When you compile and install software on Linux, you often encounter./configure prefix=usr This command ... what does/configure-prefix mean? Here is a brief introduction to the use of/configure-prefix.
The installation of the source code typically consists of these three steps: Configuration (Configure), compilation (make), installation (make install).
Configure is an executable script that has many options for using commands under the source path to be installed./configure-help output A detailed list of options.
Where the-prefix option is the path to configure the installation, if this option is not configured, the executable file is placed by default in/usr/local/bin, the library file defaults to/usr/local/lib, and the profile defaults to/USR/LOCAL/ETC, Other resource files are placed in/usr/local/share and are more dispersed.
To facilitate centralized management of a variety of files for a particular software, you can configure-prefix, such as:
./configure-prefix=/usr/local
You can put all the resource files in the/usr/local path, and you won't be distracted.
Another benefit of using the-PREFIX option is uninstalling the software or porting the software. When an installed software is no longer needed, simply remove the installation directory, you can uninstall the software cleanly; the porting software simply copies the entire directory to another machine (the same operating system).
Of course, to uninstall the program, you can also use the make uninstall once in the original made directory, but only if the make file specifies uninstall.
Configure is an executable script that has many options, using commands./configure-help output A detailed list of options, as follows:
-bash-3.00#./configure--help
usage:configure [Options] [host]
Options: [Defaults in brackets after descriptions]
Configuration:
--cache-file=file cache test results in file
--HELP Print this message
--no-create do not create output files
--quiet,--silent does not print ' checking ... ' messages
--version Print the version of autoconf that created configure
Directory and file names:
--prefix=prefix install architecture-independent files in prefix
[/usr/local]
--exec-prefix=eprefix install architecture-dependent files in Eprefix
[Same as prefix]
--bindir=dir user executables in DIR [Eprefix/bin]
... (omit a number of)
A lot of options, personally think, can ignore everything else, but please add-prefix.
For example, to install supersparrow-0.0.0, you intend to install it to the directory/usr/local/supersparrow, and then execute the script with options in the supersparrow-0.0.0 directory:
./configure--prefix=/usr/local/supersparrow
Compile and install after successful execution (Make,make install);