OSDN Git Service

* tests/lha-test.in: emulate POSIX shell when it is executed by
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Thu, 13 Oct 2005 14:52:22 +0000 (14:52 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Thu, 13 Oct 2005 14:52:22 +0000 (14:52 +0000)
zsh or bash. (this part is derived from GNU Autoconf 2.59)

* tests/Makefile.am: replaced `bash' with `@sh_for_lha_test@'

* configure.ac: search shell programs to execute the lha-test.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@837 6a8cc165-1e22-0410-a132-eb4e3f353aba

configure.ac
tests/Makefile.am
tests/lha-test.in

index 837d024..4251b93 100644 (file)
@@ -16,6 +16,7 @@ AC_PROG_MAKE_SET
 AC_MINIX
 AM_C_PROTOTYPES
 AC_SYS_LARGEFILE
+AC_CHECK_PROGS(sh_for_lha_test, [zsh bash ksh pdksh], [sh])
 
 # Checks for libraries.
 AC_SEARCH_LIBS(opendir, [mingwex])
index 7f4139c..58f1e1c 100644 (file)
@@ -19,7 +19,7 @@ EXTRA_DIST =  lha-test1 \
 DISTCLEANFILES = test.log
 
 check-local:
-       bash ./lha-test
+       @sh_for_lha_test@ ./lha-test
 
 lha-test: $(top_builddir)/config.status $(srcdir)/lha-test.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
index 1dc8632..37b7376 100644 (file)
@@ -1,5 +1,18 @@
 #!/bin/bash
 
+# Be Bourne compatible
+# -- followings are derived from configure script generated by autoconf 2.59 --
+if test -n "${ZSH_VERSION+set}" && (emulate ksh) >/dev/null 2>&1; then
+  emulate ksh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
 : ${lha_dir=@top_builddir@/src}
 : ${lha_cmd=$(cd $lha_dir && pwd)/lha}
 : ${srcdir=@srcdir@}