aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/win32/msys_tools/win2msys_path.sh
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2011-12-02 15:27:13 +0100
committerPatrik Nyblom <[email protected]>2011-12-02 15:27:40 +0100
commit0d273c54d93fd0ddf03f98d138f302442a0f65f9 (patch)
tree635977fc0ef2b8236c9d619c014a8b9f1d07af42 /erts/etc/win32/msys_tools/win2msys_path.sh
parent86cd971ea4fee5fb596cd06e0dc8da60f4cf65d1 (diff)
parent42286b769c3cb6b9f8dd2dccf31e4232d6795d4e (diff)
downloadotp-0d273c54d93fd0ddf03f98d138f302442a0f65f9.tar.gz
otp-0d273c54d93fd0ddf03f98d138f302442a0f65f9.tar.bz2
otp-0d273c54d93fd0ddf03f98d138f302442a0f65f9.zip
Merge branch 'pan/win64-port'
* pan/win64-port: Update static cache Back to not using 32bit time_t Remove ancient WaitForInputIdle workaround Iron out bugs in Win64 found in daily builds Make Win64 build work both under MSYS and Cygwin Fix aclocal.m4 to override changes in opu Make whole of OTP build and release on Win64 Get cerl and distribution working in Win64 Get working prompt in Win64 using bootstrap code Build Win64 Erlang emulator using MSYS Add static win64 cache OTP-9130 OTP-9766
Diffstat (limited to 'erts/etc/win32/msys_tools/win2msys_path.sh')
-rw-r--r--erts/etc/win32/msys_tools/win2msys_path.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/erts/etc/win32/msys_tools/win2msys_path.sh b/erts/etc/win32/msys_tools/win2msys_path.sh
new file mode 100644
index 0000000000..6558a15ecd
--- /dev/null
+++ b/erts/etc/win32/msys_tools/win2msys_path.sh
@@ -0,0 +1,38 @@
+#! /bin/bash
+if [ -z "$1" ]; then
+ echo "Usage: $0 <path>" >&2
+ exit 1;
+fi
+
+MSYS_PATH=`echo "$1" | sed 's,^\([a-zA-Z]\):\\\\,/\L\1/,;s,\\\\,/,g'`
+if [ -z "$MSYS_PATH" ]; then
+ echo "$0: Could not translate $1 to msys format" >&2
+ exit 2;
+fi
+
+DELBLANK=`echo "$MSYS_PATH" | sed 's, ,,g'`
+
+if [ "X$DELBLANK" != "X$MSYS_PATH" ]; then
+ if [ -d "$MSYS_PATH" ]; then
+ C1=`(cd "$MSYS_PATH" && cmd //C "for %i in (".") do @echo %~fsi")`
+ MSYS_PATH=`echo "$C1" | sed 's,^\([a-zA-Z]\):\\\\,/\L\1/,;s,\\\\,/,g'`
+ else
+ MSYS_DIR=`dirname "$MSYS_PATH"`
+ MSYS_FILE=`basename "$MSYS_PATH"`
+ if [ -d "$MSYS_DIR" ]; then
+ C1=`(cd "$MSYS_DIR" && cmd //C "for %i in (".") do @echo %~fsi")`
+ BAT_FILE=/tmp/w$$.bat
+ # I simply cannot get the quoting right for this,
+ # need an intermediate bat file
+ cat > $BAT_FILE <<EOF
+@echo off
+for %%i in ("$MSYS_FILE") do @echo %%~snxi
+EOF
+ C2=`(cd "$MSYS_DIR" && cmd //C $BAT_FILE)`
+ rm -f $BAT_FILE
+ MSYS_PATH=`echo "$C1/$C2" | sed 's,^\([a-zA-Z]\):\\\\,/\L\1/,;s,\\\\,/,g;s," ", ,g'`
+ fi
+ fi
+fi
+echo $MSYS_PATH
+exit 0 \ No newline at end of file