[cmake-commits] king committed cmComputeLinkInformation.cxx 1.16 1.17 cmComputeLinkInformation.h 1.11 1.12 cmake.cxx 1.355 1.356

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Feb 4 15:22:12 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv3339/Source

Modified Files:
	cmComputeLinkInformation.cxx cmComputeLinkInformation.h 
	cmake.cxx 
Log Message:
BUG: Added TARGET_ARCHIVES_MAY_BE_SHARED_LIBS global property to help compute proper rpath information on AIX when shared libraries have names like "libfoo.a".


Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cmComputeLinkInformation.cxx	1 Feb 2008 13:56:00 -0000	1.16
+++ cmComputeLinkInformation.cxx	4 Feb 2008 20:22:10 -0000	1.17
@@ -23,6 +23,7 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmTarget.h"
+#include "cmake.h"
 
 #include <ctype.h>
 
@@ -222,6 +223,7 @@
   this->Makefile = this->Target->GetMakefile();
   this->LocalGenerator = this->Makefile->GetLocalGenerator();
   this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
+  this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
 
   // The configuration being linked.
   this->Config = config;
@@ -649,6 +651,11 @@
 //----------------------------------------------------------------------------
 void cmComputeLinkInformation::ComputeLinkTypeInfo()
 {
+  // Check whether archives may actually be shared libraries.
+  this->ArchivesMayBeShared =
+    this->CMakeInstance->GetPropertyAsBool(
+      "TARGET_ARCHIVES_MAY_BE_SHARED_LIBS");
+
   // First assume we cannot do link type stuff.
   this->LinkTypeEnabled = false;
 
@@ -1260,8 +1267,20 @@
   std::string file = cmSystemTools::GetFilenameName(fullPath);
   if(!this->ExtractSharedLibraryName.find(file.c_str()))
     {
-    // This is not the name of a shared library.
-    return;
+    // On some platforms (AIX) a shared library may look static.
+    if(this->ArchivesMayBeShared)
+      {
+      if(!this->ExtractStaticLibraryName.find(file.c_str()))
+        {
+        // This is not the name of a shared library or archive.
+        return;
+        }
+      }
+    else
+      {
+      // This is not the name of a shared library.
+      return;
+      }
     }
 
   // Include this library in the runtime path ordering.

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.355
retrieving revision 1.356
diff -u -d -r1.355 -r1.356
--- cmake.cxx	24 Jan 2008 19:37:48 -0000	1.355
+++ cmake.cxx	4 Feb 2008 20:22:10 -0000	1.356
@@ -3245,6 +3245,13 @@
      "platform supports shared libraries. Basically all current general "
      "general purpose OS do so, the exception are usually embedded systems "
      "with no or special OSs.");
+
+  cm->DefineProperty
+    ("TARGET_ARCHIVES_MAY_BE_SHARED_LIBS", cmProperty::GLOBAL,
+     "Set if shared libraries may be named like archives.",
+     "On AIX shared libraries may be named \"lib<name>.a\".  "
+     "This property is set to true on such platforms.");
+
   cm->DefineProperty
     ("FIND_LIBRARY_USE_LIB64_PATHS", cmProperty::GLOBAL,
      "Whether FIND_LIBRARY should automatically search lib64 directories.",

Index: cmComputeLinkInformation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cmComputeLinkInformation.h	1 Feb 2008 13:56:00 -0000	1.11
+++ cmComputeLinkInformation.h	4 Feb 2008 20:22:10 -0000	1.12
@@ -21,6 +21,7 @@
 
 #include <cmsys/RegularExpression.hxx>
 
+class cmake;
 class cmGlobalGenerator;
 class cmLocalGenerator;
 class cmMakefile;
@@ -79,6 +80,7 @@
   cmMakefile* Makefile;
   cmLocalGenerator* LocalGenerator;
   cmGlobalGenerator* GlobalGenerator;
+  cmake* CMakeInstance;
 
   // Configuration information.
   const char* Config;
@@ -114,6 +116,7 @@
   std::string SharedLinkTypeFlag;
   bool LinkTypeEnabled;
   void SetCurrentLinkType(LinkType lt);
+  bool ArchivesMayBeShared;
 
   // Link item parsing.
   void ComputeItemParserInfo();



More information about the Cmake-commits mailing list