When you use Linux, you have to hear the term "compile from source" sooner or later. You will be very scared when you hear him, but when you understand what he is, how do he work, you will feel too simple. Maybe you will ask yourself to have a installation package management system like RPM and APT, why should we use the original code? Although these tasks make things simple, they still have some shortcomings in using them. First, you must rely on people who do installation packages. This means that if the software has a new version, you can't get him if you don't upgrade the installation package. But you can always get the latest version of the program original code. The installation package always retains the greatest versatility. Some options have need to use, and some people don't need it. This means that if some feature you want is not compiled into the installation package or you want to install something that is very compliant with your system, then the original code is your unique choice. Compiling as a procedure from the original code We need some tools. Some publishers called them to develop packages. At least we need the Make program, the compiler (usually GCC), some related class libraries and other basic procedures. If you encounter some problems, then the error message tells you something missing. After you solve those problems, you need to delete a file called config.cache, which displays will find your changes.
Now we have already prepared for installing a small program. The first thing we have to do will download the original code. In this article, the program we want to install is called ZGBasic. Suppose I have put that the original code of the downloaded code is put on the directory: / usr / local / src (here the original code name here is Zgbasic.Tar.gz). After downloading, you will then do the following: ==== ========================= Tar zxf zgbasic.tar.gzcd zxf zgbasic./configuremakemake test (optional) Make install ======= ======================
The first line command will decompress the file downloaded (Untar) download. The next command is converted to the corresponding directory. Most standard installation packages are used ./configure and make also have make install to install. In most cases you can find the structure of the installation package in the ReadMe or Install file. By running ./configure command You can do two basic things: 1 is to let the program detect all the files he want to install and their location, 2 is tell the procedure that you want to add. The options can be more, you want to know that those options can run the following command: ============================ ./configure --help | Less ============================ can let you see the options you can use. Once the assembler is running, and you check without any mistakes, you can run make. This step is actually compiling the original code as the program. By the original code with you and your machine, this process may perform a few seconds, or it may be a few hours. Make Test is optional, but he is a good practice opportunity. He can detect if all things are normal, whether the operation is reasonable. Here we must notice that all steps can be done by a non-root user. But the final step is to need root privileges. Only do your programs can run like other installations that are installed on your system. Because the last step is true to the file Copy to our system. If you still need to build this program from the new, you need to make a make clean before compiling, he will delete those files generated by your previous compiler, and return a Tree to delete the file.
And the previous tutorial is obviously the Perl program. From the original code (also available using the CPAN) Installing the Perl program We need to do it below ===================================== Tar zxf zgbasic- Perl.tar.gzcd zgbasic-perlperl makefile.plmakemake test (optional) Make install ============================
You will find that most steps are the same, and there are only ./configure and perl makefile.pl.
If you encounter some problems when you are from the original code installer, then the error message will tell you that you are lost, and how he failed. If you still don't understand, you can contact me, QQ: 26798 7618279