automake-patches
[Top][All Lists]
Advanced

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

Re: FYI: autoheader -vs- AC_CONFIG_HEADERS (Was: Re: Conditionally compi


From: Alexandre Duret-Lutz
Subject: Re: FYI: autoheader -vs- AC_CONFIG_HEADERS (Was: Re: Conditionally compiling Java)
Date: 14 Jun 2002 08:05:51 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Raja" == Raja R Harinath <address@hidden> writes:

[...]

 Raja> But, I don't think this addresses the failure of 'autoheader' when
 Raja> configure.in use AM_CONFIG_HEADER([foo]).  AM_CONFIG_HEADER needs to
 Raja> be defined in terms of AC_CONFIG_HEADERS for 'autoheader' to work
 Raja> with semi-legacy configure.in files.

Thanks for catching this.

 Raja> I would suggest that you replace the current definition of
 Raja> AM_CONFIG_HEADER with _AM_CONFIG_HEADERS, which is traced, and which
 Raja> is used in the INSINUATion.  Then, revert AM_CONFIG_HEADER to

 Raja> AU_DEFUN([AM_CONFIG_HEADER],[AC_CONFIG_HEADERS([$1])])

 Raja> (This also solves the singular/plural identity crisis in the current
 Raja> definition of AM_CONFIG_HEADER.)

Great!  This also cleanups the Automake code: we can now
trace AC_CONFIG_HEADERS like autoheader does.

I'm checking in this.

2002-06-14  Alexandre Duret-Lutz  <address@hidden>

        * m4/header.m4 (AM_CONFIG_HEADER): Rename to ...
        (_AM_CONFIG_HEADERS): ... this.
        (_AM_CONFIG_HEADER_INSINUATE): Define AC_CONFIG_HEADERS to
        call _AM_CONFIG_HEADERS; and AM_CONFIG_HEADER to call
        AC_CONFIG_HEADERS.
        * automake.in (scan_autoconf_traces): Trace AC_CONFIG_HEADERS
        instead of AM_CONFIG_HEADER.
        * tests/autoheader2.test: New file.
        * tests/Makefile.am (TESTS): Add autoheader2.test.
        Suggested by Raja R Harinath.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1303
diff -u -r1.1303 automake.in
--- automake.in 13 Jun 2002 08:48:10 -0000      1.1303
+++ automake.in 14 Jun 2002 06:44:55 -0000
@@ -4592,6 +4592,7 @@
                  AC_CANONICAL_SYSTEM
                  AC_CONFIG_AUX_DIR
                  AC_CONFIG_FILES
+                 AC_CONFIG_HEADERS
                  AC_INIT
                  AC_LIBSOURCE
                  AC_PROG_LEX
@@ -4599,7 +4600,6 @@
                  AC_SUBST
                  AM_AUTOMAKE_VERSION
                  AM_CONDITIONAL
-                 AM_CONFIG_HEADER
                  AM_C_PROTOTYPES
                  AM_GNU_GETTEXT
                  AM_INIT_AUTOMAKE
@@ -4649,6 +4649,11 @@
          $ac_config_files_location = $here;
          &scan_autoconf_config_files ($args[1]);
        }
+      elsif ($macro eq 'AC_CONFIG_HEADERS')
+       {
+         $config_header_location = $here;
+         push @config_headers, split (' ', $args[1]);
+       }
       elsif ($macro eq 'AC_INIT')
         {
          if (defined $args[2])
@@ -4696,11 +4701,6 @@
       elsif ($macro eq 'AM_CONDITIONAL')
        {
          $configure_cond{$args[1]} = $here;
-       }
-      elsif ($macro eq 'AM_CONFIG_HEADER')
-       {
-         $config_header_location = $here;
-         push @config_headers, split (' ', $args[1]);
        }
       elsif ($macro eq 'AM_C_PROTOTYPES')
        {
Index: m4/header.m4
===================================================================
RCS file: /cvs/automake/automake/m4/header.m4,v
retrieving revision 1.16
diff -u -r1.16 header.m4
--- m4/header.m4        13 Jun 2002 19:45:20 -0000      1.16
+++ m4/header.m4        14 Jun 2002 06:44:55 -0000
@@ -70,11 +70,11 @@
 ])# _AM_CONFIG_HEADER
 
 
-# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
-# --------------------------------------------------------------
-AC_DEFUN([AM_CONFIG_HEADER],
+# _AM_CONFIG_HEADERS(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
+# ----------------------------------------------------------------
+AC_DEFUN([_AM_CONFIG_HEADERS],
 [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
-])# AM_CONFIG_HEADER
+])# _AM_CONFIG_HEADERS
 
 
 # _AM_CONFIG_HEADER_INSINUATE
@@ -91,6 +91,8 @@
 dnl lose the --trace bit of AC_CONFIG_HEADERS if we undefine it.)
 m4_copy([AC_CONFIG_HEADERS], [_AM_AC_CONFIG_HEADERS])dnl
 dnl Override AC_CONFIG_HEADERS with ours.
-dnl (Don't use m4_copy because we are tracing AM_CONFIG_HEADER.)
-AC_DEFUN([AC_CONFIG_HEADERS], [AM_CONFIG_HEADER($][@)])dnl
+AC_DEFUN([AC_CONFIG_HEADERS], [_AM_CONFIG_HEADERS($][@)])dnl
+dnl Define AM_CONFIG_HEADERS (obsolete) in terms of AC_CONFIG_HEADERS.
+dnl This way autoheader will `see' the calls to AM_CONFIG_HEADER.
+AC_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($][@)])dnl
 ])
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.407
diff -u -r1.407 Makefile.am
--- tests/Makefile.am   13 Jun 2002 19:45:20 -0000      1.407
+++ tests/Makefile.am   14 Jun 2002 06:44:56 -0000
@@ -31,6 +31,7 @@
 ar.test \
 asm.test \
 autoheader.test \
+autoheader2.test \
 auxdir.test \
 auxdir2.test \
 backsl.test \
Index: tests/autoheader2.test
===================================================================
RCS file: tests/autoheader2.test
diff -N tests/autoheader2.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/autoheader2.test      14 Jun 2002 06:44:57 -0000
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Check that autoheaders works, despite our AC_CONFIG_HEADERS hack.
+
+. $srcdir/defs
+
+set -e
+
+cat >>configure.in <<EOF
+AM_CONFIG_HEADER([thisfile.h])
+EOF
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOHEADER
+
+test -f thisfile.h.in


-- 
Alexandre Duret-Lutz




reply via email to

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