cairo/src/Makefile.am.analysis
Benjamin Otte f7fc8569a7 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
2010-07-09 12:38:37 +02:00

32 lines
1.2 KiB
Text

SPARSE = sparse
sparse:
@echo Checking enabled sources with sparse checker
@status=true; for f in $(enabled_cairo_sources) $(enabled_cairo_cxx_sources); do \
echo $(SPARSE) $(PREPROCESS_ARGS) $(srcdir)/$$f; \
$(SPARSE) $(PREPROCESS_ARGS) $(srcdir)/$$f || status=false; \
done; $$status
SPLINT = splint -badflag
splint:
@echo Checking enabled sources with splint checker
@status=true; for f in $(enabled_cairo_sources) $(enabled_cairo_cxx_sources); do \
echo $(SPLINT) $(PREPROCESS_ARGS) $(srcdir)/$$f; \
$(SPLINT) $(PREPROCESS_ARGS) $(srcdir)/$$f || status=false; \
done; $$status
UNO = uno
uno:
@echo Checking enabled sources with uno checker
cd $(srcdir); $(UNO) $(PREPROCESS_ARGS) -DHAVE_CONFIG_H -U__GNUC__ $(enabled_cairo_sources)
headers-standalone: $(enabled_cairo_headers) $(enabled_cairo_private)
@echo Checking that enabled public/private headers can be compiled standalone
@status=true; for f in $(enabled_cairo_headers) $(enabled_cairo_private); do \
echo " CHECK $$f"; \
$(COMPILE) -o /dev/null $(srcdir)/$$f || status=false; \
done; $$status
@touch $@
CLEANFILES += headers-standalone
analysis: all headers-standalone sparse splint uno