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)
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/file.h sys/ioctl.h sys/time.h syslog.h unistd.h termios.h netdb.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])
149 AC_ARG_WITH(auth-printing-dir,
150 [ --with-auth-printing-dir=path
151 path to authenticated printing directory],
153 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
155 AC_MSG_RESULT([enabling authenticated printing support]),
158 AC_ARG_WITH(config-dir,
159 [ --with-config-dir=path path to config files [default=/etc/atalk]],
160 config_dir="$withval",
161 config_dir="/etc/atalk"
164 AC_ARG_WITH(cracklib,
165 [ --with-cracklib=dict enable/set location of cracklib dictionary],
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!])
182 [ --disable-ddp disable DDP],
183 if test "$enableval" = "no"; then
185 AC_MSG_RESULT([disabling DDP])
190 [ --enable-debug enable debug code],
191 if test "$enableval" != "no"; then
192 if test "$enableval" = "yes"; then
195 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
197 AC_MSG_RESULT([enabling debugging code])
204 dnl ----------- A NOTE ABOUT DROPKLUDGE
205 dnl The trouble with this fix is that if you know what the file is called, it
206 dnl can be read from the Unix side. That's okay for most academic institutions
207 dnl since the students don't have telnet access to the Mac servers. There is
208 dnl currently no one working on further development/fixes of DROPKLUDGE.
211 AC_ARG_ENABLE(dropkludge,
212 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
213 if test "$enableval" = "yes"; then
214 AC_DEFINE(DROPKLUDGE, 1)
215 AC_MSG_RESULT([enabling experimental dropbox support])
219 AC_ARG_ENABLE(force-uidgid,
220 [ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],
221 if test "$enableval" = "yes"; then
222 AC_DEFINE(FORCE_UIDGID, 1)
223 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
227 AC_ARG_ENABLE(lastdid,
228 [ --enable-lastdid enable build without DID dev/inode mapping kludge],
229 if test "$enableval" = "yes"; then
230 AC_DEFINE(USE_LASTDID, 1)
231 AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
236 AC_ARG_WITH(message-dir,
237 [ --with-msg-dir=path path to message files [default=/etc/atalk/msg]],
239 if test x"$msg_dir" = "x"; then
240 msg_dir="$CONFIG_DIR/msg"
242 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
243 [path to message dir [default=$CONFIG_DIR/msg]])
244 SERVERTEXT="$msg_dir"
248 AC_CHECK_LIB(pam, pam_start,
249 AC_DEFINE(USE_PAM, 1)
253 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
256 [ --with-pam enable password authentication modules support],
257 if test "x$compile_pam" = "xyes"; then
259 AC_MSG_RESULT([enabling pam modules support])
261 AC_MSG_RESULT([pam libraries not found. Disabling pam modules support])
267 [ --with-shadow enable shadow password support],
268 AC_MSG_RESULT([enabling shadow password support])
273 AC_ARG_WITH(flock-locks,
274 [ --with-flock-locks enable flock locks support],
275 AC_MSG_RESULT([enabling flock locks])
276 AC_DEFINE(USE_FLOCK_LOCKS)
279 AC_ARG_WITH(tcp-wrappers,
280 [ --with-tcp-wrappers enable TCP wrappers support],
281 AC_CHECK_LIB(wrap, main,
284 AC_MSG_RESULT([enabling TCP wrappers support])
288 AC_ARG_ENABLE(redhat,
289 [ --enable-redhat use redhat-style sysv configuration ],
290 if test "$enableval" = "yes"; then
293 AC_MSG_RESULT([enabling redhat-style sysv support])
297 [ --enable-suse use suse-style sysv configuration ],
298 if test "$enableval" = "yes"; then
301 AC_MSG_RESULT([enabling suse-style sysv support])
304 AC_ARG_ENABLE(cobalt,
305 [ --enable-cobalt use cobalt-style sysv configuration ],
306 if test "$enableval" = "yes"; then
309 AC_MSG_RESULT([enabling cobalt-style sysv support])
312 AC_ARG_WITH(uams-path,
313 [ --with-uams-path=path path to UAMs [default=/etc/atalk/uams]],
314 uams_path="$withval",
315 uams_path="$config_dir/uams"
318 dnl --------------------------------------------------------------------------
319 dnl FHS stuff has to be done last because it overrides other defaults
320 dnl --------------------------------------------------------------------------
323 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],
324 if test "$enableval" = "yes"; then
325 uams_path="/usr/lib/netatalk"
326 config_dir="/etc/netatalk"
328 dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
329 AC_DEFINE(FHS_COMPATIBILITY)
331 AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
334 dnl --------------------------------------------------------------------------
335 dnl post-FHS substitutions, etc
336 dnl --------------------------------------------------------------------------
339 AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
340 [path to config dir [default=/etc/atalk]])
341 CONFIG_DIR="$config_dir"
343 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
346 AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
347 [path to UAMs [default=/etc/atalk/uams]])
348 UAMS_PATH="$uams_path"
351 dnl --------------------------------------------------------------------------
352 dnl drop in includes for top level directory structures here...
353 dnl --------------------------------------------------------------------------
354 LDFLAGS="$LDFLAGS -L\$(top_srcdir)/libatalk/"
355 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
357 dnl --------------------------------------------------------------------------
358 dnl specific configuration comes in here:
359 dnl --------------------------------------------------------------------------
361 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
363 dnl --------------------- determine operating system from "target"
365 *freebsd*) this_os=freebsd ;;
366 *linux*) this_os=linux ;;
367 *osx*) this_os=macosx ;;
368 *netbsd*) this_os=netbsd ;;
369 *openbsd*) this_os=openbsd ;;
370 *osf*) this_os=tru64 ;;
371 *solaris*) this_os=solaris ;;
375 i386|i486|i586|i686|k7) this_cpu=x86 ;;
376 alpha) this_cpu=alpha ;;
377 mips) this_cpu=mips ;;
378 powerpc|ppc) this_cpu=ppc ;;
381 dnl --------------------- operating system specific flags (port from sys/*)
383 dnl ----- FreeBSD specific -----
384 if test x"$this_os" = "xfreebsd"; then
385 AC_MSG_RESULT([ * FreeBSD specific configuration])
387 AC_DEFINE(SENDFILE_FLAVOR_BSD)
390 dnl ----- Linux specific -----
391 if test x"$this_os" = "xlinux"; then
392 AC_MSG_RESULT([ * Linux specific configuration])
393 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
395 dnl ----- check if we need the quotactl wrapper
396 AC_CHECK_HEADER(sys/quota.h,,
397 AC_MSG_RESULT([enabling quotactl wrapper])
398 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
401 dnl ----- Linux/alpha specific -----
402 if test x"$this_cpu" = "xalpha"; then
403 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
404 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
409 dnl ----- Mac OSX specific -----
410 if test x"$this_os" = "xmacosx"; then
411 AC_MSG_RESULT([ * Mac OSX specific configuration])
413 AC_DEFINE(HAVE_BROKEN_CPP)
414 AC_DEFINE(HAVE_2ARG_DBTOB)
415 AC_DEFINE(NO_DLFCN_H)
416 AC_DEFINE(MACOSX_SERVER)
419 dnl ----- NetBSD specific -----
420 if test x"$this_os" = "xnetbsd"; then
421 AC_MSG_RESULT([ * NetBSD specific configuration])
423 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
424 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
428 dnl ----- OpenBSD specific -----
429 if test x"$this_os" = "xopenbsd"; then
430 AC_MSG_RESULT([ * OpenBSD specific configuration])
434 dnl ----- Solaris specific -----
435 if test x"$this_os" = "xsolaris"; then
436 AC_MSG_RESULT([ * Solaris specific configuration])
438 AC_DEFINE(_ISOC9X_SOURCE)
439 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
441 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
443 AC_MSG_RESULT([enabling Solaris kernel module build])
447 dnl ----- Tru64 specific -----
448 if test x"$this_os" = "xtru64"; then
449 AC_MSG_RESULT([ * Tru64 specific configuration])
451 AC_DEFINE(HAVE_64BIT_LONGS)
452 AC_DEFINE(USE_MOUNT_H)
453 AC_DEFINE(USE_OLD_RQUOTA)
454 AC_DEFINE(USE_UFS_QUOTA_H)
456 CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
457 LDSHAREDFLAGS="-expect_unresolved \*"
462 dnl -- look for openssl
464 [ --with-ssl-dir=PATH specify path to openssl installation (must contain
465 lib and include dirs) ],
467 if test "x$withval" != "$xno"; then
473 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl/ /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
474 if test -f "$ssldir/include/openssl/cast.h" ; then
475 LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
476 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
477 if test "$need_dash_r" = "yes"; then
478 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
481 dnl Check for the crypto library:
482 AC_CHECK_LIB(crypto, main)
483 dnl LIBS="$LIBS -lcrypto"
484 dnl Check for "DES" library (for SSLeay, not openssl):
485 AC_CHECK_LIB(des, main)
487 AC_DEFINE(OPENSSL_DHX, 1)
488 AC_DEFINE(UAM_DHX, 1)
489 dnl AC_DEFINE(UAM_PGP, 1)
490 AC_DEFINE(UAM_RNDNUM, 1)
493 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
498 dnl --------------------- last minute substitutions
502 AC_SUBST(LDSHAREDFLAGS)
503 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
504 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
505 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
506 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
507 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
508 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
509 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
510 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
511 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
512 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
514 dnl --------------------- generate files
518 bin/adv1tov2/Makefile
521 bin/afppasswd/Makefile
522 bin/getzones/Makefile
523 bin/megatron/Makefile
530 contrib/printing/Makefile
531 contrib/shell_utils/Makefile
532 contrib/timelord/Makefile
534 distrib/config/Makefile
535 distrib/config/netatalk-config
536 distrib/initscripts/Makefile
540 etc/afpd/nls/Makefile
546 include/atalk/Makefile
548 libatalk/adouble/Makefile
549 libatalk/asp/Makefile
550 libatalk/atp/Makefile
551 libatalk/compat/Makefile
552 libatalk/dsi/Makefile
553 libatalk/nbp/Makefile
554 libatalk/netddp/Makefile
555 libatalk/util/Makefile
563 sys/netatalk/Makefile
565 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]