diff --git a/ChangeLog b/ChangeLog index 4b1092d9c..47de40a60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-24 Emmanuele Bassi + + * configure.ac: Add the --with-json configure switch to + allow building Clutter with the external dependency on + the system JSON-GLib; the default is to use the internal + copy unless explicitly asked to check. + 2008-04-24 Emmanuele Bassi * Makefile.am: Add HACKING.backends to the EXTRA_DIST. diff --git a/configure.ac b/configure.ac index 56139c600..f4aed2727 100644 --- a/configure.ac +++ b/configure.ac @@ -345,18 +345,37 @@ AC_SUBST([clutterbackendlib]) dnl ======================================================================== -# if we have json-glib installed, use the system library instead of -# the internal copy -AC_MSG_CHECKING([for installed JSON-GLib]) -PKG_CHECK_EXISTS(json-glib-1.0, [have_json=yes], [have_json=no]) -if test "x$have_json" = "xyes"; then - JSON_PREFIX=json-glib - JSON_GLIB_PC=json-glib-1.0 - AC_DEFINE(HAVE_JSON_GLIB, 1, [Have the JSON-GLib library installed]) - AC_MSG_RESULT([found]) -else +# allow building clutter with an external dependency on json-glib +# using the --with-json=check argument, but keep the default to +# the internal version +AC_ARG_WITH([json], + AC_HELP_STRING([--with-json=@<:@internal/check@:>@], + [Select the JSON-GLib copy to use @<:@default=internal@:>@]), + [], + [with_json=internal]) + +case $with_json in + internal|check) ;; + *) AC_MSG_ERROR([Invalid value for the JSON library: use internal or check]) ;; +esac + +if test "x$with_json" = "xinternal"; then JSON_PREFIX=json - AC_MSG_RESULT([not found, using internal copy]) + have_json=no +else + # if the user asked for it and if we have json-glib installed, + # prefer the system library instead of the internal copy + AC_MSG_CHECKING([for installed JSON-GLib]) + PKG_CHECK_EXISTS(json-glib-1.0, [have_json=yes], [have_json=no]) + if test "x$have_json" = "xyes"; then + JSON_PREFIX=json-glib + JSON_GLIB_PC=json-glib-1.0 + AC_DEFINE(HAVE_JSON_GLIB, 1, [Have the JSON-GLib library installed]) + AC_MSG_RESULT([found]) + else + JSON_PREFIX=json + AC_MSG_RESULT([not found, using internal copy]) + fi fi AC_SUBST(JSON_PREFIX)