Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How configure script decides to regenerate itself

When I run ./configure sometimes it decides that it's too old and re-runs autoconf through missing script to regenerate itself. Sometimes it leads to weird breakages since autoconf on the target machine is older then autoconf that was used to originally generate configure.

I was wondering how it figures out that it's too old? Is there a standard way for configure to do that? or it depends on the library. Pointers to documentation would be appreciated.

like image 969
KiRPiCH Avatar asked Nov 05 '10 03:11

KiRPiCH


1 Answers

configure does not decide this: make does. If the configure script is older than configure.ac or any of the files it includes (starting with aclocal.m4), then make runs autoconf to rebuild configure.

Similar rules exist to rebuild aclocal.m4 using aclocal, and the various Makefile.in using automake.

These rebuild rules should never be triggered after you unpack a tarball on a target machine, because the timestamp of all these files in the tarball should be correct (configure newer than configure.ac, etc.). So if this happens, either something is bogus in your tarball (like you did not use make dist or preferably make distcheck to generate it), or the user compiling the source code did something wrong (like copying the entire directory without preserving the timestamps), or there is something bogus in the target system (e.g. make usually fail to work properly on a NFS-mounted directory if the clock of the NFS-server is not synchronized with that of the client).

Another frequent source of unwelcome rebuilt is observed by people who keep the generated files in version-control system. See https://www.gnu.org/software/automake/manual/html_node/CVS.html for a discussion about this if that is your case.

like image 71
adl Avatar answered Sep 28 '22 09:09

adl