From: Jean-Philippe Orsini Date: Tue, 21 Jan 2014 16:34:49 +0000 (+0000) Subject: support of json lib in addition to json0 lib X-Git-Tag: v0.0.6~11 X-Git-Url: http://git.wpitchoune.net/gitweb/?p=ptask.git;a=commitdiff_plain;h=6255d64eb9fc2802e09bcb45ea274348542afd1e support of json lib in addition to json0 lib --- diff --git a/NEWS.html b/NEWS.html index f13f412..e19f715 100644 --- a/NEWS.html +++ b/NEWS.html @@ -517,7 +517,7 @@ Initial release.

diff --git a/config.h.in b/config.h.in index 866782d..1668fb2 100644 --- a/config.h.in +++ b/config.h.in @@ -22,6 +22,12 @@ /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV +/* Use JSON */ +#undef HAVE_JSON + +/* Use JSON0 */ +#undef HAVE_JSON_0 + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O diff --git a/config.status b/config.status index 675ff48..25fe1fd 100755 --- a/config.status +++ b/config.status @@ -428,7 +428,7 @@ $config_commands Report bugs to . ptask home page: ." -ac_cs_config="'--prefix=/tmp'" +ac_cs_config="" ac_cs_version="\ ptask config.status 0.0.x configured by ./configure, generated by GNU Autoconf 2.69, @@ -438,7 +438,7 @@ Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/jporsini/work/wpitchoune/svnpub/ptask/trunk' +ac_pwd='/home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk' srcdir='.' INSTALL='/usr/bin/install -c' MKDIR_P='/bin/mkdir -p' @@ -520,7 +520,7 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - set X /bin/bash './configure' '--prefix=/tmp' $ac_configure_extra_args --no-create --no-recursion + set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion shift $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 CONFIG_SHELL='/bin/bash' @@ -682,6 +682,8 @@ S["GSETTINGS_RULES"]="\n"\ S["GLIB_COMPILE_SCHEMAS"]="/usr/lib/x86_64-linux-gnu/glib-2.0/glib-compile-schemas" S["gsettingsschemadir"]="${datarootdir}/glib-2.0/schemas" S["GSETTINGS_DISABLE_SCHEMAS_COMPILE"]="" +S["JSON_FALSE"]="#" +S["JSON_TRUE"]="" S["JSON_LIBS"]="-ljson-c " S["JSON_CFLAGS"]="-I/usr/include/json-c " S["GTK_LIBS"]="-lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 " @@ -756,7 +758,7 @@ S["mkdir_p"]="/bin/mkdir -p" S["MKDIR_P"]="/bin/mkdir -p" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" S["STRIP"]="" -S["install_sh"]="${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/trunk/install-sh" +S["install_sh"]="${SHELL} /home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk/install-sh" S["MAKEINFO"]="makeinfo" S["AUTOHEADER"]="autoheader" S["AUTOMAKE"]="automake-1.13" @@ -797,7 +799,7 @@ S["libexecdir"]="${exec_prefix}/libexec" S["sbindir"]="${exec_prefix}/sbin" S["bindir"]="${exec_prefix}/bin" S["program_transform_name"]="s,x,x," -S["prefix"]="/tmp" +S["prefix"]="/usr/local" S["exec_prefix"]="${prefix}" S["PACKAGE_URL"]="http://wpitchoune.net/ptask" S["PACKAGE_BUGREPORT"]="jeanfi@gmail.com" @@ -859,6 +861,7 @@ D["VERSION"]=" \"0.0.x\"" D["ENABLE_NLS"]=" 1" D["HAVE_GETTEXT"]=" 1" D["HAVE_DCGETTEXT"]=" 1" +D["HAVE_JSON"]=" 1" for (key in D) D_is_set[key] = 1 FS = "" } diff --git a/configure b/configure index 71dde9f..380ec8e 100755 --- a/configure +++ b/configure @@ -599,6 +599,8 @@ GSETTINGS_RULES GLIB_COMPILE_SCHEMAS gsettingsschemadir GSETTINGS_DISABLE_SCHEMAS_COMPILE +JSON_FALSE +JSON_TRUE JSON_LIBS JSON_CFLAGS GTK_LIBS @@ -6861,6 +6863,175 @@ if test -n "$JSON_CFLAGS"; then pkg_cv_JSON_CFLAGS="$JSON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 + ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JSON_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$JSON_LIBS"; then + pkg_cv_JSON_LIBS="$JSON_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 + ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JSON_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + JSON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1` + else + JSON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$JSON_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"json-c missing\"" >&5 +$as_echo "$as_me: WARNING: \"json-c missing\"" >&2;} +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"json-c missing\"" >&5 +$as_echo "$as_me: WARNING: \"json-c missing\"" >&2;} +else + JSON_CFLAGS=$pkg_cv_JSON_CFLAGS + JSON_LIBS=$pkg_cv_JSON_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_JSON 1" >>confdefs.h + +fi + +if test "$JSON_LIBS" == ""; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON" >&5 +$as_echo_n "checking for JSON... " >&6; } + +if test -n "$JSON_CFLAGS"; then + pkg_cv_JSON_CFLAGS="$JSON_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json\""; } >&5 + ($PKG_CONFIG --exists --print-errors "json") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JSON_CFLAGS=`$PKG_CONFIG --cflags "json" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$JSON_LIBS"; then + pkg_cv_JSON_LIBS="$JSON_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json\""; } >&5 + ($PKG_CONFIG --exists --print-errors "json") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JSON_LIBS=`$PKG_CONFIG --libs "json" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + JSON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json" 2>&1` + else + JSON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$JSON_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"json0 missing\"" >&5 +$as_echo "$as_me: WARNING: \"json0 missing\"" >&2;} +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"json0 missing\"" >&5 +$as_echo "$as_me: WARNING: \"json0 missing\"" >&2;} +else + JSON_CFLAGS=$pkg_cv_JSON_CFLAGS + JSON_LIBS=$pkg_cv_JSON_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_JSON 1" >>confdefs.h + + +$as_echo "#define HAVE_JSON_0 1" >>confdefs.h + +fi +fi + + if test -n "$JSON_LIBS"; then + JSON_TRUE= + JSON_FALSE='#' +else + JSON_TRUE='#' + JSON_FALSE= +fi + + + + +JSON_LIBS= + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON" >&5 +$as_echo_n "checking for JSON... " >&6; } + +if test -n "$JSON_CFLAGS"; then + pkg_cv_JSON_CFLAGS="$JSON_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json\""; } >&5 ($PKG_CONFIG --exists --print-errors "json") 2>&5 ac_status=$? @@ -7405,6 +7576,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${JSON_TRUE}" && test -z "${JSON_FALSE}"; then + as_fn_error $? "conditional \"JSON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${CPPCHECK_TRUE}" && test -z "${CPPCHECK_FALSE}"; then as_fn_error $? "conditional \"CPPCHECK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/configure.ac b/configure.ac index 00ff4c6..182d4d4 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,24 @@ AC_SUBST(GTK_LIBS) # Check JSON JSON_LIBS= +PKG_CHECK_MODULES(JSON, + json-c, + [AC_DEFINE([HAVE_JSON],[1],[Use JSON])], + [AC_MSG_WARN("json-c missing")]) + +if test "$JSON_LIBS" == ""; then +PKG_CHECK_MODULES(JSON, + json, + [AC_DEFINE([HAVE_JSON],[1],[Use JSON]) + AC_DEFINE([HAVE_JSON_0],[1],[Use JSON0])], + [AC_MSG_WARN("json0 missing")]) +fi + +AM_CONDITIONAL(JSON, test -n "$JSON_LIBS") +AC_SUBST(JSON_CFLAGS) +AC_SUBST(JSON_LIBS) + +JSON_LIBS= PKG_CHECK_MODULES(JSON, json) AC_SUBST(JSON_CFLAGS) AC_SUBST(JSON_LIBS) diff --git a/po/Makefile b/po/Makefile index ea8150b..79402fd 100644 --- a/po/Makefile +++ b/po/Makefile @@ -21,7 +21,7 @@ srcdir = . top_srcdir = .. -prefix = /tmp +prefix = /usr/local exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} @@ -34,12 +34,12 @@ INSTALL_DATA = ${INSTALL} -m 644 # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, -# ${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/trunk/install-sh does not start with $(SHELL), so we add it. +# ${SHELL} /home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk/install-sh does not start with $(SHELL), so we add it. # In automake >= 1.10, /bin/mkdir -p is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. -mkinstalldirs = $(SHELL) ${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/trunk/install-sh -d -install_sh = $(SHELL) ${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/trunk/install-sh +mkinstalldirs = $(SHELL) ${SHELL} /home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk/install-sh -d +install_sh = $(SHELL) ${SHELL} /home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk/install-sh MKDIR_P = /bin/mkdir -p mkdir_p = /bin/mkdir -p diff --git a/po/Makefile.in b/po/Makefile.in index ca508b4..00e247f 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -21,7 +21,7 @@ srcdir = . top_srcdir = .. -prefix = /tmp +prefix = /usr/local exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} @@ -34,12 +34,12 @@ INSTALL_DATA = ${INSTALL} -m 644 # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, -# ${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/trunk/install-sh does not start with $(SHELL), so we add it. +# ${SHELL} /home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk/install-sh does not start with $(SHELL), so we add it. # In automake >= 1.10, /bin/mkdir -p is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. -mkinstalldirs = $(SHELL) ${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/trunk/install-sh -d -install_sh = $(SHELL) ${SHELL} /home/jporsini/work/wpitchoune/svnpub/ptask/trunk/install-sh +mkinstalldirs = $(SHELL) ${SHELL} /home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk/install-sh -d +install_sh = $(SHELL) ${SHELL} /home/jporsini/work.local/wpitchoune/svnpub/ptask/trunk/install-sh MKDIR_P = /bin/mkdir -p mkdir_p = /bin/mkdir -p