From 9f5add6a0344fcef0611c06a7958031bead835b4 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 20 Jun 2022 17:14:52 +0530 Subject: Makefile: Suffix libguilexapian with effective Guile version number. We need to distinguish between libguilexapian built for different versions of Guile. * Makefile.am (lib_LTLIBRARIES): Replace libguilexapian.la with libguilexapian-@GUILE_EFFECTIVE_VERSION@.la. (libguilexapian_la_SOURCES): Rename to libguilexapian_@GUILE_EFFECTIVE_VERSION@_la_SOURCES. (libguilexapian_la_CXXFLAGS): Rename to libguilexapian_@GUILE_EFFECTIVE_VERSION@_la_CXXFLAGS. (libguilexapian_la_LDFLAGS): Rename to libguilexapian_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS. (xapian.i): Substitute @GUILE_EFFECTIVE_VERSION@. (xapian/xapian.go): Depend on libguilexapian-@GUILE_EFFECTIVE_VERSION@.la instead of libguilexapian.la. * xapian.i.in: Load libguilexapian-@GUILE_EFFECTIVE_VERSION@.la instead of libguilexapian.la. --- Makefile.am | 13 +++++++------ xapian.i.in | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index db36483..e88d63b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ # guile-xapian --- Guile bindings for Xapian # Copyright © 2020, 2021, 2022 Arun Isaac +# Copyright © 2022 Bob131 # # This file is part of guile-xapian. # @@ -37,17 +38,17 @@ SWIG_GEN_1 = # Xapian wrapper -lib_LTLIBRARIES = libguilexapian.la +lib_LTLIBRARIES = libguilexapian-@GUILE_EFFECTIVE_VERSION@.la BUILT_SOURCES = xapian_wrap.cc xapian/wrap.scm -libguilexapian_la_SOURCES = xapian_wrap.cc -libguilexapian_la_CXXFLAGS = $(GUILE_CFLAGS) $(XAPIAN_CFLAGS) -libguilexapian_la_LDFLAGS = $(GUILE_LIBS) $(XAPIAN_LIBS) +libguilexapian_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = xapian_wrap.cc +libguilexapian_@GUILE_EFFECTIVE_VERSION@_la_CXXFLAGS = $(GUILE_CFLAGS) $(XAPIAN_CFLAGS) +libguilexapian_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = $(GUILE_LIBS) $(XAPIAN_LIBS) CLEANFILES = xapian.i xapian_wrap.cc xapian/wrap.scm xapian.i: xapian.i.in Makefile - sed 's|@libdir[@]|$(libdir)|g' $< > $@ + sed -e 's|@libdir[@]|$(libdir)|g' -e 's|@GUILE_EFFECTIVE_VERSION[@]|$(GUILE_EFFECTIVE_VERSION)|g' $< > $@ xapian_wrap.cc xapian/wrap.scm &: xapian.i xapian-head.i xapian-headers.i $(MKDIR_P) xapian @@ -72,7 +73,7 @@ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat # Building xapian/xapian.scm additionally requires the libguilexapian # shared library. -xapian/xapian.go: xapian/xapian.scm libguilexapian.la +xapian/xapian.go: xapian/xapian.scm libguilexapian-@GUILE_EFFECTIVE_VERSION@.la # Tests diff --git a/xapian.i.in b/xapian.i.in index 4f36f8e..f1ffe07 100644 --- a/xapian.i.in +++ b/xapian.i.in @@ -1,6 +1,6 @@ /* guile-xapian --- Guile bindings for Xapian * Copyright © 2020 Arun Isaac - * Copyright © 2021 Bob131 + * Copyright © 2021, 2022 Bob131 * * This file is part of guile-xapian. * @@ -30,9 +30,9 @@ ;; so that guile-xapian finds libguilexapian both before and after installation. (catch #t (lambda () - (load-extension "@libdir@/libguilexapian" "SWIG_init")) + (load-extension "@libdir@/libguilexapian-@GUILE_EFFECTIVE_VERSION@" "SWIG_init")) (lambda _ - (load-extension "libguilexapian" "SWIG_init"))) + (load-extension "libguilexapian-@GUILE_EFFECTIVE_VERSION@" "SWIG_init"))) %} %{ -- cgit v1.2.3