# $Id$ PortSystem 1.0 name arm-aout-gcc version 3.3.6 # Parameters for this port. set newlibversion 1.14.0 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 http://gcc.gnu.org/ platforms darwin categories cross devel license GPL-2+ maintainers nomaintainer 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/ dist_subdir gcc # Patches for info's dir and bugs that gcc 4.x doesn't like. patchfiles patch-gcc-Makefile.in \ patch-gcc-f-com.h \ 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. post-extract { 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} \ --enable-obsolete \ --with-gnu-as --with-gnu-ld \ --with-newlib \ --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \ --with-included-gettext configure.cflags-append -std=gnu89 configure.cppflags configure.ldflags configure.cc_archflags configure.cxx_archflags configure.objc_archflags configure.ld_archflags 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 \ NM_FOR_TARGET=${crossgcc-target}-nm \ RANLIB_FOR_TARGET=${crossgcc-target}-ranlib post-patch { namespace eval crossgcc {} # Fix the info pages and related stuff. # # path: path to the doc directory (e.g. gas/doc/) # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in) # name: name of the info page (e.g. as) # suffix: suffix of the souce page (texinfo or texi) proc crossgcc::fixinfo { path makefile name suffix } { global crossgcc-target worksrcpath # Fix the source reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \ ${worksrcpath}/${path}/${name}.${suffix} reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \ ${worksrcpath}/${path}/${name}.${suffix} reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \ ${worksrcpath}/${path}/${name}.${suffix} # Fix the Makefile reinplace "s|${name}.info|${crossgcc-target}-${name}.info|g" \ ${worksrcpath}/${makefile} reinplace "s|${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \ ${worksrcpath}/${makefile} # Rename the source file rename ${worksrcpath}/${path}/${name}.${suffix} \ ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix} # Fix install-info's dir. # (note: this may be effectless if there was no info dir to be fixed) reinplace "s|__TARGET|${crossgcc-target}|g" \ "${worksrcpath}/${makefile}" } # Fix the gettext files and related stuff. # # module: name of the module (e.g. gas) proc crossgcc::fixgettext { module } { global crossgcc-target worksrcpath if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } { reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \ "${worksrcpath}/${module}/Makefile.in" } if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } { reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \ "${worksrcpath}/${module}/doc/Makefile.in" } if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } { reinplace "s|@PACKAGE@|${crossgcc-target}-@PACKAGE@|g" \ "${worksrcpath}/${module}/po/Make-in" } } # gcc/doc/cpp.texi crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi # gcc/doc/cppinternals.texi crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi # gcc/doc/gcc.texi crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi # gcc/doc/gccint.texi crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi # gcc/f/g77.texi crossgcc::fixinfo gcc/f/ gcc/f/Make-lang.in g77 texi # gcc/java/gcj.texi crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi # fastjar/fastjar.texi crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi # gettext stuff. crossgcc::fixgettext gcc crossgcc::fixgettext fastjar } post-destroot { # Stuff I don't want (either because they're in the system # or because they would conflict with other FSF ports) # (it's easier for maintainability purposes to fix things here) # aliases for locales (should be on the system) file delete "${destroot}${prefix}/share/locale/locale.alias" # FSF propaganda (should already be there or would conflict) file delete -force "${destroot}${prefix}/share/man/man7" # (host) libiberty foreach f [glob -directory "${destroot}${prefix}/lib" libiberty.a */libiberty.a] { file delete $f } # aliases for charsets (should already be there) file delete "${destroot}${prefix}/lib/charset.alias" # Remove man pages for tools that are not built as part of cross-gcc file delete "${destroot}${prefix}/share/man/man1/rmic.1" file delete "${destroot}${prefix}/share/man/man1/rmiregistry.1" file delete "${destroot}${prefix}/share/man/man1/jv-convert.1" file delete "${destroot}${prefix}/share/man/man1/gij.1" # For some reason, some man pages are not prefixed while they should have been # (to avoid conflicting). file rename "${destroot}${prefix}/share/man/man1/cpp.1" \ "${destroot}${prefix}/share/man/man1/${crossgcc-target}-cpp.1" file rename "${destroot}${prefix}/share/man/man1/gcjh.1" \ "${destroot}${prefix}/share/man/man1/${crossgcc-target}-gcjh.1" file rename "${destroot}${prefix}/share/man/man1/gcov.1" \ "${destroot}${prefix}/share/man/man1/${crossgcc-target}-gcov.1" file rename "${destroot}${prefix}/share/man/man1/jcf-dump.1" \ "${destroot}${prefix}/share/man/man1/${crossgcc-target}-jcf-dump.1" file rename "${destroot}${prefix}/share/man/man1/jv-scan.1" \ "${destroot}${prefix}/share/man/man1/${crossgcc-target}-jv-scan.1" } livecheck.type regex livecheck.url http://gcc.gnu.org/releases.html livecheck.regex {