Ubuntu10.10 build the cross compiler 2.95.3 Environment

Source: Internet
Author: User
1, sudoapt-getinstallncurses-dev2, sudoapt-getinstallbison3, sudoapt-getinstallflex4, sudoapt-getinstallbuild-essential5, modify gcc version, the default is 4.4.5, this version is too high, changed to 3.4.6 under

1. sudo apt-get install ncurses-dev

2. sudo apt-get install bison

3. sudo apt-get install flex

4. sudo apt-get install build-essential

5. Modify the gcc version. The default value is 4.4.5. This version is too high and changed to 3.4.6.

Download the deb installation package. The downloaded package is:

Gcc-3.4-base_3.4.6-6Ubuntu3_i386.deb,

Gcc-3.4_3.4.6-6ubuntu3_i386.deb,

Cpp-3.4_3.4.6-6ubuntu3_i386.deb,

G ++-3.4 _ 3.4.6-6ubuntu3_i386.deb,

Libstdc ++ 6-dev_3.4.6-6ubuntu3_i386.deb

For: http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/

6. Create a new directory and copy the deb package into it. My is/mnt/share/gcc-3.4.6.

Next, execute the following command in this directory:

Root@www.linuxidc.com:/mnt/share/gcc-3.4.6 # dpkg-I *. deb

Check the installation result as follows:

Root@www.linuxidc.com:/mnt/share/gcc-3.4.6 # ls/usr/bin/gcc *

/Usr/bin/gcc/usr/bin/gcc-3.4/usr/bin/gcc-4.4/usr/bin/gccbug-3.4


7. Added options for gcc3.4.6 and gcc4.4.5.

Root@www.linuxidc.com:/mnt/share/gcc-3.4.6 # update-alternatives -- install/usr/bin/gcc/usr/bin/gcc-4.4 40

 

Root@www.linuxidc.com:/mnt/share/gcc-3.4.6 # update-alternatives -- install/usr/bin/gcc/usr/bin/gcc-3.4 30

 

8. Switch version to gcc-3.4

Root@www.linuxidc.com:/mnt/share/gcc-3.4.6 # update-alternatives -- config gc

There are 2 choices for the alternative gcc (providing/usr/bin/gcc ).

Select the path priority status
------------------------------------------------------------
* 0/usr/bin/gcc-4.4 40 automatic mode
1/usr/bin/gcc-3.4 30 manual mode
2/usr/bin/gcc-4.4 40 manual mode

To maintain the current value [*], press the Enter key or enter the selected number: 1 (manually enter the default value to be selected, enter 1, and set the default value to version 3.4)

9. view the current gcc version

The root@www.linuxidc.com:/mnt/share/gcc-3.4.6 # gcc-v
Reading specs from/usr/lib/gcc/i486-linux-gnu/3.4.6/specs
Configured :.. /src/configure-v -- enable-ages = c, c ++, f77, pascal -- prefix =/usr -- libexecdir =/usr/lib -- with-gxx-include-dir =/usr/include/c ++/3.4 -- enable-shared -- with-system -zlib -- enable-nls -- without-receivded-gettext -- program-suffix =-3.4 -- enable-_ cxa_atexit -- enable-clocale = gnu -- enable-libstdcxx-debug --- tune = pentium4 i486-linux-gnu
Thread model: posix
Gcc version 3.4.6 (Ubuntu 3.4.6-6ubuntu3)

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.