be3c8d0e545552f8f74506f33a69dd308d5d2a93
[chise/xemacs-chise.git.1] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.13 
6 #### Copyright (C) 1992, 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.12 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 ac_max_here_lines=12
96
97 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
98
99 # File descriptor usage:
100 # 0 standard input
101 # 1 file creation
102 # 2 errors and warnings
103 # 3 some systems may open it to /dev/tty
104 # 4 used on the Kubota Titan
105 # 6 checking for... messages and results
106 # 5 compiler messages saved in config.log
107 if test "$silent" = yes; then
108   exec 6>/dev/null
109 else
110   exec 6>&1
111 fi
112 exec 5>./config.log
113
114 echo "\
115 This file contains any messages produced by compilers while
116 running configure, to aid debugging if configure makes a mistake.
117 " 1>&5
118
119 # Strip out --no-create and --no-recursion so they do not pile up.
120 # Also quote any args containing shell metacharacters.
121 ac_configure_args=
122 for ac_arg
123 do
124   case "$ac_arg" in
125   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
126   | --no-cr | --no-c) ;;
127   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
128   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
129   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
130   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
131   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
132   esac
133 done
134
135 # NLS nuisances.
136 # Only set these to C if already set.  These must not be set unconditionally
137 # because not all systems understand e.g. LANG=C (notably SCO).
138 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
139 # Non-C LC_CTYPE values break the ctype check.
140 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
141 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
142 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
143 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
144
145 # confdefs.h avoids OS command line length limits that DEFS can exceed.
146 rm -rf conftest* confdefs.h
147 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
148 echo > confdefs.h
149
150 # A filename unique to this package, relative to the directory that
151 # configure is in, which we can look for to find out if srcdir is correct.
152 ac_unique_file=src/lisp.h
153
154 # Find the source files, if location was not specified.
155 if test -z "$srcdir"; then
156   ac_srcdir_defaulted=yes
157   # Try the directory containing this script, then its parent.
158   ac_prog=$0
159   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
160   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
161   srcdir=$ac_confdir
162   if test ! -r $srcdir/$ac_unique_file; then
163     srcdir=..
164   fi
165 else
166   ac_srcdir_defaulted=no
167 fi
168 if test ! -r $srcdir/$ac_unique_file; then
169   if test "$ac_srcdir_defaulted" = yes; then
170     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
171   else
172     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
173   fi
174 fi
175 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
176
177 # Prefer explicitly selected file to automatically selected ones.
178 if test -z "$CONFIG_SITE"; then
179   if test "x$prefix" != xNONE; then
180     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
181   else
182     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
183   fi
184 fi
185 for ac_site_file in $CONFIG_SITE; do
186   if test -r "$ac_site_file"; then
187     echo "loading site script $ac_site_file"
188     . "$ac_site_file"
189   fi
190 done
191
192
193 ac_ext=c
194 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
195 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
196 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
197 ac_cpp='$CPP '"$xe_cppflags"
198 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
199 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
200 cross_compiling=no
201
202 ac_exeext=
203 ac_objext=o
204 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
205   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
206   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
207     ac_n= ac_c='
208 ' ac_t='        '
209   else
210     ac_n=-n ac_c= ac_t=
211   fi
212 else
213   ac_n= ac_c='\c' ac_t=
214 fi
215
216
217 progname="`echo $0 | sed 's:^\./\./:\./:'`"
218
219
220 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
221 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
222
223 prefix='/usr/local'
224 exec_prefix='${prefix}'
225 bindir='${exec_prefix}/bin'
226 datadir='${prefix}/lib'
227 statedir='${prefix}/lib'
228 libdir='${exec_prefix}/lib'
229 mandir='${prefix}/man/man1'
230 inststaticdir='${PROGNAME}'
231 instvardir='${PROGNAME}-${version}'
232 infodir='${datadir}/${instvardir}/info'
233 infopath=''
234 install_pp=''
235 lispdir='${datadir}/${instvardir}/lisp'
236 moduledir='${datadir}/${instvardir}/${configuration}/modules'
237 sitelispdir='${datadir}/${inststaticdir}/site-lisp'
238 sitemoduledir='${datadir}/${inststaticdir}/site-modules'
239 pkgdir='${datadir}/${instvardir}/lisp'
240 package_path=''
241 etcdir='${datadir}/${instvardir}/etc'
242 lockdir='${statedir}/${inststaticdir}/lock'
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
267
268
269
270 arguments="$@"
271
272 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
273 quoted_arguments=
274 for i in "$@"; do
275    case "$i" in
276    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
277    | --no-cr | --no-c) ;;
278    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
279    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
280    *)
281    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
282    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
283    esac
284 done
285
286 while test $# != 0; do
287   arg="$1"; shift
288   case "$arg" in
289     --no-create|--no-recursion) ;;
290         -* )
291             case "$arg" in
292         -*=*)
293           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
294           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
295           valomitted=no
296         ;;
297                                                                           -*)
298                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
299           val="yes" valomitted=yes
300         ;;
301       esac
302
303             optname="$opt"
304       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
305
306             case "${valomitted}-${opt}" in yes-without_* )
307         opt=`echo $opt | sed 's/without/with/'`
308         valomitted="no" val="no" ;;
309       esac
310
311             case "$opt" in
312
313         with_site_lisp  | \
314         with_prefix     | \
315         with_site_modules | \
316         with_x          | \
317         with_x11        | \
318         with_msw        | \
319         with_gcc        | \
320         dynamic         | \
321         with_ncurses    | \
322         with_dnet       | \
323         with_socks      | \
324         with_dragndrop  | \
325         with_cde        | \
326         with_offix      | \
327         with_gpm        | \
328         with_xpm        | \
329         with_xface      | \
330         with_gif        | \
331         with_jpeg       | \
332         with_png        | \
333         with_tiff       | \
334         with_wmcommand  | \
335         with_xmu        | \
336         with_purify     | \
337         with_quantify   | \
338         with_toolbars   | \
339         with_tty        | \
340         with_xfs        | \
341         with_i18n3      | \
342         with_mule       | \
343         with_file_coding| \
344         with_canna      | \
345         with_wnn        | \
346         with_wnn6       | \
347         with_workshop   | \
348         with_sparcworks | \
349         with_tooltalk   | \
350         with_ldap       | \
351         with_pop        | \
352         with_kerberos   | \
353         with_hesiod     | \
354         with_dnet       | \
355         with_infodock   | \
356         external_widget | \
357         verbose         | \
358         extra_verbose   | \
359         const_is_losing | \
360         usage_tracking  | \
361         use_union_type  | \
362         debug           | \
363         use_assertions  | \
364         memory_usage_stats | \
365         with_clash_detection | \
366         with_modules | \
367         no_doc_file )
368                   case "$val" in
369             y | ye | yes )      val=yes ;;
370             n | no )            val=no  ;;
371             * ) (echo "$progname: Usage error:"
372 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
373 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
374           esac
375           eval "$opt=\"$val\"" ;;
376
377
378                         srcdir          | \
379         compiler        | \
380         cflags          | \
381         cpp             | \
382         cppflags        | \
383         libs            | \
384         ldflags         | \
385         cache_file      | \
386         native_sound_lib| \
387         site_lisp       | \
388         x_includes      | \
389         x_libraries     | \
390         site_includes   | \
391         site_libraries  | \
392         site_prefixes   | \
393         site_runtime_libraries )
394                   if test "$valomitted" = "yes" ; then
395                     if test "$#" = 0 ; then
396               (echo "$progname: Usage error:"
397 echo " " "The \`--$optname' option requires a value."
398 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
399             fi
400             val="$1"; shift
401           fi
402           eval "$opt=\"$val\""
403         ;;
404
405                 rel_alloc | \
406         with_dlmalloc | \
407         with_debug_malloc  | use_debug_malloc | \
408         with_system_malloc | use_system_malloc )
409           case "$val" in
410             y | ye | yes )      val=yes ;;
411             n | no )            val=no  ;;
412             d | de | def | defa | defau | defaul | default ) val=default ;;
413             * ) (echo "$progname: Usage error:"
414 echo " " "The \`--$optname' option requires one of these values:
415   \`yes', \`no', or \`default'."
416 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
417           esac
418           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
419           eval "$opt=\"$val\""
420         ;;
421
422                 "with_database" )
423           with_database_berkdb=no
424           with_database_dbm=no
425           with_database_gnudbm=no
426           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
427             case "$x" in
428                 no ) ;;
429                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
430                 d | db | dbm )                          with_database_dbm=yes    ;;
431                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
432                 * ) (echo "$progname: Usage error:"
433 echo " " "The \`--$optname' option value
434   must be either \`no' or a comma-separated list
435   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
436 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
437             esac
438           done
439           if test "$with_database_dbm"    = "yes" -a \
440                   "$with_database_gnudbm" = "yes"; then
441           (echo "$progname: Usage error:"
442 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
443   with the \`--$optname' option."
444 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
445           fi
446         ;;
447
448                 "with_sound" )
449                           case "$val" in
450             y | ye | yes )                      val=native ;;
451             n | no | non | none )               val=no;;
452             na | nat | nati | nativ | native )  val=native  ;;
453             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
454             b | bo | bot | both )               val=both;;
455             * ) (echo "$progname: Usage error:"
456 echo " " "The \`--$optname' option must have one of these values:
457   \`native', \`nas', \`both', or \`none'."
458 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
459           esac
460           eval "$opt=\"$val\""
461         ;;
462
463                 "with_xim" )
464           case "$val" in
465             y | ye | yes )                val=yes   ;;
466             n | no | non | none )         val=no    ;;
467             x | xl | xli | xlib )         val=xlib  ;;
468             m | mo | mot | moti | motif ) val=motif ;;
469             * ) (echo "$progname: Usage error:"
470 echo " " "The \`--$optname' option must have one of these values:
471   \`motif', \`xlib', \`yes', or \`no'."
472 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
473           esac
474           eval "$opt=\"$val\""
475         ;;
476
477                 "mail_locking" )
478           case "$val" in
479             lockf )     val=lockf ;;
480             flock )     val=flock ;;
481             file )      val=file  ;;
482             * ) (echo "$progname: Usage error:"
483 echo " " "The \`--$optname' option must have one of these values:
484   \`lockf', \`flock', or \`file'."
485 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
486           esac
487           eval "$opt=\"$val\""
488         ;;
489
490                 "error_checking" )
491                           
492           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
493             case "$x" in
494                       n | no | non | none ) new_default=no ;;
495               a | al | all )        new_default=yes ;;
496
497               extents )       error_check_extents=yes ;;
498               noextents )     error_check_extents=no ;;
499
500               typecheck )     error_check_typecheck=yes ;;
501               notypecheck )   error_check_typecheck=no ;;
502
503               bufpos )        error_check_bufpos=yes ;;
504               nobufpos )      error_check_bufpos=no ;;
505
506               gc )            error_check_gc=yes ;;
507               nogc )          error_check_gc=no ;;
508
509               malloc )        error_check_malloc=yes ;;
510               nomalloc )      error_check_malloc=no ;;
511
512               byte_code )     error_check_byte_code=yes ;;
513               nobyte_code )   error_check_byte_code=no ;;
514
515               * ) bogus_error_check=yes ;;
516             esac
517             if test "$bogus_error_check" -o \
518                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
519                 if test "$error_check_default" = yes ; then
520                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
521                 else
522                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
523                 fi
524                 (echo "$progname: Usage error:"
525 echo " " "Valid types for the \`--$optname' option are:
526   $types."
527 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
528             elif test -n "$new_default" ; then
529                 error_check_extents=$new_default
530                 error_check_typecheck=$new_default
531                 error_check_bufpos=$new_default
532                 error_check_gc=$new_default
533                 error_check_malloc=$new_default
534                 error_check_byte_code=$new_default
535                 new_default=    # reset this
536             fi
537             echeck_notfirst=true
538           done
539         ;;
540
541                                 
542                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
543         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
544         archlibdir | docdir | package_path )
545                    if test "$valomitted" = "yes"; then
546              if test "$#" = 0; then
547                  (echo "$progname: Usage error:"
548 echo " " "The \`--$optname' option requires a value."
549 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
550              fi
551              val="$1"; shift
552            fi
553            eval "$opt=\"$val\""
554
555                            case "$opt" in
556                      exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
557     Defining EXEC_PREFIX_USER_DEFINED
558 EOF
559 cat >> confdefs.h <<\EOF
560 #define EXEC_PREFIX_USER_DEFINED 1
561 EOF
562 }
563  ;;
564              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
565     Defining LISPDIR_USER_DEFINED
566 EOF
567 cat >> confdefs.h <<\EOF
568 #define LISPDIR_USER_DEFINED 1
569 EOF
570 }
571  ;;
572              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
573     Defining SITELISPDIR_USER_DEFINED
574 EOF
575 cat >> confdefs.h <<\EOF
576 #define SITELISPDIR_USER_DEFINED 1
577 EOF
578 }
579  ;;
580              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
581     Defining MODULEDIR_USER_DEFINED
582 EOF
583 cat >> confdefs.h <<\EOF
584 #define MODULEDIR_USER_DEFINED 1
585 EOF
586 }
587  ;;
588              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
589     Defining ETCDIR_USER_DEFINED
590 EOF
591 cat >> confdefs.h <<\EOF
592 #define ETCDIR_USER_DEFINED 1
593 EOF
594 }
595  ;;
596              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
597     Defining INFODIR_USER_DEFINED
598 EOF
599 cat >> confdefs.h <<\EOF
600 #define INFODIR_USER_DEFINED 1
601 EOF
602 }
603  ;;
604              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
605     Defining INFOPATH_USER_DEFINED
606 EOF
607 cat >> confdefs.h <<\EOF
608 #define INFOPATH_USER_DEFINED 1
609 EOF
610 }
611  ;;
612              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
613     Defining PACKAGE_PATH_USER_DEFINED
614 EOF
615 cat >> confdefs.h <<\EOF
616 #define PACKAGE_PATH_USER_DEFINED 1
617 EOF
618 }
619  ;;
620              datadir )
621                 { test "$extra_verbose" = "yes" && cat << \EOF
622     Defining INFODIR_USER_DEFINED
623 EOF
624 cat >> confdefs.h <<\EOF
625 #define INFODIR_USER_DEFINED 1
626 EOF
627 }
628
629                 { test "$extra_verbose" = "yes" && cat << \EOF
630     Defining LISPDIR_USER_DEFINED
631 EOF
632 cat >> confdefs.h <<\EOF
633 #define LISPDIR_USER_DEFINED 1
634 EOF
635 }
636
637             { test "$extra_verbose" = "yes" && cat << \EOF
638     Defining MODULEDIR_USER_DEFINED
639 EOF
640 cat >> confdefs.h <<\EOF
641 #define MODULEDIR_USER_DEFINED 1
642 EOF
643 }
644
645                 { test "$extra_verbose" = "yes" && cat << \EOF
646     Defining ETCDIR_USER_DEFINED
647 EOF
648 cat >> confdefs.h <<\EOF
649 #define ETCDIR_USER_DEFINED 1
650 EOF
651 }
652  ;;
653              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
654     Defining LOCKDIR_USER_DEFINED
655 EOF
656 cat >> confdefs.h <<\EOF
657 #define LOCKDIR_USER_DEFINED 1
658 EOF
659 }
660  ;;
661              docdir ) { test "$extra_verbose" = "yes" && cat << \EOF
662     Defining DOCDIR_USER_DEFINED
663 EOF
664 cat >> confdefs.h <<\EOF
665 #define DOCDIR_USER_DEFINED 1
666 EOF
667 }
668  ;;
669              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
670     Defining ARCHLIBDIR_USER_DEFINED
671 EOF
672 cat >> confdefs.h <<\EOF
673 #define ARCHLIBDIR_USER_DEFINED 1
674 EOF
675 }
676  ;;
677            esac
678         ;;
679
680                 "no_create" ) ;;
681
682                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
683
684                 "with_menubars"   | \
685         "with_scrollbars" | \
686         "with_dialogs" | \
687         "with_widgets" )
688           case "$val" in
689             l | lu | luc | luci | lucid )               val=lucid  ;;
690             m | mo | mot | moti | motif )               val=motif  ;;
691             athena3d | athena-3d )                      val=athena3d ;;
692             a | at | ath | athe | athen | athena )      val=athena ;;
693             n | no | non | none )                       val=no ;;
694             * ) (echo "$progname: Usage error:"
695 echo " " "The \`--$optname' option must have one of these values:
696   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
697 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
698           esac
699           eval "$opt=\"$val\""
700         ;;
701
702                 "run_in_place"  | \
703         "with_gnu_make" )
704           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
705         ;;
706
707                 * ) (echo "$progname: Usage error:"
708 echo " " "Unrecognized option: $arg"
709 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
710
711       esac
712     ;;
713
714         *-*-*) configuration="$arg" ;;
715
716         *) (echo "$progname: Usage error:"
717 echo " " "Unrecognized argument: $arg"
718 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
719
720   esac
721 done
722
723
724 test -n "$cpp"      && CPP="$cpp"
725 test -n "$cppflags" && CPPFLAGS="$cppflags"
726 test -n "$libs"     && LIBS="$libs"
727 test -n "$ldflags"  && LDFLAGS="$ldflags"
728
729 eval set x "$quoted_arguments"; shift
730
731 test "$extra_verbose" = "yes" && verbose=yes
732
733 test -n "$with_x" && with_x11="$with_x"
734
735 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
736   test "$with_system_malloc" = "default" && with_system_malloc=yes
737 fi
738
739
740
741 if test "$with_cde $with_tooltalk" = "yes no"; then
742   (echo "$progname: Usage error:"
743 echo " " "--with-cde requires --with-tooltalk"
744 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
745 elif test "$with_tooltalk" = "no" ; then with_cde=no
746 elif test "$with_cde" = "yes"; then with_tooltalk=yes
747 fi
748
749
750 case "$srcdir" in
751
752     "" )
753     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
754       if test -f "$dir/src/lisp.h" -a \
755               -f "$dir/lisp/version.el" ; then
756         srcdir="$dir"
757         break
758       fi
759     done
760     if test -z "$srcdir" ; then
761       (echo "$progname: Usage error:"
762 echo " " "Neither the current directory nor its parent seem to
763   contain the XEmacs sources.  If you do not want to build XEmacs in its
764   source tree, you should run \`$progname' in the directory in which
765   you wish to build XEmacs, using the \`--srcdir' option to say where the
766   sources may be found."
767 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
768     fi
769   ;;
770
771     * )
772     if test ! -f "$srcdir/src/lisp.h" -o \
773             ! -f "$srcdir/lisp/version.el" ; then
774       (echo "$progname: Usage error:"
775 echo " " "The directory specified with the \`--srcdir' option,
776   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
777   either run the \`$progname' script at the top of the XEmacs source
778   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
779 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
780     fi
781   ;;
782 esac
783
784 if test -z "$configuration"; then
785     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
786   if test -z "$configuration"; then
787     (echo "$progname: Usage error:"
788 echo " " "XEmacs has not been ported to this host type.
789 Try explicitly specifying the CONFIGURATION when rerunning configure."
790 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
791   fi
792 fi
793
794 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
795 echo "configure:796: checking whether ln -s works" >&5
796
797 rm -f conftestdata
798 if ln -s X conftestdata 2>/dev/null
799 then
800   rm -f conftestdata
801   ac_cv_prog_LN_S="ln -s"
802 else
803   ac_cv_prog_LN_S=ln
804 fi
805 LN_S="$ac_cv_prog_LN_S"
806 if test "$ac_cv_prog_LN_S" = "ln -s"; then
807   echo "$ac_t""yes" 1>&6
808 else
809   echo "$ac_t""no" 1>&6
810 fi
811
812
813 for dir in lisp etc man info; do
814   if test ! -d "$dir" ; then
815     echo Making symbolic link to "$srcdir/$dir"
816     ${LN_S} "$srcdir/$dir" "$dir"
817   fi
818 done
819
820
821 absolute_pwd="`pwd`";
822 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
823 then blddir="$PWD"
824 else blddir="$absolute_pwd"; if test -d "/net"; then
825   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
826   blddir=`echo "$blddir" | \
827    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
828 fi
829 fi
830
831
832 case "$srcdir" in
833   /* ) ;;
834   .  ) srcdir="$blddir" ;;
835   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
836   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
837   srcdir=`echo "$srcdir" | \
838    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
839 fi ;;
840 esac
841
842 if test `pwd` != `sh -c cd $srcdir && pwd`  \
843    && test -f "$srcdir/src/config.h"; then
844   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
845    echo "   as a build directory right now; it has been configured in its own"
846    echo "   right.  To configure in another directory as well, you MUST"
847    echo "   use GNU make.  If you do not have GNU make, then you must"
848    echo "   now do \`make distclean' in $srcdir,"
849    echo "   and then run $progname again.") >&2
850   extrasub='/^VPATH[     ]*=/c\
851 vpath %.c $(srcdir)\
852 vpath %.h $(srcdir)\
853 vpath %.y $(srcdir)\
854 vpath %.l $(srcdir)\
855 vpath %.s $(srcdir)\
856 vpath %.in $(srcdir)'
857 fi
858
859 . "$srcdir/version.sh" || exit 1;
860 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
861 : "${extra_verbose=$beta}"
862 version="${emacs_major_version}.${emacs_minor_version}"
863 { test "$extra_verbose" = "yes" && cat << EOF
864     Defining EMACS_MAJOR_VERSION = $emacs_major_version
865 EOF
866 cat >> confdefs.h <<EOF
867 #define EMACS_MAJOR_VERSION $emacs_major_version
868 EOF
869 }
870
871 { test "$extra_verbose" = "yes" && cat << EOF
872     Defining EMACS_MINOR_VERSION = $emacs_minor_version
873 EOF
874 cat >> confdefs.h <<EOF
875 #define EMACS_MINOR_VERSION $emacs_minor_version
876 EOF
877 }
878
879 if test -n "$emacs_beta_version" ; then
880   if test "$beta" = "yes"; then
881         version="${version}-b${emacs_beta_version}"
882         { test "$extra_verbose" = "yes" && cat << EOF
883     Defining EMACS_BETA_VERSION = $emacs_beta_version
884 EOF
885 cat >> confdefs.h <<EOF
886 #define EMACS_BETA_VERSION $emacs_beta_version
887 EOF
888 }
889
890   else
891         version="${version}.${emacs_beta_version}"
892         { test "$extra_verbose" = "yes" && cat << EOF
893     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
894 EOF
895 cat >> confdefs.h <<EOF
896 #define EMACS_PATCH_LEVEL $emacs_beta_version
897 EOF
898 }
899
900   fi
901 fi
902 { test "$extra_verbose" = "yes" && cat << EOF
903     Defining XEMACS_CODENAME = "$xemacs_codename"
904 EOF
905 cat >> confdefs.h <<EOF
906 #define XEMACS_CODENAME "$xemacs_codename"
907 EOF
908 }
909
910 { test "$extra_verbose" = "yes" && cat << EOF
911     Defining EMACS_VERSION = "$version"
912 EOF
913 cat >> confdefs.h <<EOF
914 #define EMACS_VERSION "$version"
915 EOF
916 }
917
918
919 if test "$with_infodock" = "yes"; then
920   if test ! -f ../../ID-INSTALL; then
921     echo "Cannot build InfoDock without InfoDock sources"
922     with_infodock=no
923   fi
924 fi
925
926 if test "$with_infodock" = "yes"; then
927       { test "$extra_verbose" = "yes" && cat << EOF
928     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
929 EOF
930 cat >> confdefs.h <<EOF
931 #define INFODOCK_MAJOR_VERSION $infodock_major_version
932 EOF
933 }
934
935   { test "$extra_verbose" = "yes" && cat << EOF
936     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
937 EOF
938 cat >> confdefs.h <<EOF
939 #define INFODOCK_MINOR_VERSION $infodock_minor_version
940 EOF
941 }
942
943   { test "$extra_verbose" = "yes" && cat << EOF
944     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
945 EOF
946 cat >> confdefs.h <<EOF
947 #define INFODOCK_BUILD_VERSION $infodock_build_version
948 EOF
949 }
950
951   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
952   PROGNAME=infodock
953   CPPFLAGS="$CPPFLAGS -DINFODOCK"
954 else
955   PROGNAME=xemacs
956 fi
957
958 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
959 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
960     Defining ERROR_CHECK_EXTENTS
961 EOF
962 cat >> confdefs.h <<\EOF
963 #define ERROR_CHECK_EXTENTS 1
964 EOF
965 }
966
967 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
968     Defining ERROR_CHECK_TYPECHECK
969 EOF
970 cat >> confdefs.h <<\EOF
971 #define ERROR_CHECK_TYPECHECK 1
972 EOF
973 }
974
975 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
976     Defining ERROR_CHECK_BUFPOS
977 EOF
978 cat >> confdefs.h <<\EOF
979 #define ERROR_CHECK_BUFPOS 1
980 EOF
981 }
982
983 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
984     Defining ERROR_CHECK_GC
985 EOF
986 cat >> confdefs.h <<\EOF
987 #define ERROR_CHECK_GC 1
988 EOF
989 }
990
991 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
992     Defining ERROR_CHECK_MALLOC
993 EOF
994 cat >> confdefs.h <<\EOF
995 #define ERROR_CHECK_MALLOC 1
996 EOF
997 }
998
999 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1000     Defining ERROR_CHECK_BYTE_CODE
1001 EOF
1002 cat >> confdefs.h <<\EOF
1003 #define ERROR_CHECK_BYTE_CODE 1
1004 EOF
1005 }
1006
1007 if test "${debug:=$beta}" = "yes"; then
1008   use_assertions=yes memory_usage_stats=yes
1009   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
1010    echo "    xemacs will be linked with \"debug.o\""
1011  fi
1012   { test "$extra_verbose" = "yes" && cat << \EOF
1013     Defining DEBUG_XEMACS
1014 EOF
1015 cat >> confdefs.h <<\EOF
1016 #define DEBUG_XEMACS 1
1017 EOF
1018 }
1019
1020 fi
1021 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1022     Defining USE_ASSERTIONS
1023 EOF
1024 cat >> confdefs.h <<\EOF
1025 #define USE_ASSERTIONS 1
1026 EOF
1027 }
1028
1029 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1030     Defining MEMORY_USAGE_STATS
1031 EOF
1032 cat >> confdefs.h <<\EOF
1033 #define MEMORY_USAGE_STATS 1
1034 EOF
1035 }
1036
1037
1038
1039 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1040 echo "configure:1041: checking "host system type"" >&5
1041 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1042 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1043 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1044 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1045 echo "$ac_t""$configuration" 1>&6
1046
1047
1048
1049
1050
1051 machine='' opsys=''
1052
1053 case "$canonical" in
1054   sparc-*-*        ) machine=sparc ;;
1055   alpha*-*-*       ) machine=alpha ;;
1056   vax-*-*          ) machine=vax ;;
1057   mips-dec-*       ) machine=pmax ;;
1058   mips-sgi-*       ) machine=iris4d ;;
1059   romp-ibm-*       ) machine=ibmrt ;;
1060   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1061   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1062   powerpc*-*       ) machine=powerpc ;;
1063   hppa-*-*         ) machine=hp800 ;;
1064   m88k-dg-*        ) machine=aviion ;;
1065   m68*-sony-*      ) machine=news ;;
1066   mips-sony-*      ) machine=news-risc ;;
1067   clipper-*        ) machine=clipper ;;
1068   arm-*            ) machine=arm ;;
1069   ns32k-*          ) machine=ns32000 ;;
1070 esac
1071
1072 case "$canonical" in
1073   *-*-linux*    ) opsys=linux ;;
1074   *-*-netbsd*   ) opsys=netbsd ;;
1075   *-*-openbsd*  ) opsys=openbsd ;;
1076   *-*-nextstep* ) opsys=nextstep ;;
1077   *-*-vms       ) opsys=vms ;;
1078
1079     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1080   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1081   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1082   *-dec-osf3*                ) opsys=decosf3-1 ;;
1083   *-dec-osf4*                ) opsys=decosf4-0 ;;
1084
1085     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1086   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1087   *-*-ultrix* )         opsys=ultrix4-3 ;;
1088
1089     *-*-aix3.1*  ) opsys=aix3-1 ;;
1090   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1091   *-*-aix3*    ) opsys=aix3-2   ;;
1092   *-*-aix4.0*  ) opsys=aix4     ;;
1093   *-*-aix4.1*  ) opsys=aix4-1   ;;
1094   *-*-aix4*    ) opsys=aix4-2   ;;
1095
1096     *-gnu* )                    opsys=gnu    ;;
1097   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1098   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1099   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1100   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1101   *-*-aos*   )                  opsys=bsd4-3 ;;
1102   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1103   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1104   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1105   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1106   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1107   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1108         if test -z "$NON_GNU_CPP" ; then
1109           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1110             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1111           done
1112         fi
1113         opsys=usg5-4-2 ;;
1114     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1115     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1116 esac
1117
1118 case "$canonical" in
1119
1120     *-*-netbsd* )
1121     case "$canonical" in
1122       i[3-9]86-*-netbsd*) machine=intel386 ;;
1123       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1124                                             machine=hp9000s300 ;;
1125       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1126       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1127     esac
1128   ;;
1129
1130     *-*-openbsd* )
1131     case "${canonical}" in
1132       i386-*-openbsd*)          machine=intel386 ;;
1133       m68k-*-openbsd*)          machine=hp9000s300 ;;
1134       mipsel-*-openbsd*)        machine=pmax ;;
1135      esac
1136    ;;
1137
1138     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1139   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1140
1141     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1142   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1143
1144     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1145
1146     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1147
1148     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1149
1150     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1151
1152     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1153
1154     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1155   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1156   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1157
1158   
1159     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1160
1161     *-convex-bsd* | *-convex-convexos* )
1162     machine=convex opsys=bsd4-3
1163     NON_GNU_CPP="cc -E -P"
1164   ;;
1165
1166     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1167
1168     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1169   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1170   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1171   m88k-dg-dgux*                           ) opsys=dgux     ;;
1172
1173     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1174   m88k-motorola-sysv4* )
1175                     machine=delta88k opsys=usg5-4-2
1176   ;;
1177   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1178
1179     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1180   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1181
1182     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1183
1184     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1185   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1186   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1187
1188       m88k-harris-cxux* )
1189         case "`uname -r`" in
1190        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1191        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1192     esac
1193     NON_GNU_CPP="/lib/cpp"
1194   ;;
1195     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1196     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1197
1198     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1199
1200     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1201
1202     *-hp-hpux* )
1203         case "$canonical" in
1204       m68*  ) machine=hp9000s300 ;;
1205       hppa* ) machine=hp800      ;;
1206     esac
1207
1208     case "$canonical" in
1209       *-hp-hpux7*  )  opsys=hpux   ;;
1210       *-hp-hpux8*  )  opsys=hpux8  ;;
1211       *-hp-hpux9*  )  opsys=hpux9  ;;
1212       *-hp-hpux10* )  opsys=hpux10 ;;
1213       *-hp-hpux11* )  opsys=hpux11 ;;
1214       *            )  opsys=hpux   ;;
1215     esac
1216
1217         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1218    echo "    xemacs will be linked with \"strcat.o\""
1219  fi ;; esac
1220
1221     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1222         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1223     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1224
1225     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1226   ;;
1227
1228     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1229   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1230
1231     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1232   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1233   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1234   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1235   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1236   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1237
1238     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1239   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1240
1241     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1242
1243     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1244
1245     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1246
1247     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1248
1249       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1250
1251     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1252
1253     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1254
1255     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1256
1257     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1258
1259         mips-mips-usg* ) machine=mips4 ;;
1260   mips-mips-riscos4 )
1261     machine=mips4
1262     NON_GNU_CC="cc -systype bsd43"
1263     NON_GNU_CPP="cc -systype bsd43 -E"
1264     case "$canonical" in
1265       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1266       mips-mips-riscos5* ) opsys=riscos5 ;;
1267     esac
1268   ;;
1269   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1270   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1271
1272     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1273
1274     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1275
1276     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1277   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1278
1279     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1280
1281     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1282
1283     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1284
1285     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1286
1287     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1288   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1289
1290     mips-siemens-sysv* | mips-sni-sysv*)
1291     machine=mips-siemens opsys=usg5-4
1292     NON_GNU_CC=/usr/ccs/bin/cc
1293     NON_GNU_CPP=/usr/ccs/lib/cpp
1294   ;;
1295
1296     mips-nec-sysv*)
1297     machine=mips-nec
1298     NON_GNU_CC=/usr/ccs/bin/cc
1299     NON_GNU_CPP=/usr/ccs/lib/cpp
1300   ;;
1301
1302       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1303   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1304     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1305   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1306   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1307   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1308   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1309   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1310   mips-sgi-irix*      ) opsys=irix5-0 ;;
1311
1312     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1313   *-sony-news* ) opsys=newsos5 ;;
1314
1315     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1316
1317     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1318         case "$canonical" in
1319       m68*-sunos1* )             machine=sun1     ;;
1320       m68*-sunos2* )             machine=sun2     ;;
1321       m68* )                     machine=sun3     ;;
1322       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1323       i*86-*-* )                 machine=intel386 ;;
1324       rs6000* )                  machine=rs6000   ;;
1325     esac
1326
1327         case "$canonical" in *-sunos5*)
1328       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1329     esac
1330
1331                     case "$canonical" in
1332       *-sunos4* )
1333         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1334         : ;;
1335       *-solaris2* )
1336         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1337         RANLIB=':' ;;
1338     esac
1339
1340     case "$canonical" in
1341       *-solaris*          )
1342         opsys=sol2
1343         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1344         { test "$extra_verbose" = "yes" && cat << EOF
1345     Defining OS_RELEASE = $os_release
1346 EOF
1347 cat >> confdefs.h <<EOF
1348 #define OS_RELEASE $os_release
1349 EOF
1350 }
1351  ;;
1352
1353             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1354       *-sunos4.0*         ) opsys=sunos4-0      ;;
1355       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1356       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1357       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1358       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1359       *-mach*             ) opsys=mach-bsd4-3   ;;
1360       *                   ) opsys=bsd4-2        ;;
1361     esac
1362
1363     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1364
1365         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1366   ;;
1367
1368     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1369
1370     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1371   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1372
1373     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1374
1375     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1376
1377     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1378       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1379
1380     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1381
1382     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1383
1384     vax-dec-* )
1385     case "$canonical" in
1386       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1387       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1388       *-mach* )                         opsys=mach-bsd4-3 ;;
1389     esac
1390   ;;
1391
1392     ns16k-whitechapel-* ) machine=mg1 ;;
1393
1394     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1395
1396     i[3-9]86-*-* )
1397     machine=intel386
1398     case "$canonical" in
1399       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1400       *-isc2.2* )               opsys=isc2-2 ;;
1401       *-isc4.0* )               opsys=isc4-0 ;;
1402       *-isc4.* )                opsys=isc4-1
1403                                 GCC_TEST_OPTIONS=-posix
1404                                 NON_GCC_TEST_OPTIONS=-Xp
1405                                 ;;
1406       *-isc* )                  opsys=isc3-0 ;;
1407       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1408       *-esix* )                 opsys=esix ;;
1409       *-mach* )                 opsys=mach-bsd4-3 ;;
1410       *-xenix* )                opsys=xenix ;;
1411       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1412       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1413       *-bsdi4* )                opsys=bsdos4 ;;
1414       *-bsdi3* )                opsys=bsdos3 ;;
1415       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1416       *-bsdi2* )                opsys=bsdos2 ;;
1417       *-sco3.2v5* )             opsys=sco5 ;
1418                                                         if test "$dynamic" = "yes" ; then
1419                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1420         else
1421                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1422         fi ;;
1423       *-sysv5* )                opsys=sco7 ;;
1424       *-386bsd* )               opsys=386bsd ;;
1425       *-freebsd* )              opsys=freebsd ;;
1426       *-nextstep* )             opsys=nextstep ;;
1427       *-pc-cygwin* )            opsys=cygwin32 ;;
1428       *-pc-mingw* )             opsys=mingw32 ;
1429                                 test -z "$with_tty" && with_tty="no";;
1430           esac
1431   ;;
1432
1433     m68k-*-linux* ) machine=m68k opsys=linux ;;
1434
1435 esac
1436
1437 if test -z "$machine" -o -z "$opsys"; then
1438   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1439    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1440   ) >&2
1441   exit 1
1442 fi
1443
1444 if test -z "$dynamic"; then
1445   case "$opsys" in
1446     hpux* | sunos4* ) dynamic=no ;;
1447     *) dynamic=yes ;;
1448   esac
1449 fi
1450 if test "$dynamic" = "yes"; then
1451   case "$opsys" in
1452     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1453     decosf* ) ld_call_shared="-call_shared" ;;
1454   esac
1455 else   case "$opsys" in
1456     sol2 )
1457       echo "Static linking is not supported on Solaris 2."
1458       echo "Rerun configure without specifying --dynamic=no."
1459       exit 1 ;;
1460     linux   ) ld_call_shared="-Bstatic" ;;
1461     decosf* ) ld_call_shared="-non_shared" ;;
1462   esac
1463 fi
1464
1465 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1466
1467 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1468 { test "$extra_verbose" = "yes" && cat << EOF
1469     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1470 EOF
1471 cat >> confdefs.h <<EOF
1472 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1473 EOF
1474 }
1475
1476
1477 machfile="m/${machine}.h"
1478 opsysfile="s/${opsys}.h"
1479
1480
1481 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1482 if test "$with_workshop $with_tooltalk" = "yes no"; then
1483   (echo "$progname: Usage error:"
1484 echo " " "--with-workshop requires --with-tooltalk"
1485 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1486 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1487 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1488 fi
1489
1490 if test "$with_workshop" = "yes"; then
1491   { test "$extra_verbose" = "yes" && cat << \EOF
1492     Defining SUNPRO
1493 EOF
1494 cat >> confdefs.h <<\EOF
1495 #define SUNPRO 1
1496 EOF
1497 }
1498
1499   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1500    echo "    xemacs will be linked with \"sunpro.o\""
1501  fi
1502 fi
1503
1504 if test "$with_clash_detection" = "yes"; then
1505   { test "$extra_verbose" = "yes" && cat << \EOF
1506     Defining CLASH_DETECTION
1507 EOF
1508 cat >> confdefs.h <<\EOF
1509 #define CLASH_DETECTION 1
1510 EOF
1511 }
1512
1513   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1514    echo "    xemacs will be linked with \"filelock.o\""
1515  fi
1516 fi
1517
1518 test -n "$compiler" && CC="$compiler"
1519 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1520 fi
1521
1522 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1523 if test "${CFLAGS-unset}" != unset
1524   then cflags_specified=yes;
1525   else cflags_specified=no;
1526 fi
1527
1528 xe_save_CFLAGS="$CFLAGS"
1529
1530 # Extract the first word of "gcc", so it can be a program name with args.
1531 set dummy gcc; ac_word=$2
1532 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1533 echo "configure:1534: checking for $ac_word" >&5
1534
1535 if test -n "$CC"; then
1536   ac_cv_prog_CC="$CC" # Let the user override the test.
1537 else
1538   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1539   ac_dummy="$PATH"
1540   for ac_dir in $ac_dummy; do
1541     test -z "$ac_dir" && ac_dir=.
1542     if test -f $ac_dir/$ac_word; then
1543       ac_cv_prog_CC="gcc"
1544       break
1545     fi
1546   done
1547   IFS="$ac_save_ifs"
1548 fi
1549 CC="$ac_cv_prog_CC"
1550 if test -n "$CC"; then
1551   echo "$ac_t""$CC" 1>&6
1552 else
1553   echo "$ac_t""no" 1>&6
1554 fi
1555
1556 if test -z "$CC"; then
1557   # Extract the first word of "cc", so it can be a program name with args.
1558 set dummy cc; ac_word=$2
1559 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1560 echo "configure:1561: checking for $ac_word" >&5
1561
1562 if test -n "$CC"; then
1563   ac_cv_prog_CC="$CC" # Let the user override the test.
1564 else
1565   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1566   ac_prog_rejected=no
1567   ac_dummy="$PATH"
1568   for ac_dir in $ac_dummy; do
1569     test -z "$ac_dir" && ac_dir=.
1570     if test -f $ac_dir/$ac_word; then
1571       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1572         ac_prog_rejected=yes
1573         continue
1574       fi
1575       ac_cv_prog_CC="cc"
1576       break
1577     fi
1578   done
1579   IFS="$ac_save_ifs"
1580 if test $ac_prog_rejected = yes; then
1581   # We found a bogon in the path, so make sure we never use it.
1582   set dummy $ac_cv_prog_CC
1583   shift
1584   if test $# -gt 0; then
1585     # We chose a different compiler from the bogus one.
1586     # However, it has the same basename, so the bogon will be chosen
1587     # first if we set CC to just the basename; use the full file name.
1588     shift
1589     set dummy "$ac_dir/$ac_word" "$@"
1590     shift
1591     ac_cv_prog_CC="$@"
1592   fi
1593 fi
1594 fi
1595 CC="$ac_cv_prog_CC"
1596 if test -n "$CC"; then
1597   echo "$ac_t""$CC" 1>&6
1598 else
1599   echo "$ac_t""no" 1>&6
1600 fi
1601
1602   if test -z "$CC"; then
1603     case "`uname -s`" in
1604     *win32* | *WIN32*)
1605       # Extract the first word of "cl", so it can be a program name with args.
1606 set dummy cl; ac_word=$2
1607 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1608 echo "configure:1609: checking for $ac_word" >&5
1609
1610 if test -n "$CC"; then
1611   ac_cv_prog_CC="$CC" # Let the user override the test.
1612 else
1613   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1614   ac_dummy="$PATH"
1615   for ac_dir in $ac_dummy; do
1616     test -z "$ac_dir" && ac_dir=.
1617     if test -f $ac_dir/$ac_word; then
1618       ac_cv_prog_CC="cl"
1619       break
1620     fi
1621   done
1622   IFS="$ac_save_ifs"
1623 fi
1624 CC="$ac_cv_prog_CC"
1625 if test -n "$CC"; then
1626   echo "$ac_t""$CC" 1>&6
1627 else
1628   echo "$ac_t""no" 1>&6
1629 fi
1630  ;;
1631     esac
1632   fi
1633   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1634 fi
1635
1636 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1637 echo "configure:1638: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1638
1639 ac_ext=c
1640 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1641 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1642 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1643 ac_cpp='$CPP '"$xe_cppflags"
1644 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1645 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1646 cross_compiling=no
1647
1648 cat > conftest.$ac_ext << EOF
1649
1650 #line 1651 "configure"
1651 #include "confdefs.h"
1652
1653 main(){return(0);}
1654 EOF
1655 if { (eval echo configure:1656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1656   ac_cv_prog_cc_works=yes
1657   # If we can't run a trivial program, we are probably using a cross compiler.
1658   if (./conftest; exit) 2>/dev/null; then
1659     ac_cv_prog_cc_cross=no
1660   else
1661     ac_cv_prog_cc_cross=yes
1662   fi
1663 else
1664   echo "configure: failed program was:" >&5
1665   cat conftest.$ac_ext >&5
1666   ac_cv_prog_cc_works=no
1667 fi
1668 rm -fr conftest*
1669 ac_ext=c
1670 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1671 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1672 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1673 ac_cpp='$CPP '"$xe_cppflags"
1674 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1675 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1676 cross_compiling=no
1677
1678 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1679 if test $ac_cv_prog_cc_works = no; then
1680   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1681 fi
1682 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1683 echo "configure:1684: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1684 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1685 cross_compiling=$ac_cv_prog_cc_cross
1686
1687 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1688 echo "configure:1689: checking whether we are using GNU C" >&5
1689
1690 cat > conftest.c <<EOF
1691 #ifdef __GNUC__
1692   yes;
1693 #endif
1694 EOF
1695 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1696   ac_cv_prog_gcc=yes
1697 else
1698   ac_cv_prog_gcc=no
1699 fi
1700
1701 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1702
1703 if test $ac_cv_prog_gcc = yes; then
1704   GCC=yes
1705 else
1706   GCC=
1707 fi
1708
1709 ac_test_CFLAGS="${CFLAGS+set}"
1710 ac_save_CFLAGS="$CFLAGS"
1711 CFLAGS=
1712 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1713 echo "configure:1714: checking whether ${CC-cc} accepts -g" >&5
1714
1715 echo 'void f(){}' > conftest.c
1716 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1717   ac_cv_prog_cc_g=yes
1718 else
1719   ac_cv_prog_cc_g=no
1720 fi
1721 rm -f conftest*
1722
1723
1724 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS="$ac_save_CFLAGS"
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740  
1741 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1742   CC=${NON_GNU_CC-cc}
1743   # Extract the first word of "gcc", so it can be a program name with args.
1744 set dummy gcc; ac_word=$2
1745 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1746 echo "configure:1747: checking for $ac_word" >&5
1747
1748 if test -n "$CC"; then
1749   ac_cv_prog_CC="$CC" # Let the user override the test.
1750 else
1751   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1752   ac_dummy="$PATH"
1753   for ac_dir in $ac_dummy; do
1754     test -z "$ac_dir" && ac_dir=.
1755     if test -f $ac_dir/$ac_word; then
1756       ac_cv_prog_CC="gcc"
1757       break
1758     fi
1759   done
1760   IFS="$ac_save_ifs"
1761 fi
1762 CC="$ac_cv_prog_CC"
1763 if test -n "$CC"; then
1764   echo "$ac_t""$CC" 1>&6
1765 else
1766   echo "$ac_t""no" 1>&6
1767 fi
1768
1769 if test -z "$CC"; then
1770   # Extract the first word of "cc", so it can be a program name with args.
1771 set dummy cc; ac_word=$2
1772 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1773 echo "configure:1774: checking for $ac_word" >&5
1774
1775 if test -n "$CC"; then
1776   ac_cv_prog_CC="$CC" # Let the user override the test.
1777 else
1778   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1779   ac_prog_rejected=no
1780   ac_dummy="$PATH"
1781   for ac_dir in $ac_dummy; do
1782     test -z "$ac_dir" && ac_dir=.
1783     if test -f $ac_dir/$ac_word; then
1784       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1785         ac_prog_rejected=yes
1786         continue
1787       fi
1788       ac_cv_prog_CC="cc"
1789       break
1790     fi
1791   done
1792   IFS="$ac_save_ifs"
1793 if test $ac_prog_rejected = yes; then
1794   # We found a bogon in the path, so make sure we never use it.
1795   set dummy $ac_cv_prog_CC
1796   shift
1797   if test $# -gt 0; then
1798     # We chose a different compiler from the bogus one.
1799     # However, it has the same basename, so the bogon will be chosen
1800     # first if we set CC to just the basename; use the full file name.
1801     shift
1802     set dummy "$ac_dir/$ac_word" "$@"
1803     shift
1804     ac_cv_prog_CC="$@"
1805   fi
1806 fi
1807 fi
1808 CC="$ac_cv_prog_CC"
1809 if test -n "$CC"; then
1810   echo "$ac_t""$CC" 1>&6
1811 else
1812   echo "$ac_t""no" 1>&6
1813 fi
1814
1815   if test -z "$CC"; then
1816     case "`uname -s`" in
1817     *win32* | *WIN32*)
1818       # Extract the first word of "cl", so it can be a program name with args.
1819 set dummy cl; ac_word=$2
1820 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1821 echo "configure:1822: checking for $ac_word" >&5
1822
1823 if test -n "$CC"; then
1824   ac_cv_prog_CC="$CC" # Let the user override the test.
1825 else
1826   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1827   ac_dummy="$PATH"
1828   for ac_dir in $ac_dummy; do
1829     test -z "$ac_dir" && ac_dir=.
1830     if test -f $ac_dir/$ac_word; then
1831       ac_cv_prog_CC="cl"
1832       break
1833     fi
1834   done
1835   IFS="$ac_save_ifs"
1836 fi
1837 CC="$ac_cv_prog_CC"
1838 if test -n "$CC"; then
1839   echo "$ac_t""$CC" 1>&6
1840 else
1841   echo "$ac_t""no" 1>&6
1842 fi
1843  ;;
1844     esac
1845   fi
1846   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1847 fi
1848
1849 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1850 echo "configure:1851: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1851
1852 ac_ext=c
1853 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1854 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1855 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1856 ac_cpp='$CPP '"$xe_cppflags"
1857 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1858 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1859 cross_compiling=no
1860
1861 cat > conftest.$ac_ext << EOF
1862
1863 #line 1864 "configure"
1864 #include "confdefs.h"
1865
1866 main(){return(0);}
1867 EOF
1868 if { (eval echo configure:1869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1869   ac_cv_prog_cc_works=yes
1870   # If we can't run a trivial program, we are probably using a cross compiler.
1871   if (./conftest; exit) 2>/dev/null; then
1872     ac_cv_prog_cc_cross=no
1873   else
1874     ac_cv_prog_cc_cross=yes
1875   fi
1876 else
1877   echo "configure: failed program was:" >&5
1878   cat conftest.$ac_ext >&5
1879   ac_cv_prog_cc_works=no
1880 fi
1881 rm -fr conftest*
1882 ac_ext=c
1883 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1884 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1885 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1886 ac_cpp='$CPP '"$xe_cppflags"
1887 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1888 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1889 cross_compiling=no
1890
1891 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1892 if test $ac_cv_prog_cc_works = no; then
1893   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1894 fi
1895 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1896 echo "configure:1897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1897 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1898 cross_compiling=$ac_cv_prog_cc_cross
1899
1900 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1901 echo "configure:1902: checking whether we are using GNU C" >&5
1902
1903 cat > conftest.c <<EOF
1904 #ifdef __GNUC__
1905   yes;
1906 #endif
1907 EOF
1908 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1909   ac_cv_prog_gcc=yes
1910 else
1911   ac_cv_prog_gcc=no
1912 fi
1913
1914 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1915
1916 if test $ac_cv_prog_gcc = yes; then
1917   GCC=yes
1918 else
1919   GCC=
1920 fi
1921
1922 ac_test_CFLAGS="${CFLAGS+set}"
1923 ac_save_CFLAGS="$CFLAGS"
1924 CFLAGS=
1925 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1926 echo "configure:1927: checking whether ${CC-cc} accepts -g" >&5
1927
1928 echo 'void f(){}' > conftest.c
1929 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1930   ac_cv_prog_cc_g=yes
1931 else
1932   ac_cv_prog_cc_g=no
1933 fi
1934 rm -f conftest*
1935
1936
1937 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1938 if test "$ac_test_CFLAGS" = set; then
1939   CFLAGS="$ac_save_CFLAGS"
1940 elif test $ac_cv_prog_cc_g = yes; then
1941   if test "$GCC" = yes; then
1942     CFLAGS="-g -O2"
1943   else
1944     CFLAGS="-g"
1945   fi
1946 else
1947   if test "$GCC" = yes; then
1948     CFLAGS="-O2"
1949   else
1950     CFLAGS=
1951   fi
1952 fi
1953
1954 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1955   CC=gcc
1956   # Extract the first word of "gcc", so it can be a program name with args.
1957 set dummy gcc; ac_word=$2
1958 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1959 echo "configure:1960: checking for $ac_word" >&5
1960
1961 if test -n "$CC"; then
1962   ac_cv_prog_CC="$CC" # Let the user override the test.
1963 else
1964   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1965   ac_dummy="$PATH"
1966   for ac_dir in $ac_dummy; do
1967     test -z "$ac_dir" && ac_dir=.
1968     if test -f $ac_dir/$ac_word; then
1969       ac_cv_prog_CC="gcc"
1970       break
1971     fi
1972   done
1973   IFS="$ac_save_ifs"
1974 fi
1975 CC="$ac_cv_prog_CC"
1976 if test -n "$CC"; then
1977   echo "$ac_t""$CC" 1>&6
1978 else
1979   echo "$ac_t""no" 1>&6
1980 fi
1981
1982 if test -z "$CC"; then
1983   # Extract the first word of "cc", so it can be a program name with args.
1984 set dummy cc; ac_word=$2
1985 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1986 echo "configure:1987: checking for $ac_word" >&5
1987
1988 if test -n "$CC"; then
1989   ac_cv_prog_CC="$CC" # Let the user override the test.
1990 else
1991   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1992   ac_prog_rejected=no
1993   ac_dummy="$PATH"
1994   for ac_dir in $ac_dummy; do
1995     test -z "$ac_dir" && ac_dir=.
1996     if test -f $ac_dir/$ac_word; then
1997       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1998         ac_prog_rejected=yes
1999         continue
2000       fi
2001       ac_cv_prog_CC="cc"
2002       break
2003     fi
2004   done
2005   IFS="$ac_save_ifs"
2006 if test $ac_prog_rejected = yes; then
2007   # We found a bogon in the path, so make sure we never use it.
2008   set dummy $ac_cv_prog_CC
2009   shift
2010   if test $# -gt 0; then
2011     # We chose a different compiler from the bogus one.
2012     # However, it has the same basename, so the bogon will be chosen
2013     # first if we set CC to just the basename; use the full file name.
2014     shift
2015     set dummy "$ac_dir/$ac_word" "$@"
2016     shift
2017     ac_cv_prog_CC="$@"
2018   fi
2019 fi
2020 fi
2021 CC="$ac_cv_prog_CC"
2022 if test -n "$CC"; then
2023   echo "$ac_t""$CC" 1>&6
2024 else
2025   echo "$ac_t""no" 1>&6
2026 fi
2027
2028   if test -z "$CC"; then
2029     case "`uname -s`" in
2030     *win32* | *WIN32*)
2031       # Extract the first word of "cl", so it can be a program name with args.
2032 set dummy cl; ac_word=$2
2033 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2034 echo "configure:2035: checking for $ac_word" >&5
2035
2036 if test -n "$CC"; then
2037   ac_cv_prog_CC="$CC" # Let the user override the test.
2038 else
2039   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2040   ac_dummy="$PATH"
2041   for ac_dir in $ac_dummy; do
2042     test -z "$ac_dir" && ac_dir=.
2043     if test -f $ac_dir/$ac_word; then
2044       ac_cv_prog_CC="cl"
2045       break
2046     fi
2047   done
2048   IFS="$ac_save_ifs"
2049 fi
2050 CC="$ac_cv_prog_CC"
2051 if test -n "$CC"; then
2052   echo "$ac_t""$CC" 1>&6
2053 else
2054   echo "$ac_t""no" 1>&6
2055 fi
2056  ;;
2057     esac
2058   fi
2059   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2060 fi
2061
2062 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2063 echo "configure:2064: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2064
2065 ac_ext=c
2066 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2067 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2068 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2069 ac_cpp='$CPP '"$xe_cppflags"
2070 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2071 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2072 cross_compiling=no
2073
2074 cat > conftest.$ac_ext << EOF
2075
2076 #line 2077 "configure"
2077 #include "confdefs.h"
2078
2079 main(){return(0);}
2080 EOF
2081 if { (eval echo configure:2082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2082   ac_cv_prog_cc_works=yes
2083   # If we can't run a trivial program, we are probably using a cross compiler.
2084   if (./conftest; exit) 2>/dev/null; then
2085     ac_cv_prog_cc_cross=no
2086   else
2087     ac_cv_prog_cc_cross=yes
2088   fi
2089 else
2090   echo "configure: failed program was:" >&5
2091   cat conftest.$ac_ext >&5
2092   ac_cv_prog_cc_works=no
2093 fi
2094 rm -fr conftest*
2095 ac_ext=c
2096 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2097 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2098 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2099 ac_cpp='$CPP '"$xe_cppflags"
2100 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2101 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2102 cross_compiling=no
2103
2104 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2105 if test $ac_cv_prog_cc_works = no; then
2106   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2107 fi
2108 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2109 echo "configure:2110: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2110 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2111 cross_compiling=$ac_cv_prog_cc_cross
2112
2113 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2114 echo "configure:2115: checking whether we are using GNU C" >&5
2115
2116 cat > conftest.c <<EOF
2117 #ifdef __GNUC__
2118   yes;
2119 #endif
2120 EOF
2121 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2122   ac_cv_prog_gcc=yes
2123 else
2124   ac_cv_prog_gcc=no
2125 fi
2126
2127 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2128
2129 if test $ac_cv_prog_gcc = yes; then
2130   GCC=yes
2131 else
2132   GCC=
2133 fi
2134
2135 ac_test_CFLAGS="${CFLAGS+set}"
2136 ac_save_CFLAGS="$CFLAGS"
2137 CFLAGS=
2138 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2139 echo "configure:2140: checking whether ${CC-cc} accepts -g" >&5
2140
2141 echo 'void f(){}' > conftest.c
2142 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2143   ac_cv_prog_cc_g=yes
2144 else
2145   ac_cv_prog_cc_g=no
2146 fi
2147 rm -f conftest*
2148
2149
2150 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2151 if test "$ac_test_CFLAGS" = set; then
2152   CFLAGS="$ac_save_CFLAGS"
2153 elif test $ac_cv_prog_cc_g = yes; then
2154   if test "$GCC" = yes; then
2155     CFLAGS="-g -O2"
2156   else
2157     CFLAGS="-g"
2158   fi
2159 else
2160   if test "$GCC" = yes; then
2161     CFLAGS="-O2"
2162   else
2163     CFLAGS=
2164   fi
2165 fi
2166
2167 fi
2168 CFLAGS="$xe_save_CFLAGS"
2169
2170
2171 test -n "$CPP" -a -d "$CPP" && CPP=
2172
2173 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2174
2175 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2176 echo "configure:2177: checking how to run the C preprocessor" >&5
2177 # On Suns, sometimes $CPP names a directory.
2178 if test -n "$CPP" && test -d "$CPP"; then
2179   CPP=
2180 fi
2181 if test -z "$CPP"; then
2182
2183   # This must be in double quotes, not single quotes, because CPP may get
2184   # substituted into the Makefile and "${CC-cc}" will confuse make.
2185   CPP="${CC-cc} -E"
2186   # On the NeXT, cc -E runs the code through the compiler's parser,
2187   # not just through cpp.
2188   cat > conftest.$ac_ext <<EOF
2189 #line 2190 "configure"
2190 #include "confdefs.h"
2191 #include <assert.h>
2192 Syntax Error
2193 EOF
2194 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2195 { (eval echo configure:2196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2196 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2197 if test -z "$ac_err"; then
2198   :
2199 else
2200   echo "$ac_err" >&5
2201   echo "configure: failed program was:" >&5
2202   cat conftest.$ac_ext >&5
2203   rm -rf conftest*
2204   CPP="${CC-cc} -E -traditional-cpp"
2205   cat > conftest.$ac_ext <<EOF
2206 #line 2207 "configure"
2207 #include "confdefs.h"
2208 #include <assert.h>
2209 Syntax Error
2210 EOF
2211 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2212 { (eval echo configure:2213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2213 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2214 if test -z "$ac_err"; then
2215   :
2216 else
2217   echo "$ac_err" >&5
2218   echo "configure: failed program was:" >&5
2219   cat conftest.$ac_ext >&5
2220   rm -rf conftest*
2221   CPP="${CC-cc} -nologo -E"
2222   cat > conftest.$ac_ext <<EOF
2223 #line 2224 "configure"
2224 #include "confdefs.h"
2225 #include <assert.h>
2226 Syntax Error
2227 EOF
2228 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2229 { (eval echo configure:2230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2230 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2231 if test -z "$ac_err"; then
2232   :
2233 else
2234   echo "$ac_err" >&5
2235   echo "configure: failed program was:" >&5
2236   cat conftest.$ac_ext >&5
2237   rm -rf conftest*
2238   CPP=/lib/cpp
2239 fi
2240 rm -f conftest*
2241 fi
2242 rm -f conftest*
2243 fi
2244 rm -f conftest*
2245   ac_cv_prog_CPP="$CPP"
2246   CPP="$ac_cv_prog_CPP"
2247 else
2248   ac_cv_prog_CPP="$CPP"
2249 fi
2250 echo "$ac_t""$CPP" 1>&6
2251
2252
2253 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2254 echo "configure:2255: checking for AIX" >&5
2255 cat > conftest.$ac_ext <<EOF
2256 #line 2257 "configure"
2257 #include "confdefs.h"
2258 #ifdef _AIX
2259   yes
2260 #endif
2261
2262 EOF
2263 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2264   egrep "yes" >/dev/null 2>&1; then
2265   rm -rf conftest*
2266   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2267     Defining _ALL_SOURCE
2268 EOF
2269 cat >> confdefs.h <<\EOF
2270 #define _ALL_SOURCE 1
2271 EOF
2272 }
2273
2274 else
2275   rm -rf conftest*
2276   echo "$ac_t""no" 1>&6
2277 fi
2278 rm -f conftest*
2279
2280
2281
2282 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2283 echo "configure:2284: checking for GNU libc" >&5
2284 cat > conftest.$ac_ext <<EOF
2285 #line 2286 "configure"
2286 #include "confdefs.h"
2287 #include <features.h>
2288 int main() {
2289
2290 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2291 #error Not a GNU libc system :-(
2292 ******* ======= ******** &&&&&&&&
2293 #endif
2294
2295 ; return 0; }
2296 EOF
2297 if { (eval echo configure:2298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2298   rm -rf conftest*
2299   have_glibc=yes
2300 else
2301   echo "configure: failed program was:" >&5
2302   cat conftest.$ac_ext >&5
2303   rm -rf conftest*
2304   have_glibc=no
2305 fi
2306 rm -f conftest*
2307 echo "$ac_t""$have_glibc" 1>&6
2308 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2309     Defining _GNU_SOURCE
2310 EOF
2311 cat >> confdefs.h <<\EOF
2312 #define _GNU_SOURCE 1
2313 EOF
2314 }
2315
2316
2317
2318 cat > conftest.$ac_ext <<EOF
2319 #line 2320 "configure"
2320 #include "confdefs.h"
2321 int main () {
2322 #if defined __SUNPRO_C
2323 return 11;
2324 #elif defined __DECC
2325 return 12;
2326 #else
2327 return 0;
2328 #endif
2329 }
2330 EOF
2331 if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2332 then
2333   :
2334 else
2335   conftest_rc="$?"
2336   echo "configure: failed program was:" >&5
2337   cat conftest.$ac_ext >&5
2338   rm -fr conftest*
2339   case "$conftest_rc" in
2340   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2341   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2342 esac
2343 fi
2344 rm -fr conftest*
2345
2346
2347
2348
2349 echo "Extracting information from the machine- and system-dependent headers..."
2350
2351 tempcname="conftest.c"
2352
2353
2354
2355 cat > $tempcname <<EOF
2356 #define NOT_C_CODE
2357 #define C_SWITCH_SITE
2358 #define C_SWITCH_X_SITE
2359 #define LD_SWITCH_SITE
2360 #define LD_SWITCH_X_SITE
2361 #define LD_SWITCH_X_SITE_AUX
2362 #define OS_RELEASE $os_release
2363 #include "$srcdir/src/$opsysfile"
2364 #include "$srcdir/src/$machfile"
2365
2366 #ifndef LIBS_MACHINE
2367 #define LIBS_MACHINE
2368 #endif
2369 configure___ libs_machine=LIBS_MACHINE
2370
2371 #ifndef LIBS_SYSTEM
2372 #define LIBS_SYSTEM
2373 #endif
2374 configure___ libs_system=LIBS_SYSTEM
2375
2376 #ifndef LIBS_TERMCAP
2377 #define LIBS_TERMCAP
2378 #endif
2379 configure___ libs_termcap=LIBS_TERMCAP
2380
2381 #ifndef LIB_STANDARD
2382 #define LIB_STANDARD
2383 #endif
2384 configure___ libs_standard=LIB_STANDARD
2385
2386
2387 #ifndef OBJECTS_MACHINE
2388 #define OBJECTS_MACHINE
2389 #endif
2390 configure___ objects_machine=OBJECTS_MACHINE
2391
2392 #ifndef OBJECTS_SYSTEM
2393 #define OBJECTS_SYSTEM
2394 #endif
2395 configure___ objects_system=OBJECTS_SYSTEM
2396
2397
2398 #ifndef C_SWITCH_MACHINE
2399 #define C_SWITCH_MACHINE
2400 #endif
2401 configure___ c_switch_machine=C_SWITCH_MACHINE
2402
2403 #ifndef C_SWITCH_SYSTEM
2404 #define C_SWITCH_SYSTEM
2405 #endif
2406 configure___ c_switch_system=C_SWITCH_SYSTEM
2407
2408
2409 #ifndef LD_SWITCH_MACHINE
2410 #define LD_SWITCH_MACHINE
2411 #endif
2412 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2413
2414 #ifndef LD_SWITCH_SYSTEM
2415 #define LD_SWITCH_SYSTEM
2416 #endif
2417 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2418
2419
2420 #ifndef UNEXEC
2421 #define UNEXEC "unexec.o"
2422 #endif
2423 configure___ unexec=UNEXEC
2424
2425
2426 #ifndef LD_SWITCH_SHARED
2427 #define LD_SWITCH_SHARED "-c"
2428 #endif
2429 configure___ ld_switch_shared=LD_SWITCH_SHARED
2430
2431
2432 #ifdef ORDINARY_LINK
2433 #define LD "\$(CC) \$(CFLAGS)"
2434 #else /* no ORDINARY LINK */
2435 #ifdef COFF_ENCAPSULATE
2436 #define LD "\$(CC) -nostdlib"
2437 #else /* not COFF_ENCAPSULATE */
2438 #ifdef LINKER
2439 #define LD LINKER
2440 #else /* ! defined (LINKER) */
2441 #define LD "ld"
2442 #endif /* ! defined (LINKER) */
2443 #endif /* ! defined (COFF_ENCAPSULATE) */
2444 #endif /* not ORDINARY_LINK */
2445 configure___ ld=LD
2446
2447 #ifndef LIB_GCC
2448 #define LIB_GCC
2449 #endif
2450 configure___ lib_gcc=LIB_GCC
2451
2452 #ifndef LD_TEXT_START_ADDR
2453 #define LD_TEXT_START_ADDR
2454 #endif
2455 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2456
2457
2458 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2459 #ifdef NO_REMAP
2460 #ifdef COFF_ENCAPSULATE
2461 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2462 #else /* ! defined (COFF_ENCAPSULATE) */
2463 #define START_FILES "pre-crt0.o /lib/crt0.o"
2464 #endif /* ! defined (COFF_ENCAPSULATE) */
2465 #else /* ! defined (NO_REMAP) */
2466 #define START_FILES "ecrt0.o"
2467 #endif /* ! defined (NO_REMAP) */
2468 #endif /* no ORDINARY_LINK */
2469 #ifndef START_FILES
2470 #define START_FILES
2471 #endif
2472 configure___ start_files=START_FILES
2473
2474 #ifdef ORDINARY_LINK
2475 configure___ ordinary_link=yes
2476 #else
2477 configure___ ordinary_link=no
2478 #endif
2479
2480 #ifdef SYSTEM_MALLOC
2481 configure___ system_malloc=yes
2482 #else
2483 configure___ system_malloc=no
2484 #endif
2485
2486 #ifdef TERMINFO
2487 configure___ have_terminfo=yes
2488 #else
2489 configure___ have_terminfo=no
2490 #endif
2491
2492 #ifdef MAIL_USE_FLOCK
2493 configure___ mail_use_flock=yes
2494 #else
2495 configure___ mail_use_flock=no
2496 #endif
2497
2498 #ifdef MAIL_USE_LOCKF
2499 configure___ mail_use_lockf=yes
2500 #else
2501 configure___ mail_use_lockf=no
2502 #endif
2503
2504 #ifdef HAVE_WIN32_PROCESSES
2505 configure___ win32_processes=yes
2506 #else
2507 configure___ win32_processes=no
2508 #endif
2509
2510 EOF
2511
2512 CPP=`eval "echo $CPP $CPPFLAGS"`
2513 eval `$CPP -Isrc $tempcname \
2514         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2515
2516 rm $tempcname
2517
2518 test "$extra_verbose" = "yes" && \
2519   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 ""
2520
2521 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2522
2523 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2524
2525 if test "$cflags_specified" = "no"; then
2526       if   test "$GCC" = "yes"; then
2527     CFLAGS="-g -O3 -Wall -Wno-switch"
2528               elif test "$__SUNPRO_C" = "yes"; then
2529     case "$opsys" in
2530       sol2    ) CFLAGS="-v -xO4" ;;
2531       sunos4* ) CFLAGS="-xO2";;
2532     esac
2533   elif test "$__DECC" = "yes"; then
2534     CFLAGS="-O3"
2535   elif test "$CC" = "xlc"; then
2536     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2537     else
2538     CFLAGS="-O" ;  fi
2539 fi
2540
2541
2542 if test "$GCC" = "yes"; then
2543   set x $ld_switch_system; shift; ld_switch_system=""
2544   while test -n "$1"; do
2545     case $1 in
2546       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2547       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2548       -Xlinker* ) ;;
2549       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2550     esac
2551     shift
2552   done
2553 fi
2554
2555 if test "$GCC" = "yes"; then
2556   set x $ld_switch_machine; shift; ld_switch_machine=""
2557   while test -n "$1"; do
2558     case $1 in
2559       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2560       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2561       -Xlinker* ) ;;
2562       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2563     esac
2564     shift
2565   done
2566 fi
2567
2568 if test "$GCC" = "yes"; then
2569   set x $LDFLAGS; shift; LDFLAGS=""
2570   while test -n "$1"; do
2571     case $1 in
2572       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2573       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2574       -Xlinker* ) ;;
2575       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2576     esac
2577     shift
2578   done
2579 fi
2580
2581 if test "$GCC" = "yes"; then
2582   set x $ld_call_shared; shift; ld_call_shared=""
2583   while test -n "$1"; do
2584     case $1 in
2585       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2586       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2587       -Xlinker* ) ;;
2588       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2589     esac
2590     shift
2591   done
2592 fi
2593
2594 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2595    echo "    xemacs will be linked with \"$objects_machine\""
2596  fi
2597 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2598    echo "    xemacs will be linked with \"$objects_system\""
2599  fi
2600 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2601    echo "    xemacs will be linked with \"$unexec\""
2602  fi
2603
2604 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2605 echo "configure:2606: checking for dynodump" >&5
2606 if test "$unexec" != "unexsol2.o"; then
2607   echo "$ac_t""no" 1>&6
2608 else
2609   echo "$ac_t""yes" 1>&6
2610   { test "$extra_verbose" = "yes" && cat << \EOF
2611     Defining DYNODUMP
2612 EOF
2613 cat >> confdefs.h <<\EOF
2614 #define DYNODUMP 1
2615 EOF
2616 }
2617
2618   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2619   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2620   case "$machine" in
2621     sparc   ) dynodump_arch=sparc ;;
2622     *86*    ) dynodump_arch=i386  ;;
2623     powerpc ) dynodump_arch=ppc   ;;
2624   esac
2625     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
2626 fi
2627
2628
2629 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2630
2631 if test "$unexec" = "unexaix.o"; then
2632   if   test "$dynamic" = "no"; then
2633   start_flags="-Wl,-bnso,-bnodelcsect"
2634   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2635   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2636     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2637   done
2638   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2639     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2640   done
2641   
2642 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2643 echo "configure:2644: checking for terminateAndUnload in -lC" >&5
2644 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2645
2646 xe_check_libs=" -lC "
2647 cat > conftest.$ac_ext <<EOF
2648 #line 2649 "configure"
2649 #include "confdefs.h"
2650 /* Override any gcc2 internal prototype to avoid an error.  */
2651 /* We use char because int might match the return type of a gcc2
2652     builtin and then its argument prototype would still apply.  */
2653 char terminateAndUnload();
2654
2655 int main() {
2656 terminateAndUnload()
2657 ; return 0; }
2658 EOF
2659 if { (eval echo configure:2660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2660   rm -rf conftest*
2661   eval "ac_cv_lib_$ac_lib_var=yes"
2662 else
2663   echo "configure: failed program was:" >&5
2664   cat conftest.$ac_ext >&5
2665   rm -rf conftest*
2666   eval "ac_cv_lib_$ac_lib_var=no"
2667 fi
2668 rm -f conftest*
2669 xe_check_libs=""
2670
2671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2672   echo "$ac_t""yes" 1>&6
2673   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2674 else
2675   echo "$ac_t""no" 1>&6
2676 fi
2677
2678
2679   fi
2680 elif test -n "$ld_text_start_addr"; then
2681   start_flags="-T $ld_text_start_addr -e __start"
2682 fi
2683
2684
2685
2686
2687 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2688  test -z "$linker" &&  linker='$(CC) -nostdlib'
2689  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2690 fi
2691 test "$GCC" != "yes" && lib_gcc=
2692
2693
2694
2695
2696
2697 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2698 if test -n "$site_libraries"; then
2699   for arg in $site_libraries; do
2700     case "$arg" in
2701      -* ) ;;
2702      * ) test -d "$arg" || \
2703            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2704        arg="-L${arg}" ;;
2705     esac
2706     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2707   done
2708 fi
2709
2710 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2711 if test -n "$site_includes"; then
2712   for arg in $site_includes; do
2713     case "$arg" in
2714       -* ) ;;
2715       * ) test -d "$arg" || \
2716            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2717       arg="-I${arg}" ;;
2718     esac
2719     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2720   done
2721 fi
2722
2723 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2724 if test -n "$site_prefixes"; then
2725   for dir in $site_prefixes; do
2726     lib_dir="${dir}/lib"
2727     inc_dir="${dir}/include"
2728     if test ! -d "$dir"; then
2729       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2730     elif test ! -d "$lib_dir"; then
2731       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2732     else
2733       if test -d "$inc_dir"; then
2734         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
2735       fi
2736       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
2737     fi
2738   done
2739 fi
2740
2741
2742 for dir in "/usr/ccs/lib"; do
2743   test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${dir}\" to \$ld_switch_site"; fi
2744 done
2745
2746 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2747 if test -n "$site_runtime_libraries"; then
2748   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2749   export LD_RUN_PATH
2750 fi
2751
2752
2753 if   test "$dynamic" = "no"; then add_runtime_path=no
2754 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2755 else case "$opsys" in
2756        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2757        * ) add_runtime_path=no ;;
2758      esac
2759 fi
2760
2761 if test "$add_runtime_path" = "yes"; then
2762       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2763 echo "configure:2764: checking "for runtime libraries flag"" >&5
2764   case "$opsys" in
2765     sol2 ) dash_r="-R" ;;
2766     decosf* | linux* | irix*) dash_r="-rpath " ;;
2767     *)
2768       dash_r=""
2769       for try_dash_r in "-R" "-R " "-rpath "; do
2770         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2771         
2772 if test "$GCC" = "yes"; then
2773   set x $xe_check_libs; shift; xe_check_libs=""
2774   while test -n "$1"; do
2775     case $1 in
2776       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2777       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2778       -Xlinker* ) ;;
2779       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2780     esac
2781     shift
2782   done
2783 fi
2784         cat > conftest.$ac_ext <<EOF
2785 #line 2786 "configure"
2786 #include "confdefs.h"
2787
2788 int main() {
2789
2790 ; return 0; }
2791 EOF
2792 if { (eval echo configure:2793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2793   rm -rf conftest*
2794   dash_r="$try_dash_r"
2795 else
2796   echo "configure: failed program was:" >&5
2797   cat conftest.$ac_ext >&5
2798 fi
2799 rm -f conftest*
2800         xe_check_libs=""
2801         test -n "$dash_r" && break
2802       done ;;
2803   esac
2804   if test -n "$dash_r";
2805     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2806     else echo "$ac_t""NONE" 1>&6
2807   fi
2808 fi
2809
2810 xe_add_unique_runpath_dir='
2811   xe_add_p=yes
2812   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2813   done
2814   if test "$xe_add_p" = "yes"; then
2815     test -n "$runpath" && runpath="${runpath}:"
2816     runpath="${runpath}${xe_runpath_dir}"
2817     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2818   fi'
2819
2820
2821
2822
2823 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2824     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2825   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2826   
2827         runpath="" runpath_dirs=""
2828   if test -n "$LD_RUN_PATH"; then
2829     runpath="$LD_RUN_PATH"
2830   elif test "$GCC" = "yes"; then
2831         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2832     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2833     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2834     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2835       case "$arg" in P,* | -L* | -R* )
2836         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2837           {
2838 xe_runpath_dir="$dir"
2839   test "$xe_runpath_dir" != "/lib"     -a \
2840         "$xe_runpath_dir" != "/usr/lib" -a \
2841         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2842   eval "$xe_add_unique_runpath_dir"
2843 }
2844         done ;;
2845       esac
2846     done
2847     ld_switch_run="$ld_switch_run_save"
2848     rm -f conftest*
2849   else
2850         for arg in $ld_switch_site $ld_switch_x_site; do
2851       case "$arg" in -L*) {
2852 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2853   test "$xe_runpath_dir" != "/lib"     -a \
2854         "$xe_runpath_dir" != "/usr/lib" -a \
2855         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2856   eval "$xe_add_unique_runpath_dir"
2857 };; esac
2858     done
2859         if test "$opsys $need_motif" = "sol2 yes"; then
2860       xe_runpath_dir="/opt/SUNWdt/lib";
2861       eval "$xe_add_unique_runpath_dir";
2862     fi
2863   fi 
2864   if test -n "$runpath"; then
2865     ld_switch_run="${dash_r}${runpath}"
2866     
2867 if test "$GCC" = "yes"; then
2868   set x $ld_switch_run; shift; ld_switch_run=""
2869   while test -n "$1"; do
2870     case $1 in
2871       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2872       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2873       -Xlinker* ) ;;
2874       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2875     esac
2876     shift
2877   done
2878 fi
2879     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2880   fi
2881 fi
2882
2883
2884
2885
2886 GNU_MALLOC=yes
2887 if test "$with_dlmalloc" != "no"; then
2888         doug_lea_malloc=yes
2889 else
2890         doug_lea_malloc=no
2891 fi
2892 after_morecore_hook_exists=yes
2893 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2894 echo "configure:2895: checking for malloc_get_state" >&5
2895
2896 cat > conftest.$ac_ext <<EOF
2897 #line 2898 "configure"
2898 #include "confdefs.h"
2899 /* System header to define __stub macros and hopefully few prototypes,
2900     which can conflict with char malloc_get_state(); below.  */
2901 #include <assert.h>
2902 /* Override any gcc2 internal prototype to avoid an error.  */
2903 /* We use char because int might match the return type of a gcc2
2904     builtin and then its argument prototype would still apply.  */
2905 char malloc_get_state();
2906
2907 int main() {
2908
2909 /* The GNU C library defines this for functions which it implements
2910     to always fail with ENOSYS.  Some functions are actually named
2911     something starting with __ and the normal name is an alias.  */
2912 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2913 choke me
2914 #else
2915 malloc_get_state();
2916 #endif
2917
2918 ; return 0; }
2919 EOF
2920 if { (eval echo configure:2921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2921   rm -rf conftest*
2922   eval "ac_cv_func_malloc_get_state=yes"
2923 else
2924   echo "configure: failed program was:" >&5
2925   cat conftest.$ac_ext >&5
2926   rm -rf conftest*
2927   eval "ac_cv_func_malloc_get_state=no"
2928 fi
2929 rm -f conftest*
2930
2931 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2932   echo "$ac_t""yes" 1>&6
2933   :
2934 else
2935   echo "$ac_t""no" 1>&6
2936 doug_lea_malloc=no
2937 fi
2938
2939 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2940 echo "configure:2941: checking for malloc_set_state" >&5
2941
2942 cat > conftest.$ac_ext <<EOF
2943 #line 2944 "configure"
2944 #include "confdefs.h"
2945 /* System header to define __stub macros and hopefully few prototypes,
2946     which can conflict with char malloc_set_state(); below.  */
2947 #include <assert.h>
2948 /* Override any gcc2 internal prototype to avoid an error.  */
2949 /* We use char because int might match the return type of a gcc2
2950     builtin and then its argument prototype would still apply.  */
2951 char malloc_set_state();
2952
2953 int main() {
2954
2955 /* The GNU C library defines this for functions which it implements
2956     to always fail with ENOSYS.  Some functions are actually named
2957     something starting with __ and the normal name is an alias.  */
2958 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2959 choke me
2960 #else
2961 malloc_set_state();
2962 #endif
2963
2964 ; return 0; }
2965 EOF
2966 if { (eval echo configure:2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2967   rm -rf conftest*
2968   eval "ac_cv_func_malloc_set_state=yes"
2969 else
2970   echo "configure: failed program was:" >&5
2971   cat conftest.$ac_ext >&5
2972   rm -rf conftest*
2973   eval "ac_cv_func_malloc_set_state=no"
2974 fi
2975 rm -f conftest*
2976
2977 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2978   echo "$ac_t""yes" 1>&6
2979   :
2980 else
2981   echo "$ac_t""no" 1>&6
2982 doug_lea_malloc=no
2983 fi
2984
2985 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2986 echo "configure:2987: checking whether __after_morecore_hook exists" >&5
2987 cat > conftest.$ac_ext <<EOF
2988 #line 2989 "configure"
2989 #include "confdefs.h"
2990 extern void (* __after_morecore_hook)();
2991 int main() {
2992 __after_morecore_hook = 0
2993 ; return 0; }
2994 EOF
2995 if { (eval echo configure:2996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2996   rm -rf conftest*
2997   echo "$ac_t""yes" 1>&6
2998 else
2999   echo "configure: failed program was:" >&5
3000   cat conftest.$ac_ext >&5
3001   rm -rf conftest*
3002   echo "$ac_t""no" 1>&6
3003    after_morecore_hook_exists=no
3004 fi
3005 rm -f conftest*
3006 if test "$system_malloc" = "yes" ; then
3007   GNU_MALLOC=no
3008   GNU_MALLOC_reason="
3009   (The GNU allocators don't work with this system configuration)."
3010 elif test "$with_system_malloc" = "yes" ; then
3011   GNU_MALLOC=no
3012   GNU_MALLOC_reason="
3013   (User chose not to use GNU allocators)."
3014 elif test "$with_debug_malloc" = "yes" ; then
3015   GNU_MALLOC=no
3016   GNU_MALLOC_reason="
3017   (User chose to use Debugging Malloc)."
3018 fi
3019
3020 if test "$doug_lea_malloc" = "yes" ; then
3021   if test "$GNU_MALLOC" = yes ; then
3022     GNU_MALLOC_reason="
3023   (Using Doug Lea's new malloc from the GNU C Library.)"
3024   fi
3025   { test "$extra_verbose" = "yes" && cat << \EOF
3026     Defining DOUG_LEA_MALLOC
3027 EOF
3028 cat >> confdefs.h <<\EOF
3029 #define DOUG_LEA_MALLOC 1
3030 EOF
3031 }
3032
3033   if test "$after_morecore_hook_exists" = "no" ; then
3034     GNU_MALLOC_reason="
3035   (Using Doug Lea's new malloc from the Linux C Library.)"
3036     { test "$extra_verbose" = "yes" && cat << \EOF
3037     Defining _NO_MALLOC_WARNING_
3038 EOF
3039 cat >> confdefs.h <<\EOF
3040 #define _NO_MALLOC_WARNING_ 1
3041 EOF
3042 }
3043
3044   fi
3045   use_minimal_tagbits=yes
3046 fi
3047
3048
3049
3050
3051 # Extract the first word of "ranlib", so it can be a program name with args.
3052 set dummy ranlib; ac_word=$2
3053 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3054 echo "configure:3055: checking for $ac_word" >&5
3055
3056 if test -n "$RANLIB"; then
3057   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3058 else
3059   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3060   ac_dummy="$PATH"
3061   for ac_dir in $ac_dummy; do
3062     test -z "$ac_dir" && ac_dir=.
3063     if test -f $ac_dir/$ac_word; then
3064       ac_cv_prog_RANLIB="ranlib"
3065       break
3066     fi
3067   done
3068   IFS="$ac_save_ifs"
3069   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3070 fi
3071 RANLIB="$ac_cv_prog_RANLIB"
3072 if test -n "$RANLIB"; then
3073   echo "$ac_t""$RANLIB" 1>&6
3074 else
3075   echo "$ac_t""no" 1>&6
3076 fi
3077
3078 ac_aux_dir=
3079 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3080   if test -f $ac_dir/install-sh; then
3081     ac_aux_dir=$ac_dir
3082     ac_install_sh="$ac_aux_dir/install-sh -c"
3083     break
3084   elif test -f $ac_dir/install.sh; then
3085     ac_aux_dir=$ac_dir
3086     ac_install_sh="$ac_aux_dir/install.sh -c"
3087     break
3088   fi
3089 done
3090 if test -z "$ac_aux_dir"; then
3091   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3092 fi
3093 ac_config_guess=$ac_aux_dir/config.guess
3094 ac_config_sub=$ac_aux_dir/config.sub
3095 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3096
3097 # Find a good install program.  We prefer a C program (faster),
3098 # so one script is as good as another.  But avoid the broken or
3099 # incompatible versions:
3100 # SysV /etc/install, /usr/sbin/install
3101 # SunOS /usr/etc/install
3102 # IRIX /sbin/install
3103 # AIX /bin/install
3104 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3105 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3106 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3107 # ./install, which can be erroneously created by make from ./install.sh.
3108 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3109 echo "configure:3110: checking for a BSD compatible install" >&5
3110 if test -z "$INSTALL"; then
3111
3112   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3113   for ac_dir in $PATH; do
3114     # Account for people who put trailing slashes in PATH elements.
3115     case "$ac_dir/" in
3116     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3117     *)
3118       # OSF1 and SCO ODT 3.0 have their own names for install.
3119       # Don't use installbsd from OSF since it installs stuff as root
3120       # by default.
3121       for ac_prog in ginstall scoinst install; do
3122         if test -f $ac_dir/$ac_prog; then
3123           if test $ac_prog = install &&
3124             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3125             # AIX install.  It has an incompatible calling convention.
3126             :
3127           else
3128             ac_cv_path_install="$ac_dir/$ac_prog -c"
3129             break 2
3130           fi
3131         fi
3132       done
3133       ;;
3134     esac
3135   done
3136   IFS="$ac_save_IFS"
3137
3138   if test "${ac_cv_path_install+set}" = set; then
3139     INSTALL="$ac_cv_path_install"
3140   else
3141     # As a last resort, use the slow shell script.  We don't cache a
3142     # path for INSTALL within a source directory, because that will
3143     # break other packages using the cache if that directory is
3144     # removed, or if the path is relative.
3145     INSTALL="$ac_install_sh"
3146   fi
3147 fi
3148 echo "$ac_t""$INSTALL" 1>&6
3149
3150 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3151 # It thinks the first close brace ends the variable substitution.
3152 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3153
3154 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3155
3156 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3157
3158 for ac_prog in 'bison -y' byacc
3159 do
3160 # Extract the first word of "$ac_prog", so it can be a program name with args.
3161 set dummy $ac_prog; ac_word=$2
3162 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3163 echo "configure:3164: checking for $ac_word" >&5
3164
3165 if test -n "$YACC"; then
3166   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3167 else
3168   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3169   ac_dummy="$PATH"
3170   for ac_dir in $ac_dummy; do
3171     test -z "$ac_dir" && ac_dir=.
3172     if test -f $ac_dir/$ac_word; then
3173       ac_cv_prog_YACC="$ac_prog"
3174       break
3175     fi
3176   done
3177   IFS="$ac_save_ifs"
3178 fi
3179 YACC="$ac_cv_prog_YACC"
3180 if test -n "$YACC"; then
3181   echo "$ac_t""$YACC" 1>&6
3182 else
3183   echo "$ac_t""no" 1>&6
3184 fi
3185
3186 test -n "$YACC" && break
3187 done
3188 test -n "$YACC" || YACC="yacc"
3189
3190
3191 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
3192 do
3193 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3194 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3195 echo "configure:3196: checking for $ac_hdr" >&5
3196
3197 cat > conftest.$ac_ext <<EOF
3198 #line 3199 "configure"
3199 #include "confdefs.h"
3200 #include <$ac_hdr>
3201 EOF
3202 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3203 { (eval echo configure:3204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3204 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3205 if test -z "$ac_err"; then
3206   rm -rf conftest*
3207   eval "ac_cv_header_$ac_safe=yes"
3208 else
3209   echo "$ac_err" >&5
3210   echo "configure: failed program was:" >&5
3211   cat conftest.$ac_ext >&5
3212   rm -rf conftest*
3213   eval "ac_cv_header_$ac_safe=no"
3214 fi
3215 rm -f conftest*
3216 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3217   echo "$ac_t""yes" 1>&6
3218     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3219   { test "$extra_verbose" = "yes" && cat << EOF
3220     Defining $ac_tr_hdr
3221 EOF
3222 cat >> confdefs.h <<EOF
3223 #define $ac_tr_hdr 1
3224 EOF
3225 }
3226  
3227 else
3228   echo "$ac_t""no" 1>&6
3229 fi
3230 done
3231
3232 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3233 do
3234 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3235 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3236 echo "configure:3237: checking for $ac_hdr" >&5
3237
3238 cat > conftest.$ac_ext <<EOF
3239 #line 3240 "configure"
3240 #include "confdefs.h"
3241 #include <$ac_hdr>
3242 EOF
3243 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3244 { (eval echo configure:3245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3245 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3246 if test -z "$ac_err"; then
3247   rm -rf conftest*
3248   eval "ac_cv_header_$ac_safe=yes"
3249 else
3250   echo "$ac_err" >&5
3251   echo "configure: failed program was:" >&5
3252   cat conftest.$ac_ext >&5
3253   rm -rf conftest*
3254   eval "ac_cv_header_$ac_safe=no"
3255 fi
3256 rm -f conftest*
3257 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3258   echo "$ac_t""yes" 1>&6
3259     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3260   { test "$extra_verbose" = "yes" && cat << EOF
3261     Defining $ac_tr_hdr
3262 EOF
3263 cat >> confdefs.h <<EOF
3264 #define $ac_tr_hdr 1
3265 EOF
3266 }
3267  
3268 else
3269   echo "$ac_t""no" 1>&6
3270 fi
3271 done
3272
3273 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3274 do
3275 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3276 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3277 echo "configure:3278: checking for $ac_hdr" >&5
3278
3279 cat > conftest.$ac_ext <<EOF
3280 #line 3281 "configure"
3281 #include "confdefs.h"
3282 #include <$ac_hdr>
3283 EOF
3284 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3285 { (eval echo configure:3286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3286 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3287 if test -z "$ac_err"; then
3288   rm -rf conftest*
3289   eval "ac_cv_header_$ac_safe=yes"
3290 else
3291   echo "$ac_err" >&5
3292   echo "configure: failed program was:" >&5
3293   cat conftest.$ac_ext >&5
3294   rm -rf conftest*
3295   eval "ac_cv_header_$ac_safe=no"
3296 fi
3297 rm -f conftest*
3298 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3299   echo "$ac_t""yes" 1>&6
3300     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3301   { test "$extra_verbose" = "yes" && cat << EOF
3302     Defining $ac_tr_hdr
3303 EOF
3304 cat >> confdefs.h <<EOF
3305 #define $ac_tr_hdr 1
3306 EOF
3307 }
3308  
3309 else
3310   echo "$ac_t""no" 1>&6
3311 fi
3312 done
3313
3314 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3315 echo "configure:3316: checking for sys/wait.h that is POSIX.1 compatible" >&5
3316
3317 cat > conftest.$ac_ext <<EOF
3318 #line 3319 "configure"
3319 #include "confdefs.h"
3320 #include <sys/types.h>
3321 #include <sys/wait.h>
3322 #ifndef WEXITSTATUS
3323 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3324 #endif
3325 #ifndef WIFEXITED
3326 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3327 #endif
3328 int main() {
3329 int s;
3330 wait (&s);
3331 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3332 ; return 0; }
3333 EOF
3334 if { (eval echo configure:3335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3335   rm -rf conftest*
3336   ac_cv_header_sys_wait_h=yes
3337 else
3338   echo "configure: failed program was:" >&5
3339   cat conftest.$ac_ext >&5
3340   rm -rf conftest*
3341   ac_cv_header_sys_wait_h=no
3342 fi
3343 rm -f conftest*
3344
3345 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3346 if test $ac_cv_header_sys_wait_h = yes; then
3347   { test "$extra_verbose" = "yes" && cat << \EOF
3348     Defining HAVE_SYS_WAIT_H
3349 EOF
3350 cat >> confdefs.h <<\EOF
3351 #define HAVE_SYS_WAIT_H 1
3352 EOF
3353 }
3354
3355 fi
3356
3357 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3358 echo "configure:3359: checking for ANSI C header files" >&5
3359
3360 cat > conftest.$ac_ext <<EOF
3361 #line 3362 "configure"
3362 #include "confdefs.h"
3363 #include <stdlib.h>
3364 #include <stdarg.h>
3365 #include <string.h>
3366 #include <float.h>
3367 EOF
3368 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3369 { (eval echo configure:3370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3370 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3371 if test -z "$ac_err"; then
3372   rm -rf conftest*
3373   ac_cv_header_stdc=yes
3374 else
3375   echo "$ac_err" >&5
3376   echo "configure: failed program was:" >&5
3377   cat conftest.$ac_ext >&5
3378   rm -rf conftest*
3379   ac_cv_header_stdc=no
3380 fi
3381 rm -f conftest*
3382
3383 if test $ac_cv_header_stdc = yes; then
3384   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3385 cat > conftest.$ac_ext <<EOF
3386 #line 3387 "configure"
3387 #include "confdefs.h"
3388 #include <string.h>
3389 EOF
3390 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3391   egrep "memchr" >/dev/null 2>&1; then
3392   :
3393 else
3394   rm -rf conftest*
3395   ac_cv_header_stdc=no
3396 fi
3397 rm -f conftest*
3398
3399 fi
3400
3401 if test $ac_cv_header_stdc = yes; then
3402   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3403 cat > conftest.$ac_ext <<EOF
3404 #line 3405 "configure"
3405 #include "confdefs.h"
3406 #include <stdlib.h>
3407 EOF
3408 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3409   egrep "free" >/dev/null 2>&1; then
3410   :
3411 else
3412   rm -rf conftest*
3413   ac_cv_header_stdc=no
3414 fi
3415 rm -f conftest*
3416
3417 fi
3418
3419 if test $ac_cv_header_stdc = yes; then
3420   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3421 cat > conftest.$ac_ext <<EOF
3422 #line 3423 "configure"
3423 #include "confdefs.h"
3424 #include <ctype.h>
3425 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3426 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3427 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3428 int main () { int i; for (i = 0; i < 256; i++)
3429 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3430 exit (0); }
3431
3432 EOF
3433 if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3434 then
3435   :
3436 else
3437   conftest_rc="$?"
3438   echo "configure: failed program was:" >&5
3439   cat conftest.$ac_ext >&5
3440   rm -fr conftest*
3441   ac_cv_header_stdc=no
3442 fi
3443 rm -fr conftest*
3444 fi
3445
3446 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3447 if test $ac_cv_header_stdc = yes; then
3448   { test "$extra_verbose" = "yes" && cat << \EOF
3449     Defining STDC_HEADERS
3450 EOF
3451 cat >> confdefs.h <<\EOF
3452 #define STDC_HEADERS 1
3453 EOF
3454 }
3455
3456 fi
3457
3458 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3459 echo "configure:3460: checking whether time.h and sys/time.h may both be included" >&5
3460
3461 cat > conftest.$ac_ext <<EOF
3462 #line 3463 "configure"
3463 #include "confdefs.h"
3464 #include <sys/types.h>
3465 #include <sys/time.h>
3466 #include <time.h>
3467 int main() {
3468 struct tm *tp;
3469 ; return 0; }
3470 EOF
3471 if { (eval echo configure:3472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3472   rm -rf conftest*
3473   ac_cv_header_time=yes
3474 else
3475   echo "configure: failed program was:" >&5
3476   cat conftest.$ac_ext >&5
3477   rm -rf conftest*
3478   ac_cv_header_time=no
3479 fi
3480 rm -f conftest*
3481
3482 echo "$ac_t""$ac_cv_header_time" 1>&6
3483 if test $ac_cv_header_time = yes; then
3484   { test "$extra_verbose" = "yes" && cat << \EOF
3485     Defining TIME_WITH_SYS_TIME
3486 EOF
3487 cat >> confdefs.h <<\EOF
3488 #define TIME_WITH_SYS_TIME 1
3489 EOF
3490 }
3491
3492 fi
3493
3494 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3495 echo "configure:3496: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3496
3497 cat > conftest.$ac_ext <<EOF
3498 #line 3499 "configure"
3499 #include "confdefs.h"
3500 #include <sys/types.h>
3501 #include <signal.h>
3502 /* NetBSD declares sys_siglist in unistd.h.  */
3503 #ifdef HAVE_UNISTD_H
3504 #include <unistd.h>
3505 #endif
3506 int main() {
3507 char *msg = *(sys_siglist + 1);
3508 ; return 0; }
3509 EOF
3510 if { (eval echo configure:3511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3511   rm -rf conftest*
3512   ac_cv_decl_sys_siglist=yes
3513 else
3514   echo "configure: failed program was:" >&5
3515   cat conftest.$ac_ext >&5
3516   rm -rf conftest*
3517   ac_cv_decl_sys_siglist=no
3518 fi
3519 rm -f conftest*
3520
3521 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3522 if test $ac_cv_decl_sys_siglist = yes; then
3523   { test "$extra_verbose" = "yes" && cat << \EOF
3524     Defining SYS_SIGLIST_DECLARED
3525 EOF
3526 cat >> confdefs.h <<\EOF
3527 #define SYS_SIGLIST_DECLARED 1
3528 EOF
3529 }
3530
3531 fi
3532
3533
3534 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3535 echo "configure:3536: checking for struct utimbuf" >&5
3536 cat > conftest.$ac_ext <<EOF
3537 #line 3538 "configure"
3538 #include "confdefs.h"
3539 #ifdef TIME_WITH_SYS_TIME
3540 #include <sys/time.h>
3541 #include <time.h>
3542 #else
3543 #ifdef HAVE_SYS_TIME_H
3544 #include <sys/time.h>
3545 #else
3546 #include <time.h>
3547 #endif
3548 #endif
3549 #ifdef HAVE_UTIME_H
3550 #include <utime.h>
3551 #endif
3552 int main() {
3553 static struct utimbuf x; x.actime = x.modtime;
3554 ; return 0; }
3555 EOF
3556 if { (eval echo configure:3557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3557   rm -rf conftest*
3558   echo "$ac_t""yes" 1>&6
3559    { test "$extra_verbose" = "yes" && cat << \EOF
3560     Defining HAVE_STRUCT_UTIMBUF
3561 EOF
3562 cat >> confdefs.h <<\EOF
3563 #define HAVE_STRUCT_UTIMBUF 1
3564 EOF
3565 }
3566
3567 else
3568   echo "configure: failed program was:" >&5
3569   cat conftest.$ac_ext >&5
3570   rm -rf conftest*
3571   echo "$ac_t""no" 1>&6
3572 fi
3573 rm -f conftest*
3574
3575 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3576 echo "configure:3577: checking return type of signal handlers" >&5
3577
3578 cat > conftest.$ac_ext <<EOF
3579 #line 3580 "configure"
3580 #include "confdefs.h"
3581 #include <sys/types.h>
3582 #include <signal.h>
3583 #ifdef signal
3584 #undef signal
3585 #endif
3586 #ifdef __cplusplus
3587 extern "C" void (*signal (int, void (*)(int)))(int);
3588 #else
3589 void (*signal ()) ();
3590 #endif
3591
3592 int main() {
3593 int i;
3594 ; return 0; }
3595 EOF
3596 if { (eval echo configure:3597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3597   rm -rf conftest*
3598   ac_cv_type_signal=void
3599 else
3600   echo "configure: failed program was:" >&5
3601   cat conftest.$ac_ext >&5
3602   rm -rf conftest*
3603   ac_cv_type_signal=int
3604 fi
3605 rm -f conftest*
3606
3607 echo "$ac_t""$ac_cv_type_signal" 1>&6
3608 { test "$extra_verbose" = "yes" && cat << EOF
3609     Defining RETSIGTYPE = $ac_cv_type_signal
3610 EOF
3611 cat >> confdefs.h <<EOF
3612 #define RETSIGTYPE $ac_cv_type_signal
3613 EOF
3614 }
3615
3616
3617 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3618 echo "configure:3619: checking for size_t" >&5
3619
3620 cat > conftest.$ac_ext <<EOF
3621 #line 3622 "configure"
3622 #include "confdefs.h"
3623 #include <sys/types.h>
3624 #if STDC_HEADERS
3625 #include <stdlib.h>
3626 #include <stddef.h>
3627 #endif
3628 EOF
3629 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3630   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3631   rm -rf conftest*
3632   ac_cv_type_size_t=yes
3633 else
3634   rm -rf conftest*
3635   ac_cv_type_size_t=no
3636 fi
3637 rm -f conftest*
3638
3639 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3640 if test $ac_cv_type_size_t = no; then
3641   { test "$extra_verbose" = "yes" && cat << \EOF
3642     Defining size_t = unsigned
3643 EOF
3644 cat >> confdefs.h <<\EOF
3645 #define size_t unsigned
3646 EOF
3647 }
3648
3649 fi
3650
3651 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3652 echo "configure:3653: checking for pid_t" >&5
3653
3654 cat > conftest.$ac_ext <<EOF
3655 #line 3656 "configure"
3656 #include "confdefs.h"
3657 #include <sys/types.h>
3658 #if STDC_HEADERS
3659 #include <stdlib.h>
3660 #include <stddef.h>
3661 #endif
3662 EOF
3663 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3664   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3665   rm -rf conftest*
3666   ac_cv_type_pid_t=yes
3667 else
3668   rm -rf conftest*
3669   ac_cv_type_pid_t=no
3670 fi
3671 rm -f conftest*
3672
3673 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3674 if test $ac_cv_type_pid_t = no; then
3675   { test "$extra_verbose" = "yes" && cat << \EOF
3676     Defining pid_t = int
3677 EOF
3678 cat >> confdefs.h <<\EOF
3679 #define pid_t int
3680 EOF
3681 }
3682
3683 fi
3684
3685 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3686 echo "configure:3687: checking for uid_t in sys/types.h" >&5
3687
3688 cat > conftest.$ac_ext <<EOF
3689 #line 3690 "configure"
3690 #include "confdefs.h"
3691 #include <sys/types.h>
3692 EOF
3693 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3694   egrep "uid_t" >/dev/null 2>&1; then
3695   rm -rf conftest*
3696   ac_cv_type_uid_t=yes
3697 else
3698   rm -rf conftest*
3699   ac_cv_type_uid_t=no
3700 fi
3701 rm -f conftest*
3702
3703
3704 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3705 if test $ac_cv_type_uid_t = no; then
3706   { test "$extra_verbose" = "yes" && cat << \EOF
3707     Defining uid_t = int
3708 EOF
3709 cat >> confdefs.h <<\EOF
3710 #define uid_t int
3711 EOF
3712 }
3713
3714   { test "$extra_verbose" = "yes" && cat << \EOF
3715     Defining gid_t = int
3716 EOF
3717 cat >> confdefs.h <<\EOF
3718 #define gid_t int
3719 EOF
3720 }
3721
3722 fi
3723
3724 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3725 echo "configure:3726: checking for mode_t" >&5
3726
3727 cat > conftest.$ac_ext <<EOF
3728 #line 3729 "configure"
3729 #include "confdefs.h"
3730 #include <sys/types.h>
3731 #if STDC_HEADERS
3732 #include <stdlib.h>
3733 #include <stddef.h>
3734 #endif
3735 EOF
3736 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3737   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3738   rm -rf conftest*
3739   ac_cv_type_mode_t=yes
3740 else
3741   rm -rf conftest*
3742   ac_cv_type_mode_t=no
3743 fi
3744 rm -f conftest*
3745
3746 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3747 if test $ac_cv_type_mode_t = no; then
3748   { test "$extra_verbose" = "yes" && cat << \EOF
3749     Defining mode_t = int
3750 EOF
3751 cat >> confdefs.h <<\EOF
3752 #define mode_t int
3753 EOF
3754 }
3755
3756 fi
3757
3758 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3759 echo "configure:3760: checking for off_t" >&5
3760
3761 cat > conftest.$ac_ext <<EOF
3762 #line 3763 "configure"
3763 #include "confdefs.h"
3764 #include <sys/types.h>
3765 #if STDC_HEADERS
3766 #include <stdlib.h>
3767 #include <stddef.h>
3768 #endif
3769 EOF
3770 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3771   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3772   rm -rf conftest*
3773   ac_cv_type_off_t=yes
3774 else
3775   rm -rf conftest*
3776   ac_cv_type_off_t=no
3777 fi
3778 rm -f conftest*
3779
3780 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3781 if test $ac_cv_type_off_t = no; then
3782   { test "$extra_verbose" = "yes" && cat << \EOF
3783     Defining off_t = long
3784 EOF
3785 cat >> confdefs.h <<\EOF
3786 #define off_t long
3787 EOF
3788 }
3789
3790 fi
3791
3792
3793 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3794 echo "configure:3795: checking for struct timeval" >&5
3795 cat > conftest.$ac_ext <<EOF
3796 #line 3797 "configure"
3797 #include "confdefs.h"
3798 #ifdef TIME_WITH_SYS_TIME
3799 #include <sys/time.h>
3800 #include <time.h>
3801 #else
3802 #ifdef HAVE_SYS_TIME_H
3803 #include <sys/time.h>
3804 #else
3805 #include <time.h>
3806 #endif
3807 #endif
3808 int main() {
3809 static struct timeval x; x.tv_sec = x.tv_usec;
3810 ; return 0; }
3811 EOF
3812 if { (eval echo configure:3813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3813   rm -rf conftest*
3814   echo "$ac_t""yes" 1>&6
3815   HAVE_TIMEVAL=yes
3816   { test "$extra_verbose" = "yes" && cat << \EOF
3817     Defining HAVE_TIMEVAL
3818 EOF
3819 cat >> confdefs.h <<\EOF
3820 #define HAVE_TIMEVAL 1
3821 EOF
3822 }
3823
3824 else
3825   echo "configure: failed program was:" >&5
3826   cat conftest.$ac_ext >&5
3827   rm -rf conftest*
3828   echo "$ac_t""no" 1>&6
3829    HAVE_TIMEVAL=no
3830 fi
3831 rm -f conftest*
3832
3833 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3834 echo "configure:3835: checking whether struct tm is in sys/time.h or time.h" >&5
3835
3836 cat > conftest.$ac_ext <<EOF
3837 #line 3838 "configure"
3838 #include "confdefs.h"
3839 #include <sys/types.h>
3840 #include <time.h>
3841 int main() {
3842 struct tm *tp; tp->tm_sec;
3843 ; return 0; }
3844 EOF
3845 if { (eval echo configure:3846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3846   rm -rf conftest*
3847   ac_cv_struct_tm=time.h
3848 else
3849   echo "configure: failed program was:" >&5
3850   cat conftest.$ac_ext >&5
3851   rm -rf conftest*
3852   ac_cv_struct_tm=sys/time.h
3853 fi
3854 rm -f conftest*
3855
3856 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3857 if test $ac_cv_struct_tm = sys/time.h; then
3858   { test "$extra_verbose" = "yes" && cat << \EOF
3859     Defining TM_IN_SYS_TIME
3860 EOF
3861 cat >> confdefs.h <<\EOF
3862 #define TM_IN_SYS_TIME 1
3863 EOF
3864 }
3865
3866 fi
3867
3868 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3869 echo "configure:3870: checking for tm_zone in struct tm" >&5
3870
3871 cat > conftest.$ac_ext <<EOF
3872 #line 3873 "configure"
3873 #include "confdefs.h"
3874 #include <sys/types.h>
3875 #include <$ac_cv_struct_tm>
3876 int main() {
3877 struct tm tm; tm.tm_zone;
3878 ; return 0; }
3879 EOF
3880 if { (eval echo configure:3881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3881   rm -rf conftest*
3882   ac_cv_struct_tm_zone=yes
3883 else
3884   echo "configure: failed program was:" >&5
3885   cat conftest.$ac_ext >&5
3886   rm -rf conftest*
3887   ac_cv_struct_tm_zone=no
3888 fi
3889 rm -f conftest*
3890
3891 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3892 if test "$ac_cv_struct_tm_zone" = yes; then
3893   { test "$extra_verbose" = "yes" && cat << \EOF
3894     Defining HAVE_TM_ZONE
3895 EOF
3896 cat >> confdefs.h <<\EOF
3897 #define HAVE_TM_ZONE 1
3898 EOF
3899 }
3900
3901 else
3902   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3903 echo "configure:3904: checking for tzname" >&5
3904
3905 cat > conftest.$ac_ext <<EOF
3906 #line 3907 "configure"
3907 #include "confdefs.h"
3908 #include <time.h>
3909 #ifndef tzname /* For SGI.  */
3910 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3911 #endif
3912 int main() {
3913 atoi(*tzname);
3914 ; return 0; }
3915 EOF
3916 if { (eval echo configure:3917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3917   rm -rf conftest*
3918   ac_cv_var_tzname=yes
3919 else
3920   echo "configure: failed program was:" >&5
3921   cat conftest.$ac_ext >&5
3922   rm -rf conftest*
3923   ac_cv_var_tzname=no
3924 fi
3925 rm -f conftest*
3926
3927 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3928   if test $ac_cv_var_tzname = yes; then
3929     { test "$extra_verbose" = "yes" && cat << \EOF
3930     Defining HAVE_TZNAME
3931 EOF
3932 cat >> confdefs.h <<\EOF
3933 #define HAVE_TZNAME 1
3934 EOF
3935 }
3936
3937   fi
3938 fi
3939
3940
3941 echo $ac_n "checking for working const""... $ac_c" 1>&6
3942 echo "configure:3943: checking for working const" >&5
3943
3944 cat > conftest.$ac_ext <<EOF
3945 #line 3946 "configure"
3946 #include "confdefs.h"
3947
3948 int main() {
3949
3950 /* Ultrix mips cc rejects this.  */
3951 typedef int charset[2]; const charset x;
3952 /* SunOS 4.1.1 cc rejects this.  */
3953 char const *const *ccp;
3954 char **p;
3955 /* NEC SVR4.0.2 mips cc rejects this.  */
3956 struct point {int x, y;};
3957 static struct point const zero = {0,0};
3958 /* AIX XL C 1.02.0.0 rejects this.
3959    It does not let you subtract one const X* pointer from another in an arm
3960    of an if-expression whose if-part is not a constant expression */
3961 const char *g = "string";
3962 ccp = &g + (g ? g-g : 0);
3963 /* HPUX 7.0 cc rejects these. */
3964 ++ccp;
3965 p = (char**) ccp;
3966 ccp = (char const *const *) p;
3967 { /* SCO 3.2v4 cc rejects this.  */
3968   char *t;
3969   char const *s = 0 ? (char *) 0 : (char const *) 0;
3970
3971   *t++ = 0;
3972 }
3973 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3974   int x[] = {25, 17};
3975   const int *foo = &x[0];
3976   ++foo;
3977 }
3978 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3979   typedef const int *iptr;
3980   iptr p = 0;
3981   ++p;
3982 }
3983 { /* AIX XL C 1.02.0.0 rejects this saying
3984      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3985   struct s { int j; const int *ap[3]; };
3986   struct s *b; b->j = 5;
3987 }
3988 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3989   const int foo = 10;
3990 }
3991
3992 ; return 0; }
3993 EOF
3994 if { (eval echo configure:3995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3995   rm -rf conftest*
3996   ac_cv_c_const=yes
3997 else
3998   echo "configure: failed program was:" >&5
3999   cat conftest.$ac_ext >&5
4000   rm -rf conftest*
4001   ac_cv_c_const=no
4002 fi
4003 rm -f conftest*
4004
4005 echo "$ac_t""$ac_cv_c_const" 1>&6
4006 if test $ac_cv_c_const = no; then
4007   { test "$extra_verbose" = "yes" && cat << \EOF
4008     Defining const = 
4009 EOF
4010 cat >> confdefs.h <<\EOF
4011 #define const 
4012 EOF
4013 }
4014
4015 fi
4016
4017
4018 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
4019 echo "configure:4020: checking whether ${MAKE-make} sets \${MAKE}" >&5
4020 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
4021
4022 cat > conftestmake <<\EOF
4023 all:
4024         @echo 'ac_maketemp="${MAKE}"'
4025 EOF
4026 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4027 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4028 if test -n "$ac_maketemp"; then
4029   eval ac_cv_prog_make_${ac_make}_set=yes
4030 else
4031   eval ac_cv_prog_make_${ac_make}_set=no
4032 fi
4033 rm -f conftestmake
4034 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4035   echo "$ac_t""yes" 1>&6
4036   SET_MAKE=
4037 else
4038   echo "$ac_t""no" 1>&6
4039   SET_MAKE="MAKE=${MAKE-make}"
4040 fi
4041
4042
4043 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4044 echo "configure:4045: checking whether byte ordering is bigendian" >&5
4045
4046 ac_cv_c_bigendian=unknown
4047 # See if sys/param.h defines the BYTE_ORDER macro.
4048 cat > conftest.$ac_ext <<EOF
4049 #line 4050 "configure"
4050 #include "confdefs.h"
4051 #include <sys/types.h>
4052 #include <sys/param.h>
4053 int main() {
4054
4055 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4056  bogus endian macros
4057 #endif
4058 ; return 0; }
4059 EOF
4060 if { (eval echo configure:4061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4061   rm -rf conftest*
4062   # It does; now see whether it defined to BIG_ENDIAN or not.
4063 cat > conftest.$ac_ext <<EOF
4064 #line 4065 "configure"
4065 #include "confdefs.h"
4066 #include <sys/types.h>
4067 #include <sys/param.h>
4068 int main() {
4069
4070 #if BYTE_ORDER != BIG_ENDIAN
4071  not big endian
4072 #endif
4073 ; return 0; }
4074 EOF
4075 if { (eval echo configure:4076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4076   rm -rf conftest*
4077   ac_cv_c_bigendian=yes
4078 else
4079   echo "configure: failed program was:" >&5
4080   cat conftest.$ac_ext >&5
4081   rm -rf conftest*
4082   ac_cv_c_bigendian=no
4083 fi
4084 rm -f conftest*
4085 else
4086   echo "configure: failed program was:" >&5
4087   cat conftest.$ac_ext >&5
4088 fi
4089 rm -f conftest*
4090 if test $ac_cv_c_bigendian = unknown; then
4091 cat > conftest.$ac_ext <<EOF
4092 #line 4093 "configure"
4093 #include "confdefs.h"
4094 main () {
4095   /* Are we little or big endian?  From Harbison&Steele.  */
4096   union
4097   {
4098     long l;
4099     char c[sizeof (long)];
4100   } u;
4101   u.l = 1;
4102   exit (u.c[sizeof (long) - 1] == 1);
4103 }
4104 EOF
4105 if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4106 then
4107   ac_cv_c_bigendian=no
4108 else
4109   conftest_rc="$?"
4110   echo "configure: failed program was:" >&5
4111   cat conftest.$ac_ext >&5
4112   rm -fr conftest*
4113   ac_cv_c_bigendian=yes
4114 fi
4115 rm -fr conftest*
4116 fi
4117
4118 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4119 if test $ac_cv_c_bigendian = yes; then
4120   { test "$extra_verbose" = "yes" && cat << \EOF
4121     Defining WORDS_BIGENDIAN
4122 EOF
4123 cat >> confdefs.h <<\EOF
4124 #define WORDS_BIGENDIAN 1
4125 EOF
4126 }
4127
4128 fi
4129
4130
4131 echo $ac_n "checking size of short""... $ac_c" 1>&6
4132 echo "configure:4133: checking size of short" >&5
4133
4134 cat > conftest.$ac_ext <<EOF
4135 #line 4136 "configure"
4136 #include "confdefs.h"
4137 #include <stdio.h>
4138 main()
4139 {
4140   FILE *f=fopen("conftestval", "w");
4141   if (!f) exit(1);
4142   fprintf(f, "%d\n", sizeof(short));
4143   exit(0);
4144 }
4145 EOF
4146 if { (eval echo configure:4147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4147 then
4148   ac_cv_sizeof_short=`cat conftestval`
4149 else
4150   conftest_rc="$?"
4151   echo "configure: failed program was:" >&5
4152   cat conftest.$ac_ext >&5
4153   rm -fr conftest*
4154   ac_cv_sizeof_short=0
4155 fi
4156 rm -fr conftest*
4157 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4158 { test "$extra_verbose" = "yes" && cat << EOF
4159     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4160 EOF
4161 cat >> confdefs.h <<EOF
4162 #define SIZEOF_SHORT $ac_cv_sizeof_short
4163 EOF
4164 }
4165
4166
4167 if test "$ac_cv_sizeof_short" = 0; then
4168   echo ""
4169   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4170   echo "*** PANIC *** Please examine config.log for compilation errors."
4171   exit 1
4172 fi
4173 echo $ac_n "checking size of int""... $ac_c" 1>&6
4174 echo "configure:4175: checking size of int" >&5
4175
4176 cat > conftest.$ac_ext <<EOF
4177 #line 4178 "configure"
4178 #include "confdefs.h"
4179 #include <stdio.h>
4180 main()
4181 {
4182   FILE *f=fopen("conftestval", "w");
4183   if (!f) exit(1);
4184   fprintf(f, "%d\n", sizeof(int));
4185   exit(0);
4186 }
4187 EOF
4188 if { (eval echo configure:4189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4189 then
4190   ac_cv_sizeof_int=`cat conftestval`
4191 else
4192   conftest_rc="$?"
4193   echo "configure: failed program was:" >&5
4194   cat conftest.$ac_ext >&5
4195   rm -fr conftest*
4196   ac_cv_sizeof_int=0
4197 fi
4198 rm -fr conftest*
4199 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4200 { test "$extra_verbose" = "yes" && cat << EOF
4201     Defining SIZEOF_INT = $ac_cv_sizeof_int
4202 EOF
4203 cat >> confdefs.h <<EOF
4204 #define SIZEOF_INT $ac_cv_sizeof_int
4205 EOF
4206 }
4207
4208
4209 echo $ac_n "checking size of long""... $ac_c" 1>&6
4210 echo "configure:4211: checking size of long" >&5
4211
4212 cat > conftest.$ac_ext <<EOF
4213 #line 4214 "configure"
4214 #include "confdefs.h"
4215 #include <stdio.h>
4216 main()
4217 {
4218   FILE *f=fopen("conftestval", "w");
4219   if (!f) exit(1);
4220   fprintf(f, "%d\n", sizeof(long));
4221   exit(0);
4222 }
4223 EOF
4224 if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4225 then
4226   ac_cv_sizeof_long=`cat conftestval`
4227 else
4228   conftest_rc="$?"
4229   echo "configure: failed program was:" >&5
4230   cat conftest.$ac_ext >&5
4231   rm -fr conftest*
4232   ac_cv_sizeof_long=0
4233 fi
4234 rm -fr conftest*
4235 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4236 { test "$extra_verbose" = "yes" && cat << EOF
4237     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4238 EOF
4239 cat >> confdefs.h <<EOF
4240 #define SIZEOF_LONG $ac_cv_sizeof_long
4241 EOF
4242 }
4243
4244
4245 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4246 echo "configure:4247: checking size of long long" >&5
4247
4248 cat > conftest.$ac_ext <<EOF
4249 #line 4250 "configure"
4250 #include "confdefs.h"
4251 #include <stdio.h>
4252 main()
4253 {
4254   FILE *f=fopen("conftestval", "w");
4255   if (!f) exit(1);
4256   fprintf(f, "%d\n", sizeof(long long));
4257   exit(0);
4258 }
4259 EOF
4260 if { (eval echo configure:4261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4261 then
4262   ac_cv_sizeof_long_long=`cat conftestval`
4263 else
4264   conftest_rc="$?"
4265   echo "configure: failed program was:" >&5
4266   cat conftest.$ac_ext >&5
4267   rm -fr conftest*
4268   ac_cv_sizeof_long_long=0
4269 fi
4270 rm -fr conftest*
4271 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4272 { test "$extra_verbose" = "yes" && cat << EOF
4273     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4274 EOF
4275 cat >> confdefs.h <<EOF
4276 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4277 EOF
4278 }
4279
4280
4281 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4282 echo "configure:4283: checking size of void *" >&5
4283
4284 cat > conftest.$ac_ext <<EOF
4285 #line 4286 "configure"
4286 #include "confdefs.h"
4287 #include <stdio.h>
4288 main()
4289 {
4290   FILE *f=fopen("conftestval", "w");
4291   if (!f) exit(1);
4292   fprintf(f, "%d\n", sizeof(void *));
4293   exit(0);
4294 }
4295 EOF
4296 if { (eval echo configure:4297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4297 then
4298   ac_cv_sizeof_void_p=`cat conftestval`
4299 else
4300   conftest_rc="$?"
4301   echo "configure: failed program was:" >&5
4302   cat conftest.$ac_ext >&5
4303   rm -fr conftest*
4304   ac_cv_sizeof_void_p=0
4305 fi
4306 rm -fr conftest*
4307 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4308 { test "$extra_verbose" = "yes" && cat << EOF
4309     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4310 EOF
4311 cat >> confdefs.h <<EOF
4312 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4313 EOF
4314 }
4315
4316
4317
4318 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4319 echo "configure:4320: checking for long file names" >&5
4320
4321 ac_cv_sys_long_file_names=yes
4322 # Test for long file names in all the places we know might matter:
4323 #      .                the current directory, where building will happen
4324 #      $prefix/lib      where we will be installing things
4325 #      $exec_prefix/lib likewise
4326 # eval it to expand exec_prefix.
4327 #      $TMPDIR          if set, where it might want to write temporary files
4328 # if $TMPDIR is not set:
4329 #      /tmp             where it might want to write temporary files
4330 #      /var/tmp         likewise
4331 #      /usr/tmp         likewise
4332 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4333   ac_tmpdirs="$TMPDIR"
4334 else
4335   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4336 fi
4337 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4338   test -d $ac_dir || continue
4339   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4340   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4341   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4342   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4343   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4344     ac_cv_sys_long_file_names=no
4345     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4346     break
4347   fi
4348   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4349 done
4350
4351 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4352 if test $ac_cv_sys_long_file_names = yes; then
4353   { test "$extra_verbose" = "yes" && cat << \EOF
4354     Defining HAVE_LONG_FILE_NAMES
4355 EOF
4356 cat >> confdefs.h <<\EOF
4357 #define HAVE_LONG_FILE_NAMES 1
4358 EOF
4359 }
4360
4361 fi
4362
4363
4364 echo $ac_n "checking for sin""... $ac_c" 1>&6
4365 echo "configure:4366: checking for sin" >&5
4366
4367 cat > conftest.$ac_ext <<EOF
4368 #line 4369 "configure"
4369 #include "confdefs.h"
4370 /* System header to define __stub macros and hopefully few prototypes,
4371     which can conflict with char sin(); below.  */
4372 #include <assert.h>
4373 /* Override any gcc2 internal prototype to avoid an error.  */
4374 /* We use char because int might match the return type of a gcc2
4375     builtin and then its argument prototype would still apply.  */
4376 char sin();
4377
4378 int main() {
4379
4380 /* The GNU C library defines this for functions which it implements
4381     to always fail with ENOSYS.  Some functions are actually named
4382     something starting with __ and the normal name is an alias.  */
4383 #if defined (__stub_sin) || defined (__stub___sin)
4384 choke me
4385 #else
4386 sin();
4387 #endif
4388
4389 ; return 0; }
4390 EOF
4391 if { (eval echo configure:4392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4392   rm -rf conftest*
4393   eval "ac_cv_func_sin=yes"
4394 else
4395   echo "configure: failed program was:" >&5
4396   cat conftest.$ac_ext >&5
4397   rm -rf conftest*
4398   eval "ac_cv_func_sin=no"
4399 fi
4400 rm -f conftest*
4401
4402 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4403   echo "$ac_t""yes" 1>&6
4404   :
4405 else
4406   echo "$ac_t""no" 1>&6
4407
4408 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4409 echo "configure:4410: checking for sin in -lm" >&5
4410 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4411
4412 xe_check_libs=" -lm "
4413 cat > conftest.$ac_ext <<EOF
4414 #line 4415 "configure"
4415 #include "confdefs.h"
4416 /* Override any gcc2 internal prototype to avoid an error.  */
4417 /* We use char because int might match the return type of a gcc2
4418     builtin and then its argument prototype would still apply.  */
4419 char sin();
4420
4421 int main() {
4422 sin()
4423 ; return 0; }
4424 EOF
4425 if { (eval echo configure:4426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4426   rm -rf conftest*
4427   eval "ac_cv_lib_$ac_lib_var=yes"
4428 else
4429   echo "configure: failed program was:" >&5
4430   cat conftest.$ac_ext >&5
4431   rm -rf conftest*
4432   eval "ac_cv_lib_$ac_lib_var=no"
4433 fi
4434 rm -f conftest*
4435 xe_check_libs=""
4436
4437 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4438   echo "$ac_t""yes" 1>&6
4439     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4440     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4441   { test "$extra_verbose" = "yes" && cat << EOF
4442     Defining $ac_tr_lib
4443 EOF
4444 cat >> confdefs.h <<EOF
4445 #define $ac_tr_lib 1
4446 EOF
4447 }
4448
4449   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4450
4451 else
4452   echo "$ac_t""no" 1>&6
4453 fi
4454
4455
4456 fi
4457
4458
4459 { test "$extra_verbose" = "yes" && cat << \EOF
4460     Defining LISP_FLOAT_TYPE
4461 EOF
4462 cat >> confdefs.h <<\EOF
4463 #define LISP_FLOAT_TYPE 1
4464 EOF
4465 }
4466
4467
4468 cat > conftest.$ac_ext <<EOF
4469 #line 4470 "configure"
4470 #include "confdefs.h"
4471 #include <math.h>
4472 int main() {
4473 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4474 ; return 0; }
4475 EOF
4476 if { (eval echo configure:4477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4477   rm -rf conftest*
4478   { test "$extra_verbose" = "yes" && cat << \EOF
4479     Defining HAVE_INVERSE_HYPERBOLIC
4480 EOF
4481 cat >> confdefs.h <<\EOF
4482 #define HAVE_INVERSE_HYPERBOLIC 1
4483 EOF
4484 }
4485
4486 else
4487   echo "configure: failed program was:" >&5
4488   cat conftest.$ac_ext >&5
4489 fi
4490 rm -f conftest*
4491
4492 echo "checking type of mail spool file locking" 1>&6
4493 echo "configure:4494: checking type of mail spool file locking" >&5
4494 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4495 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4496 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4497     Defining REAL_MAIL_USE_LOCKF
4498 EOF
4499 cat >> confdefs.h <<\EOF
4500 #define REAL_MAIL_USE_LOCKF 1
4501 EOF
4502 }
4503
4504 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4505     Defining REAL_MAIL_USE_FLOCK
4506 EOF
4507 cat >> confdefs.h <<\EOF
4508 #define REAL_MAIL_USE_FLOCK 1
4509 EOF
4510 }
4511
4512 else mail_locking="dot-locking"
4513 fi
4514
4515 case "$opsys" in decosf*)
4516   
4517 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4518 echo "configure:4519: checking for cma_open in -lpthreads" >&5
4519 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4520
4521 xe_check_libs=" -lpthreads "
4522 cat > conftest.$ac_ext <<EOF
4523 #line 4524 "configure"
4524 #include "confdefs.h"
4525 /* Override any gcc2 internal prototype to avoid an error.  */
4526 /* We use char because int might match the return type of a gcc2
4527     builtin and then its argument prototype would still apply.  */
4528 char cma_open();
4529
4530 int main() {
4531 cma_open()
4532 ; return 0; }
4533 EOF
4534 if { (eval echo configure:4535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4535   rm -rf conftest*
4536   eval "ac_cv_lib_$ac_lib_var=yes"
4537 else
4538   echo "configure: failed program was:" >&5
4539   cat conftest.$ac_ext >&5
4540   rm -rf conftest*
4541   eval "ac_cv_lib_$ac_lib_var=no"
4542 fi
4543 rm -f conftest*
4544 xe_check_libs=""
4545
4546 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4547   echo "$ac_t""yes" 1>&6
4548     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4549     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4550   { test "$extra_verbose" = "yes" && cat << EOF
4551     Defining $ac_tr_lib
4552 EOF
4553 cat >> confdefs.h <<EOF
4554 #define $ac_tr_lib 1
4555 EOF
4556 }
4557
4558   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4559
4560 else
4561   echo "$ac_t""no" 1>&6
4562 fi
4563
4564
4565   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4566     c_switch_site="$c_switch_site -threads" ;;
4567 esac
4568
4569 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4570 echo "configure:4571: checking whether the -xildoff compiler flag is required" >&5
4571 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4572   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4573     then echo "$ac_t""no" 1>&6;
4574     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
4575   fi
4576   else echo "$ac_t""no" 1>&6
4577 fi
4578
4579 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4580   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4581 echo "configure:4582: checking for \"-z ignore\" linker flag" >&5
4582   case "`ld -h 2>&1`" in
4583     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4584       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4585     *) echo "$ac_t""no" 1>&6 ;;
4586   esac
4587 fi
4588
4589
4590 echo "checking "for specified window system"" 1>&6
4591 echo "configure:4592: checking "for specified window system"" >&5
4592
4593 if test "$with_x11" != "no"; then
4594     test "$x_includes $x_libraries" != "NONE NONE" && \
4595    window_system=x11 with_x11=yes
4596
4597         
4598       if test "$x_includes $x_libraries" = "NONE NONE" \
4599     -a -n "$OPENWINHOME" \
4600     -a "$OPENWINHOME" != "/usr/openwin" \
4601     -a -d "$OPENWINHOME"; then
4602       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4603       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4604       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4605   fi
4606
4607   if test "$x_includes" = "NONE"; then
4608                     for dir in "/usr/X11" "/usr/X11R6"; do
4609       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4610     done
4611   fi
4612
4613   if test "$x_libraries" = "NONE"; then
4614     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4615       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4616     done
4617   fi
4618
4619   # If we find X, set shell vars x_includes and x_libraries to the
4620 # paths, otherwise set no_x=yes.
4621 # Uses ac_ vars as temps to allow command line to override cache and checks.
4622 # --without-x overrides everything else, but does not touch the cache.
4623 echo $ac_n "checking for X""... $ac_c" 1>&6
4624 echo "configure:4625: checking for X" >&5
4625
4626 # Check whether --with-x or --without-x was given.
4627 if test "${with_x+set}" = set; then
4628   withval="$with_x"
4629   :
4630 fi
4631
4632 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4633 if test "x$with_x" = xno; then
4634   # The user explicitly disabled X.
4635   have_x=disabled
4636 else
4637   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4638     # Both variables are already set.
4639     have_x=yes
4640   else
4641
4642 # One or both of the vars are not set, and there is no cached value.
4643 ac_x_includes=NO ac_x_libraries=NO
4644 rm -fr conftestdir
4645 if mkdir conftestdir; then
4646   cd conftestdir
4647   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4648   cat > Imakefile <<'EOF'
4649 acfindx:
4650         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4651 EOF
4652   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4653     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4654     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4655     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4656     for ac_extension in a so sl; do
4657       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4658         test -f $ac_im_libdir/libX11.$ac_extension; then
4659         ac_im_usrlibdir=$ac_im_libdir; break
4660       fi
4661     done
4662     # Screen out bogus values from the imake configuration.  They are
4663     # bogus both because they are the default anyway, and because
4664     # using them would break gcc on systems where it needs fixed includes.
4665     case "$ac_im_incroot" in
4666         /usr/include) ;;
4667         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4668     esac
4669     case "$ac_im_usrlibdir" in
4670         /usr/lib | /lib) ;;
4671         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4672     esac
4673   fi
4674   cd ..
4675   rm -fr conftestdir
4676 fi
4677
4678 if test "$ac_x_includes" = NO; then
4679   # Guess where to find include files, by looking for this one X11 .h file.
4680   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4681
4682   # First, try using that file with no special directory specified.
4683 cat > conftest.$ac_ext <<EOF
4684 #line 4685 "configure"
4685 #include "confdefs.h"
4686 #include <$x_direct_test_include>
4687 EOF
4688 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4689 { (eval echo configure:4690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4690 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4691 if test -z "$ac_err"; then
4692   rm -rf conftest*
4693   # We can compile using X headers with no special include directory.
4694 ac_x_includes=
4695 else
4696   echo "$ac_err" >&5
4697   echo "configure: failed program was:" >&5
4698   cat conftest.$ac_ext >&5
4699   rm -rf conftest*
4700   # Look for the header file in a standard set of common directories.
4701 # Check X11 before X11Rn because it is often a symlink to the current release.
4702   for ac_dir in               \
4703     /usr/X11/include          \
4704     /usr/X11R6/include        \
4705     /usr/X11R5/include        \
4706     /usr/X11R4/include        \
4707                               \
4708     /usr/include/X11          \
4709     /usr/include/X11R6        \
4710     /usr/include/X11R5        \
4711     /usr/include/X11R4        \
4712                               \
4713     /usr/local/X11/include    \
4714     /usr/local/X11R6/include  \
4715     /usr/local/X11R5/include  \
4716     /usr/local/X11R4/include  \
4717                               \
4718     /usr/local/include/X11    \
4719     /usr/local/include/X11R6  \
4720     /usr/local/include/X11R5  \
4721     /usr/local/include/X11R4  \
4722                               \
4723     /usr/X386/include         \
4724     /usr/x386/include         \
4725     /usr/XFree86/include/X11  \
4726                               \
4727     /usr/include              \
4728     /usr/local/include        \
4729     /usr/unsupported/include  \
4730     /usr/athena/include       \
4731     /usr/local/x11r5/include  \
4732     /usr/lpp/Xamples/include  \
4733                               \
4734     /usr/openwin/include      \
4735     /usr/openwin/share/include \
4736     ; \
4737   do
4738     if test -r "$ac_dir/$x_direct_test_include"; then
4739       ac_x_includes=$ac_dir
4740       break
4741     fi
4742   done
4743 fi
4744 rm -f conftest*
4745 fi # $ac_x_includes = NO
4746
4747 if test "$ac_x_libraries" = NO; then
4748   # Check for the libraries.
4749
4750   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4751   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4752
4753   # See if we find them without any special options.
4754   # Don't add to $LIBS permanently.
4755   ac_save_LIBS="$LIBS"
4756   LIBS="-l$x_direct_test_library $LIBS"
4757 cat > conftest.$ac_ext <<EOF
4758 #line 4759 "configure"
4759 #include "confdefs.h"
4760
4761 int main() {
4762 ${x_direct_test_function}()
4763 ; return 0; }
4764 EOF
4765 if { (eval echo configure:4766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4766   rm -rf conftest*
4767   LIBS="$ac_save_LIBS"
4768 # We can link X programs with no special library path.
4769 ac_x_libraries=
4770 else
4771   echo "configure: failed program was:" >&5
4772   cat conftest.$ac_ext >&5
4773   rm -rf conftest*
4774   LIBS="$ac_save_LIBS"
4775 # First see if replacing the include by lib works.
4776 # Check X11 before X11Rn because it is often a symlink to the current release.
4777 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4778     /usr/X11/lib          \
4779     /usr/X11R6/lib        \
4780     /usr/X11R5/lib        \
4781     /usr/X11R4/lib        \
4782                           \
4783     /usr/lib/X11          \
4784     /usr/lib/X11R6        \
4785     /usr/lib/X11R5        \
4786     /usr/lib/X11R4        \
4787                           \
4788     /usr/local/X11/lib    \
4789     /usr/local/X11R6/lib  \
4790     /usr/local/X11R5/lib  \
4791     /usr/local/X11R4/lib  \
4792                           \
4793     /usr/local/lib/X11    \
4794     /usr/local/lib/X11R6  \
4795     /usr/local/lib/X11R5  \
4796     /usr/local/lib/X11R4  \
4797                           \
4798     /usr/X386/lib         \
4799     /usr/x386/lib         \
4800     /usr/XFree86/lib/X11  \
4801                           \
4802     /usr/lib              \
4803     /usr/local/lib        \
4804     /usr/unsupported/lib  \
4805     /usr/athena/lib       \
4806     /usr/local/x11r5/lib  \
4807     /usr/lpp/Xamples/lib  \
4808     /lib/usr/lib/X11      \
4809                           \
4810     /usr/openwin/lib      \
4811     /usr/openwin/share/lib \
4812     ; \
4813 do
4814   for ac_extension in a so sl; do
4815     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4816       ac_x_libraries=$ac_dir
4817       break 2
4818     fi
4819   done
4820 done
4821 fi
4822 rm -f conftest*
4823 fi # $ac_x_libraries = NO
4824
4825 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4826   # Didn't find X anywhere.  Cache the known absence of X.
4827   ac_cv_have_x="have_x=no"
4828 else
4829   # Record where we found X for the cache.
4830   ac_cv_have_x="have_x=yes \
4831                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4832 fi
4833   fi
4834   eval "$ac_cv_have_x"
4835 fi # $with_x != no
4836
4837 if test "$have_x" != yes; then
4838   echo "$ac_t""$have_x" 1>&6
4839   no_x=yes
4840 else
4841   # If each of the values was on the command line, it overrides each guess.
4842   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4843   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4844   # Update the cache value to reflect the command line values.
4845   ac_cv_have_x="have_x=yes \
4846                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4847   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4848 fi
4849
4850 if test "$no_x" = yes; then
4851   # Not all programs may use this symbol, but it does not hurt to define it.
4852   { test "$extra_verbose" = "yes" && cat << \EOF
4853     Defining X_DISPLAY_MISSING
4854 EOF
4855 cat >> confdefs.h <<\EOF
4856 #define X_DISPLAY_MISSING 1
4857 EOF
4858 }
4859
4860   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4861 else
4862   if test -n "$x_includes"; then
4863     X_CFLAGS="$X_CFLAGS -I$x_includes"
4864   fi
4865
4866   # It would also be nice to do this for all -L options, not just this one.
4867   if test -n "$x_libraries"; then
4868     X_LIBS="$X_LIBS -L$x_libraries"
4869     # For Solaris; some versions of Sun CC require a space after -R and
4870     # others require no space.  Words are not sufficient . . . .
4871     case "`(uname -sr) 2>/dev/null`" in
4872     "SunOS 5"*)
4873       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4874 echo "configure:4875: checking whether -R must be followed by a space" >&5
4875       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4876       cat > conftest.$ac_ext <<EOF
4877 #line 4878 "configure"
4878 #include "confdefs.h"
4879
4880 int main() {
4881
4882 ; return 0; }
4883 EOF
4884 if { (eval echo configure:4885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4885   rm -rf conftest*
4886   ac_R_nospace=yes
4887 else
4888   echo "configure: failed program was:" >&5
4889   cat conftest.$ac_ext >&5
4890   rm -rf conftest*
4891   ac_R_nospace=no
4892 fi
4893 rm -f conftest*
4894       if test $ac_R_nospace = yes; then
4895         echo "$ac_t""no" 1>&6
4896         X_LIBS="$X_LIBS -R$x_libraries"
4897       else
4898         LIBS="$ac_xsave_LIBS -R $x_libraries"
4899         cat > conftest.$ac_ext <<EOF
4900 #line 4901 "configure"
4901 #include "confdefs.h"
4902
4903 int main() {
4904
4905 ; return 0; }
4906 EOF
4907 if { (eval echo configure:4908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4908   rm -rf conftest*
4909   ac_R_space=yes
4910 else
4911   echo "configure: failed program was:" >&5
4912   cat conftest.$ac_ext >&5
4913   rm -rf conftest*
4914   ac_R_space=no
4915 fi
4916 rm -f conftest*
4917         if test $ac_R_space = yes; then
4918           echo "$ac_t""yes" 1>&6
4919           X_LIBS="$X_LIBS -R $x_libraries"
4920         else
4921           echo "$ac_t""neither works" 1>&6
4922         fi
4923       fi
4924       LIBS="$ac_xsave_LIBS"
4925     esac
4926   fi
4927
4928   # Check for system-dependent libraries X programs must link with.
4929   # Do this before checking for the system-independent R6 libraries
4930   # (-lICE), since we may need -lsocket or whatever for X linking.
4931
4932   if test "$ISC" = yes; then
4933     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4934   else
4935     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4936     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4937     # the Alpha needs dnet_stub (dnet does not exist).
4938     if test "$with_dnet" = "no" ; then
4939 ac_cv_lib_dnet_dnet_ntoa=no
4940 else
4941
4942 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4943 echo "configure:4944: checking for dnet_ntoa in -ldnet" >&5
4944 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4945
4946 xe_check_libs=" -ldnet "
4947 cat > conftest.$ac_ext <<EOF
4948 #line 4949 "configure"
4949 #include "confdefs.h"
4950 /* Override any gcc2 internal prototype to avoid an error.  */
4951 /* We use char because int might match the return type of a gcc2
4952     builtin and then its argument prototype would still apply.  */
4953 char dnet_ntoa();
4954
4955 int main() {
4956 dnet_ntoa()
4957 ; return 0; }
4958 EOF
4959 if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4960   rm -rf conftest*
4961   eval "ac_cv_lib_$ac_lib_var=yes"
4962 else
4963   echo "configure: failed program was:" >&5
4964   cat conftest.$ac_ext >&5
4965   rm -rf conftest*
4966   eval "ac_cv_lib_$ac_lib_var=no"
4967 fi
4968 rm -f conftest*
4969 xe_check_libs=""
4970
4971 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4972   echo "$ac_t""yes" 1>&6
4973   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4974 else
4975   echo "$ac_t""no" 1>&6
4976 fi
4977
4978 fi
4979
4980     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4981       
4982 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4983 echo "configure:4984: checking for dnet_ntoa in -ldnet_stub" >&5
4984 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4985
4986 xe_check_libs=" -ldnet_stub "
4987 cat > conftest.$ac_ext <<EOF
4988 #line 4989 "configure"
4989 #include "confdefs.h"
4990 /* Override any gcc2 internal prototype to avoid an error.  */
4991 /* We use char because int might match the return type of a gcc2
4992     builtin and then its argument prototype would still apply.  */
4993 char dnet_ntoa();
4994
4995 int main() {
4996 dnet_ntoa()
4997 ; return 0; }
4998 EOF
4999 if { (eval echo configure:5000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5000   rm -rf conftest*
5001   eval "ac_cv_lib_$ac_lib_var=yes"
5002 else
5003   echo "configure: failed program was:" >&5
5004   cat conftest.$ac_ext >&5
5005   rm -rf conftest*
5006   eval "ac_cv_lib_$ac_lib_var=no"
5007 fi
5008 rm -f conftest*
5009 xe_check_libs=""
5010
5011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5012   echo "$ac_t""yes" 1>&6
5013   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
5014 else
5015   echo "$ac_t""no" 1>&6
5016 fi
5017
5018
5019     fi
5020
5021     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
5022     # to get the SysV transport functions.
5023     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5024     # needs -lnsl.
5025     # The nsl library prevents programs from opening the X display
5026     # on Irix 5.2, according to dickey@clark.net.
5027     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5028 echo "configure:5029: checking for gethostbyname" >&5
5029
5030 cat > conftest.$ac_ext <<EOF
5031 #line 5032 "configure"
5032 #include "confdefs.h"
5033 /* System header to define __stub macros and hopefully few prototypes,
5034     which can conflict with char gethostbyname(); below.  */
5035 #include <assert.h>
5036 /* Override any gcc2 internal prototype to avoid an error.  */
5037 /* We use char because int might match the return type of a gcc2
5038     builtin and then its argument prototype would still apply.  */
5039 char gethostbyname();
5040
5041 int main() {
5042
5043 /* The GNU C library defines this for functions which it implements
5044     to always fail with ENOSYS.  Some functions are actually named
5045     something starting with __ and the normal name is an alias.  */
5046 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5047 choke me
5048 #else
5049 gethostbyname();
5050 #endif
5051
5052 ; return 0; }
5053 EOF
5054 if { (eval echo configure:5055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5055   rm -rf conftest*
5056   eval "ac_cv_func_gethostbyname=yes"
5057 else
5058   echo "configure: failed program was:" >&5
5059   cat conftest.$ac_ext >&5
5060   rm -rf conftest*
5061   eval "ac_cv_func_gethostbyname=no"
5062 fi
5063 rm -f conftest*
5064
5065 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5066   echo "$ac_t""yes" 1>&6
5067   :
5068 else
5069   echo "$ac_t""no" 1>&6
5070 fi
5071
5072     if test $ac_cv_func_gethostbyname = no; then
5073       
5074 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5075 echo "configure:5076: checking for gethostbyname in -lnsl" >&5
5076 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5077
5078 xe_check_libs=" -lnsl "
5079 cat > conftest.$ac_ext <<EOF
5080 #line 5081 "configure"
5081 #include "confdefs.h"
5082 /* Override any gcc2 internal prototype to avoid an error.  */
5083 /* We use char because int might match the return type of a gcc2
5084     builtin and then its argument prototype would still apply.  */
5085 char gethostbyname();
5086
5087 int main() {
5088 gethostbyname()
5089 ; return 0; }
5090 EOF
5091 if { (eval echo configure:5092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5092   rm -rf conftest*
5093   eval "ac_cv_lib_$ac_lib_var=yes"
5094 else
5095   echo "configure: failed program was:" >&5
5096   cat conftest.$ac_ext >&5
5097   rm -rf conftest*
5098   eval "ac_cv_lib_$ac_lib_var=no"
5099 fi
5100 rm -f conftest*
5101 xe_check_libs=""
5102
5103 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5104   echo "$ac_t""yes" 1>&6
5105   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5106 else
5107   echo "$ac_t""no" 1>&6
5108 fi
5109
5110
5111     fi
5112
5113     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5114     # socket/setsockopt and other routines are undefined under SCO ODT
5115     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5116     # on later versions), says simon@lia.di.epfl.ch: it contains
5117     # gethostby* variants that don't use the nameserver (or something).
5118     # -lsocket must be given before -lnsl if both are needed.
5119     # We assume that if connect needs -lnsl, so does gethostbyname.
5120     echo $ac_n "checking for connect""... $ac_c" 1>&6
5121 echo "configure:5122: checking for connect" >&5
5122
5123 cat > conftest.$ac_ext <<EOF
5124 #line 5125 "configure"
5125 #include "confdefs.h"
5126 /* System header to define __stub macros and hopefully few prototypes,
5127     which can conflict with char connect(); below.  */
5128 #include <assert.h>
5129 /* Override any gcc2 internal prototype to avoid an error.  */
5130 /* We use char because int might match the return type of a gcc2
5131     builtin and then its argument prototype would still apply.  */
5132 char connect();
5133
5134 int main() {
5135
5136 /* The GNU C library defines this for functions which it implements
5137     to always fail with ENOSYS.  Some functions are actually named
5138     something starting with __ and the normal name is an alias.  */
5139 #if defined (__stub_connect) || defined (__stub___connect)
5140 choke me
5141 #else
5142 connect();
5143 #endif
5144
5145 ; return 0; }
5146 EOF
5147 if { (eval echo configure:5148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5148   rm -rf conftest*
5149   eval "ac_cv_func_connect=yes"
5150 else
5151   echo "configure: failed program was:" >&5
5152   cat conftest.$ac_ext >&5
5153   rm -rf conftest*
5154   eval "ac_cv_func_connect=no"
5155 fi
5156 rm -f conftest*
5157
5158 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5159   echo "$ac_t""yes" 1>&6
5160   :
5161 else
5162   echo "$ac_t""no" 1>&6
5163 fi
5164
5165     if test $ac_cv_func_connect = no; then
5166       
5167 xe_msg_checking="for connect in -lsocket"
5168 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5169 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5170 echo "configure:5171: checking "$xe_msg_checking"" >&5
5171 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5172
5173 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5174 cat > conftest.$ac_ext <<EOF
5175 #line 5176 "configure"
5176 #include "confdefs.h"
5177 /* Override any gcc2 internal prototype to avoid an error.  */
5178 /* We use char because int might match the return type of a gcc2
5179     builtin and then its argument prototype would still apply.  */
5180 char connect();
5181
5182 int main() {
5183 connect()
5184 ; return 0; }
5185 EOF
5186 if { (eval echo configure:5187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5187   rm -rf conftest*
5188   eval "ac_cv_lib_$ac_lib_var=yes"
5189 else
5190   echo "configure: failed program was:" >&5
5191   cat conftest.$ac_ext >&5
5192   rm -rf conftest*
5193   eval "ac_cv_lib_$ac_lib_var=no"
5194 fi
5195 rm -f conftest*
5196 xe_check_libs=""
5197
5198 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5199   echo "$ac_t""yes" 1>&6
5200   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5201 else
5202   echo "$ac_t""no" 1>&6
5203 fi
5204
5205
5206     fi
5207
5208     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5209     echo $ac_n "checking for remove""... $ac_c" 1>&6
5210 echo "configure:5211: checking for remove" >&5
5211
5212 cat > conftest.$ac_ext <<EOF
5213 #line 5214 "configure"
5214 #include "confdefs.h"
5215 /* System header to define __stub macros and hopefully few prototypes,
5216     which can conflict with char remove(); below.  */
5217 #include <assert.h>
5218 /* Override any gcc2 internal prototype to avoid an error.  */
5219 /* We use char because int might match the return type of a gcc2
5220     builtin and then its argument prototype would still apply.  */
5221 char remove();
5222
5223 int main() {
5224
5225 /* The GNU C library defines this for functions which it implements
5226     to always fail with ENOSYS.  Some functions are actually named
5227     something starting with __ and the normal name is an alias.  */
5228 #if defined (__stub_remove) || defined (__stub___remove)
5229 choke me
5230 #else
5231 remove();
5232 #endif
5233
5234 ; return 0; }
5235 EOF
5236 if { (eval echo configure:5237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5237   rm -rf conftest*
5238   eval "ac_cv_func_remove=yes"
5239 else
5240   echo "configure: failed program was:" >&5
5241   cat conftest.$ac_ext >&5
5242   rm -rf conftest*
5243   eval "ac_cv_func_remove=no"
5244 fi
5245 rm -f conftest*
5246
5247 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5248   echo "$ac_t""yes" 1>&6
5249   :
5250 else
5251   echo "$ac_t""no" 1>&6
5252 fi
5253
5254     if test $ac_cv_func_remove = no; then
5255       
5256 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5257 echo "configure:5258: checking for remove in -lposix" >&5
5258 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5259
5260 xe_check_libs=" -lposix "
5261 cat > conftest.$ac_ext <<EOF
5262 #line 5263 "configure"
5263 #include "confdefs.h"
5264 /* Override any gcc2 internal prototype to avoid an error.  */
5265 /* We use char because int might match the return type of a gcc2
5266     builtin and then its argument prototype would still apply.  */
5267 char remove();
5268
5269 int main() {
5270 remove()
5271 ; return 0; }
5272 EOF
5273 if { (eval echo configure:5274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5274   rm -rf conftest*
5275   eval "ac_cv_lib_$ac_lib_var=yes"
5276 else
5277   echo "configure: failed program was:" >&5
5278   cat conftest.$ac_ext >&5
5279   rm -rf conftest*
5280   eval "ac_cv_lib_$ac_lib_var=no"
5281 fi
5282 rm -f conftest*
5283 xe_check_libs=""
5284
5285 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5286   echo "$ac_t""yes" 1>&6
5287   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5288 else
5289   echo "$ac_t""no" 1>&6
5290 fi
5291
5292
5293     fi
5294
5295     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5296     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5297 echo "configure:5298: checking for shmat" >&5
5298
5299 cat > conftest.$ac_ext <<EOF
5300 #line 5301 "configure"
5301 #include "confdefs.h"
5302 /* System header to define __stub macros and hopefully few prototypes,
5303     which can conflict with char shmat(); below.  */
5304 #include <assert.h>
5305 /* Override any gcc2 internal prototype to avoid an error.  */
5306 /* We use char because int might match the return type of a gcc2
5307     builtin and then its argument prototype would still apply.  */
5308 char shmat();
5309
5310 int main() {
5311
5312 /* The GNU C library defines this for functions which it implements
5313     to always fail with ENOSYS.  Some functions are actually named
5314     something starting with __ and the normal name is an alias.  */
5315 #if defined (__stub_shmat) || defined (__stub___shmat)
5316 choke me
5317 #else
5318 shmat();
5319 #endif
5320
5321 ; return 0; }
5322 EOF
5323 if { (eval echo configure:5324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5324   rm -rf conftest*
5325   eval "ac_cv_func_shmat=yes"
5326 else
5327   echo "configure: failed program was:" >&5
5328   cat conftest.$ac_ext >&5
5329   rm -rf conftest*
5330   eval "ac_cv_func_shmat=no"
5331 fi
5332 rm -f conftest*
5333
5334 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5335   echo "$ac_t""yes" 1>&6
5336   :
5337 else
5338   echo "$ac_t""no" 1>&6
5339 fi
5340
5341     if test $ac_cv_func_shmat = no; then
5342       
5343 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5344 echo "configure:5345: checking for shmat in -lipc" >&5
5345 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5346
5347 xe_check_libs=" -lipc "
5348 cat > conftest.$ac_ext <<EOF
5349 #line 5350 "configure"
5350 #include "confdefs.h"
5351 /* Override any gcc2 internal prototype to avoid an error.  */
5352 /* We use char because int might match the return type of a gcc2
5353     builtin and then its argument prototype would still apply.  */
5354 char shmat();
5355
5356 int main() {
5357 shmat()
5358 ; return 0; }
5359 EOF
5360 if { (eval echo configure:5361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5361   rm -rf conftest*
5362   eval "ac_cv_lib_$ac_lib_var=yes"
5363 else
5364   echo "configure: failed program was:" >&5
5365   cat conftest.$ac_ext >&5
5366   rm -rf conftest*
5367   eval "ac_cv_lib_$ac_lib_var=no"
5368 fi
5369 rm -f conftest*
5370 xe_check_libs=""
5371
5372 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5373   echo "$ac_t""yes" 1>&6
5374   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5375 else
5376   echo "$ac_t""no" 1>&6
5377 fi
5378
5379
5380     fi
5381   fi
5382
5383   # Check for libraries that X11R6 Xt/Xaw programs need.
5384   ac_save_LDFLAGS="$LDFLAGS"
5385   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5386   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5387   # check for ICE first), but we must link in the order -lSM -lICE or
5388   # we get undefined symbols.  So assume we have SM if we have ICE.
5389   # These have to be linked with before -lX11, unlike the other
5390   # libraries we check for below, so use a different variable.
5391   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5392   
5393 xe_msg_checking="for IceConnectionNumber in -lICE"
5394 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5395 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5396 echo "configure:5397: checking "$xe_msg_checking"" >&5
5397 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5398
5399 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5400 cat > conftest.$ac_ext <<EOF
5401 #line 5402 "configure"
5402 #include "confdefs.h"
5403 /* Override any gcc2 internal prototype to avoid an error.  */
5404 /* We use char because int might match the return type of a gcc2
5405     builtin and then its argument prototype would still apply.  */
5406 char IceConnectionNumber();
5407
5408 int main() {
5409 IceConnectionNumber()
5410 ; return 0; }
5411 EOF
5412 if { (eval echo configure:5413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5413   rm -rf conftest*
5414   eval "ac_cv_lib_$ac_lib_var=yes"
5415 else
5416   echo "configure: failed program was:" >&5
5417   cat conftest.$ac_ext >&5
5418   rm -rf conftest*
5419   eval "ac_cv_lib_$ac_lib_var=no"
5420 fi
5421 rm -f conftest*
5422 xe_check_libs=""
5423
5424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5425   echo "$ac_t""yes" 1>&6
5426   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5427 else
5428   echo "$ac_t""no" 1>&6
5429 fi
5430
5431
5432   LDFLAGS="$ac_save_LDFLAGS"
5433
5434 fi
5435  # Autoconf claims to find X library and include dirs for us.
5436   if test "$no_x" = "yes"
5437   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5438   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5439   fi
5440 fi
5441
5442 case "$with_x11" in
5443   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5444   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5445 esac
5446
5447 if test "$with_x11" = "yes"; then
5448   { test "$extra_verbose" = "yes" && cat << \EOF
5449     Defining HAVE_X_WINDOWS
5450 EOF
5451 cat >> confdefs.h <<\EOF
5452 #define HAVE_X_WINDOWS 1
5453 EOF
5454 }
5455
5456   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5457   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5458
5459       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5460     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5461     if test -d "$lib_dir" -a -d "$inc_dir"; then
5462       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5463         x_libraries="$lib_dir $x_libraries"
5464         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5465       esac
5466       case "$x_includes" in "$inc_dir"* ) ;; *)
5467         x_includes="$inc_dir $x_includes"
5468         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5469       esac
5470       break;       fi
5471   done
5472
5473     for rel in "X11R6" "X11R5" "X11R4"; do
5474     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5475     if test -d "$lib_dir" -a -d "$inc_dir"; then
5476       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5477         x_libraries="$x_libraries $lib_dir"
5478         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5479       esac
5480       case "$x_includes" in "$inc_dir"* ) ;; *)
5481         x_includes="$x_includes $inc_dir"
5482         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5483       esac
5484       break;     fi
5485   done
5486
5487     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
5488
5489   ld_switch_x_site="$X_LIBS"
5490
5491   
5492 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5493     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5494   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5495   
5496         runpath="" runpath_dirs=""
5497   if test -n "$LD_RUN_PATH"; then
5498     runpath="$LD_RUN_PATH"
5499   elif test "$GCC" = "yes"; then
5500         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5501     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5502     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5503     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5504       case "$arg" in P,* | -L* | -R* )
5505         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5506           {
5507 xe_runpath_dir="$dir"
5508   test "$xe_runpath_dir" != "/lib"     -a \
5509         "$xe_runpath_dir" != "/usr/lib" -a \
5510         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5511   eval "$xe_add_unique_runpath_dir"
5512 }
5513         done ;;
5514       esac
5515     done
5516     ld_switch_run="$ld_switch_run_save"
5517     rm -f conftest*
5518   else
5519         for arg in $ld_switch_site $ld_switch_x_site; do
5520       case "$arg" in -L*) {
5521 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5522   test "$xe_runpath_dir" != "/lib"     -a \
5523         "$xe_runpath_dir" != "/usr/lib" -a \
5524         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5525   eval "$xe_add_unique_runpath_dir"
5526 };; esac
5527     done
5528         if test "$opsys $need_motif" = "sol2 yes"; then
5529       xe_runpath_dir="/opt/SUNWdt/lib";
5530       eval "$xe_add_unique_runpath_dir";
5531     fi
5532   fi 
5533   if test -n "$runpath"; then
5534     ld_switch_run="${dash_r}${runpath}"
5535     
5536 if test "$GCC" = "yes"; then
5537   set x $ld_switch_run; shift; ld_switch_run=""
5538   while test -n "$1"; do
5539     case $1 in
5540       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5541       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5542       -Xlinker* ) ;;
5543       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5544     esac
5545     shift
5546   done
5547 fi
5548     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5549   fi
5550 fi
5551
5552
5553   if test "$extra_verbose" = "yes"; then
5554     echo; echo "X11 compilation variables:"
5555     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5556     echo
5557   fi
5558
5559             bitmapdirs=
5560   if test "$x_includes" != NONE; then
5561     for i in $x_includes; do
5562       if test -d "$i/bitmaps"; then
5563         bitmapdirs="$i/bitmaps:$bitmapdirs"
5564       fi
5565       if test -d "$i/X11/bitmaps"; then
5566         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5567       fi
5568     done
5569     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5570   fi
5571   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5572     Defining BITMAPDIR = "$bitmapdirs"
5573 EOF
5574 cat >> confdefs.h <<EOF
5575 #define BITMAPDIR "$bitmapdirs"
5576 EOF
5577 }
5578
5579
5580     echo "checking for X defines extracted by xmkmf" 1>&6
5581 echo "configure:5582: checking for X defines extracted by xmkmf" >&5
5582   rm -fr conftestdir
5583   if mkdir conftestdir; then
5584     cd conftestdir
5585     cat > Imakefile <<'EOF'
5586 xetest:
5587         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5588 EOF
5589     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5590       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5591       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5592     fi
5593     cd ..
5594     rm -fr conftestdir
5595     for word in $xmkmf_defines; do
5596       case "$word" in
5597         -D*=* ) ;;
5598         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5599               { test "$extra_verbose" = "yes" && cat << EOF
5600     Defining $word
5601 EOF
5602 cat >> confdefs.h <<EOF
5603 #define $word 1
5604 EOF
5605 }
5606  ;;
5607       esac
5608     done
5609   fi
5610
5611     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5612 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5613 echo "configure:5614: checking for X11/Intrinsic.h" >&5
5614
5615 cat > conftest.$ac_ext <<EOF
5616 #line 5617 "configure"
5617 #include "confdefs.h"
5618 #include <X11/Intrinsic.h>
5619 EOF
5620 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5621 { (eval echo configure:5622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5622 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5623 if test -z "$ac_err"; then
5624   rm -rf conftest*
5625   eval "ac_cv_header_$ac_safe=yes"
5626 else
5627   echo "$ac_err" >&5
5628   echo "configure: failed program was:" >&5
5629   cat conftest.$ac_ext >&5
5630   rm -rf conftest*
5631   eval "ac_cv_header_$ac_safe=no"
5632 fi
5633 rm -f conftest*
5634 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5635   echo "$ac_t""yes" 1>&6
5636   :
5637 else
5638   echo "$ac_t""no" 1>&6
5639 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5640 fi
5641
5642
5643       
5644 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5645 echo "configure:5646: checking for XOpenDisplay in -lX11" >&5
5646 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5647
5648 xe_check_libs=" -lX11 "
5649 cat > conftest.$ac_ext <<EOF
5650 #line 5651 "configure"
5651 #include "confdefs.h"
5652 /* Override any gcc2 internal prototype to avoid an error.  */
5653 /* We use char because int might match the return type of a gcc2
5654     builtin and then its argument prototype would still apply.  */
5655 char XOpenDisplay();
5656
5657 int main() {
5658 XOpenDisplay()
5659 ; return 0; }
5660 EOF
5661 if { (eval echo configure:5662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5662   rm -rf conftest*
5663   eval "ac_cv_lib_$ac_lib_var=yes"
5664 else
5665   echo "configure: failed program was:" >&5
5666   cat conftest.$ac_ext >&5
5667   rm -rf conftest*
5668   eval "ac_cv_lib_$ac_lib_var=no"
5669 fi
5670 rm -f conftest*
5671 xe_check_libs=""
5672
5673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5674   echo "$ac_t""yes" 1>&6
5675   have_lib_x11=yes
5676 else
5677   echo "$ac_t""no" 1>&6
5678 fi
5679
5680
5681   if test "$have_lib_x11" != "yes"; then
5682     
5683 xe_msg_checking="for XGetFontProperty in -lX11"
5684 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5685 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5686 echo "configure:5687: checking "$xe_msg_checking"" >&5
5687 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5688
5689 xe_check_libs=" -lX11 -b i486-linuxaout"
5690 cat > conftest.$ac_ext <<EOF
5691 #line 5692 "configure"
5692 #include "confdefs.h"
5693 /* Override any gcc2 internal prototype to avoid an error.  */
5694 /* We use char because int might match the return type of a gcc2
5695     builtin and then its argument prototype would still apply.  */
5696 char XGetFontProperty();
5697
5698 int main() {
5699 XGetFontProperty()
5700 ; return 0; }
5701 EOF
5702 if { (eval echo configure:5703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5703   rm -rf conftest*
5704   eval "ac_cv_lib_$ac_lib_var=yes"
5705 else
5706   echo "configure: failed program was:" >&5
5707   cat conftest.$ac_ext >&5
5708   rm -rf conftest*
5709   eval "ac_cv_lib_$ac_lib_var=no"
5710 fi
5711 rm -f conftest*
5712 xe_check_libs=""
5713
5714 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5715   echo "$ac_t""yes" 1>&6
5716   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5717 else
5718   echo "$ac_t""no" 1>&6
5719 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5720 fi
5721
5722
5723   fi
5724   libs_x="-lX11"
5725   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5726
5727     
5728 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5729 echo "configure:5730: checking for XShapeSelectInput in -lXext" >&5
5730 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5731
5732 xe_check_libs=" -lXext "
5733 cat > conftest.$ac_ext <<EOF
5734 #line 5735 "configure"
5735 #include "confdefs.h"
5736 /* Override any gcc2 internal prototype to avoid an error.  */
5737 /* We use char because int might match the return type of a gcc2
5738     builtin and then its argument prototype would still apply.  */
5739 char XShapeSelectInput();
5740
5741 int main() {
5742 XShapeSelectInput()
5743 ; return 0; }
5744 EOF
5745 if { (eval echo configure:5746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5746   rm -rf conftest*
5747   eval "ac_cv_lib_$ac_lib_var=yes"
5748 else
5749   echo "configure: failed program was:" >&5
5750   cat conftest.$ac_ext >&5
5751   rm -rf conftest*
5752   eval "ac_cv_lib_$ac_lib_var=no"
5753 fi
5754 rm -f conftest*
5755 xe_check_libs=""
5756
5757 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5758   echo "$ac_t""yes" 1>&6
5759   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5760 else
5761   echo "$ac_t""no" 1>&6
5762 fi
5763
5764
5765
5766     
5767 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5768 echo "configure:5769: checking for XtOpenDisplay in -lXt" >&5
5769 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5770
5771 xe_check_libs=" -lXt "
5772 cat > conftest.$ac_ext <<EOF
5773 #line 5774 "configure"
5774 #include "confdefs.h"
5775 /* Override any gcc2 internal prototype to avoid an error.  */
5776 /* We use char because int might match the return type of a gcc2
5777     builtin and then its argument prototype would still apply.  */
5778 char XtOpenDisplay();
5779
5780 int main() {
5781 XtOpenDisplay()
5782 ; return 0; }
5783 EOF
5784 if { (eval echo configure:5785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5785   rm -rf conftest*
5786   eval "ac_cv_lib_$ac_lib_var=yes"
5787 else
5788   echo "configure: failed program was:" >&5
5789   cat conftest.$ac_ext >&5
5790   rm -rf conftest*
5791   eval "ac_cv_lib_$ac_lib_var=no"
5792 fi
5793 rm -f conftest*
5794 xe_check_libs=""
5795
5796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5797   echo "$ac_t""yes" 1>&6
5798   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5799 else
5800   echo "$ac_t""no" 1>&6
5801 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5802 fi
5803
5804
5805
5806   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5807 echo "configure:5808: checking the version of X11 being used" >&5
5808   cat > conftest.$ac_ext <<EOF
5809 #line 5810 "configure"
5810 #include "confdefs.h"
5811 #include <X11/Intrinsic.h>
5812     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5813 EOF
5814 if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5815 then
5816   ./conftest foobar; x11_release=$?
5817 else
5818   conftest_rc="$?"
5819   echo "configure: failed program was:" >&5
5820   cat conftest.$ac_ext >&5
5821   rm -fr conftest*
5822   x11_release=4
5823 fi
5824 rm -fr conftest*
5825   echo "$ac_t""R${x11_release}" 1>&6
5826   { test "$extra_verbose" = "yes" && cat << EOF
5827     Defining THIS_IS_X11R${x11_release}
5828 EOF
5829 cat >> confdefs.h <<EOF
5830 #define THIS_IS_X11R${x11_release} 1
5831 EOF
5832 }
5833
5834
5835   for ac_hdr in X11/Xlocale.h
5836 do
5837 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5838 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5839 echo "configure:5840: checking for $ac_hdr" >&5
5840
5841 cat > conftest.$ac_ext <<EOF
5842 #line 5843 "configure"
5843 #include "confdefs.h"
5844 #include <$ac_hdr>
5845 EOF
5846 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5847 { (eval echo configure:5848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5848 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5849 if test -z "$ac_err"; then
5850   rm -rf conftest*
5851   eval "ac_cv_header_$ac_safe=yes"
5852 else
5853   echo "$ac_err" >&5
5854   echo "configure: failed program was:" >&5
5855   cat conftest.$ac_ext >&5
5856   rm -rf conftest*
5857   eval "ac_cv_header_$ac_safe=no"
5858 fi
5859 rm -f conftest*
5860 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5861   echo "$ac_t""yes" 1>&6
5862     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5863   { test "$extra_verbose" = "yes" && cat << EOF
5864     Defining $ac_tr_hdr
5865 EOF
5866 cat >> confdefs.h <<EOF
5867 #define $ac_tr_hdr 1
5868 EOF
5869 }
5870  
5871 else
5872   echo "$ac_t""no" 1>&6
5873 fi
5874 done
5875
5876
5877     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5878 echo "configure:5879: checking for XFree86" >&5
5879   if test -d "/usr/X386/include" -o \
5880           -f "/etc/XF86Config"    -o \
5881           -f "/etc/X11/XF86Config" -o \
5882           -f "/usr/X11R6/lib/X11/XF86Config"; then
5883     echo "$ac_t""yes" 1>&6
5884     { test "$extra_verbose" = "yes" && cat << \EOF
5885     Defining HAVE_XFREE386
5886 EOF
5887 cat >> confdefs.h <<\EOF
5888 #define HAVE_XFREE386 1
5889 EOF
5890 }
5891
5892   else
5893     echo "$ac_t""no" 1>&6
5894   fi
5895
5896     test -z "$with_xmu" && { 
5897 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5898 echo "configure:5899: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5899 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5900
5901 xe_check_libs=" -lXmu "
5902 cat > conftest.$ac_ext <<EOF
5903 #line 5904 "configure"
5904 #include "confdefs.h"
5905 /* Override any gcc2 internal prototype to avoid an error.  */
5906 /* We use char because int might match the return type of a gcc2
5907     builtin and then its argument prototype would still apply.  */
5908 char XmuReadBitmapDataFromFile();
5909
5910 int main() {
5911 XmuReadBitmapDataFromFile()
5912 ; return 0; }
5913 EOF
5914 if { (eval echo configure:5915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5915   rm -rf conftest*
5916   eval "ac_cv_lib_$ac_lib_var=yes"
5917 else
5918   echo "configure: failed program was:" >&5
5919   cat conftest.$ac_ext >&5
5920   rm -rf conftest*
5921   eval "ac_cv_lib_$ac_lib_var=no"
5922 fi
5923 rm -f conftest*
5924 xe_check_libs=""
5925
5926 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5927   echo "$ac_t""yes" 1>&6
5928   with_xmu=yes
5929 else
5930   echo "$ac_t""no" 1>&6
5931 with_xmu=no
5932 fi
5933
5934  }
5935   if test "$with_xmu" = "no"; then
5936     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5937    echo "    xemacs will be linked with \"xmu.o\""
5938  fi
5939   else
5940     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5941     { test "$extra_verbose" = "yes" && cat << \EOF
5942     Defining HAVE_XMU
5943 EOF
5944 cat >> confdefs.h <<\EOF
5945 #define HAVE_XMU 1
5946 EOF
5947 }
5948
5949   fi
5950
5951       
5952 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5953 echo "configure:5954: checking for main in -lXbsd" >&5
5954 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5955
5956 xe_check_libs=" -lXbsd "
5957 cat > conftest.$ac_ext <<EOF
5958 #line 5959 "configure"
5959 #include "confdefs.h"
5960
5961 int main() {
5962 main()
5963 ; return 0; }
5964 EOF
5965 if { (eval echo configure:5966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5966   rm -rf conftest*
5967   eval "ac_cv_lib_$ac_lib_var=yes"
5968 else
5969   echo "configure: failed program was:" >&5
5970   cat conftest.$ac_ext >&5
5971   rm -rf conftest*
5972   eval "ac_cv_lib_$ac_lib_var=no"
5973 fi
5974 rm -f conftest*
5975 xe_check_libs=""
5976
5977 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5978   echo "$ac_t""yes" 1>&6
5979   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5980 else
5981   echo "$ac_t""no" 1>&6
5982 fi
5983
5984
5985
5986     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5987         if test "$GCC" = "yes"; then
5988       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5989       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5990     else
5991       case "$CC" in
5992         "xlc" ) CC="xlc_r" ;;
5993         "xlC" ) CC="xlC_r" ;;
5994         "cc"  ) CC="cc_r" ;;
5995       esac
5996     fi
5997   fi
5998
5999 fi 
6000 if test "$with_msw" != "no"; then
6001   echo "checking for MS-Windows" 1>&6
6002 echo "configure:6003: checking for MS-Windows" >&5
6003   
6004 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
6005 echo "configure:6006: checking for main in -lgdi32" >&5
6006 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
6007
6008 xe_check_libs=" -lgdi32 "
6009 cat > conftest.$ac_ext <<EOF
6010 #line 6011 "configure"
6011 #include "confdefs.h"
6012
6013 int main() {
6014 main()
6015 ; return 0; }
6016 EOF
6017 if { (eval echo configure:6018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6018   rm -rf conftest*
6019   eval "ac_cv_lib_$ac_lib_var=yes"
6020 else
6021   echo "configure: failed program was:" >&5
6022   cat conftest.$ac_ext >&5
6023   rm -rf conftest*
6024   eval "ac_cv_lib_$ac_lib_var=no"
6025 fi
6026 rm -f conftest*
6027 xe_check_libs=""
6028
6029 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6030   echo "$ac_t""yes" 1>&6
6031   with_msw=yes
6032 else
6033   echo "$ac_t""no" 1>&6
6034 fi
6035
6036
6037   if test "$with_msw" = "yes"; then
6038     { test "$extra_verbose" = "yes" && cat << \EOF
6039     Defining HAVE_MS_WINDOWS
6040 EOF
6041 cat >> confdefs.h <<\EOF
6042 #define HAVE_MS_WINDOWS 1
6043 EOF
6044 }
6045
6046     install_pp="$blddir/lib-src/installexe.sh"
6047     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
6048     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6049     if test "$window_system" != x11; then
6050         window_system=msw
6051         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6052             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6053    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6054  fi
6055         test "$with_menubars"   != "no" && with_menubars=msw \
6056             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6057    echo "    xemacs will be linked with \"menubar-msw.o\""
6058  fi
6059         test "$with_toolbars"   != "no" && with_toolbars=msw \
6060             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6061    echo "    xemacs will be linked with \"toolbar-msw.o\""
6062  fi
6063         test "$with_dialogs"   != "no" && with_dialogs=msw \
6064             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6065    echo "    xemacs will be linked with \"dialog-msw.o\""
6066  fi
6067         test "$with_widgets"   != "no" && with_widgets=msw
6068     else
6069         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6070    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6071  fi
6072         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6073    echo "    xemacs will be linked with \"menubar-msw.o\""
6074  fi
6075         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6076    echo "    xemacs will be linked with \"toolbar-msw.o\""
6077  fi
6078         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6079    echo "    xemacs will be linked with \"dialog-msw.o\""
6080  fi
6081     fi
6082         cat > conftest.$ac_ext <<EOF
6083 #line 6084 "configure"
6084 #include "confdefs.h"
6085 #include <fcntl.h>
6086     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6087 EOF
6088 if { (eval echo configure:6089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6089 then
6090   { test "$extra_verbose" = "yes" && cat << \EOF
6091     Defining HAVE_MSG_SELECT
6092 EOF
6093 cat >> confdefs.h <<\EOF
6094 #define HAVE_MSG_SELECT 1
6095 EOF
6096 }
6097
6098 else
6099   conftest_rc="$?"
6100   echo "configure: failed program was:" >&5
6101   cat conftest.$ac_ext >&5
6102 fi
6103 rm -fr conftest*
6104     const_is_losing=no
6105     with_file_coding=yes
6106     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
6107    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\""
6108  fi
6109   fi
6110 fi
6111
6112
6113
6114 test -z "$window_system" && window_system="none"
6115
6116 if test "$window_system" = "none"; then
6117   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6118   do
6119     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6120        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6121     fi
6122     eval "with_${feature}=no"
6123   done
6124 else
6125   test -z "$with_toolbars" && with_toolbars=yes
6126 fi
6127
6128 if test "$with_msw" != "yes"; then
6129   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6130   do
6131     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6132        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6133     fi
6134     eval "with_${feature}=no"
6135   done
6136 else
6137   :
6138 fi
6139
6140 if test "$with_x11" != "yes"; then
6141             for feature in tooltalk cde offix wmcommand xim xmu
6142   do
6143     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6144        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6145     fi
6146     eval "with_${feature}=no"
6147   done
6148 fi
6149
6150 bitmapdir=
6151
6152 case "$window_system" in
6153   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6154   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6155   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6156 esac
6157
6158 case "$x_libraries" in *X11R4* )
6159   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6160   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6161 esac
6162
6163 echo "checking for WM_COMMAND option" 1>&6
6164 echo "configure:6165: checking for WM_COMMAND option" >&5;
6165 if test "$with_wmcommand" != "no"; then
6166   { test "$extra_verbose" = "yes" && cat << \EOF
6167     Defining HAVE_WMCOMMAND
6168 EOF
6169 cat >> confdefs.h <<\EOF
6170 #define HAVE_WMCOMMAND 1
6171 EOF
6172 }
6173
6174 fi
6175
6176 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6177 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6178 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6179 echo "configure:6180: checking for X11/Xauth.h" >&5
6180
6181 cat > conftest.$ac_ext <<EOF
6182 #line 6183 "configure"
6183 #include "confdefs.h"
6184 #include <X11/Xauth.h>
6185 EOF
6186 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6187 { (eval echo configure:6188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6188 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6189 if test -z "$ac_err"; then
6190   rm -rf conftest*
6191   eval "ac_cv_header_$ac_safe=yes"
6192 else
6193   echo "$ac_err" >&5
6194   echo "configure: failed program was:" >&5
6195   cat conftest.$ac_ext >&5
6196   rm -rf conftest*
6197   eval "ac_cv_header_$ac_safe=no"
6198 fi
6199 rm -f conftest*
6200 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6201   echo "$ac_t""yes" 1>&6
6202   :
6203 else
6204   echo "$ac_t""no" 1>&6
6205 with_xauth=no
6206 fi
6207  }
6208 test -z "$with_xauth" && { 
6209 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6210 echo "configure:6211: checking for XauGetAuthByAddr in -lXau" >&5
6211 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6212
6213 xe_check_libs=" -lXau "
6214 cat > conftest.$ac_ext <<EOF
6215 #line 6216 "configure"
6216 #include "confdefs.h"
6217 /* Override any gcc2 internal prototype to avoid an error.  */
6218 /* We use char because int might match the return type of a gcc2
6219     builtin and then its argument prototype would still apply.  */
6220 char XauGetAuthByAddr();
6221
6222 int main() {
6223 XauGetAuthByAddr()
6224 ; return 0; }
6225 EOF
6226 if { (eval echo configure:6227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6227   rm -rf conftest*
6228   eval "ac_cv_lib_$ac_lib_var=yes"
6229 else
6230   echo "configure: failed program was:" >&5
6231   cat conftest.$ac_ext >&5
6232   rm -rf conftest*
6233   eval "ac_cv_lib_$ac_lib_var=no"
6234 fi
6235 rm -f conftest*
6236 xe_check_libs=""
6237
6238 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6239   echo "$ac_t""yes" 1>&6
6240   :
6241 else
6242   echo "$ac_t""no" 1>&6
6243 with_xauth=no
6244 fi
6245
6246  }
6247 test -z "$with_xauth" && with_xauth=yes
6248 if test "$with_xauth" = "yes"; then
6249   { test "$extra_verbose" = "yes" && cat << \EOF
6250     Defining HAVE_XAUTH
6251 EOF
6252 cat >> confdefs.h <<\EOF
6253 #define HAVE_XAUTH 1
6254 EOF
6255 }
6256
6257   
6258 T=""
6259 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
6260 libs_xauth="$T"
6261
6262 fi
6263
6264
6265
6266
6267 if test "$with_tooltalk" != "no" ; then
6268       for dir in "" "Tt/" "desktop/" ; do
6269     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6270 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6271 echo "configure:6272: checking for ${dir}tt_c.h" >&5
6272
6273 cat > conftest.$ac_ext <<EOF
6274 #line 6275 "configure"
6275 #include "confdefs.h"
6276 #include <${dir}tt_c.h>
6277 EOF
6278 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6279 { (eval echo configure:6280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6280 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6281 if test -z "$ac_err"; then
6282   rm -rf conftest*
6283   eval "ac_cv_header_$ac_safe=yes"
6284 else
6285   echo "$ac_err" >&5
6286   echo "configure: failed program was:" >&5
6287   cat conftest.$ac_ext >&5
6288   rm -rf conftest*
6289   eval "ac_cv_header_$ac_safe=no"
6290 fi
6291 rm -f conftest*
6292 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6293   echo "$ac_t""yes" 1>&6
6294   tt_c_h_path="${dir}tt_c.h"; break
6295 else
6296   echo "$ac_t""no" 1>&6
6297 fi
6298
6299   done
6300   if test -z "$tt_c_h_path"; then
6301     if test "$with_tooltalk" = "yes"; then
6302       (echo "$progname: Usage error:"
6303 echo " " "Unable to find required tooltalk header files."
6304 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6305     fi
6306     with_tooltalk=no
6307   fi
6308 fi
6309 if test "$with_tooltalk" != "no" ; then
6310   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6311     
6312 xe_msg_checking="for tt_message_create in -ltt"
6313 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6314 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6315 echo "configure:6316: checking "$xe_msg_checking"" >&5
6316 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6317
6318 xe_check_libs=" -ltt $extra_libs"
6319 cat > conftest.$ac_ext <<EOF
6320 #line 6321 "configure"
6321 #include "confdefs.h"
6322 /* Override any gcc2 internal prototype to avoid an error.  */
6323 /* We use char because int might match the return type of a gcc2
6324     builtin and then its argument prototype would still apply.  */
6325 char tt_message_create();
6326
6327 int main() {
6328 tt_message_create()
6329 ; return 0; }
6330 EOF
6331 if { (eval echo configure:6332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6332   rm -rf conftest*
6333   eval "ac_cv_lib_$ac_lib_var=yes"
6334 else
6335   echo "configure: failed program was:" >&5
6336   cat conftest.$ac_ext >&5
6337   rm -rf conftest*
6338   eval "ac_cv_lib_$ac_lib_var=no"
6339 fi
6340 rm -f conftest*
6341 xe_check_libs=""
6342
6343 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6344   echo "$ac_t""yes" 1>&6
6345   tt_libs="-ltt $extra_libs"; break
6346 else
6347   echo "$ac_t""no" 1>&6
6348 :
6349 fi
6350
6351
6352   done
6353   if test -z "$tt_libs"; then
6354     if test "$with_tooltalk" = "yes"; then
6355       (echo "$progname: Usage error:"
6356 echo " " "Unable to find required tooltalk libraries."
6357 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6358     fi
6359     with_tooltalk=no
6360   fi
6361 fi
6362 test -z "$with_tooltalk" && with_tooltalk=yes
6363 if test "$with_tooltalk" = "yes"; then
6364   { test "$extra_verbose" = "yes" && cat << \EOF
6365     Defining TOOLTALK
6366 EOF
6367 cat >> confdefs.h <<\EOF
6368 #define TOOLTALK 1
6369 EOF
6370 }
6371
6372   { test "$extra_verbose" = "yes" && cat << EOF
6373     Defining TT_C_H_PATH = "$tt_c_h_path"
6374 EOF
6375 cat >> confdefs.h <<EOF
6376 #define TT_C_H_PATH "$tt_c_h_path"
6377 EOF
6378 }
6379
6380   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6381   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6382    echo "    xemacs will be linked with \"tooltalk.o\""
6383  fi
6384 fi
6385
6386 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6387 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6388 echo "configure:6389: checking for Dt/Dt.h" >&5
6389
6390 cat > conftest.$ac_ext <<EOF
6391 #line 6392 "configure"
6392 #include "confdefs.h"
6393 #include <Dt/Dt.h>
6394 EOF
6395 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6396 { (eval echo configure:6397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6397 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6398 if test -z "$ac_err"; then
6399   rm -rf conftest*
6400   eval "ac_cv_header_$ac_safe=yes"
6401 else
6402   echo "$ac_err" >&5
6403   echo "configure: failed program was:" >&5
6404   cat conftest.$ac_ext >&5
6405   rm -rf conftest*
6406   eval "ac_cv_header_$ac_safe=no"
6407 fi
6408 rm -f conftest*
6409 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6410   echo "$ac_t""yes" 1>&6
6411   :
6412 else
6413   echo "$ac_t""no" 1>&6
6414 with_cde=no
6415 fi
6416  }
6417 test -z "$with_cde" && { 
6418 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6419 echo "configure:6420: checking for DtDndDragStart in -lDtSvc" >&5
6420 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6421
6422 xe_check_libs=" -lDtSvc "
6423 cat > conftest.$ac_ext <<EOF
6424 #line 6425 "configure"
6425 #include "confdefs.h"
6426 /* Override any gcc2 internal prototype to avoid an error.  */
6427 /* We use char because int might match the return type of a gcc2
6428     builtin and then its argument prototype would still apply.  */
6429 char DtDndDragStart();
6430
6431 int main() {
6432 DtDndDragStart()
6433 ; return 0; }
6434 EOF
6435 if { (eval echo configure:6436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6436   rm -rf conftest*
6437   eval "ac_cv_lib_$ac_lib_var=yes"
6438 else
6439   echo "configure: failed program was:" >&5
6440   cat conftest.$ac_ext >&5
6441   rm -rf conftest*
6442   eval "ac_cv_lib_$ac_lib_var=no"
6443 fi
6444 rm -f conftest*
6445 xe_check_libs=""
6446
6447 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6448   echo "$ac_t""yes" 1>&6
6449   :
6450 else
6451   echo "$ac_t""no" 1>&6
6452 with_cde=no
6453 fi
6454
6455  }
6456 test -z "$with_cde" && with_cde=yes
6457 if test "$with_dragndrop" = no; then
6458   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6459   with_cde=no
6460 fi
6461 if test "$with_cde" = "yes" ; then
6462   { test "$extra_verbose" = "yes" && cat << \EOF
6463     Defining HAVE_CDE
6464 EOF
6465 cat >> confdefs.h <<\EOF
6466 #define HAVE_CDE 1
6467 EOF
6468 }
6469
6470   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6471   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6472   with_tooltalk=yes # CDE requires Tooltalk
6473   need_motif=yes    # CDE requires Motif
6474 fi
6475
6476 test "$window_system" != "x11" && with_offix=no
6477 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6478   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6479   with_offix=no
6480 fi
6481 if test "$with_dragndrop" = no; then
6482   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6483   with_offix=no
6484 fi
6485 if test "$with_cde" = yes; then
6486   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6487   with_offix=no
6488 fi
6489 test -z "$with_offix" && with_offix=no
6490 if test "$with_offix" = "yes"; then
6491   { test "$extra_verbose" = "yes" && cat << \EOF
6492     Defining HAVE_OFFIX_DND
6493 EOF
6494 cat >> confdefs.h <<\EOF
6495 #define HAVE_OFFIX_DND 1
6496 EOF
6497 }
6498
6499   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6500   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6501 fi
6502
6503 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6504 echo "configure:6505: checking if drag and drop API is needed" >&5
6505 if test "$with_dragndrop" != "no" ; then
6506   if test -n "$dragndrop_proto" ; then
6507     with_dragndrop=yes
6508     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6509     { test "$extra_verbose" = "yes" && cat << \EOF
6510     Defining HAVE_DRAGNDROP
6511 EOF
6512 cat >> confdefs.h <<\EOF
6513 #define HAVE_DRAGNDROP 1
6514 EOF
6515 }
6516
6517     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6518   else
6519     with_dragndrop=no
6520     echo "$ac_t""no" 1>&6
6521   fi
6522 fi
6523
6524 echo "checking for LDAP" 1>&6
6525 echo "configure:6526: checking for LDAP" >&5
6526 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6527 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6528 echo "configure:6529: checking for ldap.h" >&5
6529
6530 cat > conftest.$ac_ext <<EOF
6531 #line 6532 "configure"
6532 #include "confdefs.h"
6533 #include <ldap.h>
6534 EOF
6535 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6536 { (eval echo configure:6537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6537 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6538 if test -z "$ac_err"; then
6539   rm -rf conftest*
6540   eval "ac_cv_header_$ac_safe=yes"
6541 else
6542   echo "$ac_err" >&5
6543   echo "configure: failed program was:" >&5
6544   cat conftest.$ac_ext >&5
6545   rm -rf conftest*
6546   eval "ac_cv_header_$ac_safe=no"
6547 fi
6548 rm -f conftest*
6549 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6550   echo "$ac_t""yes" 1>&6
6551   :
6552 else
6553   echo "$ac_t""no" 1>&6
6554 with_ldap=no
6555 fi
6556  }
6557 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6558 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6559 echo "configure:6560: checking for lber.h" >&5
6560
6561 cat > conftest.$ac_ext <<EOF
6562 #line 6563 "configure"
6563 #include "confdefs.h"
6564 #include <lber.h>
6565 EOF
6566 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6567 { (eval echo configure:6568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6568 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6569 if test -z "$ac_err"; then
6570   rm -rf conftest*
6571   eval "ac_cv_header_$ac_safe=yes"
6572 else
6573   echo "$ac_err" >&5
6574   echo "configure: failed program was:" >&5
6575   cat conftest.$ac_ext >&5
6576   rm -rf conftest*
6577   eval "ac_cv_header_$ac_safe=no"
6578 fi
6579 rm -f conftest*
6580 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6581   echo "$ac_t""yes" 1>&6
6582   :
6583 else
6584   echo "$ac_t""no" 1>&6
6585 with_ldap=no
6586 fi
6587  }
6588 if test "$with_ldap" != "no"; then
6589   
6590 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
6591 echo "configure:6592: checking for ldap_search in -lldap" >&5
6592 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
6593
6594 xe_check_libs=" -lldap "
6595 cat > conftest.$ac_ext <<EOF
6596 #line 6597 "configure"
6597 #include "confdefs.h"
6598 /* Override any gcc2 internal prototype to avoid an error.  */
6599 /* We use char because int might match the return type of a gcc2
6600     builtin and then its argument prototype would still apply.  */
6601 char ldap_search();
6602
6603 int main() {
6604 ldap_search()
6605 ; return 0; }
6606 EOF
6607 if { (eval echo configure:6608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6608   rm -rf conftest*
6609   eval "ac_cv_lib_$ac_lib_var=yes"
6610 else
6611   echo "configure: failed program was:" >&5
6612   cat conftest.$ac_ext >&5
6613   rm -rf conftest*
6614   eval "ac_cv_lib_$ac_lib_var=no"
6615 fi
6616 rm -f conftest*
6617 xe_check_libs=""
6618
6619 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6620   echo "$ac_t""yes" 1>&6
6621   with_ldap_nolber=yes
6622 else
6623   echo "$ac_t""no" 1>&6
6624 with_ldap_nolber=no
6625 fi
6626
6627
6628   test "$with_ldap_nolber" = "no" && { 
6629 xe_msg_checking="for ldap_open in -lldap"
6630 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6631 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6632 echo "configure:6633: checking "$xe_msg_checking"" >&5
6633 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6634
6635 xe_check_libs=" -lldap -llber"
6636 cat > conftest.$ac_ext <<EOF
6637 #line 6638 "configure"
6638 #include "confdefs.h"
6639 /* Override any gcc2 internal prototype to avoid an error.  */
6640 /* We use char because int might match the return type of a gcc2
6641     builtin and then its argument prototype would still apply.  */
6642 char ldap_open();
6643
6644 int main() {
6645 ldap_open()
6646 ; return 0; }
6647 EOF
6648 if { (eval echo configure:6649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6649   rm -rf conftest*
6650   eval "ac_cv_lib_$ac_lib_var=yes"
6651 else
6652   echo "configure: failed program was:" >&5
6653   cat conftest.$ac_ext >&5
6654   rm -rf conftest*
6655   eval "ac_cv_lib_$ac_lib_var=no"
6656 fi
6657 rm -f conftest*
6658 xe_check_libs=""
6659
6660 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6661   echo "$ac_t""yes" 1>&6
6662   with_ldap_lber=yes
6663 else
6664   echo "$ac_t""no" 1>&6
6665 with_ldap_lber=no
6666 fi
6667
6668  }
6669   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { 
6670 xe_msg_checking="for ldap_open in -lldap"
6671 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
6672 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6673 echo "configure:6674: checking "$xe_msg_checking"" >&5
6674 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6675
6676 xe_check_libs=" -lldap -llber -lkrb"
6677 cat > conftest.$ac_ext <<EOF
6678 #line 6679 "configure"
6679 #include "confdefs.h"
6680 /* Override any gcc2 internal prototype to avoid an error.  */
6681 /* We use char because int might match the return type of a gcc2
6682     builtin and then its argument prototype would still apply.  */
6683 char ldap_open();
6684
6685 int main() {
6686 ldap_open()
6687 ; return 0; }
6688 EOF
6689 if { (eval echo configure:6690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6690   rm -rf conftest*
6691   eval "ac_cv_lib_$ac_lib_var=yes"
6692 else
6693   echo "configure: failed program was:" >&5
6694   cat conftest.$ac_ext >&5
6695   rm -rf conftest*
6696   eval "ac_cv_lib_$ac_lib_var=no"
6697 fi
6698 rm -f conftest*
6699 xe_check_libs=""
6700
6701 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6702   echo "$ac_t""yes" 1>&6
6703   with_ldap_krb=yes
6704 else
6705   echo "$ac_t""no" 1>&6
6706 with_ldap_krb=no
6707 fi
6708
6709  }
6710   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { 
6711 xe_msg_checking="for ldap_open in -lldap"
6712 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
6713 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6714 echo "configure:6715: checking "$xe_msg_checking"" >&5
6715 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6716
6717 xe_check_libs=" -lldap -llber -lkrb -ldes"
6718 cat > conftest.$ac_ext <<EOF
6719 #line 6720 "configure"
6720 #include "confdefs.h"
6721 /* Override any gcc2 internal prototype to avoid an error.  */
6722 /* We use char because int might match the return type of a gcc2
6723     builtin and then its argument prototype would still apply.  */
6724 char ldap_open();
6725
6726 int main() {
6727 ldap_open()
6728 ; return 0; }
6729 EOF
6730 if { (eval echo configure:6731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6731   rm -rf conftest*
6732   eval "ac_cv_lib_$ac_lib_var=yes"
6733 else
6734   echo "configure: failed program was:" >&5
6735   cat conftest.$ac_ext >&5
6736   rm -rf conftest*
6737   eval "ac_cv_lib_$ac_lib_var=no"
6738 fi
6739 rm -f conftest*
6740 xe_check_libs=""
6741
6742 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6743   echo "$ac_t""yes" 1>&6
6744   with_ldap_krbdes=yes
6745 else
6746   echo "$ac_t""no" 1>&6
6747 with_ldap_krbdes=no
6748 fi
6749
6750  }
6751   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
6752 fi
6753 if test "$with_ldap" = "yes"; then
6754   { test "$extra_verbose" = "yes" && cat << \EOF
6755     Defining HAVE_LDAP
6756 EOF
6757 cat >> confdefs.h <<\EOF
6758 #define HAVE_LDAP 1
6759 EOF
6760 }
6761
6762   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6763    echo "    xemacs will be linked with \"eldap.o\""
6764  fi
6765   if test "$with_ldap_nolber" = "yes" ; then
6766     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6767   else
6768     if test "$with_ldap_krb" = "yes" ; then
6769       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
6770     fi
6771     if test "$with_ldap_krbdes" = "yes" ; then
6772       LIBS="-ldes $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldes\" to \$LIBS"; fi
6773       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
6774     fi
6775     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6776     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6777   fi
6778   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
6779 do
6780 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6781 echo "configure:6782: checking for $ac_func" >&5
6782
6783 cat > conftest.$ac_ext <<EOF
6784 #line 6785 "configure"
6785 #include "confdefs.h"
6786 /* System header to define __stub macros and hopefully few prototypes,
6787     which can conflict with char $ac_func(); below.  */
6788 #include <assert.h>
6789 /* Override any gcc2 internal prototype to avoid an error.  */
6790 /* We use char because int might match the return type of a gcc2
6791     builtin and then its argument prototype would still apply.  */
6792 char $ac_func();
6793
6794 int main() {
6795
6796 /* The GNU C library defines this for functions which it implements
6797     to always fail with ENOSYS.  Some functions are actually named
6798     something starting with __ and the normal name is an alias.  */
6799 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6800 choke me
6801 #else
6802 $ac_func();
6803 #endif
6804
6805 ; return 0; }
6806 EOF
6807 if { (eval echo configure:6808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6808   rm -rf conftest*
6809   eval "ac_cv_func_$ac_func=yes"
6810 else
6811   echo "configure: failed program was:" >&5
6812   cat conftest.$ac_ext >&5
6813   rm -rf conftest*
6814   eval "ac_cv_func_$ac_func=no"
6815 fi
6816 rm -f conftest*
6817
6818 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6819   echo "$ac_t""yes" 1>&6
6820     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6821   { test "$extra_verbose" = "yes" && cat << EOF
6822     Defining $ac_tr_func
6823 EOF
6824 cat >> confdefs.h <<EOF
6825 #define $ac_tr_func 1
6826 EOF
6827 }
6828  
6829 else
6830   echo "$ac_t""no" 1>&6
6831 fi
6832 done
6833
6834 fi
6835
6836
6837 if test "$window_system" != "none"; then
6838   echo "checking for graphics libraries" 1>&6
6839 echo "configure:6840: checking for graphics libraries" >&5
6840
6841     xpm_problem=""
6842   if test -z "$with_xpm"; then
6843     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6844 echo "configure:6845: checking for Xpm - no older than 3.4f" >&5
6845     xe_check_libs=-lXpm
6846     cat > conftest.$ac_ext <<EOF
6847 #line 6848 "configure"
6848 #include "confdefs.h"
6849 #include <X11/xpm.h>
6850     int main(int c, char **v) {
6851     return c == 1 ? 0 :
6852       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6853       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6854 EOF
6855 if { (eval echo configure:6856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6856 then
6857   ./conftest dummy_arg; xpm_status=$?;
6858       if test "$xpm_status" = "0"; then
6859         with_xpm=yes;
6860       else
6861         with_xpm=no;
6862         if test "$xpm_status" = "1"; then
6863           xpm_problem="Xpm library version and header file version don't match!"
6864         elif test "$xpm_status" = "2"; then
6865           xpm_problem="Xpm library version is too old!"
6866         else
6867           xpm_problem="Internal xpm detection logic error!"
6868         fi
6869         echo "
6870 *** WARNING *** $xpm_problem
6871   I'm not touching that with a 10-foot pole!
6872   If you really want to use the installed version of Xpm, rerun
6873   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6874     fi
6875 else
6876   conftest_rc="$?"
6877   echo "configure: failed program was:" >&5
6878   cat conftest.$ac_ext >&5
6879   rm -fr conftest*
6880   with_xpm=no
6881 fi
6882 rm -fr conftest*
6883     xe_check_libs=
6884     echo "$ac_t""$with_xpm" 1>&6
6885   fi
6886   if test "$with_xpm" = "yes"; then
6887     { test "$extra_verbose" = "yes" && cat << \EOF
6888     Defining HAVE_XPM
6889 EOF
6890 cat >> confdefs.h <<\EOF
6891 #define HAVE_XPM 1
6892 EOF
6893 }
6894
6895     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6896     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6897 echo "configure:6898: checking for \"FOR_MSW\" xpm" >&5
6898     xe_check_libs=-lXpm
6899     cat > conftest.$ac_ext <<EOF
6900 #line 6901 "configure"
6901 #include "confdefs.h"
6902
6903 int main() {
6904 XpmCreatePixmapFromData()
6905 ; return 0; }
6906 EOF
6907 if { (eval echo configure:6908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6908   rm -rf conftest*
6909   xpm_for_msw=no
6910 else
6911   echo "configure: failed program was:" >&5
6912   cat conftest.$ac_ext >&5
6913   rm -rf conftest*
6914   xpm_for_msw=yes
6915 fi
6916 rm -f conftest*
6917     xe_check_libs=
6918     echo "$ac_t""$xpm_for_msw" 1>&6
6919     if test "$xpm_for_msw" = "yes"; then
6920       { test "$extra_verbose" = "yes" && cat << \EOF
6921     Defining FOR_MSW
6922 EOF
6923 cat >> confdefs.h <<\EOF
6924 #define FOR_MSW 1
6925 EOF
6926 }
6927
6928     fi
6929   fi
6930
6931     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6932 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6933 echo "configure:6934: checking for compface.h" >&5
6934
6935 cat > conftest.$ac_ext <<EOF
6936 #line 6937 "configure"
6937 #include "confdefs.h"
6938 #include <compface.h>
6939 EOF
6940 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6941 { (eval echo configure:6942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6942 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6943 if test -z "$ac_err"; then
6944   rm -rf conftest*
6945   eval "ac_cv_header_$ac_safe=yes"
6946 else
6947   echo "$ac_err" >&5
6948   echo "configure: failed program was:" >&5
6949   cat conftest.$ac_ext >&5
6950   rm -rf conftest*
6951   eval "ac_cv_header_$ac_safe=no"
6952 fi
6953 rm -f conftest*
6954 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6955   echo "$ac_t""yes" 1>&6
6956   :
6957 else
6958   echo "$ac_t""no" 1>&6
6959 with_xface=no
6960 fi
6961  }
6962   test -z "$with_xface" && { 
6963 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6964 echo "configure:6965: checking for UnGenFace in -lcompface" >&5
6965 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6966
6967 xe_check_libs=" -lcompface "
6968 cat > conftest.$ac_ext <<EOF
6969 #line 6970 "configure"
6970 #include "confdefs.h"
6971 /* Override any gcc2 internal prototype to avoid an error.  */
6972 /* We use char because int might match the return type of a gcc2
6973     builtin and then its argument prototype would still apply.  */
6974 char UnGenFace();
6975
6976 int main() {
6977 UnGenFace()
6978 ; return 0; }
6979 EOF
6980 if { (eval echo configure:6981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6981   rm -rf conftest*
6982   eval "ac_cv_lib_$ac_lib_var=yes"
6983 else
6984   echo "configure: failed program was:" >&5
6985   cat conftest.$ac_ext >&5
6986   rm -rf conftest*
6987   eval "ac_cv_lib_$ac_lib_var=no"
6988 fi
6989 rm -f conftest*
6990 xe_check_libs=""
6991
6992 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6993   echo "$ac_t""yes" 1>&6
6994   : 
6995 else
6996   echo "$ac_t""no" 1>&6
6997 with_xface=no
6998 fi
6999
7000  }
7001   test -z "$with_xface" && with_xface=yes
7002   if test "$with_xface" = "yes"; then
7003     { test "$extra_verbose" = "yes" && cat << \EOF
7004     Defining HAVE_XFACE
7005 EOF
7006 cat >> confdefs.h <<\EOF
7007 #define HAVE_XFACE 1
7008 EOF
7009 }
7010
7011     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7012   fi
7013
7014         if test "$with_gif" != "no"; then
7015     with_gif="yes"
7016     { test "$extra_verbose" = "yes" && cat << \EOF
7017     Defining HAVE_GIF
7018 EOF
7019 cat >> confdefs.h <<\EOF
7020 #define HAVE_GIF 1
7021 EOF
7022 }
7023
7024     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
7025    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
7026  fi
7027   fi
7028
7029       if test "$with_png $with_tiff" != "no no"; then
7030     
7031 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
7032 echo "configure:7033: checking for inflate in -lc" >&5
7033 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
7034
7035 xe_check_libs=" -lc "
7036 cat > conftest.$ac_ext <<EOF
7037 #line 7038 "configure"
7038 #include "confdefs.h"
7039 /* Override any gcc2 internal prototype to avoid an error.  */
7040 /* We use char because int might match the return type of a gcc2
7041     builtin and then its argument prototype would still apply.  */
7042 char inflate();
7043
7044 int main() {
7045 inflate()
7046 ; return 0; }
7047 EOF
7048 if { (eval echo configure:7049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7049   rm -rf conftest*
7050   eval "ac_cv_lib_$ac_lib_var=yes"
7051 else
7052   echo "configure: failed program was:" >&5
7053   cat conftest.$ac_ext >&5
7054   rm -rf conftest*
7055   eval "ac_cv_lib_$ac_lib_var=no"
7056 fi
7057 rm -f conftest*
7058 xe_check_libs=""
7059
7060 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7061   echo "$ac_t""yes" 1>&6
7062   :
7063 else
7064   echo "$ac_t""no" 1>&6
7065
7066 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
7067 echo "configure:7068: checking for inflate in -lz" >&5
7068 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
7069
7070 xe_check_libs=" -lz "
7071 cat > conftest.$ac_ext <<EOF
7072 #line 7073 "configure"
7073 #include "confdefs.h"
7074 /* Override any gcc2 internal prototype to avoid an error.  */
7075 /* We use char because int might match the return type of a gcc2
7076     builtin and then its argument prototype would still apply.  */
7077 char inflate();
7078
7079 int main() {
7080 inflate()
7081 ; return 0; }
7082 EOF
7083 if { (eval echo configure:7084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7084   rm -rf conftest*
7085   eval "ac_cv_lib_$ac_lib_var=yes"
7086 else
7087   echo "configure: failed program was:" >&5
7088   cat conftest.$ac_ext >&5
7089   rm -rf conftest*
7090   eval "ac_cv_lib_$ac_lib_var=no"
7091 fi
7092 rm -f conftest*
7093 xe_check_libs=""
7094
7095 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7096   echo "$ac_t""yes" 1>&6
7097   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
7098 else
7099   echo "$ac_t""no" 1>&6
7100
7101 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
7102 echo "configure:7103: checking for inflate in -lgz" >&5
7103 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
7104
7105 xe_check_libs=" -lgz "
7106 cat > conftest.$ac_ext <<EOF
7107 #line 7108 "configure"
7108 #include "confdefs.h"
7109 /* Override any gcc2 internal prototype to avoid an error.  */
7110 /* We use char because int might match the return type of a gcc2
7111     builtin and then its argument prototype would still apply.  */
7112 char inflate();
7113
7114 int main() {
7115 inflate()
7116 ; return 0; }
7117 EOF
7118 if { (eval echo configure:7119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7119   rm -rf conftest*
7120   eval "ac_cv_lib_$ac_lib_var=yes"
7121 else
7122   echo "configure: failed program was:" >&5
7123   cat conftest.$ac_ext >&5
7124   rm -rf conftest*
7125   eval "ac_cv_lib_$ac_lib_var=no"
7126 fi
7127 rm -f conftest*
7128 xe_check_libs=""
7129
7130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7131   echo "$ac_t""yes" 1>&6
7132   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
7133 else
7134   echo "$ac_t""no" 1>&6
7135 fi
7136
7137
7138 fi
7139
7140
7141 fi
7142
7143
7144   fi
7145
7146     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
7147 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
7148 echo "configure:7149: checking for jpeglib.h" >&5
7149
7150 cat > conftest.$ac_ext <<EOF
7151 #line 7152 "configure"
7152 #include "confdefs.h"
7153 #include <jpeglib.h>
7154 EOF
7155 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7156 { (eval echo configure:7157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7157 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7158 if test -z "$ac_err"; then
7159   rm -rf conftest*
7160   eval "ac_cv_header_$ac_safe=yes"
7161 else
7162   echo "$ac_err" >&5
7163   echo "configure: failed program was:" >&5
7164   cat conftest.$ac_ext >&5
7165   rm -rf conftest*
7166   eval "ac_cv_header_$ac_safe=no"
7167 fi
7168 rm -f conftest*
7169 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7170   echo "$ac_t""yes" 1>&6
7171   :
7172 else
7173   echo "$ac_t""no" 1>&6
7174 with_jpeg=no
7175 fi
7176  }
7177   test -z "$with_jpeg" && { 
7178 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7179 echo "configure:7180: checking for jpeg_destroy_decompress in -ljpeg" >&5
7180 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7181
7182 xe_check_libs=" -ljpeg "
7183 cat > conftest.$ac_ext <<EOF
7184 #line 7185 "configure"
7185 #include "confdefs.h"
7186 /* Override any gcc2 internal prototype to avoid an error.  */
7187 /* We use char because int might match the return type of a gcc2
7188     builtin and then its argument prototype would still apply.  */
7189 char jpeg_destroy_decompress();
7190
7191 int main() {
7192 jpeg_destroy_decompress()
7193 ; return 0; }
7194 EOF
7195 if { (eval echo configure:7196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7196   rm -rf conftest*
7197   eval "ac_cv_lib_$ac_lib_var=yes"
7198 else
7199   echo "configure: failed program was:" >&5
7200   cat conftest.$ac_ext >&5
7201   rm -rf conftest*
7202   eval "ac_cv_lib_$ac_lib_var=no"
7203 fi
7204 rm -f conftest*
7205 xe_check_libs=""
7206
7207 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7208   echo "$ac_t""yes" 1>&6
7209   :
7210 else
7211   echo "$ac_t""no" 1>&6
7212 with_jpeg=no
7213 fi
7214
7215  }
7216   test -z "$with_jpeg" && with_jpeg=yes
7217   if test "$with_jpeg" = "yes"; then
7218     { test "$extra_verbose" = "yes" && cat << \EOF
7219     Defining HAVE_JPEG
7220 EOF
7221 cat >> confdefs.h <<\EOF
7222 #define HAVE_JPEG 1
7223 EOF
7224 }
7225
7226     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7227   fi
7228
7229     png_problem=""
7230   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7231 echo "configure:7232: checking for pow" >&5
7232
7233 cat > conftest.$ac_ext <<EOF
7234 #line 7235 "configure"
7235 #include "confdefs.h"
7236 /* System header to define __stub macros and hopefully few prototypes,
7237     which can conflict with char pow(); below.  */
7238 #include <assert.h>
7239 /* Override any gcc2 internal prototype to avoid an error.  */
7240 /* We use char because int might match the return type of a gcc2
7241     builtin and then its argument prototype would still apply.  */
7242 char pow();
7243
7244 int main() {
7245
7246 /* The GNU C library defines this for functions which it implements
7247     to always fail with ENOSYS.  Some functions are actually named
7248     something starting with __ and the normal name is an alias.  */
7249 #if defined (__stub_pow) || defined (__stub___pow)
7250 choke me
7251 #else
7252 pow();
7253 #endif
7254
7255 ; return 0; }
7256 EOF
7257 if { (eval echo configure:7258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7258   rm -rf conftest*
7259   eval "ac_cv_func_pow=yes"
7260 else
7261   echo "configure: failed program was:" >&5
7262   cat conftest.$ac_ext >&5
7263   rm -rf conftest*
7264   eval "ac_cv_func_pow=no"
7265 fi
7266 rm -f conftest*
7267
7268 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7269   echo "$ac_t""yes" 1>&6
7270   :
7271 else
7272   echo "$ac_t""no" 1>&6
7273 with_png=no
7274 fi
7275  }
7276   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7277 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7278 echo "configure:7279: checking for png.h" >&5
7279
7280 cat > conftest.$ac_ext <<EOF
7281 #line 7282 "configure"
7282 #include "confdefs.h"
7283 #include <png.h>
7284 EOF
7285 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7286 { (eval echo configure:7287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7287 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7288 if test -z "$ac_err"; then
7289   rm -rf conftest*
7290   eval "ac_cv_header_$ac_safe=yes"
7291 else
7292   echo "$ac_err" >&5
7293   echo "configure: failed program was:" >&5
7294   cat conftest.$ac_ext >&5
7295   rm -rf conftest*
7296   eval "ac_cv_header_$ac_safe=no"
7297 fi
7298 rm -f conftest*
7299 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7300   echo "$ac_t""yes" 1>&6
7301   :
7302 else
7303   echo "$ac_t""no" 1>&6
7304 with_png=no
7305 fi
7306  }
7307   test -z "$with_png" && { 
7308 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7309 echo "configure:7310: checking for png_read_image in -lpng" >&5
7310 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7311
7312 xe_check_libs=" -lpng "
7313 cat > conftest.$ac_ext <<EOF
7314 #line 7315 "configure"
7315 #include "confdefs.h"
7316 /* Override any gcc2 internal prototype to avoid an error.  */
7317 /* We use char because int might match the return type of a gcc2
7318     builtin and then its argument prototype would still apply.  */
7319 char png_read_image();
7320
7321 int main() {
7322 png_read_image()
7323 ; return 0; }
7324 EOF
7325 if { (eval echo configure:7326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7326   rm -rf conftest*
7327   eval "ac_cv_lib_$ac_lib_var=yes"
7328 else
7329   echo "configure: failed program was:" >&5
7330   cat conftest.$ac_ext >&5
7331   rm -rf conftest*
7332   eval "ac_cv_lib_$ac_lib_var=no"
7333 fi
7334 rm -f conftest*
7335 xe_check_libs=""
7336
7337 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7338   echo "$ac_t""yes" 1>&6
7339   :
7340 else
7341   echo "$ac_t""no" 1>&6
7342 with_png=no
7343 fi
7344
7345  }
7346   if test -z "$with_png"; then
7347     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7348 echo "configure:7349: checking for workable png version information" >&5
7349     xe_check_libs="-lpng -lz"
7350     cat > conftest.$ac_ext <<EOF
7351 #line 7352 "configure"
7352 #include "confdefs.h"
7353 #include <png.h>
7354     int main(int c, char **v) {
7355     if (c == 1) return 0;
7356     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7357     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7358 EOF
7359 if { (eval echo configure:7360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7360 then
7361   ./conftest dummy_arg; png_status=$?;
7362       if test "$png_status" = "0"; then
7363         with_png=yes;
7364       else
7365         with_png=no;
7366         if test "$png_status" = "1"; then
7367           png_problem="PNG library version and header file don't match!"
7368         elif test "$png_status" = "2"; then
7369           png_problem="PNG library version too old (pre 1.0.2)!"
7370         fi
7371         echo "
7372 *** WARNING *** $png_problem
7373   I'm not touching that with a 10-foot pole!
7374   If you really want to use the installed version of libPNG, rerun
7375   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7376     fi
7377 else
7378   conftest_rc="$?"
7379   echo "configure: failed program was:" >&5
7380   cat conftest.$ac_ext >&5
7381   rm -fr conftest*
7382   with_png=no
7383 fi
7384 rm -fr conftest*
7385     xe_check_libs=
7386     echo "$ac_t""$with_png" 1>&6
7387   fi
7388   if test "$with_png" = "yes"; then
7389     { test "$extra_verbose" = "yes" && cat << \EOF
7390     Defining HAVE_PNG
7391 EOF
7392 cat >> confdefs.h <<\EOF
7393 #define HAVE_PNG 1
7394 EOF
7395 }
7396
7397     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7398   fi
7399
7400     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7401 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7402 echo "configure:7403: checking for tiffio.h" >&5
7403
7404 cat > conftest.$ac_ext <<EOF
7405 #line 7406 "configure"
7406 #include "confdefs.h"
7407 #include <tiffio.h>
7408 EOF
7409 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7410 { (eval echo configure:7411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7411 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7412 if test -z "$ac_err"; then
7413   rm -rf conftest*
7414   eval "ac_cv_header_$ac_safe=yes"
7415 else
7416   echo "$ac_err" >&5
7417   echo "configure: failed program was:" >&5
7418   cat conftest.$ac_ext >&5
7419   rm -rf conftest*
7420   eval "ac_cv_header_$ac_safe=no"
7421 fi
7422 rm -f conftest*
7423 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7424   echo "$ac_t""yes" 1>&6
7425   :
7426 else
7427   echo "$ac_t""no" 1>&6
7428 with_tiff=no
7429 fi
7430  }
7431   test -z "$with_tiff" && { 
7432 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7433 echo "configure:7434: checking for TIFFClientOpen in -ltiff" >&5
7434 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7435
7436 xe_check_libs=" -ltiff "
7437 cat > conftest.$ac_ext <<EOF
7438 #line 7439 "configure"
7439 #include "confdefs.h"
7440 /* Override any gcc2 internal prototype to avoid an error.  */
7441 /* We use char because int might match the return type of a gcc2
7442     builtin and then its argument prototype would still apply.  */
7443 char TIFFClientOpen();
7444
7445 int main() {
7446 TIFFClientOpen()
7447 ; return 0; }
7448 EOF
7449 if { (eval echo configure:7450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7450   rm -rf conftest*
7451   eval "ac_cv_lib_$ac_lib_var=yes"
7452 else
7453   echo "configure: failed program was:" >&5
7454   cat conftest.$ac_ext >&5
7455   rm -rf conftest*
7456   eval "ac_cv_lib_$ac_lib_var=no"
7457 fi
7458 rm -f conftest*
7459 xe_check_libs=""
7460
7461 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7462   echo "$ac_t""yes" 1>&6
7463   :
7464 else
7465   echo "$ac_t""no" 1>&6
7466 with_tiff=no
7467 fi
7468
7469  }
7470   test -z "$with_tiff" && with_tiff=yes
7471   if test "$with_tiff" = "yes"; then
7472     { test "$extra_verbose" = "yes" && cat << \EOF
7473     Defining HAVE_TIFF
7474 EOF
7475 cat >> confdefs.h <<\EOF
7476 #define HAVE_TIFF 1
7477 EOF
7478 }
7479
7480     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7481   fi
7482 fi
7483
7484
7485 if test "$with_x11" = "yes"; then
7486
7487   echo "checking for X11 graphics libraries" 1>&6
7488 echo "configure:7489: checking for X11 graphics libraries" >&5
7489
7490     
7491 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7492 echo "configure:7493: checking for XawScrollbarSetThumb in -lXaw" >&5
7493 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7494
7495 xe_check_libs=" -lXaw "
7496 cat > conftest.$ac_ext <<EOF
7497 #line 7498 "configure"
7498 #include "confdefs.h"
7499 /* Override any gcc2 internal prototype to avoid an error.  */
7500 /* We use char because int might match the return type of a gcc2
7501     builtin and then its argument prototype would still apply.  */
7502 char XawScrollbarSetThumb();
7503
7504 int main() {
7505 XawScrollbarSetThumb()
7506 ; return 0; }
7507 EOF
7508 if { (eval echo configure:7509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7509   rm -rf conftest*
7510   eval "ac_cv_lib_$ac_lib_var=yes"
7511 else
7512   echo "configure: failed program was:" >&5
7513   cat conftest.$ac_ext >&5
7514   rm -rf conftest*
7515   eval "ac_cv_lib_$ac_lib_var=no"
7516 fi
7517 rm -f conftest*
7518 xe_check_libs=""
7519
7520 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7521   echo "$ac_t""yes" 1>&6
7522   have_xaw=yes
7523 else
7524   echo "$ac_t""no" 1>&6
7525 have_xaw=no
7526 fi
7527
7528
7529                     
7530     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7531 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7532 echo "configure:7533: checking for Xm/Xm.h" >&5
7533
7534 cat > conftest.$ac_ext <<EOF
7535 #line 7536 "configure"
7536 #include "confdefs.h"
7537 #include <Xm/Xm.h>
7538 EOF
7539 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7540 { (eval echo configure:7541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7541 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7542 if test -z "$ac_err"; then
7543   rm -rf conftest*
7544   eval "ac_cv_header_$ac_safe=yes"
7545 else
7546   echo "$ac_err" >&5
7547   echo "configure: failed program was:" >&5
7548   cat conftest.$ac_ext >&5
7549   rm -rf conftest*
7550   eval "ac_cv_header_$ac_safe=no"
7551 fi
7552 rm -f conftest*
7553 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7554   echo "$ac_t""yes" 1>&6
7555   
7556 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7557 echo "configure:7558: checking for XmStringFree in -lXm" >&5
7558 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7559
7560 xe_check_libs=" -lXm "
7561 cat > conftest.$ac_ext <<EOF
7562 #line 7563 "configure"
7563 #include "confdefs.h"
7564 /* Override any gcc2 internal prototype to avoid an error.  */
7565 /* We use char because int might match the return type of a gcc2
7566     builtin and then its argument prototype would still apply.  */
7567 char XmStringFree();
7568
7569 int main() {
7570 XmStringFree()
7571 ; return 0; }
7572 EOF
7573 if { (eval echo configure:7574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7574   rm -rf conftest*
7575   eval "ac_cv_lib_$ac_lib_var=yes"
7576 else
7577   echo "configure: failed program was:" >&5
7578   cat conftest.$ac_ext >&5
7579   rm -rf conftest*
7580   eval "ac_cv_lib_$ac_lib_var=no"
7581 fi
7582 rm -f conftest*
7583 xe_check_libs=""
7584
7585 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7586   echo "$ac_t""yes" 1>&6
7587   have_motif=yes
7588 else
7589   echo "$ac_t""no" 1>&6
7590 have_motif=no
7591 fi
7592
7593
7594 else
7595   echo "$ac_t""no" 1>&6
7596 have_motif=no
7597 fi
7598
7599
7600   if test "$have_motif" = "yes"; then
7601         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7602 echo "configure:7603: checking for Lesstif" >&5
7603     cat > conftest.$ac_ext <<EOF
7604 #line 7605 "configure"
7605 #include "confdefs.h"
7606 #include <Xm/Xm.h>
7607 #ifdef LESSTIF_VERSION
7608 yes
7609 #endif
7610
7611 EOF
7612 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7613   egrep "yes" >/dev/null 2>&1; then
7614   rm -rf conftest*
7615   have_lesstif=yes
7616 else
7617   rm -rf conftest*
7618   have_lesstif=no
7619 fi
7620 rm -f conftest*
7621
7622   echo "$ac_t""$have_lesstif" 1>&6
7623   fi
7624
7625 fi 
7626
7627 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7628   with_menubars="lucid" ;;
7629 esac
7630 case "$with_dialogs" in "" | "yes" | "lucid" )
7631   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7632   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7633   else with_dialogs=no
7634   fi ;;
7635 esac
7636 case "$with_scrollbars" in "" | "yes" )
7637   with_scrollbars="lucid" ;;
7638 esac
7639 case "$with_widgets" in "" | "yes" )
7640   if   test "$have_motif" = "yes"; then with_widgets="motif"
7641   else with_widgets=no
7642   fi ;;
7643 esac
7644
7645 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
7646
7647 case "$all_widgets" in *athena* )
7648   { test "$extra_verbose" = "yes" && cat << \EOF
7649     Defining LWLIB_USES_ATHENA
7650 EOF
7651 cat >> confdefs.h <<\EOF
7652 #define LWLIB_USES_ATHENA 1
7653 EOF
7654 }
7655
7656   { test "$extra_verbose" = "yes" && cat << \EOF
7657     Defining NEED_ATHENA
7658 EOF
7659 cat >> confdefs.h <<\EOF
7660 #define NEED_ATHENA 1
7661 EOF
7662 }
7663
7664   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7665   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7666 esac
7667
7668 case "$all_widgets" in *motif* )
7669   { test "$extra_verbose" = "yes" && cat << \EOF
7670     Defining LWLIB_USES_MOTIF
7671 EOF
7672 cat >> confdefs.h <<\EOF
7673 #define LWLIB_USES_MOTIF 1
7674 EOF
7675 }
7676
7677   { test "$extra_verbose" = "yes" && cat << \EOF
7678     Defining NEED_MOTIF
7679 EOF
7680 cat >> confdefs.h <<\EOF
7681 #define NEED_MOTIF 1
7682 EOF
7683 }
7684
7685   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7686   need_motif=yes ;;
7687 esac
7688
7689 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7690 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7691 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7692 case "$all_widgets" in *lucid* )
7693   { test "$extra_verbose" = "yes" && cat << \EOF
7694     Defining NEED_LUCID
7695 EOF
7696 cat >> confdefs.h <<\EOF
7697 #define NEED_LUCID 1
7698 EOF
7699 }
7700
7701   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7702 esac
7703
7704
7705
7706 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7707     Defining LWLIB_SCROLLBARS_ATHENA
7708 EOF
7709 cat >> confdefs.h <<\EOF
7710 #define LWLIB_SCROLLBARS_ATHENA 1
7711 EOF
7712 }
7713 ;; esac
7714 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7715     Defining LWLIB_DIALOGS_ATHENA
7716 EOF
7717 cat >> confdefs.h <<\EOF
7718 #define LWLIB_DIALOGS_ATHENA 1
7719 EOF
7720 }
7721    ;; esac
7722 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7723     Defining LWLIB_SCROLLBARS_ATHENA3D
7724 EOF
7725 cat >> confdefs.h <<\EOF
7726 #define LWLIB_SCROLLBARS_ATHENA3D 1
7727 EOF
7728 }
7729
7730 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7731     Defining LWLIB_DIALOGS_ATHENA3D
7732 EOF
7733 cat >> confdefs.h <<\EOF
7734 #define LWLIB_DIALOGS_ATHENA3D 1
7735 EOF
7736 }
7737
7738
7739 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7740     Defining HAVE_MENUBARS
7741 EOF
7742 cat >> confdefs.h <<\EOF
7743 #define HAVE_MENUBARS 1
7744 EOF
7745 }
7746
7747 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7748     Defining HAVE_SCROLLBARS
7749 EOF
7750 cat >> confdefs.h <<\EOF
7751 #define HAVE_SCROLLBARS 1
7752 EOF
7753 }
7754
7755 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7756     Defining HAVE_DIALOGS
7757 EOF
7758 cat >> confdefs.h <<\EOF
7759 #define HAVE_DIALOGS 1
7760 EOF
7761 }
7762
7763 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7764     Defining HAVE_TOOLBARS
7765 EOF
7766 cat >> confdefs.h <<\EOF
7767 #define HAVE_TOOLBARS 1
7768 EOF
7769 }
7770
7771
7772 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7773     Defining LWLIB_MENUBARS_LUCID
7774 EOF
7775 cat >> confdefs.h <<\EOF
7776 #define LWLIB_MENUBARS_LUCID 1
7777 EOF
7778 }
7779
7780 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7781     Defining LWLIB_SCROLLBARS_LUCID
7782 EOF
7783 cat >> confdefs.h <<\EOF
7784 #define LWLIB_SCROLLBARS_LUCID 1
7785 EOF
7786 }
7787
7788
7789 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7790     Defining LWLIB_MENUBARS_MOTIF
7791 EOF
7792 cat >> confdefs.h <<\EOF
7793 #define LWLIB_MENUBARS_MOTIF 1
7794 EOF
7795 }
7796
7797 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7798     Defining LWLIB_SCROLLBARS_MOTIF
7799 EOF
7800 cat >> confdefs.h <<\EOF
7801 #define LWLIB_SCROLLBARS_MOTIF 1
7802 EOF
7803 }
7804
7805 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7806     Defining LWLIB_DIALOGS_MOTIF
7807 EOF
7808 cat >> confdefs.h <<\EOF
7809 #define LWLIB_DIALOGS_MOTIF 1
7810 EOF
7811 }
7812
7813
7814 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7815    echo "    xemacs will be linked with \"menubar.o\""
7816  fi
7817 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7818    echo "    xemacs will be linked with \"scrollbar.o\""
7819  fi
7820 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7821    echo "    xemacs will be linked with \"dialog.o\""
7822  fi
7823 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7824    echo "    xemacs will be linked with \"toolbar.o\""
7825  fi
7826
7827 if test "$with_x11" = "yes"; then
7828   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7829    echo "    xemacs will be linked with \"menubar-x.o\""
7830  fi
7831   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7832    echo "    xemacs will be linked with \"scrollbar-x.o\""
7833  fi
7834   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7835    echo "    xemacs will be linked with \"dialog-x.o\""
7836  fi
7837   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7838    echo "    xemacs will be linked with \"toolbar-x.o\""
7839  fi
7840   test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7841    echo "    xemacs will be linked with \"gui-x.o\""
7842  fi
7843 else
7844   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7845     echo "Attempt to Build NAS sound without X"
7846     echo "Please remove NAS configuration or build with X"
7847     exit 1
7848   fi
7849 fi
7850
7851
7852 test -z "$with_mule" && with_mule=no
7853 test -z "$with_file_coding" && with_file_coding=no
7854
7855
7856 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7857   { test "$extra_verbose" = "yes" && cat << \EOF
7858     Defining FILE_CODING
7859 EOF
7860 cat >> confdefs.h <<\EOF
7861 #define FILE_CODING 1
7862 EOF
7863 }
7864
7865   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7866    echo "    xemacs will be linked with \"file-coding.o\""
7867  fi
7868 fi
7869
7870 if test "$with_mule" = "yes" ; then
7871   echo "checking for Mule-related features" 1>&6
7872 echo "configure:7873: checking for Mule-related features" >&5
7873   { test "$extra_verbose" = "yes" && cat << \EOF
7874     Defining MULE
7875 EOF
7876 cat >> confdefs.h <<\EOF
7877 #define MULE 1
7878 EOF
7879 }
7880
7881   { test "$extra_verbose" = "yes" && cat << \EOF
7882     Defining FILE_CODING
7883 EOF
7884 cat >> confdefs.h <<\EOF
7885 #define FILE_CODING 1
7886 EOF
7887 }
7888
7889   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7890    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7891  fi
7892
7893     for ac_hdr in libintl.h
7894 do
7895 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7896 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7897 echo "configure:7898: checking for $ac_hdr" >&5
7898
7899 cat > conftest.$ac_ext <<EOF
7900 #line 7901 "configure"
7901 #include "confdefs.h"
7902 #include <$ac_hdr>
7903 EOF
7904 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7905 { (eval echo configure:7906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7906 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7907 if test -z "$ac_err"; then
7908   rm -rf conftest*
7909   eval "ac_cv_header_$ac_safe=yes"
7910 else
7911   echo "$ac_err" >&5
7912   echo "configure: failed program was:" >&5
7913   cat conftest.$ac_ext >&5
7914   rm -rf conftest*
7915   eval "ac_cv_header_$ac_safe=no"
7916 fi
7917 rm -f conftest*
7918 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7919   echo "$ac_t""yes" 1>&6
7920     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7921   { test "$extra_verbose" = "yes" && cat << EOF
7922     Defining $ac_tr_hdr
7923 EOF
7924 cat >> confdefs.h <<EOF
7925 #define $ac_tr_hdr 1
7926 EOF
7927 }
7928  
7929 else
7930   echo "$ac_t""no" 1>&6
7931 fi
7932 done
7933
7934   
7935 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7936 echo "configure:7937: checking for strerror in -lintl" >&5
7937 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7938
7939 xe_check_libs=" -lintl "
7940 cat > conftest.$ac_ext <<EOF
7941 #line 7942 "configure"
7942 #include "confdefs.h"
7943 /* Override any gcc2 internal prototype to avoid an error.  */
7944 /* We use char because int might match the return type of a gcc2
7945     builtin and then its argument prototype would still apply.  */
7946 char strerror();
7947
7948 int main() {
7949 strerror()
7950 ; return 0; }
7951 EOF
7952 if { (eval echo configure:7953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7953   rm -rf conftest*
7954   eval "ac_cv_lib_$ac_lib_var=yes"
7955 else
7956   echo "configure: failed program was:" >&5
7957   cat conftest.$ac_ext >&5
7958   rm -rf conftest*
7959   eval "ac_cv_lib_$ac_lib_var=no"
7960 fi
7961 rm -f conftest*
7962 xe_check_libs=""
7963
7964 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7965   echo "$ac_t""yes" 1>&6
7966     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7967     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7968   { test "$extra_verbose" = "yes" && cat << EOF
7969     Defining $ac_tr_lib
7970 EOF
7971 cat >> confdefs.h <<EOF
7972 #define $ac_tr_lib 1
7973 EOF
7974 }
7975
7976   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7977
7978 else
7979   echo "$ac_t""no" 1>&6
7980 fi
7981
7982
7983
7984   echo "checking for Mule input methods" 1>&6
7985 echo "configure:7986: checking for Mule input methods" >&5
7986         case "$with_xim" in "" | "yes" )
7987     echo "checking for XIM" 1>&6
7988 echo "configure:7989: checking for XIM" >&5
7989     
7990 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
7991 echo "configure:7992: checking for XOpenIM in -lX11" >&5
7992 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
7993
7994 xe_check_libs=" -lX11 "
7995 cat > conftest.$ac_ext <<EOF
7996 #line 7997 "configure"
7997 #include "confdefs.h"
7998 /* Override any gcc2 internal prototype to avoid an error.  */
7999 /* We use char because int might match the return type of a gcc2
8000     builtin and then its argument prototype would still apply.  */
8001 char XOpenIM();
8002
8003 int main() {
8004 XOpenIM()
8005 ; return 0; }
8006 EOF
8007 if { (eval echo configure:8008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8008   rm -rf conftest*
8009   eval "ac_cv_lib_$ac_lib_var=yes"
8010 else
8011   echo "configure: failed program was:" >&5
8012   cat conftest.$ac_ext >&5
8013   rm -rf conftest*
8014   eval "ac_cv_lib_$ac_lib_var=no"
8015 fi
8016 rm -f conftest*
8017 xe_check_libs=""
8018
8019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8020   echo "$ac_t""yes" 1>&6
8021   with_xim=xlib
8022 else
8023   echo "$ac_t""no" 1>&6
8024 with_xim=no
8025 fi
8026
8027
8028         if test "$have_motif $have_lesstif" = "yes no"; then
8029       
8030 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
8031 echo "configure:8032: checking for XmImMbLookupString in -lXm" >&5
8032 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
8033
8034 xe_check_libs=" -lXm "
8035 cat > conftest.$ac_ext <<EOF
8036 #line 8037 "configure"
8037 #include "confdefs.h"
8038 /* Override any gcc2 internal prototype to avoid an error.  */
8039 /* We use char because int might match the return type of a gcc2
8040     builtin and then its argument prototype would still apply.  */
8041 char XmImMbLookupString();
8042
8043 int main() {
8044 XmImMbLookupString()
8045 ; return 0; }
8046 EOF
8047 if { (eval echo configure:8048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8048   rm -rf conftest*
8049   eval "ac_cv_lib_$ac_lib_var=yes"
8050 else
8051   echo "configure: failed program was:" >&5
8052   cat conftest.$ac_ext >&5
8053   rm -rf conftest*
8054   eval "ac_cv_lib_$ac_lib_var=no"
8055 fi
8056 rm -f conftest*
8057 xe_check_libs=""
8058
8059 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8060   echo "$ac_t""yes" 1>&6
8061   with_xim=motif
8062 else
8063   echo "$ac_t""no" 1>&6
8064 fi
8065
8066
8067     fi ;;
8068   esac
8069   if test "$with_xim" != "no"; then
8070     { test "$extra_verbose" = "yes" && cat << \EOF
8071     Defining HAVE_XIM
8072 EOF
8073 cat >> confdefs.h <<\EOF
8074 #define HAVE_XIM 1
8075 EOF
8076 }
8077
8078     if test "$with_xim" = "xlib"; then
8079       { test "$extra_verbose" = "yes" && cat << \EOF
8080     Defining XIM_XLIB
8081 EOF
8082 cat >> confdefs.h <<\EOF
8083 #define XIM_XLIB 1
8084 EOF
8085 }
8086
8087       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
8088    echo "    xemacs will be linked with \"input-method-xlib.o\""
8089  fi
8090     fi
8091     if test "$with_xim" = "motif"; then
8092       { test "$extra_verbose" = "yes" && cat << \EOF
8093     Defining XIM_MOTIF
8094 EOF
8095 cat >> confdefs.h <<\EOF
8096 #define XIM_MOTIF 1
8097 EOF
8098 }
8099
8100       need_motif=yes
8101       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
8102    echo "    xemacs will be linked with \"input-method-motif.o\""
8103  fi
8104     fi
8105     if test "$with_xim" = "motif"; then
8106       with_xfs=no
8107     fi
8108   fi
8109
8110     if test "$with_xfs" = "yes" ; then
8111     echo "checking for XFontSet" 1>&6
8112 echo "configure:8113: checking for XFontSet" >&5
8113     
8114 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
8115 echo "configure:8116: checking for XmbDrawString in -lX11" >&5
8116 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
8117
8118 xe_check_libs=" -lX11 "
8119 cat > conftest.$ac_ext <<EOF
8120 #line 8121 "configure"
8121 #include "confdefs.h"
8122 /* Override any gcc2 internal prototype to avoid an error.  */
8123 /* We use char because int might match the return type of a gcc2
8124     builtin and then its argument prototype would still apply.  */
8125 char XmbDrawString();
8126
8127 int main() {
8128 XmbDrawString()
8129 ; return 0; }
8130 EOF
8131 if { (eval echo configure:8132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8132   rm -rf conftest*
8133   eval "ac_cv_lib_$ac_lib_var=yes"
8134 else
8135   echo "configure: failed program was:" >&5
8136   cat conftest.$ac_ext >&5
8137   rm -rf conftest*
8138   eval "ac_cv_lib_$ac_lib_var=no"
8139 fi
8140 rm -f conftest*
8141 xe_check_libs=""
8142
8143 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8144   echo "$ac_t""yes" 1>&6
8145   :
8146 else
8147   echo "$ac_t""no" 1>&6
8148 with_xfs=no
8149 fi
8150
8151
8152     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
8153       { test "$extra_verbose" = "yes" && cat << \EOF
8154     Defining USE_XFONTSET
8155 EOF
8156 cat >> confdefs.h <<\EOF
8157 #define USE_XFONTSET 1
8158 EOF
8159 }
8160
8161       if test "$with_xim" = "no" ; then
8162         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
8163    echo "    xemacs will be linked with \"input-method-xfs.o\""
8164  fi
8165       fi
8166     fi
8167   fi 
8168     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
8169   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
8170 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
8171 echo "configure:8172: checking for wnn/jllib.h" >&5
8172
8173 cat > conftest.$ac_ext <<EOF
8174 #line 8175 "configure"
8175 #include "confdefs.h"
8176 #include <wnn/jllib.h>
8177 EOF
8178 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8179 { (eval echo configure:8180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8180 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8181 if test -z "$ac_err"; then
8182   rm -rf conftest*
8183   eval "ac_cv_header_$ac_safe=yes"
8184 else
8185   echo "$ac_err" >&5
8186   echo "configure: failed program was:" >&5
8187   cat conftest.$ac_ext >&5
8188   rm -rf conftest*
8189   eval "ac_cv_header_$ac_safe=no"
8190 fi
8191 rm -f conftest*
8192 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8193   echo "$ac_t""yes" 1>&6
8194   :
8195 else
8196   echo "$ac_t""no" 1>&6
8197 with_wnn=no
8198 fi
8199  }
8200     if test "$with_wnn" != "no"; then
8201     for ac_func in crypt
8202 do
8203 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8204 echo "configure:8205: checking for $ac_func" >&5
8205
8206 cat > conftest.$ac_ext <<EOF
8207 #line 8208 "configure"
8208 #include "confdefs.h"
8209 /* System header to define __stub macros and hopefully few prototypes,
8210     which can conflict with char $ac_func(); below.  */
8211 #include <assert.h>
8212 /* Override any gcc2 internal prototype to avoid an error.  */
8213 /* We use char because int might match the return type of a gcc2
8214     builtin and then its argument prototype would still apply.  */
8215 char $ac_func();
8216
8217 int main() {
8218
8219 /* The GNU C library defines this for functions which it implements
8220     to always fail with ENOSYS.  Some functions are actually named
8221     something starting with __ and the normal name is an alias.  */
8222 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8223 choke me
8224 #else
8225 $ac_func();
8226 #endif
8227
8228 ; return 0; }
8229 EOF
8230 if { (eval echo configure:8231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8231   rm -rf conftest*
8232   eval "ac_cv_func_$ac_func=yes"
8233 else
8234   echo "configure: failed program was:" >&5
8235   cat conftest.$ac_ext >&5
8236   rm -rf conftest*
8237   eval "ac_cv_func_$ac_func=no"
8238 fi
8239 rm -f conftest*
8240
8241 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8242   echo "$ac_t""yes" 1>&6
8243     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8244   { test "$extra_verbose" = "yes" && cat << EOF
8245     Defining $ac_tr_func
8246 EOF
8247 cat >> confdefs.h <<EOF
8248 #define $ac_tr_func 1
8249 EOF
8250 }
8251  
8252 else
8253   echo "$ac_t""no" 1>&6
8254 fi
8255 done
8256
8257     test "$ac_cv_func_crypt" != "yes" && { 
8258 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
8259 echo "configure:8260: checking for crypt in -lcrypt" >&5
8260 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
8261
8262 xe_check_libs=" -lcrypt "
8263 cat > conftest.$ac_ext <<EOF
8264 #line 8265 "configure"
8265 #include "confdefs.h"
8266 /* Override any gcc2 internal prototype to avoid an error.  */
8267 /* We use char because int might match the return type of a gcc2
8268     builtin and then its argument prototype would still apply.  */
8269 char crypt();
8270
8271 int main() {
8272 crypt()
8273 ; return 0; }
8274 EOF
8275 if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8276   rm -rf conftest*
8277   eval "ac_cv_lib_$ac_lib_var=yes"
8278 else
8279   echo "configure: failed program was:" >&5
8280   cat conftest.$ac_ext >&5
8281   rm -rf conftest*
8282   eval "ac_cv_lib_$ac_lib_var=no"
8283 fi
8284 rm -f conftest*
8285 xe_check_libs=""
8286
8287 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8288   echo "$ac_t""yes" 1>&6
8289     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8290     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8291   { test "$extra_verbose" = "yes" && cat << EOF
8292     Defining $ac_tr_lib
8293 EOF
8294 cat >> confdefs.h <<EOF
8295 #define $ac_tr_lib 1
8296 EOF
8297 }
8298
8299   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
8300
8301 else
8302   echo "$ac_t""no" 1>&6
8303 fi
8304
8305  }
8306   fi
8307     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8308     
8309 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8310 echo "configure:8311: checking for jl_dic_list_e in -lwnn" >&5
8311 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8312
8313 xe_check_libs=" -lwnn "
8314 cat > conftest.$ac_ext <<EOF
8315 #line 8316 "configure"
8316 #include "confdefs.h"
8317 /* Override any gcc2 internal prototype to avoid an error.  */
8318 /* We use char because int might match the return type of a gcc2
8319     builtin and then its argument prototype would still apply.  */
8320 char jl_dic_list_e();
8321
8322 int main() {
8323 jl_dic_list_e()
8324 ; return 0; }
8325 EOF
8326 if { (eval echo configure:8327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8327   rm -rf conftest*
8328   eval "ac_cv_lib_$ac_lib_var=yes"
8329 else
8330   echo "configure: failed program was:" >&5
8331   cat conftest.$ac_ext >&5
8332   rm -rf conftest*
8333   eval "ac_cv_lib_$ac_lib_var=no"
8334 fi
8335 rm -f conftest*
8336 xe_check_libs=""
8337
8338 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8339   echo "$ac_t""yes" 1>&6
8340   libwnn=wnn
8341 else
8342   echo "$ac_t""no" 1>&6
8343 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8344 echo "configure:8345: checking for jl_dic_list_e in -lwnn4" >&5
8345 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8346
8347 xe_check_libs=" -lwnn4 "
8348 cat > conftest.$ac_ext <<EOF
8349 #line 8350 "configure"
8350 #include "confdefs.h"
8351 /* Override any gcc2 internal prototype to avoid an error.  */
8352 /* We use char because int might match the return type of a gcc2
8353     builtin and then its argument prototype would still apply.  */
8354 char jl_dic_list_e();
8355
8356 int main() {
8357 jl_dic_list_e()
8358 ; return 0; }
8359 EOF
8360 if { (eval echo configure:8361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8361   rm -rf conftest*
8362   eval "ac_cv_lib_$ac_lib_var=yes"
8363 else
8364   echo "configure: failed program was:" >&5
8365   cat conftest.$ac_ext >&5
8366   rm -rf conftest*
8367   eval "ac_cv_lib_$ac_lib_var=no"
8368 fi
8369 rm -f conftest*
8370 xe_check_libs=""
8371
8372 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8373   echo "$ac_t""yes" 1>&6
8374   libwnn=wnn4
8375 else
8376   echo "$ac_t""no" 1>&6
8377 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8378 echo "configure:8379: checking for jl_dic_list_e in -lwnn6" >&5
8379 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8380
8381 xe_check_libs=" -lwnn6 "
8382 cat > conftest.$ac_ext <<EOF
8383 #line 8384 "configure"
8384 #include "confdefs.h"
8385 /* Override any gcc2 internal prototype to avoid an error.  */
8386 /* We use char because int might match the return type of a gcc2
8387     builtin and then its argument prototype would still apply.  */
8388 char jl_dic_list_e();
8389
8390 int main() {
8391 jl_dic_list_e()
8392 ; return 0; }
8393 EOF
8394 if { (eval echo configure:8395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8395   rm -rf conftest*
8396   eval "ac_cv_lib_$ac_lib_var=yes"
8397 else
8398   echo "configure: failed program was:" >&5
8399   cat conftest.$ac_ext >&5
8400   rm -rf conftest*
8401   eval "ac_cv_lib_$ac_lib_var=no"
8402 fi
8403 rm -f conftest*
8404 xe_check_libs=""
8405
8406 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8407   echo "$ac_t""yes" 1>&6
8408   libwnn=wnn6
8409 else
8410   echo "$ac_t""no" 1>&6
8411 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8412 echo "configure:8413: checking for dic_list_e in -lwnn6_fromsrc" >&5
8413 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8414
8415 xe_check_libs=" -lwnn6_fromsrc "
8416 cat > conftest.$ac_ext <<EOF
8417 #line 8418 "configure"
8418 #include "confdefs.h"
8419 /* Override any gcc2 internal prototype to avoid an error.  */
8420 /* We use char because int might match the return type of a gcc2
8421     builtin and then its argument prototype would still apply.  */
8422 char dic_list_e();
8423
8424 int main() {
8425 dic_list_e()
8426 ; return 0; }
8427 EOF
8428 if { (eval echo configure:8429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8429   rm -rf conftest*
8430   eval "ac_cv_lib_$ac_lib_var=yes"
8431 else
8432   echo "configure: failed program was:" >&5
8433   cat conftest.$ac_ext >&5
8434   rm -rf conftest*
8435   eval "ac_cv_lib_$ac_lib_var=no"
8436 fi
8437 rm -f conftest*
8438 xe_check_libs=""
8439
8440 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8441   echo "$ac_t""yes" 1>&6
8442   libwnn=wnn6_fromsrc
8443 else
8444   echo "$ac_t""no" 1>&6
8445 with_wnn=no
8446 fi
8447
8448
8449 fi
8450
8451
8452 fi
8453
8454
8455 fi
8456
8457
8458   fi
8459   test -z "$with_wnn" && with_wnn=yes
8460   if test "$with_wnn" = "yes"; then
8461     { test "$extra_verbose" = "yes" && cat << \EOF
8462     Defining HAVE_WNN
8463 EOF
8464 cat >> confdefs.h <<\EOF
8465 #define HAVE_WNN 1
8466 EOF
8467 }
8468
8469     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8470     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8471    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8472  fi
8473     if test "$with_wnn6" != "no"; then
8474       
8475 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8476 echo "configure:8477: checking for jl_fi_dic_list in -l$libwnn" >&5
8477 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8478
8479 xe_check_libs=" -l$libwnn "
8480 cat > conftest.$ac_ext <<EOF
8481 #line 8482 "configure"
8482 #include "confdefs.h"
8483 /* Override any gcc2 internal prototype to avoid an error.  */
8484 /* We use char because int might match the return type of a gcc2
8485     builtin and then its argument prototype would still apply.  */
8486 char jl_fi_dic_list();
8487
8488 int main() {
8489 jl_fi_dic_list()
8490 ; return 0; }
8491 EOF
8492 if { (eval echo configure:8493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8493   rm -rf conftest*
8494   eval "ac_cv_lib_$ac_lib_var=yes"
8495 else
8496   echo "configure: failed program was:" >&5
8497   cat conftest.$ac_ext >&5
8498   rm -rf conftest*
8499   eval "ac_cv_lib_$ac_lib_var=no"
8500 fi
8501 rm -f conftest*
8502 xe_check_libs=""
8503
8504 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8505   echo "$ac_t""yes" 1>&6
8506   with_wnn6=yes
8507 else
8508   echo "$ac_t""no" 1>&6
8509 fi
8510
8511
8512       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8513     Defining WNN6
8514 EOF
8515 cat >> confdefs.h <<\EOF
8516 #define WNN6 1
8517 EOF
8518 }
8519
8520     fi
8521   fi
8522
8523     canna_includes_found=no
8524   if test "$with_canna" != "no"; then
8525     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8526 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8527 echo "configure:8528: checking for canna/jrkanji.h" >&5
8528
8529 cat > conftest.$ac_ext <<EOF
8530 #line 8531 "configure"
8531 #include "confdefs.h"
8532 #include <canna/jrkanji.h>
8533 EOF
8534 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8535 { (eval echo configure:8536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8536 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8537 if test -z "$ac_err"; then
8538   rm -rf conftest*
8539   eval "ac_cv_header_$ac_safe=yes"
8540 else
8541   echo "$ac_err" >&5
8542   echo "configure: failed program was:" >&5
8543   cat conftest.$ac_ext >&5
8544   rm -rf conftest*
8545   eval "ac_cv_header_$ac_safe=no"
8546 fi
8547 rm -f conftest*
8548 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8549   echo "$ac_t""yes" 1>&6
8550   canna_includes_found=yes
8551 else
8552   echo "$ac_t""no" 1>&6
8553 fi
8554
8555   fi
8556   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8557       -d "/usr/local/canna/include"; then
8558     save_c_switch_site="$c_switch_site"
8559     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8560     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8561 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8562 echo "configure:8563: checking for canna/jrkanji.h" >&5
8563
8564 cat > conftest.$ac_ext <<EOF
8565 #line 8566 "configure"
8566 #include "confdefs.h"
8567 #include <canna/jrkanji.h>
8568 EOF
8569 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8570 { (eval echo configure:8571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8571 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8572 if test -z "$ac_err"; then
8573   rm -rf conftest*
8574   eval "ac_cv_header_$ac_safe=yes"
8575 else
8576   echo "$ac_err" >&5
8577   echo "configure: failed program was:" >&5
8578   cat conftest.$ac_ext >&5
8579   rm -rf conftest*
8580   eval "ac_cv_header_$ac_safe=no"
8581 fi
8582 rm -f conftest*
8583 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8584   echo "$ac_t""yes" 1>&6
8585   canna_includes_found=yes
8586 else
8587   echo "$ac_t""no" 1>&6
8588 fi
8589
8590     if test "$canna_includes_found" != "yes"; then
8591       c_switch_site="$save_c_switch_site"
8592       with_canna="no"
8593     fi
8594   fi
8595
8596   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8597 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8598 echo "configure:8599: checking for canna/RK.h" >&5
8599
8600 cat > conftest.$ac_ext <<EOF
8601 #line 8602 "configure"
8602 #include "confdefs.h"
8603 #include <canna/RK.h>
8604 EOF
8605 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8606 { (eval echo configure:8607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8607 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8608 if test -z "$ac_err"; then
8609   rm -rf conftest*
8610   eval "ac_cv_header_$ac_safe=yes"
8611 else
8612   echo "$ac_err" >&5
8613   echo "configure: failed program was:" >&5
8614   cat conftest.$ac_ext >&5
8615   rm -rf conftest*
8616   eval "ac_cv_header_$ac_safe=no"
8617 fi
8618 rm -f conftest*
8619 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8620   echo "$ac_t""yes" 1>&6
8621   :
8622 else
8623   echo "$ac_t""no" 1>&6
8624 with_canna=no
8625 fi
8626  }
8627   test -z "$with_canna" && { 
8628 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8629 echo "configure:8630: checking for RkBgnBun in -lRKC" >&5
8630 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8631
8632 xe_check_libs=" -lRKC "
8633 cat > conftest.$ac_ext <<EOF
8634 #line 8635 "configure"
8635 #include "confdefs.h"
8636 /* Override any gcc2 internal prototype to avoid an error.  */
8637 /* We use char because int might match the return type of a gcc2
8638     builtin and then its argument prototype would still apply.  */
8639 char RkBgnBun();
8640
8641 int main() {
8642 RkBgnBun()
8643 ; return 0; }
8644 EOF
8645 if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8646   rm -rf conftest*
8647   eval "ac_cv_lib_$ac_lib_var=yes"
8648 else
8649   echo "configure: failed program was:" >&5
8650   cat conftest.$ac_ext >&5
8651   rm -rf conftest*
8652   eval "ac_cv_lib_$ac_lib_var=no"
8653 fi
8654 rm -f conftest*
8655 xe_check_libs=""
8656
8657 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8658   echo "$ac_t""yes" 1>&6
8659   :
8660 else
8661   echo "$ac_t""no" 1>&6
8662 with_canna=no
8663 fi
8664
8665  }
8666   test -z "$with_canna" && { 
8667 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8668 echo "configure:8669: checking for jrKanjiControl in -lcanna" >&5
8669 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8670
8671 xe_check_libs=" -lcanna "
8672 cat > conftest.$ac_ext <<EOF
8673 #line 8674 "configure"
8674 #include "confdefs.h"
8675 /* Override any gcc2 internal prototype to avoid an error.  */
8676 /* We use char because int might match the return type of a gcc2
8677     builtin and then its argument prototype would still apply.  */
8678 char jrKanjiControl();
8679
8680 int main() {
8681 jrKanjiControl()
8682 ; return 0; }
8683 EOF
8684 if { (eval echo configure:8685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8685   rm -rf conftest*
8686   eval "ac_cv_lib_$ac_lib_var=yes"
8687 else
8688   echo "configure: failed program was:" >&5
8689   cat conftest.$ac_ext >&5
8690   rm -rf conftest*
8691   eval "ac_cv_lib_$ac_lib_var=no"
8692 fi
8693 rm -f conftest*
8694 xe_check_libs=""
8695
8696 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8697   echo "$ac_t""yes" 1>&6
8698   :
8699 else
8700   echo "$ac_t""no" 1>&6
8701 with_canna=no
8702 fi
8703
8704  }
8705   test -z "$with_canna" && with_canna=yes
8706   if test "$with_canna" = "yes"; then
8707     { test "$extra_verbose" = "yes" && cat << \EOF
8708     Defining HAVE_CANNA
8709 EOF
8710 cat >> confdefs.h <<\EOF
8711 #define HAVE_CANNA 1
8712 EOF
8713 }
8714
8715     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8716     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8717    echo "    xemacs will be linked with \"mule-canna.o\""
8718  fi
8719   fi
8720
8721 else   for feature in xim canna wnn; do
8722     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8723       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8724     fi
8725     eval "with_${feature}=no"
8726   done
8727 fi 
8728
8729 if test "$need_motif" = "yes" ; then
8730   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8731     
8732 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8733 echo "configure:8734: checking for layout_object_getvalue in -li18n" >&5
8734 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8735
8736 xe_check_libs=" -li18n "
8737 cat > conftest.$ac_ext <<EOF
8738 #line 8739 "configure"
8739 #include "confdefs.h"
8740 /* Override any gcc2 internal prototype to avoid an error.  */
8741 /* We use char because int might match the return type of a gcc2
8742     builtin and then its argument prototype would still apply.  */
8743 char layout_object_getvalue();
8744
8745 int main() {
8746 layout_object_getvalue()
8747 ; return 0; }
8748 EOF
8749 if { (eval echo configure:8750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8750   rm -rf conftest*
8751   eval "ac_cv_lib_$ac_lib_var=yes"
8752 else
8753   echo "configure: failed program was:" >&5
8754   cat conftest.$ac_ext >&5
8755   rm -rf conftest*
8756   eval "ac_cv_lib_$ac_lib_var=no"
8757 fi
8758 rm -f conftest*
8759 xe_check_libs=""
8760
8761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8762   echo "$ac_t""yes" 1>&6
8763   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8764 else
8765   echo "$ac_t""no" 1>&6
8766 fi
8767
8768
8769   
8770 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8771     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8772   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8773   
8774         runpath="" runpath_dirs=""
8775   if test -n "$LD_RUN_PATH"; then
8776     runpath="$LD_RUN_PATH"
8777   elif test "$GCC" = "yes"; then
8778         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8779     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8780     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8781     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8782       case "$arg" in P,* | -L* | -R* )
8783         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8784           {
8785 xe_runpath_dir="$dir"
8786   test "$xe_runpath_dir" != "/lib"     -a \
8787         "$xe_runpath_dir" != "/usr/lib" -a \
8788         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8789   eval "$xe_add_unique_runpath_dir"
8790 }
8791         done ;;
8792       esac
8793     done
8794     ld_switch_run="$ld_switch_run_save"
8795     rm -f conftest*
8796   else
8797         for arg in $ld_switch_site $ld_switch_x_site; do
8798       case "$arg" in -L*) {
8799 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8800   test "$xe_runpath_dir" != "/lib"     -a \
8801         "$xe_runpath_dir" != "/usr/lib" -a \
8802         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8803   eval "$xe_add_unique_runpath_dir"
8804 };; esac
8805     done
8806         if test "$opsys $need_motif" = "sol2 yes"; then
8807       xe_runpath_dir="/opt/SUNWdt/lib";
8808       eval "$xe_add_unique_runpath_dir";
8809     fi
8810   fi 
8811   if test -n "$runpath"; then
8812     ld_switch_run="${dash_r}${runpath}"
8813     
8814 if test "$GCC" = "yes"; then
8815   set x $ld_switch_run; shift; ld_switch_run=""
8816   while test -n "$1"; do
8817     case $1 in
8818       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8819       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8820       -Xlinker* ) ;;
8821       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8822     esac
8823     shift
8824   done
8825 fi
8826     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8827   fi
8828 fi
8829
8830 fi
8831
8832 for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf
8833 do
8834 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8835 echo "configure:8836: checking for $ac_func" >&5
8836
8837 cat > conftest.$ac_ext <<EOF
8838 #line 8839 "configure"
8839 #include "confdefs.h"
8840 /* System header to define __stub macros and hopefully few prototypes,
8841     which can conflict with char $ac_func(); below.  */
8842 #include <assert.h>
8843 /* Override any gcc2 internal prototype to avoid an error.  */
8844 /* We use char because int might match the return type of a gcc2
8845     builtin and then its argument prototype would still apply.  */
8846 char $ac_func();
8847
8848 int main() {
8849
8850 /* The GNU C library defines this for functions which it implements
8851     to always fail with ENOSYS.  Some functions are actually named
8852     something starting with __ and the normal name is an alias.  */
8853 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8854 choke me
8855 #else
8856 $ac_func();
8857 #endif
8858
8859 ; return 0; }
8860 EOF
8861 if { (eval echo configure:8862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8862   rm -rf conftest*
8863   eval "ac_cv_func_$ac_func=yes"
8864 else
8865   echo "configure: failed program was:" >&5
8866   cat conftest.$ac_ext >&5
8867   rm -rf conftest*
8868   eval "ac_cv_func_$ac_func=no"
8869 fi
8870 rm -f conftest*
8871
8872 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8873   echo "$ac_t""yes" 1>&6
8874     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8875   { test "$extra_verbose" = "yes" && cat << EOF
8876     Defining $ac_tr_func
8877 EOF
8878 cat >> confdefs.h <<EOF
8879 #define $ac_tr_func 1
8880 EOF
8881 }
8882  
8883 else
8884   echo "$ac_t""no" 1>&6
8885 fi
8886 done
8887
8888
8889
8890 case "$opsys" in
8891   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8892    echo "    xemacs will be linked with \"realpath.o\""
8893  fi ;;
8894   * )
8895     case "$canonical" in
8896       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8897    echo "    xemacs will be linked with \"realpath.o\""
8898  fi ;;
8899       * ) for ac_func in realpath
8900 do
8901 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8902 echo "configure:8903: checking for $ac_func" >&5
8903
8904 cat > conftest.$ac_ext <<EOF
8905 #line 8906 "configure"
8906 #include "confdefs.h"
8907 /* System header to define __stub macros and hopefully few prototypes,
8908     which can conflict with char $ac_func(); below.  */
8909 #include <assert.h>
8910 /* Override any gcc2 internal prototype to avoid an error.  */
8911 /* We use char because int might match the return type of a gcc2
8912     builtin and then its argument prototype would still apply.  */
8913 char $ac_func();
8914
8915 int main() {
8916
8917 /* The GNU C library defines this for functions which it implements
8918     to always fail with ENOSYS.  Some functions are actually named
8919     something starting with __ and the normal name is an alias.  */
8920 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8921 choke me
8922 #else
8923 $ac_func();
8924 #endif
8925
8926 ; return 0; }
8927 EOF
8928 if { (eval echo configure:8929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8929   rm -rf conftest*
8930   eval "ac_cv_func_$ac_func=yes"
8931 else
8932   echo "configure: failed program was:" >&5
8933   cat conftest.$ac_ext >&5
8934   rm -rf conftest*
8935   eval "ac_cv_func_$ac_func=no"
8936 fi
8937 rm -f conftest*
8938
8939 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8940   echo "$ac_t""yes" 1>&6
8941     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8942   { test "$extra_verbose" = "yes" && cat << EOF
8943     Defining $ac_tr_func
8944 EOF
8945 cat >> confdefs.h <<EOF
8946 #define $ac_tr_func 1
8947 EOF
8948 }
8949  
8950 else
8951   echo "$ac_t""no" 1>&6
8952 fi
8953 done
8954
8955           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8956    echo "    xemacs will be linked with \"realpath.o\""
8957  fi ;;
8958     esac ;;
8959 esac
8960
8961 for ac_func in getloadavg
8962 do
8963 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8964 echo "configure:8965: checking for $ac_func" >&5
8965
8966 cat > conftest.$ac_ext <<EOF
8967 #line 8968 "configure"
8968 #include "confdefs.h"
8969 /* System header to define __stub macros and hopefully few prototypes,
8970     which can conflict with char $ac_func(); below.  */
8971 #include <assert.h>
8972 /* Override any gcc2 internal prototype to avoid an error.  */
8973 /* We use char because int might match the return type of a gcc2
8974     builtin and then its argument prototype would still apply.  */
8975 char $ac_func();
8976
8977 int main() {
8978
8979 /* The GNU C library defines this for functions which it implements
8980     to always fail with ENOSYS.  Some functions are actually named
8981     something starting with __ and the normal name is an alias.  */
8982 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8983 choke me
8984 #else
8985 $ac_func();
8986 #endif
8987
8988 ; return 0; }
8989 EOF
8990 if { (eval echo configure:8991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8991   rm -rf conftest*
8992   eval "ac_cv_func_$ac_func=yes"
8993 else
8994   echo "configure: failed program was:" >&5
8995   cat conftest.$ac_ext >&5
8996   rm -rf conftest*
8997   eval "ac_cv_func_$ac_func=no"
8998 fi
8999 rm -f conftest*
9000
9001 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9002   echo "$ac_t""yes" 1>&6
9003     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9004   { test "$extra_verbose" = "yes" && cat << EOF
9005     Defining $ac_tr_func
9006 EOF
9007 cat >> confdefs.h <<EOF
9008 #define $ac_tr_func 1
9009 EOF
9010 }
9011  
9012 else
9013   echo "$ac_t""no" 1>&6
9014 fi
9015 done
9016
9017
9018 if test "$ac_cv_func_getloadavg" != "yes"
9019 then
9020   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
9021    echo "    xemacs will be linked with \"getloadavg.o\""
9022  fi
9023
9024     
9025 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
9026 echo "configure:9027: checking for kstat_open in -lkstat" >&5
9027 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
9028
9029 xe_check_libs=" -lkstat "
9030 cat > conftest.$ac_ext <<EOF
9031 #line 9032 "configure"
9032 #include "confdefs.h"
9033 /* Override any gcc2 internal prototype to avoid an error.  */
9034 /* We use char because int might match the return type of a gcc2
9035     builtin and then its argument prototype would still apply.  */
9036 char kstat_open();
9037
9038 int main() {
9039 kstat_open()
9040 ; return 0; }
9041 EOF
9042 if { (eval echo configure:9043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9043   rm -rf conftest*
9044   eval "ac_cv_lib_$ac_lib_var=yes"
9045 else
9046   echo "configure: failed program was:" >&5
9047   cat conftest.$ac_ext >&5
9048   rm -rf conftest*
9049   eval "ac_cv_lib_$ac_lib_var=no"
9050 fi
9051 rm -f conftest*
9052 xe_check_libs=""
9053
9054 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9055   echo "$ac_t""yes" 1>&6
9056     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9057     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9058   { test "$extra_verbose" = "yes" && cat << EOF
9059     Defining $ac_tr_lib
9060 EOF
9061 cat >> confdefs.h <<EOF
9062 #define $ac_tr_lib 1
9063 EOF
9064 }
9065
9066   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
9067
9068 else
9069   echo "$ac_t""no" 1>&6
9070 fi
9071
9072
9073
9074     
9075 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
9076 echo "configure:9077: checking for kvm_read in -lkvm" >&5
9077 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
9078
9079 xe_check_libs=" -lkvm "
9080 cat > conftest.$ac_ext <<EOF
9081 #line 9082 "configure"
9082 #include "confdefs.h"
9083 /* Override any gcc2 internal prototype to avoid an error.  */
9084 /* We use char because int might match the return type of a gcc2
9085     builtin and then its argument prototype would still apply.  */
9086 char kvm_read();
9087
9088 int main() {
9089 kvm_read()
9090 ; return 0; }
9091 EOF
9092 if { (eval echo configure:9093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9093   rm -rf conftest*
9094   eval "ac_cv_lib_$ac_lib_var=yes"
9095 else
9096   echo "configure: failed program was:" >&5
9097   cat conftest.$ac_ext >&5
9098   rm -rf conftest*
9099   eval "ac_cv_lib_$ac_lib_var=no"
9100 fi
9101 rm -f conftest*
9102 xe_check_libs=""
9103
9104 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9105   echo "$ac_t""yes" 1>&6
9106     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9107     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9108   { test "$extra_verbose" = "yes" && cat << EOF
9109     Defining $ac_tr_lib
9110 EOF
9111 cat >> confdefs.h <<EOF
9112 #define $ac_tr_lib 1
9113 EOF
9114 }
9115
9116   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
9117
9118 else
9119   echo "$ac_t""no" 1>&6
9120 fi
9121
9122
9123 fi
9124
9125 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
9126 echo "configure:9127: checking whether netdb declares h_errno" >&5
9127 cat > conftest.$ac_ext <<EOF
9128 #line 9129 "configure"
9129 #include "confdefs.h"
9130 #include <netdb.h>
9131 int main() {
9132 return h_errno;
9133 ; return 0; }
9134 EOF
9135 if { (eval echo configure:9136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9136   rm -rf conftest*
9137   echo "$ac_t""yes" 1>&6
9138    { test "$extra_verbose" = "yes" && cat << \EOF
9139     Defining HAVE_H_ERRNO
9140 EOF
9141 cat >> confdefs.h <<\EOF
9142 #define HAVE_H_ERRNO 1
9143 EOF
9144 }
9145
9146 else
9147   echo "configure: failed program was:" >&5
9148   cat conftest.$ac_ext >&5
9149   rm -rf conftest*
9150   echo "$ac_t""no" 1>&6
9151 fi
9152 rm -f conftest*
9153
9154 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
9155 echo "configure:9156: checking for sigsetjmp" >&5
9156 cat > conftest.$ac_ext <<EOF
9157 #line 9158 "configure"
9158 #include "confdefs.h"
9159 #include <setjmp.h>
9160 int main() {
9161 sigjmp_buf bar; sigsetjmp (bar, 0);
9162 ; return 0; }
9163 EOF
9164 if { (eval echo configure:9165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9165   rm -rf conftest*
9166   echo "$ac_t""yes" 1>&6
9167    { test "$extra_verbose" = "yes" && cat << \EOF
9168     Defining HAVE_SIGSETJMP
9169 EOF
9170 cat >> confdefs.h <<\EOF
9171 #define HAVE_SIGSETJMP 1
9172 EOF
9173 }
9174
9175 else
9176   echo "configure: failed program was:" >&5
9177   cat conftest.$ac_ext >&5
9178   rm -rf conftest*
9179   echo "$ac_t""no" 1>&6
9180 fi
9181 rm -f conftest*
9182
9183 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
9184 echo "configure:9185: checking whether localtime caches TZ" >&5
9185
9186 if test "$ac_cv_func_tzset" = "yes"; then
9187 cat > conftest.$ac_ext <<EOF
9188 #line 9189 "configure"
9189 #include "confdefs.h"
9190 #include <time.h>
9191 #if STDC_HEADERS
9192 # include <stdlib.h>
9193 #endif
9194 extern char **environ;
9195 unset_TZ ()
9196 {
9197   char **from, **to;
9198   for (to = from = environ; (*to = *from); from++)
9199     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
9200       to++;
9201 }
9202 char TZ_GMT0[] = "TZ=GMT0";
9203 char TZ_PST8[] = "TZ=PST8";
9204 main()
9205 {
9206   time_t now = time ((time_t *) 0);
9207   int hour_GMT0, hour_unset;
9208   if (putenv (TZ_GMT0) != 0)
9209     exit (1);
9210   hour_GMT0 = localtime (&now)->tm_hour;
9211   unset_TZ ();
9212   hour_unset = localtime (&now)->tm_hour;
9213   if (putenv (TZ_PST8) != 0)
9214     exit (1);
9215   if (localtime (&now)->tm_hour == hour_GMT0)
9216     exit (1);
9217   unset_TZ ();
9218   if (localtime (&now)->tm_hour != hour_unset)
9219     exit (1);
9220   exit (0);
9221 }
9222 EOF
9223 if { (eval echo configure:9224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9224 then
9225   emacs_cv_localtime_cache=no
9226 else
9227   conftest_rc="$?"
9228   echo "configure: failed program was:" >&5
9229   cat conftest.$ac_ext >&5
9230   rm -fr conftest*
9231   emacs_cv_localtime_cache=yes
9232 fi
9233 rm -fr conftest*
9234 else
9235         # If we lack tzset, report that localtime does not cache TZ,
9236         # since we can't invalidate the cache if we don't have tzset.
9237         emacs_cv_localtime_cache=no
9238 fi
9239 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
9240 if test $emacs_cv_localtime_cache = yes; then
9241   { test "$extra_verbose" = "yes" && cat << \EOF
9242     Defining LOCALTIME_CACHE
9243 EOF
9244 cat >> confdefs.h <<\EOF
9245 #define LOCALTIME_CACHE 1
9246 EOF
9247 }
9248
9249 fi
9250
9251 if test "$HAVE_TIMEVAL" = "yes"; then
9252 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
9253 echo "configure:9254: checking whether gettimeofday accepts one or two arguments" >&5
9254 cat > conftest.$ac_ext <<EOF
9255 #line 9256 "configure"
9256 #include "confdefs.h"
9257
9258 #ifdef TIME_WITH_SYS_TIME
9259 #include <sys/time.h>
9260 #include <time.h>
9261 #else
9262 #ifdef HAVE_SYS_TIME_H
9263 #include <sys/time.h>
9264 #else
9265 #include <time.h>
9266 #endif
9267 #endif
9268   
9269 int main() {
9270
9271   struct timeval time;
9272   struct timezone dummy;
9273   gettimeofday (&time, &dummy);
9274
9275 ; return 0; }
9276 EOF
9277 if { (eval echo configure:9278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9278   rm -rf conftest*
9279   echo "$ac_t""two" 1>&6
9280 else
9281   echo "configure: failed program was:" >&5
9282   cat conftest.$ac_ext >&5
9283   rm -rf conftest*
9284   echo "$ac_t""one" 1>&6
9285    { test "$extra_verbose" = "yes" && cat << \EOF
9286     Defining GETTIMEOFDAY_ONE_ARGUMENT
9287 EOF
9288 cat >> confdefs.h <<\EOF
9289 #define GETTIMEOFDAY_ONE_ARGUMENT 1
9290 EOF
9291 }
9292
9293 fi
9294 rm -f conftest*
9295 fi
9296
9297
9298 echo $ac_n "checking for inline""... $ac_c" 1>&6
9299 echo "configure:9300: checking for inline" >&5
9300
9301 ac_cv_c_inline=no
9302 for ac_kw in inline __inline__ __inline; do
9303   cat > conftest.$ac_ext <<EOF
9304 #line 9305 "configure"
9305 #include "confdefs.h"
9306
9307 int main() {
9308 } $ac_kw foo() {
9309 ; return 0; }
9310 EOF
9311 if { (eval echo configure:9312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9312   rm -rf conftest*
9313   ac_cv_c_inline=$ac_kw; break
9314 else
9315   echo "configure: failed program was:" >&5
9316   cat conftest.$ac_ext >&5
9317 fi
9318 rm -f conftest*
9319 done
9320
9321
9322 echo "$ac_t""$ac_cv_c_inline" 1>&6
9323 case "$ac_cv_c_inline" in
9324   inline | yes) ;;
9325   no) { test "$extra_verbose" = "yes" && cat << \EOF
9326     Defining inline = 
9327 EOF
9328 cat >> confdefs.h <<\EOF
9329 #define inline 
9330 EOF
9331 }
9332  ;;
9333   *)  { test "$extra_verbose" = "yes" && cat << EOF
9334     Defining inline = $ac_cv_c_inline
9335 EOF
9336 cat >> confdefs.h <<EOF
9337 #define inline $ac_cv_c_inline
9338 EOF
9339 }
9340  ;;
9341 esac
9342
9343 if test "$ac_cv_c_inline" != "no"; then
9344   { test "$extra_verbose" = "yes" && cat << \EOF
9345     Defining HAVE_INLINE
9346 EOF
9347 cat >> confdefs.h <<\EOF
9348 #define HAVE_INLINE 1
9349 EOF
9350 }
9351
9352   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9353    echo "    xemacs will be linked with \"inline.o\""
9354  fi
9355 fi
9356
9357
9358 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9359 # for constant arguments.  Useless!
9360 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9361 echo "configure:9362: checking for working alloca.h" >&5
9362
9363 cat > conftest.$ac_ext <<EOF
9364 #line 9365 "configure"
9365 #include "confdefs.h"
9366 #include <alloca.h>
9367 int main() {
9368 char *p = alloca(2 * sizeof(int));
9369 ; return 0; }
9370 EOF
9371 if { (eval echo configure:9372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9372   rm -rf conftest*
9373   ac_cv_header_alloca_h=yes
9374 else
9375   echo "configure: failed program was:" >&5
9376   cat conftest.$ac_ext >&5
9377   rm -rf conftest*
9378   ac_cv_header_alloca_h=no
9379 fi
9380 rm -f conftest*
9381
9382 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9383 if test $ac_cv_header_alloca_h = yes; then
9384   { test "$extra_verbose" = "yes" && cat << \EOF
9385     Defining HAVE_ALLOCA_H
9386 EOF
9387 cat >> confdefs.h <<\EOF
9388 #define HAVE_ALLOCA_H 1
9389 EOF
9390 }
9391
9392 fi
9393
9394 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9395 echo "configure:9396: checking for alloca" >&5
9396
9397 cat > conftest.$ac_ext <<EOF
9398 #line 9399 "configure"
9399 #include "confdefs.h"
9400
9401 #ifdef __GNUC__
9402 # define alloca __builtin_alloca
9403 #else
9404 # ifdef _MSC_VER
9405 #  include <malloc.h>
9406 #  define alloca _alloca
9407 # else
9408 #  if HAVE_ALLOCA_H
9409 #   include <alloca.h>
9410 #  else
9411 #   ifdef _AIX
9412  #pragma alloca
9413 #   else
9414 #    ifndef alloca /* predefined by HP cc +Olibcalls */
9415 char *alloca ();
9416 #    endif
9417 #   endif
9418 #  endif
9419 # endif
9420 #endif
9421
9422 int main() {
9423 char *p = (char *) alloca(1);
9424 ; return 0; }
9425 EOF
9426 if { (eval echo configure:9427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9427   rm -rf conftest*
9428   ac_cv_func_alloca_works=yes
9429 else
9430   echo "configure: failed program was:" >&5
9431   cat conftest.$ac_ext >&5
9432   rm -rf conftest*
9433   ac_cv_func_alloca_works=no
9434 fi
9435 rm -f conftest*
9436
9437 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9438 if test $ac_cv_func_alloca_works = yes; then
9439   { test "$extra_verbose" = "yes" && cat << \EOF
9440     Defining HAVE_ALLOCA
9441 EOF
9442 cat >> confdefs.h <<\EOF
9443 #define HAVE_ALLOCA 1
9444 EOF
9445 }
9446
9447 fi
9448
9449 if test $ac_cv_func_alloca_works = no; then
9450   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9451   # that cause trouble.  Some versions do not even contain alloca or
9452   # contain a buggy version.  If you still want to use their alloca,
9453   # use ar to extract alloca.o from them instead of compiling alloca.c.
9454   ALLOCA=alloca.${ac_objext}
9455   { test "$extra_verbose" = "yes" && cat << \EOF
9456     Defining C_ALLOCA
9457 EOF
9458 cat >> confdefs.h <<\EOF
9459 #define C_ALLOCA 1
9460 EOF
9461 }
9462
9463
9464 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9465 echo "configure:9466: checking whether alloca needs Cray hooks" >&5
9466
9467 cat > conftest.$ac_ext <<EOF
9468 #line 9469 "configure"
9469 #include "confdefs.h"
9470 #if defined(CRAY) && ! defined(CRAY2)
9471 webecray
9472 #else
9473 wenotbecray
9474 #endif
9475
9476 EOF
9477 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9478   egrep "webecray" >/dev/null 2>&1; then
9479   rm -rf conftest*
9480   ac_cv_os_cray=yes
9481 else
9482   rm -rf conftest*
9483   ac_cv_os_cray=no
9484 fi
9485 rm -f conftest*
9486
9487
9488 echo "$ac_t""$ac_cv_os_cray" 1>&6
9489 if test $ac_cv_os_cray = yes; then
9490 for ac_func in _getb67 GETB67 getb67; do
9491   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9492 echo "configure:9493: checking for $ac_func" >&5
9493
9494 cat > conftest.$ac_ext <<EOF
9495 #line 9496 "configure"
9496 #include "confdefs.h"
9497 /* System header to define __stub macros and hopefully few prototypes,
9498     which can conflict with char $ac_func(); below.  */
9499 #include <assert.h>
9500 /* Override any gcc2 internal prototype to avoid an error.  */
9501 /* We use char because int might match the return type of a gcc2
9502     builtin and then its argument prototype would still apply.  */
9503 char $ac_func();
9504
9505 int main() {
9506
9507 /* The GNU C library defines this for functions which it implements
9508     to always fail with ENOSYS.  Some functions are actually named
9509     something starting with __ and the normal name is an alias.  */
9510 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9511 choke me
9512 #else
9513 $ac_func();
9514 #endif
9515
9516 ; return 0; }
9517 EOF
9518 if { (eval echo configure:9519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9519   rm -rf conftest*
9520   eval "ac_cv_func_$ac_func=yes"
9521 else
9522   echo "configure: failed program was:" >&5
9523   cat conftest.$ac_ext >&5
9524   rm -rf conftest*
9525   eval "ac_cv_func_$ac_func=no"
9526 fi
9527 rm -f conftest*
9528
9529 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9530   echo "$ac_t""yes" 1>&6
9531   { test "$extra_verbose" = "yes" && cat << EOF
9532     Defining CRAY_STACKSEG_END = $ac_func
9533 EOF
9534 cat >> confdefs.h <<EOF
9535 #define CRAY_STACKSEG_END $ac_func
9536 EOF
9537 }
9538
9539   break
9540 else
9541   echo "$ac_t""no" 1>&6
9542 fi
9543
9544 done
9545 fi
9546
9547 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9548 echo "configure:9549: checking stack direction for C alloca" >&5
9549
9550 cat > conftest.$ac_ext <<EOF
9551 #line 9552 "configure"
9552 #include "confdefs.h"
9553 find_stack_direction ()
9554 {
9555   static char *addr = 0;
9556   auto char dummy;
9557   if (addr == 0)
9558     {
9559       addr = &dummy;
9560       return find_stack_direction ();
9561     }
9562   else
9563     return (&dummy > addr) ? 1 : -1;
9564 }
9565 main ()
9566 {
9567   exit (find_stack_direction() < 0);
9568 }
9569 EOF
9570 if { (eval echo configure:9571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9571 then
9572   ac_cv_c_stack_direction=1
9573 else
9574   conftest_rc="$?"
9575   echo "configure: failed program was:" >&5
9576   cat conftest.$ac_ext >&5
9577   rm -fr conftest*
9578   ac_cv_c_stack_direction=-1
9579 fi
9580 rm -fr conftest*
9581
9582 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9583 { test "$extra_verbose" = "yes" && cat << EOF
9584     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9585 EOF
9586 cat >> confdefs.h <<EOF
9587 #define STACK_DIRECTION $ac_cv_c_stack_direction
9588 EOF
9589 }
9590
9591 fi
9592
9593 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9594    echo "    xemacs will be linked with \"$ALLOCA\""
9595  fi
9596
9597 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9598 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9599 echo "configure:9600: checking for vfork.h" >&5
9600
9601 cat > conftest.$ac_ext <<EOF
9602 #line 9603 "configure"
9603 #include "confdefs.h"
9604 #include <vfork.h>
9605 EOF
9606 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9607 { (eval echo configure:9608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9608 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9609 if test -z "$ac_err"; then
9610   rm -rf conftest*
9611   eval "ac_cv_header_$ac_safe=yes"
9612 else
9613   echo "$ac_err" >&5
9614   echo "configure: failed program was:" >&5
9615   cat conftest.$ac_ext >&5
9616   rm -rf conftest*
9617   eval "ac_cv_header_$ac_safe=no"
9618 fi
9619 rm -f conftest*
9620 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9621   echo "$ac_t""yes" 1>&6
9622   { test "$extra_verbose" = "yes" && cat << \EOF
9623     Defining HAVE_VFORK_H
9624 EOF
9625 cat >> confdefs.h <<\EOF
9626 #define HAVE_VFORK_H 1
9627 EOF
9628 }
9629
9630 else
9631   echo "$ac_t""no" 1>&6
9632 fi
9633
9634 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9635 echo "configure:9636: checking for working vfork" >&5
9636
9637 cat > conftest.$ac_ext <<EOF
9638 #line 9639 "configure"
9639 #include "confdefs.h"
9640 /* Thanks to Paul Eggert for this test.  */
9641 #include <stdio.h>
9642 #include <sys/types.h>
9643 #include <sys/stat.h>
9644 #ifdef HAVE_UNISTD_H
9645 #include <unistd.h>
9646 #endif
9647 #ifdef HAVE_VFORK_H
9648 #include <vfork.h>
9649 #endif
9650 /* On some sparc systems, changes by the child to local and incoming
9651    argument registers are propagated back to the parent.
9652    The compiler is told about this with #include <vfork.h>,
9653    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9654    Test for this by using a static variable whose address
9655    is put into a register that is clobbered by the vfork.  */
9656 static
9657 #ifdef __cplusplus
9658 sparc_address_test (int arg)
9659 #else
9660 sparc_address_test (arg) int arg;
9661 #endif
9662 {
9663   static pid_t child;
9664   if (!child) {
9665     child = vfork ();
9666     if (child < 0) {
9667       perror ("vfork");
9668       _exit(2);
9669     }
9670     if (!child) {
9671       arg = getpid();
9672       write(-1, "", 0);
9673       _exit (arg);
9674     }
9675   }
9676 }
9677 main() {
9678   pid_t parent = getpid ();
9679   pid_t child;
9680
9681   sparc_address_test ();
9682
9683   child = vfork ();
9684
9685   if (child == 0) {
9686     /* Here is another test for sparc vfork register problems.
9687        This test uses lots of local variables, at least
9688        as many local variables as main has allocated so far
9689        including compiler temporaries.  4 locals are enough for
9690        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9691        A buggy compiler should reuse the register of parent
9692        for one of the local variables, since it will think that
9693        parent can't possibly be used any more in this routine.
9694        Assigning to the local variable will thus munge parent
9695        in the parent process.  */
9696     pid_t
9697       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9698       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9699     /* Convince the compiler that p..p7 are live; otherwise, it might
9700        use the same hardware register for all 8 local variables.  */
9701     if (p != p1 || p != p2 || p != p3 || p != p4
9702         || p != p5 || p != p6 || p != p7)
9703       _exit(1);
9704
9705     /* On some systems (e.g. IRIX 3.3),
9706        vfork doesn't separate parent from child file descriptors.
9707        If the child closes a descriptor before it execs or exits,
9708        this munges the parent's descriptor as well.
9709        Test for this by closing stdout in the child.  */
9710     _exit(close(fileno(stdout)) != 0);
9711   } else {
9712     int status;
9713     struct stat st;
9714
9715     while (wait(&status) != child)
9716       ;
9717     exit(
9718          /* Was there some problem with vforking?  */
9719          child < 0
9720
9721          /* Did the child fail?  (This shouldn't happen.)  */
9722          || status
9723
9724          /* Did the vfork/compiler bug occur?  */
9725          || parent != getpid()
9726
9727          /* Did the file descriptor bug occur?  */
9728          || fstat(fileno(stdout), &st) != 0
9729          );
9730   }
9731 }
9732 EOF
9733 if { (eval echo configure:9734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9734 then
9735   ac_cv_func_vfork_works=yes
9736 else
9737   conftest_rc="$?"
9738   echo "configure: failed program was:" >&5
9739   cat conftest.$ac_ext >&5
9740   rm -fr conftest*
9741   ac_cv_func_vfork_works=no
9742 fi
9743 rm -fr conftest*
9744
9745 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9746 if test $ac_cv_func_vfork_works = no; then
9747   { test "$extra_verbose" = "yes" && cat << \EOF
9748     Defining vfork = fork
9749 EOF
9750 cat >> confdefs.h <<\EOF
9751 #define vfork fork
9752 EOF
9753 }
9754
9755 fi
9756
9757
9758 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9759 echo "configure:9760: checking for working strcoll" >&5
9760
9761 cat > conftest.$ac_ext <<EOF
9762 #line 9763 "configure"
9763 #include "confdefs.h"
9764 #include <string.h>
9765 main ()
9766 {
9767   exit (strcoll ("abc", "def") >= 0 ||
9768         strcoll ("ABC", "DEF") >= 0 ||
9769         strcoll ("123", "456") >= 0);
9770 }
9771 EOF
9772 if { (eval echo configure:9773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9773 then
9774   ac_cv_func_strcoll_works=yes
9775 else
9776   conftest_rc="$?"
9777   echo "configure: failed program was:" >&5
9778   cat conftest.$ac_ext >&5
9779   rm -fr conftest*
9780   ac_cv_func_strcoll_works=no
9781 fi
9782 rm -fr conftest*
9783
9784 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9785 if test $ac_cv_func_strcoll_works = yes; then
9786   { test "$extra_verbose" = "yes" && cat << \EOF
9787     Defining HAVE_STRCOLL
9788 EOF
9789 cat >> confdefs.h <<\EOF
9790 #define HAVE_STRCOLL 1
9791 EOF
9792 }
9793
9794 fi
9795
9796
9797 for ac_func in getpgrp
9798 do
9799 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9800 echo "configure:9801: checking for $ac_func" >&5
9801
9802 cat > conftest.$ac_ext <<EOF
9803 #line 9804 "configure"
9804 #include "confdefs.h"
9805 /* System header to define __stub macros and hopefully few prototypes,
9806     which can conflict with char $ac_func(); below.  */
9807 #include <assert.h>
9808 /* Override any gcc2 internal prototype to avoid an error.  */
9809 /* We use char because int might match the return type of a gcc2
9810     builtin and then its argument prototype would still apply.  */
9811 char $ac_func();
9812
9813 int main() {
9814
9815 /* The GNU C library defines this for functions which it implements
9816     to always fail with ENOSYS.  Some functions are actually named
9817     something starting with __ and the normal name is an alias.  */
9818 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9819 choke me
9820 #else
9821 $ac_func();
9822 #endif
9823
9824 ; return 0; }
9825 EOF
9826 if { (eval echo configure:9827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9827   rm -rf conftest*
9828   eval "ac_cv_func_$ac_func=yes"
9829 else
9830   echo "configure: failed program was:" >&5
9831   cat conftest.$ac_ext >&5
9832   rm -rf conftest*
9833   eval "ac_cv_func_$ac_func=no"
9834 fi
9835 rm -f conftest*
9836
9837 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9838   echo "$ac_t""yes" 1>&6
9839     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9840   { test "$extra_verbose" = "yes" && cat << EOF
9841     Defining $ac_tr_func
9842 EOF
9843 cat >> confdefs.h <<EOF
9844 #define $ac_tr_func 1
9845 EOF
9846 }
9847  
9848 else
9849   echo "$ac_t""no" 1>&6
9850 fi
9851 done
9852
9853 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9854 echo "configure:9855: checking whether getpgrp takes no argument" >&5
9855
9856 cat > conftest.$ac_ext <<EOF
9857 #line 9858 "configure"
9858 #include "confdefs.h"
9859
9860 /*
9861  * If this system has a BSD-style getpgrp(),
9862  * which takes a pid argument, exit unsuccessfully.
9863  *
9864  * Snarfed from Chet Ramey's bash pgrp.c test program
9865  */
9866 #include <stdio.h>
9867 #include <sys/types.h>
9868
9869 int     pid;
9870 int     pg1, pg2, pg3, pg4;
9871 int     ng, np, s, child;
9872
9873 main()
9874 {
9875         pid = getpid();
9876         pg1 = getpgrp(0);
9877         pg2 = getpgrp();
9878         pg3 = getpgrp(pid);
9879         pg4 = getpgrp(1);
9880
9881         /*
9882          * If all of these values are the same, it's pretty sure that
9883          * we're on a system that ignores getpgrp's first argument.
9884          */
9885         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9886                 exit(0);
9887
9888         child = fork();
9889         if (child < 0)
9890                 exit(1);
9891         else if (child == 0) {
9892                 np = getpid();
9893                 /*
9894                  * If this is Sys V, this will not work; pgrp will be
9895                  * set to np because setpgrp just changes a pgrp to be
9896                  * the same as the pid.
9897                  */
9898                 setpgrp(np, pg1);
9899                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9900                 if (ng == pg1) {
9901                         exit(1);
9902                 } else {
9903                         exit(0);
9904                 }
9905         } else {
9906                 wait(&s);
9907                 exit(s>>8);
9908         }
9909 }
9910
9911 EOF
9912 if { (eval echo configure:9913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9913 then
9914   ac_cv_func_getpgrp_void=yes
9915 else
9916   conftest_rc="$?"
9917   echo "configure: failed program was:" >&5
9918   cat conftest.$ac_ext >&5
9919   rm -fr conftest*
9920   ac_cv_func_getpgrp_void=no
9921 fi
9922 rm -fr conftest*
9923
9924
9925 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9926 if test $ac_cv_func_getpgrp_void = yes; then
9927   { test "$extra_verbose" = "yes" && cat << \EOF
9928     Defining GETPGRP_VOID
9929 EOF
9930 cat >> confdefs.h <<\EOF
9931 #define GETPGRP_VOID 1
9932 EOF
9933 }
9934
9935 fi
9936
9937
9938 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9939 echo "configure:9940: checking for working mmap" >&5
9940 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9941 cat > conftest.$ac_ext <<EOF
9942 #line 9943 "configure"
9943 #include "confdefs.h"
9944 #include <stdio.h>
9945 #include <unistd.h>
9946 #include <fcntl.h>
9947 #include <sys/mman.h>
9948
9949 #ifndef MAP_VARIABLE
9950 #define MAP_VARIABLE 0
9951 #endif
9952
9953 #ifndef MAP_FAILED
9954 #define MAP_FAILED -1
9955 #endif
9956
9957 int main (int argc, char *argv[])
9958 {
9959   int fd = -1;
9960   caddr_t p;
9961 #ifndef MAP_ANONYMOUS
9962   fd = open ("/dev/zero", O_RDWR);
9963   if (fd < 0)
9964     return 1;
9965 #define MAP_ANONYMOUS 0
9966 #endif
9967   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9968            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9969            fd, 0) != (void *) MAP_FAILED)
9970     return 0;
9971   perror ("conftest: mmap failed");
9972   return 1;
9973 }
9974 EOF
9975 if { (eval echo configure:9976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9976 then
9977   have_mmap=yes
9978 else
9979   conftest_rc="$?"
9980   echo "configure: failed program was:" >&5
9981   cat conftest.$ac_ext >&5
9982   rm -fr conftest*
9983   have_mmap=no
9984 fi
9985 rm -fr conftest* ;;
9986 esac
9987 echo "$ac_t""$have_mmap" 1>&6
9988 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9989     Defining HAVE_MMAP
9990 EOF
9991 cat >> confdefs.h <<\EOF
9992 #define HAVE_MMAP 1
9993 EOF
9994 }
9995
9996
9997 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9998 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9999 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10000     Defining REL_ALLOC
10001 EOF
10002 cat >> confdefs.h <<\EOF
10003 #define REL_ALLOC 1
10004 EOF
10005 }
10006
10007
10008 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
10009 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
10010 echo "configure:10011: checking for termios.h" >&5
10011
10012 cat > conftest.$ac_ext <<EOF
10013 #line 10014 "configure"
10014 #include "confdefs.h"
10015 #include <termios.h>
10016 EOF
10017 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10018 { (eval echo configure:10019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10019 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10020 if test -z "$ac_err"; then
10021   rm -rf conftest*
10022   eval "ac_cv_header_$ac_safe=yes"
10023 else
10024   echo "$ac_err" >&5
10025   echo "configure: failed program was:" >&5
10026   cat conftest.$ac_ext >&5
10027   rm -rf conftest*
10028   eval "ac_cv_header_$ac_safe=no"
10029 fi
10030 rm -f conftest*
10031 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10032   echo "$ac_t""yes" 1>&6
10033   { test "$extra_verbose" = "yes" && cat << \EOF
10034     Defining HAVE_TERMIOS
10035 EOF
10036 cat >> confdefs.h <<\EOF
10037 #define HAVE_TERMIOS 1
10038 EOF
10039 }
10040
10041   { test "$extra_verbose" = "yes" && cat << \EOF
10042     Defining SIGNALS_VIA_CHARACTERS
10043 EOF
10044 cat >> confdefs.h <<\EOF
10045 #define SIGNALS_VIA_CHARACTERS 1
10046 EOF
10047 }
10048
10049   { test "$extra_verbose" = "yes" && cat << \EOF
10050     Defining NO_TERMIO
10051 EOF
10052 cat >> confdefs.h <<\EOF
10053 #define NO_TERMIO 1
10054 EOF
10055 }
10056
10057 else
10058   echo "$ac_t""no" 1>&6
10059 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10060 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10061 echo "configure:10062: checking for termio.h" >&5
10062
10063 cat > conftest.$ac_ext <<EOF
10064 #line 10065 "configure"
10065 #include "confdefs.h"
10066 #include <termio.h>
10067 EOF
10068 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10069 { (eval echo configure:10070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10070 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10071 if test -z "$ac_err"; then
10072   rm -rf conftest*
10073   eval "ac_cv_header_$ac_safe=yes"
10074 else
10075   echo "$ac_err" >&5
10076   echo "configure: failed program was:" >&5
10077   cat conftest.$ac_ext >&5
10078   rm -rf conftest*
10079   eval "ac_cv_header_$ac_safe=no"
10080 fi
10081 rm -f conftest*
10082 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10083   echo "$ac_t""yes" 1>&6
10084   { test "$extra_verbose" = "yes" && cat << \EOF
10085     Defining HAVE_TERMIO
10086 EOF
10087 cat >> confdefs.h <<\EOF
10088 #define HAVE_TERMIO 1
10089 EOF
10090 }
10091
10092 else
10093   echo "$ac_t""no" 1>&6
10094 fi
10095
10096 fi
10097
10098
10099
10100 echo $ac_n "checking for socket""... $ac_c" 1>&6
10101 echo "configure:10102: checking for socket" >&5
10102
10103 cat > conftest.$ac_ext <<EOF
10104 #line 10105 "configure"
10105 #include "confdefs.h"
10106 /* System header to define __stub macros and hopefully few prototypes,
10107     which can conflict with char socket(); below.  */
10108 #include <assert.h>
10109 /* Override any gcc2 internal prototype to avoid an error.  */
10110 /* We use char because int might match the return type of a gcc2
10111     builtin and then its argument prototype would still apply.  */
10112 char socket();
10113
10114 int main() {
10115
10116 /* The GNU C library defines this for functions which it implements
10117     to always fail with ENOSYS.  Some functions are actually named
10118     something starting with __ and the normal name is an alias.  */
10119 #if defined (__stub_socket) || defined (__stub___socket)
10120 choke me
10121 #else
10122 socket();
10123 #endif
10124
10125 ; return 0; }
10126 EOF
10127 if { (eval echo configure:10128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10128   rm -rf conftest*
10129   eval "ac_cv_func_socket=yes"
10130 else
10131   echo "configure: failed program was:" >&5
10132   cat conftest.$ac_ext >&5
10133   rm -rf conftest*
10134   eval "ac_cv_func_socket=no"
10135 fi
10136 rm -f conftest*
10137
10138 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10139   echo "$ac_t""yes" 1>&6
10140   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10141 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10142 echo "configure:10143: checking for netinet/in.h" >&5
10143
10144 cat > conftest.$ac_ext <<EOF
10145 #line 10146 "configure"
10146 #include "confdefs.h"
10147 #include <netinet/in.h>
10148 EOF
10149 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10150 { (eval echo configure:10151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10151 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10152 if test -z "$ac_err"; then
10153   rm -rf conftest*
10154   eval "ac_cv_header_$ac_safe=yes"
10155 else
10156   echo "$ac_err" >&5
10157   echo "configure: failed program was:" >&5
10158   cat conftest.$ac_ext >&5
10159   rm -rf conftest*
10160   eval "ac_cv_header_$ac_safe=no"
10161 fi
10162 rm -f conftest*
10163 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10164   echo "$ac_t""yes" 1>&6
10165   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10166 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10167 echo "configure:10168: checking for arpa/inet.h" >&5
10168
10169 cat > conftest.$ac_ext <<EOF
10170 #line 10171 "configure"
10171 #include "confdefs.h"
10172 #include <arpa/inet.h>
10173 EOF
10174 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10175 { (eval echo configure:10176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10176 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10177 if test -z "$ac_err"; then
10178   rm -rf conftest*
10179   eval "ac_cv_header_$ac_safe=yes"
10180 else
10181   echo "$ac_err" >&5
10182   echo "configure: failed program was:" >&5
10183   cat conftest.$ac_ext >&5
10184   rm -rf conftest*
10185   eval "ac_cv_header_$ac_safe=no"
10186 fi
10187 rm -f conftest*
10188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10189   echo "$ac_t""yes" 1>&6
10190   
10191   { test "$extra_verbose" = "yes" && cat << \EOF
10192     Defining HAVE_SOCKETS
10193 EOF
10194 cat >> confdefs.h <<\EOF
10195 #define HAVE_SOCKETS 1
10196 EOF
10197 }
10198
10199       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10200 echo "configure:10201: checking "for sun_len member in struct sockaddr_un"" >&5
10201       cat > conftest.$ac_ext <<EOF
10202 #line 10203 "configure"
10203 #include "confdefs.h"
10204
10205 #include <sys/types.h>
10206 #include <sys/socket.h>
10207 #include <sys/un.h>
10208       
10209 int main() {
10210 static struct sockaddr_un x; x.sun_len = 1;
10211 ; return 0; }
10212 EOF
10213 if { (eval echo configure:10214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10214   rm -rf conftest*
10215   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10216     Defining HAVE_SOCKADDR_SUN_LEN
10217 EOF
10218 cat >> confdefs.h <<\EOF
10219 #define HAVE_SOCKADDR_SUN_LEN 1
10220 EOF
10221 }
10222
10223 else
10224   echo "configure: failed program was:" >&5
10225   cat conftest.$ac_ext >&5
10226   rm -rf conftest*
10227   echo "$ac_t""no" 1>&6
10228 fi
10229 rm -f conftest*
10230       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10231 echo "configure:10232: checking "for ip_mreq struct in netinet/in.h"" >&5
10232       cat > conftest.$ac_ext <<EOF
10233 #line 10234 "configure"
10234 #include "confdefs.h"
10235
10236 #include <sys/types.h>
10237 #include <netinet/in.h>
10238       
10239 int main() {
10240 static struct ip_mreq x;
10241 ; return 0; }
10242 EOF
10243 if { (eval echo configure:10244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10244   rm -rf conftest*
10245   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10246     Defining HAVE_MULTICAST
10247 EOF
10248 cat >> confdefs.h <<\EOF
10249 #define HAVE_MULTICAST 1
10250 EOF
10251 }
10252
10253 else
10254   echo "configure: failed program was:" >&5
10255   cat conftest.$ac_ext >&5
10256   rm -rf conftest*
10257   echo "$ac_t""no" 1>&6
10258 fi
10259 rm -f conftest*
10260 else
10261   echo "$ac_t""no" 1>&6
10262 fi
10263
10264 else
10265   echo "$ac_t""no" 1>&6
10266 fi
10267
10268 else
10269   echo "$ac_t""no" 1>&6
10270 fi
10271
10272
10273 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10274 echo "configure:10275: checking for msgget" >&5
10275
10276 cat > conftest.$ac_ext <<EOF
10277 #line 10278 "configure"
10278 #include "confdefs.h"
10279 /* System header to define __stub macros and hopefully few prototypes,
10280     which can conflict with char msgget(); below.  */
10281 #include <assert.h>
10282 /* Override any gcc2 internal prototype to avoid an error.  */
10283 /* We use char because int might match the return type of a gcc2
10284     builtin and then its argument prototype would still apply.  */
10285 char msgget();
10286
10287 int main() {
10288
10289 /* The GNU C library defines this for functions which it implements
10290     to always fail with ENOSYS.  Some functions are actually named
10291     something starting with __ and the normal name is an alias.  */
10292 #if defined (__stub_msgget) || defined (__stub___msgget)
10293 choke me
10294 #else
10295 msgget();
10296 #endif
10297
10298 ; return 0; }
10299 EOF
10300 if { (eval echo configure:10301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10301   rm -rf conftest*
10302   eval "ac_cv_func_msgget=yes"
10303 else
10304   echo "configure: failed program was:" >&5
10305   cat conftest.$ac_ext >&5
10306   rm -rf conftest*
10307   eval "ac_cv_func_msgget=no"
10308 fi
10309 rm -f conftest*
10310
10311 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10312   echo "$ac_t""yes" 1>&6
10313   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10314 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10315 echo "configure:10316: checking for sys/ipc.h" >&5
10316
10317 cat > conftest.$ac_ext <<EOF
10318 #line 10319 "configure"
10319 #include "confdefs.h"
10320 #include <sys/ipc.h>
10321 EOF
10322 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10323 { (eval echo configure:10324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10324 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10325 if test -z "$ac_err"; then
10326   rm -rf conftest*
10327   eval "ac_cv_header_$ac_safe=yes"
10328 else
10329   echo "$ac_err" >&5
10330   echo "configure: failed program was:" >&5
10331   cat conftest.$ac_ext >&5
10332   rm -rf conftest*
10333   eval "ac_cv_header_$ac_safe=no"
10334 fi
10335 rm -f conftest*
10336 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10337   echo "$ac_t""yes" 1>&6
10338   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10339 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10340 echo "configure:10341: checking for sys/msg.h" >&5
10341
10342 cat > conftest.$ac_ext <<EOF
10343 #line 10344 "configure"
10344 #include "confdefs.h"
10345 #include <sys/msg.h>
10346 EOF
10347 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10348 { (eval echo configure:10349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10349 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10350 if test -z "$ac_err"; then
10351   rm -rf conftest*
10352   eval "ac_cv_header_$ac_safe=yes"
10353 else
10354   echo "$ac_err" >&5
10355   echo "configure: failed program was:" >&5
10356   cat conftest.$ac_ext >&5
10357   rm -rf conftest*
10358   eval "ac_cv_header_$ac_safe=no"
10359 fi
10360 rm -f conftest*
10361 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10362   echo "$ac_t""yes" 1>&6
10363   { test "$extra_verbose" = "yes" && cat << \EOF
10364     Defining HAVE_SYSVIPC
10365 EOF
10366 cat >> confdefs.h <<\EOF
10367 #define HAVE_SYSVIPC 1
10368 EOF
10369 }
10370
10371 else
10372   echo "$ac_t""no" 1>&6
10373 fi
10374
10375 else
10376   echo "$ac_t""no" 1>&6
10377 fi
10378
10379 else
10380   echo "$ac_t""no" 1>&6
10381 fi
10382
10383
10384 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10385 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10386 echo "configure:10387: checking for dirent.h" >&5
10387
10388 cat > conftest.$ac_ext <<EOF
10389 #line 10390 "configure"
10390 #include "confdefs.h"
10391 #include <dirent.h>
10392 EOF
10393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10394 { (eval echo configure:10395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10395 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10396 if test -z "$ac_err"; then
10397   rm -rf conftest*
10398   eval "ac_cv_header_$ac_safe=yes"
10399 else
10400   echo "$ac_err" >&5
10401   echo "configure: failed program was:" >&5
10402   cat conftest.$ac_ext >&5
10403   rm -rf conftest*
10404   eval "ac_cv_header_$ac_safe=no"
10405 fi
10406 rm -f conftest*
10407 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10408   echo "$ac_t""yes" 1>&6
10409   { test "$extra_verbose" = "yes" && cat << \EOF
10410     Defining SYSV_SYSTEM_DIR
10411 EOF
10412 cat >> confdefs.h <<\EOF
10413 #define SYSV_SYSTEM_DIR 1
10414 EOF
10415 }
10416
10417 else
10418   echo "$ac_t""no" 1>&6
10419 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10420 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10421 echo "configure:10422: checking for sys/dir.h" >&5
10422
10423 cat > conftest.$ac_ext <<EOF
10424 #line 10425 "configure"
10425 #include "confdefs.h"
10426 #include <sys/dir.h>
10427 EOF
10428 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10429 { (eval echo configure:10430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10430 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10431 if test -z "$ac_err"; then
10432   rm -rf conftest*
10433   eval "ac_cv_header_$ac_safe=yes"
10434 else
10435   echo "$ac_err" >&5
10436   echo "configure: failed program was:" >&5
10437   cat conftest.$ac_ext >&5
10438   rm -rf conftest*
10439   eval "ac_cv_header_$ac_safe=no"
10440 fi
10441 rm -f conftest*
10442 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10443   echo "$ac_t""yes" 1>&6
10444   :
10445 else
10446   echo "$ac_t""no" 1>&6
10447 { test "$extra_verbose" = "yes" && cat << \EOF
10448     Defining NONSYSTEM_DIR_LIBRARY
10449 EOF
10450 cat >> confdefs.h <<\EOF
10451 #define NONSYSTEM_DIR_LIBRARY 1
10452 EOF
10453 }
10454
10455 fi
10456
10457 fi
10458
10459
10460 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10461 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10462 echo "configure:10463: checking for nlist.h" >&5
10463
10464 cat > conftest.$ac_ext <<EOF
10465 #line 10466 "configure"
10466 #include "confdefs.h"
10467 #include <nlist.h>
10468 EOF
10469 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10470 { (eval echo configure:10471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10471 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10472 if test -z "$ac_err"; then
10473   rm -rf conftest*
10474   eval "ac_cv_header_$ac_safe=yes"
10475 else
10476   echo "$ac_err" >&5
10477   echo "configure: failed program was:" >&5
10478   cat conftest.$ac_ext >&5
10479   rm -rf conftest*
10480   eval "ac_cv_header_$ac_safe=no"
10481 fi
10482 rm -f conftest*
10483 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10484   echo "$ac_t""yes" 1>&6
10485   { test "$extra_verbose" = "yes" && cat << \EOF
10486     Defining NLIST_STRUCT
10487 EOF
10488 cat >> confdefs.h <<\EOF
10489 #define NLIST_STRUCT 1
10490 EOF
10491 }
10492
10493 else
10494   echo "$ac_t""no" 1>&6
10495 fi
10496
10497
10498
10499 echo "checking "for sound support"" 1>&6
10500 echo "configure:10501: checking "for sound support"" >&5
10501 case "$with_sound" in
10502   native | both ) with_native_sound=yes;;
10503   nas    | no   ) with_native_sound=no;;
10504 esac
10505 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10506
10507 if test "$with_native_sound" != "no"; then
10508     if test -n "$native_sound_lib"; then
10509     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10510 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10511 echo "configure:10512: checking for multimedia/audio_device.h" >&5
10512
10513 cat > conftest.$ac_ext <<EOF
10514 #line 10515 "configure"
10515 #include "confdefs.h"
10516 #include <multimedia/audio_device.h>
10517 EOF
10518 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10519 { (eval echo configure:10520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10520 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10521 if test -z "$ac_err"; then
10522   rm -rf conftest*
10523   eval "ac_cv_header_$ac_safe=yes"
10524 else
10525   echo "$ac_err" >&5
10526   echo "configure: failed program was:" >&5
10527   cat conftest.$ac_ext >&5
10528   rm -rf conftest*
10529   eval "ac_cv_header_$ac_safe=no"
10530 fi
10531 rm -f conftest*
10532 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10533   echo "$ac_t""yes" 1>&6
10534   sound_found=yes sound_cflags=""
10535       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10536    echo "    xemacs will be linked with \"sunplay.o\""
10537  fi
10538 else
10539   echo "$ac_t""no" 1>&6
10540 fi
10541
10542   fi
10543
10544     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10545     sound_found=yes
10546     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10547    echo "    xemacs will be linked with \"sunplay.o\""
10548  fi
10549     if test -d "/usr/demo/SOUND/include"
10550       then sound_cflags="-I/usr/demo/SOUND/include"
10551       else sound_cflags="-I/usr/demo/SOUND"
10552     fi
10553     if test -z "$native_sound_lib" ; then
10554       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10555         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10556         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10557       fi
10558     fi
10559   fi
10560
10561     if test -z "$sound_found"; then
10562     case "$canonical" in
10563     *-sgi-* )
10564       if test -z "$native_sound_lib"; then
10565         
10566 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10567 echo "configure:10568: checking for ALopenport in -laudio" >&5
10568 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10569
10570 xe_check_libs=" -laudio "
10571 cat > conftest.$ac_ext <<EOF
10572 #line 10573 "configure"
10573 #include "confdefs.h"
10574 /* Override any gcc2 internal prototype to avoid an error.  */
10575 /* We use char because int might match the return type of a gcc2
10576     builtin and then its argument prototype would still apply.  */
10577 char ALopenport();
10578
10579 int main() {
10580 ALopenport()
10581 ; return 0; }
10582 EOF
10583 if { (eval echo configure:10584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10584   rm -rf conftest*
10585   eval "ac_cv_lib_$ac_lib_var=yes"
10586 else
10587   echo "configure: failed program was:" >&5
10588   cat conftest.$ac_ext >&5
10589   rm -rf conftest*
10590   eval "ac_cv_lib_$ac_lib_var=no"
10591 fi
10592 rm -f conftest*
10593 xe_check_libs=""
10594
10595 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10596   echo "$ac_t""yes" 1>&6
10597   native_sound_lib="-laudio"
10598 else
10599   echo "$ac_t""no" 1>&6
10600 fi
10601
10602
10603       fi
10604       if test -n "$native_sound_lib"; then
10605         sound_found=yes sound_cflags=""
10606         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10607    echo "    xemacs will be linked with \"sgiplay.o\""
10608  fi
10609       fi ;;
10610     hppa*-hp-hpux* )
10611       if test -z "$native_sound_lib"; then
10612         
10613 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10614 echo "configure:10615: checking for AOpenAudio in -lAlib" >&5
10615 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10616
10617 xe_check_libs=" -lAlib "
10618 cat > conftest.$ac_ext <<EOF
10619 #line 10620 "configure"
10620 #include "confdefs.h"
10621 /* Override any gcc2 internal prototype to avoid an error.  */
10622 /* We use char because int might match the return type of a gcc2
10623     builtin and then its argument prototype would still apply.  */
10624 char AOpenAudio();
10625
10626 int main() {
10627 AOpenAudio()
10628 ; return 0; }
10629 EOF
10630 if { (eval echo configure:10631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10631   rm -rf conftest*
10632   eval "ac_cv_lib_$ac_lib_var=yes"
10633 else
10634   echo "configure: failed program was:" >&5
10635   cat conftest.$ac_ext >&5
10636   rm -rf conftest*
10637   eval "ac_cv_lib_$ac_lib_var=no"
10638 fi
10639 rm -f conftest*
10640 xe_check_libs=""
10641
10642 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10643   echo "$ac_t""yes" 1>&6
10644   native_sound_lib="-lAlib"
10645 else
10646   echo "$ac_t""no" 1>&6
10647 fi
10648
10649
10650       fi
10651       if test -n "$native_sound_lib"; then
10652         sound_found=yes
10653         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10654    echo "    xemacs will be linked with \"hpplay.o\""
10655  fi
10656         if test "$GCC" = "yes" # Kludge city
10657           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10658           else sound_cflags="+e -I/usr/audio/examples"
10659         fi
10660       fi ;;
10661     esac
10662   fi
10663
10664     if test -z "$sound_found"; then
10665     for dir in "machine" "sys" "linux"; do
10666       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10667 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10668 echo "configure:10669: checking for ${dir}/soundcard.h" >&5
10669
10670 cat > conftest.$ac_ext <<EOF
10671 #line 10672 "configure"
10672 #include "confdefs.h"
10673 #include <${dir}/soundcard.h>
10674 EOF
10675 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10676 { (eval echo configure:10677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10677 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10678 if test -z "$ac_err"; then
10679   rm -rf conftest*
10680   eval "ac_cv_header_$ac_safe=yes"
10681 else
10682   echo "$ac_err" >&5
10683   echo "configure: failed program was:" >&5
10684   cat conftest.$ac_ext >&5
10685   rm -rf conftest*
10686   eval "ac_cv_header_$ac_safe=no"
10687 fi
10688 rm -f conftest*
10689 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10690   echo "$ac_t""yes" 1>&6
10691   sound_found=yes
10692         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10693    echo "    xemacs will be linked with \"linuxplay.o\""
10694  fi
10695         { test "$extra_verbose" = "yes" && cat << EOF
10696     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10697 EOF
10698 cat >> confdefs.h <<EOF
10699 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10700 EOF
10701 }
10702
10703         break
10704 else
10705   echo "$ac_t""no" 1>&6
10706 fi
10707
10708     done
10709   fi
10710
10711   test "$sound_found" = "yes" && with_native_sound=yes
10712 fi
10713
10714 if test -z "$with_sound"; then
10715   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10716     with_sound=native
10717   fi
10718 fi
10719
10720 if test "$with_native_sound" = "yes"; then
10721   { test "$extra_verbose" = "yes" && cat << \EOF
10722     Defining HAVE_NATIVE_SOUND
10723 EOF
10724 cat >> confdefs.h <<\EOF
10725 #define HAVE_NATIVE_SOUND 1
10726 EOF
10727 }
10728
10729   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10730 fi
10731
10732 case "$with_sound" in both | nas )
10733   { test "$extra_verbose" = "yes" && cat << \EOF
10734     Defining HAVE_NAS_SOUND
10735 EOF
10736 cat >> confdefs.h <<\EOF
10737 #define HAVE_NAS_SOUND 1
10738 EOF
10739 }
10740
10741   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10742    echo "    xemacs will be linked with \"nas.o\""
10743  fi
10744   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10745       cat > conftest.$ac_ext <<EOF
10746 #line 10747 "configure"
10747 #include "confdefs.h"
10748 #include <audio/Xtutil.h>
10749 EOF
10750 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10751   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10752   :
10753 else
10754   rm -rf conftest*
10755   { test "$extra_verbose" = "yes" && cat << \EOF
10756     Defining NAS_NO_ERROR_JUMP
10757 EOF
10758 cat >> confdefs.h <<\EOF
10759 #define NAS_NO_ERROR_JUMP 1
10760 EOF
10761 }
10762
10763 fi
10764 rm -f conftest*
10765
10766 esac
10767
10768
10769 test -z "$with_tty" && with_tty=yes
10770
10771 if test "$with_tty" = "yes"  ; then
10772   echo "checking for TTY-related features" 1>&6
10773 echo "configure:10774: checking for TTY-related features" >&5
10774   { test "$extra_verbose" = "yes" && cat << \EOF
10775     Defining HAVE_TTY
10776 EOF
10777 cat >> confdefs.h <<\EOF
10778 #define HAVE_TTY 1
10779 EOF
10780 }
10781
10782   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
10783    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\""
10784  fi
10785
10786     if test -z "$with_ncurses"; then
10787     
10788 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10789 echo "configure:10790: checking for tgetent in -lncurses" >&5
10790 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10791
10792 xe_check_libs=" -lncurses "
10793 cat > conftest.$ac_ext <<EOF
10794 #line 10795 "configure"
10795 #include "confdefs.h"
10796 /* Override any gcc2 internal prototype to avoid an error.  */
10797 /* We use char because int might match the return type of a gcc2
10798     builtin and then its argument prototype would still apply.  */
10799 char tgetent();
10800
10801 int main() {
10802 tgetent()
10803 ; return 0; }
10804 EOF
10805 if { (eval echo configure:10806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10806   rm -rf conftest*
10807   eval "ac_cv_lib_$ac_lib_var=yes"
10808 else
10809   echo "configure: failed program was:" >&5
10810   cat conftest.$ac_ext >&5
10811   rm -rf conftest*
10812   eval "ac_cv_lib_$ac_lib_var=no"
10813 fi
10814 rm -f conftest*
10815 xe_check_libs=""
10816
10817 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10818   echo "$ac_t""yes" 1>&6
10819   with_ncurses=yes
10820 else
10821   echo "$ac_t""no" 1>&6
10822 with_ncurses=no
10823 fi
10824
10825
10826   fi
10827   if test "$with_ncurses" = "yes"; then
10828     { test "$extra_verbose" = "yes" && cat << \EOF
10829     Defining HAVE_NCURSES
10830 EOF
10831 cat >> confdefs.h <<\EOF
10832 #define HAVE_NCURSES 1
10833 EOF
10834 }
10835
10836     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10837 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10838 echo "configure:10839: checking for ncurses/curses.h" >&5
10839
10840 cat > conftest.$ac_ext <<EOF
10841 #line 10842 "configure"
10842 #include "confdefs.h"
10843 #include <ncurses/curses.h>
10844 EOF
10845 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10846 { (eval echo configure:10847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10847 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10848 if test -z "$ac_err"; then
10849   rm -rf conftest*
10850   eval "ac_cv_header_$ac_safe=yes"
10851 else
10852   echo "$ac_err" >&5
10853   echo "configure: failed program was:" >&5
10854   cat conftest.$ac_ext >&5
10855   rm -rf conftest*
10856   eval "ac_cv_header_$ac_safe=no"
10857 fi
10858 rm -f conftest*
10859 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10860   echo "$ac_t""yes" 1>&6
10861   curses_h_path=ncurses/curses.h
10862 else
10863   echo "$ac_t""no" 1>&6
10864 fi
10865
10866     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10867 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10868 echo "configure:10869: checking for ncurses/term.h" >&5
10869
10870 cat > conftest.$ac_ext <<EOF
10871 #line 10872 "configure"
10872 #include "confdefs.h"
10873 #include <ncurses/term.h>
10874 EOF
10875 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10876 { (eval echo configure:10877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10877 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10878 if test -z "$ac_err"; then
10879   rm -rf conftest*
10880   eval "ac_cv_header_$ac_safe=yes"
10881 else
10882   echo "$ac_err" >&5
10883   echo "configure: failed program was:" >&5
10884   cat conftest.$ac_ext >&5
10885   rm -rf conftest*
10886   eval "ac_cv_header_$ac_safe=no"
10887 fi
10888 rm -f conftest*
10889 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10890   echo "$ac_t""yes" 1>&6
10891   term_h_path=ncurses/term.h
10892 else
10893   echo "$ac_t""no" 1>&6
10894 fi
10895
10896     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10897    echo "    xemacs will be linked with \"terminfo.o\""
10898  fi
10899     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10900
10901     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10902                         save_c_switch_site="$c_switch_site"
10903       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10904       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10905 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10906 echo "configure:10907: checking for ncurses/curses.h" >&5
10907
10908 cat > conftest.$ac_ext <<EOF
10909 #line 10910 "configure"
10910 #include "confdefs.h"
10911 #include <ncurses/curses.h>
10912 EOF
10913 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10914 { (eval echo configure:10915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10915 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10916 if test -z "$ac_err"; then
10917   rm -rf conftest*
10918   eval "ac_cv_header_$ac_safe=yes"
10919 else
10920   echo "$ac_err" >&5
10921   echo "configure: failed program was:" >&5
10922   cat conftest.$ac_ext >&5
10923   rm -rf conftest*
10924   eval "ac_cv_header_$ac_safe=no"
10925 fi
10926 rm -f conftest*
10927 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10928   echo "$ac_t""yes" 1>&6
10929   curses_h_path=ncurses/curses.h
10930 else
10931   echo "$ac_t""no" 1>&6
10932 fi
10933
10934       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10935         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10936         else c_switch_site="$save_c_switch_site"
10937       fi
10938     fi
10939   else         if test "$have_terminfo" = "yes"; then
10940       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10941    echo "    xemacs will be linked with \"terminfo.o\""
10942  fi
10943       if test -n "$libs_termcap"; then
10944         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10945       else
10946         for lib in curses termlib termcap; do
10947           
10948 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10949 echo "configure:10950: checking for tgetent in -l$lib" >&5
10950 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10951
10952 xe_check_libs=" -l$lib "
10953 cat > conftest.$ac_ext <<EOF
10954 #line 10955 "configure"
10955 #include "confdefs.h"
10956 /* Override any gcc2 internal prototype to avoid an error.  */
10957 /* We use char because int might match the return type of a gcc2
10958     builtin and then its argument prototype would still apply.  */
10959 char tgetent();
10960
10961 int main() {
10962 tgetent()
10963 ; return 0; }
10964 EOF
10965 if { (eval echo configure:10966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10966   rm -rf conftest*
10967   eval "ac_cv_lib_$ac_lib_var=yes"
10968 else
10969   echo "configure: failed program was:" >&5
10970   cat conftest.$ac_ext >&5
10971   rm -rf conftest*
10972   eval "ac_cv_lib_$ac_lib_var=no"
10973 fi
10974 rm -f conftest*
10975 xe_check_libs=""
10976
10977 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10978   echo "$ac_t""yes" 1>&6
10979   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10980 else
10981   echo "$ac_t""no" 1>&6
10982 fi
10983
10984
10985         done
10986       fi
10987     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10988    echo "    xemacs will be linked with \"tparam.o\""
10989  fi
10990                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10991       if test -n "$libs_termcap"; then
10992         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10993       else
10994         
10995 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10996 echo "configure:10997: checking for tgetent in -lcurses" >&5
10997 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10998
10999 xe_check_libs=" -lcurses "
11000 cat > conftest.$ac_ext <<EOF
11001 #line 11002 "configure"
11002 #include "confdefs.h"
11003 /* Override any gcc2 internal prototype to avoid an error.  */
11004 /* We use char because int might match the return type of a gcc2
11005     builtin and then its argument prototype would still apply.  */
11006 char tgetent();
11007
11008 int main() {
11009 tgetent()
11010 ; return 0; }
11011 EOF
11012 if { (eval echo configure:11013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11013   rm -rf conftest*
11014   eval "ac_cv_lib_$ac_lib_var=yes"
11015 else
11016   echo "configure: failed program was:" >&5
11017   cat conftest.$ac_ext >&5
11018   rm -rf conftest*
11019   eval "ac_cv_lib_$ac_lib_var=no"
11020 fi
11021 rm -f conftest*
11022 xe_check_libs=""
11023
11024 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11025   echo "$ac_t""yes" 1>&6
11026   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
11027 else
11028   echo "$ac_t""no" 1>&6
11029 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
11030 echo "configure:11031: checking for tgetent in -ltermcap" >&5
11031 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
11032
11033 xe_check_libs=" -ltermcap "
11034 cat > conftest.$ac_ext <<EOF
11035 #line 11036 "configure"
11036 #include "confdefs.h"
11037 /* Override any gcc2 internal prototype to avoid an error.  */
11038 /* We use char because int might match the return type of a gcc2
11039     builtin and then its argument prototype would still apply.  */
11040 char tgetent();
11041
11042 int main() {
11043 tgetent()
11044 ; return 0; }
11045 EOF
11046 if { (eval echo configure:11047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11047   rm -rf conftest*
11048   eval "ac_cv_lib_$ac_lib_var=yes"
11049 else
11050   echo "configure: failed program was:" >&5
11051   cat conftest.$ac_ext >&5
11052   rm -rf conftest*
11053   eval "ac_cv_lib_$ac_lib_var=no"
11054 fi
11055 rm -f conftest*
11056 xe_check_libs=""
11057
11058 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11059   echo "$ac_t""yes" 1>&6
11060   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11061 else
11062   echo "$ac_t""no" 1>&6
11063 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11064    echo "    xemacs will be linked with \"termcap.o\""
11065  fi
11066 fi
11067
11068
11069 fi
11070
11071
11072       fi
11073     fi
11074   fi
11075   { test "$extra_verbose" = "yes" && cat << EOF
11076     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11077 EOF
11078 cat >> confdefs.h <<EOF
11079 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11080 EOF
11081 }
11082
11083   { test "$extra_verbose" = "yes" && cat << EOF
11084     Defining TERM_H_PATH = "${term_h_path-term.h}"
11085 EOF
11086 cat >> confdefs.h <<EOF
11087 #define TERM_H_PATH "${term_h_path-term.h}"
11088 EOF
11089 }
11090
11091
11092     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11093 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11094 echo "configure:11095: checking for gpm.h" >&5
11095
11096 cat > conftest.$ac_ext <<EOF
11097 #line 11098 "configure"
11098 #include "confdefs.h"
11099 #include <gpm.h>
11100 EOF
11101 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11102 { (eval echo configure:11103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11103 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11104 if test -z "$ac_err"; then
11105   rm -rf conftest*
11106   eval "ac_cv_header_$ac_safe=yes"
11107 else
11108   echo "$ac_err" >&5
11109   echo "configure: failed program was:" >&5
11110   cat conftest.$ac_ext >&5
11111   rm -rf conftest*
11112   eval "ac_cv_header_$ac_safe=no"
11113 fi
11114 rm -f conftest*
11115 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11116   echo "$ac_t""yes" 1>&6
11117   :
11118 else
11119   echo "$ac_t""no" 1>&6
11120 with_gpm=no
11121 fi
11122  }
11123   test -z "$with_gpm" && { 
11124 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11125 echo "configure:11126: checking for Gpm_Open in -lgpm" >&5
11126 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11127
11128 xe_check_libs=" -lgpm "
11129 cat > conftest.$ac_ext <<EOF
11130 #line 11131 "configure"
11131 #include "confdefs.h"
11132 /* Override any gcc2 internal prototype to avoid an error.  */
11133 /* We use char because int might match the return type of a gcc2
11134     builtin and then its argument prototype would still apply.  */
11135 char Gpm_Open();
11136
11137 int main() {
11138 Gpm_Open()
11139 ; return 0; }
11140 EOF
11141 if { (eval echo configure:11142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11142   rm -rf conftest*
11143   eval "ac_cv_lib_$ac_lib_var=yes"
11144 else
11145   echo "configure: failed program was:" >&5
11146   cat conftest.$ac_ext >&5
11147   rm -rf conftest*
11148   eval "ac_cv_lib_$ac_lib_var=no"
11149 fi
11150 rm -f conftest*
11151 xe_check_libs=""
11152
11153 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11154   echo "$ac_t""yes" 1>&6
11155   with_gpm=yes
11156 else
11157   echo "$ac_t""no" 1>&6
11158 with_gpm=no
11159 fi
11160
11161  }
11162   if test "$with_gpm" = "yes"; then
11163     { test "$extra_verbose" = "yes" && cat << \EOF
11164     Defining HAVE_GPM
11165 EOF
11166 cat >> confdefs.h <<\EOF
11167 #define HAVE_GPM 1
11168 EOF
11169 }
11170
11171     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11172    echo "    xemacs will be linked with \"gpmevent.o\""
11173  fi
11174     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11175   fi
11176
11177 else   for feature in ncurses gpm; do
11178     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11179       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11180     fi
11181     eval "with_${feature}=no"
11182   done
11183 fi 
11184 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11185    echo "    xemacs will be linked with \"event-unixoid.o\""
11186  fi
11187
11188
11189 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11190   != "no no no" && echo "checking for database support" 1>&6
11191 echo "configure:11192: checking for database support" >&5
11192
11193 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11194   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11195 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11196 echo "configure:11197: checking for ndbm.h" >&5
11197
11198 cat > conftest.$ac_ext <<EOF
11199 #line 11200 "configure"
11200 #include "confdefs.h"
11201 #include <ndbm.h>
11202 EOF
11203 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11204 { (eval echo configure:11205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11205 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11206 if test -z "$ac_err"; then
11207   rm -rf conftest*
11208   eval "ac_cv_header_$ac_safe=yes"
11209 else
11210   echo "$ac_err" >&5
11211   echo "configure: failed program was:" >&5
11212   cat conftest.$ac_ext >&5
11213   rm -rf conftest*
11214   eval "ac_cv_header_$ac_safe=no"
11215 fi
11216 rm -f conftest*
11217 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11218   echo "$ac_t""yes" 1>&6
11219   :
11220 else
11221   echo "$ac_t""no" 1>&6
11222
11223     test "$with_database_gnudbm" = "yes" -o \
11224          "$with_database_dbm"    = "yes" && \
11225       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11226     with_database_gnudbm=no with_database_dbm=no
11227 fi
11228
11229 fi
11230
11231 if test "$with_database_gnudbm" != "no"; then
11232   
11233 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11234 echo "configure:11235: checking for dbm_open in -lgdbm" >&5
11235 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11236
11237 xe_check_libs=" -lgdbm "
11238 cat > conftest.$ac_ext <<EOF
11239 #line 11240 "configure"
11240 #include "confdefs.h"
11241 /* Override any gcc2 internal prototype to avoid an error.  */
11242 /* We use char because int might match the return type of a gcc2
11243     builtin and then its argument prototype would still apply.  */
11244 char dbm_open();
11245
11246 int main() {
11247 dbm_open()
11248 ; return 0; }
11249 EOF
11250 if { (eval echo configure:11251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11251   rm -rf conftest*
11252   eval "ac_cv_lib_$ac_lib_var=yes"
11253 else
11254   echo "configure: failed program was:" >&5
11255   cat conftest.$ac_ext >&5
11256   rm -rf conftest*
11257   eval "ac_cv_lib_$ac_lib_var=no"
11258 fi
11259 rm -f conftest*
11260 xe_check_libs=""
11261
11262 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11263   echo "$ac_t""yes" 1>&6
11264   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11265 else
11266   echo "$ac_t""no" 1>&6
11267 if test "$with_database_gnudbm" = "yes"; then
11268      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11269    fi
11270    with_database_gnudbm=no
11271 fi
11272
11273
11274 fi
11275
11276 if test "$with_database_dbm" != "no"; then
11277   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11278 echo "configure:11279: checking for dbm_open" >&5
11279
11280 cat > conftest.$ac_ext <<EOF
11281 #line 11282 "configure"
11282 #include "confdefs.h"
11283 /* System header to define __stub macros and hopefully few prototypes,
11284     which can conflict with char dbm_open(); below.  */
11285 #include <assert.h>
11286 /* Override any gcc2 internal prototype to avoid an error.  */
11287 /* We use char because int might match the return type of a gcc2
11288     builtin and then its argument prototype would still apply.  */
11289 char dbm_open();
11290
11291 int main() {
11292
11293 /* The GNU C library defines this for functions which it implements
11294     to always fail with ENOSYS.  Some functions are actually named
11295     something starting with __ and the normal name is an alias.  */
11296 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11297 choke me
11298 #else
11299 dbm_open();
11300 #endif
11301
11302 ; return 0; }
11303 EOF
11304 if { (eval echo configure:11305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11305   rm -rf conftest*
11306   eval "ac_cv_func_dbm_open=yes"
11307 else
11308   echo "configure: failed program was:" >&5
11309   cat conftest.$ac_ext >&5
11310   rm -rf conftest*
11311   eval "ac_cv_func_dbm_open=no"
11312 fi
11313 rm -f conftest*
11314
11315 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11316   echo "$ac_t""yes" 1>&6
11317   with_database_dbm=yes libdbm=
11318 else
11319   echo "$ac_t""no" 1>&6
11320
11321     
11322 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11323 echo "configure:11324: checking for dbm_open in -ldbm" >&5
11324 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11325
11326 xe_check_libs=" -ldbm "
11327 cat > conftest.$ac_ext <<EOF
11328 #line 11329 "configure"
11329 #include "confdefs.h"
11330 /* Override any gcc2 internal prototype to avoid an error.  */
11331 /* We use char because int might match the return type of a gcc2
11332     builtin and then its argument prototype would still apply.  */
11333 char dbm_open();
11334
11335 int main() {
11336 dbm_open()
11337 ; return 0; }
11338 EOF
11339 if { (eval echo configure:11340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11340   rm -rf conftest*
11341   eval "ac_cv_lib_$ac_lib_var=yes"
11342 else
11343   echo "configure: failed program was:" >&5
11344   cat conftest.$ac_ext >&5
11345   rm -rf conftest*
11346   eval "ac_cv_lib_$ac_lib_var=no"
11347 fi
11348 rm -f conftest*
11349 xe_check_libs=""
11350
11351 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11352   echo "$ac_t""yes" 1>&6
11353   with_database_dbm=yes libdbm=-ldbm
11354 else
11355   echo "$ac_t""no" 1>&6
11356 test "$with_database_dbm" = "yes" && \
11357         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11358       with_database_dbm=no
11359 fi
11360
11361
11362 fi
11363
11364 fi
11365
11366 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11367 test "$with_database_gnudbm" = "yes" -o \
11368      "$with_database_dbm"    = "yes" && \
11369   { test "$extra_verbose" = "yes" && cat << \EOF
11370     Defining HAVE_DBM
11371 EOF
11372 cat >> confdefs.h <<\EOF
11373 #define HAVE_DBM 1
11374 EOF
11375 }
11376
11377
11378 if test "$with_database_berkdb" != "no"; then
11379   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11380 echo "configure:11381: checking for Berkeley db.h" >&5
11381   for path in "db/db.h" "db.h"; do
11382     cat > conftest.$ac_ext <<EOF
11383 #line 11384 "configure"
11384 #include "confdefs.h"
11385 #ifdef HAVE_INTTYPES_H
11386 #define __BIT_TYPES_DEFINED__
11387 #include <inttypes.h>
11388 typedef uint8_t  u_int8_t;
11389 typedef uint16_t u_int16_t;
11390 typedef uint32_t u_int32_t;
11391 #ifdef WE_DONT_NEED_QUADS
11392 typedef uint64_t u_int64_t;
11393 #endif
11394 #endif
11395 #include <$path>
11396
11397 int main() {
11398
11399 ; return 0; }
11400 EOF
11401 if { (eval echo configure:11402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11402   rm -rf conftest*
11403   db_h_path="$path"; break
11404 else
11405   echo "configure: failed program was:" >&5
11406   cat conftest.$ac_ext >&5
11407 fi
11408 rm -f conftest*
11409   done
11410   if test -z "$db_h_path"
11411   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11412   else echo "$ac_t""$db_h_path" 1>&6
11413   fi
11414
11415   if test "$with_database_berkdb" != "no"; then
11416     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11417 echo "configure:11418: checking for Berkeley DB version" >&5
11418     cat > conftest.$ac_ext <<EOF
11419 #line 11420 "configure"
11420 #include "confdefs.h"
11421 #include <$db_h_path>
11422 #if DB_VERSION_MAJOR > 1
11423 yes
11424 #endif
11425
11426 EOF
11427 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11428   egrep "yes" >/dev/null 2>&1; then
11429   rm -rf conftest*
11430   echo "$ac_t""2" 1>&6; dbfunc=db_open
11431 else
11432   rm -rf conftest*
11433   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11434 fi
11435 rm -f conftest*
11436
11437     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11438 echo "configure:11439: checking for $dbfunc" >&5
11439
11440 cat > conftest.$ac_ext <<EOF
11441 #line 11442 "configure"
11442 #include "confdefs.h"
11443 /* System header to define __stub macros and hopefully few prototypes,
11444     which can conflict with char $dbfunc(); below.  */
11445 #include <assert.h>
11446 /* Override any gcc2 internal prototype to avoid an error.  */
11447 /* We use char because int might match the return type of a gcc2
11448     builtin and then its argument prototype would still apply.  */
11449 char $dbfunc();
11450
11451 int main() {
11452
11453 /* The GNU C library defines this for functions which it implements
11454     to always fail with ENOSYS.  Some functions are actually named
11455     something starting with __ and the normal name is an alias.  */
11456 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11457 choke me
11458 #else
11459 $dbfunc();
11460 #endif
11461
11462 ; return 0; }
11463 EOF
11464 if { (eval echo configure:11465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11465   rm -rf conftest*
11466   eval "ac_cv_func_$dbfunc=yes"
11467 else
11468   echo "configure: failed program was:" >&5
11469   cat conftest.$ac_ext >&5
11470   rm -rf conftest*
11471   eval "ac_cv_func_$dbfunc=no"
11472 fi
11473 rm -f conftest*
11474
11475 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11476   echo "$ac_t""yes" 1>&6
11477   with_database_berkdb=yes need_libdb=no
11478 else
11479   echo "$ac_t""no" 1>&6
11480
11481     
11482 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11483 echo "configure:11484: checking for $dbfunc in -ldb" >&5
11484 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11485
11486 xe_check_libs=" -ldb "
11487 cat > conftest.$ac_ext <<EOF
11488 #line 11489 "configure"
11489 #include "confdefs.h"
11490 /* Override any gcc2 internal prototype to avoid an error.  */
11491 /* We use char because int might match the return type of a gcc2
11492     builtin and then its argument prototype would still apply.  */
11493 char $dbfunc();
11494
11495 int main() {
11496 $dbfunc()
11497 ; return 0; }
11498 EOF
11499 if { (eval echo configure:11500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11500   rm -rf conftest*
11501   eval "ac_cv_lib_$ac_lib_var=yes"
11502 else
11503   echo "configure: failed program was:" >&5
11504   cat conftest.$ac_ext >&5
11505   rm -rf conftest*
11506   eval "ac_cv_lib_$ac_lib_var=no"
11507 fi
11508 rm -f conftest*
11509 xe_check_libs=""
11510
11511 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11512   echo "$ac_t""yes" 1>&6
11513   with_database_berkdb=yes need_libdb=yes
11514 else
11515   echo "$ac_t""no" 1>&6
11516 fi
11517
11518
11519 fi
11520
11521   fi
11522
11523   if test "$with_database_berkdb" = "yes"; then
11524     { test "$extra_verbose" = "yes" && cat << EOF
11525     Defining DB_H_PATH = "$db_h_path"
11526 EOF
11527 cat >> confdefs.h <<EOF
11528 #define DB_H_PATH "$db_h_path"
11529 EOF
11530 }
11531
11532     { test "$extra_verbose" = "yes" && cat << \EOF
11533     Defining HAVE_BERKELEY_DB
11534 EOF
11535 cat >> confdefs.h <<\EOF
11536 #define HAVE_BERKELEY_DB 1
11537 EOF
11538 }
11539
11540     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11541   else with_database_berkdb=no
11542   fi
11543 fi
11544
11545 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11546      != "no no no"; then
11547   { test "$extra_verbose" = "yes" && cat << \EOF
11548     Defining HAVE_DATABASE
11549 EOF
11550 cat >> confdefs.h <<\EOF
11551 #define HAVE_DATABASE 1
11552 EOF
11553 }
11554
11555   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11556    echo "    xemacs will be linked with \"database.o\""
11557  fi
11558 fi
11559
11560 if test "$with_socks" = "yes"; then
11561   
11562 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11563 echo "configure:11564: checking for SOCKSinit in -lsocks" >&5
11564 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11565
11566 xe_check_libs=" -lsocks "
11567 cat > conftest.$ac_ext <<EOF
11568 #line 11569 "configure"
11569 #include "confdefs.h"
11570 /* Override any gcc2 internal prototype to avoid an error.  */
11571 /* We use char because int might match the return type of a gcc2
11572     builtin and then its argument prototype would still apply.  */
11573 char SOCKSinit();
11574
11575 int main() {
11576 SOCKSinit()
11577 ; return 0; }
11578 EOF
11579 if { (eval echo configure:11580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11580   rm -rf conftest*
11581   eval "ac_cv_lib_$ac_lib_var=yes"
11582 else
11583   echo "configure: failed program was:" >&5
11584   cat conftest.$ac_ext >&5
11585   rm -rf conftest*
11586   eval "ac_cv_lib_$ac_lib_var=no"
11587 fi
11588 rm -f conftest*
11589 xe_check_libs=""
11590
11591 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11592   echo "$ac_t""yes" 1>&6
11593     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11594     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11595   { test "$extra_verbose" = "yes" && cat << EOF
11596     Defining $ac_tr_lib
11597 EOF
11598 cat >> confdefs.h <<EOF
11599 #define $ac_tr_lib 1
11600 EOF
11601 }
11602
11603   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11604
11605 else
11606   echo "$ac_t""no" 1>&6
11607 fi
11608
11609
11610   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11611     Defining HAVE_SOCKS
11612 EOF
11613 cat >> confdefs.h <<\EOF
11614 #define HAVE_SOCKS 1
11615 EOF
11616 }
11617
11618 fi
11619
11620 if test "$usage_tracking" = "yes"; then
11621   { test "$extra_verbose" = "yes" && cat << \EOF
11622     Defining USAGE_TRACKING
11623 EOF
11624 cat >> confdefs.h <<\EOF
11625 #define USAGE_TRACKING 1
11626 EOF
11627 }
11628
11629   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11630 fi
11631
11632 for ac_hdr in dlfcn.h
11633 do
11634 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11635 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11636 echo "configure:11637: checking for $ac_hdr" >&5
11637
11638 cat > conftest.$ac_ext <<EOF
11639 #line 11640 "configure"
11640 #include "confdefs.h"
11641 #include <$ac_hdr>
11642 EOF
11643 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11644 { (eval echo configure:11645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11645 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11646 if test -z "$ac_err"; then
11647   rm -rf conftest*
11648   eval "ac_cv_header_$ac_safe=yes"
11649 else
11650   echo "$ac_err" >&5
11651   echo "configure: failed program was:" >&5
11652   cat conftest.$ac_ext >&5
11653   rm -rf conftest*
11654   eval "ac_cv_header_$ac_safe=no"
11655 fi
11656 rm -f conftest*
11657 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11658   echo "$ac_t""yes" 1>&6
11659     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11660   { test "$extra_verbose" = "yes" && cat << EOF
11661     Defining $ac_tr_hdr
11662 EOF
11663 cat >> confdefs.h <<EOF
11664 #define $ac_tr_hdr 1
11665 EOF
11666 }
11667  have_dlfcn=yes
11668   { test "$extra_verbose" = "yes" && cat << \EOF
11669     Defining HAVE_DLFCN_H
11670 EOF
11671 cat >> confdefs.h <<\EOF
11672 #define HAVE_DLFCN_H 1
11673 EOF
11674 }
11675
11676 else
11677   echo "$ac_t""no" 1>&6
11678 fi
11679 done
11680
11681 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11682 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11683 echo "configure:11684: checking for dlopen in -ldl" >&5
11684 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11685
11686 xe_check_libs=" -ldl "
11687 cat > conftest.$ac_ext <<EOF
11688 #line 11689 "configure"
11689 #include "confdefs.h"
11690 /* Override any gcc2 internal prototype to avoid an error.  */
11691 /* We use char because int might match the return type of a gcc2
11692     builtin and then its argument prototype would still apply.  */
11693 char dlopen();
11694
11695 int main() {
11696 dlopen()
11697 ; return 0; }
11698 EOF
11699 if { (eval echo configure:11700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11700   rm -rf conftest*
11701   eval "ac_cv_lib_$ac_lib_var=yes"
11702 else
11703   echo "configure: failed program was:" >&5
11704   cat conftest.$ac_ext >&5
11705   rm -rf conftest*
11706   eval "ac_cv_lib_$ac_lib_var=no"
11707 fi
11708 rm -f conftest*
11709 xe_check_libs=""
11710
11711 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11712   echo "$ac_t""yes" 1>&6
11713   { test "$extra_verbose" = "yes" && cat << \EOF
11714     Defining HAVE_DLOPEN
11715 EOF
11716 cat >> confdefs.h <<\EOF
11717 #define HAVE_DLOPEN 1
11718 EOF
11719 }
11720  DLL_LIB=dl;  with_modules=yes
11721 else
11722   echo "$ac_t""no" 1>&6
11723 fi
11724
11725  }
11726 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11727 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11728 echo "configure:11729: checking for _dlopen in -lc" >&5
11729 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11730
11731 xe_check_libs=" -lc "
11732 cat > conftest.$ac_ext <<EOF
11733 #line 11734 "configure"
11734 #include "confdefs.h"
11735 /* Override any gcc2 internal prototype to avoid an error.  */
11736 /* We use char because int might match the return type of a gcc2
11737     builtin and then its argument prototype would still apply.  */
11738 char _dlopen();
11739
11740 int main() {
11741 _dlopen()
11742 ; return 0; }
11743 EOF
11744 if { (eval echo configure:11745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11745   rm -rf conftest*
11746   eval "ac_cv_lib_$ac_lib_var=yes"
11747 else
11748   echo "configure: failed program was:" >&5
11749   cat conftest.$ac_ext >&5
11750   rm -rf conftest*
11751   eval "ac_cv_lib_$ac_lib_var=no"
11752 fi
11753 rm -f conftest*
11754 xe_check_libs=""
11755
11756 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11757   echo "$ac_t""yes" 1>&6
11758   { test "$extra_verbose" = "yes" && cat << \EOF
11759     Defining HAVE_DLOPEN
11760 EOF
11761 cat >> confdefs.h <<\EOF
11762 #define HAVE_DLOPEN 1
11763 EOF
11764 }
11765  DLL_LIB=;   with_modules=yes
11766 else
11767   echo "$ac_t""no" 1>&6
11768 fi
11769
11770  }
11771 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11772 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11773 echo "configure:11774: checking for dlopen in -lc" >&5
11774 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11775
11776 xe_check_libs=" -lc "
11777 cat > conftest.$ac_ext <<EOF
11778 #line 11779 "configure"
11779 #include "confdefs.h"
11780 /* Override any gcc2 internal prototype to avoid an error.  */
11781 /* We use char because int might match the return type of a gcc2
11782     builtin and then its argument prototype would still apply.  */
11783 char dlopen();
11784
11785 int main() {
11786 dlopen()
11787 ; return 0; }
11788 EOF
11789 if { (eval echo configure:11790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11790   rm -rf conftest*
11791   eval "ac_cv_lib_$ac_lib_var=yes"
11792 else
11793   echo "configure: failed program was:" >&5
11794   cat conftest.$ac_ext >&5
11795   rm -rf conftest*
11796   eval "ac_cv_lib_$ac_lib_var=no"
11797 fi
11798 rm -f conftest*
11799 xe_check_libs=""
11800
11801 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11802   echo "$ac_t""yes" 1>&6
11803   { test "$extra_verbose" = "yes" && cat << \EOF
11804     Defining HAVE_DLOPEN
11805 EOF
11806 cat >> confdefs.h <<\EOF
11807 #define HAVE_DLOPEN 1
11808 EOF
11809 }
11810  DLL_LIB=;   with_modules=yes
11811 else
11812   echo "$ac_t""no" 1>&6
11813 fi
11814
11815  }
11816 test -z "$with_modules" && { 
11817 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11818 echo "configure:11819: checking for shl_load in -ldld" >&5
11819 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11820
11821 xe_check_libs=" -ldld "
11822 cat > conftest.$ac_ext <<EOF
11823 #line 11824 "configure"
11824 #include "confdefs.h"
11825 /* Override any gcc2 internal prototype to avoid an error.  */
11826 /* We use char because int might match the return type of a gcc2
11827     builtin and then its argument prototype would still apply.  */
11828 char shl_load();
11829
11830 int main() {
11831 shl_load()
11832 ; return 0; }
11833 EOF
11834 if { (eval echo configure:11835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11835   rm -rf conftest*
11836   eval "ac_cv_lib_$ac_lib_var=yes"
11837 else
11838   echo "configure: failed program was:" >&5
11839   cat conftest.$ac_ext >&5
11840   rm -rf conftest*
11841   eval "ac_cv_lib_$ac_lib_var=no"
11842 fi
11843 rm -f conftest*
11844 xe_check_libs=""
11845
11846 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11847   echo "$ac_t""yes" 1>&6
11848   { test "$extra_verbose" = "yes" && cat << \EOF
11849     Defining HAVE_SHL_LOAD
11850 EOF
11851 cat >> confdefs.h <<\EOF
11852 #define HAVE_SHL_LOAD 1
11853 EOF
11854 }
11855  DLL_LIB=dld; with_modules=yes
11856 else
11857   echo "$ac_t""no" 1>&6
11858 fi
11859
11860  }
11861 test -z "$with_modules" && { 
11862 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11863 echo "configure:11864: checking for dld_init in -ldld" >&5
11864 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11865
11866 xe_check_libs=" -ldld "
11867 cat > conftest.$ac_ext <<EOF
11868 #line 11869 "configure"
11869 #include "confdefs.h"
11870 /* Override any gcc2 internal prototype to avoid an error.  */
11871 /* We use char because int might match the return type of a gcc2
11872     builtin and then its argument prototype would still apply.  */
11873 char dld_init();
11874
11875 int main() {
11876 dld_init()
11877 ; return 0; }
11878 EOF
11879 if { (eval echo configure:11880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11880   rm -rf conftest*
11881   eval "ac_cv_lib_$ac_lib_var=yes"
11882 else
11883   echo "configure: failed program was:" >&5
11884   cat conftest.$ac_ext >&5
11885   rm -rf conftest*
11886   eval "ac_cv_lib_$ac_lib_var=no"
11887 fi
11888 rm -f conftest*
11889 xe_check_libs=""
11890
11891 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11892   echo "$ac_t""yes" 1>&6
11893   { test "$extra_verbose" = "yes" && cat << \EOF
11894     Defining HAVE_DLD_INIT
11895 EOF
11896 cat >> confdefs.h <<\EOF
11897 #define HAVE_DLD_INIT 1
11898 EOF
11899 }
11900  DLL_LIB=dld; with_modules=yes
11901 else
11902   echo "$ac_t""no" 1>&6
11903 fi
11904
11905  }
11906 if test "$with_modules" = "yes"; then
11907   
11908 dll_ld=
11909 dll_ldflags=
11910 dll_cflags=
11911 dll_post=
11912 dll_ldo="-o"
11913 ld_dynamic_link_flags=
11914 xehost=$canonical
11915 xealias=$internal_configuration
11916
11917 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
11918 echo "configure:11919: checking how to build dynamic libraries for ${xehost}" >&5
11919 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
11920 case "$xehost" in
11921 *-*-linux-gnu*) ;;
11922 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
11923 esac
11924
11925 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
11926 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
11927 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
11928
11929 case "$xehost_os" in
11930 aix3*)
11931   # AIX sometimes has problems with the GCC collect2 program.  For some
11932   # reason, if we set the COLLECT_NAMES environment variable, the problems
11933   # vanish in a puff of smoke.
11934   if test "${COLLECT_NAMES+set}" != set; then
11935     COLLECT_NAMES=
11936     export COLLECT_NAMES
11937   fi
11938   ;;
11939 esac
11940
11941 # Now see if the compiler is really GCC.
11942 if test "$GCC" = "yes"; then
11943   XEGCC=yes
11944 else
11945   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
11946 echo "configure:11947: checking checking whether we are using GNU C" >&5
11947   cat > conftest.$ac_ext <<EOF
11948 #line 11949 "configure"
11949 #include "confdefs.h"
11950
11951 #ifdef __GNUC__
11952   yes;
11953 #endif
11954
11955 EOF
11956 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11957   egrep "yes" >/dev/null 2>&1; then
11958   rm -rf conftest*
11959   XEGCC=yes
11960 else
11961   rm -rf conftest*
11962   XEGCC=no
11963 fi
11964 rm -f conftest*
11965
11966   echo "$ac_t""${XEGCC}" 1>&6
11967 fi
11968
11969 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
11970 echo "configure:11971: checking how to produce PIC code" >&5
11971 wl=
11972
11973 can_build_shared=yes
11974 if test "$XEGCC" = yes; then
11975   wl='-Wl,'
11976
11977   case "$xehost_os" in
11978   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
11979     # PIC is the default for these OSes.
11980     ;;
11981
11982   os2*)
11983     # We can build DLLs from non-PIC.
11984     ;;
11985   amigaos*)
11986     # FIXME: we need at least 68020 code to build shared libraries, but
11987     # adding the `-m68020' flag to GCC prevents building anything better,
11988     # like `-m68040'.
11989     dll_cflags='-m68020 -resident32 -malways-restore-a4'
11990     ;;
11991   *)
11992     dll_cflags='-fPIC'
11993     ;;
11994   esac
11995 else
11996   # PORTME Check for PIC flags for the system compiler.
11997   case "$xehost_os" in
11998   hpux9* | hpux10*)
11999     # Is there a better link_static_flag that works with the bundled CC?
12000     wl='-Wl,'
12001     dll_cflags='+Z'
12002     ;;
12003
12004   irix5* | irix6*)
12005     wl='-Wl,'
12006     # PIC (with -KPIC) is the default.
12007     ;;
12008
12009   os2*)
12010     # We can build DLLs from non-PIC.
12011     ;;
12012
12013   osf3* | osf4*)
12014     # All OSF/1 code is PIC.
12015     wl='-Wl,'
12016     ;;
12017
12018   sco3.2v5*)
12019     dll_cflags='-belf -Kpic'
12020     wl='-Wl,'
12021     ;;
12022
12023   unixware*)
12024     dll_cflags="-KPIC"
12025     wl="-Wl,"
12026     ;;
12027
12028   sysv4*)
12029     dll_cflags="-KPIC"
12030     wl="-Wl,"
12031     ;;
12032
12033   sysv5*)
12034     dll_cflags="-KPIC"
12035     wl="-Wl,"
12036     ;;
12037
12038   solaris2*)
12039     dll_cflags='-KPIC'
12040     wl='-Wl,'
12041     ;;
12042
12043   sunos4*)
12044     dll_cflags='-PIC'
12045     wl='-Qoption ld '
12046     ;;
12047
12048   uts4*)
12049     dll_cflags='-pic'
12050     ;;
12051
12052   *)
12053     can_build_shared=no
12054     ;;
12055   esac
12056 fi
12057
12058 if test -n "$dll_cflags"; then
12059   echo "$ac_t""${dll_cflags}" 1>&6
12060   
12061   # Check to make sure the dll_cflags actually works.
12062   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12063 echo "configure:12064: checking if PIC flag ${dll_cflags} really works" >&5
12064   save_CFLAGS="$CFLAGS"
12065   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12066   cat > conftest.$ac_ext <<EOF
12067 #line 12068 "configure"
12068 #include "confdefs.h"
12069
12070 int main() {
12071 int x=0;
12072 ; return 0; }
12073 EOF
12074 if { (eval echo configure:12075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12075   rm -rf conftest*
12076   
12077     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12078     # reports no error.  So, we need to grep stderr for (Bundled).
12079     if grep '(Bundled)' config.log >/dev/null; then
12080       echo "$ac_t""no" 1>&6
12081       can_build_shared=no
12082       dll_cflags=
12083     else
12084       echo "$ac_t""yes" 1>&6
12085     fi
12086 else
12087   echo "configure: failed program was:" >&5
12088   cat conftest.$ac_ext >&5
12089   rm -rf conftest*
12090   echo "$ac_t""no" 1>&6
12091     can_build_shared=no
12092     dll_cflags=
12093 fi
12094 rm -f conftest*
12095   CFLAGS="$save_CFLAGS"
12096 else
12097   echo "$ac_t""none" 1>&6
12098 fi
12099
12100 if test "$can_build_shared" = "yes"; then
12101 cc_produces_so=no
12102 xldf=
12103 xcldf=
12104 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12105 echo "configure:12106: checking if C compiler can produce shared libraries" >&5
12106 if test "$XEGCC" = yes; then
12107   xcldf="-shared"
12108   xldf="-shared"
12109 else # Not using GCC
12110   case "$xehost_os" in
12111     aix3* | aix4*)
12112       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12113       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12114       ;;
12115
12116     freebsd2* | netbsd* | openbsd*)
12117       xldf="-Bshareable"
12118       xcldf="${wl}-Bshareable"
12119       ;;
12120
12121     freebsd3*)
12122       xcldf="-shared"
12123       ;;
12124
12125     hpux*)
12126       xldf="-b +s"
12127       xcldf="${wl}-b ${wl}+s"
12128       ;;
12129
12130     irix5* | irix6* | osf3* | osf4*)
12131       xcldf="${wl}-shared"
12132       xldf="-shared"
12133       ;;
12134
12135     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12136       xcldf="-G"
12137       xldf="-G"
12138       ;;
12139
12140     sunos4*)
12141       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12142       xldf="-assert pure-text -Bstatic"
12143       ;;
12144   esac
12145 fi # End if if we are using gcc
12146
12147 if test -n "$xcldf"; then
12148   save_LDFLAGS=$LDFLAGS
12149   save_LIBS=$LIBS
12150   save_xe_libs=$xe_libs
12151   LDFLAGS="$xcldf $LDFLAGS"
12152   LIBS=
12153   xe_libs=
12154   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12155   cat > conftest.$ac_ext <<EOF
12156 #line 12157 "configure"
12157 #include "confdefs.h"
12158
12159 int main() {
12160 int x=0;
12161 ; return 0; }
12162 EOF
12163 if { (eval echo configure:12164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12164   rm -rf conftest*
12165   cc_produces_so=yes
12166 else
12167   echo "configure: failed program was:" >&5
12168   cat conftest.$ac_ext >&5
12169   rm -rf conftest*
12170   cc_produces_so=no
12171 fi
12172 rm -f conftest*
12173   LDFLAGS=$save_LDFLAGS
12174   LIBS=$save_LIBS
12175   xe_libs=$save_xe_libs
12176   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12177 else
12178   cc_produces_so=no
12179 fi
12180 echo "$ac_t""${cc_produces_so}" 1>&6
12181
12182 LTLD=$LD
12183 if test -z "$LTLD"; then
12184   ac_prog=ld
12185   if test "$XEGCC" = yes; then
12186     # Check if gcc -print-prog-name=ld gives a path.
12187     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12188 echo "configure:12189: checking for ld used by GCC" >&5
12189     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12190     case "$ac_prog" in
12191     # Accept absolute paths.
12192     /*)
12193       if test -z "$LTLD"; then
12194         case "$ac_prog" in
12195           *gcc-lib*) LTLD="$CC"
12196                      ;;
12197           *)         LTLD="$ac_prog"
12198                      ;;
12199         esac
12200       fi
12201       ;;
12202     "")
12203       # If it fails, then pretend we aren't using GCC.
12204       ac_prog=ld
12205       ;;
12206     *)
12207       # If it is relative, then search for the first ld in PATH.
12208       with_gnu_ld=unknown
12209       ;;
12210     esac
12211   else
12212     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12213 echo "configure:12214: checking for GNU ld" >&5
12214   fi
12215
12216   if test -z "$LTLD"; then
12217     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12218     for ac_dir in $PATH; do
12219       test -z "$ac_dir" && ac_dir=.
12220       if test -f "$ac_dir/$ac_prog"; then
12221         LTLD="$ac_dir/$ac_prog"
12222         # Check to see if the program is GNU ld.  I'd rather use --version,
12223         # but apparently some GNU ld's only accept -v.
12224         # Break only if it was the GNU/non-GNU ld that we prefer.
12225         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12226           xe_gnu_ld=yes
12227         else
12228           xe_gnu_ld=no
12229         fi
12230       fi
12231     done
12232     IFS="$ac_save_ifs"
12233   fi
12234
12235   if test -n "$LTLD"; then
12236     echo "$ac_t""${LTLD}" 1>&6
12237   else
12238     echo "$ac_t""no" 1>&6
12239   fi
12240
12241   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12242     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12243     exit 1
12244   fi
12245 fi
12246
12247 ld_dynamic_link_flags=
12248
12249 # Check to see if it really is or isn't GNU ld.
12250 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12251 echo "configure:12252: checking if the linker is GNU ld" >&5
12252 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12253 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12254   xe_gnu_ld=yes
12255 else
12256   xe_gnu_ld=no
12257 fi
12258 echo "$ac_t""${xe_gnu_ld}" 1>&6
12259
12260 case "$xehost_os" in
12261   amigaos* | sunos4*)
12262     # On these operating systems, we should treat GNU ld like the system ld.
12263     gnu_ld_acts_native=yes
12264     ;;
12265   *)
12266     gnu_ld_acts_native=no
12267     ;;
12268 esac
12269
12270 if test "$cc_produces_so" = "yes"; then
12271   dll_ld=$CC
12272   dll_ldflags=$xcldf
12273   can_build_shared=yes
12274 else
12275   # OK - only NOW do we futz about with ld.
12276   # See if the linker supports building shared libraries.
12277   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12278 echo "configure:12279: checking whether the linker supports shared libraries" >&5
12279   dll_ld=$CC
12280   dll_ldflags=$LDFLAGS
12281   ld_shlibs=yes
12282   can_build_shared=yes
12283   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12284     # See if GNU ld supports shared libraries.
12285     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12286       dll_ld=$CC
12287       dll_ldflags="-shared"
12288       ld_shlibs=yes
12289     else
12290       ld_shlibs=no
12291     fi
12292   else
12293     # PORTME fill in a description of your system's linker (not GNU ld)
12294     case "$xehost_os" in
12295     aix3*)
12296       dll_ld=$LTLD
12297       dll_ldflags=$xldf
12298       ;;
12299
12300     aix4*)
12301       dll_ldflags=$xcldf
12302       ;;
12303
12304     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12305     # support.  Future versions do this automatically, but an explicit c++rt0.o
12306     # doesn't break anything, and helps significantly (at the cost of a little
12307     # extra space).
12308     freebsd2.2*)
12309       dll_ld=$LTLD
12310       dll_ldflags=$xldf
12311       dll_post="/usr/lib/c++rt0.o"
12312       ;;
12313
12314     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12315     freebsd2*)
12316       dll_ld=$LTLD
12317       dll_ldflags="-Bshareable"
12318       ;;
12319
12320     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12321     freebsd3*)
12322       dll_ldflags="-shared"
12323       ;;
12324
12325     hpux*)
12326       dll_ld=$LTLD
12327       dll_ldflags=$xldf
12328       ;;
12329
12330     irix5* | irix6*)
12331       dll_ld=$LTLD
12332       dll_ldflags=$xldf
12333       ;;
12334
12335     netbsd*)
12336       # Tested with NetBSD 1.2 ld
12337       dll_ld=$LTLD
12338       dll_ldflags=$xldf
12339       ;;
12340
12341     openbsd*)
12342       dll_ld=$LTLD
12343       dll_ldflags=$xldf
12344       ;;
12345
12346     osf3* | osf4*)
12347       dll_ld=$LTLD
12348       dll_ldflags=$xldf
12349       ;;
12350
12351     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12352     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12353       dll_ld=$LTLD
12354       case "$dll_ld" in
12355         *gcc*) dll_ldflags="-shared"
12356                dll_ld=$CC
12357                ;;
12358         *)     dll_ldflags="-G"
12359                ;;
12360       esac
12361       ;;
12362
12363     sunos4*)
12364       if test "$XEGCC" = yes; then
12365         dll_ld=$CC
12366       else
12367         dll_ld=$LTLD
12368       fi
12369       dll_ldflags=$xldf
12370       ;;
12371
12372     uts4*)
12373       dll_ld=$LTLD
12374       dll_ldflags="-G"
12375       ;;
12376
12377     bsdi*)
12378       dll_ldflags="-r"
12379       dll_ld="shlicc2"
12380       ;;
12381
12382     *)
12383       ld_shlibs=no
12384       can_build_shared=no
12385       ;;
12386     esac
12387   fi
12388   echo "$ac_t""${ld_shlibs}" 1>&6
12389   if test "$ld_shlibs" = "no"; then
12390     can_build_shared=no
12391   fi
12392 fi # End of if cc_produces_so = no
12393
12394
12395 if test "$xe_gnu_ld" = yes; then
12396   if test "$ld_shlibs" = yes; then
12397     ld_dynamic_link_flags="${wl}-export-dynamic"
12398   fi
12399 fi
12400
12401 if test -z "$ld_dynamic_link_flags"; then
12402   case "$xehost_os" in
12403   aix3*)
12404     ld_dynamic_link_flags=
12405     ;;
12406
12407   aix4*)
12408     ld_dynamic_link_flags=
12409     ;;
12410
12411   freebsd2.2*)
12412     ld_dynamic_link_flags=
12413     ;;
12414
12415   freebsd2*)
12416     ld_dynamic_link_flags=
12417     ;;
12418
12419   freebsd3*)
12420     ld_dynamic_link_flags=
12421     ;;
12422
12423   hpux*)
12424     ld_dynamic_link_flags="${wl}-E"
12425     ;;
12426
12427   irix5* | irix6*)
12428     ld_dynamic_link_flags=
12429     ;;
12430
12431   netbsd*)
12432     ld_dynamic_link_flags=
12433     ;;
12434
12435   openbsd*)
12436     ld_dynamic_link_flags=
12437     ;;
12438
12439   osf3* | osf4*)
12440     ld_dynamic_link_flags=
12441     ;;
12442
12443   solaris2* | solaris7*)
12444     ld_dynamic_link_flags="${wl}-Bdynamic"
12445     ;;
12446
12447   sco3.2v5* | unixware* | sysv5* | sysv4*)
12448     ld_dynamic_link_flags="${wl}-Bexport"
12449     ;;
12450
12451   sunos4*)
12452     ld_dynamic_link_flags=
12453     ;;
12454
12455   uts4*)
12456     ld_dynamic_link_flags=
12457     ;;
12458
12459   bsdi*)
12460     ld_dynamic_link_flags=
12461     ;;
12462
12463   esac
12464 fi # End of if -z ld_dynamic_link_flags
12465 fi # End of if test "$can_build_shared" = "yes"
12466
12467
12468
12469
12470
12471
12472
12473
12474   if test "$can_build_shared" = "yes"; then
12475     { test "$extra_verbose" = "yes" && cat << \EOF
12476     Defining HAVE_SHLIB
12477 EOF
12478 cat >> confdefs.h <<\EOF
12479 #define HAVE_SHLIB 1
12480 EOF
12481 }
12482
12483     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12484    echo "    xemacs will be linked with \"sysdll.o\""
12485  fi
12486     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12487    echo "    xemacs will be linked with \"emodules.o\""
12488  fi
12489     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12490     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12491     for ac_func in dlerror _dlerror
12492 do
12493 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12494 echo "configure:12495: checking for $ac_func" >&5
12495
12496 cat > conftest.$ac_ext <<EOF
12497 #line 12498 "configure"
12498 #include "confdefs.h"
12499 /* System header to define __stub macros and hopefully few prototypes,
12500     which can conflict with char $ac_func(); below.  */
12501 #include <assert.h>
12502 /* Override any gcc2 internal prototype to avoid an error.  */
12503 /* We use char because int might match the return type of a gcc2
12504     builtin and then its argument prototype would still apply.  */
12505 char $ac_func();
12506
12507 int main() {
12508
12509 /* The GNU C library defines this for functions which it implements
12510     to always fail with ENOSYS.  Some functions are actually named
12511     something starting with __ and the normal name is an alias.  */
12512 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12513 choke me
12514 #else
12515 $ac_func();
12516 #endif
12517
12518 ; return 0; }
12519 EOF
12520 if { (eval echo configure:12521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12521   rm -rf conftest*
12522   eval "ac_cv_func_$ac_func=yes"
12523 else
12524   echo "configure: failed program was:" >&5
12525   cat conftest.$ac_ext >&5
12526   rm -rf conftest*
12527   eval "ac_cv_func_$ac_func=no"
12528 fi
12529 rm -f conftest*
12530
12531 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12532   echo "$ac_t""yes" 1>&6
12533     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12534   { test "$extra_verbose" = "yes" && cat << EOF
12535     Defining $ac_tr_func
12536 EOF
12537 cat >> confdefs.h <<EOF
12538 #define $ac_tr_func 1
12539 EOF
12540 }
12541  
12542 else
12543   echo "$ac_t""no" 1>&6
12544 fi
12545 done
12546
12547   else
12548     echo "configure: warning: disabling shared library support" 1>&2
12549     with_modules=no
12550   fi
12551 fi
12552
12553 cat > conftest.$ac_ext <<EOF
12554 #line 12555 "configure"
12555 #include "confdefs.h"
12556 int main(int c,char *v[]){return 0;}
12557 EOF
12558 if { (eval echo configure:12559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12559 then
12560   :
12561 else
12562   conftest_rc="$?"
12563   echo "configure: failed program was:" >&5
12564   cat conftest.$ac_ext >&5
12565   rm -fr conftest*
12566   
12567   echo ""
12568   echo "*** PANIC *** The C compiler can no longer build working executables."
12569   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12570   echo "*** PANIC *** The most likely reason for this problem is that configure"
12571   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12572   echo "*** PANIC *** found at run time."
12573   echo "*** PANIC ***"
12574   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12575   echo "*** PANIC *** On other systems, try telling configure where to find the"
12576   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12577   echo "*** PANIC ***"
12578   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12579   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12580   echo "*** PANIC *** on your system.  Don't do that."
12581   exit 1
12582 fi
12583 rm -fr conftest*
12584
12585 if test "$win32_processes" = "yes"; then
12586   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12587    echo "    xemacs will be linked with \"process-nt.o\""
12588  fi
12589 else
12590   { test "$extra_verbose" = "yes" && cat << \EOF
12591     Defining HAVE_UNIX_PROCESSES
12592 EOF
12593 cat >> confdefs.h <<\EOF
12594 #define HAVE_UNIX_PROCESSES 1
12595 EOF
12596 }
12597
12598   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12599    echo "    xemacs will be linked with \"process-unix.o\""
12600  fi
12601 fi
12602
12603
12604
12605 T=""
12606 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12607 CFLAGS="$T"
12608
12609
12610 T=""
12611 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12612 extra_objs="$T"
12613
12614
12615 T=""
12616 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
12617 c_switch_general="$T"
12618
12619
12620 T=""
12621 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12622 c_switch_window_system="$T"
12623
12624
12625 T=""
12626 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12627 c_switch_all="$T"
12628
12629
12630 T=""
12631 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
12632 ld_switch_general="$T"
12633
12634
12635 T=""
12636 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12637 ld_switch_window_system="$T"
12638
12639
12640 T=""
12641 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12642 ld_switch_all="$T"
12643
12644
12645 T=""
12646 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12647 ld_libs_general="$T"
12648
12649
12650 T=""
12651 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
12652 ld_libs_window_system="$T"
12653
12654
12655 T=""
12656 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12657 ld_libs_all="$T"
12658
12659
12660
12661 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12662 internal_makefile_list="Makefile.in"
12663 SUBDIR_MAKEFILES=''
12664 test -d lock || mkdir lock
12665 for dir in $MAKE_SUBDIR; do
12666   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12667         test -d "$d" || mkdir "$d"; cd "$d"
12668       done ) ;;
12669    * ) test -d "$dir" || mkdir "$dir" ;;
12670   esac
12671   
12672 T=""
12673 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12674 SUBDIR_MAKEFILES="$T"
12675
12676   
12677 T=""
12678 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12679 internal_makefile_list="$T"
12680
12681 done
12682
12683
12684
12685
12686 for dir in src/s src/m; do
12687   if test ! -d "$dir" ; then
12688     echo Making symbolic link to "$srcdir/$dir"
12689     ${LN_S} "$srcdir/$dir" "$dir"
12690   fi
12691 done
12692
12693 if test "$extra_verbose" = "yes"; then
12694   echo ""
12695   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
12696   echo ""
12697 fi
12698
12699 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12700   echo "creating src/gdbinit"; echo ""
12701   echo "source $srcdir/src/gdbinit" > src/gdbinit
12702 fi
12703
12704 if test "$__SUNPRO_C" = "yes"; then
12705   echo "creating .sbinit"; echo ""
12706   ( echo "# For use with Sun WorkShop's Source browser."
12707     echo "# See sbquery(1) and sbinit(4) for more information"
12708     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12709   ) > .sbinit
12710 fi
12711
12712 rm -f core
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732 PREFIX=$prefix
12733 while true; do
12734   case "$PREFIX" in
12735     *\$* ) eval "PREFIX=$PREFIX" ;;
12736     *) break ;;
12737   esac
12738 done
12739
12740
12741
12742
12743 EXEC_PREFIX=$exec_prefix
12744 while true; do
12745   case "$EXEC_PREFIX" in
12746     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12747     *) break ;;
12748   esac
12749 done
12750
12751
12752
12753
12754 INFODIR=$infodir
12755 while true; do
12756   case "$INFODIR" in
12757     *\$* ) eval "INFODIR=$INFODIR" ;;
12758     *) break ;;
12759   esac
12760 done
12761
12762
12763
12764
12765 INFOPATH=$infopath
12766 while true; do
12767   case "$INFOPATH" in
12768     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12769     *) break ;;
12770   esac
12771 done
12772
12773
12774
12775
12776 PACKAGE_PATH=$package_path
12777 while true; do
12778   case "$PACKAGE_PATH" in
12779     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12780     *) break ;;
12781   esac
12782 done
12783
12784
12785
12786
12787 LISPDIR=$lispdir
12788 while true; do
12789   case "$LISPDIR" in
12790     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12791     *) break ;;
12792   esac
12793 done
12794
12795
12796
12797
12798 MODULEDIR=$moduledir
12799 while true; do
12800   case "$MODULEDIR" in
12801     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12802     *) break ;;
12803   esac
12804 done
12805
12806
12807
12808
12809 SITELISPDIR=$sitelispdir
12810 while true; do
12811   case "$SITELISPDIR" in
12812     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12813     *) break ;;
12814   esac
12815 done
12816
12817
12818
12819
12820 SITEMODULEDIR=$sitemoduledir
12821 while true; do
12822   case "$SITEMODULEDIR" in
12823     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12824     *) break ;;
12825   esac
12826 done
12827
12828
12829
12830
12831 ETCDIR=$etcdir
12832 while true; do
12833   case "$ETCDIR" in
12834     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12835     *) break ;;
12836   esac
12837 done
12838
12839
12840
12841
12842 LOCKDIR=$lockdir
12843 while true; do
12844   case "$LOCKDIR" in
12845     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12846     *) break ;;
12847   esac
12848 done
12849
12850
12851
12852
12853 DOCDIR=$docdir
12854 while true; do
12855   case "$DOCDIR" in
12856     *\$* ) eval "DOCDIR=$DOCDIR" ;;
12857     *) break ;;
12858   esac
12859 done
12860
12861
12862
12863
12864 ARCHLIBDIR=$archlibdir
12865 while true; do
12866   case "$ARCHLIBDIR" in
12867     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12868     *) break ;;
12869   esac
12870 done
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12892
12893
12894
12895
12896
12897
12898
12899 : ${XEMACS_CC:=$CC}
12900
12901
12902 if test "$with_prefix" = "yes"; then
12903   { test "$extra_verbose" = "yes" && cat << \EOF
12904     Defining PREFIX_USER_DEFINED
12905 EOF
12906 cat >> confdefs.h <<\EOF
12907 #define PREFIX_USER_DEFINED 1
12908 EOF
12909 }
12910
12911 fi
12912
12913 if test "$with_site_lisp" = "no"; then
12914   { test "$extra_verbose" = "yes" && cat << \EOF
12915     Defining INHIBIT_SITE_LISP
12916 EOF
12917 cat >> confdefs.h <<\EOF
12918 #define INHIBIT_SITE_LISP 1
12919 EOF
12920 }
12921
12922 fi
12923 if test "$with_site_modules" = "no"; then
12924   { test "$extra_verbose" = "yes" && cat << \EOF
12925     Defining INHIBIT_SITE_MODULES
12926 EOF
12927 cat >> confdefs.h <<\EOF
12928 #define INHIBIT_SITE_MODULES 1
12929 EOF
12930 }
12931
12932 fi
12933
12934
12935 T=""
12936 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12937 ac_configure_args="$T"
12938
12939 { test "$extra_verbose" = "yes" && cat << EOF
12940     Defining EMACS_CONFIGURATION = "$canonical"
12941 EOF
12942 cat >> confdefs.h <<EOF
12943 #define EMACS_CONFIGURATION "$canonical"
12944 EOF
12945 }
12946
12947 { test "$extra_verbose" = "yes" && cat << EOF
12948     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12949 EOF
12950 cat >> confdefs.h <<EOF
12951 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12952 EOF
12953 }
12954
12955 { test "$extra_verbose" = "yes" && cat << EOF
12956     Defining config_machfile = "$machfile"
12957 EOF
12958 cat >> confdefs.h <<EOF
12959 #define config_machfile "$machfile"
12960 EOF
12961 }
12962
12963 { test "$extra_verbose" = "yes" && cat << EOF
12964     Defining config_opsysfile = "$opsysfile"
12965 EOF
12966 cat >> confdefs.h <<EOF
12967 #define config_opsysfile "$opsysfile"
12968 EOF
12969 }
12970
12971
12972
12973 null_string=""
12974 { test "$extra_verbose" = "yes" && cat << EOF
12975     Defining LD_SWITCH_X_SITE = $null_string
12976 EOF
12977 cat >> confdefs.h <<EOF
12978 #define LD_SWITCH_X_SITE $null_string
12979 EOF
12980 }
12981
12982 { test "$extra_verbose" = "yes" && cat << EOF
12983     Defining LD_SWITCH_X_SITE_AUX = $null_string
12984 EOF
12985 cat >> confdefs.h <<EOF
12986 #define LD_SWITCH_X_SITE_AUX $null_string
12987 EOF
12988 }
12989
12990 { test "$extra_verbose" = "yes" && cat << EOF
12991     Defining C_SWITCH_X_SITE = $null_string
12992 EOF
12993 cat >> confdefs.h <<EOF
12994 #define C_SWITCH_X_SITE $null_string
12995 EOF
12996 }
12997
12998 { test "$extra_verbose" = "yes" && cat << EOF
12999     Defining LD_SWITCH_SITE = $null_string
13000 EOF
13001 cat >> confdefs.h <<EOF
13002 #define LD_SWITCH_SITE $null_string
13003 EOF
13004 }
13005
13006 { test "$extra_verbose" = "yes" && cat << EOF
13007     Defining C_SWITCH_SITE = $null_string
13008 EOF
13009 cat >> confdefs.h <<EOF
13010 #define C_SWITCH_SITE $null_string
13011 EOF
13012 }
13013
13014
13015
13016 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13017     Defining GNU_MALLOC
13018 EOF
13019 cat >> confdefs.h <<\EOF
13020 #define GNU_MALLOC 1
13021 EOF
13022 }
13023
13024 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13025     Defining USE_SYSTEM_MALLOC
13026 EOF
13027 cat >> confdefs.h <<\EOF
13028 #define USE_SYSTEM_MALLOC 1
13029 EOF
13030 }
13031
13032 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13033     Defining USE_DEBUG_MALLOC
13034 EOF
13035 cat >> confdefs.h <<\EOF
13036 #define USE_DEBUG_MALLOC 1
13037 EOF
13038 }
13039
13040                                               { test "$extra_verbose" = "yes" && cat << \EOF
13041     Defining USE_SYSTEM_MALLOC
13042 EOF
13043 cat >> confdefs.h <<\EOF
13044 #define USE_SYSTEM_MALLOC 1
13045 EOF
13046 }
13047
13048 fi
13049 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13050     Defining I18N3
13051 EOF
13052 cat >> confdefs.h <<\EOF
13053 #define I18N3 1
13054 EOF
13055 }
13056
13057 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13058     Defining USE_GCC
13059 EOF
13060 cat >> confdefs.h <<\EOF
13061 #define USE_GCC 1
13062 EOF
13063 }
13064
13065 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13066     Defining EXTERNAL_WIDGET
13067 EOF
13068 cat >> confdefs.h <<\EOF
13069 #define EXTERNAL_WIDGET 1
13070 EOF
13071 }
13072
13073 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13074     Defining NO_DOC_FILE
13075 EOF
13076 cat >> confdefs.h <<\EOF
13077 #define NO_DOC_FILE 1
13078 EOF
13079 }
13080
13081 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13082     Defining PURIFY
13083 EOF
13084 cat >> confdefs.h <<\EOF
13085 #define PURIFY 1
13086 EOF
13087 }
13088
13089 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13090     Defining QUANTIFY
13091 EOF
13092 cat >> confdefs.h <<\EOF
13093 #define QUANTIFY 1
13094 EOF
13095 }
13096
13097 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13098     Defining MAIL_USE_POP
13099 EOF
13100 cat >> confdefs.h <<\EOF
13101 #define MAIL_USE_POP 1
13102 EOF
13103 }
13104
13105 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13106     Defining KERBEROS
13107 EOF
13108 cat >> confdefs.h <<\EOF
13109 #define KERBEROS 1
13110 EOF
13111 }
13112
13113 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13114     Defining HESIOD
13115 EOF
13116 cat >> confdefs.h <<\EOF
13117 #define HESIOD 1
13118 EOF
13119 }
13120
13121 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13122     Defining USE_UNION_TYPE
13123 EOF
13124 cat >> confdefs.h <<\EOF
13125 #define USE_UNION_TYPE 1
13126 EOF
13127 }
13128
13129
13130
13131 (
13132 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13133 else
13134   echo "uname -a: `uname -a`"
13135 fi
13136 echo ""
13137 echo "$0 $quoted_arguments"
13138 ) > Installation
13139
13140 if test ! -z ${emacs_beta_version} ; then
13141   if test -z "${emacs_is_beta}" ; then
13142         xemacs_betaname=".${emacs_beta_version}"
13143   else
13144         xemacs_betaname="-b${emacs_beta_version}"
13145   fi
13146 else
13147   xemacs_betaname=""    
13148 fi
13149
13150 (
13151 echo "
13152
13153 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13154
13155   Where should the build process find the source code?    $srcdir
13156   What installation prefix should install use?            $prefix
13157   What operating system and machine description files should XEmacs use?
13158         \`$opsysfile' and \`$machfile'
13159   What compiler should XEmacs be built with?              $CC $CFLAGS
13160   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13161   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13162   What window system should XEmacs use?                   ${window_system}"
13163 if test "$with_x11" = "yes"; then
13164   echo "  Where do we find X Windows header files?                $x_includes"
13165   echo "  Where do we find X Windows libraries?                   $x_libraries"
13166 fi
13167 if test -n "$site_includes"; then
13168   echo "  Additional header files:                                $site_includes"
13169 fi
13170 if test -n "$site_libraries"; then
13171   echo "  Additional libraries:                                   $site_libraries"
13172 fi
13173 if test -n "$site_prefixes"; then
13174   echo "  Additional prefixes:                                    $site_prefixes"
13175 fi
13176 if test -n "$runpath"; then
13177   echo "  Runtime library search path:                            $runpath"
13178 fi
13179 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13180 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13181 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13182 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13183   echo "  No Xmu; substituting equivalent routines."
13184 fi
13185
13186 if test "$with_xpm" = yes; then
13187   echo "  Compiling in support for XPM images."
13188 elif test "$with_x11" = yes; then
13189   echo "  --------------------------------------------------------------------"
13190   echo "  WARNING: Compiling without XPM support."
13191   if test "$xpm_problem" != ""; then
13192     echo "  Reason: $xpm_problem"
13193   fi
13194   echo "  WARNING: You should strongly consider installing XPM."
13195   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13196   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13197   echo "  --------------------------------------------------------------------"
13198 fi
13199 if test "$with_png" = yes; then
13200   echo "  Compiling in support for PNG image handling."
13201 elif test "$window_system" != "none"; then
13202   echo "  --------------------------------------------------------------------"
13203   echo "  WARNING: Compiling without PNG image support."
13204   if test "$png_problem" != ""; then
13205     echo "  Reason: $png_problem"
13206   fi
13207   echo "  WARNING: You should strongly consider installing the PNG libraries."
13208   echo "  WARNING: Otherwise certain images and glyphs may not display."
13209   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13210   echo "  --------------------------------------------------------------------"
13211 fi
13212 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13213 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13214 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13215 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13216 case "$with_sound" in
13217   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13218   native ) echo "  Compiling in native sound support." ;;
13219   both   ) echo "  Compiling in both network and native sound support." ;;
13220 esac
13221 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13222
13223 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13224 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13225 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13226
13227 test "$with_ldap"            = yes && echo "  Compiling in support for LDAP."
13228
13229 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13230 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13231
13232 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13233 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13234 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13235 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13236 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13237 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13238 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13239 if test "$with_wnn" = yes; then
13240   echo "  Compiling in support for the WNN input method on Mule."
13241   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13242 fi
13243 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13244
13245 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13246 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13247 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13248 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13249 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13250 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13251 case "$with_menubars" in
13252   lucid ) echo "  Using Lucid menubars." ;;
13253   motif ) echo "  Using Motif menubars."
13254           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13255           echo "             We recommend using the Lucid menubar instead."
13256           echo "             Re-run configure with --with-menubars='lucid'." ;;
13257 esac
13258 case "$with_scrollbars" in
13259   lucid    ) echo "  Using Lucid scrollbars."     ;;
13260   motif    ) echo "  Using Motif scrollbars."     ;;
13261   athena   ) echo "  Using Athena scrollbars."    ;;
13262   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13263 esac
13264 case "$with_widgets" in
13265   motif    ) echo "  Using Motif native widgets."     ;;
13266 esac
13267 case "$with_dialogs" in
13268   motif    )
13269     echo "  Using Motif dialog boxes."
13270     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13271       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13272       echo "             We recommend using the Athena dialog boxes instead."
13273       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13274       echo "             Read the PROBLEMS file for more information."
13275     fi; fi
13276     ;;
13277   athena   ) echo "  Using Athena dialog boxes."    ;;
13278   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13279 esac
13280 test "$with_modules" = "yes" && echo "  Compiling in DSO module support."
13281 test "$with_clash_detection" = yes && \
13282   echo "  Clash detection will use \"$lockdir\" for locking files."
13283 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13284 test "$with_pop"        = yes && echo "  Using POP for mail access."
13285 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13286 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13287 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13288 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13289 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13290 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13291   != "no no no no no"; then
13292   echo "  WARNING: ---------------------------------------------------------"
13293   echo "  WARNING: Compiling in support for runtime error checking."
13294   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13295   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13296   echo "  WARNING: ---------------------------------------------------------"
13297 fi
13298 echo ""
13299 ) | tee -a Installation
13300 echo ""
13301
13302
13303 # Remove any trailing slashes in these variables.
13304 test -n "$prefix" &&
13305   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13306 test -n "$exec_prefix" &&
13307   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13308
13309
13310 for file in $internal_makefile_list; do
13311   test "$file" = src/Makefile.in && \
13312     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13313   ac_output_files="${ac_output_files+$ac_output_files }$file"
13314 done
13315 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13316 if test "$with_modules" = "yes"; then
13317   ac_output_files="$ac_output_files lib-src/ellcc.h"
13318 fi
13319
13320 trap '' 1 2 15
13321
13322 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13323
13324 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13325 # Let make expand exec_prefix.
13326 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13327
13328 # Any assignment to VPATH causes Sun make to only execute
13329 # the first set of double-colon rules, so remove it if not needed.
13330 # If there is a colon in the path, we need to keep it.
13331 if test "x$srcdir" = x.; then
13332   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13333 fi
13334
13335 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13336
13337 DEFS=-DHAVE_CONFIG_H
13338
13339 # Without the "./", some shells look in PATH for config.status.
13340 : ${CONFIG_STATUS=./config.status}
13341
13342 echo creating $CONFIG_STATUS
13343 rm -f $CONFIG_STATUS
13344 cat > $CONFIG_STATUS <<EOF
13345 #! /bin/sh
13346 # Generated automatically by configure.
13347 # Run this file to recreate the current configuration.
13348 # This directory was configured as follows,
13349 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13350 #
13351 # $0 $ac_configure_args
13352 #
13353 # Compiler output produced by configure, useful for debugging
13354 # configure, is in ./config.log if it exists.
13355
13356 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13357 for ac_option
13358 do
13359   case "\$ac_option" in
13360   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13361     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13362     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13363   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13364     echo "$CONFIG_STATUS generated by autoconf version 2.13"
13365     exit 0 ;;
13366   -help | --help | --hel | --he | --h)
13367     echo "\$ac_cs_usage"; exit 0 ;;
13368   *) echo "\$ac_cs_usage"; exit 1 ;;
13369   esac
13370 done
13371
13372 ac_given_srcdir=$srcdir
13373 ac_given_INSTALL="$INSTALL"
13374
13375 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13376 EOF
13377 cat >> $CONFIG_STATUS <<EOF
13378
13379 # Protect against being on the right side of a sed subst in config.status.
13380 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13381  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13382 $ac_vpsub
13383 $extrasub
13384 s%@SHELL@%$SHELL%g
13385 s%@CFLAGS@%$CFLAGS%g
13386 s%@CPPFLAGS@%$CPPFLAGS%g
13387 s%@CXXFLAGS@%$CXXFLAGS%g
13388 s%@FFLAGS@%$FFLAGS%g
13389 s%@DEFS@%$DEFS%g
13390 s%@LDFLAGS@%$LDFLAGS%g
13391 s%@LIBS@%$LIBS%g
13392 s%@exec_prefix@%$exec_prefix%g
13393 s%@prefix@%$prefix%g
13394 s%@program_transform_name@%$program_transform_name%g
13395 s%@bindir@%$bindir%g
13396 s%@sbindir@%$sbindir%g
13397 s%@libexecdir@%$libexecdir%g
13398 s%@datadir@%$datadir%g
13399 s%@sysconfdir@%$sysconfdir%g
13400 s%@sharedstatedir@%$sharedstatedir%g
13401 s%@localstatedir@%$localstatedir%g
13402 s%@libdir@%$libdir%g
13403 s%@includedir@%$includedir%g
13404 s%@oldincludedir@%$oldincludedir%g
13405 s%@infodir@%$infodir%g
13406 s%@mandir@%$mandir%g
13407 s%@LN_S@%$LN_S%g
13408 s%@blddir@%$blddir%g
13409 s%@CC@%$CC%g
13410 s%@CPP@%$CPP%g
13411 s%@start_flags@%$start_flags%g
13412 s%@ld_switch_shared@%$ld_switch_shared%g
13413 s%@start_files@%$start_files%g
13414 s%@ld@%$ld%g
13415 s%@lib_gcc@%$lib_gcc%g
13416 s%@RANLIB@%$RANLIB%g
13417 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13418 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
13419 s%@INSTALL_DATA@%$INSTALL_DATA%g
13420 s%@YACC@%$YACC%g
13421 s%@SET_MAKE@%$SET_MAKE%g
13422 s%@X_CFLAGS@%$X_CFLAGS%g
13423 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13424 s%@X_LIBS@%$X_LIBS%g
13425 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13426 s%@install_pp@%$install_pp%g
13427 s%@libs_xauth@%$libs_xauth%g
13428 s%@dnd_objs@%$dnd_objs%g
13429 s%@lwlib_objs@%$lwlib_objs%g
13430 s%@ALLOCA@%$ALLOCA%g
13431 s%@dll_ld@%$dll_ld%g
13432 s%@dll_cflags@%$dll_cflags%g
13433 s%@dll_ldflags@%$dll_ldflags%g
13434 s%@dll_post@%$dll_post%g
13435 s%@dll_ldo@%$dll_ldo%g
13436 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13437 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13438 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13439 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13440 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13441 s%@PROGNAME@%$PROGNAME%g
13442 s%@version@%$version%g
13443 s%@configuration@%$configuration%g
13444 s%@canonical@%$canonical%g
13445 s%@inststaticdir@%$inststaticdir%g
13446 s%@instvardir@%$instvardir%g
13447 s%@srcdir@%$srcdir%g
13448 s%@pkgdir@%$pkgdir%g
13449 s%@statedir@%$statedir%g
13450 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
13451 s%@PREFIX@%$PREFIX%g
13452 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
13453 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13454 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13455 s%@INFODIR@%$INFODIR%g
13456 s%@infopath@%$infopath%g
13457 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13458 s%@INFOPATH@%$INFOPATH%g
13459 s%@package_path@%$package_path%g
13460 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13461 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13462 s%@lispdir@%$lispdir%g
13463 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13464 s%@LISPDIR@%$LISPDIR%g
13465 s%@moduledir@%$moduledir%g
13466 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13467 s%@MODULEDIR@%$MODULEDIR%g
13468 s%@sitelispdir@%$sitelispdir%g
13469 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13470 s%@SITELISPDIR@%$SITELISPDIR%g
13471 s%@sitemoduledir@%$sitemoduledir%g
13472 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13473 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13474 s%@etcdir@%$etcdir%g
13475 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13476 s%@ETCDIR@%$ETCDIR%g
13477 s%@lockdir@%$lockdir%g
13478 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13479 s%@LOCKDIR@%$LOCKDIR%g
13480 s%@docdir@%$docdir%g
13481 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
13482 s%@DOCDIR@%$DOCDIR%g
13483 s%@archlibdir@%$archlibdir%g
13484 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13485 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13486 s%@bitmapdir@%$bitmapdir%g
13487 s%@extra_objs@%$extra_objs%g
13488 s%@machfile@%$machfile%g
13489 s%@opsysfile@%$opsysfile%g
13490 s%@c_switch_general@%$c_switch_general%g
13491 s%@c_switch_window_system@%$c_switch_window_system%g
13492 s%@c_switch_all@%$c_switch_all%g
13493 s%@ld_switch_general@%$ld_switch_general%g
13494 s%@ld_switch_window_system@%$ld_switch_window_system%g
13495 s%@ld_switch_all@%$ld_switch_all%g
13496 s%@ld_libs_general@%$ld_libs_general%g
13497 s%@ld_libs_window_system@%$ld_libs_window_system%g
13498 s%@ld_libs_all@%$ld_libs_all%g
13499 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13500 s%@native_sound_lib@%$native_sound_lib%g
13501 s%@sound_cflags@%$sound_cflags%g
13502 s%@dynodump_arch@%$dynodump_arch%g
13503 s%@XEMACS_CC@%$XEMACS_CC%g
13504 s%@internal_makefile_list@%$internal_makefile_list%g
13505
13506 CEOF
13507 EOF
13508
13509 cat >> $CONFIG_STATUS <<\EOF
13510
13511 # Split the substitutions into bite-sized pieces for seds with
13512 # small command number limits, like on Digital OSF/1 and HP-UX.
13513 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13514 ac_file=1 # Number of current file.
13515 ac_beg=1 # First line for current file.
13516 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13517 ac_more_lines=:
13518 ac_sed_cmds=""
13519 while $ac_more_lines; do
13520   if test $ac_beg -gt 1; then
13521     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13522   else
13523     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13524   fi
13525   if test ! -s conftest.s$ac_file; then
13526     ac_more_lines=false
13527     rm -f conftest.s$ac_file
13528   else
13529     if test -z "$ac_sed_cmds"; then
13530       ac_sed_cmds="sed -f conftest.s$ac_file"
13531     else
13532       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13533     fi
13534     ac_file=`expr $ac_file + 1`
13535     ac_beg=$ac_end
13536     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13537   fi
13538 done
13539 if test -z "$ac_sed_cmds"; then
13540   ac_sed_cmds=cat
13541 fi
13542 EOF
13543
13544 cat >> $CONFIG_STATUS <<EOF
13545
13546 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13547 EOF
13548 cat >> $CONFIG_STATUS <<\EOF
13549 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13550   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13551   case "$ac_file" in
13552   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13553        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13554   *) ac_file_in="${ac_file}.in" ;;
13555   esac
13556
13557   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13558
13559   # Remove last slash and all that follows it.  Not all systems have dirname.
13560   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13561   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13562     # The file is in a subdirectory.
13563     test ! -d "$ac_dir" && mkdir "$ac_dir"
13564     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13565     # A "../" for each directory in $ac_dir_suffix.
13566     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13567   else
13568     ac_dir_suffix= ac_dots=
13569   fi
13570
13571   case "$ac_given_srcdir" in
13572   .)  srcdir=.
13573       if test -z "$ac_dots"; then top_srcdir=.
13574       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13575   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13576   *) # Relative path.
13577     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13578     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13579   esac
13580
13581   case "$ac_given_INSTALL" in
13582   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13583   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13584   esac
13585
13586   echo creating "$ac_file"
13587   rm -f "$ac_file"
13588   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13589   case "$ac_file" in
13590   *Makefile*) ac_comsub="1i\\
13591 # $configure_input" ;;
13592   *) ac_comsub= ;;
13593   esac
13594
13595   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13596   sed -e "$ac_comsub
13597 s%@configure_input@%$configure_input%g
13598 s%@srcdir@%$srcdir%g
13599 s%@top_srcdir@%$top_srcdir%g
13600 s%@INSTALL@%$INSTALL%g
13601 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13602 fi; done
13603 rm -f conftest.s*
13604
13605 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13606 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13607 #
13608 # ac_d sets the value in "#define NAME VALUE" lines.
13609 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13610 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13611 ac_dC='\3'
13612 ac_dD='%g'
13613 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13614 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13615 ac_uB='\([      ]\)%\1#\2define\3'
13616 ac_uC=' '
13617 ac_uD='\4%g'
13618 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13619 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13620 ac_eB='$%\1#\2define\3'
13621 ac_eC=' '
13622 ac_eD='%g'
13623
13624 if test "${CONFIG_HEADERS+set}" != set; then
13625 EOF
13626 cat >> $CONFIG_STATUS <<EOF
13627   CONFIG_HEADERS="src/config.h lwlib/config.h"
13628 EOF
13629 cat >> $CONFIG_STATUS <<\EOF
13630 fi
13631 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13632   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13633   case "$ac_file" in
13634   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13635        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13636   *) ac_file_in="${ac_file}.in" ;;
13637   esac
13638
13639   echo creating $ac_file
13640
13641   rm -f conftest.frag conftest.in conftest.out
13642   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13643   cat $ac_file_inputs > conftest.in
13644
13645 EOF
13646
13647 # Transform confdefs.h into a sed script conftest.vals that substitutes
13648 # the proper values into config.h.in to produce config.h.  And first:
13649 # Protect against being on the right side of a sed subst in config.status.
13650 # Protect against being in an unquoted here document in config.status.
13651 rm -f conftest.vals
13652 cat > conftest.hdr <<\EOF
13653 s/[\\&%]/\\&/g
13654 s%[\\$`]%\\&%g
13655 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13656 s%ac_d%ac_u%gp
13657 s%ac_u%ac_e%gp
13658 EOF
13659 sed -n -f conftest.hdr confdefs.h > conftest.vals
13660 rm -f conftest.hdr
13661
13662 # This sed command replaces #undef with comments.  This is necessary, for
13663 # example, in the case of _POSIX_SOURCE, which is predefined and required
13664 # on some systems where configure will not decide to define it.
13665 cat >> conftest.vals <<\EOF
13666 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13667 EOF
13668
13669 # Break up conftest.vals because some shells have a limit on
13670 # the size of here documents, and old seds have small limits too.
13671
13672 rm -f conftest.tail
13673 while :
13674 do
13675   ac_lines=`grep -c . conftest.vals`
13676   # grep -c gives empty output for an empty file on some AIX systems.
13677   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13678   # Write a limited-size here document to conftest.frag.
13679   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13680   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13681   echo 'CEOF
13682   sed -f conftest.frag conftest.in > conftest.out
13683   rm -f conftest.in
13684   mv conftest.out conftest.in
13685 ' >> $CONFIG_STATUS
13686   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13687   rm -f conftest.vals
13688   mv conftest.tail conftest.vals
13689 done
13690 rm -f conftest.vals
13691
13692 cat >> $CONFIG_STATUS <<\EOF
13693   rm -f conftest.frag conftest.h
13694   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13695   cat conftest.in >> conftest.h
13696   rm -f conftest.in
13697   if cmp -s $ac_file conftest.h 2>/dev/null; then
13698     echo "$ac_file is unchanged"
13699     rm -f conftest.h
13700   else
13701     # Remove last slash and all that follows it.  Not all systems have dirname.
13702       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13703       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13704       # The file is in a subdirectory.
13705       test ! -d "$ac_dir" && mkdir "$ac_dir"
13706     fi
13707     rm -f $ac_file
13708     mv conftest.h $ac_file
13709   fi
13710 fi; done
13711
13712 EOF
13713 cat >> $CONFIG_STATUS <<EOF
13714 CPP="$CPP"
13715  top_srcdir="$srcdir"
13716  MAKE_SUBDIR="$MAKE_SUBDIR"
13717
13718 EOF
13719 cat >> $CONFIG_STATUS <<\EOF
13720 for dir in . $MAKE_SUBDIR; do
13721   (
13722     cd $dir
13723     rm -f junk.c
13724     < Makefile.in \
13725       sed -e '/^# Generated/d' \
13726           -e 's%/\*\*/#.*%%' \
13727           -e 's/^ *# */#/' \
13728           -e '/^##/d' \
13729           -e '/^#/ {
13730 p
13731 d
13732 }'        \
13733           -e '/./ {
13734 s/\([\"]\)/\\\1/g
13735 s/^/"/
13736 s/$/"/
13737 }'  > junk.c;
13738
13739
13740
13741     echo creating $dir/Makefile
13742 $CPP -I. -I${top_srcdir}/src  junk.c \
13743   | sed -e 's/^\#.*//'          \
13744         -e 's/^[        ][      ]*$//'\
13745         -e 's/^ /       /'              \
13746   | sed -n -e '/^..*$/p'        \
13747   | sed '/^\"/ {
13748         s/\\\([\"]\)/\1/g
13749         s/^[    ]*\"//
13750         s/\"[   ]*$//
13751 }' > Makefile.new
13752     chmod 444 Makefile.new
13753     mv -f Makefile.new Makefile
13754
13755     echo creating $dir/GNUmakefile
13756 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13757   | sed -e 's/^\#.*//'          \
13758         -e 's/^[        ][      ]*$//'\
13759         -e 's/^ /       /'              \
13760   | sed -n -e '/^..*$/p'        \
13761   | sed '/^\"/ {
13762         s/\\\([\"]\)/\1/g
13763         s/^[    ]*\"//
13764         s/\"[   ]*$//
13765 }' > Makefile.new
13766     chmod 444 Makefile.new
13767     mv -f Makefile.new GNUmakefile
13768
13769     rm -f junk.c
13770   )
13771 done
13772
13773 sed < config.status >> lib-src/config.values \
13774   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13775   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13776   -e 's/^\([^ ]*\) $/\1 ""/' \
13777   -e 's/ 1$/ t/'
13778
13779
13780 exit 0
13781 EOF
13782 chmod +x $CONFIG_STATUS
13783 rm -fr confdefs* $ac_clean_files
13784 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1