Why is "autoreconf" not used often?
Asked Answered
T

2

23

I am newbie of Autotools. From my understanding, one would use the following basic steps to build software using Autotools:

  1. autoreconf --install
  2. ./configure
  3. make

However, I noticed that most open source software packages (on Linux) does not need the 1st step. Most of the time they just need step 2 and 3 to build. It seems that they already are packaged with a Makefile.in. I am wondering why? Do they manually code the Makefile.in, or does the software developer use autoreconf to generate the Makefile.in before creating the software package?

Towill answered 9/10, 2013 at 5:34 Comment(2)
OK. I think I got a possible answer myself: by Not needing the user to run "autoreconf", the software package puts less requirements on the end users' system. I.e. There is no need for the end user to have Autotools installed. I think this is actually quite big and good reason.Towill
That's correct; when configure runs, all the user needs is a couple of script interpreters (a Bourne shell, sed, maybe perl too), plus the compiler toolchain. Even if all the library dependencies are missing, the configure script should be able to run and diagnose the problem or work around it. When you run make dist-gzip, you get a tarball with the configure script, plus all *.in template files packaged so the user doesn't have to do the previous steps that require autotools.Tolerant
S
12

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.

Scrawny answered 9/10, 2013 at 5:49 Comment(0)
M
3

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.

Maris answered 13/6, 2016 at 20:48 Comment(1)
If you want to bootstrap your system from source without using pre-generated configure scripts, then it's not impossible to install autotools directly without using autotools/configure (autoconf is just a shell script, you just need to replace a few placeholder variables that can be done with sed). And once you have one version of autotools, bootstrapping other versions is a bit easier.Ruthenium

© 2022 - 2024 — McMap. All rights reserved.