1m4_define([tpl_major_version], [0])
2m4_define([tpl_minor_version], [8])
3m4_define([tpl_micro_version], [2])
4m4_define([tpl_nano_version], [0])
5
6# If Tpl library source has changed since last release, increment revision
7# If interfaces have been added, removed or changed since last release,
8#  increment current and set revision to 0
9# If interfaces have been added since last release, increment age
10# If interfaces have been removed since last release, set age to 0
11m4_define([tpl_lt_current], [6])
12m4_define([tpl_lt_revision], [0])
13m4_define([tpl_lt_age], [3])
14
15# The same for the extensions library produced by --enable-public-extensions
16m4_define([tpl_ext_lt_current], [3])
17m4_define([tpl_ext_lt_revision], [0])
18m4_define([tpl_ext_lt_age], [0])
19
20dnl Display the nano_version only if it's not '0'
21m4_define([tpl_base_version],
22          [tpl_major_version.tpl_minor_version.tpl_micro_version])
23m4_define([tpl_full_version],
24          [m4_if(tpl_nano_version, 0, [tpl_base_version],
25              [tpl_base_version].[tpl_nano_version])])
26
27m4_define(tpl_maybe_datestamp,
28          m4_esyscmd([if test x]tpl_nano_version[ != x0; then date +.%Y%m%d | tr -d '\n\r'; fi]))
29
30m4_define(tpl_version, tpl_full_version[]tpl_maybe_datestamp)
31
32
33AC_INIT([telepathy-logger],[tpl_version],[https://bugs.freedesktop.org/buglist.cgi?product=Telepathy&component=logger])
34AM_SILENT_RULES([yes])
35
36DBUS_SERVICES_DIR="$datadir/dbus-1/services"
37AC_SUBST(DBUS_SERVICES_DIR)
38AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
39
40ifelse(tpl_nano_version, 0,
41    [ official_release=yes ],
42    [ official_release=no ])
43
44TPL_LT_CURRENT=tpl_lt_current
45TPL_LT_REVISION=tpl_lt_revision
46TPL_LT_AGE=tpl_lt_age
47AC_SUBST([TPL_LT_CURRENT])
48AC_SUBST([TPL_LT_REVISION])
49AC_SUBST([TPL_LT_AGE])
50# The ABI version is the end of the SONAME on Linux, and would appear in the
51# name of a plugin directory, for instance
52TPL_ABI_VERSION=`expr ${TPL_LT_CURRENT} - ${TPL_LT_AGE}`
53AC_SUBST([TPL_ABI_VERSION])
54
55TPL_EXT_LT_CURRENT=tpl_ext_lt_current
56TPL_EXT_LT_REVISION=tpl_ext_lt_revision
57TPL_EXT_LT_AGE=tpl_ext_lt_age
58AC_SUBST([TPL_EXT_LT_CURRENT])
59AC_SUBST([TPL_EXT_LT_REVISION])
60AC_SUBST([TPL_EXT_LT_AGE])
61
62AC_PREREQ([2.65])
63AC_COPYRIGHT([
64  Copyright (C) 2003-2007 Imendio AB
65  Copyright (C) 2007-2011 Collabora Ltd.
66])
67
68# Minimal version required
69GLIB_REQUIRED=2.28
70DBUS_REQUIRED=1.1.0
71DBUS_GLIB_REQUIRED=0.82
72
73TELEPATHY_GLIB_REQUIRED=0.19.2
74AC_DEFINE(TP_VERSION_MIN_REQUIRED, TP_VERSION_0_18, [Ignore post 0.18 deprecations])
75AC_DEFINE(TP_VERSION_MAX_ALLOWED, TP_VERSION_0_20, [Prevent post 0.20 APIs])
76
77# Warning if GLib/GDK/GTK headers are included
78AC_DEFINE(G_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GLib])
79AC_DEFINE(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GDK pixbuf])
80
81# Disable GLib deprecation warnings for now; GValueArray is deprecated but we
82# need it for dbus-glib.
83AC_DEFINE(GLIB_DISABLE_DEPRECATION_WARNINGS, 1, [Build with GLib deprecated])
84
85AC_CONFIG_MACRO_DIR([m4])
86AC_CONFIG_HEADERS([config.h])
87AC_CONFIG_SRCDIR([configure.ac])
88AC_CONFIG_AUX_DIR(.)
89
90AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define no-dist-gzip tar-ustar -Wno-portability)
91AC_SEARCH_LIBS([strerror],[cposix])
92AC_PROG_CC
93AC_HEADER_STDC
94LT_INIT
95AM_PROG_MKDIR_P
96AM_PATH_GLIB_2_0
97AC_PATH_XTRA
98IT_PROG_INTLTOOL([0.35.0])
99AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
100GLIB_GSETTINGS
101GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
102AC_SUBST(GLIB_GENMARSHAL)
103
104GOBJECT_INTROSPECTION_CHECK([0.9.6])
105
106GTK_DOC_CHECK([1.10])
107
108# -----------------------------------------------------------
109# Check for code generation tools
110# -----------------------------------------------------------
111XSLTPROC=
112AC_CHECK_PROGS([XSLTPROC], [xsltproc])
113if test -z "$XSLTPROC"; then
114  AC_MSG_ERROR([xsltproc (from libxslt) is required])
115fi
116
117AM_PATH_PYTHON([2.5])
118
119# -----------------------------------------------------------
120# Error flags
121# -----------------------------------------------------------
122
123TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$official_release" = xno],
124  [all \
125   extra \
126   format-security \
127   init-self \
128   missing-prototypes \
129   nested-externs \
130   pointer-arith \
131   shadow \
132   sign-compare \
133   strict-prototypes],
134  [missing-field-initializers \
135   unused-parameter])
136
137# declaration-after-statement is deliberately not used here
138
139AC_ARG_ENABLE(Werror,
140  AS_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
141    werror=$enableval, werror=yes)
142
143TP_COMPILER_FLAG(-D_POSIX_SOURCE, ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE")
144TP_COMPILER_FLAG(-std=c99, ERROR_CFLAGS="$ERROR_CFLAGS -std=c99")
145
146AC_SUBST(ERROR_CFLAGS)
147
148# -----------------------------------------------------------
149# Pkg-Config dependency checks
150# -----------------------------------------------------------
151
152PKG_CHECK_MODULES(TPL,
153[
154   dbus-1 >= $DBUS_REQUIRED
155   dbus-glib-1 >= $DBUS_GLIB_REQUIRED
156   gio-2.0
157   glib-2.0 >= $GLIB_REQUIRED
158   gobject-2.0
159   libxml-2.0
160   sqlite3
161   telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
162])
163
164
165# -----------------------------------------------------------
166# Enable public extensions library
167# -----------------------------------------------------------
168
169AC_ARG_ENABLE(public_extensions,
170  AS_HELP_STRING([--enable-public-extensions],[build a public wrapper for the Telepathy extensions library]),
171    enable_public_extensions=$enableval, enable_public_extensions=no )
172
173if test x$enable_public_extensions = xyes; then
174  AC_DEFINE(ENABLE_PUBLIC_EXTENSIONS, [], [Enable Public Extensions])
175fi
176AM_CONDITIONAL([ENABLE_PUBLIC_EXTENSIONS], [test "x$enable_public_extensions" = xyes])
177
178# -----------------------------------------------------------
179# Enable debug
180# -----------------------------------------------------------
181
182AC_ARG_ENABLE(debug,
183  AS_HELP_STRING([--disable-debug],[compile without debug code]),
184    enable_debug=$enableval, enable_debug=yes )
185
186if test x$enable_debug = xyes; then
187  AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
188fi
189AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes])
190
191# -----------------------------------------------------------
192# Coding style checks
193# -----------------------------------------------------------
194AC_ARG_ENABLE(coding-style-checks,
195  AS_HELP_STRING([--disable-coding-style-checks],
196                 [do not check coding style using grep]),
197    [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
198
199AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
200# -----------------------------------------------------------
201
202AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], false)
203
204AC_CONFIG_FILES([
205   Makefile
206   data/Makefile
207   doc/Makefile
208   doc/reference/Makefile
209   doc/reference/libtelepathy-logger/Makefile
210   extensions/Makefile
211   extensions/tpl-extensions.pc
212   po/Makefile.in
213   src/Makefile
214   telepathy-logger/Makefile
215   telepathy-logger/telepathy-logger-0.2.pc
216   telepathy-logger/telepathy-logger-0.2-uninstalled.pc
217   tools/Makefile
218   tests/Makefile
219   tests/dbus/Makefile
220   tests/lib/Makefile
221   tests/suppressions/Makefile
222])
223AC_OUTPUT
224
225echo "
226Configure summary:
227
228	Compiler....................:  ${CC}
229	Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
230	Prefix......................:  ${prefix}
231	Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
232	Bugreporting URL............:  ${PACKAGE_BUGREPORT}
233	Public extensions library...:  ${enable_public_extensions}
234	Introspection support.......:  ${found_introspection}
235
236"
237