]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* aclocal.in (configure_ac): Do not call require_configure_ac
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 7 Sep 2003 09:55:36 +0000 (09:55 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 7 Sep 2003 09:55:36 +0000 (09:55 +0000)
before parsing the options.
* automake.in (configure_ac): Likewise.
* lib/Automake/Variable.pm (configure_ac): Do not require configure.ac,
find it.
* lib/Automake/Configure_ac.pm (require_configure_ac):
find_configure_ac never return an undefined value, so test
the file's existence instead.
* tests/Makefile.am (TESTS): Add help.test.
* tests/help.test: New file.

ChangeLog
aclocal.in
automake.in
lib/Automake/Configure_ac.pm
lib/Automake/Variable.pm
tests/Makefile.am
tests/Makefile.in
tests/help.test [new file with mode: 0755]

index 6f26df5cddf41dd8e8358c958ab30b00928182a0..96da2053d0103c62725a8aed15a5ea132418fe6f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2003-09-07  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * aclocal.in (configure_ac): Do not call require_configure_ac
+       before parsing the options.
+       * automake.in (configure_ac): Likewise.
+       * lib/Automake/Variable.pm (configure_ac): Do not require configure.ac,
+       find it.
+       * lib/Automake/Configure_ac.pm (require_configure_ac):
+       find_configure_ac never return an undefined value, so test
+       the file's existence instead.
+       * tests/Makefile.am (TESTS): Add help.test.
+       * tests/help.test: New file.
+
 2003-09-06  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * lib/Automake/XFile.pm: Update to use ChannelDefs.
index c5635f734e5d76d8274a7d7fa4ea24fd457c9169..c047ada2eef5488cd925b894ec87bb897093ad99 100644 (file)
@@ -54,7 +54,7 @@ $default_dirlist = "$default_acdir/dirlist";
 # Some globals.
 
 # configure.ac or configure.in.
-my $configure_ac = require_configure_ac;
+my $configure_ac;
 
 # Output file name.
 $output_file = 'aclocal.m4';
@@ -99,6 +99,7 @@ $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
 \f
 
 local (@dirlist) = &parse_arguments (@ARGV);
+$configure_ac = require_configure_ac;
 &scan_m4_files (@dirlist);
 &scan_configure;
 if (! $exit_code)
index 2e9176103f3c702105f747b6b9ea54c44a19efb5..cd182f7427282fea7c866f19da6125d8a86b23a8 100755 (executable)
@@ -289,7 +289,7 @@ my $force_missing = 0;
 ## ---------------------------------------- ##
 
 # Name of the configure.ac file.
-my $configure_ac = require_configure_ac;
+my $configure_ac;
 
 # Files found by scanning configure.ac for LIBOBJS.
 my %libsources = ();
@@ -6901,6 +6901,8 @@ parse_WARNINGS;
 # Parse command line.
 parse_arguments;
 
+$configure_ac = require_configure_ac;
+
 # Do configure.ac scan only once.
 scan_autoconf_files;
 
index f8523dc81844d820f702fb31c4ee9d585657112d..99acf39ab72047b3a9467a9c498872bf502a68b6 100644 (file)
@@ -79,7 +79,7 @@ sub require_configure_ac (;$)
 {
   my $res = find_configure_ac (@_);
   fatal "`configure.ac' or `configure.in' is required"
-    unless defined $res;
+    unless -f $res;
   return $res
 }
 
index 6c63337af8fcdf8484735b092efe867ee7e6ceec..b9ded9187f0c54c0d60157d41b2a2707a7823254 100644 (file)
@@ -180,7 +180,7 @@ my %_ac_macro_for_var =
    );
 
 # The name of the configure.ac file.
-my $configure_ac = require_configure_ac;
+my $configure_ac = find_configure_ac;
 
 # Variables that can be overriden without complaint from -Woverride
 my %_silent_variable_override =
index c96967892b8a1798015f42405a1b34392b61d8b1..ae6ed2686c5997708a6aab7ed9c0062870070813 100644 (file)
@@ -221,6 +221,7 @@ gnits.test \
 gnits2.test \
 gnits3.test \
 header.test \
+help.test \
 implicit.test \
 include.test \
 include2.test \
index 446860ef2978a9e9e2e69be94e80f23c5cf57d8e..dff977e75d4986d7376516dc710f01e865043f1c 100644 (file)
@@ -331,6 +331,7 @@ gnits.test \
 gnits2.test \
 gnits3.test \
 header.test \
+help.test \
 implicit.test \
 include.test \
 include2.test \
diff --git a/tests/help.test b/tests/help.test
new file mode 100755 (executable)
index 0000000..623a301
--- /dev/null
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure --help and --version work, even when no configure.ac
+# is in the current directory.
+
+. ./defs || exit 1
+
+set -e
+
+# Ensure we are run from the right directory.
+# (The last thing we want is to delete some random user files.)
+test -f ../defs
+rm -f *
+
+$ACLOCAL --version
+$ACLOCAL --help
+$AUTOMAKE --version
+$AUTOMAKE --help
+
+# aclocal and automake cannot work without configure.ac or configure.in
+$ACLOCAL 2>stderr && exit 1
+grep configure.ac stderr
+grep configure.in stderr
+AUTOMAKE_fails
+grep configure.ac stderr
+grep configure.in stderr