[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_CONFIG_HEADERS
From: |
Jeff Squyres |
Subject: |
Re: AC_CONFIG_HEADERS |
Date: |
Fri, 4 Feb 2011 16:52:23 -0500 |
On Feb 3, 2011, at 3:06 PM, Ralf Wildenhues wrote:
> Well, not completely undocumented, but quite hidden and misplaced in
> info Automake "Program Variables":
>
> Automake already provides some `-I' options automatically, in a
> separate variable that is also passed to every compilation that
> invokes the C preprocessor. In particular it generates `-I.',
> `-I$(srcdir)', and a `-I' pointing to the directory holding
> `config.h' (if you've used `AC_CONFIG_HEADERS' or
> `AM_CONFIG_HEADER'). You can disable the default `-I' options
> using the `nostdinc' option.
Ah ha -- I missed that. Thanks!
It might be worth mentioning this behavior (or maybe forward-referencing to
it?) in the AC_CONFIG_HEADERS description.
>> I see the "nostdinc" Automake flag to inhibit adding all -I's, but
>> that seems like a bit of overkill for our needs. We *do* want the
>> -I's for the AH-generated file, but not for any others. Is there a
>> way to do that? Or is there another way to inhibit specific -I's?
>
> Well, currently the only way to work around this is for you to use
> the nostdinc option and put
> AC_SUBST([DEFAULT_INCLUDES], ['-I. -I$(srcdir) $(top_builddir)/include'])
>
> in configure.ac.
Mmm... interesting. I didn't realize that we were allowed to override
DEFAULT_INCLUDES.
It doesn't totally solve the problem for us, though -- we export hwloc.m4 with
some macros for people who want to embed hwloc in a larger source code base
(such Open MPI, and others). They have their own DEFAULT_INCLUDES that we
wouldn't want to override.
> We might want to consider adding options stdinc-ah stdinc-nohdr or so
> for generating only include paths for autoheader-generated headers plus
> the first two, or the first two only, respectively. (Each with VPATH
> simplification I suppose.)
That would be nice, but since we allow hwloc to be embedded in other source
tree (with their own autotools setup), our ultimate solution would be to have
some variant of AC_CONFIG_HEADERS that explicitly says "don't add the -I for
this header to DEFAULT_INCLUDES".
That being said, I have nowhere near the m4 ability to suggest a patch for such
behavior. :-\
--
Jeff Squyres
address@hidden
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/