From 3eceb036efbb33e940b61df0b92c34416189d4ce Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 21 Mar 2019 09:53:02 -0500 Subject: [PATCH] Internalize build options into config header. --- src/engine/build.sh | 8 -------- src/engine/builtins.h | 1 + src/engine/class.h | 1 + src/engine/command.h | 1 + src/engine/compile.h | 1 + src/engine/config.h | 20 ++++++++++++++++++++ src/engine/config_toolset.bat | 8 -------- src/engine/constants.h | 1 + src/engine/cwd.h | 1 + src/engine/debug.h | 1 + src/engine/debugger.h | 1 + src/engine/execcmd.h | 1 + src/engine/filesys.h | 1 + src/engine/frames.h | 1 + src/engine/function.h | 1 + src/engine/hash.h | 1 + src/engine/hcache.c | 2 ++ src/engine/hcache.h | 1 + src/engine/hdrmacro.h | 1 + src/engine/headers.h | 1 + src/engine/jam.h | 2 ++ src/engine/lists.h | 1 + src/engine/make.h | 1 + src/engine/mem.h | 2 ++ src/engine/modules.h | 1 + src/engine/native.h | 1 + src/engine/object.h | 2 ++ src/engine/option.h | 2 ++ src/engine/output.h | 1 + src/engine/parse.h | 1 + src/engine/pathsys.h | 1 + src/engine/regexp.h | 2 ++ src/engine/rules.h | 1 + src/engine/scan.h | 1 + src/engine/search.h | 1 + src/engine/strings.h | 1 + src/engine/subst.h | 1 + src/engine/timestamp.h | 1 + src/engine/variable.h | 1 + 39 files changed, 62 insertions(+), 16 deletions(-) create mode 100644 src/engine/config.h diff --git a/src/engine/build.sh b/src/engine/build.sh index c2a39041d..90d9cab66 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -162,14 +162,6 @@ case "$1" in esac BOOST_JAM_OPT_JAM="\ -DNDEBUG \ - -DOPT_HEADER_CACHE_EXT \ - -DOPT_GRAPH_DEBUG_EXT \ - -DOPT_SEMAPHORE \ - -DOPT_AT_FILES \ - -DOPT_DEBUG_PROFILE \ - -DJAM_DEBUGGER \ - -DOPT_FIX_TARGET_VARIABLES_EXT \ - -DOPT_IMPROVED_PATIENCE_EXT \ -DYYSTACKSIZE=5000 \ -DYYINITDEPTH=5000 \ -o b2" diff --git a/src/engine/builtins.h b/src/engine/builtins.h index 617ad18c6..241a0d050 100644 --- a/src/engine/builtins.h +++ b/src/engine/builtins.h @@ -7,6 +7,7 @@ #ifndef JAM_BUILTINS_H # define JAM_BUILTINS_H +# include "config.h" # include "frames.h" /* diff --git a/src/engine/class.h b/src/engine/class.h index 256d298b5..ee76e80c7 100644 --- a/src/engine/class.h +++ b/src/engine/class.h @@ -5,6 +5,7 @@ #ifndef CLASS_H_VP_2003_08_01 #define CLASS_H_VP_2003_08_01 +#include "config.h" #include "lists.h" #include "frames.h" diff --git a/src/engine/command.h b/src/engine/command.h index fd59ed11d..9091cdcc7 100644 --- a/src/engine/command.h +++ b/src/engine/command.h @@ -40,6 +40,7 @@ #ifndef COMMAND_SW20111118_H #define COMMAND_SW20111118_H +#include "config.h" #include "lists.h" #include "rules.h" #include "strings.h" diff --git a/src/engine/compile.h b/src/engine/compile.h index c70f98b9e..97370a92d 100644 --- a/src/engine/compile.h +++ b/src/engine/compile.h @@ -17,6 +17,7 @@ #ifndef COMPILE_DWA20011022_H #define COMPILE_DWA20011022_H +#include "config.h" #include "frames.h" #include "lists.h" #include "object.h" diff --git a/src/engine/config.h b/src/engine/config.h new file mode 100644 index 000000000..6260f5a7b --- /dev/null +++ b/src/engine/config.h @@ -0,0 +1,20 @@ +#ifndef B2_CONFIG_H +#define B2_CONFIG_H + +/* +Copyright 2002-2018 Rene Rivera. +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#define OPT_HEADER_CACHE_EXT 1 +#define OPT_GRAPH_DEBUG_EXT 1 +#define OPT_SEMAPHORE 1 +#define OPT_AT_FILES 1 +#define OPT_DEBUG_PROFILE 1 +#define JAM_DEBUGGER 1 +#define OPT_FIX_TARGET_VARIABLES_EXT 1 +#define OPT_IMPROVED_PATIENCE_EXT 1 + +#endif diff --git a/src/engine/config_toolset.bat b/src/engine/config_toolset.bat index 76d2661c7..6c3d4dc17 100644 --- a/src/engine/config_toolset.bat +++ b/src/engine/config_toolset.bat @@ -19,14 +19,6 @@ if "_%BOOST_JAM_TOOLSET%_" == "_intel-win32_" call :Config_INTEL_WIN32 if "_%BOOST_JAM_TOOLSET%_" == "_mingw_" call :Config_MINGW set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DNT" set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DNDEBUG" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DOPT_HEADER_CACHE_EXT" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DOPT_GRAPH_DEBUG_EXT" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DOPT_SEMAPHORE" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DOPT_AT_FILES" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DOPT_DEBUG_PROFILE" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DJAM_DEBUGGER" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DOPT_FIX_TARGET_VARIABLES_EXT" -set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DOPT_IMPROVED_PATIENCE_EXT" set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DYYSTACKSIZE=5000" set "BOOST_JAM_OPT_JAM=%BOOST_JAM_OPT_JAM% -DYYINITDEPTH=5000" exit /b %errorlevel% diff --git a/src/engine/constants.h b/src/engine/constants.h index 994275719..ec112080d 100644 --- a/src/engine/constants.h +++ b/src/engine/constants.h @@ -11,6 +11,7 @@ #ifndef BOOST_JAM_CONSTANTS_H #define BOOST_JAM_CONSTANTS_H +#include "config.h" #include "object.h" void constants_init( void ); diff --git a/src/engine/cwd.h b/src/engine/cwd.h index 886714a8f..39a66f843 100644 --- a/src/engine/cwd.h +++ b/src/engine/cwd.h @@ -12,6 +12,7 @@ #ifndef CWD_H #define CWD_H +#include "config.h" #include "object.h" diff --git a/src/engine/debug.h b/src/engine/debug.h index b4e8472c9..d61faf450 100644 --- a/src/engine/debug.h +++ b/src/engine/debug.h @@ -8,6 +8,7 @@ #ifndef BJAM_DEBUG_H #define BJAM_DEBUG_H +#include "config.h" #include "constants.h" #include "object.h" diff --git a/src/engine/debugger.h b/src/engine/debugger.h index 79eb4ce7e..67956c76a 100644 --- a/src/engine/debugger.h +++ b/src/engine/debugger.h @@ -8,6 +8,7 @@ #ifndef DEBUGGER_SW20150314_H #define DEBUGGER_SW20150314_H +#include "config.h" #include #include "object.h" #include "frames.h" diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index f26d97acb..59cba4245 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -15,6 +15,7 @@ #ifndef EXECCMD_H #define EXECCMD_H +#include "config.h" #include "lists.h" #include "strings.h" #include "timestamp.h" diff --git a/src/engine/filesys.h b/src/engine/filesys.h index a80634342..48ea6d171 100644 --- a/src/engine/filesys.h +++ b/src/engine/filesys.h @@ -17,6 +17,7 @@ #ifndef FILESYS_DWA20011025_H #define FILESYS_DWA20011025_H +#include "config.h" #include "hash.h" #include "lists.h" #include "object.h" diff --git a/src/engine/frames.h b/src/engine/frames.h index fd2ebe5c4..c134d9c79 100644 --- a/src/engine/frames.h +++ b/src/engine/frames.h @@ -8,6 +8,7 @@ #ifndef FRAMES_DWA20011021_H #define FRAMES_DWA20011021_H +#include "config.h" #include "lists.h" #include "modules.h" #include "object.h" diff --git a/src/engine/function.h b/src/engine/function.h index 1d863cfff..fb951c096 100644 --- a/src/engine/function.h +++ b/src/engine/function.h @@ -7,6 +7,7 @@ #ifndef FUNCTION_SW20111123_H #define FUNCTION_SW20111123_H +#include "config.h" #include "object.h" #include "frames.h" #include "lists.h" diff --git a/src/engine/hash.h b/src/engine/hash.h index 7c40e8c4a..7ed633d73 100644 --- a/src/engine/hash.h +++ b/src/engine/hash.h @@ -11,6 +11,7 @@ #ifndef BOOST_JAM_HASH_H #define BOOST_JAM_HASH_H +#include "config.h" #include "object.h" /* diff --git a/src/engine/hcache.c b/src/engine/hcache.c index 33c16c7ed..15ab12a35 100644 --- a/src/engine/hcache.c +++ b/src/engine/hcache.c @@ -25,6 +25,8 @@ * @boundname@ timestamp_sec timestamp_nsec @file@ @file@ @file@ ... */ +#include "config.h" + #ifdef OPT_HEADER_CACHE_EXT #include "jam.h" diff --git a/src/engine/hcache.h b/src/engine/hcache.h index a9d929d51..95267c267 100644 --- a/src/engine/hcache.h +++ b/src/engine/hcache.h @@ -8,6 +8,7 @@ #ifndef HCACHE_H #define HCACHE_H +#include "config.h" #include "lists.h" #include "regexp.h" #include "rules.h" diff --git a/src/engine/hdrmacro.h b/src/engine/hdrmacro.h index 7595ede26..1489aef9c 100644 --- a/src/engine/hdrmacro.h +++ b/src/engine/hdrmacro.h @@ -12,6 +12,7 @@ #ifndef HDRMACRO_SW20111118_H #define HDRMACRO_SW20111118_H +#include "config.h" #include "object.h" #include "rules.h" diff --git a/src/engine/headers.h b/src/engine/headers.h index 1c0a642df..a875c2d87 100644 --- a/src/engine/headers.h +++ b/src/engine/headers.h @@ -11,6 +11,7 @@ #ifndef HEADERS_SW20111118_H #define HEADERS_SW20111118_H +#include "config.h" #include "object.h" #include "rules.h" #include "regexp.h" diff --git a/src/engine/jam.h b/src/engine/jam.h index a6abf4109..e4de552d9 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -18,6 +18,8 @@ #ifndef JAM_H_VP_2003_08_01 #define JAM_H_VP_2003_08_01 +#include "config.h" + #ifdef HAVE_PYTHON #include #endif diff --git a/src/engine/lists.h b/src/engine/lists.h index 3dd8fe873..7ddb668a4 100644 --- a/src/engine/lists.h +++ b/src/engine/lists.h @@ -41,6 +41,7 @@ #ifndef LISTS_DWA20011022_H #define LISTS_DWA20011022_H +#include "config.h" #include "object.h" #ifdef HAVE_PYTHON diff --git a/src/engine/make.h b/src/engine/make.h index 2c3ba1678..537b9e98f 100644 --- a/src/engine/make.h +++ b/src/engine/make.h @@ -11,6 +11,7 @@ #ifndef MAKE_SW20111118_H #define MAKE_SW20111118_H +#include "config.h" #include "lists.h" #include "object.h" #include "rules.h" diff --git a/src/engine/mem.h b/src/engine/mem.h index df328447b..076808504 100644 --- a/src/engine/mem.h +++ b/src/engine/mem.h @@ -8,6 +8,8 @@ #ifndef BJAM_MEM_H #define BJAM_MEM_H +#include "config.h" + /* Standard C memory allocation. */ #include diff --git a/src/engine/modules.h b/src/engine/modules.h index 1b161c6e5..acad633bf 100644 --- a/src/engine/modules.h +++ b/src/engine/modules.h @@ -6,6 +6,7 @@ #ifndef MODULES_DWA10182001_H #define MODULES_DWA10182001_H +#include "config.h" #include "lists.h" #include "object.h" diff --git a/src/engine/native.h b/src/engine/native.h index 6d38d01e0..8df44cbbe 100644 --- a/src/engine/native.h +++ b/src/engine/native.h @@ -7,6 +7,7 @@ #ifndef NATIVE_H_VP_2003_12_09 #define NATIVE_H_VP_2003_12_09 +#include "config.h" #include "function.h" #include "frames.h" #include "lists.h" diff --git a/src/engine/object.h b/src/engine/object.h index cabb9f6f2..03fc0692b 100644 --- a/src/engine/object.h +++ b/src/engine/object.h @@ -11,6 +11,8 @@ #ifndef BOOST_JAM_OBJECT_H #define BOOST_JAM_OBJECT_H +#include "config.h" + typedef struct _object OBJECT; OBJECT * object_new( char const * const ); diff --git a/src/engine/option.h b/src/engine/option.h index 2e1179ad4..df3063105 100644 --- a/src/engine/option.h +++ b/src/engine/option.h @@ -11,6 +11,8 @@ * \ -) "Command line option." */ +#include "config.h" + typedef struct bjam_option { char flag; /* filled in by getoption() */ diff --git a/src/engine/output.h b/src/engine/output.h index b6a98ff79..a85edaaf2 100644 --- a/src/engine/output.h +++ b/src/engine/output.h @@ -7,6 +7,7 @@ #ifndef BJAM_OUTPUT_H #define BJAM_OUTPUT_H +#include "config.h" #include "object.h" #include "timestamp.h" diff --git a/src/engine/parse.h b/src/engine/parse.h index 689d78e8c..7dc2e660d 100644 --- a/src/engine/parse.h +++ b/src/engine/parse.h @@ -17,6 +17,7 @@ #ifndef PARSE_DWA20011020_H #define PARSE_DWA20011020_H +#include "config.h" #include "frames.h" #include "lists.h" #include "modules.h" diff --git a/src/engine/pathsys.h b/src/engine/pathsys.h index 9a99680b4..6c84396d1 100644 --- a/src/engine/pathsys.h +++ b/src/engine/pathsys.h @@ -21,6 +21,7 @@ #ifndef PATHSYS_VP_20020211_H #define PATHSYS_VP_20020211_H +#include "config.h" #include "object.h" #include "strings.h" diff --git a/src/engine/regexp.h b/src/engine/regexp.h index 6898ccdce..3a52ba3d6 100644 --- a/src/engine/regexp.h +++ b/src/engine/regexp.h @@ -7,6 +7,8 @@ #ifndef REGEXP_DWA20011023_H #define REGEXP_DWA20011023_H +#include "config.h" + #define NSUBEXP 10 typedef struct regexp { char const * startp[ NSUBEXP ]; diff --git a/src/engine/rules.h b/src/engine/rules.h index d118b3149..29889511e 100644 --- a/src/engine/rules.h +++ b/src/engine/rules.h @@ -29,6 +29,7 @@ #ifndef RULES_DWA_20011020_H #define RULES_DWA_20011020_H +#include "config.h" #include "function.h" #include "modules.h" #include "timestamp.h" diff --git a/src/engine/scan.h b/src/engine/scan.h index 2d4ca283d..2ad736ad6 100644 --- a/src/engine/scan.h +++ b/src/engine/scan.h @@ -22,6 +22,7 @@ * lists without quoting. */ +#include "config.h" #include "lists.h" #include "object.h" #include "parse.h" diff --git a/src/engine/search.h b/src/engine/search.h index 7e74f7972..80d69fa79 100644 --- a/src/engine/search.h +++ b/src/engine/search.h @@ -11,6 +11,7 @@ #ifndef SEARCH_SW20111118_H #define SEARCH_SW20111118_H +#include "config.h" #include "object.h" #include "timestamp.h" diff --git a/src/engine/strings.h b/src/engine/strings.h index 81a40cc90..86cd1904b 100644 --- a/src/engine/strings.h +++ b/src/engine/strings.h @@ -8,6 +8,7 @@ #ifndef STRINGS_DWA20011024_H #define STRINGS_DWA20011024_H +#include "config.h" #include typedef struct string diff --git a/src/engine/subst.h b/src/engine/subst.h index 7dc09a614..6e43aa024 100644 --- a/src/engine/subst.h +++ b/src/engine/subst.h @@ -6,6 +6,7 @@ #ifndef SUBST_JG20120722_H #define SUBST_JG20120722_H +#include "config.h" #include "object.h" #include "regexp.h" diff --git a/src/engine/timestamp.h b/src/engine/timestamp.h index e9b41753c..2a05d2b1c 100644 --- a/src/engine/timestamp.h +++ b/src/engine/timestamp.h @@ -11,6 +11,7 @@ #ifndef TIMESTAMP_H_SW_2011_11_18 #define TIMESTAMP_H_SW_2011_11_18 +#include "config.h" #include "object.h" #ifdef OS_NT diff --git a/src/engine/variable.h b/src/engine/variable.h index f98b3a907..948ac3432 100644 --- a/src/engine/variable.h +++ b/src/engine/variable.h @@ -11,6 +11,7 @@ #ifndef VARIABLE_SW20111119_H #define VARIABLE_SW20111119_H +#include "config.h" #include "lists.h" #include "object.h"