From owner-svn-src-all@FreeBSD.ORG Wed Mar 19 18:54:54 2014 Return-Path: Delivered-To: svn-src-all@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 74F256AA; Wed, 19 Mar 2014 18:54:54 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46964E88; Wed, 19 Mar 2014 18:54:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JIssia083889; Wed, 19 Mar 2014 18:54:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JIsrNG083887; Wed, 19 Mar 2014 18:54:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403191854.s2JIsrNG083887@svn.freebsd.org> From: Ian Lepore Date: Wed, 19 Mar 2014 18:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263373 - in head/share: examples/etc mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 18:54:54 -0000 Author: ian Date: Wed Mar 19 18:54:53 2014 New Revision: 263373 URL: http://svnweb.freebsd.org/changeset/base/263373 Log: 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. Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Wed Mar 19 17:53:09 2014 (r263372) +++ head/share/examples/etc/make.conf Wed Mar 19 18:54:53 2014 (r263373) @@ -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: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Mar 19 17:53:09 2014 (r263372) +++ head/share/mk/bsd.cpu.mk Wed Mar 19 18:54:53 2014 (r263373) @@ -260,3 +260,7 @@ 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}}