[Top][All Lists]

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

Re: Newbie questions

From: Alexandre Duret-Lutz
Subject: Re: Newbie questions
Date: Mon, 21 Jul 2003 23:54:34 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

>>> "Steven" == Steven Eker <address@hidden> writes:

 Steven> I'm converting a large program to autoconf/automake and I've run into
 Steven> a number of problems:

 Steven> (1) How do I ensure a particular file gets recompiled everytime (just
 Steven> before) a program is linked (say to update the build time via
 Steven> __DATE__ and __TIME__)? Previously I just put this before the link
 Steven> command:

 Steven> maude: <deps>
 Steven> $(CXX) <flags> -c -o banner.o
 Steven> $(CXX) <flags> banner.o <modules> <libs> -o maude

 Steven> But now automake generates the link command.

You can override the linker command if you want.  Grep the
manual for maude_LINK.

I would favor reproducible builds and compute the build time
once for all in ./configure, though.

 Steven> (2) In the same vain, how do I use a tool like purify that needs to
 Steven> see the link command? Previously I had a target like:

 Steven> maude.purify: <deps>
 Steven> $(CXX) <flags> -c -o banner.o
 Steven> $(PURIFY) $(PURIFY_FLAGS) \
 Steven> $(CXX) <flags> banner.o <modules> <libs> -o maude.purify

I don't know purify.  I suggest you try valgrind instead :)

 Steven> (3) I have a lot of .cc files that are not compiled but are included
 Steven> by other .cc files for various reasons. I can't put these in
 Steven> maude_SOURCES since I don't want them compiled but of course they
 Steven> have to be distributed, so I put them in EXTRA_maude_SOURCES. Is
 Steven> there a better way?

In some conditions (using subdir sources, or per-target flags),
this will cause superfluous build rules to be generated (one
rule for each such file), because what EXTRA_maude_SOURCES says
is that these files might be built and Automake should account
for that.  Better use EXTRA_DIST in case.  If that was my source
tree, I would rename all these files to something Automake
doesn't compile, as that would also make the tree clearer to

 Steven> (4) I notice that the top level Makefile produced by automake tries to
 Steven> do an autoconf and configure even though I just did a
 Steven> configure. I've noticed this with other packages over the years
 Steven> but just ignored it; but it can be really annoying when the hosts
 Steven> autoconf is old and doesn't look for

That should not happen and is probably due to some timestamp breakage.  
The two most frequent causes of this are
  - building on an NFS-exported disk when the NFS client and
    the NFS server do not have synchronized clocks.
  - untaring packages with `tar -m' (some people do this, no idea why)

 Steven> One slightly amusing thing - I see in section 9.4 of the automake
 Steven> manual the example program is called maude... Well my program is
 Steven> really called maude and has been for many years:

No idea how old is this maude.

Alexandre Duret-Lutz

reply via email to

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