[Top][All Lists]
[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: |
Alexandre Duret-Lutz |
Subject: |
Re: AC_CONFIG_FILES assumes that build directories have sibling in the source tree |
Date: |
Mon, 27 Oct 2003 19:16:35 +0100 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) |
>>> "Akim" == Akim Demaille <address@hidden> writes:
[...]
Akim> Nope, it does not "work fine": it contains a hidden failure:
Akim> rm -Rf test
Akim> mkdir test
Akim> cd test
Akim> cat >configure.in <<EOF
Akim> AC_INIT
Akim> AC_OUTPUT(sub/foo:in/sub.in)
Akim> EOF
Akim> mkdir in
Akim> echo '@srcdir@' >in/sub.in # <<<===
Akim> autoconf2.13 # <<<===
Akim> mkdir _build
Akim> cd _build
Akim> ../configure
Akim> cat sub/foo # <<<===
Akim> => ../../sub
This looks correct to me.
[...]
>> 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.
Akim> That's an option. AFAICS there are three sounds options:
Akim> 1. ignore and do as 2.13: output junk
Akim> 2. ignore but ac_subst @srcdir@ as "" (or NONE? or don't ac_subst it?)
Akim> 3. recognize case and output "in/" as srcdir
Akim> 3 of course "fails" when there are more that one source file. But
Akim> that's the common case.
Akim> Opinions?
We seems to disagree about what @srcdir@ means. For me, it's a
relative path from the current build directory to its twin
source directory. Especially, this become `.' when in non-VPATH
builds. The value of this variable is global to a directory,
and independent on how files are constructed. This rules out
option 3.
When the source directory corresponding to the current build
directory does not exist, there is a problem. (The converse
cannot happen, because config.status always creates missing
build directories.) Admittedly the @srcdir@ variable is of
little value when the directory does not exists. Even though,
it's still possible to define @srcdir@ as relative path from the
current build directory to its (possibly nonexistent) twin
source directory. Autoconf does this very well presently.
My complaint is about @abs_srcdir@, not @address@hidden While
@srcdir@ can be computed without assuming the existence of the
source directory, @abs_srcdir@ cannot, because this involves a
cd into this directory (and creating a directory into the source
tree for the sake of this cd is not an option).
I can see only two options to define @abs_srcdir@ when the
source directory does not exist:
1. define @abs_srcdir@ as junk
2. compute @abs_srcdir@ without using cd
I've suggested option 1 in my previous mail because that seems
the easier to implement, and I can't see why one would want to
use this variable when the source directory does not exist.
Not AC_SUBSTing @abs_srcdir@ in this case does not seem very
sensible, because it will be impossible for tools which trace
AC_SUBST to know which AC_SUBSTs are substituted and which are
not. (However if what you meant was to never AC_SUBST
@abs_srcdir@, then I'm all for it. IMHO all the abs_
substitutions are evil.)
--
Alexandre Duret-Lutz