[cogl/cogl-1.18] Build and install cogl-path as a shared library



commit 52a69bb9ab0865d468932077d76cc3e3634c52bb
Author: Robert Bragg <robert linux intel com>
Date:   Wed Nov 27 21:02:03 2013 +0000

    Build and install cogl-path as a shared library
    
    Since we now have more time to ensure that Clutter is updated to check
    for the now separate cogl-path package as part of its build
    configuration we are now making the package split, in line with Cogl
    master.
    
    Reviewed-by: Neil Roberts <neil linux intel com>

 Makefile.am                                |    7 ++-----
 cogl-path/Makefile.am                      |   21 +++++++++++++++++++--
 cogl-path/cogl-path-2.0-experimental.pc.in |   13 +++++++++++++
 cogl-path/cogl-path.h                      |    4 ++++
 cogl-path/cogl-path.pc.in                  |   13 +++++++++++++
 cogl/Makefile.am                           |   11 +----------
 cogl/cogl.h                                |    9 ++++++++-
 cogl/deprecated/cogl-clip-state.c          |    1 -
 configure.ac                               |    2 ++
 9 files changed, 62 insertions(+), 19 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e24041f..a0c0c76 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,14 +1,11 @@
 SUBDIRS = deps test-fixtures
 
-# Until we can bump the cogl soname cogl-path is built as
-# a noinst_LTLIBRARY and linked into libcogl.so so it needs
-# to be built before cogl...
+SUBDIRS += cogl
+
 if BUILD_COGL_PATH
 SUBDIRS += cogl-path
 endif
 
-SUBDIRS += cogl
-
 if BUILD_COGL_PANGO
 SUBDIRS += cogl-pango
 endif
diff --git a/cogl-path/Makefile.am b/cogl-path/Makefile.am
index 8212a50..ea3ed4c 100644
--- a/cogl-path/Makefile.am
+++ b/cogl-path/Makefile.am
@@ -70,11 +70,19 @@ glib_enum_headers = $(source_1_x_h)
 include $(top_srcdir)/build/autotools/Makefile.am.enums
 endif
 
-noinst_LTLIBRARIES = libcogl-path.la
+lib_LTLIBRARIES = libcogl-path.la
 
 libcogl_path_la_SOURCES = $(source_c) $(source_h)
 nodist_libcogl_path_la_SOURCES = $(BUILT_SOURCES)
-libcogl_path_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_GST_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
+libcogl_path_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
+libcogl_path_la_LIBADD = $(top_builddir)/cogl/libcogl.la
+libcogl_path_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
+libcogl_path_la_LDFLAGS = \
+       -export-dynamic \
+       -export-symbols-regex "^(cogl|cogl2)_(framebuffer|path|is)_.*" \
+       -no-undefined \
+       -version-info @COGL_LT_CURRENT@:@COGL_LT_REVISION@:@COGL_LT_AGE@ \
+       -rpath $(libdir)
 
 AM_CPPFLAGS = \
        -DCOGL_COMPILATION              \
@@ -92,6 +100,15 @@ if USE_GLIB
 nodist_cogl_pathheaders_HEADERS = cogl-path-enum-types.h
 endif
 
+pc_files = cogl-path-1.0.pc \
+          cogl-path-2.0-experimental.pc
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(pc_files)
+
+EXTRA_DIST += cogl-path.pc.in
+DISTCLEANFILES += $(pc_files)
+
 dist-hook:     \
        $(top_builddir)/build/win32/vs9/cogl-path.vcproj        \
        $(top_builddir)/build/win32/vs10/cogl-path.vcxproj      \
diff --git a/cogl-path/cogl-path-2.0-experimental.pc.in b/cogl-path/cogl-path-2.0-experimental.pc.in
new file mode 100644
index 0000000..9cb7c97
--- /dev/null
+++ b/cogl-path/cogl-path-2.0-experimental.pc.in
@@ -0,0 +1,13 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+apiversion=1.0
+requires= COGL_PKG_REQUIRES@ cogl-1.0
+
+Name: Cogl
+Description: A 2D path drawing library for Cogl
+Version: @COGL_1_VERSION@
+Libs: -L${libdir} -lcogl-path
+Cflags: -I${includedir}/cogl
+Requires: ${requires}
diff --git a/cogl-path/cogl-path.h b/cogl-path/cogl-path.h
index 2e76080..3bc834f 100644
--- a/cogl-path/cogl-path.h
+++ b/cogl-path/cogl-path.h
@@ -44,7 +44,11 @@
  * rather then in the absolute coordinates.
  */
 
+#include <cogl/cogl-defines.h>
+
+#ifdef COGL_HAS_GTYPE_SUPPORT
 #include <cogl-path/cogl-path-enum-types.h>
+#endif
 
 #include <cogl-path/cogl-path-types.h>
 
diff --git a/cogl-path/cogl-path.pc.in b/cogl-path/cogl-path.pc.in
new file mode 100644
index 0000000..d8b3beb
--- /dev/null
+++ b/cogl-path/cogl-path.pc.in
@@ -0,0 +1,13 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+apiversion= COGL_API_VERSION@
+requires= COGL_PKG_REQUIRES@
+
+Name: Cogl
+Description: A 2D path drawing library for Cogl
+Version: @COGL_VERSION@
+Libs: -L${libdir} -lcogl-path
+Cflags: -I${includedir}/cogl
+Requires: ${requires}
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 6ac1284..b428180 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -531,9 +531,6 @@ endif
 if UNIT_TESTS
 libcogl_la_LIBADD += $(top_builddir)/test-fixtures/libtest-fixtures.la
 endif
-if BUILD_COGL_PATH
-libcogl_la_LIBADD += $(top_builddir)/cogl-path/libcogl-path.la
-endif
 # XXX: The aim is to eventually get rid of all private API exports
 # for cogl-pango.
 libcogl_la_LDFLAGS = \
@@ -664,13 +661,7 @@ if UNIT_TESTS
 Cogl_1_0_gir_LIBS += $(top_builddir)/test-fixtures/libtest-fixtures.la
 endif
 Cogl_1_0_gir_FILES = $(cogl_1_public_h) cogl-enum-types.h
-if BUILD_COGL_PATH
-Cogl_1_0_gir_FILES += \
-       $(top_builddir)/cogl-path/cogl-path-enum-types.h \
-       $(top_srcdir)/cogl-path/cogl-path-types.h \
-       $(top_srcdir)/cogl-path/cogl1-path-functions.h
-endif
-Cogl_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_ENABLE_EXPERIMENTAL_API 
-UCOGL_ENABLE_EXPERIMENTAL_2_0_API -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__
+Cogl_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_ENABLE_EXPERIMENTAL_API 
-UCOGL_ENABLE_EXPERIMENTAL_2_0_API -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__ 
-DCOGL_GIR_SCANNING
 Cogl_1_0_gir_INCLUDES = GL-1.0 GObject-2.0
 Cogl_1_0_gir_EXPORT_PACKAGES = cogl-1.0
 Cogl_1_0_gir_SCANNERFLAGS = --warn-all --c-include='cogl/cogl.h'
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 9d7c03e..6299b91 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -149,8 +149,15 @@
  *
  * The cogl_path_ api used to be part of the core Cogl api so for
  * compatability we include cogl-path.h via cogl.h
+ *
+ * Note: we have to make sure not to include cogl-path.h while
+ * building core cogl or generating the Cogl .gir data because
+ * cogl-path now gets built after cogl and some cogl-path headers are
+ * only generated at build time...
  */
-#if defined (COGL_HAS_COGL_PATH_SUPPORT)
+#if defined (COGL_HAS_COGL_PATH_SUPPORT) && \
+  !defined (COGL_COMPILATION) && \
+  !defined (COGL_GIR_SCANNING)
 #include <cogl-path/cogl-path.h>
 #endif
 
diff --git a/cogl/deprecated/cogl-clip-state.c b/cogl/deprecated/cogl-clip-state.c
index 7beee46..a1a50b0 100644
--- a/cogl/deprecated/cogl-clip-state.c
+++ b/cogl/deprecated/cogl-clip-state.c
@@ -38,7 +38,6 @@
 #include "cogl-util.h"
 #include "cogl-matrix-private.h"
 #include "cogl1-context.h"
-#include "cogl-path/cogl-path.h"
 
 void
 cogl_clip_push_window_rectangle (int x_offset,
diff --git a/configure.ac b/configure.ac
index 44b4a27..10782d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1470,6 +1470,8 @@ cogl-pango/cogl-pango-1.0.pc
 cogl-pango/cogl-pango-2.0-experimental.pc
 cogl-pango/cogl-pango.rc
 cogl-path/Makefile
+cogl-path/cogl-path-1.0.pc
+cogl-path/cogl-path-2.0-experimental.pc
 cogl-gst/Makefile
 cogl-gst/cogl-gst.pc
 cogl-gles2/Makefile


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]