It seems that some autoconf projects use a configure.in
file to generate a configure
script, and some use configure.ac
.
What is the difference/advantage between using one or the other?
configure.ac (sometimes also named: configure.in) is an input file for autoconf. It contains tests that check for conditions that are likely to differ on different platforms. The tests are made by actually invoke autoconf macros.
In configure.ac, lines commented with '#' that occur after AC_INIT will appear in the resulting configure script. dnl comments will not. One purpose of dnl is to discard unwanted newlines in an effort to make the configure script readable.
The configure script is responsible for getting ready to build the software on your specific system. It makes sure all of the dependencies for the rest of the build and install process are available, and finds out whatever it needs to know to use those dependencies.
Autoconf essentially runs the preprocessor on your script to produce a portable shell script which will perform all the requisite tests, produce handy log files, preprocess template files, for example to generate Makefile from Makefile.in and and take a standard set of command line arguments.
Its just a matter of style. Historically autoconf files were named configure.in
. Now configure.ac
is the preferred naming scheme. Its also discussed in the documentation.
New projects should use configure.ac. Old projects used configure.in; if it is inconvenient to switch to the new name, they can continue to use it, but the autoconf tools will generate a warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With