Douglas Bischoff's Fix for Plugins on OSX.
authorKent Mein <mein@cs.umn.edu>
Tue, 25 Nov 2003 20:10:06 +0000 (20:10 +0000)
committerKent Mein <mein@cs.umn.edu>
Tue, 25 Nov 2003 20:10:06 +0000 (20:10 +0000)
Kent

release/plugins/bmake
source/blender/blenlib/intern/dynlib.c

index eeee92bc2f298d29f8ab6aa68ad978d8f5714e03..50f274ef3959422be96d22314a0eb6496a303d46 100644 (file)
@@ -74,7 +74,7 @@ elif ( test $UNAME = "Darwin" ) then
         CC="cc";
         CFLAGS="-fPIC -funsigned-char -O2 -fno-common";
         LD="cc";
         CC="cc";
         CFLAGS="-fPIC -funsigned-char -O2 -fno-common";
         LD="cc";
-        LDFLAGS=" -bundle -bundle_loader ../../blender.app/Contents/MacOS/blender -lm";
+        LDFLAGS="-flat_namespace -bundle -bundle_loader ../../blender.app/Contents/MacOS/blender -ldl -lm";
         EXT="so";
 fi
 
         EXT="so";
 fi
 
index 4c6ab6ab6161979317e8a94d759593041949b87f..77a01f310a649edddba3d3cb39091dd1e410416f 100644 (file)
@@ -102,62 +102,7 @@ void PIL_dynlib_close(PILdynlib *lib) {
        free(lib);
 }
 
        free(lib);
 }
 
-#else
-#ifdef __APPLE__
-#include <mach-o/dyld.h>
-
-struct PILdynlib {
-       NSModule *handle;
-};
-
-PILdynlib *PIL_dynlib_open(char *name) {
-   NSObjectFileImage img;
-
-   PILdynlib *lib= malloc(sizeof(*lib));
-   if (NSCreateObjectFileImageFromFile( name, &img) == 
-       NSObjectFileImageSuccess) {
-      lib->handle = NSLinkModule( img, name, NSLINKMODULE_OPTION_BINDNOW);
-      NSDestroyObjectFileImage(img);
-      return lib;
-   }
-   free(lib);
-   return NULL;
-}
-
-void *PIL_dynlib_find_symbol(PILdynlib* lib, char *symname) {
-   char *name;
-   NSSymbol cr;
-   int size;
-
-   size = strlen(symname) + 2 * sizeof(char);
-   if (size < CHAR_MAX) {
-      name = MEM_mallocN(size, symname);
-      sprintf(&name, "_%s",symname);
-printf("\nouchie name =%s\n",name);
-      cr = NSLookupSymbolInModule(lib->handle, name);
-      free(name);
-      return NSAddressOfSymbol(cr);
-   }
-   return NULL;
-}
-
-char *PIL_dynlib_get_error_as_string(PILdynlib* lib) {
-    char *string;
-    int *errorNumber;
-    NSLinkEditErrors *c;
-    char *filename, *errorstr;
-
-    NSLinkEditError(&c,&errorNumber,&filename,&errorstr);
-    sprintf(string,"%d :%s: %s",errorNumber,filename,errorstr);
-       return string;
-}
-       
-void PIL_dynlib_close(PILdynlib *lib) {
-       NSUnLinkModule(lib->handle,NSUNLINKMODULE_OPTION_NONE);
-       free(lib);
-}
-
-#else  /* Unix */
+#else  /* Unix & MacOS X */
 
 #include <dlfcn.h>
 
 
 #include <dlfcn.h>
 
@@ -193,4 +138,3 @@ void PIL_dynlib_close(PILdynlib *lib) {
 }
 
 #endif
 }
 
 #endif
-#endif