1 dnl $Id: configure.in,v 1.202 2004-01-14 16:10:29 bfernhomberg 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_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 ufs/quota.h mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h crypt.h)
47 AC_CHECK_HEADER(sys/cdefs.h,,
48 AC_MSG_RESULT([enabling generic cdefs.h from tree])
49 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
52 AC_CHECK_HEADERS([sys/param.h])
53 AC_CHECK_HEADERS([sys/mount.h], [], [],
56 #include <sys/param.h>
62 dnl Checks for typedefs, structures, and compiler characteristics.
72 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
75 dnl Checks for library functions.
79 AC_CHECK_FUNCS(strcasestr strchr memcpy)
80 NETATALK_SNPRINTF_CHECK
83 dnl Configuration options.
86 NETATALK_ADMINGRP_CHECK
90 AC_MSG_CHECKING([for logfile path])
92 [ --with-logfile=PATH path for file used by logger [/var/log/netatalk.log]
93 use --without-logfile to disable logger], [
94 if test "x$withval" = "xno"; then
95 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
96 AC_MSG_RESULT([syslog])
97 elif test "$withval" != "yes"; then
98 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
99 AC_MSG_RESULT([$withval])
101 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
102 AC_MSG_RESULT([/var/log/netatalk.log])
104 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
105 AC_MSG_RESULT([/var/log/netatalk.log])
109 AC_ARG_WITH(cracklib,
110 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
111 if test "x$withval" != "xno" ; then
113 AC_CHECK_LIB(crack, main,
114 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
116 AC_MSG_RESULT([enabling cracklib support])
117 if test "$cracklib" = "yes"; then
118 cracklib="/usr/lib/cracklib_dict"
120 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
121 [path to cracklib dictionary])
122 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
123 AC_MSG_ERROR([cracklib not found!])
128 AC_MSG_CHECKING([whether to enable DDP])
130 [ --disable-ddp disable DDP], [
131 if test "x$enableval" = "xno"; then
132 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
142 AC_MSG_CHECKING([whether to enable debugging code])
144 [ --enable-debug enable debug code], [
145 if test "x$enableval" != "xno"; then
146 if test "x$enableval" = "xyes"; then
147 AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
149 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
162 [ --enable-afp3 enable AFP 3.x calls],
163 if test "$enableval" = "yes"; then
165 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
166 AC_MSG_RESULT([enabling AFP 3.x calls])
170 if test "$afp3" = "yes"; then
176 dnl ----------- A NOTE ABOUT DROPKLUDGE
177 dnl The trouble with this fix is that if you know what the file is called, it
178 dnl can be read from the Unix side. That's okay for most academic institutions
179 dnl since the students don't have telnet access to the Mac servers. There is
180 dnl currently no one working on further development/fixes of DROPKLUDGE.
183 AC_MSG_CHECKING([whether to enable experimental dropbox support])
184 AC_ARG_ENABLE(dropkludge,
185 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ], [
186 if test "x$enableval" = "xyes"; then
187 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
192 ], [AC_MSG_RESULT([no])]
195 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
196 AC_ARG_ENABLE(force-uidgid,
197 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ], [
198 if test "x$enableval" = "xyes"; then
199 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
204 ], [AC_MSG_RESULT([no])]
209 dnl Determine whether or not to use filename mangling
210 AC_MSG_CHECKING([whether to use filename mangling])
211 AC_ARG_WITH(mangling,
212 [ --with-mangling enable filename mangling],
214 if test "x$withval" = "xyes"; then
215 if test "x$did_scheme" != "xcnid"; then
216 AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
218 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
225 if test "x$did_scheme" = "xcnid"; then
226 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
234 if test "$did_scheme" = "cnid"; then
240 dnl Determine whether or not to use CDB or transactional DB store
241 AC_MSG_CHECKING([whether to use CNID with Concurrent Data Store])
243 [ --with-cdb enable CNID with Concurrent Data Store],
244 if test "$withval" = "no"; then
245 if test "x$did_scheme" != "xcnid"; then
247 AC_MSG_ERROR([DID scheme must be CNID to use CDB])
256 , AC_MSG_RESULT([yes])
259 if test "$USE_CDB" = "yes"; then
260 AC_DEFINE(CNID_DB_CDB, 1, [Define if CNID should be used with Concurrent Data Store])
263 dnl Check for quota support
266 dnl Check for optional server location protocol support (used by MacOS X)
270 NETATALK_GSSAPI_CHECK
272 dnl Check for PAM libs
276 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
279 AC_MSG_CHECKING([whether shadow support should be enabled])
281 [ --with-shadow enable shadow password support],
282 [shadowpw="$withval"],
285 if test "x$shadowpw" = "xyes"; then
286 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
288 AC_MSG_RESULT([$shadowpw])
290 AC_ARG_ENABLE(shell-check,
291 [ --disable-shell-check disable checking for a valid shell],
292 if test "$enableval" = "no"; then
293 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
294 AC_MSG_RESULT([disabling valid shell check])
298 NETATALK_TCP_WRAPPERS
300 AC_ARG_ENABLE(redhat,
301 [ --enable-redhat use redhat-style sysv configuration ],
302 if test "$enableval" = "yes"; then
305 AC_MSG_RESULT([enabling redhat-style sysv support])
309 [ --enable-suse use suse-style sysv configuration ],
310 if test "$enableval" = "yes"; then
313 AC_MSG_RESULT([enabling suse-style sysv support])
316 AC_ARG_ENABLE(cobalt,
317 [ --enable-cobalt use cobalt-style sysv configuration ],
318 if test "$enableval" = "yes"; then
321 AC_MSG_RESULT([enabling cobalt-style sysv support])
324 AC_ARG_ENABLE(netbsd,
325 [ --enable-netbsd use NetBSD-style rc.d configuration ],
326 if test "x$enableval" = "xyes"; then
329 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
332 dnl ----- a2boot compilation (disabled by default)
333 AC_MSG_CHECKING([whether a2boot should be compiled])
335 AC_ARG_ENABLE(a2boot,
336 [ --enable-a2boot enable compilation of Apple2 boot server],
337 [compile_a2boot="$enableval"],
338 [compile_a2boot="no"]
340 AC_MSG_RESULT([$compile_a2boot])
342 AC_ARG_WITH(uams-path,
343 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
344 uams_path="$withval",
345 uams_path="${PKGCONFDIR}/uams"
348 dnl --------------------------------------------------------------------------
349 dnl FHS stuff has to be done last because it overrides other defaults
350 dnl --------------------------------------------------------------------------
353 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
354 if test "$enableval" = "yes"; then
355 uams_path="${libdir}/netatalk"
357 PKGCONFDIR=${sysconfdir}/netatalk
358 SERVERTEXT="${PKGCONFDIR}/msg"
359 NLSDIR="${PKGCONFDIR}/nls"
361 mandir="/usr/share/man"
362 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
364 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
367 dnl --------------------------------------------------------------------------
368 dnl post-FHS substitutions, etc
369 dnl --------------------------------------------------------------------------
372 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
373 [path to UAMs [default=PKGCONF/uams]])
374 UAMS_PATH="${uams_path}"
377 dnl --------------------------------------------------------------------------
378 dnl drop in includes for top level directory structures here...
379 dnl --------------------------------------------------------------------------
381 dnl Note: $(top_srcdir)/include should be added before all other includes
382 dnl so that includes from that directory a preferred to includes from
383 dnl /usr/include or similar places.
384 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
385 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
387 dnl --------------------------------------------------------------------------
388 dnl specific configuration comes in here:
389 dnl --------------------------------------------------------------------------
391 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
393 dnl --------------------- determine operating system from "target"
395 *aix*) this_os=aix ;;
396 *freebsd*) this_os=freebsd ;;
397 *hpux11*) this_os=hpux11 ;;
398 *irix*) this_os=irix ;;
399 *linux*) this_os=linux ;;
400 *osx*) this_os=macosx ;;
401 *darwin*) this_os=macosx ;;
402 *netbsd*) this_os=netbsd ;;
403 *openbsd*) this_os=openbsd ;;
404 *osf*) this_os=tru64 ;;
405 *solaris*) this_os=solaris ;;
409 i386|i486|i586|i686|k7) this_cpu=x86 ;;
410 alpha) this_cpu=alpha ;;
411 mips) this_cpu=mips ;;
412 powerpc|ppc) this_cpu=ppc ;;
415 dnl --------------------- operating system specific flags (port from sys/*)
417 dnl ----- AIX specific -----
418 if test x"$this_os" = "xaix"; then
419 AC_MSG_RESULT([ * AIX specific configuration])
421 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
422 dnl compilation environment. It's enough to get things defined
423 dnl right in endian.h provided that long long is supported, though.
424 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
427 dnl ----- FreeBSD specific -----
428 if test x"$this_os" = "xfreebsd"; then
429 AC_MSG_RESULT([ * FreeBSD specific configuration])
430 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
431 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
434 dnl ----- HP-UX 11 specific -----
435 if test x"$this_os" = "xhpux11"; then
436 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
438 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
441 dnl ----- Linux specific -----
442 ac_have_atalk_addr=no
443 if test x"$this_os" = "xlinux"; then
444 AC_MSG_RESULT([ * Linux specific configuration])
446 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
447 AC_MSG_CHECKING([for struct atalk_addr])
449 #include <sys/socket.h>
450 #include <asm/types.h>
451 #include <linux/atalk.h>
454 struct atalk_addr foo;
459 ac_have_atalk_addr=yes
465 if test "x$ac_have_atalk_addr" = "xyes"; then
466 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
469 dnl ----- as far as I can tell, dbtob always does the wrong thing
470 dnl ----- on every single version of linux I've ever played with.
471 dnl ----- see etc/afpd/quota.c
472 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
474 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
475 dnl ----- check if version is newer than 2.2.x
477 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
478 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
479 if [ $majorvers -ge 2 ]; then
480 if [ $minorvers -ge 2 ]; then
482 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
483 AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
485 AC_MSG_RESULT([ * found Linux 2.0.x ])
489 dnl ----- Linux/alpha specific -----
490 if test x"$this_cpu" = "xalpha"; then
491 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
492 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
497 dnl ----- Mac OSX specific -----
498 if test x"$this_os" = "xmacosx"; then
499 AC_MSG_RESULT([ * Mac OSX specific configuration])
500 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
501 AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
502 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
503 dnl AC_DEFINE(NO_DLFCN_H)
504 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
507 dnl ----- NetBSD specific -----
508 if test x"$this_os" = "xnetbsd"; then
509 AC_MSG_RESULT([ * NetBSD specific configuration])
510 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
511 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
512 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
513 # If this test is true, it's not an ELF box.
514 # This REALLY should be a configure test.
515 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
517 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
521 dnl ----- OpenBSD specific -----
522 if test x"$this_os" = "xopenbsd"; then
523 AC_MSG_RESULT([ * OpenBSD specific configuration])
524 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
525 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
528 dnl ----- Solaris specific -----
529 if test x"$this_os" = "xsolaris"; then
530 AC_MSG_RESULT([ * Solaris specific configuration])
531 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
532 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
533 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
534 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
537 AC_MSG_RESULT([enabling Solaris kernel module build])
541 dnl ----- Tru64 specific -----
542 if test x"$this_os" = "xtru64"; then
543 AC_MSG_RESULT([ * Tru64 specific configuration])
544 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
545 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
546 dnl AC_DEFINE(USE_MOUNT_H)
547 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
548 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
549 AC_CHECK_LIB(security,set_auth_parameters)
550 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
555 dnl -- look for OpenSSL and other crypt libraries
559 dnl --------------------- check for building Kerberos v4 UAM module
561 AC_ARG_ENABLE(krb4-uam,
562 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
563 if test "$enableval" = "yes"; then
564 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
566 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
569 dnl --------------------- overwrite the config files . . . or not.
571 AC_MSG_CHECKING([whether configuration files should be overwritten])
572 AC_ARG_ENABLE(overwrite,
573 [ --enable-overwrite overwrite configuration files during installation],
574 [OVERWRITE_CONFIG="${enable_overwrite}"],
575 [OVERWRITE_CONFIG="no"]
577 AC_MSG_RESULT([$OVERWRITE_CONFIG])
579 dnl --------------------- last minute substitutions
583 AC_SUBST(OVERWRITE_CONFIG)
585 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
586 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
587 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
588 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
589 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
590 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
591 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
592 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
593 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
594 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
595 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
596 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
597 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
599 dnl --------------------- generate files
603 bin/adv1tov2/Makefile
606 bin/afppasswd/Makefile
609 bin/getzones/Makefile
610 bin/megatron/Makefile
616 contrib/macusers/Makefile
617 contrib/macusers/macusers
620 contrib/printing/Makefile
621 contrib/shell_utils/Makefile
622 contrib/shell_utils/afpd-mtab.pl
623 contrib/shell_utils/apple_cp
624 contrib/shell_utils/apple_mv
625 contrib/shell_utils/apple_rm
626 contrib/shell_utils/cleanappledouble.pl
627 contrib/shell_utils/lp2pap.sh
628 contrib/shell_utils/netatalkshorternamelinks.pl
629 contrib/timelord/Makefile
630 contrib/a2boot/Makefile
632 distrib/config/Makefile
633 distrib/config/netatalk-config
634 distrib/initscripts/Makefile
639 etc/afpd/nls/Makefile
642 etc/uams/uams_krb4/Makefile
647 include/atalk/Makefile
649 libatalk/adouble/Makefile
650 libatalk/asp/Makefile
651 libatalk/atp/Makefile
652 libatalk/cnid/Makefile
653 libatalk/compat/Makefile
654 libatalk/dsi/Makefile
655 libatalk/nbp/Makefile
656 libatalk/netddp/Makefile
657 libatalk/util/Makefile
667 sys/generic/sys/Makefile
668 sys/netatalk/Makefile
670 sys/netbsd/netatalk/Makefile
672 sys/solaris/Makefile.kernel
676 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]