From 5561d67cf9e7520eb48236405acdab7a6b7a8718 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 7 Dec 2000 15:21:54 +0000 Subject: [PATCH] * tests/atgeneral.m4 (AT_CHECK): Bad typo: assign `exit 1' to at_continue if something failed, not `:'. * tests/semantics.at (AC_PATH_XTRA): New. * acspecific.m4 (_AC_PATH_X): New, extracted form AC_PATH_X. --- ChangeLog | 7 +++ acspecific.m4 | 127 +++++++++++++++++++++------------------ lib/autoconf/specific.m4 | 127 +++++++++++++++++++++------------------ lib/autotest/general.m4 | 2 +- tests/atgeneral.m4 | 2 +- tests/atspecific.m4 | 4 +- tests/mktests.sh | 6 +- tests/semantics.at | 30 ++++++--- tests/syntax.at | 1 - 9 files changed, 176 insertions(+), 130 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94b9bead..f2330b30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-12-07 Akim Demaille + + * tests/atgeneral.m4 (AT_CHECK): Bad typo: assign `exit 1' to + at_continue if something failed, not `:'. + * tests/semantics.at (AC_PATH_XTRA): New. + * acspecific.m4 (_AC_PATH_X): New, extracted form AC_PATH_X. + 2000-12-06 Akim Demaille * configure.in: Bump version to 2.49c. diff --git a/acspecific.m4 b/acspecific.m4 index 74830b5f..61b8fc4f 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -823,65 +823,9 @@ AC_DEFUN([AC_SYS_POSIX_TERMIOS], ## --------------------- ## -# AC_PATH_X -# --------- -# If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# Uses ac_ vars as temps to allow command line to override cache and checks. -# --without-x overrides everything else, but does not touch the cache. -AC_DEFUN([AC_PATH_X], -[dnl Document the X abnormal options inherited from history. -AC_DIVERT_ONCE([HELP_BEGIN], [ -X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR])dnl -AC_MSG_CHECKING([for X]) - -AC_ARG_WITH(x, [ --with-x use the X Window System]) -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else -AC_CACHE_VAL(ac_cv_have_x, -[# One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -_AC_PATH_X_XMKMF -_AC_PATH_X_DIRECT -if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi])dnl - fi - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - AC_MSG_RESULT([$have_x]) - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) -fi -])# AC_PATH_X - - # _AC_PATH_X_XMKMF # ---------------- -# Internal subroutine of AC_PATH_X. +# Internal subroutine of _AC_PATH_X. # Set ac_x_includes and/or ac_x_libraries. m4_define([_AC_PATH_X_XMKMF], [rm -fr conftestdir @@ -922,7 +866,7 @@ fi # _AC_PATH_X_DIRECT # ----------------- -# Internal subroutine of AC_PATH_X. +# Internal subroutine of _AC_PATH_X. # Set ac_x_includes and/or ac_x_libraries. m4_define([_AC_PATH_X_DIRECT], [# Standard set of common directories for X headers. @@ -1001,6 +945,71 @@ fi # $ac_x_libraries = no ])# _AC_PATH_X_DIRECT +# _AC_PATH_X +# ---------- +# Compute ac_cv_have_x. +AC_DEFUN([_AC_PATH_X], +[AC_CACHE_VAL(ac_cv_have_x, +[# One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +_AC_PATH_X_XMKMF +_AC_PATH_X_DIRECT +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi])dnl +]) + + +# AC_PATH_X +# --------- +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# Uses ac_ vars as temps to allow command line to override cache and checks. +# --without-x overrides everything else, but does not touch the cache. +AC_DEFUN([AC_PATH_X], +[dnl Document the X abnormal options inherited from history. +AC_DIVERT_ONCE([HELP_BEGIN], [ +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR])dnl +AC_MSG_CHECKING([for X]) + +AC_ARG_WITH(x, [ --with-x use the X Window System]) +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + _AC_PATH_X + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + AC_MSG_RESULT([$have_x]) + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) +fi +])# AC_PATH_X + + + # AC_PATH_XTRA # ------------ # Find additional X libraries, magic flags, etc. @@ -1008,7 +1017,7 @@ AC_DEFUN([AC_PATH_XTRA], [AC_REQUIRE([AC_PATH_X])dnl if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. - AC_DEFINE(X_DISPLAY_MISSING, 1, + AC_DEFINE([X_DISPLAY_MISSING], 1, [Define if the X Window System is missing or not being used.]) X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 74830b5f..61b8fc4f 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -823,65 +823,9 @@ AC_DEFUN([AC_SYS_POSIX_TERMIOS], ## --------------------- ## -# AC_PATH_X -# --------- -# If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# Uses ac_ vars as temps to allow command line to override cache and checks. -# --without-x overrides everything else, but does not touch the cache. -AC_DEFUN([AC_PATH_X], -[dnl Document the X abnormal options inherited from history. -AC_DIVERT_ONCE([HELP_BEGIN], [ -X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR])dnl -AC_MSG_CHECKING([for X]) - -AC_ARG_WITH(x, [ --with-x use the X Window System]) -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else -AC_CACHE_VAL(ac_cv_have_x, -[# One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -_AC_PATH_X_XMKMF -_AC_PATH_X_DIRECT -if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi])dnl - fi - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - AC_MSG_RESULT([$have_x]) - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) -fi -])# AC_PATH_X - - # _AC_PATH_X_XMKMF # ---------------- -# Internal subroutine of AC_PATH_X. +# Internal subroutine of _AC_PATH_X. # Set ac_x_includes and/or ac_x_libraries. m4_define([_AC_PATH_X_XMKMF], [rm -fr conftestdir @@ -922,7 +866,7 @@ fi # _AC_PATH_X_DIRECT # ----------------- -# Internal subroutine of AC_PATH_X. +# Internal subroutine of _AC_PATH_X. # Set ac_x_includes and/or ac_x_libraries. m4_define([_AC_PATH_X_DIRECT], [# Standard set of common directories for X headers. @@ -1001,6 +945,71 @@ fi # $ac_x_libraries = no ])# _AC_PATH_X_DIRECT +# _AC_PATH_X +# ---------- +# Compute ac_cv_have_x. +AC_DEFUN([_AC_PATH_X], +[AC_CACHE_VAL(ac_cv_have_x, +[# One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +_AC_PATH_X_XMKMF +_AC_PATH_X_DIRECT +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi])dnl +]) + + +# AC_PATH_X +# --------- +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# Uses ac_ vars as temps to allow command line to override cache and checks. +# --without-x overrides everything else, but does not touch the cache. +AC_DEFUN([AC_PATH_X], +[dnl Document the X abnormal options inherited from history. +AC_DIVERT_ONCE([HELP_BEGIN], [ +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR])dnl +AC_MSG_CHECKING([for X]) + +AC_ARG_WITH(x, [ --with-x use the X Window System]) +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + _AC_PATH_X + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + AC_MSG_RESULT([$have_x]) + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) +fi +])# AC_PATH_X + + + # AC_PATH_XTRA # ------------ # Find additional X libraries, magic flags, etc. @@ -1008,7 +1017,7 @@ AC_DEFUN([AC_PATH_XTRA], [AC_REQUIRE([AC_PATH_X])dnl if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. - AC_DEFINE(X_DISPLAY_MISSING, 1, + AC_DEFINE([X_DISPLAY_MISSING], 1, [Define if the X Window System is missing or not being used.]) X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index d11bd598..80011704 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -450,7 +450,7 @@ m4_case([$3], expout, [AT_CLEANUP_FILES([expout])dnl $at_diff expout stdout >&5 || at_continue='exit 1'], [], [$at_diff empty stdout >&5 || at_continue='exit 1'], - [echo $at_n "m4_patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stdout >&5 || at_continue=:]) + [echo $at_n "m4_patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stdout >&5 || at_continue='exit 1']) dnl Check exit val. case $at_status in 77) exit 77;; diff --git a/tests/atgeneral.m4 b/tests/atgeneral.m4 index d11bd598..80011704 100644 --- a/tests/atgeneral.m4 +++ b/tests/atgeneral.m4 @@ -450,7 +450,7 @@ m4_case([$3], expout, [AT_CLEANUP_FILES([expout])dnl $at_diff expout stdout >&5 || at_continue='exit 1'], [], [$at_diff empty stdout >&5 || at_continue='exit 1'], - [echo $at_n "m4_patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stdout >&5 || at_continue=:]) + [echo $at_n "m4_patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stdout >&5 || at_continue='exit 1']) dnl Check exit val. case $at_status in 77) exit 77;; diff --git a/tests/atspecific.m4 b/tests/atspecific.m4 index d9545faf..b4b49c67 100644 --- a/tests/atspecific.m4 +++ b/tests/atspecific.m4 @@ -37,7 +37,9 @@ AT_CHECK([autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])]) # AT_CHECK_CONFIGURE -# ------------------- +# ------------------ +# `top_srcdir' is needed so that `./configure' finds install-sh. +# Using --srcdir is more expensive. m4_define([AT_CHECK_CONFIGURE], [AT_CLEANUP_FILE_IFELSE([config.hin], [AT_CLEANUP_FILE(config.h)])dnl diff --git a/tests/mktests.sh b/tests/mktests.sh index a09d8446..73f19408 100755 --- a/tests/mktests.sh +++ b/tests/mktests.sh @@ -89,10 +89,13 @@ exclude_list='^ac_cv_prog_(gcc|gxx|g77)$ # Already tested by `AT_CHECK_MACRO'. # - AC_FD_CC # Is a number. -# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE) +# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE), AC_PATH_XTRA # Checked in semantics. # - AC_CYGWIN, AC_CYGWIN32, AC_EMXOS2, AC_MING32, AC_EXEEXT, AC_OBJEXT # AU defined to nothing. +# - AC_PATH_XTRA +# Checked in semantics. +# syntax_exclude_list='^AC_ARG_VAR$ ^AC_CANONICALIZE|AC_PREFIX_PROGRAM|AC_PREREQ$ ^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TOOL|TYPE)S?$ @@ -112,6 +115,7 @@ syntax_exclude_list='^AC_ARG_VAR$ ^AC_FD_CC$ ^(AC_(PROG_CC|C_CONST|C_INLINE|C_VOLATILE))$ ^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$ +^AC_PATH_XTRA$ _AC_' # syntax_exclude_egrep -- diff --git a/tests/semantics.at b/tests/semantics.at index 09ebef2a..f8526337 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -1,10 +1,6 @@ # -*- autoconf -*- -cat <