From e3834e1ce49d8e31b3e69a02ef59d77f2861b6b2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 4 Sep 2010 11:16:43 +0200 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ build-aux/relocatable.sh.in | 17 ++++++++--------- m4/lib-ld.m4 | 19 +++++++++---------- m4/progtest.m4 | 19 +++++++++---------- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3fdec484..3f55b0b0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-04 Bruno Haible + + 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. + 2010-09-04 Stefano Lattarini (tiny change) Set PATH_SEPARATOR the same way autoconf does. diff --git a/build-aux/relocatable.sh.in b/build-aux/relocatable.sh.in index 16f98e6a8..ecfc2ccac 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 diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 index ebb30528b..294db72e1 100644 --- a/m4/lib-ld.m4 +++ b/m4/lib-ld.m4 @@ -1,4 +1,4 @@ -# lib-ld.m4 serial 4 (gettext-0.18) +# lib-ld.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -31,15 +31,14 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # 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 ac_prog=ld if test "$GCC" = yes; then diff --git a/m4/progtest.m4 b/m4/progtest.m4 index 2d804ac99..9ffa5c020 100644 --- a/m4/progtest.m4 +++ b/m4/progtest.m4 @@ -1,4 +1,4 @@ -# progtest.m4 serial 6 (gettext-0.18) +# progtest.m4 serial 7 (gettext-0.18.2) dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -27,15 +27,14 @@ AC_DEFUN([AM_PATH_PROG_WITH_TEST], # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # 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 # Find out how to test for executable files. Don't use a zero-byte file, -- 2.11.0