CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
libcap: updated to 2.25-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
747a910d 5# Depends on: zlib libmpc
6dca1d21
JB
6
7name=gcc
1f4a96bf 8version=7.3.0
6c5365d2 9release=1
1f4a96bf 10source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/$name-$version.tar.xz
a795003d 11 $name-nocheck-fixincludes.patch)
6dca1d21
JB
12
13
14build() {
90f92569 15 cd $name-$version
cd1d0db8 16
cd1d0db8 17 patch -p1 -i $SRC/$name-nocheck-fixincludes.patch
3af34845 18 sed -i 's|REVISION|REVISION " (CRUX-ARM)"|' $name/version.c
ecd7d154 19 # apply a sed substitution that will suppress the installation of libiberty.a
90f92569 20 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
90f92569
JB
21
22 mkdir $SRC/build
23 cd $SRC/build
24
ecd7d154 25 export CXXFLAGS="-O2 -pipe"
90f92569 26 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
9be8a544
VM
27 ../$name-$version/configure --build=$CHOST \
28 --host=$CTARGET \
29 --target=$CTARGET \
90f92569 30 --prefix=/usr \
2d0bfa97 31 --mandir=/usr/man \
90f92569
JB
32 --libexecdir=/usr/lib \
33 --enable-languages=c,c++ \
2d0bfa97 34 --disable-libstdcxx-pch \
90f92569 35 --enable-threads=posix \
90f92569
JB
36 --enable-__cxa_atexit \
37 --enable-clocale=gnu \
2d0bfa97 38 --enable-shared \
d4c11352 39 --with-float=hard \
90f92569 40 --disable-nls \
2d0bfa97
VM
41 --with-x=no \
42 --with-system-zlib \
60f5b73f 43 --with-pkgversion="CRUX-ARM"
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
ecd7d154 48 make
6c5365d2
VM
49
50 # prevent libtool from adding host lib paths for relink at install
51 # based on patch submitted by Vincent Cadet for libtool bug #21455
52 # see https://lists.gnu.org/archive/html/bug-libtool/2015-09/msg00012.html
53 for lt_file in $(find $SRC/build/$CTARGET -name libtool) ; do
54 sed -i 's/\(add_dir=\"\)\$add_dir \(-L\$inst_prefix_dir\$libdir\"\)/\1\2/' $lt_file
55 done
56
ecd7d154 57 make -j1 DESTDIR=$PKG install
90f92569
JB
58
59 mkdir $PKG/lib
60 ln -sf ../usr/bin/cpp $PKG/lib/cpp
61 ln -sf gcc $PKG/usr/bin/cc
62 ln -sf g++ $PKG/usr/bin/c++
2d0bfa97 63
90f92569 64 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
2d0bfa97 65
1f4a96bf 66 rm $PKG/usr/lib/libstdc++.so.6.0.24-gdb.py
2d0bfa97
VM
67 rm -r $PKG/usr/share
68 rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
90f92569
JB
69
70 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
6dca1d21 71}