blob: 811276b96bcf183864c2fb101339f05469423b6a (
plain)
1 # URL: http://gcc.gnu.org/fortran
2 # Description: Fortran (f95) add-on for GNU GCC compiler.
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Depends on: libmpfr
5
6 name=gcc-fortran
7 version=12.2.0
8 release=1
9 source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.xz
10 gcc-nocheck-fixincludes.patch gcc-4.7.3-multilib-dirs.patch)
11
12 build() {
13 patch -d gcc-$version -p 1 -i $SRC/gcc-nocheck-fixincludes.patch
14 patch -d gcc-$version -p 1 -i $SRC/gcc-4.7.3-multilib-dirs.patch
15
16 # Do not run fixincludes
17 sed -i -e 's|\./fixinc\.sh|-c true|' gcc-$version/gcc/Makefile.in
18
19 install -d build
20 cd build
21
22 ../gcc-$version/configure \
23 --prefix=/usr \
24 --libexecdir=/usr/lib \
25 --enable-languages=fortran \
26 --enable-threads=posix \
27 --enable-__cxa_atexit \
28 --enable-clocale=gnu \
29 --enable-shared \
30 --disable-nls \
31 --with-x=no \
32 --with-system-zlib \
33 --enable-multilib \
34 --disable-sjlj-exceptions \
35 --with-pkgversion="CRUX-x86_64-multilib"
36
37 if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
38 make STAGE_CC_WRAPPER='/usr/bin/ccache' BOOT_CFLAGS="$CFLAGS" bootstrap
39 else
40 make BOOT_CFLAGS="$CFLAGS" bootstrap
41 fi
42
43 make -j 1 DESTDIR=$PKG install
44
45 ln -fs gfortran $PKG/usr/bin/f90
46 ln -fs gfortran $PKG/usr/bin/f95
47 ln -fs gfortran $PKG/usr/bin/g77
48
49 for D in lib{,32}; do
50 install -d -m 0755 $PKG/usr/share/gdb/auto-load/usr/${D}
51 mv $PKG/usr/${D}/libstdc++.so.*-gdb.py $PKG/usr/share/gdb/auto-load/usr/${D}
52 done
53
54 # remove files already on the system out of the port
55 for i in $(pkginfo -l gcc | sed -e "s|^|/|") $(pkginfo -l binutils | sed -e "s|^|/|"); do
56 if [ -e "$i" ] && [ ! -d "$i" ]; then
57 if [ -e "$PKG$i" ]; then
58 rm "$PKG$i"
59 fi
60 # check for compressed manpages
61 if [ -e "$PKG${i%%.gz}" ]; then
62 rm "$PKG${i%%.gz}"
63 fi
64 fi
65 done
66
67 rm $PKG/usr/bin/*-linux-gnu-*
68 rm -r $PKG/usr/share/{info,gcc-$version}
69 rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
70
71 # Remove empty directories
72 find $PKG -depth -empty -exec rm -r {} \;
73
74 # remove build paths from *.la files
75 sed -i -e "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/libgfortran.la
76 }
|