From owner-svn-src-all@FreeBSD.ORG Tue Oct 9 06:32:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BF1D107B; Tue, 9 Oct 2012 06:32:27 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA7C8FC20; Tue, 9 Oct 2012 06:32:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9956UMS041278; Tue, 9 Oct 2012 05:06:30 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9956U2Z041272; Tue, 9 Oct 2012 05:06:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201210090506.q9956U2Z041272@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 9 Oct 2012 05:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r241368 - in stable/8: tools/regression/usr.bin/make tools/regression/usr.bin/make/variables/modifier_t tools/regression/usr.bin/make/variables/opt_V usr.bin/make X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 06:32:27 -0000 Author: obrien Date: Tue Oct 9 05:06:30 2012 New Revision: 241368 URL: http://svn.freebsd.org/changeset/base/241368 Log: MF9: r237100: MFC r236338, r236339, r236346, r236347, r236365, & r236977 * Deprecate the FreeBSD 10's make's ":U" (to-upper case) and ":L" (to-lower case) modifiers for ":tu" and ":tl". * make it easier to test newly-built make. * Add "-V '${VAR}'" variable expansion from Portable Berkeley Make. * regression test for '-V' command line option and the :t[lu] modifiers. MF9: r241364: Update MAKE_VERSION for r237100. MFC: r201225: add missing `void' keyword. Added: stable/8/tools/regression/usr.bin/make/test-new.mk - copied unchanged from r237100, stable/9/tools/regression/usr.bin/make/test-new.mk stable/8/tools/regression/usr.bin/make/variables/modifier_t/ - copied from r237100, stable/9/tools/regression/usr.bin/make/variables/modifier_t/ stable/8/tools/regression/usr.bin/make/variables/opt_V/ - copied from r237100, stable/9/tools/regression/usr.bin/make/variables/opt_V/ Modified: stable/8/usr.bin/make/Makefile stable/8/usr.bin/make/job.c stable/8/usr.bin/make/make.1 stable/8/usr.bin/make/var.c Directory Properties: stable/8/ (props changed) stable/8/tools/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/make/all.sh (props changed) stable/8/tools/regression/usr.bin/make/common.sh (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/make/ (props changed) Copied: stable/8/tools/regression/usr.bin/make/test-new.mk (from r237100, stable/9/tools/regression/usr.bin/make/test-new.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/usr.bin/make/test-new.mk Tue Oct 9 05:06:30 2012 (r241368, copy of r237100, stable/9/tools/regression/usr.bin/make/test-new.mk) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +NEW_DIR!= make -C ${.CURDIR}/../../../../usr.bin/make -V .OBJDIR + +all: + rm -rf /tmp/${USER}.make.test + env MAKE_PROG=${NEW_DIR}/make ${.SHELL} ./all.sh + +.include Modified: stable/8/usr.bin/make/Makefile ============================================================================== --- stable/8/usr.bin/make/Makefile Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/Makefile Tue Oct 9 05:06:30 2012 (r241368) @@ -11,7 +11,9 @@ SRCS= arch.c buf.c cond.c dir.c for.c ha WARNS?= 6 NO_SHARED?= YES -CFLAGS+=-DMAKE_VERSION=\"5200408120\" +# Version has the RYYYYMMDDX format, where R is from RELENG_ +CFLAGS+=-DMAKE_VERSION=\"8201210080\" + # There is no obvious performance improvement currently. # CFLAGS+=-DUSE_KQUEUE Modified: stable/8/usr.bin/make/job.c ============================================================================== --- stable/8/usr.bin/make/job.c Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/job.c Tue Oct 9 05:06:30 2012 (r241368) @@ -485,7 +485,7 @@ catch_child(int sig __unused) /** */ void -Proc_Init() +Proc_Init(void) { /* * Catch SIGCHLD so that we get kicked out of select() when we Modified: stable/8/usr.bin/make/make.1 ============================================================================== --- stable/8/usr.bin/make/make.1 Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/make.1 Tue Oct 9 05:06:30 2012 (r241368) @@ -32,7 +32,7 @@ .\" @(#)make.1 8.8 (Berkeley) 6/13/95 .\" $FreeBSD$ .\" -.Dd November 5, 2011 +.Dd May 30, 2012 .Dt MAKE 1 .Os .Sh NAME @@ -290,6 +290,11 @@ Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +If +.Ar variable +contains a +.Sq Ic $ +then the value will be expanded before printing. .It Fl v Be extra verbose. Print any extra information. @@ -873,6 +878,7 @@ Replaces each word in the variable with .It Cm L Converts variable to lower-case letters. .It Cm M Ns Ar pattern +(deprecated) Select only those words that match the rest of the modifier. The standard shell wildcard characters .Pf ( Ql * , @@ -963,8 +969,13 @@ to be replaced in .Ar new_string . .It Cm T Replaces each word in the variable with its last component. +.It Cm tl +Converts variable to lower-case letters. +.It Cm tu +Converts variable to upper-case letters. .It Cm U Converts variable to upper-case letters. +(deprecated) .It Cm u Remove adjacent duplicate words (like .Xr uniq 1 ) . @@ -1711,6 +1722,19 @@ is set to the same value as .Va .MAKE ; support for this may be removed in the future. .Pp +The use of the +.Cm :L +and +.Cm :U +modifiers will be deprecated +in +.Fx 10.0 +and the more portable (among Pmake decedents) +.Cm :tl +and +.Cm :tu +should be used instead. +.Pp Most of the more esoteric features of .Nm should probably be avoided for greater compatibility. Modified: stable/8/usr.bin/make/var.c ============================================================================== --- stable/8/usr.bin/make/var.c Tue Oct 9 03:54:53 2012 (r241367) +++ stable/8/usr.bin/make/var.c Tue Oct 9 05:06:30 2012 (r241368) @@ -1748,6 +1748,19 @@ ParseModifier(VarParser *vp, char startc case 'C': newStr = modifier_C(vp, value, v); break; + case 't': + /* :tl :tu for OSF ODE & NetBSD make compatibility */ + switch (vp->ptr[1]) { + case 'l': + vp->ptr++; + goto mod_lower; + break; + case 'u': + vp->ptr++; + goto mod_upper; + break; + } + /* FALLTHROUGH */ default: if (vp->ptr[1] != endc && vp->ptr[1] != ':') { #ifdef SUNSHCMD @@ -1776,6 +1789,7 @@ ParseModifier(VarParser *vp, char startc switch (vp->ptr[0]) { case 'L': + mod_lower: { const char *cp; Buffer *buf; @@ -1801,6 +1815,7 @@ ParseModifier(VarParser *vp, char startc vp->ptr++; break; case 'U': + mod_upper: { const char *cp; Buffer *buf; @@ -2580,7 +2595,7 @@ void Var_Print(Lst *vlist, Boolean expandVars) { LstNode *n; - const char *name; + char *name; LST_FOREACH(n, vlist) { name = Lst_Datum(n); @@ -2588,13 +2603,17 @@ Var_Print(Lst *vlist, Boolean expandVars char *value; char *v; - v = emalloc(strlen(name) + 1 + 3); - sprintf(v, "${%s}", name); - + if (*name == '$') { + v = name; + } else { + v = emalloc(strlen(name) + 1 + 3); + sprintf(v, "${%s}", name); + } value = Buf_Peel(Var_Subst(v, VAR_GLOBAL, FALSE)); printf("%s\n", value); - free(v); + if (v != name) + free(v); free(value); } else { const char *value = Var_Value(name, VAR_GLOBAL);