Improve determination of PATH separator in bootstrap script.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 10 Jun 2010 18:32:54 +0000 (20:32 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 11 Jun 2010 04:31:38 +0000 (06:31 +0200)
* bootstrap: Detemine what the PATH separator is the same way
autoconf does.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
bootstrap

index d8623b2809bf2d682bf85c8f8fac77a1b1ebf996..c2d62cfbe5362a5a1faf1b742c5c8ede6aa97b02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-06-11  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       Improve determination of PATH separator in bootstrap script.
+       * bootstrap: Detemine what the PATH separator is the same way
+       autoconf does.
+
        Minor improvements in bootstrap script.
        * bootstrap: Consistently use two-spaces indentation.  Cosmetic
        improvement to comments.
index 2e4bedcb13a69ea6380e6a91e1f85600f5fecd39..7766bd3e83e314c83377143fd5e0303cd06406fd 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Find the path separator.
-echo "#! /bin/sh" >boot$$.sh
-echo  "exit 0"   >>boot$$.sh
-chmod +x boot$$.sh
-if (PATH="/nonexistent;."; boot$$.sh) >/dev/null 2>&1; then
-  PATH_SEPARATOR=';'
-else
+# (Snippet copied from configure's initialization in Autoconf 2.65)
+if test "${PATH_SEPARATOR+set}" != set; then
   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
-rm -f boot$$.sh
 
 # Don't ignore failures.
 set -e