Tarball compilation and installation and upgrade-make and patch

Source: Internet
Author: User
Tarball compilation, installation, and upgrade-make, pattern, and concept: the original code is compiled into an executable program of a binary mechanism. make and the detection program usually generate the makefile of the compilation connection file together with config, then, makefile is compiled into an executable file. The Tarball is actually the tar of the original code... tarball compilation and installation and upgrade-make and patch 1. concept: compile the source code into an executable program of a binary mechanism. make and the detection program generate the makefile of the compilation connection file together with config, then, makefile is compiled into an executable file. Tarball is actually a tar package and compressed package of the original code. Rpm refers to the packages that are compiled and released by linux merchants for a long time, but different types of systems cannot be used. The function library www.2cto.com provides external calls, a bit like a dll. 2. gcc is the C statement compiler. it is usually compiled into the target file first and then linked into an executable file. 3. make can be easily compiled because it writes the commands and sequences to be compiled to the makefile file. Www.2cto.com 4. put the makefile file in the first-level Directory of the program's original code. Its syntax: [root @ www ~] # Vi makefileLIBS =-lm # This is the variable OBJS = main. o haha. o sin_value.o cos_value.oCFLAGS =-Wallmain :$ {OBJS} gcc-o $ {OBJS }$ {LIBS} <== That $ @ is main! $ @ Indicates the current target clean: rm-f main $ {OBJS} # Mark: The source code file with relevance # tab at the beginning of the second line, this line is the executed command, such as script command 5. the specific directory rules are as follows: a. It is best to extract the original tarball data to/usr/local/src; B. during installation, it is best to install the software in the default path of/usr/local. c. consider future anti-installation steps. it is best to install each software separately under/usr/local; d. Add man path search to the man page of the software installed in a separate directory: if the software you installed is stored in/usr/local/software/, the man page search settings are as follows, it may have to be in/etc/man. 40 ~ in config ~ At about 50 rows, write the following line: MANPATH/usr/local/software/man to query the online files of the software ??? /Div> 6. detect the configuration program. /configure -- help, you can view the support parameters and descriptions of the general parameters are installed to which Directory parameters: -- prefix =/path 7, General steps (using ntp as an example ): cd/usr/local/src tar-zxvf/root/ntp-4.2.4p7.tar.gz cd ntp-4.2.4p7/cat INSTALL. /configure -- help | more. /configure -- prefix =/usr/local/ntpmake clean; makemake check # if this step is not detected, make install 8 and update the original code: a, cat ~ /Main_0.20.to_0.2.patch # Check the relative directory B of the first line and update it with the patch-p number <patch_file. the number here indicates that the old directory should be removed from several /, if not, use patch-p1 <patch_file, which must be determined by Step. For example, compare main-0.1/xxx with main-0.2/xxx, and you are now in the main-0.1 directory, so patch-p1 <.. /main_0.20.to_0.2.patch c. The update package is usually released. A patch is a suffix that indicates the version to which the patch is to be updated. if the patch cannot be upgraded across multiple versions, it must be upgraded in sequence. for example, if multiple update packages are used, update the previous update packages one by one. d and make clean; make check # if this step is not detected, make install. If an error is reported, you may need to execute it. /configure and patch only update the changed original code. E. what if the patch is incorrect? Our patch can be restored! Use patch-R <../main_0.20.to_0.2.patch. (Main_0.20.to_0.2.patch is just an example)
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.