CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
7cdd4a2b9f7b72375751a92ccd50d30a698814c5
[crossrootfs.git] / gcc / Pkgfile
1 # Description: The GNU Compiler Collection
2 # URL: http://gcc.gnu.org
3 # Maintainer: CRUX System Team, core-ports at crux dot nu
4 # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
5 # Depends on: zlib libmpc
6
7 name=gcc
8 version=4.7.3
9 release=1
10 source=(ftp://gcc.gnu.org/pub/gcc/releases/$name-$version/$name-$version.tar.bz2
11 $name-nocheck-fixincludes.patch $name-$version-gnueabihf.patch)
12
13
14 build() {
15 cd $name-$version
16
17 patch -p1 -i $SRC/$name-$version-gnueabihf.patch
18 patch -p1 -i $SRC/$name-nocheck-fixincludes.patch
19 sed -i 's|REVISION|REVISION " (CRUX-ARMHF)"|' $name/version.c
20 # apply a sed substitutio that will suppress the installation of libiberty.a
21 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
22
23 mkdir $SRC/build
24 cd $SRC/build
25
26 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
27 ../$name-$version/configure --build=$CHOST \
28 --host=$CTARGET \
29 --target=$CTARGET \
30 --prefix=/usr \
31 --mandir=/usr/man \
32 --libexecdir=/usr/lib \
33 --enable-languages=c,c++ \
34 --disable-libstdcxx-pch \
35 --enable-threads=posix \
36 --enable-__cxa_atexit \
37 --enable-clocale=gnu \
38 --enable-shared \
39 --with-float=hard \
40 --disable-nls \
41 --with-x=no \
42 --with-system-zlib \
43 --with-pkgversion="CRUX-ARMHF"
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++
55
56 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
57
58 rm $PKG/usr/lib/libstdc++.so.6.0.17-gdb.py
59 rm -r $PKG/usr/share
60 rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
61
62 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
63 }