development/sdcc: Fix packaging conflict with binutils

Signed-off-by: Kyle Guinn <elyk03@gmail.com>
This commit is contained in:
Kyle Guinn 2017-08-19 12:03:49 -05:00 committed by Willy Sudiarto Raharjo
parent edaed3d07a
commit 227a6fd87d
1 changed files with 15 additions and 10 deletions

View File

@ -2,7 +2,7 @@
# Slackware build script for sdcc
# Copyright 2014-2016 Kyle Guinn <elyk03@gmail.com>, USA
# Copyright 2014-2017 Kyle Guinn <elyk03@gmail.com>, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -24,12 +24,12 @@
PRGNAM=sdcc
VERSION=${VERSION:-3.6.0}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$(uname -m)" in
i?86) ARCH=i486 ;;
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$(uname -m) ;;
esac
@ -37,7 +37,7 @@ fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
PKG=$TMP/package-$PRGNAM-$VERSION
OUTPUT=${OUTPUT:-/tmp}
DOCS="COPYING ChangeLog"
@ -45,6 +45,9 @@ DOCS="COPYING ChangeLog"
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
@ -67,6 +70,9 @@ cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go-w,a+rX-st .
# Don't clobber bfd.info from Slackware's binutils package.
sed -i 's/^\(INFO_DEPS =\).*/\1/' support/sdbinutils/bfd/doc/Makefile.in
# A few Makefiles install (copy) the source tree _after_ building, and
# accidentally install a bunch of build byproducts which they try to clean
# up afterwards. Delete some byproducts that they missed.
@ -88,8 +94,6 @@ fi
# Also unset $EARCH for good measure.
ARCH= \
EARCH= \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX}/$PRGNAM \
@ -98,10 +102,12 @@ CXXFLAGS="$SLKCFLAGS" \
--mandir=/usr/man \
--infodir=/usr/info \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux \
--enable-libgc \
$enable_doc \
$enable_pic
$enable_pic \
--build=$ARCH-slackware-linux \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
@ -109,8 +115,7 @@ make install DESTDIR=$PKG
find $PKG -exec file {} + | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*.info*
rmdir $PKG/usr/info
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION