#!/bin/sh CWD=`pwd` TMP=/tmp PKG=$TMP/package-binutils VERSION=2.17.50.0.9 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: LDFLAGS=-s \ ./configure \ --prefix=/usr \ --enable-shared \ --enable-64-bit-bfd \ --without-included-gettext \ --enable-targets=$TARGET \ $TARGET || exit make -j2 || exit # Needed to link ksymoops: #make install || exit # We need to clear ldscripts/ because binutils doesn't implement DESTDIR everywhere: #rm -rf /usr/lib/ldscripts /usr/$TARGET/lib/ldscripts # Repopulate it: #make install || exit # Install into the $PKG location: make install DESTDIR=$PKG || exit # 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* ChangeLog.linux MAI* 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