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)
12 dnl Reset locations to proper places
13 AC_PREFIX_DEFAULT(/usr)
15 dnl Checks for programs.
23 dnl *********************************************************************
24 dnl FIXME! FIXME! These should be selectable properly, and should produce
25 dnl the proper flags and defines...
26 dnl *********************************************************************
28 dnl Checks for libraries.
29 dnl Replace `main' with a function in -labs:
30 AC_CHECK_LIB(abs, main)
31 dnl Replace `main' with a function in -laudit:
32 AC_CHECK_LIB(audit, main)
33 dnl Replace `main' with a function in -lauth:
34 AC_CHECK_LIB(auth, main)
35 dnl Replace `main' with a function in -lcmd:
36 AC_CHECK_LIB(cmd, main)
37 dnl Replace `main' with a function in -lcom_err:
38 AC_CHECK_LIB(com_err, main)
39 dnl Replace `main' with a function in -lcrypt:
40 AC_CHECK_LIB(crypt, main)
41 dnl Replace `main' with a function in -lcrypto:
42 AC_CHECK_LIB(crypto, main)
43 dnl Replace `main' with a function in -ld:
45 dnl Replace `main' with a function in -ldb:
46 AC_CHECK_LIB(db, main)
47 dnl Replace `main' with a function in -ldes:
48 AC_CHECK_LIB(des, main)
49 dnl Replace `main' with a function in -ldl:
50 AC_CHECK_LIB(dl, main)
51 dnl Replace `main' with a function in -lkauth:
52 AC_CHECK_LIB(kauth, main)
53 dnl Replace `main' with a function in -lkrb:
54 AC_CHECK_LIB(krb, main)
55 dnl Replace `main' with a function in -llwp:
56 AC_CHECK_LIB(lwp, main)
57 dnl Replace `main' with a function in -ln:
59 dnl Replace `main' with a function in -lnsl:
60 AC_CHECK_LIB(nsl, main)
61 dnl Replace `main' with a function in -lprot:
62 AC_CHECK_LIB(prot, main)
63 dnl Replace `main' with a function in -lresolv:
64 AC_CHECK_LIB(resolv, main)
65 dnl Replace `main' with a function in -lrpcsvc:
66 AC_CHECK_LIB(rpcsvc, main)
67 dnl Replace `main' with a function in -lrx:
68 AC_CHECK_LIB(rx, main)
69 dnl Replace `main' with a function in -lrxkad:
70 AC_CHECK_LIB(rxkad, main)
71 dnl Replace `main' with a function in -lsocket:
72 AC_CHECK_LIB(socket, main)
73 dnl Replace `main' with a function in -lsys:
74 AC_CHECK_LIB(sys, main)
75 dnl Replace `main' with a function in -lubik:
76 AC_CHECK_LIB(ubik, main)
78 dnl Checks for header files.
82 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
84 # Allow user to specify flags
86 [ --with-cflags specify additional flags to pass to compiler],
88 if test "x$withval" != "xno" ; then
89 CFLAGS="$CFLAGS $withval"
94 [ --with-libs specify additional libraries to link with],
96 if test "x$withval" != "xno" ; then
102 dnl Checks for typedefs, structures, and compiler characteristics.
114 dnl Checks for library functions.
116 AC_PROG_GCC_TRADITIONAL
123 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul)
125 dnl --------------------------------------------------------------------------
126 dnl specific configuration comes in here:
127 dnl --------------------------------------------------------------------------
129 AC_DEFINE(ADMIN_GRP, 1)
131 AC_ARG_WITH(admin-group,
132 [ --disable-admin-group disable admin group],
133 if test "$enableval" = "no"; then
134 AC_DEFINE (ADMIN_GRP, 0)
135 AC_MSG_RESULT([disabling administrative group support]),
139 AC_ARG_WITH(auth-printing-dir,
140 [ --with-auth-printing-dir=path
141 path to authenticated printing directory],
143 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
145 AC_MSG_RESULT([enabling authenticated printing support]),
148 AC_ARG_WITH(config-dir,
149 [ --with-config-dir=path path to config files [default=/etc/atalk]],
150 config_dir="$withval",
151 config_dir="/etc/atalk"
153 AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
154 [path to config dir [default=/etc/atalk]])
155 CONFIG_DIR="$config_dir"
157 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
159 AC_ARG_WITH(cracklib,
160 [ --with-cracklib=dict enable/set location of cracklib dictionary],
162 AC_CHECK_LIB(crack, main,
163 AC_DEFINE(USE_CRACKLIB)
165 AC_MSG_RESULT([enabling cracklib support])
166 if test "$cracklib" = "yes"; then
167 cracklib="/usr/lib/cracklib_dict"
169 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
170 [path to cracklib dictionary])
171 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
172 AC_MSG_ERROR([cracklib not found!])
177 [ --disable-ddp disable DDP],
178 if test "$enableval" = "no"; then
180 AC_MSG_RESULT([disabling DDP])
185 [ --enable-debug enable debug code],
186 if test "$enableval" != "no"; then
187 if test "$enableval" = "yes"; then
190 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
192 AC_MSG_RESULT([enabling debugging code])
199 dnl ----------- A NOTE ABOUT DROPKLUDGE
200 dnl The trouble with this fix is that if you know what the file is called, it
201 dnl can be read from the Unix side. That's okay for most academic institutions
202 dnl since the students don't have telnet access to the Mac servers. There is
203 dnl currently no one working on further development/fixes of DROPKLUDGE.
206 AC_ARG_ENABLE(dropkludge,
207 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
208 AC_DEFINE(DROPKLUDGE, 1)
209 AC_MSG_RESULT([enabling experimental dropbox support])
212 AC_ARG_ENABLE(lastdid,
213 [ --enable-lastdid enable build without DID dev/inode mapping kludge],
214 if test "$enableval" = "yes"; then
215 AC_DEFINE(USE_LASTDID, 1)
216 AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
221 AC_ARG_WITH(message-dir,
222 [ --with-msg-dir=path path to message files [default=/etc/atalk/msg]],
224 if test x"$msg_dir" = "x"; then
225 msg_dir="$CONFIG_DIR/msg"
227 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
228 [path to message dir [default=$CONFIG_DIR/msg]])
229 SERVERTEXT="$msg_dir"
234 [ --with-pam enable password authentication modules support],
235 AC_CHECK_LIB(pam, main,
238 AC_MSG_RESULT([enabling pam modules support])
243 [ --with-shadow enable shadow password support],
244 AC_MSG_RESULT([enabling shadow password support])
248 AC_ARG_WITH(flock-locks,
249 [ --with-flock-locks enable flock locks support],
250 AC_MSG_RESULT([enabling flock locks])
251 AC_DEFINE(USE_FLOCK_LOCKS)
254 AC_ARG_WITH(tcp-wrappers,
255 [ --with-tcp-wrappers enable TCP wrappers support],
256 AC_CHECK_LIB(wrap, main,
259 AC_MSG_RESULT([enabling TCP wrappers support])
263 AC_ARG_WITH(uams-path,
264 [ --with-uams-path=path path to UAMs [default=/etc/atalk/uams]],
265 uams_path="$withval",
266 uams_path="/etc/atalk/uams"
268 AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
269 [path to UAMs [default=/etc/atalk/uams]])
270 UAMS_PATH="$uams_path"
273 dnl --------------------------------------------------------------------------
274 dnl drop in includes for top level directory structures here...
275 dnl --------------------------------------------------------------------------
276 LIBS="$LIBS -L\$(top_srcdir)/libatalk/"
277 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
279 dnl --------------------------------------------------------------------------
280 dnl specific configuration comes in here:
281 dnl --------------------------------------------------------------------------
283 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
285 dnl --------------------- determine operating system from "target"
287 *freebsd*) this_os=freebsd ;;
288 *linux*) this_os=linux ;;
289 *osx*) this_os=macosx ;;
290 *netbsd*) this_os=netbsd ;;
291 *openbsd*) this_os=openbsd ;;
292 *solaris*) this_os=solaris ;;
296 i386|i486|i586|i686|k7) this_cpu=x86 ;;
297 alpha) this_cpu=alpha ;;
298 mips) this_cpu=mips ;;
299 powerpc|ppc) this_cpu=ppc ;;
302 dnl --------------------- operating system specific flags (port from sys/*)
304 dnl ----- FreeBSD specific -----
305 if test x"$this_os" = "xfreebsd"; then
306 AC_MSG_RESULT([ * FreeBSD specific configuration])
308 AC_DEFINE(SENDFILE_FLAVOR_BSD)
311 dnl ----- Linux specific -----
312 if test x"$this_os" = "xlinux"; then
313 AC_MSG_RESULT([ * Linux specific configuration])
314 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
316 dnl ----- check if we need the quotactl wrapper
317 AC_CHECK_HEADER(sys/quota.h,,
318 AC_MSG_RESULT([enabling quotactl wrapper])
319 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
322 dnl ----- Linux/alpha specific -----
323 if test x"$this_cpu" = "xalpha"; then
324 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
325 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
330 dnl ----- Mac OSX specific -----
331 if test x"$this_os" = "xmacosx"; then
332 AC_MSG_RESULT([ * Mac OSX specific configuration])
334 AC_DEFINE(HAVE_BROKEN_CPP)
335 AC_DEFINE(HAVE_2ARG_DBTOB)
336 AC_DEFINE(NO_DLFCN_H)
337 AC_DEFINE(MACOSX_SERVER)
340 dnl ----- NetBSD specific -----
341 if test x"$this_os" = "xnetbsd"; then
342 AC_MSG_RESULT([ * NetBSD specific configuration])
344 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
345 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
349 dnl ----- OpenBSD specific -----
350 if test x"$this_os" = "xopenbsd"; then
351 AC_MSG_RESULT([ * OpenBSD specific configuration])
355 dnl ----- Solaris specific -----
356 if test x"$this_os" = "xsolaris"; then
357 AC_MSG_RESULT([ * Solaris specific configuration])
359 AC_DEFINE(_ISOC9X_SOURCE)
360 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
365 dnl -- look for openssl
367 [ --with-ssl-dir=PATH specify path to openssl installation (must contain
368 lib and include dirs) ],
370 if test "x$withval" != "$xno"; then
376 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
377 if test -f "$ssldir/include/openssl/cast.h" ; then
378 LIBS="$LIBS -L$ssldir/lib -L$ssldir"
379 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
380 if test "$need_dash_r" = "yes"; then
381 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
383 LIBS="$LIBS -lcrypto"
384 AC_DEFINE(OPENSSL_DHX, 1)
385 AC_DEFINE(UAM_DHX, 1)
386 AC_DEFINE(UAM_RNDNUM, 1)
388 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
393 dnl --------------------- last minute substitutions
397 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
399 dnl --------------------- generate files
403 bin/adv1tov2/Makefile
406 bin/afppasswd/Makefile
407 bin/getzones/Makefile
408 bin/megatron/Makefile
415 contrib/printing/Makefile
416 contrib/shell_utils/Makefile
417 contrib/timelord/Makefile
419 distrib/config/Makefile
420 distrib/config/netatalk-config
421 distrib/initscripts/Makefile
422 distrib/initscripts/rc.atalk.redhat
426 etc/afpd/nls/Makefile
432 include/atalk/Makefile
434 libatalk/adouble/Makefile
435 libatalk/asp/Makefile
436 libatalk/atp/Makefile
437 libatalk/compat/Makefile
438 libatalk/dsi/Makefile
439 libatalk/nbp/Makefile
440 libatalk/netddp/Makefile
441 libatalk/util/Makefile
448 sys/netatalk/Makefile
450 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]