From owner-svn-src-all@FreeBSD.ORG Fri Jun 19 14:56:26 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99778B0E; Fri, 19 Jun 2015 14:56:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) 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 7AD112E0; Fri, 19 Jun 2015 14:56:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JEuQmK074341; Fri, 19 Jun 2015 14:56:26 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5JEuPDU074336; Fri, 19 Jun 2015 14:56:25 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201506191456.t5JEuPDU074336@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 19 Jun 2015 14:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284598 - head/share/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.20 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: Fri, 19 Jun 2015 14:56:26 -0000 Author: sjg Date: Fri Jun 19 14:56:24 2015 New Revision: 284598 URL: https://svnweb.freebsd.org/changeset/base/284598 Log: Move include of make.conf back to its old position. This means moving include of local.sys.mk and src.sys.mk too. Introduce new includes to take the early slot, for the purpose of being able to influence toolchains and the like. Differential Revision: D2860 Reviewed by: imp Added: head/share/mk/local.sys.env.mk - copied, changed from r284432, head/share/mk/local.sys.mk head/share/mk/src.sys.env.mk - copied, changed from r284432, head/share/mk/src.sys.mk Modified: head/share/mk/local.sys.mk head/share/mk/src.sys.mk head/share/mk/sys.mk Copied and modified: head/share/mk/local.sys.env.mk (from r284432, head/share/mk/local.sys.mk) ============================================================================== --- head/share/mk/local.sys.mk Mon Jun 15 21:20:52 2015 (r284432, copy source) +++ head/share/mk/local.sys.env.mk Fri Jun 19 14:56:24 2015 (r284598) @@ -1,5 +1,7 @@ # $FreeBSD$ +# This makefile is for customizations that should be done early + .if !defined(_TARGETS) # some things we do only once _TARGETS:= ${.TARGETS} @@ -29,28 +31,6 @@ M_whence = ${M_type}:M/*:[1] # convert a path to a valid shell variable M_P2V = tu:C,[./-],_,g -.if ${MK_META_MODE} == "yes" -MAKE_PRINT_VAR_ON_ERROR+= \ - .CURDIR \ - .MAKE \ - .OBJDIR \ - .TARGETS \ - DESTDIR \ - LD_LIBRARY_PATH \ - MACHINE \ - MACHINE_ARCH \ - MAKEOBJDIRPREFIX \ - MAKESYSPATH \ - MAKE_VERSION\ - SRCTOP \ - OBJTOP \ - ${MAKE_PRINT_VAR_ON_ERROR_XTRAS} - -.if ${.MAKE.LEVEL} > 0 -MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH -.endif -.endif - # these are handy # we can use this for a cheap timestamp at the start of a target's script, # but not at the end - since make will expand both at the same time. @@ -60,4 +40,4 @@ TIME_STAMP = ${TIME_STAMP_FMT:localtime} TIME_STAMP_DATE = `date '+${TIME_STAMP_FMT}'` TIME_STAMP_END?= ${TIME_STAMP_DATE} -.include "src.sys.mk" +.include "src.sys.env.mk" Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Fri Jun 19 14:20:21 2015 (r284597) +++ head/share/mk/local.sys.mk Fri Jun 19 14:56:24 2015 (r284598) @@ -1,34 +1,5 @@ # $FreeBSD$ -.if !defined(_TARGETS) -# some things we do only once -_TARGETS:= ${.TARGETS} -.export _TARGETS -.endif - -# some handy macros -_this = ${.PARSEDIR:tA}/${.PARSEFILE} -# some useful modifiers - -# A useful trick for testing multiple :M's against something -# :L says to use the variable's name as its value - ie. literal -# got = ${clean* destroy:${M_ListToMatch:S,V,.TARGETS,}} -M_ListToMatch = L:@m@$${V:M$$m}@ -# match against our initial targets (see above) -M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,} - -# turn a list into a set of :N modifiers -# NskipFoo = ${Foo:${M_ListToSkip}} -M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N, - -# type should be a builtin in any sh since about 1980, -# AUTOCONF := ${autoconf:L:${M_whence}} -M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g -M_whence = ${M_type}:M/*:[1] - -# convert a path to a valid shell variable -M_P2V = tu:C,[./-],_,g - .if ${MK_META_MODE} == "yes" MAKE_PRINT_VAR_ON_ERROR+= \ .CURDIR \ @@ -51,13 +22,4 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFIL .endif .endif -# these are handy -# we can use this for a cheap timestamp at the start of a target's script, -# but not at the end - since make will expand both at the same time. -TIME_STAMP_FMT = @ %s [%Y-%m-%d %T] -TIME_STAMP = ${TIME_STAMP_FMT:localtime} -# this will produce the same output but as of when date(1) is run. -TIME_STAMP_DATE = `date '+${TIME_STAMP_FMT}'` -TIME_STAMP_END?= ${TIME_STAMP_DATE} - .include "src.sys.mk" Copied and modified: head/share/mk/src.sys.env.mk (from r284432, head/share/mk/src.sys.mk) ============================================================================== --- head/share/mk/src.sys.mk Mon Jun 15 21:20:52 2015 (r284432, copy source) +++ head/share/mk/src.sys.env.mk Fri Jun 19 14:56:24 2015 (r284598) @@ -1,19 +1,17 @@ # $FreeBSD$ -# Note: This file is also duplicated in the sys/conf/kern.pre.mk so -# it will always grab SRCCONF, even if it isn't being built in-tree -# to preserve historical (and useful) behavior. Changes here need to -# be reflected there so SRCCONF isn't included multiple times. +# early setup only see also src.sys.mk # make sure this is defined in a consistent manner SRCTOP:= ${.PARSEDIR:tA:H:H} -# Allow user to configure things that only effect src tree builds. -SRCCONF?= /etc/src.conf -.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) -.sinclude "${SRCCONF}" -_srcconf_included_: .NOTMAIN +# site customizations that do not depend on anything! +SRC_ENV_CONF?= /etc/src-env.conf +.if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_) +.-include "${SRC_ENV_CONF}" +_src_env_conf_included_: .NOTMAIN .endif + # If we were found via .../share/mk we need to replace that # with ${.PARSEDIR:tA} so that we can be found by # sub-makes launched from objdir. @@ -24,5 +22,3 @@ _srcconf_included_: .NOTMAIN MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},} .export MAKESYSPATH .endif -# tempting, but bsd.compiler.mk causes problems this early -#.include "src.opts.mk" Modified: head/share/mk/src.sys.mk ============================================================================== --- head/share/mk/src.sys.mk Fri Jun 19 14:20:21 2015 (r284597) +++ head/share/mk/src.sys.mk Fri Jun 19 14:56:24 2015 (r284598) @@ -5,24 +5,13 @@ # to preserve historical (and useful) behavior. Changes here need to # be reflected there so SRCCONF isn't included multiple times. -# make sure this is defined in a consistent manner -SRCTOP:= ${.PARSEDIR:tA:H:H} - # Allow user to configure things that only effect src tree builds. SRCCONF?= /etc/src.conf .if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) .sinclude "${SRCCONF}" _srcconf_included_: .NOTMAIN .endif -# If we were found via .../share/mk we need to replace that -# with ${.PARSEDIR:tA} so that we can be found by -# sub-makes launched from objdir. -.if ${.MAKEFLAGS:M.../share/mk} != "" -.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},} -.endif -.if ${MAKESYSPATH:Uno:M*.../*} != "" -MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},} -.export MAKESYSPATH -.endif + # tempting, but bsd.compiler.mk causes problems this early +# probably need to remove dependence on bsd.own.mk #.include "src.opts.mk" Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Jun 19 14:20:21 2015 (r284597) +++ head/share/mk/sys.mk Fri Jun 19 14:56:24 2015 (r284598) @@ -31,15 +31,9 @@ __DEFAULT_DEPENDENT_OPTIONS= \ .include -# Pull in global settings. -__MAKE_CONF?=/etc/make.conf -.if exists(${__MAKE_CONF}) -.include "${__MAKE_CONF}" -.endif - -# Set any local definitions first. Place this early, but it needs -# MACHINE_CPUARCH to be defined. -.-include +# early include for customization +# see local.sys.mk below +.-include .if ${MK_META_MODE} == "yes" .-include @@ -360,6 +354,14 @@ YFLAGS ?= -d rm -f ${.PREFIX}.tmp.c ${CTFCONVERT_CMD} +# Pull in global settings. +__MAKE_CONF?=/etc/make.conf +.if exists(${__MAKE_CONF}) +.include "${__MAKE_CONF}" +.endif + +# late include for customization +.-include .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) SHELL= ${__MAKE_SHELL}