automake-patches
[Top][All Lists]
Advanced

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

Re: pr401*.test and BSD make: computing LIBOBJDIR


From: Alexandre Duret-Lutz
Subject: Re: pr401*.test and BSD make: computing LIBOBJDIR
Date: Tue, 06 Jun 2006 21:09:02 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:

 adl> I'll try to look at this and the rewrite of depout later this week-end

Ahem...  I had a very long week.  (Does that sound credible?)
Sorry about that.

>>> "RW" == Ralf Wildenhues <address@hidden> writes:

 RW> 1)
 RW> On alphaev7-dec-osf5.1b, pr401.test fails like this in the last part of
 RW> the test (subdir-objects, Test using LIBOBJS from parent directory, the
 RW> distcheck part from testSubDir/pr401-1.0/_build):

 >> configure: creating ./config.status
 >> config.status: creating Makefile
 >> config.status: executing depfiles commands
 >> Make: Don't know how to make ./lib/feep.o.  Stop.
 >> *** Exit 1
 >> Stop.
 >> FAIL: ../../automake-1.9a/tests/pr401.test

 RW> Similarly pr401c (pr401b was SKIPped due to non-installed Libtool).

 RW> This is because that `make' knows how to build `lib/feep.o', but not
 RW> `./lib/feep.o' from the VPATH source.  The prefix comes from LIBOBJDIR.
 RW> The patch below fixes that by not adding `$(top_builddir)/' if that is
 RW> `./', as is also done in rewrite_inputs_into_dependencies, for example.

Sounds fine.

 RW> 2)
 RW> But there is another bug lingering here: handle_LIBOBJS_or_ALLOCA
 RW> returns $dir _always_ unprefixed; that is then used to compute
 RW> $depfiles.  So if you have a src/Makefile.am with subdir-objects,
 RW> and reference to LIBOBJS, then there will be a spurious extra tree,
 RW> like this:
 RW> testSubDir
 RW> lib
 RW> [.deps  may exist or not]
 RW> sub2
 RW> lib
 RW> .deps

 RW> Eww.  ;-)

 RW> To fix this, we need to munge a bit in _AM_OUTPUT_DEPENDENCY_COMMANDS so
 RW> that `am__include $(top_builddir)/...' will also be understood correctly.
 RW> Note here that it seems necessary to go to lengths to extract
 RW> top_builddir, because by the time `config.status' instantiates depfiles,
 RW> the value of $ac_top_build_prefix will be `.', which is not what we
 RW> need.  (Maybe Autoconf should help out here?  Dunno; the way I did
 RW> surely is expensive, as it adds a fork per Makefile, to fix a corner
 RW> case.)

$(top_builddir) can be computed statically by Automake if
needed.  I think automake's $topsrcdir (the Perl variable)
contains exactly the relative path you want.  Maybe that's
simpler and faster ? (i.e., no depout.m4 modification required)

[...]

 RW> * automake.in (handle_LIBOBJS_or_ALLOCA): With subdir-objects,
 RW> do not prefix `$(top_builddir)/' aka `./' to nonempty LIBOBJDIR,
 RW> to help BSD Make find the files also in a VPATH build.
 RW> Also return the same path, possibly prefixed, for correct
 RW> depdir computation.

Took me a while to realize that the chunk changing depdir's
computation was missing from the patch you sent.  The rest of
the patch looks fine to me.  I tend to favor the $topsrcdir
approach above, but if it cannot work for some reason or if you
disagree, please go on and install your idea.
-- 
Alexandre Duret-Lutz

Shared books are happy books.     http://www.bookcrossing.com/friend/gadl





reply via email to

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