1 dnl Kitchen sink for configuration macros
3 dnl Filesystem Hierarchy Standard (FHS) compatibility
4 AC_DEFUN([AC_NETATALK_FHS], [
5 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
7 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[
8 if test "$enableval" = "yes"; then
9 uams_path="${libdir}/netatalk"
11 PKGCONFDIR=${sysconfdir}/netatalk
12 SERVERTEXT="${PKGCONFDIR}/msg"
14 mandir="/usr/share/man"
15 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
25 dnl 64bit platform check
26 AC_DEFUN([AC_NETATALK_64BIT_LIBS], [
27 AC_MSG_CHECKING([whether to check for 64bit libraries])
28 # Test if the compiler is in 64bit mode
29 echo 'int i;' > conftest.$ac_ext
30 atalk_cv_cc_64bit_output=no
31 if AC_TRY_EVAL(ac_compile); then
32 case `/usr/bin/file conftest.$ac_objext` in
34 atalk_cv_cc_64bit_output=yes
40 case $host_cpu:$atalk_cv_cc_64bit_output in
41 powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
45 atalk_libname="lib/64"
64 dnl Check for optional admin group support
65 AC_DEFUN([AC_NETATALK_ADMIN_GROUP], [
66 netatalk_cv_admin_group=yes
67 AC_MSG_CHECKING([for administrative group support])
68 AC_ARG_ENABLE(admin-group,
69 [ --disable-admin-group disable admin group],[
70 if test x"$enableval" = x"no"; then
71 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
72 netatalk_cv_admin_group=no
75 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
78 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
83 dnl Check for optional cracklib support
84 AC_DEFUN([AC_NETATALK_CRACKLIB], [
85 netatalk_cv_with_cracklib=no
87 [ --with-cracklib=DICT enable/set location of cracklib dictionary],[
88 if test "x$withval" != "xno" ; then
90 AC_CHECK_LIB(crack, main, [
91 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
93 if test "$cracklib" = "yes"; then
94 cracklib="/usr/$atalk_libname/cracklib_dict"
96 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
97 [path to cracklib dictionary])
98 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
99 netatalk_cv_with_cracklib=yes
101 AC_MSG_ERROR([cracklib not found!])
107 AC_MSG_CHECKING([for cracklib support])
108 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
111 dnl Check whether to enable debug code
112 AC_DEFUN([AC_NETATALK_DEBUG], [
113 AC_MSG_CHECKING([whether to enable verbose debug code])
115 [ --enable-debug enable verbose debug code],[
116 if test "$enableval" != "no"; then
117 if test "$enableval" = "yes"; then
118 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
120 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
125 AC_DEFINE(NDEBUG, 1, [Disable assertions])
129 AC_DEFINE(NDEBUG, 1, [Disable assertions])
134 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
135 AC_DEFUN([AC_NETATALK_DEBUGGING], [
136 AC_MSG_CHECKING([whether to enable debugging with debuggers])
137 AC_ARG_ENABLE(debugging,
138 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
139 if test "$enableval" != "no"; then
140 if test "$enableval" = "yes"; then
141 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
143 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
156 dnl Check for optional shadow password support
157 AC_DEFUN([AC_NETATALK_SHADOW], [
158 netatalk_cv_use_shadowpw=no
160 [ --with-shadow enable shadow password support [[auto]]],
161 [netatalk_cv_use_shadowpw="$withval"],
162 [netatalk_cv_use_shadowpw=auto]
165 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
166 AC_CHECK_HEADER([shadow.h])
167 if test x"$ac_cv_header_shadow_h" = x"yes"; then
168 netatalk_cv_use_shadowpw=yes
169 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
171 if test "x$shadowpw" = "xyes"; then
172 AC_MSG_ERROR([shadow support not available])
174 netatalk_cv_use_shadowpw=no
179 AC_MSG_CHECKING([whether shadow support should be enabled])
180 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
187 dnl Check for optional valid-shell-check support
188 AC_DEFUN([AC_NETATALK_SHELL_CHECK], [
189 netatalk_cv_use_shellcheck=yes
190 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
191 AC_ARG_ENABLE(shell-check,
192 [ --disable-shell-check disable checking for a valid shell],[
193 if test "$enableval" = "no"; then
194 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
196 netatalk_cv_use_shellcheck=no
206 dnl Check for optional sysv initscript install
207 AC_DEFUN([AC_NETATALK_INIT_STYLE], [
208 AC_ARG_WITH(init-style,
209 [ --with-init-style use OS specific init config [[redhat-sysv|redhat-systemd|suse-sysv|suse-systemd|gentoo|netbsd|debian|systemd]]],
210 init_style="$withval", init_style=none
212 case "$init_style" in
214 AC_MSG_ERROR([--with-init-style=redhat is obsoleted. Use redhat-sysv or redhat-systemd.])
217 AC_MSG_RESULT([enabling redhat-style sysv (upstart) configuration])
220 AC_MSG_RESULT([enabling redhat-style systemd support])
223 AC_MSG_ERROR([--with-init-style=suse is obsoleted. Use suse-sysv or suse-systemd.])
226 AC_MSG_RESULT([enabling suse-style sysv configuration])
229 AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
232 AC_MSG_RESULT([enabling gentoo-style sysv support])
235 AC_MSG_RESULT([enabling netbsd-style sysv support])
238 AC_MSG_RESULT([enabling debian-style sysv support])
241 AC_MSG_RESULT([use general systemd configuration])
244 AC_MSG_RESULT([disabling sysv support])
247 AM_CONDITIONAL(USE_NETBSD, test x$init_style = xnetbsd)
248 AM_CONDITIONAL(USE_REDHAT_SYSV, test x$init_style = xredhat-sysv)
249 AM_CONDITIONAL(USE_SUSE_SYSV, test x$init_style = xsuse-sysv)
250 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
251 AM_CONDITIONAL(USE_TRU64, test x$init_style = xtru64)
252 AM_CONDITIONAL(USE_SOLARIS, test x$init_style = xsolaris)
253 AM_CONDITIONAL(USE_GENTOO, test x$init_style = xgentoo)
254 AM_CONDITIONAL(USE_DEBIAN, test x$init_style = xdebian)
255 AM_CONDITIONAL(USE_SYSTEMD, test x$init_style = xsystemd || test x$init_style = xredhat-systemd || test x$init_style = xsuse-systemd)
256 AM_CONDITIONAL(USE_UNDEF, test x$init_style = xnone)
260 dnl OS specific configuration
261 AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
263 *aix*) this_os=aix ;;
264 *freebsd*) this_os=freebsd ;;
265 *hpux11*) this_os=hpux11 ;;
266 *irix*) this_os=irix ;;
267 *linux*) this_os=linux ;;
268 *osx*) this_os=macosx ;;
269 *darwin*) this_os=macosx ;;
270 *netbsd*) this_os=netbsd ;;
271 *openbsd*) this_os=openbsd ;;
272 *osf*) this_os=tru64 ;;
273 *solaris*) this_os=solaris ;;
277 i386|i486|i586|i686|k7) this_cpu=x86 ;;
278 alpha) this_cpu=alpha ;;
279 mips) this_cpu=mips ;;
280 powerpc|ppc) this_cpu=ppc ;;
283 dnl --------------------- GNU source
285 linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
287 kfreebsd-gnu) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
291 dnl --------------------- operating system specific flags (port from sys/*)
293 dnl ----- FreeBSD specific -----
294 if test x"$this_os" = "xfreebsd"; then
295 AC_MSG_RESULT([ * FreeBSD specific configuration])
296 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
297 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
298 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
301 dnl ----- GNU/kFreeBSD specific -----
302 if test x"$this_os" = "xkfreebsd-gnu"; then
303 AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration])
304 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
305 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
306 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
309 dnl ----- Linux specific -----
310 if test x"$this_os" = "xlinux"; then
311 AC_MSG_RESULT([ * Linux specific configuration])
313 dnl ----- check if we need the quotactl wrapper
314 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
315 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
316 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
320 dnl ----- as far as I can tell, dbtob always does the wrong thing
321 dnl ----- on every single version of linux I've ever played with.
322 dnl ----- see etc/afpd/quota.c
323 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
328 dnl ----- NetBSD specific -----
329 if test x"$this_os" = "xnetbsd"; then
330 AC_MSG_RESULT([ * NetBSD specific configuration])
331 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
332 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
333 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
335 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
338 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
339 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
342 dnl ----- OpenBSD specific -----
343 if test x"$this_os" = "xopenbsd"; then
344 AC_MSG_RESULT([ * OpenBSD specific configuration])
345 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
346 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
347 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
350 dnl ----- Solaris specific -----
351 if test x"$this_os" = "xsolaris"; then
352 AC_MSG_RESULT([ * Solaris specific configuration])
353 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
354 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
355 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
356 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
357 AC_DEFINE(_XOPEN_SOURCE, 600, [Solaris compilation environment])
358 AC_DEFINE(__EXTENSIONS__, 1, [Solaris compilation environment])
359 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
364 AC_MSG_CHECKING([if we can build Solaris kernel module])
365 if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
368 AC_MSG_RESULT([$solaris_module])
370 COMPILE_64BIT_KMODULE=no
373 COMPILE_KERNEL_GCC=no
375 if test "$solaris_module" = "yes"; then
376 dnl Solaris kernel module stuff
377 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
379 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
380 if test -x /usr/bin/isainfo; then
381 # check for 64 bit platform
382 if isainfo -kv | grep '^64-bit'; then
383 COMPILE_64BIT_KMODULE=yes
387 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
389 if test "${GCC}" = yes; then
390 COMPILE_KERNEL_GCC=yes
391 if test "$COMPILE_64BIT_KMODULE" = yes; then
393 AC_MSG_CHECKING([if we can build a 64bit kernel module])
395 case `$CC --version 2>/dev/null` in
397 COMPILE_64BIT_KMODULE=no
398 COMPILE_KERNEL_GCC=no
403 #KLDFLAGS="-melf64_sparc"
407 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
413 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
415 if test "$COMPILE_64BIT_KMODULE" = yes; then
416 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
417 KCFLAGS="-xarch=v9 -xregs=no%appl"
423 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
426 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
428 #include <sys/stream.h>
429 #include <sys/ddi.h>],
433 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
435 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
438 AC_SUBST(COMPILE_KERNEL_GCC)
439 AC_SUBST(COMPILE_64BIT_KMODULE)
446 dnl Check for building PGP UAM module
447 AC_DEFUN([AC_NETATALK_PGP_UAM], [
448 AC_MSG_CHECKING([whether the PGP UAM should be build])
449 AC_ARG_ENABLE(pgp-uam,
450 [ --enable-pgp-uam enable build of PGP UAM module],[
451 if test "$enableval" = "yes"; then
452 if test "x$neta_cv_have_openssl" = "xyes"; then
453 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
466 dnl Check for building Kerberos V UAM module
467 AC_DEFUN([AC_NETATALK_KRB5_UAM], [
468 netatalk_cv_build_krb5_uam=no
469 AC_ARG_ENABLE(krbV-uam,
470 [ --enable-krbV-uam enable build of Kerberos V UAM module],
472 if test x"$enableval" = x"yes"; then
473 NETATALK_GSSAPI_CHECK([
474 netatalk_cv_build_krb5_uam=yes
476 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
483 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
484 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
489 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
492 AC_DEFUN([AC_NETATALK_KERBEROS], [
493 AC_MSG_CHECKING([for Kerberos 5 (necessary for GetSrvrInfo:DirectoryNames support)])
494 AC_ARG_WITH([kerberos],
495 [AS_HELP_STRING([--with-kerberos], [Kerberos 5 support (default=auto)])],
497 [with_kerberos=auto])
498 AC_MSG_RESULT($with_kerberos)
500 if test x"$with_kerberos" != x"no"; then
501 have_krb5_header="no"
502 AC_CHECK_HEADERS([krb5/krb5.h krb5.h], [have_krb5_header="yes"; break])
503 if test x"$have_krb5_header" = x"no" && test x"$with_kerberos" != x"auto"; then
504 AC_MSG_FAILURE([--with-kerberos was given, but no headers found])
507 AC_PATH_PROG([KRB5_CONFIG], [krb5-config])
508 AC_MSG_CHECKING([for krb5-config])
509 if test -x "$KRB5_CONFIG"; then
510 AC_MSG_RESULT([$KRB5_CONFIG])
511 CFLAGS="$CFLAGS `$KRB5_CONFIG --cflags krb5`"
512 LIBS="`$KRB5_CONFIG --libs krb5` $LIBS"
515 AC_MSG_RESULT([not found])
516 if test x"$with_kerberos" != x"auto"; then
517 AC_MSG_FAILURE([--with-kerberos was given, but krb5-config could not be found])
522 if test x"$with_kerberos" = x"yes"; then
523 AC_DEFINE([HAVE_KERBEROS], [1], [Define if Kerberos 5 is available])
527 dnl Check for overwrite the config files or not
528 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
529 AC_MSG_CHECKING([whether configuration files should be overwritten])
530 AC_ARG_ENABLE(overwrite,
531 [ --enable-overwrite overwrite configuration files during installation],
532 [OVERWRITE_CONFIG="${enable_overwrite}"],
533 [OVERWRITE_CONFIG="no"]
535 AC_MSG_RESULT([$OVERWRITE_CONFIG])
536 AC_SUBST(OVERWRITE_CONFIG)
539 dnl Check for LDAP support, for client-side ACL visibility
540 AC_DEFUN([AC_NETATALK_LDAP], [
541 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
543 [AS_HELP_STRING([--with-ldap],
544 [LDAP support (default=auto)])],
553 AC_MSG_RESULT($with_ldap)
555 if test x"$with_ldap" != x"no" ; then
556 AC_CHECK_HEADER([ldap.h], with_ldap=yes,
557 [ if test x"$with_ldap" = x"yes" ; then
558 AC_MSG_ERROR([Missing LDAP headers])
562 AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
563 [ if test x"$with_ldap" = x"yes" ; then
564 AC_MSG_ERROR([Missing LDAP library])
570 if test x"$with_ldap" = x"yes"; then
571 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
575 dnl Check for ACL support
576 AC_DEFUN([AC_NETATALK_ACL], [
577 AC_MSG_CHECKING(whether to support ACLs)
579 [AS_HELP_STRING([--with-acls],
580 [Include ACL support (default=auto)])],
583 with_acl_support="$withval"
586 with_acl_support=auto
589 [with_acl_support=auto])
590 AC_MSG_RESULT($with_acl_support)
592 if test x"$with_acl_support" = x"no"; then
593 AC_MSG_RESULT(Disabling ACL support)
594 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
599 if test x"$with_acl_support" = x"yes" ; then
600 AC_MSG_NOTICE(checking whether ACL support is available:)
603 AC_MSG_NOTICE(Using UnixWare ACLs)
604 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
607 AC_MSG_NOTICE(Using solaris ACLs)
608 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
609 ACL_LIBS="$ACL_LIBS -lsec"
612 AC_MSG_NOTICE(Using HPUX ACLs)
613 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
616 AC_MSG_NOTICE(Using IRIX ACLs)
617 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
620 AC_MSG_NOTICE(Using AIX ACLs)
621 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
624 AC_MSG_NOTICE(Using Tru64 ACLs)
625 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
626 ACL_LIBS="$ACL_LIBS -lpacl"
629 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
630 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
633 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
636 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
639 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
641 LIBS="$LIBS $ACL_LIBS"
643 #include <sys/types.h>
648 acl_entry_t *entry_p;
649 return acl_get_entry(acl, entry_id, entry_p);
651 [netatalk_cv_HAVE_POSIX_ACLS=yes],
652 [netatalk_cv_HAVE_POSIX_ACLS=no
653 with_acl_support=no])
656 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
657 AC_MSG_NOTICE(Using POSIX ACLs)
658 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
659 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
661 LIBS="$LIBS $ACL_LIBS"
663 #include <sys/types.h>
666 acl_permset_t permset_d;
668 return acl_get_perm_np(permset_d, perm);
670 [netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],
671 [netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
674 if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
675 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
679 AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
681 LIBS="$LIBS $ACL_LIBS"
682 AC_CHECK_FUNCS(acl_from_mode,
683 [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
684 [netatalk_cv_HAVE_ACL_FROM_MODE=no])
687 if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
688 AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
692 AC_MSG_NOTICE(ACL support is not avaliable)
693 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
699 if test x"$with_acl_support" = x"yes" ; then
700 AC_CHECK_HEADERS([acl/libacl.h])
701 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
706 dnl Check for Extended Attributes support
707 AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
709 neta_cv_eas_sys_found=no
710 neta_cv_eas_sys_not_found=no
712 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
717 AC_SEARCH_LIBS(getproplist, [proplist])
718 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
719 [neta_cv_eas_sys_found=yes],
720 [neta_cv_eas_sys_not_found=yes])
721 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
722 [neta_cv_eas_sys_not_found=yes])
723 AC_CHECK_FUNCS([sizeof_proplist_entry],,
724 [neta_cv_eas_sys_not_found=yes])
728 AC_CHECK_FUNCS([attropen],
729 [neta_cv_eas_sys_found=yes; AC_DEFINE(HAVE_EAFD, 1, [extattr API has full fledged fds for EAs])],
730 [neta_cv_eas_sys_not_found=yes])
734 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
735 [neta_cv_eas_sys_found=yes],
736 [neta_cv_eas_sys_not_found=yes])
737 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
738 [neta_cv_eas_sys_not_found=yes])
739 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
740 [neta_cv_eas_sys_not_found=yes])
741 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
742 [neta_cv_eas_sys_not_found=yes])
745 *freebsd4* | *dragonfly* )
746 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
750 AC_SEARCH_LIBS(getxattr, [attr])
752 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
753 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
754 [neta_cv_eas_sys_found=yes],
755 [neta_cv_eas_sys_not_found=yes])
756 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
757 [neta_cv_eas_sys_not_found=yes])
758 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
759 [neta_cv_eas_sys_not_found=yes])
762 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
763 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
764 [neta_cv_eas_sys_found=yes],
765 [neta_cv_eas_sys_not_found=yes])
766 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
767 [neta_cv_eas_sys_not_found=yes])
770 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
771 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
772 [neta_cv_eas_sys_not_found=yes])
773 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
774 [neta_cv_eas_sys_not_found=yes])
779 # Do xattr functions take additional options like on Darwin?
780 if test x"$ac_cv_func_getxattr" = x"yes" ; then
781 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
783 LIBS="$LIBS $ACL_LIBS"
785 #include <sys/types.h>
786 #if HAVE_ATTR_XATTR_H
787 #include <attr/xattr.h>
788 #elif HAVE_SYS_XATTR_H
789 #include <sys/xattr.h>
792 getxattr(0, 0, 0, 0, 0, 0);
794 [smb_attr_cv_xattr_add_opt=yes],
795 [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
797 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
798 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
802 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
803 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
804 neta_cv_eas="$neta_cv_eas | sys"
807 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
810 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
811 dnl Defines "neta_cv_have_smbshmd" to "yes" or "no"
812 dnl AC_SUBST's "SMB_SHAREMODES_CFLAGS" and "SMB_SHAREMODES_LDFLAGS"
813 dnl AM_CONDITIONAL's "USE_SMB_SHAREMODES"
814 AC_DEFUN([AC_NETATALK_SMB_SHAREMODES], [
815 neta_cv_have_smbshmd=no
816 AC_ARG_WITH(smbsharemodes-lib,
817 [ --with-smbsharemodes-lib=PATH PATH to libsmbsharemodes lib from Samba],
818 [SMB_SHAREMODES_LDFLAGS="-L$withval -lsmbsharemodes"]
820 AC_ARG_WITH(smbsharemodes-include,
821 [ --with-smbsharemodes-include=PATH PATH to libsmbsharemodes header from Samba],
822 [SMB_SHAREMODES_CFLAGS="-I$withval"]
824 AC_ARG_WITH(smbsharemodes,
825 [AS_HELP_STRING([--with-smbsharemodes],[Samba interop (default is yes)])],
826 [use_smbsharemodes=$withval],
827 [use_smbsharemodes=yes]
830 if test x"$use_smbsharemodes" = x"yes" ; then
831 AC_MSG_CHECKING([whether to enable Samba/Netatalk access/deny/share-modes interop])
833 saved_CFLAGS="$CFLAGS"
834 saved_LDFLAGS="$LDFLAGS"
835 CFLAGS="$SMB_SHAREMODES_CFLAGS $CFLAGS"
836 LDFLAGS="$SMB_SHAREMODES_LDFLAGS $LDFLAGS"
841 #include <sys/time.h>
844 /* From messages.h */
848 #include "smb_share_modes.h"
849 int main(void) { (void)smb_share_mode_db_open(""); return 0;}],
850 [neta_cv_have_smbshmd=yes]
853 AC_MSG_RESULT($neta_cv_have_smbshmd)
854 AC_SUBST(SMB_SHAREMODES_CFLAGS, [$SMB_SHAREMODES_CFLAGS])
855 AC_SUBST(SMB_SHAREMODES_LDFLAGS, [$SMB_SHAREMODES_LDFLAGS])
856 CFLAGS="$saved_CFLAGS"
857 LDFLAGS="$saved_LDFLAGS"
860 AM_CONDITIONAL(USE_SMB_SHAREMODES, test x"$neta_cv_have_smbshmd" = x"yes")
863 dnl ------ Check for sendfile() --------
864 AC_DEFUN([AC_NETATALK_SENDFILE], [
865 netatalk_cv_search_sendfile=yes
866 AC_ARG_ENABLE(sendfile,
867 [ --disable-sendfile disable sendfile syscall],
868 [if test x"$enableval" = x"no"; then
869 netatalk_cv_search_sendfile=no
873 if test x"$netatalk_cv_search_sendfile" = x"yes"; then
876 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
877 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
881 AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()])
882 AC_SEARCH_LIBS(sendfile, sendfile)
883 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
887 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
888 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
896 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
897 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
902 dnl --------------------- Check if realpath() takes NULL
903 AC_DEFUN([AC_NETATALK_REALPATH], [
904 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
905 neta_cv_REALPATH_TAKES_NULL, [
911 void exit_on_core(int ignored) {
917 signal(SIGSEGV, exit_on_core);
918 newpath = realpath("/tmp", NULL);
919 exit((newpath != NULL) ? 0 : 1);
921 neta_cv_REALPATH_TAKES_NULL=yes,
922 neta_cv_REALPATH_TAKES_NULL=no,
923 neta_cv_REALPATH_TAKES_NULL=cross
928 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
929 AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])