Re: AM_CPPFLAGS vs INCLUDES

2003-11-25 Thread Alexandre Duret-Lutz
 Bob == Bob Friesenhahn [EMAIL PROTECTED] writes:

 Bob The Automake documentation claims that 'INCLUDES' is the
 Bob equivalent of 'AM_CPPFLAGS'.  However, I find that this is
 Bob not the case at all.  If AM_CPPFLAGS is used, then any
 Bob per-target CPPFLAGS option completely overrides it.

Thanks for pointing this out.  I'm checking this in.

2003-11-25  Alexandre Duret-Lutz  [EMAIL PROTECTED]

* doc/automake.texi (Program variables): Mention per-target
_CPPFLAGS in the documentation of INCLUDES.
* automake.in (generate_makefile): Likewise in the INCLUDES diagnostic.
Report from Bob Friesenhahn.

Index: THANKS
===
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.229
diff -u -r1.229 THANKS
--- THANKS  24 Nov 2003 07:39:09 -  1.229
+++ THANKS  25 Nov 2003 22:03:41 -
@@ -29,6 +29,7 @@
 Bill Currie[EMAIL PROTECTED]
 Bill Davidson  [EMAIL PROTECTED]
 Bill Fenner[EMAIL PROTECTED]
+Bob Friesenhahn[EMAIL PROTECTED]
 Bob Proulx [EMAIL PROTECTED]
 Braden N. McDaniel [EMAIL PROTECTED]
 Brendan O'Dea  [EMAIL PROTECTED]
Index: automake.in
===
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1518
diff -u -r1.1518 automake.in
--- automake.in 22 Nov 2003 18:05:34 -  1.1518
+++ automake.in 25 Nov 2003 22:03:47 -
@@ -6745,7 +6745,7 @@
 
   # Catch some obsolete variables.
   msg_var ('obsolete', 'INCLUDES',
-  `INCLUDES' is the old name for `AM_CPPFLAGS')
+  `INCLUDES' is the old name for `AM_CPPFLAGS' (or `*_CPPFLAGS'))
 if var ('INCLUDES');
 
   # At the toplevel directory, we might need config.guess, config.sub
Index: doc/automake.texi
===
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.10
diff -u -r1.10 automake.texi
--- doc/automake.texi   25 Nov 2003 21:48:24 -  1.10
+++ doc/automake.texi   25 Nov 2003 22:03:54 -
@@ -3236,9 +3236,10 @@
 per-library) @code{_CPPFLAGS} variable if it is defined.
 
 @item INCLUDES
-This does the same job as @samp{AM_CPPFLAGS}.  It is an older name for
-the same functionality.  This variable is deprecated; we suggest using
[EMAIL PROTECTED] instead.
+This does the same job as @samp{AM_CPPFLAGS} (or any per-target
[EMAIL PROTECTED] variable if it is used).  It is an older name for the
+same functionality.  This variable is deprecated; we suggest using
[EMAIL PROTECTED] and per-target @samp{_CPPFLAGS} instead.
 
 @item AM_CFLAGS
 This is the variable which the @file{Makefile.am} author can use to pass


-- 
Alexandre Duret-Lutz





Re: AM_CPPFLAGS vs INCLUDES

2003-11-25 Thread Bob Friesenhahn
On Tue, 25 Nov 2003, Alexandre Duret-Lutz wrote:

  Bob == Bob Friesenhahn [EMAIL PROTECTED] writes:

  Bob The Automake documentation claims that 'INCLUDES' is the
  Bob equivalent of 'AM_CPPFLAGS'.  However, I find that this is
  Bob not the case at all.  If AM_CPPFLAGS is used, then any
  Bob per-target CPPFLAGS option completely overrides it.

 Thanks for pointing this out.  I'm checking this in.

My point was not entirely that the documentation was wrong.  It is an
extremely useful capability to be able to define a common base set of
CPPFLAGS and then use per-target CPPFLAGS to extend these (equivalent
to +=).  Otherwise the Makefile.am has to be very messy and large,
since as soon as you add one per-target CPPFLAGS, you then need to
start passing all CPPFLAGS via individual per-target CPPFLAGS

The current operation of INCLUDES in conjunction with per-target
CPPFLAGS is effectively

INCLUDES=$(CPPFLAGS)
TARGET_INCLUDES=$(INCLUDES) $(TARGET_CPPFLAGS)

Bob
==
Bob Friesenhahn
[EMAIL PROTECTED]
http://www.simplesystems.org/users/bfriesen





Re: AM_CPPFLAGS vs INCLUDES

2003-11-25 Thread Kevin P. Fleming
Bob Friesenhahn wrote:

My point was not entirely that the documentation was wrong.  It is an
extremely useful capability to be able to define a common base set of
CPPFLAGS and then use per-target CPPFLAGS to extend these (equivalent
to +=).  Otherwise the Makefile.am has to be very messy and large,
since as soon as you add one per-target CPPFLAGS, you then need to
start passing all CPPFLAGS via individual per-target CPPFLAGS
Are you sure about that last part Bob? I have Makefiles that do:

AM_CPPFLAGS = -I../foo -DBAR

src_foo_CPPFLAGS = -DBAZ $(AM_CPPFLAGS)

and this works just fine. I can then ensure that my common CPPFLAGS are 
incorporated for a target that also needs special flags.





AM_CPPFLAGS vs INCLUDES

2003-11-20 Thread Bob Friesenhahn
The Automake documentation claims that 'INCLUDES' is the equivalent of
'AM_CPPFLAGS'.  However, I find that this is not the case at all.  If
AM_CPPFLAGS is used, then any per-target CPPFLAGS option completely
overrides it.  However, if INCLUDES is used, then per-target CPPFLAGS
options augment the value provided via INCLUDES.

Bob
==
Bob Friesenhahn
[EMAIL PROTECTED]
http://www.simplesystems.org/users/bfriesen