[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
autoreconf + AC_CONFIG_SUBDIRS + non-AC package
From: |
Noah Misch |
Subject: |
autoreconf + AC_CONFIG_SUBDIRS + non-AC package |
Date: |
Wed, 29 Dec 2004 23:08:55 -0800 |
User-agent: |
Mutt/1.5.6i |
AC_CONFIG_SUBDIRS runs configure scripts in the specified directories regardless
of whether they appear to be products of Autoconf, but autoreconf raises an
error if such a subdirectory contains no configure.{in,ac}. This patch makes
autoreconf tolerate non-Autoconf subdirectory configure scripts, but it will
still raise an error if a directory the user specified on the command line or
the default (`.') has no configure.{in,ac}.
Passes `make check'.
Original report:
http://lists.gnu.org/archive/html/autoconf/2004-07/msg00013.html
2004-12-30 Noah Misch <address@hidden>
* bin/autoreconf.in (autoreconf_current_directory): No configure.ac or
configure.in is not an error (for subdirectories). Reported by Charles
'Buck' Krasic.
(Main): Lack of configure.ac or configure.in in a top-level target
directory _is_ an error.
* tests/torture.at (autoreconf and non-AC configure)
(autoreconf an empty directory): New tests.
diff -U4 -rpX dontdiff ac-clean/bin/autoreconf.in
ac-reconf_nonac/bin/autoreconf.in
--- ac-clean/bin/autoreconf.in 2004-02-23 03:27:51.000000000 -0500
+++ ac-reconf_nonac/bin/autoreconf.in 2004-12-29 23:41:23.828461559 -0500
@@ -5,9 +5,9 @@
eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
if 0;
# autoreconf - install the GNU Build System in a directory tree
-# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
+# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -296,26 +296,28 @@ sub run_aclocal ($$)
# &autoreconf_current_directory
# -----------------------------
sub autoreconf_current_directory ()
{
- my $configure_ac = require_configure_ac;
+ my $configure_ac = find_configure_ac;
# ---------------------- #
# Is it using Autoconf? #
# ---------------------- #
my $uses_autoconf;
my $uses_gettext;
- my $configure_ac_file = new Autom4te::XFile $configure_ac;
- while ($_ = $configure_ac_file->getline)
- {
- s/#.*//;
- s/dnl.*//;
- $uses_autoconf = 1 if /AC_INIT/;
- # See below for why we look for gettext here.
- $uses_gettext = 1 if /^AM_GNU_GETTEXT_VERSION/;
- }
-
+ if(-f $configure_ac)
+ {
+ my $configure_ac_file = new Autom4te::XFile $configure_ac;
+ while ($_ = $configure_ac_file->getline)
+ {
+ s/#.*//;
+ s/dnl.*//;
+ $uses_autoconf = 1 if /AC_INIT/;
+ # See below for why we look for gettext here.
+ $uses_gettext = 1 if /^AM_GNU_GETTEXT_VERSION/;
+ }
+ }
if (!$uses_autoconf)
{
verb "$configure_ac: not using Autoconf";
return;
@@ -653,8 +652,9 @@ parse_args;
# Autoreconf all the given configure.ac. A while loop, not a for,
# since the list can change at runtime because of AC_CONFIG_SUBDIRS.
for my $directory (@ARGV)
{
+ require_configure_ac;
autoreconf ($directory);
}
### Setup "GNU" style for perl-mode and cperl-mode.
diff -U4 -rpX dontdiff ac-clean/tests/torture.at
ac-reconf_nonac/tests/torture.at
--- ac-clean/tests/torture.at 2004-08-20 15:58:08.000000000 -0400
+++ ac-reconf_nonac/tests/torture.at 2004-12-29 23:50:46.054531472 -0500
@@ -707,4 +707,66 @@ AT_CHECK([grep INNERMOST builddir/inner/
[[#define INNERMOST build/tsomrenni
]])
AT_CLEANUP
+
+
+
+## ------------------------------- ##
+## autoreconf and non-AC configure ##
+## ------------------------------- ##
+
+AT_SETUP([autoreconf and non-AC configure])
+AT_KEYWORDS([autoreconf])
+
+# We use aclocal (via autoreconf).
+AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
+
+AT_DATA([install-sh], [])
+AT_DATA([configure.in],
+[[AC_INIT(GNU Outer, 1.0)
+AC_CONFIG_SUBDIRS([inner])
+AC_OUTPUT
+]])
+
+AS_MKDIR_P([inner])
+
+AT_DATA([inner/configure],
+[[#! /bin/sh
+case "$*" in
+ *--help*) echo 'No Autoconf here, folks!' ;;
+ *) echo got_it >myfile ;;
+esac
+exit 0
+]])
+chmod +x inner/configure
+
+AT_CHECK([autoreconf -Wall -v], 0, [ignore], [ignore])
+
+# Running the outer configure recursively should provide the innermost
+# help strings.
+AT_CHECK([./configure --help=recursive | grep "folks"], 0, [ignore])
+
+# Running the outer configure should trigger the inner.
+AT_CHECK([./configure], 0, [ignore])
+AT_CHECK([test -f inner/myfile], 0)
+
+AT_CLEANUP
+
+
+
+## ----------------------------- ##
+## autoreconf an empty directory ##
+## ----------------------------- ##
+
+AT_SETUP([autoreconf an empty directory])
+AT_KEYWORDS([autoreconf])
+
+# We use aclocal (via autoreconf).
+AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
+
+# The test group directory is not necessarily _empty_, but it does not contain
+# files meaningful to `autoreconf'.
+
+AT_CHECK([autoreconf -Wall -v], 1, [ignore], [ignore])
+
+AT_CLEANUP
diff -U4 -rpX dontdiff ac-clean/THANKS ac-reconf_nonac/THANKS
--- ac-clean/THANKS 2004-11-29 16:44:45.000000000 -0500
+++ ac-reconf_nonac/THANKS 2004-12-30 00:08:49.201311447 -0500
@@ -31,8 +31,9 @@ Bram Moolenaar address@hidden
Bruno Haible address@hidden
Carl Edman address@hidden
Carlos Velasco address@hidden
Chad R. Larson address@hidden
+Charles 'Buck' Krasic address@hidden
Chris P. Ross address@hidden
Chris Provenzano address@hidden
Christian Cornelssen address@hidden
Christian Krackowizer address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- autoreconf + AC_CONFIG_SUBDIRS + non-AC package,
Noah Misch <=