summaryrefslogtreecommitdiff
path: root/mozilla/nsprpub/build/cygwin-wrapper
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2011-08-09 15:52:57 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-09-25 08:55:51 +0000
commitc52067ca0b79daf6ffae5376481e6fef74849254 (patch)
tree9a4b19451eb85dcd6e16afb9d49a45a2f4f5aa83 /mozilla/nsprpub/build/cygwin-wrapper
parent40d4517c5b760454c076064fac192b28a22e7a37 (diff)
downloadnspr-c52067ca0b79daf6ffae5376481e6fef74849254.tar.gz
Imported from /srv/lorry/lorry-area/nspr/nspr-4.8.9.tar.gz.HEADnspr-4.8.9master
Diffstat (limited to 'mozilla/nsprpub/build/cygwin-wrapper')
-rwxr-xr-xmozilla/nsprpub/build/cygwin-wrapper75
1 files changed, 75 insertions, 0 deletions
diff --git a/mozilla/nsprpub/build/cygwin-wrapper b/mozilla/nsprpub/build/cygwin-wrapper
new file mode 100755
index 0000000..679f0a1
--- /dev/null
+++ b/mozilla/nsprpub/build/cygwin-wrapper
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Stupid wrapper to avoid win32 dospath/cygdrive issues
+# Try not to spawn programs from within this file. If the stuff in here looks royally
+# confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643
+# and look at the older versions of this file that are easier to read, but
+# do basically the same thing
+#
+
+prog=$1
+shift
+if test -z "$prog"; then
+ exit 0
+fi
+
+# If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
+mountpoint=$CYGDRIVE_MOUNT
+if test -z "$mountpoint"; then
+ mountpoint=`mount -p`
+ if test -z "$mountpoint"; then
+ print "Cannot determine cygwin mount points. Exiting"
+ exit 1
+ fi
+fi
+
+# Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
+mountpoint=${mountpoint#*/}
+mountpoint=/${mountpoint%%[!A-Za-z0-9_]*}
+mountpoint=${mountpoint%/}
+
+args=""
+up=""
+if test "${prog}" = "-up"; then
+ up=1
+ prog=${1}
+ shift
+fi
+
+process=1
+
+# Convert the mountpoint in parameters to Win32 filenames
+# For instance: /cygdrive/c/foo -> c:/foo
+for i in "${@}"
+do
+ if test "${i}" = "-wrap"; then
+ process=1
+ else
+ if test "${i}" = "-nowrap"; then
+ process=
+ else
+ if test -n "${process}"; then
+ if test -n "${up}"; then
+ pathname=${i#-I[a-zA-Z]:/}
+ if ! test "${pathname}" = "${i}"; then
+ no_i=${i#-I}
+ driveletter=${no_i%%:*}
+ i=-I${mountpoint}/${driveletter}/${pathname}
+ fi
+ else
+ eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
+ if ! test "${leader}" = "${i}"; then
+ eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
+ eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
+ driveletter=${no_mountpoint%%/*}
+ i=${leader}${driveletter}:/${pathname}
+ fi
+ fi
+ fi
+
+ args="${args} ${i}"
+ fi
+ fi
+done
+
+exec $prog $args