Skip to content

Commit

Permalink
kernel: don't include config.h from any header file
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Nov 4, 2021
1 parent 7039321 commit 70afb0b
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 10 deletions.
8 changes: 0 additions & 8 deletions README.buildsys.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/blister.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
#include "saveload.h"
#include "set.h"

#include "config.h"


#define RequireBlist(funcname, op) \
RequireArgumentCondition(funcname, op, IsBlistConv(op), \
Expand Down
2 changes: 0 additions & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef GAP_COMMON_H
#define GAP_COMMON_H

#include "config.h"

#include <assert.h>
#include <stdint.h>

Expand Down
2 changes: 2 additions & 0 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "hpc/region.h"
#endif

#include "config.h"

#include <stdio.h>
#include <stdlib.h>

Expand Down
2 changes: 2 additions & 0 deletions src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
#include "boehm_gc.h"
#endif

#include "config.h"

#include <gmp.h>

static Obj Error;
Expand Down
2 changes: 2 additions & 0 deletions src/gaptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "sysfiles.h"
#include "system.h"

#include "config.h"

#include <errno.h>
#include <stddef.h>
#include <sys/time.h>
Expand Down
2 changes: 2 additions & 0 deletions src/gasman.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@

#include "bags.inc"

#include "config.h"

#include <setjmp.h>
#include <string.h>

Expand Down
2 changes: 2 additions & 0 deletions src/integer.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
#include "stats.h"
#include "stringobj.h"

#include "config.h"


/* TODO: Remove after Ward2 */
#ifndef WARD_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions src/iostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#include "hpc/thread.h"

#include "config.h"

#include <errno.h>
#include <fcntl.h>
#include <signal.h>
Expand Down
2 changes: 2 additions & 0 deletions src/julia_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include "bags.inc"

#include "config.h"

#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 2 additions & 0 deletions src/macfloat.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "stringobj.h"
#include "sysstr.h"

#include "config.h"

#include <stdio.h>
#include <stdlib.h>

Expand Down
2 changes: 2 additions & 0 deletions src/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "sysstr.h"
#include "vars.h"

#include "config.h"

#ifdef HAVE_DLOPEN
#include <dlfcn.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#include "hpc/thread.h"

#include "config.h"

#include <stdio.h>
#include <sys/time.h> // for gettimeofday
#include <sys/types.h>
Expand Down
2 changes: 2 additions & 0 deletions src/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "sysfiles.h"
#include "vars.h"

#include "config.h"

#ifdef USE_GASMAN
#include "sysmem.h"
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "trycatch.h"
#include "vars.h"

#include "config.h"

#include <dirent.h>
#include <errno.h>
#include <stdlib.h>
Expand Down
5 changes: 5 additions & 0 deletions src/sysfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -35,6 +38,8 @@

#include "hpc/thread.h"

#include "config.h"

#include <assert.h>
#include <errno.h>
#include <fcntl.h>
Expand Down
2 changes: 2 additions & 0 deletions src/sysmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "sysfiles.h"
#include "sysopt.h"

#include "config.h"

#ifdef GAP_MEM_CHECK
#include <fcntl.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "boehm_gc.h"
#endif

#include "config.h"

#include <assert.h>
#include <fcntl.h>
#include <stdarg.h>
Expand Down

0 comments on commit 70afb0b

Please sign in to comment.