# Parameters for this port.
set crossgcc-target arm-aout
description gcc cross-compilers for arm-aout, with newlib runtime library.
long_description gnu compilers collection (including c++, fortran and java) for \
arm-aout, with newlib runtime library.
homepage https://gcc.gnu.org/
master_sites gnu:gcc/gcc-${version}/:gcc \
ftp://sources.redhat.com/pub/newlib/:newlib \
ftp://ftp.mirror.ac.uk/sites/sources.redhat.com/pub/newlib/:newlib
distfiles gcc-${version}.tar.gz:gcc newlib-${newlibversion}.tar.gz:newlib
worksrcdir gcc-${version}
checksums gcc-${version}.tar.gz \
md5 22c911f0a10275a0035d6004b9d68b63 \
sha1 7c713380dc7eed4bf95e158118b555fc68031c73 \
rmd160 aa9bdc4d7549fc586684c4e6da90df68a1c191ff \
newlib-${newlibversion}.tar.gz \
md5 3fa663f131b355d3adb24ead4df678f2 \
sha1 edc50f5cda734b50c5431a2b8d1e579ac82ce3f9 \
rmd160 6f2b3f32759925142421ddc069229eff857dd106
# All cross ports violate the mtree layout.
destroot.violate_mtree yes
# Download everything to gcc/
# Patches for info's dir and bugs that gcc 4.x doesn't like.
patchfiles patch-gcc-Makefile.in \
patch-gcc-f-Make-lang.in \
patch-gcc-java-Make-lang.in \
patch-gcc-java-gjavah.c \
patch-fastjar-Makefile.in
depends_lib port:${crossgcc-target}-binutils
# Link newlib to gcc, so gcc will find its include files and this will also build newlib.
system "ln -s ${workpath}/newlib-${newlibversion}/newlib ${workpath}/gcc-${version}"
# Build in a different directory, as advised in the README file.
pre-configure { system "cd ${workpath} && mkdir -p build"}
configure.dir ${workpath}/build
configure.cmd ${workpath}/gcc-${version}/configure
configure.args --infodir='${prefix}/share/info' \
--mandir='${prefix}/share/man' \
--target=${crossgcc-target} \
--program-prefix=${crossgcc-target}- \
--program-suffix=-${version} \
--with-gnu-as --with-gnu-ld \
--with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
configure.cflags-append -std=gnu89
build.dir ${workpath}/build
# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
# program names as gcc's name (add -${version} with ${version} being the version of gcc).
# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
# had, they would actually have the binutils' version suffix (and not gcc's version).
# So let's tell gcc's Makefile it not to do that.
build.args AR_FOR_TARGET=${crossgcc-target}-ar \
AS_FOR_TARGET=${crossgcc-target}-as \
LD_FOR_TARGET=${crossgcc-target}-ld \
NM_FOR_TARGET=${crossgcc-target}-nm \
RANLIB_FOR_TARGET=${crossgcc-target}-ranlib
destroot.args AR_FOR_TARGET=${crossgcc-target}-ar \
AS_FOR_TARGET=${crossgcc-target}-as \
LD_FOR_TARGET=${crossgcc-target}-ld \