export CTARGET=mipsel-linux-uclibc
export ARCH=mips
rm -rf build
mkdir build
cd build
../binutils-2.17/configure \
--target=$CTARGET \
--prefix=/usr/local/$ARCH/ \
--with-sysroot=/usr/local/$ARCH/$CTARGET \
--disable-werror
make
make install
# It installs things we don't want (and will fail later)
rm -rf /usr/local/$ARCH/{info,lib,man,share}
export PATH=/usr/local/$ARCH/bin:$PATH
cd ../linux-2.6.15.7
yes "" | make ARCH=$ARCH oldconfig prepare
#With 2.6.x, this will probably end in an error because you don't have a gcc
#cross-compiler yet, but you can ignore that. Just copy over the headers:
mkdir -p /usr/local/$ARCH/$CTARGET/usr/include/
rsync -arv include/linux include/asm-generic /usr/local/$ARCH/$CTARGET/usr/include/
rsync -arv include/asm-$ARCH/ /usr/local/$ARCH/$CTARGET/usr/include/asm
cd ../uClibc-0.9.28.3/
make menuconfig
#Target Architecture: mips
#Target Architecture Features and Options:
# Target Process Architecture: MIPS I
# Target Process Endianness: Little Endian
# Target CPU has a memory management unit (MMU): YES
# Enable floating point number support: YES
# Target CPU has a floating point unit: NO
# (/usr/local/mips/mipsel-linux-uclibc/usr) Linux kernel header location
#
#Library Installation Options
# (/usr/local/mips/mipsel-linux-uclibc) uClibc runtime library directory
# (/usr/local/mips/mipsel-linux-uclibc/usr) uClibc development environment
#
#uClibc development/debugging options
# (mipsel-linux-uclibc-) Cross-compiling toolchain prefix
# This command should fail.
make CROSS=mipsel-linux-uclibc-
# Copy the new include files
rsync -arvL include/ /usr/local/$ARCH/$CTARGET/sys-include
cd ../build/
rm -rf *
../gcc-4.0.4/configure \
--target=$CTARGET \
--prefix=/usr/local/mips \
--with-sysroot=/usr/local/mips/$CTARGET \
--enable-languages=c \
--disable-shared \
--disable-checking \
--disable-werror \
--disable-__cxa_atexit \
--enable-target-optspace \
--disable-nls \
--enable-multilib \
--with-float=soft \
--enable-sjlj-exceptions \
--disable-threads
make
make install
#rm -rf /usr/local/$ARCH/$CTARGET/sys-include
cd ../uClibc-0.9.28.3/
make CROSS=mipsel-linux-uclibc-
make install
rm -rf *
../gcc-4.0.4/configure \
--target=$CTARGET \
--prefix=/usr/local/mips \
--with-sysroot=/usr/local/mips/$CTARGET \
--enable-languages=c \
--enable-shared \
--disable-checking \
--disable-werror \
--disable-__cxa_atexit \
--enable-target-optspace \
--disable-nls \
--enable-multilib \
--with-float=soft \
--enable-sjlj-exceptions \
--enable-threads=posix
make
make install
# it SHOULD be --enable-languages=c,c++ but that fails for me everytime.