From owner-svn-src-head@FreeBSD.ORG Wed Sep 26 17:25:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1CE31065674; Wed, 26 Sep 2012 17:25:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A48238FC19; Wed, 26 Sep 2012 17:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8QHPFA6064386; Wed, 26 Sep 2012 17:25:15 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8QHPFWO064383; Wed, 26 Sep 2012 17:25:15 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201209261725.q8QHPFWO064383@svn.freebsd.org> From: Brooks Davis Date: Wed, 26 Sep 2012 17:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240966 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2012 17:25:15 -0000 Author: brooks Date: Wed Sep 26 17:25:15 2012 New Revision: 240966 URL: http://svn.freebsd.org/changeset/base/240966 Log: 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: head/share/mk/bsd.compiler.mk head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Sep 26 16:46:44 2012 (r240965) +++ head/share/mk/bsd.compiler.mk Wed Sep 26 17:25:15 2012 (r240966) @@ -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: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Sep 26 16:46:44 2012 (r240965) +++ head/share/mk/bsd.own.mk Wed Sep 26 17:25:15 2012 (r240966) @@ -432,7 +432,6 @@ __DEFAULT_NO_OPTIONS = \ ICONV \ IDEA \ INSTALL_AS_USER \ - LIBCPLUSPLUS \ NAND \ OFED \ SHARED_TOOLCHAIN @@ -642,6 +641,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(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300