autoconf
[Top][All Lists]
Advanced

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

Re: enabling specific configuration flags for development builds


From: Eric Blake
Subject: Re: enabling specific configuration flags for development builds
Date: Mon, 21 Nov 2011 06:21:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 11/19/2011 01:48 AM, Adam Mercer wrote:
> Hi
> 
> Is there a way to change the default value of specific configuration
> flags depending on whether the project is built from the development
> repository or from a release tarball, i.e. built using "make dist"?
> There are specific configuration flags that I would like to have
> enabled by default when building from the development repository but
> not for a release.
> 
> Does anyone know a way that I can achieve this without changing the
> macro definition for every release?

Yes - use m4_esyscmd to run a command that determines whether you are
likely to be a VCS checkout or a tarball.  Autoconf itself does exactly
that; it has this in configure.ac:

AC_INIT([GNU Autoconf],
        m4_esyscmd([build-aux/git-version-gen .tarball-version]),
        address@hidden)

where build-aux/git-version-gen is a script that determines whether this
is a tarball release (as evidenced by the existence of a file
.tarball-version, created only at 'make dist' time and matching the
corresponding 'git tag' version string chosen at release time) or a git
checkout (as evidenced by a .git subdirectory), and alters the version
string accordingly (either a release value, or an extended intra-release
version such as 2.68.54-d641).  Also, since AC_INIT sets the m4 macro
AC_PACKAGE_VERSION and the shell variable $PACKAGE_VERSION, the rest of
the configure.ac can make decisions about whether this is a development
release or a tarball release based on whether the version string is
short or long.  End result: you have a configure.ac that does not need
any modifications, and yet still behaves differently between developer's
trees and formal releases.

-- 
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]