1 dnl $Id: configure.in,v 1.199 2003-12-15 06:26:52 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.
42 AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h unistd.h termios.h sys/termios.h netdb.h sgtty.h sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h)
43 AC_CHECK_HEADER(sys/cdefs.h,,
44 AC_MSG_RESULT([enabling generic cdefs.h from tree])
45 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
49 dnl Checks for typedefs, structures, and compiler characteristics.
62 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
65 dnl Checks for library functions.
69 AC_PROG_GCC_TRADITIONAL
76 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul setpgrp strchr memcpy)
80 dnl Checks for (v)snprintf
83 NETATALK_SNPRINTF_CHECK
85 dnl --------------------------------------------------------------------------
86 dnl specific configuration comes in here:
87 dnl --------------------------------------------------------------------------
89 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
91 AC_MSG_CHECKING([for administrative group support])
92 AC_ARG_WITH(admin-group,
93 [ --disable-admin-group disable admin group], [
94 if test "$enableval" = "no"; then
95 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
108 AC_MSG_CHECKING([for logfile path])
110 [ --with-logfile=PATH path for file used by logger [/var/log/netatalk.log]
111 use --without-logfile to disable logger], [
112 if test "x$withval" == "xno"; then
113 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
114 AC_MSG_RESULT([syslog])
115 elif test "$withval" != "yes"; then
116 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
117 AC_MSG_RESULT([$withval])
119 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
120 AC_MSG_RESULT([/var/log/netatalk.log])
122 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
123 AC_MSG_RESULT([/var/log/netatalk.log])
127 AC_ARG_WITH(cracklib,
128 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
129 if test "x$withval" != "xno" ; then
131 AC_CHECK_LIB(crack, main,
132 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
134 AC_MSG_RESULT([enabling cracklib support])
135 if test "$cracklib" = "yes"; then
136 cracklib="/usr/lib/cracklib_dict"
138 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
139 [path to cracklib dictionary])
140 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
141 AC_MSG_ERROR([cracklib not found!])
146 AC_MSG_CHECKING([whether to enable DDP])
148 [ --disable-ddp disable DDP], [
149 if test "x$enableval" = "xno"; then
150 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
160 AC_MSG_CHECKING([whether to enable debugging code])
162 [ --enable-debug enable debug code], [
163 if test "x$enableval" != "xno"; then
164 if test "x$enableval" = "xyes"; then
165 AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
167 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
180 [ --enable-afp3 enable AFP 3.x calls],
181 if test "$enableval" = "yes"; then
183 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
184 AC_MSG_RESULT([enabling AFP 3.x calls])
188 if test "$afp3" = "yes"; then
194 dnl ----------- A NOTE ABOUT DROPKLUDGE
195 dnl The trouble with this fix is that if you know what the file is called, it
196 dnl can be read from the Unix side. That's okay for most academic institutions
197 dnl since the students don't have telnet access to the Mac servers. There is
198 dnl currently no one working on further development/fixes of DROPKLUDGE.
201 AC_MSG_CHECKING([whether to enable experimental dropbox support])
202 AC_ARG_ENABLE(dropkludge,
203 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ], [
204 if test "x$enableval" = "xyes"; then
205 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
210 ], [AC_MSG_RESULT([no])]
213 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
214 AC_ARG_ENABLE(force-uidgid,
215 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ], [
216 if test "x$enableval" = "xyes"; then
217 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
222 ], [AC_MSG_RESULT([no])]
227 dnl Determine whether or not to use filename mangling
228 AC_MSG_CHECKING([whether to use filename mangling])
229 AC_ARG_WITH(mangling,
230 [ --with-mangling enable filename mangling],
232 if test "x$withval" = "xyes"; then
233 if test "x$did_scheme" != "xcnid"; then
234 AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
236 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
243 if test "x$did_scheme" = "xcnid"; then
244 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
252 if test "$did_scheme" = "cnid"; then
258 dnl Determine whether or not to use CDB or transactional DB store
259 AC_MSG_CHECKING([whether to use CNID with Concurrent Data Store])
261 [ --with-cdb enable CNID with Concurrent Data Store],
262 if test "$withval" = "no"; then
263 if test "x$did_scheme" != "xcnid"; then
265 AC_MSG_ERROR([DID scheme must be CNID to use CDB])
274 , AC_MSG_RESULT([yes])
277 if test "$USE_CDB" = "yes"; then
278 AC_DEFINE(CNID_DB_CDB, 1, [Define if CNID should be used with Concurrent Data Store])
281 dnl Check for quota support
284 dnl Check for optional server location protocol support (used by MacOS X)
288 NETATALK_GSSAPI_CHECK
290 dnl Check for PAM libs
294 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
297 AC_MSG_CHECKING([whether shadow support should be enabled])
299 [ --with-shadow enable shadow password support],
300 [shadowpw="$withval"],
303 if test "x$shadowpw" = "xyes"; then
304 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
306 AC_MSG_RESULT([$shadowpw])
308 AC_ARG_ENABLE(shell-check,
309 [ --disable-shell-check disable checking for a valid shell],
310 if test "$enableval" = "no"; then
311 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
312 AC_MSG_RESULT([disabling valid shell check])
316 NETATALK_TCP_WRAPPERS
318 AC_ARG_ENABLE(redhat,
319 [ --enable-redhat use redhat-style sysv configuration ],
320 if test "$enableval" = "yes"; then
323 AC_MSG_RESULT([enabling redhat-style sysv support])
327 [ --enable-suse use suse-style sysv configuration ],
328 if test "$enableval" = "yes"; then
331 AC_MSG_RESULT([enabling suse-style sysv support])
334 AC_ARG_ENABLE(cobalt,
335 [ --enable-cobalt use cobalt-style sysv configuration ],
336 if test "$enableval" = "yes"; then
339 AC_MSG_RESULT([enabling cobalt-style sysv support])
342 AC_ARG_ENABLE(netbsd,
343 [ --enable-netbsd use NetBSD-style rc.d configuration ],
344 if test "x$enableval" = "xyes"; then
347 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
350 dnl ----- a2boot compilation (disabled by default)
351 AC_MSG_CHECKING([whether a2boot should be compiled])
353 AC_ARG_ENABLE(a2boot,
354 [ --enable-a2boot enable compilation of Apple2 boot server],
355 [compile_a2boot="$enableval"],
356 [compile_a2boot="no"]
358 AC_MSG_RESULT([$compile_a2boot])
360 AC_ARG_WITH(uams-path,
361 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
362 uams_path="$withval",
363 uams_path="${PKGCONFDIR}/uams"
366 dnl --------------------------------------------------------------------------
367 dnl FHS stuff has to be done last because it overrides other defaults
368 dnl --------------------------------------------------------------------------
371 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
372 if test "$enableval" = "yes"; then
373 uams_path="${libdir}/netatalk"
375 PKGCONFDIR=${sysconfdir}/netatalk
376 SERVERTEXT="${PKGCONFDIR}/msg"
377 NLSDIR="${PKGCONFDIR}/nls"
379 mandir="/usr/share/man"
380 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
382 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
385 dnl --------------------------------------------------------------------------
386 dnl post-FHS substitutions, etc
387 dnl --------------------------------------------------------------------------
390 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
391 [path to UAMs [default=PKGCONF/uams]])
392 UAMS_PATH="${uams_path}"
395 dnl --------------------------------------------------------------------------
396 dnl drop in includes for top level directory structures here...
397 dnl --------------------------------------------------------------------------
399 dnl Note: $(top_srcdir)/include should be added before all other includes
400 dnl so that includes from that directory a preferred to includes from
401 dnl /usr/include or similar places.
402 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
403 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
405 dnl --------------------------------------------------------------------------
406 dnl specific configuration comes in here:
407 dnl --------------------------------------------------------------------------
409 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
411 dnl --------------------- determine operating system from "target"
413 *aix*) this_os=aix ;;
414 *freebsd*) this_os=freebsd ;;
415 *hpux11*) this_os=hpux11 ;;
416 *irix*) this_os=irix ;;
417 *linux*) this_os=linux ;;
418 *osx*) this_os=macosx ;;
419 *darwin*) this_os=macosx ;;
420 *netbsd*) this_os=netbsd ;;
421 *openbsd*) this_os=openbsd ;;
422 *osf*) this_os=tru64 ;;
423 *solaris*) this_os=solaris ;;
427 i386|i486|i586|i686|k7) this_cpu=x86 ;;
428 alpha) this_cpu=alpha ;;
429 mips) this_cpu=mips ;;
430 powerpc|ppc) this_cpu=ppc ;;
433 dnl --------------------- operating system specific flags (port from sys/*)
435 dnl ----- AIX specific -----
436 if test x"$this_os" = "xaix"; then
437 AC_MSG_RESULT([ * AIX specific configuration])
439 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
440 dnl compilation environment. It's enough to get things defined
441 dnl right in endian.h provided that long long is supported, though.
442 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
445 dnl ----- FreeBSD specific -----
446 if test x"$this_os" = "xfreebsd"; then
447 AC_MSG_RESULT([ * FreeBSD specific configuration])
448 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
449 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
451 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
454 dnl ----- HP-UX 11 specific -----
455 if test x"$this_os" = "xhpux11"; then
456 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
458 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
461 dnl ----- Linux specific -----
462 ac_have_atalk_addr=no
463 if test x"$this_os" = "xlinux"; then
464 AC_MSG_RESULT([ * Linux specific configuration])
466 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
467 AC_MSG_CHECKING([for struct atalk_addr])
469 #include <sys/socket.h>
470 #include <asm/types.h>
471 #include <linux/atalk.h>
474 struct atalk_addr foo;
479 ac_have_atalk_addr=yes
485 if test "x$ac_have_atalk_addr" = "xyes"; then
486 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
489 dnl ----- as far as I can tell, dbtob always does the wrong thing
490 dnl ----- on every single version of linux I've ever played with.
491 dnl ----- see etc/afpd/quota.c
492 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
494 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
495 dnl ----- check if version is newer than 2.2.x
497 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
498 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
499 if [ $majorvers -ge 2 ]; then
500 if [ $minorvers -ge 2 ]; then
502 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
503 AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
505 AC_MSG_RESULT([ * found Linux 2.0.x ])
509 dnl ----- Linux/alpha specific -----
510 if test x"$this_cpu" = "xalpha"; then
511 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
512 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
517 dnl ----- Mac OSX specific -----
518 if test x"$this_os" = "xmacosx"; then
519 AC_MSG_RESULT([ * Mac OSX specific configuration])
520 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
521 AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
522 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
523 dnl AC_DEFINE(NO_DLFCN_H)
524 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
527 dnl ----- NetBSD specific -----
528 if test x"$this_os" = "xnetbsd"; then
529 AC_MSG_RESULT([ * NetBSD specific configuration])
530 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
531 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
532 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
533 # If this test is true, it's not an ELF box.
534 # This REALLY should be a configure test.
535 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
537 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
540 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
541 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
542 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
545 dnl ----- OpenBSD specific -----
546 if test x"$this_os" = "xopenbsd"; then
547 AC_MSG_RESULT([ * OpenBSD specific configuration])
548 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
549 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
551 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
552 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
553 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
556 dnl ----- Solaris specific -----
557 if test x"$this_os" = "xsolaris"; then
558 AC_MSG_RESULT([ * Solaris specific configuration])
559 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
560 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
561 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
562 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
565 AC_MSG_RESULT([enabling Solaris kernel module build])
569 dnl ----- Tru64 specific -----
570 if test x"$this_os" = "xtru64"; then
571 AC_MSG_RESULT([ * Tru64 specific configuration])
572 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
573 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
574 dnl AC_DEFINE(USE_MOUNT_H)
575 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
576 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
577 AC_CHECK_LIB(security,set_auth_parameters)
578 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
583 dnl -- look for OpenSSL and other crypt libraries
587 dnl --------------------- check for building Kerberos v4 UAM module
589 AC_ARG_ENABLE(krb4-uam,
590 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
591 if test "$enableval" = "yes"; then
592 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
594 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
597 dnl --------------------- overwrite the config files . . . or not.
599 AC_MSG_CHECKING([whether configuration files should be overwritten])
600 AC_ARG_ENABLE(overwrite,
601 [ --enable-overwrite overwrite configuration files during installation],
602 [OVERWRITE_CONFIG="${enable_overwrite}"],
603 [OVERWRITE_CONFIG="no"]
605 AC_MSG_RESULT([$OVERWRITE_CONFIG])
607 dnl --------------------- last minute substitutions
611 AC_SUBST(OVERWRITE_CONFIG)
613 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
614 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
615 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
616 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
617 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
618 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
619 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
620 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
621 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
622 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
623 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
624 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
625 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
627 dnl --------------------- generate files
631 bin/adv1tov2/Makefile
634 bin/afppasswd/Makefile
637 bin/getzones/Makefile
638 bin/megatron/Makefile
644 contrib/macusers/Makefile
645 contrib/macusers/macusers
648 contrib/printing/Makefile
649 contrib/shell_utils/Makefile
650 contrib/shell_utils/afpd-mtab.pl
651 contrib/shell_utils/apple_cp
652 contrib/shell_utils/apple_mv
653 contrib/shell_utils/apple_rm
654 contrib/shell_utils/cleanappledouble.pl
655 contrib/shell_utils/lp2pap.sh
656 contrib/shell_utils/netatalkshorternamelinks.pl
657 contrib/timelord/Makefile
658 contrib/a2boot/Makefile
660 distrib/config/Makefile
661 distrib/config/netatalk-config
662 distrib/initscripts/Makefile
667 etc/afpd/nls/Makefile
670 etc/uams/uams_krb4/Makefile
675 include/atalk/Makefile
677 libatalk/adouble/Makefile
678 libatalk/asp/Makefile
679 libatalk/atp/Makefile
680 libatalk/cnid/Makefile
681 libatalk/compat/Makefile
682 libatalk/dsi/Makefile
683 libatalk/nbp/Makefile
684 libatalk/netddp/Makefile
685 libatalk/util/Makefile
695 sys/generic/sys/Makefile
696 sys/netatalk/Makefile
698 sys/netbsd/netatalk/Makefile
700 sys/solaris/Makefile.kernel
704 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]