From 9e88c16c51540a59394ac9bcc607746ebcbd90d0 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 7 Sep 2003 09:55:36 +0000 Subject: [PATCH] * 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. --- ChangeLog | 13 +++++++++++ aclocal.in | 3 ++- automake.in | 4 +++- lib/Automake/Configure_ac.pm | 2 +- lib/Automake/Variable.pm | 2 +- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/help.test | 44 ++++++++++++++++++++++++++++++++++++ 8 files changed, 66 insertions(+), 4 deletions(-) create mode 100755 tests/help.test diff --git a/ChangeLog b/ChangeLog index 6f26df5cd..96da2053d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-09-07 Alexandre Duret-Lutz + + * 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 * lib/Automake/XFile.pm: Update to use ChannelDefs. diff --git a/aclocal.in b/aclocal.in index c5635f734..c047ada2e 100644 --- a/aclocal.in +++ b/aclocal.in @@ -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]+))\\)"; local (@dirlist) = &parse_arguments (@ARGV); +$configure_ac = require_configure_ac; &scan_m4_files (@dirlist); &scan_configure; if (! $exit_code) diff --git a/automake.in b/automake.in index 2e9176103..cd182f742 100755 --- a/automake.in +++ b/automake.in @@ -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; diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm index f8523dc81..99acf39ab 100644 --- a/lib/Automake/Configure_ac.pm +++ b/lib/Automake/Configure_ac.pm @@ -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 } diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 6c63337af..b9ded9187 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -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 = diff --git a/tests/Makefile.am b/tests/Makefile.am index c96967892..ae6ed2686 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -221,6 +221,7 @@ gnits.test \ gnits2.test \ gnits3.test \ header.test \ +help.test \ implicit.test \ include.test \ include2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 446860ef2..dff977e75 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..623a301a1 --- /dev/null +++ b/tests/help.test @@ -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 -- 2.47.2