Hi,

The following diff lets cmake build shared libraries without soname,
which is compliant to our policy for shared libraries.

This should go in a bulk build.
I already know for example that net/libproxy is failing with this, 
but I already have patches ready for it...

Let me know about other eventual failures caused by this patch.

Thanks!
David

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/cmake/Makefile,v
retrieving revision 1.64
diff -u -p -r1.64 Makefile
--- Makefile    31 Aug 2012 12:28:31 -0000      1.64
+++ Makefile    24 Sep 2012 14:06:42 -0000
@@ -7,6 +7,7 @@ HOMEPAGE =      http://www.cmake.org/
 CATEGORIES =   devel
 COMMENT =      portable build system
 DISTNAME =     cmake-2.8.9
+REVISION =     0
 MASTER_SITES = ${HOMEPAGE}files/v2.8/
 
 MAINTAINER =   David Coppa <dco...@openbsd.org>
Index: patches/patch-Source_cmComputeLinkInformation_cxx
===================================================================
RCS file: patches/patch-Source_cmComputeLinkInformation_cxx
diff -N patches/patch-Source_cmComputeLinkInformation_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmComputeLinkInformation_cxx   24 Sep 2012 14:06:43 
-0000
@@ -0,0 +1,68 @@
+$OpenBSD$
+--- Source/cmComputeLinkInformation.cxx.orig   Thu Aug  9 20:15:19 2012
++++ Source/cmComputeLinkInformation.cxx        Tue Aug 28 14:27:03 2012
+@@ -1059,12 +1059,18 @@ void cmComputeLinkInformation::AddTargetItem(std::stri
+     this->SharedLibrariesLinked.insert(target);
+     }
+ 
+-  // Handle case of an imported shared library with no soname.
+-  if(this->NoSONameUsesPath &&
+-     target->IsImportedSharedLibWithoutSOName(this->Config))
++  if(this->OpenBSD)
+     {
+     this->AddSharedLibNoSOName(item);
+     return;
++    } else {
++    // Handle case of an imported shared library with no soname.
++    if(this->NoSONameUsesPath &&
++       target->IsImportedSharedLibWithoutSOName(this->Config))
++      {
++      this->AddSharedLibNoSOName(item);
++      return;
++      }
+     }
+ 
+   // If this platform wants a flag before the full path, add it.
+@@ -1389,23 +1395,29 @@ void cmComputeLinkInformation::AddFrameworkPath(std::s
+ //----------------------------------------------------------------------------
+ bool cmComputeLinkInformation::CheckSharedLibNoSOName(std::string const& item)
+ {
+-  // This platform will use the path to a library as its soname if the
+-  // library is given via path and was not built with an soname.  If
+-  // this is a shared library that might be the case.
+-  std::string file = cmSystemTools::GetFilenameName(item);
+-  if(this->ExtractSharedLibraryName.find(file))
++  if(this->OpenBSD)
+     {
+-    // If we can guess the soname fairly reliably then assume the
+-    // library has one.  Otherwise assume the library has no builtin
+-    // soname.
+-    std::string soname;
+-    if(!cmSystemTools::GuessLibrarySOName(item, soname))
++    this->AddSharedLibNoSOName(item);
++    return true;
++    } else {
++    // This platform will use the path to a library as its soname if the
++    // library is given via path and was not built with an soname.  If
++    // this is a shared library that might be the case.
++    std::string file = cmSystemTools::GetFilenameName(item);
++    if(this->ExtractSharedLibraryName.find(file))
+       {
+-      this->AddSharedLibNoSOName(item);
+-      return true;
++      // If we can guess the soname fairly reliably then assume the
++      // library has one.  Otherwise assume the library has no builtin
++      // soname.
++      std::string soname;
++      if(!cmSystemTools::GuessLibrarySOName(item, soname))
++        {
++        this->AddSharedLibNoSOName(item);
++        return true;
++        }
+       }
++    return false;
+     }
+-  return false;
+ }
+ 
+ //----------------------------------------------------------------------------
Index: patches/patch-Source_cmTarget_cxx
===================================================================
RCS file: /cvs/ports/devel/cmake/patches/patch-Source_cmTarget_cxx,v
retrieving revision 1.13
diff -u -p -r1.13 patch-Source_cmTarget_cxx
--- patches/patch-Source_cmTarget_cxx   31 Aug 2012 12:28:31 -0000      1.13
+++ patches/patch-Source_cmTarget_cxx   24 Sep 2012 14:06:43 -0000
@@ -1,7 +1,24 @@
 $OpenBSD: patch-Source_cmTarget_cxx,v 1.13 2012/08/31 12:28:31 dcoppa Exp $
 --- Source/cmTarget.cxx.orig   Thu Aug  9 20:15:19 2012
-+++ Source/cmTarget.cxx        Thu Aug 23 11:25:48 2012
-@@ -3380,9 +3380,43 @@ void cmTarget::GetLibraryNames(std::string& name,
++++ Source/cmTarget.cxx        Mon Aug 27 15:07:12 2012
+@@ -3022,12 +3022,16 @@ std::string cmTarget::GetPDBName(const char* config)
+ //----------------------------------------------------------------------------
+ bool cmTarget::HasSOName(const char* config)
+ {
++#if !defined(__OpenBSD__)
+   // soname is supported only for shared libraries and modules,
+   // and then only when the platform supports an soname flag.
+   return ((this->GetType() == cmTarget::SHARED_LIBRARY ||
+            this->GetType() == cmTarget::MODULE_LIBRARY) &&
+           !this->GetPropertyAsBool("NO_SONAME") &&
+           this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config)));
++#else
++  return false;
++#endif
+ }
+ 
+ //----------------------------------------------------------------------------
+@@ -3380,9 +3384,43 @@ void cmTarget::GetLibraryNames(std::string& name,
    // The library name.
    name = prefix+base+suffix;
  
@@ -45,7 +62,7 @@ $OpenBSD: patch-Source_cmTarget_cxx,v 1.
  
    // The library's real name on disk.
    this->ComputeVersionedName(realName, prefix, base, suffix,
-@@ -3415,7 +3449,23 @@ void cmTarget::ComputeVersionedName(std::string& vName
+@@ -3415,7 +3453,23 @@ void cmTarget::ComputeVersionedName(std::string& vName
    if(version)
      {
      vName += ".";

Reply via email to