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_ARG_WITH(admin-group,
130 [ --with-admin-group=grp enable and set administrative group],
132 AC_DEFINE_UNQUOTED(ADMIN_GRP, "$admin_grp")
133 AC_MSG_RESULT([enabling administrative group "$admin_grp"]),
136 AC_ARG_WITH(auth-printing-dir,
137 [ --with-auth-printing-dir=path
138 path to authenticated printing directory],
140 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
142 AC_MSG_RESULT([enabling authenticated printing support]),
145 AC_ARG_WITH(config-dir,
146 [ --with-config-dir=path path to config files [default=/etc/atalk]],
147 config_dir="$withval",
148 config_dir="/etc/atalk"
150 AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
151 [path to config dir [default=/etc/atalk]])
152 CONFIG_DIR="$config_dir"
154 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
156 AC_ARG_WITH(cracklib,
157 [ --with-cracklib=dict enable/set location of cracklib dictionary],
159 AC_CHECK_LIB(crack, main,
160 AC_DEFINE(USE_CRACKLIB)
162 AC_MSG_RESULT([enabling cracklib support])
163 if test "$cracklib" = "yes"; then
164 cracklib="/usr/lib/cracklib_dict"
166 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
167 [path to cracklib dictionary])
168 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
169 AC_MSG_ERROR([cracklib not found!])
174 [ --disable-ddp disable DDP],
175 if test "$enableval" = "no"; then
177 AC_MSG_RESULT([disabling DDP])
182 [ --enable-debug enable debug code],
183 if test "$enableval" != "no"; then
184 if test "$enableval" = "yes"; then
187 AC_DEFINE_UNQUOTED(DEBUG, $enableval)
189 AC_MSG_RESULT([enabling debugging code])
196 dnl ----------- A NOTE ABOUT DROPKLUDGE
197 dnl The trouble with this fix is that if you know what the file is called, it
198 dnl can be read from the Unix side. That's okay for most academic institutions
199 dnl since the students don't have telnet access to the Mac servers. There is
200 dnl currently no one working on further development/fixes of DROPKLUDGE.
203 AC_ARG_ENABLE(dropkludge,
204 [ --enable-dropkludge enable the experimental dropbox fix (INSECURE!) ],
205 AC_DEFINE(DROPKLUDGE, 1)
206 AC_MSG_RESULT([enabling experimental dropbox support])
210 AC_ARG_WITH(message-dir,
211 [ --with-msg-dir=path path to message files [default=/etc/atalk/msg]],
213 if test x"$msg_dir" = "x"; then
214 msg_dir="$CONFIG_DIR/msg"
216 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
217 [path to message dir [default=$CONFIG_DIR/msg]])
218 SERVERTEXT="$msg_dir"
223 [ --with-pam enable password authentication modules support],
224 AC_CHECK_LIB(pam, main,
227 AC_MSG_RESULT([enabling pam modules support])
232 [ --with-shadow enable shadow password support],
233 AC_MSG_RESULT([enabling shadow password support])
237 AC_ARG_WITH(flock-locks,
238 [ --with-flock-locks enable flock locks support],
239 AC_MSG_RESULT([enabling flock locks])
240 AC_DEFINE(USE_FLOCK_LOCKS)
243 AC_ARG_WITH(tcp-wrappers,
244 [ --with-tcp-wrappers enable TCP wrappers support],
245 AC_CHECK_LIB(wrap, main,
248 AC_MSG_RESULT([enabling TCP wrappers support])
252 AC_ARG_WITH(uams-path,
253 [ --with-uams-path=path path to UAMs [default=/etc/atalk/uams]],
254 uams_path="$withval",
255 uams_path="/etc/atalk/uams"
257 AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
258 [path to UAMs [default=/etc/atalk/uams]])
259 UAMS_PATH="$uams_path"
262 dnl --------------------------------------------------------------------------
263 dnl drop in includes for top level directory structures here...
264 dnl --------------------------------------------------------------------------
265 LIBS="$LIBS -L\$(top_srcdir)/libatalk/"
266 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
268 dnl --------------------------------------------------------------------------
269 dnl specific configuration comes in here:
270 dnl --------------------------------------------------------------------------
272 dnl --------------------- determine operating system from "target"
273 case "$ac_cv_target_os" in
274 *freebsd*) this_os=freebsd ;;
275 *linux*) this_os=linux ;;
276 *osx*) this_os=macosx ;;
277 *netbsd*) this_os=netbsd ;;
278 *openbsd*) this_os=openbsd ;;
279 *solaris*) this_os=solaris ;;
282 case "$ac_cv_target_cpu" in
283 i386|i486|i586|i686|k7) this_cpu=x86 ;;
284 alpha) this_cpu=alpha ;;
285 mips) this_cpu=mips ;;
286 powerpc|ppc) this_cpu=ppc ;;
289 dnl --------------------- operating system specific flags (port from sys/*)
291 dnl ----- FreeBSD specific -----
292 if test x"$this_os" = "xfreebsd"; then
293 AC_MSG_RESULT([ * FreeBSD specific configuration])
295 AC_DEFINE(SENDFILE_FLAVOR_BSD)
298 dnl ----- Linux specific -----
299 if test x"$this_os" = "xlinux"; then
300 AC_MSG_RESULT([ * Linux specific configuration])
301 AC_DEFINE(SENDFILE_FLAVOR_LINUX)
303 dnl ----- check if we need the quotactl wrapper
304 AC_CHECK_HEADER(sys/quota.h,,
305 AC_MSG_RESULT([enabling quotactl wrapper])
306 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
309 dnl ----- Linux/alpha specific -----
310 if test x"$this_cpu" = "xalpha"; then
311 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
312 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
317 dnl ----- Mac OSX specific -----
318 if test x"$this_os" = "xmacosx"; then
319 AC_MSG_RESULT([ * Mac OSX specific configuration])
321 AC_DEFINE(HAVE_BROKEN_CPP)
322 AC_DEFINE(HAVE_2ARG_DBTOB)
323 AC_DEFINE(NO_DLFCN_H)
324 AC_DEFINE(MACOSX_SERVER)
327 dnl ----- NetBSD specific -----
328 if test x"$this_os" = "xnetbsd"; then
329 AC_MSG_RESULT([ * NetBSD specific configuration])
331 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
332 CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
336 dnl ----- OpenBSD specific -----
337 if test x"$this_os" = "xopenbsd"; then
338 AC_MSG_RESULT([ * OpenBSD specific configuration])
342 dnl ----- Solaris specific -----
343 if test x"$this_os" = "xsolaris"; then
344 AC_MSG_RESULT([ * Solaris specific configuration])
346 AC_DEFINE(_ISOC9X_SOURCE)
347 AC_DEFINE(NO_STRUCT_TM_GMTOFF)
352 dnl -- look for openssl
354 [ --with-ssl-dir=PATH Specify path to openssl installation (must contain lib and include dirs) ],
356 if test "x$withval" != "$xno"; then
362 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
363 if test -f "$ssldir/include/openssl/cast.h" ; then
364 LIBS="$LIBS -L$ssldir/lib -L$ssldir"
365 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
366 if test "$need_dash_r" = "yes"; then
367 LIBS="$LIBS -R$ssldir/lib -R$ssldir"
369 LIBS="$LIBS -lcrypto"
370 AC_DEFINE(OPENSSL_DHX, 1)
371 AC_DEFINE(UAM_DHX, 1)
372 AC_DEFINE(UAM_RNDNUM, 1)
374 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
379 dnl --------------------- last minute substitutions
383 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
385 dnl --------------------- generate files
389 bin/adv1tov2/Makefile
392 bin/afppasswd/Makefile
393 bin/getzones/Makefile
394 bin/megatron/Makefile
401 contrib/printing/Makefile
402 contrib/shell_utils/Makefile
403 contrib/timelord/Makefile
405 distrib/config/Makefile
406 distrib/config/netatalk-config
407 distrib/initscripts/Makefile
408 distrib/initscripts/rc.atalk.redhat
412 etc/afpd/nls/Makefile
418 include/atalk/Makefile
420 libatalk/adouble/Makefile
421 libatalk/asp/Makefile
422 libatalk/atp/Makefile
423 libatalk/compat/Makefile
424 libatalk/dsi/Makefile
425 libatalk/nbp/Makefile
426 libatalk/netddp/Makefile
427 libatalk/util/Makefile
434 sys/netatalk/Makefile
436 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]