next release will be 1.3.3
[ppastats.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.64])
5 AC_INIT([ppastats], [1.3.3],[jeanfi@gmail.com],[ppastats],[http://wpitchoune.net/ppastats])
6
7 AM_INIT_AUTOMAKE([-Wall gnu])
8
9 AC_CONFIG_SRCDIR([src/main.c])
10 AC_CONFIG_HEADERS([config.h])
11
12 # Checks for programs.
13 AC_PROG_CC
14 AM_PROG_CC_C_O
15
16 # Checks lib build
17 AC_PROG_RANLIB
18
19 # Intl support
20 AM_GNU_GETTEXT_VERSION([0.18.1])
21 AM_GNU_GETTEXT([external])
22
23 # Checks for header files.
24 AC_PATH_X
25 AC_CHECK_HEADERS([getopt.h stdio.h stdlib.h string.h sys/stat.h sys/time.h sys/types.h time.h])
26
27 # Checks CURL 
28 PKG_CHECK_MODULES(CURL, libcurl )
29 AC_SUBST(CURL_CFLAGS)
30 AC_SUBST(CURL_LIBS)
31
32 # Checks JSON
33 JSON_LIBS=
34 PKG_CHECK_MODULES(JSON, 
35                   json-c >= 0.11.99,
36                   [AC_DEFINE([HAVE_JSON],[1],[Use JSON])], 
37                   [AC_MSG_WARN("json-c missing")])
38
39 if test "$JSON_LIBS" == ""; then
40 PKG_CHECK_MODULES(JSON, 
41                   json >= 0.11.99, 
42                   [AC_DEFINE([HAVE_JSON],[1],[Use JSON])
43                    AC_DEFINE([HAVE_JSON_0],[1],[Use JSON0])], 
44                   [AC_MSG_WARN("json0 missing")])
45 fi
46
47 AM_CONDITIONAL(JSON, test -n "$JSON_LIBS")
48 AC_SUBST(JSON_CFLAGS)
49 AC_SUBST(JSON_LIBS)
50
51 AC_CHECK_TYPE(json_bool, [AC_DEFINE([HAVE_JSON_BOOL], 1, [Use json_bool])], [], [[#include <json/json.h>]])
52
53 AC_CONFIG_FILES([ po/Makefile.in
54  Makefile
55  src/Makefile
56  tests/Makefile
57  themes/Makefile
58  themes/default/css/Makefile
59  themes/default/js/Makefile
60  themes/default/templates/Makefile
61  themes/default/templates/footer.tpl
62 ])
63
64 AC_CHECK_PROGS([HELP2MAN], [help2man])
65
66 AC_CHECK_PROG(HAVE_CPPCHECK, cppcheck, yes)
67 AM_CONDITIONAL(CPPCHECK, test -n "$HAVE_CPPCHECK")
68
69 AC_OUTPUT