Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the Configure options configured in Linux

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "What are the Configure options in Linux?" In daily operation, I believe many people have doubts about what problems there are in the Configure option configuration in Linux. Xiaobian consulted various materials and sorted out simple and easy to use operation methods. I hope to help you answer the doubts about "What are the Configure options in Linux?"! Next, please follow the small series to learn together!

Linux environment software installation, is not an easy thing; if through the source code compiled after installation, of course, things are more complicated; now install a variety of software tutorials are very common; but the same thing, a solid grasp of the basic knowledge, installation of various software problems will be solved. The Configure script configuration tool is one of the basics, and it is the basic application of autoconf's tools.

Compared with some skills, Configure seems to be basic, of course, it seems boring to use and learn, of course, to become a master, familiar with the foundation can not exceed oh.

For this reason, I reprinted a detailed introduction to Configure option configuration. For your reference, the 'configure' script has a large number of command line options. These options may vary from package to package, but many basic options remain unchanged. Execute the 'configure' script with the '-help' option to see all the options available. Although many options are rarely used, it is beneficial to know that they exist when you configure a package for specific needs. A brief description of each option follows:

–cache-file=FILE

'configure' tests for features (or bugs!) on your system. To speed up subsequent configuration, test results are stored in a cache file. When configuring a complex source tree with 'configure' scripts in every subtree, the presence of a good cache file helps a lot.

–help

Output help information. Even experienced users occasionally need to use the '-help' option, as a complex project may contain additional options. For example, the GCC package's 'configure' script contains options that allow you to control whether the GNU assembler is generated and used in GCC.

–no-create

A main function in 'configure' produces output files. This option prevents 'configure' from generating this file. You can think of it as a dry run, although the cache is still overwritten.

–quiet

–silent

When 'configure' performs its test, it outputs a brief message telling the user what it is doing. This is done because 'configure' may be slow and without this output the user will be left wondering what is happening. Using either of these options will throw you aside. If there was no such output, the user would be left wondering what is happening. By using this option, you too can be left wondering!)

–version

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

- prefix=preFIX(where the file is installed)

'-prefix' is the most common option. The resulting 'Makefile' will see the parameters passed with this option, and when a package is installed it can completely relocate its structural components. As an example, when installing a package, say Emacs, the following command will cause Emacs Lisp file to be installed in "/opt/gnu/share":

$ ./ configure –prefix=/opt/gnu/share

–exec-prefix=EPREFIX

Similar to the '-prefix' option, but it is used to set the installation location of structure-dependent files. The compiled 'emacs' binary file is one such file. If this option is not set, the default option value will be set to the same value as the '-prefix' option.

–bindir=DIR

Specifies the location where the binary file is installed. Binary files here are defined as programs that can be executed directly by users.

-sbindir=DIR

Specifies the location where the super binary file is installed. These are programs that can usually only be executed by superusers.

- libexecdir=DIR(package directory, program call)

Specifies the installation location for executable support files. In contrast to binaries, these files are never executed directly by the user, but can be executed by the binaries mentioned above.

–datadir=DIR

Specify the installation location for the generic data file.

- sysconfdir=DIR(/etc configuration file directory)

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

–sharedstatedir=DIR

Specifies the installation location for writable data that can be shared across multiple machines.

–localstatedir=DIR

Specifies the installation location of writable data for stand-alone use only.

- libdir=DIR(library file directory)

Specify the installation location for library files.

–includedir=DIR

Specify the location where C header files are installed. Other languages such as C++ header files can also use this option.

–oldincludedir=DIR

Specifies the installation location of C header files installed for compilers other than GCC.

–infodir=DIR

Specifies the installation location of documents in Info format.Info is the document format used by the GNU Project.

- mandir=DIR(installation directory of help documentation)

Specifies where man pages are installed.

–srcdir=DIR

This option has no effect on installation. He tells 'configure' where the source code is located. Generally, this option is not required because the 'configure' script is usually in the same directory as the source files.

–program-prefix=PREFIX

Specifies the prefix to be added to the name of the installed program. For example, using '-program-prefix=g' to configure a program named 'tar' will cause the installed program to be named 'gtar'. When used in conjunction with other installation options, this option only works if it is used by the `Makefile.in 'file.

–program-suffix=SUFFIX

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

–program-transform-name=PROGRAM

Program here is a sed script. When a program is installed, its name is passed through sed -e PROGRAM to produce the installed name.

–build=BUILD

Specifies the system platform on which the package is installed. If not specified, the default value will be the value of the '-host' option.

–host=HOST

Specifies the system platform on which the software runs. If not specified,`config.guess 'will be run to detect.

–target=GARGET

Specifies the system platform for which the software is targeted. This works primarily in the context of programming language tools such as compilers and assemblers. If not specified, the default value for the '-host' option will be used.

–disable-FEATURE

Some packages can select this option to provide compile-time configuration for large options, such as using the Kerberos authentication system or an experimental compiler optimization. If these features are provided by default, you can disable them by using '-disable FEATURE' where 'FEATURE' is the name of the feature. For example:

The code is as follows:

$ ./ configure –disable-gui

-enable-FEATURE[=ARG](system parameter configuration, done at compile time)

Conversely, some packages may provide features that are disabled by default and can be enabled using '-enable-FEATURE'. Here 'FEATURE' is the name of the feature. A feature may accept an optional parameter. For example:

The code is as follows:

$ ./ configure –enable-buffers=128

`-enable-FEATURE=no 'is synonymous with'-disable-FEATURE 'mentioned above.

–with-PACKAGE[=ARG]

In the free software community, there is a fine tradition of using existing packages and libraries. When using 'configure' to configure a source tree, it provides information about other installed packages. For example, the BLT device kit depends on Tcl and Tk. To configure BLT, you may need to provide 'configure' with some information about where we put Tcl and Tk:

The code is as follows:

$ ./ configure –with-tcl=/usr/local –with-tk=/usr/local

'-without-PACKAGE =no' is synonymous with '-without-PACKAGE' mentioned below.

–without-PACKAGE

Sometimes you may not want your software package to work with the software that the system already has

Package interaction. For example, you may not want your new compiler to use GNU ld. You can do this by using this option:

The code is as follows:

$ ./ configure –without-gnu-ld

–x-includes=DIR

This option is a special case of the '-with-PACKAGE' option. When Autoconf was first developed, it was popular to use 'configure' as a workaround to Imake software that runs on X. The-x-includes 'option provides a way to indicate to the' configure 'script the directory containing the X11 header files.

–x-libraries=DIR

Similarly, the '-x-libraries' option provides a way to indicate to the 'configure' script the directory containing the X11 libraries.

Running 'configure' in the source tree is unnecessary and undesirable. A good 'Makefile' generated by 'configure' can build packages whose source code belongs to another tree. The advantage of constructing derived files in a tree independent of the source code is obvious: derived files, such as object files, are scattered haphazardly throughout the source code tree. It also makes it difficult to build the same object file on a different system or with different configuration options. Three trees are recommended: a source tree, a build tree, and an install tree. Here's a close example of GNU malloc packages built using this method:

The code is as follows:

$ 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

With the tree configured, you can continue to build and install the package to the default location '/usr/local':

The code is as follows:

$ make all && make install

How to uninstall a package completely after it has been installed by compiling source code?

If the original source is still there, many source Makefiles have uninstall rules written, directly in Souce make uninstall is feasible, but encounter unscrupulous authors did not write, that sentence by sentence see Makefile install part of what he did, and then delete one by one.

If the source is missing... Then be depressed.

So far, I've been able to make uninstall...

Make uninstall&&make clean, then reconfigure...

At this point, the study of "What are the Configure options in Linux" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report