-dnl $Id: configure.in,v 1.240 2010-03-29 15:22:57 franklahm Exp $
dnl configure.in for netatalk
AC_INIT(etc/afpd/main.c)
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_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 langinfo.h locale.h sys/filio.h)
AC_CHECK_HEADER(sys/cdefs.h,,
AC_MSG_RESULT([enabling generic cdefs.h from tree])
CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
#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_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
fi
-
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_PROG_GCC_TRADITIONAL
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)
+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_FUNCS(strlcpy strlcat setlinebuf dirfd)
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(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
+AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
+dnl search for necessary libs for libpthread stuff
+AC_SEARCH_LIBS(pthread_sigmask, pthread,,
+ [AC_MSG_ERROR([cannot find pthread_sigmask in libc or libpthread])])
+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
AC_MSG_CHECKING([for cracklib support])
AC_MSG_RESULT([$netatalk_cv_with_cracklib])
-netatalk_cv_ddp_enabled=yes
+netatalk_cv_ddp_enabled=no
AC_MSG_CHECKING([whether to enable DDP])
AC_ARG_ENABLE(ddp,
- [ --disable-ddp disable DDP],[
- if test "$enableval" = "no"; then
- AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
- AC_MSG_RESULT([no])
- netatalk_cv_ddp_enabled=no
+ [ --enable-ddp enable DDP (AppleTalk)],[
+ if test "$enableval" = "yes"; then
+ AC_MSG_RESULT([yes])
+ netatalk_cv_ddp_enabled=yes
else
AC_MSG_RESULT([yes])
+ AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
fi
],[
- AC_MSG_RESULT([yes])
+ AC_MSG_RESULT([no])
+ AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
]
)
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
+ AC_DEFINE(NDEBUG, 1, [Disable assertions])
fi
],[
AC_MSG_RESULT([no])
+ AC_DEFINE(NDEBUG, 1, [Disable assertions])
]
)
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([
LIBS="$LIBS -L\$(top_srcdir)/libatalk"
CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
+AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
+
dnl --------------------------------------------------------------------------
dnl specific configuration comes in here:
dnl --------------------------------------------------------------------------
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" = "xnetbsd"; then
AC_MSG_RESULT([ * NetBSD specific configuration])
AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
- AC_DEFINE(NETBSD, 1, [Define if OS is FreeBSD])
- CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
+ AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
+ AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
+
+ CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
need_dash_r=yes
dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
solaris_module=no
AC_MSG_CHECKING([if we can build Solaris kernel module])
- if test -x /usr/ccs/bin/ld; then
+ if test -x /usr/ccs/bin/ld && test x$netatalk_cv_ddp_enabled = yes ; then
solaris_module=yes
fi
AC_MSG_RESULT([$solaris_module])
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)
+AC_MSG_CHECKING(whether to support ACLs)
+AC_ARG_WITH(acls,
+ [AS_HELP_STRING([--with-acls],
+ [Include ACL support (default=auto)])],
+ [ case "$withval" in
+ yes|no)
+ with_acl_support="$withval"
+ ;;
+ *)
+ with_acl_support=auto
+ ;;
+ esac ],
+ [with_acl_support=auto])
+AC_MSG_RESULT($with_acl_support)
+
+if test x"$with_acl_support" = x"no"; then
+ AC_MSG_RESULT(Disabling ACL support)
+ 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$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
- )
+
+if test x"$with_acl_support" = x"yes" ; then
+ AC_MSG_NOTICE(checking whether ACL support is available:)
+ case "$host_os" in
+ *sysv5*)
+ AC_MSG_NOTICE(Using UnixWare ACLs)
+ AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
+ ;;
+ *solaris*)
+ AC_MSG_NOTICE(Using solaris ACLs)
+ AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
+ ACL_LIBS="$ACL_LIBS -lsec"
+ ;;
+ *hpux*)
+ AC_MSG_NOTICE(Using HPUX ACLs)
+ AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
+ ;;
+ *irix*)
+ AC_MSG_NOTICE(Using IRIX ACLs)
+ AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
+ ;;
+ *aix*)
+ AC_MSG_NOTICE(Using AIX ACLs)
+ AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
+ ;;
+ *osf*)
+ AC_MSG_NOTICE(Using Tru64 ACLs)
+ AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
+ ACL_LIBS="$ACL_LIBS -lpacl"
+ ;;
+ *darwin*)
+ AC_MSG_NOTICE(ACLs on Darwin currently not supported)
+ AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
+ ;;
+ *)
+ AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
+ case "$host_os" in
+ *linux*)
+ AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
+ ;;
+ esac
+ AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
+ acl_LIBS=$LIBS
+ LIBS="$LIBS $ACL_LIBS"
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <sys/acl.h>
+ ],[
+ acl_t acl;
+ int entry_id;
+ acl_entry_t *entry_p;
+ return acl_get_entry(acl, entry_id, entry_p);
+ ],
+ [netatalk_cv_HAVE_POSIX_ACLS=yes],
+ [netatalk_cv_HAVE_POSIX_ACLS=no
+ with_acl_support=no])
+ LIBS=$acl_LIBS
+ ])
+ if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
+ AC_MSG_NOTICE(Using POSIX ACLs)
+ AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
+ AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
+ acl_LIBS=$LIBS
+ LIBS="$LIBS $ACL_LIBS"
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <sys/acl.h>
+ ],[
+ acl_permset_t permset_d;
+ 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])
+ 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
+ else
+ AC_MSG_NOTICE(ACL support is not avaliable)
+ AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
+ fi
+ ;;
+ esac
fi
-if test x$neta_cv_nfsv4acl = xyes; then
- LIBATALK_ACLS="acl/libacl.la"
-else
- LIBATALK_ACLS=""
+
+if test x"$with_acl_support" = x"yes" ; then
+ AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
+ AC_SUBST(ACL_LIBS)
fi
-AC_SUBST(LIBATALK_ACLS)
dnl --------------------- check for Extended Attributes support
-neta_cv_eas="files"
+neta_cv_eas="ad"
neta_cv_eas_sys_found=no
neta_cv_eas_sys_not_found=no
[neta_cv_eas_sys_not_found=yes])
;;
+ 'freebsd')
+ AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
+ [neta_cv_eas_sys_found=yes],
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
+ [neta_cv_eas_sys_not_found=yes])
+ AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
+ [neta_cv_eas_sys_not_found=yes])
+ ;;
+
+ *freebsd4* | *dragonfly* )
+ AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
+ ;;
+
*)
AC_SEARCH_LIBS(getxattr, [attr])
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"
+ neta_cv_eas="$neta_cv_eas | sys"
fi
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)
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(USE_NFSv4_ACLS, test x$neta_cv_nfsv4acl = xyes)
+AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = 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)
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)
dnl --------------------- generate files
libatalk/adouble/Makefile
libatalk/asp/Makefile
libatalk/atp/Makefile
+ libatalk/bstring/Makefile
libatalk/cnid/Makefile
libatalk/cnid/cdb/Makefile
libatalk/cnid/last/Makefile
sys/solaris/Makefile
sys/sunos/Makefile
sys/ultrix/Makefile
+ test/Makefile
+ test/afpd/Makefile
],
[chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
)