scan aclocal.m4
authorTom Tromey <tromey@redhat.com>
Sun, 8 Dec 1996 00:50:02 +0000 (00:50 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 8 Dec 1996 00:50:02 +0000 (00:50 +0000)
ChangeLog
TODO
automake.in

index d4c0bc7..8f1f910 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 Sat Dec  7 11:34:39 1996  Tom Tromey  <tromey@cygnus.com>
 
+       * automake.in (scan_one_configure_file): New sub.
+       (scan_configure): Scan aclocal.m4 as well as configure.in.
+       (handle_configure): Makefile.in now depends on $(ACLOCAL), because
+       automake scans it.
+
        * automake.in (handle_configure): Put full path to file onto
        @rewritten_inputs.  Test output4.test.
 
diff --git a/TODO b/TODO
index 5414716..27160d8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -13,26 +13,6 @@ non-C source in a libtool library specification.
 * must split $obj into two parts: one for libtool and one for
   deansification.  Otherwise .S files will be deansified!
 
-* automake must scan aclocal.m4
-  this means Makefile.in must depend on aclocal.m4 as well
-
-* for new autoconf:
-  * completely handle multi-":" mode for AC_CONFIG_HEADER
-  * Scan multiple input files when Makefile is generated?
-    This would provide flexibility for large projects; subsumes
-    the "Makefile.tmpl" idea
-
-   [ can't do this.  must explain why in manual.
-     basically, solving all the problems is too hard
-     like: how to remove redundancies between generated .in files
-     instead should implement `include' directive for Makefile.am ]
-
-  * figure out what to pass as CONFIG_HEADER to config.status
-
-  * for multi-":" mode and AC_OUTPUT, it would be good to pick the
-    first input file that has a corresponding .am file.
-    There are other bugs here too.
-
 * look @ jim's $(t:=foo) problem
 
 * should install-foo target for a new dir (eg fooexecdir) be run via
@@ -42,6 +22,8 @@ non-C source in a libtool library specification.
 
 ================================================================
 
+* CONFIG_HEADER is passed incorrectly in ":" mode.
+
 * put parser.h into distribution if "yacc -d" is used
 
 * only remove libtool at top level?
@@ -69,6 +51,19 @@ Further:
 
 Avoid loops when installing; instead unroll them in automake
 
+* for new autoconf:
+  * completely handle multi-":" mode for AC_CONFIG_HEADER
+  * Scan multiple input files when Makefile is generated?
+    This would provide flexibility for large projects; subsumes
+    the "Makefile.tmpl" idea
+
+   [ can't do this.  must explain why in manual.
+     basically, solving all the problems is too hard
+     like: how to remove redundancies between generated .in files
+     instead should implement `include' directive for Makefile.am ]
+* for multi-":" mode and AC_OUTPUT, it might be good to pick the
+  first input file that has a corresponding .am file.
+
 Some long-term projects:
 * if $(FOO) is used somewhere, ensure FOO is defined, either by
   user or by automake if possible
index dd825b8..3999b5c 100755 (executable)
@@ -2369,7 +2369,8 @@ sub handle_configure
     # This rule remakes the Makefile.in.  Note use of @MAINT@ forces
     # us to abandon pretty-printing.  Sigh.
     $output_rules .= ($infile . ': ' . ($seen_maint_mode ? '@MAINT@ ' : '')
-                     . $amfile . ' ' . '$(top_srcdir)/configure.in '
+                     . $amfile . ' '
+                     . '$(top_srcdir)/configure.in $(ACLOCAL) '
                      . join (' ', @rewritten) . "\n"
                      . "\tcd \$(top_srcdir) && automake "
                      . ($cygnus_mode ? '--cygnus' : ('--' . $strictness_name))
@@ -3144,21 +3145,15 @@ sub handle_emacs_lisp
 
 ################################################################
 
-# Scan configure.in for interesting things.
-sub scan_configure
+# Scan one file for interesting things.  Subroutine of scan_configure.
+sub scan_one_configure_file
 {
-    open (CONFIGURE, 'configure.in')
-       || die "automake: couldn't open \`configure.in': $!\n";
-    print "automake: reading configure.in\n" if $verbose;
+    local ($filename) = @_;
 
-    # Reinitialize libsources here.  This isn't really necessary,
-    # since we currently assume there is only one configure.in.  But
-    # that won't always be the case.
-    %libsources = ();
+    open (CONFIGURE, $filename)
+       || die "automake: couldn't open \`$filename': $!\n";
+    print "automake: reading $filename\n" if $verbose;
 
-    local ($in_ac_output, $in_ac_replace) = (0, 0);
-    local (%make_list, @make_input_list);
-    local ($libobj_iter);
     while (<CONFIGURE>)
     {
        # Remove comments from current line.
@@ -3423,6 +3418,26 @@ sub scan_configure
        }
     }
 
+    close (CONFIGURE);
+}
+
+# Scan configure.in and aclocal.m4 for interesting things.  We must
+# scan aclocal.m4 because there might be AC_SUBSTs and such there.
+sub scan_configure
+{
+    # Reinitialize libsources here.  This isn't really necessary,
+    # since we currently assume there is only one configure.in.  But
+    # that won't always be the case.
+    %libsources = ();
+
+    local ($in_ac_output, $in_ac_replace) = (0, 0);
+    local (%make_list, @make_input_list);
+    local ($libobj_iter);
+
+    &scan_one_configure_file ('configure.in');
+    &scan_one_configure_file ('aclocal.m4')
+       if -f 'aclocal.m4';
+
     # Set input and output files if not specified by user.
     if (! @input_files)
     {
@@ -3430,8 +3445,6 @@ sub scan_configure
        %output_files = %make_list;
     }
 
-    close (CONFIGURE);
-
     &am_conf_error ("\`PACKAGE' not defined in configure.in")
         if ! $seen_package;
     &am_conf_error ("\`VERSION' not defined in configure.in")