[cairo-commit] 3 commits - boilerplate/Makefile.am boilerplate/Makefile.sources src/cairo-qt.h src/Makefile.am

Benjamin Otte company at kemper.freedesktop.org
Sun Jul 11 09:54:05 PDT 2010


 boilerplate/Makefile.am      |   31 ++++++++++++++++++++++++-------
 boilerplate/Makefile.sources |    7 ++-----
 src/Makefile.am              |    2 +-
 src/cairo-qt.h               |   12 ++++--------
 4 files changed, 31 insertions(+), 21 deletions(-)

New commits:
commit 120b78ada7eed6424f07a688854657d0c3ad68f8
Author: Benjamin Otte <otte at redhat.com>
Date:   Sun Jul 11 18:48:38 2010 +0200

    build: Split boilerplate lib generation into two so's
    
    Same thing as what was previously done for libcairo.so: Build an
    intermediate lib for the (potential) C++ stuff.

diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 547f415..82aa80f 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -14,7 +14,14 @@ AM_CPPFLAGS = \
 	$(NULL)
 AM_LDFLAGS = $(CAIRO_LDFLAGS)
 
-EXTRA_LTLIBRARIES += libcairoboilerplate.la
+if BUILD_CXX
+cxx_boilerplate_lib = libcairoboilerplate_cxx.la
+else
+cxx_boilerplate_lib =
+endif
+
+EXTRA_LTLIBRARIES += libcairoboilerplate.la $(cxx_boilerplate_lib)
+
 
 libcairoboilerplate_la_SOURCES = \
 	$(enabled_cairo_boilerplate_headers) \
@@ -22,24 +29,34 @@ libcairoboilerplate_la_SOURCES = \
 	$(enabled_cairo_boilerplate_sources) \
 	cairo-boilerplate-constructors.c \
 	$(NULL)
-libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la
+libcairoboilerplate_cxx_la_SOURCES = \
+	$(enabled_cairo_boilerplate_cxx_sources) \
+	$(NULL)
+libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la \
+	$(cxx_boilerplate_lib) \
+	$(CAIRO_LIBS) \
+	$(CAIROBOILERPLATE_LIBS) \
+	$(NULL)
+libcairoboilerplate_cxx_la_LIBADD = $(top_builddir)/src/libcairo.la \
+	$(CAIRO_LIBS) \
+	$(CAIROBOILERPLATE_LIBS) \
+	$(NULL)
+
 if CAIRO_HAS_DL
 libcairoboilerplate_la_LIBADD += -ldl
 endif
 
 if CAIRO_HAS_BEOS_SURFACE
 # BeOS system headers trigger this warning
-AM_CPPFLAGS += -Wno-multichar
+libcairoboilerplate_cxx_la_CXXFLAGS = -Wno-multichar
 endif
 
 if CAIRO_HAS_WIN32_SURFACE
 libcairoboilerplate_la_LIBADD += -lwinspool
 endif
 
-libcairoboilerplate_la_LIBADD += $(CAIROBOILERPLATE_LIBS)
-
-cairo-boilerplate-constructors.c: Makefile $(enabled_cairo_boilerplate_sources) make-cairo-boilerplate-constructors.sh
-	(cd $(srcdir) && sh ./make-cairo-boilerplate-constructors.sh $(enabled_cairo_boilerplate_sources)) > $@
+cairo-boilerplate-constructors.c: Makefile $(enabled_cairo_boilerplate_sources) $(enabled_cairo_boilerplate_cxx_sources) make-cairo-boilerplate-constructors.sh
+	(cd $(srcdir) && sh ./make-cairo-boilerplate-constructors.sh $(enabled_cairo_boilerplate_sources) $(enabled_cairo_boilerplate_cxx_sources)) > $@
 
 BUILT_SOURCES += cairo-boilerplate-constructors.c
 EXTRA_DIST += $(BUILT_SOURCES) make-cairo-boilerplate-constructors.sh
diff --git a/boilerplate/Makefile.sources b/boilerplate/Makefile.sources
index d247510..63ef34e 100644
--- a/boilerplate/Makefile.sources
+++ b/boilerplate/Makefile.sources
@@ -19,10 +19,7 @@ cairo_boilerplate_private = \
 	cairo-boilerplate-private.h \
 	$(NULL)
 
-# automake is stupid enough to always use c++ linker if we enable the
-# following lines, even if beos surface is not enabled.  Disable it for now.
-#libcairoboilerplate_la_SOURCES += cairo-boilerplate-beos.cpp
-
+cairo_boilerplate_beos_cxx_sources = cairo-boilerplate-beos.cpp
 cairo_boilerplate_directfb_sources = cairo-boilerplate-directfb.c
 cairo_boilerplate_drm_sources = cairo-boilerplate-drm.c
 cairo_boilerplate_glx_sources = cairo-boilerplate-glx.c
@@ -30,7 +27,7 @@ cairo_boilerplate_wgl_sources = cairo-boilerplate-wgl.c
 cairo_boilerplate_egl_sources = cairo-boilerplate-egl.c
 cairo_boilerplate_pdf_sources = cairo-boilerplate-pdf.c
 cairo_boilerplate_ps_sources = cairo-boilerplate-ps.c
-cairo_boilerplate_qt_sources = cairo-boilerplate-qt.cpp
+cairo_boilerplate_qt_cxx_sources = cairo-boilerplate-qt.cpp
 cairo_boilerplate_quartz_sources = cairo-boilerplate-quartz.c
 cairo_boilerplate_script_sources = cairo-boilerplate-script.c
 cairo_boilerplate_skia_sources = cairo-boilerplate-skia.c
commit d6362a0d76753cb6f85f0dbd567a3ec7b7b08696
Author: Benjamin Otte <otte at redhat.com>
Date:   Sun Jul 11 16:01:44 2010 +0200

    qt: Define cairo-qt's API as C symbols
    
    That way, the C linker doesn't mess up when linking libcairo.so.

diff --git a/src/cairo-qt.h b/src/cairo-qt.h
index ec26b04..c20bbb1 100644
--- a/src/cairo-qt.h
+++ b/src/cairo-qt.h
@@ -41,10 +41,10 @@
 
 #if CAIRO_HAS_QT_SURFACE
 
-#if defined(__cplusplus)
+#include <QtGui/QImage>
+#include <QtGui/QPainter>
 
-class QPainter;
-class QImage;
+CAIRO_BEGIN_DECLS
 
 cairo_public cairo_surface_t *
 cairo_qt_surface_create (QPainter *painter);
@@ -74,11 +74,7 @@ cairo_qt_surface_get_image (cairo_surface_t *surface);
 cairo_public QImage *
 cairo_qt_surface_get_qimage (cairo_surface_t *surface);
 
-#else /* ! __cplusplus */
-
-# warning cairo-qt only exports a C++ interface
-
-#endif /* __cplusplus */
+CAIRO_END_DECLS
 
 #else /* CAIRO_HAS_QT_SURFACE */
 
commit 5d4a4775c8b091b947b52cc8f7e1e48a5eaea007
Author: Benjamin Otte <otte at redhat.com>
Date:   Sun Jul 11 15:41:56 2010 +0200

    build: Fix typo that makes C++ libs not build

diff --git a/src/Makefile.am b/src/Makefile.am
index 357e217..30a942d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,7 +48,7 @@ libcairo_la_SOURCES = \
 	$(NULL)
 libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
 libcairo_la_LIBADD = $(CAIRO_LIBS) \
-	$(enabled_cairo_cxx_lib)
+	$(cairo_cxx_lib)
 libcairo_la_DEPENDENCIES = $(cairo_def_dependency)
 
 # Special headers


More information about the cairo-commit mailing list