[asterisk-scf-commits] asterisk-scf/release/ice.git branch "fix-apple-so" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jan 13 22:28:35 CST 2011


branch "fix-apple-so" has been created
        at  d49219e4981f80f35fc50984a4ed377e1d4cee88 (commit)

- Log -----------------------------------------------------------------
commit d49219e4981f80f35fc50984a4ed377e1d4cee88
Author: David M. Lee <dlee at digium.com>
Date:   Thu Jan 13 22:16:02 2011 -0600

    Keep old error message when falling back to .dylib.

diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index 7a6b320..3a86c21 100644
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -146,6 +146,7 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
     if(!load(lib))
     {
 #ifdef __APPLE__
+        string olderr = _err;
         // Older version 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
@@ -158,6 +159,8 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
         lib += ".dylib";
         if(!load(lib))
         {
+            // restore old error message
+            _err = olderr;
             return 0;
         }
 #else

commit a3a82839b3b73025575a02331f8aa4695dd954df
Author: David M. Lee <dlee at digium.com>
Date:   Thu Jan 13 21:29:06 2011 -0600

    Fixed Apple module loading to prefer .so to .dylib.
    
    For Mac OS X, there's a distinction between shared libraries (.dylib)
    and loadable modules (.so).  While things work loading shared libraries
    instead of modules, it causes complications for folks using CMake to
    build their modules.
    * If they build as a module, then it has the .so extension and icebox
      won't load it.
    * If they build as a library, now icebox will load it, but a Windows
      build will build it as a library, and generate a .LIB file that you
      really don't want.

diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index c9be971..7a6b320 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 += ".dylib";
+    lib += ".so"; // .so for loadable module on Mach-O
 #elif defined(__hpux)
     lib = "lib" + libName;
     if(!version.empty())
@@ -145,7 +145,24 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
 
     if(!load(lib))
     {
+#ifdef __APPLE__
+        // Older version 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
+        lib = "lib" + libName;
+        if(!version.empty())
+        {
+            lib += "." + version;
+        }
+        lib += ".dylib";
+        if(!load(lib))
+        {
+            return 0;
+        }
+#else
         return 0;
+#endif
     }
 
     return getSymbol(funcName);

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


-- 
asterisk-scf/release/ice.git



More information about the asterisk-scf-commits mailing list