Description of configure parameters in Linux

Source: Internet
Author: User
Tags gtar

Description of configure parameters for Linux operating systems 09:11:39 Source: Author: [large, medium, small] Comment: 0 added:

Installing software in Linux is not an easy task. If the software is installed after source code compilation, it is more complicated.
The tutorials are very common, but they do not leave them alone. If you have a solid grasp of the basic knowledge, you can solve the problems of installing various software. Configure script configuration tool is one of the basics. It is
The basic application of the Autoconf tool.

Compared with some techniques, configure is more basic. Of course, it is boring to use and learn. Of course, to become a master, you must be familiar with the basics.

For this reason, I have reproduced a detailed introduction to the configuration of configure options. For your reference

The 'configure 'script has a large number of command line options. For different software packages, these options may change, but many basic options will not change. Take '--
Execute the 'configure 'script to view all available options. Although many options are rarely used, when you configure a package for Special Needs
It is very beneficial to know their existence. Next we will give a brief introduction to each option:

-- Cache-file = File

'Configure 'tests existing features (or bugs!) on your system !). To accelerate subsequent configuration, the test results are stored in a cache.
File. When configure has a complex source code tree with 'configure 'scripts in each subtree, the existence of a good cache file will be of great help.

-- Help

Output help information. Even experienced users occasionally need to use the '-- help' option, because a complex project contains additional options. For example, the 'configure 'script in the GCC contains options that allow you to control whether to generate and use the GNU Compiler in GCC.

-- No-create

A major function in 'configure 'creates an output file. This option prevents 'configure 'from generating this file. You can think of it as a dry run, although the cache is still rewritten.

-- Quiet

-- Silent

When 'configure' performs his/her test, a brief message is output to tell the user what is being done. This is because 'configure 'may be slow, and no
If this type of output is used, the user will be thrown aside and wondering what is happening. using either of the two options will throw you aside. The two sentences are interesting. The original Article is as follows: if
There was no such output, the user wocould be left wondering what is
Happening. By using this option, you too can be left wondering !)

-- Version

Print the Autoconf version used to generate the 'configure 'script.

-- Prefix = pewfix

'-- Prefix' is the most common option. The generated 'makefile' will view the parameters passed with this option. When a package is installed, it can be completely reinstalled.
Create an independent part. For example, to install a package, for example, emacs, the following command will install Emacs lisp file to "/opt/GNU/share ":

$./Configure -- prefix =/opt/gnu

-- Exec-Prefix = eprefix

It is similar to the '-- prefix' option, but it is used to set the installation location of the file relying on the structure. The compiled 'memacs' binary file is such a question. If this option is not set, the default option value is set to the same as the '-- prefix' option value.

-- Bindir = dir

Specifies the installation location of the binary file. The binary file here is defined as a program that can be directly executed by the user.

-- Sbindir = dir

Specifies the installation location of the Super binary file. This is a program that can only be executed by Super Users.

-- Libexecdir = dir

Specifies the installation location of executable support files. In contrast to binary files, these files are never directly executed by users, but can be executed by the binary files mentioned above.

-- Datadir = dir

Specifies the installation location of common data files.

-- Sysconfdir = dir

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

-- Sharedstatedir = dir

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

-- Localstatedir = dir

Specifies the installation location of writable data that can only be used by a single machine.

-- Libdir = dir

Specifies the installation location of the library file.

-- Includedir = dir

Specifies the installation location of the C header file. You can also use this option for header files in other languages such as C ++.

-- Oldincludedir = dir

Specify the installation location of the C header file installed by the compiler except GCC.

-- Infodir = dir

Specifies the installation location of the Info format document. info is the document format used by the GNU project.

-- Mandir = dir

Specifies the installation location of the manual page.

-- Srcdir = dir

This option does not work for installation. It will tell the 'configure 'source code location. Generally, you do not need to specify this option, because the 'configure 'script is generally in the same directory as the source code file.

-- Program-Prefix = prefix

Specifies the prefix that will be added to the name of the installed program. For example, if you use '-- Program-Prefix = G' to configure a program named 'tar ',
The installed program is named 'gtar '. This option works only when it is used with other installation options by the 'makefile. in' file.

-- Program-suffix = suffix

Specifies the suffix that will be added to the name of the installed program.

-- Program-transform-name = Program

The program here is a sed script. When a program is installed, its name will pass through 'sed-e program 'to generate the installation name.

-- Build = build

The system platform where the software package is installed. If not specified, the default value is the value of the '-- host' option.

-- Host = Host

System platform where the software runs. If not specified. Run 'config. Guess 'to detect the vulnerability.

-- Target = garget

Specifies the target to system platform of the software. This mainly plays a role in programming language tools such as compiler and assembler context. If not specified, the '-- host' option value is used by default.

-- Disable-feature

Some software packages can choose this option to provide compilation configuration for large options, such as using the Kerberos authentication system or an experimental compiler optimal configuration. If these features are provided by default, you can use '-- disable-feature' to disable them. Here 'feature 'is the name of the feature, for example:

$./Configure -- disable-Gui

-Enable-feature [= Arg]

On the contrary, some software packages may provide some features that are disabled by default. You can use '-- enable-feature' to start using it. Here, 'feature 'is the feature name. A feature may accept an optional parameter. For example:

$./Configure -- enable-Buffers = 128

'-- Enable-feature = no' is synonymous with' -- disable-feature 'mentioned above.

-- With-package [= Arg]

There is an excellent tradition of using existing software packages and libraries in the free software community. When you use 'configure 'to configure a source code tree, you can provide information about other installed software packages. For example,
The BLT device toolkit relies on Tcl and TK. To configure the BLT, you may need to provide the 'configure 'with some information about where we installed the Tcl and TK:

$./Configure -- With-tcl =/usr/local -- With-TK =/usr/local

'-- With-package = no' is synonymous with' -- without-package 'mentioned below.

-- Without-Package

Sometimes you may not want your software package to interact with the existing software package of the system. For example, you may not want your new compiler to use GNU lD. You can do this by using this option:

$./Configure -- without-GNU-LD

-- X-regiondes = dir

This option is a special case of the '-- With-package' option. When Autoconf was initially developed, 'configure 'is widely used
Imake can be used to create software running on X. The '-- X-uploads' option specifies to the 'configure' script the directory containing the X11 header file.

-- X-libraries = dir

Similarly, the '-- X-libraries' option provides a method for specifying the directory containing the X11 Library to the 'configure' script.

Running 'configure 'in the source code tree is unnecessary and bad. A good 'makefile' generated by 'configure 'can be constructed.
The source code is a software package of another tree. The benefit of constructing a derived file in a tree independent of the source code is obvious: derived files, such as the target file, will be scattered in the source code tree in disorder. This also makes
It is very difficult to build the same target file with different configuration options. We recommend that you use three trees: A source tree and a build tree.
Install tree ). Here is 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 how 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

In this way, the build tree is configured. You can continue to build and install the package to the default location '/usr/local ':

$ Make all & make install

Related Article

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: 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.