autoconf
[Top][All Lists]
Advanced

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

Re: help on configuration file creation


From: Eric Blake
Subject: Re: help on configuration file creation
Date: Fri, 28 Sep 2012 07:15:03 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 09/28/2012 01:17 AM, Claudio Eterno wrote:
> First of all I apologize for my low knowledge on autotools. These are my
> first steps..
> Question: I'm developing a package for embedded application and I prepared
> the configure.ac in order to do it..
> The creation of the file reaches but there are too much defines (some of
> them not specifically required).

Are those extra defines actually harming your project?  If not, I
wouldn't worry about them.  But if you are trying to build your header
as something that can be installed, then you are correct that extra
defines should not be polluting your installed header.

If you are planning on installing your bare-minimum configured header
for other projects to include, I'd recommend using AC_CONFIG_HEADERS to
configure multiple headers; the first header (typically named config.h)
will then hold all the extra defines automatically provided by
autoheader and used only internally by your project; and then list your
desired header sapl/shm_apl_config.h as the second header, built from
your own custom template file that has only the macros you want.

> My configure.ac contain this:
> AC_INIT([shmtest],[1.1.0],address@hidden)
> AM_INIT_AUTOMAKE([foreign -Wall -Werror])
> AC_PROG_CC
> AC_CONFIG_HEADERS([sapl/shm_apl_config.h])

That is, your current approach treated your target file as the dumping
ground for ALL defines, by letting autoheader generate the template file
instead of you doing it manually.  My approach would be something like:

AC_CONFIG_HEADERS([config.h
   sapl/shm_apl_config.h:sapl/shm_apl_config.h.in])

where autoheader still generates config.h.in, but where I hand-write
sapl/shm_apl_config.h.in to contain just the macro names I want.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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