From owner-svn-src-all@freebsd.org Fri Mar 18 17:27:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 344B2AD5D1D; Fri, 18 Mar 2016 17:27:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 049881159; Fri, 18 Mar 2016 17:27:28 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2IHRSlq020331; Fri, 18 Mar 2016 17:27:28 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IHRQvR020313; Fri, 18 Mar 2016 17:27:26 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201603181727.u2IHRQvR020313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 18 Mar 2016 17:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r297032 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor 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.21 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, 18 Mar 2016 17:27:29 -0000 Author: sjg Date: Fri Mar 18 17:27:26 2016 New Revision: 297032 URL: https://svnweb.freebsd.org/changeset/base/297032 Log: Import bmake-20160315 Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/meta.autodep.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/sys.dependfile.mk vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/suff.c vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/ChangeLog Fri Mar 18 17:27:26 2016 (r297032) @@ -1,3 +1,20 @@ +2016-03-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160315 + Merge with NetBSD make, pick up + o fix handling of archive members + +2016-03-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): rename variable to avoid interference + with checks for ${MAKE_VERSION} + +2016-03-10 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160310 + Merge with NetBSD make, pick up + o meta.c: treat missing Read file same as Write, incase we Delete it. + 2016-03-07 Simon J. Gerraty * Makefile (MAKE_VERSION): 20160307 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/Makefile Fri Mar 18 17:27:26 2016 (r297032) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.55 2016/03/07 22:02:47 sjg Exp $ +# $Id: Makefile,v 1.58 2016/03/15 23:39:12 sjg Exp $ # Base version on src date -MAKE_VERSION= 20160307 +_MAKE_VERSION= 20160315 PROG= bmake @@ -76,7 +76,7 @@ CFLAGS+= ${CPPFLAGS} CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} -COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" +COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" # meta mode can be useful even without filemon FILEMON_H ?= /usr/include/dev/filemon/filemon.h Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/bmake.1 Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.254 2016/02/20 01:43:28 wiz Exp $ +.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -685,6 +685,9 @@ or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . +For compatibility with other makes this is an alias for +.Ic .ARCHIVE +in archive member rules. .El .Pp The shorter forms Modified: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Fri Mar 18 17:27:26 2016 (r297032) @@ -438,7 +438,9 @@ VVAARRIIAABBLLEE AASSSSIIGG suffixes declared with ..SSUUFFFFIIXXEESS or it will not be recog- nized. - _._T_A_R_G_E_T The name of the target; also known as `_@'. + _._T_A_R_G_E_T The name of the target; also known as `_@'. For compati- + bility with other makes this is an alias for ..AARRCCHHIIVVEE in + archive member rules. The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted for backward compatibility with historical makefiles and legacy POSIX Modified: vendor/NetBSD/bmake/dist/make.1 ============================================================================== --- vendor/NetBSD/bmake/dist/make.1 Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/make.1 Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.254 2016/02/20 01:43:28 wiz Exp $ +.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -685,6 +685,9 @@ or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . +For compatibility with other makes this is an alias for +.Ic .ARCHIVE +in archive member rules. .El .Pp The shorter forms Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/meta.c Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.53 2016/03/07 21:45:43 christos Exp $ */ +/* $NetBSD: meta.c,v 1.54 2016/03/11 07:01:21 sjg Exp $ */ /* * Implement 'meta' mode. @@ -1190,7 +1190,8 @@ meta_oodate(GNode *gn, Boolean oodate) if ((link_src != NULL && lstat(p, &fs) < 0) || (link_src == NULL && stat(p, &fs) < 0)) { - Lst_AtEnd(missingFiles, bmake_strdup(p)); + if (Lst_Find(missingFiles, p, string_match) == NULL) + Lst_AtEnd(missingFiles, bmake_strdup(p)); } break; check_link_src: @@ -1281,9 +1282,8 @@ meta_oodate(GNode *gn, Boolean oodate) * A referenced file outside of CWD is missing. * We cannot catch every eventuality here... */ - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: file '%s' may have moved?...\n", fname, lineno, p); - oodate = TRUE; + if (Lst_Find(missingFiles, p, string_match) == NULL) + Lst_AtEnd(missingFiles, bmake_strdup(p)); } } if (buf[0] == 'E') { Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Fri Mar 18 17:27:26 2016 (r297032) @@ -1,3 +1,26 @@ +2016-03-15 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160315 + + * meta.stage.mk (LN_CP_SCRIPT): do not ln(1) if we have to chmod(1) + normally only applies to scripts. + + * dirdeps.mk: NO_DIRDEPS_BELOW to supress DIRDEPS below RELDIR as + well as outside it. + +2016-03-10 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160310 + + * dirdeps.mk: use targets rather than a list to track DIRDEPS that + we have processed; the list gets very inefficient as number of + DIRDEPS gets large. + + * sys.dependfile.mk: fix comment wrt MACHINE + + * meta.autodep.mk: ignore staged DPADDs when bootstrapping. + patch from Bryan Drewery + 2016-03-02 Simon J. Gerraty * meta2deps.sh: don't ignore subdirs. Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.59 2016/02/26 23:32:29 sjg Exp $ +# $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -135,7 +135,6 @@ start_utc := ${now_utc} # make sure these are empty to start with _DEP_TARGET_SPEC = -_DIRDEP_CHECKED = # If TARGET_SPEC_VARS is other than just MACHINE # it should be set by sys.mk or similar by now. @@ -225,7 +224,7 @@ _DEP_TARGET_SPEC = ${_last_dependfile:${ .endif .if !empty(_last_dependfile) # record that we've read dependfile for this -_DIRDEP_CHECKED += ${_CURDIR}.${TARGET_SPEC} +_dirdeps_checked.${_CURDIR}.${TARGET_SPEC}: .endif .endif @@ -306,8 +305,10 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} .if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) -# confine ourselves to the original dir +# confine ourselves to the original dir and below. DIRDEPS_FILTER += M${_DEP_RELDIR}* +.elif defined(NO_DIRDEPS_BELOW) +DIRDEPS_FILTER += M${_DEP_RELDIR} .endif # this is what we run below @@ -597,9 +598,9 @@ ${_this_dir}.$m: ${_build_dirs:M*.$m:N${ # Now find more dependencies - and recurse. .for d in ${_build_all_dirs} -.if ${_DIRDEP_CHECKED:M$d} == "" +.if !target(_dirdeps_checked.$d) # once only -_DIRDEP_CHECKED += $d +_dirdeps_checked.$d: .if ${_debug_search} .info checking $d .endif Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/mk/install-mk Fri Mar 18 17:27:26 2016 (r297032) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.121 2016/02/27 00:23:02 sjg Exp $ +# $Id: install-mk,v 1.123 2016/03/16 00:13:16 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20160226 +MK_VERSION=20160315 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/meta.autodep.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.40 2016/02/22 22:44:58 sjg Exp $ +# $Id: meta.autodep.mk,v 1.41 2016/03/11 01:29:38 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -195,7 +195,7 @@ gendirdeps: ${_DEPENDFILE} # The pseudo machine "host" is used for HOST_TARGET DIRDEPS += \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ - ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} + ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:N${STAGE_ROOT:U${_OBJTOP}}/*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} .endif .endif Modified: vendor/NetBSD/bmake/dist/mk/meta.stage.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.stage.mk Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/mk/meta.stage.mk Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.43 2016/02/24 18:46:32 sjg Exp $ +# $Id: meta.stage.mk,v 1.44 2016/03/16 18:21:23 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -58,7 +58,7 @@ GENDIRDEPS_FILTER += Nnot-empty-is-impor LN_CP_SCRIPT = LnCp() { \ rm -f $$2 2> /dev/null; \ - ln $$1 $$2 2> /dev/null || \ + { [ -z "$$mode" ] && ln $$1 $$2 2> /dev/null; } || \ cp -p $$1 $$2; } # a staging conflict should cause an error Modified: vendor/NetBSD/bmake/dist/mk/sys.dependfile.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys.dependfile.mk Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/mk/sys.dependfile.mk Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -# $Id: sys.dependfile.mk,v 1.7 2016/02/20 01:57:39 sjg Exp $ +# $Id: sys.dependfile.mk,v 1.8 2016/03/11 01:34:13 sjg Exp $ # # @(#) Copyright (c) 2012, Simon J. Gerraty # @@ -48,7 +48,7 @@ _e := ${.MAKE.DEPENDFILE_PREFERENCE:@m@$ # MACHINE specific depend files are supported, but *not* default. # If any already exist, we should follow suit. _aml = ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MACHINE} -# MACHINE must be the last entry in _aml ;-) +# make sure we restore MACHINE _m := ${MACHINE} _e := ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}@} MACHINE := ${_m} Modified: vendor/NetBSD/bmake/dist/parse.c ============================================================================== --- vendor/NetBSD/bmake/dist/parse.c Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/parse.c Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $"); #endif #endif /* not lint */ #endif @@ -1261,6 +1261,7 @@ ParseDoDependency(char *line) goto out; } else { /* Done with this word; on to the next. */ + cp = line; continue; } } Modified: vendor/NetBSD/bmake/dist/suff.c ============================================================================== --- vendor/NetBSD/bmake/dist/suff.c Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/suff.c Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"); #endif #endif /* not lint */ #endif @@ -1894,6 +1894,7 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) TARGET, /* Must be first */ PREFIX, /* Must be second */ }; + LstNode ln, nln; /* Next suffix node to check */ int i; /* Index into copy and vals */ Suff *ms; /* Suffix descriptor for member */ char *name; /* Start of member's name */ @@ -1955,6 +1956,20 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) Var_Set(MEMBER, name, gn, 0); Var_Set(ARCHIVE, gn->name, gn, 0); + /* + * Set $@ for compatibility with other makes + */ + Var_Set(TARGET, gn->name, gn, 0); + + /* + * Now we've got the important local variables set, expand any sources + * that still contain variables or wildcards in their names. + */ + for (ln = Lst_First(gn->children); ln != NULL; ln = nln) { + nln = Lst_Succ(ln); + SuffExpandChildren(ln, gn); + } + if (ms != NULL) { /* * Member has a known suffix, so look for a transformation rule from @@ -1962,7 +1977,6 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) * through the entire list, we just look at suffixes to which the * member's suffix may be transformed... */ - LstNode ln; SuffixCmpData sd; /* Search string data */ /* @@ -2002,9 +2016,10 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) /* * Flag the member as such so we remember to look in the archive for - * its modification time. + * its modification time. The OP_JOIN | OP_MADE is needed because this + * target should never get made. */ - mem->type |= OP_MEMBER; + mem->type |= OP_MEMBER | OP_JOIN | OP_MADE; } /*- Modified: vendor/NetBSD/bmake/dist/var.c ============================================================================== --- vendor/NetBSD/bmake/dist/var.c Fri Mar 18 17:27:05 2016 (r297031) +++ vendor/NetBSD/bmake/dist/var.c Fri Mar 18 17:27:26 2016 (r297032) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $ */ +/* $NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $"); +__RCSID("$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"); #endif #endif /* not lint */ #endif @@ -3699,11 +3699,11 @@ Var_Parse(const char *str, GNode *ctxt, case '@': return UNCONST("$(.TARGET)"); case '%': - return UNCONST("$(.ARCHIVE)"); + return UNCONST("$(.MEMBER)"); case '*': return UNCONST("$(.PREFIX)"); case '!': - return UNCONST("$(.MEMBER)"); + return UNCONST("$(.ARCHIVE)"); } } /*