Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildsys: unify rpath handling #976

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
KEXT_NAME = semigroups

KEXT_CXXFLAGS = @LIBSEMIGROUPS_CFLAGS@ -std=gnu++14 -O3
KEXT_LDFLAGS =
KEXT_LDFLAGS = @LIBSEMIGROUPS_RPATH@ @LIBSEMIGROUPS_LIBS@

# configure settings
GAPPATH = @GAPROOT@
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@
abs_top_builddir = @abs_top_builddir@

# sources
KEXT_SOURCES = src/bipart.cpp
Expand Down Expand Up @@ -43,7 +43,6 @@ KEXT_CXXFLAGS += $(HPCOMBI_CXXFLAGS)
endif

ifdef WITH_INCLUDED_LIBSEMIGROUPS
KEXT_LDFLAGS += -Wl,-rpath,$(PWD)/bin/lib
# FIXME(later) all the include paths should point into bin/include/ and not to
# the sources, or otherwise we should stop make installing into bin
ifdef LIBSEMIGROUPS_HPCOMBI_ENABLED
Expand All @@ -63,8 +62,6 @@ endif

KEXT_CXXFLAGS += $(KEXT_CPPFLAGS) # HACK: there is no KEXT_CPPFLAGS

KEXT_LDFLAGS += @LIBSEMIGROUPS_LIBS@

# HACK: On cygwin, add this flag to work around issues where fork() sometimes
# fails on Cygwin when semigroups.so is loaded into GAP. This will hopefully
# become unnecessary with GAP 4.13, which will automatically add this to the
Expand Down
2 changes: 1 addition & 1 deletion Makefile.gappkg
Original file line number Diff line number Diff line change
Expand Up @@ -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) $(LIBSEMIGROUPS_RPATH)
$(QUIET_GAC)$(GAP_CXX) -o $@ $(GAP_LDFLAGS) $(GAC_LDFLAGS) $(KEXT_OBJS) $(KEXT_LDFLAGS)

# hook into `make clean`
clean: clean-kext
Expand Down
2 changes: 2 additions & 0 deletions m4/ax_check_libsemigroup.m4
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ AC_DEFUN([AX_CHECK_LIBSEMIGROUPS], [
AC_SUBST(LIBSEMIGROUPS_CFLAGS, ['-I./bin/include -I./bin/include/libsemigroups'])
AC_SUBST(LIBSEMIGROUPS_LIBS, ['-L./bin/lib -lsemigroups'])
AC_CONFIG_SUBDIRS([libsemigroups])

AC_SUBST([LIBSEMIGROUPS_RPATH],['-Wl,-rpath,$(abs_top_builddir)/bin/lib'])
else
LIBSEMIGROUPS_VERSION="$(pkg-config --modversion libsemigroups)"
AC_MSG_NOTICE([using external libsemigroups $LIBSEMIGROUPS_VERSION])
Expand Down
Loading