From: arai Date: Thu, 13 Oct 2005 14:52:22 +0000 (+0000) Subject: * tests/lha-test.in: emulate POSIX shell when it is executed by X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=078c3fc503a5925005b0f5ebdc6e8c3c1811b659;p=lha%2Flha.git * tests/lha-test.in: emulate POSIX shell when it is executed by 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 --- diff --git a/configure.ac b/configure.ac index 837d024..4251b93 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/tests/Makefile.am b/tests/Makefile.am index 7f4139c..58f1e1c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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)/$@ diff --git a/tests/lha-test.in b/tests/lha-test.in index 1dc8632..37b7376 100644 --- a/tests/lha-test.in +++ b/tests/lha-test.in @@ -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@}