From 98a8e4ef0d115c07ad48aea18dc4f59524c1095c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 21 Sep 1996 20:06:36 +0000 Subject: [PATCH] More error checking --- ChangeLog | 4 ++++ automake.in | 29 ++++++++++++++++++++++++++++- automake.texi | 16 +++++++++------- tests/ChangeLog | 5 +++++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/primary.test | 12 ++++++++++++ tests/primary2.test | 13 +++++++++++++ version.texi | 2 +- 9 files changed, 74 insertions(+), 11 deletions(-) create mode 100755 tests/primary.test create mode 100755 tests/primary2.test diff --git a/ChangeLog b/ChangeLog index 2bd647b7..622075a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Sep 21 13:59:15 1996 Tom Tromey + + * automake.in (am_install_var): More error checking. + Fri Sep 20 09:06:37 1996 Tom Tromey * tags.am (TAGS): Minor cleanup. diff --git a/automake.in b/automake.in index 33bb0469..9905c4ad 100755 --- a/automake.in +++ b/automake.in @@ -3617,6 +3617,11 @@ sub am_install_var # for Gnitsoids. local (%valid) = &am_primary_prefixes ($primary, @prefixes); + # If a primary includes a configure substitution, then the EXTRA_ + # form is required. Otherwise we can't properly do our job. + local ($require_extra); + local ($warned_about_extra) = 0; + local ($clean_file) = $file . '-clean'; local ($one_name); local ($X); @@ -3631,7 +3636,23 @@ sub am_install_var foreach $rcurs (&variable_value_as_list ($one_name)) { # Skip configure substitutions. Possibly bogus. - next if $rcurs =~ /^\@.*\@$/; + if ($rcurs =~ /^\@.*\@$/) + { + if ($X eq 'EXTRA') + { + if (! $warned_about_extra) + { + $warned_about_extra = 1; + &am_line_error ($one_name, + "\`$one_name' contains configure substitution, but shouldn't"); + } + } + else + { + $require_extra = $one_name; + } + next; + } push (@result, $rcurs); } @@ -3690,6 +3711,12 @@ sub am_install_var $output_vars .= "\n"; } + if ($require_extra && ! &variable_defined ('EXTRA_' . $primary)) + { + &am_line_error ($require_extra, + "\`$require_extra' contains configure substitution, but \`EXTRA_$primary' not defined"); + } + # Push here because PRIMARY might be configure time determined. push (@all, '$(' . $primary . ')') if $do_all && @used; diff --git a/automake.texi b/automake.texi index 7e83dfc8..394646c5 100644 --- a/automake.texi +++ b/automake.texi @@ -265,15 +265,17 @@ works. @node General Operation @section General Operation -Automake essentially works by reading a @file{Makefile.am} and -generating a @file{Makefile.in}. +Automake works by reading a @file{Makefile.am} and generating a +@file{Makefile.in}. Certain macros and targets defined in the +@file{Makefile.am} instruct automake to generate more specialized code; +for instances a @samp{bin_PROGRAMS} macro definition will cause targets +for compiling and linking to be generated. The macro definitions and targets in the @file{Makefile.am} are copied -into the generated file. This allows you to add essentially arbitrary -code into the generated @file{Makefile.in}. For instance the Automake -distribution includes a non-standard @code{cvs-dist} target, which the -Automake maintainer uses to make distributions from his source control -system. +into the generated file. This allows you to add arbitrary code into the +generated @file{Makefile.in}. For instance the Automake distribution +includes a non-standard @code{cvs-dist} target, which the Automake +maintainer uses to make distributions from his source control system. Note that GNU make extensions are not recognized by Automake. Using such extensions in a @file{Makefile.am} will lead to errors or confusing diff --git a/tests/ChangeLog b/tests/ChangeLog index b14501e4..a82e7d05 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +Sat Sep 21 14:01:10 1996 Tom Tromey + + * primary2.test: New file. + * primary.test: New file. + Fri Sep 20 09:39:27 1996 Tom Tromey * confsub.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 102e9b9e..87886b79 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,6 +15,6 @@ man.test info.test obsolete.test lex.test scripts.test subdir2.test \ exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ order.test libobj2.test interp.test alllib.test block.test libobj3.test \ gnits.test interp2.test colneq.test implicit.test spell.test spell2.test \ -confsub.test +confsub.test primary.test primary2.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index c940a5fd..8b65426e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -53,7 +53,7 @@ man.test info.test obsolete.test lex.test scripts.test subdir2.test \ exsource.test canon4.test dup.test defun.test cxxlink.test cxxnoc.test \ order.test libobj2.test interp.test alllib.test block.test libobj3.test \ gnits.test interp2.test colneq.test implicit.test spell.test spell2.test \ -confsub.test +confsub.test primary.test primary2.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(top_srcdir)/mkinstalldirs diff --git a/tests/primary.test b/tests/primary.test new file mode 100755 index 00000000..3a561b7d --- /dev/null +++ b/tests/primary.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure errors in am_install_var work. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = @programs@ +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/primary2.test b/tests/primary2.test new file mode 100755 index 00000000..81c5db7e --- /dev/null +++ b/tests/primary2.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Test to make sure errors in am_install_var work. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = @programs@ +EXTRA_PROGRAMS = joe @more@ +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/version.texi b/version.texi index 3513c74b..f1d01518 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 20 September 1996 +@set UPDATED 21 September 1996 @set EDITION 1.1f @set VERSION 1.1f -- 2.43.5