Induction of Configure command skills in Linux

Source: Internet
Author: User
In Linux, the Configure command skills include & amp; lsquo; configure & amp; rsquo; script has a large number of command line options. for different software packages, these options may change, but many basic options will not be changed. with & amp; rsquo; -- help & amp; rsquo; option execution & amp; rsquo; config... in Linux, there are a lot of command line options in the 'configure 'script. for different software packages, these options may change, but many basic options will not be changed. run the '-- help' script to view all available options. although many options are rarely used, it is very helpful to know that they exist when you configure a package for special purpose. 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 settings, 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 very 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 create 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 being tested, a brief message is output to tell the user what he is doing. this is because 'configure 'may be slow, not With such output, users will be thrown aside to wonder what is happening. if you use either of the two options, you will be taken 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 indicates 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, its structure is completely relocated. 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 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 is defined as a program that can be directly executed by the user. -- sbindir = DIR specifies the installation location of the ultimate binary file. this is a program that can only be executed by the ultimate 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 the common data file. -- 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 in other languages such as C ++ header files. -- 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 file. info is the file 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. he will tell the 'configure 'source code location. generally, you do not need to specify this option 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 specifies the system platform where the software runs. if not specified, 'config. guess 'to detect. -- 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 select this option to provide compilation setting for large options, such as using the Kerberos authentication system or an experimental compiler optimal setting. if these features are provided by default, you can use '-- disable-FEATURE' to disable them. here 'feature 'is the name of the FEATURE. example: $. /configure -- disable-gui-enable-FEATURE [= ARG]; some software packages may provide some features that are disabled by default, you can use '-- enable-FEATURE. here, 'feature 'is the FEATURE name. A feature may accept an optional parameter. 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 of using existing software packages and libraries. when you use 'configure 'to set 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 set the BLT, you may need to provide 'configure 'with some information about where we installed Tcl and Tk: $. /configure -- with-tcl =/usr/local -- with-tk =/usr/local' -- with-PACKAGE = no' and the '-- without-package' mentioned below is synonymous. -- without-PACKAGE sometimes you may not want your software PACKAGE to interact with existing software packages 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-nodes des = 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 is similar. 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 setting 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. in this way, the build tree is set. you can 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.