Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent autotools from re-generating configure script automatically?

Tags:

git

autotools

Sometimes due to the SCM not strictly remembering the timestamp of files the generated Makefile will think that it needs to re-run "autoreconf -i" or equivalent to re-generate Makefile.in from Makefile.am, configure from configure.ac, etc..

How do I prevent this?

I want to prevent it because it causes these problems:

  • when creating a dist archive (git archive --format=tar ...) the timestamp will be incorrect and the problem will be there for end-users. Not cool.
  • On slow systems this makes the compile take a lot longer, because it's no longer configure, make, make install, but configure, autoreconf -i, configure, make make install.

I know I can "touch" the generated files prior to making a dist tarball, but in my opinion that only solves the problem for the tarballs, not for developers. It's also an ugly hack to work around a misfeature that should just be turn-off-able. Also, it breaks git archive, since the timestamps won't always be correct there anyway.

Other SCMs also have this, so the problem is not (IMO) with git.

like image 653
Thomas Avatar asked Mar 01 '23 16:03

Thomas


1 Answers

You need to look into maintainer mode - that should prevent the autoreconf step, which will fix the end-users' problems.

Add

AM_MAINTAINER_MODE

to your configure.ac / configure.in file, then (unless you specify --enable-maintainer-mode) when you configure, you're Makefile won't contain the reconfigure rules.

like image 64
Douglas Leeder Avatar answered Mar 05 '23 15:03

Douglas Leeder