Fixup incorrect ordering of directories in toll and library paths.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@27167 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-11-28 12:18:38 +00:00
parent 191b868240
commit 2f1c36af26
2 changed files with 29 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-11-28 Richard Frith-Macdonald <rfm@gnu.org>
* print_unique_pathlist.sh: Reverse the order of the path fragments
so that, when the caller iterates through them and prepends them to
other paths, they end up prepended in the correct order.
2008-11-13 Richard Frith-Macdonald <rfm@gnu.org>
* Documentation/README.MingW: Change instructions to use libffi

View file

@ -28,6 +28,11 @@
# from Win32 to Unix style), and prints the 4 paths separated by ':',
# removing duplicates.
# The order of the paths printed is the REVERSE of the order in which
# they were supplied, this is so that code which iterates through them
# prepending them to a PATH will leave them in the correct order in
# that path.
# GNUSTEP_MAKEFILES needs to be defined when you execute this script.
if [ ! $# -eq 5 ]; then
@ -79,4 +84,22 @@ if [ "$GS_MAKE_PATH_4" != "$GS_MAKE_PATH_1" ]; then
fi
fi
# Now reverse the order of the path fragments so that the calling code
# can iterate through them and prepend each in turn to another path.
old_IFS="$IFS"
IFS=:
reversed=""
for dir in $GS_MAKE_RESULT; do
path_fragment="$dir"
if [ -z "$reversed" ]; then
reversed="$path_fragment"
else
reversed="$path_fragment:$reversed"
fi
done
GS_MAKE_RESULT="$reversed"
IFS="$old_IFS"
unset reversed
unset old_IFS
echo "$GS_MAKE_RESULT"