2a4d54f4e745808b0b0ff6ed5052c1db0f640dee
[chise/xemacs-chise.git.1] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.13 
6 #### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
7 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
8 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
9 #### Copyright (C) 1995, 1996 Ben Wing.
10 #### Copyright (C) 2000, 2001 Martin Buchholz.
11 #### Copyright (C) 1998, 1999 J. Kean Johnston.
12
13 ### Don't edit this script!
14 ### This script was automatically generated by the `autoconf' program
15 ### from the file `./configure.in'.
16 ### To rebuild it, execute the command
17 ###     autoconf
18 ### in the this directory.  You must have autoconf version 2.13 or later.
19
20 ### This file is part of XEmacs.
21
22 ### XEmacs is free software; you can redistribute it and/or modify it
23 ### under the terms of the GNU General Public License as published by
24 ### the Free Software Foundation; either version 2, or (at your
25 ### option) any later version.
26
27 ### XEmacs is distributed in the hope that it will be useful, but
28 ### WITHOUT ANY WARRANTY; without even the implied warranty of
29 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
30 ### General Public License for more details.
31
32 ### You should have received a copy of the GNU General Public License
33 ### along with XEmacs; see the file COPYING.  If not, write to the Free
34 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35 ### 02111-1307, USA.
36
37 ### For usage, run `./configure --help'
38 ### For more detailed information on building and installing XEmacs,
39 ### read the file `INSTALL'.
40 ###
41 ### If configure succeeds, it leaves its status in config.status.
42 ### A log of configuration tests can be found in config.log.
43 ### If configure fails after disturbing the status quo,
44 ###     config.status is removed.
45
46 ac_help="$ac_help
47   --with-x                use the X Window System"
48
49
50
51 if test -n "$ZSH_VERSION"; then
52     setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
53   setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
54   setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
55   setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
56       if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
57 elif test -n "$BASH_VERSION"; then
58     set -o posix
59   unset CDPATH
60 else
61   if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
62 fi
63
64 exec_prefix=NONE
65 host=NONE
66 no_create=
67 nonopt=NONE
68 no_recursion=
69 prefix=NONE
70 program_prefix=NONE
71 program_suffix=NONE
72 program_transform_name=s,x,x,
73 silent=
74 site=
75 srcdir=
76 target=NONE
77 verbose=
78 x_includes=NONE
79 x_libraries=NONE
80
81 subdirs=
82 MFLAGS= MAKEFLAGS=
83 SHELL=${CONFIG_SHELL-/bin/sh}
84 ac_max_here_lines=12
85
86 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
87
88 # File descriptor usage:
89 # 0 standard input
90 # 1 file creation
91 # 2 errors and warnings
92 # 3 some systems may open it to /dev/tty
93 # 4 used on the Kubota Titan
94 # 6 checking for... messages and results
95 # 5 compiler messages saved in config.log
96 if test "$silent" = yes; then
97   exec 6>/dev/null
98 else
99   exec 6>&1
100 fi
101 exec 5>./config.log
102
103 echo "\
104 This file contains any messages produced by compilers while
105 running configure, to aid debugging if configure makes a mistake.
106 " 1>&5
107
108 # Strip out --no-create and --no-recursion so they do not pile up.
109 # Also quote any args containing shell metacharacters.
110 ac_configure_args=
111 for ac_arg
112 do
113   case "$ac_arg" in
114   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
115   | --no-cr | --no-c) ;;
116   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
117   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
118   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
119   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
120   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
121   esac
122 done
123
124 # NLS nuisances.
125 # Only set these to C if already set.  These must not be set unconditionally
126 # because not all systems understand e.g. LANG=C (notably SCO).
127 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
128 # Non-C LC_CTYPE values break the ctype check.
129 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
130 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
131 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
132 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
133
134 # confdefs.h avoids OS command line length limits that DEFS can exceed.
135 rm -rf conftest* confdefs.h
136 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
137 echo > confdefs.h
138
139 # A filename unique to this package, relative to the directory that
140 # configure is in, which we can look for to find out if srcdir is correct.
141 ac_unique_file=src/lisp.h
142
143 # Find the source files, if location was not specified.
144 if test -z "$srcdir"; then
145   ac_srcdir_defaulted=yes
146   # Try the directory containing this script, then its parent.
147   ac_prog=$0
148   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
149   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
150   srcdir=$ac_confdir
151   if test ! -r $srcdir/$ac_unique_file; then
152     srcdir=..
153   fi
154 else
155   ac_srcdir_defaulted=no
156 fi
157 if test ! -r $srcdir/$ac_unique_file; then
158   if test "$ac_srcdir_defaulted" = yes; then
159     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
160   else
161     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
162   fi
163 fi
164 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
165
166 # Prefer explicitly selected file to automatically selected ones.
167 if test -z "$CONFIG_SITE"; then
168   if test "x$prefix" != xNONE; then
169     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
170   else
171     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
172   fi
173 fi
174 for ac_site_file in $CONFIG_SITE; do
175   if test -r "$ac_site_file"; then
176     echo "loading site script $ac_site_file"
177     . "$ac_site_file"
178   fi
179 done
180
181
182 ac_ext=c
183 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
184 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
185 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
186 ac_cpp='$CPP '"$xe_cppflags"
187 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
188 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
189 cross_compiling=no
190
191 ac_exeext=
192 ac_objext=o
193 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
194   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
195   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
196     ac_n= ac_c='
197 ' ac_t='        '
198   else
199     ac_n=-n ac_c= ac_t=
200   fi
201 else
202   ac_n= ac_c='\c' ac_t=
203 fi
204
205
206 progname="`echo $0 | sed 's:^\./\./:\./:'`"
207
208
209 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
210 INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
211
212 prefix='/usr/local'
213 exec_prefix='${prefix}'
214 bindir='${exec_prefix}/bin'
215 datadir='${prefix}/lib'
216 statedir='${prefix}/lib'
217 libdir='${exec_prefix}/lib'
218 mandir='${prefix}/man/man1'
219 inststaticdir='${PROGNAME}'
220 instvardir='${PROGNAME}-${version}'
221 infodir='${datadir}/${instvardir}/info'
222 infopath=''
223 install_pp=''
224 lispdir='${datadir}/${instvardir}/lisp'
225 moduledir='${datadir}/${instvardir}/${configuration}/modules'
226 sitelispdir='${datadir}/${inststaticdir}/site-lisp'
227 sitemoduledir='${datadir}/${inststaticdir}/site-modules'
228 pkgdir='${datadir}/${instvardir}/lisp'
229 package_path=''
230 etcdir='${datadir}/${instvardir}/etc'
231 archlibdir='${datadir}/${instvardir}/${configuration}'
232 docdir='${archlibdir}'
233 with_prefix='yes'
234 with_site_lisp='no'
235 with_site_modules='yes'
236 with_menubars=''
237 with_scrollbars=''
238 with_widgets=''
239 with_dialogs=''
240 with_file_coding=''
241 cpp='' cppflags='' libs='' ldflags=''
242 extra_includes=''
243 dynamic=''
244 with_x11=''
245 with_msw=''
246 rel_alloc='default'
247 with_system_malloc='default'
248 with_dlmalloc='default'
249 native_sound_lib=''
250 use_assertions="yes"
251 with_toolbars=""
252 with_tty=""
253 use_union_type="no"
254 with_dnet=""
255 pdump="no"
256 with_dragndrop="no"
257
258
259
260
261 arguments="$@"
262
263 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
264 quoted_arguments=
265 for i in "$@"; do
266    case "$i" in
267    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
268    | --no-cr | --no-c) ;;
269    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
270    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
271    *)
272    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
273    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
274    esac
275 done
276
277 while test $# != 0; do
278   arg="$1"; shift
279   case "$arg" in
280     --no-create|--no-recursion) ;;
281         -* )
282             case "$arg" in
283         -*=*)
284           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
285           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
286           valomitted=no
287         ;;
288                                                                           -*)
289                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
290           val="yes" valomitted=yes
291         ;;
292       esac
293
294             optname="$opt"
295       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
296
297             case "${valomitted}-${opt}" in yes-without_* )
298         opt=`echo $opt | sed 's/without/with/'`
299         valomitted="no" val="no" ;;
300       esac
301
302             case "$opt" in
303
304         with_site_lisp  | \
305         with_prefix     | \
306         with_site_modules | \
307         with_x          | \
308         with_x11        | \
309         with_msw        | \
310         with_gcc        | \
311         dynamic         | \
312         with_ncurses    | \
313         with_dnet       | \
314         with_socks      | \
315         with_dragndrop  | \
316         with_cde        | \
317         with_offix      | \
318         with_gpm        | \
319         with_xpm        | \
320         with_xface      | \
321         with_gif        | \
322         with_jpeg       | \
323         with_png        | \
324         with_tiff       | \
325         with_wmcommand  | \
326         with_xmu        | \
327         with_purify     | \
328         with_quantify   | \
329         with_toolbars   | \
330         with_tty        | \
331         with_xfs        | \
332         with_i18n3      | \
333         with_mule       | \
334         with_file_coding| \
335         with_canna      | \
336         with_wnn        | \
337         with_wnn6       | \
338         with_workshop   | \
339         with_sparcworks | \
340         with_tooltalk   | \
341         with_ldap       | \
342         with_postgresql | \
343         with_pop        | \
344         with_kerberos   | \
345         with_hesiod     | \
346         with_dnet       | \
347         with_infodock   | \
348         external_widget | \
349         verbose         | \
350         extra_verbose   | \
351         usage_tracking  | \
352         use_union_type  | \
353         pdump           | \
354         debug           | \
355         use_assertions  | \
356         memory_usage_stats | \
357         with_clash_detection | \
358         with_modules | \
359         quick_build )
360                   case "$val" in
361             y | ye | yes )      val=yes ;;
362             n | no )            val=no  ;;
363             * ) (echo "$progname: Usage error:"
364 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
365 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
366           esac
367           eval "$opt=\"$val\"" ;;
368
369
370                         srcdir          | \
371         compiler        | \
372         cflags          | \
373         cpp             | \
374         cppflags        | \
375         libs            | \
376         ldflags         | \
377         cache_file      | \
378         native_sound_lib| \
379         site_lisp       | \
380         x_includes      | \
381         x_libraries     | \
382         site_includes   | \
383         site_libraries  | \
384         site_prefixes   | \
385         site_runtime_libraries )
386                   if test "$valomitted" = "yes" ; then
387                     if test "$#" = 0 ; then
388               (echo "$progname: Usage error:"
389 echo " " "The \`--$optname' option requires a value."
390 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
391             fi
392             val="$1"; shift
393           fi
394           eval "$opt=\"$val\""
395         ;;
396
397                 rel_alloc | \
398         with_dlmalloc | \
399         with_debug_malloc  | use_debug_malloc | \
400         with_system_malloc | use_system_malloc )
401           case "$val" in
402             y | ye | yes )      val=yes ;;
403             n | no )            val=no  ;;
404             d | de | def | defa | defau | defaul | default ) val=default ;;
405             * ) (echo "$progname: Usage error:"
406 echo " " "The \`--$optname' option requires one of these values:
407   \`yes', \`no', or \`default'."
408 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
409           esac
410           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
411           eval "$opt=\"$val\""
412         ;;
413
414                 "with_database" )
415           with_database_berkdb=no
416           with_database_dbm=no
417           with_database_gdbm=no
418           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
419             case "$x" in
420               no ) ;;
421               b | be | ber | berk | berkd | berkdb )       with_database_berkdb=yes ;;
422               d | db | dbm )                               with_database_dbm=yes    ;;
423               g | gn | gnu | gnud | gnudb | gnudbm | gdbm) with_database_gdbm=yes   ;;
424               * ) (echo "$progname: Usage error:"
425 echo " " "The \`--$optname' option value
426   must be either \`no' or a comma-separated list
427   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
428 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
429             esac
430           done
431           if test "$with_database_dbm"  = "yes" -a \
432                   "$with_database_gdbm" = "yes"; then
433           (echo "$progname: Usage error:"
434 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
435   with the \`--$optname' option."
436 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
437           fi
438         ;;
439
440                 "with_sound" )
441                           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
442             case "$x" in
443                       n | no | non | none ) new_sdefault=no ;;
444               a | al | all | both ) new_sdefault=yes ;;
445
446               native )       with_native_sound=yes ;;
447               nonative )     with_native_sound=no ;;
448
449               nas )          with_nas_sound=yes ;;
450               nonas )        with_nas_sound=no ;;
451
452               esd )          with_esd_sound=yes ;;
453               noesd )        with_esd_sound=no ;;
454
455               * ) bogus_sound=yes ;;
456             esac
457             if test "$bogus_sound" -o \
458                  \( -n "$new_sdefault" -a -n "$sound_notfirst" \) ; then
459                 types="\`all', \`none', \`(no)native', \`no(nas)', \`(no)esd'."
460                 (echo "$progname: Usage error:"
461 echo " " "Valid types for the \`--$optname' option are:
462   $types.
463 The default is to autodetect all sound support."
464 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
465             elif test -n "$new_sdefault" ; then
466                 with_native_sound=$new_sdefault
467                 with_nas_sound=$new_sdefault
468                 with_esd_sound=$new_sdefault
469                 new_sdefault=   # reset this
470             fi
471             sound_notfirst=true
472           done
473         ;;
474
475                         "with_athena" )
476           case "$val" in
477             xa | xaw )                    val=xaw    ;;
478             3 | 3d | xaw3d )              val=3d     ;;
479                         ne | nex | next | naxtaw)     val=next   ;;
480                         9 | 95 | xaw95 )              val=95     ;;
481             xp | xpm | xawxpm )           val=xpm    ;;
482             * ) (echo "$progname: Usage error:"
483 echo " " "The \`--$optname' option must have one of these values:
484   \`xaw', \`3d', \`next', \`95', or \`xpm'."
485 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
486           esac
487           eval "$opt=\"$val\""
488         ;;
489
490                 "with_xim" )
491           case "$val" in
492             y | ye | yes )                val=yes   ;;
493             n | no | non | none )         val=no    ;;
494             x | xl | xli | xlib )         val=xlib  ;;
495             m | mo | mot | moti | motif ) val=motif ;;
496             * ) (echo "$progname: Usage error:"
497 echo " " "The \`--$optname' option must have one of these values:
498   \`motif', \`xlib', \`yes', or \`no'."
499 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
500           esac
501           eval "$opt=\"$val\""
502         ;;
503
504                 "mail_locking" )
505           case "$val" in
506             lockf )     val=lockf ;;
507             flock )     val=flock ;;
508             file | dot ) val=file  ;;
509             locking )   val=locking  ;;
510             * ) (echo "$progname: Usage error:"
511 echo " " "The \`--$optname' option must have one of these values:
512   \`lockf', \`flock', \`file', \`locking', or \`mmdf'."
513 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
514           esac
515           eval "$opt=\"$val\""
516         ;;
517
518                 "error_checking" )
519                           
520           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
521             case "$x" in
522                       n | no | non | none ) new_default=no ;;
523               a | al | all )        new_default=yes ;;
524
525               extents )       error_check_extents=yes ;;
526               noextents )     error_check_extents=no ;;
527
528               typecheck )     error_check_typecheck=yes ;;
529               notypecheck )   error_check_typecheck=no ;;
530
531               bufpos )        error_check_bufpos=yes ;;
532               nobufpos )      error_check_bufpos=no ;;
533
534               gc )            error_check_gc=yes ;;
535               nogc )          error_check_gc=no ;;
536
537               malloc )        error_check_malloc=yes ;;
538               nomalloc )      error_check_malloc=no ;;
539
540               byte_code )     error_check_byte_code=yes ;;
541               nobyte_code )   error_check_byte_code=no ;;
542
543               glyphs )     error_check_glyphs=yes ;;
544               noglyphs )   error_check_glyphs=no ;;
545
546               * ) bogus_error_check=yes ;;
547             esac
548             if test "$bogus_error_check" -o \
549                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
550                 if test "$error_check_default" = yes ; then
551                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', \`noglyphs' and \`nobyte-code'."
552                 else
553                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'."
554                 fi
555                 (echo "$progname: Usage error:"
556 echo " " "Valid types for the \`--$optname' option are:
557   $types."
558 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
559             elif test -n "$new_default" ; then
560                 error_check_extents=$new_default
561                 error_check_typecheck=$new_default
562                 error_check_bufpos=$new_default
563                 error_check_gc=$new_default
564                 error_check_malloc=$new_default
565                 error_check_byte_code=$new_default
566                 error_check_glyphs=$new_default
567                 new_default=    # reset this
568             fi
569             echeck_notfirst=true
570           done
571         ;;
572
573                                 
574                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
575         mandir | infodir | infopath | lispdir | etcdir | pkgdir | \
576         archlibdir | docdir | package_path )
577                    if test "$valomitted" = "yes"; then
578              if test "$#" = 0; then
579                  (echo "$progname: Usage error:"
580 echo " " "The \`--$optname' option requires a value."
581 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
582              fi
583              val="$1"; shift
584            fi
585            eval "$opt=\"$val\""
586
587                            case "$opt" in
588                      exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
589     Defining EXEC_PREFIX_USER_DEFINED
590 EOF
591 cat >> confdefs.h <<\EOF
592 #define EXEC_PREFIX_USER_DEFINED 1
593 EOF
594 }
595  ;;
596              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
597     Defining LISPDIR_USER_DEFINED
598 EOF
599 cat >> confdefs.h <<\EOF
600 #define LISPDIR_USER_DEFINED 1
601 EOF
602 }
603  ;;
604              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
605     Defining SITELISPDIR_USER_DEFINED
606 EOF
607 cat >> confdefs.h <<\EOF
608 #define SITELISPDIR_USER_DEFINED 1
609 EOF
610 }
611  ;;
612              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
613     Defining MODULEDIR_USER_DEFINED
614 EOF
615 cat >> confdefs.h <<\EOF
616 #define MODULEDIR_USER_DEFINED 1
617 EOF
618 }
619  ;;
620              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
621     Defining ETCDIR_USER_DEFINED
622 EOF
623 cat >> confdefs.h <<\EOF
624 #define ETCDIR_USER_DEFINED 1
625 EOF
626 }
627  ;;
628              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
629     Defining INFODIR_USER_DEFINED
630 EOF
631 cat >> confdefs.h <<\EOF
632 #define INFODIR_USER_DEFINED 1
633 EOF
634 }
635  ;;
636              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
637     Defining INFOPATH_USER_DEFINED
638 EOF
639 cat >> confdefs.h <<\EOF
640 #define INFOPATH_USER_DEFINED 1
641 EOF
642 }
643  ;;
644              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
645     Defining PACKAGE_PATH_USER_DEFINED
646 EOF
647 cat >> confdefs.h <<\EOF
648 #define PACKAGE_PATH_USER_DEFINED 1
649 EOF
650 }
651  ;;
652              datadir )
653                 { test "$extra_verbose" = "yes" && cat << \EOF
654     Defining INFODIR_USER_DEFINED
655 EOF
656 cat >> confdefs.h <<\EOF
657 #define INFODIR_USER_DEFINED 1
658 EOF
659 }
660
661                 { test "$extra_verbose" = "yes" && cat << \EOF
662     Defining LISPDIR_USER_DEFINED
663 EOF
664 cat >> confdefs.h <<\EOF
665 #define LISPDIR_USER_DEFINED 1
666 EOF
667 }
668
669                 { test "$extra_verbose" = "yes" && cat << \EOF
670     Defining MODULEDIR_USER_DEFINED
671 EOF
672 cat >> confdefs.h <<\EOF
673 #define MODULEDIR_USER_DEFINED 1
674 EOF
675 }
676
677                 { test "$extra_verbose" = "yes" && cat << \EOF
678     Defining ETCDIR_USER_DEFINED
679 EOF
680 cat >> confdefs.h <<\EOF
681 #define ETCDIR_USER_DEFINED 1
682 EOF
683 }
684
685                 { test "$extra_verbose" = "yes" && cat << \EOF
686     Defining DOCDIR_USER_DEFINED
687 EOF
688 cat >> confdefs.h <<\EOF
689 #define DOCDIR_USER_DEFINED 1
690 EOF
691 }
692
693                 { test "$extra_verbose" = "yes" && cat << \EOF
694     Defining ARCHLIBDIR_USER_DEFINED
695 EOF
696 cat >> confdefs.h <<\EOF
697 #define ARCHLIBDIR_USER_DEFINED 1
698 EOF
699 }
700  ;;
701              docdir ) { test "$extra_verbose" = "yes" && cat << \EOF
702     Defining DOCDIR_USER_DEFINED
703 EOF
704 cat >> confdefs.h <<\EOF
705 #define DOCDIR_USER_DEFINED 1
706 EOF
707 }
708  ;;
709              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
710     Defining ARCHLIBDIR_USER_DEFINED
711 EOF
712 cat >> confdefs.h <<\EOF
713 #define ARCHLIBDIR_USER_DEFINED 1
714 EOF
715 }
716  ;;
717            esac
718         ;;
719
720                 "no_create" ) ;;
721
722                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
723
724                 "with_menubars"   | \
725         "with_scrollbars" | \
726         "with_dialogs"    | \
727         "with_widgets" )
728           case "$val" in
729             l | lu | luc | luci | lucid )               val=lucid  ;;
730             m | mo | mot | moti | motif )               val=motif  ;;
731             a | at | ath | athe | athen | athena )      val=athena ;;
732             n | no | non | none )                       val=no     ;;
733             y | ye | yes )                              val=yes    ;;
734             m | ms | msw )                      val=msw    ;;
735             * ) (echo "$progname: Usage error:"
736 echo " " "The \`--$optname' option must have one of these values:
737   \`lucid', \`motif', \`athena', \`yes', or \`no'."
738 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
739           esac
740           eval "$opt=\"$val\""
741         ;;
742
743                 "use_minimal_tagbits" | \
744         "use_indexed_lrecord_implementation" | \
745         "run_in_place"  | \
746         "const_is_losing" | \
747         "with_gnu_make" )
748           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
749         ;;
750
751                 * ) (echo "$progname: Usage error:"
752 echo " " "Unrecognized option: $arg"
753 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
754
755       esac
756     ;;
757
758         *-*-*) configuration="$arg" ;;
759
760         *) (echo "$progname: Usage error:"
761 echo " " "Unrecognized argument: $arg"
762 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
763
764   esac
765 done
766
767
768 test -n "$cpp"      && CPP="$cpp"
769 test -n "$cppflags" && CPPFLAGS="$cppflags"
770 test -n "$libs"     && LIBS="$libs"
771 test -n "$ldflags"  && LDFLAGS="$ldflags"
772
773 eval set x "$quoted_arguments"; shift
774
775 test "$extra_verbose" = "yes" && verbose=yes
776
777 test -n "$with_x" && with_x11="$with_x"
778
779 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
780   test "$with_system_malloc" = "default" && with_system_malloc=yes
781 fi
782
783
784
785 if test "$with_cde $with_tooltalk" = "yes no"; then
786   (echo "$progname: Usage error:"
787 echo " " "--with-cde requires --with-tooltalk"
788 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
789 elif test "$with_tooltalk" = "no" ; then with_cde=no
790 elif test "$with_cde" = "yes"; then with_tooltalk=yes
791 fi
792
793
794 case "$srcdir" in
795
796     "" )
797     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
798       if test -f "$dir/src/lisp.h" -a \
799               -f "$dir/lisp/version.el" ; then
800         srcdir="$dir"
801         break
802       fi
803     done
804     if test -z "$srcdir" ; then
805       (echo "$progname: Usage error:"
806 echo " " "Neither the current directory nor its parent seem to
807   contain the XEmacs sources.  If you do not want to build XEmacs in its
808   source tree, you should run \`$progname' in the directory in which
809   you wish to build XEmacs, using the \`--srcdir' option to say where the
810   sources may be found."
811 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
812     fi
813   ;;
814
815     * )
816     if test ! -f "$srcdir/src/lisp.h" -o \
817             ! -f "$srcdir/lisp/version.el" ; then
818       (echo "$progname: Usage error:"
819 echo " " "The directory specified with the \`--srcdir' option,
820   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
821   either run the \`$progname' script at the top of the XEmacs source
822   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
823 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
824     fi
825   ;;
826 esac
827
828 if test -z "$configuration"; then
829     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
830   if test -z "$configuration"; then
831     (echo "$progname: Usage error:"
832 echo " " "XEmacs has not been ported to this host type.
833 Try explicitly specifying the CONFIGURATION when rerunning configure."
834 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
835   fi
836 fi
837
838 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
839 echo "configure:840: checking whether ln -s works" >&5
840
841 rm -f conftestdata
842 if ln -s X conftestdata 2>/dev/null
843 then
844   rm -f conftestdata
845   ac_cv_prog_LN_S="ln -s"
846 else
847   ac_cv_prog_LN_S=ln
848 fi
849 LN_S="$ac_cv_prog_LN_S"
850 if test "$ac_cv_prog_LN_S" = "ln -s"; then
851   echo "$ac_t""yes" 1>&6
852 else
853   echo "$ac_t""no" 1>&6
854 fi
855
856
857 for dir in lisp etc man info tests; do
858   if test ! -d "$dir" ; then
859     echo Making symbolic link to "$srcdir/$dir"
860     ${LN_S} "$srcdir/$dir" "$dir"
861   fi
862 done
863
864
865 absolute_pwd="`pwd`";
866 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
867 then blddir="$PWD"
868 else blddir="$absolute_pwd"; if test -d "/net"; then
869   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
870   blddir=`echo "$blddir" | \
871    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
872 fi
873 fi
874
875
876 case "$srcdir" in
877   /* ) ;;
878   .  ) srcdir="$blddir" ;;
879   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
880   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
881   srcdir=`echo "$srcdir" | \
882    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
883 fi ;;
884 esac
885
886 if test `pwd` != `sh -c cd $srcdir && pwd`  \
887    && test -f "$srcdir/src/config.h"; then
888   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
889    echo "   as a build directory right now; it has been configured in its own"
890    echo "   right.  To configure in another directory as well, you MUST"
891    echo "   use GNU make.  If you do not have GNU make, then you must"
892    echo "   now do \`make distclean' in $srcdir,"
893    echo "   and then run $progname again.") >&2
894   extrasub='/^VPATH[     ]*=/c\
895 vpath %.c $(srcdir)\
896 vpath %.h $(srcdir)\
897 vpath %.y $(srcdir)\
898 vpath %.l $(srcdir)\
899 vpath %.s $(srcdir)\
900 vpath %.in $(srcdir)'
901 fi
902
903 . "$srcdir/version.sh" || exit 1;
904 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
905 : "${extra_verbose=$beta}"
906 version="${emacs_major_version}.${emacs_minor_version}"
907 { test "$extra_verbose" = "yes" && cat << EOF
908     Defining EMACS_MAJOR_VERSION = $emacs_major_version
909 EOF
910 cat >> confdefs.h <<EOF
911 #define EMACS_MAJOR_VERSION $emacs_major_version
912 EOF
913 }
914
915 { test "$extra_verbose" = "yes" && cat << EOF
916     Defining EMACS_MINOR_VERSION = $emacs_minor_version
917 EOF
918 cat >> confdefs.h <<EOF
919 #define EMACS_MINOR_VERSION $emacs_minor_version
920 EOF
921 }
922
923 if test -n "$emacs_beta_version" ; then
924   if test "$beta" = "yes"; then
925         version="${version}-b${emacs_beta_version}"
926         { test "$extra_verbose" = "yes" && cat << EOF
927     Defining EMACS_BETA_VERSION = $emacs_beta_version
928 EOF
929 cat >> confdefs.h <<EOF
930 #define EMACS_BETA_VERSION $emacs_beta_version
931 EOF
932 }
933
934   else
935         version="${version}.${emacs_beta_version}"
936         { test "$extra_verbose" = "yes" && cat << EOF
937     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
938 EOF
939 cat >> confdefs.h <<EOF
940 #define EMACS_PATCH_LEVEL $emacs_beta_version
941 EOF
942 }
943
944   fi
945 fi
946 { test "$extra_verbose" = "yes" && cat << EOF
947     Defining XEMACS_CODENAME = "$xemacs_codename"
948 EOF
949 cat >> confdefs.h <<EOF
950 #define XEMACS_CODENAME "$xemacs_codename"
951 EOF
952 }
953
954 { test "$extra_verbose" = "yes" && cat << EOF
955     Defining EMACS_VERSION = "$version"
956 EOF
957 cat >> confdefs.h <<EOF
958 #define EMACS_VERSION "$version"
959 EOF
960 }
961
962
963 if test "$with_infodock" = "yes"; then
964   if test ! -f ../../ID-INSTALL; then
965     echo "Cannot build InfoDock without InfoDock sources"
966     with_infodock=no
967   fi
968 fi
969
970 if test "$with_infodock" = "yes"; then
971       { test "$extra_verbose" = "yes" && cat << EOF
972     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
973 EOF
974 cat >> confdefs.h <<EOF
975 #define INFODOCK_MAJOR_VERSION $infodock_major_version
976 EOF
977 }
978
979   { test "$extra_verbose" = "yes" && cat << EOF
980     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
981 EOF
982 cat >> confdefs.h <<EOF
983 #define INFODOCK_MINOR_VERSION $infodock_minor_version
984 EOF
985 }
986
987   { test "$extra_verbose" = "yes" && cat << EOF
988     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
989 EOF
990 cat >> confdefs.h <<EOF
991 #define INFODOCK_BUILD_VERSION $infodock_build_version
992 EOF
993 }
994
995   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
996   PROGNAME=infodock
997   CPPFLAGS="$CPPFLAGS -DINFODOCK"
998 else
999   PROGNAME=xemacs
1000 fi
1001
1002 { test "$extra_verbose" = "yes" && cat << EOF
1003     Defining EMACS_PROGNAME = "$PROGNAME"
1004 EOF
1005 cat >> confdefs.h <<EOF
1006 #define EMACS_PROGNAME "$PROGNAME"
1007 EOF
1008 }
1009
1010
1011 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
1012 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1013     Defining ERROR_CHECK_EXTENTS
1014 EOF
1015 cat >> confdefs.h <<\EOF
1016 #define ERROR_CHECK_EXTENTS 1
1017 EOF
1018 }
1019
1020 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1021     Defining ERROR_CHECK_TYPECHECK
1022 EOF
1023 cat >> confdefs.h <<\EOF
1024 #define ERROR_CHECK_TYPECHECK 1
1025 EOF
1026 }
1027
1028 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1029     Defining ERROR_CHECK_BUFPOS
1030 EOF
1031 cat >> confdefs.h <<\EOF
1032 #define ERROR_CHECK_BUFPOS 1
1033 EOF
1034 }
1035
1036 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1037     Defining ERROR_CHECK_GC
1038 EOF
1039 cat >> confdefs.h <<\EOF
1040 #define ERROR_CHECK_GC 1
1041 EOF
1042 }
1043
1044 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1045     Defining ERROR_CHECK_MALLOC
1046 EOF
1047 cat >> confdefs.h <<\EOF
1048 #define ERROR_CHECK_MALLOC 1
1049 EOF
1050 }
1051
1052 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1053     Defining ERROR_CHECK_BYTE_CODE
1054 EOF
1055 cat >> confdefs.h <<\EOF
1056 #define ERROR_CHECK_BYTE_CODE 1
1057 EOF
1058 }
1059
1060 test "${error_check_glyphs=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1061     Defining ERROR_CHECK_GLYPHS
1062 EOF
1063 cat >> confdefs.h <<\EOF
1064 #define ERROR_CHECK_GLYPHS 1
1065 EOF
1066 }
1067
1068 if test "${debug:=$beta}" = "yes"; then
1069   use_assertions=yes memory_usage_stats=yes
1070   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
1071    echo "    xemacs will be linked with \"debug.o\""
1072  fi
1073   extra_objs="$extra_objs tests.o" &&  if test "$extra_verbose" = "yes"; then
1074    echo "    xemacs will be linked with \"tests.o\""
1075  fi
1076   { test "$extra_verbose" = "yes" && cat << \EOF
1077     Defining DEBUG_XEMACS
1078 EOF
1079 cat >> confdefs.h <<\EOF
1080 #define DEBUG_XEMACS 1
1081 EOF
1082 }
1083
1084 fi
1085 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1086     Defining USE_ASSERTIONS
1087 EOF
1088 cat >> confdefs.h <<\EOF
1089 #define USE_ASSERTIONS 1
1090 EOF
1091 }
1092
1093 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1094     Defining MEMORY_USAGE_STATS
1095 EOF
1096 cat >> confdefs.h <<\EOF
1097 #define MEMORY_USAGE_STATS 1
1098 EOF
1099 }
1100
1101
1102
1103 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1104 echo "configure:1105: checking "host system type"" >&5
1105 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1106 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1107 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1108 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1109 echo "$ac_t""$configuration" 1>&6
1110
1111
1112
1113
1114
1115 machine='' opsys=''
1116
1117 case "$canonical" in
1118   sparc-*-*        ) machine=sparc ;;
1119   alpha*-*-*       ) machine=alpha ;;
1120   vax-*-*          ) machine=vax ;;
1121   mips-dec-*       ) machine=pmax ;;
1122   mips-sgi-irix6*  ) machine=iris6d ;;
1123   mips-sgi-*       ) machine=iris4d ;;
1124   mips*-linux      ) machine=mips ;;
1125   romp-ibm-*       ) machine=ibmrt ;;
1126   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1127   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1128   powerpc*-*       ) machine=powerpc ;;
1129   hppa-*-*         ) machine=hp800 ;;
1130   m88k-dg-*        ) machine=aviion ;;
1131   m68*-sony-*      ) machine=news ;;
1132   mips-sony-*      ) machine=news-risc ;;
1133   clipper-*        ) machine=clipper ;;
1134   arm*             ) machine=arm ;;
1135   ns32k-*          ) machine=ns32000 ;;
1136 esac
1137
1138 case "$canonical" in
1139   *-*-linux*    ) opsys=linux ;;
1140   *-*-netbsd*   ) opsys=netbsd ;;
1141   *-*-openbsd*  ) opsys=openbsd ;;
1142   *-*-nextstep* ) opsys=nextstep ;;
1143   *-*-vms       ) opsys=vms ;;
1144
1145     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1146   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1147   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1148   *-dec-osf3*                ) opsys=decosf3-1 ;;
1149   *-dec-osf[4-9]*          ) opsys=decosf4-0 ;;
1150
1151     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1152   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1153   *-*-ultrix* )         opsys=ultrix4-3 ;;
1154
1155     *-*-aix3.1*  ) opsys=aix3-1 ;;
1156   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1157   *-*-aix3*    ) opsys=aix3-2   ;;
1158   *-*-aix4.0*  ) opsys=aix4     ;;
1159   *-*-aix4.1*  ) opsys=aix4-1   ;;
1160   *-*-aix4*    ) opsys=aix4-2   ;;
1161
1162     *-gnu* )                    opsys=gnu    ;;
1163   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1164   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1165   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1166   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1167   *-*-aos*   )                  opsys=bsd4-3 ;;
1168   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1169   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1170   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1171   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1172   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1173   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1174         if test -z "$NON_GNU_CPP" ; then
1175           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1176             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1177           done
1178         fi
1179         opsys=usg5-4-2 ;;
1180     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1181     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1182 esac
1183
1184 case "$canonical" in
1185
1186     *-*-netbsd* )
1187     case "$canonical" in
1188       i[3-9]86-*-netbsd*) machine=intel386 ;;
1189       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1190                                             machine=hp9000s300 ;;
1191       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1192       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1193     esac
1194   ;;
1195
1196     *-*-openbsd* )
1197     case "${canonical}" in
1198       i386-*-openbsd*)          machine=intel386 ;;
1199       m68k-*-openbsd*)          machine=hp9000s300 ;;
1200       mipsel-*-openbsd*)        machine=pmax ;;
1201      esac
1202    ;;
1203
1204     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1205   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1206
1207     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1208   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1209
1210     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1211
1212     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1213
1214     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1215
1216     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1217
1218     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1219
1220     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1221   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1222   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1223
1224   
1225     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1226
1227     *-convex-bsd* | *-convex-convexos* )
1228     machine=convex opsys=bsd4-3
1229     NON_GNU_CPP="cc -E -P"
1230   ;;
1231
1232     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1233
1234     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1235   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1236   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1237   m88k-dg-dgux*                           ) opsys=dgux     ;;
1238
1239     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1240   m88k-motorola-sysv4* )
1241                     machine=delta88k opsys=usg5-4-2
1242   ;;
1243   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1244
1245     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1246   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1247
1248     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1249
1250     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1251   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1252   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1253
1254       m88k-harris-cxux* )
1255         case "`uname -r`" in
1256        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1257        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1258     esac
1259     NON_GNU_CPP="/lib/cpp"
1260   ;;
1261     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1262     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1263
1264     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1265
1266     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1267
1268     *-hp-hpux* )
1269         case "$canonical" in
1270       m68*  ) machine=hp9000s300 ;;
1271       hppa* ) machine=hp800      ;;
1272     esac
1273
1274     case "$canonical" in
1275       *-hp-hpux7*  )  opsys=hpux   ;;
1276       *-hp-hpux8*  )  opsys=hpux8  ;;
1277       *-hp-hpux9*  )  opsys=hpux9  ;;
1278       *-hp-hpux10* )  opsys=hpux10 ;;
1279       *-hp-hpux11* )  opsys=hpux11 ;;
1280       *            )  opsys=hpux   ;;
1281     esac
1282
1283         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1284    echo "    xemacs will be linked with \"strcat.o\""
1285  fi ;; esac
1286
1287     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1288         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1289     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1290
1291     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1292   ;;
1293
1294     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1295   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1296
1297     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1298   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1299   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1300   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1301   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1302   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1303
1304     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1305   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1306
1307     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1308
1309     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1310
1311     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1312
1313     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1314
1315       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1316
1317     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1318
1319     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1320
1321     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1322
1323     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1324
1325         mips-mips-usg* ) machine=mips4 ;;
1326   mips-mips-riscos4 )
1327     machine=mips4
1328     NON_GNU_CC="cc -systype bsd43"
1329     NON_GNU_CPP="cc -systype bsd43 -E"
1330     case "$canonical" in
1331       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1332       mips-mips-riscos5* ) opsys=riscos5 ;;
1333     esac
1334   ;;
1335   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1336   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1337
1338     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1339
1340     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1341
1342     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1343   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1344
1345     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1346
1347     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1348
1349     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1350
1351     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1352
1353     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1354   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1355
1356     mips-siemens-sysv* | mips-sni-sysv*)
1357     machine=mips-siemens opsys=usg5-4
1358     NON_GNU_CC=/usr/ccs/bin/cc
1359     NON_GNU_CPP=/usr/ccs/lib/cpp
1360   ;;
1361
1362     mips-nec-sysv*)
1363     machine=mips-nec
1364     NON_GNU_CC=/usr/ccs/bin/cc
1365     NON_GNU_CPP=/usr/ccs/lib/cpp
1366   ;;
1367
1368       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1369   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1370     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1371   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1372   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1373   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1374   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1375   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1376   mips-sgi-irix*      ) opsys=irix5-0 ;;
1377
1378     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1379   *-sony-news* ) opsys=newsos5 ;;
1380
1381     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1382
1383     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1384         case "$canonical" in
1385       m68*-sunos1* )             machine=sun1     ;;
1386       m68*-sunos2* )             machine=sun2     ;;
1387       m68* )                     machine=sun3     ;;
1388       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1389       i*86-*-* )                 machine=intel386 ;;
1390       rs6000* )                  machine=rs6000   ;;
1391     esac
1392
1393         case "$canonical" in *-sunos5*)
1394       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1395     esac
1396
1397                     case "$canonical" in
1398       *-sunos4* )
1399         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1400         : ;;
1401       *-solaris2* )
1402         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1403         RANLIB=':' ;;
1404     esac
1405
1406     case "$canonical" in
1407       *-solaris*          )
1408         opsys=sol2
1409         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1410         { test "$extra_verbose" = "yes" && cat << EOF
1411     Defining OS_RELEASE = $os_release
1412 EOF
1413 cat >> confdefs.h <<EOF
1414 #define OS_RELEASE $os_release
1415 EOF
1416 }
1417  ;;
1418
1419             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1420       *-sunos4.0*         ) opsys=sunos4-0      ;;
1421       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1422       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1423       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1424       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1425       *-mach*             ) opsys=mach-bsd4-3   ;;
1426       *                   ) opsys=bsd4-2        ;;
1427     esac
1428
1429     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1430
1431         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1432   ;;
1433
1434     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1435
1436     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1437   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1438
1439     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1440
1441     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1442
1443     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1444       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1445
1446     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1447
1448     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1449
1450     vax-dec-* )
1451     case "$canonical" in
1452       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1453       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1454       *-mach* )                         opsys=mach-bsd4-3 ;;
1455     esac
1456   ;;
1457
1458     ns16k-whitechapel-* ) machine=mg1 ;;
1459
1460     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1461
1462     i[3-9]86-*-* )
1463     machine=intel386
1464     case "$canonical" in
1465       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1466       *-isc2.2* )               opsys=isc2-2 ;;
1467       *-isc4.0* )               opsys=isc4-0 ;;
1468       *-isc4.* )                opsys=isc4-1
1469                                 GCC_TEST_OPTIONS=-posix
1470                                 NON_GCC_TEST_OPTIONS=-Xp
1471                                 ;;
1472       *-isc* )                  opsys=isc3-0 ;;
1473       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1474       *-esix* )                 opsys=esix ;;
1475       *-mach* )                 opsys=mach-bsd4-3 ;;
1476       *-xenix* )                opsys=xenix ;;
1477       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1478       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1479       *-bsdi4* )                opsys=bsdos4 ;;
1480       *-bsdi3* )                opsys=bsdos3 ;;
1481       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1482       *-bsdi2* )                opsys=bsdos2 ;;
1483       *-sco3.2v5* )             opsys=sco5 ;;
1484       *-sysv5* )                opsys=sco7 ;;
1485       *-386bsd* )               opsys=386bsd ;;
1486       *-freebsd* )              opsys=freebsd ;;
1487       *-nextstep* )             opsys=nextstep ;;
1488       *-pc-cygwin* )            opsys=cygwin32 ;;
1489       *-pc-mingw* )             opsys=mingw32 ;
1490                                 test -z "$with_tty" && with_tty="no";;
1491           esac
1492   ;;
1493
1494     m68k-*-linux* ) machine=m68k opsys=linux ;;
1495
1496 esac
1497
1498 test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'`
1499 test -z "$opsys"   && opsys=`echo $canonical | sed 's/^^-*-^-*-//'`
1500
1501 if test -r "${srcdir}/src/m/${machine}.h"; then
1502   machfile="m/${machine}.h"
1503   { test "$extra_verbose" = "yes" && cat << EOF
1504     Defining config_machfile = "$machfile"
1505 EOF
1506 cat >> confdefs.h <<EOF
1507 #define config_machfile "$machfile"
1508 EOF
1509 }
1510
1511 else
1512   echo "XEmacs has no builtin knowledge of \`$machine' machines."
1513   echo "Using configure-time autodetection only."
1514 fi
1515
1516 if test -r "${srcdir}/src/s/${opsys}.h"; then
1517   opsysfile="s/${opsys}.h"
1518   { test "$extra_verbose" = "yes" && cat << EOF
1519     Defining config_opsysfile = "$opsysfile"
1520 EOF
1521 cat >> confdefs.h <<EOF
1522 #define config_opsysfile "$opsysfile"
1523 EOF
1524 }
1525
1526 else
1527   echo "XEmacs has no builtin knowledge of \`$opsys' operating systems."
1528   echo "Using configure-time autodetection only."
1529 fi
1530
1531
1532 if test -z "$dynamic"; then
1533   case "$opsys" in
1534     hpux* | sunos4* ) dynamic=no ;;
1535     *) dynamic=yes ;;
1536   esac
1537 fi
1538 if test "$dynamic" = "yes"; then
1539   case "$opsys" in
1540     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1541     decosf* ) ld_call_shared="-call_shared" ;;
1542   esac
1543 else   case "$opsys" in
1544     sol2 )
1545       echo "Static linking is not supported on Solaris 2."
1546       echo "Rerun configure without specifying --dynamic=no."
1547       exit 1 ;;
1548     linux   ) ld_call_shared="-Bstatic" ;;
1549     decosf* ) ld_call_shared="-non_shared" ;;
1550   esac
1551 fi
1552
1553 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1554
1555 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1556 { test "$extra_verbose" = "yes" && cat << EOF
1557     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1558 EOF
1559 cat >> confdefs.h <<EOF
1560 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1561 EOF
1562 }
1563
1564
1565
1566 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1567 if test "$with_workshop $with_tooltalk" = "yes no"; then
1568   (echo "$progname: Usage error:"
1569 echo " " "--with-workshop requires --with-tooltalk"
1570 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1571 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1572 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1573 fi
1574
1575 if test "$with_workshop" = "yes"; then
1576   { test "$extra_verbose" = "yes" && cat << \EOF
1577     Defining SUNPRO
1578 EOF
1579 cat >> confdefs.h <<\EOF
1580 #define SUNPRO 1
1581 EOF
1582 }
1583
1584   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1585    echo "    xemacs will be linked with \"sunpro.o\""
1586  fi
1587 fi
1588
1589 if test "$with_clash_detection" != "no"; then
1590   { test "$extra_verbose" = "yes" && cat << \EOF
1591     Defining CLASH_DETECTION
1592 EOF
1593 cat >> confdefs.h <<\EOF
1594 #define CLASH_DETECTION 1
1595 EOF
1596 }
1597
1598   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1599    echo "    xemacs will be linked with \"filelock.o\""
1600  fi
1601 fi
1602
1603 test -n "$compiler" && CC="$compiler"
1604 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1605 fi
1606
1607 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1608 if test "${CFLAGS-unset}" != unset
1609   then cflags_specified=yes;
1610   else cflags_specified=no;
1611 fi
1612
1613 xe_save_CFLAGS="$CFLAGS"
1614
1615 # Extract the first word of "gcc", so it can be a program name with args.
1616 set dummy gcc; ac_word=$2
1617 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1618 echo "configure:1619: checking for $ac_word" >&5
1619
1620 if test -n "$CC"; then
1621   ac_cv_prog_CC="$CC" # Let the user override the test.
1622 else
1623   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1624   ac_dummy="$PATH"
1625   for ac_dir in $ac_dummy; do
1626     test -z "$ac_dir" && ac_dir=.
1627     if test -f $ac_dir/$ac_word; then
1628       ac_cv_prog_CC="gcc"
1629       break
1630     fi
1631   done
1632   IFS="$ac_save_ifs"
1633 fi
1634 CC="$ac_cv_prog_CC"
1635 if test -n "$CC"; then
1636   echo "$ac_t""$CC" 1>&6
1637 else
1638   echo "$ac_t""no" 1>&6
1639 fi
1640
1641 if test -z "$CC"; then
1642   # Extract the first word of "cc", so it can be a program name with args.
1643 set dummy cc; ac_word=$2
1644 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1645 echo "configure:1646: checking for $ac_word" >&5
1646
1647 if test -n "$CC"; then
1648   ac_cv_prog_CC="$CC" # Let the user override the test.
1649 else
1650   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1651   ac_prog_rejected=no
1652   ac_dummy="$PATH"
1653   for ac_dir in $ac_dummy; do
1654     test -z "$ac_dir" && ac_dir=.
1655     if test -f $ac_dir/$ac_word; then
1656       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1657         ac_prog_rejected=yes
1658         continue
1659       fi
1660       ac_cv_prog_CC="cc"
1661       break
1662     fi
1663   done
1664   IFS="$ac_save_ifs"
1665 if test $ac_prog_rejected = yes; then
1666   # We found a bogon in the path, so make sure we never use it.
1667   set dummy $ac_cv_prog_CC
1668   shift
1669   if test $# -gt 0; then
1670     # We chose a different compiler from the bogus one.
1671     # However, it has the same basename, so the bogon will be chosen
1672     # first if we set CC to just the basename; use the full file name.
1673     shift
1674     set dummy "$ac_dir/$ac_word" "$@"
1675     shift
1676     ac_cv_prog_CC="$@"
1677   fi
1678 fi
1679 fi
1680 CC="$ac_cv_prog_CC"
1681 if test -n "$CC"; then
1682   echo "$ac_t""$CC" 1>&6
1683 else
1684   echo "$ac_t""no" 1>&6
1685 fi
1686
1687   if test -z "$CC"; then
1688     case "`uname -s`" in
1689     *win32* | *WIN32*)
1690       # Extract the first word of "cl", so it can be a program name with args.
1691 set dummy cl; ac_word=$2
1692 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1693 echo "configure:1694: checking for $ac_word" >&5
1694
1695 if test -n "$CC"; then
1696   ac_cv_prog_CC="$CC" # Let the user override the test.
1697 else
1698   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1699   ac_dummy="$PATH"
1700   for ac_dir in $ac_dummy; do
1701     test -z "$ac_dir" && ac_dir=.
1702     if test -f $ac_dir/$ac_word; then
1703       ac_cv_prog_CC="cl"
1704       break
1705     fi
1706   done
1707   IFS="$ac_save_ifs"
1708 fi
1709 CC="$ac_cv_prog_CC"
1710 if test -n "$CC"; then
1711   echo "$ac_t""$CC" 1>&6
1712 else
1713   echo "$ac_t""no" 1>&6
1714 fi
1715  ;;
1716     esac
1717   fi
1718   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1719 fi
1720
1721 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1722 echo "configure:1723: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1723
1724 ac_ext=c
1725 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1726 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1727 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1728 ac_cpp='$CPP '"$xe_cppflags"
1729 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1730 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1731 cross_compiling=no
1732
1733 cat > conftest.$ac_ext << EOF
1734
1735 #line 1736 "configure"
1736 #include "confdefs.h"
1737
1738 main(){return(0);}
1739 EOF
1740 if { (eval echo configure:1741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1741   ac_cv_prog_cc_works=yes
1742   # If we can't run a trivial program, we are probably using a cross compiler.
1743   if (./conftest; exit) 2>/dev/null; then
1744     ac_cv_prog_cc_cross=no
1745   else
1746     ac_cv_prog_cc_cross=yes
1747   fi
1748 else
1749   echo "configure: failed program was:" >&5
1750   cat conftest.$ac_ext >&5
1751   ac_cv_prog_cc_works=no
1752 fi
1753 rm -fr conftest*
1754 ac_ext=c
1755 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1756 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1757 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1758 ac_cpp='$CPP '"$xe_cppflags"
1759 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1760 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1761 cross_compiling=no
1762
1763 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1764 if test $ac_cv_prog_cc_works = no; then
1765   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1766 fi
1767 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1768 echo "configure:1769: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1769 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1770 cross_compiling=$ac_cv_prog_cc_cross
1771
1772 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1773 echo "configure:1774: checking whether we are using GNU C" >&5
1774
1775 cat > conftest.c <<EOF
1776 #ifdef __GNUC__
1777   yes;
1778 #endif
1779 EOF
1780 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1781   ac_cv_prog_gcc=yes
1782 else
1783   ac_cv_prog_gcc=no
1784 fi
1785
1786 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1787
1788 if test $ac_cv_prog_gcc = yes; then
1789   GCC=yes
1790 else
1791   GCC=
1792 fi
1793
1794 ac_test_CFLAGS="${CFLAGS+set}"
1795 ac_save_CFLAGS="$CFLAGS"
1796 CFLAGS=
1797 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1798 echo "configure:1799: checking whether ${CC-cc} accepts -g" >&5
1799
1800 echo 'void f(){}' > conftest.c
1801 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1802   ac_cv_prog_cc_g=yes
1803 else
1804   ac_cv_prog_cc_g=no
1805 fi
1806 rm -f conftest*
1807
1808
1809 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1810 if test "$ac_test_CFLAGS" = set; then
1811   CFLAGS="$ac_save_CFLAGS"
1812 elif test $ac_cv_prog_cc_g = yes; then
1813   if test "$GCC" = yes; then
1814     CFLAGS="-g -O2"
1815   else
1816     CFLAGS="-g"
1817   fi
1818 else
1819   if test "$GCC" = yes; then
1820     CFLAGS="-O2"
1821   else
1822     CFLAGS=
1823   fi
1824 fi
1825  
1826 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1827   CC=${NON_GNU_CC-cc}
1828   # Extract the first word of "gcc", so it can be a program name with args.
1829 set dummy gcc; ac_word=$2
1830 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1831 echo "configure:1832: checking for $ac_word" >&5
1832
1833 if test -n "$CC"; then
1834   ac_cv_prog_CC="$CC" # Let the user override the test.
1835 else
1836   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1837   ac_dummy="$PATH"
1838   for ac_dir in $ac_dummy; do
1839     test -z "$ac_dir" && ac_dir=.
1840     if test -f $ac_dir/$ac_word; then
1841       ac_cv_prog_CC="gcc"
1842       break
1843     fi
1844   done
1845   IFS="$ac_save_ifs"
1846 fi
1847 CC="$ac_cv_prog_CC"
1848 if test -n "$CC"; then
1849   echo "$ac_t""$CC" 1>&6
1850 else
1851   echo "$ac_t""no" 1>&6
1852 fi
1853
1854 if test -z "$CC"; then
1855   # Extract the first word of "cc", so it can be a program name with args.
1856 set dummy cc; ac_word=$2
1857 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1858 echo "configure:1859: checking for $ac_word" >&5
1859
1860 if test -n "$CC"; then
1861   ac_cv_prog_CC="$CC" # Let the user override the test.
1862 else
1863   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1864   ac_prog_rejected=no
1865   ac_dummy="$PATH"
1866   for ac_dir in $ac_dummy; do
1867     test -z "$ac_dir" && ac_dir=.
1868     if test -f $ac_dir/$ac_word; then
1869       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1870         ac_prog_rejected=yes
1871         continue
1872       fi
1873       ac_cv_prog_CC="cc"
1874       break
1875     fi
1876   done
1877   IFS="$ac_save_ifs"
1878 if test $ac_prog_rejected = yes; then
1879   # We found a bogon in the path, so make sure we never use it.
1880   set dummy $ac_cv_prog_CC
1881   shift
1882   if test $# -gt 0; then
1883     # We chose a different compiler from the bogus one.
1884     # However, it has the same basename, so the bogon will be chosen
1885     # first if we set CC to just the basename; use the full file name.
1886     shift
1887     set dummy "$ac_dir/$ac_word" "$@"
1888     shift
1889     ac_cv_prog_CC="$@"
1890   fi
1891 fi
1892 fi
1893 CC="$ac_cv_prog_CC"
1894 if test -n "$CC"; then
1895   echo "$ac_t""$CC" 1>&6
1896 else
1897   echo "$ac_t""no" 1>&6
1898 fi
1899
1900   if test -z "$CC"; then
1901     case "`uname -s`" in
1902     *win32* | *WIN32*)
1903       # Extract the first word of "cl", so it can be a program name with args.
1904 set dummy cl; ac_word=$2
1905 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1906 echo "configure:1907: checking for $ac_word" >&5
1907
1908 if test -n "$CC"; then
1909   ac_cv_prog_CC="$CC" # Let the user override the test.
1910 else
1911   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1912   ac_dummy="$PATH"
1913   for ac_dir in $ac_dummy; do
1914     test -z "$ac_dir" && ac_dir=.
1915     if test -f $ac_dir/$ac_word; then
1916       ac_cv_prog_CC="cl"
1917       break
1918     fi
1919   done
1920   IFS="$ac_save_ifs"
1921 fi
1922 CC="$ac_cv_prog_CC"
1923 if test -n "$CC"; then
1924   echo "$ac_t""$CC" 1>&6
1925 else
1926   echo "$ac_t""no" 1>&6
1927 fi
1928  ;;
1929     esac
1930   fi
1931   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1932 fi
1933
1934 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1935 echo "configure:1936: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1936
1937 ac_ext=c
1938 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1939 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1940 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1941 ac_cpp='$CPP '"$xe_cppflags"
1942 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1943 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1944 cross_compiling=no
1945
1946 cat > conftest.$ac_ext << EOF
1947
1948 #line 1949 "configure"
1949 #include "confdefs.h"
1950
1951 main(){return(0);}
1952 EOF
1953 if { (eval echo configure:1954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1954   ac_cv_prog_cc_works=yes
1955   # If we can't run a trivial program, we are probably using a cross compiler.
1956   if (./conftest; exit) 2>/dev/null; then
1957     ac_cv_prog_cc_cross=no
1958   else
1959     ac_cv_prog_cc_cross=yes
1960   fi
1961 else
1962   echo "configure: failed program was:" >&5
1963   cat conftest.$ac_ext >&5
1964   ac_cv_prog_cc_works=no
1965 fi
1966 rm -fr conftest*
1967 ac_ext=c
1968 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1969 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1970 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1971 ac_cpp='$CPP '"$xe_cppflags"
1972 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1973 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1974 cross_compiling=no
1975
1976 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1977 if test $ac_cv_prog_cc_works = no; then
1978   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1979 fi
1980 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1981 echo "configure:1982: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1982 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1983 cross_compiling=$ac_cv_prog_cc_cross
1984
1985 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1986 echo "configure:1987: checking whether we are using GNU C" >&5
1987
1988 cat > conftest.c <<EOF
1989 #ifdef __GNUC__
1990   yes;
1991 #endif
1992 EOF
1993 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1994   ac_cv_prog_gcc=yes
1995 else
1996   ac_cv_prog_gcc=no
1997 fi
1998
1999 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2000
2001 if test $ac_cv_prog_gcc = yes; then
2002   GCC=yes
2003 else
2004   GCC=
2005 fi
2006
2007 ac_test_CFLAGS="${CFLAGS+set}"
2008 ac_save_CFLAGS="$CFLAGS"
2009 CFLAGS=
2010 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2011 echo "configure:2012: checking whether ${CC-cc} accepts -g" >&5
2012
2013 echo 'void f(){}' > conftest.c
2014 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2015   ac_cv_prog_cc_g=yes
2016 else
2017   ac_cv_prog_cc_g=no
2018 fi
2019 rm -f conftest*
2020
2021
2022 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2023 if test "$ac_test_CFLAGS" = set; then
2024   CFLAGS="$ac_save_CFLAGS"
2025 elif test $ac_cv_prog_cc_g = yes; then
2026   if test "$GCC" = yes; then
2027     CFLAGS="-g -O2"
2028   else
2029     CFLAGS="-g"
2030   fi
2031 else
2032   if test "$GCC" = yes; then
2033     CFLAGS="-O2"
2034   else
2035     CFLAGS=
2036   fi
2037 fi
2038
2039 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
2040   CC=gcc
2041   # Extract the first word of "gcc", so it can be a program name with args.
2042 set dummy gcc; ac_word=$2
2043 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2044 echo "configure:2045: checking for $ac_word" >&5
2045
2046 if test -n "$CC"; then
2047   ac_cv_prog_CC="$CC" # Let the user override the test.
2048 else
2049   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2050   ac_dummy="$PATH"
2051   for ac_dir in $ac_dummy; do
2052     test -z "$ac_dir" && ac_dir=.
2053     if test -f $ac_dir/$ac_word; then
2054       ac_cv_prog_CC="gcc"
2055       break
2056     fi
2057   done
2058   IFS="$ac_save_ifs"
2059 fi
2060 CC="$ac_cv_prog_CC"
2061 if test -n "$CC"; then
2062   echo "$ac_t""$CC" 1>&6
2063 else
2064   echo "$ac_t""no" 1>&6
2065 fi
2066
2067 if test -z "$CC"; then
2068   # Extract the first word of "cc", so it can be a program name with args.
2069 set dummy cc; ac_word=$2
2070 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2071 echo "configure:2072: checking for $ac_word" >&5
2072
2073 if test -n "$CC"; then
2074   ac_cv_prog_CC="$CC" # Let the user override the test.
2075 else
2076   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2077   ac_prog_rejected=no
2078   ac_dummy="$PATH"
2079   for ac_dir in $ac_dummy; do
2080     test -z "$ac_dir" && ac_dir=.
2081     if test -f $ac_dir/$ac_word; then
2082       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2083         ac_prog_rejected=yes
2084         continue
2085       fi
2086       ac_cv_prog_CC="cc"
2087       break
2088     fi
2089   done
2090   IFS="$ac_save_ifs"
2091 if test $ac_prog_rejected = yes; then
2092   # We found a bogon in the path, so make sure we never use it.
2093   set dummy $ac_cv_prog_CC
2094   shift
2095   if test $# -gt 0; then
2096     # We chose a different compiler from the bogus one.
2097     # However, it has the same basename, so the bogon will be chosen
2098     # first if we set CC to just the basename; use the full file name.
2099     shift
2100     set dummy "$ac_dir/$ac_word" "$@"
2101     shift
2102     ac_cv_prog_CC="$@"
2103   fi
2104 fi
2105 fi
2106 CC="$ac_cv_prog_CC"
2107 if test -n "$CC"; then
2108   echo "$ac_t""$CC" 1>&6
2109 else
2110   echo "$ac_t""no" 1>&6
2111 fi
2112
2113   if test -z "$CC"; then
2114     case "`uname -s`" in
2115     *win32* | *WIN32*)
2116       # Extract the first word of "cl", so it can be a program name with args.
2117 set dummy cl; ac_word=$2
2118 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2119 echo "configure:2120: checking for $ac_word" >&5
2120
2121 if test -n "$CC"; then
2122   ac_cv_prog_CC="$CC" # Let the user override the test.
2123 else
2124   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2125   ac_dummy="$PATH"
2126   for ac_dir in $ac_dummy; do
2127     test -z "$ac_dir" && ac_dir=.
2128     if test -f $ac_dir/$ac_word; then
2129       ac_cv_prog_CC="cl"
2130       break
2131     fi
2132   done
2133   IFS="$ac_save_ifs"
2134 fi
2135 CC="$ac_cv_prog_CC"
2136 if test -n "$CC"; then
2137   echo "$ac_t""$CC" 1>&6
2138 else
2139   echo "$ac_t""no" 1>&6
2140 fi
2141  ;;
2142     esac
2143   fi
2144   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2145 fi
2146
2147 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2148 echo "configure:2149: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2149
2150 ac_ext=c
2151 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2152 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2153 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2154 ac_cpp='$CPP '"$xe_cppflags"
2155 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2156 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2157 cross_compiling=no
2158
2159 cat > conftest.$ac_ext << EOF
2160
2161 #line 2162 "configure"
2162 #include "confdefs.h"
2163
2164 main(){return(0);}
2165 EOF
2166 if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2167   ac_cv_prog_cc_works=yes
2168   # If we can't run a trivial program, we are probably using a cross compiler.
2169   if (./conftest; exit) 2>/dev/null; then
2170     ac_cv_prog_cc_cross=no
2171   else
2172     ac_cv_prog_cc_cross=yes
2173   fi
2174 else
2175   echo "configure: failed program was:" >&5
2176   cat conftest.$ac_ext >&5
2177   ac_cv_prog_cc_works=no
2178 fi
2179 rm -fr conftest*
2180 ac_ext=c
2181 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2182 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2183 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2184 ac_cpp='$CPP '"$xe_cppflags"
2185 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2186 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2187 cross_compiling=no
2188
2189 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2190 if test $ac_cv_prog_cc_works = no; then
2191   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2192 fi
2193 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2194 echo "configure:2195: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2195 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2196 cross_compiling=$ac_cv_prog_cc_cross
2197
2198 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2199 echo "configure:2200: checking whether we are using GNU C" >&5
2200
2201 cat > conftest.c <<EOF
2202 #ifdef __GNUC__
2203   yes;
2204 #endif
2205 EOF
2206 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2207   ac_cv_prog_gcc=yes
2208 else
2209   ac_cv_prog_gcc=no
2210 fi
2211
2212 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2213
2214 if test $ac_cv_prog_gcc = yes; then
2215   GCC=yes
2216 else
2217   GCC=
2218 fi
2219
2220 ac_test_CFLAGS="${CFLAGS+set}"
2221 ac_save_CFLAGS="$CFLAGS"
2222 CFLAGS=
2223 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2224 echo "configure:2225: checking whether ${CC-cc} accepts -g" >&5
2225
2226 echo 'void f(){}' > conftest.c
2227 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2228   ac_cv_prog_cc_g=yes
2229 else
2230   ac_cv_prog_cc_g=no
2231 fi
2232 rm -f conftest*
2233
2234
2235 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2236 if test "$ac_test_CFLAGS" = set; then
2237   CFLAGS="$ac_save_CFLAGS"
2238 elif test $ac_cv_prog_cc_g = yes; then
2239   if test "$GCC" = yes; then
2240     CFLAGS="-g -O2"
2241   else
2242     CFLAGS="-g"
2243   fi
2244 else
2245   if test "$GCC" = yes; then
2246     CFLAGS="-O2"
2247   else
2248     CFLAGS=
2249   fi
2250 fi
2251
2252 fi
2253 CFLAGS="$xe_save_CFLAGS"
2254
2255
2256 test -n "$CPP" -a -d "$CPP" && CPP=
2257
2258 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2259
2260 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2261 echo "configure:2262: checking how to run the C preprocessor" >&5
2262 # On Suns, sometimes $CPP names a directory.
2263 if test -n "$CPP" && test -d "$CPP"; then
2264   CPP=
2265 fi
2266 if test -z "$CPP"; then
2267
2268   # This must be in double quotes, not single quotes, because CPP may get
2269   # substituted into the Makefile and "${CC-cc}" will confuse make.
2270   CPP="${CC-cc} -E"
2271   # On the NeXT, cc -E runs the code through the compiler's parser,
2272   # not just through cpp.
2273   cat > conftest.$ac_ext <<EOF
2274 #line 2275 "configure"
2275 #include "confdefs.h"
2276 #include <assert.h>
2277 Syntax Error
2278 EOF
2279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2280 { (eval echo configure:2281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2282 if test -z "$ac_err"; then
2283   :
2284 else
2285   echo "$ac_err" >&5
2286   echo "configure: failed program was:" >&5
2287   cat conftest.$ac_ext >&5
2288   rm -rf conftest*
2289   CPP="${CC-cc} -E -traditional-cpp"
2290   cat > conftest.$ac_ext <<EOF
2291 #line 2292 "configure"
2292 #include "confdefs.h"
2293 #include <assert.h>
2294 Syntax Error
2295 EOF
2296 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2297 { (eval echo configure:2298: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2298 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2299 if test -z "$ac_err"; then
2300   :
2301 else
2302   echo "$ac_err" >&5
2303   echo "configure: failed program was:" >&5
2304   cat conftest.$ac_ext >&5
2305   rm -rf conftest*
2306   CPP="${CC-cc} -nologo -E"
2307   cat > conftest.$ac_ext <<EOF
2308 #line 2309 "configure"
2309 #include "confdefs.h"
2310 #include <assert.h>
2311 Syntax Error
2312 EOF
2313 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2314 { (eval echo configure:2315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2315 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2316 if test -z "$ac_err"; then
2317   :
2318 else
2319   echo "$ac_err" >&5
2320   echo "configure: failed program was:" >&5
2321   cat conftest.$ac_ext >&5
2322   rm -rf conftest*
2323   CPP=/lib/cpp
2324 fi
2325 rm -f conftest*
2326 fi
2327 rm -f conftest*
2328 fi
2329 rm -f conftest*
2330   ac_cv_prog_CPP="$CPP"
2331   CPP="$ac_cv_prog_CPP"
2332 else
2333   ac_cv_prog_CPP="$CPP"
2334 fi
2335 echo "$ac_t""$CPP" 1>&6
2336
2337
2338
2339 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2340 echo "configure:2341: checking for AIX" >&5
2341 cat > conftest.$ac_ext <<EOF
2342 #line 2343 "configure"
2343 #include "confdefs.h"
2344 #ifdef _AIX
2345   yes
2346 #endif
2347
2348 EOF
2349 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2350   egrep "yes" >/dev/null 2>&1; then
2351   rm -rf conftest*
2352   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2353     Defining _ALL_SOURCE
2354 EOF
2355 cat >> confdefs.h <<\EOF
2356 #define _ALL_SOURCE 1
2357 EOF
2358 }
2359
2360 else
2361   rm -rf conftest*
2362   echo "$ac_t""no" 1>&6
2363 fi
2364 rm -f conftest*
2365
2366  
2367
2368 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2369 echo "configure:2370: checking for GNU libc" >&5
2370 cat > conftest.$ac_ext <<EOF
2371 #line 2372 "configure"
2372 #include "confdefs.h"
2373 #include <features.h>
2374 int main() {
2375
2376 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2377 #error Not a GNU libc system :-(
2378 ******* ======= ******** &&&&&&&&
2379 #endif
2380
2381 ; return 0; }
2382 EOF
2383 if { (eval echo configure:2384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2384   rm -rf conftest*
2385   have_glibc=yes
2386 else
2387   echo "configure: failed program was:" >&5
2388   cat conftest.$ac_ext >&5
2389   rm -rf conftest*
2390   have_glibc=no
2391 fi
2392 rm -f conftest*
2393 echo "$ac_t""$have_glibc" 1>&6
2394 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2395     Defining _GNU_SOURCE
2396 EOF
2397 cat >> confdefs.h <<\EOF
2398 #define _GNU_SOURCE 1
2399 EOF
2400 }
2401
2402
2403 case "$opsys" in
2404   sol2)
2405    { test "$extra_verbose" = "yes" && cat << \EOF
2406     Defining __EXTENSIONS__
2407 EOF
2408 cat >> confdefs.h <<\EOF
2409 #define __EXTENSIONS__ 1
2410 EOF
2411 }
2412
2413       if test "$os_release" -ge 55; then
2414      { test "$extra_verbose" = "yes" && cat << \EOF
2415     Defining _XOPEN_SOURCE = 500
2416 EOF
2417 cat >> confdefs.h <<\EOF
2418 #define _XOPEN_SOURCE 500
2419 EOF
2420 }
2421
2422      { test "$extra_verbose" = "yes" && cat << \EOF
2423     Defining _XOPEN_SOURCE_EXTENDED
2424 EOF
2425 cat >> confdefs.h <<\EOF
2426 #define _XOPEN_SOURCE_EXTENDED 1
2427 EOF
2428 }
2429
2430    fi ;;
2431   linux)
2432     { test "$extra_verbose" = "yes" && cat << \EOF
2433     Defining _POSIX_C_SOURCE = 199506L
2434 EOF
2435 cat >> confdefs.h <<\EOF
2436 #define _POSIX_C_SOURCE 199506L
2437 EOF
2438 }
2439
2440     { test "$extra_verbose" = "yes" && cat << \EOF
2441     Defining _XOPEN_SOURCE = 500
2442 EOF
2443 cat >> confdefs.h <<\EOF
2444 #define _XOPEN_SOURCE 500
2445 EOF
2446 }
2447
2448     { test "$extra_verbose" = "yes" && cat << \EOF
2449     Defining _XOPEN_SOURCE_EXTENDED
2450 EOF
2451 cat >> confdefs.h <<\EOF
2452 #define _XOPEN_SOURCE_EXTENDED 1
2453 EOF
2454 }
2455
2456     ;;
2457 esac
2458
2459 cat > conftest.$ac_ext <<EOF
2460 #line 2461 "configure"
2461 #include "confdefs.h"
2462 int main () {
2463 #if defined __SUNPRO_C
2464 return 11;
2465 #elif defined __DECC
2466 return 12;
2467 #elif defined __USLC__ && defined __SCO_VERSION__
2468 return 13;
2469 #else
2470 return 0;
2471 #endif
2472 }
2473 EOF
2474 if { (eval echo configure:2475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2475 then
2476   :
2477 else
2478   conftest_rc="$?"
2479   echo "configure: failed program was:" >&5
2480   cat conftest.$ac_ext >&5
2481   rm -fr conftest*
2482   case "$conftest_rc" in
2483   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2484   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2485   13) echo "You appear to be using the SCO C compiler."   ; __USLC__=yes ;;
2486 esac
2487 fi
2488 rm -fr conftest*
2489
2490
2491
2492
2493 echo "Extracting information from the machine- and system-dependent headers..."
2494
2495 tempcname="conftest.c"
2496
2497
2498
2499 cat > $tempcname < confdefs.h
2500 cat >> $tempcname <<EOF
2501 #define NOT_C_CODE
2502 #define C_SWITCH_SITE
2503 #define C_SWITCH_X_SITE
2504 #define LD_SWITCH_SITE
2505 #define LD_SWITCH_X_SITE
2506 #define LD_SWITCH_X_SITE_AUX
2507 #define OS_RELEASE $os_release
2508
2509 #ifdef config_opsysfile
2510 #include "$srcdir/src/$opsysfile"
2511 #endif
2512
2513 #ifdef config_machfile
2514 #include "$srcdir/src/$machfile"
2515 #endif
2516
2517 #ifndef LIBS_MACHINE
2518 #define LIBS_MACHINE
2519 #endif
2520 configure___ libs_machine=LIBS_MACHINE
2521
2522 #ifndef LIBS_SYSTEM
2523 #define LIBS_SYSTEM
2524 #endif
2525 configure___ libs_system=LIBS_SYSTEM
2526
2527 #ifndef LIBS_TERMCAP
2528 #define LIBS_TERMCAP
2529 #endif
2530 configure___ libs_termcap=LIBS_TERMCAP
2531
2532 #ifndef LIB_STANDARD
2533 #define LIB_STANDARD
2534 #endif
2535 configure___ libs_standard=LIB_STANDARD
2536
2537
2538 #ifndef OBJECTS_MACHINE
2539 #define OBJECTS_MACHINE
2540 #endif
2541 configure___ objects_machine=OBJECTS_MACHINE
2542
2543 #ifndef OBJECTS_SYSTEM
2544 #define OBJECTS_SYSTEM
2545 #endif
2546 configure___ objects_system=OBJECTS_SYSTEM
2547
2548
2549 #ifndef C_SWITCH_MACHINE
2550 #define C_SWITCH_MACHINE
2551 #endif
2552 configure___ c_switch_machine=C_SWITCH_MACHINE
2553
2554 #ifndef C_SWITCH_SYSTEM
2555 #define C_SWITCH_SYSTEM
2556 #endif
2557 configure___ c_switch_system=C_SWITCH_SYSTEM
2558
2559
2560 #ifndef LD_SWITCH_MACHINE
2561 #define LD_SWITCH_MACHINE
2562 #endif
2563 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2564
2565 #ifndef LD_SWITCH_SYSTEM
2566 #define LD_SWITCH_SYSTEM
2567 #endif
2568 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2569
2570
2571 #ifndef UNEXEC
2572 #define UNEXEC "unexec.o"
2573 #endif
2574 configure___ unexec=UNEXEC
2575
2576
2577 #ifndef LD_SWITCH_SHARED
2578 #define LD_SWITCH_SHARED "-c"
2579 #endif
2580 configure___ ld_switch_shared=LD_SWITCH_SHARED
2581
2582
2583 #define ORDINARY_LD "\$(CC) \$(CFLAGS)"
2584 configure___ ordinary_ld=ORDINARY_LD
2585
2586 #ifdef ORDINARY_LINK
2587 #define LD ORDINARY_LD
2588 #else /* no ORDINARY LINK */
2589 #ifdef COFF_ENCAPSULATE
2590 #define LD "\$(CC) -nostdlib"
2591 #else /* not COFF_ENCAPSULATE */
2592 #ifdef LINKER
2593 #define LD LINKER
2594 #else /* ! defined (LINKER) */
2595 #define LD "ld"
2596 #endif /* ! defined (LINKER) */
2597 #endif /* ! defined (COFF_ENCAPSULATE) */
2598 #endif /* not ORDINARY_LINK */
2599 configure___ ld=LD
2600
2601 #ifndef LIB_GCC
2602 #define LIB_GCC
2603 #endif
2604 configure___ lib_gcc=LIB_GCC
2605
2606 #ifndef LD_TEXT_START_ADDR
2607 #define LD_TEXT_START_ADDR
2608 #endif
2609 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2610
2611
2612 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2613 #ifdef NO_REMAP
2614 #ifdef COFF_ENCAPSULATE
2615 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2616 #else /* ! defined (COFF_ENCAPSULATE) */
2617 #define START_FILES "pre-crt0.o /lib/crt0.o"
2618 #endif /* ! defined (COFF_ENCAPSULATE) */
2619 #else /* ! defined (NO_REMAP) */
2620 #define START_FILES "ecrt0.o"
2621 #endif /* ! defined (NO_REMAP) */
2622 #endif /* no ORDINARY_LINK */
2623 #ifndef START_FILES
2624 #define START_FILES
2625 #endif
2626 configure___ start_files=START_FILES
2627
2628 #ifdef ORDINARY_LINK
2629 configure___ ordinary_link=yes
2630 #else
2631 configure___ ordinary_link=no
2632 #endif
2633
2634 #ifdef SYSTEM_MALLOC
2635 configure___ system_malloc=yes
2636 #else
2637 configure___ system_malloc=no
2638 #endif
2639
2640 #ifdef TERMINFO
2641 configure___ have_terminfo=yes
2642 #else
2643 configure___ have_terminfo=no
2644 #endif
2645
2646 #ifdef MAIL_USE_FLOCK
2647 configure___ mail_use_flock=yes
2648 #else
2649 configure___ mail_use_flock=no
2650 #endif
2651
2652 #ifdef MAIL_USE_LOCKF
2653 configure___ mail_use_lockf=yes
2654 #else
2655 configure___ mail_use_lockf=no
2656 #endif
2657
2658 #ifdef MAIL_USE_LOCKING
2659 configure___ mail_use_locking=yes
2660 #else
2661 configure___ mail_use_locking=no
2662 #endif
2663
2664 #ifdef HAVE_WIN32_PROCESSES
2665 configure___ win32_processes=yes
2666 #else
2667 configure___ win32_processes=no
2668 #endif
2669
2670 EOF
2671
2672 CPP=`eval "echo $CPP $CPPFLAGS"`
2673 eval `$CPP -Isrc $tempcname \
2674         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2675
2676 rm $tempcname
2677
2678 if test "$pdump" = "yes"; then
2679   ordinary_link="yes"
2680   ld="${ordinary_ld}"
2681   start_files=
2682   libs_standard=
2683   unexec=
2684   lib_gcc=
2685 fi
2686
2687 test "$extra_verbose" = "yes" && \
2688   for var in libs_machine libs_system libs_termcap libs_standard   objects_machine objects_system c_switch_machine c_switch_system   ld_switch_machine ld_switch_system unexec ld_switch_shared   ld lib_gcc ld_text_start_addr start_files ordinary_link   have_terminfo mail_use_flock mail_use_lockf; do eval "echo \"$var = '\$$var'\""; done && echo ""
2689
2690 case "$opsys" in mingw* | cygwin*)
2691   cygwin_include=`eval "gcc -print-file-name=libc.a"` ;
2692   cygwin_include=`eval "dirname $cygwin_include"` ;
2693   cygwin_include="-I$cygwin_include/../include" ;
2694   extra_includes="$cygwin_include/mingw32 $cygwin_include/mingw $cygwin_include" ;
2695   case "$opsys" in mingw*)
2696     c_switch_system="$c_switch_system $extra_includes" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$extra_includes\" to \$c_switch_system"; fi ;;
2697   esac
2698   ;;
2699 esac
2700
2701 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2702
2703
2704 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std1" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std1\" to \$c_switch_site"; fi
2705
2706 if test "$__USLC__" = yes; then
2707   echo $ac_n "checking for whether the -Kalloca compiler flag is needed""... $ac_c" 1>&6
2708 echo "configure:2709: checking for whether the -Kalloca compiler flag is needed" >&5
2709   need_kalloca=no
2710   cat > conftest.$ac_ext <<EOF
2711 #line 2712 "configure"
2712 #include "confdefs.h"
2713
2714 int main() {
2715 void *x = alloca(4);
2716 ; return 0; }
2717 EOF
2718 if { (eval echo configure:2719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2719   rm -rf conftest*
2720   :
2721 else
2722   echo "configure: failed program was:" >&5
2723   cat conftest.$ac_ext >&5
2724   rm -rf conftest*
2725   
2726     xe_save_c_switch_system="$c_switch_system"
2727     c_switch_system="$c_switch_system -Kalloca"
2728     cat > conftest.$ac_ext <<EOF
2729 #line 2730 "configure"
2730 #include "confdefs.h"
2731
2732 int main() {
2733 void *x = alloca(4);
2734 ; return 0; }
2735 EOF
2736 if { (eval echo configure:2737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2737   rm -rf conftest*
2738    need_kalloca=yes 
2739 else
2740   echo "configure: failed program was:" >&5
2741   cat conftest.$ac_ext >&5
2742 fi
2743 rm -f conftest*
2744     c_switch_system="$xe_save_c_switch_system"
2745 fi
2746 rm -f conftest*
2747   echo "$ac_t""$need_kalloca" 1>&6
2748   test "$need_kalloca" = "yes" && c_switch_system="$c_switch_system -Kalloca" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-Kalloca\" to \$c_switch_system"; fi
2749 fi
2750
2751 if test "$cflags_specified" = "no"; then
2752       if   test "$GCC" = "yes"; then
2753     CFLAGS="-g -O3 -Wall -Wno-switch -Winline -Wmissing-prototypes -Wshadow"
2754             test "$have_glibc" != "yes" && CFLAGS="$CFLAGS -Wpointer-arith"
2755               elif test "$__SUNPRO_C" = "yes"; then
2756     case "$opsys" in
2757       sol2    ) CFLAGS="-v -xO4" ;;
2758       sunos4* ) CFLAGS="-xO2";;
2759     esac
2760   elif test "$__DECC" = "yes"; then
2761     CFLAGS="-O3"
2762   elif test "$CC" = "xlc"; then
2763     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2764     else
2765     CFLAGS="-O" ;  fi
2766 fi
2767
2768 if test "$GCC" = "yes"; then
2769 echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6
2770 echo "configure:2771: checking for buggy gcc versions" >&5
2771 GCC_VERSION=`$CC --version`
2772 case `uname -s`:`uname -m`:$GCC_VERSION in
2773                     *:sun4*:2.8.1|*:sun4*:egcs-2.90.*)
2774                         case "$CFLAGS" in
2775             *-O2*|*-O3*)
2776                 case "$CFLAGS" in
2777                     *-fno-schedule-insns*) ;;
2778                     *)
2779                         echo "$ac_t""yes" 1>&6
2780                         echo "configure: warning: Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures" 1>&2
2781                         echo "configure: warning: without also using -fno-schedule-insns." 1>&2
2782                         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2783                         ;;
2784                 esac
2785                 ;;
2786         esac
2787         ;;
2788                     Linux:alpha:egcs-2.91.*)
2789         echo "$ac_t""yes" 1>&6
2790         echo "configure: warning: There have been reports of egcs-1.1 not compiling XEmacs correctly on" 1>&2
2791         echo "configure: warning: Alpha Linux.  There have also been reports that egcs-1.0.3a is O.K." 1>&2
2792         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2793         ;;
2794     *:i*86*:2.7.2*)
2795         case "$CFLAGS" in
2796             *-O2*|*-O3*)
2797                 case "$GCC_VERSION" in
2798                     2.7.2)
2799                         case "$CFLAGS" in
2800                             *-fno-strength-reduce*) ;;
2801                             *)
2802                                 echo "$ac_t""yes" 1>&6
2803                                 echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
2804                                 echo "configure: warning: -fno-strength-reduce." 1>&2
2805                                 { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2806                                 ;;
2807                         esac
2808                         ;;
2809                 esac
2810                 case "$CFLAGS" in
2811                  *-fno-caller-saves*) ;;
2812                  *)
2813                     echo "$ac_t""yes" 1>&6
2814                     echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
2815                     echo "configure: warning: -fno-caller-saves." 1>&2
2816                     { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2817                     ;;
2818                 esac
2819                 ;;
2820         esac
2821         ;;
2822 esac
2823 echo "$ac_t""no" 1>&6
2824 fi
2825
2826
2827 if test "$GCC" = "yes"; then
2828   set x $ld_switch_system; shift; ld_switch_system=""
2829   while test -n "$1"; do
2830     case $1 in
2831       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2832       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2833       -Xlinker* ) ;;
2834       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2835     esac
2836     shift
2837   done
2838 fi
2839
2840 if test "$GCC" = "yes"; then
2841   set x $ld_switch_machine; shift; ld_switch_machine=""
2842   while test -n "$1"; do
2843     case $1 in
2844       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2845       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2846       -Xlinker* ) ;;
2847       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2848     esac
2849     shift
2850   done
2851 fi
2852
2853 if test "$GCC" = "yes"; then
2854   set x $LDFLAGS; shift; LDFLAGS=""
2855   while test -n "$1"; do
2856     case $1 in
2857       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2858       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2859       -Xlinker* ) ;;
2860       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2861     esac
2862     shift
2863   done
2864 fi
2865
2866 if test "$GCC" = "yes"; then
2867   set x $ld_call_shared; shift; ld_call_shared=""
2868   while test -n "$1"; do
2869     case $1 in
2870       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2871       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2872       -Xlinker* ) ;;
2873       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2874     esac
2875     shift
2876   done
2877 fi
2878
2879 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2880    echo "    xemacs will be linked with \"$objects_machine\""
2881  fi
2882 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2883    echo "    xemacs will be linked with \"$objects_system\""
2884  fi
2885 test -n "$unexec"          && test ! "$pdump" = "yes" && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2886    echo "    xemacs will be linked with \"$unexec\""
2887  fi
2888 test "$pdump" = "yes" && extra_objs="$extra_objs dumper.o" &&  if test "$extra_verbose" = "yes"; then
2889    echo "    xemacs will be linked with \"dumper.o\""
2890  fi
2891
2892 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2893 echo "configure:2894: checking for dynodump" >&5
2894 if test "$unexec" != "unexsol2.o"; then
2895   echo "$ac_t""no" 1>&6
2896 else
2897   echo "$ac_t""yes" 1>&6
2898   { test "$extra_verbose" = "yes" && cat << \EOF
2899     Defining DYNODUMP
2900 EOF
2901 cat >> confdefs.h <<\EOF
2902 #define DYNODUMP 1
2903 EOF
2904 }
2905
2906   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2907   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2908   case "$machine" in
2909     sparc   ) dynodump_arch=sparc ;;
2910     *86*    ) dynodump_arch=i386  ;;
2911     powerpc ) dynodump_arch=ppc   ;;
2912   esac
2913     test "$GCC" = "yes" && ld_switch_site="$ld_switch_site -fno-gnu-linker" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-fno-gnu-linker\" to \$ld_switch_site"; fi
2914 fi
2915
2916
2917 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2918
2919 if test "$unexec" = "unexaix.o"; then
2920   if   test "$dynamic" = "no"; then
2921   start_flags="-Wl,-bnso,-bnodelcsect"
2922   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2923   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2924     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2925   done
2926   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2927     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2928   done
2929   
2930 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2931 echo "configure:2932: checking for terminateAndUnload in -lC" >&5
2932 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2933
2934 xe_check_libs=" -lC "
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 terminateAndUnload();
2942
2943 int main() {
2944 terminateAndUnload()
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 xe_check_libs=""
2958
2959 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2960   echo "$ac_t""yes" 1>&6
2961   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2962 else
2963   echo "$ac_t""no" 1>&6
2964 fi
2965
2966
2967   fi
2968 elif test -n "$ld_text_start_addr"; then
2969   start_flags="-T $ld_text_start_addr -e __start"
2970 fi
2971
2972
2973
2974
2975 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2976  test -z "$linker" &&  linker='$(CC) -nostdlib'
2977  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2978 fi
2979 test "$GCC" != "yes" && lib_gcc=
2980
2981
2982
2983
2984
2985 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2986 if test -n "$site_libraries"; then
2987   for arg in $site_libraries; do
2988     case "$arg" in
2989      -* ) ;;
2990      * ) test -d "$arg" || \
2991            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2992        arg="-L${arg}" ;;
2993     esac
2994     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2995   done
2996 fi
2997
2998 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2999 if test -n "$site_includes"; then
3000   for arg in $site_includes; do
3001     case "$arg" in
3002       -* ) ;;
3003       * ) test -d "$arg" || \
3004            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
3005       arg="-I${arg}" ;;
3006     esac
3007     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
3008   done
3009 fi
3010
3011 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3012 if test -n "$site_prefixes"; then
3013   for dir in $site_prefixes; do
3014     lib_dir="${dir}/lib"
3015     inc_dir="${dir}/include"
3016     if test ! -d "$dir"; then
3017       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
3018     elif test ! -d "$lib_dir"; then
3019       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
3020     else
3021       if test -d "$inc_dir"; then
3022         c_switch_site="$c_switch_site "-I$inc_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-I$inc_dir"\" to \$c_switch_site"; fi
3023       fi
3024       ld_switch_site="$ld_switch_site "-L$lib_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-L$lib_dir"\" to \$ld_switch_site"; fi
3025     fi
3026   done
3027 fi
3028
3029
3030 for dir in "/usr/ccs/lib"; do
3031   test -d "$dir" && ld_switch_system="$ld_switch_system -L${dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${dir}\" to \$ld_switch_system"; fi
3032 done
3033
3034 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3035 if test -n "$site_runtime_libraries"; then
3036   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
3037   export LD_RUN_PATH
3038 fi
3039
3040
3041
3042
3043
3044 if test -n "$add_runtime_path"; then :;
3045 elif test "$dynamic" = "no"; then add_runtime_path=no
3046 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
3047 else case "$opsys" in
3048        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
3049        * ) add_runtime_path=no ;;
3050      esac
3051 fi
3052
3053 if test "$add_runtime_path" = "yes"; then
3054       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
3055 echo "configure:3056: checking "for runtime libraries flag"" >&5
3056   case "$opsys" in
3057     sol2 ) dash_r="-R" ;;
3058     decosf* | linux* | irix*) dash_r="-rpath " ;;
3059     *)
3060       dash_r=""
3061       for try_dash_r in "-R" "-R " "-rpath "; do
3062         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
3063         
3064 if test "$GCC" = "yes"; then
3065   set x $xe_check_libs; shift; xe_check_libs=""
3066   while test -n "$1"; do
3067     case $1 in
3068       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
3069       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
3070       -Xlinker* ) ;;
3071       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
3072     esac
3073     shift
3074   done
3075 fi
3076         cat > conftest.$ac_ext <<EOF
3077 #line 3078 "configure"
3078 #include "confdefs.h"
3079
3080 int main() {
3081
3082 ; return 0; }
3083 EOF
3084 if { (eval echo configure:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3085   rm -rf conftest*
3086   dash_r="$try_dash_r"
3087 else
3088   echo "configure: failed program was:" >&5
3089   cat conftest.$ac_ext >&5
3090 fi
3091 rm -f conftest*
3092         xe_check_libs=""
3093         test -n "$dash_r" && break
3094       done ;;
3095   esac
3096   if test -n "$dash_r";
3097     then echo "$ac_t"""\"${dash_r}\""" 1>&6
3098     else echo "$ac_t""NONE" 1>&6
3099   fi
3100 fi
3101
3102 xe_add_unique_runpath_dir='
3103   xe_add_p=yes
3104   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
3105   done
3106   if test "$xe_add_p" = "yes"; then
3107     test -n "$runpath" && runpath="${runpath}:"
3108     runpath="${runpath}${xe_runpath_dir}"
3109     runpath_dirs="$runpath_dirs $xe_runpath_dir"
3110   fi'
3111
3112
3113
3114
3115 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
3116     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
3117   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
3118   
3119         runpath="" runpath_dirs=""
3120   if test -n "$LD_RUN_PATH"; then
3121     runpath="$LD_RUN_PATH"
3122   elif test "$GCC" = "yes"; then
3123         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
3124     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
3125     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
3126     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
3127       case "$arg" in P,* | -L* | -R* )
3128         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
3129           {
3130 xe_runpath_dir="$dir"
3131   test "$xe_runpath_dir" != "/lib"     -a \
3132         "$xe_runpath_dir" != "/usr/lib" -a \
3133         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
3134   eval "$xe_add_unique_runpath_dir"
3135 }
3136         done ;;
3137       esac
3138     done
3139     ld_switch_run="$ld_switch_run_save"
3140     rm -f conftest*
3141   else
3142         for arg in $ld_switch_site $ld_switch_x_site; do
3143       case "$arg" in -L*) {
3144 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
3145   test "$xe_runpath_dir" != "/lib"     -a \
3146         "$xe_runpath_dir" != "/usr/lib" -a \
3147         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
3148   eval "$xe_add_unique_runpath_dir"
3149 };; esac
3150     done
3151         if test "$opsys $need_motif" = "sol2 yes"; then
3152       xe_runpath_dir="/opt/SUNWdt/lib";
3153       eval "$xe_add_unique_runpath_dir";
3154     fi
3155   fi 
3156   if test -n "$runpath"; then
3157     ld_switch_run="${dash_r}${runpath}"
3158     
3159 if test "$GCC" = "yes"; then
3160   set x $ld_switch_run; shift; ld_switch_run=""
3161   while test -n "$1"; do
3162     case $1 in
3163       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
3164       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
3165       -Xlinker* ) ;;
3166       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
3167     esac
3168     shift
3169   done
3170 fi
3171     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
3172   fi
3173 fi
3174
3175
3176
3177 GNU_MALLOC=yes
3178 if test "$with_dlmalloc" != "no"; then
3179         doug_lea_malloc=yes
3180 else
3181         doug_lea_malloc=no
3182 fi
3183 after_morecore_hook_exists=yes
3184 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
3185 echo "configure:3186: checking for malloc_set_state" >&5
3186
3187 cat > conftest.$ac_ext <<EOF
3188 #line 3189 "configure"
3189 #include "confdefs.h"
3190 /* System header to define __stub macros and hopefully few prototypes,
3191     which can conflict with char malloc_set_state(); below.  */
3192 #include <assert.h>
3193 /* Override any gcc2 internal prototype to avoid an error.  */
3194 /* We use char because int might match the return type of a gcc2
3195     builtin and then its argument prototype would still apply.  */
3196 char malloc_set_state();
3197
3198 int main() {
3199
3200 /* The GNU C library defines this for functions which it implements
3201     to always fail with ENOSYS.  Some functions are actually named
3202     something starting with __ and the normal name is an alias.  */
3203 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
3204 choke me
3205 #else
3206 malloc_set_state();
3207 #endif
3208
3209 ; return 0; }
3210 EOF
3211 if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3212   rm -rf conftest*
3213   eval "ac_cv_func_malloc_set_state=yes"
3214 else
3215   echo "configure: failed program was:" >&5
3216   cat conftest.$ac_ext >&5
3217   rm -rf conftest*
3218   eval "ac_cv_func_malloc_set_state=no"
3219 fi
3220 rm -f conftest*
3221
3222 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
3223   echo "$ac_t""yes" 1>&6
3224   :
3225 else
3226   echo "$ac_t""no" 1>&6
3227 doug_lea_malloc=no
3228 fi
3229
3230 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
3231 echo "configure:3232: checking whether __after_morecore_hook exists" >&5
3232 cat > conftest.$ac_ext <<EOF
3233 #line 3234 "configure"
3234 #include "confdefs.h"
3235 extern void (* __after_morecore_hook)();
3236 int main() {
3237 __after_morecore_hook = 0
3238 ; return 0; }
3239 EOF
3240 if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3241   rm -rf conftest*
3242   echo "$ac_t""yes" 1>&6
3243 else
3244   echo "configure: failed program was:" >&5
3245   cat conftest.$ac_ext >&5
3246   rm -rf conftest*
3247   echo "$ac_t""no" 1>&6
3248    after_morecore_hook_exists=no
3249 fi
3250 rm -f conftest*
3251 if test "$system_malloc" = "yes" ; then
3252   GNU_MALLOC=no
3253   GNU_MALLOC_reason="
3254     - The GNU allocators don't work with this system configuration."
3255 elif test "$with_system_malloc" = "yes" ; then
3256   GNU_MALLOC=no
3257   GNU_MALLOC_reason="
3258     - User chose not to use GNU allocators."
3259 elif test "$with_debug_malloc" = "yes" ; then
3260   GNU_MALLOC=no
3261   GNU_MALLOC_reason="
3262     - User chose to use Debugging Malloc."
3263 fi
3264
3265 if test "$doug_lea_malloc" = "yes" -a "$GNU_MALLOC" = "yes" ; then
3266   GNU_MALLOC_reason="
3267     - Using Doug Lea's new malloc from the GNU C Library."
3268   { test "$extra_verbose" = "yes" && cat << \EOF
3269     Defining DOUG_LEA_MALLOC
3270 EOF
3271 cat >> confdefs.h <<\EOF
3272 #define DOUG_LEA_MALLOC 1
3273 EOF
3274 }
3275
3276   if test "$after_morecore_hook_exists" = "no" ; then
3277     GNU_MALLOC_reason="
3278     - Using Doug Lea's new malloc from the Linux C Library."
3279     { test "$extra_verbose" = "yes" && cat << \EOF
3280     Defining _NO_MALLOC_WARNING_
3281 EOF
3282 cat >> confdefs.h <<\EOF
3283 #define _NO_MALLOC_WARNING_ 1
3284 EOF
3285 }
3286
3287   fi
3288 fi
3289
3290
3291
3292
3293 # Extract the first word of "ranlib", so it can be a program name with args.
3294 set dummy ranlib; ac_word=$2
3295 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3296 echo "configure:3297: checking for $ac_word" >&5
3297
3298 if test -n "$RANLIB"; then
3299   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3300 else
3301   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3302   ac_dummy="$PATH"
3303   for ac_dir in $ac_dummy; do
3304     test -z "$ac_dir" && ac_dir=.
3305     if test -f $ac_dir/$ac_word; then
3306       ac_cv_prog_RANLIB="ranlib"
3307       break
3308     fi
3309   done
3310   IFS="$ac_save_ifs"
3311   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3312 fi
3313 RANLIB="$ac_cv_prog_RANLIB"
3314 if test -n "$RANLIB"; then
3315   echo "$ac_t""$RANLIB" 1>&6
3316 else
3317   echo "$ac_t""no" 1>&6
3318 fi
3319
3320 ac_aux_dir=
3321 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3322   if test -f $ac_dir/install-sh; then
3323     ac_aux_dir=$ac_dir
3324     ac_install_sh="$ac_aux_dir/install-sh -c"
3325     break
3326   elif test -f $ac_dir/install.sh; then
3327     ac_aux_dir=$ac_dir
3328     ac_install_sh="$ac_aux_dir/install.sh -c"
3329     break
3330   fi
3331 done
3332 if test -z "$ac_aux_dir"; then
3333   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3334 fi
3335 ac_config_guess=$ac_aux_dir/config.guess
3336 ac_config_sub=$ac_aux_dir/config.sub
3337 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3338
3339 # Find a good install program.  We prefer a C program (faster),
3340 # so one script is as good as another.  But avoid the broken or
3341 # incompatible versions:
3342 # SysV /etc/install, /usr/sbin/install
3343 # SunOS /usr/etc/install
3344 # IRIX /sbin/install
3345 # AIX /bin/install
3346 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3347 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3348 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3349 # ./install, which can be erroneously created by make from ./install.sh.
3350 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3351 echo "configure:3352: checking for a BSD compatible install" >&5
3352 if test -z "$INSTALL"; then
3353
3354   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3355   for ac_dir in $PATH; do
3356     # Account for people who put trailing slashes in PATH elements.
3357     case "$ac_dir/" in
3358     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3359     *)
3360       # OSF1 and SCO ODT 3.0 have their own names for install.
3361       # Don't use installbsd from OSF since it installs stuff as root
3362       # by default.
3363       for ac_prog in ginstall scoinst install; do
3364         if test -f $ac_dir/$ac_prog; then
3365           if test $ac_prog = install &&
3366             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3367             # AIX install.  It has an incompatible calling convention.
3368             :
3369           else
3370             ac_cv_path_install="$ac_dir/$ac_prog -c"
3371             break 2
3372           fi
3373         fi
3374       done
3375       ;;
3376     esac
3377   done
3378   IFS="$ac_save_IFS"
3379
3380   if test "${ac_cv_path_install+set}" = set; then
3381     INSTALL="$ac_cv_path_install"
3382   else
3383     # As a last resort, use the slow shell script.  We don't cache a
3384     # path for INSTALL within a source directory, because that will
3385     # break other packages using the cache if that directory is
3386     # removed, or if the path is relative.
3387     INSTALL="$ac_install_sh"
3388   fi
3389 fi
3390 echo "$ac_t""$INSTALL" 1>&6
3391
3392 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3393 # It thinks the first close brace ends the variable substitution.
3394 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3395
3396 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3397
3398 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3399
3400 for ac_prog in 'bison -y' byacc
3401 do
3402 # Extract the first word of "$ac_prog", so it can be a program name with args.
3403 set dummy $ac_prog; ac_word=$2
3404 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3405 echo "configure:3406: checking for $ac_word" >&5
3406
3407 if test -n "$YACC"; then
3408   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3409 else
3410   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3411   ac_dummy="$PATH"
3412   for ac_dir in $ac_dummy; do
3413     test -z "$ac_dir" && ac_dir=.
3414     if test -f $ac_dir/$ac_word; then
3415       ac_cv_prog_YACC="$ac_prog"
3416       break
3417     fi
3418   done
3419   IFS="$ac_save_ifs"
3420 fi
3421 YACC="$ac_cv_prog_YACC"
3422 if test -n "$YACC"; then
3423   echo "$ac_t""$YACC" 1>&6
3424 else
3425   echo "$ac_t""no" 1>&6
3426 fi
3427
3428 test -n "$YACC" && break
3429 done
3430 test -n "$YACC" || YACC="yacc"
3431
3432
3433 for ac_hdr in   a.out.h   elf.h   cygwin/version.h   fcntl.h   inttypes.h   libgen.h   locale.h   mach/mach.h   sys/param.h   sys/pstat.h   sys/time.h   sys/timeb.h   sys/un.h   ulimit.h   unistd.h 
3434 do
3435 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3436 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3437 echo "configure:3438: checking for $ac_hdr" >&5
3438
3439 cat > conftest.$ac_ext <<EOF
3440 #line 3441 "configure"
3441 #include "confdefs.h"
3442 #include <$ac_hdr>
3443 EOF
3444 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3445 { (eval echo configure:3446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3446 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3447 if test -z "$ac_err"; then
3448   rm -rf conftest*
3449   eval "ac_cv_header_$ac_safe=yes"
3450 else
3451   echo "$ac_err" >&5
3452   echo "configure: failed program was:" >&5
3453   cat conftest.$ac_ext >&5
3454   rm -rf conftest*
3455   eval "ac_cv_header_$ac_safe=no"
3456 fi
3457 rm -f conftest*
3458 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3459   echo "$ac_t""yes" 1>&6
3460     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3461   { test "$extra_verbose" = "yes" && cat << EOF
3462     Defining $ac_tr_hdr
3463 EOF
3464 cat >> confdefs.h <<EOF
3465 #define $ac_tr_hdr 1
3466 EOF
3467 }
3468  
3469 else
3470   echo "$ac_t""no" 1>&6
3471 fi
3472 done
3473
3474 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3475 echo "configure:3476: checking for sys/wait.h that is POSIX.1 compatible" >&5
3476
3477 cat > conftest.$ac_ext <<EOF
3478 #line 3479 "configure"
3479 #include "confdefs.h"
3480 #include <sys/types.h>
3481 #include <sys/wait.h>
3482 #ifndef WEXITSTATUS
3483 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3484 #endif
3485 #ifndef WIFEXITED
3486 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3487 #endif
3488 int main() {
3489 int s;
3490 wait (&s);
3491 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3492 ; return 0; }
3493 EOF
3494 if { (eval echo configure:3495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3495   rm -rf conftest*
3496   ac_cv_header_sys_wait_h=yes
3497 else
3498   echo "configure: failed program was:" >&5
3499   cat conftest.$ac_ext >&5
3500   rm -rf conftest*
3501   ac_cv_header_sys_wait_h=no
3502 fi
3503 rm -f conftest*
3504
3505 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3506 if test $ac_cv_header_sys_wait_h = yes; then
3507   { test "$extra_verbose" = "yes" && cat << \EOF
3508     Defining HAVE_SYS_WAIT_H
3509 EOF
3510 cat >> confdefs.h <<\EOF
3511 #define HAVE_SYS_WAIT_H 1
3512 EOF
3513 }
3514
3515 fi
3516
3517 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3518 echo "configure:3519: checking for ANSI C header files" >&5
3519
3520 cat > conftest.$ac_ext <<EOF
3521 #line 3522 "configure"
3522 #include "confdefs.h"
3523 #include <stdlib.h>
3524 #include <stdarg.h>
3525 #include <string.h>
3526 #include <float.h>
3527 EOF
3528 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3529 { (eval echo configure:3530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3530 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3531 if test -z "$ac_err"; then
3532   rm -rf conftest*
3533   ac_cv_header_stdc=yes
3534 else
3535   echo "$ac_err" >&5
3536   echo "configure: failed program was:" >&5
3537   cat conftest.$ac_ext >&5
3538   rm -rf conftest*
3539   ac_cv_header_stdc=no
3540 fi
3541 rm -f conftest*
3542
3543 if test $ac_cv_header_stdc = yes; then
3544   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3545 cat > conftest.$ac_ext <<EOF
3546 #line 3547 "configure"
3547 #include "confdefs.h"
3548 #include <string.h>
3549 EOF
3550 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3551   egrep "memchr" >/dev/null 2>&1; then
3552   :
3553 else
3554   rm -rf conftest*
3555   ac_cv_header_stdc=no
3556 fi
3557 rm -f conftest*
3558
3559 fi
3560
3561 if test $ac_cv_header_stdc = yes; then
3562   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3563 cat > conftest.$ac_ext <<EOF
3564 #line 3565 "configure"
3565 #include "confdefs.h"
3566 #include <stdlib.h>
3567 EOF
3568 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3569   egrep "free" >/dev/null 2>&1; then
3570   :
3571 else
3572   rm -rf conftest*
3573   ac_cv_header_stdc=no
3574 fi
3575 rm -f conftest*
3576
3577 fi
3578
3579 if test $ac_cv_header_stdc = yes; then
3580   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3581 cat > conftest.$ac_ext <<EOF
3582 #line 3583 "configure"
3583 #include "confdefs.h"
3584 #include <ctype.h>
3585 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3586 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3587 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3588 int main () { int i; for (i = 0; i < 256; i++)
3589 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3590 exit (0); }
3591
3592 EOF
3593 if { (eval echo configure:3594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3594 then
3595   :
3596 else
3597   conftest_rc="$?"
3598   echo "configure: failed program was:" >&5
3599   cat conftest.$ac_ext >&5
3600   rm -fr conftest*
3601   ac_cv_header_stdc=no
3602 fi
3603 rm -fr conftest*
3604 fi
3605
3606 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3607 if test $ac_cv_header_stdc = yes; then
3608   { test "$extra_verbose" = "yes" && cat << \EOF
3609     Defining STDC_HEADERS
3610 EOF
3611 cat >> confdefs.h <<\EOF
3612 #define STDC_HEADERS 1
3613 EOF
3614 }
3615
3616 fi
3617
3618 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3619 echo "configure:3620: checking whether time.h and sys/time.h may both be included" >&5
3620
3621 cat > conftest.$ac_ext <<EOF
3622 #line 3623 "configure"
3623 #include "confdefs.h"
3624 #include <sys/types.h>
3625 #include <sys/time.h>
3626 #include <time.h>
3627 int main() {
3628 struct tm *tp;
3629 ; return 0; }
3630 EOF
3631 if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3632   rm -rf conftest*
3633   ac_cv_header_time=yes
3634 else
3635   echo "configure: failed program was:" >&5
3636   cat conftest.$ac_ext >&5
3637   rm -rf conftest*
3638   ac_cv_header_time=no
3639 fi
3640 rm -f conftest*
3641
3642 echo "$ac_t""$ac_cv_header_time" 1>&6
3643 if test $ac_cv_header_time = yes; then
3644   { test "$extra_verbose" = "yes" && cat << \EOF
3645     Defining TIME_WITH_SYS_TIME
3646 EOF
3647 cat >> confdefs.h <<\EOF
3648 #define TIME_WITH_SYS_TIME 1
3649 EOF
3650 }
3651
3652 fi
3653
3654 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3655 echo "configure:3656: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3656
3657 cat > conftest.$ac_ext <<EOF
3658 #line 3659 "configure"
3659 #include "confdefs.h"
3660 #include <sys/types.h>
3661 #include <signal.h>
3662 /* NetBSD declares sys_siglist in unistd.h.  */
3663 #ifdef HAVE_UNISTD_H
3664 #include <unistd.h>
3665 #endif
3666 int main() {
3667 char *msg = *(sys_siglist + 1);
3668 ; return 0; }
3669 EOF
3670 if { (eval echo configure:3671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3671   rm -rf conftest*
3672   ac_cv_decl_sys_siglist=yes
3673 else
3674   echo "configure: failed program was:" >&5
3675   cat conftest.$ac_ext >&5
3676   rm -rf conftest*
3677   ac_cv_decl_sys_siglist=no
3678 fi
3679 rm -f conftest*
3680
3681 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3682 if test $ac_cv_decl_sys_siglist = yes; then
3683   { test "$extra_verbose" = "yes" && cat << \EOF
3684     Defining SYS_SIGLIST_DECLARED
3685 EOF
3686 cat >> confdefs.h <<\EOF
3687 #define SYS_SIGLIST_DECLARED 1
3688 EOF
3689 }
3690
3691 fi
3692
3693
3694
3695 echo $ac_n "checking for utime""... $ac_c" 1>&6
3696 echo "configure:3697: checking for utime" >&5
3697 cat > conftest.$ac_ext <<EOF
3698 #line 3699 "configure"
3699 #include "confdefs.h"
3700 #include <sys/types.h>
3701 #include <utime.h>
3702 int main() {
3703 struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x);
3704 ; return 0; }
3705 EOF
3706 if { (eval echo configure:3707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3707   rm -rf conftest*
3708   echo "$ac_t""yes" 1>&6
3709    { test "$extra_verbose" = "yes" && cat << \EOF
3710     Defining HAVE_UTIME
3711 EOF
3712 cat >> confdefs.h <<\EOF
3713 #define HAVE_UTIME 1
3714 EOF
3715 }
3716
3717 else
3718   echo "configure: failed program was:" >&5
3719   cat conftest.$ac_ext >&5
3720   rm -rf conftest*
3721   echo "$ac_t""no" 1>&6
3722       for ac_func in utimes
3723 do
3724 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3725 echo "configure:3726: checking for $ac_func" >&5
3726
3727 cat > conftest.$ac_ext <<EOF
3728 #line 3729 "configure"
3729 #include "confdefs.h"
3730 /* System header to define __stub macros and hopefully few prototypes,
3731     which can conflict with char $ac_func(); below.  */
3732 #include <assert.h>
3733 /* Override any gcc2 internal prototype to avoid an error.  */
3734 /* We use char because int might match the return type of a gcc2
3735     builtin and then its argument prototype would still apply.  */
3736 char $ac_func();
3737
3738 int main() {
3739
3740 /* The GNU C library defines this for functions which it implements
3741     to always fail with ENOSYS.  Some functions are actually named
3742     something starting with __ and the normal name is an alias.  */
3743 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3744 choke me
3745 #else
3746 $ac_func();
3747 #endif
3748
3749 ; return 0; }
3750 EOF
3751 if { (eval echo configure:3752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3752   rm -rf conftest*
3753   eval "ac_cv_func_$ac_func=yes"
3754 else
3755   echo "configure: failed program was:" >&5
3756   cat conftest.$ac_ext >&5
3757   rm -rf conftest*
3758   eval "ac_cv_func_$ac_func=no"
3759 fi
3760 rm -f conftest*
3761
3762 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3763   echo "$ac_t""yes" 1>&6
3764     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3765   { test "$extra_verbose" = "yes" && cat << EOF
3766     Defining $ac_tr_func
3767 EOF
3768 cat >> confdefs.h <<EOF
3769 #define $ac_tr_func 1
3770 EOF
3771 }
3772  
3773 else
3774   echo "$ac_t""no" 1>&6
3775 fi
3776 done
3777
3778 fi
3779 rm -f conftest*
3780
3781
3782 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3783 echo "configure:3784: checking return type of signal handlers" >&5
3784
3785 cat > conftest.$ac_ext <<EOF
3786 #line 3787 "configure"
3787 #include "confdefs.h"
3788 #include <sys/types.h>
3789 #include <signal.h>
3790 #ifdef signal
3791 #undef signal
3792 #endif
3793 #ifdef __cplusplus
3794 extern "C" void (*signal (int, void (*)(int)))(int);
3795 #else
3796 void (*signal ()) ();
3797 #endif
3798
3799 int main() {
3800 int i;
3801 ; return 0; }
3802 EOF
3803 if { (eval echo configure:3804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3804   rm -rf conftest*
3805   ac_cv_type_signal=void
3806 else
3807   echo "configure: failed program was:" >&5
3808   cat conftest.$ac_ext >&5
3809   rm -rf conftest*
3810   ac_cv_type_signal=int
3811 fi
3812 rm -f conftest*
3813
3814 echo "$ac_t""$ac_cv_type_signal" 1>&6
3815 { test "$extra_verbose" = "yes" && cat << EOF
3816     Defining RETSIGTYPE = $ac_cv_type_signal
3817 EOF
3818 cat >> confdefs.h <<EOF
3819 #define RETSIGTYPE $ac_cv_type_signal
3820 EOF
3821 }
3822
3823
3824 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3825 echo "configure:3826: checking for size_t" >&5
3826
3827 cat > conftest.$ac_ext <<EOF
3828 #line 3829 "configure"
3829 #include "confdefs.h"
3830 #include <sys/types.h>
3831 #if STDC_HEADERS
3832 #include <stdlib.h>
3833 #include <stddef.h>
3834 #endif
3835 EOF
3836 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3837   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3838   rm -rf conftest*
3839   ac_cv_type_size_t=yes
3840 else
3841   rm -rf conftest*
3842   ac_cv_type_size_t=no
3843 fi
3844 rm -f conftest*
3845
3846 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3847 if test $ac_cv_type_size_t = no; then
3848   { test "$extra_verbose" = "yes" && cat << \EOF
3849     Defining size_t = unsigned
3850 EOF
3851 cat >> confdefs.h <<\EOF
3852 #define size_t unsigned
3853 EOF
3854 }
3855
3856 fi
3857
3858 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3859 echo "configure:3860: checking for pid_t" >&5
3860
3861 cat > conftest.$ac_ext <<EOF
3862 #line 3863 "configure"
3863 #include "confdefs.h"
3864 #include <sys/types.h>
3865 #if STDC_HEADERS
3866 #include <stdlib.h>
3867 #include <stddef.h>
3868 #endif
3869 EOF
3870 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3871   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3872   rm -rf conftest*
3873   ac_cv_type_pid_t=yes
3874 else
3875   rm -rf conftest*
3876   ac_cv_type_pid_t=no
3877 fi
3878 rm -f conftest*
3879
3880 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3881 if test $ac_cv_type_pid_t = no; then
3882   { test "$extra_verbose" = "yes" && cat << \EOF
3883     Defining pid_t = int
3884 EOF
3885 cat >> confdefs.h <<\EOF
3886 #define pid_t int
3887 EOF
3888 }
3889
3890 fi
3891
3892 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3893 echo "configure:3894: checking for uid_t in sys/types.h" >&5
3894
3895 cat > conftest.$ac_ext <<EOF
3896 #line 3897 "configure"
3897 #include "confdefs.h"
3898 #include <sys/types.h>
3899 EOF
3900 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3901   egrep "uid_t" >/dev/null 2>&1; then
3902   rm -rf conftest*
3903   ac_cv_type_uid_t=yes
3904 else
3905   rm -rf conftest*
3906   ac_cv_type_uid_t=no
3907 fi
3908 rm -f conftest*
3909
3910
3911 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3912 if test $ac_cv_type_uid_t = no; then
3913   { test "$extra_verbose" = "yes" && cat << \EOF
3914     Defining uid_t = int
3915 EOF
3916 cat >> confdefs.h <<\EOF
3917 #define uid_t int
3918 EOF
3919 }
3920
3921   { test "$extra_verbose" = "yes" && cat << \EOF
3922     Defining gid_t = int
3923 EOF
3924 cat >> confdefs.h <<\EOF
3925 #define gid_t int
3926 EOF
3927 }
3928
3929 fi
3930
3931 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3932 echo "configure:3933: checking for mode_t" >&5
3933
3934 cat > conftest.$ac_ext <<EOF
3935 #line 3936 "configure"
3936 #include "confdefs.h"
3937 #include <sys/types.h>
3938 #if STDC_HEADERS
3939 #include <stdlib.h>
3940 #include <stddef.h>
3941 #endif
3942 EOF
3943 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3944   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3945   rm -rf conftest*
3946   ac_cv_type_mode_t=yes
3947 else
3948   rm -rf conftest*
3949   ac_cv_type_mode_t=no
3950 fi
3951 rm -f conftest*
3952
3953 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3954 if test $ac_cv_type_mode_t = no; then
3955   { test "$extra_verbose" = "yes" && cat << \EOF
3956     Defining mode_t = int
3957 EOF
3958 cat >> confdefs.h <<\EOF
3959 #define mode_t int
3960 EOF
3961 }
3962
3963 fi
3964
3965 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3966 echo "configure:3967: checking for off_t" >&5
3967
3968 cat > conftest.$ac_ext <<EOF
3969 #line 3970 "configure"
3970 #include "confdefs.h"
3971 #include <sys/types.h>
3972 #if STDC_HEADERS
3973 #include <stdlib.h>
3974 #include <stddef.h>
3975 #endif
3976 EOF
3977 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3978   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3979   rm -rf conftest*
3980   ac_cv_type_off_t=yes
3981 else
3982   rm -rf conftest*
3983   ac_cv_type_off_t=no
3984 fi
3985 rm -f conftest*
3986
3987 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3988 if test $ac_cv_type_off_t = no; then
3989   { test "$extra_verbose" = "yes" && cat << \EOF
3990     Defining off_t = long
3991 EOF
3992 cat >> confdefs.h <<\EOF
3993 #define off_t long
3994 EOF
3995 }
3996
3997 fi
3998
3999 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
4000 echo "configure:4001: checking for ssize_t" >&5
4001
4002 cat > conftest.$ac_ext <<EOF
4003 #line 4004 "configure"
4004 #include "confdefs.h"
4005 #include <sys/types.h>
4006 #if STDC_HEADERS
4007 #include <stdlib.h>
4008 #include <stddef.h>
4009 #endif
4010 EOF
4011 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4012   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
4013   rm -rf conftest*
4014   ac_cv_type_ssize_t=yes
4015 else
4016   rm -rf conftest*
4017   ac_cv_type_ssize_t=no
4018 fi
4019 rm -f conftest*
4020
4021 echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
4022 if test $ac_cv_type_ssize_t = no; then
4023   { test "$extra_verbose" = "yes" && cat << \EOF
4024     Defining ssize_t = int
4025 EOF
4026 cat >> confdefs.h <<\EOF
4027 #define ssize_t int
4028 EOF
4029 }
4030
4031 fi
4032
4033
4034 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
4035 echo "configure:4036: checking for socklen_t" >&5
4036 cat > conftest.$ac_ext <<EOF
4037 #line 4038 "configure"
4038 #include "confdefs.h"
4039 #include <sys/socket.h>
4040 socklen_t x;
4041
4042 int main() {
4043
4044 ; return 0; }
4045 EOF
4046 if { (eval echo configure:4047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4047   rm -rf conftest*
4048   echo "$ac_t""yes" 1>&6
4049 else
4050   echo "configure: failed program was:" >&5
4051   cat conftest.$ac_ext >&5
4052   rm -rf conftest*
4053   
4054 cat > conftest.$ac_ext <<EOF
4055 #line 4056 "configure"
4056 #include "confdefs.h"
4057 #include <sys/socket.h>
4058 int accept (int, struct sockaddr *, size_t *);
4059
4060 int main() {
4061
4062 ; return 0; }
4063 EOF
4064 if { (eval echo configure:4065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4065   rm -rf conftest*
4066   
4067 echo "$ac_t""size_t" 1>&6
4068 { test "$extra_verbose" = "yes" && cat << \EOF
4069     Defining socklen_t = size_t
4070 EOF
4071 cat >> confdefs.h <<\EOF
4072 #define socklen_t size_t
4073 EOF
4074 }
4075
4076 else
4077   echo "configure: failed program was:" >&5
4078   cat conftest.$ac_ext >&5
4079   rm -rf conftest*
4080   
4081 echo "$ac_t""int" 1>&6
4082 { test "$extra_verbose" = "yes" && cat << \EOF
4083     Defining socklen_t = int
4084 EOF
4085 cat >> confdefs.h <<\EOF
4086 #define socklen_t int
4087 EOF
4088 }
4089
4090 fi
4091 rm -f conftest*
4092 fi
4093 rm -f conftest*
4094
4095 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
4096 echo "configure:4097: checking for struct timeval" >&5
4097 cat > conftest.$ac_ext <<EOF
4098 #line 4099 "configure"
4099 #include "confdefs.h"
4100 #ifdef TIME_WITH_SYS_TIME
4101 #include <sys/time.h>
4102 #include <time.h>
4103 #else
4104 #ifdef HAVE_SYS_TIME_H
4105 #include <sys/time.h>
4106 #else
4107 #include <time.h>
4108 #endif
4109 #endif
4110 int main() {
4111 static struct timeval x; x.tv_sec = x.tv_usec;
4112 ; return 0; }
4113 EOF
4114 if { (eval echo configure:4115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4115   rm -rf conftest*
4116   echo "$ac_t""yes" 1>&6
4117   HAVE_TIMEVAL=yes
4118   { test "$extra_verbose" = "yes" && cat << \EOF
4119     Defining HAVE_TIMEVAL
4120 EOF
4121 cat >> confdefs.h <<\EOF
4122 #define HAVE_TIMEVAL 1
4123 EOF
4124 }
4125
4126 else
4127   echo "configure: failed program was:" >&5
4128   cat conftest.$ac_ext >&5
4129   rm -rf conftest*
4130   echo "$ac_t""no" 1>&6
4131    HAVE_TIMEVAL=no
4132 fi
4133 rm -f conftest*
4134
4135 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
4136 echo "configure:4137: checking whether struct tm is in sys/time.h or time.h" >&5
4137
4138 cat > conftest.$ac_ext <<EOF
4139 #line 4140 "configure"
4140 #include "confdefs.h"
4141 #include <sys/types.h>
4142 #include <time.h>
4143 int main() {
4144 struct tm *tp; tp->tm_sec;
4145 ; return 0; }
4146 EOF
4147 if { (eval echo configure:4148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4148   rm -rf conftest*
4149   ac_cv_struct_tm=time.h
4150 else
4151   echo "configure: failed program was:" >&5
4152   cat conftest.$ac_ext >&5
4153   rm -rf conftest*
4154   ac_cv_struct_tm=sys/time.h
4155 fi
4156 rm -f conftest*
4157
4158 echo "$ac_t""$ac_cv_struct_tm" 1>&6
4159 if test $ac_cv_struct_tm = sys/time.h; then
4160   { test "$extra_verbose" = "yes" && cat << \EOF
4161     Defining TM_IN_SYS_TIME
4162 EOF
4163 cat >> confdefs.h <<\EOF
4164 #define TM_IN_SYS_TIME 1
4165 EOF
4166 }
4167
4168 fi
4169
4170 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
4171 echo "configure:4172: checking for tm_zone in struct tm" >&5
4172
4173 cat > conftest.$ac_ext <<EOF
4174 #line 4175 "configure"
4175 #include "confdefs.h"
4176 #include <sys/types.h>
4177 #include <$ac_cv_struct_tm>
4178 int main() {
4179 struct tm tm; tm.tm_zone;
4180 ; return 0; }
4181 EOF
4182 if { (eval echo configure:4183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4183   rm -rf conftest*
4184   ac_cv_struct_tm_zone=yes
4185 else
4186   echo "configure: failed program was:" >&5
4187   cat conftest.$ac_ext >&5
4188   rm -rf conftest*
4189   ac_cv_struct_tm_zone=no
4190 fi
4191 rm -f conftest*
4192
4193 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
4194 if test "$ac_cv_struct_tm_zone" = yes; then
4195   { test "$extra_verbose" = "yes" && cat << \EOF
4196     Defining HAVE_TM_ZONE
4197 EOF
4198 cat >> confdefs.h <<\EOF
4199 #define HAVE_TM_ZONE 1
4200 EOF
4201 }
4202
4203 else
4204   echo $ac_n "checking for tzname""... $ac_c" 1>&6
4205 echo "configure:4206: checking for tzname" >&5
4206
4207 cat > conftest.$ac_ext <<EOF
4208 #line 4209 "configure"
4209 #include "confdefs.h"
4210 #include <time.h>
4211 #ifndef tzname /* For SGI.  */
4212 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
4213 #endif
4214 int main() {
4215 atoi(*tzname);
4216 ; return 0; }
4217 EOF
4218 if { (eval echo configure:4219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4219   rm -rf conftest*
4220   ac_cv_var_tzname=yes
4221 else
4222   echo "configure: failed program was:" >&5
4223   cat conftest.$ac_ext >&5
4224   rm -rf conftest*
4225   ac_cv_var_tzname=no
4226 fi
4227 rm -f conftest*
4228
4229 echo "$ac_t""$ac_cv_var_tzname" 1>&6
4230   if test $ac_cv_var_tzname = yes; then
4231     { test "$extra_verbose" = "yes" && cat << \EOF
4232     Defining HAVE_TZNAME
4233 EOF
4234 cat >> confdefs.h <<\EOF
4235 #define HAVE_TZNAME 1
4236 EOF
4237 }
4238
4239   fi
4240 fi
4241
4242
4243 echo $ac_n "checking for working const""... $ac_c" 1>&6
4244 echo "configure:4245: checking for working const" >&5
4245
4246 cat > conftest.$ac_ext <<EOF
4247 #line 4248 "configure"
4248 #include "confdefs.h"
4249
4250 int main() {
4251
4252 /* Ultrix mips cc rejects this.  */
4253 typedef int charset[2]; const charset x;
4254 /* SunOS 4.1.1 cc rejects this.  */
4255 char const *const *ccp;
4256 char **p;
4257 /* NEC SVR4.0.2 mips cc rejects this.  */
4258 struct point {int x, y;};
4259 static struct point const zero = {0,0};
4260 /* AIX XL C 1.02.0.0 rejects this.
4261    It does not let you subtract one const X* pointer from another in an arm
4262    of an if-expression whose if-part is not a constant expression */
4263 const char *g = "string";
4264 ccp = &g + (g ? g-g : 0);
4265 /* HPUX 7.0 cc rejects these. */
4266 ++ccp;
4267 p = (char**) ccp;
4268 ccp = (char const *const *) p;
4269 { /* SCO 3.2v4 cc rejects this.  */
4270   char *t;
4271   char const *s = 0 ? (char *) 0 : (char const *) 0;
4272
4273   *t++ = 0;
4274 }
4275 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4276   int x[] = {25, 17};
4277   const int *foo = &x[0];
4278   ++foo;
4279 }
4280 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4281   typedef const int *iptr;
4282   iptr p = 0;
4283   ++p;
4284 }
4285 { /* AIX XL C 1.02.0.0 rejects this saying
4286      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4287   struct s { int j; const int *ap[3]; };
4288   struct s *b; b->j = 5;
4289 }
4290 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4291   const int foo = 10;
4292 }
4293
4294 ; return 0; }
4295 EOF
4296 if { (eval echo configure:4297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4297   rm -rf conftest*
4298   ac_cv_c_const=yes
4299 else
4300   echo "configure: failed program was:" >&5
4301   cat conftest.$ac_ext >&5
4302   rm -rf conftest*
4303   ac_cv_c_const=no
4304 fi
4305 rm -f conftest*
4306
4307 echo "$ac_t""$ac_cv_c_const" 1>&6
4308 if test $ac_cv_c_const = no; then
4309   { test "$extra_verbose" = "yes" && cat << \EOF
4310     Defining const = 
4311 EOF
4312 cat >> confdefs.h <<\EOF
4313 #define const 
4314 EOF
4315 }
4316
4317 fi
4318
4319
4320 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
4321 echo "configure:4322: checking whether ${MAKE-make} sets \${MAKE}" >&5
4322 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
4323
4324 cat > conftestmake <<\EOF
4325 all:
4326         @echo 'ac_maketemp="${MAKE}"'
4327 EOF
4328 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4329 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4330 if test -n "$ac_maketemp"; then
4331   eval ac_cv_prog_make_${ac_make}_set=yes
4332 else
4333   eval ac_cv_prog_make_${ac_make}_set=no
4334 fi
4335 rm -f conftestmake
4336 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4337   echo "$ac_t""yes" 1>&6
4338   SET_MAKE=
4339 else
4340   echo "$ac_t""no" 1>&6
4341   SET_MAKE="MAKE=${MAKE-make}"
4342 fi
4343
4344
4345 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4346 echo "configure:4347: checking whether byte ordering is bigendian" >&5
4347
4348 ac_cv_c_bigendian=unknown
4349 # See if sys/param.h defines the BYTE_ORDER macro.
4350 cat > conftest.$ac_ext <<EOF
4351 #line 4352 "configure"
4352 #include "confdefs.h"
4353 #include <sys/types.h>
4354 #include <sys/param.h>
4355 int main() {
4356
4357 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4358  bogus endian macros
4359 #endif
4360 ; return 0; }
4361 EOF
4362 if { (eval echo configure:4363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4363   rm -rf conftest*
4364   # It does; now see whether it defined to BIG_ENDIAN or not.
4365 cat > conftest.$ac_ext <<EOF
4366 #line 4367 "configure"
4367 #include "confdefs.h"
4368 #include <sys/types.h>
4369 #include <sys/param.h>
4370 int main() {
4371
4372 #if BYTE_ORDER != BIG_ENDIAN
4373  not big endian
4374 #endif
4375 ; return 0; }
4376 EOF
4377 if { (eval echo configure:4378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4378   rm -rf conftest*
4379   ac_cv_c_bigendian=yes
4380 else
4381   echo "configure: failed program was:" >&5
4382   cat conftest.$ac_ext >&5
4383   rm -rf conftest*
4384   ac_cv_c_bigendian=no
4385 fi
4386 rm -f conftest*
4387 else
4388   echo "configure: failed program was:" >&5
4389   cat conftest.$ac_ext >&5
4390 fi
4391 rm -f conftest*
4392 if test $ac_cv_c_bigendian = unknown; then
4393 cat > conftest.$ac_ext <<EOF
4394 #line 4395 "configure"
4395 #include "confdefs.h"
4396 main () {
4397   /* Are we little or big endian?  From Harbison&Steele.  */
4398   union
4399   {
4400     long l;
4401     char c[sizeof (long)];
4402   } u;
4403   u.l = 1;
4404   exit (u.c[sizeof (long) - 1] == 1);
4405 }
4406 EOF
4407 if { (eval echo configure:4408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4408 then
4409   ac_cv_c_bigendian=no
4410 else
4411   conftest_rc="$?"
4412   echo "configure: failed program was:" >&5
4413   cat conftest.$ac_ext >&5
4414   rm -fr conftest*
4415   ac_cv_c_bigendian=yes
4416 fi
4417 rm -fr conftest*
4418 fi
4419
4420 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4421 if test $ac_cv_c_bigendian = yes; then
4422   { test "$extra_verbose" = "yes" && cat << \EOF
4423     Defining WORDS_BIGENDIAN
4424 EOF
4425 cat >> confdefs.h <<\EOF
4426 #define WORDS_BIGENDIAN 1
4427 EOF
4428 }
4429
4430 fi
4431
4432
4433 echo $ac_n "checking size of short""... $ac_c" 1>&6
4434 echo "configure:4435: checking size of short" >&5
4435
4436 cat > conftest.$ac_ext <<EOF
4437 #line 4438 "configure"
4438 #include "confdefs.h"
4439 #include <stdio.h>
4440 main()
4441 {
4442   FILE *f=fopen("conftestval", "w");
4443   if (!f) exit(1);
4444   fprintf(f, "%d\n", sizeof(short));
4445   exit(0);
4446 }
4447 EOF
4448 if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4449 then
4450   ac_cv_sizeof_short=`cat conftestval`
4451 else
4452   conftest_rc="$?"
4453   echo "configure: failed program was:" >&5
4454   cat conftest.$ac_ext >&5
4455   rm -fr conftest*
4456   ac_cv_sizeof_short=0
4457 fi
4458 rm -fr conftest*
4459 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4460 { test "$extra_verbose" = "yes" && cat << EOF
4461     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4462 EOF
4463 cat >> confdefs.h <<EOF
4464 #define SIZEOF_SHORT $ac_cv_sizeof_short
4465 EOF
4466 }
4467
4468
4469 if test "$ac_cv_sizeof_short" = 0; then
4470   echo ""
4471   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4472   echo "*** PANIC *** Please examine config.log for compilation errors."
4473   exit 1
4474 fi
4475 echo $ac_n "checking size of int""... $ac_c" 1>&6
4476 echo "configure:4477: checking size of int" >&5
4477
4478 cat > conftest.$ac_ext <<EOF
4479 #line 4480 "configure"
4480 #include "confdefs.h"
4481 #include <stdio.h>
4482 main()
4483 {
4484   FILE *f=fopen("conftestval", "w");
4485   if (!f) exit(1);
4486   fprintf(f, "%d\n", sizeof(int));
4487   exit(0);
4488 }
4489 EOF
4490 if { (eval echo configure:4491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4491 then
4492   ac_cv_sizeof_int=`cat conftestval`
4493 else
4494   conftest_rc="$?"
4495   echo "configure: failed program was:" >&5
4496   cat conftest.$ac_ext >&5
4497   rm -fr conftest*
4498   ac_cv_sizeof_int=0
4499 fi
4500 rm -fr conftest*
4501 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4502 { test "$extra_verbose" = "yes" && cat << EOF
4503     Defining SIZEOF_INT = $ac_cv_sizeof_int
4504 EOF
4505 cat >> confdefs.h <<EOF
4506 #define SIZEOF_INT $ac_cv_sizeof_int
4507 EOF
4508 }
4509
4510
4511 echo $ac_n "checking size of long""... $ac_c" 1>&6
4512 echo "configure:4513: checking size of long" >&5
4513
4514 cat > conftest.$ac_ext <<EOF
4515 #line 4516 "configure"
4516 #include "confdefs.h"
4517 #include <stdio.h>
4518 main()
4519 {
4520   FILE *f=fopen("conftestval", "w");
4521   if (!f) exit(1);
4522   fprintf(f, "%d\n", sizeof(long));
4523   exit(0);
4524 }
4525 EOF
4526 if { (eval echo configure:4527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4527 then
4528   ac_cv_sizeof_long=`cat conftestval`
4529 else
4530   conftest_rc="$?"
4531   echo "configure: failed program was:" >&5
4532   cat conftest.$ac_ext >&5
4533   rm -fr conftest*
4534   ac_cv_sizeof_long=0
4535 fi
4536 rm -fr conftest*
4537 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4538 { test "$extra_verbose" = "yes" && cat << EOF
4539     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4540 EOF
4541 cat >> confdefs.h <<EOF
4542 #define SIZEOF_LONG $ac_cv_sizeof_long
4543 EOF
4544 }
4545
4546
4547 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4548 echo "configure:4549: checking size of long long" >&5
4549
4550 cat > conftest.$ac_ext <<EOF
4551 #line 4552 "configure"
4552 #include "confdefs.h"
4553 #include <stdio.h>
4554 main()
4555 {
4556   FILE *f=fopen("conftestval", "w");
4557   if (!f) exit(1);
4558   fprintf(f, "%d\n", sizeof(long long));
4559   exit(0);
4560 }
4561 EOF
4562 if { (eval echo configure:4563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4563 then
4564   ac_cv_sizeof_long_long=`cat conftestval`
4565 else
4566   conftest_rc="$?"
4567   echo "configure: failed program was:" >&5
4568   cat conftest.$ac_ext >&5
4569   rm -fr conftest*
4570   ac_cv_sizeof_long_long=0
4571 fi
4572 rm -fr conftest*
4573 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4574 { test "$extra_verbose" = "yes" && cat << EOF
4575     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4576 EOF
4577 cat >> confdefs.h <<EOF
4578 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4579 EOF
4580 }
4581
4582
4583 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4584 echo "configure:4585: checking size of void *" >&5
4585
4586 cat > conftest.$ac_ext <<EOF
4587 #line 4588 "configure"
4588 #include "confdefs.h"
4589 #include <stdio.h>
4590 main()
4591 {
4592   FILE *f=fopen("conftestval", "w");
4593   if (!f) exit(1);
4594   fprintf(f, "%d\n", sizeof(void *));
4595   exit(0);
4596 }
4597 EOF
4598 if { (eval echo configure:4599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4599 then
4600   ac_cv_sizeof_void_p=`cat conftestval`
4601 else
4602   conftest_rc="$?"
4603   echo "configure: failed program was:" >&5
4604   cat conftest.$ac_ext >&5
4605   rm -fr conftest*
4606   ac_cv_sizeof_void_p=0
4607 fi
4608 rm -fr conftest*
4609 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4610 { test "$extra_verbose" = "yes" && cat << EOF
4611     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4612 EOF
4613 cat >> confdefs.h <<EOF
4614 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4615 EOF
4616 }
4617
4618
4619
4620 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4621 echo "configure:4622: checking for long file names" >&5
4622
4623 ac_cv_sys_long_file_names=yes
4624 # Test for long file names in all the places we know might matter:
4625 #      .                the current directory, where building will happen
4626 #      $prefix/lib      where we will be installing things
4627 #      $exec_prefix/lib likewise
4628 # eval it to expand exec_prefix.
4629 #      $TMPDIR          if set, where it might want to write temporary files
4630 # if $TMPDIR is not set:
4631 #      /tmp             where it might want to write temporary files
4632 #      /var/tmp         likewise
4633 #      /usr/tmp         likewise
4634 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4635   ac_tmpdirs="$TMPDIR"
4636 else
4637   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4638 fi
4639 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4640   test -d $ac_dir || continue
4641   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4642   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4643   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4644   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4645   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4646     ac_cv_sys_long_file_names=no
4647     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4648     break
4649   fi
4650   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4651 done
4652
4653 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4654 if test $ac_cv_sys_long_file_names = yes; then
4655   { test "$extra_verbose" = "yes" && cat << \EOF
4656     Defining HAVE_LONG_FILE_NAMES
4657 EOF
4658 cat >> confdefs.h <<\EOF
4659 #define HAVE_LONG_FILE_NAMES 1
4660 EOF
4661 }
4662
4663 fi
4664
4665
4666 echo $ac_n "checking for sin""... $ac_c" 1>&6
4667 echo "configure:4668: checking for sin" >&5
4668
4669 cat > conftest.$ac_ext <<EOF
4670 #line 4671 "configure"
4671 #include "confdefs.h"
4672 /* System header to define __stub macros and hopefully few prototypes,
4673     which can conflict with char sin(); below.  */
4674 #include <assert.h>
4675 /* Override any gcc2 internal prototype to avoid an error.  */
4676 /* We use char because int might match the return type of a gcc2
4677     builtin and then its argument prototype would still apply.  */
4678 char sin();
4679
4680 int main() {
4681
4682 /* The GNU C library defines this for functions which it implements
4683     to always fail with ENOSYS.  Some functions are actually named
4684     something starting with __ and the normal name is an alias.  */
4685 #if defined (__stub_sin) || defined (__stub___sin)
4686 choke me
4687 #else
4688 sin();
4689 #endif
4690
4691 ; return 0; }
4692 EOF
4693 if { (eval echo configure:4694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4694   rm -rf conftest*
4695   eval "ac_cv_func_sin=yes"
4696 else
4697   echo "configure: failed program was:" >&5
4698   cat conftest.$ac_ext >&5
4699   rm -rf conftest*
4700   eval "ac_cv_func_sin=no"
4701 fi
4702 rm -f conftest*
4703
4704 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4705   echo "$ac_t""yes" 1>&6
4706   :
4707 else
4708   echo "$ac_t""no" 1>&6
4709
4710 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4711 echo "configure:4712: checking for sin in -lm" >&5
4712 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4713
4714 xe_check_libs=" -lm "
4715 cat > conftest.$ac_ext <<EOF
4716 #line 4717 "configure"
4717 #include "confdefs.h"
4718 /* Override any gcc2 internal prototype to avoid an error.  */
4719 /* We use char because int might match the return type of a gcc2
4720     builtin and then its argument prototype would still apply.  */
4721 char sin();
4722
4723 int main() {
4724 sin()
4725 ; return 0; }
4726 EOF
4727 if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4728   rm -rf conftest*
4729   eval "ac_cv_lib_$ac_lib_var=yes"
4730 else
4731   echo "configure: failed program was:" >&5
4732   cat conftest.$ac_ext >&5
4733   rm -rf conftest*
4734   eval "ac_cv_lib_$ac_lib_var=no"
4735 fi
4736 rm -f conftest*
4737 xe_check_libs=""
4738
4739 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4740   echo "$ac_t""yes" 1>&6
4741     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4742     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4743   { test "$extra_verbose" = "yes" && cat << EOF
4744     Defining $ac_tr_lib
4745 EOF
4746 cat >> confdefs.h <<EOF
4747 #define $ac_tr_lib 1
4748 EOF
4749 }
4750
4751   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4752
4753 else
4754   echo "$ac_t""no" 1>&6
4755 fi
4756
4757
4758 fi
4759
4760
4761 { test "$extra_verbose" = "yes" && cat << \EOF
4762     Defining LISP_FLOAT_TYPE
4763 EOF
4764 cat >> confdefs.h <<\EOF
4765 #define LISP_FLOAT_TYPE 1
4766 EOF
4767 }
4768
4769
4770 cat > conftest.$ac_ext <<EOF
4771 #line 4772 "configure"
4772 #include "confdefs.h"
4773 #include <math.h>
4774 int main() {
4775 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4776 ; return 0; }
4777 EOF
4778 if { (eval echo configure:4779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4779   rm -rf conftest*
4780   { test "$extra_verbose" = "yes" && cat << \EOF
4781     Defining HAVE_INVERSE_HYPERBOLIC
4782 EOF
4783 cat >> confdefs.h <<\EOF
4784 #define HAVE_INVERSE_HYPERBOLIC 1
4785 EOF
4786 }
4787
4788 else
4789   echo "configure: failed program was:" >&5
4790   cat conftest.$ac_ext >&5
4791 fi
4792 rm -f conftest*
4793
4794 echo "checking type of mail spool file locking" 1>&6
4795 echo "configure:4796: checking type of mail spool file locking" >&5
4796 for ac_func in lockf flock
4797 do
4798 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4799 echo "configure:4800: checking for $ac_func" >&5
4800
4801 cat > conftest.$ac_ext <<EOF
4802 #line 4803 "configure"
4803 #include "confdefs.h"
4804 /* System header to define __stub macros and hopefully few prototypes,
4805     which can conflict with char $ac_func(); below.  */
4806 #include <assert.h>
4807 /* Override any gcc2 internal prototype to avoid an error.  */
4808 /* We use char because int might match the return type of a gcc2
4809     builtin and then its argument prototype would still apply.  */
4810 char $ac_func();
4811
4812 int main() {
4813
4814 /* The GNU C library defines this for functions which it implements
4815     to always fail with ENOSYS.  Some functions are actually named
4816     something starting with __ and the normal name is an alias.  */
4817 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4818 choke me
4819 #else
4820 $ac_func();
4821 #endif
4822
4823 ; return 0; }
4824 EOF
4825 if { (eval echo configure:4826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4826   rm -rf conftest*
4827   eval "ac_cv_func_$ac_func=yes"
4828 else
4829   echo "configure: failed program was:" >&5
4830   cat conftest.$ac_ext >&5
4831   rm -rf conftest*
4832   eval "ac_cv_func_$ac_func=no"
4833 fi
4834 rm -f conftest*
4835
4836 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4837   echo "$ac_t""yes" 1>&6
4838     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4839   { test "$extra_verbose" = "yes" && cat << EOF
4840     Defining $ac_tr_func
4841 EOF
4842 cat >> confdefs.h <<EOF
4843 #define $ac_tr_func 1
4844 EOF
4845 }
4846  
4847 else
4848   echo "$ac_t""no" 1>&6
4849 fi
4850 done
4851
4852 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4853 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4854 test -z "$mail_locking" -a "$mail_use_locking" = "yes" && mail_locking=locking
4855 if   test -z "$mail_locking"; then
4856   case "$opsys" in cygwin* | mingw*)
4857     mail_locking=pop ;;
4858   esac
4859 fi
4860
4861 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4862     Defining MAIL_LOCK_LOCKF
4863 EOF
4864 cat >> confdefs.h <<\EOF
4865 #define MAIL_LOCK_LOCKF 1
4866 EOF
4867 }
4868
4869 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4870     Defining MAIL_LOCK_FLOCK
4871 EOF
4872 cat >> confdefs.h <<\EOF
4873 #define MAIL_LOCK_FLOCK 1
4874 EOF
4875 }
4876
4877 elif test "$mail_locking" = "locking"; then { test "$extra_verbose" = "yes" && cat << \EOF
4878     Defining MAIL_LOCK_LOCKING
4879 EOF
4880 cat >> confdefs.h <<\EOF
4881 #define MAIL_LOCK_LOCKING 1
4882 EOF
4883 }
4884
4885 elif test "$mail_locking" = "pop"; then
4886   with_pop=yes
4887   mail_locking=
4888 else mail_locking="dot-locking"; { test "$extra_verbose" = "yes" && cat << \EOF
4889     Defining MAIL_LOCK_DOT
4890 EOF
4891 cat >> confdefs.h <<\EOF
4892 #define MAIL_LOCK_DOT 1
4893 EOF
4894 }
4895
4896 fi
4897 test "$mail_locking" = "lockf" -a "$ac_cv_func_lockf" != "yes" && \
4898   { echo "Error:" "lockf mail locking requested but not available." >&2; exit 1; }
4899 test "$mail_locking" = "flock" -a "$ac_cv_func_flock" != "yes" && \
4900   { echo "Error:" "flock mail locking requested but not available." >&2; exit 1; }
4901 test "$mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \
4902   { echo "Error:" "locking mail locking requested but not available." >&2; exit 1; }
4903
4904 case "$opsys" in decosf*)
4905   
4906 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4907 echo "configure:4908: checking for cma_open in -lpthreads" >&5
4908 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4909
4910 xe_check_libs=" -lpthreads "
4911 cat > conftest.$ac_ext <<EOF
4912 #line 4913 "configure"
4913 #include "confdefs.h"
4914 /* Override any gcc2 internal prototype to avoid an error.  */
4915 /* We use char because int might match the return type of a gcc2
4916     builtin and then its argument prototype would still apply.  */
4917 char cma_open();
4918
4919 int main() {
4920 cma_open()
4921 ; return 0; }
4922 EOF
4923 if { (eval echo configure:4924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4924   rm -rf conftest*
4925   eval "ac_cv_lib_$ac_lib_var=yes"
4926 else
4927   echo "configure: failed program was:" >&5
4928   cat conftest.$ac_ext >&5
4929   rm -rf conftest*
4930   eval "ac_cv_lib_$ac_lib_var=no"
4931 fi
4932 rm -f conftest*
4933 xe_check_libs=""
4934
4935 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4936   echo "$ac_t""yes" 1>&6
4937     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4938     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4939   { test "$extra_verbose" = "yes" && cat << EOF
4940     Defining $ac_tr_lib
4941 EOF
4942 cat >> confdefs.h <<EOF
4943 #define $ac_tr_lib 1
4944 EOF
4945 }
4946
4947   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4948
4949 else
4950   echo "$ac_t""no" 1>&6
4951 fi
4952
4953
4954   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4955     c_switch_site="$c_switch_site -threads" ;;
4956 esac
4957
4958 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4959 echo "configure:4960: checking whether the -xildoff compiler flag is required" >&5
4960 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4961   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4962     then echo "$ac_t""no" 1>&6;
4963     else echo "$ac_t""yes" 1>&6; ld_switch_site="$ld_switch_site -xildoff" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-xildoff\" to \$ld_switch_site"; fi
4964   fi
4965   else echo "$ac_t""no" 1>&6
4966 fi
4967
4968 if test "$opsys" = "sol2"; then
4969   if test "$os_release" -ge 56; then
4970     echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4971 echo "configure:4972: checking for \"-z ignore\" linker flag" >&5
4972     case "`ld -h 2>&1`" in
4973       *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4974         ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4975       *) echo "$ac_t""no" 1>&6 ;;
4976     esac
4977   fi
4978 fi
4979
4980
4981 echo "checking "for specified window system"" 1>&6
4982 echo "configure:4983: checking "for specified window system"" >&5
4983
4984 if test "$with_x11" != "no"; then
4985     test "$x_includes $x_libraries" != "NONE NONE" && \
4986    window_system=x11 with_x11=yes
4987
4988         
4989       if test "$x_includes $x_libraries" = "NONE NONE" \
4990     -a -n "$OPENWINHOME" \
4991     -a "$OPENWINHOME" != "/usr/openwin" \
4992     -a -d "$OPENWINHOME"; then
4993       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4994       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4995       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4996   fi
4997
4998   if test "$x_includes" = "NONE"; then
4999                     for dir in "/usr/X11" "/usr/X11R6"; do
5000       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
5001     done
5002   fi
5003
5004   if test "$x_libraries" = "NONE"; then
5005     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
5006       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
5007     done
5008   fi
5009
5010   # If we find X, set shell vars x_includes and x_libraries to the
5011 # paths, otherwise set no_x=yes.
5012 # Uses ac_ vars as temps to allow command line to override cache and checks.
5013 # --without-x overrides everything else, but does not touch the cache.
5014 echo $ac_n "checking for X""... $ac_c" 1>&6
5015 echo "configure:5016: checking for X" >&5
5016
5017 # Check whether --with-x or --without-x was given.
5018 if test "${with_x+set}" = set; then
5019   withval="$with_x"
5020   :
5021 fi
5022
5023 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
5024 if test "x$with_x" = xno; then
5025   # The user explicitly disabled X.
5026   have_x=disabled
5027 else
5028   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
5029     # Both variables are already set.
5030     have_x=yes
5031   else
5032
5033 # One or both of the vars are not set, and there is no cached value.
5034 ac_x_includes=NO ac_x_libraries=NO
5035 rm -fr conftestdir
5036 if mkdir conftestdir; then
5037   cd conftestdir
5038   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
5039   cat > Imakefile <<'EOF'
5040 acfindx:
5041         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
5042 EOF
5043   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5044     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5045     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
5046     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
5047     for ac_extension in a so sl; do
5048       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
5049         test -f $ac_im_libdir/libX11.$ac_extension; then
5050         ac_im_usrlibdir=$ac_im_libdir; break
5051       fi
5052     done
5053     # Screen out bogus values from the imake configuration.  They are
5054     # bogus both because they are the default anyway, and because
5055     # using them would break gcc on systems where it needs fixed includes.
5056     case "$ac_im_incroot" in
5057         /usr/include) ;;
5058         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
5059     esac
5060     case "$ac_im_usrlibdir" in
5061         /usr/lib | /lib) ;;
5062         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
5063     esac
5064   fi
5065   cd ..
5066   rm -fr conftestdir
5067 fi
5068
5069 if test "$ac_x_includes" = NO; then
5070   # Guess where to find include files, by looking for this one X11 .h file.
5071   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
5072
5073   # First, try using that file with no special directory specified.
5074 cat > conftest.$ac_ext <<EOF
5075 #line 5076 "configure"
5076 #include "confdefs.h"
5077 #include <$x_direct_test_include>
5078 EOF
5079 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5080 { (eval echo configure:5081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5081 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5082 if test -z "$ac_err"; then
5083   rm -rf conftest*
5084   # We can compile using X headers with no special include directory.
5085 ac_x_includes=
5086 else
5087   echo "$ac_err" >&5
5088   echo "configure: failed program was:" >&5
5089   cat conftest.$ac_ext >&5
5090   rm -rf conftest*
5091   # Look for the header file in a standard set of common directories.
5092 # Check X11 before X11Rn because it is often a symlink to the current release.
5093   for ac_dir in               \
5094     /usr/X11/include          \
5095     /usr/X11R6/include        \
5096     /usr/X11R5/include        \
5097     /usr/X11R4/include        \
5098                               \
5099     /usr/include/X11          \
5100     /usr/include/X11R6        \
5101     /usr/include/X11R5        \
5102     /usr/include/X11R4        \
5103                               \
5104     /usr/local/X11/include    \
5105     /usr/local/X11R6/include  \
5106     /usr/local/X11R5/include  \
5107     /usr/local/X11R4/include  \
5108                               \
5109     /usr/local/include/X11    \
5110     /usr/local/include/X11R6  \
5111     /usr/local/include/X11R5  \
5112     /usr/local/include/X11R4  \
5113                               \
5114     /usr/X386/include         \
5115     /usr/x386/include         \
5116     /usr/XFree86/include/X11  \
5117                               \
5118     /usr/include              \
5119     /usr/local/include        \
5120     /usr/unsupported/include  \
5121     /usr/athena/include       \
5122     /usr/local/x11r5/include  \
5123     /usr/lpp/Xamples/include  \
5124                               \
5125     /usr/openwin/include      \
5126     /usr/openwin/share/include \
5127     ; \
5128   do
5129     if test -r "$ac_dir/$x_direct_test_include"; then
5130       ac_x_includes=$ac_dir
5131       break
5132     fi
5133   done
5134 fi
5135 rm -f conftest*
5136 fi # $ac_x_includes = NO
5137
5138 if test "$ac_x_libraries" = NO; then
5139   # Check for the libraries.
5140
5141   test -z "$x_direct_test_library" && x_direct_test_library=Xt
5142   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
5143
5144   # See if we find them without any special options.
5145   # Don't add to $LIBS permanently.
5146   ac_save_LIBS="$LIBS"
5147   LIBS="-l$x_direct_test_library $LIBS"
5148 cat > conftest.$ac_ext <<EOF
5149 #line 5150 "configure"
5150 #include "confdefs.h"
5151
5152 int main() {
5153 ${x_direct_test_function}()
5154 ; return 0; }
5155 EOF
5156 if { (eval echo configure:5157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5157   rm -rf conftest*
5158   LIBS="$ac_save_LIBS"
5159 # We can link X programs with no special library path.
5160 ac_x_libraries=
5161 else
5162   echo "configure: failed program was:" >&5
5163   cat conftest.$ac_ext >&5
5164   rm -rf conftest*
5165   LIBS="$ac_save_LIBS"
5166 # First see if replacing the include by lib works.
5167 # Check X11 before X11Rn because it is often a symlink to the current release.
5168 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
5169     /usr/X11/lib          \
5170     /usr/X11R6/lib        \
5171     /usr/X11R5/lib        \
5172     /usr/X11R4/lib        \
5173                           \
5174     /usr/lib/X11          \
5175     /usr/lib/X11R6        \
5176     /usr/lib/X11R5        \
5177     /usr/lib/X11R4        \
5178                           \
5179     /usr/local/X11/lib    \
5180     /usr/local/X11R6/lib  \
5181     /usr/local/X11R5/lib  \
5182     /usr/local/X11R4/lib  \
5183                           \
5184     /usr/local/lib/X11    \
5185     /usr/local/lib/X11R6  \
5186     /usr/local/lib/X11R5  \
5187     /usr/local/lib/X11R4  \
5188                           \
5189     /usr/X386/lib         \
5190     /usr/x386/lib         \
5191     /usr/XFree86/lib/X11  \
5192                           \
5193     /usr/lib              \
5194     /usr/local/lib        \
5195     /usr/unsupported/lib  \
5196     /usr/athena/lib       \
5197     /usr/local/x11r5/lib  \
5198     /usr/lpp/Xamples/lib  \
5199     /lib/usr/lib/X11      \
5200                           \
5201     /usr/openwin/lib      \
5202     /usr/openwin/share/lib \
5203     ; \
5204 do
5205   for ac_extension in a so sl; do
5206     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
5207       ac_x_libraries=$ac_dir
5208       break 2
5209     fi
5210   done
5211 done
5212 fi
5213 rm -f conftest*
5214 fi # $ac_x_libraries = NO
5215
5216 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
5217   # Didn't find X anywhere.  Cache the known absence of X.
5218   ac_cv_have_x="have_x=no"
5219 else
5220   # Record where we found X for the cache.
5221   ac_cv_have_x="have_x=yes \
5222                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
5223 fi
5224   fi
5225   eval "$ac_cv_have_x"
5226 fi # $with_x != no
5227
5228 if test "$have_x" != yes; then
5229   echo "$ac_t""$have_x" 1>&6
5230   no_x=yes
5231 else
5232   # If each of the values was on the command line, it overrides each guess.
5233   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
5234   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
5235   # Update the cache value to reflect the command line values.
5236   ac_cv_have_x="have_x=yes \
5237                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
5238   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
5239 fi
5240
5241 if test "$no_x" = yes; then
5242   # Not all programs may use this symbol, but it does not hurt to define it.
5243   { test "$extra_verbose" = "yes" && cat << \EOF
5244     Defining X_DISPLAY_MISSING
5245 EOF
5246 cat >> confdefs.h <<\EOF
5247 #define X_DISPLAY_MISSING 1
5248 EOF
5249 }
5250
5251   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
5252 else
5253   if test -n "$x_includes"; then
5254     X_CFLAGS="$X_CFLAGS -I$x_includes"
5255   fi
5256
5257   # It would also be nice to do this for all -L options, not just this one.
5258   if test -n "$x_libraries"; then
5259     X_LIBS="$X_LIBS -L$x_libraries"
5260     # For Solaris; some versions of Sun CC require a space after -R and
5261     # others require no space.  Words are not sufficient . . . .
5262     case "`(uname -sr) 2>/dev/null`" in
5263     "SunOS 5"*)
5264       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
5265 echo "configure:5266: checking whether -R must be followed by a space" >&5
5266       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
5267       cat > conftest.$ac_ext <<EOF
5268 #line 5269 "configure"
5269 #include "confdefs.h"
5270
5271 int main() {
5272
5273 ; return 0; }
5274 EOF
5275 if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5276   rm -rf conftest*
5277   ac_R_nospace=yes
5278 else
5279   echo "configure: failed program was:" >&5
5280   cat conftest.$ac_ext >&5
5281   rm -rf conftest*
5282   ac_R_nospace=no
5283 fi
5284 rm -f conftest*
5285       if test $ac_R_nospace = yes; then
5286         echo "$ac_t""no" 1>&6
5287         X_LIBS="$X_LIBS -R$x_libraries"
5288       else
5289         LIBS="$ac_xsave_LIBS -R $x_libraries"
5290         cat > conftest.$ac_ext <<EOF
5291 #line 5292 "configure"
5292 #include "confdefs.h"
5293
5294 int main() {
5295
5296 ; return 0; }
5297 EOF
5298 if { (eval echo configure:5299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5299   rm -rf conftest*
5300   ac_R_space=yes
5301 else
5302   echo "configure: failed program was:" >&5
5303   cat conftest.$ac_ext >&5
5304   rm -rf conftest*
5305   ac_R_space=no
5306 fi
5307 rm -f conftest*
5308         if test $ac_R_space = yes; then
5309           echo "$ac_t""yes" 1>&6
5310           X_LIBS="$X_LIBS -R $x_libraries"
5311         else
5312           echo "$ac_t""neither works" 1>&6
5313         fi
5314       fi
5315       LIBS="$ac_xsave_LIBS"
5316     esac
5317   fi
5318
5319   # Check for system-dependent libraries X programs must link with.
5320   # Do this before checking for the system-independent R6 libraries
5321   # (-lICE), since we may need -lsocket or whatever for X linking.
5322
5323   if test "$ISC" = yes; then
5324     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
5325   else
5326     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
5327     # libraries were built with DECnet support.  And karl@cs.umb.edu says
5328     # the Alpha needs dnet_stub (dnet does not exist).
5329     if test "$with_dnet" = "no" ; then
5330 ac_cv_lib_dnet_dnet_ntoa=no
5331 else
5332
5333 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
5334 echo "configure:5335: checking for dnet_ntoa in -ldnet" >&5
5335 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
5336
5337 xe_check_libs=" -ldnet "
5338 cat > conftest.$ac_ext <<EOF
5339 #line 5340 "configure"
5340 #include "confdefs.h"
5341 /* Override any gcc2 internal prototype to avoid an error.  */
5342 /* We use char because int might match the return type of a gcc2
5343     builtin and then its argument prototype would still apply.  */
5344 char dnet_ntoa();
5345
5346 int main() {
5347 dnet_ntoa()
5348 ; return 0; }
5349 EOF
5350 if { (eval echo configure:5351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5351   rm -rf conftest*
5352   eval "ac_cv_lib_$ac_lib_var=yes"
5353 else
5354   echo "configure: failed program was:" >&5
5355   cat conftest.$ac_ext >&5
5356   rm -rf conftest*
5357   eval "ac_cv_lib_$ac_lib_var=no"
5358 fi
5359 rm -f conftest*
5360 xe_check_libs=""
5361
5362 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5363   echo "$ac_t""yes" 1>&6
5364   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
5365 else
5366   echo "$ac_t""no" 1>&6
5367 fi
5368
5369 fi
5370
5371     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
5372       
5373 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
5374 echo "configure:5375: checking for dnet_ntoa in -ldnet_stub" >&5
5375 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
5376
5377 xe_check_libs=" -ldnet_stub "
5378 cat > conftest.$ac_ext <<EOF
5379 #line 5380 "configure"
5380 #include "confdefs.h"
5381 /* Override any gcc2 internal prototype to avoid an error.  */
5382 /* We use char because int might match the return type of a gcc2
5383     builtin and then its argument prototype would still apply.  */
5384 char dnet_ntoa();
5385
5386 int main() {
5387 dnet_ntoa()
5388 ; return 0; }
5389 EOF
5390 if { (eval echo configure:5391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5391   rm -rf conftest*
5392   eval "ac_cv_lib_$ac_lib_var=yes"
5393 else
5394   echo "configure: failed program was:" >&5
5395   cat conftest.$ac_ext >&5
5396   rm -rf conftest*
5397   eval "ac_cv_lib_$ac_lib_var=no"
5398 fi
5399 rm -f conftest*
5400 xe_check_libs=""
5401
5402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5403   echo "$ac_t""yes" 1>&6
5404   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
5405 else
5406   echo "$ac_t""no" 1>&6
5407 fi
5408
5409
5410     fi
5411
5412     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
5413     # to get the SysV transport functions.
5414     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5415     # needs -lnsl.
5416     # The nsl library prevents programs from opening the X display
5417     # on Irix 5.2, according to dickey@clark.net.
5418     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5419 echo "configure:5420: checking for gethostbyname" >&5
5420
5421 cat > conftest.$ac_ext <<EOF
5422 #line 5423 "configure"
5423 #include "confdefs.h"
5424 /* System header to define __stub macros and hopefully few prototypes,
5425     which can conflict with char gethostbyname(); below.  */
5426 #include <assert.h>
5427 /* Override any gcc2 internal prototype to avoid an error.  */
5428 /* We use char because int might match the return type of a gcc2
5429     builtin and then its argument prototype would still apply.  */
5430 char gethostbyname();
5431
5432 int main() {
5433
5434 /* The GNU C library defines this for functions which it implements
5435     to always fail with ENOSYS.  Some functions are actually named
5436     something starting with __ and the normal name is an alias.  */
5437 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5438 choke me
5439 #else
5440 gethostbyname();
5441 #endif
5442
5443 ; return 0; }
5444 EOF
5445 if { (eval echo configure:5446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5446   rm -rf conftest*
5447   eval "ac_cv_func_gethostbyname=yes"
5448 else
5449   echo "configure: failed program was:" >&5
5450   cat conftest.$ac_ext >&5
5451   rm -rf conftest*
5452   eval "ac_cv_func_gethostbyname=no"
5453 fi
5454 rm -f conftest*
5455
5456 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5457   echo "$ac_t""yes" 1>&6
5458   :
5459 else
5460   echo "$ac_t""no" 1>&6
5461 fi
5462
5463     if test $ac_cv_func_gethostbyname = no; then
5464       
5465 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5466 echo "configure:5467: checking for gethostbyname in -lnsl" >&5
5467 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5468
5469 xe_check_libs=" -lnsl "
5470 cat > conftest.$ac_ext <<EOF
5471 #line 5472 "configure"
5472 #include "confdefs.h"
5473 /* Override any gcc2 internal prototype to avoid an error.  */
5474 /* We use char because int might match the return type of a gcc2
5475     builtin and then its argument prototype would still apply.  */
5476 char gethostbyname();
5477
5478 int main() {
5479 gethostbyname()
5480 ; return 0; }
5481 EOF
5482 if { (eval echo configure:5483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5483   rm -rf conftest*
5484   eval "ac_cv_lib_$ac_lib_var=yes"
5485 else
5486   echo "configure: failed program was:" >&5
5487   cat conftest.$ac_ext >&5
5488   rm -rf conftest*
5489   eval "ac_cv_lib_$ac_lib_var=no"
5490 fi
5491 rm -f conftest*
5492 xe_check_libs=""
5493
5494 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5495   echo "$ac_t""yes" 1>&6
5496   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5497 else
5498   echo "$ac_t""no" 1>&6
5499 fi
5500
5501
5502     fi
5503
5504     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5505     # socket/setsockopt and other routines are undefined under SCO ODT
5506     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5507     # on later versions), says simon@lia.di.epfl.ch: it contains
5508     # gethostby* variants that don't use the nameserver (or something).
5509     # -lsocket must be given before -lnsl if both are needed.
5510     # We assume that if connect needs -lnsl, so does gethostbyname.
5511     echo $ac_n "checking for connect""... $ac_c" 1>&6
5512 echo "configure:5513: checking for connect" >&5
5513
5514 cat > conftest.$ac_ext <<EOF
5515 #line 5516 "configure"
5516 #include "confdefs.h"
5517 /* System header to define __stub macros and hopefully few prototypes,
5518     which can conflict with char connect(); below.  */
5519 #include <assert.h>
5520 /* Override any gcc2 internal prototype to avoid an error.  */
5521 /* We use char because int might match the return type of a gcc2
5522     builtin and then its argument prototype would still apply.  */
5523 char connect();
5524
5525 int main() {
5526
5527 /* The GNU C library defines this for functions which it implements
5528     to always fail with ENOSYS.  Some functions are actually named
5529     something starting with __ and the normal name is an alias.  */
5530 #if defined (__stub_connect) || defined (__stub___connect)
5531 choke me
5532 #else
5533 connect();
5534 #endif
5535
5536 ; return 0; }
5537 EOF
5538 if { (eval echo configure:5539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5539   rm -rf conftest*
5540   eval "ac_cv_func_connect=yes"
5541 else
5542   echo "configure: failed program was:" >&5
5543   cat conftest.$ac_ext >&5
5544   rm -rf conftest*
5545   eval "ac_cv_func_connect=no"
5546 fi
5547 rm -f conftest*
5548
5549 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5550   echo "$ac_t""yes" 1>&6
5551   :
5552 else
5553   echo "$ac_t""no" 1>&6
5554 fi
5555
5556     if test $ac_cv_func_connect = no; then
5557       
5558 xe_msg_checking="for connect in -lsocket"
5559 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5560 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5561 echo "configure:5562: checking "$xe_msg_checking"" >&5
5562 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5563
5564 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5565 cat > conftest.$ac_ext <<EOF
5566 #line 5567 "configure"
5567 #include "confdefs.h"
5568 /* Override any gcc2 internal prototype to avoid an error.  */
5569 /* We use char because int might match the return type of a gcc2
5570     builtin and then its argument prototype would still apply.  */
5571 char connect();
5572
5573 int main() {
5574 connect()
5575 ; return 0; }
5576 EOF
5577 if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5578   rm -rf conftest*
5579   eval "ac_cv_lib_$ac_lib_var=yes"
5580 else
5581   echo "configure: failed program was:" >&5
5582   cat conftest.$ac_ext >&5
5583   rm -rf conftest*
5584   eval "ac_cv_lib_$ac_lib_var=no"
5585 fi
5586 rm -f conftest*
5587 xe_check_libs=""
5588
5589 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5590   echo "$ac_t""yes" 1>&6
5591   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5592 else
5593   echo "$ac_t""no" 1>&6
5594 fi
5595
5596
5597     fi
5598
5599     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5600     echo $ac_n "checking for remove""... $ac_c" 1>&6
5601 echo "configure:5602: checking for remove" >&5
5602
5603 cat > conftest.$ac_ext <<EOF
5604 #line 5605 "configure"
5605 #include "confdefs.h"
5606 /* System header to define __stub macros and hopefully few prototypes,
5607     which can conflict with char remove(); below.  */
5608 #include <assert.h>
5609 /* Override any gcc2 internal prototype to avoid an error.  */
5610 /* We use char because int might match the return type of a gcc2
5611     builtin and then its argument prototype would still apply.  */
5612 char remove();
5613
5614 int main() {
5615
5616 /* The GNU C library defines this for functions which it implements
5617     to always fail with ENOSYS.  Some functions are actually named
5618     something starting with __ and the normal name is an alias.  */
5619 #if defined (__stub_remove) || defined (__stub___remove)
5620 choke me
5621 #else
5622 remove();
5623 #endif
5624
5625 ; return 0; }
5626 EOF
5627 if { (eval echo configure:5628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5628   rm -rf conftest*
5629   eval "ac_cv_func_remove=yes"
5630 else
5631   echo "configure: failed program was:" >&5
5632   cat conftest.$ac_ext >&5
5633   rm -rf conftest*
5634   eval "ac_cv_func_remove=no"
5635 fi
5636 rm -f conftest*
5637
5638 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5639   echo "$ac_t""yes" 1>&6
5640   :
5641 else
5642   echo "$ac_t""no" 1>&6
5643 fi
5644
5645     if test $ac_cv_func_remove = no; then
5646       
5647 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5648 echo "configure:5649: checking for remove in -lposix" >&5
5649 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5650
5651 xe_check_libs=" -lposix "
5652 cat > conftest.$ac_ext <<EOF
5653 #line 5654 "configure"
5654 #include "confdefs.h"
5655 /* Override any gcc2 internal prototype to avoid an error.  */
5656 /* We use char because int might match the return type of a gcc2
5657     builtin and then its argument prototype would still apply.  */
5658 char remove();
5659
5660 int main() {
5661 remove()
5662 ; return 0; }
5663 EOF
5664 if { (eval echo configure:5665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5665   rm -rf conftest*
5666   eval "ac_cv_lib_$ac_lib_var=yes"
5667 else
5668   echo "configure: failed program was:" >&5
5669   cat conftest.$ac_ext >&5
5670   rm -rf conftest*
5671   eval "ac_cv_lib_$ac_lib_var=no"
5672 fi
5673 rm -f conftest*
5674 xe_check_libs=""
5675
5676 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5677   echo "$ac_t""yes" 1>&6
5678   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5679 else
5680   echo "$ac_t""no" 1>&6
5681 fi
5682
5683
5684     fi
5685
5686     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5687     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5688 echo "configure:5689: checking for shmat" >&5
5689
5690 cat > conftest.$ac_ext <<EOF
5691 #line 5692 "configure"
5692 #include "confdefs.h"
5693 /* System header to define __stub macros and hopefully few prototypes,
5694     which can conflict with char shmat(); below.  */
5695 #include <assert.h>
5696 /* Override any gcc2 internal prototype to avoid an error.  */
5697 /* We use char because int might match the return type of a gcc2
5698     builtin and then its argument prototype would still apply.  */
5699 char shmat();
5700
5701 int main() {
5702
5703 /* The GNU C library defines this for functions which it implements
5704     to always fail with ENOSYS.  Some functions are actually named
5705     something starting with __ and the normal name is an alias.  */
5706 #if defined (__stub_shmat) || defined (__stub___shmat)
5707 choke me
5708 #else
5709 shmat();
5710 #endif
5711
5712 ; return 0; }
5713 EOF
5714 if { (eval echo configure:5715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5715   rm -rf conftest*
5716   eval "ac_cv_func_shmat=yes"
5717 else
5718   echo "configure: failed program was:" >&5
5719   cat conftest.$ac_ext >&5
5720   rm -rf conftest*
5721   eval "ac_cv_func_shmat=no"
5722 fi
5723 rm -f conftest*
5724
5725 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5726   echo "$ac_t""yes" 1>&6
5727   :
5728 else
5729   echo "$ac_t""no" 1>&6
5730 fi
5731
5732     if test $ac_cv_func_shmat = no; then
5733       
5734 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5735 echo "configure:5736: checking for shmat in -lipc" >&5
5736 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5737
5738 xe_check_libs=" -lipc "
5739 cat > conftest.$ac_ext <<EOF
5740 #line 5741 "configure"
5741 #include "confdefs.h"
5742 /* Override any gcc2 internal prototype to avoid an error.  */
5743 /* We use char because int might match the return type of a gcc2
5744     builtin and then its argument prototype would still apply.  */
5745 char shmat();
5746
5747 int main() {
5748 shmat()
5749 ; return 0; }
5750 EOF
5751 if { (eval echo configure:5752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5752   rm -rf conftest*
5753   eval "ac_cv_lib_$ac_lib_var=yes"
5754 else
5755   echo "configure: failed program was:" >&5
5756   cat conftest.$ac_ext >&5
5757   rm -rf conftest*
5758   eval "ac_cv_lib_$ac_lib_var=no"
5759 fi
5760 rm -f conftest*
5761 xe_check_libs=""
5762
5763 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5764   echo "$ac_t""yes" 1>&6
5765   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5766 else
5767   echo "$ac_t""no" 1>&6
5768 fi
5769
5770
5771     fi
5772   fi
5773
5774   # Check for libraries that X11R6 Xt/Xaw programs need.
5775   ac_save_LDFLAGS="$LDFLAGS"
5776   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5777   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5778   # check for ICE first), but we must link in the order -lSM -lICE or
5779   # we get undefined symbols.  So assume we have SM if we have ICE.
5780   # These have to be linked with before -lX11, unlike the other
5781   # libraries we check for below, so use a different variable.
5782   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5783   
5784 xe_msg_checking="for IceConnectionNumber in -lICE"
5785 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5786 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5787 echo "configure:5788: checking "$xe_msg_checking"" >&5
5788 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5789
5790 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5791 cat > conftest.$ac_ext <<EOF
5792 #line 5793 "configure"
5793 #include "confdefs.h"
5794 /* Override any gcc2 internal prototype to avoid an error.  */
5795 /* We use char because int might match the return type of a gcc2
5796     builtin and then its argument prototype would still apply.  */
5797 char IceConnectionNumber();
5798
5799 int main() {
5800 IceConnectionNumber()
5801 ; return 0; }
5802 EOF
5803 if { (eval echo configure:5804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5804   rm -rf conftest*
5805   eval "ac_cv_lib_$ac_lib_var=yes"
5806 else
5807   echo "configure: failed program was:" >&5
5808   cat conftest.$ac_ext >&5
5809   rm -rf conftest*
5810   eval "ac_cv_lib_$ac_lib_var=no"
5811 fi
5812 rm -f conftest*
5813 xe_check_libs=""
5814
5815 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5816   echo "$ac_t""yes" 1>&6
5817   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5818 else
5819   echo "$ac_t""no" 1>&6
5820 fi
5821
5822
5823   LDFLAGS="$ac_save_LDFLAGS"
5824
5825 fi
5826  # Autoconf claims to find X library and include dirs for us.
5827   if test "$no_x" = "yes"
5828   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5829   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5830   fi
5831 fi
5832
5833 case "$with_x11" in
5834   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5835   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5836 esac
5837
5838 if test "$with_x11" = "yes"; then
5839   { test "$extra_verbose" = "yes" && cat << \EOF
5840     Defining HAVE_X_WINDOWS
5841 EOF
5842 cat >> confdefs.h <<\EOF
5843 #define HAVE_X_WINDOWS 1
5844 EOF
5845 }
5846
5847   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5848   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5849
5850       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5851     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5852     if test -d "$lib_dir" -a -d "$inc_dir"; then
5853       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5854         x_libraries="$lib_dir $x_libraries"
5855         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5856       esac
5857       case "$x_includes" in "$inc_dir"* ) ;; *)
5858         x_includes="$inc_dir $x_includes"
5859         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5860       esac
5861       break;       fi
5862   done
5863
5864     for rel in "X11R6" "X11R5" "X11R4"; do
5865     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5866     if test -d "$lib_dir" -a -d "$inc_dir"; then
5867       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5868         x_libraries="$x_libraries $lib_dir"
5869         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5870       esac
5871       case "$x_includes" in "$inc_dir"* ) ;; *)
5872         x_includes="$x_includes $inc_dir"
5873         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5874       esac
5875       break;     fi
5876   done
5877
5878     case "$opsys" in
5879   decosf*) if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi ;;
5880   esac
5881
5882   ld_switch_x_site="$X_LIBS"
5883
5884   
5885 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5886     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5887   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5888   
5889         runpath="" runpath_dirs=""
5890   if test -n "$LD_RUN_PATH"; then
5891     runpath="$LD_RUN_PATH"
5892   elif test "$GCC" = "yes"; then
5893         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5894     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5895     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5896     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5897       case "$arg" in P,* | -L* | -R* )
5898         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5899           {
5900 xe_runpath_dir="$dir"
5901   test "$xe_runpath_dir" != "/lib"     -a \
5902         "$xe_runpath_dir" != "/usr/lib" -a \
5903         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5904   eval "$xe_add_unique_runpath_dir"
5905 }
5906         done ;;
5907       esac
5908     done
5909     ld_switch_run="$ld_switch_run_save"
5910     rm -f conftest*
5911   else
5912         for arg in $ld_switch_site $ld_switch_x_site; do
5913       case "$arg" in -L*) {
5914 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5915   test "$xe_runpath_dir" != "/lib"     -a \
5916         "$xe_runpath_dir" != "/usr/lib" -a \
5917         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5918   eval "$xe_add_unique_runpath_dir"
5919 };; esac
5920     done
5921         if test "$opsys $need_motif" = "sol2 yes"; then
5922       xe_runpath_dir="/opt/SUNWdt/lib";
5923       eval "$xe_add_unique_runpath_dir";
5924     fi
5925   fi 
5926   if test -n "$runpath"; then
5927     ld_switch_run="${dash_r}${runpath}"
5928     
5929 if test "$GCC" = "yes"; then
5930   set x $ld_switch_run; shift; ld_switch_run=""
5931   while test -n "$1"; do
5932     case $1 in
5933       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5934       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5935       -Xlinker* ) ;;
5936       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5937     esac
5938     shift
5939   done
5940 fi
5941     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5942   fi
5943 fi
5944
5945
5946   if test "$extra_verbose" = "yes"; then
5947     echo; echo "X11 compilation variables:"
5948     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5949     echo
5950   fi
5951
5952             bitmapdirs=
5953   if test "$x_includes" != NONE; then
5954     for i in $x_includes; do
5955       if test -d "$i/bitmaps"; then
5956         bitmapdirs="$i/bitmaps:$bitmapdirs"
5957       fi
5958       if test -d "$i/X11/bitmaps"; then
5959         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5960       fi
5961     done
5962     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5963   fi
5964   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5965     Defining BITMAPDIR = "$bitmapdirs"
5966 EOF
5967 cat >> confdefs.h <<EOF
5968 #define BITMAPDIR "$bitmapdirs"
5969 EOF
5970 }
5971
5972
5973     echo "checking for X defines extracted by xmkmf" 1>&6
5974 echo "configure:5975: checking for X defines extracted by xmkmf" >&5
5975   rm -fr conftestdir
5976   if mkdir conftestdir; then
5977     cd conftestdir
5978     cat > Imakefile <<'EOF'
5979 xetest:
5980         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5981 EOF
5982     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5983       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5984       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5985     fi
5986     cd ..
5987     rm -fr conftestdir
5988     for word in $xmkmf_defines; do
5989       case "$word" in -D* )
5990         sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'`
5991         case "$word" in
5992           -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;;
5993           *     ) val=1 ;;
5994         esac
5995         if grep "^#define $sym " confdefs.h >/dev/null; then :; else
5996           if test "$val" = "1"
5997             then { test "$extra_verbose" = "yes" && cat << EOF
5998     Defining $sym
5999 EOF
6000 cat >> confdefs.h <<EOF
6001 #define $sym 1
6002 EOF
6003 }
6004
6005             else { test "$extra_verbose" = "yes" && cat << EOF
6006     Defining $sym = $val
6007 EOF
6008 cat >> confdefs.h <<EOF
6009 #define $sym $val
6010 EOF
6011 }
6012
6013           fi
6014         fi  ;;
6015       esac
6016     done
6017   fi
6018
6019     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
6020 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
6021 echo "configure:6022: checking for X11/Intrinsic.h" >&5
6022
6023 cat > conftest.$ac_ext <<EOF
6024 #line 6025 "configure"
6025 #include "confdefs.h"
6026 #include <X11/Intrinsic.h>
6027 EOF
6028 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6029 { (eval echo configure:6030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6030 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6031 if test -z "$ac_err"; then
6032   rm -rf conftest*
6033   eval "ac_cv_header_$ac_safe=yes"
6034 else
6035   echo "$ac_err" >&5
6036   echo "configure: failed program was:" >&5
6037   cat conftest.$ac_ext >&5
6038   rm -rf conftest*
6039   eval "ac_cv_header_$ac_safe=no"
6040 fi
6041 rm -f conftest*
6042 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6043   echo "$ac_t""yes" 1>&6
6044   :
6045 else
6046   echo "$ac_t""no" 1>&6
6047 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
6048 fi
6049
6050
6051       
6052 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
6053 echo "configure:6054: checking for XOpenDisplay in -lX11" >&5
6054 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
6055
6056 xe_check_libs=" -lX11 "
6057 cat > conftest.$ac_ext <<EOF
6058 #line 6059 "configure"
6059 #include "confdefs.h"
6060 /* Override any gcc2 internal prototype to avoid an error.  */
6061 /* We use char because int might match the return type of a gcc2
6062     builtin and then its argument prototype would still apply.  */
6063 char XOpenDisplay();
6064
6065 int main() {
6066 XOpenDisplay()
6067 ; return 0; }
6068 EOF
6069 if { (eval echo configure:6070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6070   rm -rf conftest*
6071   eval "ac_cv_lib_$ac_lib_var=yes"
6072 else
6073   echo "configure: failed program was:" >&5
6074   cat conftest.$ac_ext >&5
6075   rm -rf conftest*
6076   eval "ac_cv_lib_$ac_lib_var=no"
6077 fi
6078 rm -f conftest*
6079 xe_check_libs=""
6080
6081 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6082   echo "$ac_t""yes" 1>&6
6083   have_lib_x11=yes
6084 else
6085   echo "$ac_t""no" 1>&6
6086 fi
6087
6088
6089   if test "$have_lib_x11" != "yes"; then
6090     
6091 xe_msg_checking="for XGetFontProperty in -lX11"
6092 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
6093 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6094 echo "configure:6095: checking "$xe_msg_checking"" >&5
6095 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
6096
6097 xe_check_libs=" -lX11 -b i486-linuxaout"
6098 cat > conftest.$ac_ext <<EOF
6099 #line 6100 "configure"
6100 #include "confdefs.h"
6101 /* Override any gcc2 internal prototype to avoid an error.  */
6102 /* We use char because int might match the return type of a gcc2
6103     builtin and then its argument prototype would still apply.  */
6104 char XGetFontProperty();
6105
6106 int main() {
6107 XGetFontProperty()
6108 ; return 0; }
6109 EOF
6110 if { (eval echo configure:6111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6111   rm -rf conftest*
6112   eval "ac_cv_lib_$ac_lib_var=yes"
6113 else
6114   echo "configure: failed program was:" >&5
6115   cat conftest.$ac_ext >&5
6116   rm -rf conftest*
6117   eval "ac_cv_lib_$ac_lib_var=no"
6118 fi
6119 rm -f conftest*
6120 xe_check_libs=""
6121
6122 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6123   echo "$ac_t""yes" 1>&6
6124   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
6125 else
6126   echo "$ac_t""no" 1>&6
6127 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
6128 fi
6129
6130
6131   fi
6132   libs_x="-lX11"
6133   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
6134
6135     
6136 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
6137 echo "configure:6138: checking for XShapeSelectInput in -lXext" >&5
6138 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
6139
6140 xe_check_libs=" -lXext "
6141 cat > conftest.$ac_ext <<EOF
6142 #line 6143 "configure"
6143 #include "confdefs.h"
6144 /* Override any gcc2 internal prototype to avoid an error.  */
6145 /* We use char because int might match the return type of a gcc2
6146     builtin and then its argument prototype would still apply.  */
6147 char XShapeSelectInput();
6148
6149 int main() {
6150 XShapeSelectInput()
6151 ; return 0; }
6152 EOF
6153 if { (eval echo configure:6154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6154   rm -rf conftest*
6155   eval "ac_cv_lib_$ac_lib_var=yes"
6156 else
6157   echo "configure: failed program was:" >&5
6158   cat conftest.$ac_ext >&5
6159   rm -rf conftest*
6160   eval "ac_cv_lib_$ac_lib_var=no"
6161 fi
6162 rm -f conftest*
6163 xe_check_libs=""
6164
6165 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6166   echo "$ac_t""yes" 1>&6
6167   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
6168 else
6169   echo "$ac_t""no" 1>&6
6170 fi
6171
6172
6173
6174     
6175 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
6176 echo "configure:6177: checking for XtOpenDisplay in -lXt" >&5
6177 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
6178
6179 xe_check_libs=" -lXt "
6180 cat > conftest.$ac_ext <<EOF
6181 #line 6182 "configure"
6182 #include "confdefs.h"
6183 /* Override any gcc2 internal prototype to avoid an error.  */
6184 /* We use char because int might match the return type of a gcc2
6185     builtin and then its argument prototype would still apply.  */
6186 char XtOpenDisplay();
6187
6188 int main() {
6189 XtOpenDisplay()
6190 ; return 0; }
6191 EOF
6192 if { (eval echo configure:6193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6193   rm -rf conftest*
6194   eval "ac_cv_lib_$ac_lib_var=yes"
6195 else
6196   echo "configure: failed program was:" >&5
6197   cat conftest.$ac_ext >&5
6198   rm -rf conftest*
6199   eval "ac_cv_lib_$ac_lib_var=no"
6200 fi
6201 rm -f conftest*
6202 xe_check_libs=""
6203
6204 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6205   echo "$ac_t""yes" 1>&6
6206   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
6207 else
6208   echo "$ac_t""no" 1>&6
6209 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
6210 fi
6211
6212
6213
6214   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
6215 echo "configure:6216: checking the version of X11 being used" >&5
6216   cat > conftest.$ac_ext <<EOF
6217 #line 6218 "configure"
6218 #include "confdefs.h"
6219 #include <X11/Intrinsic.h>
6220     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
6221 EOF
6222 if { (eval echo configure:6223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6223 then
6224   ./conftest foobar; x11_release=$?
6225 else
6226   conftest_rc="$?"
6227   echo "configure: failed program was:" >&5
6228   cat conftest.$ac_ext >&5
6229   rm -fr conftest*
6230   x11_release=4
6231 fi
6232 rm -fr conftest*
6233   echo "$ac_t""R${x11_release}" 1>&6
6234   { test "$extra_verbose" = "yes" && cat << EOF
6235     Defining THIS_IS_X11R${x11_release}
6236 EOF
6237 cat >> confdefs.h <<EOF
6238 #define THIS_IS_X11R${x11_release} 1
6239 EOF
6240 }
6241
6242
6243   if test "${x11_release}" = "4"; then
6244     case "$with_widgets" in
6245       "" | "no") with_widgets=no ;;
6246       *) { echo "Error:" "Widget support requires X11R5 or greater" >&2; exit 1; } ;;
6247     esac
6248   fi
6249
6250   for ac_func in XConvertCase
6251 do
6252 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6253 echo "configure:6254: checking for $ac_func" >&5
6254
6255 cat > conftest.$ac_ext <<EOF
6256 #line 6257 "configure"
6257 #include "confdefs.h"
6258 /* System header to define __stub macros and hopefully few prototypes,
6259     which can conflict with char $ac_func(); below.  */
6260 #include <assert.h>
6261 /* Override any gcc2 internal prototype to avoid an error.  */
6262 /* We use char because int might match the return type of a gcc2
6263     builtin and then its argument prototype would still apply.  */
6264 char $ac_func();
6265
6266 int main() {
6267
6268 /* The GNU C library defines this for functions which it implements
6269     to always fail with ENOSYS.  Some functions are actually named
6270     something starting with __ and the normal name is an alias.  */
6271 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6272 choke me
6273 #else
6274 $ac_func();
6275 #endif
6276
6277 ; return 0; }
6278 EOF
6279 if { (eval echo configure:6280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6280   rm -rf conftest*
6281   eval "ac_cv_func_$ac_func=yes"
6282 else
6283   echo "configure: failed program was:" >&5
6284   cat conftest.$ac_ext >&5
6285   rm -rf conftest*
6286   eval "ac_cv_func_$ac_func=no"
6287 fi
6288 rm -f conftest*
6289
6290 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6291   echo "$ac_t""yes" 1>&6
6292     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6293   { test "$extra_verbose" = "yes" && cat << EOF
6294     Defining $ac_tr_func
6295 EOF
6296 cat >> confdefs.h <<EOF
6297 #define $ac_tr_func 1
6298 EOF
6299 }
6300  
6301 else
6302   echo "$ac_t""no" 1>&6
6303 fi
6304 done
6305
6306
6307   for ac_hdr in X11/Xlocale.h
6308 do
6309 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6310 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6311 echo "configure:6312: checking for $ac_hdr" >&5
6312
6313 cat > conftest.$ac_ext <<EOF
6314 #line 6315 "configure"
6315 #include "confdefs.h"
6316 #include <$ac_hdr>
6317 EOF
6318 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6319 { (eval echo configure:6320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6320 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6321 if test -z "$ac_err"; then
6322   rm -rf conftest*
6323   eval "ac_cv_header_$ac_safe=yes"
6324 else
6325   echo "$ac_err" >&5
6326   echo "configure: failed program was:" >&5
6327   cat conftest.$ac_ext >&5
6328   rm -rf conftest*
6329   eval "ac_cv_header_$ac_safe=no"
6330 fi
6331 rm -f conftest*
6332 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6333   echo "$ac_t""yes" 1>&6
6334     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6335   { test "$extra_verbose" = "yes" && cat << EOF
6336     Defining $ac_tr_hdr
6337 EOF
6338 cat >> confdefs.h <<EOF
6339 #define $ac_tr_hdr 1
6340 EOF
6341 }
6342  
6343 else
6344   echo "$ac_t""no" 1>&6
6345 fi
6346 done
6347
6348
6349     for ac_func in XRegisterIMInstantiateCallback
6350 do
6351 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6352 echo "configure:6353: checking for $ac_func" >&5
6353
6354 cat > conftest.$ac_ext <<EOF
6355 #line 6356 "configure"
6356 #include "confdefs.h"
6357 /* System header to define __stub macros and hopefully few prototypes,
6358     which can conflict with char $ac_func(); below.  */
6359 #include <assert.h>
6360 /* Override any gcc2 internal prototype to avoid an error.  */
6361 /* We use char because int might match the return type of a gcc2
6362     builtin and then its argument prototype would still apply.  */
6363 char $ac_func();
6364
6365 int main() {
6366
6367 /* The GNU C library defines this for functions which it implements
6368     to always fail with ENOSYS.  Some functions are actually named
6369     something starting with __ and the normal name is an alias.  */
6370 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6371 choke me
6372 #else
6373 $ac_func();
6374 #endif
6375
6376 ; return 0; }
6377 EOF
6378 if { (eval echo configure:6379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6379   rm -rf conftest*
6380   eval "ac_cv_func_$ac_func=yes"
6381 else
6382   echo "configure: failed program was:" >&5
6383   cat conftest.$ac_ext >&5
6384   rm -rf conftest*
6385   eval "ac_cv_func_$ac_func=no"
6386 fi
6387 rm -f conftest*
6388
6389 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6390   echo "$ac_t""yes" 1>&6
6391     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6392   { test "$extra_verbose" = "yes" && cat << EOF
6393     Defining $ac_tr_func
6394 EOF
6395 cat >> confdefs.h <<EOF
6396 #define $ac_tr_func 1
6397 EOF
6398 }
6399  
6400 else
6401   echo "$ac_t""no" 1>&6
6402 fi
6403 done
6404
6405   echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6
6406 echo "configure:6407: checking for standard XRegisterIMInstantiateCallback prototype" >&5
6407   cat > conftest.$ac_ext <<EOF
6408 #line 6409 "configure"
6409 #include "confdefs.h"
6410
6411 #define NeedFunctionPrototypes 1
6412 #include <X11/Xlib.h>
6413 extern Bool XRegisterIMInstantiateCallback(
6414    Display*, struct _XrmHashBucketRec*, char*, char*, XIMProc, XPointer*);
6415
6416 int main() {
6417
6418 ; return 0; }
6419 EOF
6420 if { (eval echo configure:6421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6421   rm -rf conftest*
6422   echo "$ac_t""yes" 1>&6
6423 else
6424   echo "configure: failed program was:" >&5
6425   cat conftest.$ac_ext >&5
6426   rm -rf conftest*
6427   echo "$ac_t""no" 1>&6
6428    { test "$extra_verbose" = "yes" && cat << \EOF
6429     Defining XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE
6430 EOF
6431 cat >> confdefs.h <<\EOF
6432 #define XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE 1
6433 EOF
6434 }
6435
6436 fi
6437 rm -f conftest*
6438
6439     test -z "$with_xmu" && { 
6440 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
6441 echo "configure:6442: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
6442 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
6443
6444 xe_check_libs=" -lXmu "
6445 cat > conftest.$ac_ext <<EOF
6446 #line 6447 "configure"
6447 #include "confdefs.h"
6448 /* Override any gcc2 internal prototype to avoid an error.  */
6449 /* We use char because int might match the return type of a gcc2
6450     builtin and then its argument prototype would still apply.  */
6451 char XmuReadBitmapDataFromFile();
6452
6453 int main() {
6454 XmuReadBitmapDataFromFile()
6455 ; return 0; }
6456 EOF
6457 if { (eval echo configure:6458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6458   rm -rf conftest*
6459   eval "ac_cv_lib_$ac_lib_var=yes"
6460 else
6461   echo "configure: failed program was:" >&5
6462   cat conftest.$ac_ext >&5
6463   rm -rf conftest*
6464   eval "ac_cv_lib_$ac_lib_var=no"
6465 fi
6466 rm -f conftest*
6467 xe_check_libs=""
6468
6469 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6470   echo "$ac_t""yes" 1>&6
6471   with_xmu=yes
6472 else
6473   echo "$ac_t""no" 1>&6
6474 with_xmu=no
6475 fi
6476
6477  }
6478   if test "$with_xmu" = "no"; then
6479     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
6480    echo "    xemacs will be linked with \"xmu.o\""
6481  fi
6482   else
6483     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
6484     { test "$extra_verbose" = "yes" && cat << \EOF
6485     Defining HAVE_XMU
6486 EOF
6487 cat >> confdefs.h <<\EOF
6488 #define HAVE_XMU 1
6489 EOF
6490 }
6491
6492   fi
6493
6494       
6495 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
6496 echo "configure:6497: checking for main in -lXbsd" >&5
6497 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
6498
6499 xe_check_libs=" -lXbsd "
6500 cat > conftest.$ac_ext <<EOF
6501 #line 6502 "configure"
6502 #include "confdefs.h"
6503
6504 int main() {
6505 main()
6506 ; return 0; }
6507 EOF
6508 if { (eval echo configure:6509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6509   rm -rf conftest*
6510   eval "ac_cv_lib_$ac_lib_var=yes"
6511 else
6512   echo "configure: failed program was:" >&5
6513   cat conftest.$ac_ext >&5
6514   rm -rf conftest*
6515   eval "ac_cv_lib_$ac_lib_var=no"
6516 fi
6517 rm -f conftest*
6518 xe_check_libs=""
6519
6520 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6521   echo "$ac_t""yes" 1>&6
6522   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
6523 else
6524   echo "$ac_t""no" 1>&6
6525 fi
6526
6527
6528
6529     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
6530         if test "$GCC" = "yes"; then
6531       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
6532       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
6533     else
6534       case "$CC" in
6535         "xlc" ) CC="xlc_r" ;;
6536         "xlC" ) CC="xlC_r" ;;
6537         "cc"  ) CC="cc_r" ;;
6538       esac
6539     fi
6540   fi
6541
6542 fi 
6543 if test "$with_msw" != "no"; then
6544   echo "checking for MS-Windows" 1>&6
6545 echo "configure:6546: checking for MS-Windows" >&5
6546   
6547 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
6548 echo "configure:6549: checking for main in -lgdi32" >&5
6549 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
6550
6551 xe_check_libs=" -lgdi32 "
6552 cat > conftest.$ac_ext <<EOF
6553 #line 6554 "configure"
6554 #include "confdefs.h"
6555
6556 int main() {
6557 main()
6558 ; return 0; }
6559 EOF
6560 if { (eval echo configure:6561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6561   rm -rf conftest*
6562   eval "ac_cv_lib_$ac_lib_var=yes"
6563 else
6564   echo "configure: failed program was:" >&5
6565   cat conftest.$ac_ext >&5
6566   rm -rf conftest*
6567   eval "ac_cv_lib_$ac_lib_var=no"
6568 fi
6569 rm -f conftest*
6570 xe_check_libs=""
6571
6572 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6573   echo "$ac_t""yes" 1>&6
6574   with_msw=yes
6575 else
6576   echo "$ac_t""no" 1>&6
6577 fi
6578
6579
6580   if test "$with_msw" = "yes"; then
6581     { test "$extra_verbose" = "yes" && cat << \EOF
6582     Defining HAVE_MS_WINDOWS
6583 EOF
6584 cat >> confdefs.h <<\EOF
6585 #define HAVE_MS_WINDOWS 1
6586 EOF
6587 }
6588
6589
6590         MAKE_SUBDIR="$MAKE_SUBDIR netinstall" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"netinstall\" to \$MAKE_SUBDIR"; fi
6591     SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS netinstall" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"netinstall\" to \$SRC_SUBDIR_DEPS"; fi
6592     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR netinstall" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"netinstall\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
6593
6594     install_pp="$blddir/lib-src/installexe.sh"
6595     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool\" to \$libs_system"; fi
6596     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6597     if test "$window_system" != x11; then
6598         window_system=msw
6599         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6600             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6601    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6602  fi
6603         test "$with_menubars"   != "no" && with_menubars=msw \
6604             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6605    echo "    xemacs will be linked with \"menubar-msw.o\""
6606  fi
6607         test "$with_toolbars"   != "no" && with_toolbars=msw \
6608             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6609    echo "    xemacs will be linked with \"toolbar-msw.o\""
6610  fi
6611         test "$with_dialogs"   != "no" && with_dialogs=msw \
6612             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6613    echo "    xemacs will be linked with \"dialog-msw.o\""
6614  fi
6615         test "$with_widgets"   != "no" && with_widgets=msw
6616     else
6617         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6618    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6619  fi
6620         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6621    echo "    xemacs will be linked with \"menubar-msw.o\""
6622  fi
6623         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6624    echo "    xemacs will be linked with \"toolbar-msw.o\""
6625  fi
6626         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6627    echo "    xemacs will be linked with \"dialog-msw.o\""
6628  fi
6629     fi
6630         cat > conftest.$ac_ext <<EOF
6631 #line 6632 "configure"
6632 #include "confdefs.h"
6633 #include <fcntl.h>
6634     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6635 EOF
6636 if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6637 then
6638   { test "$extra_verbose" = "yes" && cat << \EOF
6639     Defining HAVE_MSG_SELECT
6640 EOF
6641 cat >> confdefs.h <<\EOF
6642 #define HAVE_MSG_SELECT 1
6643 EOF
6644 }
6645
6646 else
6647   conftest_rc="$?"
6648   echo "configure: failed program was:" >&5
6649   cat conftest.$ac_ext >&5
6650 fi
6651 rm -fr conftest*
6652     with_file_coding=yes
6653     extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o" &&  if test "$extra_verbose" = "yes"; then
6654    echo "    xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o\""
6655  fi
6656   fi
6657 fi
6658
6659
6660
6661 test -z "$window_system" && window_system="none"
6662
6663 if test "$window_system" = "none"; then
6664   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6665   do
6666     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6667        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6668     fi
6669     eval "with_${feature}=no"
6670   done
6671 else
6672   test -z "$with_toolbars" && with_toolbars=yes
6673 fi
6674
6675 if test "$with_msw" != "yes"; then
6676   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6677   do
6678     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6679        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6680     fi
6681     eval "with_${feature}=no"
6682   done
6683 else
6684   :
6685 fi
6686
6687 if test "$with_x11" != "yes"; then
6688             for feature in tooltalk cde offix wmcommand xim xmu nas_sound
6689   do
6690     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6691        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6692     fi
6693     eval "with_${feature}=no"
6694   done
6695 fi
6696
6697 if test "$with_x11" = "yes"; then
6698   ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'`
6699 echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6
6700 echo "configure:6701: checking for X11/extensions/shape.h" >&5
6701
6702 cat > conftest.$ac_ext <<EOF
6703 #line 6704 "configure"
6704 #include "confdefs.h"
6705 #include <X11/extensions/shape.h>
6706 EOF
6707 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6708 { (eval echo configure:6709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6709 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6710 if test -z "$ac_err"; then
6711   rm -rf conftest*
6712   eval "ac_cv_header_$ac_safe=yes"
6713 else
6714   echo "$ac_err" >&5
6715   echo "configure: failed program was:" >&5
6716   cat conftest.$ac_ext >&5
6717   rm -rf conftest*
6718   eval "ac_cv_header_$ac_safe=no"
6719 fi
6720 rm -f conftest*
6721 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6722   echo "$ac_t""yes" 1>&6
6723   
6724    { test "$extra_verbose" = "yes" && cat << \EOF
6725     Defining HAVE_BALLOON_HELP
6726 EOF
6727 cat >> confdefs.h <<\EOF
6728 #define HAVE_BALLOON_HELP 1
6729 EOF
6730 }
6731
6732    extra_objs="$extra_objs balloon_help.o balloon-x.o" &&  if test "$extra_verbose" = "yes"; then
6733    echo "    xemacs will be linked with \"balloon_help.o balloon-x.o\""
6734  fi
6735 else
6736   echo "$ac_t""no" 1>&6
6737 fi
6738
6739 fi
6740
6741 bitmapdir=
6742
6743 case "$window_system" in
6744   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6745   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6746   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6747 esac
6748
6749 case "$x_libraries" in *X11R4* )
6750   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6751   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6752 esac
6753
6754 echo "checking for WM_COMMAND option" 1>&6
6755 echo "configure:6756: checking for WM_COMMAND option" >&5;
6756 if test "$with_wmcommand" != "no"; then
6757   { test "$extra_verbose" = "yes" && cat << \EOF
6758     Defining HAVE_WMCOMMAND
6759 EOF
6760 cat >> confdefs.h <<\EOF
6761 #define HAVE_WMCOMMAND 1
6762 EOF
6763 }
6764
6765 fi
6766
6767 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6768 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6769 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6770 echo "configure:6771: checking for X11/Xauth.h" >&5
6771
6772 cat > conftest.$ac_ext <<EOF
6773 #line 6774 "configure"
6774 #include "confdefs.h"
6775 #include <X11/Xauth.h>
6776 EOF
6777 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6778 { (eval echo configure:6779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6779 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6780 if test -z "$ac_err"; then
6781   rm -rf conftest*
6782   eval "ac_cv_header_$ac_safe=yes"
6783 else
6784   echo "$ac_err" >&5
6785   echo "configure: failed program was:" >&5
6786   cat conftest.$ac_ext >&5
6787   rm -rf conftest*
6788   eval "ac_cv_header_$ac_safe=no"
6789 fi
6790 rm -f conftest*
6791 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6792   echo "$ac_t""yes" 1>&6
6793   :
6794 else
6795   echo "$ac_t""no" 1>&6
6796 with_xauth=no
6797 fi
6798  }
6799 test -z "$with_xauth" && { 
6800 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6801 echo "configure:6802: checking for XauGetAuthByAddr in -lXau" >&5
6802 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6803
6804 xe_check_libs=" -lXau "
6805 cat > conftest.$ac_ext <<EOF
6806 #line 6807 "configure"
6807 #include "confdefs.h"
6808 /* Override any gcc2 internal prototype to avoid an error.  */
6809 /* We use char because int might match the return type of a gcc2
6810     builtin and then its argument prototype would still apply.  */
6811 char XauGetAuthByAddr();
6812
6813 int main() {
6814 XauGetAuthByAddr()
6815 ; return 0; }
6816 EOF
6817 if { (eval echo configure:6818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6818   rm -rf conftest*
6819   eval "ac_cv_lib_$ac_lib_var=yes"
6820 else
6821   echo "configure: failed program was:" >&5
6822   cat conftest.$ac_ext >&5
6823   rm -rf conftest*
6824   eval "ac_cv_lib_$ac_lib_var=no"
6825 fi
6826 rm -f conftest*
6827 xe_check_libs=""
6828
6829 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6830   echo "$ac_t""yes" 1>&6
6831   :
6832 else
6833   echo "$ac_t""no" 1>&6
6834 with_xauth=no
6835 fi
6836
6837  }
6838 test -z "$with_xauth" && with_xauth=yes
6839 if test "$with_xauth" = "yes"; then
6840   { test "$extra_verbose" = "yes" && cat << \EOF
6841     Defining HAVE_XAUTH
6842 EOF
6843 cat >> confdefs.h <<\EOF
6844 #define HAVE_XAUTH 1
6845 EOF
6846 }
6847
6848   
6849 T=""
6850 for W in $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
6851 libs_xauth="$T"
6852
6853 fi
6854
6855
6856
6857
6858 if test "$with_tooltalk" != "no" ; then
6859       for dir in "" "Tt/" "desktop/" ; do
6860     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6861 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6862 echo "configure:6863: checking for ${dir}tt_c.h" >&5
6863
6864 cat > conftest.$ac_ext <<EOF
6865 #line 6866 "configure"
6866 #include "confdefs.h"
6867 #include <${dir}tt_c.h>
6868 EOF
6869 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6870 { (eval echo configure:6871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6871 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6872 if test -z "$ac_err"; then
6873   rm -rf conftest*
6874   eval "ac_cv_header_$ac_safe=yes"
6875 else
6876   echo "$ac_err" >&5
6877   echo "configure: failed program was:" >&5
6878   cat conftest.$ac_ext >&5
6879   rm -rf conftest*
6880   eval "ac_cv_header_$ac_safe=no"
6881 fi
6882 rm -f conftest*
6883 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6884   echo "$ac_t""yes" 1>&6
6885   tt_c_h_file="${dir}tt_c.h"; break
6886 else
6887   echo "$ac_t""no" 1>&6
6888 fi
6889
6890   done
6891   if test -z "$tt_c_h_file"; then
6892     if test "$with_tooltalk" = "yes"; then
6893       (echo "$progname: Usage error:"
6894 echo " " "Unable to find required tooltalk header files."
6895 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6896     fi
6897     with_tooltalk=no
6898   fi
6899 fi
6900 if test "$with_tooltalk" != "no" ; then
6901   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6902     
6903 xe_msg_checking="for tt_message_create in -ltt"
6904 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6905 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6906 echo "configure:6907: checking "$xe_msg_checking"" >&5
6907 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6908
6909 xe_check_libs=" -ltt $extra_libs"
6910 cat > conftest.$ac_ext <<EOF
6911 #line 6912 "configure"
6912 #include "confdefs.h"
6913 /* Override any gcc2 internal prototype to avoid an error.  */
6914 /* We use char because int might match the return type of a gcc2
6915     builtin and then its argument prototype would still apply.  */
6916 char tt_message_create();
6917
6918 int main() {
6919 tt_message_create()
6920 ; return 0; }
6921 EOF
6922 if { (eval echo configure:6923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6923   rm -rf conftest*
6924   eval "ac_cv_lib_$ac_lib_var=yes"
6925 else
6926   echo "configure: failed program was:" >&5
6927   cat conftest.$ac_ext >&5
6928   rm -rf conftest*
6929   eval "ac_cv_lib_$ac_lib_var=no"
6930 fi
6931 rm -f conftest*
6932 xe_check_libs=""
6933
6934 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6935   echo "$ac_t""yes" 1>&6
6936   tt_libs="-ltt $extra_libs"; break
6937 else
6938   echo "$ac_t""no" 1>&6
6939 :
6940 fi
6941
6942
6943   done
6944   if test -z "$tt_libs"; then
6945     if test "$with_tooltalk" = "yes"; then
6946       (echo "$progname: Usage error:"
6947 echo " " "Unable to find required tooltalk libraries."
6948 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6949     fi
6950     with_tooltalk=no
6951   fi
6952 fi
6953 test -z "$with_tooltalk" && with_tooltalk=yes
6954 if test "$with_tooltalk" = "yes"; then
6955   { test "$extra_verbose" = "yes" && cat << \EOF
6956     Defining TOOLTALK
6957 EOF
6958 cat >> confdefs.h <<\EOF
6959 #define TOOLTALK 1
6960 EOF
6961 }
6962
6963   { test "$extra_verbose" = "yes" && cat << EOF
6964     Defining TT_C_H_FILE = "$tt_c_h_file"
6965 EOF
6966 cat >> confdefs.h <<EOF
6967 #define TT_C_H_FILE "$tt_c_h_file"
6968 EOF
6969 }
6970
6971   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6972   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6973    echo "    xemacs will be linked with \"tooltalk.o\""
6974  fi
6975 fi
6976
6977 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6978 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6979 echo "configure:6980: checking for Dt/Dt.h" >&5
6980
6981 cat > conftest.$ac_ext <<EOF
6982 #line 6983 "configure"
6983 #include "confdefs.h"
6984 #include <Dt/Dt.h>
6985 EOF
6986 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6987 { (eval echo configure:6988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6988 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6989 if test -z "$ac_err"; then
6990   rm -rf conftest*
6991   eval "ac_cv_header_$ac_safe=yes"
6992 else
6993   echo "$ac_err" >&5
6994   echo "configure: failed program was:" >&5
6995   cat conftest.$ac_ext >&5
6996   rm -rf conftest*
6997   eval "ac_cv_header_$ac_safe=no"
6998 fi
6999 rm -f conftest*
7000 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7001   echo "$ac_t""yes" 1>&6
7002   :
7003 else
7004   echo "$ac_t""no" 1>&6
7005 with_cde=no
7006 fi
7007  }
7008 test -z "$with_cde" && { 
7009 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
7010 echo "configure:7011: checking for DtDndDragStart in -lDtSvc" >&5
7011 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
7012
7013 xe_check_libs=" -lDtSvc "
7014 cat > conftest.$ac_ext <<EOF
7015 #line 7016 "configure"
7016 #include "confdefs.h"
7017 /* Override any gcc2 internal prototype to avoid an error.  */
7018 /* We use char because int might match the return type of a gcc2
7019     builtin and then its argument prototype would still apply.  */
7020 char DtDndDragStart();
7021
7022 int main() {
7023 DtDndDragStart()
7024 ; return 0; }
7025 EOF
7026 if { (eval echo configure:7027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7027   rm -rf conftest*
7028   eval "ac_cv_lib_$ac_lib_var=yes"
7029 else
7030   echo "configure: failed program was:" >&5
7031   cat conftest.$ac_ext >&5
7032   rm -rf conftest*
7033   eval "ac_cv_lib_$ac_lib_var=no"
7034 fi
7035 rm -f conftest*
7036 xe_check_libs=""
7037
7038 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7039   echo "$ac_t""yes" 1>&6
7040   :
7041 else
7042   echo "$ac_t""no" 1>&6
7043 with_cde=no
7044 fi
7045
7046  }
7047 test -z "$with_cde" && with_cde=yes
7048 if test "$with_dragndrop" = no; then
7049   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
7050   with_cde=no
7051 fi
7052 if test "$with_cde" = "yes" ; then
7053   { test "$extra_verbose" = "yes" && cat << \EOF
7054     Defining HAVE_CDE
7055 EOF
7056 cat >> confdefs.h <<\EOF
7057 #define HAVE_CDE 1
7058 EOF
7059 }
7060
7061   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
7062   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
7063   with_tooltalk=yes # CDE requires Tooltalk
7064   need_motif=yes    # CDE requires Motif
7065 fi
7066
7067 test "$window_system" != "x11" && with_offix=no
7068 if test "$with_xmu" != yes -a "$with_x11" = yes; then
7069   echo "configure: warning: No OffiX without real Xmu support" 1>&2
7070   with_offix=no
7071 fi
7072 if test "$with_dragndrop" = no; then
7073   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
7074   with_offix=no
7075 fi
7076 if test "$with_cde" = yes; then
7077   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
7078   with_offix=no
7079 fi
7080 test -z "$with_offix" && with_offix=no
7081 if test "$with_offix" = "yes"; then
7082   { test "$extra_verbose" = "yes" && cat << \EOF
7083     Defining HAVE_OFFIX_DND
7084 EOF
7085 cat >> confdefs.h <<\EOF
7086 #define HAVE_OFFIX_DND 1
7087 EOF
7088 }
7089
7090   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
7091   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
7092 fi
7093
7094 if test "$with_dragndrop" != "no" ; then
7095   echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
7096 echo "configure:7097: checking if drag and drop API is needed" >&5
7097   if test -n "$dragndrop_proto" ; then
7098     with_dragndrop=yes
7099     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
7100     { test "$extra_verbose" = "yes" && cat << \EOF
7101     Defining HAVE_DRAGNDROP
7102 EOF
7103 cat >> confdefs.h <<\EOF
7104 #define HAVE_DRAGNDROP 1
7105 EOF
7106 }
7107
7108     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
7109   else
7110     with_dragndrop=no
7111     echo "$ac_t""no" 1>&6
7112   fi
7113 fi
7114
7115 echo "checking for LDAP" 1>&6
7116 echo "configure:7117: checking for LDAP" >&5
7117 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
7118 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
7119 echo "configure:7120: checking for ldap.h" >&5
7120
7121 cat > conftest.$ac_ext <<EOF
7122 #line 7123 "configure"
7123 #include "confdefs.h"
7124 #include <ldap.h>
7125 EOF
7126 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7127 { (eval echo configure:7128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7128 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7129 if test -z "$ac_err"; then
7130   rm -rf conftest*
7131   eval "ac_cv_header_$ac_safe=yes"
7132 else
7133   echo "$ac_err" >&5
7134   echo "configure: failed program was:" >&5
7135   cat conftest.$ac_ext >&5
7136   rm -rf conftest*
7137   eval "ac_cv_header_$ac_safe=no"
7138 fi
7139 rm -f conftest*
7140 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7141   echo "$ac_t""yes" 1>&6
7142   :
7143 else
7144   echo "$ac_t""no" 1>&6
7145 with_ldap=no
7146 fi
7147  }
7148 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
7149 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
7150 echo "configure:7151: checking for lber.h" >&5
7151
7152 cat > conftest.$ac_ext <<EOF
7153 #line 7154 "configure"
7154 #include "confdefs.h"
7155 #include <lber.h>
7156 EOF
7157 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7158 { (eval echo configure:7159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7159 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7160 if test -z "$ac_err"; then
7161   rm -rf conftest*
7162   eval "ac_cv_header_$ac_safe=yes"
7163 else
7164   echo "$ac_err" >&5
7165   echo "configure: failed program was:" >&5
7166   cat conftest.$ac_ext >&5
7167   rm -rf conftest*
7168   eval "ac_cv_header_$ac_safe=no"
7169 fi
7170 rm -f conftest*
7171 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7172   echo "$ac_t""yes" 1>&6
7173   :
7174 else
7175   echo "$ac_t""no" 1>&6
7176 with_ldap=no
7177 fi
7178  }
7179 if test "$with_ldap" != "no"; then
7180   
7181 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
7182 echo "configure:7183: checking for ldap_search in -lldap" >&5
7183 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
7184
7185 xe_check_libs=" -lldap "
7186 cat > conftest.$ac_ext <<EOF
7187 #line 7188 "configure"
7188 #include "confdefs.h"
7189 /* Override any gcc2 internal prototype to avoid an error.  */
7190 /* We use char because int might match the return type of a gcc2
7191     builtin and then its argument prototype would still apply.  */
7192 char ldap_search();
7193
7194 int main() {
7195 ldap_search()
7196 ; return 0; }
7197 EOF
7198 if { (eval echo configure:7199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7199   rm -rf conftest*
7200   eval "ac_cv_lib_$ac_lib_var=yes"
7201 else
7202   echo "configure: failed program was:" >&5
7203   cat conftest.$ac_ext >&5
7204   rm -rf conftest*
7205   eval "ac_cv_lib_$ac_lib_var=no"
7206 fi
7207 rm -f conftest*
7208 xe_check_libs=""
7209
7210 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7211   echo "$ac_t""yes" 1>&6
7212   with_ldap_nolber=yes
7213 else
7214   echo "$ac_t""no" 1>&6
7215 with_ldap_nolber=no
7216 fi
7217
7218
7219   test "$with_ldap_nolber" = "no" && { 
7220 xe_msg_checking="for ldap_open in -lldap"
7221 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
7222 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7223 echo "configure:7224: checking "$xe_msg_checking"" >&5
7224 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7225
7226 xe_check_libs=" -lldap -llber"
7227 cat > conftest.$ac_ext <<EOF
7228 #line 7229 "configure"
7229 #include "confdefs.h"
7230 /* Override any gcc2 internal prototype to avoid an error.  */
7231 /* We use char because int might match the return type of a gcc2
7232     builtin and then its argument prototype would still apply.  */
7233 char ldap_open();
7234
7235 int main() {
7236 ldap_open()
7237 ; return 0; }
7238 EOF
7239 if { (eval echo configure:7240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7240   rm -rf conftest*
7241   eval "ac_cv_lib_$ac_lib_var=yes"
7242 else
7243   echo "configure: failed program was:" >&5
7244   cat conftest.$ac_ext >&5
7245   rm -rf conftest*
7246   eval "ac_cv_lib_$ac_lib_var=no"
7247 fi
7248 rm -f conftest*
7249 xe_check_libs=""
7250
7251 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7252   echo "$ac_t""yes" 1>&6
7253   with_ldap_lber=yes
7254 else
7255   echo "$ac_t""no" 1>&6
7256 with_ldap_lber=no
7257 fi
7258
7259  }
7260   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { 
7261 xe_msg_checking="for ldap_open in -lldap"
7262 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
7263 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7264 echo "configure:7265: checking "$xe_msg_checking"" >&5
7265 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7266
7267 xe_check_libs=" -lldap -llber -lkrb"
7268 cat > conftest.$ac_ext <<EOF
7269 #line 7270 "configure"
7270 #include "confdefs.h"
7271 /* Override any gcc2 internal prototype to avoid an error.  */
7272 /* We use char because int might match the return type of a gcc2
7273     builtin and then its argument prototype would still apply.  */
7274 char ldap_open();
7275
7276 int main() {
7277 ldap_open()
7278 ; return 0; }
7279 EOF
7280 if { (eval echo configure:7281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7281   rm -rf conftest*
7282   eval "ac_cv_lib_$ac_lib_var=yes"
7283 else
7284   echo "configure: failed program was:" >&5
7285   cat conftest.$ac_ext >&5
7286   rm -rf conftest*
7287   eval "ac_cv_lib_$ac_lib_var=no"
7288 fi
7289 rm -f conftest*
7290 xe_check_libs=""
7291
7292 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7293   echo "$ac_t""yes" 1>&6
7294   with_ldap_krb=yes
7295 else
7296   echo "$ac_t""no" 1>&6
7297 with_ldap_krb=no
7298 fi
7299
7300  }
7301   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { 
7302 xe_msg_checking="for ldap_open in -lldap"
7303 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
7304 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7305 echo "configure:7306: checking "$xe_msg_checking"" >&5
7306 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7307
7308 xe_check_libs=" -lldap -llber -lkrb -ldes"
7309 cat > conftest.$ac_ext <<EOF
7310 #line 7311 "configure"
7311 #include "confdefs.h"
7312 /* Override any gcc2 internal prototype to avoid an error.  */
7313 /* We use char because int might match the return type of a gcc2
7314     builtin and then its argument prototype would still apply.  */
7315 char ldap_open();
7316
7317 int main() {
7318 ldap_open()
7319 ; return 0; }
7320 EOF
7321 if { (eval echo configure:7322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7322   rm -rf conftest*
7323   eval "ac_cv_lib_$ac_lib_var=yes"
7324 else
7325   echo "configure: failed program was:" >&5
7326   cat conftest.$ac_ext >&5
7327   rm -rf conftest*
7328   eval "ac_cv_lib_$ac_lib_var=no"
7329 fi
7330 rm -f conftest*
7331 xe_check_libs=""
7332
7333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7334   echo "$ac_t""yes" 1>&6
7335   with_ldap_krbdes=yes
7336 else
7337   echo "$ac_t""no" 1>&6
7338 with_ldap_krbdes=no
7339 fi
7340
7341  }
7342   test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes
7343 fi
7344 if test "$with_ldap" = "yes"; then
7345   { test "$extra_verbose" = "yes" && cat << \EOF
7346     Defining HAVE_LDAP
7347 EOF
7348 cat >> confdefs.h <<\EOF
7349 #define HAVE_LDAP 1
7350 EOF
7351 }
7352
7353   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
7354    echo "    xemacs will be linked with \"eldap.o\""
7355  fi
7356   if test "$with_ldap_nolber" = "yes" ; then
7357     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
7358   else
7359     if test "$with_ldap_krb" = "yes" ; then
7360       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
7361     fi
7362     if test "$with_ldap_krbdes" = "yes" ; then
7363       LIBS="-ldes $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldes\" to \$LIBS"; fi
7364       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
7365     fi
7366     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
7367     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
7368   fi
7369   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
7370 do
7371 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7372 echo "configure:7373: checking for $ac_func" >&5
7373
7374 cat > conftest.$ac_ext <<EOF
7375 #line 7376 "configure"
7376 #include "confdefs.h"
7377 /* System header to define __stub macros and hopefully few prototypes,
7378     which can conflict with char $ac_func(); below.  */
7379 #include <assert.h>
7380 /* Override any gcc2 internal prototype to avoid an error.  */
7381 /* We use char because int might match the return type of a gcc2
7382     builtin and then its argument prototype would still apply.  */
7383 char $ac_func();
7384
7385 int main() {
7386
7387 /* The GNU C library defines this for functions which it implements
7388     to always fail with ENOSYS.  Some functions are actually named
7389     something starting with __ and the normal name is an alias.  */
7390 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7391 choke me
7392 #else
7393 $ac_func();
7394 #endif
7395
7396 ; return 0; }
7397 EOF
7398 if { (eval echo configure:7399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7399   rm -rf conftest*
7400   eval "ac_cv_func_$ac_func=yes"
7401 else
7402   echo "configure: failed program was:" >&5
7403   cat conftest.$ac_ext >&5
7404   rm -rf conftest*
7405   eval "ac_cv_func_$ac_func=no"
7406 fi
7407 rm -f conftest*
7408
7409 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7410   echo "$ac_t""yes" 1>&6
7411     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7412   { test "$extra_verbose" = "yes" && cat << EOF
7413     Defining $ac_tr_func
7414 EOF
7415 cat >> confdefs.h <<EOF
7416 #define $ac_tr_func 1
7417 EOF
7418 }
7419  
7420 else
7421   echo "$ac_t""no" 1>&6
7422 fi
7423 done
7424
7425 fi
7426
7427 if test "$with_postgresql" != "no"; then
7428   echo "checking for PostgreSQL" 1>&6
7429 echo "configure:7430: checking for PostgreSQL" >&5
7430
7431   for header_dir in "" "pgsql/" "postgresql/"; do
7432     ac_safe=`echo "${header_dir}libpq-fe.h" | sed 'y%./+-%__p_%'`
7433 echo $ac_n "checking for ${header_dir}libpq-fe.h""... $ac_c" 1>&6
7434 echo "configure:7435: checking for ${header_dir}libpq-fe.h" >&5
7435
7436 cat > conftest.$ac_ext <<EOF
7437 #line 7438 "configure"
7438 #include "confdefs.h"
7439 #include <${header_dir}libpq-fe.h>
7440 EOF
7441 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7442 { (eval echo configure:7443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7443 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7444 if test -z "$ac_err"; then
7445   rm -rf conftest*
7446   eval "ac_cv_header_$ac_safe=yes"
7447 else
7448   echo "$ac_err" >&5
7449   echo "configure: failed program was:" >&5
7450   cat conftest.$ac_ext >&5
7451   rm -rf conftest*
7452   eval "ac_cv_header_$ac_safe=no"
7453 fi
7454 rm -f conftest*
7455 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7456   echo "$ac_t""yes" 1>&6
7457   libpq_fe_h_file=${header_dir}libpq-fe.h; break
7458 else
7459   echo "$ac_t""no" 1>&6
7460 fi
7461
7462   done
7463
7464   test -n "$libpq_fe_h_file" && { 
7465 echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
7466 echo "configure:7467: checking for PQconnectdb in -lpq" >&5
7467 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'`
7468
7469 xe_check_libs=" -lpq "
7470 cat > conftest.$ac_ext <<EOF
7471 #line 7472 "configure"
7472 #include "confdefs.h"
7473 /* Override any gcc2 internal prototype to avoid an error.  */
7474 /* We use char because int might match the return type of a gcc2
7475     builtin and then its argument prototype would still apply.  */
7476 char PQconnectdb();
7477
7478 int main() {
7479 PQconnectdb()
7480 ; return 0; }
7481 EOF
7482 if { (eval echo configure:7483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7483   rm -rf conftest*
7484   eval "ac_cv_lib_$ac_lib_var=yes"
7485 else
7486   echo "configure: failed program was:" >&5
7487   cat conftest.$ac_ext >&5
7488   rm -rf conftest*
7489   eval "ac_cv_lib_$ac_lib_var=no"
7490 fi
7491 rm -f conftest*
7492 xe_check_libs=""
7493
7494 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7495   echo "$ac_t""yes" 1>&6
7496   have_libpq=yes
7497 else
7498   echo "$ac_t""no" 1>&6
7499 fi
7500
7501  }
7502
7503   if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then
7504     with_postgresql=yes
7505     { test "$extra_verbose" = "yes" && cat << \EOF
7506     Defining HAVE_POSTGRESQL
7507 EOF
7508 cat >> confdefs.h <<\EOF
7509 #define HAVE_POSTGRESQL 1
7510 EOF
7511 }
7512
7513     
7514 echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6
7515 echo "configure:7516: checking for PQconnectStart in -lpq" >&5
7516 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'`
7517
7518 xe_check_libs=" -lpq "
7519 cat > conftest.$ac_ext <<EOF
7520 #line 7521 "configure"
7521 #include "confdefs.h"
7522 /* Override any gcc2 internal prototype to avoid an error.  */
7523 /* We use char because int might match the return type of a gcc2
7524     builtin and then its argument prototype would still apply.  */
7525 char PQconnectStart();
7526
7527 int main() {
7528 PQconnectStart()
7529 ; return 0; }
7530 EOF
7531 if { (eval echo configure:7532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7532   rm -rf conftest*
7533   eval "ac_cv_lib_$ac_lib_var=yes"
7534 else
7535   echo "configure: failed program was:" >&5
7536   cat conftest.$ac_ext >&5
7537   rm -rf conftest*
7538   eval "ac_cv_lib_$ac_lib_var=no"
7539 fi
7540 rm -f conftest*
7541 xe_check_libs=""
7542
7543 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7544   echo "$ac_t""yes" 1>&6
7545   with_postgresqlv7=yes;
7546                  { test "$extra_verbose" = "yes" && cat << \EOF
7547     Defining HAVE_POSTGRESQLV7
7548 EOF
7549 cat >> confdefs.h <<\EOF
7550 #define HAVE_POSTGRESQLV7 1
7551 EOF
7552 }
7553
7554 else
7555   echo "$ac_t""no" 1>&6
7556 fi
7557
7558
7559     { test "$extra_verbose" = "yes" && cat << EOF
7560     Defining LIBPQ_FE_H_FILE = "$libpq_fe_h_file"
7561 EOF
7562 cat >> confdefs.h <<EOF
7563 #define LIBPQ_FE_H_FILE "$libpq_fe_h_file"
7564 EOF
7565 }
7566
7567     LIBS="-lpq $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpq\" to \$LIBS"; fi
7568     extra_objs="$extra_objs postgresql.o" &&  if test "$extra_verbose" = "yes"; then
7569    echo "    xemacs will be linked with \"postgresql.o\""
7570  fi
7571   elif test "$with_postgresql" = "yes"; then
7572     { echo "Error:" "Required PostgreSQL support cannot be provided.  Check --site-prefixes." >&2; exit 1; }
7573   fi
7574 fi
7575
7576
7577 if test "$window_system" != "none"; then
7578   echo "checking for graphics libraries" 1>&6
7579 echo "configure:7580: checking for graphics libraries" >&5
7580
7581     xpm_problem=""
7582   if test -z "$with_xpm"; then
7583     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
7584 echo "configure:7585: checking for Xpm - no older than 3.4f" >&5
7585     xe_check_libs=-lXpm
7586     cat > conftest.$ac_ext <<EOF
7587 #line 7588 "configure"
7588 #include "confdefs.h"
7589 #define XPM_NUMBERS
7590 #include <X11/xpm.h>
7591     int main(int c, char **v) {
7592     return c == 1 ? 0 :
7593       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
7594       XpmIncludeVersion < 30406 ? 2 : 0 ;}
7595 EOF
7596 if { (eval echo configure:7597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7597 then
7598   ./conftest dummy_arg; xpm_status=$?;
7599       if test "$xpm_status" = "0"; then
7600         with_xpm=yes;
7601       else
7602         with_xpm=no;
7603         if test "$xpm_status" = "1"; then
7604           xpm_problem="Xpm library version and header file version don't match!"
7605         elif test "$xpm_status" = "2"; then
7606           xpm_problem="Xpm library version is too old!"
7607         else
7608           xpm_problem="Internal xpm detection logic error!"
7609         fi
7610         echo "
7611 *** WARNING *** $xpm_problem
7612   I'm not touching that with a 10-foot pole!
7613   If you really want to use the installed version of Xpm, rerun
7614   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
7615     fi
7616 else
7617   conftest_rc="$?"
7618   echo "configure: failed program was:" >&5
7619   cat conftest.$ac_ext >&5
7620   rm -fr conftest*
7621   with_xpm=no
7622 fi
7623 rm -fr conftest*
7624     xe_check_libs=
7625     echo "$ac_t""$with_xpm" 1>&6
7626   fi
7627   if test "$with_xpm" = "yes"; then
7628                 { test "$extra_verbose" = "yes" && cat << \EOF
7629     Defining HAVE_XPM
7630 EOF
7631 cat >> confdefs.h <<\EOF
7632 #define HAVE_XPM 1
7633 EOF
7634 }
7635
7636     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
7637     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
7638 echo "configure:7639: checking for \"FOR_MSW\" xpm" >&5
7639     xe_check_libs=-lXpm
7640     cat > conftest.$ac_ext <<EOF
7641 #line 7642 "configure"
7642 #include "confdefs.h"
7643
7644 int main() {
7645 XpmCreatePixmapFromData()
7646 ; return 0; }
7647 EOF
7648 if { (eval echo configure:7649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7649   rm -rf conftest*
7650   xpm_for_msw=no
7651 else
7652   echo "configure: failed program was:" >&5
7653   cat conftest.$ac_ext >&5
7654   rm -rf conftest*
7655   xpm_for_msw=yes
7656 fi
7657 rm -f conftest*
7658     xe_check_libs=
7659     echo "$ac_t""$xpm_for_msw" 1>&6
7660     if test "$xpm_for_msw" = "yes"; then
7661       { test "$extra_verbose" = "yes" && cat << \EOF
7662     Defining FOR_MSW
7663 EOF
7664 cat >> confdefs.h <<\EOF
7665 #define FOR_MSW 1
7666 EOF
7667 }
7668
7669     fi
7670   fi
7671
7672     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
7673 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
7674 echo "configure:7675: checking for compface.h" >&5
7675
7676 cat > conftest.$ac_ext <<EOF
7677 #line 7678 "configure"
7678 #include "confdefs.h"
7679 #include <compface.h>
7680 EOF
7681 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7682 { (eval echo configure:7683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7683 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7684 if test -z "$ac_err"; then
7685   rm -rf conftest*
7686   eval "ac_cv_header_$ac_safe=yes"
7687 else
7688   echo "$ac_err" >&5
7689   echo "configure: failed program was:" >&5
7690   cat conftest.$ac_ext >&5
7691   rm -rf conftest*
7692   eval "ac_cv_header_$ac_safe=no"
7693 fi
7694 rm -f conftest*
7695 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7696   echo "$ac_t""yes" 1>&6
7697   :
7698 else
7699   echo "$ac_t""no" 1>&6
7700 with_xface=no
7701 fi
7702  }
7703   test -z "$with_xface" && { 
7704 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
7705 echo "configure:7706: checking for UnGenFace in -lcompface" >&5
7706 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
7707
7708 xe_check_libs=" -lcompface "
7709 cat > conftest.$ac_ext <<EOF
7710 #line 7711 "configure"
7711 #include "confdefs.h"
7712 /* Override any gcc2 internal prototype to avoid an error.  */
7713 /* We use char because int might match the return type of a gcc2
7714     builtin and then its argument prototype would still apply.  */
7715 char UnGenFace();
7716
7717 int main() {
7718 UnGenFace()
7719 ; return 0; }
7720 EOF
7721 if { (eval echo configure:7722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7722   rm -rf conftest*
7723   eval "ac_cv_lib_$ac_lib_var=yes"
7724 else
7725   echo "configure: failed program was:" >&5
7726   cat conftest.$ac_ext >&5
7727   rm -rf conftest*
7728   eval "ac_cv_lib_$ac_lib_var=no"
7729 fi
7730 rm -f conftest*
7731 xe_check_libs=""
7732
7733 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7734   echo "$ac_t""yes" 1>&6
7735   : 
7736 else
7737   echo "$ac_t""no" 1>&6
7738 with_xface=no
7739 fi
7740
7741  }
7742   test -z "$with_xface" && with_xface=yes
7743   if test "$with_xface" = "yes"; then
7744     { test "$extra_verbose" = "yes" && cat << \EOF
7745     Defining HAVE_XFACE
7746 EOF
7747 cat >> confdefs.h <<\EOF
7748 #define HAVE_XFACE 1
7749 EOF
7750 }
7751
7752     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7753   fi
7754
7755         if test "$with_gif" != "no"; then
7756     with_gif="yes"
7757     { test "$extra_verbose" = "yes" && cat << \EOF
7758     Defining HAVE_GIF
7759 EOF
7760 cat >> confdefs.h <<\EOF
7761 #define HAVE_GIF 1
7762 EOF
7763 }
7764
7765     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
7766    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
7767  fi
7768   fi
7769
7770       if test "$with_png $with_tiff" != "no no"; then
7771     
7772 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
7773 echo "configure:7774: checking for inflate in -lc" >&5
7774 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
7775
7776 xe_check_libs=" -lc "
7777 cat > conftest.$ac_ext <<EOF
7778 #line 7779 "configure"
7779 #include "confdefs.h"
7780 /* Override any gcc2 internal prototype to avoid an error.  */
7781 /* We use char because int might match the return type of a gcc2
7782     builtin and then its argument prototype would still apply.  */
7783 char inflate();
7784
7785 int main() {
7786 inflate()
7787 ; return 0; }
7788 EOF
7789 if { (eval echo configure:7790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7790   rm -rf conftest*
7791   eval "ac_cv_lib_$ac_lib_var=yes"
7792 else
7793   echo "configure: failed program was:" >&5
7794   cat conftest.$ac_ext >&5
7795   rm -rf conftest*
7796   eval "ac_cv_lib_$ac_lib_var=no"
7797 fi
7798 rm -f conftest*
7799 xe_check_libs=""
7800
7801 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7802   echo "$ac_t""yes" 1>&6
7803   :
7804 else
7805   echo "$ac_t""no" 1>&6
7806
7807 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
7808 echo "configure:7809: checking for inflate in -lz" >&5
7809 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
7810
7811 xe_check_libs=" -lz "
7812 cat > conftest.$ac_ext <<EOF
7813 #line 7814 "configure"
7814 #include "confdefs.h"
7815 /* Override any gcc2 internal prototype to avoid an error.  */
7816 /* We use char because int might match the return type of a gcc2
7817     builtin and then its argument prototype would still apply.  */
7818 char inflate();
7819
7820 int main() {
7821 inflate()
7822 ; return 0; }
7823 EOF
7824 if { (eval echo configure:7825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7825   rm -rf conftest*
7826   eval "ac_cv_lib_$ac_lib_var=yes"
7827 else
7828   echo "configure: failed program was:" >&5
7829   cat conftest.$ac_ext >&5
7830   rm -rf conftest*
7831   eval "ac_cv_lib_$ac_lib_var=no"
7832 fi
7833 rm -f conftest*
7834 xe_check_libs=""
7835
7836 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7837   echo "$ac_t""yes" 1>&6
7838   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
7839 else
7840   echo "$ac_t""no" 1>&6
7841
7842 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
7843 echo "configure:7844: checking for inflate in -lgz" >&5
7844 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
7845
7846 xe_check_libs=" -lgz "
7847 cat > conftest.$ac_ext <<EOF
7848 #line 7849 "configure"
7849 #include "confdefs.h"
7850 /* Override any gcc2 internal prototype to avoid an error.  */
7851 /* We use char because int might match the return type of a gcc2
7852     builtin and then its argument prototype would still apply.  */
7853 char inflate();
7854
7855 int main() {
7856 inflate()
7857 ; return 0; }
7858 EOF
7859 if { (eval echo configure:7860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7860   rm -rf conftest*
7861   eval "ac_cv_lib_$ac_lib_var=yes"
7862 else
7863   echo "configure: failed program was:" >&5
7864   cat conftest.$ac_ext >&5
7865   rm -rf conftest*
7866   eval "ac_cv_lib_$ac_lib_var=no"
7867 fi
7868 rm -f conftest*
7869 xe_check_libs=""
7870
7871 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7872   echo "$ac_t""yes" 1>&6
7873   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
7874 else
7875   echo "$ac_t""no" 1>&6
7876 fi
7877
7878
7879 fi
7880
7881
7882 fi
7883
7884
7885   fi
7886
7887     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
7888 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
7889 echo "configure:7890: checking for jpeglib.h" >&5
7890
7891 cat > conftest.$ac_ext <<EOF
7892 #line 7893 "configure"
7893 #include "confdefs.h"
7894 #include <jpeglib.h>
7895 EOF
7896 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7897 { (eval echo configure:7898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7898 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7899 if test -z "$ac_err"; then
7900   rm -rf conftest*
7901   eval "ac_cv_header_$ac_safe=yes"
7902 else
7903   echo "$ac_err" >&5
7904   echo "configure: failed program was:" >&5
7905   cat conftest.$ac_ext >&5
7906   rm -rf conftest*
7907   eval "ac_cv_header_$ac_safe=no"
7908 fi
7909 rm -f conftest*
7910 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7911   echo "$ac_t""yes" 1>&6
7912   :
7913 else
7914   echo "$ac_t""no" 1>&6
7915 with_jpeg=no
7916 fi
7917  }
7918   test -z "$with_jpeg" && { 
7919 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7920 echo "configure:7921: checking for jpeg_destroy_decompress in -ljpeg" >&5
7921 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7922
7923 xe_check_libs=" -ljpeg "
7924 cat > conftest.$ac_ext <<EOF
7925 #line 7926 "configure"
7926 #include "confdefs.h"
7927 /* Override any gcc2 internal prototype to avoid an error.  */
7928 /* We use char because int might match the return type of a gcc2
7929     builtin and then its argument prototype would still apply.  */
7930 char jpeg_destroy_decompress();
7931
7932 int main() {
7933 jpeg_destroy_decompress()
7934 ; return 0; }
7935 EOF
7936 if { (eval echo configure:7937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7937   rm -rf conftest*
7938   eval "ac_cv_lib_$ac_lib_var=yes"
7939 else
7940   echo "configure: failed program was:" >&5
7941   cat conftest.$ac_ext >&5
7942   rm -rf conftest*
7943   eval "ac_cv_lib_$ac_lib_var=no"
7944 fi
7945 rm -f conftest*
7946 xe_check_libs=""
7947
7948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7949   echo "$ac_t""yes" 1>&6
7950   :
7951 else
7952   echo "$ac_t""no" 1>&6
7953 with_jpeg=no
7954 fi
7955
7956  }
7957   test -z "$with_jpeg" && with_jpeg=yes
7958   if test "$with_jpeg" = "yes"; then
7959     { test "$extra_verbose" = "yes" && cat << \EOF
7960     Defining HAVE_JPEG
7961 EOF
7962 cat >> confdefs.h <<\EOF
7963 #define HAVE_JPEG 1
7964 EOF
7965 }
7966
7967     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7968   fi
7969
7970     png_problem=""
7971   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7972 echo "configure:7973: checking for pow" >&5
7973
7974 cat > conftest.$ac_ext <<EOF
7975 #line 7976 "configure"
7976 #include "confdefs.h"
7977 /* System header to define __stub macros and hopefully few prototypes,
7978     which can conflict with char pow(); below.  */
7979 #include <assert.h>
7980 /* Override any gcc2 internal prototype to avoid an error.  */
7981 /* We use char because int might match the return type of a gcc2
7982     builtin and then its argument prototype would still apply.  */
7983 char pow();
7984
7985 int main() {
7986
7987 /* The GNU C library defines this for functions which it implements
7988     to always fail with ENOSYS.  Some functions are actually named
7989     something starting with __ and the normal name is an alias.  */
7990 #if defined (__stub_pow) || defined (__stub___pow)
7991 choke me
7992 #else
7993 pow();
7994 #endif
7995
7996 ; return 0; }
7997 EOF
7998 if { (eval echo configure:7999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7999   rm -rf conftest*
8000   eval "ac_cv_func_pow=yes"
8001 else
8002   echo "configure: failed program was:" >&5
8003   cat conftest.$ac_ext >&5
8004   rm -rf conftest*
8005   eval "ac_cv_func_pow=no"
8006 fi
8007 rm -f conftest*
8008
8009 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
8010   echo "$ac_t""yes" 1>&6
8011   :
8012 else
8013   echo "$ac_t""no" 1>&6
8014 with_png=no
8015 fi
8016  }
8017   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
8018 echo $ac_n "checking for png.h""... $ac_c" 1>&6
8019 echo "configure:8020: checking for png.h" >&5
8020
8021 cat > conftest.$ac_ext <<EOF
8022 #line 8023 "configure"
8023 #include "confdefs.h"
8024 #include <png.h>
8025 EOF
8026 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8027 { (eval echo configure:8028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8028 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8029 if test -z "$ac_err"; then
8030   rm -rf conftest*
8031   eval "ac_cv_header_$ac_safe=yes"
8032 else
8033   echo "$ac_err" >&5
8034   echo "configure: failed program was:" >&5
8035   cat conftest.$ac_ext >&5
8036   rm -rf conftest*
8037   eval "ac_cv_header_$ac_safe=no"
8038 fi
8039 rm -f conftest*
8040 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8041   echo "$ac_t""yes" 1>&6
8042   :
8043 else
8044   echo "$ac_t""no" 1>&6
8045 with_png=no
8046 fi
8047  }
8048   test -z "$with_png" && { 
8049 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
8050 echo "configure:8051: checking for png_read_image in -lpng" >&5
8051 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
8052
8053 xe_check_libs=" -lpng "
8054 cat > conftest.$ac_ext <<EOF
8055 #line 8056 "configure"
8056 #include "confdefs.h"
8057 /* Override any gcc2 internal prototype to avoid an error.  */
8058 /* We use char because int might match the return type of a gcc2
8059     builtin and then its argument prototype would still apply.  */
8060 char png_read_image();
8061
8062 int main() {
8063 png_read_image()
8064 ; return 0; }
8065 EOF
8066 if { (eval echo configure:8067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8067   rm -rf conftest*
8068   eval "ac_cv_lib_$ac_lib_var=yes"
8069 else
8070   echo "configure: failed program was:" >&5
8071   cat conftest.$ac_ext >&5
8072   rm -rf conftest*
8073   eval "ac_cv_lib_$ac_lib_var=no"
8074 fi
8075 rm -f conftest*
8076 xe_check_libs=""
8077
8078 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8079   echo "$ac_t""yes" 1>&6
8080   :
8081 else
8082   echo "$ac_t""no" 1>&6
8083 with_png=no
8084 fi
8085
8086  }
8087   if test -z "$with_png"; then
8088     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
8089 echo "configure:8090: checking for workable png version information" >&5
8090     xe_check_libs="-lpng -lz"
8091     cat > conftest.$ac_ext <<EOF
8092 #line 8093 "configure"
8093 #include "confdefs.h"
8094 #include <png.h>
8095     int main(int c, char **v) {
8096     if (c == 1) return 0;
8097     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
8098     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
8099 EOF
8100 if { (eval echo configure:8101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8101 then
8102   ./conftest dummy_arg; png_status=$?;
8103       if test "$png_status" = "0"; then
8104         with_png=yes;
8105       else
8106         with_png=no;
8107         if test "$png_status" = "1"; then
8108           png_problem="PNG library version and header file don't match!"
8109         elif test "$png_status" = "2"; then
8110           png_problem="PNG library version too old (pre 1.0.2)!"
8111         fi
8112         echo "
8113 *** WARNING *** $png_problem
8114   I'm not touching that with a 10-foot pole!
8115   If you really want to use the installed version of libPNG, rerun
8116   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
8117     fi
8118 else
8119   conftest_rc="$?"
8120   echo "configure: failed program was:" >&5
8121   cat conftest.$ac_ext >&5
8122   rm -fr conftest*
8123   with_png=no
8124 fi
8125 rm -fr conftest*
8126     xe_check_libs=
8127     echo "$ac_t""$with_png" 1>&6
8128   fi
8129   if test "$with_png" = "yes"; then
8130     { test "$extra_verbose" = "yes" && cat << \EOF
8131     Defining HAVE_PNG
8132 EOF
8133 cat >> confdefs.h <<\EOF
8134 #define HAVE_PNG 1
8135 EOF
8136 }
8137
8138     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
8139   fi
8140
8141     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
8142 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
8143 echo "configure:8144: checking for tiffio.h" >&5
8144
8145 cat > conftest.$ac_ext <<EOF
8146 #line 8147 "configure"
8147 #include "confdefs.h"
8148 #include <tiffio.h>
8149 EOF
8150 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8151 { (eval echo configure:8152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8152 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8153 if test -z "$ac_err"; then
8154   rm -rf conftest*
8155   eval "ac_cv_header_$ac_safe=yes"
8156 else
8157   echo "$ac_err" >&5
8158   echo "configure: failed program was:" >&5
8159   cat conftest.$ac_ext >&5
8160   rm -rf conftest*
8161   eval "ac_cv_header_$ac_safe=no"
8162 fi
8163 rm -f conftest*
8164 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8165   echo "$ac_t""yes" 1>&6
8166   :
8167 else
8168   echo "$ac_t""no" 1>&6
8169 with_tiff=no
8170 fi
8171  }
8172   test -z "$with_tiff" && { 
8173 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
8174 echo "configure:8175: checking for TIFFClientOpen in -ltiff" >&5
8175 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
8176
8177 xe_check_libs=" -ltiff "
8178 cat > conftest.$ac_ext <<EOF
8179 #line 8180 "configure"
8180 #include "confdefs.h"
8181 /* Override any gcc2 internal prototype to avoid an error.  */
8182 /* We use char because int might match the return type of a gcc2
8183     builtin and then its argument prototype would still apply.  */
8184 char TIFFClientOpen();
8185
8186 int main() {
8187 TIFFClientOpen()
8188 ; return 0; }
8189 EOF
8190 if { (eval echo configure:8191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8191   rm -rf conftest*
8192   eval "ac_cv_lib_$ac_lib_var=yes"
8193 else
8194   echo "configure: failed program was:" >&5
8195   cat conftest.$ac_ext >&5
8196   rm -rf conftest*
8197   eval "ac_cv_lib_$ac_lib_var=no"
8198 fi
8199 rm -f conftest*
8200 xe_check_libs=""
8201
8202 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8203   echo "$ac_t""yes" 1>&6
8204   :
8205 else
8206   echo "$ac_t""no" 1>&6
8207 with_tiff=no
8208 fi
8209
8210  }
8211   test -z "$with_tiff" && with_tiff=yes
8212   if test "$with_tiff" = "yes"; then
8213     { test "$extra_verbose" = "yes" && cat << \EOF
8214     Defining HAVE_TIFF
8215 EOF
8216 cat >> confdefs.h <<\EOF
8217 #define HAVE_TIFF 1
8218 EOF
8219 }
8220
8221     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
8222   fi
8223 fi
8224
8225
8226 if test "$with_x11" = "yes"; then
8227
8228   echo "checking for X11 graphics libraries" 1>&6
8229 echo "configure:8230: checking for X11 graphics libraries" >&5
8230
8231   echo "checking for the Athena widgets" 1>&6
8232 echo "configure:8233: checking for the Athena widgets" >&5
8233
8234     case "$with_athena" in
8235         "xaw" | "")     athena_variant=Xaw      athena_3d=no  ;;
8236     "3d")       athena_variant=Xaw3d    athena_3d=yes ;;
8237     "next")     athena_variant=neXtaw   athena_3d=yes ;;
8238     "95")       athena_variant=Xaw95    athena_3d=yes ;;
8239     "xpm")      athena_variant=XawXpm   athena_3d=yes ;;
8240     *)          { echo "Error:" "Unknown Athena widget set \`$with_athena'. This should not happen." >&2; exit 1; } ;;
8241   esac
8242
8243     if test "$athena_3d" = "no"; then
8244     
8245 echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6
8246 echo "configure:8247: checking for XawScrollbarSetThumb in -l$athena_variant" >&5
8247 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
8248
8249 xe_check_libs=" -l$athena_variant "
8250 cat > conftest.$ac_ext <<EOF
8251 #line 8252 "configure"
8252 #include "confdefs.h"
8253 /* Override any gcc2 internal prototype to avoid an error.  */
8254 /* We use char because int might match the return type of a gcc2
8255     builtin and then its argument prototype would still apply.  */
8256 char XawScrollbarSetThumb();
8257
8258 int main() {
8259 XawScrollbarSetThumb()
8260 ; return 0; }
8261 EOF
8262 if { (eval echo configure:8263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8263   rm -rf conftest*
8264   eval "ac_cv_lib_$ac_lib_var=yes"
8265 else
8266   echo "configure: failed program was:" >&5
8267   cat conftest.$ac_ext >&5
8268   rm -rf conftest*
8269   eval "ac_cv_lib_$ac_lib_var=no"
8270 fi
8271 rm -f conftest*
8272 xe_check_libs=""
8273
8274 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8275   echo "$ac_t""yes" 1>&6
8276           
8277 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
8278 echo "configure:8279: checking for threeDClassRec in -l$athena_variant" >&5
8279 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
8280
8281 xe_check_libs=" -l$athena_variant "
8282 cat > conftest.$ac_ext <<EOF
8283 #line 8284 "configure"
8284 #include "confdefs.h"
8285 /* Override any gcc2 internal prototype to avoid an error.  */
8286 /* We use char because int might match the return type of a gcc2
8287     builtin and then its argument prototype would still apply.  */
8288 char threeDClassRec();
8289
8290 int main() {
8291 threeDClassRec()
8292 ; return 0; }
8293 EOF
8294 if { (eval echo configure:8295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8295   rm -rf conftest*
8296   eval "ac_cv_lib_$ac_lib_var=yes"
8297 else
8298   echo "configure: failed program was:" >&5
8299   cat conftest.$ac_ext >&5
8300   rm -rf conftest*
8301   eval "ac_cv_lib_$ac_lib_var=no"
8302 fi
8303 rm -f conftest*
8304 xe_check_libs=""
8305
8306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8307   echo "$ac_t""yes" 1>&6
8308   echo "configure: warning: "Could not find a non-3d Athena widget library."" 1>&2
8309 else
8310   echo "$ac_t""no" 1>&6
8311 athena_lib=$athena_variant
8312 fi
8313
8314
8315       
8316 else
8317   echo "$ac_t""no" 1>&6
8318 echo "configure: warning: "Could not find an Athena widget library."" 1>&2
8319 fi
8320
8321
8322   else
8323         
8324 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
8325 echo "configure:8326: checking for threeDClassRec in -l$athena_variant" >&5
8326 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
8327
8328 xe_check_libs=" -l$athena_variant "
8329 cat > conftest.$ac_ext <<EOF
8330 #line 8331 "configure"
8331 #include "confdefs.h"
8332 /* Override any gcc2 internal prototype to avoid an error.  */
8333 /* We use char because int might match the return type of a gcc2
8334     builtin and then its argument prototype would still apply.  */
8335 char threeDClassRec();
8336
8337 int main() {
8338 threeDClassRec()
8339 ; return 0; }
8340 EOF
8341 if { (eval echo configure:8342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8342   rm -rf conftest*
8343   eval "ac_cv_lib_$ac_lib_var=yes"
8344 else
8345   echo "configure: failed program was:" >&5
8346   cat conftest.$ac_ext >&5
8347   rm -rf conftest*
8348   eval "ac_cv_lib_$ac_lib_var=no"
8349 fi
8350 rm -f conftest*
8351 xe_check_libs=""
8352
8353 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8354   echo "$ac_t""yes" 1>&6
8355   athena_lib=$athena_variant
8356 else
8357   echo "$ac_t""no" 1>&6
8358 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6
8359 echo "configure:8360: checking for threeDClassRec in -lXaw" >&5
8360 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'`
8361
8362 xe_check_libs=" -lXaw "
8363 cat > conftest.$ac_ext <<EOF
8364 #line 8365 "configure"
8365 #include "confdefs.h"
8366 /* Override any gcc2 internal prototype to avoid an error.  */
8367 /* We use char because int might match the return type of a gcc2
8368     builtin and then its argument prototype would still apply.  */
8369 char threeDClassRec();
8370
8371 int main() {
8372 threeDClassRec()
8373 ; return 0; }
8374 EOF
8375 if { (eval echo configure:8376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8376   rm -rf conftest*
8377   eval "ac_cv_lib_$ac_lib_var=yes"
8378 else
8379   echo "configure: failed program was:" >&5
8380   cat conftest.$ac_ext >&5
8381   rm -rf conftest*
8382   eval "ac_cv_lib_$ac_lib_var=no"
8383 fi
8384 rm -f conftest*
8385 xe_check_libs=""
8386
8387 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8388   echo "$ac_t""yes" 1>&6
8389   athena_lib=Xaw;
8390           echo "configure: warning: "Assuming that libXaw is actually $athena_variant."" 1>&2;
8391         
8392 else
8393   echo "$ac_t""no" 1>&6
8394 echo "configure: warning: "Could not find a 3d Athena widget library that looked like $athena_variant."" 1>&2
8395 fi
8396
8397
8398 fi
8399
8400
8401   fi
8402
8403     if test "$athena_3d" = "no"; then
8404     ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
8405 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
8406 echo "configure:8407: checking for X11/Xaw/ThreeD.h" >&5
8407
8408 cat > conftest.$ac_ext <<EOF
8409 #line 8410 "configure"
8410 #include "confdefs.h"
8411 #include <X11/Xaw/ThreeD.h>
8412 EOF
8413 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8414 { (eval echo configure:8415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8415 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8416 if test -z "$ac_err"; then
8417   rm -rf conftest*
8418   eval "ac_cv_header_$ac_safe=yes"
8419 else
8420   echo "$ac_err" >&5
8421   echo "configure: failed program was:" >&5
8422   cat conftest.$ac_ext >&5
8423   rm -rf conftest*
8424   eval "ac_cv_header_$ac_safe=no"
8425 fi
8426 rm -f conftest*
8427 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8428   echo "$ac_t""yes" 1>&6
8429   echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2
8430 else
8431   echo "$ac_t""no" 1>&6
8432 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'`
8433 echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6
8434 echo "configure:8435: checking for X11/Xaw/XawInit.h" >&5
8435
8436 cat > conftest.$ac_ext <<EOF
8437 #line 8438 "configure"
8438 #include "confdefs.h"
8439 #include <X11/Xaw/XawInit.h>
8440 EOF
8441 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8442 { (eval echo configure:8443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8443 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8444 if test -z "$ac_err"; then
8445   rm -rf conftest*
8446   eval "ac_cv_header_$ac_safe=yes"
8447 else
8448   echo "$ac_err" >&5
8449   echo "configure: failed program was:" >&5
8450   cat conftest.$ac_ext >&5
8451   rm -rf conftest*
8452   eval "ac_cv_header_$ac_safe=no"
8453 fi
8454 rm -f conftest*
8455 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8456   echo "$ac_t""yes" 1>&6
8457   athena_h_path=X11/Xaw
8458 else
8459   echo "$ac_t""no" 1>&6
8460 echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2
8461 fi
8462
8463 fi
8464
8465   else
8466             ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
8467 echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6
8468 echo "configure:8469: checking for X11/$athena_variant/XawInit.h" >&5
8469
8470 cat > conftest.$ac_ext <<EOF
8471 #line 8472 "configure"
8472 #include "confdefs.h"
8473 #include <X11/$athena_variant/XawInit.h>
8474 EOF
8475 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8476 { (eval echo configure:8477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8477 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8478 if test -z "$ac_err"; then
8479   rm -rf conftest*
8480   eval "ac_cv_header_$ac_safe=yes"
8481 else
8482   echo "$ac_err" >&5
8483   echo "configure: failed program was:" >&5
8484   cat conftest.$ac_ext >&5
8485   rm -rf conftest*
8486   eval "ac_cv_header_$ac_safe=no"
8487 fi
8488 rm -f conftest*
8489 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8490   echo "$ac_t""yes" 1>&6
8491   ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
8492 echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6
8493 echo "configure:8494: checking for X11/$athena_variant/ThreeD.h" >&5
8494
8495 cat > conftest.$ac_ext <<EOF
8496 #line 8497 "configure"
8497 #include "confdefs.h"
8498 #include <X11/$athena_variant/ThreeD.h>
8499 EOF
8500 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8501 { (eval echo configure:8502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8502 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8503 if test -z "$ac_err"; then
8504   rm -rf conftest*
8505   eval "ac_cv_header_$ac_safe=yes"
8506 else
8507   echo "$ac_err" >&5
8508   echo "configure: failed program was:" >&5
8509   cat conftest.$ac_ext >&5
8510   rm -rf conftest*
8511   eval "ac_cv_header_$ac_safe=no"
8512 fi
8513 rm -f conftest*
8514 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8515   echo "$ac_t""yes" 1>&6
8516   athena_h_path=X11/$athena_variant
8517 else
8518   echo "$ac_t""no" 1>&6
8519 fi
8520
8521 else
8522   echo "$ac_t""no" 1>&6
8523 fi
8524
8525
8526         if test -z "$athena_h_path"; then
8527       ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
8528 echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6
8529 echo "configure:8530: checking for $athena_variant/XawInit.h" >&5
8530
8531 cat > conftest.$ac_ext <<EOF
8532 #line 8533 "configure"
8533 #include "confdefs.h"
8534 #include <$athena_variant/XawInit.h>
8535 EOF
8536 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8537 { (eval echo configure:8538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8538 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8539 if test -z "$ac_err"; then
8540   rm -rf conftest*
8541   eval "ac_cv_header_$ac_safe=yes"
8542 else
8543   echo "$ac_err" >&5
8544   echo "configure: failed program was:" >&5
8545   cat conftest.$ac_ext >&5
8546   rm -rf conftest*
8547   eval "ac_cv_header_$ac_safe=no"
8548 fi
8549 rm -f conftest*
8550 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8551   echo "$ac_t""yes" 1>&6
8552   ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
8553 echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6
8554 echo "configure:8555: checking for $athena_variant/ThreeD.h" >&5
8555
8556 cat > conftest.$ac_ext <<EOF
8557 #line 8558 "configure"
8558 #include "confdefs.h"
8559 #include <$athena_variant/ThreeD.h>
8560 EOF
8561 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8562 { (eval echo configure:8563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8563 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8564 if test -z "$ac_err"; then
8565   rm -rf conftest*
8566   eval "ac_cv_header_$ac_safe=yes"
8567 else
8568   echo "$ac_err" >&5
8569   echo "configure: failed program was:" >&5
8570   cat conftest.$ac_ext >&5
8571   rm -rf conftest*
8572   eval "ac_cv_header_$ac_safe=no"
8573 fi
8574 rm -f conftest*
8575 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8576   echo "$ac_t""yes" 1>&6
8577   athena_h_path=$athena_variant
8578 else
8579   echo "$ac_t""no" 1>&6
8580 fi
8581
8582 else
8583   echo "$ac_t""no" 1>&6
8584 fi
8585
8586     fi
8587
8588         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
8589       ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
8590 echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6
8591 echo "configure:8592: checking for X11/Xaw3d/XawInit.h" >&5
8592
8593 cat > conftest.$ac_ext <<EOF
8594 #line 8595 "configure"
8595 #include "confdefs.h"
8596 #include <X11/Xaw3d/XawInit.h>
8597 EOF
8598 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8599 { (eval echo configure:8600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8600 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8601 if test -z "$ac_err"; then
8602   rm -rf conftest*
8603   eval "ac_cv_header_$ac_safe=yes"
8604 else
8605   echo "$ac_err" >&5
8606   echo "configure: failed program was:" >&5
8607   cat conftest.$ac_ext >&5
8608   rm -rf conftest*
8609   eval "ac_cv_header_$ac_safe=no"
8610 fi
8611 rm -f conftest*
8612 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8613   echo "$ac_t""yes" 1>&6
8614   ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
8615 echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6
8616 echo "configure:8617: checking for X11/Xaw3d/ThreeD.h" >&5
8617
8618 cat > conftest.$ac_ext <<EOF
8619 #line 8620 "configure"
8620 #include "confdefs.h"
8621 #include <X11/Xaw3d/ThreeD.h>
8622 EOF
8623 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8624 { (eval echo configure:8625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8625 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8626 if test -z "$ac_err"; then
8627   rm -rf conftest*
8628   eval "ac_cv_header_$ac_safe=yes"
8629 else
8630   echo "$ac_err" >&5
8631   echo "configure: failed program was:" >&5
8632   cat conftest.$ac_ext >&5
8633   rm -rf conftest*
8634   eval "ac_cv_header_$ac_safe=no"
8635 fi
8636 rm -f conftest*
8637 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8638   echo "$ac_t""yes" 1>&6
8639   
8640             echo "configure: warning: "Assuming that X11/Xaw3d headers are suitable for $athena_variant."" 1>&2
8641             athena_h_path=X11/Xaw3d
8642           
8643 else
8644   echo "$ac_t""no" 1>&6
8645 fi
8646
8647 else
8648   echo "$ac_t""no" 1>&6
8649 fi
8650
8651     fi
8652
8653         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
8654       ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
8655 echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6
8656 echo "configure:8657: checking for Xaw3d/XawInit.h" >&5
8657
8658 cat > conftest.$ac_ext <<EOF
8659 #line 8660 "configure"
8660 #include "confdefs.h"
8661 #include <Xaw3d/XawInit.h>
8662 EOF
8663 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8664 { (eval echo configure:8665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8665 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8666 if test -z "$ac_err"; then
8667   rm -rf conftest*
8668   eval "ac_cv_header_$ac_safe=yes"
8669 else
8670   echo "$ac_err" >&5
8671   echo "configure: failed program was:" >&5
8672   cat conftest.$ac_ext >&5
8673   rm -rf conftest*
8674   eval "ac_cv_header_$ac_safe=no"
8675 fi
8676 rm -f conftest*
8677 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8678   echo "$ac_t""yes" 1>&6
8679   ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
8680 echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6
8681 echo "configure:8682: checking for Xaw3d/ThreeD.h" >&5
8682
8683 cat > conftest.$ac_ext <<EOF
8684 #line 8685 "configure"
8685 #include "confdefs.h"
8686 #include <Xaw3d/ThreeD.h>
8687 EOF
8688 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8689 { (eval echo configure:8690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8690 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8691 if test -z "$ac_err"; then
8692   rm -rf conftest*
8693   eval "ac_cv_header_$ac_safe=yes"
8694 else
8695   echo "$ac_err" >&5
8696   echo "configure: failed program was:" >&5
8697   cat conftest.$ac_ext >&5
8698   rm -rf conftest*
8699   eval "ac_cv_header_$ac_safe=no"
8700 fi
8701 rm -f conftest*
8702 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8703   echo "$ac_t""yes" 1>&6
8704   
8705             echo "configure: warning: "Assuming that Xaw3d headers are suitable for $athena_variant."" 1>&2
8706             athena_h_path=Xaw3d
8707           
8708 else
8709   echo "$ac_t""no" 1>&6
8710 fi
8711
8712 else
8713   echo "$ac_t""no" 1>&6
8714 fi
8715
8716     fi
8717
8718             if test -z "$athena_h_path"; then
8719       ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
8720 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
8721 echo "configure:8722: checking for X11/Xaw/ThreeD.h" >&5
8722
8723 cat > conftest.$ac_ext <<EOF
8724 #line 8725 "configure"
8725 #include "confdefs.h"
8726 #include <X11/Xaw/ThreeD.h>
8727 EOF
8728 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8729 { (eval echo configure:8730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8730 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8731 if test -z "$ac_err"; then
8732   rm -rf conftest*
8733   eval "ac_cv_header_$ac_safe=yes"
8734 else
8735   echo "$ac_err" >&5
8736   echo "configure: failed program was:" >&5
8737   cat conftest.$ac_ext >&5
8738   rm -rf conftest*
8739   eval "ac_cv_header_$ac_safe=no"
8740 fi
8741 rm -f conftest*
8742 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8743   echo "$ac_t""yes" 1>&6
8744   
8745           echo "configure: warning: "Assuming that X11/Xaw headers are suitable for $athena_variant."" 1>&2
8746           athena_h_path=X11/Xaw
8747         
8748 else
8749   echo "$ac_t""no" 1>&6
8750 echo "configure: warning: "Could not find a suitable 3d Athena header set."" 1>&2
8751 fi
8752
8753     fi
8754   fi
8755
8756     if test -n "$athena_lib" -a -n "$athena_h_path"; then
8757     have_xaw=yes
8758   else
8759     have_xaw=no
8760   fi
8761
8762     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
8763 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
8764 echo "configure:8765: checking for Xm/Xm.h" >&5
8765
8766 cat > conftest.$ac_ext <<EOF
8767 #line 8768 "configure"
8768 #include "confdefs.h"
8769 #include <Xm/Xm.h>
8770 EOF
8771 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8772 { (eval echo configure:8773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8773 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8774 if test -z "$ac_err"; then
8775   rm -rf conftest*
8776   eval "ac_cv_header_$ac_safe=yes"
8777 else
8778   echo "$ac_err" >&5
8779   echo "configure: failed program was:" >&5
8780   cat conftest.$ac_ext >&5
8781   rm -rf conftest*
8782   eval "ac_cv_header_$ac_safe=no"
8783 fi
8784 rm -f conftest*
8785 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8786   echo "$ac_t""yes" 1>&6
8787   
8788 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
8789 echo "configure:8790: checking for XmStringFree in -lXm" >&5
8790 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
8791
8792 xe_check_libs=" -lXm "
8793 cat > conftest.$ac_ext <<EOF
8794 #line 8795 "configure"
8795 #include "confdefs.h"
8796 /* Override any gcc2 internal prototype to avoid an error.  */
8797 /* We use char because int might match the return type of a gcc2
8798     builtin and then its argument prototype would still apply.  */
8799 char XmStringFree();
8800
8801 int main() {
8802 XmStringFree()
8803 ; return 0; }
8804 EOF
8805 if { (eval echo configure:8806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8806   rm -rf conftest*
8807   eval "ac_cv_lib_$ac_lib_var=yes"
8808 else
8809   echo "configure: failed program was:" >&5
8810   cat conftest.$ac_ext >&5
8811   rm -rf conftest*
8812   eval "ac_cv_lib_$ac_lib_var=no"
8813 fi
8814 rm -f conftest*
8815 xe_check_libs=""
8816
8817 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8818   echo "$ac_t""yes" 1>&6
8819   have_motif=yes
8820 else
8821   echo "$ac_t""no" 1>&6
8822 have_motif=no
8823 fi
8824
8825
8826 else
8827   echo "$ac_t""no" 1>&6
8828 have_motif=no
8829 fi
8830
8831
8832   if test "$have_motif" = "yes"; then
8833         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
8834 echo "configure:8835: checking for Lesstif" >&5
8835     cat > conftest.$ac_ext <<EOF
8836 #line 8837 "configure"
8837 #include "confdefs.h"
8838 #include <Xm/Xm.h>
8839 #ifdef LESSTIF_VERSION
8840 yes
8841 #endif
8842
8843 EOF
8844 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8845   egrep "yes" >/dev/null 2>&1; then
8846   rm -rf conftest*
8847   have_lesstif=yes
8848 else
8849   rm -rf conftest*
8850   have_lesstif=no
8851 fi
8852 rm -f conftest*
8853
8854   echo "$ac_t""$have_lesstif" 1>&6
8855   fi
8856
8857 fi 
8858
8859 case "$with_menubars" in "" | "yes" | "athena" )
8860   with_menubars="lucid" ;;
8861 esac
8862 case "$with_dialogs" in "" | "yes" | "lucid" )
8863   if   test "$have_motif"     = "yes"; then with_dialogs="motif"
8864   elif test "$have_xaw"       = "yes"; then with_dialogs="athena"
8865   else with_dialogs=no
8866   fi ;;
8867 esac
8868 case "$with_scrollbars" in "" | "yes" )
8869   with_scrollbars="lucid" ;;
8870 esac
8871 case "$with_widgets" in "" | "yes" | "lucid")
8872   if   test "$have_motif" = "yes"; then with_widgets="motif"
8873   elif test "$have_xaw"   = "yes"; then with_widgets="athena"
8874   else with_widgets=no
8875   fi ;;
8876 esac
8877
8878 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
8879
8880 case "$all_widgets" in
8881   *athena* )
8882     if test "$have_xaw" != "yes"; then
8883       { echo "Error:" "Could not find a suitable Athena library to build with." >&2; exit 1; }
8884     fi
8885
8886         lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
8887
8888         libs_x="-l$athena_lib $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$athena_lib\" to \$libs_x"; fi
8889
8890                     { test "$extra_verbose" = "yes" && cat << EOF
8891     Defining ATHENA_Scrollbar_h_ = "$athena_h_path/Scrollbar.h"
8892 EOF
8893 cat >> confdefs.h <<EOF
8894 #define ATHENA_Scrollbar_h_ "$athena_h_path/Scrollbar.h"
8895 EOF
8896 }
8897
8898     { test "$extra_verbose" = "yes" && cat << EOF
8899     Defining ATHENA_Dialog_h_ = "$athena_h_path/Dialog.h"
8900 EOF
8901 cat >> confdefs.h <<EOF
8902 #define ATHENA_Dialog_h_ "$athena_h_path/Dialog.h"
8903 EOF
8904 }
8905
8906     { test "$extra_verbose" = "yes" && cat << EOF
8907     Defining ATHENA_Form_h_ = "$athena_h_path/Form.h"
8908 EOF
8909 cat >> confdefs.h <<EOF
8910 #define ATHENA_Form_h_ "$athena_h_path/Form.h"
8911 EOF
8912 }
8913
8914     { test "$extra_verbose" = "yes" && cat << EOF
8915     Defining ATHENA_Command_h_ = "$athena_h_path/Command.h"
8916 EOF
8917 cat >> confdefs.h <<EOF
8918 #define ATHENA_Command_h_ "$athena_h_path/Command.h"
8919 EOF
8920 }
8921
8922     { test "$extra_verbose" = "yes" && cat << EOF
8923     Defining ATHENA_Label_h_ = "$athena_h_path/Label.h"
8924 EOF
8925 cat >> confdefs.h <<EOF
8926 #define ATHENA_Label_h_ "$athena_h_path/Label.h"
8927 EOF
8928 }
8929
8930     { test "$extra_verbose" = "yes" && cat << EOF
8931     Defining ATHENA_LabelP_h_ = "$athena_h_path/LabelP.h"
8932 EOF
8933 cat >> confdefs.h <<EOF
8934 #define ATHENA_LabelP_h_ "$athena_h_path/LabelP.h"
8935 EOF
8936 }
8937
8938     { test "$extra_verbose" = "yes" && cat << EOF
8939     Defining ATHENA_Toggle_h_ = "$athena_h_path/Toggle.h"
8940 EOF
8941 cat >> confdefs.h <<EOF
8942 #define ATHENA_Toggle_h_ "$athena_h_path/Toggle.h"
8943 EOF
8944 }
8945
8946     { test "$extra_verbose" = "yes" && cat << EOF
8947     Defining ATHENA_ToggleP_h_ = "$athena_h_path/ToggleP.h"
8948 EOF
8949 cat >> confdefs.h <<EOF
8950 #define ATHENA_ToggleP_h_ "$athena_h_path/ToggleP.h"
8951 EOF
8952 }
8953
8954     { test "$extra_verbose" = "yes" && cat << EOF
8955     Defining ATHENA_AsciiText_h_ = "$athena_h_path/AsciiText.h"
8956 EOF
8957 cat >> confdefs.h <<EOF
8958 #define ATHENA_AsciiText_h_ "$athena_h_path/AsciiText.h"
8959 EOF
8960 }
8961
8962     { test "$extra_verbose" = "yes" && cat << EOF
8963     Defining ATHENA_XawInit_h_ = "$athena_h_path/XawInit.h"
8964 EOF
8965 cat >> confdefs.h <<EOF
8966 #define ATHENA_XawInit_h_ "$athena_h_path/XawInit.h"
8967 EOF
8968 }
8969
8970
8971     { test "$extra_verbose" = "yes" && cat << \EOF
8972     Defining LWLIB_USES_ATHENA
8973 EOF
8974 cat >> confdefs.h <<\EOF
8975 #define LWLIB_USES_ATHENA 1
8976 EOF
8977 }
8978
8979     { test "$extra_verbose" = "yes" && cat << \EOF
8980     Defining NEED_ATHENA
8981 EOF
8982 cat >> confdefs.h <<\EOF
8983 #define NEED_ATHENA 1
8984 EOF
8985 }
8986
8987     need_athena="yes"
8988
8989     if test "$athena_3d" = "yes"; then
8990       { test "$extra_verbose" = "yes" && cat << \EOF
8991     Defining HAVE_ATHENA_3D
8992 EOF
8993 cat >> confdefs.h <<\EOF
8994 #define HAVE_ATHENA_3D 1
8995 EOF
8996 }
8997
8998     fi
8999   ;;
9000 esac
9001
9002 case "$all_widgets" in *motif* )
9003   { test "$extra_verbose" = "yes" && cat << \EOF
9004     Defining LWLIB_USES_MOTIF
9005 EOF
9006 cat >> confdefs.h <<\EOF
9007 #define LWLIB_USES_MOTIF 1
9008 EOF
9009 }
9010
9011   { test "$extra_verbose" = "yes" && cat << \EOF
9012     Defining NEED_MOTIF
9013 EOF
9014 cat >> confdefs.h <<\EOF
9015 #define NEED_MOTIF 1
9016 EOF
9017 }
9018
9019   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
9020   need_motif=yes ;;
9021 esac
9022
9023 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
9024 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
9025 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
9026 test "$with_widgets"   != "no" && test "$with_widgets" != "msw" && \
9027         lwlib_objs="$lwlib_objs xlwtabs.o xlwgcs.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwtabs.o xlwgcs.o\" to \$lwlib_objs"; fi
9028 case "$with_widgets" in athena* )
9029         lwlib_objs="$lwlib_objs xlwradio.o xlwcheckbox.o xlwgauge.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwradio.o xlwcheckbox.o xlwgauge.o\" to \$lwlib_objs"; fi;;
9030 esac
9031 case "$all_widgets" in *lucid* )
9032   { test "$extra_verbose" = "yes" && cat << \EOF
9033     Defining NEED_LUCID
9034 EOF
9035 cat >> confdefs.h <<\EOF
9036 #define NEED_LUCID 1
9037 EOF
9038 }
9039
9040   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
9041 esac
9042
9043
9044
9045 test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9046     Defining LWLIB_SCROLLBARS_ATHENA
9047 EOF
9048 cat >> confdefs.h <<\EOF
9049 #define LWLIB_SCROLLBARS_ATHENA 1
9050 EOF
9051 }
9052
9053 test "$with_dialogs"    = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9054     Defining LWLIB_DIALOGS_ATHENA
9055 EOF
9056 cat >> confdefs.h <<\EOF
9057 #define LWLIB_DIALOGS_ATHENA 1
9058 EOF
9059 }
9060
9061
9062 if test "$athena_3d" = "yes"; then
9063   test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9064     Defining LWLIB_SCROLLBARS_ATHENA3D
9065 EOF
9066 cat >> confdefs.h <<\EOF
9067 #define LWLIB_SCROLLBARS_ATHENA3D 1
9068 EOF
9069 }
9070
9071   test "$with_dialogs"    = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9072     Defining LWLIB_DIALOGS_ATHENA3D
9073 EOF
9074 cat >> confdefs.h <<\EOF
9075 #define LWLIB_DIALOGS_ATHENA3D 1
9076 EOF
9077 }
9078
9079 fi
9080
9081 case "$with_widgets" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
9082     Defining LWLIB_WIDGETS_ATHENA
9083 EOF
9084 cat >> confdefs.h <<\EOF
9085 #define LWLIB_WIDGETS_ATHENA 1
9086 EOF
9087 }
9088 ;; esac
9089 test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \
9090         { test "$extra_verbose" = "yes" && cat << \EOF
9091     Defining LWLIB_TABS_LUCID
9092 EOF
9093 cat >> confdefs.h <<\EOF
9094 #define LWLIB_TABS_LUCID 1
9095 EOF
9096 }
9097
9098
9099 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9100     Defining HAVE_MENUBARS
9101 EOF
9102 cat >> confdefs.h <<\EOF
9103 #define HAVE_MENUBARS 1
9104 EOF
9105 }
9106
9107 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9108     Defining HAVE_SCROLLBARS
9109 EOF
9110 cat >> confdefs.h <<\EOF
9111 #define HAVE_SCROLLBARS 1
9112 EOF
9113 }
9114
9115 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9116     Defining HAVE_DIALOGS
9117 EOF
9118 cat >> confdefs.h <<\EOF
9119 #define HAVE_DIALOGS 1
9120 EOF
9121 }
9122
9123 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9124     Defining HAVE_TOOLBARS
9125 EOF
9126 cat >> confdefs.h <<\EOF
9127 #define HAVE_TOOLBARS 1
9128 EOF
9129 }
9130
9131 test "$with_widgets"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9132     Defining HAVE_WIDGETS
9133 EOF
9134 cat >> confdefs.h <<\EOF
9135 #define HAVE_WIDGETS 1
9136 EOF
9137 }
9138
9139
9140 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
9141     Defining LWLIB_MENUBARS_LUCID
9142 EOF
9143 cat >> confdefs.h <<\EOF
9144 #define LWLIB_MENUBARS_LUCID 1
9145 EOF
9146 }
9147
9148 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
9149     Defining LWLIB_SCROLLBARS_LUCID
9150 EOF
9151 cat >> confdefs.h <<\EOF
9152 #define LWLIB_SCROLLBARS_LUCID 1
9153 EOF
9154 }
9155
9156
9157 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9158     Defining LWLIB_MENUBARS_MOTIF
9159 EOF
9160 cat >> confdefs.h <<\EOF
9161 #define LWLIB_MENUBARS_MOTIF 1
9162 EOF
9163 }
9164
9165 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9166     Defining LWLIB_SCROLLBARS_MOTIF
9167 EOF
9168 cat >> confdefs.h <<\EOF
9169 #define LWLIB_SCROLLBARS_MOTIF 1
9170 EOF
9171 }
9172
9173 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9174     Defining LWLIB_DIALOGS_MOTIF
9175 EOF
9176 cat >> confdefs.h <<\EOF
9177 #define LWLIB_DIALOGS_MOTIF 1
9178 EOF
9179 }
9180
9181 test "$with_widgets"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9182     Defining LWLIB_WIDGETS_MOTIF
9183 EOF
9184 cat >> confdefs.h <<\EOF
9185 #define LWLIB_WIDGETS_MOTIF 1
9186 EOF
9187 }
9188
9189
9190 test "$with_menubars"   != "no"    && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
9191    echo "    xemacs will be linked with \"menubar.o\""
9192  fi
9193 test "$with_scrollbars" != "no"    && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
9194    echo "    xemacs will be linked with \"scrollbar.o\""
9195  fi
9196 test "$with_dialogs"    != "no"    && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
9197    echo "    xemacs will be linked with \"dialog.o\""
9198  fi
9199 test "$with_toolbars"   != "no"    && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
9200    echo "    xemacs will be linked with \"toolbar.o\""
9201  fi
9202
9203 if test "$with_x11" = "yes"; then
9204   test "$with_menubars"   != "no"  && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
9205    echo "    xemacs will be linked with \"menubar-x.o\""
9206  fi
9207   test "$with_scrollbars" != "no"  && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
9208    echo "    xemacs will be linked with \"scrollbar-x.o\""
9209  fi
9210   test "$with_dialogs"    != "no"  && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
9211    echo "    xemacs will be linked with \"dialog-x.o\""
9212  fi
9213   test "$with_toolbars"   != "no"  && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
9214    echo "    xemacs will be linked with \"toolbar-x.o\""
9215  fi
9216   test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
9217    echo "    xemacs will be linked with \"gui-x.o\""
9218  fi
9219 fi
9220
9221
9222 test -z "$with_mule" && with_mule=no
9223 test -z "$with_file_coding" && with_file_coding=no
9224
9225
9226 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
9227   { test "$extra_verbose" = "yes" && cat << \EOF
9228     Defining FILE_CODING
9229 EOF
9230 cat >> confdefs.h <<\EOF
9231 #define FILE_CODING 1
9232 EOF
9233 }
9234
9235   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
9236    echo "    xemacs will be linked with \"file-coding.o\""
9237  fi
9238 fi
9239
9240 if test "$with_mule" = "yes" ; then
9241   echo "checking for Mule-related features" 1>&6
9242 echo "configure:9243: checking for Mule-related features" >&5
9243   { test "$extra_verbose" = "yes" && cat << \EOF
9244     Defining MULE
9245 EOF
9246 cat >> confdefs.h <<\EOF
9247 #define MULE 1
9248 EOF
9249 }
9250
9251   { test "$extra_verbose" = "yes" && cat << \EOF
9252     Defining FILE_CODING
9253 EOF
9254 cat >> confdefs.h <<\EOF
9255 #define FILE_CODING 1
9256 EOF
9257 }
9258
9259   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
9260    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
9261  fi
9262
9263     for ac_hdr in libintl.h
9264 do
9265 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9266 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9267 echo "configure:9268: checking for $ac_hdr" >&5
9268
9269 cat > conftest.$ac_ext <<EOF
9270 #line 9271 "configure"
9271 #include "confdefs.h"
9272 #include <$ac_hdr>
9273 EOF
9274 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9275 { (eval echo configure:9276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9276 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9277 if test -z "$ac_err"; then
9278   rm -rf conftest*
9279   eval "ac_cv_header_$ac_safe=yes"
9280 else
9281   echo "$ac_err" >&5
9282   echo "configure: failed program was:" >&5
9283   cat conftest.$ac_ext >&5
9284   rm -rf conftest*
9285   eval "ac_cv_header_$ac_safe=no"
9286 fi
9287 rm -f conftest*
9288 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9289   echo "$ac_t""yes" 1>&6
9290     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9291   { test "$extra_verbose" = "yes" && cat << EOF
9292     Defining $ac_tr_hdr
9293 EOF
9294 cat >> confdefs.h <<EOF
9295 #define $ac_tr_hdr 1
9296 EOF
9297 }
9298  
9299 else
9300   echo "$ac_t""no" 1>&6
9301 fi
9302 done
9303
9304   
9305 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
9306 echo "configure:9307: checking for strerror in -lintl" >&5
9307 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
9308
9309 xe_check_libs=" -lintl "
9310 cat > conftest.$ac_ext <<EOF
9311 #line 9312 "configure"
9312 #include "confdefs.h"
9313 /* Override any gcc2 internal prototype to avoid an error.  */
9314 /* We use char because int might match the return type of a gcc2
9315     builtin and then its argument prototype would still apply.  */
9316 char strerror();
9317
9318 int main() {
9319 strerror()
9320 ; return 0; }
9321 EOF
9322 if { (eval echo configure:9323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9323   rm -rf conftest*
9324   eval "ac_cv_lib_$ac_lib_var=yes"
9325 else
9326   echo "configure: failed program was:" >&5
9327   cat conftest.$ac_ext >&5
9328   rm -rf conftest*
9329   eval "ac_cv_lib_$ac_lib_var=no"
9330 fi
9331 rm -f conftest*
9332 xe_check_libs=""
9333
9334 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9335   echo "$ac_t""yes" 1>&6
9336     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9337     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9338   { test "$extra_verbose" = "yes" && cat << EOF
9339     Defining $ac_tr_lib
9340 EOF
9341 cat >> confdefs.h <<EOF
9342 #define $ac_tr_lib 1
9343 EOF
9344 }
9345
9346   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
9347
9348 else
9349   echo "$ac_t""no" 1>&6
9350 fi
9351
9352
9353
9354   echo "checking for Mule input methods" 1>&6
9355 echo "configure:9356: checking for Mule input methods" >&5
9356         case "$with_xim" in "" | "yes" )
9357     echo "checking for XIM" 1>&6
9358 echo "configure:9359: checking for XIM" >&5
9359     
9360 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
9361 echo "configure:9362: checking for XOpenIM in -lX11" >&5
9362 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
9363
9364 xe_check_libs=" -lX11 "
9365 cat > conftest.$ac_ext <<EOF
9366 #line 9367 "configure"
9367 #include "confdefs.h"
9368 /* Override any gcc2 internal prototype to avoid an error.  */
9369 /* We use char because int might match the return type of a gcc2
9370     builtin and then its argument prototype would still apply.  */
9371 char XOpenIM();
9372
9373 int main() {
9374 XOpenIM()
9375 ; return 0; }
9376 EOF
9377 if { (eval echo configure:9378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9378   rm -rf conftest*
9379   eval "ac_cv_lib_$ac_lib_var=yes"
9380 else
9381   echo "configure: failed program was:" >&5
9382   cat conftest.$ac_ext >&5
9383   rm -rf conftest*
9384   eval "ac_cv_lib_$ac_lib_var=no"
9385 fi
9386 rm -f conftest*
9387 xe_check_libs=""
9388
9389 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9390   echo "$ac_t""yes" 1>&6
9391   with_xim=xlib
9392 else
9393   echo "$ac_t""no" 1>&6
9394 with_xim=no
9395 fi
9396
9397
9398         if test "$have_motif $have_lesstif" = "yes no"; then
9399       
9400 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
9401 echo "configure:9402: checking for XmImMbLookupString in -lXm" >&5
9402 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
9403
9404 xe_check_libs=" -lXm "
9405 cat > conftest.$ac_ext <<EOF
9406 #line 9407 "configure"
9407 #include "confdefs.h"
9408 /* Override any gcc2 internal prototype to avoid an error.  */
9409 /* We use char because int might match the return type of a gcc2
9410     builtin and then its argument prototype would still apply.  */
9411 char XmImMbLookupString();
9412
9413 int main() {
9414 XmImMbLookupString()
9415 ; return 0; }
9416 EOF
9417 if { (eval echo configure:9418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9418   rm -rf conftest*
9419   eval "ac_cv_lib_$ac_lib_var=yes"
9420 else
9421   echo "configure: failed program was:" >&5
9422   cat conftest.$ac_ext >&5
9423   rm -rf conftest*
9424   eval "ac_cv_lib_$ac_lib_var=no"
9425 fi
9426 rm -f conftest*
9427 xe_check_libs=""
9428
9429 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9430   echo "$ac_t""yes" 1>&6
9431   with_xim=motif
9432 else
9433   echo "$ac_t""no" 1>&6
9434 fi
9435
9436
9437     fi ;;
9438   esac
9439   if test "$with_xim" != "no"; then
9440     { test "$extra_verbose" = "yes" && cat << \EOF
9441     Defining HAVE_XIM
9442 EOF
9443 cat >> confdefs.h <<\EOF
9444 #define HAVE_XIM 1
9445 EOF
9446 }
9447
9448     if test "$with_xim" = "xlib"; then
9449       { test "$extra_verbose" = "yes" && cat << \EOF
9450     Defining XIM_XLIB
9451 EOF
9452 cat >> confdefs.h <<\EOF
9453 #define XIM_XLIB 1
9454 EOF
9455 }
9456
9457       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
9458    echo "    xemacs will be linked with \"input-method-xlib.o\""
9459  fi
9460     fi
9461     if test "$with_xim" = "motif"; then
9462       { test "$extra_verbose" = "yes" && cat << \EOF
9463     Defining XIM_MOTIF
9464 EOF
9465 cat >> confdefs.h <<\EOF
9466 #define XIM_MOTIF 1
9467 EOF
9468 }
9469
9470       need_motif=yes
9471       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
9472    echo "    xemacs will be linked with \"input-method-motif.o\""
9473  fi
9474     fi
9475     if test "$with_xim" = "motif"; then
9476       with_xfs=no
9477     fi
9478   fi
9479
9480     if test "$with_xfs" = "yes" ; then
9481     echo "checking for XFontSet" 1>&6
9482 echo "configure:9483: checking for XFontSet" >&5
9483     
9484 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
9485 echo "configure:9486: checking for XmbDrawString in -lX11" >&5
9486 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
9487
9488 xe_check_libs=" -lX11 "
9489 cat > conftest.$ac_ext <<EOF
9490 #line 9491 "configure"
9491 #include "confdefs.h"
9492 /* Override any gcc2 internal prototype to avoid an error.  */
9493 /* We use char because int might match the return type of a gcc2
9494     builtin and then its argument prototype would still apply.  */
9495 char XmbDrawString();
9496
9497 int main() {
9498 XmbDrawString()
9499 ; return 0; }
9500 EOF
9501 if { (eval echo configure:9502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9502   rm -rf conftest*
9503   eval "ac_cv_lib_$ac_lib_var=yes"
9504 else
9505   echo "configure: failed program was:" >&5
9506   cat conftest.$ac_ext >&5
9507   rm -rf conftest*
9508   eval "ac_cv_lib_$ac_lib_var=no"
9509 fi
9510 rm -f conftest*
9511 xe_check_libs=""
9512
9513 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9514   echo "$ac_t""yes" 1>&6
9515   :
9516 else
9517   echo "$ac_t""no" 1>&6
9518 with_xfs=no
9519 fi
9520
9521
9522     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
9523       { test "$extra_verbose" = "yes" && cat << \EOF
9524     Defining USE_XFONTSET
9525 EOF
9526 cat >> confdefs.h <<\EOF
9527 #define USE_XFONTSET 1
9528 EOF
9529 }
9530
9531       if test "$with_xim" = "no" ; then
9532         extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
9533    echo "    xemacs will be linked with \"input-method-xlib.o\""
9534  fi
9535       fi
9536     fi
9537   fi 
9538     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
9539   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
9540 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
9541 echo "configure:9542: checking for wnn/jllib.h" >&5
9542
9543 cat > conftest.$ac_ext <<EOF
9544 #line 9545 "configure"
9545 #include "confdefs.h"
9546 #include <wnn/jllib.h>
9547 EOF
9548 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9549 { (eval echo configure:9550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9550 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9551 if test -z "$ac_err"; then
9552   rm -rf conftest*
9553   eval "ac_cv_header_$ac_safe=yes"
9554 else
9555   echo "$ac_err" >&5
9556   echo "configure: failed program was:" >&5
9557   cat conftest.$ac_ext >&5
9558   rm -rf conftest*
9559   eval "ac_cv_header_$ac_safe=no"
9560 fi
9561 rm -f conftest*
9562 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9563   echo "$ac_t""yes" 1>&6
9564   :
9565 else
9566   echo "$ac_t""no" 1>&6
9567 with_wnn=no
9568 fi
9569  }
9570     test -z "$with_wnn" && { ac_safe=`echo "wnn/commonhd.h" | sed 'y%./+-%__p_%'`
9571 echo $ac_n "checking for wnn/commonhd.h""... $ac_c" 1>&6
9572 echo "configure:9573: checking for wnn/commonhd.h" >&5
9573
9574 cat > conftest.$ac_ext <<EOF
9575 #line 9576 "configure"
9576 #include "confdefs.h"
9577 #include <wnn/commonhd.h>
9578 EOF
9579 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9580 { (eval echo configure:9581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9581 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9582 if test -z "$ac_err"; then
9583   rm -rf conftest*
9584   eval "ac_cv_header_$ac_safe=yes"
9585 else
9586   echo "$ac_err" >&5
9587   echo "configure: failed program was:" >&5
9588   cat conftest.$ac_ext >&5
9589   rm -rf conftest*
9590   eval "ac_cv_header_$ac_safe=no"
9591 fi
9592 rm -f conftest*
9593 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9594   echo "$ac_t""yes" 1>&6
9595   :
9596 else
9597   echo "$ac_t""no" 1>&6
9598 with_wnn=no
9599 fi
9600  }
9601     if test "$with_wnn" != "no"; then
9602     for ac_func in crypt
9603 do
9604 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9605 echo "configure:9606: checking for $ac_func" >&5
9606
9607 cat > conftest.$ac_ext <<EOF
9608 #line 9609 "configure"
9609 #include "confdefs.h"
9610 /* System header to define __stub macros and hopefully few prototypes,
9611     which can conflict with char $ac_func(); below.  */
9612 #include <assert.h>
9613 /* Override any gcc2 internal prototype to avoid an error.  */
9614 /* We use char because int might match the return type of a gcc2
9615     builtin and then its argument prototype would still apply.  */
9616 char $ac_func();
9617
9618 int main() {
9619
9620 /* The GNU C library defines this for functions which it implements
9621     to always fail with ENOSYS.  Some functions are actually named
9622     something starting with __ and the normal name is an alias.  */
9623 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9624 choke me
9625 #else
9626 $ac_func();
9627 #endif
9628
9629 ; return 0; }
9630 EOF
9631 if { (eval echo configure:9632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9632   rm -rf conftest*
9633   eval "ac_cv_func_$ac_func=yes"
9634 else
9635   echo "configure: failed program was:" >&5
9636   cat conftest.$ac_ext >&5
9637   rm -rf conftest*
9638   eval "ac_cv_func_$ac_func=no"
9639 fi
9640 rm -f conftest*
9641
9642 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9643   echo "$ac_t""yes" 1>&6
9644     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9645   { test "$extra_verbose" = "yes" && cat << EOF
9646     Defining $ac_tr_func
9647 EOF
9648 cat >> confdefs.h <<EOF
9649 #define $ac_tr_func 1
9650 EOF
9651 }
9652  
9653 else
9654   echo "$ac_t""no" 1>&6
9655 fi
9656 done
9657
9658     test "$ac_cv_func_crypt" != "yes" && { 
9659 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9660 echo "configure:9661: checking for crypt in -lcrypt" >&5
9661 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9662
9663 xe_check_libs=" -lcrypt "
9664 cat > conftest.$ac_ext <<EOF
9665 #line 9666 "configure"
9666 #include "confdefs.h"
9667 /* Override any gcc2 internal prototype to avoid an error.  */
9668 /* We use char because int might match the return type of a gcc2
9669     builtin and then its argument prototype would still apply.  */
9670 char crypt();
9671
9672 int main() {
9673 crypt()
9674 ; return 0; }
9675 EOF
9676 if { (eval echo configure:9677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9677   rm -rf conftest*
9678   eval "ac_cv_lib_$ac_lib_var=yes"
9679 else
9680   echo "configure: failed program was:" >&5
9681   cat conftest.$ac_ext >&5
9682   rm -rf conftest*
9683   eval "ac_cv_lib_$ac_lib_var=no"
9684 fi
9685 rm -f conftest*
9686 xe_check_libs=""
9687
9688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9689   echo "$ac_t""yes" 1>&6
9690     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9691     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9692   { test "$extra_verbose" = "yes" && cat << EOF
9693     Defining $ac_tr_lib
9694 EOF
9695 cat >> confdefs.h <<EOF
9696 #define $ac_tr_lib 1
9697 EOF
9698 }
9699
9700   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
9701
9702 else
9703   echo "$ac_t""no" 1>&6
9704 fi
9705
9706  }
9707   fi
9708     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
9709     
9710 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
9711 echo "configure:9712: checking for jl_dic_list_e in -lwnn" >&5
9712 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9713
9714 xe_check_libs=" -lwnn "
9715 cat > conftest.$ac_ext <<EOF
9716 #line 9717 "configure"
9717 #include "confdefs.h"
9718 /* Override any gcc2 internal prototype to avoid an error.  */
9719 /* We use char because int might match the return type of a gcc2
9720     builtin and then its argument prototype would still apply.  */
9721 char jl_dic_list_e();
9722
9723 int main() {
9724 jl_dic_list_e()
9725 ; return 0; }
9726 EOF
9727 if { (eval echo configure:9728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9728   rm -rf conftest*
9729   eval "ac_cv_lib_$ac_lib_var=yes"
9730 else
9731   echo "configure: failed program was:" >&5
9732   cat conftest.$ac_ext >&5
9733   rm -rf conftest*
9734   eval "ac_cv_lib_$ac_lib_var=no"
9735 fi
9736 rm -f conftest*
9737 xe_check_libs=""
9738
9739 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9740   echo "$ac_t""yes" 1>&6
9741   libwnn=wnn
9742 else
9743   echo "$ac_t""no" 1>&6
9744 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
9745 echo "configure:9746: checking for jl_dic_list_e in -lwnn4" >&5
9746 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9747
9748 xe_check_libs=" -lwnn4 "
9749 cat > conftest.$ac_ext <<EOF
9750 #line 9751 "configure"
9751 #include "confdefs.h"
9752 /* Override any gcc2 internal prototype to avoid an error.  */
9753 /* We use char because int might match the return type of a gcc2
9754     builtin and then its argument prototype would still apply.  */
9755 char jl_dic_list_e();
9756
9757 int main() {
9758 jl_dic_list_e()
9759 ; return 0; }
9760 EOF
9761 if { (eval echo configure:9762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9762   rm -rf conftest*
9763   eval "ac_cv_lib_$ac_lib_var=yes"
9764 else
9765   echo "configure: failed program was:" >&5
9766   cat conftest.$ac_ext >&5
9767   rm -rf conftest*
9768   eval "ac_cv_lib_$ac_lib_var=no"
9769 fi
9770 rm -f conftest*
9771 xe_check_libs=""
9772
9773 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9774   echo "$ac_t""yes" 1>&6
9775   libwnn=wnn4
9776 else
9777   echo "$ac_t""no" 1>&6
9778 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
9779 echo "configure:9780: checking for jl_dic_list_e in -lwnn6" >&5
9780 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9781
9782 xe_check_libs=" -lwnn6 "
9783 cat > conftest.$ac_ext <<EOF
9784 #line 9785 "configure"
9785 #include "confdefs.h"
9786 /* Override any gcc2 internal prototype to avoid an error.  */
9787 /* We use char because int might match the return type of a gcc2
9788     builtin and then its argument prototype would still apply.  */
9789 char jl_dic_list_e();
9790
9791 int main() {
9792 jl_dic_list_e()
9793 ; return 0; }
9794 EOF
9795 if { (eval echo configure:9796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9796   rm -rf conftest*
9797   eval "ac_cv_lib_$ac_lib_var=yes"
9798 else
9799   echo "configure: failed program was:" >&5
9800   cat conftest.$ac_ext >&5
9801   rm -rf conftest*
9802   eval "ac_cv_lib_$ac_lib_var=no"
9803 fi
9804 rm -f conftest*
9805 xe_check_libs=""
9806
9807 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9808   echo "$ac_t""yes" 1>&6
9809   libwnn=wnn6
9810 else
9811   echo "$ac_t""no" 1>&6
9812 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
9813 echo "configure:9814: checking for dic_list_e in -lwnn6_fromsrc" >&5
9814 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
9815
9816 xe_check_libs=" -lwnn6_fromsrc "
9817 cat > conftest.$ac_ext <<EOF
9818 #line 9819 "configure"
9819 #include "confdefs.h"
9820 /* Override any gcc2 internal prototype to avoid an error.  */
9821 /* We use char because int might match the return type of a gcc2
9822     builtin and then its argument prototype would still apply.  */
9823 char dic_list_e();
9824
9825 int main() {
9826 dic_list_e()
9827 ; return 0; }
9828 EOF
9829 if { (eval echo configure:9830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9830   rm -rf conftest*
9831   eval "ac_cv_lib_$ac_lib_var=yes"
9832 else
9833   echo "configure: failed program was:" >&5
9834   cat conftest.$ac_ext >&5
9835   rm -rf conftest*
9836   eval "ac_cv_lib_$ac_lib_var=no"
9837 fi
9838 rm -f conftest*
9839 xe_check_libs=""
9840
9841 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9842   echo "$ac_t""yes" 1>&6
9843   libwnn=wnn6_fromsrc
9844 else
9845   echo "$ac_t""no" 1>&6
9846 with_wnn=no
9847 fi
9848
9849
9850 fi
9851
9852
9853 fi
9854
9855
9856 fi
9857
9858
9859   fi
9860   test -z "$with_wnn" && with_wnn=yes
9861   if test "$with_wnn" = "yes"; then
9862     { test "$extra_verbose" = "yes" && cat << \EOF
9863     Defining HAVE_WNN
9864 EOF
9865 cat >> confdefs.h <<\EOF
9866 #define HAVE_WNN 1
9867 EOF
9868 }
9869
9870     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
9871     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
9872    echo "    xemacs will be linked with \"mule-wnnfns.o\""
9873  fi
9874     if test "$with_wnn6" != "no"; then
9875       
9876 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
9877 echo "configure:9878: checking for jl_fi_dic_list in -l$libwnn" >&5
9878 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
9879
9880 xe_check_libs=" -l$libwnn "
9881 cat > conftest.$ac_ext <<EOF
9882 #line 9883 "configure"
9883 #include "confdefs.h"
9884 /* Override any gcc2 internal prototype to avoid an error.  */
9885 /* We use char because int might match the return type of a gcc2
9886     builtin and then its argument prototype would still apply.  */
9887 char jl_fi_dic_list();
9888
9889 int main() {
9890 jl_fi_dic_list()
9891 ; return 0; }
9892 EOF
9893 if { (eval echo configure:9894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9894   rm -rf conftest*
9895   eval "ac_cv_lib_$ac_lib_var=yes"
9896 else
9897   echo "configure: failed program was:" >&5
9898   cat conftest.$ac_ext >&5
9899   rm -rf conftest*
9900   eval "ac_cv_lib_$ac_lib_var=no"
9901 fi
9902 rm -f conftest*
9903 xe_check_libs=""
9904
9905 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9906   echo "$ac_t""yes" 1>&6
9907   with_wnn6=yes
9908 else
9909   echo "$ac_t""no" 1>&6
9910 fi
9911
9912
9913       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9914     Defining WNN6
9915 EOF
9916 cat >> confdefs.h <<\EOF
9917 #define WNN6 1
9918 EOF
9919 }
9920
9921     fi
9922   fi
9923
9924     canna_includes_found=no
9925   if test "$with_canna" != "no"; then
9926     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
9927 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
9928 echo "configure:9929: checking for canna/jrkanji.h" >&5
9929
9930 cat > conftest.$ac_ext <<EOF
9931 #line 9932 "configure"
9932 #include "confdefs.h"
9933 #include <canna/jrkanji.h>
9934 EOF
9935 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9936 { (eval echo configure:9937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9937 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9938 if test -z "$ac_err"; then
9939   rm -rf conftest*
9940   eval "ac_cv_header_$ac_safe=yes"
9941 else
9942   echo "$ac_err" >&5
9943   echo "configure: failed program was:" >&5
9944   cat conftest.$ac_ext >&5
9945   rm -rf conftest*
9946   eval "ac_cv_header_$ac_safe=no"
9947 fi
9948 rm -f conftest*
9949 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9950   echo "$ac_t""yes" 1>&6
9951   canna_includes_found=yes
9952 else
9953   echo "$ac_t""no" 1>&6
9954 fi
9955
9956   fi
9957   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
9958       -d "/usr/local/canna/include"; then
9959     save_c_switch_site="$c_switch_site"
9960     c_switch_site="$c_switch_site -I/usr/local/canna/include"
9961     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
9962 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
9963 echo "configure:9964: checking for canna/jrkanji.h" >&5
9964
9965 cat > conftest.$ac_ext <<EOF
9966 #line 9967 "configure"
9967 #include "confdefs.h"
9968 #include <canna/jrkanji.h>
9969 EOF
9970 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9971 { (eval echo configure:9972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9972 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9973 if test -z "$ac_err"; then
9974   rm -rf conftest*
9975   eval "ac_cv_header_$ac_safe=yes"
9976 else
9977   echo "$ac_err" >&5
9978   echo "configure: failed program was:" >&5
9979   cat conftest.$ac_ext >&5
9980   rm -rf conftest*
9981   eval "ac_cv_header_$ac_safe=no"
9982 fi
9983 rm -f conftest*
9984 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9985   echo "$ac_t""yes" 1>&6
9986   canna_includes_found=yes
9987 else
9988   echo "$ac_t""no" 1>&6
9989 fi
9990
9991     if test "$canna_includes_found" != "yes"; then
9992       c_switch_site="$save_c_switch_site"
9993       with_canna="no"
9994     fi
9995   fi
9996
9997   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
9998 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
9999 echo "configure:10000: checking for canna/RK.h" >&5
10000
10001 cat > conftest.$ac_ext <<EOF
10002 #line 10003 "configure"
10003 #include "confdefs.h"
10004 #include <canna/RK.h>
10005 EOF
10006 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10007 { (eval echo configure:10008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10008 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10009 if test -z "$ac_err"; then
10010   rm -rf conftest*
10011   eval "ac_cv_header_$ac_safe=yes"
10012 else
10013   echo "$ac_err" >&5
10014   echo "configure: failed program was:" >&5
10015   cat conftest.$ac_ext >&5
10016   rm -rf conftest*
10017   eval "ac_cv_header_$ac_safe=no"
10018 fi
10019 rm -f conftest*
10020 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10021   echo "$ac_t""yes" 1>&6
10022   :
10023 else
10024   echo "$ac_t""no" 1>&6
10025 with_canna=no
10026 fi
10027  }
10028   test -z "$with_canna" && { 
10029 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
10030 echo "configure:10031: checking for RkBgnBun in -lRKC" >&5
10031 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
10032
10033 xe_check_libs=" -lRKC "
10034 cat > conftest.$ac_ext <<EOF
10035 #line 10036 "configure"
10036 #include "confdefs.h"
10037 /* Override any gcc2 internal prototype to avoid an error.  */
10038 /* We use char because int might match the return type of a gcc2
10039     builtin and then its argument prototype would still apply.  */
10040 char RkBgnBun();
10041
10042 int main() {
10043 RkBgnBun()
10044 ; return 0; }
10045 EOF
10046 if { (eval echo configure:10047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10047   rm -rf conftest*
10048   eval "ac_cv_lib_$ac_lib_var=yes"
10049 else
10050   echo "configure: failed program was:" >&5
10051   cat conftest.$ac_ext >&5
10052   rm -rf conftest*
10053   eval "ac_cv_lib_$ac_lib_var=no"
10054 fi
10055 rm -f conftest*
10056 xe_check_libs=""
10057
10058 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10059   echo "$ac_t""yes" 1>&6
10060   :
10061 else
10062   echo "$ac_t""no" 1>&6
10063 with_canna=no
10064 fi
10065
10066  }
10067   test -z "$with_canna" && { 
10068 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
10069 echo "configure:10070: checking for jrKanjiControl in -lcanna" >&5
10070 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
10071
10072 xe_check_libs=" -lcanna "
10073 cat > conftest.$ac_ext <<EOF
10074 #line 10075 "configure"
10075 #include "confdefs.h"
10076 /* Override any gcc2 internal prototype to avoid an error.  */
10077 /* We use char because int might match the return type of a gcc2
10078     builtin and then its argument prototype would still apply.  */
10079 char jrKanjiControl();
10080
10081 int main() {
10082 jrKanjiControl()
10083 ; return 0; }
10084 EOF
10085 if { (eval echo configure:10086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10086   rm -rf conftest*
10087   eval "ac_cv_lib_$ac_lib_var=yes"
10088 else
10089   echo "configure: failed program was:" >&5
10090   cat conftest.$ac_ext >&5
10091   rm -rf conftest*
10092   eval "ac_cv_lib_$ac_lib_var=no"
10093 fi
10094 rm -f conftest*
10095 xe_check_libs=""
10096
10097 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10098   echo "$ac_t""yes" 1>&6
10099   :
10100 else
10101   echo "$ac_t""no" 1>&6
10102 with_canna=no
10103 fi
10104
10105  }
10106   test -z "$with_canna" && with_canna=yes
10107   if test "$with_canna" = "yes"; then
10108     { test "$extra_verbose" = "yes" && cat << \EOF
10109     Defining HAVE_CANNA
10110 EOF
10111 cat >> confdefs.h <<\EOF
10112 #define HAVE_CANNA 1
10113 EOF
10114 }
10115
10116     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
10117     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
10118    echo "    xemacs will be linked with \"mule-canna.o\""
10119  fi
10120   fi
10121
10122 else   for feature in xim canna wnn; do
10123     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
10124       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
10125     fi
10126     eval "with_${feature}=no"
10127   done
10128 fi 
10129
10130 if test "$need_motif" = "yes" ; then
10131   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
10132     
10133 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
10134 echo "configure:10135: checking for layout_object_getvalue in -li18n" >&5
10135 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
10136
10137 xe_check_libs=" -li18n "
10138 cat > conftest.$ac_ext <<EOF
10139 #line 10140 "configure"
10140 #include "confdefs.h"
10141 /* Override any gcc2 internal prototype to avoid an error.  */
10142 /* We use char because int might match the return type of a gcc2
10143     builtin and then its argument prototype would still apply.  */
10144 char layout_object_getvalue();
10145
10146 int main() {
10147 layout_object_getvalue()
10148 ; return 0; }
10149 EOF
10150 if { (eval echo configure:10151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10151   rm -rf conftest*
10152   eval "ac_cv_lib_$ac_lib_var=yes"
10153 else
10154   echo "configure: failed program was:" >&5
10155   cat conftest.$ac_ext >&5
10156   rm -rf conftest*
10157   eval "ac_cv_lib_$ac_lib_var=no"
10158 fi
10159 rm -f conftest*
10160 xe_check_libs=""
10161
10162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10163   echo "$ac_t""yes" 1>&6
10164   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
10165 else
10166   echo "$ac_t""no" 1>&6
10167 fi
10168
10169
10170   
10171 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
10172     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
10173   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
10174   
10175         runpath="" runpath_dirs=""
10176   if test -n "$LD_RUN_PATH"; then
10177     runpath="$LD_RUN_PATH"
10178   elif test "$GCC" = "yes"; then
10179         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
10180     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
10181     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
10182     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
10183       case "$arg" in P,* | -L* | -R* )
10184         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
10185           {
10186 xe_runpath_dir="$dir"
10187   test "$xe_runpath_dir" != "/lib"     -a \
10188         "$xe_runpath_dir" != "/usr/lib" -a \
10189         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
10190   eval "$xe_add_unique_runpath_dir"
10191 }
10192         done ;;
10193       esac
10194     done
10195     ld_switch_run="$ld_switch_run_save"
10196     rm -f conftest*
10197   else
10198         for arg in $ld_switch_site $ld_switch_x_site; do
10199       case "$arg" in -L*) {
10200 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
10201   test "$xe_runpath_dir" != "/lib"     -a \
10202         "$xe_runpath_dir" != "/usr/lib" -a \
10203         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
10204   eval "$xe_add_unique_runpath_dir"
10205 };; esac
10206     done
10207         if test "$opsys $need_motif" = "sol2 yes"; then
10208       xe_runpath_dir="/opt/SUNWdt/lib";
10209       eval "$xe_add_unique_runpath_dir";
10210     fi
10211   fi 
10212   if test -n "$runpath"; then
10213     ld_switch_run="${dash_r}${runpath}"
10214     
10215 if test "$GCC" = "yes"; then
10216   set x $ld_switch_run; shift; ld_switch_run=""
10217   while test -n "$1"; do
10218     case $1 in
10219       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
10220       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
10221       -Xlinker* ) ;;
10222       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
10223     esac
10224     shift
10225   done
10226 fi
10227     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
10228   fi
10229 fi
10230
10231 fi
10232
10233 for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask
10234 do
10235 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10236 echo "configure:10237: checking for $ac_func" >&5
10237
10238 cat > conftest.$ac_ext <<EOF
10239 #line 10240 "configure"
10240 #include "confdefs.h"
10241 /* System header to define __stub macros and hopefully few prototypes,
10242     which can conflict with char $ac_func(); below.  */
10243 #include <assert.h>
10244 /* Override any gcc2 internal prototype to avoid an error.  */
10245 /* We use char because int might match the return type of a gcc2
10246     builtin and then its argument prototype would still apply.  */
10247 char $ac_func();
10248
10249 int main() {
10250
10251 /* The GNU C library defines this for functions which it implements
10252     to always fail with ENOSYS.  Some functions are actually named
10253     something starting with __ and the normal name is an alias.  */
10254 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10255 choke me
10256 #else
10257 $ac_func();
10258 #endif
10259
10260 ; return 0; }
10261 EOF
10262 if { (eval echo configure:10263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10263   rm -rf conftest*
10264   eval "ac_cv_func_$ac_func=yes"
10265 else
10266   echo "configure: failed program was:" >&5
10267   cat conftest.$ac_ext >&5
10268   rm -rf conftest*
10269   eval "ac_cv_func_$ac_func=no"
10270 fi
10271 rm -f conftest*
10272
10273 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10274   echo "$ac_t""yes" 1>&6
10275     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10276   { test "$extra_verbose" = "yes" && cat << EOF
10277     Defining $ac_tr_func
10278 EOF
10279 cat >> confdefs.h <<EOF
10280 #define $ac_tr_func 1
10281 EOF
10282 }
10283  
10284 else
10285   echo "$ac_t""no" 1>&6
10286 fi
10287 done
10288
10289
10290
10291 for ac_func in getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp
10292 do
10293 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10294 echo "configure:10295: checking for $ac_func" >&5
10295
10296 cat > conftest.$ac_ext <<EOF
10297 #line 10298 "configure"
10298 #include "confdefs.h"
10299 /* System header to define __stub macros and hopefully few prototypes,
10300     which can conflict with char $ac_func(); below.  */
10301 #include <assert.h>
10302 /* Override any gcc2 internal prototype to avoid an error.  */
10303 /* We use char because int might match the return type of a gcc2
10304     builtin and then its argument prototype would still apply.  */
10305 char $ac_func();
10306
10307 int main() {
10308
10309 /* The GNU C library defines this for functions which it implements
10310     to always fail with ENOSYS.  Some functions are actually named
10311     something starting with __ and the normal name is an alias.  */
10312 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10313 choke me
10314 #else
10315 $ac_func();
10316 #endif
10317
10318 ; return 0; }
10319 EOF
10320 if { (eval echo configure:10321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10321   rm -rf conftest*
10322   eval "ac_cv_func_$ac_func=yes"
10323 else
10324   echo "configure: failed program was:" >&5
10325   cat conftest.$ac_ext >&5
10326   rm -rf conftest*
10327   eval "ac_cv_func_$ac_func=no"
10328 fi
10329 rm -f conftest*
10330
10331 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10332   echo "$ac_t""yes" 1>&6
10333     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10334   { test "$extra_verbose" = "yes" && cat << EOF
10335     Defining $ac_tr_func
10336 EOF
10337 cat >> confdefs.h <<EOF
10338 #define $ac_tr_func 1
10339 EOF
10340 }
10341  
10342 else
10343   echo "$ac_t""no" 1>&6
10344 fi
10345 done
10346
10347
10348 echo $ac_n "checking for openpty""... $ac_c" 1>&6
10349 echo "configure:10350: checking for openpty" >&5
10350
10351 cat > conftest.$ac_ext <<EOF
10352 #line 10353 "configure"
10353 #include "confdefs.h"
10354 /* System header to define __stub macros and hopefully few prototypes,
10355     which can conflict with char openpty(); below.  */
10356 #include <assert.h>
10357 /* Override any gcc2 internal prototype to avoid an error.  */
10358 /* We use char because int might match the return type of a gcc2
10359     builtin and then its argument prototype would still apply.  */
10360 char openpty();
10361
10362 int main() {
10363
10364 /* The GNU C library defines this for functions which it implements
10365     to always fail with ENOSYS.  Some functions are actually named
10366     something starting with __ and the normal name is an alias.  */
10367 #if defined (__stub_openpty) || defined (__stub___openpty)
10368 choke me
10369 #else
10370 openpty();
10371 #endif
10372
10373 ; return 0; }
10374 EOF
10375 if { (eval echo configure:10376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10376   rm -rf conftest*
10377   eval "ac_cv_func_openpty=yes"
10378 else
10379   echo "configure: failed program was:" >&5
10380   cat conftest.$ac_ext >&5
10381   rm -rf conftest*
10382   eval "ac_cv_func_openpty=no"
10383 fi
10384 rm -f conftest*
10385
10386 if eval "test \"`echo '$ac_cv_func_'openpty`\" = yes"; then
10387   echo "$ac_t""yes" 1>&6
10388   have_openpty=yes
10389 else
10390   echo "$ac_t""no" 1>&6
10391
10392   
10393 echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
10394 echo "configure:10395: checking for openpty in -lutil" >&5
10395 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
10396
10397 xe_check_libs=" -lutil "
10398 cat > conftest.$ac_ext <<EOF
10399 #line 10400 "configure"
10400 #include "confdefs.h"
10401 /* Override any gcc2 internal prototype to avoid an error.  */
10402 /* We use char because int might match the return type of a gcc2
10403     builtin and then its argument prototype would still apply.  */
10404 char openpty();
10405
10406 int main() {
10407 openpty()
10408 ; return 0; }
10409 EOF
10410 if { (eval echo configure:10411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10411   rm -rf conftest*
10412   eval "ac_cv_lib_$ac_lib_var=yes"
10413 else
10414   echo "configure: failed program was:" >&5
10415   cat conftest.$ac_ext >&5
10416   rm -rf conftest*
10417   eval "ac_cv_lib_$ac_lib_var=no"
10418 fi
10419 rm -f conftest*
10420 xe_check_libs=""
10421
10422 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10423   echo "$ac_t""yes" 1>&6
10424   have_openpty=yes need_libutil=yes
10425 else
10426   echo "$ac_t""no" 1>&6
10427 fi
10428
10429
10430 fi
10431
10432 if test "$have_openpty" = "yes"; then
10433   { test "$extra_verbose" = "yes" && cat << \EOF
10434     Defining HAVE_OPENPTY
10435 EOF
10436 cat >> confdefs.h <<\EOF
10437 #define HAVE_OPENPTY 1
10438 EOF
10439 }
10440
10441   for ac_hdr in pty.h libutil.h util.h
10442 do
10443 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10444 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10445 echo "configure:10446: checking for $ac_hdr" >&5
10446
10447 cat > conftest.$ac_ext <<EOF
10448 #line 10449 "configure"
10449 #include "confdefs.h"
10450 #include <$ac_hdr>
10451 EOF
10452 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10453 { (eval echo configure:10454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10454 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10455 if test -z "$ac_err"; then
10456   rm -rf conftest*
10457   eval "ac_cv_header_$ac_safe=yes"
10458 else
10459   echo "$ac_err" >&5
10460   echo "configure: failed program was:" >&5
10461   cat conftest.$ac_ext >&5
10462   rm -rf conftest*
10463   eval "ac_cv_header_$ac_safe=no"
10464 fi
10465 rm -f conftest*
10466 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10467   echo "$ac_t""yes" 1>&6
10468     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10469   { test "$extra_verbose" = "yes" && cat << EOF
10470     Defining $ac_tr_hdr
10471 EOF
10472 cat >> confdefs.h <<EOF
10473 #define $ac_tr_hdr 1
10474 EOF
10475 }
10476  break
10477 else
10478   echo "$ac_t""no" 1>&6
10479 fi
10480 done
10481
10482   test "$need_libutil" = "yes" && libs_system="$libs_system -lutil" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lutil\" to \$libs_system"; fi
10483 fi
10484
10485 for ac_hdr in stropts.h
10486 do
10487 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10488 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10489 echo "configure:10490: checking for $ac_hdr" >&5
10490
10491 cat > conftest.$ac_ext <<EOF
10492 #line 10493 "configure"
10493 #include "confdefs.h"
10494 #include <$ac_hdr>
10495 EOF
10496 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10497 { (eval echo configure:10498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10498 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10499 if test -z "$ac_err"; then
10500   rm -rf conftest*
10501   eval "ac_cv_header_$ac_safe=yes"
10502 else
10503   echo "$ac_err" >&5
10504   echo "configure: failed program was:" >&5
10505   cat conftest.$ac_ext >&5
10506   rm -rf conftest*
10507   eval "ac_cv_header_$ac_safe=no"
10508 fi
10509 rm -f conftest*
10510 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10511   echo "$ac_t""yes" 1>&6
10512     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10513   { test "$extra_verbose" = "yes" && cat << EOF
10514     Defining $ac_tr_hdr
10515 EOF
10516 cat >> confdefs.h <<EOF
10517 #define $ac_tr_hdr 1
10518 EOF
10519 }
10520  
10521 else
10522   echo "$ac_t""no" 1>&6
10523 fi
10524 done
10525
10526 if test "$ac_cv_header_stropts_h" = "yes"; then
10527   for ac_func in isastream
10528 do
10529 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10530 echo "configure:10531: checking for $ac_func" >&5
10531
10532 cat > conftest.$ac_ext <<EOF
10533 #line 10534 "configure"
10534 #include "confdefs.h"
10535 /* System header to define __stub macros and hopefully few prototypes,
10536     which can conflict with char $ac_func(); below.  */
10537 #include <assert.h>
10538 /* Override any gcc2 internal prototype to avoid an error.  */
10539 /* We use char because int might match the return type of a gcc2
10540     builtin and then its argument prototype would still apply.  */
10541 char $ac_func();
10542
10543 int main() {
10544
10545 /* The GNU C library defines this for functions which it implements
10546     to always fail with ENOSYS.  Some functions are actually named
10547     something starting with __ and the normal name is an alias.  */
10548 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10549 choke me
10550 #else
10551 $ac_func();
10552 #endif
10553
10554 ; return 0; }
10555 EOF
10556 if { (eval echo configure:10557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10557   rm -rf conftest*
10558   eval "ac_cv_func_$ac_func=yes"
10559 else
10560   echo "configure: failed program was:" >&5
10561   cat conftest.$ac_ext >&5
10562   rm -rf conftest*
10563   eval "ac_cv_func_$ac_func=no"
10564 fi
10565 rm -f conftest*
10566
10567 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10568   echo "$ac_t""yes" 1>&6
10569     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10570   { test "$extra_verbose" = "yes" && cat << EOF
10571     Defining $ac_tr_func
10572 EOF
10573 cat >> confdefs.h <<EOF
10574 #define $ac_tr_func 1
10575 EOF
10576 }
10577  
10578 else
10579   echo "$ac_t""no" 1>&6
10580 fi
10581 done
10582
10583   for ac_hdr in strtio.h
10584 do
10585 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10586 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10587 echo "configure:10588: checking for $ac_hdr" >&5
10588
10589 cat > conftest.$ac_ext <<EOF
10590 #line 10591 "configure"
10591 #include "confdefs.h"
10592 #include <$ac_hdr>
10593 EOF
10594 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10595 { (eval echo configure:10596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10596 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10597 if test -z "$ac_err"; then
10598   rm -rf conftest*
10599   eval "ac_cv_header_$ac_safe=yes"
10600 else
10601   echo "$ac_err" >&5
10602   echo "configure: failed program was:" >&5
10603   cat conftest.$ac_ext >&5
10604   rm -rf conftest*
10605   eval "ac_cv_header_$ac_safe=no"
10606 fi
10607 rm -f conftest*
10608 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10609   echo "$ac_t""yes" 1>&6
10610     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10611   { test "$extra_verbose" = "yes" && cat << EOF
10612     Defining $ac_tr_hdr
10613 EOF
10614 cat >> confdefs.h <<EOF
10615 #define $ac_tr_hdr 1
10616 EOF
10617 }
10618  
10619 else
10620   echo "$ac_t""no" 1>&6
10621 fi
10622 done
10623  fi
10624
10625 extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
10626    echo "    xemacs will be linked with \"realpath.o\""
10627  fi
10628
10629 for ac_func in getloadavg
10630 do
10631 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10632 echo "configure:10633: checking for $ac_func" >&5
10633
10634 cat > conftest.$ac_ext <<EOF
10635 #line 10636 "configure"
10636 #include "confdefs.h"
10637 /* System header to define __stub macros and hopefully few prototypes,
10638     which can conflict with char $ac_func(); below.  */
10639 #include <assert.h>
10640 /* Override any gcc2 internal prototype to avoid an error.  */
10641 /* We use char because int might match the return type of a gcc2
10642     builtin and then its argument prototype would still apply.  */
10643 char $ac_func();
10644
10645 int main() {
10646
10647 /* The GNU C library defines this for functions which it implements
10648     to always fail with ENOSYS.  Some functions are actually named
10649     something starting with __ and the normal name is an alias.  */
10650 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10651 choke me
10652 #else
10653 $ac_func();
10654 #endif
10655
10656 ; return 0; }
10657 EOF
10658 if { (eval echo configure:10659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10659   rm -rf conftest*
10660   eval "ac_cv_func_$ac_func=yes"
10661 else
10662   echo "configure: failed program was:" >&5
10663   cat conftest.$ac_ext >&5
10664   rm -rf conftest*
10665   eval "ac_cv_func_$ac_func=no"
10666 fi
10667 rm -f conftest*
10668
10669 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10670   echo "$ac_t""yes" 1>&6
10671     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10672   { test "$extra_verbose" = "yes" && cat << EOF
10673     Defining $ac_tr_func
10674 EOF
10675 cat >> confdefs.h <<EOF
10676 #define $ac_tr_func 1
10677 EOF
10678 }
10679  
10680 else
10681   echo "$ac_t""no" 1>&6
10682 fi
10683 done
10684
10685
10686 if test "$ac_cv_func_getloadavg" = "yes"; then
10687         for ac_hdr in sys/loadavg.h
10688 do
10689 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10690 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10691 echo "configure:10692: checking for $ac_hdr" >&5
10692
10693 cat > conftest.$ac_ext <<EOF
10694 #line 10695 "configure"
10695 #include "confdefs.h"
10696 #include <$ac_hdr>
10697 EOF
10698 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10699 { (eval echo configure:10700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10700 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10701 if test -z "$ac_err"; then
10702   rm -rf conftest*
10703   eval "ac_cv_header_$ac_safe=yes"
10704 else
10705   echo "$ac_err" >&5
10706   echo "configure: failed program was:" >&5
10707   cat conftest.$ac_ext >&5
10708   rm -rf conftest*
10709   eval "ac_cv_header_$ac_safe=no"
10710 fi
10711 rm -f conftest*
10712 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10713   echo "$ac_t""yes" 1>&6
10714     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10715   { test "$extra_verbose" = "yes" && cat << EOF
10716     Defining $ac_tr_hdr
10717 EOF
10718 cat >> confdefs.h <<EOF
10719 #define $ac_tr_hdr 1
10720 EOF
10721 }
10722  
10723 else
10724   echo "$ac_t""no" 1>&6
10725 fi
10726 done
10727
10728 else
10729     extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
10730    echo "    xemacs will be linked with \"getloadavg.o\""
10731  fi
10732
10733     
10734 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
10735 echo "configure:10736: checking for kstat_open in -lkstat" >&5
10736 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
10737
10738 xe_check_libs=" -lkstat "
10739 cat > conftest.$ac_ext <<EOF
10740 #line 10741 "configure"
10741 #include "confdefs.h"
10742 /* Override any gcc2 internal prototype to avoid an error.  */
10743 /* We use char because int might match the return type of a gcc2
10744     builtin and then its argument prototype would still apply.  */
10745 char kstat_open();
10746
10747 int main() {
10748 kstat_open()
10749 ; return 0; }
10750 EOF
10751 if { (eval echo configure:10752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10752   rm -rf conftest*
10753   eval "ac_cv_lib_$ac_lib_var=yes"
10754 else
10755   echo "configure: failed program was:" >&5
10756   cat conftest.$ac_ext >&5
10757   rm -rf conftest*
10758   eval "ac_cv_lib_$ac_lib_var=no"
10759 fi
10760 rm -f conftest*
10761 xe_check_libs=""
10762
10763 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10764   echo "$ac_t""yes" 1>&6
10765     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10766     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10767   { test "$extra_verbose" = "yes" && cat << EOF
10768     Defining $ac_tr_lib
10769 EOF
10770 cat >> confdefs.h <<EOF
10771 #define $ac_tr_lib 1
10772 EOF
10773 }
10774
10775   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
10776
10777 else
10778   echo "$ac_t""no" 1>&6
10779 fi
10780
10781
10782   for ac_hdr in kstat.h
10783 do
10784 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10785 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10786 echo "configure:10787: checking for $ac_hdr" >&5
10787
10788 cat > conftest.$ac_ext <<EOF
10789 #line 10790 "configure"
10790 #include "confdefs.h"
10791 #include <$ac_hdr>
10792 EOF
10793 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10794 { (eval echo configure:10795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10795 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10796 if test -z "$ac_err"; then
10797   rm -rf conftest*
10798   eval "ac_cv_header_$ac_safe=yes"
10799 else
10800   echo "$ac_err" >&5
10801   echo "configure: failed program was:" >&5
10802   cat conftest.$ac_ext >&5
10803   rm -rf conftest*
10804   eval "ac_cv_header_$ac_safe=no"
10805 fi
10806 rm -f conftest*
10807 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10808   echo "$ac_t""yes" 1>&6
10809     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10810   { test "$extra_verbose" = "yes" && cat << EOF
10811     Defining $ac_tr_hdr
10812 EOF
10813 cat >> confdefs.h <<EOF
10814 #define $ac_tr_hdr 1
10815 EOF
10816 }
10817  
10818 else
10819   echo "$ac_t""no" 1>&6
10820 fi
10821 done
10822
10823
10824     
10825 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
10826 echo "configure:10827: checking for kvm_read in -lkvm" >&5
10827 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
10828
10829 xe_check_libs=" -lkvm "
10830 cat > conftest.$ac_ext <<EOF
10831 #line 10832 "configure"
10832 #include "confdefs.h"
10833 /* Override any gcc2 internal prototype to avoid an error.  */
10834 /* We use char because int might match the return type of a gcc2
10835     builtin and then its argument prototype would still apply.  */
10836 char kvm_read();
10837
10838 int main() {
10839 kvm_read()
10840 ; return 0; }
10841 EOF
10842 if { (eval echo configure:10843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10843   rm -rf conftest*
10844   eval "ac_cv_lib_$ac_lib_var=yes"
10845 else
10846   echo "configure: failed program was:" >&5
10847   cat conftest.$ac_ext >&5
10848   rm -rf conftest*
10849   eval "ac_cv_lib_$ac_lib_var=no"
10850 fi
10851 rm -f conftest*
10852 xe_check_libs=""
10853
10854 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10855   echo "$ac_t""yes" 1>&6
10856     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10857     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10858   { test "$extra_verbose" = "yes" && cat << EOF
10859     Defining $ac_tr_lib
10860 EOF
10861 cat >> confdefs.h <<EOF
10862 #define $ac_tr_lib 1
10863 EOF
10864 }
10865
10866   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
10867
10868 else
10869   echo "$ac_t""no" 1>&6
10870 fi
10871
10872
10873 fi
10874
10875 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
10876 echo "configure:10877: checking whether netdb declares h_errno" >&5
10877 cat > conftest.$ac_ext <<EOF
10878 #line 10879 "configure"
10879 #include "confdefs.h"
10880 #include <netdb.h>
10881 int main() {
10882 return h_errno;
10883 ; return 0; }
10884 EOF
10885 if { (eval echo configure:10886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10886   rm -rf conftest*
10887   echo "$ac_t""yes" 1>&6
10888    { test "$extra_verbose" = "yes" && cat << \EOF
10889     Defining HAVE_H_ERRNO
10890 EOF
10891 cat >> confdefs.h <<\EOF
10892 #define HAVE_H_ERRNO 1
10893 EOF
10894 }
10895
10896 else
10897   echo "configure: failed program was:" >&5
10898   cat conftest.$ac_ext >&5
10899   rm -rf conftest*
10900   echo "$ac_t""no" 1>&6
10901 fi
10902 rm -f conftest*
10903
10904 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
10905 echo "configure:10906: checking for sigsetjmp" >&5
10906 cat > conftest.$ac_ext <<EOF
10907 #line 10908 "configure"
10908 #include "confdefs.h"
10909 #include <setjmp.h>
10910 int main() {
10911 sigjmp_buf bar; sigsetjmp (bar, 0);
10912 ; return 0; }
10913 EOF
10914 if { (eval echo configure:10915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10915   rm -rf conftest*
10916   echo "$ac_t""yes" 1>&6
10917    { test "$extra_verbose" = "yes" && cat << \EOF
10918     Defining HAVE_SIGSETJMP
10919 EOF
10920 cat >> confdefs.h <<\EOF
10921 #define HAVE_SIGSETJMP 1
10922 EOF
10923 }
10924
10925 else
10926   echo "configure: failed program was:" >&5
10927   cat conftest.$ac_ext >&5
10928   rm -rf conftest*
10929   echo "$ac_t""no" 1>&6
10930 fi
10931 rm -f conftest*
10932
10933 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
10934 echo "configure:10935: checking whether localtime caches TZ" >&5
10935
10936 if test "$ac_cv_func_tzset" = "yes"; then
10937 cat > conftest.$ac_ext <<EOF
10938 #line 10939 "configure"
10939 #include "confdefs.h"
10940 #include <time.h>
10941 #if STDC_HEADERS
10942 # include <stdlib.h>
10943 #endif
10944 extern char **environ;
10945 unset_TZ ()
10946 {
10947   char **from, **to;
10948   for (to = from = environ; (*to = *from); from++)
10949     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
10950       to++;
10951 }
10952 char TZ_GMT0[] = "TZ=GMT0";
10953 char TZ_PST8[] = "TZ=PST8";
10954 main()
10955 {
10956   time_t now = time ((time_t *) 0);
10957   int hour_GMT0, hour_unset;
10958   if (putenv (TZ_GMT0) != 0)
10959     exit (1);
10960   hour_GMT0 = localtime (&now)->tm_hour;
10961   unset_TZ ();
10962   hour_unset = localtime (&now)->tm_hour;
10963   if (putenv (TZ_PST8) != 0)
10964     exit (1);
10965   if (localtime (&now)->tm_hour == hour_GMT0)
10966     exit (1);
10967   unset_TZ ();
10968   if (localtime (&now)->tm_hour != hour_unset)
10969     exit (1);
10970   exit (0);
10971 }
10972 EOF
10973 if { (eval echo configure:10974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10974 then
10975   emacs_cv_localtime_cache=no
10976 else
10977   conftest_rc="$?"
10978   echo "configure: failed program was:" >&5
10979   cat conftest.$ac_ext >&5
10980   rm -fr conftest*
10981   emacs_cv_localtime_cache=yes
10982 fi
10983 rm -fr conftest*
10984 else
10985         # If we lack tzset, report that localtime does not cache TZ,
10986         # since we can't invalidate the cache if we don't have tzset.
10987         emacs_cv_localtime_cache=no
10988 fi
10989 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
10990 if test $emacs_cv_localtime_cache = yes; then
10991   { test "$extra_verbose" = "yes" && cat << \EOF
10992     Defining LOCALTIME_CACHE
10993 EOF
10994 cat >> confdefs.h <<\EOF
10995 #define LOCALTIME_CACHE 1
10996 EOF
10997 }
10998
10999 fi
11000
11001 if test "$HAVE_TIMEVAL" = "yes"; then
11002 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
11003 echo "configure:11004: checking whether gettimeofday accepts one or two arguments" >&5
11004 cat > conftest.$ac_ext <<EOF
11005 #line 11006 "configure"
11006 #include "confdefs.h"
11007
11008 #ifdef TIME_WITH_SYS_TIME
11009 #include <sys/time.h>
11010 #include <time.h>
11011 #else
11012 #ifdef HAVE_SYS_TIME_H
11013 #include <sys/time.h>
11014 #else
11015 #include <time.h>
11016 #endif
11017 #endif
11018   
11019 int main() {
11020
11021   struct timeval time;
11022   gettimeofday (&time, 0);
11023
11024 ; return 0; }
11025 EOF
11026 if { (eval echo configure:11027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11027   rm -rf conftest*
11028   echo "$ac_t""two" 1>&6
11029 else
11030   echo "configure: failed program was:" >&5
11031   cat conftest.$ac_ext >&5
11032   rm -rf conftest*
11033   echo "$ac_t""one" 1>&6
11034    { test "$extra_verbose" = "yes" && cat << \EOF
11035     Defining GETTIMEOFDAY_ONE_ARGUMENT
11036 EOF
11037 cat >> confdefs.h <<\EOF
11038 #define GETTIMEOFDAY_ONE_ARGUMENT 1
11039 EOF
11040 }
11041
11042 fi
11043 rm -f conftest*
11044 fi
11045
11046
11047 echo $ac_n "checking for inline""... $ac_c" 1>&6
11048 echo "configure:11049: checking for inline" >&5
11049
11050 ac_cv_c_inline=no
11051 for ac_kw in inline __inline__ __inline; do
11052   cat > conftest.$ac_ext <<EOF
11053 #line 11054 "configure"
11054 #include "confdefs.h"
11055
11056 int main() {
11057 } $ac_kw foo() {
11058 ; return 0; }
11059 EOF
11060 if { (eval echo configure:11061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11061   rm -rf conftest*
11062   ac_cv_c_inline=$ac_kw; break
11063 else
11064   echo "configure: failed program was:" >&5
11065   cat conftest.$ac_ext >&5
11066 fi
11067 rm -f conftest*
11068 done
11069
11070
11071 echo "$ac_t""$ac_cv_c_inline" 1>&6
11072 case "$ac_cv_c_inline" in
11073   inline | yes) ;;
11074   no) { test "$extra_verbose" = "yes" && cat << \EOF
11075     Defining inline = 
11076 EOF
11077 cat >> confdefs.h <<\EOF
11078 #define inline 
11079 EOF
11080 }
11081  ;;
11082   *)  { test "$extra_verbose" = "yes" && cat << EOF
11083     Defining inline = $ac_cv_c_inline
11084 EOF
11085 cat >> confdefs.h <<EOF
11086 #define inline $ac_cv_c_inline
11087 EOF
11088 }
11089  ;;
11090 esac
11091
11092 test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
11093    echo "    xemacs will be linked with \"inline.o\""
11094  fi
11095
11096
11097 if test "$__DECC" != "yes"; then
11098   # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
11099 # for constant arguments.  Useless!
11100 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
11101 echo "configure:11102: checking for working alloca.h" >&5
11102
11103 cat > conftest.$ac_ext <<EOF
11104 #line 11105 "configure"
11105 #include "confdefs.h"
11106 #include <alloca.h>
11107 int main() {
11108 char *p = alloca(2 * sizeof(int));
11109 ; return 0; }
11110 EOF
11111 if { (eval echo configure:11112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11112   rm -rf conftest*
11113   ac_cv_header_alloca_h=yes
11114 else
11115   echo "configure: failed program was:" >&5
11116   cat conftest.$ac_ext >&5
11117   rm -rf conftest*
11118   ac_cv_header_alloca_h=no
11119 fi
11120 rm -f conftest*
11121
11122 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
11123 if test $ac_cv_header_alloca_h = yes; then
11124   { test "$extra_verbose" = "yes" && cat << \EOF
11125     Defining HAVE_ALLOCA_H
11126 EOF
11127 cat >> confdefs.h <<\EOF
11128 #define HAVE_ALLOCA_H 1
11129 EOF
11130 }
11131
11132 fi
11133
11134 echo $ac_n "checking for alloca""... $ac_c" 1>&6
11135 echo "configure:11136: checking for alloca" >&5
11136
11137 cat > conftest.$ac_ext <<EOF
11138 #line 11139 "configure"
11139 #include "confdefs.h"
11140
11141 #ifdef __GNUC__
11142 # define alloca __builtin_alloca
11143 #else
11144 # ifdef _MSC_VER
11145 #  include <malloc.h>
11146 #  define alloca _alloca
11147 # else
11148 #  if HAVE_ALLOCA_H
11149 #   include <alloca.h>
11150 #  else
11151 #   ifdef _AIX
11152  #pragma alloca
11153 #   else
11154 #    ifndef alloca /* predefined by HP cc +Olibcalls */
11155 char *alloca ();
11156 #    endif
11157 #   endif
11158 #  endif
11159 # endif
11160 #endif
11161
11162 int main() {
11163 char *p = (char *) alloca(1);
11164 ; return 0; }
11165 EOF
11166 if { (eval echo configure:11167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11167   rm -rf conftest*
11168   ac_cv_func_alloca_works=yes
11169 else
11170   echo "configure: failed program was:" >&5
11171   cat conftest.$ac_ext >&5
11172   rm -rf conftest*
11173   ac_cv_func_alloca_works=no
11174 fi
11175 rm -f conftest*
11176
11177 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
11178 if test $ac_cv_func_alloca_works = yes; then
11179   { test "$extra_verbose" = "yes" && cat << \EOF
11180     Defining HAVE_ALLOCA
11181 EOF
11182 cat >> confdefs.h <<\EOF
11183 #define HAVE_ALLOCA 1
11184 EOF
11185 }
11186
11187 fi
11188
11189 if test $ac_cv_func_alloca_works = no; then
11190   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
11191   # that cause trouble.  Some versions do not even contain alloca or
11192   # contain a buggy version.  If you still want to use their alloca,
11193   # use ar to extract alloca.o from them instead of compiling alloca.c.
11194   ALLOCA=alloca.${ac_objext}
11195   { test "$extra_verbose" = "yes" && cat << \EOF
11196     Defining C_ALLOCA
11197 EOF
11198 cat >> confdefs.h <<\EOF
11199 #define C_ALLOCA 1
11200 EOF
11201 }
11202
11203
11204 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
11205 echo "configure:11206: checking whether alloca needs Cray hooks" >&5
11206
11207 cat > conftest.$ac_ext <<EOF
11208 #line 11209 "configure"
11209 #include "confdefs.h"
11210 #if defined(CRAY) && ! defined(CRAY2)
11211 webecray
11212 #else
11213 wenotbecray
11214 #endif
11215
11216 EOF
11217 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11218   egrep "webecray" >/dev/null 2>&1; then
11219   rm -rf conftest*
11220   ac_cv_os_cray=yes
11221 else
11222   rm -rf conftest*
11223   ac_cv_os_cray=no
11224 fi
11225 rm -f conftest*
11226
11227
11228 echo "$ac_t""$ac_cv_os_cray" 1>&6
11229 if test $ac_cv_os_cray = yes; then
11230 for ac_func in _getb67 GETB67 getb67; do
11231   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11232 echo "configure:11233: checking for $ac_func" >&5
11233
11234 cat > conftest.$ac_ext <<EOF
11235 #line 11236 "configure"
11236 #include "confdefs.h"
11237 /* System header to define __stub macros and hopefully few prototypes,
11238     which can conflict with char $ac_func(); below.  */
11239 #include <assert.h>
11240 /* Override any gcc2 internal prototype to avoid an error.  */
11241 /* We use char because int might match the return type of a gcc2
11242     builtin and then its argument prototype would still apply.  */
11243 char $ac_func();
11244
11245 int main() {
11246
11247 /* The GNU C library defines this for functions which it implements
11248     to always fail with ENOSYS.  Some functions are actually named
11249     something starting with __ and the normal name is an alias.  */
11250 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11251 choke me
11252 #else
11253 $ac_func();
11254 #endif
11255
11256 ; return 0; }
11257 EOF
11258 if { (eval echo configure:11259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11259   rm -rf conftest*
11260   eval "ac_cv_func_$ac_func=yes"
11261 else
11262   echo "configure: failed program was:" >&5
11263   cat conftest.$ac_ext >&5
11264   rm -rf conftest*
11265   eval "ac_cv_func_$ac_func=no"
11266 fi
11267 rm -f conftest*
11268
11269 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11270   echo "$ac_t""yes" 1>&6
11271   { test "$extra_verbose" = "yes" && cat << EOF
11272     Defining CRAY_STACKSEG_END = $ac_func
11273 EOF
11274 cat >> confdefs.h <<EOF
11275 #define CRAY_STACKSEG_END $ac_func
11276 EOF
11277 }
11278
11279   break
11280 else
11281   echo "$ac_t""no" 1>&6
11282 fi
11283
11284 done
11285 fi
11286
11287 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
11288 echo "configure:11289: checking stack direction for C alloca" >&5
11289
11290 cat > conftest.$ac_ext <<EOF
11291 #line 11292 "configure"
11292 #include "confdefs.h"
11293 find_stack_direction ()
11294 {
11295   static char *addr = 0;
11296   auto char dummy;
11297   if (addr == 0)
11298     {
11299       addr = &dummy;
11300       return find_stack_direction ();
11301     }
11302   else
11303     return (&dummy > addr) ? 1 : -1;
11304 }
11305 main ()
11306 {
11307   exit (find_stack_direction() < 0);
11308 }
11309 EOF
11310 if { (eval echo configure:11311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11311 then
11312   ac_cv_c_stack_direction=1
11313 else
11314   conftest_rc="$?"
11315   echo "configure: failed program was:" >&5
11316   cat conftest.$ac_ext >&5
11317   rm -fr conftest*
11318   ac_cv_c_stack_direction=-1
11319 fi
11320 rm -fr conftest*
11321
11322 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
11323 { test "$extra_verbose" = "yes" && cat << EOF
11324     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
11325 EOF
11326 cat >> confdefs.h <<EOF
11327 #define STACK_DIRECTION $ac_cv_c_stack_direction
11328 EOF
11329 }
11330
11331 fi
11332
11333   test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
11334    echo "    xemacs will be linked with \"$ALLOCA\""
11335  fi
11336 fi
11337
11338 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
11339 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
11340 echo "configure:11341: checking for vfork.h" >&5
11341
11342 cat > conftest.$ac_ext <<EOF
11343 #line 11344 "configure"
11344 #include "confdefs.h"
11345 #include <vfork.h>
11346 EOF
11347 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11348 { (eval echo configure:11349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11349 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11350 if test -z "$ac_err"; then
11351   rm -rf conftest*
11352   eval "ac_cv_header_$ac_safe=yes"
11353 else
11354   echo "$ac_err" >&5
11355   echo "configure: failed program was:" >&5
11356   cat conftest.$ac_ext >&5
11357   rm -rf conftest*
11358   eval "ac_cv_header_$ac_safe=no"
11359 fi
11360 rm -f conftest*
11361 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11362   echo "$ac_t""yes" 1>&6
11363   { test "$extra_verbose" = "yes" && cat << \EOF
11364     Defining HAVE_VFORK_H
11365 EOF
11366 cat >> confdefs.h <<\EOF
11367 #define HAVE_VFORK_H 1
11368 EOF
11369 }
11370
11371 else
11372   echo "$ac_t""no" 1>&6
11373 fi
11374
11375 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
11376 echo "configure:11377: checking for working vfork" >&5
11377
11378 cat > conftest.$ac_ext <<EOF
11379 #line 11380 "configure"
11380 #include "confdefs.h"
11381 /* Thanks to Paul Eggert for this test.  */
11382 #include <stdio.h>
11383 #include <sys/types.h>
11384 #include <sys/stat.h>
11385 #ifdef HAVE_UNISTD_H
11386 #include <unistd.h>
11387 #endif
11388 #ifdef HAVE_VFORK_H
11389 #include <vfork.h>
11390 #endif
11391 /* On some sparc systems, changes by the child to local and incoming
11392    argument registers are propagated back to the parent.
11393    The compiler is told about this with #include <vfork.h>,
11394    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
11395    Test for this by using a static variable whose address
11396    is put into a register that is clobbered by the vfork.  */
11397 static
11398 #ifdef __cplusplus
11399 sparc_address_test (int arg)
11400 #else
11401 sparc_address_test (arg) int arg;
11402 #endif
11403 {
11404   static pid_t child;
11405   if (!child) {
11406     child = vfork ();
11407     if (child < 0) {
11408       perror ("vfork");
11409       _exit(2);
11410     }
11411     if (!child) {
11412       arg = getpid();
11413       write(-1, "", 0);
11414       _exit (arg);
11415     }
11416   }
11417 }
11418 main() {
11419   pid_t parent = getpid ();
11420   pid_t child;
11421
11422   sparc_address_test ();
11423
11424   child = vfork ();
11425
11426   if (child == 0) {
11427     /* Here is another test for sparc vfork register problems.
11428        This test uses lots of local variables, at least
11429        as many local variables as main has allocated so far
11430        including compiler temporaries.  4 locals are enough for
11431        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
11432        A buggy compiler should reuse the register of parent
11433        for one of the local variables, since it will think that
11434        parent can't possibly be used any more in this routine.
11435        Assigning to the local variable will thus munge parent
11436        in the parent process.  */
11437     pid_t
11438       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
11439       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
11440     /* Convince the compiler that p..p7 are live; otherwise, it might
11441        use the same hardware register for all 8 local variables.  */
11442     if (p != p1 || p != p2 || p != p3 || p != p4
11443         || p != p5 || p != p6 || p != p7)
11444       _exit(1);
11445
11446     /* On some systems (e.g. IRIX 3.3),
11447        vfork doesn't separate parent from child file descriptors.
11448        If the child closes a descriptor before it execs or exits,
11449        this munges the parent's descriptor as well.
11450        Test for this by closing stdout in the child.  */
11451     _exit(close(fileno(stdout)) != 0);
11452   } else {
11453     int status;
11454     struct stat st;
11455
11456     while (wait(&status) != child)
11457       ;
11458     exit(
11459          /* Was there some problem with vforking?  */
11460          child < 0
11461
11462          /* Did the child fail?  (This shouldn't happen.)  */
11463          || status
11464
11465          /* Did the vfork/compiler bug occur?  */
11466          || parent != getpid()
11467
11468          /* Did the file descriptor bug occur?  */
11469          || fstat(fileno(stdout), &st) != 0
11470          );
11471   }
11472 }
11473 EOF
11474 if { (eval echo configure:11475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11475 then
11476   ac_cv_func_vfork_works=yes
11477 else
11478   conftest_rc="$?"
11479   echo "configure: failed program was:" >&5
11480   cat conftest.$ac_ext >&5
11481   rm -fr conftest*
11482   ac_cv_func_vfork_works=no
11483 fi
11484 rm -fr conftest*
11485
11486 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
11487 if test $ac_cv_func_vfork_works = no; then
11488   { test "$extra_verbose" = "yes" && cat << \EOF
11489     Defining vfork = fork
11490 EOF
11491 cat >> confdefs.h <<\EOF
11492 #define vfork fork
11493 EOF
11494 }
11495
11496 fi
11497
11498
11499 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
11500 echo "configure:11501: checking for working strcoll" >&5
11501
11502 cat > conftest.$ac_ext <<EOF
11503 #line 11504 "configure"
11504 #include "confdefs.h"
11505 #include <string.h>
11506 main ()
11507 {
11508   exit (strcoll ("abc", "def") >= 0 ||
11509         strcoll ("ABC", "DEF") >= 0 ||
11510         strcoll ("123", "456") >= 0);
11511 }
11512 EOF
11513 if { (eval echo configure:11514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11514 then
11515   ac_cv_func_strcoll_works=yes
11516 else
11517   conftest_rc="$?"
11518   echo "configure: failed program was:" >&5
11519   cat conftest.$ac_ext >&5
11520   rm -fr conftest*
11521   ac_cv_func_strcoll_works=no
11522 fi
11523 rm -fr conftest*
11524
11525 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
11526 if test $ac_cv_func_strcoll_works = yes; then
11527   { test "$extra_verbose" = "yes" && cat << \EOF
11528     Defining HAVE_STRCOLL
11529 EOF
11530 cat >> confdefs.h <<\EOF
11531 #define HAVE_STRCOLL 1
11532 EOF
11533 }
11534
11535 fi
11536
11537
11538 for ac_func in getpgrp
11539 do
11540 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11541 echo "configure:11542: checking for $ac_func" >&5
11542
11543 cat > conftest.$ac_ext <<EOF
11544 #line 11545 "configure"
11545 #include "confdefs.h"
11546 /* System header to define __stub macros and hopefully few prototypes,
11547     which can conflict with char $ac_func(); below.  */
11548 #include <assert.h>
11549 /* Override any gcc2 internal prototype to avoid an error.  */
11550 /* We use char because int might match the return type of a gcc2
11551     builtin and then its argument prototype would still apply.  */
11552 char $ac_func();
11553
11554 int main() {
11555
11556 /* The GNU C library defines this for functions which it implements
11557     to always fail with ENOSYS.  Some functions are actually named
11558     something starting with __ and the normal name is an alias.  */
11559 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11560 choke me
11561 #else
11562 $ac_func();
11563 #endif
11564
11565 ; return 0; }
11566 EOF
11567 if { (eval echo configure:11568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11568   rm -rf conftest*
11569   eval "ac_cv_func_$ac_func=yes"
11570 else
11571   echo "configure: failed program was:" >&5
11572   cat conftest.$ac_ext >&5
11573   rm -rf conftest*
11574   eval "ac_cv_func_$ac_func=no"
11575 fi
11576 rm -f conftest*
11577
11578 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11579   echo "$ac_t""yes" 1>&6
11580     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11581   { test "$extra_verbose" = "yes" && cat << EOF
11582     Defining $ac_tr_func
11583 EOF
11584 cat >> confdefs.h <<EOF
11585 #define $ac_tr_func 1
11586 EOF
11587 }
11588  
11589 else
11590   echo "$ac_t""no" 1>&6
11591 fi
11592 done
11593
11594 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
11595 echo "configure:11596: checking whether getpgrp takes no argument" >&5
11596
11597 cat > conftest.$ac_ext <<EOF
11598 #line 11599 "configure"
11599 #include "confdefs.h"
11600
11601 /*
11602  * If this system has a BSD-style getpgrp(),
11603  * which takes a pid argument, exit unsuccessfully.
11604  *
11605  * Snarfed from Chet Ramey's bash pgrp.c test program
11606  */
11607 #include <stdio.h>
11608 #include <sys/types.h>
11609
11610 int     pid;
11611 int     pg1, pg2, pg3, pg4;
11612 int     ng, np, s, child;
11613
11614 main()
11615 {
11616         pid = getpid();
11617         pg1 = getpgrp(0);
11618         pg2 = getpgrp();
11619         pg3 = getpgrp(pid);
11620         pg4 = getpgrp(1);
11621
11622         /*
11623          * If all of these values are the same, it's pretty sure that
11624          * we're on a system that ignores getpgrp's first argument.
11625          */
11626         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
11627                 exit(0);
11628
11629         child = fork();
11630         if (child < 0)
11631                 exit(1);
11632         else if (child == 0) {
11633                 np = getpid();
11634                 /*
11635                  * If this is Sys V, this will not work; pgrp will be
11636                  * set to np because setpgrp just changes a pgrp to be
11637                  * the same as the pid.
11638                  */
11639                 setpgrp(np, pg1);
11640                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
11641                 if (ng == pg1) {
11642                         exit(1);
11643                 } else {
11644                         exit(0);
11645                 }
11646         } else {
11647                 wait(&s);
11648                 exit(s>>8);
11649         }
11650 }
11651
11652 EOF
11653 if { (eval echo configure:11654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11654 then
11655   ac_cv_func_getpgrp_void=yes
11656 else
11657   conftest_rc="$?"
11658   echo "configure: failed program was:" >&5
11659   cat conftest.$ac_ext >&5
11660   rm -fr conftest*
11661   ac_cv_func_getpgrp_void=no
11662 fi
11663 rm -fr conftest*
11664
11665
11666 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
11667 if test $ac_cv_func_getpgrp_void = yes; then
11668   { test "$extra_verbose" = "yes" && cat << \EOF
11669     Defining GETPGRP_VOID
11670 EOF
11671 cat >> confdefs.h <<\EOF
11672 #define GETPGRP_VOID 1
11673 EOF
11674 }
11675
11676 fi
11677
11678
11679 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
11680 echo "configure:11681: checking for working mmap" >&5
11681 case "$opsys" in ultrix* ) have_mmap=no ;; *)
11682 cat > conftest.$ac_ext <<EOF
11683 #line 11684 "configure"
11684 #include "confdefs.h"
11685 #include <stdio.h>
11686 #include <unistd.h>
11687 #include <fcntl.h>
11688 #include <sys/mman.h>
11689
11690 #ifndef MAP_VARIABLE
11691 #define MAP_VARIABLE 0
11692 #endif
11693
11694 #ifndef MAP_FAILED
11695 #define MAP_FAILED -1
11696 #endif
11697
11698 int main (int argc, char *argv[])
11699 {
11700   int fd = -1;
11701   caddr_t p;
11702 #ifndef MAP_ANONYMOUS
11703   fd = open ("/dev/zero", O_RDWR);
11704   if (fd < 0)
11705     return 1;
11706 #define MAP_ANONYMOUS 0
11707 #endif
11708   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
11709            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
11710            fd, 0) != (void *) MAP_FAILED)
11711     return 0;
11712   perror ("conftest: mmap failed");
11713   return 1;
11714 }
11715 EOF
11716 if { (eval echo configure:11717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11717 then
11718   have_mmap=yes
11719 else
11720   conftest_rc="$?"
11721   echo "configure: failed program was:" >&5
11722   cat conftest.$ac_ext >&5
11723   rm -fr conftest*
11724   have_mmap=no
11725 fi
11726 rm -fr conftest* ;;
11727 esac
11728 echo "$ac_t""$have_mmap" 1>&6
11729 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
11730     Defining HAVE_MMAP
11731 EOF
11732 cat >> confdefs.h <<\EOF
11733 #define HAVE_MMAP 1
11734 EOF
11735 }
11736
11737
11738 test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no
11739 if test "$rel_alloc $have_mmap" = "default yes"; then
11740   if test "$doug_lea_malloc" = "yes"; then
11741         echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6
11742 echo "configure:11743: checking for M_MMAP_THRESHOLD" >&5
11743     cat > conftest.$ac_ext <<EOF
11744 #line 11745 "configure"
11745 #include "confdefs.h"
11746 #include <malloc.h>
11747 int main() {
11748
11749 #ifndef M_MMAP_THRESHOLD
11750 #error No M_MMAP_THRESHOLD :-(
11751 !@+$%^&*_)(_ - unlikely to compile...
11752 #endif
11753
11754 ; return 0; }
11755 EOF
11756 if { (eval echo configure:11757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11757   rm -rf conftest*
11758   rel_alloc=no; echo "$ac_t""yes" 1>&6;
11759 else
11760   echo "configure: failed program was:" >&5
11761   cat conftest.$ac_ext >&5
11762   rm -rf conftest*
11763   rel_alloc=yes; echo "$ac_t""no" 1>&6;
11764 fi
11765 rm -f conftest*
11766   else
11767     rel_alloc=yes
11768   fi
11769 fi
11770 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
11771     Defining REL_ALLOC
11772 EOF
11773 cat >> confdefs.h <<\EOF
11774 #define REL_ALLOC 1
11775 EOF
11776 }
11777
11778
11779 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
11780 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
11781 echo "configure:11782: checking for termios.h" >&5
11782
11783 cat > conftest.$ac_ext <<EOF
11784 #line 11785 "configure"
11785 #include "confdefs.h"
11786 #include <termios.h>
11787 EOF
11788 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11789 { (eval echo configure:11790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11790 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11791 if test -z "$ac_err"; then
11792   rm -rf conftest*
11793   eval "ac_cv_header_$ac_safe=yes"
11794 else
11795   echo "$ac_err" >&5
11796   echo "configure: failed program was:" >&5
11797   cat conftest.$ac_ext >&5
11798   rm -rf conftest*
11799   eval "ac_cv_header_$ac_safe=no"
11800 fi
11801 rm -f conftest*
11802 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11803   echo "$ac_t""yes" 1>&6
11804   { test "$extra_verbose" = "yes" && cat << \EOF
11805     Defining HAVE_TERMIOS
11806 EOF
11807 cat >> confdefs.h <<\EOF
11808 #define HAVE_TERMIOS 1
11809 EOF
11810 }
11811
11812   { test "$extra_verbose" = "yes" && cat << \EOF
11813     Defining SIGNALS_VIA_CHARACTERS
11814 EOF
11815 cat >> confdefs.h <<\EOF
11816 #define SIGNALS_VIA_CHARACTERS 1
11817 EOF
11818 }
11819
11820   { test "$extra_verbose" = "yes" && cat << \EOF
11821     Defining NO_TERMIO
11822 EOF
11823 cat >> confdefs.h <<\EOF
11824 #define NO_TERMIO 1
11825 EOF
11826 }
11827
11828 else
11829   echo "$ac_t""no" 1>&6
11830 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
11831 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
11832 echo "configure:11833: checking for termio.h" >&5
11833
11834 cat > conftest.$ac_ext <<EOF
11835 #line 11836 "configure"
11836 #include "confdefs.h"
11837 #include <termio.h>
11838 EOF
11839 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11840 { (eval echo configure:11841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11841 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11842 if test -z "$ac_err"; then
11843   rm -rf conftest*
11844   eval "ac_cv_header_$ac_safe=yes"
11845 else
11846   echo "$ac_err" >&5
11847   echo "configure: failed program was:" >&5
11848   cat conftest.$ac_ext >&5
11849   rm -rf conftest*
11850   eval "ac_cv_header_$ac_safe=no"
11851 fi
11852 rm -f conftest*
11853 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11854   echo "$ac_t""yes" 1>&6
11855   { test "$extra_verbose" = "yes" && cat << \EOF
11856     Defining HAVE_TERMIO
11857 EOF
11858 cat >> confdefs.h <<\EOF
11859 #define HAVE_TERMIO 1
11860 EOF
11861 }
11862
11863 else
11864   echo "$ac_t""no" 1>&6
11865 fi
11866
11867 fi
11868
11869
11870
11871 echo $ac_n "checking for socket""... $ac_c" 1>&6
11872 echo "configure:11873: checking for socket" >&5
11873
11874 cat > conftest.$ac_ext <<EOF
11875 #line 11876 "configure"
11876 #include "confdefs.h"
11877 /* System header to define __stub macros and hopefully few prototypes,
11878     which can conflict with char socket(); below.  */
11879 #include <assert.h>
11880 /* Override any gcc2 internal prototype to avoid an error.  */
11881 /* We use char because int might match the return type of a gcc2
11882     builtin and then its argument prototype would still apply.  */
11883 char socket();
11884
11885 int main() {
11886
11887 /* The GNU C library defines this for functions which it implements
11888     to always fail with ENOSYS.  Some functions are actually named
11889     something starting with __ and the normal name is an alias.  */
11890 #if defined (__stub_socket) || defined (__stub___socket)
11891 choke me
11892 #else
11893 socket();
11894 #endif
11895
11896 ; return 0; }
11897 EOF
11898 if { (eval echo configure:11899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11899   rm -rf conftest*
11900   eval "ac_cv_func_socket=yes"
11901 else
11902   echo "configure: failed program was:" >&5
11903   cat conftest.$ac_ext >&5
11904   rm -rf conftest*
11905   eval "ac_cv_func_socket=no"
11906 fi
11907 rm -f conftest*
11908
11909 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
11910   echo "$ac_t""yes" 1>&6
11911   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
11912 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
11913 echo "configure:11914: checking for netinet/in.h" >&5
11914
11915 cat > conftest.$ac_ext <<EOF
11916 #line 11917 "configure"
11917 #include "confdefs.h"
11918 #include <netinet/in.h>
11919 EOF
11920 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11921 { (eval echo configure:11922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11922 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11923 if test -z "$ac_err"; then
11924   rm -rf conftest*
11925   eval "ac_cv_header_$ac_safe=yes"
11926 else
11927   echo "$ac_err" >&5
11928   echo "configure: failed program was:" >&5
11929   cat conftest.$ac_ext >&5
11930   rm -rf conftest*
11931   eval "ac_cv_header_$ac_safe=no"
11932 fi
11933 rm -f conftest*
11934 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11935   echo "$ac_t""yes" 1>&6
11936   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
11937 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
11938 echo "configure:11939: checking for arpa/inet.h" >&5
11939
11940 cat > conftest.$ac_ext <<EOF
11941 #line 11942 "configure"
11942 #include "confdefs.h"
11943 #include <arpa/inet.h>
11944 EOF
11945 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11946 { (eval echo configure:11947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11947 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11948 if test -z "$ac_err"; then
11949   rm -rf conftest*
11950   eval "ac_cv_header_$ac_safe=yes"
11951 else
11952   echo "$ac_err" >&5
11953   echo "configure: failed program was:" >&5
11954   cat conftest.$ac_ext >&5
11955   rm -rf conftest*
11956   eval "ac_cv_header_$ac_safe=no"
11957 fi
11958 rm -f conftest*
11959 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11960   echo "$ac_t""yes" 1>&6
11961   
11962   { test "$extra_verbose" = "yes" && cat << \EOF
11963     Defining HAVE_SOCKETS
11964 EOF
11965 cat >> confdefs.h <<\EOF
11966 #define HAVE_SOCKETS 1
11967 EOF
11968 }
11969
11970       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
11971 echo "configure:11972: checking "for sun_len member in struct sockaddr_un"" >&5
11972       cat > conftest.$ac_ext <<EOF
11973 #line 11974 "configure"
11974 #include "confdefs.h"
11975
11976 #include <sys/types.h>
11977 #include <sys/socket.h>
11978 #include <sys/un.h>
11979       
11980 int main() {
11981 static struct sockaddr_un x; x.sun_len = 1;
11982 ; return 0; }
11983 EOF
11984 if { (eval echo configure:11985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11985   rm -rf conftest*
11986   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
11987     Defining HAVE_SOCKADDR_SUN_LEN
11988 EOF
11989 cat >> confdefs.h <<\EOF
11990 #define HAVE_SOCKADDR_SUN_LEN 1
11991 EOF
11992 }
11993
11994 else
11995   echo "configure: failed program was:" >&5
11996   cat conftest.$ac_ext >&5
11997   rm -rf conftest*
11998   echo "$ac_t""no" 1>&6
11999 fi
12000 rm -f conftest*
12001       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
12002 echo "configure:12003: checking "for ip_mreq struct in netinet/in.h"" >&5
12003       cat > conftest.$ac_ext <<EOF
12004 #line 12005 "configure"
12005 #include "confdefs.h"
12006
12007 #include <sys/types.h>
12008 #include <netinet/in.h>
12009       
12010 int main() {
12011 static struct ip_mreq x;
12012 ; return 0; }
12013 EOF
12014 if { (eval echo configure:12015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12015   rm -rf conftest*
12016   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
12017     Defining HAVE_MULTICAST
12018 EOF
12019 cat >> confdefs.h <<\EOF
12020 #define HAVE_MULTICAST 1
12021 EOF
12022 }
12023
12024 else
12025   echo "configure: failed program was:" >&5
12026   cat conftest.$ac_ext >&5
12027   rm -rf conftest*
12028   echo "$ac_t""no" 1>&6
12029 fi
12030 rm -f conftest*
12031 else
12032   echo "$ac_t""no" 1>&6
12033 fi
12034
12035 else
12036   echo "$ac_t""no" 1>&6
12037 fi
12038
12039 else
12040   echo "$ac_t""no" 1>&6
12041 fi
12042
12043
12044 echo $ac_n "checking for msgget""... $ac_c" 1>&6
12045 echo "configure:12046: checking for msgget" >&5
12046
12047 cat > conftest.$ac_ext <<EOF
12048 #line 12049 "configure"
12049 #include "confdefs.h"
12050 /* System header to define __stub macros and hopefully few prototypes,
12051     which can conflict with char msgget(); below.  */
12052 #include <assert.h>
12053 /* Override any gcc2 internal prototype to avoid an error.  */
12054 /* We use char because int might match the return type of a gcc2
12055     builtin and then its argument prototype would still apply.  */
12056 char msgget();
12057
12058 int main() {
12059
12060 /* The GNU C library defines this for functions which it implements
12061     to always fail with ENOSYS.  Some functions are actually named
12062     something starting with __ and the normal name is an alias.  */
12063 #if defined (__stub_msgget) || defined (__stub___msgget)
12064 choke me
12065 #else
12066 msgget();
12067 #endif
12068
12069 ; return 0; }
12070 EOF
12071 if { (eval echo configure:12072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12072   rm -rf conftest*
12073   eval "ac_cv_func_msgget=yes"
12074 else
12075   echo "configure: failed program was:" >&5
12076   cat conftest.$ac_ext >&5
12077   rm -rf conftest*
12078   eval "ac_cv_func_msgget=no"
12079 fi
12080 rm -f conftest*
12081
12082 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
12083   echo "$ac_t""yes" 1>&6
12084   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
12085 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
12086 echo "configure:12087: checking for sys/ipc.h" >&5
12087
12088 cat > conftest.$ac_ext <<EOF
12089 #line 12090 "configure"
12090 #include "confdefs.h"
12091 #include <sys/ipc.h>
12092 EOF
12093 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12094 { (eval echo configure:12095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12095 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12096 if test -z "$ac_err"; then
12097   rm -rf conftest*
12098   eval "ac_cv_header_$ac_safe=yes"
12099 else
12100   echo "$ac_err" >&5
12101   echo "configure: failed program was:" >&5
12102   cat conftest.$ac_ext >&5
12103   rm -rf conftest*
12104   eval "ac_cv_header_$ac_safe=no"
12105 fi
12106 rm -f conftest*
12107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12108   echo "$ac_t""yes" 1>&6
12109   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
12110 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
12111 echo "configure:12112: checking for sys/msg.h" >&5
12112
12113 cat > conftest.$ac_ext <<EOF
12114 #line 12115 "configure"
12115 #include "confdefs.h"
12116 #include <sys/msg.h>
12117 EOF
12118 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12119 { (eval echo configure:12120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12120 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12121 if test -z "$ac_err"; then
12122   rm -rf conftest*
12123   eval "ac_cv_header_$ac_safe=yes"
12124 else
12125   echo "$ac_err" >&5
12126   echo "configure: failed program was:" >&5
12127   cat conftest.$ac_ext >&5
12128   rm -rf conftest*
12129   eval "ac_cv_header_$ac_safe=no"
12130 fi
12131 rm -f conftest*
12132 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12133   echo "$ac_t""yes" 1>&6
12134   { test "$extra_verbose" = "yes" && cat << \EOF
12135     Defining HAVE_SYSVIPC
12136 EOF
12137 cat >> confdefs.h <<\EOF
12138 #define HAVE_SYSVIPC 1
12139 EOF
12140 }
12141
12142 else
12143   echo "$ac_t""no" 1>&6
12144 fi
12145
12146 else
12147   echo "$ac_t""no" 1>&6
12148 fi
12149
12150 else
12151   echo "$ac_t""no" 1>&6
12152 fi
12153
12154
12155 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
12156 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
12157 echo "configure:12158: checking for dirent.h" >&5
12158
12159 cat > conftest.$ac_ext <<EOF
12160 #line 12161 "configure"
12161 #include "confdefs.h"
12162 #include <dirent.h>
12163 EOF
12164 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12165 { (eval echo configure:12166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12166 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12167 if test -z "$ac_err"; then
12168   rm -rf conftest*
12169   eval "ac_cv_header_$ac_safe=yes"
12170 else
12171   echo "$ac_err" >&5
12172   echo "configure: failed program was:" >&5
12173   cat conftest.$ac_ext >&5
12174   rm -rf conftest*
12175   eval "ac_cv_header_$ac_safe=no"
12176 fi
12177 rm -f conftest*
12178 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12179   echo "$ac_t""yes" 1>&6
12180   { test "$extra_verbose" = "yes" && cat << \EOF
12181     Defining SYSV_SYSTEM_DIR
12182 EOF
12183 cat >> confdefs.h <<\EOF
12184 #define SYSV_SYSTEM_DIR 1
12185 EOF
12186 }
12187
12188 else
12189   echo "$ac_t""no" 1>&6
12190 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
12191 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
12192 echo "configure:12193: checking for sys/dir.h" >&5
12193
12194 cat > conftest.$ac_ext <<EOF
12195 #line 12196 "configure"
12196 #include "confdefs.h"
12197 #include <sys/dir.h>
12198 EOF
12199 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12200 { (eval echo configure:12201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12201 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12202 if test -z "$ac_err"; then
12203   rm -rf conftest*
12204   eval "ac_cv_header_$ac_safe=yes"
12205 else
12206   echo "$ac_err" >&5
12207   echo "configure: failed program was:" >&5
12208   cat conftest.$ac_ext >&5
12209   rm -rf conftest*
12210   eval "ac_cv_header_$ac_safe=no"
12211 fi
12212 rm -f conftest*
12213 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12214   echo "$ac_t""yes" 1>&6
12215   :
12216 else
12217   echo "$ac_t""no" 1>&6
12218 { test "$extra_verbose" = "yes" && cat << \EOF
12219     Defining NONSYSTEM_DIR_LIBRARY
12220 EOF
12221 cat >> confdefs.h <<\EOF
12222 #define NONSYSTEM_DIR_LIBRARY 1
12223 EOF
12224 }
12225
12226 fi
12227
12228 fi
12229
12230
12231 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
12232 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
12233 echo "configure:12234: checking for nlist.h" >&5
12234
12235 cat > conftest.$ac_ext <<EOF
12236 #line 12237 "configure"
12237 #include "confdefs.h"
12238 #include <nlist.h>
12239 EOF
12240 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12241 { (eval echo configure:12242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12242 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12243 if test -z "$ac_err"; then
12244   rm -rf conftest*
12245   eval "ac_cv_header_$ac_safe=yes"
12246 else
12247   echo "$ac_err" >&5
12248   echo "configure: failed program was:" >&5
12249   cat conftest.$ac_ext >&5
12250   rm -rf conftest*
12251   eval "ac_cv_header_$ac_safe=no"
12252 fi
12253 rm -f conftest*
12254 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12255   echo "$ac_t""yes" 1>&6
12256   { test "$extra_verbose" = "yes" && cat << \EOF
12257     Defining NLIST_STRUCT
12258 EOF
12259 cat >> confdefs.h <<\EOF
12260 #define NLIST_STRUCT 1
12261 EOF
12262 }
12263
12264 else
12265   echo "$ac_t""no" 1>&6
12266 fi
12267
12268
12269
12270 echo "checking "for sound support"" 1>&6
12271 echo "configure:12272: checking "for sound support"" >&5
12272 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
12273
12274 if test "$with_native_sound" != "no"; then
12275     if test -n "$native_sound_lib"; then
12276     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
12277 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
12278 echo "configure:12279: checking for multimedia/audio_device.h" >&5
12279
12280 cat > conftest.$ac_ext <<EOF
12281 #line 12282 "configure"
12282 #include "confdefs.h"
12283 #include <multimedia/audio_device.h>
12284 EOF
12285 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12286 { (eval echo configure:12287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12287 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12288 if test -z "$ac_err"; then
12289   rm -rf conftest*
12290   eval "ac_cv_header_$ac_safe=yes"
12291 else
12292   echo "$ac_err" >&5
12293   echo "configure: failed program was:" >&5
12294   cat conftest.$ac_ext >&5
12295   rm -rf conftest*
12296   eval "ac_cv_header_$ac_safe=no"
12297 fi
12298 rm -f conftest*
12299 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12300   echo "$ac_t""yes" 1>&6
12301   sound_found=yes sound_cflags=""
12302       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
12303    echo "    xemacs will be linked with \"sunplay.o\""
12304  fi
12305 else
12306   echo "$ac_t""no" 1>&6
12307 fi
12308
12309   fi
12310
12311     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
12312     sound_found=yes
12313     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
12314    echo "    xemacs will be linked with \"sunplay.o\""
12315  fi
12316     if test -d "/usr/demo/SOUND/include"
12317       then sound_cflags="-I/usr/demo/SOUND/include"
12318       else sound_cflags="-I/usr/demo/SOUND"
12319     fi
12320     if test -z "$native_sound_lib" ; then
12321       if test -r "/usr/demo/SOUND/lib/libaudio.a"
12322         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
12323         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
12324       fi
12325     fi
12326   fi
12327
12328     if test -z "$sound_found"; then
12329     case "$canonical" in
12330     *-sgi-* )
12331       if test -z "$native_sound_lib"; then
12332         
12333 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
12334 echo "configure:12335: checking for ALopenport in -laudio" >&5
12335 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
12336
12337 xe_check_libs=" -laudio "
12338 cat > conftest.$ac_ext <<EOF
12339 #line 12340 "configure"
12340 #include "confdefs.h"
12341 /* Override any gcc2 internal prototype to avoid an error.  */
12342 /* We use char because int might match the return type of a gcc2
12343     builtin and then its argument prototype would still apply.  */
12344 char ALopenport();
12345
12346 int main() {
12347 ALopenport()
12348 ; return 0; }
12349 EOF
12350 if { (eval echo configure:12351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12351   rm -rf conftest*
12352   eval "ac_cv_lib_$ac_lib_var=yes"
12353 else
12354   echo "configure: failed program was:" >&5
12355   cat conftest.$ac_ext >&5
12356   rm -rf conftest*
12357   eval "ac_cv_lib_$ac_lib_var=no"
12358 fi
12359 rm -f conftest*
12360 xe_check_libs=""
12361
12362 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12363   echo "$ac_t""yes" 1>&6
12364   native_sound_lib="-laudio"
12365 else
12366   echo "$ac_t""no" 1>&6
12367 fi
12368
12369
12370       fi
12371       if test -n "$native_sound_lib"; then
12372         sound_found=yes sound_cflags=""
12373         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
12374    echo "    xemacs will be linked with \"sgiplay.o\""
12375  fi
12376       fi ;;
12377     hppa*-hp-hpux* )
12378       if test -z "$native_sound_lib"; then
12379         
12380 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
12381 echo "configure:12382: checking for AOpenAudio in -lAlib" >&5
12382 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
12383
12384 xe_check_libs=" -lAlib "
12385 cat > conftest.$ac_ext <<EOF
12386 #line 12387 "configure"
12387 #include "confdefs.h"
12388 /* Override any gcc2 internal prototype to avoid an error.  */
12389 /* We use char because int might match the return type of a gcc2
12390     builtin and then its argument prototype would still apply.  */
12391 char AOpenAudio();
12392
12393 int main() {
12394 AOpenAudio()
12395 ; return 0; }
12396 EOF
12397 if { (eval echo configure:12398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12398   rm -rf conftest*
12399   eval "ac_cv_lib_$ac_lib_var=yes"
12400 else
12401   echo "configure: failed program was:" >&5
12402   cat conftest.$ac_ext >&5
12403   rm -rf conftest*
12404   eval "ac_cv_lib_$ac_lib_var=no"
12405 fi
12406 rm -f conftest*
12407 xe_check_libs=""
12408
12409 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12410   echo "$ac_t""yes" 1>&6
12411   native_sound_lib="-lAlib"
12412 else
12413   echo "$ac_t""no" 1>&6
12414 fi
12415
12416
12417       fi
12418       if test -n "$native_sound_lib"; then
12419         sound_found=yes
12420         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
12421    echo "    xemacs will be linked with \"hpplay.o\""
12422  fi
12423         if test "$GCC" = "yes" # Kludge city
12424           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
12425           else sound_cflags="+e -I/usr/audio/examples"
12426         fi
12427       fi ;;
12428     esac
12429   fi
12430
12431     if test -z "$sound_found"; then
12432     for dir in "machine" "sys" "linux"; do
12433       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
12434 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
12435 echo "configure:12436: checking for ${dir}/soundcard.h" >&5
12436
12437 cat > conftest.$ac_ext <<EOF
12438 #line 12439 "configure"
12439 #include "confdefs.h"
12440 #include <${dir}/soundcard.h>
12441 EOF
12442 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12443 { (eval echo configure:12444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12444 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12445 if test -z "$ac_err"; then
12446   rm -rf conftest*
12447   eval "ac_cv_header_$ac_safe=yes"
12448 else
12449   echo "$ac_err" >&5
12450   echo "configure: failed program was:" >&5
12451   cat conftest.$ac_ext >&5
12452   rm -rf conftest*
12453   eval "ac_cv_header_$ac_safe=no"
12454 fi
12455 rm -f conftest*
12456 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12457   echo "$ac_t""yes" 1>&6
12458   sound_found=yes
12459        need_miscplay=yes
12460         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
12461    echo "    xemacs will be linked with \"linuxplay.o\""
12462  fi
12463         { test "$extra_verbose" = "yes" && cat << EOF
12464     Defining SOUNDCARD_H_FILE = "${dir}/soundcard.h"
12465 EOF
12466 cat >> confdefs.h <<EOF
12467 #define SOUNDCARD_H_FILE "${dir}/soundcard.h"
12468 EOF
12469 }
12470
12471         break
12472 else
12473   echo "$ac_t""no" 1>&6
12474 fi
12475
12476     done
12477   fi
12478
12479     if test -z "$sound_found"; then
12480     if test "$with_msw" = "yes"; then
12481     sound_found=yes
12482     native_sound_lib=
12483     fi
12484   fi
12485
12486   test "$sound_found" = "yes" && with_native_sound=yes
12487 fi
12488
12489 if test "$with_native_sound" = "yes"; then
12490   { test "$extra_verbose" = "yes" && cat << \EOF
12491     Defining HAVE_NATIVE_SOUND
12492 EOF
12493 cat >> confdefs.h <<\EOF
12494 #define HAVE_NATIVE_SOUND 1
12495 EOF
12496 }
12497
12498   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
12499 fi
12500
12501 if test "$with_nas_sound" != "no"; then
12502   ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'`
12503 echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6
12504 echo "configure:12505: checking for audio/audiolib.h" >&5
12505
12506 cat > conftest.$ac_ext <<EOF
12507 #line 12508 "configure"
12508 #include "confdefs.h"
12509 #include <audio/audiolib.h>
12510 EOF
12511 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12512 { (eval echo configure:12513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12513 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12514 if test -z "$ac_err"; then
12515   rm -rf conftest*
12516   eval "ac_cv_header_$ac_safe=yes"
12517 else
12518   echo "$ac_err" >&5
12519   echo "configure: failed program was:" >&5
12520   cat conftest.$ac_ext >&5
12521   rm -rf conftest*
12522   eval "ac_cv_header_$ac_safe=no"
12523 fi
12524 rm -f conftest*
12525 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12526   echo "$ac_t""yes" 1>&6
12527   
12528     
12529 echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6
12530 echo "configure:12531: checking for AuOpenServer in -laudio" >&5
12531 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'`
12532
12533 xe_check_libs=" -laudio "
12534 cat > conftest.$ac_ext <<EOF
12535 #line 12536 "configure"
12536 #include "confdefs.h"
12537 /* Override any gcc2 internal prototype to avoid an error.  */
12538 /* We use char because int might match the return type of a gcc2
12539     builtin and then its argument prototype would still apply.  */
12540 char AuOpenServer();
12541
12542 int main() {
12543 AuOpenServer()
12544 ; return 0; }
12545 EOF
12546 if { (eval echo configure:12547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12547   rm -rf conftest*
12548   eval "ac_cv_lib_$ac_lib_var=yes"
12549 else
12550   echo "configure: failed program was:" >&5
12551   cat conftest.$ac_ext >&5
12552   rm -rf conftest*
12553   eval "ac_cv_lib_$ac_lib_var=no"
12554 fi
12555 rm -f conftest*
12556 xe_check_libs=""
12557
12558 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12559   echo "$ac_t""yes" 1>&6
12560   have_nas_sound=yes
12561 else
12562   echo "$ac_t""no" 1>&6
12563 fi
12564
12565
12566 else
12567   echo "$ac_t""no" 1>&6
12568 fi
12569
12570   if test "$have_nas_sound" = "yes"; then
12571     with_nas_sound=yes
12572     { test "$extra_verbose" = "yes" && cat << \EOF
12573     Defining HAVE_NAS_SOUND
12574 EOF
12575 cat >> confdefs.h <<\EOF
12576 #define HAVE_NAS_SOUND 1
12577 EOF
12578 }
12579
12580     extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
12581    echo "    xemacs will be linked with \"nas.o\""
12582  fi
12583     libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
12584             cat > conftest.$ac_ext <<EOF
12585 #line 12586 "configure"
12586 #include "confdefs.h"
12587 #include <audio/Xtutil.h>
12588 EOF
12589 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12590   egrep "AuXtErrorJump" >/dev/null 2>&1; then
12591   :
12592 else
12593   rm -rf conftest*
12594   old_nas=yes; { test "$extra_verbose" = "yes" && cat << \EOF
12595     Defining NAS_NO_ERROR_JUMP
12596 EOF
12597 cat >> confdefs.h <<\EOF
12598 #define NAS_NO_ERROR_JUMP 1
12599 EOF
12600 }
12601
12602 fi
12603 rm -f conftest*
12604
12605   else
12606     test "$with_nas_sound" = "yes" && \
12607       { echo "Error:" "Required NAS sound support cannot be provided." >&2; exit 1; }
12608     with_nas_sound=no
12609   fi
12610 fi
12611
12612 if test "$with_esd_sound" != "no"; then
12613   # Extract the first word of "esd-config", so it can be a program name with args.
12614 set dummy esd-config; ac_word=$2
12615 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
12616 echo "configure:12617: checking for $ac_word" >&5
12617
12618 if test -n "$have_esd_config"; then
12619   ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test.
12620 else
12621   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
12622   ac_dummy="$PATH"
12623   for ac_dir in $ac_dummy; do
12624     test -z "$ac_dir" && ac_dir=.
12625     if test -f $ac_dir/$ac_word; then
12626       ac_cv_prog_have_esd_config="yes"
12627       break
12628     fi
12629   done
12630   IFS="$ac_save_ifs"
12631   test -z "$ac_cv_prog_have_esd_config" && ac_cv_prog_have_esd_config="no"
12632 fi
12633 have_esd_config="$ac_cv_prog_have_esd_config"
12634 if test -n "$have_esd_config"; then
12635   echo "$ac_t""$have_esd_config" 1>&6
12636 else
12637   echo "$ac_t""no" 1>&6
12638 fi
12639
12640   if test "$have_esd_config" = "yes"; then
12641     save_c_switch_site="$c_switch_site" save_LIBS="$LIBS"
12642     c_switch_site="$c_switch_site `esd-config --cflags`" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"`esd-config --cflags`\" to \$c_switch_site"; fi
12643     LIBS="`esd-config --libs` $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"`esd-config --libs`\" to \$LIBS"; fi
12644     echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6
12645 echo "configure:12646: checking for esd_play_stream" >&5
12646
12647 cat > conftest.$ac_ext <<EOF
12648 #line 12649 "configure"
12649 #include "confdefs.h"
12650 /* System header to define __stub macros and hopefully few prototypes,
12651     which can conflict with char esd_play_stream(); below.  */
12652 #include <assert.h>
12653 /* Override any gcc2 internal prototype to avoid an error.  */
12654 /* We use char because int might match the return type of a gcc2
12655     builtin and then its argument prototype would still apply.  */
12656 char esd_play_stream();
12657
12658 int main() {
12659
12660 /* The GNU C library defines this for functions which it implements
12661     to always fail with ENOSYS.  Some functions are actually named
12662     something starting with __ and the normal name is an alias.  */
12663 #if defined (__stub_esd_play_stream) || defined (__stub___esd_play_stream)
12664 choke me
12665 #else
12666 esd_play_stream();
12667 #endif
12668
12669 ; return 0; }
12670 EOF
12671 if { (eval echo configure:12672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12672   rm -rf conftest*
12673   eval "ac_cv_func_esd_play_stream=yes"
12674 else
12675   echo "configure: failed program was:" >&5
12676   cat conftest.$ac_ext >&5
12677   rm -rf conftest*
12678   eval "ac_cv_func_esd_play_stream=no"
12679 fi
12680 rm -f conftest*
12681
12682 if eval "test \"`echo '$ac_cv_func_'esd_play_stream`\" = yes"; then
12683   echo "$ac_t""yes" 1>&6
12684   have_esd_sound=yes
12685 else
12686   echo "$ac_t""no" 1>&6
12687 c_switch_site="$save_c_switch_site" LIBS="$save_LIBS"
12688 fi
12689
12690   fi
12691
12692   if test "$have_esd_sound" = "yes"; then
12693     with_esd_sound=yes
12694     need_miscplay=yes
12695     extra_objs="$extra_objs esd.o" &&  if test "$extra_verbose" = "yes"; then
12696    echo "    xemacs will be linked with \"esd.o\""
12697  fi
12698     { test "$extra_verbose" = "yes" && cat << \EOF
12699     Defining HAVE_ESD_SOUND
12700 EOF
12701 cat >> confdefs.h <<\EOF
12702 #define HAVE_ESD_SOUND 1
12703 EOF
12704 }
12705
12706   else
12707     test "$with_esd_sound" = "yes" && \
12708       { echo "Error:" "Required ESD sound support cannot be provided." >&2; exit 1; }
12709     with_esd_sound=no
12710   fi
12711 fi
12712
12713 test "$need_miscplay" = "yes" && extra_objs="$extra_objs miscplay.o" &&  if test "$extra_verbose" = "yes"; then
12714    echo "    xemacs will be linked with \"miscplay.o\""
12715  fi
12716
12717
12718 test -z "$with_tty" && with_tty=yes
12719
12720 if test "$with_tty" = "yes"  ; then
12721   echo "checking for TTY-related features" 1>&6
12722 echo "configure:12723: checking for TTY-related features" >&5
12723   { test "$extra_verbose" = "yes" && cat << \EOF
12724     Defining HAVE_TTY
12725 EOF
12726 cat >> confdefs.h <<\EOF
12727 #define HAVE_TTY 1
12728 EOF
12729 }
12730
12731   extra_objs="$extra_objs console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o" &&  if test "$extra_verbose" = "yes"; then
12732    echo "    xemacs will be linked with \"console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o\""
12733  fi
12734
12735     if test -z "$with_ncurses"; then
12736     
12737 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
12738 echo "configure:12739: checking for tgetent in -lncurses" >&5
12739 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
12740
12741 xe_check_libs=" -lncurses "
12742 cat > conftest.$ac_ext <<EOF
12743 #line 12744 "configure"
12744 #include "confdefs.h"
12745 /* Override any gcc2 internal prototype to avoid an error.  */
12746 /* We use char because int might match the return type of a gcc2
12747     builtin and then its argument prototype would still apply.  */
12748 char tgetent();
12749
12750 int main() {
12751 tgetent()
12752 ; return 0; }
12753 EOF
12754 if { (eval echo configure:12755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12755   rm -rf conftest*
12756   eval "ac_cv_lib_$ac_lib_var=yes"
12757 else
12758   echo "configure: failed program was:" >&5
12759   cat conftest.$ac_ext >&5
12760   rm -rf conftest*
12761   eval "ac_cv_lib_$ac_lib_var=no"
12762 fi
12763 rm -f conftest*
12764 xe_check_libs=""
12765
12766 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12767   echo "$ac_t""yes" 1>&6
12768   with_ncurses=yes
12769 else
12770   echo "$ac_t""no" 1>&6
12771 with_ncurses=no
12772 fi
12773
12774
12775   fi
12776   if test "$with_ncurses" = "yes"; then
12777     { test "$extra_verbose" = "yes" && cat << \EOF
12778     Defining HAVE_NCURSES
12779 EOF
12780 cat >> confdefs.h <<\EOF
12781 #define HAVE_NCURSES 1
12782 EOF
12783 }
12784
12785     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
12786 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
12787 echo "configure:12788: checking for ncurses/curses.h" >&5
12788
12789 cat > conftest.$ac_ext <<EOF
12790 #line 12791 "configure"
12791 #include "confdefs.h"
12792 #include <ncurses/curses.h>
12793 EOF
12794 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12795 { (eval echo configure:12796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12796 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12797 if test -z "$ac_err"; then
12798   rm -rf conftest*
12799   eval "ac_cv_header_$ac_safe=yes"
12800 else
12801   echo "$ac_err" >&5
12802   echo "configure: failed program was:" >&5
12803   cat conftest.$ac_ext >&5
12804   rm -rf conftest*
12805   eval "ac_cv_header_$ac_safe=no"
12806 fi
12807 rm -f conftest*
12808 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12809   echo "$ac_t""yes" 1>&6
12810   curses_h_file=ncurses/curses.h
12811 else
12812   echo "$ac_t""no" 1>&6
12813 fi
12814
12815     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
12816 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
12817 echo "configure:12818: checking for ncurses/term.h" >&5
12818
12819 cat > conftest.$ac_ext <<EOF
12820 #line 12821 "configure"
12821 #include "confdefs.h"
12822 #include <ncurses/term.h>
12823 EOF
12824 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12825 { (eval echo configure:12826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12826 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12827 if test -z "$ac_err"; then
12828   rm -rf conftest*
12829   eval "ac_cv_header_$ac_safe=yes"
12830 else
12831   echo "$ac_err" >&5
12832   echo "configure: failed program was:" >&5
12833   cat conftest.$ac_ext >&5
12834   rm -rf conftest*
12835   eval "ac_cv_header_$ac_safe=no"
12836 fi
12837 rm -f conftest*
12838 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12839   echo "$ac_t""yes" 1>&6
12840   term_h_file=ncurses/term.h
12841 else
12842   echo "$ac_t""no" 1>&6
12843 fi
12844
12845     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
12846    echo "    xemacs will be linked with \"terminfo.o\""
12847  fi
12848     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
12849
12850     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
12851                         save_c_switch_site="$c_switch_site"
12852       c_switch_site="$c_switch_site -I/usr/include/ncurses"
12853       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
12854 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
12855 echo "configure:12856: checking for ncurses/curses.h" >&5
12856
12857 cat > conftest.$ac_ext <<EOF
12858 #line 12859 "configure"
12859 #include "confdefs.h"
12860 #include <ncurses/curses.h>
12861 EOF
12862 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12863 { (eval echo configure:12864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12864 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12865 if test -z "$ac_err"; then
12866   rm -rf conftest*
12867   eval "ac_cv_header_$ac_safe=yes"
12868 else
12869   echo "$ac_err" >&5
12870   echo "configure: failed program was:" >&5
12871   cat conftest.$ac_ext >&5
12872   rm -rf conftest*
12873   eval "ac_cv_header_$ac_safe=no"
12874 fi
12875 rm -f conftest*
12876 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12877   echo "$ac_t""yes" 1>&6
12878   curses_h_file=ncurses/curses.h
12879 else
12880   echo "$ac_t""no" 1>&6
12881 fi
12882
12883       if test "$ac_cv_header_ncurses_curses_h" = "yes"
12884         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
12885         else c_switch_site="$save_c_switch_site"
12886       fi
12887     fi
12888   else         if test "$have_terminfo" = "yes"; then
12889       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
12890    echo "    xemacs will be linked with \"terminfo.o\""
12891  fi
12892       if test -n "$libs_termcap"; then
12893         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
12894       else
12895         for lib in curses termlib termcap; do
12896           
12897 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
12898 echo "configure:12899: checking for tgetent in -l$lib" >&5
12899 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
12900
12901 xe_check_libs=" -l$lib "
12902 cat > conftest.$ac_ext <<EOF
12903 #line 12904 "configure"
12904 #include "confdefs.h"
12905 /* Override any gcc2 internal prototype to avoid an error.  */
12906 /* We use char because int might match the return type of a gcc2
12907     builtin and then its argument prototype would still apply.  */
12908 char tgetent();
12909
12910 int main() {
12911 tgetent()
12912 ; return 0; }
12913 EOF
12914 if { (eval echo configure:12915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12915   rm -rf conftest*
12916   eval "ac_cv_lib_$ac_lib_var=yes"
12917 else
12918   echo "configure: failed program was:" >&5
12919   cat conftest.$ac_ext >&5
12920   rm -rf conftest*
12921   eval "ac_cv_lib_$ac_lib_var=no"
12922 fi
12923 rm -f conftest*
12924 xe_check_libs=""
12925
12926 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12927   echo "$ac_t""yes" 1>&6
12928   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
12929 else
12930   echo "$ac_t""no" 1>&6
12931 fi
12932
12933
12934         done
12935       fi
12936     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
12937    echo "    xemacs will be linked with \"tparam.o\""
12938  fi
12939                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
12940       if test -n "$libs_termcap"; then
12941         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
12942       else
12943         
12944 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
12945 echo "configure:12946: checking for tgetent in -lcurses" >&5
12946 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
12947
12948 xe_check_libs=" -lcurses "
12949 cat > conftest.$ac_ext <<EOF
12950 #line 12951 "configure"
12951 #include "confdefs.h"
12952 /* Override any gcc2 internal prototype to avoid an error.  */
12953 /* We use char because int might match the return type of a gcc2
12954     builtin and then its argument prototype would still apply.  */
12955 char tgetent();
12956
12957 int main() {
12958 tgetent()
12959 ; return 0; }
12960 EOF
12961 if { (eval echo configure:12962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12962   rm -rf conftest*
12963   eval "ac_cv_lib_$ac_lib_var=yes"
12964 else
12965   echo "configure: failed program was:" >&5
12966   cat conftest.$ac_ext >&5
12967   rm -rf conftest*
12968   eval "ac_cv_lib_$ac_lib_var=no"
12969 fi
12970 rm -f conftest*
12971 xe_check_libs=""
12972
12973 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12974   echo "$ac_t""yes" 1>&6
12975   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
12976 else
12977   echo "$ac_t""no" 1>&6
12978 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
12979 echo "configure:12980: checking for tgetent in -ltermcap" >&5
12980 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
12981
12982 xe_check_libs=" -ltermcap "
12983 cat > conftest.$ac_ext <<EOF
12984 #line 12985 "configure"
12985 #include "confdefs.h"
12986 /* Override any gcc2 internal prototype to avoid an error.  */
12987 /* We use char because int might match the return type of a gcc2
12988     builtin and then its argument prototype would still apply.  */
12989 char tgetent();
12990
12991 int main() {
12992 tgetent()
12993 ; return 0; }
12994 EOF
12995 if { (eval echo configure:12996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12996   rm -rf conftest*
12997   eval "ac_cv_lib_$ac_lib_var=yes"
12998 else
12999   echo "configure: failed program was:" >&5
13000   cat conftest.$ac_ext >&5
13001   rm -rf conftest*
13002   eval "ac_cv_lib_$ac_lib_var=no"
13003 fi
13004 rm -f conftest*
13005 xe_check_libs=""
13006
13007 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13008   echo "$ac_t""yes" 1>&6
13009   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
13010 else
13011   echo "$ac_t""no" 1>&6
13012 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
13013    echo "    xemacs will be linked with \"termcap.o\""
13014  fi
13015 fi
13016
13017
13018 fi
13019
13020
13021       fi
13022     fi
13023   fi
13024   { test "$extra_verbose" = "yes" && cat << EOF
13025     Defining CURSES_H_FILE = "${curses_h_file-curses.h}"
13026 EOF
13027 cat >> confdefs.h <<EOF
13028 #define CURSES_H_FILE "${curses_h_file-curses.h}"
13029 EOF
13030 }
13031
13032   { test "$extra_verbose" = "yes" && cat << EOF
13033     Defining TERM_H_FILE = "${term_h_file-term.h}"
13034 EOF
13035 cat >> confdefs.h <<EOF
13036 #define TERM_H_FILE "${term_h_file-term.h}"
13037 EOF
13038 }
13039
13040
13041     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
13042 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
13043 echo "configure:13044: checking for gpm.h" >&5
13044
13045 cat > conftest.$ac_ext <<EOF
13046 #line 13047 "configure"
13047 #include "confdefs.h"
13048 #include <gpm.h>
13049 EOF
13050 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13051 { (eval echo configure:13052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13052 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13053 if test -z "$ac_err"; then
13054   rm -rf conftest*
13055   eval "ac_cv_header_$ac_safe=yes"
13056 else
13057   echo "$ac_err" >&5
13058   echo "configure: failed program was:" >&5
13059   cat conftest.$ac_ext >&5
13060   rm -rf conftest*
13061   eval "ac_cv_header_$ac_safe=no"
13062 fi
13063 rm -f conftest*
13064 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13065   echo "$ac_t""yes" 1>&6
13066   :
13067 else
13068   echo "$ac_t""no" 1>&6
13069 with_gpm=no
13070 fi
13071  }
13072   test -z "$with_gpm" && { 
13073 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
13074 echo "configure:13075: checking for Gpm_Open in -lgpm" >&5
13075 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
13076
13077 xe_check_libs=" -lgpm "
13078 cat > conftest.$ac_ext <<EOF
13079 #line 13080 "configure"
13080 #include "confdefs.h"
13081 /* Override any gcc2 internal prototype to avoid an error.  */
13082 /* We use char because int might match the return type of a gcc2
13083     builtin and then its argument prototype would still apply.  */
13084 char Gpm_Open();
13085
13086 int main() {
13087 Gpm_Open()
13088 ; return 0; }
13089 EOF
13090 if { (eval echo configure:13091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13091   rm -rf conftest*
13092   eval "ac_cv_lib_$ac_lib_var=yes"
13093 else
13094   echo "configure: failed program was:" >&5
13095   cat conftest.$ac_ext >&5
13096   rm -rf conftest*
13097   eval "ac_cv_lib_$ac_lib_var=no"
13098 fi
13099 rm -f conftest*
13100 xe_check_libs=""
13101
13102 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13103   echo "$ac_t""yes" 1>&6
13104   with_gpm=yes
13105 else
13106   echo "$ac_t""no" 1>&6
13107 with_gpm=no
13108 fi
13109
13110  }
13111   if test "$with_gpm" = "yes"; then
13112     { test "$extra_verbose" = "yes" && cat << \EOF
13113     Defining HAVE_GPM
13114 EOF
13115 cat >> confdefs.h <<\EOF
13116 #define HAVE_GPM 1
13117 EOF
13118 }
13119
13120     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
13121    echo "    xemacs will be linked with \"gpmevent.o\""
13122  fi
13123     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
13124   fi
13125
13126 else   for feature in ncurses gpm; do
13127     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
13128       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
13129     fi
13130     eval "with_${feature}=no"
13131   done
13132 fi 
13133 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
13134    echo "    xemacs will be linked with \"event-unixoid.o\""
13135  fi
13136
13137
13138 test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
13139   != "no no no" && echo "checking for database support" 1>&6
13140 echo "configure:13141: checking for database support" >&5
13141
13142 if test "$with_database_gdbm $with_database_dbm" != "no no"; then
13143   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
13144 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
13145 echo "configure:13146: checking for ndbm.h" >&5
13146
13147 cat > conftest.$ac_ext <<EOF
13148 #line 13149 "configure"
13149 #include "confdefs.h"
13150 #include <ndbm.h>
13151 EOF
13152 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13153 { (eval echo configure:13154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13154 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13155 if test -z "$ac_err"; then
13156   rm -rf conftest*
13157   eval "ac_cv_header_$ac_safe=yes"
13158 else
13159   echo "$ac_err" >&5
13160   echo "configure: failed program was:" >&5
13161   cat conftest.$ac_ext >&5
13162   rm -rf conftest*
13163   eval "ac_cv_header_$ac_safe=no"
13164 fi
13165 rm -f conftest*
13166 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13167   echo "$ac_t""yes" 1>&6
13168   :
13169 else
13170   echo "$ac_t""no" 1>&6
13171
13172     test "$with_database_gdbm" = "yes" -o \
13173          "$with_database_dbm"  = "yes" && \
13174       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
13175     with_database_gdbm=no with_database_dbm=no
13176 fi
13177
13178 fi
13179
13180 if test "$with_database_gdbm" != "no"; then
13181   
13182 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
13183 echo "configure:13184: checking for dbm_open in -lgdbm" >&5
13184 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
13185
13186 xe_check_libs=" -lgdbm "
13187 cat > conftest.$ac_ext <<EOF
13188 #line 13189 "configure"
13189 #include "confdefs.h"
13190 /* Override any gcc2 internal prototype to avoid an error.  */
13191 /* We use char because int might match the return type of a gcc2
13192     builtin and then its argument prototype would still apply.  */
13193 char dbm_open();
13194
13195 int main() {
13196 dbm_open()
13197 ; return 0; }
13198 EOF
13199 if { (eval echo configure:13200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13200   rm -rf conftest*
13201   eval "ac_cv_lib_$ac_lib_var=yes"
13202 else
13203   echo "configure: failed program was:" >&5
13204   cat conftest.$ac_ext >&5
13205   rm -rf conftest*
13206   eval "ac_cv_lib_$ac_lib_var=no"
13207 fi
13208 rm -f conftest*
13209 xe_check_libs=""
13210
13211 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13212   echo "$ac_t""yes" 1>&6
13213   with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm
13214 else
13215   echo "$ac_t""no" 1>&6
13216 if test "$with_database_gdbm" = "yes"; then
13217      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
13218    fi
13219    with_database_gdbm=no
13220 fi
13221
13222
13223 fi
13224
13225 if test "$with_database_dbm" != "no"; then
13226   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
13227 echo "configure:13228: checking for dbm_open" >&5
13228
13229 cat > conftest.$ac_ext <<EOF
13230 #line 13231 "configure"
13231 #include "confdefs.h"
13232 /* System header to define __stub macros and hopefully few prototypes,
13233     which can conflict with char dbm_open(); below.  */
13234 #include <assert.h>
13235 /* Override any gcc2 internal prototype to avoid an error.  */
13236 /* We use char because int might match the return type of a gcc2
13237     builtin and then its argument prototype would still apply.  */
13238 char dbm_open();
13239
13240 int main() {
13241
13242 /* The GNU C library defines this for functions which it implements
13243     to always fail with ENOSYS.  Some functions are actually named
13244     something starting with __ and the normal name is an alias.  */
13245 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
13246 choke me
13247 #else
13248 dbm_open();
13249 #endif
13250
13251 ; return 0; }
13252 EOF
13253 if { (eval echo configure:13254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13254   rm -rf conftest*
13255   eval "ac_cv_func_dbm_open=yes"
13256 else
13257   echo "configure: failed program was:" >&5
13258   cat conftest.$ac_ext >&5
13259   rm -rf conftest*
13260   eval "ac_cv_func_dbm_open=no"
13261 fi
13262 rm -f conftest*
13263
13264 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
13265   echo "$ac_t""yes" 1>&6
13266   with_database_dbm=yes libdbm=
13267 else
13268   echo "$ac_t""no" 1>&6
13269
13270     
13271 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
13272 echo "configure:13273: checking for dbm_open in -ldbm" >&5
13273 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
13274
13275 xe_check_libs=" -ldbm "
13276 cat > conftest.$ac_ext <<EOF
13277 #line 13278 "configure"
13278 #include "confdefs.h"
13279 /* Override any gcc2 internal prototype to avoid an error.  */
13280 /* We use char because int might match the return type of a gcc2
13281     builtin and then its argument prototype would still apply.  */
13282 char dbm_open();
13283
13284 int main() {
13285 dbm_open()
13286 ; return 0; }
13287 EOF
13288 if { (eval echo configure:13289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13289   rm -rf conftest*
13290   eval "ac_cv_lib_$ac_lib_var=yes"
13291 else
13292   echo "configure: failed program was:" >&5
13293   cat conftest.$ac_ext >&5
13294   rm -rf conftest*
13295   eval "ac_cv_lib_$ac_lib_var=no"
13296 fi
13297 rm -f conftest*
13298 xe_check_libs=""
13299
13300 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13301   echo "$ac_t""yes" 1>&6
13302   with_database_dbm=yes libdbm=-ldbm
13303 else
13304   echo "$ac_t""no" 1>&6
13305 test "$with_database_dbm" = "yes" && \
13306         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
13307       with_database_dbm=no
13308 fi
13309
13310
13311 fi
13312
13313 fi
13314
13315 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
13316 test "$with_database_gdbm" = "yes" -o \
13317      "$with_database_dbm"  = "yes" && \
13318   { test "$extra_verbose" = "yes" && cat << \EOF
13319     Defining HAVE_DBM
13320 EOF
13321 cat >> confdefs.h <<\EOF
13322 #define HAVE_DBM 1
13323 EOF
13324 }
13325
13326
13327 if test "$with_database_berkdb" != "no"; then
13328   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
13329 echo "configure:13330: checking for Berkeley db.h" >&5
13330   for header in "db/db.h" "db.h"; do
13331     cat > conftest.$ac_ext <<EOF
13332 #line 13333 "configure"
13333 #include "confdefs.h"
13334
13335 #include <stdlib.h>
13336 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
13337 #ifdef HAVE_INTTYPES_H
13338 #define __BIT_TYPES_DEFINED__
13339 #include <inttypes.h>
13340 typedef uint8_t  u_int8_t;
13341 typedef uint16_t u_int16_t;
13342 typedef uint32_t u_int32_t;
13343 #ifdef WE_DONT_NEED_QUADS
13344 typedef uint64_t u_int64_t;
13345 #endif
13346 #endif
13347 #endif
13348 #include <$header>
13349
13350 int main() {
13351
13352 ; return 0; }
13353 EOF
13354 if { (eval echo configure:13355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13355   rm -rf conftest*
13356   db_h_file="$header"; break
13357 else
13358   echo "configure: failed program was:" >&5
13359   cat conftest.$ac_ext >&5
13360 fi
13361 rm -f conftest*
13362   done
13363   if test -z "$db_h_file"
13364   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
13365   else echo "$ac_t""$db_h_file" 1>&6
13366   fi
13367
13368   if test "$with_database_berkdb" != "no"; then
13369     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
13370 echo "configure:13371: checking for Berkeley DB version" >&5
13371     cat > conftest.$ac_ext <<EOF
13372 #line 13373 "configure"
13373 #include "confdefs.h"
13374 #include <$db_h_file>
13375 #if DB_VERSION_MAJOR > 1
13376 yes
13377 #endif
13378
13379 EOF
13380 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13381   egrep "yes" >/dev/null 2>&1; then
13382   rm -rf conftest*
13383   cat > conftest.$ac_ext <<EOF
13384 #line 13385 "configure"
13385 #include "confdefs.h"
13386 #include <$db_h_file>
13387 #if DB_VERSION_MAJOR > 2
13388 yes
13389 #endif
13390
13391 EOF
13392 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13393   egrep "yes" >/dev/null 2>&1; then
13394   rm -rf conftest*
13395   echo "$ac_t""3" 1>&6; dbfunc=db_create
13396 else
13397   rm -rf conftest*
13398   
13399     echo "$ac_t""2" 1>&6; dbfunc=db_open
13400 fi
13401 rm -f conftest*
13402
13403 else
13404   rm -rf conftest*
13405   
13406     echo "$ac_t""1" 1>&6; dbfunc=dbopen
13407 fi
13408 rm -f conftest*
13409
13410     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
13411 echo "configure:13412: checking for $dbfunc" >&5
13412
13413 cat > conftest.$ac_ext <<EOF
13414 #line 13415 "configure"
13415 #include "confdefs.h"
13416 /* System header to define __stub macros and hopefully few prototypes,
13417     which can conflict with char $dbfunc(); below.  */
13418 #include <assert.h>
13419 /* Override any gcc2 internal prototype to avoid an error.  */
13420 /* We use char because int might match the return type of a gcc2
13421     builtin and then its argument prototype would still apply.  */
13422 char $dbfunc();
13423
13424 int main() {
13425
13426 /* The GNU C library defines this for functions which it implements
13427     to always fail with ENOSYS.  Some functions are actually named
13428     something starting with __ and the normal name is an alias.  */
13429 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
13430 choke me
13431 #else
13432 $dbfunc();
13433 #endif
13434
13435 ; return 0; }
13436 EOF
13437 if { (eval echo configure:13438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13438   rm -rf conftest*
13439   eval "ac_cv_func_$dbfunc=yes"
13440 else
13441   echo "configure: failed program was:" >&5
13442   cat conftest.$ac_ext >&5
13443   rm -rf conftest*
13444   eval "ac_cv_func_$dbfunc=no"
13445 fi
13446 rm -f conftest*
13447
13448 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
13449   echo "$ac_t""yes" 1>&6
13450   with_database_berkdb=yes need_libdb=no
13451 else
13452   echo "$ac_t""no" 1>&6
13453
13454     
13455 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
13456 echo "configure:13457: checking for $dbfunc in -ldb" >&5
13457 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
13458
13459 xe_check_libs=" -ldb "
13460 cat > conftest.$ac_ext <<EOF
13461 #line 13462 "configure"
13462 #include "confdefs.h"
13463 /* Override any gcc2 internal prototype to avoid an error.  */
13464 /* We use char because int might match the return type of a gcc2
13465     builtin and then its argument prototype would still apply.  */
13466 char $dbfunc();
13467
13468 int main() {
13469 $dbfunc()
13470 ; return 0; }
13471 EOF
13472 if { (eval echo configure:13473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13473   rm -rf conftest*
13474   eval "ac_cv_lib_$ac_lib_var=yes"
13475 else
13476   echo "configure: failed program was:" >&5
13477   cat conftest.$ac_ext >&5
13478   rm -rf conftest*
13479   eval "ac_cv_lib_$ac_lib_var=no"
13480 fi
13481 rm -f conftest*
13482 xe_check_libs=""
13483
13484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13485   echo "$ac_t""yes" 1>&6
13486   with_database_berkdb=yes need_libdb=yes
13487 else
13488   echo "$ac_t""no" 1>&6
13489 fi
13490
13491
13492 fi
13493
13494   fi
13495
13496   if test "$with_database_berkdb" = "yes"; then
13497     { test "$extra_verbose" = "yes" && cat << EOF
13498     Defining DB_H_FILE = "$db_h_file"
13499 EOF
13500 cat >> confdefs.h <<EOF
13501 #define DB_H_FILE "$db_h_file"
13502 EOF
13503 }
13504
13505     { test "$extra_verbose" = "yes" && cat << \EOF
13506     Defining HAVE_BERKELEY_DB
13507 EOF
13508 cat >> confdefs.h <<\EOF
13509 #define HAVE_BERKELEY_DB 1
13510 EOF
13511 }
13512
13513     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
13514   else with_database_berkdb=no
13515   fi
13516 fi
13517
13518 if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
13519      != "no no no"; then
13520   { test "$extra_verbose" = "yes" && cat << \EOF
13521     Defining HAVE_DATABASE
13522 EOF
13523 cat >> confdefs.h <<\EOF
13524 #define HAVE_DATABASE 1
13525 EOF
13526 }
13527
13528   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
13529    echo "    xemacs will be linked with \"database.o\""
13530  fi
13531 fi
13532
13533 if test "$with_socks" = "yes"; then
13534   
13535 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
13536 echo "configure:13537: checking for SOCKSinit in -lsocks" >&5
13537 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
13538
13539 xe_check_libs=" -lsocks "
13540 cat > conftest.$ac_ext <<EOF
13541 #line 13542 "configure"
13542 #include "confdefs.h"
13543 /* Override any gcc2 internal prototype to avoid an error.  */
13544 /* We use char because int might match the return type of a gcc2
13545     builtin and then its argument prototype would still apply.  */
13546 char SOCKSinit();
13547
13548 int main() {
13549 SOCKSinit()
13550 ; return 0; }
13551 EOF
13552 if { (eval echo configure:13553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13553   rm -rf conftest*
13554   eval "ac_cv_lib_$ac_lib_var=yes"
13555 else
13556   echo "configure: failed program was:" >&5
13557   cat conftest.$ac_ext >&5
13558   rm -rf conftest*
13559   eval "ac_cv_lib_$ac_lib_var=no"
13560 fi
13561 rm -f conftest*
13562 xe_check_libs=""
13563
13564 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13565   echo "$ac_t""yes" 1>&6
13566     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
13567     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
13568   { test "$extra_verbose" = "yes" && cat << EOF
13569     Defining $ac_tr_lib
13570 EOF
13571 cat >> confdefs.h <<EOF
13572 #define $ac_tr_lib 1
13573 EOF
13574 }
13575
13576   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
13577
13578 else
13579   echo "$ac_t""no" 1>&6
13580 fi
13581
13582
13583   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
13584     Defining HAVE_SOCKS
13585 EOF
13586 cat >> confdefs.h <<\EOF
13587 #define HAVE_SOCKS 1
13588 EOF
13589 }
13590
13591 fi
13592
13593 if test "$usage_tracking" = "yes"; then
13594   { test "$extra_verbose" = "yes" && cat << \EOF
13595     Defining USAGE_TRACKING
13596 EOF
13597 cat >> confdefs.h <<\EOF
13598 #define USAGE_TRACKING 1
13599 EOF
13600 }
13601
13602   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
13603 fi
13604
13605 if test "$with_modules" != "no"; then
13606   echo "checking for module support" 1>&6
13607 echo "configure:13608: checking for module support" >&5
13608
13609     if test "$with_msw" = "yes"; then
13610     have_dl=yes;
13611   else
13612         ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
13613 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
13614 echo "configure:13615: checking for dlfcn.h" >&5
13615
13616 cat > conftest.$ac_ext <<EOF
13617 #line 13618 "configure"
13618 #include "confdefs.h"
13619 #include <dlfcn.h>
13620 EOF
13621 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13622 { (eval echo configure:13623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13623 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13624 if test -z "$ac_err"; then
13625   rm -rf conftest*
13626   eval "ac_cv_header_$ac_safe=yes"
13627 else
13628   echo "$ac_err" >&5
13629   echo "configure: failed program was:" >&5
13630   cat conftest.$ac_ext >&5
13631   rm -rf conftest*
13632   eval "ac_cv_header_$ac_safe=no"
13633 fi
13634 rm -f conftest*
13635 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13636   echo "$ac_t""yes" 1>&6
13637   
13638       echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
13639 echo "configure:13640: checking for dlopen in -lc" >&5
13640       cat > conftest.$ac_ext <<EOF
13641 #line 13642 "configure"
13642 #include "confdefs.h"
13643 #include <dlfcn.h>
13644 int main() {
13645         dlopen ("", 0);
13646 ; return 0; }
13647 EOF
13648 if { (eval echo configure:13649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13649   rm -rf conftest*
13650    have_dl=yes 
13651 else
13652   echo "configure: failed program was:" >&5
13653   cat conftest.$ac_ext >&5
13654   rm -rf conftest*
13655   
13656       echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
13657 echo "configure:13658: checking for dlopen in -ldl" >&5
13658       ac_save_LIBS="$LIBS"
13659       LIBS="-ldl $LIBS"
13660       cat > conftest.$ac_ext <<EOF
13661 #line 13662 "configure"
13662 #include "confdefs.h"
13663 #include <dlfcn.h>
13664 int main() {
13665         dlopen ("", 0);
13666 ; return 0; }
13667 EOF
13668 if { (eval echo configure:13669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13669   rm -rf conftest*
13670    have_dl=yes 
13671 else
13672   echo "configure: failed program was:" >&5
13673   cat conftest.$ac_ext >&5
13674   rm -rf conftest*
13675   LIBS="$ac_save_LIBS"
13676 fi
13677 rm -f conftest*
13678       ac_save_LIBS=
13679 fi
13680 rm -f conftest*
13681 else
13682   echo "$ac_t""no" 1>&6
13683 fi
13684
13685     if test -n "$have_dl"; then
13686       { test "$extra_verbose" = "yes" && cat << \EOF
13687     Defining HAVE_DLOPEN
13688 EOF
13689 cat >> confdefs.h <<\EOF
13690 #define HAVE_DLOPEN 1
13691 EOF
13692 }
13693
13694     else
13695       
13696 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
13697 echo "configure:13698: checking for shl_load in -ldld" >&5
13698 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
13699
13700 xe_check_libs=" -ldld "
13701 cat > conftest.$ac_ext <<EOF
13702 #line 13703 "configure"
13703 #include "confdefs.h"
13704 /* Override any gcc2 internal prototype to avoid an error.  */
13705 /* We use char because int might match the return type of a gcc2
13706     builtin and then its argument prototype would still apply.  */
13707 char shl_load();
13708
13709 int main() {
13710 shl_load()
13711 ; return 0; }
13712 EOF
13713 if { (eval echo configure:13714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13714   rm -rf conftest*
13715   eval "ac_cv_lib_$ac_lib_var=yes"
13716 else
13717   echo "configure: failed program was:" >&5
13718   cat conftest.$ac_ext >&5
13719   rm -rf conftest*
13720   eval "ac_cv_lib_$ac_lib_var=no"
13721 fi
13722 rm -f conftest*
13723 xe_check_libs=""
13724
13725 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13726   echo "$ac_t""yes" 1>&6
13727   libdl=dld have_dl=yes;
13728         { test "$extra_verbose" = "yes" && cat << \EOF
13729     Defining HAVE_SHL_LOAD
13730 EOF
13731 cat >> confdefs.h <<\EOF
13732 #define HAVE_SHL_LOAD 1
13733 EOF
13734 }
13735
13736 else
13737   echo "$ac_t""no" 1>&6
13738
13739 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
13740 echo "configure:13741: checking for dld_init in -ldld" >&5
13741 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
13742
13743 xe_check_libs=" -ldld "
13744 cat > conftest.$ac_ext <<EOF
13745 #line 13746 "configure"
13746 #include "confdefs.h"
13747 /* Override any gcc2 internal prototype to avoid an error.  */
13748 /* We use char because int might match the return type of a gcc2
13749     builtin and then its argument prototype would still apply.  */
13750 char dld_init();
13751
13752 int main() {
13753 dld_init()
13754 ; return 0; }
13755 EOF
13756 if { (eval echo configure:13757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13757   rm -rf conftest*
13758   eval "ac_cv_lib_$ac_lib_var=yes"
13759 else
13760   echo "configure: failed program was:" >&5
13761   cat conftest.$ac_ext >&5
13762   rm -rf conftest*
13763   eval "ac_cv_lib_$ac_lib_var=no"
13764 fi
13765 rm -f conftest*
13766 xe_check_libs=""
13767
13768 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13769   echo "$ac_t""yes" 1>&6
13770   libdl=dld have_dl=yes;
13771         { test "$extra_verbose" = "yes" && cat << \EOF
13772     Defining HAVE_DLD_INIT
13773 EOF
13774 cat >> confdefs.h <<\EOF
13775 #define HAVE_DLD_INIT 1
13776 EOF
13777 }
13778
13779 else
13780   echo "$ac_t""no" 1>&6
13781 fi
13782
13783
13784 fi
13785
13786
13787     fi
13788   fi 
13789   if test -n "$have_dl"; then
13790         
13791 dll_ld=
13792 dll_ldflags=
13793 dll_cflags=
13794 dll_post=
13795 dll_ldo="-o"
13796 ld_dynamic_link_flags=
13797 xehost=$canonical
13798 xealias=$internal_configuration
13799
13800 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
13801 echo "configure:13802: checking how to build dynamic libraries for ${xehost}" >&5
13802 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
13803 case "$xehost" in
13804 *-*-linux-gnu*) ;;
13805 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
13806 esac
13807
13808 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
13809 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
13810 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
13811
13812 case "$xehost_os" in
13813 aix3*)
13814   # AIX sometimes has problems with the GCC collect2 program.  For some
13815   # reason, if we set the COLLECT_NAMES environment variable, the problems
13816   # vanish in a puff of smoke.
13817   if test "${COLLECT_NAMES+set}" != set; then
13818     COLLECT_NAMES=
13819     export COLLECT_NAMES
13820   fi
13821   ;;
13822 esac
13823
13824 # Now see if the compiler is really GCC.
13825 if test "$GCC" = "yes"; then
13826   XEGCC=yes
13827 else
13828   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
13829 echo "configure:13830: checking checking whether we are using GNU C" >&5
13830   cat > conftest.$ac_ext <<EOF
13831 #line 13832 "configure"
13832 #include "confdefs.h"
13833
13834 #ifdef __GNUC__
13835   yes;
13836 #endif
13837
13838 EOF
13839 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13840   egrep "yes" >/dev/null 2>&1; then
13841   rm -rf conftest*
13842   XEGCC=yes
13843 else
13844   rm -rf conftest*
13845   XEGCC=no
13846 fi
13847 rm -f conftest*
13848
13849   echo "$ac_t""${XEGCC}" 1>&6
13850 fi
13851
13852 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
13853 echo "configure:13854: checking how to produce PIC code" >&5
13854 wl=
13855
13856 can_build_shared=yes
13857 if test "$XEGCC" = yes; then
13858   wl='-Wl,'
13859
13860   case "$xehost_os" in
13861   aix[3-9]* | irix[5-9]* | osf[3-9])
13862     # PIC is the default for these OSes.
13863     ;;
13864
13865   os2*)
13866     # We can build DLLs from non-PIC.
13867     ;;
13868   amigaos*)
13869     # FIXME: we need at least 68020 code to build shared libraries, but
13870     # adding the `-m68020' flag to GCC prevents building anything better,
13871     # like `-m68040'.
13872     dll_cflags='-m68020 -resident32 -malways-restore-a4'
13873     ;;
13874   *cygwin* | *mingw* )
13875     # PIC is the default
13876     ;;
13877   *)
13878     dll_cflags='-fPIC'
13879     ;;
13880   esac
13881 else
13882   # PORTME Check for PIC flags for the system compiler.
13883   case "$xehost_os" in
13884   hpux9* | hpux1[0-9]*)
13885     # Is there a better link_static_flag that works with the bundled CC?
13886     wl='-Wl,'
13887     dll_cflags='+Z'
13888     ;;
13889
13890   irix[5-9]*)
13891     wl='-Wl,'
13892     # PIC (with -KPIC) is the default.
13893     ;;
13894
13895   os2*)
13896     # We can build DLLs from non-PIC.
13897     ;;
13898
13899   osf[3-9]*)
13900     # All OSF/1 code is PIC.
13901     wl='-Wl,'
13902     ;;
13903
13904   aix[3-9]*)
13905     # All AIX code is PIC.
13906     wl='-Wl,'
13907     ;;
13908
13909   sco3.2v5*)
13910     dll_cflags='-belf -Kpic'
13911     wl='-Wl,'
13912     ;;
13913
13914   unixware*)
13915     dll_cflags="-KPIC"
13916     wl="-Wl,"
13917     ;;
13918
13919   sysv4*)
13920     dll_cflags="-KPIC"
13921     wl="-Wl,"
13922     ;;
13923
13924   sysv5*)
13925     dll_cflags="-KPIC"
13926     wl="-Wl,"
13927     ;;
13928
13929   solaris2*)
13930     dll_cflags='-KPIC'
13931     wl='-Wl,'
13932     ;;
13933
13934   sunos4*)
13935     dll_cflags='-PIC'
13936     wl='-Qoption ld '
13937     ;;
13938
13939   uts4*)
13940     dll_cflags='-pic'
13941     ;;
13942
13943   *)
13944     can_build_shared=no
13945     ;;
13946   esac
13947 fi
13948
13949 if test -n "$dll_cflags"; then
13950   echo "$ac_t""${dll_cflags}" 1>&6
13951
13952   # Check to make sure the dll_cflags actually works.
13953   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
13954 echo "configure:13955: checking if PIC flag ${dll_cflags} really works" >&5
13955   save_CFLAGS="$CFLAGS"
13956   CFLAGS="$CFLAGS $dll_cflags -DPIC"
13957   cat > conftest.$ac_ext <<EOF
13958 #line 13959 "configure"
13959 #include "confdefs.h"
13960
13961 int main() {
13962 int x=0;
13963 ; return 0; }
13964 EOF
13965 if { (eval echo configure:13966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13966   rm -rf conftest*
13967   
13968     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
13969     # reports no error.  So, we need to grep stderr for (Bundled).
13970     if grep '(Bundled)' config.log >/dev/null; then
13971       echo "$ac_t""no" 1>&6
13972       can_build_shared=no
13973       dll_cflags=
13974     else
13975       echo "$ac_t""yes" 1>&6
13976     fi
13977 else
13978   echo "configure: failed program was:" >&5
13979   cat conftest.$ac_ext >&5
13980   rm -rf conftest*
13981   echo "$ac_t""no" 1>&6
13982     can_build_shared=no
13983     dll_cflags=
13984 fi
13985 rm -f conftest*
13986   CFLAGS="$save_CFLAGS"
13987 else
13988   echo "$ac_t""none" 1>&6
13989 fi
13990
13991 if test "$can_build_shared" = "yes"; then
13992 cc_produces_so=no
13993 xldf=
13994 xcldf=
13995 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
13996 echo "configure:13997: checking if C compiler can produce shared libraries" >&5
13997 if test "$XEGCC" = yes; then
13998   xcldf="-shared"
13999   xldf="-shared"
14000 else # Not using GCC
14001   case "$xehost_os" in
14002     aix[3-9]*)
14003       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
14004       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
14005       ;;
14006
14007     freebsd2* | netbsd* | openbsd*)
14008       xldf="-Bshareable"
14009       xcldf="${wl}-Bshareable"
14010       ;;
14011
14012     freebsd3*)
14013       xcldf="-shared"
14014       ;;
14015
14016     hpux*)
14017       xldf="-b +s"
14018       xcldf="${wl}-b ${wl}+s"
14019       ;;
14020
14021     irix[5-9]* | osf[3-9]*)
14022       xcldf="${wl}-shared"
14023       xldf="-shared"
14024       ;;
14025
14026     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
14027       xcldf="-G"
14028       xldf="-G"
14029       ;;
14030
14031     sunos4*)
14032       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
14033       xldf="-assert pure-text -Bstatic"
14034       ;;
14035   esac
14036 fi # End if if we are using gcc
14037
14038 if test -n "$xcldf"; then
14039   save_LDFLAGS=$LDFLAGS
14040   save_LIBS=$LIBS
14041   save_xe_libs=$xe_libs
14042   LDFLAGS="$xcldf $LDFLAGS"
14043   LIBS=
14044   xe_libs=
14045   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
14046   cat > conftest.$ac_ext <<EOF
14047 #line 14048 "configure"
14048 #include "confdefs.h"
14049
14050 int main() {
14051 int x=0;
14052 ; return 0; }
14053 EOF
14054 if { (eval echo configure:14055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14055   rm -rf conftest*
14056   cc_produces_so=yes
14057 else
14058   echo "configure: failed program was:" >&5
14059   cat conftest.$ac_ext >&5
14060   rm -rf conftest*
14061   cc_produces_so=no
14062 fi
14063 rm -f conftest*
14064   LDFLAGS=$save_LDFLAGS
14065   LIBS=$save_LIBS
14066   xe_libs=$save_xe_libs
14067   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
14068 else
14069   cc_produces_so=no
14070 fi
14071 echo "$ac_t""${cc_produces_so}" 1>&6
14072
14073 LTLD=$LD
14074 if test -z "$LTLD"; then
14075   ac_prog=ld
14076   if test "$XEGCC" = yes; then
14077     # Check if gcc -print-prog-name=ld gives a path.
14078     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
14079 echo "configure:14080: checking for ld used by GCC" >&5
14080     ac_prog=`($CC -print-prog-name=ld) 2>&5`
14081     case "$ac_prog" in
14082     # Accept absolute paths.
14083     /*)
14084       if test -z "$LTLD"; then
14085         case "$ac_prog" in
14086           *gcc-lib*) LTLD="$CC"
14087                      ;;
14088           *)         LTLD="$ac_prog"
14089                      ;;
14090         esac
14091       fi
14092       ;;
14093     "")
14094       # If it fails, then pretend we aren't using GCC.
14095       ac_prog=ld
14096       ;;
14097     *)
14098       # If it is relative, then search for the first ld in PATH.
14099       with_gnu_ld=unknown
14100       ;;
14101     esac
14102   else
14103     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
14104 echo "configure:14105: checking for GNU ld" >&5
14105   fi
14106
14107   if test -z "$LTLD"; then
14108     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
14109     for ac_dir in $PATH; do
14110       test -z "$ac_dir" && ac_dir=.
14111       if test -f "$ac_dir/$ac_prog"; then
14112         LTLD="$ac_dir/$ac_prog"
14113         # Check to see if the program is GNU ld.  I'd rather use --version,
14114         # but apparently some GNU ld's only accept -v.
14115         # Break only if it was the GNU/non-GNU ld that we prefer.
14116         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
14117           xe_gnu_ld=yes
14118         else
14119           xe_gnu_ld=no
14120         fi
14121       fi
14122     done
14123     IFS="$ac_save_ifs"
14124   fi
14125
14126   if test -n "$LTLD"; then
14127     echo "$ac_t""${LTLD}" 1>&6
14128   else
14129     echo "$ac_t""no" 1>&6
14130   fi
14131
14132   if test -z "$LTLD" -a "$cc_produces_so" = no; then
14133     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
14134     exit 1
14135   fi
14136 fi
14137
14138 ld_dynamic_link_flags=
14139
14140 # Check to see if it really is or isn't GNU ld.
14141 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
14142 echo "configure:14143: checking if the linker is GNU ld" >&5
14143 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
14144 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
14145   xe_gnu_ld=yes
14146 else
14147   xe_gnu_ld=no
14148 fi
14149 echo "$ac_t""${xe_gnu_ld}" 1>&6
14150
14151 case "$xehost_os" in
14152   amigaos* | sunos4*)
14153     # On these operating systems, we should treat GNU ld like the system ld.
14154     gnu_ld_acts_native=yes
14155     ;;
14156   *)
14157     gnu_ld_acts_native=no
14158     ;;
14159 esac
14160
14161 if test "$cc_produces_so" = "yes"; then
14162   dll_ld=$CC
14163   dll_ldflags=$xcldf
14164   can_build_shared=yes
14165   ld_shlibs=yes
14166 else
14167   # OK - only NOW do we futz about with ld.
14168   # See if the linker supports building shared libraries.
14169   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
14170 echo "configure:14171: checking whether the linker supports shared libraries" >&5
14171   dll_ld=$CC
14172   dll_ldflags=$LDFLAGS
14173   ld_shlibs=yes
14174   can_build_shared=yes
14175   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
14176     # See if GNU ld supports shared libraries.
14177     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
14178       dll_ld=$CC
14179       dll_ldflags="-shared"
14180       ld_shlibs=yes
14181     else
14182       ld_shlibs=no
14183     fi
14184   else
14185     # PORTME fill in a description of your system's linker (not GNU ld)
14186     case "$xehost_os" in
14187     aix3*)
14188       dll_ld=$LTLD
14189       dll_ldflags=$xldf
14190       ;;
14191
14192     aix[4-9]*)
14193       dll_ldflags=$xcldf
14194       ;;
14195
14196     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
14197     # support.  Future versions do this automatically, but an explicit c++rt0.o
14198     # doesn't break anything, and helps significantly (at the cost of a little
14199     # extra space).
14200     freebsd2.2*)
14201       dll_ld=$LTLD
14202       dll_ldflags=$xldf
14203       dll_post="/usr/lib/c++rt0.o"
14204       ;;
14205
14206     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
14207     freebsd2*)
14208       dll_ld=$LTLD
14209       dll_ldflags="-Bshareable"
14210       ;;
14211
14212     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
14213     freebsd3*)
14214       dll_ldflags="-shared"
14215       ;;
14216
14217     hpux*)
14218       dll_ld=$LTLD
14219       dll_ldflags=$xldf
14220       ;;
14221
14222     irix[5-9]*)
14223       dll_ld=$LTLD
14224       dll_ldflags=$xldf
14225       ;;
14226
14227     netbsd*)
14228       # Tested with NetBSD 1.2 ld
14229       dll_ld=$LTLD
14230       dll_ldflags=$xldf
14231       ;;
14232
14233     openbsd*)
14234       dll_ld=$LTLD
14235       dll_ldflags=$xldf
14236       ;;
14237
14238     osf3* | osf4*)
14239       dll_ld=$LTLD
14240       dll_ldflags=$xldf
14241       ;;
14242
14243     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
14244     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
14245       dll_ld=$LTLD
14246       case "$dll_ld" in
14247         *gcc*) dll_ldflags="-shared"
14248                dll_ld=$CC
14249                ;;
14250         *)     dll_ldflags="-G"
14251                ;;
14252       esac
14253       ;;
14254
14255     sunos4*)
14256       if test "$XEGCC" = yes; then
14257         dll_ld=$CC
14258       else
14259         dll_ld=$LTLD
14260       fi
14261       dll_ldflags=$xldf
14262       ;;
14263
14264     uts4*)
14265       dll_ld=$LTLD
14266       dll_ldflags="-G"
14267       ;;
14268
14269     bsdi*)
14270       dll_ldflags="-r"
14271       dll_ld="shlicc2"
14272       ;;
14273
14274     *)
14275       ld_shlibs=no
14276       can_build_shared=no
14277       ;;
14278     esac
14279   fi
14280   echo "$ac_t""${ld_shlibs}" 1>&6
14281   if test "$ld_shlibs" = "no"; then
14282     can_build_shared=no
14283   fi
14284 fi # End of if cc_produces_so = no
14285
14286
14287 if test "$xe_gnu_ld" = yes; then
14288   if test "$ld_shlibs" = yes; then
14289     ld_dynamic_link_flags="${wl}-export-dynamic"
14290   fi
14291 fi
14292
14293 if test -z "$ld_dynamic_link_flags"; then
14294   case "$xehost_os" in
14295   aix[3-9]*)
14296     ld_dynamic_link_flags=
14297     ;;
14298
14299   freebsd2.2*)
14300     ld_dynamic_link_flags=
14301     ;;
14302
14303   freebsd2*)
14304     ld_dynamic_link_flags=
14305     ;;
14306
14307   freebsd3*)
14308     ld_dynamic_link_flags=
14309     ;;
14310
14311   hpux*)
14312     ld_dynamic_link_flags="${wl}-E"
14313     ;;
14314
14315   irix[5-9]*)
14316     ld_dynamic_link_flags=
14317     ;;
14318
14319   netbsd*)
14320     ld_dynamic_link_flags=
14321     ;;
14322
14323   openbsd*)
14324     ld_dynamic_link_flags=
14325     ;;
14326
14327   osf3* | osf4*)
14328     ld_dynamic_link_flags=
14329     ;;
14330
14331   solaris2* | solaris7*)
14332     ld_dynamic_link_flags=
14333     ;;
14334
14335   sco3.2v5* | unixware* | sysv5* | sysv4*)
14336     ld_dynamic_link_flags="${wl}-Bexport"
14337     ;;
14338
14339   sunos4*)
14340     ld_dynamic_link_flags=
14341     ;;
14342
14343   uts4*)
14344     ld_dynamic_link_flags=
14345     ;;
14346
14347   bsdi*)
14348     ld_dynamic_link_flags=
14349     ;;
14350
14351   esac
14352 fi # End of if -z ld_dynamic_link_flags
14353 fi # End of if test "$can_build_shared" = "yes"
14354
14355
14356
14357
14358
14359
14360
14361
14362   fi
14363
14364   if test "$can_build_shared" = "yes"; then
14365     { test "$extra_verbose" = "yes" && cat << \EOF
14366     Defining HAVE_SHLIB
14367 EOF
14368 cat >> confdefs.h <<\EOF
14369 #define HAVE_SHLIB 1
14370 EOF
14371 }
14372
14373     extra_objs="$extra_objs sysdll.o emodules.o" &&  if test "$extra_verbose" = "yes"; then
14374    echo "    xemacs will be linked with \"sysdll.o emodules.o\""
14375  fi
14376     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
14377     test -n "$libdl" && LIBS="-l${libdl} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${libdl}\" to \$LIBS"; fi
14378     for ac_func in dlerror _dlerror
14379 do
14380 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14381 echo "configure:14382: checking for $ac_func" >&5
14382
14383 cat > conftest.$ac_ext <<EOF
14384 #line 14385 "configure"
14385 #include "confdefs.h"
14386 /* System header to define __stub macros and hopefully few prototypes,
14387     which can conflict with char $ac_func(); below.  */
14388 #include <assert.h>
14389 /* Override any gcc2 internal prototype to avoid an error.  */
14390 /* We use char because int might match the return type of a gcc2
14391     builtin and then its argument prototype would still apply.  */
14392 char $ac_func();
14393
14394 int main() {
14395
14396 /* The GNU C library defines this for functions which it implements
14397     to always fail with ENOSYS.  Some functions are actually named
14398     something starting with __ and the normal name is an alias.  */
14399 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14400 choke me
14401 #else
14402 $ac_func();
14403 #endif
14404
14405 ; return 0; }
14406 EOF
14407 if { (eval echo configure:14408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14408   rm -rf conftest*
14409   eval "ac_cv_func_$ac_func=yes"
14410 else
14411   echo "configure: failed program was:" >&5
14412   cat conftest.$ac_ext >&5
14413   rm -rf conftest*
14414   eval "ac_cv_func_$ac_func=no"
14415 fi
14416 rm -f conftest*
14417
14418 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14419   echo "$ac_t""yes" 1>&6
14420     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14421   { test "$extra_verbose" = "yes" && cat << EOF
14422     Defining $ac_tr_func
14423 EOF
14424 cat >> confdefs.h <<EOF
14425 #define $ac_tr_func 1
14426 EOF
14427 }
14428  
14429 else
14430   echo "$ac_t""no" 1>&6
14431 fi
14432 done
14433
14434     with_modules=yes
14435   else
14436     if test "$with_modules" = "yes"; then
14437       { echo "Error:" "Required module support cannot be provided." >&2; exit 1; }
14438     else
14439       echo "configure: warning: "Module support cannot be provided."" 1>&2
14440     fi
14441     with_modules=no
14442   fi
14443 fi
14444
14445 cat > conftest.$ac_ext <<EOF
14446 #line 14447 "configure"
14447 #include "confdefs.h"
14448 int main(int c,char *v[]){return 0;}
14449 EOF
14450 if { (eval echo configure:14451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
14451 then
14452   :
14453 else
14454   conftest_rc="$?"
14455   echo "configure: failed program was:" >&5
14456   cat conftest.$ac_ext >&5
14457   rm -fr conftest*
14458   
14459   echo ""
14460   echo "*** PANIC *** The C compiler can no longer build working executables."
14461   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
14462   echo "*** PANIC *** The most likely reason for this problem is that configure"
14463   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
14464   echo "*** PANIC *** found at run time."
14465   echo "*** PANIC ***"
14466   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
14467   echo "*** PANIC *** On other systems, try telling configure where to find the"
14468   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
14469   echo "*** PANIC ***"
14470   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
14471   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
14472   echo "*** PANIC *** on your system.  Don't do that."
14473   exit 1
14474 fi
14475 rm -fr conftest*
14476
14477 if test "$win32_processes" = "yes"; then
14478   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
14479    echo "    xemacs will be linked with \"process-nt.o\""
14480  fi
14481 else
14482   { test "$extra_verbose" = "yes" && cat << \EOF
14483     Defining HAVE_UNIX_PROCESSES
14484 EOF
14485 cat >> confdefs.h <<\EOF
14486 #define HAVE_UNIX_PROCESSES 1
14487 EOF
14488 }
14489
14490   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
14491    echo "    xemacs will be linked with \"process-unix.o\""
14492  fi
14493 fi
14494
14495
14496
14497 T=""
14498 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14499 CFLAGS="$T"
14500
14501
14502 T=""
14503 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14504 extra_objs="$T"
14505
14506
14507 T=""
14508 for W in -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14509 c_switch_general="$T"
14510
14511
14512 T=""
14513 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14514 c_switch_window_system="$T"
14515
14516
14517 T=""
14518 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14519 c_switch_all="$T"
14520
14521
14522 T=""
14523 for W in $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14524 ld_switch_general="$T"
14525
14526
14527 T=""
14528 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14529 ld_switch_window_system="$T"
14530
14531
14532 T=""
14533 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14534 ld_switch_all="$T"
14535
14536
14537 T=""
14538 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14539 ld_libs_general="$T"
14540
14541
14542 T=""
14543 for W in $X_EXTRA_LIBS $libs_x $X_PRE_LIBS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14544 ld_libs_window_system="$T"
14545
14546
14547 T=""
14548 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14549 ld_libs_all="$T"
14550
14551
14552
14553 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
14554 internal_makefile_list="Makefile.in"
14555 SUBDIR_MAKEFILES=''
14556 test -d lock || mkdir lock
14557 for dir in $MAKE_SUBDIR; do
14558   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
14559         test -d "$d" || mkdir "$d"; cd "$d"
14560       done ) ;;
14561    * ) test -d "$dir" || mkdir "$dir" ;;
14562   esac
14563   
14564 T=""
14565 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14566 SUBDIR_MAKEFILES="$T"
14567
14568   
14569 T=""
14570 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14571 internal_makefile_list="$T"
14572
14573 done
14574
14575
14576
14577
14578 for dir in src/s src/m; do
14579   if test ! -d "$dir" ; then
14580     echo Making symbolic link to "$srcdir/$dir"
14581     ${LN_S} "$srcdir/$dir" "$dir"
14582   fi
14583 done
14584
14585 if test "$extra_verbose" = "yes"; then
14586   echo ""
14587   for var in extra_objs    c_switch_general  c_switch_window_system  c_switch_all   ld_switch_general ld_switch_window_system ld_switch_all     ld_libs_general   ld_libs_window_system   ld_libs_all; do eval "echo \"$var = '\$$var'\""; done
14588   echo ""
14589 fi
14590
14591
14592 if test -f "$srcdir/src/.gdbinit" -a ! -f "src/.gdbinit"; then
14593   test "$extra_verbose" = "yes" && echo "creating src/.gdbinit"
14594   echo "source $srcdir/src/.gdbinit" > "src/.gdbinit"
14595 fi
14596
14597 if test -f "$srcdir/src/.dbxrc" -a ! -f "src/.dbxrc"; then
14598   test "$extra_verbose" = "yes" && echo "creating src/.dbxrc"
14599   echo ". $srcdir/src/.dbxrc" > "src/.dbxrc"
14600 fi
14601
14602 if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then
14603   test "$extra_verbose" = "yes" && echo "creating TAGS"
14604   echo "\f
14605 $srcdir/TAGS,include" > "TAGS"
14606 fi
14607
14608 if test "$__SUNPRO_C" = "yes"; then
14609   test "$extra_verbose" = "yes" && echo "creating .sbinit"
14610   ( echo "# For use with Sun WorkShop's Source browser."
14611     echo "# See sbquery(1) and sbinit(4) for more information"
14612     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
14613   ) > .sbinit
14614 fi
14615
14616 rm -f core
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637 PREFIX=$prefix
14638 while true; do
14639   case "$PREFIX" in
14640     *\$* ) eval "PREFIX=$PREFIX" ;;
14641     *) break ;;
14642   esac
14643 done
14644
14645
14646
14647
14648 EXEC_PREFIX=$exec_prefix
14649 while true; do
14650   case "$EXEC_PREFIX" in
14651     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
14652     *) break ;;
14653   esac
14654 done
14655
14656
14657
14658
14659 INFODIR=$infodir
14660 while true; do
14661   case "$INFODIR" in
14662     *\$* ) eval "INFODIR=$INFODIR" ;;
14663     *) break ;;
14664   esac
14665 done
14666
14667
14668
14669
14670 INFOPATH=$infopath
14671 while true; do
14672   case "$INFOPATH" in
14673     *\$* ) eval "INFOPATH=$INFOPATH" ;;
14674     *) break ;;
14675   esac
14676 done
14677
14678
14679
14680
14681 PACKAGE_PATH=$package_path
14682 while true; do
14683   case "$PACKAGE_PATH" in
14684     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
14685     *) break ;;
14686   esac
14687 done
14688
14689
14690
14691
14692 LISPDIR=$lispdir
14693 while true; do
14694   case "$LISPDIR" in
14695     *\$* ) eval "LISPDIR=$LISPDIR" ;;
14696     *) break ;;
14697   esac
14698 done
14699
14700
14701
14702
14703 MODULEDIR=$moduledir
14704 while true; do
14705   case "$MODULEDIR" in
14706     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
14707     *) break ;;
14708   esac
14709 done
14710
14711
14712
14713
14714 SITELISPDIR=$sitelispdir
14715 while true; do
14716   case "$SITELISPDIR" in
14717     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
14718     *) break ;;
14719   esac
14720 done
14721
14722
14723
14724
14725 SITEMODULEDIR=$sitemoduledir
14726 while true; do
14727   case "$SITEMODULEDIR" in
14728     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
14729     *) break ;;
14730   esac
14731 done
14732
14733
14734
14735
14736 ETCDIR=$etcdir
14737 while true; do
14738   case "$ETCDIR" in
14739     *\$* ) eval "ETCDIR=$ETCDIR" ;;
14740     *) break ;;
14741   esac
14742 done
14743
14744
14745
14746
14747 DOCDIR=$docdir
14748 while true; do
14749   case "$DOCDIR" in
14750     *\$* ) eval "DOCDIR=$DOCDIR" ;;
14751     *) break ;;
14752   esac
14753 done
14754
14755
14756
14757
14758 ARCHLIBDIR=$archlibdir
14759 while true; do
14760   case "$ARCHLIBDIR" in
14761     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
14762     *) break ;;
14763   esac
14764 done
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
14786
14787
14788
14789
14790
14791
14792
14793 : ${XEMACS_CC:=$CC}
14794
14795
14796 if test "$with_prefix" = "yes"; then
14797   { test "$extra_verbose" = "yes" && cat << \EOF
14798     Defining PREFIX_USER_DEFINED
14799 EOF
14800 cat >> confdefs.h <<\EOF
14801 #define PREFIX_USER_DEFINED 1
14802 EOF
14803 }
14804
14805 fi
14806
14807 if test "$with_site_lisp" = "no"; then
14808   { test "$extra_verbose" = "yes" && cat << \EOF
14809     Defining INHIBIT_SITE_LISP
14810 EOF
14811 cat >> confdefs.h <<\EOF
14812 #define INHIBIT_SITE_LISP 1
14813 EOF
14814 }
14815
14816 fi
14817 if test "$with_site_modules" = "no"; then
14818   { test "$extra_verbose" = "yes" && cat << \EOF
14819     Defining INHIBIT_SITE_MODULES
14820 EOF
14821 cat >> confdefs.h <<\EOF
14822 #define INHIBIT_SITE_MODULES 1
14823 EOF
14824 }
14825
14826 fi
14827
14828
14829 T=""
14830 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14831 ac_configure_args="$T"
14832
14833 { test "$extra_verbose" = "yes" && cat << EOF
14834     Defining EMACS_CONFIGURATION = "$configuration"
14835 EOF
14836 cat >> confdefs.h <<EOF
14837 #define EMACS_CONFIGURATION "$configuration"
14838 EOF
14839 }
14840
14841 { test "$extra_verbose" = "yes" && cat << EOF
14842     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
14843 EOF
14844 cat >> confdefs.h <<EOF
14845 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
14846 EOF
14847 }
14848
14849
14850
14851 null_string=""
14852 { test "$extra_verbose" = "yes" && cat << EOF
14853     Defining LD_SWITCH_X_SITE = $null_string
14854 EOF
14855 cat >> confdefs.h <<EOF
14856 #define LD_SWITCH_X_SITE $null_string
14857 EOF
14858 }
14859
14860 { test "$extra_verbose" = "yes" && cat << EOF
14861     Defining LD_SWITCH_X_SITE_AUX = $null_string
14862 EOF
14863 cat >> confdefs.h <<EOF
14864 #define LD_SWITCH_X_SITE_AUX $null_string
14865 EOF
14866 }
14867
14868 { test "$extra_verbose" = "yes" && cat << EOF
14869     Defining C_SWITCH_X_SITE = $null_string
14870 EOF
14871 cat >> confdefs.h <<EOF
14872 #define C_SWITCH_X_SITE $null_string
14873 EOF
14874 }
14875
14876 { test "$extra_verbose" = "yes" && cat << EOF
14877     Defining LD_SWITCH_SITE = $null_string
14878 EOF
14879 cat >> confdefs.h <<EOF
14880 #define LD_SWITCH_SITE $null_string
14881 EOF
14882 }
14883
14884 { test "$extra_verbose" = "yes" && cat << EOF
14885     Defining C_SWITCH_SITE = $null_string
14886 EOF
14887 cat >> confdefs.h <<EOF
14888 #define C_SWITCH_SITE $null_string
14889 EOF
14890 }
14891
14892
14893
14894 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14895     Defining GNU_MALLOC
14896 EOF
14897 cat >> confdefs.h <<\EOF
14898 #define GNU_MALLOC 1
14899 EOF
14900 }
14901
14902 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14903     Defining USE_SYSTEM_MALLOC
14904 EOF
14905 cat >> confdefs.h <<\EOF
14906 #define USE_SYSTEM_MALLOC 1
14907 EOF
14908 }
14909
14910 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14911     Defining USE_DEBUG_MALLOC
14912 EOF
14913 cat >> confdefs.h <<\EOF
14914 #define USE_DEBUG_MALLOC 1
14915 EOF
14916 }
14917
14918                                               { test "$extra_verbose" = "yes" && cat << \EOF
14919     Defining USE_SYSTEM_MALLOC
14920 EOF
14921 cat >> confdefs.h <<\EOF
14922 #define USE_SYSTEM_MALLOC 1
14923 EOF
14924 }
14925
14926 fi
14927 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14928     Defining I18N3
14929 EOF
14930 cat >> confdefs.h <<\EOF
14931 #define I18N3 1
14932 EOF
14933 }
14934
14935 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14936     Defining USE_GCC
14937 EOF
14938 cat >> confdefs.h <<\EOF
14939 #define USE_GCC 1
14940 EOF
14941 }
14942
14943 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14944     Defining EXTERNAL_WIDGET
14945 EOF
14946 cat >> confdefs.h <<\EOF
14947 #define EXTERNAL_WIDGET 1
14948 EOF
14949 }
14950
14951 test "$quick_build"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14952     Defining QUICK_BUILD
14953 EOF
14954 cat >> confdefs.h <<\EOF
14955 #define QUICK_BUILD 1
14956 EOF
14957 }
14958
14959 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14960     Defining PURIFY
14961 EOF
14962 cat >> confdefs.h <<\EOF
14963 #define PURIFY 1
14964 EOF
14965 }
14966
14967 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14968     Defining QUANTIFY
14969 EOF
14970 cat >> confdefs.h <<\EOF
14971 #define QUANTIFY 1
14972 EOF
14973 }
14974
14975 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14976     Defining MAIL_USE_POP
14977 EOF
14978 cat >> confdefs.h <<\EOF
14979 #define MAIL_USE_POP 1
14980 EOF
14981 }
14982
14983 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14984     Defining KERBEROS
14985 EOF
14986 cat >> confdefs.h <<\EOF
14987 #define KERBEROS 1
14988 EOF
14989 }
14990
14991 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14992     Defining HESIOD
14993 EOF
14994 cat >> confdefs.h <<\EOF
14995 #define HESIOD 1
14996 EOF
14997 }
14998
14999 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
15000     Defining USE_UNION_TYPE
15001 EOF
15002 cat >> confdefs.h <<\EOF
15003 #define USE_UNION_TYPE 1
15004 EOF
15005 }
15006
15007 test "$pdump"              = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
15008     Defining PDUMP
15009 EOF
15010 cat >> confdefs.h <<\EOF
15011 #define PDUMP 1
15012 EOF
15013 }
15014
15015
15016
15017 (
15018 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
15019 else
15020   echo "uname -a: `uname -a`"
15021 fi
15022 echo ""
15023 echo "$0 $quoted_arguments"
15024 ) > Installation
15025
15026 if test ! -z ${emacs_beta_version} ; then
15027   if test -z "${emacs_is_beta}" ; then
15028         xemacs_betaname=".${emacs_beta_version}"
15029   else
15030         xemacs_betaname="-b${emacs_beta_version}"
15031   fi
15032 else
15033   xemacs_betaname=""
15034 fi
15035
15036 (
15037 echo "
15038
15039 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
15040 "
15041 echo "
15042 Compilation / Installation:"
15043 echo "  Source code location:              $srcdir"
15044 echo "  Installation prefix:               $prefix"
15045 if test -n "$site_includes"; then
15046   echo "  Additional header files:           $site_includes"
15047 fi
15048 if test -n "$site_libraries"; then
15049   echo "  Additional libraries:              $site_libraries"
15050 fi
15051 if test -n "$site_prefixes"; then
15052   echo "  Additional prefixes:               $site_prefixes"
15053 fi
15054 if test -n "$runpath"; then
15055   echo "  Runtime library search path:       $runpath"
15056 fi
15057
15058 if test -n "$opsysfile"
15059 then echo "  Operating system description file: \`$opsysfile'"
15060 else echo "  Not using any operating system description file"
15061 fi
15062 if test -n "$machfile"
15063 then echo "  Machine description file:          \`$machfile'"
15064 else echo "  Not using any machine description file"
15065 fi
15066
15067 echo "  Compiler:                          $CC $CFLAGS"
15068 echo "  Relocating allocator for buffers:  $rel_alloc"
15069 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
15070
15071 echo "
15072 Window System:"
15073 if test "$with_msw" = "yes"; then
15074   echo "  Compiling in support for the Microsoft window system."
15075 fi
15076 if test "$with_x11" = "yes"; then
15077   echo "  Compiling in support for the X window system:"
15078   echo "    - X Windows headers location:                 $x_includes"
15079   echo "    - X Windows libraries location:               $x_libraries"
15080   if test "$with_xauth" != yes; then
15081     echo "    - Xau (X authority) not available."
15082   fi
15083   if test "$with_xmu" != yes; then
15084     echo "    - Xmu library not available; substituting equivalent routines."
15085   fi
15086   if test "$with_wmcommand" != no; then
15087     echo "    - Handling WM_COMMAND properly."
15088   fi
15089 fi
15090 if test "$need_athena" = "yes"; then
15091   echo "  Compiling in support for the Athena widget set:"
15092   echo "    - Athena headers location:                    $athena_h_path"
15093   echo "    - Athena library to link:                     $athena_lib"
15094 fi
15095 case "$with_menubars" in
15096   lucid ) echo "  Using Lucid menubars." ;;
15097   motif ) echo "  Using Motif menubars."
15098           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
15099           echo "             We recommend using the Lucid menubar instead."
15100           echo "             Re-run configure with --with-menubars='lucid'." ;;
15101     msw ) echo "  Using MS-Windows menubars." ;;
15102 esac
15103 case "$with_scrollbars" in
15104   lucid  ) echo "  Using Lucid scrollbars."      ;;
15105   motif  ) echo "  Using Motif scrollbars."      ;;
15106   athena ) echo "  Using Athena scrollbars."     ;;
15107      msw ) echo "  Using MS-Windows scrollbars." ;;
15108 esac
15109 case "$with_dialogs" in
15110   motif  ) echo "  Using Motif dialog boxes."
15111            if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
15112              echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
15113              echo "             We recommend using the Athena dialog boxes instead."
15114              echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
15115              echo "             Read the PROBLEMS file for more information."
15116            fi; fi ;;
15117   athena ) echo "  Using Athena dialog boxes."     ;;
15118      msw ) echo "  Using MS-Windows dialog boxes." ;;
15119 esac
15120 case "$with_widgets" in
15121   motif  ) echo "  Using Motif native widgets."      ;;
15122   athena ) echo "  Using Athena native widgets."     ;;
15123      msw ) echo "  Using MS-Windows native widgets." ;;
15124 esac
15125 if test "$with_dragndrop" = yes; then
15126   echo "  Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
15127   echo "    -  Drag'n'Drop prototype:                             $dragndrop_proto."
15128 fi
15129
15130 echo "
15131 TTY:"
15132 test "$with_ncurses" = yes && echo "  Compiling in support for ncurses."
15133 test "$with_gpm" = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
15134
15135 echo "
15136 Images:"
15137 test "$with_gif" = yes && echo "  Compiling in support for GIF  images (builtin)."
15138 if test "$with_xpm" = yes; then
15139   echo "  Compiling in support for XPM  images."
15140 elif test "$with_x11" = yes; then
15141   echo "  WARNING: -----------------------------------------------------------"
15142   echo "  WARNING: Compiling without XPM image support."
15143   if test "$xpm_problem" != ""; then
15144     echo "  Reason: $xpm_problem"
15145   fi
15146   echo "  WARNING: You should strongly consider installing XPM."
15147   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
15148   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
15149   echo "  WARNING: -----------------------------------------------------------"
15150 fi
15151 if test "$with_png" = yes; then
15152   echo "  Compiling in support for PNG  images."
15153 elif test "$window_system" != "none"; then
15154   echo "  WARNING: -----------------------------------------------------------"
15155   echo "  WARNING: Compiling without PNG image support."
15156   if test "$png_problem" != ""; then
15157     echo "  Reason: $png_problem"
15158   fi
15159   echo "  WARNING: You should strongly consider installing the PNG libraries."
15160   echo "  WARNING: Otherwise certain images and glyphs may not display."
15161   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
15162   echo "  WARNING: -----------------------------------------------------------"
15163 fi
15164 test "$with_jpeg" = yes && echo "  Compiling in support for JPEG images."
15165 test "$with_tiff" = yes && echo "  Compiling in support for TIFF images."
15166 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
15167
15168 echo "
15169 Sound:"
15170 test "$with_native_sound" = yes && echo "  Compiling in support for sound (native)."
15171 test "$with_nas_sound" = yes && echo "  Compiling in support for NAS (network audio system)."
15172 test "$old_nas" = yes && echo "    - NAS library lacks error trapping; will play synchronously."
15173 test "$with_esd_sound" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
15174
15175 echo "
15176 Databases:"
15177 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
15178 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
15179 test "$with_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
15180 test "$with_ldap" = yes && echo "  Compiling in support for LDAP."
15181 if test "$with_postgresql" = yes; then
15182   echo "  Compiling in support for PostgreSQL."
15183   echo "    - Using PostgreSQL header file:  $libpq_fe_h_file"
15184   test "$with_postgresqlv7" = yes && echo "    - Using PostgreSQL V7 bindings."
15185 fi
15186
15187 echo "
15188 Internationalization:"
15189 test "$with_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
15190 test "$with_file_coding" = yes && echo "  Compiling in support for file coding."
15191 test "$with_xim" != no && echo "  Compiling in support for XIM (X11R5+ I18N input method)."
15192 test "$with_xim" = motif && echo "    - Using Motif to provide XIM support."
15193 test "$with_xim" = xlib && echo "    - Using raw Xlib to provide XIM support."
15194 test "$with_xfs" = yes && echo "    - Using XFontSet to provide bilingual menubar."
15195 test "$with_canna" = yes && echo "  Compiling in support for Canna on Mule."
15196 if test "$with_wnn" = yes; then
15197   echo "  Compiling in support for the WNN input method on Mule."
15198   test "$with_wnn6" = yes && echo "    - Using WNN version 6."
15199 fi
15200 test "$with_i18n3" = yes && echo "  Compiling in support for I18N level 3 (doesn't currently work)."
15201
15202 echo "
15203 Mail:"
15204 test "$with_pop" = yes && echo "  Compiling in support for POP mail retrieval."
15205 test "$with_kerberos" = yes && echo "  Compiling in support for Kerberos POP authentication."
15206 test "$with_hesiod" = yes && echo "  Compiling in support for Hesiod POP server access."
15207 test -n "$mail_locking" && echo "  Compiling in support for \"$mail_locking\" mail spool file locking method."
15208
15209 echo "
15210 Other Features:"
15211 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
15212 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
15213 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
15214 test "$with_dnet" = yes && echo "  Compiling in support for DNET."
15215 test "$with_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
15216 test "$use_union_type" = yes && echo "  Using the union type for Lisp_Objects."
15217 test "$pdump" = yes && echo "  Using the new portable dumper."
15218 test "$debug" = yes && echo "  Compiling in support for extra debugging code."
15219 test "$usage_tracking" = yes && echo "  Compiling in support for active usage tracking (Sun internal)."
15220 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc $error_check_glyphs" \
15221   != "no no no no no no"; then
15222   echo "  WARNING: ---------------------------------------------------------"
15223   echo "  WARNING: Compiling in support for runtime error checking."
15224   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
15225   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
15226   echo "  WARNING: ---------------------------------------------------------"
15227 fi
15228 echo ""
15229 ) | tee -a Installation
15230 echo ""
15231
15232
15233 # Remove any trailing slashes in these variables.
15234 test -n "$prefix" &&
15235   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
15236 test -n "$exec_prefix" &&
15237   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
15238
15239
15240 for file in $internal_makefile_list; do
15241   test "$file" = src/Makefile.in && \
15242     file="src/Makefile.in:src/Makefile.in.in:src/depend"
15243   ac_output_files="$ac_output_files $file" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$file\" to \$ac_output_files"; fi
15244 done
15245 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
15246 test "$with_modules" = "yes" && ac_output_files="$ac_output_files lib-src/ellcc.h" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src/ellcc.h\" to \$ac_output_files"; fi
15247
15248 trap '' 1 2 15
15249
15250 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
15251
15252 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15253 # Let make expand exec_prefix.
15254 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15255
15256 # Any assignment to VPATH causes Sun make to only execute
15257 # the first set of double-colon rules, so remove it if not needed.
15258 # If there is a colon in the path, we need to keep it.
15259 if test "x$srcdir" = x.; then
15260   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
15261 fi
15262
15263 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
15264
15265 DEFS=-DHAVE_CONFIG_H
15266
15267 # Without the "./", some shells look in PATH for config.status.
15268 : ${CONFIG_STATUS=./config.status}
15269
15270 echo creating $CONFIG_STATUS
15271 rm -f $CONFIG_STATUS
15272 cat > $CONFIG_STATUS <<EOF
15273 #! /bin/sh
15274 # Generated automatically by configure.
15275 # Run this file to recreate the current configuration.
15276 # This directory was configured as follows,
15277 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
15278 #
15279 # $0 $ac_configure_args
15280 #
15281 # Compiler output produced by configure, useful for debugging
15282 # configure, is in ./config.log if it exists.
15283
15284 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
15285 for ac_option
15286 do
15287   case "\$ac_option" in
15288   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15289     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
15290     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
15291   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
15292     echo "$CONFIG_STATUS generated by autoconf version 2.13"
15293     exit 0 ;;
15294   -help | --help | --hel | --he | --h)
15295     echo "\$ac_cs_usage"; exit 0 ;;
15296   *) echo "\$ac_cs_usage"; exit 1 ;;
15297   esac
15298 done
15299
15300 ac_given_srcdir=$srcdir
15301 ac_given_INSTALL="$INSTALL"
15302
15303 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
15304 EOF
15305 cat >> $CONFIG_STATUS <<EOF
15306
15307 # Protect against being on the right side of a sed subst in config.status.
15308 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
15309  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
15310 $ac_vpsub
15311 $extrasub
15312 s%@SHELL@%$SHELL%g
15313 s%@CFLAGS@%$CFLAGS%g
15314 s%@CPPFLAGS@%$CPPFLAGS%g
15315 s%@CXXFLAGS@%$CXXFLAGS%g
15316 s%@FFLAGS@%$FFLAGS%g
15317 s%@DEFS@%$DEFS%g
15318 s%@LDFLAGS@%$LDFLAGS%g
15319 s%@LIBS@%$LIBS%g
15320 s%@exec_prefix@%$exec_prefix%g
15321 s%@prefix@%$prefix%g
15322 s%@program_transform_name@%$program_transform_name%g
15323 s%@bindir@%$bindir%g
15324 s%@sbindir@%$sbindir%g
15325 s%@libexecdir@%$libexecdir%g
15326 s%@datadir@%$datadir%g
15327 s%@sysconfdir@%$sysconfdir%g
15328 s%@sharedstatedir@%$sharedstatedir%g
15329 s%@localstatedir@%$localstatedir%g
15330 s%@libdir@%$libdir%g
15331 s%@includedir@%$includedir%g
15332 s%@oldincludedir@%$oldincludedir%g
15333 s%@infodir@%$infodir%g
15334 s%@mandir@%$mandir%g
15335 s%@LN_S@%$LN_S%g
15336 s%@blddir@%$blddir%g
15337 s%@CC@%$CC%g
15338 s%@CPP@%$CPP%g
15339 s%@start_flags@%$start_flags%g
15340 s%@ld_switch_shared@%$ld_switch_shared%g
15341 s%@start_files@%$start_files%g
15342 s%@ld@%$ld%g
15343 s%@lib_gcc@%$lib_gcc%g
15344 s%@RANLIB@%$RANLIB%g
15345 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
15346 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
15347 s%@INSTALL_DATA@%$INSTALL_DATA%g
15348 s%@YACC@%$YACC%g
15349 s%@SET_MAKE@%$SET_MAKE%g
15350 s%@X_CFLAGS@%$X_CFLAGS%g
15351 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
15352 s%@X_LIBS@%$X_LIBS%g
15353 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
15354 s%@install_pp@%$install_pp%g
15355 s%@libs_xauth@%$libs_xauth%g
15356 s%@dnd_objs@%$dnd_objs%g
15357 s%@lwlib_objs@%$lwlib_objs%g
15358 s%@ALLOCA@%$ALLOCA%g
15359 s%@have_esd_config@%$have_esd_config%g
15360 s%@dll_ld@%$dll_ld%g
15361 s%@dll_cflags@%$dll_cflags%g
15362 s%@dll_ldflags@%$dll_ldflags%g
15363 s%@dll_post@%$dll_post%g
15364 s%@dll_ldo@%$dll_ldo%g
15365 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
15366 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
15367 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
15368 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
15369 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
15370 s%@PROGNAME@%$PROGNAME%g
15371 s%@version@%$version%g
15372 s%@configuration@%$configuration%g
15373 s%@canonical@%$canonical%g
15374 s%@inststaticdir@%$inststaticdir%g
15375 s%@instvardir@%$instvardir%g
15376 s%@srcdir@%$srcdir%g
15377 s%@pkgdir@%$pkgdir%g
15378 s%@statedir@%$statedir%g
15379 s%@extra_includes@%$extra_includes%g
15380 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
15381 s%@PREFIX@%$PREFIX%g
15382 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
15383 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
15384 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
15385 s%@INFODIR@%$INFODIR%g
15386 s%@infopath@%$infopath%g
15387 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
15388 s%@INFOPATH@%$INFOPATH%g
15389 s%@package_path@%$package_path%g
15390 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
15391 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
15392 s%@lispdir@%$lispdir%g
15393 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
15394 s%@LISPDIR@%$LISPDIR%g
15395 s%@moduledir@%$moduledir%g
15396 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
15397 s%@MODULEDIR@%$MODULEDIR%g
15398 s%@sitelispdir@%$sitelispdir%g
15399 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
15400 s%@SITELISPDIR@%$SITELISPDIR%g
15401 s%@sitemoduledir@%$sitemoduledir%g
15402 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
15403 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
15404 s%@etcdir@%$etcdir%g
15405 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
15406 s%@ETCDIR@%$ETCDIR%g
15407 s%@docdir@%$docdir%g
15408 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
15409 s%@DOCDIR@%$DOCDIR%g
15410 s%@archlibdir@%$archlibdir%g
15411 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
15412 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
15413 s%@bitmapdir@%$bitmapdir%g
15414 s%@extra_objs@%$extra_objs%g
15415 s%@machfile@%$machfile%g
15416 s%@opsysfile@%$opsysfile%g
15417 s%@c_switch_general@%$c_switch_general%g
15418 s%@c_switch_window_system@%$c_switch_window_system%g
15419 s%@c_switch_all@%$c_switch_all%g
15420 s%@ld_switch_general@%$ld_switch_general%g
15421 s%@ld_switch_window_system@%$ld_switch_window_system%g
15422 s%@ld_switch_all@%$ld_switch_all%g
15423 s%@ld_libs_general@%$ld_libs_general%g
15424 s%@ld_libs_window_system@%$ld_libs_window_system%g
15425 s%@ld_libs_all@%$ld_libs_all%g
15426 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
15427 s%@native_sound_lib@%$native_sound_lib%g
15428 s%@sound_cflags@%$sound_cflags%g
15429 s%@dynodump_arch@%$dynodump_arch%g
15430 s%@XEMACS_CC@%$XEMACS_CC%g
15431 s%@internal_makefile_list@%$internal_makefile_list%g
15432
15433 CEOF
15434 EOF
15435
15436 cat >> $CONFIG_STATUS <<\EOF
15437
15438 # Split the substitutions into bite-sized pieces for seds with
15439 # small command number limits, like on Digital OSF/1 and HP-UX.
15440 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
15441 ac_file=1 # Number of current file.
15442 ac_beg=1 # First line for current file.
15443 ac_end=$ac_max_sed_cmds # Line after last line for current file.
15444 ac_more_lines=:
15445 ac_sed_cmds=""
15446 while $ac_more_lines; do
15447   if test $ac_beg -gt 1; then
15448     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
15449   else
15450     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
15451   fi
15452   if test ! -s conftest.s$ac_file; then
15453     ac_more_lines=false
15454     rm -f conftest.s$ac_file
15455   else
15456     if test -z "$ac_sed_cmds"; then
15457       ac_sed_cmds="sed -f conftest.s$ac_file"
15458     else
15459       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
15460     fi
15461     ac_file=`expr $ac_file + 1`
15462     ac_beg=$ac_end
15463     ac_end=`expr $ac_end + $ac_max_sed_cmds`
15464   fi
15465 done
15466 if test -z "$ac_sed_cmds"; then
15467   ac_sed_cmds=cat
15468 fi
15469 EOF
15470
15471 cat >> $CONFIG_STATUS <<EOF
15472
15473 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
15474 EOF
15475 cat >> $CONFIG_STATUS <<\EOF
15476 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
15477   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15478   case "$ac_file" in
15479   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
15480        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
15481   *) ac_file_in="${ac_file}.in" ;;
15482   esac
15483
15484   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
15485
15486   # Remove last slash and all that follows it.  Not all systems have dirname.
15487   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15488   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15489     # The file is in a subdirectory.
15490     test ! -d "$ac_dir" && mkdir "$ac_dir"
15491     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
15492     # A "../" for each directory in $ac_dir_suffix.
15493     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
15494   else
15495     ac_dir_suffix= ac_dots=
15496   fi
15497
15498   case "$ac_given_srcdir" in
15499   .)  srcdir=.
15500       if test -z "$ac_dots"; then top_srcdir=.
15501       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
15502   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
15503   *) # Relative path.
15504     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
15505     top_srcdir="$ac_dots$ac_given_srcdir" ;;
15506   esac
15507
15508   case "$ac_given_INSTALL" in
15509   [/$]*) INSTALL="$ac_given_INSTALL" ;;
15510   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
15511   esac
15512
15513   echo creating "$ac_file"
15514   rm -f "$ac_file"
15515   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
15516   case "$ac_file" in
15517   *Makefile*) ac_comsub="1i\\
15518 # $configure_input" ;;
15519   *) ac_comsub= ;;
15520   esac
15521
15522   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
15523   sed -e "$ac_comsub
15524 s%@configure_input@%$configure_input%g
15525 s%@srcdir@%$srcdir%g
15526 s%@top_srcdir@%$top_srcdir%g
15527 s%@INSTALL@%$INSTALL%g
15528 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
15529 fi; done
15530 rm -f conftest.s*
15531
15532 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15533 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15534 #
15535 # ac_d sets the value in "#define NAME VALUE" lines.
15536 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15537 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
15538 ac_dC='\3'
15539 ac_dD='%g'
15540 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15541 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15542 ac_uB='\([      ]\)%\1#\2define\3'
15543 ac_uC=' '
15544 ac_uD='\4%g'
15545 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15546 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15547 ac_eB='$%\1#\2define\3'
15548 ac_eC=' '
15549 ac_eD='%g'
15550
15551 if test "${CONFIG_HEADERS+set}" != set; then
15552 EOF
15553 cat >> $CONFIG_STATUS <<EOF
15554   CONFIG_HEADERS="src/config.h lwlib/config.h"
15555 EOF
15556 cat >> $CONFIG_STATUS <<\EOF
15557 fi
15558 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
15559   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15560   case "$ac_file" in
15561   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
15562        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
15563   *) ac_file_in="${ac_file}.in" ;;
15564   esac
15565
15566   echo creating $ac_file
15567
15568   rm -f conftest.frag conftest.in conftest.out
15569   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
15570   cat $ac_file_inputs > conftest.in
15571
15572 EOF
15573
15574 # Transform confdefs.h into a sed script conftest.vals that substitutes
15575 # the proper values into config.h.in to produce config.h.  And first:
15576 # Protect against being on the right side of a sed subst in config.status.
15577 # Protect against being in an unquoted here document in config.status.
15578 rm -f conftest.vals
15579 cat > conftest.hdr <<\EOF
15580 s/[\\&%]/\\&/g
15581 s%[\\$`]%\\&%g
15582 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
15583 s%ac_d%ac_u%gp
15584 s%ac_u%ac_e%gp
15585 EOF
15586 sed -n -f conftest.hdr confdefs.h > conftest.vals
15587 rm -f conftest.hdr
15588
15589 # This sed command replaces #undef with comments.  This is necessary, for
15590 # example, in the case of _POSIX_SOURCE, which is predefined and required
15591 # on some systems where configure will not decide to define it.
15592 cat >> conftest.vals <<\EOF
15593 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
15594 EOF
15595
15596 # Break up conftest.vals because some shells have a limit on
15597 # the size of here documents, and old seds have small limits too.
15598
15599 rm -f conftest.tail
15600 while :
15601 do
15602   ac_lines=`grep -c . conftest.vals`
15603   # grep -c gives empty output for an empty file on some AIX systems.
15604   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
15605   # Write a limited-size here document to conftest.frag.
15606   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
15607   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
15608   echo 'CEOF
15609   sed -f conftest.frag conftest.in > conftest.out
15610   rm -f conftest.in
15611   mv conftest.out conftest.in
15612 ' >> $CONFIG_STATUS
15613   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15614   rm -f conftest.vals
15615   mv conftest.tail conftest.vals
15616 done
15617 rm -f conftest.vals
15618
15619 cat >> $CONFIG_STATUS <<\EOF
15620   rm -f conftest.frag conftest.h
15621   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15622   cat conftest.in >> conftest.h
15623   rm -f conftest.in
15624   if cmp -s $ac_file conftest.h 2>/dev/null; then
15625     echo "$ac_file is unchanged"
15626     rm -f conftest.h
15627   else
15628     # Remove last slash and all that follows it.  Not all systems have dirname.
15629       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15630       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15631       # The file is in a subdirectory.
15632       test ! -d "$ac_dir" && mkdir "$ac_dir"
15633     fi
15634     rm -f $ac_file
15635     mv conftest.h $ac_file
15636   fi
15637 fi; done
15638
15639 EOF
15640 cat >> $CONFIG_STATUS <<EOF
15641 CPP="$CPP"
15642  top_srcdir="$srcdir"
15643  MAKE_SUBDIR="$MAKE_SUBDIR"
15644
15645 EOF
15646 cat >> $CONFIG_STATUS <<\EOF
15647 for dir in . $MAKE_SUBDIR; do
15648   (
15649     cd $dir
15650     rm -f junk.c
15651     < Makefile.in \
15652       sed -e '/^# Generated/d' \
15653           -e 's%/\*\*/#.*%%' \
15654           -e 's/^ *# */#/' \
15655           -e '/^##/d' \
15656           -e '/^#/ {
15657 p
15658 d
15659 }'        \
15660           -e '/./ {
15661 s/\([\"]\)/\\\1/g
15662 s/^/"/
15663 s/$/"/
15664 }'  > junk.c;
15665
15666
15667
15668     echo creating $dir/Makefile
15669 $CPP -I. -I${top_srcdir}/src  junk.c \
15670   | sed -e 's/^\#.*//'          \
15671         -e 's/^[        ][      ]*$//'\
15672         -e 's/^ /       /'              \
15673         -e '/^[ \f]*$/d' \
15674         -e '/^\"/ {
15675         s/\\\([\"]\)/\1/g
15676         s/^[    ]*\"//
15677         s/\"[   ]*$//
15678 }' > Makefile.new
15679     chmod 444 Makefile.new
15680     mv -f Makefile.new Makefile
15681
15682     echo creating $dir/GNUmakefile
15683 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
15684   | sed -e 's/^\#.*//'          \
15685         -e 's/^[        ][      ]*$//'\
15686         -e 's/^ /       /'              \
15687         -e '/^[ \f]*$/d' \
15688         -e '/^\"/ {
15689         s/\\\([\"]\)/\1/g
15690         s/^[    ]*\"//
15691         s/\"[   ]*$//
15692 }' > Makefile.new
15693     chmod 444 Makefile.new
15694     mv -f Makefile.new GNUmakefile
15695
15696     rm -f junk.c
15697   )
15698 done
15699
15700 sed < config.status >> lib-src/config.values \
15701   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
15702   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
15703   -e 's/^\([^ ]*\) $/\1 ""/' \
15704   -e 's/ 1$/ t/'
15705
15706
15707 exit 0
15708 EOF
15709 chmod +x $CONFIG_STATUS
15710 rm -fr confdefs* $ac_clean_files
15711 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1