Skip to content

Commit f144c82

Browse files
committed
Install full mingw, not just headers
1 parent 874d6d4 commit f144c82

File tree

1 file changed

+60
-27
lines changed

1 file changed

+60
-27
lines changed

scripts.d/10-mingw.sh

Lines changed: 60 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ffbuild_dockerlayer() {
1616

1717
ffbuild_dockerfinal() {
1818
[[ $TARGET == winarm* ]] && return 0
19-
to_df "COPY --from=${PREVLAYER} /opt/mingw/. /"
19+
to_df "COPY --link --from=${PREVLAYER} /opt/mingw/. /"
2020
}
2121

2222
ffbuild_dockerdl() {
@@ -26,42 +26,75 @@ ffbuild_dockerdl() {
2626
ffbuild_dockerbuild() {
2727
[[ $TARGET == winarm* ]] && return 0
2828

29-
cd mingw-w64-headers
30-
31-
unset CFLAGS
32-
unset CXXFLAGS
33-
unset LDFLAGS
34-
unset PKG_CONFIG_LIBDIR
35-
3629
if [[ -z "$COMPILER_SYSROOT" ]]; then
3730
COMPILER_SYSROOT="$(${CC} -print-sysroot)/usr/${FFBUILD_TOOLCHAIN}"
3831
fi
3932

40-
local myconf=(
41-
--prefix="$COMPILER_SYSROOT"
42-
--host="$FFBUILD_TOOLCHAIN"
43-
--with-default-win32-winnt="0x601"
44-
--with-default-msvcrt=ucrt
45-
--enable-idl
33+
unset CC CXX LD AR CPP LIBS CCAS
34+
unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS CCASFLAGS
35+
unset PKG_CONFIG_LIBDIR
36+
37+
###
38+
### mingw-w64-headers
39+
###
40+
(
41+
cd mingw-w64-headers
42+
43+
local myconf=(
44+
--prefix="$COMPILER_SYSROOT"
45+
--host="$FFBUILD_TOOLCHAIN"
46+
--with-default-win32-winnt="0x601"
47+
--with-default-msvcrt=ucrt
48+
--enable-idl
49+
--enable-sdk=all
50+
--enable-secure-api
51+
)
52+
53+
./configure "${myconf[@]}"
54+
make -j$(nproc)
55+
make install DESTDIR="/opt/mingw"
4656
)
4757

48-
./configure "${myconf[@]}"
49-
make -j$(nproc)
50-
make install DESTDIR="/opt/mingw"
58+
cp -a /opt/mingw/. /
59+
60+
###
61+
### mingw-w64-crt
62+
###
63+
(
64+
cd mingw-w64-crt
5165

52-
cd ../mingw-w64-libraries/winpthreads
66+
local myconf=(
67+
--prefix="$COMPILER_SYSROOT"
68+
--host="$FFBUILD_TOOLCHAIN"
69+
--with-default-msvcrt=ucrt
70+
--enable-wildcard
71+
)
5372

54-
local myconf=(
55-
--prefix="$COMPILER_SYSROOT"
56-
--host="$FFBUILD_TOOLCHAIN"
57-
--with-pic
58-
--disable-shared
59-
--enable-static
73+
./configure "${myconf[@]}"
74+
make -j$(nproc)
75+
make install DESTDIR="/opt/mingw"
6076
)
6177

62-
./configure "${myconf[@]}"
63-
make -j$(nproc)
64-
make install DESTDIR="/opt/mingw"
78+
cp -a /opt/mingw/. /
79+
80+
###
81+
### mingw-w64-libraries/winpthreads
82+
###
83+
(
84+
cd mingw-w64-libraries/winpthreads
85+
86+
local myconf=(
87+
--prefix="$COMPILER_SYSROOT"
88+
--host="$FFBUILD_TOOLCHAIN"
89+
--with-pic
90+
--disable-shared
91+
--enable-static
92+
)
93+
94+
./configure "${myconf[@]}"
95+
make -j$(nproc)
96+
make install DESTDIR="/opt/mingw"
97+
)
6598
}
6699

67100
ffbuild_configure() {

0 commit comments

Comments
 (0)