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 -ldes:
47 AC_CHECK_LIB(des, main)
48 dnl Replace `main' with a function in -ldl:
49 AC_CHECK_LIB(dl, main)
50 dnl Replace `main' with a function in -lkauth:
51 AC_CHECK_LIB(kauth, main)
52 dnl Replace `main' with a function in -lkrb:
53 AC_CHECK_LIB(krb, main)
54 dnl Replace `main' with a function in -llwp:
55 AC_CHECK_LIB(lwp, main)
56 dnl Replace `main' with a function in -ln:
58 dnl Replace `main' with a function in -lnsl:
59 AC_CHECK_LIB(nsl, main)
60 dnl Replace `main' with a function in -lprot:
61 AC_CHECK_LIB(prot, main)
62 dnl Replace `main' with a function in -lresolv:
63 AC_CHECK_LIB(resolv, main)
64 dnl Replace `main' with a function in -lrpcsvc:
65 AC_CHECK_LIB(rpcsvc, main)
66 dnl Replace `main' with a function in -lrx:
67 AC_CHECK_LIB(rx, main)
68 dnl Replace `main' with a function in -lrxkad:
69 AC_CHECK_LIB(rxkad, main)
70 dnl Replace `main' with a function in -lsocket:
71 AC_CHECK_LIB(socket, main)
72 dnl Replace `main' with a function in -lsys:
73 AC_CHECK_LIB(sys, main)
74 dnl Replace `main' with a function in -lubik:
75 AC_CHECK_LIB(ubik, main)
77 dnl Checks for header files.
81 AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
82 AC_CHECK_HEADER(sys/cdefs.h,,
83 AC_MSG_RESULT([enabling generic cdefs.h from tree])
84 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
87 # Allow user to specify flags
89 [ --with-cflags specify additional flags to pass to compiler],
91 if test "x$withval" != "xno" ; then
92 CFLAGS="$CFLAGS $withval"
97 [ --with-libs specify additional libraries to link with],
99 if test "x$withval" != "xno" ; then
100 LIBS="$LIBS $withval"
105 dnl Checks for typedefs, structures, and compiler characteristics.
117 dnl Checks for library functions.
119 AC_PROG_GCC_TRADITIONAL
126 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul)
128 dnl --------------------------------------------------------------------------
129 dnl specific configuration comes in here:
130 dnl --------------------------------------------------------------------------
132 AC_DEFINE(ADMIN_GRP, 1)
134 AC_ARG_WITH(admin-group,
135 [ --disable-admin-group disable admin group],
136 if test "$enableval" = "no"; then
137 AC_DEFINE(ADMIN_GRP, 0)
138 AC_MSG_RESULT([disabling administrative group support])
142 AC_ARG_WITH(auth-printing-dir,
143 [ --with-auth-printing-dir=path
144 path to authenticated printing directory],
146 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
148 AC_MSG_RESULT([enabling authenticated printing support]),
151 AC_ARG_WITH(config-dir,
152 [ --with-config-dir=path path to config files [default=/etc/atalk]],
153 config_dir="$withval",
154 config_dir="/etc/atalk"
156 AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
157 [path to config dir [default=/etc/atalk]])
158 CONFIG_DIR="$config_dir"
160 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
162 AC_ARG_WITH(cracklib,
163 [ --with-cracklib=dict enable/set location of cracklib dictionary],
165 AC_CHECK_LIB(crack, main,
166 AC_DEFINE(USE_CRACKLIB)
168 AC_MSG_RESULT([enabling cracklib support])
169 if test "$cracklib" = "yes"; then
170 cracklib="/usr/lib/cracklib_dict"
172 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
173 [path to cracklib dictionary])
174 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
175 AC_MSG_ERROR([cracklib not found!])
180 [ --disable-ddp disable DDP],
181 if test "$enableval" = "no"; then
183 AC_MSG_RESULT([disabling DDP])
187 AC_ARG_ENABLE(force2GB,
188 [ --enable-force2GB enable force 2GB max reported volume size],
189 if test "x$enableval" = "xyes"; then
190 AC_DEFINE(FORCE_2GB, 1)
191 AC_MSG_RESULT([enable forge 2GB])
196 [ --enable-debug enable debug code],
197 if test "$enableval" != "no"; then
198 if test "$enableval" = "yes"; then
201 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
203 AC_MSG_RESULT([enabling debugging code])
210 dnl ----------- A NOTE ABOUT DROPKLUDGE
211 dnl The trouble with this fix is that if you know what the file is called, it
212 dnl can be read from the Unix side. That's okay for most academic institutions
213 dnl since the students don't have telnet access to the Mac servers. There is
214 dnl currently no one working on further development/fixes of DROPKLUDGE.
217 AC_ARG_ENABLE(dropkludge,
218 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
219 AC_DEFINE(DROPKLUDGE, 1)
220 AC_MSG_RESULT([enabling experimental dropbox support])
223 AC_ARG_ENABLE(lastdid,
224 [ --enable-lastdid enable build without DID dev/inode mapping kludge],
225 if test "$enableval" = "yes"; then
226 AC_DEFINE(USE_LASTDID, 1)
227 AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
232 AC_ARG_WITH(message-dir,
233 [ --with-msg-dir=path path to message files [default=/etc/atalk/msg]],
235 if test x"$msg_dir" = "x"; then
236 msg_dir="$CONFIG_DIR/msg"
238 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
239 [path to message dir [default=$CONFIG_DIR/msg]])
240 SERVERTEXT="$msg_dir"
245 [ --with-pam enable password authentication modules support],
246 AC_CHECK_LIB(pam, pam_start,
247 AC_DEFINE(USE_PAM, 1)
249 AC_MSG_RESULT([enabling pam modules support])
254 [ --with-shadow enable shadow password support],
255 AC_MSG_RESULT([enabling shadow password support])
259 AC_ARG_WITH(flock-locks,
260 [ --with-flock-locks enable flock locks support],
261 AC_MSG_RESULT([enabling flock locks])
262 AC_DEFINE(USE_FLOCK_LOCKS)
265 AC_ARG_WITH(tcp-wrappers,
266 [ --with-tcp-wrappers enable TCP wrappers support],
267 AC_CHECK_LIB(wrap, main,
270 AC_MSG_RESULT([enabling TCP wrappers support])
274 AC_ARG_WITH(uams-path,
275 [ --with-uams-path=path path to UAMs [default=/etc/atalk/uams]],
276 uams_path="$withval",
277 uams_path="/etc/atalk/uams"
279 AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
280 [path to UAMs [default=/etc/atalk/uams]])
281 UAMS_PATH="$uams_path"
284 dnl --------------------------------------------------------------------------
285 dnl drop in includes for top level directory structures here...
286 dnl --------------------------------------------------------------------------
287 LIBS="$LIBS -L\$(top_srcdir)/libatalk/"
288 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
290 dnl --------------------------------------------------------------------------
291 dnl specific configuration comes in here:
292 dnl --------------------------------------------------------------------------
294 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
296 dnl --------------------- determine operating system from "target"
298 *freebsd*) this_os=freebsd ;;
299 *linux*) this_os=linux ;;
300 *osx*) this_os=macosx ;;
301 *netbsd*) this_os=netbsd ;;
302 *openbsd*) this_os=openbsd ;;
303 *solaris*) this_os=solaris ;;
307 i386|i486|i586|i686|k7) this_cpu=x86 ;;
308 alpha) this_cpu=alpha ;;
309 mips) this_cpu=mips ;;
310 powerpc|ppc) this_cpu=ppc ;;
313 dnl --------------------- operating system specific flags (port from sys/*)
315 dnl ----- FreeBSD specific -----
316 if test x"$this_os" = "xfreebsd"; then
317 AC_MSG_RESULT([ * FreeBSD specific configuration])
319 AC_DEFINE(SENDFILE_FLAVOR_BSD)
322 dnl ----- Linux specific -----
323 if test x"$this_os" = "xlinux"; then
324 AC_MSG_RESULT([ * Linux specific configuration])
325 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
327 dnl ----- check if we need the quotactl wrapper
328 AC_CHECK_HEADER(sys/quota.h,,
329 AC_MSG_RESULT([enabling quotactl wrapper])
330 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
333 dnl ----- Linux/alpha specific -----
334 if test x"$this_cpu" = "xalpha"; then
335 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
336 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
341 dnl ----- Mac OSX specific -----
342 if test x"$this_os" = "xmacosx"; then
343 AC_MSG_RESULT([ * Mac OSX specific configuration])
345 AC_DEFINE(HAVE_BROKEN_CPP)
346 AC_DEFINE(HAVE_2ARG_DBTOB)
347 AC_DEFINE(NO_DLFCN_H)
348 AC_DEFINE(MACOSX_SERVER)
351 dnl ----- NetBSD specific -----
352 if test x"$this_os" = "xnetbsd"; then
353 AC_MSG_RESULT([ * NetBSD specific configuration])
355 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
356 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
360 dnl ----- OpenBSD specific -----
361 if test x"$this_os" = "xopenbsd"; then
362 AC_MSG_RESULT([ * OpenBSD specific configuration])
366 dnl ----- Solaris specific -----
367 if test x"$this_os" = "xsolaris"; then
368 AC_MSG_RESULT([ * Solaris specific configuration])
370 AC_DEFINE(_ISOC9X_SOURCE)
371 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
376 dnl -- look for openssl
378 [ --with-ssl-dir=PATH specify path to openssl installation (must contain
379 lib and include dirs) ],
381 if test "x$withval" != "$xno"; then
387 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
388 if test -f "$ssldir/include/openssl/cast.h" ; then
389 LIBS="$LIBS -L$ssldir/lib -L$ssldir"
390 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
391 if test "$need_dash_r" = "yes"; then
392 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
394 dnl Replace `main' with a function in -lcrypto:
395 AC_CHECK_LIB(crypto, main)
397 LIBS="$LIBS -lcrypto"
398 AC_DEFINE(OPENSSL_DHX, 1)
399 AC_DEFINE(UAM_DHX, 1)
400 AC_DEFINE(UAM_RNDNUM, 1)
402 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
407 dnl --------------------- last minute substitutions
411 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
413 dnl --------------------- generate files
417 bin/adv1tov2/Makefile
420 bin/afppasswd/Makefile
421 bin/getzones/Makefile
422 bin/megatron/Makefile
429 contrib/printing/Makefile
430 contrib/shell_utils/Makefile
431 contrib/timelord/Makefile
433 distrib/config/Makefile
434 distrib/config/netatalk-config
435 distrib/initscripts/Makefile
439 etc/afpd/nls/Makefile
445 include/atalk/Makefile
447 libatalk/adouble/Makefile
448 libatalk/asp/Makefile
449 libatalk/atp/Makefile
450 libatalk/compat/Makefile
451 libatalk/dsi/Makefile
452 libatalk/nbp/Makefile
453 libatalk/netddp/Makefile
454 libatalk/util/Makefile
462 sys/netatalk/Makefile
464 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]