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>
* 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
MAKE_VERSION= 20151201
MAKE_VERSION= 20151220
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>
* 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
#
@ -40,12 +40,12 @@ MKOBJDIRS= auto
.if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto
# Use __objdir here so it is easier to tweak without impacting
# the logic.
.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX})
.if !empty(MAKEOBJDIRPREFIX)
__objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR}
.endif
__objdir?= ${MAKEOBJDIR:Uobj}
__objdir:= ${__objdir:tA}
.if ${.OBJDIR} != ${__objdir}
__objdir:= ${__objdir}
.if ${.OBJDIR:tA} != ${__objdir:tA}
# We need to chdir, make the directory if needed
.if !exists(${__objdir}/) && \
(${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "")
@ -53,11 +53,10 @@ __objdir:= ${__objdir:tA}
__objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \
${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \
${Mkdirs}; Mkdirs ${__objdir}
__objdir:= ${__objdir:tA}
.endif
# This causes make to use the specified directory as .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}
.endif
.endif

View File

@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# 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
#
@ -70,7 +70,7 @@
# sjg@crufty.net
#
MK_VERSION=20151111
MK_VERSION=20151212
OWNER=
GROUP=
MODE=444

48
os.sh
View File

@ -17,7 +17,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# 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
#
@ -56,10 +56,10 @@ Which() {
case "$1" in
/*) test $t $1 && echo $1;;
*)
# some shells cannot correctly handle `IFS`
# in conjunction with the for loop.
_dirs=`IFS=:; echo ${2:-$PATH}`
for d in $_dirs
# some shells cannot correctly handle `IFS`
# in conjunction with the for loop.
_dirs=`IFS=:; echo ${2:-$PATH}`
for d in $_dirs
do
test $t $d/$1 && { echo $d/$1; break; }
done
@ -70,11 +70,11 @@ Which() {
# tr is insanely non-portable wrt char classes, so we need to
# spell out the alphabet. sed y/// would work too.
toUpper() {
${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}
toLower() {
${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
}
K=
@ -91,7 +91,7 @@ SunOS)
export CHOWN
# 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`
MAILER=/usr/ucb/Mail
@ -105,8 +105,8 @@ SunOS)
MACHINE=$MACHINE_ARCH
;;
4*)
MACHINE_ARCH=`arch`
;;
MACHINE_ARCH=`arch`
;;
5*)
K=-k
LOCAL_FS=ufs
@ -116,8 +116,8 @@ SunOS)
# overwriting an existing file!!!!! We want one that works!
test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln}
# wonderful, 5.8's tr again require's []'s
# but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set!
# use toUpper/toLower instead.
# but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set!
# use toUpper/toLower instead.
;;
esac
case "$OS/$MACHINE_ARCH" in
@ -142,9 +142,9 @@ SunOS)
SHARE_ARCH=$OS/$HOST
;;
OpenBSD)
arch=`Which arch /usr/bin:/usr/ucb:$PATH`
MACHINE_ARCH=`$arch -s`
;;
arch=`Which arch /usr/bin:/usr/ucb:$PATH`
MACHINE_ARCH=`$arch -s`
;;
esac
NAWK=awk
export NAWK
@ -218,17 +218,25 @@ export HOST_TARGET
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 LN SHARE_ARCH TR
case /$0 in
*/os.sh)
for v in $*
for v in $*
do
eval vv=\$$v
echo "$v='$vv'"
eval vv=\$$v
echo "$v='$vv'"
done
;;
;;
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
@ -69,14 +69,14 @@
*/
#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
#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.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 /* not lint */
#endif
@ -553,7 +553,20 @@ Suff_ClearSuffixes(void)
#endif
sufflist = Lst_Init(FALSE);
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
Suff_Init(void)
{
sufflist = Lst_Init(FALSE);
#ifdef CLEANUP
suffClean = Lst_Init(FALSE);
#endif
srclist = Lst_Init(FALSE);
transforms = Lst_Init(FALSE);
sNum = 0;
/*
* 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
* suffix.
*/
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;
Suff_ClearSuffixes();
}