Changeset 54512


Ignore:
Timestamp:
Jul 28, 2009, 10:47:25 PM (9 years ago)
Author:
jmr@…
Message:

gcc ports: Set archflags that are acceptable to the generated compiler (#20280). If this isn't doing things right, please feel free to correct.

Location:
trunk/dports/lang
Files:
6 edited

Legend:

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

    r53914 r54512  
    4848#patch.dir              ${workpath}/gcc-${version}
    4949
     50# the generated compiler doesn't accept -arch
     51if {[info exists build_arch] && ${os.platform} == "darwin"} {
     52    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
     53        configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
     54    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
     55        configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
     56    } else {
     57        pre-fetch {
     58            return -code error "Cannot build $name for $build_arch"
     59        }
     60    }
     61    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
     62    configure.cc_archflags
     63    configure.cxx_archflags
     64    configure.objc_archflags
     65}
     66
    5067configure.cmd   ${workpath}/gcc-${version}/configure
    5168configure.args  --enable-languages=c,c++,java,objc,f95 \
  • trunk/dports/lang/gcc41/Portfile

    r43838 r54512  
    5151}
    5252patch.dir       ${workpath}/gcc-${version}
     53
     54# the generated compiler doesn't accept -arch
     55if {[info exists build_arch] && ${os.platform} == "darwin"} {
     56    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
     57        configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
     58    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
     59        configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
     60    } else {
     61        pre-fetch {
     62            return -code error "Cannot build $name for $build_arch"
     63        }
     64    }
     65    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
     66    configure.cc_archflags
     67    configure.cxx_archflags
     68    configure.objc_archflags
     69}
    5370
    5471configure.cmd   ../gcc-${version}/configure
  • trunk/dports/lang/gcc42/Portfile

    r46292 r54512  
    4949                reinplace "s|${f}.info|${f}-mp-${version}.info|g" ${workpath}/gcc-${version}/gcc/doc/${f}.texi
    5050        }
     51}
     52
     53# the generated compiler doesn't accept -arch
     54if {[info exists build_arch] && ${os.platform} == "darwin"} {
     55    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
     56        configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
     57    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
     58        configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
     59    } else {
     60        pre-fetch {
     61            return -code error "Cannot build $name for $build_arch"
     62        }
     63    }
     64    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
     65    configure.cc_archflags
     66    configure.cxx_archflags
     67    configure.objc_archflags
    5168}
    5269
  • trunk/dports/lang/gcc43/Portfile

    r45978 r54512  
    4646pre-configure {
    4747    file mkdir ${worksrcpath}
     48}
     49
     50# the generated compiler doesn't accept -arch
     51if {[info exists build_arch] && ${os.platform} == "darwin"} {
     52    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
     53        configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
     54    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
     55        configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
     56    } else {
     57        pre-fetch {
     58            return -code error "Cannot build $name for $build_arch"
     59        }
     60    }
     61    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
     62    configure.cc_archflags
     63    configure.cxx_archflags
     64    configure.objc_archflags
    4865}
    4966
  • trunk/dports/lang/gcc44/Portfile

    r54219 r54512  
    4343
    4444worksrcdir              build
     45
     46# the generated compiler doesn't accept -arch
     47if {[info exists build_arch] && ${os.platform} == "darwin"} {
     48    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
     49        configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
     50    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
     51        configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
     52    } else {
     53        pre-fetch {
     54            return -code error "Cannot build $name for $build_arch"
     55        }
     56    }
     57    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
     58    configure.cc_archflags
     59    configure.cxx_archflags
     60    configure.objc_archflags
     61}
    4562
    4663pre-configure {
  • trunk/dports/lang/gcc45/Portfile

    r54280 r54512  
    4242
    4343worksrcdir              build
     44
     45# the generated compiler doesn't accept -arch
     46if {[info exists build_arch] && ${os.platform} == "darwin"} {
     47    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
     48        configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
     49    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
     50        configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
     51    } else {
     52        pre-fetch {
     53            return -code error "Cannot build $name for $build_arch"
     54        }
     55    }
     56    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
     57    configure.cc_archflags
     58    configure.cxx_archflags
     59    configure.objc_archflags
     60}
    4461
    4562pre-configure {
Note: See TracChangeset for help on using the changeset viewer.