]> arthur.barton.de Git - netatalk.git/blobdiff - macros/netatalk.m4
Move and rename Spotlight module
[netatalk.git] / macros / netatalk.m4
index 6ae3fab2b0d51ac2a6191652376333e40c817c2f..45b75cffbae090d00b6a3b025de4b5fe2b45ea57 100644 (file)
@@ -1,19 +1,87 @@
 dnl Kitchen sink for configuration macros
 
+dnl Whether to enable developer build
+AC_DEFUN([AC_DEVELOPER], [
+    AC_MSG_CHECKING([whether to enable developer build])
+    AC_ARG_ENABLE(
+        developer,
+        AS_HELP_STRING([--enable-developer], [whether to enable developer build (ABI checking)]),
+        enable_dev=$enableval,
+        enable_dev=no
+    )
+    AC_MSG_RESULT([$enable_dev])
+    AM_CONDITIONAL(DEVELOPER, test x"$enable_dev" = x"yes")
+])
+
+dnl Tracker, for Spotlight
+AC_DEFUN([AC_NETATALK_SPOTLIGHT], [
+    ac_cv_tracker_pkg_default=tracker-sparql-0.12
+    AC_ARG_WITH([tracker-pkg-config],
+       [AS_HELP_STRING([--with-tracker-pkg-config],[name of the Tracker SPARQL pkg in pkg-config])],
+       [ac_cv_tracker_pkg=$withval],
+       [ac_cv_tracker_pkg=$ac_cv_tracker_pkg_default])
+
+    AC_MSG_NOTICE([searching for $ac_cv_tracker_pkg])
+
+    PKG_CHECK_MODULES([TRACKER], [$ac_cv_tracker_pkg >= 0.12], [ac_cv_have_tracker=yes], [ac_cv_have_tracker=no])
+
+    if test x"$ac_cv_have_tracker" = x"no" ; then
+        if test x"$need_tracker" = x"yes" ; then
+            AC_MSG_ERROR([$ac_cv_tracker_pkg not found])
+        fi
+    else
+        AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker library is available])
+        ac_cv_tracker_prefix=`pkg-config --variable=prefix $ac_cv_tracker_pkg`
+        AC_DEFINE_UNQUOTED(TRACKER_PREFIX, ["$ac_cv_tracker_prefix"], [Path to Tracker])
+       fi
+
+    AC_SUBST(TRACKER_CFLAGS)
+    AC_SUBST(TRACKER_LIBS)
+    AM_CONDITIONAL(HAVE_TRACKER_SPARQL, [test x"$ac_cv_have_tracker" = x"yes"])
+
+    ac_cv_tracker_miner_pkg_default=tracker-miner-0.12
+    AC_ARG_WITH([tracker-miner-pkg-config],
+       [AS_HELP_STRING([--with-tracker-miner-pkg-config],[name of the Tracker miner pkg in pkg-config])],
+       [ac_cv_tracker_miner_pkg=$withval],
+       [ac_cv_tracker_miner_pkg=$ac_cv_tracker_miner_pkg_default])
+
+    AC_MSG_NOTICE([searching for $ac_cv_tracker_miner_pkg])
+
+    PKG_CHECK_MODULES([TRACKER_MINER], [$ac_cv_tracker_miner_pkg >= 0.12], [ac_cv_have_tracker_miner=yes], [ac_cv_have_tracker_miner=no])
+
+    if test x"$ac_cv_have_tracker_miner" = x"yes" ; then
+        AC_DEFINE(HAVE_TRACKER_MINER, 1, [Define if Tracker miner library is available])
+        AC_SUBST(TRACKER_MINER_CFLAGS)
+        AC_SUBST(TRACKER_MINER_LIBS)
+       fi
+])
+
 dnl Whether to disable bundled libevent
 AC_DEFUN([AC_NETATALK_LIBEVENT], [
-    AC_MSG_CHECKING([whether to disable bundled libevent (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)])
-    AC_ARG_ENABLE(
-        bundled-libevent,
-        [AS_HELP_STRING([--disable-bundled-libevent],[whether the bundled version of libevent shall not be used (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)
-        ])],
-        use_bundled_libevent=$enableval,
+    AC_MSG_CHECKING([whether to use bundled libevent])
+    AC_ARG_WITH(
+        libevent,
+        [AS_HELP_STRING([--with-libevent],[whether to use the bundled libevent (default: yes)])],
+        use_bundled_libevent=$withval,
         use_bundled_libevent=yes
     )
-
-    if test x"$use_bundled_libevent" = x"yes" ; then
-        AC_CONFIG_SUBDIRS([libevent])
+    AC_ARG_WITH(
+        libevent-header,
+        [AS_HELP_STRING([--with-libevent-header],[path to libevent header files])],
+        [use_bundled_libevent=no; LIBEVENT_CFLAGS=-I$withval]
+    )
+    AC_ARG_WITH(
+        libevent-lib,
+        [AS_HELP_STRING([--with-libevent-lib],[path to libevent library])],
+        [use_bundled_libevent=no; LIBEVENT_LDFLAGS=-L$withval]
+    )
+    if test x"$LIBEVENT_CFLAGS" = x"-Iyes" -o x"$LIBEVENT_LDFLAGS" = x"-Lyes" ; then
+        AC_MSG_ERROR([--with-libevent requires a path])
     fi
+    AC_MSG_RESULT([$use_bundled_libevent])
+    AC_CONFIG_SUBDIRS([libevent])
+    AC_SUBST(LIBEVENT_CFLAGS)
+    AC_SUBST(LIBEVENT_LDFLAGS)
     AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
 ])
 
@@ -23,12 +91,16 @@ AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibilit
 AC_ARG_ENABLE(fhs,
        [  --enable-fhs            use Filesystem Hierarchy Standard (FHS) compatibility],[
        if test "$enableval" = "yes"; then
-               uams_path="${libdir}/netatalk"
+               bindir="/bin"
+               sbindir="/sbin"
                sysconfdir="/etc"
-               PKGCONFDIR=${sysconfdir}/netatalk
-               SERVERTEXT="${PKGCONFDIR}/msg"
-               use_pam_so=yes
+               libdir="/lib"
+               localstatedir="/var"
                mandir="/usr/share/man"
+               uams_path="${libdir}/netatalk"
+               PKGCONFDIR="${sysconfdir}"
+               SERVERTEXT="${localstatedir}/netatalk/msg"
+               use_pam_so=yes
                AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
                AC_MSG_RESULT([yes])
        else
@@ -101,7 +173,7 @@ dnl Check for optional cracklib support
 AC_DEFUN([AC_NETATALK_CRACKLIB], [
 netatalk_cv_with_cracklib=no
 AC_ARG_WITH(cracklib,
-       [  --with-cracklib=DICT    enable/set location of cracklib dictionary],[
+       [  --with-cracklib[[=DICT]]  enable/set location of cracklib dictionary [[no]]],[
        if test "x$withval" != "xno" ; then
                cracklib="$withval"
                AC_CHECK_LIB(crack, main, [
@@ -231,7 +303,7 @@ AC_DEFUN([AC_NETATALK_INIT_STYLE], [
            AC_MSG_ERROR([--with-init-style=redhat is obsoleted. Use redhat-sysv or redhat-systemd.])
         ;;
     "redhat-sysv")
-           AC_MSG_RESULT([enabling redhat-style sysv (upstart) configuration])
+           AC_MSG_RESULT([enabling redhat-style sysv initscript support])
            ;;
     "redhat-systemd")
            AC_MSG_RESULT([enabling redhat-style systemd support])
@@ -240,25 +312,25 @@ AC_DEFUN([AC_NETATALK_INIT_STYLE], [
            AC_MSG_ERROR([--with-init-style=suse is obsoleted. Use suse-sysv or suse-systemd.])
         ;;
     "suse-sysv")
-           AC_MSG_RESULT([enabling suse-style sysv configuration])
+           AC_MSG_RESULT([enabling suse-style sysv initscript support])
            ;;
     "suse-systemd")
            AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
            ;;
     "gentoo")
-           AC_MSG_RESULT([enabling gentoo-style sysv support])
+           AC_MSG_RESULT([enabling gentoo-style initscript support])
         ;;
     "netbsd")
-           AC_MSG_RESULT([enabling netbsd-style sysv support])
+           AC_MSG_RESULT([enabling netbsd-style initscript support])
         ;;
     "debian")
-           AC_MSG_RESULT([enabling debian-style sysv support])
+           AC_MSG_RESULT([enabling debian-style initscript support])
         ;;
     "solaris")
-           AC_MSG_RESULT([enabling solaris-style sysv support])
+           AC_MSG_RESULT([enabling solaris-style SMF support])
         ;;
     "systemd")
-           AC_MSG_RESULT([use general systemd configuration])
+           AC_MSG_RESULT([enabling general systemd support])
         ;;
     "none")
            AC_MSG_RESULT([disabling init-style support])
@@ -330,7 +402,7 @@ fi
 dnl ----- Linux specific -----
 if test x"$this_os" = "xlinux"; then 
        AC_MSG_RESULT([ * Linux specific configuration])
-       
+    AC_DEFINE(LINUX, 1, [OS is Linux]) 
        dnl ----- check if we need the quotactl wrapper
     AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
                [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)