Author: obrien
Date: Tue Oct  9 13:21:08 2012
New Revision: 241372
URL: http://svn.freebsd.org/changeset/base/241372

Log:
  MF8: r241368:
    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/7/tools/regression/usr.bin/make/test-new.mk
     - copied unchanged from r241368, 
stable/8/tools/regression/usr.bin/make/test-new.mk
  stable/7/tools/regression/usr.bin/make/variables/modifier_t/
     - copied from r241368, 
stable/8/tools/regression/usr.bin/make/variables/modifier_t/
  stable/7/tools/regression/usr.bin/make/variables/opt_V/
     - copied from r241368, 
stable/8/tools/regression/usr.bin/make/variables/opt_V/
Modified:
  stable/7/usr.bin/make/Makefile
  stable/7/usr.bin/make/job.c
  stable/7/usr.bin/make/make.1
  stable/7/usr.bin/make/var.c
Directory Properties:
  stable/7/   (props changed)
  stable/7/tools/   (props changed)
  stable/7/tools/regression/usr.bin/   (props changed)
  stable/7/tools/regression/usr.bin/make/all.sh   (props changed)
  stable/7/tools/regression/usr.bin/make/common.sh   (props changed)
  stable/7/usr.bin/   (props changed)
  stable/7/usr.bin/make/   (props changed)

Copied: stable/7/tools/regression/usr.bin/make/test-new.mk (from r241368, 
stable/8/tools/regression/usr.bin/make/test-new.mk)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/7/tools/regression/usr.bin/make/test-new.mk  Tue Oct  9 13:21:08 
2012        (r241372, copy of r241368, 
stable/8/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/7/usr.bin/make/Makefile
==============================================================================
--- stable/7/usr.bin/make/Makefile      Tue Oct  9 12:22:43 2012        
(r241371)
+++ stable/7/usr.bin/make/Makefile      Tue Oct  9 13:21:08 2012        
(r241372)
@@ -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=\"7201210080\"
+
 # There is no obvious performance improvement currently.
 # CFLAGS+=-DUSE_KQUEUE
 

Modified: stable/7/usr.bin/make/job.c
==============================================================================
--- stable/7/usr.bin/make/job.c Tue Oct  9 12:22:43 2012        (r241371)
+++ stable/7/usr.bin/make/job.c Tue Oct  9 13:21:08 2012        (r241372)
@@ -480,7 +480,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/7/usr.bin/make/make.1
==============================================================================
--- stable/7/usr.bin/make/make.1        Tue Oct  9 12:22:43 2012        
(r241371)
+++ stable/7/usr.bin/make/make.1        Tue Oct  9 13:21:08 2012        
(r241372)
@@ -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/7/usr.bin/make/var.c
==============================================================================
--- stable/7/usr.bin/make/var.c Tue Oct  9 12:22:43 2012        (r241371)
+++ stable/7/usr.bin/make/var.c Tue Oct  9 13:21:08 2012        (r241372)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to