Sync up with r21-2-44.
[chise/xemacs-chise.git-] / 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, 93, 94, 95, 96 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) 1998, 1999 J. Kean Johnston.
11
12 ### Don't edit this script!
13 ### This script was automatically generated by the `autoconf' program
14 ### from the file `./configure.in'.
15 ### To rebuild it, execute the command
16 ###     autoconf
17 ### in the this directory.  You must have autoconf version 2.13 or later.
18
19 ### This file is part of XEmacs.
20
21 ### XEmacs is free software; you can redistribute it and/or modify it
22 ### under the terms of the GNU General Public License as published by
23 ### the Free Software Foundation; either version 2, or (at your
24 ### option) any later version.
25
26 ### XEmacs is distributed in the hope that it will be useful, but
27 ### WITHOUT ANY WARRANTY; without even the implied warranty of
28 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29 ### General Public License for more details.
30
31 ### You should have received a copy of the GNU General Public License
32 ### along with XEmacs; see the file COPYING.  If not, write to the Free
33 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 ### 02111-1307, USA.
35
36 ### For usage, run `./configure --help'
37 ### For more detailed information on building and installing XEmacs,
38 ### read the file `INSTALL'.
39 ###
40 ### If configure succeeds, it leaves its status in config.status.
41 ### A log of configuration tests can be found in config.log.
42 ### If configure fails after disturbing the status quo,
43 ###     config.status is removed.
44
45 ac_help="$ac_help
46   --with-x                use the X Window System"
47
48
49
50 if test -n "$ZSH_VERSION"; then
51     setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
52   setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
53   setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
54   setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
55       if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
56 elif test -n "$BASH_VERSION"; then
57     set -o posix
58   unset CDPATH
59 else
60   if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
61 fi
62
63 exec_prefix=NONE
64 host=NONE
65 no_create=
66 nonopt=NONE
67 no_recursion=
68 prefix=NONE
69 program_prefix=NONE
70 program_suffix=NONE
71 program_transform_name=s,x,x,
72 silent=
73 site=
74 srcdir=
75 target=NONE
76 verbose=
77 x_includes=NONE
78 x_libraries=NONE
79
80 subdirs=
81 MFLAGS= MAKEFLAGS=
82 SHELL=${CONFIG_SHELL-/bin/sh}
83 ac_max_here_lines=12
84
85 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
86
87 # File descriptor usage:
88 # 0 standard input
89 # 1 file creation
90 # 2 errors and warnings
91 # 3 some systems may open it to /dev/tty
92 # 4 used on the Kubota Titan
93 # 6 checking for... messages and results
94 # 5 compiler messages saved in config.log
95 if test "$silent" = yes; then
96   exec 6>/dev/null
97 else
98   exec 6>&1
99 fi
100 exec 5>./config.log
101
102 echo "\
103 This file contains any messages produced by compilers while
104 running configure, to aid debugging if configure makes a mistake.
105 " 1>&5
106
107 # Strip out --no-create and --no-recursion so they do not pile up.
108 # Also quote any args containing shell metacharacters.
109 ac_configure_args=
110 for ac_arg
111 do
112   case "$ac_arg" in
113   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
114   | --no-cr | --no-c) ;;
115   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
116   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
117   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
118   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
119   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
120   esac
121 done
122
123 # NLS nuisances.
124 # Only set these to C if already set.  These must not be set unconditionally
125 # because not all systems understand e.g. LANG=C (notably SCO).
126 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
127 # Non-C LC_CTYPE values break the ctype check.
128 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
129 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
130 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
131 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
132
133 # confdefs.h avoids OS command line length limits that DEFS can exceed.
134 rm -rf conftest* confdefs.h
135 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
136 echo > confdefs.h
137
138 # A filename unique to this package, relative to the directory that
139 # configure is in, which we can look for to find out if srcdir is correct.
140 ac_unique_file=src/lisp.h
141
142 # Find the source files, if location was not specified.
143 if test -z "$srcdir"; then
144   ac_srcdir_defaulted=yes
145   # Try the directory containing this script, then its parent.
146   ac_prog=$0
147   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
148   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
149   srcdir=$ac_confdir
150   if test ! -r $srcdir/$ac_unique_file; then
151     srcdir=..
152   fi
153 else
154   ac_srcdir_defaulted=no
155 fi
156 if test ! -r $srcdir/$ac_unique_file; then
157   if test "$ac_srcdir_defaulted" = yes; then
158     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
159   else
160     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
161   fi
162 fi
163 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
164
165 # Prefer explicitly selected file to automatically selected ones.
166 if test -z "$CONFIG_SITE"; then
167   if test "x$prefix" != xNONE; then
168     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
169   else
170     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
171   fi
172 fi
173 for ac_site_file in $CONFIG_SITE; do
174   if test -r "$ac_site_file"; then
175     echo "loading site script $ac_site_file"
176     . "$ac_site_file"
177   fi
178 done
179
180
181 ac_ext=c
182 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
183 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
184 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
185 ac_cpp='$CPP '"$xe_cppflags"
186 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
187 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
188 cross_compiling=no
189
190 ac_exeext=
191 ac_objext=o
192 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
193   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
194   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
195     ac_n= ac_c='
196 ' ac_t='        '
197   else
198     ac_n=-n ac_c= ac_t=
199   fi
200 else
201   ac_n= ac_c='\c' ac_t=
202 fi
203
204
205 progname="`echo $0 | sed 's:^\./\./:\./:'`"
206
207
208 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
209 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
210
211 prefix='/usr/local'
212 exec_prefix='${prefix}'
213 bindir='${exec_prefix}/bin'
214 datadir='${prefix}/lib'
215 statedir='${prefix}/lib'
216 libdir='${exec_prefix}/lib'
217 mandir='${prefix}/man/man1'
218 inststaticdir='${PROGNAME}'
219 instvardir='${PROGNAME}-${version}'
220 infodir='${datadir}/${instvardir}/info'
221 infopath=''
222 install_pp=''
223 lispdir='${datadir}/${instvardir}/lisp'
224 moduledir='${datadir}/${instvardir}/${configuration}/modules'
225 sitelispdir='${datadir}/${inststaticdir}/site-lisp'
226 sitemoduledir='${datadir}/${inststaticdir}/site-modules'
227 pkgdir='${datadir}/${instvardir}/lisp'
228 package_path=''
229 etcdir='${datadir}/${instvardir}/etc'
230 archlibdir='${datadir}/${instvardir}/${configuration}'
231 docdir='${archlibdir}'
232 with_prefix='yes'
233 with_site_lisp='no'
234 with_site_modules='yes'
235 with_menubars=''
236 with_scrollbars=''
237 with_widgets=''
238 with_dialogs=''
239 with_file_coding=''
240 cpp='' cppflags='' libs='' ldflags=''
241 extra_includes=''
242 dynamic=''
243 with_x11=''
244 with_msw=''
245 rel_alloc='default'
246 with_system_malloc='default'
247 with_dlmalloc='default'
248 native_sound_lib=''
249 use_assertions="yes"
250 with_toolbars=""
251 with_tty=""
252 use_union_type="no"
253 with_dnet=""
254 pdump="no"
255 with_dragndrop="no"
256
257
258
259
260 arguments="$@"
261
262 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
263 quoted_arguments=
264 for i in "$@"; do
265    case "$i" in
266    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
267    | --no-cr | --no-c) ;;
268    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
269    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
270    *)
271    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
272    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
273    esac
274 done
275
276 while test $# != 0; do
277   arg="$1"; shift
278   case "$arg" in
279     --no-create|--no-recursion) ;;
280         -* )
281             case "$arg" in
282         -*=*)
283           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
284           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
285           valomitted=no
286         ;;
287                                                                           -*)
288                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
289           val="yes" valomitted=yes
290         ;;
291       esac
292
293             optname="$opt"
294       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
295
296             case "${valomitted}-${opt}" in yes-without_* )
297         opt=`echo $opt | sed 's/without/with/'`
298         valomitted="no" val="no" ;;
299       esac
300
301             case "$opt" in
302
303         with_site_lisp  | \
304         with_prefix     | \
305         with_site_modules | \
306         with_x          | \
307         with_x11        | \
308         with_msw        | \
309         with_gcc        | \
310         dynamic         | \
311         with_ncurses    | \
312         with_dnet       | \
313         with_socks      | \
314         with_dragndrop  | \
315         with_cde        | \
316         with_offix      | \
317         with_gpm        | \
318         with_xpm        | \
319         with_xface      | \
320         with_gif        | \
321         with_jpeg       | \
322         with_png        | \
323         with_tiff       | \
324         with_wmcommand  | \
325         with_xmu        | \
326         with_purify     | \
327         with_quantify   | \
328         with_toolbars   | \
329         with_tty        | \
330         with_xfs        | \
331         with_i18n3      | \
332         with_mule       | \
333         with_utf_2000   | \
334         with_text_coding| \
335         with_file_coding| \
336         with_canna      | \
337         with_wnn        | \
338         with_wnn6       | \
339         with_workshop   | \
340         with_sparcworks | \
341         with_tooltalk   | \
342         with_ldap       | \
343         with_postgresql | \
344         with_pop        | \
345         with_kerberos   | \
346         with_hesiod     | \
347         with_dnet       | \
348         with_infodock   | \
349         external_widget | \
350         verbose         | \
351         extra_verbose   | \
352         usage_tracking  | \
353         use_union_type  | \
354         pdump           | \
355         debug           | \
356         use_assertions  | \
357         memory_usage_stats | \
358         with_clash_detection | \
359         with_modules | \
360         quick_build )
361                   case "$val" in
362             y | ye | yes )      val=yes ;;
363             n | no )            val=no  ;;
364             * ) (echo "$progname: Usage error:"
365 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
366 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
367           esac
368           eval "$opt=\"$val\"" ;;
369
370
371                         srcdir          | \
372         compiler        | \
373         cflags          | \
374         cpp             | \
375         cppflags        | \
376         libs            | \
377         ldflags         | \
378         cache_file      | \
379         native_sound_lib| \
380         site_lisp       | \
381         x_includes      | \
382         x_libraries     | \
383         site_includes   | \
384         site_libraries  | \
385         site_prefixes   | \
386         site_runtime_libraries )
387                   if test "$valomitted" = "yes" ; then
388                     if test "$#" = 0 ; then
389               (echo "$progname: Usage error:"
390 echo " " "The \`--$optname' option requires a value."
391 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
392             fi
393             val="$1"; shift
394           fi
395           eval "$opt=\"$val\""
396         ;;
397
398                 rel_alloc | \
399         with_dlmalloc | \
400         with_debug_malloc  | use_debug_malloc | \
401         with_system_malloc | use_system_malloc )
402           case "$val" in
403             y | ye | yes )      val=yes ;;
404             n | no )            val=no  ;;
405             d | de | def | defa | defau | defaul | default ) val=default ;;
406             * ) (echo "$progname: Usage error:"
407 echo " " "The \`--$optname' option requires one of these values:
408   \`yes', \`no', or \`default'."
409 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
410           esac
411           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
412           eval "$opt=\"$val\""
413         ;;
414
415                 "with_database" )
416           with_database_berkdb=no
417           with_database_dbm=no
418           with_database_gdbm=no
419           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
420             case "$x" in
421               no ) ;;
422               b | be | ber | berk | berkd | berkdb )       with_database_berkdb=yes ;;
423               d | db | dbm )                               with_database_dbm=yes    ;;
424               g | gn | gnu | gnud | gnudb | gnudbm | gdbm) with_database_gdbm=yes   ;;
425               * ) (echo "$progname: Usage error:"
426 echo " " "The \`--$optname' option value
427   must be either \`no' or a comma-separated list
428   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
429 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
430             esac
431           done
432           if test "$with_database_dbm"  = "yes" -a \
433                   "$with_database_gdbm" = "yes"; then
434           (echo "$progname: Usage error:"
435 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
436   with the \`--$optname' option."
437 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
438           fi
439         ;;
440
441                 "with_sound" )
442                           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
443             case "$x" in
444                       n | no | non | none ) new_sdefault=no ;;
445               a | al | all | both ) new_sdefault=yes ;;
446
447               native )       with_native_sound=yes ;;
448               nonative )     with_native_sound=no ;;
449
450               nas )          with_nas_sound=yes ;;
451               nonas )        with_nas_sound=no ;;
452
453               esd )          with_esd_sound=yes ;;
454               noesd )        with_esd_sound=no ;;
455
456               * ) bogus_sound=yes ;;
457             esac
458             if test "$bogus_sound" -o \
459                  \( -n "$new_sdefault" -a -n "$sound_notfirst" \) ; then
460                 types="\`all', \`none', \`(no)native', \`no(nas)', \`(no)esd'."
461                 (echo "$progname: Usage error:"
462 echo " " "Valid types for the \`--$optname' option are:
463   $types.
464 The default is to autodetect all sound support."
465 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
466             elif test -n "$new_sdefault" ; then
467                 with_native_sound=$new_sdefault
468                 with_nas_sound=$new_sdefault
469                 with_esd_sound=$new_sdefault
470                 new_sdefault=   # reset this
471             fi
472             sound_notfirst=true
473           done
474         ;;
475
476                         "with_athena" )
477           case "$val" in
478             xa | xaw )                    val=xaw    ;;
479             3 | 3d | xaw3d )              val=3d     ;;
480                         ne | nex | next | naxtaw)     val=next   ;;
481                         9 | 95 | xaw95 )              val=95     ;;
482             xp | xpm | xawxpm )           val=xpm    ;;
483             * ) (echo "$progname: Usage error:"
484 echo " " "The \`--$optname' option must have one of these values:
485   \`xaw', \`3d', \`next', \`95', or \`xpm'."
486 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
487           esac
488           eval "$opt=\"$val\""
489         ;;
490
491                 "with_xim" )
492           case "$val" in
493             y | ye | yes )                val=yes   ;;
494             n | no | non | none )         val=no    ;;
495             x | xl | xli | xlib )         val=xlib  ;;
496             m | mo | mot | moti | motif ) val=motif ;;
497             * ) (echo "$progname: Usage error:"
498 echo " " "The \`--$optname' option must have one of these values:
499   \`motif', \`xlib', \`yes', or \`no'."
500 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
501           esac
502           eval "$opt=\"$val\""
503         ;;
504
505                 "mail_locking" )
506           case "$val" in
507             lockf )     val=lockf ;;
508             flock )     val=flock ;;
509             file | dot ) val=file  ;;
510             locking )   val=locking  ;;
511             * ) (echo "$progname: Usage error:"
512 echo " " "The \`--$optname' option must have one of these values:
513   \`lockf', \`flock', \`file', \`locking', or \`mmdf'."
514 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
515           esac
516           eval "$opt=\"$val\""
517         ;;
518
519                 "error_checking" )
520                           
521           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
522             case "$x" in
523                       n | no | non | none ) new_default=no ;;
524               a | al | all )        new_default=yes ;;
525
526               extents )       error_check_extents=yes ;;
527               noextents )     error_check_extents=no ;;
528
529               typecheck )     error_check_typecheck=yes ;;
530               notypecheck )   error_check_typecheck=no ;;
531
532               bufpos )        error_check_bufpos=yes ;;
533               nobufpos )      error_check_bufpos=no ;;
534
535               gc )            error_check_gc=yes ;;
536               nogc )          error_check_gc=no ;;
537
538               malloc )        error_check_malloc=yes ;;
539               nomalloc )      error_check_malloc=no ;;
540
541               byte_code )     error_check_byte_code=yes ;;
542               nobyte_code )   error_check_byte_code=no ;;
543
544               glyphs )     error_check_glyphs=yes ;;
545               noglyphs )   error_check_glyphs=no ;;
546
547               * ) bogus_error_check=yes ;;
548             esac
549             if test "$bogus_error_check" -o \
550                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
551                 if test "$error_check_default" = yes ; then
552                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', \`noglyphs' and \`nobyte-code'."
553                 else
554                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'."
555                 fi
556                 (echo "$progname: Usage error:"
557 echo " " "Valid types for the \`--$optname' option are:
558   $types."
559 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
560             elif test -n "$new_default" ; then
561                 error_check_extents=$new_default
562                 error_check_typecheck=$new_default
563                 error_check_bufpos=$new_default
564                 error_check_gc=$new_default
565                 error_check_malloc=$new_default
566                 error_check_byte_code=$new_default
567                 error_check_glyphs=$new_default
568                 new_default=    # reset this
569             fi
570             echeck_notfirst=true
571           done
572         ;;
573
574                                 
575                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
576         mandir | infodir | infopath | lispdir | etcdir | pkgdir | \
577         archlibdir | docdir | package_path )
578                    if test "$valomitted" = "yes"; then
579              if test "$#" = 0; then
580                  (echo "$progname: Usage error:"
581 echo " " "The \`--$optname' option requires a value."
582 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
583              fi
584              val="$1"; shift
585            fi
586            eval "$opt=\"$val\""
587
588                            case "$opt" in
589                      exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
590     Defining EXEC_PREFIX_USER_DEFINED
591 EOF
592 cat >> confdefs.h <<\EOF
593 #define EXEC_PREFIX_USER_DEFINED 1
594 EOF
595 }
596  ;;
597              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
598     Defining LISPDIR_USER_DEFINED
599 EOF
600 cat >> confdefs.h <<\EOF
601 #define LISPDIR_USER_DEFINED 1
602 EOF
603 }
604  ;;
605              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
606     Defining SITELISPDIR_USER_DEFINED
607 EOF
608 cat >> confdefs.h <<\EOF
609 #define SITELISPDIR_USER_DEFINED 1
610 EOF
611 }
612  ;;
613              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
614     Defining MODULEDIR_USER_DEFINED
615 EOF
616 cat >> confdefs.h <<\EOF
617 #define MODULEDIR_USER_DEFINED 1
618 EOF
619 }
620  ;;
621              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
622     Defining ETCDIR_USER_DEFINED
623 EOF
624 cat >> confdefs.h <<\EOF
625 #define ETCDIR_USER_DEFINED 1
626 EOF
627 }
628  ;;
629              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
630     Defining INFODIR_USER_DEFINED
631 EOF
632 cat >> confdefs.h <<\EOF
633 #define INFODIR_USER_DEFINED 1
634 EOF
635 }
636  ;;
637              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
638     Defining INFOPATH_USER_DEFINED
639 EOF
640 cat >> confdefs.h <<\EOF
641 #define INFOPATH_USER_DEFINED 1
642 EOF
643 }
644  ;;
645              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
646     Defining PACKAGE_PATH_USER_DEFINED
647 EOF
648 cat >> confdefs.h <<\EOF
649 #define PACKAGE_PATH_USER_DEFINED 1
650 EOF
651 }
652  ;;
653              datadir )
654                 { test "$extra_verbose" = "yes" && cat << \EOF
655     Defining INFODIR_USER_DEFINED
656 EOF
657 cat >> confdefs.h <<\EOF
658 #define INFODIR_USER_DEFINED 1
659 EOF
660 }
661
662                 { test "$extra_verbose" = "yes" && cat << \EOF
663     Defining LISPDIR_USER_DEFINED
664 EOF
665 cat >> confdefs.h <<\EOF
666 #define LISPDIR_USER_DEFINED 1
667 EOF
668 }
669
670                 { test "$extra_verbose" = "yes" && cat << \EOF
671     Defining MODULEDIR_USER_DEFINED
672 EOF
673 cat >> confdefs.h <<\EOF
674 #define MODULEDIR_USER_DEFINED 1
675 EOF
676 }
677
678                 { test "$extra_verbose" = "yes" && cat << \EOF
679     Defining ETCDIR_USER_DEFINED
680 EOF
681 cat >> confdefs.h <<\EOF
682 #define ETCDIR_USER_DEFINED 1
683 EOF
684 }
685
686                 { test "$extra_verbose" = "yes" && cat << \EOF
687     Defining DOCDIR_USER_DEFINED
688 EOF
689 cat >> confdefs.h <<\EOF
690 #define DOCDIR_USER_DEFINED 1
691 EOF
692 }
693
694                 { test "$extra_verbose" = "yes" && cat << \EOF
695     Defining ARCHLIBDIR_USER_DEFINED
696 EOF
697 cat >> confdefs.h <<\EOF
698 #define ARCHLIBDIR_USER_DEFINED 1
699 EOF
700 }
701  ;;
702              docdir ) { test "$extra_verbose" = "yes" && cat << \EOF
703     Defining DOCDIR_USER_DEFINED
704 EOF
705 cat >> confdefs.h <<\EOF
706 #define DOCDIR_USER_DEFINED 1
707 EOF
708 }
709  ;;
710              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
711     Defining ARCHLIBDIR_USER_DEFINED
712 EOF
713 cat >> confdefs.h <<\EOF
714 #define ARCHLIBDIR_USER_DEFINED 1
715 EOF
716 }
717  ;;
718            esac
719         ;;
720
721                 "no_create" ) ;;
722
723                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
724
725                 "with_menubars"   | \
726         "with_scrollbars" | \
727         "with_dialogs"    | \
728         "with_widgets" )
729           case "$val" in
730             l | lu | luc | luci | lucid )               val=lucid  ;;
731             m | mo | mot | moti | motif )               val=motif  ;;
732             a | at | ath | athe | athen | athena )      val=athena ;;
733             n | no | non | none )                       val=no     ;;
734             y | ye | yes )                              val=yes    ;;
735             m | ms | msw )                      val=msw    ;;
736             * ) (echo "$progname: Usage error:"
737 echo " " "The \`--$optname' option must have one of these values:
738   \`lucid', \`motif', \`athena', \`yes', or \`no'."
739 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
740           esac
741           eval "$opt=\"$val\""
742         ;;
743
744                 "use_minimal_tagbits" | \
745         "use_indexed_lrecord_implementation" | \
746         "run_in_place"  | \
747         "const_is_losing" | \
748         "with_gnu_make" )
749           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
750         ;;
751
752                 * ) (echo "$progname: Usage error:"
753 echo " " "Unrecognized option: $arg"
754 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
755
756       esac
757     ;;
758
759         *-*-*) configuration="$arg" ;;
760
761         *) (echo "$progname: Usage error:"
762 echo " " "Unrecognized argument: $arg"
763 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
764
765   esac
766 done
767
768
769 test -n "$cpp"      && CPP="$cpp"
770 test -n "$cppflags" && CPPFLAGS="$cppflags"
771 test -n "$libs"     && LIBS="$libs"
772 test -n "$ldflags"  && LDFLAGS="$ldflags"
773
774 eval set x "$quoted_arguments"; shift
775
776 test "$extra_verbose" = "yes" && verbose=yes
777
778 test -n "$with_x" && with_x11="$with_x"
779
780 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
781   test "$with_system_malloc" = "default" && with_system_malloc=yes
782 fi
783
784
785
786 if test "$with_cde $with_tooltalk" = "yes no"; then
787   (echo "$progname: Usage error:"
788 echo " " "--with-cde requires --with-tooltalk"
789 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
790 elif test "$with_tooltalk" = "no" ; then with_cde=no
791 elif test "$with_cde" = "yes"; then with_tooltalk=yes
792 fi
793
794
795 case "$srcdir" in
796
797     "" )
798     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
799       if test -f "$dir/src/lisp.h" -a \
800               -f "$dir/lisp/version.el" ; then
801         srcdir="$dir"
802         break
803       fi
804     done
805     if test -z "$srcdir" ; then
806       (echo "$progname: Usage error:"
807 echo " " "Neither the current directory nor its parent seem to
808   contain the XEmacs sources.  If you do not want to build XEmacs in its
809   source tree, you should run \`$progname' in the directory in which
810   you wish to build XEmacs, using the \`--srcdir' option to say where the
811   sources may be found."
812 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
813     fi
814   ;;
815
816     * )
817     if test ! -f "$srcdir/src/lisp.h" -o \
818             ! -f "$srcdir/lisp/version.el" ; then
819       (echo "$progname: Usage error:"
820 echo " " "The directory specified with the \`--srcdir' option,
821   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
822   either run the \`$progname' script at the top of the XEmacs source
823   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
824 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
825     fi
826   ;;
827 esac
828
829 if test -z "$configuration"; then
830     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
831   if test -z "$configuration"; then
832     (echo "$progname: Usage error:"
833 echo " " "XEmacs has not been ported to this host type.
834 Try explicitly specifying the CONFIGURATION when rerunning configure."
835 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
836   fi
837 fi
838
839 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
840 echo "configure:841: checking whether ln -s works" >&5
841
842 rm -f conftestdata
843 if ln -s X conftestdata 2>/dev/null
844 then
845   rm -f conftestdata
846   ac_cv_prog_LN_S="ln -s"
847 else
848   ac_cv_prog_LN_S=ln
849 fi
850 LN_S="$ac_cv_prog_LN_S"
851 if test "$ac_cv_prog_LN_S" = "ln -s"; then
852   echo "$ac_t""yes" 1>&6
853 else
854   echo "$ac_t""no" 1>&6
855 fi
856
857
858 for dir in lisp etc man info tests; do
859   if test ! -d "$dir" ; then
860     echo Making symbolic link to "$srcdir/$dir"
861     ${LN_S} "$srcdir/$dir" "$dir"
862   fi
863 done
864
865
866 absolute_pwd="`pwd`";
867 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
868 then blddir="$PWD"
869 else blddir="$absolute_pwd"; if test -d "/net"; then
870   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
871   blddir=`echo "$blddir" | \
872    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
873 fi
874 fi
875
876
877 case "$srcdir" in
878   /* ) ;;
879   .  ) srcdir="$blddir" ;;
880   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
881   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
882   srcdir=`echo "$srcdir" | \
883    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
884 fi ;;
885 esac
886
887 if test `pwd` != `sh -c cd $srcdir && pwd`  \
888    && test -f "$srcdir/src/config.h"; then
889   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
890    echo "   as a build directory right now; it has been configured in its own"
891    echo "   right.  To configure in another directory as well, you MUST"
892    echo "   use GNU make.  If you do not have GNU make, then you must"
893    echo "   now do \`make distclean' in $srcdir,"
894    echo "   and then run $progname again.") >&2
895   extrasub='/^VPATH[     ]*=/c\
896 vpath %.c $(srcdir)\
897 vpath %.h $(srcdir)\
898 vpath %.y $(srcdir)\
899 vpath %.l $(srcdir)\
900 vpath %.s $(srcdir)\
901 vpath %.in $(srcdir)'
902 fi
903
904 . "$srcdir/version.sh" || exit 1;
905 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
906 : "${extra_verbose=$beta}"
907 version="${emacs_major_version}.${emacs_minor_version}"
908 { test "$extra_verbose" = "yes" && cat << EOF
909     Defining EMACS_MAJOR_VERSION = $emacs_major_version
910 EOF
911 cat >> confdefs.h <<EOF
912 #define EMACS_MAJOR_VERSION $emacs_major_version
913 EOF
914 }
915
916 { test "$extra_verbose" = "yes" && cat << EOF
917     Defining EMACS_MINOR_VERSION = $emacs_minor_version
918 EOF
919 cat >> confdefs.h <<EOF
920 #define EMACS_MINOR_VERSION $emacs_minor_version
921 EOF
922 }
923
924 if test -n "$emacs_beta_version" ; then
925   if test "$beta" = "yes"; then
926         version="${version}-b${emacs_beta_version}"
927         { test "$extra_verbose" = "yes" && cat << EOF
928     Defining EMACS_BETA_VERSION = $emacs_beta_version
929 EOF
930 cat >> confdefs.h <<EOF
931 #define EMACS_BETA_VERSION $emacs_beta_version
932 EOF
933 }
934
935   else
936         version="${version}.${emacs_beta_version}"
937         { test "$extra_verbose" = "yes" && cat << EOF
938     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
939 EOF
940 cat >> confdefs.h <<EOF
941 #define EMACS_PATCH_LEVEL $emacs_beta_version
942 EOF
943 }
944
945   fi
946 fi
947 { test "$extra_verbose" = "yes" && cat << EOF
948     Defining XEMACS_CODENAME = "$xemacs_codename"
949 EOF
950 cat >> confdefs.h <<EOF
951 #define XEMACS_CODENAME "$xemacs_codename"
952 EOF
953 }
954
955 { test "$extra_verbose" = "yes" && cat << EOF
956     Defining EMACS_VERSION = "$version"
957 EOF
958 cat >> confdefs.h <<EOF
959 #define EMACS_VERSION "$version"
960 EOF
961 }
962
963
964 if test "$with_infodock" = "yes"; then
965   if test ! -f ../../ID-INSTALL; then
966     echo "Cannot build InfoDock without InfoDock sources"
967     with_infodock=no
968   fi
969 fi
970
971 if test "$with_infodock" = "yes"; then
972       { test "$extra_verbose" = "yes" && cat << EOF
973     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
974 EOF
975 cat >> confdefs.h <<EOF
976 #define INFODOCK_MAJOR_VERSION $infodock_major_version
977 EOF
978 }
979
980   { test "$extra_verbose" = "yes" && cat << EOF
981     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
982 EOF
983 cat >> confdefs.h <<EOF
984 #define INFODOCK_MINOR_VERSION $infodock_minor_version
985 EOF
986 }
987
988   { test "$extra_verbose" = "yes" && cat << EOF
989     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
990 EOF
991 cat >> confdefs.h <<EOF
992 #define INFODOCK_BUILD_VERSION $infodock_build_version
993 EOF
994 }
995
996   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
997   PROGNAME=infodock
998   CPPFLAGS="$CPPFLAGS -DINFODOCK"
999 else
1000   PROGNAME=xemacs
1001 fi
1002
1003 { test "$extra_verbose" = "yes" && cat << EOF
1004     Defining EMACS_PROGNAME = "$PROGNAME"
1005 EOF
1006 cat >> confdefs.h <<EOF
1007 #define EMACS_PROGNAME "$PROGNAME"
1008 EOF
1009 }
1010
1011
1012 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
1013 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1014     Defining ERROR_CHECK_EXTENTS
1015 EOF
1016 cat >> confdefs.h <<\EOF
1017 #define ERROR_CHECK_EXTENTS 1
1018 EOF
1019 }
1020
1021 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1022     Defining ERROR_CHECK_TYPECHECK
1023 EOF
1024 cat >> confdefs.h <<\EOF
1025 #define ERROR_CHECK_TYPECHECK 1
1026 EOF
1027 }
1028
1029 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1030     Defining ERROR_CHECK_BUFPOS
1031 EOF
1032 cat >> confdefs.h <<\EOF
1033 #define ERROR_CHECK_BUFPOS 1
1034 EOF
1035 }
1036
1037 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1038     Defining ERROR_CHECK_GC
1039 EOF
1040 cat >> confdefs.h <<\EOF
1041 #define ERROR_CHECK_GC 1
1042 EOF
1043 }
1044
1045 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1046     Defining ERROR_CHECK_MALLOC
1047 EOF
1048 cat >> confdefs.h <<\EOF
1049 #define ERROR_CHECK_MALLOC 1
1050 EOF
1051 }
1052
1053 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1054     Defining ERROR_CHECK_BYTE_CODE
1055 EOF
1056 cat >> confdefs.h <<\EOF
1057 #define ERROR_CHECK_BYTE_CODE 1
1058 EOF
1059 }
1060
1061 test "${error_check_glyphs=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1062     Defining ERROR_CHECK_GLYPHS
1063 EOF
1064 cat >> confdefs.h <<\EOF
1065 #define ERROR_CHECK_GLYPHS 1
1066 EOF
1067 }
1068
1069 if test "${debug:=$beta}" = "yes"; then
1070   use_assertions=yes memory_usage_stats=yes
1071   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
1072    echo "    xemacs will be linked with \"debug.o\""
1073  fi
1074   extra_objs="$extra_objs tests.o" &&  if test "$extra_verbose" = "yes"; then
1075    echo "    xemacs will be linked with \"tests.o\""
1076  fi
1077   { test "$extra_verbose" = "yes" && cat << \EOF
1078     Defining DEBUG_XEMACS
1079 EOF
1080 cat >> confdefs.h <<\EOF
1081 #define DEBUG_XEMACS 1
1082 EOF
1083 }
1084
1085 fi
1086 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1087     Defining USE_ASSERTIONS
1088 EOF
1089 cat >> confdefs.h <<\EOF
1090 #define USE_ASSERTIONS 1
1091 EOF
1092 }
1093
1094 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1095     Defining MEMORY_USAGE_STATS
1096 EOF
1097 cat >> confdefs.h <<\EOF
1098 #define MEMORY_USAGE_STATS 1
1099 EOF
1100 }
1101
1102
1103
1104 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1105 echo "configure:1106: checking "host system type"" >&5
1106 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1107 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1108 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1109 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1110 echo "$ac_t""$configuration" 1>&6
1111
1112
1113
1114
1115
1116 machine='' opsys=''
1117
1118 case "$canonical" in
1119   sparc-*-*        ) machine=sparc ;;
1120   alpha*-*-*       ) machine=alpha ;;
1121   vax-*-*          ) machine=vax ;;
1122   mips-dec-*       ) machine=pmax ;;
1123   mips-sgi-irix6*  ) machine=iris6d ;;
1124   mips-sgi-*       ) machine=iris4d ;;
1125   mips*-linux      ) machine=mips ;;
1126   romp-ibm-*       ) machine=ibmrt ;;
1127   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1128   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1129   powerpc*-*       ) machine=powerpc ;;
1130   hppa-*-*         ) machine=hp800 ;;
1131   m88k-dg-*        ) machine=aviion ;;
1132   m68*-sony-*      ) machine=news ;;
1133   mips-sony-*      ) machine=news-risc ;;
1134   clipper-*        ) machine=clipper ;;
1135   arm*             ) machine=arm ;;
1136   ns32k-*          ) machine=ns32000 ;;
1137 esac
1138
1139 case "$canonical" in
1140   *-*-linux*    ) opsys=linux ;;
1141   *-*-netbsd*   ) opsys=netbsd ;;
1142   *-*-openbsd*  ) opsys=openbsd ;;
1143   *-*-nextstep* ) opsys=nextstep ;;
1144   *-*-vms       ) opsys=vms ;;
1145
1146     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1147   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1148   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1149   *-dec-osf3*                ) opsys=decosf3-1 ;;
1150   *-dec-osf[4-9]*          ) opsys=decosf4-0 ;;
1151
1152     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1153   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1154   *-*-ultrix* )         opsys=ultrix4-3 ;;
1155
1156     *-*-aix3.1*  ) opsys=aix3-1 ;;
1157   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1158   *-*-aix3*    ) opsys=aix3-2   ;;
1159   *-*-aix4.0*  ) opsys=aix4     ;;
1160   *-*-aix4.1*  ) opsys=aix4-1   ;;
1161   *-*-aix4*    ) opsys=aix4-2   ;;
1162
1163     *-gnu* )                    opsys=gnu    ;;
1164   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1165   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1166   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1167   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1168   *-*-aos*   )                  opsys=bsd4-3 ;;
1169   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1170   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1171   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1172   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1173   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1174   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1175         if test -z "$NON_GNU_CPP" ; then
1176           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1177             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1178           done
1179         fi
1180         opsys=usg5-4-2 ;;
1181     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1182     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1183 esac
1184
1185 case "$canonical" in
1186
1187     *-*-netbsd* )
1188     case "$canonical" in
1189       i[3-9]86-*-netbsd*) machine=intel386 ;;
1190       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1191                                             machine=hp9000s300 ;;
1192       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1193       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1194     esac
1195   ;;
1196
1197     *-*-openbsd* )
1198     case "${canonical}" in
1199       i386-*-openbsd*)          machine=intel386 ;;
1200       m68k-*-openbsd*)          machine=hp9000s300 ;;
1201       mipsel-*-openbsd*)        machine=pmax ;;
1202      esac
1203    ;;
1204
1205     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1206   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1207
1208     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1209   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1210
1211     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1212
1213     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1214
1215     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1216
1217     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1218
1219     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1220
1221     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1222   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1223   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1224
1225   
1226     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1227
1228     *-convex-bsd* | *-convex-convexos* )
1229     machine=convex opsys=bsd4-3
1230     NON_GNU_CPP="cc -E -P"
1231   ;;
1232
1233     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1234
1235     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1236   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1237   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1238   m88k-dg-dgux*                           ) opsys=dgux     ;;
1239
1240     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1241   m88k-motorola-sysv4* )
1242                     machine=delta88k opsys=usg5-4-2
1243   ;;
1244   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1245
1246     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1247   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1248
1249     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1250
1251     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1252   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1253   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1254
1255       m88k-harris-cxux* )
1256         case "`uname -r`" in
1257        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1258        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1259     esac
1260     NON_GNU_CPP="/lib/cpp"
1261   ;;
1262     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1263     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1264
1265     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1266
1267     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1268
1269     *-hp-hpux* )
1270         case "$canonical" in
1271       m68*  ) machine=hp9000s300 ;;
1272       hppa* ) machine=hp800      ;;
1273     esac
1274
1275     case "$canonical" in
1276       *-hp-hpux7*  )  opsys=hpux   ;;
1277       *-hp-hpux8*  )  opsys=hpux8  ;;
1278       *-hp-hpux9*  )  opsys=hpux9  ;;
1279       *-hp-hpux10* )  opsys=hpux10 ;;
1280       *-hp-hpux11* )  opsys=hpux11 ;;
1281       *            )  opsys=hpux   ;;
1282     esac
1283
1284         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1285    echo "    xemacs will be linked with \"strcat.o\""
1286  fi ;; esac
1287
1288     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1289         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1290     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1291
1292     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1293   ;;
1294
1295     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1296   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1297
1298     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1299   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1300   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1301   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1302   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1303   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1304
1305     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1306   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1307
1308     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1309
1310     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1311
1312     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1313
1314     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1315
1316       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1317
1318     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1319
1320     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1321
1322     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1323
1324     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1325
1326         mips-mips-usg* ) machine=mips4 ;;
1327   mips-mips-riscos4 )
1328     machine=mips4
1329     NON_GNU_CC="cc -systype bsd43"
1330     NON_GNU_CPP="cc -systype bsd43 -E"
1331     case "$canonical" in
1332       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1333       mips-mips-riscos5* ) opsys=riscos5 ;;
1334     esac
1335   ;;
1336   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1337   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1338
1339     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1340
1341     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1342
1343     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1344   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1345
1346     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1347
1348     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1349
1350     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1351
1352     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1353
1354     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1355   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1356
1357     mips-siemens-sysv* | mips-sni-sysv*)
1358     machine=mips-siemens opsys=usg5-4
1359     NON_GNU_CC=/usr/ccs/bin/cc
1360     NON_GNU_CPP=/usr/ccs/lib/cpp
1361   ;;
1362
1363     mips-nec-sysv*)
1364     machine=mips-nec
1365     NON_GNU_CC=/usr/ccs/bin/cc
1366     NON_GNU_CPP=/usr/ccs/lib/cpp
1367   ;;
1368
1369       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1370   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1371     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1372   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1373   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1374   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1375   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1376   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1377   mips-sgi-irix*      ) opsys=irix5-0 ;;
1378
1379     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1380   *-sony-news* ) opsys=newsos5 ;;
1381
1382     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1383
1384     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1385         case "$canonical" in
1386       m68*-sunos1* )             machine=sun1     ;;
1387       m68*-sunos2* )             machine=sun2     ;;
1388       m68* )                     machine=sun3     ;;
1389       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1390       i*86-*-* )                 machine=intel386 ;;
1391       rs6000* )                  machine=rs6000   ;;
1392     esac
1393
1394         case "$canonical" in *-sunos5*)
1395       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1396     esac
1397
1398                     case "$canonical" in
1399       *-sunos4* )
1400         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1401         : ;;
1402       *-solaris2* )
1403         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1404         RANLIB=':' ;;
1405     esac
1406
1407     case "$canonical" in
1408       *-solaris*          )
1409         opsys=sol2
1410         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1411         { test "$extra_verbose" = "yes" && cat << EOF
1412     Defining OS_RELEASE = $os_release
1413 EOF
1414 cat >> confdefs.h <<EOF
1415 #define OS_RELEASE $os_release
1416 EOF
1417 }
1418  ;;
1419
1420             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1421       *-sunos4.0*         ) opsys=sunos4-0      ;;
1422       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1423       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1424       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1425       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1426       *-mach*             ) opsys=mach-bsd4-3   ;;
1427       *                   ) opsys=bsd4-2        ;;
1428     esac
1429
1430     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1431
1432         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1433   ;;
1434
1435     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1436
1437     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1438   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1439
1440     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1441
1442     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1443
1444     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1445       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1446
1447     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1448
1449     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1450
1451     vax-dec-* )
1452     case "$canonical" in
1453       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1454       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1455       *-mach* )                         opsys=mach-bsd4-3 ;;
1456     esac
1457   ;;
1458
1459     ns16k-whitechapel-* ) machine=mg1 ;;
1460
1461     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1462
1463     i[3-9]86-*-* )
1464     machine=intel386
1465     case "$canonical" in
1466       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1467       *-isc2.2* )               opsys=isc2-2 ;;
1468       *-isc4.0* )               opsys=isc4-0 ;;
1469       *-isc4.* )                opsys=isc4-1
1470                                 GCC_TEST_OPTIONS=-posix
1471                                 NON_GCC_TEST_OPTIONS=-Xp
1472                                 ;;
1473       *-isc* )                  opsys=isc3-0 ;;
1474       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1475       *-esix* )                 opsys=esix ;;
1476       *-mach* )                 opsys=mach-bsd4-3 ;;
1477       *-xenix* )                opsys=xenix ;;
1478       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1479       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1480       *-bsdi4* )                opsys=bsdos4 ;;
1481       *-bsdi3* )                opsys=bsdos3 ;;
1482       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1483       *-bsdi2* )                opsys=bsdos2 ;;
1484       *-sco3.2v5* )             opsys=sco5 ;
1485                                                         if test "$dynamic" = "yes" ; then
1486                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1487         else
1488                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1489         fi ;;
1490       *-sysv5* )                opsys=sco7 ;;
1491       *-386bsd* )               opsys=386bsd ;;
1492       *-freebsd* )              opsys=freebsd ;;
1493       *-nextstep* )             opsys=nextstep ;;
1494       *-pc-cygwin* )            opsys=cygwin32 ;;
1495       *-pc-mingw* )             opsys=mingw32 ;
1496                                 test -z "$with_tty" && with_tty="no";;
1497           esac
1498   ;;
1499
1500     m68k-*-linux* ) machine=m68k opsys=linux ;;
1501
1502 esac
1503
1504 test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'`
1505 test -z "$opsys"   && opsys=`echo $canonical | sed 's/^^-*-^-*-//'`
1506
1507 if test -r "${srcdir}/src/m/${machine}.h"; then
1508   machfile="m/${machine}.h"
1509   { test "$extra_verbose" = "yes" && cat << EOF
1510     Defining config_machfile = "$machfile"
1511 EOF
1512 cat >> confdefs.h <<EOF
1513 #define config_machfile "$machfile"
1514 EOF
1515 }
1516
1517 else
1518   echo "XEmacs has no builtin knowledge of \`$machine' machines."
1519   echo "Using configure-time autodetection only."
1520 fi
1521
1522 if test -r "${srcdir}/src/s/${opsys}.h"; then
1523   opsysfile="s/${opsys}.h"
1524   { test "$extra_verbose" = "yes" && cat << EOF
1525     Defining config_opsysfile = "$opsysfile"
1526 EOF
1527 cat >> confdefs.h <<EOF
1528 #define config_opsysfile "$opsysfile"
1529 EOF
1530 }
1531
1532 else
1533   echo "XEmacs has no builtin knowledge of \`$opsys' operating systems."
1534   echo "Using configure-time autodetection only."
1535 fi
1536
1537
1538 if test -z "$dynamic"; then
1539   case "$opsys" in
1540     hpux* | sunos4* ) dynamic=no ;;
1541     *) dynamic=yes ;;
1542   esac
1543 fi
1544 if test "$dynamic" = "yes"; then
1545   case "$opsys" in
1546     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1547     decosf* ) ld_call_shared="-call_shared" ;;
1548   esac
1549 else   case "$opsys" in
1550     sol2 )
1551       echo "Static linking is not supported on Solaris 2."
1552       echo "Rerun configure without specifying --dynamic=no."
1553       exit 1 ;;
1554     linux   ) ld_call_shared="-Bstatic" ;;
1555     decosf* ) ld_call_shared="-non_shared" ;;
1556   esac
1557 fi
1558
1559 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1560
1561 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1562 { test "$extra_verbose" = "yes" && cat << EOF
1563     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1564 EOF
1565 cat >> confdefs.h <<EOF
1566 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1567 EOF
1568 }
1569
1570
1571
1572 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1573 if test "$with_workshop $with_tooltalk" = "yes no"; then
1574   (echo "$progname: Usage error:"
1575 echo " " "--with-workshop requires --with-tooltalk"
1576 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1577 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1578 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1579 fi
1580
1581 if test "$with_workshop" = "yes"; then
1582   { test "$extra_verbose" = "yes" && cat << \EOF
1583     Defining SUNPRO
1584 EOF
1585 cat >> confdefs.h <<\EOF
1586 #define SUNPRO 1
1587 EOF
1588 }
1589
1590   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1591    echo "    xemacs will be linked with \"sunpro.o\""
1592  fi
1593 fi
1594
1595 if test "$with_clash_detection" != "no"; then
1596   { test "$extra_verbose" = "yes" && cat << \EOF
1597     Defining CLASH_DETECTION
1598 EOF
1599 cat >> confdefs.h <<\EOF
1600 #define CLASH_DETECTION 1
1601 EOF
1602 }
1603
1604   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1605    echo "    xemacs will be linked with \"filelock.o\""
1606  fi
1607 fi
1608
1609 test -n "$compiler" && CC="$compiler"
1610 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1611 fi
1612
1613 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1614 if test "${CFLAGS-unset}" != unset
1615   then cflags_specified=yes;
1616   else cflags_specified=no;
1617 fi
1618
1619 xe_save_CFLAGS="$CFLAGS"
1620
1621 # Extract the first word of "gcc", so it can be a program name with args.
1622 set dummy gcc; ac_word=$2
1623 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1624 echo "configure:1625: checking for $ac_word" >&5
1625
1626 if test -n "$CC"; then
1627   ac_cv_prog_CC="$CC" # Let the user override the test.
1628 else
1629   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1630   ac_dummy="$PATH"
1631   for ac_dir in $ac_dummy; do
1632     test -z "$ac_dir" && ac_dir=.
1633     if test -f $ac_dir/$ac_word; then
1634       ac_cv_prog_CC="gcc"
1635       break
1636     fi
1637   done
1638   IFS="$ac_save_ifs"
1639 fi
1640 CC="$ac_cv_prog_CC"
1641 if test -n "$CC"; then
1642   echo "$ac_t""$CC" 1>&6
1643 else
1644   echo "$ac_t""no" 1>&6
1645 fi
1646
1647 if test -z "$CC"; then
1648   # Extract the first word of "cc", so it can be a program name with args.
1649 set dummy cc; ac_word=$2
1650 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1651 echo "configure:1652: checking for $ac_word" >&5
1652
1653 if test -n "$CC"; then
1654   ac_cv_prog_CC="$CC" # Let the user override the test.
1655 else
1656   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1657   ac_prog_rejected=no
1658   ac_dummy="$PATH"
1659   for ac_dir in $ac_dummy; do
1660     test -z "$ac_dir" && ac_dir=.
1661     if test -f $ac_dir/$ac_word; then
1662       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1663         ac_prog_rejected=yes
1664         continue
1665       fi
1666       ac_cv_prog_CC="cc"
1667       break
1668     fi
1669   done
1670   IFS="$ac_save_ifs"
1671 if test $ac_prog_rejected = yes; then
1672   # We found a bogon in the path, so make sure we never use it.
1673   set dummy $ac_cv_prog_CC
1674   shift
1675   if test $# -gt 0; then
1676     # We chose a different compiler from the bogus one.
1677     # However, it has the same basename, so the bogon will be chosen
1678     # first if we set CC to just the basename; use the full file name.
1679     shift
1680     set dummy "$ac_dir/$ac_word" "$@"
1681     shift
1682     ac_cv_prog_CC="$@"
1683   fi
1684 fi
1685 fi
1686 CC="$ac_cv_prog_CC"
1687 if test -n "$CC"; then
1688   echo "$ac_t""$CC" 1>&6
1689 else
1690   echo "$ac_t""no" 1>&6
1691 fi
1692
1693   if test -z "$CC"; then
1694     case "`uname -s`" in
1695     *win32* | *WIN32*)
1696       # Extract the first word of "cl", so it can be a program name with args.
1697 set dummy cl; ac_word=$2
1698 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1699 echo "configure:1700: checking for $ac_word" >&5
1700
1701 if test -n "$CC"; then
1702   ac_cv_prog_CC="$CC" # Let the user override the test.
1703 else
1704   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1705   ac_dummy="$PATH"
1706   for ac_dir in $ac_dummy; do
1707     test -z "$ac_dir" && ac_dir=.
1708     if test -f $ac_dir/$ac_word; then
1709       ac_cv_prog_CC="cl"
1710       break
1711     fi
1712   done
1713   IFS="$ac_save_ifs"
1714 fi
1715 CC="$ac_cv_prog_CC"
1716 if test -n "$CC"; then
1717   echo "$ac_t""$CC" 1>&6
1718 else
1719   echo "$ac_t""no" 1>&6
1720 fi
1721  ;;
1722     esac
1723   fi
1724   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1725 fi
1726
1727 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1728 echo "configure:1729: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1729
1730 ac_ext=c
1731 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1732 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1733 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1734 ac_cpp='$CPP '"$xe_cppflags"
1735 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1736 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1737 cross_compiling=no
1738
1739 cat > conftest.$ac_ext << EOF
1740
1741 #line 1742 "configure"
1742 #include "confdefs.h"
1743
1744 main(){return(0);}
1745 EOF
1746 if { (eval echo configure:1747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1747   ac_cv_prog_cc_works=yes
1748   # If we can't run a trivial program, we are probably using a cross compiler.
1749   if (./conftest; exit) 2>/dev/null; then
1750     ac_cv_prog_cc_cross=no
1751   else
1752     ac_cv_prog_cc_cross=yes
1753   fi
1754 else
1755   echo "configure: failed program was:" >&5
1756   cat conftest.$ac_ext >&5
1757   ac_cv_prog_cc_works=no
1758 fi
1759 rm -fr conftest*
1760 ac_ext=c
1761 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1762 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1763 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1764 ac_cpp='$CPP '"$xe_cppflags"
1765 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1766 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1767 cross_compiling=no
1768
1769 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1770 if test $ac_cv_prog_cc_works = no; then
1771   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1772 fi
1773 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1774 echo "configure:1775: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1775 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1776 cross_compiling=$ac_cv_prog_cc_cross
1777
1778 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1779 echo "configure:1780: checking whether we are using GNU C" >&5
1780
1781 cat > conftest.c <<EOF
1782 #ifdef __GNUC__
1783   yes;
1784 #endif
1785 EOF
1786 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1787   ac_cv_prog_gcc=yes
1788 else
1789   ac_cv_prog_gcc=no
1790 fi
1791
1792 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1793
1794 if test $ac_cv_prog_gcc = yes; then
1795   GCC=yes
1796 else
1797   GCC=
1798 fi
1799
1800 ac_test_CFLAGS="${CFLAGS+set}"
1801 ac_save_CFLAGS="$CFLAGS"
1802 CFLAGS=
1803 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1804 echo "configure:1805: checking whether ${CC-cc} accepts -g" >&5
1805
1806 echo 'void f(){}' > conftest.c
1807 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1808   ac_cv_prog_cc_g=yes
1809 else
1810   ac_cv_prog_cc_g=no
1811 fi
1812 rm -f conftest*
1813
1814
1815 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1816 if test "$ac_test_CFLAGS" = set; then
1817   CFLAGS="$ac_save_CFLAGS"
1818 elif test $ac_cv_prog_cc_g = yes; then
1819   if test "$GCC" = yes; then
1820     CFLAGS="-g -O2"
1821   else
1822     CFLAGS="-g"
1823   fi
1824 else
1825   if test "$GCC" = yes; then
1826     CFLAGS="-O2"
1827   else
1828     CFLAGS=
1829   fi
1830 fi
1831  
1832 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1833   CC=${NON_GNU_CC-cc}
1834   # Extract the first word of "gcc", so it can be a program name with args.
1835 set dummy gcc; ac_word=$2
1836 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1837 echo "configure:1838: checking for $ac_word" >&5
1838
1839 if test -n "$CC"; then
1840   ac_cv_prog_CC="$CC" # Let the user override the test.
1841 else
1842   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1843   ac_dummy="$PATH"
1844   for ac_dir in $ac_dummy; do
1845     test -z "$ac_dir" && ac_dir=.
1846     if test -f $ac_dir/$ac_word; then
1847       ac_cv_prog_CC="gcc"
1848       break
1849     fi
1850   done
1851   IFS="$ac_save_ifs"
1852 fi
1853 CC="$ac_cv_prog_CC"
1854 if test -n "$CC"; then
1855   echo "$ac_t""$CC" 1>&6
1856 else
1857   echo "$ac_t""no" 1>&6
1858 fi
1859
1860 if test -z "$CC"; then
1861   # Extract the first word of "cc", so it can be a program name with args.
1862 set dummy cc; ac_word=$2
1863 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1864 echo "configure:1865: checking for $ac_word" >&5
1865
1866 if test -n "$CC"; then
1867   ac_cv_prog_CC="$CC" # Let the user override the test.
1868 else
1869   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1870   ac_prog_rejected=no
1871   ac_dummy="$PATH"
1872   for ac_dir in $ac_dummy; do
1873     test -z "$ac_dir" && ac_dir=.
1874     if test -f $ac_dir/$ac_word; then
1875       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1876         ac_prog_rejected=yes
1877         continue
1878       fi
1879       ac_cv_prog_CC="cc"
1880       break
1881     fi
1882   done
1883   IFS="$ac_save_ifs"
1884 if test $ac_prog_rejected = yes; then
1885   # We found a bogon in the path, so make sure we never use it.
1886   set dummy $ac_cv_prog_CC
1887   shift
1888   if test $# -gt 0; then
1889     # We chose a different compiler from the bogus one.
1890     # However, it has the same basename, so the bogon will be chosen
1891     # first if we set CC to just the basename; use the full file name.
1892     shift
1893     set dummy "$ac_dir/$ac_word" "$@"
1894     shift
1895     ac_cv_prog_CC="$@"
1896   fi
1897 fi
1898 fi
1899 CC="$ac_cv_prog_CC"
1900 if test -n "$CC"; then
1901   echo "$ac_t""$CC" 1>&6
1902 else
1903   echo "$ac_t""no" 1>&6
1904 fi
1905
1906   if test -z "$CC"; then
1907     case "`uname -s`" in
1908     *win32* | *WIN32*)
1909       # Extract the first word of "cl", so it can be a program name with args.
1910 set dummy cl; ac_word=$2
1911 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1912 echo "configure:1913: checking for $ac_word" >&5
1913
1914 if test -n "$CC"; then
1915   ac_cv_prog_CC="$CC" # Let the user override the test.
1916 else
1917   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1918   ac_dummy="$PATH"
1919   for ac_dir in $ac_dummy; do
1920     test -z "$ac_dir" && ac_dir=.
1921     if test -f $ac_dir/$ac_word; then
1922       ac_cv_prog_CC="cl"
1923       break
1924     fi
1925   done
1926   IFS="$ac_save_ifs"
1927 fi
1928 CC="$ac_cv_prog_CC"
1929 if test -n "$CC"; then
1930   echo "$ac_t""$CC" 1>&6
1931 else
1932   echo "$ac_t""no" 1>&6
1933 fi
1934  ;;
1935     esac
1936   fi
1937   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1938 fi
1939
1940 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1941 echo "configure:1942: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1942
1943 ac_ext=c
1944 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1945 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1946 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1947 ac_cpp='$CPP '"$xe_cppflags"
1948 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1949 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1950 cross_compiling=no
1951
1952 cat > conftest.$ac_ext << EOF
1953
1954 #line 1955 "configure"
1955 #include "confdefs.h"
1956
1957 main(){return(0);}
1958 EOF
1959 if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1960   ac_cv_prog_cc_works=yes
1961   # If we can't run a trivial program, we are probably using a cross compiler.
1962   if (./conftest; exit) 2>/dev/null; then
1963     ac_cv_prog_cc_cross=no
1964   else
1965     ac_cv_prog_cc_cross=yes
1966   fi
1967 else
1968   echo "configure: failed program was:" >&5
1969   cat conftest.$ac_ext >&5
1970   ac_cv_prog_cc_works=no
1971 fi
1972 rm -fr conftest*
1973 ac_ext=c
1974 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1975 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1976 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1977 ac_cpp='$CPP '"$xe_cppflags"
1978 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1979 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1980 cross_compiling=no
1981
1982 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1983 if test $ac_cv_prog_cc_works = no; then
1984   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1985 fi
1986 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1987 echo "configure:1988: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1988 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1989 cross_compiling=$ac_cv_prog_cc_cross
1990
1991 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1992 echo "configure:1993: checking whether we are using GNU C" >&5
1993
1994 cat > conftest.c <<EOF
1995 #ifdef __GNUC__
1996   yes;
1997 #endif
1998 EOF
1999 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2000   ac_cv_prog_gcc=yes
2001 else
2002   ac_cv_prog_gcc=no
2003 fi
2004
2005 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2006
2007 if test $ac_cv_prog_gcc = yes; then
2008   GCC=yes
2009 else
2010   GCC=
2011 fi
2012
2013 ac_test_CFLAGS="${CFLAGS+set}"
2014 ac_save_CFLAGS="$CFLAGS"
2015 CFLAGS=
2016 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2017 echo "configure:2018: checking whether ${CC-cc} accepts -g" >&5
2018
2019 echo 'void f(){}' > conftest.c
2020 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2021   ac_cv_prog_cc_g=yes
2022 else
2023   ac_cv_prog_cc_g=no
2024 fi
2025 rm -f conftest*
2026
2027
2028 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2029 if test "$ac_test_CFLAGS" = set; then
2030   CFLAGS="$ac_save_CFLAGS"
2031 elif test $ac_cv_prog_cc_g = yes; then
2032   if test "$GCC" = yes; then
2033     CFLAGS="-g -O2"
2034   else
2035     CFLAGS="-g"
2036   fi
2037 else
2038   if test "$GCC" = yes; then
2039     CFLAGS="-O2"
2040   else
2041     CFLAGS=
2042   fi
2043 fi
2044
2045 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
2046   CC=gcc
2047   # Extract the first word of "gcc", so it can be a program name with args.
2048 set dummy gcc; ac_word=$2
2049 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2050 echo "configure:2051: checking for $ac_word" >&5
2051
2052 if test -n "$CC"; then
2053   ac_cv_prog_CC="$CC" # Let the user override the test.
2054 else
2055   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2056   ac_dummy="$PATH"
2057   for ac_dir in $ac_dummy; do
2058     test -z "$ac_dir" && ac_dir=.
2059     if test -f $ac_dir/$ac_word; then
2060       ac_cv_prog_CC="gcc"
2061       break
2062     fi
2063   done
2064   IFS="$ac_save_ifs"
2065 fi
2066 CC="$ac_cv_prog_CC"
2067 if test -n "$CC"; then
2068   echo "$ac_t""$CC" 1>&6
2069 else
2070   echo "$ac_t""no" 1>&6
2071 fi
2072
2073 if test -z "$CC"; then
2074   # Extract the first word of "cc", so it can be a program name with args.
2075 set dummy cc; ac_word=$2
2076 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2077 echo "configure:2078: checking for $ac_word" >&5
2078
2079 if test -n "$CC"; then
2080   ac_cv_prog_CC="$CC" # Let the user override the test.
2081 else
2082   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2083   ac_prog_rejected=no
2084   ac_dummy="$PATH"
2085   for ac_dir in $ac_dummy; do
2086     test -z "$ac_dir" && ac_dir=.
2087     if test -f $ac_dir/$ac_word; then
2088       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2089         ac_prog_rejected=yes
2090         continue
2091       fi
2092       ac_cv_prog_CC="cc"
2093       break
2094     fi
2095   done
2096   IFS="$ac_save_ifs"
2097 if test $ac_prog_rejected = yes; then
2098   # We found a bogon in the path, so make sure we never use it.
2099   set dummy $ac_cv_prog_CC
2100   shift
2101   if test $# -gt 0; then
2102     # We chose a different compiler from the bogus one.
2103     # However, it has the same basename, so the bogon will be chosen
2104     # first if we set CC to just the basename; use the full file name.
2105     shift
2106     set dummy "$ac_dir/$ac_word" "$@"
2107     shift
2108     ac_cv_prog_CC="$@"
2109   fi
2110 fi
2111 fi
2112 CC="$ac_cv_prog_CC"
2113 if test -n "$CC"; then
2114   echo "$ac_t""$CC" 1>&6
2115 else
2116   echo "$ac_t""no" 1>&6
2117 fi
2118
2119   if test -z "$CC"; then
2120     case "`uname -s`" in
2121     *win32* | *WIN32*)
2122       # Extract the first word of "cl", so it can be a program name with args.
2123 set dummy cl; ac_word=$2
2124 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2125 echo "configure:2126: checking for $ac_word" >&5
2126
2127 if test -n "$CC"; then
2128   ac_cv_prog_CC="$CC" # Let the user override the test.
2129 else
2130   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2131   ac_dummy="$PATH"
2132   for ac_dir in $ac_dummy; do
2133     test -z "$ac_dir" && ac_dir=.
2134     if test -f $ac_dir/$ac_word; then
2135       ac_cv_prog_CC="cl"
2136       break
2137     fi
2138   done
2139   IFS="$ac_save_ifs"
2140 fi
2141 CC="$ac_cv_prog_CC"
2142 if test -n "$CC"; then
2143   echo "$ac_t""$CC" 1>&6
2144 else
2145   echo "$ac_t""no" 1>&6
2146 fi
2147  ;;
2148     esac
2149   fi
2150   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2151 fi
2152
2153 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2154 echo "configure:2155: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2155
2156 ac_ext=c
2157 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2158 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2159 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2160 ac_cpp='$CPP '"$xe_cppflags"
2161 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2162 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2163 cross_compiling=no
2164
2165 cat > conftest.$ac_ext << EOF
2166
2167 #line 2168 "configure"
2168 #include "confdefs.h"
2169
2170 main(){return(0);}
2171 EOF
2172 if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2173   ac_cv_prog_cc_works=yes
2174   # If we can't run a trivial program, we are probably using a cross compiler.
2175   if (./conftest; exit) 2>/dev/null; then
2176     ac_cv_prog_cc_cross=no
2177   else
2178     ac_cv_prog_cc_cross=yes
2179   fi
2180 else
2181   echo "configure: failed program was:" >&5
2182   cat conftest.$ac_ext >&5
2183   ac_cv_prog_cc_works=no
2184 fi
2185 rm -fr conftest*
2186 ac_ext=c
2187 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2188 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2189 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2190 ac_cpp='$CPP '"$xe_cppflags"
2191 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2192 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2193 cross_compiling=no
2194
2195 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2196 if test $ac_cv_prog_cc_works = no; then
2197   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2198 fi
2199 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2200 echo "configure:2201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2201 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2202 cross_compiling=$ac_cv_prog_cc_cross
2203
2204 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2205 echo "configure:2206: checking whether we are using GNU C" >&5
2206
2207 cat > conftest.c <<EOF
2208 #ifdef __GNUC__
2209   yes;
2210 #endif
2211 EOF
2212 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2213   ac_cv_prog_gcc=yes
2214 else
2215   ac_cv_prog_gcc=no
2216 fi
2217
2218 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2219
2220 if test $ac_cv_prog_gcc = yes; then
2221   GCC=yes
2222 else
2223   GCC=
2224 fi
2225
2226 ac_test_CFLAGS="${CFLAGS+set}"
2227 ac_save_CFLAGS="$CFLAGS"
2228 CFLAGS=
2229 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2230 echo "configure:2231: checking whether ${CC-cc} accepts -g" >&5
2231
2232 echo 'void f(){}' > conftest.c
2233 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2234   ac_cv_prog_cc_g=yes
2235 else
2236   ac_cv_prog_cc_g=no
2237 fi
2238 rm -f conftest*
2239
2240
2241 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2242 if test "$ac_test_CFLAGS" = set; then
2243   CFLAGS="$ac_save_CFLAGS"
2244 elif test $ac_cv_prog_cc_g = yes; then
2245   if test "$GCC" = yes; then
2246     CFLAGS="-g -O2"
2247   else
2248     CFLAGS="-g"
2249   fi
2250 else
2251   if test "$GCC" = yes; then
2252     CFLAGS="-O2"
2253   else
2254     CFLAGS=
2255   fi
2256 fi
2257
2258 fi
2259 CFLAGS="$xe_save_CFLAGS"
2260
2261
2262 test -n "$CPP" -a -d "$CPP" && CPP=
2263
2264 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2265
2266 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2267 echo "configure:2268: checking how to run the C preprocessor" >&5
2268 # On Suns, sometimes $CPP names a directory.
2269 if test -n "$CPP" && test -d "$CPP"; then
2270   CPP=
2271 fi
2272 if test -z "$CPP"; then
2273
2274   # This must be in double quotes, not single quotes, because CPP may get
2275   # substituted into the Makefile and "${CC-cc}" will confuse make.
2276   CPP="${CC-cc} -E"
2277   # On the NeXT, cc -E runs the code through the compiler's parser,
2278   # not just through cpp.
2279   cat > conftest.$ac_ext <<EOF
2280 #line 2281 "configure"
2281 #include "confdefs.h"
2282 #include <assert.h>
2283 Syntax Error
2284 EOF
2285 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2286 { (eval echo configure:2287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2287 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2288 if test -z "$ac_err"; then
2289   :
2290 else
2291   echo "$ac_err" >&5
2292   echo "configure: failed program was:" >&5
2293   cat conftest.$ac_ext >&5
2294   rm -rf conftest*
2295   CPP="${CC-cc} -E -traditional-cpp"
2296   cat > conftest.$ac_ext <<EOF
2297 #line 2298 "configure"
2298 #include "confdefs.h"
2299 #include <assert.h>
2300 Syntax Error
2301 EOF
2302 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2303 { (eval echo configure:2304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2304 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2305 if test -z "$ac_err"; then
2306   :
2307 else
2308   echo "$ac_err" >&5
2309   echo "configure: failed program was:" >&5
2310   cat conftest.$ac_ext >&5
2311   rm -rf conftest*
2312   CPP="${CC-cc} -nologo -E"
2313   cat > conftest.$ac_ext <<EOF
2314 #line 2315 "configure"
2315 #include "confdefs.h"
2316 #include <assert.h>
2317 Syntax Error
2318 EOF
2319 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2320 { (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2321 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2322 if test -z "$ac_err"; then
2323   :
2324 else
2325   echo "$ac_err" >&5
2326   echo "configure: failed program was:" >&5
2327   cat conftest.$ac_ext >&5
2328   rm -rf conftest*
2329   CPP=/lib/cpp
2330 fi
2331 rm -f conftest*
2332 fi
2333 rm -f conftest*
2334 fi
2335 rm -f conftest*
2336   ac_cv_prog_CPP="$CPP"
2337   CPP="$ac_cv_prog_CPP"
2338 else
2339   ac_cv_prog_CPP="$CPP"
2340 fi
2341 echo "$ac_t""$CPP" 1>&6
2342
2343
2344
2345 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2346 echo "configure:2347: checking for AIX" >&5
2347 cat > conftest.$ac_ext <<EOF
2348 #line 2349 "configure"
2349 #include "confdefs.h"
2350 #ifdef _AIX
2351   yes
2352 #endif
2353
2354 EOF
2355 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2356   egrep "yes" >/dev/null 2>&1; then
2357   rm -rf conftest*
2358   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2359     Defining _ALL_SOURCE
2360 EOF
2361 cat >> confdefs.h <<\EOF
2362 #define _ALL_SOURCE 1
2363 EOF
2364 }
2365
2366 else
2367   rm -rf conftest*
2368   echo "$ac_t""no" 1>&6
2369 fi
2370 rm -f conftest*
2371
2372  
2373
2374 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2375 echo "configure:2376: checking for GNU libc" >&5
2376 cat > conftest.$ac_ext <<EOF
2377 #line 2378 "configure"
2378 #include "confdefs.h"
2379 #include <features.h>
2380 int main() {
2381
2382 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2383 #error Not a GNU libc system :-(
2384 ******* ======= ******** &&&&&&&&
2385 #endif
2386
2387 ; return 0; }
2388 EOF
2389 if { (eval echo configure:2390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2390   rm -rf conftest*
2391   have_glibc=yes
2392 else
2393   echo "configure: failed program was:" >&5
2394   cat conftest.$ac_ext >&5
2395   rm -rf conftest*
2396   have_glibc=no
2397 fi
2398 rm -f conftest*
2399 echo "$ac_t""$have_glibc" 1>&6
2400 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2401     Defining _GNU_SOURCE
2402 EOF
2403 cat >> confdefs.h <<\EOF
2404 #define _GNU_SOURCE 1
2405 EOF
2406 }
2407
2408
2409 case "$opsys" in
2410   sol2)
2411    { test "$extra_verbose" = "yes" && cat << \EOF
2412     Defining __EXTENSIONS__
2413 EOF
2414 cat >> confdefs.h <<\EOF
2415 #define __EXTENSIONS__ 1
2416 EOF
2417 }
2418
2419       if test "$os_release" -ge 55; then
2420      { test "$extra_verbose" = "yes" && cat << \EOF
2421     Defining _XOPEN_SOURCE = 500
2422 EOF
2423 cat >> confdefs.h <<\EOF
2424 #define _XOPEN_SOURCE 500
2425 EOF
2426 }
2427
2428      { test "$extra_verbose" = "yes" && cat << \EOF
2429     Defining _XOPEN_SOURCE_EXTENDED
2430 EOF
2431 cat >> confdefs.h <<\EOF
2432 #define _XOPEN_SOURCE_EXTENDED 1
2433 EOF
2434 }
2435
2436    fi ;;
2437   linux)
2438     { test "$extra_verbose" = "yes" && cat << \EOF
2439     Defining _POSIX_C_SOURCE = 199506L
2440 EOF
2441 cat >> confdefs.h <<\EOF
2442 #define _POSIX_C_SOURCE 199506L
2443 EOF
2444 }
2445
2446     { test "$extra_verbose" = "yes" && cat << \EOF
2447     Defining _XOPEN_SOURCE = 500
2448 EOF
2449 cat >> confdefs.h <<\EOF
2450 #define _XOPEN_SOURCE 500
2451 EOF
2452 }
2453
2454     { test "$extra_verbose" = "yes" && cat << \EOF
2455     Defining _XOPEN_SOURCE_EXTENDED
2456 EOF
2457 cat >> confdefs.h <<\EOF
2458 #define _XOPEN_SOURCE_EXTENDED 1
2459 EOF
2460 }
2461
2462     ;;
2463 esac
2464
2465 cat > conftest.$ac_ext <<EOF
2466 #line 2467 "configure"
2467 #include "confdefs.h"
2468 int main () {
2469 #if defined __SUNPRO_C
2470 return 11;
2471 #elif defined __DECC
2472 return 12;
2473 #elif defined __USLC__ && defined __SCO_VERSION__
2474 return 13;
2475 #else
2476 return 0;
2477 #endif
2478 }
2479 EOF
2480 if { (eval echo configure:2481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2481 then
2482   :
2483 else
2484   conftest_rc="$?"
2485   echo "configure: failed program was:" >&5
2486   cat conftest.$ac_ext >&5
2487   rm -fr conftest*
2488   case "$conftest_rc" in
2489   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2490   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2491   13) echo "You appear to be using the SCO C compiler."   ; __USLC__=yes ;;
2492 esac
2493 fi
2494 rm -fr conftest*
2495
2496
2497
2498
2499 echo "Extracting information from the machine- and system-dependent headers..."
2500
2501 tempcname="conftest.c"
2502
2503
2504
2505 cat > $tempcname < confdefs.h
2506 cat >> $tempcname <<EOF
2507 #define NOT_C_CODE
2508 #define C_SWITCH_SITE
2509 #define C_SWITCH_X_SITE
2510 #define LD_SWITCH_SITE
2511 #define LD_SWITCH_X_SITE
2512 #define LD_SWITCH_X_SITE_AUX
2513 #define OS_RELEASE $os_release
2514
2515 #ifdef config_opsysfile
2516 #include "$srcdir/src/$opsysfile"
2517 #endif
2518
2519 #ifdef config_machfile
2520 #include "$srcdir/src/$machfile"
2521 #endif
2522
2523 #ifndef LIBS_MACHINE
2524 #define LIBS_MACHINE
2525 #endif
2526 configure___ libs_machine=LIBS_MACHINE
2527
2528 #ifndef LIBS_SYSTEM
2529 #define LIBS_SYSTEM
2530 #endif
2531 configure___ libs_system=LIBS_SYSTEM
2532
2533 #ifndef LIBS_TERMCAP
2534 #define LIBS_TERMCAP
2535 #endif
2536 configure___ libs_termcap=LIBS_TERMCAP
2537
2538 #ifndef LIB_STANDARD
2539 #define LIB_STANDARD
2540 #endif
2541 configure___ libs_standard=LIB_STANDARD
2542
2543
2544 #ifndef OBJECTS_MACHINE
2545 #define OBJECTS_MACHINE
2546 #endif
2547 configure___ objects_machine=OBJECTS_MACHINE
2548
2549 #ifndef OBJECTS_SYSTEM
2550 #define OBJECTS_SYSTEM
2551 #endif
2552 configure___ objects_system=OBJECTS_SYSTEM
2553
2554
2555 #ifndef C_SWITCH_MACHINE
2556 #define C_SWITCH_MACHINE
2557 #endif
2558 configure___ c_switch_machine=C_SWITCH_MACHINE
2559
2560 #ifndef C_SWITCH_SYSTEM
2561 #define C_SWITCH_SYSTEM
2562 #endif
2563 configure___ c_switch_system=C_SWITCH_SYSTEM
2564
2565
2566 #ifndef LD_SWITCH_MACHINE
2567 #define LD_SWITCH_MACHINE
2568 #endif
2569 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2570
2571 #ifndef LD_SWITCH_SYSTEM
2572 #define LD_SWITCH_SYSTEM
2573 #endif
2574 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2575
2576
2577 #ifndef UNEXEC
2578 #define UNEXEC "unexec.o"
2579 #endif
2580 configure___ unexec=UNEXEC
2581
2582
2583 #ifndef LD_SWITCH_SHARED
2584 #define LD_SWITCH_SHARED "-c"
2585 #endif
2586 configure___ ld_switch_shared=LD_SWITCH_SHARED
2587
2588
2589 #define ORDINARY_LD "\$(CC) \$(CFLAGS)"
2590 configure___ ordinary_ld=ORDINARY_LD
2591
2592 #ifdef ORDINARY_LINK
2593 #define LD ORDINARY_LD
2594 #else /* no ORDINARY LINK */
2595 #ifdef COFF_ENCAPSULATE
2596 #define LD "\$(CC) -nostdlib"
2597 #else /* not COFF_ENCAPSULATE */
2598 #ifdef LINKER
2599 #define LD LINKER
2600 #else /* ! defined (LINKER) */
2601 #define LD "ld"
2602 #endif /* ! defined (LINKER) */
2603 #endif /* ! defined (COFF_ENCAPSULATE) */
2604 #endif /* not ORDINARY_LINK */
2605 configure___ ld=LD
2606
2607 #ifndef LIB_GCC
2608 #define LIB_GCC
2609 #endif
2610 configure___ lib_gcc=LIB_GCC
2611
2612 #ifndef LD_TEXT_START_ADDR
2613 #define LD_TEXT_START_ADDR
2614 #endif
2615 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2616
2617
2618 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2619 #ifdef NO_REMAP
2620 #ifdef COFF_ENCAPSULATE
2621 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2622 #else /* ! defined (COFF_ENCAPSULATE) */
2623 #define START_FILES "pre-crt0.o /lib/crt0.o"
2624 #endif /* ! defined (COFF_ENCAPSULATE) */
2625 #else /* ! defined (NO_REMAP) */
2626 #define START_FILES "ecrt0.o"
2627 #endif /* ! defined (NO_REMAP) */
2628 #endif /* no ORDINARY_LINK */
2629 #ifndef START_FILES
2630 #define START_FILES
2631 #endif
2632 configure___ start_files=START_FILES
2633
2634 #ifdef ORDINARY_LINK
2635 configure___ ordinary_link=yes
2636 #else
2637 configure___ ordinary_link=no
2638 #endif
2639
2640 #ifdef SYSTEM_MALLOC
2641 configure___ system_malloc=yes
2642 #else
2643 configure___ system_malloc=no
2644 #endif
2645
2646 #ifdef TERMINFO
2647 configure___ have_terminfo=yes
2648 #else
2649 configure___ have_terminfo=no
2650 #endif
2651
2652 #ifdef MAIL_USE_FLOCK
2653 configure___ mail_use_flock=yes
2654 #else
2655 configure___ mail_use_flock=no
2656 #endif
2657
2658 #ifdef MAIL_USE_LOCKF
2659 configure___ mail_use_lockf=yes
2660 #else
2661 configure___ mail_use_lockf=no
2662 #endif
2663
2664 #ifdef MAIL_USE_LOCKING
2665 configure___ mail_use_locking=yes
2666 #else
2667 configure___ mail_use_locking=no
2668 #endif
2669
2670 #ifdef HAVE_WIN32_PROCESSES
2671 configure___ win32_processes=yes
2672 #else
2673 configure___ win32_processes=no
2674 #endif
2675
2676 EOF
2677
2678 CPP=`eval "echo $CPP $CPPFLAGS"`
2679 eval `$CPP -Isrc $tempcname \
2680         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2681
2682 rm $tempcname
2683
2684 if test "$pdump" = "yes"; then
2685   ordinary_link="yes"
2686   ld="${ordinary_ld}"
2687   start_files=
2688   libs_standard=
2689   unexec=
2690   lib_gcc=
2691 fi
2692
2693 test "$extra_verbose" = "yes" && \
2694   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 ""
2695
2696 case "$opsys" in mingw* | cygwin*)
2697   cygwin_include=`eval "gcc -print-file-name=libc.a"` ;
2698   cygwin_include=`eval "dirname $cygwin_include"` ;
2699   cygwin_include="-I$cygwin_include/../include" ;
2700   extra_includes="$cygwin_include/mingw32 $cygwin_include/mingw $cygwin_include" ;
2701   case "$opsys" in mingw*)
2702     c_switch_system="$c_switch_system $extra_includes" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$extra_includes\" to \$c_switch_system"; fi ;;
2703   esac
2704   ;;
2705 esac
2706
2707 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2708
2709
2710 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std1" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std1\" to \$c_switch_site"; fi
2711
2712 if test "$__USLC__" = yes; then
2713   echo $ac_n "checking for whether the -Kalloca compiler flag is needed""... $ac_c" 1>&6
2714 echo "configure:2715: checking for whether the -Kalloca compiler flag is needed" >&5
2715   need_kalloca=no
2716   cat > conftest.$ac_ext <<EOF
2717 #line 2718 "configure"
2718 #include "confdefs.h"
2719
2720 int main() {
2721 void *x = alloca(4);
2722 ; return 0; }
2723 EOF
2724 if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2725   rm -rf conftest*
2726   :
2727 else
2728   echo "configure: failed program was:" >&5
2729   cat conftest.$ac_ext >&5
2730   rm -rf conftest*
2731   
2732     xe_save_c_switch_system="$c_switch_system"
2733     c_switch_system="$c_switch_system -Kalloca"
2734     cat > conftest.$ac_ext <<EOF
2735 #line 2736 "configure"
2736 #include "confdefs.h"
2737
2738 int main() {
2739 void *x = alloca(4);
2740 ; return 0; }
2741 EOF
2742 if { (eval echo configure:2743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2743   rm -rf conftest*
2744    need_kalloca=yes 
2745 else
2746   echo "configure: failed program was:" >&5
2747   cat conftest.$ac_ext >&5
2748 fi
2749 rm -f conftest*
2750     c_switch_system="$xe_save_c_switch_system"
2751 fi
2752 rm -f conftest*
2753   echo "$ac_t""$need_kalloca" 1>&6
2754   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
2755 fi
2756
2757 if test "$cflags_specified" = "no"; then
2758       if   test "$GCC" = "yes"; then
2759     CFLAGS="-g -O3 -Wall -Wno-switch -Winline -Wmissing-prototypes -Wshadow"
2760             test "$have_glibc" != "yes" && CFLAGS="$CFLAGS -Wpointer-arith"
2761               elif test "$__SUNPRO_C" = "yes"; then
2762     case "$opsys" in
2763       sol2    ) CFLAGS="-v -xO4" ;;
2764       sunos4* ) CFLAGS="-xO2";;
2765     esac
2766   elif test "$__DECC" = "yes"; then
2767     CFLAGS="-O3"
2768   elif test "$CC" = "xlc"; then
2769     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2770     else
2771     CFLAGS="-O" ;  fi
2772 fi
2773
2774 if test "$GCC" = "yes"; then
2775 echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6
2776 echo "configure:2777: checking for buggy gcc versions" >&5
2777 GCC_VERSION=`$CC --version`
2778 case `uname -s`:`uname -m`:$GCC_VERSION in
2779                     *:sun4*:2.8.1|*:sun4*:egcs-2.90.*)
2780                         case "$CFLAGS" in
2781             *-O2*|*-O3*)
2782                 case "$CFLAGS" in
2783                     *-fno-schedule-insns*) ;;
2784                     *)
2785                         echo "$ac_t""yes" 1>&6
2786                         echo "configure: warning: Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures" 1>&2
2787                         echo "configure: warning: without also using -fno-schedule-insns." 1>&2
2788                         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2789                         ;;
2790                 esac
2791                 ;;
2792         esac
2793         ;;
2794                     Linux:alpha:egcs-2.91.*)
2795         echo "$ac_t""yes" 1>&6
2796         echo "configure: warning: There have been reports of egcs-1.1 not compiling XEmacs correctly on" 1>&2
2797         echo "configure: warning: Alpha Linux.  There have also been reports that egcs-1.0.3a is O.K." 1>&2
2798         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2799         ;;
2800     *:i*86*:2.7.2*)
2801         case "$CFLAGS" in
2802             *-O2*|*-O3*)
2803                 case "$GCC_VERSION" in
2804                     2.7.2)
2805                         case "$CFLAGS" in
2806                             *-fno-strength-reduce*) ;;
2807                             *)
2808                                 echo "$ac_t""yes" 1>&6
2809                                 echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
2810                                 echo "configure: warning: -fno-strength-reduce." 1>&2
2811                                 { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2812                                 ;;
2813                         esac
2814                         ;;
2815                 esac
2816                 case "$CFLAGS" in
2817                  *-fno-caller-saves*) ;;
2818                  *)
2819                     echo "$ac_t""yes" 1>&6
2820                     echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
2821                     echo "configure: warning: -fno-caller-saves." 1>&2
2822                     { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2823                     ;;
2824                 esac
2825                 ;;
2826         esac
2827         ;;
2828 esac
2829 echo "$ac_t""no" 1>&6
2830 fi
2831
2832
2833 if test "$GCC" = "yes"; then
2834   set x $ld_switch_system; shift; ld_switch_system=""
2835   while test -n "$1"; do
2836     case $1 in
2837       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2838       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2839       -Xlinker* ) ;;
2840       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2841     esac
2842     shift
2843   done
2844 fi
2845
2846 if test "$GCC" = "yes"; then
2847   set x $ld_switch_machine; shift; ld_switch_machine=""
2848   while test -n "$1"; do
2849     case $1 in
2850       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2851       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2852       -Xlinker* ) ;;
2853       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2854     esac
2855     shift
2856   done
2857 fi
2858
2859 if test "$GCC" = "yes"; then
2860   set x $LDFLAGS; shift; LDFLAGS=""
2861   while test -n "$1"; do
2862     case $1 in
2863       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2864       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2865       -Xlinker* ) ;;
2866       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2867     esac
2868     shift
2869   done
2870 fi
2871
2872 if test "$GCC" = "yes"; then
2873   set x $ld_call_shared; shift; ld_call_shared=""
2874   while test -n "$1"; do
2875     case $1 in
2876       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2877       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2878       -Xlinker* ) ;;
2879       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2880     esac
2881     shift
2882   done
2883 fi
2884
2885 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2886    echo "    xemacs will be linked with \"$objects_machine\""
2887  fi
2888 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2889    echo "    xemacs will be linked with \"$objects_system\""
2890  fi
2891 test -n "$unexec"          && test ! "$pdump" = "yes" && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2892    echo "    xemacs will be linked with \"$unexec\""
2893  fi
2894 test "$pdump" = "yes" && extra_objs="$extra_objs dumper.o" &&  if test "$extra_verbose" = "yes"; then
2895    echo "    xemacs will be linked with \"dumper.o\""
2896  fi
2897
2898 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2899 echo "configure:2900: checking for dynodump" >&5
2900 if test "$unexec" != "unexsol2.o"; then
2901   echo "$ac_t""no" 1>&6
2902 else
2903   echo "$ac_t""yes" 1>&6
2904   { test "$extra_verbose" = "yes" && cat << \EOF
2905     Defining DYNODUMP
2906 EOF
2907 cat >> confdefs.h <<\EOF
2908 #define DYNODUMP 1
2909 EOF
2910 }
2911
2912   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2913   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2914   case "$machine" in
2915     sparc   ) dynodump_arch=sparc ;;
2916     *86*    ) dynodump_arch=i386  ;;
2917     powerpc ) dynodump_arch=ppc   ;;
2918   esac
2919     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
2920 fi
2921
2922
2923 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2924
2925 if test "$unexec" = "unexaix.o"; then
2926   if   test "$dynamic" = "no"; then
2927   start_flags="-Wl,-bnso,-bnodelcsect"
2928   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2929   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2930     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2931   done
2932   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2933     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2934   done
2935   
2936 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2937 echo "configure:2938: checking for terminateAndUnload in -lC" >&5
2938 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2939
2940 xe_check_libs=" -lC "
2941 cat > conftest.$ac_ext <<EOF
2942 #line 2943 "configure"
2943 #include "confdefs.h"
2944 /* Override any gcc2 internal prototype to avoid an error.  */
2945 /* We use char because int might match the return type of a gcc2
2946     builtin and then its argument prototype would still apply.  */
2947 char terminateAndUnload();
2948
2949 int main() {
2950 terminateAndUnload()
2951 ; return 0; }
2952 EOF
2953 if { (eval echo configure:2954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2954   rm -rf conftest*
2955   eval "ac_cv_lib_$ac_lib_var=yes"
2956 else
2957   echo "configure: failed program was:" >&5
2958   cat conftest.$ac_ext >&5
2959   rm -rf conftest*
2960   eval "ac_cv_lib_$ac_lib_var=no"
2961 fi
2962 rm -f conftest*
2963 xe_check_libs=""
2964
2965 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2966   echo "$ac_t""yes" 1>&6
2967   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2968 else
2969   echo "$ac_t""no" 1>&6
2970 fi
2971
2972
2973   fi
2974 elif test -n "$ld_text_start_addr"; then
2975   start_flags="-T $ld_text_start_addr -e __start"
2976 fi
2977
2978
2979
2980
2981 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2982  test -z "$linker" &&  linker='$(CC) -nostdlib'
2983  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2984 fi
2985 test "$GCC" != "yes" && lib_gcc=
2986
2987
2988
2989
2990
2991 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2992 if test -n "$site_libraries"; then
2993   for arg in $site_libraries; do
2994     case "$arg" in
2995      -* ) ;;
2996      * ) test -d "$arg" || \
2997            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2998        arg="-L${arg}" ;;
2999     esac
3000     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
3001   done
3002 fi
3003
3004 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3005 if test -n "$site_includes"; then
3006   for arg in $site_includes; do
3007     case "$arg" in
3008       -* ) ;;
3009       * ) test -d "$arg" || \
3010            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
3011       arg="-I${arg}" ;;
3012     esac
3013     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
3014   done
3015 fi
3016
3017 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3018 if test -n "$site_prefixes"; then
3019   for dir in $site_prefixes; do
3020     lib_dir="${dir}/lib"
3021     inc_dir="${dir}/include"
3022     if test ! -d "$dir"; then
3023       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
3024     elif test ! -d "$lib_dir"; then
3025       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
3026     else
3027       if test -d "$inc_dir"; then
3028         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
3029       fi
3030       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
3031     fi
3032   done
3033 fi
3034
3035
3036 for dir in "/usr/ccs/lib"; do
3037   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
3038 done
3039
3040 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3041 if test -n "$site_runtime_libraries"; then
3042   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
3043   export LD_RUN_PATH
3044 fi
3045
3046
3047
3048
3049
3050 if test -n "$add_runtime_path"; then :;
3051 elif test "$dynamic" = "no"; then add_runtime_path=no
3052 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
3053 else case "$opsys" in
3054        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
3055        * ) add_runtime_path=no ;;
3056      esac
3057 fi
3058
3059 if test "$add_runtime_path" = "yes"; then
3060       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
3061 echo "configure:3062: checking "for runtime libraries flag"" >&5
3062   case "$opsys" in
3063     sol2 ) dash_r="-R" ;;
3064     decosf* | linux* | irix*) dash_r="-rpath " ;;
3065     *)
3066       dash_r=""
3067       for try_dash_r in "-R" "-R " "-rpath "; do
3068         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
3069         
3070 if test "$GCC" = "yes"; then
3071   set x $xe_check_libs; shift; xe_check_libs=""
3072   while test -n "$1"; do
3073     case $1 in
3074       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
3075       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
3076       -Xlinker* ) ;;
3077       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
3078     esac
3079     shift
3080   done
3081 fi
3082         cat > conftest.$ac_ext <<EOF
3083 #line 3084 "configure"
3084 #include "confdefs.h"
3085
3086 int main() {
3087
3088 ; return 0; }
3089 EOF
3090 if { (eval echo configure:3091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3091   rm -rf conftest*
3092   dash_r="$try_dash_r"
3093 else
3094   echo "configure: failed program was:" >&5
3095   cat conftest.$ac_ext >&5
3096 fi
3097 rm -f conftest*
3098         xe_check_libs=""
3099         test -n "$dash_r" && break
3100       done ;;
3101   esac
3102   if test -n "$dash_r";
3103     then echo "$ac_t"""\"${dash_r}\""" 1>&6
3104     else echo "$ac_t""NONE" 1>&6
3105   fi
3106 fi
3107
3108 xe_add_unique_runpath_dir='
3109   xe_add_p=yes
3110   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
3111   done
3112   if test "$xe_add_p" = "yes"; then
3113     test -n "$runpath" && runpath="${runpath}:"
3114     runpath="${runpath}${xe_runpath_dir}"
3115     runpath_dirs="$runpath_dirs $xe_runpath_dir"
3116   fi'
3117
3118
3119
3120
3121 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
3122     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
3123   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
3124   
3125         runpath="" runpath_dirs=""
3126   if test -n "$LD_RUN_PATH"; then
3127     runpath="$LD_RUN_PATH"
3128   elif test "$GCC" = "yes"; then
3129         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
3130     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
3131     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
3132     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
3133       case "$arg" in P,* | -L* | -R* )
3134         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
3135           {
3136 xe_runpath_dir="$dir"
3137   test "$xe_runpath_dir" != "/lib"     -a \
3138         "$xe_runpath_dir" != "/usr/lib" -a \
3139         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
3140   eval "$xe_add_unique_runpath_dir"
3141 }
3142         done ;;
3143       esac
3144     done
3145     ld_switch_run="$ld_switch_run_save"
3146     rm -f conftest*
3147   else
3148         for arg in $ld_switch_site $ld_switch_x_site; do
3149       case "$arg" in -L*) {
3150 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
3151   test "$xe_runpath_dir" != "/lib"     -a \
3152         "$xe_runpath_dir" != "/usr/lib" -a \
3153         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
3154   eval "$xe_add_unique_runpath_dir"
3155 };; esac
3156     done
3157         if test "$opsys $need_motif" = "sol2 yes"; then
3158       xe_runpath_dir="/opt/SUNWdt/lib";
3159       eval "$xe_add_unique_runpath_dir";
3160     fi
3161   fi 
3162   if test -n "$runpath"; then
3163     ld_switch_run="${dash_r}${runpath}"
3164     
3165 if test "$GCC" = "yes"; then
3166   set x $ld_switch_run; shift; ld_switch_run=""
3167   while test -n "$1"; do
3168     case $1 in
3169       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
3170       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
3171       -Xlinker* ) ;;
3172       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
3173     esac
3174     shift
3175   done
3176 fi
3177     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
3178   fi
3179 fi
3180
3181
3182
3183
3184 GNU_MALLOC=yes
3185 if test "$with_dlmalloc" != "no"; then
3186         doug_lea_malloc=yes
3187 else
3188         doug_lea_malloc=no
3189 fi
3190 after_morecore_hook_exists=yes
3191 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
3192 echo "configure:3193: checking for malloc_set_state" >&5
3193
3194 cat > conftest.$ac_ext <<EOF
3195 #line 3196 "configure"
3196 #include "confdefs.h"
3197 /* System header to define __stub macros and hopefully few prototypes,
3198     which can conflict with char malloc_set_state(); below.  */
3199 #include <assert.h>
3200 /* Override any gcc2 internal prototype to avoid an error.  */
3201 /* We use char because int might match the return type of a gcc2
3202     builtin and then its argument prototype would still apply.  */
3203 char malloc_set_state();
3204
3205 int main() {
3206
3207 /* The GNU C library defines this for functions which it implements
3208     to always fail with ENOSYS.  Some functions are actually named
3209     something starting with __ and the normal name is an alias.  */
3210 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
3211 choke me
3212 #else
3213 malloc_set_state();
3214 #endif
3215
3216 ; return 0; }
3217 EOF
3218 if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3219   rm -rf conftest*
3220   eval "ac_cv_func_malloc_set_state=yes"
3221 else
3222   echo "configure: failed program was:" >&5
3223   cat conftest.$ac_ext >&5
3224   rm -rf conftest*
3225   eval "ac_cv_func_malloc_set_state=no"
3226 fi
3227 rm -f conftest*
3228
3229 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
3230   echo "$ac_t""yes" 1>&6
3231   :
3232 else
3233   echo "$ac_t""no" 1>&6
3234 doug_lea_malloc=no
3235 fi
3236
3237 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
3238 echo "configure:3239: checking whether __after_morecore_hook exists" >&5
3239 cat > conftest.$ac_ext <<EOF
3240 #line 3241 "configure"
3241 #include "confdefs.h"
3242 extern void (* __after_morecore_hook)();
3243 int main() {
3244 __after_morecore_hook = 0
3245 ; return 0; }
3246 EOF
3247 if { (eval echo configure:3248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3248   rm -rf conftest*
3249   echo "$ac_t""yes" 1>&6
3250 else
3251   echo "configure: failed program was:" >&5
3252   cat conftest.$ac_ext >&5
3253   rm -rf conftest*
3254   echo "$ac_t""no" 1>&6
3255    after_morecore_hook_exists=no
3256 fi
3257 rm -f conftest*
3258 if test "$system_malloc" = "yes" ; then
3259   GNU_MALLOC=no
3260   GNU_MALLOC_reason="
3261     - The GNU allocators don't work with this system configuration."
3262 elif test "$with_system_malloc" = "yes" ; then
3263   GNU_MALLOC=no
3264   GNU_MALLOC_reason="
3265     - User chose not to use GNU allocators."
3266 elif test "$with_debug_malloc" = "yes" ; then
3267   GNU_MALLOC=no
3268   GNU_MALLOC_reason="
3269     - User chose to use Debugging Malloc."
3270 fi
3271
3272 if test "$doug_lea_malloc" = "yes" -a "$GNU_MALLOC" = "yes" ; then
3273   GNU_MALLOC_reason="
3274     - Using Doug Lea's new malloc from the GNU C Library."
3275   { test "$extra_verbose" = "yes" && cat << \EOF
3276     Defining DOUG_LEA_MALLOC
3277 EOF
3278 cat >> confdefs.h <<\EOF
3279 #define DOUG_LEA_MALLOC 1
3280 EOF
3281 }
3282
3283   if test "$after_morecore_hook_exists" = "no" ; then
3284     GNU_MALLOC_reason="
3285     - Using Doug Lea's new malloc from the Linux C Library."
3286     { test "$extra_verbose" = "yes" && cat << \EOF
3287     Defining _NO_MALLOC_WARNING_
3288 EOF
3289 cat >> confdefs.h <<\EOF
3290 #define _NO_MALLOC_WARNING_ 1
3291 EOF
3292 }
3293
3294   fi
3295 fi
3296
3297
3298
3299
3300 # Extract the first word of "ranlib", so it can be a program name with args.
3301 set dummy ranlib; ac_word=$2
3302 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3303 echo "configure:3304: checking for $ac_word" >&5
3304
3305 if test -n "$RANLIB"; then
3306   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3307 else
3308   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3309   ac_dummy="$PATH"
3310   for ac_dir in $ac_dummy; do
3311     test -z "$ac_dir" && ac_dir=.
3312     if test -f $ac_dir/$ac_word; then
3313       ac_cv_prog_RANLIB="ranlib"
3314       break
3315     fi
3316   done
3317   IFS="$ac_save_ifs"
3318   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3319 fi
3320 RANLIB="$ac_cv_prog_RANLIB"
3321 if test -n "$RANLIB"; then
3322   echo "$ac_t""$RANLIB" 1>&6
3323 else
3324   echo "$ac_t""no" 1>&6
3325 fi
3326
3327 ac_aux_dir=
3328 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3329   if test -f $ac_dir/install-sh; then
3330     ac_aux_dir=$ac_dir
3331     ac_install_sh="$ac_aux_dir/install-sh -c"
3332     break
3333   elif test -f $ac_dir/install.sh; then
3334     ac_aux_dir=$ac_dir
3335     ac_install_sh="$ac_aux_dir/install.sh -c"
3336     break
3337   fi
3338 done
3339 if test -z "$ac_aux_dir"; then
3340   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3341 fi
3342 ac_config_guess=$ac_aux_dir/config.guess
3343 ac_config_sub=$ac_aux_dir/config.sub
3344 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3345
3346 # Find a good install program.  We prefer a C program (faster),
3347 # so one script is as good as another.  But avoid the broken or
3348 # incompatible versions:
3349 # SysV /etc/install, /usr/sbin/install
3350 # SunOS /usr/etc/install
3351 # IRIX /sbin/install
3352 # AIX /bin/install
3353 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3354 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3355 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3356 # ./install, which can be erroneously created by make from ./install.sh.
3357 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3358 echo "configure:3359: checking for a BSD compatible install" >&5
3359 if test -z "$INSTALL"; then
3360
3361   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3362   for ac_dir in $PATH; do
3363     # Account for people who put trailing slashes in PATH elements.
3364     case "$ac_dir/" in
3365     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3366     *)
3367       # OSF1 and SCO ODT 3.0 have their own names for install.
3368       # Don't use installbsd from OSF since it installs stuff as root
3369       # by default.
3370       for ac_prog in ginstall scoinst install; do
3371         if test -f $ac_dir/$ac_prog; then
3372           if test $ac_prog = install &&
3373             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3374             # AIX install.  It has an incompatible calling convention.
3375             :
3376           else
3377             ac_cv_path_install="$ac_dir/$ac_prog -c"
3378             break 2
3379           fi
3380         fi
3381       done
3382       ;;
3383     esac
3384   done
3385   IFS="$ac_save_IFS"
3386
3387   if test "${ac_cv_path_install+set}" = set; then
3388     INSTALL="$ac_cv_path_install"
3389   else
3390     # As a last resort, use the slow shell script.  We don't cache a
3391     # path for INSTALL within a source directory, because that will
3392     # break other packages using the cache if that directory is
3393     # removed, or if the path is relative.
3394     INSTALL="$ac_install_sh"
3395   fi
3396 fi
3397 echo "$ac_t""$INSTALL" 1>&6
3398
3399 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3400 # It thinks the first close brace ends the variable substitution.
3401 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3402
3403 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3404
3405 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3406
3407 for ac_prog in 'bison -y' byacc
3408 do
3409 # Extract the first word of "$ac_prog", so it can be a program name with args.
3410 set dummy $ac_prog; ac_word=$2
3411 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3412 echo "configure:3413: checking for $ac_word" >&5
3413
3414 if test -n "$YACC"; then
3415   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3416 else
3417   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3418   ac_dummy="$PATH"
3419   for ac_dir in $ac_dummy; do
3420     test -z "$ac_dir" && ac_dir=.
3421     if test -f $ac_dir/$ac_word; then
3422       ac_cv_prog_YACC="$ac_prog"
3423       break
3424     fi
3425   done
3426   IFS="$ac_save_ifs"
3427 fi
3428 YACC="$ac_cv_prog_YACC"
3429 if test -n "$YACC"; then
3430   echo "$ac_t""$YACC" 1>&6
3431 else
3432   echo "$ac_t""no" 1>&6
3433 fi
3434
3435 test -n "$YACC" && break
3436 done
3437 test -n "$YACC" || YACC="yacc"
3438
3439
3440 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   utime.h 
3441 do
3442 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3443 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3444 echo "configure:3445: checking for $ac_hdr" >&5
3445
3446 cat > conftest.$ac_ext <<EOF
3447 #line 3448 "configure"
3448 #include "confdefs.h"
3449 #include <$ac_hdr>
3450 EOF
3451 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3452 { (eval echo configure:3453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3453 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3454 if test -z "$ac_err"; then
3455   rm -rf conftest*
3456   eval "ac_cv_header_$ac_safe=yes"
3457 else
3458   echo "$ac_err" >&5
3459   echo "configure: failed program was:" >&5
3460   cat conftest.$ac_ext >&5
3461   rm -rf conftest*
3462   eval "ac_cv_header_$ac_safe=no"
3463 fi
3464 rm -f conftest*
3465 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3466   echo "$ac_t""yes" 1>&6
3467     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3468   { test "$extra_verbose" = "yes" && cat << EOF
3469     Defining $ac_tr_hdr
3470 EOF
3471 cat >> confdefs.h <<EOF
3472 #define $ac_tr_hdr 1
3473 EOF
3474 }
3475  
3476 else
3477   echo "$ac_t""no" 1>&6
3478 fi
3479 done
3480
3481 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3482 echo "configure:3483: checking for sys/wait.h that is POSIX.1 compatible" >&5
3483
3484 cat > conftest.$ac_ext <<EOF
3485 #line 3486 "configure"
3486 #include "confdefs.h"
3487 #include <sys/types.h>
3488 #include <sys/wait.h>
3489 #ifndef WEXITSTATUS
3490 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3491 #endif
3492 #ifndef WIFEXITED
3493 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3494 #endif
3495 int main() {
3496 int s;
3497 wait (&s);
3498 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3499 ; return 0; }
3500 EOF
3501 if { (eval echo configure:3502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3502   rm -rf conftest*
3503   ac_cv_header_sys_wait_h=yes
3504 else
3505   echo "configure: failed program was:" >&5
3506   cat conftest.$ac_ext >&5
3507   rm -rf conftest*
3508   ac_cv_header_sys_wait_h=no
3509 fi
3510 rm -f conftest*
3511
3512 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3513 if test $ac_cv_header_sys_wait_h = yes; then
3514   { test "$extra_verbose" = "yes" && cat << \EOF
3515     Defining HAVE_SYS_WAIT_H
3516 EOF
3517 cat >> confdefs.h <<\EOF
3518 #define HAVE_SYS_WAIT_H 1
3519 EOF
3520 }
3521
3522 fi
3523
3524 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3525 echo "configure:3526: checking for ANSI C header files" >&5
3526
3527 cat > conftest.$ac_ext <<EOF
3528 #line 3529 "configure"
3529 #include "confdefs.h"
3530 #include <stdlib.h>
3531 #include <stdarg.h>
3532 #include <string.h>
3533 #include <float.h>
3534 EOF
3535 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3536 { (eval echo configure:3537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3537 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3538 if test -z "$ac_err"; then
3539   rm -rf conftest*
3540   ac_cv_header_stdc=yes
3541 else
3542   echo "$ac_err" >&5
3543   echo "configure: failed program was:" >&5
3544   cat conftest.$ac_ext >&5
3545   rm -rf conftest*
3546   ac_cv_header_stdc=no
3547 fi
3548 rm -f conftest*
3549
3550 if test $ac_cv_header_stdc = yes; then
3551   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3552 cat > conftest.$ac_ext <<EOF
3553 #line 3554 "configure"
3554 #include "confdefs.h"
3555 #include <string.h>
3556 EOF
3557 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3558   egrep "memchr" >/dev/null 2>&1; then
3559   :
3560 else
3561   rm -rf conftest*
3562   ac_cv_header_stdc=no
3563 fi
3564 rm -f conftest*
3565
3566 fi
3567
3568 if test $ac_cv_header_stdc = yes; then
3569   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3570 cat > conftest.$ac_ext <<EOF
3571 #line 3572 "configure"
3572 #include "confdefs.h"
3573 #include <stdlib.h>
3574 EOF
3575 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3576   egrep "free" >/dev/null 2>&1; then
3577   :
3578 else
3579   rm -rf conftest*
3580   ac_cv_header_stdc=no
3581 fi
3582 rm -f conftest*
3583
3584 fi
3585
3586 if test $ac_cv_header_stdc = yes; then
3587   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3588 cat > conftest.$ac_ext <<EOF
3589 #line 3590 "configure"
3590 #include "confdefs.h"
3591 #include <ctype.h>
3592 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3593 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3594 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3595 int main () { int i; for (i = 0; i < 256; i++)
3596 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3597 exit (0); }
3598
3599 EOF
3600 if { (eval echo configure:3601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3601 then
3602   :
3603 else
3604   conftest_rc="$?"
3605   echo "configure: failed program was:" >&5
3606   cat conftest.$ac_ext >&5
3607   rm -fr conftest*
3608   ac_cv_header_stdc=no
3609 fi
3610 rm -fr conftest*
3611 fi
3612
3613 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3614 if test $ac_cv_header_stdc = yes; then
3615   { test "$extra_verbose" = "yes" && cat << \EOF
3616     Defining STDC_HEADERS
3617 EOF
3618 cat >> confdefs.h <<\EOF
3619 #define STDC_HEADERS 1
3620 EOF
3621 }
3622
3623 fi
3624
3625 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3626 echo "configure:3627: checking whether time.h and sys/time.h may both be included" >&5
3627
3628 cat > conftest.$ac_ext <<EOF
3629 #line 3630 "configure"
3630 #include "confdefs.h"
3631 #include <sys/types.h>
3632 #include <sys/time.h>
3633 #include <time.h>
3634 int main() {
3635 struct tm *tp;
3636 ; return 0; }
3637 EOF
3638 if { (eval echo configure:3639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3639   rm -rf conftest*
3640   ac_cv_header_time=yes
3641 else
3642   echo "configure: failed program was:" >&5
3643   cat conftest.$ac_ext >&5
3644   rm -rf conftest*
3645   ac_cv_header_time=no
3646 fi
3647 rm -f conftest*
3648
3649 echo "$ac_t""$ac_cv_header_time" 1>&6
3650 if test $ac_cv_header_time = yes; then
3651   { test "$extra_verbose" = "yes" && cat << \EOF
3652     Defining TIME_WITH_SYS_TIME
3653 EOF
3654 cat >> confdefs.h <<\EOF
3655 #define TIME_WITH_SYS_TIME 1
3656 EOF
3657 }
3658
3659 fi
3660
3661 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3662 echo "configure:3663: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3663
3664 cat > conftest.$ac_ext <<EOF
3665 #line 3666 "configure"
3666 #include "confdefs.h"
3667 #include <sys/types.h>
3668 #include <signal.h>
3669 /* NetBSD declares sys_siglist in unistd.h.  */
3670 #ifdef HAVE_UNISTD_H
3671 #include <unistd.h>
3672 #endif
3673 int main() {
3674 char *msg = *(sys_siglist + 1);
3675 ; return 0; }
3676 EOF
3677 if { (eval echo configure:3678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3678   rm -rf conftest*
3679   ac_cv_decl_sys_siglist=yes
3680 else
3681   echo "configure: failed program was:" >&5
3682   cat conftest.$ac_ext >&5
3683   rm -rf conftest*
3684   ac_cv_decl_sys_siglist=no
3685 fi
3686 rm -f conftest*
3687
3688 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3689 if test $ac_cv_decl_sys_siglist = yes; then
3690   { test "$extra_verbose" = "yes" && cat << \EOF
3691     Defining SYS_SIGLIST_DECLARED
3692 EOF
3693 cat >> confdefs.h <<\EOF
3694 #define SYS_SIGLIST_DECLARED 1
3695 EOF
3696 }
3697
3698 fi
3699
3700
3701 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3702 echo "configure:3703: checking for struct utimbuf" >&5
3703 cat > conftest.$ac_ext <<EOF
3704 #line 3705 "configure"
3705 #include "confdefs.h"
3706 #ifdef TIME_WITH_SYS_TIME
3707 #include <sys/time.h>
3708 #include <time.h>
3709 #else
3710 #ifdef HAVE_SYS_TIME_H
3711 #include <sys/time.h>
3712 #else
3713 #include <time.h>
3714 #endif
3715 #endif
3716 #ifdef HAVE_UTIME_H
3717 #include <utime.h>
3718 #endif
3719 int main() {
3720 static struct utimbuf x; x.actime = x.modtime;
3721 ; return 0; }
3722 EOF
3723 if { (eval echo configure:3724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3724   rm -rf conftest*
3725   echo "$ac_t""yes" 1>&6
3726    { test "$extra_verbose" = "yes" && cat << \EOF
3727     Defining HAVE_STRUCT_UTIMBUF
3728 EOF
3729 cat >> confdefs.h <<\EOF
3730 #define HAVE_STRUCT_UTIMBUF 1
3731 EOF
3732 }
3733
3734 else
3735   echo "configure: failed program was:" >&5
3736   cat conftest.$ac_ext >&5
3737   rm -rf conftest*
3738   echo "$ac_t""no" 1>&6
3739 fi
3740 rm -f conftest*
3741
3742 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3743 echo "configure:3744: checking return type of signal handlers" >&5
3744
3745 cat > conftest.$ac_ext <<EOF
3746 #line 3747 "configure"
3747 #include "confdefs.h"
3748 #include <sys/types.h>
3749 #include <signal.h>
3750 #ifdef signal
3751 #undef signal
3752 #endif
3753 #ifdef __cplusplus
3754 extern "C" void (*signal (int, void (*)(int)))(int);
3755 #else
3756 void (*signal ()) ();
3757 #endif
3758
3759 int main() {
3760 int i;
3761 ; return 0; }
3762 EOF
3763 if { (eval echo configure:3764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3764   rm -rf conftest*
3765   ac_cv_type_signal=void
3766 else
3767   echo "configure: failed program was:" >&5
3768   cat conftest.$ac_ext >&5
3769   rm -rf conftest*
3770   ac_cv_type_signal=int
3771 fi
3772 rm -f conftest*
3773
3774 echo "$ac_t""$ac_cv_type_signal" 1>&6
3775 { test "$extra_verbose" = "yes" && cat << EOF
3776     Defining RETSIGTYPE = $ac_cv_type_signal
3777 EOF
3778 cat >> confdefs.h <<EOF
3779 #define RETSIGTYPE $ac_cv_type_signal
3780 EOF
3781 }
3782
3783
3784 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3785 echo "configure:3786: checking for size_t" >&5
3786
3787 cat > conftest.$ac_ext <<EOF
3788 #line 3789 "configure"
3789 #include "confdefs.h"
3790 #include <sys/types.h>
3791 #if STDC_HEADERS
3792 #include <stdlib.h>
3793 #include <stddef.h>
3794 #endif
3795 EOF
3796 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3797   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3798   rm -rf conftest*
3799   ac_cv_type_size_t=yes
3800 else
3801   rm -rf conftest*
3802   ac_cv_type_size_t=no
3803 fi
3804 rm -f conftest*
3805
3806 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3807 if test $ac_cv_type_size_t = no; then
3808   { test "$extra_verbose" = "yes" && cat << \EOF
3809     Defining size_t = unsigned
3810 EOF
3811 cat >> confdefs.h <<\EOF
3812 #define size_t unsigned
3813 EOF
3814 }
3815
3816 fi
3817
3818 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3819 echo "configure:3820: checking for pid_t" >&5
3820
3821 cat > conftest.$ac_ext <<EOF
3822 #line 3823 "configure"
3823 #include "confdefs.h"
3824 #include <sys/types.h>
3825 #if STDC_HEADERS
3826 #include <stdlib.h>
3827 #include <stddef.h>
3828 #endif
3829 EOF
3830 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3831   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3832   rm -rf conftest*
3833   ac_cv_type_pid_t=yes
3834 else
3835   rm -rf conftest*
3836   ac_cv_type_pid_t=no
3837 fi
3838 rm -f conftest*
3839
3840 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3841 if test $ac_cv_type_pid_t = no; then
3842   { test "$extra_verbose" = "yes" && cat << \EOF
3843     Defining pid_t = int
3844 EOF
3845 cat >> confdefs.h <<\EOF
3846 #define pid_t int
3847 EOF
3848 }
3849
3850 fi
3851
3852 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3853 echo "configure:3854: checking for uid_t in sys/types.h" >&5
3854
3855 cat > conftest.$ac_ext <<EOF
3856 #line 3857 "configure"
3857 #include "confdefs.h"
3858 #include <sys/types.h>
3859 EOF
3860 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3861   egrep "uid_t" >/dev/null 2>&1; then
3862   rm -rf conftest*
3863   ac_cv_type_uid_t=yes
3864 else
3865   rm -rf conftest*
3866   ac_cv_type_uid_t=no
3867 fi
3868 rm -f conftest*
3869
3870
3871 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3872 if test $ac_cv_type_uid_t = no; then
3873   { test "$extra_verbose" = "yes" && cat << \EOF
3874     Defining uid_t = int
3875 EOF
3876 cat >> confdefs.h <<\EOF
3877 #define uid_t int
3878 EOF
3879 }
3880
3881   { test "$extra_verbose" = "yes" && cat << \EOF
3882     Defining gid_t = int
3883 EOF
3884 cat >> confdefs.h <<\EOF
3885 #define gid_t int
3886 EOF
3887 }
3888
3889 fi
3890
3891 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3892 echo "configure:3893: checking for mode_t" >&5
3893
3894 cat > conftest.$ac_ext <<EOF
3895 #line 3896 "configure"
3896 #include "confdefs.h"
3897 #include <sys/types.h>
3898 #if STDC_HEADERS
3899 #include <stdlib.h>
3900 #include <stddef.h>
3901 #endif
3902 EOF
3903 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3904   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3905   rm -rf conftest*
3906   ac_cv_type_mode_t=yes
3907 else
3908   rm -rf conftest*
3909   ac_cv_type_mode_t=no
3910 fi
3911 rm -f conftest*
3912
3913 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3914 if test $ac_cv_type_mode_t = no; then
3915   { test "$extra_verbose" = "yes" && cat << \EOF
3916     Defining mode_t = int
3917 EOF
3918 cat >> confdefs.h <<\EOF
3919 #define mode_t int
3920 EOF
3921 }
3922
3923 fi
3924
3925 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3926 echo "configure:3927: checking for off_t" >&5
3927
3928 cat > conftest.$ac_ext <<EOF
3929 #line 3930 "configure"
3930 #include "confdefs.h"
3931 #include <sys/types.h>
3932 #if STDC_HEADERS
3933 #include <stdlib.h>
3934 #include <stddef.h>
3935 #endif
3936 EOF
3937 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3938   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3939   rm -rf conftest*
3940   ac_cv_type_off_t=yes
3941 else
3942   rm -rf conftest*
3943   ac_cv_type_off_t=no
3944 fi
3945 rm -f conftest*
3946
3947 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3948 if test $ac_cv_type_off_t = no; then
3949   { test "$extra_verbose" = "yes" && cat << \EOF
3950     Defining off_t = long
3951 EOF
3952 cat >> confdefs.h <<\EOF
3953 #define off_t long
3954 EOF
3955 }
3956
3957 fi
3958
3959 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
3960 echo "configure:3961: checking for ssize_t" >&5
3961
3962 cat > conftest.$ac_ext <<EOF
3963 #line 3964 "configure"
3964 #include "confdefs.h"
3965 #include <sys/types.h>
3966 #if STDC_HEADERS
3967 #include <stdlib.h>
3968 #include <stddef.h>
3969 #endif
3970 EOF
3971 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3972   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3973   rm -rf conftest*
3974   ac_cv_type_ssize_t=yes
3975 else
3976   rm -rf conftest*
3977   ac_cv_type_ssize_t=no
3978 fi
3979 rm -f conftest*
3980
3981 echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
3982 if test $ac_cv_type_ssize_t = no; then
3983   { test "$extra_verbose" = "yes" && cat << \EOF
3984     Defining ssize_t = int
3985 EOF
3986 cat >> confdefs.h <<\EOF
3987 #define ssize_t int
3988 EOF
3989 }
3990
3991 fi
3992
3993
3994 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
3995 echo "configure:3996: checking for socklen_t" >&5
3996 cat > conftest.$ac_ext <<EOF
3997 #line 3998 "configure"
3998 #include "confdefs.h"
3999 #include <sys/socket.h>
4000 socklen_t x;
4001
4002 int main() {
4003
4004 ; return 0; }
4005 EOF
4006 if { (eval echo configure:4007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4007   rm -rf conftest*
4008   echo "$ac_t""yes" 1>&6
4009 else
4010   echo "configure: failed program was:" >&5
4011   cat conftest.$ac_ext >&5
4012   rm -rf conftest*
4013   
4014 cat > conftest.$ac_ext <<EOF
4015 #line 4016 "configure"
4016 #include "confdefs.h"
4017 #include <sys/socket.h>
4018 int accept (int, struct sockaddr *, size_t *);
4019
4020 int main() {
4021
4022 ; return 0; }
4023 EOF
4024 if { (eval echo configure:4025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4025   rm -rf conftest*
4026   
4027 echo "$ac_t""size_t" 1>&6
4028 { test "$extra_verbose" = "yes" && cat << \EOF
4029     Defining socklen_t = size_t
4030 EOF
4031 cat >> confdefs.h <<\EOF
4032 #define socklen_t size_t
4033 EOF
4034 }
4035
4036 else
4037   echo "configure: failed program was:" >&5
4038   cat conftest.$ac_ext >&5
4039   rm -rf conftest*
4040   
4041 echo "$ac_t""int" 1>&6
4042 { test "$extra_verbose" = "yes" && cat << \EOF
4043     Defining socklen_t = int
4044 EOF
4045 cat >> confdefs.h <<\EOF
4046 #define socklen_t int
4047 EOF
4048 }
4049
4050 fi
4051 rm -f conftest*
4052 fi
4053 rm -f conftest*
4054
4055 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
4056 echo "configure:4057: checking for struct timeval" >&5
4057 cat > conftest.$ac_ext <<EOF
4058 #line 4059 "configure"
4059 #include "confdefs.h"
4060 #ifdef TIME_WITH_SYS_TIME
4061 #include <sys/time.h>
4062 #include <time.h>
4063 #else
4064 #ifdef HAVE_SYS_TIME_H
4065 #include <sys/time.h>
4066 #else
4067 #include <time.h>
4068 #endif
4069 #endif
4070 int main() {
4071 static struct timeval x; x.tv_sec = x.tv_usec;
4072 ; return 0; }
4073 EOF
4074 if { (eval echo configure:4075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4075   rm -rf conftest*
4076   echo "$ac_t""yes" 1>&6
4077   HAVE_TIMEVAL=yes
4078   { test "$extra_verbose" = "yes" && cat << \EOF
4079     Defining HAVE_TIMEVAL
4080 EOF
4081 cat >> confdefs.h <<\EOF
4082 #define HAVE_TIMEVAL 1
4083 EOF
4084 }
4085
4086 else
4087   echo "configure: failed program was:" >&5
4088   cat conftest.$ac_ext >&5
4089   rm -rf conftest*
4090   echo "$ac_t""no" 1>&6
4091    HAVE_TIMEVAL=no
4092 fi
4093 rm -f conftest*
4094
4095 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
4096 echo "configure:4097: checking whether struct tm is in sys/time.h or time.h" >&5
4097
4098 cat > conftest.$ac_ext <<EOF
4099 #line 4100 "configure"
4100 #include "confdefs.h"
4101 #include <sys/types.h>
4102 #include <time.h>
4103 int main() {
4104 struct tm *tp; tp->tm_sec;
4105 ; return 0; }
4106 EOF
4107 if { (eval echo configure:4108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4108   rm -rf conftest*
4109   ac_cv_struct_tm=time.h
4110 else
4111   echo "configure: failed program was:" >&5
4112   cat conftest.$ac_ext >&5
4113   rm -rf conftest*
4114   ac_cv_struct_tm=sys/time.h
4115 fi
4116 rm -f conftest*
4117
4118 echo "$ac_t""$ac_cv_struct_tm" 1>&6
4119 if test $ac_cv_struct_tm = sys/time.h; then
4120   { test "$extra_verbose" = "yes" && cat << \EOF
4121     Defining TM_IN_SYS_TIME
4122 EOF
4123 cat >> confdefs.h <<\EOF
4124 #define TM_IN_SYS_TIME 1
4125 EOF
4126 }
4127
4128 fi
4129
4130 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
4131 echo "configure:4132: checking for tm_zone in struct tm" >&5
4132
4133 cat > conftest.$ac_ext <<EOF
4134 #line 4135 "configure"
4135 #include "confdefs.h"
4136 #include <sys/types.h>
4137 #include <$ac_cv_struct_tm>
4138 int main() {
4139 struct tm tm; tm.tm_zone;
4140 ; return 0; }
4141 EOF
4142 if { (eval echo configure:4143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4143   rm -rf conftest*
4144   ac_cv_struct_tm_zone=yes
4145 else
4146   echo "configure: failed program was:" >&5
4147   cat conftest.$ac_ext >&5
4148   rm -rf conftest*
4149   ac_cv_struct_tm_zone=no
4150 fi
4151 rm -f conftest*
4152
4153 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
4154 if test "$ac_cv_struct_tm_zone" = yes; then
4155   { test "$extra_verbose" = "yes" && cat << \EOF
4156     Defining HAVE_TM_ZONE
4157 EOF
4158 cat >> confdefs.h <<\EOF
4159 #define HAVE_TM_ZONE 1
4160 EOF
4161 }
4162
4163 else
4164   echo $ac_n "checking for tzname""... $ac_c" 1>&6
4165 echo "configure:4166: checking for tzname" >&5
4166
4167 cat > conftest.$ac_ext <<EOF
4168 #line 4169 "configure"
4169 #include "confdefs.h"
4170 #include <time.h>
4171 #ifndef tzname /* For SGI.  */
4172 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
4173 #endif
4174 int main() {
4175 atoi(*tzname);
4176 ; return 0; }
4177 EOF
4178 if { (eval echo configure:4179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4179   rm -rf conftest*
4180   ac_cv_var_tzname=yes
4181 else
4182   echo "configure: failed program was:" >&5
4183   cat conftest.$ac_ext >&5
4184   rm -rf conftest*
4185   ac_cv_var_tzname=no
4186 fi
4187 rm -f conftest*
4188
4189 echo "$ac_t""$ac_cv_var_tzname" 1>&6
4190   if test $ac_cv_var_tzname = yes; then
4191     { test "$extra_verbose" = "yes" && cat << \EOF
4192     Defining HAVE_TZNAME
4193 EOF
4194 cat >> confdefs.h <<\EOF
4195 #define HAVE_TZNAME 1
4196 EOF
4197 }
4198
4199   fi
4200 fi
4201
4202
4203 echo $ac_n "checking for working const""... $ac_c" 1>&6
4204 echo "configure:4205: checking for working const" >&5
4205
4206 cat > conftest.$ac_ext <<EOF
4207 #line 4208 "configure"
4208 #include "confdefs.h"
4209
4210 int main() {
4211
4212 /* Ultrix mips cc rejects this.  */
4213 typedef int charset[2]; const charset x;
4214 /* SunOS 4.1.1 cc rejects this.  */
4215 char const *const *ccp;
4216 char **p;
4217 /* NEC SVR4.0.2 mips cc rejects this.  */
4218 struct point {int x, y;};
4219 static struct point const zero = {0,0};
4220 /* AIX XL C 1.02.0.0 rejects this.
4221    It does not let you subtract one const X* pointer from another in an arm
4222    of an if-expression whose if-part is not a constant expression */
4223 const char *g = "string";
4224 ccp = &g + (g ? g-g : 0);
4225 /* HPUX 7.0 cc rejects these. */
4226 ++ccp;
4227 p = (char**) ccp;
4228 ccp = (char const *const *) p;
4229 { /* SCO 3.2v4 cc rejects this.  */
4230   char *t;
4231   char const *s = 0 ? (char *) 0 : (char const *) 0;
4232
4233   *t++ = 0;
4234 }
4235 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4236   int x[] = {25, 17};
4237   const int *foo = &x[0];
4238   ++foo;
4239 }
4240 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4241   typedef const int *iptr;
4242   iptr p = 0;
4243   ++p;
4244 }
4245 { /* AIX XL C 1.02.0.0 rejects this saying
4246      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4247   struct s { int j; const int *ap[3]; };
4248   struct s *b; b->j = 5;
4249 }
4250 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4251   const int foo = 10;
4252 }
4253
4254 ; return 0; }
4255 EOF
4256 if { (eval echo configure:4257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4257   rm -rf conftest*
4258   ac_cv_c_const=yes
4259 else
4260   echo "configure: failed program was:" >&5
4261   cat conftest.$ac_ext >&5
4262   rm -rf conftest*
4263   ac_cv_c_const=no
4264 fi
4265 rm -f conftest*
4266
4267 echo "$ac_t""$ac_cv_c_const" 1>&6
4268 if test $ac_cv_c_const = no; then
4269   { test "$extra_verbose" = "yes" && cat << \EOF
4270     Defining const = 
4271 EOF
4272 cat >> confdefs.h <<\EOF
4273 #define const 
4274 EOF
4275 }
4276
4277 fi
4278
4279
4280 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
4281 echo "configure:4282: checking whether ${MAKE-make} sets \${MAKE}" >&5
4282 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
4283
4284 cat > conftestmake <<\EOF
4285 all:
4286         @echo 'ac_maketemp="${MAKE}"'
4287 EOF
4288 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4289 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4290 if test -n "$ac_maketemp"; then
4291   eval ac_cv_prog_make_${ac_make}_set=yes
4292 else
4293   eval ac_cv_prog_make_${ac_make}_set=no
4294 fi
4295 rm -f conftestmake
4296 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4297   echo "$ac_t""yes" 1>&6
4298   SET_MAKE=
4299 else
4300   echo "$ac_t""no" 1>&6
4301   SET_MAKE="MAKE=${MAKE-make}"
4302 fi
4303
4304
4305 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4306 echo "configure:4307: checking whether byte ordering is bigendian" >&5
4307
4308 ac_cv_c_bigendian=unknown
4309 # See if sys/param.h defines the BYTE_ORDER macro.
4310 cat > conftest.$ac_ext <<EOF
4311 #line 4312 "configure"
4312 #include "confdefs.h"
4313 #include <sys/types.h>
4314 #include <sys/param.h>
4315 int main() {
4316
4317 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4318  bogus endian macros
4319 #endif
4320 ; return 0; }
4321 EOF
4322 if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4323   rm -rf conftest*
4324   # It does; now see whether it defined to BIG_ENDIAN or not.
4325 cat > conftest.$ac_ext <<EOF
4326 #line 4327 "configure"
4327 #include "confdefs.h"
4328 #include <sys/types.h>
4329 #include <sys/param.h>
4330 int main() {
4331
4332 #if BYTE_ORDER != BIG_ENDIAN
4333  not big endian
4334 #endif
4335 ; return 0; }
4336 EOF
4337 if { (eval echo configure:4338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4338   rm -rf conftest*
4339   ac_cv_c_bigendian=yes
4340 else
4341   echo "configure: failed program was:" >&5
4342   cat conftest.$ac_ext >&5
4343   rm -rf conftest*
4344   ac_cv_c_bigendian=no
4345 fi
4346 rm -f conftest*
4347 else
4348   echo "configure: failed program was:" >&5
4349   cat conftest.$ac_ext >&5
4350 fi
4351 rm -f conftest*
4352 if test $ac_cv_c_bigendian = unknown; then
4353 cat > conftest.$ac_ext <<EOF
4354 #line 4355 "configure"
4355 #include "confdefs.h"
4356 main () {
4357   /* Are we little or big endian?  From Harbison&Steele.  */
4358   union
4359   {
4360     long l;
4361     char c[sizeof (long)];
4362   } u;
4363   u.l = 1;
4364   exit (u.c[sizeof (long) - 1] == 1);
4365 }
4366 EOF
4367 if { (eval echo configure:4368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4368 then
4369   ac_cv_c_bigendian=no
4370 else
4371   conftest_rc="$?"
4372   echo "configure: failed program was:" >&5
4373   cat conftest.$ac_ext >&5
4374   rm -fr conftest*
4375   ac_cv_c_bigendian=yes
4376 fi
4377 rm -fr conftest*
4378 fi
4379
4380 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4381 if test $ac_cv_c_bigendian = yes; then
4382   { test "$extra_verbose" = "yes" && cat << \EOF
4383     Defining WORDS_BIGENDIAN
4384 EOF
4385 cat >> confdefs.h <<\EOF
4386 #define WORDS_BIGENDIAN 1
4387 EOF
4388 }
4389
4390 fi
4391
4392
4393 echo $ac_n "checking size of short""... $ac_c" 1>&6
4394 echo "configure:4395: checking size of short" >&5
4395
4396 cat > conftest.$ac_ext <<EOF
4397 #line 4398 "configure"
4398 #include "confdefs.h"
4399 #include <stdio.h>
4400 #include <sys/types.h>
4401 main()
4402 {
4403   FILE *f=fopen("conftestval", "w");
4404   if (!f) exit(1);
4405   fprintf(f, "%d\n", sizeof(short));
4406   exit(0);
4407 }
4408 EOF
4409 if { (eval echo configure:4410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4410 then
4411   ac_cv_sizeof_short=`cat conftestval`
4412 else
4413   conftest_rc="$?"
4414   echo "configure: failed program was:" >&5
4415   cat conftest.$ac_ext >&5
4416   rm -fr conftest*
4417   ac_cv_sizeof_short=0
4418 fi
4419 rm -fr conftest*
4420 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4421 { test "$extra_verbose" = "yes" && cat << EOF
4422     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4423 EOF
4424 cat >> confdefs.h <<EOF
4425 #define SIZEOF_SHORT $ac_cv_sizeof_short
4426 EOF
4427 }
4428
4429
4430 if test "$ac_cv_sizeof_short" = 0; then
4431   echo ""
4432   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4433   echo "*** PANIC *** Please examine config.log for compilation errors."
4434   exit 1
4435 fi
4436 echo $ac_n "checking size of int""... $ac_c" 1>&6
4437 echo "configure:4438: checking size of int" >&5
4438
4439 cat > conftest.$ac_ext <<EOF
4440 #line 4441 "configure"
4441 #include "confdefs.h"
4442 #include <stdio.h>
4443 #include <sys/types.h>
4444 main()
4445 {
4446   FILE *f=fopen("conftestval", "w");
4447   if (!f) exit(1);
4448   fprintf(f, "%d\n", sizeof(int));
4449   exit(0);
4450 }
4451 EOF
4452 if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4453 then
4454   ac_cv_sizeof_int=`cat conftestval`
4455 else
4456   conftest_rc="$?"
4457   echo "configure: failed program was:" >&5
4458   cat conftest.$ac_ext >&5
4459   rm -fr conftest*
4460   ac_cv_sizeof_int=0
4461 fi
4462 rm -fr conftest*
4463 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4464 { test "$extra_verbose" = "yes" && cat << EOF
4465     Defining SIZEOF_INT = $ac_cv_sizeof_int
4466 EOF
4467 cat >> confdefs.h <<EOF
4468 #define SIZEOF_INT $ac_cv_sizeof_int
4469 EOF
4470 }
4471
4472
4473 echo $ac_n "checking size of long""... $ac_c" 1>&6
4474 echo "configure:4475: checking size of long" >&5
4475
4476 cat > conftest.$ac_ext <<EOF
4477 #line 4478 "configure"
4478 #include "confdefs.h"
4479 #include <stdio.h>
4480 #include <sys/types.h>
4481 main()
4482 {
4483   FILE *f=fopen("conftestval", "w");
4484   if (!f) exit(1);
4485   fprintf(f, "%d\n", sizeof(long));
4486   exit(0);
4487 }
4488 EOF
4489 if { (eval echo configure:4490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4490 then
4491   ac_cv_sizeof_long=`cat conftestval`
4492 else
4493   conftest_rc="$?"
4494   echo "configure: failed program was:" >&5
4495   cat conftest.$ac_ext >&5
4496   rm -fr conftest*
4497   ac_cv_sizeof_long=0
4498 fi
4499 rm -fr conftest*
4500 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4501 { test "$extra_verbose" = "yes" && cat << EOF
4502     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4503 EOF
4504 cat >> confdefs.h <<EOF
4505 #define SIZEOF_LONG $ac_cv_sizeof_long
4506 EOF
4507 }
4508
4509
4510 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4511 echo "configure:4512: checking size of long long" >&5
4512
4513 cat > conftest.$ac_ext <<EOF
4514 #line 4515 "configure"
4515 #include "confdefs.h"
4516 #include <stdio.h>
4517 #include <sys/types.h>
4518 main()
4519 {
4520   FILE *f=fopen("conftestval", "w");
4521   if (!f) exit(1);
4522   fprintf(f, "%d\n", sizeof(long 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_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_long=0
4535 fi
4536 rm -fr conftest*
4537 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4538 { test "$extra_verbose" = "yes" && cat << EOF
4539     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4540 EOF
4541 cat >> confdefs.h <<EOF
4542 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4543 EOF
4544 }
4545
4546
4547 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4548 echo "configure:4549: checking size of void *" >&5
4549
4550 cat > conftest.$ac_ext <<EOF
4551 #line 4552 "configure"
4552 #include "confdefs.h"
4553 #include <stdio.h>
4554 #include <sys/types.h>
4555 main()
4556 {
4557   FILE *f=fopen("conftestval", "w");
4558   if (!f) exit(1);
4559   fprintf(f, "%d\n", sizeof(void *));
4560   exit(0);
4561 }
4562 EOF
4563 if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4564 then
4565   ac_cv_sizeof_void_p=`cat conftestval`
4566 else
4567   conftest_rc="$?"
4568   echo "configure: failed program was:" >&5
4569   cat conftest.$ac_ext >&5
4570   rm -fr conftest*
4571   ac_cv_sizeof_void_p=0
4572 fi
4573 rm -fr conftest*
4574 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4575 { test "$extra_verbose" = "yes" && cat << EOF
4576     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4577 EOF
4578 cat >> confdefs.h <<EOF
4579 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4580 EOF
4581 }
4582
4583
4584
4585 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4586 echo "configure:4587: checking for long file names" >&5
4587
4588 ac_cv_sys_long_file_names=yes
4589 # Test for long file names in all the places we know might matter:
4590 #      .                the current directory, where building will happen
4591 #      $prefix/lib      where we will be installing things
4592 #      $exec_prefix/lib likewise
4593 # eval it to expand exec_prefix.
4594 #      $TMPDIR          if set, where it might want to write temporary files
4595 # if $TMPDIR is not set:
4596 #      /tmp             where it might want to write temporary files
4597 #      /var/tmp         likewise
4598 #      /usr/tmp         likewise
4599 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4600   ac_tmpdirs="$TMPDIR"
4601 else
4602   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4603 fi
4604 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4605   test -d $ac_dir || continue
4606   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4607   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4608   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4609   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4610   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4611     ac_cv_sys_long_file_names=no
4612     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4613     break
4614   fi
4615   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4616 done
4617
4618 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4619 if test $ac_cv_sys_long_file_names = yes; then
4620   { test "$extra_verbose" = "yes" && cat << \EOF
4621     Defining HAVE_LONG_FILE_NAMES
4622 EOF
4623 cat >> confdefs.h <<\EOF
4624 #define HAVE_LONG_FILE_NAMES 1
4625 EOF
4626 }
4627
4628 fi
4629
4630
4631 echo $ac_n "checking for sin""... $ac_c" 1>&6
4632 echo "configure:4633: checking for sin" >&5
4633
4634 cat > conftest.$ac_ext <<EOF
4635 #line 4636 "configure"
4636 #include "confdefs.h"
4637 /* System header to define __stub macros and hopefully few prototypes,
4638     which can conflict with char sin(); below.  */
4639 #include <assert.h>
4640 /* Override any gcc2 internal prototype to avoid an error.  */
4641 /* We use char because int might match the return type of a gcc2
4642     builtin and then its argument prototype would still apply.  */
4643 char sin();
4644
4645 int main() {
4646
4647 /* The GNU C library defines this for functions which it implements
4648     to always fail with ENOSYS.  Some functions are actually named
4649     something starting with __ and the normal name is an alias.  */
4650 #if defined (__stub_sin) || defined (__stub___sin)
4651 choke me
4652 #else
4653 sin();
4654 #endif
4655
4656 ; return 0; }
4657 EOF
4658 if { (eval echo configure:4659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4659   rm -rf conftest*
4660   eval "ac_cv_func_sin=yes"
4661 else
4662   echo "configure: failed program was:" >&5
4663   cat conftest.$ac_ext >&5
4664   rm -rf conftest*
4665   eval "ac_cv_func_sin=no"
4666 fi
4667 rm -f conftest*
4668
4669 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4670   echo "$ac_t""yes" 1>&6
4671   :
4672 else
4673   echo "$ac_t""no" 1>&6
4674
4675 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4676 echo "configure:4677: checking for sin in -lm" >&5
4677 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4678
4679 xe_check_libs=" -lm "
4680 cat > conftest.$ac_ext <<EOF
4681 #line 4682 "configure"
4682 #include "confdefs.h"
4683 /* Override any gcc2 internal prototype to avoid an error.  */
4684 /* We use char because int might match the return type of a gcc2
4685     builtin and then its argument prototype would still apply.  */
4686 char sin();
4687
4688 int main() {
4689 sin()
4690 ; return 0; }
4691 EOF
4692 if { (eval echo configure:4693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4693   rm -rf conftest*
4694   eval "ac_cv_lib_$ac_lib_var=yes"
4695 else
4696   echo "configure: failed program was:" >&5
4697   cat conftest.$ac_ext >&5
4698   rm -rf conftest*
4699   eval "ac_cv_lib_$ac_lib_var=no"
4700 fi
4701 rm -f conftest*
4702 xe_check_libs=""
4703
4704 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4705   echo "$ac_t""yes" 1>&6
4706     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4707     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4708   { test "$extra_verbose" = "yes" && cat << EOF
4709     Defining $ac_tr_lib
4710 EOF
4711 cat >> confdefs.h <<EOF
4712 #define $ac_tr_lib 1
4713 EOF
4714 }
4715
4716   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4717
4718 else
4719   echo "$ac_t""no" 1>&6
4720 fi
4721
4722
4723 fi
4724
4725
4726 { test "$extra_verbose" = "yes" && cat << \EOF
4727     Defining LISP_FLOAT_TYPE
4728 EOF
4729 cat >> confdefs.h <<\EOF
4730 #define LISP_FLOAT_TYPE 1
4731 EOF
4732 }
4733
4734
4735 cat > conftest.$ac_ext <<EOF
4736 #line 4737 "configure"
4737 #include "confdefs.h"
4738 #include <math.h>
4739 int main() {
4740 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4741 ; return 0; }
4742 EOF
4743 if { (eval echo configure:4744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4744   rm -rf conftest*
4745   { test "$extra_verbose" = "yes" && cat << \EOF
4746     Defining HAVE_INVERSE_HYPERBOLIC
4747 EOF
4748 cat >> confdefs.h <<\EOF
4749 #define HAVE_INVERSE_HYPERBOLIC 1
4750 EOF
4751 }
4752
4753 else
4754   echo "configure: failed program was:" >&5
4755   cat conftest.$ac_ext >&5
4756 fi
4757 rm -f conftest*
4758
4759 echo "checking type of mail spool file locking" 1>&6
4760 echo "configure:4761: checking type of mail spool file locking" >&5
4761 for ac_func in lockf flock
4762 do
4763 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4764 echo "configure:4765: checking for $ac_func" >&5
4765
4766 cat > conftest.$ac_ext <<EOF
4767 #line 4768 "configure"
4768 #include "confdefs.h"
4769 /* System header to define __stub macros and hopefully few prototypes,
4770     which can conflict with char $ac_func(); below.  */
4771 #include <assert.h>
4772 /* Override any gcc2 internal prototype to avoid an error.  */
4773 /* We use char because int might match the return type of a gcc2
4774     builtin and then its argument prototype would still apply.  */
4775 char $ac_func();
4776
4777 int main() {
4778
4779 /* The GNU C library defines this for functions which it implements
4780     to always fail with ENOSYS.  Some functions are actually named
4781     something starting with __ and the normal name is an alias.  */
4782 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4783 choke me
4784 #else
4785 $ac_func();
4786 #endif
4787
4788 ; return 0; }
4789 EOF
4790 if { (eval echo configure:4791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4791   rm -rf conftest*
4792   eval "ac_cv_func_$ac_func=yes"
4793 else
4794   echo "configure: failed program was:" >&5
4795   cat conftest.$ac_ext >&5
4796   rm -rf conftest*
4797   eval "ac_cv_func_$ac_func=no"
4798 fi
4799 rm -f conftest*
4800
4801 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4802   echo "$ac_t""yes" 1>&6
4803     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4804   { test "$extra_verbose" = "yes" && cat << EOF
4805     Defining $ac_tr_func
4806 EOF
4807 cat >> confdefs.h <<EOF
4808 #define $ac_tr_func 1
4809 EOF
4810 }
4811  
4812 else
4813   echo "$ac_t""no" 1>&6
4814 fi
4815 done
4816
4817 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4818 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4819 test -z "$mail_locking" -a "$mail_use_locking" = "yes" && mail_locking=locking
4820 if   test -z "$mail_locking"; then
4821   case "$opsys" in cygwin* | mingw*)
4822     mail_locking=pop ;;
4823   esac
4824 fi
4825
4826 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4827     Defining MAIL_LOCK_LOCKF
4828 EOF
4829 cat >> confdefs.h <<\EOF
4830 #define MAIL_LOCK_LOCKF 1
4831 EOF
4832 }
4833
4834 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4835     Defining MAIL_LOCK_FLOCK
4836 EOF
4837 cat >> confdefs.h <<\EOF
4838 #define MAIL_LOCK_FLOCK 1
4839 EOF
4840 }
4841
4842 elif test "$mail_locking" = "locking"; then { test "$extra_verbose" = "yes" && cat << \EOF
4843     Defining MAIL_LOCK_LOCKING
4844 EOF
4845 cat >> confdefs.h <<\EOF
4846 #define MAIL_LOCK_LOCKING 1
4847 EOF
4848 }
4849
4850 elif test "$mail_locking" = "pop"; then
4851   with_pop=yes
4852   mail_locking=
4853 else mail_locking="dot-locking"; { test "$extra_verbose" = "yes" && cat << \EOF
4854     Defining MAIL_LOCK_DOT
4855 EOF
4856 cat >> confdefs.h <<\EOF
4857 #define MAIL_LOCK_DOT 1
4858 EOF
4859 }
4860
4861 fi
4862 test "$mail_locking" = "lockf" -a "$ac_cv_func_lockf" != "yes" && \
4863   { echo "Error:" "lockf mail locking requested but not available." >&2; exit 1; }
4864 test "$mail_locking" = "flock" -a "$ac_cv_func_flock" != "yes" && \
4865   { echo "Error:" "flock mail locking requested but not available." >&2; exit 1; }
4866 test "$mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \
4867   { echo "Error:" "locking mail locking requested but not available." >&2; exit 1; }
4868
4869 case "$opsys" in decosf*)
4870   
4871 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4872 echo "configure:4873: checking for cma_open in -lpthreads" >&5
4873 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4874
4875 xe_check_libs=" -lpthreads "
4876 cat > conftest.$ac_ext <<EOF
4877 #line 4878 "configure"
4878 #include "confdefs.h"
4879 /* Override any gcc2 internal prototype to avoid an error.  */
4880 /* We use char because int might match the return type of a gcc2
4881     builtin and then its argument prototype would still apply.  */
4882 char cma_open();
4883
4884 int main() {
4885 cma_open()
4886 ; return 0; }
4887 EOF
4888 if { (eval echo configure:4889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4889   rm -rf conftest*
4890   eval "ac_cv_lib_$ac_lib_var=yes"
4891 else
4892   echo "configure: failed program was:" >&5
4893   cat conftest.$ac_ext >&5
4894   rm -rf conftest*
4895   eval "ac_cv_lib_$ac_lib_var=no"
4896 fi
4897 rm -f conftest*
4898 xe_check_libs=""
4899
4900 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4901   echo "$ac_t""yes" 1>&6
4902     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4903     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4904   { test "$extra_verbose" = "yes" && cat << EOF
4905     Defining $ac_tr_lib
4906 EOF
4907 cat >> confdefs.h <<EOF
4908 #define $ac_tr_lib 1
4909 EOF
4910 }
4911
4912   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4913
4914 else
4915   echo "$ac_t""no" 1>&6
4916 fi
4917
4918
4919   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4920     c_switch_site="$c_switch_site -threads" ;;
4921 esac
4922
4923 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4924 echo "configure:4925: checking whether the -xildoff compiler flag is required" >&5
4925 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4926   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4927     then echo "$ac_t""no" 1>&6;
4928     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
4929   fi
4930   else echo "$ac_t""no" 1>&6
4931 fi
4932
4933 if test "$opsys" = "sol2"; then
4934   if test "$os_release" -ge 56; then
4935     echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4936 echo "configure:4937: checking for \"-z ignore\" linker flag" >&5
4937     case "`ld -h 2>&1`" in
4938       *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4939         ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4940       *) echo "$ac_t""no" 1>&6 ;;
4941     esac
4942   fi
4943 fi
4944
4945
4946 echo "checking "for specified window system"" 1>&6
4947 echo "configure:4948: checking "for specified window system"" >&5
4948
4949 if test "$with_x11" != "no"; then
4950     test "$x_includes $x_libraries" != "NONE NONE" && \
4951    window_system=x11 with_x11=yes
4952
4953         
4954       if test "$x_includes $x_libraries" = "NONE NONE" \
4955     -a -n "$OPENWINHOME" \
4956     -a "$OPENWINHOME" != "/usr/openwin" \
4957     -a -d "$OPENWINHOME"; then
4958       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4959       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4960       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4961   fi
4962
4963   if test "$x_includes" = "NONE"; then
4964                     for dir in "/usr/X11" "/usr/X11R6"; do
4965       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4966     done
4967   fi
4968
4969   if test "$x_libraries" = "NONE"; then
4970     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4971       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4972     done
4973   fi
4974
4975   # If we find X, set shell vars x_includes and x_libraries to the
4976 # paths, otherwise set no_x=yes.
4977 # Uses ac_ vars as temps to allow command line to override cache and checks.
4978 # --without-x overrides everything else, but does not touch the cache.
4979 echo $ac_n "checking for X""... $ac_c" 1>&6
4980 echo "configure:4981: checking for X" >&5
4981
4982 # Check whether --with-x or --without-x was given.
4983 if test "${with_x+set}" = set; then
4984   withval="$with_x"
4985   :
4986 fi
4987
4988 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4989 if test "x$with_x" = xno; then
4990   # The user explicitly disabled X.
4991   have_x=disabled
4992 else
4993   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4994     # Both variables are already set.
4995     have_x=yes
4996   else
4997
4998 # One or both of the vars are not set, and there is no cached value.
4999 ac_x_includes=NO ac_x_libraries=NO
5000 rm -fr conftestdir
5001 if mkdir conftestdir; then
5002   cd conftestdir
5003   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
5004   cat > Imakefile <<'EOF'
5005 acfindx:
5006         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
5007 EOF
5008   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5009     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5010     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
5011     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
5012     for ac_extension in a so sl; do
5013       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
5014         test -f $ac_im_libdir/libX11.$ac_extension; then
5015         ac_im_usrlibdir=$ac_im_libdir; break
5016       fi
5017     done
5018     # Screen out bogus values from the imake configuration.  They are
5019     # bogus both because they are the default anyway, and because
5020     # using them would break gcc on systems where it needs fixed includes.
5021     case "$ac_im_incroot" in
5022         /usr/include) ;;
5023         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
5024     esac
5025     case "$ac_im_usrlibdir" in
5026         /usr/lib | /lib) ;;
5027         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
5028     esac
5029   fi
5030   cd ..
5031   rm -fr conftestdir
5032 fi
5033
5034 if test "$ac_x_includes" = NO; then
5035   # Guess where to find include files, by looking for this one X11 .h file.
5036   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
5037
5038   # First, try using that file with no special directory specified.
5039 cat > conftest.$ac_ext <<EOF
5040 #line 5041 "configure"
5041 #include "confdefs.h"
5042 #include <$x_direct_test_include>
5043 EOF
5044 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5045 { (eval echo configure:5046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5046 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5047 if test -z "$ac_err"; then
5048   rm -rf conftest*
5049   # We can compile using X headers with no special include directory.
5050 ac_x_includes=
5051 else
5052   echo "$ac_err" >&5
5053   echo "configure: failed program was:" >&5
5054   cat conftest.$ac_ext >&5
5055   rm -rf conftest*
5056   # Look for the header file in a standard set of common directories.
5057 # Check X11 before X11Rn because it is often a symlink to the current release.
5058   for ac_dir in               \
5059     /usr/X11/include          \
5060     /usr/X11R6/include        \
5061     /usr/X11R5/include        \
5062     /usr/X11R4/include        \
5063                               \
5064     /usr/include/X11          \
5065     /usr/include/X11R6        \
5066     /usr/include/X11R5        \
5067     /usr/include/X11R4        \
5068                               \
5069     /usr/local/X11/include    \
5070     /usr/local/X11R6/include  \
5071     /usr/local/X11R5/include  \
5072     /usr/local/X11R4/include  \
5073                               \
5074     /usr/local/include/X11    \
5075     /usr/local/include/X11R6  \
5076     /usr/local/include/X11R5  \
5077     /usr/local/include/X11R4  \
5078                               \
5079     /usr/X386/include         \
5080     /usr/x386/include         \
5081     /usr/XFree86/include/X11  \
5082                               \
5083     /usr/include              \
5084     /usr/local/include        \
5085     /usr/unsupported/include  \
5086     /usr/athena/include       \
5087     /usr/local/x11r5/include  \
5088     /usr/lpp/Xamples/include  \
5089                               \
5090     /usr/openwin/include      \
5091     /usr/openwin/share/include \
5092     ; \
5093   do
5094     if test -r "$ac_dir/$x_direct_test_include"; then
5095       ac_x_includes=$ac_dir
5096       break
5097     fi
5098   done
5099 fi
5100 rm -f conftest*
5101 fi # $ac_x_includes = NO
5102
5103 if test "$ac_x_libraries" = NO; then
5104   # Check for the libraries.
5105
5106   test -z "$x_direct_test_library" && x_direct_test_library=Xt
5107   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
5108
5109   # See if we find them without any special options.
5110   # Don't add to $LIBS permanently.
5111   ac_save_LIBS="$LIBS"
5112   LIBS="-l$x_direct_test_library $LIBS"
5113 cat > conftest.$ac_ext <<EOF
5114 #line 5115 "configure"
5115 #include "confdefs.h"
5116
5117 int main() {
5118 ${x_direct_test_function}()
5119 ; return 0; }
5120 EOF
5121 if { (eval echo configure:5122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5122   rm -rf conftest*
5123   LIBS="$ac_save_LIBS"
5124 # We can link X programs with no special library path.
5125 ac_x_libraries=
5126 else
5127   echo "configure: failed program was:" >&5
5128   cat conftest.$ac_ext >&5
5129   rm -rf conftest*
5130   LIBS="$ac_save_LIBS"
5131 # First see if replacing the include by lib works.
5132 # Check X11 before X11Rn because it is often a symlink to the current release.
5133 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
5134     /usr/X11/lib          \
5135     /usr/X11R6/lib        \
5136     /usr/X11R5/lib        \
5137     /usr/X11R4/lib        \
5138                           \
5139     /usr/lib/X11          \
5140     /usr/lib/X11R6        \
5141     /usr/lib/X11R5        \
5142     /usr/lib/X11R4        \
5143                           \
5144     /usr/local/X11/lib    \
5145     /usr/local/X11R6/lib  \
5146     /usr/local/X11R5/lib  \
5147     /usr/local/X11R4/lib  \
5148                           \
5149     /usr/local/lib/X11    \
5150     /usr/local/lib/X11R6  \
5151     /usr/local/lib/X11R5  \
5152     /usr/local/lib/X11R4  \
5153                           \
5154     /usr/X386/lib         \
5155     /usr/x386/lib         \
5156     /usr/XFree86/lib/X11  \
5157                           \
5158     /usr/lib              \
5159     /usr/local/lib        \
5160     /usr/unsupported/lib  \
5161     /usr/athena/lib       \
5162     /usr/local/x11r5/lib  \
5163     /usr/lpp/Xamples/lib  \
5164     /lib/usr/lib/X11      \
5165                           \
5166     /usr/openwin/lib      \
5167     /usr/openwin/share/lib \
5168     ; \
5169 do
5170   for ac_extension in a so sl; do
5171     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
5172       ac_x_libraries=$ac_dir
5173       break 2
5174     fi
5175   done
5176 done
5177 fi
5178 rm -f conftest*
5179 fi # $ac_x_libraries = NO
5180
5181 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
5182   # Didn't find X anywhere.  Cache the known absence of X.
5183   ac_cv_have_x="have_x=no"
5184 else
5185   # Record where we found X for the cache.
5186   ac_cv_have_x="have_x=yes \
5187                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
5188 fi
5189   fi
5190   eval "$ac_cv_have_x"
5191 fi # $with_x != no
5192
5193 if test "$have_x" != yes; then
5194   echo "$ac_t""$have_x" 1>&6
5195   no_x=yes
5196 else
5197   # If each of the values was on the command line, it overrides each guess.
5198   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
5199   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
5200   # Update the cache value to reflect the command line values.
5201   ac_cv_have_x="have_x=yes \
5202                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
5203   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
5204 fi
5205
5206 if test "$no_x" = yes; then
5207   # Not all programs may use this symbol, but it does not hurt to define it.
5208   { test "$extra_verbose" = "yes" && cat << \EOF
5209     Defining X_DISPLAY_MISSING
5210 EOF
5211 cat >> confdefs.h <<\EOF
5212 #define X_DISPLAY_MISSING 1
5213 EOF
5214 }
5215
5216   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
5217 else
5218   if test -n "$x_includes"; then
5219     X_CFLAGS="$X_CFLAGS -I$x_includes"
5220   fi
5221
5222   # It would also be nice to do this for all -L options, not just this one.
5223   if test -n "$x_libraries"; then
5224     X_LIBS="$X_LIBS -L$x_libraries"
5225     # For Solaris; some versions of Sun CC require a space after -R and
5226     # others require no space.  Words are not sufficient . . . .
5227     case "`(uname -sr) 2>/dev/null`" in
5228     "SunOS 5"*)
5229       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
5230 echo "configure:5231: checking whether -R must be followed by a space" >&5
5231       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
5232       cat > conftest.$ac_ext <<EOF
5233 #line 5234 "configure"
5234 #include "confdefs.h"
5235
5236 int main() {
5237
5238 ; return 0; }
5239 EOF
5240 if { (eval echo configure:5241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5241   rm -rf conftest*
5242   ac_R_nospace=yes
5243 else
5244   echo "configure: failed program was:" >&5
5245   cat conftest.$ac_ext >&5
5246   rm -rf conftest*
5247   ac_R_nospace=no
5248 fi
5249 rm -f conftest*
5250       if test $ac_R_nospace = yes; then
5251         echo "$ac_t""no" 1>&6
5252         X_LIBS="$X_LIBS -R$x_libraries"
5253       else
5254         LIBS="$ac_xsave_LIBS -R $x_libraries"
5255         cat > conftest.$ac_ext <<EOF
5256 #line 5257 "configure"
5257 #include "confdefs.h"
5258
5259 int main() {
5260
5261 ; return 0; }
5262 EOF
5263 if { (eval echo configure:5264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5264   rm -rf conftest*
5265   ac_R_space=yes
5266 else
5267   echo "configure: failed program was:" >&5
5268   cat conftest.$ac_ext >&5
5269   rm -rf conftest*
5270   ac_R_space=no
5271 fi
5272 rm -f conftest*
5273         if test $ac_R_space = yes; then
5274           echo "$ac_t""yes" 1>&6
5275           X_LIBS="$X_LIBS -R $x_libraries"
5276         else
5277           echo "$ac_t""neither works" 1>&6
5278         fi
5279       fi
5280       LIBS="$ac_xsave_LIBS"
5281     esac
5282   fi
5283
5284   # Check for system-dependent libraries X programs must link with.
5285   # Do this before checking for the system-independent R6 libraries
5286   # (-lICE), since we may need -lsocket or whatever for X linking.
5287
5288   if test "$ISC" = yes; then
5289     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
5290   else
5291     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
5292     # libraries were built with DECnet support.  And karl@cs.umb.edu says
5293     # the Alpha needs dnet_stub (dnet does not exist).
5294     if test "$with_dnet" = "no" ; then
5295 ac_cv_lib_dnet_dnet_ntoa=no
5296 else
5297
5298 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
5299 echo "configure:5300: checking for dnet_ntoa in -ldnet" >&5
5300 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
5301
5302 xe_check_libs=" -ldnet "
5303 cat > conftest.$ac_ext <<EOF
5304 #line 5305 "configure"
5305 #include "confdefs.h"
5306 /* Override any gcc2 internal prototype to avoid an error.  */
5307 /* We use char because int might match the return type of a gcc2
5308     builtin and then its argument prototype would still apply.  */
5309 char dnet_ntoa();
5310
5311 int main() {
5312 dnet_ntoa()
5313 ; return 0; }
5314 EOF
5315 if { (eval echo configure:5316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5316   rm -rf conftest*
5317   eval "ac_cv_lib_$ac_lib_var=yes"
5318 else
5319   echo "configure: failed program was:" >&5
5320   cat conftest.$ac_ext >&5
5321   rm -rf conftest*
5322   eval "ac_cv_lib_$ac_lib_var=no"
5323 fi
5324 rm -f conftest*
5325 xe_check_libs=""
5326
5327 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5328   echo "$ac_t""yes" 1>&6
5329   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
5330 else
5331   echo "$ac_t""no" 1>&6
5332 fi
5333
5334 fi
5335
5336     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
5337       
5338 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
5339 echo "configure:5340: checking for dnet_ntoa in -ldnet_stub" >&5
5340 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
5341
5342 xe_check_libs=" -ldnet_stub "
5343 cat > conftest.$ac_ext <<EOF
5344 #line 5345 "configure"
5345 #include "confdefs.h"
5346 /* Override any gcc2 internal prototype to avoid an error.  */
5347 /* We use char because int might match the return type of a gcc2
5348     builtin and then its argument prototype would still apply.  */
5349 char dnet_ntoa();
5350
5351 int main() {
5352 dnet_ntoa()
5353 ; return 0; }
5354 EOF
5355 if { (eval echo configure:5356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5356   rm -rf conftest*
5357   eval "ac_cv_lib_$ac_lib_var=yes"
5358 else
5359   echo "configure: failed program was:" >&5
5360   cat conftest.$ac_ext >&5
5361   rm -rf conftest*
5362   eval "ac_cv_lib_$ac_lib_var=no"
5363 fi
5364 rm -f conftest*
5365 xe_check_libs=""
5366
5367 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5368   echo "$ac_t""yes" 1>&6
5369   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
5370 else
5371   echo "$ac_t""no" 1>&6
5372 fi
5373
5374
5375     fi
5376
5377     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
5378     # to get the SysV transport functions.
5379     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5380     # needs -lnsl.
5381     # The nsl library prevents programs from opening the X display
5382     # on Irix 5.2, according to dickey@clark.net.
5383     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5384 echo "configure:5385: checking for gethostbyname" >&5
5385
5386 cat > conftest.$ac_ext <<EOF
5387 #line 5388 "configure"
5388 #include "confdefs.h"
5389 /* System header to define __stub macros and hopefully few prototypes,
5390     which can conflict with char gethostbyname(); below.  */
5391 #include <assert.h>
5392 /* Override any gcc2 internal prototype to avoid an error.  */
5393 /* We use char because int might match the return type of a gcc2
5394     builtin and then its argument prototype would still apply.  */
5395 char gethostbyname();
5396
5397 int main() {
5398
5399 /* The GNU C library defines this for functions which it implements
5400     to always fail with ENOSYS.  Some functions are actually named
5401     something starting with __ and the normal name is an alias.  */
5402 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5403 choke me
5404 #else
5405 gethostbyname();
5406 #endif
5407
5408 ; return 0; }
5409 EOF
5410 if { (eval echo configure:5411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5411   rm -rf conftest*
5412   eval "ac_cv_func_gethostbyname=yes"
5413 else
5414   echo "configure: failed program was:" >&5
5415   cat conftest.$ac_ext >&5
5416   rm -rf conftest*
5417   eval "ac_cv_func_gethostbyname=no"
5418 fi
5419 rm -f conftest*
5420
5421 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5422   echo "$ac_t""yes" 1>&6
5423   :
5424 else
5425   echo "$ac_t""no" 1>&6
5426 fi
5427
5428     if test $ac_cv_func_gethostbyname = no; then
5429       
5430 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5431 echo "configure:5432: checking for gethostbyname in -lnsl" >&5
5432 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5433
5434 xe_check_libs=" -lnsl "
5435 cat > conftest.$ac_ext <<EOF
5436 #line 5437 "configure"
5437 #include "confdefs.h"
5438 /* Override any gcc2 internal prototype to avoid an error.  */
5439 /* We use char because int might match the return type of a gcc2
5440     builtin and then its argument prototype would still apply.  */
5441 char gethostbyname();
5442
5443 int main() {
5444 gethostbyname()
5445 ; return 0; }
5446 EOF
5447 if { (eval echo configure:5448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5448   rm -rf conftest*
5449   eval "ac_cv_lib_$ac_lib_var=yes"
5450 else
5451   echo "configure: failed program was:" >&5
5452   cat conftest.$ac_ext >&5
5453   rm -rf conftest*
5454   eval "ac_cv_lib_$ac_lib_var=no"
5455 fi
5456 rm -f conftest*
5457 xe_check_libs=""
5458
5459 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5460   echo "$ac_t""yes" 1>&6
5461   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5462 else
5463   echo "$ac_t""no" 1>&6
5464 fi
5465
5466
5467     fi
5468
5469     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5470     # socket/setsockopt and other routines are undefined under SCO ODT
5471     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5472     # on later versions), says simon@lia.di.epfl.ch: it contains
5473     # gethostby* variants that don't use the nameserver (or something).
5474     # -lsocket must be given before -lnsl if both are needed.
5475     # We assume that if connect needs -lnsl, so does gethostbyname.
5476     echo $ac_n "checking for connect""... $ac_c" 1>&6
5477 echo "configure:5478: checking for connect" >&5
5478
5479 cat > conftest.$ac_ext <<EOF
5480 #line 5481 "configure"
5481 #include "confdefs.h"
5482 /* System header to define __stub macros and hopefully few prototypes,
5483     which can conflict with char connect(); below.  */
5484 #include <assert.h>
5485 /* Override any gcc2 internal prototype to avoid an error.  */
5486 /* We use char because int might match the return type of a gcc2
5487     builtin and then its argument prototype would still apply.  */
5488 char connect();
5489
5490 int main() {
5491
5492 /* The GNU C library defines this for functions which it implements
5493     to always fail with ENOSYS.  Some functions are actually named
5494     something starting with __ and the normal name is an alias.  */
5495 #if defined (__stub_connect) || defined (__stub___connect)
5496 choke me
5497 #else
5498 connect();
5499 #endif
5500
5501 ; return 0; }
5502 EOF
5503 if { (eval echo configure:5504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5504   rm -rf conftest*
5505   eval "ac_cv_func_connect=yes"
5506 else
5507   echo "configure: failed program was:" >&5
5508   cat conftest.$ac_ext >&5
5509   rm -rf conftest*
5510   eval "ac_cv_func_connect=no"
5511 fi
5512 rm -f conftest*
5513
5514 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5515   echo "$ac_t""yes" 1>&6
5516   :
5517 else
5518   echo "$ac_t""no" 1>&6
5519 fi
5520
5521     if test $ac_cv_func_connect = no; then
5522       
5523 xe_msg_checking="for connect in -lsocket"
5524 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5525 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5526 echo "configure:5527: checking "$xe_msg_checking"" >&5
5527 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5528
5529 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5530 cat > conftest.$ac_ext <<EOF
5531 #line 5532 "configure"
5532 #include "confdefs.h"
5533 /* Override any gcc2 internal prototype to avoid an error.  */
5534 /* We use char because int might match the return type of a gcc2
5535     builtin and then its argument prototype would still apply.  */
5536 char connect();
5537
5538 int main() {
5539 connect()
5540 ; return 0; }
5541 EOF
5542 if { (eval echo configure:5543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5543   rm -rf conftest*
5544   eval "ac_cv_lib_$ac_lib_var=yes"
5545 else
5546   echo "configure: failed program was:" >&5
5547   cat conftest.$ac_ext >&5
5548   rm -rf conftest*
5549   eval "ac_cv_lib_$ac_lib_var=no"
5550 fi
5551 rm -f conftest*
5552 xe_check_libs=""
5553
5554 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5555   echo "$ac_t""yes" 1>&6
5556   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5557 else
5558   echo "$ac_t""no" 1>&6
5559 fi
5560
5561
5562     fi
5563
5564     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5565     echo $ac_n "checking for remove""... $ac_c" 1>&6
5566 echo "configure:5567: checking for remove" >&5
5567
5568 cat > conftest.$ac_ext <<EOF
5569 #line 5570 "configure"
5570 #include "confdefs.h"
5571 /* System header to define __stub macros and hopefully few prototypes,
5572     which can conflict with char remove(); below.  */
5573 #include <assert.h>
5574 /* Override any gcc2 internal prototype to avoid an error.  */
5575 /* We use char because int might match the return type of a gcc2
5576     builtin and then its argument prototype would still apply.  */
5577 char remove();
5578
5579 int main() {
5580
5581 /* The GNU C library defines this for functions which it implements
5582     to always fail with ENOSYS.  Some functions are actually named
5583     something starting with __ and the normal name is an alias.  */
5584 #if defined (__stub_remove) || defined (__stub___remove)
5585 choke me
5586 #else
5587 remove();
5588 #endif
5589
5590 ; return 0; }
5591 EOF
5592 if { (eval echo configure:5593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5593   rm -rf conftest*
5594   eval "ac_cv_func_remove=yes"
5595 else
5596   echo "configure: failed program was:" >&5
5597   cat conftest.$ac_ext >&5
5598   rm -rf conftest*
5599   eval "ac_cv_func_remove=no"
5600 fi
5601 rm -f conftest*
5602
5603 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5604   echo "$ac_t""yes" 1>&6
5605   :
5606 else
5607   echo "$ac_t""no" 1>&6
5608 fi
5609
5610     if test $ac_cv_func_remove = no; then
5611       
5612 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5613 echo "configure:5614: checking for remove in -lposix" >&5
5614 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5615
5616 xe_check_libs=" -lposix "
5617 cat > conftest.$ac_ext <<EOF
5618 #line 5619 "configure"
5619 #include "confdefs.h"
5620 /* Override any gcc2 internal prototype to avoid an error.  */
5621 /* We use char because int might match the return type of a gcc2
5622     builtin and then its argument prototype would still apply.  */
5623 char remove();
5624
5625 int main() {
5626 remove()
5627 ; return 0; }
5628 EOF
5629 if { (eval echo configure:5630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5630   rm -rf conftest*
5631   eval "ac_cv_lib_$ac_lib_var=yes"
5632 else
5633   echo "configure: failed program was:" >&5
5634   cat conftest.$ac_ext >&5
5635   rm -rf conftest*
5636   eval "ac_cv_lib_$ac_lib_var=no"
5637 fi
5638 rm -f conftest*
5639 xe_check_libs=""
5640
5641 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5642   echo "$ac_t""yes" 1>&6
5643   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5644 else
5645   echo "$ac_t""no" 1>&6
5646 fi
5647
5648
5649     fi
5650
5651     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5652     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5653 echo "configure:5654: checking for shmat" >&5
5654
5655 cat > conftest.$ac_ext <<EOF
5656 #line 5657 "configure"
5657 #include "confdefs.h"
5658 /* System header to define __stub macros and hopefully few prototypes,
5659     which can conflict with char shmat(); below.  */
5660 #include <assert.h>
5661 /* Override any gcc2 internal prototype to avoid an error.  */
5662 /* We use char because int might match the return type of a gcc2
5663     builtin and then its argument prototype would still apply.  */
5664 char shmat();
5665
5666 int main() {
5667
5668 /* The GNU C library defines this for functions which it implements
5669     to always fail with ENOSYS.  Some functions are actually named
5670     something starting with __ and the normal name is an alias.  */
5671 #if defined (__stub_shmat) || defined (__stub___shmat)
5672 choke me
5673 #else
5674 shmat();
5675 #endif
5676
5677 ; return 0; }
5678 EOF
5679 if { (eval echo configure:5680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5680   rm -rf conftest*
5681   eval "ac_cv_func_shmat=yes"
5682 else
5683   echo "configure: failed program was:" >&5
5684   cat conftest.$ac_ext >&5
5685   rm -rf conftest*
5686   eval "ac_cv_func_shmat=no"
5687 fi
5688 rm -f conftest*
5689
5690 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5691   echo "$ac_t""yes" 1>&6
5692   :
5693 else
5694   echo "$ac_t""no" 1>&6
5695 fi
5696
5697     if test $ac_cv_func_shmat = no; then
5698       
5699 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5700 echo "configure:5701: checking for shmat in -lipc" >&5
5701 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5702
5703 xe_check_libs=" -lipc "
5704 cat > conftest.$ac_ext <<EOF
5705 #line 5706 "configure"
5706 #include "confdefs.h"
5707 /* Override any gcc2 internal prototype to avoid an error.  */
5708 /* We use char because int might match the return type of a gcc2
5709     builtin and then its argument prototype would still apply.  */
5710 char shmat();
5711
5712 int main() {
5713 shmat()
5714 ; return 0; }
5715 EOF
5716 if { (eval echo configure:5717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5717   rm -rf conftest*
5718   eval "ac_cv_lib_$ac_lib_var=yes"
5719 else
5720   echo "configure: failed program was:" >&5
5721   cat conftest.$ac_ext >&5
5722   rm -rf conftest*
5723   eval "ac_cv_lib_$ac_lib_var=no"
5724 fi
5725 rm -f conftest*
5726 xe_check_libs=""
5727
5728 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5729   echo "$ac_t""yes" 1>&6
5730   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5731 else
5732   echo "$ac_t""no" 1>&6
5733 fi
5734
5735
5736     fi
5737   fi
5738
5739   # Check for libraries that X11R6 Xt/Xaw programs need.
5740   ac_save_LDFLAGS="$LDFLAGS"
5741   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5742   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5743   # check for ICE first), but we must link in the order -lSM -lICE or
5744   # we get undefined symbols.  So assume we have SM if we have ICE.
5745   # These have to be linked with before -lX11, unlike the other
5746   # libraries we check for below, so use a different variable.
5747   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5748   
5749 xe_msg_checking="for IceConnectionNumber in -lICE"
5750 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5751 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5752 echo "configure:5753: checking "$xe_msg_checking"" >&5
5753 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5754
5755 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5756 cat > conftest.$ac_ext <<EOF
5757 #line 5758 "configure"
5758 #include "confdefs.h"
5759 /* Override any gcc2 internal prototype to avoid an error.  */
5760 /* We use char because int might match the return type of a gcc2
5761     builtin and then its argument prototype would still apply.  */
5762 char IceConnectionNumber();
5763
5764 int main() {
5765 IceConnectionNumber()
5766 ; return 0; }
5767 EOF
5768 if { (eval echo configure:5769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5769   rm -rf conftest*
5770   eval "ac_cv_lib_$ac_lib_var=yes"
5771 else
5772   echo "configure: failed program was:" >&5
5773   cat conftest.$ac_ext >&5
5774   rm -rf conftest*
5775   eval "ac_cv_lib_$ac_lib_var=no"
5776 fi
5777 rm -f conftest*
5778 xe_check_libs=""
5779
5780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5781   echo "$ac_t""yes" 1>&6
5782   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5783 else
5784   echo "$ac_t""no" 1>&6
5785 fi
5786
5787
5788   LDFLAGS="$ac_save_LDFLAGS"
5789
5790 fi
5791  # Autoconf claims to find X library and include dirs for us.
5792   if test "$no_x" = "yes"
5793   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5794   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5795   fi
5796 fi
5797
5798 case "$with_x11" in
5799   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5800   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5801 esac
5802
5803 if test "$with_x11" = "yes"; then
5804   { test "$extra_verbose" = "yes" && cat << \EOF
5805     Defining HAVE_X_WINDOWS
5806 EOF
5807 cat >> confdefs.h <<\EOF
5808 #define HAVE_X_WINDOWS 1
5809 EOF
5810 }
5811
5812   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5813   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5814
5815       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5816     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5817     if test -d "$lib_dir" -a -d "$inc_dir"; then
5818       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5819         x_libraries="$lib_dir $x_libraries"
5820         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5821       esac
5822       case "$x_includes" in "$inc_dir"* ) ;; *)
5823         x_includes="$inc_dir $x_includes"
5824         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5825       esac
5826       break;       fi
5827   done
5828
5829     for rel in "X11R6" "X11R5" "X11R4"; do
5830     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5831     if test -d "$lib_dir" -a -d "$inc_dir"; then
5832       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5833         x_libraries="$x_libraries $lib_dir"
5834         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5835       esac
5836       case "$x_includes" in "$inc_dir"* ) ;; *)
5837         x_includes="$x_includes $inc_dir"
5838         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5839       esac
5840       break;     fi
5841   done
5842
5843     case "$opsys" in
5844   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 ;;
5845   esac
5846
5847   ld_switch_x_site="$X_LIBS"
5848
5849   
5850 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5851     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5852   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5853   
5854         runpath="" runpath_dirs=""
5855   if test -n "$LD_RUN_PATH"; then
5856     runpath="$LD_RUN_PATH"
5857   elif test "$GCC" = "yes"; then
5858         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5859     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5860     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5861     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5862       case "$arg" in P,* | -L* | -R* )
5863         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5864           {
5865 xe_runpath_dir="$dir"
5866   test "$xe_runpath_dir" != "/lib"     -a \
5867         "$xe_runpath_dir" != "/usr/lib" -a \
5868         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5869   eval "$xe_add_unique_runpath_dir"
5870 }
5871         done ;;
5872       esac
5873     done
5874     ld_switch_run="$ld_switch_run_save"
5875     rm -f conftest*
5876   else
5877         for arg in $ld_switch_site $ld_switch_x_site; do
5878       case "$arg" in -L*) {
5879 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5880   test "$xe_runpath_dir" != "/lib"     -a \
5881         "$xe_runpath_dir" != "/usr/lib" -a \
5882         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5883   eval "$xe_add_unique_runpath_dir"
5884 };; esac
5885     done
5886         if test "$opsys $need_motif" = "sol2 yes"; then
5887       xe_runpath_dir="/opt/SUNWdt/lib";
5888       eval "$xe_add_unique_runpath_dir";
5889     fi
5890   fi 
5891   if test -n "$runpath"; then
5892     ld_switch_run="${dash_r}${runpath}"
5893     
5894 if test "$GCC" = "yes"; then
5895   set x $ld_switch_run; shift; ld_switch_run=""
5896   while test -n "$1"; do
5897     case $1 in
5898       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5899       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5900       -Xlinker* ) ;;
5901       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5902     esac
5903     shift
5904   done
5905 fi
5906     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5907   fi
5908 fi
5909
5910
5911   if test "$extra_verbose" = "yes"; then
5912     echo; echo "X11 compilation variables:"
5913     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5914     echo
5915   fi
5916
5917             bitmapdirs=
5918   if test "$x_includes" != NONE; then
5919     for i in $x_includes; do
5920       if test -d "$i/bitmaps"; then
5921         bitmapdirs="$i/bitmaps:$bitmapdirs"
5922       fi
5923       if test -d "$i/X11/bitmaps"; then
5924         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5925       fi
5926     done
5927     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5928   fi
5929   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5930     Defining BITMAPDIR = "$bitmapdirs"
5931 EOF
5932 cat >> confdefs.h <<EOF
5933 #define BITMAPDIR "$bitmapdirs"
5934 EOF
5935 }
5936
5937
5938     echo "checking for X defines extracted by xmkmf" 1>&6
5939 echo "configure:5940: checking for X defines extracted by xmkmf" >&5
5940   rm -fr conftestdir
5941   if mkdir conftestdir; then
5942     cd conftestdir
5943     cat > Imakefile <<'EOF'
5944 xetest:
5945         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5946 EOF
5947     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5948       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5949       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5950     fi
5951     cd ..
5952     rm -fr conftestdir
5953     for word in $xmkmf_defines; do
5954       case "$word" in -D* )
5955         sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'`
5956         case "$word" in
5957           -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;;
5958           *     ) val=1 ;;
5959         esac
5960         if grep "^#define $sym " confdefs.h >/dev/null; then :; else
5961           if test "$val" = "1"
5962             then { test "$extra_verbose" = "yes" && cat << EOF
5963     Defining $sym
5964 EOF
5965 cat >> confdefs.h <<EOF
5966 #define $sym 1
5967 EOF
5968 }
5969
5970             else { test "$extra_verbose" = "yes" && cat << EOF
5971     Defining $sym = $val
5972 EOF
5973 cat >> confdefs.h <<EOF
5974 #define $sym $val
5975 EOF
5976 }
5977
5978           fi
5979         fi  ;;
5980       esac
5981     done
5982   fi
5983
5984     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5985 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5986 echo "configure:5987: checking for X11/Intrinsic.h" >&5
5987
5988 cat > conftest.$ac_ext <<EOF
5989 #line 5990 "configure"
5990 #include "confdefs.h"
5991 #include <X11/Intrinsic.h>
5992 EOF
5993 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5994 { (eval echo configure:5995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5995 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5996 if test -z "$ac_err"; then
5997   rm -rf conftest*
5998   eval "ac_cv_header_$ac_safe=yes"
5999 else
6000   echo "$ac_err" >&5
6001   echo "configure: failed program was:" >&5
6002   cat conftest.$ac_ext >&5
6003   rm -rf conftest*
6004   eval "ac_cv_header_$ac_safe=no"
6005 fi
6006 rm -f conftest*
6007 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6008   echo "$ac_t""yes" 1>&6
6009   :
6010 else
6011   echo "$ac_t""no" 1>&6
6012 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
6013 fi
6014
6015
6016       
6017 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
6018 echo "configure:6019: checking for XOpenDisplay in -lX11" >&5
6019 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
6020
6021 xe_check_libs=" -lX11 "
6022 cat > conftest.$ac_ext <<EOF
6023 #line 6024 "configure"
6024 #include "confdefs.h"
6025 /* Override any gcc2 internal prototype to avoid an error.  */
6026 /* We use char because int might match the return type of a gcc2
6027     builtin and then its argument prototype would still apply.  */
6028 char XOpenDisplay();
6029
6030 int main() {
6031 XOpenDisplay()
6032 ; return 0; }
6033 EOF
6034 if { (eval echo configure:6035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6035   rm -rf conftest*
6036   eval "ac_cv_lib_$ac_lib_var=yes"
6037 else
6038   echo "configure: failed program was:" >&5
6039   cat conftest.$ac_ext >&5
6040   rm -rf conftest*
6041   eval "ac_cv_lib_$ac_lib_var=no"
6042 fi
6043 rm -f conftest*
6044 xe_check_libs=""
6045
6046 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6047   echo "$ac_t""yes" 1>&6
6048   have_lib_x11=yes
6049 else
6050   echo "$ac_t""no" 1>&6
6051 fi
6052
6053
6054   if test "$have_lib_x11" != "yes"; then
6055     
6056 xe_msg_checking="for XGetFontProperty in -lX11"
6057 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
6058 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6059 echo "configure:6060: checking "$xe_msg_checking"" >&5
6060 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
6061
6062 xe_check_libs=" -lX11 -b i486-linuxaout"
6063 cat > conftest.$ac_ext <<EOF
6064 #line 6065 "configure"
6065 #include "confdefs.h"
6066 /* Override any gcc2 internal prototype to avoid an error.  */
6067 /* We use char because int might match the return type of a gcc2
6068     builtin and then its argument prototype would still apply.  */
6069 char XGetFontProperty();
6070
6071 int main() {
6072 XGetFontProperty()
6073 ; return 0; }
6074 EOF
6075 if { (eval echo configure:6076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6076   rm -rf conftest*
6077   eval "ac_cv_lib_$ac_lib_var=yes"
6078 else
6079   echo "configure: failed program was:" >&5
6080   cat conftest.$ac_ext >&5
6081   rm -rf conftest*
6082   eval "ac_cv_lib_$ac_lib_var=no"
6083 fi
6084 rm -f conftest*
6085 xe_check_libs=""
6086
6087 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6088   echo "$ac_t""yes" 1>&6
6089   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
6090 else
6091   echo "$ac_t""no" 1>&6
6092 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
6093 fi
6094
6095
6096   fi
6097   libs_x="-lX11"
6098   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
6099
6100     
6101 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
6102 echo "configure:6103: checking for XShapeSelectInput in -lXext" >&5
6103 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
6104
6105 xe_check_libs=" -lXext "
6106 cat > conftest.$ac_ext <<EOF
6107 #line 6108 "configure"
6108 #include "confdefs.h"
6109 /* Override any gcc2 internal prototype to avoid an error.  */
6110 /* We use char because int might match the return type of a gcc2
6111     builtin and then its argument prototype would still apply.  */
6112 char XShapeSelectInput();
6113
6114 int main() {
6115 XShapeSelectInput()
6116 ; return 0; }
6117 EOF
6118 if { (eval echo configure:6119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6119   rm -rf conftest*
6120   eval "ac_cv_lib_$ac_lib_var=yes"
6121 else
6122   echo "configure: failed program was:" >&5
6123   cat conftest.$ac_ext >&5
6124   rm -rf conftest*
6125   eval "ac_cv_lib_$ac_lib_var=no"
6126 fi
6127 rm -f conftest*
6128 xe_check_libs=""
6129
6130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6131   echo "$ac_t""yes" 1>&6
6132   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
6133 else
6134   echo "$ac_t""no" 1>&6
6135 fi
6136
6137
6138
6139     
6140 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
6141 echo "configure:6142: checking for XtOpenDisplay in -lXt" >&5
6142 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
6143
6144 xe_check_libs=" -lXt "
6145 cat > conftest.$ac_ext <<EOF
6146 #line 6147 "configure"
6147 #include "confdefs.h"
6148 /* Override any gcc2 internal prototype to avoid an error.  */
6149 /* We use char because int might match the return type of a gcc2
6150     builtin and then its argument prototype would still apply.  */
6151 char XtOpenDisplay();
6152
6153 int main() {
6154 XtOpenDisplay()
6155 ; return 0; }
6156 EOF
6157 if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6158   rm -rf conftest*
6159   eval "ac_cv_lib_$ac_lib_var=yes"
6160 else
6161   echo "configure: failed program was:" >&5
6162   cat conftest.$ac_ext >&5
6163   rm -rf conftest*
6164   eval "ac_cv_lib_$ac_lib_var=no"
6165 fi
6166 rm -f conftest*
6167 xe_check_libs=""
6168
6169 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6170   echo "$ac_t""yes" 1>&6
6171   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
6172 else
6173   echo "$ac_t""no" 1>&6
6174 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
6175 fi
6176
6177
6178
6179   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
6180 echo "configure:6181: checking the version of X11 being used" >&5
6181   cat > conftest.$ac_ext <<EOF
6182 #line 6183 "configure"
6183 #include "confdefs.h"
6184 #include <X11/Intrinsic.h>
6185     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
6186 EOF
6187 if { (eval echo configure:6188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6188 then
6189   ./conftest foobar; x11_release=$?
6190 else
6191   conftest_rc="$?"
6192   echo "configure: failed program was:" >&5
6193   cat conftest.$ac_ext >&5
6194   rm -fr conftest*
6195   x11_release=4
6196 fi
6197 rm -fr conftest*
6198   echo "$ac_t""R${x11_release}" 1>&6
6199   { test "$extra_verbose" = "yes" && cat << EOF
6200     Defining THIS_IS_X11R${x11_release}
6201 EOF
6202 cat >> confdefs.h <<EOF
6203 #define THIS_IS_X11R${x11_release} 1
6204 EOF
6205 }
6206
6207
6208   if test "${x11_release}" = "4"; then
6209     case "$with_widgets" in
6210       "" | "no") with_widgets=no ;;
6211       *) { echo "Error:" "Widget support requires X11R5 or greater" >&2; exit 1; } ;;
6212     esac
6213   fi
6214
6215   for ac_func in XConvertCase
6216 do
6217 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6218 echo "configure:6219: checking for $ac_func" >&5
6219
6220 cat > conftest.$ac_ext <<EOF
6221 #line 6222 "configure"
6222 #include "confdefs.h"
6223 /* System header to define __stub macros and hopefully few prototypes,
6224     which can conflict with char $ac_func(); below.  */
6225 #include <assert.h>
6226 /* Override any gcc2 internal prototype to avoid an error.  */
6227 /* We use char because int might match the return type of a gcc2
6228     builtin and then its argument prototype would still apply.  */
6229 char $ac_func();
6230
6231 int main() {
6232
6233 /* The GNU C library defines this for functions which it implements
6234     to always fail with ENOSYS.  Some functions are actually named
6235     something starting with __ and the normal name is an alias.  */
6236 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6237 choke me
6238 #else
6239 $ac_func();
6240 #endif
6241
6242 ; return 0; }
6243 EOF
6244 if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6245   rm -rf conftest*
6246   eval "ac_cv_func_$ac_func=yes"
6247 else
6248   echo "configure: failed program was:" >&5
6249   cat conftest.$ac_ext >&5
6250   rm -rf conftest*
6251   eval "ac_cv_func_$ac_func=no"
6252 fi
6253 rm -f conftest*
6254
6255 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6256   echo "$ac_t""yes" 1>&6
6257     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6258   { test "$extra_verbose" = "yes" && cat << EOF
6259     Defining $ac_tr_func
6260 EOF
6261 cat >> confdefs.h <<EOF
6262 #define $ac_tr_func 1
6263 EOF
6264 }
6265  
6266 else
6267   echo "$ac_t""no" 1>&6
6268 fi
6269 done
6270
6271
6272   for ac_hdr in X11/Xlocale.h
6273 do
6274 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6275 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6276 echo "configure:6277: checking for $ac_hdr" >&5
6277
6278 cat > conftest.$ac_ext <<EOF
6279 #line 6280 "configure"
6280 #include "confdefs.h"
6281 #include <$ac_hdr>
6282 EOF
6283 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6284 { (eval echo configure:6285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6285 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6286 if test -z "$ac_err"; then
6287   rm -rf conftest*
6288   eval "ac_cv_header_$ac_safe=yes"
6289 else
6290   echo "$ac_err" >&5
6291   echo "configure: failed program was:" >&5
6292   cat conftest.$ac_ext >&5
6293   rm -rf conftest*
6294   eval "ac_cv_header_$ac_safe=no"
6295 fi
6296 rm -f conftest*
6297 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6298   echo "$ac_t""yes" 1>&6
6299     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6300   { test "$extra_verbose" = "yes" && cat << EOF
6301     Defining $ac_tr_hdr
6302 EOF
6303 cat >> confdefs.h <<EOF
6304 #define $ac_tr_hdr 1
6305 EOF
6306 }
6307  
6308 else
6309   echo "$ac_t""no" 1>&6
6310 fi
6311 done
6312
6313
6314     for ac_func in XRegisterIMInstantiateCallback
6315 do
6316 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6317 echo "configure:6318: checking for $ac_func" >&5
6318
6319 cat > conftest.$ac_ext <<EOF
6320 #line 6321 "configure"
6321 #include "confdefs.h"
6322 /* System header to define __stub macros and hopefully few prototypes,
6323     which can conflict with char $ac_func(); below.  */
6324 #include <assert.h>
6325 /* Override any gcc2 internal prototype to avoid an error.  */
6326 /* We use char because int might match the return type of a gcc2
6327     builtin and then its argument prototype would still apply.  */
6328 char $ac_func();
6329
6330 int main() {
6331
6332 /* The GNU C library defines this for functions which it implements
6333     to always fail with ENOSYS.  Some functions are actually named
6334     something starting with __ and the normal name is an alias.  */
6335 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6336 choke me
6337 #else
6338 $ac_func();
6339 #endif
6340
6341 ; return 0; }
6342 EOF
6343 if { (eval echo configure:6344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6344   rm -rf conftest*
6345   eval "ac_cv_func_$ac_func=yes"
6346 else
6347   echo "configure: failed program was:" >&5
6348   cat conftest.$ac_ext >&5
6349   rm -rf conftest*
6350   eval "ac_cv_func_$ac_func=no"
6351 fi
6352 rm -f conftest*
6353
6354 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6355   echo "$ac_t""yes" 1>&6
6356     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6357   { test "$extra_verbose" = "yes" && cat << EOF
6358     Defining $ac_tr_func
6359 EOF
6360 cat >> confdefs.h <<EOF
6361 #define $ac_tr_func 1
6362 EOF
6363 }
6364  
6365 else
6366   echo "$ac_t""no" 1>&6
6367 fi
6368 done
6369
6370   echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6
6371 echo "configure:6372: checking for standard XRegisterIMInstantiateCallback prototype" >&5
6372   cat > conftest.$ac_ext <<EOF
6373 #line 6374 "configure"
6374 #include "confdefs.h"
6375
6376 #define NeedFunctionPrototypes 1
6377 #include <X11/Xlib.h>
6378 extern Bool XRegisterIMInstantiateCallback(
6379    Display*, struct _XrmHashBucketRec*, char*, char*, XIMProc, XPointer*);
6380
6381 int main() {
6382
6383 ; return 0; }
6384 EOF
6385 if { (eval echo configure:6386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6386   rm -rf conftest*
6387   echo "$ac_t""yes" 1>&6
6388 else
6389   echo "configure: failed program was:" >&5
6390   cat conftest.$ac_ext >&5
6391   rm -rf conftest*
6392   echo "$ac_t""no" 1>&6
6393    { test "$extra_verbose" = "yes" && cat << \EOF
6394     Defining XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE
6395 EOF
6396 cat >> confdefs.h <<\EOF
6397 #define XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE 1
6398 EOF
6399 }
6400
6401 fi
6402 rm -f conftest*
6403
6404     test -z "$with_xmu" && { 
6405 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
6406 echo "configure:6407: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
6407 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
6408
6409 xe_check_libs=" -lXmu "
6410 cat > conftest.$ac_ext <<EOF
6411 #line 6412 "configure"
6412 #include "confdefs.h"
6413 /* Override any gcc2 internal prototype to avoid an error.  */
6414 /* We use char because int might match the return type of a gcc2
6415     builtin and then its argument prototype would still apply.  */
6416 char XmuReadBitmapDataFromFile();
6417
6418 int main() {
6419 XmuReadBitmapDataFromFile()
6420 ; return 0; }
6421 EOF
6422 if { (eval echo configure:6423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6423   rm -rf conftest*
6424   eval "ac_cv_lib_$ac_lib_var=yes"
6425 else
6426   echo "configure: failed program was:" >&5
6427   cat conftest.$ac_ext >&5
6428   rm -rf conftest*
6429   eval "ac_cv_lib_$ac_lib_var=no"
6430 fi
6431 rm -f conftest*
6432 xe_check_libs=""
6433
6434 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6435   echo "$ac_t""yes" 1>&6
6436   with_xmu=yes
6437 else
6438   echo "$ac_t""no" 1>&6
6439 with_xmu=no
6440 fi
6441
6442  }
6443   if test "$with_xmu" = "no"; then
6444     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
6445    echo "    xemacs will be linked with \"xmu.o\""
6446  fi
6447   else
6448     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
6449     { test "$extra_verbose" = "yes" && cat << \EOF
6450     Defining HAVE_XMU
6451 EOF
6452 cat >> confdefs.h <<\EOF
6453 #define HAVE_XMU 1
6454 EOF
6455 }
6456
6457   fi
6458
6459       
6460 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
6461 echo "configure:6462: checking for main in -lXbsd" >&5
6462 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
6463
6464 xe_check_libs=" -lXbsd "
6465 cat > conftest.$ac_ext <<EOF
6466 #line 6467 "configure"
6467 #include "confdefs.h"
6468
6469 int main() {
6470 main()
6471 ; return 0; }
6472 EOF
6473 if { (eval echo configure:6474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6474   rm -rf conftest*
6475   eval "ac_cv_lib_$ac_lib_var=yes"
6476 else
6477   echo "configure: failed program was:" >&5
6478   cat conftest.$ac_ext >&5
6479   rm -rf conftest*
6480   eval "ac_cv_lib_$ac_lib_var=no"
6481 fi
6482 rm -f conftest*
6483 xe_check_libs=""
6484
6485 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6486   echo "$ac_t""yes" 1>&6
6487   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
6488 else
6489   echo "$ac_t""no" 1>&6
6490 fi
6491
6492
6493
6494     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
6495         if test "$GCC" = "yes"; then
6496       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
6497       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
6498     else
6499       case "$CC" in
6500         "xlc" ) CC="xlc_r" ;;
6501         "xlC" ) CC="xlC_r" ;;
6502         "cc"  ) CC="cc_r" ;;
6503       esac
6504     fi
6505   fi
6506
6507 fi 
6508 if test "$with_msw" != "no"; then
6509   echo "checking for MS-Windows" 1>&6
6510 echo "configure:6511: checking for MS-Windows" >&5
6511   
6512 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
6513 echo "configure:6514: checking for main in -lgdi32" >&5
6514 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
6515
6516 xe_check_libs=" -lgdi32 "
6517 cat > conftest.$ac_ext <<EOF
6518 #line 6519 "configure"
6519 #include "confdefs.h"
6520
6521 int main() {
6522 main()
6523 ; return 0; }
6524 EOF
6525 if { (eval echo configure:6526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6526   rm -rf conftest*
6527   eval "ac_cv_lib_$ac_lib_var=yes"
6528 else
6529   echo "configure: failed program was:" >&5
6530   cat conftest.$ac_ext >&5
6531   rm -rf conftest*
6532   eval "ac_cv_lib_$ac_lib_var=no"
6533 fi
6534 rm -f conftest*
6535 xe_check_libs=""
6536
6537 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6538   echo "$ac_t""yes" 1>&6
6539   with_msw=yes
6540 else
6541   echo "$ac_t""no" 1>&6
6542 fi
6543
6544
6545   if test "$with_msw" = "yes"; then
6546     { test "$extra_verbose" = "yes" && cat << \EOF
6547     Defining HAVE_MS_WINDOWS
6548 EOF
6549 cat >> confdefs.h <<\EOF
6550 #define HAVE_MS_WINDOWS 1
6551 EOF
6552 }
6553
6554
6555         MAKE_SUBDIR="$MAKE_SUBDIR netinstall" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"netinstall\" to \$MAKE_SUBDIR"; fi
6556     SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS netinstall" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"netinstall\" to \$SRC_SUBDIR_DEPS"; fi
6557     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR netinstall" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"netinstall\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
6558
6559     install_pp="$blddir/lib-src/installexe.sh"
6560     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
6561     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6562     if test "$window_system" != x11; then
6563         window_system=msw
6564         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6565             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6566    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6567  fi
6568         test "$with_menubars"   != "no" && with_menubars=msw \
6569             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6570    echo "    xemacs will be linked with \"menubar-msw.o\""
6571  fi
6572         test "$with_toolbars"   != "no" && with_toolbars=msw \
6573             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6574    echo "    xemacs will be linked with \"toolbar-msw.o\""
6575  fi
6576         test "$with_dialogs"   != "no" && with_dialogs=msw \
6577             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6578    echo "    xemacs will be linked with \"dialog-msw.o\""
6579  fi
6580         test "$with_widgets"   != "no" && with_widgets=msw
6581     else
6582         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6583    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6584  fi
6585         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6586    echo "    xemacs will be linked with \"menubar-msw.o\""
6587  fi
6588         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6589    echo "    xemacs will be linked with \"toolbar-msw.o\""
6590  fi
6591         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6592    echo "    xemacs will be linked with \"dialog-msw.o\""
6593  fi
6594     fi
6595         cat > conftest.$ac_ext <<EOF
6596 #line 6597 "configure"
6597 #include "confdefs.h"
6598 #include <fcntl.h>
6599     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6600 EOF
6601 if { (eval echo configure:6602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6602 then
6603   { test "$extra_verbose" = "yes" && cat << \EOF
6604     Defining HAVE_MSG_SELECT
6605 EOF
6606 cat >> confdefs.h <<\EOF
6607 #define HAVE_MSG_SELECT 1
6608 EOF
6609 }
6610
6611 else
6612   conftest_rc="$?"
6613   echo "configure: failed program was:" >&5
6614   cat conftest.$ac_ext >&5
6615 fi
6616 rm -fr conftest*
6617     with_file_coding=yes
6618     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
6619    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\""
6620  fi
6621   fi
6622 fi
6623
6624
6625
6626 test -z "$window_system" && window_system="none"
6627
6628 if test "$window_system" = "none"; then
6629   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6630   do
6631     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6632        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6633     fi
6634     eval "with_${feature}=no"
6635   done
6636 else
6637   test -z "$with_toolbars" && with_toolbars=yes
6638 fi
6639
6640 if test "$with_msw" != "yes"; then
6641   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6642   do
6643     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6644        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6645     fi
6646     eval "with_${feature}=no"
6647   done
6648 else
6649   :
6650 fi
6651
6652 if test "$with_x11" != "yes"; then
6653             for feature in tooltalk cde offix wmcommand xim xmu nas_sound
6654   do
6655     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6656        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6657     fi
6658     eval "with_${feature}=no"
6659   done
6660 fi
6661
6662 if test "$with_x11" = "yes"; then
6663   ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'`
6664 echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6
6665 echo "configure:6666: checking for X11/extensions/shape.h" >&5
6666
6667 cat > conftest.$ac_ext <<EOF
6668 #line 6669 "configure"
6669 #include "confdefs.h"
6670 #include <X11/extensions/shape.h>
6671 EOF
6672 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6673 { (eval echo configure:6674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6674 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6675 if test -z "$ac_err"; then
6676   rm -rf conftest*
6677   eval "ac_cv_header_$ac_safe=yes"
6678 else
6679   echo "$ac_err" >&5
6680   echo "configure: failed program was:" >&5
6681   cat conftest.$ac_ext >&5
6682   rm -rf conftest*
6683   eval "ac_cv_header_$ac_safe=no"
6684 fi
6685 rm -f conftest*
6686 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6687   echo "$ac_t""yes" 1>&6
6688   
6689    { test "$extra_verbose" = "yes" && cat << \EOF
6690     Defining HAVE_BALLOON_HELP
6691 EOF
6692 cat >> confdefs.h <<\EOF
6693 #define HAVE_BALLOON_HELP 1
6694 EOF
6695 }
6696
6697    extra_objs="$extra_objs balloon_help.o balloon-x.o" &&  if test "$extra_verbose" = "yes"; then
6698    echo "    xemacs will be linked with \"balloon_help.o balloon-x.o\""
6699  fi
6700 else
6701   echo "$ac_t""no" 1>&6
6702 fi
6703
6704 fi
6705
6706 bitmapdir=
6707
6708 case "$window_system" in
6709   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6710   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6711   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6712 esac
6713
6714 case "$x_libraries" in *X11R4* )
6715   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6716   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6717 esac
6718
6719 echo "checking for WM_COMMAND option" 1>&6
6720 echo "configure:6721: checking for WM_COMMAND option" >&5;
6721 if test "$with_wmcommand" != "no"; then
6722   { test "$extra_verbose" = "yes" && cat << \EOF
6723     Defining HAVE_WMCOMMAND
6724 EOF
6725 cat >> confdefs.h <<\EOF
6726 #define HAVE_WMCOMMAND 1
6727 EOF
6728 }
6729
6730 fi
6731
6732 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6733 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6734 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6735 echo "configure:6736: checking for X11/Xauth.h" >&5
6736
6737 cat > conftest.$ac_ext <<EOF
6738 #line 6739 "configure"
6739 #include "confdefs.h"
6740 #include <X11/Xauth.h>
6741 EOF
6742 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6743 { (eval echo configure:6744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6744 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6745 if test -z "$ac_err"; then
6746   rm -rf conftest*
6747   eval "ac_cv_header_$ac_safe=yes"
6748 else
6749   echo "$ac_err" >&5
6750   echo "configure: failed program was:" >&5
6751   cat conftest.$ac_ext >&5
6752   rm -rf conftest*
6753   eval "ac_cv_header_$ac_safe=no"
6754 fi
6755 rm -f conftest*
6756 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6757   echo "$ac_t""yes" 1>&6
6758   :
6759 else
6760   echo "$ac_t""no" 1>&6
6761 with_xauth=no
6762 fi
6763  }
6764 test -z "$with_xauth" && { 
6765 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6766 echo "configure:6767: checking for XauGetAuthByAddr in -lXau" >&5
6767 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6768
6769 xe_check_libs=" -lXau "
6770 cat > conftest.$ac_ext <<EOF
6771 #line 6772 "configure"
6772 #include "confdefs.h"
6773 /* Override any gcc2 internal prototype to avoid an error.  */
6774 /* We use char because int might match the return type of a gcc2
6775     builtin and then its argument prototype would still apply.  */
6776 char XauGetAuthByAddr();
6777
6778 int main() {
6779 XauGetAuthByAddr()
6780 ; return 0; }
6781 EOF
6782 if { (eval echo configure:6783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6783   rm -rf conftest*
6784   eval "ac_cv_lib_$ac_lib_var=yes"
6785 else
6786   echo "configure: failed program was:" >&5
6787   cat conftest.$ac_ext >&5
6788   rm -rf conftest*
6789   eval "ac_cv_lib_$ac_lib_var=no"
6790 fi
6791 rm -f conftest*
6792 xe_check_libs=""
6793
6794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6795   echo "$ac_t""yes" 1>&6
6796   :
6797 else
6798   echo "$ac_t""no" 1>&6
6799 with_xauth=no
6800 fi
6801
6802  }
6803 test -z "$with_xauth" && with_xauth=yes
6804 if test "$with_xauth" = "yes"; then
6805   { test "$extra_verbose" = "yes" && cat << \EOF
6806     Defining HAVE_XAUTH
6807 EOF
6808 cat >> confdefs.h <<\EOF
6809 #define HAVE_XAUTH 1
6810 EOF
6811 }
6812
6813   
6814 T=""
6815 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
6816 libs_xauth="$T"
6817
6818 fi
6819
6820
6821
6822
6823 if test "$with_tooltalk" != "no" ; then
6824       for dir in "" "Tt/" "desktop/" ; do
6825     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6826 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6827 echo "configure:6828: checking for ${dir}tt_c.h" >&5
6828
6829 cat > conftest.$ac_ext <<EOF
6830 #line 6831 "configure"
6831 #include "confdefs.h"
6832 #include <${dir}tt_c.h>
6833 EOF
6834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6835 { (eval echo configure:6836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6836 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6837 if test -z "$ac_err"; then
6838   rm -rf conftest*
6839   eval "ac_cv_header_$ac_safe=yes"
6840 else
6841   echo "$ac_err" >&5
6842   echo "configure: failed program was:" >&5
6843   cat conftest.$ac_ext >&5
6844   rm -rf conftest*
6845   eval "ac_cv_header_$ac_safe=no"
6846 fi
6847 rm -f conftest*
6848 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6849   echo "$ac_t""yes" 1>&6
6850   tt_c_h_file="${dir}tt_c.h"; break
6851 else
6852   echo "$ac_t""no" 1>&6
6853 fi
6854
6855   done
6856   if test -z "$tt_c_h_file"; then
6857     if test "$with_tooltalk" = "yes"; then
6858       (echo "$progname: Usage error:"
6859 echo " " "Unable to find required tooltalk header files."
6860 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6861     fi
6862     with_tooltalk=no
6863   fi
6864 fi
6865 if test "$with_tooltalk" != "no" ; then
6866   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6867     
6868 xe_msg_checking="for tt_message_create in -ltt"
6869 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6870 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6871 echo "configure:6872: checking "$xe_msg_checking"" >&5
6872 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6873
6874 xe_check_libs=" -ltt $extra_libs"
6875 cat > conftest.$ac_ext <<EOF
6876 #line 6877 "configure"
6877 #include "confdefs.h"
6878 /* Override any gcc2 internal prototype to avoid an error.  */
6879 /* We use char because int might match the return type of a gcc2
6880     builtin and then its argument prototype would still apply.  */
6881 char tt_message_create();
6882
6883 int main() {
6884 tt_message_create()
6885 ; return 0; }
6886 EOF
6887 if { (eval echo configure:6888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6888   rm -rf conftest*
6889   eval "ac_cv_lib_$ac_lib_var=yes"
6890 else
6891   echo "configure: failed program was:" >&5
6892   cat conftest.$ac_ext >&5
6893   rm -rf conftest*
6894   eval "ac_cv_lib_$ac_lib_var=no"
6895 fi
6896 rm -f conftest*
6897 xe_check_libs=""
6898
6899 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6900   echo "$ac_t""yes" 1>&6
6901   tt_libs="-ltt $extra_libs"; break
6902 else
6903   echo "$ac_t""no" 1>&6
6904 :
6905 fi
6906
6907
6908   done
6909   if test -z "$tt_libs"; then
6910     if test "$with_tooltalk" = "yes"; then
6911       (echo "$progname: Usage error:"
6912 echo " " "Unable to find required tooltalk libraries."
6913 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6914     fi
6915     with_tooltalk=no
6916   fi
6917 fi
6918 test -z "$with_tooltalk" && with_tooltalk=yes
6919 if test "$with_tooltalk" = "yes"; then
6920   { test "$extra_verbose" = "yes" && cat << \EOF
6921     Defining TOOLTALK
6922 EOF
6923 cat >> confdefs.h <<\EOF
6924 #define TOOLTALK 1
6925 EOF
6926 }
6927
6928   { test "$extra_verbose" = "yes" && cat << EOF
6929     Defining TT_C_H_FILE = "$tt_c_h_file"
6930 EOF
6931 cat >> confdefs.h <<EOF
6932 #define TT_C_H_FILE "$tt_c_h_file"
6933 EOF
6934 }
6935
6936   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6937   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6938    echo "    xemacs will be linked with \"tooltalk.o\""
6939  fi
6940 fi
6941
6942 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6943 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6944 echo "configure:6945: checking for Dt/Dt.h" >&5
6945
6946 cat > conftest.$ac_ext <<EOF
6947 #line 6948 "configure"
6948 #include "confdefs.h"
6949 #include <Dt/Dt.h>
6950 EOF
6951 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6952 { (eval echo configure:6953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6953 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6954 if test -z "$ac_err"; then
6955   rm -rf conftest*
6956   eval "ac_cv_header_$ac_safe=yes"
6957 else
6958   echo "$ac_err" >&5
6959   echo "configure: failed program was:" >&5
6960   cat conftest.$ac_ext >&5
6961   rm -rf conftest*
6962   eval "ac_cv_header_$ac_safe=no"
6963 fi
6964 rm -f conftest*
6965 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6966   echo "$ac_t""yes" 1>&6
6967   :
6968 else
6969   echo "$ac_t""no" 1>&6
6970 with_cde=no
6971 fi
6972  }
6973 test -z "$with_cde" && { 
6974 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6975 echo "configure:6976: checking for DtDndDragStart in -lDtSvc" >&5
6976 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6977
6978 xe_check_libs=" -lDtSvc "
6979 cat > conftest.$ac_ext <<EOF
6980 #line 6981 "configure"
6981 #include "confdefs.h"
6982 /* Override any gcc2 internal prototype to avoid an error.  */
6983 /* We use char because int might match the return type of a gcc2
6984     builtin and then its argument prototype would still apply.  */
6985 char DtDndDragStart();
6986
6987 int main() {
6988 DtDndDragStart()
6989 ; return 0; }
6990 EOF
6991 if { (eval echo configure:6992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6992   rm -rf conftest*
6993   eval "ac_cv_lib_$ac_lib_var=yes"
6994 else
6995   echo "configure: failed program was:" >&5
6996   cat conftest.$ac_ext >&5
6997   rm -rf conftest*
6998   eval "ac_cv_lib_$ac_lib_var=no"
6999 fi
7000 rm -f conftest*
7001 xe_check_libs=""
7002
7003 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7004   echo "$ac_t""yes" 1>&6
7005   :
7006 else
7007   echo "$ac_t""no" 1>&6
7008 with_cde=no
7009 fi
7010
7011  }
7012 test -z "$with_cde" && with_cde=yes
7013 if test "$with_dragndrop" = no; then
7014   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
7015   with_cde=no
7016 fi
7017 if test "$with_cde" = "yes" ; then
7018   { test "$extra_verbose" = "yes" && cat << \EOF
7019     Defining HAVE_CDE
7020 EOF
7021 cat >> confdefs.h <<\EOF
7022 #define HAVE_CDE 1
7023 EOF
7024 }
7025
7026   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
7027   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
7028   with_tooltalk=yes # CDE requires Tooltalk
7029   need_motif=yes    # CDE requires Motif
7030 fi
7031
7032 test "$window_system" != "x11" && with_offix=no
7033 if test "$with_xmu" != yes -a "$with_x11" = yes; then
7034   echo "configure: warning: No OffiX without real Xmu support" 1>&2
7035   with_offix=no
7036 fi
7037 if test "$with_dragndrop" = no; then
7038   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
7039   with_offix=no
7040 fi
7041 if test "$with_cde" = yes; then
7042   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
7043   with_offix=no
7044 fi
7045 test -z "$with_offix" && with_offix=no
7046 if test "$with_offix" = "yes"; then
7047   { test "$extra_verbose" = "yes" && cat << \EOF
7048     Defining HAVE_OFFIX_DND
7049 EOF
7050 cat >> confdefs.h <<\EOF
7051 #define HAVE_OFFIX_DND 1
7052 EOF
7053 }
7054
7055   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
7056   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
7057 fi
7058
7059 if test "$with_dragndrop" != "no" ; then
7060   echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
7061 echo "configure:7062: checking if drag and drop API is needed" >&5
7062   if test -n "$dragndrop_proto" ; then
7063     with_dragndrop=yes
7064     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
7065     { test "$extra_verbose" = "yes" && cat << \EOF
7066     Defining HAVE_DRAGNDROP
7067 EOF
7068 cat >> confdefs.h <<\EOF
7069 #define HAVE_DRAGNDROP 1
7070 EOF
7071 }
7072
7073     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
7074   else
7075     with_dragndrop=no
7076     echo "$ac_t""no" 1>&6
7077   fi
7078 fi
7079
7080 echo "checking for LDAP" 1>&6
7081 echo "configure:7082: checking for LDAP" >&5
7082 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
7083 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
7084 echo "configure:7085: checking for ldap.h" >&5
7085
7086 cat > conftest.$ac_ext <<EOF
7087 #line 7088 "configure"
7088 #include "confdefs.h"
7089 #include <ldap.h>
7090 EOF
7091 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7092 { (eval echo configure:7093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7093 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7094 if test -z "$ac_err"; then
7095   rm -rf conftest*
7096   eval "ac_cv_header_$ac_safe=yes"
7097 else
7098   echo "$ac_err" >&5
7099   echo "configure: failed program was:" >&5
7100   cat conftest.$ac_ext >&5
7101   rm -rf conftest*
7102   eval "ac_cv_header_$ac_safe=no"
7103 fi
7104 rm -f conftest*
7105 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7106   echo "$ac_t""yes" 1>&6
7107   :
7108 else
7109   echo "$ac_t""no" 1>&6
7110 with_ldap=no
7111 fi
7112  }
7113 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
7114 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
7115 echo "configure:7116: checking for lber.h" >&5
7116
7117 cat > conftest.$ac_ext <<EOF
7118 #line 7119 "configure"
7119 #include "confdefs.h"
7120 #include <lber.h>
7121 EOF
7122 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7123 { (eval echo configure:7124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7124 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7125 if test -z "$ac_err"; then
7126   rm -rf conftest*
7127   eval "ac_cv_header_$ac_safe=yes"
7128 else
7129   echo "$ac_err" >&5
7130   echo "configure: failed program was:" >&5
7131   cat conftest.$ac_ext >&5
7132   rm -rf conftest*
7133   eval "ac_cv_header_$ac_safe=no"
7134 fi
7135 rm -f conftest*
7136 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7137   echo "$ac_t""yes" 1>&6
7138   :
7139 else
7140   echo "$ac_t""no" 1>&6
7141 with_ldap=no
7142 fi
7143  }
7144 if test "$with_ldap" != "no"; then
7145   
7146 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
7147 echo "configure:7148: checking for ldap_search in -lldap" >&5
7148 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
7149
7150 xe_check_libs=" -lldap "
7151 cat > conftest.$ac_ext <<EOF
7152 #line 7153 "configure"
7153 #include "confdefs.h"
7154 /* Override any gcc2 internal prototype to avoid an error.  */
7155 /* We use char because int might match the return type of a gcc2
7156     builtin and then its argument prototype would still apply.  */
7157 char ldap_search();
7158
7159 int main() {
7160 ldap_search()
7161 ; return 0; }
7162 EOF
7163 if { (eval echo configure:7164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7164   rm -rf conftest*
7165   eval "ac_cv_lib_$ac_lib_var=yes"
7166 else
7167   echo "configure: failed program was:" >&5
7168   cat conftest.$ac_ext >&5
7169   rm -rf conftest*
7170   eval "ac_cv_lib_$ac_lib_var=no"
7171 fi
7172 rm -f conftest*
7173 xe_check_libs=""
7174
7175 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7176   echo "$ac_t""yes" 1>&6
7177   with_ldap_nolber=yes
7178 else
7179   echo "$ac_t""no" 1>&6
7180 with_ldap_nolber=no
7181 fi
7182
7183
7184   test "$with_ldap_nolber" = "no" && { 
7185 xe_msg_checking="for ldap_open in -lldap"
7186 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
7187 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7188 echo "configure:7189: checking "$xe_msg_checking"" >&5
7189 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7190
7191 xe_check_libs=" -lldap -llber"
7192 cat > conftest.$ac_ext <<EOF
7193 #line 7194 "configure"
7194 #include "confdefs.h"
7195 /* Override any gcc2 internal prototype to avoid an error.  */
7196 /* We use char because int might match the return type of a gcc2
7197     builtin and then its argument prototype would still apply.  */
7198 char ldap_open();
7199
7200 int main() {
7201 ldap_open()
7202 ; return 0; }
7203 EOF
7204 if { (eval echo configure:7205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7205   rm -rf conftest*
7206   eval "ac_cv_lib_$ac_lib_var=yes"
7207 else
7208   echo "configure: failed program was:" >&5
7209   cat conftest.$ac_ext >&5
7210   rm -rf conftest*
7211   eval "ac_cv_lib_$ac_lib_var=no"
7212 fi
7213 rm -f conftest*
7214 xe_check_libs=""
7215
7216 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7217   echo "$ac_t""yes" 1>&6
7218   with_ldap_lber=yes
7219 else
7220   echo "$ac_t""no" 1>&6
7221 with_ldap_lber=no
7222 fi
7223
7224  }
7225   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { 
7226 xe_msg_checking="for ldap_open in -lldap"
7227 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
7228 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7229 echo "configure:7230: checking "$xe_msg_checking"" >&5
7230 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7231
7232 xe_check_libs=" -lldap -llber -lkrb"
7233 cat > conftest.$ac_ext <<EOF
7234 #line 7235 "configure"
7235 #include "confdefs.h"
7236 /* Override any gcc2 internal prototype to avoid an error.  */
7237 /* We use char because int might match the return type of a gcc2
7238     builtin and then its argument prototype would still apply.  */
7239 char ldap_open();
7240
7241 int main() {
7242 ldap_open()
7243 ; return 0; }
7244 EOF
7245 if { (eval echo configure:7246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7246   rm -rf conftest*
7247   eval "ac_cv_lib_$ac_lib_var=yes"
7248 else
7249   echo "configure: failed program was:" >&5
7250   cat conftest.$ac_ext >&5
7251   rm -rf conftest*
7252   eval "ac_cv_lib_$ac_lib_var=no"
7253 fi
7254 rm -f conftest*
7255 xe_check_libs=""
7256
7257 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7258   echo "$ac_t""yes" 1>&6
7259   with_ldap_krb=yes
7260 else
7261   echo "$ac_t""no" 1>&6
7262 with_ldap_krb=no
7263 fi
7264
7265  }
7266   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { 
7267 xe_msg_checking="for ldap_open in -lldap"
7268 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
7269 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7270 echo "configure:7271: checking "$xe_msg_checking"" >&5
7271 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7272
7273 xe_check_libs=" -lldap -llber -lkrb -ldes"
7274 cat > conftest.$ac_ext <<EOF
7275 #line 7276 "configure"
7276 #include "confdefs.h"
7277 /* Override any gcc2 internal prototype to avoid an error.  */
7278 /* We use char because int might match the return type of a gcc2
7279     builtin and then its argument prototype would still apply.  */
7280 char ldap_open();
7281
7282 int main() {
7283 ldap_open()
7284 ; return 0; }
7285 EOF
7286 if { (eval echo configure:7287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7287   rm -rf conftest*
7288   eval "ac_cv_lib_$ac_lib_var=yes"
7289 else
7290   echo "configure: failed program was:" >&5
7291   cat conftest.$ac_ext >&5
7292   rm -rf conftest*
7293   eval "ac_cv_lib_$ac_lib_var=no"
7294 fi
7295 rm -f conftest*
7296 xe_check_libs=""
7297
7298 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7299   echo "$ac_t""yes" 1>&6
7300   with_ldap_krbdes=yes
7301 else
7302   echo "$ac_t""no" 1>&6
7303 with_ldap_krbdes=no
7304 fi
7305
7306  }
7307   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
7308 fi
7309 if test "$with_ldap" = "yes"; then
7310   { test "$extra_verbose" = "yes" && cat << \EOF
7311     Defining HAVE_LDAP
7312 EOF
7313 cat >> confdefs.h <<\EOF
7314 #define HAVE_LDAP 1
7315 EOF
7316 }
7317
7318   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
7319    echo "    xemacs will be linked with \"eldap.o\""
7320  fi
7321   if test "$with_ldap_nolber" = "yes" ; then
7322     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
7323   else
7324     if test "$with_ldap_krb" = "yes" ; then
7325       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
7326     fi
7327     if test "$with_ldap_krbdes" = "yes" ; then
7328       LIBS="-ldes $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldes\" to \$LIBS"; fi
7329       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
7330     fi
7331     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
7332     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
7333   fi
7334   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
7335 do
7336 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7337 echo "configure:7338: checking for $ac_func" >&5
7338
7339 cat > conftest.$ac_ext <<EOF
7340 #line 7341 "configure"
7341 #include "confdefs.h"
7342 /* System header to define __stub macros and hopefully few prototypes,
7343     which can conflict with char $ac_func(); below.  */
7344 #include <assert.h>
7345 /* Override any gcc2 internal prototype to avoid an error.  */
7346 /* We use char because int might match the return type of a gcc2
7347     builtin and then its argument prototype would still apply.  */
7348 char $ac_func();
7349
7350 int main() {
7351
7352 /* The GNU C library defines this for functions which it implements
7353     to always fail with ENOSYS.  Some functions are actually named
7354     something starting with __ and the normal name is an alias.  */
7355 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7356 choke me
7357 #else
7358 $ac_func();
7359 #endif
7360
7361 ; return 0; }
7362 EOF
7363 if { (eval echo configure:7364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7364   rm -rf conftest*
7365   eval "ac_cv_func_$ac_func=yes"
7366 else
7367   echo "configure: failed program was:" >&5
7368   cat conftest.$ac_ext >&5
7369   rm -rf conftest*
7370   eval "ac_cv_func_$ac_func=no"
7371 fi
7372 rm -f conftest*
7373
7374 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7375   echo "$ac_t""yes" 1>&6
7376     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7377   { test "$extra_verbose" = "yes" && cat << EOF
7378     Defining $ac_tr_func
7379 EOF
7380 cat >> confdefs.h <<EOF
7381 #define $ac_tr_func 1
7382 EOF
7383 }
7384  
7385 else
7386   echo "$ac_t""no" 1>&6
7387 fi
7388 done
7389
7390 fi
7391
7392 if test "$with_postgresql" != "no"; then
7393   echo "checking for PostgreSQL" 1>&6
7394 echo "configure:7395: checking for PostgreSQL" >&5
7395
7396   for header_dir in "" "pgsql/" "postgresql/"; do
7397     ac_safe=`echo "${header_dir}libpq-fe.h" | sed 'y%./+-%__p_%'`
7398 echo $ac_n "checking for ${header_dir}libpq-fe.h""... $ac_c" 1>&6
7399 echo "configure:7400: checking for ${header_dir}libpq-fe.h" >&5
7400
7401 cat > conftest.$ac_ext <<EOF
7402 #line 7403 "configure"
7403 #include "confdefs.h"
7404 #include <${header_dir}libpq-fe.h>
7405 EOF
7406 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7407 { (eval echo configure:7408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7408 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7409 if test -z "$ac_err"; then
7410   rm -rf conftest*
7411   eval "ac_cv_header_$ac_safe=yes"
7412 else
7413   echo "$ac_err" >&5
7414   echo "configure: failed program was:" >&5
7415   cat conftest.$ac_ext >&5
7416   rm -rf conftest*
7417   eval "ac_cv_header_$ac_safe=no"
7418 fi
7419 rm -f conftest*
7420 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7421   echo "$ac_t""yes" 1>&6
7422   libpq_fe_h_file=${header_dir}libpq-fe.h; break
7423 else
7424   echo "$ac_t""no" 1>&6
7425 fi
7426
7427   done
7428
7429   test -n "$libpq_fe_h_file" && { 
7430 echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
7431 echo "configure:7432: checking for PQconnectdb in -lpq" >&5
7432 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'`
7433
7434 xe_check_libs=" -lpq "
7435 cat > conftest.$ac_ext <<EOF
7436 #line 7437 "configure"
7437 #include "confdefs.h"
7438 /* Override any gcc2 internal prototype to avoid an error.  */
7439 /* We use char because int might match the return type of a gcc2
7440     builtin and then its argument prototype would still apply.  */
7441 char PQconnectdb();
7442
7443 int main() {
7444 PQconnectdb()
7445 ; return 0; }
7446 EOF
7447 if { (eval echo configure:7448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7448   rm -rf conftest*
7449   eval "ac_cv_lib_$ac_lib_var=yes"
7450 else
7451   echo "configure: failed program was:" >&5
7452   cat conftest.$ac_ext >&5
7453   rm -rf conftest*
7454   eval "ac_cv_lib_$ac_lib_var=no"
7455 fi
7456 rm -f conftest*
7457 xe_check_libs=""
7458
7459 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7460   echo "$ac_t""yes" 1>&6
7461   have_libpq=yes
7462 else
7463   echo "$ac_t""no" 1>&6
7464 fi
7465
7466  }
7467
7468   if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then
7469     with_postgresql=yes
7470     { test "$extra_verbose" = "yes" && cat << \EOF
7471     Defining HAVE_POSTGRESQL
7472 EOF
7473 cat >> confdefs.h <<\EOF
7474 #define HAVE_POSTGRESQL 1
7475 EOF
7476 }
7477
7478     
7479 echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6
7480 echo "configure:7481: checking for PQconnectStart in -lpq" >&5
7481 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'`
7482
7483 xe_check_libs=" -lpq "
7484 cat > conftest.$ac_ext <<EOF
7485 #line 7486 "configure"
7486 #include "confdefs.h"
7487 /* Override any gcc2 internal prototype to avoid an error.  */
7488 /* We use char because int might match the return type of a gcc2
7489     builtin and then its argument prototype would still apply.  */
7490 char PQconnectStart();
7491
7492 int main() {
7493 PQconnectStart()
7494 ; return 0; }
7495 EOF
7496 if { (eval echo configure:7497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7497   rm -rf conftest*
7498   eval "ac_cv_lib_$ac_lib_var=yes"
7499 else
7500   echo "configure: failed program was:" >&5
7501   cat conftest.$ac_ext >&5
7502   rm -rf conftest*
7503   eval "ac_cv_lib_$ac_lib_var=no"
7504 fi
7505 rm -f conftest*
7506 xe_check_libs=""
7507
7508 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7509   echo "$ac_t""yes" 1>&6
7510   with_postgresqlv7=yes;
7511                  { test "$extra_verbose" = "yes" && cat << \EOF
7512     Defining HAVE_POSTGRESQLV7
7513 EOF
7514 cat >> confdefs.h <<\EOF
7515 #define HAVE_POSTGRESQLV7 1
7516 EOF
7517 }
7518
7519 else
7520   echo "$ac_t""no" 1>&6
7521 fi
7522
7523
7524     { test "$extra_verbose" = "yes" && cat << EOF
7525     Defining LIBPQ_FE_H_FILE = "$libpq_fe_h_file"
7526 EOF
7527 cat >> confdefs.h <<EOF
7528 #define LIBPQ_FE_H_FILE "$libpq_fe_h_file"
7529 EOF
7530 }
7531
7532     LIBS="-lpq $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpq\" to \$LIBS"; fi
7533     extra_objs="$extra_objs postgresql.o" &&  if test "$extra_verbose" = "yes"; then
7534    echo "    xemacs will be linked with \"postgresql.o\""
7535  fi
7536   elif test "$with_postgresql" = "yes"; then
7537     { echo "Error:" "Required PostgreSQL support cannot be provided.  Check --site-prefixes." >&2; exit 1; }
7538   fi
7539 fi
7540
7541
7542 if test "$window_system" != "none"; then
7543   echo "checking for graphics libraries" 1>&6
7544 echo "configure:7545: checking for graphics libraries" >&5
7545
7546     xpm_problem=""
7547   if test -z "$with_xpm"; then
7548     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
7549 echo "configure:7550: checking for Xpm - no older than 3.4f" >&5
7550     xe_check_libs=-lXpm
7551     cat > conftest.$ac_ext <<EOF
7552 #line 7553 "configure"
7553 #include "confdefs.h"
7554 #define XPM_NUMBERS
7555 #include <X11/xpm.h>
7556     int main(int c, char **v) {
7557     return c == 1 ? 0 :
7558       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
7559       XpmIncludeVersion < 30406 ? 2 : 0 ;}
7560 EOF
7561 if { (eval echo configure:7562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7562 then
7563   ./conftest dummy_arg; xpm_status=$?;
7564       if test "$xpm_status" = "0"; then
7565         with_xpm=yes;
7566       else
7567         with_xpm=no;
7568         if test "$xpm_status" = "1"; then
7569           xpm_problem="Xpm library version and header file version don't match!"
7570         elif test "$xpm_status" = "2"; then
7571           xpm_problem="Xpm library version is too old!"
7572         else
7573           xpm_problem="Internal xpm detection logic error!"
7574         fi
7575         echo "
7576 *** WARNING *** $xpm_problem
7577   I'm not touching that with a 10-foot pole!
7578   If you really want to use the installed version of Xpm, rerun
7579   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
7580     fi
7581 else
7582   conftest_rc="$?"
7583   echo "configure: failed program was:" >&5
7584   cat conftest.$ac_ext >&5
7585   rm -fr conftest*
7586   with_xpm=no
7587 fi
7588 rm -fr conftest*
7589     xe_check_libs=
7590     echo "$ac_t""$with_xpm" 1>&6
7591   fi
7592   if test "$with_xpm" = "yes"; then
7593                 { test "$extra_verbose" = "yes" && cat << \EOF
7594     Defining HAVE_XPM
7595 EOF
7596 cat >> confdefs.h <<\EOF
7597 #define HAVE_XPM 1
7598 EOF
7599 }
7600
7601     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
7602     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
7603 echo "configure:7604: checking for \"FOR_MSW\" xpm" >&5
7604     xe_check_libs=-lXpm
7605     cat > conftest.$ac_ext <<EOF
7606 #line 7607 "configure"
7607 #include "confdefs.h"
7608
7609 int main() {
7610 XpmCreatePixmapFromData()
7611 ; return 0; }
7612 EOF
7613 if { (eval echo configure:7614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7614   rm -rf conftest*
7615   xpm_for_msw=no
7616 else
7617   echo "configure: failed program was:" >&5
7618   cat conftest.$ac_ext >&5
7619   rm -rf conftest*
7620   xpm_for_msw=yes
7621 fi
7622 rm -f conftest*
7623     xe_check_libs=
7624     echo "$ac_t""$xpm_for_msw" 1>&6
7625     if test "$xpm_for_msw" = "yes"; then
7626       { test "$extra_verbose" = "yes" && cat << \EOF
7627     Defining FOR_MSW
7628 EOF
7629 cat >> confdefs.h <<\EOF
7630 #define FOR_MSW 1
7631 EOF
7632 }
7633
7634     fi
7635   fi
7636
7637     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
7638 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
7639 echo "configure:7640: checking for compface.h" >&5
7640
7641 cat > conftest.$ac_ext <<EOF
7642 #line 7643 "configure"
7643 #include "confdefs.h"
7644 #include <compface.h>
7645 EOF
7646 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7647 { (eval echo configure:7648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7648 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7649 if test -z "$ac_err"; then
7650   rm -rf conftest*
7651   eval "ac_cv_header_$ac_safe=yes"
7652 else
7653   echo "$ac_err" >&5
7654   echo "configure: failed program was:" >&5
7655   cat conftest.$ac_ext >&5
7656   rm -rf conftest*
7657   eval "ac_cv_header_$ac_safe=no"
7658 fi
7659 rm -f conftest*
7660 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7661   echo "$ac_t""yes" 1>&6
7662   :
7663 else
7664   echo "$ac_t""no" 1>&6
7665 with_xface=no
7666 fi
7667  }
7668   test -z "$with_xface" && { 
7669 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
7670 echo "configure:7671: checking for UnGenFace in -lcompface" >&5
7671 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
7672
7673 xe_check_libs=" -lcompface "
7674 cat > conftest.$ac_ext <<EOF
7675 #line 7676 "configure"
7676 #include "confdefs.h"
7677 /* Override any gcc2 internal prototype to avoid an error.  */
7678 /* We use char because int might match the return type of a gcc2
7679     builtin and then its argument prototype would still apply.  */
7680 char UnGenFace();
7681
7682 int main() {
7683 UnGenFace()
7684 ; return 0; }
7685 EOF
7686 if { (eval echo configure:7687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7687   rm -rf conftest*
7688   eval "ac_cv_lib_$ac_lib_var=yes"
7689 else
7690   echo "configure: failed program was:" >&5
7691   cat conftest.$ac_ext >&5
7692   rm -rf conftest*
7693   eval "ac_cv_lib_$ac_lib_var=no"
7694 fi
7695 rm -f conftest*
7696 xe_check_libs=""
7697
7698 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7699   echo "$ac_t""yes" 1>&6
7700   : 
7701 else
7702   echo "$ac_t""no" 1>&6
7703 with_xface=no
7704 fi
7705
7706  }
7707   test -z "$with_xface" && with_xface=yes
7708   if test "$with_xface" = "yes"; then
7709     { test "$extra_verbose" = "yes" && cat << \EOF
7710     Defining HAVE_XFACE
7711 EOF
7712 cat >> confdefs.h <<\EOF
7713 #define HAVE_XFACE 1
7714 EOF
7715 }
7716
7717     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7718   fi
7719
7720         if test "$with_gif" != "no"; then
7721     with_gif="yes"
7722     { test "$extra_verbose" = "yes" && cat << \EOF
7723     Defining HAVE_GIF
7724 EOF
7725 cat >> confdefs.h <<\EOF
7726 #define HAVE_GIF 1
7727 EOF
7728 }
7729
7730     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
7731    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
7732  fi
7733   fi
7734
7735       if test "$with_png $with_tiff" != "no no"; then
7736     
7737 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
7738 echo "configure:7739: checking for inflate in -lc" >&5
7739 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
7740
7741 xe_check_libs=" -lc "
7742 cat > conftest.$ac_ext <<EOF
7743 #line 7744 "configure"
7744 #include "confdefs.h"
7745 /* Override any gcc2 internal prototype to avoid an error.  */
7746 /* We use char because int might match the return type of a gcc2
7747     builtin and then its argument prototype would still apply.  */
7748 char inflate();
7749
7750 int main() {
7751 inflate()
7752 ; return 0; }
7753 EOF
7754 if { (eval echo configure:7755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7755   rm -rf conftest*
7756   eval "ac_cv_lib_$ac_lib_var=yes"
7757 else
7758   echo "configure: failed program was:" >&5
7759   cat conftest.$ac_ext >&5
7760   rm -rf conftest*
7761   eval "ac_cv_lib_$ac_lib_var=no"
7762 fi
7763 rm -f conftest*
7764 xe_check_libs=""
7765
7766 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7767   echo "$ac_t""yes" 1>&6
7768   :
7769 else
7770   echo "$ac_t""no" 1>&6
7771
7772 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
7773 echo "configure:7774: checking for inflate in -lz" >&5
7774 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
7775
7776 xe_check_libs=" -lz "
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   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
7804 else
7805   echo "$ac_t""no" 1>&6
7806
7807 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
7808 echo "configure:7809: checking for inflate in -lgz" >&5
7809 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
7810
7811 xe_check_libs=" -lgz "
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="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
7839 else
7840   echo "$ac_t""no" 1>&6
7841 fi
7842
7843
7844 fi
7845
7846
7847 fi
7848
7849
7850   fi
7851
7852     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
7853 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
7854 echo "configure:7855: checking for jpeglib.h" >&5
7855
7856 cat > conftest.$ac_ext <<EOF
7857 #line 7858 "configure"
7858 #include "confdefs.h"
7859 #include <jpeglib.h>
7860 EOF
7861 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7862 { (eval echo configure:7863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7863 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7864 if test -z "$ac_err"; then
7865   rm -rf conftest*
7866   eval "ac_cv_header_$ac_safe=yes"
7867 else
7868   echo "$ac_err" >&5
7869   echo "configure: failed program was:" >&5
7870   cat conftest.$ac_ext >&5
7871   rm -rf conftest*
7872   eval "ac_cv_header_$ac_safe=no"
7873 fi
7874 rm -f conftest*
7875 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7876   echo "$ac_t""yes" 1>&6
7877   :
7878 else
7879   echo "$ac_t""no" 1>&6
7880 with_jpeg=no
7881 fi
7882  }
7883   test -z "$with_jpeg" && { 
7884 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7885 echo "configure:7886: checking for jpeg_destroy_decompress in -ljpeg" >&5
7886 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7887
7888 xe_check_libs=" -ljpeg "
7889 cat > conftest.$ac_ext <<EOF
7890 #line 7891 "configure"
7891 #include "confdefs.h"
7892 /* Override any gcc2 internal prototype to avoid an error.  */
7893 /* We use char because int might match the return type of a gcc2
7894     builtin and then its argument prototype would still apply.  */
7895 char jpeg_destroy_decompress();
7896
7897 int main() {
7898 jpeg_destroy_decompress()
7899 ; return 0; }
7900 EOF
7901 if { (eval echo configure:7902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7902   rm -rf conftest*
7903   eval "ac_cv_lib_$ac_lib_var=yes"
7904 else
7905   echo "configure: failed program was:" >&5
7906   cat conftest.$ac_ext >&5
7907   rm -rf conftest*
7908   eval "ac_cv_lib_$ac_lib_var=no"
7909 fi
7910 rm -f conftest*
7911 xe_check_libs=""
7912
7913 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7914   echo "$ac_t""yes" 1>&6
7915   :
7916 else
7917   echo "$ac_t""no" 1>&6
7918 with_jpeg=no
7919 fi
7920
7921  }
7922   test -z "$with_jpeg" && with_jpeg=yes
7923   if test "$with_jpeg" = "yes"; then
7924     { test "$extra_verbose" = "yes" && cat << \EOF
7925     Defining HAVE_JPEG
7926 EOF
7927 cat >> confdefs.h <<\EOF
7928 #define HAVE_JPEG 1
7929 EOF
7930 }
7931
7932     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7933   fi
7934
7935     png_problem=""
7936   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7937 echo "configure:7938: checking for pow" >&5
7938
7939 cat > conftest.$ac_ext <<EOF
7940 #line 7941 "configure"
7941 #include "confdefs.h"
7942 /* System header to define __stub macros and hopefully few prototypes,
7943     which can conflict with char pow(); below.  */
7944 #include <assert.h>
7945 /* Override any gcc2 internal prototype to avoid an error.  */
7946 /* We use char because int might match the return type of a gcc2
7947     builtin and then its argument prototype would still apply.  */
7948 char pow();
7949
7950 int main() {
7951
7952 /* The GNU C library defines this for functions which it implements
7953     to always fail with ENOSYS.  Some functions are actually named
7954     something starting with __ and the normal name is an alias.  */
7955 #if defined (__stub_pow) || defined (__stub___pow)
7956 choke me
7957 #else
7958 pow();
7959 #endif
7960
7961 ; return 0; }
7962 EOF
7963 if { (eval echo configure:7964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7964   rm -rf conftest*
7965   eval "ac_cv_func_pow=yes"
7966 else
7967   echo "configure: failed program was:" >&5
7968   cat conftest.$ac_ext >&5
7969   rm -rf conftest*
7970   eval "ac_cv_func_pow=no"
7971 fi
7972 rm -f conftest*
7973
7974 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7975   echo "$ac_t""yes" 1>&6
7976   :
7977 else
7978   echo "$ac_t""no" 1>&6
7979 with_png=no
7980 fi
7981  }
7982   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7983 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7984 echo "configure:7985: checking for png.h" >&5
7985
7986 cat > conftest.$ac_ext <<EOF
7987 #line 7988 "configure"
7988 #include "confdefs.h"
7989 #include <png.h>
7990 EOF
7991 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7992 { (eval echo configure:7993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7993 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7994 if test -z "$ac_err"; then
7995   rm -rf conftest*
7996   eval "ac_cv_header_$ac_safe=yes"
7997 else
7998   echo "$ac_err" >&5
7999   echo "configure: failed program was:" >&5
8000   cat conftest.$ac_ext >&5
8001   rm -rf conftest*
8002   eval "ac_cv_header_$ac_safe=no"
8003 fi
8004 rm -f conftest*
8005 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8006   echo "$ac_t""yes" 1>&6
8007   :
8008 else
8009   echo "$ac_t""no" 1>&6
8010 with_png=no
8011 fi
8012  }
8013   test -z "$with_png" && { 
8014 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
8015 echo "configure:8016: checking for png_read_image in -lpng" >&5
8016 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
8017
8018 xe_check_libs=" -lpng "
8019 cat > conftest.$ac_ext <<EOF
8020 #line 8021 "configure"
8021 #include "confdefs.h"
8022 /* Override any gcc2 internal prototype to avoid an error.  */
8023 /* We use char because int might match the return type of a gcc2
8024     builtin and then its argument prototype would still apply.  */
8025 char png_read_image();
8026
8027 int main() {
8028 png_read_image()
8029 ; return 0; }
8030 EOF
8031 if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8032   rm -rf conftest*
8033   eval "ac_cv_lib_$ac_lib_var=yes"
8034 else
8035   echo "configure: failed program was:" >&5
8036   cat conftest.$ac_ext >&5
8037   rm -rf conftest*
8038   eval "ac_cv_lib_$ac_lib_var=no"
8039 fi
8040 rm -f conftest*
8041 xe_check_libs=""
8042
8043 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8044   echo "$ac_t""yes" 1>&6
8045   :
8046 else
8047   echo "$ac_t""no" 1>&6
8048 with_png=no
8049 fi
8050
8051  }
8052   if test -z "$with_png"; then
8053     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
8054 echo "configure:8055: checking for workable png version information" >&5
8055     xe_check_libs="-lpng -lz"
8056     cat > conftest.$ac_ext <<EOF
8057 #line 8058 "configure"
8058 #include "confdefs.h"
8059 #include <png.h>
8060     int main(int c, char **v) {
8061     if (c == 1) return 0;
8062     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
8063     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
8064 EOF
8065 if { (eval echo configure:8066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8066 then
8067   ./conftest dummy_arg; png_status=$?;
8068       if test "$png_status" = "0"; then
8069         with_png=yes;
8070       else
8071         with_png=no;
8072         if test "$png_status" = "1"; then
8073           png_problem="PNG library version and header file don't match!"
8074         elif test "$png_status" = "2"; then
8075           png_problem="PNG library version too old (pre 1.0.2)!"
8076         fi
8077         echo "
8078 *** WARNING *** $png_problem
8079   I'm not touching that with a 10-foot pole!
8080   If you really want to use the installed version of libPNG, rerun
8081   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
8082     fi
8083 else
8084   conftest_rc="$?"
8085   echo "configure: failed program was:" >&5
8086   cat conftest.$ac_ext >&5
8087   rm -fr conftest*
8088   with_png=no
8089 fi
8090 rm -fr conftest*
8091     xe_check_libs=
8092     echo "$ac_t""$with_png" 1>&6
8093   fi
8094   if test "$with_png" = "yes"; then
8095     { test "$extra_verbose" = "yes" && cat << \EOF
8096     Defining HAVE_PNG
8097 EOF
8098 cat >> confdefs.h <<\EOF
8099 #define HAVE_PNG 1
8100 EOF
8101 }
8102
8103     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
8104   fi
8105
8106     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
8107 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
8108 echo "configure:8109: checking for tiffio.h" >&5
8109
8110 cat > conftest.$ac_ext <<EOF
8111 #line 8112 "configure"
8112 #include "confdefs.h"
8113 #include <tiffio.h>
8114 EOF
8115 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8116 { (eval echo configure:8117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8117 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8118 if test -z "$ac_err"; then
8119   rm -rf conftest*
8120   eval "ac_cv_header_$ac_safe=yes"
8121 else
8122   echo "$ac_err" >&5
8123   echo "configure: failed program was:" >&5
8124   cat conftest.$ac_ext >&5
8125   rm -rf conftest*
8126   eval "ac_cv_header_$ac_safe=no"
8127 fi
8128 rm -f conftest*
8129 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8130   echo "$ac_t""yes" 1>&6
8131   :
8132 else
8133   echo "$ac_t""no" 1>&6
8134 with_tiff=no
8135 fi
8136  }
8137   test -z "$with_tiff" && { 
8138 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
8139 echo "configure:8140: checking for TIFFClientOpen in -ltiff" >&5
8140 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
8141
8142 xe_check_libs=" -ltiff "
8143 cat > conftest.$ac_ext <<EOF
8144 #line 8145 "configure"
8145 #include "confdefs.h"
8146 /* Override any gcc2 internal prototype to avoid an error.  */
8147 /* We use char because int might match the return type of a gcc2
8148     builtin and then its argument prototype would still apply.  */
8149 char TIFFClientOpen();
8150
8151 int main() {
8152 TIFFClientOpen()
8153 ; return 0; }
8154 EOF
8155 if { (eval echo configure:8156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8156   rm -rf conftest*
8157   eval "ac_cv_lib_$ac_lib_var=yes"
8158 else
8159   echo "configure: failed program was:" >&5
8160   cat conftest.$ac_ext >&5
8161   rm -rf conftest*
8162   eval "ac_cv_lib_$ac_lib_var=no"
8163 fi
8164 rm -f conftest*
8165 xe_check_libs=""
8166
8167 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8168   echo "$ac_t""yes" 1>&6
8169   :
8170 else
8171   echo "$ac_t""no" 1>&6
8172 with_tiff=no
8173 fi
8174
8175  }
8176   test -z "$with_tiff" && with_tiff=yes
8177   if test "$with_tiff" = "yes"; then
8178     { test "$extra_verbose" = "yes" && cat << \EOF
8179     Defining HAVE_TIFF
8180 EOF
8181 cat >> confdefs.h <<\EOF
8182 #define HAVE_TIFF 1
8183 EOF
8184 }
8185
8186     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
8187   fi
8188 fi
8189
8190
8191 if test "$with_x11" = "yes"; then
8192
8193   echo "checking for X11 graphics libraries" 1>&6
8194 echo "configure:8195: checking for X11 graphics libraries" >&5
8195
8196   echo "checking for the Athena widgets" 1>&6
8197 echo "configure:8198: checking for the Athena widgets" >&5
8198
8199     case "$with_athena" in
8200         "xaw" | "")     athena_variant=Xaw      athena_3d=no  ;;
8201     "3d")       athena_variant=Xaw3d    athena_3d=yes ;;
8202     "next")     athena_variant=neXtaw   athena_3d=yes ;;
8203     "95")       athena_variant=Xaw95    athena_3d=yes ;;
8204     "xpm")      athena_variant=XawXpm   athena_3d=yes ;;
8205     *)          { echo "Error:" "Unknown Athena widget set \`$with_athena'. This should not happen." >&2; exit 1; } ;;
8206   esac
8207
8208     if test "$athena_3d" = "no"; then
8209     
8210 echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6
8211 echo "configure:8212: checking for XawScrollbarSetThumb in -l$athena_variant" >&5
8212 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
8213
8214 xe_check_libs=" -l$athena_variant "
8215 cat > conftest.$ac_ext <<EOF
8216 #line 8217 "configure"
8217 #include "confdefs.h"
8218 /* Override any gcc2 internal prototype to avoid an error.  */
8219 /* We use char because int might match the return type of a gcc2
8220     builtin and then its argument prototype would still apply.  */
8221 char XawScrollbarSetThumb();
8222
8223 int main() {
8224 XawScrollbarSetThumb()
8225 ; return 0; }
8226 EOF
8227 if { (eval echo configure:8228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8228   rm -rf conftest*
8229   eval "ac_cv_lib_$ac_lib_var=yes"
8230 else
8231   echo "configure: failed program was:" >&5
8232   cat conftest.$ac_ext >&5
8233   rm -rf conftest*
8234   eval "ac_cv_lib_$ac_lib_var=no"
8235 fi
8236 rm -f conftest*
8237 xe_check_libs=""
8238
8239 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8240   echo "$ac_t""yes" 1>&6
8241           
8242 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
8243 echo "configure:8244: checking for threeDClassRec in -l$athena_variant" >&5
8244 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
8245
8246 xe_check_libs=" -l$athena_variant "
8247 cat > conftest.$ac_ext <<EOF
8248 #line 8249 "configure"
8249 #include "confdefs.h"
8250 /* Override any gcc2 internal prototype to avoid an error.  */
8251 /* We use char because int might match the return type of a gcc2
8252     builtin and then its argument prototype would still apply.  */
8253 char threeDClassRec();
8254
8255 int main() {
8256 threeDClassRec()
8257 ; return 0; }
8258 EOF
8259 if { (eval echo configure:8260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8260   rm -rf conftest*
8261   eval "ac_cv_lib_$ac_lib_var=yes"
8262 else
8263   echo "configure: failed program was:" >&5
8264   cat conftest.$ac_ext >&5
8265   rm -rf conftest*
8266   eval "ac_cv_lib_$ac_lib_var=no"
8267 fi
8268 rm -f conftest*
8269 xe_check_libs=""
8270
8271 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8272   echo "$ac_t""yes" 1>&6
8273   echo "configure: warning: "Could not find a non-3d Athena widget library."" 1>&2
8274 else
8275   echo "$ac_t""no" 1>&6
8276 athena_lib=$athena_variant
8277 fi
8278
8279
8280       
8281 else
8282   echo "$ac_t""no" 1>&6
8283 echo "configure: warning: "Could not find an Athena widget library."" 1>&2
8284 fi
8285
8286
8287   else
8288         
8289 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
8290 echo "configure:8291: checking for threeDClassRec in -l$athena_variant" >&5
8291 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
8292
8293 xe_check_libs=" -l$athena_variant "
8294 cat > conftest.$ac_ext <<EOF
8295 #line 8296 "configure"
8296 #include "confdefs.h"
8297 /* Override any gcc2 internal prototype to avoid an error.  */
8298 /* We use char because int might match the return type of a gcc2
8299     builtin and then its argument prototype would still apply.  */
8300 char threeDClassRec();
8301
8302 int main() {
8303 threeDClassRec()
8304 ; return 0; }
8305 EOF
8306 if { (eval echo configure:8307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8307   rm -rf conftest*
8308   eval "ac_cv_lib_$ac_lib_var=yes"
8309 else
8310   echo "configure: failed program was:" >&5
8311   cat conftest.$ac_ext >&5
8312   rm -rf conftest*
8313   eval "ac_cv_lib_$ac_lib_var=no"
8314 fi
8315 rm -f conftest*
8316 xe_check_libs=""
8317
8318 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8319   echo "$ac_t""yes" 1>&6
8320   athena_lib=$athena_variant
8321 else
8322   echo "$ac_t""no" 1>&6
8323 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6
8324 echo "configure:8325: checking for threeDClassRec in -lXaw" >&5
8325 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'`
8326
8327 xe_check_libs=" -lXaw "
8328 cat > conftest.$ac_ext <<EOF
8329 #line 8330 "configure"
8330 #include "confdefs.h"
8331 /* Override any gcc2 internal prototype to avoid an error.  */
8332 /* We use char because int might match the return type of a gcc2
8333     builtin and then its argument prototype would still apply.  */
8334 char threeDClassRec();
8335
8336 int main() {
8337 threeDClassRec()
8338 ; return 0; }
8339 EOF
8340 if { (eval echo configure:8341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8341   rm -rf conftest*
8342   eval "ac_cv_lib_$ac_lib_var=yes"
8343 else
8344   echo "configure: failed program was:" >&5
8345   cat conftest.$ac_ext >&5
8346   rm -rf conftest*
8347   eval "ac_cv_lib_$ac_lib_var=no"
8348 fi
8349 rm -f conftest*
8350 xe_check_libs=""
8351
8352 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8353   echo "$ac_t""yes" 1>&6
8354   athena_lib=Xaw;
8355           echo "configure: warning: "Assuming that libXaw is actually $athena_variant."" 1>&2;
8356         
8357 else
8358   echo "$ac_t""no" 1>&6
8359 echo "configure: warning: "Could not find a 3d Athena widget library that looked like $athena_variant."" 1>&2
8360 fi
8361
8362
8363 fi
8364
8365
8366   fi
8367
8368     if test "$athena_3d" = "no"; then
8369     ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
8370 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
8371 echo "configure:8372: checking for X11/Xaw/ThreeD.h" >&5
8372
8373 cat > conftest.$ac_ext <<EOF
8374 #line 8375 "configure"
8375 #include "confdefs.h"
8376 #include <X11/Xaw/ThreeD.h>
8377 EOF
8378 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8379 { (eval echo configure:8380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8380 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8381 if test -z "$ac_err"; then
8382   rm -rf conftest*
8383   eval "ac_cv_header_$ac_safe=yes"
8384 else
8385   echo "$ac_err" >&5
8386   echo "configure: failed program was:" >&5
8387   cat conftest.$ac_ext >&5
8388   rm -rf conftest*
8389   eval "ac_cv_header_$ac_safe=no"
8390 fi
8391 rm -f conftest*
8392 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8393   echo "$ac_t""yes" 1>&6
8394   echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2
8395 else
8396   echo "$ac_t""no" 1>&6
8397 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'`
8398 echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6
8399 echo "configure:8400: checking for X11/Xaw/XawInit.h" >&5
8400
8401 cat > conftest.$ac_ext <<EOF
8402 #line 8403 "configure"
8403 #include "confdefs.h"
8404 #include <X11/Xaw/XawInit.h>
8405 EOF
8406 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8407 { (eval echo configure:8408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8408 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8409 if test -z "$ac_err"; then
8410   rm -rf conftest*
8411   eval "ac_cv_header_$ac_safe=yes"
8412 else
8413   echo "$ac_err" >&5
8414   echo "configure: failed program was:" >&5
8415   cat conftest.$ac_ext >&5
8416   rm -rf conftest*
8417   eval "ac_cv_header_$ac_safe=no"
8418 fi
8419 rm -f conftest*
8420 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8421   echo "$ac_t""yes" 1>&6
8422   athena_h_path=X11/Xaw
8423 else
8424   echo "$ac_t""no" 1>&6
8425 echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2
8426 fi
8427
8428 fi
8429
8430   else
8431             ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
8432 echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6
8433 echo "configure:8434: checking for X11/$athena_variant/XawInit.h" >&5
8434
8435 cat > conftest.$ac_ext <<EOF
8436 #line 8437 "configure"
8437 #include "confdefs.h"
8438 #include <X11/$athena_variant/XawInit.h>
8439 EOF
8440 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8441 { (eval echo configure:8442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8442 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8443 if test -z "$ac_err"; then
8444   rm -rf conftest*
8445   eval "ac_cv_header_$ac_safe=yes"
8446 else
8447   echo "$ac_err" >&5
8448   echo "configure: failed program was:" >&5
8449   cat conftest.$ac_ext >&5
8450   rm -rf conftest*
8451   eval "ac_cv_header_$ac_safe=no"
8452 fi
8453 rm -f conftest*
8454 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8455   echo "$ac_t""yes" 1>&6
8456   ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
8457 echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6
8458 echo "configure:8459: checking for X11/$athena_variant/ThreeD.h" >&5
8459
8460 cat > conftest.$ac_ext <<EOF
8461 #line 8462 "configure"
8462 #include "confdefs.h"
8463 #include <X11/$athena_variant/ThreeD.h>
8464 EOF
8465 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8466 { (eval echo configure:8467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8467 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8468 if test -z "$ac_err"; then
8469   rm -rf conftest*
8470   eval "ac_cv_header_$ac_safe=yes"
8471 else
8472   echo "$ac_err" >&5
8473   echo "configure: failed program was:" >&5
8474   cat conftest.$ac_ext >&5
8475   rm -rf conftest*
8476   eval "ac_cv_header_$ac_safe=no"
8477 fi
8478 rm -f conftest*
8479 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8480   echo "$ac_t""yes" 1>&6
8481   athena_h_path=X11/$athena_variant
8482 else
8483   echo "$ac_t""no" 1>&6
8484 fi
8485
8486 else
8487   echo "$ac_t""no" 1>&6
8488 fi
8489
8490
8491         if test -z "$athena_h_path"; then
8492       ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
8493 echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6
8494 echo "configure:8495: checking for $athena_variant/XawInit.h" >&5
8495
8496 cat > conftest.$ac_ext <<EOF
8497 #line 8498 "configure"
8498 #include "confdefs.h"
8499 #include <$athena_variant/XawInit.h>
8500 EOF
8501 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8502 { (eval echo configure:8503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8503 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8504 if test -z "$ac_err"; then
8505   rm -rf conftest*
8506   eval "ac_cv_header_$ac_safe=yes"
8507 else
8508   echo "$ac_err" >&5
8509   echo "configure: failed program was:" >&5
8510   cat conftest.$ac_ext >&5
8511   rm -rf conftest*
8512   eval "ac_cv_header_$ac_safe=no"
8513 fi
8514 rm -f conftest*
8515 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8516   echo "$ac_t""yes" 1>&6
8517   ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
8518 echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6
8519 echo "configure:8520: checking for $athena_variant/ThreeD.h" >&5
8520
8521 cat > conftest.$ac_ext <<EOF
8522 #line 8523 "configure"
8523 #include "confdefs.h"
8524 #include <$athena_variant/ThreeD.h>
8525 EOF
8526 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8527 { (eval echo configure:8528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8528 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8529 if test -z "$ac_err"; then
8530   rm -rf conftest*
8531   eval "ac_cv_header_$ac_safe=yes"
8532 else
8533   echo "$ac_err" >&5
8534   echo "configure: failed program was:" >&5
8535   cat conftest.$ac_ext >&5
8536   rm -rf conftest*
8537   eval "ac_cv_header_$ac_safe=no"
8538 fi
8539 rm -f conftest*
8540 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8541   echo "$ac_t""yes" 1>&6
8542   athena_h_path=$athena_variant
8543 else
8544   echo "$ac_t""no" 1>&6
8545 fi
8546
8547 else
8548   echo "$ac_t""no" 1>&6
8549 fi
8550
8551     fi
8552
8553         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
8554       ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
8555 echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6
8556 echo "configure:8557: checking for X11/Xaw3d/XawInit.h" >&5
8557
8558 cat > conftest.$ac_ext <<EOF
8559 #line 8560 "configure"
8560 #include "confdefs.h"
8561 #include <X11/Xaw3d/XawInit.h>
8562 EOF
8563 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8564 { (eval echo configure:8565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8565 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8566 if test -z "$ac_err"; then
8567   rm -rf conftest*
8568   eval "ac_cv_header_$ac_safe=yes"
8569 else
8570   echo "$ac_err" >&5
8571   echo "configure: failed program was:" >&5
8572   cat conftest.$ac_ext >&5
8573   rm -rf conftest*
8574   eval "ac_cv_header_$ac_safe=no"
8575 fi
8576 rm -f conftest*
8577 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8578   echo "$ac_t""yes" 1>&6
8579   ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
8580 echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6
8581 echo "configure:8582: checking for X11/Xaw3d/ThreeD.h" >&5
8582
8583 cat > conftest.$ac_ext <<EOF
8584 #line 8585 "configure"
8585 #include "confdefs.h"
8586 #include <X11/Xaw3d/ThreeD.h>
8587 EOF
8588 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8589 { (eval echo configure:8590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8590 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8591 if test -z "$ac_err"; then
8592   rm -rf conftest*
8593   eval "ac_cv_header_$ac_safe=yes"
8594 else
8595   echo "$ac_err" >&5
8596   echo "configure: failed program was:" >&5
8597   cat conftest.$ac_ext >&5
8598   rm -rf conftest*
8599   eval "ac_cv_header_$ac_safe=no"
8600 fi
8601 rm -f conftest*
8602 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8603   echo "$ac_t""yes" 1>&6
8604   
8605             echo "configure: warning: "Assuming that X11/Xaw3d headers are suitable for $athena_variant."" 1>&2
8606             athena_h_path=X11/Xaw3d
8607           
8608 else
8609   echo "$ac_t""no" 1>&6
8610 fi
8611
8612 else
8613   echo "$ac_t""no" 1>&6
8614 fi
8615
8616     fi
8617
8618         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
8619       ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
8620 echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6
8621 echo "configure:8622: checking for Xaw3d/XawInit.h" >&5
8622
8623 cat > conftest.$ac_ext <<EOF
8624 #line 8625 "configure"
8625 #include "confdefs.h"
8626 #include <Xaw3d/XawInit.h>
8627 EOF
8628 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8629 { (eval echo configure:8630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8630 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8631 if test -z "$ac_err"; then
8632   rm -rf conftest*
8633   eval "ac_cv_header_$ac_safe=yes"
8634 else
8635   echo "$ac_err" >&5
8636   echo "configure: failed program was:" >&5
8637   cat conftest.$ac_ext >&5
8638   rm -rf conftest*
8639   eval "ac_cv_header_$ac_safe=no"
8640 fi
8641 rm -f conftest*
8642 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8643   echo "$ac_t""yes" 1>&6
8644   ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
8645 echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6
8646 echo "configure:8647: checking for Xaw3d/ThreeD.h" >&5
8647
8648 cat > conftest.$ac_ext <<EOF
8649 #line 8650 "configure"
8650 #include "confdefs.h"
8651 #include <Xaw3d/ThreeD.h>
8652 EOF
8653 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8654 { (eval echo configure:8655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8655 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8656 if test -z "$ac_err"; then
8657   rm -rf conftest*
8658   eval "ac_cv_header_$ac_safe=yes"
8659 else
8660   echo "$ac_err" >&5
8661   echo "configure: failed program was:" >&5
8662   cat conftest.$ac_ext >&5
8663   rm -rf conftest*
8664   eval "ac_cv_header_$ac_safe=no"
8665 fi
8666 rm -f conftest*
8667 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8668   echo "$ac_t""yes" 1>&6
8669   
8670             echo "configure: warning: "Assuming that Xaw3d headers are suitable for $athena_variant."" 1>&2
8671             athena_h_path=Xaw3d
8672           
8673 else
8674   echo "$ac_t""no" 1>&6
8675 fi
8676
8677 else
8678   echo "$ac_t""no" 1>&6
8679 fi
8680
8681     fi
8682
8683             if test -z "$athena_h_path"; then
8684       ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
8685 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
8686 echo "configure:8687: checking for X11/Xaw/ThreeD.h" >&5
8687
8688 cat > conftest.$ac_ext <<EOF
8689 #line 8690 "configure"
8690 #include "confdefs.h"
8691 #include <X11/Xaw/ThreeD.h>
8692 EOF
8693 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8694 { (eval echo configure:8695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8695 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8696 if test -z "$ac_err"; then
8697   rm -rf conftest*
8698   eval "ac_cv_header_$ac_safe=yes"
8699 else
8700   echo "$ac_err" >&5
8701   echo "configure: failed program was:" >&5
8702   cat conftest.$ac_ext >&5
8703   rm -rf conftest*
8704   eval "ac_cv_header_$ac_safe=no"
8705 fi
8706 rm -f conftest*
8707 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8708   echo "$ac_t""yes" 1>&6
8709   
8710           echo "configure: warning: "Assuming that X11/Xaw headers are suitable for $athena_variant."" 1>&2
8711           athena_h_path=X11/Xaw
8712         
8713 else
8714   echo "$ac_t""no" 1>&6
8715 echo "configure: warning: "Could not find a suitable 3d Athena header set."" 1>&2
8716 fi
8717
8718     fi
8719   fi
8720
8721     if test -n "$athena_lib" -a -n "$athena_h_path"; then
8722     have_xaw=yes
8723   else
8724     have_xaw=no
8725   fi
8726
8727     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
8728 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
8729 echo "configure:8730: checking for Xm/Xm.h" >&5
8730
8731 cat > conftest.$ac_ext <<EOF
8732 #line 8733 "configure"
8733 #include "confdefs.h"
8734 #include <Xm/Xm.h>
8735 EOF
8736 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8737 { (eval echo configure:8738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8738 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8739 if test -z "$ac_err"; then
8740   rm -rf conftest*
8741   eval "ac_cv_header_$ac_safe=yes"
8742 else
8743   echo "$ac_err" >&5
8744   echo "configure: failed program was:" >&5
8745   cat conftest.$ac_ext >&5
8746   rm -rf conftest*
8747   eval "ac_cv_header_$ac_safe=no"
8748 fi
8749 rm -f conftest*
8750 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8751   echo "$ac_t""yes" 1>&6
8752   
8753 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
8754 echo "configure:8755: checking for XmStringFree in -lXm" >&5
8755 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
8756
8757 xe_check_libs=" -lXm "
8758 cat > conftest.$ac_ext <<EOF
8759 #line 8760 "configure"
8760 #include "confdefs.h"
8761 /* Override any gcc2 internal prototype to avoid an error.  */
8762 /* We use char because int might match the return type of a gcc2
8763     builtin and then its argument prototype would still apply.  */
8764 char XmStringFree();
8765
8766 int main() {
8767 XmStringFree()
8768 ; return 0; }
8769 EOF
8770 if { (eval echo configure:8771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8771   rm -rf conftest*
8772   eval "ac_cv_lib_$ac_lib_var=yes"
8773 else
8774   echo "configure: failed program was:" >&5
8775   cat conftest.$ac_ext >&5
8776   rm -rf conftest*
8777   eval "ac_cv_lib_$ac_lib_var=no"
8778 fi
8779 rm -f conftest*
8780 xe_check_libs=""
8781
8782 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8783   echo "$ac_t""yes" 1>&6
8784   have_motif=yes
8785 else
8786   echo "$ac_t""no" 1>&6
8787 have_motif=no
8788 fi
8789
8790
8791 else
8792   echo "$ac_t""no" 1>&6
8793 have_motif=no
8794 fi
8795
8796
8797   if test "$have_motif" = "yes"; then
8798         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
8799 echo "configure:8800: checking for Lesstif" >&5
8800     cat > conftest.$ac_ext <<EOF
8801 #line 8802 "configure"
8802 #include "confdefs.h"
8803 #include <Xm/Xm.h>
8804 #ifdef LESSTIF_VERSION
8805 yes
8806 #endif
8807
8808 EOF
8809 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8810   egrep "yes" >/dev/null 2>&1; then
8811   rm -rf conftest*
8812   have_lesstif=yes
8813 else
8814   rm -rf conftest*
8815   have_lesstif=no
8816 fi
8817 rm -f conftest*
8818
8819   echo "$ac_t""$have_lesstif" 1>&6
8820   fi
8821
8822 fi 
8823
8824 case "$with_menubars" in "" | "yes" | "athena" )
8825   with_menubars="lucid" ;;
8826 esac
8827 case "$with_dialogs" in "" | "yes" | "lucid" )
8828   if   test "$have_motif"     = "yes"; then with_dialogs="motif"
8829   elif test "$have_xaw"       = "yes"; then with_dialogs="athena"
8830   else with_dialogs=no
8831   fi ;;
8832 esac
8833 case "$with_scrollbars" in "" | "yes" )
8834   with_scrollbars="lucid" ;;
8835 esac
8836 case "$with_widgets" in "" | "yes" | "lucid")
8837   if   test "$have_motif" = "yes"; then with_widgets="motif"
8838   elif test "$have_xaw"   = "yes"; then with_widgets="athena"
8839   else with_widgets=no
8840   fi ;;
8841 esac
8842
8843 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
8844
8845 case "$all_widgets" in
8846   *athena* )
8847     if test "$have_xaw" != "yes"; then
8848       { echo "Error:" "Could not find a suitable Athena library to build with." >&2; exit 1; }
8849     fi
8850
8851         lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
8852
8853         libs_x="-l$athena_lib $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$athena_lib\" to \$libs_x"; fi
8854
8855                     { test "$extra_verbose" = "yes" && cat << EOF
8856     Defining ATHENA_Scrollbar_h_ = "$athena_h_path/Scrollbar.h"
8857 EOF
8858 cat >> confdefs.h <<EOF
8859 #define ATHENA_Scrollbar_h_ "$athena_h_path/Scrollbar.h"
8860 EOF
8861 }
8862
8863     { test "$extra_verbose" = "yes" && cat << EOF
8864     Defining ATHENA_Dialog_h_ = "$athena_h_path/Dialog.h"
8865 EOF
8866 cat >> confdefs.h <<EOF
8867 #define ATHENA_Dialog_h_ "$athena_h_path/Dialog.h"
8868 EOF
8869 }
8870
8871     { test "$extra_verbose" = "yes" && cat << EOF
8872     Defining ATHENA_Form_h_ = "$athena_h_path/Form.h"
8873 EOF
8874 cat >> confdefs.h <<EOF
8875 #define ATHENA_Form_h_ "$athena_h_path/Form.h"
8876 EOF
8877 }
8878
8879     { test "$extra_verbose" = "yes" && cat << EOF
8880     Defining ATHENA_Command_h_ = "$athena_h_path/Command.h"
8881 EOF
8882 cat >> confdefs.h <<EOF
8883 #define ATHENA_Command_h_ "$athena_h_path/Command.h"
8884 EOF
8885 }
8886
8887     { test "$extra_verbose" = "yes" && cat << EOF
8888     Defining ATHENA_Label_h_ = "$athena_h_path/Label.h"
8889 EOF
8890 cat >> confdefs.h <<EOF
8891 #define ATHENA_Label_h_ "$athena_h_path/Label.h"
8892 EOF
8893 }
8894
8895     { test "$extra_verbose" = "yes" && cat << EOF
8896     Defining ATHENA_LabelP_h_ = "$athena_h_path/LabelP.h"
8897 EOF
8898 cat >> confdefs.h <<EOF
8899 #define ATHENA_LabelP_h_ "$athena_h_path/LabelP.h"
8900 EOF
8901 }
8902
8903     { test "$extra_verbose" = "yes" && cat << EOF
8904     Defining ATHENA_Toggle_h_ = "$athena_h_path/Toggle.h"
8905 EOF
8906 cat >> confdefs.h <<EOF
8907 #define ATHENA_Toggle_h_ "$athena_h_path/Toggle.h"
8908 EOF
8909 }
8910
8911     { test "$extra_verbose" = "yes" && cat << EOF
8912     Defining ATHENA_ToggleP_h_ = "$athena_h_path/ToggleP.h"
8913 EOF
8914 cat >> confdefs.h <<EOF
8915 #define ATHENA_ToggleP_h_ "$athena_h_path/ToggleP.h"
8916 EOF
8917 }
8918
8919     { test "$extra_verbose" = "yes" && cat << EOF
8920     Defining ATHENA_AsciiText_h_ = "$athena_h_path/AsciiText.h"
8921 EOF
8922 cat >> confdefs.h <<EOF
8923 #define ATHENA_AsciiText_h_ "$athena_h_path/AsciiText.h"
8924 EOF
8925 }
8926
8927     { test "$extra_verbose" = "yes" && cat << EOF
8928     Defining ATHENA_XawInit_h_ = "$athena_h_path/XawInit.h"
8929 EOF
8930 cat >> confdefs.h <<EOF
8931 #define ATHENA_XawInit_h_ "$athena_h_path/XawInit.h"
8932 EOF
8933 }
8934
8935
8936     { test "$extra_verbose" = "yes" && cat << \EOF
8937     Defining LWLIB_USES_ATHENA
8938 EOF
8939 cat >> confdefs.h <<\EOF
8940 #define LWLIB_USES_ATHENA 1
8941 EOF
8942 }
8943
8944     { test "$extra_verbose" = "yes" && cat << \EOF
8945     Defining NEED_ATHENA
8946 EOF
8947 cat >> confdefs.h <<\EOF
8948 #define NEED_ATHENA 1
8949 EOF
8950 }
8951
8952     need_athena="yes"
8953
8954     if test "$athena_3d" = "yes"; then
8955       { test "$extra_verbose" = "yes" && cat << \EOF
8956     Defining HAVE_ATHENA_3D
8957 EOF
8958 cat >> confdefs.h <<\EOF
8959 #define HAVE_ATHENA_3D 1
8960 EOF
8961 }
8962
8963     fi
8964   ;;
8965 esac
8966
8967 case "$all_widgets" in *motif* )
8968   { test "$extra_verbose" = "yes" && cat << \EOF
8969     Defining LWLIB_USES_MOTIF
8970 EOF
8971 cat >> confdefs.h <<\EOF
8972 #define LWLIB_USES_MOTIF 1
8973 EOF
8974 }
8975
8976   { test "$extra_verbose" = "yes" && cat << \EOF
8977     Defining NEED_MOTIF
8978 EOF
8979 cat >> confdefs.h <<\EOF
8980 #define NEED_MOTIF 1
8981 EOF
8982 }
8983
8984   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
8985   need_motif=yes ;;
8986 esac
8987
8988 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
8989 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
8990 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
8991 test "$with_widgets"   != "no" && test "$with_widgets" != "msw" && \
8992         lwlib_objs="$lwlib_objs xlwtabs.o xlwgcs.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwtabs.o xlwgcs.o\" to \$lwlib_objs"; fi
8993 case "$with_widgets" in athena* )
8994         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;;
8995 esac
8996 case "$all_widgets" in *lucid* )
8997   { test "$extra_verbose" = "yes" && cat << \EOF
8998     Defining NEED_LUCID
8999 EOF
9000 cat >> confdefs.h <<\EOF
9001 #define NEED_LUCID 1
9002 EOF
9003 }
9004
9005   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
9006 esac
9007
9008
9009
9010 test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9011     Defining LWLIB_SCROLLBARS_ATHENA
9012 EOF
9013 cat >> confdefs.h <<\EOF
9014 #define LWLIB_SCROLLBARS_ATHENA 1
9015 EOF
9016 }
9017
9018 test "$with_dialogs"    = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9019     Defining LWLIB_DIALOGS_ATHENA
9020 EOF
9021 cat >> confdefs.h <<\EOF
9022 #define LWLIB_DIALOGS_ATHENA 1
9023 EOF
9024 }
9025
9026
9027 if test "$athena_3d" = "yes"; then
9028   test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9029     Defining LWLIB_SCROLLBARS_ATHENA3D
9030 EOF
9031 cat >> confdefs.h <<\EOF
9032 #define LWLIB_SCROLLBARS_ATHENA3D 1
9033 EOF
9034 }
9035
9036   test "$with_dialogs"    = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
9037     Defining LWLIB_DIALOGS_ATHENA3D
9038 EOF
9039 cat >> confdefs.h <<\EOF
9040 #define LWLIB_DIALOGS_ATHENA3D 1
9041 EOF
9042 }
9043
9044 fi
9045
9046 case "$with_widgets" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
9047     Defining LWLIB_WIDGETS_ATHENA
9048 EOF
9049 cat >> confdefs.h <<\EOF
9050 #define LWLIB_WIDGETS_ATHENA 1
9051 EOF
9052 }
9053 ;; esac
9054 test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \
9055         { test "$extra_verbose" = "yes" && cat << \EOF
9056     Defining LWLIB_TABS_LUCID
9057 EOF
9058 cat >> confdefs.h <<\EOF
9059 #define LWLIB_TABS_LUCID 1
9060 EOF
9061 }
9062
9063
9064 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9065     Defining HAVE_MENUBARS
9066 EOF
9067 cat >> confdefs.h <<\EOF
9068 #define HAVE_MENUBARS 1
9069 EOF
9070 }
9071
9072 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9073     Defining HAVE_SCROLLBARS
9074 EOF
9075 cat >> confdefs.h <<\EOF
9076 #define HAVE_SCROLLBARS 1
9077 EOF
9078 }
9079
9080 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9081     Defining HAVE_DIALOGS
9082 EOF
9083 cat >> confdefs.h <<\EOF
9084 #define HAVE_DIALOGS 1
9085 EOF
9086 }
9087
9088 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9089     Defining HAVE_TOOLBARS
9090 EOF
9091 cat >> confdefs.h <<\EOF
9092 #define HAVE_TOOLBARS 1
9093 EOF
9094 }
9095
9096 test "$with_widgets"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
9097     Defining HAVE_WIDGETS
9098 EOF
9099 cat >> confdefs.h <<\EOF
9100 #define HAVE_WIDGETS 1
9101 EOF
9102 }
9103
9104
9105 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
9106     Defining LWLIB_MENUBARS_LUCID
9107 EOF
9108 cat >> confdefs.h <<\EOF
9109 #define LWLIB_MENUBARS_LUCID 1
9110 EOF
9111 }
9112
9113 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
9114     Defining LWLIB_SCROLLBARS_LUCID
9115 EOF
9116 cat >> confdefs.h <<\EOF
9117 #define LWLIB_SCROLLBARS_LUCID 1
9118 EOF
9119 }
9120
9121
9122 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9123     Defining LWLIB_MENUBARS_MOTIF
9124 EOF
9125 cat >> confdefs.h <<\EOF
9126 #define LWLIB_MENUBARS_MOTIF 1
9127 EOF
9128 }
9129
9130 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9131     Defining LWLIB_SCROLLBARS_MOTIF
9132 EOF
9133 cat >> confdefs.h <<\EOF
9134 #define LWLIB_SCROLLBARS_MOTIF 1
9135 EOF
9136 }
9137
9138 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9139     Defining LWLIB_DIALOGS_MOTIF
9140 EOF
9141 cat >> confdefs.h <<\EOF
9142 #define LWLIB_DIALOGS_MOTIF 1
9143 EOF
9144 }
9145
9146 test "$with_widgets"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
9147     Defining LWLIB_WIDGETS_MOTIF
9148 EOF
9149 cat >> confdefs.h <<\EOF
9150 #define LWLIB_WIDGETS_MOTIF 1
9151 EOF
9152 }
9153
9154
9155 test "$with_menubars"   != "no"    && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
9156    echo "    xemacs will be linked with \"menubar.o\""
9157  fi
9158 test "$with_scrollbars" != "no"    && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
9159    echo "    xemacs will be linked with \"scrollbar.o\""
9160  fi
9161 test "$with_dialogs"    != "no"    && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
9162    echo "    xemacs will be linked with \"dialog.o\""
9163  fi
9164 test "$with_toolbars"   != "no"    && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
9165    echo "    xemacs will be linked with \"toolbar.o\""
9166  fi
9167
9168 if test "$with_x11" = "yes"; then
9169   test "$with_menubars"   != "no"  && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
9170    echo "    xemacs will be linked with \"menubar-x.o\""
9171  fi
9172   test "$with_scrollbars" != "no"  && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
9173    echo "    xemacs will be linked with \"scrollbar-x.o\""
9174  fi
9175   test "$with_dialogs"    != "no"  && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
9176    echo "    xemacs will be linked with \"dialog-x.o\""
9177  fi
9178   test "$with_toolbars"   != "no"  && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
9179    echo "    xemacs will be linked with \"toolbar-x.o\""
9180  fi
9181   test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
9182    echo "    xemacs will be linked with \"gui-x.o\""
9183  fi
9184 fi
9185
9186
9187 test -z "$with_mule" && with_mule=no
9188 test -z "$with_file_coding" && with_file_coding=no
9189
9190
9191 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
9192   { test "$extra_verbose" = "yes" && cat << \EOF
9193     Defining FILE_CODING
9194 EOF
9195 cat >> confdefs.h <<\EOF
9196 #define FILE_CODING 1
9197 EOF
9198 }
9199
9200   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
9201    echo "    xemacs will be linked with \"file-coding.o\""
9202  fi
9203 fi
9204
9205 if test "$with_mule" = "yes" ; then
9206   echo "checking for Mule-related features" 1>&6
9207 echo "configure:9208: checking for Mule-related features" >&5
9208   { test "$extra_verbose" = "yes" && cat << \EOF
9209     Defining MULE
9210 EOF
9211 cat >> confdefs.h <<\EOF
9212 #define MULE 1
9213 EOF
9214 }
9215
9216   { test "$extra_verbose" = "yes" && cat << \EOF
9217     Defining FILE_CODING
9218 EOF
9219 cat >> confdefs.h <<\EOF
9220 #define FILE_CODING 1
9221 EOF
9222 }
9223
9224   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o" &&  if test "$extra_verbose" = "yes"; then
9225    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o\""
9226  fi
9227   if test "$with_utf_2000" = "yes" && test "$with_text_coding" = "yes"; then
9228     { test "$extra_verbose" = "yes" && cat << \EOF
9229     Defining TEXT_CODING
9230 EOF
9231 cat >> confdefs.h <<\EOF
9232 #define TEXT_CODING 1
9233 EOF
9234 }
9235
9236     extra_objs="$extra_objs text-coding.o" &&  if test "$extra_verbose" = "yes"; then
9237    echo "    xemacs will be linked with \"text-coding.o\""
9238  fi
9239   else
9240     extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
9241    echo "    xemacs will be linked with \"file-coding.o\""
9242  fi
9243   fi
9244     for ac_hdr in libintl.h
9245 do
9246 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9247 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9248 echo "configure:9249: checking for $ac_hdr" >&5
9249
9250 cat > conftest.$ac_ext <<EOF
9251 #line 9252 "configure"
9252 #include "confdefs.h"
9253 #include <$ac_hdr>
9254 EOF
9255 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9256 { (eval echo configure:9257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9257 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9258 if test -z "$ac_err"; then
9259   rm -rf conftest*
9260   eval "ac_cv_header_$ac_safe=yes"
9261 else
9262   echo "$ac_err" >&5
9263   echo "configure: failed program was:" >&5
9264   cat conftest.$ac_ext >&5
9265   rm -rf conftest*
9266   eval "ac_cv_header_$ac_safe=no"
9267 fi
9268 rm -f conftest*
9269 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9270   echo "$ac_t""yes" 1>&6
9271     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9272   { test "$extra_verbose" = "yes" && cat << EOF
9273     Defining $ac_tr_hdr
9274 EOF
9275 cat >> confdefs.h <<EOF
9276 #define $ac_tr_hdr 1
9277 EOF
9278 }
9279  
9280 else
9281   echo "$ac_t""no" 1>&6
9282 fi
9283 done
9284
9285   
9286 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
9287 echo "configure:9288: checking for strerror in -lintl" >&5
9288 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
9289
9290 xe_check_libs=" -lintl "
9291 cat > conftest.$ac_ext <<EOF
9292 #line 9293 "configure"
9293 #include "confdefs.h"
9294 /* Override any gcc2 internal prototype to avoid an error.  */
9295 /* We use char because int might match the return type of a gcc2
9296     builtin and then its argument prototype would still apply.  */
9297 char strerror();
9298
9299 int main() {
9300 strerror()
9301 ; return 0; }
9302 EOF
9303 if { (eval echo configure:9304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9304   rm -rf conftest*
9305   eval "ac_cv_lib_$ac_lib_var=yes"
9306 else
9307   echo "configure: failed program was:" >&5
9308   cat conftest.$ac_ext >&5
9309   rm -rf conftest*
9310   eval "ac_cv_lib_$ac_lib_var=no"
9311 fi
9312 rm -f conftest*
9313 xe_check_libs=""
9314
9315 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9316   echo "$ac_t""yes" 1>&6
9317     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9318     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9319   { test "$extra_verbose" = "yes" && cat << EOF
9320     Defining $ac_tr_lib
9321 EOF
9322 cat >> confdefs.h <<EOF
9323 #define $ac_tr_lib 1
9324 EOF
9325 }
9326
9327   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
9328
9329 else
9330   echo "$ac_t""no" 1>&6
9331 fi
9332
9333
9334
9335   if test "$with_utf_2000" = "yes" ; then
9336     { test "$extra_verbose" = "yes" && cat << \EOF
9337     Defining CHAR_IS_UCS4
9338 EOF
9339 cat >> confdefs.h <<\EOF
9340 #define CHAR_IS_UCS4 1
9341 EOF
9342 }
9343
9344     { test "$extra_verbose" = "yes" && cat << \EOF
9345     Defining UTF2000
9346 EOF
9347 cat >> confdefs.h <<\EOF
9348 #define UTF2000 1
9349 EOF
9350 }
9351
9352   fi
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 utimes 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   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
13862     # PIC is the default for these OSes.
13863     ;;
13864
13865   aix3* | aix4* | 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   irix5* | irix6*)
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   osf3* | osf4*)
13900     # All OSF/1 code is PIC.
13901     wl='-Wl,'
13902     ;;
13903
13904   sco3.2v5*)
13905     dll_cflags='-belf -Kpic'
13906     wl='-Wl,'
13907     ;;
13908
13909   unixware*)
13910     dll_cflags="-KPIC"
13911     wl="-Wl,"
13912     ;;
13913
13914   sysv4*)
13915     dll_cflags="-KPIC"
13916     wl="-Wl,"
13917     ;;
13918
13919   sysv5*)
13920     dll_cflags="-KPIC"
13921     wl="-Wl,"
13922     ;;
13923
13924   solaris2*)
13925     dll_cflags='-KPIC'
13926     wl='-Wl,'
13927     ;;
13928
13929   sunos4*)
13930     dll_cflags='-PIC'
13931     wl='-Qoption ld '
13932     ;;
13933
13934   uts4*)
13935     dll_cflags='-pic'
13936     ;;
13937
13938   *)
13939     can_build_shared=no
13940     ;;
13941   esac
13942 fi
13943
13944 if test -n "$dll_cflags"; then
13945   echo "$ac_t""${dll_cflags}" 1>&6
13946
13947   # Check to make sure the dll_cflags actually works.
13948   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
13949 echo "configure:13950: checking if PIC flag ${dll_cflags} really works" >&5
13950   save_CFLAGS="$CFLAGS"
13951   CFLAGS="$CFLAGS $dll_cflags -DPIC"
13952   cat > conftest.$ac_ext <<EOF
13953 #line 13954 "configure"
13954 #include "confdefs.h"
13955
13956 int main() {
13957 int x=0;
13958 ; return 0; }
13959 EOF
13960 if { (eval echo configure:13961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13961   rm -rf conftest*
13962   
13963     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
13964     # reports no error.  So, we need to grep stderr for (Bundled).
13965     if grep '(Bundled)' config.log >/dev/null; then
13966       echo "$ac_t""no" 1>&6
13967       can_build_shared=no
13968       dll_cflags=
13969     else
13970       echo "$ac_t""yes" 1>&6
13971     fi
13972 else
13973   echo "configure: failed program was:" >&5
13974   cat conftest.$ac_ext >&5
13975   rm -rf conftest*
13976   echo "$ac_t""no" 1>&6
13977     can_build_shared=no
13978     dll_cflags=
13979 fi
13980 rm -f conftest*
13981   CFLAGS="$save_CFLAGS"
13982 else
13983   echo "$ac_t""none" 1>&6
13984 fi
13985
13986 if test "$can_build_shared" = "yes"; then
13987 cc_produces_so=no
13988 xldf=
13989 xcldf=
13990 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
13991 echo "configure:13992: checking if C compiler can produce shared libraries" >&5
13992 if test "$XEGCC" = yes; then
13993   xcldf="-shared"
13994   xldf="-shared"
13995 else # Not using GCC
13996   case "$xehost_os" in
13997     aix3* | aix4*)
13998       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
13999       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
14000       ;;
14001
14002     freebsd2* | netbsd* | openbsd*)
14003       xldf="-Bshareable"
14004       xcldf="${wl}-Bshareable"
14005       ;;
14006
14007     freebsd3*)
14008       xcldf="-shared"
14009       ;;
14010
14011     hpux*)
14012       xldf="-b +s"
14013       xcldf="${wl}-b ${wl}+s"
14014       ;;
14015
14016     irix5* | irix6* | osf3* | osf4*)
14017       xcldf="${wl}-shared"
14018       xldf="-shared"
14019       ;;
14020
14021     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
14022       xcldf="-G"
14023       xldf="-G"
14024       ;;
14025
14026     sunos4*)
14027       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
14028       xldf="-assert pure-text -Bstatic"
14029       ;;
14030   esac
14031 fi # End if if we are using gcc
14032
14033 if test -n "$xcldf"; then
14034   save_LDFLAGS=$LDFLAGS
14035   save_LIBS=$LIBS
14036   save_xe_libs=$xe_libs
14037   LDFLAGS="$xcldf $LDFLAGS"
14038   LIBS=
14039   xe_libs=
14040   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
14041   cat > conftest.$ac_ext <<EOF
14042 #line 14043 "configure"
14043 #include "confdefs.h"
14044
14045 int main() {
14046 int x=0;
14047 ; return 0; }
14048 EOF
14049 if { (eval echo configure:14050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14050   rm -rf conftest*
14051   cc_produces_so=yes
14052 else
14053   echo "configure: failed program was:" >&5
14054   cat conftest.$ac_ext >&5
14055   rm -rf conftest*
14056   cc_produces_so=no
14057 fi
14058 rm -f conftest*
14059   LDFLAGS=$save_LDFLAGS
14060   LIBS=$save_LIBS
14061   xe_libs=$save_xe_libs
14062   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
14063 else
14064   cc_produces_so=no
14065 fi
14066 echo "$ac_t""${cc_produces_so}" 1>&6
14067
14068 LTLD=$LD
14069 if test -z "$LTLD"; then
14070   ac_prog=ld
14071   if test "$XEGCC" = yes; then
14072     # Check if gcc -print-prog-name=ld gives a path.
14073     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
14074 echo "configure:14075: checking for ld used by GCC" >&5
14075     ac_prog=`($CC -print-prog-name=ld) 2>&5`
14076     case "$ac_prog" in
14077     # Accept absolute paths.
14078     /*)
14079       if test -z "$LTLD"; then
14080         case "$ac_prog" in
14081           *gcc-lib*) LTLD="$CC"
14082                      ;;
14083           *)         LTLD="$ac_prog"
14084                      ;;
14085         esac
14086       fi
14087       ;;
14088     "")
14089       # If it fails, then pretend we aren't using GCC.
14090       ac_prog=ld
14091       ;;
14092     *)
14093       # If it is relative, then search for the first ld in PATH.
14094       with_gnu_ld=unknown
14095       ;;
14096     esac
14097   else
14098     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
14099 echo "configure:14100: checking for GNU ld" >&5
14100   fi
14101
14102   if test -z "$LTLD"; then
14103     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
14104     for ac_dir in $PATH; do
14105       test -z "$ac_dir" && ac_dir=.
14106       if test -f "$ac_dir/$ac_prog"; then
14107         LTLD="$ac_dir/$ac_prog"
14108         # Check to see if the program is GNU ld.  I'd rather use --version,
14109         # but apparently some GNU ld's only accept -v.
14110         # Break only if it was the GNU/non-GNU ld that we prefer.
14111         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
14112           xe_gnu_ld=yes
14113         else
14114           xe_gnu_ld=no
14115         fi
14116       fi
14117     done
14118     IFS="$ac_save_ifs"
14119   fi
14120
14121   if test -n "$LTLD"; then
14122     echo "$ac_t""${LTLD}" 1>&6
14123   else
14124     echo "$ac_t""no" 1>&6
14125   fi
14126
14127   if test -z "$LTLD" -a "$cc_produces_so" = no; then
14128     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
14129     exit 1
14130   fi
14131 fi
14132
14133 ld_dynamic_link_flags=
14134
14135 # Check to see if it really is or isn't GNU ld.
14136 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
14137 echo "configure:14138: checking if the linker is GNU ld" >&5
14138 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
14139 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
14140   xe_gnu_ld=yes
14141 else
14142   xe_gnu_ld=no
14143 fi
14144 echo "$ac_t""${xe_gnu_ld}" 1>&6
14145
14146 case "$xehost_os" in
14147   amigaos* | sunos4*)
14148     # On these operating systems, we should treat GNU ld like the system ld.
14149     gnu_ld_acts_native=yes
14150     ;;
14151   *)
14152     gnu_ld_acts_native=no
14153     ;;
14154 esac
14155
14156 if test "$cc_produces_so" = "yes"; then
14157   dll_ld=$CC
14158   dll_ldflags=$xcldf
14159   can_build_shared=yes
14160   ld_shlibs=yes
14161 else
14162   # OK - only NOW do we futz about with ld.
14163   # See if the linker supports building shared libraries.
14164   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
14165 echo "configure:14166: checking whether the linker supports shared libraries" >&5
14166   dll_ld=$CC
14167   dll_ldflags=$LDFLAGS
14168   ld_shlibs=yes
14169   can_build_shared=yes
14170   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
14171     # See if GNU ld supports shared libraries.
14172     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
14173       dll_ld=$CC
14174       dll_ldflags="-shared"
14175       ld_shlibs=yes
14176     else
14177       ld_shlibs=no
14178     fi
14179   else
14180     # PORTME fill in a description of your system's linker (not GNU ld)
14181     case "$xehost_os" in
14182     aix3*)
14183       dll_ld=$LTLD
14184       dll_ldflags=$xldf
14185       ;;
14186
14187     aix4*)
14188       dll_ldflags=$xcldf
14189       ;;
14190
14191     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
14192     # support.  Future versions do this automatically, but an explicit c++rt0.o
14193     # doesn't break anything, and helps significantly (at the cost of a little
14194     # extra space).
14195     freebsd2.2*)
14196       dll_ld=$LTLD
14197       dll_ldflags=$xldf
14198       dll_post="/usr/lib/c++rt0.o"
14199       ;;
14200
14201     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
14202     freebsd2*)
14203       dll_ld=$LTLD
14204       dll_ldflags="-Bshareable"
14205       ;;
14206
14207     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
14208     freebsd3*)
14209       dll_ldflags="-shared"
14210       ;;
14211
14212     hpux*)
14213       dll_ld=$LTLD
14214       dll_ldflags=$xldf
14215       ;;
14216
14217     irix5* | irix6*)
14218       dll_ld=$LTLD
14219       dll_ldflags=$xldf
14220       ;;
14221
14222     netbsd*)
14223       # Tested with NetBSD 1.2 ld
14224       dll_ld=$LTLD
14225       dll_ldflags=$xldf
14226       ;;
14227
14228     openbsd*)
14229       dll_ld=$LTLD
14230       dll_ldflags=$xldf
14231       ;;
14232
14233     osf3* | osf4*)
14234       dll_ld=$LTLD
14235       dll_ldflags=$xldf
14236       ;;
14237
14238     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
14239     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
14240       dll_ld=$LTLD
14241       case "$dll_ld" in
14242         *gcc*) dll_ldflags="-shared"
14243                dll_ld=$CC
14244                ;;
14245         *)     dll_ldflags="-G"
14246                ;;
14247       esac
14248       ;;
14249
14250     sunos4*)
14251       if test "$XEGCC" = yes; then
14252         dll_ld=$CC
14253       else
14254         dll_ld=$LTLD
14255       fi
14256       dll_ldflags=$xldf
14257       ;;
14258
14259     uts4*)
14260       dll_ld=$LTLD
14261       dll_ldflags="-G"
14262       ;;
14263
14264     bsdi*)
14265       dll_ldflags="-r"
14266       dll_ld="shlicc2"
14267       ;;
14268
14269     *)
14270       ld_shlibs=no
14271       can_build_shared=no
14272       ;;
14273     esac
14274   fi
14275   echo "$ac_t""${ld_shlibs}" 1>&6
14276   if test "$ld_shlibs" = "no"; then
14277     can_build_shared=no
14278   fi
14279 fi # End of if cc_produces_so = no
14280
14281
14282 if test "$xe_gnu_ld" = yes; then
14283   if test "$ld_shlibs" = yes; then
14284     ld_dynamic_link_flags="${wl}-export-dynamic"
14285   fi
14286 fi
14287
14288 if test -z "$ld_dynamic_link_flags"; then
14289   case "$xehost_os" in
14290   aix3*)
14291     ld_dynamic_link_flags=
14292     ;;
14293
14294   aix4*)
14295     ld_dynamic_link_flags=
14296     ;;
14297
14298   freebsd2.2*)
14299     ld_dynamic_link_flags=
14300     ;;
14301
14302   freebsd2*)
14303     ld_dynamic_link_flags=
14304     ;;
14305
14306   freebsd3*)
14307     ld_dynamic_link_flags=
14308     ;;
14309
14310   hpux*)
14311     ld_dynamic_link_flags="${wl}-E"
14312     ;;
14313
14314   irix5* | irix6*)
14315     ld_dynamic_link_flags=
14316     ;;
14317
14318   netbsd*)
14319     ld_dynamic_link_flags=
14320     ;;
14321
14322   openbsd*)
14323     ld_dynamic_link_flags=
14324     ;;
14325
14326   osf3* | osf4*)
14327     ld_dynamic_link_flags=
14328     ;;
14329
14330   solaris2* | solaris7*)
14331     ld_dynamic_link_flags=
14332     ;;
14333
14334   sco3.2v5* | unixware* | sysv5* | sysv4*)
14335     ld_dynamic_link_flags="${wl}-Bexport"
14336     ;;
14337
14338   sunos4*)
14339     ld_dynamic_link_flags=
14340     ;;
14341
14342   uts4*)
14343     ld_dynamic_link_flags=
14344     ;;
14345
14346   bsdi*)
14347     ld_dynamic_link_flags=
14348     ;;
14349
14350   esac
14351 fi # End of if -z ld_dynamic_link_flags
14352 fi # End of if test "$can_build_shared" = "yes"
14353
14354
14355
14356
14357
14358
14359
14360
14361   fi
14362
14363   if test "$can_build_shared" = "yes"; then
14364     { test "$extra_verbose" = "yes" && cat << \EOF
14365     Defining HAVE_SHLIB
14366 EOF
14367 cat >> confdefs.h <<\EOF
14368 #define HAVE_SHLIB 1
14369 EOF
14370 }
14371
14372     extra_objs="$extra_objs sysdll.o emodules.o" &&  if test "$extra_verbose" = "yes"; then
14373    echo "    xemacs will be linked with \"sysdll.o emodules.o\""
14374  fi
14375     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
14376     test -n "$libdl" && LIBS="-l${libdl} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${libdl}\" to \$LIBS"; fi
14377     for ac_func in dlerror _dlerror
14378 do
14379 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
14380 echo "configure:14381: checking for $ac_func" >&5
14381
14382 cat > conftest.$ac_ext <<EOF
14383 #line 14384 "configure"
14384 #include "confdefs.h"
14385 /* System header to define __stub macros and hopefully few prototypes,
14386     which can conflict with char $ac_func(); below.  */
14387 #include <assert.h>
14388 /* Override any gcc2 internal prototype to avoid an error.  */
14389 /* We use char because int might match the return type of a gcc2
14390     builtin and then its argument prototype would still apply.  */
14391 char $ac_func();
14392
14393 int main() {
14394
14395 /* The GNU C library defines this for functions which it implements
14396     to always fail with ENOSYS.  Some functions are actually named
14397     something starting with __ and the normal name is an alias.  */
14398 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14399 choke me
14400 #else
14401 $ac_func();
14402 #endif
14403
14404 ; return 0; }
14405 EOF
14406 if { (eval echo configure:14407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14407   rm -rf conftest*
14408   eval "ac_cv_func_$ac_func=yes"
14409 else
14410   echo "configure: failed program was:" >&5
14411   cat conftest.$ac_ext >&5
14412   rm -rf conftest*
14413   eval "ac_cv_func_$ac_func=no"
14414 fi
14415 rm -f conftest*
14416
14417 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
14418   echo "$ac_t""yes" 1>&6
14419     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
14420   { test "$extra_verbose" = "yes" && cat << EOF
14421     Defining $ac_tr_func
14422 EOF
14423 cat >> confdefs.h <<EOF
14424 #define $ac_tr_func 1
14425 EOF
14426 }
14427  
14428 else
14429   echo "$ac_t""no" 1>&6
14430 fi
14431 done
14432
14433     with_modules=yes
14434   else
14435     if test "$with_modules" = "yes"; then
14436       { echo "Error:" "Required module support cannot be provided." >&2; exit 1; }
14437     else
14438       echo "configure: warning: "Module support cannot be provided."" 1>&2
14439     fi
14440     with_modules=no
14441   fi
14442 fi
14443
14444 cat > conftest.$ac_ext <<EOF
14445 #line 14446 "configure"
14446 #include "confdefs.h"
14447 int main(int c,char *v[]){return 0;}
14448 EOF
14449 if { (eval echo configure:14450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
14450 then
14451   :
14452 else
14453   conftest_rc="$?"
14454   echo "configure: failed program was:" >&5
14455   cat conftest.$ac_ext >&5
14456   rm -fr conftest*
14457   
14458   echo ""
14459   echo "*** PANIC *** The C compiler can no longer build working executables."
14460   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
14461   echo "*** PANIC *** The most likely reason for this problem is that configure"
14462   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
14463   echo "*** PANIC *** found at run time."
14464   echo "*** PANIC ***"
14465   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
14466   echo "*** PANIC *** On other systems, try telling configure where to find the"
14467   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
14468   echo "*** PANIC ***"
14469   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
14470   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
14471   echo "*** PANIC *** on your system.  Don't do that."
14472   exit 1
14473 fi
14474 rm -fr conftest*
14475
14476 if test "$win32_processes" = "yes"; then
14477   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
14478    echo "    xemacs will be linked with \"process-nt.o\""
14479  fi
14480 else
14481   { test "$extra_verbose" = "yes" && cat << \EOF
14482     Defining HAVE_UNIX_PROCESSES
14483 EOF
14484 cat >> confdefs.h <<\EOF
14485 #define HAVE_UNIX_PROCESSES 1
14486 EOF
14487 }
14488
14489   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
14490    echo "    xemacs will be linked with \"process-unix.o\""
14491  fi
14492 fi
14493
14494
14495
14496 T=""
14497 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14498 CFLAGS="$T"
14499
14500
14501 T=""
14502 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14503 extra_objs="$T"
14504
14505
14506 T=""
14507 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
14508 c_switch_general="$T"
14509
14510
14511 T=""
14512 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14513 c_switch_window_system="$T"
14514
14515
14516 T=""
14517 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14518 c_switch_all="$T"
14519
14520
14521 T=""
14522 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
14523 ld_switch_general="$T"
14524
14525
14526 T=""
14527 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14528 ld_switch_window_system="$T"
14529
14530
14531 T=""
14532 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14533 ld_switch_all="$T"
14534
14535
14536 T=""
14537 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14538 ld_libs_general="$T"
14539
14540
14541 T=""
14542 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
14543 ld_libs_window_system="$T"
14544
14545
14546 T=""
14547 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14548 ld_libs_all="$T"
14549
14550
14551
14552 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
14553 internal_makefile_list="Makefile.in"
14554 SUBDIR_MAKEFILES=''
14555 test -d lock || mkdir lock
14556 for dir in $MAKE_SUBDIR; do
14557   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
14558         test -d "$d" || mkdir "$d"; cd "$d"
14559       done ) ;;
14560    * ) test -d "$dir" || mkdir "$dir" ;;
14561   esac
14562   
14563 T=""
14564 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14565 SUBDIR_MAKEFILES="$T"
14566
14567   
14568 T=""
14569 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14570 internal_makefile_list="$T"
14571
14572 done
14573
14574
14575
14576
14577 for dir in src/s src/m; do
14578   if test ! -d "$dir" ; then
14579     echo Making symbolic link to "$srcdir/$dir"
14580     ${LN_S} "$srcdir/$dir" "$dir"
14581   fi
14582 done
14583
14584 if test "$extra_verbose" = "yes"; then
14585   echo ""
14586   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
14587   echo ""
14588 fi
14589
14590
14591 if test -f "$srcdir/src/.gdbinit" -a ! -f "src/.gdbinit"; then
14592   test "$extra_verbose" = "yes" && echo "creating src/.gdbinit"
14593   echo "source $srcdir/src/.gdbinit" > "src/.gdbinit"
14594 fi
14595
14596 if test -f "$srcdir/src/.dbxrc" -a ! -f "src/.dbxrc"; then
14597   test "$extra_verbose" = "yes" && echo "creating src/.dbxrc"
14598   echo ". $srcdir/src/.dbxrc" > "src/.dbxrc"
14599 fi
14600
14601 if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then
14602   test "$extra_verbose" = "yes" && echo "creating TAGS"
14603   echo "\f
14604 $srcdir/TAGS,include" > "TAGS"
14605 fi
14606
14607 if test "$__SUNPRO_C" = "yes"; then
14608   test "$extra_verbose" = "yes" && echo "creating .sbinit"
14609   ( echo "# For use with Sun WorkShop's Source browser."
14610     echo "# See sbquery(1) and sbinit(4) for more information"
14611     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
14612   ) > .sbinit
14613 fi
14614
14615 rm -f core
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636 PREFIX=$prefix
14637 while true; do
14638   case "$PREFIX" in
14639     *\$* ) eval "PREFIX=$PREFIX" ;;
14640     *) break ;;
14641   esac
14642 done
14643
14644
14645
14646
14647 EXEC_PREFIX=$exec_prefix
14648 while true; do
14649   case "$EXEC_PREFIX" in
14650     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
14651     *) break ;;
14652   esac
14653 done
14654
14655
14656
14657
14658 INFODIR=$infodir
14659 while true; do
14660   case "$INFODIR" in
14661     *\$* ) eval "INFODIR=$INFODIR" ;;
14662     *) break ;;
14663   esac
14664 done
14665
14666
14667
14668
14669 INFOPATH=$infopath
14670 while true; do
14671   case "$INFOPATH" in
14672     *\$* ) eval "INFOPATH=$INFOPATH" ;;
14673     *) break ;;
14674   esac
14675 done
14676
14677
14678
14679
14680 PACKAGE_PATH=$package_path
14681 while true; do
14682   case "$PACKAGE_PATH" in
14683     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
14684     *) break ;;
14685   esac
14686 done
14687
14688
14689
14690
14691 LISPDIR=$lispdir
14692 while true; do
14693   case "$LISPDIR" in
14694     *\$* ) eval "LISPDIR=$LISPDIR" ;;
14695     *) break ;;
14696   esac
14697 done
14698
14699
14700
14701
14702 MODULEDIR=$moduledir
14703 while true; do
14704   case "$MODULEDIR" in
14705     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
14706     *) break ;;
14707   esac
14708 done
14709
14710
14711
14712
14713 SITELISPDIR=$sitelispdir
14714 while true; do
14715   case "$SITELISPDIR" in
14716     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
14717     *) break ;;
14718   esac
14719 done
14720
14721
14722
14723
14724 SITEMODULEDIR=$sitemoduledir
14725 while true; do
14726   case "$SITEMODULEDIR" in
14727     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
14728     *) break ;;
14729   esac
14730 done
14731
14732
14733
14734
14735 ETCDIR=$etcdir
14736 while true; do
14737   case "$ETCDIR" in
14738     *\$* ) eval "ETCDIR=$ETCDIR" ;;
14739     *) break ;;
14740   esac
14741 done
14742
14743
14744
14745
14746 DOCDIR=$docdir
14747 while true; do
14748   case "$DOCDIR" in
14749     *\$* ) eval "DOCDIR=$DOCDIR" ;;
14750     *) break ;;
14751   esac
14752 done
14753
14754
14755
14756
14757 ARCHLIBDIR=$archlibdir
14758 while true; do
14759   case "$ARCHLIBDIR" in
14760     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
14761     *) break ;;
14762   esac
14763 done
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
14785
14786
14787
14788
14789
14790
14791
14792 : ${XEMACS_CC:=$CC}
14793
14794
14795 if test "$with_prefix" = "yes"; then
14796   { test "$extra_verbose" = "yes" && cat << \EOF
14797     Defining PREFIX_USER_DEFINED
14798 EOF
14799 cat >> confdefs.h <<\EOF
14800 #define PREFIX_USER_DEFINED 1
14801 EOF
14802 }
14803
14804 fi
14805
14806 if test "$with_site_lisp" = "no"; then
14807   { test "$extra_verbose" = "yes" && cat << \EOF
14808     Defining INHIBIT_SITE_LISP
14809 EOF
14810 cat >> confdefs.h <<\EOF
14811 #define INHIBIT_SITE_LISP 1
14812 EOF
14813 }
14814
14815 fi
14816 if test "$with_site_modules" = "no"; then
14817   { test "$extra_verbose" = "yes" && cat << \EOF
14818     Defining INHIBIT_SITE_MODULES
14819 EOF
14820 cat >> confdefs.h <<\EOF
14821 #define INHIBIT_SITE_MODULES 1
14822 EOF
14823 }
14824
14825 fi
14826
14827
14828 T=""
14829 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14830 ac_configure_args="$T"
14831
14832 { test "$extra_verbose" = "yes" && cat << EOF
14833     Defining EMACS_CONFIGURATION = "$configuration"
14834 EOF
14835 cat >> confdefs.h <<EOF
14836 #define EMACS_CONFIGURATION "$configuration"
14837 EOF
14838 }
14839
14840 { test "$extra_verbose" = "yes" && cat << EOF
14841     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
14842 EOF
14843 cat >> confdefs.h <<EOF
14844 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
14845 EOF
14846 }
14847
14848
14849
14850 null_string=""
14851 { test "$extra_verbose" = "yes" && cat << EOF
14852     Defining LD_SWITCH_X_SITE = $null_string
14853 EOF
14854 cat >> confdefs.h <<EOF
14855 #define LD_SWITCH_X_SITE $null_string
14856 EOF
14857 }
14858
14859 { test "$extra_verbose" = "yes" && cat << EOF
14860     Defining LD_SWITCH_X_SITE_AUX = $null_string
14861 EOF
14862 cat >> confdefs.h <<EOF
14863 #define LD_SWITCH_X_SITE_AUX $null_string
14864 EOF
14865 }
14866
14867 { test "$extra_verbose" = "yes" && cat << EOF
14868     Defining C_SWITCH_X_SITE = $null_string
14869 EOF
14870 cat >> confdefs.h <<EOF
14871 #define C_SWITCH_X_SITE $null_string
14872 EOF
14873 }
14874
14875 { test "$extra_verbose" = "yes" && cat << EOF
14876     Defining LD_SWITCH_SITE = $null_string
14877 EOF
14878 cat >> confdefs.h <<EOF
14879 #define LD_SWITCH_SITE $null_string
14880 EOF
14881 }
14882
14883 { test "$extra_verbose" = "yes" && cat << EOF
14884     Defining C_SWITCH_SITE = $null_string
14885 EOF
14886 cat >> confdefs.h <<EOF
14887 #define C_SWITCH_SITE $null_string
14888 EOF
14889 }
14890
14891
14892
14893 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14894     Defining GNU_MALLOC
14895 EOF
14896 cat >> confdefs.h <<\EOF
14897 #define GNU_MALLOC 1
14898 EOF
14899 }
14900
14901 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14902     Defining USE_SYSTEM_MALLOC
14903 EOF
14904 cat >> confdefs.h <<\EOF
14905 #define USE_SYSTEM_MALLOC 1
14906 EOF
14907 }
14908
14909 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14910     Defining USE_DEBUG_MALLOC
14911 EOF
14912 cat >> confdefs.h <<\EOF
14913 #define USE_DEBUG_MALLOC 1
14914 EOF
14915 }
14916
14917                                               { test "$extra_verbose" = "yes" && cat << \EOF
14918     Defining USE_SYSTEM_MALLOC
14919 EOF
14920 cat >> confdefs.h <<\EOF
14921 #define USE_SYSTEM_MALLOC 1
14922 EOF
14923 }
14924
14925 fi
14926 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14927     Defining I18N3
14928 EOF
14929 cat >> confdefs.h <<\EOF
14930 #define I18N3 1
14931 EOF
14932 }
14933
14934 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14935     Defining USE_GCC
14936 EOF
14937 cat >> confdefs.h <<\EOF
14938 #define USE_GCC 1
14939 EOF
14940 }
14941
14942 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14943     Defining EXTERNAL_WIDGET
14944 EOF
14945 cat >> confdefs.h <<\EOF
14946 #define EXTERNAL_WIDGET 1
14947 EOF
14948 }
14949
14950 test "$quick_build"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14951     Defining QUICK_BUILD
14952 EOF
14953 cat >> confdefs.h <<\EOF
14954 #define QUICK_BUILD 1
14955 EOF
14956 }
14957
14958 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14959     Defining PURIFY
14960 EOF
14961 cat >> confdefs.h <<\EOF
14962 #define PURIFY 1
14963 EOF
14964 }
14965
14966 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14967     Defining QUANTIFY
14968 EOF
14969 cat >> confdefs.h <<\EOF
14970 #define QUANTIFY 1
14971 EOF
14972 }
14973
14974 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14975     Defining MAIL_USE_POP
14976 EOF
14977 cat >> confdefs.h <<\EOF
14978 #define MAIL_USE_POP 1
14979 EOF
14980 }
14981
14982 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14983     Defining KERBEROS
14984 EOF
14985 cat >> confdefs.h <<\EOF
14986 #define KERBEROS 1
14987 EOF
14988 }
14989
14990 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14991     Defining HESIOD
14992 EOF
14993 cat >> confdefs.h <<\EOF
14994 #define HESIOD 1
14995 EOF
14996 }
14997
14998 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14999     Defining USE_UNION_TYPE
15000 EOF
15001 cat >> confdefs.h <<\EOF
15002 #define USE_UNION_TYPE 1
15003 EOF
15004 }
15005
15006 test "$pdump"              = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
15007     Defining PDUMP
15008 EOF
15009 cat >> confdefs.h <<\EOF
15010 #define PDUMP 1
15011 EOF
15012 }
15013
15014
15015
15016 (
15017 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
15018 else
15019   echo "uname -a: `uname -a`"
15020 fi
15021 echo ""
15022 echo "$0 $quoted_arguments"
15023 ) > Installation
15024
15025 if test ! -z ${emacs_beta_version} ; then
15026   if test -z "${emacs_is_beta}" ; then
15027         xemacs_betaname=".${emacs_beta_version}"
15028   else
15029         xemacs_betaname="-b${emacs_beta_version}"
15030   fi
15031 else
15032   xemacs_betaname=""
15033 fi
15034
15035 (
15036 echo "
15037
15038 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
15039 "
15040 echo "
15041 Compilation / Installation:"
15042 echo "  Source code location:              $srcdir"
15043 echo "  Installation prefix:               $prefix"
15044 if test -n "$site_includes"; then
15045   echo "  Additional header files:           $site_includes"
15046 fi
15047 if test -n "$site_libraries"; then
15048   echo "  Additional libraries:              $site_libraries"
15049 fi
15050 if test -n "$site_prefixes"; then
15051   echo "  Additional prefixes:               $site_prefixes"
15052 fi
15053 if test -n "$runpath"; then
15054   echo "  Runtime library search path:       $runpath"
15055 fi
15056
15057 if test -n "$opsysfile"
15058 then echo "  Operating system description file: \`$opsysfile'"
15059 else echo "  Not using any operating system description file"
15060 fi
15061 if test -n "$machfile"
15062 then echo "  Machine description file:          \`$machfile'"
15063 else echo "  Not using any machine description file"
15064 fi
15065
15066 echo "  Compiler:                          $CC $CFLAGS"
15067 echo "  Relocating allocator for buffers:  $rel_alloc"
15068 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
15069
15070 echo "
15071 Window System:"
15072 if test "$with_msw" = "yes"; then
15073   echo "  Compiling in support for the Microsoft window system."
15074 fi
15075 if test "$with_x11" = "yes"; then
15076   echo "  Compiling in support for the X window system:"
15077   echo "    - X Windows headers location:                 $x_includes"
15078   echo "    - X Windows libraries location:               $x_libraries"
15079   if test "$with_xauth" != yes; then
15080     echo "    - Xau (X authority) not available."
15081   fi
15082   if test "$with_xmu" != yes; then
15083     echo "    - Xmu library not available; substituting equivalent routines."
15084   fi
15085   if test "$with_wmcommand" != no; then
15086     echo "    - Handling WM_COMMAND properly."
15087   fi
15088 fi
15089 if test "$need_athena" = "yes"; then
15090   echo "  Compiling in support for the Athena widget set:"
15091   echo "    - Athena headers location:                    $athena_h_path"
15092   echo "    - Athena library to link:                     $athena_lib"
15093 fi
15094 case "$with_menubars" in
15095   lucid ) echo "  Using Lucid menubars." ;;
15096   motif ) echo "  Using Motif menubars."
15097           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
15098           echo "             We recommend using the Lucid menubar instead."
15099           echo "             Re-run configure with --with-menubars='lucid'." ;;
15100     msw ) echo "  Using MS-Windows menubars." ;;
15101 esac
15102 case "$with_scrollbars" in
15103   lucid  ) echo "  Using Lucid scrollbars."      ;;
15104   motif  ) echo "  Using Motif scrollbars."      ;;
15105   athena ) echo "  Using Athena scrollbars."     ;;
15106      msw ) echo "  Using MS-Windows scrollbars." ;;
15107 esac
15108 case "$with_dialogs" in
15109   motif  ) echo "  Using Motif dialog boxes."
15110            if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
15111              echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
15112              echo "             We recommend using the Athena dialog boxes instead."
15113              echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
15114              echo "             Read the PROBLEMS file for more information."
15115            fi; fi ;;
15116   athena ) echo "  Using Athena dialog boxes."     ;;
15117      msw ) echo "  Using MS-Windows dialog boxes." ;;
15118 esac
15119 case "$with_widgets" in
15120   motif  ) echo "  Using Motif native widgets."      ;;
15121   athena ) echo "  Using Athena native widgets."     ;;
15122      msw ) echo "  Using MS-Windows native widgets." ;;
15123 esac
15124 if test "$with_dragndrop" = yes; then
15125   echo "  Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
15126   echo "    -  Drag'n'Drop prototype:                             $dragndrop_proto."
15127 fi
15128
15129 echo "
15130 TTY:"
15131 test "$with_ncurses" = yes && echo "  Compiling in support for ncurses."
15132 test "$with_gpm" = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
15133
15134 echo "
15135 Images:"
15136 test "$with_gif" = yes && echo "  Compiling in support for GIF  images (builtin)."
15137 if test "$with_xpm" = yes; then
15138   echo "  Compiling in support for XPM  images."
15139 elif test "$with_x11" = yes; then
15140   echo "  WARNING: -----------------------------------------------------------"
15141   echo "  WARNING: Compiling without XPM image support."
15142   if test "$xpm_problem" != ""; then
15143     echo "  Reason: $xpm_problem"
15144   fi
15145   echo "  WARNING: You should strongly consider installing XPM."
15146   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
15147   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
15148   echo "  WARNING: -----------------------------------------------------------"
15149 fi
15150 if test "$with_png" = yes; then
15151   echo "  Compiling in support for PNG  images."
15152 elif test "$window_system" != "none"; then
15153   echo "  WARNING: -----------------------------------------------------------"
15154   echo "  WARNING: Compiling without PNG image support."
15155   if test "$png_problem" != ""; then
15156     echo "  Reason: $png_problem"
15157   fi
15158   echo "  WARNING: You should strongly consider installing the PNG libraries."
15159   echo "  WARNING: Otherwise certain images and glyphs may not display."
15160   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
15161   echo "  WARNING: -----------------------------------------------------------"
15162 fi
15163 test "$with_jpeg" = yes && echo "  Compiling in support for JPEG images."
15164 test "$with_tiff" = yes && echo "  Compiling in support for TIFF images."
15165 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
15166
15167 echo "
15168 Sound:"
15169 test "$with_native_sound" = yes && echo "  Compiling in support for sound (native)."
15170 test "$with_nas_sound" = yes && echo "  Compiling in support for NAS (network audio system)."
15171 test "$old_nas" = yes && echo "    - NAS library lacks error trapping; will play synchronously."
15172 test "$with_esd_sound" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
15173
15174 echo "
15175 Databases:"
15176 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
15177 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
15178 test "$with_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
15179 test "$with_ldap" = yes && echo "  Compiling in support for LDAP."
15180 if test "$with_postgresql" = yes; then
15181   echo "  Compiling in support for PostgreSQL."
15182   echo "    - Using PostgreSQL header file:  $libpq_fe_h_file"
15183   test "$with_postgresqlv7" = yes && echo "    - Using PostgreSQL V7 bindings."
15184 fi
15185
15186 echo "
15187 Internationalization:"
15188 test "$with_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
15189 test "$with_utf_2000" = yes && echo "  Using UTF-2000 (UTF-8) buffer/string representation."
15190 test "$with_text_coding" = yes && echo "  Compiling in support for text coding."
15191 test "$with_file_coding" = yes && echo "  Compiling in support for file coding."
15192 test "$with_xim" != no && echo "  Compiling in support for XIM (X11R5+ I18N input method)."
15193 test "$with_xim" = motif && echo "    - Using Motif to provide XIM support."
15194 test "$with_xim" = xlib && echo "    - Using raw Xlib to provide XIM support."
15195 test "$with_xfs" = yes && echo "    - Using XFontSet to provide bilingual menubar."
15196 test "$with_canna" = yes && echo "  Compiling in support for Canna on Mule."
15197 if test "$with_wnn" = yes; then
15198   echo "  Compiling in support for the WNN input method on Mule."
15199   test "$with_wnn6" = yes && echo "    - Using WNN version 6."
15200 fi
15201 test "$with_i18n3" = yes && echo "  Compiling in support for I18N level 3 (doesn't currently work)."
15202
15203 echo "
15204 Mail:"
15205 test "$with_pop" = yes && echo "  Compiling in support for POP mail retrieval."
15206 test "$with_kerberos" = yes && echo "  Compiling in support for Kerberos POP authentication."
15207 test "$with_hesiod" = yes && echo "  Compiling in support for Hesiod POP server access."
15208 test -n "$mail_locking" && echo "  Compiling in support for \"$mail_locking\" mail spool file locking method."
15209
15210 echo "
15211 Other Features:"
15212 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
15213 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
15214 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
15215 test "$with_dnet" = yes && echo "  Compiling in support for DNET."
15216 test "$with_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
15217 test "$use_union_type" = yes && echo "  Using the union type for Lisp_Objects."
15218 test "$pdump" = yes && echo "  Using the new portable dumper."
15219 test "$debug" = yes && echo "  Compiling in support for extra debugging code."
15220 test "$usage_tracking" = yes && echo "  Compiling in support for active usage tracking (Sun internal)."
15221 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc $error_check_glyphs" \
15222   != "no no no no no no"; then
15223   echo "  WARNING: ---------------------------------------------------------"
15224   echo "  WARNING: Compiling in support for runtime error checking."
15225   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
15226   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
15227   echo "  WARNING: ---------------------------------------------------------"
15228 fi
15229 echo ""
15230 ) | tee -a Installation
15231 echo ""
15232
15233
15234 # Remove any trailing slashes in these variables.
15235 test -n "$prefix" &&
15236   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
15237 test -n "$exec_prefix" &&
15238   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
15239
15240
15241 for file in $internal_makefile_list; do
15242   test "$file" = src/Makefile.in && \
15243     file="src/Makefile.in:src/Makefile.in.in:src/depend"
15244   ac_output_files="$ac_output_files $file" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$file\" to \$ac_output_files"; fi
15245 done
15246 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
15247 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
15248
15249 trap '' 1 2 15
15250
15251 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
15252
15253 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15254 # Let make expand exec_prefix.
15255 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15256
15257 # Any assignment to VPATH causes Sun make to only execute
15258 # the first set of double-colon rules, so remove it if not needed.
15259 # If there is a colon in the path, we need to keep it.
15260 if test "x$srcdir" = x.; then
15261   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
15262 fi
15263
15264 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
15265
15266 DEFS=-DHAVE_CONFIG_H
15267
15268 # Without the "./", some shells look in PATH for config.status.
15269 : ${CONFIG_STATUS=./config.status}
15270
15271 echo creating $CONFIG_STATUS
15272 rm -f $CONFIG_STATUS
15273 cat > $CONFIG_STATUS <<EOF
15274 #! /bin/sh
15275 # Generated automatically by configure.
15276 # Run this file to recreate the current configuration.
15277 # This directory was configured as follows,
15278 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
15279 #
15280 # $0 $ac_configure_args
15281 #
15282 # Compiler output produced by configure, useful for debugging
15283 # configure, is in ./config.log if it exists.
15284
15285 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
15286 for ac_option
15287 do
15288   case "\$ac_option" in
15289   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15290     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
15291     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
15292   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
15293     echo "$CONFIG_STATUS generated by autoconf version 2.13"
15294     exit 0 ;;
15295   -help | --help | --hel | --he | --h)
15296     echo "\$ac_cs_usage"; exit 0 ;;
15297   *) echo "\$ac_cs_usage"; exit 1 ;;
15298   esac
15299 done
15300
15301 ac_given_srcdir=$srcdir
15302 ac_given_INSTALL="$INSTALL"
15303
15304 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
15305 EOF
15306 cat >> $CONFIG_STATUS <<EOF
15307
15308 # Protect against being on the right side of a sed subst in config.status.
15309 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
15310  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
15311 $ac_vpsub
15312 $extrasub
15313 s%@SHELL@%$SHELL%g
15314 s%@CFLAGS@%$CFLAGS%g
15315 s%@CPPFLAGS@%$CPPFLAGS%g
15316 s%@CXXFLAGS@%$CXXFLAGS%g
15317 s%@FFLAGS@%$FFLAGS%g
15318 s%@DEFS@%$DEFS%g
15319 s%@LDFLAGS@%$LDFLAGS%g
15320 s%@LIBS@%$LIBS%g
15321 s%@exec_prefix@%$exec_prefix%g
15322 s%@prefix@%$prefix%g
15323 s%@program_transform_name@%$program_transform_name%g
15324 s%@bindir@%$bindir%g
15325 s%@sbindir@%$sbindir%g
15326 s%@libexecdir@%$libexecdir%g
15327 s%@datadir@%$datadir%g
15328 s%@sysconfdir@%$sysconfdir%g
15329 s%@sharedstatedir@%$sharedstatedir%g
15330 s%@localstatedir@%$localstatedir%g
15331 s%@libdir@%$libdir%g
15332 s%@includedir@%$includedir%g
15333 s%@oldincludedir@%$oldincludedir%g
15334 s%@infodir@%$infodir%g
15335 s%@mandir@%$mandir%g
15336 s%@LN_S@%$LN_S%g
15337 s%@blddir@%$blddir%g
15338 s%@CC@%$CC%g
15339 s%@CPP@%$CPP%g
15340 s%@start_flags@%$start_flags%g
15341 s%@ld_switch_shared@%$ld_switch_shared%g
15342 s%@start_files@%$start_files%g
15343 s%@ld@%$ld%g
15344 s%@lib_gcc@%$lib_gcc%g
15345 s%@RANLIB@%$RANLIB%g
15346 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
15347 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
15348 s%@INSTALL_DATA@%$INSTALL_DATA%g
15349 s%@YACC@%$YACC%g
15350 s%@SET_MAKE@%$SET_MAKE%g
15351 s%@X_CFLAGS@%$X_CFLAGS%g
15352 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
15353 s%@X_LIBS@%$X_LIBS%g
15354 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
15355 s%@install_pp@%$install_pp%g
15356 s%@libs_xauth@%$libs_xauth%g
15357 s%@dnd_objs@%$dnd_objs%g
15358 s%@lwlib_objs@%$lwlib_objs%g
15359 s%@ALLOCA@%$ALLOCA%g
15360 s%@have_esd_config@%$have_esd_config%g
15361 s%@dll_ld@%$dll_ld%g
15362 s%@dll_cflags@%$dll_cflags%g
15363 s%@dll_ldflags@%$dll_ldflags%g
15364 s%@dll_post@%$dll_post%g
15365 s%@dll_ldo@%$dll_ldo%g
15366 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
15367 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
15368 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
15369 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
15370 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
15371 s%@PROGNAME@%$PROGNAME%g
15372 s%@version@%$version%g
15373 s%@configuration@%$configuration%g
15374 s%@canonical@%$canonical%g
15375 s%@inststaticdir@%$inststaticdir%g
15376 s%@instvardir@%$instvardir%g
15377 s%@srcdir@%$srcdir%g
15378 s%@pkgdir@%$pkgdir%g
15379 s%@statedir@%$statedir%g
15380 s%@extra_includes@%$extra_includes%g
15381 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
15382 s%@PREFIX@%$PREFIX%g
15383 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
15384 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
15385 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
15386 s%@INFODIR@%$INFODIR%g
15387 s%@infopath@%$infopath%g
15388 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
15389 s%@INFOPATH@%$INFOPATH%g
15390 s%@package_path@%$package_path%g
15391 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
15392 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
15393 s%@lispdir@%$lispdir%g
15394 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
15395 s%@LISPDIR@%$LISPDIR%g
15396 s%@moduledir@%$moduledir%g
15397 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
15398 s%@MODULEDIR@%$MODULEDIR%g
15399 s%@sitelispdir@%$sitelispdir%g
15400 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
15401 s%@SITELISPDIR@%$SITELISPDIR%g
15402 s%@sitemoduledir@%$sitemoduledir%g
15403 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
15404 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
15405 s%@etcdir@%$etcdir%g
15406 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
15407 s%@ETCDIR@%$ETCDIR%g
15408 s%@docdir@%$docdir%g
15409 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
15410 s%@DOCDIR@%$DOCDIR%g
15411 s%@archlibdir@%$archlibdir%g
15412 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
15413 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
15414 s%@bitmapdir@%$bitmapdir%g
15415 s%@extra_objs@%$extra_objs%g
15416 s%@machfile@%$machfile%g
15417 s%@opsysfile@%$opsysfile%g
15418 s%@c_switch_general@%$c_switch_general%g
15419 s%@c_switch_window_system@%$c_switch_window_system%g
15420 s%@c_switch_all@%$c_switch_all%g
15421 s%@ld_switch_general@%$ld_switch_general%g
15422 s%@ld_switch_window_system@%$ld_switch_window_system%g
15423 s%@ld_switch_all@%$ld_switch_all%g
15424 s%@ld_libs_general@%$ld_libs_general%g
15425 s%@ld_libs_window_system@%$ld_libs_window_system%g
15426 s%@ld_libs_all@%$ld_libs_all%g
15427 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
15428 s%@native_sound_lib@%$native_sound_lib%g
15429 s%@sound_cflags@%$sound_cflags%g
15430 s%@dynodump_arch@%$dynodump_arch%g
15431 s%@XEMACS_CC@%$XEMACS_CC%g
15432 s%@internal_makefile_list@%$internal_makefile_list%g
15433
15434 CEOF
15435 EOF
15436
15437 cat >> $CONFIG_STATUS <<\EOF
15438
15439 # Split the substitutions into bite-sized pieces for seds with
15440 # small command number limits, like on Digital OSF/1 and HP-UX.
15441 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
15442 ac_file=1 # Number of current file.
15443 ac_beg=1 # First line for current file.
15444 ac_end=$ac_max_sed_cmds # Line after last line for current file.
15445 ac_more_lines=:
15446 ac_sed_cmds=""
15447 while $ac_more_lines; do
15448   if test $ac_beg -gt 1; then
15449     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
15450   else
15451     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
15452   fi
15453   if test ! -s conftest.s$ac_file; then
15454     ac_more_lines=false
15455     rm -f conftest.s$ac_file
15456   else
15457     if test -z "$ac_sed_cmds"; then
15458       ac_sed_cmds="sed -f conftest.s$ac_file"
15459     else
15460       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
15461     fi
15462     ac_file=`expr $ac_file + 1`
15463     ac_beg=$ac_end
15464     ac_end=`expr $ac_end + $ac_max_sed_cmds`
15465   fi
15466 done
15467 if test -z "$ac_sed_cmds"; then
15468   ac_sed_cmds=cat
15469 fi
15470 EOF
15471
15472 cat >> $CONFIG_STATUS <<EOF
15473
15474 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
15475 EOF
15476 cat >> $CONFIG_STATUS <<\EOF
15477 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
15478   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15479   case "$ac_file" in
15480   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
15481        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
15482   *) ac_file_in="${ac_file}.in" ;;
15483   esac
15484
15485   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
15486
15487   # Remove last slash and all that follows it.  Not all systems have dirname.
15488   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15489   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15490     # The file is in a subdirectory.
15491     test ! -d "$ac_dir" && mkdir "$ac_dir"
15492     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
15493     # A "../" for each directory in $ac_dir_suffix.
15494     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
15495   else
15496     ac_dir_suffix= ac_dots=
15497   fi
15498
15499   case "$ac_given_srcdir" in
15500   .)  srcdir=.
15501       if test -z "$ac_dots"; then top_srcdir=.
15502       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
15503   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
15504   *) # Relative path.
15505     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
15506     top_srcdir="$ac_dots$ac_given_srcdir" ;;
15507   esac
15508
15509   case "$ac_given_INSTALL" in
15510   [/$]*) INSTALL="$ac_given_INSTALL" ;;
15511   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
15512   esac
15513
15514   echo creating "$ac_file"
15515   rm -f "$ac_file"
15516   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
15517   case "$ac_file" in
15518   *Makefile*) ac_comsub="1i\\
15519 # $configure_input" ;;
15520   *) ac_comsub= ;;
15521   esac
15522
15523   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
15524   sed -e "$ac_comsub
15525 s%@configure_input@%$configure_input%g
15526 s%@srcdir@%$srcdir%g
15527 s%@top_srcdir@%$top_srcdir%g
15528 s%@INSTALL@%$INSTALL%g
15529 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
15530 fi; done
15531 rm -f conftest.s*
15532
15533 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15534 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15535 #
15536 # ac_d sets the value in "#define NAME VALUE" lines.
15537 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15538 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
15539 ac_dC='\3'
15540 ac_dD='%g'
15541 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15542 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15543 ac_uB='\([      ]\)%\1#\2define\3'
15544 ac_uC=' '
15545 ac_uD='\4%g'
15546 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15547 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15548 ac_eB='$%\1#\2define\3'
15549 ac_eC=' '
15550 ac_eD='%g'
15551
15552 if test "${CONFIG_HEADERS+set}" != set; then
15553 EOF
15554 cat >> $CONFIG_STATUS <<EOF
15555   CONFIG_HEADERS="src/config.h lwlib/config.h"
15556 EOF
15557 cat >> $CONFIG_STATUS <<\EOF
15558 fi
15559 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
15560   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15561   case "$ac_file" in
15562   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
15563        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
15564   *) ac_file_in="${ac_file}.in" ;;
15565   esac
15566
15567   echo creating $ac_file
15568
15569   rm -f conftest.frag conftest.in conftest.out
15570   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
15571   cat $ac_file_inputs > conftest.in
15572
15573 EOF
15574
15575 # Transform confdefs.h into a sed script conftest.vals that substitutes
15576 # the proper values into config.h.in to produce config.h.  And first:
15577 # Protect against being on the right side of a sed subst in config.status.
15578 # Protect against being in an unquoted here document in config.status.
15579 rm -f conftest.vals
15580 cat > conftest.hdr <<\EOF
15581 s/[\\&%]/\\&/g
15582 s%[\\$`]%\\&%g
15583 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
15584 s%ac_d%ac_u%gp
15585 s%ac_u%ac_e%gp
15586 EOF
15587 sed -n -f conftest.hdr confdefs.h > conftest.vals
15588 rm -f conftest.hdr
15589
15590 # This sed command replaces #undef with comments.  This is necessary, for
15591 # example, in the case of _POSIX_SOURCE, which is predefined and required
15592 # on some systems where configure will not decide to define it.
15593 cat >> conftest.vals <<\EOF
15594 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
15595 EOF
15596
15597 # Break up conftest.vals because some shells have a limit on
15598 # the size of here documents, and old seds have small limits too.
15599
15600 rm -f conftest.tail
15601 while :
15602 do
15603   ac_lines=`grep -c . conftest.vals`
15604   # grep -c gives empty output for an empty file on some AIX systems.
15605   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
15606   # Write a limited-size here document to conftest.frag.
15607   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
15608   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
15609   echo 'CEOF
15610   sed -f conftest.frag conftest.in > conftest.out
15611   rm -f conftest.in
15612   mv conftest.out conftest.in
15613 ' >> $CONFIG_STATUS
15614   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15615   rm -f conftest.vals
15616   mv conftest.tail conftest.vals
15617 done
15618 rm -f conftest.vals
15619
15620 cat >> $CONFIG_STATUS <<\EOF
15621   rm -f conftest.frag conftest.h
15622   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15623   cat conftest.in >> conftest.h
15624   rm -f conftest.in
15625   if cmp -s $ac_file conftest.h 2>/dev/null; then
15626     echo "$ac_file is unchanged"
15627     rm -f conftest.h
15628   else
15629     # Remove last slash and all that follows it.  Not all systems have dirname.
15630       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15631       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15632       # The file is in a subdirectory.
15633       test ! -d "$ac_dir" && mkdir "$ac_dir"
15634     fi
15635     rm -f $ac_file
15636     mv conftest.h $ac_file
15637   fi
15638 fi; done
15639
15640 EOF
15641 cat >> $CONFIG_STATUS <<EOF
15642 CPP="$CPP"
15643  top_srcdir="$srcdir"
15644  MAKE_SUBDIR="$MAKE_SUBDIR"
15645
15646 EOF
15647 cat >> $CONFIG_STATUS <<\EOF
15648 for dir in . $MAKE_SUBDIR; do
15649   (
15650     cd $dir
15651     rm -f junk.c
15652     < Makefile.in \
15653       sed -e '/^# Generated/d' \
15654           -e 's%/\*\*/#.*%%' \
15655           -e 's/^ *# */#/' \
15656           -e '/^##/d' \
15657           -e '/^#/ {
15658 p
15659 d
15660 }'        \
15661           -e '/./ {
15662 s/\([\"]\)/\\\1/g
15663 s/^/"/
15664 s/$/"/
15665 }'  > junk.c;
15666
15667
15668
15669     echo creating $dir/Makefile
15670 $CPP -I. -I${top_srcdir}/src  junk.c \
15671   | sed -e 's/^\#.*//'          \
15672         -e 's/^[        ][      ]*$//'\
15673         -e 's/^ /       /'              \
15674         -e '/^[ \f]*$/d' \
15675         -e '/^\"/ {
15676         s/\\\([\"]\)/\1/g
15677         s/^[    ]*\"//
15678         s/\"[   ]*$//
15679 }' > Makefile.new
15680     chmod 444 Makefile.new
15681     mv -f Makefile.new Makefile
15682
15683     echo creating $dir/GNUmakefile
15684 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
15685   | sed -e 's/^\#.*//'          \
15686         -e 's/^[        ][      ]*$//'\
15687         -e 's/^ /       /'              \
15688         -e '/^[ \f]*$/d' \
15689         -e '/^\"/ {
15690         s/\\\([\"]\)/\1/g
15691         s/^[    ]*\"//
15692         s/\"[   ]*$//
15693 }' > Makefile.new
15694     chmod 444 Makefile.new
15695     mv -f Makefile.new GNUmakefile
15696
15697     rm -f junk.c
15698   )
15699 done
15700
15701 sed < config.status >> lib-src/config.values \
15702   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
15703   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
15704   -e 's/^\([^ ]*\) $/\1 ""/' \
15705   -e 's/ 1$/ t/'
15706
15707
15708 exit 0
15709 EOF
15710 chmod +x $CONFIG_STATUS
15711 rm -fr confdefs* $ac_clean_files
15712 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1