Android system development (4) -- Autotools
Composition of Autotools
1. autoscan
Autoscan is used to scan the source code directory to generate the configure. san file. configure. san contains the basic options for system configuration, which are macro definitions. We need to change its name to configure. in.
2. aclocal
Aclocal is a perl script program. Aclocal automatically generates the aclocal. m4 file based on the content of the configure. in file. The generated aclocal. m4 file is a macro extension file.
3. autoconf
Autoconf is used to generate the configure file, configure. the in file contains some macros. These macros are processed by autoconf and become shell scripts that check system features, environment variables, and required software parameters.
4. autohead
Automatically generate config. h. in
5. automake
Use automake-add-missing to generate Makefile. in.
Document address: https://www.gnu.org/software/autoconf/manual/autoconf.html
Files used in preparing a software package for distribution, when using just Autoconf:
your source files --> [autoscan*] --> [configure.scan] --> configure.ac configure.ac --. | .------> autoconf* -----> configure [aclocal.m4] --+---+ | `-----> [autoheader*] --> [config.h.in] [acsite.m4] ---' Makefile.in
Additionally, if you use Automake, the following additional productions come into play:
[acinclude.m4] --. | [local macros] --+--> aclocal* --> aclocal.m4 | configure.ac ----' configure.ac --. +--> automake* --> Makefile.in Makefile.am ---'
Files used in processing a software package:
.-------------> [config.cache] configure* ------------+-------------> config.log | [config.h.in] -. v .-> [config.h] -. +--> config.status* -+ +--> make* Makefile.in ---' `-> Makefile ---'
Autotools process demonstration 1. autoscan
Modify the configure. san file name to configure. ac or configure. in. Open the configuration and generate the makefile.
2. aclocal
Run the autoconf command to generate the configure executable file and create a new Makefile. am to edit the content.
bin_PROGRAMS = hellohello_SOURCES = hello.c
Install software
Run the make command and sudo make install
Go to/usr/local/bin and execute our Executable File hello
Generate a compressed package