]> arthur.barton.de Git - netatalk.git/blobdiff - configure.in
Merge sf/master
[netatalk.git] / configure.in
index ee12c256833697310897f85a3ba02958398a794b..bbdee98320a9a0b1916bfe568d01df45bf3e4cb0 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)
@@ -74,7 +73,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)])
@@ -96,36 +101,34 @@ 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 --------------------------------------------------------------------------
@@ -252,39 +255,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
@@ -781,7 +752,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])
@@ -975,10 +946,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)
@@ -996,14 +1001,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
@@ -1077,13 +1074,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
                                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])
@@ -1093,6 +1104,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
@@ -1197,6 +1209,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],
@@ -1230,14 +1243,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)
@@ -1250,6 +1255,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)
@@ -1271,14 +1277,15 @@ 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
 
 AC_OUTPUT([Makefile
        bin/Makefile
+       bin/ad/Makefile
        bin/adv1tov2/Makefile
        bin/aecho/Makefile
-       bin/afile/Makefile
        bin/afppasswd/Makefile
        bin/cnid/Makefile
        bin/cnid/cnid2_create
@@ -1297,10 +1304,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
@@ -1336,7 +1340,6 @@ AC_OUTPUT([Makefile
        libatalk/nbp/Makefile
        libatalk/netddp/Makefile
        libatalk/util/Makefile
-       libatalk/util/test/Makefile
        libatalk/tdb/Makefile
        libatalk/unicode/Makefile
        libatalk/unicode/charsets/Makefile