- dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
- AC_MSG_CHECKING([for struct atalk_addr])
-dnl AC_COMPILE_IFELSE([
- AC_TRY_COMPILE([
-#include <sys/socket.h>
-#include <asm/types.h>
-#include <linux/atalk.h>
-
- struct atalk_addr foo;
-],
-[ ], [
- ac_have_atalk_addr=yes
- AC_MSG_RESULT([yes])
- ], [
- AC_MSG_RESULT([no])
- ])
-
-if test "x$ac_have_atalk_addr" = "xyes"; then
- AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
-fi
-
- dnl ----- check if we need the quotactl wrapper
-# AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
-# AC_CHECK_FUNC(quotactl,,
-# AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed])
-# AC_MSG_RESULT([enabling quotactl wrapper])
-# )
-
- # For quotas on Linux XFS filesystems
-
- # For linux > 2.5.56
- AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
- [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
- AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
- )
-
-
- dnl ----- as far as I can tell, dbtob always does the wrong thing
- dnl ----- on every single version of linux I've ever played with.
- dnl ----- see etc/afpd/quota.c
- AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
-
-
- dnl ----- Linux/alpha specific -----
- if test x"$this_cpu" = "xalpha"; then
- AC_MSG_RESULT([enabling gcc memcpy bug workaround])
- AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
- fi
- need_dash_r=no
-
-
-fi
-
-dnl ----- Mac OSX specific -----
-if test x"$this_os" = "xmacosx"; then
- AC_MSG_RESULT([ * Mac OSX specific configuration])
- AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
- AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
- dnl AC_DEFINE(NO_DLFCN_H)
- AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
- AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
- AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
-fi
-
-dnl ----- NetBSD 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 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 -----
- AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
-fi
-
-dnl ----- OpenBSD specific -----
-if test x"$this_os" = "xopenbsd"; then
- AC_MSG_RESULT([ * OpenBSD specific configuration])
- AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
- dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
- AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
- AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
-fi
-
-dnl ----- Solaris specific -----
-if test x"$this_os" = "xsolaris"; then
- AC_MSG_RESULT([ * Solaris specific configuration])
- AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
- AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
- AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
- AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
- CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
- need_dash_r=yes
- sysv_style=solaris
-
- solaris_module=no
- AC_MSG_CHECKING([if we can build Solaris kernel module])
- if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
- solaris_module=yes
- fi
- AC_MSG_RESULT([$solaris_module])
-
- COMPILE_64BIT_KMODULE=no
- KCFLAGS=""
- KLDFLAGS=""
- COMPILE_KERNEL_GCC=no
-
- if test "$solaris_module" = "yes"; then
- dnl Solaris kernel module stuff
- AC_MSG_CHECKING([if we have to build a 64bit kernel module])
-
- # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
- if test -x /usr/bin/isainfo; then
- # check for 64 bit platform
- if isainfo -kv | grep '^64-bit'; then
- COMPILE_64BIT_KMODULE=yes
- fi
- fi
-
- AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
-
- if test "${GCC}" = yes; then
- COMPILE_KERNEL_GCC=yes
- if test "$COMPILE_64BIT_KMODULE" = yes; then
-
- AC_MSG_CHECKING([if we can build a 64bit kernel module])
-
- case `$CC --version 2>/dev/null` in
- [[12]].* | 3.0.*)
- COMPILE_64BIT_KMODULE=no
- COMPILE_KERNEL_GCC=no
- solaris_module=no;;
- *)
- # use for 64 bit
- KCFLAGS="-m64"
- #KLDFLAGS="-melf64_sparc"
- KLDFLAGS="-64";;
- esac
-
- AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
-
- else
- KCFLAGS=""
- KLDFLAGS=""
- fi
- KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
- else
- if test "$COMPILE_64BIT_KMODULE" = yes; then
- # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
- KCFLAGS="-xarch=v9 -xregs=no%appl"
- KLDFLAGS="-64"
- else
- KCFLAGS=""
- KLDFLAGS=""
- fi
- KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
- fi
-
- AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
- AC_TRY_LINK([\
-#include <sys/stream.h>
-#include <sys/ddi.h>],
-[\
-timeout_id_t dummy;
-],
-netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
-
- AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
- fi
-
- AC_SUBST(COMPILE_KERNEL_GCC)
- AC_SUBST(COMPILE_64BIT_KMODULE)
- AC_SUBST(KCFLAGS)
- AC_SUBST(KLDFLAGS)
-fi
-
-dnl ----- Tru64 specific -----
-if test x"$this_os" = "xtru64"; then
- AC_MSG_RESULT([ * Tru64 specific configuration])
- AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
- AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
- dnl AC_DEFINE(USE_MOUNT_H)
- AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
- dnl AC_DEFINE(USE_UFS_QUOTA_H)
- AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
- AC_DEFINE(_OSF_SOURCE, 1, [Define if the *passwd UAMs should be used])
- AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for Berkeley DB 4])
- AC_CHECK_LIB(security,set_auth_parameters)
- CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
- need_dash_r=no
- sysv_style=tru64
-fi
-
-dnl ------ Check for sendfile() --------
-netatalk_cv_search_sendfile=yes
-AC_ARG_ENABLE(sendfile,
- [ --disable-sendfile disable sendfile syscall],
- [if test x"$enableval" = x"no"; then
- netatalk_cv_search_sendfile=no
- fi]
-)
-
-if test x"$netatalk_cv_search_sendfile" = x"yes"; then
- case "$host_os" in
- *linux*)
- AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
- AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
- ;;
-
- *solaris*)
- AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()])
- AC_SEARCH_LIBS(sendfile, sendfile)
- AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
-dnl -- there's a bug somewhere, disable for now
- netatalk_cv_HAVE_SENDFILE=no
- ;;