1 dnl configure.in for netatalk
3 AC_INIT(etc/afpd/main.c)
5 NETATALK_VERSION=`cat $srcdir/VERSION`
6 AC_SUBST(NETATALK_VERSION)
9 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
10 AM_CONFIG_HEADER(config.h)
12 dnl Checks for programs.
26 dnl Request SUSv3 standard interfaces plus anything else the platform may have
27 CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -D_GNU_SOURCE"
29 dnl Checks for header files.
32 AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h time.h stdarg.h)
33 AC_CHECK_HEADERS(mntent.h syslog.h unistd.h termios.h ufs/quota.h)
34 AC_CHECK_HEADERS(netdb.h sgtty.h mount.h statfs.h dlfcn.h errno.h langinfo.h locale.h)
35 AC_CHECK_HEADERS(sys/param.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h)
36 AC_CHECK_HEADERS(sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h)
37 AC_CHECK_HEADERS(sys/termios.h sys/types.h sys/errno.h sys/uio.h sys/filio.h)
38 AC_CHECK_HEADER(sys/cdefs.h,,
39 AC_MSG_RESULT([enabling generic cdefs.h from tree])
40 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
43 AC_CHECK_HEADERS([sys/mount.h], , ,
44 [#ifdef HAVE_SYS_PARAM_H
45 #include <sys/param.h>
49 dnl Checks for typedefs, structures, and compiler characteristics.
61 dnl --------------------------------------------------------------------------
62 dnl check if dlsym needs to add an underscore, uses libtool macros
63 dnl --------------------------------------------------------------------------
65 AC_CHECK_FUNCS(dlopen dlsym dlclose)
67 if test x"$libltdl_cv_need_uscore" = xyes; then
68 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
72 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
74 dnl these tests have been comfirmed to be needed in 2011
75 AC_CHECK_FUNC(renameat, AC_DEFINE([_ATFILE_SOURCE], 1, AT file source))
76 AC_CHECK_FUNCS(backtrace_symbols dirfd getusershell pread pwrite pselect)
77 AC_CHECK_FUNCS(setlinebuf strlcat strlcpy strnlen)
79 dnl search for necessary libraries
80 AC_SEARCH_LIBS(gethostbyname, nsl)
81 AC_SEARCH_LIBS(connect, socket)
82 AC_SEARCH_LIBS(pthread_sigmask, pthread,,[AC_MSG_ERROR([missing pthread_sigmask])])
83 if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
84 PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
86 AC_SUBST(PTHREAD_LIBS)
89 dnl Checks for (v)snprintf
90 NETATALK_SNPRINTF_CHECK
92 dnl --------------------------------------------------------------------------
93 dnl 64bit platform check
94 dnl --------------------------------------------------------------------------
96 AC_MSG_CHECKING([whether to check for 64bit libraries])
97 # Test if the compiler is in 64bit mode
98 echo 'int i;' > conftest.$ac_ext
99 atalk_cv_cc_64bit_output=no
100 if AC_TRY_EVAL(ac_compile); then
101 case `/usr/bin/file conftest.$ac_objext` in
103 atalk_cv_cc_64bit_output=yes
109 case $host_cpu:$atalk_cv_cc_64bit_output in
110 powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
114 atalk_libname="lib/64"
117 atalk_libname="lib64"
127 dnl --------------------------------------------------------------------------
128 dnl specific configuration comes in here:
129 dnl --------------------------------------------------------------------------
132 netatalk_cv_admin_group=yes
133 AC_MSG_CHECKING([for administrative group support])
134 AC_ARG_ENABLE(admin-group,
135 [ --disable-admin-group disable admin group],[
136 if test x"$enableval" = x"no"; then
137 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
138 netatalk_cv_admin_group=no
141 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
144 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
153 netatalk_cv_with_cracklib=no
154 AC_ARG_WITH(cracklib,
155 [ --with-cracklib=DICT enable/set location of cracklib dictionary],[
156 if test "x$withval" != "xno" ; then
158 AC_CHECK_LIB(crack, main, [
159 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
161 if test "$cracklib" = "yes"; then
162 cracklib="/usr/$atalk_libname/cracklib_dict"
164 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
165 [path to cracklib dictionary])
166 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
167 netatalk_cv_with_cracklib=yes
169 AC_MSG_ERROR([cracklib not found!])
175 AC_MSG_CHECKING([for cracklib support])
176 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
178 netatalk_cv_ddp_enabled=no
179 AC_MSG_CHECKING([whether to enable DDP])
181 [ --enable-ddp enable DDP (AppleTalk)],[
182 if test "$enableval" = "yes"; then
184 netatalk_cv_ddp_enabled=yes
187 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
191 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
195 AC_MSG_CHECKING([whether to enable debug code])
196 AC_ARG_ENABLE(debug1,
197 [ --enable-debug1 enable debug code],[
198 if test "$enableval" != "no"; then
199 if test "$enableval" = "yes"; then
200 AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included])
202 AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included])
213 AC_MSG_CHECKING([whether to enable verbose debug code])
215 [ --enable-debug enable verbose debug code],[
216 if test "$enableval" != "no"; then
217 if test "$enableval" = "yes"; then
218 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
220 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
225 AC_DEFINE(NDEBUG, 1, [Disable assertions])
229 AC_DEFINE(NDEBUG, 1, [Disable assertions])
233 AC_MSG_CHECKING([whether to enable debugging with debuggers])
234 AC_ARG_ENABLE(debugging,
235 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
236 if test "$enableval" != "no"; then
237 if test "$enableval" = "yes"; then
238 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
240 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
254 AC_MSG_CHECKING([whether AFP 3.x calls should be enabled])
256 [ --disable-afp3 disable AFP 3.x calls],
258 if test x"$enableval" != x"no"; then
271 if test x"$afp3" = x"yes"; then
273 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
275 if test x"$afp3set" = x"yes"; then
276 AC_MSG_ERROR([AFP 3.x support requires Large File Support.])
278 AC_MSG_WARN([AFP 3.x support requires Large File Support. AFP3.x support disabled])
286 dnl ----------- A NOTE ABOUT DROPKLUDGE
287 dnl The trouble with this fix is that if you know what the file is called, it
288 dnl can be read from the Unix side. That's okay for most academic institutions
289 dnl since the students don't have telnet access to the Mac servers. There is
290 dnl currently no one working on further development/fixes of DROPKLUDGE.
293 netatalk_cv_dropkludge=no
294 AC_MSG_CHECKING([whether to enable experimental dropbox support])
295 AC_ARG_ENABLE(dropkludge,
296 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],[
297 if test "$enableval" = "yes"; then
298 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
300 netatalk_cv_dropkludge=yes
309 netatalk_cv_force_uidgid=no
310 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
311 AC_ARG_ENABLE(force-uidgid,
312 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],[
313 if test "$enableval" = "yes"; then
314 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
315 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
317 netatalk_cv_force_uidgid=yes
326 dnl Check for CNID database backends
328 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
330 dnl Check for quota support
333 dnl Check for optional server location protocol support (used by MacOS X)
336 dnl Check for optional Zeroconf support
339 dnl Check for PAM libs
340 netatalk_cv_use_pam=no
344 netatalk_cv_use_pam=yes
345 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
348 netatalk_cv_use_shadowpw=no
350 [ --with-shadow enable shadow password support [[auto]]],
351 [netatalk_cv_use_shadowpw="$withval"],
352 [netatalk_cv_use_shadowpw=auto]
355 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
356 AC_CHECK_HEADER([shadow.h])
357 if test x"$ac_cv_header_shadow_h" = x"yes"; then
358 netatalk_cv_use_shadowpw=yes
359 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
361 if test "x$shadowpw" = "xyes"; then
362 AC_MSG_ERROR([shadow support not available])
364 netatalk_cv_use_shadowpw=no
369 AC_MSG_CHECKING([whether shadow support should be enabled])
370 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
378 netatalk_cv_use_shellcheck=yes
379 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
380 AC_ARG_ENABLE(shell-check,
381 [ --disable-shell-check disable checking for a valid shell],[
382 if test "$enableval" = "no"; then
383 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
385 netatalk_cv_use_shellcheck=no
394 NETATALK_TCP_WRAPPERS
396 AC_MSG_CHECKING([whether system (fcntl) locking should be disabled])
397 AC_ARG_ENABLE(locking,
398 [ --disable-locking disable system locking],[
399 if test "$enableval" = "no"; then
400 AC_DEFINE(DISABLE_LOCKING, 1, [Define if system (fcntl) locking should be disabled])
413 AC_ARG_ENABLE(redhat,
414 [ --enable-redhat use redhat-style sysv configuration ],[
415 if test "$enableval" = "yes"; then
418 AC_MSG_RESULT([enabling redhat-style sysv support])
423 [ --enable-suse use suse-style sysv configuration ],[
424 if test "$enableval" = "yes"; then
427 AC_MSG_RESULT([enabling suse-style sysv support])
431 AC_ARG_ENABLE(gentoo,
432 [ --enable-gentoo use gentoo-style sysv configuration ],[
433 if test "$enableval" = "yes"; then
436 AC_MSG_RESULT([enabling gentoo-style sysv support])
440 AC_ARG_ENABLE(cobalt,
441 [ --enable-cobalt use cobalt-style sysv configuration ],
442 if test "$enableval" = "yes"; then
445 AC_MSG_RESULT([enabling cobalt-style sysv support])
448 AC_ARG_ENABLE(netbsd,
449 [ --enable-netbsd use NetBSD-style rc.d configuration ],
450 if test "x$enableval" = "xyes"; then
453 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
456 AC_ARG_ENABLE(debian,
457 [ --enable-debian use debian-style sysv configuration ],[
458 if test "$enableval" = "yes"; then
461 AC_MSG_RESULT([enabling debian-style sysv support])
465 dnl ----- timelord compilation (disabled by default)
466 AC_MSG_CHECKING([whether timelord should be compiled])
468 AC_ARG_ENABLE(timelord,
469 [ --enable-timelord enable compilation of timelord server],
470 [compile_timelord="$enableval"],
471 [compile_timelord="no"]
473 AC_MSG_RESULT([$compile_timelord])
475 dnl ----- a2boot compilation (disabled by default)
476 AC_MSG_CHECKING([whether a2boot should be compiled])
478 AC_ARG_ENABLE(a2boot,
479 [ --enable-a2boot enable compilation of Apple2 boot server],
480 [compile_a2boot="$enableval"],
481 [compile_a2boot="no"]
483 AC_MSG_RESULT([$compile_a2boot])
485 AC_ARG_WITH(uams-path,
486 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],[
489 uams_path="${PKGCONFDIR}/uams"
495 dnl check if we can use attribute unused (gcc only) from ethereal
496 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
497 if test x$GCC != x ; then
498 CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
501 CFLAGS="-D_U_=\"\" $CFLAGS"
505 dnl --------------------------------------------------------------------------
506 dnl FHS stuff has to be done last because it overrides other defaults
507 dnl --------------------------------------------------------------------------
509 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
511 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[
512 if test "$enableval" = "yes"; then
513 uams_path="${libdir}/netatalk"
515 PKGCONFDIR=${sysconfdir}/netatalk
516 SERVERTEXT="${PKGCONFDIR}/msg"
518 mandir="/usr/share/man"
519 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
529 dnl --------------------------------------------------------------------------
530 dnl post-FHS substitutions, etc
531 dnl --------------------------------------------------------------------------
534 dnl AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
535 dnl [path to UAMs [default=PKGCONF/uams]])
536 UAMS_PATH="${uams_path}"
539 dnl --------------------------------------------------------------------------
540 dnl drop in includes for top level directory structures here...
541 dnl --------------------------------------------------------------------------
543 dnl Note: $(top_srcdir)/include should be added before all other includes
544 dnl so that includes from that directory a preferred to includes from
545 dnl /usr/include or similar places.
546 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
547 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
549 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
551 dnl --------------------------------------------------------------------------
552 dnl specific configuration comes in here:
553 dnl --------------------------------------------------------------------------
555 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
557 dnl --------------------- determine operating system from "target"
559 *aix*) this_os=aix ;;
560 *freebsd*) this_os=freebsd ;;
561 *hpux11*) this_os=hpux11 ;;
562 *irix*) this_os=irix ;;
563 *linux*) this_os=linux ;;
564 *osx*) this_os=macosx ;;
565 *darwin*) this_os=macosx ;;
566 *netbsd*) this_os=netbsd ;;
567 *openbsd*) this_os=openbsd ;;
568 *osf*) this_os=tru64 ;;
569 *solaris*) this_os=solaris ;;
573 i386|i486|i586|i686|k7) this_cpu=x86 ;;
574 alpha) this_cpu=alpha ;;
575 mips) this_cpu=mips ;;
576 powerpc|ppc) this_cpu=ppc ;;
579 dnl --------------------- GNU source
581 linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
585 dnl --------------------- operating system specific flags (port from sys/*)
587 dnl ----- AIX specific -----
588 if test x"$this_os" = "xaix"; then
589 AC_MSG_RESULT([ * AIX specific configuration])
590 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
592 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
593 dnl compilation environment. It's enough to get things defined
594 dnl right in endian.h provided that long long is supported, though.
595 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
598 dnl ----- FreeBSD specific -----
599 if test x"$this_os" = "xfreebsd"; then
600 AC_MSG_RESULT([ * FreeBSD specific configuration])
601 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
602 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
603 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
604 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
607 dnl ----- HP-UX 11 specific -----
608 if test x"$this_os" = "xhpux11"; then
609 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
611 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
612 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
615 dnl ----- IRIX specific -----
616 if test x"$this_os" = "xirix"; then
617 AC_MSG_RESULT([ * IRIX specific configuration])
619 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
622 dnl ----- Linux specific -----
623 if test x"$this_os" = "xlinux"; then
624 AC_MSG_RESULT([ * Linux specific configuration])
626 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
627 AC_MSG_CHECKING([for struct atalk_addr])
628 dnl AC_COMPILE_IFELSE([
630 #include <sys/socket.h>
631 #include <asm/types.h>
632 #include <linux/atalk.h>
634 struct atalk_addr foo;
637 ac_have_atalk_addr=yes
643 if test "x$ac_have_atalk_addr" = "xyes"; then
644 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
647 dnl ----- check if we need the quotactl wrapper
648 # AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
649 # AC_CHECK_FUNC(quotactl,,
650 # AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed])
651 # AC_MSG_RESULT([enabling quotactl wrapper])
654 # For quotas on Linux XFS filesystems
657 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
658 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
659 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
663 dnl ----- as far as I can tell, dbtob always does the wrong thing
664 dnl ----- on every single version of linux I've ever played with.
665 dnl ----- see etc/afpd/quota.c
666 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
668 netatalk_cv_linux_sendfile=yes
669 AC_MSG_CHECKING([use sendfile syscall])
670 AC_ARG_ENABLE(sendfile,
671 [ --disable-sendfile disable linux sendfile syscall],[
672 if test x"$enableval" = x"no"; then
673 netatalk_cv_linux_sendfile=no
685 if test x"$netatalk_cv_linux_sendfile" = "xyes"; then
686 AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
687 AC_TRY_LINK([#include <sys/sendfile.h>],
692 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
694 netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
696 # Try and cope with broken Linux sendfile....
697 AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
699 #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
700 #undef _FILE_OFFSET_BITS
702 #include <sys/sendfile.h>],
707 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
709 netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
711 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
712 AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
713 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
714 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
715 elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
716 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
717 AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
718 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
720 netatalk_cv_linux_sendfile=no
725 dnl ----- Linux/alpha specific -----
726 if test x"$this_cpu" = "xalpha"; then
727 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
728 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
735 dnl ----- Mac OSX specific -----
736 if test x"$this_os" = "xmacosx"; then
737 AC_MSG_RESULT([ * Mac OSX specific configuration])
738 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
739 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
740 dnl AC_DEFINE(NO_DLFCN_H)
741 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
742 AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
743 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
746 dnl ----- NetBSD specific -----
747 if test x"$this_os" = "xnetbsd"; then
748 AC_MSG_RESULT([ * NetBSD specific configuration])
749 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
750 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
751 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
753 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
756 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
757 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
760 dnl ----- OpenBSD specific -----
761 if test x"$this_os" = "xopenbsd"; then
762 AC_MSG_RESULT([ * OpenBSD specific configuration])
763 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
764 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
767 dnl ----- Solaris specific -----
768 if test x"$this_os" = "xsolaris"; then
769 AC_MSG_RESULT([ * Solaris specific configuration])
770 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
771 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
772 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
773 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
774 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
779 AC_MSG_CHECKING([if we can build Solaris kernel module])
780 if test -x /usr/ccs/bin/ld && test x$netatalk_cv_ddp_enabled = yes ; then
783 AC_MSG_RESULT([$solaris_module])
785 COMPILE_64BIT_KMODULE=no
788 COMPILE_KERNEL_GCC=no
790 if test "$solaris_module" = "yes"; then
791 dnl Solaris kernel module stuff
792 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
794 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
795 if test -x /usr/bin/isainfo; then
796 # check for 64 bit platform
797 if isainfo -kv | grep '^64-bit'; then
798 COMPILE_64BIT_KMODULE=yes
802 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
804 if test "${GCC}" = yes; then
805 COMPILE_KERNEL_GCC=yes
806 if test "$COMPILE_64BIT_KMODULE" = yes; then
808 AC_MSG_CHECKING([if we can build a 64bit kernel module])
810 case `$CC --version 2>/dev/null` in
812 COMPILE_64BIT_KMODULE=no
813 COMPILE_KERNEL_GCC=no
818 #KLDFLAGS="-melf64_sparc"
822 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
828 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
830 if test "$COMPILE_64BIT_KMODULE" = yes; then
831 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
832 KCFLAGS="-xarch=v9 -xregs=no%appl"
838 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
841 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
843 #include <sys/stream.h>
844 #include <sys/ddi.h>],
848 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
850 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
853 AC_SUBST(COMPILE_KERNEL_GCC)
854 AC_SUBST(COMPILE_64BIT_KMODULE)
859 dnl ----- Tru64 specific -----
860 if test x"$this_os" = "xtru64"; then
861 AC_MSG_RESULT([ * Tru64 specific configuration])
862 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
863 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
864 dnl AC_DEFINE(USE_MOUNT_H)
865 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
866 dnl AC_DEFINE(USE_UFS_QUOTA_H)
867 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
868 AC_DEFINE(_OSF_SOURCE, 1, [Define if the *passwd UAMs should be used])
869 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for Berkeley DB 4])
870 AC_CHECK_LIB(security,set_auth_parameters)
871 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
876 dnl -- check for libgcrypt, if found enables DHX UAM
877 AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
878 neta_cv_have_libgcrypt=yes
879 AC_MSG_NOTICE([Enabling DHX2 UAM])
880 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt])
881 AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled])
884 dnl -- look for openssl, if found enables DHX UAM and Randnum UAM
887 dnl Check for Berkeley DB library
888 if test "x$bdb_required" = "xyes"; then
891 AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
892 AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
893 AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
894 AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
895 AC_MSG_RESULT([your linker is configured to check for libraries there.])
896 AC_MSG_ERROR([Berkeley DB library required but not found!])
900 dnl -- check for crypt
903 dnl --------------------- check for building PGP UAM module
905 AC_MSG_CHECKING([whether the PGP UAM should be build])
906 AC_ARG_ENABLE(pgp-uam,
907 [ --enable-pgp-uam enable build of PGP UAM module],[
908 if test "$enableval" = "yes"; then
909 if test "x$neta_cv_have_openssl" = "xyes"; then
910 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
922 dnl --------------------- check for building Kerberos v4 UAM module
924 AC_MSG_CHECKING([whether the Kerberos IV UAM should be build])
925 AC_ARG_ENABLE(krb4-uam,
926 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],[
927 if test "$enableval" = "yes"; then
928 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
939 dnl --------------------- check for building Kerberos V UAM module
941 netatalk_cv_build_krb5_uam=no
942 AC_ARG_ENABLE(krbV-uam,
943 [ --enable-krbV-uam enable build of Kerberos V UAM module],
945 if test x"$enableval" = x"yes"; then
946 NETATALK_GSSAPI_CHECK([
947 netatalk_cv_build_krb5_uam=yes
949 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
956 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
957 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
962 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
964 dnl --------------------- overwrite the config files . . . or not.
966 AC_MSG_CHECKING([whether configuration files should be overwritten])
967 AC_ARG_ENABLE(overwrite,
968 [ --enable-overwrite overwrite configuration files during installation],
969 [OVERWRITE_CONFIG="${enable_overwrite}"],
970 [OVERWRITE_CONFIG="no"]
972 AC_MSG_RESULT([$OVERWRITE_CONFIG])
974 dnl --------------------- check for LDAP support, for client-side ACL visibility
975 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
977 [AS_HELP_STRING([--with-ldap],
978 [LDAP support (default=auto)])],
987 AC_MSG_RESULT($with_ldap)
989 if test x"$with_ldap" != x"no" ; then
990 AC_CHECK_HEADER([ldap.h], with_ldap=yes,
991 [ if test x"$with_ldap" = x"yes" ; then
992 AC_MSG_ERROR([Missing LDAP headers])
996 AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
997 [ if test x"$with_ldap" = x"yes" ; then
998 AC_MSG_ERROR([Missing LDAP library])
1004 if test x"$with_ldap" = x"yes"; then
1005 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
1008 dnl --------------------- check for ACL support
1009 AC_MSG_CHECKING(whether to support ACLs)
1011 [AS_HELP_STRING([--with-acls],
1012 [Include ACL support (default=auto)])],
1013 [ case "$withval" in
1015 with_acl_support="$withval"
1018 with_acl_support=auto
1021 [with_acl_support=auto])
1022 AC_MSG_RESULT($with_acl_support)
1024 if test x"$with_acl_support" = x"no"; then
1025 AC_MSG_RESULT(Disabling ACL support)
1026 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
1028 with_acl_support=yes
1031 if test x"$with_acl_support" = x"yes" ; then
1032 AC_MSG_NOTICE(checking whether ACL support is available:)
1035 AC_MSG_NOTICE(Using UnixWare ACLs)
1036 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
1039 AC_MSG_NOTICE(Using solaris ACLs)
1040 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
1041 ACL_LIBS="$ACL_LIBS -lsec"
1044 AC_MSG_NOTICE(Using HPUX ACLs)
1045 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
1048 AC_MSG_NOTICE(Using IRIX ACLs)
1049 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
1052 AC_MSG_NOTICE(Using AIX ACLs)
1053 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
1056 AC_MSG_NOTICE(Using Tru64 ACLs)
1057 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
1058 ACL_LIBS="$ACL_LIBS -lpacl"
1061 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
1062 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
1065 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
1068 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
1071 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
1073 LIBS="$LIBS $ACL_LIBS"
1075 #include <sys/types.h>
1076 #include <sys/acl.h>
1080 acl_entry_t *entry_p;
1081 return acl_get_entry(acl, entry_id, entry_p);
1083 [netatalk_cv_HAVE_POSIX_ACLS=yes],
1084 [netatalk_cv_HAVE_POSIX_ACLS=no
1085 with_acl_support=no])
1088 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
1089 AC_MSG_NOTICE(Using POSIX ACLs)
1090 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
1091 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
1093 LIBS="$LIBS $ACL_LIBS"
1095 #include <sys/types.h>
1096 #include <sys/acl.h>
1098 acl_permset_t permset_d;
1100 return acl_get_perm_np(permset_d, perm);
1102 [samba_cv_HAVE_ACL_GET_PERM_NP=yes],
1103 [samba_cv_HAVE_ACL_GET_PERM_NP=no])
1106 if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
1107 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
1110 AC_MSG_NOTICE(ACL support is not avaliable)
1111 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
1117 if test x"$with_acl_support" = x"yes" ; then
1118 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
1122 dnl --------------------- check for Extended Attributes support
1124 neta_cv_eas_sys_found=no
1125 neta_cv_eas_sys_not_found=no
1127 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
1132 AC_SEARCH_LIBS(getproplist, [proplist])
1133 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
1134 [neta_cv_eas_sys_found=yes],
1135 [neta_cv_eas_sys_not_found=yes])
1136 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
1137 [neta_cv_eas_sys_not_found=yes])
1138 AC_CHECK_FUNCS([sizeof_proplist_entry],,
1139 [neta_cv_eas_sys_not_found=yes])
1143 AC_CHECK_FUNCS([attropen],
1144 [neta_cv_eas_sys_found=yes],
1145 [neta_cv_eas_sys_not_found=yes])
1149 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
1150 [neta_cv_eas_sys_found=yes],
1151 [neta_cv_eas_sys_not_found=yes])
1152 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
1153 [neta_cv_eas_sys_not_found=yes])
1154 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
1155 [neta_cv_eas_sys_not_found=yes])
1156 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
1157 [neta_cv_eas_sys_not_found=yes])
1160 *freebsd4* | *dragonfly* )
1161 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
1165 AC_SEARCH_LIBS(getxattr, [attr])
1167 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1168 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
1169 [neta_cv_eas_sys_found=yes],
1170 [neta_cv_eas_sys_not_found=yes])
1171 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
1172 [neta_cv_eas_sys_not_found=yes])
1173 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
1174 [neta_cv_eas_sys_not_found=yes])
1177 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1178 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
1179 [neta_cv_eas_sys_found=yes],
1180 [neta_cv_eas_sys_not_found=yes])
1181 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
1182 [neta_cv_eas_sys_not_found=yes])
1185 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1186 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
1187 [neta_cv_eas_sys_not_found=yes])
1188 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
1189 [neta_cv_eas_sys_not_found=yes])
1194 # Do xattr functions take additional options like on Darwin?
1195 if test x"$ac_cv_func_getxattr" = x"yes" ; then
1196 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
1198 LIBS="$LIBS $ACL_LIBS"
1200 #include <sys/types.h>
1201 #if HAVE_ATTR_XATTR_H
1202 #include <attr/xattr.h>
1203 #elif HAVE_SYS_XATTR_H
1204 #include <sys/xattr.h>
1207 getxattr(0, 0, 0, 0, 0, 0);
1209 [smb_attr_cv_xattr_add_opt=yes],
1210 [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
1212 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
1213 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
1217 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
1218 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
1219 neta_cv_eas="$neta_cv_eas | sys"
1222 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
1224 dnl --------------------- Check if realpath() takes NULL
1225 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
1226 neta_cv_REALPATH_TAKES_NULL, [
1232 void exit_on_core(int ignored) {
1238 signal(SIGSEGV, exit_on_core);
1239 newpath = realpath("/tmp", NULL);
1240 exit((newpath != NULL) ? 0 : 1);
1242 neta_cv_REALPATH_TAKES_NULL=yes,
1243 neta_cv_REALPATH_TAKES_NULL=no,
1244 neta_cv_REALPATH_TAKES_NULL=cross
1249 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
1250 AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])
1253 dnl --------------------- Netatalk Webmin
1256 dnl --------------------- last minute substitutions
1259 AC_SUBST(OVERWRITE_CONFIG)
1261 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
1262 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
1263 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
1264 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
1265 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
1266 AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
1267 AM_CONDITIONAL(HAVE_LDAP, test x"$with_ldap" = x"yes")
1268 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
1269 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
1270 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
1271 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
1272 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
1273 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
1274 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
1275 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
1276 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
1277 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
1278 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
1279 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
1280 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
1281 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
1282 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
1283 AM_CONDITIONAL(USE_SOLARIS, test x$sysv_style = xsolaris)
1284 AM_CONDITIONAL(USE_GENTOO, test x$sysv_style = xgentoo)
1285 AM_CONDITIONAL(USE_DEBIAN, test x$sysv_style = xdebian)
1286 AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x)
1287 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
1288 AM_CONDITIONAL(USE_APPLETALK, test x$netatalk_cv_ddp_enabled = xyes)
1290 dnl --------------------- generate files
1296 bin/afppasswd/Makefile
1298 bin/cnid/cnid2_create
1299 bin/getzones/Makefile
1300 bin/megatron/Makefile
1304 bin/psorder/Makefile
1305 bin/uniconv/Makefile
1309 contrib/macusers/Makefile
1310 contrib/macusers/macusers
1311 contrib/printing/Makefile
1312 contrib/shell_utils/Makefile
1313 contrib/shell_utils/afpd-mtab.pl
1314 contrib/shell_utils/apple_dump
1315 contrib/shell_utils/asip-status.pl
1316 contrib/timelord/Makefile
1317 contrib/a2boot/Makefile
1319 distrib/config/Makefile
1320 distrib/config/netatalk-config
1321 distrib/initscripts/Makefile
1327 etc/cnid_dbd/Makefile
1328 etc/netalockd/Makefile
1330 etc/uams/uams_krb4/Makefile
1334 include/atalk/Makefile
1336 libatalk/acl/Makefile
1337 libatalk/adouble/Makefile
1338 libatalk/asp/Makefile
1339 libatalk/atp/Makefile
1340 libatalk/bstring/Makefile
1341 libatalk/cnid/Makefile
1342 libatalk/cnid/cdb/Makefile
1343 libatalk/cnid/last/Makefile
1344 libatalk/cnid/dbd/Makefile
1345 libatalk/cnid/tdb/Makefile
1346 libatalk/compat/Makefile
1347 libatalk/dsi/Makefile
1348 libatalk/nbp/Makefile
1349 libatalk/netddp/Makefile
1350 libatalk/util/Makefile
1351 libatalk/talloc/Makefile
1352 libatalk/tdb/Makefile
1353 libatalk/unicode/Makefile
1354 libatalk/unicode/charsets/Makefile
1355 libatalk/vfs/Makefile
1364 sys/generic/Makefile
1365 sys/generic/sys/Makefile
1366 sys/netatalk/Makefile
1368 sys/netbsd/netatalk/Makefile
1369 sys/solaris/Makefile
1375 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
1378 AC_NETATALK_LIBS_SUMMARY
1379 AC_NETATALK_CONFIG_SUMMARY