@@ -9,23 +9,45 @@ export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:$
9
9
10
10
pushd $SRC_DIR /.build/$CHOST /build/build-cc-gcc-final/
11
11
12
- make -C $CHOST /libgfortran prefix=$PREFIX install
12
+ # adapted from Arch install script from https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/gcc/PKGBUILD
13
+ # We cannot make install since .la files are not relocatable so libtool deliberately prevents it:
14
+ # libtool: install: error: cannot install `libgfortran.la' to a directory not ending in ${SRC_DIR}/work/gcc_built/${CHOST}/lib/../lib
15
+ make -C $CHOST /libgfortran prefix=$PREFIX all-multi libgfortran.spec ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod config.h
13
16
if [[ -d $CHOST /libgomp ]]; then
14
17
make -C $CHOST /libgomp prefix=$PREFIX install-nodist_fincludeHEADERS
15
18
fi
16
19
make -C gcc prefix=$PREFIX fortran.install-{common,man,info}
17
20
install -Dm755 gcc/f951 $PREFIX /${_libdir} /f951
18
21
22
+ mkdir -p $PREFIX /$CHOST /sysroot/lib
23
+ cp $CHOST /libgfortran/libgfortran.spec $PREFIX /$CHOST /sysroot/lib
24
+
19
25
pushd $PREFIX /bin
20
26
ln -s $CHOST -gfortran $CHOST -f95
21
27
popd
22
28
23
29
popd
24
30
31
+ cp ${SRC_DIR} /gcc_built/$CHOST /sysroot/lib/libgfortran.so* $PREFIX /$CHOST /sysroot/lib
25
32
# Install Runtime Library Exception
26
33
install -Dm644 $SRC_DIR /.build/src/gcc-${PKG_VERSION} /COPYING.RUNTIME \
27
34
${PREFIX} /share/licenses/gcc-fortran/RUNTIME.LIBRARY.EXCEPTION
28
35
36
+ # generate specfile so that we can patch loader link path
37
+ # link_libgcc should have the gcc's own libraries by default (-R)
38
+ # so that LD_LIBRARY_PATH isn't required for basic libraries.
39
+ #
40
+ # GF method here to create specs file and edit it. The other methods
41
+ # tried had no effect on the result. including:
42
+ # setting LINK_LIBGCC_SPECS on configure
43
+ # setting LINK_LIBGCC_SPECS on make
44
+ # setting LINK_LIBGCC_SPECS in gcc/Makefile
45
+ specdir=` dirname $( $PREFIX /bin/${CHOST} -gcc -print-libgcc-file-name -no-canonical-prefixes) `
46
+ mv $PREFIX /bin/${CHOST} -gfortran $PREFIX /bin/${CHOST} -gfortran.bin
47
+ echo ' #!/bin/sh' > $PREFIX /bin/${CHOST} -gfortran
48
+ echo $PREFIX /bin/${CHOST} -gfortran.bin -specs=$specdir /specs ' "$@"' >> $PREFIX /bin/${CHOST} -gfortran
49
+ chmod +x $PREFIX /bin/${CHOST} -gfortran
50
+
29
51
mkdir -p ${PREFIX} /etc/conda/{de,}activate.d
30
52
cp " ${SRC_DIR} " /activate-gfortran.sh ${PREFIX} /etc/conda/activate.d/activate-${PKG_NAME} .sh
31
53
cp " ${SRC_DIR} " /deactivate-gfortran.sh ${PREFIX} /etc/conda/deactivate.d/deactivate-${PKG_NAME} .sh
0 commit comments