summaryrefslogtreecommitdiff
path: root/config_host
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
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')
-rw-r--r--config_host/.gitignore1
-rw-r--r--config_host/README24
-rw-r--r--config_host/config_clang.h.in19
-rw-r--r--config_host/config_global.h.in22
-rw-r--r--config_host/config_graphite.h.in6
-rw-r--r--config_host/config_telepathy.h.in6
-rw-r--r--config_host/config_vclplug.h.in15
-rw-r--r--config_host/config_version.h.in26
8 files changed, 119 insertions, 0 deletions
diff --git a/config_host/.gitignore b/config_host/.gitignore
new file mode 100644
index 000000000000..9becb5b61647
--- /dev/null
+++ b/config_host/.gitignore
@@ -0,0 +1 @@
+config_*.h
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
diff --git a/config_host/config_clang.h.in b/config_host/config_clang.h.in
new file mode 100644
index 000000000000..056d3e80832a
--- /dev/null
+++ b/config_host/config_clang.h.in
@@ -0,0 +1,19 @@
+/*
+
+Settings related to Clang compiler plugins.
+
+*/
+
+#ifndef CONFIG_CLANG_H
+#define CONFIG_CLANG_H
+
+#undef BUILDDIR
+#undef OUTDIR
+#undef SRCDIR
+#undef WORKDIR
+
+/* This is actually unused, but it should change whenever Clang changes,
+thus causing update of this .h file and triggerring rebuild of our Clang plugin. */
+#undef CLANG_FULL_VERSION
+
+#endif
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
new file mode 100644
index 000000000000..0f85b59c3785
--- /dev/null
+++ b/config_host/config_global.h.in
@@ -0,0 +1,22 @@
+/*
+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.
+
+*/
+
+#ifndef CONFIG_GLOBAL_H
+#define CONFIG_GLOBAL_H
+
+#undef HAVE_CXX11_DELETE
+#undef HAVE_CXX11_OVERRIDE
+#undef HAVE_GCC_BUILTIN_ATOMIC
+#undef HAVE_SFINAE_ANONYMOUS_BROKEN
+#undef HAVE_THREADSAFE_STATICS
+#undef HAVE_SYSLOG_H
+
+#endif
diff --git a/config_host/config_graphite.h.in b/config_host/config_graphite.h.in
new file mode 100644
index 000000000000..eb7a7b3400f7
--- /dev/null
+++ b/config_host/config_graphite.h.in
@@ -0,0 +1,6 @@
+#ifndef CONFIG_GRAPHITE_H
+#define CONFIG_GRAPHITE_H
+
+#undef ENABLE_GRAPHITE
+
+#endif
diff --git a/config_host/config_telepathy.h.in b/config_host/config_telepathy.h.in
new file mode 100644
index 000000000000..f8752b5f5336
--- /dev/null
+++ b/config_host/config_telepathy.h.in
@@ -0,0 +1,6 @@
+#ifndef CONFIG_TELEPATHY
+#define CONFIG_TELEPATHY
+
+#undef ENABLE_TELEPATHY
+
+#endif
diff --git a/config_host/config_vclplug.h.in b/config_host/config_vclplug.h.in
new file mode 100644
index 000000000000..46c6bd1aea77
--- /dev/null
+++ b/config_host/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
diff --git a/config_host/config_version.h.in b/config_host/config_version.h.in
new file mode 100644
index 000000000000..736c578afc8c
--- /dev/null
+++ b/config_host/config_version.h.in
@@ -0,0 +1,26 @@
+/*
+Version settings
+ version 4.0.0.1 is Major.Minor.Micro.Patch
+*/
+
+#ifndef CONFIG_VERSION_H
+#define CONFIG_VERSION_H
+
+#define LIBO_VERSION_STRINGIFY_inner(s) #s
+#define LIBO_VERSION_STRINGIFY(s) LIBO_VERSION_STRINGIFY_inner(s)
+
+#undef LIBO_VERSION_MAJOR
+#undef LIBO_VERSION_MINOR
+#undef LIBO_VERSION_MICRO
+#undef LIBO_VERSION_PATCH
+
+#define LIBO_VERSION_DOTTED \
+ (LIBO_VERSION_STRINGIFY(LIBO_VERSION_MAJOR) "." \
+ LIBO_VERSION_STRINGIFY(LIBO_VERSION_MINOR) "." \
+ LIBO_VERSION_STRINGIFY(LIBO_VERSION_MICRO) "." \
+ LIBO_VERSION_STRINGIFY(LIBO_VERSION_PATCH))
+
+#define LIBO_VERSION_ENCODED_IN_32BITS \
+ ((LIBO_VERSION_MAJOR << 24) | (LIBO_VERSION_MINOR << 16) | (LIBO_VERSION_MICRO << 8) | LIBO_VERSION_PATCH)
+
+#endif