diff options
author | Bruno Haible <bruno@clisp.org> | 2010-09-04 11:16:43 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-09-04 11:16:43 +0200 |
commit | e3834e1ce49d8e31b3e69a02ef59d77f2861b6b2 (patch) | |
tree | 32bd09bfbe0b33febde62a4358b2f8bf92dd675b /build-aux/relocatable.sh.in | |
parent | 60b4ba664df4642893c35ae81dd47ff3396d40ec (diff) | |
download | gnulib-e3834e1ce49d8e31b3e69a02ef59d77f2861b6b2.tar.gz |
Set PATH_SEPARATOR the same way autoconf does.
* build-aux/relocatable.sh.in (func_find_curr_installdir): Determine
the value of PATH_SEPARATOR the same way autoconf-generated configure
scripts do.
* m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise.
* m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Likewise.
Diffstat (limited to 'build-aux/relocatable.sh.in')
-rw-r--r-- | build-aux/relocatable.sh.in | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/build-aux/relocatable.sh.in b/build-aux/relocatable.sh.in index 16f98e6a87..ecfc2ccaca 100644 --- a/build-aux/relocatable.sh.in +++ b/build-aux/relocatable.sh.in @@ -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 |