update.
[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 bindir='${exec_prefix}/bin'
81 sbindir='${exec_prefix}/sbin'
82 libexecdir='${exec_prefix}/libexec'
83 datadir='${prefix}/share'
84 sysconfdir='${prefix}/etc'
85 sharedstatedir='${prefix}/com'
86 localstatedir='${prefix}/var'
87 libdir='${{exec_prefix}}/lib'
88 includedir='${prefix}/include'
89 oldincludedir='/usr/include'
90 infodir='${prefix}/info'
91 mandir='${prefix}/man'
92
93 subdirs=
94 MFLAGS= MAKEFLAGS=
95 SHELL=${CONFIG_SHELL-/bin/sh}
96 ac_max_here_lines=12
97
98 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
99
100 # File descriptor usage:
101 # 0 standard input
102 # 1 file creation
103 # 2 errors and warnings
104 # 3 some systems may open it to /dev/tty
105 # 4 used on the Kubota Titan
106 # 6 checking for... messages and results
107 # 5 compiler messages saved in config.log
108 if test "$silent" = yes; then
109   exec 6>/dev/null
110 else
111   exec 6>&1
112 fi
113 exec 5>./config.log
114
115 echo "\
116 This file contains any messages produced by compilers while
117 running configure, to aid debugging if configure makes a mistake.
118 " 1>&5
119
120 # Strip out --no-create and --no-recursion so they do not pile up.
121 # Also quote any args containing shell metacharacters.
122 ac_configure_args=
123 for ac_arg
124 do
125   case "$ac_arg" in
126   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
127   | --no-cr | --no-c) ;;
128   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
129   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
130   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
131   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
132   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
133   esac
134 done
135
136 # NLS nuisances.
137 # Only set these to C if already set.  These must not be set unconditionally
138 # because not all systems understand e.g. LANG=C (notably SCO).
139 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
140 # Non-C LC_CTYPE values break the ctype check.
141 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
142 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
143 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
144 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
145
146 # confdefs.h avoids OS command line length limits that DEFS can exceed.
147 rm -rf conftest* confdefs.h
148 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
149 echo > confdefs.h
150
151 # A filename unique to this package, relative to the directory that
152 # configure is in, which we can look for to find out if srcdir is correct.
153 ac_unique_file=src/lisp.h
154
155 # Find the source files, if location was not specified.
156 if test -z "$srcdir"; then
157   ac_srcdir_defaulted=yes
158   # Try the directory containing this script, then its parent.
159   ac_prog=$0
160   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
161   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
162   srcdir=$ac_confdir
163   if test ! -r $srcdir/$ac_unique_file; then
164     srcdir=..
165   fi
166 else
167   ac_srcdir_defaulted=no
168 fi
169 if test ! -r $srcdir/$ac_unique_file; then
170   if test "$ac_srcdir_defaulted" = yes; then
171     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
172   else
173     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
174   fi
175 fi
176 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
177
178 # Prefer explicitly selected file to automatically selected ones.
179 if test -z "$CONFIG_SITE"; then
180   if test "x$prefix" != xNONE; then
181     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
182   else
183     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
184   fi
185 fi
186 for ac_site_file in $CONFIG_SITE; do
187   if test -r "$ac_site_file"; then
188     echo "loading site script $ac_site_file"
189     . "$ac_site_file"
190   fi
191 done
192
193
194 ac_ext=c
195 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
196 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
197 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
198 ac_cpp='$CPP '"$xe_cppflags"
199 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
200 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
201 cross_compiling=no
202
203 ac_exeext=
204 ac_objext=o
205 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
206   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
207   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
208     ac_n= ac_c='
209 ' ac_t='        '
210   else
211     ac_n=-n ac_c= ac_t=
212   fi
213 else
214   ac_n= ac_c='\c' ac_t=
215 fi
216
217
218 progname="`echo $0 | sed 's:^\./\./:\./:'`"
219
220
221 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
222 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
223
224 prefix='/usr/local'
225 exec_prefix='${prefix}'
226 bindir='${exec_prefix}/bin'
227 datadir='${prefix}/lib'
228 statedir='${prefix}/lib'
229 libdir='${exec_prefix}/lib'
230 mandir='${prefix}/man/man1'
231 inststaticdir='${PROGNAME}'
232 instvardir='${PROGNAME}-${version}'
233 infodir='${datadir}/${instvardir}/info'
234 infopath=''
235 install_pp=''
236 lispdir='${datadir}/${instvardir}/lisp'
237 moduledir='${datadir}/${instvardir}/${configuration}/modules'
238 sitelispdir='${datadir}/${inststaticdir}/site-lisp'
239 sitemoduledir='${datadir}/${inststaticdir}/site-modules'
240 pkgdir='${datadir}/${instvardir}/lisp'
241 package_path=''
242 etcdir='${datadir}/${instvardir}/etc'
243 archlibdir='${datadir}/${instvardir}/${configuration}'
244 docdir='${archlibdir}'
245 with_prefix='yes'
246 with_site_lisp='no'
247 with_site_modules='yes'
248 with_menubars=''
249 with_scrollbars=''
250 with_widgets=''
251 with_dialogs=''
252 with_file_coding=''
253 cpp='' cppflags='' libs='' ldflags=''
254 dynamic=''
255 with_x11=''
256 with_msw=''
257 rel_alloc='default'
258 with_system_malloc='default'
259 with_dlmalloc='default'
260 native_sound_lib=''
261 use_assertions="yes"
262 with_toolbars=""
263 with_tty=""
264 use_union_type="no"
265 with_dnet=""
266 pdump="no"
267 with_dragndrop="no"
268
269
270
271
272 arguments="$@"
273
274 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
275 quoted_arguments=
276 for i in "$@"; do
277    case "$i" in
278    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
279    | --no-cr | --no-c) ;;
280    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
281    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
282    *)
283    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
284    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
285    esac
286 done
287
288 while test $# != 0; do
289   arg="$1"; shift
290   case "$arg" in
291     --no-create|--no-recursion) ;;
292         -* )
293             case "$arg" in
294         -*=*)
295           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
296           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
297           valomitted=no
298         ;;
299                                                                           -*)
300                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
301           val="yes" valomitted=yes
302         ;;
303       esac
304
305             optname="$opt"
306       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
307
308             case "${valomitted}-${opt}" in yes-without_* )
309         opt=`echo $opt | sed 's/without/with/'`
310         valomitted="no" val="no" ;;
311       esac
312
313             case "$opt" in
314
315         with_site_lisp  | \
316         with_prefix     | \
317         with_site_modules | \
318         with_x          | \
319         with_x11        | \
320         with_msw        | \
321         with_gcc        | \
322         dynamic         | \
323         with_ncurses    | \
324         with_dnet       | \
325         with_socks      | \
326         with_dragndrop  | \
327         with_cde        | \
328         with_offix      | \
329         with_gpm        | \
330         with_xpm        | \
331         with_xface      | \
332         with_gif        | \
333         with_jpeg       | \
334         with_png        | \
335         with_tiff       | \
336         with_wmcommand  | \
337         with_xmu        | \
338         with_purify     | \
339         with_quantify   | \
340         with_toolbars   | \
341         with_tty        | \
342         with_xfs        | \
343         with_i18n3      | \
344         with_mule       | \
345         with_utf_2000   | \
346         with_text_coding| \
347         with_file_coding| \
348         with_canna      | \
349         with_wnn        | \
350         with_wnn6       | \
351         with_workshop   | \
352         with_sparcworks | \
353         with_tooltalk   | \
354         with_ldap       | \
355         with_postgresql | \
356         with_pop        | \
357         with_kerberos   | \
358         with_hesiod     | \
359         with_dnet       | \
360         with_infodock   | \
361         external_widget | \
362         verbose         | \
363         extra_verbose   | \
364         usage_tracking  | \
365         use_union_type  | \
366         pdump           | \
367         debug           | \
368         use_assertions  | \
369         memory_usage_stats | \
370         with_clash_detection | \
371         with_modules | \
372         quick_build )
373                   case "$val" in
374             y | ye | yes )      val=yes ;;
375             n | no )            val=no  ;;
376             * ) (echo "$progname: Usage error:"
377 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
378 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
379           esac
380           eval "$opt=\"$val\"" ;;
381
382
383                         srcdir          | \
384         compiler        | \
385         cflags          | \
386         cpp             | \
387         cppflags        | \
388         libs            | \
389         ldflags         | \
390         cache_file      | \
391         native_sound_lib| \
392         site_lisp       | \
393         x_includes      | \
394         x_libraries     | \
395         site_includes   | \
396         site_libraries  | \
397         site_prefixes   | \
398         site_runtime_libraries )
399                   if test "$valomitted" = "yes" ; then
400                     if test "$#" = 0 ; then
401               (echo "$progname: Usage error:"
402 echo " " "The \`--$optname' option requires a value."
403 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
404             fi
405             val="$1"; shift
406           fi
407           eval "$opt=\"$val\""
408         ;;
409
410                 rel_alloc | \
411         with_dlmalloc | \
412         with_debug_malloc  | use_debug_malloc | \
413         with_system_malloc | use_system_malloc )
414           case "$val" in
415             y | ye | yes )      val=yes ;;
416             n | no )            val=no  ;;
417             d | de | def | defa | defau | defaul | default ) val=default ;;
418             * ) (echo "$progname: Usage error:"
419 echo " " "The \`--$optname' option requires one of these values:
420   \`yes', \`no', or \`default'."
421 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
422           esac
423           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
424           eval "$opt=\"$val\""
425         ;;
426
427                 "with_database" )
428           with_database_berkdb=no
429           with_database_dbm=no
430           with_database_gdbm=no
431           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
432             case "$x" in
433               no ) ;;
434               b | be | ber | berk | berkd | berkdb )       with_database_berkdb=yes ;;
435               d | db | dbm )                               with_database_dbm=yes    ;;
436               g | gn | gnu | gnud | gnudb | gnudbm | gdbm) with_database_gdbm=yes   ;;
437               * ) (echo "$progname: Usage error:"
438 echo " " "The \`--$optname' option value
439   must be either \`no' or a comma-separated list
440   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
441 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
442             esac
443           done
444           if test "$with_database_dbm"  = "yes" -a \
445                   "$with_database_gdbm" = "yes"; then
446           (echo "$progname: Usage error:"
447 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
448   with the \`--$optname' option."
449 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
450           fi
451         ;;
452
453                 "with_sound" )
454                           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
455             case "$x" in
456                       n | no | non | none ) new_sdefault=no ;;
457               a | al | all | both ) new_sdefault=yes ;;
458
459               native )       with_native_sound=yes ;;
460               nonative )     with_native_sound=no ;;
461
462               nas )          with_nas_sound=yes ;;
463               nonas )        with_nas_sound=no ;;
464
465               esd )          with_esd_sound=yes ;;
466               noesd )        with_esd_sound=no ;;
467
468               * ) bogus_sound=yes ;;
469             esac
470             if test "$bogus_sound" -o \
471                  \( -n "$new_sdefault" -a -n "$sound_notfirst" \) ; then
472                 types="\`all', \`none', \`(no)native', \`no(nas)', \`(no)esd'."
473                 (echo "$progname: Usage error:"
474 echo " " "Valid types for the \`--$optname' option are:
475   $types.
476 The default is to autodetect all sound support."
477 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
478             elif test -n "$new_sdefault" ; then
479                 with_native_sound=$new_sdefault
480                 with_nas_sound=$new_sdefault
481                 with_esd_sound=$new_sdefault
482                 new_sdefault=   # reset this
483             fi
484             sound_notfirst=true
485           done
486         ;;
487
488                         "with_athena" )
489           case "$val" in
490             xa | xaw )                    val=xaw    ;;
491             3 | 3d | xaw3d )              val=3d     ;;
492                         ne | nex | next | naxtaw)     val=next   ;;
493                         9 | 95 | xaw95 )              val=95     ;;
494             xp | xpm | xawxpm )           val=xpm    ;;
495             * ) (echo "$progname: Usage error:"
496 echo " " "The \`--$optname' option must have one of these values:
497   \`xaw', \`3d', \`next', \`95', or \`xpm'."
498 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
499           esac
500           eval "$opt=\"$val\""
501         ;;
502
503                 "with_xim" )
504           case "$val" in
505             y | ye | yes )                val=yes   ;;
506             n | no | non | none )         val=no    ;;
507             x | xl | xli | xlib )         val=xlib  ;;
508             m | mo | mot | moti | motif ) val=motif ;;
509             * ) (echo "$progname: Usage error:"
510 echo " " "The \`--$optname' option must have one of these values:
511   \`motif', \`xlib', \`yes', or \`no'."
512 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
513           esac
514           eval "$opt=\"$val\""
515         ;;
516
517                 "mail_locking" )
518           case "$val" in
519             lockf )     val=lockf ;;
520             flock )     val=flock ;;
521             file | dot ) val=file  ;;
522             locking )   val=locking  ;;
523             * ) (echo "$progname: Usage error:"
524 echo " " "The \`--$optname' option must have one of these values:
525   \`lockf', \`flock', \`file', \`locking', or \`mmdf'."
526 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
527           esac
528           eval "$opt=\"$val\""
529         ;;
530
531                 "error_checking" )
532                           
533           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
534             case "$x" in
535                       n | no | non | none ) new_default=no ;;
536               a | al | all )        new_default=yes ;;
537
538               extents )       error_check_extents=yes ;;
539               noextents )     error_check_extents=no ;;
540
541               typecheck )     error_check_typecheck=yes ;;
542               notypecheck )   error_check_typecheck=no ;;
543
544               bufpos )        error_check_bufpos=yes ;;
545               nobufpos )      error_check_bufpos=no ;;
546
547               gc )            error_check_gc=yes ;;
548               nogc )          error_check_gc=no ;;
549
550               malloc )        error_check_malloc=yes ;;
551               nomalloc )      error_check_malloc=no ;;
552
553               byte_code )     error_check_byte_code=yes ;;
554               nobyte_code )   error_check_byte_code=no ;;
555
556               glyphs )     error_check_glyphs=yes ;;
557               noglyphs )   error_check_glyphs=no ;;
558
559               * ) bogus_error_check=yes ;;
560             esac
561             if test "$bogus_error_check" -o \
562                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
563                 if test "$error_check_default" = yes ; then
564                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', \`noglyphs' and \`nobyte-code'."
565                 else
566                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'."
567                 fi
568                 (echo "$progname: Usage error:"
569 echo " " "Valid types for the \`--$optname' option are:
570   $types."
571 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
572             elif test -n "$new_default" ; then
573                 error_check_extents=$new_default
574                 error_check_typecheck=$new_default
575                 error_check_bufpos=$new_default
576                 error_check_gc=$new_default
577                 error_check_malloc=$new_default
578                 error_check_byte_code=$new_default
579                 error_check_glyphs=$new_default
580                 new_default=    # reset this
581             fi
582             echeck_notfirst=true
583           done
584         ;;
585
586                                 
587                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
588         mandir | infodir | infopath | lispdir | etcdir | pkgdir | \
589         archlibdir | docdir | package_path )
590                    if test "$valomitted" = "yes"; then
591              if test "$#" = 0; then
592                  (echo "$progname: Usage error:"
593 echo " " "The \`--$optname' option requires a value."
594 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
595              fi
596              val="$1"; shift
597            fi
598            eval "$opt=\"$val\""
599
600                            case "$opt" in
601                      exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
602     Defining EXEC_PREFIX_USER_DEFINED
603 EOF
604 cat >> confdefs.h <<\EOF
605 #define EXEC_PREFIX_USER_DEFINED 1
606 EOF
607 }
608  ;;
609              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
610     Defining LISPDIR_USER_DEFINED
611 EOF
612 cat >> confdefs.h <<\EOF
613 #define LISPDIR_USER_DEFINED 1
614 EOF
615 }
616  ;;
617              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
618     Defining SITELISPDIR_USER_DEFINED
619 EOF
620 cat >> confdefs.h <<\EOF
621 #define SITELISPDIR_USER_DEFINED 1
622 EOF
623 }
624  ;;
625              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
626     Defining MODULEDIR_USER_DEFINED
627 EOF
628 cat >> confdefs.h <<\EOF
629 #define MODULEDIR_USER_DEFINED 1
630 EOF
631 }
632  ;;
633              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
634     Defining ETCDIR_USER_DEFINED
635 EOF
636 cat >> confdefs.h <<\EOF
637 #define ETCDIR_USER_DEFINED 1
638 EOF
639 }
640  ;;
641              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
642     Defining INFODIR_USER_DEFINED
643 EOF
644 cat >> confdefs.h <<\EOF
645 #define INFODIR_USER_DEFINED 1
646 EOF
647 }
648  ;;
649              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
650     Defining INFOPATH_USER_DEFINED
651 EOF
652 cat >> confdefs.h <<\EOF
653 #define INFOPATH_USER_DEFINED 1
654 EOF
655 }
656  ;;
657              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
658     Defining PACKAGE_PATH_USER_DEFINED
659 EOF
660 cat >> confdefs.h <<\EOF
661 #define PACKAGE_PATH_USER_DEFINED 1
662 EOF
663 }
664  ;;
665              datadir )
666                 { test "$extra_verbose" = "yes" && cat << \EOF
667     Defining INFODIR_USER_DEFINED
668 EOF
669 cat >> confdefs.h <<\EOF
670 #define INFODIR_USER_DEFINED 1
671 EOF
672 }
673
674                 { test "$extra_verbose" = "yes" && cat << \EOF
675     Defining LISPDIR_USER_DEFINED
676 EOF
677 cat >> confdefs.h <<\EOF
678 #define LISPDIR_USER_DEFINED 1
679 EOF
680 }
681
682             { test "$extra_verbose" = "yes" && cat << \EOF
683     Defining MODULEDIR_USER_DEFINED
684 EOF
685 cat >> confdefs.h <<\EOF
686 #define MODULEDIR_USER_DEFINED 1
687 EOF
688 }
689
690                 { test "$extra_verbose" = "yes" && cat << \EOF
691     Defining ETCDIR_USER_DEFINED
692 EOF
693 cat >> confdefs.h <<\EOF
694 #define ETCDIR_USER_DEFINED 1
695 EOF
696 }
697  ;;
698              docdir ) { test "$extra_verbose" = "yes" && cat << \EOF
699     Defining DOCDIR_USER_DEFINED
700 EOF
701 cat >> confdefs.h <<\EOF
702 #define DOCDIR_USER_DEFINED 1
703 EOF
704 }
705  ;;
706              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
707     Defining ARCHLIBDIR_USER_DEFINED
708 EOF
709 cat >> confdefs.h <<\EOF
710 #define ARCHLIBDIR_USER_DEFINED 1
711 EOF
712 }
713  ;;
714            esac
715         ;;
716
717                 "no_create" ) ;;
718
719                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
720
721                 "with_menubars"   | \
722         "with_scrollbars" | \
723         "with_dialogs" | \
724         "with_widgets" )
725           case "$val" in
726             l | lu | luc | luci | lucid )               val=lucid  ;;
727             m | mo | mot | moti | motif )               val=motif  ;;
728             a | at | ath | athe | athen | athena )      val=athena ;;
729             n | no | non | none )                       val=no ;;
730             * ) (echo "$progname: Usage error:"
731 echo " " "The \`--$optname' option must have one of these values:
732   \`lucid', \`motif', \`athena', or \`no'."
733 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
734           esac
735           eval "$opt=\"$val\""
736         ;;
737
738                 "use_minimal_tagbits" | \
739         "use_indexed_lrecord_implementation" | \
740         "run_in_place"  | \
741         "const_is_losing" | \
742         "with_gnu_make" )
743           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
744         ;;
745
746                 * ) (echo "$progname: Usage error:"
747 echo " " "Unrecognized option: $arg"
748 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
749
750       esac
751     ;;
752
753         *-*-*) configuration="$arg" ;;
754
755         *) (echo "$progname: Usage error:"
756 echo " " "Unrecognized argument: $arg"
757 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
758
759   esac
760 done
761
762
763 test -n "$cpp"      && CPP="$cpp"
764 test -n "$cppflags" && CPPFLAGS="$cppflags"
765 test -n "$libs"     && LIBS="$libs"
766 test -n "$ldflags"  && LDFLAGS="$ldflags"
767
768 eval set x "$quoted_arguments"; shift
769
770 test "$extra_verbose" = "yes" && verbose=yes
771
772 test -n "$with_x" && with_x11="$with_x"
773
774 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
775   test "$with_system_malloc" = "default" && with_system_malloc=yes
776 fi
777
778
779
780 if test "$with_cde $with_tooltalk" = "yes no"; then
781   (echo "$progname: Usage error:"
782 echo " " "--with-cde requires --with-tooltalk"
783 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
784 elif test "$with_tooltalk" = "no" ; then with_cde=no
785 elif test "$with_cde" = "yes"; then with_tooltalk=yes
786 fi
787
788
789 case "$srcdir" in
790
791     "" )
792     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
793       if test -f "$dir/src/lisp.h" -a \
794               -f "$dir/lisp/version.el" ; then
795         srcdir="$dir"
796         break
797       fi
798     done
799     if test -z "$srcdir" ; then
800       (echo "$progname: Usage error:"
801 echo " " "Neither the current directory nor its parent seem to
802   contain the XEmacs sources.  If you do not want to build XEmacs in its
803   source tree, you should run \`$progname' in the directory in which
804   you wish to build XEmacs, using the \`--srcdir' option to say where the
805   sources may be found."
806 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
807     fi
808   ;;
809
810     * )
811     if test ! -f "$srcdir/src/lisp.h" -o \
812             ! -f "$srcdir/lisp/version.el" ; then
813       (echo "$progname: Usage error:"
814 echo " " "The directory specified with the \`--srcdir' option,
815   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
816   either run the \`$progname' script at the top of the XEmacs source
817   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
818 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
819     fi
820   ;;
821 esac
822
823 if test -z "$configuration"; then
824     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
825   if test -z "$configuration"; then
826     (echo "$progname: Usage error:"
827 echo " " "XEmacs has not been ported to this host type.
828 Try explicitly specifying the CONFIGURATION when rerunning configure."
829 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
830   fi
831 fi
832
833 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
834 echo "configure:835: checking whether ln -s works" >&5
835
836 rm -f conftestdata
837 if ln -s X conftestdata 2>/dev/null
838 then
839   rm -f conftestdata
840   ac_cv_prog_LN_S="ln -s"
841 else
842   ac_cv_prog_LN_S=ln
843 fi
844 LN_S="$ac_cv_prog_LN_S"
845 if test "$ac_cv_prog_LN_S" = "ln -s"; then
846   echo "$ac_t""yes" 1>&6
847 else
848   echo "$ac_t""no" 1>&6
849 fi
850
851
852 for dir in lisp etc man info tests; do
853   if test ! -d "$dir" ; then
854     echo Making symbolic link to "$srcdir/$dir"
855     ${LN_S} "$srcdir/$dir" "$dir"
856   fi
857 done
858
859
860 absolute_pwd="`pwd`";
861 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
862 then blddir="$PWD"
863 else blddir="$absolute_pwd"; if test -d "/net"; then
864   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
865   blddir=`echo "$blddir" | \
866    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
867 fi
868 fi
869
870
871 case "$srcdir" in
872   /* ) ;;
873   .  ) srcdir="$blddir" ;;
874   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
875   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
876   srcdir=`echo "$srcdir" | \
877    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
878 fi ;;
879 esac
880
881 if test `pwd` != `sh -c cd $srcdir && pwd`  \
882    && test -f "$srcdir/src/config.h"; then
883   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
884    echo "   as a build directory right now; it has been configured in its own"
885    echo "   right.  To configure in another directory as well, you MUST"
886    echo "   use GNU make.  If you do not have GNU make, then you must"
887    echo "   now do \`make distclean' in $srcdir,"
888    echo "   and then run $progname again.") >&2
889   extrasub='/^VPATH[     ]*=/c\
890 vpath %.c $(srcdir)\
891 vpath %.h $(srcdir)\
892 vpath %.y $(srcdir)\
893 vpath %.l $(srcdir)\
894 vpath %.s $(srcdir)\
895 vpath %.in $(srcdir)'
896 fi
897
898 . "$srcdir/version.sh" || exit 1;
899 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
900 : "${extra_verbose=$beta}"
901 version="${emacs_major_version}.${emacs_minor_version}"
902 { test "$extra_verbose" = "yes" && cat << EOF
903     Defining EMACS_MAJOR_VERSION = $emacs_major_version
904 EOF
905 cat >> confdefs.h <<EOF
906 #define EMACS_MAJOR_VERSION $emacs_major_version
907 EOF
908 }
909
910 { test "$extra_verbose" = "yes" && cat << EOF
911     Defining EMACS_MINOR_VERSION = $emacs_minor_version
912 EOF
913 cat >> confdefs.h <<EOF
914 #define EMACS_MINOR_VERSION $emacs_minor_version
915 EOF
916 }
917
918 if test -n "$emacs_beta_version" ; then
919   if test "$beta" = "yes"; then
920         version="${version}-b${emacs_beta_version}"
921         { test "$extra_verbose" = "yes" && cat << EOF
922     Defining EMACS_BETA_VERSION = $emacs_beta_version
923 EOF
924 cat >> confdefs.h <<EOF
925 #define EMACS_BETA_VERSION $emacs_beta_version
926 EOF
927 }
928
929   else
930         version="${version}.${emacs_beta_version}"
931         { test "$extra_verbose" = "yes" && cat << EOF
932     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
933 EOF
934 cat >> confdefs.h <<EOF
935 #define EMACS_PATCH_LEVEL $emacs_beta_version
936 EOF
937 }
938
939   fi
940 fi
941 { test "$extra_verbose" = "yes" && cat << EOF
942     Defining XEMACS_CODENAME = "$xemacs_codename"
943 EOF
944 cat >> confdefs.h <<EOF
945 #define XEMACS_CODENAME "$xemacs_codename"
946 EOF
947 }
948
949 { test "$extra_verbose" = "yes" && cat << EOF
950     Defining EMACS_VERSION = "$version"
951 EOF
952 cat >> confdefs.h <<EOF
953 #define EMACS_VERSION "$version"
954 EOF
955 }
956
957
958 if test "$with_infodock" = "yes"; then
959   if test ! -f ../../ID-INSTALL; then
960     echo "Cannot build InfoDock without InfoDock sources"
961     with_infodock=no
962   fi
963 fi
964
965 if test "$with_infodock" = "yes"; then
966       { test "$extra_verbose" = "yes" && cat << EOF
967     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
968 EOF
969 cat >> confdefs.h <<EOF
970 #define INFODOCK_MAJOR_VERSION $infodock_major_version
971 EOF
972 }
973
974   { test "$extra_verbose" = "yes" && cat << EOF
975     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
976 EOF
977 cat >> confdefs.h <<EOF
978 #define INFODOCK_MINOR_VERSION $infodock_minor_version
979 EOF
980 }
981
982   { test "$extra_verbose" = "yes" && cat << EOF
983     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
984 EOF
985 cat >> confdefs.h <<EOF
986 #define INFODOCK_BUILD_VERSION $infodock_build_version
987 EOF
988 }
989
990   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
991   PROGNAME=infodock
992   CPPFLAGS="$CPPFLAGS -DINFODOCK"
993 else
994   PROGNAME=xemacs
995 fi
996
997 { test "$extra_verbose" = "yes" && cat << EOF
998     Defining EMACS_PROGNAME = "$PROGNAME"
999 EOF
1000 cat >> confdefs.h <<EOF
1001 #define EMACS_PROGNAME "$PROGNAME"
1002 EOF
1003 }
1004
1005
1006 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
1007 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1008     Defining ERROR_CHECK_EXTENTS
1009 EOF
1010 cat >> confdefs.h <<\EOF
1011 #define ERROR_CHECK_EXTENTS 1
1012 EOF
1013 }
1014
1015 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1016     Defining ERROR_CHECK_TYPECHECK
1017 EOF
1018 cat >> confdefs.h <<\EOF
1019 #define ERROR_CHECK_TYPECHECK 1
1020 EOF
1021 }
1022
1023 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1024     Defining ERROR_CHECK_BUFPOS
1025 EOF
1026 cat >> confdefs.h <<\EOF
1027 #define ERROR_CHECK_BUFPOS 1
1028 EOF
1029 }
1030
1031 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1032     Defining ERROR_CHECK_GC
1033 EOF
1034 cat >> confdefs.h <<\EOF
1035 #define ERROR_CHECK_GC 1
1036 EOF
1037 }
1038
1039 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1040     Defining ERROR_CHECK_MALLOC
1041 EOF
1042 cat >> confdefs.h <<\EOF
1043 #define ERROR_CHECK_MALLOC 1
1044 EOF
1045 }
1046
1047 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1048     Defining ERROR_CHECK_BYTE_CODE
1049 EOF
1050 cat >> confdefs.h <<\EOF
1051 #define ERROR_CHECK_BYTE_CODE 1
1052 EOF
1053 }
1054
1055 test "${error_check_glyphs=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1056     Defining ERROR_CHECK_GLYPHS
1057 EOF
1058 cat >> confdefs.h <<\EOF
1059 #define ERROR_CHECK_GLYPHS 1
1060 EOF
1061 }
1062
1063 if test "${debug:=$beta}" = "yes"; then
1064   use_assertions=yes memory_usage_stats=yes
1065   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
1066    echo "    xemacs will be linked with \"debug.o\""
1067  fi
1068   extra_objs="$extra_objs tests.o" &&  if test "$extra_verbose" = "yes"; then
1069    echo "    xemacs will be linked with \"tests.o\""
1070  fi
1071   { test "$extra_verbose" = "yes" && cat << \EOF
1072     Defining DEBUG_XEMACS
1073 EOF
1074 cat >> confdefs.h <<\EOF
1075 #define DEBUG_XEMACS 1
1076 EOF
1077 }
1078
1079 fi
1080 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1081     Defining USE_ASSERTIONS
1082 EOF
1083 cat >> confdefs.h <<\EOF
1084 #define USE_ASSERTIONS 1
1085 EOF
1086 }
1087
1088 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1089     Defining MEMORY_USAGE_STATS
1090 EOF
1091 cat >> confdefs.h <<\EOF
1092 #define MEMORY_USAGE_STATS 1
1093 EOF
1094 }
1095
1096
1097
1098 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1099 echo "configure:1100: checking "host system type"" >&5
1100 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1101 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1102 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1103 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1104 echo "$ac_t""$configuration" 1>&6
1105
1106
1107
1108
1109
1110 machine='' opsys=''
1111
1112 case "$canonical" in
1113   sparc-*-*        ) machine=sparc ;;
1114   alpha*-*-*       ) machine=alpha ;;
1115   vax-*-*          ) machine=vax ;;
1116   mips-dec-*       ) machine=pmax ;;
1117   mips-sgi-irix6*  ) machine=iris6d ;;
1118   mips-sgi-*       ) machine=iris4d ;;
1119   mips*-linux      ) machine=mips ;;
1120   romp-ibm-*       ) machine=ibmrt ;;
1121   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1122   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1123   powerpc*-*       ) machine=powerpc ;;
1124   hppa-*-*         ) machine=hp800 ;;
1125   m88k-dg-*        ) machine=aviion ;;
1126   m68*-sony-*      ) machine=news ;;
1127   mips-sony-*      ) machine=news-risc ;;
1128   clipper-*        ) machine=clipper ;;
1129   arm*             ) machine=arm ;;
1130   ns32k-*          ) machine=ns32000 ;;
1131 esac
1132
1133 case "$canonical" in
1134   *-*-linux*    ) opsys=linux ;;
1135   *-*-netbsd*   ) opsys=netbsd ;;
1136   *-*-openbsd*  ) opsys=openbsd ;;
1137   *-*-nextstep* ) opsys=nextstep ;;
1138   *-*-vms       ) opsys=vms ;;
1139
1140     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1141   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1142   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1143   *-dec-osf3*                ) opsys=decosf3-1 ;;
1144   *-dec-osf4*                ) opsys=decosf4-0 ;;
1145
1146     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1147   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1148   *-*-ultrix* )         opsys=ultrix4-3 ;;
1149
1150     *-*-aix3.1*  ) opsys=aix3-1 ;;
1151   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1152   *-*-aix3*    ) opsys=aix3-2   ;;
1153   *-*-aix4.0*  ) opsys=aix4     ;;
1154   *-*-aix4.1*  ) opsys=aix4-1   ;;
1155   *-*-aix4*    ) opsys=aix4-2   ;;
1156
1157     *-gnu* )                    opsys=gnu    ;;
1158   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1159   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1160   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1161   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1162   *-*-aos*   )                  opsys=bsd4-3 ;;
1163   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1164   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1165   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1166   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1167   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1168   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1169         if test -z "$NON_GNU_CPP" ; then
1170           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1171             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1172           done
1173         fi
1174         opsys=usg5-4-2 ;;
1175     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1176     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1177 esac
1178
1179 case "$canonical" in
1180
1181     *-*-netbsd* )
1182     case "$canonical" in
1183       i[3-9]86-*-netbsd*) machine=intel386 ;;
1184       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1185                                             machine=hp9000s300 ;;
1186       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1187       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1188     esac
1189   ;;
1190
1191     *-*-openbsd* )
1192     case "${canonical}" in
1193       i386-*-openbsd*)          machine=intel386 ;;
1194       m68k-*-openbsd*)          machine=hp9000s300 ;;
1195       mipsel-*-openbsd*)        machine=pmax ;;
1196      esac
1197    ;;
1198
1199     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1200   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1201
1202     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1203   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1204
1205     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1206
1207     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1208
1209     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1210
1211     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1212
1213     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1214
1215     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1216   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1217   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1218
1219   
1220     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1221
1222     *-convex-bsd* | *-convex-convexos* )
1223     machine=convex opsys=bsd4-3
1224     NON_GNU_CPP="cc -E -P"
1225   ;;
1226
1227     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1228
1229     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1230   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1231   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1232   m88k-dg-dgux*                           ) opsys=dgux     ;;
1233
1234     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1235   m88k-motorola-sysv4* )
1236                     machine=delta88k opsys=usg5-4-2
1237   ;;
1238   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1239
1240     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1241   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1242
1243     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1244
1245     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1246   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1247   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1248
1249       m88k-harris-cxux* )
1250         case "`uname -r`" in
1251        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1252        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1253     esac
1254     NON_GNU_CPP="/lib/cpp"
1255   ;;
1256     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1257     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1258
1259     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1260
1261     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1262
1263     *-hp-hpux* )
1264         case "$canonical" in
1265       m68*  ) machine=hp9000s300 ;;
1266       hppa* ) machine=hp800      ;;
1267     esac
1268
1269     case "$canonical" in
1270       *-hp-hpux7*  )  opsys=hpux   ;;
1271       *-hp-hpux8*  )  opsys=hpux8  ;;
1272       *-hp-hpux9*  )  opsys=hpux9  ;;
1273       *-hp-hpux10* )  opsys=hpux10 ;;
1274       *-hp-hpux11* )  opsys=hpux11 ;;
1275       *            )  opsys=hpux   ;;
1276     esac
1277
1278         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1279    echo "    xemacs will be linked with \"strcat.o\""
1280  fi ;; esac
1281
1282     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1283         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1284     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1285
1286     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1287   ;;
1288
1289     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1290   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1291
1292     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1293   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1294   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1295   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1296   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1297   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1298
1299     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1300   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1301
1302     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1303
1304     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1305
1306     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1307
1308     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1309
1310       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1311
1312     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1313
1314     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1315
1316     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1317
1318     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1319
1320         mips-mips-usg* ) machine=mips4 ;;
1321   mips-mips-riscos4 )
1322     machine=mips4
1323     NON_GNU_CC="cc -systype bsd43"
1324     NON_GNU_CPP="cc -systype bsd43 -E"
1325     case "$canonical" in
1326       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1327       mips-mips-riscos5* ) opsys=riscos5 ;;
1328     esac
1329   ;;
1330   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1331   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1332
1333     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1334
1335     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1336
1337     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1338   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1339
1340     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1341
1342     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1343
1344     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1345
1346     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1347
1348     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1349   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1350
1351     mips-siemens-sysv* | mips-sni-sysv*)
1352     machine=mips-siemens opsys=usg5-4
1353     NON_GNU_CC=/usr/ccs/bin/cc
1354     NON_GNU_CPP=/usr/ccs/lib/cpp
1355   ;;
1356
1357     mips-nec-sysv*)
1358     machine=mips-nec
1359     NON_GNU_CC=/usr/ccs/bin/cc
1360     NON_GNU_CPP=/usr/ccs/lib/cpp
1361   ;;
1362
1363       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1364   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1365     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1366   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1367   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1368   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1369   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1370   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1371   mips-sgi-irix*      ) opsys=irix5-0 ;;
1372
1373     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1374   *-sony-news* ) opsys=newsos5 ;;
1375
1376     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1377
1378     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1379         case "$canonical" in
1380       m68*-sunos1* )             machine=sun1     ;;
1381       m68*-sunos2* )             machine=sun2     ;;
1382       m68* )                     machine=sun3     ;;
1383       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1384       i*86-*-* )                 machine=intel386 ;;
1385       rs6000* )                  machine=rs6000   ;;
1386     esac
1387
1388         case "$canonical" in *-sunos5*)
1389       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1390     esac
1391
1392                     case "$canonical" in
1393       *-sunos4* )
1394         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1395         : ;;
1396       *-solaris2* )
1397         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1398         RANLIB=':' ;;
1399     esac
1400
1401     case "$canonical" in
1402       *-solaris*          )
1403         opsys=sol2
1404         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1405         { test "$extra_verbose" = "yes" && cat << EOF
1406     Defining OS_RELEASE = $os_release
1407 EOF
1408 cat >> confdefs.h <<EOF
1409 #define OS_RELEASE $os_release
1410 EOF
1411 }
1412  ;;
1413
1414             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1415       *-sunos4.0*         ) opsys=sunos4-0      ;;
1416       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1417       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1418       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1419       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1420       *-mach*             ) opsys=mach-bsd4-3   ;;
1421       *                   ) opsys=bsd4-2        ;;
1422     esac
1423
1424     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1425
1426         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1427   ;;
1428
1429     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1430
1431     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1432   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1433
1434     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1435
1436     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1437
1438     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1439       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1440
1441     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1442
1443     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1444
1445     vax-dec-* )
1446     case "$canonical" in
1447       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1448       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1449       *-mach* )                         opsys=mach-bsd4-3 ;;
1450     esac
1451   ;;
1452
1453     ns16k-whitechapel-* ) machine=mg1 ;;
1454
1455     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1456
1457     i[3-9]86-*-* )
1458     machine=intel386
1459     case "$canonical" in
1460       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1461       *-isc2.2* )               opsys=isc2-2 ;;
1462       *-isc4.0* )               opsys=isc4-0 ;;
1463       *-isc4.* )                opsys=isc4-1
1464                                 GCC_TEST_OPTIONS=-posix
1465                                 NON_GCC_TEST_OPTIONS=-Xp
1466                                 ;;
1467       *-isc* )                  opsys=isc3-0 ;;
1468       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1469       *-esix* )                 opsys=esix ;;
1470       *-mach* )                 opsys=mach-bsd4-3 ;;
1471       *-xenix* )                opsys=xenix ;;
1472       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1473       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1474       *-bsdi4* )                opsys=bsdos4 ;;
1475       *-bsdi3* )                opsys=bsdos3 ;;
1476       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1477       *-bsdi2* )                opsys=bsdos2 ;;
1478       *-sco3.2v5* )             opsys=sco5 ;
1479                                                         if test "$dynamic" = "yes" ; then
1480                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1481         else
1482                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1483         fi ;;
1484       *-sysv5* )                opsys=sco7 ;;
1485       *-386bsd* )               opsys=386bsd ;;
1486       *-freebsd* )              opsys=freebsd ;;
1487       *-nextstep* )             opsys=nextstep ;;
1488       *-pc-cygwin* )            opsys=cygwin32 ;;
1489       *-pc-mingw* )             opsys=mingw32 ;
1490                                 test -z "$with_tty" && with_tty="no";;
1491           esac
1492   ;;
1493
1494     m68k-*-linux* ) machine=m68k opsys=linux ;;
1495
1496 esac
1497
1498 if test -z "$machine" -o -z "$opsys"; then
1499   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1500    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1501   ) >&2
1502   exit 1
1503 fi
1504
1505 if test -z "$dynamic"; then
1506   case "$opsys" in
1507     hpux* | sunos4* ) dynamic=no ;;
1508     *) dynamic=yes ;;
1509   esac
1510 fi
1511 if test "$dynamic" = "yes"; then
1512   case "$opsys" in
1513     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1514     decosf* ) ld_call_shared="-call_shared" ;;
1515   esac
1516 else   case "$opsys" in
1517     sol2 )
1518       echo "Static linking is not supported on Solaris 2."
1519       echo "Rerun configure without specifying --dynamic=no."
1520       exit 1 ;;
1521     linux   ) ld_call_shared="-Bstatic" ;;
1522     decosf* ) ld_call_shared="-non_shared" ;;
1523   esac
1524 fi
1525
1526 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1527
1528 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1529 { test "$extra_verbose" = "yes" && cat << EOF
1530     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1531 EOF
1532 cat >> confdefs.h <<EOF
1533 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1534 EOF
1535 }
1536
1537
1538 machfile="m/${machine}.h"
1539 opsysfile="s/${opsys}.h"
1540
1541
1542 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1543 if test "$with_workshop $with_tooltalk" = "yes no"; then
1544   (echo "$progname: Usage error:"
1545 echo " " "--with-workshop requires --with-tooltalk"
1546 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1547 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1548 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1549 fi
1550
1551 if test "$with_workshop" = "yes"; then
1552   { test "$extra_verbose" = "yes" && cat << \EOF
1553     Defining SUNPRO
1554 EOF
1555 cat >> confdefs.h <<\EOF
1556 #define SUNPRO 1
1557 EOF
1558 }
1559
1560   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1561    echo "    xemacs will be linked with \"sunpro.o\""
1562  fi
1563 fi
1564
1565 if test "$with_clash_detection" != "no"; then
1566   { test "$extra_verbose" = "yes" && cat << \EOF
1567     Defining CLASH_DETECTION
1568 EOF
1569 cat >> confdefs.h <<\EOF
1570 #define CLASH_DETECTION 1
1571 EOF
1572 }
1573
1574   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1575    echo "    xemacs will be linked with \"filelock.o\""
1576  fi
1577 fi
1578
1579 test -n "$compiler" && CC="$compiler"
1580 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1581 fi
1582
1583 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1584 if test "${CFLAGS-unset}" != unset
1585   then cflags_specified=yes;
1586   else cflags_specified=no;
1587 fi
1588
1589 xe_save_CFLAGS="$CFLAGS"
1590
1591 # Extract the first word of "gcc", so it can be a program name with args.
1592 set dummy gcc; ac_word=$2
1593 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1594 echo "configure:1595: checking for $ac_word" >&5
1595
1596 if test -n "$CC"; then
1597   ac_cv_prog_CC="$CC" # Let the user override the test.
1598 else
1599   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1600   ac_dummy="$PATH"
1601   for ac_dir in $ac_dummy; do
1602     test -z "$ac_dir" && ac_dir=.
1603     if test -f $ac_dir/$ac_word; then
1604       ac_cv_prog_CC="gcc"
1605       break
1606     fi
1607   done
1608   IFS="$ac_save_ifs"
1609 fi
1610 CC="$ac_cv_prog_CC"
1611 if test -n "$CC"; then
1612   echo "$ac_t""$CC" 1>&6
1613 else
1614   echo "$ac_t""no" 1>&6
1615 fi
1616
1617 if test -z "$CC"; then
1618   # Extract the first word of "cc", so it can be a program name with args.
1619 set dummy cc; ac_word=$2
1620 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1621 echo "configure:1622: checking for $ac_word" >&5
1622
1623 if test -n "$CC"; then
1624   ac_cv_prog_CC="$CC" # Let the user override the test.
1625 else
1626   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1627   ac_prog_rejected=no
1628   ac_dummy="$PATH"
1629   for ac_dir in $ac_dummy; do
1630     test -z "$ac_dir" && ac_dir=.
1631     if test -f $ac_dir/$ac_word; then
1632       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1633         ac_prog_rejected=yes
1634         continue
1635       fi
1636       ac_cv_prog_CC="cc"
1637       break
1638     fi
1639   done
1640   IFS="$ac_save_ifs"
1641 if test $ac_prog_rejected = yes; then
1642   # We found a bogon in the path, so make sure we never use it.
1643   set dummy $ac_cv_prog_CC
1644   shift
1645   if test $# -gt 0; then
1646     # We chose a different compiler from the bogus one.
1647     # However, it has the same basename, so the bogon will be chosen
1648     # first if we set CC to just the basename; use the full file name.
1649     shift
1650     set dummy "$ac_dir/$ac_word" "$@"
1651     shift
1652     ac_cv_prog_CC="$@"
1653   fi
1654 fi
1655 fi
1656 CC="$ac_cv_prog_CC"
1657 if test -n "$CC"; then
1658   echo "$ac_t""$CC" 1>&6
1659 else
1660   echo "$ac_t""no" 1>&6
1661 fi
1662
1663   if test -z "$CC"; then
1664     case "`uname -s`" in
1665     *win32* | *WIN32*)
1666       # Extract the first word of "cl", so it can be a program name with args.
1667 set dummy cl; ac_word=$2
1668 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1669 echo "configure:1670: checking for $ac_word" >&5
1670
1671 if test -n "$CC"; then
1672   ac_cv_prog_CC="$CC" # Let the user override the test.
1673 else
1674   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1675   ac_dummy="$PATH"
1676   for ac_dir in $ac_dummy; do
1677     test -z "$ac_dir" && ac_dir=.
1678     if test -f $ac_dir/$ac_word; then
1679       ac_cv_prog_CC="cl"
1680       break
1681     fi
1682   done
1683   IFS="$ac_save_ifs"
1684 fi
1685 CC="$ac_cv_prog_CC"
1686 if test -n "$CC"; then
1687   echo "$ac_t""$CC" 1>&6
1688 else
1689   echo "$ac_t""no" 1>&6
1690 fi
1691  ;;
1692     esac
1693   fi
1694   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1695 fi
1696
1697 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1698 echo "configure:1699: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1699
1700 ac_ext=c
1701 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1702 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1703 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1704 ac_cpp='$CPP '"$xe_cppflags"
1705 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1706 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1707 cross_compiling=no
1708
1709 cat > conftest.$ac_ext << EOF
1710
1711 #line 1712 "configure"
1712 #include "confdefs.h"
1713
1714 main(){return(0);}
1715 EOF
1716 if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1717   ac_cv_prog_cc_works=yes
1718   # If we can't run a trivial program, we are probably using a cross compiler.
1719   if (./conftest; exit) 2>/dev/null; then
1720     ac_cv_prog_cc_cross=no
1721   else
1722     ac_cv_prog_cc_cross=yes
1723   fi
1724 else
1725   echo "configure: failed program was:" >&5
1726   cat conftest.$ac_ext >&5
1727   ac_cv_prog_cc_works=no
1728 fi
1729 rm -fr conftest*
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 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1740 if test $ac_cv_prog_cc_works = no; then
1741   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1742 fi
1743 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1744 echo "configure:1745: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1745 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1746 cross_compiling=$ac_cv_prog_cc_cross
1747
1748 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1749 echo "configure:1750: checking whether we are using GNU C" >&5
1750
1751 cat > conftest.c <<EOF
1752 #ifdef __GNUC__
1753   yes;
1754 #endif
1755 EOF
1756 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1757   ac_cv_prog_gcc=yes
1758 else
1759   ac_cv_prog_gcc=no
1760 fi
1761
1762 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1763
1764 if test $ac_cv_prog_gcc = yes; then
1765   GCC=yes
1766 else
1767   GCC=
1768 fi
1769
1770 ac_test_CFLAGS="${CFLAGS+set}"
1771 ac_save_CFLAGS="$CFLAGS"
1772 CFLAGS=
1773 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1774 echo "configure:1775: checking whether ${CC-cc} accepts -g" >&5
1775
1776 echo 'void f(){}' > conftest.c
1777 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1778   ac_cv_prog_cc_g=yes
1779 else
1780   ac_cv_prog_cc_g=no
1781 fi
1782 rm -f conftest*
1783
1784
1785 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1786 if test "$ac_test_CFLAGS" = set; then
1787   CFLAGS="$ac_save_CFLAGS"
1788 elif test $ac_cv_prog_cc_g = yes; then
1789   if test "$GCC" = yes; then
1790     CFLAGS="-g -O2"
1791   else
1792     CFLAGS="-g"
1793   fi
1794 else
1795   if test "$GCC" = yes; then
1796     CFLAGS="-O2"
1797   else
1798     CFLAGS=
1799   fi
1800 fi
1801  
1802 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1803   CC=${NON_GNU_CC-cc}
1804   # Extract the first word of "gcc", so it can be a program name with args.
1805 set dummy gcc; ac_word=$2
1806 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1807 echo "configure:1808: checking for $ac_word" >&5
1808
1809 if test -n "$CC"; then
1810   ac_cv_prog_CC="$CC" # Let the user override the test.
1811 else
1812   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1813   ac_dummy="$PATH"
1814   for ac_dir in $ac_dummy; do
1815     test -z "$ac_dir" && ac_dir=.
1816     if test -f $ac_dir/$ac_word; then
1817       ac_cv_prog_CC="gcc"
1818       break
1819     fi
1820   done
1821   IFS="$ac_save_ifs"
1822 fi
1823 CC="$ac_cv_prog_CC"
1824 if test -n "$CC"; then
1825   echo "$ac_t""$CC" 1>&6
1826 else
1827   echo "$ac_t""no" 1>&6
1828 fi
1829
1830 if test -z "$CC"; then
1831   # Extract the first word of "cc", so it can be a program name with args.
1832 set dummy cc; ac_word=$2
1833 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1834 echo "configure:1835: checking for $ac_word" >&5
1835
1836 if test -n "$CC"; then
1837   ac_cv_prog_CC="$CC" # Let the user override the test.
1838 else
1839   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1840   ac_prog_rejected=no
1841   ac_dummy="$PATH"
1842   for ac_dir in $ac_dummy; do
1843     test -z "$ac_dir" && ac_dir=.
1844     if test -f $ac_dir/$ac_word; then
1845       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1846         ac_prog_rejected=yes
1847         continue
1848       fi
1849       ac_cv_prog_CC="cc"
1850       break
1851     fi
1852   done
1853   IFS="$ac_save_ifs"
1854 if test $ac_prog_rejected = yes; then
1855   # We found a bogon in the path, so make sure we never use it.
1856   set dummy $ac_cv_prog_CC
1857   shift
1858   if test $# -gt 0; then
1859     # We chose a different compiler from the bogus one.
1860     # However, it has the same basename, so the bogon will be chosen
1861     # first if we set CC to just the basename; use the full file name.
1862     shift
1863     set dummy "$ac_dir/$ac_word" "$@"
1864     shift
1865     ac_cv_prog_CC="$@"
1866   fi
1867 fi
1868 fi
1869 CC="$ac_cv_prog_CC"
1870 if test -n "$CC"; then
1871   echo "$ac_t""$CC" 1>&6
1872 else
1873   echo "$ac_t""no" 1>&6
1874 fi
1875
1876   if test -z "$CC"; then
1877     case "`uname -s`" in
1878     *win32* | *WIN32*)
1879       # Extract the first word of "cl", so it can be a program name with args.
1880 set dummy cl; ac_word=$2
1881 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1882 echo "configure:1883: checking for $ac_word" >&5
1883
1884 if test -n "$CC"; then
1885   ac_cv_prog_CC="$CC" # Let the user override the test.
1886 else
1887   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1888   ac_dummy="$PATH"
1889   for ac_dir in $ac_dummy; do
1890     test -z "$ac_dir" && ac_dir=.
1891     if test -f $ac_dir/$ac_word; then
1892       ac_cv_prog_CC="cl"
1893       break
1894     fi
1895   done
1896   IFS="$ac_save_ifs"
1897 fi
1898 CC="$ac_cv_prog_CC"
1899 if test -n "$CC"; then
1900   echo "$ac_t""$CC" 1>&6
1901 else
1902   echo "$ac_t""no" 1>&6
1903 fi
1904  ;;
1905     esac
1906   fi
1907   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1908 fi
1909
1910 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1911 echo "configure:1912: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1912
1913 ac_ext=c
1914 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1915 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1916 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1917 ac_cpp='$CPP '"$xe_cppflags"
1918 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1919 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1920 cross_compiling=no
1921
1922 cat > conftest.$ac_ext << EOF
1923
1924 #line 1925 "configure"
1925 #include "confdefs.h"
1926
1927 main(){return(0);}
1928 EOF
1929 if { (eval echo configure:1930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1930   ac_cv_prog_cc_works=yes
1931   # If we can't run a trivial program, we are probably using a cross compiler.
1932   if (./conftest; exit) 2>/dev/null; then
1933     ac_cv_prog_cc_cross=no
1934   else
1935     ac_cv_prog_cc_cross=yes
1936   fi
1937 else
1938   echo "configure: failed program was:" >&5
1939   cat conftest.$ac_ext >&5
1940   ac_cv_prog_cc_works=no
1941 fi
1942 rm -fr conftest*
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 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1953 if test $ac_cv_prog_cc_works = no; then
1954   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1955 fi
1956 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1957 echo "configure:1958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1958 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1959 cross_compiling=$ac_cv_prog_cc_cross
1960
1961 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1962 echo "configure:1963: checking whether we are using GNU C" >&5
1963
1964 cat > conftest.c <<EOF
1965 #ifdef __GNUC__
1966   yes;
1967 #endif
1968 EOF
1969 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1970   ac_cv_prog_gcc=yes
1971 else
1972   ac_cv_prog_gcc=no
1973 fi
1974
1975 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1976
1977 if test $ac_cv_prog_gcc = yes; then
1978   GCC=yes
1979 else
1980   GCC=
1981 fi
1982
1983 ac_test_CFLAGS="${CFLAGS+set}"
1984 ac_save_CFLAGS="$CFLAGS"
1985 CFLAGS=
1986 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1987 echo "configure:1988: checking whether ${CC-cc} accepts -g" >&5
1988
1989 echo 'void f(){}' > conftest.c
1990 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1991   ac_cv_prog_cc_g=yes
1992 else
1993   ac_cv_prog_cc_g=no
1994 fi
1995 rm -f conftest*
1996
1997
1998 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1999 if test "$ac_test_CFLAGS" = set; then
2000   CFLAGS="$ac_save_CFLAGS"
2001 elif test $ac_cv_prog_cc_g = yes; then
2002   if test "$GCC" = yes; then
2003     CFLAGS="-g -O2"
2004   else
2005     CFLAGS="-g"
2006   fi
2007 else
2008   if test "$GCC" = yes; then
2009     CFLAGS="-O2"
2010   else
2011     CFLAGS=
2012   fi
2013 fi
2014
2015 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
2016   CC=gcc
2017   # Extract the first word of "gcc", so it can be a program name with args.
2018 set dummy gcc; ac_word=$2
2019 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2020 echo "configure:2021: checking for $ac_word" >&5
2021
2022 if test -n "$CC"; then
2023   ac_cv_prog_CC="$CC" # Let the user override the test.
2024 else
2025   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2026   ac_dummy="$PATH"
2027   for ac_dir in $ac_dummy; do
2028     test -z "$ac_dir" && ac_dir=.
2029     if test -f $ac_dir/$ac_word; then
2030       ac_cv_prog_CC="gcc"
2031       break
2032     fi
2033   done
2034   IFS="$ac_save_ifs"
2035 fi
2036 CC="$ac_cv_prog_CC"
2037 if test -n "$CC"; then
2038   echo "$ac_t""$CC" 1>&6
2039 else
2040   echo "$ac_t""no" 1>&6
2041 fi
2042
2043 if test -z "$CC"; then
2044   # Extract the first word of "cc", so it can be a program name with args.
2045 set dummy cc; ac_word=$2
2046 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2047 echo "configure:2048: checking for $ac_word" >&5
2048
2049 if test -n "$CC"; then
2050   ac_cv_prog_CC="$CC" # Let the user override the test.
2051 else
2052   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2053   ac_prog_rejected=no
2054   ac_dummy="$PATH"
2055   for ac_dir in $ac_dummy; do
2056     test -z "$ac_dir" && ac_dir=.
2057     if test -f $ac_dir/$ac_word; then
2058       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2059         ac_prog_rejected=yes
2060         continue
2061       fi
2062       ac_cv_prog_CC="cc"
2063       break
2064     fi
2065   done
2066   IFS="$ac_save_ifs"
2067 if test $ac_prog_rejected = yes; then
2068   # We found a bogon in the path, so make sure we never use it.
2069   set dummy $ac_cv_prog_CC
2070   shift
2071   if test $# -gt 0; then
2072     # We chose a different compiler from the bogus one.
2073     # However, it has the same basename, so the bogon will be chosen
2074     # first if we set CC to just the basename; use the full file name.
2075     shift
2076     set dummy "$ac_dir/$ac_word" "$@"
2077     shift
2078     ac_cv_prog_CC="$@"
2079   fi
2080 fi
2081 fi
2082 CC="$ac_cv_prog_CC"
2083 if test -n "$CC"; then
2084   echo "$ac_t""$CC" 1>&6
2085 else
2086   echo "$ac_t""no" 1>&6
2087 fi
2088
2089   if test -z "$CC"; then
2090     case "`uname -s`" in
2091     *win32* | *WIN32*)
2092       # Extract the first word of "cl", so it can be a program name with args.
2093 set dummy cl; ac_word=$2
2094 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2095 echo "configure:2096: checking for $ac_word" >&5
2096
2097 if test -n "$CC"; then
2098   ac_cv_prog_CC="$CC" # Let the user override the test.
2099 else
2100   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2101   ac_dummy="$PATH"
2102   for ac_dir in $ac_dummy; do
2103     test -z "$ac_dir" && ac_dir=.
2104     if test -f $ac_dir/$ac_word; then
2105       ac_cv_prog_CC="cl"
2106       break
2107     fi
2108   done
2109   IFS="$ac_save_ifs"
2110 fi
2111 CC="$ac_cv_prog_CC"
2112 if test -n "$CC"; then
2113   echo "$ac_t""$CC" 1>&6
2114 else
2115   echo "$ac_t""no" 1>&6
2116 fi
2117  ;;
2118     esac
2119   fi
2120   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2121 fi
2122
2123 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2124 echo "configure:2125: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2125
2126 ac_ext=c
2127 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2128 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2129 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2130 ac_cpp='$CPP '"$xe_cppflags"
2131 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2132 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2133 cross_compiling=no
2134
2135 cat > conftest.$ac_ext << EOF
2136
2137 #line 2138 "configure"
2138 #include "confdefs.h"
2139
2140 main(){return(0);}
2141 EOF
2142 if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2143   ac_cv_prog_cc_works=yes
2144   # If we can't run a trivial program, we are probably using a cross compiler.
2145   if (./conftest; exit) 2>/dev/null; then
2146     ac_cv_prog_cc_cross=no
2147   else
2148     ac_cv_prog_cc_cross=yes
2149   fi
2150 else
2151   echo "configure: failed program was:" >&5
2152   cat conftest.$ac_ext >&5
2153   ac_cv_prog_cc_works=no
2154 fi
2155 rm -fr conftest*
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 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2166 if test $ac_cv_prog_cc_works = no; then
2167   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2168 fi
2169 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2170 echo "configure:2171: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2171 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2172 cross_compiling=$ac_cv_prog_cc_cross
2173
2174 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2175 echo "configure:2176: checking whether we are using GNU C" >&5
2176
2177 cat > conftest.c <<EOF
2178 #ifdef __GNUC__
2179   yes;
2180 #endif
2181 EOF
2182 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2183   ac_cv_prog_gcc=yes
2184 else
2185   ac_cv_prog_gcc=no
2186 fi
2187
2188 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2189
2190 if test $ac_cv_prog_gcc = yes; then
2191   GCC=yes
2192 else
2193   GCC=
2194 fi
2195
2196 ac_test_CFLAGS="${CFLAGS+set}"
2197 ac_save_CFLAGS="$CFLAGS"
2198 CFLAGS=
2199 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2200 echo "configure:2201: checking whether ${CC-cc} accepts -g" >&5
2201
2202 echo 'void f(){}' > conftest.c
2203 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2204   ac_cv_prog_cc_g=yes
2205 else
2206   ac_cv_prog_cc_g=no
2207 fi
2208 rm -f conftest*
2209
2210
2211 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2212 if test "$ac_test_CFLAGS" = set; then
2213   CFLAGS="$ac_save_CFLAGS"
2214 elif test $ac_cv_prog_cc_g = yes; then
2215   if test "$GCC" = yes; then
2216     CFLAGS="-g -O2"
2217   else
2218     CFLAGS="-g"
2219   fi
2220 else
2221   if test "$GCC" = yes; then
2222     CFLAGS="-O2"
2223   else
2224     CFLAGS=
2225   fi
2226 fi
2227
2228 fi
2229 CFLAGS="$xe_save_CFLAGS"
2230
2231
2232 test -n "$CPP" -a -d "$CPP" && CPP=
2233
2234 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2235
2236 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2237 echo "configure:2238: checking how to run the C preprocessor" >&5
2238 # On Suns, sometimes $CPP names a directory.
2239 if test -n "$CPP" && test -d "$CPP"; then
2240   CPP=
2241 fi
2242 if test -z "$CPP"; then
2243
2244   # This must be in double quotes, not single quotes, because CPP may get
2245   # substituted into the Makefile and "${CC-cc}" will confuse make.
2246   CPP="${CC-cc} -E"
2247   # On the NeXT, cc -E runs the code through the compiler's parser,
2248   # not just through cpp.
2249   cat > conftest.$ac_ext <<EOF
2250 #line 2251 "configure"
2251 #include "confdefs.h"
2252 #include <assert.h>
2253 Syntax Error
2254 EOF
2255 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2256 { (eval echo configure:2257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2257 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2258 if test -z "$ac_err"; then
2259   :
2260 else
2261   echo "$ac_err" >&5
2262   echo "configure: failed program was:" >&5
2263   cat conftest.$ac_ext >&5
2264   rm -rf conftest*
2265   CPP="${CC-cc} -E -traditional-cpp"
2266   cat > conftest.$ac_ext <<EOF
2267 #line 2268 "configure"
2268 #include "confdefs.h"
2269 #include <assert.h>
2270 Syntax Error
2271 EOF
2272 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2273 { (eval echo configure:2274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2274 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2275 if test -z "$ac_err"; then
2276   :
2277 else
2278   echo "$ac_err" >&5
2279   echo "configure: failed program was:" >&5
2280   cat conftest.$ac_ext >&5
2281   rm -rf conftest*
2282   CPP="${CC-cc} -nologo -E"
2283   cat > conftest.$ac_ext <<EOF
2284 #line 2285 "configure"
2285 #include "confdefs.h"
2286 #include <assert.h>
2287 Syntax Error
2288 EOF
2289 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2290 { (eval echo configure:2291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2291 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2292 if test -z "$ac_err"; then
2293   :
2294 else
2295   echo "$ac_err" >&5
2296   echo "configure: failed program was:" >&5
2297   cat conftest.$ac_ext >&5
2298   rm -rf conftest*
2299   CPP=/lib/cpp
2300 fi
2301 rm -f conftest*
2302 fi
2303 rm -f conftest*
2304 fi
2305 rm -f conftest*
2306   ac_cv_prog_CPP="$CPP"
2307   CPP="$ac_cv_prog_CPP"
2308 else
2309   ac_cv_prog_CPP="$CPP"
2310 fi
2311 echo "$ac_t""$CPP" 1>&6
2312
2313
2314
2315 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2316 echo "configure:2317: checking for AIX" >&5
2317 cat > conftest.$ac_ext <<EOF
2318 #line 2319 "configure"
2319 #include "confdefs.h"
2320 #ifdef _AIX
2321   yes
2322 #endif
2323
2324 EOF
2325 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2326   egrep "yes" >/dev/null 2>&1; then
2327   rm -rf conftest*
2328   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2329     Defining _ALL_SOURCE
2330 EOF
2331 cat >> confdefs.h <<\EOF
2332 #define _ALL_SOURCE 1
2333 EOF
2334 }
2335
2336 else
2337   rm -rf conftest*
2338   echo "$ac_t""no" 1>&6
2339 fi
2340 rm -f conftest*
2341
2342  
2343 cat > $srcdir/conffoo.h <<EOF
2344 #define CONFFOO 1
2345 EOF
2346 echo $ac_n "checking for a working inclusion macro""... $ac_c" 1>&6
2347 echo "configure:2348: checking for a working inclusion macro" >&5
2348 cat > conftest.$ac_ext <<EOF
2349 #line 2350 "configure"
2350 #include "confdefs.h"
2351
2352 int main() {
2353
2354 #define SMART_INCLUDE(path,file) <path/file>
2355 #define CONFFOO_H_PATH $srcdir
2356 #define CONFFOO_INCLUDE(file) SMART_INCLUDE (CONFFOO_H_PATH,file)
2357 #include CONFFOO_INCLUDE(conffoo.h)
2358
2359 ; return 0; }
2360 EOF
2361 if { (eval echo configure:2362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2362   rm -rf conftest*
2363    echo "$ac_t""direct" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2364     Defining SMART_INCLUDE_INDIRECTIONS = 0
2365 EOF
2366 cat >> confdefs.h <<\EOF
2367 #define SMART_INCLUDE_INDIRECTIONS 0
2368 EOF
2369 }
2370  
2371 else
2372   echo "configure: failed program was:" >&5
2373   cat conftest.$ac_ext >&5
2374   rm -rf conftest*
2375   cat > conftest.$ac_ext <<EOF
2376 #line 2377 "configure"
2377 #include "confdefs.h"
2378
2379 int main() {
2380
2381 #define GLUE_INCLUDE(path,file)  <##path##/##file##>
2382 #define SMART_INCLUDE(path,file) GLUE_INCLUDE(path,file)
2383 #define CONFFOO_H_PATH $srcdir
2384 #define CONFFOO_INCLUDE(file) SMART_INCLUDE(CONFFOO_H_PATH,file)
2385 #include CONFFOO_INCLUDE(conffoo.h)
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    echo "$ac_t""simple" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2392     Defining SMART_INCLUDE_INDIRECTIONS = 1
2393 EOF
2394 cat >> confdefs.h <<\EOF
2395 #define SMART_INCLUDE_INDIRECTIONS 1
2396 EOF
2397 }
2398  
2399 else
2400   echo "configure: failed program was:" >&5
2401   cat conftest.$ac_ext >&5
2402   rm -rf conftest*
2403   cat > conftest.$ac_ext <<EOF
2404 #line 2405 "configure"
2405 #include "confdefs.h"
2406
2407 int main() {
2408
2409 #define GLUE_INCLUDE_2(path,file)  <##path##/##file##>
2410 #define GLUE_INCLUDE_1(path,file) GLUE_INCLUDE_2(path,file)
2411 #define SMART_INCLUDE(path,file) GLUE_INCLUDE_1(path,file)
2412 #define CONFFOO_H_PATH $srcdir
2413 #define CONFFOO_INCLUDE(file) SMART_INCLUDE (CONFFOO_H_PATH,file)
2414 #include CONFFOO_INCLUDE(conffoo.h)
2415
2416 ; return 0; }
2417 EOF
2418 if { (eval echo configure:2419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2419   rm -rf conftest*
2420    echo "$ac_t""double" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2421     Defining SMART_INCLUDE_INDIRECTIONS = 2
2422 EOF
2423 cat >> confdefs.h <<\EOF
2424 #define SMART_INCLUDE_INDIRECTIONS 2
2425 EOF
2426 }
2427  
2428 else
2429   echo "configure: failed program was:" >&5
2430   cat conftest.$ac_ext >&5
2431   rm -rf conftest*
2432   { echo "configure: error: Cannot define a proper SMART_INCLUDE macro. Please report." 1>&2; exit 1; }
2433 fi
2434 rm -f conftest*
2435 fi
2436 rm -f conftest*
2437 fi
2438 rm -f conftest*
2439 rm -f $srcdir/conffoo.h
2440
2441
2442
2443 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2444 echo "configure:2445: checking for GNU libc" >&5
2445 cat > conftest.$ac_ext <<EOF
2446 #line 2447 "configure"
2447 #include "confdefs.h"
2448 #include <features.h>
2449 int main() {
2450
2451 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2452 #error Not a GNU libc system :-(
2453 ******* ======= ******** &&&&&&&&
2454 #endif
2455
2456 ; return 0; }
2457 EOF
2458 if { (eval echo configure:2459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2459   rm -rf conftest*
2460   have_glibc=yes
2461 else
2462   echo "configure: failed program was:" >&5
2463   cat conftest.$ac_ext >&5
2464   rm -rf conftest*
2465   have_glibc=no
2466 fi
2467 rm -f conftest*
2468 echo "$ac_t""$have_glibc" 1>&6
2469 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2470     Defining _GNU_SOURCE
2471 EOF
2472 cat >> confdefs.h <<\EOF
2473 #define _GNU_SOURCE 1
2474 EOF
2475 }
2476
2477
2478 case "$opsys" in
2479   sol2)
2480    { test "$extra_verbose" = "yes" && cat << \EOF
2481     Defining __EXTENSIONS__
2482 EOF
2483 cat >> confdefs.h <<\EOF
2484 #define __EXTENSIONS__ 1
2485 EOF
2486 }
2487
2488       if test "$os_release" -ge 55; then
2489      { test "$extra_verbose" = "yes" && cat << \EOF
2490     Defining _XOPEN_SOURCE = 500
2491 EOF
2492 cat >> confdefs.h <<\EOF
2493 #define _XOPEN_SOURCE 500
2494 EOF
2495 }
2496
2497      { test "$extra_verbose" = "yes" && cat << \EOF
2498     Defining _XOPEN_SOURCE_EXTENDED
2499 EOF
2500 cat >> confdefs.h <<\EOF
2501 #define _XOPEN_SOURCE_EXTENDED 1
2502 EOF
2503 }
2504
2505    fi ;;
2506   linux)
2507     { test "$extra_verbose" = "yes" && cat << \EOF
2508     Defining _POSIX_C_SOURCE = 199506L
2509 EOF
2510 cat >> confdefs.h <<\EOF
2511 #define _POSIX_C_SOURCE 199506L
2512 EOF
2513 }
2514
2515     { test "$extra_verbose" = "yes" && cat << \EOF
2516     Defining _XOPEN_SOURCE = 500
2517 EOF
2518 cat >> confdefs.h <<\EOF
2519 #define _XOPEN_SOURCE 500
2520 EOF
2521 }
2522
2523     { test "$extra_verbose" = "yes" && cat << \EOF
2524     Defining _XOPEN_SOURCE_EXTENDED
2525 EOF
2526 cat >> confdefs.h <<\EOF
2527 #define _XOPEN_SOURCE_EXTENDED 1
2528 EOF
2529 }
2530
2531     ;;
2532 esac
2533
2534 cat > conftest.$ac_ext <<EOF
2535 #line 2536 "configure"
2536 #include "confdefs.h"
2537 int main () {
2538 #if defined __SUNPRO_C
2539 return 11;
2540 #elif defined __DECC
2541 return 12;
2542 #else
2543 return 0;
2544 #endif
2545 }
2546 EOF
2547 if { (eval echo configure:2548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2548 then
2549   :
2550 else
2551   conftest_rc="$?"
2552   echo "configure: failed program was:" >&5
2553   cat conftest.$ac_ext >&5
2554   rm -fr conftest*
2555   case "$conftest_rc" in
2556   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2557   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2558 esac
2559 fi
2560 rm -fr conftest*
2561
2562
2563
2564
2565 echo "Extracting information from the machine- and system-dependent headers..."
2566
2567 tempcname="conftest.c"
2568
2569
2570
2571 cat > $tempcname <<EOF
2572 #define NOT_C_CODE
2573 #define C_SWITCH_SITE
2574 #define C_SWITCH_X_SITE
2575 #define LD_SWITCH_SITE
2576 #define LD_SWITCH_X_SITE
2577 #define LD_SWITCH_X_SITE_AUX
2578 #define OS_RELEASE $os_release
2579 #include "$srcdir/src/$opsysfile"
2580 #include "$srcdir/src/$machfile"
2581
2582 #ifndef LIBS_MACHINE
2583 #define LIBS_MACHINE
2584 #endif
2585 configure___ libs_machine=LIBS_MACHINE
2586
2587 #ifndef LIBS_SYSTEM
2588 #define LIBS_SYSTEM
2589 #endif
2590 configure___ libs_system=LIBS_SYSTEM
2591
2592 #ifndef LIBS_TERMCAP
2593 #define LIBS_TERMCAP
2594 #endif
2595 configure___ libs_termcap=LIBS_TERMCAP
2596
2597 #ifndef LIB_STANDARD
2598 #define LIB_STANDARD
2599 #endif
2600 configure___ libs_standard=LIB_STANDARD
2601
2602
2603 #ifndef OBJECTS_MACHINE
2604 #define OBJECTS_MACHINE
2605 #endif
2606 configure___ objects_machine=OBJECTS_MACHINE
2607
2608 #ifndef OBJECTS_SYSTEM
2609 #define OBJECTS_SYSTEM
2610 #endif
2611 configure___ objects_system=OBJECTS_SYSTEM
2612
2613
2614 #ifndef C_SWITCH_MACHINE
2615 #define C_SWITCH_MACHINE
2616 #endif
2617 configure___ c_switch_machine=C_SWITCH_MACHINE
2618
2619 #ifndef C_SWITCH_SYSTEM
2620 #define C_SWITCH_SYSTEM
2621 #endif
2622 configure___ c_switch_system=C_SWITCH_SYSTEM
2623
2624
2625 #ifndef LD_SWITCH_MACHINE
2626 #define LD_SWITCH_MACHINE
2627 #endif
2628 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2629
2630 #ifndef LD_SWITCH_SYSTEM
2631 #define LD_SWITCH_SYSTEM
2632 #endif
2633 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2634
2635
2636 #ifndef UNEXEC
2637 #define UNEXEC "unexec.o"
2638 #endif
2639 configure___ unexec=UNEXEC
2640
2641
2642 #ifndef LD_SWITCH_SHARED
2643 #define LD_SWITCH_SHARED "-c"
2644 #endif
2645 configure___ ld_switch_shared=LD_SWITCH_SHARED
2646
2647
2648 #define ORDINARY_LD "\$(CC) \$(CFLAGS)"
2649 configure___ ordinary_ld=ORDINARY_LD
2650
2651 #ifdef ORDINARY_LINK
2652 #define LD ORDINARY_LD
2653 #else /* no ORDINARY LINK */
2654 #ifdef COFF_ENCAPSULATE
2655 #define LD "\$(CC) -nostdlib"
2656 #else /* not COFF_ENCAPSULATE */
2657 #ifdef LINKER
2658 #define LD LINKER
2659 #else /* ! defined (LINKER) */
2660 #define LD "ld"
2661 #endif /* ! defined (LINKER) */
2662 #endif /* ! defined (COFF_ENCAPSULATE) */
2663 #endif /* not ORDINARY_LINK */
2664 configure___ ld=LD
2665
2666 #ifndef LIB_GCC
2667 #define LIB_GCC
2668 #endif
2669 configure___ lib_gcc=LIB_GCC
2670
2671 #ifndef LD_TEXT_START_ADDR
2672 #define LD_TEXT_START_ADDR
2673 #endif
2674 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2675
2676
2677 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2678 #ifdef NO_REMAP
2679 #ifdef COFF_ENCAPSULATE
2680 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2681 #else /* ! defined (COFF_ENCAPSULATE) */
2682 #define START_FILES "pre-crt0.o /lib/crt0.o"
2683 #endif /* ! defined (COFF_ENCAPSULATE) */
2684 #else /* ! defined (NO_REMAP) */
2685 #define START_FILES "ecrt0.o"
2686 #endif /* ! defined (NO_REMAP) */
2687 #endif /* no ORDINARY_LINK */
2688 #ifndef START_FILES
2689 #define START_FILES
2690 #endif
2691 configure___ start_files=START_FILES
2692
2693 #ifdef ORDINARY_LINK
2694 configure___ ordinary_link=yes
2695 #else
2696 configure___ ordinary_link=no
2697 #endif
2698
2699 #ifdef SYSTEM_MALLOC
2700 configure___ system_malloc=yes
2701 #else
2702 configure___ system_malloc=no
2703 #endif
2704
2705 #ifdef TERMINFO
2706 configure___ have_terminfo=yes
2707 #else
2708 configure___ have_terminfo=no
2709 #endif
2710
2711 #ifdef MAIL_USE_FLOCK
2712 configure___ mail_use_flock=yes
2713 #else
2714 configure___ mail_use_flock=no
2715 #endif
2716
2717 #ifdef MAIL_USE_LOCKF
2718 configure___ mail_use_lockf=yes
2719 #else
2720 configure___ mail_use_lockf=no
2721 #endif
2722
2723 #ifdef MAIL_USE_LOCKING
2724 configure___ mail_use_locking=yes
2725 #else
2726 configure___ mail_use_locking=no
2727 #endif
2728
2729 #ifdef HAVE_WIN32_PROCESSES
2730 configure___ win32_processes=yes
2731 #else
2732 configure___ win32_processes=no
2733 #endif
2734
2735 EOF
2736
2737 CPP=`eval "echo $CPP $CPPFLAGS"`
2738 eval `$CPP -Isrc $tempcname \
2739         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2740
2741 rm $tempcname
2742
2743 if test "$pdump" = "yes"; then
2744   ordinary_link="yes"
2745   ld="${ordinary_ld}"
2746   start_files=
2747   libs_standard=
2748   unexec=
2749   lib_gcc=      
2750 fi
2751
2752 test "$extra_verbose" = "yes" && \
2753   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 ""
2754
2755 case "$opsys" in mingw*) mingw_include=`eval "gcc -print-file-name=libc.a"` ;
2756         mingw_include=`eval "dirname $mingw_include"` ;
2757         mingw_include="-I$mingw_include/../include/mingw32" ;
2758         c_switch_system="$c_switch_system $mingw_include" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$mingw_include\" to \$c_switch_system"; fi ;;
2759 esac
2760
2761 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2762
2763 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2764
2765 if test "$cflags_specified" = "no"; then
2766       if   test "$GCC" = "yes"; then
2767     CFLAGS="-g -O3 -Wall -Wno-switch -Wpointer-arith -Winline -Wmissing-prototypes -Wshadow"
2768               elif test "$__SUNPRO_C" = "yes"; then
2769     case "$opsys" in
2770       sol2    ) CFLAGS="-v -xO4" ;;
2771       sunos4* ) CFLAGS="-xO2";;
2772     esac
2773   elif test "$__DECC" = "yes"; then
2774     CFLAGS="-O3"
2775   elif test "$CC" = "xlc"; then
2776     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2777     else
2778     CFLAGS="-O" ;  fi
2779 fi
2780
2781 if test "$GCC" = "yes"; then
2782 echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6
2783 echo "configure:2784: checking for buggy gcc versions" >&5
2784 GCC_VERSION=`$CC --version`
2785 case `uname -s`:`uname -m`:$GCC_VERSION in
2786                     *:sun4*:2.8.1|*:sun4*:egcs-2.90.*)
2787                         case "$CFLAGS" in
2788             *-O2*|*-O3*)
2789                 case "$CFLAGS" in
2790                     *-fno-schedule-insns*) ;;
2791                     *)
2792                         echo "$ac_t""Yes" 1>&6
2793                         echo "configure: warning: Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures" 1>&2
2794                         echo "configure: warning: without also using -fno-schedule-insns." 1>&2
2795                         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2796                         ;;
2797                 esac
2798                 ;;
2799         esac
2800         ;;
2801                     Linux:alpha:egcs-2.91.*)
2802         echo "$ac_t""Yes" 1>&6
2803         echo "configure: warning: There have been reports of egcs-1.1 not compiling XEmacs correctly on" 1>&2
2804         echo "configure: warning: Alpha Linux.  There have also been reports that egcs-1.0.3a is O.K." 1>&2
2805         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2806         ;;
2807     *:i*86*:2.7.2*)
2808         case "$GCC_VERSION" in
2809             2.7.2)
2810                 case "$CFLAGS" in
2811                     *-O2*|*-O3*)
2812                         case "$CFLAGS" in
2813                             *-fno-strength-reduce*) ;;
2814                             *)
2815                                 echo "$ac_t""Yes" 1>&6
2816                                 echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
2817                                 echo "configure: warning: -fno-strength-reduce." 1>&2
2818                                 { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2819                                 ;;
2820                         esac
2821                         ;;
2822                 esac
2823                 ;;
2824         esac
2825         case "$CFLAGS" in
2826          *-fno-caller-saves*) ;;
2827          *)
2828             echo "$ac_t""Yes" 1>&6
2829             echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
2830             echo "configure: warning: -fno-caller-saves." 1>&2
2831             { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
2832             ;;
2833         esac
2834         ;;
2835 esac
2836 fi
2837 echo "$ac_t""No" 1>&6
2838
2839
2840 if test "$GCC" = "yes"; then
2841   set x $ld_switch_system; shift; ld_switch_system=""
2842   while test -n "$1"; do
2843     case $1 in
2844       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2845       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2846       -Xlinker* ) ;;
2847       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2848     esac
2849     shift
2850   done
2851 fi
2852
2853 if test "$GCC" = "yes"; then
2854   set x $ld_switch_machine; shift; ld_switch_machine=""
2855   while test -n "$1"; do
2856     case $1 in
2857       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2858       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2859       -Xlinker* ) ;;
2860       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2861     esac
2862     shift
2863   done
2864 fi
2865
2866 if test "$GCC" = "yes"; then
2867   set x $LDFLAGS; shift; LDFLAGS=""
2868   while test -n "$1"; do
2869     case $1 in
2870       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2871       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2872       -Xlinker* ) ;;
2873       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2874     esac
2875     shift
2876   done
2877 fi
2878
2879 if test "$GCC" = "yes"; then
2880   set x $ld_call_shared; shift; ld_call_shared=""
2881   while test -n "$1"; do
2882     case $1 in
2883       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2884       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2885       -Xlinker* ) ;;
2886       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2887     esac
2888     shift
2889   done
2890 fi
2891
2892 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2893    echo "    xemacs will be linked with \"$objects_machine\""
2894  fi
2895 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2896    echo "    xemacs will be linked with \"$objects_system\""
2897  fi
2898 test -n "$unexec"          && test ! "$pdump" = "yes" && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2899    echo "    xemacs will be linked with \"$unexec\""
2900  fi
2901 test "$pdump" = "yes" && extra_objs="$extra_objs dumper.o" &&  if test "$extra_verbose" = "yes"; then
2902    echo "    xemacs will be linked with \"dumper.o\""
2903  fi
2904
2905 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2906 echo "configure:2907: checking for dynodump" >&5
2907 if test "$unexec" != "unexsol2.o"; then
2908   echo "$ac_t""no" 1>&6
2909 else
2910   echo "$ac_t""yes" 1>&6
2911   { test "$extra_verbose" = "yes" && cat << \EOF
2912     Defining DYNODUMP
2913 EOF
2914 cat >> confdefs.h <<\EOF
2915 #define DYNODUMP 1
2916 EOF
2917 }
2918
2919   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2920   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2921   case "$machine" in
2922     sparc   ) dynodump_arch=sparc ;;
2923     *86*    ) dynodump_arch=i386  ;;
2924     powerpc ) dynodump_arch=ppc   ;;
2925   esac
2926     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
2927 fi
2928
2929
2930 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2931
2932 if test "$unexec" = "unexaix.o"; then
2933   if   test "$dynamic" = "no"; then
2934   start_flags="-Wl,-bnso,-bnodelcsect"
2935   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2936   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2937     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2938   done
2939   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2940     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2941   done
2942   
2943 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2944 echo "configure:2945: checking for terminateAndUnload in -lC" >&5
2945 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2946
2947 xe_check_libs=" -lC "
2948 cat > conftest.$ac_ext <<EOF
2949 #line 2950 "configure"
2950 #include "confdefs.h"
2951 /* Override any gcc2 internal prototype to avoid an error.  */
2952 /* We use char because int might match the return type of a gcc2
2953     builtin and then its argument prototype would still apply.  */
2954 char terminateAndUnload();
2955
2956 int main() {
2957 terminateAndUnload()
2958 ; return 0; }
2959 EOF
2960 if { (eval echo configure:2961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2961   rm -rf conftest*
2962   eval "ac_cv_lib_$ac_lib_var=yes"
2963 else
2964   echo "configure: failed program was:" >&5
2965   cat conftest.$ac_ext >&5
2966   rm -rf conftest*
2967   eval "ac_cv_lib_$ac_lib_var=no"
2968 fi
2969 rm -f conftest*
2970 xe_check_libs=""
2971
2972 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2973   echo "$ac_t""yes" 1>&6
2974   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2975 else
2976   echo "$ac_t""no" 1>&6
2977 fi
2978
2979
2980   fi
2981 elif test -n "$ld_text_start_addr"; then
2982   start_flags="-T $ld_text_start_addr -e __start"
2983 fi
2984
2985
2986
2987
2988 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2989  test -z "$linker" &&  linker='$(CC) -nostdlib'
2990  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2991 fi
2992 test "$GCC" != "yes" && lib_gcc=
2993
2994
2995
2996
2997
2998 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2999 if test -n "$site_libraries"; then
3000   for arg in $site_libraries; do
3001     case "$arg" in
3002      -* ) ;;
3003      * ) test -d "$arg" || \
3004            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
3005        arg="-L${arg}" ;;
3006     esac
3007     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
3008   done
3009 fi
3010
3011 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3012 if test -n "$site_includes"; then
3013   for arg in $site_includes; do
3014     case "$arg" in
3015       -* ) ;;
3016       * ) test -d "$arg" || \
3017            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
3018       arg="-I${arg}" ;;
3019     esac
3020     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
3021   done
3022 fi
3023
3024 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3025 if test -n "$site_prefixes"; then
3026   for dir in $site_prefixes; do
3027     lib_dir="${dir}/lib"
3028     inc_dir="${dir}/include"
3029     if test ! -d "$dir"; then
3030       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
3031     elif test ! -d "$lib_dir"; then
3032       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
3033     else
3034       if test -d "$inc_dir"; then
3035         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
3036       fi
3037       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
3038     fi
3039   done
3040 fi
3041
3042
3043 for dir in "/usr/ccs/lib"; do
3044   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
3045 done
3046
3047 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
3048 if test -n "$site_runtime_libraries"; then
3049   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
3050   export LD_RUN_PATH
3051 fi
3052
3053
3054
3055
3056
3057 if test -n "$add_runtime_path"; then :;
3058 elif test "$dynamic" = "no"; then add_runtime_path=no
3059 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
3060 else case "$opsys" in
3061        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
3062        * ) add_runtime_path=no ;;
3063      esac
3064 fi
3065
3066 if test "$add_runtime_path" = "yes"; then
3067       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
3068 echo "configure:3069: checking "for runtime libraries flag"" >&5
3069   case "$opsys" in
3070     sol2 ) dash_r="-R" ;;
3071     decosf* | linux* | irix*) dash_r="-rpath " ;;
3072     *)
3073       dash_r=""
3074       for try_dash_r in "-R" "-R " "-rpath "; do
3075         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
3076         
3077 if test "$GCC" = "yes"; then
3078   set x $xe_check_libs; shift; xe_check_libs=""
3079   while test -n "$1"; do
3080     case $1 in
3081       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
3082       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
3083       -Xlinker* ) ;;
3084       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
3085     esac
3086     shift
3087   done
3088 fi
3089         cat > conftest.$ac_ext <<EOF
3090 #line 3091 "configure"
3091 #include "confdefs.h"
3092
3093 int main() {
3094
3095 ; return 0; }
3096 EOF
3097 if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3098   rm -rf conftest*
3099   dash_r="$try_dash_r"
3100 else
3101   echo "configure: failed program was:" >&5
3102   cat conftest.$ac_ext >&5
3103 fi
3104 rm -f conftest*
3105         xe_check_libs=""
3106         test -n "$dash_r" && break
3107       done ;;
3108   esac
3109   if test -n "$dash_r";
3110     then echo "$ac_t"""\"${dash_r}\""" 1>&6
3111     else echo "$ac_t""NONE" 1>&6
3112   fi
3113 fi
3114
3115 xe_add_unique_runpath_dir='
3116   xe_add_p=yes
3117   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
3118   done
3119   if test "$xe_add_p" = "yes"; then
3120     test -n "$runpath" && runpath="${runpath}:"
3121     runpath="${runpath}${xe_runpath_dir}"
3122     runpath_dirs="$runpath_dirs $xe_runpath_dir"
3123   fi'
3124
3125
3126
3127
3128 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
3129     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
3130   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
3131   
3132         runpath="" runpath_dirs=""
3133   if test -n "$LD_RUN_PATH"; then
3134     runpath="$LD_RUN_PATH"
3135   elif test "$GCC" = "yes"; then
3136         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
3137     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
3138     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
3139     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
3140       case "$arg" in P,* | -L* | -R* )
3141         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
3142           {
3143 xe_runpath_dir="$dir"
3144   test "$xe_runpath_dir" != "/lib"     -a \
3145         "$xe_runpath_dir" != "/usr/lib" -a \
3146         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
3147   eval "$xe_add_unique_runpath_dir"
3148 }
3149         done ;;
3150       esac
3151     done
3152     ld_switch_run="$ld_switch_run_save"
3153     rm -f conftest*
3154   else
3155         for arg in $ld_switch_site $ld_switch_x_site; do
3156       case "$arg" in -L*) {
3157 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
3158   test "$xe_runpath_dir" != "/lib"     -a \
3159         "$xe_runpath_dir" != "/usr/lib" -a \
3160         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
3161   eval "$xe_add_unique_runpath_dir"
3162 };; esac
3163     done
3164         if test "$opsys $need_motif" = "sol2 yes"; then
3165       xe_runpath_dir="/opt/SUNWdt/lib";
3166       eval "$xe_add_unique_runpath_dir";
3167     fi
3168   fi 
3169   if test -n "$runpath"; then
3170     ld_switch_run="${dash_r}${runpath}"
3171     
3172 if test "$GCC" = "yes"; then
3173   set x $ld_switch_run; shift; ld_switch_run=""
3174   while test -n "$1"; do
3175     case $1 in
3176       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
3177       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
3178       -Xlinker* ) ;;
3179       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
3180     esac
3181     shift
3182   done
3183 fi
3184     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
3185   fi
3186 fi
3187
3188
3189
3190
3191 GNU_MALLOC=yes
3192 if test "$with_dlmalloc" != "no"; then
3193         doug_lea_malloc=yes
3194 else
3195         doug_lea_malloc=no
3196 fi
3197 after_morecore_hook_exists=yes
3198 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
3199 echo "configure:3200: checking for malloc_set_state" >&5
3200
3201 cat > conftest.$ac_ext <<EOF
3202 #line 3203 "configure"
3203 #include "confdefs.h"
3204 /* System header to define __stub macros and hopefully few prototypes,
3205     which can conflict with char malloc_set_state(); below.  */
3206 #include <assert.h>
3207 /* Override any gcc2 internal prototype to avoid an error.  */
3208 /* We use char because int might match the return type of a gcc2
3209     builtin and then its argument prototype would still apply.  */
3210 char malloc_set_state();
3211
3212 int main() {
3213
3214 /* The GNU C library defines this for functions which it implements
3215     to always fail with ENOSYS.  Some functions are actually named
3216     something starting with __ and the normal name is an alias.  */
3217 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
3218 choke me
3219 #else
3220 malloc_set_state();
3221 #endif
3222
3223 ; return 0; }
3224 EOF
3225 if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3226   rm -rf conftest*
3227   eval "ac_cv_func_malloc_set_state=yes"
3228 else
3229   echo "configure: failed program was:" >&5
3230   cat conftest.$ac_ext >&5
3231   rm -rf conftest*
3232   eval "ac_cv_func_malloc_set_state=no"
3233 fi
3234 rm -f conftest*
3235
3236 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
3237   echo "$ac_t""yes" 1>&6
3238   :
3239 else
3240   echo "$ac_t""no" 1>&6
3241 doug_lea_malloc=no
3242 fi
3243
3244 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
3245 echo "configure:3246: checking whether __after_morecore_hook exists" >&5
3246 cat > conftest.$ac_ext <<EOF
3247 #line 3248 "configure"
3248 #include "confdefs.h"
3249 extern void (* __after_morecore_hook)();
3250 int main() {
3251 __after_morecore_hook = 0
3252 ; return 0; }
3253 EOF
3254 if { (eval echo configure:3255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3255   rm -rf conftest*
3256   echo "$ac_t""yes" 1>&6
3257 else
3258   echo "configure: failed program was:" >&5
3259   cat conftest.$ac_ext >&5
3260   rm -rf conftest*
3261   echo "$ac_t""no" 1>&6
3262    after_morecore_hook_exists=no
3263 fi
3264 rm -f conftest*
3265 if test "$system_malloc" = "yes" ; then
3266   GNU_MALLOC=no
3267   GNU_MALLOC_reason="
3268     - The GNU allocators don't work with this system configuration."
3269 elif test "$with_system_malloc" = "yes" ; then
3270   GNU_MALLOC=no
3271   GNU_MALLOC_reason="
3272     - User chose not to use GNU allocators."
3273 elif test "$with_debug_malloc" = "yes" ; then
3274   GNU_MALLOC=no
3275   GNU_MALLOC_reason="
3276     - User chose to use Debugging Malloc."
3277 fi
3278
3279 if test "$doug_lea_malloc" = "yes" -a "$GNU_MALLOC" = "yes" ; then
3280   GNU_MALLOC_reason="
3281     - Using Doug Lea's new malloc from the GNU C Library."
3282   { test "$extra_verbose" = "yes" && cat << \EOF
3283     Defining DOUG_LEA_MALLOC
3284 EOF
3285 cat >> confdefs.h <<\EOF
3286 #define DOUG_LEA_MALLOC 1
3287 EOF
3288 }
3289
3290   if test "$after_morecore_hook_exists" = "no" ; then
3291     GNU_MALLOC_reason="
3292     - Using Doug Lea's new malloc from the Linux C Library."
3293     { test "$extra_verbose" = "yes" && cat << \EOF
3294     Defining _NO_MALLOC_WARNING_
3295 EOF
3296 cat >> confdefs.h <<\EOF
3297 #define _NO_MALLOC_WARNING_ 1
3298 EOF
3299 }
3300
3301   fi
3302 fi
3303
3304
3305
3306
3307 # Extract the first word of "ranlib", so it can be a program name with args.
3308 set dummy ranlib; ac_word=$2
3309 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3310 echo "configure:3311: checking for $ac_word" >&5
3311
3312 if test -n "$RANLIB"; then
3313   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3314 else
3315   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3316   ac_dummy="$PATH"
3317   for ac_dir in $ac_dummy; do
3318     test -z "$ac_dir" && ac_dir=.
3319     if test -f $ac_dir/$ac_word; then
3320       ac_cv_prog_RANLIB="ranlib"
3321       break
3322     fi
3323   done
3324   IFS="$ac_save_ifs"
3325   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3326 fi
3327 RANLIB="$ac_cv_prog_RANLIB"
3328 if test -n "$RANLIB"; then
3329   echo "$ac_t""$RANLIB" 1>&6
3330 else
3331   echo "$ac_t""no" 1>&6
3332 fi
3333
3334 ac_aux_dir=
3335 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3336   if test -f $ac_dir/install-sh; then
3337     ac_aux_dir=$ac_dir
3338     ac_install_sh="$ac_aux_dir/install-sh -c"
3339     break
3340   elif test -f $ac_dir/install.sh; then
3341     ac_aux_dir=$ac_dir
3342     ac_install_sh="$ac_aux_dir/install.sh -c"
3343     break
3344   fi
3345 done
3346 if test -z "$ac_aux_dir"; then
3347   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3348 fi
3349 ac_config_guess=$ac_aux_dir/config.guess
3350 ac_config_sub=$ac_aux_dir/config.sub
3351 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3352
3353 # Find a good install program.  We prefer a C program (faster),
3354 # so one script is as good as another.  But avoid the broken or
3355 # incompatible versions:
3356 # SysV /etc/install, /usr/sbin/install
3357 # SunOS /usr/etc/install
3358 # IRIX /sbin/install
3359 # AIX /bin/install
3360 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3361 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3362 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3363 # ./install, which can be erroneously created by make from ./install.sh.
3364 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3365 echo "configure:3366: checking for a BSD compatible install" >&5
3366 if test -z "$INSTALL"; then
3367
3368   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3369   for ac_dir in $PATH; do
3370     # Account for people who put trailing slashes in PATH elements.
3371     case "$ac_dir/" in
3372     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3373     *)
3374       # OSF1 and SCO ODT 3.0 have their own names for install.
3375       # Don't use installbsd from OSF since it installs stuff as root
3376       # by default.
3377       for ac_prog in ginstall scoinst install; do
3378         if test -f $ac_dir/$ac_prog; then
3379           if test $ac_prog = install &&
3380             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3381             # AIX install.  It has an incompatible calling convention.
3382             :
3383           else
3384             ac_cv_path_install="$ac_dir/$ac_prog -c"
3385             break 2
3386           fi
3387         fi
3388       done
3389       ;;
3390     esac
3391   done
3392   IFS="$ac_save_IFS"
3393
3394   if test "${ac_cv_path_install+set}" = set; then
3395     INSTALL="$ac_cv_path_install"
3396   else
3397     # As a last resort, use the slow shell script.  We don't cache a
3398     # path for INSTALL within a source directory, because that will
3399     # break other packages using the cache if that directory is
3400     # removed, or if the path is relative.
3401     INSTALL="$ac_install_sh"
3402   fi
3403 fi
3404 echo "$ac_t""$INSTALL" 1>&6
3405
3406 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3407 # It thinks the first close brace ends the variable substitution.
3408 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3409
3410 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3411
3412 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3413
3414 for ac_prog in 'bison -y' byacc
3415 do
3416 # Extract the first word of "$ac_prog", so it can be a program name with args.
3417 set dummy $ac_prog; ac_word=$2
3418 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3419 echo "configure:3420: checking for $ac_word" >&5
3420
3421 if test -n "$YACC"; then
3422   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3423 else
3424   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3425   ac_dummy="$PATH"
3426   for ac_dir in $ac_dummy; do
3427     test -z "$ac_dir" && ac_dir=.
3428     if test -f $ac_dir/$ac_word; then
3429       ac_cv_prog_YACC="$ac_prog"
3430       break
3431     fi
3432   done
3433   IFS="$ac_save_ifs"
3434 fi
3435 YACC="$ac_cv_prog_YACC"
3436 if test -n "$YACC"; then
3437   echo "$ac_t""$YACC" 1>&6
3438 else
3439   echo "$ac_t""no" 1>&6
3440 fi
3441
3442 test -n "$YACC" && break
3443 done
3444 test -n "$YACC" || YACC="yacc"
3445
3446
3447 for ac_hdr in   a.out.h   cygwin/version.h   fcntl.h   inttypes.h   libgen.h   locale.h   mach/mach.h   sys/param.h   sys/pstat.h   sys/stropts.h   sys/time.h   sys/timeb.h   sys/un.h   kstat.h   ulimit.h   unistd.h   utime.h 
3448 do
3449 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3450 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3451 echo "configure:3452: checking for $ac_hdr" >&5
3452
3453 cat > conftest.$ac_ext <<EOF
3454 #line 3455 "configure"
3455 #include "confdefs.h"
3456 #include <$ac_hdr>
3457 EOF
3458 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3459 { (eval echo configure:3460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3460 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3461 if test -z "$ac_err"; then
3462   rm -rf conftest*
3463   eval "ac_cv_header_$ac_safe=yes"
3464 else
3465   echo "$ac_err" >&5
3466   echo "configure: failed program was:" >&5
3467   cat conftest.$ac_ext >&5
3468   rm -rf conftest*
3469   eval "ac_cv_header_$ac_safe=no"
3470 fi
3471 rm -f conftest*
3472 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3473   echo "$ac_t""yes" 1>&6
3474     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3475   { test "$extra_verbose" = "yes" && cat << EOF
3476     Defining $ac_tr_hdr
3477 EOF
3478 cat >> confdefs.h <<EOF
3479 #define $ac_tr_hdr 1
3480 EOF
3481 }
3482  
3483 else
3484   echo "$ac_t""no" 1>&6
3485 fi
3486 done
3487
3488 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3489 echo "configure:3490: checking for sys/wait.h that is POSIX.1 compatible" >&5
3490
3491 cat > conftest.$ac_ext <<EOF
3492 #line 3493 "configure"
3493 #include "confdefs.h"
3494 #include <sys/types.h>
3495 #include <sys/wait.h>
3496 #ifndef WEXITSTATUS
3497 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3498 #endif
3499 #ifndef WIFEXITED
3500 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3501 #endif
3502 int main() {
3503 int s;
3504 wait (&s);
3505 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3506 ; return 0; }
3507 EOF
3508 if { (eval echo configure:3509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3509   rm -rf conftest*
3510   ac_cv_header_sys_wait_h=yes
3511 else
3512   echo "configure: failed program was:" >&5
3513   cat conftest.$ac_ext >&5
3514   rm -rf conftest*
3515   ac_cv_header_sys_wait_h=no
3516 fi
3517 rm -f conftest*
3518
3519 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3520 if test $ac_cv_header_sys_wait_h = yes; then
3521   { test "$extra_verbose" = "yes" && cat << \EOF
3522     Defining HAVE_SYS_WAIT_H
3523 EOF
3524 cat >> confdefs.h <<\EOF
3525 #define HAVE_SYS_WAIT_H 1
3526 EOF
3527 }
3528
3529 fi
3530
3531 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3532 echo "configure:3533: checking for ANSI C header files" >&5
3533
3534 cat > conftest.$ac_ext <<EOF
3535 #line 3536 "configure"
3536 #include "confdefs.h"
3537 #include <stdlib.h>
3538 #include <stdarg.h>
3539 #include <string.h>
3540 #include <float.h>
3541 EOF
3542 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3543 { (eval echo configure:3544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3544 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3545 if test -z "$ac_err"; then
3546   rm -rf conftest*
3547   ac_cv_header_stdc=yes
3548 else
3549   echo "$ac_err" >&5
3550   echo "configure: failed program was:" >&5
3551   cat conftest.$ac_ext >&5
3552   rm -rf conftest*
3553   ac_cv_header_stdc=no
3554 fi
3555 rm -f conftest*
3556
3557 if test $ac_cv_header_stdc = yes; then
3558   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3559 cat > conftest.$ac_ext <<EOF
3560 #line 3561 "configure"
3561 #include "confdefs.h"
3562 #include <string.h>
3563 EOF
3564 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3565   egrep "memchr" >/dev/null 2>&1; then
3566   :
3567 else
3568   rm -rf conftest*
3569   ac_cv_header_stdc=no
3570 fi
3571 rm -f conftest*
3572
3573 fi
3574
3575 if test $ac_cv_header_stdc = yes; then
3576   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3577 cat > conftest.$ac_ext <<EOF
3578 #line 3579 "configure"
3579 #include "confdefs.h"
3580 #include <stdlib.h>
3581 EOF
3582 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3583   egrep "free" >/dev/null 2>&1; then
3584   :
3585 else
3586   rm -rf conftest*
3587   ac_cv_header_stdc=no
3588 fi
3589 rm -f conftest*
3590
3591 fi
3592
3593 if test $ac_cv_header_stdc = yes; then
3594   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3595 cat > conftest.$ac_ext <<EOF
3596 #line 3597 "configure"
3597 #include "confdefs.h"
3598 #include <ctype.h>
3599 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3600 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3601 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3602 int main () { int i; for (i = 0; i < 256; i++)
3603 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3604 exit (0); }
3605
3606 EOF
3607 if { (eval echo configure:3608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3608 then
3609   :
3610 else
3611   conftest_rc="$?"
3612   echo "configure: failed program was:" >&5
3613   cat conftest.$ac_ext >&5
3614   rm -fr conftest*
3615   ac_cv_header_stdc=no
3616 fi
3617 rm -fr conftest*
3618 fi
3619
3620 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3621 if test $ac_cv_header_stdc = yes; then
3622   { test "$extra_verbose" = "yes" && cat << \EOF
3623     Defining STDC_HEADERS
3624 EOF
3625 cat >> confdefs.h <<\EOF
3626 #define STDC_HEADERS 1
3627 EOF
3628 }
3629
3630 fi
3631
3632 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3633 echo "configure:3634: checking whether time.h and sys/time.h may both be included" >&5
3634
3635 cat > conftest.$ac_ext <<EOF
3636 #line 3637 "configure"
3637 #include "confdefs.h"
3638 #include <sys/types.h>
3639 #include <sys/time.h>
3640 #include <time.h>
3641 int main() {
3642 struct tm *tp;
3643 ; return 0; }
3644 EOF
3645 if { (eval echo configure:3646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3646   rm -rf conftest*
3647   ac_cv_header_time=yes
3648 else
3649   echo "configure: failed program was:" >&5
3650   cat conftest.$ac_ext >&5
3651   rm -rf conftest*
3652   ac_cv_header_time=no
3653 fi
3654 rm -f conftest*
3655
3656 echo "$ac_t""$ac_cv_header_time" 1>&6
3657 if test $ac_cv_header_time = yes; then
3658   { test "$extra_verbose" = "yes" && cat << \EOF
3659     Defining TIME_WITH_SYS_TIME
3660 EOF
3661 cat >> confdefs.h <<\EOF
3662 #define TIME_WITH_SYS_TIME 1
3663 EOF
3664 }
3665
3666 fi
3667
3668 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3669 echo "configure:3670: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3670
3671 cat > conftest.$ac_ext <<EOF
3672 #line 3673 "configure"
3673 #include "confdefs.h"
3674 #include <sys/types.h>
3675 #include <signal.h>
3676 /* NetBSD declares sys_siglist in unistd.h.  */
3677 #ifdef HAVE_UNISTD_H
3678 #include <unistd.h>
3679 #endif
3680 int main() {
3681 char *msg = *(sys_siglist + 1);
3682 ; return 0; }
3683 EOF
3684 if { (eval echo configure:3685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3685   rm -rf conftest*
3686   ac_cv_decl_sys_siglist=yes
3687 else
3688   echo "configure: failed program was:" >&5
3689   cat conftest.$ac_ext >&5
3690   rm -rf conftest*
3691   ac_cv_decl_sys_siglist=no
3692 fi
3693 rm -f conftest*
3694
3695 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3696 if test $ac_cv_decl_sys_siglist = yes; then
3697   { test "$extra_verbose" = "yes" && cat << \EOF
3698     Defining SYS_SIGLIST_DECLARED
3699 EOF
3700 cat >> confdefs.h <<\EOF
3701 #define SYS_SIGLIST_DECLARED 1
3702 EOF
3703 }
3704
3705 fi
3706
3707
3708 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3709 echo "configure:3710: checking for struct utimbuf" >&5
3710 cat > conftest.$ac_ext <<EOF
3711 #line 3712 "configure"
3712 #include "confdefs.h"
3713 #ifdef TIME_WITH_SYS_TIME
3714 #include <sys/time.h>
3715 #include <time.h>
3716 #else
3717 #ifdef HAVE_SYS_TIME_H
3718 #include <sys/time.h>
3719 #else
3720 #include <time.h>
3721 #endif
3722 #endif
3723 #ifdef HAVE_UTIME_H
3724 #include <utime.h>
3725 #endif
3726 int main() {
3727 static struct utimbuf x; x.actime = x.modtime;
3728 ; return 0; }
3729 EOF
3730 if { (eval echo configure:3731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3731   rm -rf conftest*
3732   echo "$ac_t""yes" 1>&6
3733    { test "$extra_verbose" = "yes" && cat << \EOF
3734     Defining HAVE_STRUCT_UTIMBUF
3735 EOF
3736 cat >> confdefs.h <<\EOF
3737 #define HAVE_STRUCT_UTIMBUF 1
3738 EOF
3739 }
3740
3741 else
3742   echo "configure: failed program was:" >&5
3743   cat conftest.$ac_ext >&5
3744   rm -rf conftest*
3745   echo "$ac_t""no" 1>&6
3746 fi
3747 rm -f conftest*
3748
3749 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3750 echo "configure:3751: checking return type of signal handlers" >&5
3751
3752 cat > conftest.$ac_ext <<EOF
3753 #line 3754 "configure"
3754 #include "confdefs.h"
3755 #include <sys/types.h>
3756 #include <signal.h>
3757 #ifdef signal
3758 #undef signal
3759 #endif
3760 #ifdef __cplusplus
3761 extern "C" void (*signal (int, void (*)(int)))(int);
3762 #else
3763 void (*signal ()) ();
3764 #endif
3765
3766 int main() {
3767 int i;
3768 ; return 0; }
3769 EOF
3770 if { (eval echo configure:3771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3771   rm -rf conftest*
3772   ac_cv_type_signal=void
3773 else
3774   echo "configure: failed program was:" >&5
3775   cat conftest.$ac_ext >&5
3776   rm -rf conftest*
3777   ac_cv_type_signal=int
3778 fi
3779 rm -f conftest*
3780
3781 echo "$ac_t""$ac_cv_type_signal" 1>&6
3782 { test "$extra_verbose" = "yes" && cat << EOF
3783     Defining RETSIGTYPE = $ac_cv_type_signal
3784 EOF
3785 cat >> confdefs.h <<EOF
3786 #define RETSIGTYPE $ac_cv_type_signal
3787 EOF
3788 }
3789
3790
3791 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3792 echo "configure:3793: checking for size_t" >&5
3793
3794 cat > conftest.$ac_ext <<EOF
3795 #line 3796 "configure"
3796 #include "confdefs.h"
3797 #include <sys/types.h>
3798 #if STDC_HEADERS
3799 #include <stdlib.h>
3800 #include <stddef.h>
3801 #endif
3802 EOF
3803 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3804   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3805   rm -rf conftest*
3806   ac_cv_type_size_t=yes
3807 else
3808   rm -rf conftest*
3809   ac_cv_type_size_t=no
3810 fi
3811 rm -f conftest*
3812
3813 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3814 if test $ac_cv_type_size_t = no; then
3815   { test "$extra_verbose" = "yes" && cat << \EOF
3816     Defining size_t = unsigned
3817 EOF
3818 cat >> confdefs.h <<\EOF
3819 #define size_t unsigned
3820 EOF
3821 }
3822
3823 fi
3824
3825 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3826 echo "configure:3827: checking for pid_t" >&5
3827
3828 cat > conftest.$ac_ext <<EOF
3829 #line 3830 "configure"
3830 #include "confdefs.h"
3831 #include <sys/types.h>
3832 #if STDC_HEADERS
3833 #include <stdlib.h>
3834 #include <stddef.h>
3835 #endif
3836 EOF
3837 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3838   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3839   rm -rf conftest*
3840   ac_cv_type_pid_t=yes
3841 else
3842   rm -rf conftest*
3843   ac_cv_type_pid_t=no
3844 fi
3845 rm -f conftest*
3846
3847 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3848 if test $ac_cv_type_pid_t = no; then
3849   { test "$extra_verbose" = "yes" && cat << \EOF
3850     Defining pid_t = int
3851 EOF
3852 cat >> confdefs.h <<\EOF
3853 #define pid_t int
3854 EOF
3855 }
3856
3857 fi
3858
3859 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3860 echo "configure:3861: checking for uid_t in sys/types.h" >&5
3861
3862 cat > conftest.$ac_ext <<EOF
3863 #line 3864 "configure"
3864 #include "confdefs.h"
3865 #include <sys/types.h>
3866 EOF
3867 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3868   egrep "uid_t" >/dev/null 2>&1; then
3869   rm -rf conftest*
3870   ac_cv_type_uid_t=yes
3871 else
3872   rm -rf conftest*
3873   ac_cv_type_uid_t=no
3874 fi
3875 rm -f conftest*
3876
3877
3878 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3879 if test $ac_cv_type_uid_t = no; then
3880   { test "$extra_verbose" = "yes" && cat << \EOF
3881     Defining uid_t = int
3882 EOF
3883 cat >> confdefs.h <<\EOF
3884 #define uid_t int
3885 EOF
3886 }
3887
3888   { test "$extra_verbose" = "yes" && cat << \EOF
3889     Defining gid_t = int
3890 EOF
3891 cat >> confdefs.h <<\EOF
3892 #define gid_t int
3893 EOF
3894 }
3895
3896 fi
3897
3898 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3899 echo "configure:3900: checking for mode_t" >&5
3900
3901 cat > conftest.$ac_ext <<EOF
3902 #line 3903 "configure"
3903 #include "confdefs.h"
3904 #include <sys/types.h>
3905 #if STDC_HEADERS
3906 #include <stdlib.h>
3907 #include <stddef.h>
3908 #endif
3909 EOF
3910 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3911   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3912   rm -rf conftest*
3913   ac_cv_type_mode_t=yes
3914 else
3915   rm -rf conftest*
3916   ac_cv_type_mode_t=no
3917 fi
3918 rm -f conftest*
3919
3920 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3921 if test $ac_cv_type_mode_t = no; then
3922   { test "$extra_verbose" = "yes" && cat << \EOF
3923     Defining mode_t = int
3924 EOF
3925 cat >> confdefs.h <<\EOF
3926 #define mode_t int
3927 EOF
3928 }
3929
3930 fi
3931
3932 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3933 echo "configure:3934: checking for off_t" >&5
3934
3935 cat > conftest.$ac_ext <<EOF
3936 #line 3937 "configure"
3937 #include "confdefs.h"
3938 #include <sys/types.h>
3939 #if STDC_HEADERS
3940 #include <stdlib.h>
3941 #include <stddef.h>
3942 #endif
3943 EOF
3944 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3945   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3946   rm -rf conftest*
3947   ac_cv_type_off_t=yes
3948 else
3949   rm -rf conftest*
3950   ac_cv_type_off_t=no
3951 fi
3952 rm -f conftest*
3953
3954 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3955 if test $ac_cv_type_off_t = no; then
3956   { test "$extra_verbose" = "yes" && cat << \EOF
3957     Defining off_t = long
3958 EOF
3959 cat >> confdefs.h <<\EOF
3960 #define off_t long
3961 EOF
3962 }
3963
3964 fi
3965
3966 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
3967 echo "configure:3968: checking for ssize_t" >&5
3968
3969 cat > conftest.$ac_ext <<EOF
3970 #line 3971 "configure"
3971 #include "confdefs.h"
3972 #include <sys/types.h>
3973 #if STDC_HEADERS
3974 #include <stdlib.h>
3975 #include <stddef.h>
3976 #endif
3977 EOF
3978 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3979   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3980   rm -rf conftest*
3981   ac_cv_type_ssize_t=yes
3982 else
3983   rm -rf conftest*
3984   ac_cv_type_ssize_t=no
3985 fi
3986 rm -f conftest*
3987
3988 echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
3989 if test $ac_cv_type_ssize_t = no; then
3990   { test "$extra_verbose" = "yes" && cat << \EOF
3991     Defining ssize_t = int
3992 EOF
3993 cat >> confdefs.h <<\EOF
3994 #define ssize_t int
3995 EOF
3996 }
3997
3998 fi
3999
4000
4001 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
4002 echo "configure:4003: checking for struct timeval" >&5
4003 cat > conftest.$ac_ext <<EOF
4004 #line 4005 "configure"
4005 #include "confdefs.h"
4006 #ifdef TIME_WITH_SYS_TIME
4007 #include <sys/time.h>
4008 #include <time.h>
4009 #else
4010 #ifdef HAVE_SYS_TIME_H
4011 #include <sys/time.h>
4012 #else
4013 #include <time.h>
4014 #endif
4015 #endif
4016 int main() {
4017 static struct timeval x; x.tv_sec = x.tv_usec;
4018 ; return 0; }
4019 EOF
4020 if { (eval echo configure:4021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4021   rm -rf conftest*
4022   echo "$ac_t""yes" 1>&6
4023   HAVE_TIMEVAL=yes
4024   { test "$extra_verbose" = "yes" && cat << \EOF
4025     Defining HAVE_TIMEVAL
4026 EOF
4027 cat >> confdefs.h <<\EOF
4028 #define HAVE_TIMEVAL 1
4029 EOF
4030 }
4031
4032 else
4033   echo "configure: failed program was:" >&5
4034   cat conftest.$ac_ext >&5
4035   rm -rf conftest*
4036   echo "$ac_t""no" 1>&6
4037    HAVE_TIMEVAL=no
4038 fi
4039 rm -f conftest*
4040
4041 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
4042 echo "configure:4043: checking whether struct tm is in sys/time.h or time.h" >&5
4043
4044 cat > conftest.$ac_ext <<EOF
4045 #line 4046 "configure"
4046 #include "confdefs.h"
4047 #include <sys/types.h>
4048 #include <time.h>
4049 int main() {
4050 struct tm *tp; tp->tm_sec;
4051 ; return 0; }
4052 EOF
4053 if { (eval echo configure:4054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4054   rm -rf conftest*
4055   ac_cv_struct_tm=time.h
4056 else
4057   echo "configure: failed program was:" >&5
4058   cat conftest.$ac_ext >&5
4059   rm -rf conftest*
4060   ac_cv_struct_tm=sys/time.h
4061 fi
4062 rm -f conftest*
4063
4064 echo "$ac_t""$ac_cv_struct_tm" 1>&6
4065 if test $ac_cv_struct_tm = sys/time.h; then
4066   { test "$extra_verbose" = "yes" && cat << \EOF
4067     Defining TM_IN_SYS_TIME
4068 EOF
4069 cat >> confdefs.h <<\EOF
4070 #define TM_IN_SYS_TIME 1
4071 EOF
4072 }
4073
4074 fi
4075
4076 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
4077 echo "configure:4078: checking for tm_zone in struct tm" >&5
4078
4079 cat > conftest.$ac_ext <<EOF
4080 #line 4081 "configure"
4081 #include "confdefs.h"
4082 #include <sys/types.h>
4083 #include <$ac_cv_struct_tm>
4084 int main() {
4085 struct tm tm; tm.tm_zone;
4086 ; return 0; }
4087 EOF
4088 if { (eval echo configure:4089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4089   rm -rf conftest*
4090   ac_cv_struct_tm_zone=yes
4091 else
4092   echo "configure: failed program was:" >&5
4093   cat conftest.$ac_ext >&5
4094   rm -rf conftest*
4095   ac_cv_struct_tm_zone=no
4096 fi
4097 rm -f conftest*
4098
4099 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
4100 if test "$ac_cv_struct_tm_zone" = yes; then
4101   { test "$extra_verbose" = "yes" && cat << \EOF
4102     Defining HAVE_TM_ZONE
4103 EOF
4104 cat >> confdefs.h <<\EOF
4105 #define HAVE_TM_ZONE 1
4106 EOF
4107 }
4108
4109 else
4110   echo $ac_n "checking for tzname""... $ac_c" 1>&6
4111 echo "configure:4112: checking for tzname" >&5
4112
4113 cat > conftest.$ac_ext <<EOF
4114 #line 4115 "configure"
4115 #include "confdefs.h"
4116 #include <time.h>
4117 #ifndef tzname /* For SGI.  */
4118 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
4119 #endif
4120 int main() {
4121 atoi(*tzname);
4122 ; return 0; }
4123 EOF
4124 if { (eval echo configure:4125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4125   rm -rf conftest*
4126   ac_cv_var_tzname=yes
4127 else
4128   echo "configure: failed program was:" >&5
4129   cat conftest.$ac_ext >&5
4130   rm -rf conftest*
4131   ac_cv_var_tzname=no
4132 fi
4133 rm -f conftest*
4134
4135 echo "$ac_t""$ac_cv_var_tzname" 1>&6
4136   if test $ac_cv_var_tzname = yes; then
4137     { test "$extra_verbose" = "yes" && cat << \EOF
4138     Defining HAVE_TZNAME
4139 EOF
4140 cat >> confdefs.h <<\EOF
4141 #define HAVE_TZNAME 1
4142 EOF
4143 }
4144
4145   fi
4146 fi
4147
4148
4149 echo $ac_n "checking for working const""... $ac_c" 1>&6
4150 echo "configure:4151: checking for working const" >&5
4151
4152 cat > conftest.$ac_ext <<EOF
4153 #line 4154 "configure"
4154 #include "confdefs.h"
4155
4156 int main() {
4157
4158 /* Ultrix mips cc rejects this.  */
4159 typedef int charset[2]; const charset x = {0,0};
4160 /* SunOS 4.1.1 cc rejects this.  */
4161 char const *const *ccp;
4162 char **p;
4163 /* NEC SVR4.0.2 mips cc rejects this.  */
4164 struct point {int x, y;};
4165 static struct point const zero = {0,0};
4166 /* AIX XL C 1.02.0.0 rejects this.
4167    It does not let you subtract one const X* pointer from another in an arm
4168    of an if-expression whose if-part is not a constant expression */
4169 const char *g = "string";
4170 ccp = &g + (g ? g-g : 0);
4171 /* HPUX 7.0 cc rejects these. */
4172 ++ccp;
4173 p = (char**) ccp;
4174 ccp = (char const *const *) p;
4175 { /* SCO 3.2v4 cc rejects this.  */
4176   char *t;
4177   char const *s = 0 ? (char *) 0 : (char const *) 0;
4178
4179   *t++ = 0;
4180 }
4181 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4182   int x[] = {25, 17};
4183   const int *foo = &x[0];
4184   ++foo;
4185 }
4186 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4187   typedef const int *iptr;
4188   iptr p = 0;
4189   ++p;
4190 }
4191 { /* AIX XL C 1.02.0.0 rejects this saying
4192      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4193   struct s { int j; const int *ap[3]; };
4194   struct s *b; b->j = 5;
4195 }
4196 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4197   const int foo = 10;
4198 }
4199
4200 ; return 0; }
4201 EOF
4202 if { (eval echo configure:4203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4203   rm -rf conftest*
4204   ac_cv_c_const=yes
4205 else
4206   echo "configure: failed program was:" >&5
4207   cat conftest.$ac_ext >&5
4208   rm -rf conftest*
4209   ac_cv_c_const=no
4210 fi
4211 rm -f conftest*
4212
4213 echo "$ac_t""$ac_cv_c_const" 1>&6
4214 if test $ac_cv_c_const = no; then
4215   { test "$extra_verbose" = "yes" && cat << \EOF
4216     Defining const = 
4217 EOF
4218 cat >> confdefs.h <<\EOF
4219 #define const 
4220 EOF
4221 }
4222
4223 fi
4224
4225
4226 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
4227 echo "configure:4228: checking whether ${MAKE-make} sets \${MAKE}" >&5
4228 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
4229
4230 cat > conftestmake <<\EOF
4231 all:
4232         @echo 'ac_maketemp="${MAKE}"'
4233 EOF
4234 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4235 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4236 if test -n "$ac_maketemp"; then
4237   eval ac_cv_prog_make_${ac_make}_set=yes
4238 else
4239   eval ac_cv_prog_make_${ac_make}_set=no
4240 fi
4241 rm -f conftestmake
4242 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4243   echo "$ac_t""yes" 1>&6
4244   SET_MAKE=
4245 else
4246   echo "$ac_t""no" 1>&6
4247   SET_MAKE="MAKE=${MAKE-make}"
4248 fi
4249
4250
4251 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4252 echo "configure:4253: checking whether byte ordering is bigendian" >&5
4253
4254 ac_cv_c_bigendian=unknown
4255 # See if sys/param.h defines the BYTE_ORDER macro.
4256 cat > conftest.$ac_ext <<EOF
4257 #line 4258 "configure"
4258 #include "confdefs.h"
4259 #include <sys/types.h>
4260 #include <sys/param.h>
4261 int main() {
4262
4263 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4264  bogus endian macros
4265 #endif
4266 ; return 0; }
4267 EOF
4268 if { (eval echo configure:4269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4269   rm -rf conftest*
4270   # It does; now see whether it defined to BIG_ENDIAN or not.
4271 cat > conftest.$ac_ext <<EOF
4272 #line 4273 "configure"
4273 #include "confdefs.h"
4274 #include <sys/types.h>
4275 #include <sys/param.h>
4276 int main() {
4277
4278 #if BYTE_ORDER != BIG_ENDIAN
4279  not big endian
4280 #endif
4281 ; return 0; }
4282 EOF
4283 if { (eval echo configure:4284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4284   rm -rf conftest*
4285   ac_cv_c_bigendian=yes
4286 else
4287   echo "configure: failed program was:" >&5
4288   cat conftest.$ac_ext >&5
4289   rm -rf conftest*
4290   ac_cv_c_bigendian=no
4291 fi
4292 rm -f conftest*
4293 else
4294   echo "configure: failed program was:" >&5
4295   cat conftest.$ac_ext >&5
4296 fi
4297 rm -f conftest*
4298 if test $ac_cv_c_bigendian = unknown; then
4299 cat > conftest.$ac_ext <<EOF
4300 #line 4301 "configure"
4301 #include "confdefs.h"
4302 main () {
4303   /* Are we little or big endian?  From Harbison&Steele.  */
4304   union
4305   {
4306     long l;
4307     char c[sizeof (long)];
4308   } u;
4309   u.l = 1;
4310   exit (u.c[sizeof (long) - 1] == 1);
4311 }
4312 EOF
4313 if { (eval echo configure:4314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4314 then
4315   ac_cv_c_bigendian=no
4316 else
4317   conftest_rc="$?"
4318   echo "configure: failed program was:" >&5
4319   cat conftest.$ac_ext >&5
4320   rm -fr conftest*
4321   ac_cv_c_bigendian=yes
4322 fi
4323 rm -fr conftest*
4324 fi
4325
4326 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4327 if test $ac_cv_c_bigendian = yes; then
4328   { test "$extra_verbose" = "yes" && cat << \EOF
4329     Defining WORDS_BIGENDIAN
4330 EOF
4331 cat >> confdefs.h <<\EOF
4332 #define WORDS_BIGENDIAN 1
4333 EOF
4334 }
4335
4336 fi
4337
4338
4339 echo $ac_n "checking size of short""... $ac_c" 1>&6
4340 echo "configure:4341: checking size of short" >&5
4341
4342 cat > conftest.$ac_ext <<EOF
4343 #line 4344 "configure"
4344 #include "confdefs.h"
4345 #include <stdio.h>
4346 main()
4347 {
4348   FILE *f=fopen("conftestval", "w");
4349   if (!f) exit(1);
4350   fprintf(f, "%d\n", sizeof(short));
4351   exit(0);
4352 }
4353 EOF
4354 if { (eval echo configure:4355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4355 then
4356   ac_cv_sizeof_short=`cat conftestval`
4357 else
4358   conftest_rc="$?"
4359   echo "configure: failed program was:" >&5
4360   cat conftest.$ac_ext >&5
4361   rm -fr conftest*
4362   ac_cv_sizeof_short=0
4363 fi
4364 rm -fr conftest*
4365 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4366 { test "$extra_verbose" = "yes" && cat << EOF
4367     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4368 EOF
4369 cat >> confdefs.h <<EOF
4370 #define SIZEOF_SHORT $ac_cv_sizeof_short
4371 EOF
4372 }
4373
4374
4375 if test "$ac_cv_sizeof_short" = 0; then
4376   echo ""
4377   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4378   echo "*** PANIC *** Please examine config.log for compilation errors."
4379   exit 1
4380 fi
4381 echo $ac_n "checking size of int""... $ac_c" 1>&6
4382 echo "configure:4383: checking size of int" >&5
4383
4384 cat > conftest.$ac_ext <<EOF
4385 #line 4386 "configure"
4386 #include "confdefs.h"
4387 #include <stdio.h>
4388 main()
4389 {
4390   FILE *f=fopen("conftestval", "w");
4391   if (!f) exit(1);
4392   fprintf(f, "%d\n", sizeof(int));
4393   exit(0);
4394 }
4395 EOF
4396 if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4397 then
4398   ac_cv_sizeof_int=`cat conftestval`
4399 else
4400   conftest_rc="$?"
4401   echo "configure: failed program was:" >&5
4402   cat conftest.$ac_ext >&5
4403   rm -fr conftest*
4404   ac_cv_sizeof_int=0
4405 fi
4406 rm -fr conftest*
4407 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4408 { test "$extra_verbose" = "yes" && cat << EOF
4409     Defining SIZEOF_INT = $ac_cv_sizeof_int
4410 EOF
4411 cat >> confdefs.h <<EOF
4412 #define SIZEOF_INT $ac_cv_sizeof_int
4413 EOF
4414 }
4415
4416
4417 echo $ac_n "checking size of long""... $ac_c" 1>&6
4418 echo "configure:4419: checking size of long" >&5
4419
4420 cat > conftest.$ac_ext <<EOF
4421 #line 4422 "configure"
4422 #include "confdefs.h"
4423 #include <stdio.h>
4424 main()
4425 {
4426   FILE *f=fopen("conftestval", "w");
4427   if (!f) exit(1);
4428   fprintf(f, "%d\n", sizeof(long));
4429   exit(0);
4430 }
4431 EOF
4432 if { (eval echo configure:4433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4433 then
4434   ac_cv_sizeof_long=`cat conftestval`
4435 else
4436   conftest_rc="$?"
4437   echo "configure: failed program was:" >&5
4438   cat conftest.$ac_ext >&5
4439   rm -fr conftest*
4440   ac_cv_sizeof_long=0
4441 fi
4442 rm -fr conftest*
4443 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4444 { test "$extra_verbose" = "yes" && cat << EOF
4445     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4446 EOF
4447 cat >> confdefs.h <<EOF
4448 #define SIZEOF_LONG $ac_cv_sizeof_long
4449 EOF
4450 }
4451
4452
4453 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4454 echo "configure:4455: checking size of long long" >&5
4455
4456 cat > conftest.$ac_ext <<EOF
4457 #line 4458 "configure"
4458 #include "confdefs.h"
4459 #include <stdio.h>
4460 main()
4461 {
4462   FILE *f=fopen("conftestval", "w");
4463   if (!f) exit(1);
4464   fprintf(f, "%d\n", sizeof(long long));
4465   exit(0);
4466 }
4467 EOF
4468 if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4469 then
4470   ac_cv_sizeof_long_long=`cat conftestval`
4471 else
4472   conftest_rc="$?"
4473   echo "configure: failed program was:" >&5
4474   cat conftest.$ac_ext >&5
4475   rm -fr conftest*
4476   ac_cv_sizeof_long_long=0
4477 fi
4478 rm -fr conftest*
4479 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4480 { test "$extra_verbose" = "yes" && cat << EOF
4481     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4482 EOF
4483 cat >> confdefs.h <<EOF
4484 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4485 EOF
4486 }
4487
4488
4489 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4490 echo "configure:4491: checking size of void *" >&5
4491
4492 cat > conftest.$ac_ext <<EOF
4493 #line 4494 "configure"
4494 #include "confdefs.h"
4495 #include <stdio.h>
4496 main()
4497 {
4498   FILE *f=fopen("conftestval", "w");
4499   if (!f) exit(1);
4500   fprintf(f, "%d\n", sizeof(void *));
4501   exit(0);
4502 }
4503 EOF
4504 if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4505 then
4506   ac_cv_sizeof_void_p=`cat conftestval`
4507 else
4508   conftest_rc="$?"
4509   echo "configure: failed program was:" >&5
4510   cat conftest.$ac_ext >&5
4511   rm -fr conftest*
4512   ac_cv_sizeof_void_p=0
4513 fi
4514 rm -fr conftest*
4515 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4516 { test "$extra_verbose" = "yes" && cat << EOF
4517     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4518 EOF
4519 cat >> confdefs.h <<EOF
4520 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4521 EOF
4522 }
4523
4524
4525
4526 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4527 echo "configure:4528: checking for long file names" >&5
4528
4529 ac_cv_sys_long_file_names=yes
4530 # Test for long file names in all the places we know might matter:
4531 #      .                the current directory, where building will happen
4532 #      $prefix/lib      where we will be installing things
4533 #      $exec_prefix/lib likewise
4534 # eval it to expand exec_prefix.
4535 #      $TMPDIR          if set, where it might want to write temporary files
4536 # if $TMPDIR is not set:
4537 #      /tmp             where it might want to write temporary files
4538 #      /var/tmp         likewise
4539 #      /usr/tmp         likewise
4540 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4541   ac_tmpdirs="$TMPDIR"
4542 else
4543   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4544 fi
4545 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4546   test -d $ac_dir || continue
4547   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4548   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4549   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4550   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4551   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4552     ac_cv_sys_long_file_names=no
4553     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4554     break
4555   fi
4556   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4557 done
4558
4559 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4560 if test $ac_cv_sys_long_file_names = yes; then
4561   { test "$extra_verbose" = "yes" && cat << \EOF
4562     Defining HAVE_LONG_FILE_NAMES
4563 EOF
4564 cat >> confdefs.h <<\EOF
4565 #define HAVE_LONG_FILE_NAMES 1
4566 EOF
4567 }
4568
4569 fi
4570
4571
4572 echo $ac_n "checking for sin""... $ac_c" 1>&6
4573 echo "configure:4574: checking for sin" >&5
4574
4575 cat > conftest.$ac_ext <<EOF
4576 #line 4577 "configure"
4577 #include "confdefs.h"
4578 /* System header to define __stub macros and hopefully few prototypes,
4579     which can conflict with char sin(); below.  */
4580 #include <assert.h>
4581 /* Override any gcc2 internal prototype to avoid an error.  */
4582 /* We use char because int might match the return type of a gcc2
4583     builtin and then its argument prototype would still apply.  */
4584 char sin();
4585
4586 int main() {
4587
4588 /* The GNU C library defines this for functions which it implements
4589     to always fail with ENOSYS.  Some functions are actually named
4590     something starting with __ and the normal name is an alias.  */
4591 #if defined (__stub_sin) || defined (__stub___sin)
4592 choke me
4593 #else
4594 sin();
4595 #endif
4596
4597 ; return 0; }
4598 EOF
4599 if { (eval echo configure:4600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4600   rm -rf conftest*
4601   eval "ac_cv_func_sin=yes"
4602 else
4603   echo "configure: failed program was:" >&5
4604   cat conftest.$ac_ext >&5
4605   rm -rf conftest*
4606   eval "ac_cv_func_sin=no"
4607 fi
4608 rm -f conftest*
4609
4610 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4611   echo "$ac_t""yes" 1>&6
4612   :
4613 else
4614   echo "$ac_t""no" 1>&6
4615
4616 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4617 echo "configure:4618: checking for sin in -lm" >&5
4618 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4619
4620 xe_check_libs=" -lm "
4621 cat > conftest.$ac_ext <<EOF
4622 #line 4623 "configure"
4623 #include "confdefs.h"
4624 /* Override any gcc2 internal prototype to avoid an error.  */
4625 /* We use char because int might match the return type of a gcc2
4626     builtin and then its argument prototype would still apply.  */
4627 char sin();
4628
4629 int main() {
4630 sin()
4631 ; return 0; }
4632 EOF
4633 if { (eval echo configure:4634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4634   rm -rf conftest*
4635   eval "ac_cv_lib_$ac_lib_var=yes"
4636 else
4637   echo "configure: failed program was:" >&5
4638   cat conftest.$ac_ext >&5
4639   rm -rf conftest*
4640   eval "ac_cv_lib_$ac_lib_var=no"
4641 fi
4642 rm -f conftest*
4643 xe_check_libs=""
4644
4645 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4646   echo "$ac_t""yes" 1>&6
4647     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4648     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4649   { test "$extra_verbose" = "yes" && cat << EOF
4650     Defining $ac_tr_lib
4651 EOF
4652 cat >> confdefs.h <<EOF
4653 #define $ac_tr_lib 1
4654 EOF
4655 }
4656
4657   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4658
4659 else
4660   echo "$ac_t""no" 1>&6
4661 fi
4662
4663
4664 fi
4665
4666
4667 { test "$extra_verbose" = "yes" && cat << \EOF
4668     Defining LISP_FLOAT_TYPE
4669 EOF
4670 cat >> confdefs.h <<\EOF
4671 #define LISP_FLOAT_TYPE 1
4672 EOF
4673 }
4674
4675
4676 cat > conftest.$ac_ext <<EOF
4677 #line 4678 "configure"
4678 #include "confdefs.h"
4679 #include <math.h>
4680 int main() {
4681 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4682 ; return 0; }
4683 EOF
4684 if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4685   rm -rf conftest*
4686   { test "$extra_verbose" = "yes" && cat << \EOF
4687     Defining HAVE_INVERSE_HYPERBOLIC
4688 EOF
4689 cat >> confdefs.h <<\EOF
4690 #define HAVE_INVERSE_HYPERBOLIC 1
4691 EOF
4692 }
4693
4694 else
4695   echo "configure: failed program was:" >&5
4696   cat conftest.$ac_ext >&5
4697 fi
4698 rm -f conftest*
4699
4700 echo "checking type of mail spool file locking" 1>&6
4701 echo "configure:4702: checking type of mail spool file locking" >&5
4702 for ac_func in lockf flock
4703 do
4704 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4705 echo "configure:4706: checking for $ac_func" >&5
4706
4707 cat > conftest.$ac_ext <<EOF
4708 #line 4709 "configure"
4709 #include "confdefs.h"
4710 /* System header to define __stub macros and hopefully few prototypes,
4711     which can conflict with char $ac_func(); below.  */
4712 #include <assert.h>
4713 /* Override any gcc2 internal prototype to avoid an error.  */
4714 /* We use char because int might match the return type of a gcc2
4715     builtin and then its argument prototype would still apply.  */
4716 char $ac_func();
4717
4718 int main() {
4719
4720 /* The GNU C library defines this for functions which it implements
4721     to always fail with ENOSYS.  Some functions are actually named
4722     something starting with __ and the normal name is an alias.  */
4723 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4724 choke me
4725 #else
4726 $ac_func();
4727 #endif
4728
4729 ; return 0; }
4730 EOF
4731 if { (eval echo configure:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4732   rm -rf conftest*
4733   eval "ac_cv_func_$ac_func=yes"
4734 else
4735   echo "configure: failed program was:" >&5
4736   cat conftest.$ac_ext >&5
4737   rm -rf conftest*
4738   eval "ac_cv_func_$ac_func=no"
4739 fi
4740 rm -f conftest*
4741
4742 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4743   echo "$ac_t""yes" 1>&6
4744     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4745   { test "$extra_verbose" = "yes" && cat << EOF
4746     Defining $ac_tr_func
4747 EOF
4748 cat >> confdefs.h <<EOF
4749 #define $ac_tr_func 1
4750 EOF
4751 }
4752  
4753 else
4754   echo "$ac_t""no" 1>&6
4755 fi
4756 done
4757
4758 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4759 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4760 test -z "$mail_locking" -a "$mail_use_locking" = "yes" && mail_locking=locking
4761 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4762     Defining MAIL_LOCK_LOCKF
4763 EOF
4764 cat >> confdefs.h <<\EOF
4765 #define MAIL_LOCK_LOCKF 1
4766 EOF
4767 }
4768
4769 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4770     Defining MAIL_LOCK_FLOCK
4771 EOF
4772 cat >> confdefs.h <<\EOF
4773 #define MAIL_LOCK_FLOCK 1
4774 EOF
4775 }
4776
4777 elif test "$mail_locking" = "locking"; then { test "$extra_verbose" = "yes" && cat << \EOF
4778     Defining MAIL_LOCK_LOCKING
4779 EOF
4780 cat >> confdefs.h <<\EOF
4781 #define MAIL_LOCK_LOCKING 1
4782 EOF
4783 }
4784
4785 else mail_locking="dot-locking"; { test "$extra_verbose" = "yes" && cat << \EOF
4786     Defining MAIL_LOCK_DOT
4787 EOF
4788 cat >> confdefs.h <<\EOF
4789 #define MAIL_LOCK_DOT 1
4790 EOF
4791 }
4792
4793 fi
4794 test "$mail_locking" = "lockf" -a "$ac_cv_func_lockf" != "yes" && \
4795   { echo "Error:" "lockf mail locking requested but not available." >&2; exit 1; }
4796 test "$mail_locking" = "flock" -a "$ac_cv_func_flock" != "yes" && \
4797   { echo "Error:" "flock mail locking requested but not available." >&2; exit 1; }
4798 test "$mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \
4799   { echo "Error:" "locking mail locking requested but not available." >&2; exit 1; }
4800
4801 case "$opsys" in decosf*)
4802   
4803 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4804 echo "configure:4805: checking for cma_open in -lpthreads" >&5
4805 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4806
4807 xe_check_libs=" -lpthreads "
4808 cat > conftest.$ac_ext <<EOF
4809 #line 4810 "configure"
4810 #include "confdefs.h"
4811 /* Override any gcc2 internal prototype to avoid an error.  */
4812 /* We use char because int might match the return type of a gcc2
4813     builtin and then its argument prototype would still apply.  */
4814 char cma_open();
4815
4816 int main() {
4817 cma_open()
4818 ; return 0; }
4819 EOF
4820 if { (eval echo configure:4821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4821   rm -rf conftest*
4822   eval "ac_cv_lib_$ac_lib_var=yes"
4823 else
4824   echo "configure: failed program was:" >&5
4825   cat conftest.$ac_ext >&5
4826   rm -rf conftest*
4827   eval "ac_cv_lib_$ac_lib_var=no"
4828 fi
4829 rm -f conftest*
4830 xe_check_libs=""
4831
4832 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4833   echo "$ac_t""yes" 1>&6
4834     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4835     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4836   { test "$extra_verbose" = "yes" && cat << EOF
4837     Defining $ac_tr_lib
4838 EOF
4839 cat >> confdefs.h <<EOF
4840 #define $ac_tr_lib 1
4841 EOF
4842 }
4843
4844   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4845
4846 else
4847   echo "$ac_t""no" 1>&6
4848 fi
4849
4850
4851   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4852     c_switch_site="$c_switch_site -threads" ;;
4853 esac
4854
4855 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4856 echo "configure:4857: checking whether the -xildoff compiler flag is required" >&5
4857 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4858   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4859     then echo "$ac_t""no" 1>&6;
4860     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
4861   fi
4862   else echo "$ac_t""no" 1>&6
4863 fi
4864
4865 if test "$opsys" = "sol2"; then
4866   if test "$os_release" -ge 56; then
4867     echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4868 echo "configure:4869: checking for \"-z ignore\" linker flag" >&5
4869     case "`ld -h 2>&1`" in
4870       *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4871         ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4872       *) echo "$ac_t""no" 1>&6 ;;
4873     esac
4874   fi
4875 fi
4876
4877
4878 echo "checking "for specified window system"" 1>&6
4879 echo "configure:4880: checking "for specified window system"" >&5
4880
4881 if test "$with_x11" != "no"; then
4882     test "$x_includes $x_libraries" != "NONE NONE" && \
4883    window_system=x11 with_x11=yes
4884
4885         
4886       if test "$x_includes $x_libraries" = "NONE NONE" \
4887     -a -n "$OPENWINHOME" \
4888     -a "$OPENWINHOME" != "/usr/openwin" \
4889     -a -d "$OPENWINHOME"; then
4890       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4891       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4892       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4893   fi
4894
4895   if test "$x_includes" = "NONE"; then
4896                     for dir in "/usr/X11" "/usr/X11R6"; do
4897       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4898     done
4899   fi
4900
4901   if test "$x_libraries" = "NONE"; then
4902     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4903       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4904     done
4905   fi
4906
4907   # If we find X, set shell vars x_includes and x_libraries to the
4908 # paths, otherwise set no_x=yes.
4909 # Uses ac_ vars as temps to allow command line to override cache and checks.
4910 # --without-x overrides everything else, but does not touch the cache.
4911 echo $ac_n "checking for X""... $ac_c" 1>&6
4912 echo "configure:4913: checking for X" >&5
4913
4914 # Check whether --with-x or --without-x was given.
4915 if test "${with_x+set}" = set; then
4916   withval="$with_x"
4917   :
4918 fi
4919
4920 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4921 if test "x$with_x" = xno; then
4922   # The user explicitly disabled X.
4923   have_x=disabled
4924 else
4925   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4926     # Both variables are already set.
4927     have_x=yes
4928   else
4929
4930 # One or both of the vars are not set, and there is no cached value.
4931 ac_x_includes=NO ac_x_libraries=NO
4932 rm -fr conftestdir
4933 if mkdir conftestdir; then
4934   cd conftestdir
4935   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4936   cat > Imakefile <<'EOF'
4937 acfindx:
4938         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4939 EOF
4940   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4941     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4942     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4943     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4944     for ac_extension in a so sl; do
4945       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4946         test -f $ac_im_libdir/libX11.$ac_extension; then
4947         ac_im_usrlibdir=$ac_im_libdir; break
4948       fi
4949     done
4950     # Screen out bogus values from the imake configuration.  They are
4951     # bogus both because they are the default anyway, and because
4952     # using them would break gcc on systems where it needs fixed includes.
4953     case "$ac_im_incroot" in
4954         /usr/include) ;;
4955         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4956     esac
4957     case "$ac_im_usrlibdir" in
4958         /usr/lib | /lib) ;;
4959         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4960     esac
4961   fi
4962   cd ..
4963   rm -fr conftestdir
4964 fi
4965
4966 if test "$ac_x_includes" = NO; then
4967   # Guess where to find include files, by looking for this one X11 .h file.
4968   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4969
4970   # First, try using that file with no special directory specified.
4971 cat > conftest.$ac_ext <<EOF
4972 #line 4973 "configure"
4973 #include "confdefs.h"
4974 #include <$x_direct_test_include>
4975 EOF
4976 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4977 { (eval echo configure:4978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4978 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4979 if test -z "$ac_err"; then
4980   rm -rf conftest*
4981   # We can compile using X headers with no special include directory.
4982 ac_x_includes=
4983 else
4984   echo "$ac_err" >&5
4985   echo "configure: failed program was:" >&5
4986   cat conftest.$ac_ext >&5
4987   rm -rf conftest*
4988   # Look for the header file in a standard set of common directories.
4989 # Check X11 before X11Rn because it is often a symlink to the current release.
4990   for ac_dir in               \
4991     /usr/X11/include          \
4992     /usr/X11R6/include        \
4993     /usr/X11R5/include        \
4994     /usr/X11R4/include        \
4995                               \
4996     /usr/include/X11          \
4997     /usr/include/X11R6        \
4998     /usr/include/X11R5        \
4999     /usr/include/X11R4        \
5000                               \
5001     /usr/local/X11/include    \
5002     /usr/local/X11R6/include  \
5003     /usr/local/X11R5/include  \
5004     /usr/local/X11R4/include  \
5005                               \
5006     /usr/local/include/X11    \
5007     /usr/local/include/X11R6  \
5008     /usr/local/include/X11R5  \
5009     /usr/local/include/X11R4  \
5010                               \
5011     /usr/X386/include         \
5012     /usr/x386/include         \
5013     /usr/XFree86/include/X11  \
5014                               \
5015     /usr/include              \
5016     /usr/local/include        \
5017     /usr/unsupported/include  \
5018     /usr/athena/include       \
5019     /usr/local/x11r5/include  \
5020     /usr/lpp/Xamples/include  \
5021                               \
5022     /usr/openwin/include      \
5023     /usr/openwin/share/include \
5024     ; \
5025   do
5026     if test -r "$ac_dir/$x_direct_test_include"; then
5027       ac_x_includes=$ac_dir
5028       break
5029     fi
5030   done
5031 fi
5032 rm -f conftest*
5033 fi # $ac_x_includes = NO
5034
5035 if test "$ac_x_libraries" = NO; then
5036   # Check for the libraries.
5037
5038   test -z "$x_direct_test_library" && x_direct_test_library=Xt
5039   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
5040
5041   # See if we find them without any special options.
5042   # Don't add to $LIBS permanently.
5043   ac_save_LIBS="$LIBS"
5044   LIBS="-l$x_direct_test_library $LIBS"
5045 cat > conftest.$ac_ext <<EOF
5046 #line 5047 "configure"
5047 #include "confdefs.h"
5048
5049 int main() {
5050 ${x_direct_test_function}()
5051 ; return 0; }
5052 EOF
5053 if { (eval echo configure:5054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5054   rm -rf conftest*
5055   LIBS="$ac_save_LIBS"
5056 # We can link X programs with no special library path.
5057 ac_x_libraries=
5058 else
5059   echo "configure: failed program was:" >&5
5060   cat conftest.$ac_ext >&5
5061   rm -rf conftest*
5062   LIBS="$ac_save_LIBS"
5063 # First see if replacing the include by lib works.
5064 # Check X11 before X11Rn because it is often a symlink to the current release.
5065 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
5066     /usr/X11/lib          \
5067     /usr/X11R6/lib        \
5068     /usr/X11R5/lib        \
5069     /usr/X11R4/lib        \
5070                           \
5071     /usr/lib/X11          \
5072     /usr/lib/X11R6        \
5073     /usr/lib/X11R5        \
5074     /usr/lib/X11R4        \
5075                           \
5076     /usr/local/X11/lib    \
5077     /usr/local/X11R6/lib  \
5078     /usr/local/X11R5/lib  \
5079     /usr/local/X11R4/lib  \
5080                           \
5081     /usr/local/lib/X11    \
5082     /usr/local/lib/X11R6  \
5083     /usr/local/lib/X11R5  \
5084     /usr/local/lib/X11R4  \
5085                           \
5086     /usr/X386/lib         \
5087     /usr/x386/lib         \
5088     /usr/XFree86/lib/X11  \
5089                           \
5090     /usr/lib              \
5091     /usr/local/lib        \
5092     /usr/unsupported/lib  \
5093     /usr/athena/lib       \
5094     /usr/local/x11r5/lib  \
5095     /usr/lpp/Xamples/lib  \
5096     /lib/usr/lib/X11      \
5097                           \
5098     /usr/openwin/lib      \
5099     /usr/openwin/share/lib \
5100     ; \
5101 do
5102   for ac_extension in a so sl; do
5103     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
5104       ac_x_libraries=$ac_dir
5105       break 2
5106     fi
5107   done
5108 done
5109 fi
5110 rm -f conftest*
5111 fi # $ac_x_libraries = NO
5112
5113 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
5114   # Didn't find X anywhere.  Cache the known absence of X.
5115   ac_cv_have_x="have_x=no"
5116 else
5117   # Record where we found X for the cache.
5118   ac_cv_have_x="have_x=yes \
5119                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
5120 fi
5121   fi
5122   eval "$ac_cv_have_x"
5123 fi # $with_x != no
5124
5125 if test "$have_x" != yes; then
5126   echo "$ac_t""$have_x" 1>&6
5127   no_x=yes
5128 else
5129   # If each of the values was on the command line, it overrides each guess.
5130   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
5131   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
5132   # Update the cache value to reflect the command line values.
5133   ac_cv_have_x="have_x=yes \
5134                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
5135   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
5136 fi
5137
5138 if test "$no_x" = yes; then
5139   # Not all programs may use this symbol, but it does not hurt to define it.
5140   { test "$extra_verbose" = "yes" && cat << \EOF
5141     Defining X_DISPLAY_MISSING
5142 EOF
5143 cat >> confdefs.h <<\EOF
5144 #define X_DISPLAY_MISSING 1
5145 EOF
5146 }
5147
5148   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
5149 else
5150   if test -n "$x_includes"; then
5151     X_CFLAGS="$X_CFLAGS -I$x_includes"
5152   fi
5153
5154   # It would also be nice to do this for all -L options, not just this one.
5155   if test -n "$x_libraries"; then
5156     X_LIBS="$X_LIBS -L$x_libraries"
5157     # For Solaris; some versions of Sun CC require a space after -R and
5158     # others require no space.  Words are not sufficient . . . .
5159     case "`(uname -sr) 2>/dev/null`" in
5160     "SunOS 5"*)
5161       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
5162 echo "configure:5163: checking whether -R must be followed by a space" >&5
5163       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
5164       cat > conftest.$ac_ext <<EOF
5165 #line 5166 "configure"
5166 #include "confdefs.h"
5167
5168 int main() {
5169
5170 ; return 0; }
5171 EOF
5172 if { (eval echo configure:5173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5173   rm -rf conftest*
5174   ac_R_nospace=yes
5175 else
5176   echo "configure: failed program was:" >&5
5177   cat conftest.$ac_ext >&5
5178   rm -rf conftest*
5179   ac_R_nospace=no
5180 fi
5181 rm -f conftest*
5182       if test $ac_R_nospace = yes; then
5183         echo "$ac_t""no" 1>&6
5184         X_LIBS="$X_LIBS -R$x_libraries"
5185       else
5186         LIBS="$ac_xsave_LIBS -R $x_libraries"
5187         cat > conftest.$ac_ext <<EOF
5188 #line 5189 "configure"
5189 #include "confdefs.h"
5190
5191 int main() {
5192
5193 ; return 0; }
5194 EOF
5195 if { (eval echo configure:5196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5196   rm -rf conftest*
5197   ac_R_space=yes
5198 else
5199   echo "configure: failed program was:" >&5
5200   cat conftest.$ac_ext >&5
5201   rm -rf conftest*
5202   ac_R_space=no
5203 fi
5204 rm -f conftest*
5205         if test $ac_R_space = yes; then
5206           echo "$ac_t""yes" 1>&6
5207           X_LIBS="$X_LIBS -R $x_libraries"
5208         else
5209           echo "$ac_t""neither works" 1>&6
5210         fi
5211       fi
5212       LIBS="$ac_xsave_LIBS"
5213     esac
5214   fi
5215
5216   # Check for system-dependent libraries X programs must link with.
5217   # Do this before checking for the system-independent R6 libraries
5218   # (-lICE), since we may need -lsocket or whatever for X linking.
5219
5220   if test "$ISC" = yes; then
5221     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
5222   else
5223     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
5224     # libraries were built with DECnet support.  And karl@cs.umb.edu says
5225     # the Alpha needs dnet_stub (dnet does not exist).
5226     if test "$with_dnet" = "no" ; then
5227 ac_cv_lib_dnet_dnet_ntoa=no
5228 else
5229
5230 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
5231 echo "configure:5232: checking for dnet_ntoa in -ldnet" >&5
5232 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
5233
5234 xe_check_libs=" -ldnet "
5235 cat > conftest.$ac_ext <<EOF
5236 #line 5237 "configure"
5237 #include "confdefs.h"
5238 /* Override any gcc2 internal prototype to avoid an error.  */
5239 /* We use char because int might match the return type of a gcc2
5240     builtin and then its argument prototype would still apply.  */
5241 char dnet_ntoa();
5242
5243 int main() {
5244 dnet_ntoa()
5245 ; return 0; }
5246 EOF
5247 if { (eval echo configure:5248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5248   rm -rf conftest*
5249   eval "ac_cv_lib_$ac_lib_var=yes"
5250 else
5251   echo "configure: failed program was:" >&5
5252   cat conftest.$ac_ext >&5
5253   rm -rf conftest*
5254   eval "ac_cv_lib_$ac_lib_var=no"
5255 fi
5256 rm -f conftest*
5257 xe_check_libs=""
5258
5259 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5260   echo "$ac_t""yes" 1>&6
5261   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
5262 else
5263   echo "$ac_t""no" 1>&6
5264 fi
5265
5266 fi
5267
5268     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
5269       
5270 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
5271 echo "configure:5272: checking for dnet_ntoa in -ldnet_stub" >&5
5272 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
5273
5274 xe_check_libs=" -ldnet_stub "
5275 cat > conftest.$ac_ext <<EOF
5276 #line 5277 "configure"
5277 #include "confdefs.h"
5278 /* Override any gcc2 internal prototype to avoid an error.  */
5279 /* We use char because int might match the return type of a gcc2
5280     builtin and then its argument prototype would still apply.  */
5281 char dnet_ntoa();
5282
5283 int main() {
5284 dnet_ntoa()
5285 ; return 0; }
5286 EOF
5287 if { (eval echo configure:5288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5288   rm -rf conftest*
5289   eval "ac_cv_lib_$ac_lib_var=yes"
5290 else
5291   echo "configure: failed program was:" >&5
5292   cat conftest.$ac_ext >&5
5293   rm -rf conftest*
5294   eval "ac_cv_lib_$ac_lib_var=no"
5295 fi
5296 rm -f conftest*
5297 xe_check_libs=""
5298
5299 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5300   echo "$ac_t""yes" 1>&6
5301   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
5302 else
5303   echo "$ac_t""no" 1>&6
5304 fi
5305
5306
5307     fi
5308
5309     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
5310     # to get the SysV transport functions.
5311     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5312     # needs -lnsl.
5313     # The nsl library prevents programs from opening the X display
5314     # on Irix 5.2, according to dickey@clark.net.
5315     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5316 echo "configure:5317: checking for gethostbyname" >&5
5317
5318 cat > conftest.$ac_ext <<EOF
5319 #line 5320 "configure"
5320 #include "confdefs.h"
5321 /* System header to define __stub macros and hopefully few prototypes,
5322     which can conflict with char gethostbyname(); below.  */
5323 #include <assert.h>
5324 /* Override any gcc2 internal prototype to avoid an error.  */
5325 /* We use char because int might match the return type of a gcc2
5326     builtin and then its argument prototype would still apply.  */
5327 char gethostbyname();
5328
5329 int main() {
5330
5331 /* The GNU C library defines this for functions which it implements
5332     to always fail with ENOSYS.  Some functions are actually named
5333     something starting with __ and the normal name is an alias.  */
5334 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5335 choke me
5336 #else
5337 gethostbyname();
5338 #endif
5339
5340 ; return 0; }
5341 EOF
5342 if { (eval echo configure:5343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5343   rm -rf conftest*
5344   eval "ac_cv_func_gethostbyname=yes"
5345 else
5346   echo "configure: failed program was:" >&5
5347   cat conftest.$ac_ext >&5
5348   rm -rf conftest*
5349   eval "ac_cv_func_gethostbyname=no"
5350 fi
5351 rm -f conftest*
5352
5353 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5354   echo "$ac_t""yes" 1>&6
5355   :
5356 else
5357   echo "$ac_t""no" 1>&6
5358 fi
5359
5360     if test $ac_cv_func_gethostbyname = no; then
5361       
5362 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5363 echo "configure:5364: checking for gethostbyname in -lnsl" >&5
5364 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5365
5366 xe_check_libs=" -lnsl "
5367 cat > conftest.$ac_ext <<EOF
5368 #line 5369 "configure"
5369 #include "confdefs.h"
5370 /* Override any gcc2 internal prototype to avoid an error.  */
5371 /* We use char because int might match the return type of a gcc2
5372     builtin and then its argument prototype would still apply.  */
5373 char gethostbyname();
5374
5375 int main() {
5376 gethostbyname()
5377 ; return 0; }
5378 EOF
5379 if { (eval echo configure:5380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5380   rm -rf conftest*
5381   eval "ac_cv_lib_$ac_lib_var=yes"
5382 else
5383   echo "configure: failed program was:" >&5
5384   cat conftest.$ac_ext >&5
5385   rm -rf conftest*
5386   eval "ac_cv_lib_$ac_lib_var=no"
5387 fi
5388 rm -f conftest*
5389 xe_check_libs=""
5390
5391 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5392   echo "$ac_t""yes" 1>&6
5393   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5394 else
5395   echo "$ac_t""no" 1>&6
5396 fi
5397
5398
5399     fi
5400
5401     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5402     # socket/setsockopt and other routines are undefined under SCO ODT
5403     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5404     # on later versions), says simon@lia.di.epfl.ch: it contains
5405     # gethostby* variants that don't use the nameserver (or something).
5406     # -lsocket must be given before -lnsl if both are needed.
5407     # We assume that if connect needs -lnsl, so does gethostbyname.
5408     echo $ac_n "checking for connect""... $ac_c" 1>&6
5409 echo "configure:5410: checking for connect" >&5
5410
5411 cat > conftest.$ac_ext <<EOF
5412 #line 5413 "configure"
5413 #include "confdefs.h"
5414 /* System header to define __stub macros and hopefully few prototypes,
5415     which can conflict with char connect(); below.  */
5416 #include <assert.h>
5417 /* Override any gcc2 internal prototype to avoid an error.  */
5418 /* We use char because int might match the return type of a gcc2
5419     builtin and then its argument prototype would still apply.  */
5420 char connect();
5421
5422 int main() {
5423
5424 /* The GNU C library defines this for functions which it implements
5425     to always fail with ENOSYS.  Some functions are actually named
5426     something starting with __ and the normal name is an alias.  */
5427 #if defined (__stub_connect) || defined (__stub___connect)
5428 choke me
5429 #else
5430 connect();
5431 #endif
5432
5433 ; return 0; }
5434 EOF
5435 if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5436   rm -rf conftest*
5437   eval "ac_cv_func_connect=yes"
5438 else
5439   echo "configure: failed program was:" >&5
5440   cat conftest.$ac_ext >&5
5441   rm -rf conftest*
5442   eval "ac_cv_func_connect=no"
5443 fi
5444 rm -f conftest*
5445
5446 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5447   echo "$ac_t""yes" 1>&6
5448   :
5449 else
5450   echo "$ac_t""no" 1>&6
5451 fi
5452
5453     if test $ac_cv_func_connect = no; then
5454       
5455 xe_msg_checking="for connect in -lsocket"
5456 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5457 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5458 echo "configure:5459: checking "$xe_msg_checking"" >&5
5459 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5460
5461 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5462 cat > conftest.$ac_ext <<EOF
5463 #line 5464 "configure"
5464 #include "confdefs.h"
5465 /* Override any gcc2 internal prototype to avoid an error.  */
5466 /* We use char because int might match the return type of a gcc2
5467     builtin and then its argument prototype would still apply.  */
5468 char connect();
5469
5470 int main() {
5471 connect()
5472 ; return 0; }
5473 EOF
5474 if { (eval echo configure:5475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5475   rm -rf conftest*
5476   eval "ac_cv_lib_$ac_lib_var=yes"
5477 else
5478   echo "configure: failed program was:" >&5
5479   cat conftest.$ac_ext >&5
5480   rm -rf conftest*
5481   eval "ac_cv_lib_$ac_lib_var=no"
5482 fi
5483 rm -f conftest*
5484 xe_check_libs=""
5485
5486 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5487   echo "$ac_t""yes" 1>&6
5488   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5489 else
5490   echo "$ac_t""no" 1>&6
5491 fi
5492
5493
5494     fi
5495
5496     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5497     echo $ac_n "checking for remove""... $ac_c" 1>&6
5498 echo "configure:5499: checking for remove" >&5
5499
5500 cat > conftest.$ac_ext <<EOF
5501 #line 5502 "configure"
5502 #include "confdefs.h"
5503 /* System header to define __stub macros and hopefully few prototypes,
5504     which can conflict with char remove(); below.  */
5505 #include <assert.h>
5506 /* Override any gcc2 internal prototype to avoid an error.  */
5507 /* We use char because int might match the return type of a gcc2
5508     builtin and then its argument prototype would still apply.  */
5509 char remove();
5510
5511 int main() {
5512
5513 /* The GNU C library defines this for functions which it implements
5514     to always fail with ENOSYS.  Some functions are actually named
5515     something starting with __ and the normal name is an alias.  */
5516 #if defined (__stub_remove) || defined (__stub___remove)
5517 choke me
5518 #else
5519 remove();
5520 #endif
5521
5522 ; return 0; }
5523 EOF
5524 if { (eval echo configure:5525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5525   rm -rf conftest*
5526   eval "ac_cv_func_remove=yes"
5527 else
5528   echo "configure: failed program was:" >&5
5529   cat conftest.$ac_ext >&5
5530   rm -rf conftest*
5531   eval "ac_cv_func_remove=no"
5532 fi
5533 rm -f conftest*
5534
5535 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5536   echo "$ac_t""yes" 1>&6
5537   :
5538 else
5539   echo "$ac_t""no" 1>&6
5540 fi
5541
5542     if test $ac_cv_func_remove = no; then
5543       
5544 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5545 echo "configure:5546: checking for remove in -lposix" >&5
5546 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5547
5548 xe_check_libs=" -lposix "
5549 cat > conftest.$ac_ext <<EOF
5550 #line 5551 "configure"
5551 #include "confdefs.h"
5552 /* Override any gcc2 internal prototype to avoid an error.  */
5553 /* We use char because int might match the return type of a gcc2
5554     builtin and then its argument prototype would still apply.  */
5555 char remove();
5556
5557 int main() {
5558 remove()
5559 ; return 0; }
5560 EOF
5561 if { (eval echo configure:5562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5562   rm -rf conftest*
5563   eval "ac_cv_lib_$ac_lib_var=yes"
5564 else
5565   echo "configure: failed program was:" >&5
5566   cat conftest.$ac_ext >&5
5567   rm -rf conftest*
5568   eval "ac_cv_lib_$ac_lib_var=no"
5569 fi
5570 rm -f conftest*
5571 xe_check_libs=""
5572
5573 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5574   echo "$ac_t""yes" 1>&6
5575   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5576 else
5577   echo "$ac_t""no" 1>&6
5578 fi
5579
5580
5581     fi
5582
5583     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5584     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5585 echo "configure:5586: checking for shmat" >&5
5586
5587 cat > conftest.$ac_ext <<EOF
5588 #line 5589 "configure"
5589 #include "confdefs.h"
5590 /* System header to define __stub macros and hopefully few prototypes,
5591     which can conflict with char shmat(); below.  */
5592 #include <assert.h>
5593 /* Override any gcc2 internal prototype to avoid an error.  */
5594 /* We use char because int might match the return type of a gcc2
5595     builtin and then its argument prototype would still apply.  */
5596 char shmat();
5597
5598 int main() {
5599
5600 /* The GNU C library defines this for functions which it implements
5601     to always fail with ENOSYS.  Some functions are actually named
5602     something starting with __ and the normal name is an alias.  */
5603 #if defined (__stub_shmat) || defined (__stub___shmat)
5604 choke me
5605 #else
5606 shmat();
5607 #endif
5608
5609 ; return 0; }
5610 EOF
5611 if { (eval echo configure:5612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5612   rm -rf conftest*
5613   eval "ac_cv_func_shmat=yes"
5614 else
5615   echo "configure: failed program was:" >&5
5616   cat conftest.$ac_ext >&5
5617   rm -rf conftest*
5618   eval "ac_cv_func_shmat=no"
5619 fi
5620 rm -f conftest*
5621
5622 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5623   echo "$ac_t""yes" 1>&6
5624   :
5625 else
5626   echo "$ac_t""no" 1>&6
5627 fi
5628
5629     if test $ac_cv_func_shmat = no; then
5630       
5631 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5632 echo "configure:5633: checking for shmat in -lipc" >&5
5633 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5634
5635 xe_check_libs=" -lipc "
5636 cat > conftest.$ac_ext <<EOF
5637 #line 5638 "configure"
5638 #include "confdefs.h"
5639 /* Override any gcc2 internal prototype to avoid an error.  */
5640 /* We use char because int might match the return type of a gcc2
5641     builtin and then its argument prototype would still apply.  */
5642 char shmat();
5643
5644 int main() {
5645 shmat()
5646 ; return 0; }
5647 EOF
5648 if { (eval echo configure:5649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5649   rm -rf conftest*
5650   eval "ac_cv_lib_$ac_lib_var=yes"
5651 else
5652   echo "configure: failed program was:" >&5
5653   cat conftest.$ac_ext >&5
5654   rm -rf conftest*
5655   eval "ac_cv_lib_$ac_lib_var=no"
5656 fi
5657 rm -f conftest*
5658 xe_check_libs=""
5659
5660 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5661   echo "$ac_t""yes" 1>&6
5662   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5663 else
5664   echo "$ac_t""no" 1>&6
5665 fi
5666
5667
5668     fi
5669   fi
5670
5671   # Check for libraries that X11R6 Xt/Xaw programs need.
5672   ac_save_LDFLAGS="$LDFLAGS"
5673   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5674   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5675   # check for ICE first), but we must link in the order -lSM -lICE or
5676   # we get undefined symbols.  So assume we have SM if we have ICE.
5677   # These have to be linked with before -lX11, unlike the other
5678   # libraries we check for below, so use a different variable.
5679   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5680   
5681 xe_msg_checking="for IceConnectionNumber in -lICE"
5682 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5683 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5684 echo "configure:5685: checking "$xe_msg_checking"" >&5
5685 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5686
5687 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5688 cat > conftest.$ac_ext <<EOF
5689 #line 5690 "configure"
5690 #include "confdefs.h"
5691 /* Override any gcc2 internal prototype to avoid an error.  */
5692 /* We use char because int might match the return type of a gcc2
5693     builtin and then its argument prototype would still apply.  */
5694 char IceConnectionNumber();
5695
5696 int main() {
5697 IceConnectionNumber()
5698 ; return 0; }
5699 EOF
5700 if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5701   rm -rf conftest*
5702   eval "ac_cv_lib_$ac_lib_var=yes"
5703 else
5704   echo "configure: failed program was:" >&5
5705   cat conftest.$ac_ext >&5
5706   rm -rf conftest*
5707   eval "ac_cv_lib_$ac_lib_var=no"
5708 fi
5709 rm -f conftest*
5710 xe_check_libs=""
5711
5712 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5713   echo "$ac_t""yes" 1>&6
5714   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5715 else
5716   echo "$ac_t""no" 1>&6
5717 fi
5718
5719
5720   LDFLAGS="$ac_save_LDFLAGS"
5721
5722 fi
5723  # Autoconf claims to find X library and include dirs for us.
5724   if test "$no_x" = "yes"
5725   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5726   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5727   fi
5728 fi
5729
5730 case "$with_x11" in
5731   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5732   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5733 esac
5734
5735 if test "$with_x11" = "yes"; then
5736   { test "$extra_verbose" = "yes" && cat << \EOF
5737     Defining HAVE_X_WINDOWS
5738 EOF
5739 cat >> confdefs.h <<\EOF
5740 #define HAVE_X_WINDOWS 1
5741 EOF
5742 }
5743
5744   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5745   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5746
5747       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5748     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5749     if test -d "$lib_dir" -a -d "$inc_dir"; then
5750       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5751         x_libraries="$lib_dir $x_libraries"
5752         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5753       esac
5754       case "$x_includes" in "$inc_dir"* ) ;; *)
5755         x_includes="$inc_dir $x_includes"
5756         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5757       esac
5758       break;       fi
5759   done
5760
5761     for rel in "X11R6" "X11R5" "X11R4"; do
5762     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5763     if test -d "$lib_dir" -a -d "$inc_dir"; then
5764       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5765         x_libraries="$x_libraries $lib_dir"
5766         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5767       esac
5768       case "$x_includes" in "$inc_dir"* ) ;; *)
5769         x_includes="$x_includes $inc_dir"
5770         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5771       esac
5772       break;     fi
5773   done
5774
5775     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
5776
5777   ld_switch_x_site="$X_LIBS"
5778
5779   
5780 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5781     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5782   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5783   
5784         runpath="" runpath_dirs=""
5785   if test -n "$LD_RUN_PATH"; then
5786     runpath="$LD_RUN_PATH"
5787   elif test "$GCC" = "yes"; then
5788         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5789     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5790     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5791     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5792       case "$arg" in P,* | -L* | -R* )
5793         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5794           {
5795 xe_runpath_dir="$dir"
5796   test "$xe_runpath_dir" != "/lib"     -a \
5797         "$xe_runpath_dir" != "/usr/lib" -a \
5798         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5799   eval "$xe_add_unique_runpath_dir"
5800 }
5801         done ;;
5802       esac
5803     done
5804     ld_switch_run="$ld_switch_run_save"
5805     rm -f conftest*
5806   else
5807         for arg in $ld_switch_site $ld_switch_x_site; do
5808       case "$arg" in -L*) {
5809 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5810   test "$xe_runpath_dir" != "/lib"     -a \
5811         "$xe_runpath_dir" != "/usr/lib" -a \
5812         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5813   eval "$xe_add_unique_runpath_dir"
5814 };; esac
5815     done
5816         if test "$opsys $need_motif" = "sol2 yes"; then
5817       xe_runpath_dir="/opt/SUNWdt/lib";
5818       eval "$xe_add_unique_runpath_dir";
5819     fi
5820   fi 
5821   if test -n "$runpath"; then
5822     ld_switch_run="${dash_r}${runpath}"
5823     
5824 if test "$GCC" = "yes"; then
5825   set x $ld_switch_run; shift; ld_switch_run=""
5826   while test -n "$1"; do
5827     case $1 in
5828       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5829       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5830       -Xlinker* ) ;;
5831       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5832     esac
5833     shift
5834   done
5835 fi
5836     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5837   fi
5838 fi
5839
5840
5841   if test "$extra_verbose" = "yes"; then
5842     echo; echo "X11 compilation variables:"
5843     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5844     echo
5845   fi
5846
5847             bitmapdirs=
5848   if test "$x_includes" != NONE; then
5849     for i in $x_includes; do
5850       if test -d "$i/bitmaps"; then
5851         bitmapdirs="$i/bitmaps:$bitmapdirs"
5852       fi
5853       if test -d "$i/X11/bitmaps"; then
5854         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5855       fi
5856     done
5857     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5858   fi
5859   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5860     Defining BITMAPDIR = "$bitmapdirs"
5861 EOF
5862 cat >> confdefs.h <<EOF
5863 #define BITMAPDIR "$bitmapdirs"
5864 EOF
5865 }
5866
5867
5868     echo "checking for X defines extracted by xmkmf" 1>&6
5869 echo "configure:5870: checking for X defines extracted by xmkmf" >&5
5870   rm -fr conftestdir
5871   if mkdir conftestdir; then
5872     cd conftestdir
5873     cat > Imakefile <<'EOF'
5874 xetest:
5875         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5876 EOF
5877     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5878       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5879       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5880     fi
5881     cd ..
5882     rm -fr conftestdir
5883     for word in $xmkmf_defines; do
5884       case "$word" in
5885         -D*=* ) ;;
5886         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5887               { test "$extra_verbose" = "yes" && cat << EOF
5888     Defining $word
5889 EOF
5890 cat >> confdefs.h <<EOF
5891 #define $word 1
5892 EOF
5893 }
5894  ;;
5895       esac
5896     done
5897   fi
5898
5899     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5900 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5901 echo "configure:5902: checking for X11/Intrinsic.h" >&5
5902
5903 cat > conftest.$ac_ext <<EOF
5904 #line 5905 "configure"
5905 #include "confdefs.h"
5906 #include <X11/Intrinsic.h>
5907 EOF
5908 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5909 { (eval echo configure:5910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5910 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5911 if test -z "$ac_err"; then
5912   rm -rf conftest*
5913   eval "ac_cv_header_$ac_safe=yes"
5914 else
5915   echo "$ac_err" >&5
5916   echo "configure: failed program was:" >&5
5917   cat conftest.$ac_ext >&5
5918   rm -rf conftest*
5919   eval "ac_cv_header_$ac_safe=no"
5920 fi
5921 rm -f conftest*
5922 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5923   echo "$ac_t""yes" 1>&6
5924   :
5925 else
5926   echo "$ac_t""no" 1>&6
5927 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5928 fi
5929
5930
5931       
5932 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5933 echo "configure:5934: checking for XOpenDisplay in -lX11" >&5
5934 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5935
5936 xe_check_libs=" -lX11 "
5937 cat > conftest.$ac_ext <<EOF
5938 #line 5939 "configure"
5939 #include "confdefs.h"
5940 /* Override any gcc2 internal prototype to avoid an error.  */
5941 /* We use char because int might match the return type of a gcc2
5942     builtin and then its argument prototype would still apply.  */
5943 char XOpenDisplay();
5944
5945 int main() {
5946 XOpenDisplay()
5947 ; return 0; }
5948 EOF
5949 if { (eval echo configure:5950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5950   rm -rf conftest*
5951   eval "ac_cv_lib_$ac_lib_var=yes"
5952 else
5953   echo "configure: failed program was:" >&5
5954   cat conftest.$ac_ext >&5
5955   rm -rf conftest*
5956   eval "ac_cv_lib_$ac_lib_var=no"
5957 fi
5958 rm -f conftest*
5959 xe_check_libs=""
5960
5961 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5962   echo "$ac_t""yes" 1>&6
5963   have_lib_x11=yes
5964 else
5965   echo "$ac_t""no" 1>&6
5966 fi
5967
5968
5969   if test "$have_lib_x11" != "yes"; then
5970     
5971 xe_msg_checking="for XGetFontProperty in -lX11"
5972 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5973 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5974 echo "configure:5975: checking "$xe_msg_checking"" >&5
5975 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5976
5977 xe_check_libs=" -lX11 -b i486-linuxaout"
5978 cat > conftest.$ac_ext <<EOF
5979 #line 5980 "configure"
5980 #include "confdefs.h"
5981 /* Override any gcc2 internal prototype to avoid an error.  */
5982 /* We use char because int might match the return type of a gcc2
5983     builtin and then its argument prototype would still apply.  */
5984 char XGetFontProperty();
5985
5986 int main() {
5987 XGetFontProperty()
5988 ; return 0; }
5989 EOF
5990 if { (eval echo configure:5991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5991   rm -rf conftest*
5992   eval "ac_cv_lib_$ac_lib_var=yes"
5993 else
5994   echo "configure: failed program was:" >&5
5995   cat conftest.$ac_ext >&5
5996   rm -rf conftest*
5997   eval "ac_cv_lib_$ac_lib_var=no"
5998 fi
5999 rm -f conftest*
6000 xe_check_libs=""
6001
6002 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6003   echo "$ac_t""yes" 1>&6
6004   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
6005 else
6006   echo "$ac_t""no" 1>&6
6007 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
6008 fi
6009
6010
6011   fi
6012   libs_x="-lX11"
6013   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
6014
6015     
6016 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
6017 echo "configure:6018: checking for XShapeSelectInput in -lXext" >&5
6018 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
6019
6020 xe_check_libs=" -lXext "
6021 cat > conftest.$ac_ext <<EOF
6022 #line 6023 "configure"
6023 #include "confdefs.h"
6024 /* Override any gcc2 internal prototype to avoid an error.  */
6025 /* We use char because int might match the return type of a gcc2
6026     builtin and then its argument prototype would still apply.  */
6027 char XShapeSelectInput();
6028
6029 int main() {
6030 XShapeSelectInput()
6031 ; return 0; }
6032 EOF
6033 if { (eval echo configure:6034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6034   rm -rf conftest*
6035   eval "ac_cv_lib_$ac_lib_var=yes"
6036 else
6037   echo "configure: failed program was:" >&5
6038   cat conftest.$ac_ext >&5
6039   rm -rf conftest*
6040   eval "ac_cv_lib_$ac_lib_var=no"
6041 fi
6042 rm -f conftest*
6043 xe_check_libs=""
6044
6045 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6046   echo "$ac_t""yes" 1>&6
6047   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
6048 else
6049   echo "$ac_t""no" 1>&6
6050 fi
6051
6052
6053
6054     
6055 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
6056 echo "configure:6057: checking for XtOpenDisplay in -lXt" >&5
6057 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
6058
6059 xe_check_libs=" -lXt "
6060 cat > conftest.$ac_ext <<EOF
6061 #line 6062 "configure"
6062 #include "confdefs.h"
6063 /* Override any gcc2 internal prototype to avoid an error.  */
6064 /* We use char because int might match the return type of a gcc2
6065     builtin and then its argument prototype would still apply.  */
6066 char XtOpenDisplay();
6067
6068 int main() {
6069 XtOpenDisplay()
6070 ; return 0; }
6071 EOF
6072 if { (eval echo configure:6073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6073   rm -rf conftest*
6074   eval "ac_cv_lib_$ac_lib_var=yes"
6075 else
6076   echo "configure: failed program was:" >&5
6077   cat conftest.$ac_ext >&5
6078   rm -rf conftest*
6079   eval "ac_cv_lib_$ac_lib_var=no"
6080 fi
6081 rm -f conftest*
6082 xe_check_libs=""
6083
6084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6085   echo "$ac_t""yes" 1>&6
6086   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
6087 else
6088   echo "$ac_t""no" 1>&6
6089 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
6090 fi
6091
6092
6093
6094   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
6095 echo "configure:6096: checking the version of X11 being used" >&5
6096   cat > conftest.$ac_ext <<EOF
6097 #line 6098 "configure"
6098 #include "confdefs.h"
6099 #include <X11/Intrinsic.h>
6100     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
6101 EOF
6102 if { (eval echo configure:6103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6103 then
6104   ./conftest foobar; x11_release=$?
6105 else
6106   conftest_rc="$?"
6107   echo "configure: failed program was:" >&5
6108   cat conftest.$ac_ext >&5
6109   rm -fr conftest*
6110   x11_release=4
6111 fi
6112 rm -fr conftest*
6113   echo "$ac_t""R${x11_release}" 1>&6
6114   { test "$extra_verbose" = "yes" && cat << EOF
6115     Defining THIS_IS_X11R${x11_release}
6116 EOF
6117 cat >> confdefs.h <<EOF
6118 #define THIS_IS_X11R${x11_release} 1
6119 EOF
6120 }
6121
6122
6123   for ac_func in XConvertCase
6124 do
6125 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6126 echo "configure:6127: checking for $ac_func" >&5
6127
6128 cat > conftest.$ac_ext <<EOF
6129 #line 6130 "configure"
6130 #include "confdefs.h"
6131 /* System header to define __stub macros and hopefully few prototypes,
6132     which can conflict with char $ac_func(); below.  */
6133 #include <assert.h>
6134 /* Override any gcc2 internal prototype to avoid an error.  */
6135 /* We use char because int might match the return type of a gcc2
6136     builtin and then its argument prototype would still apply.  */
6137 char $ac_func();
6138
6139 int main() {
6140
6141 /* The GNU C library defines this for functions which it implements
6142     to always fail with ENOSYS.  Some functions are actually named
6143     something starting with __ and the normal name is an alias.  */
6144 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6145 choke me
6146 #else
6147 $ac_func();
6148 #endif
6149
6150 ; return 0; }
6151 EOF
6152 if { (eval echo configure:6153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6153   rm -rf conftest*
6154   eval "ac_cv_func_$ac_func=yes"
6155 else
6156   echo "configure: failed program was:" >&5
6157   cat conftest.$ac_ext >&5
6158   rm -rf conftest*
6159   eval "ac_cv_func_$ac_func=no"
6160 fi
6161 rm -f conftest*
6162
6163 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6164   echo "$ac_t""yes" 1>&6
6165     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6166   { test "$extra_verbose" = "yes" && cat << EOF
6167     Defining $ac_tr_func
6168 EOF
6169 cat >> confdefs.h <<EOF
6170 #define $ac_tr_func 1
6171 EOF
6172 }
6173  
6174 else
6175   echo "$ac_t""no" 1>&6
6176 fi
6177 done
6178
6179
6180   for ac_hdr in X11/Xlocale.h
6181 do
6182 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6183 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6184 echo "configure:6185: checking for $ac_hdr" >&5
6185
6186 cat > conftest.$ac_ext <<EOF
6187 #line 6188 "configure"
6188 #include "confdefs.h"
6189 #include <$ac_hdr>
6190 EOF
6191 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6192 { (eval echo configure:6193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6193 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6194 if test -z "$ac_err"; then
6195   rm -rf conftest*
6196   eval "ac_cv_header_$ac_safe=yes"
6197 else
6198   echo "$ac_err" >&5
6199   echo "configure: failed program was:" >&5
6200   cat conftest.$ac_ext >&5
6201   rm -rf conftest*
6202   eval "ac_cv_header_$ac_safe=no"
6203 fi
6204 rm -f conftest*
6205 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6206   echo "$ac_t""yes" 1>&6
6207     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6208   { test "$extra_verbose" = "yes" && cat << EOF
6209     Defining $ac_tr_hdr
6210 EOF
6211 cat >> confdefs.h <<EOF
6212 #define $ac_tr_hdr 1
6213 EOF
6214 }
6215  
6216 else
6217   echo "$ac_t""no" 1>&6
6218 fi
6219 done
6220
6221
6222     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
6223 echo "configure:6224: checking for XFree86" >&5
6224   if test -d "/usr/X386/include" -o \
6225           -f "/etc/XF86Config"    -o \
6226           -f "/etc/X11/XF86Config" -o \
6227           -f "/usr/X11R6/lib/X11/XF86Config"; then
6228     echo "$ac_t""yes" 1>&6
6229     { test "$extra_verbose" = "yes" && cat << \EOF
6230     Defining HAVE_XFREE386
6231 EOF
6232 cat >> confdefs.h <<\EOF
6233 #define HAVE_XFREE386 1
6234 EOF
6235 }
6236
6237   else
6238     echo "$ac_t""no" 1>&6
6239   fi
6240
6241     test -z "$with_xmu" && { 
6242 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
6243 echo "configure:6244: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
6244 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
6245
6246 xe_check_libs=" -lXmu "
6247 cat > conftest.$ac_ext <<EOF
6248 #line 6249 "configure"
6249 #include "confdefs.h"
6250 /* Override any gcc2 internal prototype to avoid an error.  */
6251 /* We use char because int might match the return type of a gcc2
6252     builtin and then its argument prototype would still apply.  */
6253 char XmuReadBitmapDataFromFile();
6254
6255 int main() {
6256 XmuReadBitmapDataFromFile()
6257 ; return 0; }
6258 EOF
6259 if { (eval echo configure:6260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6260   rm -rf conftest*
6261   eval "ac_cv_lib_$ac_lib_var=yes"
6262 else
6263   echo "configure: failed program was:" >&5
6264   cat conftest.$ac_ext >&5
6265   rm -rf conftest*
6266   eval "ac_cv_lib_$ac_lib_var=no"
6267 fi
6268 rm -f conftest*
6269 xe_check_libs=""
6270
6271 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6272   echo "$ac_t""yes" 1>&6
6273   with_xmu=yes
6274 else
6275   echo "$ac_t""no" 1>&6
6276 with_xmu=no
6277 fi
6278
6279  }
6280   if test "$with_xmu" = "no"; then
6281     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
6282    echo "    xemacs will be linked with \"xmu.o\""
6283  fi
6284   else
6285     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
6286     { test "$extra_verbose" = "yes" && cat << \EOF
6287     Defining HAVE_XMU
6288 EOF
6289 cat >> confdefs.h <<\EOF
6290 #define HAVE_XMU 1
6291 EOF
6292 }
6293
6294   fi
6295
6296       
6297 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
6298 echo "configure:6299: checking for main in -lXbsd" >&5
6299 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
6300
6301 xe_check_libs=" -lXbsd "
6302 cat > conftest.$ac_ext <<EOF
6303 #line 6304 "configure"
6304 #include "confdefs.h"
6305
6306 int main() {
6307 main()
6308 ; return 0; }
6309 EOF
6310 if { (eval echo configure:6311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6311   rm -rf conftest*
6312   eval "ac_cv_lib_$ac_lib_var=yes"
6313 else
6314   echo "configure: failed program was:" >&5
6315   cat conftest.$ac_ext >&5
6316   rm -rf conftest*
6317   eval "ac_cv_lib_$ac_lib_var=no"
6318 fi
6319 rm -f conftest*
6320 xe_check_libs=""
6321
6322 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6323   echo "$ac_t""yes" 1>&6
6324   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
6325 else
6326   echo "$ac_t""no" 1>&6
6327 fi
6328
6329
6330
6331     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
6332         if test "$GCC" = "yes"; then
6333       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
6334       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
6335     else
6336       case "$CC" in
6337         "xlc" ) CC="xlc_r" ;;
6338         "xlC" ) CC="xlC_r" ;;
6339         "cc"  ) CC="cc_r" ;;
6340       esac
6341     fi
6342   fi
6343
6344 fi 
6345 if test "$with_msw" != "no"; then
6346   echo "checking for MS-Windows" 1>&6
6347 echo "configure:6348: checking for MS-Windows" >&5
6348   
6349 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
6350 echo "configure:6351: checking for main in -lgdi32" >&5
6351 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
6352
6353 xe_check_libs=" -lgdi32 "
6354 cat > conftest.$ac_ext <<EOF
6355 #line 6356 "configure"
6356 #include "confdefs.h"
6357
6358 int main() {
6359 main()
6360 ; return 0; }
6361 EOF
6362 if { (eval echo configure:6363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6363   rm -rf conftest*
6364   eval "ac_cv_lib_$ac_lib_var=yes"
6365 else
6366   echo "configure: failed program was:" >&5
6367   cat conftest.$ac_ext >&5
6368   rm -rf conftest*
6369   eval "ac_cv_lib_$ac_lib_var=no"
6370 fi
6371 rm -f conftest*
6372 xe_check_libs=""
6373
6374 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6375   echo "$ac_t""yes" 1>&6
6376   with_msw=yes
6377 else
6378   echo "$ac_t""no" 1>&6
6379 fi
6380
6381
6382   if test "$with_msw" = "yes"; then
6383     { test "$extra_verbose" = "yes" && cat << \EOF
6384     Defining HAVE_MS_WINDOWS
6385 EOF
6386 cat >> confdefs.h <<\EOF
6387 #define HAVE_MS_WINDOWS 1
6388 EOF
6389 }
6390
6391     install_pp="$blddir/lib-src/installexe.sh"
6392     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32 -lwinspool" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32 -lwinspool\" to \$libs_system"; fi
6393     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6394     if test "$window_system" != x11; then
6395         window_system=msw
6396         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6397             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6398    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6399  fi
6400         test "$with_menubars"   != "no" && with_menubars=msw \
6401             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6402    echo "    xemacs will be linked with \"menubar-msw.o\""
6403  fi
6404         test "$with_toolbars"   != "no" && with_toolbars=msw \
6405             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6406    echo "    xemacs will be linked with \"toolbar-msw.o\""
6407  fi
6408         test "$with_dialogs"   != "no" && with_dialogs=msw \
6409             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6410    echo "    xemacs will be linked with \"dialog-msw.o\""
6411  fi
6412         test "$with_widgets"   != "no" && with_widgets=msw
6413     else
6414         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6415    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6416  fi
6417         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6418    echo "    xemacs will be linked with \"menubar-msw.o\""
6419  fi
6420         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6421    echo "    xemacs will be linked with \"toolbar-msw.o\""
6422  fi
6423         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6424    echo "    xemacs will be linked with \"dialog-msw.o\""
6425  fi
6426     fi
6427         cat > conftest.$ac_ext <<EOF
6428 #line 6429 "configure"
6429 #include "confdefs.h"
6430 #include <fcntl.h>
6431     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6432 EOF
6433 if { (eval echo configure:6434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6434 then
6435   { test "$extra_verbose" = "yes" && cat << \EOF
6436     Defining HAVE_MSG_SELECT
6437 EOF
6438 cat >> confdefs.h <<\EOF
6439 #define HAVE_MSG_SELECT 1
6440 EOF
6441 }
6442
6443 else
6444   conftest_rc="$?"
6445   echo "configure: failed program was:" >&5
6446   cat conftest.$ac_ext >&5
6447 fi
6448 rm -fr conftest*
6449     with_file_coding=yes
6450     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
6451    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\""
6452  fi
6453   fi
6454 fi
6455
6456
6457
6458 test -z "$window_system" && window_system="none"
6459
6460 if test "$window_system" = "none"; then
6461   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6462   do
6463     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6464        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6465     fi
6466     eval "with_${feature}=no"
6467   done
6468 else
6469   test -z "$with_toolbars" && with_toolbars=yes
6470 fi
6471
6472 if test "$with_msw" != "yes"; then
6473   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6474   do
6475     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6476        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6477     fi
6478     eval "with_${feature}=no"
6479   done
6480 else
6481   :
6482 fi
6483
6484 if test "$with_x11" != "yes"; then
6485             for feature in tooltalk cde offix wmcommand xim xmu nas_sound
6486   do
6487     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6488        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6489     fi
6490     eval "with_${feature}=no"
6491   done
6492 fi
6493
6494 bitmapdir=
6495
6496 case "$window_system" in
6497   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6498   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6499   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6500 esac
6501
6502 case "$x_libraries" in *X11R4* )
6503   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6504   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6505 esac
6506
6507 echo "checking for WM_COMMAND option" 1>&6
6508 echo "configure:6509: checking for WM_COMMAND option" >&5;
6509 if test "$with_wmcommand" != "no"; then
6510   { test "$extra_verbose" = "yes" && cat << \EOF
6511     Defining HAVE_WMCOMMAND
6512 EOF
6513 cat >> confdefs.h <<\EOF
6514 #define HAVE_WMCOMMAND 1
6515 EOF
6516 }
6517
6518 fi
6519
6520 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6521 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6522 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6523 echo "configure:6524: checking for X11/Xauth.h" >&5
6524
6525 cat > conftest.$ac_ext <<EOF
6526 #line 6527 "configure"
6527 #include "confdefs.h"
6528 #include <X11/Xauth.h>
6529 EOF
6530 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6531 { (eval echo configure:6532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6532 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6533 if test -z "$ac_err"; then
6534   rm -rf conftest*
6535   eval "ac_cv_header_$ac_safe=yes"
6536 else
6537   echo "$ac_err" >&5
6538   echo "configure: failed program was:" >&5
6539   cat conftest.$ac_ext >&5
6540   rm -rf conftest*
6541   eval "ac_cv_header_$ac_safe=no"
6542 fi
6543 rm -f conftest*
6544 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6545   echo "$ac_t""yes" 1>&6
6546   :
6547 else
6548   echo "$ac_t""no" 1>&6
6549 with_xauth=no
6550 fi
6551  }
6552 test -z "$with_xauth" && { 
6553 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6554 echo "configure:6555: checking for XauGetAuthByAddr in -lXau" >&5
6555 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6556
6557 xe_check_libs=" -lXau "
6558 cat > conftest.$ac_ext <<EOF
6559 #line 6560 "configure"
6560 #include "confdefs.h"
6561 /* Override any gcc2 internal prototype to avoid an error.  */
6562 /* We use char because int might match the return type of a gcc2
6563     builtin and then its argument prototype would still apply.  */
6564 char XauGetAuthByAddr();
6565
6566 int main() {
6567 XauGetAuthByAddr()
6568 ; return 0; }
6569 EOF
6570 if { (eval echo configure:6571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6571   rm -rf conftest*
6572   eval "ac_cv_lib_$ac_lib_var=yes"
6573 else
6574   echo "configure: failed program was:" >&5
6575   cat conftest.$ac_ext >&5
6576   rm -rf conftest*
6577   eval "ac_cv_lib_$ac_lib_var=no"
6578 fi
6579 rm -f conftest*
6580 xe_check_libs=""
6581
6582 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6583   echo "$ac_t""yes" 1>&6
6584   :
6585 else
6586   echo "$ac_t""no" 1>&6
6587 with_xauth=no
6588 fi
6589
6590  }
6591 test -z "$with_xauth" && with_xauth=yes
6592 if test "$with_xauth" = "yes"; then
6593   { test "$extra_verbose" = "yes" && cat << \EOF
6594     Defining HAVE_XAUTH
6595 EOF
6596 cat >> confdefs.h <<\EOF
6597 #define HAVE_XAUTH 1
6598 EOF
6599 }
6600
6601   
6602 T=""
6603 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
6604 libs_xauth="$T"
6605
6606 fi
6607
6608
6609
6610
6611 if test "$with_tooltalk" != "no" ; then
6612       for dir in "" "Tt/" "desktop/" ; do
6613     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6614 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6615 echo "configure:6616: checking for ${dir}tt_c.h" >&5
6616
6617 cat > conftest.$ac_ext <<EOF
6618 #line 6619 "configure"
6619 #include "confdefs.h"
6620 #include <${dir}tt_c.h>
6621 EOF
6622 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6623 { (eval echo configure:6624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6624 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6625 if test -z "$ac_err"; then
6626   rm -rf conftest*
6627   eval "ac_cv_header_$ac_safe=yes"
6628 else
6629   echo "$ac_err" >&5
6630   echo "configure: failed program was:" >&5
6631   cat conftest.$ac_ext >&5
6632   rm -rf conftest*
6633   eval "ac_cv_header_$ac_safe=no"
6634 fi
6635 rm -f conftest*
6636 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6637   echo "$ac_t""yes" 1>&6
6638   tt_c_h_file="${dir}tt_c.h"; break
6639 else
6640   echo "$ac_t""no" 1>&6
6641 fi
6642
6643   done
6644   if test -z "$tt_c_h_file"; then
6645     if test "$with_tooltalk" = "yes"; then
6646       (echo "$progname: Usage error:"
6647 echo " " "Unable to find required tooltalk header files."
6648 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6649     fi
6650     with_tooltalk=no
6651   fi
6652 fi
6653 if test "$with_tooltalk" != "no" ; then
6654   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6655     
6656 xe_msg_checking="for tt_message_create in -ltt"
6657 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6658 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6659 echo "configure:6660: checking "$xe_msg_checking"" >&5
6660 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6661
6662 xe_check_libs=" -ltt $extra_libs"
6663 cat > conftest.$ac_ext <<EOF
6664 #line 6665 "configure"
6665 #include "confdefs.h"
6666 /* Override any gcc2 internal prototype to avoid an error.  */
6667 /* We use char because int might match the return type of a gcc2
6668     builtin and then its argument prototype would still apply.  */
6669 char tt_message_create();
6670
6671 int main() {
6672 tt_message_create()
6673 ; return 0; }
6674 EOF
6675 if { (eval echo configure:6676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6676   rm -rf conftest*
6677   eval "ac_cv_lib_$ac_lib_var=yes"
6678 else
6679   echo "configure: failed program was:" >&5
6680   cat conftest.$ac_ext >&5
6681   rm -rf conftest*
6682   eval "ac_cv_lib_$ac_lib_var=no"
6683 fi
6684 rm -f conftest*
6685 xe_check_libs=""
6686
6687 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6688   echo "$ac_t""yes" 1>&6
6689   tt_libs="-ltt $extra_libs"; break
6690 else
6691   echo "$ac_t""no" 1>&6
6692 :
6693 fi
6694
6695
6696   done
6697   if test -z "$tt_libs"; then
6698     if test "$with_tooltalk" = "yes"; then
6699       (echo "$progname: Usage error:"
6700 echo " " "Unable to find required tooltalk libraries."
6701 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6702     fi
6703     with_tooltalk=no
6704   fi
6705 fi
6706 test -z "$with_tooltalk" && with_tooltalk=yes
6707 if test "$with_tooltalk" = "yes"; then
6708   { test "$extra_verbose" = "yes" && cat << \EOF
6709     Defining TOOLTALK
6710 EOF
6711 cat >> confdefs.h <<\EOF
6712 #define TOOLTALK 1
6713 EOF
6714 }
6715
6716   { test "$extra_verbose" = "yes" && cat << EOF
6717     Defining TT_C_H_FILE = "$tt_c_h_file"
6718 EOF
6719 cat >> confdefs.h <<EOF
6720 #define TT_C_H_FILE "$tt_c_h_file"
6721 EOF
6722 }
6723
6724   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6725   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6726    echo "    xemacs will be linked with \"tooltalk.o\""
6727  fi
6728 fi
6729
6730 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6731 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6732 echo "configure:6733: checking for Dt/Dt.h" >&5
6733
6734 cat > conftest.$ac_ext <<EOF
6735 #line 6736 "configure"
6736 #include "confdefs.h"
6737 #include <Dt/Dt.h>
6738 EOF
6739 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6740 { (eval echo configure:6741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6741 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6742 if test -z "$ac_err"; then
6743   rm -rf conftest*
6744   eval "ac_cv_header_$ac_safe=yes"
6745 else
6746   echo "$ac_err" >&5
6747   echo "configure: failed program was:" >&5
6748   cat conftest.$ac_ext >&5
6749   rm -rf conftest*
6750   eval "ac_cv_header_$ac_safe=no"
6751 fi
6752 rm -f conftest*
6753 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6754   echo "$ac_t""yes" 1>&6
6755   :
6756 else
6757   echo "$ac_t""no" 1>&6
6758 with_cde=no
6759 fi
6760  }
6761 test -z "$with_cde" && { 
6762 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6763 echo "configure:6764: checking for DtDndDragStart in -lDtSvc" >&5
6764 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6765
6766 xe_check_libs=" -lDtSvc "
6767 cat > conftest.$ac_ext <<EOF
6768 #line 6769 "configure"
6769 #include "confdefs.h"
6770 /* Override any gcc2 internal prototype to avoid an error.  */
6771 /* We use char because int might match the return type of a gcc2
6772     builtin and then its argument prototype would still apply.  */
6773 char DtDndDragStart();
6774
6775 int main() {
6776 DtDndDragStart()
6777 ; return 0; }
6778 EOF
6779 if { (eval echo configure:6780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6780   rm -rf conftest*
6781   eval "ac_cv_lib_$ac_lib_var=yes"
6782 else
6783   echo "configure: failed program was:" >&5
6784   cat conftest.$ac_ext >&5
6785   rm -rf conftest*
6786   eval "ac_cv_lib_$ac_lib_var=no"
6787 fi
6788 rm -f conftest*
6789 xe_check_libs=""
6790
6791 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6792   echo "$ac_t""yes" 1>&6
6793   :
6794 else
6795   echo "$ac_t""no" 1>&6
6796 with_cde=no
6797 fi
6798
6799  }
6800 test -z "$with_cde" && with_cde=yes
6801 if test "$with_dragndrop" = no; then
6802   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6803   with_cde=no
6804 fi
6805 if test "$with_cde" = "yes" ; then
6806   { test "$extra_verbose" = "yes" && cat << \EOF
6807     Defining HAVE_CDE
6808 EOF
6809 cat >> confdefs.h <<\EOF
6810 #define HAVE_CDE 1
6811 EOF
6812 }
6813
6814   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6815   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6816   with_tooltalk=yes # CDE requires Tooltalk
6817   need_motif=yes    # CDE requires Motif
6818 fi
6819
6820 test "$window_system" != "x11" && with_offix=no
6821 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6822   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6823   with_offix=no
6824 fi
6825 if test "$with_dragndrop" = no; then
6826   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6827   with_offix=no
6828 fi
6829 if test "$with_cde" = yes; then
6830   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6831   with_offix=no
6832 fi
6833 test -z "$with_offix" && with_offix=no
6834 if test "$with_offix" = "yes"; then
6835   { test "$extra_verbose" = "yes" && cat << \EOF
6836     Defining HAVE_OFFIX_DND
6837 EOF
6838 cat >> confdefs.h <<\EOF
6839 #define HAVE_OFFIX_DND 1
6840 EOF
6841 }
6842
6843   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6844   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6845 fi
6846
6847 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6848 echo "configure:6849: checking if drag and drop API is needed" >&5
6849 if test "$with_dragndrop" != "no" ; then
6850   if test -n "$dragndrop_proto" ; then
6851     with_dragndrop=yes
6852     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6853     { test "$extra_verbose" = "yes" && cat << \EOF
6854     Defining HAVE_DRAGNDROP
6855 EOF
6856 cat >> confdefs.h <<\EOF
6857 #define HAVE_DRAGNDROP 1
6858 EOF
6859 }
6860
6861     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6862   else
6863     with_dragndrop=no
6864     echo "$ac_t""no" 1>&6
6865   fi
6866 fi
6867
6868 echo "checking for LDAP" 1>&6
6869 echo "configure:6870: checking for LDAP" >&5
6870 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6871 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6872 echo "configure:6873: checking for ldap.h" >&5
6873
6874 cat > conftest.$ac_ext <<EOF
6875 #line 6876 "configure"
6876 #include "confdefs.h"
6877 #include <ldap.h>
6878 EOF
6879 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6880 { (eval echo configure:6881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6881 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6882 if test -z "$ac_err"; then
6883   rm -rf conftest*
6884   eval "ac_cv_header_$ac_safe=yes"
6885 else
6886   echo "$ac_err" >&5
6887   echo "configure: failed program was:" >&5
6888   cat conftest.$ac_ext >&5
6889   rm -rf conftest*
6890   eval "ac_cv_header_$ac_safe=no"
6891 fi
6892 rm -f conftest*
6893 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6894   echo "$ac_t""yes" 1>&6
6895   :
6896 else
6897   echo "$ac_t""no" 1>&6
6898 with_ldap=no
6899 fi
6900  }
6901 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6902 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6903 echo "configure:6904: checking for lber.h" >&5
6904
6905 cat > conftest.$ac_ext <<EOF
6906 #line 6907 "configure"
6907 #include "confdefs.h"
6908 #include <lber.h>
6909 EOF
6910 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6911 { (eval echo configure:6912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6912 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6913 if test -z "$ac_err"; then
6914   rm -rf conftest*
6915   eval "ac_cv_header_$ac_safe=yes"
6916 else
6917   echo "$ac_err" >&5
6918   echo "configure: failed program was:" >&5
6919   cat conftest.$ac_ext >&5
6920   rm -rf conftest*
6921   eval "ac_cv_header_$ac_safe=no"
6922 fi
6923 rm -f conftest*
6924 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6925   echo "$ac_t""yes" 1>&6
6926   :
6927 else
6928   echo "$ac_t""no" 1>&6
6929 with_ldap=no
6930 fi
6931  }
6932 if test "$with_ldap" != "no"; then
6933   
6934 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
6935 echo "configure:6936: checking for ldap_search in -lldap" >&5
6936 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
6937
6938 xe_check_libs=" -lldap "
6939 cat > conftest.$ac_ext <<EOF
6940 #line 6941 "configure"
6941 #include "confdefs.h"
6942 /* Override any gcc2 internal prototype to avoid an error.  */
6943 /* We use char because int might match the return type of a gcc2
6944     builtin and then its argument prototype would still apply.  */
6945 char ldap_search();
6946
6947 int main() {
6948 ldap_search()
6949 ; return 0; }
6950 EOF
6951 if { (eval echo configure:6952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6952   rm -rf conftest*
6953   eval "ac_cv_lib_$ac_lib_var=yes"
6954 else
6955   echo "configure: failed program was:" >&5
6956   cat conftest.$ac_ext >&5
6957   rm -rf conftest*
6958   eval "ac_cv_lib_$ac_lib_var=no"
6959 fi
6960 rm -f conftest*
6961 xe_check_libs=""
6962
6963 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6964   echo "$ac_t""yes" 1>&6
6965   with_ldap_nolber=yes
6966 else
6967   echo "$ac_t""no" 1>&6
6968 with_ldap_nolber=no
6969 fi
6970
6971
6972   test "$with_ldap_nolber" = "no" && { 
6973 xe_msg_checking="for ldap_open in -lldap"
6974 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6975 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6976 echo "configure:6977: checking "$xe_msg_checking"" >&5
6977 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6978
6979 xe_check_libs=" -lldap -llber"
6980 cat > conftest.$ac_ext <<EOF
6981 #line 6982 "configure"
6982 #include "confdefs.h"
6983 /* Override any gcc2 internal prototype to avoid an error.  */
6984 /* We use char because int might match the return type of a gcc2
6985     builtin and then its argument prototype would still apply.  */
6986 char ldap_open();
6987
6988 int main() {
6989 ldap_open()
6990 ; return 0; }
6991 EOF
6992 if { (eval echo configure:6993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6993   rm -rf conftest*
6994   eval "ac_cv_lib_$ac_lib_var=yes"
6995 else
6996   echo "configure: failed program was:" >&5
6997   cat conftest.$ac_ext >&5
6998   rm -rf conftest*
6999   eval "ac_cv_lib_$ac_lib_var=no"
7000 fi
7001 rm -f conftest*
7002 xe_check_libs=""
7003
7004 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7005   echo "$ac_t""yes" 1>&6
7006   with_ldap_lber=yes
7007 else
7008   echo "$ac_t""no" 1>&6
7009 with_ldap_lber=no
7010 fi
7011
7012  }
7013   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { 
7014 xe_msg_checking="for ldap_open in -lldap"
7015 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
7016 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7017 echo "configure:7018: checking "$xe_msg_checking"" >&5
7018 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7019
7020 xe_check_libs=" -lldap -llber -lkrb"
7021 cat > conftest.$ac_ext <<EOF
7022 #line 7023 "configure"
7023 #include "confdefs.h"
7024 /* Override any gcc2 internal prototype to avoid an error.  */
7025 /* We use char because int might match the return type of a gcc2
7026     builtin and then its argument prototype would still apply.  */
7027 char ldap_open();
7028
7029 int main() {
7030 ldap_open()
7031 ; return 0; }
7032 EOF
7033 if { (eval echo configure:7034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7034   rm -rf conftest*
7035   eval "ac_cv_lib_$ac_lib_var=yes"
7036 else
7037   echo "configure: failed program was:" >&5
7038   cat conftest.$ac_ext >&5
7039   rm -rf conftest*
7040   eval "ac_cv_lib_$ac_lib_var=no"
7041 fi
7042 rm -f conftest*
7043 xe_check_libs=""
7044
7045 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7046   echo "$ac_t""yes" 1>&6
7047   with_ldap_krb=yes
7048 else
7049   echo "$ac_t""no" 1>&6
7050 with_ldap_krb=no
7051 fi
7052
7053  }
7054   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { 
7055 xe_msg_checking="for ldap_open in -lldap"
7056 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
7057 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
7058 echo "configure:7059: checking "$xe_msg_checking"" >&5
7059 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
7060
7061 xe_check_libs=" -lldap -llber -lkrb -ldes"
7062 cat > conftest.$ac_ext <<EOF
7063 #line 7064 "configure"
7064 #include "confdefs.h"
7065 /* Override any gcc2 internal prototype to avoid an error.  */
7066 /* We use char because int might match the return type of a gcc2
7067     builtin and then its argument prototype would still apply.  */
7068 char ldap_open();
7069
7070 int main() {
7071 ldap_open()
7072 ; return 0; }
7073 EOF
7074 if { (eval echo configure:7075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7075   rm -rf conftest*
7076   eval "ac_cv_lib_$ac_lib_var=yes"
7077 else
7078   echo "configure: failed program was:" >&5
7079   cat conftest.$ac_ext >&5
7080   rm -rf conftest*
7081   eval "ac_cv_lib_$ac_lib_var=no"
7082 fi
7083 rm -f conftest*
7084 xe_check_libs=""
7085
7086 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7087   echo "$ac_t""yes" 1>&6
7088   with_ldap_krbdes=yes
7089 else
7090   echo "$ac_t""no" 1>&6
7091 with_ldap_krbdes=no
7092 fi
7093
7094  }
7095   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
7096 fi
7097 if test "$with_ldap" = "yes"; then
7098   { test "$extra_verbose" = "yes" && cat << \EOF
7099     Defining HAVE_LDAP
7100 EOF
7101 cat >> confdefs.h <<\EOF
7102 #define HAVE_LDAP 1
7103 EOF
7104 }
7105
7106   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
7107    echo "    xemacs will be linked with \"eldap.o\""
7108  fi
7109   if test "$with_ldap_nolber" = "yes" ; then
7110     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
7111   else
7112     if test "$with_ldap_krb" = "yes" ; then
7113       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
7114     fi
7115     if test "$with_ldap_krbdes" = "yes" ; then
7116       LIBS="-ldes $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldes\" to \$LIBS"; fi
7117       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
7118     fi
7119     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
7120     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
7121   fi
7122   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
7123 do
7124 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7125 echo "configure:7126: checking for $ac_func" >&5
7126
7127 cat > conftest.$ac_ext <<EOF
7128 #line 7129 "configure"
7129 #include "confdefs.h"
7130 /* System header to define __stub macros and hopefully few prototypes,
7131     which can conflict with char $ac_func(); below.  */
7132 #include <assert.h>
7133 /* Override any gcc2 internal prototype to avoid an error.  */
7134 /* We use char because int might match the return type of a gcc2
7135     builtin and then its argument prototype would still apply.  */
7136 char $ac_func();
7137
7138 int main() {
7139
7140 /* The GNU C library defines this for functions which it implements
7141     to always fail with ENOSYS.  Some functions are actually named
7142     something starting with __ and the normal name is an alias.  */
7143 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7144 choke me
7145 #else
7146 $ac_func();
7147 #endif
7148
7149 ; return 0; }
7150 EOF
7151 if { (eval echo configure:7152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7152   rm -rf conftest*
7153   eval "ac_cv_func_$ac_func=yes"
7154 else
7155   echo "configure: failed program was:" >&5
7156   cat conftest.$ac_ext >&5
7157   rm -rf conftest*
7158   eval "ac_cv_func_$ac_func=no"
7159 fi
7160 rm -f conftest*
7161
7162 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7163   echo "$ac_t""yes" 1>&6
7164     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7165   { test "$extra_verbose" = "yes" && cat << EOF
7166     Defining $ac_tr_func
7167 EOF
7168 cat >> confdefs.h <<EOF
7169 #define $ac_tr_func 1
7170 EOF
7171 }
7172  
7173 else
7174   echo "$ac_t""no" 1>&6
7175 fi
7176 done
7177
7178 fi
7179
7180 echo "checking for PostgreSQL" 1>&6
7181 echo "configure:7182: checking for PostgreSQL" >&5
7182 postgres_h_path=""
7183 postgres_includes_found=no
7184 save_c_switch_site="$c_switch_site"
7185
7186 if test "$with_postgresql" != "no"; then
7187         ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
7188 echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
7189 echo "configure:7190: checking for libpq-fe.h" >&5
7190
7191 cat > conftest.$ac_ext <<EOF
7192 #line 7193 "configure"
7193 #include "confdefs.h"
7194 #include <libpq-fe.h>
7195 EOF
7196 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7197 { (eval echo configure:7198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7198 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7199 if test -z "$ac_err"; then
7200   rm -rf conftest*
7201   eval "ac_cv_header_$ac_safe=yes"
7202 else
7203   echo "$ac_err" >&5
7204   echo "configure: failed program was:" >&5
7205   cat conftest.$ac_ext >&5
7206   rm -rf conftest*
7207   eval "ac_cv_header_$ac_safe=no"
7208 fi
7209 rm -f conftest*
7210 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7211   echo "$ac_t""yes" 1>&6
7212   postgres_includes_found=yes
7213 else
7214   echo "$ac_t""no" 1>&6
7215 fi
7216
7217 fi
7218
7219 if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \
7220         -d "/usr/local/pgsql/include"; then
7221         c_switch_site="$c_switch_site -I/usr/local/pgsql/include"
7222         ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
7223 echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
7224 echo "configure:7225: checking for libpq-fe.h" >&5
7225
7226 cat > conftest.$ac_ext <<EOF
7227 #line 7228 "configure"
7228 #include "confdefs.h"
7229 #include <libpq-fe.h>
7230 EOF
7231 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7232 { (eval echo configure:7233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7233 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7234 if test -z "$ac_err"; then
7235   rm -rf conftest*
7236   eval "ac_cv_header_$ac_safe=yes"
7237 else
7238   echo "$ac_err" >&5
7239   echo "configure: failed program was:" >&5
7240   cat conftest.$ac_ext >&5
7241   rm -rf conftest*
7242   eval "ac_cv_header_$ac_safe=no"
7243 fi
7244 rm -f conftest*
7245 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7246   echo "$ac_t""yes" 1>&6
7247   postgres_includes_found=yes
7248 else
7249   echo "$ac_t""no" 1>&6
7250 fi
7251
7252         if test "$postgres_includes_found" != "yes"; then
7253                 postgres_h_path="/usr/local/pgsql/include"
7254         fi
7255         c_switch_site="$save_c_switch_site"
7256 fi
7257 if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \
7258         -d "/usr/include/pgsql"; then
7259         c_switch_site="$c_switch_site -I/usr/include/pgsql"
7260         ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
7261 echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
7262 echo "configure:7263: checking for libpq-fe.h" >&5
7263
7264 cat > conftest.$ac_ext <<EOF
7265 #line 7266 "configure"
7266 #include "confdefs.h"
7267 #include <libpq-fe.h>
7268 EOF
7269 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7270 { (eval echo configure:7271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7271 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7272 if test -z "$ac_err"; then
7273   rm -rf conftest*
7274   eval "ac_cv_header_$ac_safe=yes"
7275 else
7276   echo "$ac_err" >&5
7277   echo "configure: failed program was:" >&5
7278   cat conftest.$ac_ext >&5
7279   rm -rf conftest*
7280   eval "ac_cv_header_$ac_safe=no"
7281 fi
7282 rm -f conftest*
7283 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7284   echo "$ac_t""yes" 1>&6
7285   postgres_includes_found=yes
7286 else
7287   echo "$ac_t""no" 1>&6
7288 fi
7289
7290         if test "$postgres_includes_found" = "yes"; then
7291                 postgres_h_path="pgsql"
7292         fi
7293                 c_switch_site="$save_c_switch_site"
7294         fi
7295 if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \
7296         -d "/usr/include/postgresql"; then
7297         c_switch_site="$c_switch_site -I/usr/include/postgresql"
7298         ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
7299 echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
7300 echo "configure:7301: checking for libpq-fe.h" >&5
7301
7302 cat > conftest.$ac_ext <<EOF
7303 #line 7304 "configure"
7304 #include "confdefs.h"
7305 #include <libpq-fe.h>
7306 EOF
7307 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7308 { (eval echo configure:7309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7309 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7310 if test -z "$ac_err"; then
7311   rm -rf conftest*
7312   eval "ac_cv_header_$ac_safe=yes"
7313 else
7314   echo "$ac_err" >&5
7315   echo "configure: failed program was:" >&5
7316   cat conftest.$ac_ext >&5
7317   rm -rf conftest*
7318   eval "ac_cv_header_$ac_safe=no"
7319 fi
7320 rm -f conftest*
7321 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7322   echo "$ac_t""yes" 1>&6
7323   postgres_includes_found=yes
7324 else
7325   echo "$ac_t""no" 1>&6
7326 fi
7327
7328         if test "$postgres_includes_found" = "yes"; then
7329                 postgres_h_path="postgresql"
7330 fi
7331         c_switch_site="$save_c_switch_site"
7332 fi
7333
7334 if test "$postgres_includes_found" = "yes"; then
7335         
7336 echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
7337 echo "configure:7338: checking for PQconnectdb in -lpq" >&5
7338 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'`
7339
7340 xe_check_libs=" -lpq "
7341 cat > conftest.$ac_ext <<EOF
7342 #line 7343 "configure"
7343 #include "confdefs.h"
7344 /* Override any gcc2 internal prototype to avoid an error.  */
7345 /* We use char because int might match the return type of a gcc2
7346     builtin and then its argument prototype would still apply.  */
7347 char PQconnectdb();
7348
7349 int main() {
7350 PQconnectdb()
7351 ; return 0; }
7352 EOF
7353 if { (eval echo configure:7354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7354   rm -rf conftest*
7355   eval "ac_cv_lib_$ac_lib_var=yes"
7356 else
7357   echo "configure: failed program was:" >&5
7358   cat conftest.$ac_ext >&5
7359   rm -rf conftest*
7360   eval "ac_cv_lib_$ac_lib_var=no"
7361 fi
7362 rm -f conftest*
7363 xe_check_libs=""
7364
7365 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7366   echo "$ac_t""yes" 1>&6
7367   with_postgresql=yes
7368 else
7369   echo "$ac_t""no" 1>&6
7370 with_postgresql=no
7371 fi
7372
7373
7374 fi
7375 if test "$with_postgresql" = "yes"; then
7376         
7377 echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6
7378 echo "configure:7379: checking for PQconnectStart in -lpq" >&5
7379 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'`
7380
7381 xe_check_libs=" -lpq "
7382 cat > conftest.$ac_ext <<EOF
7383 #line 7384 "configure"
7384 #include "confdefs.h"
7385 /* Override any gcc2 internal prototype to avoid an error.  */
7386 /* We use char because int might match the return type of a gcc2
7387     builtin and then its argument prototype would still apply.  */
7388 char PQconnectStart();
7389
7390 int main() {
7391 PQconnectStart()
7392 ; return 0; }
7393 EOF
7394 if { (eval echo configure:7395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7395   rm -rf conftest*
7396   eval "ac_cv_lib_$ac_lib_var=yes"
7397 else
7398   echo "configure: failed program was:" >&5
7399   cat conftest.$ac_ext >&5
7400   rm -rf conftest*
7401   eval "ac_cv_lib_$ac_lib_var=no"
7402 fi
7403 rm -f conftest*
7404 xe_check_libs=""
7405
7406 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7407   echo "$ac_t""yes" 1>&6
7408   with_postgresqlv7=yes
7409 else
7410   echo "$ac_t""no" 1>&6
7411 with_postgresqlv7=no
7412 fi
7413
7414
7415 fi
7416 if test "$with_postgresql" = "yes"; then
7417         if test -n "$postgres_h_path"; then
7418                 { test "$extra_verbose" = "yes" && cat << EOF
7419     Defining POSTGRES_H_PATH = $postgres_h_path
7420 EOF
7421 cat >> confdefs.h <<EOF
7422 #define POSTGRES_H_PATH $postgres_h_path
7423 EOF
7424 }
7425
7426         fi
7427         { test "$extra_verbose" = "yes" && cat << \EOF
7428     Defining HAVE_POSTGRESQL
7429 EOF
7430 cat >> confdefs.h <<\EOF
7431 #define HAVE_POSTGRESQL 1
7432 EOF
7433 }
7434
7435         if test "$with_postgresqlv7" = "yes"; then
7436                 { test "$extra_verbose" = "yes" && cat << \EOF
7437     Defining HAVE_POSTGRESQLV7
7438 EOF
7439 cat >> confdefs.h <<\EOF
7440 #define HAVE_POSTGRESQLV7 1
7441 EOF
7442 }
7443
7444         fi
7445         LIBS="-lpq $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpq\" to \$LIBS"; fi
7446         extra_objs="$extra_objs postgresql.o" &&  if test "$extra_verbose" = "yes"; then
7447    echo "    xemacs will be linked with \"postgresql.o\""
7448  fi
7449 fi
7450
7451
7452 if test "$window_system" != "none"; then
7453   echo "checking for graphics libraries" 1>&6
7454 echo "configure:7455: checking for graphics libraries" >&5
7455
7456     xpm_problem=""
7457   if test -z "$with_xpm"; then
7458     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
7459 echo "configure:7460: checking for Xpm - no older than 3.4f" >&5
7460     xe_check_libs=-lXpm
7461     cat > conftest.$ac_ext <<EOF
7462 #line 7463 "configure"
7463 #include "confdefs.h"
7464 #define XPM_NUMBERS
7465 #include <X11/xpm.h>
7466     int main(int c, char **v) {
7467     return c == 1 ? 0 :
7468       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
7469       XpmIncludeVersion < 30406 ? 2 : 0 ;}
7470 EOF
7471 if { (eval echo configure:7472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7472 then
7473   ./conftest dummy_arg; xpm_status=$?;
7474       if test "$xpm_status" = "0"; then
7475         with_xpm=yes;
7476       else
7477         with_xpm=no;
7478         if test "$xpm_status" = "1"; then
7479           xpm_problem="Xpm library version and header file version don't match!"
7480         elif test "$xpm_status" = "2"; then
7481           xpm_problem="Xpm library version is too old!"
7482         else
7483           xpm_problem="Internal xpm detection logic error!"
7484         fi
7485         echo "
7486 *** WARNING *** $xpm_problem
7487   I'm not touching that with a 10-foot pole!
7488   If you really want to use the installed version of Xpm, rerun
7489   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
7490     fi
7491 else
7492   conftest_rc="$?"
7493   echo "configure: failed program was:" >&5
7494   cat conftest.$ac_ext >&5
7495   rm -fr conftest*
7496   with_xpm=no
7497 fi
7498 rm -fr conftest*
7499     xe_check_libs=
7500     echo "$ac_t""$with_xpm" 1>&6
7501   fi
7502   if test "$with_xpm" = "yes"; then
7503     { test "$extra_verbose" = "yes" && cat << \EOF
7504     Defining HAVE_XPM
7505 EOF
7506 cat >> confdefs.h <<\EOF
7507 #define HAVE_XPM 1
7508 EOF
7509 }
7510
7511     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
7512     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
7513 echo "configure:7514: checking for \"FOR_MSW\" xpm" >&5
7514     xe_check_libs=-lXpm
7515     cat > conftest.$ac_ext <<EOF
7516 #line 7517 "configure"
7517 #include "confdefs.h"
7518
7519 int main() {
7520 XpmCreatePixmapFromData()
7521 ; return 0; }
7522 EOF
7523 if { (eval echo configure:7524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7524   rm -rf conftest*
7525   xpm_for_msw=no
7526 else
7527   echo "configure: failed program was:" >&5
7528   cat conftest.$ac_ext >&5
7529   rm -rf conftest*
7530   xpm_for_msw=yes
7531 fi
7532 rm -f conftest*
7533     xe_check_libs=
7534     echo "$ac_t""$xpm_for_msw" 1>&6
7535     if test "$xpm_for_msw" = "yes"; then
7536       { test "$extra_verbose" = "yes" && cat << \EOF
7537     Defining FOR_MSW
7538 EOF
7539 cat >> confdefs.h <<\EOF
7540 #define FOR_MSW 1
7541 EOF
7542 }
7543
7544     fi
7545   fi
7546
7547     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
7548 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
7549 echo "configure:7550: checking for compface.h" >&5
7550
7551 cat > conftest.$ac_ext <<EOF
7552 #line 7553 "configure"
7553 #include "confdefs.h"
7554 #include <compface.h>
7555 EOF
7556 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7557 { (eval echo configure:7558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7558 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7559 if test -z "$ac_err"; then
7560   rm -rf conftest*
7561   eval "ac_cv_header_$ac_safe=yes"
7562 else
7563   echo "$ac_err" >&5
7564   echo "configure: failed program was:" >&5
7565   cat conftest.$ac_ext >&5
7566   rm -rf conftest*
7567   eval "ac_cv_header_$ac_safe=no"
7568 fi
7569 rm -f conftest*
7570 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7571   echo "$ac_t""yes" 1>&6
7572   :
7573 else
7574   echo "$ac_t""no" 1>&6
7575 with_xface=no
7576 fi
7577  }
7578   test -z "$with_xface" && { 
7579 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
7580 echo "configure:7581: checking for UnGenFace in -lcompface" >&5
7581 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
7582
7583 xe_check_libs=" -lcompface "
7584 cat > conftest.$ac_ext <<EOF
7585 #line 7586 "configure"
7586 #include "confdefs.h"
7587 /* Override any gcc2 internal prototype to avoid an error.  */
7588 /* We use char because int might match the return type of a gcc2
7589     builtin and then its argument prototype would still apply.  */
7590 char UnGenFace();
7591
7592 int main() {
7593 UnGenFace()
7594 ; return 0; }
7595 EOF
7596 if { (eval echo configure:7597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7597   rm -rf conftest*
7598   eval "ac_cv_lib_$ac_lib_var=yes"
7599 else
7600   echo "configure: failed program was:" >&5
7601   cat conftest.$ac_ext >&5
7602   rm -rf conftest*
7603   eval "ac_cv_lib_$ac_lib_var=no"
7604 fi
7605 rm -f conftest*
7606 xe_check_libs=""
7607
7608 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7609   echo "$ac_t""yes" 1>&6
7610   : 
7611 else
7612   echo "$ac_t""no" 1>&6
7613 with_xface=no
7614 fi
7615
7616  }
7617   test -z "$with_xface" && with_xface=yes
7618   if test "$with_xface" = "yes"; then
7619     { test "$extra_verbose" = "yes" && cat << \EOF
7620     Defining HAVE_XFACE
7621 EOF
7622 cat >> confdefs.h <<\EOF
7623 #define HAVE_XFACE 1
7624 EOF
7625 }
7626
7627     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7628   fi
7629
7630         if test "$with_gif" != "no"; then
7631     with_gif="yes"
7632     { test "$extra_verbose" = "yes" && cat << \EOF
7633     Defining HAVE_GIF
7634 EOF
7635 cat >> confdefs.h <<\EOF
7636 #define HAVE_GIF 1
7637 EOF
7638 }
7639
7640     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
7641    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
7642  fi
7643   fi
7644
7645       if test "$with_png $with_tiff" != "no no"; then
7646     
7647 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
7648 echo "configure:7649: checking for inflate in -lc" >&5
7649 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
7650
7651 xe_check_libs=" -lc "
7652 cat > conftest.$ac_ext <<EOF
7653 #line 7654 "configure"
7654 #include "confdefs.h"
7655 /* Override any gcc2 internal prototype to avoid an error.  */
7656 /* We use char because int might match the return type of a gcc2
7657     builtin and then its argument prototype would still apply.  */
7658 char inflate();
7659
7660 int main() {
7661 inflate()
7662 ; return 0; }
7663 EOF
7664 if { (eval echo configure:7665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7665   rm -rf conftest*
7666   eval "ac_cv_lib_$ac_lib_var=yes"
7667 else
7668   echo "configure: failed program was:" >&5
7669   cat conftest.$ac_ext >&5
7670   rm -rf conftest*
7671   eval "ac_cv_lib_$ac_lib_var=no"
7672 fi
7673 rm -f conftest*
7674 xe_check_libs=""
7675
7676 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7677   echo "$ac_t""yes" 1>&6
7678   :
7679 else
7680   echo "$ac_t""no" 1>&6
7681
7682 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
7683 echo "configure:7684: checking for inflate in -lz" >&5
7684 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
7685
7686 xe_check_libs=" -lz "
7687 cat > conftest.$ac_ext <<EOF
7688 #line 7689 "configure"
7689 #include "confdefs.h"
7690 /* Override any gcc2 internal prototype to avoid an error.  */
7691 /* We use char because int might match the return type of a gcc2
7692     builtin and then its argument prototype would still apply.  */
7693 char inflate();
7694
7695 int main() {
7696 inflate()
7697 ; return 0; }
7698 EOF
7699 if { (eval echo configure:7700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7700   rm -rf conftest*
7701   eval "ac_cv_lib_$ac_lib_var=yes"
7702 else
7703   echo "configure: failed program was:" >&5
7704   cat conftest.$ac_ext >&5
7705   rm -rf conftest*
7706   eval "ac_cv_lib_$ac_lib_var=no"
7707 fi
7708 rm -f conftest*
7709 xe_check_libs=""
7710
7711 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7712   echo "$ac_t""yes" 1>&6
7713   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
7714 else
7715   echo "$ac_t""no" 1>&6
7716
7717 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
7718 echo "configure:7719: checking for inflate in -lgz" >&5
7719 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
7720
7721 xe_check_libs=" -lgz "
7722 cat > conftest.$ac_ext <<EOF
7723 #line 7724 "configure"
7724 #include "confdefs.h"
7725 /* Override any gcc2 internal prototype to avoid an error.  */
7726 /* We use char because int might match the return type of a gcc2
7727     builtin and then its argument prototype would still apply.  */
7728 char inflate();
7729
7730 int main() {
7731 inflate()
7732 ; return 0; }
7733 EOF
7734 if { (eval echo configure:7735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7735   rm -rf conftest*
7736   eval "ac_cv_lib_$ac_lib_var=yes"
7737 else
7738   echo "configure: failed program was:" >&5
7739   cat conftest.$ac_ext >&5
7740   rm -rf conftest*
7741   eval "ac_cv_lib_$ac_lib_var=no"
7742 fi
7743 rm -f conftest*
7744 xe_check_libs=""
7745
7746 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7747   echo "$ac_t""yes" 1>&6
7748   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
7749 else
7750   echo "$ac_t""no" 1>&6
7751 fi
7752
7753
7754 fi
7755
7756
7757 fi
7758
7759
7760   fi
7761
7762     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
7763 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
7764 echo "configure:7765: checking for jpeglib.h" >&5
7765
7766 cat > conftest.$ac_ext <<EOF
7767 #line 7768 "configure"
7768 #include "confdefs.h"
7769 #include <jpeglib.h>
7770 EOF
7771 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7772 { (eval echo configure:7773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7773 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7774 if test -z "$ac_err"; then
7775   rm -rf conftest*
7776   eval "ac_cv_header_$ac_safe=yes"
7777 else
7778   echo "$ac_err" >&5
7779   echo "configure: failed program was:" >&5
7780   cat conftest.$ac_ext >&5
7781   rm -rf conftest*
7782   eval "ac_cv_header_$ac_safe=no"
7783 fi
7784 rm -f conftest*
7785 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7786   echo "$ac_t""yes" 1>&6
7787   :
7788 else
7789   echo "$ac_t""no" 1>&6
7790 with_jpeg=no
7791 fi
7792  }
7793   test -z "$with_jpeg" && { 
7794 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7795 echo "configure:7796: checking for jpeg_destroy_decompress in -ljpeg" >&5
7796 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7797
7798 xe_check_libs=" -ljpeg "
7799 cat > conftest.$ac_ext <<EOF
7800 #line 7801 "configure"
7801 #include "confdefs.h"
7802 /* Override any gcc2 internal prototype to avoid an error.  */
7803 /* We use char because int might match the return type of a gcc2
7804     builtin and then its argument prototype would still apply.  */
7805 char jpeg_destroy_decompress();
7806
7807 int main() {
7808 jpeg_destroy_decompress()
7809 ; return 0; }
7810 EOF
7811 if { (eval echo configure:7812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7812   rm -rf conftest*
7813   eval "ac_cv_lib_$ac_lib_var=yes"
7814 else
7815   echo "configure: failed program was:" >&5
7816   cat conftest.$ac_ext >&5
7817   rm -rf conftest*
7818   eval "ac_cv_lib_$ac_lib_var=no"
7819 fi
7820 rm -f conftest*
7821 xe_check_libs=""
7822
7823 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7824   echo "$ac_t""yes" 1>&6
7825   :
7826 else
7827   echo "$ac_t""no" 1>&6
7828 with_jpeg=no
7829 fi
7830
7831  }
7832   test -z "$with_jpeg" && with_jpeg=yes
7833   if test "$with_jpeg" = "yes"; then
7834     { test "$extra_verbose" = "yes" && cat << \EOF
7835     Defining HAVE_JPEG
7836 EOF
7837 cat >> confdefs.h <<\EOF
7838 #define HAVE_JPEG 1
7839 EOF
7840 }
7841
7842     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7843   fi
7844
7845     png_problem=""
7846   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7847 echo "configure:7848: checking for pow" >&5
7848
7849 cat > conftest.$ac_ext <<EOF
7850 #line 7851 "configure"
7851 #include "confdefs.h"
7852 /* System header to define __stub macros and hopefully few prototypes,
7853     which can conflict with char pow(); below.  */
7854 #include <assert.h>
7855 /* Override any gcc2 internal prototype to avoid an error.  */
7856 /* We use char because int might match the return type of a gcc2
7857     builtin and then its argument prototype would still apply.  */
7858 char pow();
7859
7860 int main() {
7861
7862 /* The GNU C library defines this for functions which it implements
7863     to always fail with ENOSYS.  Some functions are actually named
7864     something starting with __ and the normal name is an alias.  */
7865 #if defined (__stub_pow) || defined (__stub___pow)
7866 choke me
7867 #else
7868 pow();
7869 #endif
7870
7871 ; return 0; }
7872 EOF
7873 if { (eval echo configure:7874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7874   rm -rf conftest*
7875   eval "ac_cv_func_pow=yes"
7876 else
7877   echo "configure: failed program was:" >&5
7878   cat conftest.$ac_ext >&5
7879   rm -rf conftest*
7880   eval "ac_cv_func_pow=no"
7881 fi
7882 rm -f conftest*
7883
7884 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7885   echo "$ac_t""yes" 1>&6
7886   :
7887 else
7888   echo "$ac_t""no" 1>&6
7889 with_png=no
7890 fi
7891  }
7892   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7893 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7894 echo "configure:7895: checking for png.h" >&5
7895
7896 cat > conftest.$ac_ext <<EOF
7897 #line 7898 "configure"
7898 #include "confdefs.h"
7899 #include <png.h>
7900 EOF
7901 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7902 { (eval echo configure:7903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7903 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7904 if test -z "$ac_err"; then
7905   rm -rf conftest*
7906   eval "ac_cv_header_$ac_safe=yes"
7907 else
7908   echo "$ac_err" >&5
7909   echo "configure: failed program was:" >&5
7910   cat conftest.$ac_ext >&5
7911   rm -rf conftest*
7912   eval "ac_cv_header_$ac_safe=no"
7913 fi
7914 rm -f conftest*
7915 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7916   echo "$ac_t""yes" 1>&6
7917   :
7918 else
7919   echo "$ac_t""no" 1>&6
7920 with_png=no
7921 fi
7922  }
7923   test -z "$with_png" && { 
7924 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7925 echo "configure:7926: checking for png_read_image in -lpng" >&5
7926 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7927
7928 xe_check_libs=" -lpng "
7929 cat > conftest.$ac_ext <<EOF
7930 #line 7931 "configure"
7931 #include "confdefs.h"
7932 /* Override any gcc2 internal prototype to avoid an error.  */
7933 /* We use char because int might match the return type of a gcc2
7934     builtin and then its argument prototype would still apply.  */
7935 char png_read_image();
7936
7937 int main() {
7938 png_read_image()
7939 ; return 0; }
7940 EOF
7941 if { (eval echo configure:7942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7942   rm -rf conftest*
7943   eval "ac_cv_lib_$ac_lib_var=yes"
7944 else
7945   echo "configure: failed program was:" >&5
7946   cat conftest.$ac_ext >&5
7947   rm -rf conftest*
7948   eval "ac_cv_lib_$ac_lib_var=no"
7949 fi
7950 rm -f conftest*
7951 xe_check_libs=""
7952
7953 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7954   echo "$ac_t""yes" 1>&6
7955   :
7956 else
7957   echo "$ac_t""no" 1>&6
7958 with_png=no
7959 fi
7960
7961  }
7962   if test -z "$with_png"; then
7963     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7964 echo "configure:7965: checking for workable png version information" >&5
7965     xe_check_libs="-lpng -lz"
7966     cat > conftest.$ac_ext <<EOF
7967 #line 7968 "configure"
7968 #include "confdefs.h"
7969 #include <png.h>
7970     int main(int c, char **v) {
7971     if (c == 1) return 0;
7972     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7973     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7974 EOF
7975 if { (eval echo configure:7976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7976 then
7977   ./conftest dummy_arg; png_status=$?;
7978       if test "$png_status" = "0"; then
7979         with_png=yes;
7980       else
7981         with_png=no;
7982         if test "$png_status" = "1"; then
7983           png_problem="PNG library version and header file don't match!"
7984         elif test "$png_status" = "2"; then
7985           png_problem="PNG library version too old (pre 1.0.2)!"
7986         fi
7987         echo "
7988 *** WARNING *** $png_problem
7989   I'm not touching that with a 10-foot pole!
7990   If you really want to use the installed version of libPNG, rerun
7991   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7992     fi
7993 else
7994   conftest_rc="$?"
7995   echo "configure: failed program was:" >&5
7996   cat conftest.$ac_ext >&5
7997   rm -fr conftest*
7998   with_png=no
7999 fi
8000 rm -fr conftest*
8001     xe_check_libs=
8002     echo "$ac_t""$with_png" 1>&6
8003   fi
8004   if test "$with_png" = "yes"; then
8005     { test "$extra_verbose" = "yes" && cat << \EOF
8006     Defining HAVE_PNG
8007 EOF
8008 cat >> confdefs.h <<\EOF
8009 #define HAVE_PNG 1
8010 EOF
8011 }
8012
8013     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
8014   fi
8015
8016     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
8017 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
8018 echo "configure:8019: checking for tiffio.h" >&5
8019
8020 cat > conftest.$ac_ext <<EOF
8021 #line 8022 "configure"
8022 #include "confdefs.h"
8023 #include <tiffio.h>
8024 EOF
8025 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8026 { (eval echo configure:8027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8027 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8028 if test -z "$ac_err"; then
8029   rm -rf conftest*
8030   eval "ac_cv_header_$ac_safe=yes"
8031 else
8032   echo "$ac_err" >&5
8033   echo "configure: failed program was:" >&5
8034   cat conftest.$ac_ext >&5
8035   rm -rf conftest*
8036   eval "ac_cv_header_$ac_safe=no"
8037 fi
8038 rm -f conftest*
8039 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8040   echo "$ac_t""yes" 1>&6
8041   :
8042 else
8043   echo "$ac_t""no" 1>&6
8044 with_tiff=no
8045 fi
8046  }
8047   test -z "$with_tiff" && { 
8048 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
8049 echo "configure:8050: checking for TIFFClientOpen in -ltiff" >&5
8050 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
8051
8052 xe_check_libs=" -ltiff "
8053 cat > conftest.$ac_ext <<EOF
8054 #line 8055 "configure"
8055 #include "confdefs.h"
8056 /* Override any gcc2 internal prototype to avoid an error.  */
8057 /* We use char because int might match the return type of a gcc2
8058     builtin and then its argument prototype would still apply.  */
8059 char TIFFClientOpen();
8060
8061 int main() {
8062 TIFFClientOpen()
8063 ; return 0; }
8064 EOF
8065 if { (eval echo configure:8066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8066   rm -rf conftest*
8067   eval "ac_cv_lib_$ac_lib_var=yes"
8068 else
8069   echo "configure: failed program was:" >&5
8070   cat conftest.$ac_ext >&5
8071   rm -rf conftest*
8072   eval "ac_cv_lib_$ac_lib_var=no"
8073 fi
8074 rm -f conftest*
8075 xe_check_libs=""
8076
8077 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8078   echo "$ac_t""yes" 1>&6
8079   :
8080 else
8081   echo "$ac_t""no" 1>&6
8082 with_tiff=no
8083 fi
8084
8085  }
8086   test -z "$with_tiff" && with_tiff=yes
8087   if test "$with_tiff" = "yes"; then
8088     { test "$extra_verbose" = "yes" && cat << \EOF
8089     Defining HAVE_TIFF
8090 EOF
8091 cat >> confdefs.h <<\EOF
8092 #define HAVE_TIFF 1
8093 EOF
8094 }
8095
8096     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
8097   fi
8098 fi
8099
8100
8101 if test "$with_x11" = "yes"; then
8102
8103   echo "checking for X11 graphics libraries" 1>&6
8104 echo "configure:8105: checking for X11 graphics libraries" >&5
8105
8106   echo "checking for the Athena widgets" 1>&6
8107 echo "configure:8108: checking for the Athena widgets" >&5
8108
8109     case "$with_athena" in
8110         "xaw" | "")     athena_variant=Xaw      athena_3d=no  ;;
8111     "3d")       athena_variant=Xaw3d    athena_3d=yes ;;
8112     "next")     athena_variant=neXtaw   athena_3d=yes ;;
8113     "95")       athena_variant=Xaw95    athena_3d=yes ;;
8114     "xpm")      athena_variant=XawXpm   athena_3d=yes ;;
8115     *)          { echo "Error:" "Unknown Athena widget set \`$with_athena'. This should not happen." >&2; exit 1; } ;;
8116   esac
8117
8118     if test "$athena_3d" = "no"; then
8119     
8120 echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6
8121 echo "configure:8122: checking for XawScrollbarSetThumb in -l$athena_variant" >&5
8122 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
8123
8124 xe_check_libs=" -l$athena_variant "
8125 cat > conftest.$ac_ext <<EOF
8126 #line 8127 "configure"
8127 #include "confdefs.h"
8128 /* Override any gcc2 internal prototype to avoid an error.  */
8129 /* We use char because int might match the return type of a gcc2
8130     builtin and then its argument prototype would still apply.  */
8131 char XawScrollbarSetThumb();
8132
8133 int main() {
8134 XawScrollbarSetThumb()
8135 ; return 0; }
8136 EOF
8137 if { (eval echo configure:8138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8138   rm -rf conftest*
8139   eval "ac_cv_lib_$ac_lib_var=yes"
8140 else
8141   echo "configure: failed program was:" >&5
8142   cat conftest.$ac_ext >&5
8143   rm -rf conftest*
8144   eval "ac_cv_lib_$ac_lib_var=no"
8145 fi
8146 rm -f conftest*
8147 xe_check_libs=""
8148
8149 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8150   echo "$ac_t""yes" 1>&6
8151           
8152 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
8153 echo "configure:8154: checking for threeDClassRec in -l$athena_variant" >&5
8154 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
8155
8156 xe_check_libs=" -l$athena_variant "
8157 cat > conftest.$ac_ext <<EOF
8158 #line 8159 "configure"
8159 #include "confdefs.h"
8160 /* Override any gcc2 internal prototype to avoid an error.  */
8161 /* We use char because int might match the return type of a gcc2
8162     builtin and then its argument prototype would still apply.  */
8163 char threeDClassRec();
8164
8165 int main() {
8166 threeDClassRec()
8167 ; return 0; }
8168 EOF
8169 if { (eval echo configure:8170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8170   rm -rf conftest*
8171   eval "ac_cv_lib_$ac_lib_var=yes"
8172 else
8173   echo "configure: failed program was:" >&5
8174   cat conftest.$ac_ext >&5
8175   rm -rf conftest*
8176   eval "ac_cv_lib_$ac_lib_var=no"
8177 fi
8178 rm -f conftest*
8179 xe_check_libs=""
8180
8181 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8182   echo "$ac_t""yes" 1>&6
8183   echo "configure: warning: "Could not find a non-3d Athena widget library."" 1>&2
8184 else
8185   echo "$ac_t""no" 1>&6
8186 athena_lib=$athena_variant
8187 fi
8188
8189
8190       
8191 else
8192   echo "$ac_t""no" 1>&6
8193 echo "configure: warning: "Could not find an Athena widget library."" 1>&2
8194 fi
8195
8196
8197   else
8198         
8199 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
8200 echo "configure:8201: checking for threeDClassRec in -l$athena_variant" >&5
8201 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
8202
8203 xe_check_libs=" -l$athena_variant "
8204 cat > conftest.$ac_ext <<EOF
8205 #line 8206 "configure"
8206 #include "confdefs.h"
8207 /* Override any gcc2 internal prototype to avoid an error.  */
8208 /* We use char because int might match the return type of a gcc2
8209     builtin and then its argument prototype would still apply.  */
8210 char threeDClassRec();
8211
8212 int main() {
8213 threeDClassRec()
8214 ; return 0; }
8215 EOF
8216 if { (eval echo configure:8217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8217   rm -rf conftest*
8218   eval "ac_cv_lib_$ac_lib_var=yes"
8219 else
8220   echo "configure: failed program was:" >&5
8221   cat conftest.$ac_ext >&5
8222   rm -rf conftest*
8223   eval "ac_cv_lib_$ac_lib_var=no"
8224 fi
8225 rm -f conftest*
8226 xe_check_libs=""
8227
8228 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8229   echo "$ac_t""yes" 1>&6
8230   athena_lib=$athena_variant
8231 else
8232   echo "$ac_t""no" 1>&6
8233 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6
8234 echo "configure:8235: checking for threeDClassRec in -lXaw" >&5
8235 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'`
8236
8237 xe_check_libs=" -lXaw "
8238 cat > conftest.$ac_ext <<EOF
8239 #line 8240 "configure"
8240 #include "confdefs.h"
8241 /* Override any gcc2 internal prototype to avoid an error.  */
8242 /* We use char because int might match the return type of a gcc2
8243     builtin and then its argument prototype would still apply.  */
8244 char threeDClassRec();
8245
8246 int main() {
8247 threeDClassRec()
8248 ; return 0; }
8249 EOF
8250 if { (eval echo configure:8251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8251   rm -rf conftest*
8252   eval "ac_cv_lib_$ac_lib_var=yes"
8253 else
8254   echo "configure: failed program was:" >&5
8255   cat conftest.$ac_ext >&5
8256   rm -rf conftest*
8257   eval "ac_cv_lib_$ac_lib_var=no"
8258 fi
8259 rm -f conftest*
8260 xe_check_libs=""
8261
8262 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8263   echo "$ac_t""yes" 1>&6
8264   athena_lib=Xaw;
8265           echo "configure: warning: "Assuming that libXaw is actually $athena_variant."" 1>&2;
8266         
8267 else
8268   echo "$ac_t""no" 1>&6
8269 echo "configure: warning: "Could not find a 3d Athena widget library that looked like $athena_variant."" 1>&2
8270 fi
8271
8272
8273 fi
8274
8275
8276   fi
8277
8278     if test "$athena_3d" = "no"; then
8279     ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
8280 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
8281 echo "configure:8282: checking for X11/Xaw/ThreeD.h" >&5
8282
8283 cat > conftest.$ac_ext <<EOF
8284 #line 8285 "configure"
8285 #include "confdefs.h"
8286 #include <X11/Xaw/ThreeD.h>
8287 EOF
8288 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8289 { (eval echo configure:8290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8290 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8291 if test -z "$ac_err"; then
8292   rm -rf conftest*
8293   eval "ac_cv_header_$ac_safe=yes"
8294 else
8295   echo "$ac_err" >&5
8296   echo "configure: failed program was:" >&5
8297   cat conftest.$ac_ext >&5
8298   rm -rf conftest*
8299   eval "ac_cv_header_$ac_safe=no"
8300 fi
8301 rm -f conftest*
8302 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8303   echo "$ac_t""yes" 1>&6
8304   echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2
8305 else
8306   echo "$ac_t""no" 1>&6
8307 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'`
8308 echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6
8309 echo "configure:8310: checking for X11/Xaw/XawInit.h" >&5
8310
8311 cat > conftest.$ac_ext <<EOF
8312 #line 8313 "configure"
8313 #include "confdefs.h"
8314 #include <X11/Xaw/XawInit.h>
8315 EOF
8316 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8317 { (eval echo configure:8318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8318 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8319 if test -z "$ac_err"; then
8320   rm -rf conftest*
8321   eval "ac_cv_header_$ac_safe=yes"
8322 else
8323   echo "$ac_err" >&5
8324   echo "configure: failed program was:" >&5
8325   cat conftest.$ac_ext >&5
8326   rm -rf conftest*
8327   eval "ac_cv_header_$ac_safe=no"
8328 fi
8329 rm -f conftest*
8330 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8331   echo "$ac_t""yes" 1>&6
8332   athena_h_path=X11/Xaw
8333 else
8334   echo "$ac_t""no" 1>&6
8335 echo "configure: warning: "Could not find a non-3d Athena header set."" 1>&2
8336 fi
8337
8338 fi
8339
8340   else
8341             ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
8342 echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6
8343 echo "configure:8344: checking for X11/$athena_variant/XawInit.h" >&5
8344
8345 cat > conftest.$ac_ext <<EOF
8346 #line 8347 "configure"
8347 #include "confdefs.h"
8348 #include <X11/$athena_variant/XawInit.h>
8349 EOF
8350 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8351 { (eval echo configure:8352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8352 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8353 if test -z "$ac_err"; then
8354   rm -rf conftest*
8355   eval "ac_cv_header_$ac_safe=yes"
8356 else
8357   echo "$ac_err" >&5
8358   echo "configure: failed program was:" >&5
8359   cat conftest.$ac_ext >&5
8360   rm -rf conftest*
8361   eval "ac_cv_header_$ac_safe=no"
8362 fi
8363 rm -f conftest*
8364 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8365   echo "$ac_t""yes" 1>&6
8366   ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
8367 echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6
8368 echo "configure:8369: checking for X11/$athena_variant/ThreeD.h" >&5
8369
8370 cat > conftest.$ac_ext <<EOF
8371 #line 8372 "configure"
8372 #include "confdefs.h"
8373 #include <X11/$athena_variant/ThreeD.h>
8374 EOF
8375 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8376 { (eval echo configure:8377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8377 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8378 if test -z "$ac_err"; then
8379   rm -rf conftest*
8380   eval "ac_cv_header_$ac_safe=yes"
8381 else
8382   echo "$ac_err" >&5
8383   echo "configure: failed program was:" >&5
8384   cat conftest.$ac_ext >&5
8385   rm -rf conftest*
8386   eval "ac_cv_header_$ac_safe=no"
8387 fi
8388 rm -f conftest*
8389 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8390   echo "$ac_t""yes" 1>&6
8391   athena_h_path=X11/$athena_variant
8392 else
8393   echo "$ac_t""no" 1>&6
8394 fi
8395
8396 else
8397   echo "$ac_t""no" 1>&6
8398 fi
8399
8400
8401         if test -z "$athena_h_path"; then
8402       ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
8403 echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6
8404 echo "configure:8405: checking for $athena_variant/XawInit.h" >&5
8405
8406 cat > conftest.$ac_ext <<EOF
8407 #line 8408 "configure"
8408 #include "confdefs.h"
8409 #include <$athena_variant/XawInit.h>
8410 EOF
8411 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8412 { (eval echo configure:8413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8413 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8414 if test -z "$ac_err"; then
8415   rm -rf conftest*
8416   eval "ac_cv_header_$ac_safe=yes"
8417 else
8418   echo "$ac_err" >&5
8419   echo "configure: failed program was:" >&5
8420   cat conftest.$ac_ext >&5
8421   rm -rf conftest*
8422   eval "ac_cv_header_$ac_safe=no"
8423 fi
8424 rm -f conftest*
8425 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8426   echo "$ac_t""yes" 1>&6
8427   ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
8428 echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6
8429 echo "configure:8430: checking for $athena_variant/ThreeD.h" >&5
8430
8431 cat > conftest.$ac_ext <<EOF
8432 #line 8433 "configure"
8433 #include "confdefs.h"
8434 #include <$athena_variant/ThreeD.h>
8435 EOF
8436 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8437 { (eval echo configure:8438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8438 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8439 if test -z "$ac_err"; then
8440   rm -rf conftest*
8441   eval "ac_cv_header_$ac_safe=yes"
8442 else
8443   echo "$ac_err" >&5
8444   echo "configure: failed program was:" >&5
8445   cat conftest.$ac_ext >&5
8446   rm -rf conftest*
8447   eval "ac_cv_header_$ac_safe=no"
8448 fi
8449 rm -f conftest*
8450 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8451   echo "$ac_t""yes" 1>&6
8452   athena_h_path=$athena_variant
8453 else
8454   echo "$ac_t""no" 1>&6
8455 fi
8456
8457 else
8458   echo "$ac_t""no" 1>&6
8459 fi
8460
8461     fi
8462
8463         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
8464       ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
8465 echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6
8466 echo "configure:8467: checking for X11/Xaw3d/XawInit.h" >&5
8467
8468 cat > conftest.$ac_ext <<EOF
8469 #line 8470 "configure"
8470 #include "confdefs.h"
8471 #include <X11/Xaw3d/XawInit.h>
8472 EOF
8473 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8474 { (eval echo configure:8475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8475 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8476 if test -z "$ac_err"; then
8477   rm -rf conftest*
8478   eval "ac_cv_header_$ac_safe=yes"
8479 else
8480   echo "$ac_err" >&5
8481   echo "configure: failed program was:" >&5
8482   cat conftest.$ac_ext >&5
8483   rm -rf conftest*
8484   eval "ac_cv_header_$ac_safe=no"
8485 fi
8486 rm -f conftest*
8487 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8488   echo "$ac_t""yes" 1>&6
8489   ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
8490 echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6
8491 echo "configure:8492: checking for X11/Xaw3d/ThreeD.h" >&5
8492
8493 cat > conftest.$ac_ext <<EOF
8494 #line 8495 "configure"
8495 #include "confdefs.h"
8496 #include <X11/Xaw3d/ThreeD.h>
8497 EOF
8498 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8499 { (eval echo configure:8500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8500 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8501 if test -z "$ac_err"; then
8502   rm -rf conftest*
8503   eval "ac_cv_header_$ac_safe=yes"
8504 else
8505   echo "$ac_err" >&5
8506   echo "configure: failed program was:" >&5
8507   cat conftest.$ac_ext >&5
8508   rm -rf conftest*
8509   eval "ac_cv_header_$ac_safe=no"
8510 fi
8511 rm -f conftest*
8512 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8513   echo "$ac_t""yes" 1>&6
8514   
8515             echo "configure: warning: "Assuming that X11/Xaw3d headers are suitable for $athena_variant."" 1>&2
8516             athena_h_path=X11/Xaw3d
8517           
8518 else
8519   echo "$ac_t""no" 1>&6
8520 fi
8521
8522 else
8523   echo "$ac_t""no" 1>&6
8524 fi
8525
8526     fi
8527
8528         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
8529       ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
8530 echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6
8531 echo "configure:8532: checking for Xaw3d/XawInit.h" >&5
8532
8533 cat > conftest.$ac_ext <<EOF
8534 #line 8535 "configure"
8535 #include "confdefs.h"
8536 #include <Xaw3d/XawInit.h>
8537 EOF
8538 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8539 { (eval echo configure:8540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8540 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8541 if test -z "$ac_err"; then
8542   rm -rf conftest*
8543   eval "ac_cv_header_$ac_safe=yes"
8544 else
8545   echo "$ac_err" >&5
8546   echo "configure: failed program was:" >&5
8547   cat conftest.$ac_ext >&5
8548   rm -rf conftest*
8549   eval "ac_cv_header_$ac_safe=no"
8550 fi
8551 rm -f conftest*
8552 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8553   echo "$ac_t""yes" 1>&6
8554   ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
8555 echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6
8556 echo "configure:8557: checking for Xaw3d/ThreeD.h" >&5
8557
8558 cat > conftest.$ac_ext <<EOF
8559 #line 8560 "configure"
8560 #include "confdefs.h"
8561 #include <Xaw3d/ThreeD.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   
8580             echo "configure: warning: "Assuming that Xaw3d headers are suitable for $athena_variant."" 1>&2
8581             athena_h_path=Xaw3d
8582           
8583 else
8584   echo "$ac_t""no" 1>&6
8585 fi
8586
8587 else
8588   echo "$ac_t""no" 1>&6
8589 fi
8590
8591     fi
8592
8593             if test -z "$athena_h_path"; then
8594       ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
8595 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
8596 echo "configure:8597: checking for X11/Xaw/ThreeD.h" >&5
8597
8598 cat > conftest.$ac_ext <<EOF
8599 #line 8600 "configure"
8600 #include "confdefs.h"
8601 #include <X11/Xaw/ThreeD.h>
8602 EOF
8603 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8604 { (eval echo configure:8605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8605 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8606 if test -z "$ac_err"; then
8607   rm -rf conftest*
8608   eval "ac_cv_header_$ac_safe=yes"
8609 else
8610   echo "$ac_err" >&5
8611   echo "configure: failed program was:" >&5
8612   cat conftest.$ac_ext >&5
8613   rm -rf conftest*
8614   eval "ac_cv_header_$ac_safe=no"
8615 fi
8616 rm -f conftest*
8617 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8618   echo "$ac_t""yes" 1>&6
8619   
8620           echo "configure: warning: "Assuming that X11/Xaw headers are suitable for $athena_variant."" 1>&2
8621           athena_h_path=X11/Xaw
8622         
8623 else
8624   echo "$ac_t""no" 1>&6
8625 echo "configure: warning: "Could not find a suitable 3d Athena header set."" 1>&2
8626 fi
8627
8628     fi
8629   fi
8630
8631     if test -n "$athena_lib" -a -n "$athena_h_path"; then
8632     have_xaw=yes
8633   else
8634     have_xaw=no
8635   fi
8636
8637     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
8638 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
8639 echo "configure:8640: checking for Xm/Xm.h" >&5
8640
8641 cat > conftest.$ac_ext <<EOF
8642 #line 8643 "configure"
8643 #include "confdefs.h"
8644 #include <Xm/Xm.h>
8645 EOF
8646 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8647 { (eval echo configure:8648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8648 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8649 if test -z "$ac_err"; then
8650   rm -rf conftest*
8651   eval "ac_cv_header_$ac_safe=yes"
8652 else
8653   echo "$ac_err" >&5
8654   echo "configure: failed program was:" >&5
8655   cat conftest.$ac_ext >&5
8656   rm -rf conftest*
8657   eval "ac_cv_header_$ac_safe=no"
8658 fi
8659 rm -f conftest*
8660 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8661   echo "$ac_t""yes" 1>&6
8662   
8663 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
8664 echo "configure:8665: checking for XmStringFree in -lXm" >&5
8665 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
8666
8667 xe_check_libs=" -lXm "
8668 cat > conftest.$ac_ext <<EOF
8669 #line 8670 "configure"
8670 #include "confdefs.h"
8671 /* Override any gcc2 internal prototype to avoid an error.  */
8672 /* We use char because int might match the return type of a gcc2
8673     builtin and then its argument prototype would still apply.  */
8674 char XmStringFree();
8675
8676 int main() {
8677 XmStringFree()
8678 ; return 0; }
8679 EOF
8680 if { (eval echo configure:8681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8681   rm -rf conftest*
8682   eval "ac_cv_lib_$ac_lib_var=yes"
8683 else
8684   echo "configure: failed program was:" >&5
8685   cat conftest.$ac_ext >&5
8686   rm -rf conftest*
8687   eval "ac_cv_lib_$ac_lib_var=no"
8688 fi
8689 rm -f conftest*
8690 xe_check_libs=""
8691
8692 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8693   echo "$ac_t""yes" 1>&6
8694   have_motif=yes
8695 else
8696   echo "$ac_t""no" 1>&6
8697 have_motif=no
8698 fi
8699
8700
8701 else
8702   echo "$ac_t""no" 1>&6
8703 have_motif=no
8704 fi
8705
8706
8707   if test "$have_motif" = "yes"; then
8708         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
8709 echo "configure:8710: checking for Lesstif" >&5
8710     cat > conftest.$ac_ext <<EOF
8711 #line 8712 "configure"
8712 #include "confdefs.h"
8713 #include <Xm/Xm.h>
8714 #ifdef LESSTIF_VERSION
8715 yes
8716 #endif
8717
8718 EOF
8719 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8720   egrep "yes" >/dev/null 2>&1; then
8721   rm -rf conftest*
8722   have_lesstif=yes
8723 else
8724   rm -rf conftest*
8725   have_lesstif=no
8726 fi
8727 rm -f conftest*
8728
8729   echo "$ac_t""$have_lesstif" 1>&6
8730   fi
8731
8732 fi 
8733
8734 case "$with_menubars" in "" | "yes" | "athena" )
8735   with_menubars="lucid" ;;
8736 esac
8737 case "$with_dialogs" in "" | "yes" | "lucid" )
8738   if   test "$have_motif"     = "yes"; then with_dialogs="motif"
8739   elif test "$have_xaw"       = "yes"; then with_dialogs="athena"
8740   else with_dialogs=no
8741   fi ;;
8742 esac
8743 case "$with_scrollbars" in "" | "yes" )
8744   with_scrollbars="lucid" ;;
8745 esac
8746 case "$with_widgets" in "" | "yes" | "lucid")
8747   if   test "$have_motif" = "yes"; then with_widgets="motif"
8748   elif test "$have_xaw"   = "yes"; then with_widgets="athena"
8749   else with_widgets=no
8750   fi ;;
8751 esac
8752
8753 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
8754
8755 case "$all_widgets" in
8756   *athena* )
8757     if test "$have_xaw" != "yes"; then
8758       { echo "Error:" "Could not find a suitable Athena library to build with." >&2; exit 1; }
8759     fi
8760
8761         lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
8762
8763         libs_x="-l$athena_lib $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$athena_lib\" to \$libs_x"; fi
8764
8765             { test "$extra_verbose" = "yes" && cat << EOF
8766     Defining ATHENA_H_PATH = $athena_h_path
8767 EOF
8768 cat >> confdefs.h <<EOF
8769 #define ATHENA_H_PATH $athena_h_path
8770 EOF
8771 }
8772
8773
8774     { test "$extra_verbose" = "yes" && cat << \EOF
8775     Defining LWLIB_USES_ATHENA
8776 EOF
8777 cat >> confdefs.h <<\EOF
8778 #define LWLIB_USES_ATHENA 1
8779 EOF
8780 }
8781
8782     { test "$extra_verbose" = "yes" && cat << \EOF
8783     Defining NEED_ATHENA
8784 EOF
8785 cat >> confdefs.h <<\EOF
8786 #define NEED_ATHENA 1
8787 EOF
8788 }
8789
8790
8791     if test "$athena_3d" = "yes"; then
8792       { test "$extra_verbose" = "yes" && cat << \EOF
8793     Defining HAVE_ATHENA_3D
8794 EOF
8795 cat >> confdefs.h <<\EOF
8796 #define HAVE_ATHENA_3D 1
8797 EOF
8798 }
8799
8800     fi
8801   ;;
8802 esac
8803
8804 case "$all_widgets" in *motif* )
8805   { test "$extra_verbose" = "yes" && cat << \EOF
8806     Defining LWLIB_USES_MOTIF
8807 EOF
8808 cat >> confdefs.h <<\EOF
8809 #define LWLIB_USES_MOTIF 1
8810 EOF
8811 }
8812
8813   { test "$extra_verbose" = "yes" && cat << \EOF
8814     Defining NEED_MOTIF
8815 EOF
8816 cat >> confdefs.h <<\EOF
8817 #define NEED_MOTIF 1
8818 EOF
8819 }
8820
8821   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
8822   need_motif=yes ;;
8823 esac
8824
8825 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
8826 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
8827 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
8828 test "$with_widgets"   != "no" && test "$with_widgets" != "msw" && \
8829         lwlib_objs="$lwlib_objs xlwtabs.o xlwgcs.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwtabs.o xlwgcs.o\" to \$lwlib_objs"; fi
8830 case "$with_widgets" in athena* )
8831         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;;
8832 esac
8833 case "$all_widgets" in *lucid* )
8834   { test "$extra_verbose" = "yes" && cat << \EOF
8835     Defining NEED_LUCID
8836 EOF
8837 cat >> confdefs.h <<\EOF
8838 #define NEED_LUCID 1
8839 EOF
8840 }
8841
8842   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
8843 esac
8844
8845
8846
8847 test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
8848     Defining LWLIB_SCROLLBARS_ATHENA
8849 EOF
8850 cat >> confdefs.h <<\EOF
8851 #define LWLIB_SCROLLBARS_ATHENA 1
8852 EOF
8853 }
8854
8855 test "$with_dialogs"    = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
8856     Defining LWLIB_DIALOGS_ATHENA
8857 EOF
8858 cat >> confdefs.h <<\EOF
8859 #define LWLIB_DIALOGS_ATHENA 1
8860 EOF
8861 }
8862
8863
8864 if test "$athena_3d" = "yes"; then
8865   test "$with_scrollbars" = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
8866     Defining LWLIB_SCROLLBARS_ATHENA3D
8867 EOF
8868 cat >> confdefs.h <<\EOF
8869 #define LWLIB_SCROLLBARS_ATHENA3D 1
8870 EOF
8871 }
8872
8873   test "$with_dialogs"    = "athena" && { test "$extra_verbose" = "yes" && cat << \EOF
8874     Defining LWLIB_DIALOGS_ATHENA3D
8875 EOF
8876 cat >> confdefs.h <<\EOF
8877 #define LWLIB_DIALOGS_ATHENA3D 1
8878 EOF
8879 }
8880
8881 fi
8882
8883 case "$with_widgets" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
8884     Defining LWLIB_WIDGETS_ATHENA
8885 EOF
8886 cat >> confdefs.h <<\EOF
8887 #define LWLIB_WIDGETS_ATHENA 1
8888 EOF
8889 }
8890 ;; esac
8891 test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \
8892         { test "$extra_verbose" = "yes" && cat << \EOF
8893     Defining LWLIB_TABS_LUCID
8894 EOF
8895 cat >> confdefs.h <<\EOF
8896 #define LWLIB_TABS_LUCID 1
8897 EOF
8898 }
8899
8900
8901 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
8902     Defining HAVE_MENUBARS
8903 EOF
8904 cat >> confdefs.h <<\EOF
8905 #define HAVE_MENUBARS 1
8906 EOF
8907 }
8908
8909 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
8910     Defining HAVE_SCROLLBARS
8911 EOF
8912 cat >> confdefs.h <<\EOF
8913 #define HAVE_SCROLLBARS 1
8914 EOF
8915 }
8916
8917 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
8918     Defining HAVE_DIALOGS
8919 EOF
8920 cat >> confdefs.h <<\EOF
8921 #define HAVE_DIALOGS 1
8922 EOF
8923 }
8924
8925 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
8926     Defining HAVE_TOOLBARS
8927 EOF
8928 cat >> confdefs.h <<\EOF
8929 #define HAVE_TOOLBARS 1
8930 EOF
8931 }
8932
8933 test "$with_widgets"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
8934     Defining HAVE_WIDGETS
8935 EOF
8936 cat >> confdefs.h <<\EOF
8937 #define HAVE_WIDGETS 1
8938 EOF
8939 }
8940
8941
8942 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
8943     Defining LWLIB_MENUBARS_LUCID
8944 EOF
8945 cat >> confdefs.h <<\EOF
8946 #define LWLIB_MENUBARS_LUCID 1
8947 EOF
8948 }
8949
8950 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
8951     Defining LWLIB_SCROLLBARS_LUCID
8952 EOF
8953 cat >> confdefs.h <<\EOF
8954 #define LWLIB_SCROLLBARS_LUCID 1
8955 EOF
8956 }
8957
8958
8959 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
8960     Defining LWLIB_MENUBARS_MOTIF
8961 EOF
8962 cat >> confdefs.h <<\EOF
8963 #define LWLIB_MENUBARS_MOTIF 1
8964 EOF
8965 }
8966
8967 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
8968     Defining LWLIB_SCROLLBARS_MOTIF
8969 EOF
8970 cat >> confdefs.h <<\EOF
8971 #define LWLIB_SCROLLBARS_MOTIF 1
8972 EOF
8973 }
8974
8975 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
8976     Defining LWLIB_DIALOGS_MOTIF
8977 EOF
8978 cat >> confdefs.h <<\EOF
8979 #define LWLIB_DIALOGS_MOTIF 1
8980 EOF
8981 }
8982
8983 test "$with_widgets"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
8984     Defining LWLIB_WIDGETS_MOTIF
8985 EOF
8986 cat >> confdefs.h <<\EOF
8987 #define LWLIB_WIDGETS_MOTIF 1
8988 EOF
8989 }
8990
8991
8992 test "$with_menubars"   != "no"    && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
8993    echo "    xemacs will be linked with \"menubar.o\""
8994  fi
8995 test "$with_scrollbars" != "no"    && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
8996    echo "    xemacs will be linked with \"scrollbar.o\""
8997  fi
8998 test "$with_dialogs"    != "no"    && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
8999    echo "    xemacs will be linked with \"dialog.o\""
9000  fi
9001 test "$with_toolbars"   != "no"    && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
9002    echo "    xemacs will be linked with \"toolbar.o\""
9003  fi
9004
9005 if test "$with_x11" = "yes"; then
9006   test "$with_menubars"   != "no"  && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
9007    echo "    xemacs will be linked with \"menubar-x.o\""
9008  fi
9009   test "$with_scrollbars" != "no"  && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
9010    echo "    xemacs will be linked with \"scrollbar-x.o\""
9011  fi
9012   test "$with_dialogs"    != "no"  && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
9013    echo "    xemacs will be linked with \"dialog-x.o\""
9014  fi
9015   test "$with_toolbars"   != "no"  && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
9016    echo "    xemacs will be linked with \"toolbar-x.o\""
9017  fi
9018   test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
9019    echo "    xemacs will be linked with \"gui-x.o\""
9020  fi
9021 fi
9022
9023
9024 test -z "$with_mule" && with_mule=no
9025 test -z "$with_file_coding" && with_file_coding=no
9026
9027
9028 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
9029   { test "$extra_verbose" = "yes" && cat << \EOF
9030     Defining FILE_CODING
9031 EOF
9032 cat >> confdefs.h <<\EOF
9033 #define FILE_CODING 1
9034 EOF
9035 }
9036
9037   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
9038    echo "    xemacs will be linked with \"file-coding.o\""
9039  fi
9040 fi
9041
9042 if test "$with_mule" = "yes" ; then
9043   echo "checking for Mule-related features" 1>&6
9044 echo "configure:9045: checking for Mule-related features" >&5
9045   { test "$extra_verbose" = "yes" && cat << \EOF
9046     Defining MULE
9047 EOF
9048 cat >> confdefs.h <<\EOF
9049 #define MULE 1
9050 EOF
9051 }
9052
9053   { test "$extra_verbose" = "yes" && cat << \EOF
9054     Defining FILE_CODING
9055 EOF
9056 cat >> confdefs.h <<\EOF
9057 #define FILE_CODING 1
9058 EOF
9059 }
9060
9061   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o" &&  if test "$extra_verbose" = "yes"; then
9062    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o\""
9063  fi
9064   if test "$with_utf_2000" = "yes" && test "$with_text_coding" = "yes"; then
9065     { test "$extra_verbose" = "yes" && cat << \EOF
9066     Defining TEXT_CODING
9067 EOF
9068 cat >> confdefs.h <<\EOF
9069 #define TEXT_CODING 1
9070 EOF
9071 }
9072
9073     extra_objs="$extra_objs text-coding.o" &&  if test "$extra_verbose" = "yes"; then
9074    echo "    xemacs will be linked with \"text-coding.o\""
9075  fi
9076   else
9077     extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
9078    echo "    xemacs will be linked with \"file-coding.o\""
9079  fi
9080   fi
9081     for ac_hdr in libintl.h
9082 do
9083 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9084 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9085 echo "configure:9086: checking for $ac_hdr" >&5
9086
9087 cat > conftest.$ac_ext <<EOF
9088 #line 9089 "configure"
9089 #include "confdefs.h"
9090 #include <$ac_hdr>
9091 EOF
9092 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9093 { (eval echo configure:9094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9094 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9095 if test -z "$ac_err"; then
9096   rm -rf conftest*
9097   eval "ac_cv_header_$ac_safe=yes"
9098 else
9099   echo "$ac_err" >&5
9100   echo "configure: failed program was:" >&5
9101   cat conftest.$ac_ext >&5
9102   rm -rf conftest*
9103   eval "ac_cv_header_$ac_safe=no"
9104 fi
9105 rm -f conftest*
9106 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9107   echo "$ac_t""yes" 1>&6
9108     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9109   { test "$extra_verbose" = "yes" && cat << EOF
9110     Defining $ac_tr_hdr
9111 EOF
9112 cat >> confdefs.h <<EOF
9113 #define $ac_tr_hdr 1
9114 EOF
9115 }
9116  
9117 else
9118   echo "$ac_t""no" 1>&6
9119 fi
9120 done
9121
9122   
9123 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
9124 echo "configure:9125: checking for strerror in -lintl" >&5
9125 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
9126
9127 xe_check_libs=" -lintl "
9128 cat > conftest.$ac_ext <<EOF
9129 #line 9130 "configure"
9130 #include "confdefs.h"
9131 /* Override any gcc2 internal prototype to avoid an error.  */
9132 /* We use char because int might match the return type of a gcc2
9133     builtin and then its argument prototype would still apply.  */
9134 char strerror();
9135
9136 int main() {
9137 strerror()
9138 ; return 0; }
9139 EOF
9140 if { (eval echo configure:9141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9141   rm -rf conftest*
9142   eval "ac_cv_lib_$ac_lib_var=yes"
9143 else
9144   echo "configure: failed program was:" >&5
9145   cat conftest.$ac_ext >&5
9146   rm -rf conftest*
9147   eval "ac_cv_lib_$ac_lib_var=no"
9148 fi
9149 rm -f conftest*
9150 xe_check_libs=""
9151
9152 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9153   echo "$ac_t""yes" 1>&6
9154     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9155     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9156   { test "$extra_verbose" = "yes" && cat << EOF
9157     Defining $ac_tr_lib
9158 EOF
9159 cat >> confdefs.h <<EOF
9160 #define $ac_tr_lib 1
9161 EOF
9162 }
9163
9164   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
9165
9166 else
9167   echo "$ac_t""no" 1>&6
9168 fi
9169
9170
9171
9172   if test "$with_utf_2000" = "yes" ; then
9173     { test "$extra_verbose" = "yes" && cat << \EOF
9174     Defining CHAR_IS_UCS4
9175 EOF
9176 cat >> confdefs.h <<\EOF
9177 #define CHAR_IS_UCS4 1
9178 EOF
9179 }
9180
9181     { test "$extra_verbose" = "yes" && cat << \EOF
9182     Defining UTF2000
9183 EOF
9184 cat >> confdefs.h <<\EOF
9185 #define UTF2000 1
9186 EOF
9187 }
9188
9189     { test "$extra_verbose" = "yes" && cat << \EOF
9190     Defining HAVE_GGC
9191 EOF
9192 cat >> confdefs.h <<\EOF
9193 #define HAVE_GGC 1
9194 EOF
9195 }
9196
9197   fi
9198
9199   echo "checking for Mule input methods" 1>&6
9200 echo "configure:9201: checking for Mule input methods" >&5
9201         case "$with_xim" in "" | "yes" )
9202     echo "checking for XIM" 1>&6
9203 echo "configure:9204: checking for XIM" >&5
9204     
9205 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
9206 echo "configure:9207: checking for XOpenIM in -lX11" >&5
9207 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
9208
9209 xe_check_libs=" -lX11 "
9210 cat > conftest.$ac_ext <<EOF
9211 #line 9212 "configure"
9212 #include "confdefs.h"
9213 /* Override any gcc2 internal prototype to avoid an error.  */
9214 /* We use char because int might match the return type of a gcc2
9215     builtin and then its argument prototype would still apply.  */
9216 char XOpenIM();
9217
9218 int main() {
9219 XOpenIM()
9220 ; return 0; }
9221 EOF
9222 if { (eval echo configure:9223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9223   rm -rf conftest*
9224   eval "ac_cv_lib_$ac_lib_var=yes"
9225 else
9226   echo "configure: failed program was:" >&5
9227   cat conftest.$ac_ext >&5
9228   rm -rf conftest*
9229   eval "ac_cv_lib_$ac_lib_var=no"
9230 fi
9231 rm -f conftest*
9232 xe_check_libs=""
9233
9234 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9235   echo "$ac_t""yes" 1>&6
9236   with_xim=xlib
9237 else
9238   echo "$ac_t""no" 1>&6
9239 with_xim=no
9240 fi
9241
9242
9243         if test "$have_motif $have_lesstif" = "yes no"; then
9244       
9245 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
9246 echo "configure:9247: checking for XmImMbLookupString in -lXm" >&5
9247 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
9248
9249 xe_check_libs=" -lXm "
9250 cat > conftest.$ac_ext <<EOF
9251 #line 9252 "configure"
9252 #include "confdefs.h"
9253 /* Override any gcc2 internal prototype to avoid an error.  */
9254 /* We use char because int might match the return type of a gcc2
9255     builtin and then its argument prototype would still apply.  */
9256 char XmImMbLookupString();
9257
9258 int main() {
9259 XmImMbLookupString()
9260 ; return 0; }
9261 EOF
9262 if { (eval echo configure:9263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9263   rm -rf conftest*
9264   eval "ac_cv_lib_$ac_lib_var=yes"
9265 else
9266   echo "configure: failed program was:" >&5
9267   cat conftest.$ac_ext >&5
9268   rm -rf conftest*
9269   eval "ac_cv_lib_$ac_lib_var=no"
9270 fi
9271 rm -f conftest*
9272 xe_check_libs=""
9273
9274 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9275   echo "$ac_t""yes" 1>&6
9276   with_xim=motif
9277 else
9278   echo "$ac_t""no" 1>&6
9279 fi
9280
9281
9282     fi ;;
9283   esac
9284   if test "$with_xim" != "no"; then
9285     { test "$extra_verbose" = "yes" && cat << \EOF
9286     Defining HAVE_XIM
9287 EOF
9288 cat >> confdefs.h <<\EOF
9289 #define HAVE_XIM 1
9290 EOF
9291 }
9292
9293     if test "$with_xim" = "xlib"; then
9294       { test "$extra_verbose" = "yes" && cat << \EOF
9295     Defining XIM_XLIB
9296 EOF
9297 cat >> confdefs.h <<\EOF
9298 #define XIM_XLIB 1
9299 EOF
9300 }
9301
9302       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
9303    echo "    xemacs will be linked with \"input-method-xlib.o\""
9304  fi
9305     fi
9306     if test "$with_xim" = "motif"; then
9307       { test "$extra_verbose" = "yes" && cat << \EOF
9308     Defining XIM_MOTIF
9309 EOF
9310 cat >> confdefs.h <<\EOF
9311 #define XIM_MOTIF 1
9312 EOF
9313 }
9314
9315       need_motif=yes
9316       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
9317    echo "    xemacs will be linked with \"input-method-motif.o\""
9318  fi
9319     fi
9320     if test "$with_xim" = "motif"; then
9321       with_xfs=no
9322     fi
9323   fi
9324
9325     if test "$with_xfs" = "yes" ; then
9326     echo "checking for XFontSet" 1>&6
9327 echo "configure:9328: checking for XFontSet" >&5
9328     
9329 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
9330 echo "configure:9331: checking for XmbDrawString in -lX11" >&5
9331 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
9332
9333 xe_check_libs=" -lX11 "
9334 cat > conftest.$ac_ext <<EOF
9335 #line 9336 "configure"
9336 #include "confdefs.h"
9337 /* Override any gcc2 internal prototype to avoid an error.  */
9338 /* We use char because int might match the return type of a gcc2
9339     builtin and then its argument prototype would still apply.  */
9340 char XmbDrawString();
9341
9342 int main() {
9343 XmbDrawString()
9344 ; return 0; }
9345 EOF
9346 if { (eval echo configure:9347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9347   rm -rf conftest*
9348   eval "ac_cv_lib_$ac_lib_var=yes"
9349 else
9350   echo "configure: failed program was:" >&5
9351   cat conftest.$ac_ext >&5
9352   rm -rf conftest*
9353   eval "ac_cv_lib_$ac_lib_var=no"
9354 fi
9355 rm -f conftest*
9356 xe_check_libs=""
9357
9358 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9359   echo "$ac_t""yes" 1>&6
9360   :
9361 else
9362   echo "$ac_t""no" 1>&6
9363 with_xfs=no
9364 fi
9365
9366
9367     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
9368       { test "$extra_verbose" = "yes" && cat << \EOF
9369     Defining USE_XFONTSET
9370 EOF
9371 cat >> confdefs.h <<\EOF
9372 #define USE_XFONTSET 1
9373 EOF
9374 }
9375
9376       if test "$with_xim" = "no" ; then
9377         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
9378    echo "    xemacs will be linked with \"input-method-xfs.o\""
9379  fi
9380       fi
9381     fi
9382   fi 
9383     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
9384   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
9385 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
9386 echo "configure:9387: checking for wnn/jllib.h" >&5
9387
9388 cat > conftest.$ac_ext <<EOF
9389 #line 9390 "configure"
9390 #include "confdefs.h"
9391 #include <wnn/jllib.h>
9392 EOF
9393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9394 { (eval echo configure:9395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9395 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9396 if test -z "$ac_err"; then
9397   rm -rf conftest*
9398   eval "ac_cv_header_$ac_safe=yes"
9399 else
9400   echo "$ac_err" >&5
9401   echo "configure: failed program was:" >&5
9402   cat conftest.$ac_ext >&5
9403   rm -rf conftest*
9404   eval "ac_cv_header_$ac_safe=no"
9405 fi
9406 rm -f conftest*
9407 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9408   echo "$ac_t""yes" 1>&6
9409   :
9410 else
9411   echo "$ac_t""no" 1>&6
9412 with_wnn=no
9413 fi
9414  }
9415     if test "$with_wnn" != "no"; then
9416     for ac_func in crypt
9417 do
9418 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9419 echo "configure:9420: checking for $ac_func" >&5
9420
9421 cat > conftest.$ac_ext <<EOF
9422 #line 9423 "configure"
9423 #include "confdefs.h"
9424 /* System header to define __stub macros and hopefully few prototypes,
9425     which can conflict with char $ac_func(); below.  */
9426 #include <assert.h>
9427 /* Override any gcc2 internal prototype to avoid an error.  */
9428 /* We use char because int might match the return type of a gcc2
9429     builtin and then its argument prototype would still apply.  */
9430 char $ac_func();
9431
9432 int main() {
9433
9434 /* The GNU C library defines this for functions which it implements
9435     to always fail with ENOSYS.  Some functions are actually named
9436     something starting with __ and the normal name is an alias.  */
9437 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9438 choke me
9439 #else
9440 $ac_func();
9441 #endif
9442
9443 ; return 0; }
9444 EOF
9445 if { (eval echo configure:9446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9446   rm -rf conftest*
9447   eval "ac_cv_func_$ac_func=yes"
9448 else
9449   echo "configure: failed program was:" >&5
9450   cat conftest.$ac_ext >&5
9451   rm -rf conftest*
9452   eval "ac_cv_func_$ac_func=no"
9453 fi
9454 rm -f conftest*
9455
9456 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9457   echo "$ac_t""yes" 1>&6
9458     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9459   { test "$extra_verbose" = "yes" && cat << EOF
9460     Defining $ac_tr_func
9461 EOF
9462 cat >> confdefs.h <<EOF
9463 #define $ac_tr_func 1
9464 EOF
9465 }
9466  
9467 else
9468   echo "$ac_t""no" 1>&6
9469 fi
9470 done
9471
9472     test "$ac_cv_func_crypt" != "yes" && { 
9473 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9474 echo "configure:9475: checking for crypt in -lcrypt" >&5
9475 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9476
9477 xe_check_libs=" -lcrypt "
9478 cat > conftest.$ac_ext <<EOF
9479 #line 9480 "configure"
9480 #include "confdefs.h"
9481 /* Override any gcc2 internal prototype to avoid an error.  */
9482 /* We use char because int might match the return type of a gcc2
9483     builtin and then its argument prototype would still apply.  */
9484 char crypt();
9485
9486 int main() {
9487 crypt()
9488 ; return 0; }
9489 EOF
9490 if { (eval echo configure:9491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9491   rm -rf conftest*
9492   eval "ac_cv_lib_$ac_lib_var=yes"
9493 else
9494   echo "configure: failed program was:" >&5
9495   cat conftest.$ac_ext >&5
9496   rm -rf conftest*
9497   eval "ac_cv_lib_$ac_lib_var=no"
9498 fi
9499 rm -f conftest*
9500 xe_check_libs=""
9501
9502 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9503   echo "$ac_t""yes" 1>&6
9504     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9505     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9506   { test "$extra_verbose" = "yes" && cat << EOF
9507     Defining $ac_tr_lib
9508 EOF
9509 cat >> confdefs.h <<EOF
9510 #define $ac_tr_lib 1
9511 EOF
9512 }
9513
9514   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
9515
9516 else
9517   echo "$ac_t""no" 1>&6
9518 fi
9519
9520  }
9521   fi
9522     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
9523     
9524 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
9525 echo "configure:9526: checking for jl_dic_list_e in -lwnn" >&5
9526 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9527
9528 xe_check_libs=" -lwnn "
9529 cat > conftest.$ac_ext <<EOF
9530 #line 9531 "configure"
9531 #include "confdefs.h"
9532 /* Override any gcc2 internal prototype to avoid an error.  */
9533 /* We use char because int might match the return type of a gcc2
9534     builtin and then its argument prototype would still apply.  */
9535 char jl_dic_list_e();
9536
9537 int main() {
9538 jl_dic_list_e()
9539 ; return 0; }
9540 EOF
9541 if { (eval echo configure:9542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9542   rm -rf conftest*
9543   eval "ac_cv_lib_$ac_lib_var=yes"
9544 else
9545   echo "configure: failed program was:" >&5
9546   cat conftest.$ac_ext >&5
9547   rm -rf conftest*
9548   eval "ac_cv_lib_$ac_lib_var=no"
9549 fi
9550 rm -f conftest*
9551 xe_check_libs=""
9552
9553 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9554   echo "$ac_t""yes" 1>&6
9555   libwnn=wnn
9556 else
9557   echo "$ac_t""no" 1>&6
9558 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
9559 echo "configure:9560: checking for jl_dic_list_e in -lwnn4" >&5
9560 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9561
9562 xe_check_libs=" -lwnn4 "
9563 cat > conftest.$ac_ext <<EOF
9564 #line 9565 "configure"
9565 #include "confdefs.h"
9566 /* Override any gcc2 internal prototype to avoid an error.  */
9567 /* We use char because int might match the return type of a gcc2
9568     builtin and then its argument prototype would still apply.  */
9569 char jl_dic_list_e();
9570
9571 int main() {
9572 jl_dic_list_e()
9573 ; return 0; }
9574 EOF
9575 if { (eval echo configure:9576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9576   rm -rf conftest*
9577   eval "ac_cv_lib_$ac_lib_var=yes"
9578 else
9579   echo "configure: failed program was:" >&5
9580   cat conftest.$ac_ext >&5
9581   rm -rf conftest*
9582   eval "ac_cv_lib_$ac_lib_var=no"
9583 fi
9584 rm -f conftest*
9585 xe_check_libs=""
9586
9587 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9588   echo "$ac_t""yes" 1>&6
9589   libwnn=wnn4
9590 else
9591   echo "$ac_t""no" 1>&6
9592 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
9593 echo "configure:9594: checking for jl_dic_list_e in -lwnn6" >&5
9594 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9595
9596 xe_check_libs=" -lwnn6 "
9597 cat > conftest.$ac_ext <<EOF
9598 #line 9599 "configure"
9599 #include "confdefs.h"
9600 /* Override any gcc2 internal prototype to avoid an error.  */
9601 /* We use char because int might match the return type of a gcc2
9602     builtin and then its argument prototype would still apply.  */
9603 char jl_dic_list_e();
9604
9605 int main() {
9606 jl_dic_list_e()
9607 ; return 0; }
9608 EOF
9609 if { (eval echo configure:9610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9610   rm -rf conftest*
9611   eval "ac_cv_lib_$ac_lib_var=yes"
9612 else
9613   echo "configure: failed program was:" >&5
9614   cat conftest.$ac_ext >&5
9615   rm -rf conftest*
9616   eval "ac_cv_lib_$ac_lib_var=no"
9617 fi
9618 rm -f conftest*
9619 xe_check_libs=""
9620
9621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9622   echo "$ac_t""yes" 1>&6
9623   libwnn=wnn6
9624 else
9625   echo "$ac_t""no" 1>&6
9626 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
9627 echo "configure:9628: checking for dic_list_e in -lwnn6_fromsrc" >&5
9628 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
9629
9630 xe_check_libs=" -lwnn6_fromsrc "
9631 cat > conftest.$ac_ext <<EOF
9632 #line 9633 "configure"
9633 #include "confdefs.h"
9634 /* Override any gcc2 internal prototype to avoid an error.  */
9635 /* We use char because int might match the return type of a gcc2
9636     builtin and then its argument prototype would still apply.  */
9637 char dic_list_e();
9638
9639 int main() {
9640 dic_list_e()
9641 ; return 0; }
9642 EOF
9643 if { (eval echo configure:9644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9644   rm -rf conftest*
9645   eval "ac_cv_lib_$ac_lib_var=yes"
9646 else
9647   echo "configure: failed program was:" >&5
9648   cat conftest.$ac_ext >&5
9649   rm -rf conftest*
9650   eval "ac_cv_lib_$ac_lib_var=no"
9651 fi
9652 rm -f conftest*
9653 xe_check_libs=""
9654
9655 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9656   echo "$ac_t""yes" 1>&6
9657   libwnn=wnn6_fromsrc
9658 else
9659   echo "$ac_t""no" 1>&6
9660 with_wnn=no
9661 fi
9662
9663
9664 fi
9665
9666
9667 fi
9668
9669
9670 fi
9671
9672
9673   fi
9674   test -z "$with_wnn" && with_wnn=yes
9675   if test "$with_wnn" = "yes"; then
9676     { test "$extra_verbose" = "yes" && cat << \EOF
9677     Defining HAVE_WNN
9678 EOF
9679 cat >> confdefs.h <<\EOF
9680 #define HAVE_WNN 1
9681 EOF
9682 }
9683
9684     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
9685     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
9686    echo "    xemacs will be linked with \"mule-wnnfns.o\""
9687  fi
9688     if test "$with_wnn6" != "no"; then
9689       
9690 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
9691 echo "configure:9692: checking for jl_fi_dic_list in -l$libwnn" >&5
9692 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
9693
9694 xe_check_libs=" -l$libwnn "
9695 cat > conftest.$ac_ext <<EOF
9696 #line 9697 "configure"
9697 #include "confdefs.h"
9698 /* Override any gcc2 internal prototype to avoid an error.  */
9699 /* We use char because int might match the return type of a gcc2
9700     builtin and then its argument prototype would still apply.  */
9701 char jl_fi_dic_list();
9702
9703 int main() {
9704 jl_fi_dic_list()
9705 ; return 0; }
9706 EOF
9707 if { (eval echo configure:9708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9708   rm -rf conftest*
9709   eval "ac_cv_lib_$ac_lib_var=yes"
9710 else
9711   echo "configure: failed program was:" >&5
9712   cat conftest.$ac_ext >&5
9713   rm -rf conftest*
9714   eval "ac_cv_lib_$ac_lib_var=no"
9715 fi
9716 rm -f conftest*
9717 xe_check_libs=""
9718
9719 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9720   echo "$ac_t""yes" 1>&6
9721   with_wnn6=yes
9722 else
9723   echo "$ac_t""no" 1>&6
9724 fi
9725
9726
9727       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9728     Defining WNN6
9729 EOF
9730 cat >> confdefs.h <<\EOF
9731 #define WNN6 1
9732 EOF
9733 }
9734
9735     fi
9736   fi
9737
9738     canna_includes_found=no
9739   if test "$with_canna" != "no"; then
9740     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
9741 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
9742 echo "configure:9743: checking for canna/jrkanji.h" >&5
9743
9744 cat > conftest.$ac_ext <<EOF
9745 #line 9746 "configure"
9746 #include "confdefs.h"
9747 #include <canna/jrkanji.h>
9748 EOF
9749 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9750 { (eval echo configure:9751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9751 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9752 if test -z "$ac_err"; then
9753   rm -rf conftest*
9754   eval "ac_cv_header_$ac_safe=yes"
9755 else
9756   echo "$ac_err" >&5
9757   echo "configure: failed program was:" >&5
9758   cat conftest.$ac_ext >&5
9759   rm -rf conftest*
9760   eval "ac_cv_header_$ac_safe=no"
9761 fi
9762 rm -f conftest*
9763 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9764   echo "$ac_t""yes" 1>&6
9765   canna_includes_found=yes
9766 else
9767   echo "$ac_t""no" 1>&6
9768 fi
9769
9770   fi
9771   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
9772       -d "/usr/local/canna/include"; then
9773     save_c_switch_site="$c_switch_site"
9774     c_switch_site="$c_switch_site -I/usr/local/canna/include"
9775     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
9776 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
9777 echo "configure:9778: checking for canna/jrkanji.h" >&5
9778
9779 cat > conftest.$ac_ext <<EOF
9780 #line 9781 "configure"
9781 #include "confdefs.h"
9782 #include <canna/jrkanji.h>
9783 EOF
9784 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9785 { (eval echo configure:9786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9786 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9787 if test -z "$ac_err"; then
9788   rm -rf conftest*
9789   eval "ac_cv_header_$ac_safe=yes"
9790 else
9791   echo "$ac_err" >&5
9792   echo "configure: failed program was:" >&5
9793   cat conftest.$ac_ext >&5
9794   rm -rf conftest*
9795   eval "ac_cv_header_$ac_safe=no"
9796 fi
9797 rm -f conftest*
9798 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9799   echo "$ac_t""yes" 1>&6
9800   canna_includes_found=yes
9801 else
9802   echo "$ac_t""no" 1>&6
9803 fi
9804
9805     if test "$canna_includes_found" != "yes"; then
9806       c_switch_site="$save_c_switch_site"
9807       with_canna="no"
9808     fi
9809   fi
9810
9811   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
9812 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
9813 echo "configure:9814: checking for canna/RK.h" >&5
9814
9815 cat > conftest.$ac_ext <<EOF
9816 #line 9817 "configure"
9817 #include "confdefs.h"
9818 #include <canna/RK.h>
9819 EOF
9820 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9821 { (eval echo configure:9822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9822 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9823 if test -z "$ac_err"; then
9824   rm -rf conftest*
9825   eval "ac_cv_header_$ac_safe=yes"
9826 else
9827   echo "$ac_err" >&5
9828   echo "configure: failed program was:" >&5
9829   cat conftest.$ac_ext >&5
9830   rm -rf conftest*
9831   eval "ac_cv_header_$ac_safe=no"
9832 fi
9833 rm -f conftest*
9834 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9835   echo "$ac_t""yes" 1>&6
9836   :
9837 else
9838   echo "$ac_t""no" 1>&6
9839 with_canna=no
9840 fi
9841  }
9842   test -z "$with_canna" && { 
9843 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
9844 echo "configure:9845: checking for RkBgnBun in -lRKC" >&5
9845 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
9846
9847 xe_check_libs=" -lRKC "
9848 cat > conftest.$ac_ext <<EOF
9849 #line 9850 "configure"
9850 #include "confdefs.h"
9851 /* Override any gcc2 internal prototype to avoid an error.  */
9852 /* We use char because int might match the return type of a gcc2
9853     builtin and then its argument prototype would still apply.  */
9854 char RkBgnBun();
9855
9856 int main() {
9857 RkBgnBun()
9858 ; return 0; }
9859 EOF
9860 if { (eval echo configure:9861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9861   rm -rf conftest*
9862   eval "ac_cv_lib_$ac_lib_var=yes"
9863 else
9864   echo "configure: failed program was:" >&5
9865   cat conftest.$ac_ext >&5
9866   rm -rf conftest*
9867   eval "ac_cv_lib_$ac_lib_var=no"
9868 fi
9869 rm -f conftest*
9870 xe_check_libs=""
9871
9872 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9873   echo "$ac_t""yes" 1>&6
9874   :
9875 else
9876   echo "$ac_t""no" 1>&6
9877 with_canna=no
9878 fi
9879
9880  }
9881   test -z "$with_canna" && { 
9882 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
9883 echo "configure:9884: checking for jrKanjiControl in -lcanna" >&5
9884 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
9885
9886 xe_check_libs=" -lcanna "
9887 cat > conftest.$ac_ext <<EOF
9888 #line 9889 "configure"
9889 #include "confdefs.h"
9890 /* Override any gcc2 internal prototype to avoid an error.  */
9891 /* We use char because int might match the return type of a gcc2
9892     builtin and then its argument prototype would still apply.  */
9893 char jrKanjiControl();
9894
9895 int main() {
9896 jrKanjiControl()
9897 ; return 0; }
9898 EOF
9899 if { (eval echo configure:9900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9900   rm -rf conftest*
9901   eval "ac_cv_lib_$ac_lib_var=yes"
9902 else
9903   echo "configure: failed program was:" >&5
9904   cat conftest.$ac_ext >&5
9905   rm -rf conftest*
9906   eval "ac_cv_lib_$ac_lib_var=no"
9907 fi
9908 rm -f conftest*
9909 xe_check_libs=""
9910
9911 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9912   echo "$ac_t""yes" 1>&6
9913   :
9914 else
9915   echo "$ac_t""no" 1>&6
9916 with_canna=no
9917 fi
9918
9919  }
9920   test -z "$with_canna" && with_canna=yes
9921   if test "$with_canna" = "yes"; then
9922     { test "$extra_verbose" = "yes" && cat << \EOF
9923     Defining HAVE_CANNA
9924 EOF
9925 cat >> confdefs.h <<\EOF
9926 #define HAVE_CANNA 1
9927 EOF
9928 }
9929
9930     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
9931     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
9932    echo "    xemacs will be linked with \"mule-canna.o\""
9933  fi
9934   fi
9935
9936 else   for feature in xim canna wnn; do
9937     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
9938       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
9939     fi
9940     eval "with_${feature}=no"
9941   done
9942 fi 
9943
9944 if test "$need_motif" = "yes" ; then
9945   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
9946     
9947 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
9948 echo "configure:9949: checking for layout_object_getvalue in -li18n" >&5
9949 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
9950
9951 xe_check_libs=" -li18n "
9952 cat > conftest.$ac_ext <<EOF
9953 #line 9954 "configure"
9954 #include "confdefs.h"
9955 /* Override any gcc2 internal prototype to avoid an error.  */
9956 /* We use char because int might match the return type of a gcc2
9957     builtin and then its argument prototype would still apply.  */
9958 char layout_object_getvalue();
9959
9960 int main() {
9961 layout_object_getvalue()
9962 ; return 0; }
9963 EOF
9964 if { (eval echo configure:9965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9965   rm -rf conftest*
9966   eval "ac_cv_lib_$ac_lib_var=yes"
9967 else
9968   echo "configure: failed program was:" >&5
9969   cat conftest.$ac_ext >&5
9970   rm -rf conftest*
9971   eval "ac_cv_lib_$ac_lib_var=no"
9972 fi
9973 rm -f conftest*
9974 xe_check_libs=""
9975
9976 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9977   echo "$ac_t""yes" 1>&6
9978   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
9979 else
9980   echo "$ac_t""no" 1>&6
9981 fi
9982
9983
9984   
9985 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
9986     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
9987   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
9988   
9989         runpath="" runpath_dirs=""
9990   if test -n "$LD_RUN_PATH"; then
9991     runpath="$LD_RUN_PATH"
9992   elif test "$GCC" = "yes"; then
9993         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
9994     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
9995     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
9996     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
9997       case "$arg" in P,* | -L* | -R* )
9998         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
9999           {
10000 xe_runpath_dir="$dir"
10001   test "$xe_runpath_dir" != "/lib"     -a \
10002         "$xe_runpath_dir" != "/usr/lib" -a \
10003         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
10004   eval "$xe_add_unique_runpath_dir"
10005 }
10006         done ;;
10007       esac
10008     done
10009     ld_switch_run="$ld_switch_run_save"
10010     rm -f conftest*
10011   else
10012         for arg in $ld_switch_site $ld_switch_x_site; do
10013       case "$arg" in -L*) {
10014 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
10015   test "$xe_runpath_dir" != "/lib"     -a \
10016         "$xe_runpath_dir" != "/usr/lib" -a \
10017         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
10018   eval "$xe_add_unique_runpath_dir"
10019 };; esac
10020     done
10021         if test "$opsys $need_motif" = "sol2 yes"; then
10022       xe_runpath_dir="/opt/SUNWdt/lib";
10023       eval "$xe_add_unique_runpath_dir";
10024     fi
10025   fi 
10026   if test -n "$runpath"; then
10027     ld_switch_run="${dash_r}${runpath}"
10028     
10029 if test "$GCC" = "yes"; then
10030   set x $ld_switch_run; shift; ld_switch_run=""
10031   while test -n "$1"; do
10032     case $1 in
10033       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
10034       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
10035       -Xlinker* ) ;;
10036       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
10037     esac
10038     shift
10039   done
10040 fi
10041     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
10042   fi
10043 fi
10044
10045 fi
10046
10047 for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getpt getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask
10048 do
10049 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10050 echo "configure:10051: checking for $ac_func" >&5
10051
10052 cat > conftest.$ac_ext <<EOF
10053 #line 10054 "configure"
10054 #include "confdefs.h"
10055 /* System header to define __stub macros and hopefully few prototypes,
10056     which can conflict with char $ac_func(); below.  */
10057 #include <assert.h>
10058 /* Override any gcc2 internal prototype to avoid an error.  */
10059 /* We use char because int might match the return type of a gcc2
10060     builtin and then its argument prototype would still apply.  */
10061 char $ac_func();
10062
10063 int main() {
10064
10065 /* The GNU C library defines this for functions which it implements
10066     to always fail with ENOSYS.  Some functions are actually named
10067     something starting with __ and the normal name is an alias.  */
10068 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10069 choke me
10070 #else
10071 $ac_func();
10072 #endif
10073
10074 ; return 0; }
10075 EOF
10076 if { (eval echo configure:10077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10077   rm -rf conftest*
10078   eval "ac_cv_func_$ac_func=yes"
10079 else
10080   echo "configure: failed program was:" >&5
10081   cat conftest.$ac_ext >&5
10082   rm -rf conftest*
10083   eval "ac_cv_func_$ac_func=no"
10084 fi
10085 rm -f conftest*
10086
10087 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10088   echo "$ac_t""yes" 1>&6
10089     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10090   { test "$extra_verbose" = "yes" && cat << EOF
10091     Defining $ac_tr_func
10092 EOF
10093 cat >> confdefs.h <<EOF
10094 #define $ac_tr_func 1
10095 EOF
10096 }
10097  
10098 else
10099   echo "$ac_t""no" 1>&6
10100 fi
10101 done
10102
10103
10104 extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
10105    echo "    xemacs will be linked with \"realpath.o\""
10106  fi
10107
10108 for ac_func in getloadavg
10109 do
10110 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10111 echo "configure:10112: checking for $ac_func" >&5
10112
10113 cat > conftest.$ac_ext <<EOF
10114 #line 10115 "configure"
10115 #include "confdefs.h"
10116 /* System header to define __stub macros and hopefully few prototypes,
10117     which can conflict with char $ac_func(); below.  */
10118 #include <assert.h>
10119 /* Override any gcc2 internal prototype to avoid an error.  */
10120 /* We use char because int might match the return type of a gcc2
10121     builtin and then its argument prototype would still apply.  */
10122 char $ac_func();
10123
10124 int main() {
10125
10126 /* The GNU C library defines this for functions which it implements
10127     to always fail with ENOSYS.  Some functions are actually named
10128     something starting with __ and the normal name is an alias.  */
10129 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10130 choke me
10131 #else
10132 $ac_func();
10133 #endif
10134
10135 ; return 0; }
10136 EOF
10137 if { (eval echo configure:10138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10138   rm -rf conftest*
10139   eval "ac_cv_func_$ac_func=yes"
10140 else
10141   echo "configure: failed program was:" >&5
10142   cat conftest.$ac_ext >&5
10143   rm -rf conftest*
10144   eval "ac_cv_func_$ac_func=no"
10145 fi
10146 rm -f conftest*
10147
10148 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10149   echo "$ac_t""yes" 1>&6
10150     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10151   { test "$extra_verbose" = "yes" && cat << EOF
10152     Defining $ac_tr_func
10153 EOF
10154 cat >> confdefs.h <<EOF
10155 #define $ac_tr_func 1
10156 EOF
10157 }
10158  
10159 else
10160   echo "$ac_t""no" 1>&6
10161 fi
10162 done
10163
10164
10165 if test "$ac_cv_func_getloadavg" != "yes"
10166 then
10167   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
10168    echo "    xemacs will be linked with \"getloadavg.o\""
10169  fi
10170
10171     
10172 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
10173 echo "configure:10174: checking for kstat_open in -lkstat" >&5
10174 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
10175
10176 xe_check_libs=" -lkstat "
10177 cat > conftest.$ac_ext <<EOF
10178 #line 10179 "configure"
10179 #include "confdefs.h"
10180 /* Override any gcc2 internal prototype to avoid an error.  */
10181 /* We use char because int might match the return type of a gcc2
10182     builtin and then its argument prototype would still apply.  */
10183 char kstat_open();
10184
10185 int main() {
10186 kstat_open()
10187 ; return 0; }
10188 EOF
10189 if { (eval echo configure:10190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10190   rm -rf conftest*
10191   eval "ac_cv_lib_$ac_lib_var=yes"
10192 else
10193   echo "configure: failed program was:" >&5
10194   cat conftest.$ac_ext >&5
10195   rm -rf conftest*
10196   eval "ac_cv_lib_$ac_lib_var=no"
10197 fi
10198 rm -f conftest*
10199 xe_check_libs=""
10200
10201 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10202   echo "$ac_t""yes" 1>&6
10203     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10204     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10205   { test "$extra_verbose" = "yes" && cat << EOF
10206     Defining $ac_tr_lib
10207 EOF
10208 cat >> confdefs.h <<EOF
10209 #define $ac_tr_lib 1
10210 EOF
10211 }
10212
10213   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
10214
10215 else
10216   echo "$ac_t""no" 1>&6
10217 fi
10218
10219
10220
10221     
10222 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
10223 echo "configure:10224: checking for kvm_read in -lkvm" >&5
10224 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
10225
10226 xe_check_libs=" -lkvm "
10227 cat > conftest.$ac_ext <<EOF
10228 #line 10229 "configure"
10229 #include "confdefs.h"
10230 /* Override any gcc2 internal prototype to avoid an error.  */
10231 /* We use char because int might match the return type of a gcc2
10232     builtin and then its argument prototype would still apply.  */
10233 char kvm_read();
10234
10235 int main() {
10236 kvm_read()
10237 ; return 0; }
10238 EOF
10239 if { (eval echo configure:10240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10240   rm -rf conftest*
10241   eval "ac_cv_lib_$ac_lib_var=yes"
10242 else
10243   echo "configure: failed program was:" >&5
10244   cat conftest.$ac_ext >&5
10245   rm -rf conftest*
10246   eval "ac_cv_lib_$ac_lib_var=no"
10247 fi
10248 rm -f conftest*
10249 xe_check_libs=""
10250
10251 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10252   echo "$ac_t""yes" 1>&6
10253     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10254     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10255   { test "$extra_verbose" = "yes" && cat << EOF
10256     Defining $ac_tr_lib
10257 EOF
10258 cat >> confdefs.h <<EOF
10259 #define $ac_tr_lib 1
10260 EOF
10261 }
10262
10263   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
10264
10265 else
10266   echo "$ac_t""no" 1>&6
10267 fi
10268
10269
10270 fi
10271
10272 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
10273 echo "configure:10274: checking whether netdb declares h_errno" >&5
10274 cat > conftest.$ac_ext <<EOF
10275 #line 10276 "configure"
10276 #include "confdefs.h"
10277 #include <netdb.h>
10278 int main() {
10279 return h_errno;
10280 ; return 0; }
10281 EOF
10282 if { (eval echo configure:10283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10283   rm -rf conftest*
10284   echo "$ac_t""yes" 1>&6
10285    { test "$extra_verbose" = "yes" && cat << \EOF
10286     Defining HAVE_H_ERRNO
10287 EOF
10288 cat >> confdefs.h <<\EOF
10289 #define HAVE_H_ERRNO 1
10290 EOF
10291 }
10292
10293 else
10294   echo "configure: failed program was:" >&5
10295   cat conftest.$ac_ext >&5
10296   rm -rf conftest*
10297   echo "$ac_t""no" 1>&6
10298 fi
10299 rm -f conftest*
10300
10301 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
10302 echo "configure:10303: checking for sigsetjmp" >&5
10303 cat > conftest.$ac_ext <<EOF
10304 #line 10305 "configure"
10305 #include "confdefs.h"
10306 #include <setjmp.h>
10307 int main() {
10308 sigjmp_buf bar; sigsetjmp (bar, 0);
10309 ; return 0; }
10310 EOF
10311 if { (eval echo configure:10312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10312   rm -rf conftest*
10313   echo "$ac_t""yes" 1>&6
10314    { test "$extra_verbose" = "yes" && cat << \EOF
10315     Defining HAVE_SIGSETJMP
10316 EOF
10317 cat >> confdefs.h <<\EOF
10318 #define HAVE_SIGSETJMP 1
10319 EOF
10320 }
10321
10322 else
10323   echo "configure: failed program was:" >&5
10324   cat conftest.$ac_ext >&5
10325   rm -rf conftest*
10326   echo "$ac_t""no" 1>&6
10327 fi
10328 rm -f conftest*
10329
10330 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
10331 echo "configure:10332: checking whether localtime caches TZ" >&5
10332
10333 if test "$ac_cv_func_tzset" = "yes"; then
10334 cat > conftest.$ac_ext <<EOF
10335 #line 10336 "configure"
10336 #include "confdefs.h"
10337 #include <time.h>
10338 #if STDC_HEADERS
10339 # include <stdlib.h>
10340 #endif
10341 extern char **environ;
10342 unset_TZ ()
10343 {
10344   char **from, **to;
10345   for (to = from = environ; (*to = *from); from++)
10346     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
10347       to++;
10348 }
10349 char TZ_GMT0[] = "TZ=GMT0";
10350 char TZ_PST8[] = "TZ=PST8";
10351 main()
10352 {
10353   time_t now = time ((time_t *) 0);
10354   int hour_GMT0, hour_unset;
10355   if (putenv (TZ_GMT0) != 0)
10356     exit (1);
10357   hour_GMT0 = localtime (&now)->tm_hour;
10358   unset_TZ ();
10359   hour_unset = localtime (&now)->tm_hour;
10360   if (putenv (TZ_PST8) != 0)
10361     exit (1);
10362   if (localtime (&now)->tm_hour == hour_GMT0)
10363     exit (1);
10364   unset_TZ ();
10365   if (localtime (&now)->tm_hour != hour_unset)
10366     exit (1);
10367   exit (0);
10368 }
10369 EOF
10370 if { (eval echo configure:10371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10371 then
10372   emacs_cv_localtime_cache=no
10373 else
10374   conftest_rc="$?"
10375   echo "configure: failed program was:" >&5
10376   cat conftest.$ac_ext >&5
10377   rm -fr conftest*
10378   emacs_cv_localtime_cache=yes
10379 fi
10380 rm -fr conftest*
10381 else
10382         # If we lack tzset, report that localtime does not cache TZ,
10383         # since we can't invalidate the cache if we don't have tzset.
10384         emacs_cv_localtime_cache=no
10385 fi
10386 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
10387 if test $emacs_cv_localtime_cache = yes; then
10388   { test "$extra_verbose" = "yes" && cat << \EOF
10389     Defining LOCALTIME_CACHE
10390 EOF
10391 cat >> confdefs.h <<\EOF
10392 #define LOCALTIME_CACHE 1
10393 EOF
10394 }
10395
10396 fi
10397
10398 if test "$HAVE_TIMEVAL" = "yes"; then
10399 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
10400 echo "configure:10401: checking whether gettimeofday accepts one or two arguments" >&5
10401 cat > conftest.$ac_ext <<EOF
10402 #line 10403 "configure"
10403 #include "confdefs.h"
10404
10405 #ifdef TIME_WITH_SYS_TIME
10406 #include <sys/time.h>
10407 #include <time.h>
10408 #else
10409 #ifdef HAVE_SYS_TIME_H
10410 #include <sys/time.h>
10411 #else
10412 #include <time.h>
10413 #endif
10414 #endif
10415   
10416 int main() {
10417
10418   struct timeval time;
10419   gettimeofday (&time, 0);
10420
10421 ; return 0; }
10422 EOF
10423 if { (eval echo configure:10424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10424   rm -rf conftest*
10425   echo "$ac_t""two" 1>&6
10426 else
10427   echo "configure: failed program was:" >&5
10428   cat conftest.$ac_ext >&5
10429   rm -rf conftest*
10430   echo "$ac_t""one" 1>&6
10431    { test "$extra_verbose" = "yes" && cat << \EOF
10432     Defining GETTIMEOFDAY_ONE_ARGUMENT
10433 EOF
10434 cat >> confdefs.h <<\EOF
10435 #define GETTIMEOFDAY_ONE_ARGUMENT 1
10436 EOF
10437 }
10438
10439 fi
10440 rm -f conftest*
10441 fi
10442
10443
10444 echo $ac_n "checking for inline""... $ac_c" 1>&6
10445 echo "configure:10446: checking for inline" >&5
10446
10447 ac_cv_c_inline=no
10448 for ac_kw in inline __inline__ __inline; do
10449   cat > conftest.$ac_ext <<EOF
10450 #line 10451 "configure"
10451 #include "confdefs.h"
10452
10453 int main() {
10454 } int $ac_kw foo() {
10455 ; return 0; }
10456 EOF
10457 if { (eval echo configure:10458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10458   rm -rf conftest*
10459   ac_cv_c_inline=$ac_kw; break
10460 else
10461   echo "configure: failed program was:" >&5
10462   cat conftest.$ac_ext >&5
10463 fi
10464 rm -f conftest*
10465 done
10466
10467
10468 echo "$ac_t""$ac_cv_c_inline" 1>&6
10469 case "$ac_cv_c_inline" in
10470   inline | yes) ;;
10471   no) { test "$extra_verbose" = "yes" && cat << \EOF
10472     Defining inline = 
10473 EOF
10474 cat >> confdefs.h <<\EOF
10475 #define inline 
10476 EOF
10477 }
10478  ;;
10479   *)  { test "$extra_verbose" = "yes" && cat << EOF
10480     Defining inline = $ac_cv_c_inline
10481 EOF
10482 cat >> confdefs.h <<EOF
10483 #define inline $ac_cv_c_inline
10484 EOF
10485 }
10486  ;;
10487 esac
10488
10489 test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
10490    echo "    xemacs will be linked with \"inline.o\""
10491  fi
10492
10493
10494 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
10495 # for constant arguments.  Useless!
10496 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
10497 echo "configure:10498: checking for working alloca.h" >&5
10498
10499 cat > conftest.$ac_ext <<EOF
10500 #line 10501 "configure"
10501 #include "confdefs.h"
10502 #include <alloca.h>
10503 int main() {
10504 void *p = alloca(2 * sizeof(int));
10505 ; return 0; }
10506 EOF
10507 if { (eval echo configure:10508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10508   rm -rf conftest*
10509   ac_cv_header_alloca_h=yes
10510 else
10511   echo "configure: failed program was:" >&5
10512   cat conftest.$ac_ext >&5
10513   rm -rf conftest*
10514   ac_cv_header_alloca_h=no
10515 fi
10516 rm -f conftest*
10517
10518 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
10519 if test $ac_cv_header_alloca_h = yes; then
10520   { test "$extra_verbose" = "yes" && cat << \EOF
10521     Defining HAVE_ALLOCA_H
10522 EOF
10523 cat >> confdefs.h <<\EOF
10524 #define HAVE_ALLOCA_H 1
10525 EOF
10526 }
10527
10528 fi
10529
10530 echo $ac_n "checking for alloca""... $ac_c" 1>&6
10531 echo "configure:10532: checking for alloca" >&5
10532
10533 cat > conftest.$ac_ext <<EOF
10534 #line 10535 "configure"
10535 #include "confdefs.h"
10536
10537 #ifdef __GNUC__
10538 # define alloca __builtin_alloca
10539 #else
10540 # ifdef _MSC_VER
10541 #  include <malloc.h>
10542 #  define alloca _alloca
10543 # else
10544 #  if HAVE_ALLOCA_H
10545 #   include <alloca.h>
10546 #  else
10547 #   ifdef _AIX
10548  #pragma alloca
10549 #   else
10550 #    ifndef alloca /* predefined by HP cc +Olibcalls */
10551 char *alloca ();
10552 #    endif
10553 #   endif
10554 #  endif
10555 # endif
10556 #endif
10557
10558 int main() {
10559 char *p = (char *) alloca(1);
10560 ; return 0; }
10561 EOF
10562 if { (eval echo configure:10563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10563   rm -rf conftest*
10564   ac_cv_func_alloca_works=yes
10565 else
10566   echo "configure: failed program was:" >&5
10567   cat conftest.$ac_ext >&5
10568   rm -rf conftest*
10569   ac_cv_func_alloca_works=no
10570 fi
10571 rm -f conftest*
10572
10573 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
10574 if test $ac_cv_func_alloca_works = yes; then
10575   { test "$extra_verbose" = "yes" && cat << \EOF
10576     Defining HAVE_ALLOCA
10577 EOF
10578 cat >> confdefs.h <<\EOF
10579 #define HAVE_ALLOCA 1
10580 EOF
10581 }
10582
10583 fi
10584
10585 if test $ac_cv_func_alloca_works = no; then
10586   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
10587   # that cause trouble.  Some versions do not even contain alloca or
10588   # contain a buggy version.  If you still want to use their alloca,
10589   # use ar to extract alloca.o from them instead of compiling alloca.c.
10590   ALLOCA=alloca.${ac_objext}
10591   { test "$extra_verbose" = "yes" && cat << \EOF
10592     Defining C_ALLOCA
10593 EOF
10594 cat >> confdefs.h <<\EOF
10595 #define C_ALLOCA 1
10596 EOF
10597 }
10598
10599
10600 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
10601 echo "configure:10602: checking whether alloca needs Cray hooks" >&5
10602
10603 cat > conftest.$ac_ext <<EOF
10604 #line 10605 "configure"
10605 #include "confdefs.h"
10606 #if defined(CRAY) && ! defined(CRAY2)
10607 webecray
10608 #else
10609 wenotbecray
10610 #endif
10611
10612 EOF
10613 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10614   egrep "webecray" >/dev/null 2>&1; then
10615   rm -rf conftest*
10616   ac_cv_os_cray=yes
10617 else
10618   rm -rf conftest*
10619   ac_cv_os_cray=no
10620 fi
10621 rm -f conftest*
10622
10623
10624 echo "$ac_t""$ac_cv_os_cray" 1>&6
10625 if test $ac_cv_os_cray = yes; then
10626 for ac_func in _getb67 GETB67 getb67; do
10627   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10628 echo "configure:10629: checking for $ac_func" >&5
10629
10630 cat > conftest.$ac_ext <<EOF
10631 #line 10632 "configure"
10632 #include "confdefs.h"
10633 /* System header to define __stub macros and hopefully few prototypes,
10634     which can conflict with char $ac_func(); below.  */
10635 #include <assert.h>
10636 /* Override any gcc2 internal prototype to avoid an error.  */
10637 /* We use char because int might match the return type of a gcc2
10638     builtin and then its argument prototype would still apply.  */
10639 char $ac_func();
10640
10641 int main() {
10642
10643 /* The GNU C library defines this for functions which it implements
10644     to always fail with ENOSYS.  Some functions are actually named
10645     something starting with __ and the normal name is an alias.  */
10646 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10647 choke me
10648 #else
10649 $ac_func();
10650 #endif
10651
10652 ; return 0; }
10653 EOF
10654 if { (eval echo configure:10655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10655   rm -rf conftest*
10656   eval "ac_cv_func_$ac_func=yes"
10657 else
10658   echo "configure: failed program was:" >&5
10659   cat conftest.$ac_ext >&5
10660   rm -rf conftest*
10661   eval "ac_cv_func_$ac_func=no"
10662 fi
10663 rm -f conftest*
10664
10665 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10666   echo "$ac_t""yes" 1>&6
10667   { test "$extra_verbose" = "yes" && cat << EOF
10668     Defining CRAY_STACKSEG_END = $ac_func
10669 EOF
10670 cat >> confdefs.h <<EOF
10671 #define CRAY_STACKSEG_END $ac_func
10672 EOF
10673 }
10674
10675   break
10676 else
10677   echo "$ac_t""no" 1>&6
10678 fi
10679
10680 done
10681 fi
10682
10683 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
10684 echo "configure:10685: checking stack direction for C alloca" >&5
10685
10686 cat > conftest.$ac_ext <<EOF
10687 #line 10688 "configure"
10688 #include "confdefs.h"
10689 find_stack_direction ()
10690 {
10691   static char *addr = 0;
10692   auto char dummy;
10693   if (addr == 0)
10694     {
10695       addr = &dummy;
10696       return find_stack_direction ();
10697     }
10698   else
10699     return (&dummy > addr) ? 1 : -1;
10700 }
10701 main ()
10702 {
10703   exit (find_stack_direction() < 0);
10704 }
10705 EOF
10706 if { (eval echo configure:10707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10707 then
10708   ac_cv_c_stack_direction=1
10709 else
10710   conftest_rc="$?"
10711   echo "configure: failed program was:" >&5
10712   cat conftest.$ac_ext >&5
10713   rm -fr conftest*
10714   ac_cv_c_stack_direction=-1
10715 fi
10716 rm -fr conftest*
10717
10718 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
10719 { test "$extra_verbose" = "yes" && cat << EOF
10720     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
10721 EOF
10722 cat >> confdefs.h <<EOF
10723 #define STACK_DIRECTION $ac_cv_c_stack_direction
10724 EOF
10725 }
10726
10727 fi
10728
10729 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
10730    echo "    xemacs will be linked with \"$ALLOCA\""
10731  fi
10732
10733 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
10734 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
10735 echo "configure:10736: checking for vfork.h" >&5
10736
10737 cat > conftest.$ac_ext <<EOF
10738 #line 10739 "configure"
10739 #include "confdefs.h"
10740 #include <vfork.h>
10741 EOF
10742 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10743 { (eval echo configure:10744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10744 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10745 if test -z "$ac_err"; then
10746   rm -rf conftest*
10747   eval "ac_cv_header_$ac_safe=yes"
10748 else
10749   echo "$ac_err" >&5
10750   echo "configure: failed program was:" >&5
10751   cat conftest.$ac_ext >&5
10752   rm -rf conftest*
10753   eval "ac_cv_header_$ac_safe=no"
10754 fi
10755 rm -f conftest*
10756 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10757   echo "$ac_t""yes" 1>&6
10758   { test "$extra_verbose" = "yes" && cat << \EOF
10759     Defining HAVE_VFORK_H
10760 EOF
10761 cat >> confdefs.h <<\EOF
10762 #define HAVE_VFORK_H 1
10763 EOF
10764 }
10765
10766 else
10767   echo "$ac_t""no" 1>&6
10768 fi
10769
10770 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
10771 echo "configure:10772: checking for working vfork" >&5
10772
10773 cat > conftest.$ac_ext <<EOF
10774 #line 10775 "configure"
10775 #include "confdefs.h"
10776 /* Thanks to Paul Eggert for this test.  */
10777 #include <stdio.h>
10778 #include <sys/types.h>
10779 #include <sys/stat.h>
10780 #ifdef HAVE_UNISTD_H
10781 #include <unistd.h>
10782 #endif
10783 #ifdef HAVE_VFORK_H
10784 #include <vfork.h>
10785 #endif
10786 /* On some sparc systems, changes by the child to local and incoming
10787    argument registers are propagated back to the parent.
10788    The compiler is told about this with #include <vfork.h>,
10789    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
10790    Test for this by using a static variable whose address
10791    is put into a register that is clobbered by the vfork.  */
10792 static
10793 #ifdef __cplusplus
10794 sparc_address_test (int arg)
10795 #else
10796 sparc_address_test (arg) int arg;
10797 #endif
10798 {
10799   static pid_t child;
10800   if (!child) {
10801     child = vfork ();
10802     if (child < 0) {
10803       perror ("vfork");
10804       _exit(2);
10805     }
10806     if (!child) {
10807       arg = getpid();
10808       write(-1, "", 0);
10809       _exit (arg);
10810     }
10811   }
10812 }
10813 main() {
10814   pid_t parent = getpid ();
10815   pid_t child;
10816
10817   sparc_address_test ();
10818
10819   child = vfork ();
10820
10821   if (child == 0) {
10822     /* Here is another test for sparc vfork register problems.
10823        This test uses lots of local variables, at least
10824        as many local variables as main has allocated so far
10825        including compiler temporaries.  4 locals are enough for
10826        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
10827        A buggy compiler should reuse the register of parent
10828        for one of the local variables, since it will think that
10829        parent can't possibly be used any more in this routine.
10830        Assigning to the local variable will thus munge parent
10831        in the parent process.  */
10832     pid_t
10833       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
10834       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
10835     /* Convince the compiler that p..p7 are live; otherwise, it might
10836        use the same hardware register for all 8 local variables.  */
10837     if (p != p1 || p != p2 || p != p3 || p != p4
10838         || p != p5 || p != p6 || p != p7)
10839       _exit(1);
10840
10841     /* On some systems (e.g. IRIX 3.3),
10842        vfork doesn't separate parent from child file descriptors.
10843        If the child closes a descriptor before it execs or exits,
10844        this munges the parent's descriptor as well.
10845        Test for this by closing stdout in the child.  */
10846     _exit(close(fileno(stdout)) != 0);
10847   } else {
10848     int status;
10849     struct stat st;
10850
10851     while (wait(&status) != child)
10852       ;
10853     exit(
10854          /* Was there some problem with vforking?  */
10855          child < 0
10856
10857          /* Did the child fail?  (This shouldn't happen.)  */
10858          || status
10859
10860          /* Did the vfork/compiler bug occur?  */
10861          || parent != getpid()
10862
10863          /* Did the file descriptor bug occur?  */
10864          || fstat(fileno(stdout), &st) != 0
10865          );
10866   }
10867 }
10868 EOF
10869 if { (eval echo configure:10870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10870 then
10871   ac_cv_func_vfork_works=yes
10872 else
10873   conftest_rc="$?"
10874   echo "configure: failed program was:" >&5
10875   cat conftest.$ac_ext >&5
10876   rm -fr conftest*
10877   ac_cv_func_vfork_works=no
10878 fi
10879 rm -fr conftest*
10880
10881 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
10882 if test $ac_cv_func_vfork_works = no; then
10883   { test "$extra_verbose" = "yes" && cat << \EOF
10884     Defining vfork = fork
10885 EOF
10886 cat >> confdefs.h <<\EOF
10887 #define vfork fork
10888 EOF
10889 }
10890
10891 fi
10892
10893
10894 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
10895 echo "configure:10896: checking for working strcoll" >&5
10896
10897 cat > conftest.$ac_ext <<EOF
10898 #line 10899 "configure"
10899 #include "confdefs.h"
10900 #include <string.h>
10901 main ()
10902 {
10903   exit (strcoll ("abc", "def") >= 0 ||
10904         strcoll ("ABC", "DEF") >= 0 ||
10905         strcoll ("123", "456") >= 0);
10906 }
10907 EOF
10908 if { (eval echo configure:10909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10909 then
10910   ac_cv_func_strcoll_works=yes
10911 else
10912   conftest_rc="$?"
10913   echo "configure: failed program was:" >&5
10914   cat conftest.$ac_ext >&5
10915   rm -fr conftest*
10916   ac_cv_func_strcoll_works=no
10917 fi
10918 rm -fr conftest*
10919
10920 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
10921 if test $ac_cv_func_strcoll_works = yes; then
10922   { test "$extra_verbose" = "yes" && cat << \EOF
10923     Defining HAVE_STRCOLL
10924 EOF
10925 cat >> confdefs.h <<\EOF
10926 #define HAVE_STRCOLL 1
10927 EOF
10928 }
10929
10930 fi
10931
10932
10933 for ac_func in getpgrp
10934 do
10935 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10936 echo "configure:10937: checking for $ac_func" >&5
10937
10938 cat > conftest.$ac_ext <<EOF
10939 #line 10940 "configure"
10940 #include "confdefs.h"
10941 /* System header to define __stub macros and hopefully few prototypes,
10942     which can conflict with char $ac_func(); below.  */
10943 #include <assert.h>
10944 /* Override any gcc2 internal prototype to avoid an error.  */
10945 /* We use char because int might match the return type of a gcc2
10946     builtin and then its argument prototype would still apply.  */
10947 char $ac_func();
10948
10949 int main() {
10950
10951 /* The GNU C library defines this for functions which it implements
10952     to always fail with ENOSYS.  Some functions are actually named
10953     something starting with __ and the normal name is an alias.  */
10954 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10955 choke me
10956 #else
10957 $ac_func();
10958 #endif
10959
10960 ; return 0; }
10961 EOF
10962 if { (eval echo configure:10963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10963   rm -rf conftest*
10964   eval "ac_cv_func_$ac_func=yes"
10965 else
10966   echo "configure: failed program was:" >&5
10967   cat conftest.$ac_ext >&5
10968   rm -rf conftest*
10969   eval "ac_cv_func_$ac_func=no"
10970 fi
10971 rm -f conftest*
10972
10973 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10974   echo "$ac_t""yes" 1>&6
10975     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10976   { test "$extra_verbose" = "yes" && cat << EOF
10977     Defining $ac_tr_func
10978 EOF
10979 cat >> confdefs.h <<EOF
10980 #define $ac_tr_func 1
10981 EOF
10982 }
10983  
10984 else
10985   echo "$ac_t""no" 1>&6
10986 fi
10987 done
10988
10989 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
10990 echo "configure:10991: checking whether getpgrp takes no argument" >&5
10991
10992 cat > conftest.$ac_ext <<EOF
10993 #line 10994 "configure"
10994 #include "confdefs.h"
10995
10996 /*
10997  * If this system has a BSD-style getpgrp(),
10998  * which takes a pid argument, exit unsuccessfully.
10999  *
11000  * Snarfed from Chet Ramey's bash pgrp.c test program
11001  */
11002 #include <stdio.h>
11003 #include <sys/types.h>
11004
11005 int     pid;
11006 int     pg1, pg2, pg3, pg4;
11007 int     ng, np, s, child;
11008
11009 main()
11010 {
11011         pid = getpid();
11012         pg1 = getpgrp(0);
11013         pg2 = getpgrp();
11014         pg3 = getpgrp(pid);
11015         pg4 = getpgrp(1);
11016
11017         /*
11018          * If all of these values are the same, it's pretty sure that
11019          * we're on a system that ignores getpgrp's first argument.
11020          */
11021         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
11022                 exit(0);
11023
11024         child = fork();
11025         if (child < 0)
11026                 exit(1);
11027         else if (child == 0) {
11028                 np = getpid();
11029                 /*
11030                  * If this is Sys V, this will not work; pgrp will be
11031                  * set to np because setpgrp just changes a pgrp to be
11032                  * the same as the pid.
11033                  */
11034                 setpgrp(np, pg1);
11035                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
11036                 if (ng == pg1) {
11037                         exit(1);
11038                 } else {
11039                         exit(0);
11040                 }
11041         } else {
11042                 wait(&s);
11043                 exit(s>>8);
11044         }
11045 }
11046
11047 EOF
11048 if { (eval echo configure:11049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11049 then
11050   ac_cv_func_getpgrp_void=yes
11051 else
11052   conftest_rc="$?"
11053   echo "configure: failed program was:" >&5
11054   cat conftest.$ac_ext >&5
11055   rm -fr conftest*
11056   ac_cv_func_getpgrp_void=no
11057 fi
11058 rm -fr conftest*
11059
11060
11061 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
11062 if test $ac_cv_func_getpgrp_void = yes; then
11063   { test "$extra_verbose" = "yes" && cat << \EOF
11064     Defining GETPGRP_VOID
11065 EOF
11066 cat >> confdefs.h <<\EOF
11067 #define GETPGRP_VOID 1
11068 EOF
11069 }
11070
11071 fi
11072
11073
11074 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
11075 echo "configure:11076: checking for working mmap" >&5
11076 case "$opsys" in ultrix* ) have_mmap=no ;; *)
11077 cat > conftest.$ac_ext <<EOF
11078 #line 11079 "configure"
11079 #include "confdefs.h"
11080 #include <stdio.h>
11081 #include <unistd.h>
11082 #include <fcntl.h>
11083 #include <sys/mman.h>
11084
11085 #ifndef MAP_VARIABLE
11086 #define MAP_VARIABLE 0
11087 #endif
11088
11089 #ifndef MAP_FAILED
11090 #define MAP_FAILED -1
11091 #endif
11092
11093 int main (int argc, char *argv[])
11094 {
11095   int fd = -1;
11096   caddr_t p;
11097 #ifndef MAP_ANONYMOUS
11098   fd = open ("/dev/zero", O_RDWR);
11099   if (fd < 0)
11100     return 1;
11101 #define MAP_ANONYMOUS 0
11102 #endif
11103   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
11104            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
11105            fd, 0) != (void *) MAP_FAILED)
11106     return 0;
11107   perror ("conftest: mmap failed");
11108   return 1;
11109 }
11110 EOF
11111 if { (eval echo configure:11112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11112 then
11113   have_mmap=yes
11114 else
11115   conftest_rc="$?"
11116   echo "configure: failed program was:" >&5
11117   cat conftest.$ac_ext >&5
11118   rm -fr conftest*
11119   have_mmap=no
11120 fi
11121 rm -fr conftest* ;;
11122 esac
11123 echo "$ac_t""$have_mmap" 1>&6
11124 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
11125     Defining HAVE_MMAP
11126 EOF
11127 cat >> confdefs.h <<\EOF
11128 #define HAVE_MMAP 1
11129 EOF
11130 }
11131
11132
11133 test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no
11134 if test "$rel_alloc $have_mmap" = "default yes"; then
11135   if test "$doug_lea_malloc" = "yes"; then
11136         echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6
11137 echo "configure:11138: checking for M_MMAP_THRESHOLD" >&5
11138     cat > conftest.$ac_ext <<EOF
11139 #line 11140 "configure"
11140 #include "confdefs.h"
11141 #include <malloc.h>
11142 int main() {
11143
11144 #ifndef M_MMAP_THRESHOLD
11145 #error No M_MMAP_THRESHOLD :-(
11146 !@+$%^&*_)(_ - unlikely to compile...
11147 #endif
11148
11149 ; return 0; }
11150 EOF
11151 if { (eval echo configure:11152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11152   rm -rf conftest*
11153   rel_alloc=no; echo "$ac_t""yes" 1>&6;
11154 else
11155   echo "configure: failed program was:" >&5
11156   cat conftest.$ac_ext >&5
11157   rm -rf conftest*
11158   rel_alloc=yes; echo "$ac_t""no" 1>&6;
11159 fi
11160 rm -f conftest*
11161   else
11162     rel_alloc=yes
11163   fi
11164 fi
11165 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
11166     Defining REL_ALLOC
11167 EOF
11168 cat >> confdefs.h <<\EOF
11169 #define REL_ALLOC 1
11170 EOF
11171 }
11172
11173
11174 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
11175 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
11176 echo "configure:11177: checking for termios.h" >&5
11177
11178 cat > conftest.$ac_ext <<EOF
11179 #line 11180 "configure"
11180 #include "confdefs.h"
11181 #include <termios.h>
11182 EOF
11183 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11184 { (eval echo configure:11185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11185 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11186 if test -z "$ac_err"; then
11187   rm -rf conftest*
11188   eval "ac_cv_header_$ac_safe=yes"
11189 else
11190   echo "$ac_err" >&5
11191   echo "configure: failed program was:" >&5
11192   cat conftest.$ac_ext >&5
11193   rm -rf conftest*
11194   eval "ac_cv_header_$ac_safe=no"
11195 fi
11196 rm -f conftest*
11197 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11198   echo "$ac_t""yes" 1>&6
11199   { test "$extra_verbose" = "yes" && cat << \EOF
11200     Defining HAVE_TERMIOS
11201 EOF
11202 cat >> confdefs.h <<\EOF
11203 #define HAVE_TERMIOS 1
11204 EOF
11205 }
11206
11207   { test "$extra_verbose" = "yes" && cat << \EOF
11208     Defining SIGNALS_VIA_CHARACTERS
11209 EOF
11210 cat >> confdefs.h <<\EOF
11211 #define SIGNALS_VIA_CHARACTERS 1
11212 EOF
11213 }
11214
11215   { test "$extra_verbose" = "yes" && cat << \EOF
11216     Defining NO_TERMIO
11217 EOF
11218 cat >> confdefs.h <<\EOF
11219 #define NO_TERMIO 1
11220 EOF
11221 }
11222
11223 else
11224   echo "$ac_t""no" 1>&6
11225 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
11226 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
11227 echo "configure:11228: checking for termio.h" >&5
11228
11229 cat > conftest.$ac_ext <<EOF
11230 #line 11231 "configure"
11231 #include "confdefs.h"
11232 #include <termio.h>
11233 EOF
11234 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11235 { (eval echo configure:11236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11236 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11237 if test -z "$ac_err"; then
11238   rm -rf conftest*
11239   eval "ac_cv_header_$ac_safe=yes"
11240 else
11241   echo "$ac_err" >&5
11242   echo "configure: failed program was:" >&5
11243   cat conftest.$ac_ext >&5
11244   rm -rf conftest*
11245   eval "ac_cv_header_$ac_safe=no"
11246 fi
11247 rm -f conftest*
11248 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11249   echo "$ac_t""yes" 1>&6
11250   { test "$extra_verbose" = "yes" && cat << \EOF
11251     Defining HAVE_TERMIO
11252 EOF
11253 cat >> confdefs.h <<\EOF
11254 #define HAVE_TERMIO 1
11255 EOF
11256 }
11257
11258 else
11259   echo "$ac_t""no" 1>&6
11260 fi
11261
11262 fi
11263
11264
11265
11266 echo $ac_n "checking for socket""... $ac_c" 1>&6
11267 echo "configure:11268: checking for socket" >&5
11268
11269 cat > conftest.$ac_ext <<EOF
11270 #line 11271 "configure"
11271 #include "confdefs.h"
11272 /* System header to define __stub macros and hopefully few prototypes,
11273     which can conflict with char socket(); below.  */
11274 #include <assert.h>
11275 /* Override any gcc2 internal prototype to avoid an error.  */
11276 /* We use char because int might match the return type of a gcc2
11277     builtin and then its argument prototype would still apply.  */
11278 char socket();
11279
11280 int main() {
11281
11282 /* The GNU C library defines this for functions which it implements
11283     to always fail with ENOSYS.  Some functions are actually named
11284     something starting with __ and the normal name is an alias.  */
11285 #if defined (__stub_socket) || defined (__stub___socket)
11286 choke me
11287 #else
11288 socket();
11289 #endif
11290
11291 ; return 0; }
11292 EOF
11293 if { (eval echo configure:11294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11294   rm -rf conftest*
11295   eval "ac_cv_func_socket=yes"
11296 else
11297   echo "configure: failed program was:" >&5
11298   cat conftest.$ac_ext >&5
11299   rm -rf conftest*
11300   eval "ac_cv_func_socket=no"
11301 fi
11302 rm -f conftest*
11303
11304 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
11305   echo "$ac_t""yes" 1>&6
11306   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
11307 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
11308 echo "configure:11309: checking for netinet/in.h" >&5
11309
11310 cat > conftest.$ac_ext <<EOF
11311 #line 11312 "configure"
11312 #include "confdefs.h"
11313 #include <netinet/in.h>
11314 EOF
11315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11316 { (eval echo configure:11317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11317 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11318 if test -z "$ac_err"; then
11319   rm -rf conftest*
11320   eval "ac_cv_header_$ac_safe=yes"
11321 else
11322   echo "$ac_err" >&5
11323   echo "configure: failed program was:" >&5
11324   cat conftest.$ac_ext >&5
11325   rm -rf conftest*
11326   eval "ac_cv_header_$ac_safe=no"
11327 fi
11328 rm -f conftest*
11329 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11330   echo "$ac_t""yes" 1>&6
11331   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
11332 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
11333 echo "configure:11334: checking for arpa/inet.h" >&5
11334
11335 cat > conftest.$ac_ext <<EOF
11336 #line 11337 "configure"
11337 #include "confdefs.h"
11338 #include <arpa/inet.h>
11339 EOF
11340 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11341 { (eval echo configure:11342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11342 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11343 if test -z "$ac_err"; then
11344   rm -rf conftest*
11345   eval "ac_cv_header_$ac_safe=yes"
11346 else
11347   echo "$ac_err" >&5
11348   echo "configure: failed program was:" >&5
11349   cat conftest.$ac_ext >&5
11350   rm -rf conftest*
11351   eval "ac_cv_header_$ac_safe=no"
11352 fi
11353 rm -f conftest*
11354 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11355   echo "$ac_t""yes" 1>&6
11356   
11357   { test "$extra_verbose" = "yes" && cat << \EOF
11358     Defining HAVE_SOCKETS
11359 EOF
11360 cat >> confdefs.h <<\EOF
11361 #define HAVE_SOCKETS 1
11362 EOF
11363 }
11364
11365       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
11366 echo "configure:11367: checking "for sun_len member in struct sockaddr_un"" >&5
11367       cat > conftest.$ac_ext <<EOF
11368 #line 11369 "configure"
11369 #include "confdefs.h"
11370
11371 #include <sys/types.h>
11372 #include <sys/socket.h>
11373 #include <sys/un.h>
11374       
11375 int main() {
11376 static struct sockaddr_un x; x.sun_len = 1;
11377 ; return 0; }
11378 EOF
11379 if { (eval echo configure:11380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11380   rm -rf conftest*
11381   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
11382     Defining HAVE_SOCKADDR_SUN_LEN
11383 EOF
11384 cat >> confdefs.h <<\EOF
11385 #define HAVE_SOCKADDR_SUN_LEN 1
11386 EOF
11387 }
11388
11389 else
11390   echo "configure: failed program was:" >&5
11391   cat conftest.$ac_ext >&5
11392   rm -rf conftest*
11393   echo "$ac_t""no" 1>&6
11394 fi
11395 rm -f conftest*
11396       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
11397 echo "configure:11398: checking "for ip_mreq struct in netinet/in.h"" >&5
11398       cat > conftest.$ac_ext <<EOF
11399 #line 11400 "configure"
11400 #include "confdefs.h"
11401
11402 #include <sys/types.h>
11403 #include <netinet/in.h>
11404       
11405 int main() {
11406 static struct ip_mreq x;
11407 ; return 0; }
11408 EOF
11409 if { (eval echo configure:11410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11410   rm -rf conftest*
11411   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
11412     Defining HAVE_MULTICAST
11413 EOF
11414 cat >> confdefs.h <<\EOF
11415 #define HAVE_MULTICAST 1
11416 EOF
11417 }
11418
11419 else
11420   echo "configure: failed program was:" >&5
11421   cat conftest.$ac_ext >&5
11422   rm -rf conftest*
11423   echo "$ac_t""no" 1>&6
11424 fi
11425 rm -f conftest*
11426 else
11427   echo "$ac_t""no" 1>&6
11428 fi
11429
11430 else
11431   echo "$ac_t""no" 1>&6
11432 fi
11433
11434 else
11435   echo "$ac_t""no" 1>&6
11436 fi
11437
11438
11439 echo $ac_n "checking for msgget""... $ac_c" 1>&6
11440 echo "configure:11441: checking for msgget" >&5
11441
11442 cat > conftest.$ac_ext <<EOF
11443 #line 11444 "configure"
11444 #include "confdefs.h"
11445 /* System header to define __stub macros and hopefully few prototypes,
11446     which can conflict with char msgget(); below.  */
11447 #include <assert.h>
11448 /* Override any gcc2 internal prototype to avoid an error.  */
11449 /* We use char because int might match the return type of a gcc2
11450     builtin and then its argument prototype would still apply.  */
11451 char msgget();
11452
11453 int main() {
11454
11455 /* The GNU C library defines this for functions which it implements
11456     to always fail with ENOSYS.  Some functions are actually named
11457     something starting with __ and the normal name is an alias.  */
11458 #if defined (__stub_msgget) || defined (__stub___msgget)
11459 choke me
11460 #else
11461 msgget();
11462 #endif
11463
11464 ; return 0; }
11465 EOF
11466 if { (eval echo configure:11467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11467   rm -rf conftest*
11468   eval "ac_cv_func_msgget=yes"
11469 else
11470   echo "configure: failed program was:" >&5
11471   cat conftest.$ac_ext >&5
11472   rm -rf conftest*
11473   eval "ac_cv_func_msgget=no"
11474 fi
11475 rm -f conftest*
11476
11477 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
11478   echo "$ac_t""yes" 1>&6
11479   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
11480 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
11481 echo "configure:11482: checking for sys/ipc.h" >&5
11482
11483 cat > conftest.$ac_ext <<EOF
11484 #line 11485 "configure"
11485 #include "confdefs.h"
11486 #include <sys/ipc.h>
11487 EOF
11488 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11489 { (eval echo configure:11490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11490 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11491 if test -z "$ac_err"; then
11492   rm -rf conftest*
11493   eval "ac_cv_header_$ac_safe=yes"
11494 else
11495   echo "$ac_err" >&5
11496   echo "configure: failed program was:" >&5
11497   cat conftest.$ac_ext >&5
11498   rm -rf conftest*
11499   eval "ac_cv_header_$ac_safe=no"
11500 fi
11501 rm -f conftest*
11502 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11503   echo "$ac_t""yes" 1>&6
11504   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
11505 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
11506 echo "configure:11507: checking for sys/msg.h" >&5
11507
11508 cat > conftest.$ac_ext <<EOF
11509 #line 11510 "configure"
11510 #include "confdefs.h"
11511 #include <sys/msg.h>
11512 EOF
11513 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11514 { (eval echo configure:11515: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11515 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11516 if test -z "$ac_err"; then
11517   rm -rf conftest*
11518   eval "ac_cv_header_$ac_safe=yes"
11519 else
11520   echo "$ac_err" >&5
11521   echo "configure: failed program was:" >&5
11522   cat conftest.$ac_ext >&5
11523   rm -rf conftest*
11524   eval "ac_cv_header_$ac_safe=no"
11525 fi
11526 rm -f conftest*
11527 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11528   echo "$ac_t""yes" 1>&6
11529   { test "$extra_verbose" = "yes" && cat << \EOF
11530     Defining HAVE_SYSVIPC
11531 EOF
11532 cat >> confdefs.h <<\EOF
11533 #define HAVE_SYSVIPC 1
11534 EOF
11535 }
11536
11537 else
11538   echo "$ac_t""no" 1>&6
11539 fi
11540
11541 else
11542   echo "$ac_t""no" 1>&6
11543 fi
11544
11545 else
11546   echo "$ac_t""no" 1>&6
11547 fi
11548
11549
11550 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
11551 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
11552 echo "configure:11553: checking for dirent.h" >&5
11553
11554 cat > conftest.$ac_ext <<EOF
11555 #line 11556 "configure"
11556 #include "confdefs.h"
11557 #include <dirent.h>
11558 EOF
11559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11560 { (eval echo configure:11561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11562 if test -z "$ac_err"; then
11563   rm -rf conftest*
11564   eval "ac_cv_header_$ac_safe=yes"
11565 else
11566   echo "$ac_err" >&5
11567   echo "configure: failed program was:" >&5
11568   cat conftest.$ac_ext >&5
11569   rm -rf conftest*
11570   eval "ac_cv_header_$ac_safe=no"
11571 fi
11572 rm -f conftest*
11573 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11574   echo "$ac_t""yes" 1>&6
11575   { test "$extra_verbose" = "yes" && cat << \EOF
11576     Defining SYSV_SYSTEM_DIR
11577 EOF
11578 cat >> confdefs.h <<\EOF
11579 #define SYSV_SYSTEM_DIR 1
11580 EOF
11581 }
11582
11583 else
11584   echo "$ac_t""no" 1>&6
11585 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
11586 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
11587 echo "configure:11588: checking for sys/dir.h" >&5
11588
11589 cat > conftest.$ac_ext <<EOF
11590 #line 11591 "configure"
11591 #include "confdefs.h"
11592 #include <sys/dir.h>
11593 EOF
11594 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11595 { (eval echo configure:11596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11596 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11597 if test -z "$ac_err"; then
11598   rm -rf conftest*
11599   eval "ac_cv_header_$ac_safe=yes"
11600 else
11601   echo "$ac_err" >&5
11602   echo "configure: failed program was:" >&5
11603   cat conftest.$ac_ext >&5
11604   rm -rf conftest*
11605   eval "ac_cv_header_$ac_safe=no"
11606 fi
11607 rm -f conftest*
11608 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11609   echo "$ac_t""yes" 1>&6
11610   :
11611 else
11612   echo "$ac_t""no" 1>&6
11613 { test "$extra_verbose" = "yes" && cat << \EOF
11614     Defining NONSYSTEM_DIR_LIBRARY
11615 EOF
11616 cat >> confdefs.h <<\EOF
11617 #define NONSYSTEM_DIR_LIBRARY 1
11618 EOF
11619 }
11620
11621 fi
11622
11623 fi
11624
11625
11626 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
11627 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
11628 echo "configure:11629: checking for nlist.h" >&5
11629
11630 cat > conftest.$ac_ext <<EOF
11631 #line 11632 "configure"
11632 #include "confdefs.h"
11633 #include <nlist.h>
11634 EOF
11635 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11636 { (eval echo configure:11637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11637 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11638 if test -z "$ac_err"; then
11639   rm -rf conftest*
11640   eval "ac_cv_header_$ac_safe=yes"
11641 else
11642   echo "$ac_err" >&5
11643   echo "configure: failed program was:" >&5
11644   cat conftest.$ac_ext >&5
11645   rm -rf conftest*
11646   eval "ac_cv_header_$ac_safe=no"
11647 fi
11648 rm -f conftest*
11649 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11650   echo "$ac_t""yes" 1>&6
11651   { test "$extra_verbose" = "yes" && cat << \EOF
11652     Defining NLIST_STRUCT
11653 EOF
11654 cat >> confdefs.h <<\EOF
11655 #define NLIST_STRUCT 1
11656 EOF
11657 }
11658
11659 else
11660   echo "$ac_t""no" 1>&6
11661 fi
11662
11663
11664
11665 echo "checking "for sound support"" 1>&6
11666 echo "configure:11667: checking "for sound support"" >&5
11667 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
11668
11669 if test "$with_native_sound" != "no"; then
11670     if test -n "$native_sound_lib"; then
11671     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
11672 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
11673 echo "configure:11674: checking for multimedia/audio_device.h" >&5
11674
11675 cat > conftest.$ac_ext <<EOF
11676 #line 11677 "configure"
11677 #include "confdefs.h"
11678 #include <multimedia/audio_device.h>
11679 EOF
11680 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11681 { (eval echo configure:11682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11682 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11683 if test -z "$ac_err"; then
11684   rm -rf conftest*
11685   eval "ac_cv_header_$ac_safe=yes"
11686 else
11687   echo "$ac_err" >&5
11688   echo "configure: failed program was:" >&5
11689   cat conftest.$ac_ext >&5
11690   rm -rf conftest*
11691   eval "ac_cv_header_$ac_safe=no"
11692 fi
11693 rm -f conftest*
11694 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11695   echo "$ac_t""yes" 1>&6
11696   sound_found=yes sound_cflags=""
11697       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
11698    echo "    xemacs will be linked with \"sunplay.o\""
11699  fi
11700 else
11701   echo "$ac_t""no" 1>&6
11702 fi
11703
11704   fi
11705
11706     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
11707     sound_found=yes
11708     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
11709    echo "    xemacs will be linked with \"sunplay.o\""
11710  fi
11711     if test -d "/usr/demo/SOUND/include"
11712       then sound_cflags="-I/usr/demo/SOUND/include"
11713       else sound_cflags="-I/usr/demo/SOUND"
11714     fi
11715     if test -z "$native_sound_lib" ; then
11716       if test -r "/usr/demo/SOUND/lib/libaudio.a"
11717         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
11718         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
11719       fi
11720     fi
11721   fi
11722
11723     if test -z "$sound_found"; then
11724     case "$canonical" in
11725     *-sgi-* )
11726       if test -z "$native_sound_lib"; then
11727         
11728 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
11729 echo "configure:11730: checking for ALopenport in -laudio" >&5
11730 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
11731
11732 xe_check_libs=" -laudio "
11733 cat > conftest.$ac_ext <<EOF
11734 #line 11735 "configure"
11735 #include "confdefs.h"
11736 /* Override any gcc2 internal prototype to avoid an error.  */
11737 /* We use char because int might match the return type of a gcc2
11738     builtin and then its argument prototype would still apply.  */
11739 char ALopenport();
11740
11741 int main() {
11742 ALopenport()
11743 ; return 0; }
11744 EOF
11745 if { (eval echo configure:11746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11746   rm -rf conftest*
11747   eval "ac_cv_lib_$ac_lib_var=yes"
11748 else
11749   echo "configure: failed program was:" >&5
11750   cat conftest.$ac_ext >&5
11751   rm -rf conftest*
11752   eval "ac_cv_lib_$ac_lib_var=no"
11753 fi
11754 rm -f conftest*
11755 xe_check_libs=""
11756
11757 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11758   echo "$ac_t""yes" 1>&6
11759   native_sound_lib="-laudio"
11760 else
11761   echo "$ac_t""no" 1>&6
11762 fi
11763
11764
11765       fi
11766       if test -n "$native_sound_lib"; then
11767         sound_found=yes sound_cflags=""
11768         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
11769    echo "    xemacs will be linked with \"sgiplay.o\""
11770  fi
11771       fi ;;
11772     hppa*-hp-hpux* )
11773       if test -z "$native_sound_lib"; then
11774         
11775 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
11776 echo "configure:11777: checking for AOpenAudio in -lAlib" >&5
11777 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
11778
11779 xe_check_libs=" -lAlib "
11780 cat > conftest.$ac_ext <<EOF
11781 #line 11782 "configure"
11782 #include "confdefs.h"
11783 /* Override any gcc2 internal prototype to avoid an error.  */
11784 /* We use char because int might match the return type of a gcc2
11785     builtin and then its argument prototype would still apply.  */
11786 char AOpenAudio();
11787
11788 int main() {
11789 AOpenAudio()
11790 ; return 0; }
11791 EOF
11792 if { (eval echo configure:11793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11793   rm -rf conftest*
11794   eval "ac_cv_lib_$ac_lib_var=yes"
11795 else
11796   echo "configure: failed program was:" >&5
11797   cat conftest.$ac_ext >&5
11798   rm -rf conftest*
11799   eval "ac_cv_lib_$ac_lib_var=no"
11800 fi
11801 rm -f conftest*
11802 xe_check_libs=""
11803
11804 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11805   echo "$ac_t""yes" 1>&6
11806   native_sound_lib="-lAlib"
11807 else
11808   echo "$ac_t""no" 1>&6
11809 fi
11810
11811
11812       fi
11813       if test -n "$native_sound_lib"; then
11814         sound_found=yes
11815         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
11816    echo "    xemacs will be linked with \"hpplay.o\""
11817  fi
11818         if test "$GCC" = "yes" # Kludge city
11819           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
11820           else sound_cflags="+e -I/usr/audio/examples"
11821         fi
11822       fi ;;
11823     esac
11824   fi
11825
11826     if test -z "$sound_found"; then
11827     for dir in "machine" "sys" "linux"; do
11828       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
11829 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
11830 echo "configure:11831: checking for ${dir}/soundcard.h" >&5
11831
11832 cat > conftest.$ac_ext <<EOF
11833 #line 11834 "configure"
11834 #include "confdefs.h"
11835 #include <${dir}/soundcard.h>
11836 EOF
11837 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11838 { (eval echo configure:11839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11839 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11840 if test -z "$ac_err"; then
11841   rm -rf conftest*
11842   eval "ac_cv_header_$ac_safe=yes"
11843 else
11844   echo "$ac_err" >&5
11845   echo "configure: failed program was:" >&5
11846   cat conftest.$ac_ext >&5
11847   rm -rf conftest*
11848   eval "ac_cv_header_$ac_safe=no"
11849 fi
11850 rm -f conftest*
11851 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11852   echo "$ac_t""yes" 1>&6
11853   sound_found=yes
11854        need_miscplay=yes
11855         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
11856    echo "    xemacs will be linked with \"linuxplay.o\""
11857  fi
11858         { test "$extra_verbose" = "yes" && cat << EOF
11859     Defining SOUNDCARD_H_FILE = "${dir}/soundcard.h"
11860 EOF
11861 cat >> confdefs.h <<EOF
11862 #define SOUNDCARD_H_FILE "${dir}/soundcard.h"
11863 EOF
11864 }
11865
11866         break
11867 else
11868   echo "$ac_t""no" 1>&6
11869 fi
11870
11871     done
11872   fi
11873
11874   test "$sound_found" = "yes" && with_native_sound=yes
11875 fi
11876
11877 if test "$with_native_sound" = "yes"; then
11878   { test "$extra_verbose" = "yes" && cat << \EOF
11879     Defining HAVE_NATIVE_SOUND
11880 EOF
11881 cat >> confdefs.h <<\EOF
11882 #define HAVE_NATIVE_SOUND 1
11883 EOF
11884 }
11885
11886   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
11887 fi
11888
11889 if test "$with_nas_sound" != "no"; then
11890   ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'`
11891 echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6
11892 echo "configure:11893: checking for audio/audiolib.h" >&5
11893
11894 cat > conftest.$ac_ext <<EOF
11895 #line 11896 "configure"
11896 #include "confdefs.h"
11897 #include <audio/audiolib.h>
11898 EOF
11899 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11900 { (eval echo configure:11901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11901 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11902 if test -z "$ac_err"; then
11903   rm -rf conftest*
11904   eval "ac_cv_header_$ac_safe=yes"
11905 else
11906   echo "$ac_err" >&5
11907   echo "configure: failed program was:" >&5
11908   cat conftest.$ac_ext >&5
11909   rm -rf conftest*
11910   eval "ac_cv_header_$ac_safe=no"
11911 fi
11912 rm -f conftest*
11913 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11914   echo "$ac_t""yes" 1>&6
11915   
11916     
11917 echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6
11918 echo "configure:11919: checking for AuOpenServer in -laudio" >&5
11919 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'`
11920
11921 xe_check_libs=" -laudio "
11922 cat > conftest.$ac_ext <<EOF
11923 #line 11924 "configure"
11924 #include "confdefs.h"
11925 /* Override any gcc2 internal prototype to avoid an error.  */
11926 /* We use char because int might match the return type of a gcc2
11927     builtin and then its argument prototype would still apply.  */
11928 char AuOpenServer();
11929
11930 int main() {
11931 AuOpenServer()
11932 ; return 0; }
11933 EOF
11934 if { (eval echo configure:11935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11935   rm -rf conftest*
11936   eval "ac_cv_lib_$ac_lib_var=yes"
11937 else
11938   echo "configure: failed program was:" >&5
11939   cat conftest.$ac_ext >&5
11940   rm -rf conftest*
11941   eval "ac_cv_lib_$ac_lib_var=no"
11942 fi
11943 rm -f conftest*
11944 xe_check_libs=""
11945
11946 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11947   echo "$ac_t""yes" 1>&6
11948   have_nas_sound=yes
11949 else
11950   echo "$ac_t""no" 1>&6
11951 fi
11952
11953
11954 else
11955   echo "$ac_t""no" 1>&6
11956 fi
11957
11958   if test "$have_nas_sound" = "yes"; then
11959     with_nas_sound=yes
11960     { test "$extra_verbose" = "yes" && cat << \EOF
11961     Defining HAVE_NAS_SOUND
11962 EOF
11963 cat >> confdefs.h <<\EOF
11964 #define HAVE_NAS_SOUND 1
11965 EOF
11966 }
11967
11968     extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
11969    echo "    xemacs will be linked with \"nas.o\""
11970  fi
11971     libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
11972             cat > conftest.$ac_ext <<EOF
11973 #line 11974 "configure"
11974 #include "confdefs.h"
11975 #include <audio/Xtutil.h>
11976 EOF
11977 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11978   egrep "AuXtErrorJump" >/dev/null 2>&1; then
11979   :
11980 else
11981   rm -rf conftest*
11982   old_nas=yes; { test "$extra_verbose" = "yes" && cat << \EOF
11983     Defining NAS_NO_ERROR_JUMP
11984 EOF
11985 cat >> confdefs.h <<\EOF
11986 #define NAS_NO_ERROR_JUMP 1
11987 EOF
11988 }
11989
11990 fi
11991 rm -f conftest*
11992
11993   else
11994     test "$with_nas_sound" = "yes" && \
11995       { echo "Error:" "Required NAS sound support cannot be provided." >&2; exit 1; }
11996     with_nas_sound=no
11997   fi
11998 fi
11999
12000 if test "$with_esd_sound" != "no"; then
12001   # Extract the first word of "esd-config", so it can be a program name with args.
12002 set dummy esd-config; ac_word=$2
12003 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
12004 echo "configure:12005: checking for $ac_word" >&5
12005
12006 if test -n "$have_esd_config"; then
12007   ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test.
12008 else
12009   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
12010   ac_dummy="$PATH"
12011   for ac_dir in $ac_dummy; do
12012     test -z "$ac_dir" && ac_dir=.
12013     if test -f $ac_dir/$ac_word; then
12014       ac_cv_prog_have_esd_config="yes"
12015       break
12016     fi
12017   done
12018   IFS="$ac_save_ifs"
12019   test -z "$ac_cv_prog_have_esd_config" && ac_cv_prog_have_esd_config="no"
12020 fi
12021 have_esd_config="$ac_cv_prog_have_esd_config"
12022 if test -n "$have_esd_config"; then
12023   echo "$ac_t""$have_esd_config" 1>&6
12024 else
12025   echo "$ac_t""no" 1>&6
12026 fi
12027
12028   if test "$have_esd_config" = "yes"; then
12029     save_c_switch_site="$c_switch_site" save_LIBS="$LIBS"
12030     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
12031     LIBS="`esd-config --libs` $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"`esd-config --libs`\" to \$LIBS"; fi
12032     echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6
12033 echo "configure:12034: checking for esd_play_stream" >&5
12034
12035 cat > conftest.$ac_ext <<EOF
12036 #line 12037 "configure"
12037 #include "confdefs.h"
12038 /* System header to define __stub macros and hopefully few prototypes,
12039     which can conflict with char esd_play_stream(); below.  */
12040 #include <assert.h>
12041 /* Override any gcc2 internal prototype to avoid an error.  */
12042 /* We use char because int might match the return type of a gcc2
12043     builtin and then its argument prototype would still apply.  */
12044 char esd_play_stream();
12045
12046 int main() {
12047
12048 /* The GNU C library defines this for functions which it implements
12049     to always fail with ENOSYS.  Some functions are actually named
12050     something starting with __ and the normal name is an alias.  */
12051 #if defined (__stub_esd_play_stream) || defined (__stub___esd_play_stream)
12052 choke me
12053 #else
12054 esd_play_stream();
12055 #endif
12056
12057 ; return 0; }
12058 EOF
12059 if { (eval echo configure:12060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12060   rm -rf conftest*
12061   eval "ac_cv_func_esd_play_stream=yes"
12062 else
12063   echo "configure: failed program was:" >&5
12064   cat conftest.$ac_ext >&5
12065   rm -rf conftest*
12066   eval "ac_cv_func_esd_play_stream=no"
12067 fi
12068 rm -f conftest*
12069
12070 if eval "test \"`echo '$ac_cv_func_'esd_play_stream`\" = yes"; then
12071   echo "$ac_t""yes" 1>&6
12072   have_esd_sound=yes
12073 else
12074   echo "$ac_t""no" 1>&6
12075 c_switch_site="$save_c_switch_site" LIBS="$save_LIBS"
12076 fi
12077
12078   fi
12079
12080   if test "$have_esd_sound" = "yes"; then
12081     with_esd_sound=yes
12082     need_miscplay=yes
12083     extra_objs="$extra_objs esd.o" &&  if test "$extra_verbose" = "yes"; then
12084    echo "    xemacs will be linked with \"esd.o\""
12085  fi
12086     { test "$extra_verbose" = "yes" && cat << \EOF
12087     Defining HAVE_ESD_SOUND
12088 EOF
12089 cat >> confdefs.h <<\EOF
12090 #define HAVE_ESD_SOUND 1
12091 EOF
12092 }
12093
12094   else
12095     test "$with_esd_sound" = "yes" && \
12096       { echo "Error:" "Required ESD sound support cannot be provided." >&2; exit 1; }
12097     with_esd_sound=no
12098   fi
12099 fi
12100
12101 test "$need_miscplay" = "yes" && extra_objs="$extra_objs miscplay.o" &&  if test "$extra_verbose" = "yes"; then
12102    echo "    xemacs will be linked with \"miscplay.o\""
12103  fi
12104
12105
12106 test -z "$with_tty" && with_tty=yes
12107
12108 if test "$with_tty" = "yes"  ; then
12109   echo "checking for TTY-related features" 1>&6
12110 echo "configure:12111: checking for TTY-related features" >&5
12111   { test "$extra_verbose" = "yes" && cat << \EOF
12112     Defining HAVE_TTY
12113 EOF
12114 cat >> confdefs.h <<\EOF
12115 #define HAVE_TTY 1
12116 EOF
12117 }
12118
12119   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
12120    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\""
12121  fi
12122
12123     if test -z "$with_ncurses"; then
12124     
12125 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
12126 echo "configure:12127: checking for tgetent in -lncurses" >&5
12127 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
12128
12129 xe_check_libs=" -lncurses "
12130 cat > conftest.$ac_ext <<EOF
12131 #line 12132 "configure"
12132 #include "confdefs.h"
12133 /* Override any gcc2 internal prototype to avoid an error.  */
12134 /* We use char because int might match the return type of a gcc2
12135     builtin and then its argument prototype would still apply.  */
12136 char tgetent();
12137
12138 int main() {
12139 tgetent()
12140 ; return 0; }
12141 EOF
12142 if { (eval echo configure:12143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12143   rm -rf conftest*
12144   eval "ac_cv_lib_$ac_lib_var=yes"
12145 else
12146   echo "configure: failed program was:" >&5
12147   cat conftest.$ac_ext >&5
12148   rm -rf conftest*
12149   eval "ac_cv_lib_$ac_lib_var=no"
12150 fi
12151 rm -f conftest*
12152 xe_check_libs=""
12153
12154 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12155   echo "$ac_t""yes" 1>&6
12156   with_ncurses=yes
12157 else
12158   echo "$ac_t""no" 1>&6
12159 with_ncurses=no
12160 fi
12161
12162
12163   fi
12164   if test "$with_ncurses" = "yes"; then
12165     { test "$extra_verbose" = "yes" && cat << \EOF
12166     Defining HAVE_NCURSES
12167 EOF
12168 cat >> confdefs.h <<\EOF
12169 #define HAVE_NCURSES 1
12170 EOF
12171 }
12172
12173     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
12174 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
12175 echo "configure:12176: checking for ncurses/curses.h" >&5
12176
12177 cat > conftest.$ac_ext <<EOF
12178 #line 12179 "configure"
12179 #include "confdefs.h"
12180 #include <ncurses/curses.h>
12181 EOF
12182 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12183 { (eval echo configure:12184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12184 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12185 if test -z "$ac_err"; then
12186   rm -rf conftest*
12187   eval "ac_cv_header_$ac_safe=yes"
12188 else
12189   echo "$ac_err" >&5
12190   echo "configure: failed program was:" >&5
12191   cat conftest.$ac_ext >&5
12192   rm -rf conftest*
12193   eval "ac_cv_header_$ac_safe=no"
12194 fi
12195 rm -f conftest*
12196 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12197   echo "$ac_t""yes" 1>&6
12198   curses_h_file=ncurses/curses.h
12199 else
12200   echo "$ac_t""no" 1>&6
12201 fi
12202
12203     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
12204 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
12205 echo "configure:12206: checking for ncurses/term.h" >&5
12206
12207 cat > conftest.$ac_ext <<EOF
12208 #line 12209 "configure"
12209 #include "confdefs.h"
12210 #include <ncurses/term.h>
12211 EOF
12212 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12213 { (eval echo configure:12214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12214 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12215 if test -z "$ac_err"; then
12216   rm -rf conftest*
12217   eval "ac_cv_header_$ac_safe=yes"
12218 else
12219   echo "$ac_err" >&5
12220   echo "configure: failed program was:" >&5
12221   cat conftest.$ac_ext >&5
12222   rm -rf conftest*
12223   eval "ac_cv_header_$ac_safe=no"
12224 fi
12225 rm -f conftest*
12226 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12227   echo "$ac_t""yes" 1>&6
12228   term_h_file=ncurses/term.h
12229 else
12230   echo "$ac_t""no" 1>&6
12231 fi
12232
12233     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
12234    echo "    xemacs will be linked with \"terminfo.o\""
12235  fi
12236     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
12237
12238     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
12239                         save_c_switch_site="$c_switch_site"
12240       c_switch_site="$c_switch_site -I/usr/include/ncurses"
12241       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
12242 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
12243 echo "configure:12244: checking for ncurses/curses.h" >&5
12244
12245 cat > conftest.$ac_ext <<EOF
12246 #line 12247 "configure"
12247 #include "confdefs.h"
12248 #include <ncurses/curses.h>
12249 EOF
12250 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12251 { (eval echo configure:12252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12252 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12253 if test -z "$ac_err"; then
12254   rm -rf conftest*
12255   eval "ac_cv_header_$ac_safe=yes"
12256 else
12257   echo "$ac_err" >&5
12258   echo "configure: failed program was:" >&5
12259   cat conftest.$ac_ext >&5
12260   rm -rf conftest*
12261   eval "ac_cv_header_$ac_safe=no"
12262 fi
12263 rm -f conftest*
12264 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12265   echo "$ac_t""yes" 1>&6
12266   curses_h_file=ncurses/curses.h
12267 else
12268   echo "$ac_t""no" 1>&6
12269 fi
12270
12271       if test "$ac_cv_header_ncurses_curses_h" = "yes"
12272         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
12273         else c_switch_site="$save_c_switch_site"
12274       fi
12275     fi
12276   else         if test "$have_terminfo" = "yes"; then
12277       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
12278    echo "    xemacs will be linked with \"terminfo.o\""
12279  fi
12280       if test -n "$libs_termcap"; then
12281         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
12282       else
12283         for lib in curses termlib termcap; do
12284           
12285 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
12286 echo "configure:12287: checking for tgetent in -l$lib" >&5
12287 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
12288
12289 xe_check_libs=" -l$lib "
12290 cat > conftest.$ac_ext <<EOF
12291 #line 12292 "configure"
12292 #include "confdefs.h"
12293 /* Override any gcc2 internal prototype to avoid an error.  */
12294 /* We use char because int might match the return type of a gcc2
12295     builtin and then its argument prototype would still apply.  */
12296 char tgetent();
12297
12298 int main() {
12299 tgetent()
12300 ; return 0; }
12301 EOF
12302 if { (eval echo configure:12303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12303   rm -rf conftest*
12304   eval "ac_cv_lib_$ac_lib_var=yes"
12305 else
12306   echo "configure: failed program was:" >&5
12307   cat conftest.$ac_ext >&5
12308   rm -rf conftest*
12309   eval "ac_cv_lib_$ac_lib_var=no"
12310 fi
12311 rm -f conftest*
12312 xe_check_libs=""
12313
12314 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12315   echo "$ac_t""yes" 1>&6
12316   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
12317 else
12318   echo "$ac_t""no" 1>&6
12319 fi
12320
12321
12322         done
12323       fi
12324     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
12325    echo "    xemacs will be linked with \"tparam.o\""
12326  fi
12327                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
12328       if test -n "$libs_termcap"; then
12329         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
12330       else
12331         
12332 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
12333 echo "configure:12334: checking for tgetent in -lcurses" >&5
12334 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
12335
12336 xe_check_libs=" -lcurses "
12337 cat > conftest.$ac_ext <<EOF
12338 #line 12339 "configure"
12339 #include "confdefs.h"
12340 /* Override any gcc2 internal prototype to avoid an error.  */
12341 /* We use char because int might match the return type of a gcc2
12342     builtin and then its argument prototype would still apply.  */
12343 char tgetent();
12344
12345 int main() {
12346 tgetent()
12347 ; return 0; }
12348 EOF
12349 if { (eval echo configure:12350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12350   rm -rf conftest*
12351   eval "ac_cv_lib_$ac_lib_var=yes"
12352 else
12353   echo "configure: failed program was:" >&5
12354   cat conftest.$ac_ext >&5
12355   rm -rf conftest*
12356   eval "ac_cv_lib_$ac_lib_var=no"
12357 fi
12358 rm -f conftest*
12359 xe_check_libs=""
12360
12361 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12362   echo "$ac_t""yes" 1>&6
12363   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
12364 else
12365   echo "$ac_t""no" 1>&6
12366 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
12367 echo "configure:12368: checking for tgetent in -ltermcap" >&5
12368 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
12369
12370 xe_check_libs=" -ltermcap "
12371 cat > conftest.$ac_ext <<EOF
12372 #line 12373 "configure"
12373 #include "confdefs.h"
12374 /* Override any gcc2 internal prototype to avoid an error.  */
12375 /* We use char because int might match the return type of a gcc2
12376     builtin and then its argument prototype would still apply.  */
12377 char tgetent();
12378
12379 int main() {
12380 tgetent()
12381 ; return 0; }
12382 EOF
12383 if { (eval echo configure:12384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12384   rm -rf conftest*
12385   eval "ac_cv_lib_$ac_lib_var=yes"
12386 else
12387   echo "configure: failed program was:" >&5
12388   cat conftest.$ac_ext >&5
12389   rm -rf conftest*
12390   eval "ac_cv_lib_$ac_lib_var=no"
12391 fi
12392 rm -f conftest*
12393 xe_check_libs=""
12394
12395 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12396   echo "$ac_t""yes" 1>&6
12397   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
12398 else
12399   echo "$ac_t""no" 1>&6
12400 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
12401    echo "    xemacs will be linked with \"termcap.o\""
12402  fi
12403 fi
12404
12405
12406 fi
12407
12408
12409       fi
12410     fi
12411   fi
12412   { test "$extra_verbose" = "yes" && cat << EOF
12413     Defining CURSES_H_FILE = "${curses_h_file-curses.h}"
12414 EOF
12415 cat >> confdefs.h <<EOF
12416 #define CURSES_H_FILE "${curses_h_file-curses.h}"
12417 EOF
12418 }
12419
12420   { test "$extra_verbose" = "yes" && cat << EOF
12421     Defining TERM_H_FILE = "${term_h_file-term.h}"
12422 EOF
12423 cat >> confdefs.h <<EOF
12424 #define TERM_H_FILE "${term_h_file-term.h}"
12425 EOF
12426 }
12427
12428
12429     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
12430 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
12431 echo "configure:12432: checking for gpm.h" >&5
12432
12433 cat > conftest.$ac_ext <<EOF
12434 #line 12435 "configure"
12435 #include "confdefs.h"
12436 #include <gpm.h>
12437 EOF
12438 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12439 { (eval echo configure:12440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12440 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12441 if test -z "$ac_err"; then
12442   rm -rf conftest*
12443   eval "ac_cv_header_$ac_safe=yes"
12444 else
12445   echo "$ac_err" >&5
12446   echo "configure: failed program was:" >&5
12447   cat conftest.$ac_ext >&5
12448   rm -rf conftest*
12449   eval "ac_cv_header_$ac_safe=no"
12450 fi
12451 rm -f conftest*
12452 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12453   echo "$ac_t""yes" 1>&6
12454   :
12455 else
12456   echo "$ac_t""no" 1>&6
12457 with_gpm=no
12458 fi
12459  }
12460   test -z "$with_gpm" && { 
12461 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
12462 echo "configure:12463: checking for Gpm_Open in -lgpm" >&5
12463 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
12464
12465 xe_check_libs=" -lgpm "
12466 cat > conftest.$ac_ext <<EOF
12467 #line 12468 "configure"
12468 #include "confdefs.h"
12469 /* Override any gcc2 internal prototype to avoid an error.  */
12470 /* We use char because int might match the return type of a gcc2
12471     builtin and then its argument prototype would still apply.  */
12472 char Gpm_Open();
12473
12474 int main() {
12475 Gpm_Open()
12476 ; return 0; }
12477 EOF
12478 if { (eval echo configure:12479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12479   rm -rf conftest*
12480   eval "ac_cv_lib_$ac_lib_var=yes"
12481 else
12482   echo "configure: failed program was:" >&5
12483   cat conftest.$ac_ext >&5
12484   rm -rf conftest*
12485   eval "ac_cv_lib_$ac_lib_var=no"
12486 fi
12487 rm -f conftest*
12488 xe_check_libs=""
12489
12490 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12491   echo "$ac_t""yes" 1>&6
12492   with_gpm=yes
12493 else
12494   echo "$ac_t""no" 1>&6
12495 with_gpm=no
12496 fi
12497
12498  }
12499   if test "$with_gpm" = "yes"; then
12500     { test "$extra_verbose" = "yes" && cat << \EOF
12501     Defining HAVE_GPM
12502 EOF
12503 cat >> confdefs.h <<\EOF
12504 #define HAVE_GPM 1
12505 EOF
12506 }
12507
12508     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
12509    echo "    xemacs will be linked with \"gpmevent.o\""
12510  fi
12511     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
12512   fi
12513
12514 else   for feature in ncurses gpm; do
12515     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
12516       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
12517     fi
12518     eval "with_${feature}=no"
12519   done
12520 fi 
12521 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
12522    echo "    xemacs will be linked with \"event-unixoid.o\""
12523  fi
12524
12525
12526 test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
12527   != "no no no" && echo "checking for database support" 1>&6
12528 echo "configure:12529: checking for database support" >&5
12529
12530 if test "$with_database_gdbm $with_database_dbm" != "no no"; then
12531   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
12532 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
12533 echo "configure:12534: checking for ndbm.h" >&5
12534
12535 cat > conftest.$ac_ext <<EOF
12536 #line 12537 "configure"
12537 #include "confdefs.h"
12538 #include <ndbm.h>
12539 EOF
12540 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12541 { (eval echo configure:12542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12542 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12543 if test -z "$ac_err"; then
12544   rm -rf conftest*
12545   eval "ac_cv_header_$ac_safe=yes"
12546 else
12547   echo "$ac_err" >&5
12548   echo "configure: failed program was:" >&5
12549   cat conftest.$ac_ext >&5
12550   rm -rf conftest*
12551   eval "ac_cv_header_$ac_safe=no"
12552 fi
12553 rm -f conftest*
12554 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12555   echo "$ac_t""yes" 1>&6
12556   :
12557 else
12558   echo "$ac_t""no" 1>&6
12559
12560     test "$with_database_gdbm" = "yes" -o \
12561          "$with_database_dbm"  = "yes" && \
12562       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
12563     with_database_gdbm=no with_database_dbm=no
12564 fi
12565
12566 fi
12567
12568 if test "$with_database_gdbm" != "no"; then
12569   
12570 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
12571 echo "configure:12572: checking for dbm_open in -lgdbm" >&5
12572 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
12573
12574 xe_check_libs=" -lgdbm "
12575 cat > conftest.$ac_ext <<EOF
12576 #line 12577 "configure"
12577 #include "confdefs.h"
12578 /* Override any gcc2 internal prototype to avoid an error.  */
12579 /* We use char because int might match the return type of a gcc2
12580     builtin and then its argument prototype would still apply.  */
12581 char dbm_open();
12582
12583 int main() {
12584 dbm_open()
12585 ; return 0; }
12586 EOF
12587 if { (eval echo configure:12588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12588   rm -rf conftest*
12589   eval "ac_cv_lib_$ac_lib_var=yes"
12590 else
12591   echo "configure: failed program was:" >&5
12592   cat conftest.$ac_ext >&5
12593   rm -rf conftest*
12594   eval "ac_cv_lib_$ac_lib_var=no"
12595 fi
12596 rm -f conftest*
12597 xe_check_libs=""
12598
12599 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12600   echo "$ac_t""yes" 1>&6
12601   with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm
12602 else
12603   echo "$ac_t""no" 1>&6
12604 if test "$with_database_gdbm" = "yes"; then
12605      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
12606    fi
12607    with_database_gdbm=no
12608 fi
12609
12610
12611 fi
12612
12613 if test "$with_database_dbm" != "no"; then
12614   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12615 echo "configure:12616: checking for dbm_open" >&5
12616
12617 cat > conftest.$ac_ext <<EOF
12618 #line 12619 "configure"
12619 #include "confdefs.h"
12620 /* System header to define __stub macros and hopefully few prototypes,
12621     which can conflict with char dbm_open(); below.  */
12622 #include <assert.h>
12623 /* Override any gcc2 internal prototype to avoid an error.  */
12624 /* We use char because int might match the return type of a gcc2
12625     builtin and then its argument prototype would still apply.  */
12626 char dbm_open();
12627
12628 int main() {
12629
12630 /* The GNU C library defines this for functions which it implements
12631     to always fail with ENOSYS.  Some functions are actually named
12632     something starting with __ and the normal name is an alias.  */
12633 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12634 choke me
12635 #else
12636 dbm_open();
12637 #endif
12638
12639 ; return 0; }
12640 EOF
12641 if { (eval echo configure:12642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12642   rm -rf conftest*
12643   eval "ac_cv_func_dbm_open=yes"
12644 else
12645   echo "configure: failed program was:" >&5
12646   cat conftest.$ac_ext >&5
12647   rm -rf conftest*
12648   eval "ac_cv_func_dbm_open=no"
12649 fi
12650 rm -f conftest*
12651
12652 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12653   echo "$ac_t""yes" 1>&6
12654   with_database_dbm=yes libdbm=
12655 else
12656   echo "$ac_t""no" 1>&6
12657
12658     
12659 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
12660 echo "configure:12661: checking for dbm_open in -ldbm" >&5
12661 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
12662
12663 xe_check_libs=" -ldbm "
12664 cat > conftest.$ac_ext <<EOF
12665 #line 12666 "configure"
12666 #include "confdefs.h"
12667 /* Override any gcc2 internal prototype to avoid an error.  */
12668 /* We use char because int might match the return type of a gcc2
12669     builtin and then its argument prototype would still apply.  */
12670 char dbm_open();
12671
12672 int main() {
12673 dbm_open()
12674 ; return 0; }
12675 EOF
12676 if { (eval echo configure:12677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12677   rm -rf conftest*
12678   eval "ac_cv_lib_$ac_lib_var=yes"
12679 else
12680   echo "configure: failed program was:" >&5
12681   cat conftest.$ac_ext >&5
12682   rm -rf conftest*
12683   eval "ac_cv_lib_$ac_lib_var=no"
12684 fi
12685 rm -f conftest*
12686 xe_check_libs=""
12687
12688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12689   echo "$ac_t""yes" 1>&6
12690   with_database_dbm=yes libdbm=-ldbm
12691 else
12692   echo "$ac_t""no" 1>&6
12693 test "$with_database_dbm" = "yes" && \
12694         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
12695       with_database_dbm=no
12696 fi
12697
12698
12699 fi
12700
12701 fi
12702
12703 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
12704 test "$with_database_gdbm" = "yes" -o \
12705      "$with_database_dbm"  = "yes" && \
12706   { test "$extra_verbose" = "yes" && cat << \EOF
12707     Defining HAVE_DBM
12708 EOF
12709 cat >> confdefs.h <<\EOF
12710 #define HAVE_DBM 1
12711 EOF
12712 }
12713
12714
12715 if test "$with_database_berkdb" != "no"; then
12716   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
12717 echo "configure:12718: checking for Berkeley db.h" >&5
12718   for header in "db/db.h" "db.h"; do
12719     cat > conftest.$ac_ext <<EOF
12720 #line 12721 "configure"
12721 #include "confdefs.h"
12722
12723 #include <stdlib.h>
12724 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
12725 #ifdef HAVE_INTTYPES_H
12726 #define __BIT_TYPES_DEFINED__
12727 #include <inttypes.h>
12728 typedef uint8_t  u_int8_t;
12729 typedef uint16_t u_int16_t;
12730 typedef uint32_t u_int32_t;
12731 #ifdef WE_DONT_NEED_QUADS
12732 typedef uint64_t u_int64_t;
12733 #endif
12734 #endif
12735 #endif
12736 #include <$header>
12737
12738 int main() {
12739
12740 ; return 0; }
12741 EOF
12742 if { (eval echo configure:12743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12743   rm -rf conftest*
12744   db_h_file="$header"; break
12745 else
12746   echo "configure: failed program was:" >&5
12747   cat conftest.$ac_ext >&5
12748 fi
12749 rm -f conftest*
12750   done
12751   if test -z "$db_h_file"
12752   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
12753   else echo "$ac_t""$db_h_file" 1>&6
12754   fi
12755
12756   if test "$with_database_berkdb" != "no"; then
12757     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
12758 echo "configure:12759: checking for Berkeley DB version" >&5
12759     cat > conftest.$ac_ext <<EOF
12760 #line 12761 "configure"
12761 #include "confdefs.h"
12762 #include <$db_h_file>
12763 #if DB_VERSION_MAJOR > 1
12764 yes
12765 #endif
12766
12767 EOF
12768 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12769   egrep "yes" >/dev/null 2>&1; then
12770   rm -rf conftest*
12771   echo "$ac_t""2" 1>&6; dbfunc=db_open
12772 else
12773   rm -rf conftest*
12774   echo "$ac_t""1" 1>&6; dbfunc=dbopen
12775 fi
12776 rm -f conftest*
12777
12778     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
12779 echo "configure:12780: checking for $dbfunc" >&5
12780
12781 cat > conftest.$ac_ext <<EOF
12782 #line 12783 "configure"
12783 #include "confdefs.h"
12784 /* System header to define __stub macros and hopefully few prototypes,
12785     which can conflict with char $dbfunc(); below.  */
12786 #include <assert.h>
12787 /* Override any gcc2 internal prototype to avoid an error.  */
12788 /* We use char because int might match the return type of a gcc2
12789     builtin and then its argument prototype would still apply.  */
12790 char $dbfunc();
12791
12792 int main() {
12793
12794 /* The GNU C library defines this for functions which it implements
12795     to always fail with ENOSYS.  Some functions are actually named
12796     something starting with __ and the normal name is an alias.  */
12797 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
12798 choke me
12799 #else
12800 $dbfunc();
12801 #endif
12802
12803 ; return 0; }
12804 EOF
12805 if { (eval echo configure:12806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12806   rm -rf conftest*
12807   eval "ac_cv_func_$dbfunc=yes"
12808 else
12809   echo "configure: failed program was:" >&5
12810   cat conftest.$ac_ext >&5
12811   rm -rf conftest*
12812   eval "ac_cv_func_$dbfunc=no"
12813 fi
12814 rm -f conftest*
12815
12816 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
12817   echo "$ac_t""yes" 1>&6
12818   with_database_berkdb=yes need_libdb=no
12819 else
12820   echo "$ac_t""no" 1>&6
12821
12822     
12823 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
12824 echo "configure:12825: checking for $dbfunc in -ldb" >&5
12825 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
12826
12827 xe_check_libs=" -ldb "
12828 cat > conftest.$ac_ext <<EOF
12829 #line 12830 "configure"
12830 #include "confdefs.h"
12831 /* Override any gcc2 internal prototype to avoid an error.  */
12832 /* We use char because int might match the return type of a gcc2
12833     builtin and then its argument prototype would still apply.  */
12834 char $dbfunc();
12835
12836 int main() {
12837 $dbfunc()
12838 ; return 0; }
12839 EOF
12840 if { (eval echo configure:12841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12841   rm -rf conftest*
12842   eval "ac_cv_lib_$ac_lib_var=yes"
12843 else
12844   echo "configure: failed program was:" >&5
12845   cat conftest.$ac_ext >&5
12846   rm -rf conftest*
12847   eval "ac_cv_lib_$ac_lib_var=no"
12848 fi
12849 rm -f conftest*
12850 xe_check_libs=""
12851
12852 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12853   echo "$ac_t""yes" 1>&6
12854   with_database_berkdb=yes need_libdb=yes
12855 else
12856   echo "$ac_t""no" 1>&6
12857 fi
12858
12859
12860 fi
12861
12862   fi
12863
12864   if test "$with_database_berkdb" = "yes"; then
12865     { test "$extra_verbose" = "yes" && cat << EOF
12866     Defining DB_H_FILE = "$db_h_file"
12867 EOF
12868 cat >> confdefs.h <<EOF
12869 #define DB_H_FILE "$db_h_file"
12870 EOF
12871 }
12872
12873     { test "$extra_verbose" = "yes" && cat << \EOF
12874     Defining HAVE_BERKELEY_DB
12875 EOF
12876 cat >> confdefs.h <<\EOF
12877 #define HAVE_BERKELEY_DB 1
12878 EOF
12879 }
12880
12881     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
12882   else with_database_berkdb=no
12883   fi
12884 fi
12885
12886 if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
12887      != "no no no"; then
12888   { test "$extra_verbose" = "yes" && cat << \EOF
12889     Defining HAVE_DATABASE
12890 EOF
12891 cat >> confdefs.h <<\EOF
12892 #define HAVE_DATABASE 1
12893 EOF
12894 }
12895
12896   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
12897    echo "    xemacs will be linked with \"database.o\""
12898  fi
12899 fi
12900
12901 if test "$with_socks" = "yes"; then
12902   
12903 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
12904 echo "configure:12905: checking for SOCKSinit in -lsocks" >&5
12905 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
12906
12907 xe_check_libs=" -lsocks "
12908 cat > conftest.$ac_ext <<EOF
12909 #line 12910 "configure"
12910 #include "confdefs.h"
12911 /* Override any gcc2 internal prototype to avoid an error.  */
12912 /* We use char because int might match the return type of a gcc2
12913     builtin and then its argument prototype would still apply.  */
12914 char SOCKSinit();
12915
12916 int main() {
12917 SOCKSinit()
12918 ; return 0; }
12919 EOF
12920 if { (eval echo configure:12921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12921   rm -rf conftest*
12922   eval "ac_cv_lib_$ac_lib_var=yes"
12923 else
12924   echo "configure: failed program was:" >&5
12925   cat conftest.$ac_ext >&5
12926   rm -rf conftest*
12927   eval "ac_cv_lib_$ac_lib_var=no"
12928 fi
12929 rm -f conftest*
12930 xe_check_libs=""
12931
12932 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12933   echo "$ac_t""yes" 1>&6
12934     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
12935     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
12936   { test "$extra_verbose" = "yes" && cat << EOF
12937     Defining $ac_tr_lib
12938 EOF
12939 cat >> confdefs.h <<EOF
12940 #define $ac_tr_lib 1
12941 EOF
12942 }
12943
12944   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
12945
12946 else
12947   echo "$ac_t""no" 1>&6
12948 fi
12949
12950
12951   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
12952     Defining HAVE_SOCKS
12953 EOF
12954 cat >> confdefs.h <<\EOF
12955 #define HAVE_SOCKS 1
12956 EOF
12957 }
12958
12959 fi
12960
12961 if test "$usage_tracking" = "yes"; then
12962   { test "$extra_verbose" = "yes" && cat << \EOF
12963     Defining USAGE_TRACKING
12964 EOF
12965 cat >> confdefs.h <<\EOF
12966 #define USAGE_TRACKING 1
12967 EOF
12968 }
12969
12970   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
12971 fi
12972
12973 if test "$with_modules" != "no"; then
12974   echo "checking for module support" 1>&6
12975 echo "configure:12976: checking for module support" >&5
12976
12977     ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
12978 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
12979 echo "configure:12980: checking for dlfcn.h" >&5
12980
12981 cat > conftest.$ac_ext <<EOF
12982 #line 12983 "configure"
12983 #include "confdefs.h"
12984 #include <dlfcn.h>
12985 EOF
12986 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12987 { (eval echo configure:12988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12988 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12989 if test -z "$ac_err"; then
12990   rm -rf conftest*
12991   eval "ac_cv_header_$ac_safe=yes"
12992 else
12993   echo "$ac_err" >&5
12994   echo "configure: failed program was:" >&5
12995   cat conftest.$ac_ext >&5
12996   rm -rf conftest*
12997   eval "ac_cv_header_$ac_safe=no"
12998 fi
12999 rm -f conftest*
13000 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13001   echo "$ac_t""yes" 1>&6
13002   
13003     
13004 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
13005 echo "configure:13006: checking for dlopen in -ldl" >&5
13006 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
13007
13008 xe_check_libs=" -ldl "
13009 cat > conftest.$ac_ext <<EOF
13010 #line 13011 "configure"
13011 #include "confdefs.h"
13012 /* Override any gcc2 internal prototype to avoid an error.  */
13013 /* We use char because int might match the return type of a gcc2
13014     builtin and then its argument prototype would still apply.  */
13015 char dlopen();
13016
13017 int main() {
13018 dlopen()
13019 ; return 0; }
13020 EOF
13021 if { (eval echo configure:13022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13022   rm -rf conftest*
13023   eval "ac_cv_lib_$ac_lib_var=yes"
13024 else
13025   echo "configure: failed program was:" >&5
13026   cat conftest.$ac_ext >&5
13027   rm -rf conftest*
13028   eval "ac_cv_lib_$ac_lib_var=no"
13029 fi
13030 rm -f conftest*
13031 xe_check_libs=""
13032
13033 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13034   echo "$ac_t""yes" 1>&6
13035   have_dl=yes libdl=dl
13036 else
13037   echo "$ac_t""no" 1>&6
13038
13039 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
13040 echo "configure:13041: checking for dlopen in -lc" >&5
13041 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
13042
13043 xe_check_libs=" -lc "
13044 cat > conftest.$ac_ext <<EOF
13045 #line 13046 "configure"
13046 #include "confdefs.h"
13047 /* Override any gcc2 internal prototype to avoid an error.  */
13048 /* We use char because int might match the return type of a gcc2
13049     builtin and then its argument prototype would still apply.  */
13050 char dlopen();
13051
13052 int main() {
13053 dlopen()
13054 ; return 0; }
13055 EOF
13056 if { (eval echo configure:13057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13057   rm -rf conftest*
13058   eval "ac_cv_lib_$ac_lib_var=yes"
13059 else
13060   echo "configure: failed program was:" >&5
13061   cat conftest.$ac_ext >&5
13062   rm -rf conftest*
13063   eval "ac_cv_lib_$ac_lib_var=no"
13064 fi
13065 rm -f conftest*
13066 xe_check_libs=""
13067
13068 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13069   echo "$ac_t""yes" 1>&6
13070   have_dl=yes 
13071 else
13072   echo "$ac_t""no" 1>&6
13073 fi
13074
13075
13076 fi
13077
13078
13079 else
13080   echo "$ac_t""no" 1>&6
13081 fi
13082
13083   if test -n "$have_dl"; then
13084     { test "$extra_verbose" = "yes" && cat << \EOF
13085     Defining HAVE_DLOPEN
13086 EOF
13087 cat >> confdefs.h <<\EOF
13088 #define HAVE_DLOPEN 1
13089 EOF
13090 }
13091
13092   else
13093     
13094 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
13095 echo "configure:13096: checking for shl_load in -ldld" >&5
13096 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
13097
13098 xe_check_libs=" -ldld "
13099 cat > conftest.$ac_ext <<EOF
13100 #line 13101 "configure"
13101 #include "confdefs.h"
13102 /* Override any gcc2 internal prototype to avoid an error.  */
13103 /* We use char because int might match the return type of a gcc2
13104     builtin and then its argument prototype would still apply.  */
13105 char shl_load();
13106
13107 int main() {
13108 shl_load()
13109 ; return 0; }
13110 EOF
13111 if { (eval echo configure:13112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13112   rm -rf conftest*
13113   eval "ac_cv_lib_$ac_lib_var=yes"
13114 else
13115   echo "configure: failed program was:" >&5
13116   cat conftest.$ac_ext >&5
13117   rm -rf conftest*
13118   eval "ac_cv_lib_$ac_lib_var=no"
13119 fi
13120 rm -f conftest*
13121 xe_check_libs=""
13122
13123 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13124   echo "$ac_t""yes" 1>&6
13125   libdl=dld have_dl=yes;
13126       { test "$extra_verbose" = "yes" && cat << \EOF
13127     Defining HAVE_SHL_LOAD
13128 EOF
13129 cat >> confdefs.h <<\EOF
13130 #define HAVE_SHL_LOAD 1
13131 EOF
13132 }
13133
13134 else
13135   echo "$ac_t""no" 1>&6
13136
13137 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
13138 echo "configure:13139: checking for dld_init in -ldld" >&5
13139 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
13140
13141 xe_check_libs=" -ldld "
13142 cat > conftest.$ac_ext <<EOF
13143 #line 13144 "configure"
13144 #include "confdefs.h"
13145 /* Override any gcc2 internal prototype to avoid an error.  */
13146 /* We use char because int might match the return type of a gcc2
13147     builtin and then its argument prototype would still apply.  */
13148 char dld_init();
13149
13150 int main() {
13151 dld_init()
13152 ; return 0; }
13153 EOF
13154 if { (eval echo configure:13155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13155   rm -rf conftest*
13156   eval "ac_cv_lib_$ac_lib_var=yes"
13157 else
13158   echo "configure: failed program was:" >&5
13159   cat conftest.$ac_ext >&5
13160   rm -rf conftest*
13161   eval "ac_cv_lib_$ac_lib_var=no"
13162 fi
13163 rm -f conftest*
13164 xe_check_libs=""
13165
13166 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13167   echo "$ac_t""yes" 1>&6
13168   libdl=dld have_dl=yes;
13169       { test "$extra_verbose" = "yes" && cat << \EOF
13170     Defining HAVE_DLD_INIT
13171 EOF
13172 cat >> confdefs.h <<\EOF
13173 #define HAVE_DLD_INIT 1
13174 EOF
13175 }
13176
13177 else
13178   echo "$ac_t""no" 1>&6
13179 fi
13180
13181
13182 fi
13183
13184
13185   fi
13186
13187   if test -n "$have_dl"; then
13188         
13189 dll_ld=
13190 dll_ldflags=
13191 dll_cflags=
13192 dll_post=
13193 dll_ldo="-o"
13194 ld_dynamic_link_flags=
13195 xehost=$canonical
13196 xealias=$internal_configuration
13197
13198 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
13199 echo "configure:13200: checking how to build dynamic libraries for ${xehost}" >&5
13200 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
13201 case "$xehost" in
13202 *-*-linux-gnu*) ;;
13203 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
13204 esac
13205
13206 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
13207 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
13208 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
13209
13210 case "$xehost_os" in
13211 aix3*)
13212   # AIX sometimes has problems with the GCC collect2 program.  For some
13213   # reason, if we set the COLLECT_NAMES environment variable, the problems
13214   # vanish in a puff of smoke.
13215   if test "${COLLECT_NAMES+set}" != set; then
13216     COLLECT_NAMES=
13217     export COLLECT_NAMES
13218   fi
13219   ;;
13220 esac
13221
13222 # Now see if the compiler is really GCC.
13223 if test "$GCC" = "yes"; then
13224   XEGCC=yes
13225 else
13226   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
13227 echo "configure:13228: checking checking whether we are using GNU C" >&5
13228   cat > conftest.$ac_ext <<EOF
13229 #line 13230 "configure"
13230 #include "confdefs.h"
13231
13232 #ifdef __GNUC__
13233   yes;
13234 #endif
13235
13236 EOF
13237 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13238   egrep "yes" >/dev/null 2>&1; then
13239   rm -rf conftest*
13240   XEGCC=yes
13241 else
13242   rm -rf conftest*
13243   XEGCC=no
13244 fi
13245 rm -f conftest*
13246
13247   echo "$ac_t""${XEGCC}" 1>&6
13248 fi
13249
13250 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
13251 echo "configure:13252: checking how to produce PIC code" >&5
13252 wl=
13253
13254 can_build_shared=yes
13255 if test "$XEGCC" = yes; then
13256   wl='-Wl,'
13257
13258   case "$xehost_os" in
13259   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
13260     # PIC is the default for these OSes.
13261     ;;
13262
13263   aix3* | aix4* | os2*)
13264     # We can build DLLs from non-PIC.
13265     ;;
13266   amigaos*)
13267     # FIXME: we need at least 68020 code to build shared libraries, but
13268     # adding the `-m68020' flag to GCC prevents building anything better,
13269     # like `-m68040'.
13270     dll_cflags='-m68020 -resident32 -malways-restore-a4'
13271     ;;
13272   *)
13273     dll_cflags='-fPIC'
13274     ;;
13275   esac
13276 else
13277   # PORTME Check for PIC flags for the system compiler.
13278   case "$xehost_os" in
13279   hpux9* | hpux1[0-9]*)
13280     # Is there a better link_static_flag that works with the bundled CC?
13281     wl='-Wl,'
13282     dll_cflags='+Z'
13283     ;;
13284
13285   irix5* | irix6*)
13286     wl='-Wl,'
13287     # PIC (with -KPIC) is the default.
13288     ;;
13289
13290   os2*)
13291     # We can build DLLs from non-PIC.
13292     ;;
13293
13294   osf3* | osf4*)
13295     # All OSF/1 code is PIC.
13296     wl='-Wl,'
13297     ;;
13298
13299   sco3.2v5*)
13300     dll_cflags='-belf -Kpic'
13301     wl='-Wl,'
13302     ;;
13303
13304   unixware*)
13305     dll_cflags="-KPIC"
13306     wl="-Wl,"
13307     ;;
13308
13309   sysv4*)
13310     dll_cflags="-KPIC"
13311     wl="-Wl,"
13312     ;;
13313
13314   sysv5*)
13315     dll_cflags="-KPIC"
13316     wl="-Wl,"
13317     ;;
13318
13319   solaris2*)
13320     dll_cflags='-KPIC'
13321     wl='-Wl,'
13322     ;;
13323
13324   sunos4*)
13325     dll_cflags='-PIC'
13326     wl='-Qoption ld '
13327     ;;
13328
13329   uts4*)
13330     dll_cflags='-pic'
13331     ;;
13332
13333   *)
13334     can_build_shared=no
13335     ;;
13336   esac
13337 fi
13338
13339 if test -n "$dll_cflags"; then
13340   echo "$ac_t""${dll_cflags}" 1>&6
13341   
13342   # Check to make sure the dll_cflags actually works.
13343   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
13344 echo "configure:13345: checking if PIC flag ${dll_cflags} really works" >&5
13345   save_CFLAGS="$CFLAGS"
13346   CFLAGS="$CFLAGS $dll_cflags -DPIC"
13347   cat > conftest.$ac_ext <<EOF
13348 #line 13349 "configure"
13349 #include "confdefs.h"
13350
13351 int main() {
13352 int x=0;
13353 ; return 0; }
13354 EOF
13355 if { (eval echo configure:13356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13356   rm -rf conftest*
13357   
13358     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
13359     # reports no error.  So, we need to grep stderr for (Bundled).
13360     if grep '(Bundled)' config.log >/dev/null; then
13361       echo "$ac_t""no" 1>&6
13362       can_build_shared=no
13363       dll_cflags=
13364     else
13365       echo "$ac_t""yes" 1>&6
13366     fi
13367 else
13368   echo "configure: failed program was:" >&5
13369   cat conftest.$ac_ext >&5
13370   rm -rf conftest*
13371   echo "$ac_t""no" 1>&6
13372     can_build_shared=no
13373     dll_cflags=
13374 fi
13375 rm -f conftest*
13376   CFLAGS="$save_CFLAGS"
13377 else
13378   echo "$ac_t""none" 1>&6
13379 fi
13380
13381 if test "$can_build_shared" = "yes"; then
13382 cc_produces_so=no
13383 xldf=
13384 xcldf=
13385 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
13386 echo "configure:13387: checking if C compiler can produce shared libraries" >&5
13387 if test "$XEGCC" = yes; then
13388   xcldf="-shared"
13389   xldf="-shared"
13390 else # Not using GCC
13391   case "$xehost_os" in
13392     aix3* | aix4*)
13393       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
13394       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
13395       ;;
13396
13397     freebsd2* | netbsd* | openbsd*)
13398       xldf="-Bshareable"
13399       xcldf="${wl}-Bshareable"
13400       ;;
13401
13402     freebsd3*)
13403       xcldf="-shared"
13404       ;;
13405
13406     hpux*)
13407       xldf="-b +s"
13408       xcldf="${wl}-b ${wl}+s"
13409       ;;
13410
13411     irix5* | irix6* | osf3* | osf4*)
13412       xcldf="${wl}-shared"
13413       xldf="-shared"
13414       ;;
13415
13416     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
13417       xcldf="-G"
13418       xldf="-G"
13419       ;;
13420
13421     sunos4*)
13422       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
13423       xldf="-assert pure-text -Bstatic"
13424       ;;
13425   esac
13426 fi # End if if we are using gcc
13427
13428 if test -n "$xcldf"; then
13429   save_LDFLAGS=$LDFLAGS
13430   save_LIBS=$LIBS
13431   save_xe_libs=$xe_libs
13432   LDFLAGS="$xcldf $LDFLAGS"
13433   LIBS=
13434   xe_libs=
13435   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
13436   cat > conftest.$ac_ext <<EOF
13437 #line 13438 "configure"
13438 #include "confdefs.h"
13439
13440 int main() {
13441 int x=0;
13442 ; return 0; }
13443 EOF
13444 if { (eval echo configure:13445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13445   rm -rf conftest*
13446   cc_produces_so=yes
13447 else
13448   echo "configure: failed program was:" >&5
13449   cat conftest.$ac_ext >&5
13450   rm -rf conftest*
13451   cc_produces_so=no
13452 fi
13453 rm -f conftest*
13454   LDFLAGS=$save_LDFLAGS
13455   LIBS=$save_LIBS
13456   xe_libs=$save_xe_libs
13457   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
13458 else
13459   cc_produces_so=no
13460 fi
13461 echo "$ac_t""${cc_produces_so}" 1>&6
13462
13463 LTLD=$LD
13464 if test -z "$LTLD"; then
13465   ac_prog=ld
13466   if test "$XEGCC" = yes; then
13467     # Check if gcc -print-prog-name=ld gives a path.
13468     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
13469 echo "configure:13470: checking for ld used by GCC" >&5
13470     ac_prog=`($CC -print-prog-name=ld) 2>&5`
13471     case "$ac_prog" in
13472     # Accept absolute paths.
13473     /*)
13474       if test -z "$LTLD"; then
13475         case "$ac_prog" in
13476           *gcc-lib*) LTLD="$CC"
13477                      ;;
13478           *)         LTLD="$ac_prog"
13479                      ;;
13480         esac
13481       fi
13482       ;;
13483     "")
13484       # If it fails, then pretend we aren't using GCC.
13485       ac_prog=ld
13486       ;;
13487     *)
13488       # If it is relative, then search for the first ld in PATH.
13489       with_gnu_ld=unknown
13490       ;;
13491     esac
13492   else
13493     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
13494 echo "configure:13495: checking for GNU ld" >&5
13495   fi
13496
13497   if test -z "$LTLD"; then
13498     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
13499     for ac_dir in $PATH; do
13500       test -z "$ac_dir" && ac_dir=.
13501       if test -f "$ac_dir/$ac_prog"; then
13502         LTLD="$ac_dir/$ac_prog"
13503         # Check to see if the program is GNU ld.  I'd rather use --version,
13504         # but apparently some GNU ld's only accept -v.
13505         # Break only if it was the GNU/non-GNU ld that we prefer.
13506         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
13507           xe_gnu_ld=yes
13508         else
13509           xe_gnu_ld=no
13510         fi
13511       fi
13512     done
13513     IFS="$ac_save_ifs"
13514   fi
13515
13516   if test -n "$LTLD"; then
13517     echo "$ac_t""${LTLD}" 1>&6
13518   else
13519     echo "$ac_t""no" 1>&6
13520   fi
13521
13522   if test -z "$LTLD" -a "$cc_produces_so" = no; then
13523     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
13524     exit 1
13525   fi
13526 fi
13527
13528 ld_dynamic_link_flags=
13529
13530 # Check to see if it really is or isn't GNU ld.
13531 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
13532 echo "configure:13533: checking if the linker is GNU ld" >&5
13533 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
13534 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
13535   xe_gnu_ld=yes
13536 else
13537   xe_gnu_ld=no
13538 fi
13539 echo "$ac_t""${xe_gnu_ld}" 1>&6
13540
13541 case "$xehost_os" in
13542   amigaos* | sunos4*)
13543     # On these operating systems, we should treat GNU ld like the system ld.
13544     gnu_ld_acts_native=yes
13545     ;;
13546   *)
13547     gnu_ld_acts_native=no
13548     ;;
13549 esac
13550
13551 if test "$cc_produces_so" = "yes"; then
13552   dll_ld=$CC
13553   dll_ldflags=$xcldf
13554   can_build_shared=yes
13555   ld_shlibs=yes
13556 else
13557   # OK - only NOW do we futz about with ld.
13558   # See if the linker supports building shared libraries.
13559   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
13560 echo "configure:13561: checking whether the linker supports shared libraries" >&5
13561   dll_ld=$CC
13562   dll_ldflags=$LDFLAGS
13563   ld_shlibs=yes
13564   can_build_shared=yes
13565   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
13566     # See if GNU ld supports shared libraries.
13567     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
13568       dll_ld=$CC
13569       dll_ldflags="-shared"
13570       ld_shlibs=yes
13571     else
13572       ld_shlibs=no
13573     fi
13574   else
13575     # PORTME fill in a description of your system's linker (not GNU ld)
13576     case "$xehost_os" in
13577     aix3*)
13578       dll_ld=$LTLD
13579       dll_ldflags=$xldf
13580       ;;
13581
13582     aix4*)
13583       dll_ldflags=$xcldf
13584       ;;
13585
13586     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
13587     # support.  Future versions do this automatically, but an explicit c++rt0.o
13588     # doesn't break anything, and helps significantly (at the cost of a little
13589     # extra space).
13590     freebsd2.2*)
13591       dll_ld=$LTLD
13592       dll_ldflags=$xldf
13593       dll_post="/usr/lib/c++rt0.o"
13594       ;;
13595
13596     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
13597     freebsd2*)
13598       dll_ld=$LTLD
13599       dll_ldflags="-Bshareable"
13600       ;;
13601
13602     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
13603     freebsd3*)
13604       dll_ldflags="-shared"
13605       ;;
13606
13607     hpux*)
13608       dll_ld=$LTLD
13609       dll_ldflags=$xldf
13610       ;;
13611
13612     irix5* | irix6*)
13613       dll_ld=$LTLD
13614       dll_ldflags=$xldf
13615       ;;
13616
13617     netbsd*)
13618       # Tested with NetBSD 1.2 ld
13619       dll_ld=$LTLD
13620       dll_ldflags=$xldf
13621       ;;
13622
13623     openbsd*)
13624       dll_ld=$LTLD
13625       dll_ldflags=$xldf
13626       ;;
13627
13628     osf3* | osf4*)
13629       dll_ld=$LTLD
13630       dll_ldflags=$xldf
13631       ;;
13632
13633     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
13634     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
13635       dll_ld=$LTLD
13636       case "$dll_ld" in
13637         *gcc*) dll_ldflags="-shared"
13638                dll_ld=$CC
13639                ;;
13640         *)     dll_ldflags="-G"
13641                ;;
13642       esac
13643       ;;
13644
13645     sunos4*)
13646       if test "$XEGCC" = yes; then
13647         dll_ld=$CC
13648       else
13649         dll_ld=$LTLD
13650       fi
13651       dll_ldflags=$xldf
13652       ;;
13653
13654     uts4*)
13655       dll_ld=$LTLD
13656       dll_ldflags="-G"
13657       ;;
13658
13659     bsdi*)
13660       dll_ldflags="-r"
13661       dll_ld="shlicc2"
13662       ;;
13663
13664     *)
13665       ld_shlibs=no
13666       can_build_shared=no
13667       ;;
13668     esac
13669   fi
13670   echo "$ac_t""${ld_shlibs}" 1>&6
13671   if test "$ld_shlibs" = "no"; then
13672     can_build_shared=no
13673   fi
13674 fi # End of if cc_produces_so = no
13675
13676
13677 if test "$xe_gnu_ld" = yes; then
13678   if test "$ld_shlibs" = yes; then
13679     ld_dynamic_link_flags="${wl}-export-dynamic"
13680   fi
13681 fi
13682
13683 if test -z "$ld_dynamic_link_flags"; then
13684   case "$xehost_os" in
13685   aix3*)
13686     ld_dynamic_link_flags=
13687     ;;
13688
13689   aix4*)
13690     ld_dynamic_link_flags=
13691     ;;
13692
13693   freebsd2.2*)
13694     ld_dynamic_link_flags=
13695     ;;
13696
13697   freebsd2*)
13698     ld_dynamic_link_flags=
13699     ;;
13700
13701   freebsd3*)
13702     ld_dynamic_link_flags=
13703     ;;
13704
13705   hpux*)
13706     ld_dynamic_link_flags="${wl}-E"
13707     ;;
13708
13709   irix5* | irix6*)
13710     ld_dynamic_link_flags=
13711     ;;
13712
13713   netbsd*)
13714     ld_dynamic_link_flags=
13715     ;;
13716
13717   openbsd*)
13718     ld_dynamic_link_flags=
13719     ;;
13720
13721   osf3* | osf4*)
13722     ld_dynamic_link_flags=
13723     ;;
13724
13725   solaris2* | solaris7*)
13726     ld_dynamic_link_flags=
13727     ;;
13728
13729   sco3.2v5* | unixware* | sysv5* | sysv4*)
13730     ld_dynamic_link_flags="${wl}-Bexport"
13731     ;;
13732
13733   sunos4*)
13734     ld_dynamic_link_flags=
13735     ;;
13736
13737   uts4*)
13738     ld_dynamic_link_flags=
13739     ;;
13740
13741   bsdi*)
13742     ld_dynamic_link_flags=
13743     ;;
13744
13745   esac
13746 fi # End of if -z ld_dynamic_link_flags
13747 fi # End of if test "$can_build_shared" = "yes"
13748
13749
13750
13751
13752
13753
13754
13755
13756   fi
13757
13758   if test "$can_build_shared" = "yes"; then
13759     { test "$extra_verbose" = "yes" && cat << \EOF
13760     Defining HAVE_SHLIB
13761 EOF
13762 cat >> confdefs.h <<\EOF
13763 #define HAVE_SHLIB 1
13764 EOF
13765 }
13766
13767     extra_objs="$extra_objs sysdll.o emodules.o" &&  if test "$extra_verbose" = "yes"; then
13768    echo "    xemacs will be linked with \"sysdll.o emodules.o\""
13769  fi
13770     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
13771     test -n "$libdl" && LIBS="-l${libdl} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${libdl}\" to \$LIBS"; fi
13772     for ac_func in dlerror _dlerror
13773 do
13774 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
13775 echo "configure:13776: checking for $ac_func" >&5
13776
13777 cat > conftest.$ac_ext <<EOF
13778 #line 13779 "configure"
13779 #include "confdefs.h"
13780 /* System header to define __stub macros and hopefully few prototypes,
13781     which can conflict with char $ac_func(); below.  */
13782 #include <assert.h>
13783 /* Override any gcc2 internal prototype to avoid an error.  */
13784 /* We use char because int might match the return type of a gcc2
13785     builtin and then its argument prototype would still apply.  */
13786 char $ac_func();
13787
13788 int main() {
13789
13790 /* The GNU C library defines this for functions which it implements
13791     to always fail with ENOSYS.  Some functions are actually named
13792     something starting with __ and the normal name is an alias.  */
13793 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13794 choke me
13795 #else
13796 $ac_func();
13797 #endif
13798
13799 ; return 0; }
13800 EOF
13801 if { (eval echo configure:13802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13802   rm -rf conftest*
13803   eval "ac_cv_func_$ac_func=yes"
13804 else
13805   echo "configure: failed program was:" >&5
13806   cat conftest.$ac_ext >&5
13807   rm -rf conftest*
13808   eval "ac_cv_func_$ac_func=no"
13809 fi
13810 rm -f conftest*
13811
13812 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
13813   echo "$ac_t""yes" 1>&6
13814     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
13815   { test "$extra_verbose" = "yes" && cat << EOF
13816     Defining $ac_tr_func
13817 EOF
13818 cat >> confdefs.h <<EOF
13819 #define $ac_tr_func 1
13820 EOF
13821 }
13822  
13823 else
13824   echo "$ac_t""no" 1>&6
13825 fi
13826 done
13827
13828     with_modules=yes
13829   else
13830     if test "$with_modules" = "yes"; then
13831       { echo "Error:" "Required module support cannot be provided." >&2; exit 1; }
13832     else
13833       echo "configure: warning: "Module support cannot be provided."" 1>&2
13834     fi
13835     with_modules=no
13836   fi
13837 fi
13838
13839 cat > conftest.$ac_ext <<EOF
13840 #line 13841 "configure"
13841 #include "confdefs.h"
13842 int main(int c,char *v[]){return 0;}
13843 EOF
13844 if { (eval echo configure:13845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
13845 then
13846   :
13847 else
13848   conftest_rc="$?"
13849   echo "configure: failed program was:" >&5
13850   cat conftest.$ac_ext >&5
13851   rm -fr conftest*
13852   
13853   echo ""
13854   echo "*** PANIC *** The C compiler can no longer build working executables."
13855   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
13856   echo "*** PANIC *** The most likely reason for this problem is that configure"
13857   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
13858   echo "*** PANIC *** found at run time."
13859   echo "*** PANIC ***"
13860   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
13861   echo "*** PANIC *** On other systems, try telling configure where to find the"
13862   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
13863   echo "*** PANIC ***"
13864   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
13865   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
13866   echo "*** PANIC *** on your system.  Don't do that."
13867   exit 1
13868 fi
13869 rm -fr conftest*
13870
13871 if test "$win32_processes" = "yes"; then
13872   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
13873    echo "    xemacs will be linked with \"process-nt.o\""
13874  fi
13875 else
13876   { test "$extra_verbose" = "yes" && cat << \EOF
13877     Defining HAVE_UNIX_PROCESSES
13878 EOF
13879 cat >> confdefs.h <<\EOF
13880 #define HAVE_UNIX_PROCESSES 1
13881 EOF
13882 }
13883
13884   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
13885    echo "    xemacs will be linked with \"process-unix.o\""
13886  fi
13887 fi
13888
13889
13890
13891 T=""
13892 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13893 CFLAGS="$T"
13894
13895
13896 T=""
13897 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13898 extra_objs="$T"
13899
13900
13901 T=""
13902 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
13903 c_switch_general="$T"
13904
13905
13906 T=""
13907 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13908 c_switch_window_system="$T"
13909
13910
13911 T=""
13912 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13913 c_switch_all="$T"
13914
13915
13916 T=""
13917 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
13918 ld_switch_general="$T"
13919
13920
13921 T=""
13922 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13923 ld_switch_window_system="$T"
13924
13925
13926 T=""
13927 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13928 ld_switch_all="$T"
13929
13930
13931 T=""
13932 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13933 ld_libs_general="$T"
13934
13935
13936 T=""
13937 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
13938 ld_libs_window_system="$T"
13939
13940
13941 T=""
13942 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13943 ld_libs_all="$T"
13944
13945
13946
13947 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
13948 internal_makefile_list="Makefile.in"
13949 SUBDIR_MAKEFILES=''
13950 test -d lock || mkdir lock
13951 for dir in $MAKE_SUBDIR; do
13952   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
13953         test -d "$d" || mkdir "$d"; cd "$d"
13954       done ) ;;
13955    * ) test -d "$dir" || mkdir "$dir" ;;
13956   esac
13957   
13958 T=""
13959 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13960 SUBDIR_MAKEFILES="$T"
13961
13962   
13963 T=""
13964 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13965 internal_makefile_list="$T"
13966
13967 done
13968
13969
13970
13971
13972 for dir in src/s src/m; do
13973   if test ! -d "$dir" ; then
13974     echo Making symbolic link to "$srcdir/$dir"
13975     ${LN_S} "$srcdir/$dir" "$dir"
13976   fi
13977 done
13978
13979 if test "$extra_verbose" = "yes"; then
13980   echo ""
13981   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
13982   echo ""
13983 fi
13984
13985
13986 if test -f "$srcdir/src/.gdbinit" -a ! -f "src/.gdbinit"; then
13987   test "$extra_verbose" = "yes" && echo "creating src/.gdbinit"
13988   echo "source $srcdir/src/.gdbinit" > "src/.gdbinit"
13989 fi
13990
13991 if test -f "$srcdir/src/.dbxrc" -a ! -f "src/.dbxrc"; then
13992   test "$extra_verbose" = "yes" && echo "creating src/.dbxrc"
13993   echo ". $srcdir/src/.dbxrc" > "src/.dbxrc"
13994 fi
13995
13996 if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then
13997   test "$extra_verbose" = "yes" && echo "creating TAGS"
13998   echo "\f
13999 $srcdir/TAGS,include" > "TAGS"
14000 fi
14001
14002 if test "$__SUNPRO_C" = "yes"; then
14003   test "$extra_verbose" = "yes" && echo "creating .sbinit"
14004   ( echo "# For use with Sun WorkShop's Source browser."
14005     echo "# See sbquery(1) and sbinit(4) for more information"
14006     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
14007   ) > .sbinit
14008 fi
14009
14010 rm -f core
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030 PREFIX=$prefix
14031 while true; do
14032   case "$PREFIX" in
14033     *\$* ) eval "PREFIX=$PREFIX" ;;
14034     *) break ;;
14035   esac
14036 done
14037
14038
14039
14040
14041 EXEC_PREFIX=$exec_prefix
14042 while true; do
14043   case "$EXEC_PREFIX" in
14044     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
14045     *) break ;;
14046   esac
14047 done
14048
14049
14050
14051
14052 INFODIR=$infodir
14053 while true; do
14054   case "$INFODIR" in
14055     *\$* ) eval "INFODIR=$INFODIR" ;;
14056     *) break ;;
14057   esac
14058 done
14059
14060
14061
14062
14063 INFOPATH=$infopath
14064 while true; do
14065   case "$INFOPATH" in
14066     *\$* ) eval "INFOPATH=$INFOPATH" ;;
14067     *) break ;;
14068   esac
14069 done
14070
14071
14072
14073
14074 PACKAGE_PATH=$package_path
14075 while true; do
14076   case "$PACKAGE_PATH" in
14077     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
14078     *) break ;;
14079   esac
14080 done
14081
14082
14083
14084
14085 LISPDIR=$lispdir
14086 while true; do
14087   case "$LISPDIR" in
14088     *\$* ) eval "LISPDIR=$LISPDIR" ;;
14089     *) break ;;
14090   esac
14091 done
14092
14093
14094
14095
14096 MODULEDIR=$moduledir
14097 while true; do
14098   case "$MODULEDIR" in
14099     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
14100     *) break ;;
14101   esac
14102 done
14103
14104
14105
14106
14107 SITELISPDIR=$sitelispdir
14108 while true; do
14109   case "$SITELISPDIR" in
14110     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
14111     *) break ;;
14112   esac
14113 done
14114
14115
14116
14117
14118 SITEMODULEDIR=$sitemoduledir
14119 while true; do
14120   case "$SITEMODULEDIR" in
14121     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
14122     *) break ;;
14123   esac
14124 done
14125
14126
14127
14128
14129 ETCDIR=$etcdir
14130 while true; do
14131   case "$ETCDIR" in
14132     *\$* ) eval "ETCDIR=$ETCDIR" ;;
14133     *) break ;;
14134   esac
14135 done
14136
14137
14138
14139
14140 DOCDIR=$docdir
14141 while true; do
14142   case "$DOCDIR" in
14143     *\$* ) eval "DOCDIR=$DOCDIR" ;;
14144     *) break ;;
14145   esac
14146 done
14147
14148
14149
14150
14151 ARCHLIBDIR=$archlibdir
14152 while true; do
14153   case "$ARCHLIBDIR" in
14154     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
14155     *) break ;;
14156   esac
14157 done
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
14179
14180
14181
14182
14183
14184
14185
14186 : ${XEMACS_CC:=$CC}
14187
14188
14189 if test "$with_prefix" = "yes"; then
14190   { test "$extra_verbose" = "yes" && cat << \EOF
14191     Defining PREFIX_USER_DEFINED
14192 EOF
14193 cat >> confdefs.h <<\EOF
14194 #define PREFIX_USER_DEFINED 1
14195 EOF
14196 }
14197
14198 fi
14199
14200 if test "$with_site_lisp" = "no"; then
14201   { test "$extra_verbose" = "yes" && cat << \EOF
14202     Defining INHIBIT_SITE_LISP
14203 EOF
14204 cat >> confdefs.h <<\EOF
14205 #define INHIBIT_SITE_LISP 1
14206 EOF
14207 }
14208
14209 fi
14210 if test "$with_site_modules" = "no"; then
14211   { test "$extra_verbose" = "yes" && cat << \EOF
14212     Defining INHIBIT_SITE_MODULES
14213 EOF
14214 cat >> confdefs.h <<\EOF
14215 #define INHIBIT_SITE_MODULES 1
14216 EOF
14217 }
14218
14219 fi
14220
14221
14222 T=""
14223 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14224 ac_configure_args="$T"
14225
14226 { test "$extra_verbose" = "yes" && cat << EOF
14227     Defining EMACS_CONFIGURATION = "$configuration"
14228 EOF
14229 cat >> confdefs.h <<EOF
14230 #define EMACS_CONFIGURATION "$configuration"
14231 EOF
14232 }
14233
14234 { test "$extra_verbose" = "yes" && cat << EOF
14235     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
14236 EOF
14237 cat >> confdefs.h <<EOF
14238 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
14239 EOF
14240 }
14241
14242 { test "$extra_verbose" = "yes" && cat << EOF
14243     Defining config_machfile = "$machfile"
14244 EOF
14245 cat >> confdefs.h <<EOF
14246 #define config_machfile "$machfile"
14247 EOF
14248 }
14249
14250 { test "$extra_verbose" = "yes" && cat << EOF
14251     Defining config_opsysfile = "$opsysfile"
14252 EOF
14253 cat >> confdefs.h <<EOF
14254 #define config_opsysfile "$opsysfile"
14255 EOF
14256 }
14257
14258
14259
14260 null_string=""
14261 { test "$extra_verbose" = "yes" && cat << EOF
14262     Defining LD_SWITCH_X_SITE = $null_string
14263 EOF
14264 cat >> confdefs.h <<EOF
14265 #define LD_SWITCH_X_SITE $null_string
14266 EOF
14267 }
14268
14269 { test "$extra_verbose" = "yes" && cat << EOF
14270     Defining LD_SWITCH_X_SITE_AUX = $null_string
14271 EOF
14272 cat >> confdefs.h <<EOF
14273 #define LD_SWITCH_X_SITE_AUX $null_string
14274 EOF
14275 }
14276
14277 { test "$extra_verbose" = "yes" && cat << EOF
14278     Defining C_SWITCH_X_SITE = $null_string
14279 EOF
14280 cat >> confdefs.h <<EOF
14281 #define C_SWITCH_X_SITE $null_string
14282 EOF
14283 }
14284
14285 { test "$extra_verbose" = "yes" && cat << EOF
14286     Defining LD_SWITCH_SITE = $null_string
14287 EOF
14288 cat >> confdefs.h <<EOF
14289 #define LD_SWITCH_SITE $null_string
14290 EOF
14291 }
14292
14293 { test "$extra_verbose" = "yes" && cat << EOF
14294     Defining C_SWITCH_SITE = $null_string
14295 EOF
14296 cat >> confdefs.h <<EOF
14297 #define C_SWITCH_SITE $null_string
14298 EOF
14299 }
14300
14301
14302
14303 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14304     Defining GNU_MALLOC
14305 EOF
14306 cat >> confdefs.h <<\EOF
14307 #define GNU_MALLOC 1
14308 EOF
14309 }
14310
14311 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14312     Defining USE_SYSTEM_MALLOC
14313 EOF
14314 cat >> confdefs.h <<\EOF
14315 #define USE_SYSTEM_MALLOC 1
14316 EOF
14317 }
14318
14319 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14320     Defining USE_DEBUG_MALLOC
14321 EOF
14322 cat >> confdefs.h <<\EOF
14323 #define USE_DEBUG_MALLOC 1
14324 EOF
14325 }
14326
14327                                               { test "$extra_verbose" = "yes" && cat << \EOF
14328     Defining USE_SYSTEM_MALLOC
14329 EOF
14330 cat >> confdefs.h <<\EOF
14331 #define USE_SYSTEM_MALLOC 1
14332 EOF
14333 }
14334
14335 fi
14336 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14337     Defining I18N3
14338 EOF
14339 cat >> confdefs.h <<\EOF
14340 #define I18N3 1
14341 EOF
14342 }
14343
14344 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14345     Defining USE_GCC
14346 EOF
14347 cat >> confdefs.h <<\EOF
14348 #define USE_GCC 1
14349 EOF
14350 }
14351
14352 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14353     Defining EXTERNAL_WIDGET
14354 EOF
14355 cat >> confdefs.h <<\EOF
14356 #define EXTERNAL_WIDGET 1
14357 EOF
14358 }
14359
14360 test "$quick_build"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14361     Defining QUICK_BUILD
14362 EOF
14363 cat >> confdefs.h <<\EOF
14364 #define QUICK_BUILD 1
14365 EOF
14366 }
14367
14368 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14369     Defining PURIFY
14370 EOF
14371 cat >> confdefs.h <<\EOF
14372 #define PURIFY 1
14373 EOF
14374 }
14375
14376 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14377     Defining QUANTIFY
14378 EOF
14379 cat >> confdefs.h <<\EOF
14380 #define QUANTIFY 1
14381 EOF
14382 }
14383
14384 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14385     Defining MAIL_USE_POP
14386 EOF
14387 cat >> confdefs.h <<\EOF
14388 #define MAIL_USE_POP 1
14389 EOF
14390 }
14391
14392 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14393     Defining KERBEROS
14394 EOF
14395 cat >> confdefs.h <<\EOF
14396 #define KERBEROS 1
14397 EOF
14398 }
14399
14400 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14401     Defining HESIOD
14402 EOF
14403 cat >> confdefs.h <<\EOF
14404 #define HESIOD 1
14405 EOF
14406 }
14407
14408 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14409     Defining USE_UNION_TYPE
14410 EOF
14411 cat >> confdefs.h <<\EOF
14412 #define USE_UNION_TYPE 1
14413 EOF
14414 }
14415
14416 test "$pdump"              = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14417     Defining PDUMP
14418 EOF
14419 cat >> confdefs.h <<\EOF
14420 #define PDUMP 1
14421 EOF
14422 }
14423
14424
14425
14426 (
14427 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
14428 else
14429   echo "uname -a: `uname -a`"
14430 fi
14431 echo ""
14432 echo "$0 $quoted_arguments"
14433 ) > Installation
14434
14435 if test ! -z ${emacs_beta_version} ; then
14436   if test -z "${emacs_is_beta}" ; then
14437         xemacs_betaname=".${emacs_beta_version}"
14438   else
14439         xemacs_betaname="-b${emacs_beta_version}"
14440   fi
14441 else
14442   xemacs_betaname=""
14443 fi
14444
14445 (
14446 echo "
14447
14448 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
14449 "
14450 echo "
14451 Compilation / Installation:"
14452 echo "  Source code location:              $srcdir"
14453 echo "  Installation prefix:               $prefix"
14454 if test -n "$site_includes"; then
14455   echo "  Additional header files:           $site_includes"
14456 fi
14457 if test -n "$site_libraries"; then
14458   echo "  Additional libraries:              $site_libraries"
14459 fi
14460 if test -n "$site_prefixes"; then
14461   echo "  Additional prefixes:               $site_prefixes"
14462 fi
14463 if test -n "$runpath"; then
14464   echo "  Runtime library search path:       $runpath"
14465 fi
14466 echo "  Operating system description file: \`$opsysfile'"
14467 echo "  Machine description file:          \`$machfile'"
14468 echo "  Compiler:                          $CC $CFLAGS"
14469 echo "  Relocating allocator for buffers:  $rel_alloc"
14470 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
14471
14472 echo "
14473 Window System:"
14474 if test "$with_msw" = "yes"; then
14475   echo "  Compiling in support for the Microsoft window system."
14476 fi
14477 if test "$with_x11" = "yes"; then
14478   echo "  Compiling in support for the X window system:"
14479   echo "    - X Windows headers location:                 $x_includes"
14480   echo "    - X Windows libraries location:               $x_libraries"
14481   if test "$with_xauth" != yes; then
14482     echo "    - Xau (X authority) not available."
14483   fi
14484   if test "$with_xmu" != yes; then
14485     echo "    - Xmu library not available; substituting equivalent routines."
14486   fi
14487   if test "$with_wmcommand" != no; then
14488     echo "    - Handling WM_COMMAND properly."
14489   fi
14490 fi
14491 if test "$have_xaw" = "yes"; then
14492   echo "  Compiling in support for the Athena widget set:"
14493   echo "    - Athena headers location:                    $athena_h_path"
14494   echo "    - Athena library to link:                     $athena_lib"
14495 fi
14496 case "$with_menubars" in
14497   lucid ) echo "  Using Lucid menubars." ;;
14498   motif ) echo "  Using Motif menubars."
14499           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
14500           echo "             We recommend using the Lucid menubar instead."
14501           echo "             Re-run configure with --with-menubars='lucid'." ;;
14502     msw ) echo "  Using MS-Windows menubars." ;;
14503 esac
14504 case "$with_scrollbars" in
14505   lucid  ) echo "  Using Lucid scrollbars."      ;;
14506   motif  ) echo "  Using Motif scrollbars."      ;;
14507   athena ) echo "  Using Athena scrollbars."     ;;
14508      msw ) echo "  Using MS-Windows scrollbars." ;;
14509 esac
14510 case "$with_dialogs" in
14511   motif  ) echo "  Using Motif dialog boxes."
14512            if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
14513              echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
14514              echo "             We recommend using the Athena dialog boxes instead."
14515              echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
14516              echo "             Read the PROBLEMS file for more information."
14517            fi; fi ;;
14518   athena ) echo "  Using Athena dialog boxes."     ;;
14519      msw ) echo "  Using MS-Windows dialog boxes." ;;
14520 esac
14521 case "$with_widgets" in
14522   motif  ) echo "  Using Motif native widgets."      ;;
14523   athena ) echo "  Using Athena native widgets."     ;;
14524      msw ) echo "  Using MS-Windows native widgets." ;;
14525 esac
14526 if test "$with_dragndrop" = yes; then
14527   echo "  Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
14528   echo "    -  Drag'n'Drop prototype:                             $dragndrop_proto."
14529 fi
14530
14531 echo "
14532 TTY:"
14533 test "$with_ncurses" = yes && echo "  Compiling in support for ncurses."
14534 test "$with_gpm" = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
14535
14536 echo "
14537 Images:"
14538 test "$with_gif" = yes && echo "  Compiling in support for GIF  images (builtin)."
14539 if test "$with_xpm" = yes; then
14540   echo "  Compiling in support for XPM  images."
14541 elif test "$with_x11" = yes; then
14542   echo "  WARNING: -----------------------------------------------------------"
14543   echo "  WARNING: Compiling without XPM image support."
14544   if test "$xpm_problem" != ""; then
14545     echo "  Reason: $xpm_problem"
14546   fi
14547   echo "  WARNING: You should strongly consider installing XPM."
14548   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
14549   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
14550   echo "  WARNING: -----------------------------------------------------------"
14551 fi
14552 if test "$with_png" = yes; then
14553   echo "  Compiling in support for PNG  images."
14554 elif test "$window_system" != "none"; then
14555   echo "  WARNING: -----------------------------------------------------------"
14556   echo "  WARNING: Compiling without PNG image support."
14557   if test "$png_problem" != ""; then
14558     echo "  Reason: $png_problem"
14559   fi
14560   echo "  WARNING: You should strongly consider installing the PNG libraries."
14561   echo "  WARNING: Otherwise certain images and glyphs may not display."
14562   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
14563   echo "  WARNING: -----------------------------------------------------------"
14564 fi
14565 test "$with_jpeg" = yes && echo "  Compiling in support for JPEG images."
14566 test "$with_tiff" = yes && echo "  Compiling in support for TIFF images."
14567 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
14568
14569 echo "
14570 Sound:"
14571 test "$with_native_sound" = yes && echo "  Compiling in support for sound (native)."
14572 test "$with_nas_sound" = yes && echo "  Compiling in support for NAS (network audio system)."
14573 test "$old_nas" = yes && echo "    - NAS library lacks error trapping; will play synchronously."
14574 test "$with_esd_sound" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
14575
14576 echo "
14577 Databases:"
14578 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
14579 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
14580 test "$with_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
14581 test "$with_ldap" = yes && echo "  Compiling in support for LDAP."
14582 if test "$with_postgresql" = yes; then
14583   echo "  Compiling in support for PostgreSQL."
14584   if test "$with_postgresqlv7" = yes; then
14585     echo "    - Using PostgreSQL V7 bindings."
14586   fi
14587   if test -n "$postgres_h_path"; then
14588     echo "    - PostgreSQL headers location:  $postgres_h_path"
14589   fi
14590 fi
14591
14592 echo "
14593 Internationalization:"
14594 test "$with_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
14595 test "$with_utf_2000" = yes && echo "  Using UTF-2000 (UTF-8) buffer/string representation."
14596 test "$with_text_coding" = yes && echo "  Compiling in support for text coding."
14597 test "$with_file_coding" = yes && echo "  Compiling in support for file coding."
14598 test "$with_xim" != no && echo "  Compiling in support for XIM (X11R5+ I18N input method)."
14599 test "$with_xim" = motif && echo "    - Using Motif to provide XIM support."
14600 test "$with_xim" = xlib && echo "    - Using raw Xlib to provide XIM support."
14601 test "$with_xfs" = yes && echo "    - Using XFontSet to provide bilingual menubar."
14602 test "$with_canna" = yes && echo "  Compiling in support for Canna on Mule."
14603 if test "$with_wnn" = yes; then
14604   echo "  Compiling in support for the WNN input method on Mule."
14605   test "$with_wnn6" = yes && echo "    - Using WNN version 6."
14606 fi
14607 test "$with_i18n3" = yes && echo "  Compiling in support for I18N level 3 (doesn't currently work)."
14608
14609 echo "
14610 Mail:"
14611 test "$with_pop" = yes && echo "  Compiling in support for POP mail retrieval."
14612 test "$with_kerberos" = yes && echo "  Compiling in support for Kerberos POP authentication."
14613 test "$with_hesiod" = yes && echo "  Compiling in support for Hesiod POP server access."
14614 echo "  Compiling in support for \"$mail_locking\" mail spool file locking method."
14615
14616 echo "
14617 Other Features:"
14618 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
14619 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
14620 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
14621 test "$with_dnet" = yes && echo "  Compiling in support for DNET."
14622 test "$with_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
14623 test "$use_union_type" = yes && echo "  Using the union type for Lisp_Objects."
14624 test "$pdump" = yes && echo "  Using the new portable dumper."
14625 test "$debug" = yes && echo "  Compiling in support for extra debugging code."
14626 test "$usage_tracking" = yes && echo "  Compiling in support for active usage tracking (Sun internal)."
14627 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc $error_check_glyphs" \
14628   != "no no no no no no"; then
14629   echo "  WARNING: ---------------------------------------------------------"
14630   echo "  WARNING: Compiling in support for runtime error checking."
14631   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
14632   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
14633   echo "  WARNING: ---------------------------------------------------------"
14634 fi
14635 echo ""
14636 ) | tee -a Installation
14637 echo ""
14638
14639
14640 # Remove any trailing slashes in these variables.
14641 test -n "$prefix" &&
14642   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
14643 test -n "$exec_prefix" &&
14644   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
14645
14646
14647 for file in $internal_makefile_list; do
14648   test "$file" = src/Makefile.in && \
14649     file="src/Makefile.in:src/Makefile.in.in:src/depend"
14650   ac_output_files="$ac_output_files $file" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$file\" to \$ac_output_files"; fi
14651 done
14652 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
14653 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
14654
14655 trap '' 1 2 15
14656
14657 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
14658
14659 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14660 # Let make expand exec_prefix.
14661 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14662
14663 # Any assignment to VPATH causes Sun make to only execute
14664 # the first set of double-colon rules, so remove it if not needed.
14665 # If there is a colon in the path, we need to keep it.
14666 if test "x$srcdir" = x.; then
14667   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
14668 fi
14669
14670 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
14671
14672 DEFS=-DHAVE_CONFIG_H
14673
14674 # Without the "./", some shells look in PATH for config.status.
14675 : ${CONFIG_STATUS=./config.status}
14676
14677 echo creating $CONFIG_STATUS
14678 rm -f $CONFIG_STATUS
14679 cat > $CONFIG_STATUS <<EOF
14680 #! /bin/sh
14681 # Generated automatically by configure.
14682 # Run this file to recreate the current configuration.
14683 # This directory was configured as follows,
14684 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
14685 #
14686 # $0 $ac_configure_args
14687 #
14688 # Compiler output produced by configure, useful for debugging
14689 # configure, is in ./config.log if it exists.
14690
14691 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
14692 for ac_option
14693 do
14694   case "\$ac_option" in
14695   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14696     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
14697     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
14698   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
14699     echo "$CONFIG_STATUS generated by autoconf version 2.13"
14700     exit 0 ;;
14701   -help | --help | --hel | --he | --h)
14702     echo "\$ac_cs_usage"; exit 0 ;;
14703   *) echo "\$ac_cs_usage"; exit 1 ;;
14704   esac
14705 done
14706
14707 ac_given_srcdir=$srcdir
14708 ac_given_INSTALL="$INSTALL"
14709
14710 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
14711 EOF
14712 cat >> $CONFIG_STATUS <<EOF
14713
14714 # Protect against being on the right side of a sed subst in config.status.
14715 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
14716  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
14717 $ac_vpsub
14718 $extrasub
14719 s%@SHELL@%$SHELL%g
14720 s%@CFLAGS@%$CFLAGS%g
14721 s%@CPPFLAGS@%$CPPFLAGS%g
14722 s%@CXXFLAGS@%$CXXFLAGS%g
14723 s%@FFLAGS@%$FFLAGS%g
14724 s%@DEFS@%$DEFS%g
14725 s%@LDFLAGS@%$LDFLAGS%g
14726 s%@LIBS@%$LIBS%g
14727 s%@exec_prefix@%$exec_prefix%g
14728 s%@prefix@%$prefix%g
14729 s%@program_transform_name@%$program_transform_name%g
14730 s%@bindir@%$bindir%g
14731 s%@sbindir@%$sbindir%g
14732 s%@libexecdir@%$libexecdir%g
14733 s%@datadir@%$datadir%g
14734 s%@sysconfdir@%$sysconfdir%g
14735 s%@sharedstatedir@%$sharedstatedir%g
14736 s%@localstatedir@%$localstatedir%g
14737 s%@libdir@%$libdir%g
14738 s%@includedir@%$includedir%g
14739 s%@oldincludedir@%$oldincludedir%g
14740 s%@infodir@%$infodir%g
14741 s%@mandir@%$mandir%g
14742 s%@LN_S@%$LN_S%g
14743 s%@blddir@%$blddir%g
14744 s%@CC@%$CC%g
14745 s%@CPP@%$CPP%g
14746 s%@start_flags@%$start_flags%g
14747 s%@ld_switch_shared@%$ld_switch_shared%g
14748 s%@start_files@%$start_files%g
14749 s%@ld@%$ld%g
14750 s%@lib_gcc@%$lib_gcc%g
14751 s%@RANLIB@%$RANLIB%g
14752 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
14753 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
14754 s%@INSTALL_DATA@%$INSTALL_DATA%g
14755 s%@YACC@%$YACC%g
14756 s%@SET_MAKE@%$SET_MAKE%g
14757 s%@X_CFLAGS@%$X_CFLAGS%g
14758 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
14759 s%@X_LIBS@%$X_LIBS%g
14760 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
14761 s%@install_pp@%$install_pp%g
14762 s%@libs_xauth@%$libs_xauth%g
14763 s%@dnd_objs@%$dnd_objs%g
14764 s%@lwlib_objs@%$lwlib_objs%g
14765 s%@ALLOCA@%$ALLOCA%g
14766 s%@have_esd_config@%$have_esd_config%g
14767 s%@dll_ld@%$dll_ld%g
14768 s%@dll_cflags@%$dll_cflags%g
14769 s%@dll_ldflags@%$dll_ldflags%g
14770 s%@dll_post@%$dll_post%g
14771 s%@dll_ldo@%$dll_ldo%g
14772 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
14773 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
14774 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
14775 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
14776 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
14777 s%@PROGNAME@%$PROGNAME%g
14778 s%@version@%$version%g
14779 s%@configuration@%$configuration%g
14780 s%@canonical@%$canonical%g
14781 s%@inststaticdir@%$inststaticdir%g
14782 s%@instvardir@%$instvardir%g
14783 s%@srcdir@%$srcdir%g
14784 s%@pkgdir@%$pkgdir%g
14785 s%@statedir@%$statedir%g
14786 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
14787 s%@PREFIX@%$PREFIX%g
14788 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
14789 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
14790 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
14791 s%@INFODIR@%$INFODIR%g
14792 s%@infopath@%$infopath%g
14793 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
14794 s%@INFOPATH@%$INFOPATH%g
14795 s%@package_path@%$package_path%g
14796 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
14797 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
14798 s%@lispdir@%$lispdir%g
14799 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
14800 s%@LISPDIR@%$LISPDIR%g
14801 s%@moduledir@%$moduledir%g
14802 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
14803 s%@MODULEDIR@%$MODULEDIR%g
14804 s%@sitelispdir@%$sitelispdir%g
14805 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
14806 s%@SITELISPDIR@%$SITELISPDIR%g
14807 s%@sitemoduledir@%$sitemoduledir%g
14808 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
14809 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
14810 s%@etcdir@%$etcdir%g
14811 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
14812 s%@ETCDIR@%$ETCDIR%g
14813 s%@docdir@%$docdir%g
14814 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
14815 s%@DOCDIR@%$DOCDIR%g
14816 s%@archlibdir@%$archlibdir%g
14817 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
14818 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
14819 s%@bitmapdir@%$bitmapdir%g
14820 s%@extra_objs@%$extra_objs%g
14821 s%@machfile@%$machfile%g
14822 s%@opsysfile@%$opsysfile%g
14823 s%@c_switch_general@%$c_switch_general%g
14824 s%@c_switch_window_system@%$c_switch_window_system%g
14825 s%@c_switch_all@%$c_switch_all%g
14826 s%@ld_switch_general@%$ld_switch_general%g
14827 s%@ld_switch_window_system@%$ld_switch_window_system%g
14828 s%@ld_switch_all@%$ld_switch_all%g
14829 s%@ld_libs_general@%$ld_libs_general%g
14830 s%@ld_libs_window_system@%$ld_libs_window_system%g
14831 s%@ld_libs_all@%$ld_libs_all%g
14832 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
14833 s%@native_sound_lib@%$native_sound_lib%g
14834 s%@sound_cflags@%$sound_cflags%g
14835 s%@dynodump_arch@%$dynodump_arch%g
14836 s%@XEMACS_CC@%$XEMACS_CC%g
14837 s%@internal_makefile_list@%$internal_makefile_list%g
14838
14839 CEOF
14840 EOF
14841
14842 cat >> $CONFIG_STATUS <<\EOF
14843
14844 # Split the substitutions into bite-sized pieces for seds with
14845 # small command number limits, like on Digital OSF/1 and HP-UX.
14846 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
14847 ac_file=1 # Number of current file.
14848 ac_beg=1 # First line for current file.
14849 ac_end=$ac_max_sed_cmds # Line after last line for current file.
14850 ac_more_lines=:
14851 ac_sed_cmds=""
14852 while $ac_more_lines; do
14853   if test $ac_beg -gt 1; then
14854     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
14855   else
14856     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
14857   fi
14858   if test ! -s conftest.s$ac_file; then
14859     ac_more_lines=false
14860     rm -f conftest.s$ac_file
14861   else
14862     if test -z "$ac_sed_cmds"; then
14863       ac_sed_cmds="sed -f conftest.s$ac_file"
14864     else
14865       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
14866     fi
14867     ac_file=`expr $ac_file + 1`
14868     ac_beg=$ac_end
14869     ac_end=`expr $ac_end + $ac_max_sed_cmds`
14870   fi
14871 done
14872 if test -z "$ac_sed_cmds"; then
14873   ac_sed_cmds=cat
14874 fi
14875 EOF
14876
14877 cat >> $CONFIG_STATUS <<EOF
14878
14879 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
14880 EOF
14881 cat >> $CONFIG_STATUS <<\EOF
14882 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
14883   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14884   case "$ac_file" in
14885   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14886        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14887   *) ac_file_in="${ac_file}.in" ;;
14888   esac
14889
14890   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
14891
14892   # Remove last slash and all that follows it.  Not all systems have dirname.
14893   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
14894   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14895     # The file is in a subdirectory.
14896     test ! -d "$ac_dir" && mkdir "$ac_dir"
14897     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
14898     # A "../" for each directory in $ac_dir_suffix.
14899     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
14900   else
14901     ac_dir_suffix= ac_dots=
14902   fi
14903
14904   case "$ac_given_srcdir" in
14905   .)  srcdir=.
14906       if test -z "$ac_dots"; then top_srcdir=.
14907       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
14908   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
14909   *) # Relative path.
14910     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
14911     top_srcdir="$ac_dots$ac_given_srcdir" ;;
14912   esac
14913
14914   case "$ac_given_INSTALL" in
14915   [/$]*) INSTALL="$ac_given_INSTALL" ;;
14916   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
14917   esac
14918
14919   echo creating "$ac_file"
14920   rm -f "$ac_file"
14921   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
14922   case "$ac_file" in
14923   *Makefile*) ac_comsub="1i\\
14924 # $configure_input" ;;
14925   *) ac_comsub= ;;
14926   esac
14927
14928   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14929   sed -e "$ac_comsub
14930 s%@configure_input@%$configure_input%g
14931 s%@srcdir@%$srcdir%g
14932 s%@top_srcdir@%$top_srcdir%g
14933 s%@INSTALL@%$INSTALL%g
14934 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
14935 fi; done
14936 rm -f conftest.s*
14937
14938 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14939 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14940 #
14941 # ac_d sets the value in "#define NAME VALUE" lines.
14942 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14943 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
14944 ac_dC='\3'
14945 ac_dD='%g'
14946 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14947 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14948 ac_uB='\([      ]\)%\1#\2define\3'
14949 ac_uC=' '
14950 ac_uD='\4%g'
14951 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14952 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14953 ac_eB='$%\1#\2define\3'
14954 ac_eC=' '
14955 ac_eD='%g'
14956
14957 if test "${CONFIG_HEADERS+set}" != set; then
14958 EOF
14959 cat >> $CONFIG_STATUS <<EOF
14960   CONFIG_HEADERS="src/config.h lwlib/config.h"
14961 EOF
14962 cat >> $CONFIG_STATUS <<\EOF
14963 fi
14964 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
14965   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14966   case "$ac_file" in
14967   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14968        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14969   *) ac_file_in="${ac_file}.in" ;;
14970   esac
14971
14972   echo creating $ac_file
14973
14974   rm -f conftest.frag conftest.in conftest.out
14975   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14976   cat $ac_file_inputs > conftest.in
14977
14978 EOF
14979
14980 # Transform confdefs.h into a sed script conftest.vals that substitutes
14981 # the proper values into config.h.in to produce config.h.  And first:
14982 # Protect against being on the right side of a sed subst in config.status.
14983 # Protect against being in an unquoted here document in config.status.
14984 rm -f conftest.vals
14985 cat > conftest.hdr <<\EOF
14986 s/[\\&%]/\\&/g
14987 s%[\\$`]%\\&%g
14988 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
14989 s%ac_d%ac_u%gp
14990 s%ac_u%ac_e%gp
14991 EOF
14992 sed -n -f conftest.hdr confdefs.h > conftest.vals
14993 rm -f conftest.hdr
14994
14995 # This sed command replaces #undef with comments.  This is necessary, for
14996 # example, in the case of _POSIX_SOURCE, which is predefined and required
14997 # on some systems where configure will not decide to define it.
14998 cat >> conftest.vals <<\EOF
14999 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
15000 EOF
15001
15002 # Break up conftest.vals because some shells have a limit on
15003 # the size of here documents, and old seds have small limits too.
15004
15005 rm -f conftest.tail
15006 while :
15007 do
15008   ac_lines=`grep -c . conftest.vals`
15009   # grep -c gives empty output for an empty file on some AIX systems.
15010   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
15011   # Write a limited-size here document to conftest.frag.
15012   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
15013   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
15014   echo 'CEOF
15015   sed -f conftest.frag conftest.in > conftest.out
15016   rm -f conftest.in
15017   mv conftest.out conftest.in
15018 ' >> $CONFIG_STATUS
15019   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15020   rm -f conftest.vals
15021   mv conftest.tail conftest.vals
15022 done
15023 rm -f conftest.vals
15024
15025 cat >> $CONFIG_STATUS <<\EOF
15026   rm -f conftest.frag conftest.h
15027   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15028   cat conftest.in >> conftest.h
15029   rm -f conftest.in
15030   if cmp -s $ac_file conftest.h 2>/dev/null; then
15031     echo "$ac_file is unchanged"
15032     rm -f conftest.h
15033   else
15034     # Remove last slash and all that follows it.  Not all systems have dirname.
15035       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15036       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15037       # The file is in a subdirectory.
15038       test ! -d "$ac_dir" && mkdir "$ac_dir"
15039     fi
15040     rm -f $ac_file
15041     mv conftest.h $ac_file
15042   fi
15043 fi; done
15044
15045 EOF
15046 cat >> $CONFIG_STATUS <<EOF
15047 CPP="$CPP"
15048  top_srcdir="$srcdir"
15049  MAKE_SUBDIR="$MAKE_SUBDIR"
15050
15051 EOF
15052 cat >> $CONFIG_STATUS <<\EOF
15053 for dir in . $MAKE_SUBDIR; do
15054   (
15055     cd $dir
15056     rm -f junk.c
15057     < Makefile.in \
15058       sed -e '/^# Generated/d' \
15059           -e 's%/\*\*/#.*%%' \
15060           -e 's/^ *# */#/' \
15061           -e '/^##/d' \
15062           -e '/^#/ {
15063 p
15064 d
15065 }'        \
15066           -e '/./ {
15067 s/\([\"]\)/\\\1/g
15068 s/^/"/
15069 s/$/"/
15070 }'  > junk.c;
15071
15072
15073
15074     echo creating $dir/Makefile
15075 $CPP -I. -I${top_srcdir}/src  junk.c \
15076   | sed -e 's/^\#.*//'          \
15077         -e 's/^[        ][      ]*$//'\
15078         -e 's/^ /       /'              \
15079   | sed -n -e '/^..*$/p'        \
15080   | sed '/^\"/ {
15081         s/\\\([\"]\)/\1/g
15082         s/^[    ]*\"//
15083         s/\"[   ]*$//
15084 }' > Makefile.new
15085     chmod 444 Makefile.new
15086     mv -f Makefile.new Makefile
15087
15088     echo creating $dir/GNUmakefile
15089 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
15090   | sed -e 's/^\#.*//'          \
15091         -e 's/^[        ][      ]*$//'\
15092         -e 's/^ /       /'              \
15093   | sed -n -e '/^..*$/p'        \
15094   | sed '/^\"/ {
15095         s/\\\([\"]\)/\1/g
15096         s/^[    ]*\"//
15097         s/\"[   ]*$//
15098 }' > Makefile.new
15099     chmod 444 Makefile.new
15100     mv -f Makefile.new GNUmakefile
15101
15102     rm -f junk.c
15103   )
15104 done
15105
15106 sed < config.status >> lib-src/config.values \
15107   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
15108   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
15109   -e 's/^\([^ ]*\) $/\1 ""/' \
15110   -e 's/ 1$/ t/'
15111
15112
15113 exit 0
15114 EOF
15115 chmod +x $CONFIG_STATUS
15116 rm -fr confdefs* $ac_clean_files
15117 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1