My Debian 7 armel embedded system currently has g++ 4.6, and I\'d like to upgrade to g++ 4.9 to use new C++11 features. How do I do that?
My current sources.list conten
Probably-required: packaging-dev
, ubuntu-dev-tools
(this lets you build a package in a chroot without polluting your system with build-dependency packages)
sudo pbuilder create
if you want to build for a specific distribution, (pbuilder uses the build system release in a chroot) you can use pbuilder-dist [precise/oneric/trusy/etc...] create
pull-debian-source gcc-4.9 [4.9.0-6]
specific debian revision is optional, but can be useful if you want to pull experimental/unstable/testing/stable revisions you can also pull from specific ubuntu distros by adding them to sources.list as a deb-src and using sudo apt-get src
sudo pbuilder build gcc-4.9_4.9.0-6.dsc
In the files downloaded there is a .dsc file, for the most recent gcc it is gcc-4.9_4.9.0-6.dsc which is a package descriptor file. .orig.tar.[gz/xz] is the source tarball.
mkdir /convenient/place/for/repo
cp /var/cache/pbuilder/result/* /path/to/repo
cd /path/to/repo
apt-ftp archive packages . > Packages
sudo echo "deb [trusted=yes] file:/local/repo/Packages ./" > /etc/apt/sources.list.d/gcc-repo.list`
Note you can also do this step with .debs downloaded from anywhere (skip step 1-3)
apt-get update; apt-get install gcc-4.9 g++-4.9