wok-current view gcc+gcj/receipt @ rev 3758

Update: gcc+gcj (added package check)
author Matthew Sheets <rcx@zoominternet.net>
date Fri Jul 24 10:58:22 2009 +0000 (2009-07-24)
parents e81980da2c9e
children 7fe791e8b986
line source
1 # SliTaz package receipt.
3 PACKAGE="gcc+gcj"
4 SOURCE="gcc"
5 VERSION="4.4.0"
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 libuuid 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"
14 BUILD_DEPENDS="glibc-dev gawk flex python perl gmp gmp-dev mpfr mpfr-dev \
15 expat-dev zlib-dev zip unzip 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/"
19 WGET_URL="$GNU_MIRROR/$SOURCE/$SOURCE-$VERSION/$TARBALL"
20 PROVIDE="$SOURCE"
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 # NOTE: gcj/libjava doesn't seem to build successfully when fastjar is installed
26 if [ -n "$(tazpkg list | grep '^fastjar\>')" ] ; then
27 echo "ERROR: Package 'fastjar' must be removed before compiling $PACKAGE"
28 exit 1
29 fi
31 # Set BUILD_HOST if not defined in tazwok.conf as it should be
32 if [ -z "$BUILD_HOST" ] ; then
33 BUILD_HOST="i486-pc-linux-gnu"
34 fi
35 GCC_TARGET=$BUILD_HOST
37 # Get ecj.jar needed to build gcj
38 # (See http://gcc.gnu.org/install/configure.html --with-ecj-jar)
39 ECJ_PRE_PATH=`pwd`
40 ECJ_JAR="ecj-latest.jar"
41 ECJ_URL="ftp://sourceware.org/pub/java/$ECJ_JAR"
42 if [ ! -f "$SOURCES_REPOSITORY/$ECJ_JAR" ] ; then
43 cd $SOURCES_REPOSITORY
44 download $ECJ_URL
45 # Exit if download failed to avoid errors.
46 if [ ! -f "$SOURCES_REPOSITORY/$ECJ_JAR" ] ; then
47 echo -e "\nECJ jar download failed, exiting. Please check ECJ_URL variable.\n"
48 exit 1
49 fi
50 else
51 echo -n "ECJ jar exit... "
52 status
53 fi
55 # Copy the ecj jar to the root of the gcc source directory
56 # The file name isn't versioned, so we have to remove it from the
57 # sources repository to ensure that we receive updated files
58 mv -f $SOURCES_REPOSITORY/$ECJ_JAR $src/ecj.jar
60 # Pop back to the pre-download directory
61 cd $ECJ_PRE_PATH
63 # Use libiberty.a from binutils.
64 sed -i 's/install_to_$(INSTALL_DEST) //' \
65 $SOURCE-$VERSION/libiberty/Makefile.in || exit 1
66 mkdir -p $SOURCE-$VERSION-build
67 cd $SOURCE-$VERSION-build
69 ../$SOURCE-$VERSION/configure --prefix=/usr --libexecdir=/usr/lib \
70 --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls \
71 --enable-languages=c,c++,java --enable-shared --with-system-zlib \
72 --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit \
73 --enable-threads=posix --with-tune=i486 \
74 --enable-java-home --with-arch-directory=i386 \
75 --with-jvm-root-dir=/usr/lib/jvm/java-gcj \
76 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-gcj \
77 --with-python-dir=/lib/python2.5/site-packages \
78 --with-x --enable-java-awt=gtk \
79 --enable-gtk-cairo \
80 $CONFIGURE_ARGS $GCC_TARGET &&
81 make bootstrap &&
82 # Make install in the source tree to help creating derived pkgs
83 # and keep $_pkg variable set for genpkg.
84 make DESTDIR=$src/_pkg install
85 }
87 # Rules to gen a SliTaz package suitable for Tazpkg.
88 genpkg_rules()
89 {
90 mkdir -p $fs/usr/share
91 cp -a $_pkg/usr/share/java $fs/usr/share
92 cp -a $_pkg/usr/bin $fs/usr
93 # Copy all libs. Remove libgcc_s.so and libstdc++.so
94 # they goes in gcc-lib-base-$VERSION package.
95 cp -a $_pkg/usr/lib $fs/usr
96 rm $fs/usr/lib/libgcc_s.so*
97 rm $fs/usr/lib/libstdc++.so*
98 rm $fs/usr/lib/libgomp.so*
99 # Include files.
100 cp -a $_pkg/usr/include $fs/usr
101 }
103 # Post install commands for Tazpkg.
104 post_install()
105 {
106 local root
107 root=$1
108 echo "Processing post-install commands..."
109 if [ ! -f "$root/lib/cpp" ] ; then
110 ln -s ../usr/bin/cpp $root/lib
111 fi
112 if [ ! -f "$root/usr/bin/cc" ] ; then
113 ln -s gcc $root/usr/bin/cc
114 fi
115 }
117 # Rules to clean the package
118 clean_wok()
119 {
120 rm -r $SOURCE-$VERSION-build
121 }