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