2020-09-07 19:30:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-05-29 21:09:09 +00:00
|
|
|
SCRIPT_REPO="https://git.code.sf.net/p/mingw-w64/mingw-w64.git"
|
2023-07-08 15:37:10 +00:00
|
|
|
SCRIPT_COMMIT="3638d5e9a6f28354bc3e18f04ba0d97e2cc3b44c"
|
2020-09-07 19:30:40 +00:00
|
|
|
|
|
|
|
ffbuild_enabled() {
|
|
|
|
[[ $TARGET == win* ]] || return -1
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2021-04-06 01:41:36 +00:00
|
|
|
ffbuild_dockerlayer() {
|
2021-04-06 04:23:15 +00:00
|
|
|
to_df "COPY --from=${SELFLAYER} /opt/mingw/. /"
|
|
|
|
to_df "COPY --from=${SELFLAYER} /opt/mingw/. /opt/mingw"
|
2021-04-06 01:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerfinal() {
|
2021-04-06 04:23:15 +00:00
|
|
|
to_df "COPY --from=${PREVLAYER} /opt/mingw/. /"
|
2021-04-06 01:41:36 +00:00
|
|
|
}
|
|
|
|
|
2023-06-18 14:44:57 +00:00
|
|
|
ffbuild_dockerdl() {
|
2023-06-18 19:25:50 +00:00
|
|
|
to_df "RUN retry-tool sh -c \"rm -rf mingw && git clone '$SCRIPT_REPO' mingw\" && cd mingw && git checkout \"$SCRIPT_COMMIT\""
|
2023-06-18 14:44:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerbuild() {
|
|
|
|
cd "$FFBUILD_DLDIR/mingw"
|
2021-05-15 13:33:59 +00:00
|
|
|
|
|
|
|
cd mingw-w64-headers
|
2020-09-07 19:30:40 +00:00
|
|
|
|
|
|
|
unset CFLAGS
|
|
|
|
unset CXXFLAGS
|
|
|
|
unset LDFLAGS
|
|
|
|
unset PKG_CONFIG_LIBDIR
|
|
|
|
|
2021-12-06 17:23:09 +00:00
|
|
|
GCC_SYSROOT="$(${FFBUILD_CROSS_PREFIX}gcc -print-sysroot)"
|
|
|
|
|
2020-09-07 19:30:40 +00:00
|
|
|
local myconf=(
|
2021-12-06 17:23:09 +00:00
|
|
|
--prefix="$GCC_SYSROOT/usr/$FFBUILD_TOOLCHAIN"
|
2020-09-07 19:30:40 +00:00
|
|
|
--host="$FFBUILD_TOOLCHAIN"
|
2020-10-11 14:40:40 +00:00
|
|
|
--with-default-win32-winnt="0x601"
|
2023-06-03 22:44:53 +00:00
|
|
|
--with-default-msvcrt=ucrt
|
2020-09-07 19:30:40 +00:00
|
|
|
--enable-idl
|
|
|
|
)
|
|
|
|
|
2021-04-04 21:20:31 +00:00
|
|
|
./configure "${myconf[@]}"
|
|
|
|
make -j$(nproc)
|
2021-04-06 04:23:15 +00:00
|
|
|
make install DESTDIR="/opt/mingw"
|
2020-09-07 19:30:40 +00:00
|
|
|
|
|
|
|
cd ../mingw-w64-libraries/winpthreads
|
|
|
|
|
|
|
|
local myconf=(
|
2021-12-06 17:23:09 +00:00
|
|
|
--prefix="$GCC_SYSROOT/usr/$FFBUILD_TOOLCHAIN"
|
2020-09-07 19:30:40 +00:00
|
|
|
--host="$FFBUILD_TOOLCHAIN"
|
|
|
|
--with-pic
|
|
|
|
--disable-shared
|
|
|
|
--enable-static
|
|
|
|
)
|
|
|
|
|
2021-04-04 21:20:31 +00:00
|
|
|
./configure "${myconf[@]}"
|
|
|
|
make -j$(nproc)
|
2021-04-06 04:23:15 +00:00
|
|
|
make install DESTDIR="/opt/mingw"
|
2020-09-07 19:30:40 +00:00
|
|
|
}
|
2020-11-10 14:39:22 +00:00
|
|
|
|
|
|
|
ffbuild_configure() {
|
|
|
|
echo --disable-w32threads --enable-pthreads
|
|
|
|
}
|