Skip to content

Instantly share code, notes, and snippets.

@fgrep
Last active March 31, 2018 01:58
Show Gist options
  • Save fgrep/39279d81d135d1ce40de to your computer and use it in GitHub Desktop.
Save fgrep/39279d81d135d1ce40de to your computer and use it in GitHub Desktop.
Debian wheezy mips toolchain
# Debian 7 MIPS Toolchain
# http://cdimage.debian.org/cdimage/archive/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-CD-1.iso
# Basic install + SSH Server + Standard system utilities
# Update
mkdir /usr/src/mips-toolchain && cd /usr/src/mips-toolchain
apt-get update
apt-get upgrade
# Binutils
apt-get -y build-dep --no-install-recommends binutils
apt-get source binutils
pushd binutils-2.*/
DEB_TARGET_ARCH=mips TARGET=mips dpkg-buildpackage -b
popd
dpkg -i binutils-mips*.deb
# GCC
apt-get -y build-dep --no-install-recommends gcc-4.7
apt-get source gcc-4.7
pushd gcc-4.7-4.7.*/
DEB_TARGET_ARCH=mips DEB_CROSS_NO_BIARCH=yes with_deps_on_target_arch_pkgs=yes dpkg-buildpackage -d -T control
apt-get -y install --no-install-recommends xapt binutils-multiarch
xapt -a mips -m libc6-dev
DEB_TARGET_ARCH=mips DEB_CROSS_NO_BIARCH=yes with_deps_on_target_arch_pkgs=yes dpkg-buildpackage -b
popd
dpkg -i *.deb
ln -s /usr/bin/mips-linux-gnu-cpp-4.7 /usr/bin/mips-linux-gnu-cpp
ln -s /usr/bin/mips-linux-gnu-gcc-ar-4.7 /usr/bin/mips-linux-gnu-gcc-ar
ln -s /usr/bin/mips-linux-gnu-gcc-ranlib-4.7 /usr/bin/mips-linux-gnu-gcc-ranlib
ln -s /usr/bin/mips-linux-gnu-g++-4.7 /usr/bin/mips-linux-gnu-g++
ln -s /usr/bin/mips-linux-gnu-gccgo-4.7 /usr/bin/mips-linux-gnu-gccgo
ln -s /usr/bin/mips-linux-gnu-gcov-4.7 /usr/bin/mips-linux-gnu-gcov
ln -s /usr/bin/mips-linux-gnu-gcc-4.7 /usr/bin/mips-linux-gnu-gcc
ln -s /usr/bin/mips-linux-gnu-gcc-nm-4.7 /usr/bin/mips-linux-gnu-gcc-nm
ln -s /usr/bin/mips-linux-gnu-gfortran-4.7 /usr/bin/mips-linux-gnu-gfortran
# Compile accel-ppp for mips
apt-get -y install --no-install-recommends git cmake
xapt -a mips -m libssl-dev libpcre3-dev libnl-3-dev
cd /usr/src
git clone git://git.code.sf.net/p/accel-ppp/code accel-ppp
git clone https://github.com/fgrep/accel-ppp-edgemax.git accel-ppp-debian
mv accel-ppp-debian/debian accel-ppp/
rm -rf accel-ppp-debian
pushd accel-ppp
dpkg-buildpackage -amips -b -d
popd
ls -l accel-ppp_1.9-beta_mips.deb
@lucianomarav
Copy link

lucianomarav commented Jan 23, 2018

Configurando gcc-4.7-base-mips-cross (4.7.2-5) ...
Configurando libc-bin-mips-cross (2.13-38+deb7u10) ...
Configurando linux-libc-dev-mips-cross (3.2.78-1) ...
Configurando multiarch-support-mips-cross (2.13-38+deb7u10) ...
Configurando libc6-mips-cross (2.13-38+deb7u10) ...
Configurando libgcc1-mips-cross (1:4.7.2-5) ...
Configurando libpcre3-mips-cross (1:8.30-5) ...
Configurando libstdc++6-mips-cross (4.7.2-5) ...
Configurando libc-dev-bin-mips-cross (2.13-38+deb7u10) ...
Configurando libc6-dev-mips-cross (2.13-38+deb7u10) ...
Configurando libpcrecpp0-mips-cross (1:8.30-5) ...
Configurando libpcre3-dev-mips-cross (1:8.30-5) ...

dpkg-buildpackage -amips -b -d

Required libpcre not found.

Install libpcre3-dev and run cmake again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment