* bootstrap: Detemine what the PATH separator is the same way
autoconf does.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
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.
# 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