]> arthur.barton.de Git - netatalk.git/blob - configure.in
only compile cnid_metad and cnid_dbd daemons if --with-cnid-dbd-* has been configured
[netatalk.git] / configure.in
1 dnl $Id: configure.in,v 1.179.2.3.2.5 2003-09-20 02:54:51 bfernhomberg Exp $
2 dnl configure.in for netatalk
3
4 AC_INIT(bin/adv1tov2/adv1tov2.c)
5
6 NETATALK_VERSION=`cat $srcdir/VERSION`
7 AC_SUBST(NETATALK_VERSION)
8
9 AC_CANONICAL_SYSTEM
10 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
11 AM_CONFIG_HEADER(config.h)
12
13 dnl Checks for programs.
14 AC_PROG_AWK
15 AC_PROG_CC
16 AC_PROG_INSTALL
17 AC_PROG_LN_S
18 AC_PROG_MAKE_SET
19 AC_LIBTOOL_DLOPEN
20 AM_PROG_LIBTOOL
21 AC_PROG_PERL
22 AC_PROG_GREP
23 AC_PROG_PS
24
25 dnl *********************************************************************
26 dnl FIXME! FIXME! These should be selectable properly, and should produce
27 dnl the proper flags and defines...
28 dnl *********************************************************************
29
30 ############################################
31 # we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
32 #AC_SEARCH_LIBS(dlopen, [dl])
33 # dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
34
35 dnl Checks for libraries.
36 dnl Replace `main' with a function in -labs:
37 dnl AC_CHECK_LIB(abs, main)
38 dnl Replace `main' with a function in -laudit:
39 dnl AC_CHECK_LIB(audit, main)
40 dnl Replace `main' with a function in -lauth:
41 dnl AC_CHECK_LIB(auth, main)
42 dnl Replace `main' with a function in -lcmd:
43 dnl AC_CHECK_LIB(cmd, main)
44 dnl Replace `main' with a function in -lcrypt:
45 dnl AC_CHECK_LIB(crypt, main)
46 dnl Replace `main' with a function in -ld:
47 dnl AC_CHECK_LIB(d, main)
48 dnl Replace `main' with a function in -ldl:
49 AC_CHECK_LIB(dl, dlopen)
50 dnl Replace `main' with a function in -lkauth:
51 dnl AC_CHECK_LIB(kauth, main)
52 dnl Replace `main' with a function in -lkrb:
53 dnl AC_CHECK_LIB(krb, main)
54 dnl Replace `main' with a function in -llwp:
55 dnl AC_CHECK_LIB(lwp, main)
56 dnl Replace `main' with a function in -ln:
57 dnl AC_CHECK_LIB(n, main)
58 dnl Replace `main' with a function in -lnsl:
59 AC_CHECK_LIB(nsl, socket)
60 dnl Replace `main' with a function in -lprot:
61 dnl AC_CHECK_LIB(prot, main)
62 dnl Replace `main' with a function in -lrx:
63 dnl AC_CHECK_LIB(rx, main)
64 dnl Replace `main' with a function in -lrxkad:
65 dnl AC_CHECK_LIB(rxkad, main)
66 dnl Replace `main' with a function in -lsocket:
67 AC_CHECK_LIB(socket, socket)
68 dnl Replace `main' with a function in -lsys:
69 dnl AC_CHECK_LIB(sys, main)
70 dnl Replace `main' with a function in -lubik:
71 dnl AC_CHECK_LIB(ubik, main)
72
73 AC_MSG_RESULT([    LIBS = $LIBS])
74
75 #
76 # Check presence of some functions
77 #
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)
82
83 AC_CHECK_FUNCS(pread pwrite)
84
85 dnl Checks for header files.
86 AC_HEADER_DIRENT
87 AC_HEADER_STDC
88 AC_HEADER_SYS_WAIT
89 AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h sys/uio.h)
90 AC_CHECK_HEADER(sys/cdefs.h,,
91         AC_MSG_RESULT([enabling generic cdefs.h from tree])
92         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
93 )
94 AC_CHECK_HEADERS(langinfo.h locale.h)
95
96 dnl Checks for typedefs, structures, and compiler characteristics.
97 AC_C_CONST
98 AC_TYPE_UID_T
99 AC_C_INLINE
100 AC_TYPE_MODE_T
101 AC_TYPE_OFF_T
102 AC_TYPE_PID_T
103 AC_TYPE_SIZE_T
104 AC_STRUCT_ST_RDEV
105 AC_HEADER_TIME
106 AC_STRUCT_TM
107
108 dnl Checks for library functions.
109 AC_TYPE_GETGROUPS
110 AC_PROG_GCC_TRADITIONAL
111 AC_FUNC_MEMCMP
112 AC_HEADER_MAJOR
113 AC_FUNC_MMAP
114 AC_TYPE_SIGNAL
115 AC_FUNC_UTIME_NULL
116 AC_FUNC_WAIT3
117 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul setpgrp strchr memcpy)
118 AC_FUNC_SETPGRP
119 AC_CHECK_FUNCS(backtrace_symbols)
120 AC_CHECK_FUNCS(setlocale nl_langinfo)
121 AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
122
123
124 dnl Checks for (v)snprintf
125 NETATALK_SNPRINTF_CHECK
126 AC_MSG_RESULT([    LIBS = $LIBS])
127
128 dnl --------------------------------------------------------------------------
129 dnl specific configuration comes in here:
130 dnl --------------------------------------------------------------------------
131
132 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
133
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, [Define if the admin group should be enabled])
138                 AC_MSG_RESULT([disabling administrative group support])
139         fi
140 )
141
142 NETATALK_AFS_CHECK
143
144 NETATALK_CONFIG_DIRS
145
146 AC_ARG_WITH(logfile,
147         [  --with-logfile=PATH     path for file used by logger [/var/log/netatalk.log]
148                           use --without-logfile to disable logger],
149         if test "$withval" = "no"; then
150                 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
151                 AC_MSG_RESULT([logger disabled])
152         elif test "$withval" != "yes"; then
153                 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
154                 AC_MSG_RESULT([logfile set to $withval])
155         else
156                 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
157                 AC_MSG_RESULT([logfile set to default]) 
158         fi,
159                 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
160                 AC_MSG_RESULT([logfile set to default])
161 )
162
163 AC_ARG_WITH(cracklib,
164         [  --with-cracklib=DICT    enable/set location of cracklib dictionary],
165         if test "x$withval" != "xno" ; then
166                 cracklib="$withval"
167                 AC_CHECK_LIB(crack, main,
168                         AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
169                         LIBS="$LIBS -lcrack"
170                         AC_MSG_RESULT([enabling cracklib support])
171                         if test "$cracklib" = "yes"; then
172                                 cracklib="/usr/lib/cracklib_dict"
173                         fi
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!])
178                 )
179         fi
180 )
181
182 AC_ARG_ENABLE(ddp,
183         [  --disable-ddp           disable DDP],
184         if test "$enableval" = "no"; then 
185                 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
186                 AC_MSG_RESULT([disabling DDP])
187         fi
188 )
189
190 AC_ARG_ENABLE(debug1,
191         [  --enable-debug1          enable debug code],
192         if test "$enableval" != "no"; then
193                 if test "$enableval" = "yes"; then
194                         AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included])
195                 else
196                         AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included])
197                 fi 
198                 AC_MSG_RESULT([enabling debugging code])
199         fi
200 )
201
202 AC_ARG_ENABLE(debug,
203         [  --enable-debug          enable verbose debug code],
204         if test "$enableval" != "no"; then
205                 if test "$enableval" = "yes"; then
206                         AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
207                 else
208                         AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
209                 fi 
210                 AC_MSG_RESULT([enabling verbose debugging code])
211         fi
212 )
213
214 afp3=no
215 AC_ARG_ENABLE(afp3,
216         [  --enable-afp3           enable AFP 3.x calls],
217         if test "$enableval" = "yes"; then
218                 afp3=yes
219                 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
220                 AC_MSG_RESULT([enabling AFP 3.x calls])
221         fi
222 )
223
224 if test "$afp3" = "yes"; then
225         AM_ICONV
226         AC_SYS_LARGEFILE
227 fi
228 NETATALK_GSSAPI_CHECK
229
230
231 dnl ----------- A NOTE ABOUT DROPKLUDGE
232 dnl The trouble with this fix is that if you know what the file is called, it
233 dnl can be read from the Unix side.  That's okay for most academic institutions
234 dnl since the students don't have telnet access to the Mac servers.  There is
235 dnl currently no one working on further development/fixes of DROPKLUDGE.
236 dnl -----------
237
238 AC_ARG_ENABLE(dropkludge,
239         [  --enable-dropkludge     enable the experimental dropbox fix (INSECURE!) ],
240         if test "$enableval" = "yes"; then 
241                 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
242                 AC_MSG_RESULT([enabling experimental dropbox support])
243         fi
244 )
245
246 AC_ARG_ENABLE(force-uidgid,
247         [  --enable-force-uidgid   allow forcing of uid/gid per volume (BROKEN) ],
248         if test "$enableval" = "yes"; then
249                 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
250                 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
251         fi
252 )
253
254 dnl Don't use BDB unless it's needed
255 bdb_required=no
256
257 dnl Determine whether or not to use DB3 Concurrent Data Store
258 AC_MSG_CHECKING([whether or not to use DB3 Concurrent Data Store])
259 AC_ARG_WITH(cnid-cdb-backend,
260         [  --with-cnid-cdb-backend      enable CNID with Concurrent DB3 Data Store],
261         if test x"$withval" = x"no"; then
262             use_cdb_backend=no
263                         else
264             use_cdb_backend=yes
265         fi
266         ,use_cdb_backend=yes
267 )
268
269 if test $use_cdb_backend = yes; then
270                                 AC_MSG_RESULT([yes])
271     AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent DB3 backend should be compiled.])     
272     DEFAULT_CNID_SCHEME=cdb
273     bdb_required=yes
274 else
275     AC_MSG_RESULT([no])
276                         fi
277
278 dnl Determine whether or not to use Database Daemon CNID backend
279 AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend])
280 AC_ARG_WITH(cnid-dbd-backend,
281         [  --with-cnid-dbd-backend      enable CNID with Database Daemon Data Store],
282         if test x"$withval" = x"no"; then
283             AC_MSG_RESULT([no])
284             use_dbd_backend=no
285                 else
286             use_dbd_backend=yes
287             AC_MSG_RESULT([yes])
288         fi
289         ,use_dbd_backend=no
290         AC_MSG_RESULT([no])
291 )
292
293 dnl Determine whether or not to use with transaction support in Database Daemon
294 AC_MSG_CHECKING([whether or not to use Database Daemon with transaction support])
295 AC_ARG_WITH(cnid-dbd-txn,
296         [  --with-cnid-dbd-txn          enable transaction support for dbd backend],
297         if test x"$withval" = x"no"; then
298             AC_MSG_RESULT([no])
299             use_dbd_txn=no
300         else
301             use_dbd_txn=yes
302             AC_MSG_RESULT([yes])
303         fi
304         ,use_dbd_txn=no
305                         AC_MSG_RESULT([no])
306 )
307
308 if test $use_dbd_txn = yes; then
309     use_dbd_backend=yes
310     AC_DEFINE(CNID_BACKEND_DBD_TXN, 1, [Define if CNID Database Daemon backend has transaction support])
311 else
312     if test x"$use_dbd_backend" = x; then    
313         use_dbd_backend=no
314     fi
315 fi
316
317 if test $use_dbd_backend = yes; then
318     AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.])
319     if test x"$DEFAULT_CNID_SCHEME" = x; then
320         DEFAULT_CNID_SCHEME=dbd
321     fi
322     bdb_required=yes
323 fi
324 AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes")
325
326 dnl Determine whether or not to use DB3 transactional data store
327 AC_MSG_CHECKING([whether or not to use DB3 transactional DB store])
328 AC_ARG_WITH(cnid-db3-backend,
329         [  --with-cnid-db3-backend      enable CNID with transactional DB3 Data Store],
330         if test x"$withval" = x"no"; then
331             use_db3_backend=no
332         else
333             use_db3_backend=yes
334                 fi
335         ,use_db3_backend=no
336 )
337
338 if test $use_db3_backend = yes; then
339                         AC_MSG_RESULT([yes])
340     AC_DEFINE(CNID_BACKEND_DB3, 1, [Define if CNID transactional DB3 backend should be compiled.])
341     if test x"$DEFAULT_CNID_SCHEME" = x; then
342         DEFAULT_CNID_SCHEME=db3
343     fi
344     bdb_required=yes
345                 else
346                         AC_MSG_RESULT([no])
347                 fi
348
349 dnl Determine whether or not to use LAST DID scheme
350 AC_MSG_CHECKING([whether or not to use LAST DID scheme])
351 AC_ARG_WITH(cnid-last-backend,
352         [  --with-cnid-last-backend     enable LAST CNID scheme],
353         if test x"$withval" = x"no"; then
354             use_last_backend=no
355         else
356             use_last_backend=yes
357         fi
358         ,use_last_backend=no
359 )
360
361 if test $use_last_backend = yes; then
362     AC_MSG_RESULT([yes])
363     AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
364     if test x"$DEFAULT_CNID_SCHEME" = x; then
365         DEFAULT_CNID_SCHEME=last
366     fi
367 else
368     AC_MSG_RESULT([no])
369 fi
370
371 dnl Determine whether or not to use HASH DID scheme
372 AC_MSG_CHECKING([whether or not to use HASH DID scheme])
373 AC_ARG_WITH(cnid-hash-backend,
374         [  --with-cnid-hash-backend     enable HASH CNID scheme],
375         if test x"$withval" = x"no"; then
376             use_hash_backend=no
377         else
378             use_hash_backend=yes
379         fi
380         ,use_hash_backend=no
381 )
382
383 if test $use_hash_backend = yes; then
384     AC_MSG_RESULT([yes])
385     AC_DEFINE(CNID_BACKEND_HASH, 1, [Define if CNID HASH scheme backend should be compiled.])
386     if test x"$DEFAULT_CNID_SCHEME" = x; then
387         DEFAULT_CNID_SCHEME=hash
388     fi
389             else
390                 AC_MSG_RESULT([no])
391             fi
392
393 dnl Determine whether or not to use TDB DID scheme
394 AC_MSG_CHECKING([whether or not to use TDB DID scheme])
395 AC_ARG_WITH(cnid-tdb-backend,
396         [  --with-cnid-tdb-backend      enable DID CNID scheme],
397         if test x"$withval" = x"no"; then
398             use_tdb_backend=no
399         else
400             use_tdb_backend=yes
401         fi
402         ,use_tdb_backend=no
403 )
404
405 if test $use_tdb_backend = yes; then
406             AC_MSG_RESULT([yes])
407     AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
408     if test x"$DEFAULT_TDB_SCHEME" = x; then
409         DEFAULT_TDB_SCHEME=tdb
410         fi
411 else
412     AC_MSG_RESULT([no])
413 fi
414
415 dnl Determine whether or not to use MTAB DID scheme
416 AC_MSG_CHECKING([whether or not to use MTAB DID scheme])
417 AC_ARG_WITH(cnid-mtab-backend,
418         [  --with-cnid-mtab-backend     enable MTAB CNID scheme],
419         if test x"$withval" = x"no"; then
420             use_mtab_backend=no
421         else
422             use_mtab_backend=yes
423         fi
424         ,use_mtab_backend=no
425 )
426
427 if test $use_mtab_backend = yes; then
428     AC_MSG_RESULT([yes])
429     AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.])
430     if test x"$DEFAULT_CNID_SCHEME" = x; then
431         DEFAULT_CNID_SCHEME=mtab
432 fi
433 else            
434     AC_MSG_RESULT([no])
435 fi
436
437 dnl Set default DID scheme
438 AC_MSG_CHECKING([default DID scheme])
439 AC_ARG_WITH(cnid-default-backend,
440         [  --with-cnid-default-backend=val      set default DID scheme],
441         if test x"$withval" = x; then
442             AC_MSG_RESULT([ignored])
443         else
444             DEFAULT_CNID_SCHEME=$withval
445             AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
446         fi
447         ,AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
448 )
449
450 if test x"$DEFAULT_CNID_SCHEME" = x; then
451     AC_MSG_ERROR([No DID schemes compiled in ])
452 fi
453
454 #eval "default_scheme_selected=\$use_$DEFAULT_CNID_SCHEME_backend"
455 #echo "default_scheme_selected=[$default_scheme_selected]"
456 #if test x"$default_scheme_selected" = xyes; then
457 #   AC_MSG_CHECKING([Checking whether default CNID scheme has been activated])
458 #   AC_MSG_RESULT([yes])
459 #else
460 #   AC_MSG_ERROR([Default CNID scheme is disabled ! Enable it or select other as default.])
461 #fi
462
463 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
464
465 dnl Check for Berkeley DB library
466 if test "x$bdb_required" = "xyes"; then
467         AC_PATH_BDB(, [AC_MSG_ERROR([Berkeley DB library not found!])])
468 fi
469
470 dnl Check for quota support
471 AC_CHECK_QUOTA
472
473 dnl Check for optional server location protocol support (used by MacOS X)
474 NETATALK_SRVLOC
475
476 AC_MSG_RESULT([    LIBS = $LIBS])
477 dnl Check for PAM libs
478 AC_PATH_PAM([
479         PAPD_LIBS="$PAPD_LIBS $PAM_LIBS"
480         AFPD_LIBS="$AFPD_LIBS $PAM_LIBS"
481         use_pam_so=yes
482         compile_pam=yes
483         AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
484 ])
485
486 AC_MSG_CHECKING([whether shadow support should be enabled])
487 AC_ARG_WITH(shadow,
488         [  --with-shadow           enable shadow password support],
489         [shadowpw="$withval"],
490         [shadowpw=no]
491 )
492 if test "x$shadowpw" = "xyes"; then
493         AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
494 fi
495 AC_MSG_RESULT([$shadowpw])
496
497 AC_ARG_ENABLE(shell-check,
498         [  --disable-shell-check   disable checking for a valid shell],
499         if test "$enableval" = "no"; then 
500                 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
501                 AC_MSG_RESULT([disabling valid shell check])
502         fi
503 )
504
505 #AC_ARG_WITH(tcp-wrappers,
506 #       [  --with-tcp-wrappers     enable TCP wrappers support],[
507 #       AC_CHECK_HEADERS(tcpd.h)
508 #       AC_CHECK_LIB(wrap, tcpd_warn,
509 #               AC_DEFINE(TCPWRAP, 1, [Define if TCP wrappers should be used])
510 #               AFPD_LIBS="$AFPD_LIBS -lwrap"
511 #               AC_MSG_RESULT([enabling TCP wrappers support])
512 #       )
513 #])
514 NETATALK_TCP_WRAPPERS
515
516 AC_ARG_ENABLE(redhat,
517         [  --enable-redhat         use redhat-style sysv configuration ],
518         if test "$enableval" = "yes"; then
519                 sysv_style=redhat
520         fi
521         AC_MSG_RESULT([enabling redhat-style sysv support])
522 )
523
524 AC_ARG_ENABLE(suse,
525         [  --enable-suse           use suse-style sysv configuration ],
526         if test "$enableval" = "yes"; then
527                 sysv_style=suse
528         fi
529         AC_MSG_RESULT([enabling suse-style sysv support])
530 )
531
532 AC_ARG_ENABLE(cobalt,
533         [  --enable-cobalt         use cobalt-style sysv configuration ],
534         if test "$enableval" = "yes"; then
535                 sysv_style=cobalt
536         fi
537         AC_MSG_RESULT([enabling cobalt-style sysv support])
538 )
539
540 AC_ARG_ENABLE(netbsd,
541         [  --enable-netbsd         use NetBSD-style rc.d configuration ],
542         if test "x$enableval" = "xyes"; then
543                 sysv_style=netbsd
544         fi
545         AC_MSG_RESULT([enabling NetBSD-style rc.d support])
546 )
547
548 dnl ----- timelord compilation (disabled by default)
549 AC_MSG_CHECKING([whether timelord should be compiled])
550 compile_timelord=no
551 AC_ARG_ENABLE(timelord,
552         [  --enable-timelord       enable compilation of timelord server],
553         [compile_timelord="$enableval"],
554         [compile_timelord="no"]
555 )
556 AC_MSG_RESULT([$compile_timelord])
557
558 dnl ----- a2boot compilation (disabled by default)
559 AC_MSG_CHECKING([whether a2boot should be compiled])
560 compile_a2boot=no
561 AC_ARG_ENABLE(a2boot,
562         [  --enable-a2boot       enable compilation of Apple2 boot server],
563         [compile_a2boot="$enableval"],
564         [compile_a2boot="no"]
565 )
566 AC_MSG_RESULT([$compile_a2boot])
567
568 AC_ARG_WITH(uams-path,
569         [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]],
570         uams_path="$withval",
571         uams_path="${PKGCONFDIR}/uams"
572 )
573
574 dnl --------------------------------------------------------------------------
575 dnl FHS stuff has to be done last because it overrides other defaults
576 dnl --------------------------------------------------------------------------
577
578 AC_ARG_ENABLE(fhs,
579         [  --enable-fhs            use Filesystem Hierarchy Standard (FHS) compatibility],
580         if test "$enableval" = "yes"; then
581                 uams_path="${libdir}/netatalk"
582                 sysconfdir="/etc"
583                 PKGCONFDIR=${sysconfdir}/netatalk
584                 SERVERTEXT="${PKGCONFDIR}/msg"
585                 use_pam_so=yes
586                 mandir="/usr/share/man"
587                 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
588         fi
589         AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
590 )
591
592 dnl --------------------------------------------------------------------------
593 dnl post-FHS substitutions, etc
594 dnl --------------------------------------------------------------------------
595
596 dnl ***** UAMS_PATH
597 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
598         [path to UAMs [default=PKGCONF/uams]])
599 UAMS_PATH="${uams_path}"
600 AC_SUBST(UAMS_PATH)
601
602 dnl --------------------------------------------------------------------------
603 dnl drop in includes for top level directory structures here...
604 dnl --------------------------------------------------------------------------
605
606 dnl Note: $(top_srcdir)/include should be added before all other includes
607 dnl       so that includes from that directory a preferred to includes from
608 dnl       /usr/include or similar places.
609 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
610 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
611
612 dnl --------------------------------------------------------------------------
613 dnl specific configuration comes in here:
614 dnl --------------------------------------------------------------------------
615
616 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
617
618 dnl --------------------- determine operating system from "target"
619 case "$host_os" in
620         *aix*)                          this_os=aix ;;
621         *freebsd*)                      this_os=freebsd ;;
622         *hpux11*)                       this_os=hpux11 ;;
623         *irix*)                         this_os=irix ;;
624         *linux*)                        this_os=linux ;;
625         *osx*)                          this_os=macosx ;;
626         *darwin*)                       this_os=macosx ;;
627         *netbsd*)                       this_os=netbsd ;;
628         *openbsd*)                      this_os=openbsd ;;
629         *osf*)                          this_os=tru64 ;;
630         *solaris*)                      this_os=solaris ;;
631 esac
632
633 case "$host_cpu" in
634         i386|i486|i586|i686|k7)         this_cpu=x86 ;;
635         alpha)                                          this_cpu=alpha ;;
636         mips)                                           this_cpu=mips ;;
637         powerpc|ppc)                            this_cpu=ppc ;;
638 esac
639
640 dnl --------------------- operating system specific flags (port from sys/*)
641
642 dnl ----- AIX specific -----
643 if test x"$this_os" = "xaix"; then
644         AC_MSG_RESULT([ * AIX specific configuration])
645         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
646
647         dnl This is probably a lie; AIX 4.3 supports a 64-bit long
648         dnl compilation environment.  It's enough to get things defined
649         dnl right in endian.h provided that long long is supported, though.
650         AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
651 fi
652
653 dnl ----- FreeBSD specific -----
654 if test x"$this_os" = "xfreebsd"; then 
655         AC_MSG_RESULT([ * FreeBSD specific configuration])
656         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
657         AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
658
659         AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
660 fi
661
662 dnl ----- HP-UX 11 specific -----
663 if test x"$this_os" = "xhpux11"; then
664         AC_MSG_RESULT([ * HP-UX 11 specific configuration])
665
666         AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
667         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
668 fi
669
670 dnl ----- IRIX specific -----
671 if test x"$this_os" = "xirix"; then
672         AC_MSG_RESULT([ * IRIX specific configuration])
673
674         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
675 fi
676
677 dnl ----- Linux specific -----
678 if test x"$this_os" = "xlinux"; then 
679         AC_MSG_RESULT([ * Linux specific configuration])
680
681         dnl ----- check if we need the quotactl wrapper
682 #       AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
683 #       AC_CHECK_FUNC(quotactl,,
684 #               AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed])
685 #               AC_MSG_RESULT([enabling quotactl wrapper])
686 #       )
687
688         # For quotas on Linux XFS filesystems
689         AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
690         AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)
691         # For linux > 2.5.56
692         AC_CHECK_HEADERS(linux/dqblk_xfs.h)
693
694
695         dnl ----- as far as I can tell, dbtob always does the wrong thing
696         dnl ----- on every single version of linux I've ever played with.
697         dnl ----- see etc/afpd/quota.c
698         AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
699
700         linux_sendfile=no
701         AC_ARG_ENABLE(sendfile,
702             [  --enable-sendfile       use sendfile syscall default (no) ],
703             if test "$enableval" = "yes"; then
704                 linux_sendfile=yes
705             fi
706             AC_MSG_RESULT([enabling sendfile syscall])
707         )
708
709         if test x"$linux_sendfile" = "xyes"; then 
710             dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
711             dnl ----- check if version is newer than 2.2.x
712             changequote(<<,>>)
713             majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
714             minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
715             if [ $majorvers -ge 2 ]; then
716                 if [ $minorvers -ge 2 ]; then
717                         changequote([,])
718                         AC_MSG_RESULT([ * found Linux 2.2.x or higher])
719                         AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
720                 else
721                         AC_MSG_RESULT([ * found Linux 2.0.x ]) 
722                 fi
723             fi
724         fi
725
726         dnl ----- Linux/alpha specific -----
727         if test x"$this_cpu" = "xalpha"; then 
728                 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
729                 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
730         fi
731         need_dash_r=no
732
733
734 fi
735
736 dnl ----- Mac OSX specific -----
737 if test x"$this_os" = "xmacosx"; then 
738         AC_MSG_RESULT([ * Mac OSX specific configuration])
739         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
740         AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
741         AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
742         dnl AC_DEFINE(NO_DLFCN_H)
743         AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
744 fi
745
746 dnl ----- NetBSD specific -----
747 if test x"$this_os" = "xnetbsd"; then 
748         AC_MSG_RESULT([ * NetBSD specific configuration])
749         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
750         if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
751                 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
752                 # If this test is true, it's not an ELF box.
753                 # This REALLY should be a configure test.
754                 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
755         fi
756         CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
757         need_dash_r=yes 
758
759         dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
760         AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
761         AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
762 fi
763
764 dnl ----- OpenBSD specific -----
765 if test x"$this_os" = "xopenbsd"; then 
766         AC_MSG_RESULT([ * OpenBSD specific configuration])
767         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
768         AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
769
770         dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
771         AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
772         AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
773 fi
774
775 dnl ----- Solaris specific -----
776 if test x"$this_os" = "xsolaris"; then 
777         AC_MSG_RESULT([ * Solaris specific configuration])
778         AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
779         AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
780         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
781         AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
782         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
783         need_dash_r=yes
784
785         AC_MSG_RESULT([enabling Solaris kernel module build])
786         solaris_module=yes
787 fi
788
789 dnl ----- Tru64 specific -----
790 if test x"$this_os" = "xtru64"; then 
791         AC_MSG_RESULT([ * Tru64 specific configuration])
792         AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
793         AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
794         dnl AC_DEFINE(USE_MOUNT_H)
795         AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
796         dnl AC_DEFINE(USE_UFS_QUOTA_H)
797         AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
798         AC_CHECK_LIB(security,set_auth_parameters)
799         CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
800         need_dash_r=no
801         sysv_style=tru64
802 fi
803
804 dnl -- look for openssl
805 AC_MSG_RESULT([    LIBS = $LIBS])
806 AC_PATH_SSL
807
808 dnl --------------------- check for building PGP UAM module
809
810 AC_ARG_ENABLE(pgp-uam,
811         [  --enable-pgp-uam        enable build of PGP UAM module],
812         if test "$enableval" = "yes"; then 
813                 if test "$compile_ssl" = "yes"; then 
814                         AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
815                         compile_pgp=yes
816                         AC_MSG_RESULT([enabling build with PGP UAM module])
817                 fi
818         fi
819 )
820
821 dnl --------------------- check for building Kerberos v4 UAM module
822
823 AC_ARG_ENABLE(krb4-uam,
824         [  --enable-krb4-uam       enable build of Kerberos v4 UAM module],
825         if test "$enableval" = "yes"; then
826                 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
827                 compile_kerberos=yes
828                 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
829         fi
830 )
831 dnl --------------------- overwrite the config files . . . or not.
832
833 AC_MSG_CHECKING([whether configuration files should be overwritten])
834 AC_ARG_ENABLE(overwrite,
835         [  --enable-overwrite      overwrite configuration files during installation],
836         [OVERWRITE_CONFIG="${enable_overwrite}"],
837         [OVERWRITE_CONFIG="no"]
838 )
839 AC_MSG_RESULT([$OVERWRITE_CONFIG])
840
841 dnl --------------------- last minute substitutions
842
843 AC_SUBST(LIBS)
844 AC_SUBST(AFPD_LIBS)
845 AC_SUBST(PAPD_LIBS)
846 AC_SUBST(CFLAGS)
847 AC_SUBST(OVERWRITE_CONFIG)
848
849 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
850 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
851 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
852 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
853 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
854 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
855 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
856 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
857 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
858 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
859 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
860 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
861 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
862 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
863 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
864
865 dnl --------------------- generate files
866
867 AC_OUTPUT([Makefile
868         bin/Makefile
869         bin/adv1tov2/Makefile
870         bin/aecho/Makefile
871         bin/afile/Makefile
872         bin/afppasswd/Makefile
873         bin/cnid/Makefile
874         bin/cnid/cnid_maint
875         bin/getzones/Makefile
876         bin/megatron/Makefile
877         bin/nbp/Makefile
878         bin/pap/Makefile
879         bin/psorder/Makefile
880         config/Makefile
881         contrib/Makefile
882         contrib/macusers/Makefile
883         contrib/macusers/macusers
884         contrib/nu/Makefile
885         contrib/nu/nu
886         contrib/printing/Makefile
887         contrib/shell_utils/Makefile
888         contrib/shell_utils/afpd-mtab.pl
889         contrib/shell_utils/apple_cp
890         contrib/shell_utils/apple_mv
891         contrib/shell_utils/apple_rm
892         contrib/shell_utils/cleanappledouble.pl
893         contrib/shell_utils/netatalkshorternamelinks.pl
894         contrib/timelord/Makefile
895         contrib/a2boot/Makefile
896         distrib/Makefile
897         distrib/config/Makefile
898         distrib/config/netatalk-config
899         distrib/initscripts/Makefile
900         distrib/m4/Makefile
901         doc/Makefile
902         etc/Makefile
903         etc/afpd/Makefile
904         etc/atalkd/Makefile
905         etc/cnid_dbd/Makefile
906         etc/uams/Makefile
907         etc/uams/uams_krb4/Makefile
908         etc/papd/Makefile
909         etc/psf/Makefile
910         include/Makefile
911         include/atalk/Makefile
912         libatalk/Makefile
913         libatalk/adouble/Makefile
914         libatalk/asp/Makefile
915         libatalk/atp/Makefile
916         libatalk/cnid/Makefile
917         libatalk/cnid/db3/Makefile
918         libatalk/cnid/cdb/Makefile
919         libatalk/cnid/last/Makefile
920         libatalk/cnid/mtab/Makefile
921         libatalk/cnid/dbd/Makefile
922         libatalk/cnid/hash/Makefile
923         libatalk/cnid/tdb/Makefile
924         libatalk/compat/Makefile
925         libatalk/dsi/Makefile
926         libatalk/nbp/Makefile
927         libatalk/netddp/Makefile
928         libatalk/util/Makefile
929         libatalk/tdb/Makefile
930         libatalk/unicode/Makefile
931         libatalk/unicode/charsets/Makefile
932         macros/Makefile
933         man/Makefile
934         man/man1/Makefile
935         man/man3/Makefile
936         man/man4/Makefile
937         man/man5/Makefile
938         man/man8/Makefile
939         sys/Makefile
940         sys/generic/Makefile
941         sys/generic/sys/Makefile
942         sys/netatalk/Makefile
943         sys/netbsd/Makefile
944         sys/netbsd/netatalk/Makefile
945         sys/solaris/Makefile
946         sys/solaris/Makefile.kernel
947         sys/sunos/Makefile
948         sys/ultrix/Makefile
949         ],
950         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
951 )
952
953
954 #################################################
955 # Display summary of libraries detected
956
957 AC_MSG_RESULT([Using libraries:])
958 AC_MSG_RESULT([    LIBS = $LIBS])
959 AC_MSG_RESULT([    SSL_LIBS = $SSL_LIBS])
960 AC_MSG_RESULT([    GSSAPI_LIBS = $GSSAPI_LIBS])
961 AC_MSG_RESULT([    BDB_LIBS = $BDB_LIBS])
962 AC_MSG_RESULT([    AFPD_LIBS= $AFPD_LIBS])
963 AC_MSG_RESULT([    PAPD_LIBS= $PAPD_LIBS])
964 AC_MSG_RESULT([    CFLAGS = $CFLAGS])
965
966