I am newbie of Autotools. From my understanding, one would use the following basic steps to build software using Autotools:
autoreconf --install
./configure
make
However, I noticed that most open source software packages (on Linux) does not need the step 1. They most time just need step 2 and 3 to build. It seems that they already are packaged with Makefile.in
. I am wondering why? Do they manually code the Makefile.in
, or the software developer uses autoreconf
to generate the Makefile.in
before creating the software package?
Thanks.
The software developer who creates the tarball (or who checks out the sources from a version control system) will usually invoke autoreconf
from a script called bootstrap.sh
or autogen.sh
which may do other stuff. autoreconf
might be invoked by Makefile
as well (like when configure.ac
has changed).
Most users will never need to run autoreconf
, even those who are making some modifications to source (e.g. patches). Only those who need to make modifications to the package itself (making changes to configure.ac
and/or Makefile.am
) will need autoreconf
.
Running autoreconf
requires having the correct version of autotools installed already. This leads to a chicken-and-egg problem -- how do you get autotools installed in the first place? It also adds an extra dependency that most end-users don't really need.
As a result, most packagers run autoreconf before producing the source tarballs that they distribute. This means that if you download such a tarball, you can configure and build it without needing to install autotools first.
来源:https://stackoverflow.com/questions/19263899/why-is-autoreconf-not-used-often