1 dnl $Id: configure.in,v 1.217 2009-04-28 13:01:24 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.
27 dnl *********************************************************************
28 dnl FIXME! FIXME! These should be selectable properly, and should produce
29 dnl the proper flags and defines...
30 dnl *********************************************************************
32 ############################################
33 # we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
34 #AC_SEARCH_LIBS(dlopen, [dl])
35 # dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
37 dnl Checks for libraries.
38 dnl Replace `main' with a function in -labs:
39 dnl AC_CHECK_LIB(abs, main)
40 dnl Replace `main' with a function in -laudit:
41 dnl AC_CHECK_LIB(audit, main)
42 dnl Replace `main' with a function in -lauth:
43 dnl AC_CHECK_LIB(auth, main)
44 dnl Replace `main' with a function in -lcmd:
45 dnl AC_CHECK_LIB(cmd, main)
46 dnl Replace `main' with a function in -lcrypt:
47 dnl AC_CHECK_LIB(crypt, main)
48 dnl Replace `main' with a function in -ld:
49 dnl AC_CHECK_LIB(d, main)
50 dnl Replace `main' with a function in -ldl:
51 dnl AC_CHECK_LIB(dl, dlopen)
52 dnl Replace `main' with a function in -lkauth:
53 dnl AC_CHECK_LIB(kauth, main)
54 dnl Replace `main' with a function in -lkrb:
55 dnl AC_CHECK_LIB(krb, main)
56 dnl Replace `main' with a function in -llwp:
57 dnl AC_CHECK_LIB(lwp, main)
58 dnl Replace `main' with a function in -ln:
59 dnl AC_CHECK_LIB(n, main)
61 dnl not the right stuff but should be enough for now
62 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
63 AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
65 dnl Replace `main' with a function in -lprot:
66 dnl AC_CHECK_LIB(prot, main)
67 dnl Replace `main' with a function in -lrx:
68 dnl AC_CHECK_LIB(rx, main)
69 dnl Replace `main' with a function in -lrxkad:
70 dnl AC_CHECK_LIB(rxkad, main)
71 dnl Replace `main' with a function in -lsys:
72 dnl AC_CHECK_LIB(sys, main)
73 dnl Replace `main' with a function in -lubik:
74 dnl AC_CHECK_LIB(ubik, main)
78 # Check presence of some functions
80 # Check for XPG4 access() function
81 # Be sure to test before adding AFS libs in LIBS path as AFS lib
82 # has such a function that works only on AFS filesystems.
83 AC_CHECK_FUNCS(access)
85 AC_CHECK_FUNCS(pread pwrite)
87 dnl Checks for header files.
91 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)
92 AC_CHECK_HEADER(sys/cdefs.h,,
93 AC_MSG_RESULT([enabling generic cdefs.h from tree])
94 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
96 AC_CHECK_HEADERS([sys/mount.h], , ,
97 [#ifdef HAVE_SYS_PARAM_H
98 #include <sys/param.h>
102 AC_CHECK_HEADERS(langinfo.h locale.h sys/filio.h)
104 dnl Checks for typedefs, structures, and compiler characteristics.
116 dnl --------------------------------------------------------------------------
117 dnl check if dlsym needs to add an underscore, uses libtool macros
118 dnl --------------------------------------------------------------------------
120 AC_CHECK_FUNCS(dlopen dlsym dlclose)
122 if test x"$libltdl_cv_need_uscore" = xyes; then
123 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
127 dnl Checks for library functions.
129 AC_PROG_GCC_TRADITIONAL
136 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy)
137 AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo)
138 AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
139 AC_CHECK_FUNCS(strlcpy strlcat setlinebuf gethostid dirfd)
140 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
143 dnl Checks for (v)snprintf
144 NETATALK_SNPRINTF_CHECK
146 dnl --------------------------------------------------------------------------
147 dnl 64bit platform check
148 dnl --------------------------------------------------------------------------
150 AC_MSG_CHECKING([whether to check for 64bit libraries])
151 dnl Determine libdir name
154 # Test if the compiler is 64bit
155 echo 'int i;' > conftest.$ac_ext
156 atalk_cv_cc_64bit_output=no
157 if AC_TRY_EVAL(ac_compile); then
158 case `/usr/bin/file conftest.$ac_objext` in
160 atalk_cv_cc_64bit_output=yes
169 dnl FIXME: Do we need something like this for Solaris 64bit?
172 case $host_cpu:$atalk_cv_cc_64bit_output in
173 powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
174 atalk_libname="lib64"
183 dnl --------------------------------------------------------------------------
184 dnl specific configuration comes in here:
185 dnl --------------------------------------------------------------------------
188 netatalk_cv_admin_group=yes
189 AC_MSG_CHECKING([for administrative group support])
190 AC_ARG_ENABLE(admin-group,
191 [ --disable-admin-group disable admin group],[
192 if test x"$enableval" = x"no"; then
193 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
194 netatalk_cv_admin_group=no
197 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
200 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
209 AC_MSG_CHECKING([whether to force logfile])
211 [ --with-logfile=PATH force logging to file PATH],[
212 if test x"$withval" = x"no"; then
213 AC_MSG_RESULT([no, syslog])
214 elif test "$withval" != "yes"; then
215 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
216 AC_MSG_RESULT([$withval])
218 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
219 AC_MSG_RESULT([/var/log/netatalk.log])
221 AC_MSG_RESULT([no, syslog])
225 netatalk_cv_with_cracklib=no
226 AC_ARG_WITH(cracklib,
227 [ --with-cracklib=DICT enable/set location of cracklib dictionary],[
228 if test "x$withval" != "xno" ; then
230 AC_CHECK_LIB(crack, main, [
231 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
233 if test "$cracklib" = "yes"; then
234 cracklib="/usr/$atalk_libname/cracklib_dict"
236 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
237 [path to cracklib dictionary])
238 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
239 netatalk_cv_with_cracklib=yes
241 AC_MSG_ERROR([cracklib not found!])
247 AC_MSG_CHECKING([for cracklib support])
248 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
250 netatalk_cv_ddp_enabled=yes
251 AC_MSG_CHECKING([whether to enable DDP])
253 [ --disable-ddp disable DDP],[
254 if test "$enableval" = "no"; then
255 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
257 netatalk_cv_ddp_enabled=no
266 AC_MSG_CHECKING([whether to enable debug code])
267 AC_ARG_ENABLE(debug1,
268 [ --enable-debug1 enable debug code],[
269 if test "$enableval" != "no"; then
270 if test "$enableval" = "yes"; then
271 AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included])
273 AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included])
284 AC_MSG_CHECKING([whether to enable verbose debug code])
286 [ --enable-debug enable verbose debug code],[
287 if test "$enableval" != "no"; then
288 if test "$enableval" = "yes"; then
289 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
291 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
302 AC_MSG_CHECKING([whether to enable debugging with debuggers])
303 AC_ARG_ENABLE(debugging,
304 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
305 if test "$enableval" != "no"; then
306 if test "$enableval" = "yes"; then
307 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
309 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
323 AC_MSG_CHECKING([whether AFP 3.x calls should be enabled])
325 [ --disable-afp3 disable AFP 3.x calls],
327 if test x"$enableval" != x"no"; then
340 if test x"$afp3" = x"yes"; then
342 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
344 if test x"$afp3set" = x"yes"; then
345 AC_MSG_ERROR([AFP 3.x support requires Large File Support.])
347 AC_MSG_WARN([AFP 3.x support requires Large File Support. AFP3.x support disabled])
355 dnl ----------- A NOTE ABOUT DROPKLUDGE
356 dnl The trouble with this fix is that if you know what the file is called, it
357 dnl can be read from the Unix side. That's okay for most academic institutions
358 dnl since the students don't have telnet access to the Mac servers. There is
359 dnl currently no one working on further development/fixes of DROPKLUDGE.
362 netatalk_cv_dropkludge=no
363 AC_MSG_CHECKING([whether to enable experimental dropbox support])
364 AC_ARG_ENABLE(dropkludge,
365 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],[
366 if test "$enableval" = "yes"; then
367 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
369 netatalk_cv_dropkludge=yes
378 netatalk_cv_force_uidgid=no
379 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
380 AC_ARG_ENABLE(force-uidgid,
381 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],[
382 if test "$enableval" = "yes"; then
383 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
384 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
386 netatalk_cv_force_uidgid=yes
395 dnl Check for CNID database backends
397 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
399 dnl Check for quota support
402 dnl Check for optional server location protocol support (used by MacOS X)
405 dnl Check for PAM libs
406 netatalk_cv_use_pam=no
410 netatalk_cv_use_pam=yes
411 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
414 netatalk_cv_use_shadowpw=no
416 [ --with-shadow enable shadow password support [[auto]]],
417 [netatalk_cv_use_shadowpw="$withval"],
418 [netatalk_cv_use_shadowpw=auto]
421 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
422 AC_CHECK_HEADER([shadow.h])
423 if test x"$ac_cv_header_shadow_h" = x"yes"; then
424 netatalk_cv_use_shadowpw=yes
425 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
427 if test "x$shadowpw" = "xyes"; then
428 AC_MSG_ERROR([shadow support not available])
430 netatalk_cv_use_shadowpw=no
435 AC_MSG_CHECKING([whether shadow support should be enabled])
436 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
444 netatalk_cv_use_shellcheck=yes
445 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
446 AC_ARG_ENABLE(shell-check,
447 [ --disable-shell-check disable checking for a valid shell],[
448 if test "$enableval" = "no"; then
449 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
451 netatalk_cv_use_shellcheck=no
460 NETATALK_TCP_WRAPPERS
462 AC_MSG_CHECKING([whether system (fcntl) locking should be disabled])
463 AC_ARG_ENABLE(locking,
464 [ --disable-locking disable system locking],[
465 if test "$enableval" = "no"; then
466 AC_DEFINE(DISABLE_LOCKING, 1, [Define if system (fcntl) locking should be disabled])
479 AC_ARG_ENABLE(redhat,
480 [ --enable-redhat use redhat-style sysv configuration ],[
481 if test "$enableval" = "yes"; then
484 AC_MSG_RESULT([enabling redhat-style sysv support])
489 [ --enable-suse use suse-style sysv configuration ],[
490 if test "$enableval" = "yes"; then
493 AC_MSG_RESULT([enabling suse-style sysv support])
497 AC_ARG_ENABLE(gentoo,
498 [ --enable-gentoo use gentoo-style sysv configuration ],[
499 if test "$enableval" = "yes"; then
502 AC_MSG_RESULT([enabling gentoo-style sysv support])
506 AC_ARG_ENABLE(cobalt,
507 [ --enable-cobalt use cobalt-style sysv configuration ],
508 if test "$enableval" = "yes"; then
511 AC_MSG_RESULT([enabling cobalt-style sysv support])
514 AC_ARG_ENABLE(netbsd,
515 [ --enable-netbsd use NetBSD-style rc.d configuration ],
516 if test "x$enableval" = "xyes"; then
519 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
522 AC_ARG_ENABLE(debian,
523 [ --enable-debian use debian-style sysv configuration ],[
524 if test "$enableval" = "yes"; then
527 AC_MSG_RESULT([enabling debian-style sysv support])
531 dnl ----- timelord compilation (disabled by default)
532 AC_MSG_CHECKING([whether timelord should be compiled])
534 AC_ARG_ENABLE(timelord,
535 [ --enable-timelord enable compilation of timelord server],
536 [compile_timelord="$enableval"],
537 [compile_timelord="no"]
539 AC_MSG_RESULT([$compile_timelord])
541 dnl ----- a2boot compilation (disabled by default)
542 AC_MSG_CHECKING([whether a2boot should be compiled])
544 AC_ARG_ENABLE(a2boot,
545 [ --enable-a2boot enable compilation of Apple2 boot server],
546 [compile_a2boot="$enableval"],
547 [compile_a2boot="no"]
549 AC_MSG_RESULT([$compile_a2boot])
551 AC_ARG_WITH(uams-path,
552 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],[
555 uams_path="${PKGCONFDIR}/uams"
561 dnl check if we can use attribute unused (gcc only) from ethereal
562 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
563 if test x$GCC != x ; then
564 CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
567 CFLAGS="-D_U_=\"\" $CFLAGS"
571 dnl --------------------------------------------------------------------------
572 dnl FHS stuff has to be done last because it overrides other defaults
573 dnl --------------------------------------------------------------------------
575 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
577 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[
578 if test "$enableval" = "yes"; then
579 uams_path="${libdir}/netatalk"
581 PKGCONFDIR=${sysconfdir}/netatalk
582 SERVERTEXT="${PKGCONFDIR}/msg"
584 mandir="/usr/share/man"
585 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
595 dnl --------------------------------------------------------------------------
596 dnl post-FHS substitutions, etc
597 dnl --------------------------------------------------------------------------
600 dnl AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
601 dnl [path to UAMs [default=PKGCONF/uams]])
602 UAMS_PATH="${uams_path}"
605 dnl --------------------------------------------------------------------------
606 dnl drop in includes for top level directory structures here...
607 dnl --------------------------------------------------------------------------
609 dnl Note: $(top_srcdir)/include should be added before all other includes
610 dnl so that includes from that directory a preferred to includes from
611 dnl /usr/include or similar places.
612 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
613 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
615 dnl --------------------------------------------------------------------------
616 dnl specific configuration comes in here:
617 dnl --------------------------------------------------------------------------
619 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
621 dnl --------------------- determine operating system from "target"
623 *aix*) this_os=aix ;;
624 *freebsd*) this_os=freebsd ;;
625 *hpux11*) this_os=hpux11 ;;
626 *irix*) this_os=irix ;;
627 *linux*) this_os=linux ;;
628 *osx*) this_os=macosx ;;
629 *darwin*) this_os=macosx ;;
630 *netbsd*) this_os=netbsd ;;
631 *openbsd*) this_os=openbsd ;;
632 *osf*) this_os=tru64 ;;
633 *solaris*) this_os=solaris ;;
637 i386|i486|i586|i686|k7) this_cpu=x86 ;;
638 alpha) this_cpu=alpha ;;
639 mips) this_cpu=mips ;;
640 powerpc|ppc) this_cpu=ppc ;;
643 dnl --------------------- operating system specific flags (port from sys/*)
645 dnl ----- AIX specific -----
646 if test x"$this_os" = "xaix"; then
647 AC_MSG_RESULT([ * AIX specific configuration])
648 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
650 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
651 dnl compilation environment. It's enough to get things defined
652 dnl right in endian.h provided that long long is supported, though.
653 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
656 dnl ----- FreeBSD specific -----
657 if test x"$this_os" = "xfreebsd"; then
658 AC_MSG_RESULT([ * FreeBSD specific configuration])
659 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
660 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
661 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
664 dnl ----- HP-UX 11 specific -----
665 if test x"$this_os" = "xhpux11"; then
666 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
668 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
669 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
672 dnl ----- IRIX specific -----
673 if test x"$this_os" = "xirix"; then
674 AC_MSG_RESULT([ * IRIX specific configuration])
676 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
679 dnl ----- Linux specific -----
680 if test x"$this_os" = "xlinux"; then
681 AC_MSG_RESULT([ * Linux specific configuration])
683 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
684 AC_MSG_CHECKING([for struct atalk_addr])
685 dnl AC_COMPILE_IFELSE([
687 #include <sys/socket.h>
688 #include <asm/types.h>
689 #include <linux/atalk.h>
691 struct atalk_addr foo;
694 ac_have_atalk_addr=yes
700 if test "x$ac_have_atalk_addr" = "xyes"; then
701 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
704 dnl ----- check if we need the quotactl wrapper
705 # AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
706 # AC_CHECK_FUNC(quotactl,,
707 # AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed])
708 # AC_MSG_RESULT([enabling quotactl wrapper])
711 # For quotas on Linux XFS filesystems
714 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
715 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
716 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
720 dnl ----- as far as I can tell, dbtob always does the wrong thing
721 dnl ----- on every single version of linux I've ever played with.
722 dnl ----- see etc/afpd/quota.c
723 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
725 netatalk_cv_linux_sendfile=no
726 dnl disable this for now, code doesn't use sendfile anyway
727 dnl AC_ARG_ENABLE(sendfile,
728 dnl [ --enable-sendfile use sendfile syscall default (no) ],[
729 dnl if test "$enableval" = "yes"; then
730 dnl netatalk_cv_linux_sendfile=yes
732 dnl AC_MSG_RESULT([enabling sendfile syscall])
736 if test x"$netatalk_cv_linux_sendfile" = "xyes"; then
737 AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
738 AC_TRY_LINK([#include <sys/sendfile.h>],
743 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
745 netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
747 # Try and cope with broken Linux sendfile....
748 AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
750 #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
751 #undef _FILE_OFFSET_BITS
753 #include <sys/sendfile.h>],
758 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
760 netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
762 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
763 AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
764 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
765 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
766 elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
767 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
768 AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
769 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
771 netatalk_cv_linux_sendfile=no
776 dnl ----- Linux/alpha specific -----
777 if test x"$this_cpu" = "xalpha"; then
778 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
779 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
786 dnl ----- Mac OSX specific -----
787 if test x"$this_os" = "xmacosx"; then
788 AC_MSG_RESULT([ * Mac OSX specific configuration])
789 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
790 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
791 dnl AC_DEFINE(NO_DLFCN_H)
792 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
793 AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
794 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
797 dnl ----- NetBSD specific -----
798 if test x"$this_os" = "xnetbsd"; then
799 AC_MSG_RESULT([ * NetBSD specific configuration])
800 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
801 AC_DEFINE(NETBSD, 1, [Define if OS is FreeBSD])
802 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
805 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
806 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
809 dnl ----- OpenBSD specific -----
810 if test x"$this_os" = "xopenbsd"; then
811 AC_MSG_RESULT([ * OpenBSD specific configuration])
812 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
813 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
816 dnl ----- Solaris specific -----
817 if test x"$this_os" = "xsolaris"; then
818 AC_MSG_RESULT([ * Solaris specific configuration])
819 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
820 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
821 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
822 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
823 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
828 AC_MSG_CHECKING([if we can build Solaris kernel module])
829 if test -x /usr/ccs/bin/ld; then
832 AC_MSG_RESULT([$solaris_module])
834 COMPILE_64BIT_KMODULE=no
837 COMPILE_KERNEL_GCC=no
839 if test "$solaris_module" = "yes"; then
840 dnl Solaris kernel module stuff
841 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
843 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
844 if test -x /usr/bin/isainfo; then
845 # check for 64 bit platform
846 if isainfo -kv | grep '^64-bit'; then
847 COMPILE_64BIT_KMODULE=yes
851 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
853 if test "${GCC}" = yes; then
854 COMPILE_KERNEL_GCC=yes
855 if test "$COMPILE_64BIT_KMODULE" = yes; then
857 AC_MSG_CHECKING([if we can build a 64bit kernel module])
859 case `$CC --version 2>/dev/null` in
861 COMPILE_64BIT_KMODULE=no
862 COMPILE_KERNEL_GCC=no
867 #KLDFLAGS="-melf64_sparc"
871 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
877 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
879 if test "$COMPILE_64BIT_KMODULE" = yes; then
880 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
881 KCFLAGS="-xarch=v9 -xregs=no%appl"
887 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
890 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
892 #include <sys/stream.h>
893 #include <sys/ddi.h>],
897 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
899 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
902 AC_SUBST(COMPILE_KERNEL_GCC)
903 AC_SUBST(COMPILE_64BIT_KMODULE)
908 dnl ----- Tru64 specific -----
909 if test x"$this_os" = "xtru64"; then
910 AC_MSG_RESULT([ * Tru64 specific configuration])
911 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
912 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
913 dnl AC_DEFINE(USE_MOUNT_H)
914 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
915 dnl AC_DEFINE(USE_UFS_QUOTA_H)
916 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
917 AC_DEFINE(_OSF_SOURCE, 1, [Define if the *passwd UAMs should be used])
918 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for Berkeley DB 4])
919 AC_CHECK_LIB(security,set_auth_parameters)
920 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
925 dnl -- check for libgcrypt, if found enables DHX UAM
926 AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
927 neta_cv_have_libgcrypt=yes
928 AC_MSG_NOTICE([Enabling DHX2 UAM])
929 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt])
930 AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled])
933 dnl -- look for openssl, if found enables DHX UAM and Randnum UAM
936 dnl Check for Berkeley DB library
937 if test "x$bdb_required" = "xyes"; then
940 AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
941 AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
942 AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
943 AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
944 AC_MSG_RESULT([your linker is configured to check for libraries there.])
945 AC_MSG_ERROR([Berkeley DB library required but not found!])
949 dnl -- check for crypt
952 dnl --------------------- check for building PGP UAM module
954 AC_MSG_CHECKING([whether the PGP UAM should be build])
955 AC_ARG_ENABLE(pgp-uam,
956 [ --enable-pgp-uam enable build of PGP UAM module],[
957 if test "$enableval" = "yes"; then
958 if test "x$neta_cv_have_openssl" = "xyes"; then
959 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
971 dnl --------------------- check for building Kerberos v4 UAM module
973 AC_MSG_CHECKING([whether the Kerberos IV UAM should be build])
974 AC_ARG_ENABLE(krb4-uam,
975 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],[
976 if test "$enableval" = "yes"; then
977 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
988 dnl --------------------- check for building Kerberos V UAM module
990 netatalk_cv_build_krb5_uam=no
991 AC_ARG_ENABLE(krbV-uam,
992 [ --enable-krbV-uam enable build of Kerberos V UAM module],
994 if test x"$enableval" = x"yes"; then
995 NETATALK_GSSAPI_CHECK([
996 netatalk_cv_build_krb5_uam=yes
998 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
1005 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
1006 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
1007 AC_MSG_RESULT([yes])
1011 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
1013 dnl --------------------- overwrite the config files . . . or not.
1015 AC_MSG_CHECKING([whether configuration files should be overwritten])
1016 AC_ARG_ENABLE(overwrite,
1017 [ --enable-overwrite overwrite configuration files during installation],
1018 [OVERWRITE_CONFIG="${enable_overwrite}"],
1019 [OVERWRITE_CONFIG="no"]
1021 AC_MSG_RESULT([$OVERWRITE_CONFIG])
1023 dnl --------------------- check for ACL support
1024 neta_cv_nfsv4acl="no"
1025 AC_MSG_CHECKING([if NFSv4 ACL Support should be enabled])
1026 AC_ARG_ENABLE(nfsv4acls,
1027 [ --enable-nfsv4acls enable NFSv4 ACL Support],[
1028 if test x"$enableval" = x"yes"; then
1029 AC_MSG_RESULT([yes])
1030 neta_cv_nfsv4acl="yes"
1037 if test x$neta_cv_nfsv4acl = xyes; then
1038 AC_CHECK_HEADER([ldap.h],,[
1039 AC_MSG_ERROR([ACL Support need the LDAP client headers not found.])
1043 AC_CHECK_LIB(ldap,ldap_init,neta_cv_nfsv4acl=yes,neta_cv_nfsv4acl=no)
1045 if test x$neta_cv_nfsv4acl = xyes; then
1046 AC_CHECK_HEADER([sys/acl.h],[
1047 AC_DEFINE([HAVE_NFSv4_ACLS], 1, [Enable ACL code])
1048 AC_MSG_NOTICE([Enabling ACL support])
1053 if test x$neta_cv_nfsv4acl = xyes; then
1054 LIBATALK_ACLS="acl/libacl.la"
1058 AC_SUBST(LIBATALK_ACLS)
1060 dnl --------------------- check for Extended Attributes support
1061 neta_cv_extattrs="no"
1062 AC_MSG_CHECKING([if Extended Attribute Support should be enabled])
1063 AC_ARG_ENABLE(extattrs,
1064 [ --enable-extattrs enable Extended Attributes],[
1065 if test x"$enableval" = x"yes"; then
1066 AC_MSG_RESULT([yes])
1067 neta_cv_extattrs="yes"
1074 if test x$neta_cv_extattrs = xyes; then
1075 AC_CHECK_LIB(c,attropen,neta_cv_extattrs=yes,neta_cv_extattrs=no)
1077 if test x$neta_cv_extattrs = xyes; then
1078 AC_MSG_NOTICE([Enabling Extended Attributes support])
1079 AC_DEFINE([HAVE_EXT_ATTRS], 1, [Enable Extended Attributes])
1082 dnl --------------------- last minute substitutions
1086 AC_SUBST(OVERWRITE_CONFIG)
1088 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
1089 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
1090 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
1091 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
1092 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
1093 AM_CONDITIONAL(USE_NFSv4_ACLS, test x$neta_cv_nfsv4acl = xyes)
1094 AM_CONDITIONAL(USE_EXT_ATTRS, test x$neta_cv_extattrs = xyes)
1095 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
1096 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
1097 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
1098 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
1099 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
1100 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
1101 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
1102 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
1103 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
1104 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
1105 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
1106 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
1107 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
1108 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
1109 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
1110 AM_CONDITIONAL(USE_SOLARIS, test x$sysv_style = xsolaris)
1111 AM_CONDITIONAL(USE_GENTOO, test x$sysv_style = xgentoo)
1112 AM_CONDITIONAL(USE_DEBIAN, test x$sysv_style = xdebian)
1113 AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x)
1114 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
1116 dnl --------------------- generate files
1120 bin/adv1tov2/Makefile
1123 bin/afppasswd/Makefile
1126 bin/cnid/cnid2_create
1127 bin/getzones/Makefile
1128 bin/megatron/Makefile
1131 bin/psorder/Makefile
1132 bin/uniconv/Makefile
1135 contrib/acltests/Makefile
1136 contrib/macusers/Makefile
1137 contrib/macusers/macusers
1140 contrib/printing/Makefile
1141 contrib/shell_utils/Makefile
1142 contrib/shell_utils/afpd-mtab.pl
1143 contrib/shell_utils/apple_cp
1144 contrib/shell_utils/apple_mv
1145 contrib/shell_utils/apple_rm
1146 contrib/shell_utils/apple_cleanup
1147 contrib/shell_utils/asip-status.pl
1148 contrib/timelord/Makefile
1149 contrib/a2boot/Makefile
1151 distrib/config/Makefile
1152 distrib/config/netatalk-config
1153 distrib/initscripts/Makefile
1159 etc/cnid_dbd/Makefile
1161 etc/uams/uams_krb4/Makefile
1165 include/atalk/Makefile
1167 libatalk/acl/Makefile
1168 libatalk/adouble/Makefile
1169 libatalk/asp/Makefile
1170 libatalk/atp/Makefile
1171 libatalk/cnid/Makefile
1172 libatalk/cnid/db3/Makefile
1173 libatalk/cnid/cdb/Makefile
1174 libatalk/cnid/last/Makefile
1175 libatalk/cnid/mtab/Makefile
1176 libatalk/cnid/dbd/Makefile
1177 libatalk/cnid/hash/Makefile
1178 libatalk/cnid/tdb/Makefile
1179 libatalk/compat/Makefile
1180 libatalk/dsi/Makefile
1181 libatalk/nbp/Makefile
1182 libatalk/netddp/Makefile
1183 libatalk/util/Makefile
1184 libatalk/util/test/Makefile
1185 libatalk/tdb/Makefile
1186 libatalk/unicode/Makefile
1187 libatalk/unicode/charsets/Makefile
1196 sys/generic/Makefile
1197 sys/generic/sys/Makefile
1198 sys/netatalk/Makefile
1200 sys/netbsd/netatalk/Makefile
1201 sys/solaris/Makefile
1205 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
1208 AC_NETATALK_LIBS_SUMMARY
1209 AC_NETATALK_CONFIG_SUMMARY