summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/openjpeg/files/openjpeg-1.3-darwin.patch')
-rw-r--r--media-libs/openjpeg/files/openjpeg-1.3-darwin.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/media-libs/openjpeg/files/openjpeg-1.3-darwin.patch b/media-libs/openjpeg/files/openjpeg-1.3-darwin.patch
new file mode 100644
index 000000000..7115ebadc
--- /dev/null
+++ b/media-libs/openjpeg/files/openjpeg-1.3-darwin.patch
@@ -0,0 +1,41 @@
+* <grobian@gentoo.org>: small compilation fix for Darwin, and produce
+ correct(ly named) dylibs
+
+--- libopenjpeg/opj_malloc.h
++++ libopenjpeg/opj_malloc.h
+@@ -75,7 +75,7 @@
+ #else /* Not WIN32 */
+ #if defined(__sun)
+ #define HAVE_MEMALIGN
+- #elif defined(__GNUC__)
++ #elif defined(__GNUC__) && !defined(__APPLE__)
+ #if defined(__FreeBSD__)
+ #include <stdlib.h>
+ #include <osreldate.h>
+--- Makefile
++++ Makefile
+@@ -26,8 +26,15 @@
+
+ TARGET = openjpeg
+ STATICLIB = lib$(TARGET).a
++ifeq ($(TARGOS),Darwin)
++SHAREDLIB = lib$(TARGET).$(VER_MAJOR).$(VER_MINOR).dylib
++LIBNAME = lib$(TARGET).$(VER_MAJOR).dylib
++LIBCMD = -dynamiclib -install_name $(INSTALL_LIBDIR)/$(LIBNAME)
++else
+ SHAREDLIB = lib$(TARGET).so.$(VER_MAJOR).$(VER_MINOR)
+ LIBNAME = lib$(TARGET).so.$(VER_MAJOR)
++LIBCMD = -shared -Wl,-soname,$(LIBNAME)
++endif
+
+
+
+@@ -54,7 +61,7 @@
+ $(AR) r $@ $(MODULES)
+
+ $(SHAREDLIB): $(MODULES)
+- $(CC) $(LDFLAGS) -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES)
++ $(CC) $(LDFLAGS) $(LIBCMD) -o $@ $(MODULES) $(LIBRARIES)
+
+ install: OpenJPEG
+ install -d '$(DESTDIR)$(INSTALL_LIBDIR)' '$(DESTDIR)$(INSTALL_INCLUDE)'