From owner-svn-src-stable@FreeBSD.ORG Fri Jul 25 23:21:37 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDE7113F; Fri, 25 Jul 2014 23:21:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A04292A0D; Fri, 25 Jul 2014 23:21:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PNLbE6035848; Fri, 25 Jul 2014 23:21:37 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PNLbJb035843; Fri, 25 Jul 2014 23:21:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407252321.s6PNLbJb035843@svn.freebsd.org> From: Ian Lepore Date: Fri, 25 Jul 2014 23:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269102 - in stable/10/share: examples/etc mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2014 23:21:37 -0000 Author: ian Date: Fri Jul 25 23:21:36 2014 New Revision: 269102 URL: http://svnweb.freebsd.org/changeset/base/269102 Log: MFC r263373, r268402 Add a way to apply CFLAGS only when building the given architecture. This is useful primarily on a system used for cross-building, when you have a set of flags to apply to the TARGET_ARCH being cross-built but don't want those settings applied to building the cross-tools or other components that run on the build host machine. Support CXXFLAGS.${MACHINE_ARCH} as well as CFLAGS. This allows different C++ options for toolchain versus target when cross-building. Modified: stable/10/share/examples/etc/make.conf stable/10/share/mk/bsd.cpu.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/etc/make.conf ============================================================================== --- stable/10/share/examples/etc/make.conf Fri Jul 25 23:12:22 2014 (r269101) +++ stable/10/share/examples/etc/make.conf Fri Jul 25 23:21:36 2014 (r269102) @@ -60,6 +60,12 @@ # nonstandard optimization settings # before submitting bug reports without patches to the developers. # +# CFLAGS.arch provides a mechanism for applying CFLAGS only when building +# the given architecture. This is useful primarily on a system used for +# cross-building, when you have a set of flags to apply to the TARGET_ARCH +# being cross-built but don't want those settings applied to building the +# cross-tools or other components that run on the build host machine. +# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" @@ -71,6 +77,7 @@ # # CFLAGS+= -msse3 # CXXFLAGS+= -msse3 +# CFLAGS.armv6+= -mfloat-abi=softfp # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and Modified: stable/10/share/mk/bsd.cpu.mk ============================================================================== --- stable/10/share/mk/bsd.cpu.mk Fri Jul 25 23:12:22 2014 (r269101) +++ stable/10/share/mk/bsd.cpu.mk Fri Jul 25 23:21:36 2014 (r269102) @@ -262,3 +262,8 @@ CFLAGS += -G0 .if !defined(NO_CPU_CFLAGS) CFLAGS += ${_CPUCFLAGS} .endif + +# Add in any architecture-specific CFLAGS. +# These come from make.conf or the command line or the environment. +CFLAGS += ${CFLAGS.${MACHINE_ARCH}} +CXXFLAGS += ${CXXFLAGS.${MACHINE_ARCH}}