From nobody Sat Jan 10 21:34:02 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dpX2f4lb9z6MxNr for ; Sat, 10 Jan 2026 21:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dpX2f1D4Qz3Qjm for ; Sat, 10 Jan 2026 21:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768080842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+V70Niw3UnXI5KNJDWkg4TH7EZzOM2kDj1ZWxJS7hE=; b=LD0QcjlPw2SCWL7kH5u5wWC21dN3kgwrJdmy+NZnXMOYSV+C1yXd+WKPfHGFJk7hWVDaXK OnhyioO4Luljcg1fM4R32R+FzqRaouftM3YmSSthLCI/6Qx3Od8qn104P7m709Xw7EX8aA SN49pjc5Pax1W+bHJdygf8pt9WekIzdHXVuiAVR+7DDRrXH8YnWKGYij3gSKmH1ExbJCFZ P9ZEPWAdy0ulIfY4p4UPzX69M1Djs5JUSQasLQ9DS2n9yXodgSp4u+oEhZlyNwywivCCg+ JgRNC6NZ91mTtEc6c8ZV4ObtvfU6Hihiq9ajfjt2q3qx78r9vIEubrUL7CFsyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768080842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+V70Niw3UnXI5KNJDWkg4TH7EZzOM2kDj1ZWxJS7hE=; b=sZY7z9f6KkpJZikCOWJRJDzXwGt/Q/UxIIvRFZnILYOJJK0elkcdJ/1SL+/TqrY0i6k7EQ BnjcoxvlSnCTaIT2YOSEhBJ+GHX2xaNQDnLxUsOXPL14I0wwhRDi01sEpfFdw7BpQyzPzT k6jTSSL6Dh/sxZgYWRWaIvkq/u54Q+ybZDf8Tjy/io+FOD4OJGeKc6SDaaolQqy8117AlK KIq1LZ70FDnRpN3+4PubFBCFgF2E3WkvE0mFyxbX4htxzc0mY+ld8yaWSQuRy8px/4TQfB uxJ5hsfzXSx2yXwbGAkCF5Lxq5FxbLQ9PCEky/MfRy6kpLsOHDuRIgxAR7d7HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768080842; a=rsa-sha256; cv=none; b=Xs8WIFhzdVqqkzGOmaL1Bsy9kfepngipDbYxNZQNJW74CBgjduD8U4xLrah4qaDJL7J/t4 +tv6YPTSO/yJWWVAkv2vgozQOITVOspMpm8WJZlSxxvGXM1SyyDkdjaOXR+c7W/Ty9MsRl wY181Q3CNfBzKN0nQHsvNMny9ZaFdx/OmFGklgnaKXEyaLEIWiIbjXNyQ2dW5Um26Nf4dN E6USq/bhZAJZkcBITzuLQQ52m8INifhFZsEKM9n7XhtdUXgHtp8IrXGulwzJohQLy3HUAR fMnRtGPSkK/B7sEZop0S6mt63oow8Uk/CqbA6H47E9IcWR5GqOVhDJm1e0Tq1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dpX2f0qqdz1BSk for ; Sat, 10 Jan 2026 21:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24eae by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 10 Jan 2026 21:34:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Simon J. Gerraty Subject: git: 5d3c3f73b69c - stable/14 - Merge bmake-20240520 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5d3c3f73b69c61cd2630be56642292a676363dd0 Auto-Submitted: auto-generated Date: Sat, 10 Jan 2026 21:34:02 +0000 Message-Id: <6962c5ca.24eae.1b82e8a8@gitrepo.freebsd.org> The branch stable/14 has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5d3c3f73b69c61cd2630be56642292a676363dd0 commit 5d3c3f73b69c61cd2630be56642292a676363dd0 Author: Simon J. Gerraty AuthorDate: 2024-05-23 20:11:02 +0000 Commit: Simon J. Gerraty CommitDate: 2026-01-10 21:33:11 +0000 Merge bmake-20240520 Merge commit '29efb3dcaedd9cbabc6f96f35545baf2c8b28501' (cherry picked from commit 9d3df31ec06fe91c5c67da464f11408474d57174) --- contrib/bmake/ChangeLog | 15 +++++++++ contrib/bmake/VERSION | 2 +- contrib/bmake/dir.c | 51 ++++++++++++++++++++++++++----- contrib/bmake/dir.h | 3 +- contrib/bmake/getopt.c | 6 ++-- contrib/bmake/main.c | 6 ++-- contrib/bmake/parse.c | 6 ++-- contrib/bmake/unit-tests/deptgt-phony.exp | 2 +- usr.bin/bmake/Makefile.config | 2 +- 9 files changed, 71 insertions(+), 22 deletions(-) diff --git a/contrib/bmake/ChangeLog b/contrib/bmake/ChangeLog index 1ce033887c8f..6d8a8228969d 100644 --- a/contrib/bmake/ChangeLog +++ b/contrib/bmake/ChangeLog @@ -1,3 +1,18 @@ +2024-05-20 Simon J Gerraty + + * VERSION (_MAKE_VERSION): + Merge with NetBSD make, pick up + o dir.c: in FindFile restore last search of .CURDIR even for + includes, as a number of existing makefiles are broken otherwise. + +2024-05-19 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20240519 + Merge with NetBSD make, pick up + o dir.c: Add Dir_FindInclude, FindFile without looking in .CURDIR. + Also fix Dir_SetSYSPATH to use defSysIncPath if sysIncPath is empty. + o main.c: no need to set .DOTLAST in sysIncPath + 2024-05-07 Simon J Gerraty * VERSION (_MAKE_VERSION): 20240508 diff --git a/contrib/bmake/VERSION b/contrib/bmake/VERSION index 60aa9ae5069b..4af36cf84624 100644 --- a/contrib/bmake/VERSION +++ b/contrib/bmake/VERSION @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20240508 +_MAKE_VERSION=20240520 diff --git a/contrib/bmake/dir.c b/contrib/bmake/dir.c index 5c11d6c794d7..de50b2faf511 100644 --- a/contrib/bmake/dir.c +++ b/contrib/bmake/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.286 2023/12/29 18:53:24 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.290 2024/05/20 19:14:12 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -132,7 +132,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.286 2023/12/29 18:53:24 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.290 2024/05/20 19:14:12 sjg Exp $"); /* * A search path is a list of CachedDir structures. A CachedDir has in it the @@ -566,10 +566,12 @@ void Dir_SetSYSPATH(void) { CachedDirListNode *ln; - + SearchPath *path = Lst_IsEmpty(&sysIncPath->dirs) + ? defSysIncPath : sysIncPath; + Var_ReadOnly(".SYSPATH", false); Global_Delete(".SYSPATH"); - for (ln = sysIncPath->dirs.first; ln != NULL; ln = ln->next) { + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { CachedDir *dir = ln->datum; Global_Append(".SYSPATH", dir->name); } @@ -1142,15 +1144,16 @@ found: * Input: * name the file to find * path the directories to search, or NULL + * isinclude if true, do not search .CURDIR at all * * Results: * The freshly allocated path to the file, or NULL. */ -char * -Dir_FindFile(const char *name, SearchPath *path) +static char * +FindFile(const char *name, SearchPath *path, bool isinclude) { char *file; /* the current filename to check */ - bool seenDotLast = false; /* true if we should search dot last */ + bool seenDotLast = isinclude; /* true if we should search dot last */ struct cached_stat cst; const char *trailing_dot = "."; const char *base = str_basename(name); @@ -1163,7 +1166,7 @@ Dir_FindFile(const char *name, SearchPath *path) return NULL; } - if (path->dirs.first != NULL) { + if (!seenDotLast && path->dirs.first != NULL) { CachedDir *dir = path->dirs.first->datum; if (dir == dotLast) { seenDotLast = true; @@ -1244,6 +1247,38 @@ Dir_FindFile(const char *name, SearchPath *path) return NULL; } +/* + * Find the file with the given name along the given search path. + * + * Input: + * name the file to find + * path the directories to search, or NULL + * + * Results: + * The freshly allocated path to the file, or NULL. + */ +char * +Dir_FindFile(const char *name, SearchPath *path) +{ + return FindFile(name, path, false); +} + +/* + * Find the include file with the given name along the given search path. + * + * Input: + * name the file to find + * path the directories to search, or NULL + * + * Results: + * The freshly allocated path to the file, or NULL. + */ +char * +Dir_FindInclude(const char *name, SearchPath *path) +{ + return FindFile(name, path, true); +} + /* * Search for 'needle' starting at the directory 'here' and then working our diff --git a/contrib/bmake/dir.h b/contrib/bmake/dir.h index 09cbca8ec4c1..58bfd8c996ef 100644 --- a/contrib/bmake/dir.h +++ b/contrib/bmake/dir.h @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.47 2023/01/24 00:24:02 sjg Exp $ */ +/* $NetBSD: dir.h,v 1.48 2024/05/19 20:09:40 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -86,6 +86,7 @@ void Dir_SetSYSPATH(void); bool Dir_HasWildcards(const char *) MAKE_ATTR_USE; void SearchPath_Expand(SearchPath *, const char *, StringList *); char *Dir_FindFile(const char *, SearchPath *) MAKE_ATTR_USE; +char *Dir_FindInclude(const char *, SearchPath *) MAKE_ATTR_USE; char *Dir_FindHereOrAbove(const char *, const char *) MAKE_ATTR_USE; void Dir_UpdateMTime(GNode *, bool); CachedDir *SearchPath_Add(SearchPath *, const char *); diff --git a/contrib/bmake/getopt.c b/contrib/bmake/getopt.c index da29daed2ca8..2afe663acb00 100644 --- a/contrib/bmake/getopt.c +++ b/contrib/bmake/getopt.c @@ -1,4 +1,4 @@ -/* $NetBSD: getopt.c,v 1.29 2014/06/05 22:00:22 christos Exp $ */ +/* $NetBSD: getopt.c,v 1.30 2024/01/19 18:41:38 christos Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -58,8 +58,8 @@ int getopt(int nargc, char * const nargv[], const char *ostr) { extern char *__progname; - static const char *place = EMSG; /* option letter processing */ - char *oli; /* option letter list index */ + static const char *place = EMSG; /* option letter processing */ + const char *oli; /* option letter list index */ #ifndef BSD4_4 if (!__progname) { diff --git a/contrib/bmake/main.c b/contrib/bmake/main.c index fff294291ccf..6c97d648e5a2 100644 --- a/contrib/bmake/main.c +++ b/contrib/bmake/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.615 2024/05/07 18:26:22 sjg Exp $ */ +/* $NetBSD: main.c,v 1.616 2024/05/19 17:55:54 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -111,7 +111,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.615 2024/05/07 18:26:22 sjg Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.616 2024/05/19 17:55:54 sjg Exp $"); #if defined(MAKE_NATIVE) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -1174,8 +1174,6 @@ InitDefSysIncPath(char *syspath) else syspath = bmake_strdup(syspath); - /* do NOT search .CURDIR first for .include */ - SearchPath_Add(defSysIncPath, ".DOTLAST"); for (start = syspath; *start != '\0'; start = p) { for (p = start; *p != '\0' && *p != ':'; p++) continue; diff --git a/contrib/bmake/parse.c b/contrib/bmake/parse.c index 54f29ba5ff13..70c6d6fe5157 100644 --- a/contrib/bmake/parse.c +++ b/contrib/bmake/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.722 2024/04/27 17:33:46 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.723 2024/05/19 20:09:40 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -121,7 +121,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.722 2024/04/27 17:33:46 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.723 2024/05/19 20:09:40 sjg Exp $"); /* Detects a multiple-inclusion guard in a makefile. */ typedef enum { @@ -1269,7 +1269,7 @@ IncludeFile(const char *file, bool isSystem, bool depinc, bool silent) if (fullname == NULL) { SearchPath *path = Lst_IsEmpty(&sysIncPath->dirs) ? defSysIncPath : sysIncPath; - fullname = Dir_FindFile(file, path); + fullname = Dir_FindInclude(file, path); } if (fullname == NULL) { diff --git a/contrib/bmake/unit-tests/deptgt-phony.exp b/contrib/bmake/unit-tests/deptgt-phony.exp index e943091e4cef..1c379b32a33b 100644 --- a/contrib/bmake/unit-tests/deptgt-phony.exp +++ b/contrib/bmake/unit-tests/deptgt-phony.exp @@ -2,7 +2,7 @@ Expanding "depsrc-phony-pr-15164-*-wildcard"... Expanding "deptgt-phony-pr-15164-*-wildcard"... Searching for .depend ... failed. -Searching for .depend ...[dot last]... +Searching for .depend ... . ... failed. Wildcard expanding "all"... diff --git a/usr.bin/bmake/Makefile.config b/usr.bin/bmake/Makefile.config index 55bc4a4370ca..e62d207b70ac 100644 --- a/usr.bin/bmake/Makefile.config +++ b/usr.bin/bmake/Makefile.config @@ -6,7 +6,7 @@ SRCTOP?= ${.CURDIR:H:H} # things set by configure -_MAKE_VERSION?=20240508 +_MAKE_VERSION?=20240520 prefix?= /usr srcdir= ${SRCTOP}/contrib/bmake