summaryrefslogtreecommitdiff
path: root/config_host/README
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-01-31 20:44:25 +0200
committerTor Lillqvist <tml@iki.fi>2013-01-31 21:43:59 +0200
commitc5b1441ede3c58f1fe92372cbb48864f9d4df6ec (patch)
treec86b771e67121fe3ff1711f403bd633c02e93ec4 /config_host/README
parent0e63a97066a817f3d01b40d99e3e1ed831ae3598 (diff)
Use separate config_*.h files for BUILD and HOST when cross-compiling
We have only been lucky so far that there hasn't been any compilation errors caused by using the HOST platform config_*.h files also for the BUILD platform. But as more and more information found out during configury is stored in config_*.h files, sooner or later it will be a problem. Move config/* to config_host/*. When not cross-compiling, the config_*.h files in config_host expanded from config_*.h.in are all there is. When cross-compiling, the generated config_*.h files for the BUILD platform are put into a config_build folder. Then use config_build when building the cross_toolset and config_host otherwise. Change-Id: I3c28cc83866bffd696b45d00dfb68e00bc2ae538
Diffstat (limited to 'config_host/README')
-rw-r--r--config_host/README24
1 files changed, 24 insertions, 0 deletions
diff --git a/config_host/README b/config_host/README
new file mode 100644
index 000000000000..fd58b64045bb
--- /dev/null
+++ b/config_host/README
@@ -0,0 +1,24 @@
+These are configuration files for various features as detected by configure.
+
+Include only those files you need (in order to reduce rebuilds when a setting changes).
+
+Settings here are only C/C++ #define directives, so they apply only to C/C++ source,
+not to Makefiles.
+
+
+
+Adding a new setting:
+=====================
+
+- do AC_DEFINE(HAVE_FOO) in configure.ac when a setting should be set
+- choose the proper config/config_xxx.h file to use
+ - if it is a global setting (such as availability of a compiler feature),
+ use config/config_global.h
+ - otherwise check if there is a matching config/config_hxx.h file
+ - if none matches, add a new one:
+ - add config/config_xxx.h.in here, with just #ifndef include guard
+ - add AC_CONFIG_HEADERS([config/config_xxx.h]) next to the others
+ in configure.ac
+ - add config_hxx.h to config/.gitignore
+- add #undef HAVE_FOO to the config/config_hxx.h , possibly with a comment
+- add #include <config_xxx.h> before any #ifdef HAVE_XXX in a source file