]> arthur.barton.de Git - netatalk.git/blob - configure.in
Move check for ufs/quota.h from configure.in to macros/quota-check.m4.
[netatalk.git] / configure.in
1 dnl $Id: configure.in,v 1.194 2003-12-15 04:55:20 srittau 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 AC_PROG_DVIPS
25 AC_PROG_TROFF2PS
26
27 dnl *********************************************************************
28 dnl FIXME! FIXME! These should be selectable properly, and should produce
29 dnl the proper flags and defines...
30 dnl *********************************************************************
31
32 dnl Checks for libraries.
33 dnl Replace `main' with a function in -labs:
34 AC_CHECK_LIB(abs, main)
35 dnl Replace `main' with a function in -laudit:
36 AC_CHECK_LIB(audit, main)
37 dnl Replace `main' with a function in -lauth:
38 AC_CHECK_LIB(auth, main)
39 dnl Replace `main' with a function in -lcmd:
40 AC_CHECK_LIB(cmd, main)
41 dnl Replace `main' with a function in -lcrypt:
42 AC_CHECK_LIB(crypt, main)
43 dnl Replace `main' with a function in -ld:
44 AC_CHECK_LIB(d, main)
45 dnl Replace `main' with a function in -ldl:
46 AC_CHECK_LIB(dl, main)
47 dnl Replace `main' with a function in -lkauth:
48 AC_CHECK_LIB(kauth, main)
49 dnl Replace `main' with a function in -lkrb:
50 AC_CHECK_LIB(krb, main)
51 dnl Replace `main' with a function in -llwp:
52 AC_CHECK_LIB(lwp, main)
53 dnl Replace `main' with a function in -ln:
54 AC_CHECK_LIB(n, main)
55 dnl Replace `main' with a function in -lnsl:
56 AC_CHECK_LIB(nsl, main)
57 dnl Replace `main' with a function in -lprot:
58 AC_CHECK_LIB(prot, main)
59 dnl Replace `main' with a function in -lrx:
60 AC_CHECK_LIB(rx, main)
61 dnl Replace `main' with a function in -lrxkad:
62 AC_CHECK_LIB(rxkad, main)
63 dnl Replace `main' with a function in -lsocket:
64 AC_CHECK_LIB(socket, main)
65 dnl Replace `main' with a function in -lsys:
66 AC_CHECK_LIB(sys, main)
67 dnl Replace `main' with a function in -lubik:
68 AC_CHECK_LIB(ubik, main)
69
70 #
71 # Check presence of some functions
72 #
73 # Check for XPG4 access() function
74 # Be sure to test before adding AFS libs in LIBS path as AFS lib
75 # has such a function that works only on AFS filesystems.
76 AC_CHECK_FUNCS(access)
77
78 AC_CHECK_FUNCS(pread pwrite)
79
80 dnl Checks for header files.
81 AC_HEADER_DIRENT
82 AC_HEADER_STDC
83 AC_HEADER_SYS_WAIT
84 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 mount.h sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h)
85 AC_CHECK_HEADER(sys/cdefs.h,,
86         AC_MSG_RESULT([enabling generic cdefs.h from tree])
87         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
88 )
89
90 dnl Checks for typedefs, structures, and compiler characteristics.
91 AC_C_CONST
92 AC_TYPE_UID_T
93 AC_C_INLINE
94 AC_TYPE_MODE_T
95 AC_TYPE_OFF_T
96 AC_TYPE_PID_T
97 AC_TYPE_SIZE_T
98 AC_STRUCT_ST_RDEV
99 AC_HEADER_TIME
100 AC_STRUCT_TM
101
102 dnl Checks for library functions.
103 AC_TYPE_GETGROUPS
104 AC_PROG_GCC_TRADITIONAL
105 AC_FUNC_MEMCMP
106 AC_HEADER_MAJOR
107 AC_FUNC_MMAP
108 AC_TYPE_SIGNAL
109 AC_FUNC_UTIME_NULL
110 AC_FUNC_WAIT3
111 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul setpgrp strchr memcpy)
112 AC_FUNC_SETPGRP
113
114 dnl Checks for (v)snprintf
115 NETATALK_SNPRINTF_CHECK
116
117 dnl --------------------------------------------------------------------------
118 dnl specific configuration comes in here:
119 dnl --------------------------------------------------------------------------
120
121 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
122
123 AC_MSG_CHECKING([for administrative group support])
124 AC_ARG_WITH(admin-group,
125         [  --disable-admin-group   disable admin group], [
126         if test "$enableval" = "no"; then
127                 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
128                 AC_MSG_RESULT([no])
129         else
130                 AC_MSG_RESULT([yes])
131         fi], [
132                 AC_MSG_RESULT([yes])
133         ]
134 )
135
136 NETATALK_AFS_CHECK
137
138 NETATALK_CONFIG_DIRS
139
140 AC_MSG_CHECKING([for logfile path])
141 AC_ARG_WITH(logfile,
142         [  --with-logfile=PATH     path for file used by logger [/var/log/netatalk.log]
143                           use --without-logfile to disable logger], [
144         if test "x$withval" == "xno"; then
145                 AC_DEFINE(DISABLE_LOGGER, 1, [Define if the logger should not be used])
146                 AC_MSG_RESULT([syslog])
147         elif test "$withval" != "yes"; then
148                 AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval", [Path to the log file])
149                 AC_MSG_RESULT([$withval])
150         else
151                 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
152                 AC_MSG_RESULT([/var/log/netatalk.log]) 
153         fi], [
154                 AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log", [Path to the log file])
155                 AC_MSG_RESULT([/var/log/netatalk.log])
156         ]
157 )
158
159 AC_ARG_WITH(cracklib,
160         [  --with-cracklib=DICT    enable/set location of cracklib dictionary],
161         if test "x$withval" != "xno" ; then
162                 cracklib="$withval"
163                 AC_CHECK_LIB(crack, main,
164                         AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
165                         LIBS="$LIBS -lcrack"
166                         AC_MSG_RESULT([enabling cracklib support])
167                         if test "$cracklib" = "yes"; then
168                                 cracklib="/usr/lib/cracklib_dict"
169                         fi
170                         AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
171                                 [path to cracklib dictionary])
172                         AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
173                         AC_MSG_ERROR([cracklib not found!])
174                 )
175         fi
176 )
177
178 AC_MSG_CHECKING([whether to enable DDP])
179 AC_ARG_ENABLE(ddp,
180         [  --disable-ddp           disable DDP], [
181         if test "x$enableval" = "xno"; then 
182                 AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
183                 AC_MSG_RESULT([no])
184         else
185                 AC_MSG_RESULT([yes])
186         fi
187         ], [
188                 AC_MSG_RESULT([yes])
189         ]
190 )
191
192 AC_MSG_CHECKING([whether to enable debugging code])
193 AC_ARG_ENABLE(debug,
194         [  --enable-debug          enable debug code], [
195         if test "x$enableval" != "xno"; then
196                 if test "x$enableval" = "xyes"; then
197                         AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
198                 else
199                         AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
200                 fi 
201                 AC_MSG_RESULT([yes])
202         else
203                 AC_MSG_RESULT([no])
204         fi
205         ], [
206                 AC_MSG_RESULT([no])
207         ]
208 )
209
210 afp3=no
211 AC_ARG_ENABLE(afp3,
212         [  --enable-afp3           enable AFP 3.x calls],
213         if test "$enableval" = "yes"; then
214                 afp3=yes
215                 AC_DEFINE(AFP3x, 1, [Define to enable AFP 3.x support])
216                 AC_MSG_RESULT([enabling AFP 3.x calls])
217         fi
218 )
219
220 if test "$afp3" = "yes"; then
221         AM_ICONV
222         AC_SYS_LARGEFILE
223 fi
224
225
226 dnl ----------- A NOTE ABOUT DROPKLUDGE
227 dnl The trouble with this fix is that if you know what the file is called, it
228 dnl can be read from the Unix side.  That's okay for most academic institutions
229 dnl since the students don't have telnet access to the Mac servers.  There is
230 dnl currently no one working on further development/fixes of DROPKLUDGE.
231 dnl -----------
232
233 AC_MSG_CHECKING([whether to enable experimental dropbox support])
234 AC_ARG_ENABLE(dropkludge,
235         [  --enable-dropkludge     enable the experimental dropbox fix (INSECURE!) ], [
236         if test "x$enableval" = "xyes"; then 
237                 AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
238                 AC_MSG_RESULT([yes])
239         else
240                 AC_MSG_RESULT([no])
241         fi
242         ], [AC_MSG_RESULT([no])]
243 )
244
245 AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
246 AC_ARG_ENABLE(force-uidgid,
247         [  --enable-force-uidgid   allow forcing of uid/gid per volume (BROKEN) ], [
248         if test "x$enableval" = "xyes"; then
249                 AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
250                 AC_MSG_RESULT([yes])
251         else
252                 AC_MSG_RESULT([no])
253         fi
254         ], [AC_MSG_RESULT([no])]
255 )
256
257 NETATALK_ARG_DID
258
259 dnl Determine whether or not to use filename mangling
260 AC_MSG_CHECKING([whether to use filename mangling])
261 AC_ARG_WITH(mangling,
262         [  --with-mangling         enable filename mangling],
263         [
264                 if test "x$withval" = "xyes"; then
265                         if test "x$did_scheme" != "xcnid"; then
266                                 AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
267                         else
268                                 AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
269                                 AC_MSG_RESULT([yes])
270                         fi
271                 else
272                         AC_MSG_RESULT([no])
273                 fi
274         ], [
275                 if test "x$did_scheme" = "xcnid"; then
276                         AC_DEFINE(FILE_MANGLING, 1, [Define if file name mangling should be used])
277                         AC_MSG_RESULT([yes])
278                 else
279                         AC_MSG_RESULT([no])
280                 fi
281         ]
282 )
283
284 if test "$did_scheme" = "cnid"; then
285     USE_CDB="yes"
286 else
287     USE_CDB="no"
288 fi
289
290 dnl Determine whether or not to use CDB or transactional DB store
291 AC_MSG_CHECKING([whether to use CNID with Concurrent Data Store])
292 AC_ARG_WITH(cdb,
293         [  --with-cdb              enable CNID with Concurrent Data Store],
294         if test "$withval" = "no"; then
295             if test "x$did_scheme" != "xcnid"; then
296                 USE_CDB="no"
297                 AC_MSG_ERROR([DID scheme must be CNID to use CDB])
298             else
299                 USE_CDB="no"
300                 AC_MSG_RESULT([no])
301             fi
302         else
303             USE_CDB="yes"
304             AC_MSG_RESULT([yes])
305         fi
306         , AC_MSG_RESULT([yes])
307 )
308
309 if test "$USE_CDB" = "yes"; then
310     AC_DEFINE(CNID_DB_CDB, 1, [Define if CNID should be used with Concurrent Data Store])
311 fi
312
313 dnl Check for quota support
314 AC_CHECK_QUOTA
315
316 dnl Check for optional server location protocol support (used by MacOS X)
317 NETATALK_SRVLOC
318
319 dnl Check for gssapi
320 NETATALK_GSSAPI_CHECK
321
322 dnl Check for PAM libs
323 AC_PATH_PAM([
324         use_pam_so=yes
325         compile_pam=yes
326         AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
327 ])
328
329 AC_MSG_CHECKING([whether shadow support should be enabled])
330 AC_ARG_WITH(shadow,
331         [  --with-shadow           enable shadow password support],
332         [shadowpw="$withval"],
333         [shadowpw=no]
334 )
335 if test "x$shadowpw" = "xyes"; then
336         AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
337 fi
338 AC_MSG_RESULT([$shadowpw])
339
340 AC_ARG_ENABLE(shell-check,
341         [  --disable-shell-check   disable checking for a valid shell],
342         if test "$enableval" = "no"; then 
343                 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
344                 AC_MSG_RESULT([disabling valid shell check])
345         fi
346 )
347
348 NETATALK_TCP_WRAPPERS
349
350 AC_ARG_ENABLE(redhat,
351         [  --enable-redhat         use redhat-style sysv configuration ],
352         if test "$enableval" = "yes"; then
353                 sysv_style=redhat
354         fi
355         AC_MSG_RESULT([enabling redhat-style sysv support])
356 )
357
358 AC_ARG_ENABLE(suse,
359         [  --enable-suse           use suse-style sysv configuration ],
360         if test "$enableval" = "yes"; then
361                 sysv_style=suse
362         fi
363         AC_MSG_RESULT([enabling suse-style sysv support])
364 )
365
366 AC_ARG_ENABLE(cobalt,
367         [  --enable-cobalt         use cobalt-style sysv configuration ],
368         if test "$enableval" = "yes"; then
369                 sysv_style=cobalt
370         fi
371         AC_MSG_RESULT([enabling cobalt-style sysv support])
372 )
373
374 AC_ARG_ENABLE(netbsd,
375         [  --enable-netbsd         use NetBSD-style rc.d configuration ],
376         if test "x$enableval" = "xyes"; then
377                 sysv_style=netbsd
378         fi
379         AC_MSG_RESULT([enabling NetBSD-style rc.d support])
380 )
381
382 dnl ----- a2boot compilation (disabled by default)
383 AC_MSG_CHECKING([whether a2boot should be compiled])
384 compile_a2boot=no
385 AC_ARG_ENABLE(a2boot,
386         [  --enable-a2boot       enable compilation of Apple2 boot server],
387         [compile_a2boot="$enableval"],
388         [compile_a2boot="no"]
389 )
390 AC_MSG_RESULT([$compile_a2boot])
391
392 AC_ARG_WITH(uams-path,
393         [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]],
394         uams_path="$withval",
395         uams_path="${PKGCONFDIR}/uams"
396 )
397
398 dnl --------------------------------------------------------------------------
399 dnl FHS stuff has to be done last because it overrides other defaults
400 dnl --------------------------------------------------------------------------
401
402 AC_ARG_ENABLE(fhs,
403         [  --enable-fhs            use Filesystem Hierarchy Standard (FHS) compatibility],
404         if test "$enableval" = "yes"; then
405                 uams_path="${libdir}/netatalk"
406                 sysconfdir="/etc"
407                 PKGCONFDIR=${sysconfdir}/netatalk
408                 SERVERTEXT="${PKGCONFDIR}/msg"
409                 NLSDIR="${PKGCONFDIR}/nls"
410                 use_pam_so=yes
411                 mandir="/usr/share/man"
412                 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
413         fi
414         AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
415 )
416
417 dnl --------------------------------------------------------------------------
418 dnl post-FHS substitutions, etc
419 dnl --------------------------------------------------------------------------
420
421 dnl ***** UAMS_PATH
422 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
423         [path to UAMs [default=PKGCONF/uams]])
424 UAMS_PATH="${uams_path}"
425 AC_SUBST(UAMS_PATH)
426
427 dnl --------------------------------------------------------------------------
428 dnl drop in includes for top level directory structures here...
429 dnl --------------------------------------------------------------------------
430
431 dnl Note: $(top_srcdir)/include should be added before all other includes
432 dnl       so that includes from that directory a preferred to includes from
433 dnl       /usr/include or similar places.
434 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
435 CFLAGS="-I\$(top_srcdir)/include $CFLAGS -I\$(top_srcdir)/sys"
436
437 dnl --------------------------------------------------------------------------
438 dnl specific configuration comes in here:
439 dnl --------------------------------------------------------------------------
440
441 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
442
443 dnl --------------------- determine operating system from "target"
444 case "$host_os" in
445         *aix*)                          this_os=aix ;;
446         *freebsd*)                      this_os=freebsd ;;
447         *hpux11*)                       this_os=hpux11 ;;
448         *irix*)                         this_os=irix ;;
449         *linux*)                        this_os=linux ;;
450         *osx*)                          this_os=macosx ;;
451         *darwin*)                       this_os=macosx ;;
452         *netbsd*)                       this_os=netbsd ;;
453         *openbsd*)                      this_os=openbsd ;;
454         *osf*)                          this_os=tru64 ;;
455         *solaris*)                      this_os=solaris ;;
456 esac
457
458 case "$host_cpu" in
459         i386|i486|i586|i686|k7)         this_cpu=x86 ;;
460         alpha)                                          this_cpu=alpha ;;
461         mips)                                           this_cpu=mips ;;
462         powerpc|ppc)                            this_cpu=ppc ;;
463 esac
464
465 dnl --------------------- operating system specific flags (port from sys/*)
466
467 dnl ----- AIX specific -----
468 if test x"$this_os" = "xaix"; then
469         AC_MSG_RESULT([ * AIX specific configuration])
470         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
471
472         dnl This is probably a lie; AIX 4.3 supports a 64-bit long
473         dnl compilation environment.  It's enough to get things defined
474         dnl right in endian.h provided that long long is supported, though.
475         AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
476 fi
477
478 dnl ----- FreeBSD specific -----
479 if test x"$this_os" = "xfreebsd"; then 
480         AC_MSG_RESULT([ * FreeBSD specific configuration])
481         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
482         AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
483
484         AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
485 fi
486
487 dnl ----- HP-UX 11 specific -----
488 if test x"$this_os" = "xhpux11"; then
489         AC_MSG_RESULT([ * HP-UX 11 specific configuration])
490
491         AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
492         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
493 fi
494
495 dnl ----- IRIX specific -----
496 if test x"$this_os" = "xirix"; then
497         AC_MSG_RESULT([ * IRIX specific configuration])
498
499         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
500 fi
501
502 dnl ----- Linux specific -----
503 ac_have_atalk_addr=no
504 if test x"$this_os" = "xlinux"; then 
505         AC_MSG_RESULT([ * Linux specific configuration])
506
507         dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
508         AC_MSG_CHECKING([for struct atalk_addr])
509         AC_COMPILE_IFELSE([
510 #include <sys/socket.h>
511 #include <asm/types.h>
512 #include <linux/atalk.h>
513
514 int main() {
515        struct atalk_addr foo;
516
517        return 0;
518 }
519         ], [
520                 ac_have_atalk_addr=yes
521                 AC_MSG_RESULT([yes])
522         ], [
523                 AC_MSG_RESULT([no])
524         ])
525
526 if test "x$ac_have_atalk_addr" = "xyes"; then
527         AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
528 fi
529
530         dnl ----- as far as I can tell, dbtob always does the wrong thing
531         dnl ----- on every single version of linux I've ever played with.
532         dnl ----- see etc/afpd/quota.c
533         AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
534
535         dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
536         dnl ----- check if version is newer than 2.2.x
537         changequote(<<,>>)
538         majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
539         minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
540         if [ $majorvers -ge 2 ]; then
541                 if [ $minorvers -ge 2 ]; then
542                         changequote([,])
543                         AC_MSG_RESULT([ * found Linux 2.2.x or higher])
544                         AC_DEFINE(SENDFILE_FLAVOR_LINUX, 1, [Define if the sendfile() function uses Linux semantics])
545                 else
546                         AC_MSG_RESULT([ * found Linux 2.0.x ]) 
547                 fi
548         fi
549
550         dnl ----- Linux/alpha specific -----
551         if test x"$this_cpu" = "xalpha"; then 
552                 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
553                 AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
554         fi
555         need_dash_r=no
556 fi
557
558 dnl ----- Mac OSX specific -----
559 if test x"$this_os" = "xmacosx"; then 
560         AC_MSG_RESULT([ * Mac OSX specific configuration])
561         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
562         AC_DEFINE(HAVE_BROKEN_CPP, 1, [Define if cpp is broken])
563         AC_DEFINE(HAVE_2ARG_DBTOB, 1, [Define if dbtob takes two arguments])
564         dnl AC_DEFINE(NO_DLFCN_H)
565         AC_DEFINE(MACOSX_SERVER, 1, [Define if compiling for MacOS X Server])
566 fi
567
568 dnl ----- NetBSD specific -----
569 if test x"$this_os" = "xnetbsd"; then 
570         AC_MSG_RESULT([ * NetBSD specific configuration])
571         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
572         if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
573                 # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
574                 # If this test is true, it's not an ELF box.
575                 # This REALLY should be a configure test.
576                 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
577         fi
578         CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
579         need_dash_r=yes 
580
581         dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
582         AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
583         AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
584 fi
585
586 dnl ----- OpenBSD specific -----
587 if test x"$this_os" = "xopenbsd"; then 
588         AC_MSG_RESULT([ * OpenBSD specific configuration])
589         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
590         AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
591
592         dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
593         AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
594         AC_DEFINE(NO_CRYPT_H, 1, [Define if crypt.h does not exist])
595 fi
596
597 dnl ----- Solaris specific -----
598 if test x"$this_os" = "xsolaris"; then 
599         AC_MSG_RESULT([ * Solaris specific configuration])
600         AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
601         AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
602         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
603         AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
604         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
605         need_dash_r=yes
606
607         AC_MSG_RESULT([enabling Solaris kernel module build])
608         solaris_module=yes
609 fi
610
611 dnl ----- Tru64 specific -----
612 if test x"$this_os" = "xtru64"; then 
613         AC_MSG_RESULT([ * Tru64 specific configuration])
614         AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
615         AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
616         dnl AC_DEFINE(USE_MOUNT_H)
617         AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
618         dnl AC_DEFINE(USE_UFS_QUOTA_H)
619         AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
620         AC_CHECK_LIB(security,set_auth_parameters)
621         CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
622         need_dash_r=no
623         sysv_style=tru64
624 fi
625
626 dnl -- look for OpenSSL and other crypt libraries
627 AC_PATH_GCRYPT
628 AC_PATH_SSL
629
630 dnl --------------------- check for building Kerberos v4 UAM module
631
632 AC_ARG_ENABLE(krb4-uam,
633         [  --enable-krb4-uam       enable build of Kerberos v4 UAM module],
634         if test "$enableval" = "yes"; then
635                 AC_DEFINE(UAM_KRB4, 1, [Define if the Kerberos 4 UAM module should be compiled])
636                 compile_kerberos=yes
637                 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
638         fi
639 )
640 dnl --------------------- overwrite the config files . . . or not.
641
642 AC_MSG_CHECKING([whether configuration files should be overwritten])
643 AC_ARG_ENABLE(overwrite,
644         [  --enable-overwrite      overwrite configuration files during installation],
645         [OVERWRITE_CONFIG="${enable_overwrite}"],
646         [OVERWRITE_CONFIG="no"]
647 )
648 AC_MSG_RESULT([$OVERWRITE_CONFIG])
649
650 dnl --------------------- last minute substitutions
651
652 AC_SUBST(LIBS)
653 AC_SUBST(CFLAGS)
654 AC_SUBST(OVERWRITE_CONFIG)
655
656 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
657 AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
658 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
659 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
660 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
661 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
662 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
663 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
664 AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
665 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
666 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
667 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
668 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
669
670 dnl --------------------- generate files
671
672 AC_OUTPUT([Makefile
673         bin/Makefile
674         bin/adv1tov2/Makefile
675         bin/aecho/Makefile
676         bin/afile/Makefile
677         bin/afppasswd/Makefile
678         bin/cnid/Makefile
679         bin/cnid/cnid_maint
680         bin/getzones/Makefile
681         bin/megatron/Makefile
682         bin/nbp/Makefile
683         bin/pap/Makefile
684         bin/psorder/Makefile
685         config/Makefile
686         contrib/Makefile
687         contrib/macusers/Makefile
688         contrib/macusers/macusers
689         contrib/nu/Makefile
690         contrib/nu/nu
691         contrib/printing/Makefile
692         contrib/shell_utils/Makefile
693         contrib/shell_utils/afpd-mtab.pl
694         contrib/shell_utils/apple_cp
695         contrib/shell_utils/apple_mv
696         contrib/shell_utils/apple_rm
697         contrib/shell_utils/cleanappledouble.pl
698         contrib/shell_utils/lp2pap.sh
699         contrib/shell_utils/netatalkshorternamelinks.pl
700         contrib/timelord/Makefile
701         contrib/a2boot/Makefile
702         distrib/Makefile
703         distrib/config/Makefile
704         distrib/config/netatalk-config
705         distrib/initscripts/Makefile
706         distrib/m4/Makefile
707         doc/Makefile
708         etc/Makefile
709         etc/afpd/Makefile
710         etc/afpd/nls/Makefile
711         etc/atalkd/Makefile
712         etc/uams/Makefile
713         etc/uams/uams_krb4/Makefile
714         etc/papd/Makefile
715         etc/psf/Makefile
716         etc/psf/etc2ps.sh
717         include/Makefile
718         include/atalk/Makefile
719         libatalk/Makefile
720         libatalk/adouble/Makefile
721         libatalk/asp/Makefile
722         libatalk/atp/Makefile
723         libatalk/cnid/Makefile
724         libatalk/compat/Makefile
725         libatalk/dsi/Makefile
726         libatalk/nbp/Makefile
727         libatalk/netddp/Makefile
728         libatalk/util/Makefile
729         macros/Makefile
730         man/Makefile
731         man/man1/Makefile
732         man/man3/Makefile
733         man/man4/Makefile
734         man/man5/Makefile
735         man/man8/Makefile
736         sys/Makefile
737         sys/generic/Makefile
738         sys/generic/sys/Makefile
739         sys/netatalk/Makefile
740         sys/netbsd/Makefile
741         sys/netbsd/netatalk/Makefile
742         sys/solaris/Makefile
743         sys/solaris/Makefile.kernel
744         sys/sunos/Makefile
745         sys/ultrix/Makefile
746         ],
747         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
748 )
749