1 dnl $Id: configure.in,v 1.201 2003-12-15 06:56:33 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.
19 AC_PROG_GCC_TRADITIONAL
32 dnl Checks for presence of some functions.
35 AC_CHECK_FUNCS(pread pwrite)
38 dnl Checks for header files.
44 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)
45 AC_CHECK_HEADER(sys/cdefs.h,,
46 AC_MSG_RESULT([enabling generic cdefs.h from tree])
47 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
51 dnl Checks for typedefs, structures, and compiler characteristics.
61 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
64 dnl Checks for library functions.
68 AC_CHECK_FUNCS(strcasestr strchr memcpy)
69 NETATALK_SNPRINTF_CHECK
72 dnl Configuration options.
75 NETATALK_ADMINGRP_CHECK
79 AC_MSG_CHECKING([for logfile path])
81 [ --with-logfile=PATH path for file used by logger [/var/log/netatalk.log]
82 use --without-logfile to disable logger], [
83 if test "x$withval" == "xno"; then
84 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
85 AC_MSG_RESULT([syslog])
86 elif test "$withval" != "yes"; then
87 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
88 AC_MSG_RESULT([$withval])
90 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
91 AC_MSG_RESULT([/var/log/netatalk.log])
93 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
94 AC_MSG_RESULT([/var/log/netatalk.log])
99 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
100 if test "x$withval" != "xno" ; then
102 AC_CHECK_LIB(crack, main,
103 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
105 AC_MSG_RESULT([enabling cracklib support])
106 if test "$cracklib" = "yes"; then
107 cracklib="/usr/lib/cracklib_dict"
109 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
110 [path to cracklib dictionary])
111 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
112 AC_MSG_ERROR([cracklib not found!])
117 AC_MSG_CHECKING([whether to enable DDP])
119 [ --disable-ddp disable DDP], [
120 if test "x$enableval" = "xno"; then
121 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
131 AC_MSG_CHECKING([whether to enable debugging code])
133 [ --enable-debug enable debug code], [
134 if test "x$enableval" != "xno"; then
135 if test "x$enableval" = "xyes"; then
136 AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
138 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
151 [ --enable-afp3 enable AFP 3.x calls],
152 if test "$enableval" = "yes"; then
154 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
155 AC_MSG_RESULT([enabling AFP 3.x calls])
159 if test "$afp3" = "yes"; then
165 dnl ----------- A NOTE ABOUT DROPKLUDGE
166 dnl The trouble with this fix is that if you know what the file is called, it
167 dnl can be read from the Unix side. That's okay for most academic institutions
168 dnl since the students don't have telnet access to the Mac servers. There is
169 dnl currently no one working on further development/fixes of DROPKLUDGE.
172 AC_MSG_CHECKING([whether to enable experimental dropbox support])
173 AC_ARG_ENABLE(dropkludge,
174 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ], [
175 if test "x$enableval" = "xyes"; then
176 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
181 ], [AC_MSG_RESULT([no])]
184 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
185 AC_ARG_ENABLE(force-uidgid,
186 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ], [
187 if test "x$enableval" = "xyes"; then
188 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
193 ], [AC_MSG_RESULT([no])]
198 dnl Determine whether or not to use filename mangling
199 AC_MSG_CHECKING([whether to use filename mangling])
200 AC_ARG_WITH(mangling,
201 [ --with-mangling enable filename mangling],
203 if test "x$withval" = "xyes"; then
204 if test "x$did_scheme" != "xcnid"; then
205 AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
207 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
214 if test "x$did_scheme" = "xcnid"; then
215 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
223 if test "$did_scheme" = "cnid"; then
229 dnl Determine whether or not to use CDB or transactional DB store
230 AC_MSG_CHECKING([whether to use CNID with Concurrent Data Store])
232 [ --with-cdb enable CNID with Concurrent Data Store],
233 if test "$withval" = "no"; then
234 if test "x$did_scheme" != "xcnid"; then
236 AC_MSG_ERROR([DID scheme must be CNID to use CDB])
245 , AC_MSG_RESULT([yes])
248 if test "$USE_CDB" = "yes"; then
249 AC_DEFINE(CNID_DB_CDB, 1, [Define if CNID should be used with Concurrent Data Store])
252 dnl Check for quota support
255 dnl Check for optional server location protocol support (used by MacOS X)
259 NETATALK_GSSAPI_CHECK
261 dnl Check for PAM libs
265 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
268 AC_MSG_CHECKING([whether shadow support should be enabled])
270 [ --with-shadow enable shadow password support],
271 [shadowpw="$withval"],
274 if test "x$shadowpw" = "xyes"; then
275 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
277 AC_MSG_RESULT([$shadowpw])
279 AC_ARG_ENABLE(shell-check,
280 [ --disable-shell-check disable checking for a valid shell],
281 if test "$enableval" = "no"; then
282 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
283 AC_MSG_RESULT([disabling valid shell check])
287 NETATALK_TCP_WRAPPERS
289 AC_ARG_ENABLE(redhat,
290 [ --enable-redhat use redhat-style sysv configuration ],
291 if test "$enableval" = "yes"; then
294 AC_MSG_RESULT([enabling redhat-style sysv support])
298 [ --enable-suse use suse-style sysv configuration ],
299 if test "$enableval" = "yes"; then
302 AC_MSG_RESULT([enabling suse-style sysv support])
305 AC_ARG_ENABLE(cobalt,
306 [ --enable-cobalt use cobalt-style sysv configuration ],
307 if test "$enableval" = "yes"; then
310 AC_MSG_RESULT([enabling cobalt-style sysv support])
313 AC_ARG_ENABLE(netbsd,
314 [ --enable-netbsd use NetBSD-style rc.d configuration ],
315 if test "x$enableval" = "xyes"; then
318 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
321 dnl ----- a2boot compilation (disabled by default)
322 AC_MSG_CHECKING([whether a2boot should be compiled])
324 AC_ARG_ENABLE(a2boot,
325 [ --enable-a2boot enable compilation of Apple2 boot server],
326 [compile_a2boot="$enableval"],
327 [compile_a2boot="no"]
329 AC_MSG_RESULT([$compile_a2boot])
331 AC_ARG_WITH(uams-path,
332 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
333 uams_path="$withval",
334 uams_path="${PKGCONFDIR}/uams"
337 dnl --------------------------------------------------------------------------
338 dnl FHS stuff has to be done last because it overrides other defaults
339 dnl --------------------------------------------------------------------------
342 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
343 if test "$enableval" = "yes"; then
344 uams_path="${libdir}/netatalk"
346 PKGCONFDIR=${sysconfdir}/netatalk
347 SERVERTEXT="${PKGCONFDIR}/msg"
348 NLSDIR="${PKGCONFDIR}/nls"
350 mandir="/usr/share/man"
351 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
353 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
356 dnl --------------------------------------------------------------------------
357 dnl post-FHS substitutions, etc
358 dnl --------------------------------------------------------------------------
361 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
362 [path to UAMs [default=PKGCONF/uams]])
363 UAMS_PATH="${uams_path}"
366 dnl --------------------------------------------------------------------------
367 dnl drop in includes for top level directory structures here...
368 dnl --------------------------------------------------------------------------
370 dnl Note: $(top_srcdir)/include should be added before all other includes
371 dnl so that includes from that directory a preferred to includes from
372 dnl /usr/include or similar places.
373 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
374 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
376 dnl --------------------------------------------------------------------------
377 dnl specific configuration comes in here:
378 dnl --------------------------------------------------------------------------
380 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
382 dnl --------------------- determine operating system from "target"
384 *aix*) this_os=aix ;;
385 *freebsd*) this_os=freebsd ;;
386 *hpux11*) this_os=hpux11 ;;
387 *irix*) this_os=irix ;;
388 *linux*) this_os=linux ;;
389 *osx*) this_os=macosx ;;
390 *darwin*) this_os=macosx ;;
391 *netbsd*) this_os=netbsd ;;
392 *openbsd*) this_os=openbsd ;;
393 *osf*) this_os=tru64 ;;
394 *solaris*) this_os=solaris ;;
398 i386|i486|i586|i686|k7) this_cpu=x86 ;;
399 alpha) this_cpu=alpha ;;
400 mips) this_cpu=mips ;;
401 powerpc|ppc) this_cpu=ppc ;;
404 dnl --------------------- operating system specific flags (port from sys/*)
406 dnl ----- AIX specific -----
407 if test x"$this_os" = "xaix"; then
408 AC_MSG_RESULT([ * AIX specific configuration])
410 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
411 dnl compilation environment. It's enough to get things defined
412 dnl right in endian.h provided that long long is supported, though.
413 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
416 dnl ----- FreeBSD specific -----
417 if test x"$this_os" = "xfreebsd"; then
418 AC_MSG_RESULT([ * FreeBSD specific configuration])
419 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
420 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
422 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
425 dnl ----- HP-UX 11 specific -----
426 if test x"$this_os" = "xhpux11"; then
427 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
429 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
432 dnl ----- Linux specific -----
433 ac_have_atalk_addr=no
434 if test x"$this_os" = "xlinux"; then
435 AC_MSG_RESULT([ * Linux specific configuration])
437 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
438 AC_MSG_CHECKING([for struct atalk_addr])
440 #include <sys/socket.h>
441 #include <asm/types.h>
442 #include <linux/atalk.h>
445 struct atalk_addr foo;
450 ac_have_atalk_addr=yes
456 if test "x$ac_have_atalk_addr" = "xyes"; then
457 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
460 dnl ----- as far as I can tell, dbtob always does the wrong thing
461 dnl ----- on every single version of linux I've ever played with.
462 dnl ----- see etc/afpd/quota.c
463 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
465 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
466 dnl ----- check if version is newer than 2.2.x
468 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
469 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
470 if [ $majorvers -ge 2 ]; then
471 if [ $minorvers -ge 2 ]; then
473 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
474 AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
476 AC_MSG_RESULT([ * found Linux 2.0.x ])
480 dnl ----- Linux/alpha specific -----
481 if test x"$this_cpu" = "xalpha"; then
482 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
483 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
488 dnl ----- Mac OSX specific -----
489 if test x"$this_os" = "xmacosx"; then
490 AC_MSG_RESULT([ * Mac OSX specific configuration])
491 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
492 AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
493 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
494 dnl AC_DEFINE(NO_DLFCN_H)
495 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
498 dnl ----- NetBSD specific -----
499 if test x"$this_os" = "xnetbsd"; then
500 AC_MSG_RESULT([ * NetBSD specific configuration])
501 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
502 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
503 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
504 # If this test is true, it's not an ELF box.
505 # This REALLY should be a configure test.
506 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
508 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
511 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
512 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
513 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
516 dnl ----- OpenBSD specific -----
517 if test x"$this_os" = "xopenbsd"; then
518 AC_MSG_RESULT([ * OpenBSD specific configuration])
519 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
520 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
522 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
523 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
524 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
527 dnl ----- Solaris specific -----
528 if test x"$this_os" = "xsolaris"; then
529 AC_MSG_RESULT([ * Solaris specific configuration])
530 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
531 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
532 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
533 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
536 AC_MSG_RESULT([enabling Solaris kernel module build])
540 dnl ----- Tru64 specific -----
541 if test x"$this_os" = "xtru64"; then
542 AC_MSG_RESULT([ * Tru64 specific configuration])
543 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
544 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
545 dnl AC_DEFINE(USE_MOUNT_H)
546 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
547 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
548 AC_CHECK_LIB(security,set_auth_parameters)
549 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
554 dnl -- look for OpenSSL and other crypt libraries
558 dnl --------------------- check for building Kerberos v4 UAM module
560 AC_ARG_ENABLE(krb4-uam,
561 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
562 if test "$enableval" = "yes"; then
563 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
565 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
568 dnl --------------------- overwrite the config files . . . or not.
570 AC_MSG_CHECKING([whether configuration files should be overwritten])
571 AC_ARG_ENABLE(overwrite,
572 [ --enable-overwrite overwrite configuration files during installation],
573 [OVERWRITE_CONFIG="${enable_overwrite}"],
574 [OVERWRITE_CONFIG="no"]
576 AC_MSG_RESULT([$OVERWRITE_CONFIG])
578 dnl --------------------- last minute substitutions
582 AC_SUBST(OVERWRITE_CONFIG)
584 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
585 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
586 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
587 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
588 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
589 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
590 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
591 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
592 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
593 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
594 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
595 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
596 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
598 dnl --------------------- generate files
602 bin/adv1tov2/Makefile
605 bin/afppasswd/Makefile
608 bin/getzones/Makefile
609 bin/megatron/Makefile
615 contrib/macusers/Makefile
616 contrib/macusers/macusers
619 contrib/printing/Makefile
620 contrib/shell_utils/Makefile
621 contrib/shell_utils/afpd-mtab.pl
622 contrib/shell_utils/apple_cp
623 contrib/shell_utils/apple_mv
624 contrib/shell_utils/apple_rm
625 contrib/shell_utils/cleanappledouble.pl
626 contrib/shell_utils/lp2pap.sh
627 contrib/shell_utils/netatalkshorternamelinks.pl
628 contrib/timelord/Makefile
629 contrib/a2boot/Makefile
631 distrib/config/Makefile
632 distrib/config/netatalk-config
633 distrib/initscripts/Makefile
638 etc/afpd/nls/Makefile
641 etc/uams/uams_krb4/Makefile
646 include/atalk/Makefile
648 libatalk/adouble/Makefile
649 libatalk/asp/Makefile
650 libatalk/atp/Makefile
651 libatalk/cnid/Makefile
652 libatalk/compat/Makefile
653 libatalk/dsi/Makefile
654 libatalk/nbp/Makefile
655 libatalk/netddp/Makefile
656 libatalk/util/Makefile
666 sys/generic/sys/Makefile
667 sys/netatalk/Makefile
669 sys/netbsd/netatalk/Makefile
671 sys/solaris/Makefile.kernel
675 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]