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