1 dnl configure.in for netatalk
3 AC_INIT(bin/adv1tov2/adv1tov2.c)
5 NETATALK_VERSION=`cat VERSION`
6 AC_SUBST(NETATALK_VERSION)
9 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
10 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 syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.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(auth-printing-dir,
158 [ --with-auth-printing-dir=path
159 path to authenticated printing directory],
161 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
163 AC_MSG_RESULT([enabling authenticated printing support]),
166 AC_ARG_WITH(config-dir,
167 [ --with-config-dir=path path to config files [default=$ac_default_prefix/etc]],
168 config_dir="$withval",
169 config_dir="${prefix}/etc"
172 AC_ARG_WITH(cracklib,
173 [ --with-cracklib=dict enable/set location of cracklib dictionary],
175 AC_CHECK_LIB(crack, main,
176 AC_DEFINE(USE_CRACKLIB)
178 AC_MSG_RESULT([enabling cracklib support])
179 if test "$cracklib" = "yes"; then
180 cracklib="/usr/lib/cracklib_dict"
182 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
183 [path to cracklib dictionary])
184 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
185 AC_MSG_ERROR([cracklib not found!])
190 [ --disable-ddp disable DDP],
191 if test "$enableval" = "no"; then
193 AC_MSG_RESULT([disabling DDP])
198 [ --enable-debug enable debug code],
199 if test "$enableval" != "no"; then
200 if test "$enableval" = "yes"; then
203 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
205 AC_MSG_RESULT([enabling debugging code])
212 dnl ----------- A NOTE ABOUT DROPKLUDGE
213 dnl The trouble with this fix is that if you know what the file is called, it
214 dnl can be read from the Unix side. That's okay for most academic institutions
215 dnl since the students don't have telnet access to the Mac servers. There is
216 dnl currently no one working on further development/fixes of DROPKLUDGE.
219 AC_ARG_ENABLE(dropkludge,
220 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
221 if test "$enableval" = "yes"; then
222 AC_DEFINE(DROPKLUDGE, 1)
223 AC_MSG_RESULT([enabling experimental dropbox support])
227 AC_ARG_ENABLE(force-uidgid,
228 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],
229 if test "$enableval" = "yes"; then
230 AC_DEFINE(FORCE_UIDGID, 1)
231 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
235 AC_ARG_ENABLE(lastdid,
236 [ --enable-lastdid enable build without DID dev/inode mapping kludge],
237 if test "$enableval" = "yes"; then
238 AC_DEFINE(USE_LASTDID, 1)
239 AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
244 AC_ARG_WITH(message-dir,
245 [ --with-msg-dir=path path to message files [default=$ac_default_prefix/etc/msg]],
247 if test x"$msg_dir" = "x"; then
248 msg_dir="${prefix}/etc/msg"
250 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
251 [path to message dir [default=$ac_default_prefix/etc/msg]])
252 SERVERTEXT="$msg_dir"
256 AC_CHECK_LIB(pam, pam_start,
257 AC_DEFINE(USE_PAM, 1)
261 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
264 [ --with-pam enable password authentication modules support],
265 if test "x$compile_pam" = "xyes"; then
267 AC_MSG_RESULT([enabling pam modules support])
269 AC_MSG_RESULT([pam libraries not found. Disabling pam modules support])
275 [ --with-shadow enable shadow password support],
276 AC_MSG_RESULT([enabling shadow password support])
281 AC_ARG_ENABLE(shell-check,
282 [ --disable-shell-check disable checking for a valid shell]
283 if test "$enableval" = "no"; then
284 AC_DEFINE(DISABLE_SHELLCHECK, 1)
285 AC_MSG_RESULT([disabling valid shell check])
289 AC_ARG_WITH(flock-locks,
290 [ --with-flock-locks enable flock locks support],
291 AC_MSG_RESULT([enabling flock locks])
292 AC_DEFINE(USE_FLOCK_LOCKS)
295 AC_ARG_WITH(tcp-wrappers,
296 [ --with-tcp-wrappers enable TCP wrappers support],
297 AC_CHECK_LIB(wrap, hosts_access,
300 AC_MSG_RESULT([enabling TCP wrappers support])
304 AC_ARG_ENABLE(redhat,
305 [ --enable-redhat use redhat-style sysv configuration ],
306 if test "$enableval" = "yes"; then
309 AC_MSG_RESULT([enabling redhat-style sysv support])
313 [ --enable-suse use suse-style sysv configuration ],
314 if test "$enableval" = "yes"; then
317 AC_MSG_RESULT([enabling suse-style sysv support])
320 AC_ARG_ENABLE(cobalt,
321 [ --enable-cobalt use cobalt-style sysv configuration ],
322 if test "$enableval" = "yes"; then
325 AC_MSG_RESULT([enabling cobalt-style sysv support])
328 AC_ARG_WITH(uams-path,
329 [ --with-uams-path=path path to UAMs [default=$ac_default_prefix/etc/uams]],
330 uams_path="$withval",
331 uams_path="${config_dir}/uams"
334 dnl --------------------------------------------------------------------------
335 dnl FHS stuff has to be done last because it overrides other defaults
336 dnl --------------------------------------------------------------------------
339 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
340 if test "$enableval" = "yes"; then
341 uams_path="/usr/lib/netatalk"
342 config_dir="/etc/netatalk"
344 dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
345 AC_DEFINE(FHS_COMPATIBILITY)
347 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
350 dnl --------------------------------------------------------------------------
351 dnl post-FHS substitutions, etc
352 dnl --------------------------------------------------------------------------
355 AC_DEFINE_UNQUOTED(CONFIG_DIR, "${config_dir}",
356 [path to config dir [default=$ac_default_prefix/etc]])
357 CONFIG_DIR="${config_dir}"
359 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
362 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
363 [path to UAMs [default=$ac_default_prefix/etc/uams]])
364 UAMS_PATH="${uams_path}"
367 dnl --------------------------------------------------------------------------
368 dnl drop in includes for top level directory structures here...
369 dnl --------------------------------------------------------------------------
370 LDFLAGS="$LDFLAGS -L\$(top_srcdir)/libatalk/"
371 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
373 dnl --------------------------------------------------------------------------
374 dnl specific configuration comes in here:
375 dnl --------------------------------------------------------------------------
377 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
379 dnl --------------------- determine operating system from "target"
381 *freebsd*) this_os=freebsd ;;
382 *linux*) this_os=linux ;;
383 *osx*) this_os=macosx ;;
384 *netbsd*) this_os=netbsd ;;
385 *openbsd*) this_os=openbsd ;;
386 *osf*) this_os=tru64 ;;
387 *solaris*) this_os=solaris ;;
391 i386|i486|i586|i686|k7) this_cpu=x86 ;;
392 alpha) this_cpu=alpha ;;
393 mips) this_cpu=mips ;;
394 powerpc|ppc) this_cpu=ppc ;;
397 dnl --------------------- operating system specific flags (port from sys/*)
399 dnl ----- FreeBSD specific -----
400 if test x"$this_os" = "xfreebsd"; then
401 AC_MSG_RESULT([ * FreeBSD specific configuration])
403 AC_DEFINE(SENDFILE_FLAVOR_BSD)
405 dnl ----- Set -shared flag
406 LDSHAREDFLAGS="-shared"
409 dnl ----- Linux specific -----
410 if test x"$this_os" = "xlinux"; then
411 AC_MSG_RESULT([ * Linux specific configuration])
413 dnl ----- Set -shared flag
414 LDSHAREDFLAGS="-shared"
416 dnl ----- check if we need the quotactl wrapper
417 AC_CHECK_HEADER(sys/quota.h,,
418 AC_MSG_RESULT([enabling quotactl wrapper])
419 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
422 dnl ----- as far as I can tell, dbtob always does the wrong thing
423 dnl ----- on every single version of linux I've ever played with.
424 dnl ----- see etc/afpd/quota.c
425 AC_DEFINE(HAVE_BROKEN_DBTOB)
427 dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
428 dnl ----- check if version is newer than 2.2.x
430 majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
431 minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
432 if [ $majorvers -ge 2 ]; then
433 if [ $minorvers -ge 2 ]; then
435 AC_MSG_RESULT([ * found Linux 2.2.x or higher])
436 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
438 AC_MSG_RESULT([ * found Linux 2.0.x ])
442 dnl ----- Linux/alpha specific -----
443 if test x"$this_cpu" = "xalpha"; then
444 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
445 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
450 dnl ----- Mac OSX specific -----
451 if test x"$this_os" = "xmacosx"; then
452 AC_MSG_RESULT([ * Mac OSX specific configuration])
454 AC_DEFINE(HAVE_BROKEN_CPP)
455 AC_DEFINE(HAVE_2ARG_DBTOB)
456 AC_DEFINE(NO_DLFCN_H)
457 AC_DEFINE(MACOSX_SERVER)
459 dnl ----- Set -shared flag
460 LDSHAREDFLAGS="-shared"
463 dnl ----- NetBSD specific -----
464 if test x"$this_os" = "xnetbsd"; then
465 AC_MSG_RESULT([ * NetBSD specific configuration])
467 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
468 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
471 dnl ----- Set -shared flag
472 LDSHAREDFLAGS="-shared"
474 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
475 AC_DEFINE(UAM_DHX, 1)
476 AC_DEFINE(UAM_RNDNUM, 1)
479 AC_DEFINE(NO_CRYPT_H, 1)
482 dnl ----- OpenBSD specific -----
483 if test x"$this_os" = "xopenbsd"; then
484 AC_MSG_RESULT([ * OpenBSD specific configuration])
486 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
488 dnl ----- Set -shared flag
489 LDSHAREDFLAGS="-Bforcearchive -shared"
491 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
492 AC_DEFINE(UAM_DHX, 1)
493 AC_DEFINE(UAM_RNDNUM, 1)
496 AC_DEFINE(NO_CRYPT_H, 1)
499 dnl ----- Solaris specific -----
500 if test x"$this_os" = "xsolaris"; then
501 AC_MSG_RESULT([ * Solaris specific configuration])
503 AC_DEFINE(_ISOC9X_SOURCE)
504 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
506 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
509 dnl ----- Set -shared flag
512 AC_MSG_RESULT([enabling Solaris kernel module build])
516 dnl ----- Tru64 specific -----
517 if test x"$this_os" = "xtru64"; then
518 AC_MSG_RESULT([ * Tru64 specific configuration])
520 AC_DEFINE(HAVE_64BIT_LONGS)
521 AC_DEFINE(USE_MOUNT_H)
522 AC_DEFINE(USE_OLD_RQUOTA)
523 AC_DEFINE(USE_UFS_QUOTA_H)
525 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
526 LDSHAREDFLAGS="-shared -expect_unresolved \*"
530 dnl ----- Set -shared flag
531 LDSHAREDFLAGS="-shared"
534 dnl -- look for openssl
536 [ --with-ssl-dir=PATH specify path to openssl installation (must contain
537 lib and include dirs) ],
539 if test "x$withval" != "$xno"; then
545 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
546 if test -f "$ssldir/include/openssl/cast.h" ; then
547 LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
548 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
549 if test "$need_dash_r" = "yes"; then
550 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
553 dnl Check for the crypto library:
554 AC_CHECK_LIB(crypto, main)
555 dnl LIBS="$LIBS -lcrypto"
556 dnl Check for "DES" library (for SSLeay, not openssl):
557 AC_CHECK_LIB(des, main)
559 AC_DEFINE(OPENSSL_DHX, 1)
560 AC_DEFINE(UAM_DHX, 1)
561 AC_DEFINE(UAM_RNDNUM, 1)
564 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
569 dnl --------------------- check for building PGP UAM module
571 AC_ARG_ENABLE(pgp-uam,
572 [ --enable-pgp-uam enable build of PGP UAM module],
573 if test "$enableval" = "yes"; then
574 if test "$compile_ssl" = "yes"; then
575 AC_DEFINE(UAM_PGP, 1)
577 AC_MSG_RESULT([enabling build with PGP UAM module])
582 dnl --------------------- last minute substitutions
586 AC_SUBST(LDSHAREDFLAGS)
587 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
588 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
589 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
590 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
591 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
592 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
593 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
594 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
595 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
596 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
597 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
599 dnl --------------------- generate files
603 bin/adv1tov2/Makefile
606 bin/afppasswd/Makefile
607 bin/getzones/Makefile
608 bin/megatron/Makefile
615 contrib/printing/Makefile
616 contrib/shell_utils/Makefile
617 contrib/timelord/Makefile
619 distrib/config/Makefile
620 distrib/config/netatalk-config
621 distrib/initscripts/Makefile
626 etc/afpd/nls/Makefile
629 etc/uams/uams_krb4/Makefile
633 include/atalk/Makefile
635 libatalk/adouble/Makefile
636 libatalk/asp/Makefile
637 libatalk/atp/Makefile
638 libatalk/compat/Makefile
639 libatalk/dsi/Makefile
640 libatalk/nbp/Makefile
641 libatalk/netddp/Makefile
642 libatalk/util/Makefile
650 sys/netatalk/Makefile
652 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]