Changeset 110419


Ignore:
Timestamp:
Aug 30, 2013, 11:49:06 PM (7 years ago)
Author:
larryv@…
Message:

portconfigure.tcl: Rewrite cxx_stdlib handling to more closely resemble
similar options, like "configure.pipe". (Namely, let
configure.[obj]cxxflags be and add -stdlib while setting up the
environment.)

File:
1 edited

Legend:

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

    r110369 r110419  
    137137default configure.optflags      {-Os}
    138138default configure.cflags        {${configure.optflags}}
    139 default configure.cxxflags      {[portconfigure::choose_default_cxxflags]}
     139default configure.cxxflags      {${configure.optflags}}
    140140default configure.objcflags     {${configure.optflags}}
    141 default configure.objcxxflags   {[portconfigure::choose_default_cxxflags]}
     141default configure.objcxxflags   {${configure.optflags}}
    142142default configure.cppflags      {-I${prefix}/include}
    143143default configure.ldflags       {"-L${prefix}/lib -Wl,-headerpad_max_install_names"}
     
    258258        }
    259259    }
    260 }
    261 
    262 # internal function to choose the default configure.cxxflags and configure.objcxxflags
    263 proc portconfigure::choose_default_cxxflags {} {
    264     global cxx_stdlib
    265     global configure.optflags
    266     global configure.cxx
    267 
    268     set flags ${configure.optflags}
    269 
    270     if {${cxx_stdlib} != "" && [string match *clang* ${configure.cxx}]} {
    271         append flags " -stdlib=${cxx_stdlib}"
    272     }
    273 
    274     return ${flags}
    275260}
    276261
     
    640625           configure.ccache configure.distcc configure.cpp configure.javac configure.sdkroot \
    641626           configure.march configure.mtune \
    642            os.platform os.major
     627           os.platform os.major cxx_stdlib
    643628    foreach tool {cc cxx objc objcxx f77 f90 fc ld} {
    644629        global configure.${tool} configure.${tool}_archflags
     
    707692        }
    708693
     694        # Add C++ standard library, if requested. Set up here to allow
     695        # ${configure.cxxflags} and ${configure.objcxxflags} to override.
     696        if {[info exists cxx_stdlib] && $cxx_stdlib ne {} &&
     697            [string match *clang* [option configure.cxx]]
     698        } then {
     699            append_to_environment_value configure CXXFLAGS -stdlib=$cxx_stdlib
     700            append_to_environment_value configure OBJCXXFLAGS -stdlib=$cxx_stdlib
     701        }
     702
    709703        # Append configure flags.
    710704        foreach env_var { \
Note: See TracChangeset for help on using the changeset viewer.