Skip to content

Commit

Permalink
Use the C++ compiler to link semigroups.so
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored and james-d-mitchell committed Sep 11, 2023
1 parent c819563 commit 5c5f780
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile.gappkg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down

0 comments on commit 5c5f780

Please sign in to comment.