$NetBSD: patch-Makefile.in,v 1.6 2022/06/19 14:43:28 gdt Exp $ Add a shlib version to the shared library, which does not have one, for reasons not understood. This is accomplished by defining a SHLIB_VERSION make variable by autoconf substitution (and oddly but not importantly, including a . in the make variable rather than where used). Build and install a static version of the expect library. Use standard rather than namespaced directories for data/lib/include. \todo Decide if this is working around an upstream bug, and if so file upstream, or if it is a pkgsrc accomodation. Include LDFLAGS when linking (for RELRO). \todo File changes upstream (but upstream is not functioning). --- Makefile.in.orig 2010-09-30 17:14:07.000000000 +0000 +++ Makefile.in @@ -99,7 +99,9 @@ PKG_HEADERS = @PKG_HEADERS@ # configuration options) composed of the named objects. #======================================================================== +SHLIB_VERSION = .@SHLIB_VERSION@ PKG_LIB_FILE = @PKG_LIB_FILE@ +PKG_LIB_A_FILE = ${PKG_LIB_FILE:.so=.a} PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ lib_BINARIES = $(PKG_LIB_FILE) @@ -121,9 +123,9 @@ includedir = @includedir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) +pkgdatadir = $(datadir) +pkglibdir = $(libdir) +pkgincludedir = $(includedir) top_builddir = . @@ -149,7 +151,7 @@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ -SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ +SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ ${LDFLAGS} STLIB_LD = @STLIB_LD@ TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ @@ -214,10 +216,15 @@ all: binaries libraries doc # of the Makefile, in the "BINARIES" variable. #======================================================================== -binaries: $(BINARIES) pkgIndex.tcl-hand +binaries: $(BINARIES) pkgIndex.tcl-hand ${PKG_LIB_A_FILE} libraries: +${PKG_LIB_A_FILE}: $(PKG_OBJECTS) + rm -rf $@ + ar cr $@ $(PKG_OBJECTS) + $(RANLIB) $@ + doc: install: all install-binaries install-libraries install-doc @@ -547,6 +554,9 @@ install-lib-binaries: fi; \ fi; \ done + mv $(DESTDIR)$(pkglibdir)/$(PKG_LIB_FILE) $(DESTDIR)$(pkglibdir)/$(PKG_LIB_FILE)$(SHLIB_VERSION) + cd $(DESTDIR)$(pkglibdir) && ln -fs $(PKG_LIB_FILE)$(SHLIB_VERSION) $(PKG_LIB_FILE) + $(INSTALL_DATA) $(PKG_LIB_A_FILE) $(DESTDIR)$(pkglibdir)/$(PKG_LIB_A_FILE) @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ @@ -554,9 +564,11 @@ install-lib-binaries: $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ fi; \ done + mkdir -p $(DESTDIR)$(pkglibdir)/tcl/expect$(PACKAGE_VERSION) + ln -fs ../../$(PKG_LIB_FILE) $(DESTDIR)$(pkglibdir)/tcl/expect$(PACKAGE_VERSION)/ @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ - $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir)/tcl/expect$(PACKAGE_VERSION); \ fi #========================================================================