]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
2003-12-03 Paolo Bonzini <bonzini@gnu.org>
authorPaolo Bonzini <bonzini@gnu.org>
Thu, 25 Dec 2003 15:49:59 +0000 (15:49 +0000)
committerPaolo Bonzini <bonzini@gnu.org>
Thu, 25 Dec 2003 15:49:59 +0000 (15:49 +0000)
        * configure.ac: Test if sh -n works.
        * configure: Regenerate.
        * tests/atlocal.in: Store the result here.
        * tests/local.at (AT_CHECK_SHELL_SYNTAX): Extracted from
        tools.at, looking in atlocal's ac_cv_sh_n_works instead
        of explicitly testing.
        (AT_CHECK_PERL_SYNTAX): Moved from tools.at.
        (AT_CHECK_AUTOCONF): Test for the configure script syntax.
        * tests/tools.at (Syntax of the shell scripts): Simplify
        using AT_CHECK_SHELL_SYNTAX.
        (Syntax of the Perl scripts): Remove definition of
        AT_CHECK_PERL_SYNTAX.

ChangeLog
configure
configure.ac
tests/atlocal.in
tests/local.at
tests/tools.at

index 993b024effb54c17aaa10e4312d7f1b25f9fa96d..17accadf9a34e7c7ff04d8cc956dafc80c301c3a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2003-12-03  Paolo Bonzini  <bonzini@gnu.org>
+
+       * configure.ac: Test if sh -n works.
+       * configure: Regenerate.
+       * tests/atlocal.in: Store the result here.
+       * tests/local.at (AT_CHECK_SHELL_SYNTAX): Extracted from
+       tools.at, looking in atlocal's ac_cv_sh_n_works instead
+       of explicitly testing.
+       (AT_CHECK_PERL_SYNTAX): Moved from tools.at.
+       (AT_CHECK_AUTOCONF): Test for the configure script syntax.
+       * tests/tools.at (Syntax of the shell scripts): Simplify
+       using AT_CHECK_SHELL_SYNTAX.
+       (Syntax of the Perl scripts): Remove definition of
+       AT_CHECK_PERL_SYNTAX.
+
 2003-12-03  Paolo Bonzini  <bonzini@gnu.org>
 
        * lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_WORK): Redirect
index 749299984890338925e19fdcb79789522b707b8f..0089710bd5e4c51cfaa8e83ede550124a2106fc5 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.58a for GNU Autoconf 2.59a.
+# Generated by GNU Autoconf 2.59a for GNU Autoconf 2.59a.
 #
 # Report bugs to <bug-autoconf@gnu.org>.
 #
@@ -23,6 +23,28 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
 fi
 DUALCASE=1; export DUALCASE # for MKS sh
 
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -31,6 +53,205 @@ else
 fi
 
 
+# Find who we are.  Look in the path if we contain no path at all
+# relative or not.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if { $SHELL 2>/dev/null <<\_ASEOF
+# Be 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+"$@"}'='"$@"'
+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
+
+func_return () {
+  (exit $1)
+}
+
+func_success () {
+  func_return 0
+}
+
+func_failure () {
+  func_return 1
+}
+
+func_ret_success () {
+  return 0
+}
+
+func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if func_success; then
+  :
+else
+
+  exitcode=1
+  echo func_failure succeeded.
+
+fi
+
+if func_failure; then
+
+  exitcode=1
+  echo func_success failed.
+
+fi
+
+if func_ret_success; then
+  :
+else
+
+  exitcode=1
+  echo func_ret_success failed.
+
+fi
+
+if func_ret_failure; then
+
+  exitcode=1
+  echo func_ret_failure succeeded.
+
+fi
+
+{ (exit $exitcode); exit $exitcode; }
+_ASEOF
+}; then
+  :
+else
+
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+        case $as_dir in
+        /*)
+          if { $as_dir/$as_base 2>/dev/null <<\_ASEOF
+# Be 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+"$@"}'='"$@"'
+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
+
+func_return () {
+  (exit $1)
+}
+
+func_success () {
+  func_return 0
+}
+
+func_failure () {
+  func_return 1
+}
+
+func_ret_success () {
+  return 0
+}
+
+func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if func_success; then
+  :
+else
+
+  exitcode=1
+  echo func_failure succeeded.
+
+fi
+
+if func_failure; then
+
+  exitcode=1
+  echo func_success failed.
+
+fi
+
+if func_ret_success; then
+  :
+else
+
+  exitcode=1
+  echo func_ret_success failed.
+
+fi
+
+if func_ret_failure; then
+
+  exitcode=1
+  echo func_ret_failure succeeded.
+
+fi
+
+{ (exit $exitcode); exit $exitcode; }
+_ASEOF
+}; then
+
+            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+            CONFIG_SHELL=$as_dir/$as_base
+            export CONFIG_SHELL
+            exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+
+fi
+;;
+        esac
+       done
+done
+;;
+  *)
+
+echo Found no shell that has working shell functions.
+echo
+echo Please tell autoconf@gnu.org about your system.
+;;
+  esac
+
+fi
+
+
 # Work around bugs in pre-3.0 UWIN ksh.
 $as_unset ENV MAIL MAILPATH
 PS1='$ '
@@ -77,83 +298,12 @@ echo X/"$0" |
          s/.*/./; q'`
 
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
 
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
   as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
+  test "x$as_lineno_3"  = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
@@ -274,7 +424,7 @@ PACKAGE_STRING='GNU Autoconf 2.59a'
 PACKAGE_BUGREPORT='bug-autoconf@gnu.org'
 
 ac_unique_file="ChangeLog"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot EXPR M4 HELP2MAN PERL TEST_EMACS EMACS EMACSLOADPATH lispdir LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot ac_cv_sh_n_works EXPR M4 HELP2MAN PERL TEST_EMACS EMACS EMACSLOADPATH lispdir LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -907,7 +1057,7 @@ test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
 GNU Autoconf configure 2.59a
-generated by GNU Autoconf 2.58a
+generated by GNU Autoconf 2.59a
 
 Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -921,7 +1071,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by GNU Autoconf $as_me 2.59a, which was
-generated by GNU Autoconf 2.58a.  Invocation command line was
+generated by GNU Autoconf 2.59a.  Invocation command line was
 
   $ $0 $@
 
@@ -1109,7 +1259,9 @@ ac_signal=0
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -rf conftest* confdefs.h
 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+# NextStep 3.3 (patch 3) loses unless the first echo outputs at least 14 bytes.
+ac_space=' '
+echo "$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space$ac_space" >confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1662,6 +1814,57 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
 
 
+# We use `/bin/sh -n script' to check that there are no syntax errors
+# in the scripts.  Although incredible, there are /bin/sh that go into
+# endless loops with `-n', e.g., SunOS's:
+#
+#   $ uname -a
+#   SunOS ondine 4.1.3 2 sun4m unknown
+#   $ cat endless.sh
+#   while false
+#   do
+#     :
+#   done
+#   exit 0
+#   $ time sh endless.sh
+#   sh endless.sh  0,02s user 0,03s system 78% cpu 0,064 total
+#   $ time sh -nx endless.sh
+#   ^Csh -nx endless.sh  3,67s user 0,03s system 63% cpu 5,868 total
+#
+# 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'.
+echo "$as_me:$LINENO: checking whether sh -n works" >&5
+echo $ECHO_N "checking whether sh -n works... $ECHO_C" >&6
+if test "${ac_cv_sh_n_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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
+fi
+rm conftest.sh
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sh_n_works" >&5
+echo "${ECHO_T}$ac_cv_sh_n_works" >&6
+
+
 # Initialize the test suite and build position independent wrappers.
           ac_config_commands="$ac_config_commands tests/atconfig"
 
@@ -2213,6 +2416,28 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
 fi
 DUALCASE=1; export DUALCASE # for MKS sh
 
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -2221,6 +2446,202 @@ else
 fi
 
 
+# Find who we are.  Look in the path if we contain no path at all
+# relative or not.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+if { $SHELL 2>/dev/null <<\_ASEOF
+# Be 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+"$@"}'='"$@"'
+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
+
+func_return () {
+  (exit $1)
+}
+
+func_success () {
+  func_return 0
+}
+
+func_failure () {
+  func_return 1
+}
+
+func_ret_success () {
+  return 0
+}
+
+func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if func_success; then
+  :
+else
+
+  exitcode=1
+  echo func_failure succeeded.
+
+fi
+
+if func_failure; then
+
+  exitcode=1
+  echo func_success failed.
+
+fi
+
+if func_ret_success; then
+  :
+else
+
+  exitcode=1
+  echo func_ret_success failed.
+
+fi
+
+if func_ret_failure; then
+
+  exitcode=1
+  echo func_ret_failure succeeded.
+
+fi
+
+{ (exit $exitcode); exit $exitcode; }
+_ASEOF
+}; then
+  :
+else
+
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+        case $as_dir in
+        /*)
+          if { $as_dir/$as_base 2>/dev/null <<\_ASEOF
+# Be 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+"$@"}'='"$@"'
+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
+
+func_return () {
+  (exit $1)
+}
+
+func_success () {
+  func_return 0
+}
+
+func_failure () {
+  func_return 1
+}
+
+func_ret_success () {
+  return 0
+}
+
+func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if func_success; then
+  :
+else
+
+  exitcode=1
+  echo func_failure succeeded.
+
+fi
+
+if func_failure; then
+
+  exitcode=1
+  echo func_success failed.
+
+fi
+
+if func_ret_success; then
+  :
+else
+
+  exitcode=1
+  echo func_ret_success failed.
+
+fi
+
+if func_ret_failure; then
+
+  exitcode=1
+  echo func_ret_failure succeeded.
+
+fi
+
+{ (exit $exitcode); exit $exitcode; }
+_ASEOF
+}; then
+
+            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+            CONFIG_SHELL=$as_dir/$as_base
+            export CONFIG_SHELL
+            exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+
+fi
+;;
+        esac
+       done
+done
+;;
+  *)
+    ;;
+  esac
+
+fi
+
+
 # Work around bugs in pre-3.0 UWIN ksh.
 $as_unset ENV MAIL MAILPATH
 PS1='$ '
@@ -2267,84 +2688,12 @@ echo X/"$0" |
          s/.*/./; q'`
 
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
 
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
   as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
+  test "x$as_lineno_3"  = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
@@ -2449,7 +2798,7 @@ _ASBOX
 cat >&5 <<_CSEOF
 
 This file was extended by GNU Autoconf $as_me 2.59a, which was
-generated by GNU Autoconf 2.58a.  Invocation command line was
+generated by GNU Autoconf 2.59a.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -2507,7 +2856,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 GNU Autoconf config.status 2.59a
-configured by $0, generated by GNU Autoconf 2.58a,
+configured by $0, generated by GNU Autoconf 2.59a,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -2734,6 +3083,7 @@ s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
 s,@AWK@,$AWK,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
 s,@am__leading_dot@,$am__leading_dot,;t t
+s,@ac_cv_sh_n_works@,$ac_cv_sh_n_works,;t t
 s,@EXPR@,$EXPR,;t t
 s,@M4@,$M4,;t t
 s,@HELP2MAN@,$HELP2MAN,;t t
index 0853fc0730d83bbd687d44024443ee55884bd4bf..ff8b7763dec0260f633290cff0e2cf65192c3e73 100644 (file)
@@ -31,6 +31,50 @@ AC_CONFIG_FILES([config/Makefile])
 
 AM_INIT_AUTOMAKE([check-news 1.7.9 dist-bzip2 readme-alpha])
 
+# We use `/bin/sh -n script' to check that there are no syntax errors
+# in the scripts.  Although incredible, there are /bin/sh that go into
+# endless loops with `-n', e.g., SunOS's:
+#
+#   $ uname -a
+#   SunOS ondine 4.1.3 2 sun4m unknown
+#   $ cat endless.sh
+#   while false
+#   do
+#     :
+#   done
+#   exit 0
+#   $ time sh endless.sh
+#   sh endless.sh  0,02s user 0,03s system 78% cpu 0,064 total
+#   $ time sh -nx endless.sh
+#   ^Csh -nx endless.sh  3,67s user 0,03s system 63% cpu 5,868 total
+#
+# 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
+fi
+rm conftest.sh
+])
+AC_SUBST(ac_cv_sh_n_works)
+
 # Initialize the test suite and build position independent wrappers.
 AC_CONFIG_TESTDIR([tests])
 AC_CONFIG_FILES([tests/Makefile tests/atlocal])
index 163e12573d1ab909db9bdbd81b07a340b4ce3a4d..67e8e8b1cdc2e2bf2e564776bc67959dea25c882 100644 (file)
@@ -5,3 +5,6 @@
 
 # We need Perl.
 PERL='@PERL@'
+
+# We need to know if sh -n is ok.
+ac_cv_sh_n_works='@ac_cv_sh_n_works@'
index 1494391b7a2a3e55137ebc86053e3af4525e93fc..f2f58ad90901f3d134c05c0a8884ceabe51c4bd0 100644 (file)
@@ -26,6 +26,18 @@ m4_pattern_allow([^m4_(define|shift)$])
 
 AT_TESTED([autom4te autoconf autoheader autoupdate autoreconf ifnames])
 
+## ---------------- ##
+## Testing syntax.  ##
+## ---------------- ##
+
+m4_define([AT_CHECK_SHELL_SYNTAX],
+[AS_IF([test x"$ac_cv_sh_n_works" != xno],
+  [AT_CHECK([/bin/sh -n $1], 0)], [$2])])
+
+m4_define([AT_CHECK_PERL_SYNTAX],
+[AT_CHECK([autom4te_perllibdir=$abs_top_srcdir/lib $PERL -c $abs_top_builddir/bin/$1],
+          0, [], [ignore])])
+
 ## ------------------ ##
 ## Testing autom4te.  ##
 ## ------------------ ##
@@ -218,8 +230,11 @@ AC_STATE_SAVE(after)
 # AT_CHECK_AUTOCONF(ARGS, [EXIT-STATUS = 0], STDOUT, STDERR)
 # ----------------------------------------------------------
 m4_define([AT_CHECK_AUTOCONF],
-[AT_CHECK([autoconf $1],
-         [$2], [$3], [$4])])
+[AT_CHECK([autoconf $1], [$2], [$3], [$4])
+if test -s configure; then
+  AT_CHECK_SHELL_SYNTAX(configure)
+fi
+])
 
 
 # AT_CHECK_AUTOHEADER(ARGS, [EXIT-STATUS = 0], STDOUT, STDERR)
@@ -239,7 +254,8 @@ m4_define([AT_CHECK_CONFIGURE],
 [AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $1],
          [$2],
          m4_default([$3], [ignore]), [$4],
-         [{ echo "$srcdir/AT_LINE: config.log"; sed 's/^/> /' config.log; } >>$at_group_log ])])
+         [{ echo "$srcdir/AT_LINE: config.log"; sed 's/^/> /' config.log; } >>$at_group_log ])
+])
 
 
 # AT_CHECK_ENV
index 3ed32071d1ad750288aac9b898a3eff9dd7407c7..4e7609907e2078b45ad61109f9b40bb5fa7ffeeb 100644 (file)
@@ -46,41 +46,17 @@ AT_BANNER([Executables (autoheader, autoupdate...).])
 
 AT_SETUP([Syntax of the shell scripts])
 
-# 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'.
-AT_DATA([endless.sh],
-[[while :
-do
-  :
-done
-]])
-
-# A script in charge of testing `/bin/sh -n'.
-AT_DATA([syntax.sh],
-[[(/bin/sh -n endless.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.
-  exit 77
-fi
-]])
-
-# If we can't trust sh, just skip.
-AT_CHECK([/bin/sh ./syntax.sh])
-
 # Specify the path to the tool, some shells don't honor PATH when
 # running `sh PROG'.
 
-AT_CHECK([/bin/sh -n $abs_top_builddir/bin/autoconf],   0)
-AT_CHECK([/bin/sh -n $abs_top_builddir/tests/autoconf],   0)
-AT_CHECK([/bin/sh -n $abs_top_builddir/tests/testsuite],   0)
+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)
 
 # These are not built, they are in the src tree.
-AT_CHECK([/bin/sh -n $abs_top_srcdir/config/install-sh], 0)
-AT_CHECK([/bin/sh -n $abs_top_srcdir/config/mkinstalldirs], 0)
-AT_CHECK([/bin/sh -n $abs_top_srcdir/config/missing], 0)
+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_CLEANUP
 
@@ -93,14 +69,6 @@ AT_CLEANUP
 
 AT_SETUP([Syntax of the Perl scripts])
 
-# Perl says things like:
-# | % perl -c ./autom4te
-# | ./autom4te syntax OK
-# Ignore it, it might change between releases.
-m4_define([AT_CHECK_PERL_SYNTAX],
-[AT_CHECK([autom4te_perllibdir=$abs_top_srcdir/lib $PERL -c $abs_top_builddir/bin/$1],
-         0, [], [ignore])])
-
 AT_CHECK_PERL_SYNTAX([autoheader])
 AT_CHECK_PERL_SYNTAX([autom4te])
 AT_CHECK_PERL_SYNTAX([autoreconf])