bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_CONFIG_FILES assumes that build directories have sibling in the s


From: Akim Demaille
Subject: Re: AC_CONFIG_FILES assumes that build directories have sibling in the source tree
Date: Mon, 27 Oct 2003 17:38:57 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

 > The following test case works fine with Autoconf 2.13.                       
 >                                                          
 > rm -Rf test
 > mkdir test
 > cd test
 > cat >configure.in <<EOF
 > AC_INIT
 > AC_OUTPUT(sub/foo:in/sub.in)
 > EOF
 > mkdir in
 > : >in/sub.in
 > autoconf
 > mkdir _build
 > cd _build
 > ../configure

Nope, it does not "work fine": it contains a hidden failure:

rm -Rf test
mkdir test
cd test
cat >configure.in <<EOF
AC_INIT
AC_OUTPUT(sub/foo:in/sub.in)
EOF
mkdir in
echo '@srcdir@' >in/sub.in       # <<<===
autoconf2.13                     # <<<===
mkdir _build
cd _build
../configure
cat sub/foo                      # <<<===

=> ../../sub

 > however with Autoconf 2.57g it will produce

 > configure: creating ./config.status
 > ./config.status: line 1: cd: ../../sub: No such file or directory
 > config.status: creating sub/Makefile

 > AFAICT, this warning comes from the second `cd' in the
 > computation of ac_abs_srcdir:

 >    ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`

 > I think config.status is bogus to assume that sub/ exists in the
 > source tree, because AC_CONFIG_FILES(sub/foo:in/sub.in) only
 > mentions "sub/foo" as a built file.

Yes, you are right, of course.  But I'm not sure about the right fix :(

 > I believe it would be fine for ./config.status to ignore this
 > `cd' error, since it make no sense for the user to use
 > @abs_srcdir@ in such a file.

That's an option.  AFAICS there are three sounds options:

1. ignore and do as 2.13: output junk
2. ignore but ac_subst @srcdir@ as "" (or NONE?  or don't ac_subst it?)
3. recognize case and output "in/" as srcdir

3 of course "fails" when there are more that one source file.  But
that's the common case.

Opinions?




reply via email to

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