CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Revert "Revert gcc: Fixed build and removed not needed configure options"
[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
747a910d 5# Depends on: zlib libmpc
6dca1d21
JB
6
7name=gcc
317a7556 8version=4.6.1
6dca1d21 9release=1
90f92569 10source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-{core,g++}-$version.tar.bz2
317a7556 11 $name-$version-gnueabihf.patch)
6dca1d21
JB
12
13
14build() {
90f92569
JB
15 cd $name-$version
16
317a7556 17 patch -p1 -i $SRC/$name-$version-gnueabihf.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
90f92569
JB
21
22 mkdir $SRC/build
23 cd $SRC/build
24
25 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
9be8a544
VM
26 ../$name-$version/configure --build=$CHOST \
27 --host=$CTARGET \
28 --target=$CTARGET \
90f92569 29 --prefix=/usr \
2d0bfa97 30 --mandir=/usr/man \
90f92569
JB
31 --libexecdir=/usr/lib \
32 --enable-languages=c,c++ \
2d0bfa97 33 --disable-libstdcxx-pch \
90f92569 34 --enable-threads=posix \
90f92569
JB
35 --enable-__cxa_atexit \
36 --enable-clocale=gnu \
2d0bfa97 37 --enable-shared \
5782eb15 38 --with-float=hard \
90f92569 39 --disable-nls \
2d0bfa97
VM
40 --with-x=no \
41 --with-system-zlib \
42 --with-pkgversion="CRUX"
90f92569
JB
43
44 # prevent GCC from looking in the wrong directories for headers and libraries
45 sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" -i Makefile
46
47 make
48 make DESTDIR=$PKG install
49
50 mkdir $PKG/lib
51 ln -sf ../usr/bin/cpp $PKG/lib/cpp
52 ln -sf gcc $PKG/usr/bin/cc
53 ln -sf g++ $PKG/usr/bin/c++
2d0bfa97 54
90f92569 55 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
2d0bfa97 56
317a7556 57 rm $PKG/usr/lib/libstdc++.so.6.0.16-gdb.py
2d0bfa97
VM
58 rm -r $PKG/usr/share
59 rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
90f92569
JB
60
61 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
6dca1d21 62}