aboutsummaryrefslogtreecommitdiffstats
path: root/otp_build
diff options
context:
space:
mode:
Diffstat (limited to 'otp_build')
-rwxr-xr-xotp_build71
1 files changed, 70 insertions, 1 deletions
diff --git a/otp_build b/otp_build
index 164e0b5f4e..15f6ec7a10 100755
--- a/otp_build
+++ b/otp_build
@@ -67,6 +67,7 @@ usage ()
echo "Before trying to build on windows, consider the following option"
echo " env_win32 - echo environment settings for win32 with visual C++, use with eval"
echo " env_mingw32 - echo environment settings for win32 with MinGW, use with eval"
+ echo " env_msys64 - echo environment settings for win32 with visual C++ running msys and mingw, use with eval"
echo ""
echo "Before trying to build for vxworks, consider the following option"
echo " env_vxworks <cpu> - echo environment settings for vxworks, use with eval"
@@ -816,6 +817,63 @@ echo_env_mingw32 ()
echo_envinfo
}
+# N.B. In Erlang, and the build system, win32 means windows, so we keep
+# everything as terget win32, but add the CONFIG_SUBTYPE win64, which can
+# be handled by configure, setting WINDOWS_64BIT in headers and such
+echo_env_msys64 ()
+{
+ #echo_envinfo
+ if [ X"$SHELL" = X"" ]; then
+ echo "You need to export the shell variable first," \
+ "for bourne-like shells, type:" >&2
+ echo 'export SHELL' >&2
+ echo "and for csh-like shells, type:" >&2
+ echo 'setenv SHELL $SHELL' >&2
+ echo " - then try again." >&2
+ exit 1
+ fi
+ echo_env_erltop
+ # Try to cope with paths containing unexpected things like stray
+ # mixed paths (c:/something/bin) and quotes. Only C and D drive
+ # handled.
+ P2=`echo :$PATH | \
+ sed "s,\",,g;s,:\([a-zA-Z]\):,:/\L\1,g;s,^:,,"`
+ P3=""
+ save_pwd=`pwd`
+ save_ifs=$IFS
+ IFS=:
+ for p in $P2; do
+ if [ -d "$p" ]; then
+ #echo 'p =' "|$p|"
+ C1=`(cd "$p" && cmd //C "for %i in (".") do @echo %~fsi")`
+ #echo 'C1 =' "|$C1|"
+ C2=`echo "$C1" | sed 's,^\([a-zA-Z]\):\\\\,/\L\1/,;s,\\\\,/,g'`
+ #echo 'C2 =' "|$C2|"
+ else
+ C2=""
+ fi
+ if [ ! -z "$C2" ]; then
+ if [ -z "$P3" ];then
+ P3="$C2"
+ else
+ P3="$P3:$C2"
+ fi
+ fi
+ done
+ IFS=$save_ifs
+
+ echo_setenv OVERRIDE_TARGET win32 ';'
+ echo_setenv CONFIG_SUBTYPE win64 ';'
+ echo_setenv CC cc.sh ';'
+ echo_setenv CXX cc.sh ';'
+ echo_setenv AR ar.sh ';'
+ echo_setenv RANLIB true ';'
+ echo_setenv OVERRIDE_CONFIG_CACHE "$ERL_TOP/erts/autoconf/win64.config.cache" ';'
+ echo_setenv PATH "$ERL_TOP/erts/etc/win32/msys_tools/vc:$ERL_TOP/erts/etc/win32/msys_tools:$P3" ';'
+ echo_envinfo
+}
+
+
lookup_prog_in_path ()
{
PROG=$1
@@ -1067,8 +1125,17 @@ case $TARGET in
exit 1
fi
fi;;
+ *-mingw32)
+ if [ X"$OVERRIDE_TARGET" = X"" -a X"$1" != X"env_msys64" ];then
+ echo "Building for windows, you should do the " \
+ "following first:" >&2
+ echo 'eval `./otp_build env_msys64`' >&2
+ echo 'please note that there are backticks (``) in' \
+ 'the command'
+ exit 1
+ fi;;
*)
- ;;
+ ;;
esac
if [ ! -z "$OVERRIDE_TARGET" ]; then
@@ -1198,6 +1265,8 @@ case "$1" in
echo_env_win32;;
env_mingw32)
echo_env_mingw32;;
+ env_msys64)
+ echo_env_msys64;;
env_vxworks)
echo_env_vxworks "$2";;
env_cross)