[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] bootstrap: set and use PATH_SEPARATOR
From: |
KO Myung-Hun |
Subject: |
[PATCH 1/4] bootstrap: set and use PATH_SEPARATOR |
Date: |
Wed, 19 Nov 2014 12:54:14 +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.
* gl/build-aux/bootstrap.in (func_check_tool): Use PATH_SEPARATOR.
* gl/build-aux/funclib.sh (Shell normalisation): Set PATH_SEPARATOR
properly.
---
bootstrap | 11 ++++++++++-
gl/build-aux/bootstrap.in | 2 +-
gl/build-aux/funclib.sh | 9 +++++++++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/bootstrap b/bootstrap
index d3e9ede..7d53153 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. ##
@@ -4582,7 +4591,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/gl/build-aux/bootstrap.in b/gl/build-aux/bootstrap.in
index 6053758..d5e01a5 100755
--- a/gl/build-aux/bootstrap.in
+++ b/gl/build-aux/bootstrap.in
@@ -2392,7 +2392,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/gl/build-aux/funclib.sh b/gl/build-aux/funclib.sh
index 3a2fa79..04edc3e 100644
--- a/gl/build-aux/funclib.sh
+++ b/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