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