From f94becf3faabb8e8306712f3e48c12258dd491e7 Mon Sep 17 00:00:00 2001
From: Axel Naumann <Axel.Naumann@cern.ch>
Date: Tue, 4 Mar 2014 19:26:11 +0100
Subject: [PATCH] First step away from SVN versioning.

---
 .../cling/include/cling/Interpreter/Interpreter.h    |  2 +-
 interpreter/cling/lib/Interpreter/Interpreter.cpp    | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/interpreter/cling/include/cling/Interpreter/Interpreter.h b/interpreter/cling/include/cling/Interpreter/Interpreter.h
index b0fba4e474d..80bb8cbbc6b 100644
--- a/interpreter/cling/include/cling/Interpreter/Interpreter.h
+++ b/interpreter/cling/include/cling/Interpreter/Interpreter.h
@@ -265,7 +265,7 @@ namespace cling {
                                                 bool withAccessControl);
 
     ///\brief Set up include paths for runtime headers.
-    void AddRuntimeIncludePaths();
+    void AddRuntimeIncludePaths(const char* argv0);
     ///\brief Include C++ runtime headers and definitions.
     void IncludeCxxRuntime();
     ///\brief Include C runtime headers and definitions.
diff --git a/interpreter/cling/lib/Interpreter/Interpreter.cpp b/interpreter/cling/lib/Interpreter/Interpreter.cpp
index 29c84a55dcc..30a5a0fbe7b 100644
--- a/interpreter/cling/lib/Interpreter/Interpreter.cpp
+++ b/interpreter/cling/lib/Interpreter/Interpreter.cpp
@@ -186,7 +186,7 @@ namespace cling {
 
     handleFrontendOptions();
 
-    AddRuntimeIncludePaths();
+    AddRuntimeIncludePaths(argv[0]);
 
     // Tell the diagnostic client that we are entering file parsing mode.
     DiagnosticConsumer& DClient = getCI()->getDiagnosticClient();
@@ -212,7 +212,11 @@ namespace cling {
   }
 
   const char* Interpreter::getVersion() const {
-    return "$Id$";
+#ifdef CLING_VERSION
+    return CLING_VERSION
+#else
+    return "<unknown>";
+#endif
   }
 
   void Interpreter::handleFrontendOptions() {
@@ -224,7 +228,7 @@ namespace cling {
     }
   }
 
-  void Interpreter::AddRuntimeIncludePaths() {
+  void Interpreter::AddRuntimeIncludePaths(const char* argv0) {
     // Add configuration paths to interpreter's include files.
 #ifdef CLING_INCLUDE_PATHS
     llvm::StringRef InclPaths(CLING_INCLUDE_PATHS);
@@ -238,7 +242,7 @@ namespace cling {
     // Add remaining part
     AddIncludePath(InclPaths);
 #endif
-    llvm::SmallString<512> P(GetExecutablePath(argv[0]));
+    llvm::SmallString<512> P(GetExecutablePath(argv0));
     if (!P.empty()) {
       // Remove /cling from foo/bin/clang
       llvm::StringRef ExeIncl = llvm::sys::path::parent_path(P);
-- 
GitLab