How to use autoscan command in Linux?
Linux autoscan is a command line tool that is used to generate a configure.in file from an existing source code directory. The configure.in file is used as a template for the configure script, which is a shell script that is used to configure a software package for installation on a specific system. The configure script is generated from the configure.in file using the autoconf command.
configure.in and configure.ac files:
The "configure.in" file was the older version of the "configure.ac" file used in Autoconf projects. It was replaced by the "configure.ac" file in Autoconf version
2.50. The "configure.ac" file is used to specify the project's information and the macros that are required for the configure script. It is written in the M4 language (macro processing language).
The "configure.scan" file is generated by the autoscan command and contains a list of the required macros for the configure script. It is used as a starting point for the "configure.ac" file.
Debian based -
apt install autoconf
apk add autoconf
Arch Linux -
pacman -S autoconf
yum install autoconf
dnf install autoconf
OS X -
brew install autoconf
apt-get install autoconf
docker run cmd.cat/autoscan autoscan
$ autoscan [OPTIONS]... [Source_Directory]
Options in autoscan command
|don't remove temporary files created by this command.
|prepend directory DIR to search path in Library directories.
|append directory DIR to the search path in Library directories.
|verbosely report processing.
|display this help and exit.
|output version information and exit.
Example usage of
To use the autoscan command, the source code for the project needs to be present in a separate directory. The command is then run from the root directory of the project as follows:
This generates the
configure.scan file in the root directory of the project. The
configure.scan file can then be edited to remove the unnecessary macros and add any additional macros that are required.
To generate the
configure.ac file from the
configure.scan file, the following command can be used:
$ mv configure.scan configure.ac
The configure script can now be generated using the
This generates the configure script in the root directory of the project.
The Linux autoscan command is a essential tool for creating the initial "configure.ac" file for an Autoconf project. It scans the source code and creates a list of required macros in the configure.scan file, which can then be used to create the configure script using the
autoconf command. The configure script is in the configuration of the build process for the project and can be customised using the configure.ac file.