Changeset 54236


Ignore:
Timestamp:
Jul 23, 2009, 3:31:10 PM (9 years ago)
Author:
jmr@…
Message:

Don't pass -arch to fortran compilers (none support it), and add archflags to the *FLAGS env vars in configure_main instead of appending to the configure.*flags options earlier, which could clash with these being changed in the portfile. (#20361)

Location:
trunk/base/src/port1.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portconfigure.tcl

    r53860 r54236  
    110110default configure.pkg_config_path   {}
    111111
    112 options configure.build_arch configure.archflags
     112options configure.build_arch
    113113default configure.build_arch {${build_arch}}
    114 default configure.archflags  {[portconfigure::configure_get_archflags]}
     114foreach tool {cc cxx objc f77 f90 fc} {
     115    options configure.${tool}_archflags
     116    default configure.${tool}_archflags  "\[portconfigure::configure_get_archflags $tool\]"
     117}
    115118
    116119options configure.universal_archs configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
     
    168171
    169172# internal function to determine the compiler flags to select an arch
    170 proc portconfigure::configure_get_archflags {args} {
     173proc portconfigure::configure_get_archflags {tool} {
    171174    global configure.build_arch configure.m32 configure.m64 configure.compiler
    172175    set flags ""
     
    176179        set flags "-m32"
    177180    } elseif {${configure.build_arch} != ""} {
    178         if {[arch_flag_supported]} {
     181        if {[arch_flag_supported] && $tool == "cc" || $tool == "cxx" || $tool == "objc"} {
    179182            set flags "-arch ${configure.build_arch}"
    180183        } elseif {${configure.build_arch} == "x86_64" || ${configure.build_arch} == "ppc64"} {
     
    411414    global [info globals]
    412415    global worksrcpath use_configure use_autoreconf use_autoconf use_automake use_xmkmf
    413     global configure.env configure.pipe configure.cflags configure.cppflags configure.cxxflags configure.objcflags configure.ldflags configure.libs configure.fflags configure.f90flags configure.fcflags configure.classpath
     416    global configure.env configure.pipe configure.libs configure.classpath configure.universal_args
    414417    global configure.perl configure.python configure.ruby configure.install configure.awk configure.bison configure.pkg_config configure.pkg_config_path
    415     global configure.ccache configure.distcc configure.cc configure.cxx configure.cpp configure.objc configure.f77 configure.f90 configure.fc configure.javac
     418    global configure.ccache configure.distcc configure.cpp configure.javac configure.march configure.mtune
     419    foreach tool {cc cxx objc f77 f90 fc} {
     420        global configure.${tool} configure.${tool}_archflags
     421    }
     422    foreach flags {cflags cppflags cxxflags objcflags ldflags fflags f90flags fcflags} {
     423        global configure.${flags} configure.universal_${flags}
     424    }
    416425   
    417426    if {[tbool use_autoreconf]} {
     
    491500        append_list_to_environment_value configure "PKG_CONFIG" ${configure.pkg_config}
    492501        append_list_to_environment_value configure "PKG_CONFIG_PATH" ${configure.pkg_config_path}
     502       
     503        # add extra flags that are conditional on whether we're building universal
     504        if {[variant_exists universal] && [variant_isset universal]} {
     505            foreach flags {CFLAGS OBJCFLAGS} {
     506                append_list_to_environment_value configure $flags ${configure.universal_cflags}
     507            }
     508            append_list_to_environment_value configure "CXXFLAGS" ${configure.universal_cxxflags}
     509            append_list_to_environment_value configure "CPPFLAGS" ${configure.universal_cppflags}
     510            append_list_to_environment_value configure "LDFLAGS" ${configure.universal_ldflags}
     511            eval configure.pre_args-append ${configure.universal_args}
     512        } else {
     513            foreach {tool flags} {cc CFLAGS cxx CXXFLAGS objc OBJCFLAGS f77 FFLAGS f90 F90FLAGS fc FCFLAGS} {
     514                append_list_to_environment_value configure $flags [set configure.${tool}_archflags]
     515                if {${configure.march} != {}} {
     516                    append_list_to_environment_value configure $flags "-march=${configure.march}"
     517                }
     518                if {${configure.mtune} != {}} {
     519                    append_list_to_environment_value configure $flags "-mtune=${configure.mtune}"
     520                }
     521            }
     522        }
    493523
    494524        # Execute the command (with the new environment).
  • trunk/base/src/port1.0/portutil.tcl

    r54018 r54236  
    18711871# conditional on whether universal is set
    18721872proc universal_setup {args} {
    1873     global configure.archflags
    1874     global configure.march configure.mtune configure.universal_cflags
    1875     global configure.universal_cxxflags configure.universal_cppflags
    1876     global configure.universal_ldflags configure.universal_args
    1877    
    18781873    if {[variant_exists universal]} {
    18791874        ui_debug "universal variant already exists, so not adding the default one"
     
    18901885        ui_debug "adding the default universal variant"
    18911886        variant universal {}
    1892     }
    1893 
    1894     # add in extra CFLAGS etc
    1895     if {[variant_exists universal] && [variant_isset universal]} {
    1896         foreach flag {cflags objcflags fflags f90flags fcflags} {
    1897             eval configure.${flag}-append ${configure.universal_cflags}
    1898         }
    1899         eval configure.cxxflags-append ${configure.universal_cxxflags}
    1900         eval configure.cppflags-append ${configure.universal_cppflags}
    1901         eval configure.ldflags-append ${configure.universal_ldflags}
    1902         eval configure.pre_args-append ${configure.universal_args}
    1903     } else {
    1904         foreach flag {cflags cxxflags objcflags fflags f90flags fcflags} {
    1905             eval configure.${flag}-append ${configure.archflags}
    1906             if {${configure.march} != {}} {
    1907                 configure.${flag}-append "-march=${configure.march}"
    1908             }
    1909             if {${configure.mtune} != {}} {
    1910                 configure.${flag}-append "-mtune=${configure.mtune}"
    1911             }
    1912         }
    1913         eval configure.ldflags-append ${configure.archflags}
    19141887    }
    19151888}
Note: See TracChangeset for help on using the changeset viewer.