CRUX-ARM : Home

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