From f7fc8569a797356d5e93ad67aae4eca31e6835cd Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 9 Jul 2010 12:29:35 +0200 Subject: 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 --- build/configure.ac.features | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'build') 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 -- cgit v1.2.3