[110479] trunk/base/src/port1.0/portconfigure.tcl

jeremyhu at macports.org jeremyhu at macports.org
Sat Aug 31 08:33:20 PDT 2013


Revision: 110479
          https://trac.macports.org/changeset/110479
Author:   jeremyhu at macports.org
Date:     2013-08-31 08:33:20 -0700 (Sat, 31 Aug 2013)
Log Message:
-----------
Revert r110419

-stdlib=... needs to be in configure.cxxflags, so ports can check for it and make decisions based on its presence 
(eg: removing it from configure.cxxflags if needed)

Revision Links:
--------------
    https://trac.macports.org/changeset/110419

Modified Paths:
--------------
    trunk/base/src/port1.0/portconfigure.tcl

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2013-08-31 12:15:08 UTC (rev 110478)
+++ trunk/base/src/port1.0/portconfigure.tcl	2013-08-31 15:33:20 UTC (rev 110479)
@@ -136,9 +136,9 @@
 # compiler flags section
 default configure.optflags      {-Os}
 default configure.cflags        {${configure.optflags}}
-default configure.cxxflags      {${configure.optflags}}
+default configure.cxxflags      {[portconfigure::choose_default_cxxflags]}
 default configure.objcflags     {${configure.optflags}}
-default configure.objcxxflags   {${configure.optflags}}
+default configure.objcxxflags   {[portconfigure::choose_default_cxxflags]}
 default configure.cppflags      {-I${prefix}/include}
 default configure.ldflags       {"-L${prefix}/lib -Wl,-headerpad_max_install_names"}
 default configure.libs          {}
@@ -259,6 +259,21 @@
     }
 }
 
+# internal function to choose the default configure.cxxflags and configure.objcxxflags
+proc portconfigure::choose_default_cxxflags {} {
+    global cxx_stdlib
+    global configure.optflags
+    global configure.cxx
+
+    set flags ${configure.optflags}
+
+    if {${cxx_stdlib} != "" && [string match *clang* ${configure.cxx}]} {
+        append flags " -stdlib=${cxx_stdlib}"
+    }
+
+    return ${flags}
+}
+
 # internal function to choose the default configure.build_arch and
 # configure.universal_archs based on supported_archs and build_arch or
 # universal_archs
@@ -624,7 +639,7 @@
            configure.pkg_config configure.pkg_config_path \
            configure.ccache configure.distcc configure.cpp configure.javac configure.sdkroot \
            configure.march configure.mtune \
-           os.platform os.major cxx_stdlib
+           os.platform os.major
     foreach tool {cc cxx objc objcxx f77 f90 fc ld} {
         global configure.${tool} configure.${tool}_archflags
     }
@@ -691,15 +706,6 @@
             append_to_environment_value configure $env_var $output
         }
 
-        # Add C++ standard library, if requested. Set up here to allow
-        # ${configure.cxxflags} and ${configure.objcxxflags} to override.
-        if {[info exists cxx_stdlib] && $cxx_stdlib ne {} &&
-            [string match *clang* [option configure.cxx]]
-        } then {
-            append_to_environment_value configure CXXFLAGS -stdlib=$cxx_stdlib
-            append_to_environment_value configure OBJCXXFLAGS -stdlib=$cxx_stdlib
-        }
-
         # Append configure flags.
         foreach env_var { \
             CC CXX OBJC OBJCXX FC F77 F90 JAVAC \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130831/bd6ef049/attachment.html>


More information about the macports-changes mailing list