1 dnl $Id: configure.in,v 1.198 2003-12-15 06:13:38 srittau 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)
14 dnl Checks for programs.
31 dnl Checks for presence of some functions.
34 AC_CHECK_FUNCS(pread pwrite)
37 dnl Checks for header files.
43 AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.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 mount.h sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h)
44 AC_CHECK_HEADER(sys/cdefs.h,,
45 AC_MSG_RESULT([enabling generic cdefs.h from tree])
46 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
50 dnl Checks for typedefs, structures, and compiler characteristics.
63 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
66 dnl Checks for library functions.
70 AC_PROG_GCC_TRADITIONAL
77 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul setpgrp strchr memcpy)
81 dnl Checks for (v)snprintf
84 NETATALK_SNPRINTF_CHECK
86 dnl --------------------------------------------------------------------------
87 dnl specific configuration comes in here:
88 dnl --------------------------------------------------------------------------
90 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
92 AC_MSG_CHECKING([for administrative group support])
93 AC_ARG_WITH(admin-group,
94 [ --disable-admin-group disable admin group], [
95 if test "$enableval" = "no"; then
96 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
109 AC_MSG_CHECKING([for logfile path])
111 [ --with-logfile=PATH path for file used by logger [/var/log/netatalk.log]
112 use --without-logfile to disable logger], [
113 if test "x$withval" == "xno"; then
114 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
115 AC_MSG_RESULT([syslog])
116 elif test "$withval" != "yes"; then
117 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
118 AC_MSG_RESULT([$withval])
120 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
121 AC_MSG_RESULT([/var/log/netatalk.log])
123 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
124 AC_MSG_RESULT([/var/log/netatalk.log])
128 AC_ARG_WITH(cracklib,
129 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
130 if test "x$withval" != "xno" ; then
132 AC_CHECK_LIB(crack, main,
133 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
135 AC_MSG_RESULT([enabling cracklib support])
136 if test "$cracklib" = "yes"; then
137 cracklib="/usr/lib/cracklib_dict"
139 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
140 [path to cracklib dictionary])
141 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
142 AC_MSG_ERROR([cracklib not found!])
147 AC_MSG_CHECKING([whether to enable DDP])
149 [ --disable-ddp disable DDP], [
150 if test "x$enableval" = "xno"; then
151 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
161 AC_MSG_CHECKING([whether to enable debugging code])
163 [ --enable-debug enable debug code], [
164 if test "x$enableval" != "xno"; then
165 if test "x$enableval" = "xyes"; then
166 AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
168 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
181 [ --enable-afp3 enable AFP 3.x calls],
182 if test "$enableval" = "yes"; then
184 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
185 AC_MSG_RESULT([enabling AFP 3.x calls])
189 if test "$afp3" = "yes"; then
195 dnl ----------- A NOTE ABOUT DROPKLUDGE
196 dnl The trouble with this fix is that if you know what the file is called, it
197 dnl can be read from the Unix side. That's okay for most academic institutions
198 dnl since the students don't have telnet access to the Mac servers. There is
199 dnl currently no one working on further development/fixes of DROPKLUDGE.
202 AC_MSG_CHECKING([whether to enable experimental dropbox support])
203 AC_ARG_ENABLE(dropkludge,
204 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ], [
205 if test "x$enableval" = "xyes"; then
206 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
211 ], [AC_MSG_RESULT([no])]
214 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
215 AC_ARG_ENABLE(force-uidgid,
216 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ], [
217 if test "x$enableval" = "xyes"; then
218 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
223 ], [AC_MSG_RESULT([no])]
228 dnl Determine whether or not to use filename mangling
229 AC_MSG_CHECKING([whether to use filename mangling])
230 AC_ARG_WITH(mangling,
231 [ --with-mangling enable filename mangling],
233 if test "x$withval" = "xyes"; then
234 if test "x$did_scheme" != "xcnid"; then
235 AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
237 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
244 if test "x$did_scheme" = "xcnid"; then
245 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
253 if test "$did_scheme" = "cnid"; then
259 dnl Determine whether or not to use CDB or transactional DB store
260 AC_MSG_CHECKING([whether to use CNID with Concurrent Data Store])
262 [ --with-cdb enable CNID with Concurrent Data Store],
263 if test "$withval" = "no"; then
264 if test "x$did_scheme" != "xcnid"; then
266 AC_MSG_ERROR([DID scheme must be CNID to use CDB])
275 , AC_MSG_RESULT([yes])
278 if test "$USE_CDB" = "yes"; then
279 AC_DEFINE(CNID_DB_CDB, 1, [Define if CNID should be used with Concurrent Data Store])
282 dnl Check for quota support
285 dnl Check for optional server location protocol support (used by MacOS X)
289 NETATALK_GSSAPI_CHECK
291 dnl Check for PAM libs
295 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
298 AC_MSG_CHECKING([whether shadow support should be enabled])
300 [ --with-shadow enable shadow password support],
301 [shadowpw="$withval"],
304 if test "x$shadowpw" = "xyes"; then
305 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
307 AC_MSG_RESULT([$shadowpw])
309 AC_ARG_ENABLE(shell-check,
310 [ --disable-shell-check disable checking for a valid shell],
311 if test "$enableval" = "no"; then
312 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
313 AC_MSG_RESULT([disabling valid shell check])
317 NETATALK_TCP_WRAPPERS
319 AC_ARG_ENABLE(redhat,
320 [ --enable-redhat use redhat-style sysv configuration ],
321 if test "$enableval" = "yes"; then
324 AC_MSG_RESULT([enabling redhat-style sysv support])
328 [ --enable-suse use suse-style sysv configuration ],
329 if test "$enableval" = "yes"; then
332 AC_MSG_RESULT([enabling suse-style sysv support])
335 AC_ARG_ENABLE(cobalt,
336 [ --enable-cobalt use cobalt-style sysv configuration ],
337 if test "$enableval" = "yes"; then
340 AC_MSG_RESULT([enabling cobalt-style sysv support])
343 AC_ARG_ENABLE(netbsd,
344 [ --enable-netbsd use NetBSD-style rc.d configuration ],
345 if test "x$enableval" = "xyes"; then
348 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
351 dnl ----- a2boot compilation (disabled by default)
352 AC_MSG_CHECKING([whether a2boot should be compiled])
354 AC_ARG_ENABLE(a2boot,
355 [ --enable-a2boot enable compilation of Apple2 boot server],
356 [compile_a2boot="$enableval"],
357 [compile_a2boot="no"]
359 AC_MSG_RESULT([$compile_a2boot])
361 AC_ARG_WITH(uams-path,
362 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
363 uams_path="$withval",
364 uams_path="${PKGCONFDIR}/uams"
367 dnl --------------------------------------------------------------------------
368 dnl FHS stuff has to be done last because it overrides other defaults
369 dnl --------------------------------------------------------------------------
372 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
373 if test "$enableval" = "yes"; then
374 uams_path="${libdir}/netatalk"
376 PKGCONFDIR=${sysconfdir}/netatalk
377 SERVERTEXT="${PKGCONFDIR}/msg"
378 NLSDIR="${PKGCONFDIR}/nls"
380 mandir="/usr/share/man"
381 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
383 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
386 dnl --------------------------------------------------------------------------
387 dnl post-FHS substitutions, etc
388 dnl --------------------------------------------------------------------------
391 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
392 [path to UAMs [default=PKGCONF/uams]])
393 UAMS_PATH="${uams_path}"
396 dnl --------------------------------------------------------------------------
397 dnl drop in includes for top level directory structures here...
398 dnl --------------------------------------------------------------------------
400 dnl Note: $(top_srcdir)/include should be added before all other includes
401 dnl so that includes from that directory a preferred to includes from
402 dnl /usr/include or similar places.
403 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
404 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
406 dnl --------------------------------------------------------------------------
407 dnl specific configuration comes in here:
408 dnl --------------------------------------------------------------------------
410 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
412 dnl --------------------- determine operating system from "target"
414 *aix*) this_os=aix ;;
415 *freebsd*) this_os=freebsd ;;
416 *hpux11*) this_os=hpux11 ;;
417 *irix*) this_os=irix ;;
418 *linux*) this_os=linux ;;
419 *osx*) this_os=macosx ;;
420 *darwin*) this_os=macosx ;;
421 *netbsd*) this_os=netbsd ;;
422 *openbsd*) this_os=openbsd ;;
423 *osf*) this_os=tru64 ;;
424 *solaris*) this_os=solaris ;;
428 i386|i486|i586|i686|k7) this_cpu=x86 ;;
429 alpha) this_cpu=alpha ;;
430 mips) this_cpu=mips ;;
431 powerpc|ppc) this_cpu=ppc ;;
434 dnl --------------------- operating system specific flags (port from sys/*)
436 dnl ----- AIX specific -----
437 if test x"$this_os" = "xaix"; then
438 AC_MSG_RESULT([ * AIX specific configuration])
440 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
441 dnl compilation environment. It's enough to get things defined
442 dnl right in endian.h provided that long long is supported, though.
443 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
446 dnl ----- FreeBSD specific -----
447 if test x"$this_os" = "xfreebsd"; then
448 AC_MSG_RESULT([ * FreeBSD specific configuration])
449 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
450 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
452 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
455 dnl ----- HP-UX 11 specific -----
456 if test x"$this_os" = "xhpux11"; then
457 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
459 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
462 dnl ----- Linux specific -----
463 ac_have_atalk_addr=no
464 if test x"$this_os" = "xlinux"; then
465 AC_MSG_RESULT([ * Linux specific configuration])
467 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
468 AC_MSG_CHECKING([for struct atalk_addr])
470 #include <sys/socket.h>
471 #include <asm/types.h>
472 #include <linux/atalk.h>
475 struct atalk_addr foo;
480 ac_have_atalk_addr=yes
486 if test "x$ac_have_atalk_addr" = "xyes"; then
487 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
490 dnl ----- as far as I can tell, dbtob always does the wrong thing
491 dnl ----- on every single version of linux I've ever played with.
492 dnl ----- see etc/afpd/quota.c
493 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
495 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
496 dnl ----- check if version is newer than 2.2.x
498 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
499 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
500 if [ $majorvers -ge 2 ]; then
501 if [ $minorvers -ge 2 ]; then
503 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
504 AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
506 AC_MSG_RESULT([ * found Linux 2.0.x ])
510 dnl ----- Linux/alpha specific -----
511 if test x"$this_cpu" = "xalpha"; then
512 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
513 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
518 dnl ----- Mac OSX specific -----
519 if test x"$this_os" = "xmacosx"; then
520 AC_MSG_RESULT([ * Mac OSX specific configuration])
521 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
522 AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
523 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
524 dnl AC_DEFINE(NO_DLFCN_H)
525 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
528 dnl ----- NetBSD specific -----
529 if test x"$this_os" = "xnetbsd"; then
530 AC_MSG_RESULT([ * NetBSD specific configuration])
531 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
532 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
533 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
534 # If this test is true, it's not an ELF box.
535 # This REALLY should be a configure test.
536 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
538 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
541 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
542 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
543 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
546 dnl ----- OpenBSD specific -----
547 if test x"$this_os" = "xopenbsd"; then
548 AC_MSG_RESULT([ * OpenBSD specific configuration])
549 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
550 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
552 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
553 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
554 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
557 dnl ----- Solaris specific -----
558 if test x"$this_os" = "xsolaris"; then
559 AC_MSG_RESULT([ * Solaris specific configuration])
560 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
561 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
562 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
563 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
566 AC_MSG_RESULT([enabling Solaris kernel module build])
570 dnl ----- Tru64 specific -----
571 if test x"$this_os" = "xtru64"; then
572 AC_MSG_RESULT([ * Tru64 specific configuration])
573 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
574 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
575 dnl AC_DEFINE(USE_MOUNT_H)
576 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
577 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
578 AC_CHECK_LIB(security,set_auth_parameters)
579 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
584 dnl -- look for OpenSSL and other crypt libraries
588 dnl --------------------- check for building Kerberos v4 UAM module
590 AC_ARG_ENABLE(krb4-uam,
591 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
592 if test "$enableval" = "yes"; then
593 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
595 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
598 dnl --------------------- overwrite the config files . . . or not.
600 AC_MSG_CHECKING([whether configuration files should be overwritten])
601 AC_ARG_ENABLE(overwrite,
602 [ --enable-overwrite overwrite configuration files during installation],
603 [OVERWRITE_CONFIG="${enable_overwrite}"],
604 [OVERWRITE_CONFIG="no"]
606 AC_MSG_RESULT([$OVERWRITE_CONFIG])
608 dnl --------------------- last minute substitutions
612 AC_SUBST(OVERWRITE_CONFIG)
614 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
615 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
616 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
617 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
618 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
619 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
620 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
621 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
622 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
623 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
624 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
625 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
626 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
628 dnl --------------------- generate files
632 bin/adv1tov2/Makefile
635 bin/afppasswd/Makefile
638 bin/getzones/Makefile
639 bin/megatron/Makefile
645 contrib/macusers/Makefile
646 contrib/macusers/macusers
649 contrib/printing/Makefile
650 contrib/shell_utils/Makefile
651 contrib/shell_utils/afpd-mtab.pl
652 contrib/shell_utils/apple_cp
653 contrib/shell_utils/apple_mv
654 contrib/shell_utils/apple_rm
655 contrib/shell_utils/cleanappledouble.pl
656 contrib/shell_utils/lp2pap.sh
657 contrib/shell_utils/netatalkshorternamelinks.pl
658 contrib/timelord/Makefile
659 contrib/a2boot/Makefile
661 distrib/config/Makefile
662 distrib/config/netatalk-config
663 distrib/initscripts/Makefile
668 etc/afpd/nls/Makefile
671 etc/uams/uams_krb4/Makefile
676 include/atalk/Makefile
678 libatalk/adouble/Makefile
679 libatalk/asp/Makefile
680 libatalk/atp/Makefile
681 libatalk/cnid/Makefile
682 libatalk/compat/Makefile
683 libatalk/dsi/Makefile
684 libatalk/nbp/Makefile
685 libatalk/netddp/Makefile
686 libatalk/util/Makefile
696 sys/generic/sys/Makefile
697 sys/netatalk/Makefile
699 sys/netbsd/netatalk/Makefile
701 sys/solaris/Makefile.kernel
705 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]