]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* tests/torture.at (Configuring subdirectories): New test.
authorAkim Demaille <akim@epita.fr>
Mon, 20 Aug 2001 14:46:02 +0000 (14:46 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 20 Aug 2001 14:46:02 +0000 (14:46 +0000)
* lib/autoconf/general.m4 (_AC_INIT_SRCDIR): Say what you are
looking for.
* m4/atconfig.m4: Be sure the let $[0] be expandable.
(top_srcdir): Fix its computation.

ChangeLog
lib/autoconf/general.m4
m4/atconfig.m4
tests/Makefile.am
tests/Makefile.in
tests/torture.at

index 4d47b88af10677984c9fcd10a0066d9a922e482b..1e1c6f596bf14b40a958dde8c0da75b524cf16ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-08-20  Akim Demaille  <akim@epita.fr>
+
+       * tests/torture.at (Configuring subdirectories): New test.
+       * lib/autoconf/general.m4 (_AC_INIT_SRCDIR): Say what you are
+       looking for.
+       * m4/atconfig.m4: Be sure the let $[0] be expandable.
+       (top_srcdir): Fix its computation.
+
 2001-08-20  Akim Demaille  <akim@epita.fr>
 
        * lib/autoconf/general.m4 (_AC_OUTPUT_COMMANDS): Say what you do.
index bc2ce7c81c5cbc3d7e112d7f02b5c2c49e0d87b5..cada686df48dc0d4895b1e95c1e3195508ee3cbb 100644 (file)
@@ -659,9 +659,9 @@ else
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    AC_MSG_ERROR([cannot find sources in $ac_confdir or ..])
+    AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $ac_confdir or ..])
   else
-    AC_MSG_ERROR([cannot find sources in $srcdir])
+    AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
   fi
 fi
 dnl Double slashes in pathnames in object file debugging info
index 811a5c0ea4aff851d3e55378776c74eb0dcde8f7..dfcb23009fd14e0fade1f485753077b088077869 100644 (file)
@@ -32,9 +32,9 @@
 AC_DEFUN([AT_CONFIG],
 [AC_CONFIG_COMMANDS([$1/atconfig],
 [cat >$1/atconfig <<EOF
-# Configurable variable values for building test suites.
-# Generated by $[0]
-# Copyright 2000, 2001 Free Software Foundation, Inc.
+@%:@ Configurable variable values for building test suites.
+@%:@ Generated by $[0]
+@%:@ Copyright 2000, 2001 Free Software Foundation, Inc.
 
 at_package='$at_package'
 at_version='$at_version'
@@ -60,7 +60,7 @@ at_n='$ECHO_N'
 at_c='$ECHO_C'
 
 srcdir='$srcdir'
-top_srcdir='$top_srcdir'
+top_srcdir=`echo '$1/' | sed 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,/$,,'`
 
 at_shell='$SHELL'
 at_path_separator='$PATH_SEPARATOR'
index a218bc30ee6e3a2c80ed08ba4b1583da61397704..624a0116ec8c252c70933d1baa69a486ac5be6d2 100644 (file)
@@ -129,4 +129,4 @@ maintainer-check-c++:
        CC=g++ make check
 
 clean-local:
-       -rm -rf autom4te.cache
+       -rm -rf autom4te.cache builddir inner
index e66efd44be79d90019b24eb561db7ef640b8f0a5..3d208448e1b78d0a495da342cc4470a03e22a9db 100644 (file)
@@ -255,7 +255,7 @@ maintainer-check-c++:
        CC=g++ make check
 
 clean-local:
-       -rm -rf autom4te.cache
+       -rm -rf autom4te.cache builddir inner
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index c3b50657de6a29400007f7e2b042cad8c0b6c4ff..29f1201b1191e88514eed936a9353df24806163f 100644 (file)
@@ -389,6 +389,7 @@ AT_DATA([dummy.in],
 # configure.ac #
 # ------------ #
 
+m4_pattern_allow([^m4_(define|defun)$])
 AT_DATA([configure.ac],
 dnl The following lines transfer AT_DUMMY_VAR, AT_DESCRIPTION, and
 dnl AT_BIG_VALUE into the configure.ac as AC_DUMMY_VAR etc.
@@ -497,3 +498,84 @@ AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE([], 1, ignore, ignore)
 
 AT_CLEANUP
+
+
+## ---------------------------- ##
+## Configuring subdirectories.  ##
+## ---------------------------- ##
+
+# .
+# |-- builddir
+# |   |-- config.log
+# |   |-- config.status
+# |   `-- inner
+# |       |-- config.log
+# |       |-- config.status
+# |       `-- innermost
+# |           `-- config
+# |-- configure
+# |-- configure.ac
+# |-- inner
+# |   |-- configure
+# |   |-- configure.ac
+# |   `-- innermost
+# |       `-- config.in
+# `-- install-sh
+#
+AT_SETUP([Configuring subdirectories])
+
+# The contents of `inner/', and `inner/innermost/'.
+AS_MKDIR_P([inner/innermost])
+
+AT_DATA([inner/configure.ac],
+[AC_INIT(GNU Inner, 1.0)
+AC_CONFIG_SRCDIR([innermost/config.in])
+AC_ARG_VAR([INNER], [an inner variable])
+AC_SUBST([INNER], "inner")
+AC_CONFIG_FILES([innermost/config])
+AC_OUTPUT
+])
+
+AT_DATA([inner/innermost/config.in],
+[INNER=@INNER@
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+])
+
+# The contents of `.'
+AT_DATA([install-sh], [])
+
+AT_DATA([configure.ac],
+[AC_INIT(GNU Outer, 1.0)
+AC_ARG_VAR([OUTER], [an outer variable])
+AC_CONFIG_SUBDIRS([inner])
+AC_OUTPUT
+])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOCONF([-o inner/configure inner/configure.ac])
+AT_CHECK([test -f inner/configure])
+
+# Running the outer configure recursively should provide the innermost
+# help strings.
+AT_CHECK([./configure --help=recursive | grep INNER], 0, [ignore])
+
+# Running the outer configure should trigger the inner.
+AT_CHECK_CONFIGURE
+AT_CHECK([cat inner/innermost/config], 0,
+[INNER=inner
+srcdir=.
+top_srcdir=..
+])
+
+# The same, but from a builddir.
+AS_MKDIR_P([builddir])
+AT_CHECK([cd builddir && ../configure], 0, [ignore])
+AT_CHECK([cat builddir/inner/innermost/config], 0,
+[INNER=inner
+srcdir=../../../inner/innermost
+top_srcdir=../../../inner
+])
+
+
+AT_CLEANUP(inner builddir)