fix json_bool
authorJean-Philippe Orsini <jeanfi@gmail.com>
Thu, 13 Feb 2014 10:41:29 +0000 (10:41 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Thu, 13 Feb 2014 10:41:29 +0000 (10:41 +0000)
config.h.in
configure
configure.ac
po/Makefile
po/Makefile.in
po/fr.po
po/ppastats.pot
src/lp_json.c

index 4780543..00b832a 100644 (file)
@@ -28,6 +28,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Use json_bool */
+#undef HAVE_JSON_BOOL
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
index c0acd97..d5310d9 100755 (executable)
--- a/configure
+++ b/configure
@@ -1793,6 +1793,60 @@ $as_echo "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+        return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+           return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -6870,6 +6924,15 @@ fi
 
 
 
+ac_fn_c_check_type "$LINENO" "json_bool" "ac_cv_type_json_bool" "#include <json/json.h>
+"
+if test "x$ac_cv_type_json_bool" = xyes; then :
+
+$as_echo "#define HAVE_JSON_BOOL 1" >>confdefs.h
+
+fi
+
+
 ac_config_files="$ac_config_files po/Makefile.in Makefile src/Makefile tests/Makefile www/footer.tpl www/Makefile"
 
 
index 1e6be59..9af918e 100644 (file)
@@ -34,6 +34,8 @@ PKG_CHECK_MODULES(JSON, json )
 AC_SUBST(JSON_CFLAGS)
 AC_SUBST(JSON_LIBS)
 
+AC_CHECK_TYPE(json_bool, [AC_DEFINE([HAVE_JSON_BOOL], 1, [Use json_bool])], [], [[#include <json/json.h>]])
+
 AC_CONFIG_FILES([ po/Makefile.in
  Makefile
  src/Makefile
index 7f1eeb9..00efa4a 100644 (file)
@@ -22,7 +22,7 @@ srcdir = .
 top_srcdir = ..
 
 
-prefix = /tmp
+prefix = /usr/local
 exec_prefix = ${prefix}
 datarootdir = ${prefix}/share
 datadir = ${datarootdir}
index 0b254fb..66e9f98 100644 (file)
@@ -22,7 +22,7 @@ srcdir = .
 top_srcdir = ..
 
 
-prefix = /tmp
+prefix = /usr/local
 exec_prefix = ${prefix}
 datarootdir = ${prefix}/share
 datadir = ${datarootdir}
index 18648a4..61d69a2 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ppastats 0.0.x\n"
 "Report-Msgid-Bugs-To: jeanfi@gmail.com\n"
-"POT-Creation-Date: 2013-05-12 20:46+0200\n"
+"POT-Creation-Date: 2014-02-13 10:45+0100\n"
 "PO-Revision-Date: 2012-05-05 23:45+0200\n"
 "Last-Translator:  <jeanfi@gmail.com>\n"
 "Language-Team: French\n"
@@ -50,7 +50,7 @@ msgstr ""
 msgid "Generating %s"
 msgstr ""
 
-#: src/html.c:581
+#: src/html.c:582
 #, c-format
 msgid "Copying %s %s"
 msgstr ""
index ce294f2..0883e6a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ppastats 0.0.x\n"
 "Report-Msgid-Bugs-To: jeanfi@gmail.com\n"
-"POT-Creation-Date: 2013-05-12 20:46+0200\n"
+"POT-Creation-Date: 2014-02-13 10:45+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -50,7 +50,7 @@ msgstr ""
 msgid "Generating %s"
 msgstr ""
 
-#: src/html.c:581
+#: src/html.c:582
 #, c-format
 msgid "Copying %s %s"
 msgstr ""
index ddb8f31..e02ef62 100644 (file)
 #include <string.h>
 #include <time.h>
 
+#include <config.h>
 #include "lp_json.h"
 #include "lp_ws.h"
 
 /* Declares json_bool to have consistent code even with
    old json lib releases using boolean instead of json_bool.*/
-#ifndef json_bool
+#ifndef HAVE_JSON_BOOL
 typedef boolean json_bool;
 #endif