Moved code to search for cygpath so that we only search for it if we need it

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@12181 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2002-01-22 00:50:41 +00:00
parent c42f278f3c
commit d1e194845d

View file

@ -48,32 +48,6 @@ if [ -z "$GNUSTEP_USER_ROOT" ]; then
fi
fi
save_ifs="$IFS"; IFS=":"
cygpath=
word=cygpath.exe
dummy="$PATH"
for dir in $dummy; do
test -z "$dir" && dir=.
if test -f $dir/$word; then
cygpath=$word
break
fi
done
# Because this file is sourced rather than executed, we need to unset
# every temporary variable when we are done with it, otherwise they
# pollute the calling environment!
unset word
unset dummy
unset dir
IFS="$save_ifs"
unset save_ifs
if [ -z "$cygpath" ]; then
cygpath=$GNUSTEP_MAKEFILES/cygpath.sh
fi
# test to see if GNUSTEP_ROOT is in Win32 standard form and flag it
if [ -z "`echo $GNUSTEP_SYSTEM_ROOT | sed 's|^[a-zA-Z]:/.*$||'`" ]; then
convert_win_paths=yes
@ -91,6 +65,9 @@ if [ -z "$GNUSTEP_HOST" ]; then
GNUSTEP_HOST=`$GNUSTEP_MAKEFILES/config.guess`
GNUSTEP_HOST=`$GNUSTEP_MAKEFILES/config.sub $GNUSTEP_HOST`
cd $tmpdir
# Because this file is sourced rather than executed, we need to unset
# every temporary variable when we are done with it, otherwise they
# pollute the calling environment!
unset tmpdir
fi
@ -116,19 +93,46 @@ export GNUSTEP_HOST GNUSTEP_HOST_CPU GNUSTEP_HOST_VENDOR GNUSTEP_HOST_OS
#
if [ -z "$GNUSTEP_PATHPREFIX_LIST" ]; then
if [ "$convert_win_paths" = "yes" ]; then
# Find cygpath
save_ifs="$IFS"; IFS=":"
cygpath=
word=cygpath.exe
dummy="$PATH"
for dir in $dummy; do
test -z "$dir" && dir=.
if test -f $dir/$word; then
cygpath=$word
break
fi
done
unset word
unset dummy
unset dir
IFS="$save_ifs"
unset save_ifs
if [ -z "$cygpath" ]; then
cygpath=$GNUSTEP_MAKEFILES/cygpath.sh
fi
# Now use it to convert the paths
G_U_R=`$cygpath -u "$GNUSTEP_USER_ROOT"`
G_L_R=`$cygpath -u "$GNUSTEP_LOCAL_ROOT"`
G_N_R=`$cygpath -u "$GNUSTEP_NETWORK_ROOT"`
G_S_R=`$cygpath -u "$GNUSTEP_SYSTEM_ROOT"`
GNUSTEP_PATHPREFIX_LIST=$G_U_R:$G_L_R:$G_N_R:$G_S_R
unset cygpath
else
GNUSTEP_PATHPREFIX_LIST=$GNUSTEP_USER_ROOT:$GNUSTEP_LOCAL_ROOT:$GNUSTEP_NETWORK_ROOT:$GNUSTEP_SYSTEM_ROOT
fi
export GNUSTEP_PATHPREFIX_LIST
fi
unset cygpath
tmp_IFS="$IFS"
IFS=:
temp_path=