1 dnl $Id: configure.in,v 1.197 2003-12-15 06:03: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.
31 dnl Checks for presence of some functions.
34 dnl Check for XPG4 access() function
35 dnl Be sure to test before adding AFS libs in LIBS path as AFS lib
36 dnl has such a function that works only on AFS filesystems.
37 AC_CHECK_FUNCS(access)
38 AC_CHECK_FUNCS(pread pwrite)
41 dnl Checks for header files.
47 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)
48 AC_CHECK_HEADER(sys/cdefs.h,,
49 AC_MSG_RESULT([enabling generic cdefs.h from tree])
50 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
54 dnl Checks for typedefs, structures, and compiler characteristics.
67 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
70 dnl Checks for library functions.
74 AC_PROG_GCC_TRADITIONAL
81 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul setpgrp strchr memcpy)
85 dnl Checks for (v)snprintf
88 NETATALK_SNPRINTF_CHECK
90 dnl --------------------------------------------------------------------------
91 dnl specific configuration comes in here:
92 dnl --------------------------------------------------------------------------
94 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
96 AC_MSG_CHECKING([for administrative group support])
97 AC_ARG_WITH(admin-group,
98 [ --disable-admin-group disable admin group], [
99 if test "$enableval" = "no"; then
100 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
113 AC_MSG_CHECKING([for logfile path])
115 [ --with-logfile=PATH path for file used by logger [/var/log/netatalk.log]
116 use --without-logfile to disable logger], [
117 if test "x$withval" == "xno"; then
118 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
119 AC_MSG_RESULT([syslog])
120 elif test "$withval" != "yes"; then
121 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
122 AC_MSG_RESULT([$withval])
124 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
125 AC_MSG_RESULT([/var/log/netatalk.log])
127 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
128 AC_MSG_RESULT([/var/log/netatalk.log])
132 AC_ARG_WITH(cracklib,
133 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
134 if test "x$withval" != "xno" ; then
136 AC_CHECK_LIB(crack, main,
137 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
139 AC_MSG_RESULT([enabling cracklib support])
140 if test "$cracklib" = "yes"; then
141 cracklib="/usr/lib/cracklib_dict"
143 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
144 [path to cracklib dictionary])
145 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
146 AC_MSG_ERROR([cracklib not found!])
151 AC_MSG_CHECKING([whether to enable DDP])
153 [ --disable-ddp disable DDP], [
154 if test "x$enableval" = "xno"; then
155 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
165 AC_MSG_CHECKING([whether to enable debugging code])
167 [ --enable-debug enable debug code], [
168 if test "x$enableval" != "xno"; then
169 if test "x$enableval" = "xyes"; then
170 AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
172 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
185 [ --enable-afp3 enable AFP 3.x calls],
186 if test "$enableval" = "yes"; then
188 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
189 AC_MSG_RESULT([enabling AFP 3.x calls])
193 if test "$afp3" = "yes"; then
199 dnl ----------- A NOTE ABOUT DROPKLUDGE
200 dnl The trouble with this fix is that if you know what the file is called, it
201 dnl can be read from the Unix side. That's okay for most academic institutions
202 dnl since the students don't have telnet access to the Mac servers. There is
203 dnl currently no one working on further development/fixes of DROPKLUDGE.
206 AC_MSG_CHECKING([whether to enable experimental dropbox support])
207 AC_ARG_ENABLE(dropkludge,
208 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ], [
209 if test "x$enableval" = "xyes"; then
210 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
215 ], [AC_MSG_RESULT([no])]
218 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
219 AC_ARG_ENABLE(force-uidgid,
220 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ], [
221 if test "x$enableval" = "xyes"; then
222 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
227 ], [AC_MSG_RESULT([no])]
232 dnl Determine whether or not to use filename mangling
233 AC_MSG_CHECKING([whether to use filename mangling])
234 AC_ARG_WITH(mangling,
235 [ --with-mangling enable filename mangling],
237 if test "x$withval" = "xyes"; then
238 if test "x$did_scheme" != "xcnid"; then
239 AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
241 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
248 if test "x$did_scheme" = "xcnid"; then
249 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
257 if test "$did_scheme" = "cnid"; then
263 dnl Determine whether or not to use CDB or transactional DB store
264 AC_MSG_CHECKING([whether to use CNID with Concurrent Data Store])
266 [ --with-cdb enable CNID with Concurrent Data Store],
267 if test "$withval" = "no"; then
268 if test "x$did_scheme" != "xcnid"; then
270 AC_MSG_ERROR([DID scheme must be CNID to use CDB])
279 , AC_MSG_RESULT([yes])
282 if test "$USE_CDB" = "yes"; then
283 AC_DEFINE(CNID_DB_CDB, 1, [Define if CNID should be used with Concurrent Data Store])
286 dnl Check for quota support
289 dnl Check for optional server location protocol support (used by MacOS X)
293 NETATALK_GSSAPI_CHECK
295 dnl Check for PAM libs
299 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
302 AC_MSG_CHECKING([whether shadow support should be enabled])
304 [ --with-shadow enable shadow password support],
305 [shadowpw="$withval"],
308 if test "x$shadowpw" = "xyes"; then
309 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
311 AC_MSG_RESULT([$shadowpw])
313 AC_ARG_ENABLE(shell-check,
314 [ --disable-shell-check disable checking for a valid shell],
315 if test "$enableval" = "no"; then
316 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
317 AC_MSG_RESULT([disabling valid shell check])
321 NETATALK_TCP_WRAPPERS
323 AC_ARG_ENABLE(redhat,
324 [ --enable-redhat use redhat-style sysv configuration ],
325 if test "$enableval" = "yes"; then
328 AC_MSG_RESULT([enabling redhat-style sysv support])
332 [ --enable-suse use suse-style sysv configuration ],
333 if test "$enableval" = "yes"; then
336 AC_MSG_RESULT([enabling suse-style sysv support])
339 AC_ARG_ENABLE(cobalt,
340 [ --enable-cobalt use cobalt-style sysv configuration ],
341 if test "$enableval" = "yes"; then
344 AC_MSG_RESULT([enabling cobalt-style sysv support])
347 AC_ARG_ENABLE(netbsd,
348 [ --enable-netbsd use NetBSD-style rc.d configuration ],
349 if test "x$enableval" = "xyes"; then
352 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
355 dnl ----- a2boot compilation (disabled by default)
356 AC_MSG_CHECKING([whether a2boot should be compiled])
358 AC_ARG_ENABLE(a2boot,
359 [ --enable-a2boot enable compilation of Apple2 boot server],
360 [compile_a2boot="$enableval"],
361 [compile_a2boot="no"]
363 AC_MSG_RESULT([$compile_a2boot])
365 AC_ARG_WITH(uams-path,
366 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
367 uams_path="$withval",
368 uams_path="${PKGCONFDIR}/uams"
371 dnl --------------------------------------------------------------------------
372 dnl FHS stuff has to be done last because it overrides other defaults
373 dnl --------------------------------------------------------------------------
376 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
377 if test "$enableval" = "yes"; then
378 uams_path="${libdir}/netatalk"
380 PKGCONFDIR=${sysconfdir}/netatalk
381 SERVERTEXT="${PKGCONFDIR}/msg"
382 NLSDIR="${PKGCONFDIR}/nls"
384 mandir="/usr/share/man"
385 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
387 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
390 dnl --------------------------------------------------------------------------
391 dnl post-FHS substitutions, etc
392 dnl --------------------------------------------------------------------------
395 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
396 [path to UAMs [default=PKGCONF/uams]])
397 UAMS_PATH="${uams_path}"
400 dnl --------------------------------------------------------------------------
401 dnl drop in includes for top level directory structures here...
402 dnl --------------------------------------------------------------------------
404 dnl Note: $(top_srcdir)/include should be added before all other includes
405 dnl so that includes from that directory a preferred to includes from
406 dnl /usr/include or similar places.
407 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
408 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
410 dnl --------------------------------------------------------------------------
411 dnl specific configuration comes in here:
412 dnl --------------------------------------------------------------------------
414 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
416 dnl --------------------- determine operating system from "target"
418 *aix*) this_os=aix ;;
419 *freebsd*) this_os=freebsd ;;
420 *hpux11*) this_os=hpux11 ;;
421 *irix*) this_os=irix ;;
422 *linux*) this_os=linux ;;
423 *osx*) this_os=macosx ;;
424 *darwin*) this_os=macosx ;;
425 *netbsd*) this_os=netbsd ;;
426 *openbsd*) this_os=openbsd ;;
427 *osf*) this_os=tru64 ;;
428 *solaris*) this_os=solaris ;;
432 i386|i486|i586|i686|k7) this_cpu=x86 ;;
433 alpha) this_cpu=alpha ;;
434 mips) this_cpu=mips ;;
435 powerpc|ppc) this_cpu=ppc ;;
438 dnl --------------------- operating system specific flags (port from sys/*)
440 dnl ----- AIX specific -----
441 if test x"$this_os" = "xaix"; then
442 AC_MSG_RESULT([ * AIX specific configuration])
444 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
445 dnl compilation environment. It's enough to get things defined
446 dnl right in endian.h provided that long long is supported, though.
447 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
450 dnl ----- FreeBSD specific -----
451 if test x"$this_os" = "xfreebsd"; then
452 AC_MSG_RESULT([ * FreeBSD specific configuration])
453 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
454 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
456 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
459 dnl ----- HP-UX 11 specific -----
460 if test x"$this_os" = "xhpux11"; then
461 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
463 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
466 dnl ----- Linux specific -----
467 ac_have_atalk_addr=no
468 if test x"$this_os" = "xlinux"; then
469 AC_MSG_RESULT([ * Linux specific configuration])
471 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
472 AC_MSG_CHECKING([for struct atalk_addr])
474 #include <sys/socket.h>
475 #include <asm/types.h>
476 #include <linux/atalk.h>
479 struct atalk_addr foo;
484 ac_have_atalk_addr=yes
490 if test "x$ac_have_atalk_addr" = "xyes"; then
491 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
494 dnl ----- as far as I can tell, dbtob always does the wrong thing
495 dnl ----- on every single version of linux I've ever played with.
496 dnl ----- see etc/afpd/quota.c
497 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
499 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
500 dnl ----- check if version is newer than 2.2.x
502 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
503 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
504 if [ $majorvers -ge 2 ]; then
505 if [ $minorvers -ge 2 ]; then
507 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
508 AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
510 AC_MSG_RESULT([ * found Linux 2.0.x ])
514 dnl ----- Linux/alpha specific -----
515 if test x"$this_cpu" = "xalpha"; then
516 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
517 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
522 dnl ----- Mac OSX specific -----
523 if test x"$this_os" = "xmacosx"; then
524 AC_MSG_RESULT([ * Mac OSX specific configuration])
525 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
526 AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
527 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
528 dnl AC_DEFINE(NO_DLFCN_H)
529 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
532 dnl ----- NetBSD specific -----
533 if test x"$this_os" = "xnetbsd"; then
534 AC_MSG_RESULT([ * NetBSD specific configuration])
535 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
536 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
537 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
538 # If this test is true, it's not an ELF box.
539 # This REALLY should be a configure test.
540 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
542 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
545 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
546 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
547 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
550 dnl ----- OpenBSD specific -----
551 if test x"$this_os" = "xopenbsd"; then
552 AC_MSG_RESULT([ * OpenBSD specific configuration])
553 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
554 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
556 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
557 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
558 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
561 dnl ----- Solaris specific -----
562 if test x"$this_os" = "xsolaris"; then
563 AC_MSG_RESULT([ * Solaris specific configuration])
564 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
565 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
566 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
567 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
570 AC_MSG_RESULT([enabling Solaris kernel module build])
574 dnl ----- Tru64 specific -----
575 if test x"$this_os" = "xtru64"; then
576 AC_MSG_RESULT([ * Tru64 specific configuration])
577 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
578 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
579 dnl AC_DEFINE(USE_MOUNT_H)
580 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
581 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
582 AC_CHECK_LIB(security,set_auth_parameters)
583 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
588 dnl -- look for OpenSSL and other crypt libraries
592 dnl --------------------- check for building Kerberos v4 UAM module
594 AC_ARG_ENABLE(krb4-uam,
595 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
596 if test "$enableval" = "yes"; then
597 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
599 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
602 dnl --------------------- overwrite the config files . . . or not.
604 AC_MSG_CHECKING([whether configuration files should be overwritten])
605 AC_ARG_ENABLE(overwrite,
606 [ --enable-overwrite overwrite configuration files during installation],
607 [OVERWRITE_CONFIG="${enable_overwrite}"],
608 [OVERWRITE_CONFIG="no"]
610 AC_MSG_RESULT([$OVERWRITE_CONFIG])
612 dnl --------------------- last minute substitutions
616 AC_SUBST(OVERWRITE_CONFIG)
618 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
619 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
620 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
621 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
622 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
623 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
624 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
625 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
626 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
627 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
628 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
629 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
630 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
632 dnl --------------------- generate files
636 bin/adv1tov2/Makefile
639 bin/afppasswd/Makefile
642 bin/getzones/Makefile
643 bin/megatron/Makefile
649 contrib/macusers/Makefile
650 contrib/macusers/macusers
653 contrib/printing/Makefile
654 contrib/shell_utils/Makefile
655 contrib/shell_utils/afpd-mtab.pl
656 contrib/shell_utils/apple_cp
657 contrib/shell_utils/apple_mv
658 contrib/shell_utils/apple_rm
659 contrib/shell_utils/cleanappledouble.pl
660 contrib/shell_utils/lp2pap.sh
661 contrib/shell_utils/netatalkshorternamelinks.pl
662 contrib/timelord/Makefile
663 contrib/a2boot/Makefile
665 distrib/config/Makefile
666 distrib/config/netatalk-config
667 distrib/initscripts/Makefile
672 etc/afpd/nls/Makefile
675 etc/uams/uams_krb4/Makefile
680 include/atalk/Makefile
682 libatalk/adouble/Makefile
683 libatalk/asp/Makefile
684 libatalk/atp/Makefile
685 libatalk/cnid/Makefile
686 libatalk/compat/Makefile
687 libatalk/dsi/Makefile
688 libatalk/nbp/Makefile
689 libatalk/netddp/Makefile
690 libatalk/util/Makefile
700 sys/generic/sys/Makefile
701 sys/netatalk/Makefile
703 sys/netbsd/netatalk/Makefile
705 sys/solaris/Makefile.kernel
709 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]