update.
[chise/xemacs-chise.git-] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.13 
6 #### Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
7 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
8 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
9 #### Copyright (C) 1995, 1996 Ben Wing.
10 #### Copyright (C) 1998, 1999 J. Kean Johnston.
11
12 ### Don't edit this script!
13 ### This script was automatically generated by the `autoconf' program
14 ### from the file `./configure.in'.
15 ### To rebuild it, execute the command
16 ###     autoconf
17 ### in the this directory.  You must have autoconf version 2.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_utf_2000   | \
344         with_file_coding| \
345         with_canna      | \
346         with_wnn        | \
347         with_wnn6       | \
348         with_workshop   | \
349         with_sparcworks | \
350         with_tooltalk   | \
351         with_ldap       | \
352         with_pop        | \
353         with_kerberos   | \
354         with_hesiod     | \
355         with_dnet       | \
356         with_infodock   | \
357         external_widget | \
358         verbose         | \
359         extra_verbose   | \
360         const_is_losing | \
361         usage_tracking  | \
362         use_union_type  | \
363         debug           | \
364         use_assertions  | \
365         memory_usage_stats | \
366         with_clash_detection | \
367         with_modules | \
368         no_doc_file )
369                   case "$val" in
370             y | ye | yes )      val=yes ;;
371             n | no )            val=no  ;;
372             * ) (echo "$progname: Usage error:"
373 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
374 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
375           esac
376           eval "$opt=\"$val\"" ;;
377
378
379                         srcdir          | \
380         compiler        | \
381         cflags          | \
382         cpp             | \
383         cppflags        | \
384         libs            | \
385         ldflags         | \
386         cache_file      | \
387         native_sound_lib| \
388         site_lisp       | \
389         x_includes      | \
390         x_libraries     | \
391         site_includes   | \
392         site_libraries  | \
393         site_prefixes   | \
394         site_runtime_libraries )
395                   if test "$valomitted" = "yes" ; then
396                     if test "$#" = 0 ; then
397               (echo "$progname: Usage error:"
398 echo " " "The \`--$optname' option requires a value."
399 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
400             fi
401             val="$1"; shift
402           fi
403           eval "$opt=\"$val\""
404         ;;
405
406                 rel_alloc | \
407         with_dlmalloc | \
408         with_debug_malloc  | use_debug_malloc | \
409         with_system_malloc | use_system_malloc )
410           case "$val" in
411             y | ye | yes )      val=yes ;;
412             n | no )            val=no  ;;
413             d | de | def | defa | defau | defaul | default ) val=default ;;
414             * ) (echo "$progname: Usage error:"
415 echo " " "The \`--$optname' option requires one of these values:
416   \`yes', \`no', or \`default'."
417 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
418           esac
419           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
420           eval "$opt=\"$val\""
421         ;;
422
423                 "with_database" )
424           with_database_berkdb=no
425           with_database_dbm=no
426           with_database_gnudbm=no
427           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
428             case "$x" in
429                 no ) ;;
430                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
431                 d | db | dbm )                          with_database_dbm=yes    ;;
432                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
433                 * ) (echo "$progname: Usage error:"
434 echo " " "The \`--$optname' option value
435   must be either \`no' or a comma-separated list
436   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
437 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
438             esac
439           done
440           if test "$with_database_dbm"    = "yes" -a \
441                   "$with_database_gnudbm" = "yes"; then
442           (echo "$progname: Usage error:"
443 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
444   with the \`--$optname' option."
445 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
446           fi
447         ;;
448
449                 "with_sound" )
450                           case "$val" in
451             y | ye | yes )                      val=native ;;
452             n | no | non | none )               val=no;;
453             na | nat | nati | nativ | native )  val=native  ;;
454             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
455             b | bo | bot | both )               val=both;;
456             * ) (echo "$progname: Usage error:"
457 echo " " "The \`--$optname' option must have one of these values:
458   \`native', \`nas', \`both', or \`none'."
459 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
460           esac
461           eval "$opt=\"$val\""
462         ;;
463
464                 "with_xim" )
465           case "$val" in
466             y | ye | yes )                val=yes   ;;
467             n | no | non | none )         val=no    ;;
468             x | xl | xli | xlib )         val=xlib  ;;
469             m | mo | mot | moti | motif ) val=motif ;;
470             * ) (echo "$progname: Usage error:"
471 echo " " "The \`--$optname' option must have one of these values:
472   \`motif', \`xlib', \`yes', or \`no'."
473 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
474           esac
475           eval "$opt=\"$val\""
476         ;;
477
478                 "mail_locking" )
479           case "$val" in
480             lockf )     val=lockf ;;
481             flock )     val=flock ;;
482             file )      val=file  ;;
483             * ) (echo "$progname: Usage error:"
484 echo " " "The \`--$optname' option must have one of these values:
485   \`lockf', \`flock', or \`file'."
486 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
487           esac
488           eval "$opt=\"$val\""
489         ;;
490
491                 "error_checking" )
492                           
493           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
494             case "$x" in
495                       n | no | non | none ) new_default=no ;;
496               a | al | all )        new_default=yes ;;
497
498               extents )       error_check_extents=yes ;;
499               noextents )     error_check_extents=no ;;
500
501               typecheck )     error_check_typecheck=yes ;;
502               notypecheck )   error_check_typecheck=no ;;
503
504               bufpos )        error_check_bufpos=yes ;;
505               nobufpos )      error_check_bufpos=no ;;
506
507               gc )            error_check_gc=yes ;;
508               nogc )          error_check_gc=no ;;
509
510               malloc )        error_check_malloc=yes ;;
511               nomalloc )      error_check_malloc=no ;;
512
513               byte_code )     error_check_byte_code=yes ;;
514               nobyte_code )   error_check_byte_code=no ;;
515
516               * ) bogus_error_check=yes ;;
517             esac
518             if test "$bogus_error_check" -o \
519                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
520                 if test "$error_check_default" = yes ; then
521                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
522                 else
523                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
524                 fi
525                 (echo "$progname: Usage error:"
526 echo " " "Valid types for the \`--$optname' option are:
527   $types."
528 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
529             elif test -n "$new_default" ; then
530                 error_check_extents=$new_default
531                 error_check_typecheck=$new_default
532                 error_check_bufpos=$new_default
533                 error_check_gc=$new_default
534                 error_check_malloc=$new_default
535                 error_check_byte_code=$new_default
536                 new_default=    # reset this
537             fi
538             echeck_notfirst=true
539           done
540         ;;
541
542                                 
543                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
544         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
545         archlibdir | docdir | package_path )
546                    if test "$valomitted" = "yes"; then
547              if test "$#" = 0; then
548                  (echo "$progname: Usage error:"
549 echo " " "The \`--$optname' option requires a value."
550 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
551              fi
552              val="$1"; shift
553            fi
554            eval "$opt=\"$val\""
555
556                            case "$opt" in
557                      exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
558     Defining EXEC_PREFIX_USER_DEFINED
559 EOF
560 cat >> confdefs.h <<\EOF
561 #define EXEC_PREFIX_USER_DEFINED 1
562 EOF
563 }
564  ;;
565              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
566     Defining LISPDIR_USER_DEFINED
567 EOF
568 cat >> confdefs.h <<\EOF
569 #define LISPDIR_USER_DEFINED 1
570 EOF
571 }
572  ;;
573              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
574     Defining SITELISPDIR_USER_DEFINED
575 EOF
576 cat >> confdefs.h <<\EOF
577 #define SITELISPDIR_USER_DEFINED 1
578 EOF
579 }
580  ;;
581              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
582     Defining MODULEDIR_USER_DEFINED
583 EOF
584 cat >> confdefs.h <<\EOF
585 #define MODULEDIR_USER_DEFINED 1
586 EOF
587 }
588  ;;
589              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
590     Defining ETCDIR_USER_DEFINED
591 EOF
592 cat >> confdefs.h <<\EOF
593 #define ETCDIR_USER_DEFINED 1
594 EOF
595 }
596  ;;
597              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
598     Defining INFODIR_USER_DEFINED
599 EOF
600 cat >> confdefs.h <<\EOF
601 #define INFODIR_USER_DEFINED 1
602 EOF
603 }
604  ;;
605              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
606     Defining INFOPATH_USER_DEFINED
607 EOF
608 cat >> confdefs.h <<\EOF
609 #define INFOPATH_USER_DEFINED 1
610 EOF
611 }
612  ;;
613              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
614     Defining PACKAGE_PATH_USER_DEFINED
615 EOF
616 cat >> confdefs.h <<\EOF
617 #define PACKAGE_PATH_USER_DEFINED 1
618 EOF
619 }
620  ;;
621              datadir )
622                 { test "$extra_verbose" = "yes" && cat << \EOF
623     Defining INFODIR_USER_DEFINED
624 EOF
625 cat >> confdefs.h <<\EOF
626 #define INFODIR_USER_DEFINED 1
627 EOF
628 }
629
630                 { test "$extra_verbose" = "yes" && cat << \EOF
631     Defining LISPDIR_USER_DEFINED
632 EOF
633 cat >> confdefs.h <<\EOF
634 #define LISPDIR_USER_DEFINED 1
635 EOF
636 }
637
638             { test "$extra_verbose" = "yes" && cat << \EOF
639     Defining MODULEDIR_USER_DEFINED
640 EOF
641 cat >> confdefs.h <<\EOF
642 #define MODULEDIR_USER_DEFINED 1
643 EOF
644 }
645
646                 { test "$extra_verbose" = "yes" && cat << \EOF
647     Defining ETCDIR_USER_DEFINED
648 EOF
649 cat >> confdefs.h <<\EOF
650 #define ETCDIR_USER_DEFINED 1
651 EOF
652 }
653  ;;
654              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
655     Defining LOCKDIR_USER_DEFINED
656 EOF
657 cat >> confdefs.h <<\EOF
658 #define LOCKDIR_USER_DEFINED 1
659 EOF
660 }
661  ;;
662              docdir ) { test "$extra_verbose" = "yes" && cat << \EOF
663     Defining DOCDIR_USER_DEFINED
664 EOF
665 cat >> confdefs.h <<\EOF
666 #define DOCDIR_USER_DEFINED 1
667 EOF
668 }
669  ;;
670              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
671     Defining ARCHLIBDIR_USER_DEFINED
672 EOF
673 cat >> confdefs.h <<\EOF
674 #define ARCHLIBDIR_USER_DEFINED 1
675 EOF
676 }
677  ;;
678            esac
679         ;;
680
681                 "no_create" ) ;;
682
683                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
684
685                 "with_menubars"   | \
686         "with_scrollbars" | \
687         "with_dialogs" | \
688         "with_widgets" )
689           case "$val" in
690             l | lu | luc | luci | lucid )               val=lucid  ;;
691             m | mo | mot | moti | motif )               val=motif  ;;
692             athena3d | athena-3d )                      val=athena3d ;;
693             a | at | ath | athe | athen | athena )      val=athena ;;
694             n | no | non | none )                       val=no ;;
695             * ) (echo "$progname: Usage error:"
696 echo " " "The \`--$optname' option must have one of these values:
697   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
698 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
699           esac
700           eval "$opt=\"$val\""
701         ;;
702
703                 "run_in_place"  | \
704         "with_gnu_make" )
705           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
706         ;;
707
708                 * ) (echo "$progname: Usage error:"
709 echo " " "Unrecognized option: $arg"
710 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
711
712       esac
713     ;;
714
715         *-*-*) configuration="$arg" ;;
716
717         *) (echo "$progname: Usage error:"
718 echo " " "Unrecognized argument: $arg"
719 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
720
721   esac
722 done
723
724
725 test -n "$cpp"      && CPP="$cpp"
726 test -n "$cppflags" && CPPFLAGS="$cppflags"
727 test -n "$libs"     && LIBS="$libs"
728 test -n "$ldflags"  && LDFLAGS="$ldflags"
729
730 eval set x "$quoted_arguments"; shift
731
732 test "$extra_verbose" = "yes" && verbose=yes
733
734 test -n "$with_x" && with_x11="$with_x"
735
736 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
737   test "$with_system_malloc" = "default" && with_system_malloc=yes
738 fi
739
740
741
742 if test "$with_cde $with_tooltalk" = "yes no"; then
743   (echo "$progname: Usage error:"
744 echo " " "--with-cde requires --with-tooltalk"
745 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
746 elif test "$with_tooltalk" = "no" ; then with_cde=no
747 elif test "$with_cde" = "yes"; then with_tooltalk=yes
748 fi
749
750
751 case "$srcdir" in
752
753     "" )
754     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
755       if test -f "$dir/src/lisp.h" -a \
756               -f "$dir/lisp/version.el" ; then
757         srcdir="$dir"
758         break
759       fi
760     done
761     if test -z "$srcdir" ; then
762       (echo "$progname: Usage error:"
763 echo " " "Neither the current directory nor its parent seem to
764   contain the XEmacs sources.  If you do not want to build XEmacs in its
765   source tree, you should run \`$progname' in the directory in which
766   you wish to build XEmacs, using the \`--srcdir' option to say where the
767   sources may be found."
768 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
769     fi
770   ;;
771
772     * )
773     if test ! -f "$srcdir/src/lisp.h" -o \
774             ! -f "$srcdir/lisp/version.el" ; then
775       (echo "$progname: Usage error:"
776 echo " " "The directory specified with the \`--srcdir' option,
777   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
778   either run the \`$progname' script at the top of the XEmacs source
779   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
780 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
781     fi
782   ;;
783 esac
784
785 if test -z "$configuration"; then
786     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
787   if test -z "$configuration"; then
788     (echo "$progname: Usage error:"
789 echo " " "XEmacs has not been ported to this host type.
790 Try explicitly specifying the CONFIGURATION when rerunning configure."
791 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
792   fi
793 fi
794
795 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
796 echo "configure:797: checking whether ln -s works" >&5
797
798 rm -f conftestdata
799 if ln -s X conftestdata 2>/dev/null
800 then
801   rm -f conftestdata
802   ac_cv_prog_LN_S="ln -s"
803 else
804   ac_cv_prog_LN_S=ln
805 fi
806 LN_S="$ac_cv_prog_LN_S"
807 if test "$ac_cv_prog_LN_S" = "ln -s"; then
808   echo "$ac_t""yes" 1>&6
809 else
810   echo "$ac_t""no" 1>&6
811 fi
812
813
814 for dir in lisp etc man info; do
815   if test ! -d "$dir" ; then
816     echo Making symbolic link to "$srcdir/$dir"
817     ${LN_S} "$srcdir/$dir" "$dir"
818   fi
819 done
820
821
822 absolute_pwd="`pwd`";
823 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
824 then blddir="$PWD"
825 else blddir="$absolute_pwd"; if test -d "/net"; then
826   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
827   blddir=`echo "$blddir" | \
828    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
829 fi
830 fi
831
832
833 case "$srcdir" in
834   /* ) ;;
835   .  ) srcdir="$blddir" ;;
836   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
837   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
838   srcdir=`echo "$srcdir" | \
839    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
840 fi ;;
841 esac
842
843 if test `pwd` != `sh -c cd $srcdir && pwd`  \
844    && test -f "$srcdir/src/config.h"; then
845   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
846    echo "   as a build directory right now; it has been configured in its own"
847    echo "   right.  To configure in another directory as well, you MUST"
848    echo "   use GNU make.  If you do not have GNU make, then you must"
849    echo "   now do \`make distclean' in $srcdir,"
850    echo "   and then run $progname again.") >&2
851   extrasub='/^VPATH[     ]*=/c\
852 vpath %.c $(srcdir)\
853 vpath %.h $(srcdir)\
854 vpath %.y $(srcdir)\
855 vpath %.l $(srcdir)\
856 vpath %.s $(srcdir)\
857 vpath %.in $(srcdir)'
858 fi
859
860 . "$srcdir/version.sh" || exit 1;
861 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
862 : "${extra_verbose=$beta}"
863 version="${emacs_major_version}.${emacs_minor_version}"
864 { test "$extra_verbose" = "yes" && cat << EOF
865     Defining EMACS_MAJOR_VERSION = $emacs_major_version
866 EOF
867 cat >> confdefs.h <<EOF
868 #define EMACS_MAJOR_VERSION $emacs_major_version
869 EOF
870 }
871
872 { test "$extra_verbose" = "yes" && cat << EOF
873     Defining EMACS_MINOR_VERSION = $emacs_minor_version
874 EOF
875 cat >> confdefs.h <<EOF
876 #define EMACS_MINOR_VERSION $emacs_minor_version
877 EOF
878 }
879
880 if test -n "$emacs_beta_version" ; then
881   if test "$beta" = "yes"; then
882         version="${version}-b${emacs_beta_version}"
883         { test "$extra_verbose" = "yes" && cat << EOF
884     Defining EMACS_BETA_VERSION = $emacs_beta_version
885 EOF
886 cat >> confdefs.h <<EOF
887 #define EMACS_BETA_VERSION $emacs_beta_version
888 EOF
889 }
890
891   else
892         version="${version}.${emacs_beta_version}"
893         { test "$extra_verbose" = "yes" && cat << EOF
894     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
895 EOF
896 cat >> confdefs.h <<EOF
897 #define EMACS_PATCH_LEVEL $emacs_beta_version
898 EOF
899 }
900
901   fi
902 fi
903 { test "$extra_verbose" = "yes" && cat << EOF
904     Defining XEMACS_CODENAME = "$xemacs_codename"
905 EOF
906 cat >> confdefs.h <<EOF
907 #define XEMACS_CODENAME "$xemacs_codename"
908 EOF
909 }
910
911 { test "$extra_verbose" = "yes" && cat << EOF
912     Defining EMACS_VERSION = "$version"
913 EOF
914 cat >> confdefs.h <<EOF
915 #define EMACS_VERSION "$version"
916 EOF
917 }
918
919
920 if test "$with_infodock" = "yes"; then
921   if test ! -f ../../ID-INSTALL; then
922     echo "Cannot build InfoDock without InfoDock sources"
923     with_infodock=no
924   fi
925 fi
926
927 if test "$with_infodock" = "yes"; then
928       { test "$extra_verbose" = "yes" && cat << EOF
929     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
930 EOF
931 cat >> confdefs.h <<EOF
932 #define INFODOCK_MAJOR_VERSION $infodock_major_version
933 EOF
934 }
935
936   { test "$extra_verbose" = "yes" && cat << EOF
937     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
938 EOF
939 cat >> confdefs.h <<EOF
940 #define INFODOCK_MINOR_VERSION $infodock_minor_version
941 EOF
942 }
943
944   { test "$extra_verbose" = "yes" && cat << EOF
945     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
946 EOF
947 cat >> confdefs.h <<EOF
948 #define INFODOCK_BUILD_VERSION $infodock_build_version
949 EOF
950 }
951
952   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
953   PROGNAME=infodock
954   CPPFLAGS="$CPPFLAGS -DINFODOCK"
955 else
956   PROGNAME=xemacs
957 fi
958
959 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
960 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
961     Defining ERROR_CHECK_EXTENTS
962 EOF
963 cat >> confdefs.h <<\EOF
964 #define ERROR_CHECK_EXTENTS 1
965 EOF
966 }
967
968 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
969     Defining ERROR_CHECK_TYPECHECK
970 EOF
971 cat >> confdefs.h <<\EOF
972 #define ERROR_CHECK_TYPECHECK 1
973 EOF
974 }
975
976 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
977     Defining ERROR_CHECK_BUFPOS
978 EOF
979 cat >> confdefs.h <<\EOF
980 #define ERROR_CHECK_BUFPOS 1
981 EOF
982 }
983
984 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
985     Defining ERROR_CHECK_GC
986 EOF
987 cat >> confdefs.h <<\EOF
988 #define ERROR_CHECK_GC 1
989 EOF
990 }
991
992 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
993     Defining ERROR_CHECK_MALLOC
994 EOF
995 cat >> confdefs.h <<\EOF
996 #define ERROR_CHECK_MALLOC 1
997 EOF
998 }
999
1000 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1001     Defining ERROR_CHECK_BYTE_CODE
1002 EOF
1003 cat >> confdefs.h <<\EOF
1004 #define ERROR_CHECK_BYTE_CODE 1
1005 EOF
1006 }
1007
1008 if test "${debug:=$beta}" = "yes"; then
1009   use_assertions=yes memory_usage_stats=yes
1010   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
1011    echo "    xemacs will be linked with \"debug.o\""
1012  fi
1013   { test "$extra_verbose" = "yes" && cat << \EOF
1014     Defining DEBUG_XEMACS
1015 EOF
1016 cat >> confdefs.h <<\EOF
1017 #define DEBUG_XEMACS 1
1018 EOF
1019 }
1020
1021 fi
1022 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1023     Defining USE_ASSERTIONS
1024 EOF
1025 cat >> confdefs.h <<\EOF
1026 #define USE_ASSERTIONS 1
1027 EOF
1028 }
1029
1030 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1031     Defining MEMORY_USAGE_STATS
1032 EOF
1033 cat >> confdefs.h <<\EOF
1034 #define MEMORY_USAGE_STATS 1
1035 EOF
1036 }
1037
1038
1039
1040 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1041 echo "configure:1042: checking "host system type"" >&5
1042 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1043 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1044 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1045 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1046 echo "$ac_t""$configuration" 1>&6
1047
1048
1049
1050
1051
1052 machine='' opsys=''
1053
1054 case "$canonical" in
1055   sparc-*-*        ) machine=sparc ;;
1056   alpha*-*-*       ) machine=alpha ;;
1057   vax-*-*          ) machine=vax ;;
1058   mips-dec-*       ) machine=pmax ;;
1059   mips-sgi-*       ) machine=iris4d ;;
1060   romp-ibm-*       ) machine=ibmrt ;;
1061   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1062   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1063   powerpc*-*       ) machine=powerpc ;;
1064   hppa-*-*         ) machine=hp800 ;;
1065   m88k-dg-*        ) machine=aviion ;;
1066   m68*-sony-*      ) machine=news ;;
1067   mips-sony-*      ) machine=news-risc ;;
1068   clipper-*        ) machine=clipper ;;
1069   arm-*            ) machine=arm ;;
1070   ns32k-*          ) machine=ns32000 ;;
1071 esac
1072
1073 case "$canonical" in
1074   *-*-linux*    ) opsys=linux ;;
1075   *-*-netbsd*   ) opsys=netbsd ;;
1076   *-*-openbsd*  ) opsys=openbsd ;;
1077   *-*-nextstep* ) opsys=nextstep ;;
1078   *-*-vms       ) opsys=vms ;;
1079
1080     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1081   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1082   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1083   *-dec-osf3*                ) opsys=decosf3-1 ;;
1084   *-dec-osf4*                ) opsys=decosf4-0 ;;
1085
1086     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1087   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1088   *-*-ultrix* )         opsys=ultrix4-3 ;;
1089
1090     *-*-aix3.1*  ) opsys=aix3-1 ;;
1091   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1092   *-*-aix3*    ) opsys=aix3-2   ;;
1093   *-*-aix4.0*  ) opsys=aix4     ;;
1094   *-*-aix4.1*  ) opsys=aix4-1   ;;
1095   *-*-aix4*    ) opsys=aix4-2   ;;
1096
1097     *-gnu* )                    opsys=gnu    ;;
1098   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1099   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1100   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1101   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1102   *-*-aos*   )                  opsys=bsd4-3 ;;
1103   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1104   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1105   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1106   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1107   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1108   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1109         if test -z "$NON_GNU_CPP" ; then
1110           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1111             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1112           done
1113         fi
1114         opsys=usg5-4-2 ;;
1115     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1116     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1117 esac
1118
1119 case "$canonical" in
1120
1121     *-*-netbsd* )
1122     case "$canonical" in
1123       i[3-9]86-*-netbsd*) machine=intel386 ;;
1124       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1125                                             machine=hp9000s300 ;;
1126       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1127       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1128     esac
1129   ;;
1130
1131     *-*-openbsd* )
1132     case "${canonical}" in
1133       i386-*-openbsd*)          machine=intel386 ;;
1134       m68k-*-openbsd*)          machine=hp9000s300 ;;
1135       mipsel-*-openbsd*)        machine=pmax ;;
1136      esac
1137    ;;
1138
1139     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1140   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1141
1142     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1143   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1144
1145     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1146
1147     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1148
1149     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1150
1151     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1152
1153     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1154
1155     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1156   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1157   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1158
1159   
1160     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1161
1162     *-convex-bsd* | *-convex-convexos* )
1163     machine=convex opsys=bsd4-3
1164     NON_GNU_CPP="cc -E -P"
1165   ;;
1166
1167     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1168
1169     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1170   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1171   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1172   m88k-dg-dgux*                           ) opsys=dgux     ;;
1173
1174     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1175   m88k-motorola-sysv4* )
1176                     machine=delta88k opsys=usg5-4-2
1177   ;;
1178   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1179
1180     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1181   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1182
1183     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1184
1185     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1186   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1187   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1188
1189       m88k-harris-cxux* )
1190         case "`uname -r`" in
1191        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1192        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1193     esac
1194     NON_GNU_CPP="/lib/cpp"
1195   ;;
1196     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1197     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1198
1199     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1200
1201     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1202
1203     *-hp-hpux* )
1204         case "$canonical" in
1205       m68*  ) machine=hp9000s300 ;;
1206       hppa* ) machine=hp800      ;;
1207     esac
1208
1209     case "$canonical" in
1210       *-hp-hpux7*  )  opsys=hpux   ;;
1211       *-hp-hpux8*  )  opsys=hpux8  ;;
1212       *-hp-hpux9*  )  opsys=hpux9  ;;
1213       *-hp-hpux10* )  opsys=hpux10 ;;
1214       *-hp-hpux11* )  opsys=hpux11 ;;
1215       *            )  opsys=hpux   ;;
1216     esac
1217
1218         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1219    echo "    xemacs will be linked with \"strcat.o\""
1220  fi ;; esac
1221
1222     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1223         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1224     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1225
1226     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1227   ;;
1228
1229     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1230   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1231
1232     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1233   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1234   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1235   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1236   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1237   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1238
1239     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1240   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1241
1242     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1243
1244     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1245
1246     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1247
1248     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1249
1250       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1251
1252     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1253
1254     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1255
1256     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1257
1258     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1259
1260         mips-mips-usg* ) machine=mips4 ;;
1261   mips-mips-riscos4 )
1262     machine=mips4
1263     NON_GNU_CC="cc -systype bsd43"
1264     NON_GNU_CPP="cc -systype bsd43 -E"
1265     case "$canonical" in
1266       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1267       mips-mips-riscos5* ) opsys=riscos5 ;;
1268     esac
1269   ;;
1270   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1271   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1272
1273     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1274
1275     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1276
1277     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1278   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1279
1280     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1281
1282     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1283
1284     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1285
1286     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1287
1288     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1289   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1290
1291     mips-siemens-sysv* | mips-sni-sysv*)
1292     machine=mips-siemens opsys=usg5-4
1293     NON_GNU_CC=/usr/ccs/bin/cc
1294     NON_GNU_CPP=/usr/ccs/lib/cpp
1295   ;;
1296
1297     mips-nec-sysv*)
1298     machine=mips-nec
1299     NON_GNU_CC=/usr/ccs/bin/cc
1300     NON_GNU_CPP=/usr/ccs/lib/cpp
1301   ;;
1302
1303       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1304   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1305     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1306   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1307   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1308   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1309   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1310   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1311   mips-sgi-irix*      ) opsys=irix5-0 ;;
1312
1313     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1314   *-sony-news* ) opsys=newsos5 ;;
1315
1316     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1317
1318     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1319         case "$canonical" in
1320       m68*-sunos1* )             machine=sun1     ;;
1321       m68*-sunos2* )             machine=sun2     ;;
1322       m68* )                     machine=sun3     ;;
1323       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1324       i*86-*-* )                 machine=intel386 ;;
1325       rs6000* )                  machine=rs6000   ;;
1326     esac
1327
1328         case "$canonical" in *-sunos5*)
1329       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1330     esac
1331
1332                     case "$canonical" in
1333       *-sunos4* )
1334         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1335         : ;;
1336       *-solaris2* )
1337         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1338         RANLIB=':' ;;
1339     esac
1340
1341     case "$canonical" in
1342       *-solaris*          )
1343         opsys=sol2
1344         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1345         { test "$extra_verbose" = "yes" && cat << EOF
1346     Defining OS_RELEASE = $os_release
1347 EOF
1348 cat >> confdefs.h <<EOF
1349 #define OS_RELEASE $os_release
1350 EOF
1351 }
1352  ;;
1353
1354             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1355       *-sunos4.0*         ) opsys=sunos4-0      ;;
1356       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1357       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1358       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1359       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1360       *-mach*             ) opsys=mach-bsd4-3   ;;
1361       *                   ) opsys=bsd4-2        ;;
1362     esac
1363
1364     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1365
1366         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1367   ;;
1368
1369     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1370
1371     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1372   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1373
1374     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1375
1376     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1377
1378     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1379       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1380
1381     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1382
1383     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1384
1385     vax-dec-* )
1386     case "$canonical" in
1387       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1388       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1389       *-mach* )                         opsys=mach-bsd4-3 ;;
1390     esac
1391   ;;
1392
1393     ns16k-whitechapel-* ) machine=mg1 ;;
1394
1395     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1396
1397     i[3-9]86-*-* )
1398     machine=intel386
1399     case "$canonical" in
1400       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1401       *-isc2.2* )               opsys=isc2-2 ;;
1402       *-isc4.0* )               opsys=isc4-0 ;;
1403       *-isc4.* )                opsys=isc4-1
1404                                 GCC_TEST_OPTIONS=-posix
1405                                 NON_GCC_TEST_OPTIONS=-Xp
1406                                 ;;
1407       *-isc* )                  opsys=isc3-0 ;;
1408       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1409       *-esix* )                 opsys=esix ;;
1410       *-mach* )                 opsys=mach-bsd4-3 ;;
1411       *-xenix* )                opsys=xenix ;;
1412       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1413       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1414       *-bsdi4* )                opsys=bsdos4 ;;
1415       *-bsdi3* )                opsys=bsdos3 ;;
1416       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1417       *-bsdi2* )                opsys=bsdos2 ;;
1418       *-sco3.2v5* )             opsys=sco5 ;
1419                                                         if test "$dynamic" = "yes" ; then
1420                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1421         else
1422                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1423         fi ;;
1424       *-sysv5* )                opsys=sco7 ;;
1425       *-386bsd* )               opsys=386bsd ;;
1426       *-freebsd* )              opsys=freebsd ;;
1427       *-nextstep* )             opsys=nextstep ;;
1428       *-pc-cygwin* )            opsys=cygwin32 ;;
1429       *-pc-mingw* )             opsys=mingw32 ;
1430                                 test -z "$with_tty" && with_tty="no";;
1431           esac
1432   ;;
1433
1434     m68k-*-linux* ) machine=m68k opsys=linux ;;
1435
1436 esac
1437
1438 if test -z "$machine" -o -z "$opsys"; then
1439   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1440    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1441   ) >&2
1442   exit 1
1443 fi
1444
1445 if test -z "$dynamic"; then
1446   case "$opsys" in
1447     hpux* | sunos4* ) dynamic=no ;;
1448     *) dynamic=yes ;;
1449   esac
1450 fi
1451 if test "$dynamic" = "yes"; then
1452   case "$opsys" in
1453     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1454     decosf* ) ld_call_shared="-call_shared" ;;
1455   esac
1456 else   case "$opsys" in
1457     sol2 )
1458       echo "Static linking is not supported on Solaris 2."
1459       echo "Rerun configure without specifying --dynamic=no."
1460       exit 1 ;;
1461     linux   ) ld_call_shared="-Bstatic" ;;
1462     decosf* ) ld_call_shared="-non_shared" ;;
1463   esac
1464 fi
1465
1466 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1467
1468 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1469 { test "$extra_verbose" = "yes" && cat << EOF
1470     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1471 EOF
1472 cat >> confdefs.h <<EOF
1473 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1474 EOF
1475 }
1476
1477
1478 machfile="m/${machine}.h"
1479 opsysfile="s/${opsys}.h"
1480
1481
1482 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1483 if test "$with_workshop $with_tooltalk" = "yes no"; then
1484   (echo "$progname: Usage error:"
1485 echo " " "--with-workshop requires --with-tooltalk"
1486 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1487 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1488 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1489 fi
1490
1491 if test "$with_workshop" = "yes"; then
1492   { test "$extra_verbose" = "yes" && cat << \EOF
1493     Defining SUNPRO
1494 EOF
1495 cat >> confdefs.h <<\EOF
1496 #define SUNPRO 1
1497 EOF
1498 }
1499
1500   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1501    echo "    xemacs will be linked with \"sunpro.o\""
1502  fi
1503 fi
1504
1505 if test "$with_clash_detection" = "yes"; then
1506   { test "$extra_verbose" = "yes" && cat << \EOF
1507     Defining CLASH_DETECTION
1508 EOF
1509 cat >> confdefs.h <<\EOF
1510 #define CLASH_DETECTION 1
1511 EOF
1512 }
1513
1514   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1515    echo "    xemacs will be linked with \"filelock.o\""
1516  fi
1517 fi
1518
1519 test -n "$compiler" && CC="$compiler"
1520 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1521 fi
1522
1523 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1524 if test "${CFLAGS-unset}" != unset
1525   then cflags_specified=yes;
1526   else cflags_specified=no;
1527 fi
1528
1529 xe_save_CFLAGS="$CFLAGS"
1530
1531 # Extract the first word of "gcc", so it can be a program name with args.
1532 set dummy gcc; ac_word=$2
1533 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1534 echo "configure:1535: checking for $ac_word" >&5
1535
1536 if test -n "$CC"; then
1537   ac_cv_prog_CC="$CC" # Let the user override the test.
1538 else
1539   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1540   ac_dummy="$PATH"
1541   for ac_dir in $ac_dummy; do
1542     test -z "$ac_dir" && ac_dir=.
1543     if test -f $ac_dir/$ac_word; then
1544       ac_cv_prog_CC="gcc"
1545       break
1546     fi
1547   done
1548   IFS="$ac_save_ifs"
1549 fi
1550 CC="$ac_cv_prog_CC"
1551 if test -n "$CC"; then
1552   echo "$ac_t""$CC" 1>&6
1553 else
1554   echo "$ac_t""no" 1>&6
1555 fi
1556
1557 if test -z "$CC"; then
1558   # Extract the first word of "cc", so it can be a program name with args.
1559 set dummy cc; ac_word=$2
1560 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1561 echo "configure:1562: checking for $ac_word" >&5
1562
1563 if test -n "$CC"; then
1564   ac_cv_prog_CC="$CC" # Let the user override the test.
1565 else
1566   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1567   ac_prog_rejected=no
1568   ac_dummy="$PATH"
1569   for ac_dir in $ac_dummy; do
1570     test -z "$ac_dir" && ac_dir=.
1571     if test -f $ac_dir/$ac_word; then
1572       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1573         ac_prog_rejected=yes
1574         continue
1575       fi
1576       ac_cv_prog_CC="cc"
1577       break
1578     fi
1579   done
1580   IFS="$ac_save_ifs"
1581 if test $ac_prog_rejected = yes; then
1582   # We found a bogon in the path, so make sure we never use it.
1583   set dummy $ac_cv_prog_CC
1584   shift
1585   if test $# -gt 0; then
1586     # We chose a different compiler from the bogus one.
1587     # However, it has the same basename, so the bogon will be chosen
1588     # first if we set CC to just the basename; use the full file name.
1589     shift
1590     set dummy "$ac_dir/$ac_word" "$@"
1591     shift
1592     ac_cv_prog_CC="$@"
1593   fi
1594 fi
1595 fi
1596 CC="$ac_cv_prog_CC"
1597 if test -n "$CC"; then
1598   echo "$ac_t""$CC" 1>&6
1599 else
1600   echo "$ac_t""no" 1>&6
1601 fi
1602
1603   if test -z "$CC"; then
1604     case "`uname -s`" in
1605     *win32* | *WIN32*)
1606       # Extract the first word of "cl", so it can be a program name with args.
1607 set dummy cl; ac_word=$2
1608 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1609 echo "configure:1610: checking for $ac_word" >&5
1610
1611 if test -n "$CC"; then
1612   ac_cv_prog_CC="$CC" # Let the user override the test.
1613 else
1614   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1615   ac_dummy="$PATH"
1616   for ac_dir in $ac_dummy; do
1617     test -z "$ac_dir" && ac_dir=.
1618     if test -f $ac_dir/$ac_word; then
1619       ac_cv_prog_CC="cl"
1620       break
1621     fi
1622   done
1623   IFS="$ac_save_ifs"
1624 fi
1625 CC="$ac_cv_prog_CC"
1626 if test -n "$CC"; then
1627   echo "$ac_t""$CC" 1>&6
1628 else
1629   echo "$ac_t""no" 1>&6
1630 fi
1631  ;;
1632     esac
1633   fi
1634   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1635 fi
1636
1637 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1638 echo "configure:1639: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1639
1640 ac_ext=c
1641 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1642 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1643 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1644 ac_cpp='$CPP '"$xe_cppflags"
1645 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1646 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1647 cross_compiling=no
1648
1649 cat > conftest.$ac_ext << EOF
1650
1651 #line 1652 "configure"
1652 #include "confdefs.h"
1653
1654 main(){return(0);}
1655 EOF
1656 if { (eval echo configure:1657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1657   ac_cv_prog_cc_works=yes
1658   # If we can't run a trivial program, we are probably using a cross compiler.
1659   if (./conftest; exit) 2>/dev/null; then
1660     ac_cv_prog_cc_cross=no
1661   else
1662     ac_cv_prog_cc_cross=yes
1663   fi
1664 else
1665   echo "configure: failed program was:" >&5
1666   cat conftest.$ac_ext >&5
1667   ac_cv_prog_cc_works=no
1668 fi
1669 rm -fr conftest*
1670 ac_ext=c
1671 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1672 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1673 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1674 ac_cpp='$CPP '"$xe_cppflags"
1675 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1676 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1677 cross_compiling=no
1678
1679 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1680 if test $ac_cv_prog_cc_works = no; then
1681   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1682 fi
1683 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1684 echo "configure:1685: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1685 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1686 cross_compiling=$ac_cv_prog_cc_cross
1687
1688 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1689 echo "configure:1690: checking whether we are using GNU C" >&5
1690
1691 cat > conftest.c <<EOF
1692 #ifdef __GNUC__
1693   yes;
1694 #endif
1695 EOF
1696 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1697   ac_cv_prog_gcc=yes
1698 else
1699   ac_cv_prog_gcc=no
1700 fi
1701
1702 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1703
1704 if test $ac_cv_prog_gcc = yes; then
1705   GCC=yes
1706 else
1707   GCC=
1708 fi
1709
1710 ac_test_CFLAGS="${CFLAGS+set}"
1711 ac_save_CFLAGS="$CFLAGS"
1712 CFLAGS=
1713 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1714 echo "configure:1715: checking whether ${CC-cc} accepts -g" >&5
1715
1716 echo 'void f(){}' > conftest.c
1717 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1718   ac_cv_prog_cc_g=yes
1719 else
1720   ac_cv_prog_cc_g=no
1721 fi
1722 rm -f conftest*
1723
1724
1725 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1726 if test "$ac_test_CFLAGS" = set; then
1727   CFLAGS="$ac_save_CFLAGS"
1728 elif test $ac_cv_prog_cc_g = yes; then
1729   if test "$GCC" = yes; then
1730     CFLAGS="-g -O2"
1731   else
1732     CFLAGS="-g"
1733   fi
1734 else
1735   if test "$GCC" = yes; then
1736     CFLAGS="-O2"
1737   else
1738     CFLAGS=
1739   fi
1740 fi
1741  
1742 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1743   CC=${NON_GNU_CC-cc}
1744   # Extract the first word of "gcc", so it can be a program name with args.
1745 set dummy gcc; ac_word=$2
1746 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1747 echo "configure:1748: checking for $ac_word" >&5
1748
1749 if test -n "$CC"; then
1750   ac_cv_prog_CC="$CC" # Let the user override the test.
1751 else
1752   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1753   ac_dummy="$PATH"
1754   for ac_dir in $ac_dummy; do
1755     test -z "$ac_dir" && ac_dir=.
1756     if test -f $ac_dir/$ac_word; then
1757       ac_cv_prog_CC="gcc"
1758       break
1759     fi
1760   done
1761   IFS="$ac_save_ifs"
1762 fi
1763 CC="$ac_cv_prog_CC"
1764 if test -n "$CC"; then
1765   echo "$ac_t""$CC" 1>&6
1766 else
1767   echo "$ac_t""no" 1>&6
1768 fi
1769
1770 if test -z "$CC"; then
1771   # Extract the first word of "cc", so it can be a program name with args.
1772 set dummy cc; ac_word=$2
1773 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1774 echo "configure:1775: checking for $ac_word" >&5
1775
1776 if test -n "$CC"; then
1777   ac_cv_prog_CC="$CC" # Let the user override the test.
1778 else
1779   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1780   ac_prog_rejected=no
1781   ac_dummy="$PATH"
1782   for ac_dir in $ac_dummy; do
1783     test -z "$ac_dir" && ac_dir=.
1784     if test -f $ac_dir/$ac_word; then
1785       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1786         ac_prog_rejected=yes
1787         continue
1788       fi
1789       ac_cv_prog_CC="cc"
1790       break
1791     fi
1792   done
1793   IFS="$ac_save_ifs"
1794 if test $ac_prog_rejected = yes; then
1795   # We found a bogon in the path, so make sure we never use it.
1796   set dummy $ac_cv_prog_CC
1797   shift
1798   if test $# -gt 0; then
1799     # We chose a different compiler from the bogus one.
1800     # However, it has the same basename, so the bogon will be chosen
1801     # first if we set CC to just the basename; use the full file name.
1802     shift
1803     set dummy "$ac_dir/$ac_word" "$@"
1804     shift
1805     ac_cv_prog_CC="$@"
1806   fi
1807 fi
1808 fi
1809 CC="$ac_cv_prog_CC"
1810 if test -n "$CC"; then
1811   echo "$ac_t""$CC" 1>&6
1812 else
1813   echo "$ac_t""no" 1>&6
1814 fi
1815
1816   if test -z "$CC"; then
1817     case "`uname -s`" in
1818     *win32* | *WIN32*)
1819       # Extract the first word of "cl", so it can be a program name with args.
1820 set dummy cl; ac_word=$2
1821 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1822 echo "configure:1823: checking for $ac_word" >&5
1823
1824 if test -n "$CC"; then
1825   ac_cv_prog_CC="$CC" # Let the user override the test.
1826 else
1827   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1828   ac_dummy="$PATH"
1829   for ac_dir in $ac_dummy; do
1830     test -z "$ac_dir" && ac_dir=.
1831     if test -f $ac_dir/$ac_word; then
1832       ac_cv_prog_CC="cl"
1833       break
1834     fi
1835   done
1836   IFS="$ac_save_ifs"
1837 fi
1838 CC="$ac_cv_prog_CC"
1839 if test -n "$CC"; then
1840   echo "$ac_t""$CC" 1>&6
1841 else
1842   echo "$ac_t""no" 1>&6
1843 fi
1844  ;;
1845     esac
1846   fi
1847   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1848 fi
1849
1850 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1851 echo "configure:1852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1852
1853 ac_ext=c
1854 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1855 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1856 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1857 ac_cpp='$CPP '"$xe_cppflags"
1858 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1859 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1860 cross_compiling=no
1861
1862 cat > conftest.$ac_ext << EOF
1863
1864 #line 1865 "configure"
1865 #include "confdefs.h"
1866
1867 main(){return(0);}
1868 EOF
1869 if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1870   ac_cv_prog_cc_works=yes
1871   # If we can't run a trivial program, we are probably using a cross compiler.
1872   if (./conftest; exit) 2>/dev/null; then
1873     ac_cv_prog_cc_cross=no
1874   else
1875     ac_cv_prog_cc_cross=yes
1876   fi
1877 else
1878   echo "configure: failed program was:" >&5
1879   cat conftest.$ac_ext >&5
1880   ac_cv_prog_cc_works=no
1881 fi
1882 rm -fr conftest*
1883 ac_ext=c
1884 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1885 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1886 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1887 ac_cpp='$CPP '"$xe_cppflags"
1888 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1889 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1890 cross_compiling=no
1891
1892 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1893 if test $ac_cv_prog_cc_works = no; then
1894   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1895 fi
1896 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1897 echo "configure:1898: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1898 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1899 cross_compiling=$ac_cv_prog_cc_cross
1900
1901 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1902 echo "configure:1903: checking whether we are using GNU C" >&5
1903
1904 cat > conftest.c <<EOF
1905 #ifdef __GNUC__
1906   yes;
1907 #endif
1908 EOF
1909 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1910   ac_cv_prog_gcc=yes
1911 else
1912   ac_cv_prog_gcc=no
1913 fi
1914
1915 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1916
1917 if test $ac_cv_prog_gcc = yes; then
1918   GCC=yes
1919 else
1920   GCC=
1921 fi
1922
1923 ac_test_CFLAGS="${CFLAGS+set}"
1924 ac_save_CFLAGS="$CFLAGS"
1925 CFLAGS=
1926 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1927 echo "configure:1928: checking whether ${CC-cc} accepts -g" >&5
1928
1929 echo 'void f(){}' > conftest.c
1930 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1931   ac_cv_prog_cc_g=yes
1932 else
1933   ac_cv_prog_cc_g=no
1934 fi
1935 rm -f conftest*
1936
1937
1938 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1939 if test "$ac_test_CFLAGS" = set; then
1940   CFLAGS="$ac_save_CFLAGS"
1941 elif test $ac_cv_prog_cc_g = yes; then
1942   if test "$GCC" = yes; then
1943     CFLAGS="-g -O2"
1944   else
1945     CFLAGS="-g"
1946   fi
1947 else
1948   if test "$GCC" = yes; then
1949     CFLAGS="-O2"
1950   else
1951     CFLAGS=
1952   fi
1953 fi
1954
1955 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1956   CC=gcc
1957   # Extract the first word of "gcc", so it can be a program name with args.
1958 set dummy gcc; ac_word=$2
1959 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1960 echo "configure:1961: checking for $ac_word" >&5
1961
1962 if test -n "$CC"; then
1963   ac_cv_prog_CC="$CC" # Let the user override the test.
1964 else
1965   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1966   ac_dummy="$PATH"
1967   for ac_dir in $ac_dummy; do
1968     test -z "$ac_dir" && ac_dir=.
1969     if test -f $ac_dir/$ac_word; then
1970       ac_cv_prog_CC="gcc"
1971       break
1972     fi
1973   done
1974   IFS="$ac_save_ifs"
1975 fi
1976 CC="$ac_cv_prog_CC"
1977 if test -n "$CC"; then
1978   echo "$ac_t""$CC" 1>&6
1979 else
1980   echo "$ac_t""no" 1>&6
1981 fi
1982
1983 if test -z "$CC"; then
1984   # Extract the first word of "cc", so it can be a program name with args.
1985 set dummy cc; ac_word=$2
1986 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1987 echo "configure:1988: checking for $ac_word" >&5
1988
1989 if test -n "$CC"; then
1990   ac_cv_prog_CC="$CC" # Let the user override the test.
1991 else
1992   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1993   ac_prog_rejected=no
1994   ac_dummy="$PATH"
1995   for ac_dir in $ac_dummy; do
1996     test -z "$ac_dir" && ac_dir=.
1997     if test -f $ac_dir/$ac_word; then
1998       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1999         ac_prog_rejected=yes
2000         continue
2001       fi
2002       ac_cv_prog_CC="cc"
2003       break
2004     fi
2005   done
2006   IFS="$ac_save_ifs"
2007 if test $ac_prog_rejected = yes; then
2008   # We found a bogon in the path, so make sure we never use it.
2009   set dummy $ac_cv_prog_CC
2010   shift
2011   if test $# -gt 0; then
2012     # We chose a different compiler from the bogus one.
2013     # However, it has the same basename, so the bogon will be chosen
2014     # first if we set CC to just the basename; use the full file name.
2015     shift
2016     set dummy "$ac_dir/$ac_word" "$@"
2017     shift
2018     ac_cv_prog_CC="$@"
2019   fi
2020 fi
2021 fi
2022 CC="$ac_cv_prog_CC"
2023 if test -n "$CC"; then
2024   echo "$ac_t""$CC" 1>&6
2025 else
2026   echo "$ac_t""no" 1>&6
2027 fi
2028
2029   if test -z "$CC"; then
2030     case "`uname -s`" in
2031     *win32* | *WIN32*)
2032       # Extract the first word of "cl", so it can be a program name with args.
2033 set dummy cl; ac_word=$2
2034 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2035 echo "configure:2036: checking for $ac_word" >&5
2036
2037 if test -n "$CC"; then
2038   ac_cv_prog_CC="$CC" # Let the user override the test.
2039 else
2040   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2041   ac_dummy="$PATH"
2042   for ac_dir in $ac_dummy; do
2043     test -z "$ac_dir" && ac_dir=.
2044     if test -f $ac_dir/$ac_word; then
2045       ac_cv_prog_CC="cl"
2046       break
2047     fi
2048   done
2049   IFS="$ac_save_ifs"
2050 fi
2051 CC="$ac_cv_prog_CC"
2052 if test -n "$CC"; then
2053   echo "$ac_t""$CC" 1>&6
2054 else
2055   echo "$ac_t""no" 1>&6
2056 fi
2057  ;;
2058     esac
2059   fi
2060   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2061 fi
2062
2063 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2064 echo "configure:2065: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2065
2066 ac_ext=c
2067 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2068 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2069 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2070 ac_cpp='$CPP '"$xe_cppflags"
2071 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2072 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2073 cross_compiling=no
2074
2075 cat > conftest.$ac_ext << EOF
2076
2077 #line 2078 "configure"
2078 #include "confdefs.h"
2079
2080 main(){return(0);}
2081 EOF
2082 if { (eval echo configure:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2083   ac_cv_prog_cc_works=yes
2084   # If we can't run a trivial program, we are probably using a cross compiler.
2085   if (./conftest; exit) 2>/dev/null; then
2086     ac_cv_prog_cc_cross=no
2087   else
2088     ac_cv_prog_cc_cross=yes
2089   fi
2090 else
2091   echo "configure: failed program was:" >&5
2092   cat conftest.$ac_ext >&5
2093   ac_cv_prog_cc_works=no
2094 fi
2095 rm -fr conftest*
2096 ac_ext=c
2097 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2098 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2099 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2100 ac_cpp='$CPP '"$xe_cppflags"
2101 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2102 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2103 cross_compiling=no
2104
2105 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2106 if test $ac_cv_prog_cc_works = no; then
2107   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2108 fi
2109 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2110 echo "configure:2111: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2111 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2112 cross_compiling=$ac_cv_prog_cc_cross
2113
2114 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2115 echo "configure:2116: checking whether we are using GNU C" >&5
2116
2117 cat > conftest.c <<EOF
2118 #ifdef __GNUC__
2119   yes;
2120 #endif
2121 EOF
2122 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2123   ac_cv_prog_gcc=yes
2124 else
2125   ac_cv_prog_gcc=no
2126 fi
2127
2128 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2129
2130 if test $ac_cv_prog_gcc = yes; then
2131   GCC=yes
2132 else
2133   GCC=
2134 fi
2135
2136 ac_test_CFLAGS="${CFLAGS+set}"
2137 ac_save_CFLAGS="$CFLAGS"
2138 CFLAGS=
2139 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2140 echo "configure:2141: checking whether ${CC-cc} accepts -g" >&5
2141
2142 echo 'void f(){}' > conftest.c
2143 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2144   ac_cv_prog_cc_g=yes
2145 else
2146   ac_cv_prog_cc_g=no
2147 fi
2148 rm -f conftest*
2149
2150
2151 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2152 if test "$ac_test_CFLAGS" = set; then
2153   CFLAGS="$ac_save_CFLAGS"
2154 elif test $ac_cv_prog_cc_g = yes; then
2155   if test "$GCC" = yes; then
2156     CFLAGS="-g -O2"
2157   else
2158     CFLAGS="-g"
2159   fi
2160 else
2161   if test "$GCC" = yes; then
2162     CFLAGS="-O2"
2163   else
2164     CFLAGS=
2165   fi
2166 fi
2167
2168 fi
2169 CFLAGS="$xe_save_CFLAGS"
2170
2171
2172 test -n "$CPP" -a -d "$CPP" && CPP=
2173
2174 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2175
2176 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2177 echo "configure:2178: checking how to run the C preprocessor" >&5
2178 # On Suns, sometimes $CPP names a directory.
2179 if test -n "$CPP" && test -d "$CPP"; then
2180   CPP=
2181 fi
2182 if test -z "$CPP"; then
2183
2184   # This must be in double quotes, not single quotes, because CPP may get
2185   # substituted into the Makefile and "${CC-cc}" will confuse make.
2186   CPP="${CC-cc} -E"
2187   # On the NeXT, cc -E runs the code through the compiler's parser,
2188   # not just through cpp.
2189   cat > conftest.$ac_ext <<EOF
2190 #line 2191 "configure"
2191 #include "confdefs.h"
2192 #include <assert.h>
2193 Syntax Error
2194 EOF
2195 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2196 { (eval echo configure:2197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2197 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2198 if test -z "$ac_err"; then
2199   :
2200 else
2201   echo "$ac_err" >&5
2202   echo "configure: failed program was:" >&5
2203   cat conftest.$ac_ext >&5
2204   rm -rf conftest*
2205   CPP="${CC-cc} -E -traditional-cpp"
2206   cat > conftest.$ac_ext <<EOF
2207 #line 2208 "configure"
2208 #include "confdefs.h"
2209 #include <assert.h>
2210 Syntax Error
2211 EOF
2212 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2213 { (eval echo configure:2214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2214 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2215 if test -z "$ac_err"; then
2216   :
2217 else
2218   echo "$ac_err" >&5
2219   echo "configure: failed program was:" >&5
2220   cat conftest.$ac_ext >&5
2221   rm -rf conftest*
2222   CPP="${CC-cc} -nologo -E"
2223   cat > conftest.$ac_ext <<EOF
2224 #line 2225 "configure"
2225 #include "confdefs.h"
2226 #include <assert.h>
2227 Syntax Error
2228 EOF
2229 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2230 { (eval echo configure:2231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2231 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2232 if test -z "$ac_err"; then
2233   :
2234 else
2235   echo "$ac_err" >&5
2236   echo "configure: failed program was:" >&5
2237   cat conftest.$ac_ext >&5
2238   rm -rf conftest*
2239   CPP=/lib/cpp
2240 fi
2241 rm -f conftest*
2242 fi
2243 rm -f conftest*
2244 fi
2245 rm -f conftest*
2246   ac_cv_prog_CPP="$CPP"
2247   CPP="$ac_cv_prog_CPP"
2248 else
2249   ac_cv_prog_CPP="$CPP"
2250 fi
2251 echo "$ac_t""$CPP" 1>&6
2252
2253
2254 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2255 echo "configure:2256: checking for AIX" >&5
2256 cat > conftest.$ac_ext <<EOF
2257 #line 2258 "configure"
2258 #include "confdefs.h"
2259 #ifdef _AIX
2260   yes
2261 #endif
2262
2263 EOF
2264 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2265   egrep "yes" >/dev/null 2>&1; then
2266   rm -rf conftest*
2267   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2268     Defining _ALL_SOURCE
2269 EOF
2270 cat >> confdefs.h <<\EOF
2271 #define _ALL_SOURCE 1
2272 EOF
2273 }
2274
2275 else
2276   rm -rf conftest*
2277   echo "$ac_t""no" 1>&6
2278 fi
2279 rm -f conftest*
2280
2281
2282
2283 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2284 echo "configure:2285: checking for GNU libc" >&5
2285 cat > conftest.$ac_ext <<EOF
2286 #line 2287 "configure"
2287 #include "confdefs.h"
2288 #include <features.h>
2289 int main() {
2290
2291 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2292 #error Not a GNU libc system :-(
2293 ******* ======= ******** &&&&&&&&
2294 #endif
2295
2296 ; return 0; }
2297 EOF
2298 if { (eval echo configure:2299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2299   rm -rf conftest*
2300   have_glibc=yes
2301 else
2302   echo "configure: failed program was:" >&5
2303   cat conftest.$ac_ext >&5
2304   rm -rf conftest*
2305   have_glibc=no
2306 fi
2307 rm -f conftest*
2308 echo "$ac_t""$have_glibc" 1>&6
2309 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2310     Defining _GNU_SOURCE
2311 EOF
2312 cat >> confdefs.h <<\EOF
2313 #define _GNU_SOURCE 1
2314 EOF
2315 }
2316
2317
2318
2319 cat > conftest.$ac_ext <<EOF
2320 #line 2321 "configure"
2321 #include "confdefs.h"
2322 int main () {
2323 #if defined __SUNPRO_C
2324 return 11;
2325 #elif defined __DECC
2326 return 12;
2327 #else
2328 return 0;
2329 #endif
2330 }
2331 EOF
2332 if { (eval echo configure:2333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2333 then
2334   :
2335 else
2336   conftest_rc="$?"
2337   echo "configure: failed program was:" >&5
2338   cat conftest.$ac_ext >&5
2339   rm -fr conftest*
2340   case "$conftest_rc" in
2341   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2342   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2343 esac
2344 fi
2345 rm -fr conftest*
2346
2347
2348
2349
2350 echo "Extracting information from the machine- and system-dependent headers..."
2351
2352 tempcname="conftest.c"
2353
2354
2355
2356 cat > $tempcname <<EOF
2357 #define NOT_C_CODE
2358 #define C_SWITCH_SITE
2359 #define C_SWITCH_X_SITE
2360 #define LD_SWITCH_SITE
2361 #define LD_SWITCH_X_SITE
2362 #define LD_SWITCH_X_SITE_AUX
2363 #define OS_RELEASE $os_release
2364 #include "$srcdir/src/$opsysfile"
2365 #include "$srcdir/src/$machfile"
2366
2367 #ifndef LIBS_MACHINE
2368 #define LIBS_MACHINE
2369 #endif
2370 configure___ libs_machine=LIBS_MACHINE
2371
2372 #ifndef LIBS_SYSTEM
2373 #define LIBS_SYSTEM
2374 #endif
2375 configure___ libs_system=LIBS_SYSTEM
2376
2377 #ifndef LIBS_TERMCAP
2378 #define LIBS_TERMCAP
2379 #endif
2380 configure___ libs_termcap=LIBS_TERMCAP
2381
2382 #ifndef LIB_STANDARD
2383 #define LIB_STANDARD
2384 #endif
2385 configure___ libs_standard=LIB_STANDARD
2386
2387
2388 #ifndef OBJECTS_MACHINE
2389 #define OBJECTS_MACHINE
2390 #endif
2391 configure___ objects_machine=OBJECTS_MACHINE
2392
2393 #ifndef OBJECTS_SYSTEM
2394 #define OBJECTS_SYSTEM
2395 #endif
2396 configure___ objects_system=OBJECTS_SYSTEM
2397
2398
2399 #ifndef C_SWITCH_MACHINE
2400 #define C_SWITCH_MACHINE
2401 #endif
2402 configure___ c_switch_machine=C_SWITCH_MACHINE
2403
2404 #ifndef C_SWITCH_SYSTEM
2405 #define C_SWITCH_SYSTEM
2406 #endif
2407 configure___ c_switch_system=C_SWITCH_SYSTEM
2408
2409
2410 #ifndef LD_SWITCH_MACHINE
2411 #define LD_SWITCH_MACHINE
2412 #endif
2413 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2414
2415 #ifndef LD_SWITCH_SYSTEM
2416 #define LD_SWITCH_SYSTEM
2417 #endif
2418 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2419
2420
2421 #ifndef UNEXEC
2422 #define UNEXEC "unexec.o"
2423 #endif
2424 configure___ unexec=UNEXEC
2425
2426
2427 #ifndef LD_SWITCH_SHARED
2428 #define LD_SWITCH_SHARED "-c"
2429 #endif
2430 configure___ ld_switch_shared=LD_SWITCH_SHARED
2431
2432
2433 #ifdef ORDINARY_LINK
2434 #define LD "\$(CC) \$(CFLAGS)"
2435 #else /* no ORDINARY LINK */
2436 #ifdef COFF_ENCAPSULATE
2437 #define LD "\$(CC) -nostdlib"
2438 #else /* not COFF_ENCAPSULATE */
2439 #ifdef LINKER
2440 #define LD LINKER
2441 #else /* ! defined (LINKER) */
2442 #define LD "ld"
2443 #endif /* ! defined (LINKER) */
2444 #endif /* ! defined (COFF_ENCAPSULATE) */
2445 #endif /* not ORDINARY_LINK */
2446 configure___ ld=LD
2447
2448 #ifndef LIB_GCC
2449 #define LIB_GCC
2450 #endif
2451 configure___ lib_gcc=LIB_GCC
2452
2453 #ifndef LD_TEXT_START_ADDR
2454 #define LD_TEXT_START_ADDR
2455 #endif
2456 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2457
2458
2459 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2460 #ifdef NO_REMAP
2461 #ifdef COFF_ENCAPSULATE
2462 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2463 #else /* ! defined (COFF_ENCAPSULATE) */
2464 #define START_FILES "pre-crt0.o /lib/crt0.o"
2465 #endif /* ! defined (COFF_ENCAPSULATE) */
2466 #else /* ! defined (NO_REMAP) */
2467 #define START_FILES "ecrt0.o"
2468 #endif /* ! defined (NO_REMAP) */
2469 #endif /* no ORDINARY_LINK */
2470 #ifndef START_FILES
2471 #define START_FILES
2472 #endif
2473 configure___ start_files=START_FILES
2474
2475 #ifdef ORDINARY_LINK
2476 configure___ ordinary_link=yes
2477 #else
2478 configure___ ordinary_link=no
2479 #endif
2480
2481 #ifdef SYSTEM_MALLOC
2482 configure___ system_malloc=yes
2483 #else
2484 configure___ system_malloc=no
2485 #endif
2486
2487 #ifdef TERMINFO
2488 configure___ have_terminfo=yes
2489 #else
2490 configure___ have_terminfo=no
2491 #endif
2492
2493 #ifdef MAIL_USE_FLOCK
2494 configure___ mail_use_flock=yes
2495 #else
2496 configure___ mail_use_flock=no
2497 #endif
2498
2499 #ifdef MAIL_USE_LOCKF
2500 configure___ mail_use_lockf=yes
2501 #else
2502 configure___ mail_use_lockf=no
2503 #endif
2504
2505 #ifdef HAVE_WIN32_PROCESSES
2506 configure___ win32_processes=yes
2507 #else
2508 configure___ win32_processes=no
2509 #endif
2510
2511 EOF
2512
2513 CPP=`eval "echo $CPP $CPPFLAGS"`
2514 eval `$CPP -Isrc $tempcname \
2515         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2516
2517 rm $tempcname
2518
2519 test "$extra_verbose" = "yes" && \
2520   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 ""
2521
2522 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2523
2524 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2525
2526 if test "$cflags_specified" = "no"; then
2527       if   test "$GCC" = "yes"; then
2528     CFLAGS="-g -O3 -Wall -Wno-switch"
2529               elif test "$__SUNPRO_C" = "yes"; then
2530     case "$opsys" in
2531       sol2    ) CFLAGS="-v -xO4" ;;
2532       sunos4* ) CFLAGS="-xO2";;
2533     esac
2534   elif test "$__DECC" = "yes"; then
2535     CFLAGS="-O3"
2536   elif test "$CC" = "xlc"; then
2537     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2538     else
2539     CFLAGS="-O" ;  fi
2540 fi
2541
2542
2543 if test "$GCC" = "yes"; then
2544   set x $ld_switch_system; shift; ld_switch_system=""
2545   while test -n "$1"; do
2546     case $1 in
2547       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2548       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2549       -Xlinker* ) ;;
2550       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2551     esac
2552     shift
2553   done
2554 fi
2555
2556 if test "$GCC" = "yes"; then
2557   set x $ld_switch_machine; shift; ld_switch_machine=""
2558   while test -n "$1"; do
2559     case $1 in
2560       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2561       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2562       -Xlinker* ) ;;
2563       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2564     esac
2565     shift
2566   done
2567 fi
2568
2569 if test "$GCC" = "yes"; then
2570   set x $LDFLAGS; shift; LDFLAGS=""
2571   while test -n "$1"; do
2572     case $1 in
2573       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2574       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2575       -Xlinker* ) ;;
2576       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2577     esac
2578     shift
2579   done
2580 fi
2581
2582 if test "$GCC" = "yes"; then
2583   set x $ld_call_shared; shift; ld_call_shared=""
2584   while test -n "$1"; do
2585     case $1 in
2586       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2587       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2588       -Xlinker* ) ;;
2589       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2590     esac
2591     shift
2592   done
2593 fi
2594
2595 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2596    echo "    xemacs will be linked with \"$objects_machine\""
2597  fi
2598 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2599    echo "    xemacs will be linked with \"$objects_system\""
2600  fi
2601 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2602    echo "    xemacs will be linked with \"$unexec\""
2603  fi
2604
2605 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2606 echo "configure:2607: checking for dynodump" >&5
2607 if test "$unexec" != "unexsol2.o"; then
2608   echo "$ac_t""no" 1>&6
2609 else
2610   echo "$ac_t""yes" 1>&6
2611   { test "$extra_verbose" = "yes" && cat << \EOF
2612     Defining DYNODUMP
2613 EOF
2614 cat >> confdefs.h <<\EOF
2615 #define DYNODUMP 1
2616 EOF
2617 }
2618
2619   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2620   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2621   case "$machine" in
2622     sparc   ) dynodump_arch=sparc ;;
2623     *86*    ) dynodump_arch=i386  ;;
2624     powerpc ) dynodump_arch=ppc   ;;
2625   esac
2626     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
2627 fi
2628
2629
2630 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2631
2632 if test "$unexec" = "unexaix.o"; then
2633   if   test "$dynamic" = "no"; then
2634   start_flags="-Wl,-bnso,-bnodelcsect"
2635   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2636   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2637     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2638   done
2639   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2640     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2641   done
2642   
2643 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2644 echo "configure:2645: checking for terminateAndUnload in -lC" >&5
2645 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2646
2647 xe_check_libs=" -lC "
2648 cat > conftest.$ac_ext <<EOF
2649 #line 2650 "configure"
2650 #include "confdefs.h"
2651 /* Override any gcc2 internal prototype to avoid an error.  */
2652 /* We use char because int might match the return type of a gcc2
2653     builtin and then its argument prototype would still apply.  */
2654 char terminateAndUnload();
2655
2656 int main() {
2657 terminateAndUnload()
2658 ; return 0; }
2659 EOF
2660 if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2661   rm -rf conftest*
2662   eval "ac_cv_lib_$ac_lib_var=yes"
2663 else
2664   echo "configure: failed program was:" >&5
2665   cat conftest.$ac_ext >&5
2666   rm -rf conftest*
2667   eval "ac_cv_lib_$ac_lib_var=no"
2668 fi
2669 rm -f conftest*
2670 xe_check_libs=""
2671
2672 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2673   echo "$ac_t""yes" 1>&6
2674   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2675 else
2676   echo "$ac_t""no" 1>&6
2677 fi
2678
2679
2680   fi
2681 elif test -n "$ld_text_start_addr"; then
2682   start_flags="-T $ld_text_start_addr -e __start"
2683 fi
2684
2685
2686
2687
2688 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2689  test -z "$linker" &&  linker='$(CC) -nostdlib'
2690  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2691 fi
2692 test "$GCC" != "yes" && lib_gcc=
2693
2694
2695
2696
2697
2698 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2699 if test -n "$site_libraries"; then
2700   for arg in $site_libraries; do
2701     case "$arg" in
2702      -* ) ;;
2703      * ) test -d "$arg" || \
2704            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2705        arg="-L${arg}" ;;
2706     esac
2707     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2708   done
2709 fi
2710
2711 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2712 if test -n "$site_includes"; then
2713   for arg in $site_includes; do
2714     case "$arg" in
2715       -* ) ;;
2716       * ) test -d "$arg" || \
2717            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2718       arg="-I${arg}" ;;
2719     esac
2720     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2721   done
2722 fi
2723
2724 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2725 if test -n "$site_prefixes"; then
2726   for dir in $site_prefixes; do
2727     lib_dir="${dir}/lib"
2728     inc_dir="${dir}/include"
2729     if test ! -d "$dir"; then
2730       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2731     elif test ! -d "$lib_dir"; then
2732       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2733     else
2734       if test -d "$inc_dir"; then
2735         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
2736       fi
2737       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
2738     fi
2739   done
2740 fi
2741
2742
2743 for dir in "/usr/ccs/lib"; do
2744   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
2745 done
2746
2747 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2748 if test -n "$site_runtime_libraries"; then
2749   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2750   export LD_RUN_PATH
2751 fi
2752
2753
2754 if   test "$dynamic" = "no"; then add_runtime_path=no
2755 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2756 else case "$opsys" in
2757        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2758        * ) add_runtime_path=no ;;
2759      esac
2760 fi
2761
2762 if test "$add_runtime_path" = "yes"; then
2763       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2764 echo "configure:2765: checking "for runtime libraries flag"" >&5
2765   case "$opsys" in
2766     sol2 ) dash_r="-R" ;;
2767     decosf* | linux* | irix*) dash_r="-rpath " ;;
2768     *)
2769       dash_r=""
2770       for try_dash_r in "-R" "-R " "-rpath "; do
2771         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2772         
2773 if test "$GCC" = "yes"; then
2774   set x $xe_check_libs; shift; xe_check_libs=""
2775   while test -n "$1"; do
2776     case $1 in
2777       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2778       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2779       -Xlinker* ) ;;
2780       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2781     esac
2782     shift
2783   done
2784 fi
2785         cat > conftest.$ac_ext <<EOF
2786 #line 2787 "configure"
2787 #include "confdefs.h"
2788
2789 int main() {
2790
2791 ; return 0; }
2792 EOF
2793 if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2794   rm -rf conftest*
2795   dash_r="$try_dash_r"
2796 else
2797   echo "configure: failed program was:" >&5
2798   cat conftest.$ac_ext >&5
2799 fi
2800 rm -f conftest*
2801         xe_check_libs=""
2802         test -n "$dash_r" && break
2803       done ;;
2804   esac
2805   if test -n "$dash_r";
2806     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2807     else echo "$ac_t""NONE" 1>&6
2808   fi
2809 fi
2810
2811 xe_add_unique_runpath_dir='
2812   xe_add_p=yes
2813   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2814   done
2815   if test "$xe_add_p" = "yes"; then
2816     test -n "$runpath" && runpath="${runpath}:"
2817     runpath="${runpath}${xe_runpath_dir}"
2818     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2819   fi'
2820
2821
2822
2823
2824 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2825     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2826   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2827   
2828         runpath="" runpath_dirs=""
2829   if test -n "$LD_RUN_PATH"; then
2830     runpath="$LD_RUN_PATH"
2831   elif test "$GCC" = "yes"; then
2832         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2833     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2834     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2835     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2836       case "$arg" in P,* | -L* | -R* )
2837         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2838           {
2839 xe_runpath_dir="$dir"
2840   test "$xe_runpath_dir" != "/lib"     -a \
2841         "$xe_runpath_dir" != "/usr/lib" -a \
2842         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2843   eval "$xe_add_unique_runpath_dir"
2844 }
2845         done ;;
2846       esac
2847     done
2848     ld_switch_run="$ld_switch_run_save"
2849     rm -f conftest*
2850   else
2851         for arg in $ld_switch_site $ld_switch_x_site; do
2852       case "$arg" in -L*) {
2853 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2854   test "$xe_runpath_dir" != "/lib"     -a \
2855         "$xe_runpath_dir" != "/usr/lib" -a \
2856         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2857   eval "$xe_add_unique_runpath_dir"
2858 };; esac
2859     done
2860         if test "$opsys $need_motif" = "sol2 yes"; then
2861       xe_runpath_dir="/opt/SUNWdt/lib";
2862       eval "$xe_add_unique_runpath_dir";
2863     fi
2864   fi 
2865   if test -n "$runpath"; then
2866     ld_switch_run="${dash_r}${runpath}"
2867     
2868 if test "$GCC" = "yes"; then
2869   set x $ld_switch_run; shift; ld_switch_run=""
2870   while test -n "$1"; do
2871     case $1 in
2872       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2873       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2874       -Xlinker* ) ;;
2875       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2876     esac
2877     shift
2878   done
2879 fi
2880     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2881   fi
2882 fi
2883
2884
2885
2886
2887 GNU_MALLOC=yes
2888 if test "$with_dlmalloc" != "no"; then
2889         doug_lea_malloc=yes
2890 else
2891         doug_lea_malloc=no
2892 fi
2893 after_morecore_hook_exists=yes
2894 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2895 echo "configure:2896: checking for malloc_get_state" >&5
2896
2897 cat > conftest.$ac_ext <<EOF
2898 #line 2899 "configure"
2899 #include "confdefs.h"
2900 /* System header to define __stub macros and hopefully few prototypes,
2901     which can conflict with char malloc_get_state(); below.  */
2902 #include <assert.h>
2903 /* Override any gcc2 internal prototype to avoid an error.  */
2904 /* We use char because int might match the return type of a gcc2
2905     builtin and then its argument prototype would still apply.  */
2906 char malloc_get_state();
2907
2908 int main() {
2909
2910 /* The GNU C library defines this for functions which it implements
2911     to always fail with ENOSYS.  Some functions are actually named
2912     something starting with __ and the normal name is an alias.  */
2913 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2914 choke me
2915 #else
2916 malloc_get_state();
2917 #endif
2918
2919 ; return 0; }
2920 EOF
2921 if { (eval echo configure:2922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2922   rm -rf conftest*
2923   eval "ac_cv_func_malloc_get_state=yes"
2924 else
2925   echo "configure: failed program was:" >&5
2926   cat conftest.$ac_ext >&5
2927   rm -rf conftest*
2928   eval "ac_cv_func_malloc_get_state=no"
2929 fi
2930 rm -f conftest*
2931
2932 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2933   echo "$ac_t""yes" 1>&6
2934   :
2935 else
2936   echo "$ac_t""no" 1>&6
2937 doug_lea_malloc=no
2938 fi
2939
2940 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2941 echo "configure:2942: checking for malloc_set_state" >&5
2942
2943 cat > conftest.$ac_ext <<EOF
2944 #line 2945 "configure"
2945 #include "confdefs.h"
2946 /* System header to define __stub macros and hopefully few prototypes,
2947     which can conflict with char malloc_set_state(); below.  */
2948 #include <assert.h>
2949 /* Override any gcc2 internal prototype to avoid an error.  */
2950 /* We use char because int might match the return type of a gcc2
2951     builtin and then its argument prototype would still apply.  */
2952 char malloc_set_state();
2953
2954 int main() {
2955
2956 /* The GNU C library defines this for functions which it implements
2957     to always fail with ENOSYS.  Some functions are actually named
2958     something starting with __ and the normal name is an alias.  */
2959 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2960 choke me
2961 #else
2962 malloc_set_state();
2963 #endif
2964
2965 ; return 0; }
2966 EOF
2967 if { (eval echo configure:2968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2968   rm -rf conftest*
2969   eval "ac_cv_func_malloc_set_state=yes"
2970 else
2971   echo "configure: failed program was:" >&5
2972   cat conftest.$ac_ext >&5
2973   rm -rf conftest*
2974   eval "ac_cv_func_malloc_set_state=no"
2975 fi
2976 rm -f conftest*
2977
2978 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2979   echo "$ac_t""yes" 1>&6
2980   :
2981 else
2982   echo "$ac_t""no" 1>&6
2983 doug_lea_malloc=no
2984 fi
2985
2986 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2987 echo "configure:2988: checking whether __after_morecore_hook exists" >&5
2988 cat > conftest.$ac_ext <<EOF
2989 #line 2990 "configure"
2990 #include "confdefs.h"
2991 extern void (* __after_morecore_hook)();
2992 int main() {
2993 __after_morecore_hook = 0
2994 ; return 0; }
2995 EOF
2996 if { (eval echo configure:2997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2997   rm -rf conftest*
2998   echo "$ac_t""yes" 1>&6
2999 else
3000   echo "configure: failed program was:" >&5
3001   cat conftest.$ac_ext >&5
3002   rm -rf conftest*
3003   echo "$ac_t""no" 1>&6
3004    after_morecore_hook_exists=no
3005 fi
3006 rm -f conftest*
3007 if test "$system_malloc" = "yes" ; then
3008   GNU_MALLOC=no
3009   GNU_MALLOC_reason="
3010   (The GNU allocators don't work with this system configuration)."
3011 elif test "$with_system_malloc" = "yes" ; then
3012   GNU_MALLOC=no
3013   GNU_MALLOC_reason="
3014   (User chose not to use GNU allocators)."
3015 elif test "$with_debug_malloc" = "yes" ; then
3016   GNU_MALLOC=no
3017   GNU_MALLOC_reason="
3018   (User chose to use Debugging Malloc)."
3019 fi
3020
3021 if test "$doug_lea_malloc" = "yes" ; then
3022   if test "$GNU_MALLOC" = yes ; then
3023     GNU_MALLOC_reason="
3024   (Using Doug Lea's new malloc from the GNU C Library.)"
3025   fi
3026   { test "$extra_verbose" = "yes" && cat << \EOF
3027     Defining DOUG_LEA_MALLOC
3028 EOF
3029 cat >> confdefs.h <<\EOF
3030 #define DOUG_LEA_MALLOC 1
3031 EOF
3032 }
3033
3034   if test "$after_morecore_hook_exists" = "no" ; then
3035     GNU_MALLOC_reason="
3036   (Using Doug Lea's new malloc from the Linux C Library.)"
3037     { test "$extra_verbose" = "yes" && cat << \EOF
3038     Defining _NO_MALLOC_WARNING_
3039 EOF
3040 cat >> confdefs.h <<\EOF
3041 #define _NO_MALLOC_WARNING_ 1
3042 EOF
3043 }
3044
3045   fi
3046   use_minimal_tagbits=yes
3047 fi
3048
3049
3050
3051
3052 # Extract the first word of "ranlib", so it can be a program name with args.
3053 set dummy ranlib; ac_word=$2
3054 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3055 echo "configure:3056: checking for $ac_word" >&5
3056
3057 if test -n "$RANLIB"; then
3058   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3059 else
3060   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3061   ac_dummy="$PATH"
3062   for ac_dir in $ac_dummy; do
3063     test -z "$ac_dir" && ac_dir=.
3064     if test -f $ac_dir/$ac_word; then
3065       ac_cv_prog_RANLIB="ranlib"
3066       break
3067     fi
3068   done
3069   IFS="$ac_save_ifs"
3070   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3071 fi
3072 RANLIB="$ac_cv_prog_RANLIB"
3073 if test -n "$RANLIB"; then
3074   echo "$ac_t""$RANLIB" 1>&6
3075 else
3076   echo "$ac_t""no" 1>&6
3077 fi
3078
3079 ac_aux_dir=
3080 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3081   if test -f $ac_dir/install-sh; then
3082     ac_aux_dir=$ac_dir
3083     ac_install_sh="$ac_aux_dir/install-sh -c"
3084     break
3085   elif test -f $ac_dir/install.sh; then
3086     ac_aux_dir=$ac_dir
3087     ac_install_sh="$ac_aux_dir/install.sh -c"
3088     break
3089   fi
3090 done
3091 if test -z "$ac_aux_dir"; then
3092   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3093 fi
3094 ac_config_guess=$ac_aux_dir/config.guess
3095 ac_config_sub=$ac_aux_dir/config.sub
3096 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3097
3098 # Find a good install program.  We prefer a C program (faster),
3099 # so one script is as good as another.  But avoid the broken or
3100 # incompatible versions:
3101 # SysV /etc/install, /usr/sbin/install
3102 # SunOS /usr/etc/install
3103 # IRIX /sbin/install
3104 # AIX /bin/install
3105 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3106 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3107 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3108 # ./install, which can be erroneously created by make from ./install.sh.
3109 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3110 echo "configure:3111: checking for a BSD compatible install" >&5
3111 if test -z "$INSTALL"; then
3112
3113   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3114   for ac_dir in $PATH; do
3115     # Account for people who put trailing slashes in PATH elements.
3116     case "$ac_dir/" in
3117     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3118     *)
3119       # OSF1 and SCO ODT 3.0 have their own names for install.
3120       # Don't use installbsd from OSF since it installs stuff as root
3121       # by default.
3122       for ac_prog in ginstall scoinst install; do
3123         if test -f $ac_dir/$ac_prog; then
3124           if test $ac_prog = install &&
3125             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3126             # AIX install.  It has an incompatible calling convention.
3127             :
3128           else
3129             ac_cv_path_install="$ac_dir/$ac_prog -c"
3130             break 2
3131           fi
3132         fi
3133       done
3134       ;;
3135     esac
3136   done
3137   IFS="$ac_save_IFS"
3138
3139   if test "${ac_cv_path_install+set}" = set; then
3140     INSTALL="$ac_cv_path_install"
3141   else
3142     # As a last resort, use the slow shell script.  We don't cache a
3143     # path for INSTALL within a source directory, because that will
3144     # break other packages using the cache if that directory is
3145     # removed, or if the path is relative.
3146     INSTALL="$ac_install_sh"
3147   fi
3148 fi
3149 echo "$ac_t""$INSTALL" 1>&6
3150
3151 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3152 # It thinks the first close brace ends the variable substitution.
3153 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3154
3155 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3156
3157 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3158
3159 for ac_prog in 'bison -y' byacc
3160 do
3161 # Extract the first word of "$ac_prog", so it can be a program name with args.
3162 set dummy $ac_prog; ac_word=$2
3163 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3164 echo "configure:3165: checking for $ac_word" >&5
3165
3166 if test -n "$YACC"; then
3167   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3168 else
3169   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3170   ac_dummy="$PATH"
3171   for ac_dir in $ac_dummy; do
3172     test -z "$ac_dir" && ac_dir=.
3173     if test -f $ac_dir/$ac_word; then
3174       ac_cv_prog_YACC="$ac_prog"
3175       break
3176     fi
3177   done
3178   IFS="$ac_save_ifs"
3179 fi
3180 YACC="$ac_cv_prog_YACC"
3181 if test -n "$YACC"; then
3182   echo "$ac_t""$YACC" 1>&6
3183 else
3184   echo "$ac_t""no" 1>&6
3185 fi
3186
3187 test -n "$YACC" && break
3188 done
3189 test -n "$YACC" || YACC="yacc"
3190
3191
3192 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
3193 do
3194 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3195 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3196 echo "configure:3197: checking for $ac_hdr" >&5
3197
3198 cat > conftest.$ac_ext <<EOF
3199 #line 3200 "configure"
3200 #include "confdefs.h"
3201 #include <$ac_hdr>
3202 EOF
3203 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3204 { (eval echo configure:3205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3205 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3206 if test -z "$ac_err"; then
3207   rm -rf conftest*
3208   eval "ac_cv_header_$ac_safe=yes"
3209 else
3210   echo "$ac_err" >&5
3211   echo "configure: failed program was:" >&5
3212   cat conftest.$ac_ext >&5
3213   rm -rf conftest*
3214   eval "ac_cv_header_$ac_safe=no"
3215 fi
3216 rm -f conftest*
3217 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3218   echo "$ac_t""yes" 1>&6
3219     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3220   { test "$extra_verbose" = "yes" && cat << EOF
3221     Defining $ac_tr_hdr
3222 EOF
3223 cat >> confdefs.h <<EOF
3224 #define $ac_tr_hdr 1
3225 EOF
3226 }
3227  
3228 else
3229   echo "$ac_t""no" 1>&6
3230 fi
3231 done
3232
3233 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3234 do
3235 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3236 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3237 echo "configure:3238: checking for $ac_hdr" >&5
3238
3239 cat > conftest.$ac_ext <<EOF
3240 #line 3241 "configure"
3241 #include "confdefs.h"
3242 #include <$ac_hdr>
3243 EOF
3244 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3245 { (eval echo configure:3246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3246 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3247 if test -z "$ac_err"; then
3248   rm -rf conftest*
3249   eval "ac_cv_header_$ac_safe=yes"
3250 else
3251   echo "$ac_err" >&5
3252   echo "configure: failed program was:" >&5
3253   cat conftest.$ac_ext >&5
3254   rm -rf conftest*
3255   eval "ac_cv_header_$ac_safe=no"
3256 fi
3257 rm -f conftest*
3258 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3259   echo "$ac_t""yes" 1>&6
3260     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3261   { test "$extra_verbose" = "yes" && cat << EOF
3262     Defining $ac_tr_hdr
3263 EOF
3264 cat >> confdefs.h <<EOF
3265 #define $ac_tr_hdr 1
3266 EOF
3267 }
3268  
3269 else
3270   echo "$ac_t""no" 1>&6
3271 fi
3272 done
3273
3274 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3275 do
3276 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3277 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3278 echo "configure:3279: checking for $ac_hdr" >&5
3279
3280 cat > conftest.$ac_ext <<EOF
3281 #line 3282 "configure"
3282 #include "confdefs.h"
3283 #include <$ac_hdr>
3284 EOF
3285 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3286 { (eval echo configure:3287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3287 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3288 if test -z "$ac_err"; then
3289   rm -rf conftest*
3290   eval "ac_cv_header_$ac_safe=yes"
3291 else
3292   echo "$ac_err" >&5
3293   echo "configure: failed program was:" >&5
3294   cat conftest.$ac_ext >&5
3295   rm -rf conftest*
3296   eval "ac_cv_header_$ac_safe=no"
3297 fi
3298 rm -f conftest*
3299 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3300   echo "$ac_t""yes" 1>&6
3301     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3302   { test "$extra_verbose" = "yes" && cat << EOF
3303     Defining $ac_tr_hdr
3304 EOF
3305 cat >> confdefs.h <<EOF
3306 #define $ac_tr_hdr 1
3307 EOF
3308 }
3309  
3310 else
3311   echo "$ac_t""no" 1>&6
3312 fi
3313 done
3314
3315 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3316 echo "configure:3317: checking for sys/wait.h that is POSIX.1 compatible" >&5
3317
3318 cat > conftest.$ac_ext <<EOF
3319 #line 3320 "configure"
3320 #include "confdefs.h"
3321 #include <sys/types.h>
3322 #include <sys/wait.h>
3323 #ifndef WEXITSTATUS
3324 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3325 #endif
3326 #ifndef WIFEXITED
3327 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3328 #endif
3329 int main() {
3330 int s;
3331 wait (&s);
3332 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3333 ; return 0; }
3334 EOF
3335 if { (eval echo configure:3336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3336   rm -rf conftest*
3337   ac_cv_header_sys_wait_h=yes
3338 else
3339   echo "configure: failed program was:" >&5
3340   cat conftest.$ac_ext >&5
3341   rm -rf conftest*
3342   ac_cv_header_sys_wait_h=no
3343 fi
3344 rm -f conftest*
3345
3346 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3347 if test $ac_cv_header_sys_wait_h = yes; then
3348   { test "$extra_verbose" = "yes" && cat << \EOF
3349     Defining HAVE_SYS_WAIT_H
3350 EOF
3351 cat >> confdefs.h <<\EOF
3352 #define HAVE_SYS_WAIT_H 1
3353 EOF
3354 }
3355
3356 fi
3357
3358 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3359 echo "configure:3360: checking for ANSI C header files" >&5
3360
3361 cat > conftest.$ac_ext <<EOF
3362 #line 3363 "configure"
3363 #include "confdefs.h"
3364 #include <stdlib.h>
3365 #include <stdarg.h>
3366 #include <string.h>
3367 #include <float.h>
3368 EOF
3369 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3370 { (eval echo configure:3371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3371 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3372 if test -z "$ac_err"; then
3373   rm -rf conftest*
3374   ac_cv_header_stdc=yes
3375 else
3376   echo "$ac_err" >&5
3377   echo "configure: failed program was:" >&5
3378   cat conftest.$ac_ext >&5
3379   rm -rf conftest*
3380   ac_cv_header_stdc=no
3381 fi
3382 rm -f conftest*
3383
3384 if test $ac_cv_header_stdc = yes; then
3385   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3386 cat > conftest.$ac_ext <<EOF
3387 #line 3388 "configure"
3388 #include "confdefs.h"
3389 #include <string.h>
3390 EOF
3391 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3392   egrep "memchr" >/dev/null 2>&1; then
3393   :
3394 else
3395   rm -rf conftest*
3396   ac_cv_header_stdc=no
3397 fi
3398 rm -f conftest*
3399
3400 fi
3401
3402 if test $ac_cv_header_stdc = yes; then
3403   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3404 cat > conftest.$ac_ext <<EOF
3405 #line 3406 "configure"
3406 #include "confdefs.h"
3407 #include <stdlib.h>
3408 EOF
3409 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3410   egrep "free" >/dev/null 2>&1; then
3411   :
3412 else
3413   rm -rf conftest*
3414   ac_cv_header_stdc=no
3415 fi
3416 rm -f conftest*
3417
3418 fi
3419
3420 if test $ac_cv_header_stdc = yes; then
3421   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3422 cat > conftest.$ac_ext <<EOF
3423 #line 3424 "configure"
3424 #include "confdefs.h"
3425 #include <ctype.h>
3426 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3427 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3428 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3429 int main () { int i; for (i = 0; i < 256; i++)
3430 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3431 exit (0); }
3432
3433 EOF
3434 if { (eval echo configure:3435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3435 then
3436   :
3437 else
3438   conftest_rc="$?"
3439   echo "configure: failed program was:" >&5
3440   cat conftest.$ac_ext >&5
3441   rm -fr conftest*
3442   ac_cv_header_stdc=no
3443 fi
3444 rm -fr conftest*
3445 fi
3446
3447 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3448 if test $ac_cv_header_stdc = yes; then
3449   { test "$extra_verbose" = "yes" && cat << \EOF
3450     Defining STDC_HEADERS
3451 EOF
3452 cat >> confdefs.h <<\EOF
3453 #define STDC_HEADERS 1
3454 EOF
3455 }
3456
3457 fi
3458
3459 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3460 echo "configure:3461: checking whether time.h and sys/time.h may both be included" >&5
3461
3462 cat > conftest.$ac_ext <<EOF
3463 #line 3464 "configure"
3464 #include "confdefs.h"
3465 #include <sys/types.h>
3466 #include <sys/time.h>
3467 #include <time.h>
3468 int main() {
3469 struct tm *tp;
3470 ; return 0; }
3471 EOF
3472 if { (eval echo configure:3473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3473   rm -rf conftest*
3474   ac_cv_header_time=yes
3475 else
3476   echo "configure: failed program was:" >&5
3477   cat conftest.$ac_ext >&5
3478   rm -rf conftest*
3479   ac_cv_header_time=no
3480 fi
3481 rm -f conftest*
3482
3483 echo "$ac_t""$ac_cv_header_time" 1>&6
3484 if test $ac_cv_header_time = yes; then
3485   { test "$extra_verbose" = "yes" && cat << \EOF
3486     Defining TIME_WITH_SYS_TIME
3487 EOF
3488 cat >> confdefs.h <<\EOF
3489 #define TIME_WITH_SYS_TIME 1
3490 EOF
3491 }
3492
3493 fi
3494
3495 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3496 echo "configure:3497: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3497
3498 cat > conftest.$ac_ext <<EOF
3499 #line 3500 "configure"
3500 #include "confdefs.h"
3501 #include <sys/types.h>
3502 #include <signal.h>
3503 /* NetBSD declares sys_siglist in unistd.h.  */
3504 #ifdef HAVE_UNISTD_H
3505 #include <unistd.h>
3506 #endif
3507 int main() {
3508 char *msg = *(sys_siglist + 1);
3509 ; return 0; }
3510 EOF
3511 if { (eval echo configure:3512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3512   rm -rf conftest*
3513   ac_cv_decl_sys_siglist=yes
3514 else
3515   echo "configure: failed program was:" >&5
3516   cat conftest.$ac_ext >&5
3517   rm -rf conftest*
3518   ac_cv_decl_sys_siglist=no
3519 fi
3520 rm -f conftest*
3521
3522 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3523 if test $ac_cv_decl_sys_siglist = yes; then
3524   { test "$extra_verbose" = "yes" && cat << \EOF
3525     Defining SYS_SIGLIST_DECLARED
3526 EOF
3527 cat >> confdefs.h <<\EOF
3528 #define SYS_SIGLIST_DECLARED 1
3529 EOF
3530 }
3531
3532 fi
3533
3534
3535 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3536 echo "configure:3537: checking for struct utimbuf" >&5
3537 cat > conftest.$ac_ext <<EOF
3538 #line 3539 "configure"
3539 #include "confdefs.h"
3540 #ifdef TIME_WITH_SYS_TIME
3541 #include <sys/time.h>
3542 #include <time.h>
3543 #else
3544 #ifdef HAVE_SYS_TIME_H
3545 #include <sys/time.h>
3546 #else
3547 #include <time.h>
3548 #endif
3549 #endif
3550 #ifdef HAVE_UTIME_H
3551 #include <utime.h>
3552 #endif
3553 int main() {
3554 static struct utimbuf x; x.actime = x.modtime;
3555 ; return 0; }
3556 EOF
3557 if { (eval echo configure:3558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3558   rm -rf conftest*
3559   echo "$ac_t""yes" 1>&6
3560    { test "$extra_verbose" = "yes" && cat << \EOF
3561     Defining HAVE_STRUCT_UTIMBUF
3562 EOF
3563 cat >> confdefs.h <<\EOF
3564 #define HAVE_STRUCT_UTIMBUF 1
3565 EOF
3566 }
3567
3568 else
3569   echo "configure: failed program was:" >&5
3570   cat conftest.$ac_ext >&5
3571   rm -rf conftest*
3572   echo "$ac_t""no" 1>&6
3573 fi
3574 rm -f conftest*
3575
3576 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3577 echo "configure:3578: checking return type of signal handlers" >&5
3578
3579 cat > conftest.$ac_ext <<EOF
3580 #line 3581 "configure"
3581 #include "confdefs.h"
3582 #include <sys/types.h>
3583 #include <signal.h>
3584 #ifdef signal
3585 #undef signal
3586 #endif
3587 #ifdef __cplusplus
3588 extern "C" void (*signal (int, void (*)(int)))(int);
3589 #else
3590 void (*signal ()) ();
3591 #endif
3592
3593 int main() {
3594 int i;
3595 ; return 0; }
3596 EOF
3597 if { (eval echo configure:3598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3598   rm -rf conftest*
3599   ac_cv_type_signal=void
3600 else
3601   echo "configure: failed program was:" >&5
3602   cat conftest.$ac_ext >&5
3603   rm -rf conftest*
3604   ac_cv_type_signal=int
3605 fi
3606 rm -f conftest*
3607
3608 echo "$ac_t""$ac_cv_type_signal" 1>&6
3609 { test "$extra_verbose" = "yes" && cat << EOF
3610     Defining RETSIGTYPE = $ac_cv_type_signal
3611 EOF
3612 cat >> confdefs.h <<EOF
3613 #define RETSIGTYPE $ac_cv_type_signal
3614 EOF
3615 }
3616
3617
3618 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3619 echo "configure:3620: checking for size_t" >&5
3620
3621 cat > conftest.$ac_ext <<EOF
3622 #line 3623 "configure"
3623 #include "confdefs.h"
3624 #include <sys/types.h>
3625 #if STDC_HEADERS
3626 #include <stdlib.h>
3627 #include <stddef.h>
3628 #endif
3629 EOF
3630 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3631   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3632   rm -rf conftest*
3633   ac_cv_type_size_t=yes
3634 else
3635   rm -rf conftest*
3636   ac_cv_type_size_t=no
3637 fi
3638 rm -f conftest*
3639
3640 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3641 if test $ac_cv_type_size_t = no; then
3642   { test "$extra_verbose" = "yes" && cat << \EOF
3643     Defining size_t = unsigned
3644 EOF
3645 cat >> confdefs.h <<\EOF
3646 #define size_t unsigned
3647 EOF
3648 }
3649
3650 fi
3651
3652 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3653 echo "configure:3654: checking for pid_t" >&5
3654
3655 cat > conftest.$ac_ext <<EOF
3656 #line 3657 "configure"
3657 #include "confdefs.h"
3658 #include <sys/types.h>
3659 #if STDC_HEADERS
3660 #include <stdlib.h>
3661 #include <stddef.h>
3662 #endif
3663 EOF
3664 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3665   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3666   rm -rf conftest*
3667   ac_cv_type_pid_t=yes
3668 else
3669   rm -rf conftest*
3670   ac_cv_type_pid_t=no
3671 fi
3672 rm -f conftest*
3673
3674 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3675 if test $ac_cv_type_pid_t = no; then
3676   { test "$extra_verbose" = "yes" && cat << \EOF
3677     Defining pid_t = int
3678 EOF
3679 cat >> confdefs.h <<\EOF
3680 #define pid_t int
3681 EOF
3682 }
3683
3684 fi
3685
3686 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3687 echo "configure:3688: checking for uid_t in sys/types.h" >&5
3688
3689 cat > conftest.$ac_ext <<EOF
3690 #line 3691 "configure"
3691 #include "confdefs.h"
3692 #include <sys/types.h>
3693 EOF
3694 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3695   egrep "uid_t" >/dev/null 2>&1; then
3696   rm -rf conftest*
3697   ac_cv_type_uid_t=yes
3698 else
3699   rm -rf conftest*
3700   ac_cv_type_uid_t=no
3701 fi
3702 rm -f conftest*
3703
3704
3705 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3706 if test $ac_cv_type_uid_t = no; then
3707   { test "$extra_verbose" = "yes" && cat << \EOF
3708     Defining uid_t = int
3709 EOF
3710 cat >> confdefs.h <<\EOF
3711 #define uid_t int
3712 EOF
3713 }
3714
3715   { test "$extra_verbose" = "yes" && cat << \EOF
3716     Defining gid_t = int
3717 EOF
3718 cat >> confdefs.h <<\EOF
3719 #define gid_t int
3720 EOF
3721 }
3722
3723 fi
3724
3725 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3726 echo "configure:3727: checking for mode_t" >&5
3727
3728 cat > conftest.$ac_ext <<EOF
3729 #line 3730 "configure"
3730 #include "confdefs.h"
3731 #include <sys/types.h>
3732 #if STDC_HEADERS
3733 #include <stdlib.h>
3734 #include <stddef.h>
3735 #endif
3736 EOF
3737 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3738   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3739   rm -rf conftest*
3740   ac_cv_type_mode_t=yes
3741 else
3742   rm -rf conftest*
3743   ac_cv_type_mode_t=no
3744 fi
3745 rm -f conftest*
3746
3747 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3748 if test $ac_cv_type_mode_t = no; then
3749   { test "$extra_verbose" = "yes" && cat << \EOF
3750     Defining mode_t = int
3751 EOF
3752 cat >> confdefs.h <<\EOF
3753 #define mode_t int
3754 EOF
3755 }
3756
3757 fi
3758
3759 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3760 echo "configure:3761: checking for off_t" >&5
3761
3762 cat > conftest.$ac_ext <<EOF
3763 #line 3764 "configure"
3764 #include "confdefs.h"
3765 #include <sys/types.h>
3766 #if STDC_HEADERS
3767 #include <stdlib.h>
3768 #include <stddef.h>
3769 #endif
3770 EOF
3771 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3772   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3773   rm -rf conftest*
3774   ac_cv_type_off_t=yes
3775 else
3776   rm -rf conftest*
3777   ac_cv_type_off_t=no
3778 fi
3779 rm -f conftest*
3780
3781 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3782 if test $ac_cv_type_off_t = no; then
3783   { test "$extra_verbose" = "yes" && cat << \EOF
3784     Defining off_t = long
3785 EOF
3786 cat >> confdefs.h <<\EOF
3787 #define off_t long
3788 EOF
3789 }
3790
3791 fi
3792
3793
3794 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3795 echo "configure:3796: checking for struct timeval" >&5
3796 cat > conftest.$ac_ext <<EOF
3797 #line 3798 "configure"
3798 #include "confdefs.h"
3799 #ifdef TIME_WITH_SYS_TIME
3800 #include <sys/time.h>
3801 #include <time.h>
3802 #else
3803 #ifdef HAVE_SYS_TIME_H
3804 #include <sys/time.h>
3805 #else
3806 #include <time.h>
3807 #endif
3808 #endif
3809 int main() {
3810 static struct timeval x; x.tv_sec = x.tv_usec;
3811 ; return 0; }
3812 EOF
3813 if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3814   rm -rf conftest*
3815   echo "$ac_t""yes" 1>&6
3816   HAVE_TIMEVAL=yes
3817   { test "$extra_verbose" = "yes" && cat << \EOF
3818     Defining HAVE_TIMEVAL
3819 EOF
3820 cat >> confdefs.h <<\EOF
3821 #define HAVE_TIMEVAL 1
3822 EOF
3823 }
3824
3825 else
3826   echo "configure: failed program was:" >&5
3827   cat conftest.$ac_ext >&5
3828   rm -rf conftest*
3829   echo "$ac_t""no" 1>&6
3830    HAVE_TIMEVAL=no
3831 fi
3832 rm -f conftest*
3833
3834 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3835 echo "configure:3836: checking whether struct tm is in sys/time.h or time.h" >&5
3836
3837 cat > conftest.$ac_ext <<EOF
3838 #line 3839 "configure"
3839 #include "confdefs.h"
3840 #include <sys/types.h>
3841 #include <time.h>
3842 int main() {
3843 struct tm *tp; tp->tm_sec;
3844 ; return 0; }
3845 EOF
3846 if { (eval echo configure:3847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3847   rm -rf conftest*
3848   ac_cv_struct_tm=time.h
3849 else
3850   echo "configure: failed program was:" >&5
3851   cat conftest.$ac_ext >&5
3852   rm -rf conftest*
3853   ac_cv_struct_tm=sys/time.h
3854 fi
3855 rm -f conftest*
3856
3857 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3858 if test $ac_cv_struct_tm = sys/time.h; then
3859   { test "$extra_verbose" = "yes" && cat << \EOF
3860     Defining TM_IN_SYS_TIME
3861 EOF
3862 cat >> confdefs.h <<\EOF
3863 #define TM_IN_SYS_TIME 1
3864 EOF
3865 }
3866
3867 fi
3868
3869 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3870 echo "configure:3871: checking for tm_zone in struct tm" >&5
3871
3872 cat > conftest.$ac_ext <<EOF
3873 #line 3874 "configure"
3874 #include "confdefs.h"
3875 #include <sys/types.h>
3876 #include <$ac_cv_struct_tm>
3877 int main() {
3878 struct tm tm; tm.tm_zone;
3879 ; return 0; }
3880 EOF
3881 if { (eval echo configure:3882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3882   rm -rf conftest*
3883   ac_cv_struct_tm_zone=yes
3884 else
3885   echo "configure: failed program was:" >&5
3886   cat conftest.$ac_ext >&5
3887   rm -rf conftest*
3888   ac_cv_struct_tm_zone=no
3889 fi
3890 rm -f conftest*
3891
3892 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3893 if test "$ac_cv_struct_tm_zone" = yes; then
3894   { test "$extra_verbose" = "yes" && cat << \EOF
3895     Defining HAVE_TM_ZONE
3896 EOF
3897 cat >> confdefs.h <<\EOF
3898 #define HAVE_TM_ZONE 1
3899 EOF
3900 }
3901
3902 else
3903   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3904 echo "configure:3905: checking for tzname" >&5
3905
3906 cat > conftest.$ac_ext <<EOF
3907 #line 3908 "configure"
3908 #include "confdefs.h"
3909 #include <time.h>
3910 #ifndef tzname /* For SGI.  */
3911 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3912 #endif
3913 int main() {
3914 atoi(*tzname);
3915 ; return 0; }
3916 EOF
3917 if { (eval echo configure:3918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3918   rm -rf conftest*
3919   ac_cv_var_tzname=yes
3920 else
3921   echo "configure: failed program was:" >&5
3922   cat conftest.$ac_ext >&5
3923   rm -rf conftest*
3924   ac_cv_var_tzname=no
3925 fi
3926 rm -f conftest*
3927
3928 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3929   if test $ac_cv_var_tzname = yes; then
3930     { test "$extra_verbose" = "yes" && cat << \EOF
3931     Defining HAVE_TZNAME
3932 EOF
3933 cat >> confdefs.h <<\EOF
3934 #define HAVE_TZNAME 1
3935 EOF
3936 }
3937
3938   fi
3939 fi
3940
3941
3942 echo $ac_n "checking for working const""... $ac_c" 1>&6
3943 echo "configure:3944: checking for working const" >&5
3944
3945 cat > conftest.$ac_ext <<EOF
3946 #line 3947 "configure"
3947 #include "confdefs.h"
3948
3949 int main() {
3950
3951 /* Ultrix mips cc rejects this.  */
3952 typedef int charset[2]; const charset x;
3953 /* SunOS 4.1.1 cc rejects this.  */
3954 char const *const *ccp;
3955 char **p;
3956 /* NEC SVR4.0.2 mips cc rejects this.  */
3957 struct point {int x, y;};
3958 static struct point const zero = {0,0};
3959 /* AIX XL C 1.02.0.0 rejects this.
3960    It does not let you subtract one const X* pointer from another in an arm
3961    of an if-expression whose if-part is not a constant expression */
3962 const char *g = "string";
3963 ccp = &g + (g ? g-g : 0);
3964 /* HPUX 7.0 cc rejects these. */
3965 ++ccp;
3966 p = (char**) ccp;
3967 ccp = (char const *const *) p;
3968 { /* SCO 3.2v4 cc rejects this.  */
3969   char *t;
3970   char const *s = 0 ? (char *) 0 : (char const *) 0;
3971
3972   *t++ = 0;
3973 }
3974 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3975   int x[] = {25, 17};
3976   const int *foo = &x[0];
3977   ++foo;
3978 }
3979 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3980   typedef const int *iptr;
3981   iptr p = 0;
3982   ++p;
3983 }
3984 { /* AIX XL C 1.02.0.0 rejects this saying
3985      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3986   struct s { int j; const int *ap[3]; };
3987   struct s *b; b->j = 5;
3988 }
3989 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3990   const int foo = 10;
3991 }
3992
3993 ; return 0; }
3994 EOF
3995 if { (eval echo configure:3996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3996   rm -rf conftest*
3997   ac_cv_c_const=yes
3998 else
3999   echo "configure: failed program was:" >&5
4000   cat conftest.$ac_ext >&5
4001   rm -rf conftest*
4002   ac_cv_c_const=no
4003 fi
4004 rm -f conftest*
4005
4006 echo "$ac_t""$ac_cv_c_const" 1>&6
4007 if test $ac_cv_c_const = no; then
4008   { test "$extra_verbose" = "yes" && cat << \EOF
4009     Defining const = 
4010 EOF
4011 cat >> confdefs.h <<\EOF
4012 #define const 
4013 EOF
4014 }
4015
4016 fi
4017
4018
4019 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
4020 echo "configure:4021: checking whether ${MAKE-make} sets \${MAKE}" >&5
4021 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
4022
4023 cat > conftestmake <<\EOF
4024 all:
4025         @echo 'ac_maketemp="${MAKE}"'
4026 EOF
4027 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4028 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4029 if test -n "$ac_maketemp"; then
4030   eval ac_cv_prog_make_${ac_make}_set=yes
4031 else
4032   eval ac_cv_prog_make_${ac_make}_set=no
4033 fi
4034 rm -f conftestmake
4035 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4036   echo "$ac_t""yes" 1>&6
4037   SET_MAKE=
4038 else
4039   echo "$ac_t""no" 1>&6
4040   SET_MAKE="MAKE=${MAKE-make}"
4041 fi
4042
4043
4044 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4045 echo "configure:4046: checking whether byte ordering is bigendian" >&5
4046
4047 ac_cv_c_bigendian=unknown
4048 # See if sys/param.h defines the BYTE_ORDER macro.
4049 cat > conftest.$ac_ext <<EOF
4050 #line 4051 "configure"
4051 #include "confdefs.h"
4052 #include <sys/types.h>
4053 #include <sys/param.h>
4054 int main() {
4055
4056 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4057  bogus endian macros
4058 #endif
4059 ; return 0; }
4060 EOF
4061 if { (eval echo configure:4062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4062   rm -rf conftest*
4063   # It does; now see whether it defined to BIG_ENDIAN or not.
4064 cat > conftest.$ac_ext <<EOF
4065 #line 4066 "configure"
4066 #include "confdefs.h"
4067 #include <sys/types.h>
4068 #include <sys/param.h>
4069 int main() {
4070
4071 #if BYTE_ORDER != BIG_ENDIAN
4072  not big endian
4073 #endif
4074 ; return 0; }
4075 EOF
4076 if { (eval echo configure:4077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4077   rm -rf conftest*
4078   ac_cv_c_bigendian=yes
4079 else
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   ac_cv_c_bigendian=no
4084 fi
4085 rm -f conftest*
4086 else
4087   echo "configure: failed program was:" >&5
4088   cat conftest.$ac_ext >&5
4089 fi
4090 rm -f conftest*
4091 if test $ac_cv_c_bigendian = unknown; then
4092 cat > conftest.$ac_ext <<EOF
4093 #line 4094 "configure"
4094 #include "confdefs.h"
4095 main () {
4096   /* Are we little or big endian?  From Harbison&Steele.  */
4097   union
4098   {
4099     long l;
4100     char c[sizeof (long)];
4101   } u;
4102   u.l = 1;
4103   exit (u.c[sizeof (long) - 1] == 1);
4104 }
4105 EOF
4106 if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4107 then
4108   ac_cv_c_bigendian=no
4109 else
4110   conftest_rc="$?"
4111   echo "configure: failed program was:" >&5
4112   cat conftest.$ac_ext >&5
4113   rm -fr conftest*
4114   ac_cv_c_bigendian=yes
4115 fi
4116 rm -fr conftest*
4117 fi
4118
4119 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4120 if test $ac_cv_c_bigendian = yes; then
4121   { test "$extra_verbose" = "yes" && cat << \EOF
4122     Defining WORDS_BIGENDIAN
4123 EOF
4124 cat >> confdefs.h <<\EOF
4125 #define WORDS_BIGENDIAN 1
4126 EOF
4127 }
4128
4129 fi
4130
4131
4132 echo $ac_n "checking size of short""... $ac_c" 1>&6
4133 echo "configure:4134: checking size of short" >&5
4134
4135 cat > conftest.$ac_ext <<EOF
4136 #line 4137 "configure"
4137 #include "confdefs.h"
4138 #include <stdio.h>
4139 main()
4140 {
4141   FILE *f=fopen("conftestval", "w");
4142   if (!f) exit(1);
4143   fprintf(f, "%d\n", sizeof(short));
4144   exit(0);
4145 }
4146 EOF
4147 if { (eval echo configure:4148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4148 then
4149   ac_cv_sizeof_short=`cat conftestval`
4150 else
4151   conftest_rc="$?"
4152   echo "configure: failed program was:" >&5
4153   cat conftest.$ac_ext >&5
4154   rm -fr conftest*
4155   ac_cv_sizeof_short=0
4156 fi
4157 rm -fr conftest*
4158 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4159 { test "$extra_verbose" = "yes" && cat << EOF
4160     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4161 EOF
4162 cat >> confdefs.h <<EOF
4163 #define SIZEOF_SHORT $ac_cv_sizeof_short
4164 EOF
4165 }
4166
4167
4168 if test "$ac_cv_sizeof_short" = 0; then
4169   echo ""
4170   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4171   echo "*** PANIC *** Please examine config.log for compilation errors."
4172   exit 1
4173 fi
4174 echo $ac_n "checking size of int""... $ac_c" 1>&6
4175 echo "configure:4176: checking size of int" >&5
4176
4177 cat > conftest.$ac_ext <<EOF
4178 #line 4179 "configure"
4179 #include "confdefs.h"
4180 #include <stdio.h>
4181 main()
4182 {
4183   FILE *f=fopen("conftestval", "w");
4184   if (!f) exit(1);
4185   fprintf(f, "%d\n", sizeof(int));
4186   exit(0);
4187 }
4188 EOF
4189 if { (eval echo configure:4190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4190 then
4191   ac_cv_sizeof_int=`cat conftestval`
4192 else
4193   conftest_rc="$?"
4194   echo "configure: failed program was:" >&5
4195   cat conftest.$ac_ext >&5
4196   rm -fr conftest*
4197   ac_cv_sizeof_int=0
4198 fi
4199 rm -fr conftest*
4200 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4201 { test "$extra_verbose" = "yes" && cat << EOF
4202     Defining SIZEOF_INT = $ac_cv_sizeof_int
4203 EOF
4204 cat >> confdefs.h <<EOF
4205 #define SIZEOF_INT $ac_cv_sizeof_int
4206 EOF
4207 }
4208
4209
4210 echo $ac_n "checking size of long""... $ac_c" 1>&6
4211 echo "configure:4212: checking size of long" >&5
4212
4213 cat > conftest.$ac_ext <<EOF
4214 #line 4215 "configure"
4215 #include "confdefs.h"
4216 #include <stdio.h>
4217 main()
4218 {
4219   FILE *f=fopen("conftestval", "w");
4220   if (!f) exit(1);
4221   fprintf(f, "%d\n", sizeof(long));
4222   exit(0);
4223 }
4224 EOF
4225 if { (eval echo configure:4226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4226 then
4227   ac_cv_sizeof_long=`cat conftestval`
4228 else
4229   conftest_rc="$?"
4230   echo "configure: failed program was:" >&5
4231   cat conftest.$ac_ext >&5
4232   rm -fr conftest*
4233   ac_cv_sizeof_long=0
4234 fi
4235 rm -fr conftest*
4236 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4237 { test "$extra_verbose" = "yes" && cat << EOF
4238     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4239 EOF
4240 cat >> confdefs.h <<EOF
4241 #define SIZEOF_LONG $ac_cv_sizeof_long
4242 EOF
4243 }
4244
4245
4246 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4247 echo "configure:4248: checking size of long long" >&5
4248
4249 cat > conftest.$ac_ext <<EOF
4250 #line 4251 "configure"
4251 #include "confdefs.h"
4252 #include <stdio.h>
4253 main()
4254 {
4255   FILE *f=fopen("conftestval", "w");
4256   if (!f) exit(1);
4257   fprintf(f, "%d\n", sizeof(long long));
4258   exit(0);
4259 }
4260 EOF
4261 if { (eval echo configure:4262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4262 then
4263   ac_cv_sizeof_long_long=`cat conftestval`
4264 else
4265   conftest_rc="$?"
4266   echo "configure: failed program was:" >&5
4267   cat conftest.$ac_ext >&5
4268   rm -fr conftest*
4269   ac_cv_sizeof_long_long=0
4270 fi
4271 rm -fr conftest*
4272 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4273 { test "$extra_verbose" = "yes" && cat << EOF
4274     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4275 EOF
4276 cat >> confdefs.h <<EOF
4277 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4278 EOF
4279 }
4280
4281
4282 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4283 echo "configure:4284: checking size of void *" >&5
4284
4285 cat > conftest.$ac_ext <<EOF
4286 #line 4287 "configure"
4287 #include "confdefs.h"
4288 #include <stdio.h>
4289 main()
4290 {
4291   FILE *f=fopen("conftestval", "w");
4292   if (!f) exit(1);
4293   fprintf(f, "%d\n", sizeof(void *));
4294   exit(0);
4295 }
4296 EOF
4297 if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4298 then
4299   ac_cv_sizeof_void_p=`cat conftestval`
4300 else
4301   conftest_rc="$?"
4302   echo "configure: failed program was:" >&5
4303   cat conftest.$ac_ext >&5
4304   rm -fr conftest*
4305   ac_cv_sizeof_void_p=0
4306 fi
4307 rm -fr conftest*
4308 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4309 { test "$extra_verbose" = "yes" && cat << EOF
4310     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4311 EOF
4312 cat >> confdefs.h <<EOF
4313 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4314 EOF
4315 }
4316
4317
4318
4319 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4320 echo "configure:4321: checking for long file names" >&5
4321
4322 ac_cv_sys_long_file_names=yes
4323 # Test for long file names in all the places we know might matter:
4324 #      .                the current directory, where building will happen
4325 #      $prefix/lib      where we will be installing things
4326 #      $exec_prefix/lib likewise
4327 # eval it to expand exec_prefix.
4328 #      $TMPDIR          if set, where it might want to write temporary files
4329 # if $TMPDIR is not set:
4330 #      /tmp             where it might want to write temporary files
4331 #      /var/tmp         likewise
4332 #      /usr/tmp         likewise
4333 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4334   ac_tmpdirs="$TMPDIR"
4335 else
4336   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4337 fi
4338 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4339   test -d $ac_dir || continue
4340   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4341   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4342   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4343   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4344   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4345     ac_cv_sys_long_file_names=no
4346     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4347     break
4348   fi
4349   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4350 done
4351
4352 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4353 if test $ac_cv_sys_long_file_names = yes; then
4354   { test "$extra_verbose" = "yes" && cat << \EOF
4355     Defining HAVE_LONG_FILE_NAMES
4356 EOF
4357 cat >> confdefs.h <<\EOF
4358 #define HAVE_LONG_FILE_NAMES 1
4359 EOF
4360 }
4361
4362 fi
4363
4364
4365 echo $ac_n "checking for sin""... $ac_c" 1>&6
4366 echo "configure:4367: checking for sin" >&5
4367
4368 cat > conftest.$ac_ext <<EOF
4369 #line 4370 "configure"
4370 #include "confdefs.h"
4371 /* System header to define __stub macros and hopefully few prototypes,
4372     which can conflict with char sin(); below.  */
4373 #include <assert.h>
4374 /* Override any gcc2 internal prototype to avoid an error.  */
4375 /* We use char because int might match the return type of a gcc2
4376     builtin and then its argument prototype would still apply.  */
4377 char sin();
4378
4379 int main() {
4380
4381 /* The GNU C library defines this for functions which it implements
4382     to always fail with ENOSYS.  Some functions are actually named
4383     something starting with __ and the normal name is an alias.  */
4384 #if defined (__stub_sin) || defined (__stub___sin)
4385 choke me
4386 #else
4387 sin();
4388 #endif
4389
4390 ; return 0; }
4391 EOF
4392 if { (eval echo configure:4393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4393   rm -rf conftest*
4394   eval "ac_cv_func_sin=yes"
4395 else
4396   echo "configure: failed program was:" >&5
4397   cat conftest.$ac_ext >&5
4398   rm -rf conftest*
4399   eval "ac_cv_func_sin=no"
4400 fi
4401 rm -f conftest*
4402
4403 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4404   echo "$ac_t""yes" 1>&6
4405   :
4406 else
4407   echo "$ac_t""no" 1>&6
4408
4409 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4410 echo "configure:4411: checking for sin in -lm" >&5
4411 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4412
4413 xe_check_libs=" -lm "
4414 cat > conftest.$ac_ext <<EOF
4415 #line 4416 "configure"
4416 #include "confdefs.h"
4417 /* Override any gcc2 internal prototype to avoid an error.  */
4418 /* We use char because int might match the return type of a gcc2
4419     builtin and then its argument prototype would still apply.  */
4420 char sin();
4421
4422 int main() {
4423 sin()
4424 ; return 0; }
4425 EOF
4426 if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4427   rm -rf conftest*
4428   eval "ac_cv_lib_$ac_lib_var=yes"
4429 else
4430   echo "configure: failed program was:" >&5
4431   cat conftest.$ac_ext >&5
4432   rm -rf conftest*
4433   eval "ac_cv_lib_$ac_lib_var=no"
4434 fi
4435 rm -f conftest*
4436 xe_check_libs=""
4437
4438 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4439   echo "$ac_t""yes" 1>&6
4440     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4441     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4442   { test "$extra_verbose" = "yes" && cat << EOF
4443     Defining $ac_tr_lib
4444 EOF
4445 cat >> confdefs.h <<EOF
4446 #define $ac_tr_lib 1
4447 EOF
4448 }
4449
4450   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4451
4452 else
4453   echo "$ac_t""no" 1>&6
4454 fi
4455
4456
4457 fi
4458
4459
4460 { test "$extra_verbose" = "yes" && cat << \EOF
4461     Defining LISP_FLOAT_TYPE
4462 EOF
4463 cat >> confdefs.h <<\EOF
4464 #define LISP_FLOAT_TYPE 1
4465 EOF
4466 }
4467
4468
4469 cat > conftest.$ac_ext <<EOF
4470 #line 4471 "configure"
4471 #include "confdefs.h"
4472 #include <math.h>
4473 int main() {
4474 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4475 ; return 0; }
4476 EOF
4477 if { (eval echo configure:4478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4478   rm -rf conftest*
4479   { test "$extra_verbose" = "yes" && cat << \EOF
4480     Defining HAVE_INVERSE_HYPERBOLIC
4481 EOF
4482 cat >> confdefs.h <<\EOF
4483 #define HAVE_INVERSE_HYPERBOLIC 1
4484 EOF
4485 }
4486
4487 else
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490 fi
4491 rm -f conftest*
4492
4493 echo "checking type of mail spool file locking" 1>&6
4494 echo "configure:4495: checking type of mail spool file locking" >&5
4495 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4496 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4497 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4498     Defining REAL_MAIL_USE_LOCKF
4499 EOF
4500 cat >> confdefs.h <<\EOF
4501 #define REAL_MAIL_USE_LOCKF 1
4502 EOF
4503 }
4504
4505 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4506     Defining REAL_MAIL_USE_FLOCK
4507 EOF
4508 cat >> confdefs.h <<\EOF
4509 #define REAL_MAIL_USE_FLOCK 1
4510 EOF
4511 }
4512
4513 else mail_locking="dot-locking"
4514 fi
4515
4516 case "$opsys" in decosf*)
4517   
4518 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4519 echo "configure:4520: checking for cma_open in -lpthreads" >&5
4520 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4521
4522 xe_check_libs=" -lpthreads "
4523 cat > conftest.$ac_ext <<EOF
4524 #line 4525 "configure"
4525 #include "confdefs.h"
4526 /* Override any gcc2 internal prototype to avoid an error.  */
4527 /* We use char because int might match the return type of a gcc2
4528     builtin and then its argument prototype would still apply.  */
4529 char cma_open();
4530
4531 int main() {
4532 cma_open()
4533 ; return 0; }
4534 EOF
4535 if { (eval echo configure:4536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4536   rm -rf conftest*
4537   eval "ac_cv_lib_$ac_lib_var=yes"
4538 else
4539   echo "configure: failed program was:" >&5
4540   cat conftest.$ac_ext >&5
4541   rm -rf conftest*
4542   eval "ac_cv_lib_$ac_lib_var=no"
4543 fi
4544 rm -f conftest*
4545 xe_check_libs=""
4546
4547 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4548   echo "$ac_t""yes" 1>&6
4549     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4550     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4551   { test "$extra_verbose" = "yes" && cat << EOF
4552     Defining $ac_tr_lib
4553 EOF
4554 cat >> confdefs.h <<EOF
4555 #define $ac_tr_lib 1
4556 EOF
4557 }
4558
4559   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4560
4561 else
4562   echo "$ac_t""no" 1>&6
4563 fi
4564
4565
4566   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4567     c_switch_site="$c_switch_site -threads" ;;
4568 esac
4569
4570 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4571 echo "configure:4572: checking whether the -xildoff compiler flag is required" >&5
4572 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4573   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4574     then echo "$ac_t""no" 1>&6;
4575     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
4576   fi
4577   else echo "$ac_t""no" 1>&6
4578 fi
4579
4580 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4581   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4582 echo "configure:4583: checking for \"-z ignore\" linker flag" >&5
4583   case "`ld -h 2>&1`" in
4584     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4585       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4586     *) echo "$ac_t""no" 1>&6 ;;
4587   esac
4588 fi
4589
4590
4591 echo "checking "for specified window system"" 1>&6
4592 echo "configure:4593: checking "for specified window system"" >&5
4593
4594 if test "$with_x11" != "no"; then
4595     test "$x_includes $x_libraries" != "NONE NONE" && \
4596    window_system=x11 with_x11=yes
4597
4598         
4599       if test "$x_includes $x_libraries" = "NONE NONE" \
4600     -a -n "$OPENWINHOME" \
4601     -a "$OPENWINHOME" != "/usr/openwin" \
4602     -a -d "$OPENWINHOME"; then
4603       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4604       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4605       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4606   fi
4607
4608   if test "$x_includes" = "NONE"; then
4609                     for dir in "/usr/X11" "/usr/X11R6"; do
4610       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4611     done
4612   fi
4613
4614   if test "$x_libraries" = "NONE"; then
4615     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4616       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4617     done
4618   fi
4619
4620   # If we find X, set shell vars x_includes and x_libraries to the
4621 # paths, otherwise set no_x=yes.
4622 # Uses ac_ vars as temps to allow command line to override cache and checks.
4623 # --without-x overrides everything else, but does not touch the cache.
4624 echo $ac_n "checking for X""... $ac_c" 1>&6
4625 echo "configure:4626: checking for X" >&5
4626
4627 # Check whether --with-x or --without-x was given.
4628 if test "${with_x+set}" = set; then
4629   withval="$with_x"
4630   :
4631 fi
4632
4633 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4634 if test "x$with_x" = xno; then
4635   # The user explicitly disabled X.
4636   have_x=disabled
4637 else
4638   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4639     # Both variables are already set.
4640     have_x=yes
4641   else
4642
4643 # One or both of the vars are not set, and there is no cached value.
4644 ac_x_includes=NO ac_x_libraries=NO
4645 rm -fr conftestdir
4646 if mkdir conftestdir; then
4647   cd conftestdir
4648   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4649   cat > Imakefile <<'EOF'
4650 acfindx:
4651         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4652 EOF
4653   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4654     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4655     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4656     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4657     for ac_extension in a so sl; do
4658       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4659         test -f $ac_im_libdir/libX11.$ac_extension; then
4660         ac_im_usrlibdir=$ac_im_libdir; break
4661       fi
4662     done
4663     # Screen out bogus values from the imake configuration.  They are
4664     # bogus both because they are the default anyway, and because
4665     # using them would break gcc on systems where it needs fixed includes.
4666     case "$ac_im_incroot" in
4667         /usr/include) ;;
4668         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4669     esac
4670     case "$ac_im_usrlibdir" in
4671         /usr/lib | /lib) ;;
4672         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4673     esac
4674   fi
4675   cd ..
4676   rm -fr conftestdir
4677 fi
4678
4679 if test "$ac_x_includes" = NO; then
4680   # Guess where to find include files, by looking for this one X11 .h file.
4681   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4682
4683   # First, try using that file with no special directory specified.
4684 cat > conftest.$ac_ext <<EOF
4685 #line 4686 "configure"
4686 #include "confdefs.h"
4687 #include <$x_direct_test_include>
4688 EOF
4689 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4690 { (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4691 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4692 if test -z "$ac_err"; then
4693   rm -rf conftest*
4694   # We can compile using X headers with no special include directory.
4695 ac_x_includes=
4696 else
4697   echo "$ac_err" >&5
4698   echo "configure: failed program was:" >&5
4699   cat conftest.$ac_ext >&5
4700   rm -rf conftest*
4701   # Look for the header file in a standard set of common directories.
4702 # Check X11 before X11Rn because it is often a symlink to the current release.
4703   for ac_dir in               \
4704     /usr/X11/include          \
4705     /usr/X11R6/include        \
4706     /usr/X11R5/include        \
4707     /usr/X11R4/include        \
4708                               \
4709     /usr/include/X11          \
4710     /usr/include/X11R6        \
4711     /usr/include/X11R5        \
4712     /usr/include/X11R4        \
4713                               \
4714     /usr/local/X11/include    \
4715     /usr/local/X11R6/include  \
4716     /usr/local/X11R5/include  \
4717     /usr/local/X11R4/include  \
4718                               \
4719     /usr/local/include/X11    \
4720     /usr/local/include/X11R6  \
4721     /usr/local/include/X11R5  \
4722     /usr/local/include/X11R4  \
4723                               \
4724     /usr/X386/include         \
4725     /usr/x386/include         \
4726     /usr/XFree86/include/X11  \
4727                               \
4728     /usr/include              \
4729     /usr/local/include        \
4730     /usr/unsupported/include  \
4731     /usr/athena/include       \
4732     /usr/local/x11r5/include  \
4733     /usr/lpp/Xamples/include  \
4734                               \
4735     /usr/openwin/include      \
4736     /usr/openwin/share/include \
4737     ; \
4738   do
4739     if test -r "$ac_dir/$x_direct_test_include"; then
4740       ac_x_includes=$ac_dir
4741       break
4742     fi
4743   done
4744 fi
4745 rm -f conftest*
4746 fi # $ac_x_includes = NO
4747
4748 if test "$ac_x_libraries" = NO; then
4749   # Check for the libraries.
4750
4751   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4752   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4753
4754   # See if we find them without any special options.
4755   # Don't add to $LIBS permanently.
4756   ac_save_LIBS="$LIBS"
4757   LIBS="-l$x_direct_test_library $LIBS"
4758 cat > conftest.$ac_ext <<EOF
4759 #line 4760 "configure"
4760 #include "confdefs.h"
4761
4762 int main() {
4763 ${x_direct_test_function}()
4764 ; return 0; }
4765 EOF
4766 if { (eval echo configure:4767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4767   rm -rf conftest*
4768   LIBS="$ac_save_LIBS"
4769 # We can link X programs with no special library path.
4770 ac_x_libraries=
4771 else
4772   echo "configure: failed program was:" >&5
4773   cat conftest.$ac_ext >&5
4774   rm -rf conftest*
4775   LIBS="$ac_save_LIBS"
4776 # First see if replacing the include by lib works.
4777 # Check X11 before X11Rn because it is often a symlink to the current release.
4778 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4779     /usr/X11/lib          \
4780     /usr/X11R6/lib        \
4781     /usr/X11R5/lib        \
4782     /usr/X11R4/lib        \
4783                           \
4784     /usr/lib/X11          \
4785     /usr/lib/X11R6        \
4786     /usr/lib/X11R5        \
4787     /usr/lib/X11R4        \
4788                           \
4789     /usr/local/X11/lib    \
4790     /usr/local/X11R6/lib  \
4791     /usr/local/X11R5/lib  \
4792     /usr/local/X11R4/lib  \
4793                           \
4794     /usr/local/lib/X11    \
4795     /usr/local/lib/X11R6  \
4796     /usr/local/lib/X11R5  \
4797     /usr/local/lib/X11R4  \
4798                           \
4799     /usr/X386/lib         \
4800     /usr/x386/lib         \
4801     /usr/XFree86/lib/X11  \
4802                           \
4803     /usr/lib              \
4804     /usr/local/lib        \
4805     /usr/unsupported/lib  \
4806     /usr/athena/lib       \
4807     /usr/local/x11r5/lib  \
4808     /usr/lpp/Xamples/lib  \
4809     /lib/usr/lib/X11      \
4810                           \
4811     /usr/openwin/lib      \
4812     /usr/openwin/share/lib \
4813     ; \
4814 do
4815   for ac_extension in a so sl; do
4816     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4817       ac_x_libraries=$ac_dir
4818       break 2
4819     fi
4820   done
4821 done
4822 fi
4823 rm -f conftest*
4824 fi # $ac_x_libraries = NO
4825
4826 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4827   # Didn't find X anywhere.  Cache the known absence of X.
4828   ac_cv_have_x="have_x=no"
4829 else
4830   # Record where we found X for the cache.
4831   ac_cv_have_x="have_x=yes \
4832                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4833 fi
4834   fi
4835   eval "$ac_cv_have_x"
4836 fi # $with_x != no
4837
4838 if test "$have_x" != yes; then
4839   echo "$ac_t""$have_x" 1>&6
4840   no_x=yes
4841 else
4842   # If each of the values was on the command line, it overrides each guess.
4843   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4844   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4845   # Update the cache value to reflect the command line values.
4846   ac_cv_have_x="have_x=yes \
4847                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4848   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4849 fi
4850
4851 if test "$no_x" = yes; then
4852   # Not all programs may use this symbol, but it does not hurt to define it.
4853   { test "$extra_verbose" = "yes" && cat << \EOF
4854     Defining X_DISPLAY_MISSING
4855 EOF
4856 cat >> confdefs.h <<\EOF
4857 #define X_DISPLAY_MISSING 1
4858 EOF
4859 }
4860
4861   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4862 else
4863   if test -n "$x_includes"; then
4864     X_CFLAGS="$X_CFLAGS -I$x_includes"
4865   fi
4866
4867   # It would also be nice to do this for all -L options, not just this one.
4868   if test -n "$x_libraries"; then
4869     X_LIBS="$X_LIBS -L$x_libraries"
4870     # For Solaris; some versions of Sun CC require a space after -R and
4871     # others require no space.  Words are not sufficient . . . .
4872     case "`(uname -sr) 2>/dev/null`" in
4873     "SunOS 5"*)
4874       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4875 echo "configure:4876: checking whether -R must be followed by a space" >&5
4876       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4877       cat > conftest.$ac_ext <<EOF
4878 #line 4879 "configure"
4879 #include "confdefs.h"
4880
4881 int main() {
4882
4883 ; return 0; }
4884 EOF
4885 if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4886   rm -rf conftest*
4887   ac_R_nospace=yes
4888 else
4889   echo "configure: failed program was:" >&5
4890   cat conftest.$ac_ext >&5
4891   rm -rf conftest*
4892   ac_R_nospace=no
4893 fi
4894 rm -f conftest*
4895       if test $ac_R_nospace = yes; then
4896         echo "$ac_t""no" 1>&6
4897         X_LIBS="$X_LIBS -R$x_libraries"
4898       else
4899         LIBS="$ac_xsave_LIBS -R $x_libraries"
4900         cat > conftest.$ac_ext <<EOF
4901 #line 4902 "configure"
4902 #include "confdefs.h"
4903
4904 int main() {
4905
4906 ; return 0; }
4907 EOF
4908 if { (eval echo configure:4909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4909   rm -rf conftest*
4910   ac_R_space=yes
4911 else
4912   echo "configure: failed program was:" >&5
4913   cat conftest.$ac_ext >&5
4914   rm -rf conftest*
4915   ac_R_space=no
4916 fi
4917 rm -f conftest*
4918         if test $ac_R_space = yes; then
4919           echo "$ac_t""yes" 1>&6
4920           X_LIBS="$X_LIBS -R $x_libraries"
4921         else
4922           echo "$ac_t""neither works" 1>&6
4923         fi
4924       fi
4925       LIBS="$ac_xsave_LIBS"
4926     esac
4927   fi
4928
4929   # Check for system-dependent libraries X programs must link with.
4930   # Do this before checking for the system-independent R6 libraries
4931   # (-lICE), since we may need -lsocket or whatever for X linking.
4932
4933   if test "$ISC" = yes; then
4934     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4935   else
4936     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4937     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4938     # the Alpha needs dnet_stub (dnet does not exist).
4939     if test "$with_dnet" = "no" ; then
4940 ac_cv_lib_dnet_dnet_ntoa=no
4941 else
4942
4943 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4944 echo "configure:4945: checking for dnet_ntoa in -ldnet" >&5
4945 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4946
4947 xe_check_libs=" -ldnet "
4948 cat > conftest.$ac_ext <<EOF
4949 #line 4950 "configure"
4950 #include "confdefs.h"
4951 /* Override any gcc2 internal prototype to avoid an error.  */
4952 /* We use char because int might match the return type of a gcc2
4953     builtin and then its argument prototype would still apply.  */
4954 char dnet_ntoa();
4955
4956 int main() {
4957 dnet_ntoa()
4958 ; return 0; }
4959 EOF
4960 if { (eval echo configure:4961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4961   rm -rf conftest*
4962   eval "ac_cv_lib_$ac_lib_var=yes"
4963 else
4964   echo "configure: failed program was:" >&5
4965   cat conftest.$ac_ext >&5
4966   rm -rf conftest*
4967   eval "ac_cv_lib_$ac_lib_var=no"
4968 fi
4969 rm -f conftest*
4970 xe_check_libs=""
4971
4972 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4973   echo "$ac_t""yes" 1>&6
4974   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4975 else
4976   echo "$ac_t""no" 1>&6
4977 fi
4978
4979 fi
4980
4981     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4982       
4983 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4984 echo "configure:4985: checking for dnet_ntoa in -ldnet_stub" >&5
4985 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4986
4987 xe_check_libs=" -ldnet_stub "
4988 cat > conftest.$ac_ext <<EOF
4989 #line 4990 "configure"
4990 #include "confdefs.h"
4991 /* Override any gcc2 internal prototype to avoid an error.  */
4992 /* We use char because int might match the return type of a gcc2
4993     builtin and then its argument prototype would still apply.  */
4994 char dnet_ntoa();
4995
4996 int main() {
4997 dnet_ntoa()
4998 ; return 0; }
4999 EOF
5000 if { (eval echo configure:5001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5001   rm -rf conftest*
5002   eval "ac_cv_lib_$ac_lib_var=yes"
5003 else
5004   echo "configure: failed program was:" >&5
5005   cat conftest.$ac_ext >&5
5006   rm -rf conftest*
5007   eval "ac_cv_lib_$ac_lib_var=no"
5008 fi
5009 rm -f conftest*
5010 xe_check_libs=""
5011
5012 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5013   echo "$ac_t""yes" 1>&6
5014   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
5015 else
5016   echo "$ac_t""no" 1>&6
5017 fi
5018
5019
5020     fi
5021
5022     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
5023     # to get the SysV transport functions.
5024     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5025     # needs -lnsl.
5026     # The nsl library prevents programs from opening the X display
5027     # on Irix 5.2, according to dickey@clark.net.
5028     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5029 echo "configure:5030: checking for gethostbyname" >&5
5030
5031 cat > conftest.$ac_ext <<EOF
5032 #line 5033 "configure"
5033 #include "confdefs.h"
5034 /* System header to define __stub macros and hopefully few prototypes,
5035     which can conflict with char gethostbyname(); below.  */
5036 #include <assert.h>
5037 /* Override any gcc2 internal prototype to avoid an error.  */
5038 /* We use char because int might match the return type of a gcc2
5039     builtin and then its argument prototype would still apply.  */
5040 char gethostbyname();
5041
5042 int main() {
5043
5044 /* The GNU C library defines this for functions which it implements
5045     to always fail with ENOSYS.  Some functions are actually named
5046     something starting with __ and the normal name is an alias.  */
5047 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5048 choke me
5049 #else
5050 gethostbyname();
5051 #endif
5052
5053 ; return 0; }
5054 EOF
5055 if { (eval echo configure:5056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5056   rm -rf conftest*
5057   eval "ac_cv_func_gethostbyname=yes"
5058 else
5059   echo "configure: failed program was:" >&5
5060   cat conftest.$ac_ext >&5
5061   rm -rf conftest*
5062   eval "ac_cv_func_gethostbyname=no"
5063 fi
5064 rm -f conftest*
5065
5066 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5067   echo "$ac_t""yes" 1>&6
5068   :
5069 else
5070   echo "$ac_t""no" 1>&6
5071 fi
5072
5073     if test $ac_cv_func_gethostbyname = no; then
5074       
5075 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5076 echo "configure:5077: checking for gethostbyname in -lnsl" >&5
5077 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5078
5079 xe_check_libs=" -lnsl "
5080 cat > conftest.$ac_ext <<EOF
5081 #line 5082 "configure"
5082 #include "confdefs.h"
5083 /* Override any gcc2 internal prototype to avoid an error.  */
5084 /* We use char because int might match the return type of a gcc2
5085     builtin and then its argument prototype would still apply.  */
5086 char gethostbyname();
5087
5088 int main() {
5089 gethostbyname()
5090 ; return 0; }
5091 EOF
5092 if { (eval echo configure:5093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5093   rm -rf conftest*
5094   eval "ac_cv_lib_$ac_lib_var=yes"
5095 else
5096   echo "configure: failed program was:" >&5
5097   cat conftest.$ac_ext >&5
5098   rm -rf conftest*
5099   eval "ac_cv_lib_$ac_lib_var=no"
5100 fi
5101 rm -f conftest*
5102 xe_check_libs=""
5103
5104 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5105   echo "$ac_t""yes" 1>&6
5106   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5107 else
5108   echo "$ac_t""no" 1>&6
5109 fi
5110
5111
5112     fi
5113
5114     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5115     # socket/setsockopt and other routines are undefined under SCO ODT
5116     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5117     # on later versions), says simon@lia.di.epfl.ch: it contains
5118     # gethostby* variants that don't use the nameserver (or something).
5119     # -lsocket must be given before -lnsl if both are needed.
5120     # We assume that if connect needs -lnsl, so does gethostbyname.
5121     echo $ac_n "checking for connect""... $ac_c" 1>&6
5122 echo "configure:5123: checking for connect" >&5
5123
5124 cat > conftest.$ac_ext <<EOF
5125 #line 5126 "configure"
5126 #include "confdefs.h"
5127 /* System header to define __stub macros and hopefully few prototypes,
5128     which can conflict with char connect(); below.  */
5129 #include <assert.h>
5130 /* Override any gcc2 internal prototype to avoid an error.  */
5131 /* We use char because int might match the return type of a gcc2
5132     builtin and then its argument prototype would still apply.  */
5133 char connect();
5134
5135 int main() {
5136
5137 /* The GNU C library defines this for functions which it implements
5138     to always fail with ENOSYS.  Some functions are actually named
5139     something starting with __ and the normal name is an alias.  */
5140 #if defined (__stub_connect) || defined (__stub___connect)
5141 choke me
5142 #else
5143 connect();
5144 #endif
5145
5146 ; return 0; }
5147 EOF
5148 if { (eval echo configure:5149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5149   rm -rf conftest*
5150   eval "ac_cv_func_connect=yes"
5151 else
5152   echo "configure: failed program was:" >&5
5153   cat conftest.$ac_ext >&5
5154   rm -rf conftest*
5155   eval "ac_cv_func_connect=no"
5156 fi
5157 rm -f conftest*
5158
5159 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5160   echo "$ac_t""yes" 1>&6
5161   :
5162 else
5163   echo "$ac_t""no" 1>&6
5164 fi
5165
5166     if test $ac_cv_func_connect = no; then
5167       
5168 xe_msg_checking="for connect in -lsocket"
5169 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5170 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5171 echo "configure:5172: checking "$xe_msg_checking"" >&5
5172 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5173
5174 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5175 cat > conftest.$ac_ext <<EOF
5176 #line 5177 "configure"
5177 #include "confdefs.h"
5178 /* Override any gcc2 internal prototype to avoid an error.  */
5179 /* We use char because int might match the return type of a gcc2
5180     builtin and then its argument prototype would still apply.  */
5181 char connect();
5182
5183 int main() {
5184 connect()
5185 ; return 0; }
5186 EOF
5187 if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5188   rm -rf conftest*
5189   eval "ac_cv_lib_$ac_lib_var=yes"
5190 else
5191   echo "configure: failed program was:" >&5
5192   cat conftest.$ac_ext >&5
5193   rm -rf conftest*
5194   eval "ac_cv_lib_$ac_lib_var=no"
5195 fi
5196 rm -f conftest*
5197 xe_check_libs=""
5198
5199 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5200   echo "$ac_t""yes" 1>&6
5201   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5202 else
5203   echo "$ac_t""no" 1>&6
5204 fi
5205
5206
5207     fi
5208
5209     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5210     echo $ac_n "checking for remove""... $ac_c" 1>&6
5211 echo "configure:5212: checking for remove" >&5
5212
5213 cat > conftest.$ac_ext <<EOF
5214 #line 5215 "configure"
5215 #include "confdefs.h"
5216 /* System header to define __stub macros and hopefully few prototypes,
5217     which can conflict with char remove(); below.  */
5218 #include <assert.h>
5219 /* Override any gcc2 internal prototype to avoid an error.  */
5220 /* We use char because int might match the return type of a gcc2
5221     builtin and then its argument prototype would still apply.  */
5222 char remove();
5223
5224 int main() {
5225
5226 /* The GNU C library defines this for functions which it implements
5227     to always fail with ENOSYS.  Some functions are actually named
5228     something starting with __ and the normal name is an alias.  */
5229 #if defined (__stub_remove) || defined (__stub___remove)
5230 choke me
5231 #else
5232 remove();
5233 #endif
5234
5235 ; return 0; }
5236 EOF
5237 if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5238   rm -rf conftest*
5239   eval "ac_cv_func_remove=yes"
5240 else
5241   echo "configure: failed program was:" >&5
5242   cat conftest.$ac_ext >&5
5243   rm -rf conftest*
5244   eval "ac_cv_func_remove=no"
5245 fi
5246 rm -f conftest*
5247
5248 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5249   echo "$ac_t""yes" 1>&6
5250   :
5251 else
5252   echo "$ac_t""no" 1>&6
5253 fi
5254
5255     if test $ac_cv_func_remove = no; then
5256       
5257 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5258 echo "configure:5259: checking for remove in -lposix" >&5
5259 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5260
5261 xe_check_libs=" -lposix "
5262 cat > conftest.$ac_ext <<EOF
5263 #line 5264 "configure"
5264 #include "confdefs.h"
5265 /* Override any gcc2 internal prototype to avoid an error.  */
5266 /* We use char because int might match the return type of a gcc2
5267     builtin and then its argument prototype would still apply.  */
5268 char remove();
5269
5270 int main() {
5271 remove()
5272 ; return 0; }
5273 EOF
5274 if { (eval echo configure:5275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5275   rm -rf conftest*
5276   eval "ac_cv_lib_$ac_lib_var=yes"
5277 else
5278   echo "configure: failed program was:" >&5
5279   cat conftest.$ac_ext >&5
5280   rm -rf conftest*
5281   eval "ac_cv_lib_$ac_lib_var=no"
5282 fi
5283 rm -f conftest*
5284 xe_check_libs=""
5285
5286 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5287   echo "$ac_t""yes" 1>&6
5288   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5289 else
5290   echo "$ac_t""no" 1>&6
5291 fi
5292
5293
5294     fi
5295
5296     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5297     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5298 echo "configure:5299: checking for shmat" >&5
5299
5300 cat > conftest.$ac_ext <<EOF
5301 #line 5302 "configure"
5302 #include "confdefs.h"
5303 /* System header to define __stub macros and hopefully few prototypes,
5304     which can conflict with char shmat(); below.  */
5305 #include <assert.h>
5306 /* Override any gcc2 internal prototype to avoid an error.  */
5307 /* We use char because int might match the return type of a gcc2
5308     builtin and then its argument prototype would still apply.  */
5309 char shmat();
5310
5311 int main() {
5312
5313 /* The GNU C library defines this for functions which it implements
5314     to always fail with ENOSYS.  Some functions are actually named
5315     something starting with __ and the normal name is an alias.  */
5316 #if defined (__stub_shmat) || defined (__stub___shmat)
5317 choke me
5318 #else
5319 shmat();
5320 #endif
5321
5322 ; return 0; }
5323 EOF
5324 if { (eval echo configure:5325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5325   rm -rf conftest*
5326   eval "ac_cv_func_shmat=yes"
5327 else
5328   echo "configure: failed program was:" >&5
5329   cat conftest.$ac_ext >&5
5330   rm -rf conftest*
5331   eval "ac_cv_func_shmat=no"
5332 fi
5333 rm -f conftest*
5334
5335 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5336   echo "$ac_t""yes" 1>&6
5337   :
5338 else
5339   echo "$ac_t""no" 1>&6
5340 fi
5341
5342     if test $ac_cv_func_shmat = no; then
5343       
5344 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5345 echo "configure:5346: checking for shmat in -lipc" >&5
5346 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5347
5348 xe_check_libs=" -lipc "
5349 cat > conftest.$ac_ext <<EOF
5350 #line 5351 "configure"
5351 #include "confdefs.h"
5352 /* Override any gcc2 internal prototype to avoid an error.  */
5353 /* We use char because int might match the return type of a gcc2
5354     builtin and then its argument prototype would still apply.  */
5355 char shmat();
5356
5357 int main() {
5358 shmat()
5359 ; return 0; }
5360 EOF
5361 if { (eval echo configure:5362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5362   rm -rf conftest*
5363   eval "ac_cv_lib_$ac_lib_var=yes"
5364 else
5365   echo "configure: failed program was:" >&5
5366   cat conftest.$ac_ext >&5
5367   rm -rf conftest*
5368   eval "ac_cv_lib_$ac_lib_var=no"
5369 fi
5370 rm -f conftest*
5371 xe_check_libs=""
5372
5373 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5374   echo "$ac_t""yes" 1>&6
5375   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5376 else
5377   echo "$ac_t""no" 1>&6
5378 fi
5379
5380
5381     fi
5382   fi
5383
5384   # Check for libraries that X11R6 Xt/Xaw programs need.
5385   ac_save_LDFLAGS="$LDFLAGS"
5386   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5387   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5388   # check for ICE first), but we must link in the order -lSM -lICE or
5389   # we get undefined symbols.  So assume we have SM if we have ICE.
5390   # These have to be linked with before -lX11, unlike the other
5391   # libraries we check for below, so use a different variable.
5392   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5393   
5394 xe_msg_checking="for IceConnectionNumber in -lICE"
5395 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5396 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5397 echo "configure:5398: checking "$xe_msg_checking"" >&5
5398 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5399
5400 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5401 cat > conftest.$ac_ext <<EOF
5402 #line 5403 "configure"
5403 #include "confdefs.h"
5404 /* Override any gcc2 internal prototype to avoid an error.  */
5405 /* We use char because int might match the return type of a gcc2
5406     builtin and then its argument prototype would still apply.  */
5407 char IceConnectionNumber();
5408
5409 int main() {
5410 IceConnectionNumber()
5411 ; return 0; }
5412 EOF
5413 if { (eval echo configure:5414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5414   rm -rf conftest*
5415   eval "ac_cv_lib_$ac_lib_var=yes"
5416 else
5417   echo "configure: failed program was:" >&5
5418   cat conftest.$ac_ext >&5
5419   rm -rf conftest*
5420   eval "ac_cv_lib_$ac_lib_var=no"
5421 fi
5422 rm -f conftest*
5423 xe_check_libs=""
5424
5425 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5426   echo "$ac_t""yes" 1>&6
5427   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5428 else
5429   echo "$ac_t""no" 1>&6
5430 fi
5431
5432
5433   LDFLAGS="$ac_save_LDFLAGS"
5434
5435 fi
5436  # Autoconf claims to find X library and include dirs for us.
5437   if test "$no_x" = "yes"
5438   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5439   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5440   fi
5441 fi
5442
5443 case "$with_x11" in
5444   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5445   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5446 esac
5447
5448 if test "$with_x11" = "yes"; then
5449   { test "$extra_verbose" = "yes" && cat << \EOF
5450     Defining HAVE_X_WINDOWS
5451 EOF
5452 cat >> confdefs.h <<\EOF
5453 #define HAVE_X_WINDOWS 1
5454 EOF
5455 }
5456
5457   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5458   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5459
5460       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5461     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5462     if test -d "$lib_dir" -a -d "$inc_dir"; then
5463       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5464         x_libraries="$lib_dir $x_libraries"
5465         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5466       esac
5467       case "$x_includes" in "$inc_dir"* ) ;; *)
5468         x_includes="$inc_dir $x_includes"
5469         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5470       esac
5471       break;       fi
5472   done
5473
5474     for rel in "X11R6" "X11R5" "X11R4"; do
5475     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5476     if test -d "$lib_dir" -a -d "$inc_dir"; then
5477       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5478         x_libraries="$x_libraries $lib_dir"
5479         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5480       esac
5481       case "$x_includes" in "$inc_dir"* ) ;; *)
5482         x_includes="$x_includes $inc_dir"
5483         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5484       esac
5485       break;     fi
5486   done
5487
5488     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
5489
5490   ld_switch_x_site="$X_LIBS"
5491
5492   
5493 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5494     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5495   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5496   
5497         runpath="" runpath_dirs=""
5498   if test -n "$LD_RUN_PATH"; then
5499     runpath="$LD_RUN_PATH"
5500   elif test "$GCC" = "yes"; then
5501         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5502     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5503     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5504     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5505       case "$arg" in P,* | -L* | -R* )
5506         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5507           {
5508 xe_runpath_dir="$dir"
5509   test "$xe_runpath_dir" != "/lib"     -a \
5510         "$xe_runpath_dir" != "/usr/lib" -a \
5511         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5512   eval "$xe_add_unique_runpath_dir"
5513 }
5514         done ;;
5515       esac
5516     done
5517     ld_switch_run="$ld_switch_run_save"
5518     rm -f conftest*
5519   else
5520         for arg in $ld_switch_site $ld_switch_x_site; do
5521       case "$arg" in -L*) {
5522 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5523   test "$xe_runpath_dir" != "/lib"     -a \
5524         "$xe_runpath_dir" != "/usr/lib" -a \
5525         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5526   eval "$xe_add_unique_runpath_dir"
5527 };; esac
5528     done
5529         if test "$opsys $need_motif" = "sol2 yes"; then
5530       xe_runpath_dir="/opt/SUNWdt/lib";
5531       eval "$xe_add_unique_runpath_dir";
5532     fi
5533   fi 
5534   if test -n "$runpath"; then
5535     ld_switch_run="${dash_r}${runpath}"
5536     
5537 if test "$GCC" = "yes"; then
5538   set x $ld_switch_run; shift; ld_switch_run=""
5539   while test -n "$1"; do
5540     case $1 in
5541       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5542       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5543       -Xlinker* ) ;;
5544       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5545     esac
5546     shift
5547   done
5548 fi
5549     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5550   fi
5551 fi
5552
5553
5554   if test "$extra_verbose" = "yes"; then
5555     echo; echo "X11 compilation variables:"
5556     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5557     echo
5558   fi
5559
5560             bitmapdirs=
5561   if test "$x_includes" != NONE; then
5562     for i in $x_includes; do
5563       if test -d "$i/bitmaps"; then
5564         bitmapdirs="$i/bitmaps:$bitmapdirs"
5565       fi
5566       if test -d "$i/X11/bitmaps"; then
5567         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5568       fi
5569     done
5570     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5571   fi
5572   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5573     Defining BITMAPDIR = "$bitmapdirs"
5574 EOF
5575 cat >> confdefs.h <<EOF
5576 #define BITMAPDIR "$bitmapdirs"
5577 EOF
5578 }
5579
5580
5581     echo "checking for X defines extracted by xmkmf" 1>&6
5582 echo "configure:5583: checking for X defines extracted by xmkmf" >&5
5583   rm -fr conftestdir
5584   if mkdir conftestdir; then
5585     cd conftestdir
5586     cat > Imakefile <<'EOF'
5587 xetest:
5588         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5589 EOF
5590     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5591       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5592       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5593     fi
5594     cd ..
5595     rm -fr conftestdir
5596     for word in $xmkmf_defines; do
5597       case "$word" in
5598         -D*=* ) ;;
5599         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5600               { test "$extra_verbose" = "yes" && cat << EOF
5601     Defining $word
5602 EOF
5603 cat >> confdefs.h <<EOF
5604 #define $word 1
5605 EOF
5606 }
5607  ;;
5608       esac
5609     done
5610   fi
5611
5612     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5613 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5614 echo "configure:5615: checking for X11/Intrinsic.h" >&5
5615
5616 cat > conftest.$ac_ext <<EOF
5617 #line 5618 "configure"
5618 #include "confdefs.h"
5619 #include <X11/Intrinsic.h>
5620 EOF
5621 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5622 { (eval echo configure:5623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5623 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5624 if test -z "$ac_err"; then
5625   rm -rf conftest*
5626   eval "ac_cv_header_$ac_safe=yes"
5627 else
5628   echo "$ac_err" >&5
5629   echo "configure: failed program was:" >&5
5630   cat conftest.$ac_ext >&5
5631   rm -rf conftest*
5632   eval "ac_cv_header_$ac_safe=no"
5633 fi
5634 rm -f conftest*
5635 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5636   echo "$ac_t""yes" 1>&6
5637   :
5638 else
5639   echo "$ac_t""no" 1>&6
5640 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5641 fi
5642
5643
5644       
5645 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5646 echo "configure:5647: checking for XOpenDisplay in -lX11" >&5
5647 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5648
5649 xe_check_libs=" -lX11 "
5650 cat > conftest.$ac_ext <<EOF
5651 #line 5652 "configure"
5652 #include "confdefs.h"
5653 /* Override any gcc2 internal prototype to avoid an error.  */
5654 /* We use char because int might match the return type of a gcc2
5655     builtin and then its argument prototype would still apply.  */
5656 char XOpenDisplay();
5657
5658 int main() {
5659 XOpenDisplay()
5660 ; return 0; }
5661 EOF
5662 if { (eval echo configure:5663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5663   rm -rf conftest*
5664   eval "ac_cv_lib_$ac_lib_var=yes"
5665 else
5666   echo "configure: failed program was:" >&5
5667   cat conftest.$ac_ext >&5
5668   rm -rf conftest*
5669   eval "ac_cv_lib_$ac_lib_var=no"
5670 fi
5671 rm -f conftest*
5672 xe_check_libs=""
5673
5674 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5675   echo "$ac_t""yes" 1>&6
5676   have_lib_x11=yes
5677 else
5678   echo "$ac_t""no" 1>&6
5679 fi
5680
5681
5682   if test "$have_lib_x11" != "yes"; then
5683     
5684 xe_msg_checking="for XGetFontProperty in -lX11"
5685 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5686 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5687 echo "configure:5688: checking "$xe_msg_checking"" >&5
5688 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5689
5690 xe_check_libs=" -lX11 -b i486-linuxaout"
5691 cat > conftest.$ac_ext <<EOF
5692 #line 5693 "configure"
5693 #include "confdefs.h"
5694 /* Override any gcc2 internal prototype to avoid an error.  */
5695 /* We use char because int might match the return type of a gcc2
5696     builtin and then its argument prototype would still apply.  */
5697 char XGetFontProperty();
5698
5699 int main() {
5700 XGetFontProperty()
5701 ; return 0; }
5702 EOF
5703 if { (eval echo configure:5704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5704   rm -rf conftest*
5705   eval "ac_cv_lib_$ac_lib_var=yes"
5706 else
5707   echo "configure: failed program was:" >&5
5708   cat conftest.$ac_ext >&5
5709   rm -rf conftest*
5710   eval "ac_cv_lib_$ac_lib_var=no"
5711 fi
5712 rm -f conftest*
5713 xe_check_libs=""
5714
5715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5716   echo "$ac_t""yes" 1>&6
5717   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5718 else
5719   echo "$ac_t""no" 1>&6
5720 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5721 fi
5722
5723
5724   fi
5725   libs_x="-lX11"
5726   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5727
5728     
5729 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5730 echo "configure:5731: checking for XShapeSelectInput in -lXext" >&5
5731 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5732
5733 xe_check_libs=" -lXext "
5734 cat > conftest.$ac_ext <<EOF
5735 #line 5736 "configure"
5736 #include "confdefs.h"
5737 /* Override any gcc2 internal prototype to avoid an error.  */
5738 /* We use char because int might match the return type of a gcc2
5739     builtin and then its argument prototype would still apply.  */
5740 char XShapeSelectInput();
5741
5742 int main() {
5743 XShapeSelectInput()
5744 ; return 0; }
5745 EOF
5746 if { (eval echo configure:5747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5747   rm -rf conftest*
5748   eval "ac_cv_lib_$ac_lib_var=yes"
5749 else
5750   echo "configure: failed program was:" >&5
5751   cat conftest.$ac_ext >&5
5752   rm -rf conftest*
5753   eval "ac_cv_lib_$ac_lib_var=no"
5754 fi
5755 rm -f conftest*
5756 xe_check_libs=""
5757
5758 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5759   echo "$ac_t""yes" 1>&6
5760   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5761 else
5762   echo "$ac_t""no" 1>&6
5763 fi
5764
5765
5766
5767     
5768 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5769 echo "configure:5770: checking for XtOpenDisplay in -lXt" >&5
5770 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5771
5772 xe_check_libs=" -lXt "
5773 cat > conftest.$ac_ext <<EOF
5774 #line 5775 "configure"
5775 #include "confdefs.h"
5776 /* Override any gcc2 internal prototype to avoid an error.  */
5777 /* We use char because int might match the return type of a gcc2
5778     builtin and then its argument prototype would still apply.  */
5779 char XtOpenDisplay();
5780
5781 int main() {
5782 XtOpenDisplay()
5783 ; return 0; }
5784 EOF
5785 if { (eval echo configure:5786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5786   rm -rf conftest*
5787   eval "ac_cv_lib_$ac_lib_var=yes"
5788 else
5789   echo "configure: failed program was:" >&5
5790   cat conftest.$ac_ext >&5
5791   rm -rf conftest*
5792   eval "ac_cv_lib_$ac_lib_var=no"
5793 fi
5794 rm -f conftest*
5795 xe_check_libs=""
5796
5797 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5798   echo "$ac_t""yes" 1>&6
5799   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5800 else
5801   echo "$ac_t""no" 1>&6
5802 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5803 fi
5804
5805
5806
5807   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5808 echo "configure:5809: checking the version of X11 being used" >&5
5809   cat > conftest.$ac_ext <<EOF
5810 #line 5811 "configure"
5811 #include "confdefs.h"
5812 #include <X11/Intrinsic.h>
5813     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5814 EOF
5815 if { (eval echo configure:5816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5816 then
5817   ./conftest foobar; x11_release=$?
5818 else
5819   conftest_rc="$?"
5820   echo "configure: failed program was:" >&5
5821   cat conftest.$ac_ext >&5
5822   rm -fr conftest*
5823   x11_release=4
5824 fi
5825 rm -fr conftest*
5826   echo "$ac_t""R${x11_release}" 1>&6
5827   { test "$extra_verbose" = "yes" && cat << EOF
5828     Defining THIS_IS_X11R${x11_release}
5829 EOF
5830 cat >> confdefs.h <<EOF
5831 #define THIS_IS_X11R${x11_release} 1
5832 EOF
5833 }
5834
5835
5836   for ac_hdr in X11/Xlocale.h
5837 do
5838 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5839 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5840 echo "configure:5841: checking for $ac_hdr" >&5
5841
5842 cat > conftest.$ac_ext <<EOF
5843 #line 5844 "configure"
5844 #include "confdefs.h"
5845 #include <$ac_hdr>
5846 EOF
5847 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5848 { (eval echo configure:5849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5849 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5850 if test -z "$ac_err"; then
5851   rm -rf conftest*
5852   eval "ac_cv_header_$ac_safe=yes"
5853 else
5854   echo "$ac_err" >&5
5855   echo "configure: failed program was:" >&5
5856   cat conftest.$ac_ext >&5
5857   rm -rf conftest*
5858   eval "ac_cv_header_$ac_safe=no"
5859 fi
5860 rm -f conftest*
5861 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5862   echo "$ac_t""yes" 1>&6
5863     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5864   { test "$extra_verbose" = "yes" && cat << EOF
5865     Defining $ac_tr_hdr
5866 EOF
5867 cat >> confdefs.h <<EOF
5868 #define $ac_tr_hdr 1
5869 EOF
5870 }
5871  
5872 else
5873   echo "$ac_t""no" 1>&6
5874 fi
5875 done
5876
5877
5878     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5879 echo "configure:5880: checking for XFree86" >&5
5880   if test -d "/usr/X386/include" -o \
5881           -f "/etc/XF86Config"    -o \
5882           -f "/etc/X11/XF86Config" -o \
5883           -f "/usr/X11R6/lib/X11/XF86Config"; then
5884     echo "$ac_t""yes" 1>&6
5885     { test "$extra_verbose" = "yes" && cat << \EOF
5886     Defining HAVE_XFREE386
5887 EOF
5888 cat >> confdefs.h <<\EOF
5889 #define HAVE_XFREE386 1
5890 EOF
5891 }
5892
5893   else
5894     echo "$ac_t""no" 1>&6
5895   fi
5896
5897     test -z "$with_xmu" && { 
5898 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5899 echo "configure:5900: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5900 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5901
5902 xe_check_libs=" -lXmu "
5903 cat > conftest.$ac_ext <<EOF
5904 #line 5905 "configure"
5905 #include "confdefs.h"
5906 /* Override any gcc2 internal prototype to avoid an error.  */
5907 /* We use char because int might match the return type of a gcc2
5908     builtin and then its argument prototype would still apply.  */
5909 char XmuReadBitmapDataFromFile();
5910
5911 int main() {
5912 XmuReadBitmapDataFromFile()
5913 ; return 0; }
5914 EOF
5915 if { (eval echo configure:5916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5916   rm -rf conftest*
5917   eval "ac_cv_lib_$ac_lib_var=yes"
5918 else
5919   echo "configure: failed program was:" >&5
5920   cat conftest.$ac_ext >&5
5921   rm -rf conftest*
5922   eval "ac_cv_lib_$ac_lib_var=no"
5923 fi
5924 rm -f conftest*
5925 xe_check_libs=""
5926
5927 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5928   echo "$ac_t""yes" 1>&6
5929   with_xmu=yes
5930 else
5931   echo "$ac_t""no" 1>&6
5932 with_xmu=no
5933 fi
5934
5935  }
5936   if test "$with_xmu" = "no"; then
5937     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5938    echo "    xemacs will be linked with \"xmu.o\""
5939  fi
5940   else
5941     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5942     { test "$extra_verbose" = "yes" && cat << \EOF
5943     Defining HAVE_XMU
5944 EOF
5945 cat >> confdefs.h <<\EOF
5946 #define HAVE_XMU 1
5947 EOF
5948 }
5949
5950   fi
5951
5952       
5953 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5954 echo "configure:5955: checking for main in -lXbsd" >&5
5955 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5956
5957 xe_check_libs=" -lXbsd "
5958 cat > conftest.$ac_ext <<EOF
5959 #line 5960 "configure"
5960 #include "confdefs.h"
5961
5962 int main() {
5963 main()
5964 ; return 0; }
5965 EOF
5966 if { (eval echo configure:5967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5967   rm -rf conftest*
5968   eval "ac_cv_lib_$ac_lib_var=yes"
5969 else
5970   echo "configure: failed program was:" >&5
5971   cat conftest.$ac_ext >&5
5972   rm -rf conftest*
5973   eval "ac_cv_lib_$ac_lib_var=no"
5974 fi
5975 rm -f conftest*
5976 xe_check_libs=""
5977
5978 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5979   echo "$ac_t""yes" 1>&6
5980   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5981 else
5982   echo "$ac_t""no" 1>&6
5983 fi
5984
5985
5986
5987     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5988         if test "$GCC" = "yes"; then
5989       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5990       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5991     else
5992       case "$CC" in
5993         "xlc" ) CC="xlc_r" ;;
5994         "xlC" ) CC="xlC_r" ;;
5995         "cc"  ) CC="cc_r" ;;
5996       esac
5997     fi
5998   fi
5999
6000 fi 
6001 if test "$with_msw" != "no"; then
6002   echo "checking for MS-Windows" 1>&6
6003 echo "configure:6004: checking for MS-Windows" >&5
6004   
6005 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
6006 echo "configure:6007: checking for main in -lgdi32" >&5
6007 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
6008
6009 xe_check_libs=" -lgdi32 "
6010 cat > conftest.$ac_ext <<EOF
6011 #line 6012 "configure"
6012 #include "confdefs.h"
6013
6014 int main() {
6015 main()
6016 ; return 0; }
6017 EOF
6018 if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6019   rm -rf conftest*
6020   eval "ac_cv_lib_$ac_lib_var=yes"
6021 else
6022   echo "configure: failed program was:" >&5
6023   cat conftest.$ac_ext >&5
6024   rm -rf conftest*
6025   eval "ac_cv_lib_$ac_lib_var=no"
6026 fi
6027 rm -f conftest*
6028 xe_check_libs=""
6029
6030 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6031   echo "$ac_t""yes" 1>&6
6032   with_msw=yes
6033 else
6034   echo "$ac_t""no" 1>&6
6035 fi
6036
6037
6038   if test "$with_msw" = "yes"; then
6039     { test "$extra_verbose" = "yes" && cat << \EOF
6040     Defining HAVE_MS_WINDOWS
6041 EOF
6042 cat >> confdefs.h <<\EOF
6043 #define HAVE_MS_WINDOWS 1
6044 EOF
6045 }
6046
6047     install_pp="$blddir/lib-src/installexe.sh"
6048     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
6049     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6050     if test "$window_system" != x11; then
6051         window_system=msw
6052         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6053             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6054    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6055  fi
6056         test "$with_menubars"   != "no" && with_menubars=msw \
6057             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6058    echo "    xemacs will be linked with \"menubar-msw.o\""
6059  fi
6060         test "$with_toolbars"   != "no" && with_toolbars=msw \
6061             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6062    echo "    xemacs will be linked with \"toolbar-msw.o\""
6063  fi
6064         test "$with_dialogs"   != "no" && with_dialogs=msw \
6065             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6066    echo "    xemacs will be linked with \"dialog-msw.o\""
6067  fi
6068         test "$with_widgets"   != "no" && with_widgets=msw
6069     else
6070         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6071    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6072  fi
6073         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6074    echo "    xemacs will be linked with \"menubar-msw.o\""
6075  fi
6076         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6077    echo "    xemacs will be linked with \"toolbar-msw.o\""
6078  fi
6079         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6080    echo "    xemacs will be linked with \"dialog-msw.o\""
6081  fi
6082     fi
6083         cat > conftest.$ac_ext <<EOF
6084 #line 6085 "configure"
6085 #include "confdefs.h"
6086 #include <fcntl.h>
6087     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6088 EOF
6089 if { (eval echo configure:6090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6090 then
6091   { test "$extra_verbose" = "yes" && cat << \EOF
6092     Defining HAVE_MSG_SELECT
6093 EOF
6094 cat >> confdefs.h <<\EOF
6095 #define HAVE_MSG_SELECT 1
6096 EOF
6097 }
6098
6099 else
6100   conftest_rc="$?"
6101   echo "configure: failed program was:" >&5
6102   cat conftest.$ac_ext >&5
6103 fi
6104 rm -fr conftest*
6105     const_is_losing=no
6106     with_file_coding=yes
6107     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
6108    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\""
6109  fi
6110   fi
6111 fi
6112
6113
6114
6115 test -z "$window_system" && window_system="none"
6116
6117 if test "$window_system" = "none"; then
6118   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6119   do
6120     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6121        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6122     fi
6123     eval "with_${feature}=no"
6124   done
6125 else
6126   test -z "$with_toolbars" && with_toolbars=yes
6127 fi
6128
6129 if test "$with_msw" != "yes"; then
6130   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6131   do
6132     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6133        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6134     fi
6135     eval "with_${feature}=no"
6136   done
6137 else
6138   :
6139 fi
6140
6141 if test "$with_x11" != "yes"; then
6142             for feature in tooltalk cde offix wmcommand xim xmu
6143   do
6144     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6145        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6146     fi
6147     eval "with_${feature}=no"
6148   done
6149 fi
6150
6151 bitmapdir=
6152
6153 case "$window_system" in
6154   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6155   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6156   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6157 esac
6158
6159 case "$x_libraries" in *X11R4* )
6160   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6161   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6162 esac
6163
6164 echo "checking for WM_COMMAND option" 1>&6
6165 echo "configure:6166: checking for WM_COMMAND option" >&5;
6166 if test "$with_wmcommand" != "no"; then
6167   { test "$extra_verbose" = "yes" && cat << \EOF
6168     Defining HAVE_WMCOMMAND
6169 EOF
6170 cat >> confdefs.h <<\EOF
6171 #define HAVE_WMCOMMAND 1
6172 EOF
6173 }
6174
6175 fi
6176
6177 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6178 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6179 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6180 echo "configure:6181: checking for X11/Xauth.h" >&5
6181
6182 cat > conftest.$ac_ext <<EOF
6183 #line 6184 "configure"
6184 #include "confdefs.h"
6185 #include <X11/Xauth.h>
6186 EOF
6187 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6188 { (eval echo configure:6189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6189 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6190 if test -z "$ac_err"; then
6191   rm -rf conftest*
6192   eval "ac_cv_header_$ac_safe=yes"
6193 else
6194   echo "$ac_err" >&5
6195   echo "configure: failed program was:" >&5
6196   cat conftest.$ac_ext >&5
6197   rm -rf conftest*
6198   eval "ac_cv_header_$ac_safe=no"
6199 fi
6200 rm -f conftest*
6201 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6202   echo "$ac_t""yes" 1>&6
6203   :
6204 else
6205   echo "$ac_t""no" 1>&6
6206 with_xauth=no
6207 fi
6208  }
6209 test -z "$with_xauth" && { 
6210 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6211 echo "configure:6212: checking for XauGetAuthByAddr in -lXau" >&5
6212 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6213
6214 xe_check_libs=" -lXau "
6215 cat > conftest.$ac_ext <<EOF
6216 #line 6217 "configure"
6217 #include "confdefs.h"
6218 /* Override any gcc2 internal prototype to avoid an error.  */
6219 /* We use char because int might match the return type of a gcc2
6220     builtin and then its argument prototype would still apply.  */
6221 char XauGetAuthByAddr();
6222
6223 int main() {
6224 XauGetAuthByAddr()
6225 ; return 0; }
6226 EOF
6227 if { (eval echo configure:6228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6228   rm -rf conftest*
6229   eval "ac_cv_lib_$ac_lib_var=yes"
6230 else
6231   echo "configure: failed program was:" >&5
6232   cat conftest.$ac_ext >&5
6233   rm -rf conftest*
6234   eval "ac_cv_lib_$ac_lib_var=no"
6235 fi
6236 rm -f conftest*
6237 xe_check_libs=""
6238
6239 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6240   echo "$ac_t""yes" 1>&6
6241   :
6242 else
6243   echo "$ac_t""no" 1>&6
6244 with_xauth=no
6245 fi
6246
6247  }
6248 test -z "$with_xauth" && with_xauth=yes
6249 if test "$with_xauth" = "yes"; then
6250   { test "$extra_verbose" = "yes" && cat << \EOF
6251     Defining HAVE_XAUTH
6252 EOF
6253 cat >> confdefs.h <<\EOF
6254 #define HAVE_XAUTH 1
6255 EOF
6256 }
6257
6258   
6259 T=""
6260 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
6261 libs_xauth="$T"
6262
6263 fi
6264
6265
6266
6267
6268 if test "$with_tooltalk" != "no" ; then
6269       for dir in "" "Tt/" "desktop/" ; do
6270     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6271 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6272 echo "configure:6273: checking for ${dir}tt_c.h" >&5
6273
6274 cat > conftest.$ac_ext <<EOF
6275 #line 6276 "configure"
6276 #include "confdefs.h"
6277 #include <${dir}tt_c.h>
6278 EOF
6279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6280 { (eval echo configure:6281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6282 if test -z "$ac_err"; then
6283   rm -rf conftest*
6284   eval "ac_cv_header_$ac_safe=yes"
6285 else
6286   echo "$ac_err" >&5
6287   echo "configure: failed program was:" >&5
6288   cat conftest.$ac_ext >&5
6289   rm -rf conftest*
6290   eval "ac_cv_header_$ac_safe=no"
6291 fi
6292 rm -f conftest*
6293 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6294   echo "$ac_t""yes" 1>&6
6295   tt_c_h_path="${dir}tt_c.h"; break
6296 else
6297   echo "$ac_t""no" 1>&6
6298 fi
6299
6300   done
6301   if test -z "$tt_c_h_path"; then
6302     if test "$with_tooltalk" = "yes"; then
6303       (echo "$progname: Usage error:"
6304 echo " " "Unable to find required tooltalk header files."
6305 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6306     fi
6307     with_tooltalk=no
6308   fi
6309 fi
6310 if test "$with_tooltalk" != "no" ; then
6311   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6312     
6313 xe_msg_checking="for tt_message_create in -ltt"
6314 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6315 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6316 echo "configure:6317: checking "$xe_msg_checking"" >&5
6317 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6318
6319 xe_check_libs=" -ltt $extra_libs"
6320 cat > conftest.$ac_ext <<EOF
6321 #line 6322 "configure"
6322 #include "confdefs.h"
6323 /* Override any gcc2 internal prototype to avoid an error.  */
6324 /* We use char because int might match the return type of a gcc2
6325     builtin and then its argument prototype would still apply.  */
6326 char tt_message_create();
6327
6328 int main() {
6329 tt_message_create()
6330 ; return 0; }
6331 EOF
6332 if { (eval echo configure:6333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6333   rm -rf conftest*
6334   eval "ac_cv_lib_$ac_lib_var=yes"
6335 else
6336   echo "configure: failed program was:" >&5
6337   cat conftest.$ac_ext >&5
6338   rm -rf conftest*
6339   eval "ac_cv_lib_$ac_lib_var=no"
6340 fi
6341 rm -f conftest*
6342 xe_check_libs=""
6343
6344 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6345   echo "$ac_t""yes" 1>&6
6346   tt_libs="-ltt $extra_libs"; break
6347 else
6348   echo "$ac_t""no" 1>&6
6349 :
6350 fi
6351
6352
6353   done
6354   if test -z "$tt_libs"; then
6355     if test "$with_tooltalk" = "yes"; then
6356       (echo "$progname: Usage error:"
6357 echo " " "Unable to find required tooltalk libraries."
6358 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6359     fi
6360     with_tooltalk=no
6361   fi
6362 fi
6363 test -z "$with_tooltalk" && with_tooltalk=yes
6364 if test "$with_tooltalk" = "yes"; then
6365   { test "$extra_verbose" = "yes" && cat << \EOF
6366     Defining TOOLTALK
6367 EOF
6368 cat >> confdefs.h <<\EOF
6369 #define TOOLTALK 1
6370 EOF
6371 }
6372
6373   { test "$extra_verbose" = "yes" && cat << EOF
6374     Defining TT_C_H_PATH = "$tt_c_h_path"
6375 EOF
6376 cat >> confdefs.h <<EOF
6377 #define TT_C_H_PATH "$tt_c_h_path"
6378 EOF
6379 }
6380
6381   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6382   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6383    echo "    xemacs will be linked with \"tooltalk.o\""
6384  fi
6385 fi
6386
6387 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6388 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6389 echo "configure:6390: checking for Dt/Dt.h" >&5
6390
6391 cat > conftest.$ac_ext <<EOF
6392 #line 6393 "configure"
6393 #include "confdefs.h"
6394 #include <Dt/Dt.h>
6395 EOF
6396 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6397 { (eval echo configure:6398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6398 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6399 if test -z "$ac_err"; then
6400   rm -rf conftest*
6401   eval "ac_cv_header_$ac_safe=yes"
6402 else
6403   echo "$ac_err" >&5
6404   echo "configure: failed program was:" >&5
6405   cat conftest.$ac_ext >&5
6406   rm -rf conftest*
6407   eval "ac_cv_header_$ac_safe=no"
6408 fi
6409 rm -f conftest*
6410 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6411   echo "$ac_t""yes" 1>&6
6412   :
6413 else
6414   echo "$ac_t""no" 1>&6
6415 with_cde=no
6416 fi
6417  }
6418 test -z "$with_cde" && { 
6419 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6420 echo "configure:6421: checking for DtDndDragStart in -lDtSvc" >&5
6421 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6422
6423 xe_check_libs=" -lDtSvc "
6424 cat > conftest.$ac_ext <<EOF
6425 #line 6426 "configure"
6426 #include "confdefs.h"
6427 /* Override any gcc2 internal prototype to avoid an error.  */
6428 /* We use char because int might match the return type of a gcc2
6429     builtin and then its argument prototype would still apply.  */
6430 char DtDndDragStart();
6431
6432 int main() {
6433 DtDndDragStart()
6434 ; return 0; }
6435 EOF
6436 if { (eval echo configure:6437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6437   rm -rf conftest*
6438   eval "ac_cv_lib_$ac_lib_var=yes"
6439 else
6440   echo "configure: failed program was:" >&5
6441   cat conftest.$ac_ext >&5
6442   rm -rf conftest*
6443   eval "ac_cv_lib_$ac_lib_var=no"
6444 fi
6445 rm -f conftest*
6446 xe_check_libs=""
6447
6448 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6449   echo "$ac_t""yes" 1>&6
6450   :
6451 else
6452   echo "$ac_t""no" 1>&6
6453 with_cde=no
6454 fi
6455
6456  }
6457 test -z "$with_cde" && with_cde=yes
6458 if test "$with_dragndrop" = no; then
6459   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6460   with_cde=no
6461 fi
6462 if test "$with_cde" = "yes" ; then
6463   { test "$extra_verbose" = "yes" && cat << \EOF
6464     Defining HAVE_CDE
6465 EOF
6466 cat >> confdefs.h <<\EOF
6467 #define HAVE_CDE 1
6468 EOF
6469 }
6470
6471   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6472   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6473   with_tooltalk=yes # CDE requires Tooltalk
6474   need_motif=yes    # CDE requires Motif
6475 fi
6476
6477 test "$window_system" != "x11" && with_offix=no
6478 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6479   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6480   with_offix=no
6481 fi
6482 if test "$with_dragndrop" = no; then
6483   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6484   with_offix=no
6485 fi
6486 if test "$with_cde" = yes; then
6487   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6488   with_offix=no
6489 fi
6490 test -z "$with_offix" && with_offix=no
6491 if test "$with_offix" = "yes"; then
6492   { test "$extra_verbose" = "yes" && cat << \EOF
6493     Defining HAVE_OFFIX_DND
6494 EOF
6495 cat >> confdefs.h <<\EOF
6496 #define HAVE_OFFIX_DND 1
6497 EOF
6498 }
6499
6500   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6501   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6502 fi
6503
6504 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6505 echo "configure:6506: checking if drag and drop API is needed" >&5
6506 if test "$with_dragndrop" != "no" ; then
6507   if test -n "$dragndrop_proto" ; then
6508     with_dragndrop=yes
6509     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6510     { test "$extra_verbose" = "yes" && cat << \EOF
6511     Defining HAVE_DRAGNDROP
6512 EOF
6513 cat >> confdefs.h <<\EOF
6514 #define HAVE_DRAGNDROP 1
6515 EOF
6516 }
6517
6518     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6519   else
6520     with_dragndrop=no
6521     echo "$ac_t""no" 1>&6
6522   fi
6523 fi
6524
6525 echo "checking for LDAP" 1>&6
6526 echo "configure:6527: checking for LDAP" >&5
6527 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6528 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6529 echo "configure:6530: checking for ldap.h" >&5
6530
6531 cat > conftest.$ac_ext <<EOF
6532 #line 6533 "configure"
6533 #include "confdefs.h"
6534 #include <ldap.h>
6535 EOF
6536 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6537 { (eval echo configure:6538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6538 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6539 if test -z "$ac_err"; then
6540   rm -rf conftest*
6541   eval "ac_cv_header_$ac_safe=yes"
6542 else
6543   echo "$ac_err" >&5
6544   echo "configure: failed program was:" >&5
6545   cat conftest.$ac_ext >&5
6546   rm -rf conftest*
6547   eval "ac_cv_header_$ac_safe=no"
6548 fi
6549 rm -f conftest*
6550 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6551   echo "$ac_t""yes" 1>&6
6552   :
6553 else
6554   echo "$ac_t""no" 1>&6
6555 with_ldap=no
6556 fi
6557  }
6558 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6559 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6560 echo "configure:6561: checking for lber.h" >&5
6561
6562 cat > conftest.$ac_ext <<EOF
6563 #line 6564 "configure"
6564 #include "confdefs.h"
6565 #include <lber.h>
6566 EOF
6567 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6568 { (eval echo configure:6569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6569 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6570 if test -z "$ac_err"; then
6571   rm -rf conftest*
6572   eval "ac_cv_header_$ac_safe=yes"
6573 else
6574   echo "$ac_err" >&5
6575   echo "configure: failed program was:" >&5
6576   cat conftest.$ac_ext >&5
6577   rm -rf conftest*
6578   eval "ac_cv_header_$ac_safe=no"
6579 fi
6580 rm -f conftest*
6581 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6582   echo "$ac_t""yes" 1>&6
6583   :
6584 else
6585   echo "$ac_t""no" 1>&6
6586 with_ldap=no
6587 fi
6588  }
6589 if test "$with_ldap" != "no"; then
6590   
6591 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
6592 echo "configure:6593: checking for ldap_search in -lldap" >&5
6593 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
6594
6595 xe_check_libs=" -lldap "
6596 cat > conftest.$ac_ext <<EOF
6597 #line 6598 "configure"
6598 #include "confdefs.h"
6599 /* Override any gcc2 internal prototype to avoid an error.  */
6600 /* We use char because int might match the return type of a gcc2
6601     builtin and then its argument prototype would still apply.  */
6602 char ldap_search();
6603
6604 int main() {
6605 ldap_search()
6606 ; return 0; }
6607 EOF
6608 if { (eval echo configure:6609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6609   rm -rf conftest*
6610   eval "ac_cv_lib_$ac_lib_var=yes"
6611 else
6612   echo "configure: failed program was:" >&5
6613   cat conftest.$ac_ext >&5
6614   rm -rf conftest*
6615   eval "ac_cv_lib_$ac_lib_var=no"
6616 fi
6617 rm -f conftest*
6618 xe_check_libs=""
6619
6620 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6621   echo "$ac_t""yes" 1>&6
6622   with_ldap_nolber=yes
6623 else
6624   echo "$ac_t""no" 1>&6
6625 with_ldap_nolber=no
6626 fi
6627
6628
6629   test "$with_ldap_nolber" = "no" && { 
6630 xe_msg_checking="for ldap_open in -lldap"
6631 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6632 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6633 echo "configure:6634: checking "$xe_msg_checking"" >&5
6634 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6635
6636 xe_check_libs=" -lldap -llber"
6637 cat > conftest.$ac_ext <<EOF
6638 #line 6639 "configure"
6639 #include "confdefs.h"
6640 /* Override any gcc2 internal prototype to avoid an error.  */
6641 /* We use char because int might match the return type of a gcc2
6642     builtin and then its argument prototype would still apply.  */
6643 char ldap_open();
6644
6645 int main() {
6646 ldap_open()
6647 ; return 0; }
6648 EOF
6649 if { (eval echo configure:6650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6650   rm -rf conftest*
6651   eval "ac_cv_lib_$ac_lib_var=yes"
6652 else
6653   echo "configure: failed program was:" >&5
6654   cat conftest.$ac_ext >&5
6655   rm -rf conftest*
6656   eval "ac_cv_lib_$ac_lib_var=no"
6657 fi
6658 rm -f conftest*
6659 xe_check_libs=""
6660
6661 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6662   echo "$ac_t""yes" 1>&6
6663   with_ldap_lber=yes
6664 else
6665   echo "$ac_t""no" 1>&6
6666 with_ldap_lber=no
6667 fi
6668
6669  }
6670   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { 
6671 xe_msg_checking="for ldap_open in -lldap"
6672 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
6673 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6674 echo "configure:6675: checking "$xe_msg_checking"" >&5
6675 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6676
6677 xe_check_libs=" -lldap -llber -lkrb"
6678 cat > conftest.$ac_ext <<EOF
6679 #line 6680 "configure"
6680 #include "confdefs.h"
6681 /* Override any gcc2 internal prototype to avoid an error.  */
6682 /* We use char because int might match the return type of a gcc2
6683     builtin and then its argument prototype would still apply.  */
6684 char ldap_open();
6685
6686 int main() {
6687 ldap_open()
6688 ; return 0; }
6689 EOF
6690 if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6691   rm -rf conftest*
6692   eval "ac_cv_lib_$ac_lib_var=yes"
6693 else
6694   echo "configure: failed program was:" >&5
6695   cat conftest.$ac_ext >&5
6696   rm -rf conftest*
6697   eval "ac_cv_lib_$ac_lib_var=no"
6698 fi
6699 rm -f conftest*
6700 xe_check_libs=""
6701
6702 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6703   echo "$ac_t""yes" 1>&6
6704   with_ldap_krb=yes
6705 else
6706   echo "$ac_t""no" 1>&6
6707 with_ldap_krb=no
6708 fi
6709
6710  }
6711   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { 
6712 xe_msg_checking="for ldap_open in -lldap"
6713 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
6714 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6715 echo "configure:6716: checking "$xe_msg_checking"" >&5
6716 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6717
6718 xe_check_libs=" -lldap -llber -lkrb -ldes"
6719 cat > conftest.$ac_ext <<EOF
6720 #line 6721 "configure"
6721 #include "confdefs.h"
6722 /* Override any gcc2 internal prototype to avoid an error.  */
6723 /* We use char because int might match the return type of a gcc2
6724     builtin and then its argument prototype would still apply.  */
6725 char ldap_open();
6726
6727 int main() {
6728 ldap_open()
6729 ; return 0; }
6730 EOF
6731 if { (eval echo configure:6732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6732   rm -rf conftest*
6733   eval "ac_cv_lib_$ac_lib_var=yes"
6734 else
6735   echo "configure: failed program was:" >&5
6736   cat conftest.$ac_ext >&5
6737   rm -rf conftest*
6738   eval "ac_cv_lib_$ac_lib_var=no"
6739 fi
6740 rm -f conftest*
6741 xe_check_libs=""
6742
6743 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6744   echo "$ac_t""yes" 1>&6
6745   with_ldap_krbdes=yes
6746 else
6747   echo "$ac_t""no" 1>&6
6748 with_ldap_krbdes=no
6749 fi
6750
6751  }
6752   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
6753 fi
6754 if test "$with_ldap" = "yes"; then
6755   { test "$extra_verbose" = "yes" && cat << \EOF
6756     Defining HAVE_LDAP
6757 EOF
6758 cat >> confdefs.h <<\EOF
6759 #define HAVE_LDAP 1
6760 EOF
6761 }
6762
6763   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6764    echo "    xemacs will be linked with \"eldap.o\""
6765  fi
6766   if test "$with_ldap_nolber" = "yes" ; then
6767     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6768   else
6769     if test "$with_ldap_krb" = "yes" ; then
6770       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
6771     fi
6772     if test "$with_ldap_krbdes" = "yes" ; then
6773       LIBS="-ldes $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldes\" to \$LIBS"; fi
6774       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
6775     fi
6776     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6777     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6778   fi
6779   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
6780 do
6781 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6782 echo "configure:6783: checking for $ac_func" >&5
6783
6784 cat > conftest.$ac_ext <<EOF
6785 #line 6786 "configure"
6786 #include "confdefs.h"
6787 /* System header to define __stub macros and hopefully few prototypes,
6788     which can conflict with char $ac_func(); below.  */
6789 #include <assert.h>
6790 /* Override any gcc2 internal prototype to avoid an error.  */
6791 /* We use char because int might match the return type of a gcc2
6792     builtin and then its argument prototype would still apply.  */
6793 char $ac_func();
6794
6795 int main() {
6796
6797 /* The GNU C library defines this for functions which it implements
6798     to always fail with ENOSYS.  Some functions are actually named
6799     something starting with __ and the normal name is an alias.  */
6800 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6801 choke me
6802 #else
6803 $ac_func();
6804 #endif
6805
6806 ; return 0; }
6807 EOF
6808 if { (eval echo configure:6809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6809   rm -rf conftest*
6810   eval "ac_cv_func_$ac_func=yes"
6811 else
6812   echo "configure: failed program was:" >&5
6813   cat conftest.$ac_ext >&5
6814   rm -rf conftest*
6815   eval "ac_cv_func_$ac_func=no"
6816 fi
6817 rm -f conftest*
6818
6819 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6820   echo "$ac_t""yes" 1>&6
6821     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6822   { test "$extra_verbose" = "yes" && cat << EOF
6823     Defining $ac_tr_func
6824 EOF
6825 cat >> confdefs.h <<EOF
6826 #define $ac_tr_func 1
6827 EOF
6828 }
6829  
6830 else
6831   echo "$ac_t""no" 1>&6
6832 fi
6833 done
6834
6835 fi
6836
6837
6838 if test "$window_system" != "none"; then
6839   echo "checking for graphics libraries" 1>&6
6840 echo "configure:6841: checking for graphics libraries" >&5
6841
6842     xpm_problem=""
6843   if test -z "$with_xpm"; then
6844     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6845 echo "configure:6846: checking for Xpm - no older than 3.4f" >&5
6846     xe_check_libs=-lXpm
6847     cat > conftest.$ac_ext <<EOF
6848 #line 6849 "configure"
6849 #include "confdefs.h"
6850 #include <X11/xpm.h>
6851     int main(int c, char **v) {
6852     return c == 1 ? 0 :
6853       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6854       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6855 EOF
6856 if { (eval echo configure:6857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6857 then
6858   ./conftest dummy_arg; xpm_status=$?;
6859       if test "$xpm_status" = "0"; then
6860         with_xpm=yes;
6861       else
6862         with_xpm=no;
6863         if test "$xpm_status" = "1"; then
6864           xpm_problem="Xpm library version and header file version don't match!"
6865         elif test "$xpm_status" = "2"; then
6866           xpm_problem="Xpm library version is too old!"
6867         else
6868           xpm_problem="Internal xpm detection logic error!"
6869         fi
6870         echo "
6871 *** WARNING *** $xpm_problem
6872   I'm not touching that with a 10-foot pole!
6873   If you really want to use the installed version of Xpm, rerun
6874   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6875     fi
6876 else
6877   conftest_rc="$?"
6878   echo "configure: failed program was:" >&5
6879   cat conftest.$ac_ext >&5
6880   rm -fr conftest*
6881   with_xpm=no
6882 fi
6883 rm -fr conftest*
6884     xe_check_libs=
6885     echo "$ac_t""$with_xpm" 1>&6
6886   fi
6887   if test "$with_xpm" = "yes"; then
6888     { test "$extra_verbose" = "yes" && cat << \EOF
6889     Defining HAVE_XPM
6890 EOF
6891 cat >> confdefs.h <<\EOF
6892 #define HAVE_XPM 1
6893 EOF
6894 }
6895
6896     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6897     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6898 echo "configure:6899: checking for \"FOR_MSW\" xpm" >&5
6899     xe_check_libs=-lXpm
6900     cat > conftest.$ac_ext <<EOF
6901 #line 6902 "configure"
6902 #include "confdefs.h"
6903
6904 int main() {
6905 XpmCreatePixmapFromData()
6906 ; return 0; }
6907 EOF
6908 if { (eval echo configure:6909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6909   rm -rf conftest*
6910   xpm_for_msw=no
6911 else
6912   echo "configure: failed program was:" >&5
6913   cat conftest.$ac_ext >&5
6914   rm -rf conftest*
6915   xpm_for_msw=yes
6916 fi
6917 rm -f conftest*
6918     xe_check_libs=
6919     echo "$ac_t""$xpm_for_msw" 1>&6
6920     if test "$xpm_for_msw" = "yes"; then
6921       { test "$extra_verbose" = "yes" && cat << \EOF
6922     Defining FOR_MSW
6923 EOF
6924 cat >> confdefs.h <<\EOF
6925 #define FOR_MSW 1
6926 EOF
6927 }
6928
6929     fi
6930   fi
6931
6932     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6933 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6934 echo "configure:6935: checking for compface.h" >&5
6935
6936 cat > conftest.$ac_ext <<EOF
6937 #line 6938 "configure"
6938 #include "confdefs.h"
6939 #include <compface.h>
6940 EOF
6941 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6942 { (eval echo configure:6943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6943 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6944 if test -z "$ac_err"; then
6945   rm -rf conftest*
6946   eval "ac_cv_header_$ac_safe=yes"
6947 else
6948   echo "$ac_err" >&5
6949   echo "configure: failed program was:" >&5
6950   cat conftest.$ac_ext >&5
6951   rm -rf conftest*
6952   eval "ac_cv_header_$ac_safe=no"
6953 fi
6954 rm -f conftest*
6955 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6956   echo "$ac_t""yes" 1>&6
6957   :
6958 else
6959   echo "$ac_t""no" 1>&6
6960 with_xface=no
6961 fi
6962  }
6963   test -z "$with_xface" && { 
6964 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6965 echo "configure:6966: checking for UnGenFace in -lcompface" >&5
6966 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6967
6968 xe_check_libs=" -lcompface "
6969 cat > conftest.$ac_ext <<EOF
6970 #line 6971 "configure"
6971 #include "confdefs.h"
6972 /* Override any gcc2 internal prototype to avoid an error.  */
6973 /* We use char because int might match the return type of a gcc2
6974     builtin and then its argument prototype would still apply.  */
6975 char UnGenFace();
6976
6977 int main() {
6978 UnGenFace()
6979 ; return 0; }
6980 EOF
6981 if { (eval echo configure:6982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6982   rm -rf conftest*
6983   eval "ac_cv_lib_$ac_lib_var=yes"
6984 else
6985   echo "configure: failed program was:" >&5
6986   cat conftest.$ac_ext >&5
6987   rm -rf conftest*
6988   eval "ac_cv_lib_$ac_lib_var=no"
6989 fi
6990 rm -f conftest*
6991 xe_check_libs=""
6992
6993 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6994   echo "$ac_t""yes" 1>&6
6995   : 
6996 else
6997   echo "$ac_t""no" 1>&6
6998 with_xface=no
6999 fi
7000
7001  }
7002   test -z "$with_xface" && with_xface=yes
7003   if test "$with_xface" = "yes"; then
7004     { test "$extra_verbose" = "yes" && cat << \EOF
7005     Defining HAVE_XFACE
7006 EOF
7007 cat >> confdefs.h <<\EOF
7008 #define HAVE_XFACE 1
7009 EOF
7010 }
7011
7012     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7013   fi
7014
7015         if test "$with_gif" != "no"; then
7016     with_gif="yes"
7017     { test "$extra_verbose" = "yes" && cat << \EOF
7018     Defining HAVE_GIF
7019 EOF
7020 cat >> confdefs.h <<\EOF
7021 #define HAVE_GIF 1
7022 EOF
7023 }
7024
7025     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
7026    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
7027  fi
7028   fi
7029
7030       if test "$with_png $with_tiff" != "no no"; then
7031     
7032 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
7033 echo "configure:7034: checking for inflate in -lc" >&5
7034 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
7035
7036 xe_check_libs=" -lc "
7037 cat > conftest.$ac_ext <<EOF
7038 #line 7039 "configure"
7039 #include "confdefs.h"
7040 /* Override any gcc2 internal prototype to avoid an error.  */
7041 /* We use char because int might match the return type of a gcc2
7042     builtin and then its argument prototype would still apply.  */
7043 char inflate();
7044
7045 int main() {
7046 inflate()
7047 ; return 0; }
7048 EOF
7049 if { (eval echo configure:7050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7050   rm -rf conftest*
7051   eval "ac_cv_lib_$ac_lib_var=yes"
7052 else
7053   echo "configure: failed program was:" >&5
7054   cat conftest.$ac_ext >&5
7055   rm -rf conftest*
7056   eval "ac_cv_lib_$ac_lib_var=no"
7057 fi
7058 rm -f conftest*
7059 xe_check_libs=""
7060
7061 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7062   echo "$ac_t""yes" 1>&6
7063   :
7064 else
7065   echo "$ac_t""no" 1>&6
7066
7067 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
7068 echo "configure:7069: checking for inflate in -lz" >&5
7069 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
7070
7071 xe_check_libs=" -lz "
7072 cat > conftest.$ac_ext <<EOF
7073 #line 7074 "configure"
7074 #include "confdefs.h"
7075 /* Override any gcc2 internal prototype to avoid an error.  */
7076 /* We use char because int might match the return type of a gcc2
7077     builtin and then its argument prototype would still apply.  */
7078 char inflate();
7079
7080 int main() {
7081 inflate()
7082 ; return 0; }
7083 EOF
7084 if { (eval echo configure:7085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7085   rm -rf conftest*
7086   eval "ac_cv_lib_$ac_lib_var=yes"
7087 else
7088   echo "configure: failed program was:" >&5
7089   cat conftest.$ac_ext >&5
7090   rm -rf conftest*
7091   eval "ac_cv_lib_$ac_lib_var=no"
7092 fi
7093 rm -f conftest*
7094 xe_check_libs=""
7095
7096 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7097   echo "$ac_t""yes" 1>&6
7098   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
7099 else
7100   echo "$ac_t""no" 1>&6
7101
7102 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
7103 echo "configure:7104: checking for inflate in -lgz" >&5
7104 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
7105
7106 xe_check_libs=" -lgz "
7107 cat > conftest.$ac_ext <<EOF
7108 #line 7109 "configure"
7109 #include "confdefs.h"
7110 /* Override any gcc2 internal prototype to avoid an error.  */
7111 /* We use char because int might match the return type of a gcc2
7112     builtin and then its argument prototype would still apply.  */
7113 char inflate();
7114
7115 int main() {
7116 inflate()
7117 ; return 0; }
7118 EOF
7119 if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7120   rm -rf conftest*
7121   eval "ac_cv_lib_$ac_lib_var=yes"
7122 else
7123   echo "configure: failed program was:" >&5
7124   cat conftest.$ac_ext >&5
7125   rm -rf conftest*
7126   eval "ac_cv_lib_$ac_lib_var=no"
7127 fi
7128 rm -f conftest*
7129 xe_check_libs=""
7130
7131 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7132   echo "$ac_t""yes" 1>&6
7133   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
7134 else
7135   echo "$ac_t""no" 1>&6
7136 fi
7137
7138
7139 fi
7140
7141
7142 fi
7143
7144
7145   fi
7146
7147     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
7148 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
7149 echo "configure:7150: checking for jpeglib.h" >&5
7150
7151 cat > conftest.$ac_ext <<EOF
7152 #line 7153 "configure"
7153 #include "confdefs.h"
7154 #include <jpeglib.h>
7155 EOF
7156 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7157 { (eval echo configure:7158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7158 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7159 if test -z "$ac_err"; then
7160   rm -rf conftest*
7161   eval "ac_cv_header_$ac_safe=yes"
7162 else
7163   echo "$ac_err" >&5
7164   echo "configure: failed program was:" >&5
7165   cat conftest.$ac_ext >&5
7166   rm -rf conftest*
7167   eval "ac_cv_header_$ac_safe=no"
7168 fi
7169 rm -f conftest*
7170 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7171   echo "$ac_t""yes" 1>&6
7172   :
7173 else
7174   echo "$ac_t""no" 1>&6
7175 with_jpeg=no
7176 fi
7177  }
7178   test -z "$with_jpeg" && { 
7179 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7180 echo "configure:7181: checking for jpeg_destroy_decompress in -ljpeg" >&5
7181 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7182
7183 xe_check_libs=" -ljpeg "
7184 cat > conftest.$ac_ext <<EOF
7185 #line 7186 "configure"
7186 #include "confdefs.h"
7187 /* Override any gcc2 internal prototype to avoid an error.  */
7188 /* We use char because int might match the return type of a gcc2
7189     builtin and then its argument prototype would still apply.  */
7190 char jpeg_destroy_decompress();
7191
7192 int main() {
7193 jpeg_destroy_decompress()
7194 ; return 0; }
7195 EOF
7196 if { (eval echo configure:7197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7197   rm -rf conftest*
7198   eval "ac_cv_lib_$ac_lib_var=yes"
7199 else
7200   echo "configure: failed program was:" >&5
7201   cat conftest.$ac_ext >&5
7202   rm -rf conftest*
7203   eval "ac_cv_lib_$ac_lib_var=no"
7204 fi
7205 rm -f conftest*
7206 xe_check_libs=""
7207
7208 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7209   echo "$ac_t""yes" 1>&6
7210   :
7211 else
7212   echo "$ac_t""no" 1>&6
7213 with_jpeg=no
7214 fi
7215
7216  }
7217   test -z "$with_jpeg" && with_jpeg=yes
7218   if test "$with_jpeg" = "yes"; then
7219     { test "$extra_verbose" = "yes" && cat << \EOF
7220     Defining HAVE_JPEG
7221 EOF
7222 cat >> confdefs.h <<\EOF
7223 #define HAVE_JPEG 1
7224 EOF
7225 }
7226
7227     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7228   fi
7229
7230     png_problem=""
7231   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7232 echo "configure:7233: checking for pow" >&5
7233
7234 cat > conftest.$ac_ext <<EOF
7235 #line 7236 "configure"
7236 #include "confdefs.h"
7237 /* System header to define __stub macros and hopefully few prototypes,
7238     which can conflict with char pow(); below.  */
7239 #include <assert.h>
7240 /* Override any gcc2 internal prototype to avoid an error.  */
7241 /* We use char because int might match the return type of a gcc2
7242     builtin and then its argument prototype would still apply.  */
7243 char pow();
7244
7245 int main() {
7246
7247 /* The GNU C library defines this for functions which it implements
7248     to always fail with ENOSYS.  Some functions are actually named
7249     something starting with __ and the normal name is an alias.  */
7250 #if defined (__stub_pow) || defined (__stub___pow)
7251 choke me
7252 #else
7253 pow();
7254 #endif
7255
7256 ; return 0; }
7257 EOF
7258 if { (eval echo configure:7259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7259   rm -rf conftest*
7260   eval "ac_cv_func_pow=yes"
7261 else
7262   echo "configure: failed program was:" >&5
7263   cat conftest.$ac_ext >&5
7264   rm -rf conftest*
7265   eval "ac_cv_func_pow=no"
7266 fi
7267 rm -f conftest*
7268
7269 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7270   echo "$ac_t""yes" 1>&6
7271   :
7272 else
7273   echo "$ac_t""no" 1>&6
7274 with_png=no
7275 fi
7276  }
7277   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7278 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7279 echo "configure:7280: checking for png.h" >&5
7280
7281 cat > conftest.$ac_ext <<EOF
7282 #line 7283 "configure"
7283 #include "confdefs.h"
7284 #include <png.h>
7285 EOF
7286 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7287 { (eval echo configure:7288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7288 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7289 if test -z "$ac_err"; then
7290   rm -rf conftest*
7291   eval "ac_cv_header_$ac_safe=yes"
7292 else
7293   echo "$ac_err" >&5
7294   echo "configure: failed program was:" >&5
7295   cat conftest.$ac_ext >&5
7296   rm -rf conftest*
7297   eval "ac_cv_header_$ac_safe=no"
7298 fi
7299 rm -f conftest*
7300 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7301   echo "$ac_t""yes" 1>&6
7302   :
7303 else
7304   echo "$ac_t""no" 1>&6
7305 with_png=no
7306 fi
7307  }
7308   test -z "$with_png" && { 
7309 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7310 echo "configure:7311: checking for png_read_image in -lpng" >&5
7311 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7312
7313 xe_check_libs=" -lpng "
7314 cat > conftest.$ac_ext <<EOF
7315 #line 7316 "configure"
7316 #include "confdefs.h"
7317 /* Override any gcc2 internal prototype to avoid an error.  */
7318 /* We use char because int might match the return type of a gcc2
7319     builtin and then its argument prototype would still apply.  */
7320 char png_read_image();
7321
7322 int main() {
7323 png_read_image()
7324 ; return 0; }
7325 EOF
7326 if { (eval echo configure:7327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7327   rm -rf conftest*
7328   eval "ac_cv_lib_$ac_lib_var=yes"
7329 else
7330   echo "configure: failed program was:" >&5
7331   cat conftest.$ac_ext >&5
7332   rm -rf conftest*
7333   eval "ac_cv_lib_$ac_lib_var=no"
7334 fi
7335 rm -f conftest*
7336 xe_check_libs=""
7337
7338 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7339   echo "$ac_t""yes" 1>&6
7340   :
7341 else
7342   echo "$ac_t""no" 1>&6
7343 with_png=no
7344 fi
7345
7346  }
7347   if test -z "$with_png"; then
7348     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7349 echo "configure:7350: checking for workable png version information" >&5
7350     xe_check_libs="-lpng -lz"
7351     cat > conftest.$ac_ext <<EOF
7352 #line 7353 "configure"
7353 #include "confdefs.h"
7354 #include <png.h>
7355     int main(int c, char **v) {
7356     if (c == 1) return 0;
7357     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7358     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7359 EOF
7360 if { (eval echo configure:7361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7361 then
7362   ./conftest dummy_arg; png_status=$?;
7363       if test "$png_status" = "0"; then
7364         with_png=yes;
7365       else
7366         with_png=no;
7367         if test "$png_status" = "1"; then
7368           png_problem="PNG library version and header file don't match!"
7369         elif test "$png_status" = "2"; then
7370           png_problem="PNG library version too old (pre 1.0.2)!"
7371         fi
7372         echo "
7373 *** WARNING *** $png_problem
7374   I'm not touching that with a 10-foot pole!
7375   If you really want to use the installed version of libPNG, rerun
7376   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7377     fi
7378 else
7379   conftest_rc="$?"
7380   echo "configure: failed program was:" >&5
7381   cat conftest.$ac_ext >&5
7382   rm -fr conftest*
7383   with_png=no
7384 fi
7385 rm -fr conftest*
7386     xe_check_libs=
7387     echo "$ac_t""$with_png" 1>&6
7388   fi
7389   if test "$with_png" = "yes"; then
7390     { test "$extra_verbose" = "yes" && cat << \EOF
7391     Defining HAVE_PNG
7392 EOF
7393 cat >> confdefs.h <<\EOF
7394 #define HAVE_PNG 1
7395 EOF
7396 }
7397
7398     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7399   fi
7400
7401     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7402 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7403 echo "configure:7404: checking for tiffio.h" >&5
7404
7405 cat > conftest.$ac_ext <<EOF
7406 #line 7407 "configure"
7407 #include "confdefs.h"
7408 #include <tiffio.h>
7409 EOF
7410 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7411 { (eval echo configure:7412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7412 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7413 if test -z "$ac_err"; then
7414   rm -rf conftest*
7415   eval "ac_cv_header_$ac_safe=yes"
7416 else
7417   echo "$ac_err" >&5
7418   echo "configure: failed program was:" >&5
7419   cat conftest.$ac_ext >&5
7420   rm -rf conftest*
7421   eval "ac_cv_header_$ac_safe=no"
7422 fi
7423 rm -f conftest*
7424 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7425   echo "$ac_t""yes" 1>&6
7426   :
7427 else
7428   echo "$ac_t""no" 1>&6
7429 with_tiff=no
7430 fi
7431  }
7432   test -z "$with_tiff" && { 
7433 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7434 echo "configure:7435: checking for TIFFClientOpen in -ltiff" >&5
7435 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7436
7437 xe_check_libs=" -ltiff "
7438 cat > conftest.$ac_ext <<EOF
7439 #line 7440 "configure"
7440 #include "confdefs.h"
7441 /* Override any gcc2 internal prototype to avoid an error.  */
7442 /* We use char because int might match the return type of a gcc2
7443     builtin and then its argument prototype would still apply.  */
7444 char TIFFClientOpen();
7445
7446 int main() {
7447 TIFFClientOpen()
7448 ; return 0; }
7449 EOF
7450 if { (eval echo configure:7451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7451   rm -rf conftest*
7452   eval "ac_cv_lib_$ac_lib_var=yes"
7453 else
7454   echo "configure: failed program was:" >&5
7455   cat conftest.$ac_ext >&5
7456   rm -rf conftest*
7457   eval "ac_cv_lib_$ac_lib_var=no"
7458 fi
7459 rm -f conftest*
7460 xe_check_libs=""
7461
7462 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7463   echo "$ac_t""yes" 1>&6
7464   :
7465 else
7466   echo "$ac_t""no" 1>&6
7467 with_tiff=no
7468 fi
7469
7470  }
7471   test -z "$with_tiff" && with_tiff=yes
7472   if test "$with_tiff" = "yes"; then
7473     { test "$extra_verbose" = "yes" && cat << \EOF
7474     Defining HAVE_TIFF
7475 EOF
7476 cat >> confdefs.h <<\EOF
7477 #define HAVE_TIFF 1
7478 EOF
7479 }
7480
7481     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7482   fi
7483 fi
7484
7485
7486 if test "$with_x11" = "yes"; then
7487
7488   echo "checking for X11 graphics libraries" 1>&6
7489 echo "configure:7490: checking for X11 graphics libraries" >&5
7490
7491     
7492 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7493 echo "configure:7494: checking for XawScrollbarSetThumb in -lXaw" >&5
7494 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7495
7496 xe_check_libs=" -lXaw "
7497 cat > conftest.$ac_ext <<EOF
7498 #line 7499 "configure"
7499 #include "confdefs.h"
7500 /* Override any gcc2 internal prototype to avoid an error.  */
7501 /* We use char because int might match the return type of a gcc2
7502     builtin and then its argument prototype would still apply.  */
7503 char XawScrollbarSetThumb();
7504
7505 int main() {
7506 XawScrollbarSetThumb()
7507 ; return 0; }
7508 EOF
7509 if { (eval echo configure:7510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7510   rm -rf conftest*
7511   eval "ac_cv_lib_$ac_lib_var=yes"
7512 else
7513   echo "configure: failed program was:" >&5
7514   cat conftest.$ac_ext >&5
7515   rm -rf conftest*
7516   eval "ac_cv_lib_$ac_lib_var=no"
7517 fi
7518 rm -f conftest*
7519 xe_check_libs=""
7520
7521 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7522   echo "$ac_t""yes" 1>&6
7523   have_xaw=yes
7524 else
7525   echo "$ac_t""no" 1>&6
7526 have_xaw=no
7527 fi
7528
7529
7530                     
7531     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7532 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7533 echo "configure:7534: checking for Xm/Xm.h" >&5
7534
7535 cat > conftest.$ac_ext <<EOF
7536 #line 7537 "configure"
7537 #include "confdefs.h"
7538 #include <Xm/Xm.h>
7539 EOF
7540 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7541 { (eval echo configure:7542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7542 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7543 if test -z "$ac_err"; then
7544   rm -rf conftest*
7545   eval "ac_cv_header_$ac_safe=yes"
7546 else
7547   echo "$ac_err" >&5
7548   echo "configure: failed program was:" >&5
7549   cat conftest.$ac_ext >&5
7550   rm -rf conftest*
7551   eval "ac_cv_header_$ac_safe=no"
7552 fi
7553 rm -f conftest*
7554 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7555   echo "$ac_t""yes" 1>&6
7556   
7557 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7558 echo "configure:7559: checking for XmStringFree in -lXm" >&5
7559 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7560
7561 xe_check_libs=" -lXm "
7562 cat > conftest.$ac_ext <<EOF
7563 #line 7564 "configure"
7564 #include "confdefs.h"
7565 /* Override any gcc2 internal prototype to avoid an error.  */
7566 /* We use char because int might match the return type of a gcc2
7567     builtin and then its argument prototype would still apply.  */
7568 char XmStringFree();
7569
7570 int main() {
7571 XmStringFree()
7572 ; return 0; }
7573 EOF
7574 if { (eval echo configure:7575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7575   rm -rf conftest*
7576   eval "ac_cv_lib_$ac_lib_var=yes"
7577 else
7578   echo "configure: failed program was:" >&5
7579   cat conftest.$ac_ext >&5
7580   rm -rf conftest*
7581   eval "ac_cv_lib_$ac_lib_var=no"
7582 fi
7583 rm -f conftest*
7584 xe_check_libs=""
7585
7586 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7587   echo "$ac_t""yes" 1>&6
7588   have_motif=yes
7589 else
7590   echo "$ac_t""no" 1>&6
7591 have_motif=no
7592 fi
7593
7594
7595 else
7596   echo "$ac_t""no" 1>&6
7597 have_motif=no
7598 fi
7599
7600
7601   if test "$have_motif" = "yes"; then
7602         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7603 echo "configure:7604: checking for Lesstif" >&5
7604     cat > conftest.$ac_ext <<EOF
7605 #line 7606 "configure"
7606 #include "confdefs.h"
7607 #include <Xm/Xm.h>
7608 #ifdef LESSTIF_VERSION
7609 yes
7610 #endif
7611
7612 EOF
7613 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7614   egrep "yes" >/dev/null 2>&1; then
7615   rm -rf conftest*
7616   have_lesstif=yes
7617 else
7618   rm -rf conftest*
7619   have_lesstif=no
7620 fi
7621 rm -f conftest*
7622
7623   echo "$ac_t""$have_lesstif" 1>&6
7624   fi
7625
7626 fi 
7627
7628 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7629   with_menubars="lucid" ;;
7630 esac
7631 case "$with_dialogs" in "" | "yes" | "lucid" )
7632   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7633   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7634   else with_dialogs=no
7635   fi ;;
7636 esac
7637 case "$with_scrollbars" in "" | "yes" )
7638   with_scrollbars="lucid" ;;
7639 esac
7640 case "$with_widgets" in "" | "yes" )
7641   if   test "$have_motif" = "yes"; then with_widgets="motif"
7642   else with_widgets=no
7643   fi ;;
7644 esac
7645
7646 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
7647
7648 case "$all_widgets" in *athena* )
7649   { test "$extra_verbose" = "yes" && cat << \EOF
7650     Defining LWLIB_USES_ATHENA
7651 EOF
7652 cat >> confdefs.h <<\EOF
7653 #define LWLIB_USES_ATHENA 1
7654 EOF
7655 }
7656
7657   { test "$extra_verbose" = "yes" && cat << \EOF
7658     Defining NEED_ATHENA
7659 EOF
7660 cat >> confdefs.h <<\EOF
7661 #define NEED_ATHENA 1
7662 EOF
7663 }
7664
7665   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7666   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7667 esac
7668
7669 case "$all_widgets" in *motif* )
7670   { test "$extra_verbose" = "yes" && cat << \EOF
7671     Defining LWLIB_USES_MOTIF
7672 EOF
7673 cat >> confdefs.h <<\EOF
7674 #define LWLIB_USES_MOTIF 1
7675 EOF
7676 }
7677
7678   { test "$extra_verbose" = "yes" && cat << \EOF
7679     Defining NEED_MOTIF
7680 EOF
7681 cat >> confdefs.h <<\EOF
7682 #define NEED_MOTIF 1
7683 EOF
7684 }
7685
7686   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7687   need_motif=yes ;;
7688 esac
7689
7690 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7691 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7692 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7693 case "$all_widgets" in *lucid* )
7694   { test "$extra_verbose" = "yes" && cat << \EOF
7695     Defining NEED_LUCID
7696 EOF
7697 cat >> confdefs.h <<\EOF
7698 #define NEED_LUCID 1
7699 EOF
7700 }
7701
7702   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7703 esac
7704
7705
7706
7707 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7708     Defining LWLIB_SCROLLBARS_ATHENA
7709 EOF
7710 cat >> confdefs.h <<\EOF
7711 #define LWLIB_SCROLLBARS_ATHENA 1
7712 EOF
7713 }
7714 ;; esac
7715 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7716     Defining LWLIB_DIALOGS_ATHENA
7717 EOF
7718 cat >> confdefs.h <<\EOF
7719 #define LWLIB_DIALOGS_ATHENA 1
7720 EOF
7721 }
7722    ;; esac
7723 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7724     Defining LWLIB_SCROLLBARS_ATHENA3D
7725 EOF
7726 cat >> confdefs.h <<\EOF
7727 #define LWLIB_SCROLLBARS_ATHENA3D 1
7728 EOF
7729 }
7730
7731 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7732     Defining LWLIB_DIALOGS_ATHENA3D
7733 EOF
7734 cat >> confdefs.h <<\EOF
7735 #define LWLIB_DIALOGS_ATHENA3D 1
7736 EOF
7737 }
7738
7739
7740 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7741     Defining HAVE_MENUBARS
7742 EOF
7743 cat >> confdefs.h <<\EOF
7744 #define HAVE_MENUBARS 1
7745 EOF
7746 }
7747
7748 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7749     Defining HAVE_SCROLLBARS
7750 EOF
7751 cat >> confdefs.h <<\EOF
7752 #define HAVE_SCROLLBARS 1
7753 EOF
7754 }
7755
7756 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7757     Defining HAVE_DIALOGS
7758 EOF
7759 cat >> confdefs.h <<\EOF
7760 #define HAVE_DIALOGS 1
7761 EOF
7762 }
7763
7764 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7765     Defining HAVE_TOOLBARS
7766 EOF
7767 cat >> confdefs.h <<\EOF
7768 #define HAVE_TOOLBARS 1
7769 EOF
7770 }
7771
7772
7773 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7774     Defining LWLIB_MENUBARS_LUCID
7775 EOF
7776 cat >> confdefs.h <<\EOF
7777 #define LWLIB_MENUBARS_LUCID 1
7778 EOF
7779 }
7780
7781 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7782     Defining LWLIB_SCROLLBARS_LUCID
7783 EOF
7784 cat >> confdefs.h <<\EOF
7785 #define LWLIB_SCROLLBARS_LUCID 1
7786 EOF
7787 }
7788
7789
7790 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7791     Defining LWLIB_MENUBARS_MOTIF
7792 EOF
7793 cat >> confdefs.h <<\EOF
7794 #define LWLIB_MENUBARS_MOTIF 1
7795 EOF
7796 }
7797
7798 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7799     Defining LWLIB_SCROLLBARS_MOTIF
7800 EOF
7801 cat >> confdefs.h <<\EOF
7802 #define LWLIB_SCROLLBARS_MOTIF 1
7803 EOF
7804 }
7805
7806 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7807     Defining LWLIB_DIALOGS_MOTIF
7808 EOF
7809 cat >> confdefs.h <<\EOF
7810 #define LWLIB_DIALOGS_MOTIF 1
7811 EOF
7812 }
7813
7814
7815 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7816    echo "    xemacs will be linked with \"menubar.o\""
7817  fi
7818 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7819    echo "    xemacs will be linked with \"scrollbar.o\""
7820  fi
7821 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7822    echo "    xemacs will be linked with \"dialog.o\""
7823  fi
7824 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7825    echo "    xemacs will be linked with \"toolbar.o\""
7826  fi
7827
7828 if test "$with_x11" = "yes"; then
7829   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7830    echo "    xemacs will be linked with \"menubar-x.o\""
7831  fi
7832   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7833    echo "    xemacs will be linked with \"scrollbar-x.o\""
7834  fi
7835   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7836    echo "    xemacs will be linked with \"dialog-x.o\""
7837  fi
7838   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7839    echo "    xemacs will be linked with \"toolbar-x.o\""
7840  fi
7841   test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7842    echo "    xemacs will be linked with \"gui-x.o\""
7843  fi
7844 else
7845   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7846     echo "Attempt to Build NAS sound without X"
7847     echo "Please remove NAS configuration or build with X"
7848     exit 1
7849   fi
7850 fi
7851
7852
7853 test -z "$with_mule" && with_mule=no
7854 test -z "$with_file_coding" && with_file_coding=no
7855
7856
7857 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7858   { test "$extra_verbose" = "yes" && cat << \EOF
7859     Defining FILE_CODING
7860 EOF
7861 cat >> confdefs.h <<\EOF
7862 #define FILE_CODING 1
7863 EOF
7864 }
7865
7866   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7867    echo "    xemacs will be linked with \"file-coding.o\""
7868  fi
7869 fi
7870
7871 if test "$with_mule" = "yes" ; then
7872   echo "checking for Mule-related features" 1>&6
7873 echo "configure:7874: checking for Mule-related features" >&5
7874   { test "$extra_verbose" = "yes" && cat << \EOF
7875     Defining MULE
7876 EOF
7877 cat >> confdefs.h <<\EOF
7878 #define MULE 1
7879 EOF
7880 }
7881
7882   { test "$extra_verbose" = "yes" && cat << \EOF
7883     Defining FILE_CODING
7884 EOF
7885 cat >> confdefs.h <<\EOF
7886 #define FILE_CODING 1
7887 EOF
7888 }
7889
7890   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7891    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7892  fi
7893
7894     for ac_hdr in libintl.h
7895 do
7896 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7897 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7898 echo "configure:7899: checking for $ac_hdr" >&5
7899
7900 cat > conftest.$ac_ext <<EOF
7901 #line 7902 "configure"
7902 #include "confdefs.h"
7903 #include <$ac_hdr>
7904 EOF
7905 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7906 { (eval echo configure:7907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7907 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7908 if test -z "$ac_err"; then
7909   rm -rf conftest*
7910   eval "ac_cv_header_$ac_safe=yes"
7911 else
7912   echo "$ac_err" >&5
7913   echo "configure: failed program was:" >&5
7914   cat conftest.$ac_ext >&5
7915   rm -rf conftest*
7916   eval "ac_cv_header_$ac_safe=no"
7917 fi
7918 rm -f conftest*
7919 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7920   echo "$ac_t""yes" 1>&6
7921     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7922   { test "$extra_verbose" = "yes" && cat << EOF
7923     Defining $ac_tr_hdr
7924 EOF
7925 cat >> confdefs.h <<EOF
7926 #define $ac_tr_hdr 1
7927 EOF
7928 }
7929  
7930 else
7931   echo "$ac_t""no" 1>&6
7932 fi
7933 done
7934
7935   
7936 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7937 echo "configure:7938: checking for strerror in -lintl" >&5
7938 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7939
7940 xe_check_libs=" -lintl "
7941 cat > conftest.$ac_ext <<EOF
7942 #line 7943 "configure"
7943 #include "confdefs.h"
7944 /* Override any gcc2 internal prototype to avoid an error.  */
7945 /* We use char because int might match the return type of a gcc2
7946     builtin and then its argument prototype would still apply.  */
7947 char strerror();
7948
7949 int main() {
7950 strerror()
7951 ; return 0; }
7952 EOF
7953 if { (eval echo configure:7954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7954   rm -rf conftest*
7955   eval "ac_cv_lib_$ac_lib_var=yes"
7956 else
7957   echo "configure: failed program was:" >&5
7958   cat conftest.$ac_ext >&5
7959   rm -rf conftest*
7960   eval "ac_cv_lib_$ac_lib_var=no"
7961 fi
7962 rm -f conftest*
7963 xe_check_libs=""
7964
7965 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7966   echo "$ac_t""yes" 1>&6
7967     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7968     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7969   { test "$extra_verbose" = "yes" && cat << EOF
7970     Defining $ac_tr_lib
7971 EOF
7972 cat >> confdefs.h <<EOF
7973 #define $ac_tr_lib 1
7974 EOF
7975 }
7976
7977   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7978
7979 else
7980   echo "$ac_t""no" 1>&6
7981 fi
7982
7983
7984
7985   if test "$with_utf_2000" = "yes" ; then
7986     { test "$extra_verbose" = "yes" && cat << \EOF
7987     Defining CHAR_IS_UCS4
7988 EOF
7989 cat >> confdefs.h <<\EOF
7990 #define CHAR_IS_UCS4 1
7991 EOF
7992 }
7993
7994     { test "$extra_verbose" = "yes" && cat << \EOF
7995     Defining UTF2000
7996 EOF
7997 cat >> confdefs.h <<\EOF
7998 #define UTF2000 1
7999 EOF
8000 }
8001
8002   fi
8003
8004   echo "checking for Mule input methods" 1>&6
8005 echo "configure:8006: checking for Mule input methods" >&5
8006         case "$with_xim" in "" | "yes" )
8007     echo "checking for XIM" 1>&6
8008 echo "configure:8009: checking for XIM" >&5
8009     
8010 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
8011 echo "configure:8012: checking for XOpenIM in -lX11" >&5
8012 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
8013
8014 xe_check_libs=" -lX11 "
8015 cat > conftest.$ac_ext <<EOF
8016 #line 8017 "configure"
8017 #include "confdefs.h"
8018 /* Override any gcc2 internal prototype to avoid an error.  */
8019 /* We use char because int might match the return type of a gcc2
8020     builtin and then its argument prototype would still apply.  */
8021 char XOpenIM();
8022
8023 int main() {
8024 XOpenIM()
8025 ; return 0; }
8026 EOF
8027 if { (eval echo configure:8028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8028   rm -rf conftest*
8029   eval "ac_cv_lib_$ac_lib_var=yes"
8030 else
8031   echo "configure: failed program was:" >&5
8032   cat conftest.$ac_ext >&5
8033   rm -rf conftest*
8034   eval "ac_cv_lib_$ac_lib_var=no"
8035 fi
8036 rm -f conftest*
8037 xe_check_libs=""
8038
8039 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8040   echo "$ac_t""yes" 1>&6
8041   with_xim=xlib
8042 else
8043   echo "$ac_t""no" 1>&6
8044 with_xim=no
8045 fi
8046
8047
8048         if test "$have_motif $have_lesstif" = "yes no"; then
8049       
8050 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
8051 echo "configure:8052: checking for XmImMbLookupString in -lXm" >&5
8052 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
8053
8054 xe_check_libs=" -lXm "
8055 cat > conftest.$ac_ext <<EOF
8056 #line 8057 "configure"
8057 #include "confdefs.h"
8058 /* Override any gcc2 internal prototype to avoid an error.  */
8059 /* We use char because int might match the return type of a gcc2
8060     builtin and then its argument prototype would still apply.  */
8061 char XmImMbLookupString();
8062
8063 int main() {
8064 XmImMbLookupString()
8065 ; return 0; }
8066 EOF
8067 if { (eval echo configure:8068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8068   rm -rf conftest*
8069   eval "ac_cv_lib_$ac_lib_var=yes"
8070 else
8071   echo "configure: failed program was:" >&5
8072   cat conftest.$ac_ext >&5
8073   rm -rf conftest*
8074   eval "ac_cv_lib_$ac_lib_var=no"
8075 fi
8076 rm -f conftest*
8077 xe_check_libs=""
8078
8079 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8080   echo "$ac_t""yes" 1>&6
8081   with_xim=motif
8082 else
8083   echo "$ac_t""no" 1>&6
8084 fi
8085
8086
8087     fi ;;
8088   esac
8089   if test "$with_xim" != "no"; then
8090     { test "$extra_verbose" = "yes" && cat << \EOF
8091     Defining HAVE_XIM
8092 EOF
8093 cat >> confdefs.h <<\EOF
8094 #define HAVE_XIM 1
8095 EOF
8096 }
8097
8098     if test "$with_xim" = "xlib"; then
8099       { test "$extra_verbose" = "yes" && cat << \EOF
8100     Defining XIM_XLIB
8101 EOF
8102 cat >> confdefs.h <<\EOF
8103 #define XIM_XLIB 1
8104 EOF
8105 }
8106
8107       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
8108    echo "    xemacs will be linked with \"input-method-xlib.o\""
8109  fi
8110     fi
8111     if test "$with_xim" = "motif"; then
8112       { test "$extra_verbose" = "yes" && cat << \EOF
8113     Defining XIM_MOTIF
8114 EOF
8115 cat >> confdefs.h <<\EOF
8116 #define XIM_MOTIF 1
8117 EOF
8118 }
8119
8120       need_motif=yes
8121       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
8122    echo "    xemacs will be linked with \"input-method-motif.o\""
8123  fi
8124     fi
8125     if test "$with_xim" = "motif"; then
8126       with_xfs=no
8127     fi
8128   fi
8129
8130     if test "$with_xfs" = "yes" ; then
8131     echo "checking for XFontSet" 1>&6
8132 echo "configure:8133: checking for XFontSet" >&5
8133     
8134 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
8135 echo "configure:8136: checking for XmbDrawString in -lX11" >&5
8136 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
8137
8138 xe_check_libs=" -lX11 "
8139 cat > conftest.$ac_ext <<EOF
8140 #line 8141 "configure"
8141 #include "confdefs.h"
8142 /* Override any gcc2 internal prototype to avoid an error.  */
8143 /* We use char because int might match the return type of a gcc2
8144     builtin and then its argument prototype would still apply.  */
8145 char XmbDrawString();
8146
8147 int main() {
8148 XmbDrawString()
8149 ; return 0; }
8150 EOF
8151 if { (eval echo configure:8152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8152   rm -rf conftest*
8153   eval "ac_cv_lib_$ac_lib_var=yes"
8154 else
8155   echo "configure: failed program was:" >&5
8156   cat conftest.$ac_ext >&5
8157   rm -rf conftest*
8158   eval "ac_cv_lib_$ac_lib_var=no"
8159 fi
8160 rm -f conftest*
8161 xe_check_libs=""
8162
8163 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8164   echo "$ac_t""yes" 1>&6
8165   :
8166 else
8167   echo "$ac_t""no" 1>&6
8168 with_xfs=no
8169 fi
8170
8171
8172     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
8173       { test "$extra_verbose" = "yes" && cat << \EOF
8174     Defining USE_XFONTSET
8175 EOF
8176 cat >> confdefs.h <<\EOF
8177 #define USE_XFONTSET 1
8178 EOF
8179 }
8180
8181       if test "$with_xim" = "no" ; then
8182         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
8183    echo "    xemacs will be linked with \"input-method-xfs.o\""
8184  fi
8185       fi
8186     fi
8187   fi 
8188     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
8189   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
8190 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
8191 echo "configure:8192: checking for wnn/jllib.h" >&5
8192
8193 cat > conftest.$ac_ext <<EOF
8194 #line 8195 "configure"
8195 #include "confdefs.h"
8196 #include <wnn/jllib.h>
8197 EOF
8198 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8199 { (eval echo configure:8200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8200 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8201 if test -z "$ac_err"; then
8202   rm -rf conftest*
8203   eval "ac_cv_header_$ac_safe=yes"
8204 else
8205   echo "$ac_err" >&5
8206   echo "configure: failed program was:" >&5
8207   cat conftest.$ac_ext >&5
8208   rm -rf conftest*
8209   eval "ac_cv_header_$ac_safe=no"
8210 fi
8211 rm -f conftest*
8212 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8213   echo "$ac_t""yes" 1>&6
8214   :
8215 else
8216   echo "$ac_t""no" 1>&6
8217 with_wnn=no
8218 fi
8219  }
8220     if test "$with_wnn" != "no"; then
8221     for ac_func in crypt
8222 do
8223 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8224 echo "configure:8225: checking for $ac_func" >&5
8225
8226 cat > conftest.$ac_ext <<EOF
8227 #line 8228 "configure"
8228 #include "confdefs.h"
8229 /* System header to define __stub macros and hopefully few prototypes,
8230     which can conflict with char $ac_func(); below.  */
8231 #include <assert.h>
8232 /* Override any gcc2 internal prototype to avoid an error.  */
8233 /* We use char because int might match the return type of a gcc2
8234     builtin and then its argument prototype would still apply.  */
8235 char $ac_func();
8236
8237 int main() {
8238
8239 /* The GNU C library defines this for functions which it implements
8240     to always fail with ENOSYS.  Some functions are actually named
8241     something starting with __ and the normal name is an alias.  */
8242 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8243 choke me
8244 #else
8245 $ac_func();
8246 #endif
8247
8248 ; return 0; }
8249 EOF
8250 if { (eval echo configure:8251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8251   rm -rf conftest*
8252   eval "ac_cv_func_$ac_func=yes"
8253 else
8254   echo "configure: failed program was:" >&5
8255   cat conftest.$ac_ext >&5
8256   rm -rf conftest*
8257   eval "ac_cv_func_$ac_func=no"
8258 fi
8259 rm -f conftest*
8260
8261 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8262   echo "$ac_t""yes" 1>&6
8263     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8264   { test "$extra_verbose" = "yes" && cat << EOF
8265     Defining $ac_tr_func
8266 EOF
8267 cat >> confdefs.h <<EOF
8268 #define $ac_tr_func 1
8269 EOF
8270 }
8271  
8272 else
8273   echo "$ac_t""no" 1>&6
8274 fi
8275 done
8276
8277     test "$ac_cv_func_crypt" != "yes" && { 
8278 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
8279 echo "configure:8280: checking for crypt in -lcrypt" >&5
8280 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
8281
8282 xe_check_libs=" -lcrypt "
8283 cat > conftest.$ac_ext <<EOF
8284 #line 8285 "configure"
8285 #include "confdefs.h"
8286 /* Override any gcc2 internal prototype to avoid an error.  */
8287 /* We use char because int might match the return type of a gcc2
8288     builtin and then its argument prototype would still apply.  */
8289 char crypt();
8290
8291 int main() {
8292 crypt()
8293 ; return 0; }
8294 EOF
8295 if { (eval echo configure:8296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8296   rm -rf conftest*
8297   eval "ac_cv_lib_$ac_lib_var=yes"
8298 else
8299   echo "configure: failed program was:" >&5
8300   cat conftest.$ac_ext >&5
8301   rm -rf conftest*
8302   eval "ac_cv_lib_$ac_lib_var=no"
8303 fi
8304 rm -f conftest*
8305 xe_check_libs=""
8306
8307 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8308   echo "$ac_t""yes" 1>&6
8309     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8310     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8311   { test "$extra_verbose" = "yes" && cat << EOF
8312     Defining $ac_tr_lib
8313 EOF
8314 cat >> confdefs.h <<EOF
8315 #define $ac_tr_lib 1
8316 EOF
8317 }
8318
8319   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
8320
8321 else
8322   echo "$ac_t""no" 1>&6
8323 fi
8324
8325  }
8326   fi
8327     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8328     
8329 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8330 echo "configure:8331: checking for jl_dic_list_e in -lwnn" >&5
8331 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8332
8333 xe_check_libs=" -lwnn "
8334 cat > conftest.$ac_ext <<EOF
8335 #line 8336 "configure"
8336 #include "confdefs.h"
8337 /* Override any gcc2 internal prototype to avoid an error.  */
8338 /* We use char because int might match the return type of a gcc2
8339     builtin and then its argument prototype would still apply.  */
8340 char jl_dic_list_e();
8341
8342 int main() {
8343 jl_dic_list_e()
8344 ; return 0; }
8345 EOF
8346 if { (eval echo configure:8347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8347   rm -rf conftest*
8348   eval "ac_cv_lib_$ac_lib_var=yes"
8349 else
8350   echo "configure: failed program was:" >&5
8351   cat conftest.$ac_ext >&5
8352   rm -rf conftest*
8353   eval "ac_cv_lib_$ac_lib_var=no"
8354 fi
8355 rm -f conftest*
8356 xe_check_libs=""
8357
8358 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8359   echo "$ac_t""yes" 1>&6
8360   libwnn=wnn
8361 else
8362   echo "$ac_t""no" 1>&6
8363 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8364 echo "configure:8365: checking for jl_dic_list_e in -lwnn4" >&5
8365 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8366
8367 xe_check_libs=" -lwnn4 "
8368 cat > conftest.$ac_ext <<EOF
8369 #line 8370 "configure"
8370 #include "confdefs.h"
8371 /* Override any gcc2 internal prototype to avoid an error.  */
8372 /* We use char because int might match the return type of a gcc2
8373     builtin and then its argument prototype would still apply.  */
8374 char jl_dic_list_e();
8375
8376 int main() {
8377 jl_dic_list_e()
8378 ; return 0; }
8379 EOF
8380 if { (eval echo configure:8381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8381   rm -rf conftest*
8382   eval "ac_cv_lib_$ac_lib_var=yes"
8383 else
8384   echo "configure: failed program was:" >&5
8385   cat conftest.$ac_ext >&5
8386   rm -rf conftest*
8387   eval "ac_cv_lib_$ac_lib_var=no"
8388 fi
8389 rm -f conftest*
8390 xe_check_libs=""
8391
8392 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8393   echo "$ac_t""yes" 1>&6
8394   libwnn=wnn4
8395 else
8396   echo "$ac_t""no" 1>&6
8397 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8398 echo "configure:8399: checking for jl_dic_list_e in -lwnn6" >&5
8399 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8400
8401 xe_check_libs=" -lwnn6 "
8402 cat > conftest.$ac_ext <<EOF
8403 #line 8404 "configure"
8404 #include "confdefs.h"
8405 /* Override any gcc2 internal prototype to avoid an error.  */
8406 /* We use char because int might match the return type of a gcc2
8407     builtin and then its argument prototype would still apply.  */
8408 char jl_dic_list_e();
8409
8410 int main() {
8411 jl_dic_list_e()
8412 ; return 0; }
8413 EOF
8414 if { (eval echo configure:8415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8415   rm -rf conftest*
8416   eval "ac_cv_lib_$ac_lib_var=yes"
8417 else
8418   echo "configure: failed program was:" >&5
8419   cat conftest.$ac_ext >&5
8420   rm -rf conftest*
8421   eval "ac_cv_lib_$ac_lib_var=no"
8422 fi
8423 rm -f conftest*
8424 xe_check_libs=""
8425
8426 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8427   echo "$ac_t""yes" 1>&6
8428   libwnn=wnn6
8429 else
8430   echo "$ac_t""no" 1>&6
8431 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8432 echo "configure:8433: checking for dic_list_e in -lwnn6_fromsrc" >&5
8433 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8434
8435 xe_check_libs=" -lwnn6_fromsrc "
8436 cat > conftest.$ac_ext <<EOF
8437 #line 8438 "configure"
8438 #include "confdefs.h"
8439 /* Override any gcc2 internal prototype to avoid an error.  */
8440 /* We use char because int might match the return type of a gcc2
8441     builtin and then its argument prototype would still apply.  */
8442 char dic_list_e();
8443
8444 int main() {
8445 dic_list_e()
8446 ; return 0; }
8447 EOF
8448 if { (eval echo configure:8449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8449   rm -rf conftest*
8450   eval "ac_cv_lib_$ac_lib_var=yes"
8451 else
8452   echo "configure: failed program was:" >&5
8453   cat conftest.$ac_ext >&5
8454   rm -rf conftest*
8455   eval "ac_cv_lib_$ac_lib_var=no"
8456 fi
8457 rm -f conftest*
8458 xe_check_libs=""
8459
8460 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8461   echo "$ac_t""yes" 1>&6
8462   libwnn=wnn6_fromsrc
8463 else
8464   echo "$ac_t""no" 1>&6
8465 with_wnn=no
8466 fi
8467
8468
8469 fi
8470
8471
8472 fi
8473
8474
8475 fi
8476
8477
8478   fi
8479   test -z "$with_wnn" && with_wnn=yes
8480   if test "$with_wnn" = "yes"; then
8481     { test "$extra_verbose" = "yes" && cat << \EOF
8482     Defining HAVE_WNN
8483 EOF
8484 cat >> confdefs.h <<\EOF
8485 #define HAVE_WNN 1
8486 EOF
8487 }
8488
8489     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8490     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8491    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8492  fi
8493     if test "$with_wnn6" != "no"; then
8494       
8495 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8496 echo "configure:8497: checking for jl_fi_dic_list in -l$libwnn" >&5
8497 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8498
8499 xe_check_libs=" -l$libwnn "
8500 cat > conftest.$ac_ext <<EOF
8501 #line 8502 "configure"
8502 #include "confdefs.h"
8503 /* Override any gcc2 internal prototype to avoid an error.  */
8504 /* We use char because int might match the return type of a gcc2
8505     builtin and then its argument prototype would still apply.  */
8506 char jl_fi_dic_list();
8507
8508 int main() {
8509 jl_fi_dic_list()
8510 ; return 0; }
8511 EOF
8512 if { (eval echo configure:8513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8513   rm -rf conftest*
8514   eval "ac_cv_lib_$ac_lib_var=yes"
8515 else
8516   echo "configure: failed program was:" >&5
8517   cat conftest.$ac_ext >&5
8518   rm -rf conftest*
8519   eval "ac_cv_lib_$ac_lib_var=no"
8520 fi
8521 rm -f conftest*
8522 xe_check_libs=""
8523
8524 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8525   echo "$ac_t""yes" 1>&6
8526   with_wnn6=yes
8527 else
8528   echo "$ac_t""no" 1>&6
8529 fi
8530
8531
8532       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8533     Defining WNN6
8534 EOF
8535 cat >> confdefs.h <<\EOF
8536 #define WNN6 1
8537 EOF
8538 }
8539
8540     fi
8541   fi
8542
8543     canna_includes_found=no
8544   if test "$with_canna" != "no"; then
8545     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8546 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8547 echo "configure:8548: checking for canna/jrkanji.h" >&5
8548
8549 cat > conftest.$ac_ext <<EOF
8550 #line 8551 "configure"
8551 #include "confdefs.h"
8552 #include <canna/jrkanji.h>
8553 EOF
8554 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8555 { (eval echo configure:8556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8556 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8557 if test -z "$ac_err"; then
8558   rm -rf conftest*
8559   eval "ac_cv_header_$ac_safe=yes"
8560 else
8561   echo "$ac_err" >&5
8562   echo "configure: failed program was:" >&5
8563   cat conftest.$ac_ext >&5
8564   rm -rf conftest*
8565   eval "ac_cv_header_$ac_safe=no"
8566 fi
8567 rm -f conftest*
8568 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8569   echo "$ac_t""yes" 1>&6
8570   canna_includes_found=yes
8571 else
8572   echo "$ac_t""no" 1>&6
8573 fi
8574
8575   fi
8576   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8577       -d "/usr/local/canna/include"; then
8578     save_c_switch_site="$c_switch_site"
8579     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8580     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8581 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8582 echo "configure:8583: checking for canna/jrkanji.h" >&5
8583
8584 cat > conftest.$ac_ext <<EOF
8585 #line 8586 "configure"
8586 #include "confdefs.h"
8587 #include <canna/jrkanji.h>
8588 EOF
8589 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8590 { (eval echo configure:8591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8591 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8592 if test -z "$ac_err"; then
8593   rm -rf conftest*
8594   eval "ac_cv_header_$ac_safe=yes"
8595 else
8596   echo "$ac_err" >&5
8597   echo "configure: failed program was:" >&5
8598   cat conftest.$ac_ext >&5
8599   rm -rf conftest*
8600   eval "ac_cv_header_$ac_safe=no"
8601 fi
8602 rm -f conftest*
8603 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8604   echo "$ac_t""yes" 1>&6
8605   canna_includes_found=yes
8606 else
8607   echo "$ac_t""no" 1>&6
8608 fi
8609
8610     if test "$canna_includes_found" != "yes"; then
8611       c_switch_site="$save_c_switch_site"
8612       with_canna="no"
8613     fi
8614   fi
8615
8616   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8617 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8618 echo "configure:8619: checking for canna/RK.h" >&5
8619
8620 cat > conftest.$ac_ext <<EOF
8621 #line 8622 "configure"
8622 #include "confdefs.h"
8623 #include <canna/RK.h>
8624 EOF
8625 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8626 { (eval echo configure:8627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8627 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8628 if test -z "$ac_err"; then
8629   rm -rf conftest*
8630   eval "ac_cv_header_$ac_safe=yes"
8631 else
8632   echo "$ac_err" >&5
8633   echo "configure: failed program was:" >&5
8634   cat conftest.$ac_ext >&5
8635   rm -rf conftest*
8636   eval "ac_cv_header_$ac_safe=no"
8637 fi
8638 rm -f conftest*
8639 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8640   echo "$ac_t""yes" 1>&6
8641   :
8642 else
8643   echo "$ac_t""no" 1>&6
8644 with_canna=no
8645 fi
8646  }
8647   test -z "$with_canna" && { 
8648 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8649 echo "configure:8650: checking for RkBgnBun in -lRKC" >&5
8650 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8651
8652 xe_check_libs=" -lRKC "
8653 cat > conftest.$ac_ext <<EOF
8654 #line 8655 "configure"
8655 #include "confdefs.h"
8656 /* Override any gcc2 internal prototype to avoid an error.  */
8657 /* We use char because int might match the return type of a gcc2
8658     builtin and then its argument prototype would still apply.  */
8659 char RkBgnBun();
8660
8661 int main() {
8662 RkBgnBun()
8663 ; return 0; }
8664 EOF
8665 if { (eval echo configure:8666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8666   rm -rf conftest*
8667   eval "ac_cv_lib_$ac_lib_var=yes"
8668 else
8669   echo "configure: failed program was:" >&5
8670   cat conftest.$ac_ext >&5
8671   rm -rf conftest*
8672   eval "ac_cv_lib_$ac_lib_var=no"
8673 fi
8674 rm -f conftest*
8675 xe_check_libs=""
8676
8677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8678   echo "$ac_t""yes" 1>&6
8679   :
8680 else
8681   echo "$ac_t""no" 1>&6
8682 with_canna=no
8683 fi
8684
8685  }
8686   test -z "$with_canna" && { 
8687 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8688 echo "configure:8689: checking for jrKanjiControl in -lcanna" >&5
8689 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8690
8691 xe_check_libs=" -lcanna "
8692 cat > conftest.$ac_ext <<EOF
8693 #line 8694 "configure"
8694 #include "confdefs.h"
8695 /* Override any gcc2 internal prototype to avoid an error.  */
8696 /* We use char because int might match the return type of a gcc2
8697     builtin and then its argument prototype would still apply.  */
8698 char jrKanjiControl();
8699
8700 int main() {
8701 jrKanjiControl()
8702 ; return 0; }
8703 EOF
8704 if { (eval echo configure:8705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8705   rm -rf conftest*
8706   eval "ac_cv_lib_$ac_lib_var=yes"
8707 else
8708   echo "configure: failed program was:" >&5
8709   cat conftest.$ac_ext >&5
8710   rm -rf conftest*
8711   eval "ac_cv_lib_$ac_lib_var=no"
8712 fi
8713 rm -f conftest*
8714 xe_check_libs=""
8715
8716 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8717   echo "$ac_t""yes" 1>&6
8718   :
8719 else
8720   echo "$ac_t""no" 1>&6
8721 with_canna=no
8722 fi
8723
8724  }
8725   test -z "$with_canna" && with_canna=yes
8726   if test "$with_canna" = "yes"; then
8727     { test "$extra_verbose" = "yes" && cat << \EOF
8728     Defining HAVE_CANNA
8729 EOF
8730 cat >> confdefs.h <<\EOF
8731 #define HAVE_CANNA 1
8732 EOF
8733 }
8734
8735     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8736     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8737    echo "    xemacs will be linked with \"mule-canna.o\""
8738  fi
8739   fi
8740
8741 else   for feature in xim canna wnn; do
8742     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8743       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8744     fi
8745     eval "with_${feature}=no"
8746   done
8747 fi 
8748
8749 if test "$need_motif" = "yes" ; then
8750   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8751     
8752 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8753 echo "configure:8754: checking for layout_object_getvalue in -li18n" >&5
8754 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8755
8756 xe_check_libs=" -li18n "
8757 cat > conftest.$ac_ext <<EOF
8758 #line 8759 "configure"
8759 #include "confdefs.h"
8760 /* Override any gcc2 internal prototype to avoid an error.  */
8761 /* We use char because int might match the return type of a gcc2
8762     builtin and then its argument prototype would still apply.  */
8763 char layout_object_getvalue();
8764
8765 int main() {
8766 layout_object_getvalue()
8767 ; return 0; }
8768 EOF
8769 if { (eval echo configure:8770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8770   rm -rf conftest*
8771   eval "ac_cv_lib_$ac_lib_var=yes"
8772 else
8773   echo "configure: failed program was:" >&5
8774   cat conftest.$ac_ext >&5
8775   rm -rf conftest*
8776   eval "ac_cv_lib_$ac_lib_var=no"
8777 fi
8778 rm -f conftest*
8779 xe_check_libs=""
8780
8781 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8782   echo "$ac_t""yes" 1>&6
8783   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8784 else
8785   echo "$ac_t""no" 1>&6
8786 fi
8787
8788
8789   
8790 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8791     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8792   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8793   
8794         runpath="" runpath_dirs=""
8795   if test -n "$LD_RUN_PATH"; then
8796     runpath="$LD_RUN_PATH"
8797   elif test "$GCC" = "yes"; then
8798         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8799     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8800     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8801     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8802       case "$arg" in P,* | -L* | -R* )
8803         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8804           {
8805 xe_runpath_dir="$dir"
8806   test "$xe_runpath_dir" != "/lib"     -a \
8807         "$xe_runpath_dir" != "/usr/lib" -a \
8808         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8809   eval "$xe_add_unique_runpath_dir"
8810 }
8811         done ;;
8812       esac
8813     done
8814     ld_switch_run="$ld_switch_run_save"
8815     rm -f conftest*
8816   else
8817         for arg in $ld_switch_site $ld_switch_x_site; do
8818       case "$arg" in -L*) {
8819 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8820   test "$xe_runpath_dir" != "/lib"     -a \
8821         "$xe_runpath_dir" != "/usr/lib" -a \
8822         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8823   eval "$xe_add_unique_runpath_dir"
8824 };; esac
8825     done
8826         if test "$opsys $need_motif" = "sol2 yes"; then
8827       xe_runpath_dir="/opt/SUNWdt/lib";
8828       eval "$xe_add_unique_runpath_dir";
8829     fi
8830   fi 
8831   if test -n "$runpath"; then
8832     ld_switch_run="${dash_r}${runpath}"
8833     
8834 if test "$GCC" = "yes"; then
8835   set x $ld_switch_run; shift; ld_switch_run=""
8836   while test -n "$1"; do
8837     case $1 in
8838       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8839       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8840       -Xlinker* ) ;;
8841       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8842     esac
8843     shift
8844   done
8845 fi
8846     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8847   fi
8848 fi
8849
8850 fi
8851
8852 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
8853 do
8854 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8855 echo "configure:8856: checking for $ac_func" >&5
8856
8857 cat > conftest.$ac_ext <<EOF
8858 #line 8859 "configure"
8859 #include "confdefs.h"
8860 /* System header to define __stub macros and hopefully few prototypes,
8861     which can conflict with char $ac_func(); below.  */
8862 #include <assert.h>
8863 /* Override any gcc2 internal prototype to avoid an error.  */
8864 /* We use char because int might match the return type of a gcc2
8865     builtin and then its argument prototype would still apply.  */
8866 char $ac_func();
8867
8868 int main() {
8869
8870 /* The GNU C library defines this for functions which it implements
8871     to always fail with ENOSYS.  Some functions are actually named
8872     something starting with __ and the normal name is an alias.  */
8873 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8874 choke me
8875 #else
8876 $ac_func();
8877 #endif
8878
8879 ; return 0; }
8880 EOF
8881 if { (eval echo configure:8882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8882   rm -rf conftest*
8883   eval "ac_cv_func_$ac_func=yes"
8884 else
8885   echo "configure: failed program was:" >&5
8886   cat conftest.$ac_ext >&5
8887   rm -rf conftest*
8888   eval "ac_cv_func_$ac_func=no"
8889 fi
8890 rm -f conftest*
8891
8892 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8893   echo "$ac_t""yes" 1>&6
8894     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8895   { test "$extra_verbose" = "yes" && cat << EOF
8896     Defining $ac_tr_func
8897 EOF
8898 cat >> confdefs.h <<EOF
8899 #define $ac_tr_func 1
8900 EOF
8901 }
8902  
8903 else
8904   echo "$ac_t""no" 1>&6
8905 fi
8906 done
8907
8908
8909
8910 case "$opsys" in
8911   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8912    echo "    xemacs will be linked with \"realpath.o\""
8913  fi ;;
8914   * )
8915     case "$canonical" in
8916       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8917    echo "    xemacs will be linked with \"realpath.o\""
8918  fi ;;
8919       * ) for ac_func in realpath
8920 do
8921 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8922 echo "configure:8923: checking for $ac_func" >&5
8923
8924 cat > conftest.$ac_ext <<EOF
8925 #line 8926 "configure"
8926 #include "confdefs.h"
8927 /* System header to define __stub macros and hopefully few prototypes,
8928     which can conflict with char $ac_func(); below.  */
8929 #include <assert.h>
8930 /* Override any gcc2 internal prototype to avoid an error.  */
8931 /* We use char because int might match the return type of a gcc2
8932     builtin and then its argument prototype would still apply.  */
8933 char $ac_func();
8934
8935 int main() {
8936
8937 /* The GNU C library defines this for functions which it implements
8938     to always fail with ENOSYS.  Some functions are actually named
8939     something starting with __ and the normal name is an alias.  */
8940 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8941 choke me
8942 #else
8943 $ac_func();
8944 #endif
8945
8946 ; return 0; }
8947 EOF
8948 if { (eval echo configure:8949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8949   rm -rf conftest*
8950   eval "ac_cv_func_$ac_func=yes"
8951 else
8952   echo "configure: failed program was:" >&5
8953   cat conftest.$ac_ext >&5
8954   rm -rf conftest*
8955   eval "ac_cv_func_$ac_func=no"
8956 fi
8957 rm -f conftest*
8958
8959 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8960   echo "$ac_t""yes" 1>&6
8961     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8962   { test "$extra_verbose" = "yes" && cat << EOF
8963     Defining $ac_tr_func
8964 EOF
8965 cat >> confdefs.h <<EOF
8966 #define $ac_tr_func 1
8967 EOF
8968 }
8969  
8970 else
8971   echo "$ac_t""no" 1>&6
8972 fi
8973 done
8974
8975           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8976    echo "    xemacs will be linked with \"realpath.o\""
8977  fi ;;
8978     esac ;;
8979 esac
8980
8981 for ac_func in getloadavg
8982 do
8983 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8984 echo "configure:8985: checking for $ac_func" >&5
8985
8986 cat > conftest.$ac_ext <<EOF
8987 #line 8988 "configure"
8988 #include "confdefs.h"
8989 /* System header to define __stub macros and hopefully few prototypes,
8990     which can conflict with char $ac_func(); below.  */
8991 #include <assert.h>
8992 /* Override any gcc2 internal prototype to avoid an error.  */
8993 /* We use char because int might match the return type of a gcc2
8994     builtin and then its argument prototype would still apply.  */
8995 char $ac_func();
8996
8997 int main() {
8998
8999 /* The GNU C library defines this for functions which it implements
9000     to always fail with ENOSYS.  Some functions are actually named
9001     something starting with __ and the normal name is an alias.  */
9002 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9003 choke me
9004 #else
9005 $ac_func();
9006 #endif
9007
9008 ; return 0; }
9009 EOF
9010 if { (eval echo configure:9011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9011   rm -rf conftest*
9012   eval "ac_cv_func_$ac_func=yes"
9013 else
9014   echo "configure: failed program was:" >&5
9015   cat conftest.$ac_ext >&5
9016   rm -rf conftest*
9017   eval "ac_cv_func_$ac_func=no"
9018 fi
9019 rm -f conftest*
9020
9021 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9022   echo "$ac_t""yes" 1>&6
9023     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9024   { test "$extra_verbose" = "yes" && cat << EOF
9025     Defining $ac_tr_func
9026 EOF
9027 cat >> confdefs.h <<EOF
9028 #define $ac_tr_func 1
9029 EOF
9030 }
9031  
9032 else
9033   echo "$ac_t""no" 1>&6
9034 fi
9035 done
9036
9037
9038 if test "$ac_cv_func_getloadavg" != "yes"
9039 then
9040   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
9041    echo "    xemacs will be linked with \"getloadavg.o\""
9042  fi
9043
9044     
9045 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
9046 echo "configure:9047: checking for kstat_open in -lkstat" >&5
9047 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
9048
9049 xe_check_libs=" -lkstat "
9050 cat > conftest.$ac_ext <<EOF
9051 #line 9052 "configure"
9052 #include "confdefs.h"
9053 /* Override any gcc2 internal prototype to avoid an error.  */
9054 /* We use char because int might match the return type of a gcc2
9055     builtin and then its argument prototype would still apply.  */
9056 char kstat_open();
9057
9058 int main() {
9059 kstat_open()
9060 ; return 0; }
9061 EOF
9062 if { (eval echo configure:9063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9063   rm -rf conftest*
9064   eval "ac_cv_lib_$ac_lib_var=yes"
9065 else
9066   echo "configure: failed program was:" >&5
9067   cat conftest.$ac_ext >&5
9068   rm -rf conftest*
9069   eval "ac_cv_lib_$ac_lib_var=no"
9070 fi
9071 rm -f conftest*
9072 xe_check_libs=""
9073
9074 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9075   echo "$ac_t""yes" 1>&6
9076     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9077     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9078   { test "$extra_verbose" = "yes" && cat << EOF
9079     Defining $ac_tr_lib
9080 EOF
9081 cat >> confdefs.h <<EOF
9082 #define $ac_tr_lib 1
9083 EOF
9084 }
9085
9086   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
9087
9088 else
9089   echo "$ac_t""no" 1>&6
9090 fi
9091
9092
9093
9094     
9095 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
9096 echo "configure:9097: checking for kvm_read in -lkvm" >&5
9097 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
9098
9099 xe_check_libs=" -lkvm "
9100 cat > conftest.$ac_ext <<EOF
9101 #line 9102 "configure"
9102 #include "confdefs.h"
9103 /* Override any gcc2 internal prototype to avoid an error.  */
9104 /* We use char because int might match the return type of a gcc2
9105     builtin and then its argument prototype would still apply.  */
9106 char kvm_read();
9107
9108 int main() {
9109 kvm_read()
9110 ; return 0; }
9111 EOF
9112 if { (eval echo configure:9113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9113   rm -rf conftest*
9114   eval "ac_cv_lib_$ac_lib_var=yes"
9115 else
9116   echo "configure: failed program was:" >&5
9117   cat conftest.$ac_ext >&5
9118   rm -rf conftest*
9119   eval "ac_cv_lib_$ac_lib_var=no"
9120 fi
9121 rm -f conftest*
9122 xe_check_libs=""
9123
9124 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9125   echo "$ac_t""yes" 1>&6
9126     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9127     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9128   { test "$extra_verbose" = "yes" && cat << EOF
9129     Defining $ac_tr_lib
9130 EOF
9131 cat >> confdefs.h <<EOF
9132 #define $ac_tr_lib 1
9133 EOF
9134 }
9135
9136   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
9137
9138 else
9139   echo "$ac_t""no" 1>&6
9140 fi
9141
9142
9143 fi
9144
9145 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
9146 echo "configure:9147: checking whether netdb declares h_errno" >&5
9147 cat > conftest.$ac_ext <<EOF
9148 #line 9149 "configure"
9149 #include "confdefs.h"
9150 #include <netdb.h>
9151 int main() {
9152 return h_errno;
9153 ; return 0; }
9154 EOF
9155 if { (eval echo configure:9156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9156   rm -rf conftest*
9157   echo "$ac_t""yes" 1>&6
9158    { test "$extra_verbose" = "yes" && cat << \EOF
9159     Defining HAVE_H_ERRNO
9160 EOF
9161 cat >> confdefs.h <<\EOF
9162 #define HAVE_H_ERRNO 1
9163 EOF
9164 }
9165
9166 else
9167   echo "configure: failed program was:" >&5
9168   cat conftest.$ac_ext >&5
9169   rm -rf conftest*
9170   echo "$ac_t""no" 1>&6
9171 fi
9172 rm -f conftest*
9173
9174 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
9175 echo "configure:9176: checking for sigsetjmp" >&5
9176 cat > conftest.$ac_ext <<EOF
9177 #line 9178 "configure"
9178 #include "confdefs.h"
9179 #include <setjmp.h>
9180 int main() {
9181 sigjmp_buf bar; sigsetjmp (bar, 0);
9182 ; return 0; }
9183 EOF
9184 if { (eval echo configure:9185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9185   rm -rf conftest*
9186   echo "$ac_t""yes" 1>&6
9187    { test "$extra_verbose" = "yes" && cat << \EOF
9188     Defining HAVE_SIGSETJMP
9189 EOF
9190 cat >> confdefs.h <<\EOF
9191 #define HAVE_SIGSETJMP 1
9192 EOF
9193 }
9194
9195 else
9196   echo "configure: failed program was:" >&5
9197   cat conftest.$ac_ext >&5
9198   rm -rf conftest*
9199   echo "$ac_t""no" 1>&6
9200 fi
9201 rm -f conftest*
9202
9203 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
9204 echo "configure:9205: checking whether localtime caches TZ" >&5
9205
9206 if test "$ac_cv_func_tzset" = "yes"; then
9207 cat > conftest.$ac_ext <<EOF
9208 #line 9209 "configure"
9209 #include "confdefs.h"
9210 #include <time.h>
9211 #if STDC_HEADERS
9212 # include <stdlib.h>
9213 #endif
9214 extern char **environ;
9215 unset_TZ ()
9216 {
9217   char **from, **to;
9218   for (to = from = environ; (*to = *from); from++)
9219     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
9220       to++;
9221 }
9222 char TZ_GMT0[] = "TZ=GMT0";
9223 char TZ_PST8[] = "TZ=PST8";
9224 main()
9225 {
9226   time_t now = time ((time_t *) 0);
9227   int hour_GMT0, hour_unset;
9228   if (putenv (TZ_GMT0) != 0)
9229     exit (1);
9230   hour_GMT0 = localtime (&now)->tm_hour;
9231   unset_TZ ();
9232   hour_unset = localtime (&now)->tm_hour;
9233   if (putenv (TZ_PST8) != 0)
9234     exit (1);
9235   if (localtime (&now)->tm_hour == hour_GMT0)
9236     exit (1);
9237   unset_TZ ();
9238   if (localtime (&now)->tm_hour != hour_unset)
9239     exit (1);
9240   exit (0);
9241 }
9242 EOF
9243 if { (eval echo configure:9244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9244 then
9245   emacs_cv_localtime_cache=no
9246 else
9247   conftest_rc="$?"
9248   echo "configure: failed program was:" >&5
9249   cat conftest.$ac_ext >&5
9250   rm -fr conftest*
9251   emacs_cv_localtime_cache=yes
9252 fi
9253 rm -fr conftest*
9254 else
9255         # If we lack tzset, report that localtime does not cache TZ,
9256         # since we can't invalidate the cache if we don't have tzset.
9257         emacs_cv_localtime_cache=no
9258 fi
9259 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
9260 if test $emacs_cv_localtime_cache = yes; then
9261   { test "$extra_verbose" = "yes" && cat << \EOF
9262     Defining LOCALTIME_CACHE
9263 EOF
9264 cat >> confdefs.h <<\EOF
9265 #define LOCALTIME_CACHE 1
9266 EOF
9267 }
9268
9269 fi
9270
9271 if test "$HAVE_TIMEVAL" = "yes"; then
9272 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
9273 echo "configure:9274: checking whether gettimeofday accepts one or two arguments" >&5
9274 cat > conftest.$ac_ext <<EOF
9275 #line 9276 "configure"
9276 #include "confdefs.h"
9277
9278 #ifdef TIME_WITH_SYS_TIME
9279 #include <sys/time.h>
9280 #include <time.h>
9281 #else
9282 #ifdef HAVE_SYS_TIME_H
9283 #include <sys/time.h>
9284 #else
9285 #include <time.h>
9286 #endif
9287 #endif
9288   
9289 int main() {
9290
9291   struct timeval time;
9292   struct timezone dummy;
9293   gettimeofday (&time, &dummy);
9294
9295 ; return 0; }
9296 EOF
9297 if { (eval echo configure:9298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9298   rm -rf conftest*
9299   echo "$ac_t""two" 1>&6
9300 else
9301   echo "configure: failed program was:" >&5
9302   cat conftest.$ac_ext >&5
9303   rm -rf conftest*
9304   echo "$ac_t""one" 1>&6
9305    { test "$extra_verbose" = "yes" && cat << \EOF
9306     Defining GETTIMEOFDAY_ONE_ARGUMENT
9307 EOF
9308 cat >> confdefs.h <<\EOF
9309 #define GETTIMEOFDAY_ONE_ARGUMENT 1
9310 EOF
9311 }
9312
9313 fi
9314 rm -f conftest*
9315 fi
9316
9317
9318 echo $ac_n "checking for inline""... $ac_c" 1>&6
9319 echo "configure:9320: checking for inline" >&5
9320
9321 ac_cv_c_inline=no
9322 for ac_kw in inline __inline__ __inline; do
9323   cat > conftest.$ac_ext <<EOF
9324 #line 9325 "configure"
9325 #include "confdefs.h"
9326
9327 int main() {
9328 } $ac_kw foo() {
9329 ; return 0; }
9330 EOF
9331 if { (eval echo configure:9332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9332   rm -rf conftest*
9333   ac_cv_c_inline=$ac_kw; break
9334 else
9335   echo "configure: failed program was:" >&5
9336   cat conftest.$ac_ext >&5
9337 fi
9338 rm -f conftest*
9339 done
9340
9341
9342 echo "$ac_t""$ac_cv_c_inline" 1>&6
9343 case "$ac_cv_c_inline" in
9344   inline | yes) ;;
9345   no) { test "$extra_verbose" = "yes" && cat << \EOF
9346     Defining inline = 
9347 EOF
9348 cat >> confdefs.h <<\EOF
9349 #define inline 
9350 EOF
9351 }
9352  ;;
9353   *)  { test "$extra_verbose" = "yes" && cat << EOF
9354     Defining inline = $ac_cv_c_inline
9355 EOF
9356 cat >> confdefs.h <<EOF
9357 #define inline $ac_cv_c_inline
9358 EOF
9359 }
9360  ;;
9361 esac
9362
9363 if test "$ac_cv_c_inline" != "no"; then
9364   { test "$extra_verbose" = "yes" && cat << \EOF
9365     Defining HAVE_INLINE
9366 EOF
9367 cat >> confdefs.h <<\EOF
9368 #define HAVE_INLINE 1
9369 EOF
9370 }
9371
9372   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9373    echo "    xemacs will be linked with \"inline.o\""
9374  fi
9375 fi
9376
9377
9378 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9379 # for constant arguments.  Useless!
9380 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9381 echo "configure:9382: checking for working alloca.h" >&5
9382
9383 cat > conftest.$ac_ext <<EOF
9384 #line 9385 "configure"
9385 #include "confdefs.h"
9386 #include <alloca.h>
9387 int main() {
9388 char *p = alloca(2 * sizeof(int));
9389 ; return 0; }
9390 EOF
9391 if { (eval echo configure:9392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9392   rm -rf conftest*
9393   ac_cv_header_alloca_h=yes
9394 else
9395   echo "configure: failed program was:" >&5
9396   cat conftest.$ac_ext >&5
9397   rm -rf conftest*
9398   ac_cv_header_alloca_h=no
9399 fi
9400 rm -f conftest*
9401
9402 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9403 if test $ac_cv_header_alloca_h = yes; then
9404   { test "$extra_verbose" = "yes" && cat << \EOF
9405     Defining HAVE_ALLOCA_H
9406 EOF
9407 cat >> confdefs.h <<\EOF
9408 #define HAVE_ALLOCA_H 1
9409 EOF
9410 }
9411
9412 fi
9413
9414 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9415 echo "configure:9416: checking for alloca" >&5
9416
9417 cat > conftest.$ac_ext <<EOF
9418 #line 9419 "configure"
9419 #include "confdefs.h"
9420
9421 #ifdef __GNUC__
9422 # define alloca __builtin_alloca
9423 #else
9424 # ifdef _MSC_VER
9425 #  include <malloc.h>
9426 #  define alloca _alloca
9427 # else
9428 #  if HAVE_ALLOCA_H
9429 #   include <alloca.h>
9430 #  else
9431 #   ifdef _AIX
9432  #pragma alloca
9433 #   else
9434 #    ifndef alloca /* predefined by HP cc +Olibcalls */
9435 char *alloca ();
9436 #    endif
9437 #   endif
9438 #  endif
9439 # endif
9440 #endif
9441
9442 int main() {
9443 char *p = (char *) alloca(1);
9444 ; return 0; }
9445 EOF
9446 if { (eval echo configure:9447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9447   rm -rf conftest*
9448   ac_cv_func_alloca_works=yes
9449 else
9450   echo "configure: failed program was:" >&5
9451   cat conftest.$ac_ext >&5
9452   rm -rf conftest*
9453   ac_cv_func_alloca_works=no
9454 fi
9455 rm -f conftest*
9456
9457 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9458 if test $ac_cv_func_alloca_works = yes; then
9459   { test "$extra_verbose" = "yes" && cat << \EOF
9460     Defining HAVE_ALLOCA
9461 EOF
9462 cat >> confdefs.h <<\EOF
9463 #define HAVE_ALLOCA 1
9464 EOF
9465 }
9466
9467 fi
9468
9469 if test $ac_cv_func_alloca_works = no; then
9470   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9471   # that cause trouble.  Some versions do not even contain alloca or
9472   # contain a buggy version.  If you still want to use their alloca,
9473   # use ar to extract alloca.o from them instead of compiling alloca.c.
9474   ALLOCA=alloca.${ac_objext}
9475   { test "$extra_verbose" = "yes" && cat << \EOF
9476     Defining C_ALLOCA
9477 EOF
9478 cat >> confdefs.h <<\EOF
9479 #define C_ALLOCA 1
9480 EOF
9481 }
9482
9483
9484 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9485 echo "configure:9486: checking whether alloca needs Cray hooks" >&5
9486
9487 cat > conftest.$ac_ext <<EOF
9488 #line 9489 "configure"
9489 #include "confdefs.h"
9490 #if defined(CRAY) && ! defined(CRAY2)
9491 webecray
9492 #else
9493 wenotbecray
9494 #endif
9495
9496 EOF
9497 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9498   egrep "webecray" >/dev/null 2>&1; then
9499   rm -rf conftest*
9500   ac_cv_os_cray=yes
9501 else
9502   rm -rf conftest*
9503   ac_cv_os_cray=no
9504 fi
9505 rm -f conftest*
9506
9507
9508 echo "$ac_t""$ac_cv_os_cray" 1>&6
9509 if test $ac_cv_os_cray = yes; then
9510 for ac_func in _getb67 GETB67 getb67; do
9511   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9512 echo "configure:9513: checking for $ac_func" >&5
9513
9514 cat > conftest.$ac_ext <<EOF
9515 #line 9516 "configure"
9516 #include "confdefs.h"
9517 /* System header to define __stub macros and hopefully few prototypes,
9518     which can conflict with char $ac_func(); below.  */
9519 #include <assert.h>
9520 /* Override any gcc2 internal prototype to avoid an error.  */
9521 /* We use char because int might match the return type of a gcc2
9522     builtin and then its argument prototype would still apply.  */
9523 char $ac_func();
9524
9525 int main() {
9526
9527 /* The GNU C library defines this for functions which it implements
9528     to always fail with ENOSYS.  Some functions are actually named
9529     something starting with __ and the normal name is an alias.  */
9530 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9531 choke me
9532 #else
9533 $ac_func();
9534 #endif
9535
9536 ; return 0; }
9537 EOF
9538 if { (eval echo configure:9539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9539   rm -rf conftest*
9540   eval "ac_cv_func_$ac_func=yes"
9541 else
9542   echo "configure: failed program was:" >&5
9543   cat conftest.$ac_ext >&5
9544   rm -rf conftest*
9545   eval "ac_cv_func_$ac_func=no"
9546 fi
9547 rm -f conftest*
9548
9549 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9550   echo "$ac_t""yes" 1>&6
9551   { test "$extra_verbose" = "yes" && cat << EOF
9552     Defining CRAY_STACKSEG_END = $ac_func
9553 EOF
9554 cat >> confdefs.h <<EOF
9555 #define CRAY_STACKSEG_END $ac_func
9556 EOF
9557 }
9558
9559   break
9560 else
9561   echo "$ac_t""no" 1>&6
9562 fi
9563
9564 done
9565 fi
9566
9567 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9568 echo "configure:9569: checking stack direction for C alloca" >&5
9569
9570 cat > conftest.$ac_ext <<EOF
9571 #line 9572 "configure"
9572 #include "confdefs.h"
9573 find_stack_direction ()
9574 {
9575   static char *addr = 0;
9576   auto char dummy;
9577   if (addr == 0)
9578     {
9579       addr = &dummy;
9580       return find_stack_direction ();
9581     }
9582   else
9583     return (&dummy > addr) ? 1 : -1;
9584 }
9585 main ()
9586 {
9587   exit (find_stack_direction() < 0);
9588 }
9589 EOF
9590 if { (eval echo configure:9591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9591 then
9592   ac_cv_c_stack_direction=1
9593 else
9594   conftest_rc="$?"
9595   echo "configure: failed program was:" >&5
9596   cat conftest.$ac_ext >&5
9597   rm -fr conftest*
9598   ac_cv_c_stack_direction=-1
9599 fi
9600 rm -fr conftest*
9601
9602 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9603 { test "$extra_verbose" = "yes" && cat << EOF
9604     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9605 EOF
9606 cat >> confdefs.h <<EOF
9607 #define STACK_DIRECTION $ac_cv_c_stack_direction
9608 EOF
9609 }
9610
9611 fi
9612
9613 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9614    echo "    xemacs will be linked with \"$ALLOCA\""
9615  fi
9616
9617 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9618 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9619 echo "configure:9620: checking for vfork.h" >&5
9620
9621 cat > conftest.$ac_ext <<EOF
9622 #line 9623 "configure"
9623 #include "confdefs.h"
9624 #include <vfork.h>
9625 EOF
9626 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9627 { (eval echo configure:9628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9628 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9629 if test -z "$ac_err"; then
9630   rm -rf conftest*
9631   eval "ac_cv_header_$ac_safe=yes"
9632 else
9633   echo "$ac_err" >&5
9634   echo "configure: failed program was:" >&5
9635   cat conftest.$ac_ext >&5
9636   rm -rf conftest*
9637   eval "ac_cv_header_$ac_safe=no"
9638 fi
9639 rm -f conftest*
9640 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9641   echo "$ac_t""yes" 1>&6
9642   { test "$extra_verbose" = "yes" && cat << \EOF
9643     Defining HAVE_VFORK_H
9644 EOF
9645 cat >> confdefs.h <<\EOF
9646 #define HAVE_VFORK_H 1
9647 EOF
9648 }
9649
9650 else
9651   echo "$ac_t""no" 1>&6
9652 fi
9653
9654 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9655 echo "configure:9656: checking for working vfork" >&5
9656
9657 cat > conftest.$ac_ext <<EOF
9658 #line 9659 "configure"
9659 #include "confdefs.h"
9660 /* Thanks to Paul Eggert for this test.  */
9661 #include <stdio.h>
9662 #include <sys/types.h>
9663 #include <sys/stat.h>
9664 #ifdef HAVE_UNISTD_H
9665 #include <unistd.h>
9666 #endif
9667 #ifdef HAVE_VFORK_H
9668 #include <vfork.h>
9669 #endif
9670 /* On some sparc systems, changes by the child to local and incoming
9671    argument registers are propagated back to the parent.
9672    The compiler is told about this with #include <vfork.h>,
9673    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9674    Test for this by using a static variable whose address
9675    is put into a register that is clobbered by the vfork.  */
9676 static
9677 #ifdef __cplusplus
9678 sparc_address_test (int arg)
9679 #else
9680 sparc_address_test (arg) int arg;
9681 #endif
9682 {
9683   static pid_t child;
9684   if (!child) {
9685     child = vfork ();
9686     if (child < 0) {
9687       perror ("vfork");
9688       _exit(2);
9689     }
9690     if (!child) {
9691       arg = getpid();
9692       write(-1, "", 0);
9693       _exit (arg);
9694     }
9695   }
9696 }
9697 main() {
9698   pid_t parent = getpid ();
9699   pid_t child;
9700
9701   sparc_address_test ();
9702
9703   child = vfork ();
9704
9705   if (child == 0) {
9706     /* Here is another test for sparc vfork register problems.
9707        This test uses lots of local variables, at least
9708        as many local variables as main has allocated so far
9709        including compiler temporaries.  4 locals are enough for
9710        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9711        A buggy compiler should reuse the register of parent
9712        for one of the local variables, since it will think that
9713        parent can't possibly be used any more in this routine.
9714        Assigning to the local variable will thus munge parent
9715        in the parent process.  */
9716     pid_t
9717       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9718       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9719     /* Convince the compiler that p..p7 are live; otherwise, it might
9720        use the same hardware register for all 8 local variables.  */
9721     if (p != p1 || p != p2 || p != p3 || p != p4
9722         || p != p5 || p != p6 || p != p7)
9723       _exit(1);
9724
9725     /* On some systems (e.g. IRIX 3.3),
9726        vfork doesn't separate parent from child file descriptors.
9727        If the child closes a descriptor before it execs or exits,
9728        this munges the parent's descriptor as well.
9729        Test for this by closing stdout in the child.  */
9730     _exit(close(fileno(stdout)) != 0);
9731   } else {
9732     int status;
9733     struct stat st;
9734
9735     while (wait(&status) != child)
9736       ;
9737     exit(
9738          /* Was there some problem with vforking?  */
9739          child < 0
9740
9741          /* Did the child fail?  (This shouldn't happen.)  */
9742          || status
9743
9744          /* Did the vfork/compiler bug occur?  */
9745          || parent != getpid()
9746
9747          /* Did the file descriptor bug occur?  */
9748          || fstat(fileno(stdout), &st) != 0
9749          );
9750   }
9751 }
9752 EOF
9753 if { (eval echo configure:9754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9754 then
9755   ac_cv_func_vfork_works=yes
9756 else
9757   conftest_rc="$?"
9758   echo "configure: failed program was:" >&5
9759   cat conftest.$ac_ext >&5
9760   rm -fr conftest*
9761   ac_cv_func_vfork_works=no
9762 fi
9763 rm -fr conftest*
9764
9765 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9766 if test $ac_cv_func_vfork_works = no; then
9767   { test "$extra_verbose" = "yes" && cat << \EOF
9768     Defining vfork = fork
9769 EOF
9770 cat >> confdefs.h <<\EOF
9771 #define vfork fork
9772 EOF
9773 }
9774
9775 fi
9776
9777
9778 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9779 echo "configure:9780: checking for working strcoll" >&5
9780
9781 cat > conftest.$ac_ext <<EOF
9782 #line 9783 "configure"
9783 #include "confdefs.h"
9784 #include <string.h>
9785 main ()
9786 {
9787   exit (strcoll ("abc", "def") >= 0 ||
9788         strcoll ("ABC", "DEF") >= 0 ||
9789         strcoll ("123", "456") >= 0);
9790 }
9791 EOF
9792 if { (eval echo configure:9793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9793 then
9794   ac_cv_func_strcoll_works=yes
9795 else
9796   conftest_rc="$?"
9797   echo "configure: failed program was:" >&5
9798   cat conftest.$ac_ext >&5
9799   rm -fr conftest*
9800   ac_cv_func_strcoll_works=no
9801 fi
9802 rm -fr conftest*
9803
9804 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9805 if test $ac_cv_func_strcoll_works = yes; then
9806   { test "$extra_verbose" = "yes" && cat << \EOF
9807     Defining HAVE_STRCOLL
9808 EOF
9809 cat >> confdefs.h <<\EOF
9810 #define HAVE_STRCOLL 1
9811 EOF
9812 }
9813
9814 fi
9815
9816
9817 for ac_func in getpgrp
9818 do
9819 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9820 echo "configure:9821: checking for $ac_func" >&5
9821
9822 cat > conftest.$ac_ext <<EOF
9823 #line 9824 "configure"
9824 #include "confdefs.h"
9825 /* System header to define __stub macros and hopefully few prototypes,
9826     which can conflict with char $ac_func(); below.  */
9827 #include <assert.h>
9828 /* Override any gcc2 internal prototype to avoid an error.  */
9829 /* We use char because int might match the return type of a gcc2
9830     builtin and then its argument prototype would still apply.  */
9831 char $ac_func();
9832
9833 int main() {
9834
9835 /* The GNU C library defines this for functions which it implements
9836     to always fail with ENOSYS.  Some functions are actually named
9837     something starting with __ and the normal name is an alias.  */
9838 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9839 choke me
9840 #else
9841 $ac_func();
9842 #endif
9843
9844 ; return 0; }
9845 EOF
9846 if { (eval echo configure:9847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9847   rm -rf conftest*
9848   eval "ac_cv_func_$ac_func=yes"
9849 else
9850   echo "configure: failed program was:" >&5
9851   cat conftest.$ac_ext >&5
9852   rm -rf conftest*
9853   eval "ac_cv_func_$ac_func=no"
9854 fi
9855 rm -f conftest*
9856
9857 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9858   echo "$ac_t""yes" 1>&6
9859     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9860   { test "$extra_verbose" = "yes" && cat << EOF
9861     Defining $ac_tr_func
9862 EOF
9863 cat >> confdefs.h <<EOF
9864 #define $ac_tr_func 1
9865 EOF
9866 }
9867  
9868 else
9869   echo "$ac_t""no" 1>&6
9870 fi
9871 done
9872
9873 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9874 echo "configure:9875: checking whether getpgrp takes no argument" >&5
9875
9876 cat > conftest.$ac_ext <<EOF
9877 #line 9878 "configure"
9878 #include "confdefs.h"
9879
9880 /*
9881  * If this system has a BSD-style getpgrp(),
9882  * which takes a pid argument, exit unsuccessfully.
9883  *
9884  * Snarfed from Chet Ramey's bash pgrp.c test program
9885  */
9886 #include <stdio.h>
9887 #include <sys/types.h>
9888
9889 int     pid;
9890 int     pg1, pg2, pg3, pg4;
9891 int     ng, np, s, child;
9892
9893 main()
9894 {
9895         pid = getpid();
9896         pg1 = getpgrp(0);
9897         pg2 = getpgrp();
9898         pg3 = getpgrp(pid);
9899         pg4 = getpgrp(1);
9900
9901         /*
9902          * If all of these values are the same, it's pretty sure that
9903          * we're on a system that ignores getpgrp's first argument.
9904          */
9905         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9906                 exit(0);
9907
9908         child = fork();
9909         if (child < 0)
9910                 exit(1);
9911         else if (child == 0) {
9912                 np = getpid();
9913                 /*
9914                  * If this is Sys V, this will not work; pgrp will be
9915                  * set to np because setpgrp just changes a pgrp to be
9916                  * the same as the pid.
9917                  */
9918                 setpgrp(np, pg1);
9919                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9920                 if (ng == pg1) {
9921                         exit(1);
9922                 } else {
9923                         exit(0);
9924                 }
9925         } else {
9926                 wait(&s);
9927                 exit(s>>8);
9928         }
9929 }
9930
9931 EOF
9932 if { (eval echo configure:9933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9933 then
9934   ac_cv_func_getpgrp_void=yes
9935 else
9936   conftest_rc="$?"
9937   echo "configure: failed program was:" >&5
9938   cat conftest.$ac_ext >&5
9939   rm -fr conftest*
9940   ac_cv_func_getpgrp_void=no
9941 fi
9942 rm -fr conftest*
9943
9944
9945 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9946 if test $ac_cv_func_getpgrp_void = yes; then
9947   { test "$extra_verbose" = "yes" && cat << \EOF
9948     Defining GETPGRP_VOID
9949 EOF
9950 cat >> confdefs.h <<\EOF
9951 #define GETPGRP_VOID 1
9952 EOF
9953 }
9954
9955 fi
9956
9957
9958 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9959 echo "configure:9960: checking for working mmap" >&5
9960 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9961 cat > conftest.$ac_ext <<EOF
9962 #line 9963 "configure"
9963 #include "confdefs.h"
9964 #include <stdio.h>
9965 #include <unistd.h>
9966 #include <fcntl.h>
9967 #include <sys/mman.h>
9968
9969 #ifndef MAP_VARIABLE
9970 #define MAP_VARIABLE 0
9971 #endif
9972
9973 #ifndef MAP_FAILED
9974 #define MAP_FAILED -1
9975 #endif
9976
9977 int main (int argc, char *argv[])
9978 {
9979   int fd = -1;
9980   caddr_t p;
9981 #ifndef MAP_ANONYMOUS
9982   fd = open ("/dev/zero", O_RDWR);
9983   if (fd < 0)
9984     return 1;
9985 #define MAP_ANONYMOUS 0
9986 #endif
9987   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9988            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9989            fd, 0) != (void *) MAP_FAILED)
9990     return 0;
9991   perror ("conftest: mmap failed");
9992   return 1;
9993 }
9994 EOF
9995 if { (eval echo configure:9996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9996 then
9997   have_mmap=yes
9998 else
9999   conftest_rc="$?"
10000   echo "configure: failed program was:" >&5
10001   cat conftest.$ac_ext >&5
10002   rm -fr conftest*
10003   have_mmap=no
10004 fi
10005 rm -fr conftest* ;;
10006 esac
10007 echo "$ac_t""$have_mmap" 1>&6
10008 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10009     Defining HAVE_MMAP
10010 EOF
10011 cat >> confdefs.h <<\EOF
10012 #define HAVE_MMAP 1
10013 EOF
10014 }
10015
10016
10017 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
10018 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
10019 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10020     Defining REL_ALLOC
10021 EOF
10022 cat >> confdefs.h <<\EOF
10023 #define REL_ALLOC 1
10024 EOF
10025 }
10026
10027
10028 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
10029 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
10030 echo "configure:10031: checking for termios.h" >&5
10031
10032 cat > conftest.$ac_ext <<EOF
10033 #line 10034 "configure"
10034 #include "confdefs.h"
10035 #include <termios.h>
10036 EOF
10037 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10038 { (eval echo configure:10039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10039 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10040 if test -z "$ac_err"; then
10041   rm -rf conftest*
10042   eval "ac_cv_header_$ac_safe=yes"
10043 else
10044   echo "$ac_err" >&5
10045   echo "configure: failed program was:" >&5
10046   cat conftest.$ac_ext >&5
10047   rm -rf conftest*
10048   eval "ac_cv_header_$ac_safe=no"
10049 fi
10050 rm -f conftest*
10051 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10052   echo "$ac_t""yes" 1>&6
10053   { test "$extra_verbose" = "yes" && cat << \EOF
10054     Defining HAVE_TERMIOS
10055 EOF
10056 cat >> confdefs.h <<\EOF
10057 #define HAVE_TERMIOS 1
10058 EOF
10059 }
10060
10061   { test "$extra_verbose" = "yes" && cat << \EOF
10062     Defining SIGNALS_VIA_CHARACTERS
10063 EOF
10064 cat >> confdefs.h <<\EOF
10065 #define SIGNALS_VIA_CHARACTERS 1
10066 EOF
10067 }
10068
10069   { test "$extra_verbose" = "yes" && cat << \EOF
10070     Defining NO_TERMIO
10071 EOF
10072 cat >> confdefs.h <<\EOF
10073 #define NO_TERMIO 1
10074 EOF
10075 }
10076
10077 else
10078   echo "$ac_t""no" 1>&6
10079 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10080 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10081 echo "configure:10082: checking for termio.h" >&5
10082
10083 cat > conftest.$ac_ext <<EOF
10084 #line 10085 "configure"
10085 #include "confdefs.h"
10086 #include <termio.h>
10087 EOF
10088 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10089 { (eval echo configure:10090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10090 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10091 if test -z "$ac_err"; then
10092   rm -rf conftest*
10093   eval "ac_cv_header_$ac_safe=yes"
10094 else
10095   echo "$ac_err" >&5
10096   echo "configure: failed program was:" >&5
10097   cat conftest.$ac_ext >&5
10098   rm -rf conftest*
10099   eval "ac_cv_header_$ac_safe=no"
10100 fi
10101 rm -f conftest*
10102 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10103   echo "$ac_t""yes" 1>&6
10104   { test "$extra_verbose" = "yes" && cat << \EOF
10105     Defining HAVE_TERMIO
10106 EOF
10107 cat >> confdefs.h <<\EOF
10108 #define HAVE_TERMIO 1
10109 EOF
10110 }
10111
10112 else
10113   echo "$ac_t""no" 1>&6
10114 fi
10115
10116 fi
10117
10118
10119
10120 echo $ac_n "checking for socket""... $ac_c" 1>&6
10121 echo "configure:10122: checking for socket" >&5
10122
10123 cat > conftest.$ac_ext <<EOF
10124 #line 10125 "configure"
10125 #include "confdefs.h"
10126 /* System header to define __stub macros and hopefully few prototypes,
10127     which can conflict with char socket(); below.  */
10128 #include <assert.h>
10129 /* Override any gcc2 internal prototype to avoid an error.  */
10130 /* We use char because int might match the return type of a gcc2
10131     builtin and then its argument prototype would still apply.  */
10132 char socket();
10133
10134 int main() {
10135
10136 /* The GNU C library defines this for functions which it implements
10137     to always fail with ENOSYS.  Some functions are actually named
10138     something starting with __ and the normal name is an alias.  */
10139 #if defined (__stub_socket) || defined (__stub___socket)
10140 choke me
10141 #else
10142 socket();
10143 #endif
10144
10145 ; return 0; }
10146 EOF
10147 if { (eval echo configure:10148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10148   rm -rf conftest*
10149   eval "ac_cv_func_socket=yes"
10150 else
10151   echo "configure: failed program was:" >&5
10152   cat conftest.$ac_ext >&5
10153   rm -rf conftest*
10154   eval "ac_cv_func_socket=no"
10155 fi
10156 rm -f conftest*
10157
10158 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10159   echo "$ac_t""yes" 1>&6
10160   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10161 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10162 echo "configure:10163: checking for netinet/in.h" >&5
10163
10164 cat > conftest.$ac_ext <<EOF
10165 #line 10166 "configure"
10166 #include "confdefs.h"
10167 #include <netinet/in.h>
10168 EOF
10169 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10170 { (eval echo configure:10171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10171 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10172 if test -z "$ac_err"; then
10173   rm -rf conftest*
10174   eval "ac_cv_header_$ac_safe=yes"
10175 else
10176   echo "$ac_err" >&5
10177   echo "configure: failed program was:" >&5
10178   cat conftest.$ac_ext >&5
10179   rm -rf conftest*
10180   eval "ac_cv_header_$ac_safe=no"
10181 fi
10182 rm -f conftest*
10183 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10184   echo "$ac_t""yes" 1>&6
10185   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10186 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10187 echo "configure:10188: checking for arpa/inet.h" >&5
10188
10189 cat > conftest.$ac_ext <<EOF
10190 #line 10191 "configure"
10191 #include "confdefs.h"
10192 #include <arpa/inet.h>
10193 EOF
10194 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10195 { (eval echo configure:10196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10196 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10197 if test -z "$ac_err"; then
10198   rm -rf conftest*
10199   eval "ac_cv_header_$ac_safe=yes"
10200 else
10201   echo "$ac_err" >&5
10202   echo "configure: failed program was:" >&5
10203   cat conftest.$ac_ext >&5
10204   rm -rf conftest*
10205   eval "ac_cv_header_$ac_safe=no"
10206 fi
10207 rm -f conftest*
10208 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10209   echo "$ac_t""yes" 1>&6
10210   
10211   { test "$extra_verbose" = "yes" && cat << \EOF
10212     Defining HAVE_SOCKETS
10213 EOF
10214 cat >> confdefs.h <<\EOF
10215 #define HAVE_SOCKETS 1
10216 EOF
10217 }
10218
10219       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10220 echo "configure:10221: checking "for sun_len member in struct sockaddr_un"" >&5
10221       cat > conftest.$ac_ext <<EOF
10222 #line 10223 "configure"
10223 #include "confdefs.h"
10224
10225 #include <sys/types.h>
10226 #include <sys/socket.h>
10227 #include <sys/un.h>
10228       
10229 int main() {
10230 static struct sockaddr_un x; x.sun_len = 1;
10231 ; return 0; }
10232 EOF
10233 if { (eval echo configure:10234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10234   rm -rf conftest*
10235   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10236     Defining HAVE_SOCKADDR_SUN_LEN
10237 EOF
10238 cat >> confdefs.h <<\EOF
10239 #define HAVE_SOCKADDR_SUN_LEN 1
10240 EOF
10241 }
10242
10243 else
10244   echo "configure: failed program was:" >&5
10245   cat conftest.$ac_ext >&5
10246   rm -rf conftest*
10247   echo "$ac_t""no" 1>&6
10248 fi
10249 rm -f conftest*
10250       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10251 echo "configure:10252: checking "for ip_mreq struct in netinet/in.h"" >&5
10252       cat > conftest.$ac_ext <<EOF
10253 #line 10254 "configure"
10254 #include "confdefs.h"
10255
10256 #include <sys/types.h>
10257 #include <netinet/in.h>
10258       
10259 int main() {
10260 static struct ip_mreq x;
10261 ; return 0; }
10262 EOF
10263 if { (eval echo configure:10264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10264   rm -rf conftest*
10265   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10266     Defining HAVE_MULTICAST
10267 EOF
10268 cat >> confdefs.h <<\EOF
10269 #define HAVE_MULTICAST 1
10270 EOF
10271 }
10272
10273 else
10274   echo "configure: failed program was:" >&5
10275   cat conftest.$ac_ext >&5
10276   rm -rf conftest*
10277   echo "$ac_t""no" 1>&6
10278 fi
10279 rm -f conftest*
10280 else
10281   echo "$ac_t""no" 1>&6
10282 fi
10283
10284 else
10285   echo "$ac_t""no" 1>&6
10286 fi
10287
10288 else
10289   echo "$ac_t""no" 1>&6
10290 fi
10291
10292
10293 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10294 echo "configure:10295: checking for msgget" >&5
10295
10296 cat > conftest.$ac_ext <<EOF
10297 #line 10298 "configure"
10298 #include "confdefs.h"
10299 /* System header to define __stub macros and hopefully few prototypes,
10300     which can conflict with char msgget(); below.  */
10301 #include <assert.h>
10302 /* Override any gcc2 internal prototype to avoid an error.  */
10303 /* We use char because int might match the return type of a gcc2
10304     builtin and then its argument prototype would still apply.  */
10305 char msgget();
10306
10307 int main() {
10308
10309 /* The GNU C library defines this for functions which it implements
10310     to always fail with ENOSYS.  Some functions are actually named
10311     something starting with __ and the normal name is an alias.  */
10312 #if defined (__stub_msgget) || defined (__stub___msgget)
10313 choke me
10314 #else
10315 msgget();
10316 #endif
10317
10318 ; return 0; }
10319 EOF
10320 if { (eval echo configure:10321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10321   rm -rf conftest*
10322   eval "ac_cv_func_msgget=yes"
10323 else
10324   echo "configure: failed program was:" >&5
10325   cat conftest.$ac_ext >&5
10326   rm -rf conftest*
10327   eval "ac_cv_func_msgget=no"
10328 fi
10329 rm -f conftest*
10330
10331 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10332   echo "$ac_t""yes" 1>&6
10333   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10334 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10335 echo "configure:10336: checking for sys/ipc.h" >&5
10336
10337 cat > conftest.$ac_ext <<EOF
10338 #line 10339 "configure"
10339 #include "confdefs.h"
10340 #include <sys/ipc.h>
10341 EOF
10342 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10343 { (eval echo configure:10344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10344 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10345 if test -z "$ac_err"; then
10346   rm -rf conftest*
10347   eval "ac_cv_header_$ac_safe=yes"
10348 else
10349   echo "$ac_err" >&5
10350   echo "configure: failed program was:" >&5
10351   cat conftest.$ac_ext >&5
10352   rm -rf conftest*
10353   eval "ac_cv_header_$ac_safe=no"
10354 fi
10355 rm -f conftest*
10356 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10357   echo "$ac_t""yes" 1>&6
10358   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10359 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10360 echo "configure:10361: checking for sys/msg.h" >&5
10361
10362 cat > conftest.$ac_ext <<EOF
10363 #line 10364 "configure"
10364 #include "confdefs.h"
10365 #include <sys/msg.h>
10366 EOF
10367 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10368 { (eval echo configure:10369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10369 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10370 if test -z "$ac_err"; then
10371   rm -rf conftest*
10372   eval "ac_cv_header_$ac_safe=yes"
10373 else
10374   echo "$ac_err" >&5
10375   echo "configure: failed program was:" >&5
10376   cat conftest.$ac_ext >&5
10377   rm -rf conftest*
10378   eval "ac_cv_header_$ac_safe=no"
10379 fi
10380 rm -f conftest*
10381 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10382   echo "$ac_t""yes" 1>&6
10383   { test "$extra_verbose" = "yes" && cat << \EOF
10384     Defining HAVE_SYSVIPC
10385 EOF
10386 cat >> confdefs.h <<\EOF
10387 #define HAVE_SYSVIPC 1
10388 EOF
10389 }
10390
10391 else
10392   echo "$ac_t""no" 1>&6
10393 fi
10394
10395 else
10396   echo "$ac_t""no" 1>&6
10397 fi
10398
10399 else
10400   echo "$ac_t""no" 1>&6
10401 fi
10402
10403
10404 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10405 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10406 echo "configure:10407: checking for dirent.h" >&5
10407
10408 cat > conftest.$ac_ext <<EOF
10409 #line 10410 "configure"
10410 #include "confdefs.h"
10411 #include <dirent.h>
10412 EOF
10413 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10414 { (eval echo configure:10415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10415 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10416 if test -z "$ac_err"; then
10417   rm -rf conftest*
10418   eval "ac_cv_header_$ac_safe=yes"
10419 else
10420   echo "$ac_err" >&5
10421   echo "configure: failed program was:" >&5
10422   cat conftest.$ac_ext >&5
10423   rm -rf conftest*
10424   eval "ac_cv_header_$ac_safe=no"
10425 fi
10426 rm -f conftest*
10427 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10428   echo "$ac_t""yes" 1>&6
10429   { test "$extra_verbose" = "yes" && cat << \EOF
10430     Defining SYSV_SYSTEM_DIR
10431 EOF
10432 cat >> confdefs.h <<\EOF
10433 #define SYSV_SYSTEM_DIR 1
10434 EOF
10435 }
10436
10437 else
10438   echo "$ac_t""no" 1>&6
10439 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10440 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10441 echo "configure:10442: checking for sys/dir.h" >&5
10442
10443 cat > conftest.$ac_ext <<EOF
10444 #line 10445 "configure"
10445 #include "confdefs.h"
10446 #include <sys/dir.h>
10447 EOF
10448 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10449 { (eval echo configure:10450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10450 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10451 if test -z "$ac_err"; then
10452   rm -rf conftest*
10453   eval "ac_cv_header_$ac_safe=yes"
10454 else
10455   echo "$ac_err" >&5
10456   echo "configure: failed program was:" >&5
10457   cat conftest.$ac_ext >&5
10458   rm -rf conftest*
10459   eval "ac_cv_header_$ac_safe=no"
10460 fi
10461 rm -f conftest*
10462 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10463   echo "$ac_t""yes" 1>&6
10464   :
10465 else
10466   echo "$ac_t""no" 1>&6
10467 { test "$extra_verbose" = "yes" && cat << \EOF
10468     Defining NONSYSTEM_DIR_LIBRARY
10469 EOF
10470 cat >> confdefs.h <<\EOF
10471 #define NONSYSTEM_DIR_LIBRARY 1
10472 EOF
10473 }
10474
10475 fi
10476
10477 fi
10478
10479
10480 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10481 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10482 echo "configure:10483: checking for nlist.h" >&5
10483
10484 cat > conftest.$ac_ext <<EOF
10485 #line 10486 "configure"
10486 #include "confdefs.h"
10487 #include <nlist.h>
10488 EOF
10489 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10490 { (eval echo configure:10491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10491 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10492 if test -z "$ac_err"; then
10493   rm -rf conftest*
10494   eval "ac_cv_header_$ac_safe=yes"
10495 else
10496   echo "$ac_err" >&5
10497   echo "configure: failed program was:" >&5
10498   cat conftest.$ac_ext >&5
10499   rm -rf conftest*
10500   eval "ac_cv_header_$ac_safe=no"
10501 fi
10502 rm -f conftest*
10503 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10504   echo "$ac_t""yes" 1>&6
10505   { test "$extra_verbose" = "yes" && cat << \EOF
10506     Defining NLIST_STRUCT
10507 EOF
10508 cat >> confdefs.h <<\EOF
10509 #define NLIST_STRUCT 1
10510 EOF
10511 }
10512
10513 else
10514   echo "$ac_t""no" 1>&6
10515 fi
10516
10517
10518
10519 echo "checking "for sound support"" 1>&6
10520 echo "configure:10521: checking "for sound support"" >&5
10521 case "$with_sound" in
10522   native | both ) with_native_sound=yes;;
10523   nas    | no   ) with_native_sound=no;;
10524 esac
10525 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10526
10527 if test "$with_native_sound" != "no"; then
10528     if test -n "$native_sound_lib"; then
10529     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10530 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10531 echo "configure:10532: checking for multimedia/audio_device.h" >&5
10532
10533 cat > conftest.$ac_ext <<EOF
10534 #line 10535 "configure"
10535 #include "confdefs.h"
10536 #include <multimedia/audio_device.h>
10537 EOF
10538 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10539 { (eval echo configure:10540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10540 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10541 if test -z "$ac_err"; then
10542   rm -rf conftest*
10543   eval "ac_cv_header_$ac_safe=yes"
10544 else
10545   echo "$ac_err" >&5
10546   echo "configure: failed program was:" >&5
10547   cat conftest.$ac_ext >&5
10548   rm -rf conftest*
10549   eval "ac_cv_header_$ac_safe=no"
10550 fi
10551 rm -f conftest*
10552 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10553   echo "$ac_t""yes" 1>&6
10554   sound_found=yes sound_cflags=""
10555       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10556    echo "    xemacs will be linked with \"sunplay.o\""
10557  fi
10558 else
10559   echo "$ac_t""no" 1>&6
10560 fi
10561
10562   fi
10563
10564     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10565     sound_found=yes
10566     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10567    echo "    xemacs will be linked with \"sunplay.o\""
10568  fi
10569     if test -d "/usr/demo/SOUND/include"
10570       then sound_cflags="-I/usr/demo/SOUND/include"
10571       else sound_cflags="-I/usr/demo/SOUND"
10572     fi
10573     if test -z "$native_sound_lib" ; then
10574       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10575         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10576         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10577       fi
10578     fi
10579   fi
10580
10581     if test -z "$sound_found"; then
10582     case "$canonical" in
10583     *-sgi-* )
10584       if test -z "$native_sound_lib"; then
10585         
10586 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10587 echo "configure:10588: checking for ALopenport in -laudio" >&5
10588 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10589
10590 xe_check_libs=" -laudio "
10591 cat > conftest.$ac_ext <<EOF
10592 #line 10593 "configure"
10593 #include "confdefs.h"
10594 /* Override any gcc2 internal prototype to avoid an error.  */
10595 /* We use char because int might match the return type of a gcc2
10596     builtin and then its argument prototype would still apply.  */
10597 char ALopenport();
10598
10599 int main() {
10600 ALopenport()
10601 ; return 0; }
10602 EOF
10603 if { (eval echo configure:10604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10604   rm -rf conftest*
10605   eval "ac_cv_lib_$ac_lib_var=yes"
10606 else
10607   echo "configure: failed program was:" >&5
10608   cat conftest.$ac_ext >&5
10609   rm -rf conftest*
10610   eval "ac_cv_lib_$ac_lib_var=no"
10611 fi
10612 rm -f conftest*
10613 xe_check_libs=""
10614
10615 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10616   echo "$ac_t""yes" 1>&6
10617   native_sound_lib="-laudio"
10618 else
10619   echo "$ac_t""no" 1>&6
10620 fi
10621
10622
10623       fi
10624       if test -n "$native_sound_lib"; then
10625         sound_found=yes sound_cflags=""
10626         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10627    echo "    xemacs will be linked with \"sgiplay.o\""
10628  fi
10629       fi ;;
10630     hppa*-hp-hpux* )
10631       if test -z "$native_sound_lib"; then
10632         
10633 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10634 echo "configure:10635: checking for AOpenAudio in -lAlib" >&5
10635 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10636
10637 xe_check_libs=" -lAlib "
10638 cat > conftest.$ac_ext <<EOF
10639 #line 10640 "configure"
10640 #include "confdefs.h"
10641 /* Override any gcc2 internal prototype to avoid an error.  */
10642 /* We use char because int might match the return type of a gcc2
10643     builtin and then its argument prototype would still apply.  */
10644 char AOpenAudio();
10645
10646 int main() {
10647 AOpenAudio()
10648 ; return 0; }
10649 EOF
10650 if { (eval echo configure:10651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10651   rm -rf conftest*
10652   eval "ac_cv_lib_$ac_lib_var=yes"
10653 else
10654   echo "configure: failed program was:" >&5
10655   cat conftest.$ac_ext >&5
10656   rm -rf conftest*
10657   eval "ac_cv_lib_$ac_lib_var=no"
10658 fi
10659 rm -f conftest*
10660 xe_check_libs=""
10661
10662 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10663   echo "$ac_t""yes" 1>&6
10664   native_sound_lib="-lAlib"
10665 else
10666   echo "$ac_t""no" 1>&6
10667 fi
10668
10669
10670       fi
10671       if test -n "$native_sound_lib"; then
10672         sound_found=yes
10673         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10674    echo "    xemacs will be linked with \"hpplay.o\""
10675  fi
10676         if test "$GCC" = "yes" # Kludge city
10677           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10678           else sound_cflags="+e -I/usr/audio/examples"
10679         fi
10680       fi ;;
10681     esac
10682   fi
10683
10684     if test -z "$sound_found"; then
10685     for dir in "machine" "sys" "linux"; do
10686       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10687 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10688 echo "configure:10689: checking for ${dir}/soundcard.h" >&5
10689
10690 cat > conftest.$ac_ext <<EOF
10691 #line 10692 "configure"
10692 #include "confdefs.h"
10693 #include <${dir}/soundcard.h>
10694 EOF
10695 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10696 { (eval echo configure:10697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10697 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10698 if test -z "$ac_err"; then
10699   rm -rf conftest*
10700   eval "ac_cv_header_$ac_safe=yes"
10701 else
10702   echo "$ac_err" >&5
10703   echo "configure: failed program was:" >&5
10704   cat conftest.$ac_ext >&5
10705   rm -rf conftest*
10706   eval "ac_cv_header_$ac_safe=no"
10707 fi
10708 rm -f conftest*
10709 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10710   echo "$ac_t""yes" 1>&6
10711   sound_found=yes
10712         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10713    echo "    xemacs will be linked with \"linuxplay.o\""
10714  fi
10715         { test "$extra_verbose" = "yes" && cat << EOF
10716     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10717 EOF
10718 cat >> confdefs.h <<EOF
10719 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10720 EOF
10721 }
10722
10723         break
10724 else
10725   echo "$ac_t""no" 1>&6
10726 fi
10727
10728     done
10729   fi
10730
10731   test "$sound_found" = "yes" && with_native_sound=yes
10732 fi
10733
10734 if test -z "$with_sound"; then
10735   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10736     with_sound=native
10737   fi
10738 fi
10739
10740 if test "$with_native_sound" = "yes"; then
10741   { test "$extra_verbose" = "yes" && cat << \EOF
10742     Defining HAVE_NATIVE_SOUND
10743 EOF
10744 cat >> confdefs.h <<\EOF
10745 #define HAVE_NATIVE_SOUND 1
10746 EOF
10747 }
10748
10749   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10750 fi
10751
10752 case "$with_sound" in both | nas )
10753   { test "$extra_verbose" = "yes" && cat << \EOF
10754     Defining HAVE_NAS_SOUND
10755 EOF
10756 cat >> confdefs.h <<\EOF
10757 #define HAVE_NAS_SOUND 1
10758 EOF
10759 }
10760
10761   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10762    echo "    xemacs will be linked with \"nas.o\""
10763  fi
10764   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10765       cat > conftest.$ac_ext <<EOF
10766 #line 10767 "configure"
10767 #include "confdefs.h"
10768 #include <audio/Xtutil.h>
10769 EOF
10770 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10771   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10772   :
10773 else
10774   rm -rf conftest*
10775   { test "$extra_verbose" = "yes" && cat << \EOF
10776     Defining NAS_NO_ERROR_JUMP
10777 EOF
10778 cat >> confdefs.h <<\EOF
10779 #define NAS_NO_ERROR_JUMP 1
10780 EOF
10781 }
10782
10783 fi
10784 rm -f conftest*
10785
10786 esac
10787
10788
10789 test -z "$with_tty" && with_tty=yes
10790
10791 if test "$with_tty" = "yes"  ; then
10792   echo "checking for TTY-related features" 1>&6
10793 echo "configure:10794: checking for TTY-related features" >&5
10794   { test "$extra_verbose" = "yes" && cat << \EOF
10795     Defining HAVE_TTY
10796 EOF
10797 cat >> confdefs.h <<\EOF
10798 #define HAVE_TTY 1
10799 EOF
10800 }
10801
10802   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
10803    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\""
10804  fi
10805
10806     if test -z "$with_ncurses"; then
10807     
10808 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10809 echo "configure:10810: checking for tgetent in -lncurses" >&5
10810 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10811
10812 xe_check_libs=" -lncurses "
10813 cat > conftest.$ac_ext <<EOF
10814 #line 10815 "configure"
10815 #include "confdefs.h"
10816 /* Override any gcc2 internal prototype to avoid an error.  */
10817 /* We use char because int might match the return type of a gcc2
10818     builtin and then its argument prototype would still apply.  */
10819 char tgetent();
10820
10821 int main() {
10822 tgetent()
10823 ; return 0; }
10824 EOF
10825 if { (eval echo configure:10826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10826   rm -rf conftest*
10827   eval "ac_cv_lib_$ac_lib_var=yes"
10828 else
10829   echo "configure: failed program was:" >&5
10830   cat conftest.$ac_ext >&5
10831   rm -rf conftest*
10832   eval "ac_cv_lib_$ac_lib_var=no"
10833 fi
10834 rm -f conftest*
10835 xe_check_libs=""
10836
10837 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10838   echo "$ac_t""yes" 1>&6
10839   with_ncurses=yes
10840 else
10841   echo "$ac_t""no" 1>&6
10842 with_ncurses=no
10843 fi
10844
10845
10846   fi
10847   if test "$with_ncurses" = "yes"; then
10848     { test "$extra_verbose" = "yes" && cat << \EOF
10849     Defining HAVE_NCURSES
10850 EOF
10851 cat >> confdefs.h <<\EOF
10852 #define HAVE_NCURSES 1
10853 EOF
10854 }
10855
10856     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10857 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10858 echo "configure:10859: checking for ncurses/curses.h" >&5
10859
10860 cat > conftest.$ac_ext <<EOF
10861 #line 10862 "configure"
10862 #include "confdefs.h"
10863 #include <ncurses/curses.h>
10864 EOF
10865 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10866 { (eval echo configure:10867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10867 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10868 if test -z "$ac_err"; then
10869   rm -rf conftest*
10870   eval "ac_cv_header_$ac_safe=yes"
10871 else
10872   echo "$ac_err" >&5
10873   echo "configure: failed program was:" >&5
10874   cat conftest.$ac_ext >&5
10875   rm -rf conftest*
10876   eval "ac_cv_header_$ac_safe=no"
10877 fi
10878 rm -f conftest*
10879 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10880   echo "$ac_t""yes" 1>&6
10881   curses_h_path=ncurses/curses.h
10882 else
10883   echo "$ac_t""no" 1>&6
10884 fi
10885
10886     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10887 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10888 echo "configure:10889: checking for ncurses/term.h" >&5
10889
10890 cat > conftest.$ac_ext <<EOF
10891 #line 10892 "configure"
10892 #include "confdefs.h"
10893 #include <ncurses/term.h>
10894 EOF
10895 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10896 { (eval echo configure:10897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10897 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10898 if test -z "$ac_err"; then
10899   rm -rf conftest*
10900   eval "ac_cv_header_$ac_safe=yes"
10901 else
10902   echo "$ac_err" >&5
10903   echo "configure: failed program was:" >&5
10904   cat conftest.$ac_ext >&5
10905   rm -rf conftest*
10906   eval "ac_cv_header_$ac_safe=no"
10907 fi
10908 rm -f conftest*
10909 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10910   echo "$ac_t""yes" 1>&6
10911   term_h_path=ncurses/term.h
10912 else
10913   echo "$ac_t""no" 1>&6
10914 fi
10915
10916     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10917    echo "    xemacs will be linked with \"terminfo.o\""
10918  fi
10919     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10920
10921     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10922                         save_c_switch_site="$c_switch_site"
10923       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10924       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10925 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10926 echo "configure:10927: checking for ncurses/curses.h" >&5
10927
10928 cat > conftest.$ac_ext <<EOF
10929 #line 10930 "configure"
10930 #include "confdefs.h"
10931 #include <ncurses/curses.h>
10932 EOF
10933 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10934 { (eval echo configure:10935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10935 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10936 if test -z "$ac_err"; then
10937   rm -rf conftest*
10938   eval "ac_cv_header_$ac_safe=yes"
10939 else
10940   echo "$ac_err" >&5
10941   echo "configure: failed program was:" >&5
10942   cat conftest.$ac_ext >&5
10943   rm -rf conftest*
10944   eval "ac_cv_header_$ac_safe=no"
10945 fi
10946 rm -f conftest*
10947 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10948   echo "$ac_t""yes" 1>&6
10949   curses_h_path=ncurses/curses.h
10950 else
10951   echo "$ac_t""no" 1>&6
10952 fi
10953
10954       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10955         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10956         else c_switch_site="$save_c_switch_site"
10957       fi
10958     fi
10959   else         if test "$have_terminfo" = "yes"; then
10960       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10961    echo "    xemacs will be linked with \"terminfo.o\""
10962  fi
10963       if test -n "$libs_termcap"; then
10964         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10965       else
10966         for lib in curses termlib termcap; do
10967           
10968 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10969 echo "configure:10970: checking for tgetent in -l$lib" >&5
10970 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10971
10972 xe_check_libs=" -l$lib "
10973 cat > conftest.$ac_ext <<EOF
10974 #line 10975 "configure"
10975 #include "confdefs.h"
10976 /* Override any gcc2 internal prototype to avoid an error.  */
10977 /* We use char because int might match the return type of a gcc2
10978     builtin and then its argument prototype would still apply.  */
10979 char tgetent();
10980
10981 int main() {
10982 tgetent()
10983 ; return 0; }
10984 EOF
10985 if { (eval echo configure:10986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10986   rm -rf conftest*
10987   eval "ac_cv_lib_$ac_lib_var=yes"
10988 else
10989   echo "configure: failed program was:" >&5
10990   cat conftest.$ac_ext >&5
10991   rm -rf conftest*
10992   eval "ac_cv_lib_$ac_lib_var=no"
10993 fi
10994 rm -f conftest*
10995 xe_check_libs=""
10996
10997 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10998   echo "$ac_t""yes" 1>&6
10999   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
11000 else
11001   echo "$ac_t""no" 1>&6
11002 fi
11003
11004
11005         done
11006       fi
11007     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
11008    echo "    xemacs will be linked with \"tparam.o\""
11009  fi
11010                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
11011       if test -n "$libs_termcap"; then
11012         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11013       else
11014         
11015 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
11016 echo "configure:11017: checking for tgetent in -lcurses" >&5
11017 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
11018
11019 xe_check_libs=" -lcurses "
11020 cat > conftest.$ac_ext <<EOF
11021 #line 11022 "configure"
11022 #include "confdefs.h"
11023 /* Override any gcc2 internal prototype to avoid an error.  */
11024 /* We use char because int might match the return type of a gcc2
11025     builtin and then its argument prototype would still apply.  */
11026 char tgetent();
11027
11028 int main() {
11029 tgetent()
11030 ; return 0; }
11031 EOF
11032 if { (eval echo configure:11033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11033   rm -rf conftest*
11034   eval "ac_cv_lib_$ac_lib_var=yes"
11035 else
11036   echo "configure: failed program was:" >&5
11037   cat conftest.$ac_ext >&5
11038   rm -rf conftest*
11039   eval "ac_cv_lib_$ac_lib_var=no"
11040 fi
11041 rm -f conftest*
11042 xe_check_libs=""
11043
11044 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11045   echo "$ac_t""yes" 1>&6
11046   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
11047 else
11048   echo "$ac_t""no" 1>&6
11049 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
11050 echo "configure:11051: checking for tgetent in -ltermcap" >&5
11051 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
11052
11053 xe_check_libs=" -ltermcap "
11054 cat > conftest.$ac_ext <<EOF
11055 #line 11056 "configure"
11056 #include "confdefs.h"
11057 /* Override any gcc2 internal prototype to avoid an error.  */
11058 /* We use char because int might match the return type of a gcc2
11059     builtin and then its argument prototype would still apply.  */
11060 char tgetent();
11061
11062 int main() {
11063 tgetent()
11064 ; return 0; }
11065 EOF
11066 if { (eval echo configure:11067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11067   rm -rf conftest*
11068   eval "ac_cv_lib_$ac_lib_var=yes"
11069 else
11070   echo "configure: failed program was:" >&5
11071   cat conftest.$ac_ext >&5
11072   rm -rf conftest*
11073   eval "ac_cv_lib_$ac_lib_var=no"
11074 fi
11075 rm -f conftest*
11076 xe_check_libs=""
11077
11078 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11079   echo "$ac_t""yes" 1>&6
11080   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11081 else
11082   echo "$ac_t""no" 1>&6
11083 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11084    echo "    xemacs will be linked with \"termcap.o\""
11085  fi
11086 fi
11087
11088
11089 fi
11090
11091
11092       fi
11093     fi
11094   fi
11095   { test "$extra_verbose" = "yes" && cat << EOF
11096     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11097 EOF
11098 cat >> confdefs.h <<EOF
11099 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11100 EOF
11101 }
11102
11103   { test "$extra_verbose" = "yes" && cat << EOF
11104     Defining TERM_H_PATH = "${term_h_path-term.h}"
11105 EOF
11106 cat >> confdefs.h <<EOF
11107 #define TERM_H_PATH "${term_h_path-term.h}"
11108 EOF
11109 }
11110
11111
11112     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11113 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11114 echo "configure:11115: checking for gpm.h" >&5
11115
11116 cat > conftest.$ac_ext <<EOF
11117 #line 11118 "configure"
11118 #include "confdefs.h"
11119 #include <gpm.h>
11120 EOF
11121 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11122 { (eval echo configure:11123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11123 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11124 if test -z "$ac_err"; then
11125   rm -rf conftest*
11126   eval "ac_cv_header_$ac_safe=yes"
11127 else
11128   echo "$ac_err" >&5
11129   echo "configure: failed program was:" >&5
11130   cat conftest.$ac_ext >&5
11131   rm -rf conftest*
11132   eval "ac_cv_header_$ac_safe=no"
11133 fi
11134 rm -f conftest*
11135 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11136   echo "$ac_t""yes" 1>&6
11137   :
11138 else
11139   echo "$ac_t""no" 1>&6
11140 with_gpm=no
11141 fi
11142  }
11143   test -z "$with_gpm" && { 
11144 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11145 echo "configure:11146: checking for Gpm_Open in -lgpm" >&5
11146 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11147
11148 xe_check_libs=" -lgpm "
11149 cat > conftest.$ac_ext <<EOF
11150 #line 11151 "configure"
11151 #include "confdefs.h"
11152 /* Override any gcc2 internal prototype to avoid an error.  */
11153 /* We use char because int might match the return type of a gcc2
11154     builtin and then its argument prototype would still apply.  */
11155 char Gpm_Open();
11156
11157 int main() {
11158 Gpm_Open()
11159 ; return 0; }
11160 EOF
11161 if { (eval echo configure:11162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11162   rm -rf conftest*
11163   eval "ac_cv_lib_$ac_lib_var=yes"
11164 else
11165   echo "configure: failed program was:" >&5
11166   cat conftest.$ac_ext >&5
11167   rm -rf conftest*
11168   eval "ac_cv_lib_$ac_lib_var=no"
11169 fi
11170 rm -f conftest*
11171 xe_check_libs=""
11172
11173 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11174   echo "$ac_t""yes" 1>&6
11175   with_gpm=yes
11176 else
11177   echo "$ac_t""no" 1>&6
11178 with_gpm=no
11179 fi
11180
11181  }
11182   if test "$with_gpm" = "yes"; then
11183     { test "$extra_verbose" = "yes" && cat << \EOF
11184     Defining HAVE_GPM
11185 EOF
11186 cat >> confdefs.h <<\EOF
11187 #define HAVE_GPM 1
11188 EOF
11189 }
11190
11191     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11192    echo "    xemacs will be linked with \"gpmevent.o\""
11193  fi
11194     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11195   fi
11196
11197 else   for feature in ncurses gpm; do
11198     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11199       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11200     fi
11201     eval "with_${feature}=no"
11202   done
11203 fi 
11204 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11205    echo "    xemacs will be linked with \"event-unixoid.o\""
11206  fi
11207
11208
11209 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11210   != "no no no" && echo "checking for database support" 1>&6
11211 echo "configure:11212: checking for database support" >&5
11212
11213 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11214   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11215 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11216 echo "configure:11217: checking for ndbm.h" >&5
11217
11218 cat > conftest.$ac_ext <<EOF
11219 #line 11220 "configure"
11220 #include "confdefs.h"
11221 #include <ndbm.h>
11222 EOF
11223 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11224 { (eval echo configure:11225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11225 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11226 if test -z "$ac_err"; then
11227   rm -rf conftest*
11228   eval "ac_cv_header_$ac_safe=yes"
11229 else
11230   echo "$ac_err" >&5
11231   echo "configure: failed program was:" >&5
11232   cat conftest.$ac_ext >&5
11233   rm -rf conftest*
11234   eval "ac_cv_header_$ac_safe=no"
11235 fi
11236 rm -f conftest*
11237 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11238   echo "$ac_t""yes" 1>&6
11239   :
11240 else
11241   echo "$ac_t""no" 1>&6
11242
11243     test "$with_database_gnudbm" = "yes" -o \
11244          "$with_database_dbm"    = "yes" && \
11245       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11246     with_database_gnudbm=no with_database_dbm=no
11247 fi
11248
11249 fi
11250
11251 if test "$with_database_gnudbm" != "no"; then
11252   
11253 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11254 echo "configure:11255: checking for dbm_open in -lgdbm" >&5
11255 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11256
11257 xe_check_libs=" -lgdbm "
11258 cat > conftest.$ac_ext <<EOF
11259 #line 11260 "configure"
11260 #include "confdefs.h"
11261 /* Override any gcc2 internal prototype to avoid an error.  */
11262 /* We use char because int might match the return type of a gcc2
11263     builtin and then its argument prototype would still apply.  */
11264 char dbm_open();
11265
11266 int main() {
11267 dbm_open()
11268 ; return 0; }
11269 EOF
11270 if { (eval echo configure:11271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11271   rm -rf conftest*
11272   eval "ac_cv_lib_$ac_lib_var=yes"
11273 else
11274   echo "configure: failed program was:" >&5
11275   cat conftest.$ac_ext >&5
11276   rm -rf conftest*
11277   eval "ac_cv_lib_$ac_lib_var=no"
11278 fi
11279 rm -f conftest*
11280 xe_check_libs=""
11281
11282 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11283   echo "$ac_t""yes" 1>&6
11284   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11285 else
11286   echo "$ac_t""no" 1>&6
11287 if test "$with_database_gnudbm" = "yes"; then
11288      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11289    fi
11290    with_database_gnudbm=no
11291 fi
11292
11293
11294 fi
11295
11296 if test "$with_database_dbm" != "no"; then
11297   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11298 echo "configure:11299: checking for dbm_open" >&5
11299
11300 cat > conftest.$ac_ext <<EOF
11301 #line 11302 "configure"
11302 #include "confdefs.h"
11303 /* System header to define __stub macros and hopefully few prototypes,
11304     which can conflict with char dbm_open(); below.  */
11305 #include <assert.h>
11306 /* Override any gcc2 internal prototype to avoid an error.  */
11307 /* We use char because int might match the return type of a gcc2
11308     builtin and then its argument prototype would still apply.  */
11309 char dbm_open();
11310
11311 int main() {
11312
11313 /* The GNU C library defines this for functions which it implements
11314     to always fail with ENOSYS.  Some functions are actually named
11315     something starting with __ and the normal name is an alias.  */
11316 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11317 choke me
11318 #else
11319 dbm_open();
11320 #endif
11321
11322 ; return 0; }
11323 EOF
11324 if { (eval echo configure:11325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11325   rm -rf conftest*
11326   eval "ac_cv_func_dbm_open=yes"
11327 else
11328   echo "configure: failed program was:" >&5
11329   cat conftest.$ac_ext >&5
11330   rm -rf conftest*
11331   eval "ac_cv_func_dbm_open=no"
11332 fi
11333 rm -f conftest*
11334
11335 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11336   echo "$ac_t""yes" 1>&6
11337   with_database_dbm=yes libdbm=
11338 else
11339   echo "$ac_t""no" 1>&6
11340
11341     
11342 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11343 echo "configure:11344: checking for dbm_open in -ldbm" >&5
11344 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11345
11346 xe_check_libs=" -ldbm "
11347 cat > conftest.$ac_ext <<EOF
11348 #line 11349 "configure"
11349 #include "confdefs.h"
11350 /* Override any gcc2 internal prototype to avoid an error.  */
11351 /* We use char because int might match the return type of a gcc2
11352     builtin and then its argument prototype would still apply.  */
11353 char dbm_open();
11354
11355 int main() {
11356 dbm_open()
11357 ; return 0; }
11358 EOF
11359 if { (eval echo configure:11360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11360   rm -rf conftest*
11361   eval "ac_cv_lib_$ac_lib_var=yes"
11362 else
11363   echo "configure: failed program was:" >&5
11364   cat conftest.$ac_ext >&5
11365   rm -rf conftest*
11366   eval "ac_cv_lib_$ac_lib_var=no"
11367 fi
11368 rm -f conftest*
11369 xe_check_libs=""
11370
11371 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11372   echo "$ac_t""yes" 1>&6
11373   with_database_dbm=yes libdbm=-ldbm
11374 else
11375   echo "$ac_t""no" 1>&6
11376 test "$with_database_dbm" = "yes" && \
11377         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11378       with_database_dbm=no
11379 fi
11380
11381
11382 fi
11383
11384 fi
11385
11386 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11387 test "$with_database_gnudbm" = "yes" -o \
11388      "$with_database_dbm"    = "yes" && \
11389   { test "$extra_verbose" = "yes" && cat << \EOF
11390     Defining HAVE_DBM
11391 EOF
11392 cat >> confdefs.h <<\EOF
11393 #define HAVE_DBM 1
11394 EOF
11395 }
11396
11397
11398 if test "$with_database_berkdb" != "no"; then
11399   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11400 echo "configure:11401: checking for Berkeley db.h" >&5
11401   for path in "db/db.h" "db.h"; do
11402     cat > conftest.$ac_ext <<EOF
11403 #line 11404 "configure"
11404 #include "confdefs.h"
11405 #ifdef HAVE_INTTYPES_H
11406 #define __BIT_TYPES_DEFINED__
11407 #include <inttypes.h>
11408 typedef uint8_t  u_int8_t;
11409 typedef uint16_t u_int16_t;
11410 typedef uint32_t u_int32_t;
11411 #ifdef WE_DONT_NEED_QUADS
11412 typedef uint64_t u_int64_t;
11413 #endif
11414 #endif
11415 #include <$path>
11416
11417 int main() {
11418
11419 ; return 0; }
11420 EOF
11421 if { (eval echo configure:11422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11422   rm -rf conftest*
11423   db_h_path="$path"; break
11424 else
11425   echo "configure: failed program was:" >&5
11426   cat conftest.$ac_ext >&5
11427 fi
11428 rm -f conftest*
11429   done
11430   if test -z "$db_h_path"
11431   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11432   else echo "$ac_t""$db_h_path" 1>&6
11433   fi
11434
11435   if test "$with_database_berkdb" != "no"; then
11436     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11437 echo "configure:11438: checking for Berkeley DB version" >&5
11438     cat > conftest.$ac_ext <<EOF
11439 #line 11440 "configure"
11440 #include "confdefs.h"
11441 #include <$db_h_path>
11442 #if DB_VERSION_MAJOR > 1
11443 yes
11444 #endif
11445
11446 EOF
11447 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11448   egrep "yes" >/dev/null 2>&1; then
11449   rm -rf conftest*
11450   echo "$ac_t""2" 1>&6; dbfunc=db_open
11451 else
11452   rm -rf conftest*
11453   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11454 fi
11455 rm -f conftest*
11456
11457     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11458 echo "configure:11459: checking for $dbfunc" >&5
11459
11460 cat > conftest.$ac_ext <<EOF
11461 #line 11462 "configure"
11462 #include "confdefs.h"
11463 /* System header to define __stub macros and hopefully few prototypes,
11464     which can conflict with char $dbfunc(); below.  */
11465 #include <assert.h>
11466 /* Override any gcc2 internal prototype to avoid an error.  */
11467 /* We use char because int might match the return type of a gcc2
11468     builtin and then its argument prototype would still apply.  */
11469 char $dbfunc();
11470
11471 int main() {
11472
11473 /* The GNU C library defines this for functions which it implements
11474     to always fail with ENOSYS.  Some functions are actually named
11475     something starting with __ and the normal name is an alias.  */
11476 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11477 choke me
11478 #else
11479 $dbfunc();
11480 #endif
11481
11482 ; return 0; }
11483 EOF
11484 if { (eval echo configure:11485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11485   rm -rf conftest*
11486   eval "ac_cv_func_$dbfunc=yes"
11487 else
11488   echo "configure: failed program was:" >&5
11489   cat conftest.$ac_ext >&5
11490   rm -rf conftest*
11491   eval "ac_cv_func_$dbfunc=no"
11492 fi
11493 rm -f conftest*
11494
11495 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11496   echo "$ac_t""yes" 1>&6
11497   with_database_berkdb=yes need_libdb=no
11498 else
11499   echo "$ac_t""no" 1>&6
11500
11501     
11502 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11503 echo "configure:11504: checking for $dbfunc in -ldb" >&5
11504 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11505
11506 xe_check_libs=" -ldb "
11507 cat > conftest.$ac_ext <<EOF
11508 #line 11509 "configure"
11509 #include "confdefs.h"
11510 /* Override any gcc2 internal prototype to avoid an error.  */
11511 /* We use char because int might match the return type of a gcc2
11512     builtin and then its argument prototype would still apply.  */
11513 char $dbfunc();
11514
11515 int main() {
11516 $dbfunc()
11517 ; return 0; }
11518 EOF
11519 if { (eval echo configure:11520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11520   rm -rf conftest*
11521   eval "ac_cv_lib_$ac_lib_var=yes"
11522 else
11523   echo "configure: failed program was:" >&5
11524   cat conftest.$ac_ext >&5
11525   rm -rf conftest*
11526   eval "ac_cv_lib_$ac_lib_var=no"
11527 fi
11528 rm -f conftest*
11529 xe_check_libs=""
11530
11531 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11532   echo "$ac_t""yes" 1>&6
11533   with_database_berkdb=yes need_libdb=yes
11534 else
11535   echo "$ac_t""no" 1>&6
11536 fi
11537
11538
11539 fi
11540
11541   fi
11542
11543   if test "$with_database_berkdb" = "yes"; then
11544     { test "$extra_verbose" = "yes" && cat << EOF
11545     Defining DB_H_PATH = "$db_h_path"
11546 EOF
11547 cat >> confdefs.h <<EOF
11548 #define DB_H_PATH "$db_h_path"
11549 EOF
11550 }
11551
11552     { test "$extra_verbose" = "yes" && cat << \EOF
11553     Defining HAVE_BERKELEY_DB
11554 EOF
11555 cat >> confdefs.h <<\EOF
11556 #define HAVE_BERKELEY_DB 1
11557 EOF
11558 }
11559
11560     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11561   else with_database_berkdb=no
11562   fi
11563 fi
11564
11565 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11566      != "no no no"; then
11567   { test "$extra_verbose" = "yes" && cat << \EOF
11568     Defining HAVE_DATABASE
11569 EOF
11570 cat >> confdefs.h <<\EOF
11571 #define HAVE_DATABASE 1
11572 EOF
11573 }
11574
11575   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11576    echo "    xemacs will be linked with \"database.o\""
11577  fi
11578 fi
11579
11580 if test "$with_socks" = "yes"; then
11581   
11582 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11583 echo "configure:11584: checking for SOCKSinit in -lsocks" >&5
11584 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11585
11586 xe_check_libs=" -lsocks "
11587 cat > conftest.$ac_ext <<EOF
11588 #line 11589 "configure"
11589 #include "confdefs.h"
11590 /* Override any gcc2 internal prototype to avoid an error.  */
11591 /* We use char because int might match the return type of a gcc2
11592     builtin and then its argument prototype would still apply.  */
11593 char SOCKSinit();
11594
11595 int main() {
11596 SOCKSinit()
11597 ; return 0; }
11598 EOF
11599 if { (eval echo configure:11600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11600   rm -rf conftest*
11601   eval "ac_cv_lib_$ac_lib_var=yes"
11602 else
11603   echo "configure: failed program was:" >&5
11604   cat conftest.$ac_ext >&5
11605   rm -rf conftest*
11606   eval "ac_cv_lib_$ac_lib_var=no"
11607 fi
11608 rm -f conftest*
11609 xe_check_libs=""
11610
11611 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11612   echo "$ac_t""yes" 1>&6
11613     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11614     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11615   { test "$extra_verbose" = "yes" && cat << EOF
11616     Defining $ac_tr_lib
11617 EOF
11618 cat >> confdefs.h <<EOF
11619 #define $ac_tr_lib 1
11620 EOF
11621 }
11622
11623   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11624
11625 else
11626   echo "$ac_t""no" 1>&6
11627 fi
11628
11629
11630   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11631     Defining HAVE_SOCKS
11632 EOF
11633 cat >> confdefs.h <<\EOF
11634 #define HAVE_SOCKS 1
11635 EOF
11636 }
11637
11638 fi
11639
11640 if test "$usage_tracking" = "yes"; then
11641   { test "$extra_verbose" = "yes" && cat << \EOF
11642     Defining USAGE_TRACKING
11643 EOF
11644 cat >> confdefs.h <<\EOF
11645 #define USAGE_TRACKING 1
11646 EOF
11647 }
11648
11649   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11650 fi
11651
11652 for ac_hdr in dlfcn.h
11653 do
11654 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11655 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11656 echo "configure:11657: checking for $ac_hdr" >&5
11657
11658 cat > conftest.$ac_ext <<EOF
11659 #line 11660 "configure"
11660 #include "confdefs.h"
11661 #include <$ac_hdr>
11662 EOF
11663 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11664 { (eval echo configure:11665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11665 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11666 if test -z "$ac_err"; then
11667   rm -rf conftest*
11668   eval "ac_cv_header_$ac_safe=yes"
11669 else
11670   echo "$ac_err" >&5
11671   echo "configure: failed program was:" >&5
11672   cat conftest.$ac_ext >&5
11673   rm -rf conftest*
11674   eval "ac_cv_header_$ac_safe=no"
11675 fi
11676 rm -f conftest*
11677 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11678   echo "$ac_t""yes" 1>&6
11679     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11680   { test "$extra_verbose" = "yes" && cat << EOF
11681     Defining $ac_tr_hdr
11682 EOF
11683 cat >> confdefs.h <<EOF
11684 #define $ac_tr_hdr 1
11685 EOF
11686 }
11687  have_dlfcn=yes
11688   { test "$extra_verbose" = "yes" && cat << \EOF
11689     Defining HAVE_DLFCN_H
11690 EOF
11691 cat >> confdefs.h <<\EOF
11692 #define HAVE_DLFCN_H 1
11693 EOF
11694 }
11695
11696 else
11697   echo "$ac_t""no" 1>&6
11698 fi
11699 done
11700
11701 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11702 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11703 echo "configure:11704: checking for dlopen in -ldl" >&5
11704 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11705
11706 xe_check_libs=" -ldl "
11707 cat > conftest.$ac_ext <<EOF
11708 #line 11709 "configure"
11709 #include "confdefs.h"
11710 /* Override any gcc2 internal prototype to avoid an error.  */
11711 /* We use char because int might match the return type of a gcc2
11712     builtin and then its argument prototype would still apply.  */
11713 char dlopen();
11714
11715 int main() {
11716 dlopen()
11717 ; return 0; }
11718 EOF
11719 if { (eval echo configure:11720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11720   rm -rf conftest*
11721   eval "ac_cv_lib_$ac_lib_var=yes"
11722 else
11723   echo "configure: failed program was:" >&5
11724   cat conftest.$ac_ext >&5
11725   rm -rf conftest*
11726   eval "ac_cv_lib_$ac_lib_var=no"
11727 fi
11728 rm -f conftest*
11729 xe_check_libs=""
11730
11731 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11732   echo "$ac_t""yes" 1>&6
11733   { test "$extra_verbose" = "yes" && cat << \EOF
11734     Defining HAVE_DLOPEN
11735 EOF
11736 cat >> confdefs.h <<\EOF
11737 #define HAVE_DLOPEN 1
11738 EOF
11739 }
11740  DLL_LIB=dl;  with_modules=yes
11741 else
11742   echo "$ac_t""no" 1>&6
11743 fi
11744
11745  }
11746 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11747 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11748 echo "configure:11749: checking for _dlopen in -lc" >&5
11749 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11750
11751 xe_check_libs=" -lc "
11752 cat > conftest.$ac_ext <<EOF
11753 #line 11754 "configure"
11754 #include "confdefs.h"
11755 /* Override any gcc2 internal prototype to avoid an error.  */
11756 /* We use char because int might match the return type of a gcc2
11757     builtin and then its argument prototype would still apply.  */
11758 char _dlopen();
11759
11760 int main() {
11761 _dlopen()
11762 ; return 0; }
11763 EOF
11764 if { (eval echo configure:11765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11765   rm -rf conftest*
11766   eval "ac_cv_lib_$ac_lib_var=yes"
11767 else
11768   echo "configure: failed program was:" >&5
11769   cat conftest.$ac_ext >&5
11770   rm -rf conftest*
11771   eval "ac_cv_lib_$ac_lib_var=no"
11772 fi
11773 rm -f conftest*
11774 xe_check_libs=""
11775
11776 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11777   echo "$ac_t""yes" 1>&6
11778   { test "$extra_verbose" = "yes" && cat << \EOF
11779     Defining HAVE_DLOPEN
11780 EOF
11781 cat >> confdefs.h <<\EOF
11782 #define HAVE_DLOPEN 1
11783 EOF
11784 }
11785  DLL_LIB=;   with_modules=yes
11786 else
11787   echo "$ac_t""no" 1>&6
11788 fi
11789
11790  }
11791 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11792 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11793 echo "configure:11794: checking for dlopen in -lc" >&5
11794 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11795
11796 xe_check_libs=" -lc "
11797 cat > conftest.$ac_ext <<EOF
11798 #line 11799 "configure"
11799 #include "confdefs.h"
11800 /* Override any gcc2 internal prototype to avoid an error.  */
11801 /* We use char because int might match the return type of a gcc2
11802     builtin and then its argument prototype would still apply.  */
11803 char dlopen();
11804
11805 int main() {
11806 dlopen()
11807 ; return 0; }
11808 EOF
11809 if { (eval echo configure:11810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11810   rm -rf conftest*
11811   eval "ac_cv_lib_$ac_lib_var=yes"
11812 else
11813   echo "configure: failed program was:" >&5
11814   cat conftest.$ac_ext >&5
11815   rm -rf conftest*
11816   eval "ac_cv_lib_$ac_lib_var=no"
11817 fi
11818 rm -f conftest*
11819 xe_check_libs=""
11820
11821 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11822   echo "$ac_t""yes" 1>&6
11823   { test "$extra_verbose" = "yes" && cat << \EOF
11824     Defining HAVE_DLOPEN
11825 EOF
11826 cat >> confdefs.h <<\EOF
11827 #define HAVE_DLOPEN 1
11828 EOF
11829 }
11830  DLL_LIB=;   with_modules=yes
11831 else
11832   echo "$ac_t""no" 1>&6
11833 fi
11834
11835  }
11836 test -z "$with_modules" && { 
11837 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11838 echo "configure:11839: checking for shl_load in -ldld" >&5
11839 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11840
11841 xe_check_libs=" -ldld "
11842 cat > conftest.$ac_ext <<EOF
11843 #line 11844 "configure"
11844 #include "confdefs.h"
11845 /* Override any gcc2 internal prototype to avoid an error.  */
11846 /* We use char because int might match the return type of a gcc2
11847     builtin and then its argument prototype would still apply.  */
11848 char shl_load();
11849
11850 int main() {
11851 shl_load()
11852 ; return 0; }
11853 EOF
11854 if { (eval echo configure:11855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11855   rm -rf conftest*
11856   eval "ac_cv_lib_$ac_lib_var=yes"
11857 else
11858   echo "configure: failed program was:" >&5
11859   cat conftest.$ac_ext >&5
11860   rm -rf conftest*
11861   eval "ac_cv_lib_$ac_lib_var=no"
11862 fi
11863 rm -f conftest*
11864 xe_check_libs=""
11865
11866 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11867   echo "$ac_t""yes" 1>&6
11868   { test "$extra_verbose" = "yes" && cat << \EOF
11869     Defining HAVE_SHL_LOAD
11870 EOF
11871 cat >> confdefs.h <<\EOF
11872 #define HAVE_SHL_LOAD 1
11873 EOF
11874 }
11875  DLL_LIB=dld; with_modules=yes
11876 else
11877   echo "$ac_t""no" 1>&6
11878 fi
11879
11880  }
11881 test -z "$with_modules" && { 
11882 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11883 echo "configure:11884: checking for dld_init in -ldld" >&5
11884 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11885
11886 xe_check_libs=" -ldld "
11887 cat > conftest.$ac_ext <<EOF
11888 #line 11889 "configure"
11889 #include "confdefs.h"
11890 /* Override any gcc2 internal prototype to avoid an error.  */
11891 /* We use char because int might match the return type of a gcc2
11892     builtin and then its argument prototype would still apply.  */
11893 char dld_init();
11894
11895 int main() {
11896 dld_init()
11897 ; return 0; }
11898 EOF
11899 if { (eval echo configure:11900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11900   rm -rf conftest*
11901   eval "ac_cv_lib_$ac_lib_var=yes"
11902 else
11903   echo "configure: failed program was:" >&5
11904   cat conftest.$ac_ext >&5
11905   rm -rf conftest*
11906   eval "ac_cv_lib_$ac_lib_var=no"
11907 fi
11908 rm -f conftest*
11909 xe_check_libs=""
11910
11911 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11912   echo "$ac_t""yes" 1>&6
11913   { test "$extra_verbose" = "yes" && cat << \EOF
11914     Defining HAVE_DLD_INIT
11915 EOF
11916 cat >> confdefs.h <<\EOF
11917 #define HAVE_DLD_INIT 1
11918 EOF
11919 }
11920  DLL_LIB=dld; with_modules=yes
11921 else
11922   echo "$ac_t""no" 1>&6
11923 fi
11924
11925  }
11926 if test "$with_modules" = "yes"; then
11927   
11928 dll_ld=
11929 dll_ldflags=
11930 dll_cflags=
11931 dll_post=
11932 dll_ldo="-o"
11933 ld_dynamic_link_flags=
11934 xehost=$canonical
11935 xealias=$internal_configuration
11936
11937 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
11938 echo "configure:11939: checking how to build dynamic libraries for ${xehost}" >&5
11939 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
11940 case "$xehost" in
11941 *-*-linux-gnu*) ;;
11942 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
11943 esac
11944
11945 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
11946 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
11947 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
11948
11949 case "$xehost_os" in
11950 aix3*)
11951   # AIX sometimes has problems with the GCC collect2 program.  For some
11952   # reason, if we set the COLLECT_NAMES environment variable, the problems
11953   # vanish in a puff of smoke.
11954   if test "${COLLECT_NAMES+set}" != set; then
11955     COLLECT_NAMES=
11956     export COLLECT_NAMES
11957   fi
11958   ;;
11959 esac
11960
11961 # Now see if the compiler is really GCC.
11962 if test "$GCC" = "yes"; then
11963   XEGCC=yes
11964 else
11965   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
11966 echo "configure:11967: checking checking whether we are using GNU C" >&5
11967   cat > conftest.$ac_ext <<EOF
11968 #line 11969 "configure"
11969 #include "confdefs.h"
11970
11971 #ifdef __GNUC__
11972   yes;
11973 #endif
11974
11975 EOF
11976 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11977   egrep "yes" >/dev/null 2>&1; then
11978   rm -rf conftest*
11979   XEGCC=yes
11980 else
11981   rm -rf conftest*
11982   XEGCC=no
11983 fi
11984 rm -f conftest*
11985
11986   echo "$ac_t""${XEGCC}" 1>&6
11987 fi
11988
11989 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
11990 echo "configure:11991: checking how to produce PIC code" >&5
11991 wl=
11992
11993 can_build_shared=yes
11994 if test "$XEGCC" = yes; then
11995   wl='-Wl,'
11996
11997   case "$xehost_os" in
11998   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
11999     # PIC is the default for these OSes.
12000     ;;
12001
12002   os2*)
12003     # We can build DLLs from non-PIC.
12004     ;;
12005   amigaos*)
12006     # FIXME: we need at least 68020 code to build shared libraries, but
12007     # adding the `-m68020' flag to GCC prevents building anything better,
12008     # like `-m68040'.
12009     dll_cflags='-m68020 -resident32 -malways-restore-a4'
12010     ;;
12011   *)
12012     dll_cflags='-fPIC'
12013     ;;
12014   esac
12015 else
12016   # PORTME Check for PIC flags for the system compiler.
12017   case "$xehost_os" in
12018   hpux9* | hpux10*)
12019     # Is there a better link_static_flag that works with the bundled CC?
12020     wl='-Wl,'
12021     dll_cflags='+Z'
12022     ;;
12023
12024   irix5* | irix6*)
12025     wl='-Wl,'
12026     # PIC (with -KPIC) is the default.
12027     ;;
12028
12029   os2*)
12030     # We can build DLLs from non-PIC.
12031     ;;
12032
12033   osf3* | osf4*)
12034     # All OSF/1 code is PIC.
12035     wl='-Wl,'
12036     ;;
12037
12038   sco3.2v5*)
12039     dll_cflags='-belf -Kpic'
12040     wl='-Wl,'
12041     ;;
12042
12043   unixware*)
12044     dll_cflags="-KPIC"
12045     wl="-Wl,"
12046     ;;
12047
12048   sysv4*)
12049     dll_cflags="-KPIC"
12050     wl="-Wl,"
12051     ;;
12052
12053   sysv5*)
12054     dll_cflags="-KPIC"
12055     wl="-Wl,"
12056     ;;
12057
12058   solaris2*)
12059     dll_cflags='-KPIC'
12060     wl='-Wl,'
12061     ;;
12062
12063   sunos4*)
12064     dll_cflags='-PIC'
12065     wl='-Qoption ld '
12066     ;;
12067
12068   uts4*)
12069     dll_cflags='-pic'
12070     ;;
12071
12072   *)
12073     can_build_shared=no
12074     ;;
12075   esac
12076 fi
12077
12078 if test -n "$dll_cflags"; then
12079   echo "$ac_t""${dll_cflags}" 1>&6
12080   
12081   # Check to make sure the dll_cflags actually works.
12082   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12083 echo "configure:12084: checking if PIC flag ${dll_cflags} really works" >&5
12084   save_CFLAGS="$CFLAGS"
12085   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12086   cat > conftest.$ac_ext <<EOF
12087 #line 12088 "configure"
12088 #include "confdefs.h"
12089
12090 int main() {
12091 int x=0;
12092 ; return 0; }
12093 EOF
12094 if { (eval echo configure:12095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12095   rm -rf conftest*
12096   
12097     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12098     # reports no error.  So, we need to grep stderr for (Bundled).
12099     if grep '(Bundled)' config.log >/dev/null; then
12100       echo "$ac_t""no" 1>&6
12101       can_build_shared=no
12102       dll_cflags=
12103     else
12104       echo "$ac_t""yes" 1>&6
12105     fi
12106 else
12107   echo "configure: failed program was:" >&5
12108   cat conftest.$ac_ext >&5
12109   rm -rf conftest*
12110   echo "$ac_t""no" 1>&6
12111     can_build_shared=no
12112     dll_cflags=
12113 fi
12114 rm -f conftest*
12115   CFLAGS="$save_CFLAGS"
12116 else
12117   echo "$ac_t""none" 1>&6
12118 fi
12119
12120 if test "$can_build_shared" = "yes"; then
12121 cc_produces_so=no
12122 xldf=
12123 xcldf=
12124 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12125 echo "configure:12126: checking if C compiler can produce shared libraries" >&5
12126 if test "$XEGCC" = yes; then
12127   xcldf="-shared"
12128   xldf="-shared"
12129 else # Not using GCC
12130   case "$xehost_os" in
12131     aix3* | aix4*)
12132       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12133       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12134       ;;
12135
12136     freebsd2* | netbsd* | openbsd*)
12137       xldf="-Bshareable"
12138       xcldf="${wl}-Bshareable"
12139       ;;
12140
12141     freebsd3*)
12142       xcldf="-shared"
12143       ;;
12144
12145     hpux*)
12146       xldf="-b +s"
12147       xcldf="${wl}-b ${wl}+s"
12148       ;;
12149
12150     irix5* | irix6* | osf3* | osf4*)
12151       xcldf="${wl}-shared"
12152       xldf="-shared"
12153       ;;
12154
12155     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12156       xcldf="-G"
12157       xldf="-G"
12158       ;;
12159
12160     sunos4*)
12161       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12162       xldf="-assert pure-text -Bstatic"
12163       ;;
12164   esac
12165 fi # End if if we are using gcc
12166
12167 if test -n "$xcldf"; then
12168   save_LDFLAGS=$LDFLAGS
12169   save_LIBS=$LIBS
12170   save_xe_libs=$xe_libs
12171   LDFLAGS="$xcldf $LDFLAGS"
12172   LIBS=
12173   xe_libs=
12174   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12175   cat > conftest.$ac_ext <<EOF
12176 #line 12177 "configure"
12177 #include "confdefs.h"
12178
12179 int main() {
12180 int x=0;
12181 ; return 0; }
12182 EOF
12183 if { (eval echo configure:12184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12184   rm -rf conftest*
12185   cc_produces_so=yes
12186 else
12187   echo "configure: failed program was:" >&5
12188   cat conftest.$ac_ext >&5
12189   rm -rf conftest*
12190   cc_produces_so=no
12191 fi
12192 rm -f conftest*
12193   LDFLAGS=$save_LDFLAGS
12194   LIBS=$save_LIBS
12195   xe_libs=$save_xe_libs
12196   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12197 else
12198   cc_produces_so=no
12199 fi
12200 echo "$ac_t""${cc_produces_so}" 1>&6
12201
12202 LTLD=$LD
12203 if test -z "$LTLD"; then
12204   ac_prog=ld
12205   if test "$XEGCC" = yes; then
12206     # Check if gcc -print-prog-name=ld gives a path.
12207     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12208 echo "configure:12209: checking for ld used by GCC" >&5
12209     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12210     case "$ac_prog" in
12211     # Accept absolute paths.
12212     /*)
12213       if test -z "$LTLD"; then
12214         case "$ac_prog" in
12215           *gcc-lib*) LTLD="$CC"
12216                      ;;
12217           *)         LTLD="$ac_prog"
12218                      ;;
12219         esac
12220       fi
12221       ;;
12222     "")
12223       # If it fails, then pretend we aren't using GCC.
12224       ac_prog=ld
12225       ;;
12226     *)
12227       # If it is relative, then search for the first ld in PATH.
12228       with_gnu_ld=unknown
12229       ;;
12230     esac
12231   else
12232     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12233 echo "configure:12234: checking for GNU ld" >&5
12234   fi
12235
12236   if test -z "$LTLD"; then
12237     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12238     for ac_dir in $PATH; do
12239       test -z "$ac_dir" && ac_dir=.
12240       if test -f "$ac_dir/$ac_prog"; then
12241         LTLD="$ac_dir/$ac_prog"
12242         # Check to see if the program is GNU ld.  I'd rather use --version,
12243         # but apparently some GNU ld's only accept -v.
12244         # Break only if it was the GNU/non-GNU ld that we prefer.
12245         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12246           xe_gnu_ld=yes
12247         else
12248           xe_gnu_ld=no
12249         fi
12250       fi
12251     done
12252     IFS="$ac_save_ifs"
12253   fi
12254
12255   if test -n "$LTLD"; then
12256     echo "$ac_t""${LTLD}" 1>&6
12257   else
12258     echo "$ac_t""no" 1>&6
12259   fi
12260
12261   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12262     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12263     exit 1
12264   fi
12265 fi
12266
12267 ld_dynamic_link_flags=
12268
12269 # Check to see if it really is or isn't GNU ld.
12270 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12271 echo "configure:12272: checking if the linker is GNU ld" >&5
12272 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12273 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12274   xe_gnu_ld=yes
12275 else
12276   xe_gnu_ld=no
12277 fi
12278 echo "$ac_t""${xe_gnu_ld}" 1>&6
12279
12280 case "$xehost_os" in
12281   amigaos* | sunos4*)
12282     # On these operating systems, we should treat GNU ld like the system ld.
12283     gnu_ld_acts_native=yes
12284     ;;
12285   *)
12286     gnu_ld_acts_native=no
12287     ;;
12288 esac
12289
12290 if test "$cc_produces_so" = "yes"; then
12291   dll_ld=$CC
12292   dll_ldflags=$xcldf
12293   can_build_shared=yes
12294 else
12295   # OK - only NOW do we futz about with ld.
12296   # See if the linker supports building shared libraries.
12297   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12298 echo "configure:12299: checking whether the linker supports shared libraries" >&5
12299   dll_ld=$CC
12300   dll_ldflags=$LDFLAGS
12301   ld_shlibs=yes
12302   can_build_shared=yes
12303   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12304     # See if GNU ld supports shared libraries.
12305     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12306       dll_ld=$CC
12307       dll_ldflags="-shared"
12308       ld_shlibs=yes
12309     else
12310       ld_shlibs=no
12311     fi
12312   else
12313     # PORTME fill in a description of your system's linker (not GNU ld)
12314     case "$xehost_os" in
12315     aix3*)
12316       dll_ld=$LTLD
12317       dll_ldflags=$xldf
12318       ;;
12319
12320     aix4*)
12321       dll_ldflags=$xcldf
12322       ;;
12323
12324     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12325     # support.  Future versions do this automatically, but an explicit c++rt0.o
12326     # doesn't break anything, and helps significantly (at the cost of a little
12327     # extra space).
12328     freebsd2.2*)
12329       dll_ld=$LTLD
12330       dll_ldflags=$xldf
12331       dll_post="/usr/lib/c++rt0.o"
12332       ;;
12333
12334     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12335     freebsd2*)
12336       dll_ld=$LTLD
12337       dll_ldflags="-Bshareable"
12338       ;;
12339
12340     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12341     freebsd3*)
12342       dll_ldflags="-shared"
12343       ;;
12344
12345     hpux*)
12346       dll_ld=$LTLD
12347       dll_ldflags=$xldf
12348       ;;
12349
12350     irix5* | irix6*)
12351       dll_ld=$LTLD
12352       dll_ldflags=$xldf
12353       ;;
12354
12355     netbsd*)
12356       # Tested with NetBSD 1.2 ld
12357       dll_ld=$LTLD
12358       dll_ldflags=$xldf
12359       ;;
12360
12361     openbsd*)
12362       dll_ld=$LTLD
12363       dll_ldflags=$xldf
12364       ;;
12365
12366     osf3* | osf4*)
12367       dll_ld=$LTLD
12368       dll_ldflags=$xldf
12369       ;;
12370
12371     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12372     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12373       dll_ld=$LTLD
12374       case "$dll_ld" in
12375         *gcc*) dll_ldflags="-shared"
12376                dll_ld=$CC
12377                ;;
12378         *)     dll_ldflags="-G"
12379                ;;
12380       esac
12381       ;;
12382
12383     sunos4*)
12384       if test "$XEGCC" = yes; then
12385         dll_ld=$CC
12386       else
12387         dll_ld=$LTLD
12388       fi
12389       dll_ldflags=$xldf
12390       ;;
12391
12392     uts4*)
12393       dll_ld=$LTLD
12394       dll_ldflags="-G"
12395       ;;
12396
12397     bsdi*)
12398       dll_ldflags="-r"
12399       dll_ld="shlicc2"
12400       ;;
12401
12402     *)
12403       ld_shlibs=no
12404       can_build_shared=no
12405       ;;
12406     esac
12407   fi
12408   echo "$ac_t""${ld_shlibs}" 1>&6
12409   if test "$ld_shlibs" = "no"; then
12410     can_build_shared=no
12411   fi
12412 fi # End of if cc_produces_so = no
12413
12414
12415 if test "$xe_gnu_ld" = yes; then
12416   if test "$ld_shlibs" = yes; then
12417     ld_dynamic_link_flags="${wl}-export-dynamic"
12418   fi
12419 fi
12420
12421 if test -z "$ld_dynamic_link_flags"; then
12422   case "$xehost_os" in
12423   aix3*)
12424     ld_dynamic_link_flags=
12425     ;;
12426
12427   aix4*)
12428     ld_dynamic_link_flags=
12429     ;;
12430
12431   freebsd2.2*)
12432     ld_dynamic_link_flags=
12433     ;;
12434
12435   freebsd2*)
12436     ld_dynamic_link_flags=
12437     ;;
12438
12439   freebsd3*)
12440     ld_dynamic_link_flags=
12441     ;;
12442
12443   hpux*)
12444     ld_dynamic_link_flags="${wl}-E"
12445     ;;
12446
12447   irix5* | irix6*)
12448     ld_dynamic_link_flags=
12449     ;;
12450
12451   netbsd*)
12452     ld_dynamic_link_flags=
12453     ;;
12454
12455   openbsd*)
12456     ld_dynamic_link_flags=
12457     ;;
12458
12459   osf3* | osf4*)
12460     ld_dynamic_link_flags=
12461     ;;
12462
12463   solaris2* | solaris7*)
12464     ld_dynamic_link_flags="${wl}-Bdynamic"
12465     ;;
12466
12467   sco3.2v5* | unixware* | sysv5* | sysv4*)
12468     ld_dynamic_link_flags="${wl}-Bexport"
12469     ;;
12470
12471   sunos4*)
12472     ld_dynamic_link_flags=
12473     ;;
12474
12475   uts4*)
12476     ld_dynamic_link_flags=
12477     ;;
12478
12479   bsdi*)
12480     ld_dynamic_link_flags=
12481     ;;
12482
12483   esac
12484 fi # End of if -z ld_dynamic_link_flags
12485 fi # End of if test "$can_build_shared" = "yes"
12486
12487
12488
12489
12490
12491
12492
12493
12494   if test "$can_build_shared" = "yes"; then
12495     { test "$extra_verbose" = "yes" && cat << \EOF
12496     Defining HAVE_SHLIB
12497 EOF
12498 cat >> confdefs.h <<\EOF
12499 #define HAVE_SHLIB 1
12500 EOF
12501 }
12502
12503     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12504    echo "    xemacs will be linked with \"sysdll.o\""
12505  fi
12506     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12507    echo "    xemacs will be linked with \"emodules.o\""
12508  fi
12509     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12510     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12511     for ac_func in dlerror _dlerror
12512 do
12513 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12514 echo "configure:12515: checking for $ac_func" >&5
12515
12516 cat > conftest.$ac_ext <<EOF
12517 #line 12518 "configure"
12518 #include "confdefs.h"
12519 /* System header to define __stub macros and hopefully few prototypes,
12520     which can conflict with char $ac_func(); below.  */
12521 #include <assert.h>
12522 /* Override any gcc2 internal prototype to avoid an error.  */
12523 /* We use char because int might match the return type of a gcc2
12524     builtin and then its argument prototype would still apply.  */
12525 char $ac_func();
12526
12527 int main() {
12528
12529 /* The GNU C library defines this for functions which it implements
12530     to always fail with ENOSYS.  Some functions are actually named
12531     something starting with __ and the normal name is an alias.  */
12532 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12533 choke me
12534 #else
12535 $ac_func();
12536 #endif
12537
12538 ; return 0; }
12539 EOF
12540 if { (eval echo configure:12541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12541   rm -rf conftest*
12542   eval "ac_cv_func_$ac_func=yes"
12543 else
12544   echo "configure: failed program was:" >&5
12545   cat conftest.$ac_ext >&5
12546   rm -rf conftest*
12547   eval "ac_cv_func_$ac_func=no"
12548 fi
12549 rm -f conftest*
12550
12551 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12552   echo "$ac_t""yes" 1>&6
12553     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12554   { test "$extra_verbose" = "yes" && cat << EOF
12555     Defining $ac_tr_func
12556 EOF
12557 cat >> confdefs.h <<EOF
12558 #define $ac_tr_func 1
12559 EOF
12560 }
12561  
12562 else
12563   echo "$ac_t""no" 1>&6
12564 fi
12565 done
12566
12567   else
12568     echo "configure: warning: disabling shared library support" 1>&2
12569     with_modules=no
12570   fi
12571 fi
12572
12573 cat > conftest.$ac_ext <<EOF
12574 #line 12575 "configure"
12575 #include "confdefs.h"
12576 int main(int c,char *v[]){return 0;}
12577 EOF
12578 if { (eval echo configure:12579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12579 then
12580   :
12581 else
12582   conftest_rc="$?"
12583   echo "configure: failed program was:" >&5
12584   cat conftest.$ac_ext >&5
12585   rm -fr conftest*
12586   
12587   echo ""
12588   echo "*** PANIC *** The C compiler can no longer build working executables."
12589   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12590   echo "*** PANIC *** The most likely reason for this problem is that configure"
12591   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12592   echo "*** PANIC *** found at run time."
12593   echo "*** PANIC ***"
12594   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12595   echo "*** PANIC *** On other systems, try telling configure where to find the"
12596   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12597   echo "*** PANIC ***"
12598   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12599   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12600   echo "*** PANIC *** on your system.  Don't do that."
12601   exit 1
12602 fi
12603 rm -fr conftest*
12604
12605 if test "$win32_processes" = "yes"; then
12606   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12607    echo "    xemacs will be linked with \"process-nt.o\""
12608  fi
12609 else
12610   { test "$extra_verbose" = "yes" && cat << \EOF
12611     Defining HAVE_UNIX_PROCESSES
12612 EOF
12613 cat >> confdefs.h <<\EOF
12614 #define HAVE_UNIX_PROCESSES 1
12615 EOF
12616 }
12617
12618   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12619    echo "    xemacs will be linked with \"process-unix.o\""
12620  fi
12621 fi
12622
12623
12624
12625 T=""
12626 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12627 CFLAGS="$T"
12628
12629
12630 T=""
12631 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12632 extra_objs="$T"
12633
12634
12635 T=""
12636 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
12637 c_switch_general="$T"
12638
12639
12640 T=""
12641 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12642 c_switch_window_system="$T"
12643
12644
12645 T=""
12646 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12647 c_switch_all="$T"
12648
12649
12650 T=""
12651 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
12652 ld_switch_general="$T"
12653
12654
12655 T=""
12656 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12657 ld_switch_window_system="$T"
12658
12659
12660 T=""
12661 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12662 ld_switch_all="$T"
12663
12664
12665 T=""
12666 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12667 ld_libs_general="$T"
12668
12669
12670 T=""
12671 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
12672 ld_libs_window_system="$T"
12673
12674
12675 T=""
12676 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12677 ld_libs_all="$T"
12678
12679
12680
12681 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12682 internal_makefile_list="Makefile.in"
12683 SUBDIR_MAKEFILES=''
12684 test -d lock || mkdir lock
12685 for dir in $MAKE_SUBDIR; do
12686   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12687         test -d "$d" || mkdir "$d"; cd "$d"
12688       done ) ;;
12689    * ) test -d "$dir" || mkdir "$dir" ;;
12690   esac
12691   
12692 T=""
12693 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12694 SUBDIR_MAKEFILES="$T"
12695
12696   
12697 T=""
12698 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12699 internal_makefile_list="$T"
12700
12701 done
12702
12703
12704
12705
12706 for dir in src/s src/m; do
12707   if test ! -d "$dir" ; then
12708     echo Making symbolic link to "$srcdir/$dir"
12709     ${LN_S} "$srcdir/$dir" "$dir"
12710   fi
12711 done
12712
12713 if test "$extra_verbose" = "yes"; then
12714   echo ""
12715   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
12716   echo ""
12717 fi
12718
12719 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12720   echo "creating src/gdbinit"; echo ""
12721   echo "source $srcdir/src/gdbinit" > src/gdbinit
12722 fi
12723
12724 if test "$__SUNPRO_C" = "yes"; then
12725   echo "creating .sbinit"; echo ""
12726   ( echo "# For use with Sun WorkShop's Source browser."
12727     echo "# See sbquery(1) and sbinit(4) for more information"
12728     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12729   ) > .sbinit
12730 fi
12731
12732 rm -f core
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752 PREFIX=$prefix
12753 while true; do
12754   case "$PREFIX" in
12755     *\$* ) eval "PREFIX=$PREFIX" ;;
12756     *) break ;;
12757   esac
12758 done
12759
12760
12761
12762
12763 EXEC_PREFIX=$exec_prefix
12764 while true; do
12765   case "$EXEC_PREFIX" in
12766     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12767     *) break ;;
12768   esac
12769 done
12770
12771
12772
12773
12774 INFODIR=$infodir
12775 while true; do
12776   case "$INFODIR" in
12777     *\$* ) eval "INFODIR=$INFODIR" ;;
12778     *) break ;;
12779   esac
12780 done
12781
12782
12783
12784
12785 INFOPATH=$infopath
12786 while true; do
12787   case "$INFOPATH" in
12788     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12789     *) break ;;
12790   esac
12791 done
12792
12793
12794
12795
12796 PACKAGE_PATH=$package_path
12797 while true; do
12798   case "$PACKAGE_PATH" in
12799     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12800     *) break ;;
12801   esac
12802 done
12803
12804
12805
12806
12807 LISPDIR=$lispdir
12808 while true; do
12809   case "$LISPDIR" in
12810     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12811     *) break ;;
12812   esac
12813 done
12814
12815
12816
12817
12818 MODULEDIR=$moduledir
12819 while true; do
12820   case "$MODULEDIR" in
12821     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12822     *) break ;;
12823   esac
12824 done
12825
12826
12827
12828
12829 SITELISPDIR=$sitelispdir
12830 while true; do
12831   case "$SITELISPDIR" in
12832     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12833     *) break ;;
12834   esac
12835 done
12836
12837
12838
12839
12840 SITEMODULEDIR=$sitemoduledir
12841 while true; do
12842   case "$SITEMODULEDIR" in
12843     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12844     *) break ;;
12845   esac
12846 done
12847
12848
12849
12850
12851 ETCDIR=$etcdir
12852 while true; do
12853   case "$ETCDIR" in
12854     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12855     *) break ;;
12856   esac
12857 done
12858
12859
12860
12861
12862 LOCKDIR=$lockdir
12863 while true; do
12864   case "$LOCKDIR" in
12865     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12866     *) break ;;
12867   esac
12868 done
12869
12870
12871
12872
12873 DOCDIR=$docdir
12874 while true; do
12875   case "$DOCDIR" in
12876     *\$* ) eval "DOCDIR=$DOCDIR" ;;
12877     *) break ;;
12878   esac
12879 done
12880
12881
12882
12883
12884 ARCHLIBDIR=$archlibdir
12885 while true; do
12886   case "$ARCHLIBDIR" in
12887     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12888     *) break ;;
12889   esac
12890 done
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12912
12913
12914
12915
12916
12917
12918
12919 : ${XEMACS_CC:=$CC}
12920
12921
12922 if test "$with_prefix" = "yes"; then
12923   { test "$extra_verbose" = "yes" && cat << \EOF
12924     Defining PREFIX_USER_DEFINED
12925 EOF
12926 cat >> confdefs.h <<\EOF
12927 #define PREFIX_USER_DEFINED 1
12928 EOF
12929 }
12930
12931 fi
12932
12933 if test "$with_site_lisp" = "no"; then
12934   { test "$extra_verbose" = "yes" && cat << \EOF
12935     Defining INHIBIT_SITE_LISP
12936 EOF
12937 cat >> confdefs.h <<\EOF
12938 #define INHIBIT_SITE_LISP 1
12939 EOF
12940 }
12941
12942 fi
12943 if test "$with_site_modules" = "no"; then
12944   { test "$extra_verbose" = "yes" && cat << \EOF
12945     Defining INHIBIT_SITE_MODULES
12946 EOF
12947 cat >> confdefs.h <<\EOF
12948 #define INHIBIT_SITE_MODULES 1
12949 EOF
12950 }
12951
12952 fi
12953
12954
12955 T=""
12956 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12957 ac_configure_args="$T"
12958
12959 { test "$extra_verbose" = "yes" && cat << EOF
12960     Defining EMACS_CONFIGURATION = "$canonical"
12961 EOF
12962 cat >> confdefs.h <<EOF
12963 #define EMACS_CONFIGURATION "$canonical"
12964 EOF
12965 }
12966
12967 { test "$extra_verbose" = "yes" && cat << EOF
12968     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12969 EOF
12970 cat >> confdefs.h <<EOF
12971 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12972 EOF
12973 }
12974
12975 { test "$extra_verbose" = "yes" && cat << EOF
12976     Defining config_machfile = "$machfile"
12977 EOF
12978 cat >> confdefs.h <<EOF
12979 #define config_machfile "$machfile"
12980 EOF
12981 }
12982
12983 { test "$extra_verbose" = "yes" && cat << EOF
12984     Defining config_opsysfile = "$opsysfile"
12985 EOF
12986 cat >> confdefs.h <<EOF
12987 #define config_opsysfile "$opsysfile"
12988 EOF
12989 }
12990
12991
12992
12993 null_string=""
12994 { test "$extra_verbose" = "yes" && cat << EOF
12995     Defining LD_SWITCH_X_SITE = $null_string
12996 EOF
12997 cat >> confdefs.h <<EOF
12998 #define LD_SWITCH_X_SITE $null_string
12999 EOF
13000 }
13001
13002 { test "$extra_verbose" = "yes" && cat << EOF
13003     Defining LD_SWITCH_X_SITE_AUX = $null_string
13004 EOF
13005 cat >> confdefs.h <<EOF
13006 #define LD_SWITCH_X_SITE_AUX $null_string
13007 EOF
13008 }
13009
13010 { test "$extra_verbose" = "yes" && cat << EOF
13011     Defining C_SWITCH_X_SITE = $null_string
13012 EOF
13013 cat >> confdefs.h <<EOF
13014 #define C_SWITCH_X_SITE $null_string
13015 EOF
13016 }
13017
13018 { test "$extra_verbose" = "yes" && cat << EOF
13019     Defining LD_SWITCH_SITE = $null_string
13020 EOF
13021 cat >> confdefs.h <<EOF
13022 #define LD_SWITCH_SITE $null_string
13023 EOF
13024 }
13025
13026 { test "$extra_verbose" = "yes" && cat << EOF
13027     Defining C_SWITCH_SITE = $null_string
13028 EOF
13029 cat >> confdefs.h <<EOF
13030 #define C_SWITCH_SITE $null_string
13031 EOF
13032 }
13033
13034
13035
13036 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13037     Defining GNU_MALLOC
13038 EOF
13039 cat >> confdefs.h <<\EOF
13040 #define GNU_MALLOC 1
13041 EOF
13042 }
13043
13044 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13045     Defining USE_SYSTEM_MALLOC
13046 EOF
13047 cat >> confdefs.h <<\EOF
13048 #define USE_SYSTEM_MALLOC 1
13049 EOF
13050 }
13051
13052 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13053     Defining USE_DEBUG_MALLOC
13054 EOF
13055 cat >> confdefs.h <<\EOF
13056 #define USE_DEBUG_MALLOC 1
13057 EOF
13058 }
13059
13060                                               { test "$extra_verbose" = "yes" && cat << \EOF
13061     Defining USE_SYSTEM_MALLOC
13062 EOF
13063 cat >> confdefs.h <<\EOF
13064 #define USE_SYSTEM_MALLOC 1
13065 EOF
13066 }
13067
13068 fi
13069 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13070     Defining I18N3
13071 EOF
13072 cat >> confdefs.h <<\EOF
13073 #define I18N3 1
13074 EOF
13075 }
13076
13077 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13078     Defining USE_GCC
13079 EOF
13080 cat >> confdefs.h <<\EOF
13081 #define USE_GCC 1
13082 EOF
13083 }
13084
13085 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13086     Defining EXTERNAL_WIDGET
13087 EOF
13088 cat >> confdefs.h <<\EOF
13089 #define EXTERNAL_WIDGET 1
13090 EOF
13091 }
13092
13093 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13094     Defining NO_DOC_FILE
13095 EOF
13096 cat >> confdefs.h <<\EOF
13097 #define NO_DOC_FILE 1
13098 EOF
13099 }
13100
13101 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13102     Defining PURIFY
13103 EOF
13104 cat >> confdefs.h <<\EOF
13105 #define PURIFY 1
13106 EOF
13107 }
13108
13109 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13110     Defining QUANTIFY
13111 EOF
13112 cat >> confdefs.h <<\EOF
13113 #define QUANTIFY 1
13114 EOF
13115 }
13116
13117 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13118     Defining MAIL_USE_POP
13119 EOF
13120 cat >> confdefs.h <<\EOF
13121 #define MAIL_USE_POP 1
13122 EOF
13123 }
13124
13125 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13126     Defining KERBEROS
13127 EOF
13128 cat >> confdefs.h <<\EOF
13129 #define KERBEROS 1
13130 EOF
13131 }
13132
13133 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13134     Defining HESIOD
13135 EOF
13136 cat >> confdefs.h <<\EOF
13137 #define HESIOD 1
13138 EOF
13139 }
13140
13141 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13142     Defining USE_UNION_TYPE
13143 EOF
13144 cat >> confdefs.h <<\EOF
13145 #define USE_UNION_TYPE 1
13146 EOF
13147 }
13148
13149
13150
13151 (
13152 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13153 else
13154   echo "uname -a: `uname -a`"
13155 fi
13156 echo ""
13157 echo "$0 $quoted_arguments"
13158 ) > Installation
13159
13160 if test ! -z ${emacs_beta_version} ; then
13161   if test -z "${emacs_is_beta}" ; then
13162         xemacs_betaname=".${emacs_beta_version}"
13163   else
13164         xemacs_betaname="-b${emacs_beta_version}"
13165   fi
13166 else
13167   xemacs_betaname=""    
13168 fi
13169
13170 (
13171 echo "
13172
13173 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13174
13175   Where should the build process find the source code?    $srcdir
13176   What installation prefix should install use?            $prefix
13177   What operating system and machine description files should XEmacs use?
13178         \`$opsysfile' and \`$machfile'
13179   What compiler should XEmacs be built with?              $CC $CFLAGS
13180   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13181   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13182   What window system should XEmacs use?                   ${window_system}"
13183 if test "$with_x11" = "yes"; then
13184   echo "  Where do we find X Windows header files?                $x_includes"
13185   echo "  Where do we find X Windows libraries?                   $x_libraries"
13186 fi
13187 if test -n "$site_includes"; then
13188   echo "  Additional header files:                                $site_includes"
13189 fi
13190 if test -n "$site_libraries"; then
13191   echo "  Additional libraries:                                   $site_libraries"
13192 fi
13193 if test -n "$site_prefixes"; then
13194   echo "  Additional prefixes:                                    $site_prefixes"
13195 fi
13196 if test -n "$runpath"; then
13197   echo "  Runtime library search path:                            $runpath"
13198 fi
13199 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13200 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13201 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13202 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13203   echo "  No Xmu; substituting equivalent routines."
13204 fi
13205
13206 if test "$with_xpm" = yes; then
13207   echo "  Compiling in support for XPM images."
13208 elif test "$with_x11" = yes; then
13209   echo "  --------------------------------------------------------------------"
13210   echo "  WARNING: Compiling without XPM support."
13211   if test "$xpm_problem" != ""; then
13212     echo "  Reason: $xpm_problem"
13213   fi
13214   echo "  WARNING: You should strongly consider installing XPM."
13215   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13216   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13217   echo "  --------------------------------------------------------------------"
13218 fi
13219 if test "$with_png" = yes; then
13220   echo "  Compiling in support for PNG image handling."
13221 elif test "$window_system" != "none"; then
13222   echo "  --------------------------------------------------------------------"
13223   echo "  WARNING: Compiling without PNG image support."
13224   if test "$png_problem" != ""; then
13225     echo "  Reason: $png_problem"
13226   fi
13227   echo "  WARNING: You should strongly consider installing the PNG libraries."
13228   echo "  WARNING: Otherwise certain images and glyphs may not display."
13229   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13230   echo "  --------------------------------------------------------------------"
13231 fi
13232 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13233 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13234 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13235 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13236 case "$with_sound" in
13237   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13238   native ) echo "  Compiling in native sound support." ;;
13239   both   ) echo "  Compiling in both network and native sound support." ;;
13240 esac
13241 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13242
13243 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13244 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13245 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13246
13247 test "$with_ldap"            = yes && echo "  Compiling in support for LDAP."
13248
13249 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13250 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13251
13252 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13253 test "$with_utf_2000" = yes && echo "  Using UTF-2000 (UTF-8) buffer/string representation."
13254 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13255 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13256 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13257 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13258 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13259 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13260 if test "$with_wnn" = yes; then
13261   echo "  Compiling in support for the WNN input method on Mule."
13262   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13263 fi
13264 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13265
13266 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13267 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13268 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13269 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13270 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13271 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13272 case "$with_menubars" in
13273   lucid ) echo "  Using Lucid menubars." ;;
13274   motif ) echo "  Using Motif menubars."
13275           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13276           echo "             We recommend using the Lucid menubar instead."
13277           echo "             Re-run configure with --with-menubars='lucid'." ;;
13278 esac
13279 case "$with_scrollbars" in
13280   lucid    ) echo "  Using Lucid scrollbars."     ;;
13281   motif    ) echo "  Using Motif scrollbars."     ;;
13282   athena   ) echo "  Using Athena scrollbars."    ;;
13283   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13284 esac
13285 case "$with_widgets" in
13286   motif    ) echo "  Using Motif native widgets."     ;;
13287 esac
13288 case "$with_dialogs" in
13289   motif    )
13290     echo "  Using Motif dialog boxes."
13291     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13292       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13293       echo "             We recommend using the Athena dialog boxes instead."
13294       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13295       echo "             Read the PROBLEMS file for more information."
13296     fi; fi
13297     ;;
13298   athena   ) echo "  Using Athena dialog boxes."    ;;
13299   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13300 esac
13301 test "$with_modules" = "yes" && echo "  Compiling in DSO module support."
13302 test "$with_clash_detection" = yes && \
13303   echo "  Clash detection will use \"$lockdir\" for locking files."
13304 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13305 test "$with_pop"        = yes && echo "  Using POP for mail access."
13306 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13307 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13308 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13309 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13310 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13311 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13312   != "no no no no no"; then
13313   echo "  WARNING: ---------------------------------------------------------"
13314   echo "  WARNING: Compiling in support for runtime error checking."
13315   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13316   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13317   echo "  WARNING: ---------------------------------------------------------"
13318 fi
13319 echo ""
13320 ) | tee -a Installation
13321 echo ""
13322
13323
13324 # Remove any trailing slashes in these variables.
13325 test -n "$prefix" &&
13326   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13327 test -n "$exec_prefix" &&
13328   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13329
13330
13331 for file in $internal_makefile_list; do
13332   test "$file" = src/Makefile.in && \
13333     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13334   ac_output_files="${ac_output_files+$ac_output_files }$file"
13335 done
13336 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13337 if test "$with_modules" = "yes"; then
13338   ac_output_files="$ac_output_files lib-src/ellcc.h"
13339 fi
13340
13341 trap '' 1 2 15
13342
13343 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13344
13345 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13346 # Let make expand exec_prefix.
13347 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13348
13349 # Any assignment to VPATH causes Sun make to only execute
13350 # the first set of double-colon rules, so remove it if not needed.
13351 # If there is a colon in the path, we need to keep it.
13352 if test "x$srcdir" = x.; then
13353   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13354 fi
13355
13356 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13357
13358 DEFS=-DHAVE_CONFIG_H
13359
13360 # Without the "./", some shells look in PATH for config.status.
13361 : ${CONFIG_STATUS=./config.status}
13362
13363 echo creating $CONFIG_STATUS
13364 rm -f $CONFIG_STATUS
13365 cat > $CONFIG_STATUS <<EOF
13366 #! /bin/sh
13367 # Generated automatically by configure.
13368 # Run this file to recreate the current configuration.
13369 # This directory was configured as follows,
13370 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13371 #
13372 # $0 $ac_configure_args
13373 #
13374 # Compiler output produced by configure, useful for debugging
13375 # configure, is in ./config.log if it exists.
13376
13377 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13378 for ac_option
13379 do
13380   case "\$ac_option" in
13381   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13382     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13383     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13384   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13385     echo "$CONFIG_STATUS generated by autoconf version 2.13"
13386     exit 0 ;;
13387   -help | --help | --hel | --he | --h)
13388     echo "\$ac_cs_usage"; exit 0 ;;
13389   *) echo "\$ac_cs_usage"; exit 1 ;;
13390   esac
13391 done
13392
13393 ac_given_srcdir=$srcdir
13394 ac_given_INSTALL="$INSTALL"
13395
13396 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13397 EOF
13398 cat >> $CONFIG_STATUS <<EOF
13399
13400 # Protect against being on the right side of a sed subst in config.status.
13401 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13402  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13403 $ac_vpsub
13404 $extrasub
13405 s%@SHELL@%$SHELL%g
13406 s%@CFLAGS@%$CFLAGS%g
13407 s%@CPPFLAGS@%$CPPFLAGS%g
13408 s%@CXXFLAGS@%$CXXFLAGS%g
13409 s%@FFLAGS@%$FFLAGS%g
13410 s%@DEFS@%$DEFS%g
13411 s%@LDFLAGS@%$LDFLAGS%g
13412 s%@LIBS@%$LIBS%g
13413 s%@exec_prefix@%$exec_prefix%g
13414 s%@prefix@%$prefix%g
13415 s%@program_transform_name@%$program_transform_name%g
13416 s%@bindir@%$bindir%g
13417 s%@sbindir@%$sbindir%g
13418 s%@libexecdir@%$libexecdir%g
13419 s%@datadir@%$datadir%g
13420 s%@sysconfdir@%$sysconfdir%g
13421 s%@sharedstatedir@%$sharedstatedir%g
13422 s%@localstatedir@%$localstatedir%g
13423 s%@libdir@%$libdir%g
13424 s%@includedir@%$includedir%g
13425 s%@oldincludedir@%$oldincludedir%g
13426 s%@infodir@%$infodir%g
13427 s%@mandir@%$mandir%g
13428 s%@LN_S@%$LN_S%g
13429 s%@blddir@%$blddir%g
13430 s%@CC@%$CC%g
13431 s%@CPP@%$CPP%g
13432 s%@start_flags@%$start_flags%g
13433 s%@ld_switch_shared@%$ld_switch_shared%g
13434 s%@start_files@%$start_files%g
13435 s%@ld@%$ld%g
13436 s%@lib_gcc@%$lib_gcc%g
13437 s%@RANLIB@%$RANLIB%g
13438 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13439 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
13440 s%@INSTALL_DATA@%$INSTALL_DATA%g
13441 s%@YACC@%$YACC%g
13442 s%@SET_MAKE@%$SET_MAKE%g
13443 s%@X_CFLAGS@%$X_CFLAGS%g
13444 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13445 s%@X_LIBS@%$X_LIBS%g
13446 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13447 s%@install_pp@%$install_pp%g
13448 s%@libs_xauth@%$libs_xauth%g
13449 s%@dnd_objs@%$dnd_objs%g
13450 s%@lwlib_objs@%$lwlib_objs%g
13451 s%@ALLOCA@%$ALLOCA%g
13452 s%@dll_ld@%$dll_ld%g
13453 s%@dll_cflags@%$dll_cflags%g
13454 s%@dll_ldflags@%$dll_ldflags%g
13455 s%@dll_post@%$dll_post%g
13456 s%@dll_ldo@%$dll_ldo%g
13457 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13458 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13459 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13460 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13461 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13462 s%@PROGNAME@%$PROGNAME%g
13463 s%@version@%$version%g
13464 s%@configuration@%$configuration%g
13465 s%@canonical@%$canonical%g
13466 s%@inststaticdir@%$inststaticdir%g
13467 s%@instvardir@%$instvardir%g
13468 s%@srcdir@%$srcdir%g
13469 s%@pkgdir@%$pkgdir%g
13470 s%@statedir@%$statedir%g
13471 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
13472 s%@PREFIX@%$PREFIX%g
13473 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
13474 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13475 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13476 s%@INFODIR@%$INFODIR%g
13477 s%@infopath@%$infopath%g
13478 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13479 s%@INFOPATH@%$INFOPATH%g
13480 s%@package_path@%$package_path%g
13481 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13482 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13483 s%@lispdir@%$lispdir%g
13484 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13485 s%@LISPDIR@%$LISPDIR%g
13486 s%@moduledir@%$moduledir%g
13487 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13488 s%@MODULEDIR@%$MODULEDIR%g
13489 s%@sitelispdir@%$sitelispdir%g
13490 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13491 s%@SITELISPDIR@%$SITELISPDIR%g
13492 s%@sitemoduledir@%$sitemoduledir%g
13493 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13494 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13495 s%@etcdir@%$etcdir%g
13496 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13497 s%@ETCDIR@%$ETCDIR%g
13498 s%@lockdir@%$lockdir%g
13499 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13500 s%@LOCKDIR@%$LOCKDIR%g
13501 s%@docdir@%$docdir%g
13502 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
13503 s%@DOCDIR@%$DOCDIR%g
13504 s%@archlibdir@%$archlibdir%g
13505 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13506 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13507 s%@bitmapdir@%$bitmapdir%g
13508 s%@extra_objs@%$extra_objs%g
13509 s%@machfile@%$machfile%g
13510 s%@opsysfile@%$opsysfile%g
13511 s%@c_switch_general@%$c_switch_general%g
13512 s%@c_switch_window_system@%$c_switch_window_system%g
13513 s%@c_switch_all@%$c_switch_all%g
13514 s%@ld_switch_general@%$ld_switch_general%g
13515 s%@ld_switch_window_system@%$ld_switch_window_system%g
13516 s%@ld_switch_all@%$ld_switch_all%g
13517 s%@ld_libs_general@%$ld_libs_general%g
13518 s%@ld_libs_window_system@%$ld_libs_window_system%g
13519 s%@ld_libs_all@%$ld_libs_all%g
13520 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13521 s%@native_sound_lib@%$native_sound_lib%g
13522 s%@sound_cflags@%$sound_cflags%g
13523 s%@dynodump_arch@%$dynodump_arch%g
13524 s%@XEMACS_CC@%$XEMACS_CC%g
13525 s%@internal_makefile_list@%$internal_makefile_list%g
13526
13527 CEOF
13528 EOF
13529
13530 cat >> $CONFIG_STATUS <<\EOF
13531
13532 # Split the substitutions into bite-sized pieces for seds with
13533 # small command number limits, like on Digital OSF/1 and HP-UX.
13534 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13535 ac_file=1 # Number of current file.
13536 ac_beg=1 # First line for current file.
13537 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13538 ac_more_lines=:
13539 ac_sed_cmds=""
13540 while $ac_more_lines; do
13541   if test $ac_beg -gt 1; then
13542     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13543   else
13544     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13545   fi
13546   if test ! -s conftest.s$ac_file; then
13547     ac_more_lines=false
13548     rm -f conftest.s$ac_file
13549   else
13550     if test -z "$ac_sed_cmds"; then
13551       ac_sed_cmds="sed -f conftest.s$ac_file"
13552     else
13553       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13554     fi
13555     ac_file=`expr $ac_file + 1`
13556     ac_beg=$ac_end
13557     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13558   fi
13559 done
13560 if test -z "$ac_sed_cmds"; then
13561   ac_sed_cmds=cat
13562 fi
13563 EOF
13564
13565 cat >> $CONFIG_STATUS <<EOF
13566
13567 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13568 EOF
13569 cat >> $CONFIG_STATUS <<\EOF
13570 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13571   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13572   case "$ac_file" in
13573   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13574        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13575   *) ac_file_in="${ac_file}.in" ;;
13576   esac
13577
13578   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13579
13580   # Remove last slash and all that follows it.  Not all systems have dirname.
13581   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13582   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13583     # The file is in a subdirectory.
13584     test ! -d "$ac_dir" && mkdir "$ac_dir"
13585     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13586     # A "../" for each directory in $ac_dir_suffix.
13587     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13588   else
13589     ac_dir_suffix= ac_dots=
13590   fi
13591
13592   case "$ac_given_srcdir" in
13593   .)  srcdir=.
13594       if test -z "$ac_dots"; then top_srcdir=.
13595       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13596   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13597   *) # Relative path.
13598     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13599     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13600   esac
13601
13602   case "$ac_given_INSTALL" in
13603   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13604   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13605   esac
13606
13607   echo creating "$ac_file"
13608   rm -f "$ac_file"
13609   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13610   case "$ac_file" in
13611   *Makefile*) ac_comsub="1i\\
13612 # $configure_input" ;;
13613   *) ac_comsub= ;;
13614   esac
13615
13616   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13617   sed -e "$ac_comsub
13618 s%@configure_input@%$configure_input%g
13619 s%@srcdir@%$srcdir%g
13620 s%@top_srcdir@%$top_srcdir%g
13621 s%@INSTALL@%$INSTALL%g
13622 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13623 fi; done
13624 rm -f conftest.s*
13625
13626 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13627 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13628 #
13629 # ac_d sets the value in "#define NAME VALUE" lines.
13630 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13631 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13632 ac_dC='\3'
13633 ac_dD='%g'
13634 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13635 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13636 ac_uB='\([      ]\)%\1#\2define\3'
13637 ac_uC=' '
13638 ac_uD='\4%g'
13639 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13640 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13641 ac_eB='$%\1#\2define\3'
13642 ac_eC=' '
13643 ac_eD='%g'
13644
13645 if test "${CONFIG_HEADERS+set}" != set; then
13646 EOF
13647 cat >> $CONFIG_STATUS <<EOF
13648   CONFIG_HEADERS="src/config.h lwlib/config.h"
13649 EOF
13650 cat >> $CONFIG_STATUS <<\EOF
13651 fi
13652 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13653   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13654   case "$ac_file" in
13655   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13656        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13657   *) ac_file_in="${ac_file}.in" ;;
13658   esac
13659
13660   echo creating $ac_file
13661
13662   rm -f conftest.frag conftest.in conftest.out
13663   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13664   cat $ac_file_inputs > conftest.in
13665
13666 EOF
13667
13668 # Transform confdefs.h into a sed script conftest.vals that substitutes
13669 # the proper values into config.h.in to produce config.h.  And first:
13670 # Protect against being on the right side of a sed subst in config.status.
13671 # Protect against being in an unquoted here document in config.status.
13672 rm -f conftest.vals
13673 cat > conftest.hdr <<\EOF
13674 s/[\\&%]/\\&/g
13675 s%[\\$`]%\\&%g
13676 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13677 s%ac_d%ac_u%gp
13678 s%ac_u%ac_e%gp
13679 EOF
13680 sed -n -f conftest.hdr confdefs.h > conftest.vals
13681 rm -f conftest.hdr
13682
13683 # This sed command replaces #undef with comments.  This is necessary, for
13684 # example, in the case of _POSIX_SOURCE, which is predefined and required
13685 # on some systems where configure will not decide to define it.
13686 cat >> conftest.vals <<\EOF
13687 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13688 EOF
13689
13690 # Break up conftest.vals because some shells have a limit on
13691 # the size of here documents, and old seds have small limits too.
13692
13693 rm -f conftest.tail
13694 while :
13695 do
13696   ac_lines=`grep -c . conftest.vals`
13697   # grep -c gives empty output for an empty file on some AIX systems.
13698   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13699   # Write a limited-size here document to conftest.frag.
13700   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13701   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13702   echo 'CEOF
13703   sed -f conftest.frag conftest.in > conftest.out
13704   rm -f conftest.in
13705   mv conftest.out conftest.in
13706 ' >> $CONFIG_STATUS
13707   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13708   rm -f conftest.vals
13709   mv conftest.tail conftest.vals
13710 done
13711 rm -f conftest.vals
13712
13713 cat >> $CONFIG_STATUS <<\EOF
13714   rm -f conftest.frag conftest.h
13715   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13716   cat conftest.in >> conftest.h
13717   rm -f conftest.in
13718   if cmp -s $ac_file conftest.h 2>/dev/null; then
13719     echo "$ac_file is unchanged"
13720     rm -f conftest.h
13721   else
13722     # Remove last slash and all that follows it.  Not all systems have dirname.
13723       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13724       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13725       # The file is in a subdirectory.
13726       test ! -d "$ac_dir" && mkdir "$ac_dir"
13727     fi
13728     rm -f $ac_file
13729     mv conftest.h $ac_file
13730   fi
13731 fi; done
13732
13733 EOF
13734 cat >> $CONFIG_STATUS <<EOF
13735 CPP="$CPP"
13736  top_srcdir="$srcdir"
13737  MAKE_SUBDIR="$MAKE_SUBDIR"
13738
13739 EOF
13740 cat >> $CONFIG_STATUS <<\EOF
13741 for dir in . $MAKE_SUBDIR; do
13742   (
13743     cd $dir
13744     rm -f junk.c
13745     < Makefile.in \
13746       sed -e '/^# Generated/d' \
13747           -e 's%/\*\*/#.*%%' \
13748           -e 's/^ *# */#/' \
13749           -e '/^##/d' \
13750           -e '/^#/ {
13751 p
13752 d
13753 }'        \
13754           -e '/./ {
13755 s/\([\"]\)/\\\1/g
13756 s/^/"/
13757 s/$/"/
13758 }'  > junk.c;
13759
13760
13761
13762     echo creating $dir/Makefile
13763 $CPP -I. -I${top_srcdir}/src  junk.c \
13764   | sed -e 's/^\#.*//'          \
13765         -e 's/^[        ][      ]*$//'\
13766         -e 's/^ /       /'              \
13767   | sed -n -e '/^..*$/p'        \
13768   | sed '/^\"/ {
13769         s/\\\([\"]\)/\1/g
13770         s/^[    ]*\"//
13771         s/\"[   ]*$//
13772 }' > Makefile.new
13773     chmod 444 Makefile.new
13774     mv -f Makefile.new Makefile
13775
13776     echo creating $dir/GNUmakefile
13777 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13778   | sed -e 's/^\#.*//'          \
13779         -e 's/^[        ][      ]*$//'\
13780         -e 's/^ /       /'              \
13781   | sed -n -e '/^..*$/p'        \
13782   | sed '/^\"/ {
13783         s/\\\([\"]\)/\1/g
13784         s/^[    ]*\"//
13785         s/\"[   ]*$//
13786 }' > Makefile.new
13787     chmod 444 Makefile.new
13788     mv -f Makefile.new GNUmakefile
13789
13790     rm -f junk.c
13791   )
13792 done
13793
13794 sed < config.status >> lib-src/config.values \
13795   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13796   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13797   -e 's/^\([^ ]*\) $/\1 ""/' \
13798   -e 's/ 1$/ t/'
13799
13800
13801 exit 0
13802 EOF
13803 chmod +x $CONFIG_STATUS
13804 rm -fr confdefs* $ac_clean_files
13805 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1