automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: do not call require_configure_ac before --help or --version


From: Alexandre Duret-Lutz
Subject: FYI: do not call require_configure_ac before --help or --version
Date: Sun, 07 Sep 2003 11:55:21 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

The was a bug in require_configure_ac that prevented any diagnostic
from being issued.  Once I fixed it, I discovered that running
--help and --version was impossible in directory without a configure.(ac|in)
because require_configure_ac was run too early.

I'm installing the following fix on HEAD.

2003-09-07  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: aclocal.in
===================================================================
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.90
diff -u -r1.90 aclocal.in
--- aclocal.in  6 Sep 2003 21:10:38 -0000       1.90
+++ aclocal.in  7 Sep 2003 09:50:37 -0000
@@ -54,7 +54,7 @@
 # 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 @@
 
 
 local (@dirlist) = &parse_arguments (@ARGV);
+$configure_ac = require_configure_ac;
 &scan_m4_files (@dirlist);
 &scan_configure;
 if (! $exit_code)
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1503
diff -u -r1.1503 automake.in
--- automake.in 6 Sep 2003 21:10:38 -0000       1.1503
+++ automake.in 7 Sep 2003 09:50:41 -0000
@@ -289,7 +289,7 @@
 ## ---------------------------------------- ##
 
 # 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 = ();
@@ -6900,6 +6900,8 @@
 
 # Parse command line.
 parse_arguments;
+
+$configure_ac = require_configure_ac;
 
 # Do configure.ac scan only once.
 scan_autoconf_files;
Index: lib/Automake/Configure_ac.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Configure_ac.pm,v
retrieving revision 1.3
diff -u -r1.3 Configure_ac.pm
--- lib/Automake/Configure_ac.pm        21 Aug 2003 08:49:25 -0000      1.3
+++ lib/Automake/Configure_ac.pm        7 Sep 2003 09:50:41 -0000
@@ -79,7 +79,7 @@
 {
   my $res = find_configure_ac (@_);
   fatal "`configure.ac' or `configure.in' is required"
-    unless defined $res;
+    unless -f $res;
   return $res
 }
 
Index: lib/Automake/Variable.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Variable.pm,v
retrieving revision 1.20
diff -u -r1.20 Variable.pm
--- lib/Automake/Variable.pm    6 Sep 2003 05:36:56 -0000       1.20
+++ lib/Automake/Variable.pm    7 Sep 2003 09:50:42 -0000
@@ -180,7 +180,7 @@
    );
 
 # 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: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.514
diff -u -r1.514 Makefile.am
--- tests/Makefile.am   6 Sep 2003 21:10:39 -0000       1.514
+++ tests/Makefile.am   7 Sep 2003 09:50:42 -0000
@@ -221,6 +221,7 @@
 gnits2.test \
 gnits3.test \
 header.test \
+help.test \
 implicit.test \
 include.test \
 include2.test \
Index: tests/help.test
===================================================================
RCS file: tests/help.test
diff -N tests/help.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/help.test     7 Sep 2003 09:50:42 -0000
@@ -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

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]