X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=macros%2Fnetatalk.m4;h=c52617edea4f9b279ffbad03e364ca9d863f53d1;hb=d12639596d43e40e48ea6fad0eba47bb5832ef61;hp=e3bc4e8473c79545532b88f7c27ee0d5ab70cd24;hpb=8d2b6908a3a13c022ff2ebb3545963c6d33779af;p=netatalk.git diff --git a/macros/netatalk.m4 b/macros/netatalk.m4 index e3bc4e84..c52617ed 100644 --- a/macros/netatalk.m4 +++ b/macros/netatalk.m4 @@ -1,19 +1,108 @@ dnl Kitchen sink for configuration macros +dnl Check for dtrace +AC_DEFUN([AC_NETATALK_DTRACE], [ + AC_ARG_WITH(dtrace, + AS_HELP_STRING( + [--with-dtrace], + [Enable dtrace probes (default: enabled if dtrace found)] + ), + [WDTRACE=$withval], + [WDTRACE=auto] + ) + if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then + AC_CHECK_PROG([atalk_cv_have_dtrace], [dtrace], [yes], [no]) + if test "x$atalk_cv_have_dtrace" = "xno" ; then + if test "x$WDTRACE" = "xyes" ; then + AC_MSG_FAILURE([dtrace requested but not found]) + fi + WDTRACE="no" + else + WDTRACE="yes" + fi + fi + + if test x"$WDTRACE" = x"yes" ; then + AC_DEFINE([WITH_DTRACE], [1], [dtrace probes]) + DTRACE_LIBS="" + if test x"$this_os" = x"freebsd" ; then + DTRACE_LIBS="-lelf" + fi + AC_SUBST(DTRACE_LIBS) + fi + AM_CONDITIONAL(WITH_DTRACE, test "x$WDTRACE" = "xyes") +]) + +dnl Check for dbus-glib, for AFP stats +AC_DEFUN([AC_NETATALK_DBUS_GLIB], [ + atalk_cv_with_dbus=no + PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1, have_dbus=yes, have_dbus=no) + PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0 >= 2.6, have_dbus_glib=yes, have_dbus_glib=no) + PKG_CHECK_MODULES(DBUS_GTHREAD, gthread-2.0, have_dbus_gthread=yes, have_dbus_gthread=no) + AC_SUBST(DBUS_CFLAGS) + AC_SUBST(DBUS_LIBS) + AC_SUBST(DBUS_GLIB_CFLAGS) + AC_SUBST(DBUS_GLIB_LIBS) + AC_SUBST(DBUS_GTHREAD_CFLAGS) + AC_SUBST(DBUS_GTHREAD_LIBS) + if test x$have_dbus_glib = xyes -a x$have_dbus = xyes -a x$have_dbus_gthread = xyes ; then + atalk_cv_with_dbus=yes + fi + AM_CONDITIONAL(HAVE_DBUS_GLIB, test x$atalk_cv_with_dbus = xyes) + + AC_ARG_WITH( + dbus-sysconf-dir, + [AS_HELP_STRING([--with-dbus-sysconf-dir=PATH],[Path to dbus system bus security configuration directory (default: ${sysconfdir}/dbus-1/system.d/)])], + ac_cv_dbus_sysdir=$withval, + ac_cv_dbus_sysdir='${sysconfdir}/dbus-1/system.d' + ) + + if test x$atalk_cv_with_dbus = xyes ; then + AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if support for dbus-glib was found]) + DBUS_SYS_DIR="$ac_cv_dbus_sysdir" + AC_SUBST(DBUS_SYS_DIR) + fi +]) + +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 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,21 +112,59 @@ 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]) + atalk_cv_fhs_compat=yes else AC_MSG_RESULT([no]) + atalk_cv_fhs_compat=no fi ],[ AC_MSG_RESULT([no]) - ] -)]) + atalk_cv_fhs_compat=no +])]) + +dnl netatalk lockfile path +AC_DEFUN([AC_NETATALK_LOCKFILE], [ + AC_MSG_CHECKING([netatalk lockfile path]) + AC_ARG_WITH( + lockfile, + [AS_HELP_STRING([--with-lockfile=PATH],[Path of netatalk lockfile])], + ac_cv_netatalk_lock=$withval, + ac_cv_netatalk_lock="" + ) + if test -z "$ac_cv_netatalk_lock" ; then + ac_cv_netatalk_lock=/var/spool/locks/netatalk + if test x"$atalk_cv_fhs_compat" = x"yes" ; then + ac_cv_netatalk_lock=/var/run/netatalk.pid + else + case "$host_os" in + *freebsd*) + ac_cv_netatalk_lock=/var/spool/lock/netatalk + ;; + *netbsd*|*openbsd*) + ac_cv_netatalk_lock=/var/run/netatalk.pid + ;; + *linux*) + ac_cv_netatalk_lock=/var/lock/netatalk + ;; + esac + fi + fi + AC_DEFINE_UNQUOTED(PATH_NETATALK_LOCK, ["$ac_cv_netatalk_lock"], [netatalk lockfile path]) + AC_SUBST(PATH_NETATALK_LOCK, ["$ac_cv_netatalk_lock"]) + AC_MSG_RESULT([$ac_cv_netatalk_lock]) +]) dnl 64bit platform check AC_DEFUN([AC_NETATALK_64BIT_LIBS], [ @@ -101,7 +228,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 +358,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 +367,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 +457,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) @@ -556,7 +683,7 @@ save_CFLAGS="$CFLAGS" save_LIBS="$LIBS" CFLAGS="$KRB5_CFLAGS" LIBS="$KRB5_LIBS" -AC_CHECK_FUNCS([krb5_free_unparsed_name krb5_free_error_message]) +AC_CHECK_FUNCS([krb5_free_unparsed_name krb5_free_error_message krb5_free_keytab_entry_contents krb5_kt_free_entry]) CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" ]) @@ -931,6 +1058,7 @@ if test x"$netatalk_cv_search_sendfile" = x"yes"; then AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()]) AC_SEARCH_LIBS(sendfile, sendfile) AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes]) + AC_CHECK_FUNCS([sendfilev]) ;; *freebsd*)