Merge branch 'edsport'
[platform/upstream/folks.git] / configure.ac
1 # If not 1, append datestamp to the version number
2 m4_define([folks_released], [0])
3
4 m4_define([folks_major_version], [0])
5 m4_define([folks_minor_version], [7])
6 m4_define([folks_micro_version], [0])
7 m4_define([folks_nano_version], [1])
8
9 # If library source has changed since last release, increment revision
10 # If public symbols have been added, removed or changed since last release,
11 #  increment current and set revision to 0
12 # If public symbols have been added since last release, increment age
13 # If public symbols have been removed since last release, set age to 0
14 m4_define([folks_lt_current], [33])
15 m4_define([folks_lt_revision], [0])
16 m4_define([folks_lt_age], [8])
17
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)])
24
25 m4_define([folks_maybe_datestamp],
26           m4_if(folks_released, [1],
27                 [], [m4_esyscmd([date +.%Y%m%d | tr -d '\n\r'])]))
28
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)
32
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])])
37
38 AC_PREREQ([2.65])
39 AC_COPYRIGHT([Copyright (C) 2010 Collabora Ltd.])
40
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])
48
49 AC_PROG_CC
50 AM_PROG_CC_C_O
51 AC_DISABLE_STATIC
52 LT_INIT
53 PKG_PROG_PKG_CONFIG([0.21])
54 GLIB_GSETTINGS
55
56 AC_SUBST([CFLAGS])
57 AC_SUBST([CPPFLAGS])
58 AC_SUBST([LDFLAGS])
59
60 LT_CURRENT=folks_lt_current
61 LT_REVISION=folks_lt_revision
62 LT_AGE=folks_lt_age
63 AC_SUBST([LT_CURRENT])
64 AC_SUBST([LT_REVISION])
65 AC_SUBST([LT_AGE])
66
67 FOLKS_MAJOR_MINOR_VERSION=folks_major_minor_version
68 AC_SUBST([FOLKS_MAJOR_MINOR_VERSION])
69
70 API_VERSION=0.6
71 AC_SUBST([API_VERSION])
72
73 AC_ARG_ENABLE(tracker-backend,
74         AC_HELP_STRING([--enable-tracker-backend],
75                        [ build the Tracker backend]),
76         enable_tracker_backend=$enableval,
77         enable_tracker_backend=no )
78
79 AM_CONDITIONAL([ENABLE_TRACKER], [test "x$enable_tracker_backend" = "xyes"])
80
81 if test "x$enable_tracker_backend" = "xyes"; then
82         AC_DEFINE(HAVE_TRACKER, [1],
83                   [Define as 1 if you have the Tracker backend])
84 else
85         AC_DEFINE(HAVE_TRACKER, [0],
86                   [Define as 1 if you have the Tracker backend])
87 fi
88
89 AC_ARG_ENABLE(eds-backend,
90         AC_HELP_STRING([--enable-eds-backend],
91                        [ build the E-D-S backend]),
92         enable_eds_backend=$enableval,
93         enable_eds_backend=yes )
94
95 if test "x$enable_eds_backend" = "xyes"; then
96         AC_DEFINE(HAVE_EDS, [1], [Define as 1 if you have the eds backend])
97 else
98         AC_DEFINE(HAVE_EDS, [0], [Define as 1 if you have the eds backend])
99 fi
100
101
102 AM_CONDITIONAL([ENABLE_EDS], [test "x$enable_eds_backend" = "xyes"])
103
104
105 AC_ARG_ENABLE(zeitgeist,
106         AC_HELP_STRING([--enable-zeitgeist],
107                        [ build the Zeitgeist]),
108         enable_zeitgeist=$enableval,
109         enable_zeitgeist=no )
110
111 AM_CONDITIONAL([ENABLE_ZEITGEIST], [test "x$enable_zeitgeist" = "xyes"])
112
113 if test "x$enable_zeitgeist" = "xyes"; then
114         AC_DEFINE(HAVE_ZEITGEIST, [1],
115                   [Define as 1 if you have the Zeitgeist support])
116 else
117         AC_DEFINE(HAVE_ZEITGEIST, [0],
118                   [Define as 1 if you have the Zeitgeist support])
119 fi
120
121
122 # Automatically check the dependencies for the libsocialweb backend
123 SW_CLIENT_REQUIRED=0.25.20
124 AC_ARG_ENABLE(libsocialweb-backend,
125         AC_HELP_STRING([--enable-libsocialweb-backend=@<:@no/yes/auto@:>@],
126                        [build the Libsocialweb backend (default: auto)]),
127         enable_libsocialweb_backend=$enableval,
128         enable_libsocialweb_backend=auto )
129
130 # this may be overwritten farther down
131 AC_DEFINE(HAVE_LIBSOCIALWEB, [0],
132           [Define as 1 if you have the libsocialweb backend])
133 if test "x$enable_libsocialweb_backend" != "xno"; then
134   PKG_CHECK_MODULES([SW_CLIENT], [libsocialweb-client >= $SW_CLIENT_REQUIRED],
135       have_libsocialweb_backend="yes", have_libsocialweb_backend="no")
136   if test "x$have_libsocialweb_backend" = "xyes" -a \
137           "x$enable_vala" = "xyes"; then
138     VALA_CHECK_PACKAGES([telepathy-glib
139                          gio-2.0
140                          gee-1.0
141                          libsocialweb-client],
142         ,
143         have_libsocialweb_backend="no")
144   fi
145
146   if test "x$have_libsocialweb_backend" = "xyes"; then
147     AC_DEFINE(HAVE_LIBSOCIALWEB, [1],
148               [Define if you have the libsocialweb backend])
149   fi
150 else
151    have_libsocialweb_backend=no
152 fi
153
154 if test "x$enable_libsocialweb_backend" = "xyes" -a \
155   "x$have_libsocialweb_backend" != "xyes"; then
156     AC_MSG_ERROR([Cannot find libsocialweb dependencies.])
157 fi
158
159 AM_CONDITIONAL([ENABLE_LIBSOCIALWEB],
160         [test "x$have_libsocialweb_backend" = "xyes"])
161
162 # -----------------------------------------------------------
163 # Dependencies
164 # -----------------------------------------------------------
165
166 GLIB_REQUIRED=2.26.0
167 VALA_REQUIRED=0.15.2
168 VALADOC_REQUIRED=0.3.1
169 TRACKER_SPARQL_MAJOR=0.14
170 TRACKER_SPARQL_REQUIRED=0.13.1
171 EBOOK_REQUIRED=3.5.3
172 EDATASERVER_REQUIRED=3.5.3
173 ZEITGEIST_REQUIRED=0.3.14
174
175 AC_SUBST([TRACKER_SPARQL_MAJOR])
176
177 PKG_CHECK_MODULES([GLIB],
178                   [glib-2.0 >= $GLIB_REQUIRED
179                    gobject-2.0 >= $GLIB_REQUIRED])
180 PKG_CHECK_MODULES([GMODULE], [gmodule-no-export-2.0])
181 PKG_CHECK_MODULES([GIO], [gio-2.0 >= $GLIB_REQUIRED])
182 PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
183
184 # FIXME: We depend on libgee < 0.7 because 0.7 breaks API. bgo#627746
185 PKG_CHECK_MODULES([GEE], [gee-1.0 < 0.7],
186                   have_gee_0_6_x="yes",
187                   have_gee_0_6_x="no")
188
189 if test "x$have_gee_0_6_x" != "xyes"; then
190     AC_MSG_ERROR([
191 Gee 0.6.x required but not installed.
192
193 Note that Gee 0.8.x provides gee-0.8 (but gee-1.0 is, confusingly, provided by
194 Gee 0.6.x)])
195 fi
196
197 TP_GLIB_REQUIRED=0.19.0
198 PKG_CHECK_MODULES([TP_GLIB], [telepathy-glib >= $TP_GLIB_REQUIRED])
199
200 # Ignore post 0.20 deprecations
201 TP_GLIB_CFLAGS="$TP_GLIB_CFLAGS -DTP_VERSION_MIN_REQUIRED=TP_VERSION_0_20"
202 # Prevent post 0.20 APIs
203 TP_GLIB_CFLAGS="$TP_GLIB_CFLAGS -DTP_VERSION_MAX_ALLOWED=TP_VERSION_0_20"
204
205 if test x$enable_tracker_backend = xyes; then
206         PKG_CHECK_MODULES([TRACKER_SPARQL],
207                           [tracker-sparql-$TRACKER_SPARQL_MAJOR >= \
208                            $TRACKER_SPARQL_REQUIRED])
209 fi
210
211 if test x$enable_eds_backend = xyes; then
212         PKG_CHECK_MODULES([EBOOK], [libebook-1.2 >= $EBOOK_REQUIRED])
213         PKG_CHECK_MODULES([EDATASERVER], [libedataserver-1.2 >= $EDATASERVER_REQUIRED])
214 fi
215
216 if test x$enable_zeitgeist = xyes; then
217         PKG_CHECK_MODULES([ZEITGEIST], [zeitgeist-1.0 >= $ZEITGEIST_REQUIRED])
218 fi
219
220 #
221 # Vala building options -- allows tarball builds without installing Vala
222 #
223 AC_ARG_ENABLE([vala],
224               AS_HELP_STRING([--enable-vala],
225                              [Enable building from the Vala sources]),
226               [enable_vala=$enableval],
227               [enable_vala=no])
228
229 # will be re-set as necessary below
230 AM_CONDITIONAL([HAVE_INTROSPECTION], [test "x$enable_vala" = "xyes"])
231 sd=${srcdir}/
232
233 # Force Vala for non-release builds
234 m4_if(folks_released, [1], [],
235     [
236         enable_vala=yes
237         echo "Vala compiler required for non-release builds; requiring Vala..."
238     ])
239
240 # Force Vala if generated source is missing or outdated
241 if test \
242         ! -e ${sd}tools/folks_import_vala.stamp -o \
243         ! -e ${sd}tests/folks/abstract_field_details_vala.stamp -o \
244         ! -e ${sd}tests/folks/aggregation_vala.stamp -o \
245         ! -e ${sd}tests/folks/backend_loading_vala.stamp -o \
246         ! -e ${sd}tests/key-file/individual_retrieval_vala.stamp -o \
247         ! -e ${sd}tests/lib/folks-test.vapi -o \
248         ! -e ${sd}tests/lib/key-file/kf-test.vapi -o \
249         ! -e ${sd}tests/lib/key-file/libkf_test_la_vala.stamp -o \
250         ! -e ${sd}tests/lib/telepathy/contactlist/tp-test-contactlist.gir -o \
251         ! -e ${sd}tests/lib/telepathy/contactlist/tp-test-contactlist.vapi -o \
252         ! -e ${sd}tests/lib/libfolks_test_la_vala.stamp -o \
253         ! -e ${sd}tests/telepathy/persona_store_capabilities_vala.stamp -o \
254         ! -e ${sd}tests/telepathy/individual_retrieval_vala.stamp -o \
255         ! -e ${sd}tests/telepathy/individual_properties_vala.stamp -o \
256         ! -e ${sd}tests/folks/backend_loading_vala.stamp -o \
257         ! -e ${sd}backends/key-file/key_file_la_vala.stamp -o \
258         ! -e ${sd}backends/telepathy/telepathy_la_vala.stamp \
259                 -o \
260         ! -e ${sd}backends/telepathy/lib/folks-telepathy.vapi -o \
261         ! -e ${sd}backends/telepathy/lib/tp-lowlevel.gir -o \
262         ! -e ${sd}backends/telepathy/lib/tp-lowlevel.vapi -o \
263         ! -e ${sd}backends/telepathy/lib/libfolks_telepathy_la_vala.stamp -o \
264         ! -e ${sd}folks/folks-internal.h -o \
265         ! -e ${sd}folks/folks-internal.vapi -o \
266         ! -e ${sd}folks/libfolks_internal_la_vala.stamp -o \
267         ! -e ${sd}folks/folks.vapi -o \
268         ! -e ${sd}folks/libfolks_la_vala.stamp ; then
269         enable_vala=yes
270         echo "Vala source needs to be re-compiled; requiring Vala..."
271 fi
272
273 if test "x$enable_vala" = "xyes" ; then
274         AM_PROG_VALAC([$VALA_REQUIRED])
275         if test "x$VALAC" = "x"; then
276               AC_MSG_ERROR([Vala requested but valac is not installed])
277         fi
278
279         AC_PATH_PROG([VAPIGEN], [vapigen], [])
280         if test "x$VAPIGEN" = "x"; then
281               AC_MSG_ERROR([Vala must be built with --enable-vapigen])
282         fi
283
284         # require GLib >= 2.24 so GLib.Array, etc. reffing is handled
285         # automatically
286         VALAFLAGS="$VALAFLAGS --target-glib=2.24"
287         AC_SUBST([VALAFLAGS])
288         AC_SUBST([VAPIGENFLAGS])
289         AC_SUBST([VAPIDIR])
290
291         VALA_CHECK_PACKAGES([telepathy-glib
292                              gio-2.0
293                              gee-1.0])
294
295         if test x$enable_tracker_backend = xyes; then
296           VALA_CHECK_PACKAGES([tracker-sparql-$TRACKER_SPARQL_MAJOR])
297         fi
298
299         if test x$enable_eds_backend = xyes; then
300           VALA_CHECK_PACKAGES([libebook-1.2 libedataserver-1.2 libxml-2.0])
301         fi
302
303         if test x$enable_zeitgeist = xyes; then
304           VALA_CHECK_PACKAGES([zeitgeist-1.0])
305         fi
306
307 fi
308
309 # this will set HAVE_INTROSPECTION
310 GOBJECT_INTROSPECTION_REQUIRE([1.30])
311
312 AM_CONDITIONAL([HAVE_VALA], [test "x$enable_vala" = "xyes"])
313
314 # Various functions that we need (used in C code generated from Vala)
315 AC_CHECK_FUNCS([memset])
316 AC_CHECK_FUNCS([strstr])
317
318 # -----------------------------------------------------------
319 # Backends
320 # -----------------------------------------------------------
321
322 FOLKS_MODULE_VERSION=folks_module_version
323 AC_SUBST([FOLKS_MODULE_VERSION])
324 AC_DEFINE([MODULE_VERSION], "folks_module_version", [Module interface version])
325
326 BACKEND_DIR='$(libdir)/folks/$(FOLKS_MODULE_VERSION)/backends'
327 AC_SUBST([BACKEND_DIR])
328
329 BACKEND_KF='$(top_builddir)/backends/key-file/.libs/key-file.so'
330 AC_SUBST([BACKEND_KF])
331 BACKEND_TP='$(top_builddir)/backends/telepathy/.libs/telepathy.so'
332 AC_SUBST([BACKEND_TP])
333
334 if test x$have_libsocialweb_backend = xyes; then
335   BACKEND_LIBSOCIALWEB='$(top_builddir)/backends/libsocialweb/.libs/libsocialweb.so'
336   AC_SUBST([BACKEND_LIBSOCIALWEB])
337 fi
338
339 if test x$enable_tracker_backend = xyes; then
340   BACKEND_TRACKER='$(top_builddir)/backends/tracker/.libs/tracker.so'
341   AC_SUBST([BACKEND_TRACKER])
342 fi
343
344 if test x$enable_eds_backend = xyes; then
345   BACKEND_EDS='$(top_builddir)/backends/eds/.libs/eds.so'
346   AC_SUBST([BACKEND_EDS])
347 fi
348
349 # All of the backend libraries in our tree; to be used by the tests
350 BACKEND_UNINST_PATH='$(BACKEND_KF):$(BACKEND_TP)'
351 if test x$have_libsocialweb_backend = xyes; then
352   LIBSOCIALWEB_BACKEND_UNINST_PATH='$(BACKEND_LIBSOCIALWEB)'
353   BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$LIBSOCIALWEB_BACKEND_UNINST_PATH"
354 fi
355 if test x$enable_tracker_backend = xyes; then
356   TRACKER_BACKEND_UNINST_PATH='$(BACKEND_TRACKER)'
357   BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$TRACKER_BACKEND_UNINST_PATH"
358 fi
359 if test x$enable_eds_backend = xyes; then
360   EDS_BACKEND_UNINST_PATH='$(BACKEND_EDS)'
361   BACKEND_UNINST_PATH="$BACKEND_UNINST_PATH:$EDS_BACKEND_UNINST_PATH"
362 fi
363 AC_SUBST([BACKEND_UNINST_PATH])
364
365 # -----------------------------------------------------------
366 # Tools
367 # -----------------------------------------------------------
368
369 AC_ARG_ENABLE([import-tool],
370               AS_HELP_STRING([--enable-import-tool],
371                              [Enable building the meta-contact import tool]),
372               [enable_import_tool=$enableval with_import_tool=$enableval],
373               [enable_import_tool=maybe with_import_tool=no])
374 AS_IF([test "$enable_import_tool" != "no"],
375       [PKG_CHECK_MODULES([LIBXML], [libxml-2.0],
376                          [with_import_tool=yes], [with_import_tool=no])])
377 AS_IF([test "$enable_import_tool" = "yes" -a "$with_import_tool" = "no"],
378       [AC_MSG_ERROR([Import tool explicitly enabled, but libxml2 not found])])
379 AM_CONDITIONAL([ENABLE_IMPORT_TOOL], [test "$with_import_tool" = "yes"])
380
381 # Readline's required for the folks-inspect program
382 AC_ARG_ENABLE([inspect-tool],
383               AS_HELP_STRING([--enable-inspect-tool],
384                              [Enable building the data inspection tool]),
385               [enable_inspect_tool=$enableval with_inspect_tool=$enableval],
386               [enable_inspect_tool=maybe with_inspect_tool=no])
387 AS_IF([test "$enable_inspect_tool" = "yes" -a "$enable_vala" != "yes"],
388       [AC_MSG_ERROR([Inspect tool explicitly enabled, but Vala wasn't enabled \
389                      using --enable-vala])])
390 AS_IF([test "$enable_inspect_tool" = "maybe" -a "$enable_vala" != "yes"],
391       [AC_MSG_NOTICE([Inspect tool disabled, as Vala wasn't enabled using \
392                       --enable-vala])])
393 AS_IF([test "$enable_inspect_tool" != "no" -a "x$enable_vala" = "xyes"],
394       [AC_CHECK_LIB([readline], [main],
395                     [with_inspect_tool=yes], [with_inspect_tool=no],
396                     [-lncurses])])
397 AS_IF([test "$enable_inspect_tool" != "no" -a "$with_inspect_tool" = "yes" -a \
398        "x$enable_vala" = "xyes"],
399       [VALA_CHECK_PACKAGES([readline])
400        LIBREADLINE="-lreadline -lncurses"
401        AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline])
402        AC_SUBST([LIBREADLINE])])
403 AS_IF([test "$enable_inspect_tool" = "yes" -a "$with_inspect_tool" = "no"],
404       [AC_MSG_ERROR([Inspect tool explicitly enabled, but readline not found])])
405 AM_CONDITIONAL([ENABLE_INSPECT_TOOL], [test "$with_inspect_tool" = "yes"])
406
407 # -----------------------------------------------------------
408 # Documentation
409 # -----------------------------------------------------------
410
411 AC_ARG_ENABLE([docs],
412               AS_HELP_STRING([--enable-docs],[Enable documentation generation]),
413               [enable_docs=$enableval], [enable_docs=no])
414 AM_CONDITIONAL([ENABLE_DOCS], [test x$enable_docs = xyes])
415
416 have_valadoc=no
417 if test x$enable_docs = xyes; then
418   # make sure the library is new enough and the program exists
419   PKG_CHECK_MODULES([VALADOC], [valadoc-1.0 >= $VALADOC_REQUIRED])
420   AC_PATH_PROG([VALADOC], [valadoc], [:])
421   AS_IF([test "$VALADOC" != :], have_valadoc=yes)
422 fi
423 AM_CONDITIONAL([HAVE_VALADOC], [test x$have_valadoc = xyes])
424
425 if test "x$enable_docs" = "xyes" -a "x$have_valadoc" != "xyes"; then
426     AC_MSG_ERROR([Doc building requested but valadoc not installed.])
427 fi
428
429 # -----------------------------------------------------------
430 # Gettext
431 # -----------------------------------------------------------
432
433 GETTEXT_PACKAGE=AC_PACKAGE_NAME
434 AC_SUBST(GETTEXT_PACKAGE)
435 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
436 IT_PROG_INTLTOOL([0.50.0])
437
438 # -----------------------------------------------------------
439 # Error flags
440 # -----------------------------------------------------------
441
442 # Disable GLib deprecation warnings for now (#670196); GValueArray is deprecated
443 # but we need it for dbus-glib. Porting to GDBus will solve this (#653198)
444 AC_DEFINE(GLIB_DISABLE_DEPRECATION_WARNINGS, 1, [Build with GLib deprecated])
445
446 AS_COMPILER_FLAG([-Wall], [ERROR_CFLAGS="-Wall"], [ERROR_CFLAGS=""])
447 AS_COMPILER_FLAG([-Werror], [werror=yes], [werror=no])
448
449 AC_ARG_ENABLE([debug],
450               AS_HELP_STRING([--disable-debug],[compile without debug code]),
451               [enable_debug=$enableval], [enable_debug=yes])
452
453 AC_ARG_ENABLE([Werror],
454               AS_HELP_STRING([--disable-Werror],
455                              [compile without -Werror (normally enabled in
456                               development builds)]),
457               [werror=$enableval], [werror=yes])
458
459 AS_COMPILER_FLAG([-Wextra], [wextra=yes], [wextra=no])
460 AS_COMPILER_FLAG([-Wno-missing-field-initializers],
461                  [wno_missing_field_initializers=yes],
462                  [wno_missing_field_initializers=no])
463 AS_COMPILER_FLAG([-Wno-unused-parameter],
464                  [wno_unused_parameter=yes], [wno_unused_parameter=no])
465
466 m4_if(folks_released, [1], [],
467     [
468         if test x$werror = xyes; then
469             ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
470         fi
471         if test x$wextra = xyes -a \
472             x$wno_missing_field_initializers = xyes -a \
473             x$wno_unused_parameter = xyes; then
474             ERROR_CFLAGS="$ERROR_CFLAGS -Wextra \
475                 -Wno-missing-field-initializers -Wno-unused-parameter"
476         fi
477     ])
478
479 AS_COMPILER_FLAG([-D_POSIX_SOURCE], [ERROR_CFLAGS="$ERROR_CFLAGS -D_POSIX_SOURCE"])
480 AS_COMPILER_FLAG([-std=c99], [ERROR_CFLAGS="$ERROR_CFLAGS -std=c99"])
481 AS_COMPILER_FLAG([-Wshadow], [ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow"])
482 AS_COMPILER_FLAG([-Wmissing-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
483                                           -Wmissing-prototypes"])
484 AS_COMPILER_FLAG([-Wmissing-declarations], [ERROR_CFLAGS="$ERROR_CFLAGS \
485                                             -Wmissing-declarations"])
486 AS_COMPILER_FLAG([-Wstrict-prototypes], [ERROR_CFLAGS="$ERROR_CFLAGS \
487                                          -Wstrict-prototypes"])
488
489 AC_SUBST([ERROR_CFLAGS])
490
491 # -----------------------------------------------------------
492 # Code coverage flags
493 # -----------------------------------------------------------
494
495 AC_ARG_ENABLE([code-coverage],
496               AS_HELP_STRING([--enable-code-coverage],
497                              [compile with code coverage code]),
498               [enable_code_coverage=$enableval], [enable_code_coverage=no])
499
500 # Only enable code coverage if this isn't a release.
501 m4_if(folks_released, [1], [],
502     [
503         if test "x$GCC" = "xyes"; then
504             if test "x$enable_code_coverage" = "xyes"; then
505                 CODE_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage -O0 -ggdb"
506                 CODE_COVERAGE_LDFLAGS="-lgcov"
507             fi
508         fi
509     ])
510
511 AC_SUBST([CODE_COVERAGE_CFLAGS])
512 AC_SUBST([CODE_COVERAGE_LDFLAGS])
513
514 # Vala-related flags
515 AC_ARG_ENABLE([fatal-warnings],
516               AS_HELP_STRING([--disable-fatal-warnings],
517                              [Make warnings from valac and g-ir-scanner non-fatal]),
518               [enable_fatal_warnings=$enableval], [enable_fatal_warnings=yes])
519 AS_IF([test "x$enable_vala" = "xyes" && test "x$enable_fatal_warnings" = "xyes"],
520       [ERROR_INTROSPECTION_SCANNER_ARGS="\
521                         $ERROR_INTROSPECTION_SCANNER_ARGS --warn-error"
522        ERROR_VALAFLAGS="$ERROR_VALAFLAGS --fatal-warnings"])
523
524 # Disable -g if we're building with code coverage enabled, since Vala's
525 # insertion of #line directives into .c files confuses lcov. For the moment,
526 # we'll have to do with looking at code coverage of the generated C files only.
527 # We set the debug flags in CODE_COVERAGE_CFLAGS instead in that case.
528 m4_if(folks_released, [1], [],
529     [
530         if test "x$enable_code_coverage" != "xyes" -o "x$GCC" != "xyes"; then
531             ERROR_VALAFLAGS="$ERROR_VALAFLAGS -g"
532         fi
533     ])
534
535 AC_SUBST([ERROR_INTROSPECTION_SCANNER_ARGS])
536 AC_SUBST([ERROR_VALAFLAGS])
537
538 # -----------------------------------------------------------
539 # Final output
540 # -----------------------------------------------------------
541
542 # FIXME: We can't remove gconf.path until bgo#635379 is fixed, since we need to
543 # safely contain EDS' use of GConf for the EDS backend tests.
544 # Note that our use of gconf.path doesn't actually need GConf to be installed,
545 # though, so it's not a hard dependency of folks.
546
547 AC_CONFIG_FILES([
548     backends/telepathy/lib/folks-telepathy.pc
549     backends/telepathy/lib/folks-telepathy-uninstalled.pc
550     backends/tracker/lib/folks-tracker.deps
551     backends/tracker/lib/folks-tracker.pc
552     backends/tracker/lib/folks-tracker-uninstalled.pc
553     backends/eds/lib/folks-eds.pc
554     backends/eds/lib/folks-eds-uninstalled.pc
555     folks/folks.pc
556     folks/folks-uninstalled.pc
557     folks/org.freedesktop.folks.gschema.xml
558     Makefile
559     backends/Makefile
560     backends/key-file/Makefile
561     backends/libsocialweb/Makefile
562     backends/libsocialweb/lib/Makefile
563     backends/libsocialweb/lib/folks-libsocialweb.pc
564     backends/libsocialweb/lib/folks-libsocialweb-uninstalled.pc
565     backends/telepathy/Makefile
566     backends/telepathy/lib/Makefile
567     backends/tracker/Makefile
568     backends/tracker/lib/Makefile
569     backends/eds/Makefile
570     backends/eds/lib/Makefile
571     folks/Makefile
572     docs/Makefile
573     po/Makefile.in
574     tests/Makefile
575     tests/data/Makefile
576     tests/data/gconf.path
577     tests/folks/Makefile
578     tests/key-file/Makefile
579     tests/libsocialweb/Makefile
580     tests/telepathy/Makefile
581     tests/tracker/Makefile
582     tests/lib/Makefile
583     tests/lib/folks-test-uninstalled.pc
584     tests/lib/key-file/Makefile
585     tests/lib/libsocialweb/Makefile
586     tests/lib/libsocialweb/session.conf
587     tests/eds/Makefile
588     tests/lib/eds/Makefile
589     tests/lib/telepathy/Makefile
590     tests/lib/tracker/Makefile
591     tests/lib/telepathy/contactlist/Makefile
592     tests/lib/telepathy/contactlist/session.conf
593     tests/tools/Makefile
594     tools/Makefile
595     tools/inspect/Makefile
596 ])
597
598 AC_OUTPUT
599
600 echo "
601 Configure summary:
602
603         Vala........................:  ${enable_vala}
604         Vala Compiler...............:  ${VALAC}
605         C Compiler Flags............:  ${CFLAGS} ${ERROR_CFLAGS} ${CODE_COVERAGE_CFLAGS}
606         Linker Flags................:  ${LDFLAGS} ${CODE_COVERAGE_LDFLAGS}
607         Prefix......................:  ${prefix}
608         Bugreporting URL............:  ${PACKAGE_BUGREPORT}
609         Documentation...............:  ${have_valadoc}
610         Import tool.................:  ${with_import_tool}
611         Inspector tool..............:  ${with_inspect_tool}
612         Tracker backend.............:  ${enable_tracker_backend}
613         Libsocialweb backend........:  ${have_libsocialweb_backend}
614         E-D-S backend...............:  ${enable_eds_backend}
615         Zeitgeist support...........:  ${enable_zeitgeist}
616
617 "