autoconf
[Top][All Lists]
Advanced

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

Re: Computed values in AC_INIT, AC_CONFIG_SRCDIR, AC_CONFIG_HEADERS, etc


From: Olivier Boudeville
Subject: Re: Computed values in AC_INIT, AC_CONFIG_SRCDIR, AC_CONFIG_HEADERS, etc.
Date: Thu, 02 Feb 2006 21:01:16 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

Hi again,

yes, I dropped the m4-compliant/shell-like file and used a sed-ified
template file instead (what a pity to have to do so, whereas we use a
powerful preprocessor underneath...).

I am always surprized, as well, to see so many warnings due to the
latest libtool, still using obsolete macros !

For the name 'autogen', sorry to have used it (I read the autobook,
though), I was finding 'bootstrap' less clear, but you are right.

Thanks for your help,
regards,

Olivier Boudeville.


Bruce Korb a écrit :

> Olivier Boudeville wrote:
>
>> After having tried this approach, I noticed that at least AC_INIT,
>> AC_CONFIG_SRCDIR and AC_CONFIG_HEADERS do not seem to allow variable
>> substitution ($A taken litterally instead of its value, am I wrong ?)
>> I think to using a template that could be filled with settings read
>> from a file to generate the expected configure.ac, to ensure one-time
>> assignment and avoid multiple definition of the same value, which
>> would be error-prone in my opinion.
>
>
> Yep.  That's the way to do it:  a pre-autoreconf script.
> It is very cute to construct it in a way that both shell
> and m4 are happy, but it also adds a stiltedness that
> makes things less clear.  You may as well construct
> several files from the one script.  It's cleaner.
> You can emit the "version.texi" doc file at the same time, too.
>
>> #!/bin/sh
>>
>> VERSION_FILENAME="version.inc"
>>
>> USAGE="Usage : "`basename $0`" <major> <minor> <release> : generates
>> a file named '$VERSION_FILENAME' which can set version numbers both
>> when sourced by a shell script (setting the MAJOR_VERSION,
>> MINOR_VERSION and RELEASE variables appropriately) and included by a
>> m4 script. This is useful as a workaround to Autoconf AC_INIT
>> behaviour."
>>
>> if test "$#" -ne 3 ; then
>>     echo $USAGE 1>&2
>>     exit 1
>> fi
>> echo "dnl=\"This rather convoluted file allows to centralize version
>> numbers while \"" > $VERSION_FILENAME
>>
>> echo "dnl=\"being able to be both sourced by shell scripts and
>> included by m4.\"" >> $VERSION_FILENAME
>>
>> echo "dnl=\"It can be generated by the 'generateVersionFile.sh'
>> script.\"" >> $VERSION_FILENAME
>>
>> echo "dnl=; MAJOR=$1; MINOR=$2; RELEASE=$3 ; RELEASE_DATE=\""`date
>> '+%A, %B %e, %Y'`"\"; m4_hiding_string=\"\\" >> $VERSION_FILENAME
>>
>> echo "$1.$2.$3" >> $VERSION_FILENAME
>> echo "dnl \"" >> $VERSION_FILENAME
>>
>> echo "'$VERSION_FILENAME' has been generated."
>
>
> Using a "here doc" is much more comprehensible:
>
> cat > $VERSION_FILENAME <<- _EOF_
>     dnl="xxx"
>     dnl=; MAJOR=$1; MINOR=$2; RELEASE=$3; RELEASE_DATE="`date`"
>     dnl=; m4_hiding_string="
>     $1.$2.$3
>     dnl "
>     _EOF_
>
> Also, as the author of "autogen", I'd suggest calling the thing,
> "bootstrap" :)
>
> Cheers - Bruce
>
>
> _______________________________________________
> Autoconf mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/autoconf
>
>





reply via email to

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