]> arthur.barton.de Git - netatalk.git/blob - configure.in
CNID/DID patch from Uwe Hees (moderately tested)
[netatalk.git] / configure.in
1 dnl $Id: configure.in,v 1.96 2001-08-14 14:00:08 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 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 sys/types.h dlfcn.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                 if test "x$prefix" = "xNONE"; then
162                         sysconfdir="$ac_default_prefix/etc"
163                 else
164                         sysconfdir="${prefix}/etc"
165                 fi
166 )
167
168 AC_ARG_WITH(pkgconfdir,
169         [  --with-pkgconfdir=DIR   package specific configuration in DIR
170                           [default=SYSCONF/netatalk]],
171                 PKGCONFDIR="$withval",
172                 PKGCONFDIR="${sysconfdir}/netatalk"
173 )
174
175 AC_ARG_WITH(cracklib,
176         [  --with-cracklib=dict    enable/set location of cracklib dictionary],
177         if test "x$withval" != "xno" ; then
178                 cracklib="$withval"
179                 AC_CHECK_LIB(crack, main,
180                         AC_DEFINE(USE_CRACKLIB) 
181                         LIBS="$LIBS -lcrack"
182                         AC_MSG_RESULT([enabling cracklib support])
183                         if test "$cracklib" = "yes"; then
184                                 cracklib="/usr/lib/cracklib_dict"
185                         fi
186                         AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
187                                 [path to cracklib dictionary])
188                         AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
189                         AC_MSG_ERROR([cracklib not found!])
190                 )
191         fi
192 )
193
194 AC_ARG_ENABLE(ddp,
195         [  --disable-ddp           disable DDP],
196         if test "$enableval" = "no"; then 
197                 AC_DEFINE(NO_DDP, 1)
198                 AC_MSG_RESULT([disabling DDP])
199         fi
200 )
201
202 AC_ARG_ENABLE(debug,
203         [  --enable-debug          enable debug code],
204         if test "$enableval" != "no"; then
205                 if test "$enableval" = "yes"; then
206                         AC_DEFINE(DEBUG, 1)
207                 else
208                         AC_DEFINE_UNQUOTED(DEBUG, $enableval)
209                 fi 
210                 AC_MSG_RESULT([enabling debugging code])
211         else
212                 AC_DEFINE(DEBUG, 0)
213         fi
214 )
215
216
217 dnl ----------- A NOTE ABOUT DROPKLUDGE
218 dnl The trouble with this fix is that if you know what the file is called, it
219 dnl can be read from the Unix side.  That's okay for most academic institutions
220 dnl since the students don't have telnet access to the Mac servers.  There is
221 dnl currently no one working on further development/fixes of DROPKLUDGE.
222 dnl -----------
223
224 AC_ARG_ENABLE(dropkludge,
225         [  --enable-dropkludge     enable the experimental dropbox fix (INSECURE!) ],
226         if test "$enableval" = "yes"; then 
227                 AC_DEFINE(DROPKLUDGE, 1)
228                 AC_MSG_RESULT([enabling experimental dropbox support])
229         fi
230 )
231
232 AC_ARG_ENABLE(force-uidgid,
233         [  --enable-force-uidgid   allow forcing of uid/gid per volume (BROKEN) ],
234         if test "$enableval" = "yes"; then
235                 AC_DEFINE(FORCE_UIDGID, 1)
236                 AC_MSG_RESULT([enabling forcing of uid/gid per volume])
237         fi
238 )
239
240 AC_ARG_ENABLE(cnid-db,
241         [  --enable-cnid-db   use persistent cnid database per volume (EXPERIMENTAL) ],
242         if test "$enableval" = "yes"; then
243                 AC_DEFINE(CNID_DB, 1)
244                 AC_MSG_RESULT([using persistent cnid database per volume])
245         fi
246 )
247
248 AC_ARG_WITH(did,
249         [  --with-did=[scheme]     set DID scheme (last,mtab)],
250         if test "x$withval" != "xno" ; then
251                 if test "$withval" = "last"; then
252                         AC_DEFINE(USE_LASTDID, 1)
253                         AC_MSG_RESULT([enabling build without DID dev/inode mapping kludge])
254                 fi
255                 if test "$withval" = "mtab"; then
256                         AC_DEFINE(DID_MTAB, 1)
257                         AC_MSG_RESULT([enabling mtab-based DID creation support])
258                 fi
259         fi
260 )
261
262 msg_dir=""
263 AC_ARG_WITH(message-dir,
264         [  --with-msg-dir=path     path to message files [default=$ac_prefix_default/etc/msg]],
265                 msg_dir="$withval"
266                 if test x"$msg_dir" = "x"; then
267                         msg_dir="${PKGCONFDIR}/msg"
268                 fi
269                 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
270                         [path to message dir [default=$ac_prefix_default/etc/msg]])
271                 SERVERTEXT="$msg_dir"
272                 AC_SUBST(SERVERTEXT)
273 )
274
275 AC_CHECK_LIB(pam, pam_start,
276         AC_DEFINE(USE_PAM, 1)
277         LIBS="$LIBS -lpam"
278         compile_pam=yes
279 )
280
281 AC_ARG_WITH(pam,
282         [  --without-pam           disable password authentication modules support],
283         compile_pam=no
284         use_pam_so=no
285         AC_DEFINE(USE_PAM, 0)
286         AC_MSG_RESULT([disabling pam modules support])
287 )
288 if test "x$compile_pam" = "xyes"; then
289         use_pam_so=yes
290         AC_MSG_RESULT([enabling pam modules support])
291 fi
292
293 shadowpw=no
294 AC_ARG_WITH(shadow,
295         [  --with-shadow           enable shadow password support],
296         AC_MSG_RESULT([enabling shadow password support])
297         AC_DEFINE(SHADOWPW)
298         shadowpw=yes
299 )
300
301 AC_ARG_ENABLE(shell-check,
302         [  --disable-shell-check   disable checking for a valid shell],
303         if test "$enableval" = "no"; then 
304                 AC_DEFINE(DISABLE_SHELLCHECK, 1)
305                 AC_MSG_RESULT([disabling valid shell check])
306         fi
307 )
308
309 AC_ARG_WITH(flock-locks,
310         [  --with-flock-locks      enable flock locks support],
311         AC_MSG_RESULT([enabling flock locks])
312         AC_DEFINE(USE_FLOCK_LOCKS)
313 )
314
315 AC_ARG_WITH(tcp-wrappers,
316         [  --with-tcp-wrappers     enable TCP wrappers support],
317         AC_CHECK_LIB(wrap, tcpd_warn,
318                 AC_DEFINE(TCPWRAP)
319                 AFPD_LIBS="$AFPD_LIBS -lwrap"
320                 AC_MSG_RESULT([enabling TCP wrappers support])
321         )
322 )
323
324 AC_ARG_ENABLE(redhat,
325         [  --enable-redhat         use redhat-style sysv configuration ],
326         if test "$enableval" = "yes"; then
327                 sysv_style=redhat
328         fi
329         AC_MSG_RESULT([enabling redhat-style sysv support])
330 )
331
332 AC_ARG_ENABLE(suse,
333         [  --enable-suse           use suse-style sysv configuration ],
334         if test "$enableval" = "yes"; then
335                 sysv_style=suse
336         fi
337         AC_MSG_RESULT([enabling suse-style sysv support])
338 )
339
340 AC_ARG_ENABLE(cobalt,
341         [  --enable-cobalt         use cobalt-style sysv configuration ],
342         if test "$enableval" = "yes"; then
343                 sysv_style=cobalt
344         fi
345         AC_MSG_RESULT([enabling cobalt-style sysv support])
346 )
347
348 dnl ----- timelord compilation (disabled by default)
349 compile_timelord=no
350 AC_ARG_ENABLE(timelord,
351         [  --enable-timelord       enable compilation of timelord server],
352         if test "$enableval" = "yes"; then
353                 compile_timelord=yes
354         fi
355         AC_MSG_RESULT([enabling timelord compilation])
356 )
357
358 AC_ARG_WITH(uams-path,
359         [  --with-uams-path=path   path to UAMs [default=PKGCONF/uams]],
360         uams_path="$withval",
361         uams_path="${PKGCONFDIR}/uams"
362 )
363
364 dnl --------------------------------------------------------------------------
365 dnl FHS stuff has to be done last because it overrides other defaults
366 dnl --------------------------------------------------------------------------
367
368 AC_ARG_ENABLE(fhs,
369         [  --enable-fhs            use Filesystem Hierarchy Standard (FHS) compatibility],
370         if test "$enableval" = "yes"; then
371                 uams_path="/usr/lib/netatalk"
372                 sysconfdir="/etc"
373                 PKGCONFDIR=${sysconfdir}/netatalk
374                 use_pam_so=yes
375                 dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
376                 AC_DEFINE(FHS_COMPATIBILITY)
377         fi
378         AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
379 )
380
381 dnl --------------------------------------------------------------------------
382 dnl post-FHS substitutions, etc
383 dnl --------------------------------------------------------------------------
384
385 ***** UAMS_PATH
386 AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
387         [path to UAMs [default=PKGCONF/uams]])
388 UAMS_PATH="${uams_path}"
389 AC_SUBST(UAMS_PATH)
390
391 dnl --------------------------------------------------------------------------
392 dnl drop in includes for top level directory structures here...
393 dnl --------------------------------------------------------------------------
394 LDFLAGS="$LDFLAGS -L\$(top_srcdir)/libatalk/"
395 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
396
397 dnl --------------------------------------------------------------------------
398 dnl specific configuration comes in here:
399 dnl --------------------------------------------------------------------------
400
401 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
402
403 dnl --------------------- determine operating system from "target"
404 case "$host_os" in
405         *aix*)                          this_os=aix ;;
406         *freebsd*)                      this_os=freebsd ;;
407         *hpux11*)                       this_os=hpux11 ;;
408         *irix*)                         this_os=irix ;;
409         *linux*)                        this_os=linux ;;
410         *osx*)                          this_os=macosx ;;
411         *netbsd*)                       this_os=netbsd ;;
412         *openbsd*)                      this_os=openbsd ;;
413         *osf*)                          this_os=tru64 ;;
414         *solaris*)                      this_os=solaris ;;
415 esac
416
417 case "$host_cpu" in
418         i386|i486|i586|i686|k7)         this_cpu=x86 ;;
419         alpha)                                          this_cpu=alpha ;;
420         mips)                                           this_cpu=mips ;;
421         powerpc|ppc)                            this_cpu=ppc ;;
422 esac
423
424 dnl --------------------- operating system specific flags (port from sys/*)
425
426 dnl ----- AIX specific -----
427 if test x"$this_os" = "xaix"; then
428         AC_MSG_RESULT([ * AIX specific configuration])
429         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
430
431         dnl This is probably a lie; AIX 4.3 supports a 64-bit long
432         dnl compilation environment.  It's enough to get things defined
433         dnl right in endian.h provided that long long is supported, though.
434         AC_DEFINE(HAVE_32BIT_LONGS)
435 fi
436
437 dnl ----- FreeBSD specific -----
438 if test x"$this_os" = "xfreebsd"; then 
439         AC_MSG_RESULT([ * FreeBSD specific configuration])
440         AC_DEFINE(BSD4_4)
441         AC_DEFINE(SENDFILE_FLAVOR_BSD)
442
443         dnl ----- Set -shared flag
444         LDSHAREDFLAGS="-shared"
445         AC_DEFINE(NO_CRYPT_H, 1)
446 fi
447
448 dnl ----- HP-UX 11 specific -----
449 if test x"$this_os" = "xhpux11"; then
450         AC_MSG_RESULT([ * HP-UX 11 specific configuration])
451
452         AC_DEFINE(_ISOC9X_SOURCE)
453         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
454 fi
455
456 dnl ----- IRIX specific -----
457 if test x"$this_os" = "xirix"; then
458         AC_MSG_RESULT([ * IRIX specific configuration])
459
460         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
461 fi
462
463 dnl ----- Linux specific -----
464 if test x"$this_os" = "xlinux"; then 
465         AC_MSG_RESULT([ * Linux specific configuration])
466
467         dnl ----- Set -shared flag
468         LDSHAREDFLAGS="-shared"
469
470         dnl ----- check if we need the quotactl wrapper
471         AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
472         AC_CHECK_FUNC(quotactl,,
473                 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
474                 AC_MSG_RESULT([enabling quotactl wrapper])
475         )
476
477         dnl ----- as far as I can tell, dbtob always does the wrong thing
478         dnl ----- on every single version of linux I've ever played with.
479         dnl ----- see etc/afpd/quota.c
480         AC_DEFINE(HAVE_BROKEN_DBTOB)
481
482         dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
483         dnl ----- check if version is newer than 2.2.x
484         changequote(<<,>>)
485         majorvers="`uname -r | sed 's/\([0-9]\)..*/\1/'`"
486         minorvers="`uname -r | sed 's/[0-9]\.\([0-9]\)\..*/\1/'`"
487         if [ $majorvers -ge 2 ]; then
488                 if [ $minorvers -ge 2 ]; then
489                         changequote([,])
490                         AC_MSG_RESULT([ * found Linux 2.2.x or higher])
491                         AC_DEFINE(SENDFILE_FLAVOR_LINUX)
492                 else
493                         AC_MSG_RESULT([ * found Linux 2.0.x ]) 
494                 fi
495         fi
496
497         dnl ----- Linux/alpha specific -----
498         if test x"$this_cpu" = "xalpha"; then 
499                 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
500                 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
501         fi
502         need_dash_r=no
503 fi
504
505 dnl ----- Mac OSX specific -----
506 if test x"$this_os" = "xmacosx"; then 
507         AC_MSG_RESULT([ * Mac OSX specific configuration])
508         AC_DEFINE(BSD4_4)
509         AC_DEFINE(HAVE_BROKEN_CPP)
510         AC_DEFINE(HAVE_2ARG_DBTOB)
511         dnl AC_DEFINE(NO_DLFCN_H)
512         AC_DEFINE(MACOSX_SERVER)
513
514         dnl ----- Set -shared flag
515         LDSHAREDFLAGS="-shared"
516 fi
517
518 dnl ----- NetBSD specific -----
519 if test x"$this_os" = "xnetbsd"; then 
520         AC_MSG_RESULT([ * NetBSD specific configuration])
521         AC_DEFINE(BSD4_4)
522         AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
523         CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
524         need_dash_r=yes 
525
526         dnl ----- Set -shared flag
527         LDSHAREDFLAGS="-shared"
528
529         dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
530         AC_DEFINE(UAM_DHX, 1)
531         AC_DEFINE(UAM_RNDNUM, 1)
532         compile_dhx=yes
533         compile_ssl=yes
534         AC_DEFINE(NO_CRYPT_H, 1)
535 fi
536
537 dnl ----- OpenBSD specific -----
538 if test x"$this_os" = "xopenbsd"; then 
539         AC_MSG_RESULT([ * OpenBSD specific configuration])
540         AC_DEFINE(BSD4_4)
541         AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
542
543         dnl ----- Set -shared flag
544         LDSHAREDFLAGS="-Bforcearchive -shared"
545
546         dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
547         AC_DEFINE(UAM_DHX, 1)
548         AC_DEFINE(UAM_RNDNUM, 1)
549         compile_dhx=yes
550         compile_ssl=yes
551         AC_DEFINE(NO_CRYPT_H, 1)
552 fi
553
554 dnl ----- Solaris specific -----
555 if test x"$this_os" = "xsolaris"; then 
556         AC_MSG_RESULT([ * Solaris specific configuration])
557         AC_DEFINE(__svr4__)
558         AC_DEFINE(_ISOC9X_SOURCE)
559         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
560         AC_DEFINE(SOLARIS)
561         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
562         need_dash_r=yes
563
564         dnl ----- Set -shared flag
565         LDSHAREDFLAGS="-G"
566
567         AC_MSG_RESULT([enabling Solaris kernel module build])
568         solaris_module=yes
569 fi
570
571 dnl ----- Tru64 specific -----
572 if test x"$this_os" = "xtru64"; then 
573         AC_MSG_RESULT([ * Tru64 specific configuration])
574         AC_DEFINE(NO_DDP)
575         AC_DEFINE(HAVE_64BIT_LONGS)
576         dnl AC_DEFINE(USE_MOUNT_H)
577         AC_DEFINE(USE_OLD_RQUOTA)
578         dnl AC_DEFINE(USE_UFS_QUOTA_H)
579         AC_DEFINE(TRU64)
580         AC_CHECK_LIB(security,set_auth_parameters)
581         CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
582         LDSHAREDFLAGS="-shared -expect_unresolved \*"
583         need_dash_r=no
584         sysv_style=tru64
585
586         dnl ----- Set -shared flag
587         LDSHAREDFLAGS="-shared"
588 fi
589
590 dnl -- look for openssl  
591 AC_ARG_WITH(ssl-dir,
592         [  --with-ssl-dir=PATH     specify path to openssl installation (must contain
593                           lib and include dirs) ],
594         [
595                 if test "x$withval" != "xno"; then
596                         tryssldir=$withval
597                 fi
598         ]
599 )
600
601 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
602         if test -f "$ssldir/include/openssl/cast.h" ; then
603                 LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
604                 CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
605                 if test "$need_dash_r" = "yes"; then
606                         LIBS="$LIBS -R$ssldir/lib -R$ssldir"
607                 fi
608
609                 dnl Check for the crypto library:
610                 AC_CHECK_LIB(crypto, main)
611                 dnl LIBS="$LIBS -lcrypto"
612                 dnl Check for "DES" library (for SSLeay, not openssl):
613                 AC_CHECK_LIB(des, main)
614
615                 AC_DEFINE(OPENSSL_DHX,  1)
616                 AC_DEFINE(UAM_DHX,      1)
617                 AC_DEFINE(UAM_RNDNUM,   1)
618                 compile_dhx=yes
619                 compile_ssl=yes
620                 AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
621                 break
622         fi
623 done
624
625 dnl --------------------- check for building PGP UAM module
626
627 AC_ARG_ENABLE(pgp-uam,
628         [  --enable-pgp-uam        enable build of PGP UAM module],
629         if test "$enableval" = "yes"; then 
630                 if test "$compile_ssl" = "yes"; then 
631                         AC_DEFINE(UAM_PGP, 1)
632                         compile_pgp=yes
633                         AC_MSG_RESULT([enabling build with PGP UAM module])
634                 fi
635         fi
636 )
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)
644                 compile_kerberos=yes
645                 AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
646         fi
647 )
648
649 dnl --------------------- last minute substitutions
650
651 AC_SUBST(LIBS)
652 AC_SUBST(AFPD_LIBS)
653 AC_SUBST(PAPD_LIBS)
654
655 AC_SUBST(CFLAGS)
656 AC_SUBST(LDSHAREDFLAGS)
657
658 AC_SUBST(PKGCONFDIR)
659
660 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
661 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
662 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
663 AM_CONDITIONAL(USE_KERBEROS, test x$compile_kerberos = xyes)
664 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
665 AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
666 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
667 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
668 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
669 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
670 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
671 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
672 AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64)
673
674 dnl --------------------- generate files
675
676 AC_OUTPUT([Makefile
677         bin/Makefile
678         bin/adv1tov2/Makefile
679         bin/aecho/Makefile
680         bin/afile/Makefile
681         bin/afppasswd/Makefile
682         bin/getzones/Makefile
683         bin/megatron/Makefile
684         bin/nbp/Makefile
685         bin/pap/Makefile
686         bin/psorder/Makefile
687         config/Makefile
688         contrib/Makefile
689         contrib/macusers/Makefile
690         contrib/nu/Makefile
691         contrib/printing/Makefile
692         contrib/shell_utils/Makefile
693         contrib/timelord/Makefile
694         distrib/Makefile
695         distrib/config/Makefile
696         distrib/config/netatalk-config
697         distrib/initscripts/Makefile
698         distrib/m4/Makefile
699         doc/Makefile
700         etc/Makefile
701         etc/afpd/Makefile
702         etc/afpd/nls/Makefile
703         etc/atalkd/Makefile
704         etc/uams/Makefile
705         etc/uams/uams_krb4/Makefile
706         etc/papd/Makefile
707         etc/psf/Makefile
708         include/Makefile
709         include/atalk/Makefile
710         libatalk/Makefile
711         libatalk/adouble/Makefile
712         libatalk/asp/Makefile
713         libatalk/atp/Makefile
714         libatalk/cnid/Makefile
715         libatalk/compat/Makefile
716         libatalk/dsi/Makefile
717         libatalk/nbp/Makefile
718         libatalk/netddp/Makefile
719         libatalk/util/Makefile
720         man/Makefile
721         man/man1/Makefile
722         man/man3/Makefile
723         man/man4/Makefile
724         man/man5/Makefile
725         man/man8/Makefile
726         sys/Makefile
727         sys/generic/Makefile
728         sys/generic/sys/Makefile
729         sys/netatalk/Makefile
730         sys/netbsd/Makefile
731         sys/netbsd/netatalk/Makefile
732         sys/solaris/Makefile
733         sys/sunos/Makefile
734         sys/ultrix/Makefile
735         ],
736         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
737 )
738