path: root/
diff options
authorBenjamin Otte <>2010-07-09 12:29:35 +0200
committerBenjamin Otte <>2010-07-09 12:38:37 +0200
commitf7fc8569a797356d5e93ad67aae4eca31e6835cd (patch)
tree21ceb22b081dfb45f9e533ccdf861d60fe1a6251 /
parentdf6d49f6eaf334d5a2de8bdd90919278071ab868 (diff)
build: Fix C++ issues with automake
This is an attempt to fix the broken situation we've been in where automake links with c++ because it might potentially maybe include C++ files. Those potential files only exist in Chris' throwaway backends (skia, qt) and the BeOS backend, so for 99.99% of cases, these backends are not needed and linking with c++ is overkill. Also, no one wants to have link to libstdc++. This patch fixes that in mutliple steps: 1) Add build infrastructure to distinguish between C and C++ backends. This is done by allowing to specify backend_sources as well as backend_cxx_sources variables in Makefile.sources. 2) Optionally build a noinst library This intermediate library is built for C++ backends only and therefor linked using c++. It is then linked into the final This does not require c++, so the linking of is done with cc. This also works around various weirdnesses that the current build system exposes, where it assumes cisms when in fact using c++ semantics, like not detecting c++ properly or:
Diffstat (limited to '')
1 files changed, 10 insertions, 0 deletions
diff --git a/ b/
index 8d2c00731..cb32d7c98 100644
--- a/
+++ b/
@@ -777,6 +777,16 @@ fi
dnl ===========================================================================
+dnl Extra stuff we need to do when building C++ code
+AS_IF([test "x$use_skia" = "xyes"], [need_cxx="yes"])
+AS_IF([test "x$use_qt" = "xyes"], [need_cxx="yes"])
+AS_IF([test "x$use_beos" = "xyes"], [need_cxx="yes"])
+AM_CONDITIONAL(BUILD_CXX, test "x$need_cxx" = "xyes")
+dnl ===========================================================================
# We use GTK+ for some utility/debugging tools
PKG_CHECK_MODULES(gtk, "gtk+-2.0",have_gtk=yes, have_gtk=no)
AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")