From owner-svn-src-stable-9@FreeBSD.ORG Thu Jul 11 20:09:47 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4EBAE6A3; Thu, 11 Jul 2013 20:09:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 261991222; Thu, 11 Jul 2013 20:09:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BK9l7x003675; Thu, 11 Jul 2013 20:09:47 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BK9kD0003673; Thu, 11 Jul 2013 20:09:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307112009.r6BK9kD0003673@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Jul 2013 20:09:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253220 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jul 2013 20:09:47 -0000 Author: dim Date: Thu Jul 11 20:09:46 2013 New Revision: 253220 URL: http://svnweb.freebsd.org/changeset/base/253220 Log: MFC r240966 (by brooks) Add a COMPILER_FEATURES variable that is set in bsd.compiler.mk. When the compiler is clang add c++11 to COMPILER_FEATURES. When the compiler supports c++11, default to building libc++. This will not impact the compliation of programs, but will make it easier for users with clang compiled systems to test libc++ by passing -stdlib=libc++ to their c++ compliations. Modified: stable/9/share/mk/bsd.compiler.mk stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/share/ (props changed) stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.compiler.mk ============================================================================== --- stable/9/share/mk/bsd.compiler.mk Thu Jul 11 19:34:16 2013 (r253219) +++ stable/9/share/mk/bsd.compiler.mk Thu Jul 11 20:09:46 2013 (r253220) @@ -19,3 +19,9 @@ COMPILER_TYPE:= clang . undef _COMPILER_VERSION . endif .endif + +.if ${COMPILER_TYPE} == "clang" +COMPILER_FEATURES= c++11 +.else +COMPILER_FEATURES= +.endif Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Thu Jul 11 19:34:16 2013 (r253219) +++ stable/9/share/mk/bsd.own.mk Thu Jul 11 20:09:46 2013 (r253220) @@ -447,7 +447,6 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ ICONV \ IDEA \ - LIBCPLUSPLUS \ NMTREE \ OFED \ OPENSSH_NONE_CIPHER \ @@ -603,10 +602,6 @@ MK_CLANG_FULL:= no MK_CLANG_IS_CC:= no .endif -MK_LIBCPLUSPLUS?= no - -MK_LIBCPLUSPLUS?= no - # # Set defaults for the MK_*_SUPPORT variables. # @@ -660,6 +655,33 @@ MK_${vv:H}:= ${MK_${vv:T}} .endif .endfor +# +# MK_* options that default to "yes" if the compiler is a C++11 compiler. +# +.include +.for var in \ + LIBCPLUSPLUS +.if defined(WITH_${var}) && defined(WITHOUT_${var}) +.error WITH_${var} and WITHOUT_${var} can't both be set. +.endif +.if defined(MK_${var}) +.error MK_${var} can't be set by a user. +.endif +.if ${COMPILER_FEATURES:Mc++11} +.if defined(WITHOUT_${var}) +MK_${var}:= no +.else +MK_${var}:= yes +.endif +.else +.if defined(WITH_${var}) +MK_${var}:= yes +.else +MK_${var}:= no +.endif +.endif +.endfor + .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .elif defined(.PARSEDIR) || ${MAKE_VERSION} >= 9201210220