X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Frelocatable.sh.in;h=898f3594167744d37a5f71aa477875838102373b;hb=3bd0d48db800994cc10c3340c41d3242390dc68f;hp=291873cb8b97388f03b7c67935b05d27645e68b5;hpb=3030c5b5e0a5199e16b05927da72c43c42f211c3;p=gnulib.git diff --git a/build-aux/relocatable.sh.in b/build-aux/relocatable.sh.in index 291873cb8..898f35941 100644 --- a/build-aux/relocatable.sh.in +++ b/build-aux/relocatable.sh.in @@ -6,7 +6,7 @@ # package by hand; see doc/relocatable-maint.texi (in Gnulib) for # details. # -# Copyright (C) 2003, 2005-2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,15 +62,14 @@ func_find_curr_installdir () */* | *\\*) ;; *) # Need to look in the PATH. if test "${PATH_SEPARATOR+set}" != set; then - func_tmpdir - { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh - chmod +x "$tmp"/conf.sh - if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -rf "$tmp" + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi save_IFS="$IFS"; IFS="$PATH_SEPARATOR" for dir in $PATH; do