Re: best practice for injecting include dir across a project

2008-07-28 Thread Ben Pfaff
Monty Taylor [EMAIL PROTECTED] writes:

 I've got a project that has 24 Makefile.am files. At the top of all of
 them at the moment, I've got:

 AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include

I tend to write include $(top_srcdir)/Make.vars at the top of
each Makefile.am, and then include common settings in Make.vars
at the top of the source directory.
-- 
It was then I realized how dire my medical situation was.  Here I was,
 a network admin, unable to leave, and here was someone with a broken
 network.  And they didn't ask me to fix it.  They didn't even try to
 casually pry a hint out of me. --Ryan Tucker in the Monastery





best practice for injecting include dir across a project

2008-07-24 Thread Monty Taylor
Hey all,

I've got a project that has 24 Makefile.am files. At the top of all of
them at the moment, I've got:

AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include

Which seems a bit ridiculous. I would love to inject those two into
DEFAULT_INCLUDES, but I can't find any handles to do that... and I'd
rather not shove them into CFLAGS in configure.ac, just because that
also seems like the wrong way to do it.

Am I missing something obvious?

Monty

PS. Yes...I know the -I$(top_builddir)/include is ridiculous... I
inherited that and just haven't gotten rid of it yet... but the
fundamental question of how do I add one or more include paths globally
from a top level in a sane manner still holds...




Re: best practice for injecting include dir across a project

2008-07-24 Thread Ralf Wildenhues
Hello Monty,

* Monty Taylor wrote on Thu, Jul 24, 2008 at 08:43:39PM CEST:
 
 I've got a project that has 24 Makefile.am files. At the top of all of
 them at the moment, I've got:
 
 AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include

Put
  AC_SUBST([AM_CPPFLAGS], ['I$(top_builddir)/include -I$(top_srcdir)/include'])

in configure.ac instead.

Cheers,
Ralf




Re: best practice for injecting include dir across a project

2008-07-24 Thread Monty Taylor
Ralf Wildenhues wrote:
 Hello Monty,
 
 * Monty Taylor wrote on Thu, Jul 24, 2008 at 08:43:39PM CEST:
 I've got a project that has 24 Makefile.am files. At the top of all of
 them at the moment, I've got:

 AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
 
 Put
   AC_SUBST([AM_CPPFLAGS], ['I$(top_builddir)/include 
 -I$(top_srcdir)/include'])
 
 in configure.ac instead.

GAH! Silly me.

Thanks!

Monty




Re: best practice for injecting include dir across a project

2008-07-24 Thread Raja R Harinath
Hi,

Monty Taylor [EMAIL PROTECTED] writes:

 I've got a project that has 24 Makefile.am files. At the top of all of
 them at the moment, I've got:

 AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
[snip]
 PS. Yes...I know the -I$(top_builddir)/include is ridiculous... I
 inherited that and just haven't gotten rid of it yet... but the
 fundamental question of how do I add one or more include paths globally
 from a top level in a sane manner still holds...

Since your main question got answered...  What's wrong with
-I$(top_builddir)/include?  It's most definitely not redundant.  Of
course it can be superfluous if you don't have any generated header
files in the build tree.  But, why ridiculous?

- Hari





Re: best practice for injecting include dir across a project

2008-07-24 Thread Monty Taylor
Raja R Harinath wrote:
 Hi,
 
 Monty Taylor [EMAIL PROTECTED] writes:
 
 I've got a project that has 24 Makefile.am files. At the top of all of
 them at the moment, I've got:

 AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
 [snip]
 PS. Yes...I know the -I$(top_builddir)/include is ridiculous... I
 inherited that and just haven't gotten rid of it yet... but the
 fundamental question of how do I add one or more include paths globally
 from a top level in a sane manner still holds...
 
 Since your main question got answered...  What's wrong with
 -I$(top_builddir)/include?  It's most definitely not redundant.  Of
 course it can be superfluous if you don't have any generated header
 files in the build tree.  But, why ridiculous?

Well... ridiculous may have been a bit strong... we generate a couple
of header files, and each of them could be done in a better way. So I'm
probably just projecting my hatred of my generated headers... :)

Monty