Re: enabling specific configuration flags for development builds

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

 



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]),
        [bug-autoconf@xxxxxxx])

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   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux