autoconf
[Top][All Lists]
Advanced

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

Re: combining AC_DEFINE and AC_SUBST


From: Stepan Kasal
Subject: Re: combining AC_DEFINE and AC_SUBST
Date: Fri, 20 May 2005 07:48:21 +0200
User-agent: Mutt/1.4.1i

Hello Dan,

On Thu, May 19, 2005 at 04:12:56PM -0400, Dan Manthey wrote:
> Also, I'm using multiline output variables to include blocks like:
> 
> #ifndef FOO_T
> #define FOO_T
> typedef unsigned short foo_t;
> #ifdef FOO_MAX
> #undef FOO_MAX
> #endif
> #define FOO_MAX 0xFFFFu
> #endif

I don't think it's necessary to combine these two features.

config.h is just buch of defines.  If you use autoheader, they are even
alphabetically sorted.

If you want to modify these defines somehow, you should probably build
a wrapper around it.  real_config.h would include config.h and you
would use the real_config.h exclusively.
Or you can use AH_BOTTOM or you can add a tail to config.h this way:

AC_CONFIG_HEADERS([config.h:configh.in],
                [cat $srcdir/custom.h >> config.h])

(cited from gawk).

If you need AC_SUBST there, then real_config.h or custom.h could include
a file called second.h, declared as
        AC_CONFIG_FILES(second.h)

I cannot imagine why you really need to use both types of processing with
one file.  But I haven't seen your project.

> (1) Is `#undef /* comment */ MACRO' portable as a way to avoid --header
> mangling of `#undef MACRO'?  Do any known compilers choke on this?

I don't know.
But I have another idea:
#undef \
        MACRO

Perhaps that is portable.

Have a nice day,
        Stepan




reply via email to

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