2006-11-21 22:03:23 +11:00
|
|
|
# URL: http://gcc.gnu.org/fortran
|
|
|
|
# Description: Fortran (f95) add-on for GNU GCC compiler.
|
2008-03-26 13:45:31 +11:00
|
|
|
# Maintainer: Danny Rawlins, monster dot romster at gmail dot com
|
2006-11-21 22:03:23 +11:00
|
|
|
# Packager: acrux, acrux at linuxmail dot org
|
2007-04-01 18:46:25 +10:00
|
|
|
# Depends on: mpfr
|
2006-11-21 22:03:23 +11:00
|
|
|
|
|
|
|
name=gcc-fortran
|
2008-03-23 02:10:19 +11:00
|
|
|
version=4.2.3
|
2008-05-08 22:10:05 +10:00
|
|
|
release=2
|
2006-11-21 22:03:23 +11:00
|
|
|
source=(ftp://sources.redhat.com/pub/gcc/releases/gcc-$version/gcc-{core,fortran}-$version.tar.bz2 \
|
2007-03-31 10:04:40 +10:00
|
|
|
gcc-fortran-$version-nocheck-fixincludes.patch \
|
|
|
|
gcc-fortran-$version-fixinc.patch)
|
2006-11-21 22:03:23 +11:00
|
|
|
|
|
|
|
build() {
|
2008-03-23 02:10:19 +11:00
|
|
|
patch -d gcc-$version -p 1 -i $SRC/gcc-fortran-$version-nocheck-fixincludes.patch
|
|
|
|
patch -d gcc-$version -p 1 -i $SRC/gcc-fortran-$version-fixinc.patch
|
2007-03-31 10:04:40 +10:00
|
|
|
|
2008-03-23 02:10:19 +11:00
|
|
|
sed -i gcc-$version/gcc/version.c \
|
|
|
|
-e 's|VERSUFFIX ""|VERSUFFIX " (CRUX)"|'
|
2007-03-31 10:04:40 +10:00
|
|
|
|
2006-11-21 22:03:23 +11:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
|
2007-03-31 10:04:40 +10:00
|
|
|
../gcc-$version/configure \
|
2006-11-21 22:03:23 +11:00
|
|
|
--prefix=/usr \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--enable-languages=f95 \
|
|
|
|
--enable-threads=posix \
|
|
|
|
--enable-__cxa_atexit \
|
|
|
|
--enable-clocale=gnu \
|
|
|
|
--enable-shared \
|
|
|
|
--disable-nls \
|
|
|
|
--with-x=no
|
|
|
|
|
2007-03-31 10:04:40 +10:00
|
|
|
make bootstrap
|
|
|
|
make check
|
2008-03-23 02:10:19 +11:00
|
|
|
make -j 1 DESTDIR=$PKG install
|
2006-11-21 22:03:23 +11:00
|
|
|
|
2007-03-31 10:04:40 +10:00
|
|
|
ln -fs gfortran $PKG/usr/bin/f90
|
|
|
|
ln -fs gfortran $PKG/usr/bin/f95
|
2006-11-21 22:03:23 +11:00
|
|
|
|
|
|
|
# remove un-needed files
|
2007-03-31 10:04:40 +10:00
|
|
|
find $PKG -name 'README' -delete
|
2006-11-21 22:03:23 +11:00
|
|
|
|
|
|
|
rm \
|
|
|
|
$PKG/usr/lib/libiberty.a \
|
2007-02-15 16:00:38 +11:00
|
|
|
$PKG/usr/bin/*-linux-gnu-* \
|
|
|
|
$PKG/usr/man/man1/{cpp,gcc,gcov}.1
|
2006-11-21 22:03:23 +11:00
|
|
|
|
|
|
|
rm -r \
|
|
|
|
$PKG/usr/info \
|
2007-02-15 16:00:38 +11:00
|
|
|
$PKG/usr/man/man7 \
|
|
|
|
$PKG/usr/lib/gcc/*/$version/install-tools \
|
|
|
|
$PKG/usr/lib/gcc/*/$version/include
|
2006-11-21 22:03:23 +11:00
|
|
|
|
|
|
|
# remove files already on the system out of the port
|
2008-01-04 19:21:30 +11:00
|
|
|
for i in $(pkginfo -l gcc |sed -e "s|^|/|"); do
|
|
|
|
if [ -e "$i" ] && [ ! -d "$i" ]; then
|
|
|
|
if [ -e "$PKG$i" ]; then
|
|
|
|
rm "$PKG$i"
|
|
|
|
fi
|
2006-11-21 22:03:23 +11:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Remove empty directories
|
|
|
|
find $PKG -depth -empty -exec rm -r {} \;
|
|
|
|
|
2007-02-15 16:00:38 +11:00
|
|
|
# remove build paths from *.la files
|
2006-11-21 22:03:23 +11:00
|
|
|
for i in `find $PKG -name '*.la' | sed -e "s|$PKG|/|"`; do
|
|
|
|
sed -i "s|-L$SRC[^ ]* ||g" $PKG/$i
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|