Skip to content

Instantly share code, notes, and snippets.

@weldpua2008
Last active January 15, 2017 08:18
Show Gist options
  • Save weldpua2008/381a45d83b45cbec25cb3148b5682fbf to your computer and use it in GitHub Desktop.
Save weldpua2008/381a45d83b45cbec25cb3148b5682fbf to your computer and use it in GitHub Desktop.
How to build utils for toolchain (binutils, cmake)
#binutils 2.22
dpkg-source -x binutils_2.22-6ubuntu1.3.dsc
cd binutils-2.22/
./configure --prefix=/opt/tools/dev-tools-4.9 \
--exec-prefix=/opt/tools/dev-tools-4.9 \
--with-sysroot=/ --enable-multilib \
--with-lib-path=/opt/tools/dev-tools-4.9/lib \
--disable-werror --enable-shared \
--enable-targets=x86_64-linux-gnu,i686-linux-gnu,x86_64-pc-mingw32,i686-pc-mingw32
#binutils 2.25.1
dpkg-source -x binutils_2.2*.dsc
mkdir binutils-build&&cd binutils-build
../binutils-2.25.1/configure --prefix=/opt/tools/dev-tools-4.9 \
--enable-initfini-array \
--enable-deterministic-archives \
--exec-prefix=/opt/tools/dev-tools-4.9 \
--with-sysroot=/ --enable-multilib \
--with-lib-path=/opt/tools/dev-tools-4.9/lib --with-lib-path=/opt/tools/dev-tools-4.9/lib\
--disable-werror --enable-shared --with-strip\
--with-pkgversion="GNU Binutils for Ubuntu" \
--enable-targets=x86_64-linux-gnu,x86_64-pep,x86_64-linux-gnux32,i686-linux-gnu,x86_64-pc-mingw32,i686-pc-mingw32
make -j 8 && make install
#binutils
dpkg-source -x binutils_2.22-6ubuntu1.3.dsc
mkdir objdir&& cd objdir
../binutils-2.22/configure --prefix=/opt/tools/dev-tools-4.9 \
--exec-prefix=/opt/tools/dev-tools-4.9 \
--with-sysroot=/ --enable-multilib \
--with-lib-path=/opt/tools/dev-tools-4.9/lib \
--disable-werror --enable-shared \
--enable-targets=x86_64-linux-gnu,i686-linux-gnu,x86_64-pc-mingw32,i686-pc-mingw32
make -j 8 && make install
###
/cd ~/toolchain_src/ubuntu_binutils/objdir
cd /root/toolchain_src/ubuntu_binutils/binutils-build
cd /root/toolchain_src/gcc-4.9-4.9.2/objdir
###
./configure --prefix=/opt/tools/dev-tools-4.9 \
--exec-prefix=/opt/tools/dev-tools-4.9 \
--with-sysroot=/ --enable-multilib \
--with-lib-path=/opt/tools/dev-tools-4.9/lib \
--disable-werror --enable-shared \
--enable-targets=x86_64-linux-gnu,i686-linux-gnu,x86_64-pc-mingw32,i686-pc-mingw32
# CMAKE
wget http://www.libarchive.org/downloads/libarchive-3.2.0.tar.gz
tar xzvf libarchive-3.2.0.tar.gz
./configure --prefix=/opt/tools/dev-tools-4.9 --disable-static && \
make -j $(nproc || grep -c ^processor /proc/cpuinfo|| echo "1") && \
make install
# tar xzvf cmake-3*
wget --no-check-certificate https://cmake.org/files/v2.8/cmake-2.8.11.tar.gz
tar xzvf cmake-2.8.11.tar.gz
./bootstrap --prefix=/opt/tools/dev-tools-4.9 \
--no-system-libs --qt-gui && \
make -j $(nproc || grep -c ^processor /proc/cpuinfo|| echo "1") && \
make install
# boost
wget --no-check-certificate http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.bz2/download -O boost_1_57_0.tar.bz2
tar xjvf boost_1_57_0.tar.bz2
./bootstrap.sh --prefix=/opt/tools/dev-tools-4.9 && \
./b2 stage threading=multi link=shared && \
./b2 install threading=multi link=shared
wget http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar xzvf make-3.81.tar.gz && cd make* && \
./configure --prefix=/opt/tools/dev-tools-4.9 && \
make && \
make install && \
cd /opt/tools/dev-tools-4.9/bin/ && \
ln -s make gmake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment