From 2f2c3fb8392eaf6f570dc713a811bde7e4f34ac9 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 18 Nov 2009 17:35:07 +0000 Subject: [PATCH] build: Make cogl.h not conditional on driver defines The main COGL header cogl.h is currently created at configure time because it conditionally includes the driver-dependent defines. This sometimes leads to a stale cogl.h with old definitions which can break the build until you clean out the whole tree and start from scratch. We can generate a stable cogl-defines.h at build time from the equivalent driver-dependent header and let cogl.h include that file instead. --- cogl/Makefile.am | 18 ++++++++++++------ cogl/{cogl.h.in => cogl.h} | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) rename cogl/{cogl.h.in => cogl.h} (99%) diff --git a/cogl/Makefile.am b/cogl/Makefile.am index 69ce95104..9e757b09d 100644 --- a/cogl/Makefile.am +++ b/cogl/Makefile.am @@ -4,8 +4,8 @@ NULL = SUBDIRS = driver -BUILT_SOURCES = cogl.h -EXTRA_DIST = cogl.h.in cogl.pc.in +BUILT_SOURCES = +EXTRA_DIST = CLEANFILES = DISTCLEANFILES = @@ -23,6 +23,7 @@ cogl-$(COGL_DRIVER)-$(CLUTTER_API_VERSION).pc: cogl.pc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = $(pc_files) +EXTRA_DIST += cogl.pc.in CLEANFILES += $(pc_files) INCLUDES = \ @@ -33,6 +34,12 @@ INCLUDES = \ -I$(top_builddir)/clutter/cogl \ $(NULL) +cogl-defines.h: $(srcdir)/driver/gl/cogl-defines.h $(srcdir)/driver/gles/cogl-defines.h + $(QUIET_GEN)cp -f $(srcdir)/driver/$(COGL_DRIVER)/cogl-defines.h $(@F) + +BUILT_SOURCES += cogl-defines.h +DISTCLEANFILES += cogl-defines.h + # public headers cogl_public_h = \ $(srcdir)/cogl-bitmap.h \ @@ -47,7 +54,7 @@ cogl_public_h = \ $(srcdir)/cogl-texture.h \ $(srcdir)/cogl-types.h \ $(srcdir)/cogl-vertex-buffer.h \ - $(top_builddir)/clutter/cogl/cogl/cogl.h \ + $(srcdir)/cogl.h \ $(NULL) # windowing system; all sources have to be distributed, but we'll @@ -82,6 +89,7 @@ libclutter_cogl_la_LIBADD = -lm $(CLUTTER_LIBS) \ $(top_builddir)/clutter/cogl/cogl/driver/$(COGL_DRIVER)/libclutter-cogl-driver.la libclutter_cogl_la_SOURCES = \ + $(BUILT_SOURCES) \ $(srcdir)/winsys/cogl-winsys.h \ $(srcdir)/winsys/cogl-@COGL_WINSYS@.c \ $(srcdir)/cogl-handle.h \ @@ -127,18 +135,16 @@ libclutter_cogl_la_SOURCES = \ $(srcdir)/cogl-draw-buffer.c \ $(srcdir)/cogl-matrix-mesa.h \ $(srcdir)/cogl-matrix-mesa.c \ - $(BUILT_SOURCES) \ $(NULL) EXTRA_DIST += $(cogl_winsys_sources) - EXTRA_DIST += stb_image.c # COGL installed headers cogl_headers = \ $(cogl_public_h) \ $(srcdir)/cogl-deprecated.h \ - cogl-defines-$(COGL_DRIVER).h \ + cogl-defines.h \ cogl-enum-types.h \ $(NULL) diff --git a/cogl/cogl.h.in b/cogl/cogl.h similarity index 99% rename from cogl/cogl.h.in rename to cogl/cogl.h index 5fb5df0ce..c7e6ba5e9 100644 --- a/cogl/cogl.h.in +++ b/cogl/cogl.h @@ -29,7 +29,7 @@ #define __COGL_H_INSIDE__ -#include +#include #include #include