if [ $ARCH = i386 -o \
$ARCH = i486 -o \
$ARCH = i586 -o \
$ARCH = i686 ]; then
# Build for an x86 glibc2-based Linux system:
CFLAGS="$SLKCFLAGS" \
/configure \
--prefix=/usr \
--enable-shared \
--enable-targets=$ARCH-slackware-linux,$ARCH-slackware-linux-gnulibc1,$ARCH-slackware-linux-gnuaout \
--enable-64-bit-bfd \
$ARCH-slackware-linux
else # make no assumptions
CFLAGS="$SLKCFLAGS" \
/configure \
--prefix=/usr \
--enable-shared \
--enable-64-bit-bfd \
$ARCH-slackware-linux
fi
make clean
make -j3
make info
# Needed to link ksymoops:
make install
# We need to clear ldscripts/ because binutils doesn't implement DESTDIR everywhere:
rm -rf /usr/lib/ldscripts /usr/${ARCH}-slackware-linux/lib/ldscripts
# Repopulate it:
make install
# Install into the $PKG location:
make install DESTDIR=$PKG
# Add fresh ldscripts:
cp -a /usr/${ARCH}-slackware-linux/lib/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 $CWD/release.binutils-* $PKG/usr/doc/binutils-$VERSION
cp -a COPYING* ChangeLog.linux MAI* README* $PKG/usr/doc/binutils-$VERSION
# 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/${ARCH}-slackware-linux/lib
( cd $PKG/usr/${ARCH}-slackware-linux/lib ; rm -rf ldscripts ; ln -sf /usr/lib/ldscripts . )
mkdir -p $PKG/usr/${ARCH}-slackware-linux/bin
( cd $PKG/usr/${ARCH}-slackware-linux/bin
for file in * ; do
if [ -r "/usr/bin/$file" ]; then
rm $file
ln -sf /usr/bin/$file .
fi
done
)
# Docs adjustment:
( cd $PKG/usr/man/man1
rm -f dlltool.1 windres.1
for file in addr2line.1 ar.1 as.1 c++filt.1 gprof.1 ld.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings-GNU.1 strip.1 ; do
gzip -9 --force $file
done
)
# By adding ksymoops to the binutils package, we can use the dynamic
# libbfd and make the binary about 500K smaller.