summaryrefslogtreecommitdiff
path: root/build/cygwin-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'build/cygwin-wrapper')
-rwxr-xr-xbuild/cygwin-wrapper23
1 files changed, 23 insertions, 0 deletions
diff --git a/build/cygwin-wrapper b/build/cygwin-wrapper
new file mode 100755
index 00000000..3da3c508
--- /dev/null
+++ b/build/cygwin-wrapper
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Stupid wrapper to avoid win32 dospath/cygdrive issues
+#
+prog=$1
+shift
+if test -z "$prog"; then
+ exit 0
+fi
+mountpoint=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
+if test -z "$mountpoint"; then
+ print "Cannot determine cygwin mount points. Exiting"
+ exit 1
+fi
+mountpoint=`echo $mountpoint | sed 's|/$||'`
+if test "$prog" = "-up"; then
+ prog=$1
+ shift
+ args=`echo $* | sed -e "s|-I\([a-zA-Z]\):/|-I${mountpoint}/\1/|g;"`
+else
+ args=`echo $* | sed -e "s|${mountpoint}/\([a-zA-Z]\)/|\1:/|g;"`
+fi
+exec $prog $args