Linux Software Management src source installation compile

Source: Internet
Author: User

In many cases we need to customize the features of the software, then we need to use the source code installation. So, there are many tools to compile the source code, then, how do we know what other people are using the tool it. In fact, I do not know (*^▽^*).

Then this blog is mainly to write C code source installation.

Don't say anything, just go ahead and summarize the four steps of the source installation:

The first step:./configure: "Of course, we must also unzip the source package before this step"
(1) Pass the parameter through the option, specify enable feature, install path, etc., refer to User's designation and makefile.in file generation makefile when executing
(2) Check the dependent external environment
Step Two: Make:
Build the application according to the makefile file;
Step Three: Make install

Fourth step: Post-installation configuration options

"In fact, the next two steps are simple, the focus is the first step and the fourth step"

The above is just a small sum up, then the concrete how to achieve, GG

1. How do we get the source package

Official self-built site:
Apache.org (ASF)
mariadb.org
...
Code hosting:
SourceForge
Github.com
Code.google.com

2, is a big problem, compile C source code

Premise: Provide development tools and development environment
Development tools: Make, GCC, etc.
Development environment: Development Library, header file
GLIBC: Standard Library

To provide development components through "package groups"
CentOS 6 primarily installs these two development package components: "Development Tools", "Server Platform development"

First Step: Configure script

We have to provide some parameters to the script: such as specifying the installation location, specifying the Enable feature, and so on, we can use the command:./configure--help to get the options it supports.

Option Categories:
Configuration:

Installation Directories: Installation path setting

--prefix=/path/to/somewhere: Specifies the default installation location; default is/usr/local/
--sysconfdir=/path/to/somewhere: Configuration file installation location;

System types: Target platform Architecture "NOTE: This option is only used when cross-compiling"

Optional Features: Optional

--disable-feature
--enable-feature[=arg]

Optional Packages: A dependent package that defines a dependency

--with-package[=arg]
--without-package

Some Influential environment variables: things that may affect environment variables

Step two: Execute the "make" command

Step three: Execute "make install"

Here we can enable, now to our installation path down to boot (because we have not configured the program)
Here's a quick start.
To our installation location, execute the start command: e.g../apachectl Start

Fourth step: Configuration options after successful installation:

(1) Export the binary program directory to the PATH environment variable, "If you do not export, we can only use absolute path to access him."
Edit configuration file:/etc/profile.d/name.sh Create a script file
Add an environment variable inside: Export path=/path/to/bin: $PATH

(2) Export Library file path
Edit/etc/ld.so.conf.d/name.conf Create a profile to add a new library file in the same directory as this file
To have the system regenerate the cache: command: ldconfig [-v]

(3) Export header file
Method One: Go to the installation directory and copy the include header file to the/usr/include directory
Method Two: Implement based on the link way
LN-SV source file Soft Connect file
(4) Export Help manual
Edit/etc/man. Config file, add a Manpath parameter inside and indicate the path.

Linux Software Management src source installation compile

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.