Today, I saw an article with a shell script and a makefile that would automatically download all of the required packages and compile GCC:
| The code is as follows |
Copy Code |
$ # Download the scripts using wget. $ mkdir/opt/gcc-4.9.2 $ cd/opt/gcc-4.9.2 $ wget http://projects.joelinoff.com/gcc-4.9.2/bld.sh $ wget Http://projects.joelinoff.com/gcc-4.9.2/Makefile $ chmod a+x bld.sh $ make [Output SNIPPED] $ # The compiler is installed In/opt/gcc-4.9.2/rtf/bin |
I tried it, and it was very convenient indeed. As long as there is a computer can be connected to the network. Interested friends can give it a try.
P.s.:
(1) When compiling libiconv there may be "' gets ' undeclared here" error, please refer to this article.
(2) If the machine is 64-bit, but a 32-bit library file is missing. This will cause an error when compiling GCC: "configure:error:i suspect your system does not have 32-bit (developement and libraries). If you have them, rerun configure With–enable-multilib. If you don't have them, and want to build a 64-bit-only compiler, rerun configure. Prompts you to configure "--disable-multilib".