wok rev 9704

gcc: make it build with cookutils and let tazwok use its functions
author Christophe Lincoln <pankso@slitaz.org>
date Sun May 08 20:03:09 2011 +0200 (2011-05-08)
parents 13e77a27a5bd
children c882f9ebda9c
files gcc/receipt
line diff
     1.1 --- a/gcc/receipt	Sun May 08 16:39:31 2011 +0200
     1.2 +++ b/gcc/receipt	Sun May 08 20:03:09 2011 +0200
     1.3 @@ -5,12 +5,17 @@
     1.4  CATEGORY="development"
     1.5  SHORT_DESC="The the GNU Compiler Collection."
     1.6  MAINTAINER="pankso@slitaz.org"
     1.7 -DEPENDS="libgomp gcc-lib-base mpc-library elfutils"
     1.8 -BUILD_DEPENDS="elfutils mpc-library"
     1.9  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.10  WEB_SITE="http://gcc.gnu.org/"
    1.11  WGET_URL="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$VERSION/$TARBALL"
    1.12  
    1.13 +# We need gawk since busybox awk is not sufficient. We have BUILD_DEPENDS
    1.14 +# for cookutils that are not used by tazwok/cook-toolchain since it install
    1.15 +# and use it's own copy.
    1.16 +DEPENDS="libgomp gcc-lib-base mpc-library elfutils"
    1.17 +BUILD_DEPENDS="elfutils mpc-library mpfr mpfr-dev gmp gmp-dev elfutils \
    1.18 +elfutils-dev gawk"
    1.19 +
    1.20  # Rules to compile & install the temporary toolchain.
    1.21  precook_tmp_toolchain()
    1.22  {
    1.23 @@ -50,7 +55,7 @@
    1.24  {
    1.25  	report open-bloc
    1.26  	cd $src
    1.27 -	patch -Np1 -i $stuff/gcc-$VERSION-startfiles_fix-1.patch || { report close-bloc; return 1; }
    1.28 +	patch -Np1 -i ../stuff/gcc-$VERSION-startfiles_fix-1.patch || { report close-bloc; return 1; }
    1.29  
    1.30  	# Details about theses lines are in LFS book.
    1.31  	sed 's@\./fixinc\.sh@-c true@' -i gcc/Makefile.in
    1.32 @@ -86,6 +91,8 @@
    1.33  
    1.34  	{ CC="$BUILD_HOST-gcc -B/tools/lib/" \
    1.35  		AR=$BUILD_HOST-ar RANLIB=$BUILD_HOST-ranlib \
    1.36 +		# --disable-bootstrap dont exist ???
    1.37 +		# See: ./configure --help | grep bootstrap
    1.38  		$src/configure \
    1.39  		--with-local-prefix=/tools --enable-clocale=gnu \
    1.40  		--enable-shared --enable-threads=posix \
    1.41 @@ -104,17 +111,38 @@
    1.42  # Rules to configure and make the package.
    1.43  compile_rules()
    1.44  {
    1.45 +	cd $src
    1.46 +	
    1.47 +	# Package slitaz-toolchain use 'cook --options' when rebuilding
    1.48 +	# the full SliTaz toolchain. 
    1.49 +	[ "$3" == "--first-pass" ] && opt=$3
    1.50 +	
    1.51  	# Use libiberty.a from binutils.
    1.52  	sed -i 's/install_to_$(INSTALL_DEST) //' \
    1.53 -		$PACKAGE-$VERSION/libiberty/Makefile.in || return 1
    1.54 -	mkdir -p gcc-build && cd gcc-build
    1.55 -	$src/configure --enable-nls \
    1.56 -	--enable-languages=c,c++,objc,fortran --enable-shared --with-system-zlib \
    1.57 -	--enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit \
    1.58 -	--enable-lto --disable-bootstrap --libexecdir=/usr/lib \
    1.59 -	--enable-threads=posix --with-tune=$ARCH $BUILD_HOST &&
    1.60 -	make &&
    1.61 -	make install
    1.62 +		libiberty/Makefile.in || return 1
    1.63 +	mkdir -p ../gcc-build && cd ../gcc-build
    1.64 +	
    1.65 +	case "$opt" in
    1.66 +		--first-pass)
    1.67 +			# Used by slitaz-toolchain when rebuilding the full toolchain.
    1.68 +			echo "cook: configure GCC for: toolchain first pass"
    1.69 +			$src/configure --libexecdir=/usr/lib \
    1.70 +				--disable-nls --enable-shared \
    1.71 +				--enable-languages=c --disable-multilib \
    1.72 +				--disable-libstdcxx-pch --enable-threads=posix &&
    1.73 +				make && make install ;;
    1.74 +		*)
    1.75 +			# Used by default to produce a full featured GCC compiler.
    1.76 +			echo "cook: configure GCC for: final/full build"
    1.77 +			$src/configure --libexecdir=/usr/lib --enable-nls \
    1.78 +				--enable-languages=c,c++,objc,fortran \
    1.79 +				--enable-shared --with-system-zlib \
    1.80 +				--enable-clocale=gnu --enable-objc-gc \
    1.81 +				--enable-__cxa_atexit --enable-lto \
    1.82 +				--enable-threads=posix \
    1.83 +				--with-tune=$ARCH $BUILD_HOST &&
    1.84 +				make && make install ;;
    1.85 +	esac
    1.86  }
    1.87  
    1.88  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.89 @@ -122,14 +150,17 @@
    1.90  {
    1.91  	mkdir -p  $fs/usr/share
    1.92  	cp -a $_pkg/usr/bin $fs/usr
    1.93 -	# Copy all libs. Remove libgcc_s.so and libstdc++.so
    1.94 -	# they goes in gcc-lib-base-$VERSION package.
    1.95 +	
    1.96 +	# Copy all libs. Remove libgcc_s.so and libstdc++.so they goes in
    1.97 +	# the gcc-lib-base-$VERSION package.
    1.98  	cp -a $_pkg/usr/lib $fs/usr
    1.99  	rm $fs/usr/lib/libgcc_s.so*
   1.100  	rm $fs/usr/lib/libstdc++.so*
   1.101  	rm $fs/usr/lib/libgomp.so*
   1.102 +	
   1.103  	# Include files.
   1.104  	cp -a $_pkg/usr/include $fs/usr
   1.105 +	
   1.106  	# Gfortran goes in gfortran-$VERSION package.
   1.107  	rm -f $fs/usr/bin/*gfortran
   1.108  	rm -f $fs/usr/lib/libgfortran*
   1.109 @@ -143,13 +174,13 @@
   1.110  # Post install commands for Tazpkg.
   1.111  post_install()
   1.112  {
   1.113 -  local root
   1.114 -  root=$1
   1.115 -  echo "Processing post-install commands..."
   1.116 -  if [ ! -f "$root/lib/cpp" ]; then
   1.117 -  	ln -s ../usr/bin/cpp $root/lib
   1.118 -  fi
   1.119 -  if [ ! -f "$root/usr/bin/cc" ]; then
   1.120 -  	ln -s gcc $root/usr/bin/cc
   1.121 -  fi
   1.122 +	local root
   1.123 +	root=$1
   1.124 +	echo "Processing post-install commands..."
   1.125 +	if [ ! -f "$root/lib/cpp" ]; then
   1.126 +		ln -s ../usr/bin/cpp $root/lib
   1.127 +	fi
   1.128 +	if [ ! -f "$root/usr/bin/cc" ]; then
   1.129 +		ln -s gcc $root/usr/bin/cc
   1.130 +	fi
   1.131  }