1 dnl $Id: configure.in,v 1.144 2001-12-16 18:37:57 srittau 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"
136 AC_ARG_WITH(cracklib,
137 [ --with-cracklib=DICT enable/set location of cracklib dictionary],
138 if test "x$withval" != "xno" ; then
140 AC_CHECK_LIB(crack, main,
141 AC_DEFINE(USE_CRACKLIB)
143 AC_MSG_RESULT([enabling cracklib support])
144 if test "$cracklib" = "yes"; then
145 cracklib="/usr/lib/cracklib_dict"
147 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
148 [path to cracklib dictionary])
149 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
150 AC_MSG_ERROR([cracklib not found!])
156 [ --disable-ddp disable DDP],
157 if test "$enableval" = "no"; then
159 AC_MSG_RESULT([disabling DDP])
164 [ --enable-debug enable debug code],
165 if test "$enableval" != "no"; then
166 if test "$enableval" = "yes"; then
169 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
171 AC_MSG_RESULT([enabling debugging code])
178 dnl ----------- A NOTE ABOUT DROPKLUDGE
179 dnl The trouble with this fix is that if you know what the file is called, it
180 dnl can be read from the Unix side. That's okay for most academic institutions
181 dnl since the students don't have telnet access to the Mac servers. There is
182 dnl currently no one working on further development/fixes of DROPKLUDGE.
185 AC_ARG_ENABLE(dropkludge,
186 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
187 if test "$enableval" = "yes"; then
188 AC_DEFINE(DROPKLUDGE, 1)
189 AC_MSG_RESULT([enabling experimental dropbox support])
193 AC_ARG_ENABLE(force-uidgid,
194 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],
195 if test "$enableval" = "yes"; then
196 AC_DEFINE(FORCE_UIDGID, 1)
197 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
201 dnl Don't use DB3 unless it's needed
205 dnl Determine DID scheme
206 AC_MSG_CHECKING([for DID scheme to use])
208 [ --with-did=SCHEME set DID scheme (last,hash,mtab,cnid)],
209 [ did_scheme="$withval" ],
210 [ did_scheme="last" ]
213 if test "x$did_scheme" = "xlast"; then
214 AC_DEFINE(USE_LASTDID, 1)
215 AC_MSG_RESULT([last])
216 elif test "x$did_scheme" = "xhash"; then
217 AC_MSG_RESULT([device/inode-based hashing])
218 elif test "x$did_scheme" = "xmtab"; then
219 AC_DEFINE(DID_MTAB, 1)
220 AC_MSG_RESULT([mtab-based DID creation support])
221 elif test "x$did_scheme" = "xcnid"; then
223 AC_DEFINE(CNID_DB, 1)
224 AC_MSG_RESULT([enabling build with CNID DB support])
226 AC_MSG_ERROR([unknown DID scheme])
228 AM_CONDITIONAL(COMPILE_CNID, test "x$did_scheme" = "xcnid")
230 dnl Check for Berkeley DB3 library
231 if test "x$db3_required" = "xyes"; then
232 AC_PATH_DB3(, [AC_MSG_ERROR([Berkeley DB3 library not found!])])
235 dnl Check for quota support
239 AC_ARG_WITH(message-dir,
240 [ --with-message-dir=PATH path to message files [[PKGCONF/msg]]],
242 if test x"$msg_dir" = "x"; then
243 msg_dir="${PKGCONFDIR}/msg"
245 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
246 [path to message dir [[PKGCONF/msg]]])
247 SERVERTEXT="$msg_dir"
251 dnl Check for optional server location protocol support (used by MacOS X)
254 dnl Check for PAM libs
256 PAPD_LIBS="$PAPD_LIBS $PAM_LIBS"
257 AFPD_LIBS="$AFPD_LIBS $PAM_LIBS"
263 AC_MSG_CHECKING([whether shadow support should be enabled])
265 [ --with-shadow enable shadow password support],
266 [shadowpw="$withval"],
269 if test "x$shadowpw" = "xyes"; then
272 AC_MSG_RESULT([$shadowpw])
274 AC_ARG_ENABLE(shell-check,
275 [ --disable-shell-check disable checking for a valid shell],
276 if test "$enableval" = "no"; then
277 AC_DEFINE(DISABLE_SHELLCHECK, 1)
278 AC_MSG_RESULT([disabling valid shell check])
282 AC_MSG_CHECKING([whether flock locks should be enabled])
283 AC_ARG_WITH(flock-locks,
284 [ --with-flock-locks enable flock locks support],
285 [flock_locks="$withval"],
288 if test "x$flock_locks" = "xyes"; then
289 AC_DEFINE(USE_FLOCK_LOCKS)
291 AC_MSG_RESULT([$flock_locks])
293 AC_ARG_WITH(tcp-wrappers,
294 [ --with-tcp-wrappers enable TCP wrappers support],
295 AC_CHECK_LIB(wrap, tcpd_warn,
297 AFPD_LIBS="$AFPD_LIBS -lwrap"
298 AC_MSG_RESULT([enabling TCP wrappers support])
302 AC_ARG_ENABLE(redhat,
303 [ --enable-redhat use redhat-style sysv configuration ],
304 if test "$enableval" = "yes"; then
307 AC_MSG_RESULT([enabling redhat-style sysv support])
311 [ --enable-suse use suse-style sysv configuration ],
312 if test "$enableval" = "yes"; then
315 AC_MSG_RESULT([enabling suse-style sysv support])
318 AC_ARG_ENABLE(cobalt,
319 [ --enable-cobalt use cobalt-style sysv configuration ],
320 if test "$enableval" = "yes"; then
323 AC_MSG_RESULT([enabling cobalt-style sysv support])
326 dnl ----- timelord compilation (disabled by default)
327 AC_MSG_CHECKING([whether timelord should be compiled])
329 AC_ARG_ENABLE(timelord,
330 [ --enable-timelord enable compilation of timelord server],
331 [compile_timelord="$enableval"],
332 [compile_timelord="no"]
334 AC_MSG_RESULT([$compile_timelord])
336 AC_ARG_WITH(uams-path,
337 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
338 uams_path="$withval",
339 uams_path="${PKGCONFDIR}/uams"
342 dnl --------------------------------------------------------------------------
343 dnl FHS stuff has to be done last because it overrides other defaults
344 dnl --------------------------------------------------------------------------
347 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
348 if test "$enableval" = "yes"; then
349 uams_path="/usr/lib/netatalk"
351 PKGCONFDIR=${sysconfdir}/netatalk
353 mandir="/usr/share/man"
354 AC_DEFINE(FHS_COMPATIBILITY)
356 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
359 dnl --------------------------------------------------------------------------
360 dnl post-FHS substitutions, etc
361 dnl --------------------------------------------------------------------------
364 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
365 [path to UAMs [default=PKGCONF/uams]])
366 UAMS_PATH="${uams_path}"
369 dnl --------------------------------------------------------------------------
370 dnl drop in includes for top level directory structures here...
371 dnl --------------------------------------------------------------------------
373 dnl Note: $(top_srcdir)/include should be added before all other includes
374 dnl so that includes from that directory a preferred to includes from
375 dnl /usr/include or similar places.
376 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
377 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
379 dnl --------------------------------------------------------------------------
380 dnl specific configuration comes in here:
381 dnl --------------------------------------------------------------------------
383 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
385 dnl --------------------- determine operating system from "target"
387 *aix*) this_os=aix ;;
388 *freebsd*) this_os=freebsd ;;
389 *hpux11*) this_os=hpux11 ;;
390 *irix*) this_os=irix ;;
391 *linux*) this_os=linux ;;
392 *osx*) this_os=macosx ;;
393 *darwin*) this_os=macosx ;;
394 *netbsd*) this_os=netbsd ;;
395 *openbsd*) this_os=openbsd ;;
396 *osf*) this_os=tru64 ;;
397 *solaris*) this_os=solaris ;;
401 i386|i486|i586|i686|k7) this_cpu=x86 ;;
402 alpha) this_cpu=alpha ;;
403 mips) this_cpu=mips ;;
404 powerpc|ppc) this_cpu=ppc ;;
407 dnl --------------------- operating system specific flags (port from sys/*)
409 dnl ----- AIX specific -----
410 if test x"$this_os" = "xaix"; then
411 AC_MSG_RESULT([ * AIX specific configuration])
412 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
414 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
415 dnl compilation environment. It's enough to get things defined
416 dnl right in endian.h provided that long long is supported, though.
417 AC_DEFINE(HAVE_32BIT_LONGS)
420 dnl ----- FreeBSD specific -----
421 if test x"$this_os" = "xfreebsd"; then
422 AC_MSG_RESULT([ * FreeBSD specific configuration])
424 AC_DEFINE(SENDFILE_FLAVOR_BSD)
426 AC_DEFINE(NO_CRYPT_H, 1)
429 dnl ----- HP-UX 11 specific -----
430 if test x"$this_os" = "xhpux11"; then
431 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
433 AC_DEFINE(_ISOC9X_SOURCE)
434 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
437 dnl ----- IRIX specific -----
438 if test x"$this_os" = "xirix"; then
439 AC_MSG_RESULT([ * IRIX specific configuration])
441 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
444 dnl ----- Linux specific -----
445 if test x"$this_os" = "xlinux"; then
446 AC_MSG_RESULT([ * Linux specific configuration])
448 dnl ----- check if we need the quotactl wrapper
449 AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
450 AC_CHECK_FUNC(quotactl,,
451 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
452 AC_MSG_RESULT([enabling quotactl wrapper])
455 dnl ----- as far as I can tell, dbtob always does the wrong thing
456 dnl ----- on every single version of linux I've ever played with.
457 dnl ----- see etc/afpd/quota.c
458 AC_DEFINE(HAVE_BROKEN_DBTOB)
460 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
461 dnl ----- check if version is newer than 2.2.x
463 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
464 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
465 if [ $majorvers -ge 2 ]; then
466 if [ $minorvers -ge 2 ]; then
468 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
469 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
471 AC_MSG_RESULT([ * found Linux 2.0.x ])
475 dnl ----- Linux/alpha specific -----
476 if test x"$this_cpu" = "xalpha"; then
477 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
478 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
483 dnl ----- Mac OSX specific -----
484 if test x"$this_os" = "xmacosx"; then
485 AC_MSG_RESULT([ * Mac OSX specific configuration])
487 AC_DEFINE(HAVE_BROKEN_CPP)
488 AC_DEFINE(HAVE_2ARG_DBTOB)
489 dnl AC_DEFINE(NO_DLFCN_H)
490 AC_DEFINE(MACOSX_SERVER)
493 dnl ----- NetBSD specific -----
494 if test x"$this_os" = "xnetbsd"; then
495 AC_MSG_RESULT([ * NetBSD specific configuration])
497 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
498 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
501 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
502 AC_DEFINE(UAM_DHX, 1)
503 AC_DEFINE(NO_CRYPT_H, 1)
506 dnl ----- OpenBSD specific -----
507 if test x"$this_os" = "xopenbsd"; then
508 AC_MSG_RESULT([ * OpenBSD specific configuration])
510 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
512 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
513 AC_DEFINE(UAM_DHX, 1)
514 AC_DEFINE(NO_CRYPT_H, 1)
517 dnl ----- Solaris specific -----
518 if test x"$this_os" = "xsolaris"; then
519 AC_MSG_RESULT([ * Solaris specific configuration])
521 AC_DEFINE(_ISOC9X_SOURCE)
522 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
524 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
527 AC_MSG_RESULT([enabling Solaris kernel module build])
531 dnl ----- Tru64 specific -----
532 if test x"$this_os" = "xtru64"; then
533 AC_MSG_RESULT([ * Tru64 specific configuration])
535 AC_DEFINE(HAVE_64BIT_LONGS)
536 dnl AC_DEFINE(USE_MOUNT_H)
537 AC_DEFINE(USE_OLD_RQUOTA)
538 dnl AC_DEFINE(USE_UFS_QUOTA_H)
540 AC_CHECK_LIB(security,set_auth_parameters)
541 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
546 dnl -- look for openssl
549 dnl --------------------- check for building PGP UAM module
551 AC_ARG_ENABLE(pgp-uam,
552 [ --enable-pgp-uam enable build of PGP UAM module],
553 if test "$enableval" = "yes"; then
554 if test "$compile_ssl" = "yes"; then
555 AC_DEFINE(UAM_PGP, 1)
557 AC_MSG_RESULT([enabling build with PGP UAM module])
562 dnl --------------------- check for building Kerberos v4 UAM module
564 AC_ARG_ENABLE(krb4-uam,
565 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
566 if test "$enableval" = "yes"; then
567 AC_DEFINE(UAM_KRB4, 1)
569 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
572 dnl --------------------- overwrite the config files . . . or not.
574 AC_MSG_CHECKING([whether configuration files should be overwritten])
575 AC_ARG_ENABLE(overwrite,
576 [ --enable-overwrite overwrite configuration files during installation],
577 [OVERWRITE_CONFIG="${enable_overwrite}"],
578 [OVERWRITE_CONFIG="no"]
580 AC_MSG_RESULT([$OVERWRITE_CONFIG])
582 dnl --------------------- last minute substitutions
589 AC_SUBST(OVERWRITE_CONFIG)
591 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
592 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
593 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
594 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
595 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
596 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
597 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
598 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
599 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
600 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
601 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
602 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
603 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
605 dnl --------------------- generate files
609 bin/adv1tov2/Makefile
612 bin/afppasswd/Makefile
614 bin/getzones/Makefile
615 bin/megatron/Makefile
621 contrib/macusers/Makefile
623 contrib/printing/Makefile
624 contrib/shell_utils/Makefile
625 contrib/timelord/Makefile
627 distrib/config/Makefile
628 distrib/config/netatalk-config
629 distrib/initscripts/Makefile
634 etc/afpd/nls/Makefile
637 etc/uams/uams_krb4/Makefile
641 include/atalk/Makefile
643 libatalk/adouble/Makefile
644 libatalk/asp/Makefile
645 libatalk/atp/Makefile
646 libatalk/cnid/Makefile
647 libatalk/compat/Makefile
648 libatalk/dsi/Makefile
649 libatalk/nbp/Makefile
650 libatalk/netddp/Makefile
651 libatalk/util/Makefile
661 sys/generic/sys/Makefile
662 sys/netatalk/Makefile
664 sys/netbsd/netatalk/Makefile
669 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]