build: Generate ClutterJson in the top directory

Instead of doing the shlib trick, build ClutterJson (if needed) inside
the top-level clutter/ directory - similar to a non-recursive layout.

Hopefully, one day, we'll be able to do this with a real non-recursive
layout.
This commit is contained in:
Emmanuele Bassi 2010-09-13 02:15:44 +01:00
parent 40af71fad7
commit 94e2c7a949
2 changed files with 23 additions and 42 deletions

View File

@ -325,16 +325,25 @@ BUILT_GIRSOURCES =
INTROSPECTION_GIRS = INTROSPECTION_GIRS =
if LOCAL_JSON_GLIB if LOCAL_JSON_GLIB
json_gir_include=--include-uninstalled=$(top_builddir)/clutter/json/ClutterJson-@CLUTTER_API_VERSION@.gir json_gir_include=--include-uninstalled=$(top_builddir)/clutter/ClutterJson-@CLUTTER_API_VERSION@.gir
# If we are building it, ClutterJson gets the same handling as described ClutterJson-@CLUTTER_API_VERSION@.gir: libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la Makefile
# for Cogl above
ClutterJson-@CLUTTER_API_VERSION@.gir: Makefile Clutter-@CLUTTER_API_VERSION@.gir json/ClutterJson-@CLUTTER_API_VERSION@.gir
$(QUIET_GEN) \
shlib=`sed -n 's/.*shared-library="\([^"]*\)".*/\1/p' < Clutter-@CLUTTER_API_VERSION@.gir` ; \
sed "s/shared-library=\"[^\"]*\"/shared-library=\"$$shlib\"/"< json/ClutterJson-@CLUTTER_API_VERSION@.gir > $@
BUILT_GIRSOURCES += ClutterJson-@CLUTTER_API_VERSION@.gir clutterjson_sources = $(top_srcdir)/clutter/json/*.h $(top_srcdir)/clutter/json/*.c
clutterjson_introspection_files=$(filter-out %-private.h, $(clutterjson_sources))
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_NAMESPACE = ClutterJson
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_FILES = $(clutterjson_introspection_files)
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS) -DJSON_COMPILATION
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = GObject-2.0
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--warn-all \
--identifier-prefix=Json \
--symbol-prefix=json
INTROSPECTION_GIRS += ClutterJson-@CLUTTER_API_VERSION@.gir
else else
json_gir_include=--include=Json-1.0 json_gir_include=--include=Json-1.0
endif # LOCAL_JSON_GLIB endif # LOCAL_JSON_GLIB
@ -359,8 +368,8 @@ Clutter_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
$(json_gir_include) \ $(json_gir_include) \
--include-uninstalled=$(top_builddir)/clutter/cogl/cogl/Cogl-@CLUTTER_API_VERSION@.gir --include-uninstalled=$(top_builddir)/clutter/cogl/cogl/Cogl-@CLUTTER_API_VERSION@.gir
# ClutterJson.gir and Cogl.gir are used included into Clutter.gir, so need # ClutterJson.gir and Cogl.gir are used included into Clutter.gir, so they
# to be built before the typelib is generated # need to be built before the typelib is generated
Clutter-@CLUTTER_API_VERSION@.typelib: $(clutter_json_gir) Cogl-@CLUTTER_API_VERSION@.gir Clutter-@CLUTTER_API_VERSION@.typelib: $(clutter_json_gir) Cogl-@CLUTTER_API_VERSION@.gir
# We build Cogl.gir in the cogl/ subdir, but it needs to reference the shared # We build Cogl.gir in the cogl/ subdir, but it needs to reference the shared
@ -377,7 +386,7 @@ BUILT_GIRSOURCES += Cogl-@CLUTTER_API_VERSION@.gir
# Cally depends on Clutter because it exposes Clutter types; for this reason, # Cally depends on Clutter because it exposes Clutter types; for this reason,
# we cannot build Cally.gir under cally/ and then do the shlib trick we do # we cannot build Cally.gir under cally/ and then do the shlib trick we do
# for Cogl and ClutterJson. # for Cogl
cally_sources=$(top_srcdir)/clutter/cally/*.h $(top_srcdir)/clutter/cally/*.c cally_sources=$(top_srcdir)/clutter/cally/*.h $(top_srcdir)/clutter/cally/*.c
cally_introspection_files=$(filter-out %-private.h, $(cally_sources)) cally_introspection_files=$(filter-out %-private.h, $(cally_sources))
@ -392,6 +401,7 @@ Cally_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--warn-all \ --warn-all \
--c-include='cally/cally.h' \ --c-include='cally/cally.h' \
--add-include-path $(top_builddir)/clutter \ --add-include-path $(top_builddir)/clutter \
$(json_gir_include) \
--include-uninstalled $(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir --include-uninstalled $(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += Cally-@CLUTTER_API_VERSION@.gir INTROSPECTION_GIRS += Cally-@CLUTTER_API_VERSION@.gir
@ -423,8 +433,9 @@ ClutterX11_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--warn-all \ --warn-all \
--identifier-prefix=ClutterX11 \ --identifier-prefix=ClutterX11 \
--symbol-prefix=clutter_x11 \ --symbol-prefix=clutter_x11 \
$(json_gir_include) \
--include-uninstalled=$(top_builddir)/clutter/cogl/cogl/Cogl-@CLUTTER_API_VERSION@.gir \ --include-uninstalled=$(top_builddir)/clutter/cogl/cogl/Cogl-@CLUTTER_API_VERSION@.gir \
--include-uninstalled $(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir --include-uninstalled=$(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = xlib-2.0 ClutterX11_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = xlib-2.0
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la ClutterX11_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_FILES = $(x11_sources) ClutterX11_@CLUTTER_API_VERSION_AM@_gir_FILES = $(x11_sources)

View File

@ -37,33 +37,3 @@ libclutter_json_la_SOURCES = $(source_c) $(source_h) $(source_h_priv)
noinst_DATA = noinst_DATA =
CLEANFILES = CLEANFILES =
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
if HAVE_INTROSPECTION
BUILT_GIRSOURCES =
ClutterJson-@CLUTTER_API_VERSION@.gir: libclutter-json.la Makefile
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_NAMESPACE = ClutterJson
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-json.la
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_FILES = $(clutterjson_HEADERS) $(source_c)
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS)
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = GObject-2.0
ClutterJson_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--warn-all \
--identifier-prefix=Json \
--symbol-prefix=json
INTROSPECTION_GIRS += ClutterJson-@CLUTTER_API_VERSION@.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
CLEANFILES += $(INTROSPECTION_GIRS)
endif