[Top][All Lists]

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

calling autoreconf and minimizing rebuilds

From: David Byron
Subject: calling autoreconf and minimizing rebuilds
Date: Wed, 6 Sep 2006 11:57:21 -0700

I'm curious if there's a good way to handle the following.

I've got a helper Makefile whose job is to build "everything" in my project --
lots of modules, other initial setup stuff, some with autotools, some without,

To build the autotools stuff, the recipe is (basically)

$ autoreconf -fvi
$ mkdir build
$ cd build
$ ../configure && make && make install

So far so good.

The bummer is what happens when I run this helper Makefile twice without doing
anything else in between.  Ideally (I think), nothing should happen.  But, since
I run autoreconf -fvi, it does.  I tried just running autoreconf -vi again after
this and at that point running make invokes configure again.

I figure there's a way to set up my helper makefile so that if the build
directory already exists, it just runs make and make install there (depending on
the fancy rules to re-run things when necessary).  Only if there's no build
directory does it create one and run configure there.  I can probably get it
even more granular so that if the build directory exists, but no Makefile
exists, then it runs configure, etc.

But, this leaves me with a struggle...I bet there are times when I need to
re-run autoreconf, even if the build directory and build/Makefile exist.  The
autoconf docs say that

"autoreconf runs autoconf, autoheader, aclocal, automake, libtoolize, and
autopoint (when appropriate)"

It doesn't seem like this is the case though since autoreconf -vi causes
configure to run again when I run make.  There's also the case of a new version
of one of the autotools for which I need to run autoreconf -fvi...Any chance
there's a way for autoreconf to figure that out on its own?

As I double-check this before sending, I see something that's no doubt
important.  Here's the sequence of commands:

$ autoreconf -fvi
$ mkdir build
$ cd build
$ ../configure
$ make
<stuff happens, as it should>
$ cd ..
$ autoreconf -vi
$ cd build
$ make
<stuff happens, including ./config.status --recheck, make does nothing>
$ cd ..
$ autoreconf -vi
$ cd build
$ make
<no ./config.status and make does nothing>

So, the first time I run autoreconf -vi, something triggers ./config.status to
run again.  The second time nothing's changed.  The third, fourth, etc. are the
same as the second time.

I repeated the test, running make as

$ make -d -p -r >make.out 2>&1

and see this:

    Prerequisite `../configure' is newer than target `config.status'.
   Must remake target `config.status'.
/bin/sh ./config.status --recheck

automake 1.9.6, autoconf 2.60.

Any ideas?

Thanks much.


reply via email to

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