automake-patches
[Top][All Lists]
Advanced

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

configure dependencies, and version.texi dependencies (PR/358).


From: Alexandre Duret-Lutz
Subject: configure dependencies, and version.texi dependencies (PR/358).
Date: 04 Oct 2002 20:24:24 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

What do you folks think of this?

PR/358 suggests to have version.texi dependent on configure
instead of configure.ac, in case the package's version isn't
defined in configure.ac.

In PR/358, the version is defined by sourcing ./VERSION.  Using
today's architecture this isn't a very good idea, because shell
variables can't be traced.  

I'd like to promote the use m4_include/m4_define for this
purpose.  As in the test case below.

If `configure.ac' includes `version.m4', then we should have a
dependency between `configure' and `version.m4'.  Presently this
can be specified using the undocumented (?!)
CONFIGURE_DEPENDENCIES Makefile variable; however I think we
should fill these dependencies automatically.  This patch does that
by tracing m4_include and m4_sinclude.

Question is... is it correct?  I think it is, but I'd like
other opinions.  Especially, note that we'll also see files
included by aclocal.m4.  Akim, does this fits your plan wrt aclocal?

2002-10-04  Alexandre Duret-Lutz  <address@hidden>

        For PR automake/358:
        * lib/am/texi-vers.am (%STAMPVTI%): Depend on configure instead of
        configure.ac.
        Suggested by Thien-Thi Nguyen.
        * lib/am/configure.am ($(srcdir)/configure): Depends on
        %CONFIGURE_DEPS%
        * automake.in (@configure_deps): New array.
        (scan_autoconf_traces): Scan for m4_include and m4_sinclude,
        and fill @configure_deps.
        (handle_configure): Substitute %CONFIGURE_DEPS%.
        Distribute @configure_deps.
        * tests/version7.texi: New file.
        * tests/Makefile.am (TESTS): Add version7.test.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.189
diff -u -r1.189 THANKS
--- THANKS      1 Oct 2002 19:59:32 -0000       1.189
+++ THANKS      4 Oct 2002 18:19:55 -0000
@@ -176,13 +176,13 @@
 Ryan T. Sammartino     address@hidden
 Sergey Vlasov          address@hidden
 Seth Alves             address@hidden
-Shuhei Amakawa         <address@hidden>
+Shuhei Amakawa         address@hidden
 Shigio Yamaguchi       address@hidden
 Steve M. Robbins       address@hidden
 Sven Verdoolaege       address@hidden
 Tatu Ylonen            address@hidden
 The Crimson Binome     address@hidden
-thi                    address@hidden
+Thien-Thi Nguyen       address@hidden
 Thomas Gagne           address@hidden
 Thomas Morgan          address@hidden
 Thomas Tanner          address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1374
diff -u -r1.1374 automake.in
--- automake.in 1 Oct 2002 19:59:32 -0000       1.1374
+++ automake.in 4 Oct 2002 18:20:22 -0000
@@ -407,6 +407,9 @@
 # TRUE if --cygnus seen.
 my $cygnus_mode = 0;
 
+# Files included by @configure.
+my @configure_deps = ();
+
 # Hash table of AM_CONDITIONAL variables seen in configure.
 my %configure_cond = ();
 
@@ -4418,6 +4421,9 @@
 
     my ($regen_aclocal_m4, @aclocal_m4_deps) = scan_aclocal_m4 ();
 
+    push_dist_common (@configure_deps)
+      if $relative_dir eq '.';
+
     $output_rules .=
       &file_contents ('configure',
                      new Automake::Location,
@@ -4434,7 +4440,8 @@
                        => $cmdline_use_dependencies ? '' : ' --ignore-deps',
                      'MAKEFILE-AM-SOURCES' =>  "$input$colon_infile",
                      'REGEN-ACLOCAL-M4'    => $regen_aclocal_m4,
-                     ACLOCAL_M4_DEPS       => "@aclocal_m4_deps");
+                     ACLOCAL_M4_DEPS       => "@aclocal_m4_deps",
+                     CONFIGURE_DEPS        => "@configure_deps");
 
     if ($relative_dir eq '.')
     {
@@ -5163,7 +5170,9 @@
                  AM_GNU_GETTEXT
                  AM_INIT_AUTOMAKE
                  AM_MAINTAINER_MODE
-                 AM_PROG_CC_C_O);
+                 AM_PROG_CC_C_O
+                 m4_include
+                 m4_sinclude);
 
   my $traces = ($ENV{AUTOCONF} || 'autoconf') . " ";
 
@@ -5272,6 +5281,10 @@
       elsif ($macro eq 'AM_PROG_CC_C_O')
        {
          $seen_cc_c_o = $where;
+       }
+      elsif ($macro eq 'm4_include' || $macro eq 'm4_sinclude')
+       {
+         push @configure_deps, '$(top_srcdir)/' . $args[1];
        }
    }
 }
Index: lib/am/configure.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/configure.am,v
retrieving revision 1.14
diff -u -r1.14 configure.am
--- lib/am/configure.am 23 Jul 2002 19:10:50 -0000      1.14
+++ lib/am/configure.am 4 Oct 2002 18:20:23 -0000
@@ -54,7 +54,7 @@
 DIST_COMMON += configure %CONFIGURE-AC%
 
 ## Explicitly look in srcdir for benefit of non-GNU makes.
-$(srcdir)/configure: %MAINTAINER-MODE% $(srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) 
$(CONFIGURE_DEPENDENCIES)
+$(srcdir)/configure: %MAINTAINER-MODE% $(srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) 
$(CONFIGURE_DEPENDENCIES) %CONFIGURE_DEPS%
        cd $(srcdir) && $(AUTOCONF)
 endif %?TOPDIR_P%
 
Index: lib/am/texi-vers.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texi-vers.am,v
retrieving revision 1.22
diff -u -r1.22 texi-vers.am
--- lib/am/texi-vers.am 25 Aug 2002 20:45:51 -0000      1.22
+++ lib/am/texi-vers.am 4 Oct 2002 18:20:23 -0000
@@ -26,9 +26,10 @@
 ## discard any %VTEXI% file found in a VPATH seatch.
 %VTEXI%: %MAINTAINER-MODE% %STAMPVTI%
 
-## Depend on %CONFIGURE-AC% so that version number updates cause a
-## rebuild.
-%STAMPVTI%: %TEXI% $(top_srcdir)/%CONFIGURE-AC%
+## Depend on configure so that version number updates cause a rebuild.
+## (Not configure.ac, because not all setups define the version number
+## in this file.)
+%STAMPVTI%: %TEXI% $(top_srcdir)/configure
 ## It is wrong to have %STAMPTVTI% dependent on %DIRSTAMP%, because
 ## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file
 ## should never be dependent upon a non-distributed built file.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.446
diff -u -r1.446 Makefile.am
--- tests/Makefile.am   30 Sep 2002 18:08:07 -0000      1.446
+++ tests/Makefile.am   4 Oct 2002 18:20:23 -0000
@@ -417,6 +417,7 @@
 version4.test \
 version5.test \
 version6.test \
+version7.test \
 vpath.test \
 vtexi.test \
 vtexi2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.581
diff -u -r1.581 Makefile.in
--- tests/Makefile.in   30 Sep 2002 18:08:07 -0000      1.581
+++ tests/Makefile.in   4 Oct 2002 18:20:25 -0000
@@ -509,6 +509,7 @@
 version4.test \
 version5.test \
 version6.test \
+version7.test \
 vpath.test \
 vtexi.test \
 vtexi2.test \
Index: tests/version7.test
===================================================================
RCS file: tests/version7.test
diff -N tests/version7.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/version7.test 4 Oct 2002 18:20:25 -0000
@@ -0,0 +1,68 @@
+#! /bin/sh
+# Copyright (C) 2002  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 autoconf; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test for a special setup where the package's version isn't defined
+# in configure.in.
+
+required='makeinfo tex'
+. ./defs || exit 1
+
+set -e
+
+cat >configure.in <<'END'
+m4_include([version.m4])
+AC_INIT([version7], [THE_VERSION])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+echo 'm4_define([THE_VERSION], [2.718])' > version.m4
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = zardoz.texi
+
+check:
+       test -f $(srcdir)/version.m4
+END
+
+cat > zardoz.texi << 'END'
+\input texinfo
address@hidden zardoz.info
address@hidden Zardoz
address@hidden Top
+Hello walls.
address@hidden version.texi
address@hidden
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+./configure --version | grep '2\.718'
+./configure
+$MAKE
+grep '2\.718' version.texi
+
+
+echo 'm4_define([THE_VERSION], [3.141])' > version.m4
+$MAKE distcheck
+./configure --version | grep '3\.141'
+grep '3\.141' version.texi

-- 
Alexandre Duret-Lutz





reply via email to

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