[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to write directly to config.h from configure?
From: |
Jeffrey Walton |
Subject: |
Re: How to write directly to config.h from configure? |
Date: |
Sat, 28 Jul 2018 20:36:51 -0400 |
On Thu, Jul 26, 2018 at 11:55 AM, Nick Bowler <address@hidden> wrote:
> On 7/26/18, Jeffrey Walton <address@hidden> wrote:
>> I have a bad interaction with a project and Autotools. The project is
>> not an Autotools project but we are trying to [cleanly] support
>> Autotools. The project provides its own config.h since the mid-1990's.
>> We want to supply roughly the same file though Autotools.
>>
>> The problem is, the project's config.h has some stuff that does not
>> seem to fit in the Autotools model like typedefs and declarations of
>> namespaces. I think the solution is to write directly to config.h but
>> I can't figure out how to do it. Testing code like below is lost
>> (i.e., it is not in the resulting config.h):
>
> The only thing configure (actually, config.status) does is replace
> #undef lines in the package-provided config.h.in with either a #define
> or a comment, based on configure results controlled by the AC_DEFINE
> macro.
>
> You can essentially to place any code you'd like in config.h.in, with
> some limitations, see "Configuration Header Templates" in the Autoconf
> manual[1].
Thanks everyone.
I believe config.h.in is a dead-end for us. I tried it in the past.
Also see https://stackoverflow.com/q/48436715/608639 .
Jeff