some shells (e.g., Solaris 8 /bin/sh) implement it verrrry slowly.
Instead, just list the shells that we know work.
* tests/local.at (AT_CHECK_SHELL_SYNTAX): Remove 2nd arg. All uses
changed. Be more cautious about the _cv_ variable.
* tests/tools.at (Syntax of the shell scripts): Check the
_cv_ variable once, at first, to avoid an internal autoconf error
when sh -n does not work.
+2006-04-18 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac (ac_cv_sh_n_works): Don't try to test for it, since
+ some shells (e.g., Solaris 8 /bin/sh) implement it verrrry slowly.
+ Instead, just list the shells that we know work.
+ * tests/local.at (AT_CHECK_SHELL_SYNTAX): Remove 2nd arg. All uses
+ changed. Be more cautious about the _cv_ variable.
+ * tests/tools.at (Syntax of the shell scripts): Check the
+ _cv_ variable once, at first, to avoid an internal autoconf error
+ when sh -n does not work.
+
2006-04-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* lib/Autom4te/FileUtils.pm: Sync from Automake.
# Process this file with autoconf to produce a configure script.
# Copyright (C) 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003,
-# 2004 Free Software Foundation, Inc.
+# 2004, 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# $ time sh -nx endless.sh
# ^Csh -nx endless.sh 3,67s user 0,03s system 63% cpu 5,868 total
#
+# Also, some implementations of /bin/sh (e.g., Solaris 8) are soooo slow
+# that they are unusable on large scripts like our testsuite.
+
# So before using `/bin/sh -n' to check our scripts, we first check
-# that `/bin/sh -n' is not broken to death.
-
-# A script that never returns. We don't care that it never returns,
-# broken /bin/sh loop equally with `false', but it makes it easier to
-# test the robustness in a good environment: just remove the `-n'.
-AC_CACHE_CHECK([whether sh -n works], ac_cv_sh_n_works,
-[cat > conftest.sh <<_CONFEOF_
-while :
-do
- :
-done
-_CONFEOF_
-
-(/bin/sh -n conftest.sh) &
-sleep 2
-if kill $! >/dev/null 2>&1; then
- # We managed to kill the child, which means that we probably
- # can't trust `/bin/sh -n', hence the test failed.
- ac_cv_sh_n_works=no
-else
- ac_cv_sh_n_works=yes
+# that `/bin/sh -n' is known to not have these problems.
+
+AC_CACHE_CHECK([whether /bin/sh -n is known to work], ac_cv_sh_n_works,
+[if (
+ unset BASH_VERSION ZSH_VERSION
+ /bin/sh -c '
+ test -n "${BASH_VERSION+set}" || # Bash
+ test -n "${KSH_VERSION+set}" || # pdksh
+ test -n "${ZSH_VERSION+set}" || # zsh
+ test -n "${.sh.version}" # ksh93; put this last since its syntax is dodgy
+ '
+ ) 2>/dev/null
+then ac_cv_sh_n_works=yes
+else ac_cv_sh_n_works=no
fi
-rm conftest.sh
])
AC_SUBST(ac_cv_sh_n_works)
## Testing syntax. ##
## ---------------- ##
-# AT_CHECK_SHELL_SYNTAX(PROGRAM, ALT-COMMAND)
-# -------------------------------------------
+# AT_CHECK_SHELL_SYNTAX(PROGRAM)
+# ------------------------------
# If the shell handles `-n' well, use it to check the syntax of PROGRAM;
-# otherwise, run ALT-COMMAND.
+# otherwise, do nothing.
m4_define([AT_CHECK_SHELL_SYNTAX],
-[AS_IF([test x"$ac_cv_sh_n_works" != xno],
- [AT_CHECK([/bin/sh -n $1], 0)], [$2])])
+[AS_IF([test "$ac_cv_sh_n_works" = yes],
+ [AT_CHECK([/bin/sh -n $1])])])
m4_define([AT_CHECK_PERL_SYNTAX],
[AT_CHECK([autom4te_perllibdir=$abs_top_srcdir/lib $PERL -c $abs_top_builddir/bin/$1],
AT_SETUP([Syntax of the shell scripts])
+AT_CHECK([test "$ac_cv_sh_n_works" = yes || exit 77])
+
# Specify the absolute name of the tool, as some shells don't honor PATH when
# running `sh PROG'.
-AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/bin/autoconf], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/autoconf], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/testsuite], exit 77)
+AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/bin/autoconf])
+AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/autoconf])
+AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/testsuite])
# These are not built, they are in the src tree.
-AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/install-sh], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/mkinstalldirs], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/missing], exit 77)
+AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/install-sh])
+AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/mkinstalldirs])
+AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/missing])
AT_CLEANUP