autoconf
[Top][All Lists]
Advanced

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

Re: config.h and using @VAR@


From: Ralf Wildenhues
Subject: Re: config.h and using @VAR@
Date: Wed, 8 Mar 2006 14:13:27 +0100
User-agent: Mutt/1.5.11

Hi Peter,

* Peter Teuben wrote on Tue, Mar 07, 2006 at 11:54:49PM CET:
> 
> I'd like to use a config.h that not only has been processed by
> AC_CONFIG_HEADER but also via AC_CONFIG_FILE + AC_OUTPUT, purely
> because i also wanted to use my own variables @VAR@ that were
> computed in the configure.ac file. By default if you just use
> AC_CONFIG_HEADER it does not process @address@hidden

Right.  You could
  AC_DEFINE_UNQUOTED([VAR], [$whatever], [Description of VAR])

though.  If $whatever needs to be expanded further, you could do that
beforehand (by using the shell `eval', for example).

> I could not find any instructions, but by trial and error found this
> procedure worked in the configure.ac file:
> 
> AC_CONFIG_HEADER([config.h:config.h.tmp])
> ....
> AC_CONFIG_FILES([config.h.tmp:config.h.in])
> AC_OUTPUT

This is not safe.  The order of creating config headers and config files
is not defined.  In fact, I think this does not work in Autoconf-2.59.

> So, the question is perhaps better phrased as:   I am doing something
> where there is a better solution for? (apart from having two .h files)

Yes, two headers would be a solution, too.  You could just create the
second one as AC_CONFIG_FILES.  Although that would mean that this
header would be updated even if its contents have not changes (thus
causing unnecessary rebuilds at times).

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]