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 infodir='${datadir}/${PROGNAME}-${version}/info'
231 infopath=''
232 install_pp=''
233 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
234 moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
235 sitelispdir='${datadir}/xemacs/site-lisp'
236 sitemoduledir='${datadir}/xemacs/site-modules'
237 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
238 package_path=''
239 etcdir='${datadir}/${PROGNAME}-${version}/etc'
240 lockdir='${statedir}/${PROGNAME}/lock'
241 archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
242 with_site_lisp='no'
243 with_site_modules='yes'
244 with_menubars=''
245 with_scrollbars=''
246 with_dialogs=''
247 with_file_coding=''
248 cpp='' cppflags='' libs='' ldflags=''
249 dynamic=''
250 with_x11=''
251 with_msw=''
252 rel_alloc='default'
253 with_system_malloc='default'
254 with_dlmalloc='default'
255 native_sound_lib=''
256 use_assertions="yes"
257 with_toolbars=""
258 with_tty=""
259 use_union_type="no"
260 with_dnet=""
261
262
263
264
265 arguments="$@"
266
267 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
268 quoted_arguments=
269 for i in "$@"; do
270    case "$i" in
271    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
272    | --no-cr | --no-c) ;;
273    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
274    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
275    *)
276    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
277    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
278    esac
279 done
280
281 while test $# != 0; do
282   arg="$1"; shift
283   case "$arg" in
284     --no-create|--no-recursion) ;;
285         -* )
286             case "$arg" in
287         -*=*)
288           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
289           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
290           valomitted=no
291         ;;
292                                                                           -*)
293                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
294           val="yes" valomitted=yes
295         ;;
296       esac
297
298             optname="$opt"
299       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
300
301             case "${valomitted}-${opt}" in yes-without_* )
302         opt=`echo $opt | sed 's/without/with/'`
303         valomitted="no" val="no" ;;
304       esac
305
306             case "$opt" in
307
308         with_site_lisp  | \
309     with_site_modules | \
310         with_x          | \
311         with_x11        | \
312         with_msw        | \
313         with_gcc        | \
314         dynamic         | \
315         with_ncurses    | \
316         with_dnet       | \
317         with_socks      | \
318         with_dragndrop  | \
319         with_cde        | \
320         with_offix      | \
321         with_gpm        | \
322         with_xpm        | \
323         with_xface      | \
324         with_gif        | \
325         with_jpeg       | \
326         with_png        | \
327         with_tiff       | \
328         with_wmcommand  | \
329         with_xmu        | \
330         with_purify     | \
331         with_quantify   | \
332         with_toolbars   | \
333         with_tty        | \
334         with_xfs        | \
335         with_i18n3      | \
336         with_mule       | \
337         with_utf_2000   | \
338         with_file_coding| \
339         with_canna      | \
340         with_wnn        | \
341         with_wnn6       | \
342         with_workshop   | \
343         with_sparcworks | \
344         with_tooltalk   | \
345         with_ldap       | \
346         with_pop        | \
347         with_kerberos   | \
348         with_hesiod     | \
349         with_dnet       | \
350         with_infodock   | \
351         external_widget | \
352         verbose         | \
353         extra_verbose   | \
354         const_is_losing | \
355         usage_tracking  | \
356         use_union_type  | \
357         debug           | \
358         use_assertions  | \
359         memory_usage_stats | \
360         with_clash_detection | \
361         with_shlib | \
362         no_doc_file )
363                   case "$val" in
364             y | ye | yes )      val=yes ;;
365             n | no )            val=no  ;;
366             * ) (echo "$progname: Usage error:"
367 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
368 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
369           esac
370           eval "$opt=\"$val\"" ;;
371
372
373                         srcdir          | \
374         compiler        | \
375         cflags          | \
376         cpp             | \
377         cppflags        | \
378         libs            | \
379         ldflags         | \
380         cache_file      | \
381         native_sound_lib| \
382         site_lisp       | \
383         x_includes      | \
384         x_libraries     | \
385         site_includes   | \
386         site_libraries  | \
387         site_prefixes   | \
388         site_runtime_libraries )
389                   if test "$valomitted" = "yes" ; then
390                     if test "$#" = 0 ; then
391               (echo "$progname: Usage error:"
392 echo " " "The \`--$optname' option requires a value."
393 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
394             fi
395             val="$1"; shift
396           fi
397           eval "$opt=\"$val\""
398         ;;
399
400                 rel_alloc | \
401         with_dlmalloc | \
402         with_debug_malloc  | use_debug_malloc | \
403         with_system_malloc | use_system_malloc )
404           case "$val" in
405             y | ye | yes )      val=yes ;;
406             n | no )            val=no  ;;
407             d | de | def | defa | defau | defaul | default ) val=default ;;
408             * ) (echo "$progname: Usage error:"
409 echo " " "The \`--$optname' option requires one of these values:
410   \`yes', \`no', or \`default'."
411 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
412           esac
413           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
414           eval "$opt=\"$val\""
415         ;;
416
417                 "with_database" )
418           with_database_berkdb=no
419           with_database_dbm=no
420           with_database_gnudbm=no
421           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
422             case "$x" in
423                 no ) ;;
424                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
425                 d | db | dbm )                          with_database_dbm=yes    ;;
426                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
427                 * ) (echo "$progname: Usage error:"
428 echo " " "The \`--$optname' option value
429   must be either \`no' or a comma-separated list
430   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
431 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
432             esac
433           done
434           if test "$with_database_dbm"    = "yes" -a \
435                   "$with_database_gnudbm" = "yes"; then
436           (echo "$progname: Usage error:"
437 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
438   with the \`--$optname' option."
439 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
440           fi
441         ;;
442
443                 "with_sound" )
444                           case "$val" in
445             y | ye | yes )                      val=native ;;
446             n | no | non | none )               val=no;;
447             na | nat | nati | nativ | native )  val=native  ;;
448             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
449             b | bo | bot | both )               val=both;;
450             * ) (echo "$progname: Usage error:"
451 echo " " "The \`--$optname' option must have one of these values:
452   \`native', \`nas', \`both', or \`none'."
453 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
454           esac
455           eval "$opt=\"$val\""
456         ;;
457
458                 "with_xim" )
459           case "$val" in
460             y | ye | yes )                val=yes   ;;
461             n | no | non | none )         val=no    ;;
462             x | xl | xli | xlib )         val=xlib  ;;
463             m | mo | mot | moti | motif ) val=motif ;;
464             * ) (echo "$progname: Usage error:"
465 echo " " "The \`--$optname' option must have one of these values:
466   \`motif', \`xlib', \`yes', or \`no'."
467 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
468           esac
469           eval "$opt=\"$val\""
470         ;;
471
472                 "mail_locking" )
473           case "$val" in
474             lockf )     val=lockf ;;
475             flock )     val=flock ;;
476             file )      val=file  ;;
477             * ) (echo "$progname: Usage error:"
478 echo " " "The \`--$optname' option must have one of these values:
479   \`lockf', \`flock', or \`file'."
480 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
481           esac
482           eval "$opt=\"$val\""
483         ;;
484
485                 "error_checking" )
486                           
487           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
488             case "$x" in
489                       n | no | non | none ) new_default=no ;;
490               a | al | all )        new_default=yes ;;
491
492               extents )       error_check_extents=yes ;;
493               noextents )     error_check_extents=no ;;
494
495               typecheck )     error_check_typecheck=yes ;;
496               notypecheck )   error_check_typecheck=no ;;
497
498               bufpos )        error_check_bufpos=yes ;;
499               nobufpos )      error_check_bufpos=no ;;
500
501               gc )            error_check_gc=yes ;;
502               nogc )          error_check_gc=no ;;
503
504               malloc )        error_check_malloc=yes ;;
505               nomalloc )      error_check_malloc=no ;;
506
507               byte_code )     error_check_byte_code=yes ;;
508               nobyte_code )   error_check_byte_code=no ;;
509
510               * ) bogus_error_check=yes ;;
511             esac
512             if test "$bogus_error_check" -o \
513                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
514                 if test "$error_check_default" = yes ; then
515                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
516                 else
517                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
518                 fi
519                 (echo "$progname: Usage error:"
520 echo " " "Valid types for the \`--$optname' option are:
521   $types."
522 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
523             elif test -n "$new_default" ; then
524                 error_check_extents=$new_default
525                 error_check_typecheck=$new_default
526                 error_check_bufpos=$new_default
527                 error_check_gc=$new_default
528                 error_check_malloc=$new_default
529                 error_check_byte_code=$new_default
530                 new_default=    # reset this
531             fi
532             echeck_notfirst=true
533           done
534         ;;
535
536                                 
537                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
538         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
539         archlibdir | docdir | package_path )
540                    if test "$valomitted" = "yes"; then
541              if test "$#" = 0; then
542                  (echo "$progname: Usage error:"
543 echo " " "The \`--$optname' option requires a value."
544 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
545              fi
546              val="$1"; shift
547            fi
548            eval "$opt=\"$val\""
549
550                            case "$opt" in
551              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
552     Defining LISPDIR_USER_DEFINED
553 EOF
554 cat >> confdefs.h <<\EOF
555 #define LISPDIR_USER_DEFINED 1
556 EOF
557 }
558  ;;
559              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
560     Defining SITELISPDIR_USER_DEFINED
561 EOF
562 cat >> confdefs.h <<\EOF
563 #define SITELISPDIR_USER_DEFINED 1
564 EOF
565 }
566  ;;
567              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
568     Defining MODULEDIR_USER_DEFINED
569 EOF
570 cat >> confdefs.h <<\EOF
571 #define MODULEDIR_USER_DEFINED 1
572 EOF
573 }
574  ;;
575              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
576     Defining ETCDIR_USER_DEFINED
577 EOF
578 cat >> confdefs.h <<\EOF
579 #define ETCDIR_USER_DEFINED 1
580 EOF
581 }
582  ;;
583              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
584     Defining INFODIR_USER_DEFINED
585 EOF
586 cat >> confdefs.h <<\EOF
587 #define INFODIR_USER_DEFINED 1
588 EOF
589 }
590  ;;
591              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
592     Defining INFOPATH_USER_DEFINED
593 EOF
594 cat >> confdefs.h <<\EOF
595 #define INFOPATH_USER_DEFINED 1
596 EOF
597 }
598  ;;
599              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
600     Defining PACKAGE_PATH_USER_DEFINED
601 EOF
602 cat >> confdefs.h <<\EOF
603 #define PACKAGE_PATH_USER_DEFINED 1
604 EOF
605 }
606  ;;
607              datadir )
608                 { test "$extra_verbose" = "yes" && cat << \EOF
609     Defining INFODIR_USER_DEFINED
610 EOF
611 cat >> confdefs.h <<\EOF
612 #define INFODIR_USER_DEFINED 1
613 EOF
614 }
615
616                 { test "$extra_verbose" = "yes" && cat << \EOF
617     Defining LISPDIR_USER_DEFINED
618 EOF
619 cat >> confdefs.h <<\EOF
620 #define LISPDIR_USER_DEFINED 1
621 EOF
622 }
623
624             { test "$extra_verbose" = "yes" && cat << \EOF
625     Defining MODULEDIR_USER_DEFINED
626 EOF
627 cat >> confdefs.h <<\EOF
628 #define MODULEDIR_USER_DEFINED 1
629 EOF
630 }
631
632                 { test "$extra_verbose" = "yes" && cat << \EOF
633     Defining ETCDIR_USER_DEFINED
634 EOF
635 cat >> confdefs.h <<\EOF
636 #define ETCDIR_USER_DEFINED 1
637 EOF
638 }
639  ;;
640              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
641     Defining LOCKDIR_USER_DEFINED
642 EOF
643 cat >> confdefs.h <<\EOF
644 #define LOCKDIR_USER_DEFINED 1
645 EOF
646 }
647  ;;
648              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
649     Defining ARCHLIBDIR_USER_DEFINED
650 EOF
651 cat >> confdefs.h <<\EOF
652 #define ARCHLIBDIR_USER_DEFINED 1
653 EOF
654 }
655  ;;
656            esac
657         ;;
658
659                 "no_create" ) ;;
660
661                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
662
663                 "with_menubars"   | \
664         "with_scrollbars" | \
665         "with_dialogs" )
666           case "$val" in
667             l | lu | luc | luci | lucid )               val=lucid  ;;
668             m | mo | mot | moti | motif )               val=motif  ;;
669             athena3d | athena-3d )                      val=athena3d ;;
670             a | at | ath | athe | athen | athena )      val=athena ;;
671             n | no | non | none )                       val=no ;;
672             * ) (echo "$progname: Usage error:"
673 echo " " "The \`--$optname' option must have one of these values:
674   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
675 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
676           esac
677           eval "$opt=\"$val\""
678         ;;
679
680                 "run_in_place"  | \
681         "with_gnu_make" )
682           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
683         ;;
684
685                 * ) (echo "$progname: Usage error:"
686 echo " " "Unrecognized option: $arg"
687 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
688
689       esac
690     ;;
691
692         *-*-*) configuration="$arg" ;;
693
694         *) (echo "$progname: Usage error:"
695 echo " " "Unrecognized argument: $arg"
696 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
697
698   esac
699 done
700
701
702 test -n "$cpp"      && CPP="$cpp"
703 test -n "$cppflags" && CPPFLAGS="$cppflags"
704 test -n "$libs"     && LIBS="$libs"
705 test -n "$ldflags"  && LDFLAGS="$ldflags"
706
707 eval set x "$quoted_arguments"; shift
708
709 test "$extra_verbose" = "yes" && verbose=yes
710
711 test -n "$with_x" && with_x11="$with_x"
712
713 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
714   test "$with_system_malloc" = "default" && with_system_malloc=yes
715 fi
716
717
718
719 if test "$with_cde $with_tooltalk" = "yes no"; then
720   (echo "$progname: Usage error:"
721 echo " " "--with-cde requires --with-tooltalk"
722 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
723 elif test "$with_tooltalk" = "no" ; then with_cde=no
724 elif test "$with_cde" = "yes"; then with_tooltalk=yes
725 fi
726
727
728 case "$srcdir" in
729
730     "" )
731     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
732       if test -f "$dir/src/lisp.h" -a \
733               -f "$dir/lisp/version.el" ; then
734         srcdir="$dir"
735         break
736       fi
737     done
738     if test -z "$srcdir" ; then
739       (echo "$progname: Usage error:"
740 echo " " "Neither the current directory nor its parent seem to
741   contain the XEmacs sources.  If you do not want to build XEmacs in its
742   source tree, you should run \`$progname' in the directory in which
743   you wish to build XEmacs, using the \`--srcdir' option to say where the
744   sources may be found."
745 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
746     fi
747   ;;
748
749     * )
750     if test ! -f "$srcdir/src/lisp.h" -o \
751             ! -f "$srcdir/lisp/version.el" ; then
752       (echo "$progname: Usage error:"
753 echo " " "The directory specified with the \`--srcdir' option,
754   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
755   either run the \`$progname' script at the top of the XEmacs source
756   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
757 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
758     fi
759   ;;
760 esac
761
762 if test -z "$configuration"; then
763     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
764   if test -z "$configuration"; then
765     (echo "$progname: Usage error:"
766 echo " " "XEmacs has not been ported to this host type.
767 Try explicitly specifying the CONFIGURATION when rerunning configure."
768 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
769   fi
770 fi
771
772 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
773 echo "configure:774: checking whether ln -s works" >&5
774
775 rm -f conftestdata
776 if ln -s X conftestdata 2>/dev/null
777 then
778   rm -f conftestdata
779   ac_cv_prog_LN_S="ln -s"
780 else
781   ac_cv_prog_LN_S=ln
782 fi
783 LN_S="$ac_cv_prog_LN_S"
784 if test "$ac_cv_prog_LN_S" = "ln -s"; then
785   echo "$ac_t""yes" 1>&6
786 else
787   echo "$ac_t""no" 1>&6
788 fi
789
790
791 for dir in lisp etc man info; do
792   if test ! -d "$dir" ; then
793     echo Making symbolic link to "$srcdir/$dir"
794     ${LN_S} "$srcdir/$dir" "$dir"
795   fi
796 done
797
798
799 absolute_pwd="`pwd`";
800 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
801 then blddir="$PWD"
802 else blddir="$absolute_pwd"; if test -d "/net"; then
803   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
804   blddir=`echo "$blddir" | \
805    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
806 fi
807 fi
808
809
810 case "$srcdir" in
811   /* ) ;;
812   .  ) srcdir="$blddir" ;;
813   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
814   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
815   srcdir=`echo "$srcdir" | \
816    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
817 fi ;;
818 esac
819
820 if test `pwd` != `sh -c cd $srcdir && pwd`  \
821    && test -f "$srcdir/src/config.h"; then
822   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
823    echo "   as a build directory right now; it has been configured in its own"
824    echo "   right.  To configure in another directory as well, you MUST"
825    echo "   use GNU make.  If you do not have GNU make, then you must"
826    echo "   now do \`make distclean' in $srcdir,"
827    echo "   and then run $progname again.") >&2
828   extrasub='/^VPATH[     ]*=/c\
829 vpath %.c $(srcdir)\
830 vpath %.h $(srcdir)\
831 vpath %.y $(srcdir)\
832 vpath %.l $(srcdir)\
833 vpath %.s $(srcdir)\
834 vpath %.in $(srcdir)'
835 fi
836
837 . "$srcdir/version.sh" || exit 1;
838 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
839 : "${extra_verbose=$beta}"
840 version="${emacs_major_version}.${emacs_minor_version}"
841 { test "$extra_verbose" = "yes" && cat << EOF
842     Defining EMACS_MAJOR_VERSION = $emacs_major_version
843 EOF
844 cat >> confdefs.h <<EOF
845 #define EMACS_MAJOR_VERSION $emacs_major_version
846 EOF
847 }
848
849 { test "$extra_verbose" = "yes" && cat << EOF
850     Defining EMACS_MINOR_VERSION = $emacs_minor_version
851 EOF
852 cat >> confdefs.h <<EOF
853 #define EMACS_MINOR_VERSION $emacs_minor_version
854 EOF
855 }
856
857 if test -n "$emacs_beta_version" ; then
858   if test "$beta" = "yes"; then
859         version="${version}-b${emacs_beta_version}"
860         { test "$extra_verbose" = "yes" && cat << EOF
861     Defining EMACS_BETA_VERSION = $emacs_beta_version
862 EOF
863 cat >> confdefs.h <<EOF
864 #define EMACS_BETA_VERSION $emacs_beta_version
865 EOF
866 }
867
868   else
869         version="${version}.${emacs_beta_version}"
870         { test "$extra_verbose" = "yes" && cat << EOF
871     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
872 EOF
873 cat >> confdefs.h <<EOF
874 #define EMACS_PATCH_LEVEL $emacs_beta_version
875 EOF
876 }
877
878   fi
879 fi
880 { test "$extra_verbose" = "yes" && cat << EOF
881     Defining XEMACS_CODENAME = "$xemacs_codename"
882 EOF
883 cat >> confdefs.h <<EOF
884 #define XEMACS_CODENAME "$xemacs_codename"
885 EOF
886 }
887
888 { test "$extra_verbose" = "yes" && cat << EOF
889     Defining EMACS_VERSION = "$version"
890 EOF
891 cat >> confdefs.h <<EOF
892 #define EMACS_VERSION "$version"
893 EOF
894 }
895
896
897 if test "$with_infodock" = "yes"; then
898   if test ! -f ../ID-INSTALL; then
899     echo "Cannot build InfoDock without InfoDock sources"
900     with_infodock=no
901   fi
902 fi
903
904 if test "$with_infodock" = "yes"; then
905       { test "$extra_verbose" = "yes" && cat << EOF
906     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
907 EOF
908 cat >> confdefs.h <<EOF
909 #define INFODOCK_MAJOR_VERSION $infodock_major_version
910 EOF
911 }
912
913   { test "$extra_verbose" = "yes" && cat << EOF
914     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
915 EOF
916 cat >> confdefs.h <<EOF
917 #define INFODOCK_MINOR_VERSION $infodock_minor_version
918 EOF
919 }
920
921   { test "$extra_verbose" = "yes" && cat << EOF
922     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
923 EOF
924 cat >> confdefs.h <<EOF
925 #define INFODOCK_BUILD_VERSION $infodock_build_version
926 EOF
927 }
928
929   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
930   PROGNAME=infodock
931   CPPFLAGS="$CPPFLAGS -DINFODOCK"
932 else
933   PROGNAME=xemacs
934 fi
935
936 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
937 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
938     Defining ERROR_CHECK_EXTENTS
939 EOF
940 cat >> confdefs.h <<\EOF
941 #define ERROR_CHECK_EXTENTS 1
942 EOF
943 }
944
945 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
946     Defining ERROR_CHECK_TYPECHECK
947 EOF
948 cat >> confdefs.h <<\EOF
949 #define ERROR_CHECK_TYPECHECK 1
950 EOF
951 }
952
953 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
954     Defining ERROR_CHECK_BUFPOS
955 EOF
956 cat >> confdefs.h <<\EOF
957 #define ERROR_CHECK_BUFPOS 1
958 EOF
959 }
960
961 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
962     Defining ERROR_CHECK_GC
963 EOF
964 cat >> confdefs.h <<\EOF
965 #define ERROR_CHECK_GC 1
966 EOF
967 }
968
969 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
970     Defining ERROR_CHECK_MALLOC
971 EOF
972 cat >> confdefs.h <<\EOF
973 #define ERROR_CHECK_MALLOC 1
974 EOF
975 }
976
977 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
978     Defining ERROR_CHECK_BYTE_CODE
979 EOF
980 cat >> confdefs.h <<\EOF
981 #define ERROR_CHECK_BYTE_CODE 1
982 EOF
983 }
984
985 if test "${debug:=$beta}" = "yes"; then
986   use_assertions=yes memory_usage_stats=yes
987   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
988    echo "    xemacs will be linked with \"debug.o\""
989  fi
990   { test "$extra_verbose" = "yes" && cat << \EOF
991     Defining DEBUG_XEMACS
992 EOF
993 cat >> confdefs.h <<\EOF
994 #define DEBUG_XEMACS 1
995 EOF
996 }
997
998 fi
999 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1000     Defining USE_ASSERTIONS
1001 EOF
1002 cat >> confdefs.h <<\EOF
1003 #define USE_ASSERTIONS 1
1004 EOF
1005 }
1006
1007 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1008     Defining MEMORY_USAGE_STATS
1009 EOF
1010 cat >> confdefs.h <<\EOF
1011 #define MEMORY_USAGE_STATS 1
1012 EOF
1013 }
1014
1015
1016
1017 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1018 echo "configure:1019: checking "host system type"" >&5
1019 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1020 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1021 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1022 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1023 echo "$ac_t""$configuration" 1>&6
1024
1025
1026
1027
1028
1029 machine='' opsys=''
1030
1031 case "$canonical" in
1032   sparc-*-*        ) machine=sparc ;;
1033   alpha*-*-*       ) machine=alpha ;;
1034   vax-*-*          ) machine=vax ;;
1035   mips-dec-*       ) machine=pmax ;;
1036   mips-sgi-*       ) machine=iris4d ;;
1037   romp-ibm-*       ) machine=ibmrt ;;
1038   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1039   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1040   powerpc*-*       ) machine=powerpc ;;
1041   hppa-*-*         ) machine=hp800 ;;
1042   m88k-dg-*        ) machine=aviion ;;
1043   m68*-sony-*      ) machine=news ;;
1044   mips-sony-*      ) machine=news-risc ;;
1045   clipper-*        ) machine=clipper ;;
1046   arm-*            ) machine=arm ;;
1047   ns32k-*          ) machine=ns32000 ;;
1048 esac
1049
1050 case "$canonical" in
1051   *-*-linux*    ) opsys=linux ;;
1052   *-*-netbsd*   ) opsys=netbsd ;;
1053   *-*-openbsd*  ) opsys=openbsd ;;
1054   *-*-nextstep* ) opsys=nextstep ;;
1055   *-*-vms       ) opsys=vms ;;
1056
1057     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1058   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1059   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1060   *-dec-osf3*                ) opsys=decosf3-1 ;;
1061   *-dec-osf4*                ) opsys=decosf4-0 ;;
1062
1063     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1064   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1065   *-*-ultrix* )         opsys=ultrix4-3 ;;
1066
1067     *-*-aix3.1*  ) opsys=aix3-1 ;;
1068   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1069   *-*-aix3*    ) opsys=aix3-2   ;;
1070   *-*-aix4.0*  ) opsys=aix4     ;;
1071   *-*-aix4.1*  ) opsys=aix4-1   ;;
1072   *-*-aix4*    ) opsys=aix4-2   ;;
1073
1074     *-gnu* )                    opsys=gnu    ;;
1075   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1076   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1077   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1078   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1079   *-*-aos*   )                  opsys=bsd4-3 ;;
1080   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1081   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1082   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1083   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1084   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1085   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1086         if test -z "$NON_GNU_CPP" ; then
1087           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1088             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1089           done
1090         fi
1091         opsys=usg5-4-2 ;;
1092     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1093     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1094 esac
1095
1096 case "$canonical" in
1097
1098     *-*-netbsd* )
1099     case "$canonical" in
1100       i[3-9]86-*-netbsd*) machine=intel386 ;;
1101       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1102                                             machine=hp9000s300 ;;
1103       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1104       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1105     esac
1106   ;;
1107
1108     *-*-openbsd* )
1109     case "${canonical}" in
1110       i386-*-openbsd*)          machine=intel386 ;;
1111       m68k-*-openbsd*)          machine=hp9000s300 ;;
1112       mipsel-*-openbsd*)        machine=pmax ;;
1113      esac
1114    ;;
1115
1116     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1117   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1118
1119     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1120   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1121
1122     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1123
1124     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1125
1126     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1127
1128     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1129
1130     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1131
1132     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1133   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1134   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1135
1136   
1137     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1138
1139     *-convex-bsd* | *-convex-convexos* )
1140     machine=convex opsys=bsd4-3
1141     NON_GNU_CPP="cc -E -P"
1142   ;;
1143
1144     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1145
1146     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1147   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1148   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1149   m88k-dg-dgux*                           ) opsys=dgux     ;;
1150
1151     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1152   m88k-motorola-sysv4* )
1153                     machine=delta88k opsys=usg5-4-2
1154   ;;
1155   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1156
1157     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1158   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1159
1160     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1161
1162     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1163   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1164   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1165
1166       m88k-harris-cxux* )
1167         case "`uname -r`" in
1168        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1169        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1170     esac
1171     NON_GNU_CPP="/lib/cpp"
1172   ;;
1173     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1174     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1175
1176     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1177
1178     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1179
1180     *-hp-hpux* )
1181         case "$canonical" in
1182       m68*  ) machine=hp9000s300 ;;
1183       hppa* ) machine=hp800      ;;
1184     esac
1185
1186     case "$canonical" in
1187       *-hp-hpux7*  )  opsys=hpux   ;;
1188       *-hp-hpux8*  )  opsys=hpux8  ;;
1189       *-hp-hpux9*  )  opsys=hpux9  ;;
1190       *-hp-hpux10* )  opsys=hpux10 ;;
1191       *-hp-hpux11* )  opsys=hpux11 ;;
1192       *            )  opsys=hpux   ;;
1193     esac
1194
1195         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1196    echo "    xemacs will be linked with \"strcat.o\""
1197  fi ;; esac
1198
1199     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1200         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1201     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1202
1203     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1204   ;;
1205
1206     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1207   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1208
1209     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1210   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1211   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1212   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1213   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1214   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1215
1216     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1217   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1218
1219     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1220
1221     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1222
1223     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1224
1225     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1226
1227       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1228
1229     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1230
1231     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1232
1233     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1234
1235     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1236
1237         mips-mips-usg* ) machine=mips4 ;;
1238   mips-mips-riscos4 )
1239     machine=mips4
1240     NON_GNU_CC="cc -systype bsd43"
1241     NON_GNU_CPP="cc -systype bsd43 -E"
1242     case "$canonical" in
1243       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1244       mips-mips-riscos5* ) opsys=riscos5 ;;
1245     esac
1246   ;;
1247   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1248   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1249
1250     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1251
1252     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1253
1254     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1255   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1256
1257     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1258
1259     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1260
1261     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1262
1263     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1264
1265     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1266   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1267
1268     mips-siemens-sysv* | mips-sni-sysv*)
1269     machine=mips-siemens opsys=usg5-4
1270     NON_GNU_CC=/usr/ccs/bin/cc
1271     NON_GNU_CPP=/usr/ccs/lib/cpp
1272   ;;
1273
1274     mips-nec-sysv*)
1275     machine=mips-nec
1276     NON_GNU_CC=/usr/ccs/bin/cc
1277     NON_GNU_CPP=/usr/ccs/lib/cpp
1278   ;;
1279
1280       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1281   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1282     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1283   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1284   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1285   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1286   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1287   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1288   mips-sgi-irix*      ) opsys=irix5-0 ;;
1289
1290     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1291   *-sony-news* ) opsys=newsos5 ;;
1292
1293     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1294
1295     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1296         case "$canonical" in
1297       m68*-sunos1* )             machine=sun1     ;;
1298       m68*-sunos2* )             machine=sun2     ;;
1299       m68* )                     machine=sun3     ;;
1300       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1301       i*86-*-* )                 machine=intel386 ;;
1302       rs6000* )                  machine=rs6000   ;;
1303     esac
1304
1305         case "$canonical" in *-sunos5*)
1306       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1307     esac
1308
1309                     case "$canonical" in
1310       *-sunos4* )
1311         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1312         : ;;
1313       *-solaris2* )
1314         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1315         RANLIB=':' ;;
1316     esac
1317
1318     case "$canonical" in
1319       *-solaris*          )
1320         opsys=sol2
1321         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1322         { test "$extra_verbose" = "yes" && cat << EOF
1323     Defining OS_RELEASE = $os_release
1324 EOF
1325 cat >> confdefs.h <<EOF
1326 #define OS_RELEASE $os_release
1327 EOF
1328 }
1329  ;;
1330
1331             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1332       *-sunos4.0*         ) opsys=sunos4-0      ;;
1333       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1334       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1335       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1336       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1337       *-mach*             ) opsys=mach-bsd4-3   ;;
1338       *                   ) opsys=bsd4-2        ;;
1339     esac
1340
1341     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1342
1343         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1344   ;;
1345
1346     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1347
1348     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1349   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1350
1351     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1352
1353     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1354
1355     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1356       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1357
1358     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1359
1360     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1361
1362     vax-dec-* )
1363     case "$canonical" in
1364       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1365       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1366       *-mach* )                         opsys=mach-bsd4-3 ;;
1367     esac
1368   ;;
1369
1370     ns16k-whitechapel-* ) machine=mg1 ;;
1371
1372     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1373
1374     i[3-9]86-*-* )
1375     machine=intel386
1376     case "$canonical" in
1377       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1378       *-isc2.2* )               opsys=isc2-2 ;;
1379       *-isc4.0* )               opsys=isc4-0 ;;
1380       *-isc4.* )                opsys=isc4-1
1381                                 GCC_TEST_OPTIONS=-posix
1382                                 NON_GCC_TEST_OPTIONS=-Xp
1383                                 ;;
1384       *-isc* )                  opsys=isc3-0 ;;
1385       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1386       *-esix* )                 opsys=esix ;;
1387       *-mach* )                 opsys=mach-bsd4-3 ;;
1388       *-xenix* )                opsys=xenix ;;
1389       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1390       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1391       *-bsdi4* )                opsys=bsdos4 ;;
1392       *-bsdi3* )                opsys=bsdos3 ;;
1393       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1394       *-bsdi2* )                opsys=bsdos2 ;;
1395       *-sco3.2v5* )             opsys=sco5 ;
1396                                                         if test "$dynamic" = "yes" ; then
1397                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1398         else
1399                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1400         fi ;;
1401       *-386bsd* )               opsys=386bsd ;;
1402       *-freebsd* )              opsys=freebsd ;;
1403       *-nextstep* )             opsys=nextstep ;;
1404       *-pc-cygwin* )            opsys=cygwin32 ;;
1405       *-pc-mingw* )             opsys=mingw32 ;
1406                                 test -z "$with_tty" && with_tty="no";;
1407           esac
1408   ;;
1409
1410     m68k-*-linux* ) machine=m68k opsys=linux ;;
1411
1412 esac
1413
1414 if test -z "$machine" -o -z "$opsys"; then
1415   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1416    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1417   ) >&2
1418   exit 1
1419 fi
1420
1421 if test -z "$dynamic"; then
1422   case "$opsys" in
1423     hpux* | sunos4* ) dynamic=no ;;
1424     *) dynamic=yes ;;
1425   esac
1426 fi
1427 if test "$dynamic" = "yes"; then
1428   case "$opsys" in
1429     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1430     decosf* ) ld_call_shared="-call_shared" ;;
1431   esac
1432 else   case "$opsys" in
1433     sol2 )
1434       echo "Static linking is not supported on Solaris 2."
1435       echo "Rerun configure without specifying --dynamic=no."
1436       exit 1 ;;
1437     linux   ) ld_call_shared="-Bstatic" ;;
1438     decosf* ) ld_call_shared="-non_shared" ;;
1439   esac
1440 fi
1441
1442 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1443
1444 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1445 { test "$extra_verbose" = "yes" && cat << EOF
1446     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1447 EOF
1448 cat >> confdefs.h <<EOF
1449 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1450 EOF
1451 }
1452
1453
1454 machfile="m/${machine}.h"
1455 opsysfile="s/${opsys}.h"
1456
1457
1458 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1459 if test "$with_workshop $with_tooltalk" = "yes no"; then
1460   (echo "$progname: Usage error:"
1461 echo " " "--with-workshop requires --with-tooltalk"
1462 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1463 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1464 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1465 fi
1466
1467 if test "$with_workshop" = "yes"; then
1468   { test "$extra_verbose" = "yes" && cat << \EOF
1469     Defining SUNPRO
1470 EOF
1471 cat >> confdefs.h <<\EOF
1472 #define SUNPRO 1
1473 EOF
1474 }
1475
1476   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1477    echo "    xemacs will be linked with \"sunpro.o\""
1478  fi
1479 fi
1480
1481 if test "$with_clash_detection" = "yes"; then
1482   { test "$extra_verbose" = "yes" && cat << \EOF
1483     Defining CLASH_DETECTION
1484 EOF
1485 cat >> confdefs.h <<\EOF
1486 #define CLASH_DETECTION 1
1487 EOF
1488 }
1489
1490   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1491    echo "    xemacs will be linked with \"filelock.o\""
1492  fi
1493 fi
1494
1495 test -n "$compiler" && CC="$compiler"
1496 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1497 fi
1498
1499 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1500 if test "${CFLAGS-unset}" != unset
1501   then cflags_specified=yes;
1502   else cflags_specified=no;
1503 fi
1504
1505 xe_save_CFLAGS="$CFLAGS"
1506
1507 # Extract the first word of "gcc", so it can be a program name with args.
1508 set dummy gcc; ac_word=$2
1509 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1510 echo "configure:1511: checking for $ac_word" >&5
1511
1512 if test -n "$CC"; then
1513   ac_cv_prog_CC="$CC" # Let the user override the test.
1514 else
1515   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1516   ac_dummy="$PATH"
1517   for ac_dir in $ac_dummy; do
1518     test -z "$ac_dir" && ac_dir=.
1519     if test -f $ac_dir/$ac_word; then
1520       ac_cv_prog_CC="gcc"
1521       break
1522     fi
1523   done
1524   IFS="$ac_save_ifs"
1525 fi
1526 CC="$ac_cv_prog_CC"
1527 if test -n "$CC"; then
1528   echo "$ac_t""$CC" 1>&6
1529 else
1530   echo "$ac_t""no" 1>&6
1531 fi
1532
1533 if test -z "$CC"; then
1534   # Extract the first word of "cc", so it can be a program name with args.
1535 set dummy cc; ac_word=$2
1536 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1537 echo "configure:1538: checking for $ac_word" >&5
1538
1539 if test -n "$CC"; then
1540   ac_cv_prog_CC="$CC" # Let the user override the test.
1541 else
1542   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1543   ac_prog_rejected=no
1544   ac_dummy="$PATH"
1545   for ac_dir in $ac_dummy; do
1546     test -z "$ac_dir" && ac_dir=.
1547     if test -f $ac_dir/$ac_word; then
1548       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1549         ac_prog_rejected=yes
1550         continue
1551       fi
1552       ac_cv_prog_CC="cc"
1553       break
1554     fi
1555   done
1556   IFS="$ac_save_ifs"
1557 if test $ac_prog_rejected = yes; then
1558   # We found a bogon in the path, so make sure we never use it.
1559   set dummy $ac_cv_prog_CC
1560   shift
1561   if test $# -gt 0; then
1562     # We chose a different compiler from the bogus one.
1563     # However, it has the same basename, so the bogon will be chosen
1564     # first if we set CC to just the basename; use the full file name.
1565     shift
1566     set dummy "$ac_dir/$ac_word" "$@"
1567     shift
1568     ac_cv_prog_CC="$@"
1569   fi
1570 fi
1571 fi
1572 CC="$ac_cv_prog_CC"
1573 if test -n "$CC"; then
1574   echo "$ac_t""$CC" 1>&6
1575 else
1576   echo "$ac_t""no" 1>&6
1577 fi
1578
1579   if test -z "$CC"; then
1580     case "`uname -s`" in
1581     *win32* | *WIN32*)
1582       # Extract the first word of "cl", so it can be a program name with args.
1583 set dummy cl; ac_word=$2
1584 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1585 echo "configure:1586: checking for $ac_word" >&5
1586
1587 if test -n "$CC"; then
1588   ac_cv_prog_CC="$CC" # Let the user override the test.
1589 else
1590   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1591   ac_dummy="$PATH"
1592   for ac_dir in $ac_dummy; do
1593     test -z "$ac_dir" && ac_dir=.
1594     if test -f $ac_dir/$ac_word; then
1595       ac_cv_prog_CC="cl"
1596       break
1597     fi
1598   done
1599   IFS="$ac_save_ifs"
1600 fi
1601 CC="$ac_cv_prog_CC"
1602 if test -n "$CC"; then
1603   echo "$ac_t""$CC" 1>&6
1604 else
1605   echo "$ac_t""no" 1>&6
1606 fi
1607  ;;
1608     esac
1609   fi
1610   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1611 fi
1612
1613 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1614 echo "configure:1615: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1615
1616 ac_ext=c
1617 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1618 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1619 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1620 ac_cpp='$CPP '"$xe_cppflags"
1621 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1622 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1623 cross_compiling=no
1624
1625 cat > conftest.$ac_ext << EOF
1626
1627 #line 1628 "configure"
1628 #include "confdefs.h"
1629
1630 main(){return(0);}
1631 EOF
1632 if { (eval echo configure:1633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1633   ac_cv_prog_cc_works=yes
1634   # If we can't run a trivial program, we are probably using a cross compiler.
1635   if (./conftest; exit) 2>/dev/null; then
1636     ac_cv_prog_cc_cross=no
1637   else
1638     ac_cv_prog_cc_cross=yes
1639   fi
1640 else
1641   echo "configure: failed program was:" >&5
1642   cat conftest.$ac_ext >&5
1643   ac_cv_prog_cc_works=no
1644 fi
1645 rm -fr conftest*
1646 ac_ext=c
1647 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1648 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1649 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1650 ac_cpp='$CPP '"$xe_cppflags"
1651 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1652 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1653 cross_compiling=no
1654
1655 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1656 if test $ac_cv_prog_cc_works = no; then
1657   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1658 fi
1659 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1660 echo "configure:1661: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1661 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1662 cross_compiling=$ac_cv_prog_cc_cross
1663
1664 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1665 echo "configure:1666: checking whether we are using GNU C" >&5
1666
1667 cat > conftest.c <<EOF
1668 #ifdef __GNUC__
1669   yes;
1670 #endif
1671 EOF
1672 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1673   ac_cv_prog_gcc=yes
1674 else
1675   ac_cv_prog_gcc=no
1676 fi
1677
1678 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1679
1680 if test $ac_cv_prog_gcc = yes; then
1681   GCC=yes
1682 else
1683   GCC=
1684 fi
1685
1686 ac_test_CFLAGS="${CFLAGS+set}"
1687 ac_save_CFLAGS="$CFLAGS"
1688 CFLAGS=
1689 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1690 echo "configure:1691: checking whether ${CC-cc} accepts -g" >&5
1691
1692 echo 'void f(){}' > conftest.c
1693 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1694   ac_cv_prog_cc_g=yes
1695 else
1696   ac_cv_prog_cc_g=no
1697 fi
1698 rm -f conftest*
1699
1700
1701 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1702 if test "$ac_test_CFLAGS" = set; then
1703   CFLAGS="$ac_save_CFLAGS"
1704 elif test $ac_cv_prog_cc_g = yes; then
1705   if test "$GCC" = yes; then
1706     CFLAGS="-g -O2"
1707   else
1708     CFLAGS="-g"
1709   fi
1710 else
1711   if test "$GCC" = yes; then
1712     CFLAGS="-O2"
1713   else
1714     CFLAGS=
1715   fi
1716 fi
1717  
1718 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1719   CC=${NON_GNU_CC-cc}
1720   # Extract the first word of "gcc", so it can be a program name with args.
1721 set dummy gcc; ac_word=$2
1722 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1723 echo "configure:1724: checking for $ac_word" >&5
1724
1725 if test -n "$CC"; then
1726   ac_cv_prog_CC="$CC" # Let the user override the test.
1727 else
1728   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1729   ac_dummy="$PATH"
1730   for ac_dir in $ac_dummy; do
1731     test -z "$ac_dir" && ac_dir=.
1732     if test -f $ac_dir/$ac_word; then
1733       ac_cv_prog_CC="gcc"
1734       break
1735     fi
1736   done
1737   IFS="$ac_save_ifs"
1738 fi
1739 CC="$ac_cv_prog_CC"
1740 if test -n "$CC"; then
1741   echo "$ac_t""$CC" 1>&6
1742 else
1743   echo "$ac_t""no" 1>&6
1744 fi
1745
1746 if test -z "$CC"; then
1747   # Extract the first word of "cc", so it can be a program name with args.
1748 set dummy cc; ac_word=$2
1749 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1750 echo "configure:1751: checking for $ac_word" >&5
1751
1752 if test -n "$CC"; then
1753   ac_cv_prog_CC="$CC" # Let the user override the test.
1754 else
1755   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1756   ac_prog_rejected=no
1757   ac_dummy="$PATH"
1758   for ac_dir in $ac_dummy; do
1759     test -z "$ac_dir" && ac_dir=.
1760     if test -f $ac_dir/$ac_word; then
1761       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1762         ac_prog_rejected=yes
1763         continue
1764       fi
1765       ac_cv_prog_CC="cc"
1766       break
1767     fi
1768   done
1769   IFS="$ac_save_ifs"
1770 if test $ac_prog_rejected = yes; then
1771   # We found a bogon in the path, so make sure we never use it.
1772   set dummy $ac_cv_prog_CC
1773   shift
1774   if test $# -gt 0; then
1775     # We chose a different compiler from the bogus one.
1776     # However, it has the same basename, so the bogon will be chosen
1777     # first if we set CC to just the basename; use the full file name.
1778     shift
1779     set dummy "$ac_dir/$ac_word" "$@"
1780     shift
1781     ac_cv_prog_CC="$@"
1782   fi
1783 fi
1784 fi
1785 CC="$ac_cv_prog_CC"
1786 if test -n "$CC"; then
1787   echo "$ac_t""$CC" 1>&6
1788 else
1789   echo "$ac_t""no" 1>&6
1790 fi
1791
1792   if test -z "$CC"; then
1793     case "`uname -s`" in
1794     *win32* | *WIN32*)
1795       # Extract the first word of "cl", so it can be a program name with args.
1796 set dummy cl; ac_word=$2
1797 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1798 echo "configure:1799: checking for $ac_word" >&5
1799
1800 if test -n "$CC"; then
1801   ac_cv_prog_CC="$CC" # Let the user override the test.
1802 else
1803   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1804   ac_dummy="$PATH"
1805   for ac_dir in $ac_dummy; do
1806     test -z "$ac_dir" && ac_dir=.
1807     if test -f $ac_dir/$ac_word; then
1808       ac_cv_prog_CC="cl"
1809       break
1810     fi
1811   done
1812   IFS="$ac_save_ifs"
1813 fi
1814 CC="$ac_cv_prog_CC"
1815 if test -n "$CC"; then
1816   echo "$ac_t""$CC" 1>&6
1817 else
1818   echo "$ac_t""no" 1>&6
1819 fi
1820  ;;
1821     esac
1822   fi
1823   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1824 fi
1825
1826 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1827 echo "configure:1828: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1828
1829 ac_ext=c
1830 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1831 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1832 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1833 ac_cpp='$CPP '"$xe_cppflags"
1834 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1835 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1836 cross_compiling=no
1837
1838 cat > conftest.$ac_ext << EOF
1839
1840 #line 1841 "configure"
1841 #include "confdefs.h"
1842
1843 main(){return(0);}
1844 EOF
1845 if { (eval echo configure:1846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1846   ac_cv_prog_cc_works=yes
1847   # If we can't run a trivial program, we are probably using a cross compiler.
1848   if (./conftest; exit) 2>/dev/null; then
1849     ac_cv_prog_cc_cross=no
1850   else
1851     ac_cv_prog_cc_cross=yes
1852   fi
1853 else
1854   echo "configure: failed program was:" >&5
1855   cat conftest.$ac_ext >&5
1856   ac_cv_prog_cc_works=no
1857 fi
1858 rm -fr conftest*
1859 ac_ext=c
1860 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1861 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1862 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1863 ac_cpp='$CPP '"$xe_cppflags"
1864 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1865 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1866 cross_compiling=no
1867
1868 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1869 if test $ac_cv_prog_cc_works = no; then
1870   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1871 fi
1872 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1873 echo "configure:1874: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1874 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1875 cross_compiling=$ac_cv_prog_cc_cross
1876
1877 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1878 echo "configure:1879: checking whether we are using GNU C" >&5
1879
1880 cat > conftest.c <<EOF
1881 #ifdef __GNUC__
1882   yes;
1883 #endif
1884 EOF
1885 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1886   ac_cv_prog_gcc=yes
1887 else
1888   ac_cv_prog_gcc=no
1889 fi
1890
1891 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1892
1893 if test $ac_cv_prog_gcc = yes; then
1894   GCC=yes
1895 else
1896   GCC=
1897 fi
1898
1899 ac_test_CFLAGS="${CFLAGS+set}"
1900 ac_save_CFLAGS="$CFLAGS"
1901 CFLAGS=
1902 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1903 echo "configure:1904: checking whether ${CC-cc} accepts -g" >&5
1904
1905 echo 'void f(){}' > conftest.c
1906 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1907   ac_cv_prog_cc_g=yes
1908 else
1909   ac_cv_prog_cc_g=no
1910 fi
1911 rm -f conftest*
1912
1913
1914 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1915 if test "$ac_test_CFLAGS" = set; then
1916   CFLAGS="$ac_save_CFLAGS"
1917 elif test $ac_cv_prog_cc_g = yes; then
1918   if test "$GCC" = yes; then
1919     CFLAGS="-g -O2"
1920   else
1921     CFLAGS="-g"
1922   fi
1923 else
1924   if test "$GCC" = yes; then
1925     CFLAGS="-O2"
1926   else
1927     CFLAGS=
1928   fi
1929 fi
1930
1931 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1932   CC=gcc
1933   # Extract the first word of "gcc", so it can be a program name with args.
1934 set dummy gcc; ac_word=$2
1935 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1936 echo "configure:1937: checking for $ac_word" >&5
1937
1938 if test -n "$CC"; then
1939   ac_cv_prog_CC="$CC" # Let the user override the test.
1940 else
1941   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1942   ac_dummy="$PATH"
1943   for ac_dir in $ac_dummy; do
1944     test -z "$ac_dir" && ac_dir=.
1945     if test -f $ac_dir/$ac_word; then
1946       ac_cv_prog_CC="gcc"
1947       break
1948     fi
1949   done
1950   IFS="$ac_save_ifs"
1951 fi
1952 CC="$ac_cv_prog_CC"
1953 if test -n "$CC"; then
1954   echo "$ac_t""$CC" 1>&6
1955 else
1956   echo "$ac_t""no" 1>&6
1957 fi
1958
1959 if test -z "$CC"; then
1960   # Extract the first word of "cc", so it can be a program name with args.
1961 set dummy cc; ac_word=$2
1962 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1963 echo "configure:1964: checking for $ac_word" >&5
1964
1965 if test -n "$CC"; then
1966   ac_cv_prog_CC="$CC" # Let the user override the test.
1967 else
1968   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1969   ac_prog_rejected=no
1970   ac_dummy="$PATH"
1971   for ac_dir in $ac_dummy; do
1972     test -z "$ac_dir" && ac_dir=.
1973     if test -f $ac_dir/$ac_word; then
1974       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1975         ac_prog_rejected=yes
1976         continue
1977       fi
1978       ac_cv_prog_CC="cc"
1979       break
1980     fi
1981   done
1982   IFS="$ac_save_ifs"
1983 if test $ac_prog_rejected = yes; then
1984   # We found a bogon in the path, so make sure we never use it.
1985   set dummy $ac_cv_prog_CC
1986   shift
1987   if test $# -gt 0; then
1988     # We chose a different compiler from the bogus one.
1989     # However, it has the same basename, so the bogon will be chosen
1990     # first if we set CC to just the basename; use the full file name.
1991     shift
1992     set dummy "$ac_dir/$ac_word" "$@"
1993     shift
1994     ac_cv_prog_CC="$@"
1995   fi
1996 fi
1997 fi
1998 CC="$ac_cv_prog_CC"
1999 if test -n "$CC"; then
2000   echo "$ac_t""$CC" 1>&6
2001 else
2002   echo "$ac_t""no" 1>&6
2003 fi
2004
2005   if test -z "$CC"; then
2006     case "`uname -s`" in
2007     *win32* | *WIN32*)
2008       # Extract the first word of "cl", so it can be a program name with args.
2009 set dummy cl; ac_word=$2
2010 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2011 echo "configure:2012: checking for $ac_word" >&5
2012
2013 if test -n "$CC"; then
2014   ac_cv_prog_CC="$CC" # Let the user override the test.
2015 else
2016   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2017   ac_dummy="$PATH"
2018   for ac_dir in $ac_dummy; do
2019     test -z "$ac_dir" && ac_dir=.
2020     if test -f $ac_dir/$ac_word; then
2021       ac_cv_prog_CC="cl"
2022       break
2023     fi
2024   done
2025   IFS="$ac_save_ifs"
2026 fi
2027 CC="$ac_cv_prog_CC"
2028 if test -n "$CC"; then
2029   echo "$ac_t""$CC" 1>&6
2030 else
2031   echo "$ac_t""no" 1>&6
2032 fi
2033  ;;
2034     esac
2035   fi
2036   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2037 fi
2038
2039 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2040 echo "configure:2041: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2041
2042 ac_ext=c
2043 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2044 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2045 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2046 ac_cpp='$CPP '"$xe_cppflags"
2047 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2048 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2049 cross_compiling=no
2050
2051 cat > conftest.$ac_ext << EOF
2052
2053 #line 2054 "configure"
2054 #include "confdefs.h"
2055
2056 main(){return(0);}
2057 EOF
2058 if { (eval echo configure:2059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2059   ac_cv_prog_cc_works=yes
2060   # If we can't run a trivial program, we are probably using a cross compiler.
2061   if (./conftest; exit) 2>/dev/null; then
2062     ac_cv_prog_cc_cross=no
2063   else
2064     ac_cv_prog_cc_cross=yes
2065   fi
2066 else
2067   echo "configure: failed program was:" >&5
2068   cat conftest.$ac_ext >&5
2069   ac_cv_prog_cc_works=no
2070 fi
2071 rm -fr conftest*
2072 ac_ext=c
2073 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2074 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2075 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2076 ac_cpp='$CPP '"$xe_cppflags"
2077 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2078 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2079 cross_compiling=no
2080
2081 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2082 if test $ac_cv_prog_cc_works = no; then
2083   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2084 fi
2085 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2086 echo "configure:2087: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2087 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2088 cross_compiling=$ac_cv_prog_cc_cross
2089
2090 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2091 echo "configure:2092: checking whether we are using GNU C" >&5
2092
2093 cat > conftest.c <<EOF
2094 #ifdef __GNUC__
2095   yes;
2096 #endif
2097 EOF
2098 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2099   ac_cv_prog_gcc=yes
2100 else
2101   ac_cv_prog_gcc=no
2102 fi
2103
2104 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2105
2106 if test $ac_cv_prog_gcc = yes; then
2107   GCC=yes
2108 else
2109   GCC=
2110 fi
2111
2112 ac_test_CFLAGS="${CFLAGS+set}"
2113 ac_save_CFLAGS="$CFLAGS"
2114 CFLAGS=
2115 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2116 echo "configure:2117: checking whether ${CC-cc} accepts -g" >&5
2117
2118 echo 'void f(){}' > conftest.c
2119 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2120   ac_cv_prog_cc_g=yes
2121 else
2122   ac_cv_prog_cc_g=no
2123 fi
2124 rm -f conftest*
2125
2126
2127 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2128 if test "$ac_test_CFLAGS" = set; then
2129   CFLAGS="$ac_save_CFLAGS"
2130 elif test $ac_cv_prog_cc_g = yes; then
2131   if test "$GCC" = yes; then
2132     CFLAGS="-g -O2"
2133   else
2134     CFLAGS="-g"
2135   fi
2136 else
2137   if test "$GCC" = yes; then
2138     CFLAGS="-O2"
2139   else
2140     CFLAGS=
2141   fi
2142 fi
2143
2144 fi
2145 CFLAGS="$xe_save_CFLAGS"
2146
2147
2148 test -n "$CPP" -a -d "$CPP" && CPP=
2149
2150 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2151
2152 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2153 echo "configure:2154: checking how to run the C preprocessor" >&5
2154 # On Suns, sometimes $CPP names a directory.
2155 if test -n "$CPP" && test -d "$CPP"; then
2156   CPP=
2157 fi
2158 if test -z "$CPP"; then
2159
2160   # This must be in double quotes, not single quotes, because CPP may get
2161   # substituted into the Makefile and "${CC-cc}" will confuse make.
2162   CPP="${CC-cc} -E"
2163   # On the NeXT, cc -E runs the code through the compiler's parser,
2164   # not just through cpp.
2165   cat > conftest.$ac_ext <<EOF
2166 #line 2167 "configure"
2167 #include "confdefs.h"
2168 #include <assert.h>
2169 Syntax Error
2170 EOF
2171 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2172 { (eval echo configure:2173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2173 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2174 if test -z "$ac_err"; then
2175   :
2176 else
2177   echo "$ac_err" >&5
2178   echo "configure: failed program was:" >&5
2179   cat conftest.$ac_ext >&5
2180   rm -rf conftest*
2181   CPP="${CC-cc} -E -traditional-cpp"
2182   cat > conftest.$ac_ext <<EOF
2183 #line 2184 "configure"
2184 #include "confdefs.h"
2185 #include <assert.h>
2186 Syntax Error
2187 EOF
2188 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2189 { (eval echo configure:2190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2190 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2191 if test -z "$ac_err"; then
2192   :
2193 else
2194   echo "$ac_err" >&5
2195   echo "configure: failed program was:" >&5
2196   cat conftest.$ac_ext >&5
2197   rm -rf conftest*
2198   CPP="${CC-cc} -nologo -E"
2199   cat > conftest.$ac_ext <<EOF
2200 #line 2201 "configure"
2201 #include "confdefs.h"
2202 #include <assert.h>
2203 Syntax Error
2204 EOF
2205 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2206 { (eval echo configure:2207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2207 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2208 if test -z "$ac_err"; then
2209   :
2210 else
2211   echo "$ac_err" >&5
2212   echo "configure: failed program was:" >&5
2213   cat conftest.$ac_ext >&5
2214   rm -rf conftest*
2215   CPP=/lib/cpp
2216 fi
2217 rm -f conftest*
2218 fi
2219 rm -f conftest*
2220 fi
2221 rm -f conftest*
2222   ac_cv_prog_CPP="$CPP"
2223   CPP="$ac_cv_prog_CPP"
2224 else
2225   ac_cv_prog_CPP="$CPP"
2226 fi
2227 echo "$ac_t""$CPP" 1>&6
2228
2229
2230 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2231 echo "configure:2232: checking for AIX" >&5
2232 cat > conftest.$ac_ext <<EOF
2233 #line 2234 "configure"
2234 #include "confdefs.h"
2235 #ifdef _AIX
2236   yes
2237 #endif
2238
2239 EOF
2240 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2241   egrep "yes" >/dev/null 2>&1; then
2242   rm -rf conftest*
2243   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2244     Defining _ALL_SOURCE
2245 EOF
2246 cat >> confdefs.h <<\EOF
2247 #define _ALL_SOURCE 1
2248 EOF
2249 }
2250
2251 else
2252   rm -rf conftest*
2253   echo "$ac_t""no" 1>&6
2254 fi
2255 rm -f conftest*
2256
2257
2258
2259 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2260 echo "configure:2261: checking for GNU libc" >&5
2261 cat > conftest.$ac_ext <<EOF
2262 #line 2263 "configure"
2263 #include "confdefs.h"
2264 #include <features.h>
2265 int main() {
2266
2267 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2268 #error Not a GNU libc system :-(
2269 ******* ======= ******** &&&&&&&&
2270 #endif
2271
2272 ; return 0; }
2273 EOF
2274 if { (eval echo configure:2275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2275   rm -rf conftest*
2276   have_glibc=yes
2277 else
2278   echo "configure: failed program was:" >&5
2279   cat conftest.$ac_ext >&5
2280   rm -rf conftest*
2281   have_glibc=no
2282 fi
2283 rm -f conftest*
2284 echo "$ac_t""$have_glibc" 1>&6
2285 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2286     Defining _GNU_SOURCE
2287 EOF
2288 cat >> confdefs.h <<\EOF
2289 #define _GNU_SOURCE 1
2290 EOF
2291 }
2292
2293
2294
2295 cat > conftest.$ac_ext <<EOF
2296 #line 2297 "configure"
2297 #include "confdefs.h"
2298 int main () {
2299 #if defined __SUNPRO_C
2300 return 11;
2301 #elif defined __DECC
2302 return 12;
2303 #else
2304 return 0;
2305 #endif
2306 }
2307 EOF
2308 if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2309 then
2310   :
2311 else
2312   conftest_rc="$?"
2313   echo "configure: failed program was:" >&5
2314   cat conftest.$ac_ext >&5
2315   rm -fr conftest*
2316   case "$conftest_rc" in
2317   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2318   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2319 esac
2320 fi
2321 rm -fr conftest*
2322
2323
2324
2325
2326 echo "Extracting information from the machine- and system-dependent headers..."
2327
2328 tempcname="conftest.c"
2329
2330
2331
2332 cat > $tempcname <<EOF
2333 #define NOT_C_CODE
2334 #define C_SWITCH_SITE
2335 #define C_SWITCH_X_SITE
2336 #define LD_SWITCH_SITE
2337 #define LD_SWITCH_X_SITE
2338 #define LD_SWITCH_X_SITE_AUX
2339 #define OS_RELEASE $os_release
2340 #include "$srcdir/src/$opsysfile"
2341 #include "$srcdir/src/$machfile"
2342
2343 #ifndef LIBS_MACHINE
2344 #define LIBS_MACHINE
2345 #endif
2346 configure___ libs_machine=LIBS_MACHINE
2347
2348 #ifndef LIBS_SYSTEM
2349 #define LIBS_SYSTEM
2350 #endif
2351 configure___ libs_system=LIBS_SYSTEM
2352
2353 #ifndef LIBS_TERMCAP
2354 #define LIBS_TERMCAP
2355 #endif
2356 configure___ libs_termcap=LIBS_TERMCAP
2357
2358 #ifndef LIB_STANDARD
2359 #define LIB_STANDARD
2360 #endif
2361 configure___ libs_standard=LIB_STANDARD
2362
2363
2364 #ifndef OBJECTS_MACHINE
2365 #define OBJECTS_MACHINE
2366 #endif
2367 configure___ objects_machine=OBJECTS_MACHINE
2368
2369 #ifndef OBJECTS_SYSTEM
2370 #define OBJECTS_SYSTEM
2371 #endif
2372 configure___ objects_system=OBJECTS_SYSTEM
2373
2374
2375 #ifndef C_SWITCH_MACHINE
2376 #define C_SWITCH_MACHINE
2377 #endif
2378 configure___ c_switch_machine=C_SWITCH_MACHINE
2379
2380 #ifndef C_SWITCH_SYSTEM
2381 #define C_SWITCH_SYSTEM
2382 #endif
2383 configure___ c_switch_system=C_SWITCH_SYSTEM
2384
2385
2386 #ifndef LD_SWITCH_MACHINE
2387 #define LD_SWITCH_MACHINE
2388 #endif
2389 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2390
2391 #ifndef LD_SWITCH_SYSTEM
2392 #define LD_SWITCH_SYSTEM
2393 #endif
2394 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2395
2396
2397 #ifndef UNEXEC
2398 #define UNEXEC "unexec.o"
2399 #endif
2400 configure___ unexec=UNEXEC
2401
2402
2403 #ifndef LD_SWITCH_SHARED
2404 #define LD_SWITCH_SHARED "-c"
2405 #endif
2406 configure___ ld_switch_shared=LD_SWITCH_SHARED
2407
2408
2409 #ifdef ORDINARY_LINK
2410 #define LD "\$(CC) \$(CFLAGS)"
2411 #else /* no ORDINARY LINK */
2412 #ifdef COFF_ENCAPSULATE
2413 #define LD "\$(CC) -nostdlib"
2414 #else /* not COFF_ENCAPSULATE */
2415 #ifdef LINKER
2416 #define LD LINKER
2417 #else /* ! defined (LINKER) */
2418 #define LD "ld"
2419 #endif /* ! defined (LINKER) */
2420 #endif /* ! defined (COFF_ENCAPSULATE) */
2421 #endif /* not ORDINARY_LINK */
2422 configure___ ld=LD
2423
2424 #ifndef LIB_GCC
2425 #define LIB_GCC
2426 #endif
2427 configure___ lib_gcc=LIB_GCC
2428
2429 #ifndef LD_TEXT_START_ADDR
2430 #define LD_TEXT_START_ADDR
2431 #endif
2432 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2433
2434
2435 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2436 #ifdef NO_REMAP
2437 #ifdef COFF_ENCAPSULATE
2438 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2439 #else /* ! defined (COFF_ENCAPSULATE) */
2440 #define START_FILES "pre-crt0.o /lib/crt0.o"
2441 #endif /* ! defined (COFF_ENCAPSULATE) */
2442 #else /* ! defined (NO_REMAP) */
2443 #define START_FILES "ecrt0.o"
2444 #endif /* ! defined (NO_REMAP) */
2445 #endif /* no ORDINARY_LINK */
2446 #ifndef START_FILES
2447 #define START_FILES
2448 #endif
2449 configure___ start_files=START_FILES
2450
2451 #ifdef ORDINARY_LINK
2452 configure___ ordinary_link=yes
2453 #else
2454 configure___ ordinary_link=no
2455 #endif
2456
2457 #ifdef SYSTEM_MALLOC
2458 configure___ system_malloc=yes
2459 #else
2460 configure___ system_malloc=no
2461 #endif
2462
2463 #ifdef TERMINFO
2464 configure___ have_terminfo=yes
2465 #else
2466 configure___ have_terminfo=no
2467 #endif
2468
2469 #ifdef MAIL_USE_FLOCK
2470 configure___ mail_use_flock=yes
2471 #else
2472 configure___ mail_use_flock=no
2473 #endif
2474
2475 #ifdef MAIL_USE_LOCKF
2476 configure___ mail_use_lockf=yes
2477 #else
2478 configure___ mail_use_lockf=no
2479 #endif
2480
2481 #ifdef HAVE_WIN32_PROCESSES
2482 configure___ win32_processes=yes
2483 #else
2484 configure___ win32_processes=no
2485 #endif
2486
2487 EOF
2488
2489 CPP=`eval "echo $CPP $CPPFLAGS"`
2490 eval `$CPP -Isrc $tempcname \
2491         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2492
2493 rm $tempcname
2494
2495 test "$extra_verbose" = "yes" && \
2496   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 ""
2497
2498 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2499
2500 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2501
2502 if test "$cflags_specified" = "no"; then
2503       if   test "$GCC" = "yes"; then
2504     CFLAGS="-g -O3 -Wall -Wno-switch"
2505               elif test "$__SUNPRO_C" = "yes"; then
2506     case "$opsys" in
2507       sol2    ) CFLAGS="-v -xO4" ;;
2508       sunos4* ) CFLAGS="-xO2";;
2509     esac
2510   elif test "$__DECC" = "yes"; then
2511     CFLAGS="-O3"
2512   elif test "$CC" = "xlc"; then
2513     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2514     else
2515     CFLAGS="-O" ;  fi
2516 fi
2517
2518
2519 if test "$GCC" = "yes"; then
2520   set x $ld_switch_system; shift; ld_switch_system=""
2521   while test -n "$1"; do
2522     case $1 in
2523       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2524       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2525       -Xlinker* ) ;;
2526       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2527     esac
2528     shift
2529   done
2530 fi
2531
2532 if test "$GCC" = "yes"; then
2533   set x $ld_switch_machine; shift; ld_switch_machine=""
2534   while test -n "$1"; do
2535     case $1 in
2536       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2537       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2538       -Xlinker* ) ;;
2539       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2540     esac
2541     shift
2542   done
2543 fi
2544
2545 if test "$GCC" = "yes"; then
2546   set x $LDFLAGS; shift; LDFLAGS=""
2547   while test -n "$1"; do
2548     case $1 in
2549       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2550       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2551       -Xlinker* ) ;;
2552       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2553     esac
2554     shift
2555   done
2556 fi
2557
2558 if test "$GCC" = "yes"; then
2559   set x $ld_call_shared; shift; ld_call_shared=""
2560   while test -n "$1"; do
2561     case $1 in
2562       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2563       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2564       -Xlinker* ) ;;
2565       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2566     esac
2567     shift
2568   done
2569 fi
2570
2571 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2572    echo "    xemacs will be linked with \"$objects_machine\""
2573  fi
2574 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2575    echo "    xemacs will be linked with \"$objects_system\""
2576  fi
2577 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2578    echo "    xemacs will be linked with \"$unexec\""
2579  fi
2580
2581 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2582 echo "configure:2583: checking for dynodump" >&5
2583 if test "$unexec" != "unexsol2.o"; then
2584   echo "$ac_t""no" 1>&6
2585 else
2586   echo "$ac_t""yes" 1>&6
2587   { test "$extra_verbose" = "yes" && cat << \EOF
2588     Defining DYNODUMP
2589 EOF
2590 cat >> confdefs.h <<\EOF
2591 #define DYNODUMP 1
2592 EOF
2593 }
2594
2595   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2596   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2597   case "$machine" in
2598     sparc   ) dynodump_arch=sparc ;;
2599     *86*    ) dynodump_arch=i386  ;;
2600     powerpc ) dynodump_arch=ppc   ;;
2601   esac
2602     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
2603 fi
2604
2605
2606 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2607
2608 if test "$unexec" = "unexaix.o"; then
2609   if   test "$dynamic" = "no"; then
2610   start_flags="-Wl,-bnso,-bnodelcsect"
2611   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2612   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2613     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2614   done
2615   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2616     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2617   done
2618   
2619 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2620 echo "configure:2621: checking for terminateAndUnload in -lC" >&5
2621 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2622
2623 xe_check_libs=" -lC "
2624 cat > conftest.$ac_ext <<EOF
2625 #line 2626 "configure"
2626 #include "confdefs.h"
2627 /* Override any gcc2 internal prototype to avoid an error.  */
2628 /* We use char because int might match the return type of a gcc2
2629     builtin and then its argument prototype would still apply.  */
2630 char terminateAndUnload();
2631
2632 int main() {
2633 terminateAndUnload()
2634 ; return 0; }
2635 EOF
2636 if { (eval echo configure:2637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2637   rm -rf conftest*
2638   eval "ac_cv_lib_$ac_lib_var=yes"
2639 else
2640   echo "configure: failed program was:" >&5
2641   cat conftest.$ac_ext >&5
2642   rm -rf conftest*
2643   eval "ac_cv_lib_$ac_lib_var=no"
2644 fi
2645 rm -f conftest*
2646 xe_check_libs=""
2647
2648 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2649   echo "$ac_t""yes" 1>&6
2650   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2651 else
2652   echo "$ac_t""no" 1>&6
2653 fi
2654
2655
2656   fi
2657 elif test -n "$ld_text_start_addr"; then
2658   start_flags="-T $ld_text_start_addr -e __start"
2659 fi
2660
2661
2662
2663
2664 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2665  test -z "$linker" &&  linker='$(CC) -nostdlib'
2666  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2667 fi
2668 test "$GCC" != "yes" && lib_gcc=
2669
2670
2671
2672
2673
2674 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2675 if test -n "$site_libraries"; then
2676   for arg in $site_libraries; do
2677     case "$arg" in
2678      -* ) ;;
2679      * ) test -d "$arg" || \
2680            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2681        arg="-L${arg}" ;;
2682     esac
2683     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2684   done
2685 fi
2686
2687 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2688 if test -n "$site_includes"; then
2689   for arg in $site_includes; do
2690     case "$arg" in
2691       -* ) ;;
2692       * ) test -d "$arg" || \
2693            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2694       arg="-I${arg}" ;;
2695     esac
2696     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2697   done
2698 fi
2699
2700 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2701 if test -n "$site_prefixes"; then
2702   for dir in $site_prefixes; do
2703     lib_dir="${dir}/lib"
2704     inc_dir="${dir}/include"
2705     if test ! -d "$dir"; then
2706       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2707     elif test ! -d "$lib_dir"; then
2708       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2709     else
2710       if test -d "$inc_dir"; then
2711         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
2712       fi
2713       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
2714     fi
2715   done
2716 fi
2717
2718
2719 for dir in "/usr/ccs/lib"; do
2720   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
2721 done
2722
2723 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2724 if test -n "$site_runtime_libraries"; then
2725   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2726   export LD_RUN_PATH
2727 fi
2728
2729
2730 if   test "$dynamic" = "no"; then add_runtime_path=no
2731 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2732 else case "$opsys" in
2733        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2734        * ) add_runtime_path=no ;;
2735      esac
2736 fi
2737
2738 if test "$add_runtime_path" = "yes"; then
2739       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2740 echo "configure:2741: checking "for runtime libraries flag"" >&5
2741   case "$opsys" in
2742     sol2 ) dash_r="-R" ;;
2743     decosf* | linux* | irix*) dash_r="-rpath " ;;
2744     *)
2745       dash_r=""
2746       for try_dash_r in "-R" "-R " "-rpath "; do
2747         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2748         
2749 if test "$GCC" = "yes"; then
2750   set x $xe_check_libs; shift; xe_check_libs=""
2751   while test -n "$1"; do
2752     case $1 in
2753       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2754       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2755       -Xlinker* ) ;;
2756       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2757     esac
2758     shift
2759   done
2760 fi
2761         cat > conftest.$ac_ext <<EOF
2762 #line 2763 "configure"
2763 #include "confdefs.h"
2764
2765 int main() {
2766
2767 ; return 0; }
2768 EOF
2769 if { (eval echo configure:2770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2770   rm -rf conftest*
2771   dash_r="$try_dash_r"
2772 else
2773   echo "configure: failed program was:" >&5
2774   cat conftest.$ac_ext >&5
2775 fi
2776 rm -f conftest*
2777         xe_check_libs=""
2778         test -n "$dash_r" && break
2779       done ;;
2780   esac
2781   if test -n "$dash_r";
2782     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2783     else echo "$ac_t""NONE" 1>&6
2784   fi
2785 fi
2786
2787 xe_add_unique_runpath_dir='
2788   xe_add_p=yes
2789   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2790   done
2791   if test "$xe_add_p" = "yes"; then
2792     test -n "$runpath" && runpath="${runpath}:"
2793     runpath="${runpath}${xe_runpath_dir}"
2794     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2795   fi'
2796
2797
2798
2799
2800 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2801     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2802   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2803   
2804         runpath="" runpath_dirs=""
2805   if test -n "$LD_RUN_PATH"; then
2806     runpath="$LD_RUN_PATH"
2807   elif test "$GCC" = "yes"; then
2808         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2809     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2810     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2811     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2812       case "$arg" in P,* | -L* | -R* )
2813         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2814           {
2815 xe_runpath_dir="$dir"
2816   test "$xe_runpath_dir" != "/lib"     -a \
2817         "$xe_runpath_dir" != "/usr/lib" -a \
2818         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2819   eval "$xe_add_unique_runpath_dir"
2820 }
2821         done ;;
2822       esac
2823     done
2824     ld_switch_run="$ld_switch_run_save"
2825     rm -f conftest*
2826   else
2827         for arg in $ld_switch_site $ld_switch_x_site; do
2828       case "$arg" in -L*) {
2829 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2830   test "$xe_runpath_dir" != "/lib"     -a \
2831         "$xe_runpath_dir" != "/usr/lib" -a \
2832         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2833   eval "$xe_add_unique_runpath_dir"
2834 };; esac
2835     done
2836         if test "$opsys $need_motif" = "sol2 yes"; then
2837       xe_runpath_dir="/opt/SUNWdt/lib";
2838       eval "$xe_add_unique_runpath_dir";
2839     fi
2840   fi 
2841   if test -n "$runpath"; then
2842     ld_switch_run="${dash_r}${runpath}"
2843     
2844 if test "$GCC" = "yes"; then
2845   set x $ld_switch_run; shift; ld_switch_run=""
2846   while test -n "$1"; do
2847     case $1 in
2848       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2849       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2850       -Xlinker* ) ;;
2851       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2852     esac
2853     shift
2854   done
2855 fi
2856     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2857   fi
2858 fi
2859
2860
2861
2862
2863 GNU_MALLOC=yes
2864 if test "$with_dlmalloc" != "no"; then
2865         doug_lea_malloc=yes
2866 else
2867         doug_lea_malloc=no
2868 fi
2869 after_morecore_hook_exists=yes
2870 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2871 echo "configure:2872: checking for malloc_get_state" >&5
2872
2873 cat > conftest.$ac_ext <<EOF
2874 #line 2875 "configure"
2875 #include "confdefs.h"
2876 /* System header to define __stub macros and hopefully few prototypes,
2877     which can conflict with char malloc_get_state(); below.  */
2878 #include <assert.h>
2879 /* Override any gcc2 internal prototype to avoid an error.  */
2880 /* We use char because int might match the return type of a gcc2
2881     builtin and then its argument prototype would still apply.  */
2882 char malloc_get_state();
2883
2884 int main() {
2885
2886 /* The GNU C library defines this for functions which it implements
2887     to always fail with ENOSYS.  Some functions are actually named
2888     something starting with __ and the normal name is an alias.  */
2889 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2890 choke me
2891 #else
2892 malloc_get_state();
2893 #endif
2894
2895 ; return 0; }
2896 EOF
2897 if { (eval echo configure:2898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2898   rm -rf conftest*
2899   eval "ac_cv_func_malloc_get_state=yes"
2900 else
2901   echo "configure: failed program was:" >&5
2902   cat conftest.$ac_ext >&5
2903   rm -rf conftest*
2904   eval "ac_cv_func_malloc_get_state=no"
2905 fi
2906 rm -f conftest*
2907
2908 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2909   echo "$ac_t""yes" 1>&6
2910   :
2911 else
2912   echo "$ac_t""no" 1>&6
2913 doug_lea_malloc=no
2914 fi
2915
2916 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2917 echo "configure:2918: checking for malloc_set_state" >&5
2918
2919 cat > conftest.$ac_ext <<EOF
2920 #line 2921 "configure"
2921 #include "confdefs.h"
2922 /* System header to define __stub macros and hopefully few prototypes,
2923     which can conflict with char malloc_set_state(); below.  */
2924 #include <assert.h>
2925 /* Override any gcc2 internal prototype to avoid an error.  */
2926 /* We use char because int might match the return type of a gcc2
2927     builtin and then its argument prototype would still apply.  */
2928 char malloc_set_state();
2929
2930 int main() {
2931
2932 /* The GNU C library defines this for functions which it implements
2933     to always fail with ENOSYS.  Some functions are actually named
2934     something starting with __ and the normal name is an alias.  */
2935 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2936 choke me
2937 #else
2938 malloc_set_state();
2939 #endif
2940
2941 ; return 0; }
2942 EOF
2943 if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2944   rm -rf conftest*
2945   eval "ac_cv_func_malloc_set_state=yes"
2946 else
2947   echo "configure: failed program was:" >&5
2948   cat conftest.$ac_ext >&5
2949   rm -rf conftest*
2950   eval "ac_cv_func_malloc_set_state=no"
2951 fi
2952 rm -f conftest*
2953
2954 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2955   echo "$ac_t""yes" 1>&6
2956   :
2957 else
2958   echo "$ac_t""no" 1>&6
2959 doug_lea_malloc=no
2960 fi
2961
2962 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2963 echo "configure:2964: checking whether __after_morecore_hook exists" >&5
2964 cat > conftest.$ac_ext <<EOF
2965 #line 2966 "configure"
2966 #include "confdefs.h"
2967 extern void (* __after_morecore_hook)();
2968 int main() {
2969 __after_morecore_hook = 0
2970 ; return 0; }
2971 EOF
2972 if { (eval echo configure:2973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2973   rm -rf conftest*
2974   echo "$ac_t""yes" 1>&6
2975 else
2976   echo "configure: failed program was:" >&5
2977   cat conftest.$ac_ext >&5
2978   rm -rf conftest*
2979   echo "$ac_t""no" 1>&6
2980    after_morecore_hook_exists=no
2981 fi
2982 rm -f conftest*
2983 if test "$system_malloc" = "yes" ; then
2984   GNU_MALLOC=no
2985   GNU_MALLOC_reason="
2986   (The GNU allocators don't work with this system configuration)."
2987 elif test "$with_system_malloc" = "yes" ; then
2988   GNU_MALLOC=no
2989   GNU_MALLOC_reason="
2990   (User chose not to use GNU allocators)."
2991 elif test "$with_debug_malloc" = "yes" ; then
2992   GNU_MALLOC=no
2993   GNU_MALLOC_reason="
2994   (User chose to use Debugging Malloc)."
2995 fi
2996
2997 if test "$doug_lea_malloc" = "yes" ; then
2998   if test "$GNU_MALLOC" = yes ; then
2999     GNU_MALLOC_reason="
3000   (Using Doug Lea's new malloc from the GNU C Library.)"
3001   fi
3002   { test "$extra_verbose" = "yes" && cat << \EOF
3003     Defining DOUG_LEA_MALLOC
3004 EOF
3005 cat >> confdefs.h <<\EOF
3006 #define DOUG_LEA_MALLOC 1
3007 EOF
3008 }
3009
3010   if test "$after_morecore_hook_exists" = "no" ; then
3011     GNU_MALLOC_reason="
3012   (Using Doug Lea's new malloc from the Linux C Library.)"
3013     { test "$extra_verbose" = "yes" && cat << \EOF
3014     Defining _NO_MALLOC_WARNING_
3015 EOF
3016 cat >> confdefs.h <<\EOF
3017 #define _NO_MALLOC_WARNING_ 1
3018 EOF
3019 }
3020
3021   fi
3022   use_minimal_tagbits=yes
3023 fi
3024
3025
3026
3027
3028 # Extract the first word of "ranlib", so it can be a program name with args.
3029 set dummy ranlib; ac_word=$2
3030 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3031 echo "configure:3032: checking for $ac_word" >&5
3032
3033 if test -n "$RANLIB"; then
3034   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3035 else
3036   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3037   ac_dummy="$PATH"
3038   for ac_dir in $ac_dummy; do
3039     test -z "$ac_dir" && ac_dir=.
3040     if test -f $ac_dir/$ac_word; then
3041       ac_cv_prog_RANLIB="ranlib"
3042       break
3043     fi
3044   done
3045   IFS="$ac_save_ifs"
3046   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3047 fi
3048 RANLIB="$ac_cv_prog_RANLIB"
3049 if test -n "$RANLIB"; then
3050   echo "$ac_t""$RANLIB" 1>&6
3051 else
3052   echo "$ac_t""no" 1>&6
3053 fi
3054
3055 ac_aux_dir=
3056 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3057   if test -f $ac_dir/install-sh; then
3058     ac_aux_dir=$ac_dir
3059     ac_install_sh="$ac_aux_dir/install-sh -c"
3060     break
3061   elif test -f $ac_dir/install.sh; then
3062     ac_aux_dir=$ac_dir
3063     ac_install_sh="$ac_aux_dir/install.sh -c"
3064     break
3065   fi
3066 done
3067 if test -z "$ac_aux_dir"; then
3068   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3069 fi
3070 ac_config_guess=$ac_aux_dir/config.guess
3071 ac_config_sub=$ac_aux_dir/config.sub
3072 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3073
3074 # Find a good install program.  We prefer a C program (faster),
3075 # so one script is as good as another.  But avoid the broken or
3076 # incompatible versions:
3077 # SysV /etc/install, /usr/sbin/install
3078 # SunOS /usr/etc/install
3079 # IRIX /sbin/install
3080 # AIX /bin/install
3081 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3082 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3083 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3084 # ./install, which can be erroneously created by make from ./install.sh.
3085 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3086 echo "configure:3087: checking for a BSD compatible install" >&5
3087 if test -z "$INSTALL"; then
3088
3089   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3090   for ac_dir in $PATH; do
3091     # Account for people who put trailing slashes in PATH elements.
3092     case "$ac_dir/" in
3093     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3094     *)
3095       # OSF1 and SCO ODT 3.0 have their own names for install.
3096       # Don't use installbsd from OSF since it installs stuff as root
3097       # by default.
3098       for ac_prog in ginstall scoinst install; do
3099         if test -f $ac_dir/$ac_prog; then
3100           if test $ac_prog = install &&
3101             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3102             # AIX install.  It has an incompatible calling convention.
3103             :
3104           else
3105             ac_cv_path_install="$ac_dir/$ac_prog -c"
3106             break 2
3107           fi
3108         fi
3109       done
3110       ;;
3111     esac
3112   done
3113   IFS="$ac_save_IFS"
3114
3115   if test "${ac_cv_path_install+set}" = set; then
3116     INSTALL="$ac_cv_path_install"
3117   else
3118     # As a last resort, use the slow shell script.  We don't cache a
3119     # path for INSTALL within a source directory, because that will
3120     # break other packages using the cache if that directory is
3121     # removed, or if the path is relative.
3122     INSTALL="$ac_install_sh"
3123   fi
3124 fi
3125 echo "$ac_t""$INSTALL" 1>&6
3126
3127 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3128 # It thinks the first close brace ends the variable substitution.
3129 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3130
3131 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3132
3133 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3134
3135 for ac_prog in 'bison -y' byacc
3136 do
3137 # Extract the first word of "$ac_prog", so it can be a program name with args.
3138 set dummy $ac_prog; ac_word=$2
3139 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3140 echo "configure:3141: checking for $ac_word" >&5
3141
3142 if test -n "$YACC"; then
3143   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3144 else
3145   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3146   ac_dummy="$PATH"
3147   for ac_dir in $ac_dummy; do
3148     test -z "$ac_dir" && ac_dir=.
3149     if test -f $ac_dir/$ac_word; then
3150       ac_cv_prog_YACC="$ac_prog"
3151       break
3152     fi
3153   done
3154   IFS="$ac_save_ifs"
3155 fi
3156 YACC="$ac_cv_prog_YACC"
3157 if test -n "$YACC"; then
3158   echo "$ac_t""$YACC" 1>&6
3159 else
3160   echo "$ac_t""no" 1>&6
3161 fi
3162
3163 test -n "$YACC" && break
3164 done
3165 test -n "$YACC" || YACC="yacc"
3166
3167
3168 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
3169 do
3170 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3171 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3172 echo "configure:3173: checking for $ac_hdr" >&5
3173
3174 cat > conftest.$ac_ext <<EOF
3175 #line 3176 "configure"
3176 #include "confdefs.h"
3177 #include <$ac_hdr>
3178 EOF
3179 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3180 { (eval echo configure:3181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3181 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3182 if test -z "$ac_err"; then
3183   rm -rf conftest*
3184   eval "ac_cv_header_$ac_safe=yes"
3185 else
3186   echo "$ac_err" >&5
3187   echo "configure: failed program was:" >&5
3188   cat conftest.$ac_ext >&5
3189   rm -rf conftest*
3190   eval "ac_cv_header_$ac_safe=no"
3191 fi
3192 rm -f conftest*
3193 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3194   echo "$ac_t""yes" 1>&6
3195     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3196   { test "$extra_verbose" = "yes" && cat << EOF
3197     Defining $ac_tr_hdr
3198 EOF
3199 cat >> confdefs.h <<EOF
3200 #define $ac_tr_hdr 1
3201 EOF
3202 }
3203  
3204 else
3205   echo "$ac_t""no" 1>&6
3206 fi
3207 done
3208
3209 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3210 do
3211 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3212 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3213 echo "configure:3214: checking for $ac_hdr" >&5
3214
3215 cat > conftest.$ac_ext <<EOF
3216 #line 3217 "configure"
3217 #include "confdefs.h"
3218 #include <$ac_hdr>
3219 EOF
3220 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3221 { (eval echo configure:3222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3222 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3223 if test -z "$ac_err"; then
3224   rm -rf conftest*
3225   eval "ac_cv_header_$ac_safe=yes"
3226 else
3227   echo "$ac_err" >&5
3228   echo "configure: failed program was:" >&5
3229   cat conftest.$ac_ext >&5
3230   rm -rf conftest*
3231   eval "ac_cv_header_$ac_safe=no"
3232 fi
3233 rm -f conftest*
3234 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3235   echo "$ac_t""yes" 1>&6
3236     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3237   { test "$extra_verbose" = "yes" && cat << EOF
3238     Defining $ac_tr_hdr
3239 EOF
3240 cat >> confdefs.h <<EOF
3241 #define $ac_tr_hdr 1
3242 EOF
3243 }
3244  
3245 else
3246   echo "$ac_t""no" 1>&6
3247 fi
3248 done
3249
3250 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3251 do
3252 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3253 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3254 echo "configure:3255: checking for $ac_hdr" >&5
3255
3256 cat > conftest.$ac_ext <<EOF
3257 #line 3258 "configure"
3258 #include "confdefs.h"
3259 #include <$ac_hdr>
3260 EOF
3261 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3262 { (eval echo configure:3263: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3263 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3264 if test -z "$ac_err"; then
3265   rm -rf conftest*
3266   eval "ac_cv_header_$ac_safe=yes"
3267 else
3268   echo "$ac_err" >&5
3269   echo "configure: failed program was:" >&5
3270   cat conftest.$ac_ext >&5
3271   rm -rf conftest*
3272   eval "ac_cv_header_$ac_safe=no"
3273 fi
3274 rm -f conftest*
3275 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3276   echo "$ac_t""yes" 1>&6
3277     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3278   { test "$extra_verbose" = "yes" && cat << EOF
3279     Defining $ac_tr_hdr
3280 EOF
3281 cat >> confdefs.h <<EOF
3282 #define $ac_tr_hdr 1
3283 EOF
3284 }
3285  
3286 else
3287   echo "$ac_t""no" 1>&6
3288 fi
3289 done
3290
3291 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3292 echo "configure:3293: checking for sys/wait.h that is POSIX.1 compatible" >&5
3293
3294 cat > conftest.$ac_ext <<EOF
3295 #line 3296 "configure"
3296 #include "confdefs.h"
3297 #include <sys/types.h>
3298 #include <sys/wait.h>
3299 #ifndef WEXITSTATUS
3300 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3301 #endif
3302 #ifndef WIFEXITED
3303 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3304 #endif
3305 int main() {
3306 int s;
3307 wait (&s);
3308 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3309 ; return 0; }
3310 EOF
3311 if { (eval echo configure:3312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3312   rm -rf conftest*
3313   ac_cv_header_sys_wait_h=yes
3314 else
3315   echo "configure: failed program was:" >&5
3316   cat conftest.$ac_ext >&5
3317   rm -rf conftest*
3318   ac_cv_header_sys_wait_h=no
3319 fi
3320 rm -f conftest*
3321
3322 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3323 if test $ac_cv_header_sys_wait_h = yes; then
3324   { test "$extra_verbose" = "yes" && cat << \EOF
3325     Defining HAVE_SYS_WAIT_H
3326 EOF
3327 cat >> confdefs.h <<\EOF
3328 #define HAVE_SYS_WAIT_H 1
3329 EOF
3330 }
3331
3332 fi
3333
3334 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3335 echo "configure:3336: checking for ANSI C header files" >&5
3336
3337 cat > conftest.$ac_ext <<EOF
3338 #line 3339 "configure"
3339 #include "confdefs.h"
3340 #include <stdlib.h>
3341 #include <stdarg.h>
3342 #include <string.h>
3343 #include <float.h>
3344 EOF
3345 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3346 { (eval echo configure:3347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3347 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3348 if test -z "$ac_err"; then
3349   rm -rf conftest*
3350   ac_cv_header_stdc=yes
3351 else
3352   echo "$ac_err" >&5
3353   echo "configure: failed program was:" >&5
3354   cat conftest.$ac_ext >&5
3355   rm -rf conftest*
3356   ac_cv_header_stdc=no
3357 fi
3358 rm -f conftest*
3359
3360 if test $ac_cv_header_stdc = yes; then
3361   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3362 cat > conftest.$ac_ext <<EOF
3363 #line 3364 "configure"
3364 #include "confdefs.h"
3365 #include <string.h>
3366 EOF
3367 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3368   egrep "memchr" >/dev/null 2>&1; then
3369   :
3370 else
3371   rm -rf conftest*
3372   ac_cv_header_stdc=no
3373 fi
3374 rm -f conftest*
3375
3376 fi
3377
3378 if test $ac_cv_header_stdc = yes; then
3379   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3380 cat > conftest.$ac_ext <<EOF
3381 #line 3382 "configure"
3382 #include "confdefs.h"
3383 #include <stdlib.h>
3384 EOF
3385 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3386   egrep "free" >/dev/null 2>&1; then
3387   :
3388 else
3389   rm -rf conftest*
3390   ac_cv_header_stdc=no
3391 fi
3392 rm -f conftest*
3393
3394 fi
3395
3396 if test $ac_cv_header_stdc = yes; then
3397   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3398 cat > conftest.$ac_ext <<EOF
3399 #line 3400 "configure"
3400 #include "confdefs.h"
3401 #include <ctype.h>
3402 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3403 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3404 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3405 int main () { int i; for (i = 0; i < 256; i++)
3406 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3407 exit (0); }
3408
3409 EOF
3410 if { (eval echo configure:3411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3411 then
3412   :
3413 else
3414   conftest_rc="$?"
3415   echo "configure: failed program was:" >&5
3416   cat conftest.$ac_ext >&5
3417   rm -fr conftest*
3418   ac_cv_header_stdc=no
3419 fi
3420 rm -fr conftest*
3421 fi
3422
3423 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3424 if test $ac_cv_header_stdc = yes; then
3425   { test "$extra_verbose" = "yes" && cat << \EOF
3426     Defining STDC_HEADERS
3427 EOF
3428 cat >> confdefs.h <<\EOF
3429 #define STDC_HEADERS 1
3430 EOF
3431 }
3432
3433 fi
3434
3435 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3436 echo "configure:3437: checking whether time.h and sys/time.h may both be included" >&5
3437
3438 cat > conftest.$ac_ext <<EOF
3439 #line 3440 "configure"
3440 #include "confdefs.h"
3441 #include <sys/types.h>
3442 #include <sys/time.h>
3443 #include <time.h>
3444 int main() {
3445 struct tm *tp;
3446 ; return 0; }
3447 EOF
3448 if { (eval echo configure:3449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3449   rm -rf conftest*
3450   ac_cv_header_time=yes
3451 else
3452   echo "configure: failed program was:" >&5
3453   cat conftest.$ac_ext >&5
3454   rm -rf conftest*
3455   ac_cv_header_time=no
3456 fi
3457 rm -f conftest*
3458
3459 echo "$ac_t""$ac_cv_header_time" 1>&6
3460 if test $ac_cv_header_time = yes; then
3461   { test "$extra_verbose" = "yes" && cat << \EOF
3462     Defining TIME_WITH_SYS_TIME
3463 EOF
3464 cat >> confdefs.h <<\EOF
3465 #define TIME_WITH_SYS_TIME 1
3466 EOF
3467 }
3468
3469 fi
3470
3471 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3472 echo "configure:3473: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3473
3474 cat > conftest.$ac_ext <<EOF
3475 #line 3476 "configure"
3476 #include "confdefs.h"
3477 #include <sys/types.h>
3478 #include <signal.h>
3479 /* NetBSD declares sys_siglist in unistd.h.  */
3480 #ifdef HAVE_UNISTD_H
3481 #include <unistd.h>
3482 #endif
3483 int main() {
3484 char *msg = *(sys_siglist + 1);
3485 ; return 0; }
3486 EOF
3487 if { (eval echo configure:3488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3488   rm -rf conftest*
3489   ac_cv_decl_sys_siglist=yes
3490 else
3491   echo "configure: failed program was:" >&5
3492   cat conftest.$ac_ext >&5
3493   rm -rf conftest*
3494   ac_cv_decl_sys_siglist=no
3495 fi
3496 rm -f conftest*
3497
3498 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3499 if test $ac_cv_decl_sys_siglist = yes; then
3500   { test "$extra_verbose" = "yes" && cat << \EOF
3501     Defining SYS_SIGLIST_DECLARED
3502 EOF
3503 cat >> confdefs.h <<\EOF
3504 #define SYS_SIGLIST_DECLARED 1
3505 EOF
3506 }
3507
3508 fi
3509
3510
3511 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3512 echo "configure:3513: checking for struct utimbuf" >&5
3513 cat > conftest.$ac_ext <<EOF
3514 #line 3515 "configure"
3515 #include "confdefs.h"
3516 #ifdef TIME_WITH_SYS_TIME
3517 #include <sys/time.h>
3518 #include <time.h>
3519 #else
3520 #ifdef HAVE_SYS_TIME_H
3521 #include <sys/time.h>
3522 #else
3523 #include <time.h>
3524 #endif
3525 #endif
3526 #ifdef HAVE_UTIME_H
3527 #include <utime.h>
3528 #endif
3529 int main() {
3530 static struct utimbuf x; x.actime = x.modtime;
3531 ; return 0; }
3532 EOF
3533 if { (eval echo configure:3534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3534   rm -rf conftest*
3535   echo "$ac_t""yes" 1>&6
3536    { test "$extra_verbose" = "yes" && cat << \EOF
3537     Defining HAVE_STRUCT_UTIMBUF
3538 EOF
3539 cat >> confdefs.h <<\EOF
3540 #define HAVE_STRUCT_UTIMBUF 1
3541 EOF
3542 }
3543
3544 else
3545   echo "configure: failed program was:" >&5
3546   cat conftest.$ac_ext >&5
3547   rm -rf conftest*
3548   echo "$ac_t""no" 1>&6
3549 fi
3550 rm -f conftest*
3551
3552 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3553 echo "configure:3554: checking return type of signal handlers" >&5
3554
3555 cat > conftest.$ac_ext <<EOF
3556 #line 3557 "configure"
3557 #include "confdefs.h"
3558 #include <sys/types.h>
3559 #include <signal.h>
3560 #ifdef signal
3561 #undef signal
3562 #endif
3563 #ifdef __cplusplus
3564 extern "C" void (*signal (int, void (*)(int)))(int);
3565 #else
3566 void (*signal ()) ();
3567 #endif
3568
3569 int main() {
3570 int i;
3571 ; return 0; }
3572 EOF
3573 if { (eval echo configure:3574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3574   rm -rf conftest*
3575   ac_cv_type_signal=void
3576 else
3577   echo "configure: failed program was:" >&5
3578   cat conftest.$ac_ext >&5
3579   rm -rf conftest*
3580   ac_cv_type_signal=int
3581 fi
3582 rm -f conftest*
3583
3584 echo "$ac_t""$ac_cv_type_signal" 1>&6
3585 { test "$extra_verbose" = "yes" && cat << EOF
3586     Defining RETSIGTYPE = $ac_cv_type_signal
3587 EOF
3588 cat >> confdefs.h <<EOF
3589 #define RETSIGTYPE $ac_cv_type_signal
3590 EOF
3591 }
3592
3593
3594 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3595 echo "configure:3596: checking for size_t" >&5
3596
3597 cat > conftest.$ac_ext <<EOF
3598 #line 3599 "configure"
3599 #include "confdefs.h"
3600 #include <sys/types.h>
3601 #if STDC_HEADERS
3602 #include <stdlib.h>
3603 #include <stddef.h>
3604 #endif
3605 EOF
3606 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3607   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3608   rm -rf conftest*
3609   ac_cv_type_size_t=yes
3610 else
3611   rm -rf conftest*
3612   ac_cv_type_size_t=no
3613 fi
3614 rm -f conftest*
3615
3616 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3617 if test $ac_cv_type_size_t = no; then
3618   { test "$extra_verbose" = "yes" && cat << \EOF
3619     Defining size_t = unsigned
3620 EOF
3621 cat >> confdefs.h <<\EOF
3622 #define size_t unsigned
3623 EOF
3624 }
3625
3626 fi
3627
3628 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3629 echo "configure:3630: checking for pid_t" >&5
3630
3631 cat > conftest.$ac_ext <<EOF
3632 #line 3633 "configure"
3633 #include "confdefs.h"
3634 #include <sys/types.h>
3635 #if STDC_HEADERS
3636 #include <stdlib.h>
3637 #include <stddef.h>
3638 #endif
3639 EOF
3640 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3641   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3642   rm -rf conftest*
3643   ac_cv_type_pid_t=yes
3644 else
3645   rm -rf conftest*
3646   ac_cv_type_pid_t=no
3647 fi
3648 rm -f conftest*
3649
3650 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3651 if test $ac_cv_type_pid_t = no; then
3652   { test "$extra_verbose" = "yes" && cat << \EOF
3653     Defining pid_t = int
3654 EOF
3655 cat >> confdefs.h <<\EOF
3656 #define pid_t int
3657 EOF
3658 }
3659
3660 fi
3661
3662 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3663 echo "configure:3664: checking for uid_t in sys/types.h" >&5
3664
3665 cat > conftest.$ac_ext <<EOF
3666 #line 3667 "configure"
3667 #include "confdefs.h"
3668 #include <sys/types.h>
3669 EOF
3670 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3671   egrep "uid_t" >/dev/null 2>&1; then
3672   rm -rf conftest*
3673   ac_cv_type_uid_t=yes
3674 else
3675   rm -rf conftest*
3676   ac_cv_type_uid_t=no
3677 fi
3678 rm -f conftest*
3679
3680
3681 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3682 if test $ac_cv_type_uid_t = no; then
3683   { test "$extra_verbose" = "yes" && cat << \EOF
3684     Defining uid_t = int
3685 EOF
3686 cat >> confdefs.h <<\EOF
3687 #define uid_t int
3688 EOF
3689 }
3690
3691   { test "$extra_verbose" = "yes" && cat << \EOF
3692     Defining gid_t = int
3693 EOF
3694 cat >> confdefs.h <<\EOF
3695 #define gid_t int
3696 EOF
3697 }
3698
3699 fi
3700
3701 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3702 echo "configure:3703: checking for mode_t" >&5
3703
3704 cat > conftest.$ac_ext <<EOF
3705 #line 3706 "configure"
3706 #include "confdefs.h"
3707 #include <sys/types.h>
3708 #if STDC_HEADERS
3709 #include <stdlib.h>
3710 #include <stddef.h>
3711 #endif
3712 EOF
3713 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3714   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3715   rm -rf conftest*
3716   ac_cv_type_mode_t=yes
3717 else
3718   rm -rf conftest*
3719   ac_cv_type_mode_t=no
3720 fi
3721 rm -f conftest*
3722
3723 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3724 if test $ac_cv_type_mode_t = no; then
3725   { test "$extra_verbose" = "yes" && cat << \EOF
3726     Defining mode_t = int
3727 EOF
3728 cat >> confdefs.h <<\EOF
3729 #define mode_t int
3730 EOF
3731 }
3732
3733 fi
3734
3735 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3736 echo "configure:3737: checking for off_t" >&5
3737
3738 cat > conftest.$ac_ext <<EOF
3739 #line 3740 "configure"
3740 #include "confdefs.h"
3741 #include <sys/types.h>
3742 #if STDC_HEADERS
3743 #include <stdlib.h>
3744 #include <stddef.h>
3745 #endif
3746 EOF
3747 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3748   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3749   rm -rf conftest*
3750   ac_cv_type_off_t=yes
3751 else
3752   rm -rf conftest*
3753   ac_cv_type_off_t=no
3754 fi
3755 rm -f conftest*
3756
3757 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3758 if test $ac_cv_type_off_t = no; then
3759   { test "$extra_verbose" = "yes" && cat << \EOF
3760     Defining off_t = long
3761 EOF
3762 cat >> confdefs.h <<\EOF
3763 #define off_t long
3764 EOF
3765 }
3766
3767 fi
3768
3769
3770 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3771 echo "configure:3772: checking for struct timeval" >&5
3772 cat > conftest.$ac_ext <<EOF
3773 #line 3774 "configure"
3774 #include "confdefs.h"
3775 #ifdef TIME_WITH_SYS_TIME
3776 #include <sys/time.h>
3777 #include <time.h>
3778 #else
3779 #ifdef HAVE_SYS_TIME_H
3780 #include <sys/time.h>
3781 #else
3782 #include <time.h>
3783 #endif
3784 #endif
3785 int main() {
3786 static struct timeval x; x.tv_sec = x.tv_usec;
3787 ; return 0; }
3788 EOF
3789 if { (eval echo configure:3790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3790   rm -rf conftest*
3791   echo "$ac_t""yes" 1>&6
3792   HAVE_TIMEVAL=yes
3793   { test "$extra_verbose" = "yes" && cat << \EOF
3794     Defining HAVE_TIMEVAL
3795 EOF
3796 cat >> confdefs.h <<\EOF
3797 #define HAVE_TIMEVAL 1
3798 EOF
3799 }
3800
3801 else
3802   echo "configure: failed program was:" >&5
3803   cat conftest.$ac_ext >&5
3804   rm -rf conftest*
3805   echo "$ac_t""no" 1>&6
3806    HAVE_TIMEVAL=no
3807 fi
3808 rm -f conftest*
3809
3810 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3811 echo "configure:3812: checking whether struct tm is in sys/time.h or time.h" >&5
3812
3813 cat > conftest.$ac_ext <<EOF
3814 #line 3815 "configure"
3815 #include "confdefs.h"
3816 #include <sys/types.h>
3817 #include <time.h>
3818 int main() {
3819 struct tm *tp; tp->tm_sec;
3820 ; return 0; }
3821 EOF
3822 if { (eval echo configure:3823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3823   rm -rf conftest*
3824   ac_cv_struct_tm=time.h
3825 else
3826   echo "configure: failed program was:" >&5
3827   cat conftest.$ac_ext >&5
3828   rm -rf conftest*
3829   ac_cv_struct_tm=sys/time.h
3830 fi
3831 rm -f conftest*
3832
3833 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3834 if test $ac_cv_struct_tm = sys/time.h; then
3835   { test "$extra_verbose" = "yes" && cat << \EOF
3836     Defining TM_IN_SYS_TIME
3837 EOF
3838 cat >> confdefs.h <<\EOF
3839 #define TM_IN_SYS_TIME 1
3840 EOF
3841 }
3842
3843 fi
3844
3845 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3846 echo "configure:3847: checking for tm_zone in struct tm" >&5
3847
3848 cat > conftest.$ac_ext <<EOF
3849 #line 3850 "configure"
3850 #include "confdefs.h"
3851 #include <sys/types.h>
3852 #include <$ac_cv_struct_tm>
3853 int main() {
3854 struct tm tm; tm.tm_zone;
3855 ; return 0; }
3856 EOF
3857 if { (eval echo configure:3858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3858   rm -rf conftest*
3859   ac_cv_struct_tm_zone=yes
3860 else
3861   echo "configure: failed program was:" >&5
3862   cat conftest.$ac_ext >&5
3863   rm -rf conftest*
3864   ac_cv_struct_tm_zone=no
3865 fi
3866 rm -f conftest*
3867
3868 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3869 if test "$ac_cv_struct_tm_zone" = yes; then
3870   { test "$extra_verbose" = "yes" && cat << \EOF
3871     Defining HAVE_TM_ZONE
3872 EOF
3873 cat >> confdefs.h <<\EOF
3874 #define HAVE_TM_ZONE 1
3875 EOF
3876 }
3877
3878 else
3879   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3880 echo "configure:3881: checking for tzname" >&5
3881
3882 cat > conftest.$ac_ext <<EOF
3883 #line 3884 "configure"
3884 #include "confdefs.h"
3885 #include <time.h>
3886 #ifndef tzname /* For SGI.  */
3887 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3888 #endif
3889 int main() {
3890 atoi(*tzname);
3891 ; return 0; }
3892 EOF
3893 if { (eval echo configure:3894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3894   rm -rf conftest*
3895   ac_cv_var_tzname=yes
3896 else
3897   echo "configure: failed program was:" >&5
3898   cat conftest.$ac_ext >&5
3899   rm -rf conftest*
3900   ac_cv_var_tzname=no
3901 fi
3902 rm -f conftest*
3903
3904 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3905   if test $ac_cv_var_tzname = yes; then
3906     { test "$extra_verbose" = "yes" && cat << \EOF
3907     Defining HAVE_TZNAME
3908 EOF
3909 cat >> confdefs.h <<\EOF
3910 #define HAVE_TZNAME 1
3911 EOF
3912 }
3913
3914   fi
3915 fi
3916
3917
3918 echo $ac_n "checking for working const""... $ac_c" 1>&6
3919 echo "configure:3920: checking for working const" >&5
3920
3921 cat > conftest.$ac_ext <<EOF
3922 #line 3923 "configure"
3923 #include "confdefs.h"
3924
3925 int main() {
3926
3927 /* Ultrix mips cc rejects this.  */
3928 typedef int charset[2]; const charset x;
3929 /* SunOS 4.1.1 cc rejects this.  */
3930 char const *const *ccp;
3931 char **p;
3932 /* NEC SVR4.0.2 mips cc rejects this.  */
3933 struct point {int x, y;};
3934 static struct point const zero = {0,0};
3935 /* AIX XL C 1.02.0.0 rejects this.
3936    It does not let you subtract one const X* pointer from another in an arm
3937    of an if-expression whose if-part is not a constant expression */
3938 const char *g = "string";
3939 ccp = &g + (g ? g-g : 0);
3940 /* HPUX 7.0 cc rejects these. */
3941 ++ccp;
3942 p = (char**) ccp;
3943 ccp = (char const *const *) p;
3944 { /* SCO 3.2v4 cc rejects this.  */
3945   char *t;
3946   char const *s = 0 ? (char *) 0 : (char const *) 0;
3947
3948   *t++ = 0;
3949 }
3950 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3951   int x[] = {25, 17};
3952   const int *foo = &x[0];
3953   ++foo;
3954 }
3955 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3956   typedef const int *iptr;
3957   iptr p = 0;
3958   ++p;
3959 }
3960 { /* AIX XL C 1.02.0.0 rejects this saying
3961      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3962   struct s { int j; const int *ap[3]; };
3963   struct s *b; b->j = 5;
3964 }
3965 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3966   const int foo = 10;
3967 }
3968
3969 ; return 0; }
3970 EOF
3971 if { (eval echo configure:3972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3972   rm -rf conftest*
3973   ac_cv_c_const=yes
3974 else
3975   echo "configure: failed program was:" >&5
3976   cat conftest.$ac_ext >&5
3977   rm -rf conftest*
3978   ac_cv_c_const=no
3979 fi
3980 rm -f conftest*
3981
3982 echo "$ac_t""$ac_cv_c_const" 1>&6
3983 if test $ac_cv_c_const = no; then
3984   { test "$extra_verbose" = "yes" && cat << \EOF
3985     Defining const = 
3986 EOF
3987 cat >> confdefs.h <<\EOF
3988 #define const 
3989 EOF
3990 }
3991
3992 fi
3993
3994
3995 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3996 echo "configure:3997: checking whether ${MAKE-make} sets \${MAKE}" >&5
3997 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3998
3999 cat > conftestmake <<\EOF
4000 all:
4001         @echo 'ac_maketemp="${MAKE}"'
4002 EOF
4003 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4004 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4005 if test -n "$ac_maketemp"; then
4006   eval ac_cv_prog_make_${ac_make}_set=yes
4007 else
4008   eval ac_cv_prog_make_${ac_make}_set=no
4009 fi
4010 rm -f conftestmake
4011 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4012   echo "$ac_t""yes" 1>&6
4013   SET_MAKE=
4014 else
4015   echo "$ac_t""no" 1>&6
4016   SET_MAKE="MAKE=${MAKE-make}"
4017 fi
4018
4019
4020 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4021 echo "configure:4022: checking whether byte ordering is bigendian" >&5
4022
4023 ac_cv_c_bigendian=unknown
4024 # See if sys/param.h defines the BYTE_ORDER macro.
4025 cat > conftest.$ac_ext <<EOF
4026 #line 4027 "configure"
4027 #include "confdefs.h"
4028 #include <sys/types.h>
4029 #include <sys/param.h>
4030 int main() {
4031
4032 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4033  bogus endian macros
4034 #endif
4035 ; return 0; }
4036 EOF
4037 if { (eval echo configure:4038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4038   rm -rf conftest*
4039   # It does; now see whether it defined to BIG_ENDIAN or not.
4040 cat > conftest.$ac_ext <<EOF
4041 #line 4042 "configure"
4042 #include "confdefs.h"
4043 #include <sys/types.h>
4044 #include <sys/param.h>
4045 int main() {
4046
4047 #if BYTE_ORDER != BIG_ENDIAN
4048  not big endian
4049 #endif
4050 ; return 0; }
4051 EOF
4052 if { (eval echo configure:4053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4053   rm -rf conftest*
4054   ac_cv_c_bigendian=yes
4055 else
4056   echo "configure: failed program was:" >&5
4057   cat conftest.$ac_ext >&5
4058   rm -rf conftest*
4059   ac_cv_c_bigendian=no
4060 fi
4061 rm -f conftest*
4062 else
4063   echo "configure: failed program was:" >&5
4064   cat conftest.$ac_ext >&5
4065 fi
4066 rm -f conftest*
4067 if test $ac_cv_c_bigendian = unknown; then
4068 cat > conftest.$ac_ext <<EOF
4069 #line 4070 "configure"
4070 #include "confdefs.h"
4071 main () {
4072   /* Are we little or big endian?  From Harbison&Steele.  */
4073   union
4074   {
4075     long l;
4076     char c[sizeof (long)];
4077   } u;
4078   u.l = 1;
4079   exit (u.c[sizeof (long) - 1] == 1);
4080 }
4081 EOF
4082 if { (eval echo configure:4083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4083 then
4084   ac_cv_c_bigendian=no
4085 else
4086   conftest_rc="$?"
4087   echo "configure: failed program was:" >&5
4088   cat conftest.$ac_ext >&5
4089   rm -fr conftest*
4090   ac_cv_c_bigendian=yes
4091 fi
4092 rm -fr conftest*
4093 fi
4094
4095 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4096 if test $ac_cv_c_bigendian = yes; then
4097   { test "$extra_verbose" = "yes" && cat << \EOF
4098     Defining WORDS_BIGENDIAN
4099 EOF
4100 cat >> confdefs.h <<\EOF
4101 #define WORDS_BIGENDIAN 1
4102 EOF
4103 }
4104
4105 fi
4106
4107
4108 echo $ac_n "checking size of short""... $ac_c" 1>&6
4109 echo "configure:4110: checking size of short" >&5
4110
4111 cat > conftest.$ac_ext <<EOF
4112 #line 4113 "configure"
4113 #include "confdefs.h"
4114 #include <stdio.h>
4115 main()
4116 {
4117   FILE *f=fopen("conftestval", "w");
4118   if (!f) exit(1);
4119   fprintf(f, "%d\n", sizeof(short));
4120   exit(0);
4121 }
4122 EOF
4123 if { (eval echo configure:4124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4124 then
4125   ac_cv_sizeof_short=`cat conftestval`
4126 else
4127   conftest_rc="$?"
4128   echo "configure: failed program was:" >&5
4129   cat conftest.$ac_ext >&5
4130   rm -fr conftest*
4131   ac_cv_sizeof_short=0
4132 fi
4133 rm -fr conftest*
4134 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4135 { test "$extra_verbose" = "yes" && cat << EOF
4136     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4137 EOF
4138 cat >> confdefs.h <<EOF
4139 #define SIZEOF_SHORT $ac_cv_sizeof_short
4140 EOF
4141 }
4142
4143
4144 if test "$ac_cv_sizeof_short" = 0; then
4145   echo ""
4146   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4147   echo "*** PANIC *** Please examine config.log for compilation errors."
4148   exit 1
4149 fi
4150 echo $ac_n "checking size of int""... $ac_c" 1>&6
4151 echo "configure:4152: checking size of int" >&5
4152
4153 cat > conftest.$ac_ext <<EOF
4154 #line 4155 "configure"
4155 #include "confdefs.h"
4156 #include <stdio.h>
4157 main()
4158 {
4159   FILE *f=fopen("conftestval", "w");
4160   if (!f) exit(1);
4161   fprintf(f, "%d\n", sizeof(int));
4162   exit(0);
4163 }
4164 EOF
4165 if { (eval echo configure:4166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4166 then
4167   ac_cv_sizeof_int=`cat conftestval`
4168 else
4169   conftest_rc="$?"
4170   echo "configure: failed program was:" >&5
4171   cat conftest.$ac_ext >&5
4172   rm -fr conftest*
4173   ac_cv_sizeof_int=0
4174 fi
4175 rm -fr conftest*
4176 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4177 { test "$extra_verbose" = "yes" && cat << EOF
4178     Defining SIZEOF_INT = $ac_cv_sizeof_int
4179 EOF
4180 cat >> confdefs.h <<EOF
4181 #define SIZEOF_INT $ac_cv_sizeof_int
4182 EOF
4183 }
4184
4185
4186 echo $ac_n "checking size of long""... $ac_c" 1>&6
4187 echo "configure:4188: checking size of long" >&5
4188
4189 cat > conftest.$ac_ext <<EOF
4190 #line 4191 "configure"
4191 #include "confdefs.h"
4192 #include <stdio.h>
4193 main()
4194 {
4195   FILE *f=fopen("conftestval", "w");
4196   if (!f) exit(1);
4197   fprintf(f, "%d\n", sizeof(long));
4198   exit(0);
4199 }
4200 EOF
4201 if { (eval echo configure:4202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4202 then
4203   ac_cv_sizeof_long=`cat conftestval`
4204 else
4205   conftest_rc="$?"
4206   echo "configure: failed program was:" >&5
4207   cat conftest.$ac_ext >&5
4208   rm -fr conftest*
4209   ac_cv_sizeof_long=0
4210 fi
4211 rm -fr conftest*
4212 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4213 { test "$extra_verbose" = "yes" && cat << EOF
4214     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4215 EOF
4216 cat >> confdefs.h <<EOF
4217 #define SIZEOF_LONG $ac_cv_sizeof_long
4218 EOF
4219 }
4220
4221
4222 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4223 echo "configure:4224: checking size of long long" >&5
4224
4225 cat > conftest.$ac_ext <<EOF
4226 #line 4227 "configure"
4227 #include "confdefs.h"
4228 #include <stdio.h>
4229 main()
4230 {
4231   FILE *f=fopen("conftestval", "w");
4232   if (!f) exit(1);
4233   fprintf(f, "%d\n", sizeof(long long));
4234   exit(0);
4235 }
4236 EOF
4237 if { (eval echo configure:4238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4238 then
4239   ac_cv_sizeof_long_long=`cat conftestval`
4240 else
4241   conftest_rc="$?"
4242   echo "configure: failed program was:" >&5
4243   cat conftest.$ac_ext >&5
4244   rm -fr conftest*
4245   ac_cv_sizeof_long_long=0
4246 fi
4247 rm -fr conftest*
4248 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4249 { test "$extra_verbose" = "yes" && cat << EOF
4250     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4251 EOF
4252 cat >> confdefs.h <<EOF
4253 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4254 EOF
4255 }
4256
4257
4258 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4259 echo "configure:4260: checking size of void *" >&5
4260
4261 cat > conftest.$ac_ext <<EOF
4262 #line 4263 "configure"
4263 #include "confdefs.h"
4264 #include <stdio.h>
4265 main()
4266 {
4267   FILE *f=fopen("conftestval", "w");
4268   if (!f) exit(1);
4269   fprintf(f, "%d\n", sizeof(void *));
4270   exit(0);
4271 }
4272 EOF
4273 if { (eval echo configure:4274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4274 then
4275   ac_cv_sizeof_void_p=`cat conftestval`
4276 else
4277   conftest_rc="$?"
4278   echo "configure: failed program was:" >&5
4279   cat conftest.$ac_ext >&5
4280   rm -fr conftest*
4281   ac_cv_sizeof_void_p=0
4282 fi
4283 rm -fr conftest*
4284 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4285 { test "$extra_verbose" = "yes" && cat << EOF
4286     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4287 EOF
4288 cat >> confdefs.h <<EOF
4289 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4290 EOF
4291 }
4292
4293
4294
4295 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4296 echo "configure:4297: checking for long file names" >&5
4297
4298 ac_cv_sys_long_file_names=yes
4299 # Test for long file names in all the places we know might matter:
4300 #      .                the current directory, where building will happen
4301 #      $prefix/lib      where we will be installing things
4302 #      $exec_prefix/lib likewise
4303 # eval it to expand exec_prefix.
4304 #      $TMPDIR          if set, where it might want to write temporary files
4305 # if $TMPDIR is not set:
4306 #      /tmp             where it might want to write temporary files
4307 #      /var/tmp         likewise
4308 #      /usr/tmp         likewise
4309 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4310   ac_tmpdirs="$TMPDIR"
4311 else
4312   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4313 fi
4314 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4315   test -d $ac_dir || continue
4316   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4317   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4318   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4319   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4320   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4321     ac_cv_sys_long_file_names=no
4322     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4323     break
4324   fi
4325   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4326 done
4327
4328 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4329 if test $ac_cv_sys_long_file_names = yes; then
4330   { test "$extra_verbose" = "yes" && cat << \EOF
4331     Defining HAVE_LONG_FILE_NAMES
4332 EOF
4333 cat >> confdefs.h <<\EOF
4334 #define HAVE_LONG_FILE_NAMES 1
4335 EOF
4336 }
4337
4338 fi
4339
4340
4341 echo $ac_n "checking for sin""... $ac_c" 1>&6
4342 echo "configure:4343: checking for sin" >&5
4343
4344 cat > conftest.$ac_ext <<EOF
4345 #line 4346 "configure"
4346 #include "confdefs.h"
4347 /* System header to define __stub macros and hopefully few prototypes,
4348     which can conflict with char sin(); below.  */
4349 #include <assert.h>
4350 /* Override any gcc2 internal prototype to avoid an error.  */
4351 /* We use char because int might match the return type of a gcc2
4352     builtin and then its argument prototype would still apply.  */
4353 char sin();
4354
4355 int main() {
4356
4357 /* The GNU C library defines this for functions which it implements
4358     to always fail with ENOSYS.  Some functions are actually named
4359     something starting with __ and the normal name is an alias.  */
4360 #if defined (__stub_sin) || defined (__stub___sin)
4361 choke me
4362 #else
4363 sin();
4364 #endif
4365
4366 ; return 0; }
4367 EOF
4368 if { (eval echo configure:4369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4369   rm -rf conftest*
4370   eval "ac_cv_func_sin=yes"
4371 else
4372   echo "configure: failed program was:" >&5
4373   cat conftest.$ac_ext >&5
4374   rm -rf conftest*
4375   eval "ac_cv_func_sin=no"
4376 fi
4377 rm -f conftest*
4378
4379 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4380   echo "$ac_t""yes" 1>&6
4381   :
4382 else
4383   echo "$ac_t""no" 1>&6
4384
4385 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4386 echo "configure:4387: checking for sin in -lm" >&5
4387 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4388
4389 xe_check_libs=" -lm "
4390 cat > conftest.$ac_ext <<EOF
4391 #line 4392 "configure"
4392 #include "confdefs.h"
4393 /* Override any gcc2 internal prototype to avoid an error.  */
4394 /* We use char because int might match the return type of a gcc2
4395     builtin and then its argument prototype would still apply.  */
4396 char sin();
4397
4398 int main() {
4399 sin()
4400 ; return 0; }
4401 EOF
4402 if { (eval echo configure:4403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4403   rm -rf conftest*
4404   eval "ac_cv_lib_$ac_lib_var=yes"
4405 else
4406   echo "configure: failed program was:" >&5
4407   cat conftest.$ac_ext >&5
4408   rm -rf conftest*
4409   eval "ac_cv_lib_$ac_lib_var=no"
4410 fi
4411 rm -f conftest*
4412 xe_check_libs=""
4413
4414 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4415   echo "$ac_t""yes" 1>&6
4416     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4417     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4418   { test "$extra_verbose" = "yes" && cat << EOF
4419     Defining $ac_tr_lib
4420 EOF
4421 cat >> confdefs.h <<EOF
4422 #define $ac_tr_lib 1
4423 EOF
4424 }
4425
4426   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4427
4428 else
4429   echo "$ac_t""no" 1>&6
4430 fi
4431
4432
4433 fi
4434
4435
4436 { test "$extra_verbose" = "yes" && cat << \EOF
4437     Defining LISP_FLOAT_TYPE
4438 EOF
4439 cat >> confdefs.h <<\EOF
4440 #define LISP_FLOAT_TYPE 1
4441 EOF
4442 }
4443
4444
4445 cat > conftest.$ac_ext <<EOF
4446 #line 4447 "configure"
4447 #include "confdefs.h"
4448 #include <math.h>
4449 int main() {
4450 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4451 ; return 0; }
4452 EOF
4453 if { (eval echo configure:4454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4454   rm -rf conftest*
4455   { test "$extra_verbose" = "yes" && cat << \EOF
4456     Defining HAVE_INVERSE_HYPERBOLIC
4457 EOF
4458 cat >> confdefs.h <<\EOF
4459 #define HAVE_INVERSE_HYPERBOLIC 1
4460 EOF
4461 }
4462
4463 else
4464   echo "configure: failed program was:" >&5
4465   cat conftest.$ac_ext >&5
4466 fi
4467 rm -f conftest*
4468
4469 echo "checking type of mail spool file locking" 1>&6
4470 echo "configure:4471: checking type of mail spool file locking" >&5
4471 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4472 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4473 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4474     Defining REAL_MAIL_USE_LOCKF
4475 EOF
4476 cat >> confdefs.h <<\EOF
4477 #define REAL_MAIL_USE_LOCKF 1
4478 EOF
4479 }
4480
4481 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4482     Defining REAL_MAIL_USE_FLOCK
4483 EOF
4484 cat >> confdefs.h <<\EOF
4485 #define REAL_MAIL_USE_FLOCK 1
4486 EOF
4487 }
4488
4489 else mail_locking="dot-locking"
4490 fi
4491
4492 case "$opsys" in decosf*)
4493   
4494 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4495 echo "configure:4496: checking for cma_open in -lpthreads" >&5
4496 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4497
4498 xe_check_libs=" -lpthreads "
4499 cat > conftest.$ac_ext <<EOF
4500 #line 4501 "configure"
4501 #include "confdefs.h"
4502 /* Override any gcc2 internal prototype to avoid an error.  */
4503 /* We use char because int might match the return type of a gcc2
4504     builtin and then its argument prototype would still apply.  */
4505 char cma_open();
4506
4507 int main() {
4508 cma_open()
4509 ; return 0; }
4510 EOF
4511 if { (eval echo configure:4512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4512   rm -rf conftest*
4513   eval "ac_cv_lib_$ac_lib_var=yes"
4514 else
4515   echo "configure: failed program was:" >&5
4516   cat conftest.$ac_ext >&5
4517   rm -rf conftest*
4518   eval "ac_cv_lib_$ac_lib_var=no"
4519 fi
4520 rm -f conftest*
4521 xe_check_libs=""
4522
4523 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4524   echo "$ac_t""yes" 1>&6
4525     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4526     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4527   { test "$extra_verbose" = "yes" && cat << EOF
4528     Defining $ac_tr_lib
4529 EOF
4530 cat >> confdefs.h <<EOF
4531 #define $ac_tr_lib 1
4532 EOF
4533 }
4534
4535   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4536
4537 else
4538   echo "$ac_t""no" 1>&6
4539 fi
4540
4541
4542   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4543     c_switch_site="$c_switch_site -threads" ;;
4544 esac
4545
4546 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4547 echo "configure:4548: checking whether the -xildoff compiler flag is required" >&5
4548 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4549   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4550     then echo "$ac_t""no" 1>&6;
4551     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
4552   fi
4553   else echo "$ac_t""no" 1>&6
4554 fi
4555
4556 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4557   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4558 echo "configure:4559: checking for \"-z ignore\" linker flag" >&5
4559   case "`ld -h 2>&1`" in
4560     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4561       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4562     *) echo "$ac_t""no" 1>&6 ;;
4563   esac
4564 fi
4565
4566
4567 echo "checking "for specified window system"" 1>&6
4568 echo "configure:4569: checking "for specified window system"" >&5
4569
4570 if test "$with_x11" != "no"; then
4571     test "$x_includes $x_libraries" != "NONE NONE" && \
4572    window_system=x11 with_x11=yes
4573
4574         
4575       if test "$x_includes $x_libraries" = "NONE NONE" \
4576     -a -n "$OPENWINHOME" \
4577     -a "$OPENWINHOME" != "/usr/openwin" \
4578     -a -d "$OPENWINHOME"; then
4579       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4580       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4581       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4582   fi
4583
4584   if test "$x_includes" = "NONE"; then
4585                     for dir in "/usr/X11" "/usr/X11R6"; do
4586       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4587     done
4588   fi
4589
4590   if test "$x_libraries" = "NONE"; then
4591     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4592       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4593     done
4594   fi
4595
4596   # If we find X, set shell vars x_includes and x_libraries to the
4597 # paths, otherwise set no_x=yes.
4598 # Uses ac_ vars as temps to allow command line to override cache and checks.
4599 # --without-x overrides everything else, but does not touch the cache.
4600 echo $ac_n "checking for X""... $ac_c" 1>&6
4601 echo "configure:4602: checking for X" >&5
4602
4603 # Check whether --with-x or --without-x was given.
4604 if test "${with_x+set}" = set; then
4605   withval="$with_x"
4606   :
4607 fi
4608
4609 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4610 if test "x$with_x" = xno; then
4611   # The user explicitly disabled X.
4612   have_x=disabled
4613 else
4614   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4615     # Both variables are already set.
4616     have_x=yes
4617   else
4618
4619 # One or both of the vars are not set, and there is no cached value.
4620 ac_x_includes=NO ac_x_libraries=NO
4621 rm -fr conftestdir
4622 if mkdir conftestdir; then
4623   cd conftestdir
4624   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4625   cat > Imakefile <<'EOF'
4626 acfindx:
4627         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4628 EOF
4629   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4630     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4631     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4632     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4633     for ac_extension in a so sl; do
4634       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4635         test -f $ac_im_libdir/libX11.$ac_extension; then
4636         ac_im_usrlibdir=$ac_im_libdir; break
4637       fi
4638     done
4639     # Screen out bogus values from the imake configuration.  They are
4640     # bogus both because they are the default anyway, and because
4641     # using them would break gcc on systems where it needs fixed includes.
4642     case "$ac_im_incroot" in
4643         /usr/include) ;;
4644         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4645     esac
4646     case "$ac_im_usrlibdir" in
4647         /usr/lib | /lib) ;;
4648         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4649     esac
4650   fi
4651   cd ..
4652   rm -fr conftestdir
4653 fi
4654
4655 if test "$ac_x_includes" = NO; then
4656   # Guess where to find include files, by looking for this one X11 .h file.
4657   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4658
4659   # First, try using that file with no special directory specified.
4660 cat > conftest.$ac_ext <<EOF
4661 #line 4662 "configure"
4662 #include "confdefs.h"
4663 #include <$x_direct_test_include>
4664 EOF
4665 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4666 { (eval echo configure:4667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4667 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4668 if test -z "$ac_err"; then
4669   rm -rf conftest*
4670   # We can compile using X headers with no special include directory.
4671 ac_x_includes=
4672 else
4673   echo "$ac_err" >&5
4674   echo "configure: failed program was:" >&5
4675   cat conftest.$ac_ext >&5
4676   rm -rf conftest*
4677   # Look for the header file in a standard set of common directories.
4678 # Check X11 before X11Rn because it is often a symlink to the current release.
4679   for ac_dir in               \
4680     /usr/X11/include          \
4681     /usr/X11R6/include        \
4682     /usr/X11R5/include        \
4683     /usr/X11R4/include        \
4684                               \
4685     /usr/include/X11          \
4686     /usr/include/X11R6        \
4687     /usr/include/X11R5        \
4688     /usr/include/X11R4        \
4689                               \
4690     /usr/local/X11/include    \
4691     /usr/local/X11R6/include  \
4692     /usr/local/X11R5/include  \
4693     /usr/local/X11R4/include  \
4694                               \
4695     /usr/local/include/X11    \
4696     /usr/local/include/X11R6  \
4697     /usr/local/include/X11R5  \
4698     /usr/local/include/X11R4  \
4699                               \
4700     /usr/X386/include         \
4701     /usr/x386/include         \
4702     /usr/XFree86/include/X11  \
4703                               \
4704     /usr/include              \
4705     /usr/local/include        \
4706     /usr/unsupported/include  \
4707     /usr/athena/include       \
4708     /usr/local/x11r5/include  \
4709     /usr/lpp/Xamples/include  \
4710                               \
4711     /usr/openwin/include      \
4712     /usr/openwin/share/include \
4713     ; \
4714   do
4715     if test -r "$ac_dir/$x_direct_test_include"; then
4716       ac_x_includes=$ac_dir
4717       break
4718     fi
4719   done
4720 fi
4721 rm -f conftest*
4722 fi # $ac_x_includes = NO
4723
4724 if test "$ac_x_libraries" = NO; then
4725   # Check for the libraries.
4726
4727   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4728   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4729
4730   # See if we find them without any special options.
4731   # Don't add to $LIBS permanently.
4732   ac_save_LIBS="$LIBS"
4733   LIBS="-l$x_direct_test_library $LIBS"
4734 cat > conftest.$ac_ext <<EOF
4735 #line 4736 "configure"
4736 #include "confdefs.h"
4737
4738 int main() {
4739 ${x_direct_test_function}()
4740 ; return 0; }
4741 EOF
4742 if { (eval echo configure:4743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4743   rm -rf conftest*
4744   LIBS="$ac_save_LIBS"
4745 # We can link X programs with no special library path.
4746 ac_x_libraries=
4747 else
4748   echo "configure: failed program was:" >&5
4749   cat conftest.$ac_ext >&5
4750   rm -rf conftest*
4751   LIBS="$ac_save_LIBS"
4752 # First see if replacing the include by lib works.
4753 # Check X11 before X11Rn because it is often a symlink to the current release.
4754 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4755     /usr/X11/lib          \
4756     /usr/X11R6/lib        \
4757     /usr/X11R5/lib        \
4758     /usr/X11R4/lib        \
4759                           \
4760     /usr/lib/X11          \
4761     /usr/lib/X11R6        \
4762     /usr/lib/X11R5        \
4763     /usr/lib/X11R4        \
4764                           \
4765     /usr/local/X11/lib    \
4766     /usr/local/X11R6/lib  \
4767     /usr/local/X11R5/lib  \
4768     /usr/local/X11R4/lib  \
4769                           \
4770     /usr/local/lib/X11    \
4771     /usr/local/lib/X11R6  \
4772     /usr/local/lib/X11R5  \
4773     /usr/local/lib/X11R4  \
4774                           \
4775     /usr/X386/lib         \
4776     /usr/x386/lib         \
4777     /usr/XFree86/lib/X11  \
4778                           \
4779     /usr/lib              \
4780     /usr/local/lib        \
4781     /usr/unsupported/lib  \
4782     /usr/athena/lib       \
4783     /usr/local/x11r5/lib  \
4784     /usr/lpp/Xamples/lib  \
4785     /lib/usr/lib/X11      \
4786                           \
4787     /usr/openwin/lib      \
4788     /usr/openwin/share/lib \
4789     ; \
4790 do
4791   for ac_extension in a so sl; do
4792     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4793       ac_x_libraries=$ac_dir
4794       break 2
4795     fi
4796   done
4797 done
4798 fi
4799 rm -f conftest*
4800 fi # $ac_x_libraries = NO
4801
4802 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4803   # Didn't find X anywhere.  Cache the known absence of X.
4804   ac_cv_have_x="have_x=no"
4805 else
4806   # Record where we found X for the cache.
4807   ac_cv_have_x="have_x=yes \
4808                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4809 fi
4810   fi
4811   eval "$ac_cv_have_x"
4812 fi # $with_x != no
4813
4814 if test "$have_x" != yes; then
4815   echo "$ac_t""$have_x" 1>&6
4816   no_x=yes
4817 else
4818   # If each of the values was on the command line, it overrides each guess.
4819   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4820   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4821   # Update the cache value to reflect the command line values.
4822   ac_cv_have_x="have_x=yes \
4823                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4824   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4825 fi
4826
4827 if test "$no_x" = yes; then
4828   # Not all programs may use this symbol, but it does not hurt to define it.
4829   { test "$extra_verbose" = "yes" && cat << \EOF
4830     Defining X_DISPLAY_MISSING
4831 EOF
4832 cat >> confdefs.h <<\EOF
4833 #define X_DISPLAY_MISSING 1
4834 EOF
4835 }
4836
4837   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4838 else
4839   if test -n "$x_includes"; then
4840     X_CFLAGS="$X_CFLAGS -I$x_includes"
4841   fi
4842
4843   # It would also be nice to do this for all -L options, not just this one.
4844   if test -n "$x_libraries"; then
4845     X_LIBS="$X_LIBS -L$x_libraries"
4846     # For Solaris; some versions of Sun CC require a space after -R and
4847     # others require no space.  Words are not sufficient . . . .
4848     case "`(uname -sr) 2>/dev/null`" in
4849     "SunOS 5"*)
4850       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4851 echo "configure:4852: checking whether -R must be followed by a space" >&5
4852       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4853       cat > conftest.$ac_ext <<EOF
4854 #line 4855 "configure"
4855 #include "confdefs.h"
4856
4857 int main() {
4858
4859 ; return 0; }
4860 EOF
4861 if { (eval echo configure:4862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4862   rm -rf conftest*
4863   ac_R_nospace=yes
4864 else
4865   echo "configure: failed program was:" >&5
4866   cat conftest.$ac_ext >&5
4867   rm -rf conftest*
4868   ac_R_nospace=no
4869 fi
4870 rm -f conftest*
4871       if test $ac_R_nospace = yes; then
4872         echo "$ac_t""no" 1>&6
4873         X_LIBS="$X_LIBS -R$x_libraries"
4874       else
4875         LIBS="$ac_xsave_LIBS -R $x_libraries"
4876         cat > conftest.$ac_ext <<EOF
4877 #line 4878 "configure"
4878 #include "confdefs.h"
4879
4880 int main() {
4881
4882 ; return 0; }
4883 EOF
4884 if { (eval echo configure:4885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4885   rm -rf conftest*
4886   ac_R_space=yes
4887 else
4888   echo "configure: failed program was:" >&5
4889   cat conftest.$ac_ext >&5
4890   rm -rf conftest*
4891   ac_R_space=no
4892 fi
4893 rm -f conftest*
4894         if test $ac_R_space = yes; then
4895           echo "$ac_t""yes" 1>&6
4896           X_LIBS="$X_LIBS -R $x_libraries"
4897         else
4898           echo "$ac_t""neither works" 1>&6
4899         fi
4900       fi
4901       LIBS="$ac_xsave_LIBS"
4902     esac
4903   fi
4904
4905   # Check for system-dependent libraries X programs must link with.
4906   # Do this before checking for the system-independent R6 libraries
4907   # (-lICE), since we may need -lsocket or whatever for X linking.
4908
4909   if test "$ISC" = yes; then
4910     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4911   else
4912     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4913     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4914     # the Alpha needs dnet_stub (dnet does not exist).
4915     if test "$with_dnet" = "no" ; then
4916 ac_cv_lib_dnet_dnet_ntoa=no
4917 else
4918
4919 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4920 echo "configure:4921: checking for dnet_ntoa in -ldnet" >&5
4921 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4922
4923 xe_check_libs=" -ldnet "
4924 cat > conftest.$ac_ext <<EOF
4925 #line 4926 "configure"
4926 #include "confdefs.h"
4927 /* Override any gcc2 internal prototype to avoid an error.  */
4928 /* We use char because int might match the return type of a gcc2
4929     builtin and then its argument prototype would still apply.  */
4930 char dnet_ntoa();
4931
4932 int main() {
4933 dnet_ntoa()
4934 ; return 0; }
4935 EOF
4936 if { (eval echo configure:4937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4937   rm -rf conftest*
4938   eval "ac_cv_lib_$ac_lib_var=yes"
4939 else
4940   echo "configure: failed program was:" >&5
4941   cat conftest.$ac_ext >&5
4942   rm -rf conftest*
4943   eval "ac_cv_lib_$ac_lib_var=no"
4944 fi
4945 rm -f conftest*
4946 xe_check_libs=""
4947
4948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4949   echo "$ac_t""yes" 1>&6
4950   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4951 else
4952   echo "$ac_t""no" 1>&6
4953 fi
4954
4955 fi
4956
4957     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4958       
4959 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4960 echo "configure:4961: checking for dnet_ntoa in -ldnet_stub" >&5
4961 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4962
4963 xe_check_libs=" -ldnet_stub "
4964 cat > conftest.$ac_ext <<EOF
4965 #line 4966 "configure"
4966 #include "confdefs.h"
4967 /* Override any gcc2 internal prototype to avoid an error.  */
4968 /* We use char because int might match the return type of a gcc2
4969     builtin and then its argument prototype would still apply.  */
4970 char dnet_ntoa();
4971
4972 int main() {
4973 dnet_ntoa()
4974 ; return 0; }
4975 EOF
4976 if { (eval echo configure:4977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4977   rm -rf conftest*
4978   eval "ac_cv_lib_$ac_lib_var=yes"
4979 else
4980   echo "configure: failed program was:" >&5
4981   cat conftest.$ac_ext >&5
4982   rm -rf conftest*
4983   eval "ac_cv_lib_$ac_lib_var=no"
4984 fi
4985 rm -f conftest*
4986 xe_check_libs=""
4987
4988 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4989   echo "$ac_t""yes" 1>&6
4990   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4991 else
4992   echo "$ac_t""no" 1>&6
4993 fi
4994
4995
4996     fi
4997
4998     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4999     # to get the SysV transport functions.
5000     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5001     # needs -lnsl.
5002     # The nsl library prevents programs from opening the X display
5003     # on Irix 5.2, according to dickey@clark.net.
5004     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5005 echo "configure:5006: checking for gethostbyname" >&5
5006
5007 cat > conftest.$ac_ext <<EOF
5008 #line 5009 "configure"
5009 #include "confdefs.h"
5010 /* System header to define __stub macros and hopefully few prototypes,
5011     which can conflict with char gethostbyname(); below.  */
5012 #include <assert.h>
5013 /* Override any gcc2 internal prototype to avoid an error.  */
5014 /* We use char because int might match the return type of a gcc2
5015     builtin and then its argument prototype would still apply.  */
5016 char gethostbyname();
5017
5018 int main() {
5019
5020 /* The GNU C library defines this for functions which it implements
5021     to always fail with ENOSYS.  Some functions are actually named
5022     something starting with __ and the normal name is an alias.  */
5023 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5024 choke me
5025 #else
5026 gethostbyname();
5027 #endif
5028
5029 ; return 0; }
5030 EOF
5031 if { (eval echo configure:5032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5032   rm -rf conftest*
5033   eval "ac_cv_func_gethostbyname=yes"
5034 else
5035   echo "configure: failed program was:" >&5
5036   cat conftest.$ac_ext >&5
5037   rm -rf conftest*
5038   eval "ac_cv_func_gethostbyname=no"
5039 fi
5040 rm -f conftest*
5041
5042 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5043   echo "$ac_t""yes" 1>&6
5044   :
5045 else
5046   echo "$ac_t""no" 1>&6
5047 fi
5048
5049     if test $ac_cv_func_gethostbyname = no; then
5050       
5051 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5052 echo "configure:5053: checking for gethostbyname in -lnsl" >&5
5053 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5054
5055 xe_check_libs=" -lnsl "
5056 cat > conftest.$ac_ext <<EOF
5057 #line 5058 "configure"
5058 #include "confdefs.h"
5059 /* Override any gcc2 internal prototype to avoid an error.  */
5060 /* We use char because int might match the return type of a gcc2
5061     builtin and then its argument prototype would still apply.  */
5062 char gethostbyname();
5063
5064 int main() {
5065 gethostbyname()
5066 ; return 0; }
5067 EOF
5068 if { (eval echo configure:5069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5069   rm -rf conftest*
5070   eval "ac_cv_lib_$ac_lib_var=yes"
5071 else
5072   echo "configure: failed program was:" >&5
5073   cat conftest.$ac_ext >&5
5074   rm -rf conftest*
5075   eval "ac_cv_lib_$ac_lib_var=no"
5076 fi
5077 rm -f conftest*
5078 xe_check_libs=""
5079
5080 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5081   echo "$ac_t""yes" 1>&6
5082   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5083 else
5084   echo "$ac_t""no" 1>&6
5085 fi
5086
5087
5088     fi
5089
5090     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5091     # socket/setsockopt and other routines are undefined under SCO ODT
5092     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5093     # on later versions), says simon@lia.di.epfl.ch: it contains
5094     # gethostby* variants that don't use the nameserver (or something).
5095     # -lsocket must be given before -lnsl if both are needed.
5096     # We assume that if connect needs -lnsl, so does gethostbyname.
5097     echo $ac_n "checking for connect""... $ac_c" 1>&6
5098 echo "configure:5099: checking for connect" >&5
5099
5100 cat > conftest.$ac_ext <<EOF
5101 #line 5102 "configure"
5102 #include "confdefs.h"
5103 /* System header to define __stub macros and hopefully few prototypes,
5104     which can conflict with char connect(); below.  */
5105 #include <assert.h>
5106 /* Override any gcc2 internal prototype to avoid an error.  */
5107 /* We use char because int might match the return type of a gcc2
5108     builtin and then its argument prototype would still apply.  */
5109 char connect();
5110
5111 int main() {
5112
5113 /* The GNU C library defines this for functions which it implements
5114     to always fail with ENOSYS.  Some functions are actually named
5115     something starting with __ and the normal name is an alias.  */
5116 #if defined (__stub_connect) || defined (__stub___connect)
5117 choke me
5118 #else
5119 connect();
5120 #endif
5121
5122 ; return 0; }
5123 EOF
5124 if { (eval echo configure:5125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5125   rm -rf conftest*
5126   eval "ac_cv_func_connect=yes"
5127 else
5128   echo "configure: failed program was:" >&5
5129   cat conftest.$ac_ext >&5
5130   rm -rf conftest*
5131   eval "ac_cv_func_connect=no"
5132 fi
5133 rm -f conftest*
5134
5135 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5136   echo "$ac_t""yes" 1>&6
5137   :
5138 else
5139   echo "$ac_t""no" 1>&6
5140 fi
5141
5142     if test $ac_cv_func_connect = no; then
5143       
5144 xe_msg_checking="for connect in -lsocket"
5145 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5146 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5147 echo "configure:5148: checking "$xe_msg_checking"" >&5
5148 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5149
5150 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5151 cat > conftest.$ac_ext <<EOF
5152 #line 5153 "configure"
5153 #include "confdefs.h"
5154 /* Override any gcc2 internal prototype to avoid an error.  */
5155 /* We use char because int might match the return type of a gcc2
5156     builtin and then its argument prototype would still apply.  */
5157 char connect();
5158
5159 int main() {
5160 connect()
5161 ; return 0; }
5162 EOF
5163 if { (eval echo configure:5164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5164   rm -rf conftest*
5165   eval "ac_cv_lib_$ac_lib_var=yes"
5166 else
5167   echo "configure: failed program was:" >&5
5168   cat conftest.$ac_ext >&5
5169   rm -rf conftest*
5170   eval "ac_cv_lib_$ac_lib_var=no"
5171 fi
5172 rm -f conftest*
5173 xe_check_libs=""
5174
5175 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5176   echo "$ac_t""yes" 1>&6
5177   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5178 else
5179   echo "$ac_t""no" 1>&6
5180 fi
5181
5182
5183     fi
5184
5185     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5186     echo $ac_n "checking for remove""... $ac_c" 1>&6
5187 echo "configure:5188: checking for remove" >&5
5188
5189 cat > conftest.$ac_ext <<EOF
5190 #line 5191 "configure"
5191 #include "confdefs.h"
5192 /* System header to define __stub macros and hopefully few prototypes,
5193     which can conflict with char remove(); below.  */
5194 #include <assert.h>
5195 /* Override any gcc2 internal prototype to avoid an error.  */
5196 /* We use char because int might match the return type of a gcc2
5197     builtin and then its argument prototype would still apply.  */
5198 char remove();
5199
5200 int main() {
5201
5202 /* The GNU C library defines this for functions which it implements
5203     to always fail with ENOSYS.  Some functions are actually named
5204     something starting with __ and the normal name is an alias.  */
5205 #if defined (__stub_remove) || defined (__stub___remove)
5206 choke me
5207 #else
5208 remove();
5209 #endif
5210
5211 ; return 0; }
5212 EOF
5213 if { (eval echo configure:5214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5214   rm -rf conftest*
5215   eval "ac_cv_func_remove=yes"
5216 else
5217   echo "configure: failed program was:" >&5
5218   cat conftest.$ac_ext >&5
5219   rm -rf conftest*
5220   eval "ac_cv_func_remove=no"
5221 fi
5222 rm -f conftest*
5223
5224 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5225   echo "$ac_t""yes" 1>&6
5226   :
5227 else
5228   echo "$ac_t""no" 1>&6
5229 fi
5230
5231     if test $ac_cv_func_remove = no; then
5232       
5233 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5234 echo "configure:5235: checking for remove in -lposix" >&5
5235 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5236
5237 xe_check_libs=" -lposix "
5238 cat > conftest.$ac_ext <<EOF
5239 #line 5240 "configure"
5240 #include "confdefs.h"
5241 /* Override any gcc2 internal prototype to avoid an error.  */
5242 /* We use char because int might match the return type of a gcc2
5243     builtin and then its argument prototype would still apply.  */
5244 char remove();
5245
5246 int main() {
5247 remove()
5248 ; return 0; }
5249 EOF
5250 if { (eval echo configure:5251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5251   rm -rf conftest*
5252   eval "ac_cv_lib_$ac_lib_var=yes"
5253 else
5254   echo "configure: failed program was:" >&5
5255   cat conftest.$ac_ext >&5
5256   rm -rf conftest*
5257   eval "ac_cv_lib_$ac_lib_var=no"
5258 fi
5259 rm -f conftest*
5260 xe_check_libs=""
5261
5262 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5263   echo "$ac_t""yes" 1>&6
5264   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5265 else
5266   echo "$ac_t""no" 1>&6
5267 fi
5268
5269
5270     fi
5271
5272     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5273     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5274 echo "configure:5275: checking for shmat" >&5
5275
5276 cat > conftest.$ac_ext <<EOF
5277 #line 5278 "configure"
5278 #include "confdefs.h"
5279 /* System header to define __stub macros and hopefully few prototypes,
5280     which can conflict with char shmat(); below.  */
5281 #include <assert.h>
5282 /* Override any gcc2 internal prototype to avoid an error.  */
5283 /* We use char because int might match the return type of a gcc2
5284     builtin and then its argument prototype would still apply.  */
5285 char shmat();
5286
5287 int main() {
5288
5289 /* The GNU C library defines this for functions which it implements
5290     to always fail with ENOSYS.  Some functions are actually named
5291     something starting with __ and the normal name is an alias.  */
5292 #if defined (__stub_shmat) || defined (__stub___shmat)
5293 choke me
5294 #else
5295 shmat();
5296 #endif
5297
5298 ; return 0; }
5299 EOF
5300 if { (eval echo configure:5301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5301   rm -rf conftest*
5302   eval "ac_cv_func_shmat=yes"
5303 else
5304   echo "configure: failed program was:" >&5
5305   cat conftest.$ac_ext >&5
5306   rm -rf conftest*
5307   eval "ac_cv_func_shmat=no"
5308 fi
5309 rm -f conftest*
5310
5311 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5312   echo "$ac_t""yes" 1>&6
5313   :
5314 else
5315   echo "$ac_t""no" 1>&6
5316 fi
5317
5318     if test $ac_cv_func_shmat = no; then
5319       
5320 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5321 echo "configure:5322: checking for shmat in -lipc" >&5
5322 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5323
5324 xe_check_libs=" -lipc "
5325 cat > conftest.$ac_ext <<EOF
5326 #line 5327 "configure"
5327 #include "confdefs.h"
5328 /* Override any gcc2 internal prototype to avoid an error.  */
5329 /* We use char because int might match the return type of a gcc2
5330     builtin and then its argument prototype would still apply.  */
5331 char shmat();
5332
5333 int main() {
5334 shmat()
5335 ; return 0; }
5336 EOF
5337 if { (eval echo configure:5338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5338   rm -rf conftest*
5339   eval "ac_cv_lib_$ac_lib_var=yes"
5340 else
5341   echo "configure: failed program was:" >&5
5342   cat conftest.$ac_ext >&5
5343   rm -rf conftest*
5344   eval "ac_cv_lib_$ac_lib_var=no"
5345 fi
5346 rm -f conftest*
5347 xe_check_libs=""
5348
5349 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5350   echo "$ac_t""yes" 1>&6
5351   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5352 else
5353   echo "$ac_t""no" 1>&6
5354 fi
5355
5356
5357     fi
5358   fi
5359
5360   # Check for libraries that X11R6 Xt/Xaw programs need.
5361   ac_save_LDFLAGS="$LDFLAGS"
5362   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5363   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5364   # check for ICE first), but we must link in the order -lSM -lICE or
5365   # we get undefined symbols.  So assume we have SM if we have ICE.
5366   # These have to be linked with before -lX11, unlike the other
5367   # libraries we check for below, so use a different variable.
5368   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5369   
5370 xe_msg_checking="for IceConnectionNumber in -lICE"
5371 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5372 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5373 echo "configure:5374: checking "$xe_msg_checking"" >&5
5374 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5375
5376 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5377 cat > conftest.$ac_ext <<EOF
5378 #line 5379 "configure"
5379 #include "confdefs.h"
5380 /* Override any gcc2 internal prototype to avoid an error.  */
5381 /* We use char because int might match the return type of a gcc2
5382     builtin and then its argument prototype would still apply.  */
5383 char IceConnectionNumber();
5384
5385 int main() {
5386 IceConnectionNumber()
5387 ; return 0; }
5388 EOF
5389 if { (eval echo configure:5390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5390   rm -rf conftest*
5391   eval "ac_cv_lib_$ac_lib_var=yes"
5392 else
5393   echo "configure: failed program was:" >&5
5394   cat conftest.$ac_ext >&5
5395   rm -rf conftest*
5396   eval "ac_cv_lib_$ac_lib_var=no"
5397 fi
5398 rm -f conftest*
5399 xe_check_libs=""
5400
5401 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5402   echo "$ac_t""yes" 1>&6
5403   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5404 else
5405   echo "$ac_t""no" 1>&6
5406 fi
5407
5408
5409   LDFLAGS="$ac_save_LDFLAGS"
5410
5411 fi
5412  # Autoconf claims to find X library and include dirs for us.
5413   if test "$no_x" = "yes"
5414   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5415   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5416   fi
5417 fi
5418
5419 case "$with_x11" in
5420   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5421   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5422 esac
5423
5424 if test "$with_x11" = "yes"; then
5425   { test "$extra_verbose" = "yes" && cat << \EOF
5426     Defining HAVE_X_WINDOWS
5427 EOF
5428 cat >> confdefs.h <<\EOF
5429 #define HAVE_X_WINDOWS 1
5430 EOF
5431 }
5432
5433   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5434   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5435
5436       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5437     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5438     if test -d "$lib_dir" -a -d "$inc_dir"; then
5439       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5440         x_libraries="$lib_dir $x_libraries"
5441         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5442       esac
5443       case "$x_includes" in "$inc_dir"* ) ;; *)
5444         x_includes="$inc_dir $x_includes"
5445         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5446       esac
5447       break;       fi
5448   done
5449
5450     for rel in "X11R6" "X11R5" "X11R4"; do
5451     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5452     if test -d "$lib_dir" -a -d "$inc_dir"; then
5453       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5454         x_libraries="$x_libraries $lib_dir"
5455         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5456       esac
5457       case "$x_includes" in "$inc_dir"* ) ;; *)
5458         x_includes="$x_includes $inc_dir"
5459         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5460       esac
5461       break;     fi
5462   done
5463
5464     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
5465
5466   ld_switch_x_site="$X_LIBS"
5467
5468   
5469 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5470     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5471   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5472   
5473         runpath="" runpath_dirs=""
5474   if test -n "$LD_RUN_PATH"; then
5475     runpath="$LD_RUN_PATH"
5476   elif test "$GCC" = "yes"; then
5477         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5478     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5479     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5480     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5481       case "$arg" in P,* | -L* | -R* )
5482         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5483           {
5484 xe_runpath_dir="$dir"
5485   test "$xe_runpath_dir" != "/lib"     -a \
5486         "$xe_runpath_dir" != "/usr/lib" -a \
5487         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5488   eval "$xe_add_unique_runpath_dir"
5489 }
5490         done ;;
5491       esac
5492     done
5493     ld_switch_run="$ld_switch_run_save"
5494     rm -f conftest*
5495   else
5496         for arg in $ld_switch_site $ld_switch_x_site; do
5497       case "$arg" in -L*) {
5498 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5499   test "$xe_runpath_dir" != "/lib"     -a \
5500         "$xe_runpath_dir" != "/usr/lib" -a \
5501         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5502   eval "$xe_add_unique_runpath_dir"
5503 };; esac
5504     done
5505         if test "$opsys $need_motif" = "sol2 yes"; then
5506       xe_runpath_dir="/opt/SUNWdt/lib";
5507       eval "$xe_add_unique_runpath_dir";
5508     fi
5509   fi 
5510   if test -n "$runpath"; then
5511     ld_switch_run="${dash_r}${runpath}"
5512     
5513 if test "$GCC" = "yes"; then
5514   set x $ld_switch_run; shift; ld_switch_run=""
5515   while test -n "$1"; do
5516     case $1 in
5517       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5518       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5519       -Xlinker* ) ;;
5520       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5521     esac
5522     shift
5523   done
5524 fi
5525     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5526   fi
5527 fi
5528
5529
5530   if test "$extra_verbose" = "yes"; then
5531     echo; echo "X11 compilation variables:"
5532     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5533     echo
5534   fi
5535
5536             bitmapdirs=
5537   if test "$x_includes" != NONE; then
5538     for i in $x_includes; do
5539       if test -d "$i/bitmaps"; then
5540         bitmapdirs="$i/bitmaps:$bitmapdirs"
5541       fi
5542       if test -d "$i/X11/bitmaps"; then
5543         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5544       fi
5545     done
5546     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5547   fi
5548   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5549     Defining BITMAPDIR = "$bitmapdirs"
5550 EOF
5551 cat >> confdefs.h <<EOF
5552 #define BITMAPDIR "$bitmapdirs"
5553 EOF
5554 }
5555
5556
5557     echo "checking for X defines extracted by xmkmf" 1>&6
5558 echo "configure:5559: checking for X defines extracted by xmkmf" >&5
5559   rm -fr conftestdir
5560   if mkdir conftestdir; then
5561     cd conftestdir
5562     cat > Imakefile <<'EOF'
5563 xetest:
5564         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5565 EOF
5566     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5567       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5568       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5569     fi
5570     cd ..
5571     rm -fr conftestdir
5572     for word in $xmkmf_defines; do
5573       case "$word" in
5574         -D*=* ) ;;
5575         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5576               { test "$extra_verbose" = "yes" && cat << EOF
5577     Defining $word
5578 EOF
5579 cat >> confdefs.h <<EOF
5580 #define $word 1
5581 EOF
5582 }
5583  ;;
5584       esac
5585     done
5586   fi
5587
5588     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5589 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5590 echo "configure:5591: checking for X11/Intrinsic.h" >&5
5591
5592 cat > conftest.$ac_ext <<EOF
5593 #line 5594 "configure"
5594 #include "confdefs.h"
5595 #include <X11/Intrinsic.h>
5596 EOF
5597 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5598 { (eval echo configure:5599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5599 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5600 if test -z "$ac_err"; then
5601   rm -rf conftest*
5602   eval "ac_cv_header_$ac_safe=yes"
5603 else
5604   echo "$ac_err" >&5
5605   echo "configure: failed program was:" >&5
5606   cat conftest.$ac_ext >&5
5607   rm -rf conftest*
5608   eval "ac_cv_header_$ac_safe=no"
5609 fi
5610 rm -f conftest*
5611 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5612   echo "$ac_t""yes" 1>&6
5613   :
5614 else
5615   echo "$ac_t""no" 1>&6
5616 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5617 fi
5618
5619
5620       
5621 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5622 echo "configure:5623: checking for XOpenDisplay in -lX11" >&5
5623 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5624
5625 xe_check_libs=" -lX11 "
5626 cat > conftest.$ac_ext <<EOF
5627 #line 5628 "configure"
5628 #include "confdefs.h"
5629 /* Override any gcc2 internal prototype to avoid an error.  */
5630 /* We use char because int might match the return type of a gcc2
5631     builtin and then its argument prototype would still apply.  */
5632 char XOpenDisplay();
5633
5634 int main() {
5635 XOpenDisplay()
5636 ; return 0; }
5637 EOF
5638 if { (eval echo configure:5639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5639   rm -rf conftest*
5640   eval "ac_cv_lib_$ac_lib_var=yes"
5641 else
5642   echo "configure: failed program was:" >&5
5643   cat conftest.$ac_ext >&5
5644   rm -rf conftest*
5645   eval "ac_cv_lib_$ac_lib_var=no"
5646 fi
5647 rm -f conftest*
5648 xe_check_libs=""
5649
5650 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5651   echo "$ac_t""yes" 1>&6
5652   have_lib_x11=yes
5653 else
5654   echo "$ac_t""no" 1>&6
5655 fi
5656
5657
5658   if test "$have_lib_x11" != "yes"; then
5659     
5660 xe_msg_checking="for XGetFontProperty in -lX11"
5661 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5662 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5663 echo "configure:5664: checking "$xe_msg_checking"" >&5
5664 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5665
5666 xe_check_libs=" -lX11 -b i486-linuxaout"
5667 cat > conftest.$ac_ext <<EOF
5668 #line 5669 "configure"
5669 #include "confdefs.h"
5670 /* Override any gcc2 internal prototype to avoid an error.  */
5671 /* We use char because int might match the return type of a gcc2
5672     builtin and then its argument prototype would still apply.  */
5673 char XGetFontProperty();
5674
5675 int main() {
5676 XGetFontProperty()
5677 ; return 0; }
5678 EOF
5679 if { (eval echo configure:5680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5680   rm -rf conftest*
5681   eval "ac_cv_lib_$ac_lib_var=yes"
5682 else
5683   echo "configure: failed program was:" >&5
5684   cat conftest.$ac_ext >&5
5685   rm -rf conftest*
5686   eval "ac_cv_lib_$ac_lib_var=no"
5687 fi
5688 rm -f conftest*
5689 xe_check_libs=""
5690
5691 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5692   echo "$ac_t""yes" 1>&6
5693   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5694 else
5695   echo "$ac_t""no" 1>&6
5696 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5697 fi
5698
5699
5700   fi
5701   libs_x="-lX11"
5702   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5703
5704     
5705 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5706 echo "configure:5707: checking for XShapeSelectInput in -lXext" >&5
5707 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5708
5709 xe_check_libs=" -lXext "
5710 cat > conftest.$ac_ext <<EOF
5711 #line 5712 "configure"
5712 #include "confdefs.h"
5713 /* Override any gcc2 internal prototype to avoid an error.  */
5714 /* We use char because int might match the return type of a gcc2
5715     builtin and then its argument prototype would still apply.  */
5716 char XShapeSelectInput();
5717
5718 int main() {
5719 XShapeSelectInput()
5720 ; return 0; }
5721 EOF
5722 if { (eval echo configure:5723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5723   rm -rf conftest*
5724   eval "ac_cv_lib_$ac_lib_var=yes"
5725 else
5726   echo "configure: failed program was:" >&5
5727   cat conftest.$ac_ext >&5
5728   rm -rf conftest*
5729   eval "ac_cv_lib_$ac_lib_var=no"
5730 fi
5731 rm -f conftest*
5732 xe_check_libs=""
5733
5734 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5735   echo "$ac_t""yes" 1>&6
5736   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5737 else
5738   echo "$ac_t""no" 1>&6
5739 fi
5740
5741
5742
5743     
5744 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5745 echo "configure:5746: checking for XtOpenDisplay in -lXt" >&5
5746 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5747
5748 xe_check_libs=" -lXt "
5749 cat > conftest.$ac_ext <<EOF
5750 #line 5751 "configure"
5751 #include "confdefs.h"
5752 /* Override any gcc2 internal prototype to avoid an error.  */
5753 /* We use char because int might match the return type of a gcc2
5754     builtin and then its argument prototype would still apply.  */
5755 char XtOpenDisplay();
5756
5757 int main() {
5758 XtOpenDisplay()
5759 ; return 0; }
5760 EOF
5761 if { (eval echo configure:5762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5762   rm -rf conftest*
5763   eval "ac_cv_lib_$ac_lib_var=yes"
5764 else
5765   echo "configure: failed program was:" >&5
5766   cat conftest.$ac_ext >&5
5767   rm -rf conftest*
5768   eval "ac_cv_lib_$ac_lib_var=no"
5769 fi
5770 rm -f conftest*
5771 xe_check_libs=""
5772
5773 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5774   echo "$ac_t""yes" 1>&6
5775   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5776 else
5777   echo "$ac_t""no" 1>&6
5778 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5779 fi
5780
5781
5782
5783   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5784 echo "configure:5785: checking the version of X11 being used" >&5
5785   cat > conftest.$ac_ext <<EOF
5786 #line 5787 "configure"
5787 #include "confdefs.h"
5788 #include <X11/Intrinsic.h>
5789     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5790 EOF
5791 if { (eval echo configure:5792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5792 then
5793   ./conftest foobar; x11_release=$?
5794 else
5795   conftest_rc="$?"
5796   echo "configure: failed program was:" >&5
5797   cat conftest.$ac_ext >&5
5798   rm -fr conftest*
5799   x11_release=4
5800 fi
5801 rm -fr conftest*
5802   echo "$ac_t""R${x11_release}" 1>&6
5803   { test "$extra_verbose" = "yes" && cat << EOF
5804     Defining THIS_IS_X11R${x11_release}
5805 EOF
5806 cat >> confdefs.h <<EOF
5807 #define THIS_IS_X11R${x11_release} 1
5808 EOF
5809 }
5810
5811
5812   for ac_hdr in X11/Xlocale.h
5813 do
5814 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5815 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5816 echo "configure:5817: checking for $ac_hdr" >&5
5817
5818 cat > conftest.$ac_ext <<EOF
5819 #line 5820 "configure"
5820 #include "confdefs.h"
5821 #include <$ac_hdr>
5822 EOF
5823 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5824 { (eval echo configure:5825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5825 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5826 if test -z "$ac_err"; then
5827   rm -rf conftest*
5828   eval "ac_cv_header_$ac_safe=yes"
5829 else
5830   echo "$ac_err" >&5
5831   echo "configure: failed program was:" >&5
5832   cat conftest.$ac_ext >&5
5833   rm -rf conftest*
5834   eval "ac_cv_header_$ac_safe=no"
5835 fi
5836 rm -f conftest*
5837 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5838   echo "$ac_t""yes" 1>&6
5839     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5840   { test "$extra_verbose" = "yes" && cat << EOF
5841     Defining $ac_tr_hdr
5842 EOF
5843 cat >> confdefs.h <<EOF
5844 #define $ac_tr_hdr 1
5845 EOF
5846 }
5847  
5848 else
5849   echo "$ac_t""no" 1>&6
5850 fi
5851 done
5852
5853
5854     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5855 echo "configure:5856: checking for XFree86" >&5
5856   if test -d "/usr/X386/include" -o \
5857           -f "/etc/XF86Config"    -o \
5858           -f "/etc/X11/XF86Config" -o \
5859           -f "/usr/X11R6/lib/X11/XF86Config"; then
5860     echo "$ac_t""yes" 1>&6
5861     { test "$extra_verbose" = "yes" && cat << \EOF
5862     Defining HAVE_XFREE386
5863 EOF
5864 cat >> confdefs.h <<\EOF
5865 #define HAVE_XFREE386 1
5866 EOF
5867 }
5868
5869   else
5870     echo "$ac_t""no" 1>&6
5871   fi
5872
5873     test -z "$with_xmu" && { 
5874 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5875 echo "configure:5876: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5876 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5877
5878 xe_check_libs=" -lXmu "
5879 cat > conftest.$ac_ext <<EOF
5880 #line 5881 "configure"
5881 #include "confdefs.h"
5882 /* Override any gcc2 internal prototype to avoid an error.  */
5883 /* We use char because int might match the return type of a gcc2
5884     builtin and then its argument prototype would still apply.  */
5885 char XmuReadBitmapDataFromFile();
5886
5887 int main() {
5888 XmuReadBitmapDataFromFile()
5889 ; return 0; }
5890 EOF
5891 if { (eval echo configure:5892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5892   rm -rf conftest*
5893   eval "ac_cv_lib_$ac_lib_var=yes"
5894 else
5895   echo "configure: failed program was:" >&5
5896   cat conftest.$ac_ext >&5
5897   rm -rf conftest*
5898   eval "ac_cv_lib_$ac_lib_var=no"
5899 fi
5900 rm -f conftest*
5901 xe_check_libs=""
5902
5903 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5904   echo "$ac_t""yes" 1>&6
5905   with_xmu=yes
5906 else
5907   echo "$ac_t""no" 1>&6
5908 with_xmu=no
5909 fi
5910
5911  }
5912   if test "$with_xmu" = "no"; then
5913     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5914    echo "    xemacs will be linked with \"xmu.o\""
5915  fi
5916   else
5917     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5918     { test "$extra_verbose" = "yes" && cat << \EOF
5919     Defining HAVE_XMU
5920 EOF
5921 cat >> confdefs.h <<\EOF
5922 #define HAVE_XMU 1
5923 EOF
5924 }
5925
5926   fi
5927
5928       
5929 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5930 echo "configure:5931: checking for main in -lXbsd" >&5
5931 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5932
5933 xe_check_libs=" -lXbsd "
5934 cat > conftest.$ac_ext <<EOF
5935 #line 5936 "configure"
5936 #include "confdefs.h"
5937
5938 int main() {
5939 main()
5940 ; return 0; }
5941 EOF
5942 if { (eval echo configure:5943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5943   rm -rf conftest*
5944   eval "ac_cv_lib_$ac_lib_var=yes"
5945 else
5946   echo "configure: failed program was:" >&5
5947   cat conftest.$ac_ext >&5
5948   rm -rf conftest*
5949   eval "ac_cv_lib_$ac_lib_var=no"
5950 fi
5951 rm -f conftest*
5952 xe_check_libs=""
5953
5954 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5955   echo "$ac_t""yes" 1>&6
5956   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5957 else
5958   echo "$ac_t""no" 1>&6
5959 fi
5960
5961
5962
5963     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5964         if test "$GCC" = "yes"; then
5965       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5966       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5967     else
5968       case "$CC" in
5969         "xlc" ) CC="xlc_r" ;;
5970         "xlC" ) CC="xlC_r" ;;
5971         "cc"  ) CC="cc_r" ;;
5972       esac
5973     fi
5974   fi
5975
5976 fi 
5977 if test "$with_msw" != "no"; then
5978   echo "checking for MS-Windows" 1>&6
5979 echo "configure:5980: checking for MS-Windows" >&5
5980   
5981 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5982 echo "configure:5983: checking for main in -lgdi32" >&5
5983 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5984
5985 xe_check_libs=" -lgdi32 "
5986 cat > conftest.$ac_ext <<EOF
5987 #line 5988 "configure"
5988 #include "confdefs.h"
5989
5990 int main() {
5991 main()
5992 ; return 0; }
5993 EOF
5994 if { (eval echo configure:5995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5995   rm -rf conftest*
5996   eval "ac_cv_lib_$ac_lib_var=yes"
5997 else
5998   echo "configure: failed program was:" >&5
5999   cat conftest.$ac_ext >&5
6000   rm -rf conftest*
6001   eval "ac_cv_lib_$ac_lib_var=no"
6002 fi
6003 rm -f conftest*
6004 xe_check_libs=""
6005
6006 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6007   echo "$ac_t""yes" 1>&6
6008   with_msw=yes
6009 else
6010   echo "$ac_t""no" 1>&6
6011 fi
6012
6013
6014   if test "$with_msw" = "yes"; then
6015     { test "$extra_verbose" = "yes" && cat << \EOF
6016     Defining HAVE_MS_WINDOWS
6017 EOF
6018 cat >> confdefs.h <<\EOF
6019 #define HAVE_MS_WINDOWS 1
6020 EOF
6021 }
6022
6023     install_pp="$blddir/lib-src/installexe.sh"
6024     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
6025     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6026     if test "$window_system" != x11; then
6027         window_system=msw
6028         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6029             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6030    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6031  fi
6032         test "$with_menubars"   != "no" && with_menubars=msw \
6033             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6034    echo "    xemacs will be linked with \"menubar-msw.o\""
6035  fi
6036         test "$with_toolbars"   != "no" && with_toolbars=msw \
6037             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6038    echo "    xemacs will be linked with \"toolbar-msw.o\""
6039  fi
6040         test "$with_dialogs"   != "no" && with_dialogs=msw \
6041             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6042    echo "    xemacs will be linked with \"dialog-msw.o\""
6043  fi
6044     else
6045         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6046    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6047  fi
6048         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6049    echo "    xemacs will be linked with \"menubar-msw.o\""
6050  fi
6051         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6052    echo "    xemacs will be linked with \"toolbar-msw.o\""
6053  fi
6054         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6055    echo "    xemacs will be linked with \"dialog-msw.o\""
6056  fi
6057     fi
6058         cat > conftest.$ac_ext <<EOF
6059 #line 6060 "configure"
6060 #include "confdefs.h"
6061 #include <fcntl.h>
6062     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6063 EOF
6064 if { (eval echo configure:6065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6065 then
6066   { test "$extra_verbose" = "yes" && cat << \EOF
6067     Defining HAVE_MSG_SELECT
6068 EOF
6069 cat >> confdefs.h <<\EOF
6070 #define HAVE_MSG_SELECT 1
6071 EOF
6072 }
6073
6074 else
6075   conftest_rc="$?"
6076   echo "configure: failed program was:" >&5
6077   cat conftest.$ac_ext >&5
6078 fi
6079 rm -fr conftest*
6080     const_is_losing=no
6081     with_file_coding=yes
6082     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
6083    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\""
6084  fi
6085   fi
6086 fi
6087
6088
6089
6090 test -z "$window_system" && window_system="none"
6091
6092 if test "$window_system" = "none"; then
6093   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6094   do
6095     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6096        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6097     fi
6098     eval "with_${feature}=no"
6099   done
6100 else
6101   test -z "$with_toolbars" && with_toolbars=yes
6102 fi
6103
6104 if test "$with_msw" != "yes"; then
6105   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6106   do
6107     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6108        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6109     fi
6110     eval "with_${feature}=no"
6111   done
6112 else
6113   :
6114 fi
6115
6116 if test "$with_x11" != "yes"; then
6117             for feature in tooltalk cde offix wmcommand xim xmu
6118   do
6119     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6120        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6121     fi
6122     eval "with_${feature}=no"
6123   done
6124 fi
6125
6126 bitmapdir=
6127
6128 case "$window_system" in
6129   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6130   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6131   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6132 esac
6133
6134 case "$x_libraries" in *X11R4* )
6135   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6136   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6137 esac
6138
6139 echo "checking for WM_COMMAND option" 1>&6
6140 echo "configure:6141: checking for WM_COMMAND option" >&5;
6141 if test "$with_wmcommand" != "no"; then
6142   { test "$extra_verbose" = "yes" && cat << \EOF
6143     Defining HAVE_WMCOMMAND
6144 EOF
6145 cat >> confdefs.h <<\EOF
6146 #define HAVE_WMCOMMAND 1
6147 EOF
6148 }
6149
6150 fi
6151
6152 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6153 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6154 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6155 echo "configure:6156: checking for X11/Xauth.h" >&5
6156
6157 cat > conftest.$ac_ext <<EOF
6158 #line 6159 "configure"
6159 #include "confdefs.h"
6160 #include <X11/Xauth.h>
6161 EOF
6162 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6163 { (eval echo configure:6164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6164 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6165 if test -z "$ac_err"; then
6166   rm -rf conftest*
6167   eval "ac_cv_header_$ac_safe=yes"
6168 else
6169   echo "$ac_err" >&5
6170   echo "configure: failed program was:" >&5
6171   cat conftest.$ac_ext >&5
6172   rm -rf conftest*
6173   eval "ac_cv_header_$ac_safe=no"
6174 fi
6175 rm -f conftest*
6176 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6177   echo "$ac_t""yes" 1>&6
6178   :
6179 else
6180   echo "$ac_t""no" 1>&6
6181 with_xauth=no
6182 fi
6183  }
6184 test -z "$with_xauth" && { 
6185 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6186 echo "configure:6187: checking for XauGetAuthByAddr in -lXau" >&5
6187 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6188
6189 xe_check_libs=" -lXau "
6190 cat > conftest.$ac_ext <<EOF
6191 #line 6192 "configure"
6192 #include "confdefs.h"
6193 /* Override any gcc2 internal prototype to avoid an error.  */
6194 /* We use char because int might match the return type of a gcc2
6195     builtin and then its argument prototype would still apply.  */
6196 char XauGetAuthByAddr();
6197
6198 int main() {
6199 XauGetAuthByAddr()
6200 ; return 0; }
6201 EOF
6202 if { (eval echo configure:6203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6203   rm -rf conftest*
6204   eval "ac_cv_lib_$ac_lib_var=yes"
6205 else
6206   echo "configure: failed program was:" >&5
6207   cat conftest.$ac_ext >&5
6208   rm -rf conftest*
6209   eval "ac_cv_lib_$ac_lib_var=no"
6210 fi
6211 rm -f conftest*
6212 xe_check_libs=""
6213
6214 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6215   echo "$ac_t""yes" 1>&6
6216   :
6217 else
6218   echo "$ac_t""no" 1>&6
6219 with_xauth=no
6220 fi
6221
6222  }
6223 test -z "$with_xauth" && with_xauth=yes
6224 if test "$with_xauth" = "yes"; then
6225   { test "$extra_verbose" = "yes" && cat << \EOF
6226     Defining HAVE_XAUTH
6227 EOF
6228 cat >> confdefs.h <<\EOF
6229 #define HAVE_XAUTH 1
6230 EOF
6231 }
6232
6233   
6234 T=""
6235 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
6236 libs_xauth="$T"
6237
6238 fi
6239
6240
6241
6242
6243 if test "$with_tooltalk" != "no" ; then
6244       for dir in "" "Tt/" "desktop/" ; do
6245     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6246 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6247 echo "configure:6248: checking for ${dir}tt_c.h" >&5
6248
6249 cat > conftest.$ac_ext <<EOF
6250 #line 6251 "configure"
6251 #include "confdefs.h"
6252 #include <${dir}tt_c.h>
6253 EOF
6254 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6255 { (eval echo configure:6256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6256 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6257 if test -z "$ac_err"; then
6258   rm -rf conftest*
6259   eval "ac_cv_header_$ac_safe=yes"
6260 else
6261   echo "$ac_err" >&5
6262   echo "configure: failed program was:" >&5
6263   cat conftest.$ac_ext >&5
6264   rm -rf conftest*
6265   eval "ac_cv_header_$ac_safe=no"
6266 fi
6267 rm -f conftest*
6268 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6269   echo "$ac_t""yes" 1>&6
6270   tt_c_h_path="${dir}tt_c.h"; break
6271 else
6272   echo "$ac_t""no" 1>&6
6273 fi
6274
6275   done
6276   if test -z "$tt_c_h_path"; then
6277     if test "$with_tooltalk" = "yes"; then
6278       (echo "$progname: Usage error:"
6279 echo " " "Unable to find required tooltalk header files."
6280 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6281     fi
6282     with_tooltalk=no
6283   fi
6284 fi
6285 if test "$with_tooltalk" != "no" ; then
6286   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6287     
6288 xe_msg_checking="for tt_message_create in -ltt"
6289 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6290 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6291 echo "configure:6292: checking "$xe_msg_checking"" >&5
6292 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6293
6294 xe_check_libs=" -ltt $extra_libs"
6295 cat > conftest.$ac_ext <<EOF
6296 #line 6297 "configure"
6297 #include "confdefs.h"
6298 /* Override any gcc2 internal prototype to avoid an error.  */
6299 /* We use char because int might match the return type of a gcc2
6300     builtin and then its argument prototype would still apply.  */
6301 char tt_message_create();
6302
6303 int main() {
6304 tt_message_create()
6305 ; return 0; }
6306 EOF
6307 if { (eval echo configure:6308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6308   rm -rf conftest*
6309   eval "ac_cv_lib_$ac_lib_var=yes"
6310 else
6311   echo "configure: failed program was:" >&5
6312   cat conftest.$ac_ext >&5
6313   rm -rf conftest*
6314   eval "ac_cv_lib_$ac_lib_var=no"
6315 fi
6316 rm -f conftest*
6317 xe_check_libs=""
6318
6319 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6320   echo "$ac_t""yes" 1>&6
6321   tt_libs="-ltt $extra_libs"; break
6322 else
6323   echo "$ac_t""no" 1>&6
6324 :
6325 fi
6326
6327
6328   done
6329   if test -z "$tt_libs"; then
6330     if test "$with_tooltalk" = "yes"; then
6331       (echo "$progname: Usage error:"
6332 echo " " "Unable to find required tooltalk libraries."
6333 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6334     fi
6335     with_tooltalk=no
6336   fi
6337 fi
6338 test -z "$with_tooltalk" && with_tooltalk=yes
6339 if test "$with_tooltalk" = "yes"; then
6340   { test "$extra_verbose" = "yes" && cat << \EOF
6341     Defining TOOLTALK
6342 EOF
6343 cat >> confdefs.h <<\EOF
6344 #define TOOLTALK 1
6345 EOF
6346 }
6347
6348   { test "$extra_verbose" = "yes" && cat << EOF
6349     Defining TT_C_H_PATH = "$tt_c_h_path"
6350 EOF
6351 cat >> confdefs.h <<EOF
6352 #define TT_C_H_PATH "$tt_c_h_path"
6353 EOF
6354 }
6355
6356   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6357   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6358    echo "    xemacs will be linked with \"tooltalk.o\""
6359  fi
6360 fi
6361
6362 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6363 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6364 echo "configure:6365: checking for Dt/Dt.h" >&5
6365
6366 cat > conftest.$ac_ext <<EOF
6367 #line 6368 "configure"
6368 #include "confdefs.h"
6369 #include <Dt/Dt.h>
6370 EOF
6371 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6372 { (eval echo configure:6373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6373 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6374 if test -z "$ac_err"; then
6375   rm -rf conftest*
6376   eval "ac_cv_header_$ac_safe=yes"
6377 else
6378   echo "$ac_err" >&5
6379   echo "configure: failed program was:" >&5
6380   cat conftest.$ac_ext >&5
6381   rm -rf conftest*
6382   eval "ac_cv_header_$ac_safe=no"
6383 fi
6384 rm -f conftest*
6385 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6386   echo "$ac_t""yes" 1>&6
6387   :
6388 else
6389   echo "$ac_t""no" 1>&6
6390 with_cde=no
6391 fi
6392  }
6393 test -z "$with_cde" && { 
6394 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6395 echo "configure:6396: checking for DtDndDragStart in -lDtSvc" >&5
6396 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6397
6398 xe_check_libs=" -lDtSvc "
6399 cat > conftest.$ac_ext <<EOF
6400 #line 6401 "configure"
6401 #include "confdefs.h"
6402 /* Override any gcc2 internal prototype to avoid an error.  */
6403 /* We use char because int might match the return type of a gcc2
6404     builtin and then its argument prototype would still apply.  */
6405 char DtDndDragStart();
6406
6407 int main() {
6408 DtDndDragStart()
6409 ; return 0; }
6410 EOF
6411 if { (eval echo configure:6412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6412   rm -rf conftest*
6413   eval "ac_cv_lib_$ac_lib_var=yes"
6414 else
6415   echo "configure: failed program was:" >&5
6416   cat conftest.$ac_ext >&5
6417   rm -rf conftest*
6418   eval "ac_cv_lib_$ac_lib_var=no"
6419 fi
6420 rm -f conftest*
6421 xe_check_libs=""
6422
6423 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6424   echo "$ac_t""yes" 1>&6
6425   :
6426 else
6427   echo "$ac_t""no" 1>&6
6428 with_cde=no
6429 fi
6430
6431  }
6432 test -z "$with_cde" && with_cde=yes
6433 if test "$with_dragndrop" = no; then
6434   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6435   with_cde=no
6436 fi
6437 if test "$with_cde" = "yes" ; then
6438   { test "$extra_verbose" = "yes" && cat << \EOF
6439     Defining HAVE_CDE
6440 EOF
6441 cat >> confdefs.h <<\EOF
6442 #define HAVE_CDE 1
6443 EOF
6444 }
6445
6446   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6447   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6448   with_tooltalk=yes # CDE requires Tooltalk
6449   need_motif=yes    # CDE requires Motif
6450 fi
6451
6452 test "$window_system" != "x11" && with_offix=no
6453 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6454   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6455   with_offix=no
6456 fi
6457 if test "$with_dragndrop" = no; then
6458   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6459   with_offix=no
6460 fi
6461 if test "$with_cde" = yes; then
6462   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6463   with_offix=no
6464 fi
6465 test -z "$with_offix" && with_offix=no
6466 if test "$with_offix" = "yes"; then
6467   { test "$extra_verbose" = "yes" && cat << \EOF
6468     Defining HAVE_OFFIX_DND
6469 EOF
6470 cat >> confdefs.h <<\EOF
6471 #define HAVE_OFFIX_DND 1
6472 EOF
6473 }
6474
6475   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6476   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6477 fi
6478
6479 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6480 echo "configure:6481: checking if drag and drop API is needed" >&5
6481 if test "$with_dragndrop" != "no" ; then
6482   if test -n "$dragndrop_proto" ; then
6483     with_dragndrop=yes
6484     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6485     { test "$extra_verbose" = "yes" && cat << \EOF
6486     Defining HAVE_DRAGNDROP
6487 EOF
6488 cat >> confdefs.h <<\EOF
6489 #define HAVE_DRAGNDROP 1
6490 EOF
6491 }
6492
6493     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6494   else
6495     with_dragndrop=no
6496     echo "$ac_t""no" 1>&6
6497   fi
6498 fi
6499
6500 echo "checking for LDAP" 1>&6
6501 echo "configure:6502: checking for LDAP" >&5
6502 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6503 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6504 echo "configure:6505: checking for ldap.h" >&5
6505
6506 cat > conftest.$ac_ext <<EOF
6507 #line 6508 "configure"
6508 #include "confdefs.h"
6509 #include <ldap.h>
6510 EOF
6511 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6512 { (eval echo configure:6513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6513 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6514 if test -z "$ac_err"; then
6515   rm -rf conftest*
6516   eval "ac_cv_header_$ac_safe=yes"
6517 else
6518   echo "$ac_err" >&5
6519   echo "configure: failed program was:" >&5
6520   cat conftest.$ac_ext >&5
6521   rm -rf conftest*
6522   eval "ac_cv_header_$ac_safe=no"
6523 fi
6524 rm -f conftest*
6525 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6526   echo "$ac_t""yes" 1>&6
6527   :
6528 else
6529   echo "$ac_t""no" 1>&6
6530 with_ldap=no
6531 fi
6532  }
6533 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6534 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6535 echo "configure:6536: checking for lber.h" >&5
6536
6537 cat > conftest.$ac_ext <<EOF
6538 #line 6539 "configure"
6539 #include "confdefs.h"
6540 #include <lber.h>
6541 EOF
6542 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6543 { (eval echo configure:6544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6544 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6545 if test -z "$ac_err"; then
6546   rm -rf conftest*
6547   eval "ac_cv_header_$ac_safe=yes"
6548 else
6549   echo "$ac_err" >&5
6550   echo "configure: failed program was:" >&5
6551   cat conftest.$ac_ext >&5
6552   rm -rf conftest*
6553   eval "ac_cv_header_$ac_safe=no"
6554 fi
6555 rm -f conftest*
6556 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6557   echo "$ac_t""yes" 1>&6
6558   :
6559 else
6560   echo "$ac_t""no" 1>&6
6561 with_ldap=no
6562 fi
6563  }
6564 if test "$with_ldap" != "no"; then
6565   test -z "$with_umich_ldap" && { 
6566 xe_msg_checking="for ldap_open in -lldap"
6567 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6568 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6569 echo "configure:6570: checking "$xe_msg_checking"" >&5
6570 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6571
6572 xe_check_libs=" -lldap -llber"
6573 cat > conftest.$ac_ext <<EOF
6574 #line 6575 "configure"
6575 #include "confdefs.h"
6576 /* Override any gcc2 internal prototype to avoid an error.  */
6577 /* We use char because int might match the return type of a gcc2
6578     builtin and then its argument prototype would still apply.  */
6579 char ldap_open();
6580
6581 int main() {
6582 ldap_open()
6583 ; return 0; }
6584 EOF
6585 if { (eval echo configure:6586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6586   rm -rf conftest*
6587   eval "ac_cv_lib_$ac_lib_var=yes"
6588 else
6589   echo "configure: failed program was:" >&5
6590   cat conftest.$ac_ext >&5
6591   rm -rf conftest*
6592   eval "ac_cv_lib_$ac_lib_var=no"
6593 fi
6594 rm -f conftest*
6595 xe_check_libs=""
6596
6597 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6598   echo "$ac_t""yes" 1>&6
6599   with_umich_ldap=yes
6600 else
6601   echo "$ac_t""no" 1>&6
6602 with_umich_ldap=no
6603 fi
6604
6605  }
6606   test "$with_umich_ldap" = "no" && { 
6607 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6608 echo "configure:6609: checking for ldap_set_option in -lldap10" >&5
6609 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6610
6611 xe_check_libs=" -lldap10 "
6612 cat > conftest.$ac_ext <<EOF
6613 #line 6614 "configure"
6614 #include "confdefs.h"
6615 /* Override any gcc2 internal prototype to avoid an error.  */
6616 /* We use char because int might match the return type of a gcc2
6617     builtin and then its argument prototype would still apply.  */
6618 char ldap_set_option();
6619
6620 int main() {
6621 ldap_set_option()
6622 ; return 0; }
6623 EOF
6624 if { (eval echo configure:6625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6625   rm -rf conftest*
6626   eval "ac_cv_lib_$ac_lib_var=yes"
6627 else
6628   echo "configure: failed program was:" >&5
6629   cat conftest.$ac_ext >&5
6630   rm -rf conftest*
6631   eval "ac_cv_lib_$ac_lib_var=no"
6632 fi
6633 rm -f conftest*
6634 xe_check_libs=""
6635
6636 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6637   echo "$ac_t""yes" 1>&6
6638   with_ns_ldap=yes
6639 else
6640   echo "$ac_t""no" 1>&6
6641 with_ns_ldap=no
6642 fi
6643
6644  }
6645   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6646 fi
6647 if test "$with_ldap" = "yes"; then
6648   { test "$extra_verbose" = "yes" && cat << \EOF
6649     Defining HAVE_LDAP
6650 EOF
6651 cat >> confdefs.h <<\EOF
6652 #define HAVE_LDAP 1
6653 EOF
6654 }
6655
6656   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6657    echo "    xemacs will be linked with \"eldap.o\""
6658  fi
6659   if test "$with_umich_ldap" = "yes" ; then
6660     { test "$extra_verbose" = "yes" && cat << \EOF
6661     Defining HAVE_UMICH_LDAP
6662 EOF
6663 cat >> confdefs.h <<\EOF
6664 #define HAVE_UMICH_LDAP 1
6665 EOF
6666 }
6667
6668     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6669     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6670   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6671     { test "$extra_verbose" = "yes" && cat << \EOF
6672     Defining HAVE_NS_LDAP
6673 EOF
6674 cat >> confdefs.h <<\EOF
6675 #define HAVE_NS_LDAP 1
6676 EOF
6677 }
6678
6679     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6680   elif test "$with_ldap" = "yes" ; then
6681     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6682   fi
6683 fi
6684
6685
6686 if test "$window_system" != "none"; then
6687   echo "checking for graphics libraries" 1>&6
6688 echo "configure:6689: checking for graphics libraries" >&5
6689
6690     xpm_problem=""
6691   if test -z "$with_xpm"; then
6692     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6693 echo "configure:6694: checking for Xpm - no older than 3.4f" >&5
6694     xe_check_libs=-lXpm
6695     cat > conftest.$ac_ext <<EOF
6696 #line 6697 "configure"
6697 #include "confdefs.h"
6698 #include <X11/xpm.h>
6699     int main(int c, char **v) {
6700     return c == 1 ? 0 :
6701       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6702       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6703 EOF
6704 if { (eval echo configure:6705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6705 then
6706   ./conftest dummy_arg; xpm_status=$?;
6707       if test "$xpm_status" = "0"; then
6708         with_xpm=yes;
6709       else
6710         with_xpm=no;
6711         if test "$xpm_status" = "1"; then
6712           xpm_problem="Xpm library version and header file version don't match!"
6713         elif test "$xpm_status" = "2"; then
6714           xpm_problem="Xpm library version is too old!"
6715         else
6716           xpm_problem="Internal xpm detection logic error!"
6717         fi
6718         echo "
6719 *** WARNING *** $xpm_problem
6720   I'm not touching that with a 10-foot pole!
6721   If you really want to use the installed version of Xpm, rerun
6722   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6723     fi
6724 else
6725   conftest_rc="$?"
6726   echo "configure: failed program was:" >&5
6727   cat conftest.$ac_ext >&5
6728   rm -fr conftest*
6729   with_xpm=no
6730 fi
6731 rm -fr conftest*
6732     xe_check_libs=
6733     echo "$ac_t""$with_xpm" 1>&6
6734   fi
6735   if test "$with_xpm" = "yes"; then
6736     { test "$extra_verbose" = "yes" && cat << \EOF
6737     Defining HAVE_XPM
6738 EOF
6739 cat >> confdefs.h <<\EOF
6740 #define HAVE_XPM 1
6741 EOF
6742 }
6743
6744     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6745     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6746 echo "configure:6747: checking for \"FOR_MSW\" xpm" >&5
6747     xe_check_libs=-lXpm
6748     cat > conftest.$ac_ext <<EOF
6749 #line 6750 "configure"
6750 #include "confdefs.h"
6751
6752 int main() {
6753 XpmCreatePixmapFromData()
6754 ; return 0; }
6755 EOF
6756 if { (eval echo configure:6757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6757   rm -rf conftest*
6758   xpm_for_msw=no
6759 else
6760   echo "configure: failed program was:" >&5
6761   cat conftest.$ac_ext >&5
6762   rm -rf conftest*
6763   xpm_for_msw=yes
6764 fi
6765 rm -f conftest*
6766     xe_check_libs=
6767     echo "$ac_t""$xpm_for_msw" 1>&6
6768     if test "$xpm_for_msw" = "yes"; then
6769       { test "$extra_verbose" = "yes" && cat << \EOF
6770     Defining FOR_MSW
6771 EOF
6772 cat >> confdefs.h <<\EOF
6773 #define FOR_MSW 1
6774 EOF
6775 }
6776
6777     fi
6778   fi
6779
6780     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6781 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6782 echo "configure:6783: checking for compface.h" >&5
6783
6784 cat > conftest.$ac_ext <<EOF
6785 #line 6786 "configure"
6786 #include "confdefs.h"
6787 #include <compface.h>
6788 EOF
6789 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6790 { (eval echo configure:6791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6791 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6792 if test -z "$ac_err"; then
6793   rm -rf conftest*
6794   eval "ac_cv_header_$ac_safe=yes"
6795 else
6796   echo "$ac_err" >&5
6797   echo "configure: failed program was:" >&5
6798   cat conftest.$ac_ext >&5
6799   rm -rf conftest*
6800   eval "ac_cv_header_$ac_safe=no"
6801 fi
6802 rm -f conftest*
6803 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6804   echo "$ac_t""yes" 1>&6
6805   :
6806 else
6807   echo "$ac_t""no" 1>&6
6808 with_xface=no
6809 fi
6810  }
6811   test -z "$with_xface" && { 
6812 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6813 echo "configure:6814: checking for UnGenFace in -lcompface" >&5
6814 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6815
6816 xe_check_libs=" -lcompface "
6817 cat > conftest.$ac_ext <<EOF
6818 #line 6819 "configure"
6819 #include "confdefs.h"
6820 /* Override any gcc2 internal prototype to avoid an error.  */
6821 /* We use char because int might match the return type of a gcc2
6822     builtin and then its argument prototype would still apply.  */
6823 char UnGenFace();
6824
6825 int main() {
6826 UnGenFace()
6827 ; return 0; }
6828 EOF
6829 if { (eval echo configure:6830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6830   rm -rf conftest*
6831   eval "ac_cv_lib_$ac_lib_var=yes"
6832 else
6833   echo "configure: failed program was:" >&5
6834   cat conftest.$ac_ext >&5
6835   rm -rf conftest*
6836   eval "ac_cv_lib_$ac_lib_var=no"
6837 fi
6838 rm -f conftest*
6839 xe_check_libs=""
6840
6841 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6842   echo "$ac_t""yes" 1>&6
6843   : 
6844 else
6845   echo "$ac_t""no" 1>&6
6846 with_xface=no
6847 fi
6848
6849  }
6850   test -z "$with_xface" && with_xface=yes
6851   if test "$with_xface" = "yes"; then
6852     { test "$extra_verbose" = "yes" && cat << \EOF
6853     Defining HAVE_XFACE
6854 EOF
6855 cat >> confdefs.h <<\EOF
6856 #define HAVE_XFACE 1
6857 EOF
6858 }
6859
6860     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
6861   fi
6862
6863         if test "$with_gif" != "no"; then
6864     with_gif="yes"
6865     { test "$extra_verbose" = "yes" && cat << \EOF
6866     Defining HAVE_GIF
6867 EOF
6868 cat >> confdefs.h <<\EOF
6869 #define HAVE_GIF 1
6870 EOF
6871 }
6872
6873     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6874    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6875  fi
6876   fi
6877
6878       if test "$with_png $with_tiff" != "no no"; then
6879     
6880 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6881 echo "configure:6882: checking for inflate in -lc" >&5
6882 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6883
6884 xe_check_libs=" -lc "
6885 cat > conftest.$ac_ext <<EOF
6886 #line 6887 "configure"
6887 #include "confdefs.h"
6888 /* Override any gcc2 internal prototype to avoid an error.  */
6889 /* We use char because int might match the return type of a gcc2
6890     builtin and then its argument prototype would still apply.  */
6891 char inflate();
6892
6893 int main() {
6894 inflate()
6895 ; return 0; }
6896 EOF
6897 if { (eval echo configure:6898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6898   rm -rf conftest*
6899   eval "ac_cv_lib_$ac_lib_var=yes"
6900 else
6901   echo "configure: failed program was:" >&5
6902   cat conftest.$ac_ext >&5
6903   rm -rf conftest*
6904   eval "ac_cv_lib_$ac_lib_var=no"
6905 fi
6906 rm -f conftest*
6907 xe_check_libs=""
6908
6909 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6910   echo "$ac_t""yes" 1>&6
6911   :
6912 else
6913   echo "$ac_t""no" 1>&6
6914
6915 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6916 echo "configure:6917: checking for inflate in -lz" >&5
6917 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6918
6919 xe_check_libs=" -lz "
6920 cat > conftest.$ac_ext <<EOF
6921 #line 6922 "configure"
6922 #include "confdefs.h"
6923 /* Override any gcc2 internal prototype to avoid an error.  */
6924 /* We use char because int might match the return type of a gcc2
6925     builtin and then its argument prototype would still apply.  */
6926 char inflate();
6927
6928 int main() {
6929 inflate()
6930 ; return 0; }
6931 EOF
6932 if { (eval echo configure:6933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6933   rm -rf conftest*
6934   eval "ac_cv_lib_$ac_lib_var=yes"
6935 else
6936   echo "configure: failed program was:" >&5
6937   cat conftest.$ac_ext >&5
6938   rm -rf conftest*
6939   eval "ac_cv_lib_$ac_lib_var=no"
6940 fi
6941 rm -f conftest*
6942 xe_check_libs=""
6943
6944 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6945   echo "$ac_t""yes" 1>&6
6946   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6947 else
6948   echo "$ac_t""no" 1>&6
6949
6950 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6951 echo "configure:6952: checking for inflate in -lgz" >&5
6952 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6953
6954 xe_check_libs=" -lgz "
6955 cat > conftest.$ac_ext <<EOF
6956 #line 6957 "configure"
6957 #include "confdefs.h"
6958 /* Override any gcc2 internal prototype to avoid an error.  */
6959 /* We use char because int might match the return type of a gcc2
6960     builtin and then its argument prototype would still apply.  */
6961 char inflate();
6962
6963 int main() {
6964 inflate()
6965 ; return 0; }
6966 EOF
6967 if { (eval echo configure:6968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6968   rm -rf conftest*
6969   eval "ac_cv_lib_$ac_lib_var=yes"
6970 else
6971   echo "configure: failed program was:" >&5
6972   cat conftest.$ac_ext >&5
6973   rm -rf conftest*
6974   eval "ac_cv_lib_$ac_lib_var=no"
6975 fi
6976 rm -f conftest*
6977 xe_check_libs=""
6978
6979 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6980   echo "$ac_t""yes" 1>&6
6981   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6982 else
6983   echo "$ac_t""no" 1>&6
6984 fi
6985
6986
6987 fi
6988
6989
6990 fi
6991
6992
6993   fi
6994
6995     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6996 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6997 echo "configure:6998: checking for jpeglib.h" >&5
6998
6999 cat > conftest.$ac_ext <<EOF
7000 #line 7001 "configure"
7001 #include "confdefs.h"
7002 #include <jpeglib.h>
7003 EOF
7004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7005 { (eval echo configure:7006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7006 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7007 if test -z "$ac_err"; then
7008   rm -rf conftest*
7009   eval "ac_cv_header_$ac_safe=yes"
7010 else
7011   echo "$ac_err" >&5
7012   echo "configure: failed program was:" >&5
7013   cat conftest.$ac_ext >&5
7014   rm -rf conftest*
7015   eval "ac_cv_header_$ac_safe=no"
7016 fi
7017 rm -f conftest*
7018 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7019   echo "$ac_t""yes" 1>&6
7020   :
7021 else
7022   echo "$ac_t""no" 1>&6
7023 with_jpeg=no
7024 fi
7025  }
7026   test -z "$with_jpeg" && { 
7027 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7028 echo "configure:7029: checking for jpeg_destroy_decompress in -ljpeg" >&5
7029 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7030
7031 xe_check_libs=" -ljpeg "
7032 cat > conftest.$ac_ext <<EOF
7033 #line 7034 "configure"
7034 #include "confdefs.h"
7035 /* Override any gcc2 internal prototype to avoid an error.  */
7036 /* We use char because int might match the return type of a gcc2
7037     builtin and then its argument prototype would still apply.  */
7038 char jpeg_destroy_decompress();
7039
7040 int main() {
7041 jpeg_destroy_decompress()
7042 ; return 0; }
7043 EOF
7044 if { (eval echo configure:7045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7045   rm -rf conftest*
7046   eval "ac_cv_lib_$ac_lib_var=yes"
7047 else
7048   echo "configure: failed program was:" >&5
7049   cat conftest.$ac_ext >&5
7050   rm -rf conftest*
7051   eval "ac_cv_lib_$ac_lib_var=no"
7052 fi
7053 rm -f conftest*
7054 xe_check_libs=""
7055
7056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7057   echo "$ac_t""yes" 1>&6
7058   :
7059 else
7060   echo "$ac_t""no" 1>&6
7061 with_jpeg=no
7062 fi
7063
7064  }
7065   test -z "$with_jpeg" && with_jpeg=yes
7066   if test "$with_jpeg" = "yes"; then
7067     { test "$extra_verbose" = "yes" && cat << \EOF
7068     Defining HAVE_JPEG
7069 EOF
7070 cat >> confdefs.h <<\EOF
7071 #define HAVE_JPEG 1
7072 EOF
7073 }
7074
7075     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7076   fi
7077
7078     png_problem=""
7079   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7080 echo "configure:7081: checking for pow" >&5
7081
7082 cat > conftest.$ac_ext <<EOF
7083 #line 7084 "configure"
7084 #include "confdefs.h"
7085 /* System header to define __stub macros and hopefully few prototypes,
7086     which can conflict with char pow(); below.  */
7087 #include <assert.h>
7088 /* Override any gcc2 internal prototype to avoid an error.  */
7089 /* We use char because int might match the return type of a gcc2
7090     builtin and then its argument prototype would still apply.  */
7091 char pow();
7092
7093 int main() {
7094
7095 /* The GNU C library defines this for functions which it implements
7096     to always fail with ENOSYS.  Some functions are actually named
7097     something starting with __ and the normal name is an alias.  */
7098 #if defined (__stub_pow) || defined (__stub___pow)
7099 choke me
7100 #else
7101 pow();
7102 #endif
7103
7104 ; return 0; }
7105 EOF
7106 if { (eval echo configure:7107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7107   rm -rf conftest*
7108   eval "ac_cv_func_pow=yes"
7109 else
7110   echo "configure: failed program was:" >&5
7111   cat conftest.$ac_ext >&5
7112   rm -rf conftest*
7113   eval "ac_cv_func_pow=no"
7114 fi
7115 rm -f conftest*
7116
7117 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7118   echo "$ac_t""yes" 1>&6
7119   :
7120 else
7121   echo "$ac_t""no" 1>&6
7122 with_png=no
7123 fi
7124  }
7125   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7126 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7127 echo "configure:7128: checking for png.h" >&5
7128
7129 cat > conftest.$ac_ext <<EOF
7130 #line 7131 "configure"
7131 #include "confdefs.h"
7132 #include <png.h>
7133 EOF
7134 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7135 { (eval echo configure:7136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7136 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7137 if test -z "$ac_err"; then
7138   rm -rf conftest*
7139   eval "ac_cv_header_$ac_safe=yes"
7140 else
7141   echo "$ac_err" >&5
7142   echo "configure: failed program was:" >&5
7143   cat conftest.$ac_ext >&5
7144   rm -rf conftest*
7145   eval "ac_cv_header_$ac_safe=no"
7146 fi
7147 rm -f conftest*
7148 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7149   echo "$ac_t""yes" 1>&6
7150   :
7151 else
7152   echo "$ac_t""no" 1>&6
7153 with_png=no
7154 fi
7155  }
7156   test -z "$with_png" && { 
7157 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7158 echo "configure:7159: checking for png_read_image in -lpng" >&5
7159 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7160
7161 xe_check_libs=" -lpng "
7162 cat > conftest.$ac_ext <<EOF
7163 #line 7164 "configure"
7164 #include "confdefs.h"
7165 /* Override any gcc2 internal prototype to avoid an error.  */
7166 /* We use char because int might match the return type of a gcc2
7167     builtin and then its argument prototype would still apply.  */
7168 char png_read_image();
7169
7170 int main() {
7171 png_read_image()
7172 ; return 0; }
7173 EOF
7174 if { (eval echo configure:7175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7175   rm -rf conftest*
7176   eval "ac_cv_lib_$ac_lib_var=yes"
7177 else
7178   echo "configure: failed program was:" >&5
7179   cat conftest.$ac_ext >&5
7180   rm -rf conftest*
7181   eval "ac_cv_lib_$ac_lib_var=no"
7182 fi
7183 rm -f conftest*
7184 xe_check_libs=""
7185
7186 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7187   echo "$ac_t""yes" 1>&6
7188   :
7189 else
7190   echo "$ac_t""no" 1>&6
7191 with_png=no
7192 fi
7193
7194  }
7195   if test -z "$with_png"; then
7196     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7197 echo "configure:7198: checking for workable png version information" >&5
7198     xe_check_libs="-lpng -lz"
7199     cat > conftest.$ac_ext <<EOF
7200 #line 7201 "configure"
7201 #include "confdefs.h"
7202 #include <png.h>
7203     int main(int c, char **v) {
7204     if (c == 1) return 0;
7205     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7206     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7207 EOF
7208 if { (eval echo configure:7209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7209 then
7210   ./conftest dummy_arg; png_status=$?;
7211       if test "$png_status" = "0"; then
7212         with_png=yes;
7213       else
7214         with_png=no;
7215         if test "$png_status" = "1"; then
7216           png_problem="PNG library version and header file don't match!"
7217         elif test "$png_status" = "2"; then
7218           png_problem="PNG library version too old (pre 1.0.2)!"
7219         fi
7220         echo "
7221 *** WARNING *** $png_problem
7222   I'm not touching that with a 10-foot pole!
7223   If you really want to use the installed version of libPNG, rerun
7224   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7225     fi
7226 else
7227   conftest_rc="$?"
7228   echo "configure: failed program was:" >&5
7229   cat conftest.$ac_ext >&5
7230   rm -fr conftest*
7231   with_png=no
7232 fi
7233 rm -fr conftest*
7234     xe_check_libs=
7235     echo "$ac_t""$with_png" 1>&6
7236   fi
7237   if test "$with_png" = "yes"; then
7238     { test "$extra_verbose" = "yes" && cat << \EOF
7239     Defining HAVE_PNG
7240 EOF
7241 cat >> confdefs.h <<\EOF
7242 #define HAVE_PNG 1
7243 EOF
7244 }
7245
7246     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7247   fi
7248
7249     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7250 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7251 echo "configure:7252: checking for tiffio.h" >&5
7252
7253 cat > conftest.$ac_ext <<EOF
7254 #line 7255 "configure"
7255 #include "confdefs.h"
7256 #include <tiffio.h>
7257 EOF
7258 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7259 { (eval echo configure:7260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7260 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7261 if test -z "$ac_err"; then
7262   rm -rf conftest*
7263   eval "ac_cv_header_$ac_safe=yes"
7264 else
7265   echo "$ac_err" >&5
7266   echo "configure: failed program was:" >&5
7267   cat conftest.$ac_ext >&5
7268   rm -rf conftest*
7269   eval "ac_cv_header_$ac_safe=no"
7270 fi
7271 rm -f conftest*
7272 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7273   echo "$ac_t""yes" 1>&6
7274   :
7275 else
7276   echo "$ac_t""no" 1>&6
7277 with_tiff=no
7278 fi
7279  }
7280   test -z "$with_tiff" && { 
7281 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7282 echo "configure:7283: checking for TIFFClientOpen in -ltiff" >&5
7283 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7284
7285 xe_check_libs=" -ltiff "
7286 cat > conftest.$ac_ext <<EOF
7287 #line 7288 "configure"
7288 #include "confdefs.h"
7289 /* Override any gcc2 internal prototype to avoid an error.  */
7290 /* We use char because int might match the return type of a gcc2
7291     builtin and then its argument prototype would still apply.  */
7292 char TIFFClientOpen();
7293
7294 int main() {
7295 TIFFClientOpen()
7296 ; return 0; }
7297 EOF
7298 if { (eval echo configure:7299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7299   rm -rf conftest*
7300   eval "ac_cv_lib_$ac_lib_var=yes"
7301 else
7302   echo "configure: failed program was:" >&5
7303   cat conftest.$ac_ext >&5
7304   rm -rf conftest*
7305   eval "ac_cv_lib_$ac_lib_var=no"
7306 fi
7307 rm -f conftest*
7308 xe_check_libs=""
7309
7310 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7311   echo "$ac_t""yes" 1>&6
7312   :
7313 else
7314   echo "$ac_t""no" 1>&6
7315 with_tiff=no
7316 fi
7317
7318  }
7319   test -z "$with_tiff" && with_tiff=yes
7320   if test "$with_tiff" = "yes"; then
7321     { test "$extra_verbose" = "yes" && cat << \EOF
7322     Defining HAVE_TIFF
7323 EOF
7324 cat >> confdefs.h <<\EOF
7325 #define HAVE_TIFF 1
7326 EOF
7327 }
7328
7329     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7330   fi
7331 fi
7332
7333
7334 if test "$with_x11" = "yes"; then
7335
7336   echo "checking for X11 graphics libraries" 1>&6
7337 echo "configure:7338: checking for X11 graphics libraries" >&5
7338
7339     
7340 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7341 echo "configure:7342: checking for XawScrollbarSetThumb in -lXaw" >&5
7342 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7343
7344 xe_check_libs=" -lXaw "
7345 cat > conftest.$ac_ext <<EOF
7346 #line 7347 "configure"
7347 #include "confdefs.h"
7348 /* Override any gcc2 internal prototype to avoid an error.  */
7349 /* We use char because int might match the return type of a gcc2
7350     builtin and then its argument prototype would still apply.  */
7351 char XawScrollbarSetThumb();
7352
7353 int main() {
7354 XawScrollbarSetThumb()
7355 ; return 0; }
7356 EOF
7357 if { (eval echo configure:7358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7358   rm -rf conftest*
7359   eval "ac_cv_lib_$ac_lib_var=yes"
7360 else
7361   echo "configure: failed program was:" >&5
7362   cat conftest.$ac_ext >&5
7363   rm -rf conftest*
7364   eval "ac_cv_lib_$ac_lib_var=no"
7365 fi
7366 rm -f conftest*
7367 xe_check_libs=""
7368
7369 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7370   echo "$ac_t""yes" 1>&6
7371   have_xaw=yes
7372 else
7373   echo "$ac_t""no" 1>&6
7374 have_xaw=no
7375 fi
7376
7377
7378                     
7379     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7380 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7381 echo "configure:7382: checking for Xm/Xm.h" >&5
7382
7383 cat > conftest.$ac_ext <<EOF
7384 #line 7385 "configure"
7385 #include "confdefs.h"
7386 #include <Xm/Xm.h>
7387 EOF
7388 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7389 { (eval echo configure:7390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7390 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7391 if test -z "$ac_err"; then
7392   rm -rf conftest*
7393   eval "ac_cv_header_$ac_safe=yes"
7394 else
7395   echo "$ac_err" >&5
7396   echo "configure: failed program was:" >&5
7397   cat conftest.$ac_ext >&5
7398   rm -rf conftest*
7399   eval "ac_cv_header_$ac_safe=no"
7400 fi
7401 rm -f conftest*
7402 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7403   echo "$ac_t""yes" 1>&6
7404   
7405 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7406 echo "configure:7407: checking for XmStringFree in -lXm" >&5
7407 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7408
7409 xe_check_libs=" -lXm "
7410 cat > conftest.$ac_ext <<EOF
7411 #line 7412 "configure"
7412 #include "confdefs.h"
7413 /* Override any gcc2 internal prototype to avoid an error.  */
7414 /* We use char because int might match the return type of a gcc2
7415     builtin and then its argument prototype would still apply.  */
7416 char XmStringFree();
7417
7418 int main() {
7419 XmStringFree()
7420 ; return 0; }
7421 EOF
7422 if { (eval echo configure:7423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7423   rm -rf conftest*
7424   eval "ac_cv_lib_$ac_lib_var=yes"
7425 else
7426   echo "configure: failed program was:" >&5
7427   cat conftest.$ac_ext >&5
7428   rm -rf conftest*
7429   eval "ac_cv_lib_$ac_lib_var=no"
7430 fi
7431 rm -f conftest*
7432 xe_check_libs=""
7433
7434 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7435   echo "$ac_t""yes" 1>&6
7436   have_motif=yes
7437 else
7438   echo "$ac_t""no" 1>&6
7439 have_motif=no
7440 fi
7441
7442
7443 else
7444   echo "$ac_t""no" 1>&6
7445 have_motif=no
7446 fi
7447
7448
7449   if test "$have_motif" = "yes"; then
7450         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7451 echo "configure:7452: checking for Lesstif" >&5
7452     cat > conftest.$ac_ext <<EOF
7453 #line 7454 "configure"
7454 #include "confdefs.h"
7455 #include <Xm/Xm.h>
7456 #ifdef LESSTIF_VERSION
7457 yes
7458 #endif
7459
7460 EOF
7461 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7462   egrep "yes" >/dev/null 2>&1; then
7463   rm -rf conftest*
7464   have_lesstif=yes
7465 else
7466   rm -rf conftest*
7467   have_lesstif=no
7468 fi
7469 rm -f conftest*
7470
7471   echo "$ac_t""$have_lesstif" 1>&6
7472   fi
7473
7474 fi 
7475
7476 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7477   with_menubars="lucid" ;;
7478 esac
7479 case "$with_dialogs" in "" | "yes" | "lucid" )
7480   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7481   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7482   else with_dialogs=no
7483   fi ;;
7484 esac
7485 case "$with_scrollbars" in "" | "yes" )
7486   with_scrollbars="lucid" ;;
7487 esac
7488
7489 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7490
7491 case "$all_widgets" in *athena* )
7492   { test "$extra_verbose" = "yes" && cat << \EOF
7493     Defining LWLIB_USES_ATHENA
7494 EOF
7495 cat >> confdefs.h <<\EOF
7496 #define LWLIB_USES_ATHENA 1
7497 EOF
7498 }
7499
7500   { test "$extra_verbose" = "yes" && cat << \EOF
7501     Defining NEED_ATHENA
7502 EOF
7503 cat >> confdefs.h <<\EOF
7504 #define NEED_ATHENA 1
7505 EOF
7506 }
7507
7508   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7509   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7510 esac
7511
7512 case "$all_widgets" in *motif* )
7513   { test "$extra_verbose" = "yes" && cat << \EOF
7514     Defining LWLIB_USES_MOTIF
7515 EOF
7516 cat >> confdefs.h <<\EOF
7517 #define LWLIB_USES_MOTIF 1
7518 EOF
7519 }
7520
7521   { test "$extra_verbose" = "yes" && cat << \EOF
7522     Defining NEED_MOTIF
7523 EOF
7524 cat >> confdefs.h <<\EOF
7525 #define NEED_MOTIF 1
7526 EOF
7527 }
7528
7529   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7530   need_motif=yes ;;
7531 esac
7532
7533 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7534 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7535 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7536 case "$all_widgets" in *lucid* )
7537   { test "$extra_verbose" = "yes" && cat << \EOF
7538     Defining NEED_LUCID
7539 EOF
7540 cat >> confdefs.h <<\EOF
7541 #define NEED_LUCID 1
7542 EOF
7543 }
7544
7545   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7546 esac
7547
7548
7549
7550 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7551     Defining LWLIB_SCROLLBARS_ATHENA
7552 EOF
7553 cat >> confdefs.h <<\EOF
7554 #define LWLIB_SCROLLBARS_ATHENA 1
7555 EOF
7556 }
7557 ;; esac
7558 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7559     Defining LWLIB_DIALOGS_ATHENA
7560 EOF
7561 cat >> confdefs.h <<\EOF
7562 #define LWLIB_DIALOGS_ATHENA 1
7563 EOF
7564 }
7565    ;; esac
7566 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7567     Defining LWLIB_SCROLLBARS_ATHENA3D
7568 EOF
7569 cat >> confdefs.h <<\EOF
7570 #define LWLIB_SCROLLBARS_ATHENA3D 1
7571 EOF
7572 }
7573
7574 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7575     Defining LWLIB_DIALOGS_ATHENA3D
7576 EOF
7577 cat >> confdefs.h <<\EOF
7578 #define LWLIB_DIALOGS_ATHENA3D 1
7579 EOF
7580 }
7581
7582
7583 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7584     Defining HAVE_MENUBARS
7585 EOF
7586 cat >> confdefs.h <<\EOF
7587 #define HAVE_MENUBARS 1
7588 EOF
7589 }
7590
7591 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7592     Defining HAVE_SCROLLBARS
7593 EOF
7594 cat >> confdefs.h <<\EOF
7595 #define HAVE_SCROLLBARS 1
7596 EOF
7597 }
7598
7599 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7600     Defining HAVE_DIALOGS
7601 EOF
7602 cat >> confdefs.h <<\EOF
7603 #define HAVE_DIALOGS 1
7604 EOF
7605 }
7606
7607 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7608     Defining HAVE_TOOLBARS
7609 EOF
7610 cat >> confdefs.h <<\EOF
7611 #define HAVE_TOOLBARS 1
7612 EOF
7613 }
7614
7615
7616 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7617     Defining LWLIB_MENUBARS_LUCID
7618 EOF
7619 cat >> confdefs.h <<\EOF
7620 #define LWLIB_MENUBARS_LUCID 1
7621 EOF
7622 }
7623
7624 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7625     Defining LWLIB_SCROLLBARS_LUCID
7626 EOF
7627 cat >> confdefs.h <<\EOF
7628 #define LWLIB_SCROLLBARS_LUCID 1
7629 EOF
7630 }
7631
7632
7633 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7634     Defining LWLIB_MENUBARS_MOTIF
7635 EOF
7636 cat >> confdefs.h <<\EOF
7637 #define LWLIB_MENUBARS_MOTIF 1
7638 EOF
7639 }
7640
7641 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7642     Defining LWLIB_SCROLLBARS_MOTIF
7643 EOF
7644 cat >> confdefs.h <<\EOF
7645 #define LWLIB_SCROLLBARS_MOTIF 1
7646 EOF
7647 }
7648
7649 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7650     Defining LWLIB_DIALOGS_MOTIF
7651 EOF
7652 cat >> confdefs.h <<\EOF
7653 #define LWLIB_DIALOGS_MOTIF 1
7654 EOF
7655 }
7656
7657
7658 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7659    echo "    xemacs will be linked with \"menubar.o\""
7660  fi
7661 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7662    echo "    xemacs will be linked with \"scrollbar.o\""
7663  fi
7664 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7665    echo "    xemacs will be linked with \"dialog.o\""
7666  fi
7667 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7668    echo "    xemacs will be linked with \"toolbar.o\""
7669  fi
7670
7671 if test "$with_x11" = "yes"; then
7672   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7673    echo "    xemacs will be linked with \"menubar-x.o\""
7674  fi
7675   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7676    echo "    xemacs will be linked with \"scrollbar-x.o\""
7677  fi
7678   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7679    echo "    xemacs will be linked with \"dialog-x.o\""
7680  fi
7681   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7682    echo "    xemacs will be linked with \"toolbar-x.o\""
7683  fi
7684   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7685    echo "    xemacs will be linked with \"gui-x.o\""
7686  fi
7687 else
7688   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7689     echo "Attempt to Build NAS sound without X"
7690     echo "Please remove NAS configuration or build with X"
7691     exit 1
7692   fi
7693 fi
7694
7695
7696 test -z "$with_mule" && with_mule=no
7697 test -z "$with_file_coding" && with_file_coding=no
7698
7699
7700 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7701   { test "$extra_verbose" = "yes" && cat << \EOF
7702     Defining FILE_CODING
7703 EOF
7704 cat >> confdefs.h <<\EOF
7705 #define FILE_CODING 1
7706 EOF
7707 }
7708
7709   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7710    echo "    xemacs will be linked with \"file-coding.o\""
7711  fi
7712 fi
7713
7714 if test "$with_mule" = "yes" ; then
7715   echo "checking for Mule-related features" 1>&6
7716 echo "configure:7717: checking for Mule-related features" >&5
7717   { test "$extra_verbose" = "yes" && cat << \EOF
7718     Defining MULE
7719 EOF
7720 cat >> confdefs.h <<\EOF
7721 #define MULE 1
7722 EOF
7723 }
7724
7725   { test "$extra_verbose" = "yes" && cat << \EOF
7726     Defining FILE_CODING
7727 EOF
7728 cat >> confdefs.h <<\EOF
7729 #define FILE_CODING 1
7730 EOF
7731 }
7732
7733   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7734    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7735  fi
7736
7737     for ac_hdr in libintl.h
7738 do
7739 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7740 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7741 echo "configure:7742: checking for $ac_hdr" >&5
7742
7743 cat > conftest.$ac_ext <<EOF
7744 #line 7745 "configure"
7745 #include "confdefs.h"
7746 #include <$ac_hdr>
7747 EOF
7748 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7749 { (eval echo configure:7750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7750 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7751 if test -z "$ac_err"; then
7752   rm -rf conftest*
7753   eval "ac_cv_header_$ac_safe=yes"
7754 else
7755   echo "$ac_err" >&5
7756   echo "configure: failed program was:" >&5
7757   cat conftest.$ac_ext >&5
7758   rm -rf conftest*
7759   eval "ac_cv_header_$ac_safe=no"
7760 fi
7761 rm -f conftest*
7762 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7763   echo "$ac_t""yes" 1>&6
7764     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7765   { test "$extra_verbose" = "yes" && cat << EOF
7766     Defining $ac_tr_hdr
7767 EOF
7768 cat >> confdefs.h <<EOF
7769 #define $ac_tr_hdr 1
7770 EOF
7771 }
7772  
7773 else
7774   echo "$ac_t""no" 1>&6
7775 fi
7776 done
7777
7778   
7779 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7780 echo "configure:7781: checking for strerror in -lintl" >&5
7781 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7782
7783 xe_check_libs=" -lintl "
7784 cat > conftest.$ac_ext <<EOF
7785 #line 7786 "configure"
7786 #include "confdefs.h"
7787 /* Override any gcc2 internal prototype to avoid an error.  */
7788 /* We use char because int might match the return type of a gcc2
7789     builtin and then its argument prototype would still apply.  */
7790 char strerror();
7791
7792 int main() {
7793 strerror()
7794 ; return 0; }
7795 EOF
7796 if { (eval echo configure:7797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7797   rm -rf conftest*
7798   eval "ac_cv_lib_$ac_lib_var=yes"
7799 else
7800   echo "configure: failed program was:" >&5
7801   cat conftest.$ac_ext >&5
7802   rm -rf conftest*
7803   eval "ac_cv_lib_$ac_lib_var=no"
7804 fi
7805 rm -f conftest*
7806 xe_check_libs=""
7807
7808 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7809   echo "$ac_t""yes" 1>&6
7810     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7811     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7812   { test "$extra_verbose" = "yes" && cat << EOF
7813     Defining $ac_tr_lib
7814 EOF
7815 cat >> confdefs.h <<EOF
7816 #define $ac_tr_lib 1
7817 EOF
7818 }
7819
7820   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7821
7822 else
7823   echo "$ac_t""no" 1>&6
7824 fi
7825
7826
7827
7828   if test "$with_utf_2000" = "yes" ; then
7829     { test "$extra_verbose" = "yes" && cat << \EOF
7830     Defining UTF2000
7831 EOF
7832 cat >> confdefs.h <<\EOF
7833 #define UTF2000 1
7834 EOF
7835 }
7836
7837   fi
7838
7839   echo "checking for Mule input methods" 1>&6
7840 echo "configure:7841: checking for Mule input methods" >&5
7841         case "$with_xim" in "" | "yes" )
7842     echo "checking for XIM" 1>&6
7843 echo "configure:7844: checking for XIM" >&5
7844     
7845 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
7846 echo "configure:7847: checking for XOpenIM in -lX11" >&5
7847 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
7848
7849 xe_check_libs=" -lX11 "
7850 cat > conftest.$ac_ext <<EOF
7851 #line 7852 "configure"
7852 #include "confdefs.h"
7853 /* Override any gcc2 internal prototype to avoid an error.  */
7854 /* We use char because int might match the return type of a gcc2
7855     builtin and then its argument prototype would still apply.  */
7856 char XOpenIM();
7857
7858 int main() {
7859 XOpenIM()
7860 ; return 0; }
7861 EOF
7862 if { (eval echo configure:7863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7863   rm -rf conftest*
7864   eval "ac_cv_lib_$ac_lib_var=yes"
7865 else
7866   echo "configure: failed program was:" >&5
7867   cat conftest.$ac_ext >&5
7868   rm -rf conftest*
7869   eval "ac_cv_lib_$ac_lib_var=no"
7870 fi
7871 rm -f conftest*
7872 xe_check_libs=""
7873
7874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7875   echo "$ac_t""yes" 1>&6
7876   with_xim=xlib
7877 else
7878   echo "$ac_t""no" 1>&6
7879 with_xim=no
7880 fi
7881
7882
7883         if test "$have_motif $have_lesstif" = "yes no"; then
7884       
7885 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7886 echo "configure:7887: checking for XmImMbLookupString in -lXm" >&5
7887 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7888
7889 xe_check_libs=" -lXm "
7890 cat > conftest.$ac_ext <<EOF
7891 #line 7892 "configure"
7892 #include "confdefs.h"
7893 /* Override any gcc2 internal prototype to avoid an error.  */
7894 /* We use char because int might match the return type of a gcc2
7895     builtin and then its argument prototype would still apply.  */
7896 char XmImMbLookupString();
7897
7898 int main() {
7899 XmImMbLookupString()
7900 ; return 0; }
7901 EOF
7902 if { (eval echo configure:7903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7903   rm -rf conftest*
7904   eval "ac_cv_lib_$ac_lib_var=yes"
7905 else
7906   echo "configure: failed program was:" >&5
7907   cat conftest.$ac_ext >&5
7908   rm -rf conftest*
7909   eval "ac_cv_lib_$ac_lib_var=no"
7910 fi
7911 rm -f conftest*
7912 xe_check_libs=""
7913
7914 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7915   echo "$ac_t""yes" 1>&6
7916   with_xim=motif
7917 else
7918   echo "$ac_t""no" 1>&6
7919 fi
7920
7921
7922     fi ;;
7923   esac
7924   if test "$with_xim" != "no"; then
7925     { test "$extra_verbose" = "yes" && cat << \EOF
7926     Defining HAVE_XIM
7927 EOF
7928 cat >> confdefs.h <<\EOF
7929 #define HAVE_XIM 1
7930 EOF
7931 }
7932
7933     if test "$with_xim" = "xlib"; then
7934       { test "$extra_verbose" = "yes" && cat << \EOF
7935     Defining XIM_XLIB
7936 EOF
7937 cat >> confdefs.h <<\EOF
7938 #define XIM_XLIB 1
7939 EOF
7940 }
7941
7942       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7943    echo "    xemacs will be linked with \"input-method-xlib.o\""
7944  fi
7945     fi
7946     if test "$with_xim" = "motif"; then
7947       { test "$extra_verbose" = "yes" && cat << \EOF
7948     Defining XIM_MOTIF
7949 EOF
7950 cat >> confdefs.h <<\EOF
7951 #define XIM_MOTIF 1
7952 EOF
7953 }
7954
7955       need_motif=yes
7956       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7957    echo "    xemacs will be linked with \"input-method-motif.o\""
7958  fi
7959     fi
7960     if test "$with_xim" = "motif"; then
7961       with_xfs=no
7962     fi
7963   fi
7964
7965     if test "$with_xfs" = "yes" ; then
7966     echo "checking for XFontSet" 1>&6
7967 echo "configure:7968: checking for XFontSet" >&5
7968     
7969 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7970 echo "configure:7971: checking for XmbDrawString in -lX11" >&5
7971 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7972
7973 xe_check_libs=" -lX11 "
7974 cat > conftest.$ac_ext <<EOF
7975 #line 7976 "configure"
7976 #include "confdefs.h"
7977 /* Override any gcc2 internal prototype to avoid an error.  */
7978 /* We use char because int might match the return type of a gcc2
7979     builtin and then its argument prototype would still apply.  */
7980 char XmbDrawString();
7981
7982 int main() {
7983 XmbDrawString()
7984 ; return 0; }
7985 EOF
7986 if { (eval echo configure:7987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7987   rm -rf conftest*
7988   eval "ac_cv_lib_$ac_lib_var=yes"
7989 else
7990   echo "configure: failed program was:" >&5
7991   cat conftest.$ac_ext >&5
7992   rm -rf conftest*
7993   eval "ac_cv_lib_$ac_lib_var=no"
7994 fi
7995 rm -f conftest*
7996 xe_check_libs=""
7997
7998 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7999   echo "$ac_t""yes" 1>&6
8000   :
8001 else
8002   echo "$ac_t""no" 1>&6
8003 with_xfs=no
8004 fi
8005
8006
8007     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
8008       { test "$extra_verbose" = "yes" && cat << \EOF
8009     Defining USE_XFONTSET
8010 EOF
8011 cat >> confdefs.h <<\EOF
8012 #define USE_XFONTSET 1
8013 EOF
8014 }
8015
8016       if test "$with_xim" = "no" ; then
8017         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
8018    echo "    xemacs will be linked with \"input-method-xfs.o\""
8019  fi
8020       fi
8021     fi
8022   fi 
8023     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
8024   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
8025 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
8026 echo "configure:8027: checking for wnn/jllib.h" >&5
8027
8028 cat > conftest.$ac_ext <<EOF
8029 #line 8030 "configure"
8030 #include "confdefs.h"
8031 #include <wnn/jllib.h>
8032 EOF
8033 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8034 { (eval echo configure:8035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8035 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8036 if test -z "$ac_err"; then
8037   rm -rf conftest*
8038   eval "ac_cv_header_$ac_safe=yes"
8039 else
8040   echo "$ac_err" >&5
8041   echo "configure: failed program was:" >&5
8042   cat conftest.$ac_ext >&5
8043   rm -rf conftest*
8044   eval "ac_cv_header_$ac_safe=no"
8045 fi
8046 rm -f conftest*
8047 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8048   echo "$ac_t""yes" 1>&6
8049   :
8050 else
8051   echo "$ac_t""no" 1>&6
8052 with_wnn=no
8053 fi
8054  }
8055     if test "$with_wnn" != "no"; then
8056     for ac_func in crypt
8057 do
8058 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8059 echo "configure:8060: checking for $ac_func" >&5
8060
8061 cat > conftest.$ac_ext <<EOF
8062 #line 8063 "configure"
8063 #include "confdefs.h"
8064 /* System header to define __stub macros and hopefully few prototypes,
8065     which can conflict with char $ac_func(); below.  */
8066 #include <assert.h>
8067 /* Override any gcc2 internal prototype to avoid an error.  */
8068 /* We use char because int might match the return type of a gcc2
8069     builtin and then its argument prototype would still apply.  */
8070 char $ac_func();
8071
8072 int main() {
8073
8074 /* The GNU C library defines this for functions which it implements
8075     to always fail with ENOSYS.  Some functions are actually named
8076     something starting with __ and the normal name is an alias.  */
8077 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8078 choke me
8079 #else
8080 $ac_func();
8081 #endif
8082
8083 ; return 0; }
8084 EOF
8085 if { (eval echo configure:8086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8086   rm -rf conftest*
8087   eval "ac_cv_func_$ac_func=yes"
8088 else
8089   echo "configure: failed program was:" >&5
8090   cat conftest.$ac_ext >&5
8091   rm -rf conftest*
8092   eval "ac_cv_func_$ac_func=no"
8093 fi
8094 rm -f conftest*
8095
8096 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8097   echo "$ac_t""yes" 1>&6
8098     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8099   { test "$extra_verbose" = "yes" && cat << EOF
8100     Defining $ac_tr_func
8101 EOF
8102 cat >> confdefs.h <<EOF
8103 #define $ac_tr_func 1
8104 EOF
8105 }
8106  
8107 else
8108   echo "$ac_t""no" 1>&6
8109 fi
8110 done
8111
8112     test "$ac_cv_func_crypt" != "yes" && { 
8113 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
8114 echo "configure:8115: checking for crypt in -lcrypt" >&5
8115 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
8116
8117 xe_check_libs=" -lcrypt "
8118 cat > conftest.$ac_ext <<EOF
8119 #line 8120 "configure"
8120 #include "confdefs.h"
8121 /* Override any gcc2 internal prototype to avoid an error.  */
8122 /* We use char because int might match the return type of a gcc2
8123     builtin and then its argument prototype would still apply.  */
8124 char crypt();
8125
8126 int main() {
8127 crypt()
8128 ; return 0; }
8129 EOF
8130 if { (eval echo configure:8131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8131   rm -rf conftest*
8132   eval "ac_cv_lib_$ac_lib_var=yes"
8133 else
8134   echo "configure: failed program was:" >&5
8135   cat conftest.$ac_ext >&5
8136   rm -rf conftest*
8137   eval "ac_cv_lib_$ac_lib_var=no"
8138 fi
8139 rm -f conftest*
8140 xe_check_libs=""
8141
8142 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8143   echo "$ac_t""yes" 1>&6
8144     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8145     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8146   { test "$extra_verbose" = "yes" && cat << EOF
8147     Defining $ac_tr_lib
8148 EOF
8149 cat >> confdefs.h <<EOF
8150 #define $ac_tr_lib 1
8151 EOF
8152 }
8153
8154   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
8155
8156 else
8157   echo "$ac_t""no" 1>&6
8158 fi
8159
8160  }
8161   fi
8162     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8163     
8164 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8165 echo "configure:8166: checking for jl_dic_list_e in -lwnn" >&5
8166 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8167
8168 xe_check_libs=" -lwnn "
8169 cat > conftest.$ac_ext <<EOF
8170 #line 8171 "configure"
8171 #include "confdefs.h"
8172 /* Override any gcc2 internal prototype to avoid an error.  */
8173 /* We use char because int might match the return type of a gcc2
8174     builtin and then its argument prototype would still apply.  */
8175 char jl_dic_list_e();
8176
8177 int main() {
8178 jl_dic_list_e()
8179 ; return 0; }
8180 EOF
8181 if { (eval echo configure:8182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8182   rm -rf conftest*
8183   eval "ac_cv_lib_$ac_lib_var=yes"
8184 else
8185   echo "configure: failed program was:" >&5
8186   cat conftest.$ac_ext >&5
8187   rm -rf conftest*
8188   eval "ac_cv_lib_$ac_lib_var=no"
8189 fi
8190 rm -f conftest*
8191 xe_check_libs=""
8192
8193 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8194   echo "$ac_t""yes" 1>&6
8195   libwnn=wnn
8196 else
8197   echo "$ac_t""no" 1>&6
8198 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8199 echo "configure:8200: checking for jl_dic_list_e in -lwnn4" >&5
8200 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8201
8202 xe_check_libs=" -lwnn4 "
8203 cat > conftest.$ac_ext <<EOF
8204 #line 8205 "configure"
8205 #include "confdefs.h"
8206 /* Override any gcc2 internal prototype to avoid an error.  */
8207 /* We use char because int might match the return type of a gcc2
8208     builtin and then its argument prototype would still apply.  */
8209 char jl_dic_list_e();
8210
8211 int main() {
8212 jl_dic_list_e()
8213 ; return 0; }
8214 EOF
8215 if { (eval echo configure:8216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8216   rm -rf conftest*
8217   eval "ac_cv_lib_$ac_lib_var=yes"
8218 else
8219   echo "configure: failed program was:" >&5
8220   cat conftest.$ac_ext >&5
8221   rm -rf conftest*
8222   eval "ac_cv_lib_$ac_lib_var=no"
8223 fi
8224 rm -f conftest*
8225 xe_check_libs=""
8226
8227 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8228   echo "$ac_t""yes" 1>&6
8229   libwnn=wnn4
8230 else
8231   echo "$ac_t""no" 1>&6
8232 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8233 echo "configure:8234: checking for jl_dic_list_e in -lwnn6" >&5
8234 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8235
8236 xe_check_libs=" -lwnn6 "
8237 cat > conftest.$ac_ext <<EOF
8238 #line 8239 "configure"
8239 #include "confdefs.h"
8240 /* Override any gcc2 internal prototype to avoid an error.  */
8241 /* We use char because int might match the return type of a gcc2
8242     builtin and then its argument prototype would still apply.  */
8243 char jl_dic_list_e();
8244
8245 int main() {
8246 jl_dic_list_e()
8247 ; return 0; }
8248 EOF
8249 if { (eval echo configure:8250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8250   rm -rf conftest*
8251   eval "ac_cv_lib_$ac_lib_var=yes"
8252 else
8253   echo "configure: failed program was:" >&5
8254   cat conftest.$ac_ext >&5
8255   rm -rf conftest*
8256   eval "ac_cv_lib_$ac_lib_var=no"
8257 fi
8258 rm -f conftest*
8259 xe_check_libs=""
8260
8261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8262   echo "$ac_t""yes" 1>&6
8263   libwnn=wnn6
8264 else
8265   echo "$ac_t""no" 1>&6
8266 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8267 echo "configure:8268: checking for dic_list_e in -lwnn6_fromsrc" >&5
8268 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8269
8270 xe_check_libs=" -lwnn6_fromsrc "
8271 cat > conftest.$ac_ext <<EOF
8272 #line 8273 "configure"
8273 #include "confdefs.h"
8274 /* Override any gcc2 internal prototype to avoid an error.  */
8275 /* We use char because int might match the return type of a gcc2
8276     builtin and then its argument prototype would still apply.  */
8277 char dic_list_e();
8278
8279 int main() {
8280 dic_list_e()
8281 ; return 0; }
8282 EOF
8283 if { (eval echo configure:8284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8284   rm -rf conftest*
8285   eval "ac_cv_lib_$ac_lib_var=yes"
8286 else
8287   echo "configure: failed program was:" >&5
8288   cat conftest.$ac_ext >&5
8289   rm -rf conftest*
8290   eval "ac_cv_lib_$ac_lib_var=no"
8291 fi
8292 rm -f conftest*
8293 xe_check_libs=""
8294
8295 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8296   echo "$ac_t""yes" 1>&6
8297   libwnn=wnn6_fromsrc
8298 else
8299   echo "$ac_t""no" 1>&6
8300 with_wnn=no
8301 fi
8302
8303
8304 fi
8305
8306
8307 fi
8308
8309
8310 fi
8311
8312
8313   fi
8314   test -z "$with_wnn" && with_wnn=yes
8315   if test "$with_wnn" = "yes"; then
8316     { test "$extra_verbose" = "yes" && cat << \EOF
8317     Defining HAVE_WNN
8318 EOF
8319 cat >> confdefs.h <<\EOF
8320 #define HAVE_WNN 1
8321 EOF
8322 }
8323
8324     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8325     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8326    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8327  fi
8328     if test "$with_wnn6" != "no"; then
8329       
8330 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8331 echo "configure:8332: checking for jl_fi_dic_list in -l$libwnn" >&5
8332 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8333
8334 xe_check_libs=" -l$libwnn "
8335 cat > conftest.$ac_ext <<EOF
8336 #line 8337 "configure"
8337 #include "confdefs.h"
8338 /* Override any gcc2 internal prototype to avoid an error.  */
8339 /* We use char because int might match the return type of a gcc2
8340     builtin and then its argument prototype would still apply.  */
8341 char jl_fi_dic_list();
8342
8343 int main() {
8344 jl_fi_dic_list()
8345 ; return 0; }
8346 EOF
8347 if { (eval echo configure:8348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8348   rm -rf conftest*
8349   eval "ac_cv_lib_$ac_lib_var=yes"
8350 else
8351   echo "configure: failed program was:" >&5
8352   cat conftest.$ac_ext >&5
8353   rm -rf conftest*
8354   eval "ac_cv_lib_$ac_lib_var=no"
8355 fi
8356 rm -f conftest*
8357 xe_check_libs=""
8358
8359 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8360   echo "$ac_t""yes" 1>&6
8361   with_wnn6=yes
8362 else
8363   echo "$ac_t""no" 1>&6
8364 fi
8365
8366
8367       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8368     Defining WNN6
8369 EOF
8370 cat >> confdefs.h <<\EOF
8371 #define WNN6 1
8372 EOF
8373 }
8374
8375     fi
8376   fi
8377
8378     canna_includes_found=no
8379   if test "$with_canna" != "no"; then
8380     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8381 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8382 echo "configure:8383: checking for canna/jrkanji.h" >&5
8383
8384 cat > conftest.$ac_ext <<EOF
8385 #line 8386 "configure"
8386 #include "confdefs.h"
8387 #include <canna/jrkanji.h>
8388 EOF
8389 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8390 { (eval echo configure:8391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8391 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8392 if test -z "$ac_err"; then
8393   rm -rf conftest*
8394   eval "ac_cv_header_$ac_safe=yes"
8395 else
8396   echo "$ac_err" >&5
8397   echo "configure: failed program was:" >&5
8398   cat conftest.$ac_ext >&5
8399   rm -rf conftest*
8400   eval "ac_cv_header_$ac_safe=no"
8401 fi
8402 rm -f conftest*
8403 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8404   echo "$ac_t""yes" 1>&6
8405   canna_includes_found=yes
8406 else
8407   echo "$ac_t""no" 1>&6
8408 fi
8409
8410   fi
8411   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8412       -d "/usr/local/canna/include"; then
8413     save_c_switch_site="$c_switch_site"
8414     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8415     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8416 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8417 echo "configure:8418: checking for canna/jrkanji.h" >&5
8418
8419 cat > conftest.$ac_ext <<EOF
8420 #line 8421 "configure"
8421 #include "confdefs.h"
8422 #include <canna/jrkanji.h>
8423 EOF
8424 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8425 { (eval echo configure:8426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8426 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8427 if test -z "$ac_err"; then
8428   rm -rf conftest*
8429   eval "ac_cv_header_$ac_safe=yes"
8430 else
8431   echo "$ac_err" >&5
8432   echo "configure: failed program was:" >&5
8433   cat conftest.$ac_ext >&5
8434   rm -rf conftest*
8435   eval "ac_cv_header_$ac_safe=no"
8436 fi
8437 rm -f conftest*
8438 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8439   echo "$ac_t""yes" 1>&6
8440   canna_includes_found=yes
8441 else
8442   echo "$ac_t""no" 1>&6
8443 fi
8444
8445     if test "$canna_includes_found" != "yes"; then
8446       c_switch_site="$save_c_switch_site"
8447       with_canna="no"
8448     fi
8449   fi
8450
8451   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8452 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8453 echo "configure:8454: checking for canna/RK.h" >&5
8454
8455 cat > conftest.$ac_ext <<EOF
8456 #line 8457 "configure"
8457 #include "confdefs.h"
8458 #include <canna/RK.h>
8459 EOF
8460 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8461 { (eval echo configure:8462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8462 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8463 if test -z "$ac_err"; then
8464   rm -rf conftest*
8465   eval "ac_cv_header_$ac_safe=yes"
8466 else
8467   echo "$ac_err" >&5
8468   echo "configure: failed program was:" >&5
8469   cat conftest.$ac_ext >&5
8470   rm -rf conftest*
8471   eval "ac_cv_header_$ac_safe=no"
8472 fi
8473 rm -f conftest*
8474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8475   echo "$ac_t""yes" 1>&6
8476   :
8477 else
8478   echo "$ac_t""no" 1>&6
8479 with_canna=no
8480 fi
8481  }
8482   test -z "$with_canna" && { 
8483 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8484 echo "configure:8485: checking for RkBgnBun in -lRKC" >&5
8485 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8486
8487 xe_check_libs=" -lRKC "
8488 cat > conftest.$ac_ext <<EOF
8489 #line 8490 "configure"
8490 #include "confdefs.h"
8491 /* Override any gcc2 internal prototype to avoid an error.  */
8492 /* We use char because int might match the return type of a gcc2
8493     builtin and then its argument prototype would still apply.  */
8494 char RkBgnBun();
8495
8496 int main() {
8497 RkBgnBun()
8498 ; return 0; }
8499 EOF
8500 if { (eval echo configure:8501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8501   rm -rf conftest*
8502   eval "ac_cv_lib_$ac_lib_var=yes"
8503 else
8504   echo "configure: failed program was:" >&5
8505   cat conftest.$ac_ext >&5
8506   rm -rf conftest*
8507   eval "ac_cv_lib_$ac_lib_var=no"
8508 fi
8509 rm -f conftest*
8510 xe_check_libs=""
8511
8512 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8513   echo "$ac_t""yes" 1>&6
8514   :
8515 else
8516   echo "$ac_t""no" 1>&6
8517 with_canna=no
8518 fi
8519
8520  }
8521   test -z "$with_canna" && { 
8522 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8523 echo "configure:8524: checking for jrKanjiControl in -lcanna" >&5
8524 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8525
8526 xe_check_libs=" -lcanna "
8527 cat > conftest.$ac_ext <<EOF
8528 #line 8529 "configure"
8529 #include "confdefs.h"
8530 /* Override any gcc2 internal prototype to avoid an error.  */
8531 /* We use char because int might match the return type of a gcc2
8532     builtin and then its argument prototype would still apply.  */
8533 char jrKanjiControl();
8534
8535 int main() {
8536 jrKanjiControl()
8537 ; return 0; }
8538 EOF
8539 if { (eval echo configure:8540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8540   rm -rf conftest*
8541   eval "ac_cv_lib_$ac_lib_var=yes"
8542 else
8543   echo "configure: failed program was:" >&5
8544   cat conftest.$ac_ext >&5
8545   rm -rf conftest*
8546   eval "ac_cv_lib_$ac_lib_var=no"
8547 fi
8548 rm -f conftest*
8549 xe_check_libs=""
8550
8551 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8552   echo "$ac_t""yes" 1>&6
8553   :
8554 else
8555   echo "$ac_t""no" 1>&6
8556 with_canna=no
8557 fi
8558
8559  }
8560   test -z "$with_canna" && with_canna=yes
8561   if test "$with_canna" = "yes"; then
8562     { test "$extra_verbose" = "yes" && cat << \EOF
8563     Defining HAVE_CANNA
8564 EOF
8565 cat >> confdefs.h <<\EOF
8566 #define HAVE_CANNA 1
8567 EOF
8568 }
8569
8570     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8571     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8572    echo "    xemacs will be linked with \"mule-canna.o\""
8573  fi
8574   fi
8575
8576 else   for feature in xim canna wnn; do
8577     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8578       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8579     fi
8580     eval "with_${feature}=no"
8581   done
8582 fi 
8583
8584 if test "$need_motif" = "yes" ; then
8585   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8586     
8587 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8588 echo "configure:8589: checking for layout_object_getvalue in -li18n" >&5
8589 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8590
8591 xe_check_libs=" -li18n "
8592 cat > conftest.$ac_ext <<EOF
8593 #line 8594 "configure"
8594 #include "confdefs.h"
8595 /* Override any gcc2 internal prototype to avoid an error.  */
8596 /* We use char because int might match the return type of a gcc2
8597     builtin and then its argument prototype would still apply.  */
8598 char layout_object_getvalue();
8599
8600 int main() {
8601 layout_object_getvalue()
8602 ; return 0; }
8603 EOF
8604 if { (eval echo configure:8605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8605   rm -rf conftest*
8606   eval "ac_cv_lib_$ac_lib_var=yes"
8607 else
8608   echo "configure: failed program was:" >&5
8609   cat conftest.$ac_ext >&5
8610   rm -rf conftest*
8611   eval "ac_cv_lib_$ac_lib_var=no"
8612 fi
8613 rm -f conftest*
8614 xe_check_libs=""
8615
8616 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8617   echo "$ac_t""yes" 1>&6
8618   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8619 else
8620   echo "$ac_t""no" 1>&6
8621 fi
8622
8623
8624   
8625 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8626     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8627   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8628   
8629         runpath="" runpath_dirs=""
8630   if test -n "$LD_RUN_PATH"; then
8631     runpath="$LD_RUN_PATH"
8632   elif test "$GCC" = "yes"; then
8633         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8634     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8635     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8636     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8637       case "$arg" in P,* | -L* | -R* )
8638         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8639           {
8640 xe_runpath_dir="$dir"
8641   test "$xe_runpath_dir" != "/lib"     -a \
8642         "$xe_runpath_dir" != "/usr/lib" -a \
8643         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8644   eval "$xe_add_unique_runpath_dir"
8645 }
8646         done ;;
8647       esac
8648     done
8649     ld_switch_run="$ld_switch_run_save"
8650     rm -f conftest*
8651   else
8652         for arg in $ld_switch_site $ld_switch_x_site; do
8653       case "$arg" in -L*) {
8654 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8655   test "$xe_runpath_dir" != "/lib"     -a \
8656         "$xe_runpath_dir" != "/usr/lib" -a \
8657         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8658   eval "$xe_add_unique_runpath_dir"
8659 };; esac
8660     done
8661         if test "$opsys $need_motif" = "sol2 yes"; then
8662       xe_runpath_dir="/opt/SUNWdt/lib";
8663       eval "$xe_add_unique_runpath_dir";
8664     fi
8665   fi 
8666   if test -n "$runpath"; then
8667     ld_switch_run="${dash_r}${runpath}"
8668     
8669 if test "$GCC" = "yes"; then
8670   set x $ld_switch_run; shift; ld_switch_run=""
8671   while test -n "$1"; do
8672     case $1 in
8673       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8674       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8675       -Xlinker* ) ;;
8676       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8677     esac
8678     shift
8679   done
8680 fi
8681     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8682   fi
8683 fi
8684
8685 fi
8686
8687 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
8688 do
8689 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8690 echo "configure:8691: checking for $ac_func" >&5
8691
8692 cat > conftest.$ac_ext <<EOF
8693 #line 8694 "configure"
8694 #include "confdefs.h"
8695 /* System header to define __stub macros and hopefully few prototypes,
8696     which can conflict with char $ac_func(); below.  */
8697 #include <assert.h>
8698 /* Override any gcc2 internal prototype to avoid an error.  */
8699 /* We use char because int might match the return type of a gcc2
8700     builtin and then its argument prototype would still apply.  */
8701 char $ac_func();
8702
8703 int main() {
8704
8705 /* The GNU C library defines this for functions which it implements
8706     to always fail with ENOSYS.  Some functions are actually named
8707     something starting with __ and the normal name is an alias.  */
8708 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8709 choke me
8710 #else
8711 $ac_func();
8712 #endif
8713
8714 ; return 0; }
8715 EOF
8716 if { (eval echo configure:8717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8717   rm -rf conftest*
8718   eval "ac_cv_func_$ac_func=yes"
8719 else
8720   echo "configure: failed program was:" >&5
8721   cat conftest.$ac_ext >&5
8722   rm -rf conftest*
8723   eval "ac_cv_func_$ac_func=no"
8724 fi
8725 rm -f conftest*
8726
8727 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8728   echo "$ac_t""yes" 1>&6
8729     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8730   { test "$extra_verbose" = "yes" && cat << EOF
8731     Defining $ac_tr_func
8732 EOF
8733 cat >> confdefs.h <<EOF
8734 #define $ac_tr_func 1
8735 EOF
8736 }
8737  
8738 else
8739   echo "$ac_t""no" 1>&6
8740 fi
8741 done
8742
8743
8744
8745 case "$opsys" in
8746   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8747    echo "    xemacs will be linked with \"realpath.o\""
8748  fi ;;
8749   * )
8750     case "$canonical" in
8751       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8752    echo "    xemacs will be linked with \"realpath.o\""
8753  fi ;;
8754       * ) for ac_func in realpath
8755 do
8756 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8757 echo "configure:8758: checking for $ac_func" >&5
8758
8759 cat > conftest.$ac_ext <<EOF
8760 #line 8761 "configure"
8761 #include "confdefs.h"
8762 /* System header to define __stub macros and hopefully few prototypes,
8763     which can conflict with char $ac_func(); below.  */
8764 #include <assert.h>
8765 /* Override any gcc2 internal prototype to avoid an error.  */
8766 /* We use char because int might match the return type of a gcc2
8767     builtin and then its argument prototype would still apply.  */
8768 char $ac_func();
8769
8770 int main() {
8771
8772 /* The GNU C library defines this for functions which it implements
8773     to always fail with ENOSYS.  Some functions are actually named
8774     something starting with __ and the normal name is an alias.  */
8775 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8776 choke me
8777 #else
8778 $ac_func();
8779 #endif
8780
8781 ; return 0; }
8782 EOF
8783 if { (eval echo configure:8784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8784   rm -rf conftest*
8785   eval "ac_cv_func_$ac_func=yes"
8786 else
8787   echo "configure: failed program was:" >&5
8788   cat conftest.$ac_ext >&5
8789   rm -rf conftest*
8790   eval "ac_cv_func_$ac_func=no"
8791 fi
8792 rm -f conftest*
8793
8794 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8795   echo "$ac_t""yes" 1>&6
8796     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8797   { test "$extra_verbose" = "yes" && cat << EOF
8798     Defining $ac_tr_func
8799 EOF
8800 cat >> confdefs.h <<EOF
8801 #define $ac_tr_func 1
8802 EOF
8803 }
8804  
8805 else
8806   echo "$ac_t""no" 1>&6
8807 fi
8808 done
8809
8810           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8811    echo "    xemacs will be linked with \"realpath.o\""
8812  fi ;;
8813     esac ;;
8814 esac
8815
8816 for ac_func in getloadavg
8817 do
8818 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8819 echo "configure:8820: checking for $ac_func" >&5
8820
8821 cat > conftest.$ac_ext <<EOF
8822 #line 8823 "configure"
8823 #include "confdefs.h"
8824 /* System header to define __stub macros and hopefully few prototypes,
8825     which can conflict with char $ac_func(); below.  */
8826 #include <assert.h>
8827 /* Override any gcc2 internal prototype to avoid an error.  */
8828 /* We use char because int might match the return type of a gcc2
8829     builtin and then its argument prototype would still apply.  */
8830 char $ac_func();
8831
8832 int main() {
8833
8834 /* The GNU C library defines this for functions which it implements
8835     to always fail with ENOSYS.  Some functions are actually named
8836     something starting with __ and the normal name is an alias.  */
8837 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8838 choke me
8839 #else
8840 $ac_func();
8841 #endif
8842
8843 ; return 0; }
8844 EOF
8845 if { (eval echo configure:8846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8846   rm -rf conftest*
8847   eval "ac_cv_func_$ac_func=yes"
8848 else
8849   echo "configure: failed program was:" >&5
8850   cat conftest.$ac_ext >&5
8851   rm -rf conftest*
8852   eval "ac_cv_func_$ac_func=no"
8853 fi
8854 rm -f conftest*
8855
8856 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8857   echo "$ac_t""yes" 1>&6
8858     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8859   { test "$extra_verbose" = "yes" && cat << EOF
8860     Defining $ac_tr_func
8861 EOF
8862 cat >> confdefs.h <<EOF
8863 #define $ac_tr_func 1
8864 EOF
8865 }
8866  
8867 else
8868   echo "$ac_t""no" 1>&6
8869 fi
8870 done
8871
8872
8873 if test "$ac_cv_func_getloadavg" != "yes"
8874 then
8875   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
8876    echo "    xemacs will be linked with \"getloadavg.o\""
8877  fi
8878
8879     
8880 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
8881 echo "configure:8882: checking for kstat_open in -lkstat" >&5
8882 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
8883
8884 xe_check_libs=" -lkstat "
8885 cat > conftest.$ac_ext <<EOF
8886 #line 8887 "configure"
8887 #include "confdefs.h"
8888 /* Override any gcc2 internal prototype to avoid an error.  */
8889 /* We use char because int might match the return type of a gcc2
8890     builtin and then its argument prototype would still apply.  */
8891 char kstat_open();
8892
8893 int main() {
8894 kstat_open()
8895 ; return 0; }
8896 EOF
8897 if { (eval echo configure:8898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8898   rm -rf conftest*
8899   eval "ac_cv_lib_$ac_lib_var=yes"
8900 else
8901   echo "configure: failed program was:" >&5
8902   cat conftest.$ac_ext >&5
8903   rm -rf conftest*
8904   eval "ac_cv_lib_$ac_lib_var=no"
8905 fi
8906 rm -f conftest*
8907 xe_check_libs=""
8908
8909 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8910   echo "$ac_t""yes" 1>&6
8911     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8912     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8913   { test "$extra_verbose" = "yes" && cat << EOF
8914     Defining $ac_tr_lib
8915 EOF
8916 cat >> confdefs.h <<EOF
8917 #define $ac_tr_lib 1
8918 EOF
8919 }
8920
8921   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
8922
8923 else
8924   echo "$ac_t""no" 1>&6
8925 fi
8926
8927
8928
8929     
8930 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
8931 echo "configure:8932: checking for kvm_read in -lkvm" >&5
8932 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
8933
8934 xe_check_libs=" -lkvm "
8935 cat > conftest.$ac_ext <<EOF
8936 #line 8937 "configure"
8937 #include "confdefs.h"
8938 /* Override any gcc2 internal prototype to avoid an error.  */
8939 /* We use char because int might match the return type of a gcc2
8940     builtin and then its argument prototype would still apply.  */
8941 char kvm_read();
8942
8943 int main() {
8944 kvm_read()
8945 ; return 0; }
8946 EOF
8947 if { (eval echo configure:8948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8948   rm -rf conftest*
8949   eval "ac_cv_lib_$ac_lib_var=yes"
8950 else
8951   echo "configure: failed program was:" >&5
8952   cat conftest.$ac_ext >&5
8953   rm -rf conftest*
8954   eval "ac_cv_lib_$ac_lib_var=no"
8955 fi
8956 rm -f conftest*
8957 xe_check_libs=""
8958
8959 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8960   echo "$ac_t""yes" 1>&6
8961     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8962     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8963   { test "$extra_verbose" = "yes" && cat << EOF
8964     Defining $ac_tr_lib
8965 EOF
8966 cat >> confdefs.h <<EOF
8967 #define $ac_tr_lib 1
8968 EOF
8969 }
8970
8971   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
8972
8973 else
8974   echo "$ac_t""no" 1>&6
8975 fi
8976
8977
8978 fi
8979
8980 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8981 echo "configure:8982: checking whether netdb declares h_errno" >&5
8982 cat > conftest.$ac_ext <<EOF
8983 #line 8984 "configure"
8984 #include "confdefs.h"
8985 #include <netdb.h>
8986 int main() {
8987 return h_errno;
8988 ; return 0; }
8989 EOF
8990 if { (eval echo configure:8991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8991   rm -rf conftest*
8992   echo "$ac_t""yes" 1>&6
8993    { test "$extra_verbose" = "yes" && cat << \EOF
8994     Defining HAVE_H_ERRNO
8995 EOF
8996 cat >> confdefs.h <<\EOF
8997 #define HAVE_H_ERRNO 1
8998 EOF
8999 }
9000
9001 else
9002   echo "configure: failed program was:" >&5
9003   cat conftest.$ac_ext >&5
9004   rm -rf conftest*
9005   echo "$ac_t""no" 1>&6
9006 fi
9007 rm -f conftest*
9008
9009 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
9010 echo "configure:9011: checking for sigsetjmp" >&5
9011 cat > conftest.$ac_ext <<EOF
9012 #line 9013 "configure"
9013 #include "confdefs.h"
9014 #include <setjmp.h>
9015 int main() {
9016 sigjmp_buf bar; sigsetjmp (bar, 0);
9017 ; return 0; }
9018 EOF
9019 if { (eval echo configure:9020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9020   rm -rf conftest*
9021   echo "$ac_t""yes" 1>&6
9022    { test "$extra_verbose" = "yes" && cat << \EOF
9023     Defining HAVE_SIGSETJMP
9024 EOF
9025 cat >> confdefs.h <<\EOF
9026 #define HAVE_SIGSETJMP 1
9027 EOF
9028 }
9029
9030 else
9031   echo "configure: failed program was:" >&5
9032   cat conftest.$ac_ext >&5
9033   rm -rf conftest*
9034   echo "$ac_t""no" 1>&6
9035 fi
9036 rm -f conftest*
9037
9038 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
9039 echo "configure:9040: checking whether localtime caches TZ" >&5
9040
9041 if test "$ac_cv_func_tzset" = "yes"; then
9042 cat > conftest.$ac_ext <<EOF
9043 #line 9044 "configure"
9044 #include "confdefs.h"
9045 #include <time.h>
9046 #if STDC_HEADERS
9047 # include <stdlib.h>
9048 #endif
9049 extern char **environ;
9050 unset_TZ ()
9051 {
9052   char **from, **to;
9053   for (to = from = environ; (*to = *from); from++)
9054     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
9055       to++;
9056 }
9057 char TZ_GMT0[] = "TZ=GMT0";
9058 char TZ_PST8[] = "TZ=PST8";
9059 main()
9060 {
9061   time_t now = time ((time_t *) 0);
9062   int hour_GMT0, hour_unset;
9063   if (putenv (TZ_GMT0) != 0)
9064     exit (1);
9065   hour_GMT0 = localtime (&now)->tm_hour;
9066   unset_TZ ();
9067   hour_unset = localtime (&now)->tm_hour;
9068   if (putenv (TZ_PST8) != 0)
9069     exit (1);
9070   if (localtime (&now)->tm_hour == hour_GMT0)
9071     exit (1);
9072   unset_TZ ();
9073   if (localtime (&now)->tm_hour != hour_unset)
9074     exit (1);
9075   exit (0);
9076 }
9077 EOF
9078 if { (eval echo configure:9079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9079 then
9080   emacs_cv_localtime_cache=no
9081 else
9082   conftest_rc="$?"
9083   echo "configure: failed program was:" >&5
9084   cat conftest.$ac_ext >&5
9085   rm -fr conftest*
9086   emacs_cv_localtime_cache=yes
9087 fi
9088 rm -fr conftest*
9089 else
9090         # If we lack tzset, report that localtime does not cache TZ,
9091         # since we can't invalidate the cache if we don't have tzset.
9092         emacs_cv_localtime_cache=no
9093 fi
9094 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
9095 if test $emacs_cv_localtime_cache = yes; then
9096   { test "$extra_verbose" = "yes" && cat << \EOF
9097     Defining LOCALTIME_CACHE
9098 EOF
9099 cat >> confdefs.h <<\EOF
9100 #define LOCALTIME_CACHE 1
9101 EOF
9102 }
9103
9104 fi
9105
9106 if test "$HAVE_TIMEVAL" = "yes"; then
9107 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
9108 echo "configure:9109: checking whether gettimeofday accepts one or two arguments" >&5
9109 cat > conftest.$ac_ext <<EOF
9110 #line 9111 "configure"
9111 #include "confdefs.h"
9112
9113 #ifdef TIME_WITH_SYS_TIME
9114 #include <sys/time.h>
9115 #include <time.h>
9116 #else
9117 #ifdef HAVE_SYS_TIME_H
9118 #include <sys/time.h>
9119 #else
9120 #include <time.h>
9121 #endif
9122 #endif
9123   
9124 int main() {
9125
9126   struct timeval time;
9127   struct timezone dummy;
9128   gettimeofday (&time, &dummy);
9129
9130 ; return 0; }
9131 EOF
9132 if { (eval echo configure:9133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9133   rm -rf conftest*
9134   echo "$ac_t""two" 1>&6
9135 else
9136   echo "configure: failed program was:" >&5
9137   cat conftest.$ac_ext >&5
9138   rm -rf conftest*
9139   echo "$ac_t""one" 1>&6
9140    { test "$extra_verbose" = "yes" && cat << \EOF
9141     Defining GETTIMEOFDAY_ONE_ARGUMENT
9142 EOF
9143 cat >> confdefs.h <<\EOF
9144 #define GETTIMEOFDAY_ONE_ARGUMENT 1
9145 EOF
9146 }
9147
9148 fi
9149 rm -f conftest*
9150 fi
9151
9152
9153 echo $ac_n "checking for inline""... $ac_c" 1>&6
9154 echo "configure:9155: checking for inline" >&5
9155
9156 ac_cv_c_inline=no
9157 for ac_kw in inline __inline__ __inline; do
9158   cat > conftest.$ac_ext <<EOF
9159 #line 9160 "configure"
9160 #include "confdefs.h"
9161
9162 int main() {
9163 } $ac_kw foo() {
9164 ; return 0; }
9165 EOF
9166 if { (eval echo configure:9167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9167   rm -rf conftest*
9168   ac_cv_c_inline=$ac_kw; break
9169 else
9170   echo "configure: failed program was:" >&5
9171   cat conftest.$ac_ext >&5
9172 fi
9173 rm -f conftest*
9174 done
9175
9176
9177 echo "$ac_t""$ac_cv_c_inline" 1>&6
9178 case "$ac_cv_c_inline" in
9179   inline | yes) ;;
9180   no) { test "$extra_verbose" = "yes" && cat << \EOF
9181     Defining inline = 
9182 EOF
9183 cat >> confdefs.h <<\EOF
9184 #define inline 
9185 EOF
9186 }
9187  ;;
9188   *)  { test "$extra_verbose" = "yes" && cat << EOF
9189     Defining inline = $ac_cv_c_inline
9190 EOF
9191 cat >> confdefs.h <<EOF
9192 #define inline $ac_cv_c_inline
9193 EOF
9194 }
9195  ;;
9196 esac
9197
9198 if test "$ac_cv_c_inline" != "no"; then
9199   { test "$extra_verbose" = "yes" && cat << \EOF
9200     Defining HAVE_INLINE
9201 EOF
9202 cat >> confdefs.h <<\EOF
9203 #define HAVE_INLINE 1
9204 EOF
9205 }
9206
9207   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9208    echo "    xemacs will be linked with \"inline.o\""
9209  fi
9210 fi
9211
9212
9213 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9214 # for constant arguments.  Useless!
9215 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9216 echo "configure:9217: checking for working alloca.h" >&5
9217
9218 cat > conftest.$ac_ext <<EOF
9219 #line 9220 "configure"
9220 #include "confdefs.h"
9221 #include <alloca.h>
9222 int main() {
9223 char *p = alloca(2 * sizeof(int));
9224 ; return 0; }
9225 EOF
9226 if { (eval echo configure:9227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9227   rm -rf conftest*
9228   ac_cv_header_alloca_h=yes
9229 else
9230   echo "configure: failed program was:" >&5
9231   cat conftest.$ac_ext >&5
9232   rm -rf conftest*
9233   ac_cv_header_alloca_h=no
9234 fi
9235 rm -f conftest*
9236
9237 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9238 if test $ac_cv_header_alloca_h = yes; then
9239   { test "$extra_verbose" = "yes" && cat << \EOF
9240     Defining HAVE_ALLOCA_H
9241 EOF
9242 cat >> confdefs.h <<\EOF
9243 #define HAVE_ALLOCA_H 1
9244 EOF
9245 }
9246
9247 fi
9248
9249 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9250 echo "configure:9251: checking for alloca" >&5
9251
9252 cat > conftest.$ac_ext <<EOF
9253 #line 9254 "configure"
9254 #include "confdefs.h"
9255
9256 #ifdef __GNUC__
9257 # define alloca __builtin_alloca
9258 #else
9259 # ifdef _MSC_VER
9260 #  include <malloc.h>
9261 #  define alloca _alloca
9262 # else
9263 #  if HAVE_ALLOCA_H
9264 #   include <alloca.h>
9265 #  else
9266 #   ifdef _AIX
9267  #pragma alloca
9268 #   else
9269 #    ifndef alloca /* predefined by HP cc +Olibcalls */
9270 char *alloca ();
9271 #    endif
9272 #   endif
9273 #  endif
9274 # endif
9275 #endif
9276
9277 int main() {
9278 char *p = (char *) alloca(1);
9279 ; return 0; }
9280 EOF
9281 if { (eval echo configure:9282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9282   rm -rf conftest*
9283   ac_cv_func_alloca_works=yes
9284 else
9285   echo "configure: failed program was:" >&5
9286   cat conftest.$ac_ext >&5
9287   rm -rf conftest*
9288   ac_cv_func_alloca_works=no
9289 fi
9290 rm -f conftest*
9291
9292 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9293 if test $ac_cv_func_alloca_works = yes; then
9294   { test "$extra_verbose" = "yes" && cat << \EOF
9295     Defining HAVE_ALLOCA
9296 EOF
9297 cat >> confdefs.h <<\EOF
9298 #define HAVE_ALLOCA 1
9299 EOF
9300 }
9301
9302 fi
9303
9304 if test $ac_cv_func_alloca_works = no; then
9305   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9306   # that cause trouble.  Some versions do not even contain alloca or
9307   # contain a buggy version.  If you still want to use their alloca,
9308   # use ar to extract alloca.o from them instead of compiling alloca.c.
9309   ALLOCA=alloca.${ac_objext}
9310   { test "$extra_verbose" = "yes" && cat << \EOF
9311     Defining C_ALLOCA
9312 EOF
9313 cat >> confdefs.h <<\EOF
9314 #define C_ALLOCA 1
9315 EOF
9316 }
9317
9318
9319 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9320 echo "configure:9321: checking whether alloca needs Cray hooks" >&5
9321
9322 cat > conftest.$ac_ext <<EOF
9323 #line 9324 "configure"
9324 #include "confdefs.h"
9325 #if defined(CRAY) && ! defined(CRAY2)
9326 webecray
9327 #else
9328 wenotbecray
9329 #endif
9330
9331 EOF
9332 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9333   egrep "webecray" >/dev/null 2>&1; then
9334   rm -rf conftest*
9335   ac_cv_os_cray=yes
9336 else
9337   rm -rf conftest*
9338   ac_cv_os_cray=no
9339 fi
9340 rm -f conftest*
9341
9342
9343 echo "$ac_t""$ac_cv_os_cray" 1>&6
9344 if test $ac_cv_os_cray = yes; then
9345 for ac_func in _getb67 GETB67 getb67; do
9346   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9347 echo "configure:9348: checking for $ac_func" >&5
9348
9349 cat > conftest.$ac_ext <<EOF
9350 #line 9351 "configure"
9351 #include "confdefs.h"
9352 /* System header to define __stub macros and hopefully few prototypes,
9353     which can conflict with char $ac_func(); below.  */
9354 #include <assert.h>
9355 /* Override any gcc2 internal prototype to avoid an error.  */
9356 /* We use char because int might match the return type of a gcc2
9357     builtin and then its argument prototype would still apply.  */
9358 char $ac_func();
9359
9360 int main() {
9361
9362 /* The GNU C library defines this for functions which it implements
9363     to always fail with ENOSYS.  Some functions are actually named
9364     something starting with __ and the normal name is an alias.  */
9365 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9366 choke me
9367 #else
9368 $ac_func();
9369 #endif
9370
9371 ; return 0; }
9372 EOF
9373 if { (eval echo configure:9374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9374   rm -rf conftest*
9375   eval "ac_cv_func_$ac_func=yes"
9376 else
9377   echo "configure: failed program was:" >&5
9378   cat conftest.$ac_ext >&5
9379   rm -rf conftest*
9380   eval "ac_cv_func_$ac_func=no"
9381 fi
9382 rm -f conftest*
9383
9384 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9385   echo "$ac_t""yes" 1>&6
9386   { test "$extra_verbose" = "yes" && cat << EOF
9387     Defining CRAY_STACKSEG_END = $ac_func
9388 EOF
9389 cat >> confdefs.h <<EOF
9390 #define CRAY_STACKSEG_END $ac_func
9391 EOF
9392 }
9393
9394   break
9395 else
9396   echo "$ac_t""no" 1>&6
9397 fi
9398
9399 done
9400 fi
9401
9402 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9403 echo "configure:9404: checking stack direction for C alloca" >&5
9404
9405 cat > conftest.$ac_ext <<EOF
9406 #line 9407 "configure"
9407 #include "confdefs.h"
9408 find_stack_direction ()
9409 {
9410   static char *addr = 0;
9411   auto char dummy;
9412   if (addr == 0)
9413     {
9414       addr = &dummy;
9415       return find_stack_direction ();
9416     }
9417   else
9418     return (&dummy > addr) ? 1 : -1;
9419 }
9420 main ()
9421 {
9422   exit (find_stack_direction() < 0);
9423 }
9424 EOF
9425 if { (eval echo configure:9426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9426 then
9427   ac_cv_c_stack_direction=1
9428 else
9429   conftest_rc="$?"
9430   echo "configure: failed program was:" >&5
9431   cat conftest.$ac_ext >&5
9432   rm -fr conftest*
9433   ac_cv_c_stack_direction=-1
9434 fi
9435 rm -fr conftest*
9436
9437 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9438 { test "$extra_verbose" = "yes" && cat << EOF
9439     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9440 EOF
9441 cat >> confdefs.h <<EOF
9442 #define STACK_DIRECTION $ac_cv_c_stack_direction
9443 EOF
9444 }
9445
9446 fi
9447
9448 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9449    echo "    xemacs will be linked with \"$ALLOCA\""
9450  fi
9451
9452 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9453 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9454 echo "configure:9455: checking for vfork.h" >&5
9455
9456 cat > conftest.$ac_ext <<EOF
9457 #line 9458 "configure"
9458 #include "confdefs.h"
9459 #include <vfork.h>
9460 EOF
9461 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9462 { (eval echo configure:9463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9463 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9464 if test -z "$ac_err"; then
9465   rm -rf conftest*
9466   eval "ac_cv_header_$ac_safe=yes"
9467 else
9468   echo "$ac_err" >&5
9469   echo "configure: failed program was:" >&5
9470   cat conftest.$ac_ext >&5
9471   rm -rf conftest*
9472   eval "ac_cv_header_$ac_safe=no"
9473 fi
9474 rm -f conftest*
9475 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9476   echo "$ac_t""yes" 1>&6
9477   { test "$extra_verbose" = "yes" && cat << \EOF
9478     Defining HAVE_VFORK_H
9479 EOF
9480 cat >> confdefs.h <<\EOF
9481 #define HAVE_VFORK_H 1
9482 EOF
9483 }
9484
9485 else
9486   echo "$ac_t""no" 1>&6
9487 fi
9488
9489 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9490 echo "configure:9491: checking for working vfork" >&5
9491
9492 cat > conftest.$ac_ext <<EOF
9493 #line 9494 "configure"
9494 #include "confdefs.h"
9495 /* Thanks to Paul Eggert for this test.  */
9496 #include <stdio.h>
9497 #include <sys/types.h>
9498 #include <sys/stat.h>
9499 #ifdef HAVE_UNISTD_H
9500 #include <unistd.h>
9501 #endif
9502 #ifdef HAVE_VFORK_H
9503 #include <vfork.h>
9504 #endif
9505 /* On some sparc systems, changes by the child to local and incoming
9506    argument registers are propagated back to the parent.
9507    The compiler is told about this with #include <vfork.h>,
9508    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9509    Test for this by using a static variable whose address
9510    is put into a register that is clobbered by the vfork.  */
9511 static
9512 #ifdef __cplusplus
9513 sparc_address_test (int arg)
9514 #else
9515 sparc_address_test (arg) int arg;
9516 #endif
9517 {
9518   static pid_t child;
9519   if (!child) {
9520     child = vfork ();
9521     if (child < 0) {
9522       perror ("vfork");
9523       _exit(2);
9524     }
9525     if (!child) {
9526       arg = getpid();
9527       write(-1, "", 0);
9528       _exit (arg);
9529     }
9530   }
9531 }
9532 main() {
9533   pid_t parent = getpid ();
9534   pid_t child;
9535
9536   sparc_address_test ();
9537
9538   child = vfork ();
9539
9540   if (child == 0) {
9541     /* Here is another test for sparc vfork register problems.
9542        This test uses lots of local variables, at least
9543        as many local variables as main has allocated so far
9544        including compiler temporaries.  4 locals are enough for
9545        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9546        A buggy compiler should reuse the register of parent
9547        for one of the local variables, since it will think that
9548        parent can't possibly be used any more in this routine.
9549        Assigning to the local variable will thus munge parent
9550        in the parent process.  */
9551     pid_t
9552       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9553       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9554     /* Convince the compiler that p..p7 are live; otherwise, it might
9555        use the same hardware register for all 8 local variables.  */
9556     if (p != p1 || p != p2 || p != p3 || p != p4
9557         || p != p5 || p != p6 || p != p7)
9558       _exit(1);
9559
9560     /* On some systems (e.g. IRIX 3.3),
9561        vfork doesn't separate parent from child file descriptors.
9562        If the child closes a descriptor before it execs or exits,
9563        this munges the parent's descriptor as well.
9564        Test for this by closing stdout in the child.  */
9565     _exit(close(fileno(stdout)) != 0);
9566   } else {
9567     int status;
9568     struct stat st;
9569
9570     while (wait(&status) != child)
9571       ;
9572     exit(
9573          /* Was there some problem with vforking?  */
9574          child < 0
9575
9576          /* Did the child fail?  (This shouldn't happen.)  */
9577          || status
9578
9579          /* Did the vfork/compiler bug occur?  */
9580          || parent != getpid()
9581
9582          /* Did the file descriptor bug occur?  */
9583          || fstat(fileno(stdout), &st) != 0
9584          );
9585   }
9586 }
9587 EOF
9588 if { (eval echo configure:9589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9589 then
9590   ac_cv_func_vfork_works=yes
9591 else
9592   conftest_rc="$?"
9593   echo "configure: failed program was:" >&5
9594   cat conftest.$ac_ext >&5
9595   rm -fr conftest*
9596   ac_cv_func_vfork_works=no
9597 fi
9598 rm -fr conftest*
9599
9600 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9601 if test $ac_cv_func_vfork_works = no; then
9602   { test "$extra_verbose" = "yes" && cat << \EOF
9603     Defining vfork = fork
9604 EOF
9605 cat >> confdefs.h <<\EOF
9606 #define vfork fork
9607 EOF
9608 }
9609
9610 fi
9611
9612
9613 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9614 echo "configure:9615: checking for working strcoll" >&5
9615
9616 cat > conftest.$ac_ext <<EOF
9617 #line 9618 "configure"
9618 #include "confdefs.h"
9619 #include <string.h>
9620 main ()
9621 {
9622   exit (strcoll ("abc", "def") >= 0 ||
9623         strcoll ("ABC", "DEF") >= 0 ||
9624         strcoll ("123", "456") >= 0);
9625 }
9626 EOF
9627 if { (eval echo configure:9628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9628 then
9629   ac_cv_func_strcoll_works=yes
9630 else
9631   conftest_rc="$?"
9632   echo "configure: failed program was:" >&5
9633   cat conftest.$ac_ext >&5
9634   rm -fr conftest*
9635   ac_cv_func_strcoll_works=no
9636 fi
9637 rm -fr conftest*
9638
9639 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9640 if test $ac_cv_func_strcoll_works = yes; then
9641   { test "$extra_verbose" = "yes" && cat << \EOF
9642     Defining HAVE_STRCOLL
9643 EOF
9644 cat >> confdefs.h <<\EOF
9645 #define HAVE_STRCOLL 1
9646 EOF
9647 }
9648
9649 fi
9650
9651
9652 for ac_func in getpgrp
9653 do
9654 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9655 echo "configure:9656: checking for $ac_func" >&5
9656
9657 cat > conftest.$ac_ext <<EOF
9658 #line 9659 "configure"
9659 #include "confdefs.h"
9660 /* System header to define __stub macros and hopefully few prototypes,
9661     which can conflict with char $ac_func(); below.  */
9662 #include <assert.h>
9663 /* Override any gcc2 internal prototype to avoid an error.  */
9664 /* We use char because int might match the return type of a gcc2
9665     builtin and then its argument prototype would still apply.  */
9666 char $ac_func();
9667
9668 int main() {
9669
9670 /* The GNU C library defines this for functions which it implements
9671     to always fail with ENOSYS.  Some functions are actually named
9672     something starting with __ and the normal name is an alias.  */
9673 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9674 choke me
9675 #else
9676 $ac_func();
9677 #endif
9678
9679 ; return 0; }
9680 EOF
9681 if { (eval echo configure:9682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9682   rm -rf conftest*
9683   eval "ac_cv_func_$ac_func=yes"
9684 else
9685   echo "configure: failed program was:" >&5
9686   cat conftest.$ac_ext >&5
9687   rm -rf conftest*
9688   eval "ac_cv_func_$ac_func=no"
9689 fi
9690 rm -f conftest*
9691
9692 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9693   echo "$ac_t""yes" 1>&6
9694     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9695   { test "$extra_verbose" = "yes" && cat << EOF
9696     Defining $ac_tr_func
9697 EOF
9698 cat >> confdefs.h <<EOF
9699 #define $ac_tr_func 1
9700 EOF
9701 }
9702  
9703 else
9704   echo "$ac_t""no" 1>&6
9705 fi
9706 done
9707
9708 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9709 echo "configure:9710: checking whether getpgrp takes no argument" >&5
9710
9711 cat > conftest.$ac_ext <<EOF
9712 #line 9713 "configure"
9713 #include "confdefs.h"
9714
9715 /*
9716  * If this system has a BSD-style getpgrp(),
9717  * which takes a pid argument, exit unsuccessfully.
9718  *
9719  * Snarfed from Chet Ramey's bash pgrp.c test program
9720  */
9721 #include <stdio.h>
9722 #include <sys/types.h>
9723
9724 int     pid;
9725 int     pg1, pg2, pg3, pg4;
9726 int     ng, np, s, child;
9727
9728 main()
9729 {
9730         pid = getpid();
9731         pg1 = getpgrp(0);
9732         pg2 = getpgrp();
9733         pg3 = getpgrp(pid);
9734         pg4 = getpgrp(1);
9735
9736         /*
9737          * If all of these values are the same, it's pretty sure that
9738          * we're on a system that ignores getpgrp's first argument.
9739          */
9740         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9741                 exit(0);
9742
9743         child = fork();
9744         if (child < 0)
9745                 exit(1);
9746         else if (child == 0) {
9747                 np = getpid();
9748                 /*
9749                  * If this is Sys V, this will not work; pgrp will be
9750                  * set to np because setpgrp just changes a pgrp to be
9751                  * the same as the pid.
9752                  */
9753                 setpgrp(np, pg1);
9754                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9755                 if (ng == pg1) {
9756                         exit(1);
9757                 } else {
9758                         exit(0);
9759                 }
9760         } else {
9761                 wait(&s);
9762                 exit(s>>8);
9763         }
9764 }
9765
9766 EOF
9767 if { (eval echo configure:9768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9768 then
9769   ac_cv_func_getpgrp_void=yes
9770 else
9771   conftest_rc="$?"
9772   echo "configure: failed program was:" >&5
9773   cat conftest.$ac_ext >&5
9774   rm -fr conftest*
9775   ac_cv_func_getpgrp_void=no
9776 fi
9777 rm -fr conftest*
9778
9779
9780 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9781 if test $ac_cv_func_getpgrp_void = yes; then
9782   { test "$extra_verbose" = "yes" && cat << \EOF
9783     Defining GETPGRP_VOID
9784 EOF
9785 cat >> confdefs.h <<\EOF
9786 #define GETPGRP_VOID 1
9787 EOF
9788 }
9789
9790 fi
9791
9792
9793 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9794 echo "configure:9795: checking for working mmap" >&5
9795 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9796 cat > conftest.$ac_ext <<EOF
9797 #line 9798 "configure"
9798 #include "confdefs.h"
9799 #include <stdio.h>
9800 #include <unistd.h>
9801 #include <fcntl.h>
9802 #include <sys/mman.h>
9803
9804 #ifndef MAP_VARIABLE
9805 #define MAP_VARIABLE 0
9806 #endif
9807
9808 #ifndef MAP_FAILED
9809 #define MAP_FAILED -1
9810 #endif
9811
9812 int main (int argc, char *argv[])
9813 {
9814   int fd = -1;
9815   caddr_t p;
9816 #ifndef MAP_ANONYMOUS
9817   fd = open ("/dev/zero", O_RDWR);
9818   if (fd < 0)
9819     return 1;
9820 #define MAP_ANONYMOUS 0
9821 #endif
9822   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9823            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9824            fd, 0) != (void *) MAP_FAILED)
9825     return 0;
9826   perror ("conftest: mmap failed");
9827   return 1;
9828 }
9829 EOF
9830 if { (eval echo configure:9831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9831 then
9832   have_mmap=yes
9833 else
9834   conftest_rc="$?"
9835   echo "configure: failed program was:" >&5
9836   cat conftest.$ac_ext >&5
9837   rm -fr conftest*
9838   have_mmap=no
9839 fi
9840 rm -fr conftest* ;;
9841 esac
9842 echo "$ac_t""$have_mmap" 1>&6
9843 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9844     Defining HAVE_MMAP
9845 EOF
9846 cat >> confdefs.h <<\EOF
9847 #define HAVE_MMAP 1
9848 EOF
9849 }
9850
9851 for ac_hdr in unistd.h
9852 do
9853 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9854 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9855 echo "configure:9856: checking for $ac_hdr" >&5
9856
9857 cat > conftest.$ac_ext <<EOF
9858 #line 9859 "configure"
9859 #include "confdefs.h"
9860 #include <$ac_hdr>
9861 EOF
9862 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9863 { (eval echo configure:9864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9864 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9865 if test -z "$ac_err"; then
9866   rm -rf conftest*
9867   eval "ac_cv_header_$ac_safe=yes"
9868 else
9869   echo "$ac_err" >&5
9870   echo "configure: failed program was:" >&5
9871   cat conftest.$ac_ext >&5
9872   rm -rf conftest*
9873   eval "ac_cv_header_$ac_safe=no"
9874 fi
9875 rm -f conftest*
9876 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9877   echo "$ac_t""yes" 1>&6
9878     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9879   { test "$extra_verbose" = "yes" && cat << EOF
9880     Defining $ac_tr_hdr
9881 EOF
9882 cat >> confdefs.h <<EOF
9883 #define $ac_tr_hdr 1
9884 EOF
9885 }
9886  
9887 else
9888   echo "$ac_t""no" 1>&6
9889 fi
9890 done
9891
9892 for ac_func in getpagesize
9893 do
9894 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9895 echo "configure:9896: checking for $ac_func" >&5
9896
9897 cat > conftest.$ac_ext <<EOF
9898 #line 9899 "configure"
9899 #include "confdefs.h"
9900 /* System header to define __stub macros and hopefully few prototypes,
9901     which can conflict with char $ac_func(); below.  */
9902 #include <assert.h>
9903 /* Override any gcc2 internal prototype to avoid an error.  */
9904 /* We use char because int might match the return type of a gcc2
9905     builtin and then its argument prototype would still apply.  */
9906 char $ac_func();
9907
9908 int main() {
9909
9910 /* The GNU C library defines this for functions which it implements
9911     to always fail with ENOSYS.  Some functions are actually named
9912     something starting with __ and the normal name is an alias.  */
9913 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9914 choke me
9915 #else
9916 $ac_func();
9917 #endif
9918
9919 ; return 0; }
9920 EOF
9921 if { (eval echo configure:9922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9922   rm -rf conftest*
9923   eval "ac_cv_func_$ac_func=yes"
9924 else
9925   echo "configure: failed program was:" >&5
9926   cat conftest.$ac_ext >&5
9927   rm -rf conftest*
9928   eval "ac_cv_func_$ac_func=no"
9929 fi
9930 rm -f conftest*
9931
9932 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9933   echo "$ac_t""yes" 1>&6
9934     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9935   { test "$extra_verbose" = "yes" && cat << EOF
9936     Defining $ac_tr_func
9937 EOF
9938 cat >> confdefs.h <<EOF
9939 #define $ac_tr_func 1
9940 EOF
9941 }
9942  
9943 else
9944   echo "$ac_t""no" 1>&6
9945 fi
9946 done
9947
9948 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9949 echo "configure:9950: checking for working mmap" >&5
9950
9951 cat > conftest.$ac_ext <<EOF
9952 #line 9953 "configure"
9953 #include "confdefs.h"
9954
9955 /* Thanks to Mike Haertel and Jim Avera for this test.
9956    Here is a matrix of mmap possibilities:
9957         mmap private not fixed
9958         mmap private fixed at somewhere currently unmapped
9959         mmap private fixed at somewhere already mapped
9960         mmap shared not fixed
9961         mmap shared fixed at somewhere currently unmapped
9962         mmap shared fixed at somewhere already mapped
9963    For private mappings, we should verify that changes cannot be read()
9964    back from the file, nor mmap's back from the file at a different
9965    address.  (There have been systems where private was not correctly
9966    implemented like the infamous i386 svr4.0, and systems where the
9967    VM page cache was not coherent with the filesystem buffer cache
9968    like early versions of FreeBSD and possibly contemporary NetBSD.)
9969    For shared mappings, we should conversely verify that changes get
9970    propogated back to all the places they're supposed to be.
9971
9972    Grep wants private fixed already mapped.
9973    The main things grep needs to know about mmap are:
9974    * does it exist and is it safe to write into the mmap'd area
9975    * how to use it (BSD variants)  */
9976 #include <sys/types.h>
9977 #include <fcntl.h>
9978 #include <sys/mman.h>
9979
9980 /* This mess was copied from the GNU getpagesize.h.  */
9981 #ifndef HAVE_GETPAGESIZE
9982 # ifdef HAVE_UNISTD_H
9983 #  include <unistd.h>
9984 # endif
9985
9986 /* Assume that all systems that can run configure have sys/param.h.  */
9987 # ifndef HAVE_SYS_PARAM_H
9988 #  define HAVE_SYS_PARAM_H 1
9989 # endif
9990
9991 # ifdef _SC_PAGESIZE
9992 #  define getpagesize() sysconf(_SC_PAGESIZE)
9993 # else /* no _SC_PAGESIZE */
9994 #  ifdef HAVE_SYS_PARAM_H
9995 #   include <sys/param.h>
9996 #   ifdef EXEC_PAGESIZE
9997 #    define getpagesize() EXEC_PAGESIZE
9998 #   else /* no EXEC_PAGESIZE */
9999 #    ifdef NBPG
10000 #     define getpagesize() NBPG * CLSIZE
10001 #     ifndef CLSIZE
10002 #      define CLSIZE 1
10003 #     endif /* no CLSIZE */
10004 #    else /* no NBPG */
10005 #     ifdef NBPC
10006 #      define getpagesize() NBPC
10007 #     else /* no NBPC */
10008 #      ifdef PAGESIZE
10009 #       define getpagesize() PAGESIZE
10010 #      endif /* PAGESIZE */
10011 #     endif /* no NBPC */
10012 #    endif /* no NBPG */
10013 #   endif /* no EXEC_PAGESIZE */
10014 #  else /* no HAVE_SYS_PARAM_H */
10015 #   define getpagesize() 8192   /* punt totally */
10016 #  endif /* no HAVE_SYS_PARAM_H */
10017 # endif /* no _SC_PAGESIZE */
10018
10019 #endif /* no HAVE_GETPAGESIZE */
10020
10021 #ifdef __cplusplus
10022 extern "C" { void *malloc(unsigned); }
10023 #else
10024 char *malloc();
10025 #endif
10026
10027 int
10028 main()
10029 {
10030         char *data, *data2, *data3;
10031         int i, pagesize;
10032         int fd;
10033
10034         pagesize = getpagesize();
10035
10036         /*
10037          * First, make a file with some known garbage in it.
10038          */
10039         data = malloc(pagesize);
10040         if (!data)
10041                 exit(1);
10042         for (i = 0; i < pagesize; ++i)
10043                 *(data + i) = rand();
10044         umask(0);
10045         fd = creat("conftestmmap", 0600);
10046         if (fd < 0)
10047                 exit(1);
10048         if (write(fd, data, pagesize) != pagesize)
10049                 exit(1);
10050         close(fd);
10051
10052         /*
10053          * Next, try to mmap the file at a fixed address which
10054          * already has something else allocated at it.  If we can,
10055          * also make sure that we see the same garbage.
10056          */
10057         fd = open("conftestmmap", O_RDWR);
10058         if (fd < 0)
10059                 exit(1);
10060         data2 = malloc(2 * pagesize);
10061         if (!data2)
10062                 exit(1);
10063         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
10064         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
10065             MAP_PRIVATE | MAP_FIXED, fd, 0L))
10066                 exit(1);
10067         for (i = 0; i < pagesize; ++i)
10068                 if (*(data + i) != *(data2 + i))
10069                         exit(1);
10070
10071         /*
10072          * Finally, make sure that changes to the mapped area
10073          * do not percolate back to the file as seen by read().
10074          * (This is a bug on some variants of i386 svr4.0.)
10075          */
10076         for (i = 0; i < pagesize; ++i)
10077                 *(data2 + i) = *(data2 + i) + 1;
10078         data3 = malloc(pagesize);
10079         if (!data3)
10080                 exit(1);
10081         if (read(fd, data3, pagesize) != pagesize)
10082                 exit(1);
10083         for (i = 0; i < pagesize; ++i)
10084                 if (*(data + i) != *(data3 + i))
10085                         exit(1);
10086         close(fd);
10087         unlink("conftestmmap");
10088         exit(0);
10089 }
10090
10091 EOF
10092 if { (eval echo configure:10093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10093 then
10094   ac_cv_func_mmap_fixed_mapped=yes
10095 else
10096   conftest_rc="$?"
10097   echo "configure: failed program was:" >&5
10098   cat conftest.$ac_ext >&5
10099   rm -fr conftest*
10100   ac_cv_func_mmap_fixed_mapped=no
10101 fi
10102 rm -fr conftest*
10103
10104 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
10105 if test $ac_cv_func_mmap_fixed_mapped = yes; then
10106   { test "$extra_verbose" = "yes" && cat << \EOF
10107     Defining HAVE_MMAP
10108 EOF
10109 cat >> confdefs.h <<\EOF
10110 #define HAVE_MMAP 1
10111 EOF
10112 }
10113
10114 fi
10115
10116
10117 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
10118 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
10119 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10120     Defining REL_ALLOC
10121 EOF
10122 cat >> confdefs.h <<\EOF
10123 #define REL_ALLOC 1
10124 EOF
10125 }
10126
10127
10128 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
10129 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
10130 echo "configure:10131: checking for termios.h" >&5
10131
10132 cat > conftest.$ac_ext <<EOF
10133 #line 10134 "configure"
10134 #include "confdefs.h"
10135 #include <termios.h>
10136 EOF
10137 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10138 { (eval echo configure:10139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10139 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10140 if test -z "$ac_err"; then
10141   rm -rf conftest*
10142   eval "ac_cv_header_$ac_safe=yes"
10143 else
10144   echo "$ac_err" >&5
10145   echo "configure: failed program was:" >&5
10146   cat conftest.$ac_ext >&5
10147   rm -rf conftest*
10148   eval "ac_cv_header_$ac_safe=no"
10149 fi
10150 rm -f conftest*
10151 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10152   echo "$ac_t""yes" 1>&6
10153   { test "$extra_verbose" = "yes" && cat << \EOF
10154     Defining HAVE_TERMIOS
10155 EOF
10156 cat >> confdefs.h <<\EOF
10157 #define HAVE_TERMIOS 1
10158 EOF
10159 }
10160
10161   { test "$extra_verbose" = "yes" && cat << \EOF
10162     Defining SIGNALS_VIA_CHARACTERS
10163 EOF
10164 cat >> confdefs.h <<\EOF
10165 #define SIGNALS_VIA_CHARACTERS 1
10166 EOF
10167 }
10168
10169   { test "$extra_verbose" = "yes" && cat << \EOF
10170     Defining NO_TERMIO
10171 EOF
10172 cat >> confdefs.h <<\EOF
10173 #define NO_TERMIO 1
10174 EOF
10175 }
10176
10177 else
10178   echo "$ac_t""no" 1>&6
10179 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10180 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10181 echo "configure:10182: checking for termio.h" >&5
10182
10183 cat > conftest.$ac_ext <<EOF
10184 #line 10185 "configure"
10185 #include "confdefs.h"
10186 #include <termio.h>
10187 EOF
10188 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10189 { (eval echo configure:10190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10190 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10191 if test -z "$ac_err"; then
10192   rm -rf conftest*
10193   eval "ac_cv_header_$ac_safe=yes"
10194 else
10195   echo "$ac_err" >&5
10196   echo "configure: failed program was:" >&5
10197   cat conftest.$ac_ext >&5
10198   rm -rf conftest*
10199   eval "ac_cv_header_$ac_safe=no"
10200 fi
10201 rm -f conftest*
10202 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10203   echo "$ac_t""yes" 1>&6
10204   { test "$extra_verbose" = "yes" && cat << \EOF
10205     Defining HAVE_TERMIO
10206 EOF
10207 cat >> confdefs.h <<\EOF
10208 #define HAVE_TERMIO 1
10209 EOF
10210 }
10211
10212 else
10213   echo "$ac_t""no" 1>&6
10214 fi
10215
10216 fi
10217
10218
10219
10220 echo $ac_n "checking for socket""... $ac_c" 1>&6
10221 echo "configure:10222: checking for socket" >&5
10222
10223 cat > conftest.$ac_ext <<EOF
10224 #line 10225 "configure"
10225 #include "confdefs.h"
10226 /* System header to define __stub macros and hopefully few prototypes,
10227     which can conflict with char socket(); below.  */
10228 #include <assert.h>
10229 /* Override any gcc2 internal prototype to avoid an error.  */
10230 /* We use char because int might match the return type of a gcc2
10231     builtin and then its argument prototype would still apply.  */
10232 char socket();
10233
10234 int main() {
10235
10236 /* The GNU C library defines this for functions which it implements
10237     to always fail with ENOSYS.  Some functions are actually named
10238     something starting with __ and the normal name is an alias.  */
10239 #if defined (__stub_socket) || defined (__stub___socket)
10240 choke me
10241 #else
10242 socket();
10243 #endif
10244
10245 ; return 0; }
10246 EOF
10247 if { (eval echo configure:10248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10248   rm -rf conftest*
10249   eval "ac_cv_func_socket=yes"
10250 else
10251   echo "configure: failed program was:" >&5
10252   cat conftest.$ac_ext >&5
10253   rm -rf conftest*
10254   eval "ac_cv_func_socket=no"
10255 fi
10256 rm -f conftest*
10257
10258 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10259   echo "$ac_t""yes" 1>&6
10260   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10261 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10262 echo "configure:10263: checking for netinet/in.h" >&5
10263
10264 cat > conftest.$ac_ext <<EOF
10265 #line 10266 "configure"
10266 #include "confdefs.h"
10267 #include <netinet/in.h>
10268 EOF
10269 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10270 { (eval echo configure:10271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10271 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10272 if test -z "$ac_err"; then
10273   rm -rf conftest*
10274   eval "ac_cv_header_$ac_safe=yes"
10275 else
10276   echo "$ac_err" >&5
10277   echo "configure: failed program was:" >&5
10278   cat conftest.$ac_ext >&5
10279   rm -rf conftest*
10280   eval "ac_cv_header_$ac_safe=no"
10281 fi
10282 rm -f conftest*
10283 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10284   echo "$ac_t""yes" 1>&6
10285   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10286 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10287 echo "configure:10288: checking for arpa/inet.h" >&5
10288
10289 cat > conftest.$ac_ext <<EOF
10290 #line 10291 "configure"
10291 #include "confdefs.h"
10292 #include <arpa/inet.h>
10293 EOF
10294 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10295 { (eval echo configure:10296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10296 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10297 if test -z "$ac_err"; then
10298   rm -rf conftest*
10299   eval "ac_cv_header_$ac_safe=yes"
10300 else
10301   echo "$ac_err" >&5
10302   echo "configure: failed program was:" >&5
10303   cat conftest.$ac_ext >&5
10304   rm -rf conftest*
10305   eval "ac_cv_header_$ac_safe=no"
10306 fi
10307 rm -f conftest*
10308 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10309   echo "$ac_t""yes" 1>&6
10310   
10311   { test "$extra_verbose" = "yes" && cat << \EOF
10312     Defining HAVE_SOCKETS
10313 EOF
10314 cat >> confdefs.h <<\EOF
10315 #define HAVE_SOCKETS 1
10316 EOF
10317 }
10318
10319       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10320 echo "configure:10321: checking "for sun_len member in struct sockaddr_un"" >&5
10321       cat > conftest.$ac_ext <<EOF
10322 #line 10323 "configure"
10323 #include "confdefs.h"
10324
10325 #include <sys/types.h>
10326 #include <sys/socket.h>
10327 #include <sys/un.h>
10328       
10329 int main() {
10330 static struct sockaddr_un x; x.sun_len = 1;
10331 ; return 0; }
10332 EOF
10333 if { (eval echo configure:10334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10334   rm -rf conftest*
10335   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10336     Defining HAVE_SOCKADDR_SUN_LEN
10337 EOF
10338 cat >> confdefs.h <<\EOF
10339 #define HAVE_SOCKADDR_SUN_LEN 1
10340 EOF
10341 }
10342
10343 else
10344   echo "configure: failed program was:" >&5
10345   cat conftest.$ac_ext >&5
10346   rm -rf conftest*
10347   echo "$ac_t""no" 1>&6
10348 fi
10349 rm -f conftest*
10350       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10351 echo "configure:10352: checking "for ip_mreq struct in netinet/in.h"" >&5
10352       cat > conftest.$ac_ext <<EOF
10353 #line 10354 "configure"
10354 #include "confdefs.h"
10355
10356 #include <sys/types.h>
10357 #include <netinet/in.h>
10358       
10359 int main() {
10360 static struct ip_mreq x;
10361 ; return 0; }
10362 EOF
10363 if { (eval echo configure:10364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10364   rm -rf conftest*
10365   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10366     Defining HAVE_MULTICAST
10367 EOF
10368 cat >> confdefs.h <<\EOF
10369 #define HAVE_MULTICAST 1
10370 EOF
10371 }
10372
10373 else
10374   echo "configure: failed program was:" >&5
10375   cat conftest.$ac_ext >&5
10376   rm -rf conftest*
10377   echo "$ac_t""no" 1>&6
10378 fi
10379 rm -f conftest*
10380 else
10381   echo "$ac_t""no" 1>&6
10382 fi
10383
10384 else
10385   echo "$ac_t""no" 1>&6
10386 fi
10387
10388 else
10389   echo "$ac_t""no" 1>&6
10390 fi
10391
10392
10393 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10394 echo "configure:10395: checking for msgget" >&5
10395
10396 cat > conftest.$ac_ext <<EOF
10397 #line 10398 "configure"
10398 #include "confdefs.h"
10399 /* System header to define __stub macros and hopefully few prototypes,
10400     which can conflict with char msgget(); below.  */
10401 #include <assert.h>
10402 /* Override any gcc2 internal prototype to avoid an error.  */
10403 /* We use char because int might match the return type of a gcc2
10404     builtin and then its argument prototype would still apply.  */
10405 char msgget();
10406
10407 int main() {
10408
10409 /* The GNU C library defines this for functions which it implements
10410     to always fail with ENOSYS.  Some functions are actually named
10411     something starting with __ and the normal name is an alias.  */
10412 #if defined (__stub_msgget) || defined (__stub___msgget)
10413 choke me
10414 #else
10415 msgget();
10416 #endif
10417
10418 ; return 0; }
10419 EOF
10420 if { (eval echo configure:10421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10421   rm -rf conftest*
10422   eval "ac_cv_func_msgget=yes"
10423 else
10424   echo "configure: failed program was:" >&5
10425   cat conftest.$ac_ext >&5
10426   rm -rf conftest*
10427   eval "ac_cv_func_msgget=no"
10428 fi
10429 rm -f conftest*
10430
10431 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10432   echo "$ac_t""yes" 1>&6
10433   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10434 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10435 echo "configure:10436: checking for sys/ipc.h" >&5
10436
10437 cat > conftest.$ac_ext <<EOF
10438 #line 10439 "configure"
10439 #include "confdefs.h"
10440 #include <sys/ipc.h>
10441 EOF
10442 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10443 { (eval echo configure:10444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10444 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10445 if test -z "$ac_err"; then
10446   rm -rf conftest*
10447   eval "ac_cv_header_$ac_safe=yes"
10448 else
10449   echo "$ac_err" >&5
10450   echo "configure: failed program was:" >&5
10451   cat conftest.$ac_ext >&5
10452   rm -rf conftest*
10453   eval "ac_cv_header_$ac_safe=no"
10454 fi
10455 rm -f conftest*
10456 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10457   echo "$ac_t""yes" 1>&6
10458   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10459 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10460 echo "configure:10461: checking for sys/msg.h" >&5
10461
10462 cat > conftest.$ac_ext <<EOF
10463 #line 10464 "configure"
10464 #include "confdefs.h"
10465 #include <sys/msg.h>
10466 EOF
10467 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10468 { (eval echo configure:10469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10469 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10470 if test -z "$ac_err"; then
10471   rm -rf conftest*
10472   eval "ac_cv_header_$ac_safe=yes"
10473 else
10474   echo "$ac_err" >&5
10475   echo "configure: failed program was:" >&5
10476   cat conftest.$ac_ext >&5
10477   rm -rf conftest*
10478   eval "ac_cv_header_$ac_safe=no"
10479 fi
10480 rm -f conftest*
10481 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10482   echo "$ac_t""yes" 1>&6
10483   { test "$extra_verbose" = "yes" && cat << \EOF
10484     Defining HAVE_SYSVIPC
10485 EOF
10486 cat >> confdefs.h <<\EOF
10487 #define HAVE_SYSVIPC 1
10488 EOF
10489 }
10490
10491 else
10492   echo "$ac_t""no" 1>&6
10493 fi
10494
10495 else
10496   echo "$ac_t""no" 1>&6
10497 fi
10498
10499 else
10500   echo "$ac_t""no" 1>&6
10501 fi
10502
10503
10504 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10505 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10506 echo "configure:10507: checking for dirent.h" >&5
10507
10508 cat > conftest.$ac_ext <<EOF
10509 #line 10510 "configure"
10510 #include "confdefs.h"
10511 #include <dirent.h>
10512 EOF
10513 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10514 { (eval echo configure:10515: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10515 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10516 if test -z "$ac_err"; then
10517   rm -rf conftest*
10518   eval "ac_cv_header_$ac_safe=yes"
10519 else
10520   echo "$ac_err" >&5
10521   echo "configure: failed program was:" >&5
10522   cat conftest.$ac_ext >&5
10523   rm -rf conftest*
10524   eval "ac_cv_header_$ac_safe=no"
10525 fi
10526 rm -f conftest*
10527 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10528   echo "$ac_t""yes" 1>&6
10529   { test "$extra_verbose" = "yes" && cat << \EOF
10530     Defining SYSV_SYSTEM_DIR
10531 EOF
10532 cat >> confdefs.h <<\EOF
10533 #define SYSV_SYSTEM_DIR 1
10534 EOF
10535 }
10536
10537 else
10538   echo "$ac_t""no" 1>&6
10539 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10540 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10541 echo "configure:10542: checking for sys/dir.h" >&5
10542
10543 cat > conftest.$ac_ext <<EOF
10544 #line 10545 "configure"
10545 #include "confdefs.h"
10546 #include <sys/dir.h>
10547 EOF
10548 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10549 { (eval echo configure:10550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10550 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10551 if test -z "$ac_err"; then
10552   rm -rf conftest*
10553   eval "ac_cv_header_$ac_safe=yes"
10554 else
10555   echo "$ac_err" >&5
10556   echo "configure: failed program was:" >&5
10557   cat conftest.$ac_ext >&5
10558   rm -rf conftest*
10559   eval "ac_cv_header_$ac_safe=no"
10560 fi
10561 rm -f conftest*
10562 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10563   echo "$ac_t""yes" 1>&6
10564   :
10565 else
10566   echo "$ac_t""no" 1>&6
10567 { test "$extra_verbose" = "yes" && cat << \EOF
10568     Defining NONSYSTEM_DIR_LIBRARY
10569 EOF
10570 cat >> confdefs.h <<\EOF
10571 #define NONSYSTEM_DIR_LIBRARY 1
10572 EOF
10573 }
10574
10575 fi
10576
10577 fi
10578
10579
10580 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10581 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10582 echo "configure:10583: checking for nlist.h" >&5
10583
10584 cat > conftest.$ac_ext <<EOF
10585 #line 10586 "configure"
10586 #include "confdefs.h"
10587 #include <nlist.h>
10588 EOF
10589 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10590 { (eval echo configure:10591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10591 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10592 if test -z "$ac_err"; then
10593   rm -rf conftest*
10594   eval "ac_cv_header_$ac_safe=yes"
10595 else
10596   echo "$ac_err" >&5
10597   echo "configure: failed program was:" >&5
10598   cat conftest.$ac_ext >&5
10599   rm -rf conftest*
10600   eval "ac_cv_header_$ac_safe=no"
10601 fi
10602 rm -f conftest*
10603 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10604   echo "$ac_t""yes" 1>&6
10605   { test "$extra_verbose" = "yes" && cat << \EOF
10606     Defining NLIST_STRUCT
10607 EOF
10608 cat >> confdefs.h <<\EOF
10609 #define NLIST_STRUCT 1
10610 EOF
10611 }
10612
10613 else
10614   echo "$ac_t""no" 1>&6
10615 fi
10616
10617
10618
10619 echo "checking "for sound support"" 1>&6
10620 echo "configure:10621: checking "for sound support"" >&5
10621 case "$with_sound" in
10622   native | both ) with_native_sound=yes;;
10623   nas    | no   ) with_native_sound=no;;
10624 esac
10625 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10626
10627 if test "$with_native_sound" != "no"; then
10628     if test -n "$native_sound_lib"; then
10629     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10630 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10631 echo "configure:10632: checking for multimedia/audio_device.h" >&5
10632
10633 cat > conftest.$ac_ext <<EOF
10634 #line 10635 "configure"
10635 #include "confdefs.h"
10636 #include <multimedia/audio_device.h>
10637 EOF
10638 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10639 { (eval echo configure:10640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10640 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10641 if test -z "$ac_err"; then
10642   rm -rf conftest*
10643   eval "ac_cv_header_$ac_safe=yes"
10644 else
10645   echo "$ac_err" >&5
10646   echo "configure: failed program was:" >&5
10647   cat conftest.$ac_ext >&5
10648   rm -rf conftest*
10649   eval "ac_cv_header_$ac_safe=no"
10650 fi
10651 rm -f conftest*
10652 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10653   echo "$ac_t""yes" 1>&6
10654   sound_found=yes sound_cflags=""
10655       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10656    echo "    xemacs will be linked with \"sunplay.o\""
10657  fi
10658 else
10659   echo "$ac_t""no" 1>&6
10660 fi
10661
10662   fi
10663
10664     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10665     sound_found=yes
10666     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10667    echo "    xemacs will be linked with \"sunplay.o\""
10668  fi
10669     if test -d "/usr/demo/SOUND/include"
10670       then sound_cflags="-I/usr/demo/SOUND/include"
10671       else sound_cflags="-I/usr/demo/SOUND"
10672     fi
10673     if test -z "$native_sound_lib" ; then
10674       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10675         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10676         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10677       fi
10678     fi
10679   fi
10680
10681     if test -z "$sound_found"; then
10682     case "$canonical" in
10683     *-sgi-* )
10684       if test -z "$native_sound_lib"; then
10685         
10686 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10687 echo "configure:10688: checking for ALopenport in -laudio" >&5
10688 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10689
10690 xe_check_libs=" -laudio "
10691 cat > conftest.$ac_ext <<EOF
10692 #line 10693 "configure"
10693 #include "confdefs.h"
10694 /* Override any gcc2 internal prototype to avoid an error.  */
10695 /* We use char because int might match the return type of a gcc2
10696     builtin and then its argument prototype would still apply.  */
10697 char ALopenport();
10698
10699 int main() {
10700 ALopenport()
10701 ; return 0; }
10702 EOF
10703 if { (eval echo configure:10704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10704   rm -rf conftest*
10705   eval "ac_cv_lib_$ac_lib_var=yes"
10706 else
10707   echo "configure: failed program was:" >&5
10708   cat conftest.$ac_ext >&5
10709   rm -rf conftest*
10710   eval "ac_cv_lib_$ac_lib_var=no"
10711 fi
10712 rm -f conftest*
10713 xe_check_libs=""
10714
10715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10716   echo "$ac_t""yes" 1>&6
10717   native_sound_lib="-laudio"
10718 else
10719   echo "$ac_t""no" 1>&6
10720 fi
10721
10722
10723       fi
10724       if test -n "$native_sound_lib"; then
10725         sound_found=yes sound_cflags=""
10726         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10727    echo "    xemacs will be linked with \"sgiplay.o\""
10728  fi
10729       fi ;;
10730     hppa*-hp-hpux* )
10731       if test -z "$native_sound_lib"; then
10732         
10733 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10734 echo "configure:10735: checking for AOpenAudio in -lAlib" >&5
10735 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10736
10737 xe_check_libs=" -lAlib "
10738 cat > conftest.$ac_ext <<EOF
10739 #line 10740 "configure"
10740 #include "confdefs.h"
10741 /* Override any gcc2 internal prototype to avoid an error.  */
10742 /* We use char because int might match the return type of a gcc2
10743     builtin and then its argument prototype would still apply.  */
10744 char AOpenAudio();
10745
10746 int main() {
10747 AOpenAudio()
10748 ; return 0; }
10749 EOF
10750 if { (eval echo configure:10751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10751   rm -rf conftest*
10752   eval "ac_cv_lib_$ac_lib_var=yes"
10753 else
10754   echo "configure: failed program was:" >&5
10755   cat conftest.$ac_ext >&5
10756   rm -rf conftest*
10757   eval "ac_cv_lib_$ac_lib_var=no"
10758 fi
10759 rm -f conftest*
10760 xe_check_libs=""
10761
10762 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10763   echo "$ac_t""yes" 1>&6
10764   native_sound_lib="-lAlib"
10765 else
10766   echo "$ac_t""no" 1>&6
10767 fi
10768
10769
10770       fi
10771       if test -n "$native_sound_lib"; then
10772         sound_found=yes
10773         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10774    echo "    xemacs will be linked with \"hpplay.o\""
10775  fi
10776         if test "$GCC" = "yes" # Kludge city
10777           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10778           else sound_cflags="+e -I/usr/audio/examples"
10779         fi
10780       fi ;;
10781     esac
10782   fi
10783
10784     if test -z "$sound_found"; then
10785     for dir in "machine" "sys" "linux"; do
10786       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10787 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10788 echo "configure:10789: checking for ${dir}/soundcard.h" >&5
10789
10790 cat > conftest.$ac_ext <<EOF
10791 #line 10792 "configure"
10792 #include "confdefs.h"
10793 #include <${dir}/soundcard.h>
10794 EOF
10795 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10796 { (eval echo configure:10797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10797 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10798 if test -z "$ac_err"; then
10799   rm -rf conftest*
10800   eval "ac_cv_header_$ac_safe=yes"
10801 else
10802   echo "$ac_err" >&5
10803   echo "configure: failed program was:" >&5
10804   cat conftest.$ac_ext >&5
10805   rm -rf conftest*
10806   eval "ac_cv_header_$ac_safe=no"
10807 fi
10808 rm -f conftest*
10809 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10810   echo "$ac_t""yes" 1>&6
10811   sound_found=yes
10812         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10813    echo "    xemacs will be linked with \"linuxplay.o\""
10814  fi
10815         { test "$extra_verbose" = "yes" && cat << EOF
10816     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10817 EOF
10818 cat >> confdefs.h <<EOF
10819 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10820 EOF
10821 }
10822
10823         break
10824 else
10825   echo "$ac_t""no" 1>&6
10826 fi
10827
10828     done
10829   fi
10830
10831   test "$sound_found" = "yes" && with_native_sound=yes
10832 fi
10833
10834 if test -z "$with_sound"; then
10835   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10836     with_sound=native
10837   fi
10838 fi
10839
10840 if test "$with_native_sound" = "yes"; then
10841   { test "$extra_verbose" = "yes" && cat << \EOF
10842     Defining HAVE_NATIVE_SOUND
10843 EOF
10844 cat >> confdefs.h <<\EOF
10845 #define HAVE_NATIVE_SOUND 1
10846 EOF
10847 }
10848
10849   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10850 fi
10851
10852 case "$with_sound" in both | nas )
10853   { test "$extra_verbose" = "yes" && cat << \EOF
10854     Defining HAVE_NAS_SOUND
10855 EOF
10856 cat >> confdefs.h <<\EOF
10857 #define HAVE_NAS_SOUND 1
10858 EOF
10859 }
10860
10861   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10862    echo "    xemacs will be linked with \"nas.o\""
10863  fi
10864   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10865       cat > conftest.$ac_ext <<EOF
10866 #line 10867 "configure"
10867 #include "confdefs.h"
10868 #include <audio/Xtutil.h>
10869 EOF
10870 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10871   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10872   :
10873 else
10874   rm -rf conftest*
10875   { test "$extra_verbose" = "yes" && cat << \EOF
10876     Defining NAS_NO_ERROR_JUMP
10877 EOF
10878 cat >> confdefs.h <<\EOF
10879 #define NAS_NO_ERROR_JUMP 1
10880 EOF
10881 }
10882
10883 fi
10884 rm -f conftest*
10885
10886 esac
10887
10888
10889 test -z "$with_tty" && with_tty=yes
10890
10891 if test "$with_tty" = "yes"  ; then
10892   echo "checking for TTY-related features" 1>&6
10893 echo "configure:10894: checking for TTY-related features" >&5
10894   { test "$extra_verbose" = "yes" && cat << \EOF
10895     Defining HAVE_TTY
10896 EOF
10897 cat >> confdefs.h <<\EOF
10898 #define HAVE_TTY 1
10899 EOF
10900 }
10901
10902   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
10903    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\""
10904  fi
10905
10906     if test -z "$with_ncurses"; then
10907     
10908 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10909 echo "configure:10910: checking for tgetent in -lncurses" >&5
10910 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10911
10912 xe_check_libs=" -lncurses "
10913 cat > conftest.$ac_ext <<EOF
10914 #line 10915 "configure"
10915 #include "confdefs.h"
10916 /* Override any gcc2 internal prototype to avoid an error.  */
10917 /* We use char because int might match the return type of a gcc2
10918     builtin and then its argument prototype would still apply.  */
10919 char tgetent();
10920
10921 int main() {
10922 tgetent()
10923 ; return 0; }
10924 EOF
10925 if { (eval echo configure:10926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10926   rm -rf conftest*
10927   eval "ac_cv_lib_$ac_lib_var=yes"
10928 else
10929   echo "configure: failed program was:" >&5
10930   cat conftest.$ac_ext >&5
10931   rm -rf conftest*
10932   eval "ac_cv_lib_$ac_lib_var=no"
10933 fi
10934 rm -f conftest*
10935 xe_check_libs=""
10936
10937 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10938   echo "$ac_t""yes" 1>&6
10939   with_ncurses=yes
10940 else
10941   echo "$ac_t""no" 1>&6
10942 with_ncurses=no
10943 fi
10944
10945
10946   fi
10947   if test "$with_ncurses" = "yes"; then
10948     { test "$extra_verbose" = "yes" && cat << \EOF
10949     Defining HAVE_NCURSES
10950 EOF
10951 cat >> confdefs.h <<\EOF
10952 #define HAVE_NCURSES 1
10953 EOF
10954 }
10955
10956     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10957 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10958 echo "configure:10959: checking for ncurses/curses.h" >&5
10959
10960 cat > conftest.$ac_ext <<EOF
10961 #line 10962 "configure"
10962 #include "confdefs.h"
10963 #include <ncurses/curses.h>
10964 EOF
10965 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10966 { (eval echo configure:10967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10967 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10968 if test -z "$ac_err"; then
10969   rm -rf conftest*
10970   eval "ac_cv_header_$ac_safe=yes"
10971 else
10972   echo "$ac_err" >&5
10973   echo "configure: failed program was:" >&5
10974   cat conftest.$ac_ext >&5
10975   rm -rf conftest*
10976   eval "ac_cv_header_$ac_safe=no"
10977 fi
10978 rm -f conftest*
10979 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10980   echo "$ac_t""yes" 1>&6
10981   curses_h_path=ncurses/curses.h
10982 else
10983   echo "$ac_t""no" 1>&6
10984 fi
10985
10986     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10987 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10988 echo "configure:10989: checking for ncurses/term.h" >&5
10989
10990 cat > conftest.$ac_ext <<EOF
10991 #line 10992 "configure"
10992 #include "confdefs.h"
10993 #include <ncurses/term.h>
10994 EOF
10995 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10996 { (eval echo configure:10997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10997 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10998 if test -z "$ac_err"; then
10999   rm -rf conftest*
11000   eval "ac_cv_header_$ac_safe=yes"
11001 else
11002   echo "$ac_err" >&5
11003   echo "configure: failed program was:" >&5
11004   cat conftest.$ac_ext >&5
11005   rm -rf conftest*
11006   eval "ac_cv_header_$ac_safe=no"
11007 fi
11008 rm -f conftest*
11009 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11010   echo "$ac_t""yes" 1>&6
11011   term_h_path=ncurses/term.h
11012 else
11013   echo "$ac_t""no" 1>&6
11014 fi
11015
11016     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
11017    echo "    xemacs will be linked with \"terminfo.o\""
11018  fi
11019     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
11020
11021     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
11022                         save_c_switch_site="$c_switch_site"
11023       c_switch_site="$c_switch_site -I/usr/include/ncurses"
11024       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
11025 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
11026 echo "configure:11027: checking for ncurses/curses.h" >&5
11027
11028 cat > conftest.$ac_ext <<EOF
11029 #line 11030 "configure"
11030 #include "confdefs.h"
11031 #include <ncurses/curses.h>
11032 EOF
11033 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11034 { (eval echo configure:11035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11035 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11036 if test -z "$ac_err"; then
11037   rm -rf conftest*
11038   eval "ac_cv_header_$ac_safe=yes"
11039 else
11040   echo "$ac_err" >&5
11041   echo "configure: failed program was:" >&5
11042   cat conftest.$ac_ext >&5
11043   rm -rf conftest*
11044   eval "ac_cv_header_$ac_safe=no"
11045 fi
11046 rm -f conftest*
11047 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11048   echo "$ac_t""yes" 1>&6
11049   curses_h_path=ncurses/curses.h
11050 else
11051   echo "$ac_t""no" 1>&6
11052 fi
11053
11054       if test "$ac_cv_header_ncurses_curses_h" = "yes"
11055         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
11056         else c_switch_site="$save_c_switch_site"
11057       fi
11058     fi
11059   else         if test "$have_terminfo" = "yes"; then
11060       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
11061    echo "    xemacs will be linked with \"terminfo.o\""
11062  fi
11063       if test -n "$libs_termcap"; then
11064         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11065       else
11066         for lib in curses termlib termcap; do
11067           
11068 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
11069 echo "configure:11070: checking for tgetent in -l$lib" >&5
11070 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
11071
11072 xe_check_libs=" -l$lib "
11073 cat > conftest.$ac_ext <<EOF
11074 #line 11075 "configure"
11075 #include "confdefs.h"
11076 /* Override any gcc2 internal prototype to avoid an error.  */
11077 /* We use char because int might match the return type of a gcc2
11078     builtin and then its argument prototype would still apply.  */
11079 char tgetent();
11080
11081 int main() {
11082 tgetent()
11083 ; return 0; }
11084 EOF
11085 if { (eval echo configure:11086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11086   rm -rf conftest*
11087   eval "ac_cv_lib_$ac_lib_var=yes"
11088 else
11089   echo "configure: failed program was:" >&5
11090   cat conftest.$ac_ext >&5
11091   rm -rf conftest*
11092   eval "ac_cv_lib_$ac_lib_var=no"
11093 fi
11094 rm -f conftest*
11095 xe_check_libs=""
11096
11097 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11098   echo "$ac_t""yes" 1>&6
11099   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
11100 else
11101   echo "$ac_t""no" 1>&6
11102 fi
11103
11104
11105         done
11106       fi
11107     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
11108    echo "    xemacs will be linked with \"tparam.o\""
11109  fi
11110                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
11111       if test -n "$libs_termcap"; then
11112         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11113       else
11114         
11115 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
11116 echo "configure:11117: checking for tgetent in -lcurses" >&5
11117 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
11118
11119 xe_check_libs=" -lcurses "
11120 cat > conftest.$ac_ext <<EOF
11121 #line 11122 "configure"
11122 #include "confdefs.h"
11123 /* Override any gcc2 internal prototype to avoid an error.  */
11124 /* We use char because int might match the return type of a gcc2
11125     builtin and then its argument prototype would still apply.  */
11126 char tgetent();
11127
11128 int main() {
11129 tgetent()
11130 ; return 0; }
11131 EOF
11132 if { (eval echo configure:11133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11133   rm -rf conftest*
11134   eval "ac_cv_lib_$ac_lib_var=yes"
11135 else
11136   echo "configure: failed program was:" >&5
11137   cat conftest.$ac_ext >&5
11138   rm -rf conftest*
11139   eval "ac_cv_lib_$ac_lib_var=no"
11140 fi
11141 rm -f conftest*
11142 xe_check_libs=""
11143
11144 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11145   echo "$ac_t""yes" 1>&6
11146   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
11147 else
11148   echo "$ac_t""no" 1>&6
11149 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
11150 echo "configure:11151: checking for tgetent in -ltermcap" >&5
11151 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
11152
11153 xe_check_libs=" -ltermcap "
11154 cat > conftest.$ac_ext <<EOF
11155 #line 11156 "configure"
11156 #include "confdefs.h"
11157 /* Override any gcc2 internal prototype to avoid an error.  */
11158 /* We use char because int might match the return type of a gcc2
11159     builtin and then its argument prototype would still apply.  */
11160 char tgetent();
11161
11162 int main() {
11163 tgetent()
11164 ; return 0; }
11165 EOF
11166 if { (eval echo configure:11167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11167   rm -rf conftest*
11168   eval "ac_cv_lib_$ac_lib_var=yes"
11169 else
11170   echo "configure: failed program was:" >&5
11171   cat conftest.$ac_ext >&5
11172   rm -rf conftest*
11173   eval "ac_cv_lib_$ac_lib_var=no"
11174 fi
11175 rm -f conftest*
11176 xe_check_libs=""
11177
11178 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11179   echo "$ac_t""yes" 1>&6
11180   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11181 else
11182   echo "$ac_t""no" 1>&6
11183 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11184    echo "    xemacs will be linked with \"termcap.o\""
11185  fi
11186 fi
11187
11188
11189 fi
11190
11191
11192       fi
11193     fi
11194   fi
11195   { test "$extra_verbose" = "yes" && cat << EOF
11196     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11197 EOF
11198 cat >> confdefs.h <<EOF
11199 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11200 EOF
11201 }
11202
11203   { test "$extra_verbose" = "yes" && cat << EOF
11204     Defining TERM_H_PATH = "${term_h_path-term.h}"
11205 EOF
11206 cat >> confdefs.h <<EOF
11207 #define TERM_H_PATH "${term_h_path-term.h}"
11208 EOF
11209 }
11210
11211
11212     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11213 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11214 echo "configure:11215: checking for gpm.h" >&5
11215
11216 cat > conftest.$ac_ext <<EOF
11217 #line 11218 "configure"
11218 #include "confdefs.h"
11219 #include <gpm.h>
11220 EOF
11221 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11222 { (eval echo configure:11223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11223 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11224 if test -z "$ac_err"; then
11225   rm -rf conftest*
11226   eval "ac_cv_header_$ac_safe=yes"
11227 else
11228   echo "$ac_err" >&5
11229   echo "configure: failed program was:" >&5
11230   cat conftest.$ac_ext >&5
11231   rm -rf conftest*
11232   eval "ac_cv_header_$ac_safe=no"
11233 fi
11234 rm -f conftest*
11235 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11236   echo "$ac_t""yes" 1>&6
11237   :
11238 else
11239   echo "$ac_t""no" 1>&6
11240 with_gpm=no
11241 fi
11242  }
11243   test -z "$with_gpm" && { 
11244 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11245 echo "configure:11246: checking for Gpm_Open in -lgpm" >&5
11246 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11247
11248 xe_check_libs=" -lgpm "
11249 cat > conftest.$ac_ext <<EOF
11250 #line 11251 "configure"
11251 #include "confdefs.h"
11252 /* Override any gcc2 internal prototype to avoid an error.  */
11253 /* We use char because int might match the return type of a gcc2
11254     builtin and then its argument prototype would still apply.  */
11255 char Gpm_Open();
11256
11257 int main() {
11258 Gpm_Open()
11259 ; return 0; }
11260 EOF
11261 if { (eval echo configure:11262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11262   rm -rf conftest*
11263   eval "ac_cv_lib_$ac_lib_var=yes"
11264 else
11265   echo "configure: failed program was:" >&5
11266   cat conftest.$ac_ext >&5
11267   rm -rf conftest*
11268   eval "ac_cv_lib_$ac_lib_var=no"
11269 fi
11270 rm -f conftest*
11271 xe_check_libs=""
11272
11273 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11274   echo "$ac_t""yes" 1>&6
11275   with_gpm=yes
11276 else
11277   echo "$ac_t""no" 1>&6
11278 with_gpm=no
11279 fi
11280
11281  }
11282   if test "$with_gpm" = "yes"; then
11283     { test "$extra_verbose" = "yes" && cat << \EOF
11284     Defining HAVE_GPM
11285 EOF
11286 cat >> confdefs.h <<\EOF
11287 #define HAVE_GPM 1
11288 EOF
11289 }
11290
11291     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11292    echo "    xemacs will be linked with \"gpmevent.o\""
11293  fi
11294     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11295   fi
11296
11297 else   for feature in ncurses gpm; do
11298     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11299       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11300     fi
11301     eval "with_${feature}=no"
11302   done
11303 fi 
11304 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11305    echo "    xemacs will be linked with \"event-unixoid.o\""
11306  fi
11307
11308
11309 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11310   != "no no no" && echo "checking for database support" 1>&6
11311 echo "configure:11312: checking for database support" >&5
11312
11313 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11314   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11315 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11316 echo "configure:11317: checking for ndbm.h" >&5
11317
11318 cat > conftest.$ac_ext <<EOF
11319 #line 11320 "configure"
11320 #include "confdefs.h"
11321 #include <ndbm.h>
11322 EOF
11323 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11324 { (eval echo configure:11325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11325 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11326 if test -z "$ac_err"; then
11327   rm -rf conftest*
11328   eval "ac_cv_header_$ac_safe=yes"
11329 else
11330   echo "$ac_err" >&5
11331   echo "configure: failed program was:" >&5
11332   cat conftest.$ac_ext >&5
11333   rm -rf conftest*
11334   eval "ac_cv_header_$ac_safe=no"
11335 fi
11336 rm -f conftest*
11337 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11338   echo "$ac_t""yes" 1>&6
11339   :
11340 else
11341   echo "$ac_t""no" 1>&6
11342
11343     test "$with_database_gnudbm" = "yes" -o \
11344          "$with_database_dbm"    = "yes" && \
11345       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11346     with_database_gnudbm=no with_database_dbm=no
11347 fi
11348
11349 fi
11350
11351 if test "$with_database_gnudbm" != "no"; then
11352   
11353 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11354 echo "configure:11355: checking for dbm_open in -lgdbm" >&5
11355 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11356
11357 xe_check_libs=" -lgdbm "
11358 cat > conftest.$ac_ext <<EOF
11359 #line 11360 "configure"
11360 #include "confdefs.h"
11361 /* Override any gcc2 internal prototype to avoid an error.  */
11362 /* We use char because int might match the return type of a gcc2
11363     builtin and then its argument prototype would still apply.  */
11364 char dbm_open();
11365
11366 int main() {
11367 dbm_open()
11368 ; return 0; }
11369 EOF
11370 if { (eval echo configure:11371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11371   rm -rf conftest*
11372   eval "ac_cv_lib_$ac_lib_var=yes"
11373 else
11374   echo "configure: failed program was:" >&5
11375   cat conftest.$ac_ext >&5
11376   rm -rf conftest*
11377   eval "ac_cv_lib_$ac_lib_var=no"
11378 fi
11379 rm -f conftest*
11380 xe_check_libs=""
11381
11382 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11383   echo "$ac_t""yes" 1>&6
11384   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11385 else
11386   echo "$ac_t""no" 1>&6
11387 if test "$with_database_gnudbm" = "yes"; then
11388      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11389    fi
11390    with_database_gnudbm=no
11391 fi
11392
11393
11394 fi
11395
11396 if test "$with_database_dbm" != "no"; then
11397   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11398 echo "configure:11399: checking for dbm_open" >&5
11399
11400 cat > conftest.$ac_ext <<EOF
11401 #line 11402 "configure"
11402 #include "confdefs.h"
11403 /* System header to define __stub macros and hopefully few prototypes,
11404     which can conflict with char dbm_open(); below.  */
11405 #include <assert.h>
11406 /* Override any gcc2 internal prototype to avoid an error.  */
11407 /* We use char because int might match the return type of a gcc2
11408     builtin and then its argument prototype would still apply.  */
11409 char dbm_open();
11410
11411 int main() {
11412
11413 /* The GNU C library defines this for functions which it implements
11414     to always fail with ENOSYS.  Some functions are actually named
11415     something starting with __ and the normal name is an alias.  */
11416 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11417 choke me
11418 #else
11419 dbm_open();
11420 #endif
11421
11422 ; return 0; }
11423 EOF
11424 if { (eval echo configure:11425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11425   rm -rf conftest*
11426   eval "ac_cv_func_dbm_open=yes"
11427 else
11428   echo "configure: failed program was:" >&5
11429   cat conftest.$ac_ext >&5
11430   rm -rf conftest*
11431   eval "ac_cv_func_dbm_open=no"
11432 fi
11433 rm -f conftest*
11434
11435 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11436   echo "$ac_t""yes" 1>&6
11437   with_database_dbm=yes libdbm=
11438 else
11439   echo "$ac_t""no" 1>&6
11440
11441     
11442 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11443 echo "configure:11444: checking for dbm_open in -ldbm" >&5
11444 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11445
11446 xe_check_libs=" -ldbm "
11447 cat > conftest.$ac_ext <<EOF
11448 #line 11449 "configure"
11449 #include "confdefs.h"
11450 /* Override any gcc2 internal prototype to avoid an error.  */
11451 /* We use char because int might match the return type of a gcc2
11452     builtin and then its argument prototype would still apply.  */
11453 char dbm_open();
11454
11455 int main() {
11456 dbm_open()
11457 ; return 0; }
11458 EOF
11459 if { (eval echo configure:11460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11460   rm -rf conftest*
11461   eval "ac_cv_lib_$ac_lib_var=yes"
11462 else
11463   echo "configure: failed program was:" >&5
11464   cat conftest.$ac_ext >&5
11465   rm -rf conftest*
11466   eval "ac_cv_lib_$ac_lib_var=no"
11467 fi
11468 rm -f conftest*
11469 xe_check_libs=""
11470
11471 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11472   echo "$ac_t""yes" 1>&6
11473   with_database_dbm=yes libdbm=-ldbm
11474 else
11475   echo "$ac_t""no" 1>&6
11476 test "$with_database_dbm" = "yes" && \
11477         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11478       with_database_dbm=no
11479 fi
11480
11481
11482 fi
11483
11484 fi
11485
11486 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11487 test "$with_database_gnudbm" = "yes" -o \
11488      "$with_database_dbm"    = "yes" && \
11489   { test "$extra_verbose" = "yes" && cat << \EOF
11490     Defining HAVE_DBM
11491 EOF
11492 cat >> confdefs.h <<\EOF
11493 #define HAVE_DBM 1
11494 EOF
11495 }
11496
11497
11498 if test "$with_database_berkdb" != "no"; then
11499   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11500 echo "configure:11501: checking for Berkeley db.h" >&5
11501   for path in "db/db.h" "db.h"; do
11502     cat > conftest.$ac_ext <<EOF
11503 #line 11504 "configure"
11504 #include "confdefs.h"
11505 #ifdef HAVE_INTTYPES_H
11506 #define __BIT_TYPES_DEFINED__
11507 #include <inttypes.h>
11508 typedef uint8_t  u_int8_t;
11509 typedef uint16_t u_int16_t;
11510 typedef uint32_t u_int32_t;
11511 #ifdef WE_DONT_NEED_QUADS
11512 typedef uint64_t u_int64_t;
11513 #endif
11514 #endif
11515 #include <$path>
11516
11517 int main() {
11518
11519 ; return 0; }
11520 EOF
11521 if { (eval echo configure:11522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11522   rm -rf conftest*
11523   db_h_path="$path"; break
11524 else
11525   echo "configure: failed program was:" >&5
11526   cat conftest.$ac_ext >&5
11527 fi
11528 rm -f conftest*
11529   done
11530   if test -z "$db_h_path"
11531   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11532   else echo "$ac_t""$db_h_path" 1>&6
11533   fi
11534
11535   if test "$with_database_berkdb" != "no"; then
11536     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11537 echo "configure:11538: checking for Berkeley DB version" >&5
11538     cat > conftest.$ac_ext <<EOF
11539 #line 11540 "configure"
11540 #include "confdefs.h"
11541 #include <$db_h_path>
11542 #if DB_VERSION_MAJOR > 1
11543 yes
11544 #endif
11545
11546 EOF
11547 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11548   egrep "yes" >/dev/null 2>&1; then
11549   rm -rf conftest*
11550   echo "$ac_t""2" 1>&6; dbfunc=db_open
11551 else
11552   rm -rf conftest*
11553   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11554 fi
11555 rm -f conftest*
11556
11557     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11558 echo "configure:11559: checking for $dbfunc" >&5
11559
11560 cat > conftest.$ac_ext <<EOF
11561 #line 11562 "configure"
11562 #include "confdefs.h"
11563 /* System header to define __stub macros and hopefully few prototypes,
11564     which can conflict with char $dbfunc(); below.  */
11565 #include <assert.h>
11566 /* Override any gcc2 internal prototype to avoid an error.  */
11567 /* We use char because int might match the return type of a gcc2
11568     builtin and then its argument prototype would still apply.  */
11569 char $dbfunc();
11570
11571 int main() {
11572
11573 /* The GNU C library defines this for functions which it implements
11574     to always fail with ENOSYS.  Some functions are actually named
11575     something starting with __ and the normal name is an alias.  */
11576 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11577 choke me
11578 #else
11579 $dbfunc();
11580 #endif
11581
11582 ; return 0; }
11583 EOF
11584 if { (eval echo configure:11585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11585   rm -rf conftest*
11586   eval "ac_cv_func_$dbfunc=yes"
11587 else
11588   echo "configure: failed program was:" >&5
11589   cat conftest.$ac_ext >&5
11590   rm -rf conftest*
11591   eval "ac_cv_func_$dbfunc=no"
11592 fi
11593 rm -f conftest*
11594
11595 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11596   echo "$ac_t""yes" 1>&6
11597   with_database_berkdb=yes need_libdb=no
11598 else
11599   echo "$ac_t""no" 1>&6
11600
11601     
11602 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11603 echo "configure:11604: checking for $dbfunc in -ldb" >&5
11604 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11605
11606 xe_check_libs=" -ldb "
11607 cat > conftest.$ac_ext <<EOF
11608 #line 11609 "configure"
11609 #include "confdefs.h"
11610 /* Override any gcc2 internal prototype to avoid an error.  */
11611 /* We use char because int might match the return type of a gcc2
11612     builtin and then its argument prototype would still apply.  */
11613 char $dbfunc();
11614
11615 int main() {
11616 $dbfunc()
11617 ; return 0; }
11618 EOF
11619 if { (eval echo configure:11620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11620   rm -rf conftest*
11621   eval "ac_cv_lib_$ac_lib_var=yes"
11622 else
11623   echo "configure: failed program was:" >&5
11624   cat conftest.$ac_ext >&5
11625   rm -rf conftest*
11626   eval "ac_cv_lib_$ac_lib_var=no"
11627 fi
11628 rm -f conftest*
11629 xe_check_libs=""
11630
11631 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11632   echo "$ac_t""yes" 1>&6
11633   with_database_berkdb=yes need_libdb=yes
11634 else
11635   echo "$ac_t""no" 1>&6
11636 fi
11637
11638
11639 fi
11640
11641   fi
11642
11643   if test "$with_database_berkdb" = "yes"; then
11644     { test "$extra_verbose" = "yes" && cat << EOF
11645     Defining DB_H_PATH = "$db_h_path"
11646 EOF
11647 cat >> confdefs.h <<EOF
11648 #define DB_H_PATH "$db_h_path"
11649 EOF
11650 }
11651
11652     { test "$extra_verbose" = "yes" && cat << \EOF
11653     Defining HAVE_BERKELEY_DB
11654 EOF
11655 cat >> confdefs.h <<\EOF
11656 #define HAVE_BERKELEY_DB 1
11657 EOF
11658 }
11659
11660     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11661   else with_database_berkdb=no
11662   fi
11663 fi
11664
11665 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11666      != "no no no"; then
11667   { test "$extra_verbose" = "yes" && cat << \EOF
11668     Defining HAVE_DATABASE
11669 EOF
11670 cat >> confdefs.h <<\EOF
11671 #define HAVE_DATABASE 1
11672 EOF
11673 }
11674
11675   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11676    echo "    xemacs will be linked with \"database.o\""
11677  fi
11678 fi
11679
11680 if test "$with_socks" = "yes"; then
11681   
11682 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11683 echo "configure:11684: checking for SOCKSinit in -lsocks" >&5
11684 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11685
11686 xe_check_libs=" -lsocks "
11687 cat > conftest.$ac_ext <<EOF
11688 #line 11689 "configure"
11689 #include "confdefs.h"
11690 /* Override any gcc2 internal prototype to avoid an error.  */
11691 /* We use char because int might match the return type of a gcc2
11692     builtin and then its argument prototype would still apply.  */
11693 char SOCKSinit();
11694
11695 int main() {
11696 SOCKSinit()
11697 ; return 0; }
11698 EOF
11699 if { (eval echo configure:11700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11700   rm -rf conftest*
11701   eval "ac_cv_lib_$ac_lib_var=yes"
11702 else
11703   echo "configure: failed program was:" >&5
11704   cat conftest.$ac_ext >&5
11705   rm -rf conftest*
11706   eval "ac_cv_lib_$ac_lib_var=no"
11707 fi
11708 rm -f conftest*
11709 xe_check_libs=""
11710
11711 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11712   echo "$ac_t""yes" 1>&6
11713     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11714     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11715   { test "$extra_verbose" = "yes" && cat << EOF
11716     Defining $ac_tr_lib
11717 EOF
11718 cat >> confdefs.h <<EOF
11719 #define $ac_tr_lib 1
11720 EOF
11721 }
11722
11723   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11724
11725 else
11726   echo "$ac_t""no" 1>&6
11727 fi
11728
11729
11730   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11731     Defining HAVE_SOCKS
11732 EOF
11733 cat >> confdefs.h <<\EOF
11734 #define HAVE_SOCKS 1
11735 EOF
11736 }
11737
11738 fi
11739
11740 if test "$usage_tracking" = "yes"; then
11741   { test "$extra_verbose" = "yes" && cat << \EOF
11742     Defining USAGE_TRACKING
11743 EOF
11744 cat >> confdefs.h <<\EOF
11745 #define USAGE_TRACKING 1
11746 EOF
11747 }
11748
11749   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11750 fi
11751
11752 for ac_hdr in dlfcn.h
11753 do
11754 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11755 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11756 echo "configure:11757: checking for $ac_hdr" >&5
11757
11758 cat > conftest.$ac_ext <<EOF
11759 #line 11760 "configure"
11760 #include "confdefs.h"
11761 #include <$ac_hdr>
11762 EOF
11763 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11764 { (eval echo configure:11765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11765 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11766 if test -z "$ac_err"; then
11767   rm -rf conftest*
11768   eval "ac_cv_header_$ac_safe=yes"
11769 else
11770   echo "$ac_err" >&5
11771   echo "configure: failed program was:" >&5
11772   cat conftest.$ac_ext >&5
11773   rm -rf conftest*
11774   eval "ac_cv_header_$ac_safe=no"
11775 fi
11776 rm -f conftest*
11777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11778   echo "$ac_t""yes" 1>&6
11779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11780   { test "$extra_verbose" = "yes" && cat << EOF
11781     Defining $ac_tr_hdr
11782 EOF
11783 cat >> confdefs.h <<EOF
11784 #define $ac_tr_hdr 1
11785 EOF
11786 }
11787  have_dlfcn=yes
11788   { test "$extra_verbose" = "yes" && cat << \EOF
11789     Defining HAVE_DLFCN_H
11790 EOF
11791 cat >> confdefs.h <<\EOF
11792 #define HAVE_DLFCN_H 1
11793 EOF
11794 }
11795
11796 else
11797   echo "$ac_t""no" 1>&6
11798 fi
11799 done
11800
11801 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11802 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11803 echo "configure:11804: checking for dlopen in -ldl" >&5
11804 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11805
11806 xe_check_libs=" -ldl "
11807 cat > conftest.$ac_ext <<EOF
11808 #line 11809 "configure"
11809 #include "confdefs.h"
11810 /* Override any gcc2 internal prototype to avoid an error.  */
11811 /* We use char because int might match the return type of a gcc2
11812     builtin and then its argument prototype would still apply.  */
11813 char dlopen();
11814
11815 int main() {
11816 dlopen()
11817 ; return 0; }
11818 EOF
11819 if { (eval echo configure:11820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11820   rm -rf conftest*
11821   eval "ac_cv_lib_$ac_lib_var=yes"
11822 else
11823   echo "configure: failed program was:" >&5
11824   cat conftest.$ac_ext >&5
11825   rm -rf conftest*
11826   eval "ac_cv_lib_$ac_lib_var=no"
11827 fi
11828 rm -f conftest*
11829 xe_check_libs=""
11830
11831 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11832   echo "$ac_t""yes" 1>&6
11833   { test "$extra_verbose" = "yes" && cat << \EOF
11834     Defining HAVE_DLOPEN
11835 EOF
11836 cat >> confdefs.h <<\EOF
11837 #define HAVE_DLOPEN 1
11838 EOF
11839 }
11840  DLL_LIB=dl;  with_shlib=yes
11841 else
11842   echo "$ac_t""no" 1>&6
11843 fi
11844
11845  }
11846 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11847 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11848 echo "configure:11849: checking for _dlopen in -lc" >&5
11849 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11850
11851 xe_check_libs=" -lc "
11852 cat > conftest.$ac_ext <<EOF
11853 #line 11854 "configure"
11854 #include "confdefs.h"
11855 /* Override any gcc2 internal prototype to avoid an error.  */
11856 /* We use char because int might match the return type of a gcc2
11857     builtin and then its argument prototype would still apply.  */
11858 char _dlopen();
11859
11860 int main() {
11861 _dlopen()
11862 ; return 0; }
11863 EOF
11864 if { (eval echo configure:11865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11865   rm -rf conftest*
11866   eval "ac_cv_lib_$ac_lib_var=yes"
11867 else
11868   echo "configure: failed program was:" >&5
11869   cat conftest.$ac_ext >&5
11870   rm -rf conftest*
11871   eval "ac_cv_lib_$ac_lib_var=no"
11872 fi
11873 rm -f conftest*
11874 xe_check_libs=""
11875
11876 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11877   echo "$ac_t""yes" 1>&6
11878   { test "$extra_verbose" = "yes" && cat << \EOF
11879     Defining HAVE_DLOPEN
11880 EOF
11881 cat >> confdefs.h <<\EOF
11882 #define HAVE_DLOPEN 1
11883 EOF
11884 }
11885  DLL_LIB=;   with_shlib=yes
11886 else
11887   echo "$ac_t""no" 1>&6
11888 fi
11889
11890  }
11891 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11892 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11893 echo "configure:11894: checking for dlopen in -lc" >&5
11894 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11895
11896 xe_check_libs=" -lc "
11897 cat > conftest.$ac_ext <<EOF
11898 #line 11899 "configure"
11899 #include "confdefs.h"
11900 /* Override any gcc2 internal prototype to avoid an error.  */
11901 /* We use char because int might match the return type of a gcc2
11902     builtin and then its argument prototype would still apply.  */
11903 char dlopen();
11904
11905 int main() {
11906 dlopen()
11907 ; return 0; }
11908 EOF
11909 if { (eval echo configure:11910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11910   rm -rf conftest*
11911   eval "ac_cv_lib_$ac_lib_var=yes"
11912 else
11913   echo "configure: failed program was:" >&5
11914   cat conftest.$ac_ext >&5
11915   rm -rf conftest*
11916   eval "ac_cv_lib_$ac_lib_var=no"
11917 fi
11918 rm -f conftest*
11919 xe_check_libs=""
11920
11921 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11922   echo "$ac_t""yes" 1>&6
11923   { test "$extra_verbose" = "yes" && cat << \EOF
11924     Defining HAVE_DLOPEN
11925 EOF
11926 cat >> confdefs.h <<\EOF
11927 #define HAVE_DLOPEN 1
11928 EOF
11929 }
11930  DLL_LIB=;   with_shlib=yes
11931 else
11932   echo "$ac_t""no" 1>&6
11933 fi
11934
11935  }
11936 test -z "$with_shlib" && { 
11937 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11938 echo "configure:11939: checking for shl_load in -ldld" >&5
11939 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11940
11941 xe_check_libs=" -ldld "
11942 cat > conftest.$ac_ext <<EOF
11943 #line 11944 "configure"
11944 #include "confdefs.h"
11945 /* Override any gcc2 internal prototype to avoid an error.  */
11946 /* We use char because int might match the return type of a gcc2
11947     builtin and then its argument prototype would still apply.  */
11948 char shl_load();
11949
11950 int main() {
11951 shl_load()
11952 ; return 0; }
11953 EOF
11954 if { (eval echo configure:11955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11955   rm -rf conftest*
11956   eval "ac_cv_lib_$ac_lib_var=yes"
11957 else
11958   echo "configure: failed program was:" >&5
11959   cat conftest.$ac_ext >&5
11960   rm -rf conftest*
11961   eval "ac_cv_lib_$ac_lib_var=no"
11962 fi
11963 rm -f conftest*
11964 xe_check_libs=""
11965
11966 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11967   echo "$ac_t""yes" 1>&6
11968   { test "$extra_verbose" = "yes" && cat << \EOF
11969     Defining HAVE_SHL_LOAD
11970 EOF
11971 cat >> confdefs.h <<\EOF
11972 #define HAVE_SHL_LOAD 1
11973 EOF
11974 }
11975  DLL_LIB=dld; with_shlib=yes
11976 else
11977   echo "$ac_t""no" 1>&6
11978 fi
11979
11980  }
11981 test -z "$with_shlib" && { 
11982 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11983 echo "configure:11984: checking for dld_init in -ldld" >&5
11984 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11985
11986 xe_check_libs=" -ldld "
11987 cat > conftest.$ac_ext <<EOF
11988 #line 11989 "configure"
11989 #include "confdefs.h"
11990 /* Override any gcc2 internal prototype to avoid an error.  */
11991 /* We use char because int might match the return type of a gcc2
11992     builtin and then its argument prototype would still apply.  */
11993 char dld_init();
11994
11995 int main() {
11996 dld_init()
11997 ; return 0; }
11998 EOF
11999 if { (eval echo configure:12000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12000   rm -rf conftest*
12001   eval "ac_cv_lib_$ac_lib_var=yes"
12002 else
12003   echo "configure: failed program was:" >&5
12004   cat conftest.$ac_ext >&5
12005   rm -rf conftest*
12006   eval "ac_cv_lib_$ac_lib_var=no"
12007 fi
12008 rm -f conftest*
12009 xe_check_libs=""
12010
12011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12012   echo "$ac_t""yes" 1>&6
12013   { test "$extra_verbose" = "yes" && cat << \EOF
12014     Defining HAVE_DLD_INIT
12015 EOF
12016 cat >> confdefs.h <<\EOF
12017 #define HAVE_DLD_INIT 1
12018 EOF
12019 }
12020  DLL_LIB=dld; with_shlib=yes
12021 else
12022   echo "$ac_t""no" 1>&6
12023 fi
12024
12025  }
12026 if test "$with_shlib" = "yes"; then
12027   
12028 dll_ld=
12029 dll_ldflags=
12030 dll_cflags=
12031 dll_post=
12032 dll_ldo="-o"
12033 ld_dynamic_link_flags=
12034 xehost=$canonical
12035 xealias=$internal_configuration
12036
12037 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
12038 echo "configure:12039: checking how to build dynamic libraries for ${xehost}" >&5
12039 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
12040 case "$xehost" in
12041 *-*-linux-gnu*) ;;
12042 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
12043 esac
12044
12045 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
12046 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
12047 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
12048
12049 case "$xehost_os" in
12050 aix3*)
12051   # AIX sometimes has problems with the GCC collect2 program.  For some
12052   # reason, if we set the COLLECT_NAMES environment variable, the problems
12053   # vanish in a puff of smoke.
12054   if test "${COLLECT_NAMES+set}" != set; then
12055     COLLECT_NAMES=
12056     export COLLECT_NAMES
12057   fi
12058   ;;
12059 esac
12060
12061 # Now see if the compiler is really GCC.
12062 if test "$GCC" = "yes"; then
12063   XEGCC=yes
12064 else
12065   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
12066 echo "configure:12067: checking checking whether we are using GNU C" >&5
12067   cat > conftest.$ac_ext <<EOF
12068 #line 12069 "configure"
12069 #include "confdefs.h"
12070
12071 #ifdef __GNUC__
12072   yes;
12073 #endif
12074
12075 EOF
12076 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12077   egrep "yes" >/dev/null 2>&1; then
12078   rm -rf conftest*
12079   XEGCC=yes
12080 else
12081   rm -rf conftest*
12082   XEGCC=no
12083 fi
12084 rm -f conftest*
12085
12086   echo "$ac_t""${XEGCC}" 1>&6
12087 fi
12088
12089 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
12090 echo "configure:12091: checking how to produce PIC code" >&5
12091 wl=
12092
12093 can_build_shared=yes
12094 if test "$XEGCC" = yes; then
12095   wl='-Wl,'
12096
12097   case "$xehost_os" in
12098   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
12099     # PIC is the default for these OSes.
12100     ;;
12101
12102   os2*)
12103     # We can build DLLs from non-PIC.
12104     ;;
12105   amigaos*)
12106     # FIXME: we need at least 68020 code to build shared libraries, but
12107     # adding the `-m68020' flag to GCC prevents building anything better,
12108     # like `-m68040'.
12109     dll_cflags='-m68020 -resident32 -malways-restore-a4'
12110     ;;
12111   *)
12112     dll_cflags='-fPIC'
12113     ;;
12114   esac
12115 else
12116   # PORTME Check for PIC flags for the system compiler.
12117   case "$xehost_os" in
12118   hpux9* | hpux10*)
12119     # Is there a better link_static_flag that works with the bundled CC?
12120     wl='-Wl,'
12121     dll_cflags='+Z'
12122     ;;
12123
12124   irix5* | irix6*)
12125     wl='-Wl,'
12126     # PIC (with -KPIC) is the default.
12127     ;;
12128
12129   os2*)
12130     # We can build DLLs from non-PIC.
12131     ;;
12132
12133   osf3* | osf4*)
12134     # All OSF/1 code is PIC.
12135     wl='-Wl,'
12136     ;;
12137
12138   sco3.2v5*)
12139     dll_cflags='-belf -Kpic'
12140     wl='-Wl,'
12141     ;;
12142
12143   unixware*)
12144     dll_cflags="-KPIC"
12145     wl="-Wl,"
12146     ;;
12147
12148   sysv4*)
12149     dll_cflags="-KPIC"
12150     wl="-Wl,"
12151     ;;
12152
12153   sysv5*)
12154     dll_cflags="-KPIC"
12155     wl="-Wl,"
12156     ;;
12157
12158   solaris2*)
12159     dll_cflags='-KPIC'
12160     wl='-Wl,'
12161     ;;
12162
12163   sunos4*)
12164     dll_cflags='-PIC'
12165     wl='-Qoption ld '
12166     ;;
12167
12168   uts4*)
12169     dll_cflags='-pic'
12170     ;;
12171
12172   *)
12173     can_build_shared=no
12174     ;;
12175   esac
12176 fi
12177
12178 if test -n "$dll_cflags"; then
12179   echo "$ac_t""${dll_cflags}" 1>&6
12180   
12181   # Check to make sure the dll_cflags actually works.
12182   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12183 echo "configure:12184: checking if PIC flag ${dll_cflags} really works" >&5
12184   save_CFLAGS="$CFLAGS"
12185   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12186   cat > conftest.$ac_ext <<EOF
12187 #line 12188 "configure"
12188 #include "confdefs.h"
12189
12190 int main() {
12191 int x=0;
12192 ; return 0; }
12193 EOF
12194 if { (eval echo configure:12195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12195   rm -rf conftest*
12196   
12197     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12198     # reports no error.  So, we need to grep stderr for (Bundled).
12199     if grep '(Bundled)' config.log >/dev/null; then
12200       echo "$ac_t""no" 1>&6
12201       can_build_shared=no
12202       dll_cflags=
12203     else
12204       echo "$ac_t""yes" 1>&6
12205     fi
12206 else
12207   echo "configure: failed program was:" >&5
12208   cat conftest.$ac_ext >&5
12209   rm -rf conftest*
12210   echo "$ac_t""no" 1>&6
12211     can_build_shared=no
12212     dll_cflags=
12213 fi
12214 rm -f conftest*
12215   CFLAGS="$save_CFLAGS"
12216 else
12217   echo "$ac_t""none" 1>&6
12218 fi
12219
12220 if test "$can_build_shared" = "yes"; then
12221 cc_produces_so=no
12222 xldf=
12223 xcldf=
12224 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12225 echo "configure:12226: checking if C compiler can produce shared libraries" >&5
12226 if test "$XEGCC" = yes; then
12227   xcldf="-shared"
12228   xldf="-shared"
12229 else # Not using GCC
12230   case "$xehost_os" in
12231     aix3* | aix4*)
12232       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12233       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12234       ;;
12235
12236     freebsd2* | netbsd* | openbsd*)
12237       xldf="-Bshareable"
12238       xcldf="${wl}-Bshareable"
12239       ;;
12240
12241     freebsd3*)
12242       xcldf="-shared"
12243       ;;
12244
12245     hpux*)
12246       xldf="-b +s"
12247       xcldf="${wl}-b ${wl}+s"
12248       ;;
12249
12250     irix5* | irix6* | osf3* | osf4*)
12251       xcldf="${wl}-shared"
12252       xldf="-shared"
12253       ;;
12254
12255     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12256       xcldf="-G"
12257       xldf="-G"
12258       ;;
12259
12260     sunos4*)
12261       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12262       xldf="-assert pure-text -Bstatic"
12263       ;;
12264   esac
12265 fi # End if if we are using gcc
12266
12267 if test -n "$xcldf"; then
12268   save_LDFLAGS=$LDFLAGS
12269   save_LIBS=$LIBS
12270   save_xe_libs=$xe_libs
12271   LDFLAGS="$xcldf $LDFLAGS"
12272   LIBS=
12273   xe_libs=
12274   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12275   cat > conftest.$ac_ext <<EOF
12276 #line 12277 "configure"
12277 #include "confdefs.h"
12278
12279 int main() {
12280 int x=0;
12281 ; return 0; }
12282 EOF
12283 if { (eval echo configure:12284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12284   rm -rf conftest*
12285   cc_produces_so=yes
12286 else
12287   echo "configure: failed program was:" >&5
12288   cat conftest.$ac_ext >&5
12289   rm -rf conftest*
12290   cc_produces_so=no
12291 fi
12292 rm -f conftest*
12293   LDFLAGS=$save_LDFLAGS
12294   LIBS=$save_LIBS
12295   xe_libs=$save_xe_libs
12296   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12297 else
12298   cc_produces_so=no
12299 fi
12300 echo "$ac_t""${cc_produces_so}" 1>&6
12301
12302 LTLD=$LD
12303 if test -z "$LTLD"; then
12304   ac_prog=ld
12305   if test "$XEGCC" = yes; then
12306     # Check if gcc -print-prog-name=ld gives a path.
12307     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12308 echo "configure:12309: checking for ld used by GCC" >&5
12309     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12310     case "$ac_prog" in
12311     # Accept absolute paths.
12312     /*)
12313       if test -z "$LTLD"; then
12314         case "$ac_prog" in
12315           *gcc-lib*) LTLD="$CC"
12316                      ;;
12317           *)         LTLD="$ac_prog"
12318                      ;;
12319         esac
12320       fi
12321       ;;
12322     "")
12323       # If it fails, then pretend we aren't using GCC.
12324       ac_prog=ld
12325       ;;
12326     *)
12327       # If it is relative, then search for the first ld in PATH.
12328       with_gnu_ld=unknown
12329       ;;
12330     esac
12331   else
12332     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12333 echo "configure:12334: checking for GNU ld" >&5
12334   fi
12335
12336   if test -z "$LTLD"; then
12337     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12338     for ac_dir in $PATH; do
12339       test -z "$ac_dir" && ac_dir=.
12340       if test -f "$ac_dir/$ac_prog"; then
12341         LTLD="$ac_dir/$ac_prog"
12342         # Check to see if the program is GNU ld.  I'd rather use --version,
12343         # but apparently some GNU ld's only accept -v.
12344         # Break only if it was the GNU/non-GNU ld that we prefer.
12345         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12346           xe_gnu_ld=yes
12347         else
12348           xe_gnu_ld=no
12349         fi
12350       fi
12351     done
12352     IFS="$ac_save_ifs"
12353   fi
12354
12355   if test -n "$LTLD"; then
12356     echo "$ac_t""${LTLD}" 1>&6
12357   else
12358     echo "$ac_t""no" 1>&6
12359   fi
12360
12361   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12362     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12363     exit 1
12364   fi
12365 fi
12366
12367 ld_dynamic_link_flags=
12368
12369 # Check to see if it really is or isn't GNU ld.
12370 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12371 echo "configure:12372: checking if the linker is GNU ld" >&5
12372 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12373 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12374   xe_gnu_ld=yes
12375 else
12376   xe_gnu_ld=no
12377 fi
12378 echo "$ac_t""${xe_gnu_ld}" 1>&6
12379
12380 case "$xehost_os" in
12381   amigaos* | sunos4*)
12382     # On these operating systems, we should treat GNU ld like the system ld.
12383     gnu_ld_acts_native=yes
12384     ;;
12385   *)
12386     gnu_ld_acts_native=no
12387     ;;
12388 esac
12389
12390 if test "$cc_produces_so" = "yes"; then
12391   dll_ld=$CC
12392   dll_ldflags=$xcldf
12393   can_build_shared=yes
12394 else
12395   # OK - only NOW do we futz about with ld.
12396   # See if the linker supports building shared libraries.
12397   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12398 echo "configure:12399: checking whether the linker supports shared libraries" >&5
12399   dll_ld=$CC
12400   dll_ldflags=$LDFLAGS
12401   ld_shlibs=yes
12402   can_build_shared=yes
12403   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12404     # See if GNU ld supports shared libraries.
12405     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12406       dll_ld=$CC
12407       dll_ldflags="-shared"
12408       ld_shlibs=yes
12409     else
12410       ld_shlibs=no
12411     fi
12412   else
12413     # PORTME fill in a description of your system's linker (not GNU ld)
12414     case "$xehost_os" in
12415     aix3*)
12416       dll_ld=$LTLD
12417       dll_ldflags=$xldf
12418       ;;
12419
12420     aix4*)
12421       dll_ldflags=$xcldf
12422       ;;
12423
12424     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12425     # support.  Future versions do this automatically, but an explicit c++rt0.o
12426     # doesn't break anything, and helps significantly (at the cost of a little
12427     # extra space).
12428     freebsd2.2*)
12429       dll_ld=$LTLD
12430       dll_ldflags=$xldf
12431       dll_post="/usr/lib/c++rt0.o"
12432       ;;
12433
12434     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12435     freebsd2*)
12436       dll_ld=$LTLD
12437       dll_ldflags="-Bshareable"
12438       ;;
12439
12440     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12441     freebsd3*)
12442       dll_ldflags="-shared"
12443       ;;
12444
12445     hpux*)
12446       dll_ld=$LTLD
12447       dll_ldflags=$xldf
12448       ;;
12449
12450     irix5* | irix6*)
12451       dll_ld=$LTLD
12452       dll_ldflags=$xldf
12453       ;;
12454
12455     netbsd*)
12456       # Tested with NetBSD 1.2 ld
12457       dll_ld=$LTLD
12458       dll_ldflags=$xldf
12459       ;;
12460
12461     openbsd*)
12462       dll_ld=$LTLD
12463       dll_ldflags=$xldf
12464       ;;
12465
12466     osf3* | osf4*)
12467       dll_ld=$LTLD
12468       dll_ldflags=$xldf
12469       ;;
12470
12471     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12472     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12473       dll_ld=$LTLD
12474       case "$dll_ld" in
12475         *gcc*) dll_ldflags="-shared"
12476                dll_ld=$CC
12477                ;;
12478         *)     dll_ldflags="-G"
12479                ;;
12480       esac
12481       ;;
12482
12483     sunos4*)
12484       if test "$XEGCC" = yes; then
12485         dll_ld=$CC
12486       else
12487         dll_ld=$LTLD
12488       fi
12489       dll_ldflags=$xldf
12490       ;;
12491
12492     uts4*)
12493       dll_ld=$LTLD
12494       dll_ldflags="-G"
12495       ;;
12496
12497     bsdi*)
12498       dll_ldflags="-r"
12499       dll_ld="shlicc2"
12500       ;;
12501
12502     *)
12503       ld_shlibs=no
12504       can_build_shared=no
12505       ;;
12506     esac
12507   fi
12508   echo "$ac_t""${ld_shlibs}" 1>&6
12509   if test "$ld_shlibs" = "no"; then
12510     can_build_shared=no
12511   fi
12512 fi # End of if cc_produces_so = no
12513
12514
12515 if test "$xe_gnu_ld" = yes; then
12516   if test "$ld_shlibs" = yes; then
12517     ld_dynamic_link_flags="${wl}-export-dynamic"
12518   fi
12519 fi
12520
12521 if test -z "$ld_dynamic_link_flags"; then
12522   case "$xehost_os" in
12523   aix3*)
12524     ld_dynamic_link_flags=
12525     ;;
12526
12527   aix4*)
12528     ld_dynamic_link_flags=
12529     ;;
12530
12531   freebsd2.2*)
12532     ld_dynamic_link_flags=
12533     ;;
12534
12535   freebsd2*)
12536     ld_dynamic_link_flags=
12537     ;;
12538
12539   freebsd3*)
12540     ld_dynamic_link_flags=
12541     ;;
12542
12543   hpux*)
12544     ld_dynamic_link_flags="${wl}-E"
12545     ;;
12546
12547   irix5* | irix6*)
12548     ld_dynamic_link_flags=
12549     ;;
12550
12551   netbsd*)
12552     ld_dynamic_link_flags=
12553     ;;
12554
12555   openbsd*)
12556     ld_dynamic_link_flags=
12557     ;;
12558
12559   osf3* | osf4*)
12560     ld_dynamic_link_flags=
12561     ;;
12562
12563   solaris2* | solaris7*)
12564     ld_dynamic_link_flags="${wl}-Bdynamic"
12565     ;;
12566
12567   sco3.2v5* | unixware* | sysv5* | sysv4*)
12568     ld_dynamic_link_flags="${wl}-Bexport"
12569     ;;
12570
12571   sunos4*)
12572     ld_dynamic_link_flags=
12573     ;;
12574
12575   uts4*)
12576     ld_dynamic_link_flags=
12577     ;;
12578
12579   bsdi*)
12580     ld_dynamic_link_flags=
12581     ;;
12582
12583   esac
12584 fi # End of if -z ld_dynamic_link_flags
12585 fi # End of if test "$can_build_shared" = "yes"
12586
12587
12588
12589
12590
12591
12592
12593
12594   if test "$can_build_shared" = "yes"; then
12595     { test "$extra_verbose" = "yes" && cat << \EOF
12596     Defining HAVE_SHLIB
12597 EOF
12598 cat >> confdefs.h <<\EOF
12599 #define HAVE_SHLIB 1
12600 EOF
12601 }
12602
12603     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12604    echo "    xemacs will be linked with \"sysdll.o\""
12605  fi
12606     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12607    echo "    xemacs will be linked with \"emodules.o\""
12608  fi
12609     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12610     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12611     for ac_func in dlerror _dlerror
12612 do
12613 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12614 echo "configure:12615: checking for $ac_func" >&5
12615
12616 cat > conftest.$ac_ext <<EOF
12617 #line 12618 "configure"
12618 #include "confdefs.h"
12619 /* System header to define __stub macros and hopefully few prototypes,
12620     which can conflict with char $ac_func(); below.  */
12621 #include <assert.h>
12622 /* Override any gcc2 internal prototype to avoid an error.  */
12623 /* We use char because int might match the return type of a gcc2
12624     builtin and then its argument prototype would still apply.  */
12625 char $ac_func();
12626
12627 int main() {
12628
12629 /* The GNU C library defines this for functions which it implements
12630     to always fail with ENOSYS.  Some functions are actually named
12631     something starting with __ and the normal name is an alias.  */
12632 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12633 choke me
12634 #else
12635 $ac_func();
12636 #endif
12637
12638 ; return 0; }
12639 EOF
12640 if { (eval echo configure:12641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12641   rm -rf conftest*
12642   eval "ac_cv_func_$ac_func=yes"
12643 else
12644   echo "configure: failed program was:" >&5
12645   cat conftest.$ac_ext >&5
12646   rm -rf conftest*
12647   eval "ac_cv_func_$ac_func=no"
12648 fi
12649 rm -f conftest*
12650
12651 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12652   echo "$ac_t""yes" 1>&6
12653     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12654   { test "$extra_verbose" = "yes" && cat << EOF
12655     Defining $ac_tr_func
12656 EOF
12657 cat >> confdefs.h <<EOF
12658 #define $ac_tr_func 1
12659 EOF
12660 }
12661  
12662 else
12663   echo "$ac_t""no" 1>&6
12664 fi
12665 done
12666
12667   else
12668     echo "configure: warning: disabling shared library support" 1>&2
12669     with_shlib=no
12670   fi
12671 fi
12672
12673 cat > conftest.$ac_ext <<EOF
12674 #line 12675 "configure"
12675 #include "confdefs.h"
12676 int main(int c,char *v[]){return 0;}
12677 EOF
12678 if { (eval echo configure:12679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12679 then
12680   :
12681 else
12682   conftest_rc="$?"
12683   echo "configure: failed program was:" >&5
12684   cat conftest.$ac_ext >&5
12685   rm -fr conftest*
12686   
12687   echo ""
12688   echo "*** PANIC *** The C compiler can no longer build working executables."
12689   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12690   echo "*** PANIC *** The most likely reason for this problem is that configure"
12691   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12692   echo "*** PANIC *** found at run time."
12693   echo "*** PANIC ***"
12694   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12695   echo "*** PANIC *** On other systems, try telling configure where to find the"
12696   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12697   echo "*** PANIC ***"
12698   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12699   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12700   echo "*** PANIC *** on your system.  Don't do that."
12701   exit 1
12702 fi
12703 rm -fr conftest*
12704
12705 if test "$win32_processes" = "yes"; then
12706   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12707    echo "    xemacs will be linked with \"process-nt.o\""
12708  fi
12709 else
12710   { test "$extra_verbose" = "yes" && cat << \EOF
12711     Defining HAVE_UNIX_PROCESSES
12712 EOF
12713 cat >> confdefs.h <<\EOF
12714 #define HAVE_UNIX_PROCESSES 1
12715 EOF
12716 }
12717
12718   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12719    echo "    xemacs will be linked with \"process-unix.o\""
12720  fi
12721 fi
12722
12723
12724
12725 T=""
12726 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12727 CFLAGS="$T"
12728
12729
12730 T=""
12731 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12732 extra_objs="$T"
12733
12734
12735 T=""
12736 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
12737 c_switch_general="$T"
12738
12739
12740 T=""
12741 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12742 c_switch_window_system="$T"
12743
12744
12745 T=""
12746 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12747 c_switch_all="$T"
12748
12749
12750 T=""
12751 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
12752 ld_switch_general="$T"
12753
12754
12755 T=""
12756 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12757 ld_switch_window_system="$T"
12758
12759
12760 T=""
12761 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12762 ld_switch_all="$T"
12763
12764
12765 T=""
12766 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12767 ld_libs_general="$T"
12768
12769
12770 T=""
12771 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
12772 ld_libs_window_system="$T"
12773
12774
12775 T=""
12776 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12777 ld_libs_all="$T"
12778
12779
12780
12781 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12782 internal_makefile_list="Makefile.in"
12783 SUBDIR_MAKEFILES=''
12784 test -d lock || mkdir lock
12785 for dir in $MAKE_SUBDIR; do
12786   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12787         test -d "$d" || mkdir "$d"; cd "$d"
12788       done ) ;;
12789    * ) test -d "$dir" || mkdir "$dir" ;;
12790   esac
12791   
12792 T=""
12793 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12794 SUBDIR_MAKEFILES="$T"
12795
12796   
12797 T=""
12798 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12799 internal_makefile_list="$T"
12800
12801 done
12802
12803
12804
12805
12806 for dir in src/s src/m; do
12807   if test ! -d "$dir" ; then
12808     echo Making symbolic link to "$srcdir/$dir"
12809     ${LN_S} "$srcdir/$dir" "$dir"
12810   fi
12811 done
12812
12813 if test "$extra_verbose" = "yes"; then
12814   echo ""
12815   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
12816   echo ""
12817 fi
12818
12819 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12820   echo "creating src/gdbinit"; echo ""
12821   echo "source $srcdir/src/gdbinit" > src/gdbinit
12822 fi
12823
12824 if test "$__SUNPRO_C" = "yes"; then
12825   echo "creating .sbinit"; echo ""
12826   ( echo "# For use with Sun WorkShop's Source browser."
12827     echo "# See sbquery(1) and sbinit(4) for more information"
12828     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12829   ) > .sbinit
12830 fi
12831
12832 rm -f core
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849 PREFIX=$prefix
12850 while true; do
12851   case "$PREFIX" in
12852     *\$* ) eval "PREFIX=$PREFIX" ;;
12853     *) break ;;
12854   esac
12855 done
12856
12857
12858
12859 EXEC_PREFIX=$exec_prefix
12860 while true; do
12861   case "$EXEC_PREFIX" in
12862     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12863     *) break ;;
12864   esac
12865 done
12866
12867
12868
12869
12870 INFODIR=$infodir
12871 while true; do
12872   case "$INFODIR" in
12873     *\$* ) eval "INFODIR=$INFODIR" ;;
12874     *) break ;;
12875   esac
12876 done
12877
12878
12879
12880
12881 INFOPATH=$infopath
12882 while true; do
12883   case "$INFOPATH" in
12884     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12885     *) break ;;
12886   esac
12887 done
12888
12889
12890
12891
12892 PACKAGE_PATH=$package_path
12893 while true; do
12894   case "$PACKAGE_PATH" in
12895     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12896     *) break ;;
12897   esac
12898 done
12899
12900
12901
12902
12903 LISPDIR=$lispdir
12904 while true; do
12905   case "$LISPDIR" in
12906     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12907     *) break ;;
12908   esac
12909 done
12910
12911
12912
12913
12914 MODULEDIR=$moduledir
12915 while true; do
12916   case "$MODULEDIR" in
12917     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12918     *) break ;;
12919   esac
12920 done
12921
12922
12923
12924
12925 SITELISPDIR=$sitelispdir
12926 while true; do
12927   case "$SITELISPDIR" in
12928     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12929     *) break ;;
12930   esac
12931 done
12932
12933
12934
12935
12936 SITEMODULEDIR=$sitemoduledir
12937 while true; do
12938   case "$SITEMODULEDIR" in
12939     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12940     *) break ;;
12941   esac
12942 done
12943
12944
12945
12946
12947 ETCDIR=$etcdir
12948 while true; do
12949   case "$ETCDIR" in
12950     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12951     *) break ;;
12952   esac
12953 done
12954
12955
12956
12957
12958 LOCKDIR=$lockdir
12959 while true; do
12960   case "$LOCKDIR" in
12961     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12962     *) break ;;
12963   esac
12964 done
12965
12966
12967
12968
12969 ARCHLIBDIR=$archlibdir
12970 while true; do
12971   case "$ARCHLIBDIR" in
12972     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12973     *) break ;;
12974   esac
12975 done
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12997
12998
12999
13000
13001
13002
13003
13004 : ${XEMACS_CC:=$CC}
13005
13006
13007
13008 if test "$with_site_lisp" = "no"; then
13009   { test "$extra_verbose" = "yes" && cat << \EOF
13010     Defining INHIBIT_SITE_LISP
13011 EOF
13012 cat >> confdefs.h <<\EOF
13013 #define INHIBIT_SITE_LISP 1
13014 EOF
13015 }
13016
13017 fi
13018 if test "$with_site_modules" = "no"; then
13019   { test "$extra_verbose" = "yes" && cat << \EOF
13020     Defining INHIBIT_SITE_MODULES
13021 EOF
13022 cat >> confdefs.h <<\EOF
13023 #define INHIBIT_SITE_MODULES 1
13024 EOF
13025 }
13026
13027 fi
13028
13029
13030 T=""
13031 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13032 ac_configure_args="$T"
13033
13034 { test "$extra_verbose" = "yes" && cat << EOF
13035     Defining EMACS_CONFIGURATION = "$canonical"
13036 EOF
13037 cat >> confdefs.h <<EOF
13038 #define EMACS_CONFIGURATION "$canonical"
13039 EOF
13040 }
13041
13042 { test "$extra_verbose" = "yes" && cat << EOF
13043     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
13044 EOF
13045 cat >> confdefs.h <<EOF
13046 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
13047 EOF
13048 }
13049
13050 { test "$extra_verbose" = "yes" && cat << EOF
13051     Defining config_machfile = "$machfile"
13052 EOF
13053 cat >> confdefs.h <<EOF
13054 #define config_machfile "$machfile"
13055 EOF
13056 }
13057
13058 { test "$extra_verbose" = "yes" && cat << EOF
13059     Defining config_opsysfile = "$opsysfile"
13060 EOF
13061 cat >> confdefs.h <<EOF
13062 #define config_opsysfile "$opsysfile"
13063 EOF
13064 }
13065
13066
13067
13068 null_string=""
13069 { test "$extra_verbose" = "yes" && cat << EOF
13070     Defining LD_SWITCH_X_SITE = $null_string
13071 EOF
13072 cat >> confdefs.h <<EOF
13073 #define LD_SWITCH_X_SITE $null_string
13074 EOF
13075 }
13076
13077 { test "$extra_verbose" = "yes" && cat << EOF
13078     Defining LD_SWITCH_X_SITE_AUX = $null_string
13079 EOF
13080 cat >> confdefs.h <<EOF
13081 #define LD_SWITCH_X_SITE_AUX $null_string
13082 EOF
13083 }
13084
13085 { test "$extra_verbose" = "yes" && cat << EOF
13086     Defining C_SWITCH_X_SITE = $null_string
13087 EOF
13088 cat >> confdefs.h <<EOF
13089 #define C_SWITCH_X_SITE $null_string
13090 EOF
13091 }
13092
13093 { test "$extra_verbose" = "yes" && cat << EOF
13094     Defining LD_SWITCH_SITE = $null_string
13095 EOF
13096 cat >> confdefs.h <<EOF
13097 #define LD_SWITCH_SITE $null_string
13098 EOF
13099 }
13100
13101 { test "$extra_verbose" = "yes" && cat << EOF
13102     Defining C_SWITCH_SITE = $null_string
13103 EOF
13104 cat >> confdefs.h <<EOF
13105 #define C_SWITCH_SITE $null_string
13106 EOF
13107 }
13108
13109
13110
13111 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13112     Defining GNU_MALLOC
13113 EOF
13114 cat >> confdefs.h <<\EOF
13115 #define GNU_MALLOC 1
13116 EOF
13117 }
13118
13119 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13120     Defining USE_SYSTEM_MALLOC
13121 EOF
13122 cat >> confdefs.h <<\EOF
13123 #define USE_SYSTEM_MALLOC 1
13124 EOF
13125 }
13126
13127 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13128     Defining USE_DEBUG_MALLOC
13129 EOF
13130 cat >> confdefs.h <<\EOF
13131 #define USE_DEBUG_MALLOC 1
13132 EOF
13133 }
13134
13135                                               { test "$extra_verbose" = "yes" && cat << \EOF
13136     Defining USE_SYSTEM_MALLOC
13137 EOF
13138 cat >> confdefs.h <<\EOF
13139 #define USE_SYSTEM_MALLOC 1
13140 EOF
13141 }
13142
13143 fi
13144 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13145     Defining I18N3
13146 EOF
13147 cat >> confdefs.h <<\EOF
13148 #define I18N3 1
13149 EOF
13150 }
13151
13152 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13153     Defining USE_GCC
13154 EOF
13155 cat >> confdefs.h <<\EOF
13156 #define USE_GCC 1
13157 EOF
13158 }
13159
13160 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13161     Defining EXTERNAL_WIDGET
13162 EOF
13163 cat >> confdefs.h <<\EOF
13164 #define EXTERNAL_WIDGET 1
13165 EOF
13166 }
13167
13168 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13169     Defining NO_DOC_FILE
13170 EOF
13171 cat >> confdefs.h <<\EOF
13172 #define NO_DOC_FILE 1
13173 EOF
13174 }
13175
13176 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13177     Defining PURIFY
13178 EOF
13179 cat >> confdefs.h <<\EOF
13180 #define PURIFY 1
13181 EOF
13182 }
13183
13184 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13185     Defining QUANTIFY
13186 EOF
13187 cat >> confdefs.h <<\EOF
13188 #define QUANTIFY 1
13189 EOF
13190 }
13191
13192 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13193     Defining MAIL_USE_POP
13194 EOF
13195 cat >> confdefs.h <<\EOF
13196 #define MAIL_USE_POP 1
13197 EOF
13198 }
13199
13200 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13201     Defining KERBEROS
13202 EOF
13203 cat >> confdefs.h <<\EOF
13204 #define KERBEROS 1
13205 EOF
13206 }
13207
13208 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13209     Defining HESIOD
13210 EOF
13211 cat >> confdefs.h <<\EOF
13212 #define HESIOD 1
13213 EOF
13214 }
13215
13216 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13217     Defining USE_UNION_TYPE
13218 EOF
13219 cat >> confdefs.h <<\EOF
13220 #define USE_UNION_TYPE 1
13221 EOF
13222 }
13223
13224
13225
13226 (
13227 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13228 else
13229   echo "uname -a: `uname -a`"
13230 fi
13231 echo ""
13232 echo "$0 $quoted_arguments"
13233 ) > Installation
13234
13235 if test ! -z ${emacs_beta_version} ; then
13236   if test -z "${emacs_is_beta}" ; then
13237         xemacs_betaname=".${emacs_beta_version}"
13238   else
13239         xemacs_betaname="-b${emacs_beta_version}"
13240   fi
13241 else
13242   xemacs_betaname=""    
13243 fi
13244
13245 (
13246 echo "
13247
13248 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13249
13250   Where should the build process find the source code?    $srcdir
13251   What installation prefix should install use?            $prefix
13252   What operating system and machine description files should XEmacs use?
13253         \`$opsysfile' and \`$machfile'
13254   What compiler should XEmacs be built with?              $CC $CFLAGS
13255   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13256   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13257   What window system should XEmacs use?                   ${window_system}"
13258 if test "$with_x11" = "yes"; then
13259   echo "  Where do we find X Windows header files?                $x_includes"
13260   echo "  Where do we find X Windows libraries?                   $x_libraries"
13261 fi
13262 if test -n "$site_includes"; then
13263   echo "  Additional header files:                                $site_includes"
13264 fi
13265 if test -n "$site_libraries"; then
13266   echo "  Additional libraries:                                   $site_libraries"
13267 fi
13268 if test -n "$site_prefixes"; then
13269   echo "  Additional prefixes:                                    $site_prefixes"
13270 fi
13271 if test -n "$runpath"; then
13272   echo "  Runtime library search path:                            $runpath"
13273 fi
13274 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13275 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13276 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13277 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13278   echo "  No Xmu; substituting equivalent routines."
13279 fi
13280
13281 if test "$with_xpm" = yes; then
13282   echo "  Compiling in support for XPM images."
13283 elif test "$with_x11" = yes; then
13284   echo "  --------------------------------------------------------------------"
13285   echo "  WARNING: Compiling without XPM support."
13286   if test "$xpm_problem" != ""; then
13287     echo "  Reason: $xpm_problem"
13288   fi
13289   echo "  WARNING: You should strongly consider installing XPM."
13290   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13291   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13292   echo "  --------------------------------------------------------------------"
13293 fi
13294 if test "$with_png" = yes; then
13295   echo "  Compiling in support for PNG image handling."
13296 elif test "$window_system" != "none"; then
13297   echo "  --------------------------------------------------------------------"
13298   echo "  WARNING: Compiling without PNG image support."
13299   if test "$png_problem" != ""; then
13300     echo "  Reason: $png_problem"
13301   fi
13302   echo "  WARNING: You should strongly consider installing the PNG libraries."
13303   echo "  WARNING: Otherwise certain images and glyphs may not display."
13304   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13305   echo "  --------------------------------------------------------------------"
13306 fi
13307 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13308 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13309 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13310 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13311 case "$with_sound" in
13312   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13313   native ) echo "  Compiling in native sound support." ;;
13314   both   ) echo "  Compiling in both network and native sound support." ;;
13315 esac
13316 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13317
13318 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13319 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13320 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13321
13322 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
13323 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
13324 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
13325
13326 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13327 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13328
13329 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13330 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13331 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13332 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13333 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13334 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13335 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13336 if test "$with_wnn" = yes; then
13337   echo "  Compiling in support for the WNN input method on Mule."
13338   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13339 fi
13340 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13341
13342 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13343 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13344 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13345 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13346 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13347 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13348 case "$with_menubars" in
13349   lucid ) echo "  Using Lucid menubars." ;;
13350   motif ) echo "  Using Motif menubars."
13351           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13352           echo "             We recommend using the Lucid menubar instead."
13353           echo "             Re-run configure with --with-menubars='lucid'." ;;
13354 esac
13355 case "$with_scrollbars" in
13356   lucid    ) echo "  Using Lucid scrollbars."     ;;
13357   motif    ) echo "  Using Motif scrollbars."     ;;
13358   athena   ) echo "  Using Athena scrollbars."    ;;
13359   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13360 esac
13361 case "$with_dialogs" in
13362   motif    )
13363     echo "  Using Motif dialog boxes."
13364     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13365       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13366       echo "             We recommend using the Athena dialog boxes instead."
13367       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13368       echo "             Read the PROBLEMS file for more information."
13369     fi; fi
13370     ;;
13371   athena   ) echo "  Using Athena dialog boxes."    ;;
13372   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13373 esac
13374 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
13375 test "$with_clash_detection" = yes && \
13376   echo "  Clash detection will use \"$lockdir\" for locking files."
13377 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13378 test "$with_pop"        = yes && echo "  Using POP for mail access."
13379 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13380 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13381 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13382 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13383 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13384 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13385   != "no no no no no"; then
13386   echo "  WARNING: ---------------------------------------------------------"
13387   echo "  WARNING: Compiling in support for runtime error checking."
13388   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13389   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13390   echo "  WARNING: ---------------------------------------------------------"
13391 fi
13392 echo ""
13393 ) | tee -a Installation
13394 echo ""
13395
13396
13397 # Remove any trailing slashes in these variables.
13398 test -n "$prefix" &&
13399   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13400 test -n "$exec_prefix" &&
13401   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13402
13403
13404 for file in $internal_makefile_list; do
13405   test "$file" = src/Makefile.in && \
13406     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13407   ac_output_files="${ac_output_files+$ac_output_files }$file"
13408 done
13409 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13410 if test "$with_shlib" = "yes"; then
13411   ac_output_files="$ac_output_files lib-src/ellcc.h"
13412 fi
13413
13414 trap '' 1 2 15
13415
13416 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13417
13418 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13419 # Let make expand exec_prefix.
13420 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13421
13422 # Any assignment to VPATH causes Sun make to only execute
13423 # the first set of double-colon rules, so remove it if not needed.
13424 # If there is a colon in the path, we need to keep it.
13425 if test "x$srcdir" = x.; then
13426   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13427 fi
13428
13429 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13430
13431 DEFS=-DHAVE_CONFIG_H
13432
13433 # Without the "./", some shells look in PATH for config.status.
13434 : ${CONFIG_STATUS=./config.status}
13435
13436 echo creating $CONFIG_STATUS
13437 rm -f $CONFIG_STATUS
13438 cat > $CONFIG_STATUS <<EOF
13439 #! /bin/sh
13440 # Generated automatically by configure.
13441 # Run this file to recreate the current configuration.
13442 # This directory was configured as follows,
13443 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13444 #
13445 # $0 $ac_configure_args
13446 #
13447 # Compiler output produced by configure, useful for debugging
13448 # configure, is in ./config.log if it exists.
13449
13450 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13451 for ac_option
13452 do
13453   case "\$ac_option" in
13454   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13455     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13456     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13457   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13458     echo "$CONFIG_STATUS generated by autoconf version 2.13"
13459     exit 0 ;;
13460   -help | --help | --hel | --he | --h)
13461     echo "\$ac_cs_usage"; exit 0 ;;
13462   *) echo "\$ac_cs_usage"; exit 1 ;;
13463   esac
13464 done
13465
13466 ac_given_srcdir=$srcdir
13467 ac_given_INSTALL="$INSTALL"
13468
13469 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13470 EOF
13471 cat >> $CONFIG_STATUS <<EOF
13472
13473 # Protect against being on the right side of a sed subst in config.status.
13474 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13475  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13476 $ac_vpsub
13477 $extrasub
13478 s%@SHELL@%$SHELL%g
13479 s%@CFLAGS@%$CFLAGS%g
13480 s%@CPPFLAGS@%$CPPFLAGS%g
13481 s%@CXXFLAGS@%$CXXFLAGS%g
13482 s%@FFLAGS@%$FFLAGS%g
13483 s%@DEFS@%$DEFS%g
13484 s%@LDFLAGS@%$LDFLAGS%g
13485 s%@LIBS@%$LIBS%g
13486 s%@exec_prefix@%$exec_prefix%g
13487 s%@prefix@%$prefix%g
13488 s%@program_transform_name@%$program_transform_name%g
13489 s%@bindir@%$bindir%g
13490 s%@sbindir@%$sbindir%g
13491 s%@libexecdir@%$libexecdir%g
13492 s%@datadir@%$datadir%g
13493 s%@sysconfdir@%$sysconfdir%g
13494 s%@sharedstatedir@%$sharedstatedir%g
13495 s%@localstatedir@%$localstatedir%g
13496 s%@libdir@%$libdir%g
13497 s%@includedir@%$includedir%g
13498 s%@oldincludedir@%$oldincludedir%g
13499 s%@infodir@%$infodir%g
13500 s%@mandir@%$mandir%g
13501 s%@LN_S@%$LN_S%g
13502 s%@blddir@%$blddir%g
13503 s%@CC@%$CC%g
13504 s%@CPP@%$CPP%g
13505 s%@start_flags@%$start_flags%g
13506 s%@ld_switch_shared@%$ld_switch_shared%g
13507 s%@start_files@%$start_files%g
13508 s%@ld@%$ld%g
13509 s%@lib_gcc@%$lib_gcc%g
13510 s%@RANLIB@%$RANLIB%g
13511 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13512 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
13513 s%@INSTALL_DATA@%$INSTALL_DATA%g
13514 s%@YACC@%$YACC%g
13515 s%@SET_MAKE@%$SET_MAKE%g
13516 s%@X_CFLAGS@%$X_CFLAGS%g
13517 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13518 s%@X_LIBS@%$X_LIBS%g
13519 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13520 s%@install_pp@%$install_pp%g
13521 s%@libs_xauth@%$libs_xauth%g
13522 s%@dnd_objs@%$dnd_objs%g
13523 s%@lwlib_objs@%$lwlib_objs%g
13524 s%@ALLOCA@%$ALLOCA%g
13525 s%@dll_ld@%$dll_ld%g
13526 s%@dll_cflags@%$dll_cflags%g
13527 s%@dll_ldflags@%$dll_ldflags%g
13528 s%@dll_post@%$dll_post%g
13529 s%@dll_ldo@%$dll_ldo%g
13530 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13531 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13532 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13533 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13534 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13535 s%@PROGNAME@%$PROGNAME%g
13536 s%@version@%$version%g
13537 s%@configuration@%$configuration%g
13538 s%@canonical@%$canonical%g
13539 s%@srcdir@%$srcdir%g
13540 s%@pkgdir@%$pkgdir%g
13541 s%@statedir@%$statedir%g
13542 s%@PREFIX@%$PREFIX%g
13543 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13544 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13545 s%@INFODIR@%$INFODIR%g
13546 s%@infopath@%$infopath%g
13547 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13548 s%@INFOPATH@%$INFOPATH%g
13549 s%@package_path@%$package_path%g
13550 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13551 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13552 s%@lispdir@%$lispdir%g
13553 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13554 s%@LISPDIR@%$LISPDIR%g
13555 s%@moduledir@%$moduledir%g
13556 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13557 s%@MODULEDIR@%$MODULEDIR%g
13558 s%@sitelispdir@%$sitelispdir%g
13559 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13560 s%@SITELISPDIR@%$SITELISPDIR%g
13561 s%@sitemoduledir@%$sitemoduledir%g
13562 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13563 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13564 s%@etcdir@%$etcdir%g
13565 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13566 s%@ETCDIR@%$ETCDIR%g
13567 s%@lockdir@%$lockdir%g
13568 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13569 s%@LOCKDIR@%$LOCKDIR%g
13570 s%@archlibdir@%$archlibdir%g
13571 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13572 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13573 s%@docdir@%$docdir%g
13574 s%@bitmapdir@%$bitmapdir%g
13575 s%@extra_objs@%$extra_objs%g
13576 s%@machfile@%$machfile%g
13577 s%@opsysfile@%$opsysfile%g
13578 s%@c_switch_general@%$c_switch_general%g
13579 s%@c_switch_window_system@%$c_switch_window_system%g
13580 s%@c_switch_all@%$c_switch_all%g
13581 s%@ld_switch_general@%$ld_switch_general%g
13582 s%@ld_switch_window_system@%$ld_switch_window_system%g
13583 s%@ld_switch_all@%$ld_switch_all%g
13584 s%@ld_libs_general@%$ld_libs_general%g
13585 s%@ld_libs_window_system@%$ld_libs_window_system%g
13586 s%@ld_libs_all@%$ld_libs_all%g
13587 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13588 s%@native_sound_lib@%$native_sound_lib%g
13589 s%@sound_cflags@%$sound_cflags%g
13590 s%@dynodump_arch@%$dynodump_arch%g
13591 s%@XEMACS_CC@%$XEMACS_CC%g
13592 s%@internal_makefile_list@%$internal_makefile_list%g
13593
13594 CEOF
13595 EOF
13596
13597 cat >> $CONFIG_STATUS <<\EOF
13598
13599 # Split the substitutions into bite-sized pieces for seds with
13600 # small command number limits, like on Digital OSF/1 and HP-UX.
13601 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13602 ac_file=1 # Number of current file.
13603 ac_beg=1 # First line for current file.
13604 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13605 ac_more_lines=:
13606 ac_sed_cmds=""
13607 while $ac_more_lines; do
13608   if test $ac_beg -gt 1; then
13609     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13610   else
13611     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13612   fi
13613   if test ! -s conftest.s$ac_file; then
13614     ac_more_lines=false
13615     rm -f conftest.s$ac_file
13616   else
13617     if test -z "$ac_sed_cmds"; then
13618       ac_sed_cmds="sed -f conftest.s$ac_file"
13619     else
13620       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13621     fi
13622     ac_file=`expr $ac_file + 1`
13623     ac_beg=$ac_end
13624     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13625   fi
13626 done
13627 if test -z "$ac_sed_cmds"; then
13628   ac_sed_cmds=cat
13629 fi
13630 EOF
13631
13632 cat >> $CONFIG_STATUS <<EOF
13633
13634 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13635 EOF
13636 cat >> $CONFIG_STATUS <<\EOF
13637 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13638   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13639   case "$ac_file" in
13640   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13641        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13642   *) ac_file_in="${ac_file}.in" ;;
13643   esac
13644
13645   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13646
13647   # Remove last slash and all that follows it.  Not all systems have dirname.
13648   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13649   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13650     # The file is in a subdirectory.
13651     test ! -d "$ac_dir" && mkdir "$ac_dir"
13652     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13653     # A "../" for each directory in $ac_dir_suffix.
13654     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13655   else
13656     ac_dir_suffix= ac_dots=
13657   fi
13658
13659   case "$ac_given_srcdir" in
13660   .)  srcdir=.
13661       if test -z "$ac_dots"; then top_srcdir=.
13662       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13663   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13664   *) # Relative path.
13665     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13666     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13667   esac
13668
13669   case "$ac_given_INSTALL" in
13670   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13671   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13672   esac
13673
13674   echo creating "$ac_file"
13675   rm -f "$ac_file"
13676   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13677   case "$ac_file" in
13678   *Makefile*) ac_comsub="1i\\
13679 # $configure_input" ;;
13680   *) ac_comsub= ;;
13681   esac
13682
13683   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13684   sed -e "$ac_comsub
13685 s%@configure_input@%$configure_input%g
13686 s%@srcdir@%$srcdir%g
13687 s%@top_srcdir@%$top_srcdir%g
13688 s%@INSTALL@%$INSTALL%g
13689 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13690 fi; done
13691 rm -f conftest.s*
13692
13693 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13694 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13695 #
13696 # ac_d sets the value in "#define NAME VALUE" lines.
13697 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13698 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13699 ac_dC='\3'
13700 ac_dD='%g'
13701 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13702 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13703 ac_uB='\([      ]\)%\1#\2define\3'
13704 ac_uC=' '
13705 ac_uD='\4%g'
13706 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13707 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13708 ac_eB='$%\1#\2define\3'
13709 ac_eC=' '
13710 ac_eD='%g'
13711
13712 if test "${CONFIG_HEADERS+set}" != set; then
13713 EOF
13714 cat >> $CONFIG_STATUS <<EOF
13715   CONFIG_HEADERS="src/config.h lwlib/config.h"
13716 EOF
13717 cat >> $CONFIG_STATUS <<\EOF
13718 fi
13719 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13720   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13721   case "$ac_file" in
13722   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13723        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13724   *) ac_file_in="${ac_file}.in" ;;
13725   esac
13726
13727   echo creating $ac_file
13728
13729   rm -f conftest.frag conftest.in conftest.out
13730   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13731   cat $ac_file_inputs > conftest.in
13732
13733 EOF
13734
13735 # Transform confdefs.h into a sed script conftest.vals that substitutes
13736 # the proper values into config.h.in to produce config.h.  And first:
13737 # Protect against being on the right side of a sed subst in config.status.
13738 # Protect against being in an unquoted here document in config.status.
13739 rm -f conftest.vals
13740 cat > conftest.hdr <<\EOF
13741 s/[\\&%]/\\&/g
13742 s%[\\$`]%\\&%g
13743 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13744 s%ac_d%ac_u%gp
13745 s%ac_u%ac_e%gp
13746 EOF
13747 sed -n -f conftest.hdr confdefs.h > conftest.vals
13748 rm -f conftest.hdr
13749
13750 # This sed command replaces #undef with comments.  This is necessary, for
13751 # example, in the case of _POSIX_SOURCE, which is predefined and required
13752 # on some systems where configure will not decide to define it.
13753 cat >> conftest.vals <<\EOF
13754 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13755 EOF
13756
13757 # Break up conftest.vals because some shells have a limit on
13758 # the size of here documents, and old seds have small limits too.
13759
13760 rm -f conftest.tail
13761 while :
13762 do
13763   ac_lines=`grep -c . conftest.vals`
13764   # grep -c gives empty output for an empty file on some AIX systems.
13765   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13766   # Write a limited-size here document to conftest.frag.
13767   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13768   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13769   echo 'CEOF
13770   sed -f conftest.frag conftest.in > conftest.out
13771   rm -f conftest.in
13772   mv conftest.out conftest.in
13773 ' >> $CONFIG_STATUS
13774   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13775   rm -f conftest.vals
13776   mv conftest.tail conftest.vals
13777 done
13778 rm -f conftest.vals
13779
13780 cat >> $CONFIG_STATUS <<\EOF
13781   rm -f conftest.frag conftest.h
13782   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13783   cat conftest.in >> conftest.h
13784   rm -f conftest.in
13785   if cmp -s $ac_file conftest.h 2>/dev/null; then
13786     echo "$ac_file is unchanged"
13787     rm -f conftest.h
13788   else
13789     # Remove last slash and all that follows it.  Not all systems have dirname.
13790       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13791       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13792       # The file is in a subdirectory.
13793       test ! -d "$ac_dir" && mkdir "$ac_dir"
13794     fi
13795     rm -f $ac_file
13796     mv conftest.h $ac_file
13797   fi
13798 fi; done
13799
13800 EOF
13801 cat >> $CONFIG_STATUS <<EOF
13802 CPP="$CPP"
13803  top_srcdir="$srcdir"
13804  MAKE_SUBDIR="$MAKE_SUBDIR"
13805
13806 EOF
13807 cat >> $CONFIG_STATUS <<\EOF
13808 for dir in . $MAKE_SUBDIR; do
13809   (
13810     cd $dir
13811     rm -f junk.c
13812     < Makefile.in \
13813       sed -e '/^# Generated/d' \
13814           -e 's%/\*\*/#.*%%' \
13815           -e 's/^ *# */#/' \
13816           -e '/^##/d' \
13817           -e '/^#/ {
13818 p
13819 d
13820 }'        \
13821           -e '/./ {
13822 s/\([\"]\)/\\\1/g
13823 s/^/"/
13824 s/$/"/
13825 }'  > junk.c;
13826
13827
13828
13829     echo creating $dir/Makefile
13830 $CPP -I. -I${top_srcdir}/src  junk.c \
13831   | sed -e 's/^\#.*//'          \
13832         -e 's/^[        ][      ]*$//'\
13833         -e 's/^ /       /'              \
13834   | sed -n -e '/^..*$/p'        \
13835   | sed '/^\"/ {
13836         s/\\\([\"]\)/\1/g
13837         s/^[    ]*\"//
13838         s/\"[   ]*$//
13839 }' > Makefile.new
13840     chmod 444 Makefile.new
13841     mv -f Makefile.new Makefile
13842
13843     echo creating $dir/GNUmakefile
13844 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13845   | sed -e 's/^\#.*//'          \
13846         -e 's/^[        ][      ]*$//'\
13847         -e 's/^ /       /'              \
13848   | sed -n -e '/^..*$/p'        \
13849   | sed '/^\"/ {
13850         s/\\\([\"]\)/\1/g
13851         s/^[    ]*\"//
13852         s/\"[   ]*$//
13853 }' > Makefile.new
13854     chmod 444 Makefile.new
13855     mv -f Makefile.new GNUmakefile
13856
13857     rm -f junk.c
13858   )
13859 done
13860
13861 sed < config.status >> lib-src/config.values \
13862   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13863   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13864   -e 's/^\([^ ]*\) $/\1 ""/' \
13865   -e 's/ 1$/ t/'
13866
13867
13868 exit 0
13869 EOF
13870 chmod +x $CONFIG_STATUS
13871 rm -fr confdefs* $ac_clean_files
13872 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1