autoconf
[Top][All Lists]
Advanced

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

Re: AC_CONFIG_HEADERS & AC_CONFIG_FILES combo


From: Peter Breitenlohner
Subject: Re: AC_CONFIG_HEADERS & AC_CONFIG_FILES combo
Date: Fri, 16 Oct 2009 18:48:53 +0200 (CEST)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

On Fri, 16 Oct 2009, Sam Steingold wrote:

I have a header file avcall.h which collects the results of autoconf tests, so it is mentioned in AC_CONFIG_HEADERS.
I also want it to define the package version cpp macro, so I added

#if !defined(LIBFFCALL_VERSION)
# define LIBFFCALL_VERSION @PACKAGE_VERSION@
#endif

to it (there are several such headers, each has these 3 lines).
however, configure did not substitute @address@hidden
thus I added avcall.h to AC_CONFIG_FILES.
nothing changed, no warning or error on configure generation.
so I added this to configure.in:

AC_CONFIG_HEADERS([avcall.h],
[sed "s/@PACKAGE_VERSION@/${PACKAGE_VERSION}/" avcall.h > tmp
mv -f tmp avcall.h])

now @PACKAGE_VERSION@ is removed, nothing is inserted.

That is because the sed command is executed by config.status where
PACKAGE_VERSION not undefined.  You should try

AC_CONFIG_HEADERS([avcall.h],
[sed "s/@PACKAGE_VERSION@/$my_PACKAGE_VERSION/" avcall.h > tmp
mv -f tmp avcall.h],
[my_PACKAGE_VERSION=$PACKAGE_VERSION])

(the changed variable name is to avoid conflicts, may not be needed).

Regards
Peter Breitenlohner <address@hidden>




reply via email to

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