Import bmake-20151220

This commit is contained in:
Simon J. Gerraty 2015-12-25 08:09:48 +00:00
parent 7c6c27a0ba
commit 6c770d664f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/NetBSD/bmake/dist/; revision=292716
svn path=/vendor/NetBSD/bmake/20151220/; revision=292717; tag=vendor/NetBSD/bmake/20151220
7 changed files with 67 additions and 49 deletions

View file

@ -1,3 +1,9 @@
2015-12-20 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20151220
Merge with NetBSD make, pick up
o suff.c: re-initialize suffNull when clearing suffixes.
2015-12-01 Simon J. Gerraty <sjg@bad.crufty.net> 2015-12-01 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20151201 * Makefile (MAKE_VERSION): 20151201

View file

@ -1,7 +1,7 @@
# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ # $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $
# Base version on src date # Base version on src date
MAKE_VERSION= 20151201 MAKE_VERSION= 20151220
PROG= bmake PROG= bmake

View file

@ -1,3 +1,9 @@
2015-12-12 Simon J. Gerraty <sjg@bad.crufty.net>
* install-mk (MK_VERSION): 20151212
* auto.obj.mk: do not require MAKEOBJDIRPREFIX to exist.
only apply :tA to __objdir when comparing to .OBJDIR
2015-11-14 Simon J. Gerraty <sjg@bad.crufty.net> 2015-11-14 Simon J. Gerraty <sjg@bad.crufty.net>
* install-mk (MK_VERSION): 20151111 * install-mk (MK_VERSION): 20151111

View file

@ -1,4 +1,4 @@
# $Id: auto.obj.mk,v 1.11 2015/06/16 06:28:21 sjg Exp $ # $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $
# #
# @(#) Copyright (c) 2004, Simon J. Gerraty # @(#) Copyright (c) 2004, Simon J. Gerraty
# #
@ -40,12 +40,12 @@ MKOBJDIRS= auto
.if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto .if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto
# Use __objdir here so it is easier to tweak without impacting # Use __objdir here so it is easier to tweak without impacting
# the logic. # the logic.
.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}) .if !empty(MAKEOBJDIRPREFIX)
__objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR}
.endif .endif
__objdir?= ${MAKEOBJDIR:Uobj} __objdir?= ${MAKEOBJDIR:Uobj}
__objdir:= ${__objdir:tA} __objdir:= ${__objdir}
.if ${.OBJDIR} != ${__objdir} .if ${.OBJDIR:tA} != ${__objdir:tA}
# We need to chdir, make the directory if needed # We need to chdir, make the directory if needed
.if !exists(${__objdir}/) && \ .if !exists(${__objdir}/) && \
(${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "")
@ -53,11 +53,10 @@ __objdir:= ${__objdir:tA}
__objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \
${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \
${Mkdirs}; Mkdirs ${__objdir} ${Mkdirs}; Mkdirs ${__objdir}
__objdir:= ${__objdir:tA}
.endif .endif
# This causes make to use the specified directory as .OBJDIR # This causes make to use the specified directory as .OBJDIR
.OBJDIR: ${__objdir} .OBJDIR: ${__objdir}
.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != "" .if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != ""
.error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .error could not use ${__objdir}: .OBJDIR=${.OBJDIR}
.endif .endif
.endif .endif

View file

@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg@crufty.net> # Simon J. Gerraty <sjg@crufty.net>
# RCSid: # RCSid:
# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ # $Id: install-mk,v 1.118 2015/12/16 01:57:06 sjg Exp $
# #
# @(#) Copyright (c) 1994 Simon J. Gerraty # @(#) Copyright (c) 1994 Simon J. Gerraty
# #
@ -70,7 +70,7 @@
# sjg@crufty.net # sjg@crufty.net
# #
MK_VERSION=20151111 MK_VERSION=20151212
OWNER= OWNER=
GROUP= GROUP=
MODE=444 MODE=444

48
os.sh
View file

@ -17,7 +17,7 @@
# Simon J. Gerraty <sjg@crufty.net> # Simon J. Gerraty <sjg@crufty.net>
# RCSid: # RCSid:
# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $ # $Id: os.sh,v 1.50 2015/12/17 17:06:29 sjg Exp $
# #
# @(#) Copyright (c) 1994 Simon J. Gerraty # @(#) Copyright (c) 1994 Simon J. Gerraty
# #
@ -56,10 +56,10 @@ Which() {
case "$1" in case "$1" in
/*) test $t $1 && echo $1;; /*) test $t $1 && echo $1;;
*) *)
# some shells cannot correctly handle `IFS` # some shells cannot correctly handle `IFS`
# in conjunction with the for loop. # in conjunction with the for loop.
_dirs=`IFS=:; echo ${2:-$PATH}` _dirs=`IFS=:; echo ${2:-$PATH}`
for d in $_dirs for d in $_dirs
do do
test $t $d/$1 && { echo $d/$1; break; } test $t $d/$1 && { echo $d/$1; break; }
done done
@ -70,11 +70,11 @@ Which() {
# tr is insanely non-portable wrt char classes, so we need to # tr is insanely non-portable wrt char classes, so we need to
# spell out the alphabet. sed y/// would work too. # spell out the alphabet. sed y/// would work too.
toUpper() { toUpper() {
${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
} }
toLower() { toLower() {
${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
} }
K= K=
@ -91,7 +91,7 @@ SunOS)
export CHOWN export CHOWN
# Great! Solaris keeps moving arch(1) # Great! Solaris keeps moving arch(1)
# should just bite the bullet and use uname -p # should just bite the bullet and use uname -p
arch=`Which arch /usr/bin:/usr/ucb` arch=`Which arch /usr/bin:/usr/ucb`
MAILER=/usr/ucb/Mail MAILER=/usr/ucb/Mail
@ -105,8 +105,8 @@ SunOS)
MACHINE=$MACHINE_ARCH MACHINE=$MACHINE_ARCH
;; ;;
4*) 4*)
MACHINE_ARCH=`arch` MACHINE_ARCH=`arch`
;; ;;
5*) 5*)
K=-k K=-k
LOCAL_FS=ufs LOCAL_FS=ufs
@ -116,8 +116,8 @@ SunOS)
# overwriting an existing file!!!!! We want one that works! # overwriting an existing file!!!!! We want one that works!
test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln} test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln}
# wonderful, 5.8's tr again require's []'s # wonderful, 5.8's tr again require's []'s
# but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set!
# use toUpper/toLower instead. # use toUpper/toLower instead.
;; ;;
esac esac
case "$OS/$MACHINE_ARCH" in case "$OS/$MACHINE_ARCH" in
@ -142,9 +142,9 @@ SunOS)
SHARE_ARCH=$OS/$HOST SHARE_ARCH=$OS/$HOST
;; ;;
OpenBSD) OpenBSD)
arch=`Which arch /usr/bin:/usr/ucb:$PATH` arch=`Which arch /usr/bin:/usr/ucb:$PATH`
MACHINE_ARCH=`$arch -s` MACHINE_ARCH=`$arch -s`
;; ;;
esac esac
NAWK=awk NAWK=awk
export NAWK export NAWK
@ -218,17 +218,25 @@ export HOST_TARGET
case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac
export HOSTNAME HOST Echo() {
case "$1" in
-n) _n=$N _c=$C; shift;;
*) _n= _c=;;
esac
echo $_n "$@" $_c
}
export HOSTNAME HOST
export OS MACHINE MACHINE_ARCH OSREL OSMAJOR LOCAL_FS TMP_DIRS MAILER N C K PS_AXC export OS MACHINE MACHINE_ARCH OSREL OSMAJOR LOCAL_FS TMP_DIRS MAILER N C K PS_AXC
export LN SHARE_ARCH TR export LN SHARE_ARCH TR
case /$0 in case /$0 in
*/os.sh) */os.sh)
for v in $* for v in $*
do do
eval vv=\$$v eval vv=\$$v
echo "$v='$vv'" echo "$v='$vv'"
done done
;; ;;
esac esac

37
suff.c
View file

@ -1,4 +1,4 @@
/* $NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $ */ /* $NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993 * Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/ */
#ifndef MAKE_NATIVE #ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"; static char rcsid[] = "$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $";
#else #else
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
#if 0 #if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else #else
__RCSID("$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"); __RCSID("$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#endif #endif
@ -553,7 +553,20 @@ Suff_ClearSuffixes(void)
#endif #endif
sufflist = Lst_Init(FALSE); sufflist = Lst_Init(FALSE);
sNum = 0; sNum = 0;
suffNull = emptySuff; if (suffNull)
SuffFree(suffNull);
emptySuff = suffNull = bmake_malloc(sizeof(Suff));
suffNull->name = bmake_strdup("");
suffNull->nameLen = 0;
suffNull->searchPath = Lst_Init(FALSE);
Dir_Concat(suffNull->searchPath, dirSearchPath);
suffNull->children = Lst_Init(FALSE);
suffNull->parents = Lst_Init(FALSE);
suffNull->ref = Lst_Init(FALSE);
suffNull->sNum = sNum++;
suffNull->flags = SUFF_NULL;
suffNull->refCount = 1;
} }
/*- /*-
@ -2524,32 +2537,18 @@ Suff_SetNull(char *name)
void void
Suff_Init(void) Suff_Init(void)
{ {
sufflist = Lst_Init(FALSE);
#ifdef CLEANUP #ifdef CLEANUP
suffClean = Lst_Init(FALSE); suffClean = Lst_Init(FALSE);
#endif #endif
srclist = Lst_Init(FALSE); srclist = Lst_Init(FALSE);
transforms = Lst_Init(FALSE); transforms = Lst_Init(FALSE);
sNum = 0;
/* /*
* Create null suffix for single-suffix rules (POSIX). The thing doesn't * Create null suffix for single-suffix rules (POSIX). The thing doesn't
* actually go on the suffix list or everyone will think that's its * actually go on the suffix list or everyone will think that's its
* suffix. * suffix.
*/ */
emptySuff = suffNull = bmake_malloc(sizeof(Suff)); Suff_ClearSuffixes();
suffNull->name = bmake_strdup("");
suffNull->nameLen = 0;
suffNull->searchPath = Lst_Init(FALSE);
Dir_Concat(suffNull->searchPath, dirSearchPath);
suffNull->children = Lst_Init(FALSE);
suffNull->parents = Lst_Init(FALSE);
suffNull->ref = Lst_Init(FALSE);
suffNull->sNum = sNum++;
suffNull->flags = SUFF_NULL;
suffNull->refCount = 1;
} }