93 lines
3.3 KiB
Text
93 lines
3.3 KiB
Text
Index: lib/Makefile
|
|
--- lib/Makefile.orig
|
|
+++ lib/Makefile
|
|
@@ -56,6 +56,9 @@ LIBOBJECTS_X = \
|
|
util/token.o \
|
|
util/vasprintf.o \
|
|
|
|
+SHLIBOBJECTS = $(patsubst %.o, %.lo, $(LIBOBJECTS))
|
|
+SHLIBOBJECTS_X = $(patsubst %.o, %.lo, $(LIBOBJECTS_X))
|
|
+
|
|
MANUALS3 = libnetpbm
|
|
MANUALS5 = pbm pgm ppm pnm pam
|
|
|
|
@@ -92,13 +95,16 @@ extra_staticlib: $(EXTRA_STATICLIB)
|
|
# type, but request a static library in addition.
|
|
#----------------------------------------------------------------------------
|
|
|
|
-$(LIBOBJECTS): CFLAGS_TARGET=$(CFLAGS_SHLIB)
|
|
+$(SHLIBOBJECTS): CFLAGS_TARGET=$(CFLAGS_SHLIB)
|
|
|
|
libpbm3.o: CFLAGS_TARGET+=$(CFLAGS_SSE)
|
|
|
|
$(LIBOBJECTS): %.o: %.c importinc
|
|
$(CC) -c $(INCLUDES) $(CFLAGS_ALL) -o $@ $<
|
|
|
|
+$(SHLIBOBJECTS): %.lo: %.c importinc
|
|
+ $(CC) -c $(INCLUDES) $(CFLAGS_ALL) -o $@ $<
|
|
+
|
|
# The major number increases when there is a non-backward-compatible change
|
|
# to the library at the binary level, meaning any client of the library needs
|
|
# to keep using the old library until it has been recompiled for the new
|
|
@@ -145,7 +151,7 @@ endif
|
|
|
|
ifeq ($(NETPBMLIBTYPE),unixshared)
|
|
# The libxxx.so link is needed to link the executables.
|
|
-libnetpbm.$(NETPBMLIBSUFFIX): $(SONAME)
|
|
+libnetpbm.$(NETPBMLIBSUFFIX): libnetpbm.$(NETPBMLIBSUFFIX).$(LIBnetpbm_VERSION)
|
|
rm -f $@
|
|
$(SYMLINK) $< $@
|
|
# The $(SONAME) link is needed only to test the programs without
|
|
@@ -154,8 +160,8 @@ libnetpbm.$(NETPBMLIBSUFFIX): $(SONAME)
|
|
$(SONAME): libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN)
|
|
rm -f $@
|
|
$(SYMLINK) $< $@
|
|
-libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN): $(LIBOBJECTS) $(LIBOBJECTS_X)
|
|
- $(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
|
|
+libnetpbm.$(NETPBMLIBSUFFIX).$(LIBnetpbm_VERSION): $(SHLIBOBJECTS) $(SHLIBOBJECTS_X)
|
|
+ $(LD) $(LDSHLIB) -o $@ $(SHLIBOBJECTS) $(SHLIBOBJECTS_X) \
|
|
$(SHLIB_CLIB) -lm $(LADD)
|
|
endif
|
|
|
|
@@ -234,25 +240,21 @@ standardppmdfont.c:
|
|
compile.h:
|
|
$(SRCDIR)/buildtools/stamp-date >$@ || rm $@
|
|
|
|
-$(LIBOBJECTS_X): FORCE
|
|
+$(LIBOBJECTS_X) $(SHLIBOBJECTS_X): FORCE
|
|
@if [ ! -d $(dir $@) ] ; then mkdir $(dir $@) ; fi
|
|
$(MAKE) -C $(dir $@) -f $(SRCDIR)/$(SUBDIR)/$(dir $@)Makefile \
|
|
SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) $(notdir $@)
|
|
|
|
-libpm.o: compile.h
|
|
+libpm.o libpm.lo: compile.h
|
|
|
|
# Install a shared library
|
|
#
|
|
.PHONY: install.lib
|
|
ifeq ($(NETPBMLIBTYPE),unixshared)
|
|
# install a Unix-style shared library
|
|
-install.lib: $(PKGDIR)/lib $(PKGDIR)/sharedlink
|
|
- cd $(PKGDIR)/lib ; rm -f libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).*
|
|
+install.lib: $(PKGDIR)/lib
|
|
$(INSTALL) -c -m $(INSTALL_PERM_LIBD) \
|
|
- libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN) $(PKGDIR)/lib/
|
|
- cd $(PKGDIR)/lib/ ; \
|
|
- rm -f libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ); \
|
|
- $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN) $(SONAME)
|
|
+ libnetpbm.$(NETPBMLIBSUFFIX).$(LIBnetpbm_VERSION) $(PKGDIR)/lib/
|
|
endif
|
|
ifeq ($(NETPBMLIBTYPE),dll)
|
|
#install a Windows DLL shared library
|
|
@@ -288,9 +290,9 @@ $(INTERFACE_HEADERS:%=%_installhdr): $(PKGDIR)/include
|
|
$(SRCDIR)/lib/$(@:%_installhdr=%) $(PKGDIR)/include/netpbm/
|
|
|
|
.PHONY: install.staticlib
|
|
-install.staticlib: $(PKGDIR)/staticlink
|
|
+install.staticlib: $(PKGDIR)/lib
|
|
$(INSTALL) -c -m $(INSTALL_PERM_LIBS) libnetpbm.$(STATICLIBSUFFIX) \
|
|
- $(PKGDIR)/staticlink
|
|
+ $(PKGDIR)/lib
|
|
|
|
# Install a shared library stub -- the ".so" file used at link time to
|
|
# prepare a program for dynamically linking a library at run time
|