wok-4.x view gcc+gcj/receipt @ rev 5941

gcc: enable lto
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Aug 02 17:01:27 2010 +0200 (2010-08-02)
parents a041e4f77d18
children b51da6965de2
line source
1 # SliTaz package receipt.
3 PACKAGE="gcc+gcj"
4 SOURCE="gcc"
5 VERSION="4.5.1"
6 CATEGORY="development"
7 SHORT_DESC="The GNU Compiler Collection, including the gcj Compiler for Java."
8 MAINTAINER="rcx@zoominternet.net"
9 DEPENDS="glibc-base glib gcc-lib-base libgio util-linux-ng-uuid zlib libgomp gmp mpfr python \
10 gtk+ atk cairo expat fontconfig freetype pango pixman libpng libxcb xcb-util \
11 xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
12 xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
13 xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXtst alsa-lib"
14 BUILD_DEPENDS="glibc-dev gawk flex python perl gmp gmp-dev mpfr mpfr-dev mpc-library \
15 expat-dev zlib-dev fastjar gtk+-dev libart_lgpl-dev xorg-dev xorg-inputproto \
16 xorg-kbproto xorg-libXtst xorg-randrproto xorg-renderproto xorg-xextproto xorg-xproto"
17 TARBALL="$SOURCE-$VERSION.tar.bz2"
18 WEB_SITE="http://gcc.gnu.org/java/"
19 WGET_URL="$GNU_MIRROR/$SOURCE/$SOURCE-$VERSION/$TARBALL"
20 PROVIDE="$SOURCE jre jdk"
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 # Set BUILD_HOST if not defined in tazwok.conf as it should be
26 if [ -z "$BUILD_HOST" ] ; then
27 BUILD_HOST="i486-pc-linux-gnu"
28 fi
29 GCC_TARGET=$BUILD_HOST
31 # Get ecj.jar needed to build gcj
32 # (See http://gcc.gnu.org/install/configure.html --with-ecj-jar)
33 ECJ_PRE_PATH=`pwd`
34 ECJ_JAR="ecj-latest.jar"
35 ECJ_URL="ftp://sourceware.org/pub/java/$ECJ_JAR"
36 if [ ! -f "$SOURCES_REPOSITORY/$ECJ_JAR" ] ; then
37 cd $SOURCES_REPOSITORY
38 download $ECJ_URL
39 # Exit if download failed to avoid errors.
40 if [ ! -f "$SOURCES_REPOSITORY/$ECJ_JAR" ] ; then
41 echo -e "\nECJ jar download failed, exiting. Please check ECJ_URL variable.\n"
42 exit 1
43 fi
44 else
45 echo -n "ECJ jar exit... "
46 status
47 fi
49 # Copy the ecj jar to the root of the gcc source directory
50 # The file name isn't versioned, so we have to remove it from the
51 # sources repository to ensure that we receive updated files
52 mv -f $SOURCES_REPOSITORY/$ECJ_JAR $src/ecj.jar
54 # Pop back to the pre-download directory
55 cd $ECJ_PRE_PATH
57 # Use libiberty.a from binutils.
58 sed -i 's/install_to_$(INSTALL_DEST) //' \
59 $SOURCE-$VERSION/libiberty/Makefile.in || exit 1
60 mkdir -p $SOURCE-$VERSION-build
61 cd $SOURCE-$VERSION-build
63 ../$SOURCE-$VERSION/configure --prefix=/usr --libexecdir=/usr/lib \
64 --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls \
65 --enable-languages=c,c++,java --enable-shared --with-system-zlib \
66 --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit \
67 --enable-threads=posix --with-tune=i486 \
68 --enable-java-home --with-arch-directory=i386 \
69 --with-jvm-root-dir=/usr/lib/jvm/java-gcj \
70 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-gcj \
71 --with-python-dir=/lib/python2.5/site-packages \
72 --with-x --enable-java-awt=gtk \
73 --enable-gtk-cairo \
74 --enable-lto \
75 $CONFIGURE_ARGS $GCC_TARGET &&
76 make -j 4 bootstrap &&
77 # Make install in the source tree to help creating derived pkgs
78 # and keep $_pkg variable set for genpkg.
79 make -j 4 DESTDIR=$src/_pkg install
80 }
82 # Rules to gen a SliTaz package suitable for Tazpkg.
83 genpkg_rules()
84 {
85 mkdir -p $fs/usr/share
86 cp -a $_pkg/usr/share/java $fs/usr/share
87 cp -a $_pkg/usr/bin $fs/usr
88 # Copy all libs. Remove libgcc_s.so and libstdc++.so
89 # they goes in gcc-lib-base-$VERSION package.
90 cp -a $_pkg/usr/lib $fs/usr
91 rm $fs/usr/lib/libgcc_s.so*
92 rm $fs/usr/lib/libstdc++.so*
93 rm $fs/usr/lib/libgomp.so*
94 # Include files.
95 cp -a $_pkg/usr/include $fs/usr
96 }
98 # Post install commands for Tazpkg.
99 post_install()
100 {
101 local root
102 root=$1
103 echo "Processing post-install commands..."
104 if [ ! -f "$root/lib/cpp" ] ; then
105 ln -s ../usr/bin/cpp $root/lib
106 fi
107 if [ ! -f "$root/usr/bin/cc" ] ; then
108 ln -s gcc $root/usr/bin/cc
109 fi
110 }
112 # Rules to clean the package
113 clean_wok()
114 {
115 rm -r $SOURCE-$VERSION-build
116 }
118 TAZBB_NO_INSTALL="because it does not support objc and gfortran (yet)"