2008-10-21 01:09:29 +00:00
|
|
|
# Template file for 'binutils'
|
|
|
|
pkgname=binutils
|
2013-05-10 07:35:57 +00:00
|
|
|
version=2.23.52.0.2
|
2013-10-23 08:33:46 +00:00
|
|
|
revision=4
|
2008-10-21 01:09:29 +00:00
|
|
|
short_desc="GNU binary utilities"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2011-07-11 21:14:09 +00:00
|
|
|
homepage="http://www.gnu.org/software/binutils/"
|
|
|
|
license="GPL-3"
|
2012-06-12 08:44:04 +00:00
|
|
|
distfiles="${KERNEL_SITE}/devel/binutils/$pkgname-$version.tar.xz"
|
2013-05-10 07:35:57 +00:00
|
|
|
checksum=c2229d5d4067c782b67cfaf7f049acd8361407c0870991bc5430be5c548f6825
|
2013-02-24 12:32:26 +00:00
|
|
|
|
2013-10-23 08:33:46 +00:00
|
|
|
bootstrap=yes
|
|
|
|
|
|
|
|
if [ "$CHROOT_READY" ]; then
|
|
|
|
hostmakedepends="flex perl"
|
|
|
|
fi
|
|
|
|
|
|
|
|
makedepends="zlib-devel"
|
|
|
|
|
2013-04-12 06:55:23 +00:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
|
|
makedepends+=" libfl-devel"
|
|
|
|
fi
|
|
|
|
|
2013-10-23 08:33:46 +00:00
|
|
|
pre_configure() {
|
|
|
|
# Drop bashism!
|
|
|
|
sed -e 's,source,\.,g' -i ld/scripttempl/elf.sc
|
|
|
|
}
|
|
|
|
|
2011-11-22 09:59:32 +00:00
|
|
|
do_configure() {
|
2013-03-24 09:21:58 +00:00
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
|
2013-02-24 12:32:26 +00:00
|
|
|
CONFIGFLAG="--enable-64-bit-bfd --enable-multilib"
|
|
|
|
fi
|
2013-05-26 04:16:52 +00:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
2013-05-26 08:41:55 +00:00
|
|
|
# Do not use configure_args nor build_style=gnu-configure,
|
2013-05-26 04:16:52 +00:00
|
|
|
# avoiding --with-sysroot to $XBPS_CROSS_BASE.
|
|
|
|
CONFIGFLAG="--host=$XBPS_CROSS_TRIPLET --with-build-sysroot=$XBPS_CROSS_BASE"
|
|
|
|
fi
|
|
|
|
./configure --prefix=/usr --enable-threads \
|
2013-02-24 12:32:26 +00:00
|
|
|
--enable-plugins --enable-secureplt --with-mmap \
|
2013-05-10 07:41:32 +00:00
|
|
|
--enable-shared --disable-bootstrap $CONFIGFLAG
|
2011-11-22 09:59:32 +00:00
|
|
|
}
|
2011-07-11 21:14:54 +00:00
|
|
|
|
2011-11-22 09:59:32 +00:00
|
|
|
do_build() {
|
2011-07-11 21:14:09 +00:00
|
|
|
make ${makejobs}
|
2013-05-26 08:41:55 +00:00
|
|
|
|
2012-06-12 08:44:04 +00:00
|
|
|
# Rebuild libiberty.a with -fPIC
|
|
|
|
cp -a libiberty libiberty-pic
|
|
|
|
make -C libiberty-pic clean
|
|
|
|
make CFLAGS="$CFLAGS -fPIC" -C libiberty-pic
|
|
|
|
|
|
|
|
# Rebuild libbfd.a with -fPIC
|
|
|
|
# hidden visability prevent 3rd party shared libraries exporting bfd non-stable API
|
|
|
|
cp -a bfd bfd-pic
|
|
|
|
make -C bfd-pic clean
|
|
|
|
make CFLAGS="$CFLAGS -fPIC -fvisibility=hidden" -C bfd-pic
|
|
|
|
|
|
|
|
# Rebuild libopcodes.a with -fPIC
|
|
|
|
cp -a opcodes opcodes-pic
|
|
|
|
make -C opcodes-pic clean
|
|
|
|
make CFLAGS="$CFLAGS -fPIC" -C opcodes-pic
|
2011-07-11 21:14:09 +00:00
|
|
|
}
|
|
|
|
|
2011-11-22 09:59:32 +00:00
|
|
|
do_install() {
|
2013-03-24 09:21:58 +00:00
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
|
2013-05-10 07:35:57 +00:00
|
|
|
mkdir -p ${DESTDIR}/usr/lib
|
|
|
|
cd ${DESTDIR}/usr
|
|
|
|
ln -s lib lib64
|
|
|
|
cd ${wrksrc}
|
2009-10-18 10:28:15 +00:00
|
|
|
fi
|
2011-07-11 21:14:09 +00:00
|
|
|
make DESTDIR=${DESTDIR} tooldir=/usr install
|
|
|
|
|
2013-02-24 12:32:26 +00:00
|
|
|
# Remove ld.bfd (hardlink) and make a symlink.
|
|
|
|
rm -f ${DESTDIR}/usr/bin/ld.bfd
|
|
|
|
ln -sfr ${DESTDIR}/usr/bin/ld ${DESTDIR}/usr/bin/ld.bfd
|
|
|
|
|
2012-06-12 08:44:04 +00:00
|
|
|
# Add some useful headers
|
|
|
|
install -m644 include/libiberty.h ${DESTDIR}/usr/include
|
|
|
|
install -m644 include/demangle.h ${DESTDIR}/usr/include
|
|
|
|
|
|
|
|
# install libraries rebuilt with -fPIC
|
|
|
|
install -m644 libiberty-pic/libiberty.a ${DESTDIR}/usr/lib
|
|
|
|
install -m644 bfd-pic/libbfd.a ${DESTDIR}/usr/lib
|
|
|
|
install -m644 opcodes-pic/libopcodes.a ${DESTDIR}/usr/lib
|
|
|
|
|
|
|
|
# Remove these symlinks, they are not ABI stable.
|
|
|
|
# Programs should compile static to the .a file.
|
|
|
|
rm -f ${DESTDIR}/usr/lib/lib{bfd,opcodes}.so
|
|
|
|
echo "INPUT ( /usr/lib/libbfd.a -liberty -lz )" \
|
|
|
|
>${DESTDIR}/usr/lib/libbfd.so
|
|
|
|
echo "INPUT ( /usr/lib/libopcodes.a -lbfd )" \
|
|
|
|
>${DESTDIR}/usr/lib/libopcodes.so
|
|
|
|
|
2009-10-18 06:11:54 +00:00
|
|
|
# Remove info file that conflicts with autoconf.
|
|
|
|
rm -f ${DESTDIR}/usr/share/info/standards.info
|
2010-01-27 01:16:31 +00:00
|
|
|
rm -f ${DESTDIR}/usr/lib64
|
2010-05-20 23:14:19 +00:00
|
|
|
|
2011-07-11 21:14:09 +00:00
|
|
|
# Remove useless manpages.
|
|
|
|
for f in dlltool nlmconv windres windmc; do
|
|
|
|
rm -f ${DESTDIR}/usr/share/man/man1/${f}.1
|
|
|
|
done
|
|
|
|
|
2010-05-20 23:14:19 +00:00
|
|
|
# Fix for multilib builds.
|
|
|
|
if [ -d ${DESTDIR}/usr/lib32 ]; then
|
2011-07-11 21:14:09 +00:00
|
|
|
mv ${DESTDIR}/usr/lib32/* ${DESTDIR}/usr/lib
|
2010-05-20 23:14:19 +00:00
|
|
|
rmdir ${DESTDIR}/usr/lib32
|
|
|
|
fi
|
2009-10-18 06:11:54 +00:00
|
|
|
}
|
2013-04-12 06:55:23 +00:00
|
|
|
|
|
|
|
binutils-devel_package() {
|
|
|
|
depends="binutils>=$version"
|
2013-05-10 07:35:57 +00:00
|
|
|
short_desc+=" - development files"
|
2013-04-12 06:55:23 +00:00
|
|
|
pkg_install() {
|
|
|
|
vmove usr/include
|
|
|
|
vmove "usr/lib/*.a"
|
|
|
|
vmove usr/lib/libbfd.so
|
|
|
|
vmove usr/lib/libopcodes.so
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
binutils_package() {
|
|
|
|
pkg_install() {
|
2013-10-23 08:33:46 +00:00
|
|
|
vmove all
|
2013-04-12 06:55:23 +00:00
|
|
|
}
|
|
|
|
}
|