summaryrefslogtreecommitdiff
path: root/erts/etc/win32/msys_tools/w32_path.sh
diff options
context:
space:
mode:
authorDan Gudmundsson <dgud@erlang.org>2019-11-14 09:20:02 +0100
committerDan Gudmundsson <dgud@erlang.org>2019-11-14 09:20:02 +0100
commitafb9501f99bf94b05f999cd341dade721f69d023 (patch)
treeea7108658df4152cfbde5e84bf010045dac6ff58 /erts/etc/win32/msys_tools/w32_path.sh
parent9adc0b044a1e2a01537775b8076bee29586b4870 (diff)
parent78354470a93df501d7803d3a3e51f199ec8c9475 (diff)
downloaderlang-afb9501f99bf94b05f999cd341dade721f69d023.tar.gz
Merge branch 'dgud/cleanup-windows-build'
* dgud/cleanup-windows-build: Refactor otp_build env_win32 Speedup depend.mk creation Refactor win32 configure handling
Diffstat (limited to 'erts/etc/win32/msys_tools/w32_path.sh')
-rwxr-xr-xerts/etc/win32/msys_tools/w32_path.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/erts/etc/win32/msys_tools/w32_path.sh b/erts/etc/win32/msys_tools/w32_path.sh
new file mode 100755
index 0000000000..9a5089391d
--- /dev/null
+++ b/erts/etc/win32/msys_tools/w32_path.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+WIN32=false
+SEPARATOR=""
+ABSOLUTE=""
+UNIX=false
+done=false
+while [ $done = false ]; do
+ case "$1" in
+ -w)
+ WIN32=true;
+ SEPARATOR=backslash;
+ shift;;
+ -d)
+ WIN32=true;
+ SEPARATOR=double;
+ shift;;
+ -m)
+ WIN32=true;
+ SEPARATOR=slash;
+ shift;;
+ -u)
+ UNIX=true;
+ shift;;
+ -a)
+ ABSOLUTE="-a";
+ shift;;
+
+ *)
+ done=true;;
+ esac
+done
+
+if [ $WIN32 = false -a $UNIX = false ]; then
+ echo "Usage: $0 -m|-w|-d|-u [-a] <path>" >&2
+ exit 1;
+fi
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 -m|-w|-u [-a] <path>" >&2
+ exit 1;
+fi
+
+if [ $UNIX = true ]; then
+ echo `win2msys_path.sh $ABSOLUTE $1`
+else
+ case "$SEPARATOR" in
+ slash)
+ echo `msys2win_path.sh -m $ABSOLUTE -m $1`;
+ ;;
+ backslash)
+ echo `msys2win_path.sh $ABSOLUTE $1`;
+ ;;
+ double)
+ DOUBLE=`msys2win_path.sh $ABSOLUTE $1 | sed 's,\\\\,\\\\\\\\,g'`;
+ echo $DOUBLE
+ ;;
+ esac
+fi