]> arthur.barton.de Git - netatalk.git/blobdiff - configure.in
Start locking using Berkeley db
[netatalk.git] / configure.in
index b7123436e134c6166afa9c3a248cdc6b062d47e0..81b02430e6f877ccf9fa4e421f9cac4554be0cb7 100644 (file)
@@ -1,4 +1,3 @@
-dnl $Id: configure.in,v 1.241 2010/04/03 07:11:33 franklahm Exp $
 dnl configure.in for netatalk
 
 AC_INIT(etc/afpd/main.c)
@@ -22,97 +21,32 @@ AC_PROG_LIBTOOL
 AC_PROG_PERL
 AC_PROG_GREP
 AC_PROG_PS
-
 AM_PROG_CC_C_O
 
-dnl *********************************************************************
-dnl FIXME! FIXME! These should be selectable properly, and should produce
-dnl the proper flags and defines...
-dnl *********************************************************************
-
-############################################
-# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
-#AC_SEARCH_LIBS(dlopen, [dl])
-# dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
-
-dnl Checks for libraries.
-dnl Replace `main' with a function in -labs:
-dnl AC_CHECK_LIB(abs, main)
-dnl Replace `main' with a function in -laudit:
-dnl AC_CHECK_LIB(audit, main)
-dnl Replace `main' with a function in -lauth:
-dnl AC_CHECK_LIB(auth, main)
-dnl Replace `main' with a function in -lcmd:
-dnl AC_CHECK_LIB(cmd, main)
-dnl Replace `main' with a function in -lcrypt:
-dnl AC_CHECK_LIB(crypt, main)
-dnl Replace `main' with a function in -ld:
-dnl AC_CHECK_LIB(d, main)
-dnl Replace `main' with a function in -ldl:
-dnl AC_CHECK_LIB(dl, dlopen)
-dnl Replace `main' with a function in -lkauth:
-dnl AC_CHECK_LIB(kauth, main)
-dnl Replace `main' with a function in -lkrb:
-dnl AC_CHECK_LIB(krb, main)
-dnl Replace `main' with a function in -llwp:
-dnl AC_CHECK_LIB(lwp, main)
-dnl Replace `main' with a function in -ln:
-dnl AC_CHECK_LIB(n, main)
-
-dnl not the right stuff but should be enough for now
-AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
-AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
-
-dnl Replace `main' with a function in -lprot:
-dnl AC_CHECK_LIB(prot, main)
-dnl Replace `main' with a function in -lrx:
-dnl AC_CHECK_LIB(rx, main)
-dnl Replace `main' with a function in -lrxkad:
-dnl AC_CHECK_LIB(rxkad, main)
-dnl Replace `main' with a function in -lsys:
-dnl AC_CHECK_LIB(sys, main)
-dnl Replace `main' with a function in -lubik:
-dnl AC_CHECK_LIB(ubik, main)
-
-
-#
-# Check presence of some functions
-#
-# Check for XPG4 access() function
-# Be sure to test before adding AFS libs in LIBS path as AFS lib
-# has such a function that works only on AFS filesystems.
-AC_CHECK_FUNCS(access)
-# 
-AC_CHECK_FUNCS(pread pwrite)
-
-dnl Checks for header files.
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h time.h sys/param.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h sys/uio.h)
-AC_CHECK_HEADER(sys/cdefs.h,,
-       AC_MSG_RESULT([enabling generic cdefs.h from tree])
-       CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
-)
+dnl Checks for typedefs, structures, and compiler characteristics.
+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"
+
+dnl Configure libevent
+AC_CONFIG_SUBDIRS([libevent])
+
+dnl Checks for header files, some checks are obsolete, unfortunately the code
+dnl uses the resulting macros, so the code has to cleaned up too before
+dnl we can remove the checks here.
+AC_CHECK_HEADERS(mntent.h unistd.h termios.h ufs/quota.h)
+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, conformed 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_HEADERS(langinfo.h locale.h sys/filio.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_UID_T
-AC_C_INLINE
-AC_TYPE_MODE_T
-AC_TYPE_OFF_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_STRUCT_ST_RDEV
-AC_HEADER_TIME
-AC_STRUCT_TM
 
 dnl --------------------------------------------------------------------------
 dnl check if dlsym needs to add an underscore, uses libtool macros 
@@ -124,61 +58,58 @@ if test x"$libltdl_cv_need_uscore" = xyes; then
     AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
 fi
 
+dnl Special hecks
+AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
 
-dnl Checks for library functions.
-AC_TYPE_GETGROUPS
-AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MEMCMP
-AC_HEADER_MAJOR
-AC_FUNC_MMAP
-AC_TYPE_SIGNAL
-AC_FUNC_UTIME_NULL
-AC_FUNC_WAIT3
-AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy)
-AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo strlcpy strlcat setlinebuf dirfd pselect)
-AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
+dnl these tests have been comfirmed to be needed in 2011
 AC_CHECK_FUNC(renameat, AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)) 
-AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
+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)
+
+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_CACHE_SAVE
 
-dnl Checks for (v)snprintf
-NETATALK_SNPRINTF_CHECK
-
 dnl --------------------------------------------------------------------------
 dnl 64bit platform check
 dnl --------------------------------------------------------------------------
 
 AC_MSG_CHECKING([whether to check for 64bit libraries])
-dnl Determine libdir name
-case $host in
-*-*-linux*)
-  # Test if the compiler is 64bit
-  echo 'int i;' > conftest.$ac_ext
-  atalk_cv_cc_64bit_output=no
-  if AC_TRY_EVAL(ac_compile); then
+# 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*
-  ;;
-esac
-
-dnl
-dnl FIXME: Do we need something like this for Solaris 64bit?
-dnl
+fi
+rm -rf conftest*
 
 case $host_cpu:$atalk_cv_cc_64bit_output in
-powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-  atalk_libname="lib64"
-  AC_MSG_RESULT([yes])
-  ;;
+powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
+    AC_MSG_RESULT([yes])
+    case $target_os in
+    solaris2*)
+        atalk_libname="lib/64"
+        ;;
+    *)
+        atalk_libname="lib64"
+        ;;
+    esac
+    ;;
 *:*)
-  atalk_libname="lib"
-  AC_MSG_RESULT([no])
-  ;;
+    AC_MSG_RESULT([no])
+    atalk_libname="lib"
+    ;;
 esac
 
 dnl --------------------------------------------------------------------------
@@ -235,7 +166,7 @@ AC_MSG_RESULT([$netatalk_cv_with_cracklib])
 netatalk_cv_ddp_enabled=no
 AC_MSG_CHECKING([whether to enable DDP])
 AC_ARG_ENABLE(ddp,
-       [  --enable-ddp           enable DDP],[
+       [  --enable-ddp            enable DDP (AppleTalk)],[
        if test "$enableval" = "yes"; then 
                AC_MSG_RESULT([yes])
                netatalk_cv_ddp_enabled=yes
@@ -390,6 +321,9 @@ AC_CHECK_QUOTA
 dnl Check for optional server location protocol support (used by MacOS X)
 NETATALK_SRVLOC
 
+dnl Check for optional Zeroconf support
+NETATALK_ZEROCONF
+
 dnl Check for PAM libs
 netatalk_cv_use_pam=no
 AC_PATH_PAM([
@@ -597,8 +531,8 @@ 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 $CFLAGS -I\$(top_srcdir)/sys"
+LIBS="$LIBS -L\$(top_srcdir)/libatalk -L\$(top_srcdir)/libevent"
+CFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/sys -I\$(top_srcdir)/libevent/include $CFLAGS"
 
 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
 
@@ -831,7 +765,7 @@ if test x"$this_os" = "xsolaris"; then
 
        solaris_module=no
        AC_MSG_CHECKING([if we can build Solaris kernel module])
-       if test -x /usr/ccs/bin/ld && test x$netatalk_cv_ddp_enabled = yes ; then
+       if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
                solaris_module=yes
        fi
        AC_MSG_RESULT([$solaris_module])
@@ -1025,10 +959,44 @@ AC_ARG_ENABLE(overwrite,
 )
 AC_MSG_RESULT([$OVERWRITE_CONFIG])
 
+dnl --------------------- check for LDAP support, for client-side ACL visibility
+AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
+AC_ARG_WITH(ldap,
+    [AS_HELP_STRING([--with-ldap],
+        [LDAP support (default=auto)])],
+    [ case "$withval" in
+      yes|no)
+          with_ldap="$withval"
+                 ;;
+      *)
+          with_ldap=auto
+          ;;
+      esac ])
+AC_MSG_RESULT($with_ldap)
+
+if test x"$with_ldap" != x"no" ; then
+       AC_CHECK_HEADER([ldap.h], with_ldap=yes,
+        [ if test x"$with_ldap" = x"yes" ; then
+            AC_MSG_ERROR([Missing LDAP headers])
+        fi
+               with_ldap=no
+        ])
+       AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
+        [ if test x"$with_ldap" = x"yes" ; then
+            AC_MSG_ERROR([Missing LDAP library])
+        fi
+               with_ldap=no
+        ])
+fi
+
+if test x"$with_ldap" = x"yes"; then
+       AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
+fi
+
 dnl --------------------- check for ACL support
 AC_MSG_CHECKING(whether to support ACLs)
-AC_ARG_WITH(acl-support,
-    [AS_HELP_STRING([--with-acl-support],
+AC_ARG_WITH(acls,
+    [AS_HELP_STRING([--with-acls],
         [Include ACL support (default=auto)])],
     [ case "$withval" in
       yes|no)
@@ -1046,14 +1014,6 @@ if test x"$with_acl_support" = x"no"; then
        AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
 else
     with_acl_support=yes
-    AC_MSG_NOTICE([ACL support requires LDAP support, checking whether that's available])
-       AC_CHECK_HEADER([ldap.h],,
-        [AC_MSG_ERROR([ACL Support prerequisite LDAP client headers not found.])
-                   with_acl_support=no])
-
-       AC_CHECK_LIB(ldap, ldap_init,, 
-        [AC_MSG_ERROR([ACL Support prerequisite LDAP client libs not found.])
-                   with_acl_support=no])
 fi
 
 if test x"$with_acl_support" = x"yes" ; then
@@ -1144,6 +1104,7 @@ fi
 
 if test x"$with_acl_support" = x"yes" ; then
     AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
+    AC_SUBST(ACL_LIBS)
 fi
 
 dnl --------------------- check for Extended Attributes support
@@ -1246,6 +1207,7 @@ if test "x$neta_cv_eas_sys_found" = "xyes" ; then
       neta_cv_eas="$neta_cv_eas | sys"
    fi
 fi
+AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
 
 dnl --------------------- Check if realpath() takes NULL
 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
@@ -1280,7 +1242,6 @@ dnl --------------------- Netatalk Webmin
 NETATALK_WEBMIN
 
 dnl --------------------- last minute substitutions
-
 AC_SUBST(LIBS)
 AC_SUBST(CFLAGS)
 AC_SUBST(OVERWRITE_CONFIG)
@@ -1291,6 +1252,7 @@ AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = 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(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)
@@ -1317,9 +1279,8 @@ dnl --------------------- generate files
 
 AC_OUTPUT([Makefile
        bin/Makefile
-       bin/adv1tov2/Makefile
+       bin/ad/Makefile
        bin/aecho/Makefile
-       bin/afile/Makefile
        bin/afppasswd/Makefile
        bin/cnid/Makefile
        bin/cnid/cnid2_create
@@ -1338,10 +1299,7 @@ AC_OUTPUT([Makefile
        contrib/printing/Makefile
        contrib/shell_utils/Makefile
        contrib/shell_utils/afpd-mtab.pl
-       contrib/shell_utils/apple_cp
     contrib/shell_utils/apple_dump
-       contrib/shell_utils/apple_mv
-       contrib/shell_utils/apple_rm
        contrib/shell_utils/asip-status.pl
        contrib/timelord/Makefile
        contrib/a2boot/Makefile
@@ -1355,6 +1313,7 @@ AC_OUTPUT([Makefile
        etc/afpd/Makefile
        etc/atalkd/Makefile
        etc/cnid_dbd/Makefile
+       etc/netalockd/Makefile
        etc/uams/Makefile
        etc/uams/uams_krb4/Makefile
        etc/papd/Makefile
@@ -1374,13 +1333,17 @@ AC_OUTPUT([Makefile
        libatalk/cnid/tdb/Makefile
        libatalk/compat/Makefile
        libatalk/dsi/Makefile
+       libatalk/locking/Makefile
        libatalk/nbp/Makefile
        libatalk/netddp/Makefile
-       libatalk/util/Makefile
-       libatalk/util/test/Makefile
+       libatalk/rpc/Makefile
+       libatalk/talloc/Makefile
+       libatalk/tevent/Makefile
+       libatalk/tsocket/Makefile
        libatalk/tdb/Makefile
        libatalk/unicode/Makefile
        libatalk/unicode/charsets/Makefile
+       libatalk/util/Makefile
        libatalk/vfs/Makefile
        macros/Makefile
        man/Makefile
@@ -1390,16 +1353,15 @@ AC_OUTPUT([Makefile
        man/man5/Makefile
        man/man8/Makefile
        sys/Makefile
-       sys/generic/Makefile
-       sys/generic/sys/Makefile
        sys/netatalk/Makefile
        sys/netbsd/Makefile
        sys/netbsd/netatalk/Makefile
        sys/solaris/Makefile
        sys/sunos/Makefile
        sys/ultrix/Makefile
-    test/Makefile
-    test/afpd/Makefile
+       test/Makefile
+       test/afpd/Makefile
+       test/netalockd/Makefile
        ],
        [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
 )