1 dnl $Id: configure.in,v 1.126.2.8 2001-12-31 20:11:22 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])
229 dnl Check for Berkeley DB3 library
230 if test "x$db3_required" = "xyes"; then
231 AC_PATH_DB3(, [AC_MSG_ERROR([Berkeley DB3 library not found!])])
234 dnl Check for quota support
238 AC_ARG_WITH(message-dir,
239 [ --with-message-dir=PATH path to message files [[PKGCONF/msg]]],
241 if test x"$msg_dir" = "x"; then
242 msg_dir="${PKGCONFDIR}/msg"
244 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
245 [path to message dir [[PKGCONF/msg]]])
246 SERVERTEXT="$msg_dir"
250 dnl Check for optional server location protocol support (used by MacOS X)
253 dnl Check for PAM libs
255 PAPD_LIBS="$PAPD_LIBS $PAM_LIBS"
256 AFPD_LIBS="$AFPD_LIBS $PAM_LIBS"
262 AC_MSG_CHECKING([whether shadow support should be enabled])
264 [ --with-shadow enable shadow password support],
265 [shadowpw="$withval"],
268 if test "x$shadowpw" = "xyes"; then
271 AC_MSG_RESULT([$shadowpw])
273 AC_ARG_ENABLE(shell-check,
274 [ --disable-shell-check disable checking for a valid shell],
275 if test "$enableval" = "no"; then
276 AC_DEFINE(DISABLE_SHELLCHECK, 1)
277 AC_MSG_RESULT([disabling valid shell check])
281 AC_MSG_CHECKING([whether flock locks should be enabled])
282 AC_ARG_WITH(flock-locks,
283 [ --with-flock-locks enable flock locks support],
284 [flock_locks="$withval"],
287 if test "x$flock_locks" = "xyes"; then
288 AC_DEFINE(USE_FLOCK_LOCKS)
290 AC_MSG_RESULT([$flock_locks])
292 AC_ARG_WITH(tcp-wrappers,
293 [ --with-tcp-wrappers enable TCP wrappers support],
294 AC_CHECK_LIB(wrap, tcpd_warn,
296 AFPD_LIBS="$AFPD_LIBS -lwrap"
297 AC_MSG_RESULT([enabling TCP wrappers support])
301 AC_ARG_ENABLE(redhat,
302 [ --enable-redhat use redhat-style sysv configuration ],
303 if test "$enableval" = "yes"; then
306 AC_MSG_RESULT([enabling redhat-style sysv support])
310 [ --enable-suse use suse-style sysv configuration ],
311 if test "$enableval" = "yes"; then
314 AC_MSG_RESULT([enabling suse-style sysv support])
317 AC_ARG_ENABLE(cobalt,
318 [ --enable-cobalt use cobalt-style sysv configuration ],
319 if test "$enableval" = "yes"; then
322 AC_MSG_RESULT([enabling cobalt-style sysv support])
325 dnl ----- timelord compilation (disabled by default)
326 AC_MSG_CHECKING([whether timelord should be compiled])
328 AC_ARG_ENABLE(timelord,
329 [ --enable-timelord enable compilation of timelord server],
330 [compile_timelord="$enableval"],
331 [compile_timelord="no"]
333 AC_MSG_RESULT([$compile_timelord])
335 AC_ARG_WITH(uams-path,
336 [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]],
337 uams_path="$withval",
338 uams_path="${PKGCONFDIR}/uams"
341 dnl --------------------------------------------------------------------------
342 dnl FHS stuff has to be done last because it overrides other defaults
343 dnl --------------------------------------------------------------------------
346 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
347 if test "$enableval" = "yes"; then
348 uams_path="/usr/lib/netatalk"
350 PKGCONFDIR=${sysconfdir}/netatalk
352 mandir="/usr/share/man"
353 AC_DEFINE(FHS_COMPATIBILITY)
355 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
358 dnl --------------------------------------------------------------------------
359 dnl post-FHS substitutions, etc
360 dnl --------------------------------------------------------------------------
363 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
364 [path to UAMs [default=PKGCONF/uams]])
365 UAMS_PATH="${uams_path}"
368 dnl --------------------------------------------------------------------------
369 dnl drop in includes for top level directory structures here...
370 dnl --------------------------------------------------------------------------
372 dnl Note: $(top_srcdir)/include should be added before all other includes
373 dnl so that includes from that directory a preferred to includes from
374 dnl /usr/include or similar places.
375 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
376 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
378 dnl --------------------------------------------------------------------------
379 dnl specific configuration comes in here:
380 dnl --------------------------------------------------------------------------
382 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
384 dnl --------------------- determine operating system from "target"
386 *aix*) this_os=aix ;;
387 *freebsd*) this_os=freebsd ;;
388 *hpux11*) this_os=hpux11 ;;
389 *irix*) this_os=irix ;;
390 *linux*) this_os=linux ;;
391 *osx*) this_os=macosx ;;
392 *darwin*) this_os=macosx ;;
393 *netbsd*) this_os=netbsd ;;
394 *openbsd*) this_os=openbsd ;;
395 *osf*) this_os=tru64 ;;
396 *solaris*) this_os=solaris ;;
400 i386|i486|i586|i686|k7) this_cpu=x86 ;;
401 alpha) this_cpu=alpha ;;
402 mips) this_cpu=mips ;;
403 powerpc|ppc) this_cpu=ppc ;;
406 dnl --------------------- operating system specific flags (port from sys/*)
408 dnl ----- AIX specific -----
409 if test x"$this_os" = "xaix"; then
410 AC_MSG_RESULT([ * AIX specific configuration])
411 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
413 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
414 dnl compilation environment. It's enough to get things defined
415 dnl right in endian.h provided that long long is supported, though.
416 AC_DEFINE(HAVE_32BIT_LONGS)
419 dnl ----- FreeBSD specific -----
420 if test x"$this_os" = "xfreebsd"; then
421 AC_MSG_RESULT([ * FreeBSD specific configuration])
423 AC_DEFINE(SENDFILE_FLAVOR_BSD)
425 AC_DEFINE(NO_CRYPT_H, 1)
428 dnl ----- HP-UX 11 specific -----
429 if test x"$this_os" = "xhpux11"; then
430 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
432 AC_DEFINE(_ISOC9X_SOURCE)
433 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
436 dnl ----- IRIX specific -----
437 if test x"$this_os" = "xirix"; then
438 AC_MSG_RESULT([ * IRIX specific configuration])
440 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
443 dnl ----- Linux specific -----
444 if test x"$this_os" = "xlinux"; then
445 AC_MSG_RESULT([ * Linux specific configuration])
447 dnl ----- check if we need the quotactl wrapper
448 AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
449 AC_CHECK_FUNC(quotactl,,
450 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
451 AC_MSG_RESULT([enabling quotactl wrapper])
454 dnl ----- as far as I can tell, dbtob always does the wrong thing
455 dnl ----- on every single version of linux I've ever played with.
456 dnl ----- see etc/afpd/quota.c
457 AC_DEFINE(HAVE_BROKEN_DBTOB)
459 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
460 dnl ----- check if version is newer than 2.2.x
462 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
463 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
464 if [ $majorvers -ge 2 ]; then
465 if [ $minorvers -ge 2 ]; then
467 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
468 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
470 AC_MSG_RESULT([ * found Linux 2.0.x ])
474 dnl ----- Linux/alpha specific -----
475 if test x"$this_cpu" = "xalpha"; then
476 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
477 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
482 dnl ----- Mac OSX specific -----
483 if test x"$this_os" = "xmacosx"; then
484 AC_MSG_RESULT([ * Mac OSX specific configuration])
486 AC_DEFINE(HAVE_BROKEN_CPP)
487 AC_DEFINE(HAVE_2ARG_DBTOB)
488 dnl AC_DEFINE(NO_DLFCN_H)
489 AC_DEFINE(MACOSX_SERVER)
492 dnl ----- NetBSD specific -----
493 if test x"$this_os" = "xnetbsd"; then
494 AC_MSG_RESULT([ * NetBSD specific configuration])
496 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
497 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
500 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
501 AC_DEFINE(UAM_DHX, 1)
502 AC_DEFINE(NO_CRYPT_H, 1)
505 dnl ----- OpenBSD specific -----
506 if test x"$this_os" = "xopenbsd"; then
507 AC_MSG_RESULT([ * OpenBSD specific configuration])
509 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
511 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
512 AC_DEFINE(UAM_DHX, 1)
513 AC_DEFINE(NO_CRYPT_H, 1)
516 dnl ----- Solaris specific -----
517 if test x"$this_os" = "xsolaris"; then
518 AC_MSG_RESULT([ * Solaris specific configuration])
520 AC_DEFINE(_ISOC9X_SOURCE)
521 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
523 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
526 AC_MSG_RESULT([enabling Solaris kernel module build])
530 dnl ----- Tru64 specific -----
531 if test x"$this_os" = "xtru64"; then
532 AC_MSG_RESULT([ * Tru64 specific configuration])
534 AC_DEFINE(HAVE_64BIT_LONGS)
535 dnl AC_DEFINE(USE_MOUNT_H)
536 AC_DEFINE(USE_OLD_RQUOTA)
537 dnl AC_DEFINE(USE_UFS_QUOTA_H)
539 AC_CHECK_LIB(security,set_auth_parameters)
540 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
545 dnl -- look for openssl
548 dnl --------------------- check for building PGP UAM module
550 AC_ARG_ENABLE(pgp-uam,
551 [ --enable-pgp-uam enable build of PGP UAM module],
552 if test "$enableval" = "yes"; then
553 if test "$compile_ssl" = "yes"; then
554 AC_DEFINE(UAM_PGP, 1)
556 AC_MSG_RESULT([enabling build with PGP UAM module])
561 dnl --------------------- check for building Kerberos v4 UAM module
563 AC_ARG_ENABLE(krb4-uam,
564 [ --enable-krb4-uam enable build of Kerberos v4 UAM module],
565 if test "$enableval" = "yes"; then
566 AC_DEFINE(UAM_KRB4, 1)
568 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
571 dnl --------------------- overwrite the config files . . . or not.
573 AC_MSG_CHECKING([whether configuration files should be overwritten])
574 AC_ARG_ENABLE(overwrite,
575 [ --enable-overwrite overwrite configuration files during installation],
576 [OVERWRITE_CONFIG="${enable_overwrite}"],
577 [OVERWRITE_CONFIG="no"]
579 AC_MSG_RESULT([$OVERWRITE_CONFIG])
581 dnl --------------------- last minute substitutions
588 AC_SUBST(OVERWRITE_CONFIG)
590 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
591 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
592 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
593 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
594 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
595 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
596 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
597 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
598 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
599 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
600 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
601 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
602 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
604 dnl --------------------- generate files
608 bin/adv1tov2/Makefile
611 bin/afppasswd/Makefile
612 bin/getzones/Makefile
613 bin/megatron/Makefile
619 contrib/macusers/Makefile
621 contrib/printing/Makefile
622 contrib/shell_utils/Makefile
623 contrib/timelord/Makefile
625 distrib/config/Makefile
626 distrib/config/netatalk-config
627 distrib/initscripts/Makefile
632 etc/afpd/nls/Makefile
635 etc/uams/uams_krb4/Makefile
639 include/atalk/Makefile
641 libatalk/adouble/Makefile
642 libatalk/asp/Makefile
643 libatalk/atp/Makefile
644 libatalk/cnid/Makefile
645 libatalk/compat/Makefile
646 libatalk/dsi/Makefile
647 libatalk/nbp/Makefile
648 libatalk/netddp/Makefile
649 libatalk/util/Makefile
659 sys/generic/sys/Makefile
660 sys/netatalk/Makefile
662 sys/netbsd/netatalk/Makefile
667 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]