]> arthur.barton.de Git - netatalk.git/blobdiff - configure.in
afpd set the logger default to log_info and move some log msgs to log_debug
[netatalk.git] / configure.in
index 324f8e11037958a3ad20add07b6169d16c6ded77..ef3b073498b1f3a50a25a4b994e444d867bea0b7 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.204 2006-09-09 04:07:25 didg Exp $
+dnl $Id: configure.in,v 1.236 2010-01-04 10:02:18 franklahm Exp $
 dnl configure.in for netatalk
 
 AC_INIT(etc/afpd/main.c)
@@ -13,6 +13,7 @@ AM_CONFIG_HEADER(config.h)
 dnl Checks for programs.
 AC_PROG_AWK
 AC_PROG_CC
+AC_PROG_CC_C99
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
@@ -22,6 +23,8 @@ 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...
@@ -46,7 +49,7 @@ 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:
-# AC_CHECK_LIB(dl, dlopen)
+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:
@@ -55,16 +58,17 @@ 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 Replace `main' with a function in -lnsl:
-# AC_CHECK_LIB(nsl, 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 -lsocket:
-AC_CHECK_LIB(socket, socket)
 dnl Replace `main' with a function in -lsys:
 dnl AC_CHECK_LIB(sys, main)
 dnl Replace `main' with a function in -lubik:
@@ -131,11 +135,9 @@ 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)
-AC_CHECK_FUNCS(setlocale nl_langinfo)
+AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo)
 AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
-AC_CHECK_FUNCS(strlcpy strlcat)
-AC_CHECK_FUNCS(setlinebuf)
+AC_CHECK_FUNCS(strlcpy strlcat setlinebuf gethostid dirfd)
 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
 AC_CACHE_SAVE
 
@@ -205,25 +207,6 @@ NETATALK_AFS_CHECK
 
 NETATALK_CONFIG_DIRS
 
-AC_MSG_CHECKING([whether to use logfile])
-AC_ARG_WITH(logfile,
-       [  --with-logfile=PATH     path for file used by logger],[
-        if test x"$withval" = x"no"; then
-               AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
-               AC_MSG_RESULT([no, syslog])
-       elif test "$withval" != "yes"; then
-               AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
-               AC_MSG_RESULT([$withval])
-       else
-               AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
-               AC_MSG_RESULT([/var/log/netatalk.log]) 
-       fi],[
-               AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
-               AC_MSG_RESULT([no, syslog])
-       ]
-)
-
-
 netatalk_cv_with_cracklib=no
 AC_ARG_WITH(cracklib,
        [  --with-cracklib=DICT    enable/set location of cracklib dictionary],[
@@ -301,6 +284,25 @@ AC_ARG_ENABLE(debug,
        ]
 )
 
+AC_MSG_CHECKING([whether to enable debugging with debuggers])
+AC_ARG_ENABLE(debugging,
+       [  --enable-debugging      disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
+       if test "$enableval" != "no"; then
+               if test "$enableval" = "yes"; then
+                       AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
+               else
+                       AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
+               fi 
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+       fi
+       ],[
+               AC_MSG_RESULT([no])
+       ]
+)
+
+
 afp3=no
 afp3set=no
 AC_MSG_CHECKING([whether AFP 3.x calls should be enabled])
@@ -379,19 +381,6 @@ dnl Check for CNID database backends
 bdb_required=no
 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
 
-dnl Check for Berkeley DB library
-if test "x$bdb_required" = "xyes"; then
-       AC_PATH_BDB(, [
-               AC_MSG_RESULT([])
-               AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
-               AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
-               AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
-               AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
-               AC_MSG_RESULT([your linker is configured to check for libraries there.])
-               AC_MSG_ERROR([Berkeley DB library required but not found!])
-       ])
-fi
-
 dnl Check for quota support
 AC_CHECK_QUOTA
 
@@ -636,6 +625,12 @@ case "$host_cpu" in
        powerpc|ppc)                            this_cpu=ppc ;;
 esac
 
+dnl --------------------- GNU source
+case "$this_os" in
+       linux)  AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
+        ;;
+esac
+
 dnl --------------------- operating system specific flags (port from sys/*)
 
 dnl ----- AIX specific -----
@@ -718,16 +713,22 @@ fi
        dnl ----- see etc/afpd/quota.c
        AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
 
-       netatalk_cv_linux_sendfile=no
-dnl    disable this for now, code doesn't use sendfile anyway
-dnl        AC_ARG_ENABLE(sendfile,
-dnl        [  --enable-sendfile       use sendfile syscall default (no) ],[
-dnl            if test "$enableval" = "yes"; then
-dnl                    netatalk_cv_linux_sendfile=yes
-dnl            fi
-dnl            AC_MSG_RESULT([enabling sendfile syscall])
-dnl        ]
-dnl       )
+       netatalk_cv_linux_sendfile=yes
+       AC_MSG_CHECKING([use sendfile syscall])
+        AC_ARG_ENABLE(sendfile,
+           [  --disable-sendfile       disable linux sendfile syscall],[
+               if test x"$enableval" = x"no"; then
+                       netatalk_cv_linux_sendfile=no
+                       AC_MSG_RESULT([no])
+               else
+                       AC_MSG_RESULT([yes])
+
+               fi
+           ],[
+               AC_MSG_RESULT([yes])
+       ]
+
+       )
 
        if test x"$netatalk_cv_linux_sendfile" = "xyes"; then 
            AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
@@ -918,9 +919,30 @@ if test x"$this_os" = "xtru64"; then
        sysv_style=tru64
 fi
 
-dnl -- look for openssl
+dnl -- check for libgcrypt, if found enables DHX UAM
+AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
+                       neta_cv_have_libgcrypt=yes
+                       AC_MSG_NOTICE([Enabling DHX2 UAM])
+                       AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt])
+                       AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled])
+                       ])
+
+dnl -- look for openssl, if found enables DHX UAM and Randnum UAM
 AC_PATH_SSL
 
+dnl Check for Berkeley DB library
+if test "x$bdb_required" = "xyes"; then
+       AC_PATH_BDB(, [
+               AC_MSG_RESULT([])
+               AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
+               AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
+               AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
+               AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
+               AC_MSG_RESULT([your linker is configured to check for libraries there.])
+               AC_MSG_ERROR([Berkeley DB library required but not found!])
+       ])
+fi
+
 dnl -- check for crypt
 AC_CRYPT
 
@@ -930,7 +952,7 @@ AC_MSG_CHECKING([whether the PGP UAM should be build])
 AC_ARG_ENABLE(pgp-uam,
        [  --enable-pgp-uam        enable build of PGP UAM module],[
        if test "$enableval" = "yes"; then 
-               if test "$compile_ssl" = "yes"; then 
+               if test "x$neta_cv_have_openssl" = "xyes"; then 
                        AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
                        compile_pgp=yes
                        AC_MSG_RESULT([yes])
@@ -995,6 +1017,144 @@ AC_ARG_ENABLE(overwrite,
 )
 AC_MSG_RESULT([$OVERWRITE_CONFIG])
 
+dnl --------------------- check for ACL support
+neta_cv_nfsv4acl="no"
+AC_MSG_CHECKING([if NFSv4 ACL Support should be enabled])
+AC_ARG_ENABLE(nfsv4acls,
+       [  --enable-nfsv4acls      enable NFSv4 ACL Support],[
+       if test x"$enableval" = x"yes"; then
+          AC_MSG_RESULT([yes])
+          neta_cv_nfsv4acl="yes"
+       else
+          AC_MSG_RESULT([no])
+       fi],[
+          AC_MSG_RESULT([no])
+       ]
+)
+if test x$neta_cv_nfsv4acl = xyes; then
+       AC_CHECK_HEADER([ldap.h],,[
+               AC_MSG_ERROR([ACL Support need the LDAP client headers not found.])
+               neta_cv_nfsv4acl=no
+               ]
+       )
+       AC_CHECK_LIB(ldap,ldap_init,neta_cv_nfsv4acl=yes,neta_cv_nfsv4acl=no)
+fi
+if test x$neta_cv_nfsv4acl = xyes; then
+       AC_CHECK_HEADER([sys/acl.h],[
+               AC_DEFINE([HAVE_NFSv4_ACLS], 1, [Enable ACL code])
+               AC_MSG_NOTICE([Enabling ACL support])
+               ],
+               neta_cv_nfsv4acl=no
+       )
+fi
+if test x$neta_cv_nfsv4acl = xyes; then
+       LIBATALK_ACLS="acl/libacl.la"
+else
+       LIBATALK_ACLS=""
+fi
+AC_SUBST(LIBATALK_ACLS)
+
+dnl --------------------- check for Extended Attributes support
+neta_cv_eas="files"
+neta_cv_eas_sys_found=no
+neta_cv_eas_sys_not_found=no
+
+AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
+
+case "$this_os" in
+
+  *osf*)
+       AC_SEARCH_LIBS(getproplist, [proplist])
+       AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
+                   [neta_cv_eas_sys_found=yes],
+                   [neta_cv_eas_sys_not_found=yes])
+       AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
+                   [neta_cv_eas_sys_not_found=yes])
+       AC_CHECK_FUNCS([sizeof_proplist_entry],,
+                   [neta_cv_eas_sys_not_found=yes])
+  ;;
+
+  *solaris*)
+       AC_CHECK_FUNCS([attropen],
+                   [neta_cv_eas_sys_found=yes],
+                   [neta_cv_eas_sys_not_found=yes])
+  ;;
+
+  *)
+       AC_SEARCH_LIBS(getxattr, [attr])
+
+    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+       AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
+                      [neta_cv_eas_sys_found=yes],
+                      [neta_cv_eas_sys_not_found=yes])
+          AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
+                      [neta_cv_eas_sys_not_found=yes])
+          AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
+                      [neta_cv_eas_sys_not_found=yes])
+    fi
+
+    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+          AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
+                      [neta_cv_eas_sys_found=yes],
+                      [neta_cv_eas_sys_not_found=yes])
+          AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
+                      [neta_cv_eas_sys_not_found=yes])
+    fi
+
+    if test "x$neta_cv_eas_sys_found" != "xyes" ; then
+          AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
+                      [neta_cv_eas_sys_not_found=yes])
+       AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
+                      [neta_cv_eas_sys_not_found=yes])
+    fi
+  ;;
+esac
+
+# Do xattr functions take additional options like on Darwin?
+if test x"$ac_cv_func_getxattr" = x"yes" ; then
+       AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
+               old_LIBS=$LIBS
+               LIBS="$LIBS $ACL_LIBS"
+               AC_TRY_COMPILE([
+                       #include <sys/types.h>
+                       #if HAVE_ATTR_XATTR_H
+                       #include <attr/xattr.h>
+                       #elif HAVE_SYS_XATTR_H
+                       #include <sys/xattr.h>
+                       #endif
+               ],[
+                       getxattr(0, 0, 0, 0, 0, 0);
+               ],
+               [smb_attr_cv_xattr_add_opt=yes],
+               [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
+       ])
+       if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
+               AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
+       fi
+fi
+
+# Check if we have extattr
+case "$this_os" in
+  *freebsd4* | *dragonfly* )
+    AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
+    ;;
+  *)
+    AC_CHECK_FUNCS(extattr_delete_fd extattr_delete_file extattr_delete_link)
+    AC_CHECK_FUNCS(extattr_get_fd extattr_get_file extattr_get_link)
+    AC_CHECK_FUNCS(extattr_list_fd extattr_list_file extattr_list_link)
+    AC_CHECK_FUNCS(extattr_set_fd extattr_set_file extattr_set_link)
+    ;;
+esac
+
+if test "x$neta_cv_eas_sys_found" = "xyes" ; then
+   if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
+      neta_cv_eas="$neta_cv_eas | native"
+   fi
+fi
+
+dnl --------------------- Netatalk Webmin
+NETATALK_WEBMIN
+
 dnl --------------------- last minute substitutions
 
 AC_SUBST(LIBS)
@@ -1004,12 +1164,18 @@ AC_SUBST(OVERWRITE_CONFIG)
 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
-AM_CONDITIONAL(USE_DHX, test x$compile_ssl = 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(USE_NFSv4_ACLS, test x$neta_cv_nfsv4acl = xyes)
+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)
 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
 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_COBALT, test x$sysv_style = xcobalt)
 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
@@ -1020,6 +1186,7 @@ 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_UNDEF, test x$sysv_style = x)
+AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
 
 dnl --------------------- generate files
 
@@ -1030,28 +1197,27 @@ AC_OUTPUT([Makefile
        bin/afile/Makefile
        bin/afppasswd/Makefile
        bin/cnid/Makefile
-       bin/cnid/cnid_maint
        bin/cnid/cnid2_create
        bin/getzones/Makefile
        bin/megatron/Makefile
+    bin/misc/Makefile
        bin/nbp/Makefile
        bin/pap/Makefile
        bin/psorder/Makefile
        bin/uniconv/Makefile
        config/Makefile
+    config/pam/Makefile
        contrib/Makefile
        contrib/macusers/Makefile
        contrib/macusers/macusers
-       contrib/nu/Makefile
-       contrib/nu/nu
        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/shell_utils/cleanappledouble.pl
        contrib/timelord/Makefile
        contrib/a2boot/Makefile
        distrib/Makefile
@@ -1071,25 +1237,26 @@ AC_OUTPUT([Makefile
        include/Makefile
        include/atalk/Makefile
        libatalk/Makefile
+       libatalk/acl/Makefile
        libatalk/adouble/Makefile
        libatalk/asp/Makefile
        libatalk/atp/Makefile
        libatalk/cnid/Makefile
-       libatalk/cnid/db3/Makefile
        libatalk/cnid/cdb/Makefile
        libatalk/cnid/last/Makefile
        libatalk/cnid/mtab/Makefile
        libatalk/cnid/dbd/Makefile
-       libatalk/cnid/hash/Makefile
        libatalk/cnid/tdb/Makefile
        libatalk/compat/Makefile
        libatalk/dsi/Makefile
        libatalk/nbp/Makefile
        libatalk/netddp/Makefile
        libatalk/util/Makefile
+       libatalk/util/test/Makefile
        libatalk/tdb/Makefile
        libatalk/unicode/Makefile
        libatalk/unicode/charsets/Makefile
+       libatalk/vfs/Makefile
        macros/Makefile
        man/Makefile
        man/man1/Makefile
@@ -1112,4 +1279,3 @@ AC_OUTPUT([Makefile
 
 AC_NETATALK_LIBS_SUMMARY
 AC_NETATALK_CONFIG_SUMMARY
-