configure.ac 87 KB
Newer Older
1 2 3 4
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# This file is part of Tracker.

5
AC_PREREQ([2.64])
6 7 8 9 10 11 12 13 14

# Making releases:
#   TRACKER_MICRO_VERSION += 1;
#   TRACKER_INTERFACE_AGE += 1;
#   TRACKER_BINARY_AGE += 1;
# if any functions have been added, set TRACKER_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set TRACKER_BINARY_AGE and TRACKER_INTERFACE_AGE to 0.
m4_define([tracker_major_version], [0])
15
m4_define([tracker_minor_version], [17])
Martyn Russell's avatar
Martyn Russell committed
16
m4_define([tracker_micro_version], [7])
Martyn Russell's avatar
Martyn Russell committed
17
m4_define([tracker_interface_age], [0])
18 19 20 21 22
m4_define([tracker_binary_age],
          [m4_eval(100 * tracker_minor_version + tracker_micro_version)])
m4_define([tracker_version],
          [tracker_major_version.tracker_minor_version.tracker_micro_version])
# This is the X.Y used in -llibtracker-FOO-X.Y
23
m4_define([tracker_api_version], [1.0])
24

25 26 27 28 29 30 31 32 33
# libtool version related macros
m4_define([tracker_lt_release], [tracker_major_version.tracker_minor_version])
m4_define([tracker_lt_current],
          [m4_eval(100 * tracker_minor_version + tracker_micro_version - tracker_interface_age)])
m4_define([tracker_lt_revision], [tracker_interface_age])
m4_define([tracker_lt_age], [m4_eval(tracker_binary_age - tracker_interface_age)])
m4_define([tracker_lt_current_minus_age],
          [m4_eval(tracker_lt_current - tracker_lt_age)])

34 35 36 37 38 39 40
# Define a string for the earliest version that this release has
# backwards binary compatibility with for all interfaces a module
# might. Unless we add module-only API with lower stability
# guarantees, this should be unchanged until we break binary compat
# for Tracker.
#
# TRACKER_BINARY_VERSION=$TRACKER_MAJOR_VERSION.$TRACKER_MINOR_VERSION.$LT_CURRENT
41
m4_define([tracker_binary_version], [0.18.0])
42

43 44
AC_INIT([tracker],
        [tracker_version],
45
        [http://bugzilla.gnome.org/],
46 47
        [tracker],
        [http://www.tracker-project.org])
48

49
AC_CONFIG_SRCDIR([src/tracker-store/tracker-main.vala])
50 51
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
52

53
AM_INIT_AUTOMAKE([1.11 no-define tar-ustar -Wno-portability])
54

55
AM_SILENT_RULES([yes])
56

57 58 59 60
dnl http://people.gnome.org/~walters/docs/build-api.txt
dnl We don't support srcdir != builddir.
echo \#buildapi-variable-no-builddir >/dev/null

61 62
IDT_COMPILE_WARNINGS

63 64 65 66 67 68 69 70
TRACKER_MAJOR_VERSION=tracker_major_version
TRACKER_MINOR_VERSION=tracker_minor_version
TRACKER_MICRO_VERSION=tracker_micro_version
TRACKER_INTERFACE_AGE=tracker_interface_age
TRACKER_BINARY_AGE=tracker_binary_age
TRACKER_VERSION=tracker_version
TRACKER_API_VERSION=tracker_api_version
TRACKER_BINARY_VERSION=tracker_binary_version
71

72 73 74
dnl Note: this creates TRACKER_API_VERSION_UNDERSCORES and AC_SUBST's it
AX_DOTS_TO_UNDERSCORES(TRACKER_API_VERSION, tracker_api_version)

75 76 77 78 79 80 81 82
AC_SUBST(TRACKER_MAJOR_VERSION)
AC_SUBST(TRACKER_MINOR_VERSION)
AC_SUBST(TRACKER_MICRO_VERSION)
AC_SUBST(TRACKER_INTERFACE_AGE)
AC_SUBST(TRACKER_BINARY_AGE)
AC_SUBST(TRACKER_API_VERSION)
AC_SUBST(TRACKER_VERSION)
AC_SUBST(TRACKER_BINARY_VERSION)
83

84 85 86 87 88 89 90 91 92 93
AC_DEFINE(TRACKER_MAJOR_VERSION, [tracker_major_version],
          [Define to the Tracker major version])
AC_DEFINE(TRACKER_MINOR_VERSION, [tracker_minor_version],
          [Define to the Tracker minor version])
AC_DEFINE(TRACKER_MICRO_VERSION, [tracker_micro_version],
          [Define to the Tracker micro version])
AC_DEFINE(TRACKER_INTERFACE_AGE, [tracker_interface_age],
          [Define to the Tracker interface age])
AC_DEFINE(TRACKER_BINARY_AGE, [tracker_binary_age],
          [Define to the Tracker binary age])
94

95 96 97 98 99 100 101 102 103 104 105 106
# libtool versioning
LT_RELEASE=tracker_lt_release
LT_CURRENT=tracker_lt_current
LT_REVISION=tracker_lt_revision
LT_AGE=tracker_lt_age
LT_CURRENT_MINUS_AGE=tracker_lt_current_minus_age
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_CURRENT_MINUS_AGE)

107 108
# Checks for programs.
AC_PROG_CC
109
AM_PROG_CC_C_O()
110
AC_PROG_CXX
111 112 113 114
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_MAKE_SET

115
GLIB_GSETTINGS
116
GLIB_TESTS
117

118 119 120
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])
121 122 123

# Checks for header files.
AC_HEADER_STDC
124
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h linux/unistd.h sys/statvfs.h])
125

Martyn Russell's avatar
Martyn Russell committed
126
AC_CHECK_HEADER([zlib.h],
127 128
                [],
                [AC_MSG_ERROR([You must have zlib.h and zlib installed])])
129 130 131 132 133 134 135 136

# Can posix_fadvise be used
AC_CHECK_DECLS(posix_fadvise, [], [], [
#define _XOPEN_SOURCE 600
#include <fcntl.h>])

# Checks for functions
AC_CHECK_FUNCS([posix_fadvise])
Ralph Boehme's avatar
Ralph Boehme committed
137
AC_CHECK_FUNCS([getline strnlen])
138

139 140
CFLAGS="$CFLAGS"

141 142 143 144 145 146
# if statvfs64() is available, enable the 64-bit API extensions
AC_CHECK_FUNCS([statvfs64], [have_statvfs64=yes], [have_statvfs64=no])
if test "x$have_statvfs" = "xyes" ; then
   CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
fi

147
# Check for defines we expect
148
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
149 150
#include "stdio.h"
printf ("%s", __FUNCTION__);
151 152 153
   ]])],
   [have_function=yes],
   [have_function=no])
154 155

if test "x$have_function" = "xno" ; then
Martyn Russell's avatar
Martyn Russell committed
156 157 158
   AC_DEFINE(__FUNCTION__,
             __func__,
            [Defined for compilers not supporting __FUNCTION__])
159 160
fi

161 162 163
# Binary required versions
PYTHON_REQUIRED=2.6

164
# Library required versions
165
DBUS_REQUIRED=1.3.1
166
GLIB_REQUIRED=2.38.0
167
PANGO_REQUIRED=1.0.0
Carlos Garnacho's avatar
Carlos Garnacho committed
168
GTK_REQUIRED=3.0.0
169
LIBXML2_REQUIRED=2.6
170
LIBNOTIFY_REQUIRED=0.4.3
171
HAL_REQUIRED=0.5
172
UPOWER_REQUIRED=0.9.0
173
GDKPIXBUF_REQUIRED=2.12.0
174
MEEGOTOUCH_REQUIRED=0.20
175
POPPLER_REQUIRED=0.16.0
176 177
CAIRO_REQUIRED=1.0
GDK_REQUIRED=1.0
178
LIBICU_REQUIRED=4.8.1.1
179 180 181
LIBJPEG_REQUIRED="any version"
LIBGIF_REQUIRED="any version"
LIBTIFF_REQUIRED="any version"
182
LIBVORBIS_REQUIRED=0.22
Iain Holmes's avatar
Iain Holmes committed
183
LIBFLAC_REQUIRED=1.2.1
184
LIBEXIF_REQUIRED=0.6
185
LIBGSF_REQUIRED=1.14.24
Zeeshan Ali's avatar
Zeeshan Ali committed
186
LIBOSINFO_REQUIRED=0.2.9
187
EXEMPI_REQUIRED=2.1.0
188 189 190 191
EVO_REQUIRED=2.32.0
EVO_SHELL_REQUIRED=2.32.0
EDS_REQUIRED=2.32.0
CAMEL_REQUIRED=2.32.0
Martyn Russell's avatar
Martyn Russell committed
192
GEE_REQUIRED=0.3
193
TAGLIB_REQUIRED=1.6
194
LIBGRSS_REQUIRED=0.5
Adrien Bustany's avatar
Adrien Bustany committed
195
REST_REQUIRED=0.6
196
NETWORK_MANAGER_REQUIRED=0.8
197
GSTREAMER_REQUIRED=0.10.31
198
GUPNP_DLNA_REQUIRED=0.9.4
199
LIBPNG_REQUIRED=0.89
Martyn Russell's avatar
Martyn Russell committed
200
LIBMEDIAART_REQUIRED=0.1.0
201

202 203 204 205
# 3.6.11 for sqlite_backup API
# 3.6.16 to fix test failures
# 3.6.17 for shared cache mode with virtual tables
# 3.7.0 for WAL
206 207
# 3.7.9 for FTS4 content= support
SQLITE_REQUIRED=3.7.9
208

209 210
# Needed to generate .gir files,
# see http://live.gnome.org/GnomeGoals/AddGObjectIntrospectionSupport
211
GOBJECT_INTROSPECTION_CHECK([0.9.5])
212

213 214 215
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
AC_SUBST(GLIB_PREFIX)

216 217 218 219 220
# Check for libpng 1.2 or higher
PKG_CHECK_MODULES(LIBPNG, [libpng >= 1.2])
AC_SUBST(LIBPNG_CFLAGS)
AC_SUBST(LIBPNG_LIBS)

Jürg Billeter's avatar
Jürg Billeter committed
221 222 223 224
# Check requirements for gvdb
GVDB_REQUIRED="glib-2.0 >= $GLIB_REQUIRED"
PKG_CHECK_MODULES(GVDB, [$GVDB_REQUIRED])

225 226
# Check requirements for libtracker-bus
LIBTRACKER_BUS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
227
                         gio-unix-2.0 >= $GLIB_REQUIRED"
228

229 230
PKG_CHECK_MODULES(LIBTRACKER_BUS, [$LIBTRACKER_BUS_REQUIRED])

231
# Check requirements for libtracker-common
Martyn Russell's avatar
Martyn Russell committed
232
LIBTRACKER_COMMON_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
233
                            gio-unix-2.0    >= $GLIB_REQUIRED"
234

235 236
PKG_CHECK_MODULES(LIBTRACKER_COMMON, [$LIBTRACKER_COMMON_REQUIRED])

237 238 239 240 241 242
case $host in
  *-*-openbsd*)
    LIBTRACKER_COMMON_LIBS="$LIBTRACKER_COMMON_LIBS -lkvm"
    ;;
esac

243 244 245 246 247 248 249 250 251
# Check requirements for libtracker-data
LIBTRACKER_DATA_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                          gio-unix-2.0 >= $GLIB_REQUIRED
                          sqlite3      >= $SQLITE_REQUIRED
                          uuid"
PKG_CHECK_MODULES(LIBTRACKER_DATA, [$LIBTRACKER_DATA_REQUIRED])

LIBTRACKER_DATA_LIBS="$LIBTRACKER_DATA_LIBS -lz -lm"

252 253
# Check requirements for libtracker-direct
LIBTRACKER_DIRECT_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
254
                            gio-unix-2.0 >= $GLIB_REQUIRED"
255 256 257

PKG_CHECK_MODULES(LIBTRACKER_DIRECT, [$LIBTRACKER_DIRECT_REQUIRED])

258 259
# Check requirements for libtracker-extract
LIBTRACKER_EXTRACT_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
260 261
                             gio-unix-2.0 >= $GLIB_REQUIRED
			     gmodule-2.0  >= $GLIB_REQUIRED"
262 263 264

PKG_CHECK_MODULES(LIBTRACKER_EXTRACT, [$LIBTRACKER_EXTRACT_REQUIRED])

265 266 267 268 269 270 271
# Check requirements for libtracker-fts
LIBTRACKER_FTS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                         gio-unix-2.0 >= $GLIB_REQUIRED
                         sqlite3      >= $SQLITE_REQUIRED"

PKG_CHECK_MODULES(LIBTRACKER_FTS, [$LIBTRACKER_FTS_REQUIRED])

272
# Check requirements for libtracker-miner
Martyn Russell's avatar
Martyn Russell committed
273
LIBTRACKER_MINER_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
274
                           gio-unix-2.0    >= $GLIB_REQUIRED"
275 276 277

PKG_CHECK_MODULES(LIBTRACKER_MINER, [$LIBTRACKER_MINER_REQUIRED])

278 279
# Check requirements for libtracker-sparql
LIBTRACKER_SPARQL_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
280 281
                            gio-unix-2.0 >= $GLIB_REQUIRED
                            uuid"
282 283 284

PKG_CHECK_MODULES(LIBTRACKER_SPARQL, [$LIBTRACKER_SPARQL_REQUIRED])

285 286 287 288 289 290 291
# Check requirements for tracker-control
TRACKER_CONTROL_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                          gio-unix-2.0 >= $GLIB_REQUIRED
                          uuid"

PKG_CHECK_MODULES(TRACKER_CONTROL, [$TRACKER_CONTROL_REQUIRED])

292
TRACKER_RESDUMP_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
293
                          gee-0.8      >= $GEE_REQUIRED"
294 295 296 297 298

PKG_CHECK_MODULES(TRACKER_RESDUMP, [$TRACKER_RESDUMP_REQUIRED],
                  [have_tracker_resdump=yes],
                  [have_tracker_resdump=no])

299 300 301 302 303 304 305 306 307 308
# Check requirements for tracker-store
TRACKER_STORE_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                        gio-unix-2.0 >= $GLIB_REQUIRED
                        gmodule-2.0  >= $GLIB_REQUIRED
                        sqlite3      >= $SQLITE_REQUIRED"

PKG_CHECK_MODULES(TRACKER_STORE, [$TRACKER_STORE_REQUIRED])

TRACKER_STORE_LIBS="$TRACKER_STORE_LIBS -lz -lm"

309
# Check requirements for tracker-extract
Martyn Russell's avatar
Martyn Russell committed
310 311
TRACKER_EXTRACT_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
                          gio-unix-2.0    >= $GLIB_REQUIRED
312
                          gmodule-2.0     >= $GLIB_REQUIRED"
313 314 315

PKG_CHECK_MODULES(TRACKER_EXTRACT, [$TRACKER_EXTRACT_REQUIRED])

316 317 318 319 320 321 322 323
TRACKER_EXTRACT_MODULES_DIR="${libdir}/tracker-${TRACKER_API_VERSION}/extract-modules"
AC_SUBST(TRACKER_EXTRACT_MODULES_DIR)

# NOTE: We don't use ${TRACKER_API_VERSION} because other content like
# the ontology is installed to the same location.
TRACKER_EXTRACT_RULES_DIR="${datadir}/tracker/extract-rules"
AC_SUBST(TRACKER_EXTRACT_RULES_DIR)

324 325 326 327 328
# Check requirements for tracker-extract modules
TRACKER_EXTRACT_MODULES_REQUIRED="glib-2.0     >= $GLIB_REQUIRED"

PKG_CHECK_MODULES(TRACKER_EXTRACT_MODULES, [$TRACKER_EXTRACT_MODULES_REQUIRED])

329 330 331
# Check requirements for tracker-writeback
TRACKER_WRITEBACK_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                            gio-unix-2.0 >= $GLIB_REQUIRED
332
                            gmodule-2.0  >= $GLIB_REQUIRED"
333 334 335

PKG_CHECK_MODULES(TRACKER_WRITEBACK, [$TRACKER_WRITEBACK_REQUIRED])

336 337 338
# Check requirements for tracker-miner-fs
TRACKER_MINER_FS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                           gio-unix-2.0 >= $GLIB_REQUIRED
339
                           gmodule-2.0  >= $GLIB_REQUIRED"
340 341 342 343 344

PKG_CHECK_MODULES(TRACKER_MINER_FS, [$TRACKER_MINER_FS_REQUIRED])

TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS -lz -lm"

345
# Check requirements for tracker-miner-evolution
346 347 348 349 350 351 352 353 354 355
evolution_plugin_name=""

# First test for 3_3_5
TRACKER_MINER_EVOLUTION_3_3_5_REQUIRED="glib-2.0                  >= $GLIB_REQUIRED
                                        evolution-shell-3.0       >= 3.1
                                        evolution-plugin-3.0
                                        libemail-utils
                                        libemail-engine
                                        evolution-data-server-1.2 >= $EDS_REQUIRED
                                        camel-1.2                 >= $CAMEL_REQUIRED"
356

357
PKG_CHECK_MODULES(TRACKER_MINER_EVOLUTION, [$TRACKER_MINER_EVOLUTION_3_3_5_REQUIRED],
358 359 360
                  [have_tracker_miner_evolution=yes],
                  [have_tracker_miner_evolution=no])

361
if test -z "$evolution_plugin_name" && test "x$have_tracker_miner_evolution" = "xyes"; then
362 363
   evolution_plugin_name="evolution-plugin-3.0"

364
   AC_DEFINE(EVOLUTION_SHELL_3_3_5, 1, [Use new evolution-shell API])
365
   AC_DEFINE(EVOLUTION_SHELL_3_2, 1, [Use new evolution-shell API])
366
   AC_DEFINE(EVOLUTION_SHELL_2_91, 1, [Use new evolution-shell API])
367
fi
368

369 370 371 372 373 374
# Second test for 3_2
TRACKER_MINER_EVOLUTION_3_2_REQUIRED="glib-2.0                  >= $GLIB_REQUIRED
                                      evolution-shell-3.0       >= 3.1
                                      evolution-plugin-3.0
                                      evolution-data-server-1.2 >= $EDS_REQUIRED
                                      camel-1.2                 >= $CAMEL_REQUIRED"
375

376 377 378
PKG_CHECK_MODULES(TRACKER_MINER_EVOLUTION, [$TRACKER_MINER_EVOLUTION_3_2_REQUIRED],
                  [have_tracker_miner_evolution=yes],
                  [have_tracker_miner_evolution=no])
379

380 381
if test -z "$evolution_plugin_name" && test "x$have_tracker_miner_evolution" = "xyes"; then
   evolution_plugin_name="evolution-plugin-3.0"
382

383 384 385
   AC_DEFINE(EVOLUTION_SHELL_3_2, 1, [Use new evolution-shell API])
   AC_DEFINE(EVOLUTION_SHELL_2_91, 1, [Use new evolution-shell API])
fi
386

387 388 389 390 391 392
# Third test for 2_91
TRACKER_MINER_EVOLUTION_2_91_REQUIRED="glib-2.0                  >= $GLIB_REQUIRED
                                       evolution-shell-3.0
                                       evolution-plugin-3.0
                                       evolution-data-server-1.2 >= $EDS_REQUIRED
                                       camel-1.2                 >= $CAMEL_REQUIRED"
393

394 395 396
PKG_CHECK_MODULES(TRACKER_MINER_EVOLUTION, [$TRACKER_MINER_EVOLUTION_2_91_REQUIRED],
                  [have_tracker_miner_evolution=yes],
                  [have_tracker_miner_evolution=no])
397

398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
if test -z "$evolution_plugin_name" && test "x$have_tracker_miner_evolution" = "xyes"; then
   evolution_plugin_name="evolution-plugin-3.0"
   AC_DEFINE(EVOLUTION_SHELL_2_91, 1, [Use new evolution-shell API])
fi

# Fourth test others (do we really want support for anything < 3.2)?
TRACKER_MINER_EVOLUTION_LAST_REQUIRED="glib-2.0                  >= $GLIB_REQUIRED
                                       evolution-shell           >= $EVO_SHELL_REQUIRED
                                       evolution-plugin          >= $EVO_REQUIRED
                                       evolution-data-server-1.2 >= $EDS_REQUIRED
                                       camel-1.2                 >= $CAMEL_REQUIRED"

PKG_CHECK_MODULES(TRACKER_MINER_EVOLUTION, [$TRACKER_MINER_EVOLUTION_LAST_REQUIRED],
                  [have_tracker_miner_evolution=yes],
                  [have_tracker_miner_evolution=no])

if test -z "$evolution_plugin_name" && test "x$have_tracker_miner_evolution" = "xyes"; then
   evolution_plugin_name="evolution-plugin"
416 417
fi

418 419 420 421 422 423
# Check requirements for tracker-miner-thunderbird
TRACKER_MINER_THUNDERBIRD_REQUIRED=5.0
have_tracker_miner_thunderbird="no "

AC_PATH_PROG(THUNDERBIRD, thunderbird, thunderbird)
if test -n $THUNDERBIRD; then
424
   thunderbird_version=`$THUNDERBIRD --version | cut -d" " -f3`
425

426 427 428 429
   AX_COMPARE_VERSION([$thunderbird_version], ge, [$TRACKER_MINER_THUNDERBIRD_REQUIRED],
                      have_tracker_miner_thunderbird="yes",
                      have_tracker_miner_thunderbird="no ")
   AC_SUBST(THUNDERBIRD)
430 431
fi

432 433 434 435 436 437 438 439 440 441 442 443 444 445
# Check requirements for tracker-miner-firefox
TRACKER_MINER_FIREFOX_REQUIRED=4.0
have_tracker_miner_firefox="no "

AC_PATH_PROG(FIREFOX, firefox, firefox)
if test -n $FIREFOX; then
   firefox_version=`$FIREFOX --version | cut -d" " -f3`

   AX_COMPARE_VERSION([$firefox_version], ge, [$TRACKER_MINER_FIREFOX_REQUIRED],
                      have_tracker_miner_firefox="yes",
                      have_tracker_miner_firefox="no ")
   AC_SUBST(FIREFOX)
fi

446 447
# Check requirements for tracker-miner-rss
TRACKER_MINER_RSS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
448
                            libgrss-0.5  >= $LIBGRSS_REQUIRED"
449 450 451 452 453

PKG_CHECK_MODULES(TRACKER_MINER_RSS, [$TRACKER_MINER_RSS_REQUIRED],
                  [have_tracker_miner_rss=yes],
                  [have_tracker_miner_rss=no])

454 455
# Check requirements for tracker-utils
TRACKER_UTILS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
Jürg Billeter's avatar
Jürg Billeter committed
456
                        gio-unix-2.0 >= $GLIB_REQUIRED"
457 458 459

PKG_CHECK_MODULES(TRACKER_UTILS, [$TRACKER_UTILS_REQUIRED])

460 461 462 463
# Check requirements for tracker-needle
TRACKER_NEEDLE_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                         gio-unix-2.0 >= $GLIB_REQUIRED
                         gmodule-2.0  >= $GLIB_REQUIRED
Carlos Garnacho's avatar
Carlos Garnacho committed
464
                         gtk+-3.0     >= $GTK_REQUIRED"
465 466 467 468 469

PKG_CHECK_MODULES(TRACKER_NEEDLE, [$TRACKER_NEEDLE_REQUIRED],
                  [have_tracker_needle=yes],
                  [have_tracker_needle=no])

470 471 472 473
# Check requirements for tracker-preferences
TRACKER_PREFERENCES_REQUIRED="glib-2.0       >= $GLIB_REQUIRED
                              gio-unix-2.0   >= $GLIB_REQUIRED
                              gmodule-2.0    >= $GLIB_REQUIRED
474
                              gtk+-3.0       >= $GTK_REQUIRED"
475 476 477 478 479

PKG_CHECK_MODULES(TRACKER_PREFERENCES, [$TRACKER_PREFERENCES_REQUIRED],
                  [have_tracker_preferences=yes],
                  [have_tracker_preferences=no])

480
# Check requirements for Nautilus extension
481
TRACKER_NAUTILUS_EXTENSION_REQUIRED="libnautilus-extension"
482 483 484 485 486

PKG_CHECK_MODULES(TRACKER_NAUTILUS_EXTENSION, [$TRACKER_NAUTILUS_EXTENSION_REQUIRED],
                  [have_tracker_nautilus_extension=yes],
                  [have_tracker_nautilus_extension=no])

487 488 489 490 491
# Check we have Vala valac command we need
AC_PATH_PROG(VALAC, valac, valac)
if test -z $VALAC; then
   AC_MSG_ERROR([Could not find 'valac'])
fi
492

493
AC_SUBST(VALAC)
494

495 496 497
####################################################################
# Check gettext/intltool support
####################################################################
498 499 500 501
IT_PROG_INTLTOOL([0.40.0])

AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])
502

503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext translation domain])

####################################################################
# Check if we should enable GCOV coverage reporting support
####################################################################

AC_ARG_ENABLE(gcov,
              AS_HELP_STRING([--enable-gcov],
                             [enable coverage reporting support [[default=no]]]),,
              [enable_gcov=no])
AM_CONDITIONAL(ENABLE_GCOV, test "x$enable_gcov" != "xno")

if test "x$enable_gcov" != "xno" ; then
  GCOV_VALAFLAGS="-g"
  GCOV_CFLAGS="-ftest-coverage -fprofile-arcs"
  GCOV_LIBS="-lgcov"
521
else
522 523 524
  GCOV_VALAFLAGS=
  GCOV_CFLAGS=
  GCOV_LIBS=
525 526
fi

527 528 529
AC_SUBST(GCOV_VALAFLAGS)
AC_SUBST(GCOV_CFLAGS)
AC_SUBST(GCOV_LIBS)
530

531 532
####################################################################
# General VALAFLAGS/CFLAGS/LIBS
533 534 535
#
# NOTE: BUILD_VALACFLAGS are for the sources built by Vala,
#       not for .vala files themselves.
536
####################################################################
537
BUILD_VALAFLAGS="-g --target-glib=${GLIB_REQUIRED}"
538
BUILD_VALACFLAGS="${WARN_VALACFLAGS} ${GCOV_CFLAGS} -DG_LOG_DOMAIN=\\\"Tracker\\\" -DTRACKER_COMPILATION"
539 540 541 542
BUILD_CFLAGS="${WARN_CFLAGS} ${GCOV_CFLAGS} -DG_LOG_DOMAIN=\\\"Tracker\\\" -DTRACKER_COMPILATION"
BUILD_LIBS="${GCOV_LIBS}"

AC_SUBST(BUILD_VALAFLAGS)
543
AC_SUBST(BUILD_VALACFLAGS)
544 545 546 547
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(BUILD_LIBS)


548 549 550 551 552
####################################################################
# Check for functional-test include/exclude
####################################################################
AC_ARG_ENABLE([functional-tests],
              AS_HELP_STRING([--enable-functional-tests],
553 554
                             [enable functional tests [[default=no]]]),,
              [enable_functional_tests=no])
Jürg Billeter's avatar
Jürg Billeter committed
555

556
if test x$enable_functional_tests != "xno"; then
557 558 559 560 561 562 563 564 565 566
   # Python check, require >= 2.6
   AC_PATH_PROG([PYTHON],[python],[:])
   AS_IF([test "$PYTHON" != ":"],
         [AM_PYTHON_CHECK_VERSION([$PYTHON],[$PYTHON_REQUIRED],[:],[PYTHON=":"])])

   if test "$PYTHON" = ":"; then
      AC_MSG_ERROR([Couldn't find Python >= $PYTHON_REQUIRED (for functional-tests, try --disable-functional-tests).])
   fi

   AC_DEFINE(DIST_FUNCTIONAL_TESTS, 1, [Include functional tests in the installation])
567 568
fi

569
AM_CONDITIONAL(DIST_FUNCTIONAL_TESTS, test "x$enable_functional_tests" != "xno")
570

571
####################################################################
572
# Check for gtk-doc and docbook-tools
573 574
####################################################################

575 576 577
# Check for GTK_DOC_CHECK availability. The GTK_DOC_CHECK invocation
# must be on its own line, gtkdocize relies on it
m4_ifdef([GTK_DOC_CHECK], [
578
GTK_DOC_CHECK([1.8])
579

580 581 582 583 584 585 586
# NOTE: We need to use a separate automake conditional for this
#       to make this work with the tarballs.
AM_CONDITIONAL([ENABLE_GTK_DOC], test "x$enable_gtk_doc" = xyes)
],
[
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
587

588
if test "x$enable_gtk_doc" != xno; then
589 590 591 592 593 594 595
   # Check for graphviz if we are building gtk_doc
   AC_PATH_PROG(GRAPHVIZ_FDP, fdp)
   AC_SUBST(GRAPHVIZ_FDP)

   if test -z "$GRAPHVIZ_FDP"; then
      AC_MSG_ERROR([Couldn't find Graphviz's fdp tool (graphviz).])
   fi
596 597
fi

598
AM_CONDITIONAL(HAVE_GRAPHVIZ_FDP, test -n "$GRAPHVIZ_FDP")
599

600
####################################################################
601
# Check if we should install Windows specific binaries
602 603
####################################################################

604
AC_MSG_CHECKING(for WIN32)
605
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
606 607 608
   #ifndef WIN32
   #error
   #endif
609 610 611
   ]])],
   [native_win32=yes; AC_MSG_RESULT(yes)],
   [native_win32=no; AC_MSG_RESULT(no)])
612

613
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = "yes")
614

615 616 617
if test "$native_win32" = "yes" ; then
   AC_DEFINE(OS_WIN32, 1, [Define if we are on win32])
fi
618

619 620 621 622 623 624 625 626 627 628 629 630
####################################################################
# Check if we should install Maemo/MeeGo specific ontologies
####################################################################

AC_ARG_ENABLE(maemo,
              AS_HELP_STRING([--enable-maemo],
                             [enable maemo ontology [[default=no]]]),
             [enable_maemo="$enableval"],
             [enable_maemo=no])

AM_CONDITIONAL(HAVE_MAEMO, test "x$enable_maemo" = "xyes")

631 632 633 634
if test "x$enable_maemo" = "xyes" ; then
   AC_DEFINE(HAVE_MAEMO, 1, [Define if we enable Maemo specific features])
fi

635 636 637 638 639 640
####################################################################
# Check if we should disable the journal
####################################################################

AC_ARG_ENABLE(journal,
              AS_HELP_STRING([--enable-journal],
641
                             [enable database journal backup mechanism [[default=yes]]]),
642 643 644
             [enable_journal="$enableval"],
             [enable_journal=yes])

645 646 647 648 649 650 651 652
if test "x$enable_journal" != "xno" ; then
   have_tracker_journal="yes"
else
   have_tracker_journal="no  (disabled)"
fi

AM_CONDITIONAL(DISABLE_JOURNAL, test "x$enable_journal" = "xno")

653 654 655 656
if test "x$enable_journal" = "xno" ; then
   AC_DEFINE(DISABLE_JOURNAL, 1, [Define if we disable the journal])
fi

657 658 659 660 661 662 663 664 665 666 667 668 669 670
####################################################################
# Check for SQLite
####################################################################

PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= $SQLITE_REQUIRED])
AC_SUBST(SQLITE3_CFLAGS)
AC_SUBST(SQLITE3_LIBS)

# Make sure SQLite is compiled thread-safe
AX_SQLITE_THREADSAFE
if test "x$ax_cv_sqlite_threadsafe" != "xyes"; then
  AC_MSG_ERROR([sqlite3 is not compiled thread-safe])
fi

671
# Make sure we're not using versions which cause problems.
672
#
673 674
# Avoid versions:
#   3.7.10 - 3.7.13
675 676 677 678 679
#   3.8.1
#
# For details see:
#      https://mail.gnome.org/archives/tracker-list/2012-October/msg00028.html
#      https://mail.gnome.org/archives/tracker-list/2013-November/msg00021.html
680 681 682 683 684 685 686
AC_MSG_CHECKING(whether SQLite3 version is safe)

PKG_CHECK_EXISTS([sqlite3 <= 3.7.9], sqlite_safe=yes, sqlite_safe=no)
if test "x$sqlite_safe" != "xyes"; then
   PKG_CHECK_EXISTS([sqlite3 >= 3.7.14], sqlite_safe=yes, sqlite_safe=no)
fi

687
if test "x$sqlite_safe" = "xyes"; then
688 689 690
   PKG_CHECK_EXISTS([sqlite3 = 3.8.1], sqlite_safe=no, sqlite_safe=yes)
fi

691 692 693 694 695 696
if test "x$sqlite_safe" != "xyes"; then
   AC_MSG_RESULT(no)
else
   AC_MSG_RESULT(yes)
fi

697 698 699 700 701 702 703 704 705 706 707
##################################################################
# Check for tracker-fts, allow disabling FTS support
##################################################################

AC_ARG_ENABLE([tracker-fts],
              AS_HELP_STRING([--enable-tracker-fts],
                             [enable the tracker FTS [[default=auto]]]),,
              [enable_tracker_fts=auto])

if test "x$enable_tracker_fts" != "xno" ; then
   have_tracker_fts="yes"
708
else
709
   have_tracker_fts="no  (disabled)"
710 711
fi

712 713
if test "x$have_tracker_fts" = "xyes"; then
   AC_DEFINE(HAVE_TRACKER_FTS, [1], [Define to 1 if tracker FTS is compiled])
714

715 716 717
   AX_SQLITE_BUILTIN_FTS4
   if test "x$ax_cv_sqlite_builtin_fts4" = "xyes" ; then
      have_builtin_fts4="yes"
718
      AC_DEFINE(HAVE_BUILTIN_FTS, [], [Defined if Sqlite has FTS4 compiled in])
719 720
   else
      have_builtin_fts4="no"
721
   fi
722 723
else
   AC_DEFINE(HAVE_TRACKER_FTS, [0], [Define to 0 if tracker FTS is not compiled])
724
   have_builtin_fts4="disabled"
725 726
fi

727
AM_CONDITIONAL(HAVE_BUILTIN_FTS, test "$have_builtin_fts4" = "yes")
728
AM_CONDITIONAL(HAVE_TRACKER_FTS, test "$have_tracker_fts" = "yes")
729

730
####################################################################
731
# Check for D-Bus requirements
732 733
####################################################################

734
# Check we are not using a different D-Bus services dir
735
AC_ARG_WITH([session_bus_services_dir],
Martyn Russell's avatar
Martyn Russell committed
736
            AS_HELP_STRING([--with-session-bus-services-dir],
737
                           [path to DBus services directory]))
738 739

if test "x$with_session_bus_services_dir" = "x" ; then
740
   services_dir="$datadir/dbus-1/services"
741 742 743 744 745 746 747
else
   services_dir="$with_session_bus_services_dir"
fi

DBUS_SERVICES_DIR="$services_dir"
AC_SUBST(DBUS_SERVICES_DIR)

Martyn Russell's avatar
Martyn Russell committed
748
# Introduced with GSettings
749 750 751
GLIB_MKENUMS=`$PKG_CONFIG glib-2.0 --variable=glib_mkenums`
AC_SUBST(GLIB_MKENUMS)

752
####################################################################
753
# Should we build GLib based unit tests
754 755 756
####################################################################

AC_ARG_ENABLE(unit_tests,
757 758 759
              AS_HELP_STRING([--enable-unit-tests],
                             [enable unit tests [[default=yes]]]), ,
              [enable_unit_tests=yes])
760 761

if test "x$enable_unit_tests" != "xno" ; then
762 763 764 765 766 767 768
   have_unit_tests=yes

   AC_DEFINE(HAVE_UNIT_TEST, 1, [Define if we have GLib unit test framework])

   AC_PATH_PROG(gtester, gtester)
   if test -z $gtester; then
      AC_MSG_ERROR([Could not find 'gtester'])
769
   fi
770 771
else
   have_unit_tests=no
772 773 774 775
fi

AM_CONDITIONAL(HAVE_UNIT_TESTS, test "x$have_unit_tests" = "xyes")

776 777 778
##################################################################
# Check for libtracker-common: upower for battery/power support
##################################################################
779

780 781 782 783
AC_ARG_ENABLE(upower,
              AS_HELP_STRING([--disable-upower],
                             [disable UPower support for AC power detection [[default=auto]]]),,
              [enable_upower=auto])
784

785
AS_IF([test "x$enable_upower" != "xno"], [
786 787 788 789
   PKG_CHECK_MODULES(UPOWER,
                     [upower-glib >= $UPOWER_REQUIRED],
                     [have_upower=yes],
                     [have_upower=no])
790

791 792
   TRACKER_MINER_FS_CFLAGS="$TRACKER_MINER_FS_CFLAGS $UPOWER_CFLAGS"
   TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS $UPOWER_LIBS"
793 794
   save_LIBS=$LIBS
   LIBS=$UPOWER_LIBS
795
   AC_CHECK_FUNCS(up_client_get_on_low_battery)
796
   LIBS=$save_LIBS
797

798 799
   if test "x$have_upower" = "xyes"; then
      AC_DEFINE(HAVE_UPOWER, [], [Define if we have UPOWER])
800
   fi
801
], [
802
   have_upower="no  (disabled)"
803
])
Richard Hughes's avatar
Richard Hughes committed
804

805 806 807
if test "x$enable_upower" = "xyes"; then
   if test "x$have_upower" != "xyes"; then
      AC_MSG_ERROR([Couldn't find upower >= $UPOWER_REQUIRED.])
Richard Hughes's avatar
Richard Hughes committed
808 809 810
   fi
fi

811
AM_CONDITIONAL(HAVE_UPOWER, test "x$have_upower" = "xyes")
Richard Hughes's avatar
Richard Hughes committed
812

813
##################################################################
814
# Check for libtracker-common: hal for battery/power support (old)
815 816 817
##################################################################

AC_ARG_ENABLE(hal,
818 819 820
              AS_HELP_STRING([--disable-hal],
                             [disable HAL support for AC power detection [[default=auto]]]),,
              [enable_hal=auto])
821

822
if test "x$have_upower" != "xyes" && test "x$enable_hal" != "xno"; then
823
   PKG_CHECK_MODULES(HAL,
824 825
                     [dbus-1      >= $DBUS_REQUIRED
                      hal         >= $HAL_REQUIRED],
826 827
                     [have_hal=yes] ,
                     [have_hal=no])
828

829 830
   TRACKER_MINER_FS_CFLAGS="$TRACKER_MINER_FS_CFLAGS $HAL_CFLAGS"
   TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS $HAL_LIBS"
831 832 833 834 835 836 837 838 839

   if test "x$have_hal" = "xyes"; then
      AC_DEFINE(HAVE_HAL, [], [Define if we have HAL])
   fi
else
   have_hal="no  (disabled)"
fi

if test "x$enable_hal" = "xyes"; then
840 841
   if test "x$have_upower" = "xyes"; then
      AC_MSG_ERROR([Only one of UPower and HAL can be used.])
842 843 844 845 846 847 848
   elif test "x$have_hal" != "xyes"; then
      AC_MSG_ERROR([Couldn't find hal >= $HAL_REQUIRED.])
   fi
fi

AM_CONDITIONAL(HAVE_HAL, test "x$have_hal" = "xyes")

849
##################################################################
850 851 852 853 854
# Check for libtracker-data and libtracker-fts: Unicode support
#
# By default, AUTO with this order of preference:
#  1)  libunistring
#  2)  libicu
855 856
##################################################################

857 858
# Check for libunistring...
AC_CHECK_HEADER(uniwbrk.h,
859 860 861 862
                AC_CHECK_LIB([unistring],
                             [u8_wordbreaks],
                             [have_libunistring=yes],
                             [have_libunistring=no]))
863 864
LIBUNISTRING_CFLAGS=""
LIBUNISTRING_LIBS="-lunistring"
865

866 867
# Check for libicu...
PKG_CHECK_MODULES(LIBICU,
868
                  [icu-i18n >= $LIBICU_REQUIRED icu-uc >= $LIBICU_REQUIRED],
869 870
                  [have_libicu=yes],
                  [have_libicu=no])
871

872 873 874
# Configure option
AC_ARG_WITH([unicode-support],
            AS_HELP_STRING([--with-unicode-support],
875
                           [Unicode support library? (libunistring|libicu) [[default=auto]]]),,
876 877 878 879
            [with_unicode_support=auto])

# If auto, decide ourselves
if test "x$with_unicode_support" = "xauto"; then
880 881
   if test "x$have_libicu" = "xyes"; then
      with_unicode_support=libicu
882
   else
883 884
      if test "x$have_libunistring" = "xyes"; then
         with_unicode_support=libunistring
885
      else
886
         AC_MSG_ERROR([Couldn't find either libunistring or libicu])
887
      fi
888 889 890
   fi
fi

891 892
UNICODE_SUPPORT_CFLAGS=
UNICODE_SUPPORT_LIBS=
893

894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917
case "x$with_unicode_support" in
     # Use libunistring
     "xlibunistring")
        UNICODE_SUPPORT_CFLAGS=$LIBUNISTRING_CFLAGS
        UNICODE_SUPPORT_LIBS=$LIBUNISTRING_LIBS
        if test "x$have_libunistring" = "xyes"; then
           AC_DEFINE(HAVE_LIBUNISTRING, [1], [libunistring Unicode support library])
        else
           AC_MSG_ERROR([Couldn't find libunistring])
        fi
     ;;
     # Use libicu
     "xlibicu")
        UNICODE_SUPPORT_CFLAGS=$LIBICU_CFLAGS
        UNICODE_SUPPORT_LIBS=$LIBICU_LIBS
        if test "x$have_libicu" = "xyes"; then
          AC_DEFINE(HAVE_LIBICU, [1], [libicu Unicode support library])
        else
          AC_MSG_ERROR([Couldn't find libicu])
        fi
     ;;
     # Invalid option value
     *) AC_MSG_ERROR([Wrong value for --with-unicode-support: $with_unicode_support]) ;;
esac
918

919 920
AM_CONDITIONAL(HAVE_LIBICU, test "x$have_libicu" = "xyes")

921 922 923
# Add to libtracker-fts
LIBTRACKER_FTS_CFLAGS="$LIBTRACKER_FTS_CFLAGS $UNICODE_SUPPORT_CFLAGS"
LIBTRACKER_FTS_LIBS="$LIBTRACKER_FTS_LIBS $UNICODE_SUPPORT_LIBS"
924

925 926 927
# Add to libtracker-data
LIBTRACKER_DATA_CFLAGS="$LIBTRACKER_DATA_CFLAGS $UNICODE_SUPPORT_CFLAGS"
LIBTRACKER_DATA_LIBS="$LIBTRACKER_DATA_LIBS $UNICODE_SUPPORT_LIBS"
928

929 930 931 932
# Add to libtracker-extract
LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $UNICODE_SUPPORT_CFLAGS"
LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $UNICODE_SUPPORT_LIBS"

933 934
AM_CONDITIONAL(BUILD_LIBUNISTRING_PARSER, test "x$with_unicode_support" = "xlibunistring")
AM_CONDITIONAL(BUILD_LIBICU_PARSER, test "x$with_unicode_support" = "xlibicu")
935 936

##################################################################
937
# Check for libtracker-miner: network-manager for web miners
938 939
##################################################################

940 941 942 943
AC_ARG_ENABLE(network_manager,
              AS_HELP_STRING([--enable-network-manager],
                             [enable NetworkManager support to detect network status [[default=auto]]]),,
              [enable_network_manager=auto])
944

945 946 947 948 949
if test "x$enable_network_manager" != "xno"; then
   PKG_CHECK_MODULES(NETWORK_MANAGER,
                     [libnm-glib >= $NETWORK_MANAGER_REQUIRED],
                     [have_network_manager=yes],
                     [have_network_manager=no])
950

951 952 953 954 955
   LIBTRACKER_MINER_CFLAGS="$LIBTRACKER_MINER_CFLAGS $NETWORK_MANAGER_CFLAGS"
   LIBTRACKER_MINER_LIBS="$LIBTRACKER_MINER_LIBS $NETWORK_MANAGER_LIBS"

   if test "x$have_network_manager" = "xyes"; then
      AC_DEFINE(HAVE_NETWORK_MANAGER, [], [Define if we have NetworkManager for network status detection])
956
   fi
957 958
fi

959 960 961
if test "x$enable_network_manager" = "xyes"; then
   if test "x$have_network_manager" != "xyes"; then
      AC_MSG_ERROR([Couldn't find libnm-glib >= $NETWORK_MANAGER_REQUIRED.])
962
   fi
963 964
fi

965
AM_CONDITIONAL(HAVE_NETWORK_MANAGER, test "x$have_network_manager" = "xyes")
966

967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006
##################################################################
# Check for libtracker-miner, tracker-extract: libmediaart
##################################################################

AC_ARG_ENABLE(libmediaart,
              AS_HELP_STRING([--enable-libmediaart],
                             [enable libmediaart for caching published video/audio art [[default=auto]]]),,
              [enable_libmediaart=auto])

if test "x$enable_libmediaart" != "xno" ; then
   PKG_CHECK_MODULES(LIBMEDIAART,
                     [libmediaart-1.0 >= $LIBMEDIAART_REQUIRED],
                     [have_libmediaart=yes],
                     [have_libmediaart=no])

   LIBTRACKER_MINER_CFLAGS="$LIBTRACKER_MINER_CFLAGS $LIBMEDIAART_CFLAGS"
   LIBTRACKER_MINER_LIBS="$LIBTRACKER_MINER_LIBS $LIBMEDIAART_LIBS"

   TRACKER_EXTRACT_CFLAGS="$TRACKER_EXTRACT_CFLAGS $LIBMEDIAART_CFLAGS"
   TRACKER_EXTRACT_LIBS="$TRACKER_EXTRACT_LIBS $LIBMEDIAART_LIBS"

   # Used for .pc file...
   LIBTRACKER_MINER_PC_REQUIRES="libmediaart-1.0"
   AC_SUBST(LIBTRACKER_MINER_PC_REQUIRES)

   if test "x$have_libmediaart" = "xyes"; then
      AC_DEFINE(HAVE_LIBMEDIAART, [], [Define if we have libmediaart])
   fi
else
   have_libmediaart="no  (disabled)"
fi

if test "x$enable_libmediaart" = "xyes"; then
   if test "x$have_libmediaart" != "xyes"; then
      AC_MSG_ERROR([Couldn't find libmediaart >= $LIBMEDIAART_REQUIRED.])
   fi
fi

AM_CONDITIONAL(HAVE_LIBMEDIAART, test "x$have_libmediaart" = "xyes")

1007 1008 1009
##################################################################
# Check for libtracker-extract: libexif
##################################################################
1010

1011 1012
AC_ARG_ENABLE(libexif,
              AS_HELP_STRING([--enable-libexif],
1013
                             [enable extractor for exif metadata [[default=auto]]]),,
1014
              [enable_libexif=auto])
1015

1016 1017 1018 1019 1020
if test "x$enable_libexif" != "xno" ; then
   PKG_CHECK_MODULES(LIBEXIF,
                     [libexif >= $LIBEXIF_REQUIRED],
                     [have_libexif=yes],
                     [have_libexif=no])
1021

1022 1023
   LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $LIBEXIF_CFLAGS"
   LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $LIBEXIF_LIBS"
1024

1025 1026
   if test "x$have_libexif" = "xyes"; then
      AC_DEFINE(HAVE_LIBEXIF, [], [Define if we have libexif])
1027 1028
   fi
else
1029
   have_libexif="no  (disabled)"
1030 1031
fi

1032 1033 1034
if test "x$enable_libexif" = "xyes"; then
   if test "x$have_libexif" != "xyes"; then
      AC_MSG_ERROR([Couldn't find libexif >= $LIBEXIF_REQUIRED.])
1035 1036 1037
   fi
fi

1038
AM_CONDITIONAL(HAVE_EXIF, test "x$have_libexif" = "xyes")
1039

1040
##################################################################
1041
# Check for libtracker-extract: libiptcdata
1042 1043
##################################################################

1044 1045
AC_ARG_ENABLE(libiptcdata,
              AS_HELP_STRING([--enable-libiptcdata],
1046
                             [enable extractor for iptc metadata [[default=auto]]]),,
1047
              [enable_libiptcdata=auto])
1048

1049 1050 1051 1052 1053
if test "x$enable_libiptcdata" != "xno" ; then
   PKG_CHECK_MODULES(LIBIPTCDATA,
                     [libiptcdata],
                     [have_libiptcdata=yes],
                     [have_libiptcdata=no])
1054

1055 1056
   LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $LIBIPTCDATA_CFLAGS"
   LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $LIBIPTCDATA_LIBS"
1057

1058 1059
   if test "x$have_libiptcdata" = "xyes"; then
      AC_DEFINE(HAVE_LIBIPTCDATA, [], [Define if we have libiptcdata])
1060
   fi
1061 1062
else
   have_libiptcdata="no  (disabled)"
1063 1064
fi

1065 1066 1067 1068 1069
if test "x$enable_libiptcdata" = "xyes"; then
   if test "x$have_libiptcdata" != "xyes"; then
      AC_MSG_ERROR([Couldn't find libiptcdata.])
   fi
fi
1070

1071
AM_CONDITIONAL(HAVE_IPTC, test "x$have_libiptcdata" = "xyes")
1072

1073
##################################################################
1074
# Check for libtracker-extract, tracker-writeback: exempi
1075 1076
##################################################################

1077 1078
AC_ARG_ENABLE(exempi,
              AS_HELP_STRING([--enable-exempi],
1079
                             [enable extractor for XMP metadata [[default=auto]]]),,
1080
              [enable_exempi=auto])
1081

1082 1083 1084 1085 1086 1087 1088 1089
if test "x$enable_exempi" != "xno" ; then
   PKG_CHECK_MODULES(EXEMPI,
                     [exempi-2.0 >= $EXEMPI_REQUIRED],
                     [have_exempi=yes],
                     [have_exempi=no])

   TRACKER_WRITEBACK_CFLAGS="$TRACKER_WRITEBACK_CFLAGS $EXEMPI_CFLAGS"
   TRACKER_WRITEBACK_LIBS="$TRACKER_WRITEBACK_LIBS $EXEMPI_LIBS"
1090

1091 1092
   LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $EXEMPI_CFLAGS"
   LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $EXEMPI_LIBS"
1093

1094 1095
   if test "x$have_exempi" = "xyes"; then
      AC_DEFINE(HAVE_EXEMPI, [], [Define if we have exempi])
1096
   fi
1097 1098
else
   have_exempi="no  (disabled)"
1099 1100
fi