| 1 | # $Id$ |
|---|
| 2 | |
|---|
| 3 | PortSystem 1.0 |
|---|
| 4 | PortGroup select 1.0 |
|---|
| 5 | |
|---|
| 6 | name gcc43 |
|---|
| 7 | version 4.3.6 |
|---|
| 8 | revision 3 |
|---|
| 9 | platforms darwin |
|---|
| 10 | categories lang |
|---|
| 11 | maintainers mww openmaintainer |
|---|
| 12 | # an exception in the license allows dependents to not be GPL |
|---|
| 13 | license {GPL-3+ GPL-2+ Permissive} |
|---|
| 14 | description The GNU compiler collection |
|---|
| 15 | long_description The GNU compiler collection, including front ends for \ |
|---|
| 16 | C, C++, Objective-C, Objective-C++, Fortran, and Java. |
|---|
| 17 | |
|---|
| 18 | homepage http://gcc.gnu.org/ |
|---|
| 19 | master_sites ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \ |
|---|
| 20 | ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \ |
|---|
| 21 | ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \ |
|---|
| 22 | ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \ |
|---|
| 23 | gnu:gcc/gcc-${version} |
|---|
| 24 | |
|---|
| 25 | use_bzip2 yes |
|---|
| 26 | |
|---|
| 27 | set dcore gcc-core-${version}.tar.bz2 |
|---|
| 28 | set dfort gcc-fortran-${version}.tar.bz2 |
|---|
| 29 | set dcxx gcc-g++-${version}.tar.bz2 |
|---|
| 30 | set djava gcc-java-${version}.tar.bz2 |
|---|
| 31 | set dobjc gcc-objc-${version}.tar.bz2 |
|---|
| 32 | |
|---|
| 33 | distfiles ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc} |
|---|
| 34 | |
|---|
| 35 | checksums gcc-core-${version}.tar.bz2 \ |
|---|
| 36 | md5 43df9ad8b4bb314a46bac12f5aefaec2 \ |
|---|
| 37 | sha1 d9dc274ad558194e7d9bacc49c333a4870d7e613 \ |
|---|
| 38 | rmd160 d4bed0820d5eae5072e30fa66167fda4fc2f0bbc \ |
|---|
| 39 | gcc-fortran-${version}.tar.bz2 \ |
|---|
| 40 | md5 c6eeee73007015c52043716fbe8ffdc7 \ |
|---|
| 41 | sha1 20d9f1293857d24e4a69996f91875718e3217ae3 \ |
|---|
| 42 | rmd160 ca92b43af16f6837d99f839a76547cd0610fbc58 \ |
|---|
| 43 | gcc-g++-${version}.tar.bz2 \ |
|---|
| 44 | md5 ee7dc01b6e1a6a92a6e8d66adb8d2ab9 \ |
|---|
| 45 | sha1 91afb0336103204731d5d8156790b97005869d1f \ |
|---|
| 46 | rmd160 90e5836b9b5e16a378b93f093dec78e917ae3f9c \ |
|---|
| 47 | gcc-java-${version}.tar.bz2 \ |
|---|
| 48 | md5 b5c12ad38048c354686747d640f5d621 \ |
|---|
| 49 | sha1 0216314c694642e0b16418a1259bd0f90987107e \ |
|---|
| 50 | rmd160 bfc0ac76397e81ccfeb9334966359e668a961d8e \ |
|---|
| 51 | gcc-objc-${version}.tar.bz2 \ |
|---|
| 52 | md5 3fdb8158eabb765d1711f894bf71f7f5 \ |
|---|
| 53 | sha1 437833d7211118f8647941c1a78531ec125f97c2 \ |
|---|
| 54 | rmd160 cde38f66b4b952f52938dc50d7606a0e1ccc7d2f |
|---|
| 55 | |
|---|
| 56 | depends_lib port:gmp port:mpfr port:libiconv |
|---|
| 57 | depends_run port:gcc_select port:ld64 port:cctools |
|---|
| 58 | |
|---|
| 59 | depends_skip_archcheck-append gcc_select ld64 cctools |
|---|
| 60 | |
|---|
| 61 | patchfiles Make-lang.in.diff darwin10.diff i386_multilib.diff ppc_fde_encoding.diff |
|---|
| 62 | patch.dir ${workpath}/gcc-${version} |
|---|
| 63 | |
|---|
| 64 | set major 4.3 |
|---|
| 65 | |
|---|
| 66 | worksrcdir build |
|---|
| 67 | |
|---|
| 68 | post-extract { |
|---|
| 69 | file mkdir ${worksrcpath} |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | platform darwin { |
|---|
| 73 | configure.pre_args-append --build=${build_arch}-apple-darwin${os.major} |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | configure.cmd ../gcc-${version}/configure |
|---|
| 77 | configure.args --enable-languages=c,c++,objc,obj-c++,java,fortran \ |
|---|
| 78 | --libdir=${prefix}/lib/${name} \ |
|---|
| 79 | --includedir=${prefix}/include/${name} \ |
|---|
| 80 | --infodir=${prefix}/share/info \ |
|---|
| 81 | --mandir=${prefix}/share/man \ |
|---|
| 82 | --datadir=${prefix}/share/${name} \ |
|---|
| 83 | --with-local-prefix=${prefix} \ |
|---|
| 84 | --with-libiconv-prefix=${prefix} \ |
|---|
| 85 | --with-system-zlib \ |
|---|
| 86 | --disable-nls \ |
|---|
| 87 | --program-suffix=-mp-${major} \ |
|---|
| 88 | --with-gxx-include-dir=${prefix}/include/${name}/c++/ \ |
|---|
| 89 | --with-gmp=${prefix} \ |
|---|
| 90 | --with-mpfr=${prefix} \ |
|---|
| 91 | --enable-stage1-checking \ |
|---|
| 92 | --disable-multilib \ |
|---|
| 93 | --with-as=${prefix}/bin/as \ |
|---|
| 94 | --with-ld=${prefix}/bin/ld \ |
|---|
| 95 | --with-ar=${prefix}/bin/ar \ |
|---|
| 96 | --with-bugurl=https://trac.macports.org/newticket |
|---|
| 97 | |
|---|
| 98 | configure.env-append \ |
|---|
| 99 | AR_FOR_TARGET=${prefix}/bin/ar \ |
|---|
| 100 | AS_FOR_TARGET=${prefix}/bin/as \ |
|---|
| 101 | LD_FOR_TARGET=${prefix}/bin/ld \ |
|---|
| 102 | NM_FOR_TARGET=${prefix}/bin/nm \ |
|---|
| 103 | OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \ |
|---|
| 104 | RANLIB_FOR_TARGET=${prefix}/bin/ranlib \ |
|---|
| 105 | STRIP_FOR_TARGET=${prefix}/bin/strip \ |
|---|
| 106 | OTOOL=${prefix}/bin/otool \ |
|---|
| 107 | OTOOL64=${prefix}/bin/otool |
|---|
| 108 | |
|---|
| 109 | pre-configure { |
|---|
| 110 | configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}" |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | # http://trac.macports.org/ticket/29104 |
|---|
| 114 | if {${configure.compiler} == "llvm-gcc-4.2"} { |
|---|
| 115 | configure.compiler clang |
|---|
| 116 | } |
|---|
| 117 | |
|---|
| 118 | # STAGE1_CFLAGS="-O2 -fkeep-inline-functions" : from configure.ac |
|---|
| 119 | # BOOT_CFLAGS="-O2 -g" : from Makefile.tpl |
|---|
| 120 | # -std=gnu89 : for building with clang |
|---|
| 121 | # -D_FORTIFY_SOURCE=0 : The built compiler might not understand newer builtins |
|---|
| 122 | # exposed in libc headers for fortified string functions. |
|---|
| 123 | # Yes, we need to set both BOOT_CFLAGS and STAGE1_CFLAGS |
|---|
| 124 | # because STAGE1_CFLAGS is used with xgcc for libgcc |
|---|
| 125 | build.args-append BOOT_CFLAGS="-O2 -g -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="-O2 -fkeep-inline-functions -D_FORTIFY_SOURCE=0 -std=gnu89" |
|---|
| 126 | build.target bootstrap |
|---|
| 127 | use_parallel_build yes |
|---|
| 128 | |
|---|
| 129 | destroot.target install install-info-host |
|---|
| 130 | |
|---|
| 131 | post-destroot { |
|---|
| 132 | file delete -force ${destroot}${prefix}/share/man/man7 \ |
|---|
| 133 | ${destroot}${prefix}/share/info |
|---|
| 134 | # install/copy ffitarget.h only if we have it |
|---|
| 135 | if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} { |
|---|
| 136 | file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/ |
|---|
| 137 | } |
|---|
| 138 | } |
|---|
| 139 | |
|---|
| 140 | select.group gcc |
|---|
| 141 | select.file ${filespath}/mp-${name} |
|---|
| 142 | |
|---|
| 143 | # Java support does not compile on 10.4/x86 |
|---|
| 144 | platform darwin 8 i386 { |
|---|
| 145 | configure.args-delete --enable-languages=c,c++,objc,obj-c++,java,fortran |
|---|
| 146 | configure.args-append --enable-languages=c,c++,objc,obj-c++,fortran |
|---|
| 147 | } |
|---|
| 148 | |
|---|
| 149 | platform powerpc { |
|---|
| 150 | configure.universal_archs ppc ppc64 |
|---|
| 151 | } |
|---|
| 152 | platform i386 { |
|---|
| 153 | configure.universal_archs i386 x86_64 |
|---|
| 154 | } |
|---|
| 155 | variant universal { |
|---|
| 156 | configure.args-delete --disable-multilib |
|---|
| 157 | } |
|---|
| 158 | # the generated compiler doesn't accept -arch |
|---|
| 159 | configure.env-append CPP="${configure.cc} -E" |
|---|
| 160 | build.env-append CPP="${configure.cc} -E" |
|---|
| 161 | configure.cc-append [get_canonical_archflags] |
|---|
| 162 | configure.cc_archflags |
|---|
| 163 | configure.cxx_archflags |
|---|
| 164 | configure.objc_archflags |
|---|
| 165 | configure.ld_archflags |
|---|
| 166 | configure.universal_cflags |
|---|
| 167 | configure.universal_cxxflags |
|---|
| 168 | configure.universal_ldflags |
|---|
| 169 | configure.universal_args |
|---|
| 170 | |
|---|
| 171 | livecheck.type regex |
|---|
| 172 | livecheck.url http://gcc.gnu.org/gcc-4.3/ |
|---|
| 173 | livecheck.regex GCC (4\\.3\\.\[0-9\]) |
|---|