@@ -10,8 +10,8 @@ mingw-w64-headers_CONFIGURE_OPTS=--prefix='$(PREFIX)/$(TARGET)/mingw'
10
10
common_CONFIGURE_OPTS=--prefix ='$(PREFIX ) /$(TARGET ) /mingw' \
11
11
--with-sysroot='$(PREFIX ) /$(TARGET ) /mingw' \
12
12
CPPFLAGS='-I$(PREFIX ) /$(TARGET ) /mingw/include' \
13
- CFLAGS='-I$(PREFIX ) /$(TARGET ) /mingw/include' \
14
- CXXFLAGS='-I$(PREFIX ) /$(TARGET ) /mingw/include' \
13
+ CFLAGS='-I$(PREFIX ) /$(TARGET ) /mingw/include -s -O3 -ffast-math ' \
14
+ CXXFLAGS='-I$(PREFIX ) /$(TARGET ) /mingw/include -s -O3 -ffast-math ' \
15
15
LDFLAGS='-L$(PREFIX ) /$(TARGET ) /mingw/lib' \
16
16
RCFLAGS='-I$(PREFIX ) /$(TARGET ) /mingw/include'
17
17
@@ -48,36 +48,32 @@ define gcc_BUILD_i686-w64-mingw32
48
48
ln -sf '$(PREFIX ) /$(TARGET ) /mingw/include/'* '$(PREFIX ) /$(TARGET ) /include'
49
49
endef
50
50
51
- # GCC does not support Windows on ARM
52
- gcc_BUILD_armv7-w64-mingw32 =
53
- gcc_BUILD_aarch64-w64-mingw32 =
54
-
55
51
define llvm-mingw_BUILD_x86_64-w64-mingw32
56
- $(subst # install the usual wrappers, ln -sf $(PREFIX ) / $( TARGET ) /mingw/bin/ * $( PREFIX ) / $( TARGET ) /bin && \
57
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib' && \
58
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/include /'* '$(PREFIX ) /$(TARGET ) /include', \
59
- $( subst @mingw-crt-config-opts@,--disable-lib32 --enable-lib64 $( common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) ) )
52
+ $(subst @mingw-crt-config-opts@,--disable-lib32 --enable-lib64 $(common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) )
53
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/bin /'* '$(PREFIX ) /$(TARGET ) /bin'
54
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib'
55
+ ln -sf ' $( PREFIX ) / $( TARGET ) /mingw/include/'* ' $( PREFIX ) / $( TARGET ) /include'
60
56
endef
61
57
62
58
define llvm-mingw_BUILD_i686-w64-mingw32
63
- $(subst # install the usual wrappers, ln -sf $(PREFIX ) / $( TARGET ) /mingw/bin/ * $( PREFIX ) / $( TARGET ) /bin && \
64
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib' && \
65
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/include /'* '$(PREFIX ) /$(TARGET ) /include', \
66
- $( subst @mingw-crt-config-opts@,--enable-lib32 --disable-lib64 $( common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) ) )
59
+ $(subst @mingw-crt-config-opts@,--enable-lib32 --disable-lib64 $(common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) )
60
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/bin /'* '$(PREFIX ) /$(TARGET ) /bin'
61
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib'
62
+ ln -sf ' $( PREFIX ) / $( TARGET ) /mingw/include/'* ' $( PREFIX ) / $( TARGET ) /include'
67
63
endef
68
64
69
65
define llvm-mingw_BUILD_armv7-w64-mingw32
70
- $(subst # install the usual wrappers, ln -sf $(PREFIX ) / $( TARGET ) /mingw/bin/ * $( PREFIX ) / $( TARGET ) /bin && \
71
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib' && \
72
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/include /'* '$(PREFIX ) /$(TARGET ) /include', \
73
- $( subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm32 $( common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) ) )
66
+ $(subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm32 $(common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) )
67
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/bin /'* '$(PREFIX ) /$(TARGET ) /bin'
68
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib'
69
+ ln -sf ' $( PREFIX ) / $( TARGET ) /mingw/include/'* ' $( PREFIX ) / $( TARGET ) /include'
74
70
endef
75
71
76
72
define llvm-mingw_BUILD_aarch64-w64-mingw32
77
- $(subst # install the usual wrappers, ln -sf $(PREFIX ) / $( TARGET ) /mingw/bin/ * $( PREFIX ) / $( TARGET ) /bin && \
78
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib' && \
79
- ln -sf '$(PREFIX ) /$(TARGET ) /mingw/include /'* '$(PREFIX ) /$(TARGET ) /include', \
80
- $( subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm64 $( common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) ) )
73
+ $(subst @mingw-crt-config-opts@,--disable-lib32 --disable-lib64 --enable-libarm64 $(common_CONFIGURE_OPTS ) , $( llvm-mingw_BUILD_mingw-w64 ) )
74
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/bin /'* '$(PREFIX ) /$(TARGET ) /bin'
75
+ ln -sf '$(PREFIX ) /$(TARGET ) /mingw/lib /'* '$(PREFIX ) /$(TARGET ) /lib'
76
+ ln -sf ' $( PREFIX ) / $( TARGET ) /mingw/include/'* ' $( PREFIX ) / $( TARGET ) /include'
81
77
endef
82
78
83
79
# # Update dependencies
@@ -280,7 +276,7 @@ zlib_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST))
280
276
# Added: mingw-std-threads, libjpeg-turbo, lcms
281
277
# librsvg:
282
278
# Removed: libcroco, libgsf
283
- # Added: libxml2
279
+ # Added: libxml2, rust
284
280
# libwebp:
285
281
# Added: gettext
286
282
# Cairo:
@@ -304,22 +300,36 @@ openexr_DEPS := cc ilmbase zlib $(BUILD)~cmake
304
300
ilmbase_DEPS := cc $(BUILD ) ~cmake
305
301
pango_DEPS := $(pango_DEPS ) fribidi
306
302
poppler_DEPS := cc mingw-std-threads cairo libjpeg-turbo freetype glib openjpeg lcms libpng tiff zlib
307
- librsvg_DEPS := cc cairo gdk-pixbuf glib pango libxml2
303
+ librsvg_DEPS := $( filter-out libcroco libgsf , $( librsvg_DEPS ) ) libxml2 rust
308
304
libwebp_DEPS := $(libwebp_DEPS ) gettext
309
305
cairo_DEPS := cc fontconfig freetype-bootstrap glib libpng pixman
310
- hdf5_DEPS := cc zlib $(BUILD ) ~cmake
311
- x265_DEPS := cc $(BUILD ) ~nasm
306
+ hdf5_DEPS := $( filter-out pthreads , $( hdf5_DEPS ) ) $(BUILD ) ~cmake
307
+ x265_DEPS := $( subst yasm, $(BUILD ) ~nasm, $( x265_DEPS ) )
312
308
313
309
# # Override build scripts
314
310
311
+ # libasprintf isn't needed, so build with --disable-libasprintf
312
+ define gettext_BUILD
313
+ cd '$(SOURCE_DIR ) ' && autoreconf -fi
314
+ cd '$(BUILD_DIR ) ' && '$(SOURCE_DIR ) /gettext-runtime/configure' \
315
+ $(MXE_CONFIGURE_OPTS ) \
316
+ --enable-threads=win32 \
317
+ --without-libexpat-prefix \
318
+ --without-libxml2-prefix \
319
+ --disable-libasprintf \
320
+ CONFIG_SHELL=$(SHELL )
321
+ $(MAKE ) -C '$(BUILD_DIR ) /intl' -j '$(JOBS ) '
322
+ $(MAKE ) -C '$(BUILD_DIR ) /intl' -j 1 install
323
+ endef
324
+
315
325
# disable version script on llvm-mingw
316
326
define libffi_BUILD
317
327
# build and install the library
318
328
cd '$(BUILD_DIR ) ' && $(SOURCE_DIR ) /configure \
319
329
$(MXE_CONFIGURE_OPTS ) \
320
330
--disable-multi-os-directory \
321
331
$(if $(BUILD_STATIC ) , --disable-raw-api) \
322
- $(if $(findstring posix, $( TARGET ) ) , --disable-symvers)
332
+ $(if $(IS_LLVM ) , --disable-symvers)
323
333
324
334
$(MAKE ) -C '$(BUILD_DIR ) ' -j '$(JOBS ) '
325
335
$(MAKE ) -C '$(BUILD_DIR ) ' -j 1 install
@@ -457,23 +467,14 @@ define lcms_BUILD
457
467
$(MAKE ) -C '$(BUILD_DIR ) ' -j 1 install $(MXE_DISABLE_PROGRAMS )
458
468
endef
459
469
460
- define imagemagick_REVISION
461
- $(SED ) -n 's/MAGICK_GIT_REVISION=\(.*\)/\1/p' $(SOURCE_DIR ) /configure
462
- endef
463
-
464
470
# disable largefile support, we rely on vips for that and ImageMagick's
465
471
# detection does not work when cross-compiling
466
472
# build with jpeg-turbo and without lzma
467
473
# disable POSIX threads with --without-threads, use Win32 threads instead
468
474
# exclude deprecated methods in MagickCore API
469
475
define imagemagick_BUILD
470
- $(SED ) -i "s|\(\[MAGICK_GIT_REVISION\],\).*\]|\1['$(shell $(imagemagick_REVISION ) ) ']|" $(SOURCE_DIR ) /configure.ac
471
-
472
476
# avoid linking against -lgdi32, see: https://github.com/kleisauke/net-vips/issues/61
473
- $(SED ) -i 's,-lgdi32,,g' $(SOURCE_DIR ) /configure.ac
474
-
475
- # need to regenerate the configure script
476
- cd '$(SOURCE_DIR ) ' && autoreconf -fi
477
+ $(SED ) -i 's,-lgdi32,,g' $(SOURCE_DIR ) /configure
477
478
478
479
cd '$(BUILD_DIR ) ' && $(SOURCE_DIR ) /configure \
479
480
$(MXE_CONFIGURE_OPTS ) \
@@ -536,22 +537,32 @@ endef
536
537
537
538
# compile with the Rust toolchain
538
539
define librsvg_BUILD
540
+ # We need to explicitly link against msvcrt-os after commit ae95d7c
541
+ # on the mingw-w64 repo. Otherwise the __ms_vsnprintf symbol is
542
+ # undefined during linking. The standard library of Rust appears
543
+ # to link against this symbol by default.
544
+ # Note: this can probably be removed when the standard library of
545
+ # Rust is build with the latest mingw-w64 version (> v7.0.0).
546
+ # TODO: Could we use this instead?:
547
+ # LDFLAGS='$(LDFLAGS) -Wl,-u,___mingw_vsnprintf -Wl,--defsym,___ms_vsnprintf=___mingw_vsnprintf'
548
+ $(if $(IS_LLVM ) , \
549
+ $(SED ) -i 's/^\(Libs:.* \) /\1 -lmsvcrt-os/' '$(SOURCE_DIR ) /librsvg.pc.in')
550
+
539
551
cd '$(BUILD_DIR ) ' && $(SOURCE_DIR ) /configure \
540
552
$(MXE_CONFIGURE_OPTS ) \
541
553
--disable-pixbuf-loader \
542
554
--disable-gtk-doc \
543
555
--disable-introspection \
544
556
--disable-tools \
545
- RUST_TARGET=$(firstword $(subst -, ,$(TARGET ) ) ) -pc-windows-gnu
557
+ RUST_TARGET='$(PROCESSOR ) -pc-windows-gnu' \
558
+ CARGO='$(TARGET ) -cargo' \
559
+ RUSTC='$(TARGET ) -rustc' \
560
+ $(if $(IS_LLVM ) , LIBS='-lmsvcrt-os -lucrt')
546
561
547
562
$(MAKE ) -C '$(BUILD_DIR ) ' -j '$(JOBS ) '
548
563
$(MAKE ) -C '$(BUILD_DIR ) ' -j 1 $(INSTALL_STRIP_LIB )
549
564
endef
550
565
551
- # TODO: Rust MinGW-w64 ARM/ARM64 targets are not yet supported
552
- librsvg_BUILD_armv7-w64-mingw32 =
553
- librsvg_BUILD_aarch64-w64-mingw32 =
554
-
555
566
# compile with CMake and with libjpeg-turbo
556
567
define poppler_BUILD
557
568
$(if $(findstring win32,$(TARGET ) ) ,\
@@ -707,7 +718,7 @@ define libxml2_BUILD
707
718
--without-debug \
708
719
--without-python \
709
720
--without-threads \
710
- $(if $(findstring posix, $( TARGET ) ) , --disable-ld-version-script)
721
+ $(if $(IS_LLVM ) , --disable-ld-version-script)
711
722
$(MAKE ) -C '$(BUILD_DIR ) ' -j '$(JOBS ) ' $(MXE_DISABLE_CRUFT )
712
723
$(MAKE ) -C '$(BUILD_DIR ) ' -j 1 install $(MXE_DISABLE_CRUFT )
713
724
ln -sf '$(PREFIX ) /$(TARGET ) /bin/xml2-config' '$(PREFIX ) /bin/$(TARGET ) -xml2-config'
@@ -849,7 +860,7 @@ define hdf5_BUILD
849
860
-DH5_LLONG_TO_LDOUBLE_CORRECT=ON \
850
861
-DH5_DISABLE_SOME_LDOUBLE_CONV=OFF \
851
862
-DH5_NO_ALIGNMENT_RESTRICTIONS=ON \
852
- -DH5_HAVE_IOEO=$(if $(findstring posix, $( TARGET ) ) ,1,0) \
863
+ -DH5_HAVE_IOEO=$(if $(IS_LLVM ) ,1,0) \
853
864
-DTEST_LFS_WORKS_RUN=0 \
854
865
-DHDF5_ENABLE_THREADSAFE=ON \
855
866
-DHDF5_USE_PREGEN=ON \
0 commit comments