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-sysv|suse-systemd|gentoo|netbsd|debian|systemd]]],
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([--enable-suse is obsoleted. Use --enable-suse-sysv or --enable-suse-systemd])
165 AC_MSG_RESULT([enabling suse-style sysv configuration])
168 AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
171 AC_MSG_RESULT([enabling gentoo-style sysv support])
174 AC_MSG_RESULT([enabling netbsd-style sysv support])
177 AC_MSG_RESULT([enabling debian-style sysv support])
180 AC_MSG_RESULT([use general systemd configuration])
183 AC_MSG_RESULT([disabling sysv support])
188 dnl OS specific configuration
189 AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
191 *aix*) this_os=aix ;;
192 *freebsd*) this_os=freebsd ;;
193 *hpux11*) this_os=hpux11 ;;
194 *irix*) this_os=irix ;;
195 *linux*) this_os=linux ;;
196 *osx*) this_os=macosx ;;
197 *darwin*) this_os=macosx ;;
198 *netbsd*) this_os=netbsd ;;
199 *openbsd*) this_os=openbsd ;;
200 *osf*) this_os=tru64 ;;
201 *solaris*) this_os=solaris ;;
205 i386|i486|i586|i686|k7) this_cpu=x86 ;;
206 alpha) this_cpu=alpha ;;
207 mips) this_cpu=mips ;;
208 powerpc|ppc) this_cpu=ppc ;;
211 dnl --------------------- GNU source
213 linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
215 kfreebsd-gnu) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
219 dnl --------------------- operating system specific flags (port from sys/*)
221 dnl ----- FreeBSD specific -----
222 if test x"$this_os" = "xfreebsd"; then
223 AC_MSG_RESULT([ * FreeBSD specific configuration])
224 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
225 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
226 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
229 dnl ----- GNU/kFreeBSD specific -----
230 if test x"$this_os" = "xkfreebsd-gnu"; then
231 AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration])
232 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
233 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
234 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
237 dnl ----- Linux specific -----
238 if test x"$this_os" = "xlinux"; then
239 AC_MSG_RESULT([ * Linux specific configuration])
241 dnl ----- check if we need the quotactl wrapper
242 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
243 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
244 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
248 dnl ----- as far as I can tell, dbtob always does the wrong thing
249 dnl ----- on every single version of linux I've ever played with.
250 dnl ----- see etc/afpd/quota.c
251 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
256 dnl ----- NetBSD specific -----
257 if test x"$this_os" = "xnetbsd"; then
258 AC_MSG_RESULT([ * NetBSD specific configuration])
259 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
260 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
261 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
263 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
266 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
267 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
270 dnl ----- OpenBSD specific -----
271 if test x"$this_os" = "xopenbsd"; then
272 AC_MSG_RESULT([ * OpenBSD specific configuration])
273 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
274 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
275 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
278 dnl ----- Solaris specific -----
279 if test x"$this_os" = "xsolaris"; then
280 AC_MSG_RESULT([ * Solaris specific configuration])
281 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
282 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
283 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
284 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
285 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
290 AC_MSG_CHECKING([if we can build Solaris kernel module])
291 if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
294 AC_MSG_RESULT([$solaris_module])
296 COMPILE_64BIT_KMODULE=no
299 COMPILE_KERNEL_GCC=no
301 if test "$solaris_module" = "yes"; then
302 dnl Solaris kernel module stuff
303 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
305 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
306 if test -x /usr/bin/isainfo; then
307 # check for 64 bit platform
308 if isainfo -kv | grep '^64-bit'; then
309 COMPILE_64BIT_KMODULE=yes
313 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
315 if test "${GCC}" = yes; then
316 COMPILE_KERNEL_GCC=yes
317 if test "$COMPILE_64BIT_KMODULE" = yes; then
319 AC_MSG_CHECKING([if we can build a 64bit kernel module])
321 case `$CC --version 2>/dev/null` in
323 COMPILE_64BIT_KMODULE=no
324 COMPILE_KERNEL_GCC=no
329 #KLDFLAGS="-melf64_sparc"
333 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
339 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
341 if test "$COMPILE_64BIT_KMODULE" = yes; then
342 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
343 KCFLAGS="-xarch=v9 -xregs=no%appl"
349 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
352 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
354 #include <sys/stream.h>
355 #include <sys/ddi.h>],
359 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
361 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
364 AC_SUBST(COMPILE_KERNEL_GCC)
365 AC_SUBST(COMPILE_64BIT_KMODULE)
372 dnl Check for building PGP UAM module
373 AC_DEFUN([AC_NETATALK_PGP_UAM], [
374 AC_MSG_CHECKING([whether the PGP UAM should be build])
375 AC_ARG_ENABLE(pgp-uam,
376 [ --enable-pgp-uam enable build of PGP UAM module],[
377 if test "$enableval" = "yes"; then
378 if test "x$neta_cv_have_openssl" = "xyes"; then
379 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
392 dnl Check for building Kerberos V UAM module
393 AC_DEFUN([AC_NETATALK_KRB5_UAM], [
394 netatalk_cv_build_krb5_uam=no
395 AC_ARG_ENABLE(krbV-uam,
396 [ --enable-krbV-uam enable build of Kerberos V UAM module],
398 if test x"$enableval" = x"yes"; then
399 NETATALK_GSSAPI_CHECK([
400 netatalk_cv_build_krb5_uam=yes
402 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
409 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
410 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
415 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
418 dnl Check for overwrite the config files or not
419 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
420 AC_MSG_CHECKING([whether configuration files should be overwritten])
421 AC_ARG_ENABLE(overwrite,
422 [ --enable-overwrite overwrite configuration files during installation],
423 [OVERWRITE_CONFIG="${enable_overwrite}"],
424 [OVERWRITE_CONFIG="no"]
426 AC_MSG_RESULT([$OVERWRITE_CONFIG])
427 AC_SUBST(OVERWRITE_CONFIG)
430 dnl Check for LDAP support, for client-side ACL visibility
431 AC_DEFUN([AC_NETATALK_LDAP], [
432 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
434 [AS_HELP_STRING([--with-ldap],
435 [LDAP support (default=auto)])],
444 AC_MSG_RESULT($with_ldap)
446 if test x"$with_ldap" != x"no" ; then
447 AC_CHECK_HEADER([ldap.h], with_ldap=yes,
448 [ if test x"$with_ldap" = x"yes" ; then
449 AC_MSG_ERROR([Missing LDAP headers])
453 AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
454 [ if test x"$with_ldap" = x"yes" ; then
455 AC_MSG_ERROR([Missing LDAP library])
461 if test x"$with_ldap" = x"yes"; then
462 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
466 dnl Check for ACL support
467 AC_DEFUN([AC_NETATALK_ACL], [
468 AC_MSG_CHECKING(whether to support ACLs)
470 [AS_HELP_STRING([--with-acls],
471 [Include ACL support (default=auto)])],
474 with_acl_support="$withval"
477 with_acl_support=auto
480 [with_acl_support=auto])
481 AC_MSG_RESULT($with_acl_support)
483 if test x"$with_acl_support" = x"no"; then
484 AC_MSG_RESULT(Disabling ACL support)
485 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
490 if test x"$with_acl_support" = x"yes" ; then
491 AC_MSG_NOTICE(checking whether ACL support is available:)
494 AC_MSG_NOTICE(Using UnixWare ACLs)
495 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
498 AC_MSG_NOTICE(Using solaris ACLs)
499 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
500 ACL_LIBS="$ACL_LIBS -lsec"
503 AC_MSG_NOTICE(Using HPUX ACLs)
504 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
507 AC_MSG_NOTICE(Using IRIX ACLs)
508 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
511 AC_MSG_NOTICE(Using AIX ACLs)
512 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
515 AC_MSG_NOTICE(Using Tru64 ACLs)
516 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
517 ACL_LIBS="$ACL_LIBS -lpacl"
520 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
521 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
524 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
527 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
530 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
532 LIBS="$LIBS $ACL_LIBS"
534 #include <sys/types.h>
539 acl_entry_t *entry_p;
540 return acl_get_entry(acl, entry_id, entry_p);
542 [netatalk_cv_HAVE_POSIX_ACLS=yes],
543 [netatalk_cv_HAVE_POSIX_ACLS=no
544 with_acl_support=no])
547 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
548 AC_MSG_NOTICE(Using POSIX ACLs)
549 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
550 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
552 LIBS="$LIBS $ACL_LIBS"
554 #include <sys/types.h>
557 acl_permset_t permset_d;
559 return acl_get_perm_np(permset_d, perm);
561 [netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],
562 [netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
565 if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
566 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
570 AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
572 LIBS="$LIBS $ACL_LIBS"
573 AC_CHECK_FUNCS(acl_from_mode,
574 [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
575 [netatalk_cv_HAVE_ACL_FROM_MODE=no])
578 if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
579 AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
583 AC_MSG_NOTICE(ACL support is not avaliable)
584 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
590 if test x"$with_acl_support" = x"yes" ; then
591 AC_CHECK_HEADERS([acl/libacl.h])
592 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
597 dnl Check for Extended Attributes support
598 AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
600 neta_cv_eas_sys_found=no
601 neta_cv_eas_sys_not_found=no
603 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
608 AC_SEARCH_LIBS(getproplist, [proplist])
609 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
610 [neta_cv_eas_sys_found=yes],
611 [neta_cv_eas_sys_not_found=yes])
612 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
613 [neta_cv_eas_sys_not_found=yes])
614 AC_CHECK_FUNCS([sizeof_proplist_entry],,
615 [neta_cv_eas_sys_not_found=yes])
619 AC_CHECK_FUNCS([attropen],
620 [neta_cv_eas_sys_found=yes],
621 [neta_cv_eas_sys_not_found=yes])
625 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
626 [neta_cv_eas_sys_found=yes],
627 [neta_cv_eas_sys_not_found=yes])
628 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
629 [neta_cv_eas_sys_not_found=yes])
630 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
631 [neta_cv_eas_sys_not_found=yes])
632 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
633 [neta_cv_eas_sys_not_found=yes])
636 *freebsd4* | *dragonfly* )
637 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
641 AC_SEARCH_LIBS(getxattr, [attr])
643 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
644 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
645 [neta_cv_eas_sys_found=yes],
646 [neta_cv_eas_sys_not_found=yes])
647 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
648 [neta_cv_eas_sys_not_found=yes])
649 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
650 [neta_cv_eas_sys_not_found=yes])
653 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
654 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
655 [neta_cv_eas_sys_found=yes],
656 [neta_cv_eas_sys_not_found=yes])
657 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
658 [neta_cv_eas_sys_not_found=yes])
661 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
662 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
663 [neta_cv_eas_sys_not_found=yes])
664 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
665 [neta_cv_eas_sys_not_found=yes])
670 # Do xattr functions take additional options like on Darwin?
671 if test x"$ac_cv_func_getxattr" = x"yes" ; then
672 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
674 LIBS="$LIBS $ACL_LIBS"
676 #include <sys/types.h>
677 #if HAVE_ATTR_XATTR_H
678 #include <attr/xattr.h>
679 #elif HAVE_SYS_XATTR_H
680 #include <sys/xattr.h>
683 getxattr(0, 0, 0, 0, 0, 0);
685 [smb_attr_cv_xattr_add_opt=yes],
686 [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
688 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
689 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
693 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
694 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
695 neta_cv_eas="$neta_cv_eas | sys"
698 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
701 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
702 dnl Defines "neta_cv_have_smbshmd" to "yes" or "no"
703 dnl AC_SUBST's "SMB_SHAREMODES_CFLAGS" and "SMB_SHAREMODES_LDFLAGS"
704 dnl AM_CONDITIONAL's "USE_SMB_SHAREMODES"
705 AC_DEFUN([AC_NETATALK_SMB_SHAREMODES], [
706 neta_cv_have_smbshmd=no
707 AC_ARG_WITH(smbsharemodes-lib,
708 [ --with-smbsharemodes-lib=PATH PATH to libsmbsharemodes lib from Samba],
709 [SMB_SHAREMODES_LDFLAGS="-L$withval -lsmbsharemodes"]
711 AC_ARG_WITH(smbsharemodes-include,
712 [ --with-smbsharemodes-include=PATH PATH to libsmbsharemodes header from Samba],
713 [SMB_SHAREMODES_CFLAGS="-I$withval"]
715 AC_ARG_WITH(smbsharemodes,
716 [AS_HELP_STRING([--with-smbsharemodes],[Samba interop (default is yes)])],
717 [use_smbsharemodes=$withval],
718 [use_smbsharemodes=yes]
721 if test x"$use_smbsharemodes" = x"yes" ; then
722 AC_MSG_CHECKING([whether to enable Samba/Netatalk access/deny/share-modes interop])
724 saved_CFLAGS="$CFLAGS"
725 saved_LDFLAGS="$LDFLAGS"
726 CFLAGS="$SMB_SHAREMODES_CFLAGS $CFLAGS"
727 LDFLAGS="$SMB_SHAREMODES_LDFLAGS $LDFLAGS"
732 #include <sys/time.h>
735 /* From messages.h */
739 #include "smb_share_modes.h"
740 int main(void) { (void)smb_share_mode_db_open(""); return 0;}],
741 [neta_cv_have_smbshmd=yes]
744 AC_MSG_RESULT($neta_cv_have_smbshmd)
745 AC_SUBST(SMB_SHAREMODES_CFLAGS, [$SMB_SHAREMODES_CFLAGS])
746 AC_SUBST(SMB_SHAREMODES_LDFLAGS, [$SMB_SHAREMODES_LDFLAGS])
747 CFLAGS="$saved_CFLAGS"
748 LDFLAGS="$saved_LDFLAGS"
751 AM_CONDITIONAL(USE_SMB_SHAREMODES, test x"$neta_cv_have_smbshmd" = x"yes")
754 dnl ------ Check for sendfile() --------
755 AC_DEFUN([AC_NETATALK_SENDFILE], [
756 netatalk_cv_search_sendfile=yes
757 AC_ARG_ENABLE(sendfile,
758 [ --disable-sendfile disable sendfile syscall],
759 [if test x"$enableval" = x"no"; then
760 netatalk_cv_search_sendfile=no
764 if test x"$netatalk_cv_search_sendfile" = x"yes"; then
767 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
768 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
772 AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()])
773 AC_SEARCH_LIBS(sendfile, sendfile)
774 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
778 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
779 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
787 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
788 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
793 dnl --------------------- Check if realpath() takes NULL
794 AC_DEFUN([AC_NETATALK_REALPATH], [
795 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
796 neta_cv_REALPATH_TAKES_NULL, [
802 void exit_on_core(int ignored) {
808 signal(SIGSEGV, exit_on_core);
809 newpath = realpath("/tmp", NULL);
810 exit((newpath != NULL) ? 0 : 1);
812 neta_cv_REALPATH_TAKES_NULL=yes,
813 neta_cv_REALPATH_TAKES_NULL=no,
814 neta_cv_REALPATH_TAKES_NULL=cross
819 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
820 AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])