1 dnl $Id: configure.in,v 1.145 2002-01-04 04:45:46 sibaz Exp $
2 dnl configure.in for netatalk
4 AC_INIT(bin/adv1tov2/adv1tov2.c)
6 NETATALK_VERSION=`cat VERSION`
7 AC_SUBST(NETATALK_VERSION)
10 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
11 AM_CONFIG_HEADER(config.h)
13 dnl Checks for programs.
22 dnl *********************************************************************
23 dnl FIXME! FIXME! These should be selectable properly, and should produce
24 dnl the proper flags and defines...
25 dnl *********************************************************************
27 dnl Checks for libraries.
28 dnl Replace `main' with a function in -labs:
29 AC_CHECK_LIB(abs, main)
30 dnl Replace `main' with a function in -laudit:
31 AC_CHECK_LIB(audit, main)
32 dnl Replace `main' with a function in -lauth:
33 AC_CHECK_LIB(auth, main)
34 dnl Replace `main' with a function in -lcmd:
35 AC_CHECK_LIB(cmd, main)
36 dnl Replace `main' with a function in -lcrypt:
37 AC_CHECK_LIB(crypt, main)
38 dnl Replace `main' with a function in -ld:
40 dnl Replace `main' with a function in -ldl:
41 AC_CHECK_LIB(dl, main)
42 dnl Replace `main' with a function in -lkauth:
43 AC_CHECK_LIB(kauth, main)
44 dnl Replace `main' with a function in -lkrb:
45 AC_CHECK_LIB(krb, main)
46 dnl Replace `main' with a function in -llwp:
47 AC_CHECK_LIB(lwp, main)
48 dnl Replace `main' with a function in -ln:
50 dnl Replace `main' with a function in -lnsl:
51 AC_CHECK_LIB(nsl, main)
52 dnl Replace `main' with a function in -lprot:
53 AC_CHECK_LIB(prot, main)
54 dnl Replace `main' with a function in -lrx:
55 AC_CHECK_LIB(rx, main)
56 dnl Replace `main' with a function in -lrxkad:
57 AC_CHECK_LIB(rxkad, main)
58 dnl Replace `main' with a function in -lsocket:
59 AC_CHECK_LIB(socket, main)
60 dnl Replace `main' with a function in -lsys:
61 AC_CHECK_LIB(sys, main)
62 dnl Replace `main' with a function in -lubik:
63 AC_CHECK_LIB(ubik, main)
66 # Check presence of some functions
68 # Check for XPG4 access() function
69 # Be sure to test before adding AFS libs in LIBS path as AFS lib
70 # has such a function that works only on AFS filesystems.
71 AC_CHECK_FUNCS(access)
73 dnl Checks for header files.
77 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 sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h)
78 AC_CHECK_HEADER(sys/cdefs.h,,
79 AC_MSG_RESULT([enabling generic cdefs.h from tree])
80 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
83 dnl Checks for typedefs, structures, and compiler characteristics.
95 dnl Checks for library functions.
97 AC_PROG_GCC_TRADITIONAL
104 AC_CHECK_FUNCS(flock getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul setpgrp strchr memcpy)
107 dnl --------------------------------------------------------------------------
108 dnl specific configuration comes in here:
109 dnl --------------------------------------------------------------------------
111 AC_DEFINE(ADMIN_GRP, 1)
113 AC_ARG_WITH(admin-group,
114 [ --disable-admin-group disable admin group],
115 if test "$enableval" = "no"; then
116 AC_DEFINE(ADMIN_GRP, 0)
117 AC_MSG_RESULT([disabling administrative group support])
122 [ --enable-afs enable AFS support],
123 if test "$enableval" = "yes"; then
125 AC_MSG_RESULT([enabling AFS support])
129 AC_ARG_WITH(pkgconfdir,
130 [ --with-pkgconfdir=DIR package specific configuration in DIR
131 [[SYSCONF/netatalk]]],
132 PKGCONFDIR="$withval",
133 PKGCONFDIR="${sysconfdir}/netatalk"
137 [ --with-logfile=PATH path for file used by logger [/var/log/netatalk.log]
138 use --without-logfile to disable logger],
139 if test "$withval" = "no"; then
140 AC_DEFINE(DISABLE_LOGGER, 1)
141 AC_MSG_RESULT([logger disabled])
142 elif test "$withval" != "yes"; then
143 AC_DEFINE_UNQUOTED(LOGFILEPATH, $withval)
144 AC_MSG_RESULT([logfile set to $withval])
146 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log")
147 AC_MSG_RESULT([logfile set to default])
149 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log")
150 AC_MSG_RESULT([logfile set to default])
153 AC_ARG_WITH(cracklib,
154 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
155 if test "x$withval" != "xno" ; then
157 AC_CHECK_LIB(crack, main,
158 AC_DEFINE(USE_CRACKLIB)
160 AC_MSG_RESULT([enabling cracklib support])
161 if test "$cracklib" = "yes"; then
162 cracklib="/usr/lib/cracklib_dict"
164 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
165 [path to cracklib dictionary])
166 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
167 AC_MSG_ERROR([cracklib not found!])
173 [ --disable-ddp disable DDP],
174 if test "$enableval" = "no"; then
176 AC_MSG_RESULT([disabling DDP])
181 [ --enable-debug enable debug code],
182 if test "$enableval" != "no"; then
183 if test "$enableval" = "yes"; then
186 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
188 AC_MSG_RESULT([enabling debugging code])
195 dnl ----------- A NOTE ABOUT DROPKLUDGE
196 dnl The trouble with this fix is that if you know what the file is called, it
197 dnl can be read from the Unix side. That's okay for most academic institutions
198 dnl since the students don't have telnet access to the Mac servers. There is
199 dnl currently no one working on further development/fixes of DROPKLUDGE.
202 AC_ARG_ENABLE(dropkludge,
203 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
204 if test "$enableval" = "yes"; then
205 AC_DEFINE(DROPKLUDGE, 1)
206 AC_MSG_RESULT([enabling experimental dropbox support])
210 AC_ARG_ENABLE(force-uidgid,
211 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],
212 if test "$enableval" = "yes"; then
213 AC_DEFINE(FORCE_UIDGID, 1)
214 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
218 dnl Don't use DB3 unless it's needed
222 dnl Determine DID scheme
223 AC_MSG_CHECKING([for DID scheme to use])
225 [ --with-did=SCHEME set DID scheme (last,hash,mtab,cnid)],
226 [ did_scheme="$withval" ],
227 [ did_scheme="last" ]
230 if test "x$did_scheme" = "xlast"; then
231 AC_DEFINE(USE_LASTDID, 1)
232 AC_MSG_RESULT([last])
233 elif test "x$did_scheme" = "xhash"; then
234 AC_MSG_RESULT([device/inode-based hashing])
235 elif test "x$did_scheme" = "xmtab"; then
236 AC_DEFINE(DID_MTAB, 1)
237 AC_MSG_RESULT([mtab-based DID creation support])
238 elif test "x$did_scheme" = "xcnid"; then
240 AC_DEFINE(CNID_DB, 1)
241 AC_MSG_RESULT([enabling build with CNID DB support])
243 AC_MSG_ERROR([unknown DID scheme])
245 AM_CONDITIONAL(COMPILE_CNID, test "x$did_scheme" = "xcnid")
247 dnl Check for Berkeley DB3 library
248 if test "x$db3_required" = "xyes"; then
249 AC_PATH_DB3(, [AC_MSG_ERROR([Berkeley DB3 library not found!])])
252 dnl Check for quota support
256 AC_ARG_WITH(message-dir,
257 [ --with-message-dir=PATH path to message files [[PKGCONF/msg]]],
259 if test x"$msg_dir" = "x"; then
260 msg_dir="${PKGCONFDIR}/msg"
262 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
263 [path to message dir [[PKGCONF/msg]]])
264 SERVERTEXT="$msg_dir"
268 dnl Check for optional server location protocol support (used by MacOS X)
271 dnl Check for PAM libs
273 PAPD_LIBS="$PAPD_LIBS $PAM_LIBS"
274 AFPD_LIBS="$AFPD_LIBS $PAM_LIBS"
280 AC_MSG_CHECKING([whether shadow support should be enabled])
282 [ --with-shadow enable shadow password support],
283 [shadowpw="$withval"],
286 if test "x$shadowpw" = "xyes"; then
289 AC_MSG_RESULT([$shadowpw])
291 AC_ARG_ENABLE(shell-check,
292 [ --disable-shell-check disable checking for a valid shell],
293 if test "$enableval" = "no"; then
294 AC_DEFINE(DISABLE_SHELLCHECK, 1)
295 AC_MSG_RESULT([disabling valid shell check])
299 AC_MSG_CHECKING([whether flock locks should be enabled])
300 AC_ARG_WITH(flock-locks,
301 [ --with-flock-locks enable flock locks support],
302 [flock_locks="$withval"],
305 if test "x$flock_locks" = "xyes"; then
306 AC_DEFINE(USE_FLOCK_LOCKS)
308 AC_MSG_RESULT([$flock_locks])
310 AC_ARG_WITH(tcp-wrappers,
311 [ --with-tcp-wrappers enable TCP wrappers support],
312 AC_CHECK_LIB(wrap, tcpd_warn,
314 AFPD_LIBS="$AFPD_LIBS -lwrap"
315 AC_MSG_RESULT([enabling TCP wrappers support])
319 AC_ARG_ENABLE(redhat,
320 [ --enable-redhat use redhat-style sysv configuration ],
321 if test "$enableval" = "yes"; then
324 AC_MSG_RESULT([enabling redhat-style sysv support])
328 [ --enable-suse use suse-style sysv configuration ],
329 if test "$enableval" = "yes"; then
332 AC_MSG_RESULT([enabling suse-style sysv support])
335 AC_ARG_ENABLE(cobalt,
336 [ --enable-cobalt use cobalt-style sysv configuration ],
337 if test "$enableval" = "yes"; then
340 AC_MSG_RESULT([enabling cobalt-style sysv support])
343 dnl ----- timelord compilation (disabled by default)
344 AC_MSG_CHECKING([whether timelord should be compiled])
346 AC_ARG_ENABLE(timelord,
347 [ --enable-timelord enable compilation of timelord server],
348 [compile_timelord="$enableval"],
349 [compile_timelord="no"]
351 AC_MSG_RESULT([$compile_timelord])
353 AC_ARG_WITH(uams-path,
354 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
355 uams_path="$withval",
356 uams_path="${PKGCONFDIR}/uams"
359 dnl --------------------------------------------------------------------------
360 dnl FHS stuff has to be done last because it overrides other defaults
361 dnl --------------------------------------------------------------------------
364 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
365 if test "$enableval" = "yes"; then
366 uams_path="/usr/lib/netatalk"
368 PKGCONFDIR=${sysconfdir}/netatalk
370 mandir="/usr/share/man"
371 AC_DEFINE(FHS_COMPATIBILITY)
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])
429 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
431 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
432 dnl compilation environment. It's enough to get things defined
433 dnl right in endian.h provided that long long is supported, though.
434 AC_DEFINE(HAVE_32BIT_LONGS)
437 dnl ----- FreeBSD specific -----
438 if test x"$this_os" = "xfreebsd"; then
439 AC_MSG_RESULT([ * FreeBSD specific configuration])
441 AC_DEFINE(SENDFILE_FLAVOR_BSD)
443 AC_DEFINE(NO_CRYPT_H, 1)
446 dnl ----- HP-UX 11 specific -----
447 if test x"$this_os" = "xhpux11"; then
448 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
450 AC_DEFINE(_ISOC9X_SOURCE)
451 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
454 dnl ----- IRIX specific -----
455 if test x"$this_os" = "xirix"; then
456 AC_MSG_RESULT([ * IRIX specific configuration])
458 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
461 dnl ----- Linux specific -----
462 if test x"$this_os" = "xlinux"; then
463 AC_MSG_RESULT([ * Linux specific configuration])
465 dnl ----- check if we need the quotactl wrapper
466 AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
467 AC_CHECK_FUNC(quotactl,,
468 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
469 AC_MSG_RESULT([enabling quotactl wrapper])
472 dnl ----- as far as I can tell, dbtob always does the wrong thing
473 dnl ----- on every single version of linux I've ever played with.
474 dnl ----- see etc/afpd/quota.c
475 AC_DEFINE(HAVE_BROKEN_DBTOB)
477 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
478 dnl ----- check if version is newer than 2.2.x
480 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
481 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
482 if [ $majorvers -ge 2 ]; then
483 if [ $minorvers -ge 2 ]; then
485 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
486 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
488 AC_MSG_RESULT([ * found Linux 2.0.x ])
492 dnl ----- Linux/alpha specific -----
493 if test x"$this_cpu" = "xalpha"; then
494 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
495 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
500 dnl ----- Mac OSX specific -----
501 if test x"$this_os" = "xmacosx"; then
502 AC_MSG_RESULT([ * Mac OSX specific configuration])
504 AC_DEFINE(HAVE_BROKEN_CPP)
505 AC_DEFINE(HAVE_2ARG_DBTOB)
506 dnl AC_DEFINE(NO_DLFCN_H)
507 AC_DEFINE(MACOSX_SERVER)
510 dnl ----- NetBSD specific -----
511 if test x"$this_os" = "xnetbsd"; then
512 AC_MSG_RESULT([ * NetBSD specific configuration])
514 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
515 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
518 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
519 AC_DEFINE(UAM_DHX, 1)
520 AC_DEFINE(NO_CRYPT_H, 1)
523 dnl ----- OpenBSD specific -----
524 if test x"$this_os" = "xopenbsd"; then
525 AC_MSG_RESULT([ * OpenBSD specific configuration])
527 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
529 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
530 AC_DEFINE(UAM_DHX, 1)
531 AC_DEFINE(NO_CRYPT_H, 1)
534 dnl ----- Solaris specific -----
535 if test x"$this_os" = "xsolaris"; then
536 AC_MSG_RESULT([ * Solaris specific configuration])
538 AC_DEFINE(_ISOC9X_SOURCE)
539 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
541 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
544 AC_MSG_RESULT([enabling Solaris kernel module build])
548 dnl ----- Tru64 specific -----
549 if test x"$this_os" = "xtru64"; then
550 AC_MSG_RESULT([ * Tru64 specific configuration])
552 AC_DEFINE(HAVE_64BIT_LONGS)
553 dnl AC_DEFINE(USE_MOUNT_H)
554 AC_DEFINE(USE_OLD_RQUOTA)
555 dnl AC_DEFINE(USE_UFS_QUOTA_H)
557 AC_CHECK_LIB(security,set_auth_parameters)
558 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
563 dnl -- look for openssl
566 dnl --------------------- check for building PGP UAM module
568 AC_ARG_ENABLE(pgp-uam,
569 [ --enable-pgp-uam enable build of PGP UAM module],
570 if test "$enableval" = "yes"; then
571 if test "$compile_ssl" = "yes"; then
572 AC_DEFINE(UAM_PGP, 1)
574 AC_MSG_RESULT([enabling build with PGP UAM module])
579 dnl --------------------- check for building Kerberos v4 UAM module
581 AC_ARG_ENABLE(krb4-uam,
582 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
583 if test "$enableval" = "yes"; then
584 AC_DEFINE(UAM_KRB4, 1)
586 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
589 dnl --------------------- overwrite the config files . . . or not.
591 AC_MSG_CHECKING([whether configuration files should be overwritten])
592 AC_ARG_ENABLE(overwrite,
593 [ --enable-overwrite overwrite configuration files during installation],
594 [OVERWRITE_CONFIG="${enable_overwrite}"],
595 [OVERWRITE_CONFIG="no"]
597 AC_MSG_RESULT([$OVERWRITE_CONFIG])
599 dnl --------------------- last minute substitutions
606 AC_SUBST(OVERWRITE_CONFIG)
608 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
609 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
610 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
611 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
612 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
613 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
614 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
615 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
616 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
617 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
618 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
619 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
620 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
622 dnl --------------------- generate files
626 bin/adv1tov2/Makefile
629 bin/afppasswd/Makefile
631 bin/getzones/Makefile
632 bin/megatron/Makefile
638 contrib/macusers/Makefile
640 contrib/printing/Makefile
641 contrib/shell_utils/Makefile
642 contrib/timelord/Makefile
644 distrib/config/Makefile
645 distrib/config/netatalk-config
646 distrib/initscripts/Makefile
651 etc/afpd/nls/Makefile
654 etc/uams/uams_krb4/Makefile
658 include/atalk/Makefile
660 libatalk/adouble/Makefile
661 libatalk/asp/Makefile
662 libatalk/atp/Makefile
663 libatalk/cnid/Makefile
664 libatalk/compat/Makefile
665 libatalk/dsi/Makefile
666 libatalk/nbp/Makefile
667 libatalk/netddp/Makefile
668 libatalk/util/Makefile
678 sys/generic/sys/Makefile
679 sys/netatalk/Makefile
681 sys/netbsd/netatalk/Makefile
686 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]