Re: preventing defines in config.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Thu, Oct 19, 2006 at 03:22:02AM -0500, Andy Howell wrote:
> Hello,
> 
> 	I'm tying to understand how defines get added to config.h. In my 
> configure.ac file I have:
> 
> if test "apple" = "orange"; then
> 	AC_DEFINE_UNQUOTED(HAVE_SOMETHING,1,[Define if SOMETHING])
> fi
> 
> My test fails, so I don't expect to get
> 
> /* Define is SOMETHING */
> #define HAVE_SOMETHING 1
> 
> in config.h
> 
> I did a sh -x on configure, but I never see it do HAVE_SOMETHING.

it is OK.

The template config.h.in contains `#undef HAVE_SOMETHING'.
(It is usually created by autoheader.)

Configure collects all AC_DEFINES, the one you quoted above is not
executed, of course.

At the end, configure creates and calls config.status.

config.status makes substitutions for all AC_DEFINES, but
HAVE_SOMETHING is not among them, so the `#undef HAVE_SOMETHING'
stays there.  Then it comments out all #undefs, but that's a general
substitution, ie. it does not contain `HAVE_SOMETHING'.

Hope this helps,
	Stepan Kasal


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux