Specify installation directory when compiling software under Linux
1, the source code installation steps
The installation of the source code generally consists of 3 steps:
**
1). Configuration (Configure),
2). Compiling (make),
3). installation (make install).
* * 2,./configure–prefix=/usr/local/test
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 the configuration 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, the profile defaults to/USR/LOCAL/ETC, and the other resource files are placed in the /usr/local/share, more messy.
If you configure –prefix, such as:
./configure–prefix=/usr/local/test
You can put all the resource files in the/usr/local/test path without clutter. 3, prefix options other benefits
Another benefit of using the-PREFIX option is uninstalling the software or porting the software. When an installed software is no longer needed, simply delete 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.