diff options
-rw-r--r-- | source/blender/imbuf/CMakeLists.txt | 9 | ||||
-rw-r--r-- | source/blender/imbuf/SConscript | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dynlibtiff.c | 30 | ||||
-rw-r--r-- | source/blender/imbuf/intern/readimage.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/writeimage.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 2 | ||||
-rw-r--r-- | source/creator/creator.c | 7 |
7 files changed, 35 insertions, 25 deletions
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 55497fdabb7..336f4cc70b0 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -24,13 +24,8 @@ # # ***** END GPL LICENSE BLOCK ***** -IF(WITH_COCOA) - FILE(GLOB SRC intern/*.c intern/*.m) - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/dynlibtiff.c") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/tiff.c") -ELSE(WITH_COCOA) - FILE(GLOB SRC intern/*.c) -ENDIF(WITH_COCOA) +FILE(GLOB SRC intern/*.c) + SET(INC . ../makesdna ../../../intern/guardedalloc ../../../intern/memutil ../blenlib diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index 9684c19b247..a8d91b2d31e 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -2,10 +2,6 @@ Import ('env') sources = env.Glob('intern/*.c') -if env['WITH_GHOST_COCOA']: - sources += env.Glob('intern/*.m') - sources.remove('intern/dynlibtiff.c') - sources.remove('intern/tiff.c') incs = '. ../makesdna #/intern/guardedalloc #/intern/memutil ../blenlib' incs += ' ../avi ../blenkernel' diff --git a/source/blender/imbuf/intern/dynlibtiff.c b/source/blender/imbuf/intern/dynlibtiff.c index b9186e482c5..6db83b37c05 100644 --- a/source/blender/imbuf/intern/dynlibtiff.c +++ b/source/blender/imbuf/intern/dynlibtiff.c @@ -78,6 +78,34 @@ void libtiff_loadlibtiff(void) if (libtiff != NULL) return; /* Try to find libtiff in a couple of standard places */ +#ifdef __APPLE__ + /* OSX has version specific library */ + //standard install location + libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.dylib"); + if (libtiff != NULL) return; + libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.3.dylib"); + if (libtiff != NULL) return; + //inside the blender app package contents/resources + libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.dylib"); + if (libtiff != NULL) return; + libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.3.dylib"); + if (libtiff != NULL) return; + //inside the blender app package contents/frameworks + libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.dylib"); + if (libtiff != NULL) return; + libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.3.dylib"); + if (libtiff != NULL) return; + //along side the blender app package + libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.dylib"); + if (libtiff != NULL) return; + libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.3.dylib"); + if (libtiff != NULL) return; + //inside the blender app package contents/MacOS + libtiff = PIL_dynlib_open("@executable_path/libtiff.dylib"); + if (libtiff != NULL) return; + libtiff = PIL_dynlib_open("@executable_path/libtiff.3.dylib"); + if (libtiff != NULL) return; +#else libtiff = PIL_dynlib_open("libtiff.so"); if (libtiff != NULL) return; libtiff = PIL_dynlib_open("libtiff.so.3"); @@ -88,7 +116,6 @@ void libtiff_loadlibtiff(void) if (libtiff != NULL) return; libtiff = PIL_dynlib_open("/usr/lib/libtiff.so.3"); if (libtiff != NULL) return; - /* OSX has version specific library */ #ifdef __x86_64__ libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so.3"); if (libtiff != NULL) return; @@ -97,6 +124,7 @@ void libtiff_loadlibtiff(void) if (libtiff != NULL) return; /* For solaris */ libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so"); +#endif } diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index 5003127dfb6..f248e6bb6c4 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -57,7 +57,7 @@ #include "IMB_dpxcineon.h" #include "BKE_global.h" -#if defined(__APPLE__) && defined(GHOST_COCOA) +#if defined(__APPLE__) && defined(IMBUF_COCOA) #include "IMB_cocoa.h" #else #include "IMB_tiff.h" @@ -157,7 +157,7 @@ ImBuf *IMB_ibImageFromMemory(int *mem, int size, int flags) { ibuf = imb_loadcineon((uchar *)mem, size, flags); if (ibuf) return(ibuf); -#if defined(__APPLE__) && defined(GHOST_COCOA) +#if defined(__APPLE__) && defined(IMBUF_COCOA) ibuf = imb_cocoaLoadImage((uchar *)mem, size, flags); if(ibuf) { ibuf->ftype = TIF; diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index f8452ac4cd4..06ce59cddec 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -53,7 +53,7 @@ #include "IMB_bmp.h" #include "IMB_radiance_hdr.h" -#if defined(__APPLE__) && defined(GHOST_COCOA) +#if defined(__APPLE__) && defined(IMBUF_COCOA) #include "IMB_cocoa.h" #else #include "IMB_tiff.h" @@ -119,7 +119,7 @@ short IMB_saveiff(struct ImBuf *ibuf, char *name, int flags) return imb_saveiris(ibuf, name, flags); } -#if defined(__APPLE__) && defined(GHOST_COCOA) +#if defined(__APPLE__) && defined(IMBUF_COCOA) if (IS_tiff(ibuf)) { if(ibuf->rect==NULL && ibuf->rect_float) IMB_rect_from_float(ibuf); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 96199a2a158..8097822acbc 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -247,9 +247,7 @@ void WM_exit(bContext *C) BPY_end_python(); #endif -#if !(defined(__APPLE__) && defined(GHOST_COCOA)) libtiff_exit(); -#endif #ifdef WITH_QUICKTIME quicktime_exit(); diff --git a/source/creator/creator.c b/source/creator/creator.c index 9749b724672..6f90c2ffe84 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -368,10 +368,8 @@ int main(int argc, char **argv) switch(argv[a][1]) { case 'a': /* -b was not given, play an animation */ -#if !(defined(__APPLE__) && defined(GHOST_COCOA)) /* exception here, see below, it probably needs happens after qt init? */ libtiff_init(); -#endif // XXX playanim(argc-1, argv+1); exit(0); @@ -540,10 +538,6 @@ int main(int argc, char **argv) #endif /* WITH_QUICKTIME */ -#if defined(__APPLE__) && defined(GHOST_COCOA) - /* libtiff is not used, Cocoa services are used instead for tiff I/O */ - G.have_libtiff = 1; -#else /* dynamically load libtiff, if available */ libtiff_init(); if (!G.have_libtiff && (G.f & G_DEBUG)) { @@ -551,7 +545,6 @@ int main(int argc, char **argv) printf("Try setting the BF_TIFF_LIB environment variable if you want this support.\n"); printf("Example: setenv BF_TIFF_LIB /usr/lib/libtiff.so\n"); } -#endif /* OK we are ready for it */ |