For PR514:
* language specification files are no longer configured with "configure"
* add substitutions for %bindir%, %libdir%, and various llvmgcc related
  variables needed in the c and cpp spec files.
* Implement the stubstituions in the Compiler Driver.
* Move st.in to projects/Stacker/tools/stkrc where it belongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22128 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvmc/CompilerDriver.cpp b/tools/llvmc/CompilerDriver.cpp
index e7addf8..39a2989 100644
--- a/tools/llvmc/CompilerDriver.cpp
+++ b/tools/llvmc/CompilerDriver.cpp
@@ -249,6 +249,14 @@
             } else
               found = false;
             break;
+          case 'b':
+            if (*PI == "%bindir%") {
+              std::string tmp(*PI);
+              tmp.replace(0,8,LLVM_BINDIR);
+              action->args.push_back(tmp);
+            } else
+              found = false;
+            break;
           case 'd':
             if (*PI == "%defs%") {
               StringVector::iterator I = Defines.begin();
@@ -282,13 +290,35 @@
               found = false;
             break;
           case 'l':
-            if (*PI == "%libs%") {
+            if ((*PI)[1] == 'l') {
+              std::string tmp(*PI);
+              if (*PI == "%llvmgccdir%")
+                tmp.replace(0,12,LLVMGCCDIR);
+              else if (*PI == "%llvmgccarch%")
+                tmp.replace(0,13,LLVMGCCARCH);
+              else if (*PI == "%llvmgcc%")
+                tmp.replace(0,9,LLVMGCC);
+              else if (*PI == "%llvmgxx%")
+                tmp.replace(0,9,LLVMGXX);
+              else if (*PI == "%llvmcc1%")
+                tmp.replace(0,9,LLVMCC1);
+              else if (*PI == "%llvmcc1plus%") 
+                tmp.replace(0,9,LLVMCC1);
+              else
+                found = false;
+              if (found)
+                action->args.push_back(tmp);
+            } else if (*PI == "%libs%") {
               PathVector::iterator I = LibraryPaths.begin();
               PathVector::iterator E = LibraryPaths.end();
               while (I != E) {
                 action->args.push_back( std::string("-L") + I->toString() );
                 ++I;
               }
+            } else if (*PI == "%libdir%") {
+              std::string tmp(*PI);
+              tmp.replace(0,8,LLVM_LIBDIR);
+              action->args.push_back(tmp);
             } else
               found = false;
             break;
@@ -896,6 +926,8 @@
 CompilerDriver::~CompilerDriver() {
 }
 
+CompilerDriver::ConfigDataProvider::~ConfigDataProvider() {}
+
 CompilerDriver*
 CompilerDriver::Get(ConfigDataProvider& CDP) {
   return new CompilerDriverImpl(CDP);