1 dnl $Id: configure.in,v 1.200 2003-12-15 06:40:40 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)
71 dnl Checks for (v)snprintf
74 NETATALK_SNPRINTF_CHECK
76 dnl --------------------------------------------------------------------------
77 dnl specific configuration comes in here:
78 dnl --------------------------------------------------------------------------
80 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
82 AC_MSG_CHECKING([for administrative group support])
83 AC_ARG_WITH(admin-group,
84 [ --disable-admin-group disable admin group], [
85 if test "$enableval" = "no"; then
86 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
99 AC_MSG_CHECKING([for logfile path])
101 [ --with-logfile=PATH path for file used by logger [/var/log/netatalk.log]
102 use --without-logfile to disable logger], [
103 if test "x$withval" == "xno"; then
104 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
105 AC_MSG_RESULT([syslog])
106 elif test "$withval" != "yes"; then
107 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
108 AC_MSG_RESULT([$withval])
110 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
111 AC_MSG_RESULT([/var/log/netatalk.log])
113 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
114 AC_MSG_RESULT([/var/log/netatalk.log])
118 AC_ARG_WITH(cracklib,
119 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
120 if test "x$withval" != "xno" ; then
122 AC_CHECK_LIB(crack, main,
123 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
125 AC_MSG_RESULT([enabling cracklib support])
126 if test "$cracklib" = "yes"; then
127 cracklib="/usr/lib/cracklib_dict"
129 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
130 [path to cracklib dictionary])
131 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
132 AC_MSG_ERROR([cracklib not found!])
137 AC_MSG_CHECKING([whether to enable DDP])
139 [ --disable-ddp disable DDP], [
140 if test "x$enableval" = "xno"; then
141 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
151 AC_MSG_CHECKING([whether to enable debugging code])
153 [ --enable-debug enable debug code], [
154 if test "x$enableval" != "xno"; then
155 if test "x$enableval" = "xyes"; then
156 AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
158 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
171 [ --enable-afp3 enable AFP 3.x calls],
172 if test "$enableval" = "yes"; then
174 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
175 AC_MSG_RESULT([enabling AFP 3.x calls])
179 if test "$afp3" = "yes"; then
185 dnl ----------- A NOTE ABOUT DROPKLUDGE
186 dnl The trouble with this fix is that if you know what the file is called, it
187 dnl can be read from the Unix side. That's okay for most academic institutions
188 dnl since the students don't have telnet access to the Mac servers. There is
189 dnl currently no one working on further development/fixes of DROPKLUDGE.
192 AC_MSG_CHECKING([whether to enable experimental dropbox support])
193 AC_ARG_ENABLE(dropkludge,
194 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ], [
195 if test "x$enableval" = "xyes"; then
196 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
201 ], [AC_MSG_RESULT([no])]
204 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
205 AC_ARG_ENABLE(force-uidgid,
206 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ], [
207 if test "x$enableval" = "xyes"; then
208 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
213 ], [AC_MSG_RESULT([no])]
218 dnl Determine whether or not to use filename mangling
219 AC_MSG_CHECKING([whether to use filename mangling])
220 AC_ARG_WITH(mangling,
221 [ --with-mangling enable filename mangling],
223 if test "x$withval" = "xyes"; then
224 if test "x$did_scheme" != "xcnid"; then
225 AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
227 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
234 if test "x$did_scheme" = "xcnid"; then
235 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
243 if test "$did_scheme" = "cnid"; then
249 dnl Determine whether or not to use CDB or transactional DB store
250 AC_MSG_CHECKING([whether to use CNID with Concurrent Data Store])
252 [ --with-cdb enable CNID with Concurrent Data Store],
253 if test "$withval" = "no"; then
254 if test "x$did_scheme" != "xcnid"; then
256 AC_MSG_ERROR([DID scheme must be CNID to use CDB])
265 , AC_MSG_RESULT([yes])
268 if test "$USE_CDB" = "yes"; then
269 AC_DEFINE(CNID_DB_CDB, 1, [Define if CNID should be used with Concurrent Data Store])
272 dnl Check for quota support
275 dnl Check for optional server location protocol support (used by MacOS X)
279 NETATALK_GSSAPI_CHECK
281 dnl Check for PAM libs
285 AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
288 AC_MSG_CHECKING([whether shadow support should be enabled])
290 [ --with-shadow enable shadow password support],
291 [shadowpw="$withval"],
294 if test "x$shadowpw" = "xyes"; then
295 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
297 AC_MSG_RESULT([$shadowpw])
299 AC_ARG_ENABLE(shell-check,
300 [ --disable-shell-check disable checking for a valid shell],
301 if test "$enableval" = "no"; then
302 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
303 AC_MSG_RESULT([disabling valid shell check])
307 NETATALK_TCP_WRAPPERS
309 AC_ARG_ENABLE(redhat,
310 [ --enable-redhat use redhat-style sysv configuration ],
311 if test "$enableval" = "yes"; then
314 AC_MSG_RESULT([enabling redhat-style sysv support])
318 [ --enable-suse use suse-style sysv configuration ],
319 if test "$enableval" = "yes"; then
322 AC_MSG_RESULT([enabling suse-style sysv support])
325 AC_ARG_ENABLE(cobalt,
326 [ --enable-cobalt use cobalt-style sysv configuration ],
327 if test "$enableval" = "yes"; then
330 AC_MSG_RESULT([enabling cobalt-style sysv support])
333 AC_ARG_ENABLE(netbsd,
334 [ --enable-netbsd use NetBSD-style rc.d configuration ],
335 if test "x$enableval" = "xyes"; then
338 AC_MSG_RESULT([enabling NetBSD-style rc.d support])
341 dnl ----- a2boot compilation (disabled by default)
342 AC_MSG_CHECKING([whether a2boot should be compiled])
344 AC_ARG_ENABLE(a2boot,
345 [ --enable-a2boot enable compilation of Apple2 boot server],
346 [compile_a2boot="$enableval"],
347 [compile_a2boot="no"]
349 AC_MSG_RESULT([$compile_a2boot])
351 AC_ARG_WITH(uams-path,
352 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
353 uams_path="$withval",
354 uams_path="${PKGCONFDIR}/uams"
357 dnl --------------------------------------------------------------------------
358 dnl FHS stuff has to be done last because it overrides other defaults
359 dnl --------------------------------------------------------------------------
362 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
363 if test "$enableval" = "yes"; then
364 uams_path="${libdir}/netatalk"
366 PKGCONFDIR=${sysconfdir}/netatalk
367 SERVERTEXT="${PKGCONFDIR}/msg"
368 NLSDIR="${PKGCONFDIR}/nls"
370 mandir="/usr/share/man"
371 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
373 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
376 dnl --------------------------------------------------------------------------
377 dnl post-FHS substitutions, etc
378 dnl --------------------------------------------------------------------------
381 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
382 [path to UAMs [default=PKGCONF/uams]])
383 UAMS_PATH="${uams_path}"
386 dnl --------------------------------------------------------------------------
387 dnl drop in includes for top level directory structures here...
388 dnl --------------------------------------------------------------------------
390 dnl Note: $(top_srcdir)/include should be added before all other includes
391 dnl so that includes from that directory a preferred to includes from
392 dnl /usr/include or similar places.
393 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
394 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
396 dnl --------------------------------------------------------------------------
397 dnl specific configuration comes in here:
398 dnl --------------------------------------------------------------------------
400 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
402 dnl --------------------- determine operating system from "target"
404 *aix*) this_os=aix ;;
405 *freebsd*) this_os=freebsd ;;
406 *hpux11*) this_os=hpux11 ;;
407 *irix*) this_os=irix ;;
408 *linux*) this_os=linux ;;
409 *osx*) this_os=macosx ;;
410 *darwin*) this_os=macosx ;;
411 *netbsd*) this_os=netbsd ;;
412 *openbsd*) this_os=openbsd ;;
413 *osf*) this_os=tru64 ;;
414 *solaris*) this_os=solaris ;;
418 i386|i486|i586|i686|k7) this_cpu=x86 ;;
419 alpha) this_cpu=alpha ;;
420 mips) this_cpu=mips ;;
421 powerpc|ppc) this_cpu=ppc ;;
424 dnl --------------------- operating system specific flags (port from sys/*)
426 dnl ----- AIX specific -----
427 if test x"$this_os" = "xaix"; then
428 AC_MSG_RESULT([ * AIX specific configuration])
430 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
431 dnl compilation environment. It's enough to get things defined
432 dnl right in endian.h provided that long long is supported, though.
433 AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
436 dnl ----- FreeBSD specific -----
437 if test x"$this_os" = "xfreebsd"; then
438 AC_MSG_RESULT([ * FreeBSD specific configuration])
439 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
440 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
442 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
445 dnl ----- HP-UX 11 specific -----
446 if test x"$this_os" = "xhpux11"; then
447 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
449 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
452 dnl ----- Linux specific -----
453 ac_have_atalk_addr=no
454 if test x"$this_os" = "xlinux"; then
455 AC_MSG_RESULT([ * Linux specific configuration])
457 dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
458 AC_MSG_CHECKING([for struct atalk_addr])
460 #include <sys/socket.h>
461 #include <asm/types.h>
462 #include <linux/atalk.h>
465 struct atalk_addr foo;
470 ac_have_atalk_addr=yes
476 if test "x$ac_have_atalk_addr" = "xyes"; then
477 AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
480 dnl ----- as far as I can tell, dbtob always does the wrong thing
481 dnl ----- on every single version of linux I've ever played with.
482 dnl ----- see etc/afpd/quota.c
483 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
485 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
486 dnl ----- check if version is newer than 2.2.x
488 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
489 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
490 if [ $majorvers -ge 2 ]; then
491 if [ $minorvers -ge 2 ]; then
493 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
494 AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
496 AC_MSG_RESULT([ * found Linux 2.0.x ])
500 dnl ----- Linux/alpha specific -----
501 if test x"$this_cpu" = "xalpha"; then
502 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
503 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
508 dnl ----- Mac OSX specific -----
509 if test x"$this_os" = "xmacosx"; then
510 AC_MSG_RESULT([ * Mac OSX specific configuration])
511 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
512 AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
513 AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
514 dnl AC_DEFINE(NO_DLFCN_H)
515 AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
518 dnl ----- NetBSD specific -----
519 if test x"$this_os" = "xnetbsd"; then
520 AC_MSG_RESULT([ * NetBSD specific configuration])
521 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
522 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
523 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
524 # If this test is true, it's not an ELF box.
525 # This REALLY should be a configure test.
526 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
528 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
531 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
532 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
533 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
536 dnl ----- OpenBSD specific -----
537 if test x"$this_os" = "xopenbsd"; then
538 AC_MSG_RESULT([ * OpenBSD specific configuration])
539 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
540 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
542 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
543 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
544 AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
547 dnl ----- Solaris specific -----
548 if test x"$this_os" = "xsolaris"; then
549 AC_MSG_RESULT([ * Solaris specific configuration])
550 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
551 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
552 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
553 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
556 AC_MSG_RESULT([enabling Solaris kernel module build])
560 dnl ----- Tru64 specific -----
561 if test x"$this_os" = "xtru64"; then
562 AC_MSG_RESULT([ * Tru64 specific configuration])
563 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
564 AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
565 dnl AC_DEFINE(USE_MOUNT_H)
566 AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
567 AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
568 AC_CHECK_LIB(security,set_auth_parameters)
569 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
574 dnl -- look for OpenSSL and other crypt libraries
578 dnl --------------------- check for building Kerberos v4 UAM module
580 AC_ARG_ENABLE(krb4-uam,
581 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
582 if test "$enableval" = "yes"; then
583 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
585 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
588 dnl --------------------- overwrite the config files . . . or not.
590 AC_MSG_CHECKING([whether configuration files should be overwritten])
591 AC_ARG_ENABLE(overwrite,
592 [ --enable-overwrite overwrite configuration files during installation],
593 [OVERWRITE_CONFIG="${enable_overwrite}"],
594 [OVERWRITE_CONFIG="no"]
596 AC_MSG_RESULT([$OVERWRITE_CONFIG])
598 dnl --------------------- last minute substitutions
602 AC_SUBST(OVERWRITE_CONFIG)
604 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
605 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
606 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
607 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
608 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
609 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
610 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
611 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
612 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
613 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
614 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
615 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
616 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
618 dnl --------------------- generate files
622 bin/adv1tov2/Makefile
625 bin/afppasswd/Makefile
628 bin/getzones/Makefile
629 bin/megatron/Makefile
635 contrib/macusers/Makefile
636 contrib/macusers/macusers
639 contrib/printing/Makefile
640 contrib/shell_utils/Makefile
641 contrib/shell_utils/afpd-mtab.pl
642 contrib/shell_utils/apple_cp
643 contrib/shell_utils/apple_mv
644 contrib/shell_utils/apple_rm
645 contrib/shell_utils/cleanappledouble.pl
646 contrib/shell_utils/lp2pap.sh
647 contrib/shell_utils/netatalkshorternamelinks.pl
648 contrib/timelord/Makefile
649 contrib/a2boot/Makefile
651 distrib/config/Makefile
652 distrib/config/netatalk-config
653 distrib/initscripts/Makefile
658 etc/afpd/nls/Makefile
661 etc/uams/uams_krb4/Makefile
666 include/atalk/Makefile
668 libatalk/adouble/Makefile
669 libatalk/asp/Makefile
670 libatalk/atp/Makefile
671 libatalk/cnid/Makefile
672 libatalk/compat/Makefile
673 libatalk/dsi/Makefile
674 libatalk/nbp/Makefile
675 libatalk/netddp/Makefile
676 libatalk/util/Makefile
686 sys/generic/sys/Makefile
687 sys/netatalk/Makefile
689 sys/netbsd/netatalk/Makefile
691 sys/solaris/Makefile.kernel
695 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]