Ticket #21341: Portfile_optimized.diff

File Portfile_optimized.diff, 2.7 KB (added by howarth@…, 15 years ago)

Portfile to fix gcc44 build and make improvements in builds

  • Portfile.

    old new  
    55name                    gcc44
    66epoch                   1
    77version                 4.4.1
     8revision                1
    89platforms               darwin
    910categories              lang
    1011maintainers             mww
     
    4243
    4344set major               4.4
    4445
     46patchfiles              gcc44-config.guess.diff \
     47                        gcc44-PR41180.diff \
     48                        gcc44-disable-libjava.diff
    4549worksrcdir              build
    46 
    47 # the generated compiler doesn't accept -arch
    48 if {[info exists build_arch] && ${os.platform} == "darwin"} {
    49     if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
    50         configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
    51     } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
    52         configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
    53     } else {
    54         pre-fetch {
    55             return -code error "Cannot build $name for $build_arch"
    56         }
    57     }
    58     configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
    59     configure.cc_archflags
    60     configure.cxx_archflags
    61     configure.objc_archflags
     50pre-patch {
     51        file mkdir ${worksrcpath}
    6252}
     53patch.dir               ${workpath}/gcc-${version}
     54
     55configure.env-append CFLAGS_FOR_BUILD="${configure.cflags}"
     56configure.cc_archflags
     57configure.cxx_archflags
     58configure.objc_archflags
    6359
    6460pre-configure {
    6561        file mkdir ${worksrcpath}
     
    7773                --program-suffix=-mp-${major} \
    7874                --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
    7975                --with-gmp=${prefix} \
    80                 --with-mpfr=${prefix}
     76                --with-mpfr=${prefix} \
     77                --disable-libjava-multilib
     78
     79if {[info exists build_arch] && ${os.platform} == "darwin" && ${os.arch} == "i386" && $build_arch == "i386" } {
     80        configure.args-append --with-arch=nocona --with-tune=generic --build=i686-apple-darwin${os.major} --host=i686-apple-darwin${os.major} --target=i686-apple-darwin${os.major}
     81    }
     82
    8183# do NOT use MacPorts binutils -- they do not work
    8284configure.env-append    AR_FOR_TARGET=/usr/bin/ar \
    8385                        AS_FOR_TARGET=/usr/bin/as \
     
    104106        xinstall -m 444 ${filespath}/mp-gcc44 ${destroot}${prefix}/etc/select/gcc/
    105107}
    106108
    107 #platform darwin 7 {
    108 #       configure.cflags-append -force_cpusubtype_ALL
    109 #       confgiure.env   BOOT_CFLAGS="-g -O2 -force_cpusubtype_ALL"
    110 #       build.args-append       XCFLAGS=-force_cpusubtype_ALL
    111 #}
    112 
    113 platform powerpc {
    114         configure.args-append --disable-multilib
    115 }
    116 
    117109# odcctools currently do not compile for x64 - move to variant for the time being
    118110variant odcctools \
    119111        description "Use the odcctools instead of the system provided ones - does not work for x64 currently!" {