Linux./configure Command parameter Resolution

Source: Internet
Author: User


Software installation in a Linux environment, it is not an easy thing to do; If you compile from the source code after the installation, of course, the matter is more complex; now the tutorials for installing a variety of software are very common; but million change, the basic knowledge of a solid grasp, the installation of a variety of software problems will be solved. Configure script Configuration tool is one of the basics, it is the basic application of autoconf tools.
The ' Configure ' script has a lot of command-line options. These options may change for different packages, but many of the basic options will not change. Take the ' –help ' option to perform the ' configure ' script to see all the options available. Although many options are rarely used, it is useful to know that they exist when you configure a package for special needs. The following is a brief introduction to each option:
–cache-file=file

' Configure ' will test the presence of features (or bug!) on your system. To speed up the subsequent configuration, the test results are stored in a cache file. When configure a complex source tree with a ' configure ' script in each subtree, the presence of a good cache file can be a big help.

–help

Output help information. Even experienced users occasionally need to use the ' –help ' option because a complex project will contain additional options. For example, the ' configure ' script in the GCC package contains options that allow you to control whether the GNU assembler is generated and used in GCC.

–no-create

A primary function in ' configure ' produces the output file. This option prevents ' configure ' from generating this file. You can think of this as a drill (dry run), although the cache is still rewritten.

–quiet

–silent

When ' Configure ' carries out his tests, it outputs a brief message telling the user what is being done. This is because ' configure ' may be slow, without which the user will be thrown aside to wonder what is happening, and any one of these two options will throw you aside. These two words are more interesting, the original text is this: If there was no such output, the user would to left wondering what is happening. By using this option, too can is left wondering!)

–version

Prints the version number of the autoconf used to produce the ' configure ' script.

–prefix=pewfix

' –prefix ' is the most common option. The ' Makefile ' will look at the parameters passed with this option, and when a package is installed, it can completely relocate the independent part of his structure. For example, when installing a package, such as Emacs, the following command will cause Emacs Lisp file to be installed to "/opt/gnu/share":

$./configure–prefix=/opt/gnu

–exec-prefix=eprefix

Similar to the ' –prefix ' option, but he is used to set the installation location of a structure-dependent file, and a compiled ' emacs ' binary file is one such piece of questioning. If this option is not set, the default option value is set to be the same as the ' –prefix ' option value.

–bindir=dir

Specifies the location where binaries are installed, where the binaries are defined as programs that can be executed directly by the user.

–sbindir=dir

Specifies the location where the super binaries are installed. These are programs that are typically executed only by Superuser.

–libexecdir=dir

Specifies the location where executable support files are installed. In contrast to binary files, these files are never executed directly by the user, but can be performed by the binary file mentioned above.

–datadir=dir

Specifies the location where common data files are installed.

–sysconfdir=dir

Specifies the location of the installation of read-only data to be used on a single machine.

–sharedstatedir=dir

Specifies the installation location for writable data that can be shared on multiple machines.

–localstatedir=dir

Specifies the location where writable data can be installed only for stand-alone use.

–libdir=dir

Specifies the location where the library files are installed.

–includedir=dir

Specifies the location where the C header file is installed. This option can also be used in other languages such as header files for C + +.

–oldincludedir=dir

Specifies the installation location of the C header file that is installed for the compiler outside of GCC.

–infodir=dir

Specifies the location where the info format document is installed. Info is the document format used by the GNU project.

–mandir=dir

Specifies the location where the man page is installed.

–srcdir=dir

This option does not work for the installation, he will tell the ' configure ' source location. This option is not generally specified because the ' configure ' script is in the same directory as the source file.

–program-prefix=prefix

Specifies the prefix to be added to the name of the program you are installing. For example, using ' –program-prefix=g ' to configure a program named ' Tar ' will cause the installed program to be named ' Gtar '. When used with other installation options, this option works only if he is used by the ' makefile.in ' file.

–program-suffix=suffix

Specifies the suffix that will be added to the name of the program you are installing.

–program-transform-name=program

The program here is a sed script. When a program is installed, his name will go through ' sed-e ' to produce the name of the installation.

–build=build

Specifies the system platform on which the package is installed. If not specified, the default value will be the value of the ' –host ' option.

–host=host

Specifies the system platform on which the software runs. If not specified. will run ' config.guess ' to detect.

–target=garget

Specifies the system platform to which the software targets (target to). This works primarily in programming language tools such as compilers and assembler contexts. If not specified, the value of the ' –host ' option is used by default.

–disable-feature

Some packages can choose this option to provide compile-time configuration for large options, such as using the Kerberos authentication system or an experimental compiler optimal configuration. If the default is to provide these features, you can use ' –disable-feature ' to disable it, where ' FEATURE ' is the name of the attribute, for example:

$./configure–disable-gui

-enable-feature[=arg]

Conversely, some software packages may provide some properties that are prohibited by default and can be used using ' –enable-feature '. Here ' FEATURE ' is the name of the feature. An attribute may accept an optional parameter. For example:

$./configure–enable-buffers=128

' –enable-feature=no ' is synonymous with the ' –disable-feature ' mentioned above.

–with-package[=arg]

In the free software community, there are excellent traditions for using existing packages and libraries. When you use ' configure ' to configure a source tree, you can provide information about other packages that have already been installed. For example, a BLT device toolkit that relies on Tcl and Tk. To configure BLT, you may need to provide ' configure ' with information about where we put Tcl and TK:

$./configure–with-tcl=/usr/local–with-tk=/usr/local

' –with-package=no ' is synonymous with the ' –without-package ' that will be mentioned below.

–without-package

Sometimes you may not want your package to interact with a package that is already in the system. For example, you may not want your new compiler to use the GNU LD. You can do this by using this option:

$./configure–without-gnu-ld

–x-includes=dir

This option is a special case of the ' –with-package ' option. When Autoconf was first developed, it was popular to use ' configure ' as a workaround for Imake to make software that runs on X. The ' –x-includes ' option provides a way to indicate to the ' configure ' script the directory that contains the X11 header file.

–x-libraries=dir

Similarly, the ' –x-libraries ' option provides a way to indicate to the ' configure ' script the directory containing the X11 library.

Running ' Configure ' in the source tree is both unnecessary and bad. A good ' Makefile ' produced by ' Configure ' can build a software package that belongs to another tree. The benefits of building derived files in a separate source-independent tree are obvious: derived files, such as target files, can be cluttered and scattered across the source tree. This also makes it very difficult to construct the same target file on another different system or with different configuration options. It is recommended to use three trees: a source tree, a building tree, an installation tree (install). Here's a very close example of using this method to build the GNU malloc package:

$ Gtar ZXF mmalloc-1.0.tar.gz

$ mkdir Build && CD Build

$ .. /mmalloc-1.0/configure

Creating cache./config.cache

Checking for gcc ... gcc

Checking whether the C compiler (GCC) works ... yes

Checking whether the C compiler (GCC) is a cross-compiler ... no

Checking whether we are using GNU C ... yes

Checking whether GCC accepts-g ... yes

Checking for a BSD compatible install .../usr/bin/install-c

Checking host system Type ... I586-pc-linux-gnu

Checking build system Type ... I586-pc-linux-gnu

Checking for ar ... ar

Checking for ranlib ... ranlib

Checking to run the C preprocessor ... gcc-e

Checking for unistd.h ... yes

Checking for getpagesize ... yes

Checking for working mmap ... yes

Checking for limits.h ... yes

Checking for stddef.h ... yes

Updating cache. /config.cache

Creating./config.status

This tree is configured so that the following can continue to build and install this package to the default location '/usr/local ':

$ make all && make install

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.