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)
75 dnl Checks for header files.
79 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)
80 AC_CHECK_HEADER(sys/cdefs.h,,
81 AC_MSG_RESULT([enabling generic cdefs.h from tree])
82 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
85 # Allow user to specify flags
87 [ --with-cflags specify additional flags to pass to compiler],
89 if test "x$withval" != "xno" ; then
90 CFLAGS="$CFLAGS $withval"
95 [ --with-libs specify additional libraries to link with],
97 if test "x$withval" != "xno" ; then
103 dnl Checks for typedefs, structures, and compiler characteristics.
115 dnl Checks for library functions.
117 AC_PROG_GCC_TRADITIONAL
124 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul setpgrp)
127 dnl --------------------------------------------------------------------------
128 dnl specific configuration comes in here:
129 dnl --------------------------------------------------------------------------
131 AC_DEFINE(ADMIN_GRP, 1)
133 AC_ARG_WITH(admin-group,
134 [ --disable-admin-group disable admin group],
135 if test "$enableval" = "no"; then
136 AC_DEFINE(ADMIN_GRP, 0)
137 AC_MSG_RESULT([disabling administrative group support])
141 AC_ARG_WITH(auth-printing-dir,
142 [ --with-auth-printing-dir=path
143 path to authenticated printing directory],
145 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
147 AC_MSG_RESULT([enabling authenticated printing support]),
150 AC_ARG_WITH(config-dir,
151 [ --with-config-dir=path path to config files [default=/etc/atalk]],
152 config_dir="$withval",
153 config_dir="/etc/atalk"
155 AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
156 [path to config dir [default=/etc/atalk]])
157 CONFIG_DIR="$config_dir"
159 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
161 AC_ARG_WITH(cracklib,
162 [ --with-cracklib=dict enable/set location of cracklib dictionary],
164 AC_CHECK_LIB(crack, main,
165 AC_DEFINE(USE_CRACKLIB)
167 AC_MSG_RESULT([enabling cracklib support])
168 if test "$cracklib" = "yes"; then
169 cracklib="/usr/lib/cracklib_dict"
171 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
172 [path to cracklib dictionary])
173 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
174 AC_MSG_ERROR([cracklib not found!])
179 [ --disable-ddp disable DDP],
180 if test "$enableval" = "no"; then
182 AC_MSG_RESULT([disabling DDP])
187 [ --enable-debug enable debug code],
188 if test "$enableval" != "no"; then
189 if test "$enableval" = "yes"; then
192 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
194 AC_MSG_RESULT([enabling debugging code])
201 dnl ----------- A NOTE ABOUT DROPKLUDGE
202 dnl The trouble with this fix is that if you know what the file is called, it
203 dnl can be read from the Unix side. That's okay for most academic institutions
204 dnl since the students don't have telnet access to the Mac servers. There is
205 dnl currently no one working on further development/fixes of DROPKLUDGE.
208 AC_ARG_ENABLE(dropkludge,
209 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
210 AC_DEFINE(DROPKLUDGE, 1)
211 AC_MSG_RESULT([enabling experimental dropbox support])
214 AC_ARG_ENABLE(lastdid,
215 [ --enable-lastdid enable build without DID dev/inode mapping kludge],
216 if test "$enableval" = "yes"; then
217 AC_DEFINE(USE_LASTDID, 1)
218 AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
223 AC_ARG_WITH(message-dir,
224 [ --with-msg-dir=path path to message files [default=/etc/atalk/msg]],
226 if test x"$msg_dir" = "x"; then
227 msg_dir="$CONFIG_DIR/msg"
229 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
230 [path to message dir [default=$CONFIG_DIR/msg]])
231 SERVERTEXT="$msg_dir"
236 [ --with-pam enable password authentication modules support],
237 AC_CHECK_LIB(pam, pam_start,
238 AC_DEFINE(USE_PAM, 1)
241 AC_MSG_RESULT([enabling pam modules support])
246 [ --with-shadow enable shadow password support],
247 AC_MSG_RESULT([enabling shadow password support])
251 AC_ARG_WITH(flock-locks,
252 [ --with-flock-locks enable flock locks support],
253 AC_MSG_RESULT([enabling flock locks])
254 AC_DEFINE(USE_FLOCK_LOCKS)
257 AC_ARG_WITH(tcp-wrappers,
258 [ --with-tcp-wrappers enable TCP wrappers support],
259 AC_CHECK_LIB(wrap, main,
262 AC_MSG_RESULT([enabling TCP wrappers support])
266 AC_ARG_ENABLE(redhat,
267 [ --enable-redhat use redhat-style sysv configuration ],
268 if test "$enableval" = "yes"; then
271 AC_MSG_RESULT([enabling redhat-style sysv support])
274 AC_ARG_ENABLE(cobalt,
275 [ --enable-cobalt use cobalt-style sysv configuration ],
276 if test "$enableval" = "yes"; then
279 AC_MSG_RESULT([enabling cobalt-style sysv support])
282 AC_ARG_WITH(uams-path,
283 [ --with-uams-path=path path to UAMs [default=/etc/atalk/uams]],
284 uams_path="$withval",
285 uams_path="/etc/atalk/uams"
287 AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
288 [path to UAMs [default=/etc/atalk/uams]])
289 UAMS_PATH="$uams_path"
292 dnl --------------------------------------------------------------------------
293 dnl drop in includes for top level directory structures here...
294 dnl --------------------------------------------------------------------------
295 LIBS="$LIBS -L\$(top_srcdir)/libatalk/"
296 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
298 dnl --------------------------------------------------------------------------
299 dnl specific configuration comes in here:
300 dnl --------------------------------------------------------------------------
302 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
304 dnl --------------------- determine operating system from "target"
306 *freebsd*) this_os=freebsd ;;
307 *linux*) this_os=linux ;;
308 *osx*) this_os=macosx ;;
309 *netbsd*) this_os=netbsd ;;
310 *openbsd*) this_os=openbsd ;;
311 *solaris*) this_os=solaris ;;
315 i386|i486|i586|i686|k7) this_cpu=x86 ;;
316 alpha) this_cpu=alpha ;;
317 mips) this_cpu=mips ;;
318 powerpc|ppc) this_cpu=ppc ;;
321 dnl --------------------- operating system specific flags (port from sys/*)
323 dnl ----- FreeBSD specific -----
324 if test x"$this_os" = "xfreebsd"; then
325 AC_MSG_RESULT([ * FreeBSD specific configuration])
327 AC_DEFINE(SENDFILE_FLAVOR_BSD)
330 dnl ----- Linux specific -----
331 if test x"$this_os" = "xlinux"; then
332 AC_MSG_RESULT([ * Linux specific configuration])
333 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
335 dnl ----- check if we need the quotactl wrapper
336 AC_CHECK_HEADER(sys/quota.h,,
337 AC_MSG_RESULT([enabling quotactl wrapper])
338 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
341 dnl ----- Linux/alpha specific -----
342 if test x"$this_cpu" = "xalpha"; then
343 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
344 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
349 dnl ----- Mac OSX specific -----
350 if test x"$this_os" = "xmacosx"; then
351 AC_MSG_RESULT([ * Mac OSX specific configuration])
353 AC_DEFINE(HAVE_BROKEN_CPP)
354 AC_DEFINE(HAVE_2ARG_DBTOB)
355 AC_DEFINE(NO_DLFCN_H)
356 AC_DEFINE(MACOSX_SERVER)
359 dnl ----- NetBSD specific -----
360 if test x"$this_os" = "xnetbsd"; then
361 AC_MSG_RESULT([ * NetBSD specific configuration])
363 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
364 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
368 dnl ----- OpenBSD specific -----
369 if test x"$this_os" = "xopenbsd"; then
370 AC_MSG_RESULT([ * OpenBSD specific configuration])
374 dnl ----- Solaris specific -----
375 if test x"$this_os" = "xsolaris"; then
376 AC_MSG_RESULT([ * Solaris specific configuration])
378 AC_DEFINE(_ISOC9X_SOURCE)
379 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
381 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
385 dnl -- look for openssl
387 [ --with-ssl-dir=PATH specify path to openssl installation (must contain
388 lib and include dirs) ],
390 if test "x$withval" != "$xno"; then
396 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
397 if test -f "$ssldir/include/openssl/cast.h" ; then
398 LIBS="$LIBS -L$ssldir/lib -L$ssldir"
399 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
400 if test "$need_dash_r" = "yes"; then
401 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
404 dnl Check for the crypto library:
405 AC_CHECK_LIB(crypto, main)
406 LIBS="$LIBS -lcrypto"
407 dnl Check for "DES" library (for SSLeay, not openssl):
408 AC_CHECK_LIB(des, main)
410 AC_DEFINE(OPENSSL_DHX, 1)
411 AC_DEFINE(UAM_DHX, 1)
412 AC_DEFINE(UAM_PGP, 1)
413 AC_DEFINE(UAM_RNDNUM, 1)
415 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
420 dnl --------------------- last minute substitutions
424 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
425 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
426 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
427 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
429 dnl --------------------- generate files
433 bin/adv1tov2/Makefile
436 bin/afppasswd/Makefile
437 bin/getzones/Makefile
438 bin/megatron/Makefile
445 contrib/printing/Makefile
446 contrib/shell_utils/Makefile
447 contrib/timelord/Makefile
449 distrib/config/Makefile
450 distrib/config/netatalk-config
451 distrib/initscripts/Makefile
455 etc/afpd/nls/Makefile
461 include/atalk/Makefile
463 libatalk/adouble/Makefile
464 libatalk/asp/Makefile
465 libatalk/atp/Makefile
466 libatalk/compat/Makefile
467 libatalk/dsi/Makefile
468 libatalk/nbp/Makefile
469 libatalk/netddp/Makefile
470 libatalk/util/Makefile
478 sys/netatalk/Makefile
480 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]