[135656] trunk/dports/_resources/port1.0/group/cxx11-1.0.tcl

ionic at macports.org ionic at macports.org
Tue Apr 28 21:31:27 PDT 2015


Revision: 135656
          https://trac.macports.org/changeset/135656
Author:   ionic at macports.org
Date:     2015-04-28 21:31:27 -0700 (Tue, 28 Apr 2015)
Log Message:
-----------
cxx11-1.0: new PortGroup.

Added Paths:
-----------
    trunk/dports/_resources/port1.0/group/cxx11-1.0.tcl

Added: trunk/dports/_resources/port1.0/group/cxx11-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/cxx11-1.0.tcl	                        (rev 0)
+++ trunk/dports/_resources/port1.0/group/cxx11-1.0.tcl	2015-04-29 04:31:27 UTC (rev 135656)
@@ -0,0 +1,61 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+#
+# Copyright (c) 2015 The MacPorts Project
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of The MacPorts Project nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+# This PortGroup implements the "cxx11" option, which lets ports
+# specify that they require C++11 support.
+# We only support C++11 with libc++.
+#
+# Ideally the cxx11 option should be integrated into MacPorts base
+# instead of being a PortGroup.
+
+PortGroup compiler_blacklist_versions 1.0
+
+# Compilers supporting C++11 are GCC >= 4.6 and clang >= 3.3.
+# As we only support libc++, clang is implicitly required.
+# Blacklist all GCC compilers to not accidentally pull in libstdc++.
+# We do not know what "cc" is, so blacklist it as well.
+compiler.blacklist-append   {*gcc*} {clang < 500} macports-clang-2.* \
+                            {macports-clang-3.[0-2]} cc
+
+pre-configure {
+    if {${configure.cxx_stdlib} eq "libstdc++"} {
+        ui_error "${subport} does not support your selected MacPorts C++ runtime. libc++ must be selected and C++-based ports built against it."
+
+        if {${os.major} < 13} {
+            ui_error "Please follow the instructions on https://trac.macports.org/wiki/LibcxxOnOlderSystems."
+            ui_error "After adding the required options to macports.conf, essentially reinstall all ports like you would when switching OS X versions."
+            ui_error "Follow step 3 on https://trac.macports.org/wiki/Migration in order to do this."
+        }
+
+        return -code error "libstdc++ unsupported."
+    }
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150428/07fc9a5d/attachment.html>


More information about the macports-changes mailing list