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