You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pngquant/pngquant-2.4.0_fix-Makefile...

73 lines
1.9 KiB

--- pngquant-2.4.0.1.orig/lib/Makefile 2015-04-11 23:24:38.000000000 +0100
+++ pngquant-2.4.0.1/lib/Makefile 2015-04-19 02:24:14.987943234 +0100
@@ -1,14 +1,14 @@
-include config.mk
STATICLIB=libimagequant.a
-SHAREDLIB=libimagequant.so.0
+SHAREDLIB=libimagequant.so
+SOVER=0
DLL=libimagequant.dll
DLLIMP=libimagequant_dll.a
DLLDEF=libimagequant_dll.def
OBJS = pam.o mediancut.o blur.o mempool.o viter.o nearest.o libimagequant.o
-SHAREDOBJS = $(subst .o,.lo,$(OBJS))
BUILD_CONFIGURATION="$(CC) $(CFLAGS) $(LDFLAGS)"
@@ -32,11 +32,9 @@ $(DLL) $(DLLIMP): $(OBJS)
$(STATICLIB): $(OBJS)
$(AR) $(ARFLAGS) $@ $^
-$(SHAREDOBJS):
- $(CC) -fPIC $(CFLAGS) -c $(@:.lo=.c) -o $@
-
-$(SHAREDLIB): $(SHAREDOBJS)
- $(CC) -shared -o $@ $^ $(LDFLAGS)
+$(SHAREDLIB): $(OBJS)
+ $(CC) -shared -Wl,-soname,$(SHAREDLIB).$(SOVER) $(CFLAGS) $(OBJS) -o $(SHAREDLIB).$(SOVER)
+ ln -fs $(SHAREDLIB).$(SOVER) $(SHAREDLIB)
$(OBJS): $(wildcard *.h) config.mk
--- pngquant-2.4.0.1.orig/Makefile 2015-04-11 23:24:38.000000000 +0100
+++ pngquant-2.4.0.1/Makefile 2015-04-19 02:19:40.340909213 +0100
@@ -11,6 +11,7 @@ OBJS += $(COCOA_OBJS)
endif
STATICLIB = lib/libimagequant.a
+SHAREDLIB = lib/libimagequant.so
DISTFILES = *.[chm] pngquant.1 Makefile configure README.md INSTALL CHANGELOG COPYRIGHT
TARNAME = pngquant-$(VERSION)
@@ -29,12 +30,17 @@ staticlib:
$(STATICLIB): config.mk staticlib
+sharedlib:
+ $(MAKE) -C lib shared
+
+$(SHAREDLIB): config.mk sharedlib
+
$(OBJS): $(wildcard *.h) config.mk
rwpng_cocoa.o: rwpng_cocoa.m
$(CC) -Wno-enum-conversion -c $(CFLAGS) -o $@ $< || clang -Wno-enum-conversion -c -O3 $(CFLAGS) -o $@ $<
-$(BIN): $(OBJS) $(STATICLIB)
+$(BIN): $(OBJS) $(SHAREDLIB)
$(CC) $^ $(LDFLAGS) -o $@
test: $(BIN)
@@ -60,7 +66,7 @@ uninstall:
clean:
$(MAKE) -C lib clean
- rm -f '$(BIN)' $(OBJS) $(COCOA_OBJS) $(STATICLIB) $(TARFILE)
+ rm -f '$(BIN)' $(OBJS) $(COCOA_OBJS) $(TARFILE)
distclean: clean
$(MAKE) -C lib distclean