From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- mingw_conf.sh | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 mingw_conf.sh (limited to 'mingw_conf.sh') diff --git a/mingw_conf.sh b/mingw_conf.sh new file mode 100644 index 000000000..3af7de099 --- /dev/null +++ b/mingw_conf.sh @@ -0,0 +1,82 @@ +# MINGW Settings: +# Due to inconsistencies between distributions, mingw versions, binaries, +# and directories must be determined (or defined) prior to building. + +# This script expects the following variables: +# * OS - currently ubuntu or suse. In the future we may attempt to detect the +# platform. +# * MINGW_CMAKE_FILE - if set, a cmake toolchain file will be created +# * MINGW_POSIX_FLAGS - if set, Mingw Posix compatibility mode will be +# enabled by defining the according flags. + +# -Common mingw settings- +MINGW_PREFIX="x86_64-w64-mingw32-" +MINGW_BASE="x86_64-w64-mingw32" +MINGW_CPP="${MINGW_BASE}-c++" +MINGW_DLLTOOL="${MINGW_BASE}-dlltool" +MINGW_WINDRES="${MINGW_BASE}-windres" +MINGW_STRIP="${MINGW_BASE}-strip" +MINGW_OBJCOPY="${MINGW_BASE}-objcopy" +# -Distribution specific mingw settings- +case "$OS" in + ubuntu) + mingwPosix="-posix" + mingwLibDir="/usr/lib/gcc" + mingwVersion="$(${MINGW_CPP}${mingwPosix} -dumpversion)" + mingwTargetLibDir="${mingwLibDir}/${MINGW_BASE}/${mingwVersion}" + mingwLibpthreadDir="/usr/${MINGW_BASE}/lib" + PTW32Include=/usr/share/mingw-w64/include + PTW32Lib=/usr/x86_64-w64-mingw32/lib + ;; + suse) + mingwPosix="" + mingwLibDir="/usr/lib64/gcc" + mingwVersion="$(${MINGW_CPP}${mingwPosix} -dumpversion)" + mingwTargetLibDir="/usr/${MINGW_BASE}/sys-root/mingw/bin" + mingwLibpthreadDir="$mingwTargetLibDir" + PTW32Include=/usr/x86_64-w64-mingw32/sys-root/mingw/include + PTW32Lib=/usr/x86_64-w64-mingw32/sys-root/mingw/lib + ;; + *) + echo "$ID is unknown, automatic mingw configuration is not possible." + exit 1 + ;; +esac +# -Common mingw settings, dependent upon distribution specific settings- +MINGW_FIND_ROOT_LIB_PATH="${mingwLibDir}/\${TOOLCHAIN_PREFIX}/${mingwVersion}" +MINGW_CC="${MINGW_BASE}-gcc${mingwPosix}" +MINGW_CXX="${MINGW_BASE}-g++${mingwPosix}" +# End MINGW configuration + + +if [[ -n $MINGW_CMAKE_FILE ]]; then + cat > $MINGW_CMAKE_FILE <> $MINGW_CMAKE_FILE <