Added support for cross compiling packages on x86_64.
Two new options for the configuration file were added: * XBPS_CROSS_TARGET * XBPS_CROSS_DIR XBPS_CROSS_TARGET should be set to the target triplet that you build with the mktoolchain script. XBPS_CROSS_DIR should point to the cross directory that mktoolchain created if you've built one. As proof of concept the glibc32 package has been added for x86_64, and it works perfectly even in the chroot! with glibc32 in place that means that I can build a gcc multilib and use -m32 to build 32bit packages! OH YEAH I LOVE THAT SHIT!!!! --HG-- extra : convert_revision : 6b0008865e084674a1c4b58266f681871e519c66
This commit is contained in:
parent
1ae9019da2
commit
d15b7887e7
5 changed files with 174 additions and 4 deletions
80
templates/glibc32.tmpl
Normal file
80
templates/glibc32.tmpl
Normal file
|
@ -0,0 +1,80 @@
|
|||
# Template file for 'glibc32'
|
||||
pkgname=glibc32
|
||||
version=2.8
|
||||
wrksrc="libc"
|
||||
distfiles="ftp://ftp.archlinux.org/other/glibc/glibc-2.8_20080828.tar.bz2"
|
||||
build_style=gnu_configure
|
||||
configure_script="../configure"
|
||||
configure_env="BUILD_CC=$XBPS_CROSS_TARGET-gcc"
|
||||
configure_args="--with-tls -disable-profile --with-__thread
|
||||
--enable-kernel=2.6.16 --enable-add-ons --without-gd --enable-bind-now
|
||||
--without-cvs --without-selinux --prefix=/usr --libdir=/usr/lib32
|
||||
--with-headers=/usr/include --cache-file=config.cache
|
||||
--infodir=/usr/share/info"
|
||||
make_install_target="install_root=$XBPS_DESTDIR/$pkgname-$version install"
|
||||
short_desc="The GNU C library (32 bits)"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
checksum=f5756668f201e093cae0404e59dcf8c43ccc07757fd0a7455298ed89126c366a
|
||||
long_desc="
|
||||
The GNU C Library is the standard system C library for all GNU systems,
|
||||
and is an important part of what makes up a GNU system. It provides the
|
||||
system API for all programs written in C and C-compatible languages such
|
||||
as C++ and Objective C; the runtime facilities of other programming
|
||||
languages use the C library to access the underlying operating system.
|
||||
|
||||
This version is only for 64 bits systems."
|
||||
|
||||
cross_compiler=yes
|
||||
base_package=yes
|
||||
build_depends="perl-5.10.0"
|
||||
|
||||
pre_configure()
|
||||
{
|
||||
# We must configure it in another directory.
|
||||
mkdir -p $wrksrc/build_obj && cd $wrksrc/build_obj
|
||||
wrksrc=$wrksrc/build_obj
|
||||
echo "slibdir=/lib32" > $wrksrc/configparms
|
||||
echo "CFLAGS+=-march=${XBPS_CROSS_TARGET%%-*} -mtune=generic" \
|
||||
>> $wrksrc/configparms
|
||||
echo "libc_cv_forced_unwind=yes" > config.cache
|
||||
echo "libc_cv_c_cleanup=yes" >> config.cache
|
||||
}
|
||||
|
||||
pre_install()
|
||||
{
|
||||
# Pre-create /lib32 and /usr/lib32 directories.
|
||||
for f in lib32 usr/lib32; do
|
||||
[ ! -d $XBPS_MASTERDIR/$f ] && mkdir -p $XBPS_MASTERDIR/$f
|
||||
done
|
||||
}
|
||||
|
||||
post_install()
|
||||
{
|
||||
local destdir=$XBPS_DESTDIR/$pkgname-$version
|
||||
local tmpdir=$XBPS_BUILDDIR/$pkgname-tmp
|
||||
|
||||
mkdir -p $tmpdir/usr/include/gnu
|
||||
mkdir -p $tmpdir/usr/include/sys
|
||||
|
||||
# Remove all headers except the ones required for 32bits stuff.
|
||||
mv -v $destdir/include/gnu/stubs-32.h $tmpdir/usr/include/gnu
|
||||
mv -v $destdir/include/sys/elf.h $tmpdir/usr/include/sys
|
||||
mv -v $destdir/include/sys/vm86.h $tmpdir/usr/include/sys
|
||||
|
||||
rm -rf $destdir/include
|
||||
mkdir -p $destdir/usr/include
|
||||
mv -v $tmpdir/usr/include/* $destdir/usr/include
|
||||
|
||||
# Remove bins and unneeded stuff for compat32.
|
||||
[ -d $destdir/xbps_destdir ] && rm -rf $destdir/xbps_destdir
|
||||
rm -rf $destdir/sbin $destdir/bin $destdir/usr/sbin $destdir/usr/bin
|
||||
rm -rf $destdir/share $destdir/libexec $destdir/etc
|
||||
mv -v $destdir/lib/gconv $destdir/usr/lib32
|
||||
|
||||
# Remove wrong symlinks in shared libs and move them to /lib32.
|
||||
find $destdir/lib -type l -print|xargs rm -v
|
||||
mv -v $destdir/lib/* $destdir/lib32
|
||||
cd $destdir/lib && ln -s ../lib32/ld-linux.so.2 ld-linux.so.2
|
||||
|
||||
rm -rf $tmpdir
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue