From eb71082b759fc5aedb78829837b37288c3a98c3e Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 13 Sep 2023 22:09:04 +0100 Subject: [PATCH] set rpath for external libsemigroups --- GNUmakefile.in | 1 + Makefile.gappkg | 2 +- m4/ax_check_libsemigroup.m4 | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index ada6f6e21..a6148ead2 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -12,6 +12,7 @@ HPCOMBI_CONSTEXPR_FUN_ARGS = @HPCOMBI_CONSTEXPR_FUN_ARGS@ LIBSEMIGROUPS_HPCOMBI_ENABLED = @LIBSEMIGROUPS_HPCOMBI_ENABLED@ WITH_INCLUDED_LIBSEMIGROUPS = @WITH_INCLUDED_LIBSEMIGROUPS@ SYS_IS_CYGWIN = @SYS_IS_CYGWIN@ +LIBSEMIGROUPS_RPATH = @LIBSEMIGROUPS_RPATH@ # sources KEXT_SOURCES = src/bipart.cpp diff --git a/Makefile.gappkg b/Makefile.gappkg index 1a7d93390..71850f97a 100644 --- a/Makefile.gappkg +++ b/Makefile.gappkg @@ -138,7 +138,7 @@ gen/%.$(GAP_OBJEXT): %.s GNUmakefile # build rule for linking all object files together into a kernel extension $(KEXT_SO): $(KEXT_OBJS) @mkdir -p $(@D) - $(QUIET_GAC)$(GAP_CXX) -o $@ $(GAP_LDFLAGS) $(GAC_LDFLAGS) $(KEXT_OBJS) $(KEXT_LDFLAGS) + $(QUIET_GAC)$(GAP_CXX) -o $@ $(GAP_LDFLAGS) $(GAC_LDFLAGS) $(KEXT_OBJS) $(KEXT_LDFLAGS) $(LIBSEMIGROUPS_RPATH) # hook into `make clean` clean: clean-kext diff --git a/m4/ax_check_libsemigroup.m4 b/m4/ax_check_libsemigroup.m4 index de5173451..112f1df28 100644 --- a/m4/ax_check_libsemigroup.m4 +++ b/m4/ax_check_libsemigroup.m4 @@ -15,7 +15,8 @@ AC_DEFUN([AX_CHECK_LIBSEMIGROUPS], [ [libsemigroups >= $REQUI_LIBSEMIGROUPS_VERSION], [need_included_libsemigroups=no], [need_included_libsemigroups=yes])], - [AC_MSG_NOTICE([ignoring flag --with-external-libsemigroups, the Semigroups configure file was created on a system without m4 macros for pkg-config available...])]) + [AC_MSG_NOTICE([ignoring flag --with-external-libsemigroups, the Semigroups configure file + was created on a system without m4 macros for pkg-config available...])]) fi if test "$need_included_libsemigroups" = yes; then AC_MSG_NOTICE([using included libsemigroups...]) @@ -27,7 +28,8 @@ AC_DEFUN([AX_CHECK_LIBSEMIGROUPS], [ [AS_IF( [test -f libsemigroups/include/libsemigroups.hpp], [], - [AC_MSG_ERROR([libsemigroups is required, clone or download the repo from https://github.com/libsemigroups/libsemigroups into this directory])])]) + [AC_MSG_ERROR([libsemigroups is required, clone or download the repo from + https://github.com/libsemigroups/libsemigroups into this directory])])]) dnl Temporary workaround for compatibility with dev version of dnl libsemigroups which doesn't contain .VERSION file by default @@ -53,6 +55,8 @@ AC_DEFUN([AX_CHECK_LIBSEMIGROUPS], [ else LIBSEMIGROUPS_VERSION="$(pkg-config --modversion libsemigroups)" AC_MSG_NOTICE([using external libsemigroups $LIBSEMIGROUPS_VERSION]) + PKG_CHECK_VAR([LIBSEMIGROUPS_RPATH], [libsemigroups], [libdir], + [AC_SUBST([LIBSEMIGROUPS_RPATH],[-Wl,-rpath,${LIBSEMIGROUPS_RPATH}])]) fi AS_IF([test "x$need_included_libsemigroups" = xyes],