1 dnl Kitchen sink for configuration macros
3 dnl Check for optional admin group support
4 AC_DEFUN([AC_NETATALK_ADMIN_GROUP], [
5 netatalk_cv_admin_group=yes
6 AC_MSG_CHECKING([for administrative group support])
7 AC_ARG_ENABLE(admin-group,
8 [ --disable-admin-group disable admin group],[
9 if test x"$enableval" = x"no"; then
10 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
11 netatalk_cv_admin_group=no
14 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
17 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
22 dnl Check for optional cracklib support
23 AC_DEFUN([AC_NETATALK_CRACKLIB], [
24 netatalk_cv_with_cracklib=no
26 [ --with-cracklib=DICT enable/set location of cracklib dictionary],[
27 if test "x$withval" != "xno" ; then
29 AC_CHECK_LIB(crack, main, [
30 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
32 if test "$cracklib" = "yes"; then
33 cracklib="/usr/$atalk_libname/cracklib_dict"
35 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
36 [path to cracklib dictionary])
37 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
38 netatalk_cv_with_cracklib=yes
40 AC_MSG_ERROR([cracklib not found!])
46 AC_MSG_CHECKING([for cracklib support])
47 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
50 dnl Check whether to enable debug code
51 AC_DEFUN([AC_NETATALK_DEBUG], [
52 AC_MSG_CHECKING([whether to enable verbose debug code])
54 [ --enable-debug enable verbose debug code],[
55 if test "$enableval" != "no"; then
56 if test "$enableval" = "yes"; then
57 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
59 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
64 AC_DEFINE(NDEBUG, 1, [Disable assertions])
68 AC_DEFINE(NDEBUG, 1, [Disable assertions])
73 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
74 AC_DEFUN([AC_NETATALK_DEBUGGING], [
75 AC_MSG_CHECKING([whether to enable debugging with debuggers])
76 AC_ARG_ENABLE(debugging,
77 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
78 if test "$enableval" != "no"; then
79 if test "$enableval" = "yes"; then
80 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
82 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
95 dnl Check for optional shadow password support
96 AC_DEFUN([AC_NETATALK_SHADOW], [
97 netatalk_cv_use_shadowpw=no
99 [ --with-shadow enable shadow password support [[auto]]],
100 [netatalk_cv_use_shadowpw="$withval"],
101 [netatalk_cv_use_shadowpw=auto]
104 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
105 AC_CHECK_HEADER([shadow.h])
106 if test x"$ac_cv_header_shadow_h" = x"yes"; then
107 netatalk_cv_use_shadowpw=yes
108 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
110 if test "x$shadowpw" = "xyes"; then
111 AC_MSG_ERROR([shadow support not available])
113 netatalk_cv_use_shadowpw=no
118 AC_MSG_CHECKING([whether shadow support should be enabled])
119 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
126 dnl Check for optional valid-shell-check support
127 AC_DEFUN([AC_NETATALK_SHELL_CHECK], [
128 netatalk_cv_use_shellcheck=yes
129 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
130 AC_ARG_ENABLE(shell-check,
131 [ --disable-shell-check disable checking for a valid shell],[
132 if test "$enableval" = "no"; then
133 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
135 netatalk_cv_use_shellcheck=no
145 dnl Check for optional sysv initscript install
146 AC_DEFUN([AC_NETATALK_SYSV_STYLE], [
147 AC_ARG_WITH(sysv-style,
148 [ --with-sysv-style use OS specific sysv config [[redhat|suse|gentoo|netbsd|debian]]],
149 sysv_style="$withval", sysv_style=none
151 case "$sysv_style" in
153 AC_MSG_RESULT([enabling redhat-style sysv support])
156 AC_MSG_RESULT([enabling suse-style sysv support])
159 AC_MSG_RESULT([enabling gentoo-style sysv support])
162 AC_MSG_RESULT([enabling netbsd-style sysv support])
165 AC_MSG_RESULT([enabling debian-style sysv support])
168 AC_MSG_RESULT([disabling sysv support])
173 dnl OS specific configuration
174 AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
176 *aix*) this_os=aix ;;
177 *freebsd*) this_os=freebsd ;;
178 *hpux11*) this_os=hpux11 ;;
179 *irix*) this_os=irix ;;
180 *linux*) this_os=linux ;;
181 *osx*) this_os=macosx ;;
182 *darwin*) this_os=macosx ;;
183 *netbsd*) this_os=netbsd ;;
184 *openbsd*) this_os=openbsd ;;
185 *osf*) this_os=tru64 ;;
186 *solaris*) this_os=solaris ;;
190 i386|i486|i586|i686|k7) this_cpu=x86 ;;
191 alpha) this_cpu=alpha ;;
192 mips) this_cpu=mips ;;
193 powerpc|ppc) this_cpu=ppc ;;
196 dnl --------------------- operating system specific flags (port from sys/*)
198 dnl ----- FreeBSD specific -----
199 if test x"$this_os" = "xfreebsd"; then
200 AC_MSG_RESULT([ * FreeBSD specific configuration])
201 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
202 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
203 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
204 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
207 dnl ----- Linux specific -----
208 if test x"$this_os" = "xlinux"; then
209 AC_MSG_RESULT([ * Linux specific configuration])
211 dnl ----- check if we need the quotactl wrapper
212 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
213 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
214 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
218 dnl ----- as far as I can tell, dbtob always does the wrong thing
219 dnl ----- on every single version of linux I've ever played with.
220 dnl ----- see etc/afpd/quota.c
221 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
223 netatalk_cv_linux_sendfile=yes
224 AC_MSG_CHECKING([use sendfile syscall])
225 AC_ARG_ENABLE(sendfile,
226 [ --disable-sendfile disable linux sendfile syscall],[
227 if test x"$enableval" = x"no"; then
228 netatalk_cv_linux_sendfile=no
240 if test x"$netatalk_cv_linux_sendfile" = "xyes"; then
241 AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
242 AC_TRY_LINK([#include <sys/sendfile.h>],
247 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
249 netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
251 # Try and cope with broken Linux sendfile....
252 AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
254 #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
255 #undef _FILE_OFFSET_BITS
257 #include <sys/sendfile.h>],
262 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
264 netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
266 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
267 AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
268 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
269 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
270 elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
271 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
272 AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
273 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
275 netatalk_cv_linux_sendfile=no
283 dnl ----- Mac OSX specific -----
284 if test x"$this_os" = "xmacosx"; then
285 AC_MSG_RESULT([ * Mac OSX specific configuration])
286 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
287 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
288 dnl AC_DEFINE(NO_DLFCN_H)
289 AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
290 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
293 dnl ----- NetBSD specific -----
294 if test x"$this_os" = "xnetbsd"; then
295 AC_MSG_RESULT([ * NetBSD specific configuration])
296 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
297 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
298 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
300 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
303 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
304 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
307 dnl ----- OpenBSD specific -----
308 if test x"$this_os" = "xopenbsd"; then
309 AC_MSG_RESULT([ * OpenBSD specific configuration])
310 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
311 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
314 dnl ----- Solaris specific -----
315 if test x"$this_os" = "xsolaris"; then
316 AC_MSG_RESULT([ * Solaris specific configuration])
317 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
318 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
319 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
320 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
321 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
326 AC_MSG_CHECKING([if we can build Solaris kernel module])
327 if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
330 AC_MSG_RESULT([$solaris_module])
332 COMPILE_64BIT_KMODULE=no
335 COMPILE_KERNEL_GCC=no
337 if test "$solaris_module" = "yes"; then
338 dnl Solaris kernel module stuff
339 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
341 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
342 if test -x /usr/bin/isainfo; then
343 # check for 64 bit platform
344 if isainfo -kv | grep '^64-bit'; then
345 COMPILE_64BIT_KMODULE=yes
349 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
351 if test "${GCC}" = yes; then
352 COMPILE_KERNEL_GCC=yes
353 if test "$COMPILE_64BIT_KMODULE" = yes; then
355 AC_MSG_CHECKING([if we can build a 64bit kernel module])
357 case `$CC --version 2>/dev/null` in
359 COMPILE_64BIT_KMODULE=no
360 COMPILE_KERNEL_GCC=no
365 #KLDFLAGS="-melf64_sparc"
369 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
375 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
377 if test "$COMPILE_64BIT_KMODULE" = yes; then
378 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
379 KCFLAGS="-xarch=v9 -xregs=no%appl"
385 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
388 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
390 #include <sys/stream.h>
391 #include <sys/ddi.h>],
395 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
397 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
400 AC_SUBST(COMPILE_KERNEL_GCC)
401 AC_SUBST(COMPILE_64BIT_KMODULE)
408 dnl Check for building PGP UAM module
409 AC_DEFUN([AC_NETATALK_PGP_UAM], [
410 AC_MSG_CHECKING([whether the PGP UAM should be build])
411 AC_ARG_ENABLE(pgp-uam,
412 [ --enable-pgp-uam enable build of PGP UAM module],[
413 if test "$enableval" = "yes"; then
414 if test "x$neta_cv_have_openssl" = "xyes"; then
415 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
428 dnl Check for building Kerberos V UAM module
429 AC_DEFUN([AC_NETATALK_KRB5_UAM], [
430 netatalk_cv_build_krb5_uam=no
431 AC_ARG_ENABLE(krbV-uam,
432 [ --enable-krbV-uam enable build of Kerberos V UAM module],
434 if test x"$enableval" = x"yes"; then
435 NETATALK_GSSAPI_CHECK([
436 netatalk_cv_build_krb5_uam=yes
438 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
445 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
446 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
451 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
454 dnl Check for overwrite the config files or not
455 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
456 AC_MSG_CHECKING([whether configuration files should be overwritten])
457 AC_ARG_ENABLE(overwrite,
458 [ --enable-overwrite overwrite configuration files during installation],
459 [OVERWRITE_CONFIG="${enable_overwrite}"],
460 [OVERWRITE_CONFIG="no"]
462 AC_MSG_RESULT([$OVERWRITE_CONFIG])
463 AC_SUBST(OVERWRITE_CONFIG)
466 dnl Check for LDAP support, for client-side ACL visibility
467 AC_DEFUN([AC_NETATALK_LDAP], [
468 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
470 [AS_HELP_STRING([--with-ldap],
471 [LDAP support (default=auto)])],
480 AC_MSG_RESULT($with_ldap)
482 if test x"$with_ldap" != x"no" ; then
483 AC_CHECK_HEADER([ldap.h], with_ldap=yes,
484 [ if test x"$with_ldap" = x"yes" ; then
485 AC_MSG_ERROR([Missing LDAP headers])
489 AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
490 [ if test x"$with_ldap" = x"yes" ; then
491 AC_MSG_ERROR([Missing LDAP library])
497 if test x"$with_ldap" = x"yes"; then
498 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
502 dnl Check for ACL support
503 AC_DEFUN([AC_NETATALK_ACL], [
504 AC_MSG_CHECKING(whether to support ACLs)
506 [AS_HELP_STRING([--with-acls],
507 [Include ACL support (default=auto)])],
510 with_acl_support="$withval"
513 with_acl_support=auto
516 [with_acl_support=auto])
517 AC_MSG_RESULT($with_acl_support)
519 if test x"$with_acl_support" = x"no"; then
520 AC_MSG_RESULT(Disabling ACL support)
521 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
526 if test x"$with_acl_support" = x"yes" ; then
527 AC_MSG_NOTICE(checking whether ACL support is available:)
530 AC_MSG_NOTICE(Using UnixWare ACLs)
531 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
534 AC_MSG_NOTICE(Using solaris ACLs)
535 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
536 ACL_LIBS="$ACL_LIBS -lsec"
539 AC_MSG_NOTICE(Using HPUX ACLs)
540 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
543 AC_MSG_NOTICE(Using IRIX ACLs)
544 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
547 AC_MSG_NOTICE(Using AIX ACLs)
548 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
551 AC_MSG_NOTICE(Using Tru64 ACLs)
552 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
553 ACL_LIBS="$ACL_LIBS -lpacl"
556 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
557 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
560 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
563 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
566 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
568 LIBS="$LIBS $ACL_LIBS"
570 #include <sys/types.h>
575 acl_entry_t *entry_p;
576 return acl_get_entry(acl, entry_id, entry_p);
578 [netatalk_cv_HAVE_POSIX_ACLS=yes],
579 [netatalk_cv_HAVE_POSIX_ACLS=no
580 with_acl_support=no])
583 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
584 AC_MSG_NOTICE(Using POSIX ACLs)
585 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
586 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
588 LIBS="$LIBS $ACL_LIBS"
590 #include <sys/types.h>
593 acl_permset_t permset_d;
595 return acl_get_perm_np(permset_d, perm);
597 [netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],
598 [netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
601 if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
602 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
606 AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
608 LIBS="$LIBS $ACL_LIBS"
609 AC_CHECK_FUNCS(acl_from_mode,
610 [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
611 [netatalk_cv_HAVE_ACL_FROM_MODE=no])
614 if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
615 AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
619 AC_MSG_NOTICE(ACL support is not avaliable)
620 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
626 if test x"$with_acl_support" = x"yes" ; then
627 AC_CHECK_HEADERS([acl/libacl.h])
628 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
633 dnl Check for Extended Attributes support
634 AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
636 neta_cv_eas_sys_found=no
637 neta_cv_eas_sys_not_found=no
639 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
644 AC_SEARCH_LIBS(getproplist, [proplist])
645 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
646 [neta_cv_eas_sys_found=yes],
647 [neta_cv_eas_sys_not_found=yes])
648 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
649 [neta_cv_eas_sys_not_found=yes])
650 AC_CHECK_FUNCS([sizeof_proplist_entry],,
651 [neta_cv_eas_sys_not_found=yes])
655 AC_CHECK_FUNCS([attropen],
656 [neta_cv_eas_sys_found=yes],
657 [neta_cv_eas_sys_not_found=yes])
661 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
662 [neta_cv_eas_sys_found=yes],
663 [neta_cv_eas_sys_not_found=yes])
664 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
665 [neta_cv_eas_sys_not_found=yes])
666 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
667 [neta_cv_eas_sys_not_found=yes])
668 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
669 [neta_cv_eas_sys_not_found=yes])
672 *freebsd4* | *dragonfly* )
673 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
677 AC_SEARCH_LIBS(getxattr, [attr])
679 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
680 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
681 [neta_cv_eas_sys_found=yes],
682 [neta_cv_eas_sys_not_found=yes])
683 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
684 [neta_cv_eas_sys_not_found=yes])
685 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
686 [neta_cv_eas_sys_not_found=yes])
689 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
690 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
691 [neta_cv_eas_sys_found=yes],
692 [neta_cv_eas_sys_not_found=yes])
693 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
694 [neta_cv_eas_sys_not_found=yes])
697 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
698 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
699 [neta_cv_eas_sys_not_found=yes])
700 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
701 [neta_cv_eas_sys_not_found=yes])
706 # Do xattr functions take additional options like on Darwin?
707 if test x"$ac_cv_func_getxattr" = x"yes" ; then
708 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
710 LIBS="$LIBS $ACL_LIBS"
712 #include <sys/types.h>
713 #if HAVE_ATTR_XATTR_H
714 #include <attr/xattr.h>
715 #elif HAVE_SYS_XATTR_H
716 #include <sys/xattr.h>
719 getxattr(0, 0, 0, 0, 0, 0);
721 [smb_attr_cv_xattr_add_opt=yes],
722 [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
724 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
725 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
729 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
730 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
731 neta_cv_eas="$neta_cv_eas | sys"
734 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
737 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
738 dnl Defines "neta_cv_have_smbshmd" to "yes" or "no"
739 dnl AC_SUBST's "SMB_SHAREMODES_CFLAGS" and "SMB_SHAREMODES_LDFLAGS"
740 dnl AM_CONDITIONAL's "USE_SMB_SHAREMODES"
741 AC_DEFUN([AC_NETATALK_SMB_SHAREMODES], [
742 neta_cv_have_smbshmd=no
743 AC_ARG_WITH(smbsharemodes-lib,
744 [ --with-smbsharemodes-lib=PATH PATH to libsmbsharemodes lib from Samba],
745 [SMB_SHAREMODES_LDFLAGS="-L$withval -lsmbsharemodes"]
747 AC_ARG_WITH(smbsharemodes-include,
748 [ --with-smbsharemodes-include=PATH PATH to libsmbsharemodes header from Samba],
749 [SMB_SHAREMODES_CFLAGS="-I$withval"]
751 AC_ARG_WITH(smbsharemodes,
752 [AS_HELP_STRING([--with-smbsharemodes],[Samba interop (default is yes)])],
753 [use_smbsharemodes=$withval],
754 [use_smbsharemodes=yes]
757 if test x"$use_smbsharemodes" = x"yes" ; then
758 AC_MSG_CHECKING([whether to enable Samba/Netatalk access/deny/share-modes interop])
760 saved_CFLAGS="$CFLAGS"
761 saved_LDFLAGS="$LDFLAGS"
762 CFLAGS="$SMB_SHAREMODES_CFLAGS $CFLAGS"
763 LDFLAGS="$SMB_SHAREMODES_LDFLAGS $LDFLAGS"
768 #include <sys/time.h>
771 /* From messages.h */
775 #include "smb_share_modes.h"
776 int main(void) { (void)smb_share_mode_db_open(""); return 0;}],
777 [neta_cv_have_smbshmd=yes]
780 AC_MSG_RESULT($neta_cv_have_smbshmd)
781 AC_SUBST(SMB_SHAREMODES_CFLAGS, [$SMB_SHAREMODES_CFLAGS])
782 AC_SUBST(SMB_SHAREMODES_LDFLAGS, [$SMB_SHAREMODES_LDFLAGS])
783 CFLAGS="$saved_CFLAGS"
784 LDFLAGS="$saved_LDFLAGS"
787 AM_CONDITIONAL(USE_SMB_SHAREMODES, test x"$neta_cv_have_smbshmd" = x"yes")