[asterisk-scf-commits] asterisk-scf/integration/ice.git branch "fix-apple-so" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Mar 18 12:56:45 CDT 2011


branch "fix-apple-so" has been updated
       via  facae71e61941f950d20abb612e2a234f868510d (commit)
      from  a3b413eee36959af8895d2b434911c28e761fc81 (commit)

Summary of changes:
 cpp/src/Ice/DynamicLibrary.cpp |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit facae71e61941f950d20abb612e2a234f868510d
Author: David M. Lee <dlee at digium.com>
Date:   Fri Mar 18 10:07:04 2011 -0500

    Improve fix-apple-so base on ZeroC feedback.
    
    * Try to load .dylib first, since that's how the most common Ice plugin,
      IceSSL, is built.
    * Attempt to load .bundle if .dylib and .so fail to load.
    * Updated the comment explaining the situation.
    * Collect errors from all three load attempts, rather than just
      displaying the first error.

diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index cbe3913..966508c 100644
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -117,7 +117,7 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
     {
         lib += "." + version;
     }
-    lib += ".so"; // .so for loadable module on Mach-O
+    lib += ".dylib";
 #elif defined(__hpux)
     lib = "lib" + libName;
     if(!version.empty())
@@ -146,22 +146,26 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
     if(!load(lib))
     {
 #ifdef __APPLE__
-        string olderr = _err;
-        // Previous versions of Ice mistakenly loaded .dylib.  If it can't
-        // load a .so, fallback to loading a .dylib.  For more info on
-        // shared libraries (.dylib) vs. loadable modules (.so), see
-        // http://www.finkproject.org/doc/porting/shared.php
+        string allerr = _err;
+        // For Mac OS X, there is a distinction between shared libraries
+        // (.dylib) and loadable modules (usually .bundle or .so).  If we can't
+        // load as a shared library, try loading as a bundle.  For more info,
+        // see http://www.finkproject.org/doc/porting/shared.php
         lib = "lib" + libName;
         if(!version.empty())
         {
             lib += "." + version;
         }
-        lib += ".dylib";
-        if(!load(lib))
+        if(!load(lib + ".so"))
         {
-            // restore old error message
-            _err = olderr;
-            return 0;
+            allerr += "; " + _err;
+            if (!load(lib + ".bundle"))
+            {
+                // failed to load .dylib, .so and .bundle.
+                allerr += "; " + _err;
+                _err = allerr;
+                return 0;
+            }
         }
 #else
         return 0;

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/ice.git



More information about the asterisk-scf-commits mailing list