summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-07-09 12:29:35 +0200
committerBenjamin Otte <otte@redhat.com>2010-07-09 12:38:37 +0200
commitf7fc8569a797356d5e93ad67aae4eca31e6835cd (patch)
tree21ceb22b081dfb45f9e533ccdf861d60fe1a6251 /build
parentdf6d49f6eaf334d5a2de8bdd90919278071ab868 (diff)
build: Fix C++ issues with automake
This is an attempt to fix the broken situation we've been in where automake links libcairo.la 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 libcairo.so 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 libcairo_cxx.la noinst library This intermediate library is built for C++ backends only and therefor linked using c++. It is then linked into the final libcairo.la. This does not require c++, so the linking of libcairo.la 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: https://bugzilla.redhat.com/show_bug.cgi?id=606523
Diffstat (limited to 'build')
-rw-r--r--build/configure.ac.features7
1 files changed, 6 insertions, 1 deletions
diff --git a/build/configure.ac.features b/build/configure.ac.features
index 203d2bf3..d349a844 100644
--- a/build/configure.ac.features
+++ b/build/configure.ac.features
@@ -83,15 +83,16 @@ CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,no,!,
dnl Collect list of source files for all public features
CAIRO_MAKEFILE_ACCUMULATE(*,
[dnl
-all_$1_files = $(all_$1_headers) $(all_$1_private) $(all_$1_sources)
all_$1_headers = $($1_headers)
all_$1_private = $($1_private)
+all_$1_cxx_sources = $($1_cxx_sources)
all_$1_sources = $($1_sources)
])dnl
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,!,
[dnl
all_$1_headers += $($1_$2_headers)
all_$1_private += $($1_$2_private)
+all_$1_cxx_sources += $($1_$2_cxx_sources)
all_$1_sources += $($1_$2_sources)]dnl
)dnl
@@ -100,12 +101,14 @@ CAIRO_MAKEFILE_ACCUMULATE(*,
[dnl
enabled_$1_headers = $($1_headers)
enabled_$1_private = $($1_private)
+enabled_$1_cxx_sources = $($1_cxx_sources)
enabled_$1_sources = $($1_sources)
])dnl
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,yes,*,!,
[dnl
enabled_$1_headers += $($1_$2_headers)
enabled_$1_private += $($1_$2_private)
+enabled_$1_cxx_sources += $($1_$2_cxx_sources)
enabled_$1_sources += $($1_$2_sources)]dnl
)dnl
@@ -115,6 +118,7 @@ dnl Collect list of source files for all private features
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,,
[dnl
all_$1_private += $($1_$2_private) $($1_$2_headers)
+all_$1_cxx_sources += $($1_$2_cxx_sources)
all_$1_sources += $($1_$2_sources)]dnl
)dnl
@@ -122,6 +126,7 @@ dnl Collect list of source files for enabled private features
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,yes,*,,
[dnl
enabled_$1_private += $($1_$2_private) $($1_$2_headers)
+enabled_$1_cxx_sources += $($1_$2_cxx_sources)
enabled_$1_sources += $($1_$2_sources)]dnl
)dnl