Ticket #53330: cxx11-1.1.tcl

File cxx11-1.1.tcl, 3.1 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 8 years ago)
Line 
1# -*- 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
2#
3# Copyright (c) 2015-2017 The MacPorts Project
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. Neither the name of The MacPorts Project nor the names of its
16#    contributors may be used to endorse or promote products derived from
17#    this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30#
31#
32# This PortGroup introduces no new options. Simply including this
33# PortGroup indicates that a port requires C++11
34#
35# Ideally the functionality of this PortGroup should be integrated into
36# MacPorts base as a new option.
37
38PortGroup compiler_blacklist_versions 1.0
39
40# Compilers supporting C++11 are GCC >= 4.6 and clang >= 3.3.
41# We do not know what "cc" is, so blacklist it as well.
42compiler.blacklist-append   {*gcc-3*} {*gcc-4.[0-5]} {clang < 500} cc
43
44if {${cxx_stdlib} eq "libstdc++" || ${cxx_stdlib} eq "macports-libstdc++"} {
45    compiler.blacklist-append   {macports-clang-3.[0-8]} clang
46
47    compiler.whitelist-append   \
48        macports-clang-3.9      \
49        macports-gcc-6          \
50        macports-gcc-5          \
51        macports-gcc-4.9        \
52        macports-gcc-4.8        \
53        macports-gcc-4.7        \
54        macports-gcc-4.6
55
56    # see https://trac.macports.org/ticket/53194
57    configure.cxx_stdlib macports-libstdc++
58
59    if { ${os.major} < 13 } {
60        # prior to OS X Mavericks, libstdc++ was the default C++ runtime, so
61        #    assume MacPorts libstdc++ must be ABI compatable with system libstdc++
62        # for OS X Maverick and above, users must select libstdc++, so
63        #    assume they want default ABI compatibility
64        # see https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/manual/manual/using_dual_abi.html
65        configure.cxxflags-append -D_GLIBCXX_USE_CXX11_ABI=0
66    }
67} else {
68    # GCC compilers can not use libc++
69    compiler.blacklist-append   *gcc*
70}