Update JSON-GLib dependency

Currently, Clutter depends on the internal copy of JSON-GLib for
the ClutterScript parser. This is done to allow building Clutter
on platforms that do not have the library installed on the system.

Just like we use the internal PNG/JPEG loader as a fallback in
case we don't have GdkPixbuf or CoreGraphics available, we should
use the internal copy of JSON-GLib only in case the system copy
is not present.

The change is simply to move the default for the --with-json
configure switch from "internal" to "check".

In order to allow stricter compliance, a third setting should
be present: "system", which fails if the system copy is not
available.

We should also change the introspection generation to avoid
breaking in case we require the installed Json-1.0.gir instead
of the generated ClutterJson.gir
This commit is contained in:
Emmanuele Bassi 2009-06-25 18:56:52 +01:00
parent 81bc2b4cc7
commit 354fa437cd
2 changed files with 40 additions and 11 deletions

View File

@ -244,6 +244,9 @@ BUILT_GIRSOURCES =
if LOCAL_JSON_GLIB if LOCAL_JSON_GLIB
json_gir_include_path=--add-include-path=json json_gir_include_path=--add-include-path=json
json_gir_include=--include=ClutterJson-@CLUTTER_API_VERSION@
else
json_gir_include=--include=Json-1.0
endif endif
# We can't reference the list of COGL header files, since they are in a # We can't reference the list of COGL header files, since they are in a
@ -261,7 +264,7 @@ Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_
--include=Pango-1.0 \ --include=Pango-1.0 \
--include=PangoCairo-1.0 \ --include=PangoCairo-1.0 \
--include=Cogl-@CLUTTER_API_VERSION@ \ --include=Cogl-@CLUTTER_API_VERSION@ \
--include=ClutterJson-@CLUTTER_API_VERSION@ \ $(json_gir_include) \
--library=clutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@ \ --library=clutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@ \
--libtool="$(top_builddir)/doltlibtool" \ --libtool="$(top_builddir)/doltlibtool" \
--pkg gobject-2.0 \ --pkg gobject-2.0 \

View File

@ -540,14 +540,15 @@ AM_CONDITIONAL(X11_TESTS, [test "x$x11_tests" = "xyes"])
dnl === JSON parser check ===================================================== dnl === JSON parser check =====================================================
# allow building clutter with an external dependency on json-glib # we allow building clutter with the internal copy of json-glib
# using the --with-json=check argument, but keep the default to # for platforms without it, but by default we depend on the
# the internal version # system copy
m4_define([default_json], [check])
AC_ARG_WITH([json], AC_ARG_WITH([json],
AC_HELP_STRING([--with-json=@<:@internal/check@:>@], AC_HELP_STRING([--with-json=@<:@internal/check/system@:>@],
[Select the JSON-GLib copy to use @<:@default=internal@:>@]), [Select the JSON-GLib copy to use @<:@default=default_json@:>@]),
[], [],
[with_json=internal]) [with_json=default_json])
AS_CASE([$with_json], AS_CASE([$with_json],
@ -557,16 +558,41 @@ AS_CASE([$with_json],
have_json=no have_json=no
], ],
[check], [system],
[ [
AC_MSG_CHECKING([for installed JSON-GLib]) AC_MSG_CHECKING([for installed JSON-GLib])
PKG_CHECK_EXISTS([json-glib-1.0], [have_json=yes], [have_json=no]) PKG_CHECK_EXISTS([json-glib-1.0 >= 0.7],
[have_json=yes],
[have_json=no])
AS_IF([test "x$have_json" = "xyes"], AS_IF([test "x$have_json" = "xyes"],
[ [
JSON_PREFIX=json-glib JSON_PREFIX=json-glib
JSON_GLIB_PC=json-glib-1.0 JSON_GLIB_PC="json-glib-1.0 >= 0.7"
AC_DEFINE(HAVE_JSON_GLIB, 1, [Have the JSON-GLib library installed]) AC_DEFINE([HAVE_JSON_GLIB],
[1],
[Have the JSON-GLib library installed])
AC_MSG_RESULT([found])
],
[AC_MSG_ERROR([not found])]
)
],
[check],
[
AC_MSG_CHECKING([for installed JSON-GLib])
PKG_CHECK_EXISTS([json-glib-1.0 >= 0.7],
[have_json=yes],
[have_json=no])
AS_IF([test "x$have_json" = "xyes"],
[
JSON_PREFIX=json-glib
JSON_GLIB_PC="json-glib-1.0 >= 0.7"
AC_DEFINE([HAVE_JSON_GLIB],
[1],
[Have the JSON-GLib library installed])
AC_MSG_RESULT([found]) AC_MSG_RESULT([found])
], ],