1 # If not 1, append datestamp to the version number
2 m4_define([folks_released], [0])
4 m4_define([folks_major_version], [0])
5 m4_define([folks_minor_version], [6])
6 m4_define([folks_micro_version], [3])
7 m4_define([folks_nano_version], [3])
9 # If library source has changed since last release, increment revision
10 # If interfaces have been added, removed or changed since last release,
11 # increment current and set revision to 0
12 # If interfaces have been added since last release, increment age
13 # If interfaces have been removed since last release, set age to 0
14 m4_define([folks_lt_current], [27])
15 m4_define([folks_lt_revision], [2])
16 m4_define([folks_lt_age], [2])
18 # Display the nano_version only if it's not '0'
19 m4_define([folks_base_version],
20 folks_major_version.folks_minor_version.folks_micro_version)
21 m4_define([folks_full_version],
22 [m4_if(folks_nano_version, [0],
23 folks_base_version, folks_base_version.folks_nano_version)])
25 m4_define([folks_maybe_datestamp],
26 m4_if(folks_released, [1],
27 [], [m4_esyscmd([date +.%Y%m%d | tr -d '\n\r'])]))
29 m4_define([folks_version], folks_full_version[]folks_maybe_datestamp)
30 m4_define([folks_major_minor_version], folks_major_version.folks_minor_version)
31 m4_define([folks_module_version], folks_lt_current)
33 AC_INIT([folks], folks_version,
34 [https://bugzilla.gnome.org/browse.cgi?product=folks], [folks],
35 [http://telepathy.freedesktop.org/wiki/Folks])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 AC_COPYRIGHT([Copyright (C) 2010 Collabora Ltd.])
41 AC_CONFIG_MACRO_DIR([m4])
42 AC_CONFIG_SRCDIR([Makefile.am])
43 AC_CONFIG_HEADERS(config.h)
44 AC_CONFIG_SRCDIR([configure.ac])
45 AM_INIT_AUTOMAKE([1.11 dist-bzip2 no-define
46 no-dist-gzip tar-ustar -Wno-portability])
47 AM_MAINTAINER_MODE([enable])
53 PKG_PROG_PKG_CONFIG([0.21])
59 LT_CURRENT=folks_lt_current
60 LT_REVISION=folks_lt_revision
62 AC_SUBST([LT_CURRENT])
63 AC_SUBST([LT_REVISION])
66 FOLKS_MAJOR_MINOR_VERSION=folks_major_minor_version
67 AC_SUBST([FOLKS_MAJOR_MINOR_VERSION])
70 AC_SUBST([API_VERSION])
72 AC_ARG_ENABLE(tracker-backend,
73 AC_HELP_STRING([--enable-tracker-backend],
74 [ build the Tracker backend]),
75 enable_tracker_backend=$enableval,
76 enable_tracker_backend=no )
78 AM_CONDITIONAL([ENABLE_TRACKER], [test "x$enable_tracker_backend" = "xyes"])
80 AC_ARG_ENABLE(eds-backend,
81 AC_HELP_STRING([--enable-eds-backend],
82 [ build the E-D-S backend]),
83 enable_eds_backend=$enableval,
84 enable_eds_backend=yes )
86 AM_CONDITIONAL([ENABLE_EDS], [test "x$enable_eds_backend" = "xyes"])
88 # Automatically check the dependencies for the libsocialweb backend
89 SW_CLIENT_REQUIRED=0.25.15
90 AC_ARG_ENABLE(libsocialweb-backend,
91 AC_HELP_STRING([--enable-libsocialweb-backend=@<:@no/yes/auto@:>@],
92 [build the Libsocialweb backend (default: auto)]),
93 enable_libsocialweb_backend=$enableval,
94 enable_libsocialweb_backend=auto )
96 if test "x$enable_libsocialweb_backend" != "xno"; then
97 PKG_CHECK_MODULES([SW_CLIENT], [libsocialweb-client >= $SW_CLIENT_REQUIRED],
98 have_libsocialweb_backend="yes", have_libsocialweb_backend="no")
99 if test "x$have_libsocialweb_backend" = "xyes" -a \
100 "x$enable_vala" = "xyes"; then
101 VALA_CHECK_PACKAGES([telepathy-glib
104 libsocialweb-client],
106 have_libsocialweb_backend="no")
109 if test "x$have_libsocialweb_backend" = "xyes"; then
110 AC_DEFINE(HAVE_LIBSOCIALWEB, [],
111 [Define if you have the libsocialweb backend])
114 have_libsocialweb_backend=no
117 if test "x$enable_libsocialweb_backend" = "xyes" -a \
118 "x$have_libsocialweb_backend" != "xyes"; then
119 AC_MSG_ERROR([Cannot find libsocialweb dependencies.])
122 AM_CONDITIONAL([ENABLE_LIBSOCIALWEB],
123 [test "x$have_libsocialweb_backend" = "xyes"])
125 # -----------------------------------------------------------
127 # -----------------------------------------------------------
130 TP_GLIB_REQUIRED=0.13.1
132 VALADOC_REQUIRED=0.3.1
133 TRACKER_SPARQL_MAJOR=0.12
134 TRACKER_SPARQL_REQUIRED=0.12.0
137 EDATASERVER_REQUIRED=3.1.5
139 PKG_CHECK_MODULES([GLIB],
140 [glib-2.0 >= $GLIB_REQUIRED
141 gobject-2.0 >= $GLIB_REQUIRED])
142 PKG_CHECK_MODULES([GMODULE], [gmodule-no-export-2.0])
143 PKG_CHECK_MODULES([GIO], [gio-2.0 >= $GLIB_REQUIRED])
144 PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
145 PKG_CHECK_MODULES([GCONF2], [gconf-2.0 >= $GCONF2_REQUIRED])
147 # FIXME: We depend on libgee < 0.7 because 0.7 breaks API. bgo#627746
148 PKG_CHECK_MODULES([GEE], [gee-1.0 < 0.7],
149 have_gee_0_6_x="yes",
152 if test "x$have_gee_0_6_x" != "xyes"; then
154 Gee 0.6.x required but not installed.
156 Note that Gee 0.8.x provides gee-0.8 (but gee-1.0 is, confusingly, provided by
160 PKG_CHECK_MODULES([TP_GLIB], [telepathy-glib >= $TP_GLIB_REQUIRED])
162 if test x$enable_tracker_backend = xyes; then
163 PKG_CHECK_MODULES([TRACKER_SPARQL],
164 [tracker-sparql-$TRACKER_SPARQL_MAJOR >= \
165 $TRACKER_SPARQL_REQUIRED])
168 if test x$enable_eds_backend = xyes; then
169 PKG_CHECK_MODULES([EBOOK], [libebook-1.2 >= $EBOOK_REQUIRED])
170 PKG_CHECK_MODULES([EDATASERVER], [libedataserver-1.2 >= $EDATASERVER_REQUIRED])
174 # Vala building options -- allows tarball builds without installing Vala
176 AC_ARG_ENABLE([vala],
177 AS_HELP_STRING([--enable-vala],
178 [Enable building from the Vala sources]),
179 [enable_vala=$enableval],
182 # will be re-set as necessary below
183 AM_CONDITIONAL([HAVE_INTROSPECTION], [test "x$enable_vala" = "xyes"])
186 # Force Vala for non-release builds
187 m4_if(folks_released, [1], [],
190 echo "Vala compiler required for non-release builds; requiring Vala..."
193 # Force Vala if generated source is missing or outdated
195 ! -e ${sd}tools/folks_import_vala.stamp -o \
196 ! -e ${sd}tests/folks/abstract_field_details_vala.stamp -o \
197 ! -e ${sd}tests/folks/aggregation_vala.stamp -o \
198 ! -e ${sd}tests/folks/backend_loading_vala.stamp -o \
199 ! -e ${sd}tests/key-file/individual_retrieval_vala.stamp -o \
200 ! -e ${sd}tests/lib/folks-test.vapi -o \
201 ! -e ${sd}tests/lib/key-file/kf-test.vapi -o \
202 ! -e ${sd}tests/lib/key-file/libkf_test_la_vala.stamp -o \
203 ! -e ${sd}tests/lib/telepathy/contactlist/tp-test-contactlist.gir -o \
204 ! -e ${sd}tests/lib/telepathy/contactlist/tp-test-contactlist.vapi -o \
205 ! -e ${sd}tests/lib/libfolks_test_la_vala.stamp -o \
206 ! -e ${sd}tests/telepathy/persona_store_capabilities_vala.stamp -o \
207 ! -e ${sd}tests/telepathy/individual_retrieval_vala.stamp -o \
208 ! -e ${sd}tests/telepathy/individual_properties_vala.stamp -o \
209 ! -e ${sd}tests/folks/backend_loading_vala.stamp -o \
210 ! -e ${sd}backends/key-file/key_file_la_vala.stamp -o \
211 ! -e ${sd}backends/telepathy/telepathy_la_vala.stamp \
213 ! -e ${sd}backends/telepathy/lib/folks-telepathy.vapi -o \
214 ! -e ${sd}backends/telepathy/lib/tp-lowlevel.gir -o \
215 ! -e ${sd}backends/telepathy/lib/tp-lowlevel.vapi -o \
216 ! -e ${sd}backends/telepathy/lib/libfolks_telepathy_la_vala.stamp -o \
217 ! -e ${sd}folks/folks-internal.h -o \
218 ! -e ${sd}folks/folks-internal.vapi -o \
219 ! -e ${sd}folks/libfolks_internal_la_vala.stamp -o \
220 ! -e ${sd}folks/folks.vapi -o \
221 ! -e ${sd}folks/libfolks_la_vala.stamp ; then
223 echo "Vala source needs to be re-compiled; requiring Vala..."
226 if test "x$enable_vala" = "xyes" ; then
227 AM_PROG_VALAC([$VALA_REQUIRED])
228 if test "x$VALAC" = "x"; then
229 AC_MSG_ERROR([Vala requested but valac is not installed])
232 AC_PATH_PROG([VAPIGEN], [vapigen], [])
233 if test "x$VAPIGEN" = "x"; then
234 AC_MSG_ERROR([Vala must be built with --enable-vapigen])
237 # require GLib >= 2.24 so GLib.Array, etc. reffing is handled
239 VALAFLAGS="$VALAFLAGS --target-glib=2.24"
240 AC_SUBST([VALAFLAGS])
241 AC_SUBST([VAPIGENFLAGS])
244 VALA_CHECK_PACKAGES([telepathy-glib
248 if test x$enable_tracker_backend = xyes; then
249 VALA_CHECK_PACKAGES([tracker-sparql-$TRACKER_SPARQL_MAJOR])
252 if test x$enable_eds_backend = xyes; then
253 VALA_CHECK_PACKAGES([libebook-1.2 libedataserver-1.2 libxml-2.0])
257 # this will set HAVE_INTROSPECTION
258 GOBJECT_INTROSPECTION_REQUIRE([0.9.12])
260 AM_CONDITIONAL([HAVE_VALA], [test "x$enable_vala" = "xyes"])
262 # Various functions that we need (used in C code generated from Vala)
263 AC_CHECK_FUNCS([memset])
264 AC_CHECK_FUNCS([strstr])
266 # -----------------------------------------------------------
268 # -----------------------------------------------------------
270 FOLKS_MODULE_VERSION=folks_module_version
271 AC_SUBST([FOLKS_MODULE_VERSION])
272 AC_DEFINE([MODULE_VERSION], "folks_module_version", [Module interface version])
274 BACKEND_DIR='$(libdir)/folks/$(FOLKS_MODULE_VERSION)/backends'
275 AC_SUBST([BACKEND_DIR])
277 BACKEND_KF='$(top_builddir)/backends/key-file/.libs/key-file.so'
278 AC_SUBST([BACKEND_KF])
279 BACKEND_TP='$(top_builddir)/backends/telepathy/.libs/telepathy.so'
280 AC_SUBST([BACKEND_TP])
282 if test x$have_libsocialweb_backend = xyes; then
283 BACKEND_LIBSOCIALWEB='$(top_builddir)/backends/libsocialweb/.libs/libsocialweb.so'
284 AC_SUBST([BACKEND_LIBSOCIALWEB])
287 if test x$enable_tracker_backend = xyes; then
288 BACKEND_TRACKER='$(top_builddir)/backends/tracker/.libs/tracker.so'
289 AC_SUBST([BACKEND_TRACKER])
292 if test x$enable_eds_backend = xyes; then
293 BACKEND_EDS='$(top_builddir)/backends/eds/.libs/eds.so'
294 AC_SUBST([BACKEND_EDS])
297 # All of the backend libraries in our tree; to be used by the tests
298 BACKEND_UNINST_PATH='$(BACKEND_KF):$(BACKEND_TP)'
299 if test x$have_libsocialweb_backend = xyes; then
300 LIBSOCIALWEB_BACKEND_UNINST_PATH='$(BACKEND_LIBSOCIALWEB)'
301 BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$LIBSOCIALWEB_BACKEND_UNINST_PATH"
303 if test x$enable_tracker_backend = xyes; then
304 TRACKER_BACKEND_UNINST_PATH='$(BACKEND_TRACKER)'
305 BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$TRACKER_BACKEND_UNINST_PATH"
307 if test x$enable_eds_backend = xyes; then
308 EDS_BACKEND_UNINST_PATH='$(BACKEND_EDS)'
309 BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$EDS_BACKEND_UNINST_PATH"
311 AC_SUBST([BACKEND_UNINST_PATH])
313 # -----------------------------------------------------------
315 # -----------------------------------------------------------
317 AC_ARG_ENABLE([import-tool],
318 AS_HELP_STRING([--enable-import-tool],
319 [Enable building the meta-contact import tool]),
320 [enable_import_tool=$enableval with_import_tool=$enableval],
321 [enable_import_tool=maybe with_import_tool=no])
322 AS_IF([test "$enable_import_tool" != "no"],
323 [PKG_CHECK_MODULES([LIBXML], [libxml-2.0],
324 [with_import_tool=yes], [with_import_tool=no])])
325 AS_IF([test "$enable_import_tool" = "yes" -a "$with_import_tool" = "no"],
326 [AC_MSG_ERROR([Import tool explicitly enabled, but libxml2 not found])])
327 AM_CONDITIONAL([ENABLE_IMPORT_TOOL], [test "$with_import_tool" = "yes"])
329 # Readline's required for the folks-inspect program
330 AC_ARG_ENABLE([inspect-tool],
331 AS_HELP_STRING([--enable-inspect-tool],
332 [Enable building the data inspection tool]),
333 [enable_inspect_tool=$enableval with_inspect_tool=$enableval],
334 [enable_inspect_tool=maybe with_inspect_tool=no])
335 AS_IF([test "$enable_inspect_tool" = "yes" -a "$enable_vala" != "yes"],
336 [AC_MSG_ERROR([Inspect tool explicitly enabled, but Vala wasn't enabled \
337 using --enable-vala])])
338 AS_IF([test "$enable_inspect_tool" = "maybe" -a "$enable_vala" != "yes"],
339 [AC_MSG_NOTICE([Inspect tool disabled, as Vala wasn't enabled using \
341 AS_IF([test "$enable_inspect_tool" != "no" -a "x$enable_vala" = "xyes"],
342 [AC_CHECK_LIB([readline], [main],
343 [with_inspect_tool=yes], [with_inspect_tool=no],
345 AS_IF([test "$enable_inspect_tool" != "no" -a "$with_inspect_tool" = "yes" -a \
346 "x$enable_vala" = "xyes"],
347 [VALA_CHECK_PACKAGES([readline])
348 LIBREADLINE="-lreadline -lncurses"
349 AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline])
350 AC_SUBST([LIBREADLINE])])
351 AS_IF([test "$enable_inspect_tool" = "yes" -a "$with_inspect_tool" = "no"],
352 [AC_MSG_ERROR([Inspect tool explicitly enabled, but readline not found])])
353 AM_CONDITIONAL([ENABLE_INSPECT_TOOL], [test "$with_inspect_tool" = "yes"])
355 # -----------------------------------------------------------
357 # -----------------------------------------------------------
359 AC_ARG_ENABLE([docs],
360 AS_HELP_STRING([--enable-docs],[Enable documentation generation]),
361 [enable_docs=$enableval], [enable_docs=no])
362 AM_CONDITIONAL([ENABLE_DOCS], [test x$enable_docs = xyes])
365 if test x$enable_docs = xyes; then
366 # make sure the library is new enough and the program exists
367 PKG_CHECK_MODULES([VALADOC], [valadoc-1.0 >= $VALADOC_REQUIRED])
368 AC_PATH_PROG([VALADOC], [valadoc], [:])
369 AS_IF([test "$VALADOC" != :], have_valadoc=yes)
371 AM_CONDITIONAL([HAVE_VALADOC], [test x$have_valadoc = xyes])
373 if test "x$enable_docs" = "xyes" -a "x$have_valadoc" != "xyes"; then
374 AC_MSG_ERROR([Doc building requested but valadoc not installed.])
377 # -----------------------------------------------------------
379 # -----------------------------------------------------------
381 GETTEXT_PACKAGE=AC_PACKAGE_NAME
382 AC_SUBST(GETTEXT_PACKAGE)
383 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
384 IT_PROG_INTLTOOL([0.35.0])
386 # -----------------------------------------------------------
388 # -----------------------------------------------------------
390 AS_COMPILER_FLAG([-Wall], [ERROR_CFLAGS="-Wall"], [ERROR_CFLAGS=""])
391 AS_COMPILER_FLAG([-Werror], [werror=yes], [werror=no])
393 AC_ARG_ENABLE([debug],
394 AS_HELP_STRING([--disable-debug],[compile without debug code]),
395 [enable_debug=$enableval], [enable_debug=yes])
397 AC_ARG_ENABLE([Werror],
398 AS_HELP_STRING([--disable-Werror],
399 [compile without -Werror (normally enabled in
400 development builds)]),
401 [werror=$enableval], [werror=yes])
403 AS_COMPILER_FLAG([-Wextra], [wextra=yes], [wextra=no])
404 AS_COMPILER_FLAG([-Wno-missing-field-initializers],
405 [wno_missing_field_initializers=yes],
406 [wno_missing_field_initializers=no])
407 AS_COMPILER_FLAG([-Wno-unused-parameter],
408 [wno_unused_parameter=yes], [wno_unused_parameter=no])
410 m4_if(folks_released, [1], [],
412 if test x$werror = xyes; then
413 ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
415 if test x$wextra = xyes -a \
416 x$wno_missing_field_initializers = xyes -a \
417 x$wno_unused_parameter = xyes; then
418 ERROR_CFLAGS="$ERROR_CFLAGS -Wextra \
419 -Wno-missing-field-initializers -Wno-unused-parameter"
423 AS_COMPILER_FLAG([-D_POSIX_SOURCE], [ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE"])
424 AS_COMPILER_FLAG([-std=c99], [ERROR_CFLAGS="$ERROR_CFLAGS -std=c99"])
425 AS_COMPILER_FLAG([-Wshadow], [ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow"])
426 AS_COMPILER_FLAG([-Wmissing-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
427 -Wmissing-prototypes"])
428 AS_COMPILER_FLAG([-Wmissing-declarations], [ERROR_CFLAGS="$ERROR_CFLAGS \
429 -Wmissing-declarations"])
430 AS_COMPILER_FLAG([-Wstrict-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
431 -Wstrict-prototypes"])
433 AC_SUBST([ERROR_CFLAGS])
436 AS_IF([test "x$enable_vala" = "xyes"],
437 [ERROR_INTROSPECTION_SCANNER_ARGS="\
438 $ERROR_INTROSPECTION_SCANNER_ARGS --warn-error"
439 ERROR_VALAFLAGS="$ERROR_VALAFLAGS --fatal-warnings"])
441 m4_if(folks_released, [1], [],
443 ERROR_VALAFLAGS="$ERROR_VALAFLAGS -g"
446 AC_SUBST([ERROR_INTROSPECTION_SCANNER_ARGS])
447 AC_SUBST([ERROR_VALAFLAGS])
449 # -----------------------------------------------------------
451 # -----------------------------------------------------------
454 backends/telepathy/lib/folks-telepathy.pc
455 backends/telepathy/lib/folks-telepathy-uninstalled.pc
456 backends/tracker/lib/folks-tracker.pc
457 backends/tracker/lib/folks-tracker-uninstalled.pc
458 backends/eds/lib/folks-eds.pc
459 backends/eds/lib/folks-eds-uninstalled.pc
461 folks/folks-uninstalled.pc
464 backends/key-file/Makefile
465 backends/libsocialweb/Makefile
466 backends/libsocialweb/lib/Makefile
467 backends/libsocialweb/lib/folks-libsocialweb.pc
468 backends/libsocialweb/lib/folks-libsocialweb-uninstalled.pc
469 backends/telepathy/Makefile
470 backends/telepathy/lib/Makefile
471 backends/tracker/Makefile
472 backends/tracker/lib/Makefile
473 backends/eds/Makefile
474 backends/eds/lib/Makefile
480 tests/data/gconf.path
482 tests/key-file/Makefile
483 tests/libsocialweb/Makefile
484 tests/telepathy/Makefile
485 tests/tracker/Makefile
487 tests/lib/folks-test-uninstalled.pc
488 tests/lib/key-file/Makefile
489 tests/lib/libsocialweb/Makefile
490 tests/lib/libsocialweb/session.conf
492 tests/lib/eds/Makefile
493 tests/lib/telepathy/Makefile
494 tests/lib/tracker/Makefile
495 tests/lib/telepathy/contactlist/Makefile
496 tests/lib/telepathy/contactlist/session.conf
499 tools/inspect/Makefile
507 Vala........................: ${enable_vala}
508 Vala Compiler...............: ${VALAC}
509 C Compiler Flags............: ${CFLAGS} ${ERROR_CFLAGS}
510 Prefix......................: ${prefix}
511 Bugreporting URL............: ${PACKAGE_BUGREPORT}
512 Documentation...............: ${have_valadoc}
513 Import tool.................: ${with_import_tool}
514 Inspector tool..............: ${with_inspect_tool}
515 Tracker backend.............: ${enable_tracker_backend}
516 Libsocialweb backend........: ${have_libsocialweb_backend}
517 E-D-S backend...............: ${enable_eds_backend}