]> arthur.barton.de Git - netatalk.git/blobdiff - configure.ac
Writing metadata xattr on directories with sticky bit set, FR#94
[netatalk.git] / configure.ac
index 09bc9e58b3162f4c85104652bccbde06d8a26640..6f54a896ce37402f8edd86146de575e7b1f25069 100644 (file)
@@ -23,12 +23,10 @@ AC_PROG_PERL
 AC_PROG_GREP
 AC_PROG_PS
 AM_PROG_CC_C_O
-
-dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_BIGENDIAN
 AC_C_INLINE
-
-dnl Request SUSv3 standard interfaces plus anything else the platform may have
-CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -D_GNU_SOURCE"
+AC_PROG_LEX
+AC_PROG_YACC
 
 dnl Check if we can use attribute unused (gcc only) from ethereal
 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
@@ -48,12 +46,12 @@ AC_CHECK_HEADERS(netdb.h sgtty.h statfs.h dlfcn.h langinfo.h locale.h)
 AC_CHECK_HEADERS(sys/param.h sys/fcntl.h sys/termios.h)
 AC_CHECK_HEADERS(sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h)
 dnl Checks for header files, confirmed to be required as of 2011
-AC_CHECK_HEADERS(sys/epoll.h)
 AC_CHECK_HEADERS([sys/mount.h], , , 
 [#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 ])
+AC_CHECK_TYPES([fshare_t], [], [], [[#include <fcntl.h>]])
 
 AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
 
@@ -77,74 +75,25 @@ fi
 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
 
 dnl these tests have been comfirmed to be needed in 2011
-AC_CHECK_FUNC(epoll_create, AC_DEFINE([HAVE_EPOLL], 1, Whether Linux epoll is available)) 
 AC_CHECK_FUNCS(backtrace_symbols dirfd getusershell pread pwrite pselect)
-AC_CHECK_FUNCS(setlinebuf strlcat strlcpy strnlen)
+AC_CHECK_FUNCS(setlinebuf strlcat strlcpy strnlen mempcpy vasprintf asprintf)
 AC_CHECK_FUNCS(mmap utime getpagesize) dnl needed by tbd
 
 dnl search for necessary libraries
 AC_SEARCH_LIBS(gethostbyname, nsl)
 AC_SEARCH_LIBS(connect, socket)
-AC_SEARCH_LIBS(pthread_sigmask, pthread,,[AC_MSG_ERROR([missing pthread_sigmask])])
-if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
-   PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
-fi
-AC_SUBST(PTHREAD_LIBS)
+AC_CHECK_FUNCS(getifaddrs) dnl comes after gethostbyname and connect so it picks up the libs
 
-AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
+AX_PTHREAD(, [AC_MSG_ERROR([missing pthread_sigmask])])
 
-AC_CACHE_SAVE
+AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
 
-dnl --------------------------------------------------------------------------
 dnl 64bit platform check
-dnl --------------------------------------------------------------------------
-
-AC_MSG_CHECKING([whether to check for 64bit libraries])
-# Test if the compiler is in 64bit mode
-echo 'int i;' > conftest.$ac_ext
-atalk_cv_cc_64bit_output=no
-if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *"ELF 64"*)
-      atalk_cv_cc_64bit_output=yes
-      ;;
-    esac
-fi
-rm -rf conftest*
-
-case $host_cpu:$atalk_cv_cc_64bit_output in
-powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
-    case $target_os in
-    solaris2*)
-        AC_MSG_RESULT([yes])
-        atalk_libname="lib/64"
-        ;;
-    *bsd* | dragonfly*)
-        AC_MSG_RESULT([no])
-        atalk_libname="lib"
-        ;;
-    *)
-        AC_MSG_RESULT([yes])
-        atalk_libname="lib64"
-        ;;
-    esac
-    ;;
-*:*)
-    AC_MSG_RESULT([no])
-    atalk_libname="lib"
-    ;;
-esac
-
-dnl --------------------------------------------------------------------------
-dnl OS specific configuration comes in here:
-dnl --------------------------------------------------------------------------
+AC_NETATALK_64BIT_LIBS
 
+dnl OS specific checks
 AC_NETATALK_OS_SPECIFIC
 
-dnl --------------------------------------------------------------------------
-dnl specific configuration comes in here:
-dnl --------------------------------------------------------------------------
-
 dnl Check for optional admin group support
 AC_NETATALK_ADMIN_GROUP
 
@@ -187,14 +136,11 @@ AC_NETATALK_SHADOW
 dnl Check for optional valid-shell-check support
 AC_NETATALK_SHELL_CHECK
 
-dnl Check for optional Webmin
-AC_NETATALK_WEBMIN
-
 dnl Check for optional sysv initscript install
-AC_NETATALK_SYSV_STYLE
+AC_NETATALK_INIT_STYLE
 
 dnl Path where UAM modules shall be installed
-AC_ARG_WITH(uams-path, [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]], [uams_path="$withval"], [uams_path="${PKGCONFDIR}/uams"])
+AC_ARG_WITH(uams-path, [  --with-uams-path=PATH   path to UAMs [[$libdir/netatalk/]]], [uams_path="$withval/"], [uams_path="$libdir/netatalk/"])
 
 dnl Check for libgcrypt, if found enables DHX2 UAM
 AC_NETATALK_PATH_LIBGCRYPT([1:1.2.3])
@@ -214,6 +160,9 @@ AC_NETATALK_PGP_UAM
 dnl Check for building Kerberos V UAM module
 AC_NETATALK_KRB5_UAM
 
+dnl Check for Kerberos 5 support
+AC_NETATALK_KERBEROS
+
 dnl Check for overwrite the config files or not
 AC_NETATALK_OVERWRITE_CONFIG
 
@@ -226,155 +175,52 @@ AC_NETATALK_ACL
 dnl Check for Extended Attributes support
 AC_NETATALK_EXTENDED_ATTRIBUTES
 
-dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
-AC_NETATALK_SMB_SHAREMODES
-
 dnl Check if realpath() takes NULL
 AC_NETATALK_REALPATH
 
 dnl Check for sendfile()
 AC_NETATALK_SENDFILE
+AC_NETATALK_RECVFILE
 
-AC_ARG_ENABLE(redhat,
-       [  --enable-redhat         obsoleted ],[
-       echo "ERROR: --enable-redhat is obsoleted. Use --enable-redhat-sysv or --enable-redhat-systemd."
-       exit 1
-       ]
-)
+dnl Check whether bundled libevent shall not be used
+AC_NETATALK_LIBEVENT
 
-AC_ARG_ENABLE(redhat-sysv,
-       [  --enable-redhat-sysv    use redhat-style sysv (upstart) configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=redhat-sysv
-       fi
-       AC_MSG_RESULT([enabling redhat-style sysv support])
-       ]
-)
+dnl Check whether bundled tdb shall be used
+AC_NETATALK_TDB
 
-AC_ARG_ENABLE(redhat-systemd,
-       [  --enable-redhat-systemd use redhat-style systemd (>=Fedora15) configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=redhat-systemd
-       fi
-       AC_MSG_RESULT([enabling redhat-style systemd support])
-       ]
-)
+dnl Check for Tracker
+AC_NETATALK_SPOTLIGHT
 
-AC_ARG_ENABLE(suse,
-       [  --enable-suse           obsoleted ],[
-       echo "ERROR: --enable-suse is obsoleted. Use --enable-suse-sysv or --enable-suse-systemd."
-       exit 1
-       ]
-)
+dnl libatalk API checks
+AC_DEVELOPER
 
-AC_ARG_ENABLE(suse-sysv,
-       [  --enable-suse-sysv      use suse-style sysv configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=suse-sysv
-       fi
-       AC_MSG_RESULT([enabling suse-style sysv support])
-       ]
-)
+dnl Check for dtrace
+AC_NETATALK_DTRACE
 
-AC_ARG_ENABLE(suse-systemd,
-       [  --enable-suse-systemd   use suse-style systemd (>=openSUSE12.1) configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=suse-systemd
-       fi
-       AC_MSG_RESULT([enabling suse-style systemd support])
-       ]
-)
+dnl Check for dbus-glib, for AFP stats on dbus
+AC_NETATALK_DBUS_GLIB
 
-AC_ARG_ENABLE(gentoo,
-       [  --enable-gentoo         use gentoo-style sysv configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=gentoo
-       fi
-       AC_MSG_RESULT([enabling gentoo-style sysv support])
-       ]
-)
-
-AC_ARG_ENABLE(netbsd,
-       [  --enable-netbsd         use NetBSD-style rc.d configuration ],
-       if test "x$enableval" = "xyes"; then
-               sysv_style=netbsd
-       fi
-       AC_MSG_RESULT([enabling NetBSD-style rc.d support])
-)
-
-AC_ARG_ENABLE(debian,
-       [  --enable-debian         use debian-style sysv configuration ],[
-       if test "$enableval" = "yes"; then
-               sysv_style=debian
-       fi
-       AC_MSG_RESULT([enabling debian-style sysv support])
-       ]
-)
-
-AC_ARG_ENABLE(systemd,
-       [  --enable-systemd        use general systemd configuration],[
-       if test "$enableval" = "yes"; then
-               sysv_style=systemd
-       fi
-       AC_MSG_RESULT([enabling general systemd support])
-       ]
-)
-
-dnl --------------------------------------------------------------------------
 dnl FHS stuff has to be done last because it overrides other defaults
-dnl --------------------------------------------------------------------------
+AC_NETATALK_FHS
 
-AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
-AC_ARG_ENABLE(fhs,
-       [  --enable-fhs            use Filesystem Hierarchy Standard (FHS) compatibility],[
-       if test "$enableval" = "yes"; then
-               uams_path="${libdir}/netatalk"
-               sysconfdir="/etc"
-               PKGCONFDIR=${sysconfdir}/netatalk
-               SERVERTEXT="${PKGCONFDIR}/msg"
-               use_pam_so=yes
-               mandir="/usr/share/man"
-               AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-)
+dnl netatalk lockfile path, must come after AC_NETATALK_FHS
+AC_NETATALK_LOCKFILE
 
-dnl --------------------------------------------------------------------------
-dnl post-FHS substitutions, etc
-dnl --------------------------------------------------------------------------
+dnl Check for Docbook and build documentation if found
+AX_CHECK_DOCBOOK
 
+CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include $CPPFLAGS"
 UAMS_PATH="${uams_path}"
-AC_SUBST(UAMS_PATH)
-
-dnl --------------------------------------------------------------------------
-dnl drop in includes for top level directory structures here...
-dnl --------------------------------------------------------------------------
-
-dnl Note: $(top_srcdir)/include should be added before all other includes
-dnl       so that includes from that directory a preferred to includes from
-dnl       /usr/include or similar places.
-LIBS="$LIBS -L\$(top_srcdir)/libatalk"
-CFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/sys $CFLAGS"
-
 
-dnl --------------------------------------------------------------------------
-dnl Last minute substitutions
-dnl --------------------------------------------------------------------------
-
-dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
 AC_SUBST(LIBS)
 AC_SUBST(CFLAGS)
+AC_SUBST(UAMS_PATH)
 
 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
-AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
-AM_CONDITIONAL(HAVE_LDAP, test x"$with_ldap" = x"yes")
+AM_CONDITIONAL(HAVE_ACLS, test x"$ac_cv_have_acls" = x"yes")
+AM_CONDITIONAL(HAVE_LDAP, test x"$netatalk_cv_ldap" = x"yes")
 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
@@ -385,20 +231,12 @@ AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
 AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
+AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
 
-AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
-AM_CONDITIONAL(USE_REDHAT_SYSV, test x$sysv_style = xredhat-sysv)
-AM_CONDITIONAL(USE_SUSE_SYSV, test x$sysv_style = xsuse-sysv)
-AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
-AM_CONDITIONAL(USE_SOLARIS, test x$sysv_style = xsolaris)
-AM_CONDITIONAL(USE_GENTOO, test x$sysv_style = xgentoo)
-AM_CONDITIONAL(USE_DEBIAN, test x$sysv_style = xdebian)
-AM_CONDITIONAL(USE_SYSTEMD, test x$sysv_style = xsystemd || test x$sysv_style = xredhat-systemd || test x$sysv_style = xsuse-systemd)
-AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x)
-
+dnl Enable silent Automake rules if present                                                                           
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
 dnl --------------------- generate files
-
 AC_OUTPUT([Makefile
        bin/Makefile
        bin/ad/Makefile
@@ -407,7 +245,6 @@ AC_OUTPUT([Makefile
        bin/cnid/cnid2_create
        bin/megatron/Makefile
        bin/misc/Makefile
-       bin/uniconv/Makefile
        config/Makefile
        config/pam/Makefile
        contrib/Makefile
@@ -422,9 +259,19 @@ AC_OUTPUT([Makefile
        distrib/initscripts/Makefile
        distrib/m4/Makefile
        doc/Makefile
+    doc/html.xsl
+    doc/man.xsl
+    doc/manual/Makefile
+    doc/manual/manual.xml
+    doc/manpages/Makefile
+    doc/manpages/man1/Makefile
+    doc/manpages/man5/Makefile
+    doc/manpages/man8/Makefile
        etc/Makefile
        etc/afpd/Makefile
        etc/cnid_dbd/Makefile
+       etc/netatalk/Makefile
+       etc/spotlight/Makefile
        etc/uams/Makefile
        include/Makefile
        include/atalk/Makefile
@@ -437,9 +284,11 @@ AC_OUTPUT([Makefile
        libatalk/cnid/last/Makefile
        libatalk/cnid/dbd/Makefile
        libatalk/cnid/tdb/Makefile
+       libatalk/cnid/mysql/Makefile
        libatalk/compat/Makefile
        libatalk/dsi/Makefile
        libatalk/iniparser/Makefile
+       libatalk/talloc/Makefile
        libatalk/tdb/Makefile
        libatalk/unicode/Makefile
        libatalk/unicode/charsets/Makefile
@@ -448,8 +297,26 @@ AC_OUTPUT([Makefile
        macros/Makefile
        man/Makefile
        man/man1/Makefile
+    man/man1/ad.1
+    man/man1/afpldaptest.1
+    man/man1/afppasswd.1
+    man/man1/afpstats.1
+    man/man1/apple_dump.1
+    man/man1/asip-status.pl.1
+    man/man1/dbd.1
+    man/man1/macusers.1
+    man/man1/netatalk-config.1
+    man/man1/uniconv.1
        man/man5/Makefile
+    man/man5/afp.conf.5
+    man/man5/afp_signature.conf.5
+    man/man5/afp_voluuid.conf.5
+    man/man5/extmap.conf.5
        man/man8/Makefile
+    man/man8/afpd.8
+    man/man8/cnid_dbd.8
+    man/man8/cnid_metad.8
+    man/man8/netatalk.8
        test/Makefile
        test/afpd/Makefile
        ],