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-sysv|redhat-systemd|suse|gentoo|netbsd|debian]]],
149 sysv_style="$withval", sysv_style=none
151 case "$sysv_style" in
153 AC_MSG_ERROR([--enable-redhat is obsoleted. Use --enable-redhat-sysv or --enable-redhat-systemd.])
156 AC_MSG_RESULT([enabling redhat-style sysv (upstart) configuration])
159 AC_MSG_RESULT([enabling redhat-style systemd support])
162 AC_MSG_RESULT([enabling suse-style sysv support])
165 AC_MSG_RESULT([enabling gentoo-style sysv support])
168 AC_MSG_RESULT([enabling netbsd-style sysv support])
171 AC_MSG_RESULT([enabling debian-style sysv support])
174 AC_MSG_RESULT([disabling sysv support])
179 dnl OS specific configuration
180 AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
182 *aix*) this_os=aix ;;
183 *freebsd*) this_os=freebsd ;;
184 *hpux11*) this_os=hpux11 ;;
185 *irix*) this_os=irix ;;
186 *linux*) this_os=linux ;;
187 *osx*) this_os=macosx ;;
188 *darwin*) this_os=macosx ;;
189 *netbsd*) this_os=netbsd ;;
190 *openbsd*) this_os=openbsd ;;
191 *osf*) this_os=tru64 ;;
192 *solaris*) this_os=solaris ;;
196 i386|i486|i586|i686|k7) this_cpu=x86 ;;
197 alpha) this_cpu=alpha ;;
198 mips) this_cpu=mips ;;
199 powerpc|ppc) this_cpu=ppc ;;
202 dnl --------------------- operating system specific flags (port from sys/*)
204 dnl ----- FreeBSD specific -----
205 if test x"$this_os" = "xfreebsd"; then
206 AC_MSG_RESULT([ * FreeBSD specific configuration])
207 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
208 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
209 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
210 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
213 dnl ----- Linux specific -----
214 if test x"$this_os" = "xlinux"; then
215 AC_MSG_RESULT([ * Linux specific configuration])
217 dnl ----- check if we need the quotactl wrapper
218 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
219 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
220 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
224 dnl ----- as far as I can tell, dbtob always does the wrong thing
225 dnl ----- on every single version of linux I've ever played with.
226 dnl ----- see etc/afpd/quota.c
227 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
229 netatalk_cv_linux_sendfile=yes
230 AC_MSG_CHECKING([use sendfile syscall])
231 AC_ARG_ENABLE(sendfile,
232 [ --disable-sendfile disable linux sendfile syscall],[
233 if test x"$enableval" = x"no"; then
234 netatalk_cv_linux_sendfile=no
246 if test x"$netatalk_cv_linux_sendfile" = "xyes"; then
247 AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
248 AC_TRY_LINK([#include <sys/sendfile.h>],
253 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
255 netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
257 # Try and cope with broken Linux sendfile....
258 AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
260 #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
261 #undef _FILE_OFFSET_BITS
263 #include <sys/sendfile.h>],
268 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
270 netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
272 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
273 AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
274 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
275 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
276 elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
277 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
278 AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
279 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
281 netatalk_cv_linux_sendfile=no
289 dnl ----- Mac OSX specific -----
290 if test x"$this_os" = "xmacosx"; then
291 AC_MSG_RESULT([ * Mac OSX specific configuration])
292 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
293 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
294 dnl AC_DEFINE(NO_DLFCN_H)
295 AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
296 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
297 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
300 dnl ----- NetBSD specific -----
301 if test x"$this_os" = "xnetbsd"; then
302 AC_MSG_RESULT([ * NetBSD specific configuration])
303 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
304 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
305 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
307 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
310 dnl ----- NetBSD 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 ----- OpenBSD specific -----
315 if test x"$this_os" = "xopenbsd"; then
316 AC_MSG_RESULT([ * OpenBSD specific configuration])
317 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
318 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
321 dnl ----- Solaris specific -----
322 if test x"$this_os" = "xsolaris"; then
323 AC_MSG_RESULT([ * Solaris specific configuration])
324 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
325 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
326 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
327 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
328 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
333 AC_MSG_CHECKING([if we can build Solaris kernel module])
334 if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
337 AC_MSG_RESULT([$solaris_module])
339 COMPILE_64BIT_KMODULE=no
342 COMPILE_KERNEL_GCC=no
344 if test "$solaris_module" = "yes"; then
345 dnl Solaris kernel module stuff
346 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
348 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
349 if test -x /usr/bin/isainfo; then
350 # check for 64 bit platform
351 if isainfo -kv | grep '^64-bit'; then
352 COMPILE_64BIT_KMODULE=yes
356 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
358 if test "${GCC}" = yes; then
359 COMPILE_KERNEL_GCC=yes
360 if test "$COMPILE_64BIT_KMODULE" = yes; then
362 AC_MSG_CHECKING([if we can build a 64bit kernel module])
364 case `$CC --version 2>/dev/null` in
366 COMPILE_64BIT_KMODULE=no
367 COMPILE_KERNEL_GCC=no
372 #KLDFLAGS="-melf64_sparc"
376 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
382 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
384 if test "$COMPILE_64BIT_KMODULE" = yes; then
385 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
386 KCFLAGS="-xarch=v9 -xregs=no%appl"
392 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
395 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
397 #include <sys/stream.h>
398 #include <sys/ddi.h>],
402 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
404 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
407 AC_SUBST(COMPILE_KERNEL_GCC)
408 AC_SUBST(COMPILE_64BIT_KMODULE)
415 dnl Check for building PGP UAM module
416 AC_DEFUN([AC_NETATALK_PGP_UAM], [
417 AC_MSG_CHECKING([whether the PGP UAM should be build])
418 AC_ARG_ENABLE(pgp-uam,
419 [ --enable-pgp-uam enable build of PGP UAM module],[
420 if test "$enableval" = "yes"; then
421 if test "x$neta_cv_have_openssl" = "xyes"; then
422 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
435 dnl Check for building Kerberos V UAM module
436 AC_DEFUN([AC_NETATALK_KRB5_UAM], [
437 netatalk_cv_build_krb5_uam=no
438 AC_ARG_ENABLE(krbV-uam,
439 [ --enable-krbV-uam enable build of Kerberos V UAM module],
441 if test x"$enableval" = x"yes"; then
442 NETATALK_GSSAPI_CHECK([
443 netatalk_cv_build_krb5_uam=yes
445 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
452 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
453 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
458 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
461 dnl Check for overwrite the config files or not
462 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
463 AC_MSG_CHECKING([whether configuration files should be overwritten])
464 AC_ARG_ENABLE(overwrite,
465 [ --enable-overwrite overwrite configuration files during installation],
466 [OVERWRITE_CONFIG="${enable_overwrite}"],
467 [OVERWRITE_CONFIG="no"]
469 AC_MSG_RESULT([$OVERWRITE_CONFIG])
470 AC_SUBST(OVERWRITE_CONFIG)
473 dnl Check for LDAP support, for client-side ACL visibility
474 AC_DEFUN([AC_NETATALK_LDAP], [
475 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
477 [AS_HELP_STRING([--with-ldap],
478 [LDAP support (default=auto)])],
487 AC_MSG_RESULT($with_ldap)
489 if test x"$with_ldap" != x"no" ; then
490 AC_CHECK_HEADER([ldap.h], with_ldap=yes,
491 [ if test x"$with_ldap" = x"yes" ; then
492 AC_MSG_ERROR([Missing LDAP headers])
496 AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
497 [ if test x"$with_ldap" = x"yes" ; then
498 AC_MSG_ERROR([Missing LDAP library])
504 if test x"$with_ldap" = x"yes"; then
505 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
509 dnl Check for ACL support
510 AC_DEFUN([AC_NETATALK_ACL], [
511 AC_MSG_CHECKING(whether to support ACLs)
513 [AS_HELP_STRING([--with-acls],
514 [Include ACL support (default=auto)])],
517 with_acl_support="$withval"
520 with_acl_support=auto
523 [with_acl_support=auto])
524 AC_MSG_RESULT($with_acl_support)
526 if test x"$with_acl_support" = x"no"; then
527 AC_MSG_RESULT(Disabling ACL support)
528 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
533 if test x"$with_acl_support" = x"yes" ; then
534 AC_MSG_NOTICE(checking whether ACL support is available:)
537 AC_MSG_NOTICE(Using UnixWare ACLs)
538 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
541 AC_MSG_NOTICE(Using solaris ACLs)
542 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
543 ACL_LIBS="$ACL_LIBS -lsec"
546 AC_MSG_NOTICE(Using HPUX ACLs)
547 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
550 AC_MSG_NOTICE(Using IRIX ACLs)
551 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
554 AC_MSG_NOTICE(Using AIX ACLs)
555 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
558 AC_MSG_NOTICE(Using Tru64 ACLs)
559 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
560 ACL_LIBS="$ACL_LIBS -lpacl"
563 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
564 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
567 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
570 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
573 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
575 LIBS="$LIBS $ACL_LIBS"
577 #include <sys/types.h>
582 acl_entry_t *entry_p;
583 return acl_get_entry(acl, entry_id, entry_p);
585 [netatalk_cv_HAVE_POSIX_ACLS=yes],
586 [netatalk_cv_HAVE_POSIX_ACLS=no
587 with_acl_support=no])
590 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
591 AC_MSG_NOTICE(Using POSIX ACLs)
592 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
593 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
595 LIBS="$LIBS $ACL_LIBS"
597 #include <sys/types.h>
600 acl_permset_t permset_d;
602 return acl_get_perm_np(permset_d, perm);
604 [netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],
605 [netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
608 if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
609 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
613 AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
615 LIBS="$LIBS $ACL_LIBS"
616 AC_CHECK_FUNCS(acl_from_mode,
617 [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
618 [netatalk_cv_HAVE_ACL_FROM_MODE=no])
621 if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
622 AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
626 AC_MSG_NOTICE(ACL support is not avaliable)
627 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
633 if test x"$with_acl_support" = x"yes" ; then
634 AC_CHECK_HEADERS([acl/libacl.h])
635 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
640 dnl Check for Extended Attributes support
641 AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
643 neta_cv_eas_sys_found=no
644 neta_cv_eas_sys_not_found=no
646 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
651 AC_SEARCH_LIBS(getproplist, [proplist])
652 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
653 [neta_cv_eas_sys_found=yes],
654 [neta_cv_eas_sys_not_found=yes])
655 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
656 [neta_cv_eas_sys_not_found=yes])
657 AC_CHECK_FUNCS([sizeof_proplist_entry],,
658 [neta_cv_eas_sys_not_found=yes])
662 AC_CHECK_FUNCS([attropen],
663 [neta_cv_eas_sys_found=yes],
664 [neta_cv_eas_sys_not_found=yes])
668 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
669 [neta_cv_eas_sys_found=yes],
670 [neta_cv_eas_sys_not_found=yes])
671 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
672 [neta_cv_eas_sys_not_found=yes])
673 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
674 [neta_cv_eas_sys_not_found=yes])
675 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
676 [neta_cv_eas_sys_not_found=yes])
679 *freebsd4* | *dragonfly* )
680 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
684 AC_SEARCH_LIBS(getxattr, [attr])
686 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
687 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
688 [neta_cv_eas_sys_found=yes],
689 [neta_cv_eas_sys_not_found=yes])
690 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
691 [neta_cv_eas_sys_not_found=yes])
692 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
693 [neta_cv_eas_sys_not_found=yes])
696 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
697 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
698 [neta_cv_eas_sys_found=yes],
699 [neta_cv_eas_sys_not_found=yes])
700 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
701 [neta_cv_eas_sys_not_found=yes])
704 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
705 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
706 [neta_cv_eas_sys_not_found=yes])
707 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
708 [neta_cv_eas_sys_not_found=yes])
713 # Do xattr functions take additional options like on Darwin?
714 if test x"$ac_cv_func_getxattr" = x"yes" ; then
715 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
717 LIBS="$LIBS $ACL_LIBS"
719 #include <sys/types.h>
720 #if HAVE_ATTR_XATTR_H
721 #include <attr/xattr.h>
722 #elif HAVE_SYS_XATTR_H
723 #include <sys/xattr.h>
726 getxattr(0, 0, 0, 0, 0, 0);
728 [smb_attr_cv_xattr_add_opt=yes],
729 [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
731 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
732 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
736 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
737 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
738 neta_cv_eas="$neta_cv_eas | sys"
741 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
744 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
745 dnl Defines "neta_cv_have_smbshmd" to "yes" or "no"
746 dnl AC_SUBST's "SMB_SHAREMODES_CFLAGS" and "SMB_SHAREMODES_LDFLAGS"
747 dnl AM_CONDITIONAL's "USE_SMB_SHAREMODES"
748 AC_DEFUN([AC_NETATALK_SMB_SHAREMODES], [
749 neta_cv_have_smbshmd=no
750 AC_ARG_WITH(smbsharemodes-lib,
751 [ --with-smbsharemodes-lib=PATH PATH to libsmbsharemodes lib from Samba],
752 [SMB_SHAREMODES_LDFLAGS="-L$withval -lsmbsharemodes"]
754 AC_ARG_WITH(smbsharemodes-include,
755 [ --with-smbsharemodes-include=PATH PATH to libsmbsharemodes header from Samba],
756 [SMB_SHAREMODES_CFLAGS="-I$withval"]
758 AC_ARG_WITH(smbsharemodes,
759 [AS_HELP_STRING([--with-smbsharemodes],[Samba interop (default is yes)])],
760 [use_smbsharemodes=$withval],
761 [use_smbsharemodes=yes]
764 if test x"$use_smbsharemodes" = x"yes" ; then
765 AC_MSG_CHECKING([whether to enable Samba/Netatalk access/deny/share-modes interop])
767 saved_CFLAGS="$CFLAGS"
768 saved_LDFLAGS="$LDFLAGS"
769 CFLAGS="$SMB_SHAREMODES_CFLAGS $CFLAGS"
770 LDFLAGS="$SMB_SHAREMODES_LDFLAGS $LDFLAGS"
775 #include <sys/time.h>
778 /* From messages.h */
782 #include "smb_share_modes.h"
783 int main(void) { (void)smb_share_mode_db_open(""); return 0;}],
784 [neta_cv_have_smbshmd=yes]
787 AC_MSG_RESULT($neta_cv_have_smbshmd)
788 AC_SUBST(SMB_SHAREMODES_CFLAGS, [$SMB_SHAREMODES_CFLAGS])
789 AC_SUBST(SMB_SHAREMODES_LDFLAGS, [$SMB_SHAREMODES_LDFLAGS])
790 CFLAGS="$saved_CFLAGS"
791 LDFLAGS="$saved_LDFLAGS"
794 AM_CONDITIONAL(USE_SMB_SHAREMODES, test x"$neta_cv_have_smbshmd" = x"yes")