105 lines
3.9 KiB
Diff
105 lines
3.9 KiB
Diff
diff -up mandoc-1.14.5/Makefile.orig mandoc-1.14.5/Makefile
|
|
--- mandoc-1.14.5/Makefile.orig 2019-03-10 05:56:43.000000000 -0400
|
|
+++ mandoc-1.14.5/Makefile 2019-10-16 10:07:11.999691172 -0400
|
|
@@ -17,6 +17,10 @@
|
|
|
|
VERSION = 1.14.5
|
|
|
|
+# version for the shared object file
|
|
+SOMAJOR = 2
|
|
+SOVERSION = $(SOMAJOR).0
|
|
+
|
|
# === LIST OF FILES ====================================================
|
|
|
|
TESTSRCS = test-be32toh.c \
|
|
@@ -373,7 +377,7 @@ include Makefile.local
|
|
|
|
# === DEPENDENCY HANDLING ==============================================
|
|
|
|
-all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile.local
|
|
+all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile.local libmandoc.so.$(SOMAJOR)
|
|
|
|
install: base-install $(INSTALL_TARGETS)
|
|
|
|
@@ -388,11 +392,15 @@ include Makefile.depend
|
|
|
|
# === TARGETS CONTAINING SHELL COMMANDS ================================
|
|
|
|
+LIBMANDOC_PIC_OBJS = $(COMPAT_OBJS:.o=.pic.o) $(LIBMANDOC_OBJS:.o=.pic.o)
|
|
+%.pic.o: %.c
|
|
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) -fPIC $< -o $@
|
|
+
|
|
distclean: clean
|
|
rm -f Makefile.local config.h config.h.old config.log config.log.old
|
|
|
|
clean:
|
|
- rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
|
|
+ rm -f libmandoc.a libmandoc.so.$(SOVERSION) $(LIBMANDOC_OBJS) $(LIBMANDOC_PIC_OBJS) $(COMPAT_OBJS)
|
|
rm -f mandoc $(MAIN_OBJS)
|
|
rm -f man.cgi $(CGI_OBJS)
|
|
rm -f mandocd catman catman.o $(MANDOCD_OBJS)
|
|
@@ -431,11 +439,13 @@ base-install: mandoc demandoc soelim
|
|
$(INSTALL_MAN) makewhatis.8 \
|
|
$(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
|
|
|
|
-lib-install: libmandoc.a
|
|
+lib-install: libmandoc.so.$(SOVERSION)
|
|
mkdir -p $(DESTDIR)$(LIBDIR)
|
|
mkdir -p $(DESTDIR)$(INCLUDEDIR)
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man3
|
|
- $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
|
|
+ $(INSTALL_LIB) libmandoc.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)
|
|
+ ln -s libmandoc.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)/libmandoc.so.$(SOMAJOR)
|
|
+ ln -s libmandoc.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)/libmandoc.so
|
|
$(INSTALL_LIB) eqn.h man.h mandoc.h mandoc_aux.h mandoc_parse.h \
|
|
mdoc.h roff.h tbl.h $(DESTDIR)$(INCLUDEDIR)
|
|
$(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \
|
|
@@ -484,7 +494,8 @@ uninstall:
|
|
rm -f $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN)
|
|
rm -f $(DESTDIR)$(MANDIR)/man8/mandocd.8
|
|
rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8
|
|
- rm -f $(DESTDIR)$(LIBDIR)/libmandoc.a
|
|
+ rm -f $(DESTDIR)$(LIBDIR)/libmandoc.so.$(SOVERSION)
|
|
+ rm -f $(DESTDIR)$(LIBDIR)/libmandoc.so
|
|
rm -f $(DESTDIR)$(MANDIR)/man3/mandoc.3
|
|
rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_escape.3
|
|
rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_malloc.3
|
|
@@ -514,20 +525,29 @@ Makefile.local config.h: configure $(TES
|
|
libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
|
|
ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
|
|
|
|
-mandoc: $(MAIN_OBJS) libmandoc.a
|
|
- $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD)
|
|
+libmandoc.so.$(SOVERSION): $(LIBMANDOC_PIC_OBJS)
|
|
+ $(CC) -shared -Wl,-soname=libmandoc.so.$(SOMAJOR) -o $@ $(LIBMANDOC_PIC_OBJS)
|
|
+
|
|
+libmandoc.so.$(SOMAJOR): libmandoc.so.$(SOVERSION)
|
|
+ ln -sf libmandoc.so.$(SOVERSION) libmandoc.so.$(SOMAJOR)
|
|
+
|
|
+libmandoc.so: libmandoc.so.$(SOVERSION)
|
|
+ ln -sf libmandoc.so.$(SOVERSION) libmandoc.so
|
|
+
|
|
+mandoc: $(MAIN_OBJS) libmandoc.so
|
|
+ $(CC) -o $@ -L. -lmandoc $(LDFLAGS) $(MAIN_OBJS) $(LDADD)
|
|
|
|
man.cgi: $(CGI_OBJS) libmandoc.a
|
|
$(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
|
|
|
|
-mandocd: $(MANDOCD_OBJS) libmandoc.a
|
|
- $(CC) -o $@ $(LDFLAGS) $(MANDOCD_OBJS) libmandoc.a $(LDADD)
|
|
+mandocd: $(MANDOCD_OBJS) libmandoc.so
|
|
+ $(CC) -o $@ -L. -lmandoc $(LDFLAGS) $(MANDOCD_OBJS) $(LDADD)
|
|
|
|
-catman: catman.o libmandoc.a
|
|
- $(CC) -o $@ $(LDFLAGS) catman.o libmandoc.a $(LDADD)
|
|
+catman: catman.o libmandoc.so
|
|
+ $(CC) -o $@ -L. -lmandoc $(LDFLAGS) catman.o $(LDADD)
|
|
|
|
-demandoc: $(DEMANDOC_OBJS) libmandoc.a
|
|
- $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
|
|
+demandoc: $(DEMANDOC_OBJS) libmandoc.so
|
|
+ $(CC) -o $@ -L. -lmandoc $(LDFLAGS) $(DEMANDOC_OBJS) $(LDADD)
|
|
|
|
soelim: $(SOELIM_OBJS)
|
|
$(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS)
|