Changeset 102827


Ignore:
Timestamp:
Feb 9, 2013, 6:00:02 AM (5 years ago)
Author:
takeshi@…
Message:

g95: added gcc40 variant for Leopard; g95 builds fine against gcc42 on Leopard, but g95 does not work properly

Location:
trunk/dports/lang/g95
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/g95/Portfile

    r101744 r102827  
    66name            g95
    77version         0.93
    8 revision        1
     8revision        2
    99platforms       darwin
    1010categories      lang
     
    1818                Parts of the F2003 standard have been implemented in g95.
    1919homepage        http://g95.org/
    20 master_sites    ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.2.4/:gcc \
    21                 http://ftp.g95.org/v${version}/:g95
    2220dist_subdir     ${name}/${version}
    2321
     22if {${os.major} < 10 || ${build_arch}=="ppc" || ${build_arch}=="i386"} {
     23    default_variants +gcc40
     24}
     25
    2426set triple ""
    25 set version_gcc 4.2.4
    26 array set barch {ppc powerpc ppc64 powerpc64 i386 i386 x86_64 x86_64}
    27 if {[info exists barch(${build_arch})]} {
    28     set triple      $barch(${build_arch})-apple-darwin${os.major}
     27if {[variant_isset gcc40]} {
     28    set version_gcc 4.0.4
     29    set triple  ${os.arch}-apple-darwin${os.major}
     30    set dcore   gcc-core-${version_gcc}.tar.bz2
     31    checksums   ${dcore} md5    193e0a7a471cca70e374974bc5a60137         \
     32                ${dcore} sha1   55c664b33a4dc6b2130c47da28a1d6daab732ce9 \
     33                ${dcore} rmd160 af67dc8385942450f6b27ad83a6b9e3d22f779a1
     34} else {
     35    set version_gcc 4.2.4
     36    array set barch {ppc powerpc ppc64 powerpc64 i386 i386 x86_64 x86_64}
     37    if {[info exists barch(${build_arch})]} {
     38        set triple  $barch(${build_arch})-apple-darwin${os.major}
     39    }
     40    set dcore   gcc-core-${version_gcc}.tar.bz2
     41    checksums   ${dcore} md5     b7a4c167f6a05301591b139b356e36d0 \
     42                ${dcore} sha1    540fa6949415ded321a7cbe80bbf8befe85e3566 \
     43                ${dcore} rmd160  d54581d0a2ecc22718e6be101c6dc524a4a88463
    2944}
     45master_sites    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version_gcc}/:gcc \
     46                http://ftp.g95.org/v${version}/:g95
    3047set buildhost   "--build=${triple} --host=${triple}"
    3148
    32 set dcore       gcc-core-${version_gcc}.tar.bz2
    3349set dg95        ${name}_source.tgz
    3450set gcclib      lib/${name}/${triple}/${version_gcc}
    3551distfiles       ${dcore}:gcc ${dg95}:g95
    3652
    37 checksums       ${dcore} md5     b7a4c167f6a05301591b139b356e36d0 \
    38                 ${dcore} sha1    540fa6949415ded321a7cbe80bbf8befe85e3566 \
    39                 ${dcore} rmd160  d54581d0a2ecc22718e6be101c6dc524a4a88463 \
    40                 ${dg95}  md5     f9552aef0975c1dcf70950b6e6b18ff1 \
    41                 ${dg95}  sha1    b5e503fd6459b65cbda73190685f9490230d9cff \
    42                 ${dg95}  rmd160  98d03e9a1835f4b3553a72a798bdf1d90a757176
     53checksums-append    ${dg95}  md5     f9552aef0975c1dcf70950b6e6b18ff1 \
     54                    ${dg95}  sha1    b5e503fd6459b65cbda73190685f9490230d9cff \
     55                    ${dg95}  rmd160  98d03e9a1835f4b3553a72a798bdf1d90a757176
    4356
    4457depends_build   port:ld64 port:cctools
     
    6881    reinplace "s|CFLAGS_FOR_TARGET = -O2 \$(CFLAGS)|CFLAGS_FOR_TARGET = ${configure.cflags}|" ${workpath}/gcc-${version_gcc}/Makefile.in
    6982    reinplace "s|^stage1_cflags=\"|stage1_cflags=\"${configure.cflags} ${configure.cc_archflags} |" ${workpath}/gcc-${version_gcc}/configure
    70     reinplace "s|named_section|get_named_section|" ${worksrcpath}/trans-decl.c
     83    if {![variant_isset gcc40]} {
     84        reinplace "s|named_section|get_named_section|" ${worksrcpath}/trans-decl.c
     85    }
    7186}
    7287
     
    99114                         ${buildhost}; \
    100115            make"
    101     system "cd ${workpath}/gcc-${version_gcc}/${name}/gcc; \
    102             ar d libbackend.a options.o; \
    103             cd ${workpath}/gcc-${version_gcc}/gcc/; \
    104             patch -p0 < ${portpath}/files/patch-gcc.c.diff"
     116    if {![variant_isset gcc40]} {
     117        system "cd ${workpath}/gcc-${version_gcc}/${name}/gcc; \
     118                ar d libbackend.a options.o; \
     119                cd ${workpath}/gcc-${version_gcc}/gcc/; \
     120                patch -p0 < ${portpath}/files/patch-gcc.c.diff"
     121    }
    105122}
    106123
     
    108125
    109126post-configure {
    110     reinplace "s|\(f951_LDADD\)|(f951_LDADD) ${workpath}/gcc-${version_gcc}/g95/libdecnumber/*.o|" ${worksrcpath}/Makefile
     127    if {![variant_isset gcc40]} {
     128        reinplace "s|\(f951_LDADD\)|(f951_LDADD) ${workpath}/gcc-${version_gcc}/g95/libdecnumber/*.o|" ${worksrcpath}/Makefile
     129    }
    111130}
    112131
    113132pre-build {
    114     if {${os.arch}=="i386"} {
     133    if {![variant_isset gcc40] && ${os.arch}=="i386"} {
    115134        reinplace "s|\(g95_LDADD\)|(g95_LDADD) ${workpath}/gcc-${version_gcc}/g95/gcc/driver-i386.o|" ${worksrcpath}/Makefile
    116135    }
     
    136155    system -W ${destroot}${prefix} "find . -type f -name '*.dylib' -exec dsymutil {} +"
    137156}
     157
     158variant gcc40 description {build against gcc-4.0.x} {
     159    patchfiles-delete   patch-lang.opt.diff patch-darwin.h.diff
     160    patchfiles-append   patch-host-darwin.c.diff patch-darwin-fallback.c.diff
     161}
Note: See TracChangeset for help on using the changeset viewer.