cookutils rev 654

cross: cross libtool may help :-)
author Christophe Lincoln <pankso@slitaz.org>
date Wed Mar 05 01:19:09 2014 +0100 (2014-03-05)
parents b357bbf78c7b
children 599eac7431b6
files cross data/cross-arm.conf data/cross-armv6hf.conf data/cross-armv7.conf data/cross-x86_64.conf
line diff
     1.1 --- a/cross	Wed Mar 05 00:24:19 2014 +0100
     1.2 +++ b/cross	Wed Mar 05 01:19:09 2014 +0100
     1.3 @@ -16,6 +16,7 @@
     1.4  tools=$WORK/tools
     1.5  sysroot=$WORK/sysroot
     1.6  logdir=$WORK/log
     1.7 +mirror_url="http://mirror.slitaz.org/packages/cross/"
     1.8  
     1.9  # Cross-tools tarballs
    1.10  binutils_tarball="binutils-$BINUTILS_VERSION.tar.bz2"
    1.11 @@ -23,6 +24,7 @@
    1.12  glibc_tarball="glibc-$GLIBC_VERSION.tar.bz2"
    1.13  eglibc_tarball="eglibc-$EGLIBC_VERSION.tar.bz2"
    1.14  gcc_tarball="gcc-$GCC_VERSION.tar.bz2"
    1.15 +libtool_tarball="libtool-$LIBTOOL_VERSION.tar.gz"
    1.16  
    1.17  # Cross-tools URLs
    1.18  binutils_wget="http://ftp.gnu.org/gnu/binutils/$binutils_tarball"
    1.19 @@ -30,6 +32,7 @@
    1.20  glibc_wget="http://ftp.gnu.org/gnu/libc/$glibc_tarball"
    1.21  eglibc_wget="svn://svn.eglibc.org/branches/eglibc-2_13"
    1.22  gcc_wget="http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/$gcc_tarball"
    1.23 +libtool_wget="ftp://sunsite.cnlab-switch.ch/mirror/gnu/libtool/$libtool_tarball"
    1.24  
    1.25  # Help and usage.
    1.26  usage() {
    1.27 @@ -41,15 +44,17 @@
    1.28    howto           Man[like] page and howto
    1.29    info            Display cross-tools info
    1.30    testsuite       Execute a small testsuite
    1.31 -  setup [arch]    Setup build host environment
    1.32 +  [arch]-setup    Setup build host environment
    1.33    download        Download necessary sources
    1.34 -  show-log        Show a compile log
    1.35 +  show-log        Show a package compile log
    1.36    binutils        Compile Binutils
    1.37    linux-headers   Install Kernel headers
    1.38    gcc-static      Compile GCC static
    1.39 -  glibc           Compile GNU Glibc
    1.40 +  glibc           Compile GNU Glibc library
    1.41 +  eglibc          Compile EGlibc libc library
    1.42    gcc-final       Compile final GCC
    1.43    compile         Compile everything at once
    1.44 +  libtool         Cross GNU Libtool (test in receipt LIBTOOL=)
    1.45    clean           Clean-up build environment
    1.46    clean-tools     Clean: $tools
    1.47    gen-prebuilt    Create a prebuilt toolchain archive
    1.48 @@ -108,6 +113,7 @@
    1.49  	[ -f "$linux_tarball" ] || wget $linux_wget
    1.50  	[ -f "$glibc_tarball" ] || wget $glibc_wget
    1.51  	[ -f "$gcc_tarball" ] || wget $gcc_wget
    1.52 +	[ -f "$libtool_tarball" ] || wget $libtool_wget
    1.53  }
    1.54  
    1.55  # 1. Binutils
    1.56 @@ -348,6 +354,24 @@
    1.57  	echo "cross: GCC final compiled on: $(date)"
    1.58  }
    1.59  
    1.60 +# A cross libtool should avoid some shared libs path/format bugs
    1.61 +cross_libtool() {
    1.62 +	init_compile
    1.63 +	[ "$clean" ] && rm -rf libtool-${LIBTOOL_VERSION}
    1.64 +	if [ ! -d "libtool-$LIBTOOL_VERSION" ]; then
    1.65 +		echo "Extracting: $libtool_tarball"
    1.66 +		tar xzf $SRC/$libtool_tarball
    1.67 +	fi
    1.68 +	cd libtool-${LIBTOOL_VERSION}
    1.69 +	./configure \
    1.70 +		--prefix=$tools \
    1.71 +		--host=${TARGET} \
    1.72 +		--program-prefix=${TARGET}- &&
    1.73 +	make || exit 1
    1.74 +	make install
    1.75 +	echo "cross: Cross libtool compiled on: $(date)"
    1.76 +}
    1.77 +
    1.78  #
    1.79  # Commands
    1.80  #
    1.81 @@ -461,6 +485,8 @@
    1.82  		[ "$div" != 0 ] && min="~ ${div}m"
    1.83  		echo "Build time   : ${sec}s $min" | tee -a $logdir/compile.log
    1.84  		echo "" ;;
    1.85 +	libtool)
    1.86 +		cross_libtool 2>&1 | tee $logdir/libtool.log ;;
    1.87  	clean)
    1.88  		echo -n "Removing all source files..."
    1.89  		rm -rf $WORK/source && status
     2.1 --- a/data/cross-arm.conf	Wed Mar 05 00:24:19 2014 +0100
     2.2 +++ b/data/cross-arm.conf	Wed Mar 05 01:19:09 2014 +0100
     2.3 @@ -16,6 +16,7 @@
     2.4  GLIBC_VERSION="2.13"
     2.5  EGLIBC_VERSION="2.13"
     2.6  GCC_VERSION="4.6.3"
     2.7 +LIBTOOL_VERSION="2.4.2"
     2.8  
     2.9  # Per package configure arguments
    2.10  BINUTILS_ARGS="--enable-shared"
     3.1 --- a/data/cross-armv6hf.conf	Wed Mar 05 00:24:19 2014 +0100
     3.2 +++ b/data/cross-armv6hf.conf	Wed Mar 05 01:19:09 2014 +0100
     3.3 @@ -17,6 +17,7 @@
     3.4  GLIBC_VERSION="2.13"
     3.5  EGLIBC_VERSION="2.13"
     3.6  GCC_VERSION="4.6.3"
     3.7 +LIBTOOL_VERSION="2.4.2"
     3.8  
     3.9  # Per package configure arguments
    3.10  BINUTILS_ARGS="--enable-shared"
     4.1 --- a/data/cross-armv7.conf	Wed Mar 05 00:24:19 2014 +0100
     4.2 +++ b/data/cross-armv7.conf	Wed Mar 05 01:19:09 2014 +0100
     4.3 @@ -17,6 +17,7 @@
     4.4  GLIBC_VERSION="2.13"
     4.5  EGLIBC_VERSION="2.13"
     4.6  GCC_VERSION="4.6.3"
     4.7 +LIBTOOL_VERSION="2.4.2"
     4.8  
     4.9  # Per package configure arguments
    4.10  BINUTILS_ARGS="--enable-shared"
     5.1 --- a/data/cross-x86_64.conf	Wed Mar 05 00:24:19 2014 +0100
     5.2 +++ b/data/cross-x86_64.conf	Wed Mar 05 01:19:09 2014 +0100
     5.3 @@ -16,6 +16,7 @@
     5.4  LINUX_VERSION="3.2.14"
     5.5  GLIBC_VERSION="2.14.1"
     5.6  GCC_VERSION="4.6.3"
     5.7 +LIBTOOL_VERSION="2.4.2"
     5.8  
     5.9  # Per package configure arguments
    5.10  BINUTILS_ARGS="--disable-multilib --enable-64-bit-bfd"