m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/6] bootstrap: set and use PATH_SEPARATOR


From: KO Myung-Hun
Subject: [PATCH 1/6] bootstrap: set and use PATH_SEPARATOR
Date: Wed, 19 Nov 2014 13:06:46 +0900

A PATH separator may be different in according to systems. For
examples, OS/2 uses ';'.

* bootstrap (Shell normalisation): Set PATH_SEPARATOR properly.
(func_check_tool): Use PATH_SEPARATOR.
* build-aux/gl/build-aux/bootstrap.in (func_check_tool):
Use PATH_SEPARATOR.
* build-aux/gl/build-aux/funclib.sh (Shell normalisation): Set
PATH_SEPARATOR properly.
---
 bootstrap                           | 11 ++++++++++-
 build-aux/gl/build-aux/bootstrap.in |  2 +-
 build-aux/gl/build-aux/funclib.sh   |  9 +++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/bootstrap b/bootstrap
index 3188a87..031e624 100755
--- a/bootstrap
+++ b/bootstrap
@@ -134,6 +134,15 @@ else
   bs_echo='sh -c $bs_echo_body bs_echo'
 fi
 
+# There are apparently some retarded systems that use ';' as a PATH separator!
+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
+
 
 ## ------------------------------- ##
 ## User overridable command paths. ##
@@ -4591,7 +4600,7 @@ func_check_tool ()
       ;;
     *)
       save_IFS=$IFS
-      IFS=:
+      IFS=${PATH_SEPARATOR-:}
       for _G_check_tool_path in $PATH; do
         IFS=$save_IFS
        if test -x "$_G_check_tool_path/$1"; then
diff --git a/build-aux/gl/build-aux/bootstrap.in 
b/build-aux/gl/build-aux/bootstrap.in
index df3b6db..2047913 100755
--- a/build-aux/gl/build-aux/bootstrap.in
+++ b/build-aux/gl/build-aux/bootstrap.in
@@ -2401,7 +2401,7 @@ func_check_tool ()
       ;;
     *)
       save_IFS=$IFS
-      IFS=:
+      IFS=${PATH_SEPARATOR-:}
       for _G_check_tool_path in $PATH; do
         IFS=$save_IFS
        if test -x "$_G_check_tool_path/$1"; then
diff --git a/build-aux/gl/build-aux/funclib.sh 
b/build-aux/gl/build-aux/funclib.sh
index fbaa8d0..e29ab9d 100644
--- a/build-aux/gl/build-aux/funclib.sh
+++ b/build-aux/gl/build-aux/funclib.sh
@@ -124,6 +124,15 @@ else
   bs_echo='sh -c $bs_echo_body bs_echo'
 fi
 
+# There are apparently some retarded systems that use ';' as a PATH separator!
+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
+
 
 ## ------------------------------- ##
 ## User overridable command paths. ##
-- 
1.8.5.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]