- patch -d $name-$version -p1 -i $SRC/$name-$version-nocheck-fixincludes.patch
- sed -i 's|REVISION|REVISION " (CRUX)"|' $name-$version/$name/version.c
-
- cd $name-$version
- # apply a sed substitutio that will suppress the installation of libiberty.a
- sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
- # avoid hardcodeds
- sed 's|@have_mktemp_command@|yes|' -i gcc/gccbug.in
-
- mkdir $SRC/build
- cd $SRC/build
-
- LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
- ../$name-$version/configure --build=$CHOST \
- --host=$CTARGET \
- --target=$CTARGET \
- --prefix=/usr \
- --libexecdir=/usr/lib \
- --enable-languages=c,c++ \
- --enable-threads=posix \
- --enable-shared \
- --enable-__cxa_atexit \
- --enable-clocale=gnu \
- --disable-nls \
- --disable-libstdcxx-pch \
- --with-x=no
-
- # prevent GCC from looking in the wrong directories for headers and libraries
- sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" -i Makefile
-
- make
- make -j1 DESTDIR=$PKG install
-
- mkdir $PKG/lib
- ln -sf ../usr/bin/cpp $PKG/lib/cpp
- ln -sf gcc $PKG/usr/bin/cc
- ln -sf g++ $PKG/usr/bin/c++
- mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
- rm -rf $PKG/usr/info $PKG/usr/lib/libiberty.a \
- $PKG/usr/bin/*-linux-gnu-* \
- $PKG/usr/lib/gcc/*/$version/install-tools \
- $PKG/usr/lib/gcc/*/$version/include/README \
- $PKG/usr/lib/gcc/*/$version/include-fixed
-
- sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
-}
+ cd $name-$version
+
+# patch -p1 -i $SRC/$name-$version-gnueabihf.patch
+ patch -p1 -i $SRC/$name-nocheck-fixincludes.patch
+ sed -i 's|REVISION|REVISION " (CRUX-ARM)"|' $name/version.c
+ # apply a sed substitution that will suppress the installation of libiberty.a
+ sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
+
+ mkdir $SRC/build
+ cd $SRC/build
+
+ export CXXFLAGS="-O2 -pipe"
+ LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
+ ../$name-$version/configure --build=$CHOST \
+ --host=$CTARGET \
+ --target=$CTARGET \
+ --prefix=/usr \
+ --mandir=/usr/man \
+ --libexecdir=/usr/lib \
+ --enable-languages=c,c++ \
+ --disable-libstdcxx-pch \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-clocale=gnu \
+ --enable-shared \
+ --with-float=hard \
+ --disable-nls \
+ --with-x=no \
+ --with-system-zlib \
+ --with-pkgversion="CRUX-ARM"
+
+ # prevent GCC from looking in the wrong directories for headers and libraries
+ sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" -i Makefile
+
+ make