1 dnl $Id: configure.in,v 1.82 2001-06-07 15:39:27 rufustfirefly 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.
24 dnl *********************************************************************
25 dnl FIXME! FIXME! These should be selectable properly, and should produce
26 dnl the proper flags and defines...
27 dnl *********************************************************************
29 dnl Checks for libraries.
30 dnl Replace `main' with a function in -labs:
31 AC_CHECK_LIB(abs, main)
32 dnl Replace `main' with a function in -laudit:
33 AC_CHECK_LIB(audit, main)
34 dnl Replace `main' with a function in -lauth:
35 AC_CHECK_LIB(auth, main)
36 dnl Replace `main' with a function in -lcmd:
37 AC_CHECK_LIB(cmd, main)
38 dnl Replace `main' with a function in -lcom_err:
39 AC_CHECK_LIB(com_err, main)
40 dnl Replace `main' with a function in -lcrypt:
41 AC_CHECK_LIB(crypt, main)
42 dnl Replace `main' with a function in -ld:
44 dnl Replace `main' with a function in -ldb:
45 AC_CHECK_LIB(db, main)
46 dnl Replace `main' with a function in -ldl:
47 AC_CHECK_LIB(dl, main)
48 dnl Replace `main' with a function in -lkauth:
49 AC_CHECK_LIB(kauth, main)
50 dnl Replace `main' with a function in -lkrb:
51 AC_CHECK_LIB(krb, main)
52 dnl Replace `main' with a function in -llwp:
53 AC_CHECK_LIB(lwp, main)
54 dnl Replace `main' with a function in -ln:
56 dnl Replace `main' with a function in -lnsl:
57 AC_CHECK_LIB(nsl, main)
58 dnl Replace `main' with a function in -lprot:
59 AC_CHECK_LIB(prot, main)
60 dnl Replace `main' with a function in -lresolv:
61 AC_CHECK_LIB(resolv, main)
62 dnl Replace `main' with a function in -lrpcsvc:
63 AC_CHECK_LIB(rpcsvc, main)
64 dnl Replace `main' with a function in -lrx:
65 AC_CHECK_LIB(rx, main)
66 dnl Replace `main' with a function in -lrxkad:
67 AC_CHECK_LIB(rxkad, main)
68 dnl Replace `main' with a function in -lsocket:
69 AC_CHECK_LIB(socket, main)
70 dnl Replace `main' with a function in -lsys:
71 AC_CHECK_LIB(sys, main)
72 dnl Replace `main' with a function in -lubik:
73 AC_CHECK_LIB(ubik, main)
76 # Check presence of some functions
78 # Check for XPG4 access() function
79 # Be sure to test before adding AFS libs in LIBS path as AFS lib
80 # has such a function that works only on AFS filesystems.
81 AC_CHECK_FUNCS(access)
83 dnl Checks for header files.
87 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)
88 AC_CHECK_HEADER(sys/cdefs.h,,
89 AC_MSG_RESULT([enabling generic cdefs.h from tree])
90 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
93 # Allow user to specify flags
95 [ --with-cflags specify additional flags to pass to compiler],
97 if test "x$withval" != "xno" ; then
98 CFLAGS="$CFLAGS $withval"
103 [ --with-libs specify additional libraries to link with],
105 if test "x$withval" != "xno" ; then
106 LIBS="$LIBS $withval"
111 dnl Checks for typedefs, structures, and compiler characteristics.
123 dnl Checks for library functions.
125 AC_PROG_GCC_TRADITIONAL
132 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul setpgrp)
135 dnl --------------------------------------------------------------------------
136 dnl specific configuration comes in here:
137 dnl --------------------------------------------------------------------------
139 AC_DEFINE(ADMIN_GRP, 1)
141 AC_ARG_WITH(admin-group,
142 [ --disable-admin-group disable admin group],
143 if test "$enableval" = "no"; then
144 AC_DEFINE(ADMIN_GRP, 0)
145 AC_MSG_RESULT([disabling administrative group support])
150 [ --enable-afs enable AFS support],
151 if test "$enableval" = "yes"; then
153 AC_MSG_RESULT([enabling AFS support])
157 AC_ARG_WITH(config-dir,
158 [ --with-config-dir=path path to config files [default=$ac_prefix_default/etc]],
159 sysconfdir="$withval",
160 sysconfdir="${prefix}/etc"
163 AC_ARG_WITH(cracklib,
164 [ --with-cracklib=dict enable/set location of cracklib dictionary],
165 if test "x$withval" != "xno" ; then
167 AC_CHECK_LIB(crack, main,
168 AC_DEFINE(USE_CRACKLIB)
170 AC_MSG_RESULT([enabling cracklib support])
171 if test "$cracklib" = "yes"; then
172 cracklib="/usr/lib/cracklib_dict"
174 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
175 [path to cracklib dictionary])
176 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
177 AC_MSG_ERROR([cracklib not found!])
183 [ --disable-ddp disable DDP],
184 if test "$enableval" = "no"; then
186 AC_MSG_RESULT([disabling DDP])
191 [ --enable-debug enable debug code],
192 if test "$enableval" != "no"; then
193 if test "$enableval" = "yes"; then
196 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
198 AC_MSG_RESULT([enabling debugging code])
205 dnl ----------- A NOTE ABOUT DROPKLUDGE
206 dnl The trouble with this fix is that if you know what the file is called, it
207 dnl can be read from the Unix side. That's okay for most academic institutions
208 dnl since the students don't have telnet access to the Mac servers. There is
209 dnl currently no one working on further development/fixes of DROPKLUDGE.
212 AC_ARG_ENABLE(dropkludge,
213 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
214 if test "$enableval" = "yes"; then
215 AC_DEFINE(DROPKLUDGE, 1)
216 AC_MSG_RESULT([enabling experimental dropbox support])
220 AC_ARG_ENABLE(force-uidgid,
221 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],
222 if test "$enableval" = "yes"; then
223 AC_DEFINE(FORCE_UIDGID, 1)
224 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
229 [ --with-did=[scheme] set DID scheme (last,mtab)],
230 if test "x$withval" != "xno" ; then
231 if test "$withval" = "lastdid"; then
232 AC_DEFINE(USE_LASTDID, 1)
233 AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
235 if test "$withval" = "mtab"; then
236 AC_DEFINE(DID_MTAB, 1)
237 AC_MSG_RESULT([enabling mtab-based DID creation support])
243 AC_ARG_WITH(message-dir,
244 [ --with-msg-dir=path path to message files [default=$ac_prefix_default/etc/msg]],
246 if test x"$msg_dir" = "x"; then
247 msg_dir="${prefix}/etc/msg"
249 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
250 [path to message dir [default=$ac_prefix_default/etc/msg]])
251 SERVERTEXT="$msg_dir"
255 AC_CHECK_LIB(pam, pam_start,
256 AC_DEFINE(USE_PAM, 1)
260 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
263 [ --with-pam enable password authentication modules support],
264 if test "x$compile_pam" = "xyes"; then
266 AC_MSG_RESULT([enabling pam modules support])
268 AC_MSG_RESULT([pam libraries not found. Disabling pam modules support])
274 [ --with-shadow enable shadow password support],
275 AC_MSG_RESULT([enabling shadow password support])
280 AC_ARG_ENABLE(shell-check,
281 [ --disable-shell-check disable checking for a valid shell],
282 if test "$enableval" = "no"; then
283 AC_DEFINE(DISABLE_SHELLCHECK, 1)
284 AC_MSG_RESULT([disabling valid shell check])
288 AC_ARG_WITH(flock-locks,
289 [ --with-flock-locks enable flock locks support],
290 AC_MSG_RESULT([enabling flock locks])
291 AC_DEFINE(USE_FLOCK_LOCKS)
294 AC_ARG_WITH(tcp-wrappers,
295 [ --with-tcp-wrappers enable TCP wrappers support],
296 AC_CHECK_LIB(wrap, tcpd_warn,
298 AFPD_LIBS="$AFPD_LIBS -lwrap"
299 AC_MSG_RESULT([enabling TCP wrappers support])
303 AC_ARG_ENABLE(redhat,
304 [ --enable-redhat use redhat-style sysv configuration ],
305 if test "$enableval" = "yes"; then
308 AC_MSG_RESULT([enabling redhat-style sysv support])
312 [ --enable-suse use suse-style sysv configuration ],
313 if test "$enableval" = "yes"; then
316 AC_MSG_RESULT([enabling suse-style sysv support])
319 AC_ARG_ENABLE(cobalt,
320 [ --enable-cobalt use cobalt-style sysv configuration ],
321 if test "$enableval" = "yes"; then
324 AC_MSG_RESULT([enabling cobalt-style sysv support])
327 dnl ----- timelord compilation (disabled by default)
329 AC_ARG_ENABLE(timelord,
330 [ --enable-timelord enable compilation of timelord server],
331 if test "$enableval" = "yes"; then
334 AC_MSG_RESULT([enabling timelord compilation])
337 AC_ARG_WITH(uams-path,
338 [ --with-uams-path=path path to UAMs [default=$ac_prefix_default/etc/uams]],
339 uams_path="$withval",
340 uams_path="${config_dir}/uams"
343 dnl --------------------------------------------------------------------------
344 dnl FHS stuff has to be done last because it overrides other defaults
345 dnl --------------------------------------------------------------------------
348 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
349 if test "$enableval" = "yes"; then
350 uams_path="/usr/lib/netatalk"
351 sysconfdir="/etc/netatalk"
353 dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
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=$ac_prefix_default/etc/uams]])
366 UAMS_PATH="${uams_path}"
369 dnl --------------------------------------------------------------------------
370 dnl drop in includes for top level directory structures here...
371 dnl --------------------------------------------------------------------------
372 LDFLAGS="$LDFLAGS -L\$(top_srcdir)/libatalk/"
373 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
375 dnl --------------------------------------------------------------------------
376 dnl specific configuration comes in here:
377 dnl --------------------------------------------------------------------------
379 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
381 dnl --------------------- determine operating system from "target"
383 *freebsd*) this_os=freebsd ;;
384 *linux*) this_os=linux ;;
385 *osx*) this_os=macosx ;;
386 *netbsd*) this_os=netbsd ;;
387 *openbsd*) this_os=openbsd ;;
388 *osf*) this_os=tru64 ;;
389 *solaris*) this_os=solaris ;;
393 i386|i486|i586|i686|k7) this_cpu=x86 ;;
394 alpha) this_cpu=alpha ;;
395 mips) this_cpu=mips ;;
396 powerpc|ppc) this_cpu=ppc ;;
399 dnl --------------------- operating system specific flags (port from sys/*)
401 dnl ----- FreeBSD specific -----
402 if test x"$this_os" = "xfreebsd"; then
403 AC_MSG_RESULT([ * FreeBSD specific configuration])
405 AC_DEFINE(SENDFILE_FLAVOR_BSD)
407 dnl ----- Set -shared flag
408 LDSHAREDFLAGS="-shared"
411 dnl ----- Linux specific -----
412 if test x"$this_os" = "xlinux"; then
413 AC_MSG_RESULT([ * Linux specific configuration])
415 dnl ----- Set -shared flag
416 LDSHAREDFLAGS="-shared"
418 dnl ----- check if we need the quotactl wrapper
419 AC_CHECK_HEADER(sys/quota.h,,
420 AC_MSG_RESULT([enabling quotactl wrapper])
421 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
424 dnl ----- as far as I can tell, dbtob always does the wrong thing
425 dnl ----- on every single version of linux I've ever played with.
426 dnl ----- see etc/afpd/quota.c
427 AC_DEFINE(HAVE_BROKEN_DBTOB)
429 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
430 dnl ----- check if version is newer than 2.2.x
432 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
433 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
434 if [ $majorvers -ge 2 ]; then
435 if [ $minorvers -ge 2 ]; then
437 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
438 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
440 AC_MSG_RESULT([ * found Linux 2.0.x ])
444 dnl ----- Linux/alpha specific -----
445 if test x"$this_cpu" = "xalpha"; then
446 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
447 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
452 dnl ----- Mac OSX specific -----
453 if test x"$this_os" = "xmacosx"; then
454 AC_MSG_RESULT([ * Mac OSX specific configuration])
456 AC_DEFINE(HAVE_BROKEN_CPP)
457 AC_DEFINE(HAVE_2ARG_DBTOB)
458 AC_DEFINE(NO_DLFCN_H)
459 AC_DEFINE(MACOSX_SERVER)
461 dnl ----- Set -shared flag
462 LDSHAREDFLAGS="-shared"
465 dnl ----- NetBSD specific -----
466 if test x"$this_os" = "xnetbsd"; then
467 AC_MSG_RESULT([ * NetBSD specific configuration])
469 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
470 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
473 dnl ----- Set -shared flag
474 LDSHAREDFLAGS="-shared"
476 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
477 AC_DEFINE(UAM_DHX, 1)
478 AC_DEFINE(UAM_RNDNUM, 1)
481 AC_DEFINE(NO_CRYPT_H, 1)
484 dnl ----- OpenBSD specific -----
485 if test x"$this_os" = "xopenbsd"; then
486 AC_MSG_RESULT([ * OpenBSD specific configuration])
488 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
490 dnl ----- Set -shared flag
491 LDSHAREDFLAGS="-Bforcearchive -shared"
493 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
494 AC_DEFINE(UAM_DHX, 1)
495 AC_DEFINE(UAM_RNDNUM, 1)
498 AC_DEFINE(NO_CRYPT_H, 1)
501 dnl ----- Solaris specific -----
502 if test x"$this_os" = "xsolaris"; then
503 AC_MSG_RESULT([ * Solaris specific configuration])
505 AC_DEFINE(_ISOC9X_SOURCE)
506 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
508 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
511 dnl ----- Set -shared flag
514 AC_MSG_RESULT([enabling Solaris kernel module build])
518 dnl ----- Tru64 specific -----
519 if test x"$this_os" = "xtru64"; then
520 AC_MSG_RESULT([ * Tru64 specific configuration])
522 AC_DEFINE(HAVE_64BIT_LONGS)
523 dnl AC_DEFINE(USE_MOUNT_H)
524 AC_DEFINE(USE_OLD_RQUOTA)
525 dnl AC_DEFINE(USE_UFS_QUOTA_H)
527 AC_CHECK_LIB(security,set_auth_parameters)
528 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
529 LDSHAREDFLAGS="-shared -expect_unresolved \*"
533 dnl ----- Set -shared flag
534 LDSHAREDFLAGS="-shared"
537 dnl -- look for openssl
539 [ --with-ssl-dir=PATH specify path to openssl installation (must contain
540 lib and include dirs) ],
542 if test "x$withval" != "xno"; then
548 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
549 if test -f "$ssldir/include/openssl/cast.h" ; then
550 LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
551 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
552 if test "$need_dash_r" = "yes"; then
553 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
556 dnl Check for the crypto library:
557 AC_CHECK_LIB(crypto, main)
558 dnl LIBS="$LIBS -lcrypto"
559 dnl Check for "DES" library (for SSLeay, not openssl):
560 AC_CHECK_LIB(des, main)
562 AC_DEFINE(OPENSSL_DHX, 1)
563 AC_DEFINE(UAM_DHX, 1)
564 AC_DEFINE(UAM_RNDNUM, 1)
567 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
572 dnl --------------------- check for building PGP UAM module
574 AC_ARG_ENABLE(pgp-uam,
575 [ --enable-pgp-uam enable build of PGP UAM module],
576 if test "$enableval" = "yes"; then
577 if test "$compile_ssl" = "yes"; then
578 AC_DEFINE(UAM_PGP, 1)
580 AC_MSG_RESULT([enabling build with PGP UAM module])
585 dnl --------------------- last minute substitutions
592 AC_SUBST(LDSHAREDFLAGS)
594 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
595 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
596 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
597 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
598 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
599 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
600 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
601 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
602 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
603 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
604 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
605 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
607 dnl --------------------- generate files
611 bin/adv1tov2/Makefile
614 bin/afppasswd/Makefile
615 bin/getzones/Makefile
616 bin/megatron/Makefile
622 contrib/macusers/Makefile
624 contrib/printing/Makefile
625 contrib/shell_utils/Makefile
626 contrib/timelord/Makefile
628 distrib/config/Makefile
629 distrib/config/netatalk-config
630 distrib/initscripts/Makefile
635 etc/afpd/nls/Makefile
638 etc/uams/uams_krb4/Makefile
642 include/atalk/Makefile
644 libatalk/adouble/Makefile
645 libatalk/asp/Makefile
646 libatalk/atp/Makefile
647 libatalk/compat/Makefile
648 libatalk/dsi/Makefile
649 libatalk/nbp/Makefile
650 libatalk/netddp/Makefile
651 libatalk/util/Makefile
659 sys/netatalk/Makefile
661 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]