1 dnl $Id: configure.in,v 1.139 2001-12-10 07:20:37 jmarcus 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 Reset locations to proper places
14 AC_PREFIX_DEFAULT(/usr/local)
16 dnl Checks for programs.
25 dnl *********************************************************************
26 dnl FIXME! FIXME! These should be selectable properly, and should produce
27 dnl the proper flags and defines...
28 dnl *********************************************************************
30 dnl Checks for libraries.
31 dnl Replace `main' with a function in -labs:
32 AC_CHECK_LIB(abs, main)
33 dnl Replace `main' with a function in -laudit:
34 AC_CHECK_LIB(audit, main)
35 dnl Replace `main' with a function in -lauth:
36 AC_CHECK_LIB(auth, main)
37 dnl Replace `main' with a function in -lcmd:
38 AC_CHECK_LIB(cmd, main)
39 dnl Replace `main' with a function in -lcrypt:
40 AC_CHECK_LIB(crypt, main)
41 dnl Replace `main' with a function in -ld:
43 dnl Replace `main' with a function in -ldl:
44 AC_CHECK_LIB(dl, main)
45 dnl Replace `main' with a function in -lkauth:
46 AC_CHECK_LIB(kauth, main)
47 dnl Replace `main' with a function in -lkrb:
48 AC_CHECK_LIB(krb, main)
49 dnl Replace `main' with a function in -llwp:
50 AC_CHECK_LIB(lwp, main)
51 dnl Replace `main' with a function in -ln:
53 dnl Replace `main' with a function in -lnsl:
54 AC_CHECK_LIB(nsl, main)
55 dnl Replace `main' with a function in -lprot:
56 AC_CHECK_LIB(prot, main)
57 dnl Replace `main' with a function in -lrx:
58 AC_CHECK_LIB(rx, main)
59 dnl Replace `main' with a function in -lrxkad:
60 AC_CHECK_LIB(rxkad, main)
61 dnl Replace `main' with a function in -lsocket:
62 AC_CHECK_LIB(socket, main)
63 dnl Replace `main' with a function in -lsys:
64 AC_CHECK_LIB(sys, main)
65 dnl Replace `main' with a function in -lubik:
66 AC_CHECK_LIB(ubik, main)
69 # Check presence of some functions
71 # Check for XPG4 access() function
72 # Be sure to test before adding AFS libs in LIBS path as AFS lib
73 # has such a function that works only on AFS filesystems.
74 AC_CHECK_FUNCS(access)
76 dnl Checks for header files.
80 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)
81 AC_CHECK_HEADER(sys/cdefs.h,,
82 AC_MSG_RESULT([enabling generic cdefs.h from tree])
83 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
86 # Allow user to specify flags
88 [ --with-cflags specify additional flags to pass to compiler],
90 if test "x$withval" != "xno" ; then
91 CFLAGS="$CFLAGS $withval"
96 [ --with-libs specify additional libraries to link with],
98 if test "x$withval" != "xno" ; then
104 dnl Checks for typedefs, structures, and compiler characteristics.
116 dnl Checks for library functions.
118 AC_PROG_GCC_TRADITIONAL
125 AC_CHECK_FUNCS(flock getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul setpgrp strchr memcpy)
128 dnl --------------------------------------------------------------------------
129 dnl specific configuration comes in here:
130 dnl --------------------------------------------------------------------------
132 AC_DEFINE(ADMIN_GRP, 1)
134 AC_ARG_WITH(admin-group,
135 [ --disable-admin-group disable admin group],
136 if test "$enableval" = "no"; then
137 AC_DEFINE(ADMIN_GRP, 0)
138 AC_MSG_RESULT([disabling administrative group support])
143 [ --enable-afs enable AFS support],
144 if test "$enableval" = "yes"; then
146 AC_MSG_RESULT([enabling AFS support])
150 AC_ARG_WITH(pkgconfdir,
151 [ --with-pkgconfdir=DIR package specific configuration in DIR
152 [[SYSCONF/netatalk]]],
153 PKGCONFDIR="$withval",
154 PKGCONFDIR="${sysconfdir}/netatalk"
157 AC_ARG_WITH(cracklib,
158 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
159 if test "x$withval" != "xno" ; then
161 AC_CHECK_LIB(crack, main,
162 AC_DEFINE(USE_CRACKLIB)
164 AC_MSG_RESULT([enabling cracklib support])
165 if test "$cracklib" = "yes"; then
166 cracklib="/usr/lib/cracklib_dict"
168 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
169 [path to cracklib dictionary])
170 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
171 AC_MSG_ERROR([cracklib not found!])
177 [ --disable-ddp disable DDP],
178 if test "$enableval" = "no"; then
180 AC_MSG_RESULT([disabling DDP])
185 [ --enable-debug enable debug code],
186 if test "$enableval" != "no"; then
187 if test "$enableval" = "yes"; then
190 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
192 AC_MSG_RESULT([enabling debugging code])
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_ARG_ENABLE(dropkludge,
207 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
208 if test "$enableval" = "yes"; then
209 AC_DEFINE(DROPKLUDGE, 1)
210 AC_MSG_RESULT([enabling experimental dropbox support])
214 AC_ARG_ENABLE(force-uidgid,
215 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],
216 if test "$enableval" = "yes"; then
217 AC_DEFINE(FORCE_UIDGID, 1)
218 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
222 dnl Don't use DB3 unless it's needed
226 dnl Determine DID scheme
227 AC_MSG_CHECKING([for DID scheme to use])
229 [ --with-did=SCHEME set DID scheme (last,hash,mtab,cnid)],
230 [ did_scheme="$withval" ],
231 [ did_scheme="last" ]
234 if test "x$did_scheme" = "xlast"; then
235 AC_DEFINE(USE_LASTDID, 1)
236 AC_MSG_RESULT([last])
237 elif test "x$did_scheme" = "xhash"; then
238 AC_MSG_RESULT([device/inode-based hashing])
239 elif test "x$did_scheme" = "xmtab"; then
240 AC_DEFINE(DID_MTAB, 1)
241 AC_MSG_RESULT([mtab-based DID creation support])
242 elif test "x$did_scheme" = "xcnid"; then
244 AC_DEFINE(CNID_DB, 1)
245 AC_MSG_RESULT([enabling build with CNID DB support])
247 AC_MSG_ERROR([unknown DID scheme])
250 dnl Check for Berkeley DB3 library
251 if test "x$db3_required" = "xyes"; then
252 AC_PATH_DB3(, [AC_MSG_ERROR([Berkeley DB3 library not found!])])
255 dnl Check for quota support
259 AC_ARG_WITH(message-dir,
260 [ --with-message-dir=PATH path to message files [[PKGCONF/msg]]],
262 if test x"$msg_dir" = "x"; then
263 msg_dir="${PKGCONFDIR}/msg"
265 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
266 [path to message dir [[PKGCONF/msg]]])
267 SERVERTEXT="$msg_dir"
271 AC_ARG_ENABLE(srvloc,
272 [ --enable-srvloc turn on Server Location Protocol support (EXPERIMENTAL)],
277 dnl Conditional for optional server location protocol support (used by OS X)
278 AM_CONDITIONAL(USE_SRVLOC, test "x$srvloc" != "xno")
279 if test "x$srvloc" != "xno"; then
280 for slpdir in "" $srvloc /usr /usr/local ; do
281 if test -f "$slpdir/include/slp.h" ; then
282 LIBS="$LIBS -L$slpdir/lib -lslp"
283 CFLAGS="$CFLAGS -I$slpdir/include"
284 AC_CHECK_LIB(slp,SLPOpen)
285 AC_CHECK_FUNCS(SLPReg SLPDereg SLPClose)
286 AC_DEFINE(USE_SRVLOC, 1)
294 PAPD_LIBS="$PAPD_LIBS $PAM_LIBS"
295 AFPD_LIBS="$AFPD_LIBS $PAM_LIBS"
301 AC_MSG_CHECKING([whether shadow support should be enabled])
303 [ --with-shadow enable shadow password support],
304 [shadowpw="$withval"],
307 if test "x$shadowpw" = "xyes"; then
310 AC_MSG_RESULT([$shadowpw])
312 AC_ARG_ENABLE(shell-check,
313 [ --disable-shell-check disable checking for a valid shell],
314 if test "$enableval" = "no"; then
315 AC_DEFINE(DISABLE_SHELLCHECK, 1)
316 AC_MSG_RESULT([disabling valid shell check])
320 AC_MSG_CHECKING([whether flock locks should be enabled])
321 AC_ARG_WITH(flock-locks,
322 [ --with-flock-locks enable flock locks support],
323 [flock_locks="$withval"],
326 if test "x$flock_locks" = "xyes"; then
327 AC_DEFINE(USE_FLOCK_LOCKS)
329 AC_MSG_RESULT([$flock_locks])
331 AC_ARG_WITH(tcp-wrappers,
332 [ --with-tcp-wrappers enable TCP wrappers support],
333 AC_CHECK_LIB(wrap, tcpd_warn,
335 AFPD_LIBS="$AFPD_LIBS -lwrap"
336 AC_MSG_RESULT([enabling TCP wrappers support])
340 AC_ARG_ENABLE(redhat,
341 [ --enable-redhat use redhat-style sysv configuration ],
342 if test "$enableval" = "yes"; then
345 AC_MSG_RESULT([enabling redhat-style sysv support])
349 [ --enable-suse use suse-style sysv configuration ],
350 if test "$enableval" = "yes"; then
353 AC_MSG_RESULT([enabling suse-style sysv support])
356 AC_ARG_ENABLE(cobalt,
357 [ --enable-cobalt use cobalt-style sysv configuration ],
358 if test "$enableval" = "yes"; then
361 AC_MSG_RESULT([enabling cobalt-style sysv support])
364 dnl ----- timelord compilation (disabled by default)
365 AC_MSG_CHECKING([whether timelord should be compiled])
367 AC_ARG_ENABLE(timelord,
368 [ --enable-timelord enable compilation of timelord server],
369 [compile_timelord="$enableval"],
370 [compile_timelord="no"]
372 AC_MSG_RESULT([$compile_timelord])
374 AC_ARG_WITH(uams-path,
375 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
376 uams_path="$withval",
377 uams_path="${PKGCONFDIR}/uams"
380 dnl --------------------------------------------------------------------------
381 dnl FHS stuff has to be done last because it overrides other defaults
382 dnl --------------------------------------------------------------------------
385 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
386 if test "$enableval" = "yes"; then
387 uams_path="/usr/lib/netatalk"
389 PKGCONFDIR=${sysconfdir}/netatalk
391 dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
392 AC_DEFINE(FHS_COMPATIBILITY)
394 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
397 dnl --------------------------------------------------------------------------
398 dnl post-FHS substitutions, etc
399 dnl --------------------------------------------------------------------------
402 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
403 [path to UAMs [default=PKGCONF/uams]])
404 UAMS_PATH="${uams_path}"
407 dnl --------------------------------------------------------------------------
408 dnl drop in includes for top level directory structures here...
409 dnl --------------------------------------------------------------------------
411 dnl Note: $(top_srcdir)/include should be added before all other includes
412 dnl so that includes from that directory a preferred to includes from
413 dnl /usr/include or similar places.
414 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
415 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
417 dnl --------------------------------------------------------------------------
418 dnl specific configuration comes in here:
419 dnl --------------------------------------------------------------------------
421 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
423 dnl --------------------- determine operating system from "target"
425 *aix*) this_os=aix ;;
426 *freebsd*) this_os=freebsd ;;
427 *hpux11*) this_os=hpux11 ;;
428 *irix*) this_os=irix ;;
429 *linux*) this_os=linux ;;
430 *osx*) this_os=macosx ;;
431 *darwin*) this_os=macosx ;;
432 *netbsd*) this_os=netbsd ;;
433 *openbsd*) this_os=openbsd ;;
434 *osf*) this_os=tru64 ;;
435 *solaris*) this_os=solaris ;;
439 i386|i486|i586|i686|k7) this_cpu=x86 ;;
440 alpha) this_cpu=alpha ;;
441 mips) this_cpu=mips ;;
442 powerpc|ppc) this_cpu=ppc ;;
445 dnl --------------------- operating system specific flags (port from sys/*)
447 dnl ----- AIX specific -----
448 if test x"$this_os" = "xaix"; then
449 AC_MSG_RESULT([ * AIX specific configuration])
450 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
452 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
453 dnl compilation environment. It's enough to get things defined
454 dnl right in endian.h provided that long long is supported, though.
455 AC_DEFINE(HAVE_32BIT_LONGS)
458 dnl ----- FreeBSD specific -----
459 if test x"$this_os" = "xfreebsd"; then
460 AC_MSG_RESULT([ * FreeBSD specific configuration])
462 AC_DEFINE(SENDFILE_FLAVOR_BSD)
464 AC_DEFINE(NO_CRYPT_H, 1)
467 dnl ----- HP-UX 11 specific -----
468 if test x"$this_os" = "xhpux11"; then
469 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
471 AC_DEFINE(_ISOC9X_SOURCE)
472 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
475 dnl ----- IRIX specific -----
476 if test x"$this_os" = "xirix"; then
477 AC_MSG_RESULT([ * IRIX specific configuration])
479 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
482 dnl ----- Linux specific -----
483 if test x"$this_os" = "xlinux"; then
484 AC_MSG_RESULT([ * Linux specific configuration])
486 dnl ----- check if we need the quotactl wrapper
487 AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
488 AC_CHECK_FUNC(quotactl,,
489 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
490 AC_MSG_RESULT([enabling quotactl wrapper])
493 dnl ----- as far as I can tell, dbtob always does the wrong thing
494 dnl ----- on every single version of linux I've ever played with.
495 dnl ----- see etc/afpd/quota.c
496 AC_DEFINE(HAVE_BROKEN_DBTOB)
498 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
499 dnl ----- check if version is newer than 2.2.x
501 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
502 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
503 if [ $majorvers -ge 2 ]; then
504 if [ $minorvers -ge 2 ]; then
506 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
507 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
509 AC_MSG_RESULT([ * found Linux 2.0.x ])
513 dnl ----- Linux/alpha specific -----
514 if test x"$this_cpu" = "xalpha"; then
515 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
516 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
521 dnl ----- Mac OSX specific -----
522 if test x"$this_os" = "xmacosx"; then
523 AC_MSG_RESULT([ * Mac OSX specific configuration])
525 AC_DEFINE(HAVE_BROKEN_CPP)
526 AC_DEFINE(HAVE_2ARG_DBTOB)
527 dnl AC_DEFINE(NO_DLFCN_H)
528 AC_DEFINE(MACOSX_SERVER)
531 dnl ----- NetBSD specific -----
532 if test x"$this_os" = "xnetbsd"; then
533 AC_MSG_RESULT([ * NetBSD specific configuration])
535 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
536 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
539 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
540 AC_DEFINE(UAM_DHX, 1)
541 AC_DEFINE(NO_CRYPT_H, 1)
544 dnl ----- OpenBSD specific -----
545 if test x"$this_os" = "xopenbsd"; then
546 AC_MSG_RESULT([ * OpenBSD specific configuration])
548 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
550 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
551 AC_DEFINE(UAM_DHX, 1)
552 AC_DEFINE(NO_CRYPT_H, 1)
555 dnl ----- Solaris specific -----
556 if test x"$this_os" = "xsolaris"; then
557 AC_MSG_RESULT([ * Solaris specific configuration])
559 AC_DEFINE(_ISOC9X_SOURCE)
560 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
562 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
565 AC_MSG_RESULT([enabling Solaris kernel module build])
569 dnl ----- Tru64 specific -----
570 if test x"$this_os" = "xtru64"; then
571 AC_MSG_RESULT([ * Tru64 specific configuration])
573 AC_DEFINE(HAVE_64BIT_LONGS)
574 dnl AC_DEFINE(USE_MOUNT_H)
575 AC_DEFINE(USE_OLD_RQUOTA)
576 dnl AC_DEFINE(USE_UFS_QUOTA_H)
578 AC_CHECK_LIB(security,set_auth_parameters)
579 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
584 dnl -- look for openssl
587 dnl --------------------- check for building PGP UAM module
589 AC_ARG_ENABLE(pgp-uam,
590 [ --enable-pgp-uam enable build of PGP UAM module],
591 if test "$enableval" = "yes"; then
592 if test "$compile_ssl" = "yes"; then
593 AC_DEFINE(UAM_PGP, 1)
595 AC_MSG_RESULT([enabling build with PGP UAM module])
600 dnl --------------------- check for building Kerberos v4 UAM module
602 AC_ARG_ENABLE(krb4-uam,
603 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
604 if test "$enableval" = "yes"; then
605 AC_DEFINE(UAM_KRB4, 1)
607 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
610 dnl --------------------- overwrite the config files . . . or not.
612 AC_MSG_CHECKING([whether configuration files should be overwritten])
613 AC_ARG_ENABLE(overwrite,
614 [ --enable-overwrite overwrite configuration files during installation],
615 [OVERWRITE_CONFIG="${enable_overwrite}"],
616 [OVERWRITE_CONFIG="no"]
618 AC_MSG_RESULT([$OVERWRITE_CONFIG])
620 dnl --------------------- last minute substitutions
627 AC_SUBST(OVERWRITE_CONFIG)
629 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
630 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
631 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
632 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
633 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
634 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
635 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
636 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
637 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
638 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
639 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
640 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
641 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
643 dnl --------------------- generate files
647 bin/adv1tov2/Makefile
650 bin/afppasswd/Makefile
652 bin/getzones/Makefile
653 bin/megatron/Makefile
659 contrib/macusers/Makefile
661 contrib/printing/Makefile
662 contrib/shell_utils/Makefile
663 contrib/timelord/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
679 include/atalk/Makefile
681 libatalk/adouble/Makefile
682 libatalk/asp/Makefile
683 libatalk/atp/Makefile
684 libatalk/cnid/Makefile
685 libatalk/compat/Makefile
686 libatalk/dsi/Makefile
687 libatalk/nbp/Makefile
688 libatalk/netddp/Makefile
689 libatalk/util/Makefile
699 sys/generic/sys/Makefile
700 sys/netatalk/Makefile
702 sys/netbsd/netatalk/Makefile
707 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]