./Configure details, configure details
Http://blog.chinaunix.net/uid-21139058-id-446661.html 'configure 'script has a lot of command line options. for different software packages, these options may change, but many basic options will not change. run the 'configure 'script with the' -- help' option 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 = 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
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
Trackback: http://tb.blog.csdn.net/TrackBack.aspx? PostId = 1440383
After a software package is installed by compiling the source code, how can it be fully uninstalled ??
If the original source is still there, many source makefiles have the write uninstall rule, which is feasible to make uninstall directly in Souce, but it is not written by unscrupulous authors, let's take a look at what he did in the install part of Makefile, and then delete it one by one.
If the source is gone... it's depressing.
So far, you can make uninstall .......
(Because the error is always installed accidentally, make uninstall & make clean and re-configure ......)
Basic installation and uninstallation of software in linux
The installation and uninstallation of Linux software has been a problem for many new users. In Windows, we can use the installation and uninstallation programs that come with the software or "Add/delete programs" in the control panel. Similarly, in Linux, there is a powerful software installation and uninstallation tool named RPM. It can be used to establish, install, query, update, and uninstall software. This tool is used in the command line. Enter rpm at the Shell prompt to obtain help information for this command.
Software Installation
The installation of software in Linux is mainly in two different forms. The first installation file is xxx.tar.gz, and the other is named xxx. i386.rpm. Most of the software released in the first method is sent in the source code form, and the second method is directly sent in binary form.
For the first method, the installation method is as follows:
1. First, copy the installation file to your directory. For example, if you log on as root, copy the software to/root.
# Cp xxx.tar.gz/root
2. Because the file is compressed and packaged, decompress it. Command:
# Tar xvzf filename.tar.gz if it is in the filename.tar.bz2 format, it should be tar jxvf filename.tar.bz2 to decompress
3. After executing this command, extract the installation file to the current directory by path. Run the ls command to view the decompressed file. Generally, the files generated after decompression contain the "Install" file. This file is a plain text file that describes the installation method of the software package in detail.
4. Execute the decompressed command to generate an executable script program named configure. It is used to check whether the system has the library required for compilation, and whether the library version meets the compilation requirements and other system information required for installation. Prepare for subsequent compilation. Command: #./configure
If you want to install the software to a specified directory, use #. /configure -- prefix =/the directory you specify. For example, if you want to install an mlterm in the/opt/mlterm directory, enter
#./Configure -- prefix =/opt/mlterm
5. After the check is passed, the MakeFile file for compilation will be generated. Now you can start compiling. The compilation process varies depending on the software scale and computer performance. Command: # make.
6. After compilation, enter the following command to start installation:
# Make install
7. After installation is complete, clear the temporary files generated during compilation and files generated during configuration. Run the following command:
# Make clean
# Make distclean
So far, the software installation is complete.
For the second method, the installation method is much simpler.
Copy the installation file to your directory in the same way as the first method. Then use rpm to install the file. The command is as follows:
# Rpm-I filename. i386.rpm
Rpm automatically unpacks the installation file and installs the software in the default directory. And register the software installation information to the rpm database. The role of parameter I is to enable rpm to enter the installation mode.
Uninstall Software
1. The software is mainly detached using rpm. To uninstall a software package, you must first know the name registered in the system. Type the following command:
# Rpm-q-
You can query all the software packages installed in the current system.
2. Determine the name of the software to be detached, and you can start to uninstall the software. Type the following command:
# Rpm-e [package name]
You can uninstall the software. The function of parameter e is to enable rpm to enter the uninstall mode. Uninstall the software package named [package name. Each software package in the system depends on each other. If the object cannot be detached because of dependency, the rpm prompts and stops uninstalling the object. You can run the following command to ignore the dependency and directly start detaching:
# Rpm-e [package name]-nodeps
Uninstalling dependencies may make other software unavailable in the system.
If you want to know where the rpm package is installed?
Use # rpm-ql [package name]
3. How to uninstall the software installed with the source code package?
It is best to look at README and INSTALL. In general, it is said, but most of the software does not provide the uninstallation method of the source code package; we can find the Software Installation Point to delete. It mainly depends on where you installed it.
For example:
If the software is installed, specify a directory. This problem will not be difficult;
For example, use the source code package to install gaim
#./Configure -- prefix =/opt/gaim
# Make
# Make install
If you install mlterm
#./Configure -- prefix =/opt/mlterm
# Make
# Make install
Install all the software installed in the source code package in the/opt directory ??
If deleted, the corresponding software directory will be deleted;
Some software needs to execute make uninstall in the decompressed installation directory, so it will be uninstalled.
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 any available options. although many options are rarely used, it is helpful to know their existence when you configure a package for special purpose. 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 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 'will produce the output document. this option prevents 'configure 'from generating this document. you can think of this 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 separate structure. 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 configure the installation location of the document on which the structure depends. the compiled 'memacs' binary document is such a question. if this option is not configured, the default option value will be set to the same as the '-- prefix' option value.
-- Bindir = DIR
Specifies the installation location of the binary document. The binary document here is defined as a program that can be directly executed by the user.
-- Sbindir = DIR
Specifies the installation location of the ultimate binary document. This is a program that can only be executed by the ultimate user.
-- Libexecdir = DIR
Specifies the installation location of the executable support documentation. Unlike the binary documentation, these documents are never directly executed by the user, but can be executed by the binary document mentioned above.
-- Datadir = DIR
Specifies the installation location of the common data document.
-- 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 Document.
-- Includedir = DIR
Specifies the installation location of the C header document. Other languages such as C ++ can also use this option.
-- Oldincludedir = DIR
Specifies the installation location of the C header document 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 generally in the same directory as the source code document.
-- 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 'Document 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 = BUILD
The system platform where the software package is installed. If this parameter is 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 select 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 and can be used with '-- enable-FEATURE. 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 an existing software package in 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 provides a method to indicate to the 'configure' script the directory containing the X11 header document.
-- 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 advantage of constructing a derived document in a separate source code tree is obvious: derived documents, such as the target documents, will be scattered in the source code tree in disorder. this makes it difficult to build the same target document 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
After a software package is installed by compiling the source code, how can it be fully uninstalled ??
If the original source is still there, many source makefiles have the write uninstall rule, which is feasible to make uninstall directly in Souce, but it is not written by unscrupulous authors, let's take a look at what he did in the install part of Makefile, and then delete it one by one.
If the source is gone... it's depressing.
So far, you can make uninstall .......
(Because the error is always installed accidentally, make uninstall & make clean and re-configure ......)