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)
11 AM_MAINTAINER_MODE([enable])
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_neta_haveatfuncs=yes
78 AC_CHECK_FUNCS(openat renameat fstatat unlinkat, , ac_neta_haveatfuncs=no)
79 if test x"$ac_neta_haveatfuncs" = x"yes" ; then
80 AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)
81 AC_DEFINE([HAVE_ATFUNCS], 1, whether at funcs are available)
84 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
86 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
87 AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
88 dnl search for necessary libs for libpthread stuff
89 AC_SEARCH_LIBS(pthread_sigmask, pthread,,
90 [AC_MSG_ERROR([cannot find pthread_sigmask in libc or libpthread])])
91 if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
92 PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
94 AC_SUBST(PTHREAD_LIBS)
97 dnl Checks for (v)snprintf
98 NETATALK_SNPRINTF_CHECK
100 dnl --------------------------------------------------------------------------
101 dnl 64bit platform check
102 dnl --------------------------------------------------------------------------
104 AC_MSG_CHECKING([whether to check for 64bit libraries])
105 # Test if the compiler is in 64bit mode
106 echo 'int i;' > conftest.$ac_ext
107 atalk_cv_cc_64bit_output=no
108 if AC_TRY_EVAL(ac_compile); then
109 case `/usr/bin/file conftest.$ac_objext` in
111 atalk_cv_cc_64bit_output=yes
117 case $host_cpu:$atalk_cv_cc_64bit_output in
118 powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
122 atalk_libname="lib/64"
125 atalk_libname="lib64"
135 dnl --------------------------------------------------------------------------
136 dnl specific configuration comes in here:
137 dnl --------------------------------------------------------------------------
140 netatalk_cv_admin_group=yes
141 AC_MSG_CHECKING([for administrative group support])
142 AC_ARG_ENABLE(admin-group,
143 [ --disable-admin-group disable admin group],[
144 if test x"$enableval" = x"no"; then
145 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
146 netatalk_cv_admin_group=no
149 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
152 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
161 netatalk_cv_with_cracklib=no
162 AC_ARG_WITH(cracklib,
163 [ --with-cracklib=DICT enable/set location of cracklib dictionary],[
164 if test "x$withval" != "xno" ; then
166 AC_CHECK_LIB(crack, main, [
167 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
169 if test "$cracklib" = "yes"; then
170 cracklib="/usr/$atalk_libname/cracklib_dict"
172 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
173 [path to cracklib dictionary])
174 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
175 netatalk_cv_with_cracklib=yes
177 AC_MSG_ERROR([cracklib not found!])
183 AC_MSG_CHECKING([for cracklib support])
184 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
186 netatalk_cv_ddp_enabled=no
187 AC_MSG_CHECKING([whether to enable DDP])
189 [ --enable-ddp enable DDP (AppleTalk)],[
190 if test "$enableval" = "yes"; then
192 netatalk_cv_ddp_enabled=yes
195 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
199 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
203 AC_MSG_CHECKING([whether to enable debug code])
204 AC_ARG_ENABLE(debug1,
205 [ --enable-debug1 enable debug code],[
206 if test "$enableval" != "no"; then
207 if test "$enableval" = "yes"; then
208 AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included])
210 AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included])
221 AC_MSG_CHECKING([whether to enable verbose debug code])
223 [ --enable-debug enable verbose debug code],[
224 if test "$enableval" != "no"; then
225 if test "$enableval" = "yes"; then
226 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
228 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
233 AC_DEFINE(NDEBUG, 1, [Disable assertions])
237 AC_DEFINE(NDEBUG, 1, [Disable assertions])
241 AC_MSG_CHECKING([whether to enable debugging with debuggers])
242 AC_ARG_ENABLE(debugging,
243 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
244 if test "$enableval" != "no"; then
245 if test "$enableval" = "yes"; then
246 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
248 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
259 AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
262 dnl ----------- A NOTE ABOUT DROPKLUDGE
263 dnl The trouble with this fix is that if you know what the file is called, it
264 dnl can be read from the Unix side. That's okay for most academic institutions
265 dnl since the students don't have telnet access to the Mac servers. There is
266 dnl currently no one working on further development/fixes of DROPKLUDGE.
269 netatalk_cv_dropkludge=no
270 AC_MSG_CHECKING([whether to enable experimental dropbox support])
271 AC_ARG_ENABLE(dropkludge,
272 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],[
273 if test "$enableval" = "yes"; then
274 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
276 netatalk_cv_dropkludge=yes
285 netatalk_cv_force_uidgid=no
286 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
287 AC_ARG_ENABLE(force-uidgid,
288 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],[
289 if test "$enableval" = "yes"; then
290 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
291 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
293 netatalk_cv_force_uidgid=yes
302 dnl Check for CNID database backends
304 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
306 dnl Check for quota support
309 dnl Check for optional server location protocol support (used by MacOS X)
312 dnl Check for optional Zeroconf support
315 dnl Check for PAM libs
316 netatalk_cv_use_pam=no
320 netatalk_cv_use_pam=yes
321 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
324 netatalk_cv_use_shadowpw=no
326 [ --with-shadow enable shadow password support [[auto]]],
327 [netatalk_cv_use_shadowpw="$withval"],
328 [netatalk_cv_use_shadowpw=auto]
331 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
332 AC_CHECK_HEADER([shadow.h])
333 if test x"$ac_cv_header_shadow_h" = x"yes"; then
334 netatalk_cv_use_shadowpw=yes
335 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
337 if test "x$shadowpw" = "xyes"; then
338 AC_MSG_ERROR([shadow support not available])
340 netatalk_cv_use_shadowpw=no
345 AC_MSG_CHECKING([whether shadow support should be enabled])
346 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
354 netatalk_cv_use_shellcheck=yes
355 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
356 AC_ARG_ENABLE(shell-check,
357 [ --disable-shell-check disable checking for a valid shell],[
358 if test "$enableval" = "no"; then
359 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
361 netatalk_cv_use_shellcheck=no
370 NETATALK_TCP_WRAPPERS
372 AC_MSG_CHECKING([whether system (fcntl) locking should be disabled])
373 AC_ARG_ENABLE(locking,
374 [ --disable-locking disable system locking],[
375 if test "$enableval" = "no"; then
376 AC_DEFINE(DISABLE_LOCKING, 1, [Define if system (fcntl) locking should be disabled])
389 AC_ARG_ENABLE(redhat,
390 [ --enable-redhat use redhat-style sysv configuration ],[
391 if test "$enableval" = "yes"; then
394 AC_MSG_RESULT([enabling redhat-style sysv support])
399 [ --enable-suse use suse-style sysv configuration ],[
400 if test "$enableval" = "yes"; then
403 AC_MSG_RESULT([enabling suse-style sysv support])
407 AC_ARG_ENABLE(gentoo,
408 [ --enable-gentoo use gentoo-style sysv configuration ],[
409 if test "$enableval" = "yes"; then
412 AC_MSG_RESULT([enabling gentoo-style sysv support])
416 AC_ARG_ENABLE(netbsd,
417 [ --enable-netbsd use NetBSD-style rc.d configuration ],
418 if test "x$enableval" = "xyes"; then
421 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
424 AC_ARG_ENABLE(debian,
425 [ --enable-debian use debian-style sysv configuration ],[
426 if test "$enableval" = "yes"; then
429 AC_MSG_RESULT([enabling debian-style sysv support])
433 dnl ----- timelord compilation (disabled by default)
434 AC_MSG_CHECKING([whether timelord should be compiled])
436 AC_ARG_ENABLE(timelord,
437 [ --enable-timelord enable compilation of timelord server],
438 [compile_timelord="$enableval"],
439 [compile_timelord="no"]
441 AC_MSG_RESULT([$compile_timelord])
443 dnl ----- a2boot compilation (disabled by default)
444 AC_MSG_CHECKING([whether a2boot should be compiled])
446 AC_ARG_ENABLE(a2boot,
447 [ --enable-a2boot enable compilation of Apple2 boot server],
448 [compile_a2boot="$enableval"],
449 [compile_a2boot="no"]
451 AC_MSG_RESULT([$compile_a2boot])
453 AC_ARG_WITH(uams-path,
454 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],[
457 uams_path="${PKGCONFDIR}/uams"
463 dnl check if we can use attribute unused (gcc only) from ethereal
464 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
465 if test x$GCC != x ; then
466 CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
469 CFLAGS="-D_U_=\"\" $CFLAGS"
473 dnl --------------------------------------------------------------------------
474 dnl FHS stuff has to be done last because it overrides other defaults
475 dnl --------------------------------------------------------------------------
477 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
479 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[
480 if test "$enableval" = "yes"; then
481 uams_path="${libdir}/netatalk"
483 PKGCONFDIR=${sysconfdir}/netatalk
484 SERVERTEXT="${PKGCONFDIR}/msg"
486 mandir="/usr/share/man"
487 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
497 dnl --------------------------------------------------------------------------
498 dnl post-FHS substitutions, etc
499 dnl --------------------------------------------------------------------------
502 dnl AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
503 dnl [path to UAMs [default=PKGCONF/uams]])
504 UAMS_PATH="${uams_path}"
507 dnl --------------------------------------------------------------------------
508 dnl drop in includes for top level directory structures here...
509 dnl --------------------------------------------------------------------------
511 dnl Note: $(top_srcdir)/include should be added before all other includes
512 dnl so that includes from that directory a preferred to includes from
513 dnl /usr/include or similar places.
514 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
515 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
517 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
519 dnl --------------------------------------------------------------------------
520 dnl specific configuration comes in here:
521 dnl --------------------------------------------------------------------------
523 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
525 dnl --------------------- determine operating system from "target"
527 *aix*) this_os=aix ;;
528 *freebsd*) this_os=freebsd ;;
529 *hpux11*) this_os=hpux11 ;;
530 *irix*) this_os=irix ;;
531 *linux*) this_os=linux ;;
532 *osx*) this_os=macosx ;;
533 *darwin*) this_os=macosx ;;
534 *netbsd*) this_os=netbsd ;;
535 *openbsd*) this_os=openbsd ;;
536 *osf*) this_os=tru64 ;;
537 *solaris*) this_os=solaris ;;
541 i386|i486|i586|i686|k7) this_cpu=x86 ;;
542 alpha) this_cpu=alpha ;;
543 mips) this_cpu=mips ;;
544 powerpc|ppc) this_cpu=ppc ;;
547 dnl --------------------- GNU source
549 linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
551 *kfreebsd-gnu*) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
555 dnl --------------------- operating system specific flags (port from sys/*)
557 dnl ----- AIX specific -----
558 if test x"$this_os" = "xaix"; then
559 AC_MSG_RESULT([ * AIX specific configuration])
560 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
562 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
563 dnl compilation environment. It's enough to get things defined
564 dnl right in endian.h provided that long long is supported, though.
565 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
568 dnl ----- FreeBSD specific -----
569 if test x"$this_os" = "xfreebsd"; then
570 AC_MSG_RESULT([ * FreeBSD specific configuration])
571 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
572 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
573 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
574 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
577 dnl ----- HP-UX 11 specific -----
578 if test x"$this_os" = "xhpux11"; then
579 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
581 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
582 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
585 dnl ----- IRIX specific -----
586 if test x"$this_os" = "xirix"; then
587 AC_MSG_RESULT([ * IRIX specific configuration])
589 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
592 dnl ----- Linux specific -----
593 if test x"$this_os" = "xlinux"; then
594 AC_MSG_RESULT([ * Linux specific configuration])
596 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
597 AC_MSG_CHECKING([for struct atalk_addr])
598 dnl AC_COMPILE_IFELSE([
600 #include <sys/socket.h>
601 #include <asm/types.h>
602 #include <linux/atalk.h>
604 struct atalk_addr foo;
607 ac_have_atalk_addr=yes
613 if test "x$ac_have_atalk_addr" = "xyes"; then
614 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
617 dnl ----- check if we need the quotactl wrapper
618 # AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
619 # AC_CHECK_FUNC(quotactl,,
620 # AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed])
621 # AC_MSG_RESULT([enabling quotactl wrapper])
624 # For quotas on Linux XFS filesystems
627 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
628 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
629 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
633 dnl ----- as far as I can tell, dbtob always does the wrong thing
634 dnl ----- on every single version of linux I've ever played with.
635 dnl ----- see etc/afpd/quota.c
636 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
638 netatalk_cv_linux_sendfile=yes
639 AC_MSG_CHECKING([use sendfile syscall])
640 AC_ARG_ENABLE(sendfile,
641 [ --disable-sendfile disable linux sendfile syscall],[
642 if test x"$enableval" = x"no"; then
643 netatalk_cv_linux_sendfile=no
655 if test x"$netatalk_cv_linux_sendfile" = "xyes"; then
656 AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[
657 AC_TRY_LINK([#include <sys/sendfile.h>],
662 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
664 netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)])
666 # Try and cope with broken Linux sendfile....
667 AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[
669 #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
670 #undef _FILE_OFFSET_BITS
672 #include <sys/sendfile.h>],
677 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
679 netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)])
681 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
682 AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
683 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
684 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
685 elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
686 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
687 AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
688 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
690 netatalk_cv_linux_sendfile=no
695 dnl ----- Linux/alpha specific -----
696 if test x"$this_cpu" = "xalpha"; then
697 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
698 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
705 dnl ----- Mac OSX specific -----
706 if test x"$this_os" = "xmacosx"; then
707 AC_MSG_RESULT([ * Mac OSX specific configuration])
708 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
709 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
710 dnl AC_DEFINE(NO_DLFCN_H)
711 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
712 AC_DEFINE(NO_QUOTA_SUPPORT, 1, [Define if Quota support should be disabled])
713 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
716 dnl ----- NetBSD specific -----
717 if test x"$this_os" = "xnetbsd"; then
718 AC_MSG_RESULT([ * NetBSD specific configuration])
719 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
720 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
721 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
723 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
726 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
727 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
730 dnl ----- OpenBSD specific -----
731 if test x"$this_os" = "xopenbsd"; then
732 AC_MSG_RESULT([ * OpenBSD specific configuration])
733 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
734 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
737 dnl ----- Solaris specific -----
738 if test x"$this_os" = "xsolaris"; then
739 AC_MSG_RESULT([ * Solaris specific configuration])
740 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
741 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
742 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
743 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
744 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
749 AC_MSG_CHECKING([if we can build Solaris kernel module])
750 if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
753 AC_MSG_RESULT([$solaris_module])
755 COMPILE_64BIT_KMODULE=no
758 COMPILE_KERNEL_GCC=no
760 if test "$solaris_module" = "yes"; then
761 dnl Solaris kernel module stuff
762 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
764 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
765 if test -x /usr/bin/isainfo; then
766 # check for 64 bit platform
767 if isainfo -kv | grep '^64-bit'; then
768 COMPILE_64BIT_KMODULE=yes
772 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
774 if test "${GCC}" = yes; then
775 COMPILE_KERNEL_GCC=yes
776 if test "$COMPILE_64BIT_KMODULE" = yes; then
778 AC_MSG_CHECKING([if we can build a 64bit kernel module])
780 case `$CC --version 2>/dev/null` in
782 COMPILE_64BIT_KMODULE=no
783 COMPILE_KERNEL_GCC=no
788 #KLDFLAGS="-melf64_sparc"
792 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
798 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
800 if test "$COMPILE_64BIT_KMODULE" = yes; then
801 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
802 KCFLAGS="-xarch=v9 -xregs=no%appl"
808 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
811 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
813 #include <sys/stream.h>
814 #include <sys/ddi.h>],
818 netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_HAVE_TIMEOUT_ID_T=cross)])
820 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
823 AC_SUBST(COMPILE_KERNEL_GCC)
824 AC_SUBST(COMPILE_64BIT_KMODULE)
829 dnl ----- Tru64 specific -----
830 if test x"$this_os" = "xtru64"; then
831 AC_MSG_RESULT([ * Tru64 specific configuration])
832 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
833 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
834 dnl AC_DEFINE(USE_MOUNT_H)
835 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
836 dnl AC_DEFINE(USE_UFS_QUOTA_H)
837 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
838 AC_DEFINE(_OSF_SOURCE, 1, [Define if the *passwd UAMs should be used])
839 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for Berkeley DB 4])
840 AC_CHECK_LIB(security,set_auth_parameters)
841 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
846 dnl -- check for libgcrypt, if found enables DHX UAM
847 AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
848 neta_cv_have_libgcrypt=yes
849 AC_MSG_NOTICE([Enabling DHX2 UAM])
850 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define if the DHX2 modules should be built with libgcrypt])
851 AC_DEFINE(UAM_DHX2, 1, [Define if the DHX2 UAM modules should be compiled])
854 dnl -- look for openssl, if found enables DHX UAM and Randnum UAM
857 dnl Check for Berkeley DB library
858 if test "x$bdb_required" = "xyes"; then
861 AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
862 AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
863 AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
864 AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
865 AC_MSG_RESULT([your linker is configured to check for libraries there.])
866 AC_MSG_ERROR([Berkeley DB library required but not found!])
870 dnl -- check for crypt
873 dnl --------------------- check for building PGP UAM module
875 AC_MSG_CHECKING([whether the PGP UAM should be build])
876 AC_ARG_ENABLE(pgp-uam,
877 [ --enable-pgp-uam enable build of PGP UAM module],[
878 if test "$enableval" = "yes"; then
879 if test "x$neta_cv_have_openssl" = "xyes"; then
880 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
892 dnl --------------------- check for building Kerberos v4 UAM module
894 AC_MSG_CHECKING([whether the Kerberos IV UAM should be build])
895 AC_ARG_ENABLE(krb4-uam,
896 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],[
897 if test "$enableval" = "yes"; then
898 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
909 dnl --------------------- check for building Kerberos V UAM module
911 netatalk_cv_build_krb5_uam=no
912 AC_ARG_ENABLE(krbV-uam,
913 [ --enable-krbV-uam enable build of Kerberos V UAM module],
915 if test x"$enableval" = x"yes"; then
916 NETATALK_GSSAPI_CHECK([
917 netatalk_cv_build_krb5_uam=yes
919 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
926 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
927 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
932 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
934 dnl --------------------- overwrite the config files . . . or not.
936 AC_MSG_CHECKING([whether configuration files should be overwritten])
937 AC_ARG_ENABLE(overwrite,
938 [ --enable-overwrite overwrite configuration files during installation],
939 [OVERWRITE_CONFIG="${enable_overwrite}"],
940 [OVERWRITE_CONFIG="no"]
942 AC_MSG_RESULT([$OVERWRITE_CONFIG])
944 dnl --------------------- check for LDAP support, for client-side ACL visibility
945 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
947 [AS_HELP_STRING([--with-ldap],
948 [LDAP support (default=auto)])],
957 AC_MSG_RESULT($with_ldap)
959 if test x"$with_ldap" != x"no" ; then
960 AC_CHECK_HEADER([ldap.h], with_ldap=yes,
961 [ if test x"$with_ldap" = x"yes" ; then
962 AC_MSG_ERROR([Missing LDAP headers])
966 AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
967 [ if test x"$with_ldap" = x"yes" ; then
968 AC_MSG_ERROR([Missing LDAP library])
974 if test x"$with_ldap" = x"yes"; then
975 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
978 dnl --------------------- check for ACL support
979 AC_MSG_CHECKING(whether to support ACLs)
981 [AS_HELP_STRING([--with-acls],
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])
1001 if test x"$with_acl_support" = x"yes" ; then
1002 AC_MSG_NOTICE(checking whether ACL support is available:)
1005 AC_MSG_NOTICE(Using UnixWare ACLs)
1006 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
1009 AC_MSG_NOTICE(Using solaris ACLs)
1010 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
1011 ACL_LIBS="$ACL_LIBS -lsec"
1014 AC_MSG_NOTICE(Using HPUX ACLs)
1015 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
1018 AC_MSG_NOTICE(Using IRIX ACLs)
1019 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
1022 AC_MSG_NOTICE(Using AIX ACLs)
1023 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
1026 AC_MSG_NOTICE(Using Tru64 ACLs)
1027 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
1028 ACL_LIBS="$ACL_LIBS -lpacl"
1031 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
1032 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
1035 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
1038 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
1041 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
1043 LIBS="$LIBS $ACL_LIBS"
1045 #include <sys/types.h>
1046 #include <sys/acl.h>
1050 acl_entry_t *entry_p;
1051 return acl_get_entry(acl, entry_id, entry_p);
1053 [netatalk_cv_HAVE_POSIX_ACLS=yes],
1054 [netatalk_cv_HAVE_POSIX_ACLS=no
1055 with_acl_support=no])
1058 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
1059 AC_MSG_NOTICE(Using POSIX ACLs)
1060 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
1061 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
1063 LIBS="$LIBS $ACL_LIBS"
1065 #include <sys/types.h>
1066 #include <sys/acl.h>
1068 acl_permset_t permset_d;
1070 return acl_get_perm_np(permset_d, perm);
1072 [netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],
1073 [netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
1076 if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
1077 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
1080 AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
1082 LIBS="$LIBS $ACL_LIBS"
1083 AC_CHECK_FUNCS(acl_from_mode,
1084 [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
1085 [netatalk_cv_HAVE_ACL_FROM_MODE=no])
1088 if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
1089 AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
1094 AC_MSG_NOTICE(ACL support is not avaliable)
1095 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
1101 if test x"$with_acl_support" = x"yes" ; then
1102 AC_CHECK_HEADERS([acl/libacl.h])
1103 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
1107 dnl --------------------- check for Extended Attributes support
1109 neta_cv_eas_sys_found=no
1110 neta_cv_eas_sys_not_found=no
1112 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
1117 AC_SEARCH_LIBS(getproplist, [proplist])
1118 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
1119 [neta_cv_eas_sys_found=yes],
1120 [neta_cv_eas_sys_not_found=yes])
1121 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
1122 [neta_cv_eas_sys_not_found=yes])
1123 AC_CHECK_FUNCS([sizeof_proplist_entry],,
1124 [neta_cv_eas_sys_not_found=yes])
1128 AC_CHECK_FUNCS([attropen],
1129 [neta_cv_eas_sys_found=yes],
1130 [neta_cv_eas_sys_not_found=yes])
1134 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
1135 [neta_cv_eas_sys_found=yes],
1136 [neta_cv_eas_sys_not_found=yes])
1137 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
1138 [neta_cv_eas_sys_not_found=yes])
1139 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
1140 [neta_cv_eas_sys_not_found=yes])
1141 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
1142 [neta_cv_eas_sys_not_found=yes])
1145 *freebsd4* | *dragonfly* )
1146 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
1150 AC_SEARCH_LIBS(getxattr, [attr])
1152 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1153 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
1154 [neta_cv_eas_sys_found=yes],
1155 [neta_cv_eas_sys_not_found=yes])
1156 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
1157 [neta_cv_eas_sys_not_found=yes])
1158 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
1159 [neta_cv_eas_sys_not_found=yes])
1162 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1163 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
1164 [neta_cv_eas_sys_found=yes],
1165 [neta_cv_eas_sys_not_found=yes])
1166 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
1167 [neta_cv_eas_sys_not_found=yes])
1170 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1171 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
1172 [neta_cv_eas_sys_not_found=yes])
1173 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
1174 [neta_cv_eas_sys_not_found=yes])
1179 # Do xattr functions take additional options like on Darwin?
1180 if test x"$ac_cv_func_getxattr" = x"yes" ; then
1181 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
1183 LIBS="$LIBS $ACL_LIBS"
1185 #include <sys/types.h>
1186 #if HAVE_ATTR_XATTR_H
1187 #include <attr/xattr.h>
1188 #elif HAVE_SYS_XATTR_H
1189 #include <sys/xattr.h>
1192 getxattr(0, 0, 0, 0, 0, 0);
1194 [smb_attr_cv_xattr_add_opt=yes],
1195 [smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
1197 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
1198 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
1202 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
1203 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
1204 neta_cv_eas="$neta_cv_eas | sys"
1207 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
1209 dnl --------------------- Check if realpath() takes NULL
1210 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
1211 neta_cv_REALPATH_TAKES_NULL, [
1217 void exit_on_core(int ignored) {
1223 signal(SIGSEGV, exit_on_core);
1224 newpath = realpath("/tmp", NULL);
1225 exit((newpath != NULL) ? 0 : 1);
1227 neta_cv_REALPATH_TAKES_NULL=yes,
1228 neta_cv_REALPATH_TAKES_NULL=no,
1229 neta_cv_REALPATH_TAKES_NULL=cross
1234 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
1235 AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])
1238 dnl --------------------- Netatalk Webmin
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(HAVE_LDAP, test x"$with_ldap" = x"yes")
1254 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
1255 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
1256 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
1257 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
1258 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
1259 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
1260 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
1261 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
1262 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
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)
1274 AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
1276 dnl --------------------- generate files
1281 bin/adv1tov2/Makefile
1283 bin/afppasswd/Makefile
1285 bin/cnid/cnid2_create
1286 bin/getzones/Makefile
1287 bin/megatron/Makefile
1291 bin/psorder/Makefile
1292 bin/uniconv/Makefile
1296 contrib/macusers/Makefile
1297 contrib/macusers/macusers
1298 contrib/printing/Makefile
1299 contrib/shell_utils/Makefile
1300 contrib/shell_utils/afpd-mtab.pl
1301 contrib/shell_utils/apple_dump
1302 contrib/shell_utils/asip-status.pl
1303 contrib/timelord/Makefile
1304 contrib/a2boot/Makefile
1306 distrib/config/Makefile
1307 distrib/config/netatalk-config
1308 distrib/initscripts/Makefile
1314 etc/cnid_dbd/Makefile
1316 etc/uams/uams_krb4/Makefile
1320 include/atalk/Makefile
1322 libatalk/acl/Makefile
1323 libatalk/adouble/Makefile
1324 libatalk/asp/Makefile
1325 libatalk/atp/Makefile
1326 libatalk/bstring/Makefile
1327 libatalk/cnid/Makefile
1328 libatalk/cnid/cdb/Makefile
1329 libatalk/cnid/last/Makefile
1330 libatalk/cnid/dbd/Makefile
1331 libatalk/cnid/tdb/Makefile
1332 libatalk/compat/Makefile
1333 libatalk/dsi/Makefile
1334 libatalk/nbp/Makefile
1335 libatalk/netddp/Makefile
1336 libatalk/util/Makefile
1337 libatalk/tdb/Makefile
1338 libatalk/unicode/Makefile
1339 libatalk/unicode/charsets/Makefile
1340 libatalk/vfs/Makefile
1349 sys/generic/Makefile
1350 sys/generic/sys/Makefile
1351 sys/netatalk/Makefile
1353 sys/netbsd/netatalk/Makefile
1354 sys/solaris/Makefile
1360 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
1363 AC_NETATALK_LIBS_SUMMARY
1364 AC_NETATALK_CONFIG_SUMMARY