diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-12-07 17:51:21 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-12-07 19:48:16 +0100 |
commit | 1aad4689babec28f47b99666b303ab8bfffc3106 (patch) | |
tree | 04e82f39d983dfedfdbf25331380456187e096e7 /config | |
parent | e56c274f815a9b0cc55489537fad8c59273d2c94 (diff) |
use config_xxx.h files instead of -DHAVE_XXX on the command line
As the latter does not quite scale, and also source files depending
on the setting/feature did not rebuild in case of a change.
There are intentionally more config_xxx.h files (so autoheader
from autotools is not used), so that a setting change does not force
automatically a rebuild of everything. Running configure does not
touch those config_xxx.h files that have not changed.
There's config/README with a howto.
Change-Id: I6d6e82050ff8faf5364ed246848b8401aca3e0e5
Diffstat (limited to 'config')
-rw-r--r-- | config/.gitignore | 3 | ||||
-rw-r--r-- | config/README | 24 | ||||
-rw-r--r-- | config/config_global.h.in | 14 | ||||
-rw-r--r-- | config/config_telepathy.h.in | 6 | ||||
-rw-r--r-- | config/config_vclplug.h.in | 15 |
5 files changed, 62 insertions, 0 deletions
diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 000000000000..325a7fd030e4 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1,3 @@ +config_global.h +config_vclplug.h +config_telepathy.h diff --git a/config/README b/config/README new file mode 100644 index 000000000000..fd58b64045bb --- /dev/null +++ b/config/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 diff --git a/config/config_global.h.in b/config/config_global.h.in new file mode 100644 index 000000000000..a9eb54f68c34 --- /dev/null +++ b/config/config_global.h.in @@ -0,0 +1,14 @@ +/* +Global configuration file. + +Only for settings that apply to every source file and are unlikely to change often, +such as whether a certain C++11 feature is available. + +Do NOT use for settings local to some code or for settings that can change often. +Any change in this header will cause a rebuild of almost everything. + +*/ + +#undef HAVE_GCC_BUILTIN_ATOMIC +#undef HAVE_SFINAE_ANONYMOUS_BROKEN +#undef HAVE_THREADSAFE_STATICS diff --git a/config/config_telepathy.h.in b/config/config_telepathy.h.in new file mode 100644 index 000000000000..f8752b5f5336 --- /dev/null +++ b/config/config_telepathy.h.in @@ -0,0 +1,6 @@ +#ifndef CONFIG_TELEPATHY +#define CONFIG_TELEPATHY + +#undef ENABLE_TELEPATHY + +#endif diff --git a/config/config_vclplug.h.in b/config/config_vclplug.h.in new file mode 100644 index 000000000000..46c6bd1aea77 --- /dev/null +++ b/config/config_vclplug.h.in @@ -0,0 +1,15 @@ +/* + +Settings about which X11 desktops have support enabled. + +*/ + +#ifndef CONFIG_VCLPLUG_H +#define CONFIG_VCLPLUG_H + +#undef ENABLE_GTK +#undef ENABLE_KDE +#undef ENABLE_KDE4 +#undef ENABLE_TDE + +#endif |