[110369] trunk/base/src

jeremyhu at macports.org jeremyhu at macports.org
Fri Aug 30 11:41:03 PDT 2013


Revision: 110369
          https://trac.macports.org/changeset/110369
Author:   jeremyhu at macports.org
Date:     2013-08-30 11:41:03 -0700 (Fri, 30 Aug 2013)
Log Message:
-----------
Add support for setting cxx_stdlib in macports.conf

This will be added to configure.cxxflags -stdlib=${cxx_stdlib} when the C++
compiler is clang.  This is a developer option to aide in testing ports with
libc++.  Please do not file bug reports when using this option unless you
are also providing a fix for the problem being reported.

It is reccomended that you reinstall all ports from source when changing this
option (make sure you set buildfromsource always).

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

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2013-08-30 18:35:40 UTC (rev 110368)
+++ trunk/base/src/macports1.0/macports.tcl	2013-08-30 18:41:03 UTC (rev 110369)
@@ -49,7 +49,7 @@
         macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip \
         master_site_local patch_site_local archive_site_local buildfromsource \
         revupgrade_autorun revupgrade_mode revupgrade_check_id_loadcmds \
-        host_blacklist preferred_hosts sandbox_enable delete_la_files \
+        host_blacklist preferred_hosts sandbox_enable delete_la_files cxx_stdlib \
         packagemaker_path default_compilers pkg_post_unarchive_deletions"
     variable user_options {}
     variable portinterp_options "\
@@ -60,7 +60,7 @@
         configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
         applications_dir current_phase frameworks_dir developer_dir universal_archs build_arch \
         os_arch os_endian os_version os_major os_platform macosx_version macosx_deployment_target \
-        packagemaker_path default_compilers sandbox_enable delete_la_files \
+        packagemaker_path default_compilers sandbox_enable delete_la_files cxx_stdlib \
         pkg_post_unarchive_deletions $user_options"
 
     # deferred options are only computed when needed.
@@ -580,7 +580,8 @@
         macports::ping_cache \
         macports::host_blacklisted \
         macports::host_preferred \
-        macports::delete_la_files
+        macports::delete_la_files \
+        macports::cxx_stdlib
 
     # Set the system encoding to utf-8
     encoding system utf-8
@@ -963,6 +964,13 @@
             set macports::delete_la_files no
         }
     }
+    if {![info exists macports::cxx_stdlib]} {
+        if {$os_platform eq "darwin" && $os_major < 13} {
+            set macports::cxx_stdlib libstdc++
+        } else {
+            set macports::cxx_stdlib {}
+        }
+    }
     if {![info exists macports::global_options(ports_rev-upgrade_id-loadcmd-check)]
          && [info exists macports::revupgrade_check_id_loadcmds]} {
         set macports::global_options(ports_rev-upgrade_id-loadcmd-check) $macports::revupgrade_check_id_loadcmds

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2013-08-30 18:35:40 UTC (rev 110368)
+++ trunk/base/src/port1.0/portconfigure.tcl	2013-08-30 18:41:03 UTC (rev 110369)
@@ -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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130830/dc04d778/attachment.html>


More information about the macports-changes mailing list