Pull fixes 1.126, 1.127, 1.128 from HEAD
[freeradius.git] / src / modules / rlm_krb5 / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --with-rlm-krb5-lib-dir=DIR       Directory for krb5 library files []"
16 ac_help="$ac_help
17   --with-rlm-krb5-include-dir=DIR   Directory for krb5 include files []"
18 ac_help="$ac_help
19   --enable-heimdal-krb5             Enable if you have heimdal krb5"
20
21 # Initialize some variables set by options.
22 # The variables have the same names as the options, with
23 # dashes changed to underlines.
24 build=NONE
25 cache_file=./config.cache
26 exec_prefix=NONE
27 host=NONE
28 no_create=
29 nonopt=NONE
30 no_recursion=
31 prefix=NONE
32 program_prefix=NONE
33 program_suffix=NONE
34 program_transform_name=s,x,x,
35 silent=
36 site=
37 srcdir=
38 target=NONE
39 verbose=
40 x_includes=NONE
41 x_libraries=NONE
42 bindir='${exec_prefix}/bin'
43 sbindir='${exec_prefix}/sbin'
44 libexecdir='${exec_prefix}/libexec'
45 datadir='${prefix}/share'
46 sysconfdir='${prefix}/etc'
47 sharedstatedir='${prefix}/com'
48 localstatedir='${prefix}/var'
49 libdir='${exec_prefix}/lib'
50 includedir='${prefix}/include'
51 oldincludedir='/usr/include'
52 infodir='${prefix}/info'
53 mandir='${prefix}/man'
54
55 # Initialize some other variables.
56 subdirs=
57 MFLAGS= MAKEFLAGS=
58 SHELL=${CONFIG_SHELL-/bin/sh}
59 # Maximum number of lines to put in a shell here document.
60 ac_max_here_lines=12
61
62 ac_prev=
63 for ac_option
64 do
65
66   # If the previous option needs an argument, assign it.
67   if test -n "$ac_prev"; then
68     eval "$ac_prev=\$ac_option"
69     ac_prev=
70     continue
71   fi
72
73   case "$ac_option" in
74   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
75   *) ac_optarg= ;;
76   esac
77
78   # Accept the important Cygnus configure options, so we can diagnose typos.
79
80   case "$ac_option" in
81
82   -bindir | --bindir | --bindi | --bind | --bin | --bi)
83     ac_prev=bindir ;;
84   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
85     bindir="$ac_optarg" ;;
86
87   -build | --build | --buil | --bui | --bu)
88     ac_prev=build ;;
89   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
90     build="$ac_optarg" ;;
91
92   -cache-file | --cache-file | --cache-fil | --cache-fi \
93   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
94     ac_prev=cache_file ;;
95   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
96   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
97     cache_file="$ac_optarg" ;;
98
99   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
100     ac_prev=datadir ;;
101   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
102   | --da=*)
103     datadir="$ac_optarg" ;;
104
105   -disable-* | --disable-*)
106     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
107     # Reject names that are not valid shell variable names.
108     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
109       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
110     fi
111     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
112     eval "enable_${ac_feature}=no" ;;
113
114   -enable-* | --enable-*)
115     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
116     # Reject names that are not valid shell variable names.
117     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
118       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
119     fi
120     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
121     case "$ac_option" in
122       *=*) ;;
123       *) ac_optarg=yes ;;
124     esac
125     eval "enable_${ac_feature}='$ac_optarg'" ;;
126
127   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
128   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
129   | --exec | --exe | --ex)
130     ac_prev=exec_prefix ;;
131   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
132   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
133   | --exec=* | --exe=* | --ex=*)
134     exec_prefix="$ac_optarg" ;;
135
136   -gas | --gas | --ga | --g)
137     # Obsolete; use --with-gas.
138     with_gas=yes ;;
139
140   -help | --help | --hel | --he)
141     # Omit some internal or obsolete options to make the list less imposing.
142     # This message is too long to be a string in the A/UX 3.1 sh.
143     cat << EOF
144 Usage: configure [options] [host]
145 Options: [defaults in brackets after descriptions]
146 Configuration:
147   --cache-file=FILE       cache test results in FILE
148   --help                  print this message
149   --no-create             do not create output files
150   --quiet, --silent       do not print \`checking...' messages
151   --version               print the version of autoconf that created configure
152 Directory and file names:
153   --prefix=PREFIX         install architecture-independent files in PREFIX
154                           [$ac_default_prefix]
155   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
156                           [same as prefix]
157   --bindir=DIR            user executables in DIR [EPREFIX/bin]
158   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
159   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
160   --datadir=DIR           read-only architecture-independent data in DIR
161                           [PREFIX/share]
162   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
163   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
164                           [PREFIX/com]
165   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
166   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
167   --includedir=DIR        C header files in DIR [PREFIX/include]
168   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
169   --infodir=DIR           info documentation in DIR [PREFIX/info]
170   --mandir=DIR            man documentation in DIR [PREFIX/man]
171   --srcdir=DIR            find the sources in DIR [configure dir or ..]
172   --program-prefix=PREFIX prepend PREFIX to installed program names
173   --program-suffix=SUFFIX append SUFFIX to installed program names
174   --program-transform-name=PROGRAM
175                           run sed PROGRAM on installed program names
176 EOF
177     cat << EOF
178 Host type:
179   --build=BUILD           configure for building on BUILD [BUILD=HOST]
180   --host=HOST             configure for HOST [guessed]
181   --target=TARGET         configure for TARGET [TARGET=HOST]
182 Features and packages:
183   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
184   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
185   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
186   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
187   --x-includes=DIR        X include files are in DIR
188   --x-libraries=DIR       X library files are in DIR
189 EOF
190     if test -n "$ac_help"; then
191       echo "--enable and --with options recognized:$ac_help"
192     fi
193     exit 0 ;;
194
195   -host | --host | --hos | --ho)
196     ac_prev=host ;;
197   -host=* | --host=* | --hos=* | --ho=*)
198     host="$ac_optarg" ;;
199
200   -includedir | --includedir | --includedi | --included | --include \
201   | --includ | --inclu | --incl | --inc)
202     ac_prev=includedir ;;
203   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
204   | --includ=* | --inclu=* | --incl=* | --inc=*)
205     includedir="$ac_optarg" ;;
206
207   -infodir | --infodir | --infodi | --infod | --info | --inf)
208     ac_prev=infodir ;;
209   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
210     infodir="$ac_optarg" ;;
211
212   -libdir | --libdir | --libdi | --libd)
213     ac_prev=libdir ;;
214   -libdir=* | --libdir=* | --libdi=* | --libd=*)
215     libdir="$ac_optarg" ;;
216
217   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
218   | --libexe | --libex | --libe)
219     ac_prev=libexecdir ;;
220   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
221   | --libexe=* | --libex=* | --libe=*)
222     libexecdir="$ac_optarg" ;;
223
224   -localstatedir | --localstatedir | --localstatedi | --localstated \
225   | --localstate | --localstat | --localsta | --localst \
226   | --locals | --local | --loca | --loc | --lo)
227     ac_prev=localstatedir ;;
228   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
229   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
230   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
231     localstatedir="$ac_optarg" ;;
232
233   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
234     ac_prev=mandir ;;
235   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
236     mandir="$ac_optarg" ;;
237
238   -nfp | --nfp | --nf)
239     # Obsolete; use --without-fp.
240     with_fp=no ;;
241
242   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
243   | --no-cr | --no-c)
244     no_create=yes ;;
245
246   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
247   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
248     no_recursion=yes ;;
249
250   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
251   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
252   | --oldin | --oldi | --old | --ol | --o)
253     ac_prev=oldincludedir ;;
254   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
255   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
256   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
257     oldincludedir="$ac_optarg" ;;
258
259   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
260     ac_prev=prefix ;;
261   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
262     prefix="$ac_optarg" ;;
263
264   -program-prefix | --program-prefix | --program-prefi | --program-pref \
265   | --program-pre | --program-pr | --program-p)
266     ac_prev=program_prefix ;;
267   -program-prefix=* | --program-prefix=* | --program-prefi=* \
268   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
269     program_prefix="$ac_optarg" ;;
270
271   -program-suffix | --program-suffix | --program-suffi | --program-suff \
272   | --program-suf | --program-su | --program-s)
273     ac_prev=program_suffix ;;
274   -program-suffix=* | --program-suffix=* | --program-suffi=* \
275   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
276     program_suffix="$ac_optarg" ;;
277
278   -program-transform-name | --program-transform-name \
279   | --program-transform-nam | --program-transform-na \
280   | --program-transform-n | --program-transform- \
281   | --program-transform | --program-transfor \
282   | --program-transfo | --program-transf \
283   | --program-trans | --program-tran \
284   | --progr-tra | --program-tr | --program-t)
285     ac_prev=program_transform_name ;;
286   -program-transform-name=* | --program-transform-name=* \
287   | --program-transform-nam=* | --program-transform-na=* \
288   | --program-transform-n=* | --program-transform-=* \
289   | --program-transform=* | --program-transfor=* \
290   | --program-transfo=* | --program-transf=* \
291   | --program-trans=* | --program-tran=* \
292   | --progr-tra=* | --program-tr=* | --program-t=*)
293     program_transform_name="$ac_optarg" ;;
294
295   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
296   | -silent | --silent | --silen | --sile | --sil)
297     silent=yes ;;
298
299   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
300     ac_prev=sbindir ;;
301   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
302   | --sbi=* | --sb=*)
303     sbindir="$ac_optarg" ;;
304
305   -sharedstatedir | --sharedstatedir | --sharedstatedi \
306   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
307   | --sharedst | --shareds | --shared | --share | --shar \
308   | --sha | --sh)
309     ac_prev=sharedstatedir ;;
310   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
311   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
312   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
313   | --sha=* | --sh=*)
314     sharedstatedir="$ac_optarg" ;;
315
316   -site | --site | --sit)
317     ac_prev=site ;;
318   -site=* | --site=* | --sit=*)
319     site="$ac_optarg" ;;
320
321   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
322     ac_prev=srcdir ;;
323   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
324     srcdir="$ac_optarg" ;;
325
326   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
327   | --syscon | --sysco | --sysc | --sys | --sy)
328     ac_prev=sysconfdir ;;
329   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
330   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
331     sysconfdir="$ac_optarg" ;;
332
333   -target | --target | --targe | --targ | --tar | --ta | --t)
334     ac_prev=target ;;
335   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
336     target="$ac_optarg" ;;
337
338   -v | -verbose | --verbose | --verbos | --verbo | --verb)
339     verbose=yes ;;
340
341   -version | --version | --versio | --versi | --vers)
342     echo "configure generated by autoconf version 2.13"
343     exit 0 ;;
344
345   -with-* | --with-*)
346     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
347     # Reject names that are not valid shell variable names.
348     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
349       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
350     fi
351     ac_package=`echo $ac_package| sed 's/-/_/g'`
352     case "$ac_option" in
353       *=*) ;;
354       *) ac_optarg=yes ;;
355     esac
356     eval "with_${ac_package}='$ac_optarg'" ;;
357
358   -without-* | --without-*)
359     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
360     # Reject names that are not valid shell variable names.
361     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
362       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
363     fi
364     ac_package=`echo $ac_package| sed 's/-/_/g'`
365     eval "with_${ac_package}=no" ;;
366
367   --x)
368     # Obsolete; use --with-x.
369     with_x=yes ;;
370
371   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
372   | --x-incl | --x-inc | --x-in | --x-i)
373     ac_prev=x_includes ;;
374   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
375   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
376     x_includes="$ac_optarg" ;;
377
378   -x-libraries | --x-libraries | --x-librarie | --x-librari \
379   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
380     ac_prev=x_libraries ;;
381   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
382   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
383     x_libraries="$ac_optarg" ;;
384
385   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
386     ;;
387
388   *)
389     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
390       echo "configure: warning: $ac_option: invalid host type" 1>&2
391     fi
392     if test "x$nonopt" != xNONE; then
393       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
394     fi
395     nonopt="$ac_option"
396     ;;
397
398   esac
399 done
400
401 if test -n "$ac_prev"; then
402   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
403 fi
404
405 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
406
407 # File descriptor usage:
408 # 0 standard input
409 # 1 file creation
410 # 2 errors and warnings
411 # 3 some systems may open it to /dev/tty
412 # 4 used on the Kubota Titan
413 # 6 checking for... messages and results
414 # 5 compiler messages saved in config.log
415 if test "$silent" = yes; then
416   exec 6>/dev/null
417 else
418   exec 6>&1
419 fi
420 exec 5>./config.log
421
422 echo "\
423 This file contains any messages produced by compilers while
424 running configure, to aid debugging if configure makes a mistake.
425 " 1>&5
426
427 # Strip out --no-create and --no-recursion so they do not pile up.
428 # Also quote any args containing shell metacharacters.
429 ac_configure_args=
430 for ac_arg
431 do
432   case "$ac_arg" in
433   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
434   | --no-cr | --no-c) ;;
435   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
436   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
437   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
438   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
439   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
440   esac
441 done
442
443 # NLS nuisances.
444 # Only set these to C if already set.  These must not be set unconditionally
445 # because not all systems understand e.g. LANG=C (notably SCO).
446 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
447 # Non-C LC_CTYPE values break the ctype check.
448 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
449 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
450 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
451 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
452
453 # confdefs.h avoids OS command line length limits that DEFS can exceed.
454 rm -rf conftest* confdefs.h
455 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
456 echo > confdefs.h
457
458 # A filename unique to this package, relative to the directory that
459 # configure is in, which we can look for to find out if srcdir is correct.
460 ac_unique_file=rlm_krb5.c
461
462 # Find the source files, if location was not specified.
463 if test -z "$srcdir"; then
464   ac_srcdir_defaulted=yes
465   # Try the directory containing this script, then its parent.
466   ac_prog=$0
467   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
468   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
469   srcdir=$ac_confdir
470   if test ! -r $srcdir/$ac_unique_file; then
471     srcdir=..
472   fi
473 else
474   ac_srcdir_defaulted=no
475 fi
476 if test ! -r $srcdir/$ac_unique_file; then
477   if test "$ac_srcdir_defaulted" = yes; then
478     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
479   else
480     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
481   fi
482 fi
483 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
484
485 # Prefer explicitly selected file to automatically selected ones.
486 if test -z "$CONFIG_SITE"; then
487   if test "x$prefix" != xNONE; then
488     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
489   else
490     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
491   fi
492 fi
493 for ac_site_file in $CONFIG_SITE; do
494   if test -r "$ac_site_file"; then
495     echo "loading site script $ac_site_file"
496     . "$ac_site_file"
497   fi
498 done
499
500 if test -r "$cache_file"; then
501   echo "loading cache $cache_file"
502   . $cache_file
503 else
504   echo "creating cache $cache_file"
505   > $cache_file
506 fi
507
508 ac_ext=c
509 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
510 ac_cpp='$CPP $CPPFLAGS'
511 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
512 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
513 cross_compiling=$ac_cv_prog_cc_cross
514
515 ac_exeext=
516 ac_objext=o
517 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
518   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
519   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
520     ac_n= ac_c='
521 ' ac_t='        '
522   else
523     ac_n=-n ac_c= ac_t=
524   fi
525 else
526   ac_n= ac_c='\c' ac_t=
527 fi
528
529
530 # From configure.in Revision: 1.7 
531
532
533 if test x$with_rlm_krb5 != xno; then
534
535         # Extract the first word of "gcc", so it can be a program name with args.
536 set dummy gcc; ac_word=$2
537 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
538 echo "configure:539: checking for $ac_word" >&5
539 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
540   echo $ac_n "(cached) $ac_c" 1>&6
541 else
542   if test -n "$CC"; then
543   ac_cv_prog_CC="$CC" # Let the user override the test.
544 else
545   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
546   ac_dummy="$PATH"
547   for ac_dir in $ac_dummy; do
548     test -z "$ac_dir" && ac_dir=.
549     if test -f $ac_dir/$ac_word; then
550       ac_cv_prog_CC="gcc"
551       break
552     fi
553   done
554   IFS="$ac_save_ifs"
555 fi
556 fi
557 CC="$ac_cv_prog_CC"
558 if test -n "$CC"; then
559   echo "$ac_t""$CC" 1>&6
560 else
561   echo "$ac_t""no" 1>&6
562 fi
563
564 if test -z "$CC"; then
565   # Extract the first word of "cc", so it can be a program name with args.
566 set dummy cc; ac_word=$2
567 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
568 echo "configure:569: checking for $ac_word" >&5
569 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
570   echo $ac_n "(cached) $ac_c" 1>&6
571 else
572   if test -n "$CC"; then
573   ac_cv_prog_CC="$CC" # Let the user override the test.
574 else
575   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
576   ac_prog_rejected=no
577   ac_dummy="$PATH"
578   for ac_dir in $ac_dummy; do
579     test -z "$ac_dir" && ac_dir=.
580     if test -f $ac_dir/$ac_word; then
581       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
582         ac_prog_rejected=yes
583         continue
584       fi
585       ac_cv_prog_CC="cc"
586       break
587     fi
588   done
589   IFS="$ac_save_ifs"
590 if test $ac_prog_rejected = yes; then
591   # We found a bogon in the path, so make sure we never use it.
592   set dummy $ac_cv_prog_CC
593   shift
594   if test $# -gt 0; then
595     # We chose a different compiler from the bogus one.
596     # However, it has the same basename, so the bogon will be chosen
597     # first if we set CC to just the basename; use the full file name.
598     shift
599     set dummy "$ac_dir/$ac_word" "$@"
600     shift
601     ac_cv_prog_CC="$@"
602   fi
603 fi
604 fi
605 fi
606 CC="$ac_cv_prog_CC"
607 if test -n "$CC"; then
608   echo "$ac_t""$CC" 1>&6
609 else
610   echo "$ac_t""no" 1>&6
611 fi
612
613   if test -z "$CC"; then
614     case "`uname -s`" in
615     *win32* | *WIN32*)
616       # Extract the first word of "cl", so it can be a program name with args.
617 set dummy cl; ac_word=$2
618 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
619 echo "configure:620: checking for $ac_word" >&5
620 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
621   echo $ac_n "(cached) $ac_c" 1>&6
622 else
623   if test -n "$CC"; then
624   ac_cv_prog_CC="$CC" # Let the user override the test.
625 else
626   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
627   ac_dummy="$PATH"
628   for ac_dir in $ac_dummy; do
629     test -z "$ac_dir" && ac_dir=.
630     if test -f $ac_dir/$ac_word; then
631       ac_cv_prog_CC="cl"
632       break
633     fi
634   done
635   IFS="$ac_save_ifs"
636 fi
637 fi
638 CC="$ac_cv_prog_CC"
639 if test -n "$CC"; then
640   echo "$ac_t""$CC" 1>&6
641 else
642   echo "$ac_t""no" 1>&6
643 fi
644  ;;
645     esac
646   fi
647   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
648 fi
649
650 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
651 echo "configure:652: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
652
653 ac_ext=c
654 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
655 ac_cpp='$CPP $CPPFLAGS'
656 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
657 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
658 cross_compiling=$ac_cv_prog_cc_cross
659
660 cat > conftest.$ac_ext << EOF
661
662 #line 663 "configure"
663 #include "confdefs.h"
664
665 main(){return(0);}
666 EOF
667 if { (eval echo configure:668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
668   ac_cv_prog_cc_works=yes
669   # If we can't run a trivial program, we are probably using a cross compiler.
670   if (./conftest; exit) 2>/dev/null; then
671     ac_cv_prog_cc_cross=no
672   else
673     ac_cv_prog_cc_cross=yes
674   fi
675 else
676   echo "configure: failed program was:" >&5
677   cat conftest.$ac_ext >&5
678   ac_cv_prog_cc_works=no
679 fi
680 rm -fr conftest*
681 ac_ext=c
682 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
683 ac_cpp='$CPP $CPPFLAGS'
684 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
685 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
686 cross_compiling=$ac_cv_prog_cc_cross
687
688 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
689 if test $ac_cv_prog_cc_works = no; then
690   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
691 fi
692 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
693 echo "configure:694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
694 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
695 cross_compiling=$ac_cv_prog_cc_cross
696
697 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
698 echo "configure:699: checking whether we are using GNU C" >&5
699 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
700   echo $ac_n "(cached) $ac_c" 1>&6
701 else
702   cat > conftest.c <<EOF
703 #ifdef __GNUC__
704   yes;
705 #endif
706 EOF
707 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
708   ac_cv_prog_gcc=yes
709 else
710   ac_cv_prog_gcc=no
711 fi
712 fi
713
714 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
715
716 if test $ac_cv_prog_gcc = yes; then
717   GCC=yes
718 else
719   GCC=
720 fi
721
722 ac_test_CFLAGS="${CFLAGS+set}"
723 ac_save_CFLAGS="$CFLAGS"
724 CFLAGS=
725 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
726 echo "configure:727: checking whether ${CC-cc} accepts -g" >&5
727 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
728   echo $ac_n "(cached) $ac_c" 1>&6
729 else
730   echo 'void f(){}' > conftest.c
731 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
732   ac_cv_prog_cc_g=yes
733 else
734   ac_cv_prog_cc_g=no
735 fi
736 rm -f conftest*
737
738 fi
739
740 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
741 if test "$ac_test_CFLAGS" = set; then
742   CFLAGS="$ac_save_CFLAGS"
743 elif test $ac_cv_prog_cc_g = yes; then
744   if test "$GCC" = yes; then
745     CFLAGS="-g -O2"
746   else
747     CFLAGS="-g"
748   fi
749 else
750   if test "$GCC" = yes; then
751     CFLAGS="-O2"
752   else
753     CFLAGS=
754   fi
755 fi
756
757         echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
758 echo "configure:759: checking how to run the C preprocessor" >&5
759 # On Suns, sometimes $CPP names a directory.
760 if test -n "$CPP" && test -d "$CPP"; then
761   CPP=
762 fi
763 if test -z "$CPP"; then
764 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
765   echo $ac_n "(cached) $ac_c" 1>&6
766 else
767     # This must be in double quotes, not single quotes, because CPP may get
768   # substituted into the Makefile and "${CC-cc}" will confuse make.
769   CPP="${CC-cc} -E"
770   # On the NeXT, cc -E runs the code through the compiler's parser,
771   # not just through cpp.
772   cat > conftest.$ac_ext <<EOF
773 #line 774 "configure"
774 #include "confdefs.h"
775 #include <assert.h>
776 Syntax Error
777 EOF
778 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
779 { (eval echo configure:780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
780 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
781 if test -z "$ac_err"; then
782   :
783 else
784   echo "$ac_err" >&5
785   echo "configure: failed program was:" >&5
786   cat conftest.$ac_ext >&5
787   rm -rf conftest*
788   CPP="${CC-cc} -E -traditional-cpp"
789   cat > conftest.$ac_ext <<EOF
790 #line 791 "configure"
791 #include "confdefs.h"
792 #include <assert.h>
793 Syntax Error
794 EOF
795 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
796 { (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
797 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
798 if test -z "$ac_err"; then
799   :
800 else
801   echo "$ac_err" >&5
802   echo "configure: failed program was:" >&5
803   cat conftest.$ac_ext >&5
804   rm -rf conftest*
805   CPP="${CC-cc} -nologo -E"
806   cat > conftest.$ac_ext <<EOF
807 #line 808 "configure"
808 #include "confdefs.h"
809 #include <assert.h>
810 Syntax Error
811 EOF
812 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
813 { (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
814 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
815 if test -z "$ac_err"; then
816   :
817 else
818   echo "$ac_err" >&5
819   echo "configure: failed program was:" >&5
820   cat conftest.$ac_ext >&5
821   rm -rf conftest*
822   CPP=/lib/cpp
823 fi
824 rm -f conftest*
825 fi
826 rm -f conftest*
827 fi
828 rm -f conftest*
829   ac_cv_prog_CPP="$CPP"
830 fi
831   CPP="$ac_cv_prog_CPP"
832 else
833   ac_cv_prog_CPP="$CPP"
834 fi
835 echo "$ac_t""$CPP" 1>&6
836
837
838                 rlm_krb5_lib_dir=
839         # Check whether --with-rlm-krb5-lib-dir or --without-rlm-krb5-lib-dir was given.
840 if test "${with_rlm_krb5_lib_dir+set}" = set; then
841   withval="$with_rlm_krb5_lib_dir"
842    case "$withval" in
843             no)
844                 { echo "configure: error: Need rlm-krb5-lib-dir" 1>&2; exit 1; }
845                 ;;
846             yes)
847                 ;;
848             *)
849                 rlm_krb5_lib_dir="$withval"
850                 ;;
851           esac 
852         
853 fi
854
855
856                 rlm_krb5_inc_dir=
857         # Check whether --with-rlm-krb5-include-dir or --without-rlm-krb5-include-dir was given.
858 if test "${with_rlm_krb5_include_dir+set}" = set; then
859   withval="$with_rlm_krb5_include_dir"
860    case "$withval" in
861             no)
862                 { echo "configure: error: Need rlm-krb5-include-dir" 1>&2; exit 1; }
863                 ;;
864             yes)
865                 ;;
866             *)
867                 rlm_krb5_include_dir="$withval"
868                 ;;
869           esac 
870         
871 fi
872
873
874               # Check whether --enable-heimdal-krb5 or --disable-heimdal-krb5 was given.
875 if test "${enable_heimdal_krb5+set}" = set; then
876   enableval="$enable_heimdal_krb5"
877    case "$enableval" in
878                yes)
879                        krb5_h_cflags="-DHEIMDAL_KRB5"
880                        ;;
881          esac 
882        
883 fi
884
885
886         smart_try_dir=$rlm_krb5_include_dir
887         
888
889 ac_safe=`echo "krb5.h" | sed 'y%./+-%__pm%'`
890 echo $ac_n "checking for krb5.h""... $ac_c" 1>&6
891 echo "configure:892: checking for krb5.h" >&5
892
893 smart_include=
894 smart_include_dir=
895
896   old_CFLAGS="$CFLAGS"
897   cat > conftest.$ac_ext <<EOF
898 #line 899 "configure"
899 #include "confdefs.h"
900
901                   #include <krb5.h>
902 int main() {
903  int a = 1;
904 ; return 0; }
905 EOF
906 if { (eval echo configure:907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
907   rm -rf conftest*
908   smart_include=" "
909 else
910   echo "configure: failed program was:" >&5
911   cat conftest.$ac_ext >&5
912   rm -rf conftest*
913   smart_include=
914 fi
915 rm -f conftest*
916
917   if test "x$smart_include" = "x"; then
918     
919
920 if test "x$LOCATE" != "x"; then
921         DIRS=
922   file=krb5.h
923
924   for x in `${LOCATE} $file 2>/dev/null`; do
925                                         base=`echo $x | sed "s%/${file}%%"`
926     if test "x$x" = "x$base"; then
927       continue;
928     fi
929
930     dir=`${DIRNAME} $x 2>/dev/null`
931                 exclude=`echo ${dir} | ${GREP} /home`
932     if test "x$exclude" != "x"; then
933       continue
934     fi
935
936                     already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
937     if test "x$already" = "x"; then
938       DIRS="$DIRS $dir"
939     fi
940   done
941 fi
942
943 eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
944
945
946     for try in $smart_try_dir $smart_include_dir /usr/local/include/ /opt/include; do
947       CFLAGS="$old_CFLAGS -I$try"
948
949       cat > conftest.$ac_ext <<EOF
950 #line 951 "configure"
951 #include "confdefs.h"
952
953                        #include <krb5.h>
954 int main() {
955  int a = 1;
956 ; return 0; }
957 EOF
958 if { (eval echo configure:959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
959   rm -rf conftest*
960   smart_include="-I$try"
961 else
962   echo "configure: failed program was:" >&5
963   cat conftest.$ac_ext >&5
964   rm -rf conftest*
965   smart_include=
966 fi
967 rm -f conftest*
968
969       if test "x$smart_include" != "x"; then
970         break;
971       fi
972     done
973     CFLAGS="$old_CFLAGS"
974   fi
975
976         if test "x$smart_include" != "x"; then
977     echo "$ac_t""yes" 1>&6
978     eval "ac_cv_header_$ac_safe=yes"
979     CFLAGS="$old_CFLAGS $smart_include"
980     SMART_CFLAGS="$SMART_CFLAGS $smart_include"
981   else
982     echo "$ac_t""no" 1>&6 
983 fi
984
985
986         smart_try_dir=$rlm_krb5_lib_dir
987
988         
989
990 sm_lib_safe=`echo "k5crypto" | sed 'y%./+-%__p_%'`
991 sm_func_safe=`echo "krb5_encrypt_data" | sed 'y%./+-%__p_%'`
992 echo $ac_n "checking for krb5_encrypt_data in -lk5crypto""... $ac_c" 1>&6
993 echo "configure:994: checking for krb5_encrypt_data in -lk5crypto" >&5
994
995 smart_lib=
996 smart_lib_dir=
997
998   old_LIBS="$LIBS"
999   LIBS="$LIBS -lk5crypto"
1000   cat > conftest.$ac_ext <<EOF
1001 #line 1002 "configure"
1002 #include "confdefs.h"
1003 extern char krb5_encrypt_data();
1004 int main() {
1005  krb5_encrypt_data()
1006 ; return 0; }
1007 EOF
1008 if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1009   rm -rf conftest*
1010   smart_lib="-lk5crypto"
1011 else
1012   echo "configure: failed program was:" >&5
1013   cat conftest.$ac_ext >&5
1014 fi
1015 rm -f conftest*
1016
1017   if test "x$smart_lib" = "x"; then
1018     
1019
1020 if test "x$LOCATE" != "x"; then
1021         DIRS=
1022   file=libk5crypto${libltdl_cv_shlibext}
1023
1024   for x in `${LOCATE} $file 2>/dev/null`; do
1025                                         base=`echo $x | sed "s%/${file}%%"`
1026     if test "x$x" = "x$base"; then
1027       continue;
1028     fi
1029
1030     dir=`${DIRNAME} $x 2>/dev/null`
1031                 exclude=`echo ${dir} | ${GREP} /home`
1032     if test "x$exclude" != "x"; then
1033       continue
1034     fi
1035
1036                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1037     if test "x$already" = "x"; then
1038       DIRS="$DIRS $dir"
1039     fi
1040   done
1041 fi
1042
1043 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1044
1045     
1046
1047 if test "x$LOCATE" != "x"; then
1048         DIRS=
1049   file=libk5crypto.a
1050
1051   for x in `${LOCATE} $file 2>/dev/null`; do
1052                                         base=`echo $x | sed "s%/${file}%%"`
1053     if test "x$x" = "x$base"; then
1054       continue;
1055     fi
1056
1057     dir=`${DIRNAME} $x 2>/dev/null`
1058                 exclude=`echo ${dir} | ${GREP} /home`
1059     if test "x$exclude" != "x"; then
1060       continue
1061     fi
1062
1063                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1064     if test "x$already" = "x"; then
1065       DIRS="$DIRS $dir"
1066     fi
1067   done
1068 fi
1069
1070 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1071
1072
1073     for try in $smart_try_dir $smart_lib_dir /usr/local/lib/ /opt/lib; do
1074       LIBS="$old_LIBS -L$try -lk5crypto"
1075
1076       cat > conftest.$ac_ext <<EOF
1077 #line 1078 "configure"
1078 #include "confdefs.h"
1079 extern char krb5_encrypt_data();
1080 int main() {
1081  krb5_encrypt_data()
1082 ; return 0; }
1083 EOF
1084 if { (eval echo configure:1085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1085   rm -rf conftest*
1086   smart_lib="-L$try -lk5crypto"
1087 else
1088   echo "configure: failed program was:" >&5
1089   cat conftest.$ac_ext >&5
1090 fi
1091 rm -f conftest*
1092       if test "x$smart_lib" != "x"; then
1093         break;
1094       fi
1095     done
1096     LIBS="$old_LIBS"
1097   fi
1098
1099         if test "x$smart_lib" != "x"; then
1100     echo "$ac_t""yes" 1>&6
1101     eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
1102     LIBS="$old_LIBS $smart_lib"
1103     SMART_LIBS="$SMART_LIBS $smart_lib"
1104   else
1105     echo "$ac_t""no" 1>&6 
1106 fi
1107
1108         if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = "xyes"; then
1109                 krb5libcrypto="-lk5crypto"
1110         fi
1111
1112         
1113
1114 sm_lib_safe=`echo "crypto" | sed 'y%./+-%__p_%'`
1115 sm_func_safe=`echo "DH_new" | sed 'y%./+-%__p_%'`
1116 echo $ac_n "checking for DH_new in -lcrypto""... $ac_c" 1>&6
1117 echo "configure:1118: checking for DH_new in -lcrypto" >&5
1118
1119 smart_lib=
1120 smart_lib_dir=
1121
1122   old_LIBS="$LIBS"
1123   LIBS="$LIBS -lcrypto"
1124   cat > conftest.$ac_ext <<EOF
1125 #line 1126 "configure"
1126 #include "confdefs.h"
1127 extern char DH_new();
1128 int main() {
1129  DH_new()
1130 ; return 0; }
1131 EOF
1132 if { (eval echo configure:1133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1133   rm -rf conftest*
1134   smart_lib="-lcrypto"
1135 else
1136   echo "configure: failed program was:" >&5
1137   cat conftest.$ac_ext >&5
1138 fi
1139 rm -f conftest*
1140
1141   if test "x$smart_lib" = "x"; then
1142     
1143
1144 if test "x$LOCATE" != "x"; then
1145         DIRS=
1146   file=libcrypto${libltdl_cv_shlibext}
1147
1148   for x in `${LOCATE} $file 2>/dev/null`; do
1149                                         base=`echo $x | sed "s%/${file}%%"`
1150     if test "x$x" = "x$base"; then
1151       continue;
1152     fi
1153
1154     dir=`${DIRNAME} $x 2>/dev/null`
1155                 exclude=`echo ${dir} | ${GREP} /home`
1156     if test "x$exclude" != "x"; then
1157       continue
1158     fi
1159
1160                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1161     if test "x$already" = "x"; then
1162       DIRS="$DIRS $dir"
1163     fi
1164   done
1165 fi
1166
1167 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1168
1169     
1170
1171 if test "x$LOCATE" != "x"; then
1172         DIRS=
1173   file=libcrypto.a
1174
1175   for x in `${LOCATE} $file 2>/dev/null`; do
1176                                         base=`echo $x | sed "s%/${file}%%"`
1177     if test "x$x" = "x$base"; then
1178       continue;
1179     fi
1180
1181     dir=`${DIRNAME} $x 2>/dev/null`
1182                 exclude=`echo ${dir} | ${GREP} /home`
1183     if test "x$exclude" != "x"; then
1184       continue
1185     fi
1186
1187                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1188     if test "x$already" = "x"; then
1189       DIRS="$DIRS $dir"
1190     fi
1191   done
1192 fi
1193
1194 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1195
1196
1197     for try in $smart_try_dir $smart_lib_dir /usr/local/lib/ /opt/lib; do
1198       LIBS="$old_LIBS -L$try -lcrypto"
1199
1200       cat > conftest.$ac_ext <<EOF
1201 #line 1202 "configure"
1202 #include "confdefs.h"
1203 extern char DH_new();
1204 int main() {
1205  DH_new()
1206 ; return 0; }
1207 EOF
1208 if { (eval echo configure:1209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1209   rm -rf conftest*
1210   smart_lib="-L$try -lcrypto"
1211 else
1212   echo "configure: failed program was:" >&5
1213   cat conftest.$ac_ext >&5
1214 fi
1215 rm -f conftest*
1216       if test "x$smart_lib" != "x"; then
1217         break;
1218       fi
1219     done
1220     LIBS="$old_LIBS"
1221   fi
1222
1223         if test "x$smart_lib" != "x"; then
1224     echo "$ac_t""yes" 1>&6
1225     eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
1226     LIBS="$old_LIBS $smart_lib"
1227     SMART_LIBS="$SMART_LIBS $smart_lib"
1228   else
1229     echo "$ac_t""no" 1>&6 
1230 fi
1231
1232         if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then
1233                 krb5libcrypto="-lcrypto"
1234         fi
1235
1236         if test x$krb5libcrypto = x; then
1237                 echo "configure: warning: neither krb5 'k5crypto' nor 'crypto' libraries are found!" 1>&2
1238         fi
1239
1240         
1241
1242 sm_lib_safe=`echo "com_err" | sed 'y%./+-%__p_%'`
1243 sm_func_safe=`echo "set_com_err_hook" | sed 'y%./+-%__p_%'`
1244 echo $ac_n "checking for set_com_err_hook in -lcom_err""... $ac_c" 1>&6
1245 echo "configure:1246: checking for set_com_err_hook in -lcom_err" >&5
1246
1247 smart_lib=
1248 smart_lib_dir=
1249
1250   old_LIBS="$LIBS"
1251   LIBS="$LIBS -lcom_err"
1252   cat > conftest.$ac_ext <<EOF
1253 #line 1254 "configure"
1254 #include "confdefs.h"
1255 extern char set_com_err_hook();
1256 int main() {
1257  set_com_err_hook()
1258 ; return 0; }
1259 EOF
1260 if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1261   rm -rf conftest*
1262   smart_lib="-lcom_err"
1263 else
1264   echo "configure: failed program was:" >&5
1265   cat conftest.$ac_ext >&5
1266 fi
1267 rm -f conftest*
1268
1269   if test "x$smart_lib" = "x"; then
1270     
1271
1272 if test "x$LOCATE" != "x"; then
1273         DIRS=
1274   file=libcom_err${libltdl_cv_shlibext}
1275
1276   for x in `${LOCATE} $file 2>/dev/null`; do
1277                                         base=`echo $x | sed "s%/${file}%%"`
1278     if test "x$x" = "x$base"; then
1279       continue;
1280     fi
1281
1282     dir=`${DIRNAME} $x 2>/dev/null`
1283                 exclude=`echo ${dir} | ${GREP} /home`
1284     if test "x$exclude" != "x"; then
1285       continue
1286     fi
1287
1288                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1289     if test "x$already" = "x"; then
1290       DIRS="$DIRS $dir"
1291     fi
1292   done
1293 fi
1294
1295 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1296
1297     
1298
1299 if test "x$LOCATE" != "x"; then
1300         DIRS=
1301   file=libcom_err.a
1302
1303   for x in `${LOCATE} $file 2>/dev/null`; do
1304                                         base=`echo $x | sed "s%/${file}%%"`
1305     if test "x$x" = "x$base"; then
1306       continue;
1307     fi
1308
1309     dir=`${DIRNAME} $x 2>/dev/null`
1310                 exclude=`echo ${dir} | ${GREP} /home`
1311     if test "x$exclude" != "x"; then
1312       continue
1313     fi
1314
1315                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1316     if test "x$already" = "x"; then
1317       DIRS="$DIRS $dir"
1318     fi
1319   done
1320 fi
1321
1322 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1323
1324
1325     for try in $smart_try_dir $smart_lib_dir /usr/local/lib/ /opt/lib; do
1326       LIBS="$old_LIBS -L$try -lcom_err"
1327
1328       cat > conftest.$ac_ext <<EOF
1329 #line 1330 "configure"
1330 #include "confdefs.h"
1331 extern char set_com_err_hook();
1332 int main() {
1333  set_com_err_hook()
1334 ; return 0; }
1335 EOF
1336 if { (eval echo configure:1337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1337   rm -rf conftest*
1338   smart_lib="-L$try -lcom_err"
1339 else
1340   echo "configure: failed program was:" >&5
1341   cat conftest.$ac_ext >&5
1342 fi
1343 rm -f conftest*
1344       if test "x$smart_lib" != "x"; then
1345         break;
1346       fi
1347     done
1348     LIBS="$old_LIBS"
1349   fi
1350
1351         if test "x$smart_lib" != "x"; then
1352     echo "$ac_t""yes" 1>&6
1353     eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
1354     LIBS="$old_LIBS $smart_lib"
1355     SMART_LIBS="$SMART_LIBS $smart_lib"
1356   else
1357     echo "$ac_t""no" 1>&6 
1358 fi
1359
1360         if test "x$ac_cv_lib_com_err_set_com_err_hook" != "xyes"; then
1361                 echo "configure: warning: the comm_err library isn't found!" 1>&2 
1362         fi
1363
1364         
1365
1366 sm_lib_safe=`echo "krb5" | sed 'y%./+-%__p_%'`
1367 sm_func_safe=`echo "krb5_init_context" | sed 'y%./+-%__p_%'`
1368 echo $ac_n "checking for krb5_init_context in -lkrb5""... $ac_c" 1>&6
1369 echo "configure:1370: checking for krb5_init_context in -lkrb5" >&5
1370
1371 smart_lib=
1372 smart_lib_dir=
1373
1374   old_LIBS="$LIBS"
1375   LIBS="$LIBS -lkrb5"
1376   cat > conftest.$ac_ext <<EOF
1377 #line 1378 "configure"
1378 #include "confdefs.h"
1379 extern char krb5_init_context();
1380 int main() {
1381  krb5_init_context()
1382 ; return 0; }
1383 EOF
1384 if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1385   rm -rf conftest*
1386   smart_lib="-lkrb5"
1387 else
1388   echo "configure: failed program was:" >&5
1389   cat conftest.$ac_ext >&5
1390 fi
1391 rm -f conftest*
1392
1393   if test "x$smart_lib" = "x"; then
1394     
1395
1396 if test "x$LOCATE" != "x"; then
1397         DIRS=
1398   file=libkrb5${libltdl_cv_shlibext}
1399
1400   for x in `${LOCATE} $file 2>/dev/null`; do
1401                                         base=`echo $x | sed "s%/${file}%%"`
1402     if test "x$x" = "x$base"; then
1403       continue;
1404     fi
1405
1406     dir=`${DIRNAME} $x 2>/dev/null`
1407                 exclude=`echo ${dir} | ${GREP} /home`
1408     if test "x$exclude" != "x"; then
1409       continue
1410     fi
1411
1412                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1413     if test "x$already" = "x"; then
1414       DIRS="$DIRS $dir"
1415     fi
1416   done
1417 fi
1418
1419 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1420
1421     
1422
1423 if test "x$LOCATE" != "x"; then
1424         DIRS=
1425   file=libkrb5.a
1426
1427   for x in `${LOCATE} $file 2>/dev/null`; do
1428                                         base=`echo $x | sed "s%/${file}%%"`
1429     if test "x$x" = "x$base"; then
1430       continue;
1431     fi
1432
1433     dir=`${DIRNAME} $x 2>/dev/null`
1434                 exclude=`echo ${dir} | ${GREP} /home`
1435     if test "x$exclude" != "x"; then
1436       continue
1437     fi
1438
1439                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1440     if test "x$already" = "x"; then
1441       DIRS="$DIRS $dir"
1442     fi
1443   done
1444 fi
1445
1446 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1447
1448
1449     for try in $smart_try_dir $smart_lib_dir /usr/local/lib/ /opt/lib; do
1450       LIBS="$old_LIBS -L$try -lkrb5"
1451
1452       cat > conftest.$ac_ext <<EOF
1453 #line 1454 "configure"
1454 #include "confdefs.h"
1455 extern char krb5_init_context();
1456 int main() {
1457  krb5_init_context()
1458 ; return 0; }
1459 EOF
1460 if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1461   rm -rf conftest*
1462   smart_lib="-L$try -lkrb5"
1463 else
1464   echo "configure: failed program was:" >&5
1465   cat conftest.$ac_ext >&5
1466 fi
1467 rm -f conftest*
1468       if test "x$smart_lib" != "x"; then
1469         break;
1470       fi
1471     done
1472     LIBS="$old_LIBS"
1473   fi
1474
1475         if test "x$smart_lib" != "x"; then
1476     echo "$ac_t""yes" 1>&6
1477     eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
1478     LIBS="$old_LIBS $smart_lib"
1479     SMART_LIBS="$SMART_LIBS $smart_lib"
1480   else
1481     echo "$ac_t""no" 1>&6 
1482 fi
1483
1484         if test "x$ac_cv_lib_krb5_krb5_init_context" != "xyes"; then
1485                 fail="$fail krb5"
1486         fi
1487
1488         targetname=rlm_krb5
1489 else
1490         targetname=
1491         echo \*\*\* module rlm_krb5 is disabled.
1492 fi
1493
1494 if test x"$fail" != x""; then
1495         if test x"${enable_strict_dependencies}" = x"yes"; then
1496                 { echo "configure: error: set --without-rlm_krb5 to disable it explicitly." 1>&2; exit 1; }
1497         else
1498                 echo "configure: warning: silently not building rlm_krb5." 1>&2
1499                 echo "configure: warning: FAILURE: rlm_krb5 requires: $fail." 1>&2; 
1500                 targetname=""
1501         fi
1502 fi
1503
1504 krb5_ldflags=$SMART_LIBS
1505 krb5_cflags="${krb5_h_cflags} $SMART_CFLAGS"
1506
1507
1508
1509
1510 trap '' 1 2 15
1511 cat > confcache <<\EOF
1512 # This file is a shell script that caches the results of configure
1513 # tests run on this system so they can be shared between configure
1514 # scripts and configure runs.  It is not useful on other systems.
1515 # If it contains results you don't want to keep, you may remove or edit it.
1516 #
1517 # By default, configure uses ./config.cache as the cache file,
1518 # creating it if it does not exist already.  You can give configure
1519 # the --cache-file=FILE option to use a different cache file; that is
1520 # what configure does when it calls configure scripts in
1521 # subdirectories, so they share the cache.
1522 # Giving --cache-file=/dev/null disables caching, for debugging configure.
1523 # config.status only pays attention to the cache file if you give it the
1524 # --recheck option to rerun configure.
1525 #
1526 EOF
1527 # The following way of writing the cache mishandles newlines in values,
1528 # but we know of no workaround that is simple, portable, and efficient.
1529 # So, don't put newlines in cache variables' values.
1530 # Ultrix sh set writes to stderr and can't be redirected directly,
1531 # and sets the high bit in the cache file unless we assign to the vars.
1532 (set) 2>&1 |
1533   case `(ac_space=' '; set | grep ac_space) 2>&1` in
1534   *ac_space=\ *)
1535     # `set' does not quote correctly, so add quotes (double-quote substitution
1536     # turns \\\\ into \\, and sed turns \\ into \).
1537     sed -n \
1538       -e "s/'/'\\\\''/g" \
1539       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
1540     ;;
1541   *)
1542     # `set' quotes correctly as required by POSIX, so do not add quotes.
1543     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
1544     ;;
1545   esac >> confcache
1546 if cmp -s $cache_file confcache; then
1547   :
1548 else
1549   if test -w $cache_file; then
1550     echo "updating cache $cache_file"
1551     cat confcache > $cache_file
1552   else
1553     echo "not updating unwritable cache $cache_file"
1554   fi
1555 fi
1556 rm -f confcache
1557
1558 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1559
1560 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1561 # Let make expand exec_prefix.
1562 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1563
1564 # Any assignment to VPATH causes Sun make to only execute
1565 # the first set of double-colon rules, so remove it if not needed.
1566 # If there is a colon in the path, we need to keep it.
1567 if test "x$srcdir" = x.; then
1568   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
1569 fi
1570
1571 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1572
1573 # Transform confdefs.h into DEFS.
1574 # Protect against shell expansion while executing Makefile rules.
1575 # Protect against Makefile macro expansion.
1576 cat > conftest.defs <<\EOF
1577 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
1578 s%[     `~#$^&*(){}\\|;'"<>?]%\\&%g
1579 s%\[%\\&%g
1580 s%\]%\\&%g
1581 s%\$%$$%g
1582 EOF
1583 DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
1584 rm -f conftest.defs
1585
1586
1587 # Without the "./", some shells look in PATH for config.status.
1588 : ${CONFIG_STATUS=./config.status}
1589
1590 echo creating $CONFIG_STATUS
1591 rm -f $CONFIG_STATUS
1592 cat > $CONFIG_STATUS <<EOF
1593 #! /bin/sh
1594 # Generated automatically by configure.
1595 # Run this file to recreate the current configuration.
1596 # This directory was configured as follows,
1597 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1598 #
1599 # $0 $ac_configure_args
1600 #
1601 # Compiler output produced by configure, useful for debugging
1602 # configure, is in ./config.log if it exists.
1603
1604 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1605 for ac_option
1606 do
1607   case "\$ac_option" in
1608   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1609     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1610     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1611   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1612     echo "$CONFIG_STATUS generated by autoconf version 2.13"
1613     exit 0 ;;
1614   -help | --help | --hel | --he | --h)
1615     echo "\$ac_cs_usage"; exit 0 ;;
1616   *) echo "\$ac_cs_usage"; exit 1 ;;
1617   esac
1618 done
1619
1620 ac_given_srcdir=$srcdir
1621
1622 trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1623 EOF
1624 cat >> $CONFIG_STATUS <<EOF
1625
1626 # Protect against being on the right side of a sed subst in config.status.
1627 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
1628  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
1629 $ac_vpsub
1630 $extrasub
1631 s%@SHELL@%$SHELL%g
1632 s%@CFLAGS@%$CFLAGS%g
1633 s%@CPPFLAGS@%$CPPFLAGS%g
1634 s%@CXXFLAGS@%$CXXFLAGS%g
1635 s%@FFLAGS@%$FFLAGS%g
1636 s%@DEFS@%$DEFS%g
1637 s%@LDFLAGS@%$LDFLAGS%g
1638 s%@LIBS@%$LIBS%g
1639 s%@exec_prefix@%$exec_prefix%g
1640 s%@prefix@%$prefix%g
1641 s%@program_transform_name@%$program_transform_name%g
1642 s%@bindir@%$bindir%g
1643 s%@sbindir@%$sbindir%g
1644 s%@libexecdir@%$libexecdir%g
1645 s%@datadir@%$datadir%g
1646 s%@sysconfdir@%$sysconfdir%g
1647 s%@sharedstatedir@%$sharedstatedir%g
1648 s%@localstatedir@%$localstatedir%g
1649 s%@libdir@%$libdir%g
1650 s%@includedir@%$includedir%g
1651 s%@oldincludedir@%$oldincludedir%g
1652 s%@infodir@%$infodir%g
1653 s%@mandir@%$mandir%g
1654 s%@CC@%$CC%g
1655 s%@CPP@%$CPP%g
1656 s%@krb5_cflags@%$krb5_cflags%g
1657 s%@krb5_ldflags@%$krb5_ldflags%g
1658 s%@targetname@%$targetname%g
1659
1660 CEOF
1661 EOF
1662
1663 cat >> $CONFIG_STATUS <<\EOF
1664
1665 # Split the substitutions into bite-sized pieces for seds with
1666 # small command number limits, like on Digital OSF/1 and HP-UX.
1667 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
1668 ac_file=1 # Number of current file.
1669 ac_beg=1 # First line for current file.
1670 ac_end=$ac_max_sed_cmds # Line after last line for current file.
1671 ac_more_lines=:
1672 ac_sed_cmds=""
1673 while $ac_more_lines; do
1674   if test $ac_beg -gt 1; then
1675     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
1676   else
1677     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
1678   fi
1679   if test ! -s conftest.s$ac_file; then
1680     ac_more_lines=false
1681     rm -f conftest.s$ac_file
1682   else
1683     if test -z "$ac_sed_cmds"; then
1684       ac_sed_cmds="sed -f conftest.s$ac_file"
1685     else
1686       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
1687     fi
1688     ac_file=`expr $ac_file + 1`
1689     ac_beg=$ac_end
1690     ac_end=`expr $ac_end + $ac_max_sed_cmds`
1691   fi
1692 done
1693 if test -z "$ac_sed_cmds"; then
1694   ac_sed_cmds=cat
1695 fi
1696 EOF
1697
1698 cat >> $CONFIG_STATUS <<EOF
1699
1700 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
1701 EOF
1702 cat >> $CONFIG_STATUS <<\EOF
1703 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
1704   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
1705   case "$ac_file" in
1706   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
1707        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1708   *) ac_file_in="${ac_file}.in" ;;
1709   esac
1710
1711   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
1712
1713   # Remove last slash and all that follows it.  Not all systems have dirname.
1714   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
1715   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
1716     # The file is in a subdirectory.
1717     test ! -d "$ac_dir" && mkdir "$ac_dir"
1718     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
1719     # A "../" for each directory in $ac_dir_suffix.
1720     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
1721   else
1722     ac_dir_suffix= ac_dots=
1723   fi
1724
1725   case "$ac_given_srcdir" in
1726   .)  srcdir=.
1727       if test -z "$ac_dots"; then top_srcdir=.
1728       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
1729   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
1730   *) # Relative path.
1731     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
1732     top_srcdir="$ac_dots$ac_given_srcdir" ;;
1733   esac
1734
1735
1736   echo creating "$ac_file"
1737   rm -f "$ac_file"
1738   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
1739   case "$ac_file" in
1740   *Makefile*) ac_comsub="1i\\
1741 # $configure_input" ;;
1742   *) ac_comsub= ;;
1743   esac
1744
1745   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
1746   sed -e "$ac_comsub
1747 s%@configure_input@%$configure_input%g
1748 s%@srcdir@%$srcdir%g
1749 s%@top_srcdir@%$top_srcdir%g
1750 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
1751 fi; done
1752 rm -f conftest.s*
1753
1754 EOF
1755 cat >> $CONFIG_STATUS <<EOF
1756
1757 EOF
1758 cat >> $CONFIG_STATUS <<\EOF
1759
1760 exit 0
1761 EOF
1762 chmod +x $CONFIG_STATUS
1763 rm -fr confdefs* $ac_clean_files
1764 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1765