CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
gcc: update to 4.5.2
[crossrootfs.git] / gcc / Pkgfile
CommitLineData
6dca1d21
JB
1# Description: The GNU Compiler Collection
2# URL: http://gcc.gnu.org
3# Maintainer: CRUX System Team, core-ports at crux dot nu
b751b192 4# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
6dca1d21
JB
5# Depends on: libgmp libmpfr
6
7name=gcc
2d0bfa97 8version=4.5.2
6dca1d21 9release=1
90f92569 10source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-{core,g++}-$version.tar.bz2
2d0bfa97 11 $name-nocheck-fixincludes.patch)
6dca1d21
JB
12
13
14build() {
90f92569
JB
15 cd $name-$version
16
17 patch -p1 -i $SRC/$name-nocheck-fixincludes.patch
90f92569
JB
18 sed -i 's|REVISION|REVISION " (CRUX)"|' $name/version.c
19 # apply a sed substitutio that will suppress the installation of libiberty.a
20 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
21 # avoid hardcodeds
22 sed 's|@have_mktemp_command@|yes|' -i gcc/gccbug.in
23
24 mkdir $SRC/build
25 cd $SRC/build
26
27 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
28 ../$name-$version/configure --build=$CHOST \
29 --host=$CTARGET \
30 --target=$CTARGET \
31 --prefix=/usr \
2d0bfa97 32 --mandir=/usr/man \
90f92569
JB
33 --libexecdir=/usr/lib \
34 --enable-languages=c,c++ \
2d0bfa97 35 --disable-libstdcxx-pch \
90f92569 36 --enable-threads=posix \
90f92569
JB
37 --enable-__cxa_atexit \
38 --enable-clocale=gnu \
2d0bfa97 39 --enable-shared \
90f92569 40 --disable-nls \
2d0bfa97
VM
41 --with-x=no \
42 --with-system-zlib \
43 --with-pkgversion="CRUX"
90f92569
JB
44
45 # prevent GCC from looking in the wrong directories for headers and libraries
46 sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" -i Makefile
47
48 make
49 make DESTDIR=$PKG install
50
51 mkdir $PKG/lib
52 ln -sf ../usr/bin/cpp $PKG/lib/cpp
53 ln -sf gcc $PKG/usr/bin/cc
54 ln -sf g++ $PKG/usr/bin/c++
2d0bfa97 55
90f92569 56 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
2d0bfa97
VM
57
58 rm $PKG/usr/lib/libstdc++.so.6.0.14-gdb.py
59 rm -r $PKG/usr/share
60 rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
90f92569
JB
61
62 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
6dca1d21 63}