configure.ac 79.1 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

# 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.
Martyn Russell's avatar
Martyn Russell committed
14
m4_define([tracker_major_version], [1])
Carlos Garnacho's avatar
Carlos Garnacho committed
15
m4_define([tracker_minor_version], [99])
Carlos Garnacho's avatar
Carlos Garnacho committed
16
m4_define([tracker_micro_version], [0])
Carlos Garnacho's avatar
Carlos Garnacho 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
Carlos Garnacho's avatar
Carlos Garnacho committed
23
m4_define([tracker_api_version], [2.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], [1.0.0])
42

43 44
AC_INIT([tracker],
        [tracker_version],
45
        [http://bugzilla.gnome.org/enter_bug.cgi?product=tracker],
46
        [tracker],
47
        [https://wiki.gnome.org/Projects/Tracker])
48

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

54 55 56 57
# Available since autoconf 2.60, implies _GNU_SOURCE and extensions if available.
# See: https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Posix-Variants.html
AC_USE_SYSTEM_EXTENSIONS

58 59 60 61 62 63
# Adding the 'subdir-objects' Automake option here will fix some Automake
# warnings, but it will also break the build. I believe that it triggers
# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928>. That bug will
# be fixed in Automake 1.16, so we should be eventually able to use
# 'subdir-objects' (which is apparently will be on by default in Automake 2.0),
# but we'll need to require Automake 1.16 before we can do so.
64
AM_INIT_AUTOMAKE([1.11 no-define tar-ustar -Wno-portability no-dist-gzip dist-xz])
65

66 67
AC_PROG_LIBTOOL

68
AM_SILENT_RULES([yes])
69

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

74 75
IDT_COMPILE_WARNINGS

76 77 78 79 80 81 82 83
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
84

85 86 87
dnl Note: this creates TRACKER_API_VERSION_UNDERSCORES and AC_SUBST's it
AX_DOTS_TO_UNDERSCORES(TRACKER_API_VERSION, tracker_api_version)

88 89 90 91 92 93 94 95
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)
96

97 98 99 100 101 102 103 104 105 106
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])
107

108 109 110 111 112 113 114 115 116 117 118 119
# 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)

120
# Checks for programs.
121
AC_PROG_CXX
122 123 124
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
125
AC_PROG_INSTALL
126
AC_PROG_LN_S
127 128
AC_PROG_MAKE_SET

129 130 131
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])
132

133
AC_CHECK_HEADERS([fcntl.h float.h inttypes.h limits.h locale.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/statfs.h sys/statvfs.h sys/time.h unistd.h])
134

Martyn Russell's avatar
Martyn Russell committed
135
AC_CHECK_HEADER([zlib.h],
136 137
                [],
                [AC_MSG_ERROR([You must have zlib.h and zlib installed])])
138

139 140 141 142 143 144 145 146 147 148 149 150
AC_HEADER_STDC

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T

151 152 153 154 155 156 157
# 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
158
AC_CHECK_FUNCS([getline strnlen])
159

160 161 162 163 164 165 166 167
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STRNLEN
AC_FUNC_STRTOD
AC_CHECK_FUNCS([alarm ftruncate memchr memmove memset modf munmap setlocale sqrt strcasecmp strchr strcspn strndup strrchr strstr strtoul strtoull tzset])
168

169 170 171 172 173 174
# 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

175
# Check for defines we expect
176
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
177 178
#include "stdio.h"
printf ("%s", __FUNCTION__);
179 180 181
   ]])],
   [have_function=yes],
   [have_function=no])
182 183

if test "x$have_function" = "xno" ; then
Martyn Russell's avatar
Martyn Russell committed
184 185 186
   AC_DEFINE(__FUNCTION__,
             __func__,
            [Defined for compilers not supporting __FUNCTION__])
187 188
fi

189 190 191 192 193 194
case $host in
    *-*-linux*)
        tracker_os_linux=yes
        ;;
esac

195 196 197 198 199 200 201 202 203 204 205
# Remember CFLAGS upon entering configure...
CFLAGS="$CFLAGS"

# Initialize GLib
GLIB_GSETTINGS
GLIB_TESTS

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])

206 207 208
# Binary required versions
PYTHON_REQUIRED=2.6

209
# Library required versions
210
DBUS_REQUIRED=1.3.1
Sam Thursfield's avatar
Sam Thursfield committed
211
GLIB_REQUIRED=2.44.0
Carlos Garnacho's avatar
Carlos Garnacho committed
212
GTK_REQUIRED=3.0.0
213
LIBXML2_REQUIRED=2.6
214
HAL_REQUIRED=0.5
215
UPOWER_REQUIRED=0.9.0
216
POPPLER_REQUIRED=0.16.0
217
CAIRO_REQUIRED=1.0
218
LIBICU_REQUIRED=4.8.1.1
219 220 221
LIBJPEG_REQUIRED="any version"
LIBGIF_REQUIRED="any version"
LIBTIFF_REQUIRED="any version"
222
LIBVORBIS_REQUIRED=0.22
Iain Holmes's avatar
Iain Holmes committed
223
LIBFLAC_REQUIRED=1.2.1
224
LIBEXIF_REQUIRED=0.6
225
LIBGSF_REQUIRED=1.14.24
Zeeshan Ali's avatar
Zeeshan Ali committed
226
LIBOSINFO_REQUIRED=0.2.9
227
EXEMPI_REQUIRED=2.1.0
228 229 230 231
EVO_REQUIRED=2.32.0
EVO_SHELL_REQUIRED=2.32.0
EDS_REQUIRED=2.32.0
CAMEL_REQUIRED=2.32.0
232
TAGLIB_REQUIRED=1.6
233
LIBGRSS_REQUIRED=0.7
234
NETWORK_MANAGER_REQUIRED=0.8
235
GSTREAMER_REQUIRED=0.10.31
236
GUPNP_DLNA_REQUIRED=0.9.4
237
LIBPNG_REQUIRED=1.2
Carlos Garnacho's avatar
Carlos Garnacho committed
238 239
JSON_GLIB_REQUIRED=1.0
LIBSOUP_REQUIRED=2.40
240

241 242 243 244
# 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
245
# 3.7.9 for FTS4 content= support
246 247
# 3.7.15 for sqlite3_errstr() support
SQLITE_REQUIRED=3.7.15
248

249 250
# Needed to generate .gir files,
# see http://live.gnome.org/GnomeGoals/AddGObjectIntrospectionSupport
251
GOBJECT_INTROSPECTION_CHECK([0.9.5])
252

253 254 255
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
AC_SUBST(GLIB_PREFIX)

Jürg Billeter's avatar
Jürg Billeter committed
256 257 258 259
# Check requirements for gvdb
GVDB_REQUIRED="glib-2.0 >= $GLIB_REQUIRED"
PKG_CHECK_MODULES(GVDB, [$GVDB_REQUIRED])

260 261
# Check requirements for libtracker-bus
LIBTRACKER_BUS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
262
                         gio-unix-2.0 >= $GLIB_REQUIRED"
263

264 265
PKG_CHECK_MODULES(LIBTRACKER_BUS, [$LIBTRACKER_BUS_REQUIRED])

266
# Check requirements for libtracker-common
Martyn Russell's avatar
Martyn Russell committed
267
LIBTRACKER_COMMON_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
268
                            gio-unix-2.0    >= $GLIB_REQUIRED"
269

270 271
PKG_CHECK_MODULES(LIBTRACKER_COMMON, [$LIBTRACKER_COMMON_REQUIRED])

272 273 274 275 276 277
case $host in
  *-*-openbsd*)
    LIBTRACKER_COMMON_LIBS="$LIBTRACKER_COMMON_LIBS -lkvm"
    ;;
esac

278 279 280 281 282 283 284 285 286
# 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"

287 288
# Check requirements for libtracker-direct
LIBTRACKER_DIRECT_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
289
                            gio-unix-2.0 >= $GLIB_REQUIRED"
290 291 292

PKG_CHECK_MODULES(LIBTRACKER_DIRECT, [$LIBTRACKER_DIRECT_REQUIRED])

Carlos Garnacho's avatar
Carlos Garnacho committed
293 294 295
# Check requirements for libtracker-remote
LIBTRACKER_REMOTE_REQUIRED="glib-2.0       >= $GLIB_REQUIRED
                            libsoup-2.4    >= $LIBSOUP_REQUIRED
296
                            libxml-2.0     >= $LIBXML2_REQUIRED
Carlos Garnacho's avatar
Carlos Garnacho committed
297 298 299 300
                            json-glib-1.0  >= $JSON_GLIB_REQUIRED"

PKG_CHECK_MODULES(LIBTRACKER_REMOTE, [$LIBTRACKER_REMOTE_REQUIRED])

301 302
# Check requirements for libtracker-extract
LIBTRACKER_EXTRACT_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
303 304
                             gio-unix-2.0 >= $GLIB_REQUIRED
			     gmodule-2.0  >= $GLIB_REQUIRED"
305 306 307

PKG_CHECK_MODULES(LIBTRACKER_EXTRACT, [$LIBTRACKER_EXTRACT_REQUIRED])

308 309 310 311 312 313 314
# 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])

315
# Check requirements for libtracker-miner
Martyn Russell's avatar
Martyn Russell committed
316
LIBTRACKER_MINER_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
317
                           gio-unix-2.0    >= $GLIB_REQUIRED"
318 319 320

PKG_CHECK_MODULES(LIBTRACKER_MINER, [$LIBTRACKER_MINER_REQUIRED])

321 322 323 324 325 326
# Check requirements for libtracker-control
LIBTRACKER_CONTROL_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
                             gio-unix-2.0    >= $GLIB_REQUIRED"

PKG_CHECK_MODULES(LIBTRACKER_CONTROL, [$LIBTRACKER_CONTROL_REQUIRED])

327 328
# Check requirements for libtracker-sparql
LIBTRACKER_SPARQL_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
329 330
                            gio-unix-2.0 >= $GLIB_REQUIRED
                            uuid"
331 332 333

PKG_CHECK_MODULES(LIBTRACKER_SPARQL, [$LIBTRACKER_SPARQL_REQUIRED])

334
# Check requirements for tracker-control
335 336 337
TRACKER_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                  gio-unix-2.0 >= $GLIB_REQUIRED
                  uuid"
338

339
PKG_CHECK_MODULES(TRACKER, [$TRACKER_REQUIRED])
340

341
# Check requirements for tracker-resdump
342
TRACKER_RESDUMP_REQUIRED="glib-2.0     >= $GLIB_REQUIRED"
343 344 345 346 347

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

348 349 350 351 352 353 354 355 356 357
# 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"

358
# Check requirements for tracker-extract
Martyn Russell's avatar
Martyn Russell committed
359 360
TRACKER_EXTRACT_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
                          gio-unix-2.0    >= $GLIB_REQUIRED
361
                          gmodule-2.0     >= $GLIB_REQUIRED"
362 363 364

PKG_CHECK_MODULES(TRACKER_EXTRACT, [$TRACKER_EXTRACT_REQUIRED])

365 366 367 368 369 370 371 372
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)

373 374 375 376 377
# 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])

378 379 380
# Check requirements for tracker-writeback
TRACKER_WRITEBACK_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                            gio-unix-2.0 >= $GLIB_REQUIRED
381
                            gmodule-2.0  >= $GLIB_REQUIRED"
382 383 384

PKG_CHECK_MODULES(TRACKER_WRITEBACK, [$TRACKER_WRITEBACK_REQUIRED])

385 386 387
# Check requirements for tracker-miner-fs
TRACKER_MINER_FS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                           gio-unix-2.0 >= $GLIB_REQUIRED
388
                           gmodule-2.0  >= $GLIB_REQUIRED"
389 390 391 392 393

PKG_CHECK_MODULES(TRACKER_MINER_FS, [$TRACKER_MINER_FS_REQUIRED])

TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS -lz -lm"

394
# Check requirements for tracker-miner-apps
395 396
TRACKER_MINER_APPS_REQUIRED="glib-2.0     >= $GLIB_REQUIRED
                             gio-unix-2.0 >= $GLIB_REQUIRED"
397 398 399

PKG_CHECK_MODULES(TRACKER_MINER_APPS, [$TRACKER_MINER_APPS_REQUIRED])

400
# Check requirements for tracker-miner-rss
401 402
TRACKER_MINER_RSS_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
                            libgrss  >= $LIBGRSS_REQUIRED"
403 404 405 406 407

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

408
# Check we have Vala valac command we need
409 410 411 412
VALA_MIN_VERSION=0.18.0
AM_PROG_VALAC([$VALA_MIN_VERSION])
if test "x$VALAC" = "x"; then
    AC_MSG_ERROR([Vala requested but valac >= $VALA_MIN_VERSION is not installed])
413
fi
414

415 416 417 418 419
####################################################################
# Check gettext/intltool support
####################################################################
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
420 421
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
IT_PROG_INTLTOOL([0.40.0])
422 423 424 425 426 427 428

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

AC_ARG_ENABLE(gcov,
              AS_HELP_STRING([--enable-gcov],
429 430
                             [enable coverage reporting support [[default=no]]]),
              [enable_gcov=$enableval],
431 432 433 434 435 436 437
              [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"
438
else
439 440 441
  GCOV_VALAFLAGS=
  GCOV_CFLAGS=
  GCOV_LIBS=
442 443
fi

444 445 446
AC_SUBST(GCOV_VALAFLAGS)
AC_SUBST(GCOV_CFLAGS)
AC_SUBST(GCOV_LIBS)
447

448 449
####################################################################
# General VALAFLAGS/CFLAGS/LIBS
450 451 452
#
# NOTE: BUILD_VALACFLAGS are for the sources built by Vala,
#       not for .vala files themselves.
453
####################################################################
454
BUILD_VALAFLAGS="-g --target-glib=${GLIB_REQUIRED}"
455
BUILD_VALACFLAGS="${WARN_VALACFLAGS} ${GCOV_CFLAGS} -DG_LOG_DOMAIN=\\\"Tracker\\\" -DTRACKER_COMPILATION"
456 457 458 459
BUILD_CFLAGS="${WARN_CFLAGS} ${GCOV_CFLAGS} -DG_LOG_DOMAIN=\\\"Tracker\\\" -DTRACKER_COMPILATION"
BUILD_LIBS="${GCOV_LIBS}"

AC_SUBST(BUILD_VALAFLAGS)
460
AC_SUBST(BUILD_VALACFLAGS)
461 462 463
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(BUILD_LIBS)

464
####################################################################
465 466 467 468 469 470 471 472 473
# Check if linker supports --enable-new-dtags
####################################################################
AC_MSG_CHECKING([whether $CC supports -Wl,--enable-new-dtags])
save_LDFLAGS=$LDFLAGS
LDFLAGS="-Wl,--enable-new-dtags $LDFLAGS"

AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
             [enable_new_dtags=yes; AC_MSG_RESULT(yes)], [enable_new_dtags=no; AC_MSG_RESULT(no)])
LDFLAGS=$save_LDFLAGS
474
DTAGS_LDFLAGS=
475
if test "x$enable_new_dtags" = "xyes"; then
476
    DTAGS_LDFLAGS="-Wl,--enable-new-dtags"
477
fi
478
AC_SUBST(DTAGS_LDFLAGS)
479 480

####################################################################
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
# Check for minimal
####################################################################

AC_ARG_ENABLE(minimal,
              AS_HELP_STRING([--enable-minimal],
                             [disabled EVERYTHING except the very core (tracker-store and foundation libraries) [[default=no]]]),
              [enable_minmal=$enableval],
              [enable_minmal=no])

# WE only disable the binaries we're building here, not optional
# extras for those binaries
if test "x$enable_minimal" = "xyes"; then
   AC_MSG_WARN([Building minimal configuration])

   enable_tracker_extract=no
   enable_tracker_writeback=no
   enable_miner_fs=no
   enable_miner_apps=no
   enable_miner_rss=no
fi
501

502 503 504 505 506
####################################################################
# Check for functional-test include/exclude
####################################################################
AC_ARG_ENABLE([functional-tests],
              AS_HELP_STRING([--enable-functional-tests],
507 508
                             [enable functional tests [[default=no]]]),
              [enable_functional_tests=$enableval],
509
              [enable_functional_tests=no])
Jürg Billeter's avatar
Jürg Billeter committed
510

511
if test x$enable_functional_tests != "xno"; then
512 513 514 515 516 517
   # 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
518
      AC_MSG_ERROR([Could not find Python >= $PYTHON_REQUIRED (for functional-tests, try --disable-functional-tests).])
519 520 521
   fi

   AC_DEFINE(DIST_FUNCTIONAL_TESTS, 1, [Include functional tests in the installation])
522 523
fi

524
AM_CONDITIONAL(DIST_FUNCTIONAL_TESTS, test "x$enable_functional_tests" != "xno")
525

526
####################################################################
527
# Check for gtk-doc and docbook-tools
528 529
####################################################################

530 531 532
# 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], [
533
GTK_DOC_CHECK([1.8])
534

535 536 537 538 539 540 541
# 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)
])
542

543
####################################################################
544
# Check if we should install Windows specific binaries
545 546
####################################################################

547
AC_MSG_CHECKING(for WIN32)
548
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
549 550 551
   #ifndef WIN32
   #error
   #endif
552 553 554
   ]])],
   [native_win32=yes; AC_MSG_RESULT(yes)],
   [native_win32=no; AC_MSG_RESULT(no)])
555

556
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = "yes")
557

558 559 560
if test "$native_win32" = "yes" ; then
   AC_DEFINE(OS_WIN32, 1, [Define if we are on win32])
fi
561

562 563 564 565 566 567
####################################################################
# Check if we should disable the journal
####################################################################

AC_ARG_ENABLE(journal,
              AS_HELP_STRING([--enable-journal],
568
                             [enable database journal backup mechanism [[default=yes]]]),
569 570
              [enable_journal=$enableval],
              [enable_journal=yes])
571

572 573 574 575 576 577 578 579
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")

580 581 582 583
if test "x$enable_journal" = "xno" ; then
   AC_DEFINE(DISABLE_JOURNAL, 1, [Define if we disable the journal])
fi

584 585 586 587 588 589 590 591 592 593 594 595 596 597
####################################################################
# 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

598
# Make sure we're not using versions which cause problems.
599
#
600
# Avoid versions:
601 602 603
#   3.7.10 - 3.7.13: https://mail.gnome.org/archives/tracker-list/2012-October/msg00028.html
#   3.8.1:           https://mail.gnome.org/archives/tracker-list/2013-November/msg00021.html
#   3.8.4.1:         https://mail.gnome.org/archives/tracker-list/2014-April/msg00001.html
604
#
605 606 607 608 609 610 611
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

612
if test "x$sqlite_safe" = "xyes"; then
613 614 615
   PKG_CHECK_EXISTS([sqlite3 = 3.8.1], sqlite_safe=no, sqlite_safe=yes)
fi

616 617 618 619 620
if test "x$sqlite_safe" = "xyes"; then
   PKG_CHECK_EXISTS([sqlite3 = 3.8.4.2], sqlite_safe=no, sqlite_safe=yes)
fi


621 622 623 624 625 626
if test "x$sqlite_safe" != "xyes"; then
   AC_MSG_RESULT(no)
else
   AC_MSG_RESULT(yes)
fi

627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649
##################################################################
# Check for libtracker-common, make sure libstemmer exists
##################################################################

AC_ARG_ENABLE([libstemmer],
              AS_HELP_STRING([--enable-libstemmer],
                             [enable the stemming while indexing [[default=auto]]]),
              [enable_libstemmer=$enableval],
              [enable_libstemmer=auto])

if test "x$enable_libstemmer" != "xno" ; then
   AC_CHECK_LIB([stemmer], [sb_stemmer_new], [have_libstemmer=yes], [have_libstemmer=no])

   if test "x$have_libstemmer" = "xyes"; then
      AC_DEFINE(HAVE_LIBSTEMMER, [], [Define if we have libstemmer])
      LIBTRACKER_COMMON_LIBS="$LIBTRACKER_COMMON_LIBS -lstemmer"
   fi
else
   have_libstemmer="no  (disabled)"
fi

if test "x$enable_libstemmer" = "xyes"; then
   if test "x$have_libstemmer" != "xyes"; then
650
      AC_MSG_ERROR([Could not find libstemmer.])
651 652 653 654 655
   fi
fi

AM_CONDITIONAL(HAVE_LIBSTEMMER, test "x$have_libstemmer" = "xyes")

656 657 658 659 660 661
##################################################################
# Check for tracker-fts, allow disabling FTS support
##################################################################

AC_ARG_ENABLE([tracker-fts],
              AS_HELP_STRING([--enable-tracker-fts],
662 663
                             [enable the tracker FTS [[default=auto]]]),
              [enable_tracker_fts=$enableval],
664 665
              [enable_tracker_fts=auto])

666
if test "x$enable_tracker_fts" = "xno" ; then
667
   have_tracker_fts="no  (disabled)"
668 669
else
   have_tracker_fts="yes"
670 671
fi

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

Carlos Garnacho's avatar
Carlos Garnacho committed
675 676 677 678
   AX_SQLITE_BUILTIN_FTS5
   if test "x$ax_cv_sqlite_builtin_fts5" = "xyes" ; then
      have_builtin_fts5="yes"
      AC_DEFINE(HAVE_BUILTIN_FTS, [], [Defined if Sqlite has FTS5 compiled in])
679
   else
Carlos Garnacho's avatar
Carlos Garnacho committed
680
      have_builtin_fts5="no"
681 682 683 684 685 686

      # Make sure SQLite has extension loading enabled
      AX_SQLITE_AUTO_EXTENSION
      if test "x$ax_cv_sqlite_auto_extension" != "xyes"; then
        AC_MSG_ERROR([sqlite3 cannot load extensions])
      fi
687
   fi
688 689
else
   AC_DEFINE(HAVE_TRACKER_FTS, [0], [Define to 0 if tracker FTS is not compiled])
Carlos Garnacho's avatar
Carlos Garnacho committed
690
   have_builtin_fts5="disabled"
691 692
fi

Carlos Garnacho's avatar
Carlos Garnacho committed
693
AM_CONDITIONAL(HAVE_BUILTIN_FTS, test "$have_builtin_fts5" = "yes")
694
AM_CONDITIONAL(HAVE_TRACKER_FTS, test "$have_tracker_fts" = "yes")
695

696 697 698
####################################################################
# bash-completion
####################################################################
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717

AC_ARG_WITH([bash-completion-dir],
    AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
        [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]),
    [],
    [with_bash_completion_dir=yes])

if test "x$with_bash_completion_dir" = "xyes"; then
   PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
       [BASH_COMPLETION_DIR=$($PKG_CONFIG --variable=completionsdir bash-completion)],
       [BASH_COMPLETION_DIR="${datadir}/bash-completion/completions"])
elif test "x$with_bash_completion_dir" != "xno"; then
   # Set with_bash_completions_dir to avoid printing path twice below
   BASH_COMPLETION_DIR="$with_bash_completion_dir"
   with_bash_completion_dir="yes"
fi

AC_SUBST([BASH_COMPLETION_DIR])
AM_CONDITIONAL([WITH_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"])
718

719
####################################################################
720
# Check for D-Bus requirements
721 722
####################################################################

723
# Check we are not using a different D-Bus services dir
724
AC_ARG_WITH([session_bus_services_dir],
Martyn Russell's avatar
Martyn Russell committed
725
            AS_HELP_STRING([--with-session-bus-services-dir],
726 727 728
                           [path to DBus services directory]),
            [dbus_services_dir=$withval],
            [dbus_services_dir=$datadir/dbus-1/services])
729

730
DBUS_SERVICES_DIR="$dbus_services_dir"
731 732
AC_SUBST(DBUS_SERVICES_DIR)

733 734 735 736
####################################################################
# GLib/GIO utilities
####################################################################

737 738 739
GLIB_MKENUMS=`$PKG_CONFIG glib-2.0 --variable=glib_mkenums`
AC_SUBST(GLIB_MKENUMS)

740 741 742
GDBUS_CODEGEN=`$PKG_CONFIG --variable=gdbus_codegen gio-2.0`
AC_SUBST(GDBUS_CODEGEN)

743 744 745
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
AC_SUBST(GLIB_COMPILE_RESOURCES)

746
####################################################################
747
# Should we build GLib based unit tests
748 749 750
####################################################################

AC_ARG_ENABLE(unit_tests,
751
              AS_HELP_STRING([--enable-unit-tests],
752 753
                             [enable unit tests [[default=yes]]]),
              [enable_unit_tests=$enableval],
754
              [enable_unit_tests=yes])
755 756

if test "x$enable_unit_tests" != "xno" ; then
757 758 759 760 761 762 763
   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'])
764
   fi
765 766
else
   have_unit_tests=no
767 768 769 770
fi

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

771 772 773
##################################################################
# Check for libtracker-common: upower for battery/power support
##################################################################
774

775 776
AC_ARG_ENABLE(upower,
              AS_HELP_STRING([--disable-upower],
777 778
                             [disable UPower support for AC power detection [[default=auto]]]),
              [enable_upower=$enableval],
779
              [enable_upower=auto])
780

781
AS_IF([test "x$enable_upower" != "xno"], [
782 783 784 785
   PKG_CHECK_MODULES(UPOWER,
                     [upower-glib >= $UPOWER_REQUIRED],
                     [have_upower=yes],
                     [have_upower=no])
786

787 788
   TRACKER_MINER_FS_CFLAGS="$TRACKER_MINER_FS_CFLAGS $UPOWER_CFLAGS"
   TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS $UPOWER_LIBS"
789 790
   save_LIBS=$LIBS
   LIBS=$UPOWER_LIBS
791
   AC_CHECK_FUNCS(up_client_get_on_low_battery)
792
   LIBS=$save_LIBS
793

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

801 802
if test "x$enable_upower" = "xyes"; then
   if test "x$have_upower" != "xyes"; then
803
      AC_MSG_ERROR([Could not find upower >= $UPOWER_REQUIRED.])
Richard Hughes's avatar
Richard Hughes committed
804 805 806
   fi
fi

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

809
##################################################################
810
# Check for libtracker-common: hal for battery/power support (old)
811 812 813
##################################################################

AC_ARG_ENABLE(hal,
814
              AS_HELP_STRING([--disable-hal],
815 816
                             [disable HAL support for AC power detection [[default=auto]]]),
              [enable_hal=$enableval],
817
              [enable_hal=auto])
818

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

826 827
   TRACKER_MINER_FS_CFLAGS="$TRACKER_MINER_FS_CFLAGS $HAL_CFLAGS"
   TRACKER_MINER_FS_LIBS="$TRACKER_MINER_FS_LIBS $HAL_LIBS"
828 829 830 831 832 833 834 835 836

   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
837 838
   if test "x$have_upower" = "xyes"; then
      AC_MSG_ERROR([Only one of UPower and HAL can be used.])
839
   elif test "x$have_hal" != "xyes"; then
840
      AC_MSG_ERROR([Could not find hal >= $HAL_REQUIRED.])
841 842 843 844 845
   fi
fi

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

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

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

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

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

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

889 890
UNICODE_SUPPORT_CFLAGS=
UNICODE_SUPPORT_LIBS=
891

892 893 894 895 896 897 898 899
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
900
           AC_MSG_ERROR([Could not find libunistring])
901 902 903 904 905 906 907 908 909
        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
910
          AC_MSG_ERROR([Could not find libicu])
911 912 913 914 915
        fi
     ;;
     # Invalid option value
     *) AC_MSG_ERROR([Wrong value for --with-unicode-support: $with_unicode_support]) ;;
esac
916

917 918
AM_CONDITIONAL(HAVE_LIBICU, test "x$have_libicu" = "xyes")

919 920 921 922
# Add to libtracker-common
LIBTRACKER_COMMON_CFLAGS="$LIBTRACKER_COMMON_CFLAGS $UNICODE_SUPPORT_CFLAGS"
LIBTRACKER_COMMON_LIBS="$LIBTRACKER_COMMON_LIBS $UNICODE_SUPPORT_LIBS"

923 924 925
# Add to libtracker-fts
LIBTRACKER_FTS_CFLAGS="$LIBTRACKER_FTS_CFLAGS $UNICODE_SUPPORT_CFLAGS"
LIBTRACKER_FTS_LIBS="$LIBTRACKER_FTS_LIBS $UNICODE_SUPPORT_LIBS"
926

927 928 929
# Add to libtracker-data
LIBTRACKER_DATA_CFLAGS="$LIBTRACKER_DATA_CFLAGS $UNICODE_SUPPORT_CFLAGS"
LIBTRACKER_DATA_LIBS="$LIBTRACKER_DATA_LIBS $UNICODE_SUPPORT_LIBS"
930

931 932 933 934
# Add to libtracker-extract
LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $UNICODE_SUPPORT_CFLAGS"
LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $UNICODE_SUPPORT_LIBS"

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

##################################################################
939
# Check for libtracker-miner: network-manager for web miners
940 941
##################################################################

942 943
AC_ARG_ENABLE(network_manager,
              AS_HELP_STRING([--enable-network-manager],
944 945
                             [enable NetworkManager support to detect network status [[default=auto]]]),
              [enable_network_manager=$enableval],
946
              [enable_network_manager=auto])
947

948 949 950 951 952
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])
953

954 955 956 957 958
   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])
959
   fi
960 961
fi

962 963
if test "x$enable_network_manager" = "xyes"; then
   if test "x$have_network_manager" != "xyes"; then
964
      AC_MSG_ERROR([Could not find libnm-glib >= $NETWORK_MANAGER_REQUIRED.])
965
   fi
966 967
fi

968
AM_CONDITIONAL(HAVE_NETWORK_MANAGER, test "x$have_network_manager" = "xyes")
969

970 971 972
##################################################################
# Check for libtracker-extract: libexif
##################################################################
973

974 975
AC_ARG_ENABLE(libexif,
              AS_HELP_STRING([--enable-libexif],
976 977
                             [enable extractor for exif metadata [[default=auto]]]),
              [enable_libexif=$enableval],
978
              [enable_libexif=auto])
979

980 981 982 983 984
if test "x$enable_libexif" != "xno" ; then
   PKG_CHECK_MODULES(LIBEXIF,
                     [libexif >= $LIBEXIF_REQUIRED],
                     [have_libexif=yes],
                     [have_libexif=no])
985

986 987
   LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $LIBEXIF_CFLAGS"
   LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $LIBEXIF_LIBS"
988

989 990
   if test "x$have_libexif" = "xyes"; then
      AC_DEFINE(HAVE_LIBEXIF, [], [Define if we have libexif])
991 992
   fi
else
993
   have_libexif="no  (disabled)"
994 995
fi

996 997
if test "x$enable_libexif" = "xyes"; then
   if test "x$have_libexif" != "xyes"; then
998
      AC_MSG_ERROR([Could not find libexif >= $LIBEXIF_REQUIRED.])
999 1000 1001
   fi
fi

1002
AM_CONDITIONAL(HAVE_EXIF, test "x$have_libexif" = "xyes")
1003

1004
##################################################################
1005
# Check for libtracker-extract: libiptcdata
1006 1007
##################################################################

1008 1009
AC_ARG_ENABLE(libiptcdata,
              AS_HELP_STRING([--enable-libiptcdata],
1010 1011
                             [enable extractor for iptc metadata [[default=auto]]]),
              [enable_libiptcdata=$enableval],
1012
              [enable_libiptcdata=auto])
1013

1014 1015 1016 1017 1018
if test "x$enable_libiptcdata" != "xno" ; then
   PKG_CHECK_MODULES(LIBIPTCDATA,
                     [libiptcdata],
                     [have_libiptcdata=yes],
                     [have_libiptcdata=no])
1019

1020 1021
   LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $LIBIPTCDATA_CFLAGS"
   LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $LIBIPTCDATA_LIBS"
1022

1023 1024
   if test "x$have_libiptcdata" = "xyes"; then
      AC_DEFINE(HAVE_LIBIPTCDATA, [], [Define if we have libiptcdata])
1025
   fi
1026 1027
else
   have_libiptcdata="no  (disabled)"
1028 1029
fi

1030 1031
if test "x$enable_libiptcdata" = "xyes"; then
   if test "x$have_libiptcdata" != "xyes"; then
1032
      AC_MSG_ERROR([Could not find libiptcdata.])
1033 1034
   fi
fi
1035

1036
AM_CONDITIONAL(HAVE_IPTC, test "x$have_libiptcdata" = "xyes")
1037

1038
##################################################################
1039
# Check for libtracker-extract, tracker-writeback: exempi
1040 1041
##################################################################

1042 1043
AC_ARG_ENABLE(exempi,
              AS_HELP_STRING([--enable-exempi],
1044 1045
                             [enable extractor for XMP metadata [[default=auto]]]),
              [enable_exempi=$enableval],
1046
              [enable_exempi=auto])
1047

1048 1049 1050 1051 1052 1053 1054 1055
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"
1056

1057 1058
   LIBTRACKER_EXTRACT_CFLAGS="$LIBTRACKER_EXTRACT_CFLAGS $EXEMPI_CFLAGS"
   LIBTRACKER_EXTRACT_LIBS="$LIBTRACKER_EXTRACT_LIBS $EXEMPI_LIBS"
1059

1060 1061
   if test "x$have_exempi" = "xyes"; then
      AC_DEFINE(HAVE_EXEMPI, [], [Define if we have exempi])