bug-autoconf
[Top][All Lists]
Advanced

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

Accessing $abs_top_builddir and friends before substitution.


From: Jack Kelly
Subject: Accessing $abs_top_builddir and friends before substitution.
Date: Sun, 24 Feb 2013 08:21:46 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

[Please CC me with any replies, I am not subscribed to the list.]

This with with autoconf 2.69.

I am unable to get a sensible value for $abs_top_builddir within
configure.ac or config.status. I can only get a sensible value as a
substitution of @abs_top_builddir@ (though AC_CONFIG_FILES).

As I understand it, the info node `(autoconf) Preset Output Variables'
tells me that these variables are usable during configure tests and
during config.status. I was unable to use them at either
point. config.status substitutes address@hidden@' with the value of
`$ac_abs_top_builddir', which I can access via AC_CONFIG_COMMANDS.

Here is the test case I am using. Run it with `autoconf && ./configure
&& ./test':

configure.ac:
=============

AC_PREREQ([2.67])
AC_INIT([], [0], address@hidden)
AC_MSG_NOTICE([notice: ${abs_top_builddir}])
AC_MSG_NOTICE([notice+ac: ${abs_top_builddir}])
AC_CONFIG_COMMANDS_PRE([echo "pre+ac: ${ac_abs_top_builddir}"])
AC_CONFIG_COMMANDS_PRE([echo "pre: ${abs_top_builddir}"])
AC_CONFIG_COMMANDS_POST([echo "post+ac: ${ac_abs_top_builddir}"])
AC_CONFIG_COMMANDS_POST([echo "post: ${abs_top_builddir}"])
AC_CONFIG_COMMANDS([echo],
[echo "config.status+ac: ${ac_abs_top_builddir}"
echo "config.status: ${abs_top_builddir}"])
AC_CONFIG_FILES([test], [chmod +x test])
AC_OUTPUT

test.in:
========

#!/bin/sh
# -*- sh -*-
# @configure_input@
echo "test: @abs_top_builddir@"
echo "test+ac: @ac_abs_top_builddir@"

On my machine, running this from /home/endgame/z gives:

address@hidden:~/z$ autoconf && ./configure && ./test
configure: notice: 
configure: notice+ac: 
pre+ac: 
pre: 
configure: creating ./config.status
post+ac: 
post: 
config.status: creating test
config.status: executing echo commands
config.status+ac: /home/endgame/z
config.status: 
test: /home/endgame/z
test+ac: @ac_abs_top_builddir@
address@hidden:~/z$

Is this a bug or am I misunderstanding the documentation?

Thanks,

-- Jack



reply via email to

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