? verbatim-patch.diff
Index: read.c
===================================================================
RCS file: /sources/make/make/read.c,v
retrieving revision 1.167
diff -p -u -r1.167 read.c
--- read.c	4 Jul 2007 19:35:19 -0000	1.167
+++ read.c	16 Aug 2007 08:22:01 -0000
@@ -686,8 +686,9 @@ eval (struct ebuffer *ebuf, int set_defa
 	   can appear in the middle of a rule.  */
 	continue;
 
-      if (word1eq ("export"))
+      if (word1eq ("export") || word1eq ("verbatim"))
 	{
+          char verbatim = word1eq ("verbatim");
           /* 'export' by itself causes everything to be exported. */
 	  if (*p2 == '\0')
             export_all_variables = 1;
@@ -697,7 +698,7 @@ eval (struct ebuffer *ebuf, int set_defa
 
               v = try_variable_definition (fstart, p2, o_file, 0);
               if (v != 0)
-                v->export = v_export;
+                v->export = verbatim ? v_verbatim : v_export;
               else
                 {
                   unsigned int l;
@@ -714,7 +715,7 @@ eval (struct ebuffer *ebuf, int set_defa
                       v = lookup_variable (p, l);
                       if (v == 0)
                         v = define_variable_loc (p, l, "", o_file, 0, fstart);
-                      v->export = v_export;
+                      v->export = verbatim ? v_verbatim : v_export;
                     }
 
                   free (ap);
Index: variable.c
===================================================================
RCS file: /sources/make/make/variable.c,v
retrieving revision 1.92
diff -p -u -r1.92 variable.c
--- variable.c	4 Jul 2007 19:35:20 -0000	1.92
+++ variable.c	16 Aug 2007 08:22:01 -0000
@@ -911,6 +911,7 @@ target_environment (struct file *file)
 		  continue;
 		break;
 
+	      case v_verbatim:
 	      case v_export:
 		break;
 
@@ -956,7 +957,7 @@ target_environment (struct file *file)
 	if (v->recursive
 	    && v->origin != o_env && v->origin != o_env_override)
 	  {
-	    char *value = recursively_expand_for_file (v, file);
+	    char *value = (v->export == v_verbatim) ? xstrdup (v->value) : recursively_expand_for_file (v, file);
 #ifdef WINDOWS32
 	    if (strcmp(v->name, "Path") == 0 ||
 		strcmp(v->name, "PATH") == 0)
Index: variable.h
===================================================================
RCS file: /sources/make/make/variable.h,v
retrieving revision 1.37
diff -p -u -r1.37 variable.h
--- variable.h	4 Jul 2007 19:35:20 -0000	1.37
+++ variable.h	16 Aug 2007 08:22:01 -0000
@@ -72,11 +72,12 @@ struct variable
       origin ENUM_BITFIELD (3);	/* Variable origin.  */
     enum variable_export
       {
+	v_verbatim,		/* Export this variable without expanding it.  */
 	v_export,		/* Export this variable.  */
 	v_noexport,		/* Don't export this variable.  */
 	v_ifset,		/* Export it if it has a non-default value.  */
 	v_default		/* Decide in target_environment.  */
-      } export ENUM_BITFIELD (2);
+      } export ENUM_BITFIELD (3);
   };
 
 /* Structure that represents a variable set.  */
