Description of configure parameters for Linux source code Installation Software

Source: Internet
Author: User
Tags gtar
From: http://blog.sina.com.cn/s/blog_55079574010009ho.html
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 !). ToAccelerationThe subsequent configuration will store the test results in a cache file. When configure has a complicated source code tree with the 'configure 'script in each subtree, it is a good Cache
File is 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 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 = prefix (File Installation location, default:/usr/local)
'-- 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/share

-- 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. The default value is eprefix/bin.

--SBindir = dir
Specifies the installation location of the Super binary file. This is a program that can only be executed by the super user. The default value is eprefix/sbin.

-- Libexecdir = Dir (package directory, program call)
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. The default value is eprefix/libexec.

-- Datadir = dir
Specifies the installation location of common data files. The default value is prefix/share.

-- Sysconfdir = Dir (/etc configuration file directory, prefix/etc by default)
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. The default value is prefix/COM.

-- Localstatedir = dir
Specifies the installation location of writable data that can only be used by a single machine. The default value is prefix/var.

-- Libdir = Dir (library file directory)
Specifies the installation location of the library file. The default value is prefix/lib.

-- 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 ++. The default value is prefix/include.

-- Oldincludedir = dir
Specifies the installation location of the C header file installed by the compiler except GCC. The default value is/usr/include.

-- Infodir = dir
Specifies the installation location of the Info format document. info is the document format used by the GNU project. The default value is prefix/info.

-- Mandir = Dir (installation directory of the help document)
Specifies the installation location on the manual page. The default value is prefix/man.

-- 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] (system parameter configuration, completed during compilation)
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 andUninstall
 
Installation andUninstallIt has always been a problem that has plagued many new users. In Windows, we can install the softwareUninstallPrograms or "Add/delete programs" in the control panel. Similar to this, there is a powerful software installation in LinuxUninstallTool named rpm. It can be used to establish, install, query, update,UninstallSoftware. 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 needs and other system information required for installation. (Whether or not the library file is stored again and the library file must comply with system requirements) to 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 .. /Configure configures software attributes, installation directories, and checks whether the library files required for compilation exist (meeting the conditions) to generate makefile files required for compilation. make generate the compilation software make install software make clean, make distclean clear the temporary files and configuration files generated during the installation process

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. ParametersIThe role is to enable RPM to enter the installation mode.

SoftwareUninstall

1. SoftwareUninstallIt mainly uses rpm.UninstallFirst, you must know the name of the software package registered in the system. Type the following command:

# Rpm-Q-

You can query all the software packages installed in the current system.

2. Confirm the requirementUninstallTo start the actualUninstallThe software is ready. Type the following command:

# Rpm-E [package name]

You can.UninstallSoftware. The function of parameter E is to enable RPM to enterUninstallMode. For a software package named [package name]Uninstall. Each software package in the system depends on each other. If the dependency does not existUninstall, RPM will prompt and stopUninstall. You can use the following command to ignore the dependency and start directly.Uninstall:

# Rpm-E [package name]-nodeps ignores dependencies in the Software Package

Ignore dependencyUninstallOther software in the system may be unavailable.

If you want to know where the RPM package is installed?

# Rpm-QL [package name] should be used to display the file list of the software suite

3. HowUninstallSoftware installed with the source code package?

It is best to look at readme and install. In general, it is said that, but most software does not provide the source code packageUninstallMethod; we canFind the Software Installation Point and delete it.. It mainly depends on where you installed it. (Delete the execution file before deleting the process)

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;

If deleted, the corresponding software directory will be deleted;

Some software needs to execute make Uninstall in the decompressed installation directory.UninstallDropped

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