Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2012 05:06:30 +0000 (UTC)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
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
Message-ID:  <201210090506.q9956U2Z041272@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <bsd.obj.mk>

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_<R>
+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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210090506.q9956U2Z041272>