Understand the configure script

The configure script in order to allow a program to run on a variety of different types of machine design. Before using make to compile the source code, configure and will be matched on the target machine depends according to their libraries.

Convention, all the configure script from the script file name is regarded configure, in general, is a shell script to generate the makefile according to where the system environment. When I read the contents of some programs configure super much, it was hard to read.

Scan the current environment running the configure script to generate a named config.statussub-script. Sub-script Makefile.infiles to adapt to the current system environment Makefilefile.

GNU build system

This tool can help us generate the configure script. System Build the GNU , also known as Autotools.

This tool queries the current system environment variables, platform architecture, currently dependent libraries and their location, and then based on this information to make, so that we can achieve the same set of code only what you can configure different unix / linux systems in compile and run.

Autotools contains commands are autoconf, automake, libtool.

autoconf

The main role is to create autoconf command configure. It is based on configure.acdocuments generated configurefile.

autoscan

autoscanAutoconf is an auxiliary command, it creates a preparation of the configure ( configure.scan), as autoconf command input. We can add on demand content on this file, manually change the name after the modification becomes configure.acfiles.

autoheader

autoheaderAutoconf is also an auxiliary command to generate a configure template header file config.h.in.

automake

The main role is to create automake command Makefile. To Makefile.amand configure.acas an input to Makefile.inthe output. Makefile.inConfigure for generating at execution Makefile.

libtool

The main role of libtool command is to create and use shared (dynamic link) library portable.

Other related commands

ifnamesCommand lists preprocessing program identifier, for example #if, #ifdefand the like.

m4 File processing macros.

pkg-config Query interface has been installed library.

configure the standard file stream

The following command file stream and clear description to configure the entire process from the make.

configure standard process

Reference material

configure

GNU build system

autotools faq

autoconf doc

Original: Big Box  understanding configure script


Guess you like

Origin www.cnblogs.com/sanxiandoupi/p/11642081.html