From 5cb736b7a128a5c0da8f1460e12045015def52d7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 6 Sep 2023 15:49:17 +0200 Subject: [PATCH] Use the C++ compiler to link semigroups.so --- Makefile.gappkg | 7 ++++++- Makefile.in | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.gappkg b/Makefile.gappkg index 30416303f..e41ead2c0 100644 --- a/Makefile.gappkg +++ b/Makefile.gappkg @@ -33,6 +33,11 @@ # read GAP's build settings include $(GAPPATH)/sysinfo.gap +# Remove quotation marks from some variable +GAC_LDFLAGS := $(subst $\",,$(GAC_LDFLAGS)) +GAP_LDFLAGS := $(subst $\",,$(GAP_LDFLAGS)) +GAP_CXX := $(subst $\",,$(GAP_CXX)) + # hack to support GAP <= 4.9 ifndef GAP_KERNEL_MAJOR_VERSION KEXT_CFLAGS += -I$(GAP_LIB_DIR)/src @@ -133,7 +138,7 @@ gen/%.$(GAP_OBJEXT): %.s Makefile # build rule for linking all object files together into a kernel extension $(KEXT_SO): $(KEXT_OBJS) @mkdir -p $(@D) - $(QUIET_GAC)$(GAC) -d -p "$(KEXT_DEPFLAGS)" -P "$(KEXT_LDFLAGS)" $(KEXT_OBJS) -o $@ + $(QUIET_GAC)$(GAP_CXX) -o $@ $(GAP_LDFLAGS) $(GAC_LDFLAGS) $(KEXT_OBJS) $(KEXT_LDFLAGS) # hook into `make clean` clean: clean-kext diff --git a/Makefile.in b/Makefile.in index 20c3200aa..ada6f6e21 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ KEXT_NAME = semigroups KEXT_CXXFLAGS = @LIBSEMIGROUPS_CFLAGS@ -std=gnu++14 -O3 -KEXT_LDFLAGS = -lstdc++ # add C++ library +KEXT_LDFLAGS = # configure settings GAPPATH = @GAPROOT@