]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix for AIX /bin/make. Another bug fix
authorTom Tromey <tromey@redhat.com>
Wed, 20 Nov 1996 02:09:10 +0000 (02:09 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 20 Nov 1996 02:09:10 +0000 (02:09 +0000)
ChangeLog
TODO
automake.in
automake.texi

index b82fb21f76798c44dc55a332c45de39126a2983e..90a0cbd4cabb89e5fb8e05a45c919df96cb1e280 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
+Tue Nov 19 19:03:30 1996  Tom Tromey  <tromey@cygnus.com>
+
+       * automake.in (initialize_per_input): Initialize output_header.
+       (generate_makefile): Set up output_header; print it before
+       output_rules.
+       (handle_footer): Put .SUFFIXES into output_header, for AIX.
+
 Mon Nov 18 13:29:55 1996  Tom Tromey  <tromey@cygnus.com>
 
+       * automake.in (handle_lib_objects): Push @LIBOBJS@ and @ALLOCA@
+       onto dependency list.
+
        * aclocal.in (obsolete_macros): Include AM_SANITY_CHECK_CC; now
        part of autoconf proper.
        * m4/ccsanity.m4: Removed.
diff --git a/TODO b/TODO
index fa7d8d24d1f87e7c421abb434ab329b056e524b6..a251b83029755f682c60a0daa610e3c300f1d672 100644 (file)
--- a/TODO
+++ b/TODO
@@ -58,7 +58,9 @@ From Jason Molenda:
 
 * error messages should print ``[info blah blah]'' command when a
   certain part of the standards apply.  saw idea in message from
-  Craig Burley.
+  Craig Burley.  wouldn't it be really cool if compile-mode in Emacs
+  understood this convention, and you could click on such text to
+  go to the appropriate info page?
 
 !! should write autoconf-style doc entries for each m4 macro
 
index e5a680227d5ce1dfd301dc0f108300909c06600c..a14eddd5499fcb5121edcca12c38378c70de8307 100755 (executable)
@@ -430,8 +430,12 @@ sub generate_makefile
        if &variable_defined ('OBJECTS');
 
     # This is always the default target.  This gives us freedom to do
-    # things in whatever order is convenient.
-    $output_rules .= "default: all\n\n";
+    # things in whatever order is convenient.  Note that we set up
+    # $output_header here so that we can insert some text just after
+    # the "default" target, but before any other targets.  In
+    # particular we want to support the .SUFFIX hack here; this is
+    # documented elsewhere.
+    $output_header = "default: all\n\n";
     push (@phony, 'default');
 
     &read_am_file ($makefile . '.am');
@@ -507,6 +511,7 @@ sub generate_makefile
     print "automake: creating ", $makefile, ".in\n" if $verbose;
 
     print GM_FILE $output_vars;
+    print GM_FILE $output_header;
     print GM_FILE $output_rules;
     print GM_FILE $output_trailer;
 
@@ -1039,6 +1044,8 @@ sub handle_lib_objects
        # dependency list.  Autoconf substitutions are not pushed;
        # rarely is a new dependency substituted into (eg) foo_LDADD
        # -- but "bad things (eg -lX11) are routinely substituted.
+       # Note that LIBOBJS and ALLOCA are exceptions to this rule,
+       # and handled specially below.
        push (@dep_list, $lsearch)
            unless $lsearch =~ /^\@.*\@$/;
 
@@ -1046,6 +1053,7 @@ sub handle_lib_objects
        # means adding entries to dep_files.
        if ($lsearch eq '@LIBOBJS@')
        {
+           push (@dep_list, $lsearch);
            $seen_libobjs = 1;
            if (! keys %libsources)
            {
@@ -1069,6 +1077,7 @@ sub handle_lib_objects
        }
        elsif ($lsearch eq '@ALLOCA@')
        {
+           push (@dep_files, $lsearch);
            &am_line_error ($var,
                            "\@ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`configure.in'")
                if ! defined $libsources{'alloca.c'};
@@ -2430,18 +2439,21 @@ sub handle_footer
        $output_vars .= "\n";
     }
 
-    if (defined $contents{'SUFFIXES'})
+    if (&variable_defined ('SUFFIXES'))
     {
        # Push actual suffixes, and not $(SUFFIXES).  Some versions of
        # make do not like variable substitutions on the .SUFFIXES
        # line.
-       push (@suffixes, split (' ', $contents{'SUFFIXES'}));
+       push (@suffixes, &variable_value_as_list ('SUFFIXES'));
     }
 
-    $output_trailer .= ".SUFFIXES:\n";
+    # Note: AIX 4.1 /bin/make will fail if any suffix rule appears
+    # before .SUFFIXES.  So we make sure that .SUFFIXES appears before
+    # anything else, by sticking it right after the default: target.
+    $output_header .= ".SUFFIXES:\n";
     if (@suffixes)
     {
-       $output_trailer .= ".SUFFIXES: " . join (' ', @suffixes) . "\n";
+       $output_header .= ".SUFFIXES: " . join (' ', @suffixes) . "\n";
     }
     $output_trailer .= &file_contents ('footer');
 }
@@ -3791,6 +3803,7 @@ sub initialize_per_input
     $output_rules = '';
     $output_vars = '';
     $output_trailer = '';
+    $output_header = '';
 
     # Suffixes found during a run.
     @suffixes = ();
index 86c8e06656f0f3ba94af4c35e360914dd1efe5d4..e79128d624a41bd7933cd0ed17f2af49a1d61340 100644 (file)
@@ -663,7 +663,7 @@ This is required if any C++ source is included.
 
 @item AC_PROG_YACC
 If a Yacc source file is seen, then you must either use this macro or
-declare the variable @samp{YACC} in @file{configure.in}.  The former is
+define the variable @samp{YACC} in @file{configure.in}.  The former is
 preferred.
 @cvindex AC_PROG_YACC
 @cvindex YACC
@@ -868,10 +868,9 @@ can share a single source file.  The source file must be listed in each
 Header files listed in a @samp{_SOURCES} definition will be included in
 the distribution but otherwise ignored.  In case it isn't obvious, you
 should not include the header file generated by @file{configure} in an
-@samp{_SOURCES} variable; this file should not be distributed.
-Lex (@samp{.l}) and yacc (@samp{.y}) files can also be listed; support
-for these should work but is still preliminary.
-@c lex & yacc should have a separate section
+@samp{_SOURCES} variable; this file should not be distributed.  Lex
+(@samp{.l}) and yacc (@samp{.y}) files can also be listed; see @ref{Yacc
+and Lex}.
 
 Sometimes it is useful to determine the programs that are to be built at
 configure time.  For instance, GNU @code{cpio} only builds @code{mt} and
@@ -1009,7 +1008,38 @@ This is the command used to actually link a C program.
 @section Yacc and Lex support
 
 Automake has somewhat idiosyncratic support for Yacc and Lex.
-FIXME: describe it here.
+
+Automake assumes that the @samp{.c} file generated by yacc (or lex)
+should be named using the basename of the input file.  That is, for a
+yacc source file @file{foo.y}, automake will cause the intermediate file
+to be named @file{foo.c} (as opposed to @file{y.tab.c}, which is more
+traditional).
+
+Yacc source files must end with the extension @samp{.y}.  Lex source
+files must have the extension @samp{.l}.  You should never explicitly
+mention the intermediate @samp{.c} file in any @samp{SOURCES} variable;
+only list the source file.
+
+The intermediate files generated by yacc (or lex) will be included in
+any distribution that is made.  That way the user doesn't need to have
+yacc or lex.
+
+If a yacc source file is seen, then your @file{configure.in} must define
+the variable @samp{YACC}.  This is most easily done by invoking the
+macro @samp{AC_PROG_YACC}.
+
+Similarly, if a lex source file is seen, then your @file{configure.in}
+must define the variable @samp{LEX}.  You can use @samp{AC_PROG_LEX} to
+do this.  Automake's lex support also requires that you use the
+@samp{AC_DECL_YYTEXT} macro -- automake needs to know the value of
+@samp{LEX_OUTPUT_ROOT}.
+
+Any program including a lex source file must be linked against
+@samp{@@LEXLIB@@}.  You can do this by puttins @samp{@@LEXLIB@@} into
+the appropriate @samp{LDADD} variable.
+
+Automake makes it possible to include multiple yacc (or lex) source
+files in a single program.
 
 
 @node C++