Skip to content
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
27 changes: 15 additions & 12 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ SYSINFO_CPPFLAGS =
GAP_CPPFLAGS += -I$(builddir)/build
SYSINFO_CPPFLAGS += -I$(abs_builddir)/build

# The other source files are relative to the srcdir
GAP_CPPFLAGS += -I$(srcdir)/src
SYSINFO_CPPFLAGS += -I$(abs_srcdir)/src

# For backwards compatibility with certain packages and their kernel
# extensions, also add the root of the srcdir to the package CPPFLAGS
SYSINFO_CPPFLAGS += -I$(abs_srcdir)
# The other source files are bundled and exported through the few headers in
# the `src/extra/` directory. We deliberately do not add `src/` itself as an
# include directory to improve portability: it helps avoid clashes between our
# headers and system headers (e.g. for `io.h` this would otherwise be a
# problem on MinGW).
GAP_CPPFLAGS += -I$(srcdir)/src/extra
SYSINFO_CPPFLAGS += -I$(abs_srcdir)/src/extra

# Add GAP_DEFINES (from autoconf, contains -D flags)
GAP_CPPFLAGS += $(GAP_DEFINES)
Expand Down Expand Up @@ -513,10 +513,11 @@ libgap$(SHLIB_EXT): $(LIBGAP_FULL)
gap$(EXEEXT): build/obj/src/main.c.o $(OBJS) cnf/GAP-LDFLAGS cnf/GAP-LIBS cnf/GAP-OBJS
$(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) $< $(OBJS) $(GAP_LIBS) -o $@

# generate a modified copy of main.c for use by the `gap-install` binary
build/main.c: src/main.c config.status
# generate a special main.c which sets SYS_DEFAULT_PATHS and then includes
# regular main.c; this is used to build the `gap-install` binary
build/main.c: sysinfo.gap
@echo "#define SYS_DEFAULT_PATHS \"$(libdir)/gap;$(datarootdir)/gap\"" > $@
@cat $< >> $@
@echo "#include \"$(abs_srcdir)/src/main.c\"" >> $@

# build rule for the gap executable used by the `install-bin` target
build/gap-install: build/obj/build/main.c.o libgap$(SHLIB_EXT) cnf/GAP-LDFLAGS cnf/GAP-LIBS cnf/GAP-OBJS
Expand All @@ -542,7 +543,7 @@ build/c_%.c: $(srcdir)/lib/%.g build/gap-nocomp$(EXEEXT)
# The "ffdata" target regenerates build/ffdata.{c,h} using etc/ffgen.c
########################################################################

ffgen: $(srcdir)/etc/ffgen.c src/common.h build/config.h
ffgen: $(srcdir)/etc/ffgen.c build/config.h
$(QUIET_CC)$(CC) -Wall -Wextra $(GAP_CPPFLAGS) $< -o $@

build/ffdata.h build/ffdata.c: ffgen
Expand Down Expand Up @@ -669,7 +670,7 @@ install-gaproot: install-dirs CITATION


# the following lines adjust variables for the installed sysinfo.gap
install-sysinfo: SYSINFO_CPPFLAGS = -I${includedir}/gap -I${includedir} $(GAP_DEFINES)
install-sysinfo: SYSINFO_CPPFLAGS = -I${includedir}/gap/extra $(GAP_DEFINES)
install-sysinfo: SYSINFO_LDFLAGS = $(ABI_CFLAGS)
install-sysinfo: SYSINFO_GAP = $(bindir)/gap
install-sysinfo: SYSINFO_GAC = $(bindir)/gac
Expand All @@ -686,6 +687,8 @@ 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
$(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap/extra
$(INSTALL) -m 0644 $(srcdir)/src/extra/*.h $(DESTDIR)$(includedir)/gap/extra

install-libgap: install-dirs $(LIBGAP_FULL) libgap.pc
$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)
Expand Down
22 changes: 11 additions & 11 deletions etc/ffgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void emit_code(FILE * dest, int header)
fprintf(dest, "#ifndef GAP_FFDATA_H\n");
fprintf(dest, "#define GAP_FFDATA_H\n");
fprintf(dest, "\n");
fprintf(dest, "#include \"common.h\"\n");
fprintf(dest, "#include <stdint.h>\n");
fprintf(dest, "\n");
fprintf(dest, "enum {\n");
fprintf(dest, " NUM_SHORT_FINITE_FIELDS = %d,\n", num_ff);
Expand All @@ -72,18 +72,18 @@ void emit_code(FILE * dest, int header)
fprintf(dest, " VAL_BITS_FFE = %d\n", needed_bits(MAX_FF - 1));
fprintf(dest, "};\n");
fprintf(dest, "\n");
fprintf(dest, "extern const UInt4 SizeFF[NUM_SHORT_FINITE_FIELDS+1];\n");
fprintf(dest, "extern const UInt1 DegrFF[NUM_SHORT_FINITE_FIELDS+1];\n");
fprintf(dest, "extern const UInt4 CharFF[NUM_SHORT_FINITE_FIELDS+1];\n");
fprintf(dest, "extern const uint32_t SizeFF[NUM_SHORT_FINITE_FIELDS+1];\n");
fprintf(dest, "extern const uint8_t DegrFF[NUM_SHORT_FINITE_FIELDS+1];\n");
fprintf(dest, "extern const uint32_t CharFF[NUM_SHORT_FINITE_FIELDS+1];\n");
fprintf(dest, "\n");
if (num_ff < 65536)
fprintf(dest, "typedef UInt2 FF;\n");
fprintf(dest, "typedef uint16_t FF;\n");
else
fprintf(dest, "typedef UInt4 FF;\n");
fprintf(dest, "typedef uint32_t FF;\n");
if (MAX_FF <= 65536)
fprintf(dest, "typedef UInt2 FFV;\n");
fprintf(dest, "typedef uint16_t FFV;\n");
else
fprintf(dest, "typedef UInt4 FFV;\n");
fprintf(dest, "typedef uint32_t FFV;\n");
fprintf(dest, "\n");
fprintf(dest, "#endif // GAP_FFDATA_H\n");
}
Expand All @@ -94,7 +94,7 @@ void emit_code(FILE * dest, int header)
fprintf(dest, " * to find them. Indices start at 1.\n");
fprintf(dest, " */\n");
fprintf(dest, "\n");
fprintf(dest, "const UInt1 DegrFF[NUM_SHORT_FINITE_FIELDS+1] = {\n");
fprintf(dest, "const uint8_t DegrFF[NUM_SHORT_FINITE_FIELDS+1] = {\n");
fprintf(dest, " %3d,", 0);
for (i = 0, j = 1; i <= MAX_FF; i++) {
if (is_ff[i]) {
Expand All @@ -109,7 +109,7 @@ void emit_code(FILE * dest, int header)
fprintf(dest, "\n");
fprintf(dest, "};\n");
fprintf(dest, "\n");
fprintf(dest, "const UInt4 CharFF[NUM_SHORT_FINITE_FIELDS+1] = {\n");
fprintf(dest, "const uint32_t CharFF[NUM_SHORT_FINITE_FIELDS+1] = {\n");
fprintf(dest, " %9d,", 0);
for (i = 0, j = 1; i <= MAX_FF; i++) {
if (is_ff[i]) {
Expand All @@ -124,7 +124,7 @@ void emit_code(FILE * dest, int header)
fprintf(dest, "\n");
fprintf(dest, "};\n");
fprintf(dest, "\n");
fprintf(dest, "const UInt4 SizeFF[NUM_SHORT_FINITE_FIELDS+1] = {\n");
fprintf(dest, "const uint32_t SizeFF[NUM_SHORT_FINITE_FIELDS+1] = {\n");
fprintf(dest, " %9d,", 0);
for (i = 0, j = 1; i <= MAX_FF; i++) {
if (is_ff[i]) {
Expand Down
20 changes: 20 additions & 0 deletions src/extra/compiled.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/****************************************************************************
**
** This file is part of GAP, a system for computational discrete algebra.
**
** Copyright of GAP belongs to its developers, whose names are too numerous
** to list here. Please refer to the COPYRIGHT file for details.
**
** SPDX-License-Identifier: GPL-2.0-or-later
**
** This header is provided for backwards compatibility with GAP kernel
** extensions that are not yet using the `gap_all.h` header (available since
** GAP 4.12). Most of these used `compiled.h` instead.
*/

#ifndef GAP_EXTRA_COMPILED_H
#define GAP_EXTRA_COMPILED_H

#include "../compiled.h"
Comment thread
ptrrsn marked this conversation as resolved.

#endif // GAP_EXTRA_COMPILED_H
19 changes: 19 additions & 0 deletions src/extra/gap_all.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/****************************************************************************
**
** This file is part of GAP, a system for computational discrete algebra.
**
** Copyright of GAP belongs to its developers, whose names are too numerous
** to list here. Please refer to the COPYRIGHT file for details.
**
** SPDX-License-Identifier: GPL-2.0-or-later
**
** This header includes most of the other GAP headers, and is meant to be
** included by GAP kernel extensions.
*/

#ifndef GAP_EXTRA_GAP_ALL_H
#define GAP_EXTRA_GAP_ALL_H

#include "../gap_all.h"

#endif // GAP_EXTRA_GAP_ALL_H
18 changes: 18 additions & 0 deletions src/extra/libgap-api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/****************************************************************************
**
** This file is part of GAP, a system for computational discrete algebra.
**
** Copyright of GAP belongs to its developers, whose names are too numerous
** to list here. Please refer to the COPYRIGHT file for details.
**
** SPDX-License-Identifier: GPL-2.0-or-later
**
** This header includes LibGAP API, the API for using GAP as shared library.
Comment thread
ptrrsn marked this conversation as resolved.
*/

#ifndef GAP_EXTRA_LIBGAP_API_H
#define GAP_EXTRA_LIBGAP_API_H

#include "../libgap-api.h"

#endif // GAP_EXTRA_LIBGAP_API_H
42 changes: 21 additions & 21 deletions src/hpc/aobjects.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
** This file contains the GAP interface for thread primitives.
*/

#include "hpc/aobjects.h"

#include "hpc/guards.h"
#include "hpc/thread.h"
#include "hpc/traverse.h"

#include "ariths.h"
#include "bool.h"
#include "calls.h"
#include "error.h"
#include "fibhash.h"
#include "gaputils.h"
#include "gvars.h"
#include "io.h"
#include "lists.h"
#include "modules.h"
#include "objects.h"
#include "plist.h"
#include "precord.h"
#include "records.h"
#include "stringobj.h"
#include "aobjects.h"

#include "guards.h"
#include "thread.h"
#include "traverse.h"

#include "../ariths.h"
#include "../bool.h"
#include "../calls.h"
#include "../error.h"
#include "../fibhash.h"
#include "../gaputils.h"
#include "../gvars.h"
#include "../io.h"
#include "../lists.h"
#include "../modules.h"
#include "../objects.h"
#include "../plist.h"
#include "../precord.h"
#include "../records.h"
#include "../stringobj.h"

#include <stdlib.h> // for labs

Expand Down
4 changes: 2 additions & 2 deletions src/hpc/aobjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#ifndef GAP_AOBJECTS_H
#define GAP_AOBJECTS_H

#include "objects.h"
#include "hpc/atomic.h"
#include "../objects.h"
#include "atomic.h"

#ifndef HPCGAP
#error This header is only meant to be used with HPC-GAP
Expand Down
2 changes: 1 addition & 1 deletion src/hpc/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef GAP_ATOMIC_H
#define GAP_ATOMIC_H

#include "common.h"
#include "../common.h"

#ifndef HPCGAP
#error This header is only meant to be used with HPC-GAP
Expand Down
2 changes: 1 addition & 1 deletion src/hpc/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
** SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "hpc/cpu.h"
#include "cpu.h"

#include <unistd.h>

Expand Down
2 changes: 1 addition & 1 deletion src/hpc/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef GAP_HPC_CPU_H
#define GAP_HPC_CPU_H

#include "common.h"
#include "../common.h"

#ifndef HPCGAP
#error This header is only meant to be used with HPC-GAP
Expand Down
4 changes: 2 additions & 2 deletions src/hpc/guards.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#ifndef GAP_HPC_GUARD_H
#define GAP_HPC_GUARD_H

#include "hpc/region.h"
#include "hpc/tls.h"
#include "region.h"
#include "tls.h"

#ifndef HPCGAP
#error This header is only meant to be used with HPC-GAP
Expand Down
2 changes: 1 addition & 1 deletion src/hpc/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
** SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "hpc/misc.h"
#include "misc.h"

#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion src/hpc/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef GAP_HPC_MISC_H
#define GAP_HPC_MISC_H

#include "common.h"
#include "../common.h"

#ifndef HPCGAP
#error This header is only meant to be used with HPC-GAP
Expand Down
14 changes: 7 additions & 7 deletions src/hpc/region.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
** SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "hpc/region.h"
#include "region.h"

#ifdef USE_BOEHM_GC
#include "boehm_gc.h"
#include "../boehm_gc.h"
#endif
#include "gasman.h"
#include "objects.h"
#include "../gasman.h"
#include "../objects.h"

// #include "hpc/misc.h"
#include "hpc/thread.h"
#include "hpc/guards.h"
// #include "misc.h"
#include "thread.h"
#include "guards.h"


#include <pthread.h>
Expand Down
4 changes: 2 additions & 2 deletions src/hpc/region.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
#ifndef GAP_REGION_H
#define GAP_REGION_H

#include "common.h"
#include "../common.h"

#ifndef HPCGAP
#error This header is only meant to be used with HPC-GAP
#endif

#include "hpc/atomic.h"
#include "atomic.h"

typedef struct Region Region;

Expand Down
32 changes: 16 additions & 16 deletions src/hpc/serialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
** SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "hpc/serialize.h"

#include "bool.h"
#include "calls.h"
#include "error.h"
#include "gvars.h"
#include "modules.h"
#include "objset.h"
#include "plist.h"
#include "precord.h"
#include "rational.h"
#include "records.h"
#include "stringobj.h"
#include "trycatch.h"

#include "hpc/aobjects.h"
#include "serialize.h"

#include "../bool.h"
#include "../calls.h"
#include "../error.h"
#include "../gvars.h"
#include "../modules.h"
#include "../objset.h"
#include "../plist.h"
#include "../precord.h"
#include "../rational.h"
#include "../records.h"
#include "../stringobj.h"
#include "../trycatch.h"

#include "aobjects.h"

#include <stdio.h>

Expand Down
2 changes: 1 addition & 1 deletion src/hpc/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef GAP_SERIALIZE_H
#define GAP_SERIALIZE_H

#include "common.h"
#include "../common.h"

typedef struct SerializerState SerializerState;
typedef struct DeserializerState DeserializerState;
Expand Down
Loading
Loading