autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.65-81-g


From: Ralf Wildenhues
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.65-81-gc106e61
Date: Tue, 08 Jun 2010 05:01:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=c106e61216c5b339c093dcf01ae42635759166db

The branch, master has been updated
       via  c106e61216c5b339c093dcf01ae42635759166db (commit)
       via  cddfaa966c5536033df26106e3fdac3336bed7b2 (commit)
       via  9c975f4d23f512e571b5bea7472120e89ba1f1f2 (commit)
       via  daa7bf5d0f5ecfb504b990d2012ee9f3baac0425 (commit)
       via  a535b586adbc4a4e38393aa634f3dd8c8c7a9660 (commit)
       via  521a4615578b5a9908fd6af9a8085ba7009cb38a (commit)
      from  a18ec77aaf1c514a4fe0f122b13f298ba3f3eca0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c106e61216c5b339c093dcf01ae42635759166db
Author: Ralf Wildenhues <address@hidden>
Date:   Tue Jun 8 06:56:43 2010 +0200

    Coverage and doc fixes for AC_LANG_SOURCE and AC_LANG_PROGRAM.
    
    * tests/compile.at (AC_LANG_SOURCE, AC_LANG_SOURCE(C++))
    (AC_LANG_SOURCE example, AC_LANG_PROGRAM example): New tests.
    * doc/autoconf.texi (Generating Sources): Add markers for tested
    examples; update quoting, and update AC_INIT usage to also set
    optional URL arguments.  Mention that the examples require gcc.
    Prompted by report from Brian J. Murrell.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit cddfaa966c5536033df26106e3fdac3336bed7b2
Author: Ralf Wildenhues <address@hidden>
Date:   Tue Jun 8 06:55:10 2010 +0200

    Make AS_SET_CATFILE polymorphic, and add testsuite coverage.
    
    * lib/m4sugar/m4sh.m4 (AS_SET_CATFILE): Use AS_VAR_SET to set
    the variable.
    * tests/m4sh.at (AS@&address@hidden): New test.
    * doc/autoconf.texi (Common Shell Constructs): Document that
    AS_SET_CATFILE is polymorphic in its VAR argument now.
    * NEWS: Update.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit 9c975f4d23f512e571b5bea7472120e89ba1f1f2
Author: Ralf Wildenhues <address@hidden>
Date:   Tue Jun 8 06:51:39 2010 +0200

    Testsuite coverage for AC_COPYRIGHT and AT_COPYRIGHT.
    
    * tests/autotest.at (AT@&address@hidden): New test.
    * tests/base.at (AC@&address@hidden): Likewise.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit daa7bf5d0f5ecfb504b990d2012ee9f3baac0425
Author: Ralf Wildenhues <address@hidden>
Date:   Tue Jun 8 06:50:45 2010 +0200

    Testsuite coverage for __file__ and __line__.
    
    * tests/m4sugar.at (__file__ and __line__): New test.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit a535b586adbc4a4e38393aa634f3dd8c8c7a9660
Author: Ralf Wildenhues <address@hidden>
Date:   Tue Jun 8 06:49:55 2010 +0200

    Testsuite coverage for AC_CACHE_VAL and caching semantics.
    
    * tests/base.at (AC_CACHE_CHECK): Extend test.
    (AC_CACHE_LOAD): New test.
    * tests/torture.at (Configuring subdirectories): Also test
    --config-cache with AC_CONFIG_SUBDIRS.
    * doc/autoconf.texi (Caching Results): Annotate code snippets
    which are tested in the test suite.
    (Cache Files): Documented cache variables may be used on the
    configure command line to override individual entries in the
    cache file.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit 521a4615578b5a9908fd6af9a8085ba7009cb38a
Author: Ralf Wildenhues <address@hidden>
Date:   Sun Jun 6 11:59:25 2010 +0200

    Clarify OpenBSD sh errexit issue with compound commands.
    
    * doc/autoconf.texi (Limitations of Builtins): Only the last
    command in a compound list is problematic.
    Tested on OpenBSD 4.4.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   41 +++++++++++
 NEWS                |    2 +
 doc/autoconf.texi   |   44 ++++++++----
 lib/m4sugar/m4sh.m4 |    8 +-
 tests/autotest.at   |   24 +++++++
 tests/base.at       |  187 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 tests/compile.at    |  140 ++++++++++++++++++++++++++++++++++++++
 tests/m4sh.at       |   42 ++++++++++++
 tests/m4sugar.at    |   27 +++++++
 tests/torture.at    |    5 ++
 10 files changed, 500 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9c62634..5150f4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2010-06-08  Ralf Wildenhues  <address@hidden>
+
+       Coverage and doc fixes for AC_LANG_SOURCE and AC_LANG_PROGRAM.
+       * tests/compile.at (AC_LANG_SOURCE, AC_LANG_SOURCE(C++))
+       (AC_LANG_SOURCE example, AC_LANG_PROGRAM example): New tests.
+       * doc/autoconf.texi (Generating Sources): Add markers for tested
+       examples; update quoting, and update AC_INIT usage to also set
+       optional URL arguments.  Mention that the examples require gcc.
+       Prompted by report from Brian J. Murrell.
+
+       Make AS_SET_CATFILE polymorphic, and add testsuite coverage.
+       * lib/m4sugar/m4sh.m4 (AS_SET_CATFILE): Use AS_VAR_SET to set
+       the variable.
+       * tests/m4sh.at (AS@&address@hidden): New test.
+       * doc/autoconf.texi (Common Shell Constructs): Document that
+       AS_SET_CATFILE is polymorphic in its VAR argument now.
+       * NEWS: Update.
+
+       Testsuite coverage for AC_COPYRIGHT and AT_COPYRIGHT.
+       * tests/autotest.at (AT@&address@hidden): New test.
+       * tests/base.at (AC@&address@hidden): Likewise.
+
+       Testsuite coverage for __file__ and __line__.
+       * tests/m4sugar.at (__file__ and __line__): New test.
+
+       Testsuite coverage for AC_CACHE_VAL and caching semantics.
+       * tests/base.at (AC_CACHE_CHECK): Extend test.
+       (AC_CACHE_LOAD): New test.
+       * tests/torture.at (Configuring subdirectories): Also test
+       --config-cache with AC_CONFIG_SUBDIRS.
+       * doc/autoconf.texi (Caching Results): Annotate code snippets
+       which are tested in the test suite.
+       (Cache Files): Documented cache variables may be used on the
+       configure command line to override individual entries in the
+       cache file.
+
+       Clarify OpenBSD sh errexit issue with compound commands.
+       * doc/autoconf.texi (Limitations of Builtins): Only the last
+       command in a compound list is problematic.
+       Tested on OpenBSD 4.4.
+
 2010-06-07  Eric Blake  <address@hidden>
 
        Properly quote AC_PREREQ during autoupdate.
diff --git a/NEWS b/NEWS
index 04cf8dd..dfe8cd7 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,8 @@ GNU Autoconf NEWS - User visible changes.
 ** AC_CHECK_DECL and AC_CHECK_DECLS accept optional function argument types
    for overloaded C++ functions.
 
+** AS_SET_CATFILE accepts nonliterals in its variable name argument now.
+
 * Major changes in Autoconf 2.65 (2009-11-21) [stable]
   Released by Eric Blake, based on git versions 2.64.*.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index eab9ab2..6be99aa 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -8675,19 +8675,22 @@ all the @code{AC_DEFINE} performed so far.
 For instance executing (observe the double quotation!):
 
 @example
-AC_INIT([Hello], [1.0], [bug-hello@@example.org])
address@hidden If you change this example, adjust 
tests/compile.at:AC_LANG_SOURCE example.
+AC_INIT([Hello], [1.0], [bug-hello@@example.org], [],
+        [http://www.example.org/])
 AC_DEFINE([HELLO_WORLD], ["Hello, World\n"],
   [Greetings string.])
-AC_LANG(C)
+AC_LANG([C])
 AC_LANG_CONFTEST(
    [AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])])
 gcc -E -dD -o - conftest.c
 @end example
 
 @noindent
-results in:
+on a system with @command{gcc} installed, results in:
 
 @example
address@hidden If you change this example, adjust 
tests/compile.at:AC_LANG_SOURCE example.
 @dots{}
 # 1 "conftest.c"
 
@@ -8696,6 +8699,7 @@ results in:
 #define PACKAGE_VERSION "1.0"
 #define PACKAGE_STRING "Hello 1.0"
 #define PACKAGE_BUGREPORT "bug-hello@@example.org"
+#define PACKAGE_URL "http://www.example.org/";
 #define HELLO_WORLD "Hello, World\n"
 
 const char hw[] = "Hello, World\n";
@@ -8716,7 +8720,9 @@ available.
 For instance:
 
 @example
-AC_INIT([Hello], [1.0], [bug-hello@@example.org])
address@hidden If you change this example, adjust 
tests/compile.at:AC_LANG_PROGRAM example.
+AC_INIT([Hello], [1.0], [bug-hello@@example.org], [],
+        [http://www.example.org/])
 AC_DEFINE([HELLO_WORLD], ["Hello, World\n"],
   [Greetings string.])
 AC_LANG_CONFTEST(
@@ -8726,9 +8732,10 @@ gcc -E -dD -o - conftest.c
 @end example
 
 @noindent
-results in:
+on a system with @command{gcc} installed, results in:
 
 @example
address@hidden If you change this example, adjust 
tests/compile.at:AC_LANG_PROGRAM example.
 @dots{}
 # 1 "conftest.c"
 
@@ -8737,6 +8744,7 @@ results in:
 #define PACKAGE_VERSION "1.0"
 #define PACKAGE_STRING "Hello 1.0"
 #define PACKAGE_BUGREPORT "bug-hello@@example.org"
+#define PACKAGE_URL "http://www.example.org/";
 #define HELLO_WORLD "Hello, World\n"
 
 const char hw[] = "Hello, World\n";
@@ -9577,6 +9585,7 @@ It is common to find buggy macros using 
@code{AC_CACHE_VAL} or
 instance, the following macro is broken:
 
 @example
address@hidden If you change this example, adjust tests/base.at:AC_CACHE_CHECK.
 @group
 AC_DEFUN([AC_SHELL_TRUE],
 [AC_CACHE_CHECK([whether true(1) works], [my_cv_shell_true_works],
@@ -9596,6 +9605,7 @@ This fails if the cache is enabled: the second time this 
macro is run,
 is:
 
 @example
address@hidden If you change this example, adjust tests/base.at:AC_CACHE_CHECK.
 @group
 AC_DEFUN([AC_SHELL_TRUE],
 [AC_CACHE_CHECK([whether true(1) works], [my_cv_shell_true_works],
@@ -9675,7 +9685,8 @@ documented semantics.
 A cache file is a shell script that caches the results of configure
 tests run on one system so they can be shared between configure scripts
 and configure runs.  It is not useful on other systems.  If its contents
-are invalid for some reason, the user may delete or edit it.
+are invalid for some reason, the user may delete or edit it, or override
+documented cache variables on the @command{configure} command line.
 
 By default, @command{configure} uses no cache file,
 to avoid problems caused by accidental
@@ -13231,8 +13242,8 @@ if test "x$HAVE_sys_some_file_h" = xyes; then echo 
"Have it!"; fi
 
 @defmac AS_SET_CATFILE (@var{var}, @var{dir}, @var{file})
 @asindex{SET_CATFILE}
-Set the shell variable @var{var} to @var{dir}/@var{file}, but
-optimizing the common cases (@var{dir} or @var{file} is @samp{.},
+Set the polymorphic shell variable @var{var} to @var{dir}/@var{file},
+but optimizing the common cases (@var{dir} or @var{file} is @samp{.},
 @var{file} is absolute, etc.).
 @end defmac
 
@@ -16877,9 +16888,9 @@ makefiles, and led to circumlocutions like @samp{sh -c 
'test -f file ||
 touch file'}, where the seemingly-unnecessary @samp{sh -c '@dots{}'}
 wrapper works around the bug (@pxref{Failure in Make Rules}).
 
-Even relatively-recent versions of the BSD shell (e.g.,
-OpenBSD 3.4) wrongly exit with @option{-e} if a command within
address@hidden&&} fails inside a compound statement.  For example:
+Even relatively-recent versions of the BSD shell (e.g., OpenBSD 3.4)
+wrongly exit with @option{-e} if the last command within a compound
+statement fails and is guarded by an @samp{&&} only.  For example:
 
 @example
 #! /bin/sh
@@ -16889,14 +16900,17 @@ test -n "$foo" && exit 1
 echo one
 if :; then
   test -n "$foo" && exit 1
+  echo two
+  test -n "$foo" && exit 1
 fi
-echo two
+echo three
 @end example
 
 @noindent
-does not print @samp{two}.  One workaround is to use @samp{if test -n
-"$foo"; then exit 1; fi} rather than @samp{test -n "$foo" && exit 1}.
-Another possibility is to warn BSD users not to use @samp{sh -e}.
+does not print @samp{three}.  One workaround is to change the last
+instance of @samp{test -n "$foo" && exit 1} to be @samp{if test -n
+"$foo"; then exit 1; fi} instead.  Another possibility is to warn BSD
+users not to use @samp{sh -e}.
 
 When @samp{set -e} is in effect, a failed command substitution in
 Solaris @command{/bin/sh} cannot be ignored, even with @samp{||}.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index f056569..024498d 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -1313,12 +1313,12 @@ IFS=$as_save_IFS
 # Optimize the common case where $2 or $3 is '.'.
 m4_define([AS_SET_CATFILE],
 [case $2 in @%:@((
-.) $1=$3;;
+.) AS_VAR_SET([$1], [$3]);;
 *)
   case $3 in @%:@(((
-  .) $1=$2;;
-  [[\\/]]* | ?:[[\\/]]* ) $1=$3;;
-  *) $1=$2/$3;;
+  .) AS_VAR_SET([$1], [$2]);;
+  [[\\/]]* | ?:[[\\/]]* ) AS_VAR_SET([$1], [$3]);;
+  *) AS_VAR_SET([$1], [$2/$3]);;
   esac;;
 esac[]])# AS_SET_CATFILE
 
diff --git a/tests/autotest.at b/tests/autotest.at
index 7267915..a09e2c1 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -135,6 +135,30 @@ m4_define([AT_CHECK_EGREP],
 ])
 
 
+## -------------- ##
+## AT_COPYRIGHT.  ##
+## -------------- ##
+
+# Ensure the FSF notice as well as the user-provided one are present
+# in the head of the testsuite as well as the --version output.
+
+AT_CHECK_AT([AT@&address@hidden,
+[[AT_INIT([Testing AT@&address@hidden)
+AT_COPYRIGHT([[This is just a test notice, not a real one, so let's avoid
+words that may be matched by scanners for legal things,
+causing extra work for distributors.
+Multi-line values should be supported.
+]])
+]], [], [], [stdout], [], [], [
+AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
+AT_CHECK([grep 'This is just a test notice' stdout], [], [ignore])
+AT_CHECK([sed 50q micro-suite | grep 'Copyright.*Free Software Foundation'],
+        [], [ignore])
+AT_CHECK([sed 50q micro-suite | grep 'This is just a test notice'],
+        [], [ignore])],
+[--version])
+
+
 ## ------------------ ##
 ## Empty test suite.  ##
 ## ------------------ ##
diff --git a/tests/base.at b/tests/base.at
index 19b8f88..042f16c 100644
--- a/tests/base.at
+++ b/tests/base.at
@@ -219,6 +219,37 @@ AT_CHECK([grep "^PACKAGE_TARNAME='fu'\$" configure], [], 
[ignore])
 AT_CLEANUP
 
 
+## -------------- ##
+## AC_COPYRIGHT.  ##
+## -------------- ##
+
+# Ensure the FSF notice as well as the user-provided one are present
+# in the head of the testsuite as well as the --version output.
+
+AT_SETUP([AC@&address@hidden)
+
+AT_DATA([configure.ac],
+[[AC_INIT([GNU fu], [1.0])
+AC_COPYRIGHT([[This is just a test notice, not a real one, so let's avoid
+words that may be matched by scanners for legal things,
+causing extra work for distributors.
+Multi-line values should be supported.
+]])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([--version], [], [stdout])
+AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
+AT_CHECK([grep 'This is just a test notice' stdout], [], [ignore])
+AT_CHECK([sed -ne 50q -e '/Copyright/{' -e N -e N -e N -e N -e 's/#//g' ]dnl
+        [    -e 's/\n//g' -e p -e '}' configure ]dnl
+         [  | grep 'Copyright.*Free Software Foundation'],
+        [], [ignore])
+AT_CHECK([sed 50q configure | grep 'This is just a test notice'], [], [ignore])
+
+AT_CLEANUP
+
+
 ## ---------------- ##
 ## AC_CACHE_CHECK.  ##
 ## ---------------- ##
@@ -228,19 +259,39 @@ AT_CLEANUP
 
 AT_SETUP([AC_CACHE_CHECK])
 
+# Don't let a config.site file affect this test.
+AS_UNSET([CONFIG_SITE])
+
 AT_DATA([configure.ac],
 [[AC_INIT
 # m4_define([ac_nothing], [ac_cv_absolutely_nothing])
 AC_CACHE_CHECK([for nothing],
               [ac_nothing],
               [ac_nothing=found])
+
+AC_MSG_CHECKING([for some other variable])
+commands_to_set_it_was_run=false
+AC_CACHE_VAL([my_cv_variable], [
+# FOO
+commands_to_set_it_was_run=true
+my_cv_variable=true
+])
+AC_MSG_RESULT([$my_cv_variable])
+
+# Ensure that the result is available at this point.
+if test ${my_cv_variable+set} != set; then
+  AC_MSG_ERROR([AC@&@&address@hidden@_CACHE_VAL did not ensure that the cache 
variable was set])
+fi
+
+# AC_CACHE_SAVE should be enough here, no need for AC_OUTPUT.
+AC_CACHE_SAVE
 ]])
 
 AT_CHECK_AUTOCONF([], [], [], [stderr])
 AT_CHECK([grep 'must contain _cv_ to be cached' stderr], [], [ignore])
 
 # Do not warn about defines:
-sed 's/^# //' configure.ac > t
+sed 's/^# m4_define/m4_define/' configure.ac > t
 mv -f t configure.ac
 AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE([-q])
@@ -250,6 +301,140 @@ mv -f t configure.ac
 AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE([-q])
 
+# Print a message saying that the result was cached, iff it was cached.
+AT_CHECK_CONFIGURE([], [], [stdout])
+AT_CHECK([grep 'cached' stdout], [1])
+AT_CHECK_CONFIGURE([my_cv_variable='yes it is set'], [], [stdout])
+AT_CHECK([grep 'cached.*yes it is set' stdout], [], [ignore])
+
+# --cache-file is honored and has caching semantics.
+AT_CHECK_CONFIGURE([--cache-file=foobar.cache], [], [stdout])
+AT_CHECK([grep 'cached' stdout], [1])
+AT_CHECK([test ! -f config.cache])
+AT_CHECK([grep 'my_cv_variable.*true' foobar.cache], [], [ignore])
+AT_CHECK_CONFIGURE([--cache-file=foobar.cache], [], [stdout])
+AT_CHECK([grep 'some other variable.*cached.*true' stdout], [], [ignore])
+
+# A setting on the command line overrides the cache.
+AT_CHECK_CONFIGURE([--cache-file=foobar.cache my_cv_variable='override'], [], 
[stdout])
+AT_CHECK([grep 'cached.*override' stdout], [], [ignore])
+AT_CHECK([grep 'my_cv_variable.*override' foobar.cache], [], [ignore])
+
+# Values containing braces need special internal treatment.
+AT_CHECK_CONFIGURE([-C ac_cv_nothing='{' my_cv_variable='contains } brace'],
+                  [], [stdout])
+AT_CHECK([grep 'ac_cv_nothing.*{' config.cache], [], [ignore])
+AT_CHECK([grep 'my_cv_variable.*contains } brace' config.cache], [], [ignore])
+AT_CHECK_CONFIGURE([-C], [], [stdout])
+AT_CHECK([grep 'nothing.*{' stdout], [], [ignore])
+AT_CHECK([grep 'some other variable.*contains } brace' stdout], [], [ignore])
+rm -f config.cache
+
+# Diagnose common side-effects that are errors in COMMANDS-TO-SET-IT:
+sed 's/^# FOO/AC_DEFINE([some-define], [1], [oooh.])/' configure.ac > t
+mv -f t configure.ac
+AT_CHECK_AUTOCONF([], [], [], [stderr])
+AT_CHECK([grep 'suspicious.*AC_DEFINE' stderr], [], [ignore])
+
+sed 's/^AC_DEFINE.*/AC_SUBST([some_substitution], [oooh.])/' configure.ac > t
+mv -f t configure.ac
+AT_CHECK_AUTOCONF([], [], [], [stderr])
+AT_CHECK([grep 'suspicious.*AC_SUBST' stderr], [], [ignore])
+
+# Ensure the examples from the manual work as intended.
+# Taken from autoconf.texi:Caching Results
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_DEFUN([AC_SHELL_TRUE],
+[AC_CACHE_CHECK([whether true(1) works], [my_cv_shell_true_works],
+                [my_cv_shell_true_works=no
+                 (true) 2>/dev/null && my_cv_shell_true_works=yes
+                 if test "x$my_cv_shell_true_works" = xyes; then
+                   AC_DEFINE([TRUE_WORKS], [1],
+                             [Define if `true(1)' works properly.])
+                 fi])
+])
+AC_SHELL_TRUE
+]])
+AT_CHECK_AUTOCONF([-Werror], [1], [], [stderr])
+AT_CHECK([grep 'suspicious.*AC_DEFINE' stderr], [], [ignore])
+
+# Taken from autoconf.texi:Caching Results
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_DEFUN([AC_SHELL_TRUE],
+[AC_CACHE_CHECK([whether true(1) works], [my_cv_shell_true_works],
+                [my_cv_shell_true_works=no
+                 (true) 2>/dev/null && my_cv_shell_true_works=yes])
+ if test "x$my_cv_shell_true_works" = xyes; then
+   AC_DEFINE([TRUE_WORKS], [1],
+             [Define if `true(1)' works properly.])
+ fi
+])
+AC_SHELL_TRUE
+AC_OUTPUT
+]])
+AT_CHECK_AUTOCONF([-Werror])
+AT_CHECK_CONFIGURE([-C], [], [stdout])
+AT_CHECK([grep my_cv_shell_true_works config.cache], [], [ignore])
+AT_CHECK([grep 'true.*works.*yes' stdout], [], [ignore])
+
+AT_CHECK_CONFIGURE([--config-cache], [], [stdout])
+AT_CHECK([grep 'true.*works.*cached.*yes' stdout], [], [ignore])
+
+# config.status only pays attention to the cache file with --recheck.
+AT_CHECK([./config.status], [], [stdout])
+AT_CHECK([grep cache stdout], [1])
+AT_CHECK([./config.status --recheck], [], [stdout])
+AT_CHECK([grep cache stdout], [0], [ignore])
+
+# By default, configure uses no cache file, neither loading nor updating it.
+: > a-stamp-file
+AT_CHECK_CONFIGURE([], [], [stdout])
+AT_CHECK([grep cache stdout], [1])
+AT_CHECK([LC_ALL=C ls -t config.cache a-stamp-file | sed 1q | grep 
config.cache], [1])
+
+# config.site can specify a site-wide cache, accumulating information.
+AT_DATA([config.site],
+[[cache_file=sitecache
+]])
+AT_DATA([sitecache],
+[[my_cv_some_preset_cache_var=yes
+]])
+CONFIG_SITE=config.site
+export CONFIG_SITE
+AT_CHECK_CONFIGURE
+AT_CHECK([grep my_cv_some_preset_cache_var sitecache], [], [ignore])
+AT_CHECK([grep my_cv_shell_true_works sitecache], [], [ignore])
+AT_CHECK_CONFIGURE([], [], [stdout])
+AT_CHECK([grep 'whether true.*works.*cached' stdout], [], [ignore])
+
+AT_CLEANUP
+
+
+## --------------- ##
+## AC_CACHE_LOAD.  ##
+## --------------- ##
+
+# Test AC_CACHE_LOAD.
+
+AT_SETUP([AC_CACHE_LOAD])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+$some_test_code
+AC_CACHE_LOAD
+AC_MSG_NOTICE([some_cv_variable is $some_cv_variable])
+AC_OUTPUT
+]])
+AT_CHECK_AUTOCONF
+AS_UNSET([some_test_code])
+AT_DATA([new-cache],
+[[some_cv_variable=value-from-new-cache
+]])
+AT_CHECK_CONFIGURE([some_test_code='eval cache_file=new-cache'], [], [stdout])
+AT_CHECK([grep 'some_cv_variable.*value-from-new-cache' stdout], [], [ignore])
+
 AT_CLEANUP
 
 
diff --git a/tests/compile.at b/tests/compile.at
index bace001..129f3c6 100644
--- a/tests/compile.at
+++ b/tests/compile.at
@@ -112,6 +112,146 @@ AT_CHECK_CONFIGURE
 AT_CLEANUP
 
 
+## ---------------- ##
+## AC_LANG_SOURCE.  ##
+## ---------------- ##
+
+AT_SETUP([AC_LANG_SOURCE])
+
+AT_DATA([configure.ac],
+[[AC_INIT([pkg], [1.0])
+AC_PROG_CC
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#ifndef PACKAGE_NAME
+choke me
+#endif
+int main ()
+{
+  return 0;
+}
+]], [], [AC_MSG_FAILURE([confdefs not included])])])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP
+
+
+## --------------------- ##
+## AC_LANG_SOURCE(C++).  ##
+## --------------------- ##
+
+AT_SETUP([AC_LANG_SOURCE(C++)])
+
+AT_DATA([configure.ac],
+[[AC_INIT([pkg], [1.0])
+AC_PROG_CXX
+AC_LANG([C++])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#ifndef PACKAGE_NAME
+choke me
+#endif
+int main ()
+{
+  return 0;
+}
+]], [], [AC_MSG_FAILURE([confdefs not included])])])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP
+
+
+## ------------------------ ##
+## AC_LANG_SOURCE example.  ##
+## ------------------------ ##
+
+AT_SETUP([AC_LANG_SOURCE example])
+
+AT_DATA([configure.ac],
+[[# Taken from autoconf.texi:Generating Sources.
+# The only change is to not fail if gcc doesn't work.
+AC_INIT([Hello], [1.0], address@hidden, [],
+        [http://www.example.org/])
+AC_DEFINE([HELLO_WORLD], ["Hello, World\n"],
+  [Greetings string.])
+AC_LANG([C])
+AC_LANG_CONFTEST(
+   [AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])])
+gcc -E -dD -o - conftest.c || AS_EXIT([77])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([], [], [stdout])
+# Taken from autoconf.texi:Generating Sources.
+# Note that the output may contain more than one line matching
+#   # 1 "conftest.c"
+# so delete everything until the last one.
+AT_CHECK([sed  '1,/# 1 "conftest\.c"/d' stdout], [],
+[[
+#define PACKAGE_NAME "Hello"
+#define PACKAGE_TARNAME "hello"
+#define PACKAGE_VERSION "1.0"
+#define PACKAGE_STRING "Hello 1.0"
+#define PACKAGE_BUGREPORT "address@hidden"
+#define PACKAGE_URL "http://www.example.org/";
+#define HELLO_WORLD "Hello, World\n"
+
+const char hw[] = "Hello, World\n";
+]])
+
+AT_CLEANUP
+
+
+## ------------------------- ##
+## AC_LANG_PROGRAM example.  ##
+## ------------------------- ##
+
+AT_SETUP([AC_LANG_PROGRAM example])
+
+AT_DATA([configure.ac],
+[[# Taken from autoconf.texi:Generating Sources.
+# The only change is to not fail if gcc doesn't work.
+AC_INIT([Hello], [1.0], address@hidden, [],
+        [http://www.example.org/])
+AC_DEFINE([HELLO_WORLD], ["Hello, World\n"],
+  [Greetings string.])
+AC_LANG_CONFTEST(
+[AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]],
+                 [[fputs (hw, stdout);]])])
+gcc -E -dD -o - conftest.c || AS_EXIT([77])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([], [], [stdout])
+# Taken from autoconf.texi:Generating Sources.
+# Note that the output may contain more than one line matching
+#   # 1 "conftest.c"
+# so delete everything until the last one.
+AT_CHECK([sed  '1,/# 1 "conftest\.c"/d' stdout], [],
+[[
+#define PACKAGE_NAME "Hello"
+#define PACKAGE_TARNAME "hello"
+#define PACKAGE_VERSION "1.0"
+#define PACKAGE_STRING "Hello 1.0"
+#define PACKAGE_BUGREPORT "address@hidden"
+#define PACKAGE_URL "http://www.example.org/";
+#define HELLO_WORLD "Hello, World\n"
+
+const char hw[] = "Hello, World\n";
+int
+main ()
+{
+fputs (hw, stdout);
+  ;
+  return 0;
+}
+]])
+
+AT_CLEANUP
+
+
 ## --------------- ##
 ## AC_RUN_IFELSE.  ##
 ## --------------- ##
diff --git a/tests/m4sh.at b/tests/m4sh.at
index 7f2cc39..05cea85 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -241,6 +241,48 @@ AT_CHECK([$CONFIG_SHELL ./script])
 AT_CLEANUP
 
 
+## ---------------- ##
+## AS_SET_CATFILE.  ##
+## ---------------- ##
+
+AT_SETUP([AS@&address@hidden)
+AT_KEYWORDS([m4sh])
+
+AT_DATA_M4SH([script.as],
+[[AS_INIT
+
+# CATFILE_TEST(DIR, FILE, EXPECTED)
+m4_define([CATFILE_TEST],
+[# AS_SET_CATFILE works and can be used in a compound list.
+if AS_SET_CATFILE([var], [$1], [$2]) \
+   && test "$var" = $3; then :; else
+  echo "catfile($1, $2) = $var != $3" >&2
+fi
+# AS_SET_CATFILE can use non-literals in its arguments.
+varname=var2
+dirpart=$1
+filepart=$2
+if AS_SET_CATFILE([$varname], [$dirpart], [$filepart]) \
+   && test "$var2" = $3; then :; else
+  echo "catfile($dirpart, $filepart) = $var2 != $3" >&2
+fi
+])
+
+CATFILE_TEST([dir], [file], [dir/file])
+CATFILE_TEST([.], [file], [file])
+CATFILE_TEST([dir], [.], [dir])
+CATFILE_TEST([dir], [/abs/file], [/abs/file])
+CATFILE_TEST([dir], [C:/abs/file], [C:/abs/file])
+CATFILE_TEST(["dir  name"], ['file  name'], ['dir  name/file  name'])
+
+AS_EXIT(0)
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([$CONFIG_SHELL ./script])
+
+AT_CLEANUP
+
 
 ## --------- ##
 ## AS_ECHO.  ##
diff --git a/tests/m4sugar.at b/tests/m4sugar.at
index 4aa6034..7069309 100644
--- a/tests/m4sugar.at
+++ b/tests/m4sugar.at
@@ -2075,3 +2075,30 @@ m4_count(m4_shift(m4_set_intersection([a], [b])))
 ]])
 
 AT_CLEANUP
+
+
+## ---------------------- ##
+## __file__ and __line__. ##
+## ---------------------- ##
+
+AT_SETUP([[__file__ and __line__]])
+
+# Check that __file__ and __line__ work.
+# Check that m4__file__ and m4__line__ are not defined
+# (and get them to pass by the undefined-macro check).
+# Try to not assume too much about AT_CHECK_M4SUGAR_TEXT.
+AT_CHECK_M4SUGAR_TEXT([[dnl
+m4_pattern_allow([m4__file__])dnl
+m4_pattern_allow([m4__line__])dnl
+m4__file__
+m4__line__
+__file__
+m4_define([first], __line__)dnl
+m4_define([second], __line__)dnl
+m4_assert(first + 1 == second)dnl
+]], [[m4@&address@hidden@&address@hidden
+m4@&address@hidden@&address@hidden
+script.4s
+]])
+
+AT_CLEANUP
diff --git a/tests/torture.at b/tests/torture.at
index 1eefd71..8ecda23 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -1410,6 +1410,11 @@ AT_CHECK([cd builddir && ../configure $configure_options 
--silent], 0, [])
 AT_CHECK([cd builddir && ./config.status --recheck], 0, [stdout])
 AT_CHECK([grep 'creating \./config.status' stdout], 0, [ignore])
 
+# --cache-file is adjusted for subdirectories, so the cache is shared.
+AT_CHECK([cd builddir && ../configure $configure_options --config-cache],
+        [], [stdout])
+AT_CHECK([grep 'loading .*\.\./config.cache' stdout], [], [ignore])
+
 # Make sure we can run autoreconf on a subdirectory
 rm -f configure configure.in
 AT_CHECK([autoreconf inner], [], [], [ignore])


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

[Prev in Thread] Current Thread [Next in Thread]