Ticket #38271: gsl.clang32.diff

File gsl.clang32.diff, 2.9 KB (added by daitakahashi, 12 years ago)

A Portfile patch to enable clang-3.2 build

  • Portfile

    old new  
    5757    }
    5858}
    5959
    60 variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description "Use GCC 4.3 for compilation of GSL" {
     60variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 clang32 description "Use GCC 4.3 for compilation of GSL" {
    6161    depends_build-append        port:gcc43
    6262    configure.compiler          macports-gcc-4.3
    6363}
    6464
    65 variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description "Use GCC 4.4 for compilation of GSL" {
     65variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 clang32 description "Use GCC 4.4 for compilation of GSL" {
    6666    depends_build-append        port:gcc44
    6767    configure.compiler          macports-gcc-4.4
    6868}
    6969
    70 variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description "Use GCC 4.5 for compilation of GSL" {
     70variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 clang32 description "Use GCC 4.5 for compilation of GSL" {
    7171    depends_build-append        port:gcc45
    7272    configure.compiler          macports-gcc-4.5
    7373}
    7474
    75 variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description "Use GCC 4.6 for compilation of GSL" {
     75variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 clang32 description "Use GCC 4.6 for compilation of GSL" {
    7676    depends_build-append        port:gcc46
    7777    configure.compiler          macports-gcc-4.6
    7878}
    7979
    80 variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 description "Use GCC 4.7 for compilation of GSL" {
     80variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 clang32 description "Use GCC 4.7 for compilation of GSL" {
    8181    depends_build-append        port:gcc47
    8282    configure.compiler          macports-gcc-4.7
    8383}
    8484
     85variant clang32 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 description "Use clang 3.2 for compilation of GSL" {
     86    depends_build-append        port:clang-3.2
     87    configure.compiler          macports-clang-3.2
     88    patchfiles-append           fix-mllvm-args-ltmain.sh.diff
     89}
     90
    8591variant optimize description "Provide further optimization options (depending on compiler used)" {
    86     configure.cflags-append     "-ftree-vectorize -O3"
     92    if { [variant_isset clang32] } {
     93        configure.cflags-append     "-O3 -mllvm -vectorize-loops"
     94    } else {
     95        configure.cflags-append     "-ftree-vectorize -O3"
     96    }
    8797}
    8898
    8999platform darwin i386 {
    90     if { [variant_isset optimize] && ( [variant_isset gcc43] || [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] ) } {
    91         configure.cflags-append "-march=native"
     100    if { [variant_isset optimize] } {
     101        if { [variant_isset clang32] } {
     102            configure.cflags-append "-march=native"
     103        } elseif { [variant_isset gcc43] } {
     104            configure.cflags-append "-march=native"
     105        } elseif { [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47] } {
     106            configure.cflags-append "-march=native -mno-avx"
     107        }
    92108    }
    93109}