Detailed description of configure Parameter options

Source: Internet
Author: User
Tags gtar

Installing software in Linux environment is not an easy task. If the software is installed after source code compilation, of course it is more complicated. Currently, various software installation tutorials are common; however, if you have a solid understanding of the basic knowledge, you can solve the problems of installing various software. The 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. run the '-- help' script to view all available options. although many options are rarely used, it is very helpful to know their existence when you configure a package for special needs. next we will give a brief introduction to each option:

'-- Cache-file = FILE'
'Configure 'will test the 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 the 'configure 'script in each subtree, the existence of a good cache file will be very helpful.

'-- 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 'is tested, a brief message is output to tell the user what is being done. this is because 'configure 'may be slow. Without such output, 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 like this: 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 completely relocate its structural independence. 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 on which the structure depends. the compiled 'memacs' binary file is such a question. if this option is not set, the default option value will be 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 the Super User.

'-- Libexecdir = dir'
Specifies the installation location of executable support files. Unlike 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. This option can also be used for header files in other languages such as C ++.

'-- Oldincludedir = dir'
Specifies 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 location of the 'configure 'source code. Generally, this option is not required because the 'configure' script is usually 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 will be named 'gtar '. this option is used only when it is used with other installation options. in 'file used only.

'-- 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 go through 'sed-e program 'to generate the installation name.

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

'-- Host = host'
The system platform where the software runs. If this parameter is not specified, 'config. Guess 'is run to detect the platform.

'-- Target = garget'
Specify the target to system platform of the software. This mainly plays a role in the context of programming language tools such as compilers and compilers. If not specified, the value of the '-- host' option 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 use 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]'
In the free software community, there are excellent traditions of using existing software packages and libraries. 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.

'-- 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, it was popular to use 'configure 'as a work und for imake to create software running on X. the '-- X-uploads' option specifies the directory containing the X11 header file to the 'configure' script.

'-- 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 build a software package whose source code belongs to 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 makes it very difficult to build the same target file on another system or with different configuration options. we recommend that you use three trees: A source tree, a build tree, and an 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

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.