#!/bin/bash # install glibc-2.0.7-20.src.rpm from SGI FTP and extra patches into SOURCEDIR BUILDROOT=/home/mfklar/src/tmp/build SOURCEDIR=/home/mfklar/build/mipsel-linux/src # This is the prefix for the HOST system, the one cross-build tools will run on # the user running this script must have write permissions to this dir (which # usually means being root if it's /usr or /usr/local) PREFIX=/usr/local # This is the prefix on the TARGET system, usually /usr TPREFIX=/usr # TARGET is mips-linux for big endian, mipsel-linux for little endian TARGET=mipsel-linux mkdir -p $BUILDROOT # Note: the '|| exit 1's just mean "abort on error", # otherwise the script will try to go on ... echo --- Building glibc for $TARGET --- cd $BUILDROOT gzip -dc $SOURCEDIR/glibc-2.0.7-980711.tar.gz | tar xf - || exit 1 cd glibc-2.0.7 gzip -dc $SOURCEDIR/glibc-crypt-2.0.6.tar.gz | tar xf - || exit 1 gzip -dc $SOURCEDIR/glibc-localedata-2.0.7pre3.tar.gz | tar xf - || exit 1 gzip -dc $SOURCEDIR/glibc-linuxthreads-2.0.7pre5.tar.gz | tar xf - || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-preload.patch || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-localedata.patch || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-misc.patch || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-tz.patch || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-gafton.patch || exit 1 # some chunks of this next patch do fail, just let them... patch -p1 -f < $SOURCEDIR/glibc-2.0.7-mips.patch patch -p1 < $SOURCEDIR/glibc-2.0.7-mips2.patch || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-mips-softfloat.patch || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-mips_from_2.0.6-5lm.patch || exit 1 patch -p1 < $SOURCEDIR/glibc-2.0.7-mips_clone.patch || exit 1 mkdir build cd build CC=$PREFIX/bin/$TARGET-gcc \ ../configure --prefix=$TPREFIX $TARGET \ --enable-add-ons=crypt,linuxthreads,localedata --enable-profile || exit 1 echo CC=$PREFIX/bin/$TARGET-gcc > configparms # For building soft-float userland, uncomment next line: # echo CFLAGS=-msoft-float >> configparms echo BUILD_CC=gcc >> configparms echo AR=$PREFIX/bin/$TARGET-ar >> configparms echo RANLIB=$PREFIX/bin/$TARGET-ranlib >> configparms make || exit 1 # This overrides first few lines of build/make.config to install to right place: make prefix=$PREFIX exec_prefix=$PREFIX/$TARGET slibdir=$PREFIX/$TARGET/lib \ sysconfdir=$PREFIX/etc rootsbindir=$PREFIX/$TARGET/sbin install || exit 1