#!/bin/sh CWD=`pwd` TMP=/tmp PKG=$TMP/package-binutils VERSION=2.19 ARCH=alpha BUILD=1 TARGET=$ARCH-alphaslack-linux rm -rf $PKG mkdir -p $PKG/usr ( cd $TMP rm -rf binutils-$VERSION tar xjf $CWD/binutils-$VERSION.tar.bz2 cd binutils-$VERSION chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; # Build for a standard glibc2-based Linux system: ./configure \ --prefix=/usr \ --infodir=/usr/info \ --mandir=/usr/man \ --enable-shared \ --enable-64-bit-bfd \ --without-included-gettext \ --enable-targets=$TARGET \ --build=$TARGET make -s || exit 1 # Install into the $PKG location: make install DESTDIR=$PKG || exit 1 # Add fresh ldscripts: mkdir -p $PKG/usr/$TARGET/lib cp -a ld/ldscripts $PKG/usr/lib # Missing? cp -a gas/doc/as.1 $PKG/usr/man/man1 # "make install" skips this, but binutils.spec doesn't. Sneaky, huh? cp -a include/libiberty.h $PKG/usr/include/libiberty.h mkdir -p $PKG/usr/doc/binutils-$VERSION cp -a COPYING* README* $PKG/usr/doc/binutils-$VERSION ( cd $PKG/usr/bin ; mv strings strings-GNU ) # Add slack-desc: mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Now we must remember to adjust ldscripts (real dir is /usr/lib/ldscripts/, # links go in /usr/*-linux/lib/ ), and the bin links: mkdir -p $PKG/usr/$TARGET/lib ( cd $PKG/usr/$TARGET/lib ; rm -rf ldscripts ; ln -sf /usr/lib/ldscripts . ) mkdir -p $PKG/usr/$TARGET/bin ( cd $PKG/usr/$TARGET/bin for file in * ; do if [ -r "/usr/bin/$file" ]; then rm $file ln -sf /usr/bin/$file . fi done ) gzip -9 $PKG/usr/man/man1/* $PKG/usr/info/*.info rm -rf $PKG/usr/info/dir ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded ) chown -R root.bin $PKG/usr/bin cd $PKG makepkg -l y -c n $TMP/binutils-$VERSION-$ARCH-$BUILD.tgz ) 2>&1 | tee $TMP/binutils.build.log