]> arthur.barton.de Git - netatalk.git/blobdiff - configure.in
GNU/kFreeBSD build fix, from Patrick Coulthard
[netatalk.git] / configure.in
index 47417f4546a11bbffed2da26f4ada9fb9db8b2a0..e64a0e6f3f707f1bf13eaecd3de7c7243dc8a251 100644 (file)
@@ -8,6 +8,7 @@ AC_SUBST(NETATALK_VERSION)
 AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
 AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE([enable])
 
 dnl Checks for programs.
 AC_PROG_AWK
@@ -73,7 +74,13 @@ 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 access pread pwrite)
 AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
-AC_CHECK_FUNC(renameat, AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)) 
+ac_neta_haveatfuncs=yes
+AC_CHECK_FUNCS(openat renameat fstatat unlinkat, , ac_neta_haveatfuncs=no)
+if test x"$ac_neta_haveatfuncs" = x"yes" ; then
+   AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)
+   AC_DEFINE([HAVE_ATFUNCS], 1, whether at funcs are available)
+fi
+
 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
 
 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
@@ -249,39 +256,7 @@ AC_ARG_ENABLE(debugging,
        ]
 )
 
-
-afp3=no
-afp3set=no
-AC_MSG_CHECKING([whether AFP 3.x calls should be enabled])
-AC_ARG_ENABLE(afp3,
-       [  --disable-afp3          disable AFP 3.x calls],
-       [
-           if test x"$enableval" != x"no"; then
-               afp3set=yes
-               afp3=yes
-               AC_MSG_RESULT([yes])
-           else
-               AC_MSG_RESULT([no])
-           fi
-       ],[
-           AC_MSG_RESULT([yes])
-           afp3=yes
-       ]
-)
-
-if test x"$afp3" = x"yes"; then
-        AC_SYS_LARGEFILE([
-               AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
-       ],[
-               if test x"$afp3set" = x"yes"; then
-                       AC_MSG_ERROR([AFP 3.x support requires Large File Support.])
-               else
-                       AC_MSG_WARN([AFP 3.x support requires Large File Support. AFP3.x support disabled])
-                       afp3=no
-               fi
-       ])
-fi
-
+AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
 AC_CHECK_ICONV
 
 dnl ----------- A NOTE ABOUT DROPKLUDGE
@@ -410,16 +385,32 @@ AC_ARG_ENABLE(locking,
 
 )
 
-
 AC_ARG_ENABLE(redhat,
-       [  --enable-redhat         use redhat-style sysv configuration ],[
+       [  --enable-redhat         obsoleted ],[
+       echo "ERROR: --enable-redhat is obsoleted. Use --enable-redhat-sysv or --enable-redhat-systemd."
+       echo "exit 1"
+       exit 1
+       ]
+)
+
+AC_ARG_ENABLE(redhat-sysv,
+       [  --enable-redhat-sysv    use redhat-style sysv (upstart) configuration ],[
        if test "$enableval" = "yes"; then
-               sysv_style=redhat
+               sysv_style=redhat-sysv
        fi
        AC_MSG_RESULT([enabling redhat-style sysv support])
        ]
 )
 
+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])
+       ]
+)
+
 AC_ARG_ENABLE(suse,
        [  --enable-suse           use suse-style sysv configuration ],[
        if test "$enableval" = "yes"; then
@@ -438,14 +429,6 @@ AC_ARG_ENABLE(gentoo,
        ]
 )
 
-AC_ARG_ENABLE(cobalt,
-       [  --enable-cobalt         use cobalt-style sysv configuration ],
-       if test "$enableval" = "yes"; then
-               sysv_style=cobalt
-       fi
-       AC_MSG_RESULT([enabling cobalt-style sysv support])
-)
-
 AC_ARG_ENABLE(netbsd,
        [  --enable-netbsd         use NetBSD-style rc.d configuration ],
        if test "x$enableval" = "xyes"; then
@@ -558,6 +541,7 @@ dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
 dnl --------------------- determine operating system from "target"
 case "$host_os" in
        *aix*)                          this_os=aix ;;
+       *kfreebsd*-gnu)                 this_os=kfreebsd-gnu ;;
        *freebsd*)                      this_os=freebsd ;;
        *hpux11*)                       this_os=hpux11 ;;
        *irix*)                         this_os=irix ;;
@@ -581,6 +565,8 @@ dnl --------------------- GNU source
 case "$this_os" in
        linux)  AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
         ;;
+     kfreebsd-gnu) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
+        ;;
 esac
 
 dnl --------------------- operating system specific flags (port from sys/*)
@@ -605,6 +591,15 @@ if test x"$this_os" = "xfreebsd"; then
     AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
 fi
 
+dnl ----- GNU/kFreeBSD specific -----
+if test x"$this_os" = "xkfreebsd-gnu"; then 
+       AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration])
+       AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
+       AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
+       AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
+    AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
+fi
+
 dnl ----- HP-UX 11 specific -----
 if test x"$this_os" = "xhpux11"; then
        AC_MSG_RESULT([ * HP-UX 11 specific configuration])
@@ -778,7 +773,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])
@@ -984,21 +979,24 @@ AC_ARG_WITH(ldap,
       *)
           with_ldap=auto
           ;;
-      esac ],
-    [with_ldap=auto])
+      esac ])
 AC_MSG_RESULT($with_ldap)
-if test x"$with_ldap" = x"no"; then
-       AC_MSG_RESULT(Disabling LDAP support)
-else
-    with_ldap=yes
-    AC_MSG_NOTICE([Checking for LDAP header and library])
-       AC_CHECK_HEADER([ldap.h],,
-        [AC_MSG_ERROR([LDAP client headers not found.])
-                   with_ldap=no])
-       AC_CHECK_LIB(ldap, ldap_init,, 
-        [AC_MSG_ERROR([LDAP client libs not found.])
-                   with_ldap=no])
+
+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
@@ -1097,13 +1095,27 @@ if test x"$with_acl_support" = x"yes" ; then
                                        acl_perm_t perm;
                                        return acl_get_perm_np(permset_d, perm);
                                ],
-                               [samba_cv_HAVE_ACL_GET_PERM_NP=yes],
-                               [samba_cv_HAVE_ACL_GET_PERM_NP=no])
+                               [netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],
+                               [netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
                                LIBS=$acl_LIBS
                        ])
-                       if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
+                       if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
                                AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
                        fi
+
+                       AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
+                               acl_LIBS=$LIBS
+                               LIBS="$LIBS $ACL_LIBS"
+                AC_CHECK_FUNCS(acl_from_mode,
+                               [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
+                               [netatalk_cv_HAVE_ACL_FROM_MODE=no])
+                               LIBS=$acl_LIBS
+                       ])
+                       if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
+                               AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
+                       fi
+
+
                else
                        AC_MSG_NOTICE(ACL support is not avaliable)
                        AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
@@ -1113,6 +1125,7 @@ if test x"$with_acl_support" = x"yes" ; then
 fi
 
 if test x"$with_acl_support" = x"yes" ; then
+   AC_CHECK_HEADERS([acl/libacl.h])
     AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
     AC_SUBST(ACL_LIBS)
 fi
@@ -1217,6 +1230,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],
@@ -1250,14 +1264,6 @@ fi
 dnl --------------------- Netatalk Webmin
 NETATALK_WEBMIN
 
-dnl --------------------- Check for libuuid which is required for TimeMachine
-AC_SEARCH_LIBS([uuid_generate],
-               [uuid], ,
-               AC_MSG_ERROR([missing library libuuid required for TimeMachine]))
-AC_CHECK_HEADER([uuid/uuid.h],
-                AC_DEFINE([HAVE_UUID], 1, [have libuuid]),
-                AC_MSG_ERROR([missing header <uuid/uuid.> from libuuid required for TimeMachine]))
-
 dnl --------------------- last minute substitutions
 
 AC_SUBST(LIBS)
@@ -1280,9 +1286,9 @@ 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)
+AM_CONDITIONAL(USE_REDHAT_SYSV, test x$sysv_style = xredhat-sysv)
+AM_CONDITIONAL(USE_REDHAT_SYSTEMD, test x$sysv_style = xredhat-systemd)
 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
@@ -1292,6 +1298,7 @@ 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)
 AM_CONDITIONAL(USE_APPLETALK, test x$netatalk_cv_ddp_enabled = xyes)
+AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
 
 dnl --------------------- generate files
 
@@ -1305,20 +1312,19 @@ AC_OUTPUT([Makefile
        bin/cnid/cnid2_create
        bin/getzones/Makefile
        bin/megatron/Makefile
-    bin/misc/Makefile
+       bin/misc/Makefile
        bin/nbp/Makefile
        bin/pap/Makefile
        bin/psorder/Makefile
        bin/uniconv/Makefile
        config/Makefile
-    config/pam/Makefile
+       config/pam/Makefile
        contrib/Makefile
        contrib/macusers/Makefile
        contrib/macusers/macusers
        contrib/printing/Makefile
        contrib/shell_utils/Makefile
-       contrib/shell_utils/afpd-mtab.pl
-    contrib/shell_utils/apple_dump
+       contrib/shell_utils/apple_dump
        contrib/shell_utils/asip-status.pl
        contrib/timelord/Makefile
        contrib/a2boot/Makefile