On Sun, 2002-03-10 at 12:05, Stephan Kulow wrote:
> These bogus errors are caused by automake 1.6 - 1.5 works fine.

I've been getting this too, with Gstreamer.

The problem is that you're using variables with suffices like _LDFLAGS,
which automake interprets specially, and complains about if it doesn't
know the prefix.  I think this is solely to help detect typos.

In previous versions, automake has made an explicit exception for
variables with such suffices that are declared in configure.{ac,in}, on
the basis that this is a natural way to pass _LDFLAGS settings to be
used for several targets from configure.ac to the makefiles.  For
example, Gstreamer sets GST_LDFLAGS in configure.ac, and then sets
libgst_la_LDFLAGS = $(GST_LDFLAGS)
libgstplugins_la_LDFLAGS = $(GST_LDFLAGS)
etc in the makefiles.

It still makes this exception in several places, but it looks like a new
check is not allowing it.  I assume this is an oversight: the following
attached patch (against CVS HEAD, though I think it will work against
1.6 too) fixes this.


While on the subject, I'm not sure why check_typos() doesn't check for
variables with '_CFLAGS', '_CXXFLAGS', etc suffices.  Perhaps these
should be added.

-- 
Richard
Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1780
diff -u -r1.1780 ChangeLog
--- ChangeLog	2002/03/07 21:06:29	1.1780
+++ ChangeLog	2002/03/10 15:52:11
@@ -1,3 +1,9 @@
+2002-03-10  Richard Boulton <[EMAIL PROTECTED]>
+
+	* automake.in (check_typos): Allow variables with reserved
+	suffices (such as _LDFLAGS) and prefixes which aren't recognised
+	if the variable is defined in configure.ac.
+
 2002-03-07  Alexandre Duret-Lutz  <[EMAIL PROTECTED]>
 
 	Fix for PR automake/303:
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1282
diff -u -r1.1282 automake.in
--- automake.in	2002/03/07 21:06:29	1.1282
+++ automake.in	2002/03/10 15:52:27
@@ -3018,7 +3018,11 @@
 	{
 	  macro_error ($varname,
 		       "invalid unused variable name: `$varname'")
-	    if $varname =~ /$primary$/ && ! $content_seen{$varname};
+	    # Note that a configure variable is always legitimate.
+	    # It is natural to name such variables after the
+	    # primary, so we explicitly allow it.
+	    if $varname =~ /$primary$/ && ! $content_seen{$varname}
+		&& ! exists $configure_vars{$varname};
 	}
     }
 }

Reply via email to