1 dnl $Id: configure.in,v 1.241 2010/04/03 07:11:33 franklahm Exp $
2 dnl configure.in for netatalk
4 AC_INIT(etc/afpd/main.c)
6 NETATALK_VERSION=`cat $srcdir/VERSION`
7 AC_SUBST(NETATALK_VERSION)
10 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
11 AM_CONFIG_HEADER(config.h)
13 dnl Checks for programs.
28 dnl Checks for header files.
32 AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h time.h sys/param.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h sys/uio.h langinfo.h locale.h sys/filio.h)
33 AC_CHECK_HEADER(sys/cdefs.h,,
34 AC_MSG_RESULT([enabling generic cdefs.h from tree])
35 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
37 AC_CHECK_HEADERS([sys/mount.h], , ,
38 [#ifdef HAVE_SYS_PARAM_H
39 #include <sys/param.h>
43 dnl Checks for typedefs, structures, and compiler characteristics.
55 dnl --------------------------------------------------------------------------
56 dnl check if dlsym needs to add an underscore, uses libtool macros
57 dnl --------------------------------------------------------------------------
59 AC_CHECK_FUNCS(dlopen dlsym dlclose)
61 if test x"$libltdl_cv_need_uscore" = xyes; then
62 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
65 dnl Checks for library functions.
67 AC_PROG_GCC_TRADITIONAL
74 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy)
75 AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo strlcpy strlcat setlinebuf dirfd pselect access pread pwrite)
76 AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
77 AC_CHECK_FUNC(renameat, AC_DEFINE([_ATFILE_SOURCE], 1, AT file source))
78 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
80 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
81 AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
82 dnl search for necessary libs for libpthread stuff
83 AC_SEARCH_LIBS(pthread_sigmask, pthread,,
84 [AC_MSG_ERROR([cannot find pthread_sigmask in libc or libpthread])])
85 if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
86 PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
88 AC_SUBST(PTHREAD_LIBS)
91 dnl Checks for (v)snprintf
92 NETATALK_SNPRINTF_CHECK
94 dnl --------------------------------------------------------------------------
95 dnl 64bit platform check
96 dnl --------------------------------------------------------------------------
98 AC_MSG_CHECKING([whether to check for 64bit libraries])
99 dnl Determine libdir name
102 # Test if the compiler is 64bit
103 echo 'int i;' > conftest.$ac_ext
104 atalk_cv_cc_64bit_output=no
105 if AC_TRY_EVAL(ac_compile); then
106 case `/usr/bin/file conftest.$ac_objext` in
108 atalk_cv_cc_64bit_output=yes
117 dnl FIXME: Do we need something like this for Solaris 64bit?
120 case $host_cpu:$atalk_cv_cc_64bit_output in
121 powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
122 atalk_libname="lib64"
131 dnl --------------------------------------------------------------------------
132 dnl specific configuration comes in here:
133 dnl --------------------------------------------------------------------------
136 netatalk_cv_admin_group=yes
137 AC_MSG_CHECKING([for administrative group support])
138 AC_ARG_ENABLE(admin-group,
139 [ --disable-admin-group disable admin group],[
140 if test x"$enableval" = x"no"; then
141 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
142 netatalk_cv_admin_group=no
145 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
148 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
157 netatalk_cv_with_cracklib=no
158 AC_ARG_WITH(cracklib,
159 [ --with-cracklib=DICT enable/set location of cracklib dictionary],[
160 if test "x$withval" != "xno" ; then
162 AC_CHECK_LIB(crack, main, [
163 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
165 if test "$cracklib" = "yes"; then
166 cracklib="/usr/$atalk_libname/cracklib_dict"
168 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
169 [path to cracklib dictionary])
170 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
171 netatalk_cv_with_cracklib=yes
173 AC_MSG_ERROR([cracklib not found!])
179 AC_MSG_CHECKING([for cracklib support])
180 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
182 netatalk_cv_ddp_enabled=no
183 AC_MSG_CHECKING([whether to enable DDP])
185 [ --enable-ddp enable DDP (AppleTalk)],[
186 if test "$enableval" = "yes"; then
188 netatalk_cv_ddp_enabled=yes
191 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
195 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
199 AC_MSG_CHECKING([whether to enable debug code])
200 AC_ARG_ENABLE(debug1,
201 [ --enable-debug1 enable debug code],[
202 if test "$enableval" != "no"; then
203 if test "$enableval" = "yes"; then
204 AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included])
206 AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included])
217 AC_MSG_CHECKING([whether to enable verbose debug code])
219 [ --enable-debug enable verbose debug code],[
220 if test "$enableval" != "no"; then
221 if test "$enableval" = "yes"; then
222 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
224 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
229 AC_DEFINE(NDEBUG, 1, [Disable assertions])
233 AC_DEFINE(NDEBUG, 1, [Disable assertions])
237 AC_MSG_CHECKING([whether to enable debugging with debuggers])
238 AC_ARG_ENABLE(debugging,
239 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
240 if test "$enableval" != "no"; then
241 if test "$enableval" = "yes"; then
242 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
244 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
258 AC_MSG_CHECKING([whether AFP 3.x calls should be enabled])
260 [ --disable-afp3 disable AFP 3.x calls],
262 if test x"$enableval" != x"no"; then
275 if test x"$afp3" = x"yes"; then
277 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
279 if test x"$afp3set" = x"yes"; then
280 AC_MSG_ERROR([AFP 3.x support requires Large File Support.])
282 AC_MSG_WARN([AFP 3.x support requires Large File Support. AFP3.x support disabled])
290 dnl ----------- A NOTE ABOUT DROPKLUDGE
291 dnl The trouble with this fix is that if you know what the file is called, it
292 dnl can be read from the Unix side. That's okay for most academic institutions
293 dnl since the students don't have telnet access to the Mac servers. There is
294 dnl currently no one working on further development/fixes of DROPKLUDGE.
297 netatalk_cv_dropkludge=no
298 AC_MSG_CHECKING([whether to enable experimental dropbox support])
299 AC_ARG_ENABLE(dropkludge,
300 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],[
301 if test "$enableval" = "yes"; then
302 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
304 netatalk_cv_dropkludge=yes
313 netatalk_cv_force_uidgid=no
314 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
315 AC_ARG_ENABLE(force-uidgid,
316 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],[
317 if test "$enableval" = "yes"; then
318 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
319 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
321 netatalk_cv_force_uidgid=yes
330 dnl Check for CNID database backends
332 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
334 dnl Check for quota support
337 dnl Check for optional server location protocol support (used by MacOS X)
340 dnl Check for optional Zeroconf support
343 dnl Check for PAM libs
344 netatalk_cv_use_pam=no
348 netatalk_cv_use_pam=yes
349 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
352 netatalk_cv_use_shadowpw=no
354 [ --with-shadow enable shadow password support [[auto]]],
355 [netatalk_cv_use_shadowpw="$withval"],
356 [netatalk_cv_use_shadowpw=auto]
359 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
360 AC_CHECK_HEADER([shadow.h])
361 if test x"$ac_cv_header_shadow_h" = x"yes"; then
362 netatalk_cv_use_shadowpw=yes
363 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
365 if test "x$shadowpw" = "xyes"; then
366 AC_MSG_ERROR([shadow support not available])
368 netatalk_cv_use_shadowpw=no
373 AC_MSG_CHECKING([whether shadow support should be enabled])
374 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
382 netatalk_cv_use_shellcheck=yes
383 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
384 AC_ARG_ENABLE(shell-check,
385 [ --disable-shell-check disable checking for a valid shell],[
386 if test "$enableval" = "no"; then
387 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
389 netatalk_cv_use_shellcheck=no
398 NETATALK_TCP_WRAPPERS
400 AC_MSG_CHECKING([whether system (fcntl) locking should be disabled])
401 AC_ARG_ENABLE(locking,
402 [ --disable-locking disable system locking],[
403 if test "$enableval" = "no"; then
404 AC_DEFINE(DISABLE_LOCKING, 1, [Define if system (fcntl) locking should be disabled])
417 AC_ARG_ENABLE(redhat,
418 [ --enable-redhat use redhat-style sysv configuration ],[
419 if test "$enableval" = "yes"; then
422 AC_MSG_RESULT([enabling redhat-style sysv support])
427 [ --enable-suse use suse-style sysv configuration ],[
428 if test "$enableval" = "yes"; then
431 AC_MSG_RESULT([enabling suse-style sysv support])
435 AC_ARG_ENABLE(gentoo,
436 [ --enable-gentoo use gentoo-style sysv configuration ],[
437 if test "$enableval" = "yes"; then
440 AC_MSG_RESULT([enabling gentoo-style sysv support])
444 AC_ARG_ENABLE(cobalt,
445 [ --enable-cobalt use cobalt-style sysv configuration ],
446 if test "$enableval" = "yes"; then
449 AC_MSG_RESULT([enabling cobalt-style sysv support])
452 AC_ARG_ENABLE(netbsd,
453 [ --enable-netbsd use NetBSD-style rc.d configuration ],
454 if test "x$enableval" = "xyes"; then
457 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
460 AC_ARG_ENABLE(debian,
461 [ --enable-debian use debian-style sysv configuration ],[
462 if test "$enableval" = "yes"; then
465 AC_MSG_RESULT([enabling debian-style sysv support])
469 dnl ----- timelord compilation (disabled by default)
470 AC_MSG_CHECKING([whether timelord should be compiled])
472 AC_ARG_ENABLE(timelord,
473 [ --enable-timelord enable compilation of timelord server],
474 [compile_timelord="$enableval"],
475 [compile_timelord="no"]
477 AC_MSG_RESULT([$compile_timelord])
479 dnl ----- a2boot compilation (disabled by default)
480 AC_MSG_CHECKING([whether a2boot should be compiled])
482 AC_ARG_ENABLE(a2boot,
483 [ --enable-a2boot enable compilation of Apple2 boot server],
484 [compile_a2boot="$enableval"],
485 [compile_a2boot="no"]
487 AC_MSG_RESULT([$compile_a2boot])
489 AC_ARG_WITH(uams-path,
490 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],[
493 uams_path="${PKGCONFDIR}/uams"
499 dnl check if we can use attribute unused (gcc only) from ethereal
500 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
501 if test x$GCC != x ; then
502 CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
505 CFLAGS="-D_U_=\"\" $CFLAGS"
509 dnl --------------------------------------------------------------------------
510 dnl FHS stuff has to be done last because it overrides other defaults
511 dnl --------------------------------------------------------------------------
513 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
515 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[
516 if test "$enableval" = "yes"; then
517 uams_path="${libdir}/netatalk"
519 PKGCONFDIR=${sysconfdir}/netatalk
520 SERVERTEXT="${PKGCONFDIR}/msg"
522 mandir="/usr/share/man"
523 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
533 dnl --------------------------------------------------------------------------
534 dnl post-FHS substitutions, etc
535 dnl --------------------------------------------------------------------------
538 dnl AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
539 dnl [path to UAMs [default=PKGCONF/uams]])
540 UAMS_PATH="${uams_path}"
543 dnl --------------------------------------------------------------------------
544 dnl drop in includes for top level directory structures here...
545 dnl --------------------------------------------------------------------------
547 dnl Note: $(top_srcdir)/include should be added before all other includes
548 dnl so that includes from that directory a preferred to includes from
549 dnl /usr/include or similar places.
550 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
551 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
553 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
555 dnl --------------------------------------------------------------------------
556 dnl specific configuration comes in here:
557 dnl --------------------------------------------------------------------------
559 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
561 dnl --------------------- determine operating system from "target"
563 *aix*) this_os=aix ;;
564 *freebsd*) this_os=freebsd ;;
565 *hpux11*) this_os=hpux11 ;;
566 *irix*) this_os=irix ;;
567 *linux*) this_os=linux ;;
568 *osx*) this_os=macosx ;;
569 *darwin*) this_os=macosx ;;
570 *netbsd*) this_os=netbsd ;;
571 *openbsd*) this_os=openbsd ;;
572 *osf*) this_os=tru64 ;;
573 *solaris*) this_os=solaris ;;
577 i386|i486|i586|i686|k7) this_cpu=x86 ;;
578 alpha) this_cpu=alpha ;;
579 mips) this_cpu=mips ;;
580 powerpc|ppc) this_cpu=ppc ;;
583 dnl --------------------- GNU source
585 linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
589 dnl --------------------- operating system specific flags (port from sys/*)
591 dnl ----- AIX specific -----
592 if test x"$this_os" = "xaix"; then
593 AC_MSG_RESULT([ * AIX specific configuration])
594 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
596 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
597 dnl compilation environment. It's enough to get things defined
598 dnl right in endian.h provided that long long is supported, though.
599 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
602 dnl ----- FreeBSD specific -----
603 if test x"$this_os" = "xfreebsd"; then
604 AC_MSG_RESULT([ * FreeBSD specific configuration])
605 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
606 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
607 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
608 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
611 dnl ----- HP-UX 11 specific -----
612 if test x"$this_os" = "xhpux11"; then
613 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
615 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
616 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
619 dnl ----- IRIX specific -----
620 if test x"$this_os" = "xirix"; then
621 AC_MSG_RESULT([ * IRIX specific configuration])
623 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
626 dnl ----- Linux specific -----
627 if test x"$this_os" = "xlinux"; then
628 AC_MSG_RESULT([ * Linux specific configuration])
630 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
631 AC_MSG_CHECKING([for struct atalk_addr])
632 dnl AC_COMPILE_IFELSE([
634 #include <sys/socket.h>
635 #include <asm/types.h>
636 #include <linux/atalk.h>
638 struct atalk_addr foo;
641 ac_have_atalk_addr=yes
647 if test "x$ac_have_atalk_addr" = "xyes"; then
648 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
651 dnl ----- check if we need the quotactl wrapper
652 # AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
653 # AC_CHECK_FUNC(quotactl,,
654 # AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed])
655 # AC_MSG_RESULT([enabling quotactl wrapper])
658 # For quotas on Linux XFS filesystems
661 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
662 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
663 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
667 dnl ----- as far as I can tell, dbtob always does the wrong thing
668 dnl ----- on every single version of linux I've ever played with.
669 dnl ----- see etc/afpd/quota.c
670 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
672 netatalk_cv_linux_sendfile=yes
673 AC_MSG_CHECKING([use sendfile syscall])
674 AC_ARG_ENABLE(sendfile,
675 [ --disable-sendfile disable linux sendfile syscall],[
676 if test x"$enableval" = x"no"; then
677 netatalk_cv_linux_sendfile=no
689 if test x"$netatalk_cv_linux_sendfile" = "xyes"; then
690 AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
691 AC_TRY_LINK([#include <sys/sendfile.h>],
696 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
698 netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
700 # Try and cope with broken Linux sendfile....
701 AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
703 #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
704 #undef _FILE_OFFSET_BITS
706 #include <sys/sendfile.h>],
711 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
713 netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
715 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
716 AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
717 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
718 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
719 elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
720 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
721 AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
722 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
724 netatalk_cv_linux_sendfile=no
729 dnl ----- Linux/alpha specific -----
730 if test x"$this_cpu" = "xalpha"; then
731 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
732 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
739 dnl ----- Mac OSX specific -----
740 if test x"$this_os" = "xmacosx"; then
741 AC_MSG_RESULT([ * Mac OSX specific configuration])
742 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
743 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
744 dnl AC_DEFINE(NO_DLFCN_H)
745 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
746 AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
747 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
750 dnl ----- NetBSD specific -----
751 if test x"$this_os" = "xnetbsd"; then
752 AC_MSG_RESULT([ * NetBSD specific configuration])
753 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
754 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
755 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
757 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
760 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
761 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
764 dnl ----- OpenBSD specific -----
765 if test x"$this_os" = "xopenbsd"; then
766 AC_MSG_RESULT([ * OpenBSD specific configuration])
767 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
768 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
771 dnl ----- Solaris specific -----
772 if test x"$this_os" = "xsolaris"; then
773 AC_MSG_RESULT([ * Solaris specific configuration])
774 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
775 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
776 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
777 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
778 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
783 AC_MSG_CHECKING([if we can build Solaris kernel module])
784 if test -x /usr/ccs/bin/ld && test x$netatalk_cv_ddp_enabled = yes ; then
787 AC_MSG_RESULT([$solaris_module])
789 COMPILE_64BIT_KMODULE=no
792 COMPILE_KERNEL_GCC=no
794 if test "$solaris_module" = "yes"; then
795 dnl Solaris kernel module stuff
796 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
798 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
799 if test -x /usr/bin/isainfo; then
800 # check for 64 bit platform
801 if isainfo -kv | grep '^64-bit'; then
802 COMPILE_64BIT_KMODULE=yes
806 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
808 if test "${GCC}" = yes; then
809 COMPILE_KERNEL_GCC=yes
810 if test "$COMPILE_64BIT_KMODULE" = yes; then
812 AC_MSG_CHECKING([if we can build a 64bit kernel module])
814 case `$CC --version 2>/dev/null` in
816 COMPILE_64BIT_KMODULE=no
817 COMPILE_KERNEL_GCC=no
822 #KLDFLAGS="-melf64_sparc"
826 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
832 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
834 if test "$COMPILE_64BIT_KMODULE" = yes; then
835 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
836 KCFLAGS="-xarch=v9 -xregs=no%appl"
842 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
845 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
847 #include <sys/stream.h>
848 #include <sys/ddi.h>],
852 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
854 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
857 AC_SUBST(COMPILE_KERNEL_GCC)
858 AC_SUBST(COMPILE_64BIT_KMODULE)
863 dnl ----- Tru64 specific -----
864 if test x"$this_os" = "xtru64"; then
865 AC_MSG_RESULT([ * Tru64 specific configuration])
866 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
867 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
868 dnl AC_DEFINE(USE_MOUNT_H)
869 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
870 dnl AC_DEFINE(USE_UFS_QUOTA_H)
871 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
872 AC_DEFINE(_OSF_SOURCE, 1, [Define if the *passwd UAMs should be used])
873 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for Berkeley DB 4])
874 AC_CHECK_LIB(security,set_auth_parameters)
875 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
880 dnl -- check for libgcrypt, if found enables DHX UAM
881 AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
882 neta_cv_have_libgcrypt=yes
883 AC_MSG_NOTICE([Enabling DHX2 UAM])
884 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt])
885 AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled])
888 dnl -- look for openssl, if found enables DHX UAM and Randnum UAM
891 dnl Check for Berkeley DB library
892 if test "x$bdb_required" = "xyes"; then
895 AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
896 AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
897 AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
898 AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
899 AC_MSG_RESULT([your linker is configured to check for libraries there.])
900 AC_MSG_ERROR([Berkeley DB library required but not found!])
904 dnl -- check for crypt
907 dnl --------------------- check for building PGP UAM module
909 AC_MSG_CHECKING([whether the PGP UAM should be build])
910 AC_ARG_ENABLE(pgp-uam,
911 [ --enable-pgp-uam enable build of PGP UAM module],[
912 if test "$enableval" = "yes"; then
913 if test "x$neta_cv_have_openssl" = "xyes"; then
914 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
926 dnl --------------------- check for building Kerberos v4 UAM module
928 AC_MSG_CHECKING([whether the Kerberos IV UAM should be build])
929 AC_ARG_ENABLE(krb4-uam,
930 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],[
931 if test "$enableval" = "yes"; then
932 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
943 dnl --------------------- check for building Kerberos V UAM module
945 netatalk_cv_build_krb5_uam=no
946 AC_ARG_ENABLE(krbV-uam,
947 [ --enable-krbV-uam enable build of Kerberos V UAM module],
949 if test x"$enableval" = x"yes"; then
950 NETATALK_GSSAPI_CHECK([
951 netatalk_cv_build_krb5_uam=yes
953 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
960 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
961 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
966 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
968 dnl --------------------- overwrite the config files . . . or not.
970 AC_MSG_CHECKING([whether configuration files should be overwritten])
971 AC_ARG_ENABLE(overwrite,
972 [ --enable-overwrite overwrite configuration files during installation],
973 [OVERWRITE_CONFIG="${enable_overwrite}"],
974 [OVERWRITE_CONFIG="no"]
976 AC_MSG_RESULT([$OVERWRITE_CONFIG])
978 dnl --------------------- check for ACL support
979 AC_MSG_CHECKING(whether to support ACLs)
980 AC_ARG_WITH(acl-support,
981 [AS_HELP_STRING([--with-acl-support],
982 [Include ACL support (default=auto)])],
985 with_acl_support="$withval"
988 with_acl_support=auto
991 [with_acl_support=auto])
992 AC_MSG_RESULT($with_acl_support)
994 if test x"$with_acl_support" = x"no"; then
995 AC_MSG_RESULT(Disabling ACL support)
996 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
999 AC_MSG_NOTICE([ACL support requires LDAP support, checking whether that's available])
1000 AC_CHECK_HEADER([ldap.h],,
1001 [AC_MSG_ERROR([ACL Support prerequisite LDAP client headers not found.])
1002 with_acl_support=no])
1004 AC_CHECK_LIB(ldap, ldap_init,,
1005 [AC_MSG_ERROR([ACL Support prerequisite LDAP client libs not found.])
1006 with_acl_support=no])
1009 if test x"$with_acl_support" = x"yes" ; then
1010 AC_MSG_NOTICE(checking whether ACL support is available:)
1013 AC_MSG_NOTICE(Using UnixWare ACLs)
1014 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
1017 AC_MSG_NOTICE(Using solaris ACLs)
1018 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
1019 ACL_LIBS="$ACL_LIBS -lsec"
1022 AC_MSG_NOTICE(Using HPUX ACLs)
1023 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
1026 AC_MSG_NOTICE(Using IRIX ACLs)
1027 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
1030 AC_MSG_NOTICE(Using AIX ACLs)
1031 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
1034 AC_MSG_NOTICE(Using Tru64 ACLs)
1035 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
1036 ACL_LIBS="$ACL_LIBS -lpacl"
1039 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
1040 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
1043 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
1046 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
1049 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
1051 LIBS="$LIBS $ACL_LIBS"
1053 #include <sys/types.h>
1054 #include <sys/acl.h>
1058 acl_entry_t *entry_p;
1059 return acl_get_entry(acl, entry_id, entry_p);
1061 [netatalk_cv_HAVE_POSIX_ACLS=yes],
1062 [netatalk_cv_HAVE_POSIX_ACLS=no
1063 with_acl_support=no])
1066 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
1067 AC_MSG_NOTICE(Using POSIX ACLs)
1068 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
1069 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
1071 LIBS="$LIBS $ACL_LIBS"
1073 #include <sys/types.h>
1074 #include <sys/acl.h>
1076 acl_permset_t permset_d;
1078 return acl_get_perm_np(permset_d, perm);
1080 [samba_cv_HAVE_ACL_GET_PERM_NP=yes],
1081 [samba_cv_HAVE_ACL_GET_PERM_NP=no])
1084 if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
1085 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
1088 AC_MSG_NOTICE(ACL support is not avaliable)
1089 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
1095 if test x"$with_acl_support" = x"yes" ; then
1096 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
1100 dnl --------------------- check for Extended Attributes support
1102 neta_cv_eas_sys_found=no
1103 neta_cv_eas_sys_not_found=no
1105 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
1110 AC_SEARCH_LIBS(getproplist, [proplist])
1111 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
1112 [neta_cv_eas_sys_found=yes],
1113 [neta_cv_eas_sys_not_found=yes])
1114 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
1115 [neta_cv_eas_sys_not_found=yes])
1116 AC_CHECK_FUNCS([sizeof_proplist_entry],,
1117 [neta_cv_eas_sys_not_found=yes])
1121 AC_CHECK_FUNCS([attropen],
1122 [neta_cv_eas_sys_found=yes],
1123 [neta_cv_eas_sys_not_found=yes])
1127 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
1128 [neta_cv_eas_sys_found=yes],
1129 [neta_cv_eas_sys_not_found=yes])
1130 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
1131 [neta_cv_eas_sys_not_found=yes])
1132 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
1133 [neta_cv_eas_sys_not_found=yes])
1134 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
1135 [neta_cv_eas_sys_not_found=yes])
1138 *freebsd4* | *dragonfly* )
1139 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
1143 AC_SEARCH_LIBS(getxattr, [attr])
1145 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1146 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
1147 [neta_cv_eas_sys_found=yes],
1148 [neta_cv_eas_sys_not_found=yes])
1149 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
1150 [neta_cv_eas_sys_not_found=yes])
1151 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
1152 [neta_cv_eas_sys_not_found=yes])
1155 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1156 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
1157 [neta_cv_eas_sys_found=yes],
1158 [neta_cv_eas_sys_not_found=yes])
1159 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
1160 [neta_cv_eas_sys_not_found=yes])
1163 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1164 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
1165 [neta_cv_eas_sys_not_found=yes])
1166 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
1167 [neta_cv_eas_sys_not_found=yes])
1172 # Do xattr functions take additional options like on Darwin?
1173 if test x"$ac_cv_func_getxattr" = x"yes" ; then
1174 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
1176 LIBS="$LIBS $ACL_LIBS"
1178 #include <sys/types.h>
1179 #if HAVE_ATTR_XATTR_H
1180 #include <attr/xattr.h>
1181 #elif HAVE_SYS_XATTR_H
1182 #include <sys/xattr.h>
1185 getxattr(0, 0, 0, 0, 0, 0);
1187 [smb_attr_cv_xattr_add_opt=yes],
1188 [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
1190 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
1191 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
1195 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
1196 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
1197 neta_cv_eas="$neta_cv_eas | sys"
1201 dnl --------------------- Check if realpath() takes NULL
1202 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
1203 neta_cv_REALPATH_TAKES_NULL, [
1209 void exit_on_core(int ignored) {
1215 signal(SIGSEGV, exit_on_core);
1216 newpath = realpath("/tmp", NULL);
1217 exit((newpath != NULL) ? 0 : 1);
1219 neta_cv_REALPATH_TAKES_NULL=yes,
1220 neta_cv_REALPATH_TAKES_NULL=no,
1221 neta_cv_REALPATH_TAKES_NULL=cross
1226 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
1227 AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])
1230 dnl --------------------- Netatalk Webmin
1233 dnl --------------------- Check for libuuid which is required for TimeMachine
1234 AC_SEARCH_LIBS([uuid_generate],
1236 AC_MSG_ERROR([missing library libuuid required for TimeMachine]))
1237 AC_CHECK_HEADER([uuid/uuid.h],
1238 AC_DEFINE([HAVE_UUID], 1, [have libuuid]),
1239 AC_MSG_ERROR([missing header <uuid/uuid.> from libuuid required for TimeMachine]))
1241 dnl --------------------- last minute substitutions
1245 AC_SUBST(OVERWRITE_CONFIG)
1247 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
1248 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
1249 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
1250 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
1251 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
1252 AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
1253 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
1254 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
1255 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
1256 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
1257 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
1258 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
1259 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
1260 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
1261 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
1262 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
1263 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
1264 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
1265 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
1266 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
1267 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
1268 AM_CONDITIONAL(USE_SOLARIS, test x$sysv_style = xsolaris)
1269 AM_CONDITIONAL(USE_GENTOO, test x$sysv_style = xgentoo)
1270 AM_CONDITIONAL(USE_DEBIAN, test x$sysv_style = xdebian)
1271 AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x)
1272 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
1273 AM_CONDITIONAL(USE_APPLETALK, test x$netatalk_cv_ddp_enabled = xyes)
1275 dnl --------------------- generate files
1279 bin/adv1tov2/Makefile
1282 bin/afppasswd/Makefile
1284 bin/cnid/cnid2_create
1285 bin/getzones/Makefile
1286 bin/megatron/Makefile
1290 bin/psorder/Makefile
1291 bin/uniconv/Makefile
1295 contrib/macusers/Makefile
1296 contrib/macusers/macusers
1297 contrib/printing/Makefile
1298 contrib/shell_utils/Makefile
1299 contrib/shell_utils/afpd-mtab.pl
1300 contrib/shell_utils/apple_cp
1301 contrib/shell_utils/apple_dump
1302 contrib/shell_utils/apple_mv
1303 contrib/shell_utils/apple_rm
1304 contrib/shell_utils/asip-status.pl
1305 contrib/timelord/Makefile
1306 contrib/a2boot/Makefile
1308 distrib/config/Makefile
1309 distrib/config/netatalk-config
1310 distrib/initscripts/Makefile
1316 etc/cnid_dbd/Makefile
1318 etc/uams/uams_krb4/Makefile
1322 include/atalk/Makefile
1324 libatalk/acl/Makefile
1325 libatalk/adouble/Makefile
1326 libatalk/asp/Makefile
1327 libatalk/atp/Makefile
1328 libatalk/bstring/Makefile
1329 libatalk/cnid/Makefile
1330 libatalk/cnid/cdb/Makefile
1331 libatalk/cnid/last/Makefile
1332 libatalk/cnid/dbd/Makefile
1333 libatalk/cnid/tdb/Makefile
1334 libatalk/compat/Makefile
1335 libatalk/dsi/Makefile
1336 libatalk/nbp/Makefile
1337 libatalk/netddp/Makefile
1338 libatalk/util/Makefile
1339 libatalk/util/test/Makefile
1340 libatalk/tdb/Makefile
1341 libatalk/unicode/Makefile
1342 libatalk/unicode/charsets/Makefile
1343 libatalk/vfs/Makefile
1352 sys/generic/Makefile
1353 sys/generic/sys/Makefile
1354 sys/netatalk/Makefile
1356 sys/netbsd/netatalk/Makefile
1357 sys/solaris/Makefile
1363 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
1366 AC_NETATALK_LIBS_SUMMARY
1367 AC_NETATALK_CONFIG_SUMMARY