[Top][All Lists]

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

Re: Freebsd vs built sources

From: Stepan Kasal
Subject: Re: Freebsd vs built sources
Date: Thu, 13 Jul 2006 19:29:14 +0200
User-agent: Mutt/


On Wed, Jul 12, 2006 at 08:52:54PM +0800, John Darrington wrote:
> On Wed, Jul 12, 2006 at 02:33:21PM +0200, Stepan Kasal wrote:
>      Just omit "$(top_builddir)/" from all occurences.
> I can't do that.  If I do, then it will fail to build from outside
> of the source tree.

no, this is not true.

You are confusing (top_)builddir with (top_)srcdir.  The latter ones
are important for builds outside the source tree (so called ``VPATH

$(top_builddir) just points to the top level _build_ directory, so it
is `..', `../..', or some such.

Since you adopted the non-recursive approach in the pspp package, you
have one huge makefile in the top level (even thought the Automake
sources, *.mk files, are scattered throughout the tree).
In that huge makefile, $(top_builddir) is just a dot.

Thus the prefix `$(top_builddir)/' is actually `./'--it's only effect
is that it confuses BSD make, which does not admit that `file' and
`./file' are the same.

>      And if subdir/mystuff.x is not generated in any way, you can omit the
>      "$(top_srcdir)/" prefix from it, too.

As mentioned above, (top_)srcdir has to be used in certain
situations, for the sake of vpath builds.

But remember that make searches the prerequisities according to
VPATH variable, so you do not have to use (top_)srcdir there.

Also note that in your huge top level makefile, $(top_srcdir) is the
same as $(srcdir).  I would perhaps tend to use $(srcdir) in
*_CPPFLAGS and such, but it depends on individual taste.

> if you feel like

I downloaded this tarball, made some changes, ran autoreconf and
verified that vpath build still works (on my Fedora GNU/Linux,
with GNU make).

Actually, I noticed more problems:

The file src/language/expressions/ contains:

src/language/expressions/src_language_expressions_libexpressions_a-evaluate.o: \
        src/language/expressions/evaluate.h \
        src/language/expressions/operations.h \

You cannot add dependencies this way; Automake does not notice that
this rule does not have any commands, and fails to emit the rule for
this target.

I understand that the pre-requisities are generated.  The usual
solution is to list them in BUILT_SOURCES.

OTOH, your other usage of BUILT_SOURCES is not necessary, and should
be avoided (BUILT_SOURCES is kind of a hack).  If you use old-style
implicit rule (`.q.c:'), then you can list *.q files in the *_SOURCES
variable.  That simplifies src/language/data-io/ and
src/language/utilities/ significantly.

But the same simplification is not possible in
src/language/lexer/, because of a bug in Automake: this
feature does not work in combination with per-target flags.
So nodist_src_language_stats_libstats_a_SOURCES is still needed.

BTW: you do not need the "PERL = @PERL@" line; Automake generates it.
And though it might seem weird, neither nor aclocal.m4
And in TESTS_ENVIRONMENT in tests/, I'd use $(..), not
${..}, to emphasize the fact that the variable is expanded by make,
not by shell.
Automake distributes manu files automatically--there is no need to
list them in EXTRA_DIST.

Attached please find the resulting patch.
I have not explained every aspect of it, so feel free to ask about
the individual changes.

I hope this helps,
        Stepan Kasal

Attachment: pspp-autotools.patch
Description: Text document

reply via email to

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