autoconf
[Top][All Lists]
Advanced

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

Re: Prefix for file in source directory used in ./configure?


From: Ralf Wildenhues
Subject: Re: Prefix for file in source directory used in ./configure?
Date: Sun, 25 Apr 2010 19:40:59 +0200
User-agent: Mutt/1.5.20 (2009-10-28)

* Jason Sewall wrote on Sun, Apr 25, 2010 at 07:16:25PM CEST:
> Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:
> > $ac_top_srcdir, as documented in "info Autoconf 'Configuration Actions'".
> > Since configure is always run the top build directory, it should suffice
> > to use $srcdir though.
> 
> Well, perhaps I understand less of autoconf than I thought I did.  I
> tried to put GIT_VERSION=`$(ac_top_srcdir)/GIT-VERSION-GEN`

configure is a shell script.  In a shell script, $(...) denotes command
substitution.  So in order to evaluate $ac_top_srcdir at configure run
time, you would need to write
  GIT_VERSION=`$ac_top_srcdir/GIT-VERSION-GEN`

You can use ${var} notation which is the same between shell and make.

> GIT_VERSION=`./GIT-VERSION-GEN`
> AC_SUBST(GIT_VERSION)
> AH_TEMPLATE([GIT_VERSION],
>           [Git revision of this build])
> 
> in my configure.ac file.  It seems like AC_CONFIG_COMMAND runs too
> late for the variables to be put in config.h, is that right?

Yes.

Cheers,
Ralf




reply via email to

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