aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2016-03-18 20:03:09 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2016-03-18 20:03:09 +0000
commit3bebe7293bdcec4fe234f552e4223e07f34c4613 (patch)
tree441a6072996940eb112c1cbfdd9f818d1781c000 /contrib
parent4a5202f9c4e3a2e810b5ac5f87f87518ff56c6a5 (diff)
parentb7ff84ad756783ecadb3ce2c732c71c4c7d8e1f7 (diff)
downloadsrc-3bebe7293bdcec4fe234f552e4223e07f34c4613.tar.gz
src-3bebe7293bdcec4fe234f552e4223e07f34c4613.zip
Update to bmake-20160315
Archive member handling works again meta mode, treat missing reads as for writes. Update dirdeps.mk - much improved startup time. Update meta.stage.mk - avoid ln when chmod required.
Notes
Notes: svn path=/head/; revision=297040
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bmake/ChangeLog17
-rw-r--r--contrib/bmake/Makefile6
-rw-r--r--contrib/bmake/bmake.15
-rw-r--r--contrib/bmake/bmake.cat14
-rw-r--r--contrib/bmake/make.15
-rw-r--r--contrib/bmake/meta.c10
-rw-r--r--contrib/bmake/mk/ChangeLog23
-rw-r--r--contrib/bmake/mk/dirdeps.mk13
-rw-r--r--contrib/bmake/mk/install-mk4
-rw-r--r--contrib/bmake/mk/meta.autodep.mk4
-rw-r--r--contrib/bmake/mk/meta.stage.mk4
-rw-r--r--contrib/bmake/mk/sys.dependfile.mk4
-rw-r--r--contrib/bmake/parse.c7
-rw-r--r--contrib/bmake/suff.c27
-rw-r--r--contrib/bmake/var.c10
15 files changed, 104 insertions, 39 deletions
diff --git a/contrib/bmake/ChangeLog b/contrib/bmake/ChangeLog
index 78b5a7eedfdd..6f47f1af305e 100644
--- a/contrib/bmake/ChangeLog
+++ b/contrib/bmake/ChangeLog
@@ -1,3 +1,20 @@
+2016-03-15 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile (_MAKE_VERSION): 20160315
+ Merge with NetBSD make, pick up
+ o fix handling of archive members
+
+2016-03-13 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile (_MAKE_VERSION): rename variable to avoid interference
+ with checks for ${MAKE_VERSION}
+
+2016-03-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * 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 <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20160307
diff --git a/contrib/bmake/Makefile b/contrib/bmake/Makefile
index 730e15d27c51..87f6254b07e5 100644
--- a/contrib/bmake/Makefile
+++ b/contrib/bmake/Makefile
@@ -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
diff --git a/contrib/bmake/bmake.1 b/contrib/bmake/bmake.1
index 603481e9d08c..915963cd0476 100644
--- a/contrib/bmake/bmake.1
+++ b/contrib/bmake/bmake.1
@@ -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
diff --git a/contrib/bmake/bmake.cat1 b/contrib/bmake/bmake.cat1
index b6159a8dcfe8..091bdd48883e 100644
--- a/contrib/bmake/bmake.cat1
+++ b/contrib/bmake/bmake.cat1
@@ -438,7 +438,9 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
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
diff --git a/contrib/bmake/make.1 b/contrib/bmake/make.1
index ecece486e74f..07b23207f022 100644
--- a/contrib/bmake/make.1
+++ b/contrib/bmake/make.1
@@ -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
diff --git a/contrib/bmake/meta.c b/contrib/bmake/meta.c
index f4acbde937ee..4faf83638eb7 100644
--- a/contrib/bmake/meta.c
+++ b/contrib/bmake/meta.c
@@ -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') {
diff --git a/contrib/bmake/mk/ChangeLog b/contrib/bmake/mk/ChangeLog
index f84b5c5040e9..50d6719bdeab 100644
--- a/contrib/bmake/mk/ChangeLog
+++ b/contrib/bmake/mk/ChangeLog
@@ -1,3 +1,26 @@
+2016-03-15 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * 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 <sjg@bad.crufty.net>
+
+ * 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 <sjg@bad.crufty.net>
* meta2deps.sh: don't ignore subdirs.
diff --git a/contrib/bmake/mk/dirdeps.mk b/contrib/bmake/mk/dirdeps.mk
index ec37e35dfa54..c2350765c4a3 100644
--- a/contrib/bmake/mk/dirdeps.mk
+++ b/contrib/bmake/mk/dirdeps.mk
@@ -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:${M_dep_qual_fixes:ts:}:E}
.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${_this_dir}.$m}
# 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
diff --git a/contrib/bmake/mk/install-mk b/contrib/bmake/mk/install-mk
index 64b238fd8356..307660954574 100644
--- a/contrib/bmake/mk/install-mk
+++ b/contrib/bmake/mk/install-mk
@@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# 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
diff --git a/contrib/bmake/mk/meta.autodep.mk b/contrib/bmake/mk/meta.autodep.mk
index 5f705647efe1..831e89f02259 100644
--- a/contrib/bmake/mk/meta.autodep.mk
+++ b/contrib/bmake/mk/meta.autodep.mk
@@ -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
diff --git a/contrib/bmake/mk/meta.stage.mk b/contrib/bmake/mk/meta.stage.mk
index 0355d66af041..c6c72274789c 100644
--- a/contrib/bmake/mk/meta.stage.mk
+++ b/contrib/bmake/mk/meta.stage.mk
@@ -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-important \
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
diff --git a/contrib/bmake/mk/sys.dependfile.mk b/contrib/bmake/mk/sys.dependfile.mk
index b4d79f7e11e8..5389c24fd1bb 100644
--- a/contrib/bmake/mk/sys.dependfile.mk
+++ b/contrib/bmake/mk/sys.dependfile.mk
@@ -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@${exists($m):?$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}
diff --git a/contrib/bmake/parse.c b/contrib/bmake/parse.c
index 2a22c0b60695..03275e2c5085 100644
--- a/contrib/bmake/parse.c
+++ b/contrib/bmake/parse.c
@@ -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 <sys/cdefs.h>
#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;
}
}
diff --git a/contrib/bmake/suff.c b/contrib/bmake/suff.c
index 98bd44734872..97f745b07e47 100644
--- a/contrib/bmake/suff.c
+++ b/contrib/bmake/suff.c
@@ -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 <sys/cdefs.h>
#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;
}
/*-
diff --git a/contrib/bmake/var.c b/contrib/bmake/var.c
index 36ba6de678db..98b868a68e4e 100644
--- a/contrib/bmake/var.c
+++ b/contrib/bmake/var.c
@@ -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 <sys/cdefs.h>
#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, int flags,
case '@':
return UNCONST("$(.TARGET)");
case '%':
- return UNCONST("$(.ARCHIVE)");
+ return UNCONST("$(.MEMBER)");
case '*':
return UNCONST("$(.PREFIX)");
case '!':
- return UNCONST("$(.MEMBER)");
+ return UNCONST("$(.ARCHIVE)");
}
}
/*