From owner-svn-src-stable-10@FreeBSD.ORG Sat Dec 27 16:43:29 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 361B9CC1; Sat, 27 Dec 2014 16:43:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EF0A66ADF; Sat, 27 Dec 2014 16:43:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBRGhTf1081181; Sat, 27 Dec 2014 16:43:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBRGhNGH081153; Sat, 27 Dec 2014 16:43:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412271643.sBRGhNGH081153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 27 Dec 2014 16:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276305 - in stable/10: contrib/bmake contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/mk/sys usr.bin/bmake X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Dec 2014 16:43:29 -0000 Author: ngie Date: Sat Dec 27 16:43:22 2014 New Revision: 276305 URL: https://svnweb.freebsd.org/changeset/base/276305 Log: MFC bmake changes to stable/10 (r255285,r255916,r258113,r258114,r261212,r266760,r268437) Discussed with: sjg r255285: If MAKE_JOB_ERROR_TOKEN is set to false, do not put an error token ("E") into the job queue. This avoids closing down an entire build on failure of one branch. Probably has no use outside the context of universe/tinderbox. Reviewed by: obrien r255916: Fix Fx syntax. PR: 182269 Approved by: re@ r258113: Avoid SEGV when passed NULL for list r258114: Don't SEGV when Hash_Table is uninitialized r261212: Merge bmake-20140101 from vendor r266760: Portmgr no longer need the UL hack. Reviewed by: obrien r268437: Update to bmake-20140620 Main change is detection of malformed variable references. Reviewed by: obrien Modified: stable/10/contrib/bmake/ChangeLog stable/10/contrib/bmake/Makefile stable/10/contrib/bmake/Makefile.config.in stable/10/contrib/bmake/README stable/10/contrib/bmake/bmake.1 stable/10/contrib/bmake/bmake.cat1 stable/10/contrib/bmake/boot-strap stable/10/contrib/bmake/bsd.after-import.mk stable/10/contrib/bmake/compat.c stable/10/contrib/bmake/config.h.in stable/10/contrib/bmake/configure stable/10/contrib/bmake/configure.in stable/10/contrib/bmake/hash.c stable/10/contrib/bmake/lst.lib/lstMember.c stable/10/contrib/bmake/main.c stable/10/contrib/bmake/make-bootstrap.sh.in stable/10/contrib/bmake/make.1 stable/10/contrib/bmake/make.h stable/10/contrib/bmake/meta.c stable/10/contrib/bmake/mk/ChangeLog stable/10/contrib/bmake/mk/autodep.mk stable/10/contrib/bmake/mk/dirdeps.mk stable/10/contrib/bmake/mk/dpadd.mk stable/10/contrib/bmake/mk/gendirdeps.mk stable/10/contrib/bmake/mk/host-target.mk stable/10/contrib/bmake/mk/install-mk stable/10/contrib/bmake/mk/lib.mk stable/10/contrib/bmake/mk/meta.autodep.mk stable/10/contrib/bmake/mk/meta2deps.py stable/10/contrib/bmake/mk/meta2deps.sh stable/10/contrib/bmake/mk/options.mk stable/10/contrib/bmake/mk/rst2htm.mk stable/10/contrib/bmake/mk/sys.mk stable/10/contrib/bmake/mk/sys/SunOS.mk stable/10/contrib/bmake/mk/target-flags.mk stable/10/contrib/bmake/mk/warnings.mk stable/10/contrib/bmake/os.sh stable/10/contrib/bmake/parse.c stable/10/contrib/bmake/str.c stable/10/contrib/bmake/util.c stable/10/contrib/bmake/var.c stable/10/usr.bin/bmake/Makefile stable/10/usr.bin/bmake/Makefile.config stable/10/usr.bin/bmake/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bmake/ChangeLog ============================================================================== --- stable/10/contrib/bmake/ChangeLog Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/ChangeLog Sat Dec 27 16:43:22 2014 (r276305) @@ -1,3 +1,62 @@ +2014-06-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20140620 + Merge with NetBSD make, pick up + o var.c return varNoError rather than var_Error for ::= modidiers. + +2014-05-22 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20140522 + Merge with NetBSD make, pick up + o var.c detect some parse errors. + +2014-04-05 Simon J. Gerraty + + * Fix spelling errors - patch from Pedro Giffuni + +2014-02-14 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20140214 + Merge with NetBSD make, pick up + o .INCLUDEFROM* + o use Var_Value to get MAKEOBJDIR[PREFIX] + o reduced realloc'ign in brk_string. + * configure.in: add a check for compiler supporting __func__ + +2014-01-03 Simon J. Gerraty + + * boot-strap: ignore mksrc=none + +2014-01-02 Simon J. Gerraty + + * Makefile (DEFAULT_SYS_PATH?): use just ${prefix}/share/mk + +2014-01-01 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20140101 + * configure.in: set bmake_path_max to min(_SC_PATH_MAX,1024) + * Makefile.config: defined BMAKE_PATH_MAX to bmake_path_max + * make.h: use BMAKE_PATH_MAX if MAXPATHLEN not defined (needed for + Hurd) + * configure.in: Add AC_PREREQ and check for + sysctl; patch from Andrew Shadura andrewsh at debian.org + +2013-10-16 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20131010 + * lose the const from arg to systcl to avoid problems on older BSDs. + +2013-10-01 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20131001 + Merge with NetBSD make, pick up + o main.c: for NATIVE build sysctl to get MACHINE_ARCH from + hw.machine_arch if necessary. + o meta.c: meta_oodate - need to look at src of Link and target + of Move as well. + * main.c: check that CTL_HW and HW_MACHINE_ARCH exist. + provide __arraycount() if needed. + 2013-09-04 Simon J. Gerraty * Makefile (MAKE_VERSION): 20130904 @@ -30,7 +89,7 @@ * Makefile (MAKE_VERSION): 20130716 Merge with NetBSD make, pick up - o number of gmake compatability tweaks + o number of gmake compatibility tweaks -w for gmake style entering/leaving messages if .MAKE.LEVEL > 0 indicate it in progname "make[1]" etc. handle MAKEFLAGS containing only letters. Modified: stable/10/contrib/bmake/Makefile ============================================================================== --- stable/10/contrib/bmake/Makefile Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/Makefile Sat Dec 27 16:43:22 2014 (r276305) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.20 2013/09/04 15:42:03 sjg Exp $ +# $Id: Makefile,v 1.27 2014/06/20 14:51:54 sjg Exp $ # Base version on src date -MAKE_VERSION= 20130904 +MAKE_VERSION= 20140620 PROG= bmake @@ -68,7 +68,7 @@ SRCS+= ${LIBOBJS:T:.o=.c} prefix?= /usr srcdir?= ${.CURDIR} -DEFAULT_SYS_PATH?= .../share/mk:${prefix}/share/mk +DEFAULT_SYS_PATH?= ${prefix}/share/mk CPPFLAGS+= -DUSE_META CFLAGS+= ${CPPFLAGS} @@ -117,7 +117,7 @@ MANTARGET?= man # turn this on by default - ignored if we are root WITH_INSTALL_AS_USER= -# supress with -DWITHOUT_* +# suppress with -DWITHOUT_* OPTIONS_DEFAULT_YES+= \ AUTOCONF_MK \ INSTALL_MK \ Modified: stable/10/contrib/bmake/Makefile.config.in ============================================================================== --- stable/10/contrib/bmake/Makefile.config.in Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/Makefile.config.in Sat Dec 27 16:43:22 2014 (r276305) @@ -14,3 +14,7 @@ LIBOBJS= @LIBOBJS@ LDADD= @LIBS@ USE_META= @use_meta@ FILEMON_H= @filemon_h@ +BMAKE_PATH_MAX?= @bmake_path_max@ +# used if MAXPATHLEN not defined +CPPFLAGS+= -DBMAKE_PATH_MAX=${BMAKE_PATH_MAX} + Modified: stable/10/contrib/bmake/README ============================================================================== --- stable/10/contrib/bmake/README Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/README Sat Dec 27 16:43:22 2014 (r276305) @@ -18,7 +18,7 @@ interesting changes, so that bmake track Building: -The prefered way to bootstrap bmake is: +The preferred way to bootstrap bmake is: ./bmake/boot-strap Modified: stable/10/contrib/bmake/bmake.1 ============================================================================== --- stable/10/contrib/bmake/bmake.1 Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/bmake.1 Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.222 2013/08/11 09:53:49 apb Exp $ +.\" $NetBSD: make.1,v 1.229 2014/01/19 10:23:29 apb Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd August 11, 2013 +.Dd February 14, 2014 .Dt MAKE 1 .Os .Sh NAME @@ -706,6 +706,10 @@ was executed. Refer to the description of .Ql Ev PWD for more details. +.It Va .INCLUDEDFROMDIR +The directory of the file this Makefile was included from. +.It Va .INCLUDEDFROMFILE +The filename of the file this Makefile was included from. .It Ev MAKE The name that .Nm @@ -745,7 +749,7 @@ then output for each target is prefixed .Ql --- target --- the first part of which can be controlled via .Va .MAKE.JOB.PREFIX . -If +If .Va .MAKE.JOB.PREFIX is empty, no token is printed. .br @@ -1066,6 +1070,13 @@ may be used. The wildcard characters may be escaped with a backslash .Pq Ql \e . +As a consequence of the way values are split into words, matched, +and then joined, a construct like +.Dl ${VAR:M*} +will normalise the inter-word spacing, removing all leading and +trailing space, and converting multiple consecutive spaces +to single spaces. +. .It Cm \&:N Ns Ar pattern This is identical to .Ql Cm \&:M , @@ -1209,7 +1220,7 @@ The modifier is just like the .Cm \&:S modifier except that the old and new strings, instead of being -simple strings, are a regular expression (see +simple strings, are an extended regular expression (see .Xr regex 3 ) string .Ar pattern @@ -1239,6 +1250,15 @@ and are orthogonal; the former specifies whether multiple words are potentially affected, the latter whether multiple substitutions can potentially occur within each affected word. +.Pp +As for the +.Cm \&:S +modifier, the +.Ar pattern +and +.Ar replacement +are subjected to variable expansion before being parsed as +regular expressions. .It Cm \&:T Replaces each word in the variable with its last component. .It Cm \&:u @@ -1751,7 +1771,7 @@ or .Fl t options were specified. Normally used to mark recursive -.Nm Ns 's . +.Nm Ns s . .It Ic .META Create a meta file for the target, even if it is flagged as .Ic .PHONY , Modified: stable/10/contrib/bmake/bmake.cat1 ============================================================================== --- stable/10/contrib/bmake/bmake.cat1 Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/bmake.cat1 Sat Dec 27 16:43:22 2014 (r276305) @@ -450,6 +450,13 @@ VVAARRIIAABBLLEE AASSSSIIGG _._C_U_R_D_I_R A path to the directory where bbmmaakkee was executed. Refer to the description of `PWD' for more details. + _._I_N_C_L_U_D_E_D_F_R_O_M_D_I_R + The directory of the file this Makefile was included + from. + + _._I_N_C_L_U_D_E_D_F_R_O_M_F_I_L_E + The filename of the file this Makefile was included from. + MAKE The name that bbmmaakkee was executed with (_a_r_g_v_[_0_]). For compatibility bbmmaakkee also sets _._M_A_K_E with the same value. The preferred variable to use is the environment variable @@ -690,7 +697,13 @@ VVAARRIIAABBLLEE AASSSSIIGG ::MM_p_a_t_t_e_r_n Select only those words that match _p_a_t_t_e_r_n. The standard shell wildcard characters (`*', `?', and `[]') may be used. The wildcard - characters may be escaped with a backslash (`\'). + characters may be escaped with a backslash (`\'). As a consequence + of the way values are split into words, matched, and then joined, a + construct like + ${VAR:M*} + will normalise the inter-word spacing, removing all leading and + trailing space, and converting multiple consecutive spaces to single + spaces. ::NN_p_a_t_t_e_r_n This is identical to `::MM', but selects all words which do not match @@ -777,18 +790,21 @@ VVAARRIIAABBLLEE AASSSSIIGG ::CC/_p_a_t_t_e_r_n/_r_e_p_l_a_c_e_m_e_n_t/[11ggWW] The ::CC modifier is just like the ::SS modifier except that the old and - new strings, instead of being simple strings, are a regular expres- - sion (see regex(3)) string _p_a_t_t_e_r_n and an ed(1)-style string - _r_e_p_l_a_c_e_m_e_n_t. Normally, the first occurrence of the pattern _p_a_t_t_e_r_n - in each word of the value is substituted with _r_e_p_l_a_c_e_m_e_n_t. The `1' - modifier causes the substitution to apply to at most one word; the - `g' modifier causes the substitution to apply to as many instances - of the search pattern _p_a_t_t_e_r_n as occur in the word or words it is - found in; the `W' modifier causes the value to be treated as a sin- - gle word (possibly containing embedded white space). Note that `1' - and `g' are orthogonal; the former specifies whether multiple words - are potentially affected, the latter whether multiple substitutions - can potentially occur within each affected word. + new strings, instead of being simple strings, are an extended regu- + lar expression (see regex(3)) string _p_a_t_t_e_r_n and an ed(1)-style + string _r_e_p_l_a_c_e_m_e_n_t. Normally, the first occurrence of the pattern + _p_a_t_t_e_r_n in each word of the value is substituted with _r_e_p_l_a_c_e_m_e_n_t. + The `1' modifier causes the substitution to apply to at most one + word; the `g' modifier causes the substitution to apply to as many + instances of the search pattern _p_a_t_t_e_r_n as occur in the word or + words it is found in; the `W' modifier causes the value to be + treated as a single word (possibly containing embedded white space). + Note that `1' and `g' are orthogonal; the former specifies whether + multiple words are potentially affected, the latter whether multiple + substitutions can potentially occur within each affected word. + + As for the ::SS modifier, the _p_a_t_t_e_r_n and _r_e_p_l_a_c_e_m_e_n_t are subjected to + variable expansion before being parsed as regular expressions. ::TT Replaces each word in the variable with its last component. @@ -1107,7 +1123,7 @@ SSPPEECCIIAALL SSOOUURRCCEE ..MMAAKKEE Execute the commands associated with this target even if the --nn or --tt options were specified. Normally used to mark recursive - bbmmaakkee's. + bbmmaakkees. ..MMEETTAA Create a meta file for the target, even if it is flagged as ..PPHHOONNYY, ..MMAAKKEE, or ..SSPPEECCIIAALL. Usage in conjunction with ..MMAAKKEE is @@ -1378,4 +1394,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 August 11, 2013 NetBSD 5.1 +NetBSD 5.1 February 14, 2014 NetBSD 5.1 Modified: stable/10/contrib/bmake/boot-strap ============================================================================== --- stable/10/contrib/bmake/boot-strap Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/boot-strap Sat Dec 27 16:43:22 2014 (r276305) @@ -111,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.43 2013/03/02 18:55:23 sjg Exp $ +# $Id: boot-strap,v 1.45 2014/04/05 22:56:54 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -197,7 +197,7 @@ get_optarg() { here=`'pwd'` if [ $here = $Mydir ]; then - # avoid polution + # avoid pollution OBJROOT=../ fi @@ -216,11 +216,9 @@ do --share=*) share_dir=`get_optarg "$1"`;; --share) share_dir="$2"; shift;; --with-default-sys-path=*) - CONFIGURE_ARGS="$1" - MAKESYSPATH=`get_optarg "$1"`;; + CONFIGURE_ARGS="$1";; --with-default-sys-path) - CONFIGURE_ARGS="$1 $2" - MAKESYSPATH="$2"; shift;; + CONFIGURE_ARGS="$1 $2";; --install) INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix};; --install-host-target) INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix} @@ -330,8 +328,8 @@ add_path () { srcdir=`GetDir /bmake make-bootstrap.sh.in "$srcdir" "$2" "$Mydir" ./bmake* "$Mydir"/../bmake*` [ -d "${srcdir:-/dev/null}" ] || Usage case "$mksrc" in -none|-) # we don't want it - mksrc= +none|-) # we ignore this now + mksrc=$Mydir/mk ;; .../*) # find here or above mksrc=`FindHereOrAbove -C "$Mydir" -s "$mksrc/sys.mk"` @@ -455,7 +453,7 @@ op_all() { echo "Use --install-destdir=/somewhere to set DESTDIR during install" echo "Use --install-host-target to use INSTALL_BIN=$HOST_TARGET/bin" echo "Use -DWITH_PROG_VERSION to install as bmake-$MAKE_VERSION" - echo "Use -DWITHOUT_PROG_LINK to supress bmake -> bmake-$MAKE_VERSION symlink" + echo "Use -DWITHOUT_PROG_LINK to suppress bmake -> bmake-$MAKE_VERSION symlink" echo "Use -DWITHOUT_INSTALL_MK to skip installing files to $prefix/share/mk" fi } Modified: stable/10/contrib/bmake/bsd.after-import.mk ============================================================================== --- stable/10/contrib/bmake/bsd.after-import.mk Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/bsd.after-import.mk Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -# $Id: bsd.after-import.mk,v 1.11 2012/12/29 19:32:25 sjg Exp $ +# $Id: bsd.after-import.mk,v 1.12 2014/02/14 23:45:49 sjg Exp $ # This makefile is for use when integrating bmake into a BSD build # system. Use this makefile after importing bmake. @@ -41,15 +41,13 @@ SRCTOP := ${srctop} HOST_OS!= uname .endif -# .../share/mk will find ${SRCTOP}/share/mk -# if we are within ${SRCTOP} -DEFAULT_SYS_PATH= .../share/mk:/usr/share/mk - BOOTSTRAP_ARGS = \ - --with-default-sys-path='${DEFAULT_SYS_PATH}' \ --prefix /usr \ --share /usr/share +.if !empty(DEFAULT_SYS_PATH) +BOOTSTRAP_ARGS += --with-default-sys-path='${DEFAULT_SYS_PATH}' +.endif # run boot-strap with minimal influence bootstrap: ${BMAKE_SRC}/boot-strap ${MAKEFILE} Modified: stable/10/contrib/bmake/compat.c ============================================================================== --- stable/10/contrib/bmake/compat.c Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/compat.c Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.93 2013/09/02 19:26:42 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.94 2014/01/03 00:02:01 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.93 2013/09/02 19:26:42 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.94 2014/01/03 00:02:01 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.93 2013/09/02 19:26:42 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.94 2014/01/03 00:02:01 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -133,7 +133,7 @@ Compat_Init(void) Shell_Init(); /* setup default shell */ - for (cp = "#=|^(){};&<>*?[]:$`\\\n"; *cp != '\0'; cp++) { + for (cp = "~#=|^(){};&<>*?[]:$`\\\n"; *cp != '\0'; cp++) { meta[(unsigned char) *cp] = 1; } /* Modified: stable/10/contrib/bmake/config.h.in ============================================================================== --- stable/10/contrib/bmake/config.h.in Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/config.h.in Sat Dec 27 16:43:22 2014 (r276305) @@ -144,6 +144,9 @@ `HAVE_STRUCT_STAT_ST_RDEV' instead. */ #undef HAVE_ST_RDEV +/* Define to 1 if you have the `sysctl' function. */ +#undef HAVE_SYSCTL + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H @@ -164,6 +167,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCTL_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H @@ -298,6 +304,9 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* C99 function name */ +#undef __func__ + /* Define to empty if `const' does not conform to ANSI C. */ #undef const Modified: stable/10/contrib/bmake/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/10/contrib/bmake/configure.in ============================================================================== --- stable/10/contrib/bmake/configure.in Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/configure.in Sat Dec 27 16:43:22 2014 (r276305) @@ -1,11 +1,12 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.49 2013/07/06 18:25:19 sjg Exp $ +dnl $Id: configure.in,v 1.52 2014/02/15 22:27:59 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl -AC_INIT([bmake], [20130706], [sjg@NetBSD.org]) -AC_CONFIG_HEADER(config.h) +AC_PREREQ(2.50) +AC_INIT([bmake], [20140214], [sjg@NetBSD.org]) +AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute case "$srcdir" in @@ -77,7 +78,18 @@ AC_PROG_GCC_TRADITIONAL AC_PROG_INSTALL dnl Executable suffix - normally empty; .exe on os2. AC_SUBST(ac_exe_suffix)dnl - +dnl +dnl Hurd refuses to define PATH_MAX or MAXPATHLEN +if test -x /usr/bin/getconf; then + bmake_path_max=`getconf PATH_MAX / 2> /dev/null` +fi +bmake_path_max=${bmake_path_max:-1024} +if test $bmake_path_max -gt 1024; then + # this is all we expect + bmake_path_max=1024 +fi +echo "Using: BMAKE_PATH_MAX=$bmake_path_max" >&6 +AC_SUBST(bmake_path_max)dnl dnl dnl AC_C_CROSS dnl @@ -98,6 +110,7 @@ AC_CHECK_HEADERS( \ sys/mman.h \ sys/select.h \ sys/socket.h \ + sys/sysctl.h \ sys/time.h \ sys/uio.h \ unistd.h \ @@ -159,6 +172,7 @@ AC_CHECK_FUNCS( \ strsep \ strtod \ strtol \ + sysctl \ unsetenv \ vsnprintf \ wait3 \ @@ -189,6 +203,11 @@ dnl AC_HEADER_STAT AC_STRUCT_ST_RDEV dnl +echo "checking if compiler supports __func__" >&6 +AC_LANG(C) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[[const char *func = __func__;]])],, + AC_DEFINE(__func__, __FUNCTION__, C99 function name)) +dnl dnl we want this for unit-tests/Makefile echo $ECHO_N "checking if diff -u works... $ECHO_C" >&6 if diff -u /dev/null /dev/null > /dev/null 2>&1; then Modified: stable/10/contrib/bmake/hash.c ============================================================================== --- stable/10/contrib/bmake/hash.c Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/hash.c Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.c,v 1.19 2009/01/24 10:59:09 dsl Exp $ */ +/* $NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: hash.c,v 1.19 2009/01/24 10:59:09 dsl Exp $"; +static char rcsid[] = "$NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: hash.c,v 1.19 2009/01/24 10:59:09 dsl Exp $"); +__RCSID("$NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -221,6 +221,9 @@ Hash_FindEntry(Hash_Table *t, const char unsigned h; const char *p; + if (t == NULL || t->bucketPtr == NULL) { + return NULL; + } for (h = 0, p = key; *p;) h = (h << 5) - h + *p++; p = key; Modified: stable/10/contrib/bmake/lst.lib/lstMember.c ============================================================================== --- stable/10/contrib/bmake/lst.lib/lstMember.c Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/lst.lib/lstMember.c Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -/* $NetBSD: lstMember.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */ +/* $NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -33,14 +33,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstMember.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"; +static char rcsid[] = "$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: lstMember.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"); +__RCSID("$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -58,6 +58,9 @@ Lst_Member(Lst l, void *d) List list = l; ListNode lNode; + if (list == NULL) { + return NULL; + } lNode = list->firstPtr; if (lNode == NULL) { return NULL; Modified: stable/10/contrib/bmake/main.c ============================================================================== --- stable/10/contrib/bmake/main.c Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/main.c Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $ */ +/* $NetBSD: main.c,v 1.226 2014/02/07 17:23:35 pooka Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.226 2014/02/07 17:23:35 pooka Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.226 2014/02/07 17:23:35 pooka Exp $"); #endif #endif /* not lint */ #endif @@ -118,6 +118,9 @@ __RCSID("$NetBSD: main.c,v 1.224 2013/09 #include #include #include +#if defined(MAKE_NATIVE) && defined(HAVE_SYSCTL) +#include +#endif #include #include "wait.h" @@ -145,6 +148,10 @@ __RCSID("$NetBSD: main.c,v 1.224 2013/09 #define DEFMAXLOCAL DEFMAXJOBS #endif /* DEFMAXLOCAL */ +#ifndef __arraycount +# define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) +#endif + Lst create; /* Targets to be made */ time_t now; /* Time at start of make */ GNode *DEFAULT; /* .DEFAULT node */ @@ -910,6 +917,20 @@ main(int argc, char **argv) } if (!machine_arch) { +#if defined(MAKE_NATIVE) && defined(HAVE_SYSCTL) && defined(CTL_HW) && defined(HW_MACHINE_ARCH) + static char machine_arch_buf[sizeof(utsname.machine)]; + int mib[2] = { CTL_HW, HW_MACHINE_ARCH }; + size_t len = sizeof(machine_arch_buf); + + if (sysctl(mib, __arraycount(mib), machine_arch_buf, + &len, NULL, 0) < 0) { + (void)fprintf(stderr, "%s: sysctl failed (%s).\n", progname, + strerror(errno)); + exit(2); + } + + machine_arch = machine_arch_buf; +#else #ifndef MACHINE_ARCH #ifdef MAKE_MACHINE_ARCH machine_arch = MAKE_MACHINE_ARCH; @@ -919,6 +940,7 @@ main(int argc, char **argv) #else machine_arch = MACHINE_ARCH; #endif +#endif } myPid = getpid(); /* remember this for vFork() */ @@ -1080,11 +1102,12 @@ main(int argc, char **argv) */ #ifndef NO_PWD_OVERRIDE if (!ignorePWD) { - char *pwd; + char *pwd, *ptmp1 = NULL, *ptmp2 = NULL; if ((pwd = getenv("PWD")) != NULL && - getenv("MAKEOBJDIRPREFIX") == NULL) { - const char *makeobjdir = getenv("MAKEOBJDIR"); + Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &ptmp1) == NULL) { + const char *makeobjdir = Var_Value("MAKEOBJDIR", + VAR_CMD, &ptmp2); if (makeobjdir == NULL || !strchr(makeobjdir, '$')) { if (stat(pwd, &sb) == 0 && @@ -1093,6 +1116,8 @@ main(int argc, char **argv) (void)strncpy(curdir, pwd, MAXPATHLEN); } } + free(ptmp1); + free(ptmp2); } #endif Var_Set(".CURDIR", curdir, VAR_GLOBAL, 0); @@ -1109,11 +1134,13 @@ main(int argc, char **argv) Dir_Init(curdir); (void)Main_SetObjdir(curdir); - if ((path = getenv("MAKEOBJDIRPREFIX")) != NULL) { + if ((path = Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &p1)) != NULL) { (void)snprintf(mdpath, MAXPATHLEN, "%s%s", path, curdir); (void)Main_SetObjdir(mdpath); - } else if ((path = getenv("MAKEOBJDIR")) != NULL) { + free(p1); + } else if ((path = Var_Value("MAKEOBJDIR", VAR_CMD, &p1)) != NULL) { (void)Main_SetObjdir(path); + free(p1); } else { (void)snprintf(mdpath, MAXPATHLEN, "%s.%s", _PATH_OBJDIR, machine); if (!Main_SetObjdir(mdpath) && !Main_SetObjdir(_PATH_OBJDIR)) { Modified: stable/10/contrib/bmake/make-bootstrap.sh.in ============================================================================== --- stable/10/contrib/bmake/make-bootstrap.sh.in Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/make-bootstrap.sh.in Sat Dec 27 16:43:22 2014 (r276305) @@ -11,7 +11,7 @@ yes) XDEFS="-DUSE_META ${XDEFS}";; esac CC="@CC@" -CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS}" +CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS} -DBMAKE_PATH_MAX=@bmake_path_max@" MAKE_VERSION=`sed -n '/^MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile` Modified: stable/10/contrib/bmake/make.1 ============================================================================== --- stable/10/contrib/bmake/make.1 Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/make.1 Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.222 2013/08/11 09:53:49 apb Exp $ +.\" $NetBSD: make.1,v 1.230 2014/02/15 18:55:30 sjg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd August 11, 2013 +.Dd February 14, 2014 .Dt MAKE 1 .Os .Sh NAME @@ -706,6 +706,10 @@ was executed. Refer to the description of .Ql Ev PWD for more details. +.It Va .INCLUDEDFROMDIR +The directory of the file this Makefile was included from. +.It Va .INCLUDEDFROMFILE +The filename of the file this Makefile was included from. .It Ev MAKE The name that .Nm @@ -756,7 +760,7 @@ then output for each target is prefixed .Ql --- target --- the first part of which can be controlled via .Va .MAKE.JOB.PREFIX . -If +If .Va .MAKE.JOB.PREFIX is empty, no token is printed. .br @@ -1077,6 +1081,13 @@ may be used. The wildcard characters may be escaped with a backslash .Pq Ql \e . +As a consequence of the way values are split into words, matched, +and then joined, a construct like +.Dl ${VAR:M*} +will normalise the inter-word spacing, removing all leading and +trailing space, and converting multiple consecutive spaces +to single spaces. +. .It Cm \&:N Ns Ar pattern This is identical to .Ql Cm \&:M , @@ -1220,7 +1231,7 @@ The modifier is just like the .Cm \&:S modifier except that the old and new strings, instead of being -simple strings, are a regular expression (see +simple strings, are an extended regular expression (see .Xr regex 3 ) string .Ar pattern @@ -1250,6 +1261,15 @@ and are orthogonal; the former specifies whether multiple words are potentially affected, the latter whether multiple substitutions can potentially occur within each affected word. +.Pp +As for the +.Cm \&:S +modifier, the +.Ar pattern +and +.Ar replacement +are subjected to variable expansion before being parsed as +regular expressions. .It Cm \&:T Replaces each word in the variable with its last component. .It Cm \&:u @@ -1762,7 +1782,7 @@ or .Fl t options were specified. Normally used to mark recursive -.Nm Ns 's . +.Nm Ns s . .It Ic .META Create a meta file for the target, even if it is flagged as .Ic .PHONY , Modified: stable/10/contrib/bmake/make.h ============================================================================== --- stable/10/contrib/bmake/make.h Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/make.h Sat Dec 27 16:43:22 2014 (r276305) @@ -518,4 +518,8 @@ int str2Lst_Append(Lst, char *, const ch #define MAX(a, b) ((a > b) ? a : b) #endif +#ifndef MAXPATHLEN +#define MAXPATHLEN BMAKE_PATH_MAX +#endif + #endif /* _MAKE_H_ */ Modified: stable/10/contrib/bmake/meta.c ============================================================================== --- stable/10/contrib/bmake/meta.c Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/meta.c Sat Dec 27 16:43:22 2014 (r276305) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.32 2013/06/25 00:20:54 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.33 2013/10/01 05:37:17 sjg Exp $ */ /* * Implement 'meta' mode. @@ -860,6 +860,13 @@ string_match(const void *p, const void * continue; \ } +#define DEQUOTE(p) if (*p == '\'') { \ + char *ep; \ + p++; \ + if ((ep = strchr(p, '\''))) \ + *ep = '\0'; \ + } + Boolean meta_oodate(GNode *gn, Boolean oodate) { @@ -872,6 +879,8 @@ meta_oodate(GNode *gn, Boolean oodate) char fname2[MAXPATHLEN]; char *p; char *cp; + char *link_src; + char *move_target; static size_t cwdlen = 0; static size_t tmplen = 0; FILE *fp; @@ -938,6 +947,8 @@ meta_oodate(GNode *gn, Boolean oodate) oodate = TRUE; break; } + link_src = NULL; + move_target = NULL; /* Find the start of the build monitor section. */ if (!f) { if (strncmp(buf, "-- filemon", 10) == 0) { @@ -1051,16 +1062,21 @@ meta_oodate(GNode *gn, Boolean oodate) break; case 'M': /* renaMe */ - if (Lst_IsEmpty(missingFiles)) - break; + /* + * For 'M'oves we want to check + * the src as for 'R'ead + * and the target as for 'W'rite. + */ + cp = p; /* save this for a second */ + /* now get target */ + if (strsep(&p, " ") == NULL) + continue; + CHECK_VALID_META(p); + move_target = p; + p = cp; /* 'L' and 'M' put single quotes around the args */ - if (*p == '\'') { - char *ep; - - p++; - if ((ep = strchr(p, '\''))) - *ep = '\0'; - } + DEQUOTE(p); + DEQUOTE(move_target); /* FALLTHROUGH */ case 'D': /* unlink */ if (*p == '/' && !Lst_IsEmpty(missingFiles)) { @@ -1072,22 +1088,39 @@ meta_oodate(GNode *gn, Boolean oodate) ln = NULL; /* we're done with it */ } } + if (buf[0] == 'M') { + /* the target of the mv is a file 'W'ritten */ +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: M %s -> %s\n", + p, move_target); +#endif + p = move_target; + goto check_write; + } break; case 'L': /* Link */ - /* we want the target */ + /* + * For 'L'inks check + * the src as for 'R'ead + * and the target as for 'W'rite. + */ + link_src = p; + /* now get target */ if (strsep(&p, " ") == NULL) continue; CHECK_VALID_META(p); /* 'L' and 'M' put single quotes around the args */ - if (*p == '\'') { - char *ep; - - p++; - if ((ep = strchr(p, '\''))) - *ep = '\0'; - } + DEQUOTE(p); + DEQUOTE(link_src); +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: L %s -> %s\n", + link_src, p); +#endif /* FALLTHROUGH */ case 'W': /* Write */ + check_write: /* * If a file we generated within our bailiwick * but outside of .OBJDIR is missing, @@ -1119,6 +1152,14 @@ meta_oodate(GNode *gn, Boolean oodate) Lst_AtEnd(missingFiles, bmake_strdup(p)); } break; + check_link_src: + p = link_src; + link_src = NULL; +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "meta_oodate: L src %s\n", p); +#endif + /* FALLTHROUGH */ case 'R': /* Read */ case 'E': /* Exec */ /* @@ -1213,6 +1254,8 @@ meta_oodate(GNode *gn, Boolean oodate) default: break; } + if (!oodate && buf[0] == 'L' && link_src != NULL) + goto check_link_src; } else if (strcmp(buf, "CMD") == 0) { /* * Compare the current command with the one in the Modified: stable/10/contrib/bmake/mk/ChangeLog ============================================================================== --- stable/10/contrib/bmake/mk/ChangeLog Sat Dec 27 15:17:59 2014 (r276304) +++ stable/10/contrib/bmake/mk/ChangeLog Sat Dec 27 16:43:22 2014 (r276305) @@ -1,3 +1,79 @@ +2014-05-22 Simon J. Gerraty + + * install-mk (MK_VERSION): 20140522 + + * lib.mk: use CC to link shlib for linux too + patch from Brendan MacDonell + +2014-05-05 Simon J. Gerraty + + * meta.autodep.mk: add _reldir_{finish,failed} for gathering stats + if WITH_META_STATS is defined. + +2014-05-02 Simon J. Gerraty + + * dirdeps.mk: accept -DWITHOUT_DIRDEPS (same a as -DNO_DIRDEPS) + to supress dirdeps outside of .CURDIR. + +2014-04-05 Simon J. Gerraty + + * Fix spelling errors - patch from Pedro Giffuni + +2014-03-14 Simon J. Gerraty + + * install-mk (MK_VERSION): 20140314 + + * dirdeps.mk (beforedirdeps): a handy hook + + * dirdeps.mk (DIRDEP_MAKE): allow the actual command we run + to visit leaf dirs to be intercepted (eg. for distributed + build). + + * dirdeps.mk (__depdirs): ensure // don't sneak in + + * gendirdeps.mk (DIRDEPS): ensure // don't sneak in + + +2014-02-21 Simon J. Gerraty + + * rst2htm.mk (RST2PDF): add support for rst2pdf + +2014-02-14 Simon J. Gerraty + + * install-mk (MK_VERSION): bump version + * dirdeps.mk (_last_dependfile): use .INCLUDEDFROMFILE if + available. + +2014-02-10 Simon J. Gerraty + + * options.mk: avoid :U so this isn't bmake dependent + +2014-02-09 Simon J. Gerraty + + * options.mk: cleanup and simplify semanitcs + NO_* dominates all, if both WITH_* and WITHOUT_* + are defined then result is DOMINATE_* which defaults to "no". + Ie. WITHOUT_ normally wins. + *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***