From 4a3a3e1cf344b992b2f978e5f2676cb0957b504a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 28 Feb 2009 17:54:27 +0000 Subject: [PATCH] Add pkg-config file for COGL COGL should ship its own pkg-config file, obviously still pointing to Clutter's compiler flags and linking options, for COGL-specific variables that might be queried at configure time. For instance, it's easier (and less verbose) to do: PKG_CHECK_EXISTS([cogl-gl-1.0], [has_gl_backend=yes], [has_gl_backend=no]) Than doing: AC_MSG_CHECKING([for GL support in COGL]) cogl_backend=`$PKG_CONFIG --variable=cogl clutter-0.9` if test x$cogl_backend = xgl; then has_gl_backend=yes AC_MSG_RESULT([found]) else has_gl_backend=no AC_MSG_RESULT([not found]) fi --- .gitignore | 1 + clutter/cogl/Makefile.am | 17 ++++++++++++++++- clutter/cogl/cogl.pc.in | 15 +++++++++++++++ configure.ac | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 clutter/cogl/cogl.pc.in diff --git a/.gitignore b/.gitignore index 0eb228437..c0630e0a7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ clutter/stamp-* /clutter/cogl/cogl-defines-gl.h /clutter/cogl/cogl-defines-gles.h /clutter/cogl/cogl.h +/clutter/cogl/*.pc /clutter/cogl/gles/cogl-fixed-vertex-shader.[ch] /clutter/cogl/gles/cogl-fixed-fragment-shader.[ch] /clutter/*.gir diff --git a/clutter/cogl/Makefile.am b/clutter/cogl/Makefile.am index 443ec907f..da2a04409 100644 --- a/clutter/cogl/Makefile.am +++ b/clutter/cogl/Makefile.am @@ -2,6 +2,21 @@ SUBDIRS = common $(CLUTTER_COGL) BUILT_SOURCES = cogl.h -EXTRA_DIST = cogl.h.in +EXTRA_DIST = cogl.h.in cogl.pc.in DIST_SUBDIRS = common gl gles + +pc_files = \ + cogl-$(CLUTTER_COGL)-$(CLUTTER_API_VERSION).pc \ + cogl-$(CLUTTER_API_VERSION).pc + +cogl-$(CLUTTER_API_VERSION).pc: cogl.pc + $(QUIET_GEN)cp -f $< $(@F) + +cogl-$(CLUTTER_COGL)-$(CLUTTER_API_VERSION).pc: cogl.pc + $(QUIET_GEN)cp -f $< $(@F) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = $(pc_files) + +CLEANFILES = $(pc_files) diff --git a/clutter/cogl/cogl.pc.in b/clutter/cogl/cogl.pc.in new file mode 100644 index 000000000..d69a0a5a1 --- /dev/null +++ b/clutter/cogl/cogl.pc.in @@ -0,0 +1,15 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +apiversion=@CLUTTER_API_VERSION@ +requires=@CLUTTER_REQUIRES@ +backend=@clutterbackend@ +cogl=@CLUTTER_COGL@ + +Name: COGL +Description: Clutter GL abstraction library (${cogl} backend) +Version: @VERSION@ +Libs: -L${libdir} -lclutter-${backend}-${apiversion} +Cflags: -I${includedir}/clutter-${apiversion} +Requires: ${requires} diff --git a/configure.ac b/configure.ac index 4d2c66a64..57b9278d0 100644 --- a/configure.ac +++ b/configure.ac @@ -686,6 +686,7 @@ AC_CONFIG_FILES([ clutter/cogl/cogl.h clutter/cogl/cogl-defines-gl.h:clutter/cogl/gl/cogl-defines.h.in clutter/cogl/cogl-defines-gles.h:clutter/cogl/gles/cogl-defines.h.in + clutter/cogl/cogl.pc clutter/cogl/gl/Makefile clutter/cogl/gles/Makefile clutter/json/Makefile