* libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Since CONFIG_SHELL may
not actually be set, we should use SHELL here, also make darn sure
that SHELL is set to something. Bug from Willem Jan Palenstijn
<wpalenst@math.leidenuniv.nl>.
diff --git a/ChangeLog b/ChangeLog
index 5dbbf3f..8d5cf86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-08-04  Peter O'Gorman  <peter@pogma.com>
+
+	* libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Since CONFIG_SHELL may
+	not actually be set, we should use SHELL here, also make darn sure
+	that SHELL is set to something. Bug from Willem Jan Palenstijn
+	<wpalenst@math.leidenuniv.nl>.
+
 2004-08-03  Jacob Meuser <jakemsr@jakemsr.com>
 
 	* ltmain.in: Allow some static libraries to be used in generating a
diff --git a/libtool.m4 b/libtool.m4
index a654848..71dae45 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -695,7 +695,8 @@
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
 	       = "XX$teststring") >/dev/null 2>&1 &&
 	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
 	    lt_cv_sys_max_cmd_len=$new_result &&