Author: sjg
Date: Sun Dec 23 01:05:52 2018
New Revision: 342376
URL: https://svnweb.freebsd.org/changeset/base/342376

Log:
  Merge bmake-20181221

Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/VERSION
  head/contrib/bmake/dirname.c
  head/contrib/bmake/mk/mk-files.txt
  head/contrib/bmake/parse.c
  head/contrib/bmake/unit-tests/varquote.mk
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile.config
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==============================================================================
--- head/contrib/bmake/ChangeLog        Sat Dec 22 22:59:11 2018        
(r342375)
+++ head/contrib/bmake/ChangeLog        Sun Dec 23 01:05:52 2018        
(r342376)
@@ -1,3 +1,26 @@
+2018-12-21  Simon J Gerraty  <s...@beast.crufty.net>
+
+       * VERSION: 20181221
+         Merge with NetBSD make, pick up
+         o parse.c: ParseVErrorInternal use .PARSEDIR
+           and apply if relative, and then use .PARSEFILE
+           for consistent result.
+
+2018-12-20  Simon J Gerraty  <s...@beast.crufty.net>
+
+       * VERSION: 20181220
+         Merge with NetBSD make, pick up
+         o parse.c: ParseVErrorInternal use .CURDIR if .PARSEDIR
+           is relative
+         o var.c: avoid SEGFAULT in .unexport-env
+           when MAKELEVEL is not set
+
+2018-12-16  Simon J Gerraty  <s...@beast.crufty.net>
+
+       * VERSION: 20181216
+         Merge with NetBSD make, pick up
+         o fix for unit-tests/varquote.mk on Debian
+
 2018-09-21  Simon J. Gerraty  <s...@bad.crufty.net>
 
        * VERSION: 20180919

Modified: head/contrib/bmake/VERSION
==============================================================================
--- head/contrib/bmake/VERSION  Sat Dec 22 22:59:11 2018        (r342375)
+++ head/contrib/bmake/VERSION  Sun Dec 23 01:05:52 2018        (r342376)
@@ -1,2 +1,2 @@
 # keep this compatible with sh and make
-_MAKE_VERSION=20180919
+_MAKE_VERSION=20181221

Modified: head/contrib/bmake/dirname.c
==============================================================================
--- head/contrib/bmake/dirname.c        Sat Dec 22 22:59:11 2018        
(r342375)
+++ head/contrib/bmake/dirname.c        Sun Dec 23 01:05:52 2018        
(r342376)
@@ -1,4 +1,4 @@
-/*     $NetBSD: dirname.c,v 1.13 2014/07/16 10:52:26 christos Exp $    */
+/*     $NetBSD: dirname.c,v 1.14 2018/09/27 00:45:34 kre Exp $ */
 
 /*-
  * Copyright (c) 1997, 2002 The NetBSD Foundation, Inc.
@@ -35,6 +35,11 @@
 #ifndef HAVE_DIRNAME
 
 #include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: dirname.c,v 1.14 2018/09/27 00:45:34 kre Exp $");
+#endif /* !LIBC_SCCS && !lint */
+
+#include "namespace.h"
 #include <sys/param.h>
 #ifdef HAVE_LIBGEN_H
 #include <libgen.h>
@@ -92,7 +97,8 @@ xdirname_r(const char *path, char *buf, size_t buflen)
 out:
        if (buf != NULL && buflen != 0) {
                buflen = MIN(len, buflen - 1);
-               memcpy(buf, path, buflen);
+               if (buf != path)
+                       memcpy(buf, path, buflen);
                buf[buflen] = '\0';
        }
        return len;

Modified: head/contrib/bmake/mk/mk-files.txt
==============================================================================
--- head/contrib/bmake/mk/mk-files.txt  Sat Dec 22 22:59:11 2018        
(r342375)
+++ head/contrib/bmake/mk/mk-files.txt  Sun Dec 23 01:05:52 2018        
(r342376)
@@ -25,7 +25,8 @@ of mk-files (mk.tar.gz_).  NetBSD provided much of the
 
 Since then I've added a lot of features to NetBSD's make and hence to
 bmake which is kept closely in sync.  The mk-files however have 
-diverged quite a bit, though ideas are still picked up from NetBSD.
+diverged quite a bit, though ideas are still picked up from NetBSD
+and FreeBSD.
 
 Basics
 ------
@@ -399,6 +400,20 @@ to avoid possible conflicts during parallel builds.  
 This precludes the use of suffix rules to drive ``make depend``, so 
 dep.mk_ handles that if specifically requested.
 
+options.mk
+----------
+
+Inspired by FreeBSD's ``bsd.own.mk`` more flexible.
+FreeBSD now have similar functionality in ``bsd.mkopt.mk``.
+
+It allows users to express their intent with respect to options
+``MK_*`` by setting ``WITH_*`` or ``WITHOUT_*``.
+
+Note: ``WITHOUT_*`` wins if both are set, and makefiles can set
+``NO_*`` to say they cannot handle that option, or even ``MK_*`` if
+they really need to.
+
+
 own.mk
 ------
 
@@ -407,6 +422,13 @@ Normally included by ``init.mk`` (included by ``lib.mk
 
 It includes ``${MAKECONF}`` if it is defined and exists.
 
+ldorder.mk
+----------
+
+Leverages ``bmake`` to compute optimal link order for libraries.
+This works nicely and makes refactoring a breeze - so long as you
+have not (or few) cicular dependencies between libraries.
+
 man.mk
 ------
 
@@ -477,5 +499,5 @@ where you unpacked the tar file, you can::
 .. _mk.tar.gz: http://www.crufty.net/ftp/pub/sjg/mk.tar.gz
 
 :Author: s...@crufty.net
-:Revision: $Id: mk-files.txt,v 1.16 2014/09/05 04:41:16 sjg Exp $
+:Revision: $Id: mk-files.txt,v 1.18 2018/12/08 07:27:15 sjg Exp $
 :Copyright: Crufty.NET

Modified: head/contrib/bmake/parse.c
==============================================================================
--- head/contrib/bmake/parse.c  Sat Dec 22 22:59:11 2018        (r342375)
+++ head/contrib/bmake/parse.c  Sun Dec 23 01:05:52 2018        (r342376)
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $     */
+/*     $NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos 
Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg 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.229 2018/04/05 16:31:54 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -691,21 +691,32 @@ ParseVErrorInternal(FILE *f, const char *cfname, size_
        if (cfname != NULL) {
                (void)fprintf(f, "\"");
                if (*cfname != '/' && strcmp(cfname, "(stdin)") != 0) {
-                       char *cp;
-                       const char *dir;
+                       char *cp, *cp2;
+                       const char *dir, *fname;
 
                        /*
                         * Nothing is more annoying than not knowing
-                        * which Makefile is the culprit.
+                        * which Makefile is the culprit; we try ${.PARSEDIR}
+                        * and apply realpath(3) if not absolute.
                         */
                        dir = Var_Value(".PARSEDIR", VAR_GLOBAL, &cp);
-                       if (dir == NULL || *dir == '\0' ||
-                           (*dir == '.' && dir[1] == '\0'))
-                               dir = Var_Value(".CURDIR", VAR_GLOBAL, &cp);
                        if (dir == NULL)
                                dir = ".";
-
-                       (void)fprintf(f, "%s/%s", dir, cfname);
+                       if (*dir != '/') {
+                               dir = cp2 = realpath(dir, NULL);
+                               free(cp);
+                               cp = cp2; /* cp2 set to NULL by Var_Value */
+                       }
+                       fname = Var_Value(".PARSEFILE", VAR_GLOBAL, &cp2);
+                       if (fname == NULL) {
+                               if ((fname = strrchr(cfname, '/')))
+                                       fname++;
+                               else
+                                       fname = cfname;
+                       }
+                       (void)fprintf(f, "%s/%s", dir, fname);
+                       free(cp2);
+                       free(cp);
                } else
                        (void)fprintf(f, "%s", cfname);
 

Modified: head/contrib/bmake/unit-tests/varquote.mk
==============================================================================
--- head/contrib/bmake/unit-tests/varquote.mk   Sat Dec 22 22:59:11 2018        
(r342375)
+++ head/contrib/bmake/unit-tests/varquote.mk   Sun Dec 23 01:05:52 2018        
(r342376)
@@ -1,4 +1,4 @@
-# $NetBSD: varquote.mk,v 1.2 2018/05/27 01:14:51 christos Exp $
+# $NetBSD: varquote.mk,v 1.4 2018/12/16 18:53:34 christos Exp $
 #
 # Test VAR:q modifier
 
@@ -10,5 +10,5 @@ all:
        @${MAKE} -f ${MAKEFILE} REPROFLAGS=${REPROFLAGS:q}
 .else
 all:
-       @echo ${REPROFLAGS}
+       @printf "%s %s\n" ${REPROFLAGS}
 .endif

Modified: head/contrib/bmake/var.c
==============================================================================
--- head/contrib/bmake/var.c    Sat Dec 22 22:59:11 2018        (r342375)
+++ head/contrib/bmake/var.c    Sun Dec 23 01:05:52 2018        (r342376)
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp $       */
+/*     $NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp 
$";
+static char rcsid[] = "$NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg 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.220 2018/05/27 01:14:51 christos Exp $");
+__RCSID("$NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -835,7 +835,8 @@ Var_UnExport(char *str)
        environ = savedEnv = newenv;
        newenv[0] = NULL;
        newenv[1] = NULL;
-       setenv(MAKE_LEVEL_ENV, cp, 1);
+       if (cp && *cp)
+           setenv(MAKE_LEVEL_ENV, cp, 1);
     } else {
        for (; *str != '\n' && isspace((unsigned char) *str); str++)
            continue;

Modified: head/usr.bin/bmake/Makefile.config
==============================================================================
--- head/usr.bin/bmake/Makefile.config  Sat Dec 22 22:59:11 2018        
(r342375)
+++ head/usr.bin/bmake/Makefile.config  Sun Dec 23 01:05:52 2018        
(r342376)
@@ -7,7 +7,7 @@ SRCTOP?= ${.CURDIR:H:H}
 
 # things set by configure
 
-_MAKE_VERSION?=20180919
+_MAKE_VERSION?=20181221
 
 prefix?= /usr
 srcdir= ${SRCTOP}/contrib/bmake
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to