# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # This file is part of Tracker. AC_PREREQ(2.57) AC_INIT([tracker],[0.0.2],[xdg@lists.freedesktop.org]) AC_CONFIG_SRCDIR([src/trackerd/trackerd.c]) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AC_SUBST(PACKAGE_URL, [http://www.freedesktop.org/Software/Tracker]) # Checks for programs. AC_PROG_CC AC_HEADER_STDC AC_PROG_LIBTOOL # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h]) # Check for glib 2.0 PKG_CHECK_MODULES(GLIB2, [ glib-2.0 >= 2.4.0 ] gthread-2.0 >= 2.4.0) AC_SUBST(GLIB2_CFLAGS) AC_SUBST(GLIB2_LIBS) # Check for Dbus 0.50 or higher PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.50 dbus-glib-1 >= 0.50 ]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) #################################################################### # Embedded Mysql checks #################################################################### mysql_dir="" AC_ARG_WITH(mysql, AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]), [if test "$with_mysql" = no ; then AC_MSG_ERROR(you need MySQL for this package. Sorry.) elif test "$with_mysql" != yes ; then mysql_dir="$with_mysql/bin" fi ]) # Try to find the mysql_config program AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH ) if test "$MYSQL_CONFIG" = no ; then AC_MSG_ERROR([cannot find mysql_config]) fi # Check to make sure we have MySQL >= 4.1.0 MYSQL_VERSION=`$MYSQL_CONFIG --version` AX_COMPARE_VERSION("$MYSQL_VERSION", [ge], [4.1.0], AC_MSG_RESULT(checking mysql version >= 4.1.0... yes), AC_MSG_ERROR([Tracker requires version 4.1.* of the embedded MySQL. Please install correct version and then restart compilation])) AX_COMPARE_VERSION("$MYSQL_VERSION", [lt], [5.0.0], AC_MSG_RESULT(checking mysql version < 5.0.0... yes), AC_MSG_ERROR([Tracker requires version 4.1.* of the embedded MySQL (it will not work with version 5 or higher). Please install correct version and then restart compilation])) # Now make sure we've got mysqld MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs` if test $? != 0 ; then AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.) fi MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags` MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS` MYSQL_LIBS=`eval echo $MYSQL_LIBS` # Now test that we can actually build with MySQL save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS" AC_CHECK_HEADER([mysql/mysql.h],,AC_MSG_ERROR([unable to find MySQL header files])) save_LIBS="$LIBS" LIBS="$LIBS $MYSQL_LIBS" CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" AC_SUBST(MYSQL_CFLAGS) AC_SUBST(MYSQL_LIBS) ############################################################################### # Check for file monitor backends ############################################################################### AM_CONDITIONAL(HAVE_INOTIFY, false) AM_CONDITIONAL(HAVE_FAM, false) ################################################################## # check for inotify ################################################################## inotify_support=no fs_monitor_backends="" primary_backend="polling only" AC_CHECK_HEADERS([linux/inotify.h], [ inotify_support=yes ]) AC_ARG_ENABLE(inotify, [ --disable-inotify build without enabling inotify for file monitoring], [ inotify_support=no ] ) if test "$inotify_support" = "yes"; then AC_DEFINE(HAVE_INOTIFY, [], [Define if we have inotify]) AM_CONDITIONAL(HAVE_INOTIFY, true) AC_ARG_ENABLE(debug, [ --enable-inotify-debug turn on inotify debugging], [AC_DEFINE(LIBINOTIFY_DEBUG,, [is debugging enabled?])],) fs_monitor_backends="${fs_monitor_backends}inotify " primary_backend="inotify" fi ################################################################## # check for FAM/GAMIN ################################################################## FAM_LIBS= disable_fam=no AC_ARG_ENABLE(fam, [ --disable-fam build without enabling fam for file monitoring], [ disable_fam=yes ] ) if test "$disable_fam" = "no" then PKG_CHECK_MODULES(GAMIN, gamin, have_fam=yes, have_fam=no) if test x"$have_fam" = "xyes" then AC_DEFINE(HAVE_FAM, [], [Define if we have FAM]) AM_CONDITIONAL(HAVE_FAM, true) if test "$fs_monitor_backends" = ""; then primary_backend="gamin" FAM_LIBS="-lgamin-1" fi fs_monitor_backends="${fs_monitor_backends}gamin" else AC_CHECK_LIB(fam, FAMOpen, [AC_CHECK_HEADERS(fam.h, [AC_DEFINE(HAVE_FAM, [], [Define if we have FAM]) AM_CONDITIONAL(HAVE_FAM, true) if test "$fs_monitor_backends" = ""; then primary_backend="fam" FAM_LIBS="-lfam" fi fs_monitor_backends="${fs_monitor_backends}fam"], AC_MSG_WARN(FAM support will not be built (header files not found)))], AC_MSG_WARN(FAM support will not be built (FAM library not found))) fi fi AC_SUBST(FAM_LIBS) ################################################################################ # check whether we need to compile internal libextractor or use an existing version ################################################################################ AM_CONDITIONAL(USING_INTERNAL_LIBEXTRACTOR, true) compile_libextractor=yes extractor_support="building internal version" AC_CHECK_HEADERS([extractor.h], [ AM_CONDITIONAL(USING_INTERNAL_LIBEXTRACTOR, false) compile_libextractor=no extractor_support="not building - using an existing version found in system" ]) AC_ARG_ENABLE(libextractor, [ --enable-libextractor build with internal version of libextractor], [ AM_CONDITIONAL(USING_INTERNAL_LIBEXTRACTOR, true) compile_libextractor=yes extractor_support="building internal version" ] ) if test "$compile_libextractor" = "yes"; then echo "buidling libextractor ...." AC_CONFIG_SUBDIRS(src/libextractor) fi ##################################################### AM_CONFIG_HEADER(src/trackerd/config.h) AC_CONFIG_FILES([ Makefile tracker.pc data/Makefile data/english/Makefile filters/Makefile filters/application/Makefile filters/text/Makefile thumbnailers/Makefile thumbnailers/application/Makefile src/Makefile src/text-filters/Makefile src/text-filters/html_converter/Makefile src/text-filters/ooo_converter/Makefile src/tracker-extract/Makefile src/trackerd/Makefile src/libtracker/Makefile ]) AC_OUTPUT echo " Tracker-$VERSION: prefix: ${prefix} source code location: ${srcdir} compiler: ${CC} embedded mysql version : $MYSQL_VERSION libextractor build: $extractor_support available file mointor backends : $fs_monitor_backends file monitor backend to be used : $primary_backend "