Contents in latest XEmacs 21.2 at 1999-06-09-16.
[chise/xemacs-chise.git.1] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.13 
6 #### Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
7 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
8 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
9 #### Copyright (C) 1995, 1996 Ben Wing.
10 #### Copyright (C) 1998, 1999 J. Kean Johnston.
11
12 ### Don't edit this script!
13 ### This script was automatically generated by the `autoconf' program
14 ### from the file `./configure.in'.
15 ### To rebuild it, execute the command
16 ###     autoconf
17 ### in the this directory.  You must have autoconf version 2.12 or later.
18
19 ### This file is part of XEmacs.
20
21 ### XEmacs is free software; you can redistribute it and/or modify it
22 ### under the terms of the GNU General Public License as published by
23 ### the Free Software Foundation; either version 2, or (at your
24 ### option) any later version.
25
26 ### XEmacs is distributed in the hope that it will be useful, but
27 ### WITHOUT ANY WARRANTY; without even the implied warranty of
28 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29 ### General Public License for more details.
30
31 ### You should have received a copy of the GNU General Public License
32 ### along with XEmacs; see the file COPYING.  If not, write to the Free
33 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 ### 02111-1307, USA.
35
36 ### For usage, run `./configure --help'
37 ### For more detailed information on building and installing XEmacs,
38 ### read the file `INSTALL'.
39 ###
40 ### If configure succeeds, it leaves its status in config.status.
41 ### A log of configuration tests can be found in config.log.
42 ### If configure fails after disturbing the status quo,
43 ###     config.status is removed.
44
45 ac_help="$ac_help
46   --with-x                use the X Window System"
47
48
49
50 if test -n "$ZSH_VERSION"; then
51     setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
52   setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
53   setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
54   setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
55       if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
56 elif test -n "$BASH_VERSION"; then
57     set -o posix
58   unset CDPATH
59 else
60   if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
61 fi
62
63 exec_prefix=NONE
64 host=NONE
65 no_create=
66 nonopt=NONE
67 no_recursion=
68 prefix=NONE
69 program_prefix=NONE
70 program_suffix=NONE
71 program_transform_name=s,x,x,
72 silent=
73 site=
74 srcdir=
75 target=NONE
76 verbose=
77 x_includes=NONE
78 x_libraries=NONE
79
80 bindir='${exec_prefix}/bin'
81 sbindir='${exec_prefix}/sbin'
82 libexecdir='${exec_prefix}/libexec'
83 datadir='${prefix}/share'
84 sysconfdir='${prefix}/etc'
85 sharedstatedir='${prefix}/com'
86 localstatedir='${prefix}/var'
87 libdir='${{exec_prefix}}/lib'
88 includedir='${prefix}/include'
89 oldincludedir='/usr/include'
90 infodir='${prefix}/info'
91 mandir='${prefix}/man'
92
93 subdirs=
94 MFLAGS= MAKEFLAGS=
95 ac_max_here_lines=12
96
97 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
98
99 # File descriptor usage:
100 # 0 standard input
101 # 1 file creation
102 # 2 errors and warnings
103 # 3 some systems may open it to /dev/tty
104 # 4 used on the Kubota Titan
105 # 6 checking for... messages and results
106 # 5 compiler messages saved in config.log
107 if test "$silent" = yes; then
108   exec 6>/dev/null
109 else
110   exec 6>&1
111 fi
112 exec 5>./config.log
113
114 echo "\
115 This file contains any messages produced by compilers while
116 running configure, to aid debugging if configure makes a mistake.
117 " 1>&5
118
119 # Strip out --no-create and --no-recursion so they do not pile up.
120 # Also quote any args containing shell metacharacters.
121 ac_configure_args=
122 for ac_arg
123 do
124   case "$ac_arg" in
125   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
126   | --no-cr | --no-c) ;;
127   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
128   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
129   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
130   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
131   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
132   esac
133 done
134
135 # NLS nuisances.
136 # Only set these to C if already set.  These must not be set unconditionally
137 # because not all systems understand e.g. LANG=C (notably SCO).
138 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
139 # Non-C LC_CTYPE values break the ctype check.
140 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
141 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
142 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
143 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
144
145 # confdefs.h avoids OS command line length limits that DEFS can exceed.
146 rm -rf conftest* confdefs.h
147 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
148 echo > confdefs.h
149
150 # A filename unique to this package, relative to the directory that
151 # configure is in, which we can look for to find out if srcdir is correct.
152 ac_unique_file=src/lisp.h
153
154 # Find the source files, if location was not specified.
155 if test -z "$srcdir"; then
156   ac_srcdir_defaulted=yes
157   # Try the directory containing this script, then its parent.
158   ac_prog=$0
159   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
160   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
161   srcdir=$ac_confdir
162   if test ! -r $srcdir/$ac_unique_file; then
163     srcdir=..
164   fi
165 else
166   ac_srcdir_defaulted=no
167 fi
168 if test ! -r $srcdir/$ac_unique_file; then
169   if test "$ac_srcdir_defaulted" = yes; then
170     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
171   else
172     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
173   fi
174 fi
175 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
176
177 # Prefer explicitly selected file to automatically selected ones.
178 if test -z "$CONFIG_SITE"; then
179   if test "x$prefix" != xNONE; then
180     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
181   else
182     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
183   fi
184 fi
185 for ac_site_file in $CONFIG_SITE; do
186   if test -r "$ac_site_file"; then
187     echo "loading site script $ac_site_file"
188     . "$ac_site_file"
189   fi
190 done
191
192
193 ac_ext=c
194 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
195 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
196 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
197 ac_cpp='$CPP '"$xe_cppflags"
198 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
199 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
200 cross_compiling=no
201
202 ac_exeext=
203 ac_objext=o
204 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
205   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
206   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
207     ac_n= ac_c='
208 ' ac_t='        '
209   else
210     ac_n=-n ac_c= ac_t=
211   fi
212 else
213   ac_n= ac_c='\c' ac_t=
214 fi
215
216
217 progname="`echo $0 | sed 's:^\./\./:\./:'`"
218
219
220 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
221 INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
222
223 prefix='/usr/local'
224 exec_prefix='${prefix}'
225 bindir='${exec_prefix}/bin'
226 datadir='${prefix}/lib'
227 statedir='${prefix}/lib'
228 libdir='${exec_prefix}/lib'
229 mandir='${prefix}/man/man1'
230 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_file_coding| \
338         with_canna      | \
339         with_wnn        | \
340         with_wnn6       | \
341         with_workshop   | \
342         with_sparcworks | \
343         with_tooltalk   | \
344         with_ldap       | \
345         with_pop        | \
346         with_kerberos   | \
347         with_hesiod     | \
348         with_dnet       | \
349         with_infodock   | \
350         external_widget | \
351         verbose         | \
352         extra_verbose   | \
353         const_is_losing | \
354         usage_tracking  | \
355         use_union_type  | \
356         debug           | \
357         use_assertions  | \
358         memory_usage_stats | \
359         with_clash_detection | \
360         with_shlib | \
361         no_doc_file )
362                   case "$val" in
363             y | ye | yes )      val=yes ;;
364             n | no )            val=no  ;;
365             * ) (echo "$progname: Usage error:"
366 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
367 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
368           esac
369           eval "$opt=\"$val\"" ;;
370
371
372                         srcdir          | \
373         compiler        | \
374         cflags          | \
375         cpp             | \
376         cppflags        | \
377         libs            | \
378         ldflags         | \
379         cache_file      | \
380         native_sound_lib| \
381         site_lisp       | \
382         x_includes      | \
383         x_libraries     | \
384         site_includes   | \
385         site_libraries  | \
386         site_prefixes   | \
387         site_runtime_libraries )
388                   if test "$valomitted" = "yes" ; then
389                     if test "$#" = 0 ; then
390               (echo "$progname: Usage error:"
391 echo " " "The \`--$optname' option requires a value."
392 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
393             fi
394             val="$1"; shift
395           fi
396           eval "$opt=\"$val\""
397         ;;
398
399                 rel_alloc | \
400         with_dlmalloc | \
401         with_debug_malloc  | use_debug_malloc | \
402         with_system_malloc | use_system_malloc )
403           case "$val" in
404             y | ye | yes )      val=yes ;;
405             n | no )            val=no  ;;
406             d | de | def | defa | defau | defaul | default ) val=default ;;
407             * ) (echo "$progname: Usage error:"
408 echo " " "The \`--$optname' option requires one of these values:
409   \`yes', \`no', or \`default'."
410 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
411           esac
412           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
413           eval "$opt=\"$val\""
414         ;;
415
416                 "with_database" )
417           with_database_berkdb=no
418           with_database_dbm=no
419           with_database_gnudbm=no
420           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
421             case "$x" in
422                 no ) ;;
423                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
424                 d | db | dbm )                          with_database_dbm=yes    ;;
425                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
426                 * ) (echo "$progname: Usage error:"
427 echo " " "The \`--$optname' option value
428   must be either \`no' or a comma-separated list
429   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
430 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
431             esac
432           done
433           if test "$with_database_dbm"    = "yes" -a \
434                   "$with_database_gnudbm" = "yes"; then
435           (echo "$progname: Usage error:"
436 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
437   with the \`--$optname' option."
438 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
439           fi
440         ;;
441
442                 "with_sound" )
443                           case "$val" in
444             y | ye | yes )                      val=native ;;
445             n | no | non | none )               val=no;;
446             na | nat | nati | nativ | native )  val=native  ;;
447             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
448             b | bo | bot | both )               val=both;;
449             * ) (echo "$progname: Usage error:"
450 echo " " "The \`--$optname' option must have one of these values:
451   \`native', \`nas', \`both', or \`none'."
452 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
453           esac
454           eval "$opt=\"$val\""
455         ;;
456
457                 "with_xim" )
458           case "$val" in
459             y | ye | yes )                val=yes   ;;
460             n | no | non | none )         val=no    ;;
461             x | xl | xli | xlib )         val=xlib  ;;
462             m | mo | mot | moti | motif ) val=motif ;;
463             * ) (echo "$progname: Usage error:"
464 echo " " "The \`--$optname' option must have one of these values:
465   \`motif', \`xlib', \`yes', or \`no'."
466 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
467           esac
468           eval "$opt=\"$val\""
469         ;;
470
471                 "mail_locking" )
472           case "$val" in
473             lockf )     val=lockf ;;
474             flock )     val=flock ;;
475             file )      val=file  ;;
476             * ) (echo "$progname: Usage error:"
477 echo " " "The \`--$optname' option must have one of these values:
478   \`lockf', \`flock', or \`file'."
479 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
480           esac
481           eval "$opt=\"$val\""
482         ;;
483
484                 "error_checking" )
485                           
486           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
487             case "$x" in
488                       n | no | non | none ) new_default=no ;;
489               a | al | all )        new_default=yes ;;
490
491               extents )       error_check_extents=yes ;;
492               noextents )     error_check_extents=no ;;
493
494               typecheck )     error_check_typecheck=yes ;;
495               notypecheck )   error_check_typecheck=no ;;
496
497               bufpos )        error_check_bufpos=yes ;;
498               nobufpos )      error_check_bufpos=no ;;
499
500               gc )            error_check_gc=yes ;;
501               nogc )          error_check_gc=no ;;
502
503               malloc )        error_check_malloc=yes ;;
504               nomalloc )      error_check_malloc=no ;;
505
506               byte_code )     error_check_byte_code=yes ;;
507               nobyte_code )   error_check_byte_code=no ;;
508
509               * ) bogus_error_check=yes ;;
510             esac
511             if test "$bogus_error_check" -o \
512                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
513                 if test "$error_check_default" = yes ; then
514                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
515                 else
516                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
517                 fi
518                 (echo "$progname: Usage error:"
519 echo " " "Valid types for the \`--$optname' option are:
520   $types."
521 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
522             elif test -n "$new_default" ; then
523                 error_check_extents=$new_default
524                 error_check_typecheck=$new_default
525                 error_check_bufpos=$new_default
526                 error_check_gc=$new_default
527                 error_check_malloc=$new_default
528                 error_check_byte_code=$new_default
529                 new_default=    # reset this
530             fi
531             echeck_notfirst=true
532           done
533         ;;
534
535                                 
536                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
537         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
538         archlibdir | docdir | package_path )
539                    if test "$valomitted" = "yes"; then
540              if test "$#" = 0; then
541                  (echo "$progname: Usage error:"
542 echo " " "The \`--$optname' option requires a value."
543 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
544              fi
545              val="$1"; shift
546            fi
547            eval "$opt=\"$val\""
548
549                            case "$opt" in
550              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
551     Defining LISPDIR_USER_DEFINED
552 EOF
553 cat >> confdefs.h <<\EOF
554 #define LISPDIR_USER_DEFINED 1
555 EOF
556 }
557  ;;
558              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
559     Defining SITELISPDIR_USER_DEFINED
560 EOF
561 cat >> confdefs.h <<\EOF
562 #define SITELISPDIR_USER_DEFINED 1
563 EOF
564 }
565  ;;
566              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
567     Defining MODULEDIR_USER_DEFINED
568 EOF
569 cat >> confdefs.h <<\EOF
570 #define MODULEDIR_USER_DEFINED 1
571 EOF
572 }
573  ;;
574              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
575     Defining ETCDIR_USER_DEFINED
576 EOF
577 cat >> confdefs.h <<\EOF
578 #define ETCDIR_USER_DEFINED 1
579 EOF
580 }
581  ;;
582              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
583     Defining INFODIR_USER_DEFINED
584 EOF
585 cat >> confdefs.h <<\EOF
586 #define INFODIR_USER_DEFINED 1
587 EOF
588 }
589  ;;
590              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
591     Defining INFOPATH_USER_DEFINED
592 EOF
593 cat >> confdefs.h <<\EOF
594 #define INFOPATH_USER_DEFINED 1
595 EOF
596 }
597  ;;
598              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
599     Defining PACKAGE_PATH_USER_DEFINED
600 EOF
601 cat >> confdefs.h <<\EOF
602 #define PACKAGE_PATH_USER_DEFINED 1
603 EOF
604 }
605  ;;
606              datadir )
607                 { test "$extra_verbose" = "yes" && cat << \EOF
608     Defining INFODIR_USER_DEFINED
609 EOF
610 cat >> confdefs.h <<\EOF
611 #define INFODIR_USER_DEFINED 1
612 EOF
613 }
614
615                 { test "$extra_verbose" = "yes" && cat << \EOF
616     Defining LISPDIR_USER_DEFINED
617 EOF
618 cat >> confdefs.h <<\EOF
619 #define LISPDIR_USER_DEFINED 1
620 EOF
621 }
622
623             { test "$extra_verbose" = "yes" && cat << \EOF
624     Defining MODULEDIR_USER_DEFINED
625 EOF
626 cat >> confdefs.h <<\EOF
627 #define MODULEDIR_USER_DEFINED 1
628 EOF
629 }
630
631                 { test "$extra_verbose" = "yes" && cat << \EOF
632     Defining ETCDIR_USER_DEFINED
633 EOF
634 cat >> confdefs.h <<\EOF
635 #define ETCDIR_USER_DEFINED 1
636 EOF
637 }
638  ;;
639              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
640     Defining LOCKDIR_USER_DEFINED
641 EOF
642 cat >> confdefs.h <<\EOF
643 #define LOCKDIR_USER_DEFINED 1
644 EOF
645 }
646  ;;
647              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
648     Defining ARCHLIBDIR_USER_DEFINED
649 EOF
650 cat >> confdefs.h <<\EOF
651 #define ARCHLIBDIR_USER_DEFINED 1
652 EOF
653 }
654  ;;
655            esac
656         ;;
657
658                 "no_create" ) ;;
659
660                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
661
662                 "with_menubars"   | \
663         "with_scrollbars" | \
664         "with_dialogs" )
665           case "$val" in
666             l | lu | luc | luci | lucid )               val=lucid  ;;
667             m | mo | mot | moti | motif )               val=motif  ;;
668             athena3d | athena-3d )                      val=athena3d ;;
669             a | at | ath | athe | athen | athena )      val=athena ;;
670             n | no | non | none )                       val=no ;;
671             * ) (echo "$progname: Usage error:"
672 echo " " "The \`--$optname' option must have one of these values:
673   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
674 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
675           esac
676           eval "$opt=\"$val\""
677         ;;
678
679                 "run_in_place"  | \
680         "with_gnu_make" )
681           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
682         ;;
683
684                 * ) (echo "$progname: Usage error:"
685 echo " " "Unrecognized option: $arg"
686 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
687
688       esac
689     ;;
690
691         *-*-*) configuration="$arg" ;;
692
693         *) (echo "$progname: Usage error:"
694 echo " " "Unrecognized argument: $arg"
695 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
696
697   esac
698 done
699
700
701 test -n "$cpp"      && CPP="$cpp"
702 test -n "$cppflags" && CPPFLAGS="$cppflags"
703 test -n "$libs"     && LIBS="$libs"
704 test -n "$ldflags"  && LDFLAGS="$ldflags"
705
706 eval set x "$quoted_arguments"; shift
707
708 test "$extra_verbose" = "yes" && verbose=yes
709
710 test -n "$with_x" && with_x11="$with_x"
711
712 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
713   test "$with_system_malloc" = "default" && with_system_malloc=yes
714 fi
715
716
717
718 if test "$with_cde $with_tooltalk" = "yes no"; then
719   (echo "$progname: Usage error:"
720 echo " " "--with-cde requires --with-tooltalk"
721 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
722 elif test "$with_tooltalk" = "no" ; then with_cde=no
723 elif test "$with_cde" = "yes"; then with_tooltalk=yes
724 fi
725
726
727 case "$srcdir" in
728
729     "" )
730     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
731       if test -f "$dir/src/lisp.h" -a \
732               -f "$dir/lisp/version.el" ; then
733         srcdir="$dir"
734         break
735       fi
736     done
737     if test -z "$srcdir" ; then
738       (echo "$progname: Usage error:"
739 echo " " "Neither the current directory nor its parent seem to
740   contain the XEmacs sources.  If you do not want to build XEmacs in its
741   source tree, you should run \`$progname' in the directory in which
742   you wish to build XEmacs, using the \`--srcdir' option to say where the
743   sources may be found."
744 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
745     fi
746   ;;
747
748     * )
749     if test ! -f "$srcdir/src/lisp.h" -o \
750             ! -f "$srcdir/lisp/version.el" ; then
751       (echo "$progname: Usage error:"
752 echo " " "The directory specified with the \`--srcdir' option,
753   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
754   either run the \`$progname' script at the top of the XEmacs source
755   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
756 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
757     fi
758   ;;
759 esac
760
761 if test -z "$configuration"; then
762     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
763   if test -z "$configuration"; then
764     (echo "$progname: Usage error:"
765 echo " " "XEmacs has not been ported to this host type.
766 Try explicitly specifying the CONFIGURATION when rerunning configure."
767 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
768   fi
769 fi
770
771 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
772 echo "configure:773: checking whether ln -s works" >&5
773
774 rm -f conftestdata
775 if ln -s X conftestdata 2>/dev/null
776 then
777   rm -f conftestdata
778   ac_cv_prog_LN_S="ln -s"
779 else
780   ac_cv_prog_LN_S=ln
781 fi
782 LN_S="$ac_cv_prog_LN_S"
783 if test "$ac_cv_prog_LN_S" = "ln -s"; then
784   echo "$ac_t""yes" 1>&6
785 else
786   echo "$ac_t""no" 1>&6
787 fi
788
789
790 for dir in lisp etc man info; do
791   if test ! -d "$dir" ; then
792     echo Making symbolic link to "$srcdir/$dir"
793     ${LN_S} "$srcdir/$dir" "$dir"
794   fi
795 done
796
797
798 absolute_pwd="`pwd`";
799 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
800 then blddir="$PWD"
801 else blddir="$absolute_pwd"; if test -d "/net"; then
802   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
803   blddir=`echo "$blddir" | \
804    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
805 fi
806 fi
807
808
809 case "$srcdir" in
810   /* ) ;;
811   .  ) srcdir="$blddir" ;;
812   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
813   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
814   srcdir=`echo "$srcdir" | \
815    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
816 fi ;;
817 esac
818
819 if test `pwd` != `sh -c cd $srcdir && pwd`  \
820    && test -f "$srcdir/src/config.h"; then
821   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
822    echo "   as a build directory right now; it has been configured in its own"
823    echo "   right.  To configure in another directory as well, you MUST"
824    echo "   use GNU make.  If you do not have GNU make, then you must"
825    echo "   now do \`make distclean' in $srcdir,"
826    echo "   and then run $progname again.") >&2
827   extrasub='/^VPATH[     ]*=/c\
828 vpath %.c $(srcdir)\
829 vpath %.h $(srcdir)\
830 vpath %.y $(srcdir)\
831 vpath %.l $(srcdir)\
832 vpath %.s $(srcdir)\
833 vpath %.in $(srcdir)'
834 fi
835
836 . "$srcdir/version.sh" || exit 1;
837 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
838 : "${extra_verbose=$beta}"
839 version="${emacs_major_version}.${emacs_minor_version}"
840 { test "$extra_verbose" = "yes" && cat << EOF
841     Defining EMACS_MAJOR_VERSION = $emacs_major_version
842 EOF
843 cat >> confdefs.h <<EOF
844 #define EMACS_MAJOR_VERSION $emacs_major_version
845 EOF
846 }
847
848 { test "$extra_verbose" = "yes" && cat << EOF
849     Defining EMACS_MINOR_VERSION = $emacs_minor_version
850 EOF
851 cat >> confdefs.h <<EOF
852 #define EMACS_MINOR_VERSION $emacs_minor_version
853 EOF
854 }
855
856 if test -n "$emacs_beta_version" ; then
857   if test "$beta" = "yes"; then
858         version="${version}-b${emacs_beta_version}"
859         { test "$extra_verbose" = "yes" && cat << EOF
860     Defining EMACS_BETA_VERSION = $emacs_beta_version
861 EOF
862 cat >> confdefs.h <<EOF
863 #define EMACS_BETA_VERSION $emacs_beta_version
864 EOF
865 }
866
867   else
868         version="${version}.${emacs_beta_version}"
869         { test "$extra_verbose" = "yes" && cat << EOF
870     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
871 EOF
872 cat >> confdefs.h <<EOF
873 #define EMACS_PATCH_LEVEL $emacs_beta_version
874 EOF
875 }
876
877   fi
878 fi
879 { test "$extra_verbose" = "yes" && cat << EOF
880     Defining XEMACS_CODENAME = "$xemacs_codename"
881 EOF
882 cat >> confdefs.h <<EOF
883 #define XEMACS_CODENAME "$xemacs_codename"
884 EOF
885 }
886
887 { test "$extra_verbose" = "yes" && cat << EOF
888     Defining EMACS_VERSION = "$version"
889 EOF
890 cat >> confdefs.h <<EOF
891 #define EMACS_VERSION "$version"
892 EOF
893 }
894
895
896 if test "$with_infodock" = "yes"; then
897   if test ! -f ../ID-INSTALL; then
898     echo "Cannot build InfoDock without InfoDock sources"
899     with_infodock=no
900   fi
901 fi
902
903 if test "$with_infodock" = "yes"; then
904       { test "$extra_verbose" = "yes" && cat << EOF
905     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
906 EOF
907 cat >> confdefs.h <<EOF
908 #define INFODOCK_MAJOR_VERSION $infodock_major_version
909 EOF
910 }
911
912   { test "$extra_verbose" = "yes" && cat << EOF
913     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
914 EOF
915 cat >> confdefs.h <<EOF
916 #define INFODOCK_MINOR_VERSION $infodock_minor_version
917 EOF
918 }
919
920   { test "$extra_verbose" = "yes" && cat << EOF
921     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
922 EOF
923 cat >> confdefs.h <<EOF
924 #define INFODOCK_BUILD_VERSION $infodock_build_version
925 EOF
926 }
927
928   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
929   PROGNAME=infodock
930   CPPFLAGS="$CPPFLAGS -DINFODOCK"
931 else
932   PROGNAME=xemacs
933 fi
934
935 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
936 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
937     Defining ERROR_CHECK_EXTENTS
938 EOF
939 cat >> confdefs.h <<\EOF
940 #define ERROR_CHECK_EXTENTS 1
941 EOF
942 }
943
944 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
945     Defining ERROR_CHECK_TYPECHECK
946 EOF
947 cat >> confdefs.h <<\EOF
948 #define ERROR_CHECK_TYPECHECK 1
949 EOF
950 }
951
952 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
953     Defining ERROR_CHECK_BUFPOS
954 EOF
955 cat >> confdefs.h <<\EOF
956 #define ERROR_CHECK_BUFPOS 1
957 EOF
958 }
959
960 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
961     Defining ERROR_CHECK_GC
962 EOF
963 cat >> confdefs.h <<\EOF
964 #define ERROR_CHECK_GC 1
965 EOF
966 }
967
968 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
969     Defining ERROR_CHECK_MALLOC
970 EOF
971 cat >> confdefs.h <<\EOF
972 #define ERROR_CHECK_MALLOC 1
973 EOF
974 }
975
976 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
977     Defining ERROR_CHECK_BYTE_CODE
978 EOF
979 cat >> confdefs.h <<\EOF
980 #define ERROR_CHECK_BYTE_CODE 1
981 EOF
982 }
983
984 if test "${debug:=$beta}" = "yes"; then
985   use_assertions=yes memory_usage_stats=yes
986   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
987    echo "    xemacs will be linked with \"debug.o\""
988  fi
989   { test "$extra_verbose" = "yes" && cat << \EOF
990     Defining DEBUG_XEMACS
991 EOF
992 cat >> confdefs.h <<\EOF
993 #define DEBUG_XEMACS 1
994 EOF
995 }
996
997 fi
998 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
999     Defining USE_ASSERTIONS
1000 EOF
1001 cat >> confdefs.h <<\EOF
1002 #define USE_ASSERTIONS 1
1003 EOF
1004 }
1005
1006 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1007     Defining MEMORY_USAGE_STATS
1008 EOF
1009 cat >> confdefs.h <<\EOF
1010 #define MEMORY_USAGE_STATS 1
1011 EOF
1012 }
1013
1014
1015
1016 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1017 echo "configure:1018: checking "host system type"" >&5
1018 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1019 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1020 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1021 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1022 echo "$ac_t""$configuration" 1>&6
1023
1024
1025
1026
1027
1028 machine='' opsys=''
1029
1030 case "$canonical" in
1031   sparc-*-*        ) machine=sparc ;;
1032   alpha*-*-*       ) machine=alpha ;;
1033   vax-*-*          ) machine=vax ;;
1034   mips-dec-*       ) machine=pmax ;;
1035   mips-sgi-*       ) machine=iris4d ;;
1036   romp-ibm-*       ) machine=ibmrt ;;
1037   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1038   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1039   powerpc*-*       ) machine=powerpc ;;
1040   hppa-*-*         ) machine=hp800 ;;
1041   m88k-dg-*        ) machine=aviion ;;
1042   m68*-sony-*      ) machine=news ;;
1043   mips-sony-*      ) machine=news-risc ;;
1044   clipper-*        ) machine=clipper ;;
1045   arm-*            ) machine=arm ;;
1046   ns32k-*          ) machine=ns32000 ;;
1047 esac
1048
1049 case "$canonical" in
1050   *-*-linux*    ) opsys=linux ;;
1051   *-*-netbsd*   ) opsys=netbsd ;;
1052   *-*-openbsd*  ) opsys=openbsd ;;
1053   *-*-nextstep* ) opsys=nextstep ;;
1054   *-*-vms       ) opsys=vms ;;
1055
1056     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1057   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1058   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1059   *-dec-osf3*                ) opsys=decosf3-1 ;;
1060   *-dec-osf4*                ) opsys=decosf4-0 ;;
1061
1062     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1063   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1064   *-*-ultrix* )         opsys=ultrix4-3 ;;
1065
1066     *-*-aix3.1*  ) opsys=aix3-1 ;;
1067   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1068   *-*-aix3*    ) opsys=aix3-2   ;;
1069   *-*-aix4.0*  ) opsys=aix4     ;;
1070   *-*-aix4.1*  ) opsys=aix4-1   ;;
1071   *-*-aix4*    ) opsys=aix4-2   ;;
1072
1073     *-gnu* )                    opsys=gnu    ;;
1074   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1075   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1076   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1077   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1078   *-*-aos*   )                  opsys=bsd4-3 ;;
1079   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1080   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1081   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1082   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1083   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1084   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1085         if test -z "$NON_GNU_CPP" ; then
1086           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1087             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1088           done
1089         fi
1090         opsys=usg5-4-2 ;;
1091     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1092     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1093 esac
1094
1095 case "$canonical" in
1096
1097     *-*-netbsd* )
1098     case "$canonical" in
1099       i[3-9]86-*-netbsd*) machine=intel386 ;;
1100       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1101                                             machine=hp9000s300 ;;
1102       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1103       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1104     esac
1105   ;;
1106
1107     *-*-openbsd* )
1108     case "${canonical}" in
1109       i386-*-openbsd*)          machine=intel386 ;;
1110       m68k-*-openbsd*)          machine=hp9000s300 ;;
1111       mipsel-*-openbsd*)        machine=pmax ;;
1112      esac
1113    ;;
1114
1115     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1116   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1117
1118     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1119   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1120
1121     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1122
1123     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1124
1125     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1126
1127     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1128
1129     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1130
1131     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1132   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1133   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1134
1135   
1136     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1137
1138     *-convex-bsd* | *-convex-convexos* )
1139     machine=convex opsys=bsd4-3
1140     NON_GNU_CPP="cc -E -P"
1141   ;;
1142
1143     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1144
1145     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1146   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1147   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1148   m88k-dg-dgux*                           ) opsys=dgux     ;;
1149
1150     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1151   m88k-motorola-sysv4* )
1152                     machine=delta88k opsys=usg5-4-2
1153   ;;
1154   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1155
1156     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1157   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1158
1159     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1160
1161     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1162   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1163   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1164
1165       m88k-harris-cxux* )
1166         case "`uname -r`" in
1167        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1168        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1169     esac
1170     NON_GNU_CPP="/lib/cpp"
1171   ;;
1172     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1173     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1174
1175     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1176
1177     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1178
1179     *-hp-hpux* )
1180         case "$canonical" in
1181       m68*  ) machine=hp9000s300 ;;
1182       hppa* ) machine=hp800      ;;
1183     esac
1184
1185     case "$canonical" in
1186       *-hp-hpux7*  )  opsys=hpux   ;;
1187       *-hp-hpux8*  )  opsys=hpux8  ;;
1188       *-hp-hpux9*  )  opsys=hpux9  ;;
1189       *-hp-hpux10* )  opsys=hpux10 ;;
1190       *-hp-hpux11* )  opsys=hpux11 ;;
1191       *            )  opsys=hpux   ;;
1192     esac
1193
1194         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1195    echo "    xemacs will be linked with \"strcat.o\""
1196  fi ;; esac
1197
1198     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1199         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1200     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1201
1202     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1203   ;;
1204
1205     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1206   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1207
1208     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1209   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1210   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1211   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1212   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1213   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1214
1215     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1216   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1217
1218     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1219
1220     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1221
1222     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1223
1224     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1225
1226       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1227
1228     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1229
1230     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1231
1232     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1233
1234     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1235
1236         mips-mips-usg* ) machine=mips4 ;;
1237   mips-mips-riscos4 )
1238     machine=mips4
1239     NON_GNU_CC="cc -systype bsd43"
1240     NON_GNU_CPP="cc -systype bsd43 -E"
1241     case "$canonical" in
1242       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1243       mips-mips-riscos5* ) opsys=riscos5 ;;
1244     esac
1245   ;;
1246   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1247   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1248
1249     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1250
1251     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1252
1253     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1254   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1255
1256     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1257
1258     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1259
1260     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1261
1262     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1263
1264     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1265   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1266
1267     mips-siemens-sysv* | mips-sni-sysv*)
1268     machine=mips-siemens opsys=usg5-4
1269     NON_GNU_CC=/usr/ccs/bin/cc
1270     NON_GNU_CPP=/usr/ccs/lib/cpp
1271   ;;
1272
1273     mips-nec-sysv*)
1274     machine=mips-nec
1275     NON_GNU_CC=/usr/ccs/bin/cc
1276     NON_GNU_CPP=/usr/ccs/lib/cpp
1277   ;;
1278
1279       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1280   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1281     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1282   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1283   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1284   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1285   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1286   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1287   mips-sgi-irix*      ) opsys=irix5-0 ;;
1288
1289     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1290   *-sony-news* ) opsys=newsos5 ;;
1291
1292     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1293
1294     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1295         case "$canonical" in
1296       m68*-sunos1* )             machine=sun1     ;;
1297       m68*-sunos2* )             machine=sun2     ;;
1298       m68* )                     machine=sun3     ;;
1299       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1300       i*86-*-* )                 machine=intel386 ;;
1301       rs6000* )                  machine=rs6000   ;;
1302     esac
1303
1304         case "$canonical" in *-sunos5*)
1305       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1306     esac
1307
1308                     case "$canonical" in
1309       *-sunos4* )
1310         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1311         : ;;
1312       *-solaris2* )
1313         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1314         RANLIB=':' ;;
1315     esac
1316
1317     case "$canonical" in
1318       *-solaris*          )
1319         opsys=sol2
1320         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1321         { test "$extra_verbose" = "yes" && cat << EOF
1322     Defining OS_RELEASE = $os_release
1323 EOF
1324 cat >> confdefs.h <<EOF
1325 #define OS_RELEASE $os_release
1326 EOF
1327 }
1328  ;;
1329
1330             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1331       *-sunos4.0*         ) opsys=sunos4-0      ;;
1332       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1333       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1334       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1335       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1336       *-mach*             ) opsys=mach-bsd4-3   ;;
1337       *                   ) opsys=bsd4-2        ;;
1338     esac
1339
1340     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1341
1342         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1343   ;;
1344
1345     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1346
1347     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1348   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1349
1350     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1351
1352     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1353
1354     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1355       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1356
1357     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1358
1359     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1360
1361     vax-dec-* )
1362     case "$canonical" in
1363       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1364       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1365       *-mach* )                         opsys=mach-bsd4-3 ;;
1366     esac
1367   ;;
1368
1369     ns16k-whitechapel-* ) machine=mg1 ;;
1370
1371     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1372
1373     i[3-9]86-*-* )
1374     machine=intel386
1375     case "$canonical" in
1376       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1377       *-isc2.2* )               opsys=isc2-2 ;;
1378       *-isc4.0* )               opsys=isc4-0 ;;
1379       *-isc4.* )                opsys=isc4-1
1380                                 GCC_TEST_OPTIONS=-posix
1381                                 NON_GCC_TEST_OPTIONS=-Xp
1382                                 ;;
1383       *-isc* )                  opsys=isc3-0 ;;
1384       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1385       *-esix* )                 opsys=esix ;;
1386       *-mach* )                 opsys=mach-bsd4-3 ;;
1387       *-xenix* )                opsys=xenix ;;
1388       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1389       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1390       *-bsdi4* )                opsys=bsdos4 ;;
1391       *-bsdi3* )                opsys=bsdos3 ;;
1392       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1393       *-bsdi2* )                opsys=bsdos2 ;;
1394       *-sco3.2v5* )             opsys=sco5 ;
1395                                                         if test "$dynamic" = "yes" ; then
1396                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1397         else
1398                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1399         fi ;;
1400       *-386bsd* )               opsys=386bsd ;;
1401       *-freebsd* )              opsys=freebsd ;;
1402       *-nextstep* )             opsys=nextstep ;;
1403       *-pc-cygwin* )            opsys=cygwin32 ;;
1404       *-pc-mingw* )             opsys=mingw32 ;
1405                                 test -z "$with_tty" && with_tty="no";;
1406           esac
1407   ;;
1408
1409     m68k-*-linux* ) machine=m68k opsys=linux ;;
1410
1411 esac
1412
1413 if test -z "$machine" -o -z "$opsys"; then
1414   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1415    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1416   ) >&2
1417   exit 1
1418 fi
1419
1420 if test -z "$dynamic"; then
1421   case "$opsys" in
1422     hpux* | sunos4* ) dynamic=no ;;
1423     *) dynamic=yes ;;
1424   esac
1425 fi
1426 if test "$dynamic" = "yes"; then
1427   case "$opsys" in
1428     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1429     decosf* ) ld_call_shared="-call_shared" ;;
1430   esac
1431 else   case "$opsys" in
1432     sol2 )
1433       echo "Static linking is not supported on Solaris 2."
1434       echo "Rerun configure without specifying --dynamic=no."
1435       exit 1 ;;
1436     linux   ) ld_call_shared="-Bstatic" ;;
1437     decosf* ) ld_call_shared="-non_shared" ;;
1438   esac
1439 fi
1440
1441 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1442
1443 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1444 { test "$extra_verbose" = "yes" && cat << EOF
1445     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1446 EOF
1447 cat >> confdefs.h <<EOF
1448 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1449 EOF
1450 }
1451
1452
1453 machfile="m/${machine}.h"
1454 opsysfile="s/${opsys}.h"
1455
1456
1457 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1458 if test "$with_workshop $with_tooltalk" = "yes no"; then
1459   (echo "$progname: Usage error:"
1460 echo " " "--with-workshop requires --with-tooltalk"
1461 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1462 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1463 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1464 fi
1465
1466 if test "$with_workshop" = "yes"; then
1467   { test "$extra_verbose" = "yes" && cat << \EOF
1468     Defining SUNPRO
1469 EOF
1470 cat >> confdefs.h <<\EOF
1471 #define SUNPRO 1
1472 EOF
1473 }
1474
1475   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1476    echo "    xemacs will be linked with \"sunpro.o\""
1477  fi
1478 fi
1479
1480 if test "$with_clash_detection" = "yes"; then
1481   { test "$extra_verbose" = "yes" && cat << \EOF
1482     Defining CLASH_DETECTION
1483 EOF
1484 cat >> confdefs.h <<\EOF
1485 #define CLASH_DETECTION 1
1486 EOF
1487 }
1488
1489   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1490    echo "    xemacs will be linked with \"filelock.o\""
1491  fi
1492 fi
1493
1494 test -n "$compiler" && CC="$compiler"
1495 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1496 fi
1497
1498 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1499 if test "${CFLAGS-unset}" != unset
1500   then cflags_specified=yes;
1501   else cflags_specified=no;
1502 fi
1503
1504 xe_save_CFLAGS="$CFLAGS"
1505
1506 # Extract the first word of "gcc", so it can be a program name with args.
1507 set dummy gcc; ac_word=$2
1508 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1509 echo "configure:1510: checking for $ac_word" >&5
1510
1511 if test -n "$CC"; then
1512   ac_cv_prog_CC="$CC" # Let the user override the test.
1513 else
1514   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1515   ac_dummy="$PATH"
1516   for ac_dir in $ac_dummy; do
1517     test -z "$ac_dir" && ac_dir=.
1518     if test -f $ac_dir/$ac_word; then
1519       ac_cv_prog_CC="gcc"
1520       break
1521     fi
1522   done
1523   IFS="$ac_save_ifs"
1524 fi
1525 CC="$ac_cv_prog_CC"
1526 if test -n "$CC"; then
1527   echo "$ac_t""$CC" 1>&6
1528 else
1529   echo "$ac_t""no" 1>&6
1530 fi
1531
1532 if test -z "$CC"; then
1533   # Extract the first word of "cc", so it can be a program name with args.
1534 set dummy cc; ac_word=$2
1535 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1536 echo "configure:1537: checking for $ac_word" >&5
1537
1538 if test -n "$CC"; then
1539   ac_cv_prog_CC="$CC" # Let the user override the test.
1540 else
1541   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1542   ac_prog_rejected=no
1543   ac_dummy="$PATH"
1544   for ac_dir in $ac_dummy; do
1545     test -z "$ac_dir" && ac_dir=.
1546     if test -f $ac_dir/$ac_word; then
1547       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1548         ac_prog_rejected=yes
1549         continue
1550       fi
1551       ac_cv_prog_CC="cc"
1552       break
1553     fi
1554   done
1555   IFS="$ac_save_ifs"
1556 if test $ac_prog_rejected = yes; then
1557   # We found a bogon in the path, so make sure we never use it.
1558   set dummy $ac_cv_prog_CC
1559   shift
1560   if test $# -gt 0; then
1561     # We chose a different compiler from the bogus one.
1562     # However, it has the same basename, so the bogon will be chosen
1563     # first if we set CC to just the basename; use the full file name.
1564     shift
1565     set dummy "$ac_dir/$ac_word" "$@"
1566     shift
1567     ac_cv_prog_CC="$@"
1568   fi
1569 fi
1570 fi
1571 CC="$ac_cv_prog_CC"
1572 if test -n "$CC"; then
1573   echo "$ac_t""$CC" 1>&6
1574 else
1575   echo "$ac_t""no" 1>&6
1576 fi
1577
1578   if test -z "$CC"; then
1579     case "`uname -s`" in
1580     *win32* | *WIN32*)
1581       # Extract the first word of "cl", so it can be a program name with args.
1582 set dummy cl; ac_word=$2
1583 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1584 echo "configure:1585: checking for $ac_word" >&5
1585
1586 if test -n "$CC"; then
1587   ac_cv_prog_CC="$CC" # Let the user override the test.
1588 else
1589   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1590   ac_dummy="$PATH"
1591   for ac_dir in $ac_dummy; do
1592     test -z "$ac_dir" && ac_dir=.
1593     if test -f $ac_dir/$ac_word; then
1594       ac_cv_prog_CC="cl"
1595       break
1596     fi
1597   done
1598   IFS="$ac_save_ifs"
1599 fi
1600 CC="$ac_cv_prog_CC"
1601 if test -n "$CC"; then
1602   echo "$ac_t""$CC" 1>&6
1603 else
1604   echo "$ac_t""no" 1>&6
1605 fi
1606  ;;
1607     esac
1608   fi
1609   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1610 fi
1611
1612 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1613 echo "configure:1614: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1614
1615 ac_ext=c
1616 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1617 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1618 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1619 ac_cpp='$CPP '"$xe_cppflags"
1620 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1621 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1622 cross_compiling=no
1623
1624 cat > conftest.$ac_ext << EOF
1625
1626 #line 1627 "configure"
1627 #include "confdefs.h"
1628
1629 main(){return(0);}
1630 EOF
1631 if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1632   ac_cv_prog_cc_works=yes
1633   # If we can't run a trivial program, we are probably using a cross compiler.
1634   if (./conftest; exit) 2>/dev/null; then
1635     ac_cv_prog_cc_cross=no
1636   else
1637     ac_cv_prog_cc_cross=yes
1638   fi
1639 else
1640   echo "configure: failed program was:" >&5
1641   cat conftest.$ac_ext >&5
1642   ac_cv_prog_cc_works=no
1643 fi
1644 rm -fr conftest*
1645 ac_ext=c
1646 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1647 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1648 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1649 ac_cpp='$CPP '"$xe_cppflags"
1650 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1651 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1652 cross_compiling=no
1653
1654 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1655 if test $ac_cv_prog_cc_works = no; then
1656   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1657 fi
1658 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1659 echo "configure:1660: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1660 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1661 cross_compiling=$ac_cv_prog_cc_cross
1662
1663 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1664 echo "configure:1665: checking whether we are using GNU C" >&5
1665
1666 cat > conftest.c <<EOF
1667 #ifdef __GNUC__
1668   yes;
1669 #endif
1670 EOF
1671 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1672   ac_cv_prog_gcc=yes
1673 else
1674   ac_cv_prog_gcc=no
1675 fi
1676
1677 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1678
1679 if test $ac_cv_prog_gcc = yes; then
1680   GCC=yes
1681 else
1682   GCC=
1683 fi
1684
1685 ac_test_CFLAGS="${CFLAGS+set}"
1686 ac_save_CFLAGS="$CFLAGS"
1687 CFLAGS=
1688 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1689 echo "configure:1690: checking whether ${CC-cc} accepts -g" >&5
1690
1691 echo 'void f(){}' > conftest.c
1692 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1693   ac_cv_prog_cc_g=yes
1694 else
1695   ac_cv_prog_cc_g=no
1696 fi
1697 rm -f conftest*
1698
1699
1700 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1701 if test "$ac_test_CFLAGS" = set; then
1702   CFLAGS="$ac_save_CFLAGS"
1703 elif test $ac_cv_prog_cc_g = yes; then
1704   if test "$GCC" = yes; then
1705     CFLAGS="-g -O2"
1706   else
1707     CFLAGS="-g"
1708   fi
1709 else
1710   if test "$GCC" = yes; then
1711     CFLAGS="-O2"
1712   else
1713     CFLAGS=
1714   fi
1715 fi
1716  
1717 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1718   CC=${NON_GNU_CC-cc}
1719   # Extract the first word of "gcc", so it can be a program name with args.
1720 set dummy gcc; ac_word=$2
1721 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1722 echo "configure:1723: checking for $ac_word" >&5
1723
1724 if test -n "$CC"; then
1725   ac_cv_prog_CC="$CC" # Let the user override the test.
1726 else
1727   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1728   ac_dummy="$PATH"
1729   for ac_dir in $ac_dummy; do
1730     test -z "$ac_dir" && ac_dir=.
1731     if test -f $ac_dir/$ac_word; then
1732       ac_cv_prog_CC="gcc"
1733       break
1734     fi
1735   done
1736   IFS="$ac_save_ifs"
1737 fi
1738 CC="$ac_cv_prog_CC"
1739 if test -n "$CC"; then
1740   echo "$ac_t""$CC" 1>&6
1741 else
1742   echo "$ac_t""no" 1>&6
1743 fi
1744
1745 if test -z "$CC"; then
1746   # Extract the first word of "cc", so it can be a program name with args.
1747 set dummy cc; ac_word=$2
1748 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1749 echo "configure:1750: checking for $ac_word" >&5
1750
1751 if test -n "$CC"; then
1752   ac_cv_prog_CC="$CC" # Let the user override the test.
1753 else
1754   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1755   ac_prog_rejected=no
1756   ac_dummy="$PATH"
1757   for ac_dir in $ac_dummy; do
1758     test -z "$ac_dir" && ac_dir=.
1759     if test -f $ac_dir/$ac_word; then
1760       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1761         ac_prog_rejected=yes
1762         continue
1763       fi
1764       ac_cv_prog_CC="cc"
1765       break
1766     fi
1767   done
1768   IFS="$ac_save_ifs"
1769 if test $ac_prog_rejected = yes; then
1770   # We found a bogon in the path, so make sure we never use it.
1771   set dummy $ac_cv_prog_CC
1772   shift
1773   if test $# -gt 0; then
1774     # We chose a different compiler from the bogus one.
1775     # However, it has the same basename, so the bogon will be chosen
1776     # first if we set CC to just the basename; use the full file name.
1777     shift
1778     set dummy "$ac_dir/$ac_word" "$@"
1779     shift
1780     ac_cv_prog_CC="$@"
1781   fi
1782 fi
1783 fi
1784 CC="$ac_cv_prog_CC"
1785 if test -n "$CC"; then
1786   echo "$ac_t""$CC" 1>&6
1787 else
1788   echo "$ac_t""no" 1>&6
1789 fi
1790
1791   if test -z "$CC"; then
1792     case "`uname -s`" in
1793     *win32* | *WIN32*)
1794       # Extract the first word of "cl", so it can be a program name with args.
1795 set dummy cl; ac_word=$2
1796 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1797 echo "configure:1798: checking for $ac_word" >&5
1798
1799 if test -n "$CC"; then
1800   ac_cv_prog_CC="$CC" # Let the user override the test.
1801 else
1802   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1803   ac_dummy="$PATH"
1804   for ac_dir in $ac_dummy; do
1805     test -z "$ac_dir" && ac_dir=.
1806     if test -f $ac_dir/$ac_word; then
1807       ac_cv_prog_CC="cl"
1808       break
1809     fi
1810   done
1811   IFS="$ac_save_ifs"
1812 fi
1813 CC="$ac_cv_prog_CC"
1814 if test -n "$CC"; then
1815   echo "$ac_t""$CC" 1>&6
1816 else
1817   echo "$ac_t""no" 1>&6
1818 fi
1819  ;;
1820     esac
1821   fi
1822   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1823 fi
1824
1825 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1826 echo "configure:1827: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1827
1828 ac_ext=c
1829 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1830 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1831 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1832 ac_cpp='$CPP '"$xe_cppflags"
1833 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1834 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1835 cross_compiling=no
1836
1837 cat > conftest.$ac_ext << EOF
1838
1839 #line 1840 "configure"
1840 #include "confdefs.h"
1841
1842 main(){return(0);}
1843 EOF
1844 if { (eval echo configure:1845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1845   ac_cv_prog_cc_works=yes
1846   # If we can't run a trivial program, we are probably using a cross compiler.
1847   if (./conftest; exit) 2>/dev/null; then
1848     ac_cv_prog_cc_cross=no
1849   else
1850     ac_cv_prog_cc_cross=yes
1851   fi
1852 else
1853   echo "configure: failed program was:" >&5
1854   cat conftest.$ac_ext >&5
1855   ac_cv_prog_cc_works=no
1856 fi
1857 rm -fr conftest*
1858 ac_ext=c
1859 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1860 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1861 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1862 ac_cpp='$CPP '"$xe_cppflags"
1863 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1864 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1865 cross_compiling=no
1866
1867 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1868 if test $ac_cv_prog_cc_works = no; then
1869   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1870 fi
1871 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1872 echo "configure:1873: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1873 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1874 cross_compiling=$ac_cv_prog_cc_cross
1875
1876 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1877 echo "configure:1878: checking whether we are using GNU C" >&5
1878
1879 cat > conftest.c <<EOF
1880 #ifdef __GNUC__
1881   yes;
1882 #endif
1883 EOF
1884 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1885   ac_cv_prog_gcc=yes
1886 else
1887   ac_cv_prog_gcc=no
1888 fi
1889
1890 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1891
1892 if test $ac_cv_prog_gcc = yes; then
1893   GCC=yes
1894 else
1895   GCC=
1896 fi
1897
1898 ac_test_CFLAGS="${CFLAGS+set}"
1899 ac_save_CFLAGS="$CFLAGS"
1900 CFLAGS=
1901 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1902 echo "configure:1903: checking whether ${CC-cc} accepts -g" >&5
1903
1904 echo 'void f(){}' > conftest.c
1905 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1906   ac_cv_prog_cc_g=yes
1907 else
1908   ac_cv_prog_cc_g=no
1909 fi
1910 rm -f conftest*
1911
1912
1913 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1914 if test "$ac_test_CFLAGS" = set; then
1915   CFLAGS="$ac_save_CFLAGS"
1916 elif test $ac_cv_prog_cc_g = yes; then
1917   if test "$GCC" = yes; then
1918     CFLAGS="-g -O2"
1919   else
1920     CFLAGS="-g"
1921   fi
1922 else
1923   if test "$GCC" = yes; then
1924     CFLAGS="-O2"
1925   else
1926     CFLAGS=
1927   fi
1928 fi
1929
1930 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1931   CC=gcc
1932   # Extract the first word of "gcc", so it can be a program name with args.
1933 set dummy gcc; ac_word=$2
1934 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1935 echo "configure:1936: checking for $ac_word" >&5
1936
1937 if test -n "$CC"; then
1938   ac_cv_prog_CC="$CC" # Let the user override the test.
1939 else
1940   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1941   ac_dummy="$PATH"
1942   for ac_dir in $ac_dummy; do
1943     test -z "$ac_dir" && ac_dir=.
1944     if test -f $ac_dir/$ac_word; then
1945       ac_cv_prog_CC="gcc"
1946       break
1947     fi
1948   done
1949   IFS="$ac_save_ifs"
1950 fi
1951 CC="$ac_cv_prog_CC"
1952 if test -n "$CC"; then
1953   echo "$ac_t""$CC" 1>&6
1954 else
1955   echo "$ac_t""no" 1>&6
1956 fi
1957
1958 if test -z "$CC"; then
1959   # Extract the first word of "cc", so it can be a program name with args.
1960 set dummy cc; ac_word=$2
1961 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1962 echo "configure:1963: checking for $ac_word" >&5
1963
1964 if test -n "$CC"; then
1965   ac_cv_prog_CC="$CC" # Let the user override the test.
1966 else
1967   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1968   ac_prog_rejected=no
1969   ac_dummy="$PATH"
1970   for ac_dir in $ac_dummy; do
1971     test -z "$ac_dir" && ac_dir=.
1972     if test -f $ac_dir/$ac_word; then
1973       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1974         ac_prog_rejected=yes
1975         continue
1976       fi
1977       ac_cv_prog_CC="cc"
1978       break
1979     fi
1980   done
1981   IFS="$ac_save_ifs"
1982 if test $ac_prog_rejected = yes; then
1983   # We found a bogon in the path, so make sure we never use it.
1984   set dummy $ac_cv_prog_CC
1985   shift
1986   if test $# -gt 0; then
1987     # We chose a different compiler from the bogus one.
1988     # However, it has the same basename, so the bogon will be chosen
1989     # first if we set CC to just the basename; use the full file name.
1990     shift
1991     set dummy "$ac_dir/$ac_word" "$@"
1992     shift
1993     ac_cv_prog_CC="$@"
1994   fi
1995 fi
1996 fi
1997 CC="$ac_cv_prog_CC"
1998 if test -n "$CC"; then
1999   echo "$ac_t""$CC" 1>&6
2000 else
2001   echo "$ac_t""no" 1>&6
2002 fi
2003
2004   if test -z "$CC"; then
2005     case "`uname -s`" in
2006     *win32* | *WIN32*)
2007       # Extract the first word of "cl", so it can be a program name with args.
2008 set dummy cl; ac_word=$2
2009 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2010 echo "configure:2011: checking for $ac_word" >&5
2011
2012 if test -n "$CC"; then
2013   ac_cv_prog_CC="$CC" # Let the user override the test.
2014 else
2015   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2016   ac_dummy="$PATH"
2017   for ac_dir in $ac_dummy; do
2018     test -z "$ac_dir" && ac_dir=.
2019     if test -f $ac_dir/$ac_word; then
2020       ac_cv_prog_CC="cl"
2021       break
2022     fi
2023   done
2024   IFS="$ac_save_ifs"
2025 fi
2026 CC="$ac_cv_prog_CC"
2027 if test -n "$CC"; then
2028   echo "$ac_t""$CC" 1>&6
2029 else
2030   echo "$ac_t""no" 1>&6
2031 fi
2032  ;;
2033     esac
2034   fi
2035   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2036 fi
2037
2038 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2039 echo "configure:2040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2040
2041 ac_ext=c
2042 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2043 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2044 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2045 ac_cpp='$CPP '"$xe_cppflags"
2046 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2047 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2048 cross_compiling=no
2049
2050 cat > conftest.$ac_ext << EOF
2051
2052 #line 2053 "configure"
2053 #include "confdefs.h"
2054
2055 main(){return(0);}
2056 EOF
2057 if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2058   ac_cv_prog_cc_works=yes
2059   # If we can't run a trivial program, we are probably using a cross compiler.
2060   if (./conftest; exit) 2>/dev/null; then
2061     ac_cv_prog_cc_cross=no
2062   else
2063     ac_cv_prog_cc_cross=yes
2064   fi
2065 else
2066   echo "configure: failed program was:" >&5
2067   cat conftest.$ac_ext >&5
2068   ac_cv_prog_cc_works=no
2069 fi
2070 rm -fr conftest*
2071 ac_ext=c
2072 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2073 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2074 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2075 ac_cpp='$CPP '"$xe_cppflags"
2076 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2077 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2078 cross_compiling=no
2079
2080 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2081 if test $ac_cv_prog_cc_works = no; then
2082   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2083 fi
2084 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2085 echo "configure:2086: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2086 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2087 cross_compiling=$ac_cv_prog_cc_cross
2088
2089 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2090 echo "configure:2091: checking whether we are using GNU C" >&5
2091
2092 cat > conftest.c <<EOF
2093 #ifdef __GNUC__
2094   yes;
2095 #endif
2096 EOF
2097 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2098   ac_cv_prog_gcc=yes
2099 else
2100   ac_cv_prog_gcc=no
2101 fi
2102
2103 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2104
2105 if test $ac_cv_prog_gcc = yes; then
2106   GCC=yes
2107 else
2108   GCC=
2109 fi
2110
2111 ac_test_CFLAGS="${CFLAGS+set}"
2112 ac_save_CFLAGS="$CFLAGS"
2113 CFLAGS=
2114 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2115 echo "configure:2116: checking whether ${CC-cc} accepts -g" >&5
2116
2117 echo 'void f(){}' > conftest.c
2118 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2119   ac_cv_prog_cc_g=yes
2120 else
2121   ac_cv_prog_cc_g=no
2122 fi
2123 rm -f conftest*
2124
2125
2126 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2127 if test "$ac_test_CFLAGS" = set; then
2128   CFLAGS="$ac_save_CFLAGS"
2129 elif test $ac_cv_prog_cc_g = yes; then
2130   if test "$GCC" = yes; then
2131     CFLAGS="-g -O2"
2132   else
2133     CFLAGS="-g"
2134   fi
2135 else
2136   if test "$GCC" = yes; then
2137     CFLAGS="-O2"
2138   else
2139     CFLAGS=
2140   fi
2141 fi
2142
2143 fi
2144 CFLAGS="$xe_save_CFLAGS"
2145
2146
2147 test -n "$CPP" -a -d "$CPP" && CPP=
2148
2149 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2150
2151 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2152 echo "configure:2153: checking how to run the C preprocessor" >&5
2153 # On Suns, sometimes $CPP names a directory.
2154 if test -n "$CPP" && test -d "$CPP"; then
2155   CPP=
2156 fi
2157 if test -z "$CPP"; then
2158
2159   # This must be in double quotes, not single quotes, because CPP may get
2160   # substituted into the Makefile and "${CC-cc}" will confuse make.
2161   CPP="${CC-cc} -E"
2162   # On the NeXT, cc -E runs the code through the compiler's parser,
2163   # not just through cpp.
2164   cat > conftest.$ac_ext <<EOF
2165 #line 2166 "configure"
2166 #include "confdefs.h"
2167 #include <assert.h>
2168 Syntax Error
2169 EOF
2170 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2171 { (eval echo configure:2172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2172 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2173 if test -z "$ac_err"; then
2174   :
2175 else
2176   echo "$ac_err" >&5
2177   echo "configure: failed program was:" >&5
2178   cat conftest.$ac_ext >&5
2179   rm -rf conftest*
2180   CPP="${CC-cc} -E -traditional-cpp"
2181   cat > conftest.$ac_ext <<EOF
2182 #line 2183 "configure"
2183 #include "confdefs.h"
2184 #include <assert.h>
2185 Syntax Error
2186 EOF
2187 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2188 { (eval echo configure:2189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2189 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2190 if test -z "$ac_err"; then
2191   :
2192 else
2193   echo "$ac_err" >&5
2194   echo "configure: failed program was:" >&5
2195   cat conftest.$ac_ext >&5
2196   rm -rf conftest*
2197   CPP="${CC-cc} -nologo -E"
2198   cat > conftest.$ac_ext <<EOF
2199 #line 2200 "configure"
2200 #include "confdefs.h"
2201 #include <assert.h>
2202 Syntax Error
2203 EOF
2204 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2205 { (eval echo configure:2206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2206 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2207 if test -z "$ac_err"; then
2208   :
2209 else
2210   echo "$ac_err" >&5
2211   echo "configure: failed program was:" >&5
2212   cat conftest.$ac_ext >&5
2213   rm -rf conftest*
2214   CPP=/lib/cpp
2215 fi
2216 rm -f conftest*
2217 fi
2218 rm -f conftest*
2219 fi
2220 rm -f conftest*
2221   ac_cv_prog_CPP="$CPP"
2222   CPP="$ac_cv_prog_CPP"
2223 else
2224   ac_cv_prog_CPP="$CPP"
2225 fi
2226 echo "$ac_t""$CPP" 1>&6
2227
2228
2229 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2230 echo "configure:2231: checking for AIX" >&5
2231 cat > conftest.$ac_ext <<EOF
2232 #line 2233 "configure"
2233 #include "confdefs.h"
2234 #ifdef _AIX
2235   yes
2236 #endif
2237
2238 EOF
2239 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2240   egrep "yes" >/dev/null 2>&1; then
2241   rm -rf conftest*
2242   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2243     Defining _ALL_SOURCE
2244 EOF
2245 cat >> confdefs.h <<\EOF
2246 #define _ALL_SOURCE 1
2247 EOF
2248 }
2249
2250 else
2251   rm -rf conftest*
2252   echo "$ac_t""no" 1>&6
2253 fi
2254 rm -f conftest*
2255
2256
2257
2258 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2259 echo "configure:2260: checking for GNU libc" >&5
2260 cat > conftest.$ac_ext <<EOF
2261 #line 2262 "configure"
2262 #include "confdefs.h"
2263 #include <features.h>
2264 int main() {
2265
2266 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2267 #error Not a GNU libc system :-(
2268 ******* ======= ******** &&&&&&&&
2269 #endif
2270
2271 ; return 0; }
2272 EOF
2273 if { (eval echo configure:2274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2274   rm -rf conftest*
2275   have_glibc=yes
2276 else
2277   echo "configure: failed program was:" >&5
2278   cat conftest.$ac_ext >&5
2279   rm -rf conftest*
2280   have_glibc=no
2281 fi
2282 rm -f conftest*
2283 echo "$ac_t""$have_glibc" 1>&6
2284 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2285     Defining _GNU_SOURCE
2286 EOF
2287 cat >> confdefs.h <<\EOF
2288 #define _GNU_SOURCE 1
2289 EOF
2290 }
2291
2292
2293
2294 cat > conftest.$ac_ext <<EOF
2295 #line 2296 "configure"
2296 #include "confdefs.h"
2297 int main () {
2298 #if defined __SUNPRO_C
2299 return 11;
2300 #elif defined __DECC
2301 return 12;
2302 #else
2303 return 0;
2304 #endif
2305 }
2306 EOF
2307 if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2308 then
2309   :
2310 else
2311   conftest_rc="$?"
2312   echo "configure: failed program was:" >&5
2313   cat conftest.$ac_ext >&5
2314   rm -fr conftest*
2315   case "$conftest_rc" in
2316   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2317   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2318 esac
2319 fi
2320 rm -fr conftest*
2321
2322
2323
2324
2325 echo "Extracting information from the machine- and system-dependent headers..."
2326
2327 tempcname="conftest.c"
2328
2329
2330
2331 cat > $tempcname <<EOF
2332 #define NOT_C_CODE
2333 #define C_SWITCH_SITE
2334 #define C_SWITCH_X_SITE
2335 #define LD_SWITCH_SITE
2336 #define LD_SWITCH_X_SITE
2337 #define LD_SWITCH_X_SITE_AUX
2338 #define OS_RELEASE $os_release
2339 #include "$srcdir/src/$opsysfile"
2340 #include "$srcdir/src/$machfile"
2341
2342 #ifndef LIBS_MACHINE
2343 #define LIBS_MACHINE
2344 #endif
2345 configure___ libs_machine=LIBS_MACHINE
2346
2347 #ifndef LIBS_SYSTEM
2348 #define LIBS_SYSTEM
2349 #endif
2350 configure___ libs_system=LIBS_SYSTEM
2351
2352 #ifndef LIBS_TERMCAP
2353 #define LIBS_TERMCAP
2354 #endif
2355 configure___ libs_termcap=LIBS_TERMCAP
2356
2357 #ifndef LIB_STANDARD
2358 #define LIB_STANDARD
2359 #endif
2360 configure___ libs_standard=LIB_STANDARD
2361
2362
2363 #ifndef OBJECTS_MACHINE
2364 #define OBJECTS_MACHINE
2365 #endif
2366 configure___ objects_machine=OBJECTS_MACHINE
2367
2368 #ifndef OBJECTS_SYSTEM
2369 #define OBJECTS_SYSTEM
2370 #endif
2371 configure___ objects_system=OBJECTS_SYSTEM
2372
2373
2374 #ifndef C_SWITCH_MACHINE
2375 #define C_SWITCH_MACHINE
2376 #endif
2377 configure___ c_switch_machine=C_SWITCH_MACHINE
2378
2379 #ifndef C_SWITCH_SYSTEM
2380 #define C_SWITCH_SYSTEM
2381 #endif
2382 configure___ c_switch_system=C_SWITCH_SYSTEM
2383
2384
2385 #ifndef LD_SWITCH_MACHINE
2386 #define LD_SWITCH_MACHINE
2387 #endif
2388 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2389
2390 #ifndef LD_SWITCH_SYSTEM
2391 #define LD_SWITCH_SYSTEM
2392 #endif
2393 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2394
2395
2396 #ifndef UNEXEC
2397 #define UNEXEC "unexec.o"
2398 #endif
2399 configure___ unexec=UNEXEC
2400
2401
2402 #ifndef LD_SWITCH_SHARED
2403 #define LD_SWITCH_SHARED "-c"
2404 #endif
2405 configure___ ld_switch_shared=LD_SWITCH_SHARED
2406
2407
2408 #ifdef ORDINARY_LINK
2409 #define LD "\$(CC) \$(CFLAGS)"
2410 #else /* no ORDINARY LINK */
2411 #ifdef COFF_ENCAPSULATE
2412 #define LD "\$(CC) -nostdlib"
2413 #else /* not COFF_ENCAPSULATE */
2414 #ifdef LINKER
2415 #define LD LINKER
2416 #else /* ! defined (LINKER) */
2417 #define LD "ld"
2418 #endif /* ! defined (LINKER) */
2419 #endif /* ! defined (COFF_ENCAPSULATE) */
2420 #endif /* not ORDINARY_LINK */
2421 configure___ ld=LD
2422
2423 #ifndef LIB_GCC
2424 #define LIB_GCC
2425 #endif
2426 configure___ lib_gcc=LIB_GCC
2427
2428 #ifndef LD_TEXT_START_ADDR
2429 #define LD_TEXT_START_ADDR
2430 #endif
2431 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2432
2433
2434 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2435 #ifdef NO_REMAP
2436 #ifdef COFF_ENCAPSULATE
2437 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2438 #else /* ! defined (COFF_ENCAPSULATE) */
2439 #define START_FILES "pre-crt0.o /lib/crt0.o"
2440 #endif /* ! defined (COFF_ENCAPSULATE) */
2441 #else /* ! defined (NO_REMAP) */
2442 #define START_FILES "ecrt0.o"
2443 #endif /* ! defined (NO_REMAP) */
2444 #endif /* no ORDINARY_LINK */
2445 #ifndef START_FILES
2446 #define START_FILES
2447 #endif
2448 configure___ start_files=START_FILES
2449
2450 #ifdef ORDINARY_LINK
2451 configure___ ordinary_link=yes
2452 #else
2453 configure___ ordinary_link=no
2454 #endif
2455
2456 #ifdef SYSTEM_MALLOC
2457 configure___ system_malloc=yes
2458 #else
2459 configure___ system_malloc=no
2460 #endif
2461
2462 #ifdef TERMINFO
2463 configure___ have_terminfo=yes
2464 #else
2465 configure___ have_terminfo=no
2466 #endif
2467
2468 #ifdef MAIL_USE_FLOCK
2469 configure___ mail_use_flock=yes
2470 #else
2471 configure___ mail_use_flock=no
2472 #endif
2473
2474 #ifdef MAIL_USE_LOCKF
2475 configure___ mail_use_lockf=yes
2476 #else
2477 configure___ mail_use_lockf=no
2478 #endif
2479
2480 #ifdef HAVE_WIN32_PROCESSES
2481 configure___ win32_processes=yes
2482 #else
2483 configure___ win32_processes=no
2484 #endif
2485
2486 EOF
2487
2488 CPP=`eval "echo $CPP $CPPFLAGS"`
2489 eval `$CPP -Isrc $tempcname \
2490         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2491
2492 rm $tempcname
2493
2494 test "$extra_verbose" = "yes" && \
2495   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 ""
2496
2497 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2498
2499 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2500
2501 if test "$cflags_specified" = "no"; then
2502       if   test "$GCC" = "yes"; then
2503     CFLAGS="-g -O3 -Wall -Wno-switch"
2504               elif test "$__SUNPRO_C" = "yes"; then
2505     case "$opsys" in
2506       sol2    ) CFLAGS="-v -xO4" ;;
2507       sunos4* ) CFLAGS="-xO2";;
2508     esac
2509   elif test "$__DECC" = "yes"; then
2510     CFLAGS="-O3"
2511   elif test "$CC" = "xlc"; then
2512     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2513     else
2514     CFLAGS="-O" ;  fi
2515 fi
2516
2517
2518 if test "$GCC" = "yes"; then
2519   set x $ld_switch_system; shift; ld_switch_system=""
2520   while test -n "$1"; do
2521     case $1 in
2522       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2523       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2524       -Xlinker* ) ;;
2525       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2526     esac
2527     shift
2528   done
2529 fi
2530
2531 if test "$GCC" = "yes"; then
2532   set x $ld_switch_machine; shift; ld_switch_machine=""
2533   while test -n "$1"; do
2534     case $1 in
2535       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2536       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2537       -Xlinker* ) ;;
2538       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2539     esac
2540     shift
2541   done
2542 fi
2543
2544 if test "$GCC" = "yes"; then
2545   set x $LDFLAGS; shift; LDFLAGS=""
2546   while test -n "$1"; do
2547     case $1 in
2548       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2549       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2550       -Xlinker* ) ;;
2551       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2552     esac
2553     shift
2554   done
2555 fi
2556
2557 if test "$GCC" = "yes"; then
2558   set x $ld_call_shared; shift; ld_call_shared=""
2559   while test -n "$1"; do
2560     case $1 in
2561       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2562       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2563       -Xlinker* ) ;;
2564       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2565     esac
2566     shift
2567   done
2568 fi
2569
2570 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2571    echo "    xemacs will be linked with \"$objects_machine\""
2572  fi
2573 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2574    echo "    xemacs will be linked with \"$objects_system\""
2575  fi
2576 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2577    echo "    xemacs will be linked with \"$unexec\""
2578  fi
2579
2580 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2581 echo "configure:2582: checking for dynodump" >&5
2582 if test "$unexec" != "unexsol2.o"; then
2583   echo "$ac_t""no" 1>&6
2584 else
2585   echo "$ac_t""yes" 1>&6
2586   { test "$extra_verbose" = "yes" && cat << \EOF
2587     Defining DYNODUMP
2588 EOF
2589 cat >> confdefs.h <<\EOF
2590 #define DYNODUMP 1
2591 EOF
2592 }
2593
2594   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2595   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2596   case "$machine" in
2597     sparc   ) dynodump_arch=sparc ;;
2598     *86*    ) dynodump_arch=i386  ;;
2599     powerpc ) dynodump_arch=ppc   ;;
2600   esac
2601     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
2602 fi
2603
2604
2605 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2606
2607 if test "$unexec" = "unexaix.o"; then
2608   if   test "$dynamic" = "no"; then
2609   start_flags="-Wl,-bnso,-bnodelcsect"
2610   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2611   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2612     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2613   done
2614   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2615     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2616   done
2617   
2618 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2619 echo "configure:2620: checking for terminateAndUnload in -lC" >&5
2620 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2621
2622 xe_check_libs=" -lC "
2623 cat > conftest.$ac_ext <<EOF
2624 #line 2625 "configure"
2625 #include "confdefs.h"
2626 /* Override any gcc2 internal prototype to avoid an error.  */
2627 /* We use char because int might match the return type of a gcc2
2628     builtin and then its argument prototype would still apply.  */
2629 char terminateAndUnload();
2630
2631 int main() {
2632 terminateAndUnload()
2633 ; return 0; }
2634 EOF
2635 if { (eval echo configure:2636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2636   rm -rf conftest*
2637   eval "ac_cv_lib_$ac_lib_var=yes"
2638 else
2639   echo "configure: failed program was:" >&5
2640   cat conftest.$ac_ext >&5
2641   rm -rf conftest*
2642   eval "ac_cv_lib_$ac_lib_var=no"
2643 fi
2644 rm -f conftest*
2645 xe_check_libs=""
2646
2647 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2648   echo "$ac_t""yes" 1>&6
2649   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2650 else
2651   echo "$ac_t""no" 1>&6
2652 fi
2653
2654
2655   fi
2656 elif test -n "$ld_text_start_addr"; then
2657   start_flags="-T $ld_text_start_addr -e __start"
2658 fi
2659
2660
2661
2662
2663 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2664  test -z "$linker" &&  linker='$(CC) -nostdlib'
2665  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2666 fi
2667 test "$GCC" != "yes" && lib_gcc=
2668
2669
2670
2671
2672
2673 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2674 if test -n "$site_libraries"; then
2675   for arg in $site_libraries; do
2676     case "$arg" in
2677      -* ) ;;
2678      * ) test -d "$arg" || \
2679            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2680        arg="-L${arg}" ;;
2681     esac
2682     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2683   done
2684 fi
2685
2686 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2687 if test -n "$site_includes"; then
2688   for arg in $site_includes; do
2689     case "$arg" in
2690       -* ) ;;
2691       * ) test -d "$arg" || \
2692            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2693       arg="-I${arg}" ;;
2694     esac
2695     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2696   done
2697 fi
2698
2699 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2700 if test -n "$site_prefixes"; then
2701   for dir in $site_prefixes; do
2702     lib_dir="${dir}/lib"
2703     inc_dir="${dir}/include"
2704     if test ! -d "$dir"; then
2705       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2706     elif test ! -d "$lib_dir"; then
2707       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2708     else
2709       if test -d "$inc_dir"; then
2710         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
2711       fi
2712       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
2713     fi
2714   done
2715 fi
2716
2717
2718 for dir in "/usr/ccs/lib"; do
2719   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
2720 done
2721
2722 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2723 if test -n "$site_runtime_libraries"; then
2724   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2725   export LD_RUN_PATH
2726 fi
2727
2728
2729 if   test "$dynamic" = "no"; then add_runtime_path=no
2730 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2731 else case "$opsys" in
2732        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2733        * ) add_runtime_path=no ;;
2734      esac
2735 fi
2736
2737 if test "$add_runtime_path" = "yes"; then
2738       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2739 echo "configure:2740: checking "for runtime libraries flag"" >&5
2740   case "$opsys" in
2741     sol2 ) dash_r="-R" ;;
2742     decosf* | linux* | irix*) dash_r="-rpath " ;;
2743     *)
2744       dash_r=""
2745       for try_dash_r in "-R" "-R " "-rpath "; do
2746         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2747         
2748 if test "$GCC" = "yes"; then
2749   set x $xe_check_libs; shift; xe_check_libs=""
2750   while test -n "$1"; do
2751     case $1 in
2752       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2753       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2754       -Xlinker* ) ;;
2755       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2756     esac
2757     shift
2758   done
2759 fi
2760         cat > conftest.$ac_ext <<EOF
2761 #line 2762 "configure"
2762 #include "confdefs.h"
2763
2764 int main() {
2765
2766 ; return 0; }
2767 EOF
2768 if { (eval echo configure:2769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2769   rm -rf conftest*
2770   dash_r="$try_dash_r"
2771 else
2772   echo "configure: failed program was:" >&5
2773   cat conftest.$ac_ext >&5
2774 fi
2775 rm -f conftest*
2776         xe_check_libs=""
2777         test -n "$dash_r" && break
2778       done ;;
2779   esac
2780   if test -n "$dash_r";
2781     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2782     else echo "$ac_t""NONE" 1>&6
2783   fi
2784 fi
2785
2786 xe_add_unique_runpath_dir='
2787   xe_add_p=yes
2788   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2789   done
2790   if test "$xe_add_p" = "yes"; then
2791     test -n "$runpath" && runpath="${runpath}:"
2792     runpath="${runpath}${xe_runpath_dir}"
2793     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2794   fi'
2795
2796
2797
2798
2799 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2800     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2801   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2802   
2803         runpath="" runpath_dirs=""
2804   if test -n "$LD_RUN_PATH"; then
2805     runpath="$LD_RUN_PATH"
2806   elif test "$GCC" = "yes"; then
2807         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2808     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2809     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2810     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2811       case "$arg" in P,* | -L* | -R* )
2812         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2813           {
2814 xe_runpath_dir="$dir"
2815   test "$xe_runpath_dir" != "/lib"     -a \
2816         "$xe_runpath_dir" != "/usr/lib" -a \
2817         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2818   eval "$xe_add_unique_runpath_dir"
2819 }
2820         done ;;
2821       esac
2822     done
2823     ld_switch_run="$ld_switch_run_save"
2824     rm -f conftest*
2825   else
2826         for arg in $ld_switch_site $ld_switch_x_site; do
2827       case "$arg" in -L*) {
2828 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2829   test "$xe_runpath_dir" != "/lib"     -a \
2830         "$xe_runpath_dir" != "/usr/lib" -a \
2831         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2832   eval "$xe_add_unique_runpath_dir"
2833 };; esac
2834     done
2835         if test "$opsys $need_motif" = "sol2 yes"; then
2836       xe_runpath_dir="/opt/SUNWdt/lib";
2837       eval "$xe_add_unique_runpath_dir";
2838     fi
2839   fi 
2840   if test -n "$runpath"; then
2841     ld_switch_run="${dash_r}${runpath}"
2842     
2843 if test "$GCC" = "yes"; then
2844   set x $ld_switch_run; shift; ld_switch_run=""
2845   while test -n "$1"; do
2846     case $1 in
2847       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2848       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2849       -Xlinker* ) ;;
2850       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2851     esac
2852     shift
2853   done
2854 fi
2855     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2856   fi
2857 fi
2858
2859
2860
2861
2862 GNU_MALLOC=yes
2863 if test "$with_dlmalloc" != "no"; then
2864         doug_lea_malloc=yes
2865 else
2866         doug_lea_malloc=no
2867 fi
2868 after_morecore_hook_exists=yes
2869 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2870 echo "configure:2871: checking for malloc_get_state" >&5
2871
2872 cat > conftest.$ac_ext <<EOF
2873 #line 2874 "configure"
2874 #include "confdefs.h"
2875 /* System header to define __stub macros and hopefully few prototypes,
2876     which can conflict with char malloc_get_state(); below.  */
2877 #include <assert.h>
2878 /* Override any gcc2 internal prototype to avoid an error.  */
2879 /* We use char because int might match the return type of a gcc2
2880     builtin and then its argument prototype would still apply.  */
2881 char malloc_get_state();
2882
2883 int main() {
2884
2885 /* The GNU C library defines this for functions which it implements
2886     to always fail with ENOSYS.  Some functions are actually named
2887     something starting with __ and the normal name is an alias.  */
2888 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2889 choke me
2890 #else
2891 malloc_get_state();
2892 #endif
2893
2894 ; return 0; }
2895 EOF
2896 if { (eval echo configure:2897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2897   rm -rf conftest*
2898   eval "ac_cv_func_malloc_get_state=yes"
2899 else
2900   echo "configure: failed program was:" >&5
2901   cat conftest.$ac_ext >&5
2902   rm -rf conftest*
2903   eval "ac_cv_func_malloc_get_state=no"
2904 fi
2905 rm -f conftest*
2906
2907 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2908   echo "$ac_t""yes" 1>&6
2909   :
2910 else
2911   echo "$ac_t""no" 1>&6
2912 doug_lea_malloc=no
2913 fi
2914
2915 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2916 echo "configure:2917: checking for malloc_set_state" >&5
2917
2918 cat > conftest.$ac_ext <<EOF
2919 #line 2920 "configure"
2920 #include "confdefs.h"
2921 /* System header to define __stub macros and hopefully few prototypes,
2922     which can conflict with char malloc_set_state(); below.  */
2923 #include <assert.h>
2924 /* Override any gcc2 internal prototype to avoid an error.  */
2925 /* We use char because int might match the return type of a gcc2
2926     builtin and then its argument prototype would still apply.  */
2927 char malloc_set_state();
2928
2929 int main() {
2930
2931 /* The GNU C library defines this for functions which it implements
2932     to always fail with ENOSYS.  Some functions are actually named
2933     something starting with __ and the normal name is an alias.  */
2934 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2935 choke me
2936 #else
2937 malloc_set_state();
2938 #endif
2939
2940 ; return 0; }
2941 EOF
2942 if { (eval echo configure:2943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2943   rm -rf conftest*
2944   eval "ac_cv_func_malloc_set_state=yes"
2945 else
2946   echo "configure: failed program was:" >&5
2947   cat conftest.$ac_ext >&5
2948   rm -rf conftest*
2949   eval "ac_cv_func_malloc_set_state=no"
2950 fi
2951 rm -f conftest*
2952
2953 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2954   echo "$ac_t""yes" 1>&6
2955   :
2956 else
2957   echo "$ac_t""no" 1>&6
2958 doug_lea_malloc=no
2959 fi
2960
2961 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2962 echo "configure:2963: checking whether __after_morecore_hook exists" >&5
2963 cat > conftest.$ac_ext <<EOF
2964 #line 2965 "configure"
2965 #include "confdefs.h"
2966 extern void (* __after_morecore_hook)();
2967 int main() {
2968 __after_morecore_hook = 0
2969 ; return 0; }
2970 EOF
2971 if { (eval echo configure:2972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2972   rm -rf conftest*
2973   echo "$ac_t""yes" 1>&6
2974 else
2975   echo "configure: failed program was:" >&5
2976   cat conftest.$ac_ext >&5
2977   rm -rf conftest*
2978   echo "$ac_t""no" 1>&6
2979    after_morecore_hook_exists=no
2980 fi
2981 rm -f conftest*
2982 if test "$system_malloc" = "yes" ; then
2983   GNU_MALLOC=no
2984   GNU_MALLOC_reason="
2985   (The GNU allocators don't work with this system configuration)."
2986 elif test "$with_system_malloc" = "yes" ; then
2987   GNU_MALLOC=no
2988   GNU_MALLOC_reason="
2989   (User chose not to use GNU allocators)."
2990 elif test "$with_debug_malloc" = "yes" ; then
2991   GNU_MALLOC=no
2992   GNU_MALLOC_reason="
2993   (User chose to use Debugging Malloc)."
2994 fi
2995
2996 if test "$doug_lea_malloc" = "yes" ; then
2997   if test "$GNU_MALLOC" = yes ; then
2998     GNU_MALLOC_reason="
2999   (Using Doug Lea's new malloc from the GNU C Library.)"
3000   fi
3001   { test "$extra_verbose" = "yes" && cat << \EOF
3002     Defining DOUG_LEA_MALLOC
3003 EOF
3004 cat >> confdefs.h <<\EOF
3005 #define DOUG_LEA_MALLOC 1
3006 EOF
3007 }
3008
3009   if test "$after_morecore_hook_exists" = "no" ; then
3010     GNU_MALLOC_reason="
3011   (Using Doug Lea's new malloc from the Linux C Library.)"
3012     { test "$extra_verbose" = "yes" && cat << \EOF
3013     Defining _NO_MALLOC_WARNING_
3014 EOF
3015 cat >> confdefs.h <<\EOF
3016 #define _NO_MALLOC_WARNING_ 1
3017 EOF
3018 }
3019
3020   fi
3021   use_minimal_tagbits=yes
3022 fi
3023
3024
3025
3026
3027 # Extract the first word of "ranlib", so it can be a program name with args.
3028 set dummy ranlib; ac_word=$2
3029 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3030 echo "configure:3031: checking for $ac_word" >&5
3031
3032 if test -n "$RANLIB"; then
3033   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3034 else
3035   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3036   ac_dummy="$PATH"
3037   for ac_dir in $ac_dummy; do
3038     test -z "$ac_dir" && ac_dir=.
3039     if test -f $ac_dir/$ac_word; then
3040       ac_cv_prog_RANLIB="ranlib"
3041       break
3042     fi
3043   done
3044   IFS="$ac_save_ifs"
3045   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3046 fi
3047 RANLIB="$ac_cv_prog_RANLIB"
3048 if test -n "$RANLIB"; then
3049   echo "$ac_t""$RANLIB" 1>&6
3050 else
3051   echo "$ac_t""no" 1>&6
3052 fi
3053
3054 ac_aux_dir=
3055 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3056   if test -f $ac_dir/install-sh; then
3057     ac_aux_dir=$ac_dir
3058     ac_install_sh="$ac_aux_dir/install-sh -c"
3059     break
3060   elif test -f $ac_dir/install.sh; then
3061     ac_aux_dir=$ac_dir
3062     ac_install_sh="$ac_aux_dir/install.sh -c"
3063     break
3064   fi
3065 done
3066 if test -z "$ac_aux_dir"; then
3067   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3068 fi
3069 ac_config_guess=$ac_aux_dir/config.guess
3070 ac_config_sub=$ac_aux_dir/config.sub
3071 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3072
3073 # Find a good install program.  We prefer a C program (faster),
3074 # so one script is as good as another.  But avoid the broken or
3075 # incompatible versions:
3076 # SysV /etc/install, /usr/sbin/install
3077 # SunOS /usr/etc/install
3078 # IRIX /sbin/install
3079 # AIX /bin/install
3080 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3081 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3082 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3083 # ./install, which can be erroneously created by make from ./install.sh.
3084 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3085 echo "configure:3086: checking for a BSD compatible install" >&5
3086 if test -z "$INSTALL"; then
3087
3088   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3089   for ac_dir in $PATH; do
3090     # Account for people who put trailing slashes in PATH elements.
3091     case "$ac_dir/" in
3092     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3093     *)
3094       # OSF1 and SCO ODT 3.0 have their own names for install.
3095       # Don't use installbsd from OSF since it installs stuff as root
3096       # by default.
3097       for ac_prog in ginstall scoinst install; do
3098         if test -f $ac_dir/$ac_prog; then
3099           if test $ac_prog = install &&
3100             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3101             # AIX install.  It has an incompatible calling convention.
3102             :
3103           else
3104             ac_cv_path_install="$ac_dir/$ac_prog -c"
3105             break 2
3106           fi
3107         fi
3108       done
3109       ;;
3110     esac
3111   done
3112   IFS="$ac_save_IFS"
3113
3114   if test "${ac_cv_path_install+set}" = set; then
3115     INSTALL="$ac_cv_path_install"
3116   else
3117     # As a last resort, use the slow shell script.  We don't cache a
3118     # path for INSTALL within a source directory, because that will
3119     # break other packages using the cache if that directory is
3120     # removed, or if the path is relative.
3121     INSTALL="$ac_install_sh"
3122   fi
3123 fi
3124 echo "$ac_t""$INSTALL" 1>&6
3125
3126 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3127 # It thinks the first close brace ends the variable substitution.
3128 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3129
3130 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3131
3132 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3133
3134 for ac_prog in 'bison -y' byacc
3135 do
3136 # Extract the first word of "$ac_prog", so it can be a program name with args.
3137 set dummy $ac_prog; ac_word=$2
3138 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3139 echo "configure:3140: checking for $ac_word" >&5
3140
3141 if test -n "$YACC"; then
3142   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3143 else
3144   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3145   ac_dummy="$PATH"
3146   for ac_dir in $ac_dummy; do
3147     test -z "$ac_dir" && ac_dir=.
3148     if test -f $ac_dir/$ac_word; then
3149       ac_cv_prog_YACC="$ac_prog"
3150       break
3151     fi
3152   done
3153   IFS="$ac_save_ifs"
3154 fi
3155 YACC="$ac_cv_prog_YACC"
3156 if test -n "$YACC"; then
3157   echo "$ac_t""$YACC" 1>&6
3158 else
3159   echo "$ac_t""no" 1>&6
3160 fi
3161
3162 test -n "$YACC" && break
3163 done
3164 test -n "$YACC" || YACC="yacc"
3165
3166
3167 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
3168 do
3169 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3170 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3171 echo "configure:3172: checking for $ac_hdr" >&5
3172
3173 cat > conftest.$ac_ext <<EOF
3174 #line 3175 "configure"
3175 #include "confdefs.h"
3176 #include <$ac_hdr>
3177 EOF
3178 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3179 { (eval echo configure:3180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3180 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3181 if test -z "$ac_err"; then
3182   rm -rf conftest*
3183   eval "ac_cv_header_$ac_safe=yes"
3184 else
3185   echo "$ac_err" >&5
3186   echo "configure: failed program was:" >&5
3187   cat conftest.$ac_ext >&5
3188   rm -rf conftest*
3189   eval "ac_cv_header_$ac_safe=no"
3190 fi
3191 rm -f conftest*
3192 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3193   echo "$ac_t""yes" 1>&6
3194     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3195   { test "$extra_verbose" = "yes" && cat << EOF
3196     Defining $ac_tr_hdr
3197 EOF
3198 cat >> confdefs.h <<EOF
3199 #define $ac_tr_hdr 1
3200 EOF
3201 }
3202  
3203 else
3204   echo "$ac_t""no" 1>&6
3205 fi
3206 done
3207
3208 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3209 do
3210 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3211 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3212 echo "configure:3213: checking for $ac_hdr" >&5
3213
3214 cat > conftest.$ac_ext <<EOF
3215 #line 3216 "configure"
3216 #include "confdefs.h"
3217 #include <$ac_hdr>
3218 EOF
3219 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3220 { (eval echo configure:3221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3221 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3222 if test -z "$ac_err"; then
3223   rm -rf conftest*
3224   eval "ac_cv_header_$ac_safe=yes"
3225 else
3226   echo "$ac_err" >&5
3227   echo "configure: failed program was:" >&5
3228   cat conftest.$ac_ext >&5
3229   rm -rf conftest*
3230   eval "ac_cv_header_$ac_safe=no"
3231 fi
3232 rm -f conftest*
3233 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3234   echo "$ac_t""yes" 1>&6
3235     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3236   { test "$extra_verbose" = "yes" && cat << EOF
3237     Defining $ac_tr_hdr
3238 EOF
3239 cat >> confdefs.h <<EOF
3240 #define $ac_tr_hdr 1
3241 EOF
3242 }
3243  
3244 else
3245   echo "$ac_t""no" 1>&6
3246 fi
3247 done
3248
3249 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3250 do
3251 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3252 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3253 echo "configure:3254: checking for $ac_hdr" >&5
3254
3255 cat > conftest.$ac_ext <<EOF
3256 #line 3257 "configure"
3257 #include "confdefs.h"
3258 #include <$ac_hdr>
3259 EOF
3260 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3261 { (eval echo configure:3262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3262 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3263 if test -z "$ac_err"; then
3264   rm -rf conftest*
3265   eval "ac_cv_header_$ac_safe=yes"
3266 else
3267   echo "$ac_err" >&5
3268   echo "configure: failed program was:" >&5
3269   cat conftest.$ac_ext >&5
3270   rm -rf conftest*
3271   eval "ac_cv_header_$ac_safe=no"
3272 fi
3273 rm -f conftest*
3274 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3275   echo "$ac_t""yes" 1>&6
3276     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3277   { test "$extra_verbose" = "yes" && cat << EOF
3278     Defining $ac_tr_hdr
3279 EOF
3280 cat >> confdefs.h <<EOF
3281 #define $ac_tr_hdr 1
3282 EOF
3283 }
3284  
3285 else
3286   echo "$ac_t""no" 1>&6
3287 fi
3288 done
3289
3290 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3291 echo "configure:3292: checking for sys/wait.h that is POSIX.1 compatible" >&5
3292
3293 cat > conftest.$ac_ext <<EOF
3294 #line 3295 "configure"
3295 #include "confdefs.h"
3296 #include <sys/types.h>
3297 #include <sys/wait.h>
3298 #ifndef WEXITSTATUS
3299 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3300 #endif
3301 #ifndef WIFEXITED
3302 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3303 #endif
3304 int main() {
3305 int s;
3306 wait (&s);
3307 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3308 ; return 0; }
3309 EOF
3310 if { (eval echo configure:3311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3311   rm -rf conftest*
3312   ac_cv_header_sys_wait_h=yes
3313 else
3314   echo "configure: failed program was:" >&5
3315   cat conftest.$ac_ext >&5
3316   rm -rf conftest*
3317   ac_cv_header_sys_wait_h=no
3318 fi
3319 rm -f conftest*
3320
3321 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3322 if test $ac_cv_header_sys_wait_h = yes; then
3323   { test "$extra_verbose" = "yes" && cat << \EOF
3324     Defining HAVE_SYS_WAIT_H
3325 EOF
3326 cat >> confdefs.h <<\EOF
3327 #define HAVE_SYS_WAIT_H 1
3328 EOF
3329 }
3330
3331 fi
3332
3333 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3334 echo "configure:3335: checking for ANSI C header files" >&5
3335
3336 cat > conftest.$ac_ext <<EOF
3337 #line 3338 "configure"
3338 #include "confdefs.h"
3339 #include <stdlib.h>
3340 #include <stdarg.h>
3341 #include <string.h>
3342 #include <float.h>
3343 EOF
3344 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3345 { (eval echo configure:3346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3346 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3347 if test -z "$ac_err"; then
3348   rm -rf conftest*
3349   ac_cv_header_stdc=yes
3350 else
3351   echo "$ac_err" >&5
3352   echo "configure: failed program was:" >&5
3353   cat conftest.$ac_ext >&5
3354   rm -rf conftest*
3355   ac_cv_header_stdc=no
3356 fi
3357 rm -f conftest*
3358
3359 if test $ac_cv_header_stdc = yes; then
3360   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3361 cat > conftest.$ac_ext <<EOF
3362 #line 3363 "configure"
3363 #include "confdefs.h"
3364 #include <string.h>
3365 EOF
3366 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3367   egrep "memchr" >/dev/null 2>&1; then
3368   :
3369 else
3370   rm -rf conftest*
3371   ac_cv_header_stdc=no
3372 fi
3373 rm -f conftest*
3374
3375 fi
3376
3377 if test $ac_cv_header_stdc = yes; then
3378   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3379 cat > conftest.$ac_ext <<EOF
3380 #line 3381 "configure"
3381 #include "confdefs.h"
3382 #include <stdlib.h>
3383 EOF
3384 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3385   egrep "free" >/dev/null 2>&1; then
3386   :
3387 else
3388   rm -rf conftest*
3389   ac_cv_header_stdc=no
3390 fi
3391 rm -f conftest*
3392
3393 fi
3394
3395 if test $ac_cv_header_stdc = yes; then
3396   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3397 cat > conftest.$ac_ext <<EOF
3398 #line 3399 "configure"
3399 #include "confdefs.h"
3400 #include <ctype.h>
3401 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3402 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3403 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3404 int main () { int i; for (i = 0; i < 256; i++)
3405 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3406 exit (0); }
3407
3408 EOF
3409 if { (eval echo configure:3410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3410 then
3411   :
3412 else
3413   conftest_rc="$?"
3414   echo "configure: failed program was:" >&5
3415   cat conftest.$ac_ext >&5
3416   rm -fr conftest*
3417   ac_cv_header_stdc=no
3418 fi
3419 rm -fr conftest*
3420 fi
3421
3422 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3423 if test $ac_cv_header_stdc = yes; then
3424   { test "$extra_verbose" = "yes" && cat << \EOF
3425     Defining STDC_HEADERS
3426 EOF
3427 cat >> confdefs.h <<\EOF
3428 #define STDC_HEADERS 1
3429 EOF
3430 }
3431
3432 fi
3433
3434 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3435 echo "configure:3436: checking whether time.h and sys/time.h may both be included" >&5
3436
3437 cat > conftest.$ac_ext <<EOF
3438 #line 3439 "configure"
3439 #include "confdefs.h"
3440 #include <sys/types.h>
3441 #include <sys/time.h>
3442 #include <time.h>
3443 int main() {
3444 struct tm *tp;
3445 ; return 0; }
3446 EOF
3447 if { (eval echo configure:3448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3448   rm -rf conftest*
3449   ac_cv_header_time=yes
3450 else
3451   echo "configure: failed program was:" >&5
3452   cat conftest.$ac_ext >&5
3453   rm -rf conftest*
3454   ac_cv_header_time=no
3455 fi
3456 rm -f conftest*
3457
3458 echo "$ac_t""$ac_cv_header_time" 1>&6
3459 if test $ac_cv_header_time = yes; then
3460   { test "$extra_verbose" = "yes" && cat << \EOF
3461     Defining TIME_WITH_SYS_TIME
3462 EOF
3463 cat >> confdefs.h <<\EOF
3464 #define TIME_WITH_SYS_TIME 1
3465 EOF
3466 }
3467
3468 fi
3469
3470 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3471 echo "configure:3472: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3472
3473 cat > conftest.$ac_ext <<EOF
3474 #line 3475 "configure"
3475 #include "confdefs.h"
3476 #include <sys/types.h>
3477 #include <signal.h>
3478 /* NetBSD declares sys_siglist in unistd.h.  */
3479 #ifdef HAVE_UNISTD_H
3480 #include <unistd.h>
3481 #endif
3482 int main() {
3483 char *msg = *(sys_siglist + 1);
3484 ; return 0; }
3485 EOF
3486 if { (eval echo configure:3487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3487   rm -rf conftest*
3488   ac_cv_decl_sys_siglist=yes
3489 else
3490   echo "configure: failed program was:" >&5
3491   cat conftest.$ac_ext >&5
3492   rm -rf conftest*
3493   ac_cv_decl_sys_siglist=no
3494 fi
3495 rm -f conftest*
3496
3497 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3498 if test $ac_cv_decl_sys_siglist = yes; then
3499   { test "$extra_verbose" = "yes" && cat << \EOF
3500     Defining SYS_SIGLIST_DECLARED
3501 EOF
3502 cat >> confdefs.h <<\EOF
3503 #define SYS_SIGLIST_DECLARED 1
3504 EOF
3505 }
3506
3507 fi
3508
3509
3510 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3511 echo "configure:3512: checking for struct utimbuf" >&5
3512 cat > conftest.$ac_ext <<EOF
3513 #line 3514 "configure"
3514 #include "confdefs.h"
3515 #ifdef TIME_WITH_SYS_TIME
3516 #include <sys/time.h>
3517 #include <time.h>
3518 #else
3519 #ifdef HAVE_SYS_TIME_H
3520 #include <sys/time.h>
3521 #else
3522 #include <time.h>
3523 #endif
3524 #endif
3525 #ifdef HAVE_UTIME_H
3526 #include <utime.h>
3527 #endif
3528 int main() {
3529 static struct utimbuf x; x.actime = x.modtime;
3530 ; return 0; }
3531 EOF
3532 if { (eval echo configure:3533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3533   rm -rf conftest*
3534   echo "$ac_t""yes" 1>&6
3535    { test "$extra_verbose" = "yes" && cat << \EOF
3536     Defining HAVE_STRUCT_UTIMBUF
3537 EOF
3538 cat >> confdefs.h <<\EOF
3539 #define HAVE_STRUCT_UTIMBUF 1
3540 EOF
3541 }
3542
3543 else
3544   echo "configure: failed program was:" >&5
3545   cat conftest.$ac_ext >&5
3546   rm -rf conftest*
3547   echo "$ac_t""no" 1>&6
3548 fi
3549 rm -f conftest*
3550
3551 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3552 echo "configure:3553: checking return type of signal handlers" >&5
3553
3554 cat > conftest.$ac_ext <<EOF
3555 #line 3556 "configure"
3556 #include "confdefs.h"
3557 #include <sys/types.h>
3558 #include <signal.h>
3559 #ifdef signal
3560 #undef signal
3561 #endif
3562 #ifdef __cplusplus
3563 extern "C" void (*signal (int, void (*)(int)))(int);
3564 #else
3565 void (*signal ()) ();
3566 #endif
3567
3568 int main() {
3569 int i;
3570 ; return 0; }
3571 EOF
3572 if { (eval echo configure:3573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3573   rm -rf conftest*
3574   ac_cv_type_signal=void
3575 else
3576   echo "configure: failed program was:" >&5
3577   cat conftest.$ac_ext >&5
3578   rm -rf conftest*
3579   ac_cv_type_signal=int
3580 fi
3581 rm -f conftest*
3582
3583 echo "$ac_t""$ac_cv_type_signal" 1>&6
3584 { test "$extra_verbose" = "yes" && cat << EOF
3585     Defining RETSIGTYPE = $ac_cv_type_signal
3586 EOF
3587 cat >> confdefs.h <<EOF
3588 #define RETSIGTYPE $ac_cv_type_signal
3589 EOF
3590 }
3591
3592
3593 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3594 echo "configure:3595: checking for size_t" >&5
3595
3596 cat > conftest.$ac_ext <<EOF
3597 #line 3598 "configure"
3598 #include "confdefs.h"
3599 #include <sys/types.h>
3600 #if STDC_HEADERS
3601 #include <stdlib.h>
3602 #include <stddef.h>
3603 #endif
3604 EOF
3605 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3606   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3607   rm -rf conftest*
3608   ac_cv_type_size_t=yes
3609 else
3610   rm -rf conftest*
3611   ac_cv_type_size_t=no
3612 fi
3613 rm -f conftest*
3614
3615 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3616 if test $ac_cv_type_size_t = no; then
3617   { test "$extra_verbose" = "yes" && cat << \EOF
3618     Defining size_t = unsigned
3619 EOF
3620 cat >> confdefs.h <<\EOF
3621 #define size_t unsigned
3622 EOF
3623 }
3624
3625 fi
3626
3627 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3628 echo "configure:3629: checking for pid_t" >&5
3629
3630 cat > conftest.$ac_ext <<EOF
3631 #line 3632 "configure"
3632 #include "confdefs.h"
3633 #include <sys/types.h>
3634 #if STDC_HEADERS
3635 #include <stdlib.h>
3636 #include <stddef.h>
3637 #endif
3638 EOF
3639 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3640   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3641   rm -rf conftest*
3642   ac_cv_type_pid_t=yes
3643 else
3644   rm -rf conftest*
3645   ac_cv_type_pid_t=no
3646 fi
3647 rm -f conftest*
3648
3649 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3650 if test $ac_cv_type_pid_t = no; then
3651   { test "$extra_verbose" = "yes" && cat << \EOF
3652     Defining pid_t = int
3653 EOF
3654 cat >> confdefs.h <<\EOF
3655 #define pid_t int
3656 EOF
3657 }
3658
3659 fi
3660
3661 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3662 echo "configure:3663: checking for uid_t in sys/types.h" >&5
3663
3664 cat > conftest.$ac_ext <<EOF
3665 #line 3666 "configure"
3666 #include "confdefs.h"
3667 #include <sys/types.h>
3668 EOF
3669 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3670   egrep "uid_t" >/dev/null 2>&1; then
3671   rm -rf conftest*
3672   ac_cv_type_uid_t=yes
3673 else
3674   rm -rf conftest*
3675   ac_cv_type_uid_t=no
3676 fi
3677 rm -f conftest*
3678
3679
3680 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3681 if test $ac_cv_type_uid_t = no; then
3682   { test "$extra_verbose" = "yes" && cat << \EOF
3683     Defining uid_t = int
3684 EOF
3685 cat >> confdefs.h <<\EOF
3686 #define uid_t int
3687 EOF
3688 }
3689
3690   { test "$extra_verbose" = "yes" && cat << \EOF
3691     Defining gid_t = int
3692 EOF
3693 cat >> confdefs.h <<\EOF
3694 #define gid_t int
3695 EOF
3696 }
3697
3698 fi
3699
3700 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3701 echo "configure:3702: checking for mode_t" >&5
3702
3703 cat > conftest.$ac_ext <<EOF
3704 #line 3705 "configure"
3705 #include "confdefs.h"
3706 #include <sys/types.h>
3707 #if STDC_HEADERS
3708 #include <stdlib.h>
3709 #include <stddef.h>
3710 #endif
3711 EOF
3712 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3713   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3714   rm -rf conftest*
3715   ac_cv_type_mode_t=yes
3716 else
3717   rm -rf conftest*
3718   ac_cv_type_mode_t=no
3719 fi
3720 rm -f conftest*
3721
3722 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3723 if test $ac_cv_type_mode_t = no; then
3724   { test "$extra_verbose" = "yes" && cat << \EOF
3725     Defining mode_t = int
3726 EOF
3727 cat >> confdefs.h <<\EOF
3728 #define mode_t int
3729 EOF
3730 }
3731
3732 fi
3733
3734 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3735 echo "configure:3736: checking for off_t" >&5
3736
3737 cat > conftest.$ac_ext <<EOF
3738 #line 3739 "configure"
3739 #include "confdefs.h"
3740 #include <sys/types.h>
3741 #if STDC_HEADERS
3742 #include <stdlib.h>
3743 #include <stddef.h>
3744 #endif
3745 EOF
3746 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3747   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3748   rm -rf conftest*
3749   ac_cv_type_off_t=yes
3750 else
3751   rm -rf conftest*
3752   ac_cv_type_off_t=no
3753 fi
3754 rm -f conftest*
3755
3756 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3757 if test $ac_cv_type_off_t = no; then
3758   { test "$extra_verbose" = "yes" && cat << \EOF
3759     Defining off_t = long
3760 EOF
3761 cat >> confdefs.h <<\EOF
3762 #define off_t long
3763 EOF
3764 }
3765
3766 fi
3767
3768
3769 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3770 echo "configure:3771: checking for struct timeval" >&5
3771 cat > conftest.$ac_ext <<EOF
3772 #line 3773 "configure"
3773 #include "confdefs.h"
3774 #ifdef TIME_WITH_SYS_TIME
3775 #include <sys/time.h>
3776 #include <time.h>
3777 #else
3778 #ifdef HAVE_SYS_TIME_H
3779 #include <sys/time.h>
3780 #else
3781 #include <time.h>
3782 #endif
3783 #endif
3784 int main() {
3785 static struct timeval x; x.tv_sec = x.tv_usec;
3786 ; return 0; }
3787 EOF
3788 if { (eval echo configure:3789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3789   rm -rf conftest*
3790   echo "$ac_t""yes" 1>&6
3791   HAVE_TIMEVAL=yes
3792   { test "$extra_verbose" = "yes" && cat << \EOF
3793     Defining HAVE_TIMEVAL
3794 EOF
3795 cat >> confdefs.h <<\EOF
3796 #define HAVE_TIMEVAL 1
3797 EOF
3798 }
3799
3800 else
3801   echo "configure: failed program was:" >&5
3802   cat conftest.$ac_ext >&5
3803   rm -rf conftest*
3804   echo "$ac_t""no" 1>&6
3805    HAVE_TIMEVAL=no
3806 fi
3807 rm -f conftest*
3808
3809 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3810 echo "configure:3811: checking whether struct tm is in sys/time.h or time.h" >&5
3811
3812 cat > conftest.$ac_ext <<EOF
3813 #line 3814 "configure"
3814 #include "confdefs.h"
3815 #include <sys/types.h>
3816 #include <time.h>
3817 int main() {
3818 struct tm *tp; tp->tm_sec;
3819 ; return 0; }
3820 EOF
3821 if { (eval echo configure:3822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3822   rm -rf conftest*
3823   ac_cv_struct_tm=time.h
3824 else
3825   echo "configure: failed program was:" >&5
3826   cat conftest.$ac_ext >&5
3827   rm -rf conftest*
3828   ac_cv_struct_tm=sys/time.h
3829 fi
3830 rm -f conftest*
3831
3832 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3833 if test $ac_cv_struct_tm = sys/time.h; then
3834   { test "$extra_verbose" = "yes" && cat << \EOF
3835     Defining TM_IN_SYS_TIME
3836 EOF
3837 cat >> confdefs.h <<\EOF
3838 #define TM_IN_SYS_TIME 1
3839 EOF
3840 }
3841
3842 fi
3843
3844 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3845 echo "configure:3846: checking for tm_zone in struct tm" >&5
3846
3847 cat > conftest.$ac_ext <<EOF
3848 #line 3849 "configure"
3849 #include "confdefs.h"
3850 #include <sys/types.h>
3851 #include <$ac_cv_struct_tm>
3852 int main() {
3853 struct tm tm; tm.tm_zone;
3854 ; return 0; }
3855 EOF
3856 if { (eval echo configure:3857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3857   rm -rf conftest*
3858   ac_cv_struct_tm_zone=yes
3859 else
3860   echo "configure: failed program was:" >&5
3861   cat conftest.$ac_ext >&5
3862   rm -rf conftest*
3863   ac_cv_struct_tm_zone=no
3864 fi
3865 rm -f conftest*
3866
3867 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3868 if test "$ac_cv_struct_tm_zone" = yes; then
3869   { test "$extra_verbose" = "yes" && cat << \EOF
3870     Defining HAVE_TM_ZONE
3871 EOF
3872 cat >> confdefs.h <<\EOF
3873 #define HAVE_TM_ZONE 1
3874 EOF
3875 }
3876
3877 else
3878   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3879 echo "configure:3880: checking for tzname" >&5
3880
3881 cat > conftest.$ac_ext <<EOF
3882 #line 3883 "configure"
3883 #include "confdefs.h"
3884 #include <time.h>
3885 #ifndef tzname /* For SGI.  */
3886 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3887 #endif
3888 int main() {
3889 atoi(*tzname);
3890 ; return 0; }
3891 EOF
3892 if { (eval echo configure:3893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3893   rm -rf conftest*
3894   ac_cv_var_tzname=yes
3895 else
3896   echo "configure: failed program was:" >&5
3897   cat conftest.$ac_ext >&5
3898   rm -rf conftest*
3899   ac_cv_var_tzname=no
3900 fi
3901 rm -f conftest*
3902
3903 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3904   if test $ac_cv_var_tzname = yes; then
3905     { test "$extra_verbose" = "yes" && cat << \EOF
3906     Defining HAVE_TZNAME
3907 EOF
3908 cat >> confdefs.h <<\EOF
3909 #define HAVE_TZNAME 1
3910 EOF
3911 }
3912
3913   fi
3914 fi
3915
3916
3917 echo $ac_n "checking for working const""... $ac_c" 1>&6
3918 echo "configure:3919: checking for working const" >&5
3919
3920 cat > conftest.$ac_ext <<EOF
3921 #line 3922 "configure"
3922 #include "confdefs.h"
3923
3924 int main() {
3925
3926 /* Ultrix mips cc rejects this.  */
3927 typedef int charset[2]; const charset x;
3928 /* SunOS 4.1.1 cc rejects this.  */
3929 char const *const *ccp;
3930 char **p;
3931 /* NEC SVR4.0.2 mips cc rejects this.  */
3932 struct point {int x, y;};
3933 static struct point const zero = {0,0};
3934 /* AIX XL C 1.02.0.0 rejects this.
3935    It does not let you subtract one const X* pointer from another in an arm
3936    of an if-expression whose if-part is not a constant expression */
3937 const char *g = "string";
3938 ccp = &g + (g ? g-g : 0);
3939 /* HPUX 7.0 cc rejects these. */
3940 ++ccp;
3941 p = (char**) ccp;
3942 ccp = (char const *const *) p;
3943 { /* SCO 3.2v4 cc rejects this.  */
3944   char *t;
3945   char const *s = 0 ? (char *) 0 : (char const *) 0;
3946
3947   *t++ = 0;
3948 }
3949 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3950   int x[] = {25, 17};
3951   const int *foo = &x[0];
3952   ++foo;
3953 }
3954 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3955   typedef const int *iptr;
3956   iptr p = 0;
3957   ++p;
3958 }
3959 { /* AIX XL C 1.02.0.0 rejects this saying
3960      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3961   struct s { int j; const int *ap[3]; };
3962   struct s *b; b->j = 5;
3963 }
3964 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3965   const int foo = 10;
3966 }
3967
3968 ; return 0; }
3969 EOF
3970 if { (eval echo configure:3971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3971   rm -rf conftest*
3972   ac_cv_c_const=yes
3973 else
3974   echo "configure: failed program was:" >&5
3975   cat conftest.$ac_ext >&5
3976   rm -rf conftest*
3977   ac_cv_c_const=no
3978 fi
3979 rm -f conftest*
3980
3981 echo "$ac_t""$ac_cv_c_const" 1>&6
3982 if test $ac_cv_c_const = no; then
3983   { test "$extra_verbose" = "yes" && cat << \EOF
3984     Defining const = 
3985 EOF
3986 cat >> confdefs.h <<\EOF
3987 #define const 
3988 EOF
3989 }
3990
3991 fi
3992
3993
3994 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3995 echo "configure:3996: checking whether ${MAKE-make} sets \${MAKE}" >&5
3996 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3997
3998 cat > conftestmake <<\EOF
3999 all:
4000         @echo 'ac_maketemp="${MAKE}"'
4001 EOF
4002 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4003 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4004 if test -n "$ac_maketemp"; then
4005   eval ac_cv_prog_make_${ac_make}_set=yes
4006 else
4007   eval ac_cv_prog_make_${ac_make}_set=no
4008 fi
4009 rm -f conftestmake
4010 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4011   echo "$ac_t""yes" 1>&6
4012   SET_MAKE=
4013 else
4014   echo "$ac_t""no" 1>&6
4015   SET_MAKE="MAKE=${MAKE-make}"
4016 fi
4017
4018
4019 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4020 echo "configure:4021: checking whether byte ordering is bigendian" >&5
4021
4022 ac_cv_c_bigendian=unknown
4023 # See if sys/param.h defines the BYTE_ORDER macro.
4024 cat > conftest.$ac_ext <<EOF
4025 #line 4026 "configure"
4026 #include "confdefs.h"
4027 #include <sys/types.h>
4028 #include <sys/param.h>
4029 int main() {
4030
4031 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4032  bogus endian macros
4033 #endif
4034 ; return 0; }
4035 EOF
4036 if { (eval echo configure:4037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4037   rm -rf conftest*
4038   # It does; now see whether it defined to BIG_ENDIAN or not.
4039 cat > conftest.$ac_ext <<EOF
4040 #line 4041 "configure"
4041 #include "confdefs.h"
4042 #include <sys/types.h>
4043 #include <sys/param.h>
4044 int main() {
4045
4046 #if BYTE_ORDER != BIG_ENDIAN
4047  not big endian
4048 #endif
4049 ; return 0; }
4050 EOF
4051 if { (eval echo configure:4052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4052   rm -rf conftest*
4053   ac_cv_c_bigendian=yes
4054 else
4055   echo "configure: failed program was:" >&5
4056   cat conftest.$ac_ext >&5
4057   rm -rf conftest*
4058   ac_cv_c_bigendian=no
4059 fi
4060 rm -f conftest*
4061 else
4062   echo "configure: failed program was:" >&5
4063   cat conftest.$ac_ext >&5
4064 fi
4065 rm -f conftest*
4066 if test $ac_cv_c_bigendian = unknown; then
4067 cat > conftest.$ac_ext <<EOF
4068 #line 4069 "configure"
4069 #include "confdefs.h"
4070 main () {
4071   /* Are we little or big endian?  From Harbison&Steele.  */
4072   union
4073   {
4074     long l;
4075     char c[sizeof (long)];
4076   } u;
4077   u.l = 1;
4078   exit (u.c[sizeof (long) - 1] == 1);
4079 }
4080 EOF
4081 if { (eval echo configure:4082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4082 then
4083   ac_cv_c_bigendian=no
4084 else
4085   conftest_rc="$?"
4086   echo "configure: failed program was:" >&5
4087   cat conftest.$ac_ext >&5
4088   rm -fr conftest*
4089   ac_cv_c_bigendian=yes
4090 fi
4091 rm -fr conftest*
4092 fi
4093
4094 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4095 if test $ac_cv_c_bigendian = yes; then
4096   { test "$extra_verbose" = "yes" && cat << \EOF
4097     Defining WORDS_BIGENDIAN
4098 EOF
4099 cat >> confdefs.h <<\EOF
4100 #define WORDS_BIGENDIAN 1
4101 EOF
4102 }
4103
4104 fi
4105
4106
4107 echo $ac_n "checking size of short""... $ac_c" 1>&6
4108 echo "configure:4109: checking size of short" >&5
4109
4110 cat > conftest.$ac_ext <<EOF
4111 #line 4112 "configure"
4112 #include "confdefs.h"
4113 #include <stdio.h>
4114 main()
4115 {
4116   FILE *f=fopen("conftestval", "w");
4117   if (!f) exit(1);
4118   fprintf(f, "%d\n", sizeof(short));
4119   exit(0);
4120 }
4121 EOF
4122 if { (eval echo configure:4123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4123 then
4124   ac_cv_sizeof_short=`cat conftestval`
4125 else
4126   conftest_rc="$?"
4127   echo "configure: failed program was:" >&5
4128   cat conftest.$ac_ext >&5
4129   rm -fr conftest*
4130   ac_cv_sizeof_short=0
4131 fi
4132 rm -fr conftest*
4133 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4134 { test "$extra_verbose" = "yes" && cat << EOF
4135     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4136 EOF
4137 cat >> confdefs.h <<EOF
4138 #define SIZEOF_SHORT $ac_cv_sizeof_short
4139 EOF
4140 }
4141
4142
4143 if test "$ac_cv_sizeof_short" = 0; then
4144   echo ""
4145   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4146   echo "*** PANIC *** Please examine config.log for compilation errors."
4147   exit 1
4148 fi
4149 echo $ac_n "checking size of int""... $ac_c" 1>&6
4150 echo "configure:4151: checking size of int" >&5
4151
4152 cat > conftest.$ac_ext <<EOF
4153 #line 4154 "configure"
4154 #include "confdefs.h"
4155 #include <stdio.h>
4156 main()
4157 {
4158   FILE *f=fopen("conftestval", "w");
4159   if (!f) exit(1);
4160   fprintf(f, "%d\n", sizeof(int));
4161   exit(0);
4162 }
4163 EOF
4164 if { (eval echo configure:4165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4165 then
4166   ac_cv_sizeof_int=`cat conftestval`
4167 else
4168   conftest_rc="$?"
4169   echo "configure: failed program was:" >&5
4170   cat conftest.$ac_ext >&5
4171   rm -fr conftest*
4172   ac_cv_sizeof_int=0
4173 fi
4174 rm -fr conftest*
4175 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4176 { test "$extra_verbose" = "yes" && cat << EOF
4177     Defining SIZEOF_INT = $ac_cv_sizeof_int
4178 EOF
4179 cat >> confdefs.h <<EOF
4180 #define SIZEOF_INT $ac_cv_sizeof_int
4181 EOF
4182 }
4183
4184
4185 echo $ac_n "checking size of long""... $ac_c" 1>&6
4186 echo "configure:4187: checking size of long" >&5
4187
4188 cat > conftest.$ac_ext <<EOF
4189 #line 4190 "configure"
4190 #include "confdefs.h"
4191 #include <stdio.h>
4192 main()
4193 {
4194   FILE *f=fopen("conftestval", "w");
4195   if (!f) exit(1);
4196   fprintf(f, "%d\n", sizeof(long));
4197   exit(0);
4198 }
4199 EOF
4200 if { (eval echo configure:4201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4201 then
4202   ac_cv_sizeof_long=`cat conftestval`
4203 else
4204   conftest_rc="$?"
4205   echo "configure: failed program was:" >&5
4206   cat conftest.$ac_ext >&5
4207   rm -fr conftest*
4208   ac_cv_sizeof_long=0
4209 fi
4210 rm -fr conftest*
4211 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4212 { test "$extra_verbose" = "yes" && cat << EOF
4213     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4214 EOF
4215 cat >> confdefs.h <<EOF
4216 #define SIZEOF_LONG $ac_cv_sizeof_long
4217 EOF
4218 }
4219
4220
4221 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4222 echo "configure:4223: checking size of long long" >&5
4223
4224 cat > conftest.$ac_ext <<EOF
4225 #line 4226 "configure"
4226 #include "confdefs.h"
4227 #include <stdio.h>
4228 main()
4229 {
4230   FILE *f=fopen("conftestval", "w");
4231   if (!f) exit(1);
4232   fprintf(f, "%d\n", sizeof(long long));
4233   exit(0);
4234 }
4235 EOF
4236 if { (eval echo configure:4237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4237 then
4238   ac_cv_sizeof_long_long=`cat conftestval`
4239 else
4240   conftest_rc="$?"
4241   echo "configure: failed program was:" >&5
4242   cat conftest.$ac_ext >&5
4243   rm -fr conftest*
4244   ac_cv_sizeof_long_long=0
4245 fi
4246 rm -fr conftest*
4247 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4248 { test "$extra_verbose" = "yes" && cat << EOF
4249     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4250 EOF
4251 cat >> confdefs.h <<EOF
4252 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4253 EOF
4254 }
4255
4256
4257 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4258 echo "configure:4259: checking size of void *" >&5
4259
4260 cat > conftest.$ac_ext <<EOF
4261 #line 4262 "configure"
4262 #include "confdefs.h"
4263 #include <stdio.h>
4264 main()
4265 {
4266   FILE *f=fopen("conftestval", "w");
4267   if (!f) exit(1);
4268   fprintf(f, "%d\n", sizeof(void *));
4269   exit(0);
4270 }
4271 EOF
4272 if { (eval echo configure:4273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4273 then
4274   ac_cv_sizeof_void_p=`cat conftestval`
4275 else
4276   conftest_rc="$?"
4277   echo "configure: failed program was:" >&5
4278   cat conftest.$ac_ext >&5
4279   rm -fr conftest*
4280   ac_cv_sizeof_void_p=0
4281 fi
4282 rm -fr conftest*
4283 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4284 { test "$extra_verbose" = "yes" && cat << EOF
4285     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4286 EOF
4287 cat >> confdefs.h <<EOF
4288 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4289 EOF
4290 }
4291
4292
4293
4294 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4295 echo "configure:4296: checking for long file names" >&5
4296
4297 ac_cv_sys_long_file_names=yes
4298 # Test for long file names in all the places we know might matter:
4299 #      .                the current directory, where building will happen
4300 #      $prefix/lib      where we will be installing things
4301 #      $exec_prefix/lib likewise
4302 # eval it to expand exec_prefix.
4303 #      $TMPDIR          if set, where it might want to write temporary files
4304 # if $TMPDIR is not set:
4305 #      /tmp             where it might want to write temporary files
4306 #      /var/tmp         likewise
4307 #      /usr/tmp         likewise
4308 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4309   ac_tmpdirs="$TMPDIR"
4310 else
4311   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4312 fi
4313 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4314   test -d $ac_dir || continue
4315   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4316   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4317   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4318   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4319   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4320     ac_cv_sys_long_file_names=no
4321     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4322     break
4323   fi
4324   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4325 done
4326
4327 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4328 if test $ac_cv_sys_long_file_names = yes; then
4329   { test "$extra_verbose" = "yes" && cat << \EOF
4330     Defining HAVE_LONG_FILE_NAMES
4331 EOF
4332 cat >> confdefs.h <<\EOF
4333 #define HAVE_LONG_FILE_NAMES 1
4334 EOF
4335 }
4336
4337 fi
4338
4339
4340 echo $ac_n "checking for sin""... $ac_c" 1>&6
4341 echo "configure:4342: checking for sin" >&5
4342
4343 cat > conftest.$ac_ext <<EOF
4344 #line 4345 "configure"
4345 #include "confdefs.h"
4346 /* System header to define __stub macros and hopefully few prototypes,
4347     which can conflict with char sin(); below.  */
4348 #include <assert.h>
4349 /* Override any gcc2 internal prototype to avoid an error.  */
4350 /* We use char because int might match the return type of a gcc2
4351     builtin and then its argument prototype would still apply.  */
4352 char sin();
4353
4354 int main() {
4355
4356 /* The GNU C library defines this for functions which it implements
4357     to always fail with ENOSYS.  Some functions are actually named
4358     something starting with __ and the normal name is an alias.  */
4359 #if defined (__stub_sin) || defined (__stub___sin)
4360 choke me
4361 #else
4362 sin();
4363 #endif
4364
4365 ; return 0; }
4366 EOF
4367 if { (eval echo configure:4368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4368   rm -rf conftest*
4369   eval "ac_cv_func_sin=yes"
4370 else
4371   echo "configure: failed program was:" >&5
4372   cat conftest.$ac_ext >&5
4373   rm -rf conftest*
4374   eval "ac_cv_func_sin=no"
4375 fi
4376 rm -f conftest*
4377
4378 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4379   echo "$ac_t""yes" 1>&6
4380   :
4381 else
4382   echo "$ac_t""no" 1>&6
4383
4384 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4385 echo "configure:4386: checking for sin in -lm" >&5
4386 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4387
4388 xe_check_libs=" -lm "
4389 cat > conftest.$ac_ext <<EOF
4390 #line 4391 "configure"
4391 #include "confdefs.h"
4392 /* Override any gcc2 internal prototype to avoid an error.  */
4393 /* We use char because int might match the return type of a gcc2
4394     builtin and then its argument prototype would still apply.  */
4395 char sin();
4396
4397 int main() {
4398 sin()
4399 ; return 0; }
4400 EOF
4401 if { (eval echo configure:4402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4402   rm -rf conftest*
4403   eval "ac_cv_lib_$ac_lib_var=yes"
4404 else
4405   echo "configure: failed program was:" >&5
4406   cat conftest.$ac_ext >&5
4407   rm -rf conftest*
4408   eval "ac_cv_lib_$ac_lib_var=no"
4409 fi
4410 rm -f conftest*
4411 xe_check_libs=""
4412
4413 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4414   echo "$ac_t""yes" 1>&6
4415     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4416     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4417   { test "$extra_verbose" = "yes" && cat << EOF
4418     Defining $ac_tr_lib
4419 EOF
4420 cat >> confdefs.h <<EOF
4421 #define $ac_tr_lib 1
4422 EOF
4423 }
4424
4425   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4426
4427 else
4428   echo "$ac_t""no" 1>&6
4429 fi
4430
4431
4432 fi
4433
4434
4435 { test "$extra_verbose" = "yes" && cat << \EOF
4436     Defining LISP_FLOAT_TYPE
4437 EOF
4438 cat >> confdefs.h <<\EOF
4439 #define LISP_FLOAT_TYPE 1
4440 EOF
4441 }
4442
4443
4444 cat > conftest.$ac_ext <<EOF
4445 #line 4446 "configure"
4446 #include "confdefs.h"
4447 #include <math.h>
4448 int main() {
4449 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4450 ; return 0; }
4451 EOF
4452 if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4453   rm -rf conftest*
4454   { test "$extra_verbose" = "yes" && cat << \EOF
4455     Defining HAVE_INVERSE_HYPERBOLIC
4456 EOF
4457 cat >> confdefs.h <<\EOF
4458 #define HAVE_INVERSE_HYPERBOLIC 1
4459 EOF
4460 }
4461
4462 else
4463   echo "configure: failed program was:" >&5
4464   cat conftest.$ac_ext >&5
4465 fi
4466 rm -f conftest*
4467
4468 echo "checking type of mail spool file locking" 1>&6
4469 echo "configure:4470: checking type of mail spool file locking" >&5
4470 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4471 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4472 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4473     Defining REAL_MAIL_USE_LOCKF
4474 EOF
4475 cat >> confdefs.h <<\EOF
4476 #define REAL_MAIL_USE_LOCKF 1
4477 EOF
4478 }
4479
4480 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4481     Defining REAL_MAIL_USE_FLOCK
4482 EOF
4483 cat >> confdefs.h <<\EOF
4484 #define REAL_MAIL_USE_FLOCK 1
4485 EOF
4486 }
4487
4488 else mail_locking="dot-locking"
4489 fi
4490
4491 case "$opsys" in decosf*)
4492   
4493 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4494 echo "configure:4495: checking for cma_open in -lpthreads" >&5
4495 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4496
4497 xe_check_libs=" -lpthreads "
4498 cat > conftest.$ac_ext <<EOF
4499 #line 4500 "configure"
4500 #include "confdefs.h"
4501 /* Override any gcc2 internal prototype to avoid an error.  */
4502 /* We use char because int might match the return type of a gcc2
4503     builtin and then its argument prototype would still apply.  */
4504 char cma_open();
4505
4506 int main() {
4507 cma_open()
4508 ; return 0; }
4509 EOF
4510 if { (eval echo configure:4511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4511   rm -rf conftest*
4512   eval "ac_cv_lib_$ac_lib_var=yes"
4513 else
4514   echo "configure: failed program was:" >&5
4515   cat conftest.$ac_ext >&5
4516   rm -rf conftest*
4517   eval "ac_cv_lib_$ac_lib_var=no"
4518 fi
4519 rm -f conftest*
4520 xe_check_libs=""
4521
4522 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4523   echo "$ac_t""yes" 1>&6
4524     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4525     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4526   { test "$extra_verbose" = "yes" && cat << EOF
4527     Defining $ac_tr_lib
4528 EOF
4529 cat >> confdefs.h <<EOF
4530 #define $ac_tr_lib 1
4531 EOF
4532 }
4533
4534   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4535
4536 else
4537   echo "$ac_t""no" 1>&6
4538 fi
4539
4540
4541   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4542     c_switch_site="$c_switch_site -threads" ;;
4543 esac
4544
4545 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4546 echo "configure:4547: checking whether the -xildoff compiler flag is required" >&5
4547 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4548   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4549     then echo "$ac_t""no" 1>&6;
4550     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
4551   fi
4552   else echo "$ac_t""no" 1>&6
4553 fi
4554
4555 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4556   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4557 echo "configure:4558: checking for \"-z ignore\" linker flag" >&5
4558   case "`ld -h 2>&1`" in
4559     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4560       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4561     *) echo "$ac_t""no" 1>&6 ;;
4562   esac
4563 fi
4564
4565
4566 echo "checking "for specified window system"" 1>&6
4567 echo "configure:4568: checking "for specified window system"" >&5
4568
4569 if test "$with_x11" != "no"; then
4570     test "$x_includes $x_libraries" != "NONE NONE" && \
4571    window_system=x11 with_x11=yes
4572
4573         
4574       if test "$x_includes $x_libraries" = "NONE NONE" \
4575     -a -n "$OPENWINHOME" \
4576     -a "$OPENWINHOME" != "/usr/openwin" \
4577     -a -d "$OPENWINHOME"; then
4578       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4579       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4580       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4581   fi
4582
4583   if test "$x_includes" = "NONE"; then
4584                     for dir in "/usr/X11" "/usr/X11R6"; do
4585       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4586     done
4587   fi
4588
4589   if test "$x_libraries" = "NONE"; then
4590     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4591       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4592     done
4593   fi
4594
4595   # If we find X, set shell vars x_includes and x_libraries to the
4596 # paths, otherwise set no_x=yes.
4597 # Uses ac_ vars as temps to allow command line to override cache and checks.
4598 # --without-x overrides everything else, but does not touch the cache.
4599 echo $ac_n "checking for X""... $ac_c" 1>&6
4600 echo "configure:4601: checking for X" >&5
4601
4602 # Check whether --with-x or --without-x was given.
4603 if test "${with_x+set}" = set; then
4604   withval="$with_x"
4605   :
4606 fi
4607
4608 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4609 if test "x$with_x" = xno; then
4610   # The user explicitly disabled X.
4611   have_x=disabled
4612 else
4613   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4614     # Both variables are already set.
4615     have_x=yes
4616   else
4617
4618 # One or both of the vars are not set, and there is no cached value.
4619 ac_x_includes=NO ac_x_libraries=NO
4620 rm -fr conftestdir
4621 if mkdir conftestdir; then
4622   cd conftestdir
4623   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4624   cat > Imakefile <<'EOF'
4625 acfindx:
4626         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4627 EOF
4628   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4629     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4630     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4631     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4632     for ac_extension in a so sl; do
4633       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4634         test -f $ac_im_libdir/libX11.$ac_extension; then
4635         ac_im_usrlibdir=$ac_im_libdir; break
4636       fi
4637     done
4638     # Screen out bogus values from the imake configuration.  They are
4639     # bogus both because they are the default anyway, and because
4640     # using them would break gcc on systems where it needs fixed includes.
4641     case "$ac_im_incroot" in
4642         /usr/include) ;;
4643         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4644     esac
4645     case "$ac_im_usrlibdir" in
4646         /usr/lib | /lib) ;;
4647         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4648     esac
4649   fi
4650   cd ..
4651   rm -fr conftestdir
4652 fi
4653
4654 if test "$ac_x_includes" = NO; then
4655   # Guess where to find include files, by looking for this one X11 .h file.
4656   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4657
4658   # First, try using that file with no special directory specified.
4659 cat > conftest.$ac_ext <<EOF
4660 #line 4661 "configure"
4661 #include "confdefs.h"
4662 #include <$x_direct_test_include>
4663 EOF
4664 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4665 { (eval echo configure:4666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4666 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4667 if test -z "$ac_err"; then
4668   rm -rf conftest*
4669   # We can compile using X headers with no special include directory.
4670 ac_x_includes=
4671 else
4672   echo "$ac_err" >&5
4673   echo "configure: failed program was:" >&5
4674   cat conftest.$ac_ext >&5
4675   rm -rf conftest*
4676   # Look for the header file in a standard set of common directories.
4677 # Check X11 before X11Rn because it is often a symlink to the current release.
4678   for ac_dir in               \
4679     /usr/X11/include          \
4680     /usr/X11R6/include        \
4681     /usr/X11R5/include        \
4682     /usr/X11R4/include        \
4683                               \
4684     /usr/include/X11          \
4685     /usr/include/X11R6        \
4686     /usr/include/X11R5        \
4687     /usr/include/X11R4        \
4688                               \
4689     /usr/local/X11/include    \
4690     /usr/local/X11R6/include  \
4691     /usr/local/X11R5/include  \
4692     /usr/local/X11R4/include  \
4693                               \
4694     /usr/local/include/X11    \
4695     /usr/local/include/X11R6  \
4696     /usr/local/include/X11R5  \
4697     /usr/local/include/X11R4  \
4698                               \
4699     /usr/X386/include         \
4700     /usr/x386/include         \
4701     /usr/XFree86/include/X11  \
4702                               \
4703     /usr/include              \
4704     /usr/local/include        \
4705     /usr/unsupported/include  \
4706     /usr/athena/include       \
4707     /usr/local/x11r5/include  \
4708     /usr/lpp/Xamples/include  \
4709                               \
4710     /usr/openwin/include      \
4711     /usr/openwin/share/include \
4712     ; \
4713   do
4714     if test -r "$ac_dir/$x_direct_test_include"; then
4715       ac_x_includes=$ac_dir
4716       break
4717     fi
4718   done
4719 fi
4720 rm -f conftest*
4721 fi # $ac_x_includes = NO
4722
4723 if test "$ac_x_libraries" = NO; then
4724   # Check for the libraries.
4725
4726   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4727   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4728
4729   # See if we find them without any special options.
4730   # Don't add to $LIBS permanently.
4731   ac_save_LIBS="$LIBS"
4732   LIBS="-l$x_direct_test_library $LIBS"
4733 cat > conftest.$ac_ext <<EOF
4734 #line 4735 "configure"
4735 #include "confdefs.h"
4736
4737 int main() {
4738 ${x_direct_test_function}()
4739 ; return 0; }
4740 EOF
4741 if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4742   rm -rf conftest*
4743   LIBS="$ac_save_LIBS"
4744 # We can link X programs with no special library path.
4745 ac_x_libraries=
4746 else
4747   echo "configure: failed program was:" >&5
4748   cat conftest.$ac_ext >&5
4749   rm -rf conftest*
4750   LIBS="$ac_save_LIBS"
4751 # First see if replacing the include by lib works.
4752 # Check X11 before X11Rn because it is often a symlink to the current release.
4753 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4754     /usr/X11/lib          \
4755     /usr/X11R6/lib        \
4756     /usr/X11R5/lib        \
4757     /usr/X11R4/lib        \
4758                           \
4759     /usr/lib/X11          \
4760     /usr/lib/X11R6        \
4761     /usr/lib/X11R5        \
4762     /usr/lib/X11R4        \
4763                           \
4764     /usr/local/X11/lib    \
4765     /usr/local/X11R6/lib  \
4766     /usr/local/X11R5/lib  \
4767     /usr/local/X11R4/lib  \
4768                           \
4769     /usr/local/lib/X11    \
4770     /usr/local/lib/X11R6  \
4771     /usr/local/lib/X11R5  \
4772     /usr/local/lib/X11R4  \
4773                           \
4774     /usr/X386/lib         \
4775     /usr/x386/lib         \
4776     /usr/XFree86/lib/X11  \
4777                           \
4778     /usr/lib              \
4779     /usr/local/lib        \
4780     /usr/unsupported/lib  \
4781     /usr/athena/lib       \
4782     /usr/local/x11r5/lib  \
4783     /usr/lpp/Xamples/lib  \
4784     /lib/usr/lib/X11      \
4785                           \
4786     /usr/openwin/lib      \
4787     /usr/openwin/share/lib \
4788     ; \
4789 do
4790   for ac_extension in a so sl; do
4791     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4792       ac_x_libraries=$ac_dir
4793       break 2
4794     fi
4795   done
4796 done
4797 fi
4798 rm -f conftest*
4799 fi # $ac_x_libraries = NO
4800
4801 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4802   # Didn't find X anywhere.  Cache the known absence of X.
4803   ac_cv_have_x="have_x=no"
4804 else
4805   # Record where we found X for the cache.
4806   ac_cv_have_x="have_x=yes \
4807                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4808 fi
4809   fi
4810   eval "$ac_cv_have_x"
4811 fi # $with_x != no
4812
4813 if test "$have_x" != yes; then
4814   echo "$ac_t""$have_x" 1>&6
4815   no_x=yes
4816 else
4817   # If each of the values was on the command line, it overrides each guess.
4818   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4819   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4820   # Update the cache value to reflect the command line values.
4821   ac_cv_have_x="have_x=yes \
4822                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4823   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4824 fi
4825
4826 if test "$no_x" = yes; then
4827   # Not all programs may use this symbol, but it does not hurt to define it.
4828   { test "$extra_verbose" = "yes" && cat << \EOF
4829     Defining X_DISPLAY_MISSING
4830 EOF
4831 cat >> confdefs.h <<\EOF
4832 #define X_DISPLAY_MISSING 1
4833 EOF
4834 }
4835
4836   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4837 else
4838   if test -n "$x_includes"; then
4839     X_CFLAGS="$X_CFLAGS -I$x_includes"
4840   fi
4841
4842   # It would also be nice to do this for all -L options, not just this one.
4843   if test -n "$x_libraries"; then
4844     X_LIBS="$X_LIBS -L$x_libraries"
4845     # For Solaris; some versions of Sun CC require a space after -R and
4846     # others require no space.  Words are not sufficient . . . .
4847     case "`(uname -sr) 2>/dev/null`" in
4848     "SunOS 5"*)
4849       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4850 echo "configure:4851: checking whether -R must be followed by a space" >&5
4851       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4852       cat > conftest.$ac_ext <<EOF
4853 #line 4854 "configure"
4854 #include "confdefs.h"
4855
4856 int main() {
4857
4858 ; return 0; }
4859 EOF
4860 if { (eval echo configure:4861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4861   rm -rf conftest*
4862   ac_R_nospace=yes
4863 else
4864   echo "configure: failed program was:" >&5
4865   cat conftest.$ac_ext >&5
4866   rm -rf conftest*
4867   ac_R_nospace=no
4868 fi
4869 rm -f conftest*
4870       if test $ac_R_nospace = yes; then
4871         echo "$ac_t""no" 1>&6
4872         X_LIBS="$X_LIBS -R$x_libraries"
4873       else
4874         LIBS="$ac_xsave_LIBS -R $x_libraries"
4875         cat > conftest.$ac_ext <<EOF
4876 #line 4877 "configure"
4877 #include "confdefs.h"
4878
4879 int main() {
4880
4881 ; return 0; }
4882 EOF
4883 if { (eval echo configure:4884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4884   rm -rf conftest*
4885   ac_R_space=yes
4886 else
4887   echo "configure: failed program was:" >&5
4888   cat conftest.$ac_ext >&5
4889   rm -rf conftest*
4890   ac_R_space=no
4891 fi
4892 rm -f conftest*
4893         if test $ac_R_space = yes; then
4894           echo "$ac_t""yes" 1>&6
4895           X_LIBS="$X_LIBS -R $x_libraries"
4896         else
4897           echo "$ac_t""neither works" 1>&6
4898         fi
4899       fi
4900       LIBS="$ac_xsave_LIBS"
4901     esac
4902   fi
4903
4904   # Check for system-dependent libraries X programs must link with.
4905   # Do this before checking for the system-independent R6 libraries
4906   # (-lICE), since we may need -lsocket or whatever for X linking.
4907
4908   if test "$ISC" = yes; then
4909     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4910   else
4911     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4912     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4913     # the Alpha needs dnet_stub (dnet does not exist).
4914     if test "$with_dnet" = "no" ; then
4915 ac_cv_lib_dnet_dnet_ntoa=no
4916 else
4917
4918 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4919 echo "configure:4920: checking for dnet_ntoa in -ldnet" >&5
4920 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4921
4922 xe_check_libs=" -ldnet "
4923 cat > conftest.$ac_ext <<EOF
4924 #line 4925 "configure"
4925 #include "confdefs.h"
4926 /* Override any gcc2 internal prototype to avoid an error.  */
4927 /* We use char because int might match the return type of a gcc2
4928     builtin and then its argument prototype would still apply.  */
4929 char dnet_ntoa();
4930
4931 int main() {
4932 dnet_ntoa()
4933 ; return 0; }
4934 EOF
4935 if { (eval echo configure:4936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4936   rm -rf conftest*
4937   eval "ac_cv_lib_$ac_lib_var=yes"
4938 else
4939   echo "configure: failed program was:" >&5
4940   cat conftest.$ac_ext >&5
4941   rm -rf conftest*
4942   eval "ac_cv_lib_$ac_lib_var=no"
4943 fi
4944 rm -f conftest*
4945 xe_check_libs=""
4946
4947 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4948   echo "$ac_t""yes" 1>&6
4949   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4950 else
4951   echo "$ac_t""no" 1>&6
4952 fi
4953
4954 fi
4955
4956     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4957       
4958 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4959 echo "configure:4960: checking for dnet_ntoa in -ldnet_stub" >&5
4960 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4961
4962 xe_check_libs=" -ldnet_stub "
4963 cat > conftest.$ac_ext <<EOF
4964 #line 4965 "configure"
4965 #include "confdefs.h"
4966 /* Override any gcc2 internal prototype to avoid an error.  */
4967 /* We use char because int might match the return type of a gcc2
4968     builtin and then its argument prototype would still apply.  */
4969 char dnet_ntoa();
4970
4971 int main() {
4972 dnet_ntoa()
4973 ; return 0; }
4974 EOF
4975 if { (eval echo configure:4976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4976   rm -rf conftest*
4977   eval "ac_cv_lib_$ac_lib_var=yes"
4978 else
4979   echo "configure: failed program was:" >&5
4980   cat conftest.$ac_ext >&5
4981   rm -rf conftest*
4982   eval "ac_cv_lib_$ac_lib_var=no"
4983 fi
4984 rm -f conftest*
4985 xe_check_libs=""
4986
4987 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4988   echo "$ac_t""yes" 1>&6
4989   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4990 else
4991   echo "$ac_t""no" 1>&6
4992 fi
4993
4994
4995     fi
4996
4997     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4998     # to get the SysV transport functions.
4999     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5000     # needs -lnsl.
5001     # The nsl library prevents programs from opening the X display
5002     # on Irix 5.2, according to dickey@clark.net.
5003     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5004 echo "configure:5005: checking for gethostbyname" >&5
5005
5006 cat > conftest.$ac_ext <<EOF
5007 #line 5008 "configure"
5008 #include "confdefs.h"
5009 /* System header to define __stub macros and hopefully few prototypes,
5010     which can conflict with char gethostbyname(); below.  */
5011 #include <assert.h>
5012 /* Override any gcc2 internal prototype to avoid an error.  */
5013 /* We use char because int might match the return type of a gcc2
5014     builtin and then its argument prototype would still apply.  */
5015 char gethostbyname();
5016
5017 int main() {
5018
5019 /* The GNU C library defines this for functions which it implements
5020     to always fail with ENOSYS.  Some functions are actually named
5021     something starting with __ and the normal name is an alias.  */
5022 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5023 choke me
5024 #else
5025 gethostbyname();
5026 #endif
5027
5028 ; return 0; }
5029 EOF
5030 if { (eval echo configure:5031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5031   rm -rf conftest*
5032   eval "ac_cv_func_gethostbyname=yes"
5033 else
5034   echo "configure: failed program was:" >&5
5035   cat conftest.$ac_ext >&5
5036   rm -rf conftest*
5037   eval "ac_cv_func_gethostbyname=no"
5038 fi
5039 rm -f conftest*
5040
5041 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5042   echo "$ac_t""yes" 1>&6
5043   :
5044 else
5045   echo "$ac_t""no" 1>&6
5046 fi
5047
5048     if test $ac_cv_func_gethostbyname = no; then
5049       
5050 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5051 echo "configure:5052: checking for gethostbyname in -lnsl" >&5
5052 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5053
5054 xe_check_libs=" -lnsl "
5055 cat > conftest.$ac_ext <<EOF
5056 #line 5057 "configure"
5057 #include "confdefs.h"
5058 /* Override any gcc2 internal prototype to avoid an error.  */
5059 /* We use char because int might match the return type of a gcc2
5060     builtin and then its argument prototype would still apply.  */
5061 char gethostbyname();
5062
5063 int main() {
5064 gethostbyname()
5065 ; return 0; }
5066 EOF
5067 if { (eval echo configure:5068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5068   rm -rf conftest*
5069   eval "ac_cv_lib_$ac_lib_var=yes"
5070 else
5071   echo "configure: failed program was:" >&5
5072   cat conftest.$ac_ext >&5
5073   rm -rf conftest*
5074   eval "ac_cv_lib_$ac_lib_var=no"
5075 fi
5076 rm -f conftest*
5077 xe_check_libs=""
5078
5079 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5080   echo "$ac_t""yes" 1>&6
5081   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5082 else
5083   echo "$ac_t""no" 1>&6
5084 fi
5085
5086
5087     fi
5088
5089     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5090     # socket/setsockopt and other routines are undefined under SCO ODT
5091     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5092     # on later versions), says simon@lia.di.epfl.ch: it contains
5093     # gethostby* variants that don't use the nameserver (or something).
5094     # -lsocket must be given before -lnsl if both are needed.
5095     # We assume that if connect needs -lnsl, so does gethostbyname.
5096     echo $ac_n "checking for connect""... $ac_c" 1>&6
5097 echo "configure:5098: checking for connect" >&5
5098
5099 cat > conftest.$ac_ext <<EOF
5100 #line 5101 "configure"
5101 #include "confdefs.h"
5102 /* System header to define __stub macros and hopefully few prototypes,
5103     which can conflict with char connect(); below.  */
5104 #include <assert.h>
5105 /* Override any gcc2 internal prototype to avoid an error.  */
5106 /* We use char because int might match the return type of a gcc2
5107     builtin and then its argument prototype would still apply.  */
5108 char connect();
5109
5110 int main() {
5111
5112 /* The GNU C library defines this for functions which it implements
5113     to always fail with ENOSYS.  Some functions are actually named
5114     something starting with __ and the normal name is an alias.  */
5115 #if defined (__stub_connect) || defined (__stub___connect)
5116 choke me
5117 #else
5118 connect();
5119 #endif
5120
5121 ; return 0; }
5122 EOF
5123 if { (eval echo configure:5124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5124   rm -rf conftest*
5125   eval "ac_cv_func_connect=yes"
5126 else
5127   echo "configure: failed program was:" >&5
5128   cat conftest.$ac_ext >&5
5129   rm -rf conftest*
5130   eval "ac_cv_func_connect=no"
5131 fi
5132 rm -f conftest*
5133
5134 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5135   echo "$ac_t""yes" 1>&6
5136   :
5137 else
5138   echo "$ac_t""no" 1>&6
5139 fi
5140
5141     if test $ac_cv_func_connect = no; then
5142       
5143 xe_msg_checking="for connect in -lsocket"
5144 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5145 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5146 echo "configure:5147: checking "$xe_msg_checking"" >&5
5147 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5148
5149 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5150 cat > conftest.$ac_ext <<EOF
5151 #line 5152 "configure"
5152 #include "confdefs.h"
5153 /* Override any gcc2 internal prototype to avoid an error.  */
5154 /* We use char because int might match the return type of a gcc2
5155     builtin and then its argument prototype would still apply.  */
5156 char connect();
5157
5158 int main() {
5159 connect()
5160 ; return 0; }
5161 EOF
5162 if { (eval echo configure:5163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5163   rm -rf conftest*
5164   eval "ac_cv_lib_$ac_lib_var=yes"
5165 else
5166   echo "configure: failed program was:" >&5
5167   cat conftest.$ac_ext >&5
5168   rm -rf conftest*
5169   eval "ac_cv_lib_$ac_lib_var=no"
5170 fi
5171 rm -f conftest*
5172 xe_check_libs=""
5173
5174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5175   echo "$ac_t""yes" 1>&6
5176   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5177 else
5178   echo "$ac_t""no" 1>&6
5179 fi
5180
5181
5182     fi
5183
5184     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5185     echo $ac_n "checking for remove""... $ac_c" 1>&6
5186 echo "configure:5187: checking for remove" >&5
5187
5188 cat > conftest.$ac_ext <<EOF
5189 #line 5190 "configure"
5190 #include "confdefs.h"
5191 /* System header to define __stub macros and hopefully few prototypes,
5192     which can conflict with char remove(); below.  */
5193 #include <assert.h>
5194 /* Override any gcc2 internal prototype to avoid an error.  */
5195 /* We use char because int might match the return type of a gcc2
5196     builtin and then its argument prototype would still apply.  */
5197 char remove();
5198
5199 int main() {
5200
5201 /* The GNU C library defines this for functions which it implements
5202     to always fail with ENOSYS.  Some functions are actually named
5203     something starting with __ and the normal name is an alias.  */
5204 #if defined (__stub_remove) || defined (__stub___remove)
5205 choke me
5206 #else
5207 remove();
5208 #endif
5209
5210 ; return 0; }
5211 EOF
5212 if { (eval echo configure:5213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5213   rm -rf conftest*
5214   eval "ac_cv_func_remove=yes"
5215 else
5216   echo "configure: failed program was:" >&5
5217   cat conftest.$ac_ext >&5
5218   rm -rf conftest*
5219   eval "ac_cv_func_remove=no"
5220 fi
5221 rm -f conftest*
5222
5223 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5224   echo "$ac_t""yes" 1>&6
5225   :
5226 else
5227   echo "$ac_t""no" 1>&6
5228 fi
5229
5230     if test $ac_cv_func_remove = no; then
5231       
5232 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5233 echo "configure:5234: checking for remove in -lposix" >&5
5234 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5235
5236 xe_check_libs=" -lposix "
5237 cat > conftest.$ac_ext <<EOF
5238 #line 5239 "configure"
5239 #include "confdefs.h"
5240 /* Override any gcc2 internal prototype to avoid an error.  */
5241 /* We use char because int might match the return type of a gcc2
5242     builtin and then its argument prototype would still apply.  */
5243 char remove();
5244
5245 int main() {
5246 remove()
5247 ; return 0; }
5248 EOF
5249 if { (eval echo configure:5250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5250   rm -rf conftest*
5251   eval "ac_cv_lib_$ac_lib_var=yes"
5252 else
5253   echo "configure: failed program was:" >&5
5254   cat conftest.$ac_ext >&5
5255   rm -rf conftest*
5256   eval "ac_cv_lib_$ac_lib_var=no"
5257 fi
5258 rm -f conftest*
5259 xe_check_libs=""
5260
5261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5262   echo "$ac_t""yes" 1>&6
5263   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5264 else
5265   echo "$ac_t""no" 1>&6
5266 fi
5267
5268
5269     fi
5270
5271     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5272     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5273 echo "configure:5274: checking for shmat" >&5
5274
5275 cat > conftest.$ac_ext <<EOF
5276 #line 5277 "configure"
5277 #include "confdefs.h"
5278 /* System header to define __stub macros and hopefully few prototypes,
5279     which can conflict with char shmat(); below.  */
5280 #include <assert.h>
5281 /* Override any gcc2 internal prototype to avoid an error.  */
5282 /* We use char because int might match the return type of a gcc2
5283     builtin and then its argument prototype would still apply.  */
5284 char shmat();
5285
5286 int main() {
5287
5288 /* The GNU C library defines this for functions which it implements
5289     to always fail with ENOSYS.  Some functions are actually named
5290     something starting with __ and the normal name is an alias.  */
5291 #if defined (__stub_shmat) || defined (__stub___shmat)
5292 choke me
5293 #else
5294 shmat();
5295 #endif
5296
5297 ; return 0; }
5298 EOF
5299 if { (eval echo configure:5300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5300   rm -rf conftest*
5301   eval "ac_cv_func_shmat=yes"
5302 else
5303   echo "configure: failed program was:" >&5
5304   cat conftest.$ac_ext >&5
5305   rm -rf conftest*
5306   eval "ac_cv_func_shmat=no"
5307 fi
5308 rm -f conftest*
5309
5310 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5311   echo "$ac_t""yes" 1>&6
5312   :
5313 else
5314   echo "$ac_t""no" 1>&6
5315 fi
5316
5317     if test $ac_cv_func_shmat = no; then
5318       
5319 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5320 echo "configure:5321: checking for shmat in -lipc" >&5
5321 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5322
5323 xe_check_libs=" -lipc "
5324 cat > conftest.$ac_ext <<EOF
5325 #line 5326 "configure"
5326 #include "confdefs.h"
5327 /* Override any gcc2 internal prototype to avoid an error.  */
5328 /* We use char because int might match the return type of a gcc2
5329     builtin and then its argument prototype would still apply.  */
5330 char shmat();
5331
5332 int main() {
5333 shmat()
5334 ; return 0; }
5335 EOF
5336 if { (eval echo configure:5337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5337   rm -rf conftest*
5338   eval "ac_cv_lib_$ac_lib_var=yes"
5339 else
5340   echo "configure: failed program was:" >&5
5341   cat conftest.$ac_ext >&5
5342   rm -rf conftest*
5343   eval "ac_cv_lib_$ac_lib_var=no"
5344 fi
5345 rm -f conftest*
5346 xe_check_libs=""
5347
5348 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5349   echo "$ac_t""yes" 1>&6
5350   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5351 else
5352   echo "$ac_t""no" 1>&6
5353 fi
5354
5355
5356     fi
5357   fi
5358
5359   # Check for libraries that X11R6 Xt/Xaw programs need.
5360   ac_save_LDFLAGS="$LDFLAGS"
5361   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5362   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5363   # check for ICE first), but we must link in the order -lSM -lICE or
5364   # we get undefined symbols.  So assume we have SM if we have ICE.
5365   # These have to be linked with before -lX11, unlike the other
5366   # libraries we check for below, so use a different variable.
5367   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5368   
5369 xe_msg_checking="for IceConnectionNumber in -lICE"
5370 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5371 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5372 echo "configure:5373: checking "$xe_msg_checking"" >&5
5373 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5374
5375 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5376 cat > conftest.$ac_ext <<EOF
5377 #line 5378 "configure"
5378 #include "confdefs.h"
5379 /* Override any gcc2 internal prototype to avoid an error.  */
5380 /* We use char because int might match the return type of a gcc2
5381     builtin and then its argument prototype would still apply.  */
5382 char IceConnectionNumber();
5383
5384 int main() {
5385 IceConnectionNumber()
5386 ; return 0; }
5387 EOF
5388 if { (eval echo configure:5389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5389   rm -rf conftest*
5390   eval "ac_cv_lib_$ac_lib_var=yes"
5391 else
5392   echo "configure: failed program was:" >&5
5393   cat conftest.$ac_ext >&5
5394   rm -rf conftest*
5395   eval "ac_cv_lib_$ac_lib_var=no"
5396 fi
5397 rm -f conftest*
5398 xe_check_libs=""
5399
5400 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5401   echo "$ac_t""yes" 1>&6
5402   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5403 else
5404   echo "$ac_t""no" 1>&6
5405 fi
5406
5407
5408   LDFLAGS="$ac_save_LDFLAGS"
5409
5410 fi
5411  # Autoconf claims to find X library and include dirs for us.
5412   if test "$no_x" = "yes"
5413   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5414   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5415   fi
5416 fi
5417
5418 case "$with_x11" in
5419   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5420   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5421 esac
5422
5423 if test "$with_x11" = "yes"; then
5424   { test "$extra_verbose" = "yes" && cat << \EOF
5425     Defining HAVE_X_WINDOWS
5426 EOF
5427 cat >> confdefs.h <<\EOF
5428 #define HAVE_X_WINDOWS 1
5429 EOF
5430 }
5431
5432   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5433   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5434
5435       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5436     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5437     if test -d "$lib_dir" -a -d "$inc_dir"; then
5438       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5439         x_libraries="$lib_dir $x_libraries"
5440         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5441       esac
5442       case "$x_includes" in "$inc_dir"* ) ;; *)
5443         x_includes="$inc_dir $x_includes"
5444         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5445       esac
5446       break;       fi
5447   done
5448
5449     for rel in "X11R6" "X11R5" "X11R4"; do
5450     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5451     if test -d "$lib_dir" -a -d "$inc_dir"; then
5452       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5453         x_libraries="$x_libraries $lib_dir"
5454         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5455       esac
5456       case "$x_includes" in "$inc_dir"* ) ;; *)
5457         x_includes="$x_includes $inc_dir"
5458         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5459       esac
5460       break;     fi
5461   done
5462
5463     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
5464
5465   ld_switch_x_site="$X_LIBS"
5466
5467   
5468 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5469     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5470   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5471   
5472         runpath="" runpath_dirs=""
5473   if test -n "$LD_RUN_PATH"; then
5474     runpath="$LD_RUN_PATH"
5475   elif test "$GCC" = "yes"; then
5476         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5477     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5478     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5479     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5480       case "$arg" in P,* | -L* | -R* )
5481         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5482           {
5483 xe_runpath_dir="$dir"
5484   test "$xe_runpath_dir" != "/lib"     -a \
5485         "$xe_runpath_dir" != "/usr/lib" -a \
5486         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5487   eval "$xe_add_unique_runpath_dir"
5488 }
5489         done ;;
5490       esac
5491     done
5492     ld_switch_run="$ld_switch_run_save"
5493     rm -f conftest*
5494   else
5495         for arg in $ld_switch_site $ld_switch_x_site; do
5496       case "$arg" in -L*) {
5497 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5498   test "$xe_runpath_dir" != "/lib"     -a \
5499         "$xe_runpath_dir" != "/usr/lib" -a \
5500         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5501   eval "$xe_add_unique_runpath_dir"
5502 };; esac
5503     done
5504         if test "$opsys $need_motif" = "sol2 yes"; then
5505       xe_runpath_dir="/opt/SUNWdt/lib";
5506       eval "$xe_add_unique_runpath_dir";
5507     fi
5508   fi 
5509   if test -n "$runpath"; then
5510     ld_switch_run="${dash_r}${runpath}"
5511     
5512 if test "$GCC" = "yes"; then
5513   set x $ld_switch_run; shift; ld_switch_run=""
5514   while test -n "$1"; do
5515     case $1 in
5516       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5517       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5518       -Xlinker* ) ;;
5519       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5520     esac
5521     shift
5522   done
5523 fi
5524     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5525   fi
5526 fi
5527
5528
5529   if test "$extra_verbose" = "yes"; then
5530     echo; echo "X11 compilation variables:"
5531     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5532     echo
5533   fi
5534
5535             bitmapdirs=
5536   if test "$x_includes" != NONE; then
5537     for i in $x_includes; do
5538       if test -d "$i/bitmaps"; then
5539         bitmapdirs="$i/bitmaps:$bitmapdirs"
5540       fi
5541       if test -d "$i/X11/bitmaps"; then
5542         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5543       fi
5544     done
5545     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5546   fi
5547   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5548     Defining BITMAPDIR = "$bitmapdirs"
5549 EOF
5550 cat >> confdefs.h <<EOF
5551 #define BITMAPDIR "$bitmapdirs"
5552 EOF
5553 }
5554
5555
5556     echo "checking for X defines extracted by xmkmf" 1>&6
5557 echo "configure:5558: checking for X defines extracted by xmkmf" >&5
5558   rm -fr conftestdir
5559   if mkdir conftestdir; then
5560     cd conftestdir
5561     cat > Imakefile <<'EOF'
5562 xetest:
5563         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5564 EOF
5565     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5566       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5567       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5568     fi
5569     cd ..
5570     rm -fr conftestdir
5571     for word in $xmkmf_defines; do
5572       case "$word" in
5573         -D*=* ) ;;
5574         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5575               { test "$extra_verbose" = "yes" && cat << EOF
5576     Defining $word
5577 EOF
5578 cat >> confdefs.h <<EOF
5579 #define $word 1
5580 EOF
5581 }
5582  ;;
5583       esac
5584     done
5585   fi
5586
5587     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5588 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5589 echo "configure:5590: checking for X11/Intrinsic.h" >&5
5590
5591 cat > conftest.$ac_ext <<EOF
5592 #line 5593 "configure"
5593 #include "confdefs.h"
5594 #include <X11/Intrinsic.h>
5595 EOF
5596 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5597 { (eval echo configure:5598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5598 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5599 if test -z "$ac_err"; then
5600   rm -rf conftest*
5601   eval "ac_cv_header_$ac_safe=yes"
5602 else
5603   echo "$ac_err" >&5
5604   echo "configure: failed program was:" >&5
5605   cat conftest.$ac_ext >&5
5606   rm -rf conftest*
5607   eval "ac_cv_header_$ac_safe=no"
5608 fi
5609 rm -f conftest*
5610 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5611   echo "$ac_t""yes" 1>&6
5612   :
5613 else
5614   echo "$ac_t""no" 1>&6
5615 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5616 fi
5617
5618
5619       
5620 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5621 echo "configure:5622: checking for XOpenDisplay in -lX11" >&5
5622 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5623
5624 xe_check_libs=" -lX11 "
5625 cat > conftest.$ac_ext <<EOF
5626 #line 5627 "configure"
5627 #include "confdefs.h"
5628 /* Override any gcc2 internal prototype to avoid an error.  */
5629 /* We use char because int might match the return type of a gcc2
5630     builtin and then its argument prototype would still apply.  */
5631 char XOpenDisplay();
5632
5633 int main() {
5634 XOpenDisplay()
5635 ; return 0; }
5636 EOF
5637 if { (eval echo configure:5638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5638   rm -rf conftest*
5639   eval "ac_cv_lib_$ac_lib_var=yes"
5640 else
5641   echo "configure: failed program was:" >&5
5642   cat conftest.$ac_ext >&5
5643   rm -rf conftest*
5644   eval "ac_cv_lib_$ac_lib_var=no"
5645 fi
5646 rm -f conftest*
5647 xe_check_libs=""
5648
5649 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5650   echo "$ac_t""yes" 1>&6
5651   have_lib_x11=yes
5652 else
5653   echo "$ac_t""no" 1>&6
5654 fi
5655
5656
5657   if test "$have_lib_x11" != "yes"; then
5658     
5659 xe_msg_checking="for XGetFontProperty in -lX11"
5660 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5661 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5662 echo "configure:5663: checking "$xe_msg_checking"" >&5
5663 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5664
5665 xe_check_libs=" -lX11 -b i486-linuxaout"
5666 cat > conftest.$ac_ext <<EOF
5667 #line 5668 "configure"
5668 #include "confdefs.h"
5669 /* Override any gcc2 internal prototype to avoid an error.  */
5670 /* We use char because int might match the return type of a gcc2
5671     builtin and then its argument prototype would still apply.  */
5672 char XGetFontProperty();
5673
5674 int main() {
5675 XGetFontProperty()
5676 ; return 0; }
5677 EOF
5678 if { (eval echo configure:5679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5679   rm -rf conftest*
5680   eval "ac_cv_lib_$ac_lib_var=yes"
5681 else
5682   echo "configure: failed program was:" >&5
5683   cat conftest.$ac_ext >&5
5684   rm -rf conftest*
5685   eval "ac_cv_lib_$ac_lib_var=no"
5686 fi
5687 rm -f conftest*
5688 xe_check_libs=""
5689
5690 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5691   echo "$ac_t""yes" 1>&6
5692   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5693 else
5694   echo "$ac_t""no" 1>&6
5695 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5696 fi
5697
5698
5699   fi
5700   libs_x="-lX11"
5701   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5702
5703     
5704 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5705 echo "configure:5706: checking for XShapeSelectInput in -lXext" >&5
5706 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5707
5708 xe_check_libs=" -lXext "
5709 cat > conftest.$ac_ext <<EOF
5710 #line 5711 "configure"
5711 #include "confdefs.h"
5712 /* Override any gcc2 internal prototype to avoid an error.  */
5713 /* We use char because int might match the return type of a gcc2
5714     builtin and then its argument prototype would still apply.  */
5715 char XShapeSelectInput();
5716
5717 int main() {
5718 XShapeSelectInput()
5719 ; return 0; }
5720 EOF
5721 if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5722   rm -rf conftest*
5723   eval "ac_cv_lib_$ac_lib_var=yes"
5724 else
5725   echo "configure: failed program was:" >&5
5726   cat conftest.$ac_ext >&5
5727   rm -rf conftest*
5728   eval "ac_cv_lib_$ac_lib_var=no"
5729 fi
5730 rm -f conftest*
5731 xe_check_libs=""
5732
5733 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5734   echo "$ac_t""yes" 1>&6
5735   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5736 else
5737   echo "$ac_t""no" 1>&6
5738 fi
5739
5740
5741
5742     
5743 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5744 echo "configure:5745: checking for XtOpenDisplay in -lXt" >&5
5745 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5746
5747 xe_check_libs=" -lXt "
5748 cat > conftest.$ac_ext <<EOF
5749 #line 5750 "configure"
5750 #include "confdefs.h"
5751 /* Override any gcc2 internal prototype to avoid an error.  */
5752 /* We use char because int might match the return type of a gcc2
5753     builtin and then its argument prototype would still apply.  */
5754 char XtOpenDisplay();
5755
5756 int main() {
5757 XtOpenDisplay()
5758 ; return 0; }
5759 EOF
5760 if { (eval echo configure:5761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5761   rm -rf conftest*
5762   eval "ac_cv_lib_$ac_lib_var=yes"
5763 else
5764   echo "configure: failed program was:" >&5
5765   cat conftest.$ac_ext >&5
5766   rm -rf conftest*
5767   eval "ac_cv_lib_$ac_lib_var=no"
5768 fi
5769 rm -f conftest*
5770 xe_check_libs=""
5771
5772 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5773   echo "$ac_t""yes" 1>&6
5774   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5775 else
5776   echo "$ac_t""no" 1>&6
5777 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5778 fi
5779
5780
5781
5782   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5783 echo "configure:5784: checking the version of X11 being used" >&5
5784   cat > conftest.$ac_ext <<EOF
5785 #line 5786 "configure"
5786 #include "confdefs.h"
5787 #include <X11/Intrinsic.h>
5788     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5789 EOF
5790 if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5791 then
5792   ./conftest foobar; x11_release=$?
5793 else
5794   conftest_rc="$?"
5795   echo "configure: failed program was:" >&5
5796   cat conftest.$ac_ext >&5
5797   rm -fr conftest*
5798   x11_release=4
5799 fi
5800 rm -fr conftest*
5801   echo "$ac_t""R${x11_release}" 1>&6
5802   { test "$extra_verbose" = "yes" && cat << EOF
5803     Defining THIS_IS_X11R${x11_release}
5804 EOF
5805 cat >> confdefs.h <<EOF
5806 #define THIS_IS_X11R${x11_release} 1
5807 EOF
5808 }
5809
5810
5811   for ac_hdr in X11/Xlocale.h
5812 do
5813 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5814 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5815 echo "configure:5816: checking for $ac_hdr" >&5
5816
5817 cat > conftest.$ac_ext <<EOF
5818 #line 5819 "configure"
5819 #include "confdefs.h"
5820 #include <$ac_hdr>
5821 EOF
5822 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5823 { (eval echo configure:5824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5824 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5825 if test -z "$ac_err"; then
5826   rm -rf conftest*
5827   eval "ac_cv_header_$ac_safe=yes"
5828 else
5829   echo "$ac_err" >&5
5830   echo "configure: failed program was:" >&5
5831   cat conftest.$ac_ext >&5
5832   rm -rf conftest*
5833   eval "ac_cv_header_$ac_safe=no"
5834 fi
5835 rm -f conftest*
5836 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5837   echo "$ac_t""yes" 1>&6
5838     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5839   { test "$extra_verbose" = "yes" && cat << EOF
5840     Defining $ac_tr_hdr
5841 EOF
5842 cat >> confdefs.h <<EOF
5843 #define $ac_tr_hdr 1
5844 EOF
5845 }
5846  
5847 else
5848   echo "$ac_t""no" 1>&6
5849 fi
5850 done
5851
5852
5853     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5854 echo "configure:5855: checking for XFree86" >&5
5855   if test -d "/usr/X386/include" -o \
5856           -f "/etc/XF86Config"    -o \
5857           -f "/etc/X11/XF86Config" -o \
5858           -f "/usr/X11R6/lib/X11/XF86Config"; then
5859     echo "$ac_t""yes" 1>&6
5860     { test "$extra_verbose" = "yes" && cat << \EOF
5861     Defining HAVE_XFREE386
5862 EOF
5863 cat >> confdefs.h <<\EOF
5864 #define HAVE_XFREE386 1
5865 EOF
5866 }
5867
5868   else
5869     echo "$ac_t""no" 1>&6
5870   fi
5871
5872     test -z "$with_xmu" && { 
5873 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5874 echo "configure:5875: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5875 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5876
5877 xe_check_libs=" -lXmu "
5878 cat > conftest.$ac_ext <<EOF
5879 #line 5880 "configure"
5880 #include "confdefs.h"
5881 /* Override any gcc2 internal prototype to avoid an error.  */
5882 /* We use char because int might match the return type of a gcc2
5883     builtin and then its argument prototype would still apply.  */
5884 char XmuReadBitmapDataFromFile();
5885
5886 int main() {
5887 XmuReadBitmapDataFromFile()
5888 ; return 0; }
5889 EOF
5890 if { (eval echo configure:5891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5891   rm -rf conftest*
5892   eval "ac_cv_lib_$ac_lib_var=yes"
5893 else
5894   echo "configure: failed program was:" >&5
5895   cat conftest.$ac_ext >&5
5896   rm -rf conftest*
5897   eval "ac_cv_lib_$ac_lib_var=no"
5898 fi
5899 rm -f conftest*
5900 xe_check_libs=""
5901
5902 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5903   echo "$ac_t""yes" 1>&6
5904   with_xmu=yes
5905 else
5906   echo "$ac_t""no" 1>&6
5907 with_xmu=no
5908 fi
5909
5910  }
5911   if test "$with_xmu" = "no"; then
5912     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5913    echo "    xemacs will be linked with \"xmu.o\""
5914  fi
5915   else
5916     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5917     { test "$extra_verbose" = "yes" && cat << \EOF
5918     Defining HAVE_XMU
5919 EOF
5920 cat >> confdefs.h <<\EOF
5921 #define HAVE_XMU 1
5922 EOF
5923 }
5924
5925   fi
5926
5927       
5928 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5929 echo "configure:5930: checking for main in -lXbsd" >&5
5930 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5931
5932 xe_check_libs=" -lXbsd "
5933 cat > conftest.$ac_ext <<EOF
5934 #line 5935 "configure"
5935 #include "confdefs.h"
5936
5937 int main() {
5938 main()
5939 ; return 0; }
5940 EOF
5941 if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5942   rm -rf conftest*
5943   eval "ac_cv_lib_$ac_lib_var=yes"
5944 else
5945   echo "configure: failed program was:" >&5
5946   cat conftest.$ac_ext >&5
5947   rm -rf conftest*
5948   eval "ac_cv_lib_$ac_lib_var=no"
5949 fi
5950 rm -f conftest*
5951 xe_check_libs=""
5952
5953 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5954   echo "$ac_t""yes" 1>&6
5955   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5956 else
5957   echo "$ac_t""no" 1>&6
5958 fi
5959
5960
5961
5962     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5963         if test "$GCC" = "yes"; then
5964       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5965       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5966     else
5967       case "$CC" in
5968         "xlc" ) CC="xlc_r" ;;
5969         "xlC" ) CC="xlC_r" ;;
5970         "cc"  ) CC="cc_r" ;;
5971       esac
5972     fi
5973   fi
5974
5975 fi 
5976 if test "$with_msw" != "no"; then
5977   echo "checking for MS-Windows" 1>&6
5978 echo "configure:5979: checking for MS-Windows" >&5
5979   
5980 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5981 echo "configure:5982: checking for main in -lgdi32" >&5
5982 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5983
5984 xe_check_libs=" -lgdi32 "
5985 cat > conftest.$ac_ext <<EOF
5986 #line 5987 "configure"
5987 #include "confdefs.h"
5988
5989 int main() {
5990 main()
5991 ; return 0; }
5992 EOF
5993 if { (eval echo configure:5994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5994   rm -rf conftest*
5995   eval "ac_cv_lib_$ac_lib_var=yes"
5996 else
5997   echo "configure: failed program was:" >&5
5998   cat conftest.$ac_ext >&5
5999   rm -rf conftest*
6000   eval "ac_cv_lib_$ac_lib_var=no"
6001 fi
6002 rm -f conftest*
6003 xe_check_libs=""
6004
6005 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6006   echo "$ac_t""yes" 1>&6
6007   with_msw=yes
6008 else
6009   echo "$ac_t""no" 1>&6
6010 fi
6011
6012
6013   if test "$with_msw" = "yes"; then
6014     { test "$extra_verbose" = "yes" && cat << \EOF
6015     Defining HAVE_MS_WINDOWS
6016 EOF
6017 cat >> confdefs.h <<\EOF
6018 #define HAVE_MS_WINDOWS 1
6019 EOF
6020 }
6021
6022     install_pp="$blddir/lib-src/installexe.sh"
6023     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
6024     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6025     if test "$window_system" != x11; then
6026         window_system=msw
6027         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6028             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6029    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6030  fi
6031         test "$with_menubars"   != "no" && with_menubars=msw \
6032             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6033    echo "    xemacs will be linked with \"menubar-msw.o\""
6034  fi
6035         test "$with_toolbars"   != "no" && with_toolbars=msw \
6036             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6037    echo "    xemacs will be linked with \"toolbar-msw.o\""
6038  fi
6039         test "$with_dialogs"   != "no" && with_dialogs=msw \
6040             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6041    echo "    xemacs will be linked with \"dialog-msw.o\""
6042  fi
6043     else
6044         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6045    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6046  fi
6047         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6048    echo "    xemacs will be linked with \"menubar-msw.o\""
6049  fi
6050         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6051    echo "    xemacs will be linked with \"toolbar-msw.o\""
6052  fi
6053         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6054    echo "    xemacs will be linked with \"dialog-msw.o\""
6055  fi
6056     fi
6057         cat > conftest.$ac_ext <<EOF
6058 #line 6059 "configure"
6059 #include "confdefs.h"
6060 #include <fcntl.h>
6061     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6062 EOF
6063 if { (eval echo configure:6064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6064 then
6065   { test "$extra_verbose" = "yes" && cat << \EOF
6066     Defining HAVE_MSG_SELECT
6067 EOF
6068 cat >> confdefs.h <<\EOF
6069 #define HAVE_MSG_SELECT 1
6070 EOF
6071 }
6072
6073 else
6074   conftest_rc="$?"
6075   echo "configure: failed program was:" >&5
6076   cat conftest.$ac_ext >&5
6077 fi
6078 rm -fr conftest*
6079     const_is_losing=no
6080     with_file_coding=yes
6081     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
6082    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\""
6083  fi
6084   fi
6085 fi
6086
6087
6088
6089 test -z "$window_system" && window_system="none"
6090
6091 if test "$window_system" = "none"; then
6092   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6093   do
6094     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6095        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6096     fi
6097     eval "with_${feature}=no"
6098   done
6099 else
6100   test -z "$with_toolbars" && with_toolbars=yes
6101 fi
6102
6103 if test "$with_msw" != "yes"; then
6104   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6105   do
6106     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6107        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6108     fi
6109     eval "with_${feature}=no"
6110   done
6111 else
6112   :
6113 fi
6114
6115 if test "$with_x11" != "yes"; then
6116             for feature in tooltalk cde offix wmcommand xim xmu
6117   do
6118     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6119        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6120     fi
6121     eval "with_${feature}=no"
6122   done
6123 fi
6124
6125 bitmapdir=
6126
6127 case "$window_system" in
6128   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6129   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6130   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6131 esac
6132
6133 case "$x_libraries" in *X11R4* )
6134   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6135   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6136 esac
6137
6138 echo "checking for WM_COMMAND option" 1>&6
6139 echo "configure:6140: checking for WM_COMMAND option" >&5;
6140 if test "$with_wmcommand" != "no"; then
6141   { test "$extra_verbose" = "yes" && cat << \EOF
6142     Defining HAVE_WMCOMMAND
6143 EOF
6144 cat >> confdefs.h <<\EOF
6145 #define HAVE_WMCOMMAND 1
6146 EOF
6147 }
6148
6149 fi
6150
6151 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6152 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6153 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6154 echo "configure:6155: checking for X11/Xauth.h" >&5
6155
6156 cat > conftest.$ac_ext <<EOF
6157 #line 6158 "configure"
6158 #include "confdefs.h"
6159 #include <X11/Xauth.h>
6160 EOF
6161 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6162 { (eval echo configure:6163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6163 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6164 if test -z "$ac_err"; then
6165   rm -rf conftest*
6166   eval "ac_cv_header_$ac_safe=yes"
6167 else
6168   echo "$ac_err" >&5
6169   echo "configure: failed program was:" >&5
6170   cat conftest.$ac_ext >&5
6171   rm -rf conftest*
6172   eval "ac_cv_header_$ac_safe=no"
6173 fi
6174 rm -f conftest*
6175 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6176   echo "$ac_t""yes" 1>&6
6177   :
6178 else
6179   echo "$ac_t""no" 1>&6
6180 with_xauth=no
6181 fi
6182  }
6183 test -z "$with_xauth" && { 
6184 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6185 echo "configure:6186: checking for XauGetAuthByAddr in -lXau" >&5
6186 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6187
6188 xe_check_libs=" -lXau "
6189 cat > conftest.$ac_ext <<EOF
6190 #line 6191 "configure"
6191 #include "confdefs.h"
6192 /* Override any gcc2 internal prototype to avoid an error.  */
6193 /* We use char because int might match the return type of a gcc2
6194     builtin and then its argument prototype would still apply.  */
6195 char XauGetAuthByAddr();
6196
6197 int main() {
6198 XauGetAuthByAddr()
6199 ; return 0; }
6200 EOF
6201 if { (eval echo configure:6202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6202   rm -rf conftest*
6203   eval "ac_cv_lib_$ac_lib_var=yes"
6204 else
6205   echo "configure: failed program was:" >&5
6206   cat conftest.$ac_ext >&5
6207   rm -rf conftest*
6208   eval "ac_cv_lib_$ac_lib_var=no"
6209 fi
6210 rm -f conftest*
6211 xe_check_libs=""
6212
6213 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6214   echo "$ac_t""yes" 1>&6
6215   :
6216 else
6217   echo "$ac_t""no" 1>&6
6218 with_xauth=no
6219 fi
6220
6221  }
6222 test -z "$with_xauth" && with_xauth=yes
6223 if test "$with_xauth" = "yes"; then
6224   { test "$extra_verbose" = "yes" && cat << \EOF
6225     Defining HAVE_XAUTH
6226 EOF
6227 cat >> confdefs.h <<\EOF
6228 #define HAVE_XAUTH 1
6229 EOF
6230 }
6231
6232   
6233 T=""
6234 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
6235 libs_xauth="$T"
6236
6237 fi
6238
6239
6240
6241
6242 if test "$with_tooltalk" != "no" ; then
6243       for dir in "" "Tt/" "desktop/" ; do
6244     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6245 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6246 echo "configure:6247: checking for ${dir}tt_c.h" >&5
6247
6248 cat > conftest.$ac_ext <<EOF
6249 #line 6250 "configure"
6250 #include "confdefs.h"
6251 #include <${dir}tt_c.h>
6252 EOF
6253 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6254 { (eval echo configure:6255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6255 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6256 if test -z "$ac_err"; then
6257   rm -rf conftest*
6258   eval "ac_cv_header_$ac_safe=yes"
6259 else
6260   echo "$ac_err" >&5
6261   echo "configure: failed program was:" >&5
6262   cat conftest.$ac_ext >&5
6263   rm -rf conftest*
6264   eval "ac_cv_header_$ac_safe=no"
6265 fi
6266 rm -f conftest*
6267 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6268   echo "$ac_t""yes" 1>&6
6269   tt_c_h_path="${dir}tt_c.h"; break
6270 else
6271   echo "$ac_t""no" 1>&6
6272 fi
6273
6274   done
6275   if test -z "$tt_c_h_path"; then
6276     if test "$with_tooltalk" = "yes"; then
6277       (echo "$progname: Usage error:"
6278 echo " " "Unable to find required tooltalk header files."
6279 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6280     fi
6281     with_tooltalk=no
6282   fi
6283 fi
6284 if test "$with_tooltalk" != "no" ; then
6285   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6286     
6287 xe_msg_checking="for tt_message_create in -ltt"
6288 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6289 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6290 echo "configure:6291: checking "$xe_msg_checking"" >&5
6291 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6292
6293 xe_check_libs=" -ltt $extra_libs"
6294 cat > conftest.$ac_ext <<EOF
6295 #line 6296 "configure"
6296 #include "confdefs.h"
6297 /* Override any gcc2 internal prototype to avoid an error.  */
6298 /* We use char because int might match the return type of a gcc2
6299     builtin and then its argument prototype would still apply.  */
6300 char tt_message_create();
6301
6302 int main() {
6303 tt_message_create()
6304 ; return 0; }
6305 EOF
6306 if { (eval echo configure:6307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6307   rm -rf conftest*
6308   eval "ac_cv_lib_$ac_lib_var=yes"
6309 else
6310   echo "configure: failed program was:" >&5
6311   cat conftest.$ac_ext >&5
6312   rm -rf conftest*
6313   eval "ac_cv_lib_$ac_lib_var=no"
6314 fi
6315 rm -f conftest*
6316 xe_check_libs=""
6317
6318 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6319   echo "$ac_t""yes" 1>&6
6320   tt_libs="-ltt $extra_libs"; break
6321 else
6322   echo "$ac_t""no" 1>&6
6323 :
6324 fi
6325
6326
6327   done
6328   if test -z "$tt_libs"; then
6329     if test "$with_tooltalk" = "yes"; then
6330       (echo "$progname: Usage error:"
6331 echo " " "Unable to find required tooltalk libraries."
6332 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6333     fi
6334     with_tooltalk=no
6335   fi
6336 fi
6337 test -z "$with_tooltalk" && with_tooltalk=yes
6338 if test "$with_tooltalk" = "yes"; then
6339   { test "$extra_verbose" = "yes" && cat << \EOF
6340     Defining TOOLTALK
6341 EOF
6342 cat >> confdefs.h <<\EOF
6343 #define TOOLTALK 1
6344 EOF
6345 }
6346
6347   { test "$extra_verbose" = "yes" && cat << EOF
6348     Defining TT_C_H_PATH = "$tt_c_h_path"
6349 EOF
6350 cat >> confdefs.h <<EOF
6351 #define TT_C_H_PATH "$tt_c_h_path"
6352 EOF
6353 }
6354
6355   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6356   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6357    echo "    xemacs will be linked with \"tooltalk.o\""
6358  fi
6359 fi
6360
6361 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6362 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6363 echo "configure:6364: checking for Dt/Dt.h" >&5
6364
6365 cat > conftest.$ac_ext <<EOF
6366 #line 6367 "configure"
6367 #include "confdefs.h"
6368 #include <Dt/Dt.h>
6369 EOF
6370 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6371 { (eval echo configure:6372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6372 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6373 if test -z "$ac_err"; then
6374   rm -rf conftest*
6375   eval "ac_cv_header_$ac_safe=yes"
6376 else
6377   echo "$ac_err" >&5
6378   echo "configure: failed program was:" >&5
6379   cat conftest.$ac_ext >&5
6380   rm -rf conftest*
6381   eval "ac_cv_header_$ac_safe=no"
6382 fi
6383 rm -f conftest*
6384 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6385   echo "$ac_t""yes" 1>&6
6386   :
6387 else
6388   echo "$ac_t""no" 1>&6
6389 with_cde=no
6390 fi
6391  }
6392 test -z "$with_cde" && { 
6393 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6394 echo "configure:6395: checking for DtDndDragStart in -lDtSvc" >&5
6395 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6396
6397 xe_check_libs=" -lDtSvc "
6398 cat > conftest.$ac_ext <<EOF
6399 #line 6400 "configure"
6400 #include "confdefs.h"
6401 /* Override any gcc2 internal prototype to avoid an error.  */
6402 /* We use char because int might match the return type of a gcc2
6403     builtin and then its argument prototype would still apply.  */
6404 char DtDndDragStart();
6405
6406 int main() {
6407 DtDndDragStart()
6408 ; return 0; }
6409 EOF
6410 if { (eval echo configure:6411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6411   rm -rf conftest*
6412   eval "ac_cv_lib_$ac_lib_var=yes"
6413 else
6414   echo "configure: failed program was:" >&5
6415   cat conftest.$ac_ext >&5
6416   rm -rf conftest*
6417   eval "ac_cv_lib_$ac_lib_var=no"
6418 fi
6419 rm -f conftest*
6420 xe_check_libs=""
6421
6422 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6423   echo "$ac_t""yes" 1>&6
6424   :
6425 else
6426   echo "$ac_t""no" 1>&6
6427 with_cde=no
6428 fi
6429
6430  }
6431 test -z "$with_cde" && with_cde=yes
6432 if test "$with_dragndrop" = no; then
6433   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6434   with_cde=no
6435 fi
6436 if test "$with_cde" = "yes" ; then
6437   { test "$extra_verbose" = "yes" && cat << \EOF
6438     Defining HAVE_CDE
6439 EOF
6440 cat >> confdefs.h <<\EOF
6441 #define HAVE_CDE 1
6442 EOF
6443 }
6444
6445   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6446   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6447   with_tooltalk=yes # CDE requires Tooltalk
6448   need_motif=yes    # CDE requires Motif
6449 fi
6450
6451 test "$window_system" != "x11" && with_offix=no
6452 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6453   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6454   with_offix=no
6455 fi
6456 if test "$with_dragndrop" = no; then
6457   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6458   with_offix=no
6459 fi
6460 if test "$with_cde" = yes; then
6461   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6462   with_offix=no
6463 fi
6464 test -z "$with_offix" && with_offix=no
6465 if test "$with_offix" = "yes"; then
6466   { test "$extra_verbose" = "yes" && cat << \EOF
6467     Defining HAVE_OFFIX_DND
6468 EOF
6469 cat >> confdefs.h <<\EOF
6470 #define HAVE_OFFIX_DND 1
6471 EOF
6472 }
6473
6474   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6475   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6476 fi
6477
6478 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6479 echo "configure:6480: checking if drag and drop API is needed" >&5
6480 if test "$with_dragndrop" != "no" ; then
6481   if test -n "$dragndrop_proto" ; then
6482     with_dragndrop=yes
6483     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6484     { test "$extra_verbose" = "yes" && cat << \EOF
6485     Defining HAVE_DRAGNDROP
6486 EOF
6487 cat >> confdefs.h <<\EOF
6488 #define HAVE_DRAGNDROP 1
6489 EOF
6490 }
6491
6492     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6493   else
6494     with_dragndrop=no
6495     echo "$ac_t""no" 1>&6
6496   fi
6497 fi
6498
6499 echo "checking for LDAP" 1>&6
6500 echo "configure:6501: checking for LDAP" >&5
6501 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6502 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6503 echo "configure:6504: checking for ldap.h" >&5
6504
6505 cat > conftest.$ac_ext <<EOF
6506 #line 6507 "configure"
6507 #include "confdefs.h"
6508 #include <ldap.h>
6509 EOF
6510 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6511 { (eval echo configure:6512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6512 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6513 if test -z "$ac_err"; then
6514   rm -rf conftest*
6515   eval "ac_cv_header_$ac_safe=yes"
6516 else
6517   echo "$ac_err" >&5
6518   echo "configure: failed program was:" >&5
6519   cat conftest.$ac_ext >&5
6520   rm -rf conftest*
6521   eval "ac_cv_header_$ac_safe=no"
6522 fi
6523 rm -f conftest*
6524 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6525   echo "$ac_t""yes" 1>&6
6526   :
6527 else
6528   echo "$ac_t""no" 1>&6
6529 with_ldap=no
6530 fi
6531  }
6532 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6533 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6534 echo "configure:6535: checking for lber.h" >&5
6535
6536 cat > conftest.$ac_ext <<EOF
6537 #line 6538 "configure"
6538 #include "confdefs.h"
6539 #include <lber.h>
6540 EOF
6541 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6542 { (eval echo configure:6543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6543 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6544 if test -z "$ac_err"; then
6545   rm -rf conftest*
6546   eval "ac_cv_header_$ac_safe=yes"
6547 else
6548   echo "$ac_err" >&5
6549   echo "configure: failed program was:" >&5
6550   cat conftest.$ac_ext >&5
6551   rm -rf conftest*
6552   eval "ac_cv_header_$ac_safe=no"
6553 fi
6554 rm -f conftest*
6555 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6556   echo "$ac_t""yes" 1>&6
6557   :
6558 else
6559   echo "$ac_t""no" 1>&6
6560 with_ldap=no
6561 fi
6562  }
6563 if test "$with_ldap" != "no"; then
6564   test -z "$with_umich_ldap" && { 
6565 xe_msg_checking="for ldap_open in -lldap"
6566 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6567 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6568 echo "configure:6569: checking "$xe_msg_checking"" >&5
6569 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6570
6571 xe_check_libs=" -lldap -llber"
6572 cat > conftest.$ac_ext <<EOF
6573 #line 6574 "configure"
6574 #include "confdefs.h"
6575 /* Override any gcc2 internal prototype to avoid an error.  */
6576 /* We use char because int might match the return type of a gcc2
6577     builtin and then its argument prototype would still apply.  */
6578 char ldap_open();
6579
6580 int main() {
6581 ldap_open()
6582 ; return 0; }
6583 EOF
6584 if { (eval echo configure:6585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6585   rm -rf conftest*
6586   eval "ac_cv_lib_$ac_lib_var=yes"
6587 else
6588   echo "configure: failed program was:" >&5
6589   cat conftest.$ac_ext >&5
6590   rm -rf conftest*
6591   eval "ac_cv_lib_$ac_lib_var=no"
6592 fi
6593 rm -f conftest*
6594 xe_check_libs=""
6595
6596 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6597   echo "$ac_t""yes" 1>&6
6598   with_umich_ldap=yes
6599 else
6600   echo "$ac_t""no" 1>&6
6601 with_umich_ldap=no
6602 fi
6603
6604  }
6605   test "$with_umich_ldap" = "no" && { 
6606 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6607 echo "configure:6608: checking for ldap_set_option in -lldap10" >&5
6608 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6609
6610 xe_check_libs=" -lldap10 "
6611 cat > conftest.$ac_ext <<EOF
6612 #line 6613 "configure"
6613 #include "confdefs.h"
6614 /* Override any gcc2 internal prototype to avoid an error.  */
6615 /* We use char because int might match the return type of a gcc2
6616     builtin and then its argument prototype would still apply.  */
6617 char ldap_set_option();
6618
6619 int main() {
6620 ldap_set_option()
6621 ; return 0; }
6622 EOF
6623 if { (eval echo configure:6624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6624   rm -rf conftest*
6625   eval "ac_cv_lib_$ac_lib_var=yes"
6626 else
6627   echo "configure: failed program was:" >&5
6628   cat conftest.$ac_ext >&5
6629   rm -rf conftest*
6630   eval "ac_cv_lib_$ac_lib_var=no"
6631 fi
6632 rm -f conftest*
6633 xe_check_libs=""
6634
6635 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6636   echo "$ac_t""yes" 1>&6
6637   with_ns_ldap=yes
6638 else
6639   echo "$ac_t""no" 1>&6
6640 with_ns_ldap=no
6641 fi
6642
6643  }
6644   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6645 fi
6646 if test "$with_ldap" = "yes"; then
6647   { test "$extra_verbose" = "yes" && cat << \EOF
6648     Defining HAVE_LDAP
6649 EOF
6650 cat >> confdefs.h <<\EOF
6651 #define HAVE_LDAP 1
6652 EOF
6653 }
6654
6655   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6656    echo "    xemacs will be linked with \"eldap.o\""
6657  fi
6658   if test "$with_umich_ldap" = "yes" ; then
6659     { test "$extra_verbose" = "yes" && cat << \EOF
6660     Defining HAVE_UMICH_LDAP
6661 EOF
6662 cat >> confdefs.h <<\EOF
6663 #define HAVE_UMICH_LDAP 1
6664 EOF
6665 }
6666
6667     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6668     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6669   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6670     { test "$extra_verbose" = "yes" && cat << \EOF
6671     Defining HAVE_NS_LDAP
6672 EOF
6673 cat >> confdefs.h <<\EOF
6674 #define HAVE_NS_LDAP 1
6675 EOF
6676 }
6677
6678     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6679   elif test "$with_ldap" = "yes" ; then
6680     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6681   fi
6682 fi
6683
6684
6685 if test "$window_system" != "none"; then
6686   echo "checking for graphics libraries" 1>&6
6687 echo "configure:6688: checking for graphics libraries" >&5
6688
6689     xpm_problem=""
6690   if test -z "$with_xpm"; then
6691     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6692 echo "configure:6693: checking for Xpm - no older than 3.4f" >&5
6693     xe_check_libs=-lXpm
6694     cat > conftest.$ac_ext <<EOF
6695 #line 6696 "configure"
6696 #include "confdefs.h"
6697 #include <X11/xpm.h>
6698     int main(int c, char **v) {
6699     return c == 1 ? 0 :
6700       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6701       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6702 EOF
6703 if { (eval echo configure:6704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6704 then
6705   ./conftest dummy_arg; xpm_status=$?;
6706       if test "$xpm_status" = "0"; then
6707         with_xpm=yes;
6708       else
6709         with_xpm=no;
6710         if test "$xpm_status" = "1"; then
6711           xpm_problem="Xpm library version and header file version don't match!"
6712         elif test "$xpm_status" = "2"; then
6713           xpm_problem="Xpm library version is too old!"
6714         else
6715           xpm_problem="Internal xpm detection logic error!"
6716         fi
6717         echo "
6718 *** WARNING *** $xpm_problem
6719   I'm not touching that with a 10-foot pole!
6720   If you really want to use the installed version of Xpm, rerun
6721   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6722     fi
6723 else
6724   conftest_rc="$?"
6725   echo "configure: failed program was:" >&5
6726   cat conftest.$ac_ext >&5
6727   rm -fr conftest*
6728   with_xpm=no
6729 fi
6730 rm -fr conftest*
6731     xe_check_libs=
6732     echo "$ac_t""$with_xpm" 1>&6
6733   fi
6734   if test "$with_xpm" = "yes"; then
6735     { test "$extra_verbose" = "yes" && cat << \EOF
6736     Defining HAVE_XPM
6737 EOF
6738 cat >> confdefs.h <<\EOF
6739 #define HAVE_XPM 1
6740 EOF
6741 }
6742
6743     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6744     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6745 echo "configure:6746: checking for \"FOR_MSW\" xpm" >&5
6746     xe_check_libs=-lXpm
6747     cat > conftest.$ac_ext <<EOF
6748 #line 6749 "configure"
6749 #include "confdefs.h"
6750
6751 int main() {
6752 XpmCreatePixmapFromData()
6753 ; return 0; }
6754 EOF
6755 if { (eval echo configure:6756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6756   rm -rf conftest*
6757   xpm_for_msw=no
6758 else
6759   echo "configure: failed program was:" >&5
6760   cat conftest.$ac_ext >&5
6761   rm -rf conftest*
6762   xpm_for_msw=yes
6763 fi
6764 rm -f conftest*
6765     xe_check_libs=
6766     echo "$ac_t""$xpm_for_msw" 1>&6
6767     if test "$xpm_for_msw" = "yes"; then
6768       { test "$extra_verbose" = "yes" && cat << \EOF
6769     Defining FOR_MSW
6770 EOF
6771 cat >> confdefs.h <<\EOF
6772 #define FOR_MSW 1
6773 EOF
6774 }
6775
6776     fi
6777   fi
6778
6779     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6780 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6781 echo "configure:6782: checking for compface.h" >&5
6782
6783 cat > conftest.$ac_ext <<EOF
6784 #line 6785 "configure"
6785 #include "confdefs.h"
6786 #include <compface.h>
6787 EOF
6788 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6789 { (eval echo configure:6790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6790 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6791 if test -z "$ac_err"; then
6792   rm -rf conftest*
6793   eval "ac_cv_header_$ac_safe=yes"
6794 else
6795   echo "$ac_err" >&5
6796   echo "configure: failed program was:" >&5
6797   cat conftest.$ac_ext >&5
6798   rm -rf conftest*
6799   eval "ac_cv_header_$ac_safe=no"
6800 fi
6801 rm -f conftest*
6802 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6803   echo "$ac_t""yes" 1>&6
6804   :
6805 else
6806   echo "$ac_t""no" 1>&6
6807 with_xface=no
6808 fi
6809  }
6810   test -z "$with_xface" && { 
6811 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6812 echo "configure:6813: checking for UnGenFace in -lcompface" >&5
6813 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6814
6815 xe_check_libs=" -lcompface "
6816 cat > conftest.$ac_ext <<EOF
6817 #line 6818 "configure"
6818 #include "confdefs.h"
6819 /* Override any gcc2 internal prototype to avoid an error.  */
6820 /* We use char because int might match the return type of a gcc2
6821     builtin and then its argument prototype would still apply.  */
6822 char UnGenFace();
6823
6824 int main() {
6825 UnGenFace()
6826 ; return 0; }
6827 EOF
6828 if { (eval echo configure:6829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6829   rm -rf conftest*
6830   eval "ac_cv_lib_$ac_lib_var=yes"
6831 else
6832   echo "configure: failed program was:" >&5
6833   cat conftest.$ac_ext >&5
6834   rm -rf conftest*
6835   eval "ac_cv_lib_$ac_lib_var=no"
6836 fi
6837 rm -f conftest*
6838 xe_check_libs=""
6839
6840 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6841   echo "$ac_t""yes" 1>&6
6842   : 
6843 else
6844   echo "$ac_t""no" 1>&6
6845 with_xface=no
6846 fi
6847
6848  }
6849   test -z "$with_xface" && with_xface=yes
6850   if test "$with_xface" = "yes"; then
6851     { test "$extra_verbose" = "yes" && cat << \EOF
6852     Defining HAVE_XFACE
6853 EOF
6854 cat >> confdefs.h <<\EOF
6855 #define HAVE_XFACE 1
6856 EOF
6857 }
6858
6859     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
6860   fi
6861
6862         if test "$with_gif" != "no"; then
6863     with_gif="yes"
6864     { test "$extra_verbose" = "yes" && cat << \EOF
6865     Defining HAVE_GIF
6866 EOF
6867 cat >> confdefs.h <<\EOF
6868 #define HAVE_GIF 1
6869 EOF
6870 }
6871
6872     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6873    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6874  fi
6875   fi
6876
6877       if test "$with_png $with_tiff" != "no no"; then
6878     
6879 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6880 echo "configure:6881: checking for inflate in -lc" >&5
6881 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6882
6883 xe_check_libs=" -lc "
6884 cat > conftest.$ac_ext <<EOF
6885 #line 6886 "configure"
6886 #include "confdefs.h"
6887 /* Override any gcc2 internal prototype to avoid an error.  */
6888 /* We use char because int might match the return type of a gcc2
6889     builtin and then its argument prototype would still apply.  */
6890 char inflate();
6891
6892 int main() {
6893 inflate()
6894 ; return 0; }
6895 EOF
6896 if { (eval echo configure:6897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6897   rm -rf conftest*
6898   eval "ac_cv_lib_$ac_lib_var=yes"
6899 else
6900   echo "configure: failed program was:" >&5
6901   cat conftest.$ac_ext >&5
6902   rm -rf conftest*
6903   eval "ac_cv_lib_$ac_lib_var=no"
6904 fi
6905 rm -f conftest*
6906 xe_check_libs=""
6907
6908 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6909   echo "$ac_t""yes" 1>&6
6910   :
6911 else
6912   echo "$ac_t""no" 1>&6
6913
6914 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6915 echo "configure:6916: checking for inflate in -lz" >&5
6916 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6917
6918 xe_check_libs=" -lz "
6919 cat > conftest.$ac_ext <<EOF
6920 #line 6921 "configure"
6921 #include "confdefs.h"
6922 /* Override any gcc2 internal prototype to avoid an error.  */
6923 /* We use char because int might match the return type of a gcc2
6924     builtin and then its argument prototype would still apply.  */
6925 char inflate();
6926
6927 int main() {
6928 inflate()
6929 ; return 0; }
6930 EOF
6931 if { (eval echo configure:6932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6932   rm -rf conftest*
6933   eval "ac_cv_lib_$ac_lib_var=yes"
6934 else
6935   echo "configure: failed program was:" >&5
6936   cat conftest.$ac_ext >&5
6937   rm -rf conftest*
6938   eval "ac_cv_lib_$ac_lib_var=no"
6939 fi
6940 rm -f conftest*
6941 xe_check_libs=""
6942
6943 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6944   echo "$ac_t""yes" 1>&6
6945   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6946 else
6947   echo "$ac_t""no" 1>&6
6948
6949 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6950 echo "configure:6951: checking for inflate in -lgz" >&5
6951 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6952
6953 xe_check_libs=" -lgz "
6954 cat > conftest.$ac_ext <<EOF
6955 #line 6956 "configure"
6956 #include "confdefs.h"
6957 /* Override any gcc2 internal prototype to avoid an error.  */
6958 /* We use char because int might match the return type of a gcc2
6959     builtin and then its argument prototype would still apply.  */
6960 char inflate();
6961
6962 int main() {
6963 inflate()
6964 ; return 0; }
6965 EOF
6966 if { (eval echo configure:6967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6967   rm -rf conftest*
6968   eval "ac_cv_lib_$ac_lib_var=yes"
6969 else
6970   echo "configure: failed program was:" >&5
6971   cat conftest.$ac_ext >&5
6972   rm -rf conftest*
6973   eval "ac_cv_lib_$ac_lib_var=no"
6974 fi
6975 rm -f conftest*
6976 xe_check_libs=""
6977
6978 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6979   echo "$ac_t""yes" 1>&6
6980   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6981 else
6982   echo "$ac_t""no" 1>&6
6983 fi
6984
6985
6986 fi
6987
6988
6989 fi
6990
6991
6992   fi
6993
6994     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6995 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6996 echo "configure:6997: checking for jpeglib.h" >&5
6997
6998 cat > conftest.$ac_ext <<EOF
6999 #line 7000 "configure"
7000 #include "confdefs.h"
7001 #include <jpeglib.h>
7002 EOF
7003 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7004 { (eval echo configure:7005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7005 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7006 if test -z "$ac_err"; then
7007   rm -rf conftest*
7008   eval "ac_cv_header_$ac_safe=yes"
7009 else
7010   echo "$ac_err" >&5
7011   echo "configure: failed program was:" >&5
7012   cat conftest.$ac_ext >&5
7013   rm -rf conftest*
7014   eval "ac_cv_header_$ac_safe=no"
7015 fi
7016 rm -f conftest*
7017 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7018   echo "$ac_t""yes" 1>&6
7019   :
7020 else
7021   echo "$ac_t""no" 1>&6
7022 with_jpeg=no
7023 fi
7024  }
7025   test -z "$with_jpeg" && { 
7026 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7027 echo "configure:7028: checking for jpeg_destroy_decompress in -ljpeg" >&5
7028 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7029
7030 xe_check_libs=" -ljpeg "
7031 cat > conftest.$ac_ext <<EOF
7032 #line 7033 "configure"
7033 #include "confdefs.h"
7034 /* Override any gcc2 internal prototype to avoid an error.  */
7035 /* We use char because int might match the return type of a gcc2
7036     builtin and then its argument prototype would still apply.  */
7037 char jpeg_destroy_decompress();
7038
7039 int main() {
7040 jpeg_destroy_decompress()
7041 ; return 0; }
7042 EOF
7043 if { (eval echo configure:7044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7044   rm -rf conftest*
7045   eval "ac_cv_lib_$ac_lib_var=yes"
7046 else
7047   echo "configure: failed program was:" >&5
7048   cat conftest.$ac_ext >&5
7049   rm -rf conftest*
7050   eval "ac_cv_lib_$ac_lib_var=no"
7051 fi
7052 rm -f conftest*
7053 xe_check_libs=""
7054
7055 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7056   echo "$ac_t""yes" 1>&6
7057   :
7058 else
7059   echo "$ac_t""no" 1>&6
7060 with_jpeg=no
7061 fi
7062
7063  }
7064   test -z "$with_jpeg" && with_jpeg=yes
7065   if test "$with_jpeg" = "yes"; then
7066     { test "$extra_verbose" = "yes" && cat << \EOF
7067     Defining HAVE_JPEG
7068 EOF
7069 cat >> confdefs.h <<\EOF
7070 #define HAVE_JPEG 1
7071 EOF
7072 }
7073
7074     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7075   fi
7076
7077     png_problem=""
7078   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7079 echo "configure:7080: checking for pow" >&5
7080
7081 cat > conftest.$ac_ext <<EOF
7082 #line 7083 "configure"
7083 #include "confdefs.h"
7084 /* System header to define __stub macros and hopefully few prototypes,
7085     which can conflict with char pow(); below.  */
7086 #include <assert.h>
7087 /* Override any gcc2 internal prototype to avoid an error.  */
7088 /* We use char because int might match the return type of a gcc2
7089     builtin and then its argument prototype would still apply.  */
7090 char pow();
7091
7092 int main() {
7093
7094 /* The GNU C library defines this for functions which it implements
7095     to always fail with ENOSYS.  Some functions are actually named
7096     something starting with __ and the normal name is an alias.  */
7097 #if defined (__stub_pow) || defined (__stub___pow)
7098 choke me
7099 #else
7100 pow();
7101 #endif
7102
7103 ; return 0; }
7104 EOF
7105 if { (eval echo configure:7106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7106   rm -rf conftest*
7107   eval "ac_cv_func_pow=yes"
7108 else
7109   echo "configure: failed program was:" >&5
7110   cat conftest.$ac_ext >&5
7111   rm -rf conftest*
7112   eval "ac_cv_func_pow=no"
7113 fi
7114 rm -f conftest*
7115
7116 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7117   echo "$ac_t""yes" 1>&6
7118   :
7119 else
7120   echo "$ac_t""no" 1>&6
7121 with_png=no
7122 fi
7123  }
7124   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7125 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7126 echo "configure:7127: checking for png.h" >&5
7127
7128 cat > conftest.$ac_ext <<EOF
7129 #line 7130 "configure"
7130 #include "confdefs.h"
7131 #include <png.h>
7132 EOF
7133 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7134 { (eval echo configure:7135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7135 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7136 if test -z "$ac_err"; then
7137   rm -rf conftest*
7138   eval "ac_cv_header_$ac_safe=yes"
7139 else
7140   echo "$ac_err" >&5
7141   echo "configure: failed program was:" >&5
7142   cat conftest.$ac_ext >&5
7143   rm -rf conftest*
7144   eval "ac_cv_header_$ac_safe=no"
7145 fi
7146 rm -f conftest*
7147 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7148   echo "$ac_t""yes" 1>&6
7149   :
7150 else
7151   echo "$ac_t""no" 1>&6
7152 with_png=no
7153 fi
7154  }
7155   test -z "$with_png" && { 
7156 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7157 echo "configure:7158: checking for png_read_image in -lpng" >&5
7158 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7159
7160 xe_check_libs=" -lpng "
7161 cat > conftest.$ac_ext <<EOF
7162 #line 7163 "configure"
7163 #include "confdefs.h"
7164 /* Override any gcc2 internal prototype to avoid an error.  */
7165 /* We use char because int might match the return type of a gcc2
7166     builtin and then its argument prototype would still apply.  */
7167 char png_read_image();
7168
7169 int main() {
7170 png_read_image()
7171 ; return 0; }
7172 EOF
7173 if { (eval echo configure:7174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7174   rm -rf conftest*
7175   eval "ac_cv_lib_$ac_lib_var=yes"
7176 else
7177   echo "configure: failed program was:" >&5
7178   cat conftest.$ac_ext >&5
7179   rm -rf conftest*
7180   eval "ac_cv_lib_$ac_lib_var=no"
7181 fi
7182 rm -f conftest*
7183 xe_check_libs=""
7184
7185 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7186   echo "$ac_t""yes" 1>&6
7187   :
7188 else
7189   echo "$ac_t""no" 1>&6
7190 with_png=no
7191 fi
7192
7193  }
7194   if test -z "$with_png"; then
7195     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7196 echo "configure:7197: checking for workable png version information" >&5
7197     xe_check_libs="-lpng -lz"
7198     cat > conftest.$ac_ext <<EOF
7199 #line 7200 "configure"
7200 #include "confdefs.h"
7201 #include <png.h>
7202     int main(int c, char **v) {
7203     if (c == 1) return 0;
7204     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7205     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7206 EOF
7207 if { (eval echo configure:7208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7208 then
7209   ./conftest dummy_arg; png_status=$?;
7210       if test "$png_status" = "0"; then
7211         with_png=yes;
7212       else
7213         with_png=no;
7214         if test "$png_status" = "1"; then
7215           png_problem="PNG library version and header file don't match!"
7216         elif test "$png_status" = "2"; then
7217           png_problem="PNG library version too old (pre 1.0.2)!"
7218         fi
7219         echo "
7220 *** WARNING *** $png_problem
7221   I'm not touching that with a 10-foot pole!
7222   If you really want to use the installed version of libPNG, rerun
7223   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7224     fi
7225 else
7226   conftest_rc="$?"
7227   echo "configure: failed program was:" >&5
7228   cat conftest.$ac_ext >&5
7229   rm -fr conftest*
7230   with_png=no
7231 fi
7232 rm -fr conftest*
7233     xe_check_libs=
7234     echo "$ac_t""$with_png" 1>&6
7235   fi
7236   if test "$with_png" = "yes"; then
7237     { test "$extra_verbose" = "yes" && cat << \EOF
7238     Defining HAVE_PNG
7239 EOF
7240 cat >> confdefs.h <<\EOF
7241 #define HAVE_PNG 1
7242 EOF
7243 }
7244
7245     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7246   fi
7247
7248     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7249 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7250 echo "configure:7251: checking for tiffio.h" >&5
7251
7252 cat > conftest.$ac_ext <<EOF
7253 #line 7254 "configure"
7254 #include "confdefs.h"
7255 #include <tiffio.h>
7256 EOF
7257 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7258 { (eval echo configure:7259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7259 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7260 if test -z "$ac_err"; then
7261   rm -rf conftest*
7262   eval "ac_cv_header_$ac_safe=yes"
7263 else
7264   echo "$ac_err" >&5
7265   echo "configure: failed program was:" >&5
7266   cat conftest.$ac_ext >&5
7267   rm -rf conftest*
7268   eval "ac_cv_header_$ac_safe=no"
7269 fi
7270 rm -f conftest*
7271 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7272   echo "$ac_t""yes" 1>&6
7273   :
7274 else
7275   echo "$ac_t""no" 1>&6
7276 with_tiff=no
7277 fi
7278  }
7279   test -z "$with_tiff" && { 
7280 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7281 echo "configure:7282: checking for TIFFClientOpen in -ltiff" >&5
7282 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7283
7284 xe_check_libs=" -ltiff "
7285 cat > conftest.$ac_ext <<EOF
7286 #line 7287 "configure"
7287 #include "confdefs.h"
7288 /* Override any gcc2 internal prototype to avoid an error.  */
7289 /* We use char because int might match the return type of a gcc2
7290     builtin and then its argument prototype would still apply.  */
7291 char TIFFClientOpen();
7292
7293 int main() {
7294 TIFFClientOpen()
7295 ; return 0; }
7296 EOF
7297 if { (eval echo configure:7298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7298   rm -rf conftest*
7299   eval "ac_cv_lib_$ac_lib_var=yes"
7300 else
7301   echo "configure: failed program was:" >&5
7302   cat conftest.$ac_ext >&5
7303   rm -rf conftest*
7304   eval "ac_cv_lib_$ac_lib_var=no"
7305 fi
7306 rm -f conftest*
7307 xe_check_libs=""
7308
7309 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7310   echo "$ac_t""yes" 1>&6
7311   :
7312 else
7313   echo "$ac_t""no" 1>&6
7314 with_tiff=no
7315 fi
7316
7317  }
7318   test -z "$with_tiff" && with_tiff=yes
7319   if test "$with_tiff" = "yes"; then
7320     { test "$extra_verbose" = "yes" && cat << \EOF
7321     Defining HAVE_TIFF
7322 EOF
7323 cat >> confdefs.h <<\EOF
7324 #define HAVE_TIFF 1
7325 EOF
7326 }
7327
7328     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7329   fi
7330 fi
7331
7332
7333 if test "$with_x11" = "yes"; then
7334
7335   echo "checking for X11 graphics libraries" 1>&6
7336 echo "configure:7337: checking for X11 graphics libraries" >&5
7337
7338     
7339 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7340 echo "configure:7341: checking for XawScrollbarSetThumb in -lXaw" >&5
7341 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7342
7343 xe_check_libs=" -lXaw "
7344 cat > conftest.$ac_ext <<EOF
7345 #line 7346 "configure"
7346 #include "confdefs.h"
7347 /* Override any gcc2 internal prototype to avoid an error.  */
7348 /* We use char because int might match the return type of a gcc2
7349     builtin and then its argument prototype would still apply.  */
7350 char XawScrollbarSetThumb();
7351
7352 int main() {
7353 XawScrollbarSetThumb()
7354 ; return 0; }
7355 EOF
7356 if { (eval echo configure:7357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7357   rm -rf conftest*
7358   eval "ac_cv_lib_$ac_lib_var=yes"
7359 else
7360   echo "configure: failed program was:" >&5
7361   cat conftest.$ac_ext >&5
7362   rm -rf conftest*
7363   eval "ac_cv_lib_$ac_lib_var=no"
7364 fi
7365 rm -f conftest*
7366 xe_check_libs=""
7367
7368 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7369   echo "$ac_t""yes" 1>&6
7370   have_xaw=yes
7371 else
7372   echo "$ac_t""no" 1>&6
7373 have_xaw=no
7374 fi
7375
7376
7377                     
7378     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7379 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7380 echo "configure:7381: checking for Xm/Xm.h" >&5
7381
7382 cat > conftest.$ac_ext <<EOF
7383 #line 7384 "configure"
7384 #include "confdefs.h"
7385 #include <Xm/Xm.h>
7386 EOF
7387 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7388 { (eval echo configure:7389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7389 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7390 if test -z "$ac_err"; then
7391   rm -rf conftest*
7392   eval "ac_cv_header_$ac_safe=yes"
7393 else
7394   echo "$ac_err" >&5
7395   echo "configure: failed program was:" >&5
7396   cat conftest.$ac_ext >&5
7397   rm -rf conftest*
7398   eval "ac_cv_header_$ac_safe=no"
7399 fi
7400 rm -f conftest*
7401 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7402   echo "$ac_t""yes" 1>&6
7403   
7404 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7405 echo "configure:7406: checking for XmStringFree in -lXm" >&5
7406 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7407
7408 xe_check_libs=" -lXm "
7409 cat > conftest.$ac_ext <<EOF
7410 #line 7411 "configure"
7411 #include "confdefs.h"
7412 /* Override any gcc2 internal prototype to avoid an error.  */
7413 /* We use char because int might match the return type of a gcc2
7414     builtin and then its argument prototype would still apply.  */
7415 char XmStringFree();
7416
7417 int main() {
7418 XmStringFree()
7419 ; return 0; }
7420 EOF
7421 if { (eval echo configure:7422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7422   rm -rf conftest*
7423   eval "ac_cv_lib_$ac_lib_var=yes"
7424 else
7425   echo "configure: failed program was:" >&5
7426   cat conftest.$ac_ext >&5
7427   rm -rf conftest*
7428   eval "ac_cv_lib_$ac_lib_var=no"
7429 fi
7430 rm -f conftest*
7431 xe_check_libs=""
7432
7433 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7434   echo "$ac_t""yes" 1>&6
7435   have_motif=yes
7436 else
7437   echo "$ac_t""no" 1>&6
7438 have_motif=no
7439 fi
7440
7441
7442 else
7443   echo "$ac_t""no" 1>&6
7444 have_motif=no
7445 fi
7446
7447
7448   if test "$have_motif" = "yes"; then
7449         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7450 echo "configure:7451: checking for Lesstif" >&5
7451     cat > conftest.$ac_ext <<EOF
7452 #line 7453 "configure"
7453 #include "confdefs.h"
7454 #include <Xm/Xm.h>
7455 #ifdef LESSTIF_VERSION
7456 yes
7457 #endif
7458
7459 EOF
7460 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7461   egrep "yes" >/dev/null 2>&1; then
7462   rm -rf conftest*
7463   have_lesstif=yes
7464 else
7465   rm -rf conftest*
7466   have_lesstif=no
7467 fi
7468 rm -f conftest*
7469
7470   echo "$ac_t""$have_lesstif" 1>&6
7471   fi
7472
7473 fi 
7474
7475 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7476   with_menubars="lucid" ;;
7477 esac
7478 case "$with_dialogs" in "" | "yes" | "lucid" )
7479   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7480   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7481   else with_dialogs=no
7482   fi ;;
7483 esac
7484 case "$with_scrollbars" in "" | "yes" )
7485   with_scrollbars="lucid" ;;
7486 esac
7487
7488 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7489
7490 case "$all_widgets" in *athena* )
7491   { test "$extra_verbose" = "yes" && cat << \EOF
7492     Defining LWLIB_USES_ATHENA
7493 EOF
7494 cat >> confdefs.h <<\EOF
7495 #define LWLIB_USES_ATHENA 1
7496 EOF
7497 }
7498
7499   { test "$extra_verbose" = "yes" && cat << \EOF
7500     Defining NEED_ATHENA
7501 EOF
7502 cat >> confdefs.h <<\EOF
7503 #define NEED_ATHENA 1
7504 EOF
7505 }
7506
7507   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7508   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7509 esac
7510
7511 case "$all_widgets" in *motif* )
7512   { test "$extra_verbose" = "yes" && cat << \EOF
7513     Defining LWLIB_USES_MOTIF
7514 EOF
7515 cat >> confdefs.h <<\EOF
7516 #define LWLIB_USES_MOTIF 1
7517 EOF
7518 }
7519
7520   { test "$extra_verbose" = "yes" && cat << \EOF
7521     Defining NEED_MOTIF
7522 EOF
7523 cat >> confdefs.h <<\EOF
7524 #define NEED_MOTIF 1
7525 EOF
7526 }
7527
7528   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7529   need_motif=yes ;;
7530 esac
7531
7532 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7533 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7534 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7535 case "$all_widgets" in *lucid* )
7536   { test "$extra_verbose" = "yes" && cat << \EOF
7537     Defining NEED_LUCID
7538 EOF
7539 cat >> confdefs.h <<\EOF
7540 #define NEED_LUCID 1
7541 EOF
7542 }
7543
7544   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7545 esac
7546
7547
7548
7549 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7550     Defining LWLIB_SCROLLBARS_ATHENA
7551 EOF
7552 cat >> confdefs.h <<\EOF
7553 #define LWLIB_SCROLLBARS_ATHENA 1
7554 EOF
7555 }
7556 ;; esac
7557 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7558     Defining LWLIB_DIALOGS_ATHENA
7559 EOF
7560 cat >> confdefs.h <<\EOF
7561 #define LWLIB_DIALOGS_ATHENA 1
7562 EOF
7563 }
7564    ;; esac
7565 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7566     Defining LWLIB_SCROLLBARS_ATHENA3D
7567 EOF
7568 cat >> confdefs.h <<\EOF
7569 #define LWLIB_SCROLLBARS_ATHENA3D 1
7570 EOF
7571 }
7572
7573 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7574     Defining LWLIB_DIALOGS_ATHENA3D
7575 EOF
7576 cat >> confdefs.h <<\EOF
7577 #define LWLIB_DIALOGS_ATHENA3D 1
7578 EOF
7579 }
7580
7581
7582 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7583     Defining HAVE_MENUBARS
7584 EOF
7585 cat >> confdefs.h <<\EOF
7586 #define HAVE_MENUBARS 1
7587 EOF
7588 }
7589
7590 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7591     Defining HAVE_SCROLLBARS
7592 EOF
7593 cat >> confdefs.h <<\EOF
7594 #define HAVE_SCROLLBARS 1
7595 EOF
7596 }
7597
7598 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7599     Defining HAVE_DIALOGS
7600 EOF
7601 cat >> confdefs.h <<\EOF
7602 #define HAVE_DIALOGS 1
7603 EOF
7604 }
7605
7606 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7607     Defining HAVE_TOOLBARS
7608 EOF
7609 cat >> confdefs.h <<\EOF
7610 #define HAVE_TOOLBARS 1
7611 EOF
7612 }
7613
7614
7615 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7616     Defining LWLIB_MENUBARS_LUCID
7617 EOF
7618 cat >> confdefs.h <<\EOF
7619 #define LWLIB_MENUBARS_LUCID 1
7620 EOF
7621 }
7622
7623 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7624     Defining LWLIB_SCROLLBARS_LUCID
7625 EOF
7626 cat >> confdefs.h <<\EOF
7627 #define LWLIB_SCROLLBARS_LUCID 1
7628 EOF
7629 }
7630
7631
7632 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7633     Defining LWLIB_MENUBARS_MOTIF
7634 EOF
7635 cat >> confdefs.h <<\EOF
7636 #define LWLIB_MENUBARS_MOTIF 1
7637 EOF
7638 }
7639
7640 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7641     Defining LWLIB_SCROLLBARS_MOTIF
7642 EOF
7643 cat >> confdefs.h <<\EOF
7644 #define LWLIB_SCROLLBARS_MOTIF 1
7645 EOF
7646 }
7647
7648 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7649     Defining LWLIB_DIALOGS_MOTIF
7650 EOF
7651 cat >> confdefs.h <<\EOF
7652 #define LWLIB_DIALOGS_MOTIF 1
7653 EOF
7654 }
7655
7656
7657 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7658    echo "    xemacs will be linked with \"menubar.o\""
7659  fi
7660 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7661    echo "    xemacs will be linked with \"scrollbar.o\""
7662  fi
7663 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7664    echo "    xemacs will be linked with \"dialog.o\""
7665  fi
7666 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7667    echo "    xemacs will be linked with \"toolbar.o\""
7668  fi
7669
7670 if test "$with_x11" = "yes"; then
7671   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7672    echo "    xemacs will be linked with \"menubar-x.o\""
7673  fi
7674   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7675    echo "    xemacs will be linked with \"scrollbar-x.o\""
7676  fi
7677   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7678    echo "    xemacs will be linked with \"dialog-x.o\""
7679  fi
7680   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7681    echo "    xemacs will be linked with \"toolbar-x.o\""
7682  fi
7683   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7684    echo "    xemacs will be linked with \"gui-x.o\""
7685  fi
7686 else
7687   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7688     echo "Attempt to Build NAS sound without X"
7689     echo "Please remove NAS configuration or build with X"
7690     exit 1
7691   fi
7692 fi
7693
7694
7695 test -z "$with_mule" && with_mule=no
7696 test -z "$with_file_coding" && with_file_coding=no
7697
7698
7699 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7700   { test "$extra_verbose" = "yes" && cat << \EOF
7701     Defining FILE_CODING
7702 EOF
7703 cat >> confdefs.h <<\EOF
7704 #define FILE_CODING 1
7705 EOF
7706 }
7707
7708   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7709    echo "    xemacs will be linked with \"file-coding.o\""
7710  fi
7711 fi
7712
7713 if test "$with_mule" = "yes" ; then
7714   echo "checking for Mule-related features" 1>&6
7715 echo "configure:7716: checking for Mule-related features" >&5
7716   { test "$extra_verbose" = "yes" && cat << \EOF
7717     Defining MULE
7718 EOF
7719 cat >> confdefs.h <<\EOF
7720 #define MULE 1
7721 EOF
7722 }
7723
7724   { test "$extra_verbose" = "yes" && cat << \EOF
7725     Defining FILE_CODING
7726 EOF
7727 cat >> confdefs.h <<\EOF
7728 #define FILE_CODING 1
7729 EOF
7730 }
7731
7732   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7733    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7734  fi
7735
7736     for ac_hdr in libintl.h
7737 do
7738 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7739 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7740 echo "configure:7741: checking for $ac_hdr" >&5
7741
7742 cat > conftest.$ac_ext <<EOF
7743 #line 7744 "configure"
7744 #include "confdefs.h"
7745 #include <$ac_hdr>
7746 EOF
7747 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7748 { (eval echo configure:7749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7749 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7750 if test -z "$ac_err"; then
7751   rm -rf conftest*
7752   eval "ac_cv_header_$ac_safe=yes"
7753 else
7754   echo "$ac_err" >&5
7755   echo "configure: failed program was:" >&5
7756   cat conftest.$ac_ext >&5
7757   rm -rf conftest*
7758   eval "ac_cv_header_$ac_safe=no"
7759 fi
7760 rm -f conftest*
7761 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7762   echo "$ac_t""yes" 1>&6
7763     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7764   { test "$extra_verbose" = "yes" && cat << EOF
7765     Defining $ac_tr_hdr
7766 EOF
7767 cat >> confdefs.h <<EOF
7768 #define $ac_tr_hdr 1
7769 EOF
7770 }
7771  
7772 else
7773   echo "$ac_t""no" 1>&6
7774 fi
7775 done
7776
7777   
7778 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7779 echo "configure:7780: checking for strerror in -lintl" >&5
7780 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7781
7782 xe_check_libs=" -lintl "
7783 cat > conftest.$ac_ext <<EOF
7784 #line 7785 "configure"
7785 #include "confdefs.h"
7786 /* Override any gcc2 internal prototype to avoid an error.  */
7787 /* We use char because int might match the return type of a gcc2
7788     builtin and then its argument prototype would still apply.  */
7789 char strerror();
7790
7791 int main() {
7792 strerror()
7793 ; return 0; }
7794 EOF
7795 if { (eval echo configure:7796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7796   rm -rf conftest*
7797   eval "ac_cv_lib_$ac_lib_var=yes"
7798 else
7799   echo "configure: failed program was:" >&5
7800   cat conftest.$ac_ext >&5
7801   rm -rf conftest*
7802   eval "ac_cv_lib_$ac_lib_var=no"
7803 fi
7804 rm -f conftest*
7805 xe_check_libs=""
7806
7807 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7808   echo "$ac_t""yes" 1>&6
7809     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7810     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7811   { test "$extra_verbose" = "yes" && cat << EOF
7812     Defining $ac_tr_lib
7813 EOF
7814 cat >> confdefs.h <<EOF
7815 #define $ac_tr_lib 1
7816 EOF
7817 }
7818
7819   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7820
7821 else
7822   echo "$ac_t""no" 1>&6
7823 fi
7824
7825
7826
7827   echo "checking for Mule input methods" 1>&6
7828 echo "configure:7829: checking for Mule input methods" >&5
7829         case "$with_xim" in "" | "yes" )
7830     echo "checking for XIM" 1>&6
7831 echo "configure:7832: checking for XIM" >&5
7832     
7833 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
7834 echo "configure:7835: checking for XOpenIM in -lX11" >&5
7835 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
7836
7837 xe_check_libs=" -lX11 "
7838 cat > conftest.$ac_ext <<EOF
7839 #line 7840 "configure"
7840 #include "confdefs.h"
7841 /* Override any gcc2 internal prototype to avoid an error.  */
7842 /* We use char because int might match the return type of a gcc2
7843     builtin and then its argument prototype would still apply.  */
7844 char XOpenIM();
7845
7846 int main() {
7847 XOpenIM()
7848 ; return 0; }
7849 EOF
7850 if { (eval echo configure:7851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7851   rm -rf conftest*
7852   eval "ac_cv_lib_$ac_lib_var=yes"
7853 else
7854   echo "configure: failed program was:" >&5
7855   cat conftest.$ac_ext >&5
7856   rm -rf conftest*
7857   eval "ac_cv_lib_$ac_lib_var=no"
7858 fi
7859 rm -f conftest*
7860 xe_check_libs=""
7861
7862 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7863   echo "$ac_t""yes" 1>&6
7864   with_xim=xlib
7865 else
7866   echo "$ac_t""no" 1>&6
7867 with_xim=no
7868 fi
7869
7870
7871         if test "$have_motif $have_lesstif" = "yes no"; then
7872       
7873 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7874 echo "configure:7875: checking for XmImMbLookupString in -lXm" >&5
7875 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7876
7877 xe_check_libs=" -lXm "
7878 cat > conftest.$ac_ext <<EOF
7879 #line 7880 "configure"
7880 #include "confdefs.h"
7881 /* Override any gcc2 internal prototype to avoid an error.  */
7882 /* We use char because int might match the return type of a gcc2
7883     builtin and then its argument prototype would still apply.  */
7884 char XmImMbLookupString();
7885
7886 int main() {
7887 XmImMbLookupString()
7888 ; return 0; }
7889 EOF
7890 if { (eval echo configure:7891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7891   rm -rf conftest*
7892   eval "ac_cv_lib_$ac_lib_var=yes"
7893 else
7894   echo "configure: failed program was:" >&5
7895   cat conftest.$ac_ext >&5
7896   rm -rf conftest*
7897   eval "ac_cv_lib_$ac_lib_var=no"
7898 fi
7899 rm -f conftest*
7900 xe_check_libs=""
7901
7902 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7903   echo "$ac_t""yes" 1>&6
7904   with_xim=motif
7905 else
7906   echo "$ac_t""no" 1>&6
7907 fi
7908
7909
7910     fi ;;
7911   esac
7912   if test "$with_xim" != "no"; then
7913     { test "$extra_verbose" = "yes" && cat << \EOF
7914     Defining HAVE_XIM
7915 EOF
7916 cat >> confdefs.h <<\EOF
7917 #define HAVE_XIM 1
7918 EOF
7919 }
7920
7921     if test "$with_xim" = "xlib"; then
7922       { test "$extra_verbose" = "yes" && cat << \EOF
7923     Defining XIM_XLIB
7924 EOF
7925 cat >> confdefs.h <<\EOF
7926 #define XIM_XLIB 1
7927 EOF
7928 }
7929
7930       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7931    echo "    xemacs will be linked with \"input-method-xlib.o\""
7932  fi
7933     fi
7934     if test "$with_xim" = "motif"; then
7935       { test "$extra_verbose" = "yes" && cat << \EOF
7936     Defining XIM_MOTIF
7937 EOF
7938 cat >> confdefs.h <<\EOF
7939 #define XIM_MOTIF 1
7940 EOF
7941 }
7942
7943       need_motif=yes
7944       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7945    echo "    xemacs will be linked with \"input-method-motif.o\""
7946  fi
7947     fi
7948     if test "$with_xim" = "motif"; then
7949       with_xfs=no
7950     fi
7951   fi
7952
7953     if test "$with_xfs" = "yes" ; then
7954     echo "checking for XFontSet" 1>&6
7955 echo "configure:7956: checking for XFontSet" >&5
7956     
7957 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7958 echo "configure:7959: checking for XmbDrawString in -lX11" >&5
7959 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7960
7961 xe_check_libs=" -lX11 "
7962 cat > conftest.$ac_ext <<EOF
7963 #line 7964 "configure"
7964 #include "confdefs.h"
7965 /* Override any gcc2 internal prototype to avoid an error.  */
7966 /* We use char because int might match the return type of a gcc2
7967     builtin and then its argument prototype would still apply.  */
7968 char XmbDrawString();
7969
7970 int main() {
7971 XmbDrawString()
7972 ; return 0; }
7973 EOF
7974 if { (eval echo configure:7975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7975   rm -rf conftest*
7976   eval "ac_cv_lib_$ac_lib_var=yes"
7977 else
7978   echo "configure: failed program was:" >&5
7979   cat conftest.$ac_ext >&5
7980   rm -rf conftest*
7981   eval "ac_cv_lib_$ac_lib_var=no"
7982 fi
7983 rm -f conftest*
7984 xe_check_libs=""
7985
7986 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7987   echo "$ac_t""yes" 1>&6
7988   :
7989 else
7990   echo "$ac_t""no" 1>&6
7991 with_xfs=no
7992 fi
7993
7994
7995     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7996       { test "$extra_verbose" = "yes" && cat << \EOF
7997     Defining USE_XFONTSET
7998 EOF
7999 cat >> confdefs.h <<\EOF
8000 #define USE_XFONTSET 1
8001 EOF
8002 }
8003
8004       if test "$with_xim" = "no" ; then
8005         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
8006    echo "    xemacs will be linked with \"input-method-xfs.o\""
8007  fi
8008       fi
8009     fi
8010   fi 
8011     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
8012   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
8013 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
8014 echo "configure:8015: checking for wnn/jllib.h" >&5
8015
8016 cat > conftest.$ac_ext <<EOF
8017 #line 8018 "configure"
8018 #include "confdefs.h"
8019 #include <wnn/jllib.h>
8020 EOF
8021 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8022 { (eval echo configure:8023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8023 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8024 if test -z "$ac_err"; then
8025   rm -rf conftest*
8026   eval "ac_cv_header_$ac_safe=yes"
8027 else
8028   echo "$ac_err" >&5
8029   echo "configure: failed program was:" >&5
8030   cat conftest.$ac_ext >&5
8031   rm -rf conftest*
8032   eval "ac_cv_header_$ac_safe=no"
8033 fi
8034 rm -f conftest*
8035 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8036   echo "$ac_t""yes" 1>&6
8037   :
8038 else
8039   echo "$ac_t""no" 1>&6
8040 with_wnn=no
8041 fi
8042  }
8043     if test "$with_wnn" != "no"; then
8044     for ac_func in crypt
8045 do
8046 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8047 echo "configure:8048: checking for $ac_func" >&5
8048
8049 cat > conftest.$ac_ext <<EOF
8050 #line 8051 "configure"
8051 #include "confdefs.h"
8052 /* System header to define __stub macros and hopefully few prototypes,
8053     which can conflict with char $ac_func(); below.  */
8054 #include <assert.h>
8055 /* Override any gcc2 internal prototype to avoid an error.  */
8056 /* We use char because int might match the return type of a gcc2
8057     builtin and then its argument prototype would still apply.  */
8058 char $ac_func();
8059
8060 int main() {
8061
8062 /* The GNU C library defines this for functions which it implements
8063     to always fail with ENOSYS.  Some functions are actually named
8064     something starting with __ and the normal name is an alias.  */
8065 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8066 choke me
8067 #else
8068 $ac_func();
8069 #endif
8070
8071 ; return 0; }
8072 EOF
8073 if { (eval echo configure:8074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8074   rm -rf conftest*
8075   eval "ac_cv_func_$ac_func=yes"
8076 else
8077   echo "configure: failed program was:" >&5
8078   cat conftest.$ac_ext >&5
8079   rm -rf conftest*
8080   eval "ac_cv_func_$ac_func=no"
8081 fi
8082 rm -f conftest*
8083
8084 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8085   echo "$ac_t""yes" 1>&6
8086     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8087   { test "$extra_verbose" = "yes" && cat << EOF
8088     Defining $ac_tr_func
8089 EOF
8090 cat >> confdefs.h <<EOF
8091 #define $ac_tr_func 1
8092 EOF
8093 }
8094  
8095 else
8096   echo "$ac_t""no" 1>&6
8097 fi
8098 done
8099
8100     test "$ac_cv_func_crypt" != "yes" && { 
8101 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
8102 echo "configure:8103: checking for crypt in -lcrypt" >&5
8103 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
8104
8105 xe_check_libs=" -lcrypt "
8106 cat > conftest.$ac_ext <<EOF
8107 #line 8108 "configure"
8108 #include "confdefs.h"
8109 /* Override any gcc2 internal prototype to avoid an error.  */
8110 /* We use char because int might match the return type of a gcc2
8111     builtin and then its argument prototype would still apply.  */
8112 char crypt();
8113
8114 int main() {
8115 crypt()
8116 ; return 0; }
8117 EOF
8118 if { (eval echo configure:8119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8119   rm -rf conftest*
8120   eval "ac_cv_lib_$ac_lib_var=yes"
8121 else
8122   echo "configure: failed program was:" >&5
8123   cat conftest.$ac_ext >&5
8124   rm -rf conftest*
8125   eval "ac_cv_lib_$ac_lib_var=no"
8126 fi
8127 rm -f conftest*
8128 xe_check_libs=""
8129
8130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8131   echo "$ac_t""yes" 1>&6
8132     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8133     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8134   { test "$extra_verbose" = "yes" && cat << EOF
8135     Defining $ac_tr_lib
8136 EOF
8137 cat >> confdefs.h <<EOF
8138 #define $ac_tr_lib 1
8139 EOF
8140 }
8141
8142   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
8143
8144 else
8145   echo "$ac_t""no" 1>&6
8146 fi
8147
8148  }
8149   fi
8150     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8151     
8152 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8153 echo "configure:8154: checking for jl_dic_list_e in -lwnn" >&5
8154 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8155
8156 xe_check_libs=" -lwnn "
8157 cat > conftest.$ac_ext <<EOF
8158 #line 8159 "configure"
8159 #include "confdefs.h"
8160 /* Override any gcc2 internal prototype to avoid an error.  */
8161 /* We use char because int might match the return type of a gcc2
8162     builtin and then its argument prototype would still apply.  */
8163 char jl_dic_list_e();
8164
8165 int main() {
8166 jl_dic_list_e()
8167 ; return 0; }
8168 EOF
8169 if { (eval echo configure:8170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8170   rm -rf conftest*
8171   eval "ac_cv_lib_$ac_lib_var=yes"
8172 else
8173   echo "configure: failed program was:" >&5
8174   cat conftest.$ac_ext >&5
8175   rm -rf conftest*
8176   eval "ac_cv_lib_$ac_lib_var=no"
8177 fi
8178 rm -f conftest*
8179 xe_check_libs=""
8180
8181 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8182   echo "$ac_t""yes" 1>&6
8183   libwnn=wnn
8184 else
8185   echo "$ac_t""no" 1>&6
8186 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8187 echo "configure:8188: checking for jl_dic_list_e in -lwnn4" >&5
8188 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8189
8190 xe_check_libs=" -lwnn4 "
8191 cat > conftest.$ac_ext <<EOF
8192 #line 8193 "configure"
8193 #include "confdefs.h"
8194 /* Override any gcc2 internal prototype to avoid an error.  */
8195 /* We use char because int might match the return type of a gcc2
8196     builtin and then its argument prototype would still apply.  */
8197 char jl_dic_list_e();
8198
8199 int main() {
8200 jl_dic_list_e()
8201 ; return 0; }
8202 EOF
8203 if { (eval echo configure:8204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8204   rm -rf conftest*
8205   eval "ac_cv_lib_$ac_lib_var=yes"
8206 else
8207   echo "configure: failed program was:" >&5
8208   cat conftest.$ac_ext >&5
8209   rm -rf conftest*
8210   eval "ac_cv_lib_$ac_lib_var=no"
8211 fi
8212 rm -f conftest*
8213 xe_check_libs=""
8214
8215 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8216   echo "$ac_t""yes" 1>&6
8217   libwnn=wnn4
8218 else
8219   echo "$ac_t""no" 1>&6
8220 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8221 echo "configure:8222: checking for jl_dic_list_e in -lwnn6" >&5
8222 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8223
8224 xe_check_libs=" -lwnn6 "
8225 cat > conftest.$ac_ext <<EOF
8226 #line 8227 "configure"
8227 #include "confdefs.h"
8228 /* Override any gcc2 internal prototype to avoid an error.  */
8229 /* We use char because int might match the return type of a gcc2
8230     builtin and then its argument prototype would still apply.  */
8231 char jl_dic_list_e();
8232
8233 int main() {
8234 jl_dic_list_e()
8235 ; return 0; }
8236 EOF
8237 if { (eval echo configure:8238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8238   rm -rf conftest*
8239   eval "ac_cv_lib_$ac_lib_var=yes"
8240 else
8241   echo "configure: failed program was:" >&5
8242   cat conftest.$ac_ext >&5
8243   rm -rf conftest*
8244   eval "ac_cv_lib_$ac_lib_var=no"
8245 fi
8246 rm -f conftest*
8247 xe_check_libs=""
8248
8249 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8250   echo "$ac_t""yes" 1>&6
8251   libwnn=wnn6
8252 else
8253   echo "$ac_t""no" 1>&6
8254 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8255 echo "configure:8256: checking for dic_list_e in -lwnn6_fromsrc" >&5
8256 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8257
8258 xe_check_libs=" -lwnn6_fromsrc "
8259 cat > conftest.$ac_ext <<EOF
8260 #line 8261 "configure"
8261 #include "confdefs.h"
8262 /* Override any gcc2 internal prototype to avoid an error.  */
8263 /* We use char because int might match the return type of a gcc2
8264     builtin and then its argument prototype would still apply.  */
8265 char dic_list_e();
8266
8267 int main() {
8268 dic_list_e()
8269 ; return 0; }
8270 EOF
8271 if { (eval echo configure:8272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8272   rm -rf conftest*
8273   eval "ac_cv_lib_$ac_lib_var=yes"
8274 else
8275   echo "configure: failed program was:" >&5
8276   cat conftest.$ac_ext >&5
8277   rm -rf conftest*
8278   eval "ac_cv_lib_$ac_lib_var=no"
8279 fi
8280 rm -f conftest*
8281 xe_check_libs=""
8282
8283 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8284   echo "$ac_t""yes" 1>&6
8285   libwnn=wnn6_fromsrc
8286 else
8287   echo "$ac_t""no" 1>&6
8288 with_wnn=no
8289 fi
8290
8291
8292 fi
8293
8294
8295 fi
8296
8297
8298 fi
8299
8300
8301   fi
8302   test -z "$with_wnn" && with_wnn=yes
8303   if test "$with_wnn" = "yes"; then
8304     { test "$extra_verbose" = "yes" && cat << \EOF
8305     Defining HAVE_WNN
8306 EOF
8307 cat >> confdefs.h <<\EOF
8308 #define HAVE_WNN 1
8309 EOF
8310 }
8311
8312     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8313     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8314    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8315  fi
8316     if test "$with_wnn6" != "no"; then
8317       
8318 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8319 echo "configure:8320: checking for jl_fi_dic_list in -l$libwnn" >&5
8320 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8321
8322 xe_check_libs=" -l$libwnn "
8323 cat > conftest.$ac_ext <<EOF
8324 #line 8325 "configure"
8325 #include "confdefs.h"
8326 /* Override any gcc2 internal prototype to avoid an error.  */
8327 /* We use char because int might match the return type of a gcc2
8328     builtin and then its argument prototype would still apply.  */
8329 char jl_fi_dic_list();
8330
8331 int main() {
8332 jl_fi_dic_list()
8333 ; return 0; }
8334 EOF
8335 if { (eval echo configure:8336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8336   rm -rf conftest*
8337   eval "ac_cv_lib_$ac_lib_var=yes"
8338 else
8339   echo "configure: failed program was:" >&5
8340   cat conftest.$ac_ext >&5
8341   rm -rf conftest*
8342   eval "ac_cv_lib_$ac_lib_var=no"
8343 fi
8344 rm -f conftest*
8345 xe_check_libs=""
8346
8347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8348   echo "$ac_t""yes" 1>&6
8349   with_wnn6=yes
8350 else
8351   echo "$ac_t""no" 1>&6
8352 fi
8353
8354
8355       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8356     Defining WNN6
8357 EOF
8358 cat >> confdefs.h <<\EOF
8359 #define WNN6 1
8360 EOF
8361 }
8362
8363     fi
8364   fi
8365
8366     canna_includes_found=no
8367   if test "$with_canna" != "no"; then
8368     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8369 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8370 echo "configure:8371: checking for canna/jrkanji.h" >&5
8371
8372 cat > conftest.$ac_ext <<EOF
8373 #line 8374 "configure"
8374 #include "confdefs.h"
8375 #include <canna/jrkanji.h>
8376 EOF
8377 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8378 { (eval echo configure:8379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8379 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8380 if test -z "$ac_err"; then
8381   rm -rf conftest*
8382   eval "ac_cv_header_$ac_safe=yes"
8383 else
8384   echo "$ac_err" >&5
8385   echo "configure: failed program was:" >&5
8386   cat conftest.$ac_ext >&5
8387   rm -rf conftest*
8388   eval "ac_cv_header_$ac_safe=no"
8389 fi
8390 rm -f conftest*
8391 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8392   echo "$ac_t""yes" 1>&6
8393   canna_includes_found=yes
8394 else
8395   echo "$ac_t""no" 1>&6
8396 fi
8397
8398   fi
8399   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8400       -d "/usr/local/canna/include"; then
8401     save_c_switch_site="$c_switch_site"
8402     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8403     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8404 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8405 echo "configure:8406: checking for canna/jrkanji.h" >&5
8406
8407 cat > conftest.$ac_ext <<EOF
8408 #line 8409 "configure"
8409 #include "confdefs.h"
8410 #include <canna/jrkanji.h>
8411 EOF
8412 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8413 { (eval echo configure:8414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8414 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8415 if test -z "$ac_err"; then
8416   rm -rf conftest*
8417   eval "ac_cv_header_$ac_safe=yes"
8418 else
8419   echo "$ac_err" >&5
8420   echo "configure: failed program was:" >&5
8421   cat conftest.$ac_ext >&5
8422   rm -rf conftest*
8423   eval "ac_cv_header_$ac_safe=no"
8424 fi
8425 rm -f conftest*
8426 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8427   echo "$ac_t""yes" 1>&6
8428   canna_includes_found=yes
8429 else
8430   echo "$ac_t""no" 1>&6
8431 fi
8432
8433     if test "$canna_includes_found" != "yes"; then
8434       c_switch_site="$save_c_switch_site"
8435       with_canna="no"
8436     fi
8437   fi
8438
8439   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8440 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8441 echo "configure:8442: checking for canna/RK.h" >&5
8442
8443 cat > conftest.$ac_ext <<EOF
8444 #line 8445 "configure"
8445 #include "confdefs.h"
8446 #include <canna/RK.h>
8447 EOF
8448 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8449 { (eval echo configure:8450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8450 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8451 if test -z "$ac_err"; then
8452   rm -rf conftest*
8453   eval "ac_cv_header_$ac_safe=yes"
8454 else
8455   echo "$ac_err" >&5
8456   echo "configure: failed program was:" >&5
8457   cat conftest.$ac_ext >&5
8458   rm -rf conftest*
8459   eval "ac_cv_header_$ac_safe=no"
8460 fi
8461 rm -f conftest*
8462 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8463   echo "$ac_t""yes" 1>&6
8464   :
8465 else
8466   echo "$ac_t""no" 1>&6
8467 with_canna=no
8468 fi
8469  }
8470   test -z "$with_canna" && { 
8471 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8472 echo "configure:8473: checking for RkBgnBun in -lRKC" >&5
8473 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8474
8475 xe_check_libs=" -lRKC "
8476 cat > conftest.$ac_ext <<EOF
8477 #line 8478 "configure"
8478 #include "confdefs.h"
8479 /* Override any gcc2 internal prototype to avoid an error.  */
8480 /* We use char because int might match the return type of a gcc2
8481     builtin and then its argument prototype would still apply.  */
8482 char RkBgnBun();
8483
8484 int main() {
8485 RkBgnBun()
8486 ; return 0; }
8487 EOF
8488 if { (eval echo configure:8489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8489   rm -rf conftest*
8490   eval "ac_cv_lib_$ac_lib_var=yes"
8491 else
8492   echo "configure: failed program was:" >&5
8493   cat conftest.$ac_ext >&5
8494   rm -rf conftest*
8495   eval "ac_cv_lib_$ac_lib_var=no"
8496 fi
8497 rm -f conftest*
8498 xe_check_libs=""
8499
8500 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8501   echo "$ac_t""yes" 1>&6
8502   :
8503 else
8504   echo "$ac_t""no" 1>&6
8505 with_canna=no
8506 fi
8507
8508  }
8509   test -z "$with_canna" && { 
8510 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8511 echo "configure:8512: checking for jrKanjiControl in -lcanna" >&5
8512 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8513
8514 xe_check_libs=" -lcanna "
8515 cat > conftest.$ac_ext <<EOF
8516 #line 8517 "configure"
8517 #include "confdefs.h"
8518 /* Override any gcc2 internal prototype to avoid an error.  */
8519 /* We use char because int might match the return type of a gcc2
8520     builtin and then its argument prototype would still apply.  */
8521 char jrKanjiControl();
8522
8523 int main() {
8524 jrKanjiControl()
8525 ; return 0; }
8526 EOF
8527 if { (eval echo configure:8528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8528   rm -rf conftest*
8529   eval "ac_cv_lib_$ac_lib_var=yes"
8530 else
8531   echo "configure: failed program was:" >&5
8532   cat conftest.$ac_ext >&5
8533   rm -rf conftest*
8534   eval "ac_cv_lib_$ac_lib_var=no"
8535 fi
8536 rm -f conftest*
8537 xe_check_libs=""
8538
8539 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8540   echo "$ac_t""yes" 1>&6
8541   :
8542 else
8543   echo "$ac_t""no" 1>&6
8544 with_canna=no
8545 fi
8546
8547  }
8548   test -z "$with_canna" && with_canna=yes
8549   if test "$with_canna" = "yes"; then
8550     { test "$extra_verbose" = "yes" && cat << \EOF
8551     Defining HAVE_CANNA
8552 EOF
8553 cat >> confdefs.h <<\EOF
8554 #define HAVE_CANNA 1
8555 EOF
8556 }
8557
8558     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8559     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8560    echo "    xemacs will be linked with \"mule-canna.o\""
8561  fi
8562   fi
8563
8564 else   for feature in xim canna wnn; do
8565     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8566       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8567     fi
8568     eval "with_${feature}=no"
8569   done
8570 fi 
8571
8572 if test "$need_motif" = "yes" ; then
8573   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8574     
8575 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8576 echo "configure:8577: checking for layout_object_getvalue in -li18n" >&5
8577 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8578
8579 xe_check_libs=" -li18n "
8580 cat > conftest.$ac_ext <<EOF
8581 #line 8582 "configure"
8582 #include "confdefs.h"
8583 /* Override any gcc2 internal prototype to avoid an error.  */
8584 /* We use char because int might match the return type of a gcc2
8585     builtin and then its argument prototype would still apply.  */
8586 char layout_object_getvalue();
8587
8588 int main() {
8589 layout_object_getvalue()
8590 ; return 0; }
8591 EOF
8592 if { (eval echo configure:8593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8593   rm -rf conftest*
8594   eval "ac_cv_lib_$ac_lib_var=yes"
8595 else
8596   echo "configure: failed program was:" >&5
8597   cat conftest.$ac_ext >&5
8598   rm -rf conftest*
8599   eval "ac_cv_lib_$ac_lib_var=no"
8600 fi
8601 rm -f conftest*
8602 xe_check_libs=""
8603
8604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8605   echo "$ac_t""yes" 1>&6
8606   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8607 else
8608   echo "$ac_t""no" 1>&6
8609 fi
8610
8611
8612   
8613 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8614     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8615   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8616   
8617         runpath="" runpath_dirs=""
8618   if test -n "$LD_RUN_PATH"; then
8619     runpath="$LD_RUN_PATH"
8620   elif test "$GCC" = "yes"; then
8621         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8622     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8623     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8624     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8625       case "$arg" in P,* | -L* | -R* )
8626         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8627           {
8628 xe_runpath_dir="$dir"
8629   test "$xe_runpath_dir" != "/lib"     -a \
8630         "$xe_runpath_dir" != "/usr/lib" -a \
8631         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8632   eval "$xe_add_unique_runpath_dir"
8633 }
8634         done ;;
8635       esac
8636     done
8637     ld_switch_run="$ld_switch_run_save"
8638     rm -f conftest*
8639   else
8640         for arg in $ld_switch_site $ld_switch_x_site; do
8641       case "$arg" in -L*) {
8642 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8643   test "$xe_runpath_dir" != "/lib"     -a \
8644         "$xe_runpath_dir" != "/usr/lib" -a \
8645         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8646   eval "$xe_add_unique_runpath_dir"
8647 };; esac
8648     done
8649         if test "$opsys $need_motif" = "sol2 yes"; then
8650       xe_runpath_dir="/opt/SUNWdt/lib";
8651       eval "$xe_add_unique_runpath_dir";
8652     fi
8653   fi 
8654   if test -n "$runpath"; then
8655     ld_switch_run="${dash_r}${runpath}"
8656     
8657 if test "$GCC" = "yes"; then
8658   set x $ld_switch_run; shift; ld_switch_run=""
8659   while test -n "$1"; do
8660     case $1 in
8661       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8662       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8663       -Xlinker* ) ;;
8664       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8665     esac
8666     shift
8667   done
8668 fi
8669     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8670   fi
8671 fi
8672
8673 fi
8674
8675 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
8676 do
8677 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8678 echo "configure:8679: checking for $ac_func" >&5
8679
8680 cat > conftest.$ac_ext <<EOF
8681 #line 8682 "configure"
8682 #include "confdefs.h"
8683 /* System header to define __stub macros and hopefully few prototypes,
8684     which can conflict with char $ac_func(); below.  */
8685 #include <assert.h>
8686 /* Override any gcc2 internal prototype to avoid an error.  */
8687 /* We use char because int might match the return type of a gcc2
8688     builtin and then its argument prototype would still apply.  */
8689 char $ac_func();
8690
8691 int main() {
8692
8693 /* The GNU C library defines this for functions which it implements
8694     to always fail with ENOSYS.  Some functions are actually named
8695     something starting with __ and the normal name is an alias.  */
8696 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8697 choke me
8698 #else
8699 $ac_func();
8700 #endif
8701
8702 ; return 0; }
8703 EOF
8704 if { (eval echo configure:8705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8705   rm -rf conftest*
8706   eval "ac_cv_func_$ac_func=yes"
8707 else
8708   echo "configure: failed program was:" >&5
8709   cat conftest.$ac_ext >&5
8710   rm -rf conftest*
8711   eval "ac_cv_func_$ac_func=no"
8712 fi
8713 rm -f conftest*
8714
8715 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8716   echo "$ac_t""yes" 1>&6
8717     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8718   { test "$extra_verbose" = "yes" && cat << EOF
8719     Defining $ac_tr_func
8720 EOF
8721 cat >> confdefs.h <<EOF
8722 #define $ac_tr_func 1
8723 EOF
8724 }
8725  
8726 else
8727   echo "$ac_t""no" 1>&6
8728 fi
8729 done
8730
8731
8732
8733 case "$opsys" in
8734   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8735    echo "    xemacs will be linked with \"realpath.o\""
8736  fi ;;
8737   * )
8738     case "$canonical" in
8739       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8740    echo "    xemacs will be linked with \"realpath.o\""
8741  fi ;;
8742       * ) for ac_func in realpath
8743 do
8744 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8745 echo "configure:8746: checking for $ac_func" >&5
8746
8747 cat > conftest.$ac_ext <<EOF
8748 #line 8749 "configure"
8749 #include "confdefs.h"
8750 /* System header to define __stub macros and hopefully few prototypes,
8751     which can conflict with char $ac_func(); below.  */
8752 #include <assert.h>
8753 /* Override any gcc2 internal prototype to avoid an error.  */
8754 /* We use char because int might match the return type of a gcc2
8755     builtin and then its argument prototype would still apply.  */
8756 char $ac_func();
8757
8758 int main() {
8759
8760 /* The GNU C library defines this for functions which it implements
8761     to always fail with ENOSYS.  Some functions are actually named
8762     something starting with __ and the normal name is an alias.  */
8763 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8764 choke me
8765 #else
8766 $ac_func();
8767 #endif
8768
8769 ; return 0; }
8770 EOF
8771 if { (eval echo configure:8772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8772   rm -rf conftest*
8773   eval "ac_cv_func_$ac_func=yes"
8774 else
8775   echo "configure: failed program was:" >&5
8776   cat conftest.$ac_ext >&5
8777   rm -rf conftest*
8778   eval "ac_cv_func_$ac_func=no"
8779 fi
8780 rm -f conftest*
8781
8782 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8783   echo "$ac_t""yes" 1>&6
8784     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8785   { test "$extra_verbose" = "yes" && cat << EOF
8786     Defining $ac_tr_func
8787 EOF
8788 cat >> confdefs.h <<EOF
8789 #define $ac_tr_func 1
8790 EOF
8791 }
8792  
8793 else
8794   echo "$ac_t""no" 1>&6
8795 fi
8796 done
8797
8798           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8799    echo "    xemacs will be linked with \"realpath.o\""
8800  fi ;;
8801     esac ;;
8802 esac
8803
8804 for ac_func in getloadavg
8805 do
8806 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8807 echo "configure:8808: checking for $ac_func" >&5
8808
8809 cat > conftest.$ac_ext <<EOF
8810 #line 8811 "configure"
8811 #include "confdefs.h"
8812 /* System header to define __stub macros and hopefully few prototypes,
8813     which can conflict with char $ac_func(); below.  */
8814 #include <assert.h>
8815 /* Override any gcc2 internal prototype to avoid an error.  */
8816 /* We use char because int might match the return type of a gcc2
8817     builtin and then its argument prototype would still apply.  */
8818 char $ac_func();
8819
8820 int main() {
8821
8822 /* The GNU C library defines this for functions which it implements
8823     to always fail with ENOSYS.  Some functions are actually named
8824     something starting with __ and the normal name is an alias.  */
8825 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8826 choke me
8827 #else
8828 $ac_func();
8829 #endif
8830
8831 ; return 0; }
8832 EOF
8833 if { (eval echo configure:8834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8834   rm -rf conftest*
8835   eval "ac_cv_func_$ac_func=yes"
8836 else
8837   echo "configure: failed program was:" >&5
8838   cat conftest.$ac_ext >&5
8839   rm -rf conftest*
8840   eval "ac_cv_func_$ac_func=no"
8841 fi
8842 rm -f conftest*
8843
8844 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8845   echo "$ac_t""yes" 1>&6
8846     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8847   { test "$extra_verbose" = "yes" && cat << EOF
8848     Defining $ac_tr_func
8849 EOF
8850 cat >> confdefs.h <<EOF
8851 #define $ac_tr_func 1
8852 EOF
8853 }
8854  
8855 else
8856   echo "$ac_t""no" 1>&6
8857 fi
8858 done
8859
8860
8861 if test "$ac_cv_func_getloadavg" != "yes"
8862 then
8863   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
8864    echo "    xemacs will be linked with \"getloadavg.o\""
8865  fi
8866
8867     
8868 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
8869 echo "configure:8870: checking for kstat_open in -lkstat" >&5
8870 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
8871
8872 xe_check_libs=" -lkstat "
8873 cat > conftest.$ac_ext <<EOF
8874 #line 8875 "configure"
8875 #include "confdefs.h"
8876 /* Override any gcc2 internal prototype to avoid an error.  */
8877 /* We use char because int might match the return type of a gcc2
8878     builtin and then its argument prototype would still apply.  */
8879 char kstat_open();
8880
8881 int main() {
8882 kstat_open()
8883 ; return 0; }
8884 EOF
8885 if { (eval echo configure:8886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8886   rm -rf conftest*
8887   eval "ac_cv_lib_$ac_lib_var=yes"
8888 else
8889   echo "configure: failed program was:" >&5
8890   cat conftest.$ac_ext >&5
8891   rm -rf conftest*
8892   eval "ac_cv_lib_$ac_lib_var=no"
8893 fi
8894 rm -f conftest*
8895 xe_check_libs=""
8896
8897 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8898   echo "$ac_t""yes" 1>&6
8899     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8900     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8901   { test "$extra_verbose" = "yes" && cat << EOF
8902     Defining $ac_tr_lib
8903 EOF
8904 cat >> confdefs.h <<EOF
8905 #define $ac_tr_lib 1
8906 EOF
8907 }
8908
8909   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
8910
8911 else
8912   echo "$ac_t""no" 1>&6
8913 fi
8914
8915
8916
8917     
8918 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
8919 echo "configure:8920: checking for kvm_read in -lkvm" >&5
8920 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
8921
8922 xe_check_libs=" -lkvm "
8923 cat > conftest.$ac_ext <<EOF
8924 #line 8925 "configure"
8925 #include "confdefs.h"
8926 /* Override any gcc2 internal prototype to avoid an error.  */
8927 /* We use char because int might match the return type of a gcc2
8928     builtin and then its argument prototype would still apply.  */
8929 char kvm_read();
8930
8931 int main() {
8932 kvm_read()
8933 ; return 0; }
8934 EOF
8935 if { (eval echo configure:8936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8936   rm -rf conftest*
8937   eval "ac_cv_lib_$ac_lib_var=yes"
8938 else
8939   echo "configure: failed program was:" >&5
8940   cat conftest.$ac_ext >&5
8941   rm -rf conftest*
8942   eval "ac_cv_lib_$ac_lib_var=no"
8943 fi
8944 rm -f conftest*
8945 xe_check_libs=""
8946
8947 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8948   echo "$ac_t""yes" 1>&6
8949     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8950     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8951   { test "$extra_verbose" = "yes" && cat << EOF
8952     Defining $ac_tr_lib
8953 EOF
8954 cat >> confdefs.h <<EOF
8955 #define $ac_tr_lib 1
8956 EOF
8957 }
8958
8959   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
8960
8961 else
8962   echo "$ac_t""no" 1>&6
8963 fi
8964
8965
8966 fi
8967
8968 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8969 echo "configure:8970: checking whether netdb declares h_errno" >&5
8970 cat > conftest.$ac_ext <<EOF
8971 #line 8972 "configure"
8972 #include "confdefs.h"
8973 #include <netdb.h>
8974 int main() {
8975 return h_errno;
8976 ; return 0; }
8977 EOF
8978 if { (eval echo configure:8979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8979   rm -rf conftest*
8980   echo "$ac_t""yes" 1>&6
8981    { test "$extra_verbose" = "yes" && cat << \EOF
8982     Defining HAVE_H_ERRNO
8983 EOF
8984 cat >> confdefs.h <<\EOF
8985 #define HAVE_H_ERRNO 1
8986 EOF
8987 }
8988
8989 else
8990   echo "configure: failed program was:" >&5
8991   cat conftest.$ac_ext >&5
8992   rm -rf conftest*
8993   echo "$ac_t""no" 1>&6
8994 fi
8995 rm -f conftest*
8996
8997 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8998 echo "configure:8999: checking for sigsetjmp" >&5
8999 cat > conftest.$ac_ext <<EOF
9000 #line 9001 "configure"
9001 #include "confdefs.h"
9002 #include <setjmp.h>
9003 int main() {
9004 sigjmp_buf bar; sigsetjmp (bar, 0);
9005 ; return 0; }
9006 EOF
9007 if { (eval echo configure:9008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9008   rm -rf conftest*
9009   echo "$ac_t""yes" 1>&6
9010    { test "$extra_verbose" = "yes" && cat << \EOF
9011     Defining HAVE_SIGSETJMP
9012 EOF
9013 cat >> confdefs.h <<\EOF
9014 #define HAVE_SIGSETJMP 1
9015 EOF
9016 }
9017
9018 else
9019   echo "configure: failed program was:" >&5
9020   cat conftest.$ac_ext >&5
9021   rm -rf conftest*
9022   echo "$ac_t""no" 1>&6
9023 fi
9024 rm -f conftest*
9025
9026 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
9027 echo "configure:9028: checking whether localtime caches TZ" >&5
9028
9029 if test "$ac_cv_func_tzset" = "yes"; then
9030 cat > conftest.$ac_ext <<EOF
9031 #line 9032 "configure"
9032 #include "confdefs.h"
9033 #include <time.h>
9034 #if STDC_HEADERS
9035 # include <stdlib.h>
9036 #endif
9037 extern char **environ;
9038 unset_TZ ()
9039 {
9040   char **from, **to;
9041   for (to = from = environ; (*to = *from); from++)
9042     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
9043       to++;
9044 }
9045 char TZ_GMT0[] = "TZ=GMT0";
9046 char TZ_PST8[] = "TZ=PST8";
9047 main()
9048 {
9049   time_t now = time ((time_t *) 0);
9050   int hour_GMT0, hour_unset;
9051   if (putenv (TZ_GMT0) != 0)
9052     exit (1);
9053   hour_GMT0 = localtime (&now)->tm_hour;
9054   unset_TZ ();
9055   hour_unset = localtime (&now)->tm_hour;
9056   if (putenv (TZ_PST8) != 0)
9057     exit (1);
9058   if (localtime (&now)->tm_hour == hour_GMT0)
9059     exit (1);
9060   unset_TZ ();
9061   if (localtime (&now)->tm_hour != hour_unset)
9062     exit (1);
9063   exit (0);
9064 }
9065 EOF
9066 if { (eval echo configure:9067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9067 then
9068   emacs_cv_localtime_cache=no
9069 else
9070   conftest_rc="$?"
9071   echo "configure: failed program was:" >&5
9072   cat conftest.$ac_ext >&5
9073   rm -fr conftest*
9074   emacs_cv_localtime_cache=yes
9075 fi
9076 rm -fr conftest*
9077 else
9078         # If we lack tzset, report that localtime does not cache TZ,
9079         # since we can't invalidate the cache if we don't have tzset.
9080         emacs_cv_localtime_cache=no
9081 fi
9082 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
9083 if test $emacs_cv_localtime_cache = yes; then
9084   { test "$extra_verbose" = "yes" && cat << \EOF
9085     Defining LOCALTIME_CACHE
9086 EOF
9087 cat >> confdefs.h <<\EOF
9088 #define LOCALTIME_CACHE 1
9089 EOF
9090 }
9091
9092 fi
9093
9094 if test "$HAVE_TIMEVAL" = "yes"; then
9095 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
9096 echo "configure:9097: checking whether gettimeofday accepts one or two arguments" >&5
9097 cat > conftest.$ac_ext <<EOF
9098 #line 9099 "configure"
9099 #include "confdefs.h"
9100
9101 #ifdef TIME_WITH_SYS_TIME
9102 #include <sys/time.h>
9103 #include <time.h>
9104 #else
9105 #ifdef HAVE_SYS_TIME_H
9106 #include <sys/time.h>
9107 #else
9108 #include <time.h>
9109 #endif
9110 #endif
9111   
9112 int main() {
9113
9114   struct timeval time;
9115   struct timezone dummy;
9116   gettimeofday (&time, &dummy);
9117
9118 ; return 0; }
9119 EOF
9120 if { (eval echo configure:9121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9121   rm -rf conftest*
9122   echo "$ac_t""two" 1>&6
9123 else
9124   echo "configure: failed program was:" >&5
9125   cat conftest.$ac_ext >&5
9126   rm -rf conftest*
9127   echo "$ac_t""one" 1>&6
9128    { test "$extra_verbose" = "yes" && cat << \EOF
9129     Defining GETTIMEOFDAY_ONE_ARGUMENT
9130 EOF
9131 cat >> confdefs.h <<\EOF
9132 #define GETTIMEOFDAY_ONE_ARGUMENT 1
9133 EOF
9134 }
9135
9136 fi
9137 rm -f conftest*
9138 fi
9139
9140
9141 echo $ac_n "checking for inline""... $ac_c" 1>&6
9142 echo "configure:9143: checking for inline" >&5
9143
9144 ac_cv_c_inline=no
9145 for ac_kw in inline __inline__ __inline; do
9146   cat > conftest.$ac_ext <<EOF
9147 #line 9148 "configure"
9148 #include "confdefs.h"
9149
9150 int main() {
9151 } $ac_kw foo() {
9152 ; return 0; }
9153 EOF
9154 if { (eval echo configure:9155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9155   rm -rf conftest*
9156   ac_cv_c_inline=$ac_kw; break
9157 else
9158   echo "configure: failed program was:" >&5
9159   cat conftest.$ac_ext >&5
9160 fi
9161 rm -f conftest*
9162 done
9163
9164
9165 echo "$ac_t""$ac_cv_c_inline" 1>&6
9166 case "$ac_cv_c_inline" in
9167   inline | yes) ;;
9168   no) { test "$extra_verbose" = "yes" && cat << \EOF
9169     Defining inline = 
9170 EOF
9171 cat >> confdefs.h <<\EOF
9172 #define inline 
9173 EOF
9174 }
9175  ;;
9176   *)  { test "$extra_verbose" = "yes" && cat << EOF
9177     Defining inline = $ac_cv_c_inline
9178 EOF
9179 cat >> confdefs.h <<EOF
9180 #define inline $ac_cv_c_inline
9181 EOF
9182 }
9183  ;;
9184 esac
9185
9186 if test "$ac_cv_c_inline" != "no"; then
9187   { test "$extra_verbose" = "yes" && cat << \EOF
9188     Defining HAVE_INLINE
9189 EOF
9190 cat >> confdefs.h <<\EOF
9191 #define HAVE_INLINE 1
9192 EOF
9193 }
9194
9195   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9196    echo "    xemacs will be linked with \"inline.o\""
9197  fi
9198 fi
9199
9200
9201 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9202 # for constant arguments.  Useless!
9203 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9204 echo "configure:9205: checking for working alloca.h" >&5
9205
9206 cat > conftest.$ac_ext <<EOF
9207 #line 9208 "configure"
9208 #include "confdefs.h"
9209 #include <alloca.h>
9210 int main() {
9211 char *p = alloca(2 * sizeof(int));
9212 ; return 0; }
9213 EOF
9214 if { (eval echo configure:9215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9215   rm -rf conftest*
9216   ac_cv_header_alloca_h=yes
9217 else
9218   echo "configure: failed program was:" >&5
9219   cat conftest.$ac_ext >&5
9220   rm -rf conftest*
9221   ac_cv_header_alloca_h=no
9222 fi
9223 rm -f conftest*
9224
9225 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9226 if test $ac_cv_header_alloca_h = yes; then
9227   { test "$extra_verbose" = "yes" && cat << \EOF
9228     Defining HAVE_ALLOCA_H
9229 EOF
9230 cat >> confdefs.h <<\EOF
9231 #define HAVE_ALLOCA_H 1
9232 EOF
9233 }
9234
9235 fi
9236
9237 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9238 echo "configure:9239: checking for alloca" >&5
9239
9240 cat > conftest.$ac_ext <<EOF
9241 #line 9242 "configure"
9242 #include "confdefs.h"
9243
9244 #ifdef __GNUC__
9245 # define alloca __builtin_alloca
9246 #else
9247 # ifdef _MSC_VER
9248 #  include <malloc.h>
9249 #  define alloca _alloca
9250 # else
9251 #  if HAVE_ALLOCA_H
9252 #   include <alloca.h>
9253 #  else
9254 #   ifdef _AIX
9255  #pragma alloca
9256 #   else
9257 #    ifndef alloca /* predefined by HP cc +Olibcalls */
9258 char *alloca ();
9259 #    endif
9260 #   endif
9261 #  endif
9262 # endif
9263 #endif
9264
9265 int main() {
9266 char *p = (char *) alloca(1);
9267 ; return 0; }
9268 EOF
9269 if { (eval echo configure:9270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9270   rm -rf conftest*
9271   ac_cv_func_alloca_works=yes
9272 else
9273   echo "configure: failed program was:" >&5
9274   cat conftest.$ac_ext >&5
9275   rm -rf conftest*
9276   ac_cv_func_alloca_works=no
9277 fi
9278 rm -f conftest*
9279
9280 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9281 if test $ac_cv_func_alloca_works = yes; then
9282   { test "$extra_verbose" = "yes" && cat << \EOF
9283     Defining HAVE_ALLOCA
9284 EOF
9285 cat >> confdefs.h <<\EOF
9286 #define HAVE_ALLOCA 1
9287 EOF
9288 }
9289
9290 fi
9291
9292 if test $ac_cv_func_alloca_works = no; then
9293   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9294   # that cause trouble.  Some versions do not even contain alloca or
9295   # contain a buggy version.  If you still want to use their alloca,
9296   # use ar to extract alloca.o from them instead of compiling alloca.c.
9297   ALLOCA=alloca.${ac_objext}
9298   { test "$extra_verbose" = "yes" && cat << \EOF
9299     Defining C_ALLOCA
9300 EOF
9301 cat >> confdefs.h <<\EOF
9302 #define C_ALLOCA 1
9303 EOF
9304 }
9305
9306
9307 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9308 echo "configure:9309: checking whether alloca needs Cray hooks" >&5
9309
9310 cat > conftest.$ac_ext <<EOF
9311 #line 9312 "configure"
9312 #include "confdefs.h"
9313 #if defined(CRAY) && ! defined(CRAY2)
9314 webecray
9315 #else
9316 wenotbecray
9317 #endif
9318
9319 EOF
9320 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9321   egrep "webecray" >/dev/null 2>&1; then
9322   rm -rf conftest*
9323   ac_cv_os_cray=yes
9324 else
9325   rm -rf conftest*
9326   ac_cv_os_cray=no
9327 fi
9328 rm -f conftest*
9329
9330
9331 echo "$ac_t""$ac_cv_os_cray" 1>&6
9332 if test $ac_cv_os_cray = yes; then
9333 for ac_func in _getb67 GETB67 getb67; do
9334   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9335 echo "configure:9336: checking for $ac_func" >&5
9336
9337 cat > conftest.$ac_ext <<EOF
9338 #line 9339 "configure"
9339 #include "confdefs.h"
9340 /* System header to define __stub macros and hopefully few prototypes,
9341     which can conflict with char $ac_func(); below.  */
9342 #include <assert.h>
9343 /* Override any gcc2 internal prototype to avoid an error.  */
9344 /* We use char because int might match the return type of a gcc2
9345     builtin and then its argument prototype would still apply.  */
9346 char $ac_func();
9347
9348 int main() {
9349
9350 /* The GNU C library defines this for functions which it implements
9351     to always fail with ENOSYS.  Some functions are actually named
9352     something starting with __ and the normal name is an alias.  */
9353 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9354 choke me
9355 #else
9356 $ac_func();
9357 #endif
9358
9359 ; return 0; }
9360 EOF
9361 if { (eval echo configure:9362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9362   rm -rf conftest*
9363   eval "ac_cv_func_$ac_func=yes"
9364 else
9365   echo "configure: failed program was:" >&5
9366   cat conftest.$ac_ext >&5
9367   rm -rf conftest*
9368   eval "ac_cv_func_$ac_func=no"
9369 fi
9370 rm -f conftest*
9371
9372 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9373   echo "$ac_t""yes" 1>&6
9374   { test "$extra_verbose" = "yes" && cat << EOF
9375     Defining CRAY_STACKSEG_END = $ac_func
9376 EOF
9377 cat >> confdefs.h <<EOF
9378 #define CRAY_STACKSEG_END $ac_func
9379 EOF
9380 }
9381
9382   break
9383 else
9384   echo "$ac_t""no" 1>&6
9385 fi
9386
9387 done
9388 fi
9389
9390 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9391 echo "configure:9392: checking stack direction for C alloca" >&5
9392
9393 cat > conftest.$ac_ext <<EOF
9394 #line 9395 "configure"
9395 #include "confdefs.h"
9396 find_stack_direction ()
9397 {
9398   static char *addr = 0;
9399   auto char dummy;
9400   if (addr == 0)
9401     {
9402       addr = &dummy;
9403       return find_stack_direction ();
9404     }
9405   else
9406     return (&dummy > addr) ? 1 : -1;
9407 }
9408 main ()
9409 {
9410   exit (find_stack_direction() < 0);
9411 }
9412 EOF
9413 if { (eval echo configure:9414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9414 then
9415   ac_cv_c_stack_direction=1
9416 else
9417   conftest_rc="$?"
9418   echo "configure: failed program was:" >&5
9419   cat conftest.$ac_ext >&5
9420   rm -fr conftest*
9421   ac_cv_c_stack_direction=-1
9422 fi
9423 rm -fr conftest*
9424
9425 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9426 { test "$extra_verbose" = "yes" && cat << EOF
9427     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9428 EOF
9429 cat >> confdefs.h <<EOF
9430 #define STACK_DIRECTION $ac_cv_c_stack_direction
9431 EOF
9432 }
9433
9434 fi
9435
9436 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9437    echo "    xemacs will be linked with \"$ALLOCA\""
9438  fi
9439
9440 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9441 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9442 echo "configure:9443: checking for vfork.h" >&5
9443
9444 cat > conftest.$ac_ext <<EOF
9445 #line 9446 "configure"
9446 #include "confdefs.h"
9447 #include <vfork.h>
9448 EOF
9449 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9450 { (eval echo configure:9451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9451 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9452 if test -z "$ac_err"; then
9453   rm -rf conftest*
9454   eval "ac_cv_header_$ac_safe=yes"
9455 else
9456   echo "$ac_err" >&5
9457   echo "configure: failed program was:" >&5
9458   cat conftest.$ac_ext >&5
9459   rm -rf conftest*
9460   eval "ac_cv_header_$ac_safe=no"
9461 fi
9462 rm -f conftest*
9463 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9464   echo "$ac_t""yes" 1>&6
9465   { test "$extra_verbose" = "yes" && cat << \EOF
9466     Defining HAVE_VFORK_H
9467 EOF
9468 cat >> confdefs.h <<\EOF
9469 #define HAVE_VFORK_H 1
9470 EOF
9471 }
9472
9473 else
9474   echo "$ac_t""no" 1>&6
9475 fi
9476
9477 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9478 echo "configure:9479: checking for working vfork" >&5
9479
9480 cat > conftest.$ac_ext <<EOF
9481 #line 9482 "configure"
9482 #include "confdefs.h"
9483 /* Thanks to Paul Eggert for this test.  */
9484 #include <stdio.h>
9485 #include <sys/types.h>
9486 #include <sys/stat.h>
9487 #ifdef HAVE_UNISTD_H
9488 #include <unistd.h>
9489 #endif
9490 #ifdef HAVE_VFORK_H
9491 #include <vfork.h>
9492 #endif
9493 /* On some sparc systems, changes by the child to local and incoming
9494    argument registers are propagated back to the parent.
9495    The compiler is told about this with #include <vfork.h>,
9496    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9497    Test for this by using a static variable whose address
9498    is put into a register that is clobbered by the vfork.  */
9499 static
9500 #ifdef __cplusplus
9501 sparc_address_test (int arg)
9502 #else
9503 sparc_address_test (arg) int arg;
9504 #endif
9505 {
9506   static pid_t child;
9507   if (!child) {
9508     child = vfork ();
9509     if (child < 0) {
9510       perror ("vfork");
9511       _exit(2);
9512     }
9513     if (!child) {
9514       arg = getpid();
9515       write(-1, "", 0);
9516       _exit (arg);
9517     }
9518   }
9519 }
9520 main() {
9521   pid_t parent = getpid ();
9522   pid_t child;
9523
9524   sparc_address_test ();
9525
9526   child = vfork ();
9527
9528   if (child == 0) {
9529     /* Here is another test for sparc vfork register problems.
9530        This test uses lots of local variables, at least
9531        as many local variables as main has allocated so far
9532        including compiler temporaries.  4 locals are enough for
9533        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9534        A buggy compiler should reuse the register of parent
9535        for one of the local variables, since it will think that
9536        parent can't possibly be used any more in this routine.
9537        Assigning to the local variable will thus munge parent
9538        in the parent process.  */
9539     pid_t
9540       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9541       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9542     /* Convince the compiler that p..p7 are live; otherwise, it might
9543        use the same hardware register for all 8 local variables.  */
9544     if (p != p1 || p != p2 || p != p3 || p != p4
9545         || p != p5 || p != p6 || p != p7)
9546       _exit(1);
9547
9548     /* On some systems (e.g. IRIX 3.3),
9549        vfork doesn't separate parent from child file descriptors.
9550        If the child closes a descriptor before it execs or exits,
9551        this munges the parent's descriptor as well.
9552        Test for this by closing stdout in the child.  */
9553     _exit(close(fileno(stdout)) != 0);
9554   } else {
9555     int status;
9556     struct stat st;
9557
9558     while (wait(&status) != child)
9559       ;
9560     exit(
9561          /* Was there some problem with vforking?  */
9562          child < 0
9563
9564          /* Did the child fail?  (This shouldn't happen.)  */
9565          || status
9566
9567          /* Did the vfork/compiler bug occur?  */
9568          || parent != getpid()
9569
9570          /* Did the file descriptor bug occur?  */
9571          || fstat(fileno(stdout), &st) != 0
9572          );
9573   }
9574 }
9575 EOF
9576 if { (eval echo configure:9577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9577 then
9578   ac_cv_func_vfork_works=yes
9579 else
9580   conftest_rc="$?"
9581   echo "configure: failed program was:" >&5
9582   cat conftest.$ac_ext >&5
9583   rm -fr conftest*
9584   ac_cv_func_vfork_works=no
9585 fi
9586 rm -fr conftest*
9587
9588 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9589 if test $ac_cv_func_vfork_works = no; then
9590   { test "$extra_verbose" = "yes" && cat << \EOF
9591     Defining vfork = fork
9592 EOF
9593 cat >> confdefs.h <<\EOF
9594 #define vfork fork
9595 EOF
9596 }
9597
9598 fi
9599
9600
9601 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9602 echo "configure:9603: checking for working strcoll" >&5
9603
9604 cat > conftest.$ac_ext <<EOF
9605 #line 9606 "configure"
9606 #include "confdefs.h"
9607 #include <string.h>
9608 main ()
9609 {
9610   exit (strcoll ("abc", "def") >= 0 ||
9611         strcoll ("ABC", "DEF") >= 0 ||
9612         strcoll ("123", "456") >= 0);
9613 }
9614 EOF
9615 if { (eval echo configure:9616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9616 then
9617   ac_cv_func_strcoll_works=yes
9618 else
9619   conftest_rc="$?"
9620   echo "configure: failed program was:" >&5
9621   cat conftest.$ac_ext >&5
9622   rm -fr conftest*
9623   ac_cv_func_strcoll_works=no
9624 fi
9625 rm -fr conftest*
9626
9627 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9628 if test $ac_cv_func_strcoll_works = yes; then
9629   { test "$extra_verbose" = "yes" && cat << \EOF
9630     Defining HAVE_STRCOLL
9631 EOF
9632 cat >> confdefs.h <<\EOF
9633 #define HAVE_STRCOLL 1
9634 EOF
9635 }
9636
9637 fi
9638
9639
9640 for ac_func in getpgrp
9641 do
9642 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9643 echo "configure:9644: checking for $ac_func" >&5
9644
9645 cat > conftest.$ac_ext <<EOF
9646 #line 9647 "configure"
9647 #include "confdefs.h"
9648 /* System header to define __stub macros and hopefully few prototypes,
9649     which can conflict with char $ac_func(); below.  */
9650 #include <assert.h>
9651 /* Override any gcc2 internal prototype to avoid an error.  */
9652 /* We use char because int might match the return type of a gcc2
9653     builtin and then its argument prototype would still apply.  */
9654 char $ac_func();
9655
9656 int main() {
9657
9658 /* The GNU C library defines this for functions which it implements
9659     to always fail with ENOSYS.  Some functions are actually named
9660     something starting with __ and the normal name is an alias.  */
9661 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9662 choke me
9663 #else
9664 $ac_func();
9665 #endif
9666
9667 ; return 0; }
9668 EOF
9669 if { (eval echo configure:9670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9670   rm -rf conftest*
9671   eval "ac_cv_func_$ac_func=yes"
9672 else
9673   echo "configure: failed program was:" >&5
9674   cat conftest.$ac_ext >&5
9675   rm -rf conftest*
9676   eval "ac_cv_func_$ac_func=no"
9677 fi
9678 rm -f conftest*
9679
9680 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9681   echo "$ac_t""yes" 1>&6
9682     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9683   { test "$extra_verbose" = "yes" && cat << EOF
9684     Defining $ac_tr_func
9685 EOF
9686 cat >> confdefs.h <<EOF
9687 #define $ac_tr_func 1
9688 EOF
9689 }
9690  
9691 else
9692   echo "$ac_t""no" 1>&6
9693 fi
9694 done
9695
9696 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9697 echo "configure:9698: checking whether getpgrp takes no argument" >&5
9698
9699 cat > conftest.$ac_ext <<EOF
9700 #line 9701 "configure"
9701 #include "confdefs.h"
9702
9703 /*
9704  * If this system has a BSD-style getpgrp(),
9705  * which takes a pid argument, exit unsuccessfully.
9706  *
9707  * Snarfed from Chet Ramey's bash pgrp.c test program
9708  */
9709 #include <stdio.h>
9710 #include <sys/types.h>
9711
9712 int     pid;
9713 int     pg1, pg2, pg3, pg4;
9714 int     ng, np, s, child;
9715
9716 main()
9717 {
9718         pid = getpid();
9719         pg1 = getpgrp(0);
9720         pg2 = getpgrp();
9721         pg3 = getpgrp(pid);
9722         pg4 = getpgrp(1);
9723
9724         /*
9725          * If all of these values are the same, it's pretty sure that
9726          * we're on a system that ignores getpgrp's first argument.
9727          */
9728         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9729                 exit(0);
9730
9731         child = fork();
9732         if (child < 0)
9733                 exit(1);
9734         else if (child == 0) {
9735                 np = getpid();
9736                 /*
9737                  * If this is Sys V, this will not work; pgrp will be
9738                  * set to np because setpgrp just changes a pgrp to be
9739                  * the same as the pid.
9740                  */
9741                 setpgrp(np, pg1);
9742                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9743                 if (ng == pg1) {
9744                         exit(1);
9745                 } else {
9746                         exit(0);
9747                 }
9748         } else {
9749                 wait(&s);
9750                 exit(s>>8);
9751         }
9752 }
9753
9754 EOF
9755 if { (eval echo configure:9756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9756 then
9757   ac_cv_func_getpgrp_void=yes
9758 else
9759   conftest_rc="$?"
9760   echo "configure: failed program was:" >&5
9761   cat conftest.$ac_ext >&5
9762   rm -fr conftest*
9763   ac_cv_func_getpgrp_void=no
9764 fi
9765 rm -fr conftest*
9766
9767
9768 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9769 if test $ac_cv_func_getpgrp_void = yes; then
9770   { test "$extra_verbose" = "yes" && cat << \EOF
9771     Defining GETPGRP_VOID
9772 EOF
9773 cat >> confdefs.h <<\EOF
9774 #define GETPGRP_VOID 1
9775 EOF
9776 }
9777
9778 fi
9779
9780
9781 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9782 echo "configure:9783: checking for working mmap" >&5
9783 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9784 cat > conftest.$ac_ext <<EOF
9785 #line 9786 "configure"
9786 #include "confdefs.h"
9787 #include <stdio.h>
9788 #include <unistd.h>
9789 #include <fcntl.h>
9790 #include <sys/mman.h>
9791
9792 #ifndef MAP_VARIABLE
9793 #define MAP_VARIABLE 0
9794 #endif
9795
9796 #ifndef MAP_FAILED
9797 #define MAP_FAILED -1
9798 #endif
9799
9800 int main (int argc, char *argv[])
9801 {
9802   int fd = -1;
9803   caddr_t p;
9804 #ifndef MAP_ANONYMOUS
9805   fd = open ("/dev/zero", O_RDWR);
9806   if (fd < 0)
9807     return 1;
9808 #define MAP_ANONYMOUS 0
9809 #endif
9810   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9811            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9812            fd, 0) != (void *) MAP_FAILED)
9813     return 0;
9814   perror ("conftest: mmap failed");
9815   return 1;
9816 }
9817 EOF
9818 if { (eval echo configure:9819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9819 then
9820   have_mmap=yes
9821 else
9822   conftest_rc="$?"
9823   echo "configure: failed program was:" >&5
9824   cat conftest.$ac_ext >&5
9825   rm -fr conftest*
9826   have_mmap=no
9827 fi
9828 rm -fr conftest* ;;
9829 esac
9830 echo "$ac_t""$have_mmap" 1>&6
9831 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9832     Defining HAVE_MMAP
9833 EOF
9834 cat >> confdefs.h <<\EOF
9835 #define HAVE_MMAP 1
9836 EOF
9837 }
9838
9839 for ac_hdr in unistd.h
9840 do
9841 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9842 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9843 echo "configure:9844: checking for $ac_hdr" >&5
9844
9845 cat > conftest.$ac_ext <<EOF
9846 #line 9847 "configure"
9847 #include "confdefs.h"
9848 #include <$ac_hdr>
9849 EOF
9850 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9851 { (eval echo configure:9852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9852 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9853 if test -z "$ac_err"; then
9854   rm -rf conftest*
9855   eval "ac_cv_header_$ac_safe=yes"
9856 else
9857   echo "$ac_err" >&5
9858   echo "configure: failed program was:" >&5
9859   cat conftest.$ac_ext >&5
9860   rm -rf conftest*
9861   eval "ac_cv_header_$ac_safe=no"
9862 fi
9863 rm -f conftest*
9864 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9865   echo "$ac_t""yes" 1>&6
9866     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9867   { test "$extra_verbose" = "yes" && cat << EOF
9868     Defining $ac_tr_hdr
9869 EOF
9870 cat >> confdefs.h <<EOF
9871 #define $ac_tr_hdr 1
9872 EOF
9873 }
9874  
9875 else
9876   echo "$ac_t""no" 1>&6
9877 fi
9878 done
9879
9880 for ac_func in getpagesize
9881 do
9882 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9883 echo "configure:9884: checking for $ac_func" >&5
9884
9885 cat > conftest.$ac_ext <<EOF
9886 #line 9887 "configure"
9887 #include "confdefs.h"
9888 /* System header to define __stub macros and hopefully few prototypes,
9889     which can conflict with char $ac_func(); below.  */
9890 #include <assert.h>
9891 /* Override any gcc2 internal prototype to avoid an error.  */
9892 /* We use char because int might match the return type of a gcc2
9893     builtin and then its argument prototype would still apply.  */
9894 char $ac_func();
9895
9896 int main() {
9897
9898 /* The GNU C library defines this for functions which it implements
9899     to always fail with ENOSYS.  Some functions are actually named
9900     something starting with __ and the normal name is an alias.  */
9901 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9902 choke me
9903 #else
9904 $ac_func();
9905 #endif
9906
9907 ; return 0; }
9908 EOF
9909 if { (eval echo configure:9910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9910   rm -rf conftest*
9911   eval "ac_cv_func_$ac_func=yes"
9912 else
9913   echo "configure: failed program was:" >&5
9914   cat conftest.$ac_ext >&5
9915   rm -rf conftest*
9916   eval "ac_cv_func_$ac_func=no"
9917 fi
9918 rm -f conftest*
9919
9920 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9921   echo "$ac_t""yes" 1>&6
9922     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9923   { test "$extra_verbose" = "yes" && cat << EOF
9924     Defining $ac_tr_func
9925 EOF
9926 cat >> confdefs.h <<EOF
9927 #define $ac_tr_func 1
9928 EOF
9929 }
9930  
9931 else
9932   echo "$ac_t""no" 1>&6
9933 fi
9934 done
9935
9936 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9937 echo "configure:9938: checking for working mmap" >&5
9938
9939 cat > conftest.$ac_ext <<EOF
9940 #line 9941 "configure"
9941 #include "confdefs.h"
9942
9943 /* Thanks to Mike Haertel and Jim Avera for this test.
9944    Here is a matrix of mmap possibilities:
9945         mmap private not fixed
9946         mmap private fixed at somewhere currently unmapped
9947         mmap private fixed at somewhere already mapped
9948         mmap shared not fixed
9949         mmap shared fixed at somewhere currently unmapped
9950         mmap shared fixed at somewhere already mapped
9951    For private mappings, we should verify that changes cannot be read()
9952    back from the file, nor mmap's back from the file at a different
9953    address.  (There have been systems where private was not correctly
9954    implemented like the infamous i386 svr4.0, and systems where the
9955    VM page cache was not coherent with the filesystem buffer cache
9956    like early versions of FreeBSD and possibly contemporary NetBSD.)
9957    For shared mappings, we should conversely verify that changes get
9958    propogated back to all the places they're supposed to be.
9959
9960    Grep wants private fixed already mapped.
9961    The main things grep needs to know about mmap are:
9962    * does it exist and is it safe to write into the mmap'd area
9963    * how to use it (BSD variants)  */
9964 #include <sys/types.h>
9965 #include <fcntl.h>
9966 #include <sys/mman.h>
9967
9968 /* This mess was copied from the GNU getpagesize.h.  */
9969 #ifndef HAVE_GETPAGESIZE
9970 # ifdef HAVE_UNISTD_H
9971 #  include <unistd.h>
9972 # endif
9973
9974 /* Assume that all systems that can run configure have sys/param.h.  */
9975 # ifndef HAVE_SYS_PARAM_H
9976 #  define HAVE_SYS_PARAM_H 1
9977 # endif
9978
9979 # ifdef _SC_PAGESIZE
9980 #  define getpagesize() sysconf(_SC_PAGESIZE)
9981 # else /* no _SC_PAGESIZE */
9982 #  ifdef HAVE_SYS_PARAM_H
9983 #   include <sys/param.h>
9984 #   ifdef EXEC_PAGESIZE
9985 #    define getpagesize() EXEC_PAGESIZE
9986 #   else /* no EXEC_PAGESIZE */
9987 #    ifdef NBPG
9988 #     define getpagesize() NBPG * CLSIZE
9989 #     ifndef CLSIZE
9990 #      define CLSIZE 1
9991 #     endif /* no CLSIZE */
9992 #    else /* no NBPG */
9993 #     ifdef NBPC
9994 #      define getpagesize() NBPC
9995 #     else /* no NBPC */
9996 #      ifdef PAGESIZE
9997 #       define getpagesize() PAGESIZE
9998 #      endif /* PAGESIZE */
9999 #     endif /* no NBPC */
10000 #    endif /* no NBPG */
10001 #   endif /* no EXEC_PAGESIZE */
10002 #  else /* no HAVE_SYS_PARAM_H */
10003 #   define getpagesize() 8192   /* punt totally */
10004 #  endif /* no HAVE_SYS_PARAM_H */
10005 # endif /* no _SC_PAGESIZE */
10006
10007 #endif /* no HAVE_GETPAGESIZE */
10008
10009 #ifdef __cplusplus
10010 extern "C" { void *malloc(unsigned); }
10011 #else
10012 char *malloc();
10013 #endif
10014
10015 int
10016 main()
10017 {
10018         char *data, *data2, *data3;
10019         int i, pagesize;
10020         int fd;
10021
10022         pagesize = getpagesize();
10023
10024         /*
10025          * First, make a file with some known garbage in it.
10026          */
10027         data = malloc(pagesize);
10028         if (!data)
10029                 exit(1);
10030         for (i = 0; i < pagesize; ++i)
10031                 *(data + i) = rand();
10032         umask(0);
10033         fd = creat("conftestmmap", 0600);
10034         if (fd < 0)
10035                 exit(1);
10036         if (write(fd, data, pagesize) != pagesize)
10037                 exit(1);
10038         close(fd);
10039
10040         /*
10041          * Next, try to mmap the file at a fixed address which
10042          * already has something else allocated at it.  If we can,
10043          * also make sure that we see the same garbage.
10044          */
10045         fd = open("conftestmmap", O_RDWR);
10046         if (fd < 0)
10047                 exit(1);
10048         data2 = malloc(2 * pagesize);
10049         if (!data2)
10050                 exit(1);
10051         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
10052         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
10053             MAP_PRIVATE | MAP_FIXED, fd, 0L))
10054                 exit(1);
10055         for (i = 0; i < pagesize; ++i)
10056                 if (*(data + i) != *(data2 + i))
10057                         exit(1);
10058
10059         /*
10060          * Finally, make sure that changes to the mapped area
10061          * do not percolate back to the file as seen by read().
10062          * (This is a bug on some variants of i386 svr4.0.)
10063          */
10064         for (i = 0; i < pagesize; ++i)
10065                 *(data2 + i) = *(data2 + i) + 1;
10066         data3 = malloc(pagesize);
10067         if (!data3)
10068                 exit(1);
10069         if (read(fd, data3, pagesize) != pagesize)
10070                 exit(1);
10071         for (i = 0; i < pagesize; ++i)
10072                 if (*(data + i) != *(data3 + i))
10073                         exit(1);
10074         close(fd);
10075         unlink("conftestmmap");
10076         exit(0);
10077 }
10078
10079 EOF
10080 if { (eval echo configure:10081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10081 then
10082   ac_cv_func_mmap_fixed_mapped=yes
10083 else
10084   conftest_rc="$?"
10085   echo "configure: failed program was:" >&5
10086   cat conftest.$ac_ext >&5
10087   rm -fr conftest*
10088   ac_cv_func_mmap_fixed_mapped=no
10089 fi
10090 rm -fr conftest*
10091
10092 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
10093 if test $ac_cv_func_mmap_fixed_mapped = yes; then
10094   { test "$extra_verbose" = "yes" && cat << \EOF
10095     Defining HAVE_MMAP
10096 EOF
10097 cat >> confdefs.h <<\EOF
10098 #define HAVE_MMAP 1
10099 EOF
10100 }
10101
10102 fi
10103
10104
10105 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
10106 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
10107 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10108     Defining REL_ALLOC
10109 EOF
10110 cat >> confdefs.h <<\EOF
10111 #define REL_ALLOC 1
10112 EOF
10113 }
10114
10115
10116 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
10117 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
10118 echo "configure:10119: checking for termios.h" >&5
10119
10120 cat > conftest.$ac_ext <<EOF
10121 #line 10122 "configure"
10122 #include "confdefs.h"
10123 #include <termios.h>
10124 EOF
10125 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10126 { (eval echo configure:10127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10127 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10128 if test -z "$ac_err"; then
10129   rm -rf conftest*
10130   eval "ac_cv_header_$ac_safe=yes"
10131 else
10132   echo "$ac_err" >&5
10133   echo "configure: failed program was:" >&5
10134   cat conftest.$ac_ext >&5
10135   rm -rf conftest*
10136   eval "ac_cv_header_$ac_safe=no"
10137 fi
10138 rm -f conftest*
10139 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10140   echo "$ac_t""yes" 1>&6
10141   { test "$extra_verbose" = "yes" && cat << \EOF
10142     Defining HAVE_TERMIOS
10143 EOF
10144 cat >> confdefs.h <<\EOF
10145 #define HAVE_TERMIOS 1
10146 EOF
10147 }
10148
10149   { test "$extra_verbose" = "yes" && cat << \EOF
10150     Defining SIGNALS_VIA_CHARACTERS
10151 EOF
10152 cat >> confdefs.h <<\EOF
10153 #define SIGNALS_VIA_CHARACTERS 1
10154 EOF
10155 }
10156
10157   { test "$extra_verbose" = "yes" && cat << \EOF
10158     Defining NO_TERMIO
10159 EOF
10160 cat >> confdefs.h <<\EOF
10161 #define NO_TERMIO 1
10162 EOF
10163 }
10164
10165 else
10166   echo "$ac_t""no" 1>&6
10167 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10168 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10169 echo "configure:10170: checking for termio.h" >&5
10170
10171 cat > conftest.$ac_ext <<EOF
10172 #line 10173 "configure"
10173 #include "confdefs.h"
10174 #include <termio.h>
10175 EOF
10176 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10177 { (eval echo configure:10178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10178 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10179 if test -z "$ac_err"; then
10180   rm -rf conftest*
10181   eval "ac_cv_header_$ac_safe=yes"
10182 else
10183   echo "$ac_err" >&5
10184   echo "configure: failed program was:" >&5
10185   cat conftest.$ac_ext >&5
10186   rm -rf conftest*
10187   eval "ac_cv_header_$ac_safe=no"
10188 fi
10189 rm -f conftest*
10190 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10191   echo "$ac_t""yes" 1>&6
10192   { test "$extra_verbose" = "yes" && cat << \EOF
10193     Defining HAVE_TERMIO
10194 EOF
10195 cat >> confdefs.h <<\EOF
10196 #define HAVE_TERMIO 1
10197 EOF
10198 }
10199
10200 else
10201   echo "$ac_t""no" 1>&6
10202 fi
10203
10204 fi
10205
10206
10207
10208 echo $ac_n "checking for socket""... $ac_c" 1>&6
10209 echo "configure:10210: checking for socket" >&5
10210
10211 cat > conftest.$ac_ext <<EOF
10212 #line 10213 "configure"
10213 #include "confdefs.h"
10214 /* System header to define __stub macros and hopefully few prototypes,
10215     which can conflict with char socket(); below.  */
10216 #include <assert.h>
10217 /* Override any gcc2 internal prototype to avoid an error.  */
10218 /* We use char because int might match the return type of a gcc2
10219     builtin and then its argument prototype would still apply.  */
10220 char socket();
10221
10222 int main() {
10223
10224 /* The GNU C library defines this for functions which it implements
10225     to always fail with ENOSYS.  Some functions are actually named
10226     something starting with __ and the normal name is an alias.  */
10227 #if defined (__stub_socket) || defined (__stub___socket)
10228 choke me
10229 #else
10230 socket();
10231 #endif
10232
10233 ; return 0; }
10234 EOF
10235 if { (eval echo configure:10236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10236   rm -rf conftest*
10237   eval "ac_cv_func_socket=yes"
10238 else
10239   echo "configure: failed program was:" >&5
10240   cat conftest.$ac_ext >&5
10241   rm -rf conftest*
10242   eval "ac_cv_func_socket=no"
10243 fi
10244 rm -f conftest*
10245
10246 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10247   echo "$ac_t""yes" 1>&6
10248   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10249 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10250 echo "configure:10251: checking for netinet/in.h" >&5
10251
10252 cat > conftest.$ac_ext <<EOF
10253 #line 10254 "configure"
10254 #include "confdefs.h"
10255 #include <netinet/in.h>
10256 EOF
10257 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10258 { (eval echo configure:10259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10259 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10260 if test -z "$ac_err"; then
10261   rm -rf conftest*
10262   eval "ac_cv_header_$ac_safe=yes"
10263 else
10264   echo "$ac_err" >&5
10265   echo "configure: failed program was:" >&5
10266   cat conftest.$ac_ext >&5
10267   rm -rf conftest*
10268   eval "ac_cv_header_$ac_safe=no"
10269 fi
10270 rm -f conftest*
10271 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10272   echo "$ac_t""yes" 1>&6
10273   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10274 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10275 echo "configure:10276: checking for arpa/inet.h" >&5
10276
10277 cat > conftest.$ac_ext <<EOF
10278 #line 10279 "configure"
10279 #include "confdefs.h"
10280 #include <arpa/inet.h>
10281 EOF
10282 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10283 { (eval echo configure:10284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10284 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10285 if test -z "$ac_err"; then
10286   rm -rf conftest*
10287   eval "ac_cv_header_$ac_safe=yes"
10288 else
10289   echo "$ac_err" >&5
10290   echo "configure: failed program was:" >&5
10291   cat conftest.$ac_ext >&5
10292   rm -rf conftest*
10293   eval "ac_cv_header_$ac_safe=no"
10294 fi
10295 rm -f conftest*
10296 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10297   echo "$ac_t""yes" 1>&6
10298   
10299   { test "$extra_verbose" = "yes" && cat << \EOF
10300     Defining HAVE_SOCKETS
10301 EOF
10302 cat >> confdefs.h <<\EOF
10303 #define HAVE_SOCKETS 1
10304 EOF
10305 }
10306
10307       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10308 echo "configure:10309: checking "for sun_len member in struct sockaddr_un"" >&5
10309       cat > conftest.$ac_ext <<EOF
10310 #line 10311 "configure"
10311 #include "confdefs.h"
10312
10313 #include <sys/types.h>
10314 #include <sys/socket.h>
10315 #include <sys/un.h>
10316       
10317 int main() {
10318 static struct sockaddr_un x; x.sun_len = 1;
10319 ; return 0; }
10320 EOF
10321 if { (eval echo configure:10322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10322   rm -rf conftest*
10323   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10324     Defining HAVE_SOCKADDR_SUN_LEN
10325 EOF
10326 cat >> confdefs.h <<\EOF
10327 #define HAVE_SOCKADDR_SUN_LEN 1
10328 EOF
10329 }
10330
10331 else
10332   echo "configure: failed program was:" >&5
10333   cat conftest.$ac_ext >&5
10334   rm -rf conftest*
10335   echo "$ac_t""no" 1>&6
10336 fi
10337 rm -f conftest*
10338       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10339 echo "configure:10340: checking "for ip_mreq struct in netinet/in.h"" >&5
10340       cat > conftest.$ac_ext <<EOF
10341 #line 10342 "configure"
10342 #include "confdefs.h"
10343
10344 #include <sys/types.h>
10345 #include <netinet/in.h>
10346       
10347 int main() {
10348 static struct ip_mreq x;
10349 ; return 0; }
10350 EOF
10351 if { (eval echo configure:10352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10352   rm -rf conftest*
10353   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10354     Defining HAVE_MULTICAST
10355 EOF
10356 cat >> confdefs.h <<\EOF
10357 #define HAVE_MULTICAST 1
10358 EOF
10359 }
10360
10361 else
10362   echo "configure: failed program was:" >&5
10363   cat conftest.$ac_ext >&5
10364   rm -rf conftest*
10365   echo "$ac_t""no" 1>&6
10366 fi
10367 rm -f conftest*
10368 else
10369   echo "$ac_t""no" 1>&6
10370 fi
10371
10372 else
10373   echo "$ac_t""no" 1>&6
10374 fi
10375
10376 else
10377   echo "$ac_t""no" 1>&6
10378 fi
10379
10380
10381 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10382 echo "configure:10383: checking for msgget" >&5
10383
10384 cat > conftest.$ac_ext <<EOF
10385 #line 10386 "configure"
10386 #include "confdefs.h"
10387 /* System header to define __stub macros and hopefully few prototypes,
10388     which can conflict with char msgget(); below.  */
10389 #include <assert.h>
10390 /* Override any gcc2 internal prototype to avoid an error.  */
10391 /* We use char because int might match the return type of a gcc2
10392     builtin and then its argument prototype would still apply.  */
10393 char msgget();
10394
10395 int main() {
10396
10397 /* The GNU C library defines this for functions which it implements
10398     to always fail with ENOSYS.  Some functions are actually named
10399     something starting with __ and the normal name is an alias.  */
10400 #if defined (__stub_msgget) || defined (__stub___msgget)
10401 choke me
10402 #else
10403 msgget();
10404 #endif
10405
10406 ; return 0; }
10407 EOF
10408 if { (eval echo configure:10409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10409   rm -rf conftest*
10410   eval "ac_cv_func_msgget=yes"
10411 else
10412   echo "configure: failed program was:" >&5
10413   cat conftest.$ac_ext >&5
10414   rm -rf conftest*
10415   eval "ac_cv_func_msgget=no"
10416 fi
10417 rm -f conftest*
10418
10419 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10420   echo "$ac_t""yes" 1>&6
10421   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10422 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10423 echo "configure:10424: checking for sys/ipc.h" >&5
10424
10425 cat > conftest.$ac_ext <<EOF
10426 #line 10427 "configure"
10427 #include "confdefs.h"
10428 #include <sys/ipc.h>
10429 EOF
10430 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10431 { (eval echo configure:10432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10432 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10433 if test -z "$ac_err"; then
10434   rm -rf conftest*
10435   eval "ac_cv_header_$ac_safe=yes"
10436 else
10437   echo "$ac_err" >&5
10438   echo "configure: failed program was:" >&5
10439   cat conftest.$ac_ext >&5
10440   rm -rf conftest*
10441   eval "ac_cv_header_$ac_safe=no"
10442 fi
10443 rm -f conftest*
10444 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10445   echo "$ac_t""yes" 1>&6
10446   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10447 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10448 echo "configure:10449: checking for sys/msg.h" >&5
10449
10450 cat > conftest.$ac_ext <<EOF
10451 #line 10452 "configure"
10452 #include "confdefs.h"
10453 #include <sys/msg.h>
10454 EOF
10455 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10456 { (eval echo configure:10457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10457 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10458 if test -z "$ac_err"; then
10459   rm -rf conftest*
10460   eval "ac_cv_header_$ac_safe=yes"
10461 else
10462   echo "$ac_err" >&5
10463   echo "configure: failed program was:" >&5
10464   cat conftest.$ac_ext >&5
10465   rm -rf conftest*
10466   eval "ac_cv_header_$ac_safe=no"
10467 fi
10468 rm -f conftest*
10469 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10470   echo "$ac_t""yes" 1>&6
10471   { test "$extra_verbose" = "yes" && cat << \EOF
10472     Defining HAVE_SYSVIPC
10473 EOF
10474 cat >> confdefs.h <<\EOF
10475 #define HAVE_SYSVIPC 1
10476 EOF
10477 }
10478
10479 else
10480   echo "$ac_t""no" 1>&6
10481 fi
10482
10483 else
10484   echo "$ac_t""no" 1>&6
10485 fi
10486
10487 else
10488   echo "$ac_t""no" 1>&6
10489 fi
10490
10491
10492 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10493 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10494 echo "configure:10495: checking for dirent.h" >&5
10495
10496 cat > conftest.$ac_ext <<EOF
10497 #line 10498 "configure"
10498 #include "confdefs.h"
10499 #include <dirent.h>
10500 EOF
10501 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10502 { (eval echo configure:10503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10503 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10504 if test -z "$ac_err"; then
10505   rm -rf conftest*
10506   eval "ac_cv_header_$ac_safe=yes"
10507 else
10508   echo "$ac_err" >&5
10509   echo "configure: failed program was:" >&5
10510   cat conftest.$ac_ext >&5
10511   rm -rf conftest*
10512   eval "ac_cv_header_$ac_safe=no"
10513 fi
10514 rm -f conftest*
10515 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10516   echo "$ac_t""yes" 1>&6
10517   { test "$extra_verbose" = "yes" && cat << \EOF
10518     Defining SYSV_SYSTEM_DIR
10519 EOF
10520 cat >> confdefs.h <<\EOF
10521 #define SYSV_SYSTEM_DIR 1
10522 EOF
10523 }
10524
10525 else
10526   echo "$ac_t""no" 1>&6
10527 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10528 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10529 echo "configure:10530: checking for sys/dir.h" >&5
10530
10531 cat > conftest.$ac_ext <<EOF
10532 #line 10533 "configure"
10533 #include "confdefs.h"
10534 #include <sys/dir.h>
10535 EOF
10536 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10537 { (eval echo configure:10538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10538 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10539 if test -z "$ac_err"; then
10540   rm -rf conftest*
10541   eval "ac_cv_header_$ac_safe=yes"
10542 else
10543   echo "$ac_err" >&5
10544   echo "configure: failed program was:" >&5
10545   cat conftest.$ac_ext >&5
10546   rm -rf conftest*
10547   eval "ac_cv_header_$ac_safe=no"
10548 fi
10549 rm -f conftest*
10550 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10551   echo "$ac_t""yes" 1>&6
10552   :
10553 else
10554   echo "$ac_t""no" 1>&6
10555 { test "$extra_verbose" = "yes" && cat << \EOF
10556     Defining NONSYSTEM_DIR_LIBRARY
10557 EOF
10558 cat >> confdefs.h <<\EOF
10559 #define NONSYSTEM_DIR_LIBRARY 1
10560 EOF
10561 }
10562
10563 fi
10564
10565 fi
10566
10567
10568 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10569 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10570 echo "configure:10571: checking for nlist.h" >&5
10571
10572 cat > conftest.$ac_ext <<EOF
10573 #line 10574 "configure"
10574 #include "confdefs.h"
10575 #include <nlist.h>
10576 EOF
10577 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10578 { (eval echo configure:10579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10579 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10580 if test -z "$ac_err"; then
10581   rm -rf conftest*
10582   eval "ac_cv_header_$ac_safe=yes"
10583 else
10584   echo "$ac_err" >&5
10585   echo "configure: failed program was:" >&5
10586   cat conftest.$ac_ext >&5
10587   rm -rf conftest*
10588   eval "ac_cv_header_$ac_safe=no"
10589 fi
10590 rm -f conftest*
10591 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10592   echo "$ac_t""yes" 1>&6
10593   { test "$extra_verbose" = "yes" && cat << \EOF
10594     Defining NLIST_STRUCT
10595 EOF
10596 cat >> confdefs.h <<\EOF
10597 #define NLIST_STRUCT 1
10598 EOF
10599 }
10600
10601 else
10602   echo "$ac_t""no" 1>&6
10603 fi
10604
10605
10606
10607 echo "checking "for sound support"" 1>&6
10608 echo "configure:10609: checking "for sound support"" >&5
10609 case "$with_sound" in
10610   native | both ) with_native_sound=yes;;
10611   nas    | no   ) with_native_sound=no;;
10612 esac
10613 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10614
10615 if test "$with_native_sound" != "no"; then
10616     if test -n "$native_sound_lib"; then
10617     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10618 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10619 echo "configure:10620: checking for multimedia/audio_device.h" >&5
10620
10621 cat > conftest.$ac_ext <<EOF
10622 #line 10623 "configure"
10623 #include "confdefs.h"
10624 #include <multimedia/audio_device.h>
10625 EOF
10626 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10627 { (eval echo configure:10628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10628 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10629 if test -z "$ac_err"; then
10630   rm -rf conftest*
10631   eval "ac_cv_header_$ac_safe=yes"
10632 else
10633   echo "$ac_err" >&5
10634   echo "configure: failed program was:" >&5
10635   cat conftest.$ac_ext >&5
10636   rm -rf conftest*
10637   eval "ac_cv_header_$ac_safe=no"
10638 fi
10639 rm -f conftest*
10640 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10641   echo "$ac_t""yes" 1>&6
10642   sound_found=yes sound_cflags=""
10643       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10644    echo "    xemacs will be linked with \"sunplay.o\""
10645  fi
10646 else
10647   echo "$ac_t""no" 1>&6
10648 fi
10649
10650   fi
10651
10652     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10653     sound_found=yes
10654     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10655    echo "    xemacs will be linked with \"sunplay.o\""
10656  fi
10657     if test -d "/usr/demo/SOUND/include"
10658       then sound_cflags="-I/usr/demo/SOUND/include"
10659       else sound_cflags="-I/usr/demo/SOUND"
10660     fi
10661     if test -z "$native_sound_lib" ; then
10662       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10663         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10664         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10665       fi
10666     fi
10667   fi
10668
10669     if test -z "$sound_found"; then
10670     case "$canonical" in
10671     *-sgi-* )
10672       if test -z "$native_sound_lib"; then
10673         
10674 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10675 echo "configure:10676: checking for ALopenport in -laudio" >&5
10676 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10677
10678 xe_check_libs=" -laudio "
10679 cat > conftest.$ac_ext <<EOF
10680 #line 10681 "configure"
10681 #include "confdefs.h"
10682 /* Override any gcc2 internal prototype to avoid an error.  */
10683 /* We use char because int might match the return type of a gcc2
10684     builtin and then its argument prototype would still apply.  */
10685 char ALopenport();
10686
10687 int main() {
10688 ALopenport()
10689 ; return 0; }
10690 EOF
10691 if { (eval echo configure:10692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10692   rm -rf conftest*
10693   eval "ac_cv_lib_$ac_lib_var=yes"
10694 else
10695   echo "configure: failed program was:" >&5
10696   cat conftest.$ac_ext >&5
10697   rm -rf conftest*
10698   eval "ac_cv_lib_$ac_lib_var=no"
10699 fi
10700 rm -f conftest*
10701 xe_check_libs=""
10702
10703 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10704   echo "$ac_t""yes" 1>&6
10705   native_sound_lib="-laudio"
10706 else
10707   echo "$ac_t""no" 1>&6
10708 fi
10709
10710
10711       fi
10712       if test -n "$native_sound_lib"; then
10713         sound_found=yes sound_cflags=""
10714         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10715    echo "    xemacs will be linked with \"sgiplay.o\""
10716  fi
10717       fi ;;
10718     hppa*-hp-hpux* )
10719       if test -z "$native_sound_lib"; then
10720         
10721 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10722 echo "configure:10723: checking for AOpenAudio in -lAlib" >&5
10723 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10724
10725 xe_check_libs=" -lAlib "
10726 cat > conftest.$ac_ext <<EOF
10727 #line 10728 "configure"
10728 #include "confdefs.h"
10729 /* Override any gcc2 internal prototype to avoid an error.  */
10730 /* We use char because int might match the return type of a gcc2
10731     builtin and then its argument prototype would still apply.  */
10732 char AOpenAudio();
10733
10734 int main() {
10735 AOpenAudio()
10736 ; return 0; }
10737 EOF
10738 if { (eval echo configure:10739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10739   rm -rf conftest*
10740   eval "ac_cv_lib_$ac_lib_var=yes"
10741 else
10742   echo "configure: failed program was:" >&5
10743   cat conftest.$ac_ext >&5
10744   rm -rf conftest*
10745   eval "ac_cv_lib_$ac_lib_var=no"
10746 fi
10747 rm -f conftest*
10748 xe_check_libs=""
10749
10750 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10751   echo "$ac_t""yes" 1>&6
10752   native_sound_lib="-lAlib"
10753 else
10754   echo "$ac_t""no" 1>&6
10755 fi
10756
10757
10758       fi
10759       if test -n "$native_sound_lib"; then
10760         sound_found=yes
10761         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10762    echo "    xemacs will be linked with \"hpplay.o\""
10763  fi
10764         if test "$GCC" = "yes" # Kludge city
10765           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10766           else sound_cflags="+e -I/usr/audio/examples"
10767         fi
10768       fi ;;
10769     esac
10770   fi
10771
10772     if test -z "$sound_found"; then
10773     for dir in "machine" "sys" "linux"; do
10774       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10775 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10776 echo "configure:10777: checking for ${dir}/soundcard.h" >&5
10777
10778 cat > conftest.$ac_ext <<EOF
10779 #line 10780 "configure"
10780 #include "confdefs.h"
10781 #include <${dir}/soundcard.h>
10782 EOF
10783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10784 { (eval echo configure:10785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10785 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10786 if test -z "$ac_err"; then
10787   rm -rf conftest*
10788   eval "ac_cv_header_$ac_safe=yes"
10789 else
10790   echo "$ac_err" >&5
10791   echo "configure: failed program was:" >&5
10792   cat conftest.$ac_ext >&5
10793   rm -rf conftest*
10794   eval "ac_cv_header_$ac_safe=no"
10795 fi
10796 rm -f conftest*
10797 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10798   echo "$ac_t""yes" 1>&6
10799   sound_found=yes
10800         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10801    echo "    xemacs will be linked with \"linuxplay.o\""
10802  fi
10803         { test "$extra_verbose" = "yes" && cat << EOF
10804     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10805 EOF
10806 cat >> confdefs.h <<EOF
10807 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10808 EOF
10809 }
10810
10811         break
10812 else
10813   echo "$ac_t""no" 1>&6
10814 fi
10815
10816     done
10817   fi
10818
10819   test "$sound_found" = "yes" && with_native_sound=yes
10820 fi
10821
10822 if test -z "$with_sound"; then
10823   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10824     with_sound=native
10825   fi
10826 fi
10827
10828 if test "$with_native_sound" = "yes"; then
10829   { test "$extra_verbose" = "yes" && cat << \EOF
10830     Defining HAVE_NATIVE_SOUND
10831 EOF
10832 cat >> confdefs.h <<\EOF
10833 #define HAVE_NATIVE_SOUND 1
10834 EOF
10835 }
10836
10837   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10838 fi
10839
10840 case "$with_sound" in both | nas )
10841   { test "$extra_verbose" = "yes" && cat << \EOF
10842     Defining HAVE_NAS_SOUND
10843 EOF
10844 cat >> confdefs.h <<\EOF
10845 #define HAVE_NAS_SOUND 1
10846 EOF
10847 }
10848
10849   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10850    echo "    xemacs will be linked with \"nas.o\""
10851  fi
10852   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10853       cat > conftest.$ac_ext <<EOF
10854 #line 10855 "configure"
10855 #include "confdefs.h"
10856 #include <audio/Xtutil.h>
10857 EOF
10858 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10859   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10860   :
10861 else
10862   rm -rf conftest*
10863   { test "$extra_verbose" = "yes" && cat << \EOF
10864     Defining NAS_NO_ERROR_JUMP
10865 EOF
10866 cat >> confdefs.h <<\EOF
10867 #define NAS_NO_ERROR_JUMP 1
10868 EOF
10869 }
10870
10871 fi
10872 rm -f conftest*
10873
10874 esac
10875
10876
10877 test -z "$with_tty" && with_tty=yes
10878
10879 if test "$with_tty" = "yes"  ; then
10880   echo "checking for TTY-related features" 1>&6
10881 echo "configure:10882: checking for TTY-related features" >&5
10882   { test "$extra_verbose" = "yes" && cat << \EOF
10883     Defining HAVE_TTY
10884 EOF
10885 cat >> confdefs.h <<\EOF
10886 #define HAVE_TTY 1
10887 EOF
10888 }
10889
10890   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
10891    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\""
10892  fi
10893
10894     if test -z "$with_ncurses"; then
10895     
10896 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10897 echo "configure:10898: checking for tgetent in -lncurses" >&5
10898 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10899
10900 xe_check_libs=" -lncurses "
10901 cat > conftest.$ac_ext <<EOF
10902 #line 10903 "configure"
10903 #include "confdefs.h"
10904 /* Override any gcc2 internal prototype to avoid an error.  */
10905 /* We use char because int might match the return type of a gcc2
10906     builtin and then its argument prototype would still apply.  */
10907 char tgetent();
10908
10909 int main() {
10910 tgetent()
10911 ; return 0; }
10912 EOF
10913 if { (eval echo configure:10914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10914   rm -rf conftest*
10915   eval "ac_cv_lib_$ac_lib_var=yes"
10916 else
10917   echo "configure: failed program was:" >&5
10918   cat conftest.$ac_ext >&5
10919   rm -rf conftest*
10920   eval "ac_cv_lib_$ac_lib_var=no"
10921 fi
10922 rm -f conftest*
10923 xe_check_libs=""
10924
10925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10926   echo "$ac_t""yes" 1>&6
10927   with_ncurses=yes
10928 else
10929   echo "$ac_t""no" 1>&6
10930 with_ncurses=no
10931 fi
10932
10933
10934   fi
10935   if test "$with_ncurses" = "yes"; then
10936     { test "$extra_verbose" = "yes" && cat << \EOF
10937     Defining HAVE_NCURSES
10938 EOF
10939 cat >> confdefs.h <<\EOF
10940 #define HAVE_NCURSES 1
10941 EOF
10942 }
10943
10944     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10945 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10946 echo "configure:10947: checking for ncurses/curses.h" >&5
10947
10948 cat > conftest.$ac_ext <<EOF
10949 #line 10950 "configure"
10950 #include "confdefs.h"
10951 #include <ncurses/curses.h>
10952 EOF
10953 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10954 { (eval echo configure:10955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10955 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10956 if test -z "$ac_err"; then
10957   rm -rf conftest*
10958   eval "ac_cv_header_$ac_safe=yes"
10959 else
10960   echo "$ac_err" >&5
10961   echo "configure: failed program was:" >&5
10962   cat conftest.$ac_ext >&5
10963   rm -rf conftest*
10964   eval "ac_cv_header_$ac_safe=no"
10965 fi
10966 rm -f conftest*
10967 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10968   echo "$ac_t""yes" 1>&6
10969   curses_h_path=ncurses/curses.h
10970 else
10971   echo "$ac_t""no" 1>&6
10972 fi
10973
10974     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10975 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10976 echo "configure:10977: checking for ncurses/term.h" >&5
10977
10978 cat > conftest.$ac_ext <<EOF
10979 #line 10980 "configure"
10980 #include "confdefs.h"
10981 #include <ncurses/term.h>
10982 EOF
10983 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10984 { (eval echo configure:10985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10985 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10986 if test -z "$ac_err"; then
10987   rm -rf conftest*
10988   eval "ac_cv_header_$ac_safe=yes"
10989 else
10990   echo "$ac_err" >&5
10991   echo "configure: failed program was:" >&5
10992   cat conftest.$ac_ext >&5
10993   rm -rf conftest*
10994   eval "ac_cv_header_$ac_safe=no"
10995 fi
10996 rm -f conftest*
10997 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10998   echo "$ac_t""yes" 1>&6
10999   term_h_path=ncurses/term.h
11000 else
11001   echo "$ac_t""no" 1>&6
11002 fi
11003
11004     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
11005    echo "    xemacs will be linked with \"terminfo.o\""
11006  fi
11007     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
11008
11009     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
11010                         save_c_switch_site="$c_switch_site"
11011       c_switch_site="$c_switch_site -I/usr/include/ncurses"
11012       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
11013 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
11014 echo "configure:11015: checking for ncurses/curses.h" >&5
11015
11016 cat > conftest.$ac_ext <<EOF
11017 #line 11018 "configure"
11018 #include "confdefs.h"
11019 #include <ncurses/curses.h>
11020 EOF
11021 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11022 { (eval echo configure:11023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11023 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11024 if test -z "$ac_err"; then
11025   rm -rf conftest*
11026   eval "ac_cv_header_$ac_safe=yes"
11027 else
11028   echo "$ac_err" >&5
11029   echo "configure: failed program was:" >&5
11030   cat conftest.$ac_ext >&5
11031   rm -rf conftest*
11032   eval "ac_cv_header_$ac_safe=no"
11033 fi
11034 rm -f conftest*
11035 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11036   echo "$ac_t""yes" 1>&6
11037   curses_h_path=ncurses/curses.h
11038 else
11039   echo "$ac_t""no" 1>&6
11040 fi
11041
11042       if test "$ac_cv_header_ncurses_curses_h" = "yes"
11043         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
11044         else c_switch_site="$save_c_switch_site"
11045       fi
11046     fi
11047   else         if test "$have_terminfo" = "yes"; then
11048       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
11049    echo "    xemacs will be linked with \"terminfo.o\""
11050  fi
11051       if test -n "$libs_termcap"; then
11052         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11053       else
11054         for lib in curses termlib termcap; do
11055           
11056 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
11057 echo "configure:11058: checking for tgetent in -l$lib" >&5
11058 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
11059
11060 xe_check_libs=" -l$lib "
11061 cat > conftest.$ac_ext <<EOF
11062 #line 11063 "configure"
11063 #include "confdefs.h"
11064 /* Override any gcc2 internal prototype to avoid an error.  */
11065 /* We use char because int might match the return type of a gcc2
11066     builtin and then its argument prototype would still apply.  */
11067 char tgetent();
11068
11069 int main() {
11070 tgetent()
11071 ; return 0; }
11072 EOF
11073 if { (eval echo configure:11074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11074   rm -rf conftest*
11075   eval "ac_cv_lib_$ac_lib_var=yes"
11076 else
11077   echo "configure: failed program was:" >&5
11078   cat conftest.$ac_ext >&5
11079   rm -rf conftest*
11080   eval "ac_cv_lib_$ac_lib_var=no"
11081 fi
11082 rm -f conftest*
11083 xe_check_libs=""
11084
11085 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11086   echo "$ac_t""yes" 1>&6
11087   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
11088 else
11089   echo "$ac_t""no" 1>&6
11090 fi
11091
11092
11093         done
11094       fi
11095     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
11096    echo "    xemacs will be linked with \"tparam.o\""
11097  fi
11098                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
11099       if test -n "$libs_termcap"; then
11100         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11101       else
11102         
11103 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
11104 echo "configure:11105: checking for tgetent in -lcurses" >&5
11105 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
11106
11107 xe_check_libs=" -lcurses "
11108 cat > conftest.$ac_ext <<EOF
11109 #line 11110 "configure"
11110 #include "confdefs.h"
11111 /* Override any gcc2 internal prototype to avoid an error.  */
11112 /* We use char because int might match the return type of a gcc2
11113     builtin and then its argument prototype would still apply.  */
11114 char tgetent();
11115
11116 int main() {
11117 tgetent()
11118 ; return 0; }
11119 EOF
11120 if { (eval echo configure:11121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11121   rm -rf conftest*
11122   eval "ac_cv_lib_$ac_lib_var=yes"
11123 else
11124   echo "configure: failed program was:" >&5
11125   cat conftest.$ac_ext >&5
11126   rm -rf conftest*
11127   eval "ac_cv_lib_$ac_lib_var=no"
11128 fi
11129 rm -f conftest*
11130 xe_check_libs=""
11131
11132 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11133   echo "$ac_t""yes" 1>&6
11134   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
11135 else
11136   echo "$ac_t""no" 1>&6
11137 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
11138 echo "configure:11139: checking for tgetent in -ltermcap" >&5
11139 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
11140
11141 xe_check_libs=" -ltermcap "
11142 cat > conftest.$ac_ext <<EOF
11143 #line 11144 "configure"
11144 #include "confdefs.h"
11145 /* Override any gcc2 internal prototype to avoid an error.  */
11146 /* We use char because int might match the return type of a gcc2
11147     builtin and then its argument prototype would still apply.  */
11148 char tgetent();
11149
11150 int main() {
11151 tgetent()
11152 ; return 0; }
11153 EOF
11154 if { (eval echo configure:11155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11155   rm -rf conftest*
11156   eval "ac_cv_lib_$ac_lib_var=yes"
11157 else
11158   echo "configure: failed program was:" >&5
11159   cat conftest.$ac_ext >&5
11160   rm -rf conftest*
11161   eval "ac_cv_lib_$ac_lib_var=no"
11162 fi
11163 rm -f conftest*
11164 xe_check_libs=""
11165
11166 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11167   echo "$ac_t""yes" 1>&6
11168   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11169 else
11170   echo "$ac_t""no" 1>&6
11171 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11172    echo "    xemacs will be linked with \"termcap.o\""
11173  fi
11174 fi
11175
11176
11177 fi
11178
11179
11180       fi
11181     fi
11182   fi
11183   { test "$extra_verbose" = "yes" && cat << EOF
11184     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11185 EOF
11186 cat >> confdefs.h <<EOF
11187 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11188 EOF
11189 }
11190
11191   { test "$extra_verbose" = "yes" && cat << EOF
11192     Defining TERM_H_PATH = "${term_h_path-term.h}"
11193 EOF
11194 cat >> confdefs.h <<EOF
11195 #define TERM_H_PATH "${term_h_path-term.h}"
11196 EOF
11197 }
11198
11199
11200     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11201 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11202 echo "configure:11203: checking for gpm.h" >&5
11203
11204 cat > conftest.$ac_ext <<EOF
11205 #line 11206 "configure"
11206 #include "confdefs.h"
11207 #include <gpm.h>
11208 EOF
11209 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11210 { (eval echo configure:11211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11211 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11212 if test -z "$ac_err"; then
11213   rm -rf conftest*
11214   eval "ac_cv_header_$ac_safe=yes"
11215 else
11216   echo "$ac_err" >&5
11217   echo "configure: failed program was:" >&5
11218   cat conftest.$ac_ext >&5
11219   rm -rf conftest*
11220   eval "ac_cv_header_$ac_safe=no"
11221 fi
11222 rm -f conftest*
11223 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11224   echo "$ac_t""yes" 1>&6
11225   :
11226 else
11227   echo "$ac_t""no" 1>&6
11228 with_gpm=no
11229 fi
11230  }
11231   test -z "$with_gpm" && { 
11232 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11233 echo "configure:11234: checking for Gpm_Open in -lgpm" >&5
11234 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11235
11236 xe_check_libs=" -lgpm "
11237 cat > conftest.$ac_ext <<EOF
11238 #line 11239 "configure"
11239 #include "confdefs.h"
11240 /* Override any gcc2 internal prototype to avoid an error.  */
11241 /* We use char because int might match the return type of a gcc2
11242     builtin and then its argument prototype would still apply.  */
11243 char Gpm_Open();
11244
11245 int main() {
11246 Gpm_Open()
11247 ; return 0; }
11248 EOF
11249 if { (eval echo configure:11250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11250   rm -rf conftest*
11251   eval "ac_cv_lib_$ac_lib_var=yes"
11252 else
11253   echo "configure: failed program was:" >&5
11254   cat conftest.$ac_ext >&5
11255   rm -rf conftest*
11256   eval "ac_cv_lib_$ac_lib_var=no"
11257 fi
11258 rm -f conftest*
11259 xe_check_libs=""
11260
11261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11262   echo "$ac_t""yes" 1>&6
11263   with_gpm=yes
11264 else
11265   echo "$ac_t""no" 1>&6
11266 with_gpm=no
11267 fi
11268
11269  }
11270   if test "$with_gpm" = "yes"; then
11271     { test "$extra_verbose" = "yes" && cat << \EOF
11272     Defining HAVE_GPM
11273 EOF
11274 cat >> confdefs.h <<\EOF
11275 #define HAVE_GPM 1
11276 EOF
11277 }
11278
11279     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11280    echo "    xemacs will be linked with \"gpmevent.o\""
11281  fi
11282     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11283   fi
11284
11285 else   for feature in ncurses gpm; do
11286     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11287       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11288     fi
11289     eval "with_${feature}=no"
11290   done
11291 fi 
11292 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11293    echo "    xemacs will be linked with \"event-unixoid.o\""
11294  fi
11295
11296
11297 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11298   != "no no no" && echo "checking for database support" 1>&6
11299 echo "configure:11300: checking for database support" >&5
11300
11301 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11302   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11303 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11304 echo "configure:11305: checking for ndbm.h" >&5
11305
11306 cat > conftest.$ac_ext <<EOF
11307 #line 11308 "configure"
11308 #include "confdefs.h"
11309 #include <ndbm.h>
11310 EOF
11311 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11312 { (eval echo configure:11313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11313 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11314 if test -z "$ac_err"; then
11315   rm -rf conftest*
11316   eval "ac_cv_header_$ac_safe=yes"
11317 else
11318   echo "$ac_err" >&5
11319   echo "configure: failed program was:" >&5
11320   cat conftest.$ac_ext >&5
11321   rm -rf conftest*
11322   eval "ac_cv_header_$ac_safe=no"
11323 fi
11324 rm -f conftest*
11325 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11326   echo "$ac_t""yes" 1>&6
11327   :
11328 else
11329   echo "$ac_t""no" 1>&6
11330
11331     test "$with_database_gnudbm" = "yes" -o \
11332          "$with_database_dbm"    = "yes" && \
11333       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11334     with_database_gnudbm=no with_database_dbm=no
11335 fi
11336
11337 fi
11338
11339 if test "$with_database_gnudbm" != "no"; then
11340   
11341 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11342 echo "configure:11343: checking for dbm_open in -lgdbm" >&5
11343 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11344
11345 xe_check_libs=" -lgdbm "
11346 cat > conftest.$ac_ext <<EOF
11347 #line 11348 "configure"
11348 #include "confdefs.h"
11349 /* Override any gcc2 internal prototype to avoid an error.  */
11350 /* We use char because int might match the return type of a gcc2
11351     builtin and then its argument prototype would still apply.  */
11352 char dbm_open();
11353
11354 int main() {
11355 dbm_open()
11356 ; return 0; }
11357 EOF
11358 if { (eval echo configure:11359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11359   rm -rf conftest*
11360   eval "ac_cv_lib_$ac_lib_var=yes"
11361 else
11362   echo "configure: failed program was:" >&5
11363   cat conftest.$ac_ext >&5
11364   rm -rf conftest*
11365   eval "ac_cv_lib_$ac_lib_var=no"
11366 fi
11367 rm -f conftest*
11368 xe_check_libs=""
11369
11370 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11371   echo "$ac_t""yes" 1>&6
11372   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11373 else
11374   echo "$ac_t""no" 1>&6
11375 if test "$with_database_gnudbm" = "yes"; then
11376      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11377    fi
11378    with_database_gnudbm=no
11379 fi
11380
11381
11382 fi
11383
11384 if test "$with_database_dbm" != "no"; then
11385   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11386 echo "configure:11387: checking for dbm_open" >&5
11387
11388 cat > conftest.$ac_ext <<EOF
11389 #line 11390 "configure"
11390 #include "confdefs.h"
11391 /* System header to define __stub macros and hopefully few prototypes,
11392     which can conflict with char dbm_open(); below.  */
11393 #include <assert.h>
11394 /* Override any gcc2 internal prototype to avoid an error.  */
11395 /* We use char because int might match the return type of a gcc2
11396     builtin and then its argument prototype would still apply.  */
11397 char dbm_open();
11398
11399 int main() {
11400
11401 /* The GNU C library defines this for functions which it implements
11402     to always fail with ENOSYS.  Some functions are actually named
11403     something starting with __ and the normal name is an alias.  */
11404 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11405 choke me
11406 #else
11407 dbm_open();
11408 #endif
11409
11410 ; return 0; }
11411 EOF
11412 if { (eval echo configure:11413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11413   rm -rf conftest*
11414   eval "ac_cv_func_dbm_open=yes"
11415 else
11416   echo "configure: failed program was:" >&5
11417   cat conftest.$ac_ext >&5
11418   rm -rf conftest*
11419   eval "ac_cv_func_dbm_open=no"
11420 fi
11421 rm -f conftest*
11422
11423 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11424   echo "$ac_t""yes" 1>&6
11425   with_database_dbm=yes libdbm=
11426 else
11427   echo "$ac_t""no" 1>&6
11428
11429     
11430 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11431 echo "configure:11432: checking for dbm_open in -ldbm" >&5
11432 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11433
11434 xe_check_libs=" -ldbm "
11435 cat > conftest.$ac_ext <<EOF
11436 #line 11437 "configure"
11437 #include "confdefs.h"
11438 /* Override any gcc2 internal prototype to avoid an error.  */
11439 /* We use char because int might match the return type of a gcc2
11440     builtin and then its argument prototype would still apply.  */
11441 char dbm_open();
11442
11443 int main() {
11444 dbm_open()
11445 ; return 0; }
11446 EOF
11447 if { (eval echo configure:11448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11448   rm -rf conftest*
11449   eval "ac_cv_lib_$ac_lib_var=yes"
11450 else
11451   echo "configure: failed program was:" >&5
11452   cat conftest.$ac_ext >&5
11453   rm -rf conftest*
11454   eval "ac_cv_lib_$ac_lib_var=no"
11455 fi
11456 rm -f conftest*
11457 xe_check_libs=""
11458
11459 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11460   echo "$ac_t""yes" 1>&6
11461   with_database_dbm=yes libdbm=-ldbm
11462 else
11463   echo "$ac_t""no" 1>&6
11464 test "$with_database_dbm" = "yes" && \
11465         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11466       with_database_dbm=no
11467 fi
11468
11469
11470 fi
11471
11472 fi
11473
11474 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11475 test "$with_database_gnudbm" = "yes" -o \
11476      "$with_database_dbm"    = "yes" && \
11477   { test "$extra_verbose" = "yes" && cat << \EOF
11478     Defining HAVE_DBM
11479 EOF
11480 cat >> confdefs.h <<\EOF
11481 #define HAVE_DBM 1
11482 EOF
11483 }
11484
11485
11486 if test "$with_database_berkdb" != "no"; then
11487   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11488 echo "configure:11489: checking for Berkeley db.h" >&5
11489   for path in "db/db.h" "db.h"; do
11490     cat > conftest.$ac_ext <<EOF
11491 #line 11492 "configure"
11492 #include "confdefs.h"
11493 #ifdef HAVE_INTTYPES_H
11494 #define __BIT_TYPES_DEFINED__
11495 #include <inttypes.h>
11496 typedef uint8_t  u_int8_t;
11497 typedef uint16_t u_int16_t;
11498 typedef uint32_t u_int32_t;
11499 #ifdef WE_DONT_NEED_QUADS
11500 typedef uint64_t u_int64_t;
11501 #endif
11502 #endif
11503 #include <$path>
11504
11505 int main() {
11506
11507 ; return 0; }
11508 EOF
11509 if { (eval echo configure:11510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11510   rm -rf conftest*
11511   db_h_path="$path"; break
11512 else
11513   echo "configure: failed program was:" >&5
11514   cat conftest.$ac_ext >&5
11515 fi
11516 rm -f conftest*
11517   done
11518   if test -z "$db_h_path"
11519   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11520   else echo "$ac_t""$db_h_path" 1>&6
11521   fi
11522
11523   if test "$with_database_berkdb" != "no"; then
11524     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11525 echo "configure:11526: checking for Berkeley DB version" >&5
11526     cat > conftest.$ac_ext <<EOF
11527 #line 11528 "configure"
11528 #include "confdefs.h"
11529 #include <$db_h_path>
11530 #if DB_VERSION_MAJOR > 1
11531 yes
11532 #endif
11533
11534 EOF
11535 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11536   egrep "yes" >/dev/null 2>&1; then
11537   rm -rf conftest*
11538   echo "$ac_t""2" 1>&6; dbfunc=db_open
11539 else
11540   rm -rf conftest*
11541   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11542 fi
11543 rm -f conftest*
11544
11545     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11546 echo "configure:11547: checking for $dbfunc" >&5
11547
11548 cat > conftest.$ac_ext <<EOF
11549 #line 11550 "configure"
11550 #include "confdefs.h"
11551 /* System header to define __stub macros and hopefully few prototypes,
11552     which can conflict with char $dbfunc(); below.  */
11553 #include <assert.h>
11554 /* Override any gcc2 internal prototype to avoid an error.  */
11555 /* We use char because int might match the return type of a gcc2
11556     builtin and then its argument prototype would still apply.  */
11557 char $dbfunc();
11558
11559 int main() {
11560
11561 /* The GNU C library defines this for functions which it implements
11562     to always fail with ENOSYS.  Some functions are actually named
11563     something starting with __ and the normal name is an alias.  */
11564 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11565 choke me
11566 #else
11567 $dbfunc();
11568 #endif
11569
11570 ; return 0; }
11571 EOF
11572 if { (eval echo configure:11573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11573   rm -rf conftest*
11574   eval "ac_cv_func_$dbfunc=yes"
11575 else
11576   echo "configure: failed program was:" >&5
11577   cat conftest.$ac_ext >&5
11578   rm -rf conftest*
11579   eval "ac_cv_func_$dbfunc=no"
11580 fi
11581 rm -f conftest*
11582
11583 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11584   echo "$ac_t""yes" 1>&6
11585   with_database_berkdb=yes need_libdb=no
11586 else
11587   echo "$ac_t""no" 1>&6
11588
11589     
11590 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11591 echo "configure:11592: checking for $dbfunc in -ldb" >&5
11592 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11593
11594 xe_check_libs=" -ldb "
11595 cat > conftest.$ac_ext <<EOF
11596 #line 11597 "configure"
11597 #include "confdefs.h"
11598 /* Override any gcc2 internal prototype to avoid an error.  */
11599 /* We use char because int might match the return type of a gcc2
11600     builtin and then its argument prototype would still apply.  */
11601 char $dbfunc();
11602
11603 int main() {
11604 $dbfunc()
11605 ; return 0; }
11606 EOF
11607 if { (eval echo configure:11608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11608   rm -rf conftest*
11609   eval "ac_cv_lib_$ac_lib_var=yes"
11610 else
11611   echo "configure: failed program was:" >&5
11612   cat conftest.$ac_ext >&5
11613   rm -rf conftest*
11614   eval "ac_cv_lib_$ac_lib_var=no"
11615 fi
11616 rm -f conftest*
11617 xe_check_libs=""
11618
11619 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11620   echo "$ac_t""yes" 1>&6
11621   with_database_berkdb=yes need_libdb=yes
11622 else
11623   echo "$ac_t""no" 1>&6
11624 fi
11625
11626
11627 fi
11628
11629   fi
11630
11631   if test "$with_database_berkdb" = "yes"; then
11632     { test "$extra_verbose" = "yes" && cat << EOF
11633     Defining DB_H_PATH = "$db_h_path"
11634 EOF
11635 cat >> confdefs.h <<EOF
11636 #define DB_H_PATH "$db_h_path"
11637 EOF
11638 }
11639
11640     { test "$extra_verbose" = "yes" && cat << \EOF
11641     Defining HAVE_BERKELEY_DB
11642 EOF
11643 cat >> confdefs.h <<\EOF
11644 #define HAVE_BERKELEY_DB 1
11645 EOF
11646 }
11647
11648     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11649   else with_database_berkdb=no
11650   fi
11651 fi
11652
11653 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11654      != "no no no"; then
11655   { test "$extra_verbose" = "yes" && cat << \EOF
11656     Defining HAVE_DATABASE
11657 EOF
11658 cat >> confdefs.h <<\EOF
11659 #define HAVE_DATABASE 1
11660 EOF
11661 }
11662
11663   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11664    echo "    xemacs will be linked with \"database.o\""
11665  fi
11666 fi
11667
11668 if test "$with_socks" = "yes"; then
11669   
11670 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11671 echo "configure:11672: checking for SOCKSinit in -lsocks" >&5
11672 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11673
11674 xe_check_libs=" -lsocks "
11675 cat > conftest.$ac_ext <<EOF
11676 #line 11677 "configure"
11677 #include "confdefs.h"
11678 /* Override any gcc2 internal prototype to avoid an error.  */
11679 /* We use char because int might match the return type of a gcc2
11680     builtin and then its argument prototype would still apply.  */
11681 char SOCKSinit();
11682
11683 int main() {
11684 SOCKSinit()
11685 ; return 0; }
11686 EOF
11687 if { (eval echo configure:11688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11688   rm -rf conftest*
11689   eval "ac_cv_lib_$ac_lib_var=yes"
11690 else
11691   echo "configure: failed program was:" >&5
11692   cat conftest.$ac_ext >&5
11693   rm -rf conftest*
11694   eval "ac_cv_lib_$ac_lib_var=no"
11695 fi
11696 rm -f conftest*
11697 xe_check_libs=""
11698
11699 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11700   echo "$ac_t""yes" 1>&6
11701     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11702     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11703   { test "$extra_verbose" = "yes" && cat << EOF
11704     Defining $ac_tr_lib
11705 EOF
11706 cat >> confdefs.h <<EOF
11707 #define $ac_tr_lib 1
11708 EOF
11709 }
11710
11711   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11712
11713 else
11714   echo "$ac_t""no" 1>&6
11715 fi
11716
11717
11718   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11719     Defining HAVE_SOCKS
11720 EOF
11721 cat >> confdefs.h <<\EOF
11722 #define HAVE_SOCKS 1
11723 EOF
11724 }
11725
11726 fi
11727
11728 if test "$usage_tracking" = "yes"; then
11729   { test "$extra_verbose" = "yes" && cat << \EOF
11730     Defining USAGE_TRACKING
11731 EOF
11732 cat >> confdefs.h <<\EOF
11733 #define USAGE_TRACKING 1
11734 EOF
11735 }
11736
11737   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11738 fi
11739
11740 for ac_hdr in dlfcn.h
11741 do
11742 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11743 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11744 echo "configure:11745: checking for $ac_hdr" >&5
11745
11746 cat > conftest.$ac_ext <<EOF
11747 #line 11748 "configure"
11748 #include "confdefs.h"
11749 #include <$ac_hdr>
11750 EOF
11751 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11752 { (eval echo configure:11753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11753 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11754 if test -z "$ac_err"; then
11755   rm -rf conftest*
11756   eval "ac_cv_header_$ac_safe=yes"
11757 else
11758   echo "$ac_err" >&5
11759   echo "configure: failed program was:" >&5
11760   cat conftest.$ac_ext >&5
11761   rm -rf conftest*
11762   eval "ac_cv_header_$ac_safe=no"
11763 fi
11764 rm -f conftest*
11765 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11766   echo "$ac_t""yes" 1>&6
11767     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11768   { test "$extra_verbose" = "yes" && cat << EOF
11769     Defining $ac_tr_hdr
11770 EOF
11771 cat >> confdefs.h <<EOF
11772 #define $ac_tr_hdr 1
11773 EOF
11774 }
11775  have_dlfcn=yes
11776   { test "$extra_verbose" = "yes" && cat << \EOF
11777     Defining HAVE_DLFCN_H
11778 EOF
11779 cat >> confdefs.h <<\EOF
11780 #define HAVE_DLFCN_H 1
11781 EOF
11782 }
11783
11784 else
11785   echo "$ac_t""no" 1>&6
11786 fi
11787 done
11788
11789 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11790 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11791 echo "configure:11792: checking for dlopen in -ldl" >&5
11792 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11793
11794 xe_check_libs=" -ldl "
11795 cat > conftest.$ac_ext <<EOF
11796 #line 11797 "configure"
11797 #include "confdefs.h"
11798 /* Override any gcc2 internal prototype to avoid an error.  */
11799 /* We use char because int might match the return type of a gcc2
11800     builtin and then its argument prototype would still apply.  */
11801 char dlopen();
11802
11803 int main() {
11804 dlopen()
11805 ; return 0; }
11806 EOF
11807 if { (eval echo configure:11808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11808   rm -rf conftest*
11809   eval "ac_cv_lib_$ac_lib_var=yes"
11810 else
11811   echo "configure: failed program was:" >&5
11812   cat conftest.$ac_ext >&5
11813   rm -rf conftest*
11814   eval "ac_cv_lib_$ac_lib_var=no"
11815 fi
11816 rm -f conftest*
11817 xe_check_libs=""
11818
11819 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11820   echo "$ac_t""yes" 1>&6
11821   { test "$extra_verbose" = "yes" && cat << \EOF
11822     Defining HAVE_DLOPEN
11823 EOF
11824 cat >> confdefs.h <<\EOF
11825 #define HAVE_DLOPEN 1
11826 EOF
11827 }
11828  DLL_LIB=dl;  with_shlib=yes
11829 else
11830   echo "$ac_t""no" 1>&6
11831 fi
11832
11833  }
11834 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11835 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11836 echo "configure:11837: checking for _dlopen in -lc" >&5
11837 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11838
11839 xe_check_libs=" -lc "
11840 cat > conftest.$ac_ext <<EOF
11841 #line 11842 "configure"
11842 #include "confdefs.h"
11843 /* Override any gcc2 internal prototype to avoid an error.  */
11844 /* We use char because int might match the return type of a gcc2
11845     builtin and then its argument prototype would still apply.  */
11846 char _dlopen();
11847
11848 int main() {
11849 _dlopen()
11850 ; return 0; }
11851 EOF
11852 if { (eval echo configure:11853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11853   rm -rf conftest*
11854   eval "ac_cv_lib_$ac_lib_var=yes"
11855 else
11856   echo "configure: failed program was:" >&5
11857   cat conftest.$ac_ext >&5
11858   rm -rf conftest*
11859   eval "ac_cv_lib_$ac_lib_var=no"
11860 fi
11861 rm -f conftest*
11862 xe_check_libs=""
11863
11864 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11865   echo "$ac_t""yes" 1>&6
11866   { test "$extra_verbose" = "yes" && cat << \EOF
11867     Defining HAVE_DLOPEN
11868 EOF
11869 cat >> confdefs.h <<\EOF
11870 #define HAVE_DLOPEN 1
11871 EOF
11872 }
11873  DLL_LIB=;   with_shlib=yes
11874 else
11875   echo "$ac_t""no" 1>&6
11876 fi
11877
11878  }
11879 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11880 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11881 echo "configure:11882: checking for dlopen in -lc" >&5
11882 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11883
11884 xe_check_libs=" -lc "
11885 cat > conftest.$ac_ext <<EOF
11886 #line 11887 "configure"
11887 #include "confdefs.h"
11888 /* Override any gcc2 internal prototype to avoid an error.  */
11889 /* We use char because int might match the return type of a gcc2
11890     builtin and then its argument prototype would still apply.  */
11891 char dlopen();
11892
11893 int main() {
11894 dlopen()
11895 ; return 0; }
11896 EOF
11897 if { (eval echo configure:11898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11898   rm -rf conftest*
11899   eval "ac_cv_lib_$ac_lib_var=yes"
11900 else
11901   echo "configure: failed program was:" >&5
11902   cat conftest.$ac_ext >&5
11903   rm -rf conftest*
11904   eval "ac_cv_lib_$ac_lib_var=no"
11905 fi
11906 rm -f conftest*
11907 xe_check_libs=""
11908
11909 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11910   echo "$ac_t""yes" 1>&6
11911   { test "$extra_verbose" = "yes" && cat << \EOF
11912     Defining HAVE_DLOPEN
11913 EOF
11914 cat >> confdefs.h <<\EOF
11915 #define HAVE_DLOPEN 1
11916 EOF
11917 }
11918  DLL_LIB=;   with_shlib=yes
11919 else
11920   echo "$ac_t""no" 1>&6
11921 fi
11922
11923  }
11924 test -z "$with_shlib" && { 
11925 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11926 echo "configure:11927: checking for shl_load in -ldld" >&5
11927 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11928
11929 xe_check_libs=" -ldld "
11930 cat > conftest.$ac_ext <<EOF
11931 #line 11932 "configure"
11932 #include "confdefs.h"
11933 /* Override any gcc2 internal prototype to avoid an error.  */
11934 /* We use char because int might match the return type of a gcc2
11935     builtin and then its argument prototype would still apply.  */
11936 char shl_load();
11937
11938 int main() {
11939 shl_load()
11940 ; return 0; }
11941 EOF
11942 if { (eval echo configure:11943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11943   rm -rf conftest*
11944   eval "ac_cv_lib_$ac_lib_var=yes"
11945 else
11946   echo "configure: failed program was:" >&5
11947   cat conftest.$ac_ext >&5
11948   rm -rf conftest*
11949   eval "ac_cv_lib_$ac_lib_var=no"
11950 fi
11951 rm -f conftest*
11952 xe_check_libs=""
11953
11954 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11955   echo "$ac_t""yes" 1>&6
11956   { test "$extra_verbose" = "yes" && cat << \EOF
11957     Defining HAVE_SHL_LOAD
11958 EOF
11959 cat >> confdefs.h <<\EOF
11960 #define HAVE_SHL_LOAD 1
11961 EOF
11962 }
11963  DLL_LIB=dld; with_shlib=yes
11964 else
11965   echo "$ac_t""no" 1>&6
11966 fi
11967
11968  }
11969 test -z "$with_shlib" && { 
11970 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11971 echo "configure:11972: checking for dld_init in -ldld" >&5
11972 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11973
11974 xe_check_libs=" -ldld "
11975 cat > conftest.$ac_ext <<EOF
11976 #line 11977 "configure"
11977 #include "confdefs.h"
11978 /* Override any gcc2 internal prototype to avoid an error.  */
11979 /* We use char because int might match the return type of a gcc2
11980     builtin and then its argument prototype would still apply.  */
11981 char dld_init();
11982
11983 int main() {
11984 dld_init()
11985 ; return 0; }
11986 EOF
11987 if { (eval echo configure:11988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11988   rm -rf conftest*
11989   eval "ac_cv_lib_$ac_lib_var=yes"
11990 else
11991   echo "configure: failed program was:" >&5
11992   cat conftest.$ac_ext >&5
11993   rm -rf conftest*
11994   eval "ac_cv_lib_$ac_lib_var=no"
11995 fi
11996 rm -f conftest*
11997 xe_check_libs=""
11998
11999 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12000   echo "$ac_t""yes" 1>&6
12001   { test "$extra_verbose" = "yes" && cat << \EOF
12002     Defining HAVE_DLD_INIT
12003 EOF
12004 cat >> confdefs.h <<\EOF
12005 #define HAVE_DLD_INIT 1
12006 EOF
12007 }
12008  DLL_LIB=dld; with_shlib=yes
12009 else
12010   echo "$ac_t""no" 1>&6
12011 fi
12012
12013  }
12014 if test "$with_shlib" = "yes"; then
12015   
12016 dll_ld=
12017 dll_ldflags=
12018 dll_cflags=
12019 dll_post=
12020 dll_ldo="-o"
12021 ld_dynamic_link_flags=
12022 xehost=$canonical
12023 xealias=$internal_configuration
12024
12025 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
12026 echo "configure:12027: checking how to build dynamic libraries for ${xehost}" >&5
12027 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
12028 case "$xehost" in
12029 *-*-linux-gnu*) ;;
12030 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
12031 esac
12032
12033 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
12034 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
12035 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
12036
12037 case "$xehost_os" in
12038 aix3*)
12039   # AIX sometimes has problems with the GCC collect2 program.  For some
12040   # reason, if we set the COLLECT_NAMES environment variable, the problems
12041   # vanish in a puff of smoke.
12042   if test "${COLLECT_NAMES+set}" != set; then
12043     COLLECT_NAMES=
12044     export COLLECT_NAMES
12045   fi
12046   ;;
12047 esac
12048
12049 # Now see if the compiler is really GCC.
12050 if test "$GCC" = "yes"; then
12051   XEGCC=yes
12052 else
12053   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
12054 echo "configure:12055: checking checking whether we are using GNU C" >&5
12055   cat > conftest.$ac_ext <<EOF
12056 #line 12057 "configure"
12057 #include "confdefs.h"
12058
12059 #ifdef __GNUC__
12060   yes;
12061 #endif
12062
12063 EOF
12064 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12065   egrep "yes" >/dev/null 2>&1; then
12066   rm -rf conftest*
12067   XEGCC=yes
12068 else
12069   rm -rf conftest*
12070   XEGCC=no
12071 fi
12072 rm -f conftest*
12073
12074   echo "$ac_t""${XEGCC}" 1>&6
12075 fi
12076
12077 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
12078 echo "configure:12079: checking how to produce PIC code" >&5
12079 wl=
12080
12081 can_build_shared=yes
12082 if test "$XEGCC" = yes; then
12083   wl='-Wl,'
12084
12085   case "$xehost_os" in
12086   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
12087     # PIC is the default for these OSes.
12088     ;;
12089
12090   os2*)
12091     # We can build DLLs from non-PIC.
12092     ;;
12093   amigaos*)
12094     # FIXME: we need at least 68020 code to build shared libraries, but
12095     # adding the `-m68020' flag to GCC prevents building anything better,
12096     # like `-m68040'.
12097     dll_cflags='-m68020 -resident32 -malways-restore-a4'
12098     ;;
12099   *)
12100     dll_cflags='-fPIC'
12101     ;;
12102   esac
12103 else
12104   # PORTME Check for PIC flags for the system compiler.
12105   case "$xehost_os" in
12106   hpux9* | hpux10*)
12107     # Is there a better link_static_flag that works with the bundled CC?
12108     wl='-Wl,'
12109     dll_cflags='+Z'
12110     ;;
12111
12112   irix5* | irix6*)
12113     wl='-Wl,'
12114     # PIC (with -KPIC) is the default.
12115     ;;
12116
12117   os2*)
12118     # We can build DLLs from non-PIC.
12119     ;;
12120
12121   osf3* | osf4*)
12122     # All OSF/1 code is PIC.
12123     wl='-Wl,'
12124     ;;
12125
12126   sco3.2v5*)
12127     dll_cflags='-belf -Kpic'
12128     wl='-Wl,'
12129     ;;
12130
12131   unixware*)
12132     dll_cflags="-KPIC"
12133     wl="-Wl,"
12134     ;;
12135
12136   sysv4*)
12137     dll_cflags="-KPIC"
12138     wl="-Wl,"
12139     ;;
12140
12141   sysv5*)
12142     dll_cflags="-KPIC"
12143     wl="-Wl,"
12144     ;;
12145
12146   solaris2*)
12147     dll_cflags='-KPIC'
12148     wl='-Wl,'
12149     ;;
12150
12151   sunos4*)
12152     dll_cflags='-PIC'
12153     wl='-Qoption ld '
12154     ;;
12155
12156   uts4*)
12157     dll_cflags='-pic'
12158     ;;
12159
12160   *)
12161     can_build_shared=no
12162     ;;
12163   esac
12164 fi
12165
12166 if test -n "$dll_cflags"; then
12167   echo "$ac_t""${dll_cflags}" 1>&6
12168   
12169   # Check to make sure the dll_cflags actually works.
12170   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12171 echo "configure:12172: checking if PIC flag ${dll_cflags} really works" >&5
12172   save_CFLAGS="$CFLAGS"
12173   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12174   cat > conftest.$ac_ext <<EOF
12175 #line 12176 "configure"
12176 #include "confdefs.h"
12177
12178 int main() {
12179 int x=0;
12180 ; return 0; }
12181 EOF
12182 if { (eval echo configure:12183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12183   rm -rf conftest*
12184   
12185     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12186     # reports no error.  So, we need to grep stderr for (Bundled).
12187     if grep '(Bundled)' config.log >/dev/null; then
12188       echo "$ac_t""no" 1>&6
12189       can_build_shared=no
12190       dll_cflags=
12191     else
12192       echo "$ac_t""yes" 1>&6
12193     fi
12194 else
12195   echo "configure: failed program was:" >&5
12196   cat conftest.$ac_ext >&5
12197   rm -rf conftest*
12198   echo "$ac_t""no" 1>&6
12199     can_build_shared=no
12200     dll_cflags=
12201 fi
12202 rm -f conftest*
12203   CFLAGS="$save_CFLAGS"
12204 else
12205   echo "$ac_t""none" 1>&6
12206 fi
12207
12208 if test "$can_build_shared" = "yes"; then
12209 cc_produces_so=no
12210 xldf=
12211 xcldf=
12212 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12213 echo "configure:12214: checking if C compiler can produce shared libraries" >&5
12214 if test "$XEGCC" = yes; then
12215   xcldf="-shared"
12216   xldf="-shared"
12217 else # Not using GCC
12218   case "$xehost_os" in
12219     aix3* | aix4*)
12220       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12221       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12222       ;;
12223
12224     freebsd2* | netbsd* | openbsd*)
12225       xldf="-Bshareable"
12226       xcldf="${wl}-Bshareable"
12227       ;;
12228
12229     freebsd3*)
12230       xcldf="-shared"
12231       ;;
12232
12233     hpux*)
12234       xldf="-b +s"
12235       xcldf="${wl}-b ${wl}+s"
12236       ;;
12237
12238     irix5* | irix6* | osf3* | osf4*)
12239       xcldf="${wl}-shared"
12240       xldf="-shared"
12241       ;;
12242
12243     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12244       xcldf="-G"
12245       xldf="-G"
12246       ;;
12247
12248     sunos4*)
12249       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12250       xldf="-assert pure-text -Bstatic"
12251       ;;
12252   esac
12253 fi # End if if we are using gcc
12254
12255 if test -n "$xcldf"; then
12256   save_LDFLAGS=$LDFLAGS
12257   save_LIBS=$LIBS
12258   save_xe_libs=$xe_libs
12259   LDFLAGS="$xcldf $LDFLAGS"
12260   LIBS=
12261   xe_libs=
12262   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12263   cat > conftest.$ac_ext <<EOF
12264 #line 12265 "configure"
12265 #include "confdefs.h"
12266
12267 int main() {
12268 int x=0;
12269 ; return 0; }
12270 EOF
12271 if { (eval echo configure:12272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12272   rm -rf conftest*
12273   cc_produces_so=yes
12274 else
12275   echo "configure: failed program was:" >&5
12276   cat conftest.$ac_ext >&5
12277   rm -rf conftest*
12278   cc_produces_so=no
12279 fi
12280 rm -f conftest*
12281   LDFLAGS=$save_LDFLAGS
12282   LIBS=$save_LIBS
12283   xe_libs=$save_xe_libs
12284   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12285 else
12286   cc_produces_so=no
12287 fi
12288 echo "$ac_t""${cc_produces_so}" 1>&6
12289
12290 LTLD=$LD
12291 if test -z "$LTLD"; then
12292   ac_prog=ld
12293   if test "$XEGCC" = yes; then
12294     # Check if gcc -print-prog-name=ld gives a path.
12295     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12296 echo "configure:12297: checking for ld used by GCC" >&5
12297     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12298     case "$ac_prog" in
12299     # Accept absolute paths.
12300     /*)
12301       if test -z "$LTLD"; then
12302         case "$ac_prog" in
12303           *gcc-lib*) LTLD="$CC"
12304                      ;;
12305           *)         LTLD="$ac_prog"
12306                      ;;
12307         esac
12308       fi
12309       ;;
12310     "")
12311       # If it fails, then pretend we aren't using GCC.
12312       ac_prog=ld
12313       ;;
12314     *)
12315       # If it is relative, then search for the first ld in PATH.
12316       with_gnu_ld=unknown
12317       ;;
12318     esac
12319   else
12320     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12321 echo "configure:12322: checking for GNU ld" >&5
12322   fi
12323
12324   if test -z "$LTLD"; then
12325     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12326     for ac_dir in $PATH; do
12327       test -z "$ac_dir" && ac_dir=.
12328       if test -f "$ac_dir/$ac_prog"; then
12329         LTLD="$ac_dir/$ac_prog"
12330         # Check to see if the program is GNU ld.  I'd rather use --version,
12331         # but apparently some GNU ld's only accept -v.
12332         # Break only if it was the GNU/non-GNU ld that we prefer.
12333         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12334           xe_gnu_ld=yes
12335         else
12336           xe_gnu_ld=no
12337         fi
12338       fi
12339     done
12340     IFS="$ac_save_ifs"
12341   fi
12342
12343   if test -n "$LTLD"; then
12344     echo "$ac_t""${LTLD}" 1>&6
12345   else
12346     echo "$ac_t""no" 1>&6
12347   fi
12348
12349   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12350     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12351     exit 1
12352   fi
12353 fi
12354
12355 ld_dynamic_link_flags=
12356
12357 # Check to see if it really is or isn't GNU ld.
12358 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12359 echo "configure:12360: checking if the linker is GNU ld" >&5
12360 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12361 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12362   xe_gnu_ld=yes
12363 else
12364   xe_gnu_ld=no
12365 fi
12366 echo "$ac_t""${xe_gnu_ld}" 1>&6
12367
12368 case "$xehost_os" in
12369   amigaos* | sunos4*)
12370     # On these operating systems, we should treat GNU ld like the system ld.
12371     gnu_ld_acts_native=yes
12372     ;;
12373   *)
12374     gnu_ld_acts_native=no
12375     ;;
12376 esac
12377
12378 if test "$cc_produces_so" = "yes"; then
12379   dll_ld=$CC
12380   dll_ldflags=$xcldf
12381   can_build_shared=yes
12382 else
12383   # OK - only NOW do we futz about with ld.
12384   # See if the linker supports building shared libraries.
12385   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12386 echo "configure:12387: checking whether the linker supports shared libraries" >&5
12387   dll_ld=$CC
12388   dll_ldflags=$LDFLAGS
12389   ld_shlibs=yes
12390   can_build_shared=yes
12391   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12392     # See if GNU ld supports shared libraries.
12393     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12394       dll_ld=$CC
12395       dll_ldflags="-shared"
12396       ld_shlibs=yes
12397     else
12398       ld_shlibs=no
12399     fi
12400   else
12401     # PORTME fill in a description of your system's linker (not GNU ld)
12402     case "$xehost_os" in
12403     aix3*)
12404       dll_ld=$LTLD
12405       dll_ldflags=$xldf
12406       ;;
12407
12408     aix4*)
12409       dll_ldflags=$xcldf
12410       ;;
12411
12412     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12413     # support.  Future versions do this automatically, but an explicit c++rt0.o
12414     # doesn't break anything, and helps significantly (at the cost of a little
12415     # extra space).
12416     freebsd2.2*)
12417       dll_ld=$LTLD
12418       dll_ldflags=$xldf
12419       dll_post="/usr/lib/c++rt0.o"
12420       ;;
12421
12422     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12423     freebsd2*)
12424       dll_ld=$LTLD
12425       dll_ldflags="-Bshareable"
12426       ;;
12427
12428     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12429     freebsd3*)
12430       dll_ldflags="-shared"
12431       ;;
12432
12433     hpux*)
12434       dll_ld=$LTLD
12435       dll_ldflags=$xldf
12436       ;;
12437
12438     irix5* | irix6*)
12439       dll_ld=$LTLD
12440       dll_ldflags=$xldf
12441       ;;
12442
12443     netbsd*)
12444       # Tested with NetBSD 1.2 ld
12445       dll_ld=$LTLD
12446       dll_ldflags=$xldf
12447       ;;
12448
12449     openbsd*)
12450       dll_ld=$LTLD
12451       dll_ldflags=$xldf
12452       ;;
12453
12454     osf3* | osf4*)
12455       dll_ld=$LTLD
12456       dll_ldflags=$xldf
12457       ;;
12458
12459     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12460     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12461       dll_ld=$LTLD
12462       case "$dll_ld" in
12463         *gcc*) dll_ldflags="-shared"
12464                dll_ld=$CC
12465                ;;
12466         *)     dll_ldflags="-G"
12467                ;;
12468       esac
12469       ;;
12470
12471     sunos4*)
12472       if test "$XEGCC" = yes; then
12473         dll_ld=$CC
12474       else
12475         dll_ld=$LTLD
12476       fi
12477       dll_ldflags=$xldf
12478       ;;
12479
12480     uts4*)
12481       dll_ld=$LTLD
12482       dll_ldflags="-G"
12483       ;;
12484
12485     bsdi*)
12486       dll_ldflags="-r"
12487       dll_ld="shlicc2"
12488       ;;
12489
12490     *)
12491       ld_shlibs=no
12492       can_build_shared=no
12493       ;;
12494     esac
12495   fi
12496   echo "$ac_t""${ld_shlibs}" 1>&6
12497   if test "$ld_shlibs" = "no"; then
12498     can_build_shared=no
12499   fi
12500 fi # End of if cc_produces_so = no
12501
12502
12503 if test "$xe_gnu_ld" = yes; then
12504   if test "$ld_shlibs" = yes; then
12505     ld_dynamic_link_flags="${wl}-export-dynamic"
12506   fi
12507 fi
12508
12509 if test -z "$ld_dynamic_link_flags"; then
12510   case "$xehost_os" in
12511   aix3*)
12512     ld_dynamic_link_flags=
12513     ;;
12514
12515   aix4*)
12516     ld_dynamic_link_flags=
12517     ;;
12518
12519   freebsd2.2*)
12520     ld_dynamic_link_flags=
12521     ;;
12522
12523   freebsd2*)
12524     ld_dynamic_link_flags=
12525     ;;
12526
12527   freebsd3*)
12528     ld_dynamic_link_flags=
12529     ;;
12530
12531   hpux*)
12532     ld_dynamic_link_flags="${wl}-E"
12533     ;;
12534
12535   irix5* | irix6*)
12536     ld_dynamic_link_flags=
12537     ;;
12538
12539   netbsd*)
12540     ld_dynamic_link_flags=
12541     ;;
12542
12543   openbsd*)
12544     ld_dynamic_link_flags=
12545     ;;
12546
12547   osf3* | osf4*)
12548     ld_dynamic_link_flags=
12549     ;;
12550
12551   solaris2* | solaris7*)
12552     ld_dynamic_link_flags="${wl}-Bdynamic"
12553     ;;
12554
12555   sco3.2v5* | unixware* | sysv5* | sysv4*)
12556     ld_dynamic_link_flags="${wl}-Bexport"
12557     ;;
12558
12559   sunos4*)
12560     ld_dynamic_link_flags=
12561     ;;
12562
12563   uts4*)
12564     ld_dynamic_link_flags=
12565     ;;
12566
12567   bsdi*)
12568     ld_dynamic_link_flags=
12569     ;;
12570
12571   esac
12572 fi # End of if -z ld_dynamic_link_flags
12573 fi # End of if test "$can_build_shared" = "yes"
12574
12575
12576
12577
12578
12579
12580
12581
12582   if test "$can_build_shared" = "yes"; then
12583     { test "$extra_verbose" = "yes" && cat << \EOF
12584     Defining HAVE_SHLIB
12585 EOF
12586 cat >> confdefs.h <<\EOF
12587 #define HAVE_SHLIB 1
12588 EOF
12589 }
12590
12591     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12592    echo "    xemacs will be linked with \"sysdll.o\""
12593  fi
12594     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12595    echo "    xemacs will be linked with \"emodules.o\""
12596  fi
12597     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12598     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12599     for ac_func in dlerror _dlerror
12600 do
12601 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12602 echo "configure:12603: checking for $ac_func" >&5
12603
12604 cat > conftest.$ac_ext <<EOF
12605 #line 12606 "configure"
12606 #include "confdefs.h"
12607 /* System header to define __stub macros and hopefully few prototypes,
12608     which can conflict with char $ac_func(); below.  */
12609 #include <assert.h>
12610 /* Override any gcc2 internal prototype to avoid an error.  */
12611 /* We use char because int might match the return type of a gcc2
12612     builtin and then its argument prototype would still apply.  */
12613 char $ac_func();
12614
12615 int main() {
12616
12617 /* The GNU C library defines this for functions which it implements
12618     to always fail with ENOSYS.  Some functions are actually named
12619     something starting with __ and the normal name is an alias.  */
12620 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12621 choke me
12622 #else
12623 $ac_func();
12624 #endif
12625
12626 ; return 0; }
12627 EOF
12628 if { (eval echo configure:12629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12629   rm -rf conftest*
12630   eval "ac_cv_func_$ac_func=yes"
12631 else
12632   echo "configure: failed program was:" >&5
12633   cat conftest.$ac_ext >&5
12634   rm -rf conftest*
12635   eval "ac_cv_func_$ac_func=no"
12636 fi
12637 rm -f conftest*
12638
12639 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12640   echo "$ac_t""yes" 1>&6
12641     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12642   { test "$extra_verbose" = "yes" && cat << EOF
12643     Defining $ac_tr_func
12644 EOF
12645 cat >> confdefs.h <<EOF
12646 #define $ac_tr_func 1
12647 EOF
12648 }
12649  
12650 else
12651   echo "$ac_t""no" 1>&6
12652 fi
12653 done
12654
12655   else
12656     echo "configure: warning: disabling shared library support" 1>&2
12657     with_shlib=no
12658   fi
12659 fi
12660
12661 cat > conftest.$ac_ext <<EOF
12662 #line 12663 "configure"
12663 #include "confdefs.h"
12664 int main(int c,char *v[]){return 0;}
12665 EOF
12666 if { (eval echo configure:12667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12667 then
12668   :
12669 else
12670   conftest_rc="$?"
12671   echo "configure: failed program was:" >&5
12672   cat conftest.$ac_ext >&5
12673   rm -fr conftest*
12674   
12675   echo ""
12676   echo "*** PANIC *** The C compiler can no longer build working executables."
12677   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12678   echo "*** PANIC *** The most likely reason for this problem is that configure"
12679   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12680   echo "*** PANIC *** found at run time."
12681   echo "*** PANIC ***"
12682   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12683   echo "*** PANIC *** On other systems, try telling configure where to find the"
12684   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12685   echo "*** PANIC ***"
12686   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12687   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12688   echo "*** PANIC *** on your system.  Don't do that."
12689   exit 1
12690 fi
12691 rm -fr conftest*
12692
12693 if test "$win32_processes" = "yes"; then
12694   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12695    echo "    xemacs will be linked with \"process-nt.o\""
12696  fi
12697 else
12698   { test "$extra_verbose" = "yes" && cat << \EOF
12699     Defining HAVE_UNIX_PROCESSES
12700 EOF
12701 cat >> confdefs.h <<\EOF
12702 #define HAVE_UNIX_PROCESSES 1
12703 EOF
12704 }
12705
12706   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12707    echo "    xemacs will be linked with \"process-unix.o\""
12708  fi
12709 fi
12710
12711
12712
12713 T=""
12714 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12715 CFLAGS="$T"
12716
12717
12718 T=""
12719 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12720 extra_objs="$T"
12721
12722
12723 T=""
12724 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
12725 c_switch_general="$T"
12726
12727
12728 T=""
12729 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12730 c_switch_window_system="$T"
12731
12732
12733 T=""
12734 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12735 c_switch_all="$T"
12736
12737
12738 T=""
12739 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
12740 ld_switch_general="$T"
12741
12742
12743 T=""
12744 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12745 ld_switch_window_system="$T"
12746
12747
12748 T=""
12749 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12750 ld_switch_all="$T"
12751
12752
12753 T=""
12754 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12755 ld_libs_general="$T"
12756
12757
12758 T=""
12759 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
12760 ld_libs_window_system="$T"
12761
12762
12763 T=""
12764 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12765 ld_libs_all="$T"
12766
12767
12768
12769 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12770 internal_makefile_list="Makefile.in"
12771 SUBDIR_MAKEFILES=''
12772 test -d lock || mkdir lock
12773 for dir in $MAKE_SUBDIR; do
12774   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12775         test -d "$d" || mkdir "$d"; cd "$d"
12776       done ) ;;
12777    * ) test -d "$dir" || mkdir "$dir" ;;
12778   esac
12779   
12780 T=""
12781 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12782 SUBDIR_MAKEFILES="$T"
12783
12784   
12785 T=""
12786 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12787 internal_makefile_list="$T"
12788
12789 done
12790
12791
12792
12793
12794 for dir in src/s src/m; do
12795   if test ! -d "$dir" ; then
12796     echo Making symbolic link to "$srcdir/$dir"
12797     ${LN_S} "$srcdir/$dir" "$dir"
12798   fi
12799 done
12800
12801 if test "$extra_verbose" = "yes"; then
12802   echo ""
12803   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
12804   echo ""
12805 fi
12806
12807 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12808   echo "creating src/gdbinit"; echo ""
12809   echo "source $srcdir/src/gdbinit" > src/gdbinit
12810 fi
12811
12812 if test "$__SUNPRO_C" = "yes"; then
12813   echo "creating .sbinit"; echo ""
12814   ( echo "# For use with Sun WorkShop's Source browser."
12815     echo "# See sbquery(1) and sbinit(4) for more information"
12816     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12817   ) > .sbinit
12818 fi
12819
12820 rm -f core
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837 PREFIX=$prefix
12838 while true; do
12839   case "$PREFIX" in
12840     *\$* ) eval "PREFIX=$PREFIX" ;;
12841     *) break ;;
12842   esac
12843 done
12844
12845
12846
12847 EXEC_PREFIX=$exec_prefix
12848 while true; do
12849   case "$EXEC_PREFIX" in
12850     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12851     *) break ;;
12852   esac
12853 done
12854
12855
12856
12857
12858 INFODIR=$infodir
12859 while true; do
12860   case "$INFODIR" in
12861     *\$* ) eval "INFODIR=$INFODIR" ;;
12862     *) break ;;
12863   esac
12864 done
12865
12866
12867
12868
12869 INFOPATH=$infopath
12870 while true; do
12871   case "$INFOPATH" in
12872     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12873     *) break ;;
12874   esac
12875 done
12876
12877
12878
12879
12880 PACKAGE_PATH=$package_path
12881 while true; do
12882   case "$PACKAGE_PATH" in
12883     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12884     *) break ;;
12885   esac
12886 done
12887
12888
12889
12890
12891 LISPDIR=$lispdir
12892 while true; do
12893   case "$LISPDIR" in
12894     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12895     *) break ;;
12896   esac
12897 done
12898
12899
12900
12901
12902 MODULEDIR=$moduledir
12903 while true; do
12904   case "$MODULEDIR" in
12905     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12906     *) break ;;
12907   esac
12908 done
12909
12910
12911
12912
12913 SITELISPDIR=$sitelispdir
12914 while true; do
12915   case "$SITELISPDIR" in
12916     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12917     *) break ;;
12918   esac
12919 done
12920
12921
12922
12923
12924 SITEMODULEDIR=$sitemoduledir
12925 while true; do
12926   case "$SITEMODULEDIR" in
12927     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12928     *) break ;;
12929   esac
12930 done
12931
12932
12933
12934
12935 ETCDIR=$etcdir
12936 while true; do
12937   case "$ETCDIR" in
12938     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12939     *) break ;;
12940   esac
12941 done
12942
12943
12944
12945
12946 LOCKDIR=$lockdir
12947 while true; do
12948   case "$LOCKDIR" in
12949     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12950     *) break ;;
12951   esac
12952 done
12953
12954
12955
12956
12957 ARCHLIBDIR=$archlibdir
12958 while true; do
12959   case "$ARCHLIBDIR" in
12960     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12961     *) break ;;
12962   esac
12963 done
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12985
12986
12987
12988
12989
12990
12991
12992 : ${XEMACS_CC:=$CC}
12993
12994
12995
12996 if test "$with_site_lisp" = "no"; then
12997   { test "$extra_verbose" = "yes" && cat << \EOF
12998     Defining INHIBIT_SITE_LISP
12999 EOF
13000 cat >> confdefs.h <<\EOF
13001 #define INHIBIT_SITE_LISP 1
13002 EOF
13003 }
13004
13005 fi
13006 if test "$with_site_modules" = "no"; then
13007   { test "$extra_verbose" = "yes" && cat << \EOF
13008     Defining INHIBIT_SITE_MODULES
13009 EOF
13010 cat >> confdefs.h <<\EOF
13011 #define INHIBIT_SITE_MODULES 1
13012 EOF
13013 }
13014
13015 fi
13016
13017
13018 T=""
13019 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13020 ac_configure_args="$T"
13021
13022 { test "$extra_verbose" = "yes" && cat << EOF
13023     Defining EMACS_CONFIGURATION = "$canonical"
13024 EOF
13025 cat >> confdefs.h <<EOF
13026 #define EMACS_CONFIGURATION "$canonical"
13027 EOF
13028 }
13029
13030 { test "$extra_verbose" = "yes" && cat << EOF
13031     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
13032 EOF
13033 cat >> confdefs.h <<EOF
13034 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
13035 EOF
13036 }
13037
13038 { test "$extra_verbose" = "yes" && cat << EOF
13039     Defining config_machfile = "$machfile"
13040 EOF
13041 cat >> confdefs.h <<EOF
13042 #define config_machfile "$machfile"
13043 EOF
13044 }
13045
13046 { test "$extra_verbose" = "yes" && cat << EOF
13047     Defining config_opsysfile = "$opsysfile"
13048 EOF
13049 cat >> confdefs.h <<EOF
13050 #define config_opsysfile "$opsysfile"
13051 EOF
13052 }
13053
13054
13055
13056 null_string=""
13057 { test "$extra_verbose" = "yes" && cat << EOF
13058     Defining LD_SWITCH_X_SITE = $null_string
13059 EOF
13060 cat >> confdefs.h <<EOF
13061 #define LD_SWITCH_X_SITE $null_string
13062 EOF
13063 }
13064
13065 { test "$extra_verbose" = "yes" && cat << EOF
13066     Defining LD_SWITCH_X_SITE_AUX = $null_string
13067 EOF
13068 cat >> confdefs.h <<EOF
13069 #define LD_SWITCH_X_SITE_AUX $null_string
13070 EOF
13071 }
13072
13073 { test "$extra_verbose" = "yes" && cat << EOF
13074     Defining C_SWITCH_X_SITE = $null_string
13075 EOF
13076 cat >> confdefs.h <<EOF
13077 #define C_SWITCH_X_SITE $null_string
13078 EOF
13079 }
13080
13081 { test "$extra_verbose" = "yes" && cat << EOF
13082     Defining LD_SWITCH_SITE = $null_string
13083 EOF
13084 cat >> confdefs.h <<EOF
13085 #define LD_SWITCH_SITE $null_string
13086 EOF
13087 }
13088
13089 { test "$extra_verbose" = "yes" && cat << EOF
13090     Defining C_SWITCH_SITE = $null_string
13091 EOF
13092 cat >> confdefs.h <<EOF
13093 #define C_SWITCH_SITE $null_string
13094 EOF
13095 }
13096
13097
13098
13099 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13100     Defining GNU_MALLOC
13101 EOF
13102 cat >> confdefs.h <<\EOF
13103 #define GNU_MALLOC 1
13104 EOF
13105 }
13106
13107 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13108     Defining USE_SYSTEM_MALLOC
13109 EOF
13110 cat >> confdefs.h <<\EOF
13111 #define USE_SYSTEM_MALLOC 1
13112 EOF
13113 }
13114
13115 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13116     Defining USE_DEBUG_MALLOC
13117 EOF
13118 cat >> confdefs.h <<\EOF
13119 #define USE_DEBUG_MALLOC 1
13120 EOF
13121 }
13122
13123                                               { test "$extra_verbose" = "yes" && cat << \EOF
13124     Defining USE_SYSTEM_MALLOC
13125 EOF
13126 cat >> confdefs.h <<\EOF
13127 #define USE_SYSTEM_MALLOC 1
13128 EOF
13129 }
13130
13131 fi
13132 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13133     Defining I18N3
13134 EOF
13135 cat >> confdefs.h <<\EOF
13136 #define I18N3 1
13137 EOF
13138 }
13139
13140 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13141     Defining USE_GCC
13142 EOF
13143 cat >> confdefs.h <<\EOF
13144 #define USE_GCC 1
13145 EOF
13146 }
13147
13148 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13149     Defining EXTERNAL_WIDGET
13150 EOF
13151 cat >> confdefs.h <<\EOF
13152 #define EXTERNAL_WIDGET 1
13153 EOF
13154 }
13155
13156 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13157     Defining NO_DOC_FILE
13158 EOF
13159 cat >> confdefs.h <<\EOF
13160 #define NO_DOC_FILE 1
13161 EOF
13162 }
13163
13164 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13165     Defining PURIFY
13166 EOF
13167 cat >> confdefs.h <<\EOF
13168 #define PURIFY 1
13169 EOF
13170 }
13171
13172 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13173     Defining QUANTIFY
13174 EOF
13175 cat >> confdefs.h <<\EOF
13176 #define QUANTIFY 1
13177 EOF
13178 }
13179
13180 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13181     Defining MAIL_USE_POP
13182 EOF
13183 cat >> confdefs.h <<\EOF
13184 #define MAIL_USE_POP 1
13185 EOF
13186 }
13187
13188 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13189     Defining KERBEROS
13190 EOF
13191 cat >> confdefs.h <<\EOF
13192 #define KERBEROS 1
13193 EOF
13194 }
13195
13196 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13197     Defining HESIOD
13198 EOF
13199 cat >> confdefs.h <<\EOF
13200 #define HESIOD 1
13201 EOF
13202 }
13203
13204 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13205     Defining USE_UNION_TYPE
13206 EOF
13207 cat >> confdefs.h <<\EOF
13208 #define USE_UNION_TYPE 1
13209 EOF
13210 }
13211
13212
13213
13214 (
13215 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13216 else
13217   echo "uname -a: `uname -a`"
13218 fi
13219 echo ""
13220 echo "$0 $quoted_arguments"
13221 ) > Installation
13222
13223 if test ! -z ${emacs_beta_version} ; then
13224   if test -z "${emacs_is_beta}" ; then
13225         xemacs_betaname=".${emacs_beta_version}"
13226   else
13227         xemacs_betaname="-b${emacs_beta_version}"
13228   fi
13229 else
13230   xemacs_betaname=""    
13231 fi
13232
13233 (
13234 echo "
13235
13236 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13237
13238   Where should the build process find the source code?    $srcdir
13239   What installation prefix should install use?            $prefix
13240   What operating system and machine description files should XEmacs use?
13241         \`$opsysfile' and \`$machfile'
13242   What compiler should XEmacs be built with?              $CC $CFLAGS
13243   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13244   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13245   What window system should XEmacs use?                   ${window_system}"
13246 if test "$with_x11" = "yes"; then
13247   echo "  Where do we find X Windows header files?                $x_includes"
13248   echo "  Where do we find X Windows libraries?                   $x_libraries"
13249 fi
13250 if test -n "$site_includes"; then
13251   echo "  Additional header files:                                $site_includes"
13252 fi
13253 if test -n "$site_libraries"; then
13254   echo "  Additional libraries:                                   $site_libraries"
13255 fi
13256 if test -n "$site_prefixes"; then
13257   echo "  Additional prefixes:                                    $site_prefixes"
13258 fi
13259 if test -n "$runpath"; then
13260   echo "  Runtime library search path:                            $runpath"
13261 fi
13262 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13263 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13264 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13265 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13266   echo "  No Xmu; substituting equivalent routines."
13267 fi
13268
13269 if test "$with_xpm" = yes; then
13270   echo "  Compiling in support for XPM images."
13271 elif test "$with_x11" = yes; then
13272   echo "  --------------------------------------------------------------------"
13273   echo "  WARNING: Compiling without XPM support."
13274   if test "$xpm_problem" != ""; then
13275     echo "  Reason: $xpm_problem"
13276   fi
13277   echo "  WARNING: You should strongly consider installing XPM."
13278   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13279   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13280   echo "  --------------------------------------------------------------------"
13281 fi
13282 if test "$with_png" = yes; then
13283   echo "  Compiling in support for PNG image handling."
13284 elif test "$window_system" != "none"; then
13285   echo "  --------------------------------------------------------------------"
13286   echo "  WARNING: Compiling without PNG image support."
13287   if test "$png_problem" != ""; then
13288     echo "  Reason: $png_problem"
13289   fi
13290   echo "  WARNING: You should strongly consider installing the PNG libraries."
13291   echo "  WARNING: Otherwise certain images and glyphs may not display."
13292   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13293   echo "  --------------------------------------------------------------------"
13294 fi
13295 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13296 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13297 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13298 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13299 case "$with_sound" in
13300   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13301   native ) echo "  Compiling in native sound support." ;;
13302   both   ) echo "  Compiling in both network and native sound support." ;;
13303 esac
13304 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13305
13306 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13307 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13308 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13309
13310 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
13311 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
13312 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
13313
13314 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13315 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13316
13317 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13318 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13319 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13320 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13321 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13322 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13323 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13324 if test "$with_wnn" = yes; then
13325   echo "  Compiling in support for the WNN input method on Mule."
13326   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13327 fi
13328 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13329
13330 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13331 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13332 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13333 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13334 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13335 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13336 case "$with_menubars" in
13337   lucid ) echo "  Using Lucid menubars." ;;
13338   motif ) echo "  Using Motif menubars."
13339           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13340           echo "             We recommend using the Lucid menubar instead."
13341           echo "             Re-run configure with --with-menubars='lucid'." ;;
13342 esac
13343 case "$with_scrollbars" in
13344   lucid    ) echo "  Using Lucid scrollbars."     ;;
13345   motif    ) echo "  Using Motif scrollbars."     ;;
13346   athena   ) echo "  Using Athena scrollbars."    ;;
13347   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13348 esac
13349 case "$with_dialogs" in
13350   motif    )
13351     echo "  Using Motif dialog boxes."
13352     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13353       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13354       echo "             We recommend using the Athena dialog boxes instead."
13355       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13356       echo "             Read the PROBLEMS file for more information."
13357     fi; fi
13358     ;;
13359   athena   ) echo "  Using Athena dialog boxes."    ;;
13360   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13361 esac
13362 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
13363 test "$with_clash_detection" = yes && \
13364   echo "  Clash detection will use \"$lockdir\" for locking files."
13365 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13366 test "$with_pop"        = yes && echo "  Using POP for mail access."
13367 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13368 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13369 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13370 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13371 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13372 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13373   != "no no no no no"; then
13374   echo "  WARNING: ---------------------------------------------------------"
13375   echo "  WARNING: Compiling in support for runtime error checking."
13376   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13377   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13378   echo "  WARNING: ---------------------------------------------------------"
13379 fi
13380 echo ""
13381 ) | tee -a Installation
13382 echo ""
13383
13384
13385 # Remove any trailing slashes in these variables.
13386 test -n "$prefix" &&
13387   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13388 test -n "$exec_prefix" &&
13389   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13390
13391
13392 for file in $internal_makefile_list; do
13393   test "$file" = src/Makefile.in && \
13394     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13395   ac_output_files="${ac_output_files+$ac_output_files }$file"
13396 done
13397 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13398 if test "$with_shlib" = "yes"; then
13399   ac_output_files="$ac_output_files lib-src/ellcc.h"
13400 fi
13401
13402 trap '' 1 2 15
13403
13404 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13405
13406 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13407 # Let make expand exec_prefix.
13408 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13409
13410 # Any assignment to VPATH causes Sun make to only execute
13411 # the first set of double-colon rules, so remove it if not needed.
13412 # If there is a colon in the path, we need to keep it.
13413 if test "x$srcdir" = x.; then
13414   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13415 fi
13416
13417 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13418
13419 DEFS=-DHAVE_CONFIG_H
13420
13421 # Without the "./", some shells look in PATH for config.status.
13422 : ${CONFIG_STATUS=./config.status}
13423
13424 echo creating $CONFIG_STATUS
13425 rm -f $CONFIG_STATUS
13426 cat > $CONFIG_STATUS <<EOF
13427 #! /bin/sh
13428 # Generated automatically by configure.
13429 # Run this file to recreate the current configuration.
13430 # This directory was configured as follows,
13431 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13432 #
13433 # $0 $ac_configure_args
13434 #
13435 # Compiler output produced by configure, useful for debugging
13436 # configure, is in ./config.log if it exists.
13437
13438 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13439 for ac_option
13440 do
13441   case "\$ac_option" in
13442   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13443     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13444     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13445   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13446     echo "$CONFIG_STATUS generated by autoconf version 2.13"
13447     exit 0 ;;
13448   -help | --help | --hel | --he | --h)
13449     echo "\$ac_cs_usage"; exit 0 ;;
13450   *) echo "\$ac_cs_usage"; exit 1 ;;
13451   esac
13452 done
13453
13454 ac_given_srcdir=$srcdir
13455 ac_given_INSTALL="$INSTALL"
13456
13457 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13458 EOF
13459 cat >> $CONFIG_STATUS <<EOF
13460
13461 # Protect against being on the right side of a sed subst in config.status.
13462 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13463  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13464 $ac_vpsub
13465 $extrasub
13466 s%@SHELL@%$SHELL%g
13467 s%@CFLAGS@%$CFLAGS%g
13468 s%@CPPFLAGS@%$CPPFLAGS%g
13469 s%@CXXFLAGS@%$CXXFLAGS%g
13470 s%@FFLAGS@%$FFLAGS%g
13471 s%@DEFS@%$DEFS%g
13472 s%@LDFLAGS@%$LDFLAGS%g
13473 s%@LIBS@%$LIBS%g
13474 s%@exec_prefix@%$exec_prefix%g
13475 s%@prefix@%$prefix%g
13476 s%@program_transform_name@%$program_transform_name%g
13477 s%@bindir@%$bindir%g
13478 s%@sbindir@%$sbindir%g
13479 s%@libexecdir@%$libexecdir%g
13480 s%@datadir@%$datadir%g
13481 s%@sysconfdir@%$sysconfdir%g
13482 s%@sharedstatedir@%$sharedstatedir%g
13483 s%@localstatedir@%$localstatedir%g
13484 s%@libdir@%$libdir%g
13485 s%@includedir@%$includedir%g
13486 s%@oldincludedir@%$oldincludedir%g
13487 s%@infodir@%$infodir%g
13488 s%@mandir@%$mandir%g
13489 s%@LN_S@%$LN_S%g
13490 s%@blddir@%$blddir%g
13491 s%@CC@%$CC%g
13492 s%@CPP@%$CPP%g
13493 s%@start_flags@%$start_flags%g
13494 s%@ld_switch_shared@%$ld_switch_shared%g
13495 s%@start_files@%$start_files%g
13496 s%@ld@%$ld%g
13497 s%@lib_gcc@%$lib_gcc%g
13498 s%@RANLIB@%$RANLIB%g
13499 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13500 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
13501 s%@INSTALL_DATA@%$INSTALL_DATA%g
13502 s%@YACC@%$YACC%g
13503 s%@SET_MAKE@%$SET_MAKE%g
13504 s%@X_CFLAGS@%$X_CFLAGS%g
13505 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13506 s%@X_LIBS@%$X_LIBS%g
13507 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13508 s%@install_pp@%$install_pp%g
13509 s%@libs_xauth@%$libs_xauth%g
13510 s%@dnd_objs@%$dnd_objs%g
13511 s%@lwlib_objs@%$lwlib_objs%g
13512 s%@ALLOCA@%$ALLOCA%g
13513 s%@dll_ld@%$dll_ld%g
13514 s%@dll_cflags@%$dll_cflags%g
13515 s%@dll_ldflags@%$dll_ldflags%g
13516 s%@dll_post@%$dll_post%g
13517 s%@dll_ldo@%$dll_ldo%g
13518 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13519 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13520 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13521 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13522 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13523 s%@PROGNAME@%$PROGNAME%g
13524 s%@version@%$version%g
13525 s%@configuration@%$configuration%g
13526 s%@canonical@%$canonical%g
13527 s%@srcdir@%$srcdir%g
13528 s%@pkgdir@%$pkgdir%g
13529 s%@statedir@%$statedir%g
13530 s%@PREFIX@%$PREFIX%g
13531 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13532 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13533 s%@INFODIR@%$INFODIR%g
13534 s%@infopath@%$infopath%g
13535 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13536 s%@INFOPATH@%$INFOPATH%g
13537 s%@package_path@%$package_path%g
13538 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13539 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13540 s%@lispdir@%$lispdir%g
13541 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13542 s%@LISPDIR@%$LISPDIR%g
13543 s%@moduledir@%$moduledir%g
13544 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13545 s%@MODULEDIR@%$MODULEDIR%g
13546 s%@sitelispdir@%$sitelispdir%g
13547 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13548 s%@SITELISPDIR@%$SITELISPDIR%g
13549 s%@sitemoduledir@%$sitemoduledir%g
13550 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13551 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13552 s%@etcdir@%$etcdir%g
13553 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13554 s%@ETCDIR@%$ETCDIR%g
13555 s%@lockdir@%$lockdir%g
13556 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13557 s%@LOCKDIR@%$LOCKDIR%g
13558 s%@archlibdir@%$archlibdir%g
13559 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13560 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13561 s%@docdir@%$docdir%g
13562 s%@bitmapdir@%$bitmapdir%g
13563 s%@extra_objs@%$extra_objs%g
13564 s%@machfile@%$machfile%g
13565 s%@opsysfile@%$opsysfile%g
13566 s%@c_switch_general@%$c_switch_general%g
13567 s%@c_switch_window_system@%$c_switch_window_system%g
13568 s%@c_switch_all@%$c_switch_all%g
13569 s%@ld_switch_general@%$ld_switch_general%g
13570 s%@ld_switch_window_system@%$ld_switch_window_system%g
13571 s%@ld_switch_all@%$ld_switch_all%g
13572 s%@ld_libs_general@%$ld_libs_general%g
13573 s%@ld_libs_window_system@%$ld_libs_window_system%g
13574 s%@ld_libs_all@%$ld_libs_all%g
13575 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13576 s%@native_sound_lib@%$native_sound_lib%g
13577 s%@sound_cflags@%$sound_cflags%g
13578 s%@dynodump_arch@%$dynodump_arch%g
13579 s%@XEMACS_CC@%$XEMACS_CC%g
13580 s%@internal_makefile_list@%$internal_makefile_list%g
13581
13582 CEOF
13583 EOF
13584
13585 cat >> $CONFIG_STATUS <<\EOF
13586
13587 # Split the substitutions into bite-sized pieces for seds with
13588 # small command number limits, like on Digital OSF/1 and HP-UX.
13589 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13590 ac_file=1 # Number of current file.
13591 ac_beg=1 # First line for current file.
13592 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13593 ac_more_lines=:
13594 ac_sed_cmds=""
13595 while $ac_more_lines; do
13596   if test $ac_beg -gt 1; then
13597     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13598   else
13599     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13600   fi
13601   if test ! -s conftest.s$ac_file; then
13602     ac_more_lines=false
13603     rm -f conftest.s$ac_file
13604   else
13605     if test -z "$ac_sed_cmds"; then
13606       ac_sed_cmds="sed -f conftest.s$ac_file"
13607     else
13608       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13609     fi
13610     ac_file=`expr $ac_file + 1`
13611     ac_beg=$ac_end
13612     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13613   fi
13614 done
13615 if test -z "$ac_sed_cmds"; then
13616   ac_sed_cmds=cat
13617 fi
13618 EOF
13619
13620 cat >> $CONFIG_STATUS <<EOF
13621
13622 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13623 EOF
13624 cat >> $CONFIG_STATUS <<\EOF
13625 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13626   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13627   case "$ac_file" in
13628   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13629        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13630   *) ac_file_in="${ac_file}.in" ;;
13631   esac
13632
13633   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13634
13635   # Remove last slash and all that follows it.  Not all systems have dirname.
13636   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13637   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13638     # The file is in a subdirectory.
13639     test ! -d "$ac_dir" && mkdir "$ac_dir"
13640     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13641     # A "../" for each directory in $ac_dir_suffix.
13642     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13643   else
13644     ac_dir_suffix= ac_dots=
13645   fi
13646
13647   case "$ac_given_srcdir" in
13648   .)  srcdir=.
13649       if test -z "$ac_dots"; then top_srcdir=.
13650       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13651   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13652   *) # Relative path.
13653     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13654     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13655   esac
13656
13657   case "$ac_given_INSTALL" in
13658   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13659   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13660   esac
13661
13662   echo creating "$ac_file"
13663   rm -f "$ac_file"
13664   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13665   case "$ac_file" in
13666   *Makefile*) ac_comsub="1i\\
13667 # $configure_input" ;;
13668   *) ac_comsub= ;;
13669   esac
13670
13671   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13672   sed -e "$ac_comsub
13673 s%@configure_input@%$configure_input%g
13674 s%@srcdir@%$srcdir%g
13675 s%@top_srcdir@%$top_srcdir%g
13676 s%@INSTALL@%$INSTALL%g
13677 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13678 fi; done
13679 rm -f conftest.s*
13680
13681 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13682 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13683 #
13684 # ac_d sets the value in "#define NAME VALUE" lines.
13685 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13686 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13687 ac_dC='\3'
13688 ac_dD='%g'
13689 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13690 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13691 ac_uB='\([      ]\)%\1#\2define\3'
13692 ac_uC=' '
13693 ac_uD='\4%g'
13694 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13695 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13696 ac_eB='$%\1#\2define\3'
13697 ac_eC=' '
13698 ac_eD='%g'
13699
13700 if test "${CONFIG_HEADERS+set}" != set; then
13701 EOF
13702 cat >> $CONFIG_STATUS <<EOF
13703   CONFIG_HEADERS="src/config.h lwlib/config.h"
13704 EOF
13705 cat >> $CONFIG_STATUS <<\EOF
13706 fi
13707 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13708   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13709   case "$ac_file" in
13710   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13711        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13712   *) ac_file_in="${ac_file}.in" ;;
13713   esac
13714
13715   echo creating $ac_file
13716
13717   rm -f conftest.frag conftest.in conftest.out
13718   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13719   cat $ac_file_inputs > conftest.in
13720
13721 EOF
13722
13723 # Transform confdefs.h into a sed script conftest.vals that substitutes
13724 # the proper values into config.h.in to produce config.h.  And first:
13725 # Protect against being on the right side of a sed subst in config.status.
13726 # Protect against being in an unquoted here document in config.status.
13727 rm -f conftest.vals
13728 cat > conftest.hdr <<\EOF
13729 s/[\\&%]/\\&/g
13730 s%[\\$`]%\\&%g
13731 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13732 s%ac_d%ac_u%gp
13733 s%ac_u%ac_e%gp
13734 EOF
13735 sed -n -f conftest.hdr confdefs.h > conftest.vals
13736 rm -f conftest.hdr
13737
13738 # This sed command replaces #undef with comments.  This is necessary, for
13739 # example, in the case of _POSIX_SOURCE, which is predefined and required
13740 # on some systems where configure will not decide to define it.
13741 cat >> conftest.vals <<\EOF
13742 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13743 EOF
13744
13745 # Break up conftest.vals because some shells have a limit on
13746 # the size of here documents, and old seds have small limits too.
13747
13748 rm -f conftest.tail
13749 while :
13750 do
13751   ac_lines=`grep -c . conftest.vals`
13752   # grep -c gives empty output for an empty file on some AIX systems.
13753   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13754   # Write a limited-size here document to conftest.frag.
13755   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13756   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13757   echo 'CEOF
13758   sed -f conftest.frag conftest.in > conftest.out
13759   rm -f conftest.in
13760   mv conftest.out conftest.in
13761 ' >> $CONFIG_STATUS
13762   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13763   rm -f conftest.vals
13764   mv conftest.tail conftest.vals
13765 done
13766 rm -f conftest.vals
13767
13768 cat >> $CONFIG_STATUS <<\EOF
13769   rm -f conftest.frag conftest.h
13770   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13771   cat conftest.in >> conftest.h
13772   rm -f conftest.in
13773   if cmp -s $ac_file conftest.h 2>/dev/null; then
13774     echo "$ac_file is unchanged"
13775     rm -f conftest.h
13776   else
13777     # Remove last slash and all that follows it.  Not all systems have dirname.
13778       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13779       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13780       # The file is in a subdirectory.
13781       test ! -d "$ac_dir" && mkdir "$ac_dir"
13782     fi
13783     rm -f $ac_file
13784     mv conftest.h $ac_file
13785   fi
13786 fi; done
13787
13788 EOF
13789 cat >> $CONFIG_STATUS <<EOF
13790 CPP="$CPP"
13791  top_srcdir="$srcdir"
13792  MAKE_SUBDIR="$MAKE_SUBDIR"
13793
13794 EOF
13795 cat >> $CONFIG_STATUS <<\EOF
13796 for dir in . $MAKE_SUBDIR; do
13797   (
13798     cd $dir
13799     rm -f junk.c
13800     < Makefile.in \
13801       sed -e '/^# Generated/d' \
13802           -e 's%/\*\*/#.*%%' \
13803           -e 's/^ *# */#/' \
13804           -e '/^##/d' \
13805           -e '/^#/ {
13806 p
13807 d
13808 }'        \
13809           -e '/./ {
13810 s/\([\"]\)/\\\1/g
13811 s/^/"/
13812 s/$/"/
13813 }'  > junk.c;
13814
13815
13816
13817     echo creating $dir/Makefile
13818 $CPP -I. -I${top_srcdir}/src  junk.c \
13819   | sed -e 's/^\#.*//'          \
13820         -e 's/^[        ][      ]*$//'\
13821         -e 's/^ /       /'              \
13822   | sed -n -e '/^..*$/p'        \
13823   | sed '/^\"/ {
13824         s/\\\([\"]\)/\1/g
13825         s/^[    ]*\"//
13826         s/\"[   ]*$//
13827 }' > Makefile.new
13828     chmod 444 Makefile.new
13829     mv -f Makefile.new Makefile
13830
13831     echo creating $dir/GNUmakefile
13832 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13833   | sed -e 's/^\#.*//'          \
13834         -e 's/^[        ][      ]*$//'\
13835         -e 's/^ /       /'              \
13836   | sed -n -e '/^..*$/p'        \
13837   | sed '/^\"/ {
13838         s/\\\([\"]\)/\1/g
13839         s/^[    ]*\"//
13840         s/\"[   ]*$//
13841 }' > Makefile.new
13842     chmod 444 Makefile.new
13843     mv -f Makefile.new GNUmakefile
13844
13845     rm -f junk.c
13846   )
13847 done
13848
13849 sed < config.status >> lib-src/config.values \
13850   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13851   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13852   -e 's/^\([^ ]*\) $/\1 ""/' \
13853   -e 's/ 1$/ t/'
13854
13855
13856 exit 0
13857 EOF
13858 chmod +x $CONFIG_STATUS
13859 rm -fr confdefs* $ac_clean_files
13860 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1