(Vcharset_control_1): New macro.
[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   fi
9190
9191   echo "checking for Mule input methods" 1>&6
9192 echo "configure:9193: checking for Mule input methods" >&5
9193         case "$with_xim" in "" | "yes" )
9194     echo "checking for XIM" 1>&6
9195 echo "configure:9196: checking for XIM" >&5
9196     
9197 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
9198 echo "configure:9199: checking for XOpenIM in -lX11" >&5
9199 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
9200
9201 xe_check_libs=" -lX11 "
9202 cat > conftest.$ac_ext <<EOF
9203 #line 9204 "configure"
9204 #include "confdefs.h"
9205 /* Override any gcc2 internal prototype to avoid an error.  */
9206 /* We use char because int might match the return type of a gcc2
9207     builtin and then its argument prototype would still apply.  */
9208 char XOpenIM();
9209
9210 int main() {
9211 XOpenIM()
9212 ; return 0; }
9213 EOF
9214 if { (eval echo configure:9215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9215   rm -rf conftest*
9216   eval "ac_cv_lib_$ac_lib_var=yes"
9217 else
9218   echo "configure: failed program was:" >&5
9219   cat conftest.$ac_ext >&5
9220   rm -rf conftest*
9221   eval "ac_cv_lib_$ac_lib_var=no"
9222 fi
9223 rm -f conftest*
9224 xe_check_libs=""
9225
9226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9227   echo "$ac_t""yes" 1>&6
9228   with_xim=xlib
9229 else
9230   echo "$ac_t""no" 1>&6
9231 with_xim=no
9232 fi
9233
9234
9235         if test "$have_motif $have_lesstif" = "yes no"; then
9236       
9237 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
9238 echo "configure:9239: checking for XmImMbLookupString in -lXm" >&5
9239 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
9240
9241 xe_check_libs=" -lXm "
9242 cat > conftest.$ac_ext <<EOF
9243 #line 9244 "configure"
9244 #include "confdefs.h"
9245 /* Override any gcc2 internal prototype to avoid an error.  */
9246 /* We use char because int might match the return type of a gcc2
9247     builtin and then its argument prototype would still apply.  */
9248 char XmImMbLookupString();
9249
9250 int main() {
9251 XmImMbLookupString()
9252 ; return 0; }
9253 EOF
9254 if { (eval echo configure:9255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9255   rm -rf conftest*
9256   eval "ac_cv_lib_$ac_lib_var=yes"
9257 else
9258   echo "configure: failed program was:" >&5
9259   cat conftest.$ac_ext >&5
9260   rm -rf conftest*
9261   eval "ac_cv_lib_$ac_lib_var=no"
9262 fi
9263 rm -f conftest*
9264 xe_check_libs=""
9265
9266 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9267   echo "$ac_t""yes" 1>&6
9268   with_xim=motif
9269 else
9270   echo "$ac_t""no" 1>&6
9271 fi
9272
9273
9274     fi ;;
9275   esac
9276   if test "$with_xim" != "no"; then
9277     { test "$extra_verbose" = "yes" && cat << \EOF
9278     Defining HAVE_XIM
9279 EOF
9280 cat >> confdefs.h <<\EOF
9281 #define HAVE_XIM 1
9282 EOF
9283 }
9284
9285     if test "$with_xim" = "xlib"; then
9286       { test "$extra_verbose" = "yes" && cat << \EOF
9287     Defining XIM_XLIB
9288 EOF
9289 cat >> confdefs.h <<\EOF
9290 #define XIM_XLIB 1
9291 EOF
9292 }
9293
9294       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
9295    echo "    xemacs will be linked with \"input-method-xlib.o\""
9296  fi
9297     fi
9298     if test "$with_xim" = "motif"; then
9299       { test "$extra_verbose" = "yes" && cat << \EOF
9300     Defining XIM_MOTIF
9301 EOF
9302 cat >> confdefs.h <<\EOF
9303 #define XIM_MOTIF 1
9304 EOF
9305 }
9306
9307       need_motif=yes
9308       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
9309    echo "    xemacs will be linked with \"input-method-motif.o\""
9310  fi
9311     fi
9312     if test "$with_xim" = "motif"; then
9313       with_xfs=no
9314     fi
9315   fi
9316
9317     if test "$with_xfs" = "yes" ; then
9318     echo "checking for XFontSet" 1>&6
9319 echo "configure:9320: checking for XFontSet" >&5
9320     
9321 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
9322 echo "configure:9323: checking for XmbDrawString in -lX11" >&5
9323 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
9324
9325 xe_check_libs=" -lX11 "
9326 cat > conftest.$ac_ext <<EOF
9327 #line 9328 "configure"
9328 #include "confdefs.h"
9329 /* Override any gcc2 internal prototype to avoid an error.  */
9330 /* We use char because int might match the return type of a gcc2
9331     builtin and then its argument prototype would still apply.  */
9332 char XmbDrawString();
9333
9334 int main() {
9335 XmbDrawString()
9336 ; return 0; }
9337 EOF
9338 if { (eval echo configure:9339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9339   rm -rf conftest*
9340   eval "ac_cv_lib_$ac_lib_var=yes"
9341 else
9342   echo "configure: failed program was:" >&5
9343   cat conftest.$ac_ext >&5
9344   rm -rf conftest*
9345   eval "ac_cv_lib_$ac_lib_var=no"
9346 fi
9347 rm -f conftest*
9348 xe_check_libs=""
9349
9350 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9351   echo "$ac_t""yes" 1>&6
9352   :
9353 else
9354   echo "$ac_t""no" 1>&6
9355 with_xfs=no
9356 fi
9357
9358
9359     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
9360       { test "$extra_verbose" = "yes" && cat << \EOF
9361     Defining USE_XFONTSET
9362 EOF
9363 cat >> confdefs.h <<\EOF
9364 #define USE_XFONTSET 1
9365 EOF
9366 }
9367
9368       if test "$with_xim" = "no" ; then
9369         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
9370    echo "    xemacs will be linked with \"input-method-xfs.o\""
9371  fi
9372       fi
9373     fi
9374   fi 
9375     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
9376   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
9377 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
9378 echo "configure:9379: checking for wnn/jllib.h" >&5
9379
9380 cat > conftest.$ac_ext <<EOF
9381 #line 9382 "configure"
9382 #include "confdefs.h"
9383 #include <wnn/jllib.h>
9384 EOF
9385 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9386 { (eval echo configure:9387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9387 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9388 if test -z "$ac_err"; then
9389   rm -rf conftest*
9390   eval "ac_cv_header_$ac_safe=yes"
9391 else
9392   echo "$ac_err" >&5
9393   echo "configure: failed program was:" >&5
9394   cat conftest.$ac_ext >&5
9395   rm -rf conftest*
9396   eval "ac_cv_header_$ac_safe=no"
9397 fi
9398 rm -f conftest*
9399 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9400   echo "$ac_t""yes" 1>&6
9401   :
9402 else
9403   echo "$ac_t""no" 1>&6
9404 with_wnn=no
9405 fi
9406  }
9407     if test "$with_wnn" != "no"; then
9408     for ac_func in crypt
9409 do
9410 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9411 echo "configure:9412: checking for $ac_func" >&5
9412
9413 cat > conftest.$ac_ext <<EOF
9414 #line 9415 "configure"
9415 #include "confdefs.h"
9416 /* System header to define __stub macros and hopefully few prototypes,
9417     which can conflict with char $ac_func(); below.  */
9418 #include <assert.h>
9419 /* Override any gcc2 internal prototype to avoid an error.  */
9420 /* We use char because int might match the return type of a gcc2
9421     builtin and then its argument prototype would still apply.  */
9422 char $ac_func();
9423
9424 int main() {
9425
9426 /* The GNU C library defines this for functions which it implements
9427     to always fail with ENOSYS.  Some functions are actually named
9428     something starting with __ and the normal name is an alias.  */
9429 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9430 choke me
9431 #else
9432 $ac_func();
9433 #endif
9434
9435 ; return 0; }
9436 EOF
9437 if { (eval echo configure:9438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9438   rm -rf conftest*
9439   eval "ac_cv_func_$ac_func=yes"
9440 else
9441   echo "configure: failed program was:" >&5
9442   cat conftest.$ac_ext >&5
9443   rm -rf conftest*
9444   eval "ac_cv_func_$ac_func=no"
9445 fi
9446 rm -f conftest*
9447
9448 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9449   echo "$ac_t""yes" 1>&6
9450     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9451   { test "$extra_verbose" = "yes" && cat << EOF
9452     Defining $ac_tr_func
9453 EOF
9454 cat >> confdefs.h <<EOF
9455 #define $ac_tr_func 1
9456 EOF
9457 }
9458  
9459 else
9460   echo "$ac_t""no" 1>&6
9461 fi
9462 done
9463
9464     test "$ac_cv_func_crypt" != "yes" && { 
9465 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9466 echo "configure:9467: checking for crypt in -lcrypt" >&5
9467 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9468
9469 xe_check_libs=" -lcrypt "
9470 cat > conftest.$ac_ext <<EOF
9471 #line 9472 "configure"
9472 #include "confdefs.h"
9473 /* Override any gcc2 internal prototype to avoid an error.  */
9474 /* We use char because int might match the return type of a gcc2
9475     builtin and then its argument prototype would still apply.  */
9476 char crypt();
9477
9478 int main() {
9479 crypt()
9480 ; return 0; }
9481 EOF
9482 if { (eval echo configure:9483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9483   rm -rf conftest*
9484   eval "ac_cv_lib_$ac_lib_var=yes"
9485 else
9486   echo "configure: failed program was:" >&5
9487   cat conftest.$ac_ext >&5
9488   rm -rf conftest*
9489   eval "ac_cv_lib_$ac_lib_var=no"
9490 fi
9491 rm -f conftest*
9492 xe_check_libs=""
9493
9494 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9495   echo "$ac_t""yes" 1>&6
9496     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9497     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9498   { test "$extra_verbose" = "yes" && cat << EOF
9499     Defining $ac_tr_lib
9500 EOF
9501 cat >> confdefs.h <<EOF
9502 #define $ac_tr_lib 1
9503 EOF
9504 }
9505
9506   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
9507
9508 else
9509   echo "$ac_t""no" 1>&6
9510 fi
9511
9512  }
9513   fi
9514     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
9515     
9516 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
9517 echo "configure:9518: checking for jl_dic_list_e in -lwnn" >&5
9518 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9519
9520 xe_check_libs=" -lwnn "
9521 cat > conftest.$ac_ext <<EOF
9522 #line 9523 "configure"
9523 #include "confdefs.h"
9524 /* Override any gcc2 internal prototype to avoid an error.  */
9525 /* We use char because int might match the return type of a gcc2
9526     builtin and then its argument prototype would still apply.  */
9527 char jl_dic_list_e();
9528
9529 int main() {
9530 jl_dic_list_e()
9531 ; return 0; }
9532 EOF
9533 if { (eval echo configure:9534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9534   rm -rf conftest*
9535   eval "ac_cv_lib_$ac_lib_var=yes"
9536 else
9537   echo "configure: failed program was:" >&5
9538   cat conftest.$ac_ext >&5
9539   rm -rf conftest*
9540   eval "ac_cv_lib_$ac_lib_var=no"
9541 fi
9542 rm -f conftest*
9543 xe_check_libs=""
9544
9545 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9546   echo "$ac_t""yes" 1>&6
9547   libwnn=wnn
9548 else
9549   echo "$ac_t""no" 1>&6
9550 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
9551 echo "configure:9552: checking for jl_dic_list_e in -lwnn4" >&5
9552 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9553
9554 xe_check_libs=" -lwnn4 "
9555 cat > conftest.$ac_ext <<EOF
9556 #line 9557 "configure"
9557 #include "confdefs.h"
9558 /* Override any gcc2 internal prototype to avoid an error.  */
9559 /* We use char because int might match the return type of a gcc2
9560     builtin and then its argument prototype would still apply.  */
9561 char jl_dic_list_e();
9562
9563 int main() {
9564 jl_dic_list_e()
9565 ; return 0; }
9566 EOF
9567 if { (eval echo configure:9568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9568   rm -rf conftest*
9569   eval "ac_cv_lib_$ac_lib_var=yes"
9570 else
9571   echo "configure: failed program was:" >&5
9572   cat conftest.$ac_ext >&5
9573   rm -rf conftest*
9574   eval "ac_cv_lib_$ac_lib_var=no"
9575 fi
9576 rm -f conftest*
9577 xe_check_libs=""
9578
9579 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9580   echo "$ac_t""yes" 1>&6
9581   libwnn=wnn4
9582 else
9583   echo "$ac_t""no" 1>&6
9584 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
9585 echo "configure:9586: checking for jl_dic_list_e in -lwnn6" >&5
9586 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
9587
9588 xe_check_libs=" -lwnn6 "
9589 cat > conftest.$ac_ext <<EOF
9590 #line 9591 "configure"
9591 #include "confdefs.h"
9592 /* Override any gcc2 internal prototype to avoid an error.  */
9593 /* We use char because int might match the return type of a gcc2
9594     builtin and then its argument prototype would still apply.  */
9595 char jl_dic_list_e();
9596
9597 int main() {
9598 jl_dic_list_e()
9599 ; return 0; }
9600 EOF
9601 if { (eval echo configure:9602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9602   rm -rf conftest*
9603   eval "ac_cv_lib_$ac_lib_var=yes"
9604 else
9605   echo "configure: failed program was:" >&5
9606   cat conftest.$ac_ext >&5
9607   rm -rf conftest*
9608   eval "ac_cv_lib_$ac_lib_var=no"
9609 fi
9610 rm -f conftest*
9611 xe_check_libs=""
9612
9613 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9614   echo "$ac_t""yes" 1>&6
9615   libwnn=wnn6
9616 else
9617   echo "$ac_t""no" 1>&6
9618 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
9619 echo "configure:9620: checking for dic_list_e in -lwnn6_fromsrc" >&5
9620 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
9621
9622 xe_check_libs=" -lwnn6_fromsrc "
9623 cat > conftest.$ac_ext <<EOF
9624 #line 9625 "configure"
9625 #include "confdefs.h"
9626 /* Override any gcc2 internal prototype to avoid an error.  */
9627 /* We use char because int might match the return type of a gcc2
9628     builtin and then its argument prototype would still apply.  */
9629 char dic_list_e();
9630
9631 int main() {
9632 dic_list_e()
9633 ; return 0; }
9634 EOF
9635 if { (eval echo configure:9636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9636   rm -rf conftest*
9637   eval "ac_cv_lib_$ac_lib_var=yes"
9638 else
9639   echo "configure: failed program was:" >&5
9640   cat conftest.$ac_ext >&5
9641   rm -rf conftest*
9642   eval "ac_cv_lib_$ac_lib_var=no"
9643 fi
9644 rm -f conftest*
9645 xe_check_libs=""
9646
9647 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9648   echo "$ac_t""yes" 1>&6
9649   libwnn=wnn6_fromsrc
9650 else
9651   echo "$ac_t""no" 1>&6
9652 with_wnn=no
9653 fi
9654
9655
9656 fi
9657
9658
9659 fi
9660
9661
9662 fi
9663
9664
9665   fi
9666   test -z "$with_wnn" && with_wnn=yes
9667   if test "$with_wnn" = "yes"; then
9668     { test "$extra_verbose" = "yes" && cat << \EOF
9669     Defining HAVE_WNN
9670 EOF
9671 cat >> confdefs.h <<\EOF
9672 #define HAVE_WNN 1
9673 EOF
9674 }
9675
9676     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
9677     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
9678    echo "    xemacs will be linked with \"mule-wnnfns.o\""
9679  fi
9680     if test "$with_wnn6" != "no"; then
9681       
9682 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
9683 echo "configure:9684: checking for jl_fi_dic_list in -l$libwnn" >&5
9684 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
9685
9686 xe_check_libs=" -l$libwnn "
9687 cat > conftest.$ac_ext <<EOF
9688 #line 9689 "configure"
9689 #include "confdefs.h"
9690 /* Override any gcc2 internal prototype to avoid an error.  */
9691 /* We use char because int might match the return type of a gcc2
9692     builtin and then its argument prototype would still apply.  */
9693 char jl_fi_dic_list();
9694
9695 int main() {
9696 jl_fi_dic_list()
9697 ; return 0; }
9698 EOF
9699 if { (eval echo configure:9700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9700   rm -rf conftest*
9701   eval "ac_cv_lib_$ac_lib_var=yes"
9702 else
9703   echo "configure: failed program was:" >&5
9704   cat conftest.$ac_ext >&5
9705   rm -rf conftest*
9706   eval "ac_cv_lib_$ac_lib_var=no"
9707 fi
9708 rm -f conftest*
9709 xe_check_libs=""
9710
9711 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9712   echo "$ac_t""yes" 1>&6
9713   with_wnn6=yes
9714 else
9715   echo "$ac_t""no" 1>&6
9716 fi
9717
9718
9719       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9720     Defining WNN6
9721 EOF
9722 cat >> confdefs.h <<\EOF
9723 #define WNN6 1
9724 EOF
9725 }
9726
9727     fi
9728   fi
9729
9730     canna_includes_found=no
9731   if test "$with_canna" != "no"; then
9732     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
9733 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
9734 echo "configure:9735: checking for canna/jrkanji.h" >&5
9735
9736 cat > conftest.$ac_ext <<EOF
9737 #line 9738 "configure"
9738 #include "confdefs.h"
9739 #include <canna/jrkanji.h>
9740 EOF
9741 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9742 { (eval echo configure:9743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9743 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9744 if test -z "$ac_err"; then
9745   rm -rf conftest*
9746   eval "ac_cv_header_$ac_safe=yes"
9747 else
9748   echo "$ac_err" >&5
9749   echo "configure: failed program was:" >&5
9750   cat conftest.$ac_ext >&5
9751   rm -rf conftest*
9752   eval "ac_cv_header_$ac_safe=no"
9753 fi
9754 rm -f conftest*
9755 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9756   echo "$ac_t""yes" 1>&6
9757   canna_includes_found=yes
9758 else
9759   echo "$ac_t""no" 1>&6
9760 fi
9761
9762   fi
9763   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
9764       -d "/usr/local/canna/include"; then
9765     save_c_switch_site="$c_switch_site"
9766     c_switch_site="$c_switch_site -I/usr/local/canna/include"
9767     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
9768 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
9769 echo "configure:9770: checking for canna/jrkanji.h" >&5
9770
9771 cat > conftest.$ac_ext <<EOF
9772 #line 9773 "configure"
9773 #include "confdefs.h"
9774 #include <canna/jrkanji.h>
9775 EOF
9776 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9777 { (eval echo configure:9778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9778 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9779 if test -z "$ac_err"; then
9780   rm -rf conftest*
9781   eval "ac_cv_header_$ac_safe=yes"
9782 else
9783   echo "$ac_err" >&5
9784   echo "configure: failed program was:" >&5
9785   cat conftest.$ac_ext >&5
9786   rm -rf conftest*
9787   eval "ac_cv_header_$ac_safe=no"
9788 fi
9789 rm -f conftest*
9790 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9791   echo "$ac_t""yes" 1>&6
9792   canna_includes_found=yes
9793 else
9794   echo "$ac_t""no" 1>&6
9795 fi
9796
9797     if test "$canna_includes_found" != "yes"; then
9798       c_switch_site="$save_c_switch_site"
9799       with_canna="no"
9800     fi
9801   fi
9802
9803   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
9804 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
9805 echo "configure:9806: checking for canna/RK.h" >&5
9806
9807 cat > conftest.$ac_ext <<EOF
9808 #line 9809 "configure"
9809 #include "confdefs.h"
9810 #include <canna/RK.h>
9811 EOF
9812 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9813 { (eval echo configure:9814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9814 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9815 if test -z "$ac_err"; then
9816   rm -rf conftest*
9817   eval "ac_cv_header_$ac_safe=yes"
9818 else
9819   echo "$ac_err" >&5
9820   echo "configure: failed program was:" >&5
9821   cat conftest.$ac_ext >&5
9822   rm -rf conftest*
9823   eval "ac_cv_header_$ac_safe=no"
9824 fi
9825 rm -f conftest*
9826 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9827   echo "$ac_t""yes" 1>&6
9828   :
9829 else
9830   echo "$ac_t""no" 1>&6
9831 with_canna=no
9832 fi
9833  }
9834   test -z "$with_canna" && { 
9835 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
9836 echo "configure:9837: checking for RkBgnBun in -lRKC" >&5
9837 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
9838
9839 xe_check_libs=" -lRKC "
9840 cat > conftest.$ac_ext <<EOF
9841 #line 9842 "configure"
9842 #include "confdefs.h"
9843 /* Override any gcc2 internal prototype to avoid an error.  */
9844 /* We use char because int might match the return type of a gcc2
9845     builtin and then its argument prototype would still apply.  */
9846 char RkBgnBun();
9847
9848 int main() {
9849 RkBgnBun()
9850 ; return 0; }
9851 EOF
9852 if { (eval echo configure:9853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9853   rm -rf conftest*
9854   eval "ac_cv_lib_$ac_lib_var=yes"
9855 else
9856   echo "configure: failed program was:" >&5
9857   cat conftest.$ac_ext >&5
9858   rm -rf conftest*
9859   eval "ac_cv_lib_$ac_lib_var=no"
9860 fi
9861 rm -f conftest*
9862 xe_check_libs=""
9863
9864 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9865   echo "$ac_t""yes" 1>&6
9866   :
9867 else
9868   echo "$ac_t""no" 1>&6
9869 with_canna=no
9870 fi
9871
9872  }
9873   test -z "$with_canna" && { 
9874 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
9875 echo "configure:9876: checking for jrKanjiControl in -lcanna" >&5
9876 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
9877
9878 xe_check_libs=" -lcanna "
9879 cat > conftest.$ac_ext <<EOF
9880 #line 9881 "configure"
9881 #include "confdefs.h"
9882 /* Override any gcc2 internal prototype to avoid an error.  */
9883 /* We use char because int might match the return type of a gcc2
9884     builtin and then its argument prototype would still apply.  */
9885 char jrKanjiControl();
9886
9887 int main() {
9888 jrKanjiControl()
9889 ; return 0; }
9890 EOF
9891 if { (eval echo configure:9892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9892   rm -rf conftest*
9893   eval "ac_cv_lib_$ac_lib_var=yes"
9894 else
9895   echo "configure: failed program was:" >&5
9896   cat conftest.$ac_ext >&5
9897   rm -rf conftest*
9898   eval "ac_cv_lib_$ac_lib_var=no"
9899 fi
9900 rm -f conftest*
9901 xe_check_libs=""
9902
9903 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9904   echo "$ac_t""yes" 1>&6
9905   :
9906 else
9907   echo "$ac_t""no" 1>&6
9908 with_canna=no
9909 fi
9910
9911  }
9912   test -z "$with_canna" && with_canna=yes
9913   if test "$with_canna" = "yes"; then
9914     { test "$extra_verbose" = "yes" && cat << \EOF
9915     Defining HAVE_CANNA
9916 EOF
9917 cat >> confdefs.h <<\EOF
9918 #define HAVE_CANNA 1
9919 EOF
9920 }
9921
9922     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
9923     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
9924    echo "    xemacs will be linked with \"mule-canna.o\""
9925  fi
9926   fi
9927
9928 else   for feature in xim canna wnn; do
9929     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
9930       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
9931     fi
9932     eval "with_${feature}=no"
9933   done
9934 fi 
9935
9936 if test "$need_motif" = "yes" ; then
9937   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
9938     
9939 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
9940 echo "configure:9941: checking for layout_object_getvalue in -li18n" >&5
9941 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
9942
9943 xe_check_libs=" -li18n "
9944 cat > conftest.$ac_ext <<EOF
9945 #line 9946 "configure"
9946 #include "confdefs.h"
9947 /* Override any gcc2 internal prototype to avoid an error.  */
9948 /* We use char because int might match the return type of a gcc2
9949     builtin and then its argument prototype would still apply.  */
9950 char layout_object_getvalue();
9951
9952 int main() {
9953 layout_object_getvalue()
9954 ; return 0; }
9955 EOF
9956 if { (eval echo configure:9957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9957   rm -rf conftest*
9958   eval "ac_cv_lib_$ac_lib_var=yes"
9959 else
9960   echo "configure: failed program was:" >&5
9961   cat conftest.$ac_ext >&5
9962   rm -rf conftest*
9963   eval "ac_cv_lib_$ac_lib_var=no"
9964 fi
9965 rm -f conftest*
9966 xe_check_libs=""
9967
9968 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9969   echo "$ac_t""yes" 1>&6
9970   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
9971 else
9972   echo "$ac_t""no" 1>&6
9973 fi
9974
9975
9976   
9977 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
9978     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
9979   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
9980   
9981         runpath="" runpath_dirs=""
9982   if test -n "$LD_RUN_PATH"; then
9983     runpath="$LD_RUN_PATH"
9984   elif test "$GCC" = "yes"; then
9985         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
9986     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
9987     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
9988     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
9989       case "$arg" in P,* | -L* | -R* )
9990         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
9991           {
9992 xe_runpath_dir="$dir"
9993   test "$xe_runpath_dir" != "/lib"     -a \
9994         "$xe_runpath_dir" != "/usr/lib" -a \
9995         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
9996   eval "$xe_add_unique_runpath_dir"
9997 }
9998         done ;;
9999       esac
10000     done
10001     ld_switch_run="$ld_switch_run_save"
10002     rm -f conftest*
10003   else
10004         for arg in $ld_switch_site $ld_switch_x_site; do
10005       case "$arg" in -L*) {
10006 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
10007   test "$xe_runpath_dir" != "/lib"     -a \
10008         "$xe_runpath_dir" != "/usr/lib" -a \
10009         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
10010   eval "$xe_add_unique_runpath_dir"
10011 };; esac
10012     done
10013         if test "$opsys $need_motif" = "sol2 yes"; then
10014       xe_runpath_dir="/opt/SUNWdt/lib";
10015       eval "$xe_add_unique_runpath_dir";
10016     fi
10017   fi 
10018   if test -n "$runpath"; then
10019     ld_switch_run="${dash_r}${runpath}"
10020     
10021 if test "$GCC" = "yes"; then
10022   set x $ld_switch_run; shift; ld_switch_run=""
10023   while test -n "$1"; do
10024     case $1 in
10025       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
10026       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
10027       -Xlinker* ) ;;
10028       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
10029     esac
10030     shift
10031   done
10032 fi
10033     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
10034   fi
10035 fi
10036
10037 fi
10038
10039 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
10040 do
10041 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10042 echo "configure:10043: checking for $ac_func" >&5
10043
10044 cat > conftest.$ac_ext <<EOF
10045 #line 10046 "configure"
10046 #include "confdefs.h"
10047 /* System header to define __stub macros and hopefully few prototypes,
10048     which can conflict with char $ac_func(); below.  */
10049 #include <assert.h>
10050 /* Override any gcc2 internal prototype to avoid an error.  */
10051 /* We use char because int might match the return type of a gcc2
10052     builtin and then its argument prototype would still apply.  */
10053 char $ac_func();
10054
10055 int main() {
10056
10057 /* The GNU C library defines this for functions which it implements
10058     to always fail with ENOSYS.  Some functions are actually named
10059     something starting with __ and the normal name is an alias.  */
10060 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10061 choke me
10062 #else
10063 $ac_func();
10064 #endif
10065
10066 ; return 0; }
10067 EOF
10068 if { (eval echo configure:10069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10069   rm -rf conftest*
10070   eval "ac_cv_func_$ac_func=yes"
10071 else
10072   echo "configure: failed program was:" >&5
10073   cat conftest.$ac_ext >&5
10074   rm -rf conftest*
10075   eval "ac_cv_func_$ac_func=no"
10076 fi
10077 rm -f conftest*
10078
10079 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10080   echo "$ac_t""yes" 1>&6
10081     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10082   { test "$extra_verbose" = "yes" && cat << EOF
10083     Defining $ac_tr_func
10084 EOF
10085 cat >> confdefs.h <<EOF
10086 #define $ac_tr_func 1
10087 EOF
10088 }
10089  
10090 else
10091   echo "$ac_t""no" 1>&6
10092 fi
10093 done
10094
10095
10096 extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
10097    echo "    xemacs will be linked with \"realpath.o\""
10098  fi
10099
10100 for ac_func in getloadavg
10101 do
10102 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10103 echo "configure:10104: checking for $ac_func" >&5
10104
10105 cat > conftest.$ac_ext <<EOF
10106 #line 10107 "configure"
10107 #include "confdefs.h"
10108 /* System header to define __stub macros and hopefully few prototypes,
10109     which can conflict with char $ac_func(); below.  */
10110 #include <assert.h>
10111 /* Override any gcc2 internal prototype to avoid an error.  */
10112 /* We use char because int might match the return type of a gcc2
10113     builtin and then its argument prototype would still apply.  */
10114 char $ac_func();
10115
10116 int main() {
10117
10118 /* The GNU C library defines this for functions which it implements
10119     to always fail with ENOSYS.  Some functions are actually named
10120     something starting with __ and the normal name is an alias.  */
10121 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10122 choke me
10123 #else
10124 $ac_func();
10125 #endif
10126
10127 ; return 0; }
10128 EOF
10129 if { (eval echo configure:10130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10130   rm -rf conftest*
10131   eval "ac_cv_func_$ac_func=yes"
10132 else
10133   echo "configure: failed program was:" >&5
10134   cat conftest.$ac_ext >&5
10135   rm -rf conftest*
10136   eval "ac_cv_func_$ac_func=no"
10137 fi
10138 rm -f conftest*
10139
10140 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10141   echo "$ac_t""yes" 1>&6
10142     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10143   { test "$extra_verbose" = "yes" && cat << EOF
10144     Defining $ac_tr_func
10145 EOF
10146 cat >> confdefs.h <<EOF
10147 #define $ac_tr_func 1
10148 EOF
10149 }
10150  
10151 else
10152   echo "$ac_t""no" 1>&6
10153 fi
10154 done
10155
10156
10157 if test "$ac_cv_func_getloadavg" != "yes"
10158 then
10159   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
10160    echo "    xemacs will be linked with \"getloadavg.o\""
10161  fi
10162
10163     
10164 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
10165 echo "configure:10166: checking for kstat_open in -lkstat" >&5
10166 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
10167
10168 xe_check_libs=" -lkstat "
10169 cat > conftest.$ac_ext <<EOF
10170 #line 10171 "configure"
10171 #include "confdefs.h"
10172 /* Override any gcc2 internal prototype to avoid an error.  */
10173 /* We use char because int might match the return type of a gcc2
10174     builtin and then its argument prototype would still apply.  */
10175 char kstat_open();
10176
10177 int main() {
10178 kstat_open()
10179 ; return 0; }
10180 EOF
10181 if { (eval echo configure:10182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10182   rm -rf conftest*
10183   eval "ac_cv_lib_$ac_lib_var=yes"
10184 else
10185   echo "configure: failed program was:" >&5
10186   cat conftest.$ac_ext >&5
10187   rm -rf conftest*
10188   eval "ac_cv_lib_$ac_lib_var=no"
10189 fi
10190 rm -f conftest*
10191 xe_check_libs=""
10192
10193 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10194   echo "$ac_t""yes" 1>&6
10195     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10196     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10197   { test "$extra_verbose" = "yes" && cat << EOF
10198     Defining $ac_tr_lib
10199 EOF
10200 cat >> confdefs.h <<EOF
10201 #define $ac_tr_lib 1
10202 EOF
10203 }
10204
10205   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
10206
10207 else
10208   echo "$ac_t""no" 1>&6
10209 fi
10210
10211
10212
10213     
10214 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
10215 echo "configure:10216: checking for kvm_read in -lkvm" >&5
10216 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
10217
10218 xe_check_libs=" -lkvm "
10219 cat > conftest.$ac_ext <<EOF
10220 #line 10221 "configure"
10221 #include "confdefs.h"
10222 /* Override any gcc2 internal prototype to avoid an error.  */
10223 /* We use char because int might match the return type of a gcc2
10224     builtin and then its argument prototype would still apply.  */
10225 char kvm_read();
10226
10227 int main() {
10228 kvm_read()
10229 ; return 0; }
10230 EOF
10231 if { (eval echo configure:10232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10232   rm -rf conftest*
10233   eval "ac_cv_lib_$ac_lib_var=yes"
10234 else
10235   echo "configure: failed program was:" >&5
10236   cat conftest.$ac_ext >&5
10237   rm -rf conftest*
10238   eval "ac_cv_lib_$ac_lib_var=no"
10239 fi
10240 rm -f conftest*
10241 xe_check_libs=""
10242
10243 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10244   echo "$ac_t""yes" 1>&6
10245     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10246     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10247   { test "$extra_verbose" = "yes" && cat << EOF
10248     Defining $ac_tr_lib
10249 EOF
10250 cat >> confdefs.h <<EOF
10251 #define $ac_tr_lib 1
10252 EOF
10253 }
10254
10255   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
10256
10257 else
10258   echo "$ac_t""no" 1>&6
10259 fi
10260
10261
10262 fi
10263
10264 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
10265 echo "configure:10266: checking whether netdb declares h_errno" >&5
10266 cat > conftest.$ac_ext <<EOF
10267 #line 10268 "configure"
10268 #include "confdefs.h"
10269 #include <netdb.h>
10270 int main() {
10271 return h_errno;
10272 ; return 0; }
10273 EOF
10274 if { (eval echo configure:10275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10275   rm -rf conftest*
10276   echo "$ac_t""yes" 1>&6
10277    { test "$extra_verbose" = "yes" && cat << \EOF
10278     Defining HAVE_H_ERRNO
10279 EOF
10280 cat >> confdefs.h <<\EOF
10281 #define HAVE_H_ERRNO 1
10282 EOF
10283 }
10284
10285 else
10286   echo "configure: failed program was:" >&5
10287   cat conftest.$ac_ext >&5
10288   rm -rf conftest*
10289   echo "$ac_t""no" 1>&6
10290 fi
10291 rm -f conftest*
10292
10293 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
10294 echo "configure:10295: checking for sigsetjmp" >&5
10295 cat > conftest.$ac_ext <<EOF
10296 #line 10297 "configure"
10297 #include "confdefs.h"
10298 #include <setjmp.h>
10299 int main() {
10300 sigjmp_buf bar; sigsetjmp (bar, 0);
10301 ; return 0; }
10302 EOF
10303 if { (eval echo configure:10304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10304   rm -rf conftest*
10305   echo "$ac_t""yes" 1>&6
10306    { test "$extra_verbose" = "yes" && cat << \EOF
10307     Defining HAVE_SIGSETJMP
10308 EOF
10309 cat >> confdefs.h <<\EOF
10310 #define HAVE_SIGSETJMP 1
10311 EOF
10312 }
10313
10314 else
10315   echo "configure: failed program was:" >&5
10316   cat conftest.$ac_ext >&5
10317   rm -rf conftest*
10318   echo "$ac_t""no" 1>&6
10319 fi
10320 rm -f conftest*
10321
10322 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
10323 echo "configure:10324: checking whether localtime caches TZ" >&5
10324
10325 if test "$ac_cv_func_tzset" = "yes"; then
10326 cat > conftest.$ac_ext <<EOF
10327 #line 10328 "configure"
10328 #include "confdefs.h"
10329 #include <time.h>
10330 #if STDC_HEADERS
10331 # include <stdlib.h>
10332 #endif
10333 extern char **environ;
10334 unset_TZ ()
10335 {
10336   char **from, **to;
10337   for (to = from = environ; (*to = *from); from++)
10338     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
10339       to++;
10340 }
10341 char TZ_GMT0[] = "TZ=GMT0";
10342 char TZ_PST8[] = "TZ=PST8";
10343 main()
10344 {
10345   time_t now = time ((time_t *) 0);
10346   int hour_GMT0, hour_unset;
10347   if (putenv (TZ_GMT0) != 0)
10348     exit (1);
10349   hour_GMT0 = localtime (&now)->tm_hour;
10350   unset_TZ ();
10351   hour_unset = localtime (&now)->tm_hour;
10352   if (putenv (TZ_PST8) != 0)
10353     exit (1);
10354   if (localtime (&now)->tm_hour == hour_GMT0)
10355     exit (1);
10356   unset_TZ ();
10357   if (localtime (&now)->tm_hour != hour_unset)
10358     exit (1);
10359   exit (0);
10360 }
10361 EOF
10362 if { (eval echo configure:10363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10363 then
10364   emacs_cv_localtime_cache=no
10365 else
10366   conftest_rc="$?"
10367   echo "configure: failed program was:" >&5
10368   cat conftest.$ac_ext >&5
10369   rm -fr conftest*
10370   emacs_cv_localtime_cache=yes
10371 fi
10372 rm -fr conftest*
10373 else
10374         # If we lack tzset, report that localtime does not cache TZ,
10375         # since we can't invalidate the cache if we don't have tzset.
10376         emacs_cv_localtime_cache=no
10377 fi
10378 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
10379 if test $emacs_cv_localtime_cache = yes; then
10380   { test "$extra_verbose" = "yes" && cat << \EOF
10381     Defining LOCALTIME_CACHE
10382 EOF
10383 cat >> confdefs.h <<\EOF
10384 #define LOCALTIME_CACHE 1
10385 EOF
10386 }
10387
10388 fi
10389
10390 if test "$HAVE_TIMEVAL" = "yes"; then
10391 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
10392 echo "configure:10393: checking whether gettimeofday accepts one or two arguments" >&5
10393 cat > conftest.$ac_ext <<EOF
10394 #line 10395 "configure"
10395 #include "confdefs.h"
10396
10397 #ifdef TIME_WITH_SYS_TIME
10398 #include <sys/time.h>
10399 #include <time.h>
10400 #else
10401 #ifdef HAVE_SYS_TIME_H
10402 #include <sys/time.h>
10403 #else
10404 #include <time.h>
10405 #endif
10406 #endif
10407   
10408 int main() {
10409
10410   struct timeval time;
10411   gettimeofday (&time, 0);
10412
10413 ; return 0; }
10414 EOF
10415 if { (eval echo configure:10416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10416   rm -rf conftest*
10417   echo "$ac_t""two" 1>&6
10418 else
10419   echo "configure: failed program was:" >&5
10420   cat conftest.$ac_ext >&5
10421   rm -rf conftest*
10422   echo "$ac_t""one" 1>&6
10423    { test "$extra_verbose" = "yes" && cat << \EOF
10424     Defining GETTIMEOFDAY_ONE_ARGUMENT
10425 EOF
10426 cat >> confdefs.h <<\EOF
10427 #define GETTIMEOFDAY_ONE_ARGUMENT 1
10428 EOF
10429 }
10430
10431 fi
10432 rm -f conftest*
10433 fi
10434
10435
10436 echo $ac_n "checking for inline""... $ac_c" 1>&6
10437 echo "configure:10438: checking for inline" >&5
10438
10439 ac_cv_c_inline=no
10440 for ac_kw in inline __inline__ __inline; do
10441   cat > conftest.$ac_ext <<EOF
10442 #line 10443 "configure"
10443 #include "confdefs.h"
10444
10445 int main() {
10446 } int $ac_kw foo() {
10447 ; return 0; }
10448 EOF
10449 if { (eval echo configure:10450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10450   rm -rf conftest*
10451   ac_cv_c_inline=$ac_kw; break
10452 else
10453   echo "configure: failed program was:" >&5
10454   cat conftest.$ac_ext >&5
10455 fi
10456 rm -f conftest*
10457 done
10458
10459
10460 echo "$ac_t""$ac_cv_c_inline" 1>&6
10461 case "$ac_cv_c_inline" in
10462   inline | yes) ;;
10463   no) { test "$extra_verbose" = "yes" && cat << \EOF
10464     Defining inline = 
10465 EOF
10466 cat >> confdefs.h <<\EOF
10467 #define inline 
10468 EOF
10469 }
10470  ;;
10471   *)  { test "$extra_verbose" = "yes" && cat << EOF
10472     Defining inline = $ac_cv_c_inline
10473 EOF
10474 cat >> confdefs.h <<EOF
10475 #define inline $ac_cv_c_inline
10476 EOF
10477 }
10478  ;;
10479 esac
10480
10481 test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
10482    echo "    xemacs will be linked with \"inline.o\""
10483  fi
10484
10485
10486 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
10487 # for constant arguments.  Useless!
10488 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
10489 echo "configure:10490: checking for working alloca.h" >&5
10490
10491 cat > conftest.$ac_ext <<EOF
10492 #line 10493 "configure"
10493 #include "confdefs.h"
10494 #include <alloca.h>
10495 int main() {
10496 void *p = alloca(2 * sizeof(int));
10497 ; return 0; }
10498 EOF
10499 if { (eval echo configure:10500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10500   rm -rf conftest*
10501   ac_cv_header_alloca_h=yes
10502 else
10503   echo "configure: failed program was:" >&5
10504   cat conftest.$ac_ext >&5
10505   rm -rf conftest*
10506   ac_cv_header_alloca_h=no
10507 fi
10508 rm -f conftest*
10509
10510 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
10511 if test $ac_cv_header_alloca_h = yes; then
10512   { test "$extra_verbose" = "yes" && cat << \EOF
10513     Defining HAVE_ALLOCA_H
10514 EOF
10515 cat >> confdefs.h <<\EOF
10516 #define HAVE_ALLOCA_H 1
10517 EOF
10518 }
10519
10520 fi
10521
10522 echo $ac_n "checking for alloca""... $ac_c" 1>&6
10523 echo "configure:10524: checking for alloca" >&5
10524
10525 cat > conftest.$ac_ext <<EOF
10526 #line 10527 "configure"
10527 #include "confdefs.h"
10528
10529 #ifdef __GNUC__
10530 # define alloca __builtin_alloca
10531 #else
10532 # ifdef _MSC_VER
10533 #  include <malloc.h>
10534 #  define alloca _alloca
10535 # else
10536 #  if HAVE_ALLOCA_H
10537 #   include <alloca.h>
10538 #  else
10539 #   ifdef _AIX
10540  #pragma alloca
10541 #   else
10542 #    ifndef alloca /* predefined by HP cc +Olibcalls */
10543 char *alloca ();
10544 #    endif
10545 #   endif
10546 #  endif
10547 # endif
10548 #endif
10549
10550 int main() {
10551 char *p = (char *) alloca(1);
10552 ; return 0; }
10553 EOF
10554 if { (eval echo configure:10555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10555   rm -rf conftest*
10556   ac_cv_func_alloca_works=yes
10557 else
10558   echo "configure: failed program was:" >&5
10559   cat conftest.$ac_ext >&5
10560   rm -rf conftest*
10561   ac_cv_func_alloca_works=no
10562 fi
10563 rm -f conftest*
10564
10565 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
10566 if test $ac_cv_func_alloca_works = yes; then
10567   { test "$extra_verbose" = "yes" && cat << \EOF
10568     Defining HAVE_ALLOCA
10569 EOF
10570 cat >> confdefs.h <<\EOF
10571 #define HAVE_ALLOCA 1
10572 EOF
10573 }
10574
10575 fi
10576
10577 if test $ac_cv_func_alloca_works = no; then
10578   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
10579   # that cause trouble.  Some versions do not even contain alloca or
10580   # contain a buggy version.  If you still want to use their alloca,
10581   # use ar to extract alloca.o from them instead of compiling alloca.c.
10582   ALLOCA=alloca.${ac_objext}
10583   { test "$extra_verbose" = "yes" && cat << \EOF
10584     Defining C_ALLOCA
10585 EOF
10586 cat >> confdefs.h <<\EOF
10587 #define C_ALLOCA 1
10588 EOF
10589 }
10590
10591
10592 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
10593 echo "configure:10594: checking whether alloca needs Cray hooks" >&5
10594
10595 cat > conftest.$ac_ext <<EOF
10596 #line 10597 "configure"
10597 #include "confdefs.h"
10598 #if defined(CRAY) && ! defined(CRAY2)
10599 webecray
10600 #else
10601 wenotbecray
10602 #endif
10603
10604 EOF
10605 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10606   egrep "webecray" >/dev/null 2>&1; then
10607   rm -rf conftest*
10608   ac_cv_os_cray=yes
10609 else
10610   rm -rf conftest*
10611   ac_cv_os_cray=no
10612 fi
10613 rm -f conftest*
10614
10615
10616 echo "$ac_t""$ac_cv_os_cray" 1>&6
10617 if test $ac_cv_os_cray = yes; then
10618 for ac_func in _getb67 GETB67 getb67; do
10619   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10620 echo "configure:10621: checking for $ac_func" >&5
10621
10622 cat > conftest.$ac_ext <<EOF
10623 #line 10624 "configure"
10624 #include "confdefs.h"
10625 /* System header to define __stub macros and hopefully few prototypes,
10626     which can conflict with char $ac_func(); below.  */
10627 #include <assert.h>
10628 /* Override any gcc2 internal prototype to avoid an error.  */
10629 /* We use char because int might match the return type of a gcc2
10630     builtin and then its argument prototype would still apply.  */
10631 char $ac_func();
10632
10633 int main() {
10634
10635 /* The GNU C library defines this for functions which it implements
10636     to always fail with ENOSYS.  Some functions are actually named
10637     something starting with __ and the normal name is an alias.  */
10638 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10639 choke me
10640 #else
10641 $ac_func();
10642 #endif
10643
10644 ; return 0; }
10645 EOF
10646 if { (eval echo configure:10647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10647   rm -rf conftest*
10648   eval "ac_cv_func_$ac_func=yes"
10649 else
10650   echo "configure: failed program was:" >&5
10651   cat conftest.$ac_ext >&5
10652   rm -rf conftest*
10653   eval "ac_cv_func_$ac_func=no"
10654 fi
10655 rm -f conftest*
10656
10657 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10658   echo "$ac_t""yes" 1>&6
10659   { test "$extra_verbose" = "yes" && cat << EOF
10660     Defining CRAY_STACKSEG_END = $ac_func
10661 EOF
10662 cat >> confdefs.h <<EOF
10663 #define CRAY_STACKSEG_END $ac_func
10664 EOF
10665 }
10666
10667   break
10668 else
10669   echo "$ac_t""no" 1>&6
10670 fi
10671
10672 done
10673 fi
10674
10675 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
10676 echo "configure:10677: checking stack direction for C alloca" >&5
10677
10678 cat > conftest.$ac_ext <<EOF
10679 #line 10680 "configure"
10680 #include "confdefs.h"
10681 find_stack_direction ()
10682 {
10683   static char *addr = 0;
10684   auto char dummy;
10685   if (addr == 0)
10686     {
10687       addr = &dummy;
10688       return find_stack_direction ();
10689     }
10690   else
10691     return (&dummy > addr) ? 1 : -1;
10692 }
10693 main ()
10694 {
10695   exit (find_stack_direction() < 0);
10696 }
10697 EOF
10698 if { (eval echo configure:10699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10699 then
10700   ac_cv_c_stack_direction=1
10701 else
10702   conftest_rc="$?"
10703   echo "configure: failed program was:" >&5
10704   cat conftest.$ac_ext >&5
10705   rm -fr conftest*
10706   ac_cv_c_stack_direction=-1
10707 fi
10708 rm -fr conftest*
10709
10710 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
10711 { test "$extra_verbose" = "yes" && cat << EOF
10712     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
10713 EOF
10714 cat >> confdefs.h <<EOF
10715 #define STACK_DIRECTION $ac_cv_c_stack_direction
10716 EOF
10717 }
10718
10719 fi
10720
10721 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
10722    echo "    xemacs will be linked with \"$ALLOCA\""
10723  fi
10724
10725 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
10726 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
10727 echo "configure:10728: checking for vfork.h" >&5
10728
10729 cat > conftest.$ac_ext <<EOF
10730 #line 10731 "configure"
10731 #include "confdefs.h"
10732 #include <vfork.h>
10733 EOF
10734 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10735 { (eval echo configure:10736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10736 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10737 if test -z "$ac_err"; then
10738   rm -rf conftest*
10739   eval "ac_cv_header_$ac_safe=yes"
10740 else
10741   echo "$ac_err" >&5
10742   echo "configure: failed program was:" >&5
10743   cat conftest.$ac_ext >&5
10744   rm -rf conftest*
10745   eval "ac_cv_header_$ac_safe=no"
10746 fi
10747 rm -f conftest*
10748 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10749   echo "$ac_t""yes" 1>&6
10750   { test "$extra_verbose" = "yes" && cat << \EOF
10751     Defining HAVE_VFORK_H
10752 EOF
10753 cat >> confdefs.h <<\EOF
10754 #define HAVE_VFORK_H 1
10755 EOF
10756 }
10757
10758 else
10759   echo "$ac_t""no" 1>&6
10760 fi
10761
10762 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
10763 echo "configure:10764: checking for working vfork" >&5
10764
10765 cat > conftest.$ac_ext <<EOF
10766 #line 10767 "configure"
10767 #include "confdefs.h"
10768 /* Thanks to Paul Eggert for this test.  */
10769 #include <stdio.h>
10770 #include <sys/types.h>
10771 #include <sys/stat.h>
10772 #ifdef HAVE_UNISTD_H
10773 #include <unistd.h>
10774 #endif
10775 #ifdef HAVE_VFORK_H
10776 #include <vfork.h>
10777 #endif
10778 /* On some sparc systems, changes by the child to local and incoming
10779    argument registers are propagated back to the parent.
10780    The compiler is told about this with #include <vfork.h>,
10781    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
10782    Test for this by using a static variable whose address
10783    is put into a register that is clobbered by the vfork.  */
10784 static
10785 #ifdef __cplusplus
10786 sparc_address_test (int arg)
10787 #else
10788 sparc_address_test (arg) int arg;
10789 #endif
10790 {
10791   static pid_t child;
10792   if (!child) {
10793     child = vfork ();
10794     if (child < 0) {
10795       perror ("vfork");
10796       _exit(2);
10797     }
10798     if (!child) {
10799       arg = getpid();
10800       write(-1, "", 0);
10801       _exit (arg);
10802     }
10803   }
10804 }
10805 main() {
10806   pid_t parent = getpid ();
10807   pid_t child;
10808
10809   sparc_address_test ();
10810
10811   child = vfork ();
10812
10813   if (child == 0) {
10814     /* Here is another test for sparc vfork register problems.
10815        This test uses lots of local variables, at least
10816        as many local variables as main has allocated so far
10817        including compiler temporaries.  4 locals are enough for
10818        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
10819        A buggy compiler should reuse the register of parent
10820        for one of the local variables, since it will think that
10821        parent can't possibly be used any more in this routine.
10822        Assigning to the local variable will thus munge parent
10823        in the parent process.  */
10824     pid_t
10825       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
10826       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
10827     /* Convince the compiler that p..p7 are live; otherwise, it might
10828        use the same hardware register for all 8 local variables.  */
10829     if (p != p1 || p != p2 || p != p3 || p != p4
10830         || p != p5 || p != p6 || p != p7)
10831       _exit(1);
10832
10833     /* On some systems (e.g. IRIX 3.3),
10834        vfork doesn't separate parent from child file descriptors.
10835        If the child closes a descriptor before it execs or exits,
10836        this munges the parent's descriptor as well.
10837        Test for this by closing stdout in the child.  */
10838     _exit(close(fileno(stdout)) != 0);
10839   } else {
10840     int status;
10841     struct stat st;
10842
10843     while (wait(&status) != child)
10844       ;
10845     exit(
10846          /* Was there some problem with vforking?  */
10847          child < 0
10848
10849          /* Did the child fail?  (This shouldn't happen.)  */
10850          || status
10851
10852          /* Did the vfork/compiler bug occur?  */
10853          || parent != getpid()
10854
10855          /* Did the file descriptor bug occur?  */
10856          || fstat(fileno(stdout), &st) != 0
10857          );
10858   }
10859 }
10860 EOF
10861 if { (eval echo configure:10862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10862 then
10863   ac_cv_func_vfork_works=yes
10864 else
10865   conftest_rc="$?"
10866   echo "configure: failed program was:" >&5
10867   cat conftest.$ac_ext >&5
10868   rm -fr conftest*
10869   ac_cv_func_vfork_works=no
10870 fi
10871 rm -fr conftest*
10872
10873 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
10874 if test $ac_cv_func_vfork_works = no; then
10875   { test "$extra_verbose" = "yes" && cat << \EOF
10876     Defining vfork = fork
10877 EOF
10878 cat >> confdefs.h <<\EOF
10879 #define vfork fork
10880 EOF
10881 }
10882
10883 fi
10884
10885
10886 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
10887 echo "configure:10888: checking for working strcoll" >&5
10888
10889 cat > conftest.$ac_ext <<EOF
10890 #line 10891 "configure"
10891 #include "confdefs.h"
10892 #include <string.h>
10893 main ()
10894 {
10895   exit (strcoll ("abc", "def") >= 0 ||
10896         strcoll ("ABC", "DEF") >= 0 ||
10897         strcoll ("123", "456") >= 0);
10898 }
10899 EOF
10900 if { (eval echo configure:10901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10901 then
10902   ac_cv_func_strcoll_works=yes
10903 else
10904   conftest_rc="$?"
10905   echo "configure: failed program was:" >&5
10906   cat conftest.$ac_ext >&5
10907   rm -fr conftest*
10908   ac_cv_func_strcoll_works=no
10909 fi
10910 rm -fr conftest*
10911
10912 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
10913 if test $ac_cv_func_strcoll_works = yes; then
10914   { test "$extra_verbose" = "yes" && cat << \EOF
10915     Defining HAVE_STRCOLL
10916 EOF
10917 cat >> confdefs.h <<\EOF
10918 #define HAVE_STRCOLL 1
10919 EOF
10920 }
10921
10922 fi
10923
10924
10925 for ac_func in getpgrp
10926 do
10927 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10928 echo "configure:10929: checking for $ac_func" >&5
10929
10930 cat > conftest.$ac_ext <<EOF
10931 #line 10932 "configure"
10932 #include "confdefs.h"
10933 /* System header to define __stub macros and hopefully few prototypes,
10934     which can conflict with char $ac_func(); below.  */
10935 #include <assert.h>
10936 /* Override any gcc2 internal prototype to avoid an error.  */
10937 /* We use char because int might match the return type of a gcc2
10938     builtin and then its argument prototype would still apply.  */
10939 char $ac_func();
10940
10941 int main() {
10942
10943 /* The GNU C library defines this for functions which it implements
10944     to always fail with ENOSYS.  Some functions are actually named
10945     something starting with __ and the normal name is an alias.  */
10946 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10947 choke me
10948 #else
10949 $ac_func();
10950 #endif
10951
10952 ; return 0; }
10953 EOF
10954 if { (eval echo configure:10955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10955   rm -rf conftest*
10956   eval "ac_cv_func_$ac_func=yes"
10957 else
10958   echo "configure: failed program was:" >&5
10959   cat conftest.$ac_ext >&5
10960   rm -rf conftest*
10961   eval "ac_cv_func_$ac_func=no"
10962 fi
10963 rm -f conftest*
10964
10965 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10966   echo "$ac_t""yes" 1>&6
10967     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10968   { test "$extra_verbose" = "yes" && cat << EOF
10969     Defining $ac_tr_func
10970 EOF
10971 cat >> confdefs.h <<EOF
10972 #define $ac_tr_func 1
10973 EOF
10974 }
10975  
10976 else
10977   echo "$ac_t""no" 1>&6
10978 fi
10979 done
10980
10981 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
10982 echo "configure:10983: checking whether getpgrp takes no argument" >&5
10983
10984 cat > conftest.$ac_ext <<EOF
10985 #line 10986 "configure"
10986 #include "confdefs.h"
10987
10988 /*
10989  * If this system has a BSD-style getpgrp(),
10990  * which takes a pid argument, exit unsuccessfully.
10991  *
10992  * Snarfed from Chet Ramey's bash pgrp.c test program
10993  */
10994 #include <stdio.h>
10995 #include <sys/types.h>
10996
10997 int     pid;
10998 int     pg1, pg2, pg3, pg4;
10999 int     ng, np, s, child;
11000
11001 main()
11002 {
11003         pid = getpid();
11004         pg1 = getpgrp(0);
11005         pg2 = getpgrp();
11006         pg3 = getpgrp(pid);
11007         pg4 = getpgrp(1);
11008
11009         /*
11010          * If all of these values are the same, it's pretty sure that
11011          * we're on a system that ignores getpgrp's first argument.
11012          */
11013         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
11014                 exit(0);
11015
11016         child = fork();
11017         if (child < 0)
11018                 exit(1);
11019         else if (child == 0) {
11020                 np = getpid();
11021                 /*
11022                  * If this is Sys V, this will not work; pgrp will be
11023                  * set to np because setpgrp just changes a pgrp to be
11024                  * the same as the pid.
11025                  */
11026                 setpgrp(np, pg1);
11027                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
11028                 if (ng == pg1) {
11029                         exit(1);
11030                 } else {
11031                         exit(0);
11032                 }
11033         } else {
11034                 wait(&s);
11035                 exit(s>>8);
11036         }
11037 }
11038
11039 EOF
11040 if { (eval echo configure:11041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11041 then
11042   ac_cv_func_getpgrp_void=yes
11043 else
11044   conftest_rc="$?"
11045   echo "configure: failed program was:" >&5
11046   cat conftest.$ac_ext >&5
11047   rm -fr conftest*
11048   ac_cv_func_getpgrp_void=no
11049 fi
11050 rm -fr conftest*
11051
11052
11053 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
11054 if test $ac_cv_func_getpgrp_void = yes; then
11055   { test "$extra_verbose" = "yes" && cat << \EOF
11056     Defining GETPGRP_VOID
11057 EOF
11058 cat >> confdefs.h <<\EOF
11059 #define GETPGRP_VOID 1
11060 EOF
11061 }
11062
11063 fi
11064
11065
11066 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
11067 echo "configure:11068: checking for working mmap" >&5
11068 case "$opsys" in ultrix* ) have_mmap=no ;; *)
11069 cat > conftest.$ac_ext <<EOF
11070 #line 11071 "configure"
11071 #include "confdefs.h"
11072 #include <stdio.h>
11073 #include <unistd.h>
11074 #include <fcntl.h>
11075 #include <sys/mman.h>
11076
11077 #ifndef MAP_VARIABLE
11078 #define MAP_VARIABLE 0
11079 #endif
11080
11081 #ifndef MAP_FAILED
11082 #define MAP_FAILED -1
11083 #endif
11084
11085 int main (int argc, char *argv[])
11086 {
11087   int fd = -1;
11088   caddr_t p;
11089 #ifndef MAP_ANONYMOUS
11090   fd = open ("/dev/zero", O_RDWR);
11091   if (fd < 0)
11092     return 1;
11093 #define MAP_ANONYMOUS 0
11094 #endif
11095   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
11096            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
11097            fd, 0) != (void *) MAP_FAILED)
11098     return 0;
11099   perror ("conftest: mmap failed");
11100   return 1;
11101 }
11102 EOF
11103 if { (eval echo configure:11104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11104 then
11105   have_mmap=yes
11106 else
11107   conftest_rc="$?"
11108   echo "configure: failed program was:" >&5
11109   cat conftest.$ac_ext >&5
11110   rm -fr conftest*
11111   have_mmap=no
11112 fi
11113 rm -fr conftest* ;;
11114 esac
11115 echo "$ac_t""$have_mmap" 1>&6
11116 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
11117     Defining HAVE_MMAP
11118 EOF
11119 cat >> confdefs.h <<\EOF
11120 #define HAVE_MMAP 1
11121 EOF
11122 }
11123
11124
11125 test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no
11126 if test "$rel_alloc $have_mmap" = "default yes"; then
11127   if test "$doug_lea_malloc" = "yes"; then
11128         echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6
11129 echo "configure:11130: checking for M_MMAP_THRESHOLD" >&5
11130     cat > conftest.$ac_ext <<EOF
11131 #line 11132 "configure"
11132 #include "confdefs.h"
11133 #include <malloc.h>
11134 int main() {
11135
11136 #ifndef M_MMAP_THRESHOLD
11137 #error No M_MMAP_THRESHOLD :-(
11138 !@+$%^&*_)(_ - unlikely to compile...
11139 #endif
11140
11141 ; return 0; }
11142 EOF
11143 if { (eval echo configure:11144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11144   rm -rf conftest*
11145   rel_alloc=no; echo "$ac_t""yes" 1>&6;
11146 else
11147   echo "configure: failed program was:" >&5
11148   cat conftest.$ac_ext >&5
11149   rm -rf conftest*
11150   rel_alloc=yes; echo "$ac_t""no" 1>&6;
11151 fi
11152 rm -f conftest*
11153   else
11154     rel_alloc=yes
11155   fi
11156 fi
11157 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
11158     Defining REL_ALLOC
11159 EOF
11160 cat >> confdefs.h <<\EOF
11161 #define REL_ALLOC 1
11162 EOF
11163 }
11164
11165
11166 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
11167 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
11168 echo "configure:11169: checking for termios.h" >&5
11169
11170 cat > conftest.$ac_ext <<EOF
11171 #line 11172 "configure"
11172 #include "confdefs.h"
11173 #include <termios.h>
11174 EOF
11175 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11176 { (eval echo configure:11177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11177 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11178 if test -z "$ac_err"; then
11179   rm -rf conftest*
11180   eval "ac_cv_header_$ac_safe=yes"
11181 else
11182   echo "$ac_err" >&5
11183   echo "configure: failed program was:" >&5
11184   cat conftest.$ac_ext >&5
11185   rm -rf conftest*
11186   eval "ac_cv_header_$ac_safe=no"
11187 fi
11188 rm -f conftest*
11189 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11190   echo "$ac_t""yes" 1>&6
11191   { test "$extra_verbose" = "yes" && cat << \EOF
11192     Defining HAVE_TERMIOS
11193 EOF
11194 cat >> confdefs.h <<\EOF
11195 #define HAVE_TERMIOS 1
11196 EOF
11197 }
11198
11199   { test "$extra_verbose" = "yes" && cat << \EOF
11200     Defining SIGNALS_VIA_CHARACTERS
11201 EOF
11202 cat >> confdefs.h <<\EOF
11203 #define SIGNALS_VIA_CHARACTERS 1
11204 EOF
11205 }
11206
11207   { test "$extra_verbose" = "yes" && cat << \EOF
11208     Defining NO_TERMIO
11209 EOF
11210 cat >> confdefs.h <<\EOF
11211 #define NO_TERMIO 1
11212 EOF
11213 }
11214
11215 else
11216   echo "$ac_t""no" 1>&6
11217 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
11218 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
11219 echo "configure:11220: checking for termio.h" >&5
11220
11221 cat > conftest.$ac_ext <<EOF
11222 #line 11223 "configure"
11223 #include "confdefs.h"
11224 #include <termio.h>
11225 EOF
11226 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11227 { (eval echo configure:11228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11228 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11229 if test -z "$ac_err"; then
11230   rm -rf conftest*
11231   eval "ac_cv_header_$ac_safe=yes"
11232 else
11233   echo "$ac_err" >&5
11234   echo "configure: failed program was:" >&5
11235   cat conftest.$ac_ext >&5
11236   rm -rf conftest*
11237   eval "ac_cv_header_$ac_safe=no"
11238 fi
11239 rm -f conftest*
11240 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11241   echo "$ac_t""yes" 1>&6
11242   { test "$extra_verbose" = "yes" && cat << \EOF
11243     Defining HAVE_TERMIO
11244 EOF
11245 cat >> confdefs.h <<\EOF
11246 #define HAVE_TERMIO 1
11247 EOF
11248 }
11249
11250 else
11251   echo "$ac_t""no" 1>&6
11252 fi
11253
11254 fi
11255
11256
11257
11258 echo $ac_n "checking for socket""... $ac_c" 1>&6
11259 echo "configure:11260: checking for socket" >&5
11260
11261 cat > conftest.$ac_ext <<EOF
11262 #line 11263 "configure"
11263 #include "confdefs.h"
11264 /* System header to define __stub macros and hopefully few prototypes,
11265     which can conflict with char socket(); below.  */
11266 #include <assert.h>
11267 /* Override any gcc2 internal prototype to avoid an error.  */
11268 /* We use char because int might match the return type of a gcc2
11269     builtin and then its argument prototype would still apply.  */
11270 char socket();
11271
11272 int main() {
11273
11274 /* The GNU C library defines this for functions which it implements
11275     to always fail with ENOSYS.  Some functions are actually named
11276     something starting with __ and the normal name is an alias.  */
11277 #if defined (__stub_socket) || defined (__stub___socket)
11278 choke me
11279 #else
11280 socket();
11281 #endif
11282
11283 ; return 0; }
11284 EOF
11285 if { (eval echo configure:11286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11286   rm -rf conftest*
11287   eval "ac_cv_func_socket=yes"
11288 else
11289   echo "configure: failed program was:" >&5
11290   cat conftest.$ac_ext >&5
11291   rm -rf conftest*
11292   eval "ac_cv_func_socket=no"
11293 fi
11294 rm -f conftest*
11295
11296 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
11297   echo "$ac_t""yes" 1>&6
11298   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
11299 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
11300 echo "configure:11301: checking for netinet/in.h" >&5
11301
11302 cat > conftest.$ac_ext <<EOF
11303 #line 11304 "configure"
11304 #include "confdefs.h"
11305 #include <netinet/in.h>
11306 EOF
11307 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11308 { (eval echo configure:11309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11309 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11310 if test -z "$ac_err"; then
11311   rm -rf conftest*
11312   eval "ac_cv_header_$ac_safe=yes"
11313 else
11314   echo "$ac_err" >&5
11315   echo "configure: failed program was:" >&5
11316   cat conftest.$ac_ext >&5
11317   rm -rf conftest*
11318   eval "ac_cv_header_$ac_safe=no"
11319 fi
11320 rm -f conftest*
11321 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11322   echo "$ac_t""yes" 1>&6
11323   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
11324 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
11325 echo "configure:11326: checking for arpa/inet.h" >&5
11326
11327 cat > conftest.$ac_ext <<EOF
11328 #line 11329 "configure"
11329 #include "confdefs.h"
11330 #include <arpa/inet.h>
11331 EOF
11332 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11333 { (eval echo configure:11334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11334 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11335 if test -z "$ac_err"; then
11336   rm -rf conftest*
11337   eval "ac_cv_header_$ac_safe=yes"
11338 else
11339   echo "$ac_err" >&5
11340   echo "configure: failed program was:" >&5
11341   cat conftest.$ac_ext >&5
11342   rm -rf conftest*
11343   eval "ac_cv_header_$ac_safe=no"
11344 fi
11345 rm -f conftest*
11346 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11347   echo "$ac_t""yes" 1>&6
11348   
11349   { test "$extra_verbose" = "yes" && cat << \EOF
11350     Defining HAVE_SOCKETS
11351 EOF
11352 cat >> confdefs.h <<\EOF
11353 #define HAVE_SOCKETS 1
11354 EOF
11355 }
11356
11357       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
11358 echo "configure:11359: checking "for sun_len member in struct sockaddr_un"" >&5
11359       cat > conftest.$ac_ext <<EOF
11360 #line 11361 "configure"
11361 #include "confdefs.h"
11362
11363 #include <sys/types.h>
11364 #include <sys/socket.h>
11365 #include <sys/un.h>
11366       
11367 int main() {
11368 static struct sockaddr_un x; x.sun_len = 1;
11369 ; return 0; }
11370 EOF
11371 if { (eval echo configure:11372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11372   rm -rf conftest*
11373   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
11374     Defining HAVE_SOCKADDR_SUN_LEN
11375 EOF
11376 cat >> confdefs.h <<\EOF
11377 #define HAVE_SOCKADDR_SUN_LEN 1
11378 EOF
11379 }
11380
11381 else
11382   echo "configure: failed program was:" >&5
11383   cat conftest.$ac_ext >&5
11384   rm -rf conftest*
11385   echo "$ac_t""no" 1>&6
11386 fi
11387 rm -f conftest*
11388       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
11389 echo "configure:11390: checking "for ip_mreq struct in netinet/in.h"" >&5
11390       cat > conftest.$ac_ext <<EOF
11391 #line 11392 "configure"
11392 #include "confdefs.h"
11393
11394 #include <sys/types.h>
11395 #include <netinet/in.h>
11396       
11397 int main() {
11398 static struct ip_mreq x;
11399 ; return 0; }
11400 EOF
11401 if { (eval echo configure:11402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11402   rm -rf conftest*
11403   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
11404     Defining HAVE_MULTICAST
11405 EOF
11406 cat >> confdefs.h <<\EOF
11407 #define HAVE_MULTICAST 1
11408 EOF
11409 }
11410
11411 else
11412   echo "configure: failed program was:" >&5
11413   cat conftest.$ac_ext >&5
11414   rm -rf conftest*
11415   echo "$ac_t""no" 1>&6
11416 fi
11417 rm -f conftest*
11418 else
11419   echo "$ac_t""no" 1>&6
11420 fi
11421
11422 else
11423   echo "$ac_t""no" 1>&6
11424 fi
11425
11426 else
11427   echo "$ac_t""no" 1>&6
11428 fi
11429
11430
11431 echo $ac_n "checking for msgget""... $ac_c" 1>&6
11432 echo "configure:11433: checking for msgget" >&5
11433
11434 cat > conftest.$ac_ext <<EOF
11435 #line 11436 "configure"
11436 #include "confdefs.h"
11437 /* System header to define __stub macros and hopefully few prototypes,
11438     which can conflict with char msgget(); below.  */
11439 #include <assert.h>
11440 /* Override any gcc2 internal prototype to avoid an error.  */
11441 /* We use char because int might match the return type of a gcc2
11442     builtin and then its argument prototype would still apply.  */
11443 char msgget();
11444
11445 int main() {
11446
11447 /* The GNU C library defines this for functions which it implements
11448     to always fail with ENOSYS.  Some functions are actually named
11449     something starting with __ and the normal name is an alias.  */
11450 #if defined (__stub_msgget) || defined (__stub___msgget)
11451 choke me
11452 #else
11453 msgget();
11454 #endif
11455
11456 ; return 0; }
11457 EOF
11458 if { (eval echo configure:11459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11459   rm -rf conftest*
11460   eval "ac_cv_func_msgget=yes"
11461 else
11462   echo "configure: failed program was:" >&5
11463   cat conftest.$ac_ext >&5
11464   rm -rf conftest*
11465   eval "ac_cv_func_msgget=no"
11466 fi
11467 rm -f conftest*
11468
11469 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
11470   echo "$ac_t""yes" 1>&6
11471   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
11472 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
11473 echo "configure:11474: checking for sys/ipc.h" >&5
11474
11475 cat > conftest.$ac_ext <<EOF
11476 #line 11477 "configure"
11477 #include "confdefs.h"
11478 #include <sys/ipc.h>
11479 EOF
11480 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11481 { (eval echo configure:11482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11482 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11483 if test -z "$ac_err"; then
11484   rm -rf conftest*
11485   eval "ac_cv_header_$ac_safe=yes"
11486 else
11487   echo "$ac_err" >&5
11488   echo "configure: failed program was:" >&5
11489   cat conftest.$ac_ext >&5
11490   rm -rf conftest*
11491   eval "ac_cv_header_$ac_safe=no"
11492 fi
11493 rm -f conftest*
11494 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11495   echo "$ac_t""yes" 1>&6
11496   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
11497 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
11498 echo "configure:11499: checking for sys/msg.h" >&5
11499
11500 cat > conftest.$ac_ext <<EOF
11501 #line 11502 "configure"
11502 #include "confdefs.h"
11503 #include <sys/msg.h>
11504 EOF
11505 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11506 { (eval echo configure:11507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11507 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11508 if test -z "$ac_err"; then
11509   rm -rf conftest*
11510   eval "ac_cv_header_$ac_safe=yes"
11511 else
11512   echo "$ac_err" >&5
11513   echo "configure: failed program was:" >&5
11514   cat conftest.$ac_ext >&5
11515   rm -rf conftest*
11516   eval "ac_cv_header_$ac_safe=no"
11517 fi
11518 rm -f conftest*
11519 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11520   echo "$ac_t""yes" 1>&6
11521   { test "$extra_verbose" = "yes" && cat << \EOF
11522     Defining HAVE_SYSVIPC
11523 EOF
11524 cat >> confdefs.h <<\EOF
11525 #define HAVE_SYSVIPC 1
11526 EOF
11527 }
11528
11529 else
11530   echo "$ac_t""no" 1>&6
11531 fi
11532
11533 else
11534   echo "$ac_t""no" 1>&6
11535 fi
11536
11537 else
11538   echo "$ac_t""no" 1>&6
11539 fi
11540
11541
11542 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
11543 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
11544 echo "configure:11545: checking for dirent.h" >&5
11545
11546 cat > conftest.$ac_ext <<EOF
11547 #line 11548 "configure"
11548 #include "confdefs.h"
11549 #include <dirent.h>
11550 EOF
11551 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11552 { (eval echo configure:11553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11553 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11554 if test -z "$ac_err"; then
11555   rm -rf conftest*
11556   eval "ac_cv_header_$ac_safe=yes"
11557 else
11558   echo "$ac_err" >&5
11559   echo "configure: failed program was:" >&5
11560   cat conftest.$ac_ext >&5
11561   rm -rf conftest*
11562   eval "ac_cv_header_$ac_safe=no"
11563 fi
11564 rm -f conftest*
11565 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11566   echo "$ac_t""yes" 1>&6
11567   { test "$extra_verbose" = "yes" && cat << \EOF
11568     Defining SYSV_SYSTEM_DIR
11569 EOF
11570 cat >> confdefs.h <<\EOF
11571 #define SYSV_SYSTEM_DIR 1
11572 EOF
11573 }
11574
11575 else
11576   echo "$ac_t""no" 1>&6
11577 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
11578 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
11579 echo "configure:11580: checking for sys/dir.h" >&5
11580
11581 cat > conftest.$ac_ext <<EOF
11582 #line 11583 "configure"
11583 #include "confdefs.h"
11584 #include <sys/dir.h>
11585 EOF
11586 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11587 { (eval echo configure:11588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11588 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11589 if test -z "$ac_err"; then
11590   rm -rf conftest*
11591   eval "ac_cv_header_$ac_safe=yes"
11592 else
11593   echo "$ac_err" >&5
11594   echo "configure: failed program was:" >&5
11595   cat conftest.$ac_ext >&5
11596   rm -rf conftest*
11597   eval "ac_cv_header_$ac_safe=no"
11598 fi
11599 rm -f conftest*
11600 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11601   echo "$ac_t""yes" 1>&6
11602   :
11603 else
11604   echo "$ac_t""no" 1>&6
11605 { test "$extra_verbose" = "yes" && cat << \EOF
11606     Defining NONSYSTEM_DIR_LIBRARY
11607 EOF
11608 cat >> confdefs.h <<\EOF
11609 #define NONSYSTEM_DIR_LIBRARY 1
11610 EOF
11611 }
11612
11613 fi
11614
11615 fi
11616
11617
11618 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
11619 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
11620 echo "configure:11621: checking for nlist.h" >&5
11621
11622 cat > conftest.$ac_ext <<EOF
11623 #line 11624 "configure"
11624 #include "confdefs.h"
11625 #include <nlist.h>
11626 EOF
11627 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11628 { (eval echo configure:11629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11629 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11630 if test -z "$ac_err"; then
11631   rm -rf conftest*
11632   eval "ac_cv_header_$ac_safe=yes"
11633 else
11634   echo "$ac_err" >&5
11635   echo "configure: failed program was:" >&5
11636   cat conftest.$ac_ext >&5
11637   rm -rf conftest*
11638   eval "ac_cv_header_$ac_safe=no"
11639 fi
11640 rm -f conftest*
11641 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11642   echo "$ac_t""yes" 1>&6
11643   { test "$extra_verbose" = "yes" && cat << \EOF
11644     Defining NLIST_STRUCT
11645 EOF
11646 cat >> confdefs.h <<\EOF
11647 #define NLIST_STRUCT 1
11648 EOF
11649 }
11650
11651 else
11652   echo "$ac_t""no" 1>&6
11653 fi
11654
11655
11656
11657 echo "checking "for sound support"" 1>&6
11658 echo "configure:11659: checking "for sound support"" >&5
11659 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
11660
11661 if test "$with_native_sound" != "no"; then
11662     if test -n "$native_sound_lib"; then
11663     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
11664 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
11665 echo "configure:11666: checking for multimedia/audio_device.h" >&5
11666
11667 cat > conftest.$ac_ext <<EOF
11668 #line 11669 "configure"
11669 #include "confdefs.h"
11670 #include <multimedia/audio_device.h>
11671 EOF
11672 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11673 { (eval echo configure:11674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11674 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11675 if test -z "$ac_err"; then
11676   rm -rf conftest*
11677   eval "ac_cv_header_$ac_safe=yes"
11678 else
11679   echo "$ac_err" >&5
11680   echo "configure: failed program was:" >&5
11681   cat conftest.$ac_ext >&5
11682   rm -rf conftest*
11683   eval "ac_cv_header_$ac_safe=no"
11684 fi
11685 rm -f conftest*
11686 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11687   echo "$ac_t""yes" 1>&6
11688   sound_found=yes sound_cflags=""
11689       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
11690    echo "    xemacs will be linked with \"sunplay.o\""
11691  fi
11692 else
11693   echo "$ac_t""no" 1>&6
11694 fi
11695
11696   fi
11697
11698     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
11699     sound_found=yes
11700     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
11701    echo "    xemacs will be linked with \"sunplay.o\""
11702  fi
11703     if test -d "/usr/demo/SOUND/include"
11704       then sound_cflags="-I/usr/demo/SOUND/include"
11705       else sound_cflags="-I/usr/demo/SOUND"
11706     fi
11707     if test -z "$native_sound_lib" ; then
11708       if test -r "/usr/demo/SOUND/lib/libaudio.a"
11709         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
11710         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
11711       fi
11712     fi
11713   fi
11714
11715     if test -z "$sound_found"; then
11716     case "$canonical" in
11717     *-sgi-* )
11718       if test -z "$native_sound_lib"; then
11719         
11720 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
11721 echo "configure:11722: checking for ALopenport in -laudio" >&5
11722 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
11723
11724 xe_check_libs=" -laudio "
11725 cat > conftest.$ac_ext <<EOF
11726 #line 11727 "configure"
11727 #include "confdefs.h"
11728 /* Override any gcc2 internal prototype to avoid an error.  */
11729 /* We use char because int might match the return type of a gcc2
11730     builtin and then its argument prototype would still apply.  */
11731 char ALopenport();
11732
11733 int main() {
11734 ALopenport()
11735 ; return 0; }
11736 EOF
11737 if { (eval echo configure:11738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11738   rm -rf conftest*
11739   eval "ac_cv_lib_$ac_lib_var=yes"
11740 else
11741   echo "configure: failed program was:" >&5
11742   cat conftest.$ac_ext >&5
11743   rm -rf conftest*
11744   eval "ac_cv_lib_$ac_lib_var=no"
11745 fi
11746 rm -f conftest*
11747 xe_check_libs=""
11748
11749 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11750   echo "$ac_t""yes" 1>&6
11751   native_sound_lib="-laudio"
11752 else
11753   echo "$ac_t""no" 1>&6
11754 fi
11755
11756
11757       fi
11758       if test -n "$native_sound_lib"; then
11759         sound_found=yes sound_cflags=""
11760         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
11761    echo "    xemacs will be linked with \"sgiplay.o\""
11762  fi
11763       fi ;;
11764     hppa*-hp-hpux* )
11765       if test -z "$native_sound_lib"; then
11766         
11767 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
11768 echo "configure:11769: checking for AOpenAudio in -lAlib" >&5
11769 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
11770
11771 xe_check_libs=" -lAlib "
11772 cat > conftest.$ac_ext <<EOF
11773 #line 11774 "configure"
11774 #include "confdefs.h"
11775 /* Override any gcc2 internal prototype to avoid an error.  */
11776 /* We use char because int might match the return type of a gcc2
11777     builtin and then its argument prototype would still apply.  */
11778 char AOpenAudio();
11779
11780 int main() {
11781 AOpenAudio()
11782 ; return 0; }
11783 EOF
11784 if { (eval echo configure:11785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11785   rm -rf conftest*
11786   eval "ac_cv_lib_$ac_lib_var=yes"
11787 else
11788   echo "configure: failed program was:" >&5
11789   cat conftest.$ac_ext >&5
11790   rm -rf conftest*
11791   eval "ac_cv_lib_$ac_lib_var=no"
11792 fi
11793 rm -f conftest*
11794 xe_check_libs=""
11795
11796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11797   echo "$ac_t""yes" 1>&6
11798   native_sound_lib="-lAlib"
11799 else
11800   echo "$ac_t""no" 1>&6
11801 fi
11802
11803
11804       fi
11805       if test -n "$native_sound_lib"; then
11806         sound_found=yes
11807         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
11808    echo "    xemacs will be linked with \"hpplay.o\""
11809  fi
11810         if test "$GCC" = "yes" # Kludge city
11811           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
11812           else sound_cflags="+e -I/usr/audio/examples"
11813         fi
11814       fi ;;
11815     esac
11816   fi
11817
11818     if test -z "$sound_found"; then
11819     for dir in "machine" "sys" "linux"; do
11820       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
11821 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
11822 echo "configure:11823: checking for ${dir}/soundcard.h" >&5
11823
11824 cat > conftest.$ac_ext <<EOF
11825 #line 11826 "configure"
11826 #include "confdefs.h"
11827 #include <${dir}/soundcard.h>
11828 EOF
11829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11830 { (eval echo configure:11831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11831 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11832 if test -z "$ac_err"; then
11833   rm -rf conftest*
11834   eval "ac_cv_header_$ac_safe=yes"
11835 else
11836   echo "$ac_err" >&5
11837   echo "configure: failed program was:" >&5
11838   cat conftest.$ac_ext >&5
11839   rm -rf conftest*
11840   eval "ac_cv_header_$ac_safe=no"
11841 fi
11842 rm -f conftest*
11843 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11844   echo "$ac_t""yes" 1>&6
11845   sound_found=yes
11846        need_miscplay=yes
11847         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
11848    echo "    xemacs will be linked with \"linuxplay.o\""
11849  fi
11850         { test "$extra_verbose" = "yes" && cat << EOF
11851     Defining SOUNDCARD_H_FILE = "${dir}/soundcard.h"
11852 EOF
11853 cat >> confdefs.h <<EOF
11854 #define SOUNDCARD_H_FILE "${dir}/soundcard.h"
11855 EOF
11856 }
11857
11858         break
11859 else
11860   echo "$ac_t""no" 1>&6
11861 fi
11862
11863     done
11864   fi
11865
11866   test "$sound_found" = "yes" && with_native_sound=yes
11867 fi
11868
11869 if test "$with_native_sound" = "yes"; then
11870   { test "$extra_verbose" = "yes" && cat << \EOF
11871     Defining HAVE_NATIVE_SOUND
11872 EOF
11873 cat >> confdefs.h <<\EOF
11874 #define HAVE_NATIVE_SOUND 1
11875 EOF
11876 }
11877
11878   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
11879 fi
11880
11881 if test "$with_nas_sound" != "no"; then
11882   ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'`
11883 echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6
11884 echo "configure:11885: checking for audio/audiolib.h" >&5
11885
11886 cat > conftest.$ac_ext <<EOF
11887 #line 11888 "configure"
11888 #include "confdefs.h"
11889 #include <audio/audiolib.h>
11890 EOF
11891 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11892 { (eval echo configure:11893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11893 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11894 if test -z "$ac_err"; then
11895   rm -rf conftest*
11896   eval "ac_cv_header_$ac_safe=yes"
11897 else
11898   echo "$ac_err" >&5
11899   echo "configure: failed program was:" >&5
11900   cat conftest.$ac_ext >&5
11901   rm -rf conftest*
11902   eval "ac_cv_header_$ac_safe=no"
11903 fi
11904 rm -f conftest*
11905 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11906   echo "$ac_t""yes" 1>&6
11907   
11908     
11909 echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6
11910 echo "configure:11911: checking for AuOpenServer in -laudio" >&5
11911 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'`
11912
11913 xe_check_libs=" -laudio "
11914 cat > conftest.$ac_ext <<EOF
11915 #line 11916 "configure"
11916 #include "confdefs.h"
11917 /* Override any gcc2 internal prototype to avoid an error.  */
11918 /* We use char because int might match the return type of a gcc2
11919     builtin and then its argument prototype would still apply.  */
11920 char AuOpenServer();
11921
11922 int main() {
11923 AuOpenServer()
11924 ; return 0; }
11925 EOF
11926 if { (eval echo configure:11927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11927   rm -rf conftest*
11928   eval "ac_cv_lib_$ac_lib_var=yes"
11929 else
11930   echo "configure: failed program was:" >&5
11931   cat conftest.$ac_ext >&5
11932   rm -rf conftest*
11933   eval "ac_cv_lib_$ac_lib_var=no"
11934 fi
11935 rm -f conftest*
11936 xe_check_libs=""
11937
11938 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11939   echo "$ac_t""yes" 1>&6
11940   have_nas_sound=yes
11941 else
11942   echo "$ac_t""no" 1>&6
11943 fi
11944
11945
11946 else
11947   echo "$ac_t""no" 1>&6
11948 fi
11949
11950   if test "$have_nas_sound" = "yes"; then
11951     with_nas_sound=yes
11952     { test "$extra_verbose" = "yes" && cat << \EOF
11953     Defining HAVE_NAS_SOUND
11954 EOF
11955 cat >> confdefs.h <<\EOF
11956 #define HAVE_NAS_SOUND 1
11957 EOF
11958 }
11959
11960     extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
11961    echo "    xemacs will be linked with \"nas.o\""
11962  fi
11963     libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
11964             cat > conftest.$ac_ext <<EOF
11965 #line 11966 "configure"
11966 #include "confdefs.h"
11967 #include <audio/Xtutil.h>
11968 EOF
11969 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11970   egrep "AuXtErrorJump" >/dev/null 2>&1; then
11971   :
11972 else
11973   rm -rf conftest*
11974   old_nas=yes; { test "$extra_verbose" = "yes" && cat << \EOF
11975     Defining NAS_NO_ERROR_JUMP
11976 EOF
11977 cat >> confdefs.h <<\EOF
11978 #define NAS_NO_ERROR_JUMP 1
11979 EOF
11980 }
11981
11982 fi
11983 rm -f conftest*
11984
11985   else
11986     test "$with_nas_sound" = "yes" && \
11987       { echo "Error:" "Required NAS sound support cannot be provided." >&2; exit 1; }
11988     with_nas_sound=no
11989   fi
11990 fi
11991
11992 if test "$with_esd_sound" != "no"; then
11993   # Extract the first word of "esd-config", so it can be a program name with args.
11994 set dummy esd-config; ac_word=$2
11995 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
11996 echo "configure:11997: checking for $ac_word" >&5
11997
11998 if test -n "$have_esd_config"; then
11999   ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test.
12000 else
12001   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
12002   ac_dummy="$PATH"
12003   for ac_dir in $ac_dummy; do
12004     test -z "$ac_dir" && ac_dir=.
12005     if test -f $ac_dir/$ac_word; then
12006       ac_cv_prog_have_esd_config="yes"
12007       break
12008     fi
12009   done
12010   IFS="$ac_save_ifs"
12011   test -z "$ac_cv_prog_have_esd_config" && ac_cv_prog_have_esd_config="no"
12012 fi
12013 have_esd_config="$ac_cv_prog_have_esd_config"
12014 if test -n "$have_esd_config"; then
12015   echo "$ac_t""$have_esd_config" 1>&6
12016 else
12017   echo "$ac_t""no" 1>&6
12018 fi
12019
12020   if test "$have_esd_config" = "yes"; then
12021     save_c_switch_site="$c_switch_site" save_LIBS="$LIBS"
12022     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
12023     LIBS="`esd-config --libs` $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"`esd-config --libs`\" to \$LIBS"; fi
12024     echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6
12025 echo "configure:12026: checking for esd_play_stream" >&5
12026
12027 cat > conftest.$ac_ext <<EOF
12028 #line 12029 "configure"
12029 #include "confdefs.h"
12030 /* System header to define __stub macros and hopefully few prototypes,
12031     which can conflict with char esd_play_stream(); below.  */
12032 #include <assert.h>
12033 /* Override any gcc2 internal prototype to avoid an error.  */
12034 /* We use char because int might match the return type of a gcc2
12035     builtin and then its argument prototype would still apply.  */
12036 char esd_play_stream();
12037
12038 int main() {
12039
12040 /* The GNU C library defines this for functions which it implements
12041     to always fail with ENOSYS.  Some functions are actually named
12042     something starting with __ and the normal name is an alias.  */
12043 #if defined (__stub_esd_play_stream) || defined (__stub___esd_play_stream)
12044 choke me
12045 #else
12046 esd_play_stream();
12047 #endif
12048
12049 ; return 0; }
12050 EOF
12051 if { (eval echo configure:12052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12052   rm -rf conftest*
12053   eval "ac_cv_func_esd_play_stream=yes"
12054 else
12055   echo "configure: failed program was:" >&5
12056   cat conftest.$ac_ext >&5
12057   rm -rf conftest*
12058   eval "ac_cv_func_esd_play_stream=no"
12059 fi
12060 rm -f conftest*
12061
12062 if eval "test \"`echo '$ac_cv_func_'esd_play_stream`\" = yes"; then
12063   echo "$ac_t""yes" 1>&6
12064   have_esd_sound=yes
12065 else
12066   echo "$ac_t""no" 1>&6
12067 c_switch_site="$save_c_switch_site" LIBS="$save_LIBS"
12068 fi
12069
12070   fi
12071
12072   if test "$have_esd_sound" = "yes"; then
12073     with_esd_sound=yes
12074     need_miscplay=yes
12075     extra_objs="$extra_objs esd.o" &&  if test "$extra_verbose" = "yes"; then
12076    echo "    xemacs will be linked with \"esd.o\""
12077  fi
12078     { test "$extra_verbose" = "yes" && cat << \EOF
12079     Defining HAVE_ESD_SOUND
12080 EOF
12081 cat >> confdefs.h <<\EOF
12082 #define HAVE_ESD_SOUND 1
12083 EOF
12084 }
12085
12086   else
12087     test "$with_esd_sound" = "yes" && \
12088       { echo "Error:" "Required ESD sound support cannot be provided." >&2; exit 1; }
12089     with_esd_sound=no
12090   fi
12091 fi
12092
12093 test "$need_miscplay" = "yes" && extra_objs="$extra_objs miscplay.o" &&  if test "$extra_verbose" = "yes"; then
12094    echo "    xemacs will be linked with \"miscplay.o\""
12095  fi
12096
12097
12098 test -z "$with_tty" && with_tty=yes
12099
12100 if test "$with_tty" = "yes"  ; then
12101   echo "checking for TTY-related features" 1>&6
12102 echo "configure:12103: checking for TTY-related features" >&5
12103   { test "$extra_verbose" = "yes" && cat << \EOF
12104     Defining HAVE_TTY
12105 EOF
12106 cat >> confdefs.h <<\EOF
12107 #define HAVE_TTY 1
12108 EOF
12109 }
12110
12111   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
12112    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\""
12113  fi
12114
12115     if test -z "$with_ncurses"; then
12116     
12117 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
12118 echo "configure:12119: checking for tgetent in -lncurses" >&5
12119 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
12120
12121 xe_check_libs=" -lncurses "
12122 cat > conftest.$ac_ext <<EOF
12123 #line 12124 "configure"
12124 #include "confdefs.h"
12125 /* Override any gcc2 internal prototype to avoid an error.  */
12126 /* We use char because int might match the return type of a gcc2
12127     builtin and then its argument prototype would still apply.  */
12128 char tgetent();
12129
12130 int main() {
12131 tgetent()
12132 ; return 0; }
12133 EOF
12134 if { (eval echo configure:12135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12135   rm -rf conftest*
12136   eval "ac_cv_lib_$ac_lib_var=yes"
12137 else
12138   echo "configure: failed program was:" >&5
12139   cat conftest.$ac_ext >&5
12140   rm -rf conftest*
12141   eval "ac_cv_lib_$ac_lib_var=no"
12142 fi
12143 rm -f conftest*
12144 xe_check_libs=""
12145
12146 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12147   echo "$ac_t""yes" 1>&6
12148   with_ncurses=yes
12149 else
12150   echo "$ac_t""no" 1>&6
12151 with_ncurses=no
12152 fi
12153
12154
12155   fi
12156   if test "$with_ncurses" = "yes"; then
12157     { test "$extra_verbose" = "yes" && cat << \EOF
12158     Defining HAVE_NCURSES
12159 EOF
12160 cat >> confdefs.h <<\EOF
12161 #define HAVE_NCURSES 1
12162 EOF
12163 }
12164
12165     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
12166 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
12167 echo "configure:12168: checking for ncurses/curses.h" >&5
12168
12169 cat > conftest.$ac_ext <<EOF
12170 #line 12171 "configure"
12171 #include "confdefs.h"
12172 #include <ncurses/curses.h>
12173 EOF
12174 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12175 { (eval echo configure:12176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12176 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12177 if test -z "$ac_err"; then
12178   rm -rf conftest*
12179   eval "ac_cv_header_$ac_safe=yes"
12180 else
12181   echo "$ac_err" >&5
12182   echo "configure: failed program was:" >&5
12183   cat conftest.$ac_ext >&5
12184   rm -rf conftest*
12185   eval "ac_cv_header_$ac_safe=no"
12186 fi
12187 rm -f conftest*
12188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12189   echo "$ac_t""yes" 1>&6
12190   curses_h_file=ncurses/curses.h
12191 else
12192   echo "$ac_t""no" 1>&6
12193 fi
12194
12195     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
12196 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
12197 echo "configure:12198: checking for ncurses/term.h" >&5
12198
12199 cat > conftest.$ac_ext <<EOF
12200 #line 12201 "configure"
12201 #include "confdefs.h"
12202 #include <ncurses/term.h>
12203 EOF
12204 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12205 { (eval echo configure:12206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12206 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12207 if test -z "$ac_err"; then
12208   rm -rf conftest*
12209   eval "ac_cv_header_$ac_safe=yes"
12210 else
12211   echo "$ac_err" >&5
12212   echo "configure: failed program was:" >&5
12213   cat conftest.$ac_ext >&5
12214   rm -rf conftest*
12215   eval "ac_cv_header_$ac_safe=no"
12216 fi
12217 rm -f conftest*
12218 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12219   echo "$ac_t""yes" 1>&6
12220   term_h_file=ncurses/term.h
12221 else
12222   echo "$ac_t""no" 1>&6
12223 fi
12224
12225     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
12226    echo "    xemacs will be linked with \"terminfo.o\""
12227  fi
12228     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
12229
12230     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
12231                         save_c_switch_site="$c_switch_site"
12232       c_switch_site="$c_switch_site -I/usr/include/ncurses"
12233       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
12234 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
12235 echo "configure:12236: checking for ncurses/curses.h" >&5
12236
12237 cat > conftest.$ac_ext <<EOF
12238 #line 12239 "configure"
12239 #include "confdefs.h"
12240 #include <ncurses/curses.h>
12241 EOF
12242 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12243 { (eval echo configure:12244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12244 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12245 if test -z "$ac_err"; then
12246   rm -rf conftest*
12247   eval "ac_cv_header_$ac_safe=yes"
12248 else
12249   echo "$ac_err" >&5
12250   echo "configure: failed program was:" >&5
12251   cat conftest.$ac_ext >&5
12252   rm -rf conftest*
12253   eval "ac_cv_header_$ac_safe=no"
12254 fi
12255 rm -f conftest*
12256 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12257   echo "$ac_t""yes" 1>&6
12258   curses_h_file=ncurses/curses.h
12259 else
12260   echo "$ac_t""no" 1>&6
12261 fi
12262
12263       if test "$ac_cv_header_ncurses_curses_h" = "yes"
12264         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
12265         else c_switch_site="$save_c_switch_site"
12266       fi
12267     fi
12268   else         if test "$have_terminfo" = "yes"; then
12269       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
12270    echo "    xemacs will be linked with \"terminfo.o\""
12271  fi
12272       if test -n "$libs_termcap"; then
12273         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
12274       else
12275         for lib in curses termlib termcap; do
12276           
12277 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
12278 echo "configure:12279: checking for tgetent in -l$lib" >&5
12279 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
12280
12281 xe_check_libs=" -l$lib "
12282 cat > conftest.$ac_ext <<EOF
12283 #line 12284 "configure"
12284 #include "confdefs.h"
12285 /* Override any gcc2 internal prototype to avoid an error.  */
12286 /* We use char because int might match the return type of a gcc2
12287     builtin and then its argument prototype would still apply.  */
12288 char tgetent();
12289
12290 int main() {
12291 tgetent()
12292 ; return 0; }
12293 EOF
12294 if { (eval echo configure:12295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12295   rm -rf conftest*
12296   eval "ac_cv_lib_$ac_lib_var=yes"
12297 else
12298   echo "configure: failed program was:" >&5
12299   cat conftest.$ac_ext >&5
12300   rm -rf conftest*
12301   eval "ac_cv_lib_$ac_lib_var=no"
12302 fi
12303 rm -f conftest*
12304 xe_check_libs=""
12305
12306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12307   echo "$ac_t""yes" 1>&6
12308   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
12309 else
12310   echo "$ac_t""no" 1>&6
12311 fi
12312
12313
12314         done
12315       fi
12316     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
12317    echo "    xemacs will be linked with \"tparam.o\""
12318  fi
12319                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
12320       if test -n "$libs_termcap"; then
12321         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
12322       else
12323         
12324 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
12325 echo "configure:12326: checking for tgetent in -lcurses" >&5
12326 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
12327
12328 xe_check_libs=" -lcurses "
12329 cat > conftest.$ac_ext <<EOF
12330 #line 12331 "configure"
12331 #include "confdefs.h"
12332 /* Override any gcc2 internal prototype to avoid an error.  */
12333 /* We use char because int might match the return type of a gcc2
12334     builtin and then its argument prototype would still apply.  */
12335 char tgetent();
12336
12337 int main() {
12338 tgetent()
12339 ; return 0; }
12340 EOF
12341 if { (eval echo configure:12342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12342   rm -rf conftest*
12343   eval "ac_cv_lib_$ac_lib_var=yes"
12344 else
12345   echo "configure: failed program was:" >&5
12346   cat conftest.$ac_ext >&5
12347   rm -rf conftest*
12348   eval "ac_cv_lib_$ac_lib_var=no"
12349 fi
12350 rm -f conftest*
12351 xe_check_libs=""
12352
12353 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12354   echo "$ac_t""yes" 1>&6
12355   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
12356 else
12357   echo "$ac_t""no" 1>&6
12358 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
12359 echo "configure:12360: checking for tgetent in -ltermcap" >&5
12360 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
12361
12362 xe_check_libs=" -ltermcap "
12363 cat > conftest.$ac_ext <<EOF
12364 #line 12365 "configure"
12365 #include "confdefs.h"
12366 /* Override any gcc2 internal prototype to avoid an error.  */
12367 /* We use char because int might match the return type of a gcc2
12368     builtin and then its argument prototype would still apply.  */
12369 char tgetent();
12370
12371 int main() {
12372 tgetent()
12373 ; return 0; }
12374 EOF
12375 if { (eval echo configure:12376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12376   rm -rf conftest*
12377   eval "ac_cv_lib_$ac_lib_var=yes"
12378 else
12379   echo "configure: failed program was:" >&5
12380   cat conftest.$ac_ext >&5
12381   rm -rf conftest*
12382   eval "ac_cv_lib_$ac_lib_var=no"
12383 fi
12384 rm -f conftest*
12385 xe_check_libs=""
12386
12387 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12388   echo "$ac_t""yes" 1>&6
12389   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
12390 else
12391   echo "$ac_t""no" 1>&6
12392 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
12393    echo "    xemacs will be linked with \"termcap.o\""
12394  fi
12395 fi
12396
12397
12398 fi
12399
12400
12401       fi
12402     fi
12403   fi
12404   { test "$extra_verbose" = "yes" && cat << EOF
12405     Defining CURSES_H_FILE = "${curses_h_file-curses.h}"
12406 EOF
12407 cat >> confdefs.h <<EOF
12408 #define CURSES_H_FILE "${curses_h_file-curses.h}"
12409 EOF
12410 }
12411
12412   { test "$extra_verbose" = "yes" && cat << EOF
12413     Defining TERM_H_FILE = "${term_h_file-term.h}"
12414 EOF
12415 cat >> confdefs.h <<EOF
12416 #define TERM_H_FILE "${term_h_file-term.h}"
12417 EOF
12418 }
12419
12420
12421     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
12422 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
12423 echo "configure:12424: checking for gpm.h" >&5
12424
12425 cat > conftest.$ac_ext <<EOF
12426 #line 12427 "configure"
12427 #include "confdefs.h"
12428 #include <gpm.h>
12429 EOF
12430 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12431 { (eval echo configure:12432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12432 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12433 if test -z "$ac_err"; then
12434   rm -rf conftest*
12435   eval "ac_cv_header_$ac_safe=yes"
12436 else
12437   echo "$ac_err" >&5
12438   echo "configure: failed program was:" >&5
12439   cat conftest.$ac_ext >&5
12440   rm -rf conftest*
12441   eval "ac_cv_header_$ac_safe=no"
12442 fi
12443 rm -f conftest*
12444 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12445   echo "$ac_t""yes" 1>&6
12446   :
12447 else
12448   echo "$ac_t""no" 1>&6
12449 with_gpm=no
12450 fi
12451  }
12452   test -z "$with_gpm" && { 
12453 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
12454 echo "configure:12455: checking for Gpm_Open in -lgpm" >&5
12455 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
12456
12457 xe_check_libs=" -lgpm "
12458 cat > conftest.$ac_ext <<EOF
12459 #line 12460 "configure"
12460 #include "confdefs.h"
12461 /* Override any gcc2 internal prototype to avoid an error.  */
12462 /* We use char because int might match the return type of a gcc2
12463     builtin and then its argument prototype would still apply.  */
12464 char Gpm_Open();
12465
12466 int main() {
12467 Gpm_Open()
12468 ; return 0; }
12469 EOF
12470 if { (eval echo configure:12471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12471   rm -rf conftest*
12472   eval "ac_cv_lib_$ac_lib_var=yes"
12473 else
12474   echo "configure: failed program was:" >&5
12475   cat conftest.$ac_ext >&5
12476   rm -rf conftest*
12477   eval "ac_cv_lib_$ac_lib_var=no"
12478 fi
12479 rm -f conftest*
12480 xe_check_libs=""
12481
12482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12483   echo "$ac_t""yes" 1>&6
12484   with_gpm=yes
12485 else
12486   echo "$ac_t""no" 1>&6
12487 with_gpm=no
12488 fi
12489
12490  }
12491   if test "$with_gpm" = "yes"; then
12492     { test "$extra_verbose" = "yes" && cat << \EOF
12493     Defining HAVE_GPM
12494 EOF
12495 cat >> confdefs.h <<\EOF
12496 #define HAVE_GPM 1
12497 EOF
12498 }
12499
12500     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
12501    echo "    xemacs will be linked with \"gpmevent.o\""
12502  fi
12503     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
12504   fi
12505
12506 else   for feature in ncurses gpm; do
12507     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
12508       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
12509     fi
12510     eval "with_${feature}=no"
12511   done
12512 fi 
12513 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
12514    echo "    xemacs will be linked with \"event-unixoid.o\""
12515  fi
12516
12517
12518 test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
12519   != "no no no" && echo "checking for database support" 1>&6
12520 echo "configure:12521: checking for database support" >&5
12521
12522 if test "$with_database_gdbm $with_database_dbm" != "no no"; then
12523   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
12524 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
12525 echo "configure:12526: checking for ndbm.h" >&5
12526
12527 cat > conftest.$ac_ext <<EOF
12528 #line 12529 "configure"
12529 #include "confdefs.h"
12530 #include <ndbm.h>
12531 EOF
12532 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12533 { (eval echo configure:12534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12534 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12535 if test -z "$ac_err"; then
12536   rm -rf conftest*
12537   eval "ac_cv_header_$ac_safe=yes"
12538 else
12539   echo "$ac_err" >&5
12540   echo "configure: failed program was:" >&5
12541   cat conftest.$ac_ext >&5
12542   rm -rf conftest*
12543   eval "ac_cv_header_$ac_safe=no"
12544 fi
12545 rm -f conftest*
12546 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12547   echo "$ac_t""yes" 1>&6
12548   :
12549 else
12550   echo "$ac_t""no" 1>&6
12551
12552     test "$with_database_gdbm" = "yes" -o \
12553          "$with_database_dbm"  = "yes" && \
12554       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
12555     with_database_gdbm=no with_database_dbm=no
12556 fi
12557
12558 fi
12559
12560 if test "$with_database_gdbm" != "no"; then
12561   
12562 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
12563 echo "configure:12564: checking for dbm_open in -lgdbm" >&5
12564 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
12565
12566 xe_check_libs=" -lgdbm "
12567 cat > conftest.$ac_ext <<EOF
12568 #line 12569 "configure"
12569 #include "confdefs.h"
12570 /* Override any gcc2 internal prototype to avoid an error.  */
12571 /* We use char because int might match the return type of a gcc2
12572     builtin and then its argument prototype would still apply.  */
12573 char dbm_open();
12574
12575 int main() {
12576 dbm_open()
12577 ; return 0; }
12578 EOF
12579 if { (eval echo configure:12580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12580   rm -rf conftest*
12581   eval "ac_cv_lib_$ac_lib_var=yes"
12582 else
12583   echo "configure: failed program was:" >&5
12584   cat conftest.$ac_ext >&5
12585   rm -rf conftest*
12586   eval "ac_cv_lib_$ac_lib_var=no"
12587 fi
12588 rm -f conftest*
12589 xe_check_libs=""
12590
12591 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12592   echo "$ac_t""yes" 1>&6
12593   with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm
12594 else
12595   echo "$ac_t""no" 1>&6
12596 if test "$with_database_gdbm" = "yes"; then
12597      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
12598    fi
12599    with_database_gdbm=no
12600 fi
12601
12602
12603 fi
12604
12605 if test "$with_database_dbm" != "no"; then
12606   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12607 echo "configure:12608: checking for dbm_open" >&5
12608
12609 cat > conftest.$ac_ext <<EOF
12610 #line 12611 "configure"
12611 #include "confdefs.h"
12612 /* System header to define __stub macros and hopefully few prototypes,
12613     which can conflict with char dbm_open(); below.  */
12614 #include <assert.h>
12615 /* Override any gcc2 internal prototype to avoid an error.  */
12616 /* We use char because int might match the return type of a gcc2
12617     builtin and then its argument prototype would still apply.  */
12618 char dbm_open();
12619
12620 int main() {
12621
12622 /* The GNU C library defines this for functions which it implements
12623     to always fail with ENOSYS.  Some functions are actually named
12624     something starting with __ and the normal name is an alias.  */
12625 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12626 choke me
12627 #else
12628 dbm_open();
12629 #endif
12630
12631 ; return 0; }
12632 EOF
12633 if { (eval echo configure:12634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12634   rm -rf conftest*
12635   eval "ac_cv_func_dbm_open=yes"
12636 else
12637   echo "configure: failed program was:" >&5
12638   cat conftest.$ac_ext >&5
12639   rm -rf conftest*
12640   eval "ac_cv_func_dbm_open=no"
12641 fi
12642 rm -f conftest*
12643
12644 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12645   echo "$ac_t""yes" 1>&6
12646   with_database_dbm=yes libdbm=
12647 else
12648   echo "$ac_t""no" 1>&6
12649
12650     
12651 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
12652 echo "configure:12653: checking for dbm_open in -ldbm" >&5
12653 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
12654
12655 xe_check_libs=" -ldbm "
12656 cat > conftest.$ac_ext <<EOF
12657 #line 12658 "configure"
12658 #include "confdefs.h"
12659 /* Override any gcc2 internal prototype to avoid an error.  */
12660 /* We use char because int might match the return type of a gcc2
12661     builtin and then its argument prototype would still apply.  */
12662 char dbm_open();
12663
12664 int main() {
12665 dbm_open()
12666 ; return 0; }
12667 EOF
12668 if { (eval echo configure:12669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12669   rm -rf conftest*
12670   eval "ac_cv_lib_$ac_lib_var=yes"
12671 else
12672   echo "configure: failed program was:" >&5
12673   cat conftest.$ac_ext >&5
12674   rm -rf conftest*
12675   eval "ac_cv_lib_$ac_lib_var=no"
12676 fi
12677 rm -f conftest*
12678 xe_check_libs=""
12679
12680 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12681   echo "$ac_t""yes" 1>&6
12682   with_database_dbm=yes libdbm=-ldbm
12683 else
12684   echo "$ac_t""no" 1>&6
12685 test "$with_database_dbm" = "yes" && \
12686         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
12687       with_database_dbm=no
12688 fi
12689
12690
12691 fi
12692
12693 fi
12694
12695 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
12696 test "$with_database_gdbm" = "yes" -o \
12697      "$with_database_dbm"  = "yes" && \
12698   { test "$extra_verbose" = "yes" && cat << \EOF
12699     Defining HAVE_DBM
12700 EOF
12701 cat >> confdefs.h <<\EOF
12702 #define HAVE_DBM 1
12703 EOF
12704 }
12705
12706
12707 if test "$with_database_berkdb" != "no"; then
12708   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
12709 echo "configure:12710: checking for Berkeley db.h" >&5
12710   for header in "db/db.h" "db.h"; do
12711     cat > conftest.$ac_ext <<EOF
12712 #line 12713 "configure"
12713 #include "confdefs.h"
12714
12715 #include <stdlib.h>
12716 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
12717 #ifdef HAVE_INTTYPES_H
12718 #define __BIT_TYPES_DEFINED__
12719 #include <inttypes.h>
12720 typedef uint8_t  u_int8_t;
12721 typedef uint16_t u_int16_t;
12722 typedef uint32_t u_int32_t;
12723 #ifdef WE_DONT_NEED_QUADS
12724 typedef uint64_t u_int64_t;
12725 #endif
12726 #endif
12727 #endif
12728 #include <$header>
12729
12730 int main() {
12731
12732 ; return 0; }
12733 EOF
12734 if { (eval echo configure:12735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12735   rm -rf conftest*
12736   db_h_file="$header"; break
12737 else
12738   echo "configure: failed program was:" >&5
12739   cat conftest.$ac_ext >&5
12740 fi
12741 rm -f conftest*
12742   done
12743   if test -z "$db_h_file"
12744   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
12745   else echo "$ac_t""$db_h_file" 1>&6
12746   fi
12747
12748   if test "$with_database_berkdb" != "no"; then
12749     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
12750 echo "configure:12751: checking for Berkeley DB version" >&5
12751     cat > conftest.$ac_ext <<EOF
12752 #line 12753 "configure"
12753 #include "confdefs.h"
12754 #include <$db_h_file>
12755 #if DB_VERSION_MAJOR > 1
12756 yes
12757 #endif
12758
12759 EOF
12760 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12761   egrep "yes" >/dev/null 2>&1; then
12762   rm -rf conftest*
12763   echo "$ac_t""2" 1>&6; dbfunc=db_open
12764 else
12765   rm -rf conftest*
12766   echo "$ac_t""1" 1>&6; dbfunc=dbopen
12767 fi
12768 rm -f conftest*
12769
12770     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
12771 echo "configure:12772: checking for $dbfunc" >&5
12772
12773 cat > conftest.$ac_ext <<EOF
12774 #line 12775 "configure"
12775 #include "confdefs.h"
12776 /* System header to define __stub macros and hopefully few prototypes,
12777     which can conflict with char $dbfunc(); below.  */
12778 #include <assert.h>
12779 /* Override any gcc2 internal prototype to avoid an error.  */
12780 /* We use char because int might match the return type of a gcc2
12781     builtin and then its argument prototype would still apply.  */
12782 char $dbfunc();
12783
12784 int main() {
12785
12786 /* The GNU C library defines this for functions which it implements
12787     to always fail with ENOSYS.  Some functions are actually named
12788     something starting with __ and the normal name is an alias.  */
12789 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
12790 choke me
12791 #else
12792 $dbfunc();
12793 #endif
12794
12795 ; return 0; }
12796 EOF
12797 if { (eval echo configure:12798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12798   rm -rf conftest*
12799   eval "ac_cv_func_$dbfunc=yes"
12800 else
12801   echo "configure: failed program was:" >&5
12802   cat conftest.$ac_ext >&5
12803   rm -rf conftest*
12804   eval "ac_cv_func_$dbfunc=no"
12805 fi
12806 rm -f conftest*
12807
12808 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
12809   echo "$ac_t""yes" 1>&6
12810   with_database_berkdb=yes need_libdb=no
12811 else
12812   echo "$ac_t""no" 1>&6
12813
12814     
12815 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
12816 echo "configure:12817: checking for $dbfunc in -ldb" >&5
12817 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
12818
12819 xe_check_libs=" -ldb "
12820 cat > conftest.$ac_ext <<EOF
12821 #line 12822 "configure"
12822 #include "confdefs.h"
12823 /* Override any gcc2 internal prototype to avoid an error.  */
12824 /* We use char because int might match the return type of a gcc2
12825     builtin and then its argument prototype would still apply.  */
12826 char $dbfunc();
12827
12828 int main() {
12829 $dbfunc()
12830 ; return 0; }
12831 EOF
12832 if { (eval echo configure:12833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12833   rm -rf conftest*
12834   eval "ac_cv_lib_$ac_lib_var=yes"
12835 else
12836   echo "configure: failed program was:" >&5
12837   cat conftest.$ac_ext >&5
12838   rm -rf conftest*
12839   eval "ac_cv_lib_$ac_lib_var=no"
12840 fi
12841 rm -f conftest*
12842 xe_check_libs=""
12843
12844 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12845   echo "$ac_t""yes" 1>&6
12846   with_database_berkdb=yes need_libdb=yes
12847 else
12848   echo "$ac_t""no" 1>&6
12849 fi
12850
12851
12852 fi
12853
12854   fi
12855
12856   if test "$with_database_berkdb" = "yes"; then
12857     { test "$extra_verbose" = "yes" && cat << EOF
12858     Defining DB_H_FILE = "$db_h_file"
12859 EOF
12860 cat >> confdefs.h <<EOF
12861 #define DB_H_FILE "$db_h_file"
12862 EOF
12863 }
12864
12865     { test "$extra_verbose" = "yes" && cat << \EOF
12866     Defining HAVE_BERKELEY_DB
12867 EOF
12868 cat >> confdefs.h <<\EOF
12869 #define HAVE_BERKELEY_DB 1
12870 EOF
12871 }
12872
12873     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
12874   else with_database_berkdb=no
12875   fi
12876 fi
12877
12878 if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
12879      != "no no no"; then
12880   { test "$extra_verbose" = "yes" && cat << \EOF
12881     Defining HAVE_DATABASE
12882 EOF
12883 cat >> confdefs.h <<\EOF
12884 #define HAVE_DATABASE 1
12885 EOF
12886 }
12887
12888   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
12889    echo "    xemacs will be linked with \"database.o\""
12890  fi
12891 fi
12892
12893 if test "$with_socks" = "yes"; then
12894   
12895 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
12896 echo "configure:12897: checking for SOCKSinit in -lsocks" >&5
12897 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
12898
12899 xe_check_libs=" -lsocks "
12900 cat > conftest.$ac_ext <<EOF
12901 #line 12902 "configure"
12902 #include "confdefs.h"
12903 /* Override any gcc2 internal prototype to avoid an error.  */
12904 /* We use char because int might match the return type of a gcc2
12905     builtin and then its argument prototype would still apply.  */
12906 char SOCKSinit();
12907
12908 int main() {
12909 SOCKSinit()
12910 ; return 0; }
12911 EOF
12912 if { (eval echo configure:12913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12913   rm -rf conftest*
12914   eval "ac_cv_lib_$ac_lib_var=yes"
12915 else
12916   echo "configure: failed program was:" >&5
12917   cat conftest.$ac_ext >&5
12918   rm -rf conftest*
12919   eval "ac_cv_lib_$ac_lib_var=no"
12920 fi
12921 rm -f conftest*
12922 xe_check_libs=""
12923
12924 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12925   echo "$ac_t""yes" 1>&6
12926     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
12927     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
12928   { test "$extra_verbose" = "yes" && cat << EOF
12929     Defining $ac_tr_lib
12930 EOF
12931 cat >> confdefs.h <<EOF
12932 #define $ac_tr_lib 1
12933 EOF
12934 }
12935
12936   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
12937
12938 else
12939   echo "$ac_t""no" 1>&6
12940 fi
12941
12942
12943   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
12944     Defining HAVE_SOCKS
12945 EOF
12946 cat >> confdefs.h <<\EOF
12947 #define HAVE_SOCKS 1
12948 EOF
12949 }
12950
12951 fi
12952
12953 if test "$usage_tracking" = "yes"; then
12954   { test "$extra_verbose" = "yes" && cat << \EOF
12955     Defining USAGE_TRACKING
12956 EOF
12957 cat >> confdefs.h <<\EOF
12958 #define USAGE_TRACKING 1
12959 EOF
12960 }
12961
12962   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
12963 fi
12964
12965 if test "$with_modules" != "no"; then
12966   echo "checking for module support" 1>&6
12967 echo "configure:12968: checking for module support" >&5
12968
12969     ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
12970 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
12971 echo "configure:12972: checking for dlfcn.h" >&5
12972
12973 cat > conftest.$ac_ext <<EOF
12974 #line 12975 "configure"
12975 #include "confdefs.h"
12976 #include <dlfcn.h>
12977 EOF
12978 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12979 { (eval echo configure:12980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12980 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12981 if test -z "$ac_err"; then
12982   rm -rf conftest*
12983   eval "ac_cv_header_$ac_safe=yes"
12984 else
12985   echo "$ac_err" >&5
12986   echo "configure: failed program was:" >&5
12987   cat conftest.$ac_ext >&5
12988   rm -rf conftest*
12989   eval "ac_cv_header_$ac_safe=no"
12990 fi
12991 rm -f conftest*
12992 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12993   echo "$ac_t""yes" 1>&6
12994   
12995     
12996 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
12997 echo "configure:12998: checking for dlopen in -ldl" >&5
12998 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
12999
13000 xe_check_libs=" -ldl "
13001 cat > conftest.$ac_ext <<EOF
13002 #line 13003 "configure"
13003 #include "confdefs.h"
13004 /* Override any gcc2 internal prototype to avoid an error.  */
13005 /* We use char because int might match the return type of a gcc2
13006     builtin and then its argument prototype would still apply.  */
13007 char dlopen();
13008
13009 int main() {
13010 dlopen()
13011 ; return 0; }
13012 EOF
13013 if { (eval echo configure:13014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13014   rm -rf conftest*
13015   eval "ac_cv_lib_$ac_lib_var=yes"
13016 else
13017   echo "configure: failed program was:" >&5
13018   cat conftest.$ac_ext >&5
13019   rm -rf conftest*
13020   eval "ac_cv_lib_$ac_lib_var=no"
13021 fi
13022 rm -f conftest*
13023 xe_check_libs=""
13024
13025 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13026   echo "$ac_t""yes" 1>&6
13027   have_dl=yes libdl=dl
13028 else
13029   echo "$ac_t""no" 1>&6
13030
13031 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
13032 echo "configure:13033: checking for dlopen in -lc" >&5
13033 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
13034
13035 xe_check_libs=" -lc "
13036 cat > conftest.$ac_ext <<EOF
13037 #line 13038 "configure"
13038 #include "confdefs.h"
13039 /* Override any gcc2 internal prototype to avoid an error.  */
13040 /* We use char because int might match the return type of a gcc2
13041     builtin and then its argument prototype would still apply.  */
13042 char dlopen();
13043
13044 int main() {
13045 dlopen()
13046 ; return 0; }
13047 EOF
13048 if { (eval echo configure:13049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13049   rm -rf conftest*
13050   eval "ac_cv_lib_$ac_lib_var=yes"
13051 else
13052   echo "configure: failed program was:" >&5
13053   cat conftest.$ac_ext >&5
13054   rm -rf conftest*
13055   eval "ac_cv_lib_$ac_lib_var=no"
13056 fi
13057 rm -f conftest*
13058 xe_check_libs=""
13059
13060 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13061   echo "$ac_t""yes" 1>&6
13062   have_dl=yes 
13063 else
13064   echo "$ac_t""no" 1>&6
13065 fi
13066
13067
13068 fi
13069
13070
13071 else
13072   echo "$ac_t""no" 1>&6
13073 fi
13074
13075   if test -n "$have_dl"; then
13076     { test "$extra_verbose" = "yes" && cat << \EOF
13077     Defining HAVE_DLOPEN
13078 EOF
13079 cat >> confdefs.h <<\EOF
13080 #define HAVE_DLOPEN 1
13081 EOF
13082 }
13083
13084   else
13085     
13086 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
13087 echo "configure:13088: checking for shl_load in -ldld" >&5
13088 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
13089
13090 xe_check_libs=" -ldld "
13091 cat > conftest.$ac_ext <<EOF
13092 #line 13093 "configure"
13093 #include "confdefs.h"
13094 /* Override any gcc2 internal prototype to avoid an error.  */
13095 /* We use char because int might match the return type of a gcc2
13096     builtin and then its argument prototype would still apply.  */
13097 char shl_load();
13098
13099 int main() {
13100 shl_load()
13101 ; return 0; }
13102 EOF
13103 if { (eval echo configure:13104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13104   rm -rf conftest*
13105   eval "ac_cv_lib_$ac_lib_var=yes"
13106 else
13107   echo "configure: failed program was:" >&5
13108   cat conftest.$ac_ext >&5
13109   rm -rf conftest*
13110   eval "ac_cv_lib_$ac_lib_var=no"
13111 fi
13112 rm -f conftest*
13113 xe_check_libs=""
13114
13115 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13116   echo "$ac_t""yes" 1>&6
13117   libdl=dld have_dl=yes;
13118       { test "$extra_verbose" = "yes" && cat << \EOF
13119     Defining HAVE_SHL_LOAD
13120 EOF
13121 cat >> confdefs.h <<\EOF
13122 #define HAVE_SHL_LOAD 1
13123 EOF
13124 }
13125
13126 else
13127   echo "$ac_t""no" 1>&6
13128
13129 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
13130 echo "configure:13131: checking for dld_init in -ldld" >&5
13131 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
13132
13133 xe_check_libs=" -ldld "
13134 cat > conftest.$ac_ext <<EOF
13135 #line 13136 "configure"
13136 #include "confdefs.h"
13137 /* Override any gcc2 internal prototype to avoid an error.  */
13138 /* We use char because int might match the return type of a gcc2
13139     builtin and then its argument prototype would still apply.  */
13140 char dld_init();
13141
13142 int main() {
13143 dld_init()
13144 ; return 0; }
13145 EOF
13146 if { (eval echo configure:13147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13147   rm -rf conftest*
13148   eval "ac_cv_lib_$ac_lib_var=yes"
13149 else
13150   echo "configure: failed program was:" >&5
13151   cat conftest.$ac_ext >&5
13152   rm -rf conftest*
13153   eval "ac_cv_lib_$ac_lib_var=no"
13154 fi
13155 rm -f conftest*
13156 xe_check_libs=""
13157
13158 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
13159   echo "$ac_t""yes" 1>&6
13160   libdl=dld have_dl=yes;
13161       { test "$extra_verbose" = "yes" && cat << \EOF
13162     Defining HAVE_DLD_INIT
13163 EOF
13164 cat >> confdefs.h <<\EOF
13165 #define HAVE_DLD_INIT 1
13166 EOF
13167 }
13168
13169 else
13170   echo "$ac_t""no" 1>&6
13171 fi
13172
13173
13174 fi
13175
13176
13177   fi
13178
13179   if test -n "$have_dl"; then
13180         
13181 dll_ld=
13182 dll_ldflags=
13183 dll_cflags=
13184 dll_post=
13185 dll_ldo="-o"
13186 ld_dynamic_link_flags=
13187 xehost=$canonical
13188 xealias=$internal_configuration
13189
13190 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
13191 echo "configure:13192: checking how to build dynamic libraries for ${xehost}" >&5
13192 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
13193 case "$xehost" in
13194 *-*-linux-gnu*) ;;
13195 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
13196 esac
13197
13198 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
13199 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
13200 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
13201
13202 case "$xehost_os" in
13203 aix3*)
13204   # AIX sometimes has problems with the GCC collect2 program.  For some
13205   # reason, if we set the COLLECT_NAMES environment variable, the problems
13206   # vanish in a puff of smoke.
13207   if test "${COLLECT_NAMES+set}" != set; then
13208     COLLECT_NAMES=
13209     export COLLECT_NAMES
13210   fi
13211   ;;
13212 esac
13213
13214 # Now see if the compiler is really GCC.
13215 if test "$GCC" = "yes"; then
13216   XEGCC=yes
13217 else
13218   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
13219 echo "configure:13220: checking checking whether we are using GNU C" >&5
13220   cat > conftest.$ac_ext <<EOF
13221 #line 13222 "configure"
13222 #include "confdefs.h"
13223
13224 #ifdef __GNUC__
13225   yes;
13226 #endif
13227
13228 EOF
13229 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13230   egrep "yes" >/dev/null 2>&1; then
13231   rm -rf conftest*
13232   XEGCC=yes
13233 else
13234   rm -rf conftest*
13235   XEGCC=no
13236 fi
13237 rm -f conftest*
13238
13239   echo "$ac_t""${XEGCC}" 1>&6
13240 fi
13241
13242 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
13243 echo "configure:13244: checking how to produce PIC code" >&5
13244 wl=
13245
13246 can_build_shared=yes
13247 if test "$XEGCC" = yes; then
13248   wl='-Wl,'
13249
13250   case "$xehost_os" in
13251   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
13252     # PIC is the default for these OSes.
13253     ;;
13254
13255   aix3* | aix4* | os2*)
13256     # We can build DLLs from non-PIC.
13257     ;;
13258   amigaos*)
13259     # FIXME: we need at least 68020 code to build shared libraries, but
13260     # adding the `-m68020' flag to GCC prevents building anything better,
13261     # like `-m68040'.
13262     dll_cflags='-m68020 -resident32 -malways-restore-a4'
13263     ;;
13264   *)
13265     dll_cflags='-fPIC'
13266     ;;
13267   esac
13268 else
13269   # PORTME Check for PIC flags for the system compiler.
13270   case "$xehost_os" in
13271   hpux9* | hpux1[0-9]*)
13272     # Is there a better link_static_flag that works with the bundled CC?
13273     wl='-Wl,'
13274     dll_cflags='+Z'
13275     ;;
13276
13277   irix5* | irix6*)
13278     wl='-Wl,'
13279     # PIC (with -KPIC) is the default.
13280     ;;
13281
13282   os2*)
13283     # We can build DLLs from non-PIC.
13284     ;;
13285
13286   osf3* | osf4*)
13287     # All OSF/1 code is PIC.
13288     wl='-Wl,'
13289     ;;
13290
13291   sco3.2v5*)
13292     dll_cflags='-belf -Kpic'
13293     wl='-Wl,'
13294     ;;
13295
13296   unixware*)
13297     dll_cflags="-KPIC"
13298     wl="-Wl,"
13299     ;;
13300
13301   sysv4*)
13302     dll_cflags="-KPIC"
13303     wl="-Wl,"
13304     ;;
13305
13306   sysv5*)
13307     dll_cflags="-KPIC"
13308     wl="-Wl,"
13309     ;;
13310
13311   solaris2*)
13312     dll_cflags='-KPIC'
13313     wl='-Wl,'
13314     ;;
13315
13316   sunos4*)
13317     dll_cflags='-PIC'
13318     wl='-Qoption ld '
13319     ;;
13320
13321   uts4*)
13322     dll_cflags='-pic'
13323     ;;
13324
13325   *)
13326     can_build_shared=no
13327     ;;
13328   esac
13329 fi
13330
13331 if test -n "$dll_cflags"; then
13332   echo "$ac_t""${dll_cflags}" 1>&6
13333   
13334   # Check to make sure the dll_cflags actually works.
13335   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
13336 echo "configure:13337: checking if PIC flag ${dll_cflags} really works" >&5
13337   save_CFLAGS="$CFLAGS"
13338   CFLAGS="$CFLAGS $dll_cflags -DPIC"
13339   cat > conftest.$ac_ext <<EOF
13340 #line 13341 "configure"
13341 #include "confdefs.h"
13342
13343 int main() {
13344 int x=0;
13345 ; return 0; }
13346 EOF
13347 if { (eval echo configure:13348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13348   rm -rf conftest*
13349   
13350     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
13351     # reports no error.  So, we need to grep stderr for (Bundled).
13352     if grep '(Bundled)' config.log >/dev/null; then
13353       echo "$ac_t""no" 1>&6
13354       can_build_shared=no
13355       dll_cflags=
13356     else
13357       echo "$ac_t""yes" 1>&6
13358     fi
13359 else
13360   echo "configure: failed program was:" >&5
13361   cat conftest.$ac_ext >&5
13362   rm -rf conftest*
13363   echo "$ac_t""no" 1>&6
13364     can_build_shared=no
13365     dll_cflags=
13366 fi
13367 rm -f conftest*
13368   CFLAGS="$save_CFLAGS"
13369 else
13370   echo "$ac_t""none" 1>&6
13371 fi
13372
13373 if test "$can_build_shared" = "yes"; then
13374 cc_produces_so=no
13375 xldf=
13376 xcldf=
13377 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
13378 echo "configure:13379: checking if C compiler can produce shared libraries" >&5
13379 if test "$XEGCC" = yes; then
13380   xcldf="-shared"
13381   xldf="-shared"
13382 else # Not using GCC
13383   case "$xehost_os" in
13384     aix3* | aix4*)
13385       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
13386       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
13387       ;;
13388
13389     freebsd2* | netbsd* | openbsd*)
13390       xldf="-Bshareable"
13391       xcldf="${wl}-Bshareable"
13392       ;;
13393
13394     freebsd3*)
13395       xcldf="-shared"
13396       ;;
13397
13398     hpux*)
13399       xldf="-b +s"
13400       xcldf="${wl}-b ${wl}+s"
13401       ;;
13402
13403     irix5* | irix6* | osf3* | osf4*)
13404       xcldf="${wl}-shared"
13405       xldf="-shared"
13406       ;;
13407
13408     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
13409       xcldf="-G"
13410       xldf="-G"
13411       ;;
13412
13413     sunos4*)
13414       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
13415       xldf="-assert pure-text -Bstatic"
13416       ;;
13417   esac
13418 fi # End if if we are using gcc
13419
13420 if test -n "$xcldf"; then
13421   save_LDFLAGS=$LDFLAGS
13422   save_LIBS=$LIBS
13423   save_xe_libs=$xe_libs
13424   LDFLAGS="$xcldf $LDFLAGS"
13425   LIBS=
13426   xe_libs=
13427   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
13428   cat > conftest.$ac_ext <<EOF
13429 #line 13430 "configure"
13430 #include "confdefs.h"
13431
13432 int main() {
13433 int x=0;
13434 ; return 0; }
13435 EOF
13436 if { (eval echo configure:13437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13437   rm -rf conftest*
13438   cc_produces_so=yes
13439 else
13440   echo "configure: failed program was:" >&5
13441   cat conftest.$ac_ext >&5
13442   rm -rf conftest*
13443   cc_produces_so=no
13444 fi
13445 rm -f conftest*
13446   LDFLAGS=$save_LDFLAGS
13447   LIBS=$save_LIBS
13448   xe_libs=$save_xe_libs
13449   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
13450 else
13451   cc_produces_so=no
13452 fi
13453 echo "$ac_t""${cc_produces_so}" 1>&6
13454
13455 LTLD=$LD
13456 if test -z "$LTLD"; then
13457   ac_prog=ld
13458   if test "$XEGCC" = yes; then
13459     # Check if gcc -print-prog-name=ld gives a path.
13460     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
13461 echo "configure:13462: checking for ld used by GCC" >&5
13462     ac_prog=`($CC -print-prog-name=ld) 2>&5`
13463     case "$ac_prog" in
13464     # Accept absolute paths.
13465     /*)
13466       if test -z "$LTLD"; then
13467         case "$ac_prog" in
13468           *gcc-lib*) LTLD="$CC"
13469                      ;;
13470           *)         LTLD="$ac_prog"
13471                      ;;
13472         esac
13473       fi
13474       ;;
13475     "")
13476       # If it fails, then pretend we aren't using GCC.
13477       ac_prog=ld
13478       ;;
13479     *)
13480       # If it is relative, then search for the first ld in PATH.
13481       with_gnu_ld=unknown
13482       ;;
13483     esac
13484   else
13485     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
13486 echo "configure:13487: checking for GNU ld" >&5
13487   fi
13488
13489   if test -z "$LTLD"; then
13490     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
13491     for ac_dir in $PATH; do
13492       test -z "$ac_dir" && ac_dir=.
13493       if test -f "$ac_dir/$ac_prog"; then
13494         LTLD="$ac_dir/$ac_prog"
13495         # Check to see if the program is GNU ld.  I'd rather use --version,
13496         # but apparently some GNU ld's only accept -v.
13497         # Break only if it was the GNU/non-GNU ld that we prefer.
13498         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
13499           xe_gnu_ld=yes
13500         else
13501           xe_gnu_ld=no
13502         fi
13503       fi
13504     done
13505     IFS="$ac_save_ifs"
13506   fi
13507
13508   if test -n "$LTLD"; then
13509     echo "$ac_t""${LTLD}" 1>&6
13510   else
13511     echo "$ac_t""no" 1>&6
13512   fi
13513
13514   if test -z "$LTLD" -a "$cc_produces_so" = no; then
13515     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
13516     exit 1
13517   fi
13518 fi
13519
13520 ld_dynamic_link_flags=
13521
13522 # Check to see if it really is or isn't GNU ld.
13523 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
13524 echo "configure:13525: checking if the linker is GNU ld" >&5
13525 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
13526 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
13527   xe_gnu_ld=yes
13528 else
13529   xe_gnu_ld=no
13530 fi
13531 echo "$ac_t""${xe_gnu_ld}" 1>&6
13532
13533 case "$xehost_os" in
13534   amigaos* | sunos4*)
13535     # On these operating systems, we should treat GNU ld like the system ld.
13536     gnu_ld_acts_native=yes
13537     ;;
13538   *)
13539     gnu_ld_acts_native=no
13540     ;;
13541 esac
13542
13543 if test "$cc_produces_so" = "yes"; then
13544   dll_ld=$CC
13545   dll_ldflags=$xcldf
13546   can_build_shared=yes
13547   ld_shlibs=yes
13548 else
13549   # OK - only NOW do we futz about with ld.
13550   # See if the linker supports building shared libraries.
13551   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
13552 echo "configure:13553: checking whether the linker supports shared libraries" >&5
13553   dll_ld=$CC
13554   dll_ldflags=$LDFLAGS
13555   ld_shlibs=yes
13556   can_build_shared=yes
13557   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
13558     # See if GNU ld supports shared libraries.
13559     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
13560       dll_ld=$CC
13561       dll_ldflags="-shared"
13562       ld_shlibs=yes
13563     else
13564       ld_shlibs=no
13565     fi
13566   else
13567     # PORTME fill in a description of your system's linker (not GNU ld)
13568     case "$xehost_os" in
13569     aix3*)
13570       dll_ld=$LTLD
13571       dll_ldflags=$xldf
13572       ;;
13573
13574     aix4*)
13575       dll_ldflags=$xcldf
13576       ;;
13577
13578     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
13579     # support.  Future versions do this automatically, but an explicit c++rt0.o
13580     # doesn't break anything, and helps significantly (at the cost of a little
13581     # extra space).
13582     freebsd2.2*)
13583       dll_ld=$LTLD
13584       dll_ldflags=$xldf
13585       dll_post="/usr/lib/c++rt0.o"
13586       ;;
13587
13588     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
13589     freebsd2*)
13590       dll_ld=$LTLD
13591       dll_ldflags="-Bshareable"
13592       ;;
13593
13594     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
13595     freebsd3*)
13596       dll_ldflags="-shared"
13597       ;;
13598
13599     hpux*)
13600       dll_ld=$LTLD
13601       dll_ldflags=$xldf
13602       ;;
13603
13604     irix5* | irix6*)
13605       dll_ld=$LTLD
13606       dll_ldflags=$xldf
13607       ;;
13608
13609     netbsd*)
13610       # Tested with NetBSD 1.2 ld
13611       dll_ld=$LTLD
13612       dll_ldflags=$xldf
13613       ;;
13614
13615     openbsd*)
13616       dll_ld=$LTLD
13617       dll_ldflags=$xldf
13618       ;;
13619
13620     osf3* | osf4*)
13621       dll_ld=$LTLD
13622       dll_ldflags=$xldf
13623       ;;
13624
13625     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
13626     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
13627       dll_ld=$LTLD
13628       case "$dll_ld" in
13629         *gcc*) dll_ldflags="-shared"
13630                dll_ld=$CC
13631                ;;
13632         *)     dll_ldflags="-G"
13633                ;;
13634       esac
13635       ;;
13636
13637     sunos4*)
13638       if test "$XEGCC" = yes; then
13639         dll_ld=$CC
13640       else
13641         dll_ld=$LTLD
13642       fi
13643       dll_ldflags=$xldf
13644       ;;
13645
13646     uts4*)
13647       dll_ld=$LTLD
13648       dll_ldflags="-G"
13649       ;;
13650
13651     bsdi*)
13652       dll_ldflags="-r"
13653       dll_ld="shlicc2"
13654       ;;
13655
13656     *)
13657       ld_shlibs=no
13658       can_build_shared=no
13659       ;;
13660     esac
13661   fi
13662   echo "$ac_t""${ld_shlibs}" 1>&6
13663   if test "$ld_shlibs" = "no"; then
13664     can_build_shared=no
13665   fi
13666 fi # End of if cc_produces_so = no
13667
13668
13669 if test "$xe_gnu_ld" = yes; then
13670   if test "$ld_shlibs" = yes; then
13671     ld_dynamic_link_flags="${wl}-export-dynamic"
13672   fi
13673 fi
13674
13675 if test -z "$ld_dynamic_link_flags"; then
13676   case "$xehost_os" in
13677   aix3*)
13678     ld_dynamic_link_flags=
13679     ;;
13680
13681   aix4*)
13682     ld_dynamic_link_flags=
13683     ;;
13684
13685   freebsd2.2*)
13686     ld_dynamic_link_flags=
13687     ;;
13688
13689   freebsd2*)
13690     ld_dynamic_link_flags=
13691     ;;
13692
13693   freebsd3*)
13694     ld_dynamic_link_flags=
13695     ;;
13696
13697   hpux*)
13698     ld_dynamic_link_flags="${wl}-E"
13699     ;;
13700
13701   irix5* | irix6*)
13702     ld_dynamic_link_flags=
13703     ;;
13704
13705   netbsd*)
13706     ld_dynamic_link_flags=
13707     ;;
13708
13709   openbsd*)
13710     ld_dynamic_link_flags=
13711     ;;
13712
13713   osf3* | osf4*)
13714     ld_dynamic_link_flags=
13715     ;;
13716
13717   solaris2* | solaris7*)
13718     ld_dynamic_link_flags=
13719     ;;
13720
13721   sco3.2v5* | unixware* | sysv5* | sysv4*)
13722     ld_dynamic_link_flags="${wl}-Bexport"
13723     ;;
13724
13725   sunos4*)
13726     ld_dynamic_link_flags=
13727     ;;
13728
13729   uts4*)
13730     ld_dynamic_link_flags=
13731     ;;
13732
13733   bsdi*)
13734     ld_dynamic_link_flags=
13735     ;;
13736
13737   esac
13738 fi # End of if -z ld_dynamic_link_flags
13739 fi # End of if test "$can_build_shared" = "yes"
13740
13741
13742
13743
13744
13745
13746
13747
13748   fi
13749
13750   if test "$can_build_shared" = "yes"; then
13751     { test "$extra_verbose" = "yes" && cat << \EOF
13752     Defining HAVE_SHLIB
13753 EOF
13754 cat >> confdefs.h <<\EOF
13755 #define HAVE_SHLIB 1
13756 EOF
13757 }
13758
13759     extra_objs="$extra_objs sysdll.o emodules.o" &&  if test "$extra_verbose" = "yes"; then
13760    echo "    xemacs will be linked with \"sysdll.o emodules.o\""
13761  fi
13762     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
13763     test -n "$libdl" && LIBS="-l${libdl} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${libdl}\" to \$LIBS"; fi
13764     for ac_func in dlerror _dlerror
13765 do
13766 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
13767 echo "configure:13768: checking for $ac_func" >&5
13768
13769 cat > conftest.$ac_ext <<EOF
13770 #line 13771 "configure"
13771 #include "confdefs.h"
13772 /* System header to define __stub macros and hopefully few prototypes,
13773     which can conflict with char $ac_func(); below.  */
13774 #include <assert.h>
13775 /* Override any gcc2 internal prototype to avoid an error.  */
13776 /* We use char because int might match the return type of a gcc2
13777     builtin and then its argument prototype would still apply.  */
13778 char $ac_func();
13779
13780 int main() {
13781
13782 /* The GNU C library defines this for functions which it implements
13783     to always fail with ENOSYS.  Some functions are actually named
13784     something starting with __ and the normal name is an alias.  */
13785 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13786 choke me
13787 #else
13788 $ac_func();
13789 #endif
13790
13791 ; return 0; }
13792 EOF
13793 if { (eval echo configure:13794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13794   rm -rf conftest*
13795   eval "ac_cv_func_$ac_func=yes"
13796 else
13797   echo "configure: failed program was:" >&5
13798   cat conftest.$ac_ext >&5
13799   rm -rf conftest*
13800   eval "ac_cv_func_$ac_func=no"
13801 fi
13802 rm -f conftest*
13803
13804 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
13805   echo "$ac_t""yes" 1>&6
13806     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
13807   { test "$extra_verbose" = "yes" && cat << EOF
13808     Defining $ac_tr_func
13809 EOF
13810 cat >> confdefs.h <<EOF
13811 #define $ac_tr_func 1
13812 EOF
13813 }
13814  
13815 else
13816   echo "$ac_t""no" 1>&6
13817 fi
13818 done
13819
13820     with_modules=yes
13821   else
13822     if test "$with_modules" = "yes"; then
13823       { echo "Error:" "Required module support cannot be provided." >&2; exit 1; }
13824     else
13825       echo "configure: warning: "Module support cannot be provided."" 1>&2
13826     fi
13827     with_modules=no
13828   fi
13829 fi
13830
13831 cat > conftest.$ac_ext <<EOF
13832 #line 13833 "configure"
13833 #include "confdefs.h"
13834 int main(int c,char *v[]){return 0;}
13835 EOF
13836 if { (eval echo configure:13837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
13837 then
13838   :
13839 else
13840   conftest_rc="$?"
13841   echo "configure: failed program was:" >&5
13842   cat conftest.$ac_ext >&5
13843   rm -fr conftest*
13844   
13845   echo ""
13846   echo "*** PANIC *** The C compiler can no longer build working executables."
13847   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
13848   echo "*** PANIC *** The most likely reason for this problem is that configure"
13849   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
13850   echo "*** PANIC *** found at run time."
13851   echo "*** PANIC ***"
13852   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
13853   echo "*** PANIC *** On other systems, try telling configure where to find the"
13854   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
13855   echo "*** PANIC ***"
13856   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
13857   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
13858   echo "*** PANIC *** on your system.  Don't do that."
13859   exit 1
13860 fi
13861 rm -fr conftest*
13862
13863 if test "$win32_processes" = "yes"; then
13864   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
13865    echo "    xemacs will be linked with \"process-nt.o\""
13866  fi
13867 else
13868   { test "$extra_verbose" = "yes" && cat << \EOF
13869     Defining HAVE_UNIX_PROCESSES
13870 EOF
13871 cat >> confdefs.h <<\EOF
13872 #define HAVE_UNIX_PROCESSES 1
13873 EOF
13874 }
13875
13876   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
13877    echo "    xemacs will be linked with \"process-unix.o\""
13878  fi
13879 fi
13880
13881
13882
13883 T=""
13884 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13885 CFLAGS="$T"
13886
13887
13888 T=""
13889 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13890 extra_objs="$T"
13891
13892
13893 T=""
13894 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
13895 c_switch_general="$T"
13896
13897
13898 T=""
13899 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13900 c_switch_window_system="$T"
13901
13902
13903 T=""
13904 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13905 c_switch_all="$T"
13906
13907
13908 T=""
13909 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
13910 ld_switch_general="$T"
13911
13912
13913 T=""
13914 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13915 ld_switch_window_system="$T"
13916
13917
13918 T=""
13919 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13920 ld_switch_all="$T"
13921
13922
13923 T=""
13924 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13925 ld_libs_general="$T"
13926
13927
13928 T=""
13929 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
13930 ld_libs_window_system="$T"
13931
13932
13933 T=""
13934 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13935 ld_libs_all="$T"
13936
13937
13938
13939 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
13940 internal_makefile_list="Makefile.in"
13941 SUBDIR_MAKEFILES=''
13942 test -d lock || mkdir lock
13943 for dir in $MAKE_SUBDIR; do
13944   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
13945         test -d "$d" || mkdir "$d"; cd "$d"
13946       done ) ;;
13947    * ) test -d "$dir" || mkdir "$dir" ;;
13948   esac
13949   
13950 T=""
13951 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13952 SUBDIR_MAKEFILES="$T"
13953
13954   
13955 T=""
13956 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13957 internal_makefile_list="$T"
13958
13959 done
13960
13961
13962
13963
13964 for dir in src/s src/m; do
13965   if test ! -d "$dir" ; then
13966     echo Making symbolic link to "$srcdir/$dir"
13967     ${LN_S} "$srcdir/$dir" "$dir"
13968   fi
13969 done
13970
13971 if test "$extra_verbose" = "yes"; then
13972   echo ""
13973   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
13974   echo ""
13975 fi
13976
13977
13978 if test -f "$srcdir/src/.gdbinit" -a ! -f "src/.gdbinit"; then
13979   test "$extra_verbose" = "yes" && echo "creating src/.gdbinit"
13980   echo "source $srcdir/src/.gdbinit" > "src/.gdbinit"
13981 fi
13982
13983 if test -f "$srcdir/src/.dbxrc" -a ! -f "src/.dbxrc"; then
13984   test "$extra_verbose" = "yes" && echo "creating src/.dbxrc"
13985   echo ". $srcdir/src/.dbxrc" > "src/.dbxrc"
13986 fi
13987
13988 if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then
13989   test "$extra_verbose" = "yes" && echo "creating TAGS"
13990   echo "\f
13991 $srcdir/TAGS,include" > "TAGS"
13992 fi
13993
13994 if test "$__SUNPRO_C" = "yes"; then
13995   test "$extra_verbose" = "yes" && echo "creating .sbinit"
13996   ( echo "# For use with Sun WorkShop's Source browser."
13997     echo "# See sbquery(1) and sbinit(4) for more information"
13998     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
13999   ) > .sbinit
14000 fi
14001
14002 rm -f core
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022 PREFIX=$prefix
14023 while true; do
14024   case "$PREFIX" in
14025     *\$* ) eval "PREFIX=$PREFIX" ;;
14026     *) break ;;
14027   esac
14028 done
14029
14030
14031
14032
14033 EXEC_PREFIX=$exec_prefix
14034 while true; do
14035   case "$EXEC_PREFIX" in
14036     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
14037     *) break ;;
14038   esac
14039 done
14040
14041
14042
14043
14044 INFODIR=$infodir
14045 while true; do
14046   case "$INFODIR" in
14047     *\$* ) eval "INFODIR=$INFODIR" ;;
14048     *) break ;;
14049   esac
14050 done
14051
14052
14053
14054
14055 INFOPATH=$infopath
14056 while true; do
14057   case "$INFOPATH" in
14058     *\$* ) eval "INFOPATH=$INFOPATH" ;;
14059     *) break ;;
14060   esac
14061 done
14062
14063
14064
14065
14066 PACKAGE_PATH=$package_path
14067 while true; do
14068   case "$PACKAGE_PATH" in
14069     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
14070     *) break ;;
14071   esac
14072 done
14073
14074
14075
14076
14077 LISPDIR=$lispdir
14078 while true; do
14079   case "$LISPDIR" in
14080     *\$* ) eval "LISPDIR=$LISPDIR" ;;
14081     *) break ;;
14082   esac
14083 done
14084
14085
14086
14087
14088 MODULEDIR=$moduledir
14089 while true; do
14090   case "$MODULEDIR" in
14091     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
14092     *) break ;;
14093   esac
14094 done
14095
14096
14097
14098
14099 SITELISPDIR=$sitelispdir
14100 while true; do
14101   case "$SITELISPDIR" in
14102     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
14103     *) break ;;
14104   esac
14105 done
14106
14107
14108
14109
14110 SITEMODULEDIR=$sitemoduledir
14111 while true; do
14112   case "$SITEMODULEDIR" in
14113     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
14114     *) break ;;
14115   esac
14116 done
14117
14118
14119
14120
14121 ETCDIR=$etcdir
14122 while true; do
14123   case "$ETCDIR" in
14124     *\$* ) eval "ETCDIR=$ETCDIR" ;;
14125     *) break ;;
14126   esac
14127 done
14128
14129
14130
14131
14132 DOCDIR=$docdir
14133 while true; do
14134   case "$DOCDIR" in
14135     *\$* ) eval "DOCDIR=$DOCDIR" ;;
14136     *) break ;;
14137   esac
14138 done
14139
14140
14141
14142
14143 ARCHLIBDIR=$archlibdir
14144 while true; do
14145   case "$ARCHLIBDIR" in
14146     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
14147     *) break ;;
14148   esac
14149 done
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
14171
14172
14173
14174
14175
14176
14177
14178 : ${XEMACS_CC:=$CC}
14179
14180
14181 if test "$with_prefix" = "yes"; then
14182   { test "$extra_verbose" = "yes" && cat << \EOF
14183     Defining PREFIX_USER_DEFINED
14184 EOF
14185 cat >> confdefs.h <<\EOF
14186 #define PREFIX_USER_DEFINED 1
14187 EOF
14188 }
14189
14190 fi
14191
14192 if test "$with_site_lisp" = "no"; then
14193   { test "$extra_verbose" = "yes" && cat << \EOF
14194     Defining INHIBIT_SITE_LISP
14195 EOF
14196 cat >> confdefs.h <<\EOF
14197 #define INHIBIT_SITE_LISP 1
14198 EOF
14199 }
14200
14201 fi
14202 if test "$with_site_modules" = "no"; then
14203   { test "$extra_verbose" = "yes" && cat << \EOF
14204     Defining INHIBIT_SITE_MODULES
14205 EOF
14206 cat >> confdefs.h <<\EOF
14207 #define INHIBIT_SITE_MODULES 1
14208 EOF
14209 }
14210
14211 fi
14212
14213
14214 T=""
14215 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
14216 ac_configure_args="$T"
14217
14218 { test "$extra_verbose" = "yes" && cat << EOF
14219     Defining EMACS_CONFIGURATION = "$configuration"
14220 EOF
14221 cat >> confdefs.h <<EOF
14222 #define EMACS_CONFIGURATION "$configuration"
14223 EOF
14224 }
14225
14226 { test "$extra_verbose" = "yes" && cat << EOF
14227     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
14228 EOF
14229 cat >> confdefs.h <<EOF
14230 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
14231 EOF
14232 }
14233
14234 { test "$extra_verbose" = "yes" && cat << EOF
14235     Defining config_machfile = "$machfile"
14236 EOF
14237 cat >> confdefs.h <<EOF
14238 #define config_machfile "$machfile"
14239 EOF
14240 }
14241
14242 { test "$extra_verbose" = "yes" && cat << EOF
14243     Defining config_opsysfile = "$opsysfile"
14244 EOF
14245 cat >> confdefs.h <<EOF
14246 #define config_opsysfile "$opsysfile"
14247 EOF
14248 }
14249
14250
14251
14252 null_string=""
14253 { test "$extra_verbose" = "yes" && cat << EOF
14254     Defining LD_SWITCH_X_SITE = $null_string
14255 EOF
14256 cat >> confdefs.h <<EOF
14257 #define LD_SWITCH_X_SITE $null_string
14258 EOF
14259 }
14260
14261 { test "$extra_verbose" = "yes" && cat << EOF
14262     Defining LD_SWITCH_X_SITE_AUX = $null_string
14263 EOF
14264 cat >> confdefs.h <<EOF
14265 #define LD_SWITCH_X_SITE_AUX $null_string
14266 EOF
14267 }
14268
14269 { test "$extra_verbose" = "yes" && cat << EOF
14270     Defining C_SWITCH_X_SITE = $null_string
14271 EOF
14272 cat >> confdefs.h <<EOF
14273 #define C_SWITCH_X_SITE $null_string
14274 EOF
14275 }
14276
14277 { test "$extra_verbose" = "yes" && cat << EOF
14278     Defining LD_SWITCH_SITE = $null_string
14279 EOF
14280 cat >> confdefs.h <<EOF
14281 #define LD_SWITCH_SITE $null_string
14282 EOF
14283 }
14284
14285 { test "$extra_verbose" = "yes" && cat << EOF
14286     Defining C_SWITCH_SITE = $null_string
14287 EOF
14288 cat >> confdefs.h <<EOF
14289 #define C_SWITCH_SITE $null_string
14290 EOF
14291 }
14292
14293
14294
14295 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14296     Defining GNU_MALLOC
14297 EOF
14298 cat >> confdefs.h <<\EOF
14299 #define GNU_MALLOC 1
14300 EOF
14301 }
14302
14303 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14304     Defining USE_SYSTEM_MALLOC
14305 EOF
14306 cat >> confdefs.h <<\EOF
14307 #define USE_SYSTEM_MALLOC 1
14308 EOF
14309 }
14310
14311 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
14312     Defining USE_DEBUG_MALLOC
14313 EOF
14314 cat >> confdefs.h <<\EOF
14315 #define USE_DEBUG_MALLOC 1
14316 EOF
14317 }
14318
14319                                               { test "$extra_verbose" = "yes" && cat << \EOF
14320     Defining USE_SYSTEM_MALLOC
14321 EOF
14322 cat >> confdefs.h <<\EOF
14323 #define USE_SYSTEM_MALLOC 1
14324 EOF
14325 }
14326
14327 fi
14328 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14329     Defining I18N3
14330 EOF
14331 cat >> confdefs.h <<\EOF
14332 #define I18N3 1
14333 EOF
14334 }
14335
14336 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14337     Defining USE_GCC
14338 EOF
14339 cat >> confdefs.h <<\EOF
14340 #define USE_GCC 1
14341 EOF
14342 }
14343
14344 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14345     Defining EXTERNAL_WIDGET
14346 EOF
14347 cat >> confdefs.h <<\EOF
14348 #define EXTERNAL_WIDGET 1
14349 EOF
14350 }
14351
14352 test "$quick_build"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14353     Defining QUICK_BUILD
14354 EOF
14355 cat >> confdefs.h <<\EOF
14356 #define QUICK_BUILD 1
14357 EOF
14358 }
14359
14360 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14361     Defining PURIFY
14362 EOF
14363 cat >> confdefs.h <<\EOF
14364 #define PURIFY 1
14365 EOF
14366 }
14367
14368 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14369     Defining QUANTIFY
14370 EOF
14371 cat >> confdefs.h <<\EOF
14372 #define QUANTIFY 1
14373 EOF
14374 }
14375
14376 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14377     Defining MAIL_USE_POP
14378 EOF
14379 cat >> confdefs.h <<\EOF
14380 #define MAIL_USE_POP 1
14381 EOF
14382 }
14383
14384 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14385     Defining KERBEROS
14386 EOF
14387 cat >> confdefs.h <<\EOF
14388 #define KERBEROS 1
14389 EOF
14390 }
14391
14392 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14393     Defining HESIOD
14394 EOF
14395 cat >> confdefs.h <<\EOF
14396 #define HESIOD 1
14397 EOF
14398 }
14399
14400 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14401     Defining USE_UNION_TYPE
14402 EOF
14403 cat >> confdefs.h <<\EOF
14404 #define USE_UNION_TYPE 1
14405 EOF
14406 }
14407
14408 test "$pdump"              = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
14409     Defining PDUMP
14410 EOF
14411 cat >> confdefs.h <<\EOF
14412 #define PDUMP 1
14413 EOF
14414 }
14415
14416
14417
14418 (
14419 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
14420 else
14421   echo "uname -a: `uname -a`"
14422 fi
14423 echo ""
14424 echo "$0 $quoted_arguments"
14425 ) > Installation
14426
14427 if test ! -z ${emacs_beta_version} ; then
14428   if test -z "${emacs_is_beta}" ; then
14429         xemacs_betaname=".${emacs_beta_version}"
14430   else
14431         xemacs_betaname="-b${emacs_beta_version}"
14432   fi
14433 else
14434   xemacs_betaname=""
14435 fi
14436
14437 (
14438 echo "
14439
14440 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
14441 "
14442 echo "
14443 Compilation / Installation:"
14444 echo "  Source code location:              $srcdir"
14445 echo "  Installation prefix:               $prefix"
14446 if test -n "$site_includes"; then
14447   echo "  Additional header files:           $site_includes"
14448 fi
14449 if test -n "$site_libraries"; then
14450   echo "  Additional libraries:              $site_libraries"
14451 fi
14452 if test -n "$site_prefixes"; then
14453   echo "  Additional prefixes:               $site_prefixes"
14454 fi
14455 if test -n "$runpath"; then
14456   echo "  Runtime library search path:       $runpath"
14457 fi
14458 echo "  Operating system description file: \`$opsysfile'"
14459 echo "  Machine description file:          \`$machfile'"
14460 echo "  Compiler:                          $CC $CFLAGS"
14461 echo "  Relocating allocator for buffers:  $rel_alloc"
14462 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
14463
14464 echo "
14465 Window System:"
14466 if test "$with_msw" = "yes"; then
14467   echo "  Compiling in support for the Microsoft window system."
14468 fi
14469 if test "$with_x11" = "yes"; then
14470   echo "  Compiling in support for the X window system:"
14471   echo "    - X Windows headers location:                 $x_includes"
14472   echo "    - X Windows libraries location:               $x_libraries"
14473   if test "$with_xauth" != yes; then
14474     echo "    - Xau (X authority) not available."
14475   fi
14476   if test "$with_xmu" != yes; then
14477     echo "    - Xmu library not available; substituting equivalent routines."
14478   fi
14479   if test "$with_wmcommand" != no; then
14480     echo "    - Handling WM_COMMAND properly."
14481   fi
14482 fi
14483 if test "$have_xaw" = "yes"; then
14484   echo "  Compiling in support for the Athena widget set:"
14485   echo "    - Athena headers location:                    $athena_h_path"
14486   echo "    - Athena library to link:                     $athena_lib"
14487 fi
14488 case "$with_menubars" in
14489   lucid ) echo "  Using Lucid menubars." ;;
14490   motif ) echo "  Using Motif menubars."
14491           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
14492           echo "             We recommend using the Lucid menubar instead."
14493           echo "             Re-run configure with --with-menubars='lucid'." ;;
14494     msw ) echo "  Using MS-Windows menubars." ;;
14495 esac
14496 case "$with_scrollbars" in
14497   lucid  ) echo "  Using Lucid scrollbars."      ;;
14498   motif  ) echo "  Using Motif scrollbars."      ;;
14499   athena ) echo "  Using Athena scrollbars."     ;;
14500      msw ) echo "  Using MS-Windows scrollbars." ;;
14501 esac
14502 case "$with_dialogs" in
14503   motif  ) echo "  Using Motif dialog boxes."
14504            if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
14505              echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
14506              echo "             We recommend using the Athena dialog boxes instead."
14507              echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
14508              echo "             Read the PROBLEMS file for more information."
14509            fi; fi ;;
14510   athena ) echo "  Using Athena dialog boxes."     ;;
14511      msw ) echo "  Using MS-Windows dialog boxes." ;;
14512 esac
14513 case "$with_widgets" in
14514   motif  ) echo "  Using Motif native widgets."      ;;
14515   athena ) echo "  Using Athena native widgets."     ;;
14516      msw ) echo "  Using MS-Windows native widgets." ;;
14517 esac
14518 if test "$with_dragndrop" = yes; then
14519   echo "  Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
14520   echo "    -  Drag'n'Drop prototype:                             $dragndrop_proto."
14521 fi
14522
14523 echo "
14524 TTY:"
14525 test "$with_ncurses" = yes && echo "  Compiling in support for ncurses."
14526 test "$with_gpm" = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
14527
14528 echo "
14529 Images:"
14530 test "$with_gif" = yes && echo "  Compiling in support for GIF  images (builtin)."
14531 if test "$with_xpm" = yes; then
14532   echo "  Compiling in support for XPM  images."
14533 elif test "$with_x11" = yes; then
14534   echo "  WARNING: -----------------------------------------------------------"
14535   echo "  WARNING: Compiling without XPM image support."
14536   if test "$xpm_problem" != ""; then
14537     echo "  Reason: $xpm_problem"
14538   fi
14539   echo "  WARNING: You should strongly consider installing XPM."
14540   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
14541   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
14542   echo "  WARNING: -----------------------------------------------------------"
14543 fi
14544 if test "$with_png" = yes; then
14545   echo "  Compiling in support for PNG  images."
14546 elif test "$window_system" != "none"; then
14547   echo "  WARNING: -----------------------------------------------------------"
14548   echo "  WARNING: Compiling without PNG image support."
14549   if test "$png_problem" != ""; then
14550     echo "  Reason: $png_problem"
14551   fi
14552   echo "  WARNING: You should strongly consider installing the PNG libraries."
14553   echo "  WARNING: Otherwise certain images and glyphs may not display."
14554   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
14555   echo "  WARNING: -----------------------------------------------------------"
14556 fi
14557 test "$with_jpeg" = yes && echo "  Compiling in support for JPEG images."
14558 test "$with_tiff" = yes && echo "  Compiling in support for TIFF images."
14559 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
14560
14561 echo "
14562 Sound:"
14563 test "$with_native_sound" = yes && echo "  Compiling in support for sound (native)."
14564 test "$with_nas_sound" = yes && echo "  Compiling in support for NAS (network audio system)."
14565 test "$old_nas" = yes && echo "    - NAS library lacks error trapping; will play synchronously."
14566 test "$with_esd_sound" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
14567
14568 echo "
14569 Databases:"
14570 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
14571 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
14572 test "$with_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
14573 test "$with_ldap" = yes && echo "  Compiling in support for LDAP."
14574 if test "$with_postgresql" = yes; then
14575   echo "  Compiling in support for PostgreSQL."
14576   if test "$with_postgresqlv7" = yes; then
14577     echo "    - Using PostgreSQL V7 bindings."
14578   fi
14579   if test -n "$postgres_h_path"; then
14580     echo "    - PostgreSQL headers location:  $postgres_h_path"
14581   fi
14582 fi
14583
14584 echo "
14585 Internationalization:"
14586 test "$with_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
14587 test "$with_utf_2000" = yes && echo "  Using UTF-2000 (UTF-8) buffer/string representation."
14588 test "$with_text_coding" = yes && echo "  Compiling in support for text coding."
14589 test "$with_file_coding" = yes && echo "  Compiling in support for file coding."
14590 test "$with_xim" != no && echo "  Compiling in support for XIM (X11R5+ I18N input method)."
14591 test "$with_xim" = motif && echo "    - Using Motif to provide XIM support."
14592 test "$with_xim" = xlib && echo "    - Using raw Xlib to provide XIM support."
14593 test "$with_xfs" = yes && echo "    - Using XFontSet to provide bilingual menubar."
14594 test "$with_canna" = yes && echo "  Compiling in support for Canna on Mule."
14595 if test "$with_wnn" = yes; then
14596   echo "  Compiling in support for the WNN input method on Mule."
14597   test "$with_wnn6" = yes && echo "    - Using WNN version 6."
14598 fi
14599 test "$with_i18n3" = yes && echo "  Compiling in support for I18N level 3 (doesn't currently work)."
14600
14601 echo "
14602 Mail:"
14603 test "$with_pop" = yes && echo "  Compiling in support for POP mail retrieval."
14604 test "$with_kerberos" = yes && echo "  Compiling in support for Kerberos POP authentication."
14605 test "$with_hesiod" = yes && echo "  Compiling in support for Hesiod POP server access."
14606 echo "  Compiling in support for \"$mail_locking\" mail spool file locking method."
14607
14608 echo "
14609 Other Features:"
14610 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
14611 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
14612 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
14613 test "$with_dnet" = yes && echo "  Compiling in support for DNET."
14614 test "$with_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
14615 test "$use_union_type" = yes && echo "  Using the union type for Lisp_Objects."
14616 test "$pdump" = yes && echo "  Using the new portable dumper."
14617 test "$debug" = yes && echo "  Compiling in support for extra debugging code."
14618 test "$usage_tracking" = yes && echo "  Compiling in support for active usage tracking (Sun internal)."
14619 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc $error_check_glyphs" \
14620   != "no no no no no no"; then
14621   echo "  WARNING: ---------------------------------------------------------"
14622   echo "  WARNING: Compiling in support for runtime error checking."
14623   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
14624   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
14625   echo "  WARNING: ---------------------------------------------------------"
14626 fi
14627 echo ""
14628 ) | tee -a Installation
14629 echo ""
14630
14631
14632 # Remove any trailing slashes in these variables.
14633 test -n "$prefix" &&
14634   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
14635 test -n "$exec_prefix" &&
14636   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
14637
14638
14639 for file in $internal_makefile_list; do
14640   test "$file" = src/Makefile.in && \
14641     file="src/Makefile.in:src/Makefile.in.in:src/depend"
14642   ac_output_files="$ac_output_files $file" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$file\" to \$ac_output_files"; fi
14643 done
14644 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
14645 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
14646
14647 trap '' 1 2 15
14648
14649 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
14650
14651 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14652 # Let make expand exec_prefix.
14653 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14654
14655 # Any assignment to VPATH causes Sun make to only execute
14656 # the first set of double-colon rules, so remove it if not needed.
14657 # If there is a colon in the path, we need to keep it.
14658 if test "x$srcdir" = x.; then
14659   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
14660 fi
14661
14662 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
14663
14664 DEFS=-DHAVE_CONFIG_H
14665
14666 # Without the "./", some shells look in PATH for config.status.
14667 : ${CONFIG_STATUS=./config.status}
14668
14669 echo creating $CONFIG_STATUS
14670 rm -f $CONFIG_STATUS
14671 cat > $CONFIG_STATUS <<EOF
14672 #! /bin/sh
14673 # Generated automatically by configure.
14674 # Run this file to recreate the current configuration.
14675 # This directory was configured as follows,
14676 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
14677 #
14678 # $0 $ac_configure_args
14679 #
14680 # Compiler output produced by configure, useful for debugging
14681 # configure, is in ./config.log if it exists.
14682
14683 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
14684 for ac_option
14685 do
14686   case "\$ac_option" in
14687   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14688     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
14689     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
14690   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
14691     echo "$CONFIG_STATUS generated by autoconf version 2.13"
14692     exit 0 ;;
14693   -help | --help | --hel | --he | --h)
14694     echo "\$ac_cs_usage"; exit 0 ;;
14695   *) echo "\$ac_cs_usage"; exit 1 ;;
14696   esac
14697 done
14698
14699 ac_given_srcdir=$srcdir
14700 ac_given_INSTALL="$INSTALL"
14701
14702 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
14703 EOF
14704 cat >> $CONFIG_STATUS <<EOF
14705
14706 # Protect against being on the right side of a sed subst in config.status.
14707 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
14708  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
14709 $ac_vpsub
14710 $extrasub
14711 s%@SHELL@%$SHELL%g
14712 s%@CFLAGS@%$CFLAGS%g
14713 s%@CPPFLAGS@%$CPPFLAGS%g
14714 s%@CXXFLAGS@%$CXXFLAGS%g
14715 s%@FFLAGS@%$FFLAGS%g
14716 s%@DEFS@%$DEFS%g
14717 s%@LDFLAGS@%$LDFLAGS%g
14718 s%@LIBS@%$LIBS%g
14719 s%@exec_prefix@%$exec_prefix%g
14720 s%@prefix@%$prefix%g
14721 s%@program_transform_name@%$program_transform_name%g
14722 s%@bindir@%$bindir%g
14723 s%@sbindir@%$sbindir%g
14724 s%@libexecdir@%$libexecdir%g
14725 s%@datadir@%$datadir%g
14726 s%@sysconfdir@%$sysconfdir%g
14727 s%@sharedstatedir@%$sharedstatedir%g
14728 s%@localstatedir@%$localstatedir%g
14729 s%@libdir@%$libdir%g
14730 s%@includedir@%$includedir%g
14731 s%@oldincludedir@%$oldincludedir%g
14732 s%@infodir@%$infodir%g
14733 s%@mandir@%$mandir%g
14734 s%@LN_S@%$LN_S%g
14735 s%@blddir@%$blddir%g
14736 s%@CC@%$CC%g
14737 s%@CPP@%$CPP%g
14738 s%@start_flags@%$start_flags%g
14739 s%@ld_switch_shared@%$ld_switch_shared%g
14740 s%@start_files@%$start_files%g
14741 s%@ld@%$ld%g
14742 s%@lib_gcc@%$lib_gcc%g
14743 s%@RANLIB@%$RANLIB%g
14744 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
14745 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
14746 s%@INSTALL_DATA@%$INSTALL_DATA%g
14747 s%@YACC@%$YACC%g
14748 s%@SET_MAKE@%$SET_MAKE%g
14749 s%@X_CFLAGS@%$X_CFLAGS%g
14750 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
14751 s%@X_LIBS@%$X_LIBS%g
14752 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
14753 s%@install_pp@%$install_pp%g
14754 s%@libs_xauth@%$libs_xauth%g
14755 s%@dnd_objs@%$dnd_objs%g
14756 s%@lwlib_objs@%$lwlib_objs%g
14757 s%@ALLOCA@%$ALLOCA%g
14758 s%@have_esd_config@%$have_esd_config%g
14759 s%@dll_ld@%$dll_ld%g
14760 s%@dll_cflags@%$dll_cflags%g
14761 s%@dll_ldflags@%$dll_ldflags%g
14762 s%@dll_post@%$dll_post%g
14763 s%@dll_ldo@%$dll_ldo%g
14764 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
14765 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
14766 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
14767 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
14768 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
14769 s%@PROGNAME@%$PROGNAME%g
14770 s%@version@%$version%g
14771 s%@configuration@%$configuration%g
14772 s%@canonical@%$canonical%g
14773 s%@inststaticdir@%$inststaticdir%g
14774 s%@instvardir@%$instvardir%g
14775 s%@srcdir@%$srcdir%g
14776 s%@pkgdir@%$pkgdir%g
14777 s%@statedir@%$statedir%g
14778 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
14779 s%@PREFIX@%$PREFIX%g
14780 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
14781 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
14782 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
14783 s%@INFODIR@%$INFODIR%g
14784 s%@infopath@%$infopath%g
14785 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
14786 s%@INFOPATH@%$INFOPATH%g
14787 s%@package_path@%$package_path%g
14788 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
14789 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
14790 s%@lispdir@%$lispdir%g
14791 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
14792 s%@LISPDIR@%$LISPDIR%g
14793 s%@moduledir@%$moduledir%g
14794 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
14795 s%@MODULEDIR@%$MODULEDIR%g
14796 s%@sitelispdir@%$sitelispdir%g
14797 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
14798 s%@SITELISPDIR@%$SITELISPDIR%g
14799 s%@sitemoduledir@%$sitemoduledir%g
14800 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
14801 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
14802 s%@etcdir@%$etcdir%g
14803 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
14804 s%@ETCDIR@%$ETCDIR%g
14805 s%@docdir@%$docdir%g
14806 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
14807 s%@DOCDIR@%$DOCDIR%g
14808 s%@archlibdir@%$archlibdir%g
14809 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
14810 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
14811 s%@bitmapdir@%$bitmapdir%g
14812 s%@extra_objs@%$extra_objs%g
14813 s%@machfile@%$machfile%g
14814 s%@opsysfile@%$opsysfile%g
14815 s%@c_switch_general@%$c_switch_general%g
14816 s%@c_switch_window_system@%$c_switch_window_system%g
14817 s%@c_switch_all@%$c_switch_all%g
14818 s%@ld_switch_general@%$ld_switch_general%g
14819 s%@ld_switch_window_system@%$ld_switch_window_system%g
14820 s%@ld_switch_all@%$ld_switch_all%g
14821 s%@ld_libs_general@%$ld_libs_general%g
14822 s%@ld_libs_window_system@%$ld_libs_window_system%g
14823 s%@ld_libs_all@%$ld_libs_all%g
14824 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
14825 s%@native_sound_lib@%$native_sound_lib%g
14826 s%@sound_cflags@%$sound_cflags%g
14827 s%@dynodump_arch@%$dynodump_arch%g
14828 s%@XEMACS_CC@%$XEMACS_CC%g
14829 s%@internal_makefile_list@%$internal_makefile_list%g
14830
14831 CEOF
14832 EOF
14833
14834 cat >> $CONFIG_STATUS <<\EOF
14835
14836 # Split the substitutions into bite-sized pieces for seds with
14837 # small command number limits, like on Digital OSF/1 and HP-UX.
14838 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
14839 ac_file=1 # Number of current file.
14840 ac_beg=1 # First line for current file.
14841 ac_end=$ac_max_sed_cmds # Line after last line for current file.
14842 ac_more_lines=:
14843 ac_sed_cmds=""
14844 while $ac_more_lines; do
14845   if test $ac_beg -gt 1; then
14846     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
14847   else
14848     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
14849   fi
14850   if test ! -s conftest.s$ac_file; then
14851     ac_more_lines=false
14852     rm -f conftest.s$ac_file
14853   else
14854     if test -z "$ac_sed_cmds"; then
14855       ac_sed_cmds="sed -f conftest.s$ac_file"
14856     else
14857       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
14858     fi
14859     ac_file=`expr $ac_file + 1`
14860     ac_beg=$ac_end
14861     ac_end=`expr $ac_end + $ac_max_sed_cmds`
14862   fi
14863 done
14864 if test -z "$ac_sed_cmds"; then
14865   ac_sed_cmds=cat
14866 fi
14867 EOF
14868
14869 cat >> $CONFIG_STATUS <<EOF
14870
14871 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
14872 EOF
14873 cat >> $CONFIG_STATUS <<\EOF
14874 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
14875   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14876   case "$ac_file" in
14877   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14878        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14879   *) ac_file_in="${ac_file}.in" ;;
14880   esac
14881
14882   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
14883
14884   # Remove last slash and all that follows it.  Not all systems have dirname.
14885   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
14886   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14887     # The file is in a subdirectory.
14888     test ! -d "$ac_dir" && mkdir "$ac_dir"
14889     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
14890     # A "../" for each directory in $ac_dir_suffix.
14891     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
14892   else
14893     ac_dir_suffix= ac_dots=
14894   fi
14895
14896   case "$ac_given_srcdir" in
14897   .)  srcdir=.
14898       if test -z "$ac_dots"; then top_srcdir=.
14899       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
14900   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
14901   *) # Relative path.
14902     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
14903     top_srcdir="$ac_dots$ac_given_srcdir" ;;
14904   esac
14905
14906   case "$ac_given_INSTALL" in
14907   [/$]*) INSTALL="$ac_given_INSTALL" ;;
14908   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
14909   esac
14910
14911   echo creating "$ac_file"
14912   rm -f "$ac_file"
14913   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
14914   case "$ac_file" in
14915   *Makefile*) ac_comsub="1i\\
14916 # $configure_input" ;;
14917   *) ac_comsub= ;;
14918   esac
14919
14920   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14921   sed -e "$ac_comsub
14922 s%@configure_input@%$configure_input%g
14923 s%@srcdir@%$srcdir%g
14924 s%@top_srcdir@%$top_srcdir%g
14925 s%@INSTALL@%$INSTALL%g
14926 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
14927 fi; done
14928 rm -f conftest.s*
14929
14930 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14931 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14932 #
14933 # ac_d sets the value in "#define NAME VALUE" lines.
14934 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14935 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
14936 ac_dC='\3'
14937 ac_dD='%g'
14938 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14939 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14940 ac_uB='\([      ]\)%\1#\2define\3'
14941 ac_uC=' '
14942 ac_uD='\4%g'
14943 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14944 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14945 ac_eB='$%\1#\2define\3'
14946 ac_eC=' '
14947 ac_eD='%g'
14948
14949 if test "${CONFIG_HEADERS+set}" != set; then
14950 EOF
14951 cat >> $CONFIG_STATUS <<EOF
14952   CONFIG_HEADERS="src/config.h lwlib/config.h"
14953 EOF
14954 cat >> $CONFIG_STATUS <<\EOF
14955 fi
14956 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
14957   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14958   case "$ac_file" in
14959   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
14960        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
14961   *) ac_file_in="${ac_file}.in" ;;
14962   esac
14963
14964   echo creating $ac_file
14965
14966   rm -f conftest.frag conftest.in conftest.out
14967   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
14968   cat $ac_file_inputs > conftest.in
14969
14970 EOF
14971
14972 # Transform confdefs.h into a sed script conftest.vals that substitutes
14973 # the proper values into config.h.in to produce config.h.  And first:
14974 # Protect against being on the right side of a sed subst in config.status.
14975 # Protect against being in an unquoted here document in config.status.
14976 rm -f conftest.vals
14977 cat > conftest.hdr <<\EOF
14978 s/[\\&%]/\\&/g
14979 s%[\\$`]%\\&%g
14980 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
14981 s%ac_d%ac_u%gp
14982 s%ac_u%ac_e%gp
14983 EOF
14984 sed -n -f conftest.hdr confdefs.h > conftest.vals
14985 rm -f conftest.hdr
14986
14987 # This sed command replaces #undef with comments.  This is necessary, for
14988 # example, in the case of _POSIX_SOURCE, which is predefined and required
14989 # on some systems where configure will not decide to define it.
14990 cat >> conftest.vals <<\EOF
14991 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
14992 EOF
14993
14994 # Break up conftest.vals because some shells have a limit on
14995 # the size of here documents, and old seds have small limits too.
14996
14997 rm -f conftest.tail
14998 while :
14999 do
15000   ac_lines=`grep -c . conftest.vals`
15001   # grep -c gives empty output for an empty file on some AIX systems.
15002   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
15003   # Write a limited-size here document to conftest.frag.
15004   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
15005   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
15006   echo 'CEOF
15007   sed -f conftest.frag conftest.in > conftest.out
15008   rm -f conftest.in
15009   mv conftest.out conftest.in
15010 ' >> $CONFIG_STATUS
15011   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15012   rm -f conftest.vals
15013   mv conftest.tail conftest.vals
15014 done
15015 rm -f conftest.vals
15016
15017 cat >> $CONFIG_STATUS <<\EOF
15018   rm -f conftest.frag conftest.h
15019   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
15020   cat conftest.in >> conftest.h
15021   rm -f conftest.in
15022   if cmp -s $ac_file conftest.h 2>/dev/null; then
15023     echo "$ac_file is unchanged"
15024     rm -f conftest.h
15025   else
15026     # Remove last slash and all that follows it.  Not all systems have dirname.
15027       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
15028       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15029       # The file is in a subdirectory.
15030       test ! -d "$ac_dir" && mkdir "$ac_dir"
15031     fi
15032     rm -f $ac_file
15033     mv conftest.h $ac_file
15034   fi
15035 fi; done
15036
15037 EOF
15038 cat >> $CONFIG_STATUS <<EOF
15039 CPP="$CPP"
15040  top_srcdir="$srcdir"
15041  MAKE_SUBDIR="$MAKE_SUBDIR"
15042
15043 EOF
15044 cat >> $CONFIG_STATUS <<\EOF
15045 for dir in . $MAKE_SUBDIR; do
15046   (
15047     cd $dir
15048     rm -f junk.c
15049     < Makefile.in \
15050       sed -e '/^# Generated/d' \
15051           -e 's%/\*\*/#.*%%' \
15052           -e 's/^ *# */#/' \
15053           -e '/^##/d' \
15054           -e '/^#/ {
15055 p
15056 d
15057 }'        \
15058           -e '/./ {
15059 s/\([\"]\)/\\\1/g
15060 s/^/"/
15061 s/$/"/
15062 }'  > junk.c;
15063
15064
15065
15066     echo creating $dir/Makefile
15067 $CPP -I. -I${top_srcdir}/src  junk.c \
15068   | sed -e 's/^\#.*//'          \
15069         -e 's/^[        ][      ]*$//'\
15070         -e 's/^ /       /'              \
15071   | sed -n -e '/^..*$/p'        \
15072   | sed '/^\"/ {
15073         s/\\\([\"]\)/\1/g
15074         s/^[    ]*\"//
15075         s/\"[   ]*$//
15076 }' > Makefile.new
15077     chmod 444 Makefile.new
15078     mv -f Makefile.new Makefile
15079
15080     echo creating $dir/GNUmakefile
15081 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
15082   | sed -e 's/^\#.*//'          \
15083         -e 's/^[        ][      ]*$//'\
15084         -e 's/^ /       /'              \
15085   | sed -n -e '/^..*$/p'        \
15086   | sed '/^\"/ {
15087         s/\\\([\"]\)/\1/g
15088         s/^[    ]*\"//
15089         s/\"[   ]*$//
15090 }' > Makefile.new
15091     chmod 444 Makefile.new
15092     mv -f Makefile.new GNUmakefile
15093
15094     rm -f junk.c
15095   )
15096 done
15097
15098 sed < config.status >> lib-src/config.values \
15099   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
15100   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
15101   -e 's/^\([^ ]*\) $/\1 ""/' \
15102   -e 's/ 1$/ t/'
15103
15104
15105 exit 0
15106 EOF
15107 chmod +x $CONFIG_STATUS
15108 rm -fr confdefs* $ac_clean_files
15109 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1