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

Allow kernel extensions to use GAP header files via #include <gap/HEADER.h> instead of #include "src/HEADER.h" or #include "HEADER.h" (improves compatibility with "install" GAP versions shipped by Linux distributions) #5187

Merged
merged 1 commit into from
Nov 7, 2022
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
19 changes: 13 additions & 6 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
########################################################################
# Default rule: build gap
########################################################################
all: gap$(EXEEXT) gac libgap.la CITATION doc/versiondata
all: gap$(EXEEXT) gac libgap.la CITATION doc/versiondata build/gap
.PHONY: all

# Backwards compatibility: add "default" target as alias for "all"
Expand Down Expand Up @@ -634,7 +634,7 @@ install-gaproot: CITATION


# the following lines adjust variables for the installed sysinfo.gap
install-sysinfo: SYSINFO_CPPFLAGS = -I${includedir}/gap $(GAP_DEFINES)
install-sysinfo: SYSINFO_CPPFLAGS = -I${includedir}/gap -I${includedir} $(GAP_DEFINES)
install-sysinfo: SYSINFO_LDFLAGS = $(ABI_CFLAGS)
install-sysinfo: SYSINFO_GAP = $(bindir)/gap
install-sysinfo: SYSINFO_GAP2 = $(libdir)/gap/gap
Expand All @@ -653,11 +653,15 @@ install-headers: $(FFDATA_H) build/version.h
$(INSTALL) -m 0644 $(builddir)/build/version.h $(DESTDIR)$(includedir)/gap
$(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap/hpc
$(INSTALL) -m 0644 $(srcdir)/src/hpc/*.h $(DESTDIR)$(includedir)/gap/hpc
# Create fake "src/compiled.h" header which includes the real one; for
# compatibility with GAP packages still using `#include "src/compiled.h"`
# For compatibility with GAP packages still using `#include "src/compiled.h"`
# and similar, also install copies of all headers into a `src` directory
# TODO: remove this once no distributed packages needs it anymore
$(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap/src
@echo "#include \"$(includedir)/gap/compiled.h\"" > $(DESTDIR)$(includedir)/gap/src/compiled.h
chmod 0644 $(DESTDIR)$(includedir)/gap/src/compiled.h
$(INSTALL) -m 0644 $(srcdir)/src/*.h $(DESTDIR)$(includedir)/gap/src
$(INSTALL) -m 0644 $(FFDATA_H) $(DESTDIR)$(includedir)/gap/src
$(INSTALL) -m 0644 $(builddir)/build/version.h $(DESTDIR)$(includedir)/gap/src
$(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap/src/hpc
$(INSTALL) -m 0644 $(srcdir)/src/hpc/*.h $(DESTDIR)$(includedir)/gap/src/hpc

install-libgap: libgap.la libgap.pc
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)
Expand Down Expand Up @@ -1260,6 +1264,9 @@ GNUmakefile: $(srcdir)/GNUmakefile.in config.status
libtool: config.status
@$(SHELL) ./config.status $@

build/gap:
@mkdir -p $(@D) && ln -sf $(abs_srcdir)/src build/gap

########################################################################
# Special .PHONY target: targets depending on it will always be
# considered dirty by target, hence are forced to be re-run
Expand Down
2 changes: 2 additions & 0 deletions src/gap_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ extern "C" {
#include "gvars.h"
#include "info.h"
#include "integer.h"
#include "intfuncs.h"
#include "intrprtr.h"
#include "io.h"
#include "iostream.h"
Expand All @@ -58,6 +59,7 @@ extern "C" {
#include "plist.h"
#include "pperm.h"
#include "precord.h"
#include "profile.h"
#include "range.h"
#include "rational.h"
#include "read.h"
Expand Down