1 dnl $Id: configure.in,v 1.94 2001-08-06 22:14:56 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 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 -lcom_err:
40 AC_CHECK_LIB(com_err, main)
41 dnl Replace `main' with a function in -lcrypt:
42 AC_CHECK_LIB(crypt, main)
43 dnl Replace `main' with a function in -ld:
45 dnl Replace `main' with a function in -ldb:
46 AC_CHECK_LIB(db, main)
47 dnl Replace `main' with a function in -ldl:
48 AC_CHECK_LIB(dl, main)
49 dnl Replace `main' with a function in -lkauth:
50 AC_CHECK_LIB(kauth, main)
51 dnl Replace `main' with a function in -lkrb:
52 AC_CHECK_LIB(krb, main)
53 dnl Replace `main' with a function in -llwp:
54 AC_CHECK_LIB(lwp, main)
55 dnl Replace `main' with a function in -ln:
57 dnl Replace `main' with a function in -lnsl:
58 AC_CHECK_LIB(nsl, main)
59 dnl Replace `main' with a function in -lprot:
60 AC_CHECK_LIB(prot, main)
61 dnl Replace `main' with a function in -lresolv:
62 AC_CHECK_LIB(resolv, main)
63 dnl Replace `main' with a function in -lrpcsvc:
64 AC_CHECK_LIB(rpcsvc, main)
65 dnl Replace `main' with a function in -lrx:
66 AC_CHECK_LIB(rx, main)
67 dnl Replace `main' with a function in -lrxkad:
68 AC_CHECK_LIB(rxkad, main)
69 dnl Replace `main' with a function in -lsocket:
70 AC_CHECK_LIB(socket, main)
71 dnl Replace `main' with a function in -lsys:
72 AC_CHECK_LIB(sys, main)
73 dnl Replace `main' with a function in -lubik:
74 AC_CHECK_LIB(ubik, main)
77 # Check presence of some functions
79 # Check for XPG4 access() function
80 # Be sure to test before adding AFS libs in LIBS path as AFS lib
81 # has such a function that works only on AFS filesystems.
82 AC_CHECK_FUNCS(access)
84 dnl Checks for header files.
88 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)
89 AC_CHECK_HEADER(sys/cdefs.h,,
90 AC_MSG_RESULT([enabling generic cdefs.h from tree])
91 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
94 # Allow user to specify flags
96 [ --with-cflags specify additional flags to pass to compiler],
98 if test "x$withval" != "xno" ; then
99 CFLAGS="$CFLAGS $withval"
104 [ --with-libs specify additional libraries to link with],
106 if test "x$withval" != "xno" ; then
107 LIBS="$LIBS $withval"
112 dnl Checks for typedefs, structures, and compiler characteristics.
124 dnl Checks for library functions.
126 AC_PROG_GCC_TRADITIONAL
133 AC_CHECK_FUNCS(flock getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul setpgrp)
136 dnl --------------------------------------------------------------------------
137 dnl specific configuration comes in here:
138 dnl --------------------------------------------------------------------------
140 AC_DEFINE(ADMIN_GRP, 1)
142 AC_ARG_WITH(admin-group,
143 [ --disable-admin-group disable admin group],
144 if test "$enableval" = "no"; then
145 AC_DEFINE(ADMIN_GRP, 0)
146 AC_MSG_RESULT([disabling administrative group support])
151 [ --enable-afs enable AFS support],
152 if test "$enableval" = "yes"; then
154 AC_MSG_RESULT([enabling AFS support])
158 AC_ARG_WITH(config-dir,
159 [ --with-config-dir=DIR obsolete - use --pkgconfdir],
160 sysconfdir="$withval",
161 if test "x$prefix" = "xNONE"; then
162 sysconfdir="$ac_default_prefix/etc"
164 sysconfdir="${prefix}/etc"
168 AC_ARG_WITH(pkgconfdir,
169 [ --with-pkgconfdir=DIR package specific configuration in DIR
170 [default=SYSCONF/netatalk]],
171 PKGCONFDIR="$withval",
172 PKGCONFDIR="${sysconfdir}/netatalk"
175 AC_ARG_WITH(cracklib,
176 [ --with-cracklib=dict enable/set location of cracklib dictionary],
177 if test "x$withval" != "xno" ; then
179 AC_CHECK_LIB(crack, main,
180 AC_DEFINE(USE_CRACKLIB)
182 AC_MSG_RESULT([enabling cracklib support])
183 if test "$cracklib" = "yes"; then
184 cracklib="/usr/lib/cracklib_dict"
186 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
187 [path to cracklib dictionary])
188 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
189 AC_MSG_ERROR([cracklib not found!])
195 [ --disable-ddp disable DDP],
196 if test "$enableval" = "no"; then
198 AC_MSG_RESULT([disabling DDP])
203 [ --enable-debug enable debug code],
204 if test "$enableval" != "no"; then
205 if test "$enableval" = "yes"; then
208 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
210 AC_MSG_RESULT([enabling debugging code])
217 dnl ----------- A NOTE ABOUT DROPKLUDGE
218 dnl The trouble with this fix is that if you know what the file is called, it
219 dnl can be read from the Unix side. That's okay for most academic institutions
220 dnl since the students don't have telnet access to the Mac servers. There is
221 dnl currently no one working on further development/fixes of DROPKLUDGE.
224 AC_ARG_ENABLE(dropkludge,
225 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
226 if test "$enableval" = "yes"; then
227 AC_DEFINE(DROPKLUDGE, 1)
228 AC_MSG_RESULT([enabling experimental dropbox support])
232 AC_ARG_ENABLE(force-uidgid,
233 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],
234 if test "$enableval" = "yes"; then
235 AC_DEFINE(FORCE_UIDGID, 1)
236 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
241 [ --with-did=[scheme] set DID scheme (last,mtab)],
242 if test "x$withval" != "xno" ; then
243 if test "$withval" = "last"; then
244 AC_DEFINE(USE_LASTDID, 1)
245 AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
247 if test "$withval" = "mtab"; then
248 AC_DEFINE(DID_MTAB, 1)
249 AC_MSG_RESULT([enabling mtab-based DID creation support])
255 AC_ARG_WITH(message-dir,
256 [ --with-msg-dir=path path to message files [default=$ac_prefix_default/etc/msg]],
258 if test x"$msg_dir" = "x"; then
259 msg_dir="${PKGCONFDIR}/msg"
261 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
262 [path to message dir [default=$ac_prefix_default/etc/msg]])
263 SERVERTEXT="$msg_dir"
267 AC_CHECK_LIB(pam, pam_start,
268 AC_DEFINE(USE_PAM, 1)
274 [ --without-pam disable password authentication modules support],
277 AC_DEFINE(USE_PAM, 0)
278 AC_MSG_RESULT([Disabling pam modules support])
280 if test "x$compile_pam" = "xyes"; then
282 AC_MSG_RESULT([Enabling pam modules support])
287 [ --with-shadow enable shadow password support],
288 AC_MSG_RESULT([enabling shadow password support])
293 AC_ARG_ENABLE(shell-check,
294 [ --disable-shell-check disable checking for a valid shell],
295 if test "$enableval" = "no"; then
296 AC_DEFINE(DISABLE_SHELLCHECK, 1)
297 AC_MSG_RESULT([disabling valid shell check])
301 AC_ARG_WITH(flock-locks,
302 [ --with-flock-locks enable flock locks support],
303 AC_MSG_RESULT([enabling flock locks])
304 AC_DEFINE(USE_FLOCK_LOCKS)
307 AC_ARG_WITH(tcp-wrappers,
308 [ --with-tcp-wrappers enable TCP wrappers support],
309 AC_CHECK_LIB(wrap, tcpd_warn,
311 AFPD_LIBS="$AFPD_LIBS -lwrap"
312 AC_MSG_RESULT([enabling TCP wrappers support])
316 AC_ARG_ENABLE(redhat,
317 [ --enable-redhat use redhat-style sysv configuration ],
318 if test "$enableval" = "yes"; then
321 AC_MSG_RESULT([enabling redhat-style sysv support])
325 [ --enable-suse use suse-style sysv configuration ],
326 if test "$enableval" = "yes"; then
329 AC_MSG_RESULT([enabling suse-style sysv support])
332 AC_ARG_ENABLE(cobalt,
333 [ --enable-cobalt use cobalt-style sysv configuration ],
334 if test "$enableval" = "yes"; then
337 AC_MSG_RESULT([enabling cobalt-style sysv support])
340 dnl ----- timelord compilation (disabled by default)
342 AC_ARG_ENABLE(timelord,
343 [ --enable-timelord enable compilation of timelord server],
344 if test "$enableval" = "yes"; then
347 AC_MSG_RESULT([enabling timelord compilation])
350 AC_ARG_WITH(uams-path,
351 [ --with-uams-path=path path to UAMs [default=PKGCONF/uams]],
352 uams_path="$withval",
353 uams_path="${PKGCONFDIR}/uams"
356 dnl --------------------------------------------------------------------------
357 dnl FHS stuff has to be done last because it overrides other defaults
358 dnl --------------------------------------------------------------------------
361 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
362 if test "$enableval" = "yes"; then
363 uams_path="/usr/lib/netatalk"
365 PKGCONFDIR=${sysconfdir}/netatalk
367 dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
368 AC_DEFINE(FHS_COMPATIBILITY)
370 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
373 dnl --------------------------------------------------------------------------
374 dnl post-FHS substitutions, etc
375 dnl --------------------------------------------------------------------------
378 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
379 [path to UAMs [default=PKGCONF/uams]])
380 UAMS_PATH="${uams_path}"
383 dnl --------------------------------------------------------------------------
384 dnl drop in includes for top level directory structures here...
385 dnl --------------------------------------------------------------------------
386 LDFLAGS="$LDFLAGS -L\$(top_srcdir)/libatalk/"
387 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
389 dnl --------------------------------------------------------------------------
390 dnl specific configuration comes in here:
391 dnl --------------------------------------------------------------------------
393 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
395 dnl --------------------- determine operating system from "target"
397 *aix*) this_os=aix ;;
398 *freebsd*) this_os=freebsd ;;
399 *hpux11*) this_os=hpux11 ;;
400 *irix*) this_os=irix ;;
401 *linux*) this_os=linux ;;
402 *osx*) this_os=macosx ;;
403 *netbsd*) this_os=netbsd ;;
404 *openbsd*) this_os=openbsd ;;
405 *osf*) this_os=tru64 ;;
406 *solaris*) this_os=solaris ;;
410 i386|i486|i586|i686|k7) this_cpu=x86 ;;
411 alpha) this_cpu=alpha ;;
412 mips) this_cpu=mips ;;
413 powerpc|ppc) this_cpu=ppc ;;
416 dnl --------------------- operating system specific flags (port from sys/*)
418 dnl ----- AIX specific -----
419 if test x"$this_os" = "xaix"; then
420 AC_MSG_RESULT([ * AIX specific configuration])
421 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
423 dnl This is probably a lie; AIX 4.3 supports a 64-bit long
424 dnl compilation environment. It's enough to get things defined
425 dnl right in endian.h provided that long long is supported, though.
426 AC_DEFINE(HAVE_32BIT_LONGS)
429 dnl ----- FreeBSD specific -----
430 if test x"$this_os" = "xfreebsd"; then
431 AC_MSG_RESULT([ * FreeBSD specific configuration])
433 AC_DEFINE(SENDFILE_FLAVOR_BSD)
435 dnl ----- Set -shared flag
436 LDSHAREDFLAGS="-shared"
437 AC_DEFINE(NO_CRYPT_H, 1)
440 dnl ----- HP-UX 11 specific -----
441 if test x"$this_os" = "xhpux11"; then
442 AC_MSG_RESULT([ * HP-UX 11 specific configuration])
444 AC_DEFINE(_ISOC9X_SOURCE)
445 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
448 dnl ----- IRIX specific -----
449 if test x"$this_os" = "xirix"; then
450 AC_MSG_RESULT([ * IRIX specific configuration])
452 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
455 dnl ----- Linux specific -----
456 if test x"$this_os" = "xlinux"; then
457 AC_MSG_RESULT([ * Linux specific configuration])
459 dnl ----- Set -shared flag
460 LDSHAREDFLAGS="-shared"
462 dnl ----- check if we need the quotactl wrapper
463 AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
464 AC_CHECK_FUNC(quotactl,,
465 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
466 AC_MSG_RESULT([enabling quotactl wrapper])
469 dnl ----- as far as I can tell, dbtob always does the wrong thing
470 dnl ----- on every single version of linux I've ever played with.
471 dnl ----- see etc/afpd/quota.c
472 AC_DEFINE(HAVE_BROKEN_DBTOB)
474 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
475 dnl ----- check if version is newer than 2.2.x
477 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
478 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
479 if [ $majorvers -ge 2 ]; then
480 if [ $minorvers -ge 2 ]; then
482 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
483 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
485 AC_MSG_RESULT([ * found Linux 2.0.x ])
489 dnl ----- Linux/alpha specific -----
490 if test x"$this_cpu" = "xalpha"; then
491 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
492 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
497 dnl ----- Mac OSX specific -----
498 if test x"$this_os" = "xmacosx"; then
499 AC_MSG_RESULT([ * Mac OSX specific configuration])
501 AC_DEFINE(HAVE_BROKEN_CPP)
502 AC_DEFINE(HAVE_2ARG_DBTOB)
503 dnl AC_DEFINE(NO_DLFCN_H)
504 AC_DEFINE(MACOSX_SERVER)
506 dnl ----- Set -shared flag
507 LDSHAREDFLAGS="-shared"
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 ----- Set -shared flag
519 LDSHAREDFLAGS="-shared"
521 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
522 AC_DEFINE(UAM_DHX, 1)
523 AC_DEFINE(UAM_RNDNUM, 1)
526 AC_DEFINE(NO_CRYPT_H, 1)
529 dnl ----- OpenBSD specific -----
530 if test x"$this_os" = "xopenbsd"; then
531 AC_MSG_RESULT([ * OpenBSD specific configuration])
533 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
535 dnl ----- Set -shared flag
536 LDSHAREDFLAGS="-Bforcearchive -shared"
538 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
539 AC_DEFINE(UAM_DHX, 1)
540 AC_DEFINE(UAM_RNDNUM, 1)
543 AC_DEFINE(NO_CRYPT_H, 1)
546 dnl ----- Solaris specific -----
547 if test x"$this_os" = "xsolaris"; then
548 AC_MSG_RESULT([ * Solaris specific configuration])
550 AC_DEFINE(_ISOC9X_SOURCE)
551 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
553 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
556 dnl ----- Set -shared flag
559 AC_MSG_RESULT([enabling Solaris kernel module build])
563 dnl ----- Tru64 specific -----
564 if test x"$this_os" = "xtru64"; then
565 AC_MSG_RESULT([ * Tru64 specific configuration])
567 AC_DEFINE(HAVE_64BIT_LONGS)
568 dnl AC_DEFINE(USE_MOUNT_H)
569 AC_DEFINE(USE_OLD_RQUOTA)
570 dnl AC_DEFINE(USE_UFS_QUOTA_H)
572 AC_CHECK_LIB(security,set_auth_parameters)
573 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
574 LDSHAREDFLAGS="-shared -expect_unresolved \*"
578 dnl ----- Set -shared flag
579 LDSHAREDFLAGS="-shared"
582 dnl -- look for openssl
584 [ --with-ssl-dir=PATH specify path to openssl installation (must contain
585 lib and include dirs) ],
587 if test "x$withval" != "xno"; then
593 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl/ /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
594 if test -f "$ssldir/include/openssl/cast.h" ; then
595 LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
596 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
597 if test "$need_dash_r" = "yes"; then
598 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
601 dnl Check for the crypto library:
602 AC_CHECK_LIB(crypto, main)
603 dnl LIBS="$LIBS -lcrypto"
604 dnl Check for "DES" library (for SSLeay, not openssl):
605 AC_CHECK_LIB(des, main)
607 AC_DEFINE(OPENSSL_DHX, 1)
608 AC_DEFINE(UAM_DHX, 1)
609 AC_DEFINE(UAM_RNDNUM, 1)
612 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
617 dnl --------------------- check for building PGP UAM module
619 AC_ARG_ENABLE(pgp-uam,
620 [ --enable-pgp-uam enable build of PGP UAM module],
621 if test "$enableval" = "yes"; then
622 if test "$compile_ssl" = "yes"; then
623 AC_DEFINE(UAM_PGP, 1)
625 AC_MSG_RESULT([enabling build with PGP UAM module])
630 dnl --------------------- last minute substitutions
637 AC_SUBST(LDSHAREDFLAGS)
641 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
642 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
643 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
644 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
645 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
646 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
647 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
648 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
649 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
650 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
651 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
652 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
653 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
655 dnl --------------------- generate files
659 bin/adv1tov2/Makefile
662 bin/afppasswd/Makefile
663 bin/getzones/Makefile
664 bin/megatron/Makefile
670 contrib/macusers/Makefile
672 contrib/printing/Makefile
673 contrib/shell_utils/Makefile
674 contrib/timelord/Makefile
676 distrib/config/Makefile
677 distrib/config/netatalk-config
678 distrib/initscripts/Makefile
683 etc/afpd/nls/Makefile
686 etc/uams/uams_krb4/Makefile
690 include/atalk/Makefile
692 libatalk/adouble/Makefile
693 libatalk/asp/Makefile
694 libatalk/atp/Makefile
695 libatalk/compat/Makefile
696 libatalk/dsi/Makefile
697 libatalk/nbp/Makefile
698 libatalk/netddp/Makefile
699 libatalk/util/Makefile
708 sys/generic/sys/Makefile
709 sys/netatalk/Makefile
711 sys/netbsd/netatalk/Makefile
716 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]