Check-in [a8d3f02653]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge with trunk
Timelines: family | ancestors | descendants | both | wtf-8-experiment
Files: files | file ages | folders
SHA1: a8d3f02653e43a8ad7fed9024540f24e4ad3c61d
User & Date: chw 2019-09-15 11:15:48
Context
2019-09-19
04:53
merge with trunk check-in: b38083f124 user: chw tags: wtf-8-experiment
2019-09-15
11:15
merge with trunk check-in: a8d3f02653 user: chw tags: wtf-8-experiment
11:14
improve undroid/vanillawish "ebuild" mode (embedded zipfs) plus other changes check-in: 1b0257a06e user: chw tags: trunk
2019-09-13
11:58
merge with trunk check-in: f658d4913c user: chw tags: wtf-8-experiment
Changes

Changes to jni/tcl/generic/zipfs.c.

177
178
179
180
181
182
183

184
185
186
187
188
189
190
...
363
364
365
366
367
368
369























370
371
372
373
374
375
376
....
1193
1194
1195
1196
1197
1198
1199

1200

1201
1202
1203
1204
1205
1206
1207

1208

1209
1210
1211
1212
1213
1214
1215
....
1253
1254
1255
1256
1257
1258
1259

1260
1261
1262
1263




































1264
1265
1266
1267
1268
1269
1270
....
1325
1326
1327
1328
1329
1330
1331

1332
1333
1334
1335
1336
1337
1338
....
1345
1346
1347
1348
1349
1350
1351

1352
1353





1354
1355
1356
1357
1358
1359
1360
 */

typedef struct ZipFile {
    char *name;               /* Archive name */
    Tcl_Channel chan;         /* Channel handle or NULL */
    unsigned char *data;      /* Memory mapped or malloc'ed file */
    long length;              /* Length of memory mapped file */

    unsigned char *tofree;    /* Non-NULL if malloc'ed file */
    int nfiles;               /* Number of files in archive */
    int baseoffs;             /* Archive start */
    int baseoffsp;            /* Password start */
    int centoffs;             /* Archive directory start */
    char pwbuf[264];          /* Password buffer */
#if defined(_WIN32) || defined(_WIN64)
................................................................................
/*
 * Forward declarations.
 */

static ZipEntry *		ZipFSLookup(char *filename);
static ThreadSpecificData *	ZipChannelInit(void);
























 
/*
 *-------------------------------------------------------------------------
 *
 * ReadLock, WriteLock, Unlock --
 *
 *	POSIX like rwlock functions to support multiple readers
................................................................................
 */

static void
ZipFSCloseArchive(Tcl_Interp *interp, ZipFile *zf)
{
#if defined(_WIN32) || defined(_WIN64)
    if ((zf->data != NULL) && (zf->tofree == NULL)) {

	UnmapViewOfFile(zf->data);

	zf->data = NULL;
    }
    if (zf->mh != INVALID_HANDLE_VALUE) {
	CloseHandle(zf->mh);
    }
#else
    if ((zf->data != MAP_FAILED) && (zf->tofree == NULL)) {

	munmap(zf->data, zf->length);

	zf->data = MAP_FAILED;
    }
#endif
    if (zf->tofree != NULL) {
	Tcl_Free((char *) zf->tofree);
	zf->tofree = zf->data = NULL;
    }
................................................................................
#if defined(_WIN32) || defined(_WIN64)
    zf->data = NULL;
    zf->mh = INVALID_HANDLE_VALUE;
#else
    zf->data = MAP_FAILED;
#endif
    zf->length = 0;

    zf->nfiles = 0;
    zf->baseoffs = zf->baseoffsp = 0;
    zf->tofree = NULL;
    zf->pwbuf[0] = 0;




































    zf->chan = Tcl_OpenFileChannel(interp, zipname, "r", 0);
    if (zf->chan == NULL) {
	return TCL_ERROR;
    }
    if (Tcl_GetChannelHandle(zf->chan, TCL_READABLE, &handle) != TCL_OK) {
	if (Tcl_SetChannelOption(interp, zf->chan, "-translation", "binary")
	    != TCL_OK) {
................................................................................
	if (zf->data == NULL) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
				 Tcl_NewStringObj("file mapping failed", -1));
	    }
	    goto error;
	}

#else
	zf->length = lseek((int) (long) handle, 0, SEEK_END);
	if ((zf->length == -1) || (zf->length < ZIP_CENTRAL_END_LEN)) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
				 Tcl_NewStringObj("invalid file size", -1));
	    }
................................................................................
	if (zf->data == MAP_FAILED) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
				 Tcl_NewStringObj("file mapping failed", -1));
	    }
	    goto error;
	}

#endif
    }





    p = zf->data + zf->length - ZIP_CENTRAL_END_LEN;
    while (p >= zf->data) {
	if (*p == (ZIP_CENTRAL_END_SIG & 0xFF)) {
	    if (ZipReadInt(p) == ZIP_CENTRAL_END_SIG) {
		break;
	    }
	    p -= ZIP_SIG_LEN;







>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
|
>







>
|
>







 







>




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







 







>


>
>
>
>
>







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
...
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
....
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
....
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
....
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
....
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
 */

typedef struct ZipFile {
    char *name;               /* Archive name */
    Tcl_Channel chan;         /* Channel handle or NULL */
    unsigned char *data;      /* Memory mapped or malloc'ed file */
    long length;              /* Length of memory mapped file */
    int ismapped;             /* True when data must be unmapped */
    unsigned char *tofree;    /* Non-NULL if malloc'ed file */
    int nfiles;               /* Number of files in archive */
    int baseoffs;             /* Archive start */
    int baseoffsp;            /* Password start */
    int centoffs;             /* Archive directory start */
    char pwbuf[264];          /* Password buffer */
#if defined(_WIN32) || defined(_WIN64)
................................................................................
/*
 * Forward declarations.
 */

static ZipEntry *		ZipFSLookup(char *filename);
static ThreadSpecificData *	ZipChannelInit(void);

/*
 * For embedding a ZIP in the binary.
 */

#if defined(ZIPFS_IN_TCL) || defined(ZIPFS_IN_TK)
#if defined(MAC_OSX_TCL)
#define ZIPFS_USE_ZEMBED 1
#include <dlfcn.h>
#include <mach-o/getsect.h>
static unsigned char *_binary_zembed_start = NULL;
static unsigned char *_binary_zembed_end = NULL;
#else
#if defined(__GNUC__) && !defined(ANDROID)
#define ZIPFS_USE_ZEMBED 1
typedef unsigned char zembed_data[0];
	const zembed_data _binary_zembed_start
		__attribute__((weak));
extern	const zembed_data _binary_zembed_end
		__attribute__((weak, alias("_binary_zembed_start")));
#endif
#endif
#endif

 
/*
 *-------------------------------------------------------------------------
 *
 * ReadLock, WriteLock, Unlock --
 *
 *	POSIX like rwlock functions to support multiple readers
................................................................................
 */

static void
ZipFSCloseArchive(Tcl_Interp *interp, ZipFile *zf)
{
#if defined(_WIN32) || defined(_WIN64)
    if ((zf->data != NULL) && (zf->tofree == NULL)) {
	if (zf->ismapped) {
	    UnmapViewOfFile(zf->data);
	}
	zf->data = NULL;
    }
    if (zf->mh != INVALID_HANDLE_VALUE) {
	CloseHandle(zf->mh);
    }
#else
    if ((zf->data != MAP_FAILED) && (zf->tofree == NULL)) {
	if (zf->ismapped) {
	    munmap(zf->data, zf->length);
	}
	zf->data = MAP_FAILED;
    }
#endif
    if (zf->tofree != NULL) {
	Tcl_Free((char *) zf->tofree);
	zf->tofree = zf->data = NULL;
    }
................................................................................
#if defined(_WIN32) || defined(_WIN64)
    zf->data = NULL;
    zf->mh = INVALID_HANDLE_VALUE;
#else
    zf->data = MAP_FAILED;
#endif
    zf->length = 0;
    zf->ismapped = 0;
    zf->nfiles = 0;
    zf->baseoffs = zf->baseoffsp = 0;
    zf->tofree = NULL;
    zf->pwbuf[0] = 0;

#ifdef ZIPFS_USE_ZEMBED
    /*
     * Mount from embedded memory buffer in special case.
     */
#if defined(MAC_OSX_TCL)
    if (strcmp(zipname, Tcl_GetNameOfExecutable()) == 0) {
	Dl_info dlinfo;
	unsigned char *data = NULL;
	unsigned long size = 0;

	memset(&dlinfo, 0, sizeof(dlinfo));
	dladdr(Zipfs_Init, &dlinfo);
	data = getsectiondata(dlinfo.dli_fbase, "__TEXT", "__zipfs", &size);
	if ((data != NULL) && (size > 0)) {
	    _binary_zembed_start = data;
	    _binary_zembed_end = _binary_zembed_start + size;
	    zf->chan = NULL;
	    zf->data = _binary_zembed_start;
	    zf->length = _binary_zembed_end - _binary_zembed_start;
	    needZip = 1;
	    goto gotZembed;
	}
    }
#else
    if ((_binary_zembed_end - _binary_zembed_start > 0) &&
	(strcmp(zipname, Tcl_GetNameOfExecutable()) == 0)) {
	zf->chan = NULL;
	zf->data = (unsigned char *) _binary_zembed_start;
	zf->length = _binary_zembed_end - _binary_zembed_start;
	needZip = 1;
	goto gotZembed;
    }
#endif
#endif

    zf->chan = Tcl_OpenFileChannel(interp, zipname, "r", 0);
    if (zf->chan == NULL) {
	return TCL_ERROR;
    }
    if (Tcl_GetChannelHandle(zf->chan, TCL_READABLE, &handle) != TCL_OK) {
	if (Tcl_SetChannelOption(interp, zf->chan, "-translation", "binary")
	    != TCL_OK) {
................................................................................
	if (zf->data == NULL) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
				 Tcl_NewStringObj("file mapping failed", -1));
	    }
	    goto error;
	}
	zf->ismapped = 1;
#else
	zf->length = lseek((int) (long) handle, 0, SEEK_END);
	if ((zf->length == -1) || (zf->length < ZIP_CENTRAL_END_LEN)) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
				 Tcl_NewStringObj("invalid file size", -1));
	    }
................................................................................
	if (zf->data == MAP_FAILED) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
				 Tcl_NewStringObj("file mapping failed", -1));
	    }
	    goto error;
	}
	zf->ismapped = 1;
#endif
    }

#ifdef ZIPFS_USE_ZEMBED
gotZembed:
#endif

    p = zf->data + zf->length - ZIP_CENTRAL_END_LEN;
    while (p >= zf->data) {
	if (*p == (ZIP_CENTRAL_END_SIG & 0xFF)) {
	    if (ZipReadInt(p) == ZIP_CENTRAL_END_SIG) {
		break;
	    }
	    p -= ZIP_SIG_LEN;

Changes to jni/tcl/pkgs/tdbcodbc1.1.0/generic/fakesql.h.

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
typedef WCHAR SQLWCHAR;

typedef SQLSMALLINT SQLRETURN;

/* TODO - Check how the SQLLEN and SQLULEN types are handled on
 *        64-bit Unix. */

#if defined(__WIN64)
typedef Tcl_WideInt SQLLEN;
typedef Tcl_WideUInt SQLULEN;
#else
typedef SQLINTEGER SQLLEN;
typedef SQLUINTEGER SQLULEN;
#endif








|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
typedef WCHAR SQLWCHAR;

typedef SQLSMALLINT SQLRETURN;

/* TODO - Check how the SQLLEN and SQLULEN types are handled on
 *        64-bit Unix. */

#if defined(_WIN64)
typedef Tcl_WideInt SQLLEN;
typedef Tcl_WideUInt SQLULEN;
#else
typedef SQLINTEGER SQLLEN;
typedef SQLUINTEGER SQLULEN;
#endif

Changes to undroid/build-undroidwish-kmsdrm.sh.

1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
    # now wrap to single-file binary undroidwish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/sdl2wish.orig
    ln -s assets.zip zembed
    case $(arch) in
      i*86)
        OC_B=i386
        OC_O=elf-i386
        ;;
      x86_64)
        OC_B=i386
        OC_O=elf64-x86-64
        ;;
      arm*)
        OC_B=arm







|







1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
    # now wrap to single-file binary undroidwish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/sdl2wish.orig
    ln -s assets.zip zembed
    case $(arch) in
      i*86)
        OC_B=i386
        OC_O=elf32-i386
        ;;
      x86_64)
        OC_B=i386
        OC_O=elf64-x86-64
        ;;
      arm*)
        OC_B=arm

Changes to undroid/build-undroidwish-linux32.sh.

1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
  if test "$ACTION" = "ebuild" ; then
    # now wrap to single-file binary undroidwish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/sdl2wish.orig
    ln -s assets.zip zembed
    objcopy --rename-section .data=.const.zip \
      --set-section-flags .data=readonly,load,data,alloc,contents \
      -B i386 -I binary -O elf-i386 \
      zembed ${HERE}/sdl2tk/sdl/zembed.o
    rm -f zembed
    make -C ${HERE}/sdl2tk/sdl sdl2wish ZEMBED_OBJ=zembed.o
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/undroidwish
    mv ${HERE}/sdl2tk/sdl/sdl2wish.orig ${HERE}/sdl2tk/sdl/sdl2wish
    mv ${HERE}/sdl2tk/sdl/undroidwish . || exit 1
    $STRIP undroidwish







|







1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
  if test "$ACTION" = "ebuild" ; then
    # now wrap to single-file binary undroidwish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/sdl2wish.orig
    ln -s assets.zip zembed
    objcopy --rename-section .data=.const.zip \
      --set-section-flags .data=readonly,load,data,alloc,contents \
      -B i386 -I binary -O elf32-i386 \
      zembed ${HERE}/sdl2tk/sdl/zembed.o
    rm -f zembed
    make -C ${HERE}/sdl2tk/sdl sdl2wish ZEMBED_OBJ=zembed.o
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/undroidwish
    mv ${HERE}/sdl2tk/sdl/sdl2wish.orig ${HERE}/sdl2tk/sdl/sdl2wish
    mv ${HERE}/sdl2tk/sdl/undroidwish . || exit 1
    $STRIP undroidwish

Changes to undroid/build-undroidwish-wayland.sh.

1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
    # now wrap to single-file binary undroidwish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/sdl2wish.orig
    ln -s assets.zip zembed
    case $(arch) in
      i*86)
        OC_B=i386
        OC_O=elf-i386
        ;;
      x86_64)
        OC_B=i386
        OC_O=elf64-x86-64
        ;;
      arm*)
        OC_B=arm







|







1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
    # now wrap to single-file binary undroidwish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk/sdl/sdl2wish ${HERE}/sdl2tk/sdl/sdl2wish.orig
    ln -s assets.zip zembed
    case $(arch) in
      i*86)
        OC_B=i386
        OC_O=elf32-i386
        ;;
      x86_64)
        OC_B=i386
        OC_O=elf64-x86-64
        ;;
      arm*)
        OC_B=arm

Changes to undroid/build-vanilla-linux32.sh.

1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
....
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
  if test "$ACTION" = "ebuild" ; then
    # now wrap to single-file binary vanillatclsh by embedding tassets.zip
    # as an object in re-linked tclsh
    mv ${HERE}/tcl/unix/tclsh ${HERE}/tcl/unix/tclsh.orig
    ln -s tassets.zip zembed
    objcopy --rename-section .data=.const.zip \
      --set-section-flags .data=readonly,load,data,alloc,contents \
      -B i386 -I binary -O elf-i386 \
      zembed ${HERE}/tcl/unix/zembed.o
    rm -f zembed
    make -C ${HERE}/tcl/unix tclsh ZEMBED_OBJ=zembed.o
    mv ${HERE}/tcl/unix/tclsh ${HERE}/tcl/unix/vanillatclsh
    mv ${HERE}/tcl/unix/tclsh.orig ${HERE}/tcl/unix/tclsh
    mv ${HERE}/tcl/unix/vanillatclsh . || exit 1
    $STRIP vanillatclsh
................................................................................
  if test "$ACTION" = "ebuild" ; then
    # now wrap to single-file binary vanillawish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk.static/unix/wish ${HERE}/sdl2tk.static/unix/wish.orig
    ln -s assets.zip zembed
    objcopy --rename-section .data=.const.zip \
      --set-section-flags .data=readonly,load,data,alloc,contents \
      -B i386 -I binary -O elf-i386 \
      zembed ${HERE}/sdl2tk.static/unix/zembed.o
    rm -f zembed
    make -C ${HERE}/sdl2tk.static/unix wish ZEMBED_OBJ=zembed.o
    mv ${HERE}/sdl2tk.static/unix/wish ${HERE}/sdl2tk.static/unix/vanillawish
    mv ${HERE}/sdl2tk.static/unix/wish.orig ${HERE}/sdl2tk.static/unix/wish
    mv ${HERE}/sdl2tk.static/unix/vanillawish . || exit 1
    $STRIP vanillawish







|







 







|







1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
....
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
  if test "$ACTION" = "ebuild" ; then
    # now wrap to single-file binary vanillatclsh by embedding tassets.zip
    # as an object in re-linked tclsh
    mv ${HERE}/tcl/unix/tclsh ${HERE}/tcl/unix/tclsh.orig
    ln -s tassets.zip zembed
    objcopy --rename-section .data=.const.zip \
      --set-section-flags .data=readonly,load,data,alloc,contents \
      -B i386 -I binary -O elf32-i386 \
      zembed ${HERE}/tcl/unix/zembed.o
    rm -f zembed
    make -C ${HERE}/tcl/unix tclsh ZEMBED_OBJ=zembed.o
    mv ${HERE}/tcl/unix/tclsh ${HERE}/tcl/unix/vanillatclsh
    mv ${HERE}/tcl/unix/tclsh.orig ${HERE}/tcl/unix/tclsh
    mv ${HERE}/tcl/unix/vanillatclsh . || exit 1
    $STRIP vanillatclsh
................................................................................
  if test "$ACTION" = "ebuild" ; then
    # now wrap to single-file binary vanillawish by embedding assets.zip
    # as an object in re-linked wish
    mv ${HERE}/sdl2tk.static/unix/wish ${HERE}/sdl2tk.static/unix/wish.orig
    ln -s assets.zip zembed
    objcopy --rename-section .data=.const.zip \
      --set-section-flags .data=readonly,load,data,alloc,contents \
      -B i386 -I binary -O elf32-i386 \
      zembed ${HERE}/sdl2tk.static/unix/zembed.o
    rm -f zembed
    make -C ${HERE}/sdl2tk.static/unix wish ZEMBED_OBJ=zembed.o
    mv ${HERE}/sdl2tk.static/unix/wish ${HERE}/sdl2tk.static/unix/vanillawish
    mv ${HERE}/sdl2tk.static/unix/wish.orig ${HERE}/sdl2tk.static/unix/wish
    mv ${HERE}/sdl2tk.static/unix/vanillawish . || exit 1
    $STRIP vanillawish

Changes to undroid/build-vanilla-win32.sh.

1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424



1425
1426
1427
1428
1429
1430
1431
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cat >cross.cmake <<EOD
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
EOD



  cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" \
    -DCMAKE_TOOLCHAIN_FILE=$(pwd)/cross.cmake \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1







|




>
>
>







1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cat >cross.cmake <<EOD
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_STATIC_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
EOD
  # C++ detect is broken with some cross toolchains, thus...
  perl -pi -e 's/^project.*/project(\${OPENJPEG_NAMESPACE} C)/g' \
    ../CMakeLists.txt
  cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" \
    -DCMAKE_TOOLCHAIN_FILE=$(pwd)/cross.cmake \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1

Changes to undroid/build-vanilla-win64.sh.

1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404



1405
1406
1407
1408
1409
1410
1411
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cat >cross.cmake <<EOD
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
EOD



  cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" \
    -DCMAKE_TOOLCHAIN_FILE=$(pwd)/cross.cmake \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1







|




>
>
>







1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cat >cross.cmake <<EOD
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_STATIC_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
EOD
  # C++ detect is broken with some cross toolchains, thus...
  perl -pi -e 's/^project.*/project(\${OPENJPEG_NAMESPACE} C)/g' \
    ../CMakeLists.txt
  cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" \
    -DCMAKE_TOOLCHAIN_FILE=$(pwd)/cross.cmake \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1