From 70afb0b3cc2ce3842d37d54a09a5c78092c3b713 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 25 Oct 2021 23:39:37 +0200 Subject: [PATCH] kernel: don't include config.h from any header file --- README.buildsys.md | 8 -------- src/blister.c | 2 ++ src/common.h | 2 -- src/debug.c | 2 ++ src/gap.c | 2 ++ src/gaptime.c | 2 ++ src/gasman.c | 2 ++ src/integer.c | 2 ++ src/iostream.c | 2 ++ src/julia_gc.c | 2 ++ src/macfloat.c | 2 ++ src/modules.c | 2 ++ src/profile.c | 2 ++ src/stats.c | 2 ++ src/streams.c | 2 ++ src/sysfiles.c | 5 +++++ src/sysmem.c | 2 ++ src/system.c | 2 ++ 18 files changed, 35 insertions(+), 10 deletions(-) diff --git a/README.buildsys.md b/README.buildsys.md index 56f3afca45..4bb84d71d6 100644 --- a/README.buildsys.md +++ b/README.buildsys.md @@ -130,7 +130,6 @@ far off. Compatibility mode does the following things: -* create `sysinfo.gap` file in the build dir * create a symlink `sysinfo.gap-default$ABI` pointing at `sysinfo.gap` * create a `bin/$GAPARCH/config.h` symlink pointing at `build/config.h` * create a `bin/$GAPARCH/gac` symlink pointing at `gac` @@ -249,13 +248,6 @@ support for free. While it does indeed provide various parts of the puzzle, from our perspective those are mostly the easy ones (they may be tedious, but are not conceptually difficult). The real obstacles for `make install` support are unfortunately not resolved by using `automake`. Among these are: -- dealing with installing the generated `config.h`. This file should ideally - not be installed at all and to this end not be included from any other - headers. But note that in GAP, currently *all* headers need to include - config.h directly or indirectly... Alternatively one can attempt to use - something like `AX_PREFIX_CONFIG_H`, but this, too, has its pitfalls -- removing dependencies on compiler specific features in the headers and API, - mainly as introduced by `config.h` - making `gac` installable; in particular installing a version of GNU libtool needed by `gac` - The probably hardest problem of them all is coming up with a sane way for diff --git a/src/blister.c b/src/blister.c index 0318ea4455..98783a64dc 100644 --- a/src/blister.c +++ b/src/blister.c @@ -84,6 +84,8 @@ #include "saveload.h" #include "set.h" +#include "config.h" + #define RequireBlist(funcname, op) \ RequireArgumentCondition(funcname, op, IsBlistConv(op), \ diff --git a/src/common.h b/src/common.h index 9c015c23e5..058cffd9ec 100644 --- a/src/common.h +++ b/src/common.h @@ -11,8 +11,6 @@ #ifndef GAP_COMMON_H #define GAP_COMMON_H -#include "config.h" - #include #include diff --git a/src/debug.c b/src/debug.c index e28d15672c..31b0265f00 100644 --- a/src/debug.c +++ b/src/debug.c @@ -28,6 +28,8 @@ #include "hpc/region.h" #endif +#include "config.h" + #include #include diff --git a/src/gap.c b/src/gap.c index e9450dcc26..2a89a1d68f 100644 --- a/src/gap.c +++ b/src/gap.c @@ -58,6 +58,8 @@ #include "boehm_gc.h" #endif +#include "config.h" + #include static Obj Error; diff --git a/src/gaptime.c b/src/gaptime.c index 0f647102f8..9fc54bf1e7 100644 --- a/src/gaptime.c +++ b/src/gaptime.c @@ -24,6 +24,8 @@ #include "sysfiles.h" #include "system.h" +#include "config.h" + #include #include #include diff --git a/src/gasman.c b/src/gasman.c index e2b95f2894..34f0dcdc1b 100644 --- a/src/gasman.c +++ b/src/gasman.c @@ -124,6 +124,8 @@ #include "bags.inc" +#include "config.h" + #include #include diff --git a/src/integer.c b/src/integer.c index eb07a6ce79..09f3ca301a 100644 --- a/src/integer.c +++ b/src/integer.c @@ -79,6 +79,8 @@ #include "stats.h" #include "stringobj.h" +#include "config.h" + /* TODO: Remove after Ward2 */ #ifndef WARD_ENABLED diff --git a/src/iostream.c b/src/iostream.c index 53ded24d05..58d69deaed 100644 --- a/src/iostream.c +++ b/src/iostream.c @@ -35,6 +35,8 @@ #include "hpc/thread.h" +#include "config.h" + #include #include #include diff --git a/src/julia_gc.c b/src/julia_gc.c index 8de4119575..3d0997ab20 100644 --- a/src/julia_gc.c +++ b/src/julia_gc.c @@ -31,6 +31,8 @@ #include "bags.inc" +#include "config.h" + #include #include #include diff --git a/src/macfloat.c b/src/macfloat.c index 4c8c0e0725..a4e45a2f16 100644 --- a/src/macfloat.c +++ b/src/macfloat.c @@ -33,6 +33,8 @@ #include "stringobj.h" #include "sysstr.h" +#include "config.h" + #include #include diff --git a/src/modules.c b/src/modules.c index 8deaf5f229..b0b6f0c7e6 100644 --- a/src/modules.c +++ b/src/modules.c @@ -38,6 +38,8 @@ #include "sysstr.h" #include "vars.h" +#include "config.h" + #ifdef HAVE_DLOPEN #include #endif diff --git a/src/profile.c b/src/profile.c index 7a06415127..a9bd3e437f 100644 --- a/src/profile.c +++ b/src/profile.c @@ -32,6 +32,8 @@ #include "hpc/thread.h" +#include "config.h" + #include #include // for gettimeofday #include diff --git a/src/stats.c b/src/stats.c index 9d828342cb..4dbcfdff9c 100644 --- a/src/stats.c +++ b/src/stats.c @@ -35,6 +35,8 @@ #include "sysfiles.h" #include "vars.h" +#include "config.h" + #ifdef USE_GASMAN #include "sysmem.h" #endif diff --git a/src/streams.c b/src/streams.c index ec30f26495..1698d6d5dc 100644 --- a/src/streams.c +++ b/src/streams.c @@ -38,6 +38,8 @@ #include "trycatch.h" #include "vars.h" +#include "config.h" + #include #include #include diff --git a/src/sysfiles.c b/src/sysfiles.c index 91e8c51414..b026c14056 100644 --- a/src/sysfiles.c +++ b/src/sysfiles.c @@ -11,6 +11,9 @@ ** file and stream operations. */ +// ensure we can access large files +#define _FILE_OFFSET_BITS 64 + #include "sysfiles.h" #include "bool.h" @@ -35,6 +38,8 @@ #include "hpc/thread.h" +#include "config.h" + #include #include #include diff --git a/src/sysmem.c b/src/sysmem.c index b96adb97da..85c6bf7433 100644 --- a/src/sysmem.c +++ b/src/sysmem.c @@ -19,6 +19,8 @@ #include "sysfiles.h" #include "sysopt.h" +#include "config.h" + #ifdef GAP_MEM_CHECK #include #endif diff --git a/src/system.c b/src/system.c index 8b16f114f9..aa4e86f5c3 100644 --- a/src/system.c +++ b/src/system.c @@ -38,6 +38,8 @@ #include "boehm_gc.h" #endif +#include "config.h" + #include #include #include