[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
35-test-subdir.patch
From: |
Akim Demaille |
Subject: |
35-test-subdir.patch |
Date: |
Mon, 20 Aug 2001 16:48:06 +0200 |
There are really things I don't understand too well with all the
ac_dots trciks we play. I'm surprised this test passes, but it
does...
Index: ChangeLog
from Akim Demaille <address@hidden>
* 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.
Index: lib/autoconf/general.m4
--- lib/autoconf/general.m4 Sun, 19 Aug 2001 13:08:48 +0200 akim
+++ lib/autoconf/general.m4 Sun, 19 Aug 2001 17:33:10 +0200 akim
@@ -659,9 +659,9 @@ m4_define([_AC_INIT_SRCDIR],
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: m4/atconfig.m4
--- m4/atconfig.m4 Sun, 19 Aug 2001 14:07:01 +0200 akim
+++ m4/atconfig.m4 Sun, 19 Aug 2001 17:23:44 +0200 akim
@@ -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.
address@hidden:@ Configurable variable values for building test suites.
address@hidden:@ Generated by $[0]
address@hidden:@ Copyright 2000, 2001 Free Software Foundation, Inc.
at_package='$at_package'
at_version='$at_version'
@@ -60,7 +60,7 @@ AC_DEFUN([AT_CONFIG],
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: tests/Makefile.am
--- tests/Makefile.am Sun, 19 Aug 2001 14:07:01 +0200 akim
+++ tests/Makefile.am Sun, 19 Aug 2001 18:01:57 +0200 akim
@@ -129,4 +129,4 @@ maintainer-check-posix: expr
CC=g++ make check
clean-local:
- -rm -rf autom4te.cache
+ -rm -rf autom4te.cache builddir inner
Index: tests/torture.at
--- tests/torture.at Sun, 19 Aug 2001 11:37:40 +0200 akim
+++ tests/torture.at Sun, 19 Aug 2001 18:00:35 +0200 akim
@@ -389,6 +389,7 @@ m4_define([AT_DUMMY_VAR],
# 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 @@ m4_define([AT_DUMMY_VAR],
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],
address@hidden@
address@hidden@
address@hidden@
+])
+
+# 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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 35-test-subdir.patch,
Akim Demaille <=