]> arthur.barton.de Git - netatalk.git/blob - configure.in
uams_randnum will now only get built if USE_DHX is turned on. Explicitly
[netatalk.git] / configure.in
1 dnl $Id: configure.in,v 1.118 2001-10-25 20:37:04 srittau Exp $
2 dnl configure.in for netatalk
3
4 dnl Check for SSL
5 AC_DEFUN([AM_PATH_SSL], [
6         tryssl=yes
7
8         AC_ARG_WITH(ssl-dir, [
9   --with-ssl-dir=PATH     specify path to OpenSSL installation (must contain
10                           lib and include dirs)],
11                 [
12                         if test "x$withval" != "xno"; then
13                                 tryssldir=$withval
14                         else
15                                 tryssl=no
16                         fi
17                 ]
18         )
19
20         SSL_CFLAGS=""
21         SSL_LIBS=""
22         compile_ssl=no
23
24         if test "$tryssl" = "yes"; then
25                 AC_MSG_CHECKING([for SSL])
26                 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
27                         if test -f "$ssldir/include/openssl/cast.h" ; then
28                                 SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
29                                 SSL_LIBS="$SSL_LIBS -L$ssldir/lib -L$ssldir -lcrypto"
30                                 if test "$need_dash_r" = "yes"; then
31                                         SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir"
32                                 fi
33                                 AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
34
35                                 dnl Check for the crypto library:
36                                 AC_CHECK_LIB(crypto, main)
37                                 dnl Check for "DES" library (for SSLeay, not openssl):
38                                 AC_CHECK_LIB(des, main)
39
40                                 dnl FIXME: do that temporarily
41                                 LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
42                                 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
43                                 if test "$need_dash_r" = "yes"; then
44                                         LIBS="$LIBS -R$ssldir/lib -R$ssldir"
45                                 fi
46
47                                 AC_DEFINE(OPENSSL_DHX,  1)
48                                 AC_DEFINE(UAM_DHX,      1)
49                                 compile_ssl=yes
50                                 break
51                         fi
52                 done
53                 if test "x$compile_ssl" = "xno"; then
54                         AC_MSG_RESULT([no])
55                 fi
56         fi
57         AC_SUBST(SSL_CFLAGS)
58         AC_SUBST(SSL_LIBS)
59 ])
60
61
62
63 AC_INIT(bin/adv1tov2/adv1tov2.c)
64
65 NETATALK_VERSION=`cat VERSION`
66 AC_SUBST(NETATALK_VERSION)
67
68 AC_CANONICAL_SYSTEM
69 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
70 AM_CONFIG_HEADER(config.h)
71
72 dnl Reset locations to proper places
73 AC_PREFIX_DEFAULT(/usr/local)
74
75 dnl Checks for programs.
76 AC_PROG_AWK
77 AC_PROG_CC
78 AC_PROG_INSTALL
79 AC_PROG_LN_S
80 AC_PROG_MAKE_SET
81 AC_LIBTOOL_DLOPEN
82 AM_PROG_LIBTOOL
83
84 dnl *********************************************************************
85 dnl FIXME! FIXME! These should be selectable properly, and should produce
86 dnl the proper flags and defines...
87 dnl *********************************************************************
88
89 dnl Checks for libraries.
90 dnl Replace `main' with a function in -labs:
91 AC_CHECK_LIB(abs, main)
92 dnl Replace `main' with a function in -laudit:
93 AC_CHECK_LIB(audit, main)
94 dnl Replace `main' with a function in -lauth:
95 AC_CHECK_LIB(auth, main)
96 dnl Replace `main' with a function in -lcmd:
97 AC_CHECK_LIB(cmd, main)
98 dnl Replace `main' with a function in -lcom_err:
99 AC_CHECK_LIB(com_err, main)
100 dnl Replace `main' with a function in -lcrypt:
101 AC_CHECK_LIB(crypt, main)
102 dnl Replace `main' with a function in -ld:
103 AC_CHECK_LIB(d, main)
104 dnl Replace `main' with a function in -ldl:
105 AC_CHECK_LIB(dl, main)
106 dnl Replace `main' with a function in -lkauth:
107 AC_CHECK_LIB(kauth, main)
108 dnl Replace `main' with a function in -lkrb:
109 AC_CHECK_LIB(krb, main)
110 dnl Replace `main' with a function in -llwp:
111 AC_CHECK_LIB(lwp, main)
112 dnl Replace `main' with a function in -ln:
113 AC_CHECK_LIB(n, main)
114 dnl Replace `main' with a function in -lnsl:
115 AC_CHECK_LIB(nsl, main)
116 dnl Replace `main' with a function in -lprot:
117 AC_CHECK_LIB(prot, main)
118 dnl Replace `main' with a function in -lresolv:
119 AC_CHECK_LIB(resolv, main)
120 dnl Replace `main' with a function in -lrpcsvc:
121 AC_CHECK_LIB(rpcsvc, main)
122 dnl Replace `main' with a function in -lrx:
123 AC_CHECK_LIB(rx, main)
124 dnl Replace `main' with a function in -lrxkad:
125 AC_CHECK_LIB(rxkad, main)
126 dnl Replace `main' with a function in -lsocket:
127 AC_CHECK_LIB(socket, main)
128 dnl Replace `main' with a function in -lsys:
129 AC_CHECK_LIB(sys, main)
130 dnl Replace `main' with a function in -lubik:
131 AC_CHECK_LIB(ubik, main)
132
133 #
134 # Check presence of some functions
135 #
136 # Check for XPG4 access() function
137 # Be sure to test before adding AFS libs in LIBS path as AFS lib
138 # has such a function that works only on AFS filesystems.
139 AC_CHECK_FUNCS(access)
140
141 dnl Checks for header files.
142 AC_HEADER_DIRENT
143 AC_HEADER_STDC
144 AC_HEADER_SYS_WAIT
145 AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h security/pam_appl.h)
146 AC_CHECK_HEADER(sys/cdefs.h,,
147         AC_MSG_RESULT([enabling generic cdefs.h from tree])
148         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
149 )
150
151 # Allow user to specify flags
152 AC_ARG_WITH(cflags,
153         [  --with-cflags           specify additional flags to pass to compiler],
154         [
155                 if test "x$withval" != "xno" ; then
156                         CFLAGS="$CFLAGS $withval"
157                 fi
158         ]       
159 )
160 AC_ARG_WITH(libs,
161         [  --with-libs             specify additional libraries to link with],
162         [
163                 if test "x$withval" != "xno" ; then
164                         LIBS="$LIBS $withval"
165                 fi
166         ]
167 )
168
169 dnl Checks for typedefs, structures, and compiler characteristics.
170 AC_C_CONST
171 AC_TYPE_UID_T
172 AC_C_INLINE
173 AC_TYPE_MODE_T
174 AC_TYPE_OFF_T
175 AC_TYPE_PID_T
176 AC_TYPE_SIZE_T
177 AC_STRUCT_ST_RDEV
178 AC_HEADER_TIME
179 AC_STRUCT_TM
180
181 dnl Checks for library functions.
182 AC_TYPE_GETGROUPS
183 AC_PROG_GCC_TRADITIONAL
184 AC_FUNC_MEMCMP
185 AC_HEADER_MAJOR
186 AC_FUNC_MMAP
187 AC_TYPE_SIGNAL
188 AC_FUNC_UTIME_NULL
189 AC_FUNC_WAIT3
190 AC_CHECK_FUNCS(flock getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul setpgrp strchr memcpy)
191 AC_FUNC_SETPGRP
192
193 dnl --------------------------------------------------------------------------
194 dnl specific configuration comes in here:
195 dnl --------------------------------------------------------------------------
196
197 AC_DEFINE(ADMIN_GRP, 1)
198
199 AC_ARG_WITH(admin-group,
200         [  --disable-admin-group   disable admin group],
201         if test "$enableval" = "no"; then
202                 AC_DEFINE(ADMIN_GRP, 0)
203                 AC_MSG_RESULT([disabling administrative group support])
204         fi
205  )
206
207 AC_ARG_ENABLE(afs,
208         [  --enable-afs            enable AFS support],
209         if test "$enableval" = "yes"; then
210                 AC_DEFINE(AFS, 1)
211                 AC_MSG_RESULT([enabling AFS support])
212         fi
213 )
214
215 AC_ARG_WITH(config-dir,
216         [  --with-config-dir=DIR   obsolete - use --with-pkgconfdir],
217                 sysconfdir="$withval",
218                 if test "x$prefix" = "xNONE"; then
219                         sysconfdir="$ac_default_prefix/etc"
220                 else
221                         sysconfdir="${prefix}/etc"
222                 fi
223 )
224
225 AC_ARG_WITH(pkgconfdir,
226         [  --with-pkgconfdir=DIR   package specific configuration in DIR
227                           [[SYSCONF/netatalk]]],
228                 PKGCONFDIR="$withval",
229                 PKGCONFDIR="${sysconfdir}/netatalk"
230 )
231
232 AC_ARG_WITH(cracklib,
233         [  --with-cracklib=DICT    enable/set location of cracklib dictionary],
234         if test "x$withval" != "xno" ; then
235                 cracklib="$withval"
236                 AC_CHECK_LIB(crack, main,
237                         AC_DEFINE(USE_CRACKLIB) 
238                         LIBS="$LIBS -lcrack"
239                         AC_MSG_RESULT([enabling cracklib support])
240                         if test "$cracklib" = "yes"; then
241                                 cracklib="/usr/lib/cracklib_dict"
242                         fi
243                         AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
244                                 [path to cracklib dictionary])
245                         AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
246                         AC_MSG_ERROR([cracklib not found!])
247                 )
248         fi
249 )
250
251 AC_ARG_ENABLE(ddp,
252         [  --disable-ddp           disable DDP],
253         if test "$enableval" = "no"; then 
254                 AC_DEFINE(NO_DDP, 1)
255                 AC_MSG_RESULT([disabling DDP])
256         fi
257 )
258
259 AC_ARG_ENABLE(debug,
260         [  --enable-debug          enable debug code],
261         if test "$enableval" != "no"; then
262                 if test "$enableval" = "yes"; then
263                         AC_DEFINE(DEBUG, 1)
264                 else
265                         AC_DEFINE_UNQUOTED(DEBUG, $enableval)
266                 fi 
267                 AC_MSG_RESULT([enabling debugging code])
268         else
269                 AC_DEFINE(DEBUG, 0)
270         fi
271 )
272
273
274 dnl ----------- A NOTE ABOUT DROPKLUDGE
275 dnl The trouble with this fix is that if you know what the file is called, it
276 dnl can be read from the Unix side.  That's okay for most academic institutions
277 dnl since the students don't have telnet access to the Mac servers.  There is
278 dnl currently no one working on further development/fixes of DROPKLUDGE.
279 dnl -----------
280
281 AC_ARG_ENABLE(dropkludge,
282         [  --enable-dropkludge     enable the experimental dropbox fix (INSECURE!) ],
283         if test "$enableval" = "yes"; then 
284                 AC_DEFINE(DROPKLUDGE, 1)
285                 AC_MSG_RESULT([enabling experimental dropbox support])
286         fi
287 )
288
289 AC_ARG_ENABLE(force-uidgid,
290         [  --enable-force-uidgid   allow forcing of uid/gid per volume (BROKEN) ],
291         if test "$enableval" = "yes"; then
292                 AC_DEFINE(FORCE_UIDGID, 1)
293                 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
294         fi
295 )
296
297 dnl Don't use DB3 unless it's needed
298 db3_required=no
299
300 dnl Check for CNID DB support
301 AC_ARG_ENABLE(cnid-db,
302         [  --enable-cnid-db        use persistent cnid database per volume (EXPERIMENTAL) ],
303         if test "x$enableval" = "xyes"; then
304                 dnl Now we need DB3
305                 db3_required="yes"
306
307                 dnl Note that we don't AC_DEFINE(CNID_DB, 1) here...
308                 dnl we have to check for the library first.
309                 dnl AC_MSG_RESULT([db3 check enabled])
310         fi
311 )
312
313 dnl Check for Berkeley DB3 library
314 AC_ARG_WITH(db3,
315         [  --with-db3=PATH         specify path to Berkeley DB3 installation],
316         if test "x$withval" != "xno"; then
317                 trydb3dir="$withval"
318         fi
319 )
320
321 db3_found=no
322 for db3dir in "" $trydb3dir "$trydb3dir/include" /usr/local/BerkeleyDB.3.3/include /usr/include/db3  /usr/local/include/db3 ; do
323         if test -f "$db3dir/db.h" ; then
324                 db3libdir="`echo $db3dir | sed 's/include\/db3$/lib/'`"
325                 db3libdir="`echo $db3libdir | sed 's/include$/lib/'`"
326                 LDFLAGS="$LDFLAGS -L$db3libdir"
327                 CFLAGS="$CFLAGS -I$db3dir"
328
329                 dnl If we require DB3, die if we don't have it
330                 if test "x$db3_required" != "xno"; then
331                         AC_CHECK_LIB(db, main,
332                                 dnl AC_MSG_RESULT([enabling db3 support])
333                                 db3_found=yes
334                                 dnl -- also enable CNID DB when this is found
335                                 AC_DEFINE(CNID_DB, 1)
336                                 AC_MSG_RESULT([using persistent cnid database per volume])
337                                 LIBS="$LIBS -ldb",
338                                 dnl Not Found
339                                 AC_MSG_ERROR([Berkeley DB3 library not found!])
340                         )
341                 fi
342                 break
343         fi
344 done
345
346 dnl Die if the library is required, but not found
347 if test "x$db3_required" != "xno"; then
348         if test "x$db3_found" = "xno"; then
349                 dnl Not Found
350                 AC_MSG_ERROR([Berkeley DB3 library not found!])
351         fi
352 fi
353
354 AC_ARG_WITH(did,
355         [  --with-did=SCHEME       set DID scheme (last,mtab)],
356         if test "x$withval" != "xno" ; then
357                 if test "$withval" = "last"; then
358                         AC_DEFINE(USE_LASTDID, 1)
359                         AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
360                 fi
361                 if test "$withval" = "mtab"; then
362                         AC_DEFINE(DID_MTAB, 1)
363                         AC_MSG_RESULT([enabling mtab-based DID creation support])
364                 fi
365         fi
366 )
367
368 msg_dir=""
369 AC_ARG_WITH(message-dir,
370         [  --with-msg-dir=PATH     path to message files [[PKGCONF/msg]]],
371                 msg_dir="$withval"
372                 if test x"$msg_dir" = "x"; then
373                         msg_dir="${PKGCONFDIR}/msg"
374                 fi
375                 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
376                         [path to message dir [[PKGCONF/msg]]])
377                 SERVERTEXT="$msg_dir"
378                 AC_SUBST(SERVERTEXT)
379 )
380
381 AC_ARG_ENABLE(srvloc,
382         [  --enable-srvloc         turn on Server Location Protocol support (EXPERIMENTAL)],
383         srvloc=$enableval,
384         srvloc=no
385 )
386
387 dnl Conditional for optional server location protocol support (used by OS X)
388 AM_CONDITIONAL(USE_SRVLOC, test "x$srvloc" != "xno")
389 if test "x$srvloc" != "xno"; then
390     for slpdir in "" $srvloc /usr /usr/local ; do
391                 if test -f "$slpdir/include/slp.h" ; then
392                         LDFLAGS="$LDFLAGS -L$slpdir/lib -lslp"
393                         CFLAGS="$CFLAGS -I$slpdir/include"
394                 AC_CHECK_LIB(slp,SLPOpen)
395                 AC_CHECK_FUNCS(SLPReg SLPDereg SLPClose)
396                 AC_DEFINE(USE_SRVLOC, 1)
397                         break
398                 fi
399         done
400 fi
401
402 # Check for PAM libs
403 AC_MSG_CHECKING([whether PAM support should be enabled])
404 AC_ARG_WITH(pam,
405     [  --with-pam              enable PAM support],
406     [PAM_MSG="$withval"],
407     [PAM_MSG="yes"]
408 )
409 AC_MSG_RESULT($PAM_MSG)
410 use_pam_so=yes
411 compile_pam=yes
412
413 if test "x$PAM_MSG" = "xyes"; then
414         if test "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
415         
416                 AC_CHECK_LIB(pam, pam_set_item, 
417                                 [PAPD_LIBS="$PAPD_LIBS -lpam"; AFPD_LIBS="$AFPD_LIBS -lpam"; use_pam_so=yes; compile_pam=yes; AC_DEFINE(USE_PAM)],
418                         [use_pam_so=no; compile_pam=no]
419                 )
420         fi
421 else
422         use_pam_so=no
423         compile_pam=no
424 fi
425
426 AC_MSG_CHECKING([whether shadow support should be enabled])
427 AC_ARG_WITH(shadow,
428         [  --with-shadow           enable shadow password support],
429         [shadowpw="$withval"],
430         [shadowpw=no]
431 )
432 if test "x$shadowpw" = "xyes"; then
433         AC_DEFINE(SHADOWPW)
434 fi
435 AC_MSG_RESULT([$shadowpw])
436
437 AC_ARG_ENABLE(shell-check,
438         [  --disable-shell-check   disable checking for a valid shell],
439         if test "$enableval" = "no"; then 
440                 AC_DEFINE(DISABLE_SHELLCHECK, 1)
441                 AC_MSG_RESULT([disabling valid shell check])
442         fi
443 )
444
445 AC_MSG_CHECKING([whether flock locks should be enabled])
446 AC_ARG_WITH(flock-locks,
447         [  --with-flock-locks      enable flock locks support],
448         [flock_locks="$withval"],
449         [flock_locks="no"]
450 )
451 if test "x$flock_locks" = "xyes"; then
452         AC_DEFINE(USE_FLOCK_LOCKS)
453 fi
454 AC_MSG_RESULT([$flock_locks])
455
456 AC_ARG_WITH(tcp-wrappers,
457         [  --with-tcp-wrappers     enable TCP wrappers support],
458         AC_CHECK_LIB(wrap, tcpd_warn,
459                 AC_DEFINE(TCPWRAP)
460                 AFPD_LIBS="$AFPD_LIBS -lwrap"
461                 AC_MSG_RESULT([enabling TCP wrappers support])
462         )
463 )
464
465 AC_ARG_ENABLE(redhat,
466         [  --enable-redhat         use redhat-style sysv configuration ],
467         if test "$enableval" = "yes"; then
468                 sysv_style=redhat
469         fi
470         AC_MSG_RESULT([enabling redhat-style sysv support])
471 )
472
473 AC_ARG_ENABLE(suse,
474         [  --enable-suse           use suse-style sysv configuration ],
475         if test "$enableval" = "yes"; then
476                 sysv_style=suse
477         fi
478         AC_MSG_RESULT([enabling suse-style sysv support])
479 )
480
481 AC_ARG_ENABLE(cobalt,
482         [  --enable-cobalt         use cobalt-style sysv configuration ],
483         if test "$enableval" = "yes"; then
484                 sysv_style=cobalt
485         fi
486         AC_MSG_RESULT([enabling cobalt-style sysv support])
487 )
488
489 dnl ----- timelord compilation (disabled by default)
490 AC_MSG_CHECKING([whether timelord should be compiled])
491 compile_timelord=no
492 AC_ARG_ENABLE(timelord,
493         [  --enable-timelord       enable compilation of timelord server],
494         [compile_timelord="$enableval"],
495         [compile_timelord="no"]
496 )
497 AC_MSG_RESULT([$compile_timelord])
498
499 AC_ARG_WITH(uams-path,
500         [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]],
501         uams_path="$withval",
502         uams_path="${PKGCONFDIR}/uams"
503 )
504
505 dnl --------------------------------------------------------------------------
506 dnl FHS stuff has to be done last because it overrides other defaults
507 dnl --------------------------------------------------------------------------
508
509 AC_ARG_ENABLE(fhs,
510         [  --enable-fhs            use Filesystem Hierarchy Standard (FHS) compatibility],
511         if test "$enableval" = "yes"; then
512                 uams_path="/usr/lib/netatalk"
513                 sysconfdir="/etc"
514                 PKGCONFDIR=${sysconfdir}/netatalk
515                 use_pam_so=yes
516                 dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
517                 AC_DEFINE(FHS_COMPATIBILITY)
518         fi
519         AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
520 )
521
522 dnl --------------------------------------------------------------------------
523 dnl post-FHS substitutions, etc
524 dnl --------------------------------------------------------------------------
525
526 dnl ***** UAMS_PATH
527 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
528         [path to UAMs [default=PKGCONF/uams]])
529 UAMS_PATH="${uams_path}"
530 AC_SUBST(UAMS_PATH)
531
532 dnl --------------------------------------------------------------------------
533 dnl drop in includes for top level directory structures here...
534 dnl --------------------------------------------------------------------------
535 LDFLAGS="$LDFLAGS -L\$(top_srcdir)/libatalk/"
536 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
537
538 dnl --------------------------------------------------------------------------
539 dnl specific configuration comes in here:
540 dnl --------------------------------------------------------------------------
541
542 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
543
544 dnl --------------------- determine operating system from "target"
545 case "$host_os" in
546         *aix*)                          this_os=aix ;;
547         *freebsd*)                      this_os=freebsd ;;
548         *hpux11*)                       this_os=hpux11 ;;
549         *irix*)                         this_os=irix ;;
550         *linux*)                        this_os=linux ;;
551         *osx*)                          this_os=macosx ;;
552         *netbsd*)                       this_os=netbsd ;;
553         *openbsd*)                      this_os=openbsd ;;
554         *osf*)                          this_os=tru64 ;;
555         *solaris*)                      this_os=solaris ;;
556 esac
557
558 case "$host_cpu" in
559         i386|i486|i586|i686|k7)         this_cpu=x86 ;;
560         alpha)                                          this_cpu=alpha ;;
561         mips)                                           this_cpu=mips ;;
562         powerpc|ppc)                            this_cpu=ppc ;;
563 esac
564
565 dnl --------------------- operating system specific flags (port from sys/*)
566
567 dnl ----- AIX specific -----
568 if test x"$this_os" = "xaix"; then
569         AC_MSG_RESULT([ * AIX specific configuration])
570         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
571
572         dnl This is probably a lie; AIX 4.3 supports a 64-bit long
573         dnl compilation environment.  It's enough to get things defined
574         dnl right in endian.h provided that long long is supported, though.
575         AC_DEFINE(HAVE_32BIT_LONGS)
576 fi
577
578 dnl ----- FreeBSD specific -----
579 if test x"$this_os" = "xfreebsd"; then 
580         AC_MSG_RESULT([ * FreeBSD specific configuration])
581         AC_DEFINE(BSD4_4)
582         AC_DEFINE(SENDFILE_FLAVOR_BSD)
583
584         dnl ----- Set -shared flag
585         LDSHAREDFLAGS="-shared"
586         AC_DEFINE(NO_CRYPT_H, 1)
587 fi
588
589 dnl ----- HP-UX 11 specific -----
590 if test x"$this_os" = "xhpux11"; then
591         AC_MSG_RESULT([ * HP-UX 11 specific configuration])
592
593         AC_DEFINE(_ISOC9X_SOURCE)
594         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
595 fi
596
597 dnl ----- IRIX specific -----
598 if test x"$this_os" = "xirix"; then
599         AC_MSG_RESULT([ * IRIX specific configuration])
600
601         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
602 fi
603
604 dnl ----- Linux specific -----
605 if test x"$this_os" = "xlinux"; then 
606         AC_MSG_RESULT([ * Linux specific configuration])
607
608         dnl ----- Set -shared flag
609         LDSHAREDFLAGS="-shared"
610
611         dnl ----- check if we need the quotactl wrapper
612         AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
613         AC_CHECK_FUNC(quotactl,,
614                 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
615                 AC_MSG_RESULT([enabling quotactl wrapper])
616         )
617
618         dnl ----- as far as I can tell, dbtob always does the wrong thing
619         dnl ----- on every single version of linux I've ever played with.
620         dnl ----- see etc/afpd/quota.c
621         AC_DEFINE(HAVE_BROKEN_DBTOB)
622
623         dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
624         dnl ----- check if version is newer than 2.2.x
625         changequote(<<,>>)
626         majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
627         minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
628         if [ $majorvers -ge 2 ]; then
629                 if [ $minorvers -ge 2 ]; then
630                         changequote([,])
631                         AC_MSG_RESULT([ * found Linux 2.2.x or higher])
632                         AC_DEFINE(SENDFILE_FLAVOR_LINUX)
633                 else
634                         AC_MSG_RESULT([ * found Linux 2.0.x ]) 
635                 fi
636         fi
637
638         dnl ----- Linux/alpha specific -----
639         if test x"$this_cpu" = "xalpha"; then 
640                 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
641                 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
642         fi
643         need_dash_r=no
644 fi
645
646 dnl ----- Mac OSX specific -----
647 if test x"$this_os" = "xmacosx"; then 
648         AC_MSG_RESULT([ * Mac OSX specific configuration])
649         AC_DEFINE(BSD4_4)
650         AC_DEFINE(HAVE_BROKEN_CPP)
651         AC_DEFINE(HAVE_2ARG_DBTOB)
652         dnl AC_DEFINE(NO_DLFCN_H)
653         AC_DEFINE(MACOSX_SERVER)
654
655         dnl ----- Set -shared flag
656         LDSHAREDFLAGS="-shared"
657 fi
658
659 dnl ----- NetBSD specific -----
660 if test x"$this_os" = "xnetbsd"; then 
661         AC_MSG_RESULT([ * NetBSD specific configuration])
662         AC_DEFINE(BSD4_4)
663         AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
664         CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
665         need_dash_r=yes 
666
667         dnl ----- Set -shared flag
668         LDSHAREDFLAGS="-shared"
669
670         dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
671         AC_DEFINE(UAM_DHX, 1)
672         AC_DEFINE(NO_CRYPT_H, 1)
673 fi
674
675 dnl ----- OpenBSD specific -----
676 if test x"$this_os" = "xopenbsd"; then 
677         AC_MSG_RESULT([ * OpenBSD specific configuration])
678         AC_DEFINE(BSD4_4)
679         AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
680
681         dnl ----- Set -shared flag
682         LDSHAREDFLAGS="-Bforcearchive -shared"
683
684         dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
685         AC_DEFINE(UAM_DHX, 1)
686         AC_DEFINE(NO_CRYPT_H, 1)
687 fi
688
689 dnl ----- Solaris specific -----
690 if test x"$this_os" = "xsolaris"; then 
691         AC_MSG_RESULT([ * Solaris specific configuration])
692         AC_DEFINE(__svr4__)
693         AC_DEFINE(_ISOC9X_SOURCE)
694         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
695         AC_DEFINE(SOLARIS)
696         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
697         need_dash_r=yes
698
699         dnl ----- Set -shared flag
700         LDSHAREDFLAGS="-G"
701
702         AC_MSG_RESULT([enabling Solaris kernel module build])
703         solaris_module=yes
704 fi
705
706 dnl ----- Tru64 specific -----
707 if test x"$this_os" = "xtru64"; then 
708         AC_MSG_RESULT([ * Tru64 specific configuration])
709         AC_DEFINE(NO_DDP)
710         AC_DEFINE(HAVE_64BIT_LONGS)
711         dnl AC_DEFINE(USE_MOUNT_H)
712         AC_DEFINE(USE_OLD_RQUOTA)
713         dnl AC_DEFINE(USE_UFS_QUOTA_H)
714         AC_DEFINE(TRU64)
715         AC_CHECK_LIB(security,set_auth_parameters)
716         CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
717         LDSHAREDFLAGS="-shared -expect_unresolved \*"
718         need_dash_r=no
719         sysv_style=tru64
720
721         dnl ----- Set -shared flag
722         LDSHAREDFLAGS="-shared"
723 fi
724
725 dnl -- look for openssl
726 AM_PATH_SSL
727
728 dnl --------------------- check for building PGP UAM module
729
730 AC_ARG_ENABLE(pgp-uam,
731         [  --enable-pgp-uam        enable build of PGP UAM module],
732         if test "$enableval" = "yes"; then 
733                 if test "$compile_ssl" = "yes"; then 
734                         AC_DEFINE(UAM_PGP, 1)
735                         compile_pgp=yes
736                         AC_MSG_RESULT([enabling build with PGP UAM module])
737                 fi
738         fi
739 )
740
741 dnl --------------------- check for building Kerberos v4 UAM module
742
743 AC_ARG_ENABLE(krb4-uam,
744         [  --enable-krb4-uam       enable build of Kerberos v4 UAM module],
745         if test "$enableval" = "yes"; then
746                 AC_DEFINE(UAM_KRB4, 1)
747                 compile_kerberos=yes
748                 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
749         fi
750 )
751 dnl --------------------- overwrite the config files . . . or not.
752
753 AC_MSG_CHECKING([whether configuration files should be overwritten])
754 AC_ARG_ENABLE(overwrite,
755         [  --enable-overwrite      overwrite configuration files],
756         [OVERWRITE_CONFIG="${enable_overwrite}"],
757         [OVERWRITE_CONFIG="no"]
758 )
759 AC_MSG_RESULT([$OVERWRITE_CONFIG])
760
761 dnl --------------------- last minute substitutions
762
763 AC_SUBST(LIBS)
764 AC_SUBST(AFPD_LIBS)
765 AC_SUBST(PAPD_LIBS)
766 AC_SUBST(CFLAGS)
767 AC_SUBST(LDSHAREDFLAGS)
768 AC_SUBST(PKGCONFDIR)
769 AC_SUBST(OVERWRITE_CONFIG)
770
771 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
772 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
773 AM_CONDITIONAL(USE_DHX, test x$compile_ssl = xyes)
774 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
775 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
776 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
777 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
778 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
779 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
780 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
781 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
782 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
783 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
784
785 dnl --------------------- generate files
786
787 AC_OUTPUT([Makefile
788         bin/Makefile
789         bin/adv1tov2/Makefile
790         bin/aecho/Makefile
791         bin/afile/Makefile
792         bin/afppasswd/Makefile
793         bin/getzones/Makefile
794         bin/megatron/Makefile
795         bin/nbp/Makefile
796         bin/pap/Makefile
797         bin/psorder/Makefile
798         config/Makefile
799         contrib/Makefile
800         contrib/macusers/Makefile
801         contrib/nu/Makefile
802         contrib/printing/Makefile
803         contrib/shell_utils/Makefile
804         contrib/timelord/Makefile
805         distrib/Makefile
806         distrib/config/Makefile
807         distrib/config/netatalk-config
808         distrib/initscripts/Makefile
809         distrib/m4/Makefile
810         doc/Makefile
811         etc/Makefile
812         etc/afpd/Makefile
813         etc/afpd/nls/Makefile
814         etc/atalkd/Makefile
815         etc/uams/Makefile
816         etc/uams/uams_krb4/Makefile
817         etc/papd/Makefile
818         etc/psf/Makefile
819         include/Makefile
820         include/atalk/Makefile
821         libatalk/Makefile
822         libatalk/adouble/Makefile
823         libatalk/asp/Makefile
824         libatalk/atp/Makefile
825         libatalk/cnid/Makefile
826         libatalk/compat/Makefile
827         libatalk/dsi/Makefile
828         libatalk/nbp/Makefile
829         libatalk/netddp/Makefile
830         libatalk/util/Makefile
831         man/Makefile
832         man/man1/Makefile
833         man/man3/Makefile
834         man/man4/Makefile
835         man/man5/Makefile
836         man/man8/Makefile
837         sys/Makefile
838         sys/generic/Makefile
839         sys/generic/sys/Makefile
840         sys/netatalk/Makefile
841         sys/netbsd/Makefile
842         sys/netbsd/netatalk/Makefile
843         sys/solaris/Makefile
844         sys/sunos/Makefile
845         sys/ultrix/Makefile
846         ],
847         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
848 )
849