]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in <startup, shell wrapper>: Add _AS_BOURNE_COMPATIBLE
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 13 Feb 2006 16:52:38 +0000 (16:52 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 13 Feb 2006 16:52:38 +0000 (16:52 +0000)
code from Autoconf, to fix issues with zsh and other shells.
Reported by David Gómez Espinosa <david@pleyades.net>.

ChangeLog
ltmain.in

index 56b3ed39eaca9007366f77a39983b8ad4676887e..9fa3542a802e3cda19f030afc9a723f5f8b77ba9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * ltmain.in <startup, shell wrapper>: Add _AS_BOURNE_COMPATIBLE
+       code from Autoconf, to fix issues with zsh and other shells.
+       Reported by David Gómez Espinosa <david@pleyades.net>.
+
 2006-02-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * ltmain.in (extracted_archives, extracted_serial): New globals.
index 981cc31293fdcf4c2b4be249b15481665a51eef3..154965004c5a44bbdc9c288d41c5a211c7fd6958 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -46,11 +46,19 @@ PACKAGE=@PACKAGE@
 VERSION=@VERSION@
 TIMESTAMP="@TIMESTAMP@"
 
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
@@ -5271,6 +5279,20 @@ EOF
 Xsed='${SED} -e 1s/^X//'
 sed_quote_subst='$sed_quote_subst'
 
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH