b53d42ed5993864f288424c4ebdb4bd2482449b4
[apps/madmutt.git] / 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   --disable-pgp              Disable PGP support"
16 ac_help="$ac_help
17   --disable-smime            Disable SMIME support"
18 ac_help="$ac_help
19   --with-mixmaster[=PATH]    Include Mixmaster support"
20 ac_help="$ac_help
21   --with-slang[=DIR]         Use S-Lang instead of ncurses"
22 ac_help="$ac_help
23   --with-curses=DIR          Where ncurses is installed "
24 ac_help="$ac_help
25   --with-regex               Use the GNU regex library "
26 ac_help="$ac_help
27   --with-homespool[=FILE]    File in user's directory where new mail is spooled"
28 ac_help="$ac_help
29   --with-mailpath=DIR        Directory where spool mailboxes are located"
30 ac_help="$ac_help
31   --enable-external-dotlock  Force use of an external dotlock program"
32 ac_help="$ac_help
33   --with-docdir=PATH         Specify where to put the documentation"
34 ac_help="$ac_help
35   --with-domain=DOMAIN       Specify your DNS domain name"
36 ac_help="$ac_help
37   --enable-pop               Enable POP3 support"
38 ac_help="$ac_help
39   --enable-imap              Enable IMAP support"
40 ac_help="$ac_help
41   --enable-nntp              Enable NNTP support"
42 ac_help="$ac_help
43     --with-gss[=PFX]         Compile in GSSAPI authentication for IMAP"
44 ac_help="$ac_help
45   --with-ssl[=PFX]           Compile in SSL support for POP/IMAP"
46 ac_help="$ac_help
47   --with-gnutls[=PFX]        Compile in GNU TLS support for POP/IMAP"
48 ac_help="$ac_help
49   --with-nss[=PFX]           Compile in SSL support for POP/IMAP via NSS"
50 ac_help="$ac_help
51   --with-sasl[=PFX]          Use Cyrus SASL library for POP/IMAP authentication"
52 ac_help="$ac_help
53   --with-sasl2[=PFX]         Use Cyrus SASL library version 2 for POP/IMAP authentication"
54 ac_help="$ac_help
55   --with-idn=[PFX]              Use GNU libidn for domain names"
56 ac_help="$ac_help
57   --enable-debug             Enable debugging support"
58 ac_help="$ac_help
59   --enable-flock             Use flock() to lock files"
60 ac_help="$ac_help
61   --disable-fcntl            Do NOT use fcntl() to lock files "
62 ac_help="$ac_help
63    --disable-inodesort  Do NOT read files in maildir folders sorted by inode. "
64 ac_help="$ac_help
65   --disable-warnings         Turn off compiler warnings (not recommended)"
66 ac_help="$ac_help
67   --enable-nfs-fix           Work around an NFS with broken attributes caching "
68 ac_help="$ac_help
69   --enable-buffy-size        Use file size attribute instead of access time "
70 ac_help="$ac_help
71   --enable-mailtool          Enable Sun mailtool attachments support "
72 ac_help="$ac_help
73   --enable-compressed        Enable compressed folders support "
74 ac_help="$ac_help
75   --enable-locales-fix       The result of isprint() is unreliable "
76 ac_help="$ac_help
77   --with-exec-shell=SHELL    Specify alternate shell (ONLY if /bin/sh is broken)"
78 ac_help="$ac_help
79   --enable-exact-address     Enable regeneration of email addresses"
80 ac_help="$ac_help
81   --enable-hcache            Enable header caching"
82 ac_help="$ac_help
83   --without-gdbm             Get rid of gdbm even if it is available "
84 ac_help="$ac_help
85   --with-bdb[=DIR]          Use BerkeleyDB4 if gdbm is not available "
86 ac_help="$ac_help
87   --enable-hcache            Enable header caching"
88 ac_help="$ac_help
89   --without-gdbm             Get rid of gdbm even if it is available "
90 ac_help="$ac_help
91   --with-bdb[=DIR]          Use BerkeleyDB4 if gdbm is not available "
92 ac_help="$ac_help
93   --disable-iconv            Disable iconv support"
94 ac_help="$ac_help
95   --with-libiconv-prefix=DIR Search for libiconv in DIR/include and DIR/lib"
96 ac_help="$ac_help
97   --disable-nls              Do not use Native Language Support"
98 ac_help="$ac_help
99   --with-included-gettext    Use the GNU gettext library included here"
100 ac_help="$ac_help
101   --without-wc-funcs         Do not use the system's wchar_t functions"
102 ac_help="$ac_help
103   --with-libesmtp=DIR      Compile in support for libesmtp for the MTA"
104
105 # Initialize some variables set by options.
106 # The variables have the same names as the options, with
107 # dashes changed to underlines.
108 build=NONE
109 cache_file=./config.cache
110 exec_prefix=NONE
111 host=NONE
112 no_create=
113 nonopt=NONE
114 no_recursion=
115 prefix=NONE
116 program_prefix=NONE
117 program_suffix=NONE
118 program_transform_name=s,x,x,
119 silent=
120 site=
121 srcdir=
122 target=NONE
123 verbose=
124 x_includes=NONE
125 x_libraries=NONE
126 bindir='${exec_prefix}/bin'
127 sbindir='${exec_prefix}/sbin'
128 libexecdir='${exec_prefix}/libexec'
129 datadir='${prefix}/share'
130 sysconfdir='${prefix}/etc'
131 sharedstatedir='${prefix}/com'
132 localstatedir='${prefix}/var'
133 libdir='${exec_prefix}/lib'
134 includedir='${prefix}/include'
135 oldincludedir='/usr/include'
136 infodir='${prefix}/info'
137 mandir='${prefix}/man'
138
139 # Initialize some other variables.
140 subdirs=
141 MFLAGS= MAKEFLAGS=
142 SHELL=${CONFIG_SHELL-/bin/sh}
143 # Maximum number of lines to put in a shell here document.
144 ac_max_here_lines=12
145
146 ac_prev=
147 for ac_option
148 do
149
150   # If the previous option needs an argument, assign it.
151   if test -n "$ac_prev"; then
152     eval "$ac_prev=\$ac_option"
153     ac_prev=
154     continue
155   fi
156
157   case "$ac_option" in
158   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
159   *) ac_optarg= ;;
160   esac
161
162   # Accept the important Cygnus configure options, so we can diagnose typos.
163
164   case "$ac_option" in
165
166   -bindir | --bindir | --bindi | --bind | --bin | --bi)
167     ac_prev=bindir ;;
168   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
169     bindir="$ac_optarg" ;;
170
171   -build | --build | --buil | --bui | --bu)
172     ac_prev=build ;;
173   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
174     build="$ac_optarg" ;;
175
176   -cache-file | --cache-file | --cache-fil | --cache-fi \
177   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
178     ac_prev=cache_file ;;
179   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
180   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
181     cache_file="$ac_optarg" ;;
182
183   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
184     ac_prev=datadir ;;
185   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
186   | --da=*)
187     datadir="$ac_optarg" ;;
188
189   -disable-* | --disable-*)
190     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
191     # Reject names that are not valid shell variable names.
192     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
193       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
194     fi
195     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
196     eval "enable_${ac_feature}=no" ;;
197
198   -enable-* | --enable-*)
199     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
200     # Reject names that are not valid shell variable names.
201     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
202       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
203     fi
204     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
205     case "$ac_option" in
206       *=*) ;;
207       *) ac_optarg=yes ;;
208     esac
209     eval "enable_${ac_feature}='$ac_optarg'" ;;
210
211   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
212   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
213   | --exec | --exe | --ex)
214     ac_prev=exec_prefix ;;
215   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
216   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
217   | --exec=* | --exe=* | --ex=*)
218     exec_prefix="$ac_optarg" ;;
219
220   -gas | --gas | --ga | --g)
221     # Obsolete; use --with-gas.
222     with_gas=yes ;;
223
224   -help | --help | --hel | --he)
225     # Omit some internal or obsolete options to make the list less imposing.
226     # This message is too long to be a string in the A/UX 3.1 sh.
227     cat << EOF
228 Usage: configure [options] [host]
229 Options: [defaults in brackets after descriptions]
230 Configuration:
231   --cache-file=FILE       cache test results in FILE
232   --help                  print this message
233   --no-create             do not create output files
234   --quiet, --silent       do not print \`checking...' messages
235   --version               print the version of autoconf that created configure
236 Directory and file names:
237   --prefix=PREFIX         install architecture-independent files in PREFIX
238                           [$ac_default_prefix]
239   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
240                           [same as prefix]
241   --bindir=DIR            user executables in DIR [EPREFIX/bin]
242   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
243   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
244   --datadir=DIR           read-only architecture-independent data in DIR
245                           [PREFIX/share]
246   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
247   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
248                           [PREFIX/com]
249   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
250   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
251   --includedir=DIR        C header files in DIR [PREFIX/include]
252   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
253   --infodir=DIR           info documentation in DIR [PREFIX/info]
254   --mandir=DIR            man documentation in DIR [PREFIX/man]
255   --srcdir=DIR            find the sources in DIR [configure dir or ..]
256   --program-prefix=PREFIX prepend PREFIX to installed program names
257   --program-suffix=SUFFIX append SUFFIX to installed program names
258   --program-transform-name=PROGRAM
259                           run sed PROGRAM on installed program names
260 EOF
261     cat << EOF
262 Host type:
263   --build=BUILD           configure for building on BUILD [BUILD=HOST]
264   --host=HOST             configure for HOST [guessed]
265   --target=TARGET         configure for TARGET [TARGET=HOST]
266 Features and packages:
267   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
268   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
269   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
270   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
271   --x-includes=DIR        X include files are in DIR
272   --x-libraries=DIR       X library files are in DIR
273 EOF
274     if test -n "$ac_help"; then
275       echo "--enable and --with options recognized:$ac_help"
276     fi
277     exit 0 ;;
278
279   -host | --host | --hos | --ho)
280     ac_prev=host ;;
281   -host=* | --host=* | --hos=* | --ho=*)
282     host="$ac_optarg" ;;
283
284   -includedir | --includedir | --includedi | --included | --include \
285   | --includ | --inclu | --incl | --inc)
286     ac_prev=includedir ;;
287   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
288   | --includ=* | --inclu=* | --incl=* | --inc=*)
289     includedir="$ac_optarg" ;;
290
291   -infodir | --infodir | --infodi | --infod | --info | --inf)
292     ac_prev=infodir ;;
293   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
294     infodir="$ac_optarg" ;;
295
296   -libdir | --libdir | --libdi | --libd)
297     ac_prev=libdir ;;
298   -libdir=* | --libdir=* | --libdi=* | --libd=*)
299     libdir="$ac_optarg" ;;
300
301   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
302   | --libexe | --libex | --libe)
303     ac_prev=libexecdir ;;
304   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
305   | --libexe=* | --libex=* | --libe=*)
306     libexecdir="$ac_optarg" ;;
307
308   -localstatedir | --localstatedir | --localstatedi | --localstated \
309   | --localstate | --localstat | --localsta | --localst \
310   | --locals | --local | --loca | --loc | --lo)
311     ac_prev=localstatedir ;;
312   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
313   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
314   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
315     localstatedir="$ac_optarg" ;;
316
317   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
318     ac_prev=mandir ;;
319   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
320     mandir="$ac_optarg" ;;
321
322   -nfp | --nfp | --nf)
323     # Obsolete; use --without-fp.
324     with_fp=no ;;
325
326   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
327   | --no-cr | --no-c)
328     no_create=yes ;;
329
330   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
331   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
332     no_recursion=yes ;;
333
334   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
335   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
336   | --oldin | --oldi | --old | --ol | --o)
337     ac_prev=oldincludedir ;;
338   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
339   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
340   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
341     oldincludedir="$ac_optarg" ;;
342
343   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
344     ac_prev=prefix ;;
345   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
346     prefix="$ac_optarg" ;;
347
348   -program-prefix | --program-prefix | --program-prefi | --program-pref \
349   | --program-pre | --program-pr | --program-p)
350     ac_prev=program_prefix ;;
351   -program-prefix=* | --program-prefix=* | --program-prefi=* \
352   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
353     program_prefix="$ac_optarg" ;;
354
355   -program-suffix | --program-suffix | --program-suffi | --program-suff \
356   | --program-suf | --program-su | --program-s)
357     ac_prev=program_suffix ;;
358   -program-suffix=* | --program-suffix=* | --program-suffi=* \
359   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
360     program_suffix="$ac_optarg" ;;
361
362   -program-transform-name | --program-transform-name \
363   | --program-transform-nam | --program-transform-na \
364   | --program-transform-n | --program-transform- \
365   | --program-transform | --program-transfor \
366   | --program-transfo | --program-transf \
367   | --program-trans | --program-tran \
368   | --progr-tra | --program-tr | --program-t)
369     ac_prev=program_transform_name ;;
370   -program-transform-name=* | --program-transform-name=* \
371   | --program-transform-nam=* | --program-transform-na=* \
372   | --program-transform-n=* | --program-transform-=* \
373   | --program-transform=* | --program-transfor=* \
374   | --program-transfo=* | --program-transf=* \
375   | --program-trans=* | --program-tran=* \
376   | --progr-tra=* | --program-tr=* | --program-t=*)
377     program_transform_name="$ac_optarg" ;;
378
379   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
380   | -silent | --silent | --silen | --sile | --sil)
381     silent=yes ;;
382
383   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
384     ac_prev=sbindir ;;
385   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
386   | --sbi=* | --sb=*)
387     sbindir="$ac_optarg" ;;
388
389   -sharedstatedir | --sharedstatedir | --sharedstatedi \
390   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
391   | --sharedst | --shareds | --shared | --share | --shar \
392   | --sha | --sh)
393     ac_prev=sharedstatedir ;;
394   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
395   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
396   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
397   | --sha=* | --sh=*)
398     sharedstatedir="$ac_optarg" ;;
399
400   -site | --site | --sit)
401     ac_prev=site ;;
402   -site=* | --site=* | --sit=*)
403     site="$ac_optarg" ;;
404
405   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
406     ac_prev=srcdir ;;
407   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
408     srcdir="$ac_optarg" ;;
409
410   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
411   | --syscon | --sysco | --sysc | --sys | --sy)
412     ac_prev=sysconfdir ;;
413   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
414   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
415     sysconfdir="$ac_optarg" ;;
416
417   -target | --target | --targe | --targ | --tar | --ta | --t)
418     ac_prev=target ;;
419   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
420     target="$ac_optarg" ;;
421
422   -v | -verbose | --verbose | --verbos | --verbo | --verb)
423     verbose=yes ;;
424
425   -version | --version | --versio | --versi | --vers)
426     echo "configure generated by autoconf version 2.13"
427     exit 0 ;;
428
429   -with-* | --with-*)
430     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
431     # Reject names that are not valid shell variable names.
432     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
433       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
434     fi
435     ac_package=`echo $ac_package| sed 's/-/_/g'`
436     case "$ac_option" in
437       *=*) ;;
438       *) ac_optarg=yes ;;
439     esac
440     eval "with_${ac_package}='$ac_optarg'" ;;
441
442   -without-* | --without-*)
443     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
444     # Reject names that are not valid shell variable names.
445     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
446       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
447     fi
448     ac_package=`echo $ac_package| sed 's/-/_/g'`
449     eval "with_${ac_package}=no" ;;
450
451   --x)
452     # Obsolete; use --with-x.
453     with_x=yes ;;
454
455   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
456   | --x-incl | --x-inc | --x-in | --x-i)
457     ac_prev=x_includes ;;
458   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
459   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
460     x_includes="$ac_optarg" ;;
461
462   -x-libraries | --x-libraries | --x-librarie | --x-librari \
463   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
464     ac_prev=x_libraries ;;
465   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
466   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
467     x_libraries="$ac_optarg" ;;
468
469   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
470     ;;
471
472   *)
473     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
474       echo "configure: warning: $ac_option: invalid host type" 1>&2
475     fi
476     if test "x$nonopt" != xNONE; then
477       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
478     fi
479     nonopt="$ac_option"
480     ;;
481
482   esac
483 done
484
485 if test -n "$ac_prev"; then
486   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
487 fi
488
489 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
490
491 # File descriptor usage:
492 # 0 standard input
493 # 1 file creation
494 # 2 errors and warnings
495 # 3 some systems may open it to /dev/tty
496 # 4 used on the Kubota Titan
497 # 6 checking for... messages and results
498 # 5 compiler messages saved in config.log
499 if test "$silent" = yes; then
500   exec 6>/dev/null
501 else
502   exec 6>&1
503 fi
504 exec 5>./config.log
505
506 echo "\
507 This file contains any messages produced by compilers while
508 running configure, to aid debugging if configure makes a mistake.
509 " 1>&5
510
511 # Strip out --no-create and --no-recursion so they do not pile up.
512 # Also quote any args containing shell metacharacters.
513 ac_configure_args=
514 for ac_arg
515 do
516   case "$ac_arg" in
517   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
518   | --no-cr | --no-c) ;;
519   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
520   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
521   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
522   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
523   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
524   esac
525 done
526
527 # NLS nuisances.
528 # Only set these to C if already set.  These must not be set unconditionally
529 # because not all systems understand e.g. LANG=C (notably SCO).
530 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
531 # Non-C LC_CTYPE values break the ctype check.
532 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
533 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
534 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
535 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
536
537 # confdefs.h avoids OS command line length limits that DEFS can exceed.
538 rm -rf conftest* confdefs.h
539 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
540 echo > confdefs.h
541
542 # A filename unique to this package, relative to the directory that
543 # configure is in, which we can look for to find out if srcdir is correct.
544 ac_unique_file=mutt.h
545
546 # Find the source files, if location was not specified.
547 if test -z "$srcdir"; then
548   ac_srcdir_defaulted=yes
549   # Try the directory containing this script, then its parent.
550   ac_prog=$0
551   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
552   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
553   srcdir=$ac_confdir
554   if test ! -r $srcdir/$ac_unique_file; then
555     srcdir=..
556   fi
557 else
558   ac_srcdir_defaulted=no
559 fi
560 if test ! -r $srcdir/$ac_unique_file; then
561   if test "$ac_srcdir_defaulted" = yes; then
562     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
563   else
564     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
565   fi
566 fi
567 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
568
569 # Prefer explicitly selected file to automatically selected ones.
570 if test -z "$CONFIG_SITE"; then
571   if test "x$prefix" != xNONE; then
572     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
573   else
574     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
575   fi
576 fi
577 for ac_site_file in $CONFIG_SITE; do
578   if test -r "$ac_site_file"; then
579     echo "loading site script $ac_site_file"
580     . "$ac_site_file"
581   fi
582 done
583
584 if test -r "$cache_file"; then
585   echo "loading cache $cache_file"
586   . $cache_file
587 else
588   echo "creating cache $cache_file"
589   > $cache_file
590 fi
591
592 ac_ext=c
593 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
594 ac_cpp='$CPP $CPPFLAGS'
595 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
596 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
597 cross_compiling=$ac_cv_prog_cc_cross
598
599 ac_exeext=
600 ac_objext=o
601 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
602   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
603   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
604     ac_n= ac_c='
605 ' ac_t='        '
606   else
607     ac_n=-n ac_c= ac_t=
608   fi
609 else
610   ac_n= ac_c='\c' ac_t=
611 fi
612
613
614
615
616
617
618 mutt_cv_version=`cat $srcdir/VERSION`
619
620
621 ac_aux_dir=
622 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
623   if test -f $ac_dir/install-sh; then
624     ac_aux_dir=$ac_dir
625     ac_install_sh="$ac_aux_dir/install-sh -c"
626     break
627   elif test -f $ac_dir/install.sh; then
628     ac_aux_dir=$ac_dir
629     ac_install_sh="$ac_aux_dir/install.sh -c"
630     break
631   fi
632 done
633 if test -z "$ac_aux_dir"; then
634   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
635 fi
636 ac_config_guess=$ac_aux_dir/config.guess
637 ac_config_sub=$ac_aux_dir/config.sub
638 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
639
640 # Find a good install program.  We prefer a C program (faster),
641 # so one script is as good as another.  But avoid the broken or
642 # incompatible versions:
643 # SysV /etc/install, /usr/sbin/install
644 # SunOS /usr/etc/install
645 # IRIX /sbin/install
646 # AIX /bin/install
647 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
648 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
649 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
650 # ./install, which can be erroneously created by make from ./install.sh.
651 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
652 echo "configure:653: checking for a BSD compatible install" >&5
653 if test -z "$INSTALL"; then
654 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
655   echo $ac_n "(cached) $ac_c" 1>&6
656 else
657     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
658   for ac_dir in $PATH; do
659     # Account for people who put trailing slashes in PATH elements.
660     case "$ac_dir/" in
661     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
662     *)
663       # OSF1 and SCO ODT 3.0 have their own names for install.
664       # Don't use installbsd from OSF since it installs stuff as root
665       # by default.
666       for ac_prog in ginstall scoinst install; do
667         if test -f $ac_dir/$ac_prog; then
668           if test $ac_prog = install &&
669             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
670             # AIX install.  It has an incompatible calling convention.
671             :
672           else
673             ac_cv_path_install="$ac_dir/$ac_prog -c"
674             break 2
675           fi
676         fi
677       done
678       ;;
679     esac
680   done
681   IFS="$ac_save_IFS"
682
683 fi
684   if test "${ac_cv_path_install+set}" = set; then
685     INSTALL="$ac_cv_path_install"
686   else
687     # As a last resort, use the slow shell script.  We don't cache a
688     # path for INSTALL within a source directory, because that will
689     # break other packages using the cache if that directory is
690     # removed, or if the path is relative.
691     INSTALL="$ac_install_sh"
692   fi
693 fi
694 echo "$ac_t""$INSTALL" 1>&6
695
696 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
697 # It thinks the first close brace ends the variable substitution.
698 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
699
700 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
701
702 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
703
704 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
705 echo "configure:706: checking whether build environment is sane" >&5
706 # Just in case
707 sleep 1
708 echo timestamp > conftestfile
709 # Do `set' in a subshell so we don't clobber the current shell's
710 # arguments.  Must try -L first in case configure is actually a
711 # symlink; some systems play weird games with the mod time of symlinks
712 # (eg FreeBSD returns the mod time of the symlink's containing
713 # directory).
714 if (
715    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
716    if test "$*" = "X"; then
717       # -L didn't work.
718       set X `ls -t $srcdir/configure conftestfile`
719    fi
720    if test "$*" != "X $srcdir/configure conftestfile" \
721       && test "$*" != "X conftestfile $srcdir/configure"; then
722
723       # If neither matched, then we have a broken ls.  This can happen
724       # if, for instance, CONFIG_SHELL is bash and it inherits a
725       # broken ls alias from the environment.  This has actually
726       # happened.  Such a system could not be considered "sane".
727       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
728 alias in your environment" 1>&2; exit 1; }
729    fi
730
731    test "$2" = conftestfile
732    )
733 then
734    # Ok.
735    :
736 else
737    { echo "configure: error: newly created file is older than distributed files!
738 Check your system clock" 1>&2; exit 1; }
739 fi
740 rm -f conftest*
741 echo "$ac_t""yes" 1>&6
742 if test "$program_transform_name" = s,x,x,; then
743   program_transform_name=
744 else
745   # Double any \ or $.  echo might interpret backslashes.
746   cat <<\EOF_SED > conftestsed
747 s,\\,\\\\,g; s,\$,$$,g
748 EOF_SED
749   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
750   rm -f conftestsed
751 fi
752 test "$program_prefix" != NONE &&
753   program_transform_name="s,^,${program_prefix},; $program_transform_name"
754 # Use a double $ so make ignores it.
755 test "$program_suffix" != NONE &&
756   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
757
758 # sed with no file args requires a program.
759 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
760
761 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
762 echo "configure:763: checking whether ${MAKE-make} sets \${MAKE}" >&5
763 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
764 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
765   echo $ac_n "(cached) $ac_c" 1>&6
766 else
767   cat > conftestmake <<\EOF
768 all:
769         @echo 'ac_maketemp="${MAKE}"'
770 EOF
771 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
772 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
773 if test -n "$ac_maketemp"; then
774   eval ac_cv_prog_make_${ac_make}_set=yes
775 else
776   eval ac_cv_prog_make_${ac_make}_set=no
777 fi
778 rm -f conftestmake
779 fi
780 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
781   echo "$ac_t""yes" 1>&6
782   SET_MAKE=
783 else
784   echo "$ac_t""no" 1>&6
785   SET_MAKE="MAKE=${MAKE-make}"
786 fi
787
788
789 PACKAGE=muttng
790
791 VERSION=$mutt_cv_version
792
793 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
794   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
795 fi
796 cat >> confdefs.h <<EOF
797 #define PACKAGE "$PACKAGE"
798 EOF
799
800 cat >> confdefs.h <<EOF
801 #define VERSION "$VERSION"
802 EOF
803
804
805
806 missing_dir=`cd $ac_aux_dir && pwd`
807 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
808 echo "configure:809: checking for working aclocal" >&5
809 # Run test in a subshell; some versions of sh will print an error if
810 # an executable is not found, even if stderr is redirected.
811 # Redirect stdin to placate older versions of autoconf.  Sigh.
812 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
813    ACLOCAL=aclocal
814    echo "$ac_t""found" 1>&6
815 else
816    ACLOCAL="$missing_dir/missing aclocal"
817    echo "$ac_t""missing" 1>&6
818 fi
819
820 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
821 echo "configure:822: checking for working autoconf" >&5
822 # Run test in a subshell; some versions of sh will print an error if
823 # an executable is not found, even if stderr is redirected.
824 # Redirect stdin to placate older versions of autoconf.  Sigh.
825 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
826    AUTOCONF=autoconf
827    echo "$ac_t""found" 1>&6
828 else
829    AUTOCONF="$missing_dir/missing autoconf"
830    echo "$ac_t""missing" 1>&6
831 fi
832
833 echo $ac_n "checking for working automake""... $ac_c" 1>&6
834 echo "configure:835: checking for working automake" >&5
835 # Run test in a subshell; some versions of sh will print an error if
836 # an executable is not found, even if stderr is redirected.
837 # Redirect stdin to placate older versions of autoconf.  Sigh.
838 if (automake --version) < /dev/null > /dev/null 2>&1; then
839    AUTOMAKE=automake
840    echo "$ac_t""found" 1>&6
841 else
842    AUTOMAKE="$missing_dir/missing automake"
843    echo "$ac_t""missing" 1>&6
844 fi
845
846 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
847 echo "configure:848: checking for working autoheader" >&5
848 # Run test in a subshell; some versions of sh will print an error if
849 # an executable is not found, even if stderr is redirected.
850 # Redirect stdin to placate older versions of autoconf.  Sigh.
851 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
852    AUTOHEADER=autoheader
853    echo "$ac_t""found" 1>&6
854 else
855    AUTOHEADER="$missing_dir/missing autoheader"
856    echo "$ac_t""missing" 1>&6
857 fi
858
859 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
860 echo "configure:861: checking for working makeinfo" >&5
861 # Run test in a subshell; some versions of sh will print an error if
862 # an executable is not found, even if stderr is redirected.
863 # Redirect stdin to placate older versions of autoconf.  Sigh.
864 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
865    MAKEINFO=makeinfo
866    echo "$ac_t""found" 1>&6
867 else
868    MAKEINFO="$missing_dir/missing makeinfo"
869    echo "$ac_t""missing" 1>&6
870 fi
871
872
873
874
875
876 ALL_LINGUAS="de ru it es uk fr pl nl cs id sk ko el zh_TW zh_CN pt_BR eo gl sv da lt tr ja hu et ca bg"
877
878
879 # Make sure we can run config.sub.
880 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
881 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
882 fi
883
884 echo $ac_n "checking host system type""... $ac_c" 1>&6
885 echo "configure:886: checking host system type" >&5
886
887 host_alias=$host
888 case "$host_alias" in
889 NONE)
890   case $nonopt in
891   NONE)
892     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
893     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
894     fi ;;
895   *) host_alias=$nonopt ;;
896   esac ;;
897 esac
898
899 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
900 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
901 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
902 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
903 echo "$ac_t""$host" 1>&6
904
905
906 echo $ac_n "checking for prefix""... $ac_c" 1>&6
907 echo "configure:908: checking for prefix" >&5
908 if test x$prefix = xNONE; then
909         mutt_cv_prefix=$ac_default_prefix
910 else
911         mutt_cv_prefix=$prefix
912 fi
913 echo "$ac_t""$mutt_cv_prefix" 1>&6
914
915 # Extract the first word of "gcc", so it can be a program name with args.
916 set dummy gcc; ac_word=$2
917 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
918 echo "configure:919: checking for $ac_word" >&5
919 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
920   echo $ac_n "(cached) $ac_c" 1>&6
921 else
922   if test -n "$CC"; then
923   ac_cv_prog_CC="$CC" # Let the user override the test.
924 else
925   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
926   ac_dummy="$PATH"
927   for ac_dir in $ac_dummy; do
928     test -z "$ac_dir" && ac_dir=.
929     if test -f $ac_dir/$ac_word; then
930       ac_cv_prog_CC="gcc"
931       break
932     fi
933   done
934   IFS="$ac_save_ifs"
935 fi
936 fi
937 CC="$ac_cv_prog_CC"
938 if test -n "$CC"; then
939   echo "$ac_t""$CC" 1>&6
940 else
941   echo "$ac_t""no" 1>&6
942 fi
943
944 if test -z "$CC"; then
945   # Extract the first word of "cc", so it can be a program name with args.
946 set dummy cc; ac_word=$2
947 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
948 echo "configure:949: checking for $ac_word" >&5
949 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
950   echo $ac_n "(cached) $ac_c" 1>&6
951 else
952   if test -n "$CC"; then
953   ac_cv_prog_CC="$CC" # Let the user override the test.
954 else
955   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
956   ac_prog_rejected=no
957   ac_dummy="$PATH"
958   for ac_dir in $ac_dummy; do
959     test -z "$ac_dir" && ac_dir=.
960     if test -f $ac_dir/$ac_word; then
961       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
962         ac_prog_rejected=yes
963         continue
964       fi
965       ac_cv_prog_CC="cc"
966       break
967     fi
968   done
969   IFS="$ac_save_ifs"
970 if test $ac_prog_rejected = yes; then
971   # We found a bogon in the path, so make sure we never use it.
972   set dummy $ac_cv_prog_CC
973   shift
974   if test $# -gt 0; then
975     # We chose a different compiler from the bogus one.
976     # However, it has the same basename, so the bogon will be chosen
977     # first if we set CC to just the basename; use the full file name.
978     shift
979     set dummy "$ac_dir/$ac_word" "$@"
980     shift
981     ac_cv_prog_CC="$@"
982   fi
983 fi
984 fi
985 fi
986 CC="$ac_cv_prog_CC"
987 if test -n "$CC"; then
988   echo "$ac_t""$CC" 1>&6
989 else
990   echo "$ac_t""no" 1>&6
991 fi
992
993   if test -z "$CC"; then
994     case "`uname -s`" in
995     *win32* | *WIN32*)
996       # Extract the first word of "cl", so it can be a program name with args.
997 set dummy cl; ac_word=$2
998 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
999 echo "configure:1000: checking for $ac_word" >&5
1000 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1001   echo $ac_n "(cached) $ac_c" 1>&6
1002 else
1003   if test -n "$CC"; then
1004   ac_cv_prog_CC="$CC" # Let the user override the test.
1005 else
1006   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1007   ac_dummy="$PATH"
1008   for ac_dir in $ac_dummy; do
1009     test -z "$ac_dir" && ac_dir=.
1010     if test -f $ac_dir/$ac_word; then
1011       ac_cv_prog_CC="cl"
1012       break
1013     fi
1014   done
1015   IFS="$ac_save_ifs"
1016 fi
1017 fi
1018 CC="$ac_cv_prog_CC"
1019 if test -n "$CC"; then
1020   echo "$ac_t""$CC" 1>&6
1021 else
1022   echo "$ac_t""no" 1>&6
1023 fi
1024  ;;
1025     esac
1026   fi
1027   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1028 fi
1029
1030 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1031 echo "configure:1032: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1032
1033 ac_ext=c
1034 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1035 ac_cpp='$CPP $CPPFLAGS'
1036 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1037 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1038 cross_compiling=$ac_cv_prog_cc_cross
1039
1040 cat > conftest.$ac_ext << EOF
1041
1042 #line 1043 "configure"
1043 #include "confdefs.h"
1044
1045 main(){return(0);}
1046 EOF
1047 if { (eval echo configure:1048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1048   ac_cv_prog_cc_works=yes
1049   # If we can't run a trivial program, we are probably using a cross compiler.
1050   if (./conftest; exit) 2>/dev/null; then
1051     ac_cv_prog_cc_cross=no
1052   else
1053     ac_cv_prog_cc_cross=yes
1054   fi
1055 else
1056   echo "configure: failed program was:" >&5
1057   cat conftest.$ac_ext >&5
1058   ac_cv_prog_cc_works=no
1059 fi
1060 rm -fr conftest*
1061 ac_ext=c
1062 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1063 ac_cpp='$CPP $CPPFLAGS'
1064 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1065 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1066 cross_compiling=$ac_cv_prog_cc_cross
1067
1068 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1069 if test $ac_cv_prog_cc_works = no; then
1070   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1071 fi
1072 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1073 echo "configure:1074: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1074 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1075 cross_compiling=$ac_cv_prog_cc_cross
1076
1077 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1078 echo "configure:1079: checking whether we are using GNU C" >&5
1079 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1080   echo $ac_n "(cached) $ac_c" 1>&6
1081 else
1082   cat > conftest.c <<EOF
1083 #ifdef __GNUC__
1084   yes;
1085 #endif
1086 EOF
1087 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1088   ac_cv_prog_gcc=yes
1089 else
1090   ac_cv_prog_gcc=no
1091 fi
1092 fi
1093
1094 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1095
1096 if test $ac_cv_prog_gcc = yes; then
1097   GCC=yes
1098 else
1099   GCC=
1100 fi
1101
1102 ac_test_CFLAGS="${CFLAGS+set}"
1103 ac_save_CFLAGS="$CFLAGS"
1104 CFLAGS=
1105 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1106 echo "configure:1107: checking whether ${CC-cc} accepts -g" >&5
1107 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1108   echo $ac_n "(cached) $ac_c" 1>&6
1109 else
1110   echo 'void f(){}' > conftest.c
1111 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1112   ac_cv_prog_cc_g=yes
1113 else
1114   ac_cv_prog_cc_g=no
1115 fi
1116 rm -f conftest*
1117
1118 fi
1119
1120 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1121 if test "$ac_test_CFLAGS" = set; then
1122   CFLAGS="$ac_save_CFLAGS"
1123 elif test $ac_cv_prog_cc_g = yes; then
1124   if test "$GCC" = yes; then
1125     CFLAGS="-g -O2"
1126   else
1127     CFLAGS="-g"
1128   fi
1129 else
1130   if test "$GCC" = yes; then
1131     CFLAGS="-O2"
1132   else
1133     CFLAGS=
1134   fi
1135 fi
1136
1137
1138         echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
1139 echo "configure:1140: checking for strerror in -lcposix" >&5
1140 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
1141 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1142   echo $ac_n "(cached) $ac_c" 1>&6
1143 else
1144   ac_save_LIBS="$LIBS"
1145 LIBS="-lcposix  $LIBS"
1146 cat > conftest.$ac_ext <<EOF
1147 #line 1148 "configure"
1148 #include "confdefs.h"
1149 /* Override any gcc2 internal prototype to avoid an error.  */
1150 /* We use char because int might match the return type of a gcc2
1151     builtin and then its argument prototype would still apply.  */
1152 char strerror();
1153
1154 int main() {
1155 strerror()
1156 ; return 0; }
1157 EOF
1158 if { (eval echo configure:1159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1159   rm -rf conftest*
1160   eval "ac_cv_lib_$ac_lib_var=yes"
1161 else
1162   echo "configure: failed program was:" >&5
1163   cat conftest.$ac_ext >&5
1164   rm -rf conftest*
1165   eval "ac_cv_lib_$ac_lib_var=no"
1166 fi
1167 rm -f conftest*
1168 LIBS="$ac_save_LIBS"
1169
1170 fi
1171 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1172   echo "$ac_t""yes" 1>&6
1173   LIBS="$LIBS -lcposix"
1174 else
1175   echo "$ac_t""no" 1>&6
1176 fi
1177
1178   
1179
1180
1181
1182
1183 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1184 echo "configure:1185: checking for ${CC-cc} option to accept ANSI C" >&5
1185 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
1186   echo $ac_n "(cached) $ac_c" 1>&6
1187 else
1188   am_cv_prog_cc_stdc=no
1189 ac_save_CC="$CC"
1190 # Don't try gcc -ansi; that turns off useful extensions and
1191 # breaks some systems' header files.
1192 # AIX                   -qlanglvl=ansi
1193 # Ultrix and OSF/1      -std1
1194 # HP-UX                 -Aa -D_HPUX_SOURCE
1195 # SVR4                  -Xc -D__EXTENSIONS__
1196 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1197 do
1198   CC="$ac_save_CC $ac_arg"
1199   cat > conftest.$ac_ext <<EOF
1200 #line 1201 "configure"
1201 #include "confdefs.h"
1202 #include <stdarg.h>
1203 #include <stdio.h>
1204 #include <sys/types.h>
1205 #include <sys/stat.h>
1206 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1207 struct buf { int x; };
1208 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1209 static char *e (p, i)
1210      char **p;
1211      int i;
1212 {
1213   return p[i];
1214 }
1215 static char *f (char * (*g) (char **, int), char **p, ...)
1216 {
1217   char *s;
1218   va_list v;
1219   va_start (v,p);
1220   s = g (p, va_arg (v,int));
1221   va_end (v);
1222   return s;
1223 }
1224 int test (int i, double x);
1225 struct s1 {int (*f) (int a);};
1226 struct s2 {int (*f) (double a);};
1227 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1228 int argc;
1229 char **argv;
1230
1231 int main() {
1232
1233 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1234
1235 ; return 0; }
1236 EOF
1237 if { (eval echo configure:1238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1238   rm -rf conftest*
1239   am_cv_prog_cc_stdc="$ac_arg"; break
1240 else
1241   echo "configure: failed program was:" >&5
1242   cat conftest.$ac_ext >&5
1243 fi
1244 rm -f conftest*
1245 done
1246 CC="$ac_save_CC"
1247
1248 fi
1249
1250 if test -z "$am_cv_prog_cc_stdc"; then
1251   echo "$ac_t""none needed" 1>&6
1252 else
1253   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
1254 fi
1255 case "x$am_cv_prog_cc_stdc" in
1256   x|xno) ;;
1257   *) CC="$CC $am_cv_prog_cc_stdc" ;;
1258 esac
1259
1260 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1261 echo "configure:1262: checking how to run the C preprocessor" >&5
1262 # On Suns, sometimes $CPP names a directory.
1263 if test -n "$CPP" && test -d "$CPP"; then
1264   CPP=
1265 fi
1266 if test -z "$CPP"; then
1267 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1268   echo $ac_n "(cached) $ac_c" 1>&6
1269 else
1270     # This must be in double quotes, not single quotes, because CPP may get
1271   # substituted into the Makefile and "${CC-cc}" will confuse make.
1272   CPP="${CC-cc} -E"
1273   # On the NeXT, cc -E runs the code through the compiler's parser,
1274   # not just through cpp.
1275   cat > conftest.$ac_ext <<EOF
1276 #line 1277 "configure"
1277 #include "confdefs.h"
1278 #include <assert.h>
1279 Syntax Error
1280 EOF
1281 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1282 { (eval echo configure:1283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1283 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1284 if test -z "$ac_err"; then
1285   :
1286 else
1287   echo "$ac_err" >&5
1288   echo "configure: failed program was:" >&5
1289   cat conftest.$ac_ext >&5
1290   rm -rf conftest*
1291   CPP="${CC-cc} -E -traditional-cpp"
1292   cat > conftest.$ac_ext <<EOF
1293 #line 1294 "configure"
1294 #include "confdefs.h"
1295 #include <assert.h>
1296 Syntax Error
1297 EOF
1298 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1299 { (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1300 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1301 if test -z "$ac_err"; then
1302   :
1303 else
1304   echo "$ac_err" >&5
1305   echo "configure: failed program was:" >&5
1306   cat conftest.$ac_ext >&5
1307   rm -rf conftest*
1308   CPP="${CC-cc} -nologo -E"
1309   cat > conftest.$ac_ext <<EOF
1310 #line 1311 "configure"
1311 #include "confdefs.h"
1312 #include <assert.h>
1313 Syntax Error
1314 EOF
1315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1316 { (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1317 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1318 if test -z "$ac_err"; then
1319   :
1320 else
1321   echo "$ac_err" >&5
1322   echo "configure: failed program was:" >&5
1323   cat conftest.$ac_ext >&5
1324   rm -rf conftest*
1325   CPP=/lib/cpp
1326 fi
1327 rm -f conftest*
1328 fi
1329 rm -f conftest*
1330 fi
1331 rm -f conftest*
1332   ac_cv_prog_CPP="$CPP"
1333 fi
1334   CPP="$ac_cv_prog_CPP"
1335 else
1336   ac_cv_prog_CPP="$CPP"
1337 fi
1338 echo "$ac_t""$CPP" 1>&6
1339
1340
1341
1342 echo $ac_n "checking for function prototypes""... $ac_c" 1>&6
1343 echo "configure:1344: checking for function prototypes" >&5
1344 if test "$am_cv_prog_cc_stdc" != no; then
1345   echo "$ac_t""yes" 1>&6
1346   cat >> confdefs.h <<\EOF
1347 #define PROTOTYPES 1
1348 EOF
1349
1350   U= ANSI2KNR=
1351 else
1352   echo "$ac_t""no" 1>&6
1353   U=_ ANSI2KNR=./ansi2knr
1354   # Ensure some checks needed by ansi2knr itself.
1355   echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1356 echo "configure:1357: checking for ANSI C header files" >&5
1357 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1358   echo $ac_n "(cached) $ac_c" 1>&6
1359 else
1360   cat > conftest.$ac_ext <<EOF
1361 #line 1362 "configure"
1362 #include "confdefs.h"
1363 #include <stdlib.h>
1364 #include <stdarg.h>
1365 #include <string.h>
1366 #include <float.h>
1367 EOF
1368 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1369 { (eval echo configure:1370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1370 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1371 if test -z "$ac_err"; then
1372   rm -rf conftest*
1373   ac_cv_header_stdc=yes
1374 else
1375   echo "$ac_err" >&5
1376   echo "configure: failed program was:" >&5
1377   cat conftest.$ac_ext >&5
1378   rm -rf conftest*
1379   ac_cv_header_stdc=no
1380 fi
1381 rm -f conftest*
1382
1383 if test $ac_cv_header_stdc = yes; then
1384   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1385 cat > conftest.$ac_ext <<EOF
1386 #line 1387 "configure"
1387 #include "confdefs.h"
1388 #include <string.h>
1389 EOF
1390 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1391   egrep "memchr" >/dev/null 2>&1; then
1392   :
1393 else
1394   rm -rf conftest*
1395   ac_cv_header_stdc=no
1396 fi
1397 rm -f conftest*
1398
1399 fi
1400
1401 if test $ac_cv_header_stdc = yes; then
1402   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1403 cat > conftest.$ac_ext <<EOF
1404 #line 1405 "configure"
1405 #include "confdefs.h"
1406 #include <stdlib.h>
1407 EOF
1408 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1409   egrep "free" >/dev/null 2>&1; then
1410   :
1411 else
1412   rm -rf conftest*
1413   ac_cv_header_stdc=no
1414 fi
1415 rm -f conftest*
1416
1417 fi
1418
1419 if test $ac_cv_header_stdc = yes; then
1420   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1421 if test "$cross_compiling" = yes; then
1422   :
1423 else
1424   cat > conftest.$ac_ext <<EOF
1425 #line 1426 "configure"
1426 #include "confdefs.h"
1427 #include <ctype.h>
1428 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1429 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1430 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1431 int main () { int i; for (i = 0; i < 256; i++)
1432 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1433 exit (0); }
1434
1435 EOF
1436 if { (eval echo configure:1437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1437 then
1438   :
1439 else
1440   echo "configure: failed program was:" >&5
1441   cat conftest.$ac_ext >&5
1442   rm -fr conftest*
1443   ac_cv_header_stdc=no
1444 fi
1445 rm -fr conftest*
1446 fi
1447
1448 fi
1449 fi
1450
1451 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1452 if test $ac_cv_header_stdc = yes; then
1453   cat >> confdefs.h <<\EOF
1454 #define STDC_HEADERS 1
1455 EOF
1456
1457 fi
1458
1459   for ac_hdr in string.h
1460 do
1461 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1462 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1463 echo "configure:1464: checking for $ac_hdr" >&5
1464 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1465   echo $ac_n "(cached) $ac_c" 1>&6
1466 else
1467   cat > conftest.$ac_ext <<EOF
1468 #line 1469 "configure"
1469 #include "confdefs.h"
1470 #include <$ac_hdr>
1471 EOF
1472 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1473 { (eval echo configure:1474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1474 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1475 if test -z "$ac_err"; then
1476   rm -rf conftest*
1477   eval "ac_cv_header_$ac_safe=yes"
1478 else
1479   echo "$ac_err" >&5
1480   echo "configure: failed program was:" >&5
1481   cat conftest.$ac_ext >&5
1482   rm -rf conftest*
1483   eval "ac_cv_header_$ac_safe=no"
1484 fi
1485 rm -f conftest*
1486 fi
1487 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1488   echo "$ac_t""yes" 1>&6
1489     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1490   cat >> confdefs.h <<EOF
1491 #define $ac_tr_hdr 1
1492 EOF
1493  
1494 else
1495   echo "$ac_t""no" 1>&6
1496 fi
1497 done
1498
1499 fi
1500
1501 if test "x$U" != "x"; then
1502   { echo "configure: error: Compiler not ANSI compliant" 1>&2; exit 1; }
1503 fi
1504 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1505 echo "configure:1506: checking how to run the C preprocessor" >&5
1506 # On Suns, sometimes $CPP names a directory.
1507 if test -n "$CPP" && test -d "$CPP"; then
1508   CPP=
1509 fi
1510 if test -z "$CPP"; then
1511 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1512   echo $ac_n "(cached) $ac_c" 1>&6
1513 else
1514     # This must be in double quotes, not single quotes, because CPP may get
1515   # substituted into the Makefile and "${CC-cc}" will confuse make.
1516   CPP="${CC-cc} -E"
1517   # On the NeXT, cc -E runs the code through the compiler's parser,
1518   # not just through cpp.
1519   cat > conftest.$ac_ext <<EOF
1520 #line 1521 "configure"
1521 #include "confdefs.h"
1522 #include <assert.h>
1523 Syntax Error
1524 EOF
1525 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1526 { (eval echo configure:1527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1527 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1528 if test -z "$ac_err"; then
1529   :
1530 else
1531   echo "$ac_err" >&5
1532   echo "configure: failed program was:" >&5
1533   cat conftest.$ac_ext >&5
1534   rm -rf conftest*
1535   CPP="${CC-cc} -E -traditional-cpp"
1536   cat > conftest.$ac_ext <<EOF
1537 #line 1538 "configure"
1538 #include "confdefs.h"
1539 #include <assert.h>
1540 Syntax Error
1541 EOF
1542 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1543 { (eval echo configure:1544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1544 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1545 if test -z "$ac_err"; then
1546   :
1547 else
1548   echo "$ac_err" >&5
1549   echo "configure: failed program was:" >&5
1550   cat conftest.$ac_ext >&5
1551   rm -rf conftest*
1552   CPP="${CC-cc} -nologo -E"
1553   cat > conftest.$ac_ext <<EOF
1554 #line 1555 "configure"
1555 #include "confdefs.h"
1556 #include <assert.h>
1557 Syntax Error
1558 EOF
1559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1560 { (eval echo configure:1561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1562 if test -z "$ac_err"; then
1563   :
1564 else
1565   echo "$ac_err" >&5
1566   echo "configure: failed program was:" >&5
1567   cat conftest.$ac_ext >&5
1568   rm -rf conftest*
1569   CPP=/lib/cpp
1570 fi
1571 rm -f conftest*
1572 fi
1573 rm -f conftest*
1574 fi
1575 rm -f conftest*
1576   ac_cv_prog_CPP="$CPP"
1577 fi
1578   CPP="$ac_cv_prog_CPP"
1579 else
1580   ac_cv_prog_CPP="$CPP"
1581 fi
1582 echo "$ac_t""$CPP" 1>&6
1583
1584 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1585 echo "configure:1586: checking whether ${MAKE-make} sets \${MAKE}" >&5
1586 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1587 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1588   echo $ac_n "(cached) $ac_c" 1>&6
1589 else
1590   cat > conftestmake <<\EOF
1591 all:
1592         @echo 'ac_maketemp="${MAKE}"'
1593 EOF
1594 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1595 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1596 if test -n "$ac_maketemp"; then
1597   eval ac_cv_prog_make_${ac_make}_set=yes
1598 else
1599   eval ac_cv_prog_make_${ac_make}_set=no
1600 fi
1601 rm -f conftestmake
1602 fi
1603 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1604   echo "$ac_t""yes" 1>&6
1605   SET_MAKE=
1606 else
1607   echo "$ac_t""no" 1>&6
1608   SET_MAKE="MAKE=${MAKE-make}"
1609 fi
1610
1611 # Find a good install program.  We prefer a C program (faster),
1612 # so one script is as good as another.  But avoid the broken or
1613 # incompatible versions:
1614 # SysV /etc/install, /usr/sbin/install
1615 # SunOS /usr/etc/install
1616 # IRIX /sbin/install
1617 # AIX /bin/install
1618 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1619 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1620 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1621 # ./install, which can be erroneously created by make from ./install.sh.
1622 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1623 echo "configure:1624: checking for a BSD compatible install" >&5
1624 if test -z "$INSTALL"; then
1625 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1626   echo $ac_n "(cached) $ac_c" 1>&6
1627 else
1628     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1629   for ac_dir in $PATH; do
1630     # Account for people who put trailing slashes in PATH elements.
1631     case "$ac_dir/" in
1632     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1633     *)
1634       # OSF1 and SCO ODT 3.0 have their own names for install.
1635       # Don't use installbsd from OSF since it installs stuff as root
1636       # by default.
1637       for ac_prog in ginstall scoinst install; do
1638         if test -f $ac_dir/$ac_prog; then
1639           if test $ac_prog = install &&
1640             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1641             # AIX install.  It has an incompatible calling convention.
1642             :
1643           else
1644             ac_cv_path_install="$ac_dir/$ac_prog -c"
1645             break 2
1646           fi
1647         fi
1648       done
1649       ;;
1650     esac
1651   done
1652   IFS="$ac_save_IFS"
1653
1654 fi
1655   if test "${ac_cv_path_install+set}" = set; then
1656     INSTALL="$ac_cv_path_install"
1657   else
1658     # As a last resort, use the slow shell script.  We don't cache a
1659     # path for INSTALL within a source directory, because that will
1660     # break other packages using the cache if that directory is
1661     # removed, or if the path is relative.
1662     INSTALL="$ac_install_sh"
1663   fi
1664 fi
1665 echo "$ac_t""$INSTALL" 1>&6
1666
1667 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1668 # It thinks the first close brace ends the variable substitution.
1669 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1670
1671 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1672
1673 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1674
1675 # Extract the first word of "ranlib", so it can be a program name with args.
1676 set dummy ranlib; ac_word=$2
1677 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1678 echo "configure:1679: checking for $ac_word" >&5
1679 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1680   echo $ac_n "(cached) $ac_c" 1>&6
1681 else
1682   if test -n "$RANLIB"; then
1683   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1684 else
1685   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1686   ac_dummy="$PATH"
1687   for ac_dir in $ac_dummy; do
1688     test -z "$ac_dir" && ac_dir=.
1689     if test -f $ac_dir/$ac_word; then
1690       ac_cv_prog_RANLIB="ranlib"
1691       break
1692     fi
1693   done
1694   IFS="$ac_save_ifs"
1695   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1696 fi
1697 fi
1698 RANLIB="$ac_cv_prog_RANLIB"
1699 if test -n "$RANLIB"; then
1700   echo "$ac_t""$RANLIB" 1>&6
1701 else
1702   echo "$ac_t""no" 1>&6
1703 fi
1704
1705 echo $ac_n "checking build system type""... $ac_c" 1>&6
1706 echo "configure:1707: checking build system type" >&5
1707
1708 build_alias=$build
1709 case "$build_alias" in
1710 NONE)
1711   case $nonopt in
1712   NONE) build_alias=$host_alias ;;
1713   *) build_alias=$nonopt ;;
1714   esac ;;
1715 esac
1716
1717 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
1718 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1719 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1720 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1721 echo "$ac_t""$build" 1>&6
1722
1723 if test $host != $build; then
1724   ac_tool_prefix=${host_alias}-
1725 else
1726   ac_tool_prefix=
1727 fi
1728
1729 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
1730 set dummy ${ac_tool_prefix}ar; ac_word=$2
1731 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1732 echo "configure:1733: checking for $ac_word" >&5
1733 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
1734   echo $ac_n "(cached) $ac_c" 1>&6
1735 else
1736   if test -n "$AR"; then
1737   ac_cv_prog_AR="$AR" # Let the user override the test.
1738 else
1739   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1740   ac_dummy="$PATH"
1741   for ac_dir in $ac_dummy; do
1742     test -z "$ac_dir" && ac_dir=.
1743     if test -f $ac_dir/$ac_word; then
1744       ac_cv_prog_AR="${ac_tool_prefix}ar"
1745       break
1746     fi
1747   done
1748   IFS="$ac_save_ifs"
1749 fi
1750 fi
1751 AR="$ac_cv_prog_AR"
1752 if test -n "$AR"; then
1753   echo "$ac_t""$AR" 1>&6
1754 else
1755   echo "$ac_t""no" 1>&6
1756 fi
1757
1758
1759 if test -z "$ac_cv_prog_AR"; then
1760 if test -n "$ac_tool_prefix"; then
1761   # Extract the first word of "ar", so it can be a program name with args.
1762 set dummy ar; ac_word=$2
1763 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1764 echo "configure:1765: checking for $ac_word" >&5
1765 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
1766   echo $ac_n "(cached) $ac_c" 1>&6
1767 else
1768   if test -n "$AR"; then
1769   ac_cv_prog_AR="$AR" # Let the user override the test.
1770 else
1771   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1772   ac_dummy="$PATH"
1773   for ac_dir in $ac_dummy; do
1774     test -z "$ac_dir" && ac_dir=.
1775     if test -f $ac_dir/$ac_word; then
1776       ac_cv_prog_AR="ar"
1777       break
1778     fi
1779   done
1780   IFS="$ac_save_ifs"
1781   test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
1782 fi
1783 fi
1784 AR="$ac_cv_prog_AR"
1785 if test -n "$AR"; then
1786   echo "$ac_t""$AR" 1>&6
1787 else
1788   echo "$ac_t""no" 1>&6
1789 fi
1790
1791 else
1792   AR="ar"
1793 fi
1794 fi
1795
1796
1797 echo $ac_n "checking for inline""... $ac_c" 1>&6
1798 echo "configure:1799: checking for inline" >&5
1799 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1800   echo $ac_n "(cached) $ac_c" 1>&6
1801 else
1802   ac_cv_c_inline=no
1803 for ac_kw in inline __inline__ __inline; do
1804   cat > conftest.$ac_ext <<EOF
1805 #line 1806 "configure"
1806 #include "confdefs.h"
1807
1808 int main() {
1809 } $ac_kw foo() {
1810 ; return 0; }
1811 EOF
1812 if { (eval echo configure:1813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1813   rm -rf conftest*
1814   ac_cv_c_inline=$ac_kw; break
1815 else
1816   echo "configure: failed program was:" >&5
1817   cat conftest.$ac_ext >&5
1818 fi
1819 rm -f conftest*
1820 done
1821
1822 fi
1823
1824 echo "$ac_t""$ac_cv_c_inline" 1>&6
1825 case "$ac_cv_c_inline" in
1826   inline | yes) ;;
1827   no) cat >> confdefs.h <<\EOF
1828 #define inline 
1829 EOF
1830  ;;
1831   *)  cat >> confdefs.h <<EOF
1832 #define inline $ac_cv_c_inline
1833 EOF
1834  ;;
1835 esac
1836
1837 echo $ac_n "checking for working const""... $ac_c" 1>&6
1838 echo "configure:1839: checking for working const" >&5
1839 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1840   echo $ac_n "(cached) $ac_c" 1>&6
1841 else
1842   cat > conftest.$ac_ext <<EOF
1843 #line 1844 "configure"
1844 #include "confdefs.h"
1845
1846 int main() {
1847
1848 /* Ultrix mips cc rejects this.  */
1849 typedef int charset[2]; const charset x;
1850 /* SunOS 4.1.1 cc rejects this.  */
1851 char const *const *ccp;
1852 char **p;
1853 /* NEC SVR4.0.2 mips cc rejects this.  */
1854 struct point {int x, y;};
1855 static struct point const zero = {0,0};
1856 /* AIX XL C 1.02.0.0 rejects this.
1857    It does not let you subtract one const X* pointer from another in an arm
1858    of an if-expression whose if-part is not a constant expression */
1859 const char *g = "string";
1860 ccp = &g + (g ? g-g : 0);
1861 /* HPUX 7.0 cc rejects these. */
1862 ++ccp;
1863 p = (char**) ccp;
1864 ccp = (char const *const *) p;
1865 { /* SCO 3.2v4 cc rejects this.  */
1866   char *t;
1867   char const *s = 0 ? (char *) 0 : (char const *) 0;
1868
1869   *t++ = 0;
1870 }
1871 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1872   int x[] = {25, 17};
1873   const int *foo = &x[0];
1874   ++foo;
1875 }
1876 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1877   typedef const int *iptr;
1878   iptr p = 0;
1879   ++p;
1880 }
1881 { /* AIX XL C 1.02.0.0 rejects this saying
1882      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1883   struct s { int j; const int *ap[3]; };
1884   struct s *b; b->j = 5;
1885 }
1886 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1887   const int foo = 10;
1888 }
1889
1890 ; return 0; }
1891 EOF
1892 if { (eval echo configure:1893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1893   rm -rf conftest*
1894   ac_cv_c_const=yes
1895 else
1896   echo "configure: failed program was:" >&5
1897   cat conftest.$ac_ext >&5
1898   rm -rf conftest*
1899   ac_cv_c_const=no
1900 fi
1901 rm -f conftest*
1902 fi
1903
1904 echo "$ac_t""$ac_cv_c_const" 1>&6
1905 if test $ac_cv_c_const = no; then
1906   cat >> confdefs.h <<\EOF
1907 #define const 
1908 EOF
1909
1910 fi
1911
1912
1913 # Extract the first word of "dbx", so it can be a program name with args.
1914 set dummy dbx; ac_word=$2
1915 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1916 echo "configure:1917: checking for $ac_word" >&5
1917 if eval "test \"`echo '$''{'ac_cv_path_DBX'+set}'`\" = set"; then
1918   echo $ac_n "(cached) $ac_c" 1>&6
1919 else
1920   case "$DBX" in
1921   /*)
1922   ac_cv_path_DBX="$DBX" # Let the user override the test with a path.
1923   ;;
1924   ?:/*)                  
1925   ac_cv_path_DBX="$DBX" # Let the user override the test with a dos path.
1926   ;;
1927   *)
1928   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1929   ac_dummy="$PATH"
1930   for ac_dir in $ac_dummy; do 
1931     test -z "$ac_dir" && ac_dir=.
1932     if test -f $ac_dir/$ac_word; then
1933       ac_cv_path_DBX="$ac_dir/$ac_word"
1934       break
1935     fi
1936   done
1937   IFS="$ac_save_ifs"
1938   test -z "$ac_cv_path_DBX" && ac_cv_path_DBX="no"
1939   ;;
1940 esac
1941 fi
1942 DBX="$ac_cv_path_DBX"
1943 if test -n "$DBX"; then
1944   echo "$ac_t""$DBX" 1>&6
1945 else
1946   echo "$ac_t""no" 1>&6
1947 fi
1948
1949 # Extract the first word of "gdb", so it can be a program name with args.
1950 set dummy gdb; ac_word=$2
1951 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1952 echo "configure:1953: checking for $ac_word" >&5
1953 if eval "test \"`echo '$''{'ac_cv_path_GDB'+set}'`\" = set"; then
1954   echo $ac_n "(cached) $ac_c" 1>&6
1955 else
1956   case "$GDB" in
1957   /*)
1958   ac_cv_path_GDB="$GDB" # Let the user override the test with a path.
1959   ;;
1960   ?:/*)                  
1961   ac_cv_path_GDB="$GDB" # Let the user override the test with a dos path.
1962   ;;
1963   *)
1964   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1965   ac_dummy="$PATH"
1966   for ac_dir in $ac_dummy; do 
1967     test -z "$ac_dir" && ac_dir=.
1968     if test -f $ac_dir/$ac_word; then
1969       ac_cv_path_GDB="$ac_dir/$ac_word"
1970       break
1971     fi
1972   done
1973   IFS="$ac_save_ifs"
1974   test -z "$ac_cv_path_GDB" && ac_cv_path_GDB="no"
1975   ;;
1976 esac
1977 fi
1978 GDB="$ac_cv_path_GDB"
1979 if test -n "$GDB"; then
1980   echo "$ac_t""$GDB" 1>&6
1981 else
1982   echo "$ac_t""no" 1>&6
1983 fi
1984
1985 # Extract the first word of "sdb", so it can be a program name with args.
1986 set dummy sdb; ac_word=$2
1987 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1988 echo "configure:1989: checking for $ac_word" >&5
1989 if eval "test \"`echo '$''{'ac_cv_path_SDB'+set}'`\" = set"; then
1990   echo $ac_n "(cached) $ac_c" 1>&6
1991 else
1992   case "$SDB" in
1993   /*)
1994   ac_cv_path_SDB="$SDB" # Let the user override the test with a path.
1995   ;;
1996   ?:/*)                  
1997   ac_cv_path_SDB="$SDB" # Let the user override the test with a dos path.
1998   ;;
1999   *)
2000   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2001   ac_dummy="$PATH"
2002   for ac_dir in $ac_dummy; do 
2003     test -z "$ac_dir" && ac_dir=.
2004     if test -f $ac_dir/$ac_word; then
2005       ac_cv_path_SDB="$ac_dir/$ac_word"
2006       break
2007     fi
2008   done
2009   IFS="$ac_save_ifs"
2010   test -z "$ac_cv_path_SDB" && ac_cv_path_SDB="no"
2011   ;;
2012 esac
2013 fi
2014 SDB="$ac_cv_path_SDB"
2015 if test -n "$SDB"; then
2016   echo "$ac_t""$SDB" 1>&6
2017 else
2018   echo "$ac_t""no" 1>&6
2019 fi
2020
2021
2022 if test $GDB != no ; then
2023         DEBUGGER=$GDB
2024 elif test $DBX != no ; then
2025         DEBUGGER=$DBX
2026 elif test $SDB != no ; then
2027         DEBUGGER=$SDB
2028 else
2029         DEBUGGER=no
2030 fi
2031
2032
2033
2034 # The following templates should be used with newer automakes
2035 # instead of acconfig.h
2036 #
2037 #AH_TEMPLATE([sig_atomic_t],
2038 #            [/* Define to `int' if <signal.h> doesn't define.])
2039 #AH_TEMPLATE([HAVE_START_COLOR],
2040 #            [Define if you have start_color, as a function or macro.])
2041 #AH_TEMPLATE([HAVE_TYPEAHEAD],
2042 #            [Define if you have typeahead, as a function or macro.])
2043 #AH_TEMPLATE([HAVE_BKGDSET],
2044 #            [Define if you have bkgdset, as a function or macro.])
2045 #AH_TEMPLATE([HAVE_CURS_SET],
2046 #            [Define if you have curs_set, as a function or macro.])
2047 #AH_TEMPLATE([HAVE_META],
2048 #            [Define if you have meta, as a function or macro.])
2049 #AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS],
2050 #            [Define if you have use_default_colors, as a function or macro.])
2051 #AH_TEMPLATE([HAVE_RESIZETERM],
2052 #            [Define if you have resizeterm, as a function or macro.])
2053 #AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
2054 #            [Some systems declare sig_atomic_t as volatile, some others -- no.
2055 #             This define will have value `sig_atomic_t' or
2056 #             `volatile sig_atomic_t' accordingly.])
2057 #AH_TEMPLATE([ICONV_NONTRANS],
2058 #            [Define as 1 if iconv() only converts exactly and we should treat
2059 #             all return values other than (size_t)(-1) as equivalent.])
2060
2061
2062 ac_aux_path_sendmail=/usr/sbin:/usr/lib
2063 # Extract the first word of "sendmail", so it can be a program name with args.
2064 set dummy sendmail; ac_word=$2
2065 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2066 echo "configure:2067: checking for $ac_word" >&5
2067 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2068   echo $ac_n "(cached) $ac_c" 1>&6
2069 else
2070   case "$SENDMAIL" in
2071   /*)
2072   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2073   ;;
2074   ?:/*)                  
2075   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2076   ;;
2077   *)
2078   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2079   ac_dummy="$PATH:$ac_aux_path_sendmail"
2080   for ac_dir in $ac_dummy; do 
2081     test -z "$ac_dir" && ac_dir=.
2082     if test -f $ac_dir/$ac_word; then
2083       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2084       break
2085     fi
2086   done
2087   IFS="$ac_save_ifs"
2088   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/sbin/sendmail"
2089   ;;
2090 esac
2091 fi
2092 SENDMAIL="$ac_cv_path_SENDMAIL"
2093 if test -n "$SENDMAIL"; then
2094   echo "$ac_t""$SENDMAIL" 1>&6
2095 else
2096   echo "$ac_t""no" 1>&6
2097 fi
2098
2099 cat >> confdefs.h <<EOF
2100 #define SENDMAIL "$ac_cv_path_SENDMAIL"
2101 EOF
2102
2103
2104 OPS='$(srcdir)/OPS'
2105 if test -f $srcdir/EXPORTABLE ; then
2106         SUBVERSION="us"
2107 else
2108         SUBVERSION="i"
2109
2110         # Check whether --enable-pgp or --disable-pgp was given.
2111 if test "${enable_pgp+set}" = set; then
2112   enableval="$enable_pgp"
2113          if test x$enableval = xno ; then
2114                         have_pgp=no
2115                 fi
2116         
2117 fi
2118
2119
2120         if test x$have_pgp != xno ; then
2121                 cat >> confdefs.h <<\EOF
2122 #define CRYPT_BACKEND_CLASSIC_PGP 1
2123 EOF
2124
2125                 PGPAUX_TARGET="pgpring pgpewrap"
2126                 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o pgpmicalg.o pgppacket.o crypt-mod-pgp-classic.o"
2127         fi
2128
2129         # Check whether --enable-smime or --disable-smime was given.
2130 if test "${enable_smime+set}" = set; then
2131   enableval="$enable_smime"
2132         if test x$enableval = xno ; then
2133                         have_smime=no
2134                 fi
2135         
2136 fi
2137
2138  
2139         if test x$have_smime != xno ; then
2140                 cat >> confdefs.h <<\EOF
2141 #define CRYPT_BACKEND_CLASSIC_SMIME 1
2142 EOF
2143
2144                 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS smime.o crypt-mod-smime-classic.o"
2145                 SMIMEAUX_TARGET="smime_keys"
2146         fi
2147   
2148         # Check whether --with-mixmaster or --without-mixmaster was given.
2149 if test "${with_mixmaster+set}" = set; then
2150   withval="$with_mixmaster"
2151   if test -x "$withval" ; then
2152                         MIXMASTER="$withval"
2153                  else
2154                         MIXMASTER="mixmaster"
2155                  fi
2156                  OPS="$OPS \$(srcdir)/OPS.MIX"
2157                  MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS remailer.o"
2158                  cat >> confdefs.h <<EOF
2159 #define MIXMASTER "$MIXMASTER"
2160 EOF
2161
2162                 
2163 fi
2164
2165
2166 fi
2167 # We now require all OPS
2168 OPS="$OPS \$(srcdir)/OPS.PGP \$(srcdir)/OPS.SMIME \$(srcdir)/OPS.CRYPT "
2169
2170
2171
2172
2173
2174
2175 cat >> confdefs.h <<EOF
2176 #define SUBVERSION "$SUBVERSION"
2177 EOF
2178
2179
2180
2181 # Extract the first word of "ispell", so it can be a program name with args.
2182 set dummy ispell; ac_word=$2
2183 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2184 echo "configure:2185: checking for $ac_word" >&5
2185 if eval "test \"`echo '$''{'ac_cv_path_ISPELL'+set}'`\" = set"; then
2186   echo $ac_n "(cached) $ac_c" 1>&6
2187 else
2188   case "$ISPELL" in
2189   /*)
2190   ac_cv_path_ISPELL="$ISPELL" # Let the user override the test with a path.
2191   ;;
2192   ?:/*)                  
2193   ac_cv_path_ISPELL="$ISPELL" # Let the user override the test with a dos path.
2194   ;;
2195   *)
2196   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2197   ac_dummy="$PATH"
2198   for ac_dir in $ac_dummy; do 
2199     test -z "$ac_dir" && ac_dir=.
2200     if test -f $ac_dir/$ac_word; then
2201       ac_cv_path_ISPELL="$ac_dir/$ac_word"
2202       break
2203     fi
2204   done
2205   IFS="$ac_save_ifs"
2206   test -z "$ac_cv_path_ISPELL" && ac_cv_path_ISPELL="no"
2207   ;;
2208 esac
2209 fi
2210 ISPELL="$ac_cv_path_ISPELL"
2211 if test -n "$ISPELL"; then
2212   echo "$ac_t""$ISPELL" 1>&6
2213 else
2214   echo "$ac_t""no" 1>&6
2215 fi
2216
2217 if test $ISPELL != no; then
2218         cat >> confdefs.h <<EOF
2219 #define ISPELL "$ISPELL"
2220 EOF
2221
2222 fi
2223
2224 # Check whether --with-slang or --without-slang was given.
2225 if test "${with_slang+set}" = set; then
2226   withval="$with_slang"
2227   echo $ac_n "checking if this is a BSD system""... $ac_c" 1>&6
2228 echo "configure:2229: checking if this is a BSD system" >&5
2229 if eval "test \"`echo '$''{'mutt_cv_bsdish'+set}'`\" = set"; then
2230   echo $ac_n "(cached) $ac_c" 1>&6
2231 else
2232   if test "$cross_compiling" = yes; then
2233   mutt_cv_bsdish=no
2234 else
2235   cat > conftest.$ac_ext <<EOF
2236 #line 2237 "configure"
2237 #include "confdefs.h"
2238 #include <sys/param.h>
2239
2240 main ()
2241 {
2242 #ifdef BSD
2243         exit (0);
2244 #else
2245         exit (1);
2246 #endif
2247 }
2248 EOF
2249 if { (eval echo configure:2250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2250 then
2251   mutt_cv_bsdish=yes
2252 else
2253   echo "configure: failed program was:" >&5
2254   cat conftest.$ac_ext >&5
2255   rm -fr conftest*
2256   mutt_cv_bsdish=no
2257 fi
2258 rm -fr conftest*
2259 fi
2260
2261 fi
2262
2263 echo "$ac_t""$mutt_cv_bsdish" 1>&6
2264
2265         echo $ac_n "checking for S-Lang""... $ac_c" 1>&6
2266 echo "configure:2267: checking for S-Lang" >&5
2267         if test $withval = yes; then
2268                 if test -d $srcdir/../slang; then
2269                         mutt_cv_slang=$srcdir/../slang/src
2270                         CPPFLAGS="$CPPFLAGS -I${mutt_cv_slang}"
2271                         LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs"
2272                 else
2273                         if test -d $mutt_cv_prefix/include/slang; then
2274                                 CPPFLAGS="$CPPFLAGS -I$mutt_cv_prefix/include/slang"
2275                         elif test -d /usr/include/slang; then
2276                                 CPPFLAGS="$CPPFLAGS -I/usr/include/slang"
2277                         fi
2278                         mutt_cv_slang=yes
2279                 fi
2280         else
2281                                 if test -f $withval/src/slang.h; then
2282                         mutt_cv_slang=$withval/src
2283                         CPPFLAGS="$CPPFLAGS -I${mutt_cv_slang}"
2284                         LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs"
2285                 else
2286                                                 mutt_cv_slang=$withval
2287                         if test -d $withval/include/slang; then
2288                                 CPPFLAGS="$CPPFLAGS -I${withval}/include/slang"
2289                         elif test -d $withval/include; then
2290                                 CPPFLAGS="$CPPFLAGS -I${withval}/include"
2291                         fi
2292                         LDFLAGS="$LDFLAGS -L${withval}/lib"
2293                 fi
2294         fi
2295         echo "$ac_t""$mutt_cv_slang" 1>&6
2296         if test $mutt_cv_bsdish = yes; then
2297                 echo $ac_n "checking for main in -ltermlib""... $ac_c" 1>&6
2298 echo "configure:2299: checking for main in -ltermlib" >&5
2299 ac_lib_var=`echo termlib'_'main | sed 'y%./+-%__p_%'`
2300 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2301   echo $ac_n "(cached) $ac_c" 1>&6
2302 else
2303   ac_save_LIBS="$LIBS"
2304 LIBS="-ltermlib  $LIBS"
2305 cat > conftest.$ac_ext <<EOF
2306 #line 2307 "configure"
2307 #include "confdefs.h"
2308
2309 int main() {
2310 main()
2311 ; return 0; }
2312 EOF
2313 if { (eval echo configure:2314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2314   rm -rf conftest*
2315   eval "ac_cv_lib_$ac_lib_var=yes"
2316 else
2317   echo "configure: failed program was:" >&5
2318   cat conftest.$ac_ext >&5
2319   rm -rf conftest*
2320   eval "ac_cv_lib_$ac_lib_var=no"
2321 fi
2322 rm -f conftest*
2323 LIBS="$ac_save_LIBS"
2324
2325 fi
2326 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2327   echo "$ac_t""yes" 1>&6
2328     ac_tr_lib=HAVE_LIB`echo termlib | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2329     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2330   cat >> confdefs.h <<EOF
2331 #define $ac_tr_lib 1
2332 EOF
2333
2334   LIBS="-ltermlib $LIBS"
2335
2336 else
2337   echo "$ac_t""no" 1>&6
2338 fi
2339
2340         fi
2341         cat >> confdefs.h <<\EOF
2342 #define USE_SLANG_CURSES 1
2343 EOF
2344
2345         cat >> confdefs.h <<\EOF
2346 #define HAVE_COLOR 1
2347 EOF
2348
2349         MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS resize.o"
2350
2351         
2352         echo $ac_n "checking for SLtt_get_terminfo in -lslang""... $ac_c" 1>&6
2353 echo "configure:2354: checking for SLtt_get_terminfo in -lslang" >&5
2354 ac_lib_var=`echo slang'_'SLtt_get_terminfo | sed 'y%./+-%__p_%'`
2355 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2356   echo $ac_n "(cached) $ac_c" 1>&6
2357 else
2358   ac_save_LIBS="$LIBS"
2359 LIBS="-lslang -lm $LIBS"
2360 cat > conftest.$ac_ext <<EOF
2361 #line 2362 "configure"
2362 #include "confdefs.h"
2363 /* Override any gcc2 internal prototype to avoid an error.  */
2364 /* We use char because int might match the return type of a gcc2
2365     builtin and then its argument prototype would still apply.  */
2366 char SLtt_get_terminfo();
2367
2368 int main() {
2369 SLtt_get_terminfo()
2370 ; return 0; }
2371 EOF
2372 if { (eval echo configure:2373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2373   rm -rf conftest*
2374   eval "ac_cv_lib_$ac_lib_var=yes"
2375 else
2376   echo "configure: failed program was:" >&5
2377   cat conftest.$ac_ext >&5
2378   rm -rf conftest*
2379   eval "ac_cv_lib_$ac_lib_var=no"
2380 fi
2381 rm -f conftest*
2382 LIBS="$ac_save_LIBS"
2383
2384 fi
2385 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2386   echo "$ac_t""yes" 1>&6
2387   MUTTLIBS="$MUTTLIBS -lslang -lm"
2388 else
2389   echo "$ac_t""no" 1>&6
2390 { echo "configure: error: unable to compile.  check config.log" 1>&2; exit 1; }
2391 fi
2392
2393
2394         
2395 else
2396   mutt_cv_curses=/usr
2397         # Check whether --with-curses or --without-curses was given.
2398 if test "${with_curses+set}" = set; then
2399   withval="$with_curses"
2400   if test $withval != yes; then
2401                         mutt_cv_curses=$withval
2402                 fi
2403                 if test x$mutt_cv_curses != x/usr; then
2404                         LDFLAGS="-L${mutt_cv_curses}/lib $LDFLAGS"
2405                         CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include"
2406                 fi
2407 fi
2408
2409
2410         echo $ac_n "checking for initscr""... $ac_c" 1>&6
2411 echo "configure:2412: checking for initscr" >&5
2412 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
2413   echo $ac_n "(cached) $ac_c" 1>&6
2414 else
2415   cat > conftest.$ac_ext <<EOF
2416 #line 2417 "configure"
2417 #include "confdefs.h"
2418 /* System header to define __stub macros and hopefully few prototypes,
2419     which can conflict with char initscr(); below.  */
2420 #include <assert.h>
2421 /* Override any gcc2 internal prototype to avoid an error.  */
2422 /* We use char because int might match the return type of a gcc2
2423     builtin and then its argument prototype would still apply.  */
2424 char initscr();
2425
2426 int main() {
2427
2428 /* The GNU C library defines this for functions which it implements
2429     to always fail with ENOSYS.  Some functions are actually named
2430     something starting with __ and the normal name is an alias.  */
2431 #if defined (__stub_initscr) || defined (__stub___initscr)
2432 choke me
2433 #else
2434 initscr();
2435 #endif
2436
2437 ; return 0; }
2438 EOF
2439 if { (eval echo configure:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2440   rm -rf conftest*
2441   eval "ac_cv_func_initscr=yes"
2442 else
2443   echo "configure: failed program was:" >&5
2444   cat conftest.$ac_ext >&5
2445   rm -rf conftest*
2446   eval "ac_cv_func_initscr=no"
2447 fi
2448 rm -f conftest*
2449 fi
2450
2451 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
2452   echo "$ac_t""yes" 1>&6
2453   :
2454 else
2455   echo "$ac_t""no" 1>&6
2456
2457         cf_ncurses="ncurses"
2458         for lib in ncurses ncursesw
2459         do
2460                 echo $ac_n "checking for waddnwstr in -l$lib""... $ac_c" 1>&6
2461 echo "configure:2462: checking for waddnwstr in -l$lib" >&5
2462 ac_lib_var=`echo $lib'_'waddnwstr | sed 'y%./+-%__p_%'`
2463 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2464   echo $ac_n "(cached) $ac_c" 1>&6
2465 else
2466   ac_save_LIBS="$LIBS"
2467 LIBS="-l$lib  $LIBS"
2468 cat > conftest.$ac_ext <<EOF
2469 #line 2470 "configure"
2470 #include "confdefs.h"
2471 /* Override any gcc2 internal prototype to avoid an error.  */
2472 /* We use char because int might match the return type of a gcc2
2473     builtin and then its argument prototype would still apply.  */
2474 char waddnwstr();
2475
2476 int main() {
2477 waddnwstr()
2478 ; return 0; }
2479 EOF
2480 if { (eval echo configure:2481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2481   rm -rf conftest*
2482   eval "ac_cv_lib_$ac_lib_var=yes"
2483 else
2484   echo "configure: failed program was:" >&5
2485   cat conftest.$ac_ext >&5
2486   rm -rf conftest*
2487   eval "ac_cv_lib_$ac_lib_var=no"
2488 fi
2489 rm -f conftest*
2490 LIBS="$ac_save_LIBS"
2491
2492 fi
2493 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2494   echo "$ac_t""yes" 1>&6
2495   cf_ncurses="$lib"; break
2496 else
2497   echo "$ac_t""no" 1>&6
2498 fi
2499
2500         done
2501         echo $ac_n "checking for initscr in -l$cf_ncurses""... $ac_c" 1>&6
2502 echo "configure:2503: checking for initscr in -l$cf_ncurses" >&5
2503 ac_lib_var=`echo $cf_ncurses'_'initscr | sed 'y%./+-%__p_%'`
2504 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2505   echo $ac_n "(cached) $ac_c" 1>&6
2506 else
2507   ac_save_LIBS="$LIBS"
2508 LIBS="-l$cf_ncurses  $LIBS"
2509 cat > conftest.$ac_ext <<EOF
2510 #line 2511 "configure"
2511 #include "confdefs.h"
2512 /* Override any gcc2 internal prototype to avoid an error.  */
2513 /* We use char because int might match the return type of a gcc2
2514     builtin and then its argument prototype would still apply.  */
2515 char initscr();
2516
2517 int main() {
2518 initscr()
2519 ; return 0; }
2520 EOF
2521 if { (eval echo configure:2522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2522   rm -rf conftest*
2523   eval "ac_cv_lib_$ac_lib_var=yes"
2524 else
2525   echo "configure: failed program was:" >&5
2526   cat conftest.$ac_ext >&5
2527   rm -rf conftest*
2528   eval "ac_cv_lib_$ac_lib_var=no"
2529 fi
2530 rm -f conftest*
2531 LIBS="$ac_save_LIBS"
2532
2533 fi
2534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2535   echo "$ac_t""yes" 1>&6
2536   MUTTLIBS="$MUTTLIBS -l$cf_ncurses"
2537                 if test x$mutt_cv_curses = x/usr -a -d /usr/include/ncurses; then
2538                         CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
2539                 fi
2540                 
2541                 if test "$cf_ncurses" = ncursesw; then
2542                         for ac_hdr in ncursesw/ncurses.h
2543 do
2544 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2545 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2546 echo "configure:2547: checking for $ac_hdr" >&5
2547 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2548   echo $ac_n "(cached) $ac_c" 1>&6
2549 else
2550   cat > conftest.$ac_ext <<EOF
2551 #line 2552 "configure"
2552 #include "confdefs.h"
2553 #include <$ac_hdr>
2554 EOF
2555 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2556 { (eval echo configure:2557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2557 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2558 if test -z "$ac_err"; then
2559   rm -rf conftest*
2560   eval "ac_cv_header_$ac_safe=yes"
2561 else
2562   echo "$ac_err" >&5
2563   echo "configure: failed program was:" >&5
2564   cat conftest.$ac_ext >&5
2565   rm -rf conftest*
2566   eval "ac_cv_header_$ac_safe=no"
2567 fi
2568 rm -f conftest*
2569 fi
2570 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2571   echo "$ac_t""yes" 1>&6
2572     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2573   cat >> confdefs.h <<EOF
2574 #define $ac_tr_hdr 1
2575 EOF
2576  cf_cv_ncurses_header="ncursesw/ncurses.h"
2577 else
2578   echo "$ac_t""no" 1>&6
2579 fi
2580 done
2581
2582                 else
2583                         for ac_hdr in ncurses.h
2584 do
2585 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2586 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2587 echo "configure:2588: checking for $ac_hdr" >&5
2588 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2589   echo $ac_n "(cached) $ac_c" 1>&6
2590 else
2591   cat > conftest.$ac_ext <<EOF
2592 #line 2593 "configure"
2593 #include "confdefs.h"
2594 #include <$ac_hdr>
2595 EOF
2596 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2597 { (eval echo configure:2598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2598 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2599 if test -z "$ac_err"; then
2600   rm -rf conftest*
2601   eval "ac_cv_header_$ac_safe=yes"
2602 else
2603   echo "$ac_err" >&5
2604   echo "configure: failed program was:" >&5
2605   cat conftest.$ac_ext >&5
2606   rm -rf conftest*
2607   eval "ac_cv_header_$ac_safe=no"
2608 fi
2609 rm -f conftest*
2610 fi
2611 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2612   echo "$ac_t""yes" 1>&6
2613     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2614   cat >> confdefs.h <<EOF
2615 #define $ac_tr_hdr 1
2616 EOF
2617  cf_cv_ncurses_header="ncurses.h"
2618 else
2619   echo "$ac_t""no" 1>&6
2620 fi
2621 done
2622
2623                 fi
2624 else
2625   echo "$ac_t""no" 1>&6
2626
2627 echo $ac_n "checking for initscr""... $ac_c" 1>&6
2628 echo "configure:2629: checking for initscr" >&5
2629 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
2630   echo $ac_n "(cached) $ac_c" 1>&6
2631 else
2632   cat > conftest.$ac_ext <<EOF
2633 #line 2634 "configure"
2634 #include "confdefs.h"
2635 /* System header to define __stub macros and hopefully few prototypes,
2636     which can conflict with char initscr(); below.  */
2637 #include <assert.h>
2638 /* Override any gcc2 internal prototype to avoid an error.  */
2639 /* We use char because int might match the return type of a gcc2
2640     builtin and then its argument prototype would still apply.  */
2641 char initscr();
2642
2643 int main() {
2644
2645 /* The GNU C library defines this for functions which it implements
2646     to always fail with ENOSYS.  Some functions are actually named
2647     something starting with __ and the normal name is an alias.  */
2648 #if defined (__stub_initscr) || defined (__stub___initscr)
2649 choke me
2650 #else
2651 initscr();
2652 #endif
2653
2654 ; return 0; }
2655 EOF
2656 if { (eval echo configure:2657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2657   rm -rf conftest*
2658   eval "ac_cv_func_initscr=yes"
2659 else
2660   echo "configure: failed program was:" >&5
2661   cat conftest.$ac_ext >&5
2662   rm -rf conftest*
2663   eval "ac_cv_func_initscr=no"
2664 fi
2665 rm -f conftest*
2666 fi
2667
2668 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
2669   echo "$ac_t""yes" 1>&6
2670   :
2671 else
2672   echo "$ac_t""no" 1>&6
2673
2674 case $host_os in #(vi
2675 freebsd*) #(vi
2676         echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
2677 echo "configure:2678: checking for tgoto in -lmytinfo" >&5
2678 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
2679 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2680   echo $ac_n "(cached) $ac_c" 1>&6
2681 else
2682   ac_save_LIBS="$LIBS"
2683 LIBS="-lmytinfo  $LIBS"
2684 cat > conftest.$ac_ext <<EOF
2685 #line 2686 "configure"
2686 #include "confdefs.h"
2687 /* Override any gcc2 internal prototype to avoid an error.  */
2688 /* We use char because int might match the return type of a gcc2
2689     builtin and then its argument prototype would still apply.  */
2690 char tgoto();
2691
2692 int main() {
2693 tgoto()
2694 ; return 0; }
2695 EOF
2696 if { (eval echo configure:2697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2697   rm -rf conftest*
2698   eval "ac_cv_lib_$ac_lib_var=yes"
2699 else
2700   echo "configure: failed program was:" >&5
2701   cat conftest.$ac_ext >&5
2702   rm -rf conftest*
2703   eval "ac_cv_lib_$ac_lib_var=no"
2704 fi
2705 rm -f conftest*
2706 LIBS="$ac_save_LIBS"
2707
2708 fi
2709 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2710   echo "$ac_t""yes" 1>&6
2711   LIBS="-lmytinfo $LIBS"
2712 else
2713   echo "$ac_t""no" 1>&6
2714 fi
2715
2716         ;;
2717 hpux10.*|hpux11.*)
2718         echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
2719 echo "configure:2720: checking for initscr in -lcur_colr" >&5
2720 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
2721 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2722   echo $ac_n "(cached) $ac_c" 1>&6
2723 else
2724   ac_save_LIBS="$LIBS"
2725 LIBS="-lcur_colr  $LIBS"
2726 cat > conftest.$ac_ext <<EOF
2727 #line 2728 "configure"
2728 #include "confdefs.h"
2729 /* Override any gcc2 internal prototype to avoid an error.  */
2730 /* We use char because int might match the return type of a gcc2
2731     builtin and then its argument prototype would still apply.  */
2732 char initscr();
2733
2734 int main() {
2735 initscr()
2736 ; return 0; }
2737 EOF
2738 if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2739   rm -rf conftest*
2740   eval "ac_cv_lib_$ac_lib_var=yes"
2741 else
2742   echo "configure: failed program was:" >&5
2743   cat conftest.$ac_ext >&5
2744   rm -rf conftest*
2745   eval "ac_cv_lib_$ac_lib_var=no"
2746 fi
2747 rm -f conftest*
2748 LIBS="$ac_save_LIBS"
2749
2750 fi
2751 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2752   echo "$ac_t""yes" 1>&6
2753   
2754                 LIBS="-lcur_colr $LIBS"
2755                 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
2756                 ac_cv_func_initscr=yes
2757                 
2758 else
2759   echo "$ac_t""no" 1>&6
2760
2761         echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
2762 echo "configure:2763: checking for initscr in -lHcurses" >&5
2763 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
2764 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2765   echo $ac_n "(cached) $ac_c" 1>&6
2766 else
2767   ac_save_LIBS="$LIBS"
2768 LIBS="-lHcurses  $LIBS"
2769 cat > conftest.$ac_ext <<EOF
2770 #line 2771 "configure"
2771 #include "confdefs.h"
2772 /* Override any gcc2 internal prototype to avoid an error.  */
2773 /* We use char because int might match the return type of a gcc2
2774     builtin and then its argument prototype would still apply.  */
2775 char initscr();
2776
2777 int main() {
2778 initscr()
2779 ; return 0; }
2780 EOF
2781 if { (eval echo configure:2782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2782   rm -rf conftest*
2783   eval "ac_cv_lib_$ac_lib_var=yes"
2784 else
2785   echo "configure: failed program was:" >&5
2786   cat conftest.$ac_ext >&5
2787   rm -rf conftest*
2788   eval "ac_cv_lib_$ac_lib_var=no"
2789 fi
2790 rm -f conftest*
2791 LIBS="$ac_save_LIBS"
2792
2793 fi
2794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2795   echo "$ac_t""yes" 1>&6
2796   
2797                 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
2798                 LIBS="-lHcurses $LIBS"
2799                 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
2800                 ac_cv_func_initscr=yes
2801                 
2802 else
2803   echo "$ac_t""no" 1>&6
2804 fi
2805
2806 fi
2807
2808         ;;
2809 linux*) # Suse Linux does not follow /usr/lib convention
2810         LIBS="$LIBS -L/lib"
2811         ;;
2812 esac
2813
2814 if test ".$With5lib" != ".no" ; then
2815 if test -d /usr/5lib ; then
2816         # SunOS 3.x or 4.x
2817         CPPFLAGS="$CPPFLAGS -I/usr/5include"
2818         LIBS="$LIBS -L/usr/5lib"
2819 fi
2820 fi
2821
2822 if test ".$ac_cv_func_initscr" != .yes ; then
2823         cf_save_LIBS="$LIBS"
2824         cf_term_lib=""
2825         cf_curs_lib=""
2826
2827         # Check for library containing tgoto.  Do this before curses library
2828         # because it may be needed to link the test-case for initscr.
2829         echo $ac_n "checking for tgoto""... $ac_c" 1>&6
2830 echo "configure:2831: checking for tgoto" >&5
2831 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
2832   echo $ac_n "(cached) $ac_c" 1>&6
2833 else
2834   cat > conftest.$ac_ext <<EOF
2835 #line 2836 "configure"
2836 #include "confdefs.h"
2837 /* System header to define __stub macros and hopefully few prototypes,
2838     which can conflict with char tgoto(); below.  */
2839 #include <assert.h>
2840 /* Override any gcc2 internal prototype to avoid an error.  */
2841 /* We use char because int might match the return type of a gcc2
2842     builtin and then its argument prototype would still apply.  */
2843 char tgoto();
2844
2845 int main() {
2846
2847 /* The GNU C library defines this for functions which it implements
2848     to always fail with ENOSYS.  Some functions are actually named
2849     something starting with __ and the normal name is an alias.  */
2850 #if defined (__stub_tgoto) || defined (__stub___tgoto)
2851 choke me
2852 #else
2853 tgoto();
2854 #endif
2855
2856 ; return 0; }
2857 EOF
2858 if { (eval echo configure:2859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2859   rm -rf conftest*
2860   eval "ac_cv_func_tgoto=yes"
2861 else
2862   echo "configure: failed program was:" >&5
2863   cat conftest.$ac_ext >&5
2864   rm -rf conftest*
2865   eval "ac_cv_func_tgoto=no"
2866 fi
2867 rm -f conftest*
2868 fi
2869
2870 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
2871   echo "$ac_t""yes" 1>&6
2872   cf_term_lib=predefined
2873 else
2874   echo "$ac_t""no" 1>&6
2875
2876                 for cf_term_lib in termcap termlib unknown
2877                 do
2878                         echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
2879 echo "configure:2880: checking for tgoto in -l$cf_term_lib" >&5
2880 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
2881 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2882   echo $ac_n "(cached) $ac_c" 1>&6
2883 else
2884   ac_save_LIBS="$LIBS"
2885 LIBS="-l$cf_term_lib  $LIBS"
2886 cat > conftest.$ac_ext <<EOF
2887 #line 2888 "configure"
2888 #include "confdefs.h"
2889 /* Override any gcc2 internal prototype to avoid an error.  */
2890 /* We use char because int might match the return type of a gcc2
2891     builtin and then its argument prototype would still apply.  */
2892 char tgoto();
2893
2894 int main() {
2895 tgoto()
2896 ; return 0; }
2897 EOF
2898 if { (eval echo configure:2899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2899   rm -rf conftest*
2900   eval "ac_cv_lib_$ac_lib_var=yes"
2901 else
2902   echo "configure: failed program was:" >&5
2903   cat conftest.$ac_ext >&5
2904   rm -rf conftest*
2905   eval "ac_cv_lib_$ac_lib_var=no"
2906 fi
2907 rm -f conftest*
2908 LIBS="$ac_save_LIBS"
2909
2910 fi
2911 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2912   echo "$ac_t""yes" 1>&6
2913   break
2914 else
2915   echo "$ac_t""no" 1>&6
2916 fi
2917
2918                 done
2919         
2920 fi
2921
2922
2923         # Check for library containing initscr
2924         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
2925         for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
2926         do
2927                 echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
2928 echo "configure:2929: checking for initscr in -l$cf_curs_lib" >&5
2929 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
2930 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2931   echo $ac_n "(cached) $ac_c" 1>&6
2932 else
2933   ac_save_LIBS="$LIBS"
2934 LIBS="-l$cf_curs_lib  $LIBS"
2935 cat > conftest.$ac_ext <<EOF
2936 #line 2937 "configure"
2937 #include "confdefs.h"
2938 /* Override any gcc2 internal prototype to avoid an error.  */
2939 /* We use char because int might match the return type of a gcc2
2940     builtin and then its argument prototype would still apply.  */
2941 char initscr();
2942
2943 int main() {
2944 initscr()
2945 ; return 0; }
2946 EOF
2947 if { (eval echo configure:2948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2948   rm -rf conftest*
2949   eval "ac_cv_lib_$ac_lib_var=yes"
2950 else
2951   echo "configure: failed program was:" >&5
2952   cat conftest.$ac_ext >&5
2953   rm -rf conftest*
2954   eval "ac_cv_lib_$ac_lib_var=no"
2955 fi
2956 rm -f conftest*
2957 LIBS="$ac_save_LIBS"
2958
2959 fi
2960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2961   echo "$ac_t""yes" 1>&6
2962   break
2963 else
2964   echo "$ac_t""no" 1>&6
2965 fi
2966
2967         done
2968         test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
2969
2970         LIBS="-l$cf_curs_lib $cf_save_LIBS"
2971         if test "$cf_term_lib" = unknown ; then
2972                 echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
2973 echo "configure:2974: checking if we can link with $cf_curs_lib library" >&5
2974                 cat > conftest.$ac_ext <<EOF
2975 #line 2976 "configure"
2976 #include "confdefs.h"
2977 #include <${cf_cv_ncurses_header-curses.h}>
2978 int main() {
2979 initscr()
2980 ; return 0; }
2981 EOF
2982 if { (eval echo configure:2983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2983   rm -rf conftest*
2984   cf_result=yes
2985 else
2986   echo "configure: failed program was:" >&5
2987   cat conftest.$ac_ext >&5
2988   rm -rf conftest*
2989   cf_result=no
2990 fi
2991 rm -f conftest*
2992                 echo "$ac_t""$cf_result" 1>&6
2993                 test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
2994         elif test "$cf_term_lib" != predefined ; then
2995                 echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
2996 echo "configure:2997: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
2997                 cat > conftest.$ac_ext <<EOF
2998 #line 2999 "configure"
2999 #include "confdefs.h"
3000 #include <${cf_cv_ncurses_header-curses.h}>
3001 int main() {
3002 initscr(); tgoto((char *)0, 0, 0);
3003 ; return 0; }
3004 EOF
3005 if { (eval echo configure:3006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3006   rm -rf conftest*
3007   cf_result=no
3008 else
3009   echo "configure: failed program was:" >&5
3010   cat conftest.$ac_ext >&5
3011   rm -rf conftest*
3012   
3013                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
3014                         cat > conftest.$ac_ext <<EOF
3015 #line 3016 "configure"
3016 #include "confdefs.h"
3017 #include <${cf_cv_ncurses_header-curses.h}>
3018 int main() {
3019 initscr()
3020 ; return 0; }
3021 EOF
3022 if { (eval echo configure:3023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3023   rm -rf conftest*
3024   cf_result=yes
3025 else
3026   echo "configure: failed program was:" >&5
3027   cat conftest.$ac_ext >&5
3028   rm -rf conftest*
3029   cf_result=error
3030 fi
3031 rm -f conftest*
3032                         
3033 fi
3034 rm -f conftest*
3035                 echo "$ac_t""$cf_result" 1>&6
3036         fi
3037 fi
3038
3039
3040 fi
3041
3042 fi
3043
3044                 
3045 fi
3046
3047
3048         old_LIBS="$LIBS"
3049         LIBS="$LIBS $MUTTLIBS"
3050         for ac_func in start_color typeahead bkgdset curs_set meta use_default_colors resizeterm
3051 do
3052
3053 echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6
3054 echo "configure:3055: checking for $ac_func declaration" >&5
3055 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then
3056   echo $ac_n "(cached) $ac_c" 1>&6
3057 else
3058   cat > conftest.$ac_ext <<EOF
3059 #line 3060 "configure"
3060 #include "confdefs.h"
3061 #include <${cf_cv_ncurses_header-curses.h}>
3062 int main() {
3063 #ifndef ${ac_func}
3064 extern  int     ${ac_func}();
3065 #endif
3066 ; return 0; }
3067 EOF
3068 if { (eval echo configure:3069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3069   rm -rf conftest*
3070   
3071 cat > conftest.$ac_ext <<EOF
3072 #line 3073 "configure"
3073 #include "confdefs.h"
3074 #include <${cf_cv_ncurses_header-curses.h}>
3075 int main() {
3076 #ifndef ${ac_func}
3077 int     (*p)() = ${ac_func};
3078 #endif
3079 ; return 0; }
3080 EOF
3081 if { (eval echo configure:3082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3082   rm -rf conftest*
3083   
3084 eval "ac_cv_func_decl_$ac_func=yes"
3085 else
3086   echo "configure: failed program was:" >&5
3087   cat conftest.$ac_ext >&5
3088   rm -rf conftest*
3089   
3090 eval "ac_cv_func_decl_$ac_func=no"
3091 fi
3092 rm -f conftest*
3093 else
3094   echo "configure: failed program was:" >&5
3095   cat conftest.$ac_ext >&5
3096   rm -rf conftest*
3097   
3098 eval "ac_cv_func_decl_$ac_func=yes"
3099 fi
3100 rm -f conftest*
3101 fi
3102
3103 if eval "test \"`echo '$ac_cv_func_'decl_$ac_func`\" = yes"; then
3104   echo "$ac_t""yes" 1>&6
3105   
3106   
3107 ac_tr_func=`echo HAVE_$ac_func | tr '[a-z]' '[A-Z]'`
3108
3109   cat >> confdefs.h <<EOF
3110 #define $ac_tr_func 1
3111 EOF
3112  
3113 else
3114   echo "$ac_t""no" 1>&6
3115 fi
3116 done
3117
3118         if test "$ac_cv_func_decl_start_color" = yes; then
3119                 cat >> confdefs.h <<\EOF
3120 #define HAVE_COLOR 1
3121 EOF
3122
3123         fi
3124         if test "$ac_cv_func_decl_resizeterm" = yes; then
3125                 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS resize.o"
3126         fi
3127         LIBS="$old_LIBS"
3128         
3129 fi
3130
3131
3132 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3133 echo "configure:3134: checking for ANSI C header files" >&5
3134 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
3135   echo $ac_n "(cached) $ac_c" 1>&6
3136 else
3137   cat > conftest.$ac_ext <<EOF
3138 #line 3139 "configure"
3139 #include "confdefs.h"
3140 #include <stdlib.h>
3141 #include <stdarg.h>
3142 #include <string.h>
3143 #include <float.h>
3144 EOF
3145 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3146 { (eval echo configure:3147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3147 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3148 if test -z "$ac_err"; then
3149   rm -rf conftest*
3150   ac_cv_header_stdc=yes
3151 else
3152   echo "$ac_err" >&5
3153   echo "configure: failed program was:" >&5
3154   cat conftest.$ac_ext >&5
3155   rm -rf conftest*
3156   ac_cv_header_stdc=no
3157 fi
3158 rm -f conftest*
3159
3160 if test $ac_cv_header_stdc = yes; then
3161   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3162 cat > conftest.$ac_ext <<EOF
3163 #line 3164 "configure"
3164 #include "confdefs.h"
3165 #include <string.h>
3166 EOF
3167 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3168   egrep "memchr" >/dev/null 2>&1; then
3169   :
3170 else
3171   rm -rf conftest*
3172   ac_cv_header_stdc=no
3173 fi
3174 rm -f conftest*
3175
3176 fi
3177
3178 if test $ac_cv_header_stdc = yes; then
3179   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3180 cat > conftest.$ac_ext <<EOF
3181 #line 3182 "configure"
3182 #include "confdefs.h"
3183 #include <stdlib.h>
3184 EOF
3185 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3186   egrep "free" >/dev/null 2>&1; then
3187   :
3188 else
3189   rm -rf conftest*
3190   ac_cv_header_stdc=no
3191 fi
3192 rm -f conftest*
3193
3194 fi
3195
3196 if test $ac_cv_header_stdc = yes; then
3197   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3198 if test "$cross_compiling" = yes; then
3199   :
3200 else
3201   cat > conftest.$ac_ext <<EOF
3202 #line 3203 "configure"
3203 #include "confdefs.h"
3204 #include <ctype.h>
3205 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3206 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3207 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3208 int main () { int i; for (i = 0; i < 256; i++)
3209 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3210 exit (0); }
3211
3212 EOF
3213 if { (eval echo configure:3214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3214 then
3215   :
3216 else
3217   echo "configure: failed program was:" >&5
3218   cat conftest.$ac_ext >&5
3219   rm -fr conftest*
3220   ac_cv_header_stdc=no
3221 fi
3222 rm -fr conftest*
3223 fi
3224
3225 fi
3226 fi
3227
3228 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3229 if test $ac_cv_header_stdc = yes; then
3230   cat >> confdefs.h <<\EOF
3231 #define STDC_HEADERS 1
3232 EOF
3233
3234 fi
3235
3236
3237 for ac_hdr in stdarg.h sys/ioctl.h ioctl.h sysexits.h
3238 do
3239 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3240 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3241 echo "configure:3242: checking for $ac_hdr" >&5
3242 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3243   echo $ac_n "(cached) $ac_c" 1>&6
3244 else
3245   cat > conftest.$ac_ext <<EOF
3246 #line 3247 "configure"
3247 #include "confdefs.h"
3248 #include <$ac_hdr>
3249 EOF
3250 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3251 { (eval echo configure:3252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3252 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3253 if test -z "$ac_err"; then
3254   rm -rf conftest*
3255   eval "ac_cv_header_$ac_safe=yes"
3256 else
3257   echo "$ac_err" >&5
3258   echo "configure: failed program was:" >&5
3259   cat conftest.$ac_ext >&5
3260   rm -rf conftest*
3261   eval "ac_cv_header_$ac_safe=no"
3262 fi
3263 rm -f conftest*
3264 fi
3265 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3266   echo "$ac_t""yes" 1>&6
3267     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3268   cat >> confdefs.h <<EOF
3269 #define $ac_tr_hdr 1
3270 EOF
3271  
3272 else
3273   echo "$ac_t""no" 1>&6
3274 fi
3275 done
3276
3277 for ac_hdr in sys/time.h sys/resource.h
3278 do
3279 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3280 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3281 echo "configure:3282: checking for $ac_hdr" >&5
3282 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3283   echo $ac_n "(cached) $ac_c" 1>&6
3284 else
3285   cat > conftest.$ac_ext <<EOF
3286 #line 3287 "configure"
3287 #include "confdefs.h"
3288 #include <$ac_hdr>
3289 EOF
3290 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3291 { (eval echo configure:3292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3292 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3293 if test -z "$ac_err"; then
3294   rm -rf conftest*
3295   eval "ac_cv_header_$ac_safe=yes"
3296 else
3297   echo "$ac_err" >&5
3298   echo "configure: failed program was:" >&5
3299   cat conftest.$ac_ext >&5
3300   rm -rf conftest*
3301   eval "ac_cv_header_$ac_safe=no"
3302 fi
3303 rm -f conftest*
3304 fi
3305 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3306   echo "$ac_t""yes" 1>&6
3307     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3308   cat >> confdefs.h <<EOF
3309 #define $ac_tr_hdr 1
3310 EOF
3311  
3312 else
3313   echo "$ac_t""no" 1>&6
3314 fi
3315 done
3316
3317 for ac_hdr in unix.h
3318 do
3319 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3320 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3321 echo "configure:3322: checking for $ac_hdr" >&5
3322 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3323   echo $ac_n "(cached) $ac_c" 1>&6
3324 else
3325   cat > conftest.$ac_ext <<EOF
3326 #line 3327 "configure"
3327 #include "confdefs.h"
3328 #include <$ac_hdr>
3329 EOF
3330 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3331 { (eval echo configure:3332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3332 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3333 if test -z "$ac_err"; then
3334   rm -rf conftest*
3335   eval "ac_cv_header_$ac_safe=yes"
3336 else
3337   echo "$ac_err" >&5
3338   echo "configure: failed program was:" >&5
3339   cat conftest.$ac_ext >&5
3340   rm -rf conftest*
3341   eval "ac_cv_header_$ac_safe=no"
3342 fi
3343 rm -f conftest*
3344 fi
3345 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3346   echo "$ac_t""yes" 1>&6
3347     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3348   cat >> confdefs.h <<EOF
3349 #define $ac_tr_hdr 1
3350 EOF
3351  
3352 else
3353   echo "$ac_t""no" 1>&6
3354 fi
3355 done
3356
3357
3358 for ac_func in setrlimit getsid isctype
3359 do
3360 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3361 echo "configure:3362: checking for $ac_func" >&5
3362 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3363   echo $ac_n "(cached) $ac_c" 1>&6
3364 else
3365   cat > conftest.$ac_ext <<EOF
3366 #line 3367 "configure"
3367 #include "confdefs.h"
3368 /* System header to define __stub macros and hopefully few prototypes,
3369     which can conflict with char $ac_func(); below.  */
3370 #include <assert.h>
3371 /* Override any gcc2 internal prototype to avoid an error.  */
3372 /* We use char because int might match the return type of a gcc2
3373     builtin and then its argument prototype would still apply.  */
3374 char $ac_func();
3375
3376 int main() {
3377
3378 /* The GNU C library defines this for functions which it implements
3379     to always fail with ENOSYS.  Some functions are actually named
3380     something starting with __ and the normal name is an alias.  */
3381 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3382 choke me
3383 #else
3384 $ac_func();
3385 #endif
3386
3387 ; return 0; }
3388 EOF
3389 if { (eval echo configure:3390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3390   rm -rf conftest*
3391   eval "ac_cv_func_$ac_func=yes"
3392 else
3393   echo "configure: failed program was:" >&5
3394   cat conftest.$ac_ext >&5
3395   rm -rf conftest*
3396   eval "ac_cv_func_$ac_func=no"
3397 fi
3398 rm -f conftest*
3399 fi
3400
3401 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3402   echo "$ac_t""yes" 1>&6
3403     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3404   cat >> confdefs.h <<EOF
3405 #define $ac_tr_func 1
3406 EOF
3407  
3408 else
3409   echo "$ac_t""no" 1>&6
3410 fi
3411 done
3412
3413
3414 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3415 echo "configure:3416: checking return type of signal handlers" >&5
3416 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3417   echo $ac_n "(cached) $ac_c" 1>&6
3418 else
3419   cat > conftest.$ac_ext <<EOF
3420 #line 3421 "configure"
3421 #include "confdefs.h"
3422 #include <sys/types.h>
3423 #include <signal.h>
3424 #ifdef signal
3425 #undef signal
3426 #endif
3427 #ifdef __cplusplus
3428 extern "C" void (*signal (int, void (*)(int)))(int);
3429 #else
3430 void (*signal ()) ();
3431 #endif
3432
3433 int main() {
3434 int i;
3435 ; return 0; }
3436 EOF
3437 if { (eval echo configure:3438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3438   rm -rf conftest*
3439   ac_cv_type_signal=void
3440 else
3441   echo "configure: failed program was:" >&5
3442   cat conftest.$ac_ext >&5
3443   rm -rf conftest*
3444   ac_cv_type_signal=int
3445 fi
3446 rm -f conftest*
3447 fi
3448
3449 echo "$ac_t""$ac_cv_type_signal" 1>&6
3450 cat >> confdefs.h <<EOF
3451 #define RETSIGTYPE $ac_cv_type_signal
3452 EOF
3453
3454
3455
3456 echo $ac_n "checking for sig_atomic_t in signal.h""... $ac_c" 1>&6
3457 echo "configure:3458: checking for sig_atomic_t in signal.h" >&5
3458 cat > conftest.$ac_ext <<EOF
3459 #line 3460 "configure"
3460 #include "confdefs.h"
3461 #include <signal.h>
3462 EOF
3463 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3464   egrep "sig_atomic_t" >/dev/null 2>&1; then
3465   rm -rf conftest*
3466   
3467     ac_cv_type_sig_atomic_t=yes;
3468     cat > conftest.$ac_ext <<EOF
3469 #line 3470 "configure"
3470 #include "confdefs.h"
3471 #include <signal.h>
3472 EOF
3473 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3474   egrep "volatile.*sig_atomic_t" >/dev/null 2>&1; then
3475   rm -rf conftest*
3476   
3477                         is_sig_atomic_t_volatile=yes;
3478                         echo "$ac_t""yes, volatile" 1>&6
3479                     
3480 else
3481   rm -rf conftest*
3482   
3483                         is_sig_atomic_t_volatile=no;
3484                         echo "$ac_t""yes, non volatile" 1>&6
3485                     
3486 fi
3487 rm -f conftest*
3488
3489   
3490 else
3491   rm -rf conftest*
3492   
3493     echo "$ac_t""no" 1>&6
3494     echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
3495 echo "configure:3496: checking for sig_atomic_t" >&5
3496 if eval "test \"`echo '$''{'ac_cv_type_sig_atomic_t'+set}'`\" = set"; then
3497   echo $ac_n "(cached) $ac_c" 1>&6
3498 else
3499   cat > conftest.$ac_ext <<EOF
3500 #line 3501 "configure"
3501 #include "confdefs.h"
3502 #include <sys/types.h>
3503 #if STDC_HEADERS
3504 #include <stdlib.h>
3505 #include <stddef.h>
3506 #endif
3507 EOF
3508 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3509   egrep "(^|[^a-zA-Z_0-9])sig_atomic_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3510   rm -rf conftest*
3511   ac_cv_type_sig_atomic_t=yes
3512 else
3513   rm -rf conftest*
3514   ac_cv_type_sig_atomic_t=no
3515 fi
3516 rm -f conftest*
3517
3518 fi
3519 echo "$ac_t""$ac_cv_type_sig_atomic_t" 1>&6
3520 if test $ac_cv_type_sig_atomic_t = no; then
3521   cat >> confdefs.h <<\EOF
3522 #define sig_atomic_t int
3523 EOF
3524
3525 fi
3526
3527     is_sig_atomic_t_volatile=no
3528   
3529 fi
3530 rm -f conftest*
3531
3532 if test $is_sig_atomic_t_volatile = 'yes'
3533 then
3534     cat >> confdefs.h <<\EOF
3535 #define SIG_ATOMIC_VOLATILE_T sig_atomic_t
3536 EOF
3537
3538 else
3539     cat >> confdefs.h <<\EOF
3540 #define SIG_ATOMIC_VOLATILE_T volatile sig_atomic_t
3541 EOF
3542
3543 fi
3544
3545 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3546 echo "configure:3547: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3547 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
3548   echo $ac_n "(cached) $ac_c" 1>&6
3549 else
3550   cat > conftest.$ac_ext <<EOF
3551 #line 3552 "configure"
3552 #include "confdefs.h"
3553 #include <sys/types.h>
3554 #include <signal.h>
3555 /* NetBSD declares sys_siglist in unistd.h.  */
3556 #ifdef HAVE_UNISTD_H
3557 #include <unistd.h>
3558 #endif
3559 int main() {
3560 char *msg = *(sys_siglist + 1);
3561 ; return 0; }
3562 EOF
3563 if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3564   rm -rf conftest*
3565   ac_cv_decl_sys_siglist=yes
3566 else
3567   echo "configure: failed program was:" >&5
3568   cat conftest.$ac_ext >&5
3569   rm -rf conftest*
3570   ac_cv_decl_sys_siglist=no
3571 fi
3572 rm -f conftest*
3573 fi
3574
3575 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3576 if test $ac_cv_decl_sys_siglist = yes; then
3577   cat >> confdefs.h <<\EOF
3578 #define SYS_SIGLIST_DECLARED 1
3579 EOF
3580
3581 fi
3582
3583
3584 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3585 echo "configure:3586: checking whether byte ordering is bigendian" >&5
3586 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
3587   echo $ac_n "(cached) $ac_c" 1>&6
3588 else
3589   ac_cv_c_bigendian=unknown
3590 # See if sys/param.h defines the BYTE_ORDER macro.
3591 cat > conftest.$ac_ext <<EOF
3592 #line 3593 "configure"
3593 #include "confdefs.h"
3594 #include <sys/types.h>
3595 #include <sys/param.h>
3596 int main() {
3597
3598 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3599  bogus endian macros
3600 #endif
3601 ; return 0; }
3602 EOF
3603 if { (eval echo configure:3604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3604   rm -rf conftest*
3605   # It does; now see whether it defined to BIG_ENDIAN or not.
3606 cat > conftest.$ac_ext <<EOF
3607 #line 3608 "configure"
3608 #include "confdefs.h"
3609 #include <sys/types.h>
3610 #include <sys/param.h>
3611 int main() {
3612
3613 #if BYTE_ORDER != BIG_ENDIAN
3614  not big endian
3615 #endif
3616 ; return 0; }
3617 EOF
3618 if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3619   rm -rf conftest*
3620   ac_cv_c_bigendian=yes
3621 else
3622   echo "configure: failed program was:" >&5
3623   cat conftest.$ac_ext >&5
3624   rm -rf conftest*
3625   ac_cv_c_bigendian=no
3626 fi
3627 rm -f conftest*
3628 else
3629   echo "configure: failed program was:" >&5
3630   cat conftest.$ac_ext >&5
3631 fi
3632 rm -f conftest*
3633 if test $ac_cv_c_bigendian = unknown; then
3634 if test "$cross_compiling" = yes; then
3635     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
3636 else
3637   cat > conftest.$ac_ext <<EOF
3638 #line 3639 "configure"
3639 #include "confdefs.h"
3640 main () {
3641   /* Are we little or big endian?  From Harbison&Steele.  */
3642   union
3643   {
3644     long l;
3645     char c[sizeof (long)];
3646   } u;
3647   u.l = 1;
3648   exit (u.c[sizeof (long) - 1] == 1);
3649 }
3650 EOF
3651 if { (eval echo configure:3652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3652 then
3653   ac_cv_c_bigendian=no
3654 else
3655   echo "configure: failed program was:" >&5
3656   cat conftest.$ac_ext >&5
3657   rm -fr conftest*
3658   ac_cv_c_bigendian=yes
3659 fi
3660 rm -fr conftest*
3661 fi
3662
3663 fi
3664 fi
3665
3666 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3667 if test $ac_cv_c_bigendian = yes; then
3668   cat >> confdefs.h <<\EOF
3669 #define WORDS_BIGENDIAN 1
3670 EOF
3671
3672 fi
3673
3674 for ac_hdr in inttypes.h stdint.h
3675 do
3676 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3677 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3678 echo "configure:3679: checking for $ac_hdr" >&5
3679 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3680   echo $ac_n "(cached) $ac_c" 1>&6
3681 else
3682   cat > conftest.$ac_ext <<EOF
3683 #line 3684 "configure"
3684 #include "confdefs.h"
3685 #include <$ac_hdr>
3686 EOF
3687 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3688 { (eval echo configure:3689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3689 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3690 if test -z "$ac_err"; then
3691   rm -rf conftest*
3692   eval "ac_cv_header_$ac_safe=yes"
3693 else
3694   echo "$ac_err" >&5
3695   echo "configure: failed program was:" >&5
3696   cat conftest.$ac_ext >&5
3697   rm -rf conftest*
3698   eval "ac_cv_header_$ac_safe=no"
3699 fi
3700 rm -f conftest*
3701 fi
3702 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3703   echo "$ac_t""yes" 1>&6
3704     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3705   cat >> confdefs.h <<EOF
3706 #define $ac_tr_hdr 1
3707 EOF
3708  
3709 else
3710   echo "$ac_t""no" 1>&6
3711 fi
3712 done
3713
3714 echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
3715 echo "configure:3716: checking for uint32_t" >&5
3716 cat > conftest.$ac_ext <<EOF
3717 #line 3718 "configure"
3718 #include "confdefs.h"
3719
3720 #include <sys/types.h>
3721 #if HAVE_INTTYPES_H
3722 #include <inttypes.h>
3723 #else
3724 #if HAVE_STDINT_H
3725 #include <stdint.h>
3726 #endif
3727 #endif
3728 int main() {
3729 if ((uint32_t *) 0)
3730   return 0;
3731 if (sizeof (uint32_t))
3732   return 0;
3733
3734 ; return 0; }
3735 EOF
3736 if { (eval echo configure:3737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3737   rm -rf conftest*
3738   
3739     cat >> confdefs.h <<\EOF
3740 #define HAVE_UINT32_T 1
3741 EOF
3742
3743     echo "$ac_t""yes" 1>&6
3744   
3745 else
3746   echo "configure: failed program was:" >&5
3747   cat conftest.$ac_ext >&5
3748   rm -rf conftest*
3749   echo "$ac_t""no" 1>&6
3750
3751 fi
3752 rm -f conftest*
3753 echo $ac_n "checking size of int""... $ac_c" 1>&6
3754 echo "configure:3755: checking size of int" >&5
3755 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
3756   echo $ac_n "(cached) $ac_c" 1>&6
3757 else
3758   if test "$cross_compiling" = yes; then
3759     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
3760 else
3761   cat > conftest.$ac_ext <<EOF
3762 #line 3763 "configure"
3763 #include "confdefs.h"
3764 #include <stdio.h>
3765 #include <sys/types.h>
3766 main()
3767 {
3768   FILE *f=fopen("conftestval", "w");
3769   if (!f) exit(1);
3770   fprintf(f, "%d\n", sizeof(int));
3771   exit(0);
3772 }
3773 EOF
3774 if { (eval echo configure:3775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3775 then
3776   ac_cv_sizeof_int=`cat conftestval`
3777 else
3778   echo "configure: failed program was:" >&5
3779   cat conftest.$ac_ext >&5
3780   rm -fr conftest*
3781   ac_cv_sizeof_int=0
3782 fi
3783 rm -fr conftest*
3784 fi
3785
3786 fi
3787 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
3788 cat >> confdefs.h <<EOF
3789 #define SIZEOF_INT $ac_cv_sizeof_int
3790 EOF
3791
3792
3793 echo $ac_n "checking size of long""... $ac_c" 1>&6
3794 echo "configure:3795: checking size of long" >&5
3795 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
3796   echo $ac_n "(cached) $ac_c" 1>&6
3797 else
3798   if test "$cross_compiling" = yes; then
3799     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
3800 else
3801   cat > conftest.$ac_ext <<EOF
3802 #line 3803 "configure"
3803 #include "confdefs.h"
3804 #include <stdio.h>
3805 #include <sys/types.h>
3806 main()
3807 {
3808   FILE *f=fopen("conftestval", "w");
3809   if (!f) exit(1);
3810   fprintf(f, "%d\n", sizeof(long));
3811   exit(0);
3812 }
3813 EOF
3814 if { (eval echo configure:3815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3815 then
3816   ac_cv_sizeof_long=`cat conftestval`
3817 else
3818   echo "configure: failed program was:" >&5
3819   cat conftest.$ac_ext >&5
3820   rm -fr conftest*
3821   ac_cv_sizeof_long=0
3822 fi
3823 rm -fr conftest*
3824 fi
3825
3826 fi
3827 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
3828 cat >> confdefs.h <<EOF
3829 #define SIZEOF_LONG $ac_cv_sizeof_long
3830 EOF
3831
3832
3833
3834 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3835 echo "configure:3836: checking for pid_t" >&5
3836 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
3837   echo $ac_n "(cached) $ac_c" 1>&6
3838 else
3839   cat > conftest.$ac_ext <<EOF
3840 #line 3841 "configure"
3841 #include "confdefs.h"
3842 #include <sys/types.h>
3843 #if STDC_HEADERS
3844 #include <stdlib.h>
3845 #include <stddef.h>
3846 #endif
3847 EOF
3848 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3849   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3850   rm -rf conftest*
3851   ac_cv_type_pid_t=yes
3852 else
3853   rm -rf conftest*
3854   ac_cv_type_pid_t=no
3855 fi
3856 rm -f conftest*
3857
3858 fi
3859 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3860 if test $ac_cv_type_pid_t = no; then
3861   cat >> confdefs.h <<\EOF
3862 #define pid_t int
3863 EOF
3864
3865 fi
3866
3867
3868 for ac_func in fgetpos memmove setegid srand48 strerror
3869 do
3870 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3871 echo "configure:3872: checking for $ac_func" >&5
3872 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3873   echo $ac_n "(cached) $ac_c" 1>&6
3874 else
3875   cat > conftest.$ac_ext <<EOF
3876 #line 3877 "configure"
3877 #include "confdefs.h"
3878 /* System header to define __stub macros and hopefully few prototypes,
3879     which can conflict with char $ac_func(); below.  */
3880 #include <assert.h>
3881 /* Override any gcc2 internal prototype to avoid an error.  */
3882 /* We use char because int might match the return type of a gcc2
3883     builtin and then its argument prototype would still apply.  */
3884 char $ac_func();
3885
3886 int main() {
3887
3888 /* The GNU C library defines this for functions which it implements
3889     to always fail with ENOSYS.  Some functions are actually named
3890     something starting with __ and the normal name is an alias.  */
3891 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3892 choke me
3893 #else
3894 $ac_func();
3895 #endif
3896
3897 ; return 0; }
3898 EOF
3899 if { (eval echo configure:3900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3900   rm -rf conftest*
3901   eval "ac_cv_func_$ac_func=yes"
3902 else
3903   echo "configure: failed program was:" >&5
3904   cat conftest.$ac_ext >&5
3905   rm -rf conftest*
3906   eval "ac_cv_func_$ac_func=no"
3907 fi
3908 rm -f conftest*
3909 fi
3910
3911 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3912   echo "$ac_t""yes" 1>&6
3913     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3914   cat >> confdefs.h <<EOF
3915 #define $ac_tr_func 1
3916 EOF
3917  
3918 else
3919   echo "$ac_t""no" 1>&6
3920 fi
3921 done
3922
3923
3924 for ac_func in strcasecmp strdup
3925 do
3926 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3927 echo "configure:3928: checking for $ac_func" >&5
3928 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3929   echo $ac_n "(cached) $ac_c" 1>&6
3930 else
3931   cat > conftest.$ac_ext <<EOF
3932 #line 3933 "configure"
3933 #include "confdefs.h"
3934 /* System header to define __stub macros and hopefully few prototypes,
3935     which can conflict with char $ac_func(); below.  */
3936 #include <assert.h>
3937 /* Override any gcc2 internal prototype to avoid an error.  */
3938 /* We use char because int might match the return type of a gcc2
3939     builtin and then its argument prototype would still apply.  */
3940 char $ac_func();
3941
3942 int main() {
3943
3944 /* The GNU C library defines this for functions which it implements
3945     to always fail with ENOSYS.  Some functions are actually named
3946     something starting with __ and the normal name is an alias.  */
3947 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3948 choke me
3949 #else
3950 $ac_func();
3951 #endif
3952
3953 ; return 0; }
3954 EOF
3955 if { (eval echo configure:3956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3956   rm -rf conftest*
3957   eval "ac_cv_func_$ac_func=yes"
3958 else
3959   echo "configure: failed program was:" >&5
3960   cat conftest.$ac_ext >&5
3961   rm -rf conftest*
3962   eval "ac_cv_func_$ac_func=no"
3963 fi
3964 rm -f conftest*
3965 fi
3966
3967 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3968   echo "$ac_t""yes" 1>&6
3969     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3970   cat >> confdefs.h <<EOF
3971 #define $ac_tr_func 1
3972 EOF
3973  
3974 else
3975   echo "$ac_t""no" 1>&6
3976 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
3977 fi
3978 done
3979
3980
3981
3982 echo $ac_n "checking for getopt""... $ac_c" 1>&6
3983 echo "configure:3984: checking for getopt" >&5
3984 if eval "test \"`echo '$''{'ac_cv_func_getopt'+set}'`\" = set"; then
3985   echo $ac_n "(cached) $ac_c" 1>&6
3986 else
3987   cat > conftest.$ac_ext <<EOF
3988 #line 3989 "configure"
3989 #include "confdefs.h"
3990 /* System header to define __stub macros and hopefully few prototypes,
3991     which can conflict with char getopt(); below.  */
3992 #include <assert.h>
3993 /* Override any gcc2 internal prototype to avoid an error.  */
3994 /* We use char because int might match the return type of a gcc2
3995     builtin and then its argument prototype would still apply.  */
3996 char getopt();
3997
3998 int main() {
3999
4000 /* The GNU C library defines this for functions which it implements
4001     to always fail with ENOSYS.  Some functions are actually named
4002     something starting with __ and the normal name is an alias.  */
4003 #if defined (__stub_getopt) || defined (__stub___getopt)
4004 choke me
4005 #else
4006 getopt();
4007 #endif
4008
4009 ; return 0; }
4010 EOF
4011 if { (eval echo configure:4012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4012   rm -rf conftest*
4013   eval "ac_cv_func_getopt=yes"
4014 else
4015   echo "configure: failed program was:" >&5
4016   cat conftest.$ac_ext >&5
4017   rm -rf conftest*
4018   eval "ac_cv_func_getopt=no"
4019 fi
4020 rm -f conftest*
4021 fi
4022
4023 if eval "test \"`echo '$ac_cv_func_'getopt`\" = yes"; then
4024   echo "$ac_t""yes" 1>&6
4025   :
4026 else
4027   echo "$ac_t""no" 1>&6
4028 fi
4029
4030 if test $ac_cv_func_getopt = yes; then
4031         for ac_hdr in getopt.h
4032 do
4033 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4034 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4035 echo "configure:4036: checking for $ac_hdr" >&5
4036 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4037   echo $ac_n "(cached) $ac_c" 1>&6
4038 else
4039   cat > conftest.$ac_ext <<EOF
4040 #line 4041 "configure"
4041 #include "confdefs.h"
4042 #include <$ac_hdr>
4043 EOF
4044 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4045 { (eval echo configure:4046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4046 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4047 if test -z "$ac_err"; then
4048   rm -rf conftest*
4049   eval "ac_cv_header_$ac_safe=yes"
4050 else
4051   echo "$ac_err" >&5
4052   echo "configure: failed program was:" >&5
4053   cat conftest.$ac_ext >&5
4054   rm -rf conftest*
4055   eval "ac_cv_header_$ac_safe=no"
4056 fi
4057 rm -f conftest*
4058 fi
4059 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4060   echo "$ac_t""yes" 1>&6
4061     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4062   cat >> confdefs.h <<EOF
4063 #define $ac_tr_hdr 1
4064 EOF
4065  
4066 else
4067   echo "$ac_t""no" 1>&6
4068 fi
4069 done
4070
4071 fi
4072
4073 mutt_cv_snprintf=no
4074 SNPRINTFOBJS=""
4075 for ac_func in snprintf
4076 do
4077 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4078 echo "configure:4079: checking for $ac_func" >&5
4079 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4080   echo $ac_n "(cached) $ac_c" 1>&6
4081 else
4082   cat > conftest.$ac_ext <<EOF
4083 #line 4084 "configure"
4084 #include "confdefs.h"
4085 /* System header to define __stub macros and hopefully few prototypes,
4086     which can conflict with char $ac_func(); below.  */
4087 #include <assert.h>
4088 /* Override any gcc2 internal prototype to avoid an error.  */
4089 /* We use char because int might match the return type of a gcc2
4090     builtin and then its argument prototype would still apply.  */
4091 char $ac_func();
4092
4093 int main() {
4094
4095 /* The GNU C library defines this for functions which it implements
4096     to always fail with ENOSYS.  Some functions are actually named
4097     something starting with __ and the normal name is an alias.  */
4098 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4099 choke me
4100 #else
4101 $ac_func();
4102 #endif
4103
4104 ; return 0; }
4105 EOF
4106 if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4107   rm -rf conftest*
4108   eval "ac_cv_func_$ac_func=yes"
4109 else
4110   echo "configure: failed program was:" >&5
4111   cat conftest.$ac_ext >&5
4112   rm -rf conftest*
4113   eval "ac_cv_func_$ac_func=no"
4114 fi
4115 rm -f conftest*
4116 fi
4117
4118 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4119   echo "$ac_t""yes" 1>&6
4120     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4121   cat >> confdefs.h <<EOF
4122 #define $ac_tr_func 1
4123 EOF
4124  
4125 else
4126   echo "$ac_t""no" 1>&6
4127 mutt_cv_snprintf=yes
4128 fi
4129 done
4130
4131 for ac_func in vsnprintf
4132 do
4133 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4134 echo "configure:4135: checking for $ac_func" >&5
4135 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4136   echo $ac_n "(cached) $ac_c" 1>&6
4137 else
4138   cat > conftest.$ac_ext <<EOF
4139 #line 4140 "configure"
4140 #include "confdefs.h"
4141 /* System header to define __stub macros and hopefully few prototypes,
4142     which can conflict with char $ac_func(); below.  */
4143 #include <assert.h>
4144 /* Override any gcc2 internal prototype to avoid an error.  */
4145 /* We use char because int might match the return type of a gcc2
4146     builtin and then its argument prototype would still apply.  */
4147 char $ac_func();
4148
4149 int main() {
4150
4151 /* The GNU C library defines this for functions which it implements
4152     to always fail with ENOSYS.  Some functions are actually named
4153     something starting with __ and the normal name is an alias.  */
4154 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4155 choke me
4156 #else
4157 $ac_func();
4158 #endif
4159
4160 ; return 0; }
4161 EOF
4162 if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4163   rm -rf conftest*
4164   eval "ac_cv_func_$ac_func=yes"
4165 else
4166   echo "configure: failed program was:" >&5
4167   cat conftest.$ac_ext >&5
4168   rm -rf conftest*
4169   eval "ac_cv_func_$ac_func=no"
4170 fi
4171 rm -f conftest*
4172 fi
4173
4174 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4175   echo "$ac_t""yes" 1>&6
4176     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4177   cat >> confdefs.h <<EOF
4178 #define $ac_tr_func 1
4179 EOF
4180  
4181 else
4182   echo "$ac_t""no" 1>&6
4183 mutt_cv_snprintf=yes
4184 fi
4185 done
4186
4187 if test $mutt_cv_snprintf = yes; then
4188         LIBOBJS="$LIBOBJS snprintf.o"
4189 fi
4190
4191 for ac_func in ftruncate
4192 do
4193 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4194 echo "configure:4195: checking for $ac_func" >&5
4195 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4196   echo $ac_n "(cached) $ac_c" 1>&6
4197 else
4198   cat > conftest.$ac_ext <<EOF
4199 #line 4200 "configure"
4200 #include "confdefs.h"
4201 /* System header to define __stub macros and hopefully few prototypes,
4202     which can conflict with char $ac_func(); below.  */
4203 #include <assert.h>
4204 /* Override any gcc2 internal prototype to avoid an error.  */
4205 /* We use char because int might match the return type of a gcc2
4206     builtin and then its argument prototype would still apply.  */
4207 char $ac_func();
4208
4209 int main() {
4210
4211 /* The GNU C library defines this for functions which it implements
4212     to always fail with ENOSYS.  Some functions are actually named
4213     something starting with __ and the normal name is an alias.  */
4214 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4215 choke me
4216 #else
4217 $ac_func();
4218 #endif
4219
4220 ; return 0; }
4221 EOF
4222 if { (eval echo configure:4223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4223   rm -rf conftest*
4224   eval "ac_cv_func_$ac_func=yes"
4225 else
4226   echo "configure: failed program was:" >&5
4227   cat conftest.$ac_ext >&5
4228   rm -rf conftest*
4229   eval "ac_cv_func_$ac_func=no"
4230 fi
4231 rm -f conftest*
4232 fi
4233
4234 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4235   echo "$ac_t""yes" 1>&6
4236     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4237   cat >> confdefs.h <<EOF
4238 #define $ac_tr_func 1
4239 EOF
4240  
4241 else
4242   echo "$ac_t""no" 1>&6
4243 echo $ac_n "checking for chsize in -lx""... $ac_c" 1>&6
4244 echo "configure:4245: checking for chsize in -lx" >&5
4245 ac_lib_var=`echo x'_'chsize | sed 'y%./+-%__p_%'`
4246 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4247   echo $ac_n "(cached) $ac_c" 1>&6
4248 else
4249   ac_save_LIBS="$LIBS"
4250 LIBS="-lx  $LIBS"
4251 cat > conftest.$ac_ext <<EOF
4252 #line 4253 "configure"
4253 #include "confdefs.h"
4254 /* Override any gcc2 internal prototype to avoid an error.  */
4255 /* We use char because int might match the return type of a gcc2
4256     builtin and then its argument prototype would still apply.  */
4257 char chsize();
4258
4259 int main() {
4260 chsize()
4261 ; return 0; }
4262 EOF
4263 if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4264   rm -rf conftest*
4265   eval "ac_cv_lib_$ac_lib_var=yes"
4266 else
4267   echo "configure: failed program was:" >&5
4268   cat conftest.$ac_ext >&5
4269   rm -rf conftest*
4270   eval "ac_cv_lib_$ac_lib_var=no"
4271 fi
4272 rm -f conftest*
4273 LIBS="$ac_save_LIBS"
4274
4275 fi
4276 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4277   echo "$ac_t""yes" 1>&6
4278     ac_tr_lib=HAVE_LIB`echo x | sed -e 's/^a-zA-Z0-9_/_/g' \
4279     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4280   cat >> confdefs.h <<EOF
4281 #define $ac_tr_lib 1
4282 EOF
4283
4284   LIBS="-lx $LIBS"
4285
4286 else
4287   echo "$ac_t""no" 1>&6
4288 fi
4289
4290 fi
4291 done
4292
4293
4294 for ac_func in strftime
4295 do
4296 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4297 echo "configure:4298: checking for $ac_func" >&5
4298 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4299   echo $ac_n "(cached) $ac_c" 1>&6
4300 else
4301   cat > conftest.$ac_ext <<EOF
4302 #line 4303 "configure"
4303 #include "confdefs.h"
4304 /* System header to define __stub macros and hopefully few prototypes,
4305     which can conflict with char $ac_func(); below.  */
4306 #include <assert.h>
4307 /* Override any gcc2 internal prototype to avoid an error.  */
4308 /* We use char because int might match the return type of a gcc2
4309     builtin and then its argument prototype would still apply.  */
4310 char $ac_func();
4311
4312 int main() {
4313
4314 /* The GNU C library defines this for functions which it implements
4315     to always fail with ENOSYS.  Some functions are actually named
4316     something starting with __ and the normal name is an alias.  */
4317 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4318 choke me
4319 #else
4320 $ac_func();
4321 #endif
4322
4323 ; return 0; }
4324 EOF
4325 if { (eval echo configure:4326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4326   rm -rf conftest*
4327   eval "ac_cv_func_$ac_func=yes"
4328 else
4329   echo "configure: failed program was:" >&5
4330   cat conftest.$ac_ext >&5
4331   rm -rf conftest*
4332   eval "ac_cv_func_$ac_func=no"
4333 fi
4334 rm -f conftest*
4335 fi
4336
4337 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4338   echo "$ac_t""yes" 1>&6
4339     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4340   cat >> confdefs.h <<EOF
4341 #define $ac_tr_func 1
4342 EOF
4343  
4344 else
4345   echo "$ac_t""no" 1>&6
4346 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
4347 echo "configure:4348: checking for strftime in -lintl" >&5
4348 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
4349 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4350   echo $ac_n "(cached) $ac_c" 1>&6
4351 else
4352   ac_save_LIBS="$LIBS"
4353 LIBS="-lintl  $LIBS"
4354 cat > conftest.$ac_ext <<EOF
4355 #line 4356 "configure"
4356 #include "confdefs.h"
4357 /* Override any gcc2 internal prototype to avoid an error.  */
4358 /* We use char because int might match the return type of a gcc2
4359     builtin and then its argument prototype would still apply.  */
4360 char strftime();
4361
4362 int main() {
4363 strftime()
4364 ; return 0; }
4365 EOF
4366 if { (eval echo configure:4367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4367   rm -rf conftest*
4368   eval "ac_cv_lib_$ac_lib_var=yes"
4369 else
4370   echo "configure: failed program was:" >&5
4371   cat conftest.$ac_ext >&5
4372   rm -rf conftest*
4373   eval "ac_cv_lib_$ac_lib_var=no"
4374 fi
4375 rm -f conftest*
4376 LIBS="$ac_save_LIBS"
4377
4378 fi
4379 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4380   echo "$ac_t""yes" 1>&6
4381     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/^a-zA-Z0-9_/_/g' \
4382     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4383   cat >> confdefs.h <<EOF
4384 #define $ac_tr_lib 1
4385 EOF
4386
4387   LIBS="-lintl $LIBS"
4388
4389 else
4390   echo "$ac_t""no" 1>&6
4391 fi
4392
4393 fi
4394 done
4395
4396
4397 for ac_func in fchdir
4398 do
4399 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4400 echo "configure:4401: checking for $ac_func" >&5
4401 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4402   echo $ac_n "(cached) $ac_c" 1>&6
4403 else
4404   cat > conftest.$ac_ext <<EOF
4405 #line 4406 "configure"
4406 #include "confdefs.h"
4407 /* System header to define __stub macros and hopefully few prototypes,
4408     which can conflict with char $ac_func(); below.  */
4409 #include <assert.h>
4410 /* Override any gcc2 internal prototype to avoid an error.  */
4411 /* We use char because int might match the return type of a gcc2
4412     builtin and then its argument prototype would still apply.  */
4413 char $ac_func();
4414
4415 int main() {
4416
4417 /* The GNU C library defines this for functions which it implements
4418     to always fail with ENOSYS.  Some functions are actually named
4419     something starting with __ and the normal name is an alias.  */
4420 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4421 choke me
4422 #else
4423 $ac_func();
4424 #endif
4425
4426 ; return 0; }
4427 EOF
4428 if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4429   rm -rf conftest*
4430   eval "ac_cv_func_$ac_func=yes"
4431 else
4432   echo "configure: failed program was:" >&5
4433   cat conftest.$ac_ext >&5
4434   rm -rf conftest*
4435   eval "ac_cv_func_$ac_func=no"
4436 fi
4437 rm -f conftest*
4438 fi
4439
4440 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4441   echo "$ac_t""yes" 1>&6
4442     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4443   cat >> confdefs.h <<EOF
4444 #define $ac_tr_func 1
4445 EOF
4446  
4447 else
4448   echo "$ac_t""no" 1>&6
4449 mutt_cv_fchdir=no
4450 fi
4451 done
4452
4453
4454 # Check whether --with-regex or --without-regex was given.
4455 if test "${with_regex+set}" = set; then
4456   withval="$with_regex"
4457   mutt_cv_regex=yes
4458 else
4459   for ac_func in regcomp
4460 do
4461 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4462 echo "configure:4463: checking for $ac_func" >&5
4463 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4464   echo $ac_n "(cached) $ac_c" 1>&6
4465 else
4466   cat > conftest.$ac_ext <<EOF
4467 #line 4468 "configure"
4468 #include "confdefs.h"
4469 /* System header to define __stub macros and hopefully few prototypes,
4470     which can conflict with char $ac_func(); below.  */
4471 #include <assert.h>
4472 /* Override any gcc2 internal prototype to avoid an error.  */
4473 /* We use char because int might match the return type of a gcc2
4474     builtin and then its argument prototype would still apply.  */
4475 char $ac_func();
4476
4477 int main() {
4478
4479 /* The GNU C library defines this for functions which it implements
4480     to always fail with ENOSYS.  Some functions are actually named
4481     something starting with __ and the normal name is an alias.  */
4482 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4483 choke me
4484 #else
4485 $ac_func();
4486 #endif
4487
4488 ; return 0; }
4489 EOF
4490 if { (eval echo configure:4491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4491   rm -rf conftest*
4492   eval "ac_cv_func_$ac_func=yes"
4493 else
4494   echo "configure: failed program was:" >&5
4495   cat conftest.$ac_ext >&5
4496   rm -rf conftest*
4497   eval "ac_cv_func_$ac_func=no"
4498 fi
4499 rm -f conftest*
4500 fi
4501
4502 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4503   echo "$ac_t""yes" 1>&6
4504     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4505   cat >> confdefs.h <<EOF
4506 #define $ac_tr_func 1
4507 EOF
4508  mutt_cv_regex=no
4509 else
4510   echo "$ac_t""no" 1>&6
4511 mutt_cv_regex=yes
4512 fi
4513 done
4514
4515 fi
4516
4517
4518 if test $mutt_cv_regex = no ; then
4519 echo $ac_n "checking whether your system's regexp library is completely broken""... $ac_c" 1>&6
4520 echo "configure:4521: checking whether your system's regexp library is completely broken" >&5
4521 if eval "test \"`echo '$''{'mutt_cv_regex_broken'+set}'`\" = set"; then
4522   echo $ac_n "(cached) $ac_c" 1>&6
4523 else
4524   if test "$cross_compiling" = yes; then
4525   mutt_cv_regex_broken=yes
4526 else
4527   cat > conftest.$ac_ext <<EOF
4528 #line 4529 "configure"
4529 #include "confdefs.h"
4530
4531 #include <unistd.h>
4532 #include <regex.h>
4533 main() { regex_t blah ; regmatch_t p; p.rm_eo = p.rm_eo; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); }
4534 EOF
4535 if { (eval echo configure:4536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4536 then
4537   mutt_cv_regex_broken=no
4538 else
4539   echo "configure: failed program was:" >&5
4540   cat conftest.$ac_ext >&5
4541   rm -fr conftest*
4542   mutt_cv_regex_broken=yes
4543 fi
4544 rm -fr conftest*
4545 fi
4546
4547 fi
4548
4549 echo "$ac_t""$mutt_cv_regex_broken" 1>&6
4550         if test $mutt_cv_regex_broken = yes ; then
4551                 echo "Using the included GNU regex instead." >&6
4552                 mutt_cv_regex=yes
4553         fi
4554 fi
4555
4556 if test $mutt_cv_regex = yes; then
4557         cat >> confdefs.h <<\EOF
4558 #define USE_GNU_REGEX 1
4559 EOF
4560
4561         LIBOBJS="$LIBOBJS regex.o"
4562 fi
4563
4564
4565 # Check whether --with-homespool or --without-homespool was given.
4566 if test "${with_homespool+set}" = set; then
4567   withval="$with_homespool"
4568   with_homespool=${withval}
4569 fi
4570
4571 if test x$with_homespool != x; then
4572         if test $with_homespool = yes; then
4573                 with_homespool=mailbox
4574         fi
4575         cat >> confdefs.h <<EOF
4576 #define MAILPATH "$with_homespool"
4577 EOF
4578
4579         cat >> confdefs.h <<\EOF
4580 #define HOMESPOOL 1
4581 EOF
4582
4583         cat >> confdefs.h <<\EOF
4584 #define USE_DOTLOCK 1
4585 EOF
4586
4587         mutt_cv_setgid=no
4588 else
4589         # Check whether --with-mailpath or --without-mailpath was given.
4590 if test "${with_mailpath+set}" = set; then
4591   withval="$with_mailpath"
4592   mutt_cv_mailpath=$withval
4593 else
4594    echo $ac_n "checking where new mail is stored""... $ac_c" 1>&6
4595 echo "configure:4596: checking where new mail is stored" >&5
4596 if eval "test \"`echo '$''{'mutt_cv_mailpath'+set}'`\" = set"; then
4597   echo $ac_n "(cached) $ac_c" 1>&6
4598 else
4599   mutt_cv_mailpath=no
4600                         if test -d /var/mail; then
4601                                 mutt_cv_mailpath=/var/mail
4602                         elif test -d /var/spool/mail; then
4603                                 mutt_cv_mailpath=/var/spool/mail
4604                         elif test -d /usr/spool/mail; then
4605                                 mutt_cv_mailpath=/usr/spool/mail
4606                         elif test -d /usr/mail; then
4607                                 mutt_cv_mailpath=/usr/mail
4608                         fi
4609 fi
4610
4611 echo "$ac_t""$mutt_cv_mailpath" 1>&6
4612                 
4613 fi
4614
4615         if test "$mutt_cv_mailpath" = no; then
4616                 { echo "configure: error: "Could not determine where new mail is stored."" 1>&2; exit 1; }
4617         fi
4618         cat >> confdefs.h <<EOF
4619 #define MAILPATH "$mutt_cv_mailpath"
4620 EOF
4621
4622
4623         echo $ac_n "checking if $mutt_cv_mailpath is world writable""... $ac_c" 1>&6
4624 echo "configure:4625: checking if $mutt_cv_mailpath is world writable" >&5
4625 if eval "test \"`echo '$''{'mutt_cv_worldwrite'+set}'`\" = set"; then
4626   echo $ac_n "(cached) $ac_c" 1>&6
4627 else
4628   if test "$cross_compiling" = yes; then
4629   mutt_cv_worldwrite=no
4630 else
4631   cat > conftest.$ac_ext <<EOF
4632 #line 4633 "configure"
4633 #include "confdefs.h"
4634 #include <sys/types.h>
4635 #include <sys/stat.h>
4636
4637 int main (int argc, char **argv)
4638 {
4639         struct stat s;
4640
4641         stat ("$mutt_cv_mailpath", &s);
4642         if (s.st_mode & S_IWOTH) exit (0);
4643         exit (1);
4644 }
4645 EOF
4646 if { (eval echo configure:4647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4647 then
4648   mutt_cv_worldwrite=yes
4649 else
4650   echo "configure: failed program was:" >&5
4651   cat conftest.$ac_ext >&5
4652   rm -fr conftest*
4653   mutt_cv_worldwrite=no
4654 fi
4655 rm -fr conftest*
4656 fi
4657
4658 fi
4659
4660 echo "$ac_t""$mutt_cv_worldwrite" 1>&6
4661
4662         mutt_cv_setgid=no
4663         if test $mutt_cv_worldwrite = yes; then
4664                 cat >> confdefs.h <<\EOF
4665 #define USE_DOTLOCK 1
4666 EOF
4667
4668         else
4669
4670                 echo $ac_n "checking if $mutt_cv_mailpath is group writable""... $ac_c" 1>&6
4671 echo "configure:4672: checking if $mutt_cv_mailpath is group writable" >&5
4672 if eval "test \"`echo '$''{'mutt_cv_groupwrite'+set}'`\" = set"; then
4673   echo $ac_n "(cached) $ac_c" 1>&6
4674 else
4675   if test "$cross_compiling" = yes; then
4676   mutt_cv_groupwrite=no
4677 else
4678   cat > conftest.$ac_ext <<EOF
4679 #line 4680 "configure"
4680 #include "confdefs.h"
4681 #include <sys/types.h>
4682 #include <sys/stat.h>
4683
4684 int main (int argc, char **argv)
4685 {
4686         struct stat s;
4687
4688         stat ("$mutt_cv_mailpath", &s);
4689         if (s.st_mode & S_IWGRP) exit (0);
4690         exit (1);
4691 }
4692 EOF
4693 if { (eval echo configure:4694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4694 then
4695   mutt_cv_groupwrite=yes
4696 else
4697   echo "configure: failed program was:" >&5
4698   cat conftest.$ac_ext >&5
4699   rm -fr conftest*
4700   mutt_cv_groupwrite=no
4701 fi
4702 rm -fr conftest*
4703 fi
4704
4705 fi
4706
4707 echo "$ac_t""$mutt_cv_groupwrite" 1>&6
4708
4709                 if test $mutt_cv_groupwrite = yes; then
4710                         cat >> confdefs.h <<\EOF
4711 #define USE_DOTLOCK 1
4712 EOF
4713
4714                         cat >> confdefs.h <<\EOF
4715 #define USE_SETGID 1
4716 EOF
4717
4718                         mutt_cv_setgid=yes
4719                 fi
4720         fi
4721 fi
4722
4723 # Check whether --enable-external_dotlock or --disable-external_dotlock was given.
4724 if test "${enable_external_dotlock+set}" = set; then
4725   enableval="$enable_external_dotlock"
4726   mutt_cv_external_dotlock="$enableval"
4727 fi
4728
4729
4730 if test "x$mutt_cv_setgid" = "xyes" || test "x$mutt_cv_fchdir" = "xno" \
4731         || test "x$mutt_cv_external_dotlock" = "xyes"
4732 then
4733         cat >> confdefs.h <<\EOF
4734 #define DL_STANDALONE 1
4735 EOF
4736
4737         DOTLOCK_TARGET="muttng_dotlock"
4738 else
4739         MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS dotlock.o"
4740 fi
4741
4742
4743
4744
4745 echo $ac_n "checking where to put the documentation""... $ac_c" 1>&6
4746 echo "configure:4747: checking where to put the documentation" >&5
4747 # Check whether --with-docdir or --without-docdir was given.
4748 if test "${with_docdir+set}" = set; then
4749   withval="$with_docdir"
4750   mutt_cv_docdir=$withval
4751 else
4752   mutt_cv_docdir="$mutt_cv_prefix/doc/muttng"
4753 fi
4754
4755 echo "$ac_t""$mutt_cv_docdir" 1>&6
4756
4757 docdir=$mutt_cv_docdir
4758
4759
4760 if test x$mutt_cv_setgid = xyes; then
4761         DOTLOCK_GROUP='mail'
4762         DOTLOCK_PERMISSION=2755
4763 else
4764         DOTLOCK_GROUP=''
4765         DOTLOCK_PERMISSION=755
4766 fi
4767
4768
4769
4770 # Check whether --with-domain or --without-domain was given.
4771 if test "${with_domain+set}" = set; then
4772   withval="$with_domain"
4773   if test $withval != yes; then
4774                 cat >> confdefs.h <<EOF
4775 #define DOMAIN "$withval"
4776 EOF
4777
4778         fi
4779 fi
4780
4781
4782 need_socket="no"
4783
4784
4785 # Check whether --enable-pop or --disable-pop was given.
4786 if test "${enable_pop+set}" = set; then
4787   enableval="$enable_pop"
4788          if test x$enableval = xyes ; then
4789                 cat >> confdefs.h <<\EOF
4790 #define USE_POP 1
4791 EOF
4792
4793                 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pop.o pop_lib.o pop_auth.o"
4794                 need_socket="yes"
4795                 need_pop="yes"
4796                 need_md5="yes"
4797         fi
4798
4799 fi
4800
4801
4802 # Check whether --enable-imap or --disable-imap was given.
4803 if test "${enable_imap+set}" = set; then
4804   enableval="$enable_imap"
4805          if test x$enableval = xyes ; then
4806                 cat >> confdefs.h <<\EOF
4807 #define USE_IMAP 1
4808 EOF
4809
4810                 LIBIMAP="-Limap -limap"
4811                 LIBIMAPDEPS="\$(top_srcdir)/imap/imap.h imap/libimap.a"
4812                 need_imap="yes"
4813                 need_socket="yes"
4814                 need_md5="yes"
4815         fi
4816
4817 fi
4818
4819
4820
4821 if test x$need_imap = xyes; then
4822   BUILD_IMAP_TRUE=
4823   BUILD_IMAP_FALSE='#'
4824 else
4825   BUILD_IMAP_TRUE='#'
4826   BUILD_IMAP_FALSE=
4827 fi
4828
4829 # Check whether --enable-nntp or --disable-nntp was given.
4830 if test "${enable_nntp+set}" = set; then
4831   enableval="$enable_nntp"
4832         if test x$enableval = xyes ; then
4833                 cat >> confdefs.h <<\EOF
4834 #define USE_NNTP 1
4835 EOF
4836
4837                 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS nntp.o newsrc.o"
4838                 need_socket="yes"
4839         fi
4840
4841 fi
4842
4843
4844
4845 if test "$need_socket" = "yes"
4846 then
4847         echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
4848 echo "configure:4849: checking for socklen_t" >&5
4849         cat > conftest.$ac_ext <<EOF
4850 #line 4851 "configure"
4851 #include "confdefs.h"
4852 #include <sys/socket.h>
4853 EOF
4854 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4855   egrep "socklen_t" >/dev/null 2>&1; then
4856   rm -rf conftest*
4857   echo "$ac_t""yes" 1>&6
4858 else
4859   rm -rf conftest*
4860   echo "$ac_t""no" 1>&6
4861                 cat >> confdefs.h <<\EOF
4862 #define socklen_t int
4863 EOF
4864
4865 fi
4866 rm -f conftest*
4867
4868         echo $ac_n "checking for gethostent""... $ac_c" 1>&6
4869 echo "configure:4870: checking for gethostent" >&5
4870 if eval "test \"`echo '$''{'ac_cv_func_gethostent'+set}'`\" = set"; then
4871   echo $ac_n "(cached) $ac_c" 1>&6
4872 else
4873   cat > conftest.$ac_ext <<EOF
4874 #line 4875 "configure"
4875 #include "confdefs.h"
4876 /* System header to define __stub macros and hopefully few prototypes,
4877     which can conflict with char gethostent(); below.  */
4878 #include <assert.h>
4879 /* Override any gcc2 internal prototype to avoid an error.  */
4880 /* We use char because int might match the return type of a gcc2
4881     builtin and then its argument prototype would still apply.  */
4882 char gethostent();
4883
4884 int main() {
4885
4886 /* The GNU C library defines this for functions which it implements
4887     to always fail with ENOSYS.  Some functions are actually named
4888     something starting with __ and the normal name is an alias.  */
4889 #if defined (__stub_gethostent) || defined (__stub___gethostent)
4890 choke me
4891 #else
4892 gethostent();
4893 #endif
4894
4895 ; return 0; }
4896 EOF
4897 if { (eval echo configure:4898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4898   rm -rf conftest*
4899   eval "ac_cv_func_gethostent=yes"
4900 else
4901   echo "configure: failed program was:" >&5
4902   cat conftest.$ac_ext >&5
4903   rm -rf conftest*
4904   eval "ac_cv_func_gethostent=no"
4905 fi
4906 rm -f conftest*
4907 fi
4908
4909 if eval "test \"`echo '$ac_cv_func_'gethostent`\" = yes"; then
4910   echo "$ac_t""yes" 1>&6
4911   :
4912 else
4913   echo "$ac_t""no" 1>&6
4914 echo $ac_n "checking for gethostent in -lnsl""... $ac_c" 1>&6
4915 echo "configure:4916: checking for gethostent in -lnsl" >&5
4916 ac_lib_var=`echo nsl'_'gethostent | sed 'y%./+-%__p_%'`
4917 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4918   echo $ac_n "(cached) $ac_c" 1>&6
4919 else
4920   ac_save_LIBS="$LIBS"
4921 LIBS="-lnsl  $LIBS"
4922 cat > conftest.$ac_ext <<EOF
4923 #line 4924 "configure"
4924 #include "confdefs.h"
4925 /* Override any gcc2 internal prototype to avoid an error.  */
4926 /* We use char because int might match the return type of a gcc2
4927     builtin and then its argument prototype would still apply.  */
4928 char gethostent();
4929
4930 int main() {
4931 gethostent()
4932 ; return 0; }
4933 EOF
4934 if { (eval echo configure:4935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4935   rm -rf conftest*
4936   eval "ac_cv_lib_$ac_lib_var=yes"
4937 else
4938   echo "configure: failed program was:" >&5
4939   cat conftest.$ac_ext >&5
4940   rm -rf conftest*
4941   eval "ac_cv_lib_$ac_lib_var=no"
4942 fi
4943 rm -f conftest*
4944 LIBS="$ac_save_LIBS"
4945
4946 fi
4947 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4948   echo "$ac_t""yes" 1>&6
4949     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/^a-zA-Z0-9_/_/g' \
4950     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4951   cat >> confdefs.h <<EOF
4952 #define $ac_tr_lib 1
4953 EOF
4954
4955   LIBS="-lnsl $LIBS"
4956
4957 else
4958   echo "$ac_t""no" 1>&6
4959 fi
4960
4961 fi
4962
4963         echo $ac_n "checking for setsockopt""... $ac_c" 1>&6
4964 echo "configure:4965: checking for setsockopt" >&5
4965 if eval "test \"`echo '$''{'ac_cv_func_setsockopt'+set}'`\" = set"; then
4966   echo $ac_n "(cached) $ac_c" 1>&6
4967 else
4968   cat > conftest.$ac_ext <<EOF
4969 #line 4970 "configure"
4970 #include "confdefs.h"
4971 /* System header to define __stub macros and hopefully few prototypes,
4972     which can conflict with char setsockopt(); below.  */
4973 #include <assert.h>
4974 /* Override any gcc2 internal prototype to avoid an error.  */
4975 /* We use char because int might match the return type of a gcc2
4976     builtin and then its argument prototype would still apply.  */
4977 char setsockopt();
4978
4979 int main() {
4980
4981 /* The GNU C library defines this for functions which it implements
4982     to always fail with ENOSYS.  Some functions are actually named
4983     something starting with __ and the normal name is an alias.  */
4984 #if defined (__stub_setsockopt) || defined (__stub___setsockopt)
4985 choke me
4986 #else
4987 setsockopt();
4988 #endif
4989
4990 ; return 0; }
4991 EOF
4992 if { (eval echo configure:4993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4993   rm -rf conftest*
4994   eval "ac_cv_func_setsockopt=yes"
4995 else
4996   echo "configure: failed program was:" >&5
4997   cat conftest.$ac_ext >&5
4998   rm -rf conftest*
4999   eval "ac_cv_func_setsockopt=no"
5000 fi
5001 rm -f conftest*
5002 fi
5003
5004 if eval "test \"`echo '$ac_cv_func_'setsockopt`\" = yes"; then
5005   echo "$ac_t""yes" 1>&6
5006   :
5007 else
5008   echo "$ac_t""no" 1>&6
5009 echo $ac_n "checking for setsockopt in -lsocket""... $ac_c" 1>&6
5010 echo "configure:5011: checking for setsockopt in -lsocket" >&5
5011 ac_lib_var=`echo socket'_'setsockopt | sed 'y%./+-%__p_%'`
5012 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5013   echo $ac_n "(cached) $ac_c" 1>&6
5014 else
5015   ac_save_LIBS="$LIBS"
5016 LIBS="-lsocket  $LIBS"
5017 cat > conftest.$ac_ext <<EOF
5018 #line 5019 "configure"
5019 #include "confdefs.h"
5020 /* Override any gcc2 internal prototype to avoid an error.  */
5021 /* We use char because int might match the return type of a gcc2
5022     builtin and then its argument prototype would still apply.  */
5023 char setsockopt();
5024
5025 int main() {
5026 setsockopt()
5027 ; return 0; }
5028 EOF
5029 if { (eval echo configure:5030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5030   rm -rf conftest*
5031   eval "ac_cv_lib_$ac_lib_var=yes"
5032 else
5033   echo "configure: failed program was:" >&5
5034   cat conftest.$ac_ext >&5
5035   rm -rf conftest*
5036   eval "ac_cv_lib_$ac_lib_var=no"
5037 fi
5038 rm -f conftest*
5039 LIBS="$ac_save_LIBS"
5040
5041 fi
5042 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5043   echo "$ac_t""yes" 1>&6
5044     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/^a-zA-Z0-9_/_/g' \
5045     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5046   cat >> confdefs.h <<EOF
5047 #define $ac_tr_lib 1
5048 EOF
5049
5050   LIBS="-lsocket $LIBS"
5051
5052 else
5053   echo "$ac_t""no" 1>&6
5054 fi
5055
5056 fi
5057
5058         for ac_func in getaddrinfo
5059 do
5060 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5061 echo "configure:5062: checking for $ac_func" >&5
5062 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5063   echo $ac_n "(cached) $ac_c" 1>&6
5064 else
5065   cat > conftest.$ac_ext <<EOF
5066 #line 5067 "configure"
5067 #include "confdefs.h"
5068 /* System header to define __stub macros and hopefully few prototypes,
5069     which can conflict with char $ac_func(); below.  */
5070 #include <assert.h>
5071 /* Override any gcc2 internal prototype to avoid an error.  */
5072 /* We use char because int might match the return type of a gcc2
5073     builtin and then its argument prototype would still apply.  */
5074 char $ac_func();
5075
5076 int main() {
5077
5078 /* The GNU C library defines this for functions which it implements
5079     to always fail with ENOSYS.  Some functions are actually named
5080     something starting with __ and the normal name is an alias.  */
5081 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5082 choke me
5083 #else
5084 $ac_func();
5085 #endif
5086
5087 ; return 0; }
5088 EOF
5089 if { (eval echo configure:5090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5090   rm -rf conftest*
5091   eval "ac_cv_func_$ac_func=yes"
5092 else
5093   echo "configure: failed program was:" >&5
5094   cat conftest.$ac_ext >&5
5095   rm -rf conftest*
5096   eval "ac_cv_func_$ac_func=no"
5097 fi
5098 rm -f conftest*
5099 fi
5100
5101 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5102   echo "$ac_t""yes" 1>&6
5103     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5104   cat >> confdefs.h <<EOF
5105 #define $ac_tr_func 1
5106 EOF
5107  
5108 else
5109   echo "$ac_t""no" 1>&6
5110 fi
5111 done
5112
5113         cat >> confdefs.h <<\EOF
5114 #define USE_SOCKET 1
5115 EOF
5116
5117         MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS account.o mutt_socket.o mutt_tunnel.o"
5118 fi
5119
5120
5121 # Check whether --with-gss or --without-gss was given.
5122 if test "${with_gss+set}" = set; then
5123   withval="$with_gss"
5124   gss_prefix="$withval"
5125 else
5126   gss_prefix="no"
5127 fi
5128
5129 if test "$gss_prefix" != "no"
5130 then
5131   if test "$need_imap" = "yes"
5132   then
5133     
5134   GSSAPI_PREFIX=$gss_prefix
5135   GSSAPI_IMPL="none"
5136   saved_CPPFLAGS="$CPPFLAGS"
5137   saved_LDFLAGS="$LDFLAGS"
5138   saved_LIBS="$LIBS"
5139     if test "$GSSAPI_PREFIX" != "yes"
5140   then
5141     krb5_path="$GSSAPI_PREFIX/bin"
5142   else
5143     krb5_path="$PATH"
5144   fi
5145   # Extract the first word of "krb5-config", so it can be a program name with args.
5146 set dummy krb5-config; ac_word=$2
5147 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5148 echo "configure:5149: checking for $ac_word" >&5
5149 if eval "test \"`echo '$''{'ac_cv_path_KRB5CFGPATH'+set}'`\" = set"; then
5150   echo $ac_n "(cached) $ac_c" 1>&6
5151 else
5152   case "$KRB5CFGPATH" in
5153   /*)
5154   ac_cv_path_KRB5CFGPATH="$KRB5CFGPATH" # Let the user override the test with a path.
5155   ;;
5156   ?:/*)                  
5157   ac_cv_path_KRB5CFGPATH="$KRB5CFGPATH" # Let the user override the test with a dos path.
5158   ;;
5159   *)
5160   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5161   ac_dummy="$krb5_path"
5162   for ac_dir in $ac_dummy; do 
5163     test -z "$ac_dir" && ac_dir=.
5164     if test -f $ac_dir/$ac_word; then
5165       ac_cv_path_KRB5CFGPATH="$ac_dir/$ac_word"
5166       break
5167     fi
5168   done
5169   IFS="$ac_save_ifs"
5170   test -z "$ac_cv_path_KRB5CFGPATH" && ac_cv_path_KRB5CFGPATH="none"
5171   ;;
5172 esac
5173 fi
5174 KRB5CFGPATH="$ac_cv_path_KRB5CFGPATH"
5175 if test -n "$KRB5CFGPATH"; then
5176   echo "$ac_t""$KRB5CFGPATH" 1>&6
5177 else
5178   echo "$ac_t""no" 1>&6
5179 fi
5180
5181   if test "$KRB5CFGPATH" != "none"
5182   then
5183     GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`"
5184     GSSAPI_LIBS="$MUTTLIBS `$KRB5CFGPATH --libs gssapi`"
5185     case "`$KRB5CFGPATH --version`" in
5186       "Kerberos 5 "*)   GSSAPI_IMPL="MIT";;
5187       ?eimdal*)         GSSAPI_IMPL="Heimdal";;
5188       *)                GSSAPI_IMPL="Unknown";;
5189    esac
5190   else
5191         if test "$GSSAPI_PREFIX" != "yes"
5192     then
5193       GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include"
5194       GSSAPI_LDFLAGS="-L$GSSAPI_PREFIX/lib"
5195       CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
5196       LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS"
5197     fi
5198
5199         echo $ac_n "checking for gss_init_sec_context in -lgssapi_krb5""... $ac_c" 1>&6
5200 echo "configure:5201: checking for gss_init_sec_context in -lgssapi_krb5" >&5
5201 ac_lib_var=`echo gssapi_krb5'_'gss_init_sec_context | sed 'y%./+-%__p_%'`
5202 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5203   echo $ac_n "(cached) $ac_c" 1>&6
5204 else
5205   ac_save_LIBS="$LIBS"
5206 LIBS="-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err $LIBS"
5207 cat > conftest.$ac_ext <<EOF
5208 #line 5209 "configure"
5209 #include "confdefs.h"
5210 /* Override any gcc2 internal prototype to avoid an error.  */
5211 /* We use char because int might match the return type of a gcc2
5212     builtin and then its argument prototype would still apply.  */
5213 char gss_init_sec_context();
5214
5215 int main() {
5216 gss_init_sec_context()
5217 ; return 0; }
5218 EOF
5219 if { (eval echo configure:5220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5220   rm -rf conftest*
5221   eval "ac_cv_lib_$ac_lib_var=yes"
5222 else
5223   echo "configure: failed program was:" >&5
5224   cat conftest.$ac_ext >&5
5225   rm -rf conftest*
5226   eval "ac_cv_lib_$ac_lib_var=no"
5227 fi
5228 rm -f conftest*
5229 LIBS="$ac_save_LIBS"
5230
5231 fi
5232 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5233   echo "$ac_t""yes" 1>&6
5234   
5235       GSSAPI_IMPL="MIT",
5236       GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
5237       
5238 else
5239   echo "$ac_t""no" 1>&6
5240 fi
5241
5242
5243         if test "$GSSAPI_IMPL" = "none"
5244     then
5245       echo $ac_n "checking for gss_init_sec_context in -lgssapi""... $ac_c" 1>&6
5246 echo "configure:5247: checking for gss_init_sec_context in -lgssapi" >&5
5247 ac_lib_var=`echo gssapi'_'gss_init_sec_context | sed 'y%./+-%__p_%'`
5248 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5249   echo $ac_n "(cached) $ac_c" 1>&6
5250 else
5251   ac_save_LIBS="$LIBS"
5252 LIBS="-lgssapi -lkrb5 -ldes -lasn1 -lroken -lcrypt -lcom_err $LIBS"
5253 cat > conftest.$ac_ext <<EOF
5254 #line 5255 "configure"
5255 #include "confdefs.h"
5256 /* Override any gcc2 internal prototype to avoid an error.  */
5257 /* We use char because int might match the return type of a gcc2
5258     builtin and then its argument prototype would still apply.  */
5259 char gss_init_sec_context();
5260
5261 int main() {
5262 gss_init_sec_context()
5263 ; return 0; }
5264 EOF
5265 if { (eval echo configure:5266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5266   rm -rf conftest*
5267   eval "ac_cv_lib_$ac_lib_var=yes"
5268 else
5269   echo "configure: failed program was:" >&5
5270   cat conftest.$ac_ext >&5
5271   rm -rf conftest*
5272   eval "ac_cv_lib_$ac_lib_var=no"
5273 fi
5274 rm -f conftest*
5275 LIBS="$ac_save_LIBS"
5276
5277 fi
5278 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5279   echo "$ac_t""yes" 1>&6
5280   
5281           GSSAPI_IMPL="Heimdal"
5282           GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi -lkrb5 -ldes -lasn1 -lroken"
5283           GSSAPI_LIBS="$GSSAPI_LIBS -lcrypt -lcom_err"
5284           
5285 else
5286   echo "$ac_t""no" 1>&6
5287 fi
5288
5289     fi
5290
5291                             if test "$GSSAPI_IMPL" = "none"
5292     then
5293       echo $ac_n "checking for g_order_init in -lgssapi_krb5""... $ac_c" 1>&6
5294 echo "configure:5295: checking for g_order_init in -lgssapi_krb5" >&5
5295 ac_lib_var=`echo gssapi_krb5'_'g_order_init | sed 'y%./+-%__p_%'`
5296 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5297   echo $ac_n "(cached) $ac_c" 1>&6
5298 else
5299   ac_save_LIBS="$LIBS"
5300 LIBS="-lgssapi_krb5 -lkrb5 -lcrypto -lcom_err $LIBS"
5301 cat > conftest.$ac_ext <<EOF
5302 #line 5303 "configure"
5303 #include "confdefs.h"
5304 /* Override any gcc2 internal prototype to avoid an error.  */
5305 /* We use char because int might match the return type of a gcc2
5306     builtin and then its argument prototype would still apply.  */
5307 char g_order_init();
5308
5309 int main() {
5310 g_order_init()
5311 ; return 0; }
5312 EOF
5313 if { (eval echo configure:5314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5314   rm -rf conftest*
5315   eval "ac_cv_lib_$ac_lib_var=yes"
5316 else
5317   echo "configure: failed program was:" >&5
5318   cat conftest.$ac_ext >&5
5319   rm -rf conftest*
5320   eval "ac_cv_lib_$ac_lib_var=no"
5321 fi
5322 rm -f conftest*
5323 LIBS="$ac_save_LIBS"
5324
5325 fi
5326 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5327   echo "$ac_t""yes" 1>&6
5328   
5329         GSSAPI_IMPL="OldMIT",
5330         GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"
5331         
5332 else
5333   echo "$ac_t""no" 1>&6
5334 fi
5335
5336     fi
5337   fi
5338
5339   CPPFLAGS="$saved_CPPFLAGS"
5340   LDFLAGS="$saved_LDFLAGS"
5341   LIBS="$saved_LIBS"
5342
5343     echo $ac_n "checking GSSAPI implementation""... $ac_c" 1>&6
5344 echo "configure:5345: checking GSSAPI implementation" >&5
5345     echo "$ac_t""$GSSAPI_IMPL" 1>&6
5346     if test "$GSSAPI_IMPL" = "none"
5347     then
5348       cat > confcache <<\EOF
5349 # This file is a shell script that caches the results of configure
5350 # tests run on this system so they can be shared between configure
5351 # scripts and configure runs.  It is not useful on other systems.
5352 # If it contains results you don't want to keep, you may remove or edit it.
5353 #
5354 # By default, configure uses ./config.cache as the cache file,
5355 # creating it if it does not exist already.  You can give configure
5356 # the --cache-file=FILE option to use a different cache file; that is
5357 # what configure does when it calls configure scripts in
5358 # subdirectories, so they share the cache.
5359 # Giving --cache-file=/dev/null disables caching, for debugging configure.
5360 # config.status only pays attention to the cache file if you give it the
5361 # --recheck option to rerun configure.
5362 #
5363 EOF
5364 # The following way of writing the cache mishandles newlines in values,
5365 # but we know of no workaround that is simple, portable, and efficient.
5366 # So, don't put newlines in cache variables' values.
5367 # Ultrix sh set writes to stderr and can't be redirected directly,
5368 # and sets the high bit in the cache file unless we assign to the vars.
5369 (set) 2>&1 |
5370   case `(ac_space=' '; set | grep ac_space) 2>&1` in
5371   *ac_space=\ *)
5372     # `set' does not quote correctly, so add quotes (double-quote substitution
5373     # turns \\\\ into \\, and sed turns \\ into \).
5374     sed -n \
5375       -e "s/'/'\\\\''/g" \
5376       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5377     ;;
5378   *)
5379     # `set' quotes correctly as required by POSIX, so do not add quotes.
5380     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5381     ;;
5382   esac >> confcache
5383 if cmp -s $cache_file confcache; then
5384   :
5385 else
5386   if test -w $cache_file; then
5387     echo "updating cache $cache_file"
5388     cat confcache > $cache_file
5389   else
5390     echo "not updating unwritable cache $cache_file"
5391   fi
5392 fi
5393 rm -f confcache
5394
5395       echo "$ac_t""GSSAPI libraries not found" 1>&6
5396     fi
5397     if test "$GSSAPI_IMPL" = "Heimdal"
5398     then
5399       cat >> confdefs.h <<\EOF
5400 #define HAVE_HEIMDAL 1
5401 EOF
5402
5403     fi
5404     CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
5405     MUTTLIBS="$MUTTLIBS $GSSAPI_LIBS"
5406     cat >> confdefs.h <<\EOF
5407 #define USE_GSS 1
5408 EOF
5409
5410     need_gss="yes"
5411   else
5412     echo "configure: warning: GSS was requested but IMAP is not enabled" 1>&2
5413   fi
5414 fi
5415
5416
5417 if test x$need_gss = xyes; then
5418   USE_GSS_TRUE=
5419   USE_GSS_FALSE='#'
5420 else
5421   USE_GSS_TRUE='#'
5422   USE_GSS_FALSE=
5423 fi
5424
5425
5426 # Check whether --with-ssl or --without-ssl was given.
5427 if test "${with_ssl+set}" = set; then
5428   withval="$with_ssl"
5429          if test "$with_ssl" != "no"
5430         then
5431           if test "$need_socket" != "yes"; then
5432            { echo "configure: error: SSL support is only useful with POP or IMAP support" 1>&2; exit 1; }
5433           fi
5434
5435           if test "$with_ssl" != "yes"
5436           then
5437            LDFLAGS="$LDFLAGS -L$withval/lib"
5438            CPPFLAGS="$CPPFLAGS -I$withval/include"
5439           fi
5440           saved_LIBS="$LIBS"
5441
5442           echo $ac_n "checking for X509_new in -lcrypto""... $ac_c" 1>&6
5443 echo "configure:5444: checking for X509_new in -lcrypto" >&5
5444 ac_lib_var=`echo crypto'_'X509_new | sed 'y%./+-%__p_%'`
5445 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5446   echo $ac_n "(cached) $ac_c" 1>&6
5447 else
5448   ac_save_LIBS="$LIBS"
5449 LIBS="-lcrypto  $LIBS"
5450 cat > conftest.$ac_ext <<EOF
5451 #line 5452 "configure"
5452 #include "confdefs.h"
5453 /* Override any gcc2 internal prototype to avoid an error.  */
5454 /* We use char because int might match the return type of a gcc2
5455     builtin and then its argument prototype would still apply.  */
5456 char X509_new();
5457
5458 int main() {
5459 X509_new()
5460 ; return 0; }
5461 EOF
5462 if { (eval echo configure:5463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5463   rm -rf conftest*
5464   eval "ac_cv_lib_$ac_lib_var=yes"
5465 else
5466   echo "configure: failed program was:" >&5
5467   cat conftest.$ac_ext >&5
5468   rm -rf conftest*
5469   eval "ac_cv_lib_$ac_lib_var=no"
5470 fi
5471 rm -f conftest*
5472 LIBS="$ac_save_LIBS"
5473
5474 fi
5475 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5476   echo "$ac_t""yes" 1>&6
5477     ac_tr_lib=HAVE_LIB`echo crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5478     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5479   cat >> confdefs.h <<EOF
5480 #define $ac_tr_lib 1
5481 EOF
5482
5483   LIBS="-lcrypto $LIBS"
5484
5485 else
5486   echo "$ac_t""no" 1>&6
5487 { echo "configure: error: Unable to find SSL library" 1>&2; exit 1; }
5488 fi
5489
5490           echo $ac_n "checking for SSL_new in -lssl""... $ac_c" 1>&6
5491 echo "configure:5492: checking for SSL_new in -lssl" >&5
5492 ac_lib_var=`echo ssl'_'SSL_new | sed 'y%./+-%__p_%'`
5493 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5494   echo $ac_n "(cached) $ac_c" 1>&6
5495 else
5496   ac_save_LIBS="$LIBS"
5497 LIBS="-lssl -lcrypto $LIBS"
5498 cat > conftest.$ac_ext <<EOF
5499 #line 5500 "configure"
5500 #include "confdefs.h"
5501 /* Override any gcc2 internal prototype to avoid an error.  */
5502 /* We use char because int might match the return type of a gcc2
5503     builtin and then its argument prototype would still apply.  */
5504 char SSL_new();
5505
5506 int main() {
5507 SSL_new()
5508 ; return 0; }
5509 EOF
5510 if { (eval echo configure:5511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5511   rm -rf conftest*
5512   eval "ac_cv_lib_$ac_lib_var=yes"
5513 else
5514   echo "configure: failed program was:" >&5
5515   cat conftest.$ac_ext >&5
5516   rm -rf conftest*
5517   eval "ac_cv_lib_$ac_lib_var=no"
5518 fi
5519 rm -f conftest*
5520 LIBS="$ac_save_LIBS"
5521
5522 fi
5523 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5524   echo "$ac_t""yes" 1>&6
5525     ac_tr_lib=HAVE_LIB`echo ssl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5526     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5527   cat >> confdefs.h <<EOF
5528 #define $ac_tr_lib 1
5529 EOF
5530
5531   LIBS="-lssl $LIBS"
5532
5533 else
5534   echo "$ac_t""no" 1>&6
5535 { echo "configure: error: Unable to find SSL library" 1>&2; exit 1; }
5536 fi
5537
5538
5539           for ac_func in RAND_status RAND_egd
5540 do
5541 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5542 echo "configure:5543: checking for $ac_func" >&5
5543 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5544   echo $ac_n "(cached) $ac_c" 1>&6
5545 else
5546   cat > conftest.$ac_ext <<EOF
5547 #line 5548 "configure"
5548 #include "confdefs.h"
5549 /* System header to define __stub macros and hopefully few prototypes,
5550     which can conflict with char $ac_func(); below.  */
5551 #include <assert.h>
5552 /* Override any gcc2 internal prototype to avoid an error.  */
5553 /* We use char because int might match the return type of a gcc2
5554     builtin and then its argument prototype would still apply.  */
5555 char $ac_func();
5556
5557 int main() {
5558
5559 /* The GNU C library defines this for functions which it implements
5560     to always fail with ENOSYS.  Some functions are actually named
5561     something starting with __ and the normal name is an alias.  */
5562 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5563 choke me
5564 #else
5565 $ac_func();
5566 #endif
5567
5568 ; return 0; }
5569 EOF
5570 if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5571   rm -rf conftest*
5572   eval "ac_cv_func_$ac_func=yes"
5573 else
5574   echo "configure: failed program was:" >&5
5575   cat conftest.$ac_ext >&5
5576   rm -rf conftest*
5577   eval "ac_cv_func_$ac_func=no"
5578 fi
5579 rm -f conftest*
5580 fi
5581
5582 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5583   echo "$ac_t""yes" 1>&6
5584     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5585   cat >> confdefs.h <<EOF
5586 #define $ac_tr_func 1
5587 EOF
5588  
5589 else
5590   echo "$ac_t""no" 1>&6
5591 fi
5592 done
5593
5594
5595           cat >> confdefs.h <<\EOF
5596 #define USE_SSL 1
5597 EOF
5598
5599           LIBS="$saved_LIBS"
5600           MUTTLIBS="$MUTTLIBS -lssl -lcrypto"
5601           MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl.o"
5602           need_ssl=yes
5603
5604         fi
5605
5606 fi
5607
5608
5609
5610 if test x$need_ssl = xyes; then
5611   USE_SSL_TRUE=
5612   USE_SSL_FALSE='#'
5613 else
5614   USE_SSL_TRUE='#'
5615   USE_SSL_FALSE=
5616 fi
5617
5618 # Check whether --with-gnutls or --without-gnutls was given.
5619 if test "${with_gnutls+set}" = set; then
5620   withval="$with_gnutls"
5621      if test "$need_ssl" = "yes"
5622     then
5623       { echo "configure: error: In order to compile in GNU TLS support, you must first disable SSL support" 1>&2; exit 1; }
5624     fi
5625     if test "$with_gnutls" != "no"
5626     then
5627       if test "$need_socket" != "yes"; then
5628         { echo "configure: error: GNU TLS support is only useful with POP or IMAP support" 1>&2; exit 1; }
5629       fi
5630       if test "$with_gnutls" != "yes"
5631       then
5632         LDFLAGS="$LDFLAGS -L$withval/lib"
5633         CPPFLAGS="$CPPFLAGS -I$withval/include"
5634       fi
5635 #saved_LIBS="$LIBS"
5636
5637       echo $ac_n "checking for gnutls_init in -lgnutls""... $ac_c" 1>&6
5638 echo "configure:5639: checking for gnutls_init in -lgnutls" >&5
5639 ac_lib_var=`echo gnutls'_'gnutls_init | sed 'y%./+-%__p_%'`
5640 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5641   echo $ac_n "(cached) $ac_c" 1>&6
5642 else
5643   ac_save_LIBS="$LIBS"
5644 LIBS="-lgnutls  $LIBS"
5645 cat > conftest.$ac_ext <<EOF
5646 #line 5647 "configure"
5647 #include "confdefs.h"
5648 /* Override any gcc2 internal prototype to avoid an error.  */
5649 /* We use char because int might match the return type of a gcc2
5650     builtin and then its argument prototype would still apply.  */
5651 char gnutls_init();
5652
5653 int main() {
5654 gnutls_init()
5655 ; return 0; }
5656 EOF
5657 if { (eval echo configure:5658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5658   rm -rf conftest*
5659   eval "ac_cv_lib_$ac_lib_var=yes"
5660 else
5661   echo "configure: failed program was:" >&5
5662   cat conftest.$ac_ext >&5
5663   rm -rf conftest*
5664   eval "ac_cv_lib_$ac_lib_var=no"
5665 fi
5666 rm -f conftest*
5667 LIBS="$ac_save_LIBS"
5668
5669 fi
5670 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5671   echo "$ac_t""yes" 1>&6
5672     ac_tr_lib=HAVE_LIB`echo gnutls | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5673     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5674   cat >> confdefs.h <<EOF
5675 #define $ac_tr_lib 1
5676 EOF
5677
5678   LIBS="-lgnutls $LIBS"
5679
5680 else
5681   echo "$ac_t""no" 1>&6
5682 { echo "configure: error: Unable to find GNU TLS library" 1>&2; exit 1; }
5683 fi
5684
5685
5686       cat >> confdefs.h <<\EOF
5687 #define USE_GNUTLS 1
5688 EOF
5689
5690 #LIBS="$saved_LIBS"
5691 #MUTTLIBS="$MUTTLIBS -lgnutls"
5692       MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl_gnutls.o"
5693       need_gnutls=yes
5694     fi
5695
5696 fi
5697
5698
5699
5700 if test x$need_gnutls = xyes; then
5701   USE_GNUTLS_TRUE=
5702   USE_GNUTLS_FALSE='#'
5703 else
5704   USE_GNUTLS_TRUE='#'
5705   USE_GNUTLS_FALSE=
5706 fi
5707
5708 # Check whether --with-nss or --without-nss was given.
5709 if test "${with_nss+set}" = set; then
5710   withval="$with_nss"
5711          if test "$with_nss" != no
5712         then
5713           if test "$need_socket" != "yes"; then
5714            { echo "configure: error: SSL support is only useful with POP or IMAP support" 1>&2; exit 1; }
5715           fi
5716
5717           if test "$with_nss" != "yes"
5718           then
5719            LDFLAGS="$LDFLAGS -L$withval/lib"
5720            CPPFLAGS="$CPPFLAGS -I$withval/include -I$withval/public/security"
5721           fi
5722
5723           cat >> confdefs.h <<\EOF
5724 #define USE_NSS 1
5725 EOF
5726
5727           MUTTLIBS="$MUTTLIBS -lssl -lnss -lcertdb -lcerthi -lcryptohi"
5728           MUTTLIBS="$MUTTLIBS -lpk11wrap -lsoftoken -lsecutil -ldbm -lplds4 -lplc4 -lfreebl"
5729           MUTTLIBS="$MUTTLIBS -lnspr4"
5730
5731           MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl_nss.o"
5732           need_ssl=yes
5733         fi
5734
5735 fi
5736
5737
5738 # Check whether --with-sasl or --without-sasl was given.
5739 if test "${with_sasl+set}" = set; then
5740   withval="$with_sasl"
5741   
5742         if test "$with_sasl" != "no" -a "$need_imap" != "yes" -a "$need_pop" != "yes"
5743         then
5744           { echo "configure: error: SASL support is only useful with POP or IMAP support" 1>&2; exit 1; }
5745         fi
5746
5747         if test "$with_sasl" != "no"
5748         then
5749           if test "$with_sasl" != "yes"
5750           then
5751             CPPFLAGS="$CPPFLAGS -I$with_sasl/include"
5752             LDFLAGS="$LDFLAGS -L$with_sasl/lib"
5753           fi
5754
5755           saved_LIBS="$LIBS"
5756
5757           echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
5758 echo "configure:5759: checking for sasl_client_init in -lsasl" >&5
5759 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-%__p_%'`
5760 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5761   echo $ac_n "(cached) $ac_c" 1>&6
5762 else
5763   ac_save_LIBS="$LIBS"
5764 LIBS="-lsasl  $LIBS"
5765 cat > conftest.$ac_ext <<EOF
5766 #line 5767 "configure"
5767 #include "confdefs.h"
5768 /* Override any gcc2 internal prototype to avoid an error.  */
5769 /* We use char because int might match the return type of a gcc2
5770     builtin and then its argument prototype would still apply.  */
5771 char sasl_client_init();
5772
5773 int main() {
5774 sasl_client_init()
5775 ; return 0; }
5776 EOF
5777 if { (eval echo configure:5778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5778   rm -rf conftest*
5779   eval "ac_cv_lib_$ac_lib_var=yes"
5780 else
5781   echo "configure: failed program was:" >&5
5782   cat conftest.$ac_ext >&5
5783   rm -rf conftest*
5784   eval "ac_cv_lib_$ac_lib_var=no"
5785 fi
5786 rm -f conftest*
5787 LIBS="$ac_save_LIBS"
5788
5789 fi
5790 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5791   echo "$ac_t""yes" 1>&6
5792     ac_tr_lib=HAVE_LIB`echo sasl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5793     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5794   cat >> confdefs.h <<EOF
5795 #define $ac_tr_lib 1
5796 EOF
5797
5798   LIBS="-lsasl $LIBS"
5799
5800 else
5801   echo "$ac_t""no" 1>&6
5802 { echo "configure: error: could not find libsasl" 1>&2; exit 1; }
5803 fi
5804
5805
5806           MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
5807           MUTTLIBS="$MUTTLIBS -lsasl"
5808           LIBS="$saved_LIBS"
5809           cat >> confdefs.h <<\EOF
5810 #define USE_SASL 1
5811 EOF
5812
5813           need_sasl=yes
5814         fi
5815         
5816 fi
5817
5818
5819
5820 if test x$need_sasl = xyes; then
5821   USE_SASL_TRUE=
5822   USE_SASL_FALSE='#'
5823 else
5824   USE_SASL_TRUE='#'
5825   USE_SASL_FALSE=
5826 fi
5827
5828 # Check whether --with-sasl2 or --without-sasl2 was given.
5829 if test "${with_sasl2+set}" = set; then
5830   withval="$with_sasl2"
5831   
5832         if test "$with_sasl2" != "no" -a "$need_imap" != "yes" -a "$need_pop" != "yes"
5833         then
5834           { echo "configure: error: SASL2 support is only useful with POP or IMAP support" 1>&2; exit 1; }
5835         fi
5836
5837         if test "$with_sasl2" != "no"
5838         then
5839           if test "$with_sasl2" != "yes"
5840           then
5841             CPPFLAGS="$CPPFLAGS -I$with_sasl2/include"
5842             LDFLAGS="$LDFLAGS -L$with_sasl2/lib"
5843           fi
5844
5845           saved_LIBS="$LIBS"
5846
5847           echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
5848 echo "configure:5849: checking for sasl_client_init in -lsasl2" >&5
5849 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-%__p_%'`
5850 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5851   echo $ac_n "(cached) $ac_c" 1>&6
5852 else
5853   ac_save_LIBS="$LIBS"
5854 LIBS="-lsasl2  $LIBS"
5855 cat > conftest.$ac_ext <<EOF
5856 #line 5857 "configure"
5857 #include "confdefs.h"
5858 /* Override any gcc2 internal prototype to avoid an error.  */
5859 /* We use char because int might match the return type of a gcc2
5860     builtin and then its argument prototype would still apply.  */
5861 char sasl_client_init();
5862
5863 int main() {
5864 sasl_client_init()
5865 ; return 0; }
5866 EOF
5867 if { (eval echo configure:5868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5868   rm -rf conftest*
5869   eval "ac_cv_lib_$ac_lib_var=yes"
5870 else
5871   echo "configure: failed program was:" >&5
5872   cat conftest.$ac_ext >&5
5873   rm -rf conftest*
5874   eval "ac_cv_lib_$ac_lib_var=no"
5875 fi
5876 rm -f conftest*
5877 LIBS="$ac_save_LIBS"
5878
5879 fi
5880 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5881   echo "$ac_t""yes" 1>&6
5882     ac_tr_lib=HAVE_LIB`echo sasl2 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5883     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5884   cat >> confdefs.h <<EOF
5885 #define $ac_tr_lib 1
5886 EOF
5887
5888   LIBS="-lsasl2 $LIBS"
5889
5890 else
5891   echo "$ac_t""no" 1>&6
5892 { echo "configure: error: could not find libsasl2" 1>&2; exit 1; }
5893 fi
5894
5895
5896           MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
5897           MUTTLIBS="$MUTTLIBS -lsasl2"
5898           LIBS="$saved_LIBS"
5899           cat >> confdefs.h <<\EOF
5900 #define USE_SASL 1
5901 EOF
5902
5903           cat >> confdefs.h <<\EOF
5904 #define USE_SASL2 1
5905 EOF
5906
5907           need_sasl=yes
5908         fi
5909         
5910 fi
5911
5912
5913
5914 if test x$need_sasl = xyes; then
5915   USE_SASL_TRUE=
5916   USE_SASL_FALSE='#'
5917 else
5918   USE_SASL_TRUE='#'
5919   USE_SASL_FALSE=
5920 fi
5921
5922 # Check whether --with-idn or --without-idn was given.
5923 if test "${with_idn+set}" = set; then
5924   withval="$with_idn"
5925   
5926                   if test "$with_idn" != "no" ; then
5927                         if test "$with_idn" != "yes" ; then
5928                            CPPFLAGS="$CPPFLAGS -I$with_idn/include"
5929                            LDFLAGS="$LDFLAGS -L$with_idn/lib"
5930                         fi
5931                   fi
5932                  
5933
5934 fi
5935
5936
5937 if test "x$with_idn" != "xno"; then
5938    echo $ac_n "checking for stringprep_check_version in -lidn""... $ac_c" 1>&6
5939 echo "configure:5940: checking for stringprep_check_version in -lidn" >&5
5940 ac_lib_var=`echo idn'_'stringprep_check_version | sed 'y%./+-%__p_%'`
5941 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5942   echo $ac_n "(cached) $ac_c" 1>&6
5943 else
5944   ac_save_LIBS="$LIBS"
5945 LIBS="-lidn  $LIBS"
5946 cat > conftest.$ac_ext <<EOF
5947 #line 5948 "configure"
5948 #include "confdefs.h"
5949 /* Override any gcc2 internal prototype to avoid an error.  */
5950 /* We use char because int might match the return type of a gcc2
5951     builtin and then its argument prototype would still apply.  */
5952 char stringprep_check_version();
5953
5954 int main() {
5955 stringprep_check_version()
5956 ; return 0; }
5957 EOF
5958 if { (eval echo configure:5959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5959   rm -rf conftest*
5960   eval "ac_cv_lib_$ac_lib_var=yes"
5961 else
5962   echo "configure: failed program was:" >&5
5963   cat conftest.$ac_ext >&5
5964   rm -rf conftest*
5965   eval "ac_cv_lib_$ac_lib_var=no"
5966 fi
5967 rm -f conftest*
5968 LIBS="$ac_save_LIBS"
5969
5970 fi
5971 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5972   echo "$ac_t""yes" 1>&6
5973     ac_tr_lib=HAVE_LIB`echo idn | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5974     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5975   cat >> confdefs.h <<EOF
5976 #define $ac_tr_lib 1
5977 EOF
5978
5979   LIBS="-lidn $LIBS"
5980
5981 else
5982   echo "$ac_t""no" 1>&6
5983 fi
5984
5985    for ac_func in idna_to_unicode_utf8_from_utf8 idna_to_unicode_8z8z
5986 do
5987 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5988 echo "configure:5989: checking for $ac_func" >&5
5989 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5990   echo $ac_n "(cached) $ac_c" 1>&6
5991 else
5992   cat > conftest.$ac_ext <<EOF
5993 #line 5994 "configure"
5994 #include "confdefs.h"
5995 /* System header to define __stub macros and hopefully few prototypes,
5996     which can conflict with char $ac_func(); below.  */
5997 #include <assert.h>
5998 /* Override any gcc2 internal prototype to avoid an error.  */
5999 /* We use char because int might match the return type of a gcc2
6000     builtin and then its argument prototype would still apply.  */
6001 char $ac_func();
6002
6003 int main() {
6004
6005 /* The GNU C library defines this for functions which it implements
6006     to always fail with ENOSYS.  Some functions are actually named
6007     something starting with __ and the normal name is an alias.  */
6008 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6009 choke me
6010 #else
6011 $ac_func();
6012 #endif
6013
6014 ; return 0; }
6015 EOF
6016 if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6017   rm -rf conftest*
6018   eval "ac_cv_func_$ac_func=yes"
6019 else
6020   echo "configure: failed program was:" >&5
6021   cat conftest.$ac_ext >&5
6022   rm -rf conftest*
6023   eval "ac_cv_func_$ac_func=no"
6024 fi
6025 rm -f conftest*
6026 fi
6027
6028 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6029   echo "$ac_t""yes" 1>&6
6030     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6031   cat >> confdefs.h <<EOF
6032 #define $ac_tr_func 1
6033 EOF
6034  
6035 else
6036   echo "$ac_t""no" 1>&6
6037 fi
6038 done
6039
6040    for ac_func in idna_to_ascii_from_utf8 idna_to_ascii_8z
6041 do
6042 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6043 echo "configure:6044: checking for $ac_func" >&5
6044 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6045   echo $ac_n "(cached) $ac_c" 1>&6
6046 else
6047   cat > conftest.$ac_ext <<EOF
6048 #line 6049 "configure"
6049 #include "confdefs.h"
6050 /* System header to define __stub macros and hopefully few prototypes,
6051     which can conflict with char $ac_func(); below.  */
6052 #include <assert.h>
6053 /* Override any gcc2 internal prototype to avoid an error.  */
6054 /* We use char because int might match the return type of a gcc2
6055     builtin and then its argument prototype would still apply.  */
6056 char $ac_func();
6057
6058 int main() {
6059
6060 /* The GNU C library defines this for functions which it implements
6061     to always fail with ENOSYS.  Some functions are actually named
6062     something starting with __ and the normal name is an alias.  */
6063 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6064 choke me
6065 #else
6066 $ac_func();
6067 #endif
6068
6069 ; return 0; }
6070 EOF
6071 if { (eval echo configure:6072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6072   rm -rf conftest*
6073   eval "ac_cv_func_$ac_func=yes"
6074 else
6075   echo "configure: failed program was:" >&5
6076   cat conftest.$ac_ext >&5
6077   rm -rf conftest*
6078   eval "ac_cv_func_$ac_func=no"
6079 fi
6080 rm -f conftest*
6081 fi
6082
6083 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6084   echo "$ac_t""yes" 1>&6
6085     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6086   cat >> confdefs.h <<EOF
6087 #define $ac_tr_func 1
6088 EOF
6089  
6090 else
6091   echo "$ac_t""no" 1>&6
6092 fi
6093 done
6094
6095    for ac_func in idna_to_ascii_lz idna_to_ascii_from_locale
6096 do
6097 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6098 echo "configure:6099: checking for $ac_func" >&5
6099 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6100   echo $ac_n "(cached) $ac_c" 1>&6
6101 else
6102   cat > conftest.$ac_ext <<EOF
6103 #line 6104 "configure"
6104 #include "confdefs.h"
6105 /* System header to define __stub macros and hopefully few prototypes,
6106     which can conflict with char $ac_func(); below.  */
6107 #include <assert.h>
6108 /* Override any gcc2 internal prototype to avoid an error.  */
6109 /* We use char because int might match the return type of a gcc2
6110     builtin and then its argument prototype would still apply.  */
6111 char $ac_func();
6112
6113 int main() {
6114
6115 /* The GNU C library defines this for functions which it implements
6116     to always fail with ENOSYS.  Some functions are actually named
6117     something starting with __ and the normal name is an alias.  */
6118 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6119 choke me
6120 #else
6121 $ac_func();
6122 #endif
6123
6124 ; return 0; }
6125 EOF
6126 if { (eval echo configure:6127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6127   rm -rf conftest*
6128   eval "ac_cv_func_$ac_func=yes"
6129 else
6130   echo "configure: failed program was:" >&5
6131   cat conftest.$ac_ext >&5
6132   rm -rf conftest*
6133   eval "ac_cv_func_$ac_func=no"
6134 fi
6135 rm -f conftest*
6136 fi
6137
6138 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6139   echo "$ac_t""yes" 1>&6
6140     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6141   cat >> confdefs.h <<EOF
6142 #define $ac_tr_func 1
6143 EOF
6144  
6145 else
6146   echo "$ac_t""no" 1>&6
6147 fi
6148 done
6149
6150 fi
6151
6152
6153 # Check whether --enable-debug or --disable-debug was given.
6154 if test "${enable_debug+set}" = set; then
6155   enableval="$enable_debug"
6156    if test x$enableval = xyes ; then
6157                 cat >> confdefs.h <<\EOF
6158 #define DEBUG 1
6159 EOF
6160
6161           fi
6162          
6163 fi
6164
6165
6166 # Check whether --enable-flock or --disable-flock was given.
6167 if test "${enable_flock+set}" = set; then
6168   enableval="$enable_flock"
6169   if test $enableval = yes; then
6170                 cat >> confdefs.h <<\EOF
6171 #define USE_FLOCK 1
6172 EOF
6173
6174         fi
6175 fi
6176
6177
6178 mutt_cv_fcntl=yes
6179 # Check whether --enable-fcntl or --disable-fcntl was given.
6180 if test "${enable_fcntl+set}" = set; then
6181   enableval="$enable_fcntl"
6182   if test $enableval = no; then mutt_cv_fcntl=no; fi
6183 fi
6184
6185
6186 if test $mutt_cv_fcntl = yes; then
6187         cat >> confdefs.h <<\EOF
6188 #define USE_FCNTL 1
6189 EOF
6190
6191 fi
6192
6193 mutt_cv_inodesort=yes
6194 # Check whether --enable-inodesort or --disable-inodesort was given.
6195 if test "${enable_inodesort+set}" = set; then
6196   enableval="$enable_inodesort"
6197   if test $enableval = no ; then mutt_cv_inodesort=no; fi
6198 fi
6199
6200
6201 if test $mutt_cv_inodesort = yes; then
6202         cat >> confdefs.h <<\EOF
6203 #define USE_INODESORT 1
6204 EOF
6205
6206 fi
6207
6208 mutt_cv_warnings=yes
6209 # Check whether --enable-warnings or --disable-warnings was given.
6210 if test "${enable_warnings+set}" = set; then
6211   enableval="$enable_warnings"
6212   if test $enableval = no; then
6213         mutt_cv_warnings=no
6214 fi
6215 fi
6216
6217
6218 if test x$GCC = xyes -a $mutt_cv_warnings = yes; then
6219         CFLAGS="-Wall -pedantic $CFLAGS"
6220 fi
6221
6222 # Check whether --enable-nfs-fix or --disable-nfs-fix was given.
6223 if test "${enable_nfs_fix+set}" = set; then
6224   enableval="$enable_nfs_fix"
6225   if test x$enableval = xyes; then
6226                 cat >> confdefs.h <<\EOF
6227 #define NFS_ATTRIBUTE_HACK 1
6228 EOF
6229
6230         fi
6231 fi
6232
6233
6234 # Check whether --enable-buffy-size or --disable-buffy-size was given.
6235 if test "${enable_buffy_size+set}" = set; then
6236   enableval="$enable_buffy_size"
6237   if test x$enableval = xyes; then
6238                 cat >> confdefs.h <<\EOF
6239 #define BUFFY_SIZE 1
6240 EOF
6241
6242         fi
6243 fi
6244
6245
6246 # Check whether --enable-mailtool or --disable-mailtool was given.
6247 if test "${enable_mailtool+set}" = set; then
6248   enableval="$enable_mailtool"
6249   if test x$enableval = xyes; then
6250                 cat >> confdefs.h <<\EOF
6251 #define SUN_ATTACHMENT 1
6252 EOF
6253
6254         fi
6255 fi
6256
6257
6258 # Check whether --enable-compressed or --disable-compressed was given.
6259 if test "${enable_compressed+set}" = set; then
6260   enableval="$enable_compressed"
6261   if test x$enableval = xyes; then
6262                 cat >> confdefs.h <<\EOF
6263 #define USE_COMPRESSED 1
6264 EOF
6265
6266         fi
6267 fi
6268
6269
6270 # Check whether --enable-locales-fix or --disable-locales-fix was given.
6271 if test "${enable_locales_fix+set}" = set; then
6272   enableval="$enable_locales_fix"
6273   if test x$enableval = xyes; then
6274                 cat >> confdefs.h <<\EOF
6275 #define LOCALES_HACK 1
6276 EOF
6277
6278         fi
6279 fi
6280
6281
6282 # Check whether --with-exec-shell or --without-exec-shell was given.
6283 if test "${with_exec_shell+set}" = set; then
6284   withval="$with_exec_shell"
6285   if test $withval != yes; then
6286                 cat >> confdefs.h <<EOF
6287 #define EXECSHELL "$withval"
6288 EOF
6289
6290          else
6291                 cat >> confdefs.h <<EOF
6292 #define EXECSHELL "/bin/sh"
6293 EOF
6294
6295         fi
6296 else
6297   cat >> confdefs.h <<EOF
6298 #define EXECSHELL "/bin/sh"
6299 EOF
6300
6301 fi
6302
6303
6304 # Check whether --enable-exact-address or --disable-exact-address was given.
6305 if test "${enable_exact_address+set}" = set; then
6306   enableval="$enable_exact_address"
6307   if test $enableval = yes; then
6308                 cat >> confdefs.h <<\EOF
6309 #define EXACT_ADDRESS 1
6310 EOF
6311
6312
6313         fi
6314 fi
6315
6316
6317 # Check whether --enable-hcache or --disable-hcache was given.
6318 if test "${enable_hcache+set}" = set; then
6319   enableval="$enable_hcache"
6320   if test x$enableval = xyes; then
6321     cat >> confdefs.h <<\EOF
6322 #define USE_HCACHE 1
6323 EOF
6324
6325
6326     OLDCPPFLAGS="$CPPFLAGS"
6327     OLDLIBS="$LIBS"
6328
6329     need_md5="yes"
6330     ac_prefer_gdbm=yes
6331     # Check whether --with-gdbm or --without-gdbm was given.
6332 if test "${with_gdbm+set}" = set; then
6333   withval="$with_gdbm"
6334   ac_prefer_gdbm=$withval
6335 fi
6336
6337     if test x$ac_prefer_gdbm != xno; then
6338         CPPFLAGS="$OLDCPPFLAGS"
6339         LIBS="$OLDLIBS -lgdbm";
6340         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
6341 echo "configure:6342: checking for gdbm_open" >&5
6342 if eval "test \"`echo '$''{'ac_cv_gdbmopen'+set}'`\" = set"; then
6343   echo $ac_n "(cached) $ac_c" 1>&6
6344 else
6345   
6346             ac_cv_gdbmopen=no
6347             cat > conftest.$ac_ext <<EOF
6348 #line 6349 "configure"
6349 #include "confdefs.h"
6350 #include <gdbm.h>
6351 int main() {
6352 gdbm_open(0,0,0,0,0);
6353 ; return 0; }
6354 EOF
6355 if { (eval echo configure:6356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6356   rm -rf conftest*
6357   ac_cv_gdbmopen=yes
6358 else
6359   echo "configure: failed program was:" >&5
6360   cat conftest.$ac_ext >&5
6361 fi
6362 rm -f conftest*
6363         
6364 fi
6365
6366 echo "$ac_t""$ac_cv_gdbmopen" 1>&6
6367     fi
6368
6369     ac_bdb_prefix=yes
6370     # Check whether --with-bdb or --without-bdb was given.
6371 if test "${with_bdb+set}" = set; then
6372   withval="$with_bdb"
6373   ac_bdb_prefix=$withval
6374 fi
6375
6376     if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes; then
6377         test x$ac_bdb_prefix = xyes && ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr"
6378         for d in $ac_bdb_prefix; do
6379             bdbpfx="$bdbpfx $d"
6380             for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do
6381                 bdbpfx="$bdbpfx $d/$v"
6382             done
6383         done
6384         BDB_VERSIONS="db-4 db4 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db ''"
6385         echo $ac_n "checking for BerkeleyDB > 4.0""... $ac_c" 1>&6
6386 echo "configure:6387: checking for BerkeleyDB > 4.0" >&5
6387         for d in $bdbpfx; do
6388             BDB_INCLUDE_DIR=""
6389             BDB_LIB_DIR=""
6390             for v in / $BDB_VERSIONS; do
6391                 if test -r "$d/include/$v/db.h"; then
6392                     BDB_INCLUDE_DIR="$d/include/$v"
6393                     if test -d "$d/lib/$v"; then
6394                         BDB_LIB_DIR="$d/lib/$v"
6395                         for l in `echo $BDB_VERSIONS`; do
6396                             CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
6397                             LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l"
6398                             cat > conftest.$ac_ext <<EOF
6399 #line 6400 "configure"
6400 #include "confdefs.h"
6401
6402                                 #include <stdlib.h>
6403                                 #include <db.h>
6404                             
6405 int main() {
6406
6407                                 DB *db = NULL;
6408                                 db->open(db,NULL,NULL,NULL,0,0,0);
6409                             
6410 ; return 0; }
6411 EOF
6412 if { (eval echo configure:6413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6413   rm -rf conftest*
6414   
6415                                 ac_cv_dbcreate=yes
6416                                 BDB_LIB="$l"
6417                                 break
6418                             
6419 else
6420   echo "configure: failed program was:" >&5
6421   cat conftest.$ac_ext >&5
6422 fi
6423 rm -f conftest*
6424                         done
6425                         test x$ac_dbcreate = xyes && break
6426                     fi
6427                 fi
6428             done
6429             test x$BDB_LIB != x && break
6430         done
6431         if test x$ac_cv_dbcreate = xyes; then
6432             echo "$ac_t""yes" 1>&6
6433         else
6434             echo "$ac_t""no" 1>&6
6435         fi
6436     fi
6437
6438     if test x$ac_cv_gdbmopen = xyes; then
6439         CPPFLAGS="$OLDCPPFLAGS"
6440         LIBS="$OLDLIBS -lgdbm";
6441         cat >> confdefs.h <<\EOF
6442 #define HAVE_GDBM 1
6443 EOF
6444
6445     elif test x$ac_cv_dbcreate = xyes; then
6446         CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
6447         LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
6448         cat >> confdefs.h <<\EOF
6449 #define HAVE_DB4 1
6450 EOF
6451
6452     else
6453         { echo "configure: error: You need Sleepycat DB4 or GDBM for --enable-hcache" 1>&2; exit 1; }
6454     fi
6455 fi
6456 fi
6457
6458
6459 # Check whether --enable-hcache or --disable-hcache was given.
6460 if test "${enable_hcache+set}" = set; then
6461   enableval="$enable_hcache"
6462   if test x$enableval = xyes; then
6463     cat >> confdefs.h <<\EOF
6464 #define USE_HCACHE 1
6465 EOF
6466
6467
6468     OLDCPPFLAGS="$CPPFLAGS"
6469     OLDLIBS="$LIBS"
6470
6471     need_md5="yes"
6472     ac_prefer_gdbm=yes
6473     # Check whether --with-gdbm or --without-gdbm was given.
6474 if test "${with_gdbm+set}" = set; then
6475   withval="$with_gdbm"
6476   ac_prefer_gdbm=$withval
6477 fi
6478
6479     if test x$ac_prefer_gdbm != xno; then
6480         CPPFLAGS="$OLDCPPFLAGS"
6481         LIBS="$OLDLIBS -lgdbm";
6482         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
6483 echo "configure:6484: checking for gdbm_open" >&5
6484 if eval "test \"`echo '$''{'ac_cv_gdbmopen'+set}'`\" = set"; then
6485   echo $ac_n "(cached) $ac_c" 1>&6
6486 else
6487   
6488             ac_cv_gdbmopen=no
6489             cat > conftest.$ac_ext <<EOF
6490 #line 6491 "configure"
6491 #include "confdefs.h"
6492 #include <gdbm.h>
6493 int main() {
6494 gdbm_open(0,0,0,0,0);
6495 ; return 0; }
6496 EOF
6497 if { (eval echo configure:6498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6498   rm -rf conftest*
6499   ac_cv_gdbmopen=yes
6500 else
6501   echo "configure: failed program was:" >&5
6502   cat conftest.$ac_ext >&5
6503 fi
6504 rm -f conftest*
6505         
6506 fi
6507
6508 echo "$ac_t""$ac_cv_gdbmopen" 1>&6
6509     fi
6510
6511     ac_bdb_prefix=yes
6512     # Check whether --with-bdb or --without-bdb was given.
6513 if test "${with_bdb+set}" = set; then
6514   withval="$with_bdb"
6515   ac_bdb_prefix=$withval
6516 fi
6517
6518     if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes; then
6519         test x$ac_bdb_prefix = xyes && ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr"
6520         for d in $ac_bdb_prefix; do
6521             bdbpfx="$bdbpfx $d"
6522             for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do
6523                 bdbpfx="$bdbpfx $d/$v"
6524             done
6525         done
6526         BDB_VERSIONS="db-4 db4 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db ''"
6527         echo $ac_n "checking for BerkeleyDB > 4.0""... $ac_c" 1>&6
6528 echo "configure:6529: checking for BerkeleyDB > 4.0" >&5
6529         for d in $bdbpfx; do
6530             BDB_INCLUDE_DIR=""
6531             BDB_LIB_DIR=""
6532             for v in / $BDB_VERSIONS; do
6533                 if test -r "$d/include/$v/db.h"; then
6534                     BDB_INCLUDE_DIR="$d/include/$v"
6535                     if test -d "$d/lib/$v"; then
6536                         BDB_LIB_DIR="$d/lib/$v"
6537                         for l in `echo $BDB_VERSIONS`; do
6538                             CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
6539                             LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l"
6540                             cat > conftest.$ac_ext <<EOF
6541 #line 6542 "configure"
6542 #include "confdefs.h"
6543
6544                                 #include <stdlib.h>
6545                                 #include <db.h>
6546                             
6547 int main() {
6548
6549                                 DB *db = NULL;
6550                                 db->open(db,NULL,NULL,NULL,0,0,0);
6551                             
6552 ; return 0; }
6553 EOF
6554 if { (eval echo configure:6555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6555   rm -rf conftest*
6556   
6557                                 ac_cv_dbcreate=yes
6558                                 BDB_LIB="$l"
6559                                 break
6560                             
6561 else
6562   echo "configure: failed program was:" >&5
6563   cat conftest.$ac_ext >&5
6564 fi
6565 rm -f conftest*
6566                         done
6567                         test x$ac_dbcreate = xyes && break
6568                     fi
6569                 fi
6570             done
6571             test x$BDB_LIB != x && break
6572         done
6573         if test x$ac_cv_dbcreate = xyes; then
6574             echo "$ac_t""yes" 1>&6
6575         else
6576             echo "$ac_t""no" 1>&6
6577         fi
6578     fi
6579
6580     if test x$ac_cv_gdbmopen = xyes; then
6581         CPPFLAGS="$OLDCPPFLAGS"
6582         LIBS="$OLDLIBS -lgdbm";
6583         cat >> confdefs.h <<\EOF
6584 #define HAVE_GDBM 1
6585 EOF
6586
6587     elif test x$ac_cv_dbcreate = xyes; then
6588         CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
6589         LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
6590         cat >> confdefs.h <<\EOF
6591 #define HAVE_DB4 1
6592 EOF
6593
6594     else
6595         { echo "configure: error: You need Sleepycat DB4 or GDBM for --enable-hcache" 1>&2; exit 1; }
6596     fi
6597 fi
6598 fi
6599
6600
6601
6602
6603
6604
6605
6606
6607 # Check whether --enable-iconv or --disable-iconv was given.
6608 if test "${enable_iconv+set}" = set; then
6609   enableval="$enable_iconv"
6610   if test x$enableval = xno ; then
6611                 am_cv_func_iconv=no
6612         fi
6613
6614 fi
6615
6616
6617 echo $ac_n "checking for off_t""... $ac_c" 1>&6
6618 echo "configure:6619: checking for off_t" >&5
6619 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
6620   echo $ac_n "(cached) $ac_c" 1>&6
6621 else
6622   cat > conftest.$ac_ext <<EOF
6623 #line 6624 "configure"
6624 #include "confdefs.h"
6625 #include <sys/types.h>
6626 #if STDC_HEADERS
6627 #include <stdlib.h>
6628 #include <stddef.h>
6629 #endif
6630 EOF
6631 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6632   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6633   rm -rf conftest*
6634   ac_cv_type_off_t=yes
6635 else
6636   rm -rf conftest*
6637   ac_cv_type_off_t=no
6638 fi
6639 rm -f conftest*
6640
6641 fi
6642 echo "$ac_t""$ac_cv_type_off_t" 1>&6
6643 if test $ac_cv_type_off_t = no; then
6644   cat >> confdefs.h <<\EOF
6645 #define off_t long
6646 EOF
6647
6648 fi
6649
6650 echo $ac_n "checking for size_t""... $ac_c" 1>&6
6651 echo "configure:6652: checking for size_t" >&5
6652 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
6653   echo $ac_n "(cached) $ac_c" 1>&6
6654 else
6655   cat > conftest.$ac_ext <<EOF
6656 #line 6657 "configure"
6657 #include "confdefs.h"
6658 #include <sys/types.h>
6659 #if STDC_HEADERS
6660 #include <stdlib.h>
6661 #include <stddef.h>
6662 #endif
6663 EOF
6664 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6665   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6666   rm -rf conftest*
6667   ac_cv_type_size_t=yes
6668 else
6669   rm -rf conftest*
6670   ac_cv_type_size_t=no
6671 fi
6672 rm -f conftest*
6673
6674 fi
6675 echo "$ac_t""$ac_cv_type_size_t" 1>&6
6676 if test $ac_cv_type_size_t = no; then
6677   cat >> confdefs.h <<\EOF
6678 #define size_t unsigned
6679 EOF
6680
6681 fi
6682
6683 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
6684 # for constant arguments.  Useless!
6685 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
6686 echo "configure:6687: checking for working alloca.h" >&5
6687 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
6688   echo $ac_n "(cached) $ac_c" 1>&6
6689 else
6690   cat > conftest.$ac_ext <<EOF
6691 #line 6692 "configure"
6692 #include "confdefs.h"
6693 #include <alloca.h>
6694 int main() {
6695 char *p = alloca(2 * sizeof(int));
6696 ; return 0; }
6697 EOF
6698 if { (eval echo configure:6699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6699   rm -rf conftest*
6700   ac_cv_header_alloca_h=yes
6701 else
6702   echo "configure: failed program was:" >&5
6703   cat conftest.$ac_ext >&5
6704   rm -rf conftest*
6705   ac_cv_header_alloca_h=no
6706 fi
6707 rm -f conftest*
6708 fi
6709
6710 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
6711 if test $ac_cv_header_alloca_h = yes; then
6712   cat >> confdefs.h <<\EOF
6713 #define HAVE_ALLOCA_H 1
6714 EOF
6715
6716 fi
6717
6718 echo $ac_n "checking for alloca""... $ac_c" 1>&6
6719 echo "configure:6720: checking for alloca" >&5
6720 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
6721   echo $ac_n "(cached) $ac_c" 1>&6
6722 else
6723   cat > conftest.$ac_ext <<EOF
6724 #line 6725 "configure"
6725 #include "confdefs.h"
6726
6727 #ifdef __GNUC__
6728 # define alloca __builtin_alloca
6729 #else
6730 # ifdef _MSC_VER
6731 #  include <malloc.h>
6732 #  define alloca _alloca
6733 # else
6734 #  if HAVE_ALLOCA_H
6735 #   include <alloca.h>
6736 #  else
6737 #   ifdef _AIX
6738  #pragma alloca
6739 #   else
6740 #    ifndef alloca /* predefined by HP cc +Olibcalls */
6741 char *alloca ();
6742 #    endif
6743 #   endif
6744 #  endif
6745 # endif
6746 #endif
6747
6748 int main() {
6749 char *p = (char *) alloca(1);
6750 ; return 0; }
6751 EOF
6752 if { (eval echo configure:6753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6753   rm -rf conftest*
6754   ac_cv_func_alloca_works=yes
6755 else
6756   echo "configure: failed program was:" >&5
6757   cat conftest.$ac_ext >&5
6758   rm -rf conftest*
6759   ac_cv_func_alloca_works=no
6760 fi
6761 rm -f conftest*
6762 fi
6763
6764 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
6765 if test $ac_cv_func_alloca_works = yes; then
6766   cat >> confdefs.h <<\EOF
6767 #define HAVE_ALLOCA 1
6768 EOF
6769
6770 fi
6771
6772 if test $ac_cv_func_alloca_works = no; then
6773   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
6774   # that cause trouble.  Some versions do not even contain alloca or
6775   # contain a buggy version.  If you still want to use their alloca,
6776   # use ar to extract alloca.o from them instead of compiling alloca.c.
6777   ALLOCA=alloca.${ac_objext}
6778   cat >> confdefs.h <<\EOF
6779 #define C_ALLOCA 1
6780 EOF
6781
6782
6783 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
6784 echo "configure:6785: checking whether alloca needs Cray hooks" >&5
6785 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
6786   echo $ac_n "(cached) $ac_c" 1>&6
6787 else
6788   cat > conftest.$ac_ext <<EOF
6789 #line 6790 "configure"
6790 #include "confdefs.h"
6791 #if defined(CRAY) && ! defined(CRAY2)
6792 webecray
6793 #else
6794 wenotbecray
6795 #endif
6796
6797 EOF
6798 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6799   egrep "webecray" >/dev/null 2>&1; then
6800   rm -rf conftest*
6801   ac_cv_os_cray=yes
6802 else
6803   rm -rf conftest*
6804   ac_cv_os_cray=no
6805 fi
6806 rm -f conftest*
6807
6808 fi
6809
6810 echo "$ac_t""$ac_cv_os_cray" 1>&6
6811 if test $ac_cv_os_cray = yes; then
6812 for ac_func in _getb67 GETB67 getb67; do
6813   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6814 echo "configure:6815: checking for $ac_func" >&5
6815 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6816   echo $ac_n "(cached) $ac_c" 1>&6
6817 else
6818   cat > conftest.$ac_ext <<EOF
6819 #line 6820 "configure"
6820 #include "confdefs.h"
6821 /* System header to define __stub macros and hopefully few prototypes,
6822     which can conflict with char $ac_func(); below.  */
6823 #include <assert.h>
6824 /* Override any gcc2 internal prototype to avoid an error.  */
6825 /* We use char because int might match the return type of a gcc2
6826     builtin and then its argument prototype would still apply.  */
6827 char $ac_func();
6828
6829 int main() {
6830
6831 /* The GNU C library defines this for functions which it implements
6832     to always fail with ENOSYS.  Some functions are actually named
6833     something starting with __ and the normal name is an alias.  */
6834 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6835 choke me
6836 #else
6837 $ac_func();
6838 #endif
6839
6840 ; return 0; }
6841 EOF
6842 if { (eval echo configure:6843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6843   rm -rf conftest*
6844   eval "ac_cv_func_$ac_func=yes"
6845 else
6846   echo "configure: failed program was:" >&5
6847   cat conftest.$ac_ext >&5
6848   rm -rf conftest*
6849   eval "ac_cv_func_$ac_func=no"
6850 fi
6851 rm -f conftest*
6852 fi
6853
6854 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6855   echo "$ac_t""yes" 1>&6
6856   cat >> confdefs.h <<EOF
6857 #define CRAY_STACKSEG_END $ac_func
6858 EOF
6859
6860   break
6861 else
6862   echo "$ac_t""no" 1>&6
6863 fi
6864
6865 done
6866 fi
6867
6868 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
6869 echo "configure:6870: checking stack direction for C alloca" >&5
6870 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
6871   echo $ac_n "(cached) $ac_c" 1>&6
6872 else
6873   if test "$cross_compiling" = yes; then
6874   ac_cv_c_stack_direction=0
6875 else
6876   cat > conftest.$ac_ext <<EOF
6877 #line 6878 "configure"
6878 #include "confdefs.h"
6879 find_stack_direction ()
6880 {
6881   static char *addr = 0;
6882   auto char dummy;
6883   if (addr == 0)
6884     {
6885       addr = &dummy;
6886       return find_stack_direction ();
6887     }
6888   else
6889     return (&dummy > addr) ? 1 : -1;
6890 }
6891 main ()
6892 {
6893   exit (find_stack_direction() < 0);
6894 }
6895 EOF
6896 if { (eval echo configure:6897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6897 then
6898   ac_cv_c_stack_direction=1
6899 else
6900   echo "configure: failed program was:" >&5
6901   cat conftest.$ac_ext >&5
6902   rm -fr conftest*
6903   ac_cv_c_stack_direction=-1
6904 fi
6905 rm -fr conftest*
6906 fi
6907
6908 fi
6909
6910 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
6911 cat >> confdefs.h <<EOF
6912 #define STACK_DIRECTION $ac_cv_c_stack_direction
6913 EOF
6914
6915 fi
6916
6917 for ac_hdr in unistd.h
6918 do
6919 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6920 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6921 echo "configure:6922: checking for $ac_hdr" >&5
6922 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6923   echo $ac_n "(cached) $ac_c" 1>&6
6924 else
6925   cat > conftest.$ac_ext <<EOF
6926 #line 6927 "configure"
6927 #include "confdefs.h"
6928 #include <$ac_hdr>
6929 EOF
6930 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6931 { (eval echo configure:6932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6932 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6933 if test -z "$ac_err"; then
6934   rm -rf conftest*
6935   eval "ac_cv_header_$ac_safe=yes"
6936 else
6937   echo "$ac_err" >&5
6938   echo "configure: failed program was:" >&5
6939   cat conftest.$ac_ext >&5
6940   rm -rf conftest*
6941   eval "ac_cv_header_$ac_safe=no"
6942 fi
6943 rm -f conftest*
6944 fi
6945 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6946   echo "$ac_t""yes" 1>&6
6947     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6948   cat >> confdefs.h <<EOF
6949 #define $ac_tr_hdr 1
6950 EOF
6951  
6952 else
6953   echo "$ac_t""no" 1>&6
6954 fi
6955 done
6956
6957 for ac_func in getpagesize
6958 do
6959 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6960 echo "configure:6961: checking for $ac_func" >&5
6961 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6962   echo $ac_n "(cached) $ac_c" 1>&6
6963 else
6964   cat > conftest.$ac_ext <<EOF
6965 #line 6966 "configure"
6966 #include "confdefs.h"
6967 /* System header to define __stub macros and hopefully few prototypes,
6968     which can conflict with char $ac_func(); below.  */
6969 #include <assert.h>
6970 /* Override any gcc2 internal prototype to avoid an error.  */
6971 /* We use char because int might match the return type of a gcc2
6972     builtin and then its argument prototype would still apply.  */
6973 char $ac_func();
6974
6975 int main() {
6976
6977 /* The GNU C library defines this for functions which it implements
6978     to always fail with ENOSYS.  Some functions are actually named
6979     something starting with __ and the normal name is an alias.  */
6980 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6981 choke me
6982 #else
6983 $ac_func();
6984 #endif
6985
6986 ; return 0; }
6987 EOF
6988 if { (eval echo configure:6989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6989   rm -rf conftest*
6990   eval "ac_cv_func_$ac_func=yes"
6991 else
6992   echo "configure: failed program was:" >&5
6993   cat conftest.$ac_ext >&5
6994   rm -rf conftest*
6995   eval "ac_cv_func_$ac_func=no"
6996 fi
6997 rm -f conftest*
6998 fi
6999
7000 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7001   echo "$ac_t""yes" 1>&6
7002     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7003   cat >> confdefs.h <<EOF
7004 #define $ac_tr_func 1
7005 EOF
7006  
7007 else
7008   echo "$ac_t""no" 1>&6
7009 fi
7010 done
7011
7012 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
7013 echo "configure:7014: checking for working mmap" >&5
7014 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
7015   echo $ac_n "(cached) $ac_c" 1>&6
7016 else
7017   if test "$cross_compiling" = yes; then
7018   ac_cv_func_mmap_fixed_mapped=no
7019 else
7020   cat > conftest.$ac_ext <<EOF
7021 #line 7022 "configure"
7022 #include "confdefs.h"
7023
7024 /* Thanks to Mike Haertel and Jim Avera for this test.
7025    Here is a matrix of mmap possibilities:
7026         mmap private not fixed
7027         mmap private fixed at somewhere currently unmapped
7028         mmap private fixed at somewhere already mapped
7029         mmap shared not fixed
7030         mmap shared fixed at somewhere currently unmapped
7031         mmap shared fixed at somewhere already mapped
7032    For private mappings, we should verify that changes cannot be read()
7033    back from the file, nor mmap's back from the file at a different
7034    address.  (There have been systems where private was not correctly
7035    implemented like the infamous i386 svr4.0, and systems where the
7036    VM page cache was not coherent with the filesystem buffer cache
7037    like early versions of FreeBSD and possibly contemporary NetBSD.)
7038    For shared mappings, we should conversely verify that changes get
7039    propogated back to all the places they're supposed to be.
7040
7041    Grep wants private fixed already mapped.
7042    The main things grep needs to know about mmap are:
7043    * does it exist and is it safe to write into the mmap'd area
7044    * how to use it (BSD variants)  */
7045 #include <sys/types.h>
7046 #include <fcntl.h>
7047 #include <sys/mman.h>
7048
7049 /* This mess was copied from the GNU getpagesize.h.  */
7050 #ifndef HAVE_GETPAGESIZE
7051 # ifdef HAVE_UNISTD_H
7052 #  include <unistd.h>
7053 # endif
7054
7055 /* Assume that all systems that can run configure have sys/param.h.  */
7056 # ifndef HAVE_SYS_PARAM_H
7057 #  define HAVE_SYS_PARAM_H 1
7058 # endif
7059
7060 # ifdef _SC_PAGESIZE
7061 #  define getpagesize() sysconf(_SC_PAGESIZE)
7062 # else /* no _SC_PAGESIZE */
7063 #  ifdef HAVE_SYS_PARAM_H
7064 #   include <sys/param.h>
7065 #   ifdef EXEC_PAGESIZE
7066 #    define getpagesize() EXEC_PAGESIZE
7067 #   else /* no EXEC_PAGESIZE */
7068 #    ifdef NBPG
7069 #     define getpagesize() NBPG * CLSIZE
7070 #     ifndef CLSIZE
7071 #      define CLSIZE 1
7072 #     endif /* no CLSIZE */
7073 #    else /* no NBPG */
7074 #     ifdef NBPC
7075 #      define getpagesize() NBPC
7076 #     else /* no NBPC */
7077 #      ifdef PAGESIZE
7078 #       define getpagesize() PAGESIZE
7079 #      endif /* PAGESIZE */
7080 #     endif /* no NBPC */
7081 #    endif /* no NBPG */
7082 #   endif /* no EXEC_PAGESIZE */
7083 #  else /* no HAVE_SYS_PARAM_H */
7084 #   define getpagesize() 8192   /* punt totally */
7085 #  endif /* no HAVE_SYS_PARAM_H */
7086 # endif /* no _SC_PAGESIZE */
7087
7088 #endif /* no HAVE_GETPAGESIZE */
7089
7090 #ifdef __cplusplus
7091 extern "C" { void *malloc(unsigned); }
7092 #else
7093 char *malloc();
7094 #endif
7095
7096 int
7097 main()
7098 {
7099         char *data, *data2, *data3;
7100         int i, pagesize;
7101         int fd;
7102
7103         pagesize = getpagesize();
7104
7105         /*
7106          * First, make a file with some known garbage in it.
7107          */
7108         data = malloc(pagesize);
7109         if (!data)
7110                 exit(1);
7111         for (i = 0; i < pagesize; ++i)
7112                 *(data + i) = rand();
7113         umask(0);
7114         fd = creat("conftestmmap", 0600);
7115         if (fd < 0)
7116                 exit(1);
7117         if (write(fd, data, pagesize) != pagesize)
7118                 exit(1);
7119         close(fd);
7120
7121         /*
7122          * Next, try to mmap the file at a fixed address which
7123          * already has something else allocated at it.  If we can,
7124          * also make sure that we see the same garbage.
7125          */
7126         fd = open("conftestmmap", O_RDWR);
7127         if (fd < 0)
7128                 exit(1);
7129         data2 = malloc(2 * pagesize);
7130         if (!data2)
7131                 exit(1);
7132         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
7133         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
7134             MAP_PRIVATE | MAP_FIXED, fd, 0L))
7135                 exit(1);
7136         for (i = 0; i < pagesize; ++i)
7137                 if (*(data + i) != *(data2 + i))
7138                         exit(1);
7139
7140         /*
7141          * Finally, make sure that changes to the mapped area
7142          * do not percolate back to the file as seen by read().
7143          * (This is a bug on some variants of i386 svr4.0.)
7144          */
7145         for (i = 0; i < pagesize; ++i)
7146                 *(data2 + i) = *(data2 + i) + 1;
7147         data3 = malloc(pagesize);
7148         if (!data3)
7149                 exit(1);
7150         if (read(fd, data3, pagesize) != pagesize)
7151                 exit(1);
7152         for (i = 0; i < pagesize; ++i)
7153                 if (*(data + i) != *(data3 + i))
7154                         exit(1);
7155         close(fd);
7156         unlink("conftestmmap");
7157         exit(0);
7158 }
7159
7160 EOF
7161 if { (eval echo configure:7162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7162 then
7163   ac_cv_func_mmap_fixed_mapped=yes
7164 else
7165   echo "configure: failed program was:" >&5
7166   cat conftest.$ac_ext >&5
7167   rm -fr conftest*
7168   ac_cv_func_mmap_fixed_mapped=no
7169 fi
7170 rm -fr conftest*
7171 fi
7172
7173 fi
7174
7175 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
7176 if test $ac_cv_func_mmap_fixed_mapped = yes; then
7177   cat >> confdefs.h <<\EOF
7178 #define HAVE_MMAP 1
7179 EOF
7180
7181 fi
7182
7183
7184     echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
7185 echo "configure:7186: checking whether we are using the GNU C Library 2.1 or newer" >&5
7186 if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
7187   echo $ac_n "(cached) $ac_c" 1>&6
7188 else
7189   cat > conftest.$ac_ext <<EOF
7190 #line 7191 "configure"
7191 #include "confdefs.h"
7192
7193 #include <features.h>
7194 #ifdef __GNU_LIBRARY__
7195  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
7196   Lucky GNU user
7197  #endif
7198 #endif
7199         
7200 EOF
7201 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7202   egrep "Lucky GNU user" >/dev/null 2>&1; then
7203   rm -rf conftest*
7204   ac_cv_gnu_library_2_1=yes
7205 else
7206   rm -rf conftest*
7207   ac_cv_gnu_library_2_1=no
7208 fi
7209 rm -f conftest*
7210
7211       
7212     
7213 fi
7214
7215 echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6
7216     
7217     GLIBC21="$ac_cv_gnu_library_2_1"
7218   
7219
7220                                     
7221    for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
7222 stdlib.h string.h unistd.h sys/param.h
7223 do
7224 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7225 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7226 echo "configure:7227: checking for $ac_hdr" >&5
7227 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7228   echo $ac_n "(cached) $ac_c" 1>&6
7229 else
7230   cat > conftest.$ac_ext <<EOF
7231 #line 7232 "configure"
7232 #include "confdefs.h"
7233 #include <$ac_hdr>
7234 EOF
7235 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7236 { (eval echo configure:7237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7237 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7238 if test -z "$ac_err"; then
7239   rm -rf conftest*
7240   eval "ac_cv_header_$ac_safe=yes"
7241 else
7242   echo "$ac_err" >&5
7243   echo "configure: failed program was:" >&5
7244   cat conftest.$ac_ext >&5
7245   rm -rf conftest*
7246   eval "ac_cv_header_$ac_safe=no"
7247 fi
7248 rm -f conftest*
7249 fi
7250 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7251   echo "$ac_t""yes" 1>&6
7252     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7253   cat >> confdefs.h <<EOF
7254 #define $ac_tr_hdr 1
7255 EOF
7256  
7257 else
7258   echo "$ac_t""no" 1>&6
7259 fi
7260 done
7261
7262    for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \
7263 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
7264 strdup strtoul tsearch __argz_count __argz_stringify __argz_next
7265 do
7266 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7267 echo "configure:7268: checking for $ac_func" >&5
7268 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7269   echo $ac_n "(cached) $ac_c" 1>&6
7270 else
7271   cat > conftest.$ac_ext <<EOF
7272 #line 7273 "configure"
7273 #include "confdefs.h"
7274 /* System header to define __stub macros and hopefully few prototypes,
7275     which can conflict with char $ac_func(); below.  */
7276 #include <assert.h>
7277 /* Override any gcc2 internal prototype to avoid an error.  */
7278 /* We use char because int might match the return type of a gcc2
7279     builtin and then its argument prototype would still apply.  */
7280 char $ac_func();
7281
7282 int main() {
7283
7284 /* The GNU C library defines this for functions which it implements
7285     to always fail with ENOSYS.  Some functions are actually named
7286     something starting with __ and the normal name is an alias.  */
7287 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7288 choke me
7289 #else
7290 $ac_func();
7291 #endif
7292
7293 ; return 0; }
7294 EOF
7295 if { (eval echo configure:7296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7296   rm -rf conftest*
7297   eval "ac_cv_func_$ac_func=yes"
7298 else
7299   echo "configure: failed program was:" >&5
7300   cat conftest.$ac_ext >&5
7301   rm -rf conftest*
7302   eval "ac_cv_func_$ac_func=no"
7303 fi
7304 rm -f conftest*
7305 fi
7306
7307 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7308   echo "$ac_t""yes" 1>&6
7309     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7310   cat >> confdefs.h <<EOF
7311 #define $ac_tr_func 1
7312 EOF
7313  
7314 else
7315   echo "$ac_t""no" 1>&6
7316 fi
7317 done
7318
7319
7320    
7321     
7322   # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
7323 if test "${with_libiconv_prefix+set}" = set; then
7324   withval="$with_libiconv_prefix"
7325   
7326     for dir in `echo "$withval" | tr : ' '`; do
7327       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
7328       if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
7329     done
7330    
7331 fi
7332
7333
7334   echo $ac_n "checking for iconv""... $ac_c" 1>&6
7335 echo "configure:7336: checking for iconv" >&5
7336 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
7337   echo $ac_n "(cached) $ac_c" 1>&6
7338 else
7339   
7340     am_cv_func_iconv="no, consider installing GNU libiconv"
7341     am_cv_lib_iconv=no
7342     cat > conftest.$ac_ext <<EOF
7343 #line 7344 "configure"
7344 #include "confdefs.h"
7345 #include <stdlib.h>
7346 #include <iconv.h>
7347 int main() {
7348 iconv_t cd = iconv_open("","");
7349        iconv(cd,NULL,NULL,NULL,NULL);
7350        iconv_close(cd);
7351 ; return 0; }
7352 EOF
7353 if { (eval echo configure:7354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7354   rm -rf conftest*
7355   am_cv_func_iconv=yes
7356 else
7357   echo "configure: failed program was:" >&5
7358   cat conftest.$ac_ext >&5
7359 fi
7360 rm -f conftest*
7361     if test "$am_cv_func_iconv" != yes; then
7362       am_save_LIBS="$LIBS"
7363       LIBS="$LIBS -liconv"
7364       cat > conftest.$ac_ext <<EOF
7365 #line 7366 "configure"
7366 #include "confdefs.h"
7367 #include <stdlib.h>
7368 #include <iconv.h>
7369 int main() {
7370 iconv_t cd = iconv_open("","");
7371          iconv(cd,NULL,NULL,NULL,NULL);
7372          iconv_close(cd);
7373 ; return 0; }
7374 EOF
7375 if { (eval echo configure:7376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7376   rm -rf conftest*
7377   am_cv_lib_iconv=yes
7378         am_cv_func_iconv=yes
7379 else
7380   echo "configure: failed program was:" >&5
7381   cat conftest.$ac_ext >&5
7382 fi
7383 rm -f conftest*
7384       LIBS="$am_save_LIBS"
7385     fi
7386   
7387 fi
7388
7389 echo "$ac_t""$am_cv_func_iconv" 1>&6
7390   if test "$am_cv_func_iconv" = yes; then
7391     cat >> confdefs.h <<\EOF
7392 #define HAVE_ICONV 1
7393 EOF
7394
7395     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
7396 echo "configure:7397: checking for iconv declaration" >&5
7397     if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
7398   echo $ac_n "(cached) $ac_c" 1>&6
7399 else
7400   
7401       cat > conftest.$ac_ext <<EOF
7402 #line 7403 "configure"
7403 #include "confdefs.h"
7404
7405 #include <stdlib.h>
7406 #include <iconv.h>
7407 extern
7408 #ifdef __cplusplus
7409 "C"
7410 #endif
7411 #if defined(__STDC__) || defined(__cplusplus)
7412 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
7413 #else
7414 size_t iconv();
7415 #endif
7416
7417 int main() {
7418
7419 ; return 0; }
7420 EOF
7421 if { (eval echo configure:7422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7422   rm -rf conftest*
7423   am_cv_proto_iconv_arg1=""
7424 else
7425   echo "configure: failed program was:" >&5
7426   cat conftest.$ac_ext >&5
7427   rm -rf conftest*
7428   am_cv_proto_iconv_arg1="const"
7429 fi
7430 rm -f conftest*
7431       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
7432 fi
7433
7434     am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
7435     echo "$ac_t""${ac_t:-
7436          }$am_cv_proto_iconv" 1>&6
7437     cat >> confdefs.h <<EOF
7438 #define ICONV_CONST $am_cv_proto_iconv_arg1
7439 EOF
7440
7441   fi
7442   LIBICONV=
7443   if test "$am_cv_lib_iconv" = yes; then
7444     LIBICONV="-liconv"
7445   fi
7446   
7447
7448    
7449   echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
7450 echo "configure:7451: checking for nl_langinfo and CODESET" >&5
7451 if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
7452   echo $ac_n "(cached) $ac_c" 1>&6
7453 else
7454   cat > conftest.$ac_ext <<EOF
7455 #line 7456 "configure"
7456 #include "confdefs.h"
7457 #include <langinfo.h>
7458 int main() {
7459 char* cs = nl_langinfo(CODESET);
7460 ; return 0; }
7461 EOF
7462 if { (eval echo configure:7463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7463   rm -rf conftest*
7464   am_cv_langinfo_codeset=yes
7465 else
7466   echo "configure: failed program was:" >&5
7467   cat conftest.$ac_ext >&5
7468   rm -rf conftest*
7469   am_cv_langinfo_codeset=no
7470 fi
7471 rm -f conftest*
7472     
7473 fi
7474
7475 echo "$ac_t""$am_cv_langinfo_codeset" 1>&6
7476   if test $am_cv_langinfo_codeset = yes; then
7477     cat >> confdefs.h <<\EOF
7478 #define HAVE_LANGINFO_CODESET 1
7479 EOF
7480
7481   fi
7482
7483    if test $ac_cv_header_locale_h = yes; then
7484     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
7485 echo "configure:7486: checking for LC_MESSAGES" >&5
7486 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
7487   echo $ac_n "(cached) $ac_c" 1>&6
7488 else
7489   cat > conftest.$ac_ext <<EOF
7490 #line 7491 "configure"
7491 #include "confdefs.h"
7492 #include <locale.h>
7493 int main() {
7494 return LC_MESSAGES
7495 ; return 0; }
7496 EOF
7497 if { (eval echo configure:7498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7498   rm -rf conftest*
7499   am_cv_val_LC_MESSAGES=yes
7500 else
7501   echo "configure: failed program was:" >&5
7502   cat conftest.$ac_ext >&5
7503   rm -rf conftest*
7504   am_cv_val_LC_MESSAGES=no
7505 fi
7506 rm -f conftest*
7507 fi
7508
7509 echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
7510     if test $am_cv_val_LC_MESSAGES = yes; then
7511       cat >> confdefs.h <<\EOF
7512 #define HAVE_LC_MESSAGES 1
7513 EOF
7514
7515     fi
7516   fi
7517    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
7518 echo "configure:7519: checking whether NLS is requested" >&5
7519         # Check whether --enable-nls or --disable-nls was given.
7520 if test "${enable_nls+set}" = set; then
7521   enableval="$enable_nls"
7522   USE_NLS=$enableval
7523 else
7524   USE_NLS=yes
7525 fi
7526
7527     echo "$ac_t""$USE_NLS" 1>&6
7528     
7529
7530     BUILD_INCLUDED_LIBINTL=no
7531     USE_INCLUDED_LIBINTL=no
7532     INTLLIBS=
7533
7534         if test "$USE_NLS" = "yes"; then
7535       cat >> confdefs.h <<\EOF
7536 #define ENABLE_NLS 1
7537 EOF
7538
7539       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
7540 echo "configure:7541: checking whether included gettext is requested" >&5
7541       # Check whether --with-included-gettext or --without-included-gettext was given.
7542 if test "${with_included_gettext+set}" = set; then
7543   withval="$with_included_gettext"
7544   nls_cv_force_use_gnu_gettext=$withval
7545 else
7546   nls_cv_force_use_gnu_gettext=no
7547 fi
7548
7549       echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
7550
7551       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
7552       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
7553                                 CATOBJEXT=NONE
7554
7555                 
7556         
7557
7558         ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
7559 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
7560 echo "configure:7561: checking for libintl.h" >&5
7561 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7562   echo $ac_n "(cached) $ac_c" 1>&6
7563 else
7564   cat > conftest.$ac_ext <<EOF
7565 #line 7566 "configure"
7566 #include "confdefs.h"
7567 #include <libintl.h>
7568 EOF
7569 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7570 { (eval echo configure:7571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7571 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7572 if test -z "$ac_err"; then
7573   rm -rf conftest*
7574   eval "ac_cv_header_$ac_safe=yes"
7575 else
7576   echo "$ac_err" >&5
7577   echo "configure: failed program was:" >&5
7578   cat conftest.$ac_ext >&5
7579   rm -rf conftest*
7580   eval "ac_cv_header_$ac_safe=no"
7581 fi
7582 rm -f conftest*
7583 fi
7584 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7585   echo "$ac_t""yes" 1>&6
7586   echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
7587 echo "configure:7588: checking for GNU gettext in libc" >&5
7588 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
7589   echo $ac_n "(cached) $ac_c" 1>&6
7590 else
7591   cat > conftest.$ac_ext <<EOF
7592 #line 7593 "configure"
7593 #include "confdefs.h"
7594 #include <libintl.h>
7595 extern int _nl_msg_cat_cntr;
7596 int main() {
7597 bindtextdomain ("", "");
7598 return (int) gettext ("") + _nl_msg_cat_cntr
7599 ; return 0; }
7600 EOF
7601 if { (eval echo configure:7602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7602   rm -rf conftest*
7603   gt_cv_func_gnugettext1_libc=yes
7604 else
7605   echo "configure: failed program was:" >&5
7606   cat conftest.$ac_ext >&5
7607   rm -rf conftest*
7608   gt_cv_func_gnugettext1_libc=no
7609 fi
7610 rm -f conftest*
7611 fi
7612
7613 echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
7614
7615            if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
7616              echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
7617 echo "configure:7618: checking for GNU gettext in libintl" >&5
7618 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
7619   echo $ac_n "(cached) $ac_c" 1>&6
7620 else
7621   gt_save_LIBS="$LIBS"
7622                 LIBS="$LIBS -lintl $LIBICONV"
7623                 cat > conftest.$ac_ext <<EOF
7624 #line 7625 "configure"
7625 #include "confdefs.h"
7626 #include <libintl.h>
7627 extern int _nl_msg_cat_cntr;
7628 int main() {
7629 bindtextdomain ("", "");
7630 return (int) gettext ("") + _nl_msg_cat_cntr
7631 ; return 0; }
7632 EOF
7633 if { (eval echo configure:7634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7634   rm -rf conftest*
7635   gt_cv_func_gnugettext1_libintl=yes
7636 else
7637   echo "configure: failed program was:" >&5
7638   cat conftest.$ac_ext >&5
7639   rm -rf conftest*
7640   gt_cv_func_gnugettext1_libintl=no
7641 fi
7642 rm -f conftest*
7643                 LIBS="$gt_save_LIBS"
7644 fi
7645
7646 echo "$ac_t""$gt_cv_func_gnugettext1_libintl" 1>&6
7647            fi
7648
7649                                            if test "$gt_cv_func_gnugettext1_libc" = "yes" \
7650               || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
7651                    && test "$PACKAGE" != gettext; }; then
7652              cat >> confdefs.h <<\EOF
7653 #define HAVE_GETTEXT 1
7654 EOF
7655
7656
7657              if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
7658                                        INTLLIBS="-lintl $LIBICONV"
7659              fi
7660
7661              gt_save_LIBS="$LIBS"
7662              LIBS="$LIBS $INTLLIBS"
7663              for ac_func in dcgettext
7664 do
7665 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7666 echo "configure:7667: checking for $ac_func" >&5
7667 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7668   echo $ac_n "(cached) $ac_c" 1>&6
7669 else
7670   cat > conftest.$ac_ext <<EOF
7671 #line 7672 "configure"
7672 #include "confdefs.h"
7673 /* System header to define __stub macros and hopefully few prototypes,
7674     which can conflict with char $ac_func(); below.  */
7675 #include <assert.h>
7676 /* Override any gcc2 internal prototype to avoid an error.  */
7677 /* We use char because int might match the return type of a gcc2
7678     builtin and then its argument prototype would still apply.  */
7679 char $ac_func();
7680
7681 int main() {
7682
7683 /* The GNU C library defines this for functions which it implements
7684     to always fail with ENOSYS.  Some functions are actually named
7685     something starting with __ and the normal name is an alias.  */
7686 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7687 choke me
7688 #else
7689 $ac_func();
7690 #endif
7691
7692 ; return 0; }
7693 EOF
7694 if { (eval echo configure:7695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7695   rm -rf conftest*
7696   eval "ac_cv_func_$ac_func=yes"
7697 else
7698   echo "configure: failed program was:" >&5
7699   cat conftest.$ac_ext >&5
7700   rm -rf conftest*
7701   eval "ac_cv_func_$ac_func=no"
7702 fi
7703 rm -f conftest*
7704 fi
7705
7706 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7707   echo "$ac_t""yes" 1>&6
7708     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7709   cat >> confdefs.h <<EOF
7710 #define $ac_tr_func 1
7711 EOF
7712  
7713 else
7714   echo "$ac_t""no" 1>&6
7715 fi
7716 done
7717
7718              LIBS="$gt_save_LIBS"
7719
7720                      # Extract the first word of "msgfmt", so it can be a program name with args.
7721 set dummy msgfmt; ac_word=$2
7722 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7723 echo "configure:7724: checking for $ac_word" >&5
7724 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
7725   echo $ac_n "(cached) $ac_c" 1>&6
7726 else
7727   case "$MSGFMT" in
7728   /*)
7729   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
7730   ;;
7731   *)
7732   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7733   for ac_dir in $PATH; do
7734     test -z "$ac_dir" && ac_dir=.
7735     if test -f $ac_dir/$ac_word; then
7736       if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
7737         ac_cv_path_MSGFMT="$ac_dir/$ac_word"
7738         break
7739       fi
7740     fi
7741   done
7742   IFS="$ac_save_ifs"
7743   test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
7744   ;;
7745 esac
7746 fi
7747 MSGFMT="$ac_cv_path_MSGFMT"
7748 if test "$MSGFMT" != ":"; then
7749   echo "$ac_t""$MSGFMT" 1>&6
7750 else
7751   echo "$ac_t""no" 1>&6
7752 fi
7753
7754              # Extract the first word of "gmsgfmt", so it can be a program name with args.
7755 set dummy gmsgfmt; ac_word=$2
7756 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7757 echo "configure:7758: checking for $ac_word" >&5
7758 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
7759   echo $ac_n "(cached) $ac_c" 1>&6
7760 else
7761   case "$GMSGFMT" in
7762   /*)
7763   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
7764   ;;
7765   ?:/*)                  
7766   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
7767   ;;
7768   *)
7769   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7770   ac_dummy="$PATH"
7771   for ac_dir in $ac_dummy; do 
7772     test -z "$ac_dir" && ac_dir=.
7773     if test -f $ac_dir/$ac_word; then
7774       ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
7775       break
7776     fi
7777   done
7778   IFS="$ac_save_ifs"
7779   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
7780   ;;
7781 esac
7782 fi
7783 GMSGFMT="$ac_cv_path_GMSGFMT"
7784 if test -n "$GMSGFMT"; then
7785   echo "$ac_t""$GMSGFMT" 1>&6
7786 else
7787   echo "$ac_t""no" 1>&6
7788 fi
7789
7790
7791                      # Extract the first word of "xgettext", so it can be a program name with args.
7792 set dummy xgettext; ac_word=$2
7793 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7794 echo "configure:7795: checking for $ac_word" >&5
7795 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
7796   echo $ac_n "(cached) $ac_c" 1>&6
7797 else
7798   case "$XGETTEXT" in
7799   /*)
7800   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
7801   ;;
7802   *)
7803   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7804   for ac_dir in $PATH; do
7805     test -z "$ac_dir" && ac_dir=.
7806     if test -f $ac_dir/$ac_word; then
7807       if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
7808         ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
7809         break
7810       fi
7811     fi
7812   done
7813   IFS="$ac_save_ifs"
7814   test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
7815   ;;
7816 esac
7817 fi
7818 XGETTEXT="$ac_cv_path_XGETTEXT"
7819 if test "$XGETTEXT" != ":"; then
7820   echo "$ac_t""$XGETTEXT" 1>&6
7821 else
7822   echo "$ac_t""no" 1>&6
7823 fi
7824
7825
7826              CATOBJEXT=.gmo
7827            fi
7828         
7829 else
7830   echo "$ac_t""no" 1>&6
7831 fi
7832
7833
7834         if test "$CATOBJEXT" = "NONE"; then
7835                           nls_cv_use_gnu_gettext=yes
7836         fi
7837       fi
7838
7839       if test "$nls_cv_use_gnu_gettext" = "yes"; then
7840                 INTLOBJS="\$(GETTOBJS)"
7841         # Extract the first word of "msgfmt", so it can be a program name with args.
7842 set dummy msgfmt; ac_word=$2
7843 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7844 echo "configure:7845: checking for $ac_word" >&5
7845 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
7846   echo $ac_n "(cached) $ac_c" 1>&6
7847 else
7848   case "$MSGFMT" in
7849   /*)
7850   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
7851   ;;
7852   *)
7853   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7854   for ac_dir in $PATH; do
7855     test -z "$ac_dir" && ac_dir=.
7856     if test -f $ac_dir/$ac_word; then
7857       if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
7858         ac_cv_path_MSGFMT="$ac_dir/$ac_word"
7859         break
7860       fi
7861     fi
7862   done
7863   IFS="$ac_save_ifs"
7864   test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
7865   ;;
7866 esac
7867 fi
7868 MSGFMT="$ac_cv_path_MSGFMT"
7869 if test "$MSGFMT" != ":"; then
7870   echo "$ac_t""$MSGFMT" 1>&6
7871 else
7872   echo "$ac_t""no" 1>&6
7873 fi
7874
7875         # Extract the first word of "gmsgfmt", so it can be a program name with args.
7876 set dummy gmsgfmt; ac_word=$2
7877 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7878 echo "configure:7879: checking for $ac_word" >&5
7879 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
7880   echo $ac_n "(cached) $ac_c" 1>&6
7881 else
7882   case "$GMSGFMT" in
7883   /*)
7884   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
7885   ;;
7886   ?:/*)                  
7887   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
7888   ;;
7889   *)
7890   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7891   ac_dummy="$PATH"
7892   for ac_dir in $ac_dummy; do 
7893     test -z "$ac_dir" && ac_dir=.
7894     if test -f $ac_dir/$ac_word; then
7895       ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
7896       break
7897     fi
7898   done
7899   IFS="$ac_save_ifs"
7900   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
7901   ;;
7902 esac
7903 fi
7904 GMSGFMT="$ac_cv_path_GMSGFMT"
7905 if test -n "$GMSGFMT"; then
7906   echo "$ac_t""$GMSGFMT" 1>&6
7907 else
7908   echo "$ac_t""no" 1>&6
7909 fi
7910
7911         # Extract the first word of "xgettext", so it can be a program name with args.
7912 set dummy xgettext; ac_word=$2
7913 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7914 echo "configure:7915: checking for $ac_word" >&5
7915 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
7916   echo $ac_n "(cached) $ac_c" 1>&6
7917 else
7918   case "$XGETTEXT" in
7919   /*)
7920   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
7921   ;;
7922   *)
7923   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7924   for ac_dir in $PATH; do
7925     test -z "$ac_dir" && ac_dir=.
7926     if test -f $ac_dir/$ac_word; then
7927       if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
7928         ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
7929         break
7930       fi
7931     fi
7932   done
7933   IFS="$ac_save_ifs"
7934   test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
7935   ;;
7936 esac
7937 fi
7938 XGETTEXT="$ac_cv_path_XGETTEXT"
7939 if test "$XGETTEXT" != ":"; then
7940   echo "$ac_t""$XGETTEXT" 1>&6
7941 else
7942   echo "$ac_t""no" 1>&6
7943 fi
7944
7945         
7946         BUILD_INCLUDED_LIBINTL=yes
7947         USE_INCLUDED_LIBINTL=yes
7948         CATOBJEXT=.gmo
7949         INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV"
7950         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
7951       fi
7952
7953                   if test "$GMSGFMT" != ":"; then
7954                         if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
7955           : ;
7956         else
7957           echo "$ac_t""found msgfmt program is not GNU msgfmt; ignore it" 1>&6
7958           GMSGFMT=":"
7959         fi
7960       fi
7961
7962                   if test "$XGETTEXT" != ":"; then
7963                         if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
7964           : ;
7965         else
7966           echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
7967           XGETTEXT=":"
7968         fi
7969       fi
7970
7971             POSUB=po
7972     fi
7973     
7974
7975
7976             if test "$PACKAGE" = gettext; then
7977       BUILD_INCLUDED_LIBINTL=yes
7978     fi
7979
7980                                             for ac_prog in bison
7981 do
7982 # Extract the first word of "$ac_prog", so it can be a program name with args.
7983 set dummy $ac_prog; ac_word=$2
7984 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7985 echo "configure:7986: checking for $ac_word" >&5
7986 if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
7987   echo $ac_n "(cached) $ac_c" 1>&6
7988 else
7989   if test -n "$INTLBISON"; then
7990   ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test.
7991 else
7992   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7993   ac_dummy="$PATH"
7994   for ac_dir in $ac_dummy; do
7995     test -z "$ac_dir" && ac_dir=.
7996     if test -f $ac_dir/$ac_word; then
7997       ac_cv_prog_INTLBISON="$ac_prog"
7998       break
7999     fi
8000   done
8001   IFS="$ac_save_ifs"
8002 fi
8003 fi
8004 INTLBISON="$ac_cv_prog_INTLBISON"
8005 if test -n "$INTLBISON"; then
8006   echo "$ac_t""$INTLBISON" 1>&6
8007 else
8008   echo "$ac_t""no" 1>&6
8009 fi
8010
8011 test -n "$INTLBISON" && break
8012 done
8013
8014     if test -z "$INTLBISON"; then
8015       ac_verc_fail=yes
8016     else
8017             echo $ac_n "checking version of bison""... $ac_c" 1>&6
8018 echo "configure:8019: checking version of bison" >&5
8019       ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
8020       case $ac_prog_version in
8021         '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
8022         1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
8023            ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
8024         *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
8025       esac
8026       echo "$ac_t""$ac_prog_version" 1>&6
8027     fi
8028     if test $ac_verc_fail = yes; then
8029       INTLBISON=:
8030     fi
8031
8032                 for lang in $ALL_LINGUAS; do
8033       GMOFILES="$GMOFILES $lang.gmo"
8034       POFILES="$POFILES $lang.po"
8035     done
8036
8037         
8038     
8039     
8040     
8041     
8042     
8043     
8044     
8045     
8046
8047         nls_cv_header_intl=
8048     nls_cv_header_libgt=
8049
8050         DATADIRNAME=share
8051     
8052
8053         INSTOBJEXT=.mo
8054     
8055
8056         GENCAT=gencat
8057     
8058   
8059
8060    if test "x$CATOBJEXT" != "x"; then
8061      if test "x$ALL_LINGUAS" = "x"; then
8062        LINGUAS=
8063      else
8064        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
8065 echo "configure:8066: checking for catalogs to be installed" >&5
8066        NEW_LINGUAS=
8067        for presentlang in $ALL_LINGUAS; do
8068          useit=no
8069          for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
8070            # Use the presentlang catalog if desiredlang is
8071            #   a. equal to presentlang, or
8072            #   b. a variant of presentlang (because in this case,
8073            #      presentlang can be used as a fallback for messages
8074            #      which are not translated in the desiredlang catalog).
8075            case "$desiredlang" in
8076              "$presentlang"*) useit=yes;;
8077            esac
8078          done
8079          if test $useit = yes; then
8080            NEW_LINGUAS="$NEW_LINGUAS $presentlang"
8081          fi
8082        done
8083        LINGUAS=$NEW_LINGUAS
8084        echo "$ac_t""$LINGUAS" 1>&6
8085      fi
8086
8087           if test -n "$LINGUAS"; then
8088        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
8089      fi
8090    fi
8091
8092             MKINSTALLDIRS=
8093    if test -n "$ac_aux_dir"; then
8094      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
8095    fi
8096    if test -z "$MKINSTALLDIRS"; then
8097      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
8098    fi
8099    
8100
8101       INTL_LIBTOOL_SUFFIX_PREFIX=
8102    
8103   
8104
8105 if test "$am_cv_func_iconv" != "yes"
8106 then
8107   echo "configure: warning: Configuring without iconv support. See INSTALL for details" 1>&2
8108 else
8109
8110 for ac_hdr in iconv.h
8111 do
8112 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8113 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8114 echo "configure:8115: checking for $ac_hdr" >&5
8115 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8116   echo $ac_n "(cached) $ac_c" 1>&6
8117 else
8118   cat > conftest.$ac_ext <<EOF
8119 #line 8120 "configure"
8120 #include "confdefs.h"
8121 #include <$ac_hdr>
8122 EOF
8123 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8124 { (eval echo configure:8125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8125 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8126 if test -z "$ac_err"; then
8127   rm -rf conftest*
8128   eval "ac_cv_header_$ac_safe=yes"
8129 else
8130   echo "$ac_err" >&5
8131   echo "configure: failed program was:" >&5
8132   cat conftest.$ac_ext >&5
8133   rm -rf conftest*
8134   eval "ac_cv_header_$ac_safe=no"
8135 fi
8136 rm -f conftest*
8137 fi
8138 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8139   echo "$ac_t""yes" 1>&6
8140     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8141   cat >> confdefs.h <<EOF
8142 #define $ac_tr_hdr 1
8143 EOF
8144  echo $ac_n "checking whether iconv.h defines iconv_t""... $ac_c" 1>&6
8145 echo "configure:8146: checking whether iconv.h defines iconv_t" >&5
8146          cat > conftest.$ac_ext <<EOF
8147 #line 8148 "configure"
8148 #include "confdefs.h"
8149 #include <iconv.h>
8150 EOF
8151 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8152   egrep "typedef.*iconv_t" >/dev/null 2>&1; then
8153   rm -rf conftest*
8154   echo "$ac_t""yes" 1>&6
8155                  cat >> confdefs.h <<\EOF
8156 #define HAVE_ICONV_T_DEF 1
8157 EOF
8158
8159 else
8160   rm -rf conftest*
8161   echo "$ac_t""no" 1>&6
8162 fi
8163 rm -f conftest*
8164
8165 else
8166   echo "$ac_t""no" 1>&6
8167 fi
8168 done
8169
8170
8171 echo $ac_n "checking whether this iconv is good enough""... $ac_c" 1>&6
8172 echo "configure:8173: checking whether this iconv is good enough" >&5
8173 if eval "test \"`echo '$''{'mutt_cv_iconv_good'+set}'`\" = set"; then
8174   echo $ac_n "(cached) $ac_c" 1>&6
8175 else
8176   mutt_save_LIBS="$LIBS"
8177         LIBS="$LIBS $LIBICONV"
8178         if test "$cross_compiling" = yes; then
8179   mutt_cv_iconv_good=yes
8180 else
8181   cat > conftest.$ac_ext <<EOF
8182 #line 8183 "configure"
8183 #include "confdefs.h"
8184
8185 #include <iconv.h>
8186 int main()
8187 {
8188   iconv_t cd;
8189   char buf[4];
8190   char *ob;
8191   size_t obl;
8192   ob = buf, obl = sizeof(buf);
8193   return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
8194           (iconv(cd, 0, 0, &ob, &obl) ||
8195            !(ob == buf && obl == sizeof(buf)) ||
8196            iconv_close(cd)));
8197 }
8198                 
8199 EOF
8200 if { (eval echo configure:8201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8201 then
8202   mutt_cv_iconv_good=yes
8203 else
8204   echo "configure: failed program was:" >&5
8205   cat conftest.$ac_ext >&5
8206   rm -fr conftest*
8207   mutt_cv_iconv_good=no
8208 fi
8209 rm -fr conftest*
8210 fi
8211
8212         LIBS="$mutt_save_LIBS"
8213 fi
8214
8215 echo "$ac_t""$mutt_cv_iconv_good" 1>&6
8216 if test "$mutt_cv_iconv_good" = no; then
8217   { echo "configure: error: Try using libiconv instead" 1>&2; exit 1; }
8218 fi
8219
8220 echo $ac_n "checking whether iconv is non-transcribing""... $ac_c" 1>&6
8221 echo "configure:8222: checking whether iconv is non-transcribing" >&5
8222 if eval "test \"`echo '$''{'mutt_cv_iconv_nontrans'+set}'`\" = set"; then
8223   echo $ac_n "(cached) $ac_c" 1>&6
8224 else
8225   mutt_save_LIBS="$LIBS"
8226         LIBS="$LIBS $LIBICONV"
8227         if test "$cross_compiling" = yes; then
8228   mutt_cv_iconv_nontrans=no
8229 else
8230   cat > conftest.$ac_ext <<EOF
8231 #line 8232 "configure"
8232 #include "confdefs.h"
8233
8234 #include <iconv.h>
8235 #include <string.h>
8236 int main()
8237 {
8238   iconv_t cd;
8239   const char *ib;
8240   char *ob;
8241   size_t ibl, obl;
8242   const char *s = "\304\211";
8243   char t[3];
8244   ib = s, ibl = 2, ob = t, obl = 3;
8245   return ((cd = iconv_open("UTF-8", "UTF-8")) == (iconv_t)(-1) ||
8246           iconv(cd, &ib, &ibl, &ob, &obl));
8247 }
8248                 
8249 EOF
8250 if { (eval echo configure:8251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8251 then
8252   mutt_cv_iconv_nontrans=no
8253 else
8254   echo "configure: failed program was:" >&5
8255   cat conftest.$ac_ext >&5
8256   rm -fr conftest*
8257   mutt_cv_iconv_nontrans=yes
8258 fi
8259 rm -fr conftest*
8260 fi
8261
8262         LIBS="$mutt_save_LIBS"
8263 fi
8264
8265 echo "$ac_t""$mutt_cv_iconv_nontrans" 1>&6
8266 if test "$mutt_cv_iconv_nontrans" = yes; then
8267   cat >> confdefs.h <<\EOF
8268 #define ICONV_NONTRANS 1
8269 EOF
8270
8271 else
8272   cat >> confdefs.h <<\EOF
8273 #define ICONV_NONTRANS 0
8274 EOF
8275
8276 fi
8277
8278 CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/intl"
8279
8280 if test "$BUILD_INCLUDED_LIBINTL" = "yes"; then
8281   cat >> confdefs.h <<\EOF
8282 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
8283 EOF
8284
8285 else
8286   for ac_func in bind_textdomain_codeset
8287 do
8288 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8289 echo "configure:8290: checking for $ac_func" >&5
8290 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8291   echo $ac_n "(cached) $ac_c" 1>&6
8292 else
8293   cat > conftest.$ac_ext <<EOF
8294 #line 8295 "configure"
8295 #include "confdefs.h"
8296 /* System header to define __stub macros and hopefully few prototypes,
8297     which can conflict with char $ac_func(); below.  */
8298 #include <assert.h>
8299 /* Override any gcc2 internal prototype to avoid an error.  */
8300 /* We use char because int might match the return type of a gcc2
8301     builtin and then its argument prototype would still apply.  */
8302 char $ac_func();
8303
8304 int main() {
8305
8306 /* The GNU C library defines this for functions which it implements
8307     to always fail with ENOSYS.  Some functions are actually named
8308     something starting with __ and the normal name is an alias.  */
8309 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8310 choke me
8311 #else
8312 $ac_func();
8313 #endif
8314
8315 ; return 0; }
8316 EOF
8317 if { (eval echo configure:8318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8318   rm -rf conftest*
8319   eval "ac_cv_func_$ac_func=yes"
8320 else
8321   echo "configure: failed program was:" >&5
8322   cat conftest.$ac_ext >&5
8323   rm -rf conftest*
8324   eval "ac_cv_func_$ac_func=no"
8325 fi
8326 rm -f conftest*
8327 fi
8328
8329 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8330   echo "$ac_t""yes" 1>&6
8331     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8332   cat >> confdefs.h <<EOF
8333 #define $ac_tr_func 1
8334 EOF
8335  
8336 else
8337   echo "$ac_t""no" 1>&6
8338 fi
8339 done
8340
8341 fi
8342
8343 fi # libiconv
8344
8345
8346 for ac_hdr in wchar.h
8347 do
8348 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8349 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8350 echo "configure:8351: checking for $ac_hdr" >&5
8351 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8352   echo $ac_n "(cached) $ac_c" 1>&6
8353 else
8354   cat > conftest.$ac_ext <<EOF
8355 #line 8356 "configure"
8356 #include "confdefs.h"
8357 #include <$ac_hdr>
8358 EOF
8359 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8360 { (eval echo configure:8361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8361 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8362 if test -z "$ac_err"; then
8363   rm -rf conftest*
8364   eval "ac_cv_header_$ac_safe=yes"
8365 else
8366   echo "$ac_err" >&5
8367   echo "configure: failed program was:" >&5
8368   cat conftest.$ac_ext >&5
8369   rm -rf conftest*
8370   eval "ac_cv_header_$ac_safe=no"
8371 fi
8372 rm -f conftest*
8373 fi
8374 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8375   echo "$ac_t""yes" 1>&6
8376     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8377   cat >> confdefs.h <<EOF
8378 #define $ac_tr_hdr 1
8379 EOF
8380  
8381 else
8382   echo "$ac_t""no" 1>&6
8383 fi
8384 done
8385
8386
8387 echo $ac_n "checking for wchar_t""... $ac_c" 1>&6
8388 echo "configure:8389: checking for wchar_t" >&5
8389 if eval "test \"`echo '$''{'mutt_cv_wchar_t'+set}'`\" = set"; then
8390   echo $ac_n "(cached) $ac_c" 1>&6
8391 else
8392   cat > conftest.$ac_ext <<EOF
8393 #line 8394 "configure"
8394 #include "confdefs.h"
8395
8396 #include <stddef.h>
8397 #include <stdlib.h>
8398 #ifdef HAVE_WCHAR_H
8399 #include <wchar.h>
8400 #endif
8401                 
8402 int main() {
8403  wchar_t wc; return 0; 
8404 ; return 0; }
8405 EOF
8406 if { (eval echo configure:8407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8407   rm -rf conftest*
8408   mutt_cv_wchar_t=yes
8409 else
8410   echo "configure: failed program was:" >&5
8411   cat conftest.$ac_ext >&5
8412   rm -rf conftest*
8413   mutt_cv_wchar_t=no
8414 fi
8415 rm -f conftest*
8416 fi
8417
8418 echo "$ac_t""$mutt_cv_wchar_t" 1>&6
8419
8420 if test "$mutt_cv_wchar_t" = no; then
8421         cat >> confdefs.h <<\EOF
8422 #define wchar_t int
8423 EOF
8424
8425 fi
8426
8427 echo $ac_n "checking for wint_t""... $ac_c" 1>&6
8428 echo "configure:8429: checking for wint_t" >&5
8429 if eval "test \"`echo '$''{'mutt_cv_wint_t'+set}'`\" = set"; then
8430   echo $ac_n "(cached) $ac_c" 1>&6
8431 else
8432   cat > conftest.$ac_ext <<EOF
8433 #line 8434 "configure"
8434 #include "confdefs.h"
8435
8436 #include <stddef.h>
8437 #include <stdlib.h>
8438 #ifdef HAVE_WCHAR_H
8439 #include <wchar.h>
8440 #endif
8441                 
8442 int main() {
8443  wint_t wc; return 0; 
8444 ; return 0; }
8445 EOF
8446 if { (eval echo configure:8447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8447   rm -rf conftest*
8448   mutt_cv_wint_t=yes
8449 else
8450   echo "configure: failed program was:" >&5
8451   cat conftest.$ac_ext >&5
8452   rm -rf conftest*
8453   mutt_cv_wint_t=no
8454 fi
8455 rm -f conftest*
8456 fi
8457
8458 echo "$ac_t""$mutt_cv_wint_t" 1>&6
8459
8460 if test "$mutt_cv_wint_t" = no; then
8461         cat >> confdefs.h <<\EOF
8462 #define wint_t int
8463 EOF
8464
8465 fi
8466
8467 for ac_hdr in wctype.h
8468 do
8469 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8470 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8471 echo "configure:8472: checking for $ac_hdr" >&5
8472 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8473   echo $ac_n "(cached) $ac_c" 1>&6
8474 else
8475   cat > conftest.$ac_ext <<EOF
8476 #line 8477 "configure"
8477 #include "confdefs.h"
8478 #include <$ac_hdr>
8479 EOF
8480 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8481 { (eval echo configure:8482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8482 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8483 if test -z "$ac_err"; then
8484   rm -rf conftest*
8485   eval "ac_cv_header_$ac_safe=yes"
8486 else
8487   echo "$ac_err" >&5
8488   echo "configure: failed program was:" >&5
8489   cat conftest.$ac_ext >&5
8490   rm -rf conftest*
8491   eval "ac_cv_header_$ac_safe=no"
8492 fi
8493 rm -f conftest*
8494 fi
8495 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8496   echo "$ac_t""yes" 1>&6
8497     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8498   cat >> confdefs.h <<EOF
8499 #define $ac_tr_hdr 1
8500 EOF
8501  
8502 else
8503   echo "$ac_t""no" 1>&6
8504 fi
8505 done
8506
8507 for ac_func in iswalnum iswalpha  iswcntrl iswdigit
8508 do
8509 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8510 echo "configure:8511: checking for $ac_func" >&5
8511 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8512   echo $ac_n "(cached) $ac_c" 1>&6
8513 else
8514   cat > conftest.$ac_ext <<EOF
8515 #line 8516 "configure"
8516 #include "confdefs.h"
8517 /* System header to define __stub macros and hopefully few prototypes,
8518     which can conflict with char $ac_func(); below.  */
8519 #include <assert.h>
8520 /* Override any gcc2 internal prototype to avoid an error.  */
8521 /* We use char because int might match the return type of a gcc2
8522     builtin and then its argument prototype would still apply.  */
8523 char $ac_func();
8524
8525 int main() {
8526
8527 /* The GNU C library defines this for functions which it implements
8528     to always fail with ENOSYS.  Some functions are actually named
8529     something starting with __ and the normal name is an alias.  */
8530 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8531 choke me
8532 #else
8533 $ac_func();
8534 #endif
8535
8536 ; return 0; }
8537 EOF
8538 if { (eval echo configure:8539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8539   rm -rf conftest*
8540   eval "ac_cv_func_$ac_func=yes"
8541 else
8542   echo "configure: failed program was:" >&5
8543   cat conftest.$ac_ext >&5
8544   rm -rf conftest*
8545   eval "ac_cv_func_$ac_func=no"
8546 fi
8547 rm -f conftest*
8548 fi
8549
8550 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8551   echo "$ac_t""yes" 1>&6
8552     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8553   cat >> confdefs.h <<EOF
8554 #define $ac_tr_func 1
8555 EOF
8556  
8557 else
8558   echo "$ac_t""no" 1>&6
8559 fi
8560 done
8561
8562 for ac_func in iswgraph iswlower iswprint iswpunct iswspace iswupper
8563 do
8564 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8565 echo "configure:8566: checking for $ac_func" >&5
8566 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8567   echo $ac_n "(cached) $ac_c" 1>&6
8568 else
8569   cat > conftest.$ac_ext <<EOF
8570 #line 8571 "configure"
8571 #include "confdefs.h"
8572 /* System header to define __stub macros and hopefully few prototypes,
8573     which can conflict with char $ac_func(); below.  */
8574 #include <assert.h>
8575 /* Override any gcc2 internal prototype to avoid an error.  */
8576 /* We use char because int might match the return type of a gcc2
8577     builtin and then its argument prototype would still apply.  */
8578 char $ac_func();
8579
8580 int main() {
8581
8582 /* The GNU C library defines this for functions which it implements
8583     to always fail with ENOSYS.  Some functions are actually named
8584     something starting with __ and the normal name is an alias.  */
8585 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8586 choke me
8587 #else
8588 $ac_func();
8589 #endif
8590
8591 ; return 0; }
8592 EOF
8593 if { (eval echo configure:8594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8594   rm -rf conftest*
8595   eval "ac_cv_func_$ac_func=yes"
8596 else
8597   echo "configure: failed program was:" >&5
8598   cat conftest.$ac_ext >&5
8599   rm -rf conftest*
8600   eval "ac_cv_func_$ac_func=no"
8601 fi
8602 rm -f conftest*
8603 fi
8604
8605 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8606   echo "$ac_t""yes" 1>&6
8607     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8608   cat >> confdefs.h <<EOF
8609 #define $ac_tr_func 1
8610 EOF
8611  
8612 else
8613   echo "$ac_t""no" 1>&6
8614 fi
8615 done
8616
8617 for ac_func in iswxdigit towupper towlower
8618 do
8619 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8620 echo "configure:8621: checking for $ac_func" >&5
8621 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8622   echo $ac_n "(cached) $ac_c" 1>&6
8623 else
8624   cat > conftest.$ac_ext <<EOF
8625 #line 8626 "configure"
8626 #include "confdefs.h"
8627 /* System header to define __stub macros and hopefully few prototypes,
8628     which can conflict with char $ac_func(); below.  */
8629 #include <assert.h>
8630 /* Override any gcc2 internal prototype to avoid an error.  */
8631 /* We use char because int might match the return type of a gcc2
8632     builtin and then its argument prototype would still apply.  */
8633 char $ac_func();
8634
8635 int main() {
8636
8637 /* The GNU C library defines this for functions which it implements
8638     to always fail with ENOSYS.  Some functions are actually named
8639     something starting with __ and the normal name is an alias.  */
8640 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8641 choke me
8642 #else
8643 $ac_func();
8644 #endif
8645
8646 ; return 0; }
8647 EOF
8648 if { (eval echo configure:8649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8649   rm -rf conftest*
8650   eval "ac_cv_func_$ac_func=yes"
8651 else
8652   echo "configure: failed program was:" >&5
8653   cat conftest.$ac_ext >&5
8654   rm -rf conftest*
8655   eval "ac_cv_func_$ac_func=no"
8656 fi
8657 rm -f conftest*
8658 fi
8659
8660 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8661   echo "$ac_t""yes" 1>&6
8662     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8663   cat >> confdefs.h <<EOF
8664 #define $ac_tr_func 1
8665 EOF
8666  
8667 else
8668   echo "$ac_t""no" 1>&6
8669 fi
8670 done
8671
8672
8673 echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
8674 echo "configure:8675: checking for mbstate_t" >&5
8675 if eval "test \"`echo '$''{'mutt_cv_mbstate_t'+set}'`\" = set"; then
8676   echo $ac_n "(cached) $ac_c" 1>&6
8677 else
8678   cat > conftest.$ac_ext <<EOF
8679 #line 8680 "configure"
8680 #include "confdefs.h"
8681
8682 #include <stddef.h>
8683 #include <stdlib.h>
8684 #ifdef HAVE_WCHAR_H
8685 #include <wchar.h>
8686 #endif
8687                 
8688 int main() {
8689  mbstate_t s; return 0; 
8690 ; return 0; }
8691 EOF
8692 if { (eval echo configure:8693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8693   rm -rf conftest*
8694   mutt_cv_mbstate_t=yes
8695 else
8696   echo "configure: failed program was:" >&5
8697   cat conftest.$ac_ext >&5
8698   rm -rf conftest*
8699   mutt_cv_mbstate_t=no
8700 fi
8701 rm -f conftest*
8702 fi
8703
8704 echo "$ac_t""$mutt_cv_mbstate_t" 1>&6
8705
8706 if test "$mutt_cv_mbstate_t" = no; then
8707         cat >> confdefs.h <<\EOF
8708 #define mbstate_t int
8709 EOF
8710
8711 fi
8712
8713 wc_funcs=maybe
8714 # Check whether --with-wc-funcs or --without-wc-funcs was given.
8715 if test "${with_wc_funcs+set}" = set; then
8716   withval="$with_wc_funcs"
8717   wc_funcs=$withval
8718 fi
8719
8720
8721 if test "$wc_funcs" != yes -a "$wc_funcs" != no; then
8722         echo $ac_n "checking for wchar_t functions""... $ac_c" 1>&6
8723 echo "configure:8724: checking for wchar_t functions" >&5
8724 if eval "test \"`echo '$''{'mutt_cv_wc_funcs'+set}'`\" = set"; then
8725   echo $ac_n "(cached) $ac_c" 1>&6
8726 else
8727   mutt_cv_wc_funcs=no
8728                 cat > conftest.$ac_ext <<EOF
8729 #line 8730 "configure"
8730 #include "confdefs.h"
8731
8732 #define _XOPEN_SOURCE 1
8733 #include <stddef.h>
8734 #include <stdlib.h>
8735 #ifdef HAVE_WCTYPE_H
8736 #include <wctype.h>
8737 #endif
8738 #ifdef HAVE_WCHAR_H
8739 #include <wchar.h>
8740 #endif
8741 int main() {
8742 mbrtowc(0, 0, 0, 0); wctomb(0, 0); wcwidth(0);
8743         iswprint(0); iswspace(0); towlower(0); towupper(0); iswalnum(0)
8744 ; return 0; }
8745 EOF
8746 if { (eval echo configure:8747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8747   rm -rf conftest*
8748   mutt_cv_wc_funcs=yes
8749 else
8750   echo "configure: failed program was:" >&5
8751   cat conftest.$ac_ext >&5
8752 fi
8753 rm -f conftest*
8754 fi
8755
8756 echo "$ac_t""$mutt_cv_wc_funcs" 1>&6
8757         wc_funcs=$mutt_cv_wc_funcs
8758 fi
8759
8760 if test $wc_funcs = yes; then
8761         cat >> confdefs.h <<\EOF
8762 #define HAVE_WC_FUNCS 1
8763 EOF
8764
8765 fi
8766
8767 echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
8768 echo "configure:8769: checking for nl_langinfo and CODESET" >&5
8769 if eval "test \"`echo '$''{'mutt_cv_langinfo_codeset'+set}'`\" = set"; then
8770   echo $ac_n "(cached) $ac_c" 1>&6
8771 else
8772   cat > conftest.$ac_ext <<EOF
8773 #line 8774 "configure"
8774 #include "confdefs.h"
8775 #include <langinfo.h>
8776 int main() {
8777 char* cs = nl_langinfo(CODESET);
8778 ; return 0; }
8779 EOF
8780 if { (eval echo configure:8781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8781   rm -rf conftest*
8782   mutt_cv_langinfo_codeset=yes
8783 else
8784   echo "configure: failed program was:" >&5
8785   cat conftest.$ac_ext >&5
8786   rm -rf conftest*
8787   mutt_cv_langinfo_codeset=no
8788 fi
8789 rm -f conftest*
8790 fi
8791
8792 echo "$ac_t""$mutt_cv_langinfo_codeset" 1>&6
8793 if test $mutt_cv_langinfo_codeset = yes; then
8794   cat >> confdefs.h <<\EOF
8795 #define HAVE_LANGINFO_CODESET 1
8796 EOF
8797
8798 fi
8799
8800 echo $ac_n "checking for nl_langinfo and YESEXPR""... $ac_c" 1>&6
8801 echo "configure:8802: checking for nl_langinfo and YESEXPR" >&5
8802 if eval "test \"`echo '$''{'mutt_cv_langinfo_yesexpr'+set}'`\" = set"; then
8803   echo $ac_n "(cached) $ac_c" 1>&6
8804 else
8805   cat > conftest.$ac_ext <<EOF
8806 #line 8807 "configure"
8807 #include "confdefs.h"
8808 #include <langinfo.h>
8809 int main() {
8810 char* cs = nl_langinfo(YESEXPR);
8811 ; return 0; }
8812 EOF
8813 if { (eval echo configure:8814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8814   rm -rf conftest*
8815   mutt_cv_langinfo_yesexpr=yes
8816 else
8817   echo "configure: failed program was:" >&5
8818   cat conftest.$ac_ext >&5
8819   rm -rf conftest*
8820   mutt_cv_langinfo_yesexpr=no
8821 fi
8822 rm -f conftest*
8823 fi
8824
8825 echo "$ac_t""$mutt_cv_langinfo_yesexpr" 1>&6
8826 if test $mutt_cv_langinfo_yesexpr = yes; then
8827   cat >> confdefs.h <<\EOF
8828 #define HAVE_LANGINFO_YESEXPR 1
8829 EOF
8830
8831 fi
8832
8833
8834   # Check whether --with-libesmtp or --without-libesmtp was given.
8835 if test "${with_libesmtp+set}" = set; then
8836   withval="$with_libesmtp"
8837    if test "$with_libesmtp" != "no"
8838       then
8839         mutt_libesmtp_check_path="$PATH"
8840
8841         if test "$with_libesmtp" != "yes"
8842         then
8843           mutt_libesmtp_check_path="$tmp_path:$withval/bin"
8844         fi
8845
8846                 # Extract the first word of "libesmtp-config", so it can be a program name with args.
8847 set dummy libesmtp-config; ac_word=$2
8848 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8849 echo "configure:8850: checking for $ac_word" >&5
8850 if eval "test \"`echo '$''{'ac_cv_path_mutt_libesmtp_config_path'+set}'`\" = set"; then
8851   echo $ac_n "(cached) $ac_c" 1>&6
8852 else
8853   case "$mutt_libesmtp_config_path" in
8854   /*)
8855   ac_cv_path_mutt_libesmtp_config_path="$mutt_libesmtp_config_path" # Let the user override the test with a path.
8856   ;;
8857   ?:/*)                  
8858   ac_cv_path_mutt_libesmtp_config_path="$mutt_libesmtp_config_path" # Let the user override the test with a dos path.
8859   ;;
8860   *)
8861   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8862   ac_dummy="$mutt_libesmtp_check_path"
8863   for ac_dir in $ac_dummy; do 
8864     test -z "$ac_dir" && ac_dir=.
8865     if test -f $ac_dir/$ac_word; then
8866       ac_cv_path_mutt_libesmtp_config_path="$ac_dir/$ac_word"
8867       break
8868     fi
8869   done
8870   IFS="$ac_save_ifs"
8871   test -z "$ac_cv_path_mutt_libesmtp_config_path" && ac_cv_path_mutt_libesmtp_config_path="no"
8872   ;;
8873 esac
8874 fi
8875 mutt_libesmtp_config_path="$ac_cv_path_mutt_libesmtp_config_path"
8876 if test -n "$mutt_libesmtp_config_path"; then
8877   echo "$ac_t""$mutt_libesmtp_config_path" 1>&6
8878 else
8879   echo "$ac_t""no" 1>&6
8880 fi
8881
8882
8883         if test "$mutt_libesmtp_config_path" = "no"
8884         then
8885           { echo "configure: error: libesmtp-config binary not found." 1>&2; exit 1; }
8886         fi
8887
8888                 mutt_libesmtp_cflags=`$mutt_libesmtp_config_path --cflags`
8889         mutt_libesmtp_libs=`$mutt_libesmtp_config_path --libs`
8890
8891                 temp_CFLAGS="$CFLAGS"
8892         CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
8893         ac_safe=`echo "libesmtp.h" | sed 'y%./+-%__p_%'`
8894 echo $ac_n "checking for libesmtp.h""... $ac_c" 1>&6
8895 echo "configure:8896: checking for libesmtp.h" >&5
8896 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8897   echo $ac_n "(cached) $ac_c" 1>&6
8898 else
8899   cat > conftest.$ac_ext <<EOF
8900 #line 8901 "configure"
8901 #include "confdefs.h"
8902 #include <libesmtp.h>
8903 EOF
8904 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8905 { (eval echo configure:8906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8906 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8907 if test -z "$ac_err"; then
8908   rm -rf conftest*
8909   eval "ac_cv_header_$ac_safe=yes"
8910 else
8911   echo "$ac_err" >&5
8912   echo "configure: failed program was:" >&5
8913   cat conftest.$ac_ext >&5
8914   rm -rf conftest*
8915   eval "ac_cv_header_$ac_safe=no"
8916 fi
8917 rm -f conftest*
8918 fi
8919 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8920   echo "$ac_t""yes" 1>&6
8921   :
8922 else
8923   echo "$ac_t""no" 1>&6
8924 { echo "configure: error: Could not find libesmtp.h" 1>&2; exit 1; }
8925 fi
8926
8927         CFLAGS="$temp_CFLAGS"
8928
8929                 temp_CFLAGS="$CFLAGS"
8930         temp_LIBS="$LIBS"
8931         CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
8932         LIBS="$LIBS $mutt_libesmtp_libs"
8933         echo $ac_n "checking for smtp_create_session in -lesmtp""... $ac_c" 1>&6
8934 echo "configure:8935: checking for smtp_create_session in -lesmtp" >&5
8935 ac_lib_var=`echo esmtp'_'smtp_create_session | sed 'y%./+-%__p_%'`
8936 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8937   echo $ac_n "(cached) $ac_c" 1>&6
8938 else
8939   ac_save_LIBS="$LIBS"
8940 LIBS="-lesmtp  $LIBS"
8941 cat > conftest.$ac_ext <<EOF
8942 #line 8943 "configure"
8943 #include "confdefs.h"
8944 /* Override any gcc2 internal prototype to avoid an error.  */
8945 /* We use char because int might match the return type of a gcc2
8946     builtin and then its argument prototype would still apply.  */
8947 char smtp_create_session();
8948
8949 int main() {
8950 smtp_create_session()
8951 ; return 0; }
8952 EOF
8953 if { (eval echo configure:8954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8954   rm -rf conftest*
8955   eval "ac_cv_lib_$ac_lib_var=yes"
8956 else
8957   echo "configure: failed program was:" >&5
8958   cat conftest.$ac_ext >&5
8959   rm -rf conftest*
8960   eval "ac_cv_lib_$ac_lib_var=no"
8961 fi
8962 rm -f conftest*
8963 LIBS="$ac_save_LIBS"
8964
8965 fi
8966 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8967   echo "$ac_t""yes" 1>&6
8968     ac_tr_lib=HAVE_LIB`echo esmtp | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8969     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8970   cat >> confdefs.h <<EOF
8971 #define $ac_tr_lib 1
8972 EOF
8973
8974   LIBS="-lesmtp $LIBS"
8975
8976 else
8977   echo "$ac_t""no" 1>&6
8978 { echo "configure: error: Could not find libesmtp" 1>&2; exit 1; }
8979 fi
8980
8981         CFLAGS="$temp_CFLAGS"
8982         LIBS="$temp_LIBS"
8983
8984                         use_libesmtp=yes
8985       fi
8986     
8987   
8988 fi
8989
8990
8991 if test x$use_libesmtp = xyes; then
8992     CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
8993     MUTTLIBS="$MUTTLIBS $mutt_libesmtp_libs"
8994     MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_libesmtp.o"
8995
8996     cat >> confdefs.h <<\EOF
8997 #define USE_LIBESMTP 1
8998 EOF
8999
9000 fi
9001
9002 trap '' 1 2 15
9003 cat > confcache <<\EOF
9004 # This file is a shell script that caches the results of configure
9005 # tests run on this system so they can be shared between configure
9006 # scripts and configure runs.  It is not useful on other systems.
9007 # If it contains results you don't want to keep, you may remove or edit it.
9008 #
9009 # By default, configure uses ./config.cache as the cache file,
9010 # creating it if it does not exist already.  You can give configure
9011 # the --cache-file=FILE option to use a different cache file; that is
9012 # what configure does when it calls configure scripts in
9013 # subdirectories, so they share the cache.
9014 # Giving --cache-file=/dev/null disables caching, for debugging configure.
9015 # config.status only pays attention to the cache file if you give it the
9016 # --recheck option to rerun configure.
9017 #
9018 EOF
9019 # The following way of writing the cache mishandles newlines in values,
9020 # but we know of no workaround that is simple, portable, and efficient.
9021 # So, don't put newlines in cache variables' values.
9022 # Ultrix sh set writes to stderr and can't be redirected directly,
9023 # and sets the high bit in the cache file unless we assign to the vars.
9024 (set) 2>&1 |
9025   case `(ac_space=' '; set | grep ac_space) 2>&1` in
9026   *ac_space=\ *)
9027     # `set' does not quote correctly, so add quotes (double-quote substitution
9028     # turns \\\\ into \\, and sed turns \\ into \).
9029     sed -n \
9030       -e "s/'/'\\\\''/g" \
9031       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
9032     ;;
9033   *)
9034     # `set' quotes correctly as required by POSIX, so do not add quotes.
9035     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
9036     ;;
9037   esac >> confcache
9038 if cmp -s $cache_file confcache; then
9039   :
9040 else
9041   if test -w $cache_file; then
9042     echo "updating cache $cache_file"
9043     cat confcache > $cache_file
9044   else
9045     echo "not updating unwritable cache $cache_file"
9046   fi
9047 fi
9048 rm -f confcache
9049
9050 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
9051
9052 test "x$prefix" = xNONE && prefix=$ac_default_prefix
9053 # Let make expand exec_prefix.
9054 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
9055
9056 # Any assignment to VPATH causes Sun make to only execute
9057 # the first set of double-colon rules, so remove it if not needed.
9058 # If there is a colon in the path, we need to keep it.
9059 if test "x$srcdir" = x.; then
9060   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
9061 fi
9062
9063 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
9064
9065 DEFS=-DHAVE_CONFIG_H
9066
9067 # Without the "./", some shells look in PATH for config.status.
9068 : ${CONFIG_STATUS=./config.status}
9069
9070 echo creating $CONFIG_STATUS
9071 rm -f $CONFIG_STATUS
9072 cat > $CONFIG_STATUS <<EOF
9073 #! /bin/sh
9074 # Generated automatically by configure.
9075 # Run this file to recreate the current configuration.
9076 # This directory was configured as follows,
9077 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
9078 #
9079 # $0 $ac_configure_args
9080 #
9081 # Compiler output produced by configure, useful for debugging
9082 # configure, is in ./config.log if it exists.
9083
9084 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
9085 for ac_option
9086 do
9087   case "\$ac_option" in
9088   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
9089     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
9090     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
9091   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
9092     echo "$CONFIG_STATUS generated by autoconf version 2.13"
9093     exit 0 ;;
9094   -help | --help | --hel | --he | --h)
9095     echo "\$ac_cs_usage"; exit 0 ;;
9096   *) echo "\$ac_cs_usage"; exit 1 ;;
9097   esac
9098 done
9099
9100 ac_given_srcdir=$srcdir
9101 ac_given_INSTALL="$INSTALL"
9102
9103 trap 'rm -fr `echo "Makefile intl/Makefile m4/Makefile
9104         po/Makefile.in doc/Makefile contrib/Makefile
9105         muttbug.sh
9106         imap/Makefile
9107         Muttngrc.head
9108         doc/instdoc.sh config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
9109 EOF
9110 cat >> $CONFIG_STATUS <<EOF
9111
9112 # Protect against being on the right side of a sed subst in config.status.
9113 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
9114  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
9115 $ac_vpsub
9116 $extrasub
9117 s%@SHELL@%$SHELL%g
9118 s%@CFLAGS@%$CFLAGS%g
9119 s%@CPPFLAGS@%$CPPFLAGS%g
9120 s%@CXXFLAGS@%$CXXFLAGS%g
9121 s%@FFLAGS@%$FFLAGS%g
9122 s%@DEFS@%$DEFS%g
9123 s%@LDFLAGS@%$LDFLAGS%g
9124 s%@LIBS@%$LIBS%g
9125 s%@exec_prefix@%$exec_prefix%g
9126 s%@prefix@%$prefix%g
9127 s%@program_transform_name@%$program_transform_name%g
9128 s%@bindir@%$bindir%g
9129 s%@sbindir@%$sbindir%g
9130 s%@libexecdir@%$libexecdir%g
9131 s%@datadir@%$datadir%g
9132 s%@sysconfdir@%$sysconfdir%g
9133 s%@sharedstatedir@%$sharedstatedir%g
9134 s%@localstatedir@%$localstatedir%g
9135 s%@libdir@%$libdir%g
9136 s%@includedir@%$includedir%g
9137 s%@oldincludedir@%$oldincludedir%g
9138 s%@infodir@%$infodir%g
9139 s%@mandir@%$mandir%g
9140 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
9141 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
9142 s%@INSTALL_DATA@%$INSTALL_DATA%g
9143 s%@PACKAGE@%$PACKAGE%g
9144 s%@VERSION@%$VERSION%g
9145 s%@ACLOCAL@%$ACLOCAL%g
9146 s%@AUTOCONF@%$AUTOCONF%g
9147 s%@AUTOMAKE@%$AUTOMAKE%g
9148 s%@AUTOHEADER@%$AUTOHEADER%g
9149 s%@MAKEINFO@%$MAKEINFO%g
9150 s%@SET_MAKE@%$SET_MAKE%g
9151 s%@host@%$host%g
9152 s%@host_alias@%$host_alias%g
9153 s%@host_cpu@%$host_cpu%g
9154 s%@host_vendor@%$host_vendor%g
9155 s%@host_os@%$host_os%g
9156 s%@CC@%$CC%g
9157 s%@CPP@%$CPP%g
9158 s%@U@%$U%g
9159 s%@ANSI2KNR@%$ANSI2KNR%g
9160 s%@RANLIB@%$RANLIB%g
9161 s%@build@%$build%g
9162 s%@build_alias@%$build_alias%g
9163 s%@build_cpu@%$build_cpu%g
9164 s%@build_vendor@%$build_vendor%g
9165 s%@build_os@%$build_os%g
9166 s%@AR@%$AR%g
9167 s%@DBX@%$DBX%g
9168 s%@GDB@%$GDB%g
9169 s%@SDB@%$SDB%g
9170 s%@DEBUGGER@%$DEBUGGER%g
9171 s%@SENDMAIL@%$SENDMAIL%g
9172 s%@OPS@%$OPS%g
9173 s%@PGPAUX_TARGET@%$PGPAUX_TARGET%g
9174 s%@SMIMEAUX_TARGET@%$SMIMEAUX_TARGET%g
9175 s%@SUBVERSION@%$SUBVERSION%g
9176 s%@ISPELL@%$ISPELL%g
9177 s%@LIBOBJS@%$LIBOBJS%g
9178 s%@DOTLOCK_TARGET@%$DOTLOCK_TARGET%g
9179 s%@docdir@%$docdir%g
9180 s%@DOTLOCK_GROUP@%$DOTLOCK_GROUP%g
9181 s%@DOTLOCK_PERMISSION@%$DOTLOCK_PERMISSION%g
9182 s%@BUILD_IMAP_TRUE@%$BUILD_IMAP_TRUE%g
9183 s%@BUILD_IMAP_FALSE@%$BUILD_IMAP_FALSE%g
9184 s%@KRB5CFGPATH@%$KRB5CFGPATH%g
9185 s%@USE_GSS_TRUE@%$USE_GSS_TRUE%g
9186 s%@USE_GSS_FALSE@%$USE_GSS_FALSE%g
9187 s%@USE_SSL_TRUE@%$USE_SSL_TRUE%g
9188 s%@USE_SSL_FALSE@%$USE_SSL_FALSE%g
9189 s%@USE_GNUTLS_TRUE@%$USE_GNUTLS_TRUE%g
9190 s%@USE_GNUTLS_FALSE@%$USE_GNUTLS_FALSE%g
9191 s%@USE_SASL_TRUE@%$USE_SASL_TRUE%g
9192 s%@USE_SASL_FALSE@%$USE_SASL_FALSE%g
9193 s%@MUTTLIBS@%$MUTTLIBS%g
9194 s%@MUTT_LIB_OBJECTS@%$MUTT_LIB_OBJECTS%g
9195 s%@LIBIMAP@%$LIBIMAP%g
9196 s%@LIBIMAPDEPS@%$LIBIMAPDEPS%g
9197 s%@ALLOCA@%$ALLOCA%g
9198 s%@GLIBC21@%$GLIBC21%g
9199 s%@LIBICONV@%$LIBICONV%g
9200 s%@USE_NLS@%$USE_NLS%g
9201 s%@MSGFMT@%$MSGFMT%g
9202 s%@GMSGFMT@%$GMSGFMT%g
9203 s%@XGETTEXT@%$XGETTEXT%g
9204 s%@INTLBISON@%$INTLBISON%g
9205 s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g
9206 s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
9207 s%@CATALOGS@%$CATALOGS%g
9208 s%@CATOBJEXT@%$CATOBJEXT%g
9209 s%@GMOFILES@%$GMOFILES%g
9210 s%@INTLLIBS@%$INTLLIBS%g
9211 s%@INTLOBJS@%$INTLOBJS%g
9212 s%@POFILES@%$POFILES%g
9213 s%@POSUB@%$POSUB%g
9214 s%@DATADIRNAME@%$DATADIRNAME%g
9215 s%@INSTOBJEXT@%$INSTOBJEXT%g
9216 s%@GENCAT@%$GENCAT%g
9217 s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
9218 s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g
9219 s%@mutt_libesmtp_config_path@%$mutt_libesmtp_config_path%g
9220
9221 CEOF
9222 EOF
9223
9224 cat >> $CONFIG_STATUS <<\EOF
9225
9226 # Split the substitutions into bite-sized pieces for seds with
9227 # small command number limits, like on Digital OSF/1 and HP-UX.
9228 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
9229 ac_file=1 # Number of current file.
9230 ac_beg=1 # First line for current file.
9231 ac_end=$ac_max_sed_cmds # Line after last line for current file.
9232 ac_more_lines=:
9233 ac_sed_cmds=""
9234 while $ac_more_lines; do
9235   if test $ac_beg -gt 1; then
9236     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
9237   else
9238     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
9239   fi
9240   if test ! -s conftest.s$ac_file; then
9241     ac_more_lines=false
9242     rm -f conftest.s$ac_file
9243   else
9244     if test -z "$ac_sed_cmds"; then
9245       ac_sed_cmds="sed -f conftest.s$ac_file"
9246     else
9247       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
9248     fi
9249     ac_file=`expr $ac_file + 1`
9250     ac_beg=$ac_end
9251     ac_end=`expr $ac_end + $ac_max_sed_cmds`
9252   fi
9253 done
9254 if test -z "$ac_sed_cmds"; then
9255   ac_sed_cmds=cat
9256 fi
9257 EOF
9258
9259 cat >> $CONFIG_STATUS <<EOF
9260
9261 CONFIG_FILES=\${CONFIG_FILES-"Makefile intl/Makefile m4/Makefile
9262         po/Makefile.in doc/Makefile contrib/Makefile
9263         muttbug.sh
9264         imap/Makefile
9265         Muttngrc.head
9266         doc/instdoc.sh"}
9267 EOF
9268 cat >> $CONFIG_STATUS <<\EOF
9269 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
9270   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9271   case "$ac_file" in
9272   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9273        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9274   *) ac_file_in="${ac_file}.in" ;;
9275   esac
9276
9277   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
9278
9279   # Remove last slash and all that follows it.  Not all systems have dirname.
9280   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9281   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9282     # The file is in a subdirectory.
9283     test ! -d "$ac_dir" && mkdir "$ac_dir"
9284     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
9285     # A "../" for each directory in $ac_dir_suffix.
9286     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
9287   else
9288     ac_dir_suffix= ac_dots=
9289   fi
9290
9291   case "$ac_given_srcdir" in
9292   .)  srcdir=.
9293       if test -z "$ac_dots"; then top_srcdir=.
9294       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
9295   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
9296   *) # Relative path.
9297     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
9298     top_srcdir="$ac_dots$ac_given_srcdir" ;;
9299   esac
9300
9301   case "$ac_given_INSTALL" in
9302   [/$]*) INSTALL="$ac_given_INSTALL" ;;
9303   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
9304   esac
9305
9306   echo creating "$ac_file"
9307   rm -f "$ac_file"
9308   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
9309   case "$ac_file" in
9310   *Makefile*) ac_comsub="1i\\
9311 # $configure_input" ;;
9312   *) ac_comsub= ;;
9313   esac
9314
9315   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9316   sed -e "$ac_comsub
9317 s%@configure_input@%$configure_input%g
9318 s%@srcdir@%$srcdir%g
9319 s%@top_srcdir@%$top_srcdir%g
9320 s%@INSTALL@%$INSTALL%g
9321 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
9322 fi; done
9323 rm -f conftest.s*
9324
9325 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
9326 # NAME is the cpp macro being defined and VALUE is the value it is being given.
9327 #
9328 # ac_d sets the value in "#define NAME VALUE" lines.
9329 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
9330 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
9331 ac_dC='\3'
9332 ac_dD='%g'
9333 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
9334 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9335 ac_uB='\([      ]\)%\1#\2define\3'
9336 ac_uC=' '
9337 ac_uD='\4%g'
9338 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
9339 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9340 ac_eB='$%\1#\2define\3'
9341 ac_eC=' '
9342 ac_eD='%g'
9343
9344 if test "${CONFIG_HEADERS+set}" != set; then
9345 EOF
9346 cat >> $CONFIG_STATUS <<EOF
9347   CONFIG_HEADERS="config.h"
9348 EOF
9349 cat >> $CONFIG_STATUS <<\EOF
9350 fi
9351 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
9352   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9353   case "$ac_file" in
9354   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9355        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9356   *) ac_file_in="${ac_file}.in" ;;
9357   esac
9358
9359   echo creating $ac_file
9360
9361   rm -f conftest.frag conftest.in conftest.out
9362   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9363   cat $ac_file_inputs > conftest.in
9364
9365 EOF
9366
9367 # Transform confdefs.h into a sed script conftest.vals that substitutes
9368 # the proper values into config.h.in to produce config.h.  And first:
9369 # Protect against being on the right side of a sed subst in config.status.
9370 # Protect against being in an unquoted here document in config.status.
9371 rm -f conftest.vals
9372 cat > conftest.hdr <<\EOF
9373 s/[\\&%]/\\&/g
9374 s%[\\$`]%\\&%g
9375 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
9376 s%ac_d%ac_u%gp
9377 s%ac_u%ac_e%gp
9378 EOF
9379 sed -n -f conftest.hdr confdefs.h > conftest.vals
9380 rm -f conftest.hdr
9381
9382 # This sed command replaces #undef with comments.  This is necessary, for
9383 # example, in the case of _POSIX_SOURCE, which is predefined and required
9384 # on some systems where configure will not decide to define it.
9385 cat >> conftest.vals <<\EOF
9386 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
9387 EOF
9388
9389 # Break up conftest.vals because some shells have a limit on
9390 # the size of here documents, and old seds have small limits too.
9391
9392 rm -f conftest.tail
9393 while :
9394 do
9395   ac_lines=`grep -c . conftest.vals`
9396   # grep -c gives empty output for an empty file on some AIX systems.
9397   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
9398   # Write a limited-size here document to conftest.frag.
9399   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
9400   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
9401   echo 'CEOF
9402   sed -f conftest.frag conftest.in > conftest.out
9403   rm -f conftest.in
9404   mv conftest.out conftest.in
9405 ' >> $CONFIG_STATUS
9406   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
9407   rm -f conftest.vals
9408   mv conftest.tail conftest.vals
9409 done
9410 rm -f conftest.vals
9411
9412 cat >> $CONFIG_STATUS <<\EOF
9413   rm -f conftest.frag conftest.h
9414   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
9415   cat conftest.in >> conftest.h
9416   rm -f conftest.in
9417   if cmp -s $ac_file conftest.h 2>/dev/null; then
9418     echo "$ac_file is unchanged"
9419     rm -f conftest.h
9420   else
9421     # Remove last slash and all that follows it.  Not all systems have dirname.
9422       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9423       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9424       # The file is in a subdirectory.
9425       test ! -d "$ac_dir" && mkdir "$ac_dir"
9426     fi
9427     rm -f $ac_file
9428     mv conftest.h $ac_file
9429   fi
9430 fi; done
9431
9432 EOF
9433 cat >> $CONFIG_STATUS <<EOF
9434
9435
9436
9437 EOF
9438 cat >> $CONFIG_STATUS <<\EOF
9439 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
9440 for ac_file in $CONFIG_FILES; do
9441         # Support "outfile[:infile[:infile...]]"
9442         case "$ac_file" in
9443           *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9444         esac
9445         # PO directories have a Makefile.in generated from Makefile.in.in.
9446         case "$ac_file" in */Makefile.in)
9447           # Adjust a relative srcdir.
9448           ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
9449           ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
9450           ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
9451           # In autoconf-2.13 it is called $ac_given_srcdir.
9452           # In autoconf-2.50 it is called $srcdir.
9453           test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
9454           case "$ac_given_srcdir" in
9455             .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
9456             /*) top_srcdir="$ac_given_srcdir" ;;
9457             *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
9458           esac
9459           if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
9460             rm -f "$ac_dir/POTFILES"
9461             test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
9462             sed -e "/^#/d" -e "/^[      ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
9463             test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
9464             sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
9465           fi
9466           ;;
9467         esac
9468       done
9469
9470 exit 0
9471 EOF
9472 chmod +x $CONFIG_STATUS
9473 rm -fr confdefs* $ac_clean_files
9474 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9475