Index: /CMT/HEAD/mgr/cmt_dependencies.make
===================================================================
--- /CMT/HEAD/mgr/cmt_dependencies.make	(revision 290)
+++ /CMT/HEAD/mgr/cmt_dependencies.make	(revision 291)
@@ -24,5 +24,5 @@
 cmt_regexp_cxx_dependencies =  ../source/cmt_regexp.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_regexp.h   ../source/cmt_vector.h   ../source/cmt_system.h 
 cmt_model_cxx_dependencies =  ../source/cmt_model.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt_model.h   ../source/cmt.h   ../source/cmt_parser.h   ../source/cmt_fragment.h   ../source/cmt_map.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_tag.h   ../source/cmt_symbol.h 
-cmt_project_cxx_dependencies =  ../source/cmt_project.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt.h   ../source/cmt_parser.h   ../source/cmt_awk.h   ../source/cmt_project.h   ../source/cmt_branch.h   ../source/cmt_fragment.h   ../source/cmt_group.h   ../source/cmt_constituent.h   ../source/cmt_language.h   ../source/cmt_map.h   ../source/cmt_pattern.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_tag.h   ../source/cmt_symbol.h   ../source/cmt_cmtpath_pattern.h   ../source/cmt_database.h   ../source/cmt_syntax.h   ../source/cmt_error.h 
+cmt_project_cxx_dependencies =  ../source/cmt_project.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt.h   ../source/cmt_parser.h   ../source/cmt_map.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_awk.h   ../source/cmt_project.h   ../source/cmt_branch.h   ../source/cmt_fragment.h   ../source/cmt_group.h   ../source/cmt_constituent.h   ../source/cmt_language.h   ../source/cmt_tag.h   ../source/cmt_symbol.h   ../source/cmt_cmtpath_pattern.h   ../source/cmt_database.h   ../source/cmt_syntax.h   ../source/cmt_error.h 
 cmt_syntax_cxx_dependencies =  ../source/cmt_syntax.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_map.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt.h   ../source/cmt_parser.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_awk.h   ../source/cmt_project.h   ../source/cmt_syntax.h   ../source/cmt_tag.h   ../source/cmt_symbol.h   ../source/cmt_fragment.h   ../source/cmt_group.h   ../source/cmt_constituent.h   ../source/cmt_error.h   ../source/cmt_branch.h   ../source/cmt_language.h   ../source/cmt_cmtpath_pattern.h 
 cmt_install_area_cxx_dependencies =  ../source/cmt_install_area.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt_parser.h   ../source/cmt.h   ../source/cmt_install_area.h   ../source/cmt_map.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_awk.h   ../source/cmt_project.h   ../source/cmt_syntax.h   ../source/cmt_tag.h   ../source/cmt_symbol.h   ../source/cmt_cmtpath_pattern.h 
Index: /CMT/HEAD/source/cmt_project.cxx
===================================================================
--- /CMT/HEAD/source/cmt_project.cxx	(revision 290)
+++ /CMT/HEAD/source/cmt_project.cxx	(revision 291)
@@ -570,4 +570,10 @@
       // Last step is to parse the project file
 
+      // First create the Project.m_use for the policy
+      project->m_use = Use::create (project->get_cmtpath(), 
+                                    "project_"+project->get_name()+"_policy", 
+                                    project->get_release (), "", "", "");                                    
+      project->m_use->done = false;
+      
       if (Cmt::get_debug ())
 	{
Index: /CMT/HEAD/source/cmt_project.h
===================================================================
--- /CMT/HEAD/source/cmt_project.h	(revision 290)
+++ /CMT/HEAD/source/cmt_project.h	(revision 291)
@@ -11,5 +11,7 @@
 #include "cmt_parser.h"
 #include "cmt_system.h"
+#include "cmt_use.h"
 #include "cmt_awk.h"
+
 
 class Project;
@@ -186,4 +188,7 @@
   
   void visit (IProjectVisitor& visitor);
+
+
+  Use* m_use;
   
 private:
@@ -207,5 +212,4 @@
 
   bool m_configured;
-
   cmt_vector <Strategy> m_strategies;
 };
Index: /CMT/HEAD/source/cmt_syntax.cxx
===================================================================
--- /CMT/HEAD/source/cmt_syntax.cxx	(revision 290)
+++ /CMT/HEAD/source/cmt_syntax.cxx	(revision 291)
@@ -109,5 +109,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}
+  {
+      action (words, project->m_use, file_name, line_number);
+  }
 
 };
@@ -163,22 +165,24 @@
   bool decode (const cmt_string& w, cmt_string& strategy, cmt_string& value)
   {
-    bool result = true;
-
-    value = w;
-
-    if (w == "prototypes")
+    bool result = true;    
+     
+    value =  w; 
+    Symbol::expand(value);
+               
+
+    if (value == "prototypes")
       {
 	strategy = "BuildPrototypes";
       }
-    else if (w == "no_prototypes")
+    else if (value == "no_prototypes")
       {
 	strategy = "BuildPrototypes";
       }
-    else if ((w == "with_installarea") || (w == "with_install_area"))
+    else if ((value == "with_installarea") || (value == "with_install_area"))
       {
 	value = "with_installarea";
 	strategy = "InstallArea";
       }
-    else if ((w == "without_installarea") || (w == "without_install_area"))
+    else if ((value == "without_installarea") || (value == "without_install_area"))
       {
 	value = "without_installarea";
@@ -232,5 +236,5 @@
 	       int line_number)
   {
-    for (int i = 1; i < words.size (); i++)
+      for (int i = 1; i < words.size (); i++)
       {
 	const cmt_string& w = words[i];
@@ -494,9 +498,13 @@
     Symbol::action (words, CommandMacro, use);
   }
-  void action (const CmtSystem::cmt_string_vector& words,
-		  Project* project,
-		  const cmt_string& file_name,
-		  int line_number)
-  {}
+  
+  
+  void action (const CmtSystem::cmt_string_vector& words,
+		  Project* project,
+		  const cmt_string& file_name,
+		  int line_number)
+  {                          
+      action (words, project->m_use, file_name, line_number);
+  }
 };
 
@@ -515,5 +523,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}
+  {
+      action (words, project->m_use, file_name, line_number);    
+  }
 };
 
@@ -532,5 +542,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}
+  {
+      action (words, project->m_use, file_name, line_number);    
+  }
 };
 
@@ -549,5 +561,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}
+  {
+      action (words, project->m_use, file_name, line_number);
+  }
 };
 
@@ -566,5 +580,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}
+  {
+      action (words, project->m_use, file_name, line_number);
+  }
 };
 
@@ -583,5 +599,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}
+  {
+      action (words, project->m_use, file_name, line_number);
+  }
 };
 
@@ -600,5 +618,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}
+  {
+      action (words, project->m_use, file_name, line_number);
+  }
 };
 
@@ -957,26 +977,27 @@
 
     value = w;
-
-    if (w == "config")
+    Symbol::expand(value);
+
+    if (value == "config")
       {
 	strategy = "SetupConfig";
       }
-    else if (w == "no_config")
+    else if (value == "no_config")
       {
 	strategy = "SetupConfig";
       }
-    else if (w == "root")
+    else if (value == "root")
       {
 	strategy = "SetupRoot";
       }
-    else if (w == "no_root")
+    else if (value == "no_root")
       {
 	strategy = "SetupRoot";
       }
-    else if (w == "cleanup")
+    else if (value == "cleanup")
       {
 	strategy = "SetupCleanup";
       }
-    else if (w == "no_cleanup")
+    else if (value == "no_cleanup")
       {
 	strategy = "SetupCleanup";
@@ -1029,5 +1050,5 @@
 	       int line_number)
   {
-    for (int i = 1; i < words.size (); i++)
+        for (int i = 1; i < words.size (); i++)
       {
 	const cmt_string& w = words[i];
@@ -1060,10 +1081,12 @@
 
     value = w;
-
-    if (w == "with_version_directory")
+    Symbol::expand(value);
+
+    
+    if (value == "with_version_directory")
       {
 	strategy = "VersionDirectory";
       }
-    else if (w == "without_version_directory")
+    else if (value == "without_version_directory")
       {
 	strategy = "VersionDirectory";
@@ -1116,5 +1139,5 @@
 	       int line_number)
   {
-    for (int i = 1; i < words.size (); i++)
+      for (int i = 1; i < words.size (); i++)
       {
 	const cmt_string& w = words[i];
@@ -1153,5 +1176,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}  
+  {
+        action (words, project->m_use, file_name, line_number);    
+  }  
 };
 
@@ -1170,5 +1195,7 @@
 		  const cmt_string& file_name,
 		  int line_number)
-  {}  
+  {
+          action (words, project->m_use, file_name, line_number);
+  }  
 };
 
@@ -1278,9 +1305,18 @@
 
       use->fill_standard_macros (buffer);
-
       AccessMode saved_current_access = Cmt::get_current_access ();
       Cmt::set_current_access (UserMode);
       me.do_parse_text (buffer, "", package_context, use, 0);
       Cmt::set_current_access (saved_current_access);
+      
+      //
+      Project* p = use->get_project ();
+      if (p != 0)
+      {      
+           if (p->m_use !=0)
+           {
+               use->sub_uses.push_back (p->m_use);
+           }
+      }
     }
 
@@ -1436,7 +1472,22 @@
   m_keywords.add ("version", new KwdVersion ());
 
+  // Project
   m_project_keywords.add ("author", new KwdAuthor());
+  m_project_keywords.add ("apply_tag", new KwdApplyTag ());
   m_project_keywords.add ("build_strategy", new KwdBuildStrategy ());
   m_project_keywords.add ("container", new KwdContainer ());
+  
+  m_project_keywords.add ("macro", new KwdMacro ());
+  m_project_keywords.add ("macro+", new KwdMacroAppend ());
+  m_project_keywords.add ("macro_prepend", new KwdMacroPrepend ());
+  m_project_keywords.add ("macro_append", new KwdMacroAppend ());
+  m_project_keywords.add ("macro_remove", new KwdMacroRemove ());
+  m_project_keywords.add ("macro_remove_regexp", new KwdMacroRemoveRegexp ());
+  m_project_keywords.add ("macro_remove_all", new KwdMacroRemoveAll ());
+  m_project_keywords.add ("macro_remove_all_regexp", new KwdMacroRemoveAllRegexp ());
+
+  m_project_keywords.add ("tag", new KwdTag ());
+  m_project_keywords.add ("tag_exclude", new KwdTagExclude ());
+  
   m_project_keywords.add ("project", new KwdProject ());
   m_project_keywords.add ("setup_strategy", new KwdSetupStrategy ());
Index: /CMT/HEAD/source/cmt_use.cxx
===================================================================
--- /CMT/HEAD/source/cmt_use.cxx	(revision 290)
+++ /CMT/HEAD/source/cmt_use.cxx	(revision 291)
@@ -1373,5 +1373,6 @@
                const cmt_string& new_path,
                const cmt_string& new_version_alias,
-               const cmt_string& new_path_alias)
+               const cmt_string& new_path_alias,
+               const cmt_string& native_version)
 {
   clear ();
@@ -1387,4 +1388,5 @@
   specified_version = new_version;
   version           = new_version;
+  this->native_version    = native_version;
   path              = specified_path;
   Symbol::expand (path);
@@ -1540,41 +1542,41 @@
 
       if (CmtSystem::test_file ("version.cmt"))
-	{
-	  cmt_string v;
-
-	  v.read ("version.cmt");
-	  int pos;
-	  pos = v.find ('\n');
-	  if (pos != cmt_string::npos) v.erase (pos);
-	  pos = v.find ('\r');
-	  if (pos != cmt_string::npos) v.erase (pos);
-
-	  CompareStatus s = compare_versions (version, v);
-
-	  if (Cmt::get_debug ())
-	    {
-	      cout << "Use::reach_package-6.1> version=" << version << " v=" << v << " s=" << s << endl;
-	    }
-
-	  switch (s)
-	    {
-	    case IdenticalIds:
-	    case ExplicitOldMajorIdWinsAgainstWildarded:
-	    case ExplicitOldMinorIdWinsAgainstWildarded:
-	    case ExplicitOldPatchIdWinsAgainstWildarded:
-	      break;
-	    case ExplicitNewMajorIdWinsAgainstWildarded:
-	    case ExplicitNewMinorIdWinsAgainstWildarded:
-	    case NewMinorIdGreaterThanOld:
-	    case ExplicitNewPatchIdWinsAgainstWildarded:
-	    case NewPatchIdGreaterThanOld:
-	      break;
-	    case OldMajorIdGreaterThanNew:
-	    case NewMajorIdGreaterThanOld:
-	      break;
-	    case IncompatibleMajorIds:
-	      return (0);
-	    }
-	  version = v;
+    	{
+	      cmt_string v;
+
+	      v.read ("version.cmt");
+	      int pos;
+	      pos = v.find ('\n');
+	      if (pos != cmt_string::npos) v.erase (pos);
+	      pos = v.find ('\r');
+	      if (pos != cmt_string::npos) v.erase (pos);
+
+	      CompareStatus s = compare_versions (version, v);
+
+	      if (Cmt::get_debug ())
+	        {
+	          cout << "Use::reach_package-6.1> version=" << version << " v=" << v << " s=" << s << endl;
+	        }
+
+    	  switch (s)
+    	    {
+    	    case IdenticalIds:
+    	    case ExplicitOldMajorIdWinsAgainstWildarded:
+    	    case ExplicitOldMinorIdWinsAgainstWildarded:
+    	    case ExplicitOldPatchIdWinsAgainstWildarded:
+    	      break;
+    	    case ExplicitNewMajorIdWinsAgainstWildarded:
+    	    case ExplicitNewMinorIdWinsAgainstWildarded:
+    	    case NewMinorIdGreaterThanOld:
+    	    case ExplicitNewPatchIdWinsAgainstWildarded:
+    	    case NewPatchIdGreaterThanOld:
+    	      break;
+    	    case OldMajorIdGreaterThanNew:
+    	    case NewMajorIdGreaterThanOld:
+    	      break;
+    	    case IncompatibleMajorIds:
+    	      return (0);
+    	    }
+	      version = v;
 	}
       else if (version == "")
@@ -1630,5 +1632,5 @@
 	                  pos = nv.find ('\r');
 	                  if (pos != cmt_string::npos) nv.erase (pos);
-	              
+	              	                 
 	                  if (nv == n_version)
 	                  {
@@ -2301,4 +2303,15 @@
       if (registered != 0) *old_use = registered;
       else *old_use = found;
+
+      // Should check native_version !
+      if (native_version != "" && !do_need_new)
+      {
+
+          if ((*old_use)->native_version != native_version)
+          {
+              do_need_new = true;    
+              *old_use = 0;
+          }
+      }   
     }
 
@@ -2314,6 +2327,7 @@
 Use* Use::create (const cmt_string& path,
                   const cmt_string& package,
-                  const cmt_string& version,
+                  const cmt_string& version,                  
                   const cmt_string& version_alias,
+                  const cmt_string& native_version,                  
                   const cmt_string& path_alias)
 {
@@ -2339,5 +2353,5 @@
   Use& use_object = instances.add ();
 
-  use_object.set (package, version, path, version_alias, path_alias);
+  use_object.set (package, version, path, version_alias, path_alias, native_version);
 
   return (&use_object);
@@ -2363,9 +2377,7 @@
 
   Use* old_use = 0;
-  Use* use = 0;
+  Use* use     = 0;
 
   do_need_new = need_new (path, package_name, version, native_version, &old_use, context_use);
-  //cout <<"native_version: "<<native_version<<" "<<version<<" "<<do_need_new<<endl;
-    
 
   if (Cmt::get_debug ())
@@ -2382,5 +2394,5 @@
   if (do_need_new)
     {
-      use = create (path, package_name, version, version_alias, path_alias);
+      use = create (path, package_name, version, version_alias, native_version, path_alias);
       //cout <<"need_new native_version: "<<native_version<<" "<<version<<" "<<do_need_new<<endl;
     }
@@ -3479,4 +3491,14 @@
 }
 
+Project* Use::get_project () const
+{
+    Project* p;
+    cmt_string cmtpath = "";
+    cmt_string offset  = "";    
+    get_cmtpath_and_offset (cmtpath, offset);
+    p = Project::find_by_cmtpath (cmtpath);
+    return p;
+}
+
 int Use::get_index () const
 {
@@ -4243,9 +4265,5 @@
 }
 
-
-
-
-
-
+/*---------------------------------------------------*/
 Package* Package::find (const cmt_string& name)
 {
@@ -4259,4 +4277,5 @@
 }
 
+/*---------------------------------------------------*/
 Package* Package::add (const cmt_string& name)
 {
@@ -4293,4 +4312,5 @@
 }
 
+/*---------------------------------------------------*/
 Package::PackageVector& Package::packages ()
 {
@@ -4301,4 +4321,5 @@
 }
 
+/*---------------------------------------------------*/
 Package::PackageMap& Package::package_map ()
 {
@@ -4309,4 +4330,5 @@
 }
 
+/*---------------------------------------------------*/
 void Package::clear_all ()
 {
@@ -4318,4 +4340,5 @@
 }
 
+/*---------------------------------------------------*/
 Package::Package () : m_is_cmt (false)
 {
@@ -4326,4 +4349,5 @@
 }
 
+/*---------------------------------------------------*/
 Package::~Package ()
 {
@@ -4331,4 +4355,5 @@
 }
 
+/*---------------------------------------------------*/
 const cmt_string& Package::get_name () const
 {
@@ -4336,4 +4361,5 @@
 }
 
+/*---------------------------------------------------*/
 void Package::add_use (Use* use)
 {
@@ -4347,4 +4373,5 @@
 }
 
+/*---------------------------------------------------*/
 void Package::remove_use (Use* use)
 {
@@ -4372,4 +4399,5 @@
 }
 
+/*---------------------------------------------------*/
 Use::UsePtrVector& Package::get_uses ()
 {
@@ -4382,4 +4410,5 @@
 }
 
+/*---------------------------------------------------*/
 static void show_packages ()
 {
@@ -4418,3 +4447,3 @@
   cout << endl;
 }
-
+/*---------------------------------------------------*/
Index: /CMT/HEAD/source/cmt_use.h
===================================================================
--- /CMT/HEAD/source/cmt_use.h	(revision 290)
+++ /CMT/HEAD/source/cmt_use.h	(revision 291)
@@ -60,11 +60,14 @@
   static void fill_macro_all (cmt_string& buffer, const cmt_string& suffix);
 
-// Private class methods
-private:
   static Use* create (const cmt_string& path,
                       const cmt_string& package,
                       const cmt_string& version,
                       const cmt_string& version_alias,
+                      const cmt_string& native_version, 
                       const cmt_string& path_alias);
+
+
+// Private class methods
+private:
 
 // Public instance methods
@@ -79,5 +82,6 @@
             const cmt_string& new_path,
             const cmt_string& new_version_alias = "",
-            const cmt_string& new_path_alias = "");
+            const cmt_string& new_path_alias = "",
+            const cmt_string& native_version = "");
   void author_action (const CmtSystem::cmt_string_vector& words);
   void manager_action (const CmtSystem::cmt_string_vector& words);
@@ -116,4 +120,6 @@
   void set_package_name (const cmt_string& name);
 
+  Project* get_project () const;
+
   int get_index () const;
 
@@ -156,4 +162,6 @@
   IgnorePattern::IgnorePatternVector ignore_patterns;
 
+
+  UsePtrVector sub_uses;
 // Private methods
 private:
@@ -191,5 +199,5 @@
   bool m_has_native_version;
 
-  UsePtrVector sub_uses;
+
   cmt_vector<ScopeType> sub_use_scopes;
   cmt_vector<State> sub_use_auto_imports;
