From ba07a8a7f53ec7b2e7ddb030bb37df2099a09de5 Mon Sep 17 00:00:00 2001 From: David Ward Date: Sun, 6 Feb 2022 23:02:01 -0500 Subject: [PATCH] backend/Makefile: Fix installation of backend libraries When using Automake variables like sanelib* to install files in a custom directory, the files are assumed to be platform-independent, unless these variables contain "exec" in the name. This affects whether the files are installed during "make install-data" or "make install-exec". It does not matter whether a suffix like _DATA or _LTLIBRARIES is added to this name. The packaging scripts for Debian call those Makefile targets separately and are affected by this behavior. Since the backend libraries themselves are platform-dependent files, rename these variables to execsanelib*. --- backend/Makefile.am | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/Makefile.am b/backend/Makefile.am index d9a716d88..b3868788b 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -109,9 +109,9 @@ install-data-hook: install-becfg install-firmware-path $(INSTALL_LOCKPATH) # are not lost. install-becfg: becfg @# Libtool has a bug where it will sometimes symlink the last - @# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*. - @# Having two libsane's can cause issues so get rid of it. - -rm -f $(DESTDIR)$(sanelibdir)/libsane.* + @# installed library in $(execsanelibdir) to libsane.*, which + @# causes a conflict with the actual libsane.* in $(libdir). + -rm -f $(DESTDIR)$(execsanelibdir)/libsane.* test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)" test -z "$(configdir)/dll.d" || $(MKDIR_P) "$(DESTDIR)$(configdir)/dll.d" @list="$(BACKEND_CONFS_ENABLED) saned.conf dll.conf"; for cfg in $$list; do \ @@ -225,8 +225,11 @@ EXTRA_LTLIBRARIES = $(be_convenience_libs) $(be_dlopen_libs) lib_LTLIBRARIES = libsane.la -sanelibdir = $(libdir)/sane -sanelib_LTLIBRARIES = $(BACKEND_LIBS_ENABLED) libsane-dll.la +# The libraries in $(libdir)/sane are platform-dependent files, so they +# should be installed during "make install-exec". For that reason, the +# variable names here must contain "exec". +execsanelibdir = $(libdir)/sane +execsanelib_LTLIBRARIES = $(BACKEND_LIBS_ENABLED) libsane-dll.la COMMON_LIBS = ../lib/liblib.la $(XML_LIBS)