update.
[chise/xemacs-chise.git] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.13 
6 #### Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
7 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
8 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
9 #### Copyright (C) 1995, 1996 Ben Wing.
10 #### Copyright (C) 1998, 1999 J. Kean Johnston.
11
12 ### Don't edit this script!
13 ### This script was automatically generated by the `autoconf' program
14 ### from the file `./configure.in'.
15 ### To rebuild it, execute the command
16 ###     autoconf
17 ### in the this directory.  You must have autoconf version 2.12 or later.
18
19 ### This file is part of XEmacs.
20
21 ### XEmacs is free software; you can redistribute it and/or modify it
22 ### under the terms of the GNU General Public License as published by
23 ### the Free Software Foundation; either version 2, or (at your
24 ### option) any later version.
25
26 ### XEmacs is distributed in the hope that it will be useful, but
27 ### WITHOUT ANY WARRANTY; without even the implied warranty of
28 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29 ### General Public License for more details.
30
31 ### You should have received a copy of the GNU General Public License
32 ### along with XEmacs; see the file COPYING.  If not, write to the Free
33 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 ### 02111-1307, USA.
35
36 ### For usage, run `./configure --help'
37 ### For more detailed information on building and installing XEmacs,
38 ### read the file `INSTALL'.
39 ###
40 ### If configure succeeds, it leaves its status in config.status.
41 ### A log of configuration tests can be found in config.log.
42 ### If configure fails after disturbing the status quo,
43 ###     config.status is removed.
44
45 ac_help="$ac_help
46   --with-x                use the X Window System"
47
48
49
50 if test -n "$ZSH_VERSION"; then
51     setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
52   setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
53   setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
54   setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
55       if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
56 elif test -n "$BASH_VERSION"; then
57     set -o posix
58   unset CDPATH
59 else
60   if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
61 fi
62
63 exec_prefix=NONE
64 host=NONE
65 no_create=
66 nonopt=NONE
67 no_recursion=
68 prefix=NONE
69 program_prefix=NONE
70 program_suffix=NONE
71 program_transform_name=s,x,x,
72 silent=
73 site=
74 srcdir=
75 target=NONE
76 verbose=
77 x_includes=NONE
78 x_libraries=NONE
79
80 bindir='${exec_prefix}/bin'
81 sbindir='${exec_prefix}/sbin'
82 libexecdir='${exec_prefix}/libexec'
83 datadir='${prefix}/share'
84 sysconfdir='${prefix}/etc'
85 sharedstatedir='${prefix}/com'
86 localstatedir='${prefix}/var'
87 libdir='${{exec_prefix}}/lib'
88 includedir='${prefix}/include'
89 oldincludedir='/usr/include'
90 infodir='${prefix}/info'
91 mandir='${prefix}/man'
92
93 subdirs=
94 MFLAGS= MAKEFLAGS=
95 ac_max_here_lines=12
96
97 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
98
99 # File descriptor usage:
100 # 0 standard input
101 # 1 file creation
102 # 2 errors and warnings
103 # 3 some systems may open it to /dev/tty
104 # 4 used on the Kubota Titan
105 # 6 checking for... messages and results
106 # 5 compiler messages saved in config.log
107 if test "$silent" = yes; then
108   exec 6>/dev/null
109 else
110   exec 6>&1
111 fi
112 exec 5>./config.log
113
114 echo "\
115 This file contains any messages produced by compilers while
116 running configure, to aid debugging if configure makes a mistake.
117 " 1>&5
118
119 # Strip out --no-create and --no-recursion so they do not pile up.
120 # Also quote any args containing shell metacharacters.
121 ac_configure_args=
122 for ac_arg
123 do
124   case "$ac_arg" in
125   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
126   | --no-cr | --no-c) ;;
127   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
128   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
129   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
130   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
131   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
132   esac
133 done
134
135 # NLS nuisances.
136 # Only set these to C if already set.  These must not be set unconditionally
137 # because not all systems understand e.g. LANG=C (notably SCO).
138 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
139 # Non-C LC_CTYPE values break the ctype check.
140 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
141 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
142 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
143 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
144
145 # confdefs.h avoids OS command line length limits that DEFS can exceed.
146 rm -rf conftest* confdefs.h
147 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
148 echo > confdefs.h
149
150 # A filename unique to this package, relative to the directory that
151 # configure is in, which we can look for to find out if srcdir is correct.
152 ac_unique_file=src/lisp.h
153
154 # Find the source files, if location was not specified.
155 if test -z "$srcdir"; then
156   ac_srcdir_defaulted=yes
157   # Try the directory containing this script, then its parent.
158   ac_prog=$0
159   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
160   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
161   srcdir=$ac_confdir
162   if test ! -r $srcdir/$ac_unique_file; then
163     srcdir=..
164   fi
165 else
166   ac_srcdir_defaulted=no
167 fi
168 if test ! -r $srcdir/$ac_unique_file; then
169   if test "$ac_srcdir_defaulted" = yes; then
170     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
171   else
172     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
173   fi
174 fi
175 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
176
177 # Prefer explicitly selected file to automatically selected ones.
178 if test -z "$CONFIG_SITE"; then
179   if test "x$prefix" != xNONE; then
180     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
181   else
182     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
183   fi
184 fi
185 for ac_site_file in $CONFIG_SITE; do
186   if test -r "$ac_site_file"; then
187     echo "loading site script $ac_site_file"
188     . "$ac_site_file"
189   fi
190 done
191
192
193 ac_ext=c
194 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
195 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
196 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
197 ac_cpp='$CPP '"$xe_cppflags"
198 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
199 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
200 cross_compiling=no
201
202 ac_exeext=
203 ac_objext=o
204 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
205   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
206   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
207     ac_n= ac_c='
208 ' ac_t='        '
209   else
210     ac_n=-n ac_c= ac_t=
211   fi
212 else
213   ac_n= ac_c='\c' ac_t=
214 fi
215
216
217 progname="`echo $0 | sed 's:^\./\./:\./:'`"
218
219
220 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
221 INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
222
223 prefix='/usr/local'
224 exec_prefix='${prefix}'
225 bindir='${exec_prefix}/bin'
226 datadir='${prefix}/lib'
227 statedir='${prefix}/lib'
228 libdir='${exec_prefix}/lib'
229 mandir='${prefix}/man/man1'
230 infodir='${datadir}/${PROGNAME}-${version}/info'
231 infopath=''
232 install_pp=''
233 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
234 moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
235 sitelispdir='${datadir}/xemacs/site-lisp'
236 sitemoduledir='${datadir}/xemacs/site-modules'
237 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
238 package_path=''
239 etcdir='${datadir}/${PROGNAME}-${version}/etc'
240 lockdir='${statedir}/${PROGNAME}/lock'
241 archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
242 with_site_lisp='no'
243 with_site_modules='yes'
244 with_menubars=''
245 with_scrollbars=''
246 with_dialogs=''
247 with_file_coding=''
248 cpp='' cppflags='' libs='' ldflags=''
249 dynamic=''
250 with_x11=''
251 with_msw=''
252 rel_alloc='default'
253 with_system_malloc='default'
254 with_dlmalloc='default'
255 native_sound_lib=''
256 use_assertions="yes"
257 with_toolbars=""
258 with_tty=""
259 use_union_type="no"
260 with_dnet=""
261
262
263
264
265 arguments="$@"
266
267 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
268 quoted_arguments=
269 for i in "$@"; do
270    case "$i" in
271    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
272    | --no-cr | --no-c) ;;
273    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
274    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
275    *)
276    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
277    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
278    esac
279 done
280
281 while test $# != 0; do
282   arg="$1"; shift
283   case "$arg" in
284     --no-create|--no-recursion) ;;
285         -* )
286             case "$arg" in
287         -*=*)
288           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
289           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
290           valomitted=no
291         ;;
292                                                                           -*)
293                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
294           val="yes" valomitted=yes
295         ;;
296       esac
297
298             optname="$opt"
299       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
300
301             case "${valomitted}-${opt}" in yes-without_* )
302         opt=`echo $opt | sed 's/without/with/'`
303         valomitted="no" val="no" ;;
304       esac
305
306             case "$opt" in
307
308         with_site_lisp  | \
309     with_site_modules | \
310         with_x          | \
311         with_x11        | \
312         with_msw        | \
313         with_gcc        | \
314         dynamic         | \
315         with_ncurses    | \
316         with_dnet       | \
317         with_socks      | \
318         with_dragndrop  | \
319         with_cde        | \
320         with_offix      | \
321         with_gpm        | \
322         with_xpm        | \
323         with_xface      | \
324         with_gif        | \
325         with_jpeg       | \
326         with_png        | \
327         with_tiff       | \
328         with_wmcommand  | \
329         with_xmu        | \
330         with_purify     | \
331         with_quantify   | \
332         with_toolbars   | \
333         with_tty        | \
334         with_xfs        | \
335         with_i18n3      | \
336         with_mule       | \
337         with_utf_2000   | \
338         with_ucs4       | \
339         with_file_coding| \
340         with_canna      | \
341         with_wnn        | \
342         with_wnn6       | \
343         with_workshop   | \
344         with_sparcworks | \
345         with_tooltalk   | \
346         with_ldap       | \
347         with_pop        | \
348         with_kerberos   | \
349         with_hesiod     | \
350         with_dnet       | \
351         with_infodock   | \
352         external_widget | \
353         verbose         | \
354         extra_verbose   | \
355         const_is_losing | \
356         usage_tracking  | \
357         use_union_type  | \
358         debug           | \
359         use_assertions  | \
360         memory_usage_stats | \
361         with_clash_detection | \
362         with_shlib | \
363         no_doc_file )
364                   case "$val" in
365             y | ye | yes )      val=yes ;;
366             n | no )            val=no  ;;
367             * ) (echo "$progname: Usage error:"
368 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
369 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
370           esac
371           eval "$opt=\"$val\"" ;;
372
373
374                         srcdir          | \
375         compiler        | \
376         cflags          | \
377         cpp             | \
378         cppflags        | \
379         libs            | \
380         ldflags         | \
381         cache_file      | \
382         native_sound_lib| \
383         site_lisp       | \
384         x_includes      | \
385         x_libraries     | \
386         site_includes   | \
387         site_libraries  | \
388         site_prefixes   | \
389         site_runtime_libraries )
390                   if test "$valomitted" = "yes" ; then
391                     if test "$#" = 0 ; then
392               (echo "$progname: Usage error:"
393 echo " " "The \`--$optname' option requires a value."
394 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
395             fi
396             val="$1"; shift
397           fi
398           eval "$opt=\"$val\""
399         ;;
400
401                 rel_alloc | \
402         with_dlmalloc | \
403         with_debug_malloc  | use_debug_malloc | \
404         with_system_malloc | use_system_malloc )
405           case "$val" in
406             y | ye | yes )      val=yes ;;
407             n | no )            val=no  ;;
408             d | de | def | defa | defau | defaul | default ) val=default ;;
409             * ) (echo "$progname: Usage error:"
410 echo " " "The \`--$optname' option requires one of these values:
411   \`yes', \`no', or \`default'."
412 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
413           esac
414           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
415           eval "$opt=\"$val\""
416         ;;
417
418                 "with_database" )
419           with_database_berkdb=no
420           with_database_dbm=no
421           with_database_gnudbm=no
422           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
423             case "$x" in
424                 no ) ;;
425                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
426                 d | db | dbm )                          with_database_dbm=yes    ;;
427                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
428                 * ) (echo "$progname: Usage error:"
429 echo " " "The \`--$optname' option value
430   must be either \`no' or a comma-separated list
431   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
432 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
433             esac
434           done
435           if test "$with_database_dbm"    = "yes" -a \
436                   "$with_database_gnudbm" = "yes"; then
437           (echo "$progname: Usage error:"
438 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
439   with the \`--$optname' option."
440 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
441           fi
442         ;;
443
444                 "with_sound" )
445                           case "$val" in
446             y | ye | yes )                      val=native ;;
447             n | no | non | none )               val=no;;
448             na | nat | nati | nativ | native )  val=native  ;;
449             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
450             b | bo | bot | both )               val=both;;
451             * ) (echo "$progname: Usage error:"
452 echo " " "The \`--$optname' option must have one of these values:
453   \`native', \`nas', \`both', or \`none'."
454 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
455           esac
456           eval "$opt=\"$val\""
457         ;;
458
459                 "with_xim" )
460           case "$val" in
461             y | ye | yes )                val=yes   ;;
462             n | no | non | none )         val=no    ;;
463             x | xl | xli | xlib )         val=xlib  ;;
464             m | mo | mot | moti | motif ) val=motif ;;
465             * ) (echo "$progname: Usage error:"
466 echo " " "The \`--$optname' option must have one of these values:
467   \`motif', \`xlib', \`yes', or \`no'."
468 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
469           esac
470           eval "$opt=\"$val\""
471         ;;
472
473                 "mail_locking" )
474           case "$val" in
475             lockf )     val=lockf ;;
476             flock )     val=flock ;;
477             file )      val=file  ;;
478             * ) (echo "$progname: Usage error:"
479 echo " " "The \`--$optname' option must have one of these values:
480   \`lockf', \`flock', or \`file'."
481 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
482           esac
483           eval "$opt=\"$val\""
484         ;;
485
486                 "error_checking" )
487                           
488           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
489             case "$x" in
490                       n | no | non | none ) new_default=no ;;
491               a | al | all )        new_default=yes ;;
492
493               extents )       error_check_extents=yes ;;
494               noextents )     error_check_extents=no ;;
495
496               typecheck )     error_check_typecheck=yes ;;
497               notypecheck )   error_check_typecheck=no ;;
498
499               bufpos )        error_check_bufpos=yes ;;
500               nobufpos )      error_check_bufpos=no ;;
501
502               gc )            error_check_gc=yes ;;
503               nogc )          error_check_gc=no ;;
504
505               malloc )        error_check_malloc=yes ;;
506               nomalloc )      error_check_malloc=no ;;
507
508               byte_code )     error_check_byte_code=yes ;;
509               nobyte_code )   error_check_byte_code=no ;;
510
511               * ) bogus_error_check=yes ;;
512             esac
513             if test "$bogus_error_check" -o \
514                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
515                 if test "$error_check_default" = yes ; then
516                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
517                 else
518                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
519                 fi
520                 (echo "$progname: Usage error:"
521 echo " " "Valid types for the \`--$optname' option are:
522   $types."
523 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
524             elif test -n "$new_default" ; then
525                 error_check_extents=$new_default
526                 error_check_typecheck=$new_default
527                 error_check_bufpos=$new_default
528                 error_check_gc=$new_default
529                 error_check_malloc=$new_default
530                 error_check_byte_code=$new_default
531                 new_default=    # reset this
532             fi
533             echeck_notfirst=true
534           done
535         ;;
536
537                                 
538                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
539         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
540         archlibdir | docdir | package_path )
541                    if test "$valomitted" = "yes"; then
542              if test "$#" = 0; then
543                  (echo "$progname: Usage error:"
544 echo " " "The \`--$optname' option requires a value."
545 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
546              fi
547              val="$1"; shift
548            fi
549            eval "$opt=\"$val\""
550
551                            case "$opt" in
552              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
553     Defining LISPDIR_USER_DEFINED
554 EOF
555 cat >> confdefs.h <<\EOF
556 #define LISPDIR_USER_DEFINED 1
557 EOF
558 }
559  ;;
560              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
561     Defining SITELISPDIR_USER_DEFINED
562 EOF
563 cat >> confdefs.h <<\EOF
564 #define SITELISPDIR_USER_DEFINED 1
565 EOF
566 }
567  ;;
568              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
569     Defining MODULEDIR_USER_DEFINED
570 EOF
571 cat >> confdefs.h <<\EOF
572 #define MODULEDIR_USER_DEFINED 1
573 EOF
574 }
575  ;;
576              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
577     Defining ETCDIR_USER_DEFINED
578 EOF
579 cat >> confdefs.h <<\EOF
580 #define ETCDIR_USER_DEFINED 1
581 EOF
582 }
583  ;;
584              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
585     Defining INFODIR_USER_DEFINED
586 EOF
587 cat >> confdefs.h <<\EOF
588 #define INFODIR_USER_DEFINED 1
589 EOF
590 }
591  ;;
592              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
593     Defining INFOPATH_USER_DEFINED
594 EOF
595 cat >> confdefs.h <<\EOF
596 #define INFOPATH_USER_DEFINED 1
597 EOF
598 }
599  ;;
600              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
601     Defining PACKAGE_PATH_USER_DEFINED
602 EOF
603 cat >> confdefs.h <<\EOF
604 #define PACKAGE_PATH_USER_DEFINED 1
605 EOF
606 }
607  ;;
608              datadir )
609                 { test "$extra_verbose" = "yes" && cat << \EOF
610     Defining INFODIR_USER_DEFINED
611 EOF
612 cat >> confdefs.h <<\EOF
613 #define INFODIR_USER_DEFINED 1
614 EOF
615 }
616
617                 { test "$extra_verbose" = "yes" && cat << \EOF
618     Defining LISPDIR_USER_DEFINED
619 EOF
620 cat >> confdefs.h <<\EOF
621 #define LISPDIR_USER_DEFINED 1
622 EOF
623 }
624
625             { test "$extra_verbose" = "yes" && cat << \EOF
626     Defining MODULEDIR_USER_DEFINED
627 EOF
628 cat >> confdefs.h <<\EOF
629 #define MODULEDIR_USER_DEFINED 1
630 EOF
631 }
632
633                 { test "$extra_verbose" = "yes" && cat << \EOF
634     Defining ETCDIR_USER_DEFINED
635 EOF
636 cat >> confdefs.h <<\EOF
637 #define ETCDIR_USER_DEFINED 1
638 EOF
639 }
640  ;;
641              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
642     Defining LOCKDIR_USER_DEFINED
643 EOF
644 cat >> confdefs.h <<\EOF
645 #define LOCKDIR_USER_DEFINED 1
646 EOF
647 }
648  ;;
649              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
650     Defining ARCHLIBDIR_USER_DEFINED
651 EOF
652 cat >> confdefs.h <<\EOF
653 #define ARCHLIBDIR_USER_DEFINED 1
654 EOF
655 }
656  ;;
657            esac
658         ;;
659
660                 "no_create" ) ;;
661
662                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
663
664                 "with_menubars"   | \
665         "with_scrollbars" | \
666         "with_dialogs" )
667           case "$val" in
668             l | lu | luc | luci | lucid )               val=lucid  ;;
669             m | mo | mot | moti | motif )               val=motif  ;;
670             athena3d | athena-3d )                      val=athena3d ;;
671             a | at | ath | athe | athen | athena )      val=athena ;;
672             n | no | non | none )                       val=no ;;
673             * ) (echo "$progname: Usage error:"
674 echo " " "The \`--$optname' option must have one of these values:
675   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
676 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
677           esac
678           eval "$opt=\"$val\""
679         ;;
680
681                 "run_in_place"  | \
682         "with_gnu_make" )
683           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
684         ;;
685
686                 * ) (echo "$progname: Usage error:"
687 echo " " "Unrecognized option: $arg"
688 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
689
690       esac
691     ;;
692
693         *-*-*) configuration="$arg" ;;
694
695         *) (echo "$progname: Usage error:"
696 echo " " "Unrecognized argument: $arg"
697 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
698
699   esac
700 done
701
702
703 test -n "$cpp"      && CPP="$cpp"
704 test -n "$cppflags" && CPPFLAGS="$cppflags"
705 test -n "$libs"     && LIBS="$libs"
706 test -n "$ldflags"  && LDFLAGS="$ldflags"
707
708 eval set x "$quoted_arguments"; shift
709
710 test "$extra_verbose" = "yes" && verbose=yes
711
712 test -n "$with_x" && with_x11="$with_x"
713
714 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
715   test "$with_system_malloc" = "default" && with_system_malloc=yes
716 fi
717
718
719
720 if test "$with_cde $with_tooltalk" = "yes no"; then
721   (echo "$progname: Usage error:"
722 echo " " "--with-cde requires --with-tooltalk"
723 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
724 elif test "$with_tooltalk" = "no" ; then with_cde=no
725 elif test "$with_cde" = "yes"; then with_tooltalk=yes
726 fi
727
728
729 case "$srcdir" in
730
731     "" )
732     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
733       if test -f "$dir/src/lisp.h" -a \
734               -f "$dir/lisp/version.el" ; then
735         srcdir="$dir"
736         break
737       fi
738     done
739     if test -z "$srcdir" ; then
740       (echo "$progname: Usage error:"
741 echo " " "Neither the current directory nor its parent seem to
742   contain the XEmacs sources.  If you do not want to build XEmacs in its
743   source tree, you should run \`$progname' in the directory in which
744   you wish to build XEmacs, using the \`--srcdir' option to say where the
745   sources may be found."
746 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
747     fi
748   ;;
749
750     * )
751     if test ! -f "$srcdir/src/lisp.h" -o \
752             ! -f "$srcdir/lisp/version.el" ; then
753       (echo "$progname: Usage error:"
754 echo " " "The directory specified with the \`--srcdir' option,
755   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
756   either run the \`$progname' script at the top of the XEmacs source
757   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
758 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
759     fi
760   ;;
761 esac
762
763 if test -z "$configuration"; then
764     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
765   if test -z "$configuration"; then
766     (echo "$progname: Usage error:"
767 echo " " "XEmacs has not been ported to this host type.
768 Try explicitly specifying the CONFIGURATION when rerunning configure."
769 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
770   fi
771 fi
772
773 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
774 echo "configure:775: checking whether ln -s works" >&5
775
776 rm -f conftestdata
777 if ln -s X conftestdata 2>/dev/null
778 then
779   rm -f conftestdata
780   ac_cv_prog_LN_S="ln -s"
781 else
782   ac_cv_prog_LN_S=ln
783 fi
784 LN_S="$ac_cv_prog_LN_S"
785 if test "$ac_cv_prog_LN_S" = "ln -s"; then
786   echo "$ac_t""yes" 1>&6
787 else
788   echo "$ac_t""no" 1>&6
789 fi
790
791
792 for dir in lisp etc man info; do
793   if test ! -d "$dir" ; then
794     echo Making symbolic link to "$srcdir/$dir"
795     ${LN_S} "$srcdir/$dir" "$dir"
796   fi
797 done
798
799
800 absolute_pwd="`pwd`";
801 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
802 then blddir="$PWD"
803 else blddir="$absolute_pwd"; if test -d "/net"; then
804   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
805   blddir=`echo "$blddir" | \
806    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
807 fi
808 fi
809
810
811 case "$srcdir" in
812   /* ) ;;
813   .  ) srcdir="$blddir" ;;
814   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
815   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
816   srcdir=`echo "$srcdir" | \
817    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
818 fi ;;
819 esac
820
821 if test `pwd` != `sh -c cd $srcdir && pwd`  \
822    && test -f "$srcdir/src/config.h"; then
823   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
824    echo "   as a build directory right now; it has been configured in its own"
825    echo "   right.  To configure in another directory as well, you MUST"
826    echo "   use GNU make.  If you do not have GNU make, then you must"
827    echo "   now do \`make distclean' in $srcdir,"
828    echo "   and then run $progname again.") >&2
829   extrasub='/^VPATH[     ]*=/c\
830 vpath %.c $(srcdir)\
831 vpath %.h $(srcdir)\
832 vpath %.y $(srcdir)\
833 vpath %.l $(srcdir)\
834 vpath %.s $(srcdir)\
835 vpath %.in $(srcdir)'
836 fi
837
838 . "$srcdir/version.sh" || exit 1;
839 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
840 : "${extra_verbose=$beta}"
841 version="${emacs_major_version}.${emacs_minor_version}"
842 { test "$extra_verbose" = "yes" && cat << EOF
843     Defining EMACS_MAJOR_VERSION = $emacs_major_version
844 EOF
845 cat >> confdefs.h <<EOF
846 #define EMACS_MAJOR_VERSION $emacs_major_version
847 EOF
848 }
849
850 { test "$extra_verbose" = "yes" && cat << EOF
851     Defining EMACS_MINOR_VERSION = $emacs_minor_version
852 EOF
853 cat >> confdefs.h <<EOF
854 #define EMACS_MINOR_VERSION $emacs_minor_version
855 EOF
856 }
857
858 if test -n "$emacs_beta_version" ; then
859   if test "$beta" = "yes"; then
860         version="${version}-b${emacs_beta_version}"
861         { test "$extra_verbose" = "yes" && cat << EOF
862     Defining EMACS_BETA_VERSION = $emacs_beta_version
863 EOF
864 cat >> confdefs.h <<EOF
865 #define EMACS_BETA_VERSION $emacs_beta_version
866 EOF
867 }
868
869   else
870         version="${version}.${emacs_beta_version}"
871         { test "$extra_verbose" = "yes" && cat << EOF
872     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
873 EOF
874 cat >> confdefs.h <<EOF
875 #define EMACS_PATCH_LEVEL $emacs_beta_version
876 EOF
877 }
878
879   fi
880 fi
881 { test "$extra_verbose" = "yes" && cat << EOF
882     Defining XEMACS_CODENAME = "$xemacs_codename"
883 EOF
884 cat >> confdefs.h <<EOF
885 #define XEMACS_CODENAME "$xemacs_codename"
886 EOF
887 }
888
889 { test "$extra_verbose" = "yes" && cat << EOF
890     Defining EMACS_VERSION = "$version"
891 EOF
892 cat >> confdefs.h <<EOF
893 #define EMACS_VERSION "$version"
894 EOF
895 }
896
897
898 if test "$with_infodock" = "yes"; then
899   if test ! -f ../ID-INSTALL; then
900     echo "Cannot build InfoDock without InfoDock sources"
901     with_infodock=no
902   fi
903 fi
904
905 if test "$with_infodock" = "yes"; then
906       { test "$extra_verbose" = "yes" && cat << EOF
907     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
908 EOF
909 cat >> confdefs.h <<EOF
910 #define INFODOCK_MAJOR_VERSION $infodock_major_version
911 EOF
912 }
913
914   { test "$extra_verbose" = "yes" && cat << EOF
915     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
916 EOF
917 cat >> confdefs.h <<EOF
918 #define INFODOCK_MINOR_VERSION $infodock_minor_version
919 EOF
920 }
921
922   { test "$extra_verbose" = "yes" && cat << EOF
923     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
924 EOF
925 cat >> confdefs.h <<EOF
926 #define INFODOCK_BUILD_VERSION $infodock_build_version
927 EOF
928 }
929
930   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
931   PROGNAME=infodock
932   CPPFLAGS="$CPPFLAGS -DINFODOCK"
933 else
934   PROGNAME=xemacs
935 fi
936
937 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
938 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
939     Defining ERROR_CHECK_EXTENTS
940 EOF
941 cat >> confdefs.h <<\EOF
942 #define ERROR_CHECK_EXTENTS 1
943 EOF
944 }
945
946 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
947     Defining ERROR_CHECK_TYPECHECK
948 EOF
949 cat >> confdefs.h <<\EOF
950 #define ERROR_CHECK_TYPECHECK 1
951 EOF
952 }
953
954 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
955     Defining ERROR_CHECK_BUFPOS
956 EOF
957 cat >> confdefs.h <<\EOF
958 #define ERROR_CHECK_BUFPOS 1
959 EOF
960 }
961
962 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
963     Defining ERROR_CHECK_GC
964 EOF
965 cat >> confdefs.h <<\EOF
966 #define ERROR_CHECK_GC 1
967 EOF
968 }
969
970 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
971     Defining ERROR_CHECK_MALLOC
972 EOF
973 cat >> confdefs.h <<\EOF
974 #define ERROR_CHECK_MALLOC 1
975 EOF
976 }
977
978 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
979     Defining ERROR_CHECK_BYTE_CODE
980 EOF
981 cat >> confdefs.h <<\EOF
982 #define ERROR_CHECK_BYTE_CODE 1
983 EOF
984 }
985
986 if test "${debug:=$beta}" = "yes"; then
987   use_assertions=yes memory_usage_stats=yes
988   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
989    echo "    xemacs will be linked with \"debug.o\""
990  fi
991   { test "$extra_verbose" = "yes" && cat << \EOF
992     Defining DEBUG_XEMACS
993 EOF
994 cat >> confdefs.h <<\EOF
995 #define DEBUG_XEMACS 1
996 EOF
997 }
998
999 fi
1000 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1001     Defining USE_ASSERTIONS
1002 EOF
1003 cat >> confdefs.h <<\EOF
1004 #define USE_ASSERTIONS 1
1005 EOF
1006 }
1007
1008 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1009     Defining MEMORY_USAGE_STATS
1010 EOF
1011 cat >> confdefs.h <<\EOF
1012 #define MEMORY_USAGE_STATS 1
1013 EOF
1014 }
1015
1016
1017
1018 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1019 echo "configure:1020: checking "host system type"" >&5
1020 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1021 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1022 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1023 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1024 echo "$ac_t""$configuration" 1>&6
1025
1026
1027
1028
1029
1030 machine='' opsys=''
1031
1032 case "$canonical" in
1033   sparc-*-*        ) machine=sparc ;;
1034   alpha*-*-*       ) machine=alpha ;;
1035   vax-*-*          ) machine=vax ;;
1036   mips-dec-*       ) machine=pmax ;;
1037   mips-sgi-*       ) machine=iris4d ;;
1038   romp-ibm-*       ) machine=ibmrt ;;
1039   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1040   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1041   powerpc*-*       ) machine=powerpc ;;
1042   hppa-*-*         ) machine=hp800 ;;
1043   m88k-dg-*        ) machine=aviion ;;
1044   m68*-sony-*      ) machine=news ;;
1045   mips-sony-*      ) machine=news-risc ;;
1046   clipper-*        ) machine=clipper ;;
1047   arm-*            ) machine=arm ;;
1048   ns32k-*          ) machine=ns32000 ;;
1049 esac
1050
1051 case "$canonical" in
1052   *-*-linux*    ) opsys=linux ;;
1053   *-*-netbsd*   ) opsys=netbsd ;;
1054   *-*-openbsd*  ) opsys=openbsd ;;
1055   *-*-nextstep* ) opsys=nextstep ;;
1056   *-*-vms       ) opsys=vms ;;
1057
1058     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1059   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1060   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1061   *-dec-osf3*                ) opsys=decosf3-1 ;;
1062   *-dec-osf4*                ) opsys=decosf4-0 ;;
1063
1064     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1065   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1066   *-*-ultrix* )         opsys=ultrix4-3 ;;
1067
1068     *-*-aix3.1*  ) opsys=aix3-1 ;;
1069   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1070   *-*-aix3*    ) opsys=aix3-2   ;;
1071   *-*-aix4.0*  ) opsys=aix4     ;;
1072   *-*-aix4.1*  ) opsys=aix4-1   ;;
1073   *-*-aix4*    ) opsys=aix4-2   ;;
1074
1075     *-gnu* )                    opsys=gnu    ;;
1076   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1077   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1078   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1079   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1080   *-*-aos*   )                  opsys=bsd4-3 ;;
1081   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1082   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1083   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1084   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1085   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1086   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1087         if test -z "$NON_GNU_CPP" ; then
1088           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1089             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1090           done
1091         fi
1092         opsys=usg5-4-2 ;;
1093     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1094     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1095 esac
1096
1097 case "$canonical" in
1098
1099     *-*-netbsd* )
1100     case "$canonical" in
1101       i[3-9]86-*-netbsd*) machine=intel386 ;;
1102       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1103                                             machine=hp9000s300 ;;
1104       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1105       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1106     esac
1107   ;;
1108
1109     *-*-openbsd* )
1110     case "${canonical}" in
1111       i386-*-openbsd*)          machine=intel386 ;;
1112       m68k-*-openbsd*)          machine=hp9000s300 ;;
1113       mipsel-*-openbsd*)        machine=pmax ;;
1114      esac
1115    ;;
1116
1117     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1118   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1119
1120     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1121   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1122
1123     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1124
1125     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1126
1127     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1128
1129     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1130
1131     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1132
1133     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1134   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1135   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1136
1137   
1138     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1139
1140     *-convex-bsd* | *-convex-convexos* )
1141     machine=convex opsys=bsd4-3
1142     NON_GNU_CPP="cc -E -P"
1143   ;;
1144
1145     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1146
1147     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1148   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1149   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1150   m88k-dg-dgux*                           ) opsys=dgux     ;;
1151
1152     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1153   m88k-motorola-sysv4* )
1154                     machine=delta88k opsys=usg5-4-2
1155   ;;
1156   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1157
1158     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1159   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1160
1161     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1162
1163     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1164   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1165   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1166
1167       m88k-harris-cxux* )
1168         case "`uname -r`" in
1169        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1170        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1171     esac
1172     NON_GNU_CPP="/lib/cpp"
1173   ;;
1174     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1175     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1176
1177     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1178
1179     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1180
1181     *-hp-hpux* )
1182         case "$canonical" in
1183       m68*  ) machine=hp9000s300 ;;
1184       hppa* ) machine=hp800      ;;
1185     esac
1186
1187     case "$canonical" in
1188       *-hp-hpux7*  )  opsys=hpux   ;;
1189       *-hp-hpux8*  )  opsys=hpux8  ;;
1190       *-hp-hpux9*  )  opsys=hpux9  ;;
1191       *-hp-hpux10* )  opsys=hpux10 ;;
1192       *-hp-hpux11* )  opsys=hpux11 ;;
1193       *            )  opsys=hpux   ;;
1194     esac
1195
1196         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1197    echo "    xemacs will be linked with \"strcat.o\""
1198  fi ;; esac
1199
1200     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1201         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1202     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1203
1204     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1205   ;;
1206
1207     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1208   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1209
1210     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1211   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1212   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1213   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1214   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1215   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1216
1217     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1218   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1219
1220     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1221
1222     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1223
1224     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1225
1226     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1227
1228       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1229
1230     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1231
1232     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1233
1234     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1235
1236     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1237
1238         mips-mips-usg* ) machine=mips4 ;;
1239   mips-mips-riscos4 )
1240     machine=mips4
1241     NON_GNU_CC="cc -systype bsd43"
1242     NON_GNU_CPP="cc -systype bsd43 -E"
1243     case "$canonical" in
1244       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1245       mips-mips-riscos5* ) opsys=riscos5 ;;
1246     esac
1247   ;;
1248   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1249   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1250
1251     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1252
1253     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1254
1255     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1256   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1257
1258     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1259
1260     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1261
1262     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1263
1264     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1265
1266     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1267   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1268
1269     mips-siemens-sysv* | mips-sni-sysv*)
1270     machine=mips-siemens opsys=usg5-4
1271     NON_GNU_CC=/usr/ccs/bin/cc
1272     NON_GNU_CPP=/usr/ccs/lib/cpp
1273   ;;
1274
1275     mips-nec-sysv*)
1276     machine=mips-nec
1277     NON_GNU_CC=/usr/ccs/bin/cc
1278     NON_GNU_CPP=/usr/ccs/lib/cpp
1279   ;;
1280
1281       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1282   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1283     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1284   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1285   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1286   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1287   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1288   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1289   mips-sgi-irix*      ) opsys=irix5-0 ;;
1290
1291     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1292   *-sony-news* ) opsys=newsos5 ;;
1293
1294     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1295
1296     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1297         case "$canonical" in
1298       m68*-sunos1* )             machine=sun1     ;;
1299       m68*-sunos2* )             machine=sun2     ;;
1300       m68* )                     machine=sun3     ;;
1301       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1302       i*86-*-* )                 machine=intel386 ;;
1303       rs6000* )                  machine=rs6000   ;;
1304     esac
1305
1306         case "$canonical" in *-sunos5*)
1307       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1308     esac
1309
1310                     case "$canonical" in
1311       *-sunos4* )
1312         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1313         : ;;
1314       *-solaris2* )
1315         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1316         RANLIB=':' ;;
1317     esac
1318
1319     case "$canonical" in
1320       *-solaris*          )
1321         opsys=sol2
1322         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1323         { test "$extra_verbose" = "yes" && cat << EOF
1324     Defining OS_RELEASE = $os_release
1325 EOF
1326 cat >> confdefs.h <<EOF
1327 #define OS_RELEASE $os_release
1328 EOF
1329 }
1330  ;;
1331
1332             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1333       *-sunos4.0*         ) opsys=sunos4-0      ;;
1334       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1335       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1336       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1337       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1338       *-mach*             ) opsys=mach-bsd4-3   ;;
1339       *                   ) opsys=bsd4-2        ;;
1340     esac
1341
1342     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1343
1344         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1345   ;;
1346
1347     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1348
1349     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1350   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1351
1352     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1353
1354     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1355
1356     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1357       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1358
1359     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1360
1361     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1362
1363     vax-dec-* )
1364     case "$canonical" in
1365       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1366       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1367       *-mach* )                         opsys=mach-bsd4-3 ;;
1368     esac
1369   ;;
1370
1371     ns16k-whitechapel-* ) machine=mg1 ;;
1372
1373     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1374
1375     i[3-9]86-*-* )
1376     machine=intel386
1377     case "$canonical" in
1378       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1379       *-isc2.2* )               opsys=isc2-2 ;;
1380       *-isc4.0* )               opsys=isc4-0 ;;
1381       *-isc4.* )                opsys=isc4-1
1382                                 GCC_TEST_OPTIONS=-posix
1383                                 NON_GCC_TEST_OPTIONS=-Xp
1384                                 ;;
1385       *-isc* )                  opsys=isc3-0 ;;
1386       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1387       *-esix* )                 opsys=esix ;;
1388       *-mach* )                 opsys=mach-bsd4-3 ;;
1389       *-xenix* )                opsys=xenix ;;
1390       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1391       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1392       *-bsdi4* )                opsys=bsdos4 ;;
1393       *-bsdi3* )                opsys=bsdos3 ;;
1394       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1395       *-bsdi2* )                opsys=bsdos2 ;;
1396       *-sco3.2v5* )             opsys=sco5 ;
1397                                                         if test "$dynamic" = "yes" ; then
1398                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1399         else
1400                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1401         fi ;;
1402       *-386bsd* )               opsys=386bsd ;;
1403       *-freebsd* )              opsys=freebsd ;;
1404       *-nextstep* )             opsys=nextstep ;;
1405       *-pc-cygwin* )            opsys=cygwin32 ;;
1406       *-pc-mingw* )             opsys=mingw32 ;
1407                                 test -z "$with_tty" && with_tty="no";;
1408           esac
1409   ;;
1410
1411     m68k-*-linux* ) machine=m68k opsys=linux ;;
1412
1413 esac
1414
1415 if test -z "$machine" -o -z "$opsys"; then
1416   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1417    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1418   ) >&2
1419   exit 1
1420 fi
1421
1422 if test -z "$dynamic"; then
1423   case "$opsys" in
1424     hpux* | sunos4* ) dynamic=no ;;
1425     *) dynamic=yes ;;
1426   esac
1427 fi
1428 if test "$dynamic" = "yes"; then
1429   case "$opsys" in
1430     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1431     decosf* ) ld_call_shared="-call_shared" ;;
1432   esac
1433 else   case "$opsys" in
1434     sol2 )
1435       echo "Static linking is not supported on Solaris 2."
1436       echo "Rerun configure without specifying --dynamic=no."
1437       exit 1 ;;
1438     linux   ) ld_call_shared="-Bstatic" ;;
1439     decosf* ) ld_call_shared="-non_shared" ;;
1440   esac
1441 fi
1442
1443 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1444
1445 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1446 { test "$extra_verbose" = "yes" && cat << EOF
1447     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1448 EOF
1449 cat >> confdefs.h <<EOF
1450 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1451 EOF
1452 }
1453
1454
1455 machfile="m/${machine}.h"
1456 opsysfile="s/${opsys}.h"
1457
1458
1459 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1460 if test "$with_workshop $with_tooltalk" = "yes no"; then
1461   (echo "$progname: Usage error:"
1462 echo " " "--with-workshop requires --with-tooltalk"
1463 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1464 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1465 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1466 fi
1467
1468 if test "$with_workshop" = "yes"; then
1469   { test "$extra_verbose" = "yes" && cat << \EOF
1470     Defining SUNPRO
1471 EOF
1472 cat >> confdefs.h <<\EOF
1473 #define SUNPRO 1
1474 EOF
1475 }
1476
1477   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1478    echo "    xemacs will be linked with \"sunpro.o\""
1479  fi
1480 fi
1481
1482 if test "$with_clash_detection" = "yes"; then
1483   { test "$extra_verbose" = "yes" && cat << \EOF
1484     Defining CLASH_DETECTION
1485 EOF
1486 cat >> confdefs.h <<\EOF
1487 #define CLASH_DETECTION 1
1488 EOF
1489 }
1490
1491   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1492    echo "    xemacs will be linked with \"filelock.o\""
1493  fi
1494 fi
1495
1496 test -n "$compiler" && CC="$compiler"
1497 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1498 fi
1499
1500 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1501 if test "${CFLAGS-unset}" != unset
1502   then cflags_specified=yes;
1503   else cflags_specified=no;
1504 fi
1505
1506 xe_save_CFLAGS="$CFLAGS"
1507
1508 # Extract the first word of "gcc", so it can be a program name with args.
1509 set dummy gcc; ac_word=$2
1510 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1511 echo "configure:1512: checking for $ac_word" >&5
1512
1513 if test -n "$CC"; then
1514   ac_cv_prog_CC="$CC" # Let the user override the test.
1515 else
1516   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1517   ac_dummy="$PATH"
1518   for ac_dir in $ac_dummy; do
1519     test -z "$ac_dir" && ac_dir=.
1520     if test -f $ac_dir/$ac_word; then
1521       ac_cv_prog_CC="gcc"
1522       break
1523     fi
1524   done
1525   IFS="$ac_save_ifs"
1526 fi
1527 CC="$ac_cv_prog_CC"
1528 if test -n "$CC"; then
1529   echo "$ac_t""$CC" 1>&6
1530 else
1531   echo "$ac_t""no" 1>&6
1532 fi
1533
1534 if test -z "$CC"; then
1535   # Extract the first word of "cc", so it can be a program name with args.
1536 set dummy cc; ac_word=$2
1537 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1538 echo "configure:1539: checking for $ac_word" >&5
1539
1540 if test -n "$CC"; then
1541   ac_cv_prog_CC="$CC" # Let the user override the test.
1542 else
1543   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1544   ac_prog_rejected=no
1545   ac_dummy="$PATH"
1546   for ac_dir in $ac_dummy; do
1547     test -z "$ac_dir" && ac_dir=.
1548     if test -f $ac_dir/$ac_word; then
1549       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1550         ac_prog_rejected=yes
1551         continue
1552       fi
1553       ac_cv_prog_CC="cc"
1554       break
1555     fi
1556   done
1557   IFS="$ac_save_ifs"
1558 if test $ac_prog_rejected = yes; then
1559   # We found a bogon in the path, so make sure we never use it.
1560   set dummy $ac_cv_prog_CC
1561   shift
1562   if test $# -gt 0; then
1563     # We chose a different compiler from the bogus one.
1564     # However, it has the same basename, so the bogon will be chosen
1565     # first if we set CC to just the basename; use the full file name.
1566     shift
1567     set dummy "$ac_dir/$ac_word" "$@"
1568     shift
1569     ac_cv_prog_CC="$@"
1570   fi
1571 fi
1572 fi
1573 CC="$ac_cv_prog_CC"
1574 if test -n "$CC"; then
1575   echo "$ac_t""$CC" 1>&6
1576 else
1577   echo "$ac_t""no" 1>&6
1578 fi
1579
1580   if test -z "$CC"; then
1581     case "`uname -s`" in
1582     *win32* | *WIN32*)
1583       # Extract the first word of "cl", so it can be a program name with args.
1584 set dummy cl; ac_word=$2
1585 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1586 echo "configure:1587: checking for $ac_word" >&5
1587
1588 if test -n "$CC"; then
1589   ac_cv_prog_CC="$CC" # Let the user override the test.
1590 else
1591   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1592   ac_dummy="$PATH"
1593   for ac_dir in $ac_dummy; do
1594     test -z "$ac_dir" && ac_dir=.
1595     if test -f $ac_dir/$ac_word; then
1596       ac_cv_prog_CC="cl"
1597       break
1598     fi
1599   done
1600   IFS="$ac_save_ifs"
1601 fi
1602 CC="$ac_cv_prog_CC"
1603 if test -n "$CC"; then
1604   echo "$ac_t""$CC" 1>&6
1605 else
1606   echo "$ac_t""no" 1>&6
1607 fi
1608  ;;
1609     esac
1610   fi
1611   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1612 fi
1613
1614 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1615 echo "configure:1616: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1616
1617 ac_ext=c
1618 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1619 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1620 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1621 ac_cpp='$CPP '"$xe_cppflags"
1622 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1623 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1624 cross_compiling=no
1625
1626 cat > conftest.$ac_ext << EOF
1627
1628 #line 1629 "configure"
1629 #include "confdefs.h"
1630
1631 main(){return(0);}
1632 EOF
1633 if { (eval echo configure:1634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1634   ac_cv_prog_cc_works=yes
1635   # If we can't run a trivial program, we are probably using a cross compiler.
1636   if (./conftest; exit) 2>/dev/null; then
1637     ac_cv_prog_cc_cross=no
1638   else
1639     ac_cv_prog_cc_cross=yes
1640   fi
1641 else
1642   echo "configure: failed program was:" >&5
1643   cat conftest.$ac_ext >&5
1644   ac_cv_prog_cc_works=no
1645 fi
1646 rm -fr conftest*
1647 ac_ext=c
1648 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1649 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1650 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1651 ac_cpp='$CPP '"$xe_cppflags"
1652 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1653 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1654 cross_compiling=no
1655
1656 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1657 if test $ac_cv_prog_cc_works = no; then
1658   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1659 fi
1660 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1661 echo "configure:1662: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1662 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1663 cross_compiling=$ac_cv_prog_cc_cross
1664
1665 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1666 echo "configure:1667: checking whether we are using GNU C" >&5
1667
1668 cat > conftest.c <<EOF
1669 #ifdef __GNUC__
1670   yes;
1671 #endif
1672 EOF
1673 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1674   ac_cv_prog_gcc=yes
1675 else
1676   ac_cv_prog_gcc=no
1677 fi
1678
1679 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1680
1681 if test $ac_cv_prog_gcc = yes; then
1682   GCC=yes
1683 else
1684   GCC=
1685 fi
1686
1687 ac_test_CFLAGS="${CFLAGS+set}"
1688 ac_save_CFLAGS="$CFLAGS"
1689 CFLAGS=
1690 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1691 echo "configure:1692: checking whether ${CC-cc} accepts -g" >&5
1692
1693 echo 'void f(){}' > conftest.c
1694 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   ac_cv_prog_cc_g=no
1698 fi
1699 rm -f conftest*
1700
1701
1702 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1703 if test "$ac_test_CFLAGS" = set; then
1704   CFLAGS="$ac_save_CFLAGS"
1705 elif test $ac_cv_prog_cc_g = yes; then
1706   if test "$GCC" = yes; then
1707     CFLAGS="-g -O2"
1708   else
1709     CFLAGS="-g"
1710   fi
1711 else
1712   if test "$GCC" = yes; then
1713     CFLAGS="-O2"
1714   else
1715     CFLAGS=
1716   fi
1717 fi
1718  
1719 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1720   CC=${NON_GNU_CC-cc}
1721   # Extract the first word of "gcc", so it can be a program name with args.
1722 set dummy gcc; ac_word=$2
1723 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1724 echo "configure:1725: checking for $ac_word" >&5
1725
1726 if test -n "$CC"; then
1727   ac_cv_prog_CC="$CC" # Let the user override the test.
1728 else
1729   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1730   ac_dummy="$PATH"
1731   for ac_dir in $ac_dummy; do
1732     test -z "$ac_dir" && ac_dir=.
1733     if test -f $ac_dir/$ac_word; then
1734       ac_cv_prog_CC="gcc"
1735       break
1736     fi
1737   done
1738   IFS="$ac_save_ifs"
1739 fi
1740 CC="$ac_cv_prog_CC"
1741 if test -n "$CC"; then
1742   echo "$ac_t""$CC" 1>&6
1743 else
1744   echo "$ac_t""no" 1>&6
1745 fi
1746
1747 if test -z "$CC"; then
1748   # Extract the first word of "cc", so it can be a program name with args.
1749 set dummy cc; ac_word=$2
1750 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1751 echo "configure:1752: checking for $ac_word" >&5
1752
1753 if test -n "$CC"; then
1754   ac_cv_prog_CC="$CC" # Let the user override the test.
1755 else
1756   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1757   ac_prog_rejected=no
1758   ac_dummy="$PATH"
1759   for ac_dir in $ac_dummy; do
1760     test -z "$ac_dir" && ac_dir=.
1761     if test -f $ac_dir/$ac_word; then
1762       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1763         ac_prog_rejected=yes
1764         continue
1765       fi
1766       ac_cv_prog_CC="cc"
1767       break
1768     fi
1769   done
1770   IFS="$ac_save_ifs"
1771 if test $ac_prog_rejected = yes; then
1772   # We found a bogon in the path, so make sure we never use it.
1773   set dummy $ac_cv_prog_CC
1774   shift
1775   if test $# -gt 0; then
1776     # We chose a different compiler from the bogus one.
1777     # However, it has the same basename, so the bogon will be chosen
1778     # first if we set CC to just the basename; use the full file name.
1779     shift
1780     set dummy "$ac_dir/$ac_word" "$@"
1781     shift
1782     ac_cv_prog_CC="$@"
1783   fi
1784 fi
1785 fi
1786 CC="$ac_cv_prog_CC"
1787 if test -n "$CC"; then
1788   echo "$ac_t""$CC" 1>&6
1789 else
1790   echo "$ac_t""no" 1>&6
1791 fi
1792
1793   if test -z "$CC"; then
1794     case "`uname -s`" in
1795     *win32* | *WIN32*)
1796       # Extract the first word of "cl", so it can be a program name with args.
1797 set dummy cl; ac_word=$2
1798 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1799 echo "configure:1800: checking for $ac_word" >&5
1800
1801 if test -n "$CC"; then
1802   ac_cv_prog_CC="$CC" # Let the user override the test.
1803 else
1804   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1805   ac_dummy="$PATH"
1806   for ac_dir in $ac_dummy; do
1807     test -z "$ac_dir" && ac_dir=.
1808     if test -f $ac_dir/$ac_word; then
1809       ac_cv_prog_CC="cl"
1810       break
1811     fi
1812   done
1813   IFS="$ac_save_ifs"
1814 fi
1815 CC="$ac_cv_prog_CC"
1816 if test -n "$CC"; then
1817   echo "$ac_t""$CC" 1>&6
1818 else
1819   echo "$ac_t""no" 1>&6
1820 fi
1821  ;;
1822     esac
1823   fi
1824   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1825 fi
1826
1827 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1828 echo "configure:1829: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1829
1830 ac_ext=c
1831 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1832 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1833 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1834 ac_cpp='$CPP '"$xe_cppflags"
1835 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1836 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1837 cross_compiling=no
1838
1839 cat > conftest.$ac_ext << EOF
1840
1841 #line 1842 "configure"
1842 #include "confdefs.h"
1843
1844 main(){return(0);}
1845 EOF
1846 if { (eval echo configure:1847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1847   ac_cv_prog_cc_works=yes
1848   # If we can't run a trivial program, we are probably using a cross compiler.
1849   if (./conftest; exit) 2>/dev/null; then
1850     ac_cv_prog_cc_cross=no
1851   else
1852     ac_cv_prog_cc_cross=yes
1853   fi
1854 else
1855   echo "configure: failed program was:" >&5
1856   cat conftest.$ac_ext >&5
1857   ac_cv_prog_cc_works=no
1858 fi
1859 rm -fr conftest*
1860 ac_ext=c
1861 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1862 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1863 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1864 ac_cpp='$CPP '"$xe_cppflags"
1865 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1866 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1867 cross_compiling=no
1868
1869 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1870 if test $ac_cv_prog_cc_works = no; then
1871   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1872 fi
1873 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1874 echo "configure:1875: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1875 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1876 cross_compiling=$ac_cv_prog_cc_cross
1877
1878 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1879 echo "configure:1880: checking whether we are using GNU C" >&5
1880
1881 cat > conftest.c <<EOF
1882 #ifdef __GNUC__
1883   yes;
1884 #endif
1885 EOF
1886 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1887   ac_cv_prog_gcc=yes
1888 else
1889   ac_cv_prog_gcc=no
1890 fi
1891
1892 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1893
1894 if test $ac_cv_prog_gcc = yes; then
1895   GCC=yes
1896 else
1897   GCC=
1898 fi
1899
1900 ac_test_CFLAGS="${CFLAGS+set}"
1901 ac_save_CFLAGS="$CFLAGS"
1902 CFLAGS=
1903 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1904 echo "configure:1905: checking whether ${CC-cc} accepts -g" >&5
1905
1906 echo 'void f(){}' > conftest.c
1907 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1908   ac_cv_prog_cc_g=yes
1909 else
1910   ac_cv_prog_cc_g=no
1911 fi
1912 rm -f conftest*
1913
1914
1915 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1916 if test "$ac_test_CFLAGS" = set; then
1917   CFLAGS="$ac_save_CFLAGS"
1918 elif test $ac_cv_prog_cc_g = yes; then
1919   if test "$GCC" = yes; then
1920     CFLAGS="-g -O2"
1921   else
1922     CFLAGS="-g"
1923   fi
1924 else
1925   if test "$GCC" = yes; then
1926     CFLAGS="-O2"
1927   else
1928     CFLAGS=
1929   fi
1930 fi
1931
1932 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1933   CC=gcc
1934   # Extract the first word of "gcc", so it can be a program name with args.
1935 set dummy gcc; ac_word=$2
1936 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1937 echo "configure:1938: checking for $ac_word" >&5
1938
1939 if test -n "$CC"; then
1940   ac_cv_prog_CC="$CC" # Let the user override the test.
1941 else
1942   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1943   ac_dummy="$PATH"
1944   for ac_dir in $ac_dummy; do
1945     test -z "$ac_dir" && ac_dir=.
1946     if test -f $ac_dir/$ac_word; then
1947       ac_cv_prog_CC="gcc"
1948       break
1949     fi
1950   done
1951   IFS="$ac_save_ifs"
1952 fi
1953 CC="$ac_cv_prog_CC"
1954 if test -n "$CC"; then
1955   echo "$ac_t""$CC" 1>&6
1956 else
1957   echo "$ac_t""no" 1>&6
1958 fi
1959
1960 if test -z "$CC"; then
1961   # Extract the first word of "cc", so it can be a program name with args.
1962 set dummy cc; ac_word=$2
1963 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1964 echo "configure:1965: checking for $ac_word" >&5
1965
1966 if test -n "$CC"; then
1967   ac_cv_prog_CC="$CC" # Let the user override the test.
1968 else
1969   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1970   ac_prog_rejected=no
1971   ac_dummy="$PATH"
1972   for ac_dir in $ac_dummy; do
1973     test -z "$ac_dir" && ac_dir=.
1974     if test -f $ac_dir/$ac_word; then
1975       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1976         ac_prog_rejected=yes
1977         continue
1978       fi
1979       ac_cv_prog_CC="cc"
1980       break
1981     fi
1982   done
1983   IFS="$ac_save_ifs"
1984 if test $ac_prog_rejected = yes; then
1985   # We found a bogon in the path, so make sure we never use it.
1986   set dummy $ac_cv_prog_CC
1987   shift
1988   if test $# -gt 0; then
1989     # We chose a different compiler from the bogus one.
1990     # However, it has the same basename, so the bogon will be chosen
1991     # first if we set CC to just the basename; use the full file name.
1992     shift
1993     set dummy "$ac_dir/$ac_word" "$@"
1994     shift
1995     ac_cv_prog_CC="$@"
1996   fi
1997 fi
1998 fi
1999 CC="$ac_cv_prog_CC"
2000 if test -n "$CC"; then
2001   echo "$ac_t""$CC" 1>&6
2002 else
2003   echo "$ac_t""no" 1>&6
2004 fi
2005
2006   if test -z "$CC"; then
2007     case "`uname -s`" in
2008     *win32* | *WIN32*)
2009       # Extract the first word of "cl", so it can be a program name with args.
2010 set dummy cl; ac_word=$2
2011 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2012 echo "configure:2013: checking for $ac_word" >&5
2013
2014 if test -n "$CC"; then
2015   ac_cv_prog_CC="$CC" # Let the user override the test.
2016 else
2017   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2018   ac_dummy="$PATH"
2019   for ac_dir in $ac_dummy; do
2020     test -z "$ac_dir" && ac_dir=.
2021     if test -f $ac_dir/$ac_word; then
2022       ac_cv_prog_CC="cl"
2023       break
2024     fi
2025   done
2026   IFS="$ac_save_ifs"
2027 fi
2028 CC="$ac_cv_prog_CC"
2029 if test -n "$CC"; then
2030   echo "$ac_t""$CC" 1>&6
2031 else
2032   echo "$ac_t""no" 1>&6
2033 fi
2034  ;;
2035     esac
2036   fi
2037   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2038 fi
2039
2040 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2041 echo "configure:2042: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2042
2043 ac_ext=c
2044 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2045 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2046 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2047 ac_cpp='$CPP '"$xe_cppflags"
2048 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2049 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2050 cross_compiling=no
2051
2052 cat > conftest.$ac_ext << EOF
2053
2054 #line 2055 "configure"
2055 #include "confdefs.h"
2056
2057 main(){return(0);}
2058 EOF
2059 if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2060   ac_cv_prog_cc_works=yes
2061   # If we can't run a trivial program, we are probably using a cross compiler.
2062   if (./conftest; exit) 2>/dev/null; then
2063     ac_cv_prog_cc_cross=no
2064   else
2065     ac_cv_prog_cc_cross=yes
2066   fi
2067 else
2068   echo "configure: failed program was:" >&5
2069   cat conftest.$ac_ext >&5
2070   ac_cv_prog_cc_works=no
2071 fi
2072 rm -fr conftest*
2073 ac_ext=c
2074 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2075 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2076 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2077 ac_cpp='$CPP '"$xe_cppflags"
2078 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2079 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2080 cross_compiling=no
2081
2082 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2083 if test $ac_cv_prog_cc_works = no; then
2084   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2085 fi
2086 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2087 echo "configure:2088: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2088 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2089 cross_compiling=$ac_cv_prog_cc_cross
2090
2091 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2092 echo "configure:2093: checking whether we are using GNU C" >&5
2093
2094 cat > conftest.c <<EOF
2095 #ifdef __GNUC__
2096   yes;
2097 #endif
2098 EOF
2099 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2100   ac_cv_prog_gcc=yes
2101 else
2102   ac_cv_prog_gcc=no
2103 fi
2104
2105 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2106
2107 if test $ac_cv_prog_gcc = yes; then
2108   GCC=yes
2109 else
2110   GCC=
2111 fi
2112
2113 ac_test_CFLAGS="${CFLAGS+set}"
2114 ac_save_CFLAGS="$CFLAGS"
2115 CFLAGS=
2116 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2117 echo "configure:2118: checking whether ${CC-cc} accepts -g" >&5
2118
2119 echo 'void f(){}' > conftest.c
2120 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2121   ac_cv_prog_cc_g=yes
2122 else
2123   ac_cv_prog_cc_g=no
2124 fi
2125 rm -f conftest*
2126
2127
2128 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2129 if test "$ac_test_CFLAGS" = set; then
2130   CFLAGS="$ac_save_CFLAGS"
2131 elif test $ac_cv_prog_cc_g = yes; then
2132   if test "$GCC" = yes; then
2133     CFLAGS="-g -O2"
2134   else
2135     CFLAGS="-g"
2136   fi
2137 else
2138   if test "$GCC" = yes; then
2139     CFLAGS="-O2"
2140   else
2141     CFLAGS=
2142   fi
2143 fi
2144
2145 fi
2146 CFLAGS="$xe_save_CFLAGS"
2147
2148
2149 test -n "$CPP" -a -d "$CPP" && CPP=
2150
2151 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2152
2153 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2154 echo "configure:2155: checking how to run the C preprocessor" >&5
2155 # On Suns, sometimes $CPP names a directory.
2156 if test -n "$CPP" && test -d "$CPP"; then
2157   CPP=
2158 fi
2159 if test -z "$CPP"; then
2160
2161   # This must be in double quotes, not single quotes, because CPP may get
2162   # substituted into the Makefile and "${CC-cc}" will confuse make.
2163   CPP="${CC-cc} -E"
2164   # On the NeXT, cc -E runs the code through the compiler's parser,
2165   # not just through cpp.
2166   cat > conftest.$ac_ext <<EOF
2167 #line 2168 "configure"
2168 #include "confdefs.h"
2169 #include <assert.h>
2170 Syntax Error
2171 EOF
2172 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2173 { (eval echo configure:2174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2174 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2175 if test -z "$ac_err"; then
2176   :
2177 else
2178   echo "$ac_err" >&5
2179   echo "configure: failed program was:" >&5
2180   cat conftest.$ac_ext >&5
2181   rm -rf conftest*
2182   CPP="${CC-cc} -E -traditional-cpp"
2183   cat > conftest.$ac_ext <<EOF
2184 #line 2185 "configure"
2185 #include "confdefs.h"
2186 #include <assert.h>
2187 Syntax Error
2188 EOF
2189 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2190 { (eval echo configure:2191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2191 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2192 if test -z "$ac_err"; then
2193   :
2194 else
2195   echo "$ac_err" >&5
2196   echo "configure: failed program was:" >&5
2197   cat conftest.$ac_ext >&5
2198   rm -rf conftest*
2199   CPP="${CC-cc} -nologo -E"
2200   cat > conftest.$ac_ext <<EOF
2201 #line 2202 "configure"
2202 #include "confdefs.h"
2203 #include <assert.h>
2204 Syntax Error
2205 EOF
2206 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2207 { (eval echo configure:2208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2208 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2209 if test -z "$ac_err"; then
2210   :
2211 else
2212   echo "$ac_err" >&5
2213   echo "configure: failed program was:" >&5
2214   cat conftest.$ac_ext >&5
2215   rm -rf conftest*
2216   CPP=/lib/cpp
2217 fi
2218 rm -f conftest*
2219 fi
2220 rm -f conftest*
2221 fi
2222 rm -f conftest*
2223   ac_cv_prog_CPP="$CPP"
2224   CPP="$ac_cv_prog_CPP"
2225 else
2226   ac_cv_prog_CPP="$CPP"
2227 fi
2228 echo "$ac_t""$CPP" 1>&6
2229
2230
2231 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2232 echo "configure:2233: checking for AIX" >&5
2233 cat > conftest.$ac_ext <<EOF
2234 #line 2235 "configure"
2235 #include "confdefs.h"
2236 #ifdef _AIX
2237   yes
2238 #endif
2239
2240 EOF
2241 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2242   egrep "yes" >/dev/null 2>&1; then
2243   rm -rf conftest*
2244   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2245     Defining _ALL_SOURCE
2246 EOF
2247 cat >> confdefs.h <<\EOF
2248 #define _ALL_SOURCE 1
2249 EOF
2250 }
2251
2252 else
2253   rm -rf conftest*
2254   echo "$ac_t""no" 1>&6
2255 fi
2256 rm -f conftest*
2257
2258
2259
2260 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2261 echo "configure:2262: checking for GNU libc" >&5
2262 cat > conftest.$ac_ext <<EOF
2263 #line 2264 "configure"
2264 #include "confdefs.h"
2265 #include <features.h>
2266 int main() {
2267
2268 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2269 #error Not a GNU libc system :-(
2270 ******* ======= ******** &&&&&&&&
2271 #endif
2272
2273 ; return 0; }
2274 EOF
2275 if { (eval echo configure:2276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2276   rm -rf conftest*
2277   have_glibc=yes
2278 else
2279   echo "configure: failed program was:" >&5
2280   cat conftest.$ac_ext >&5
2281   rm -rf conftest*
2282   have_glibc=no
2283 fi
2284 rm -f conftest*
2285 echo "$ac_t""$have_glibc" 1>&6
2286 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2287     Defining _GNU_SOURCE
2288 EOF
2289 cat >> confdefs.h <<\EOF
2290 #define _GNU_SOURCE 1
2291 EOF
2292 }
2293
2294
2295
2296 cat > conftest.$ac_ext <<EOF
2297 #line 2298 "configure"
2298 #include "confdefs.h"
2299 int main () {
2300 #if defined __SUNPRO_C
2301 return 11;
2302 #elif defined __DECC
2303 return 12;
2304 #else
2305 return 0;
2306 #endif
2307 }
2308 EOF
2309 if { (eval echo configure:2310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2310 then
2311   :
2312 else
2313   conftest_rc="$?"
2314   echo "configure: failed program was:" >&5
2315   cat conftest.$ac_ext >&5
2316   rm -fr conftest*
2317   case "$conftest_rc" in
2318   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2319   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2320 esac
2321 fi
2322 rm -fr conftest*
2323
2324
2325
2326
2327 echo "Extracting information from the machine- and system-dependent headers..."
2328
2329 tempcname="conftest.c"
2330
2331
2332
2333 cat > $tempcname <<EOF
2334 #define NOT_C_CODE
2335 #define C_SWITCH_SITE
2336 #define C_SWITCH_X_SITE
2337 #define LD_SWITCH_SITE
2338 #define LD_SWITCH_X_SITE
2339 #define LD_SWITCH_X_SITE_AUX
2340 #define OS_RELEASE $os_release
2341 #include "$srcdir/src/$opsysfile"
2342 #include "$srcdir/src/$machfile"
2343
2344 #ifndef LIBS_MACHINE
2345 #define LIBS_MACHINE
2346 #endif
2347 configure___ libs_machine=LIBS_MACHINE
2348
2349 #ifndef LIBS_SYSTEM
2350 #define LIBS_SYSTEM
2351 #endif
2352 configure___ libs_system=LIBS_SYSTEM
2353
2354 #ifndef LIBS_TERMCAP
2355 #define LIBS_TERMCAP
2356 #endif
2357 configure___ libs_termcap=LIBS_TERMCAP
2358
2359 #ifndef LIB_STANDARD
2360 #define LIB_STANDARD
2361 #endif
2362 configure___ libs_standard=LIB_STANDARD
2363
2364
2365 #ifndef OBJECTS_MACHINE
2366 #define OBJECTS_MACHINE
2367 #endif
2368 configure___ objects_machine=OBJECTS_MACHINE
2369
2370 #ifndef OBJECTS_SYSTEM
2371 #define OBJECTS_SYSTEM
2372 #endif
2373 configure___ objects_system=OBJECTS_SYSTEM
2374
2375
2376 #ifndef C_SWITCH_MACHINE
2377 #define C_SWITCH_MACHINE
2378 #endif
2379 configure___ c_switch_machine=C_SWITCH_MACHINE
2380
2381 #ifndef C_SWITCH_SYSTEM
2382 #define C_SWITCH_SYSTEM
2383 #endif
2384 configure___ c_switch_system=C_SWITCH_SYSTEM
2385
2386
2387 #ifndef LD_SWITCH_MACHINE
2388 #define LD_SWITCH_MACHINE
2389 #endif
2390 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2391
2392 #ifndef LD_SWITCH_SYSTEM
2393 #define LD_SWITCH_SYSTEM
2394 #endif
2395 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2396
2397
2398 #ifndef UNEXEC
2399 #define UNEXEC "unexec.o"
2400 #endif
2401 configure___ unexec=UNEXEC
2402
2403
2404 #ifndef LD_SWITCH_SHARED
2405 #define LD_SWITCH_SHARED "-c"
2406 #endif
2407 configure___ ld_switch_shared=LD_SWITCH_SHARED
2408
2409
2410 #ifdef ORDINARY_LINK
2411 #define LD "\$(CC) \$(CFLAGS)"
2412 #else /* no ORDINARY LINK */
2413 #ifdef COFF_ENCAPSULATE
2414 #define LD "\$(CC) -nostdlib"
2415 #else /* not COFF_ENCAPSULATE */
2416 #ifdef LINKER
2417 #define LD LINKER
2418 #else /* ! defined (LINKER) */
2419 #define LD "ld"
2420 #endif /* ! defined (LINKER) */
2421 #endif /* ! defined (COFF_ENCAPSULATE) */
2422 #endif /* not ORDINARY_LINK */
2423 configure___ ld=LD
2424
2425 #ifndef LIB_GCC
2426 #define LIB_GCC
2427 #endif
2428 configure___ lib_gcc=LIB_GCC
2429
2430 #ifndef LD_TEXT_START_ADDR
2431 #define LD_TEXT_START_ADDR
2432 #endif
2433 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2434
2435
2436 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2437 #ifdef NO_REMAP
2438 #ifdef COFF_ENCAPSULATE
2439 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2440 #else /* ! defined (COFF_ENCAPSULATE) */
2441 #define START_FILES "pre-crt0.o /lib/crt0.o"
2442 #endif /* ! defined (COFF_ENCAPSULATE) */
2443 #else /* ! defined (NO_REMAP) */
2444 #define START_FILES "ecrt0.o"
2445 #endif /* ! defined (NO_REMAP) */
2446 #endif /* no ORDINARY_LINK */
2447 #ifndef START_FILES
2448 #define START_FILES
2449 #endif
2450 configure___ start_files=START_FILES
2451
2452 #ifdef ORDINARY_LINK
2453 configure___ ordinary_link=yes
2454 #else
2455 configure___ ordinary_link=no
2456 #endif
2457
2458 #ifdef SYSTEM_MALLOC
2459 configure___ system_malloc=yes
2460 #else
2461 configure___ system_malloc=no
2462 #endif
2463
2464 #ifdef TERMINFO
2465 configure___ have_terminfo=yes
2466 #else
2467 configure___ have_terminfo=no
2468 #endif
2469
2470 #ifdef MAIL_USE_FLOCK
2471 configure___ mail_use_flock=yes
2472 #else
2473 configure___ mail_use_flock=no
2474 #endif
2475
2476 #ifdef MAIL_USE_LOCKF
2477 configure___ mail_use_lockf=yes
2478 #else
2479 configure___ mail_use_lockf=no
2480 #endif
2481
2482 #ifdef HAVE_WIN32_PROCESSES
2483 configure___ win32_processes=yes
2484 #else
2485 configure___ win32_processes=no
2486 #endif
2487
2488 EOF
2489
2490 CPP=`eval "echo $CPP $CPPFLAGS"`
2491 eval `$CPP -Isrc $tempcname \
2492         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2493
2494 rm $tempcname
2495
2496 test "$extra_verbose" = "yes" && \
2497   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 ""
2498
2499 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2500
2501 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2502
2503 if test "$cflags_specified" = "no"; then
2504       if   test "$GCC" = "yes"; then
2505     CFLAGS="-g -O3 -Wall -Wno-switch"
2506               elif test "$__SUNPRO_C" = "yes"; then
2507     case "$opsys" in
2508       sol2    ) CFLAGS="-v -xO4" ;;
2509       sunos4* ) CFLAGS="-xO2";;
2510     esac
2511   elif test "$__DECC" = "yes"; then
2512     CFLAGS="-O3"
2513   elif test "$CC" = "xlc"; then
2514     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2515     else
2516     CFLAGS="-O" ;  fi
2517 fi
2518
2519
2520 if test "$GCC" = "yes"; then
2521   set x $ld_switch_system; shift; ld_switch_system=""
2522   while test -n "$1"; do
2523     case $1 in
2524       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2525       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2526       -Xlinker* ) ;;
2527       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2528     esac
2529     shift
2530   done
2531 fi
2532
2533 if test "$GCC" = "yes"; then
2534   set x $ld_switch_machine; shift; ld_switch_machine=""
2535   while test -n "$1"; do
2536     case $1 in
2537       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2538       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2539       -Xlinker* ) ;;
2540       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2541     esac
2542     shift
2543   done
2544 fi
2545
2546 if test "$GCC" = "yes"; then
2547   set x $LDFLAGS; shift; LDFLAGS=""
2548   while test -n "$1"; do
2549     case $1 in
2550       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2551       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2552       -Xlinker* ) ;;
2553       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2554     esac
2555     shift
2556   done
2557 fi
2558
2559 if test "$GCC" = "yes"; then
2560   set x $ld_call_shared; shift; ld_call_shared=""
2561   while test -n "$1"; do
2562     case $1 in
2563       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2564       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2565       -Xlinker* ) ;;
2566       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2567     esac
2568     shift
2569   done
2570 fi
2571
2572 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2573    echo "    xemacs will be linked with \"$objects_machine\""
2574  fi
2575 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2576    echo "    xemacs will be linked with \"$objects_system\""
2577  fi
2578 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2579    echo "    xemacs will be linked with \"$unexec\""
2580  fi
2581
2582 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2583 echo "configure:2584: checking for dynodump" >&5
2584 if test "$unexec" != "unexsol2.o"; then
2585   echo "$ac_t""no" 1>&6
2586 else
2587   echo "$ac_t""yes" 1>&6
2588   { test "$extra_verbose" = "yes" && cat << \EOF
2589     Defining DYNODUMP
2590 EOF
2591 cat >> confdefs.h <<\EOF
2592 #define DYNODUMP 1
2593 EOF
2594 }
2595
2596   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2597   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2598   case "$machine" in
2599     sparc   ) dynodump_arch=sparc ;;
2600     *86*    ) dynodump_arch=i386  ;;
2601     powerpc ) dynodump_arch=ppc   ;;
2602   esac
2603     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
2604 fi
2605
2606
2607 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2608
2609 if test "$unexec" = "unexaix.o"; then
2610   if   test "$dynamic" = "no"; then
2611   start_flags="-Wl,-bnso,-bnodelcsect"
2612   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2613   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2614     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2615   done
2616   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2617     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2618   done
2619   
2620 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2621 echo "configure:2622: checking for terminateAndUnload in -lC" >&5
2622 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2623
2624 xe_check_libs=" -lC "
2625 cat > conftest.$ac_ext <<EOF
2626 #line 2627 "configure"
2627 #include "confdefs.h"
2628 /* Override any gcc2 internal prototype to avoid an error.  */
2629 /* We use char because int might match the return type of a gcc2
2630     builtin and then its argument prototype would still apply.  */
2631 char terminateAndUnload();
2632
2633 int main() {
2634 terminateAndUnload()
2635 ; return 0; }
2636 EOF
2637 if { (eval echo configure:2638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2638   rm -rf conftest*
2639   eval "ac_cv_lib_$ac_lib_var=yes"
2640 else
2641   echo "configure: failed program was:" >&5
2642   cat conftest.$ac_ext >&5
2643   rm -rf conftest*
2644   eval "ac_cv_lib_$ac_lib_var=no"
2645 fi
2646 rm -f conftest*
2647 xe_check_libs=""
2648
2649 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2650   echo "$ac_t""yes" 1>&6
2651   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2652 else
2653   echo "$ac_t""no" 1>&6
2654 fi
2655
2656
2657   fi
2658 elif test -n "$ld_text_start_addr"; then
2659   start_flags="-T $ld_text_start_addr -e __start"
2660 fi
2661
2662
2663
2664
2665 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2666  test -z "$linker" &&  linker='$(CC) -nostdlib'
2667  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2668 fi
2669 test "$GCC" != "yes" && lib_gcc=
2670
2671
2672
2673
2674
2675 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2676 if test -n "$site_libraries"; then
2677   for arg in $site_libraries; do
2678     case "$arg" in
2679      -* ) ;;
2680      * ) test -d "$arg" || \
2681            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2682        arg="-L${arg}" ;;
2683     esac
2684     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2685   done
2686 fi
2687
2688 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2689 if test -n "$site_includes"; then
2690   for arg in $site_includes; do
2691     case "$arg" in
2692       -* ) ;;
2693       * ) test -d "$arg" || \
2694            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2695       arg="-I${arg}" ;;
2696     esac
2697     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2698   done
2699 fi
2700
2701 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2702 if test -n "$site_prefixes"; then
2703   for dir in $site_prefixes; do
2704     lib_dir="${dir}/lib"
2705     inc_dir="${dir}/include"
2706     if test ! -d "$dir"; then
2707       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2708     elif test ! -d "$lib_dir"; then
2709       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2710     else
2711       if test -d "$inc_dir"; then
2712         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
2713       fi
2714       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
2715     fi
2716   done
2717 fi
2718
2719
2720 for dir in "/usr/ccs/lib"; do
2721   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
2722 done
2723
2724 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2725 if test -n "$site_runtime_libraries"; then
2726   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2727   export LD_RUN_PATH
2728 fi
2729
2730
2731 if   test "$dynamic" = "no"; then add_runtime_path=no
2732 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2733 else case "$opsys" in
2734        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2735        * ) add_runtime_path=no ;;
2736      esac
2737 fi
2738
2739 if test "$add_runtime_path" = "yes"; then
2740       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2741 echo "configure:2742: checking "for runtime libraries flag"" >&5
2742   case "$opsys" in
2743     sol2 ) dash_r="-R" ;;
2744     decosf* | linux* | irix*) dash_r="-rpath " ;;
2745     *)
2746       dash_r=""
2747       for try_dash_r in "-R" "-R " "-rpath "; do
2748         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2749         
2750 if test "$GCC" = "yes"; then
2751   set x $xe_check_libs; shift; xe_check_libs=""
2752   while test -n "$1"; do
2753     case $1 in
2754       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2755       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2756       -Xlinker* ) ;;
2757       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2758     esac
2759     shift
2760   done
2761 fi
2762         cat > conftest.$ac_ext <<EOF
2763 #line 2764 "configure"
2764 #include "confdefs.h"
2765
2766 int main() {
2767
2768 ; return 0; }
2769 EOF
2770 if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2771   rm -rf conftest*
2772   dash_r="$try_dash_r"
2773 else
2774   echo "configure: failed program was:" >&5
2775   cat conftest.$ac_ext >&5
2776 fi
2777 rm -f conftest*
2778         xe_check_libs=""
2779         test -n "$dash_r" && break
2780       done ;;
2781   esac
2782   if test -n "$dash_r";
2783     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2784     else echo "$ac_t""NONE" 1>&6
2785   fi
2786 fi
2787
2788 xe_add_unique_runpath_dir='
2789   xe_add_p=yes
2790   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2791   done
2792   if test "$xe_add_p" = "yes"; then
2793     test -n "$runpath" && runpath="${runpath}:"
2794     runpath="${runpath}${xe_runpath_dir}"
2795     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2796   fi'
2797
2798
2799
2800
2801 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2802     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2803   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2804   
2805         runpath="" runpath_dirs=""
2806   if test -n "$LD_RUN_PATH"; then
2807     runpath="$LD_RUN_PATH"
2808   elif test "$GCC" = "yes"; then
2809         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2810     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2811     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2812     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2813       case "$arg" in P,* | -L* | -R* )
2814         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2815           {
2816 xe_runpath_dir="$dir"
2817   test "$xe_runpath_dir" != "/lib"     -a \
2818         "$xe_runpath_dir" != "/usr/lib" -a \
2819         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2820   eval "$xe_add_unique_runpath_dir"
2821 }
2822         done ;;
2823       esac
2824     done
2825     ld_switch_run="$ld_switch_run_save"
2826     rm -f conftest*
2827   else
2828         for arg in $ld_switch_site $ld_switch_x_site; do
2829       case "$arg" in -L*) {
2830 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2831   test "$xe_runpath_dir" != "/lib"     -a \
2832         "$xe_runpath_dir" != "/usr/lib" -a \
2833         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2834   eval "$xe_add_unique_runpath_dir"
2835 };; esac
2836     done
2837         if test "$opsys $need_motif" = "sol2 yes"; then
2838       xe_runpath_dir="/opt/SUNWdt/lib";
2839       eval "$xe_add_unique_runpath_dir";
2840     fi
2841   fi 
2842   if test -n "$runpath"; then
2843     ld_switch_run="${dash_r}${runpath}"
2844     
2845 if test "$GCC" = "yes"; then
2846   set x $ld_switch_run; shift; ld_switch_run=""
2847   while test -n "$1"; do
2848     case $1 in
2849       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2850       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2851       -Xlinker* ) ;;
2852       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2853     esac
2854     shift
2855   done
2856 fi
2857     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2858   fi
2859 fi
2860
2861
2862
2863
2864 GNU_MALLOC=yes
2865 if test "$with_dlmalloc" != "no"; then
2866         doug_lea_malloc=yes
2867 else
2868         doug_lea_malloc=no
2869 fi
2870 after_morecore_hook_exists=yes
2871 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2872 echo "configure:2873: checking for malloc_get_state" >&5
2873
2874 cat > conftest.$ac_ext <<EOF
2875 #line 2876 "configure"
2876 #include "confdefs.h"
2877 /* System header to define __stub macros and hopefully few prototypes,
2878     which can conflict with char malloc_get_state(); below.  */
2879 #include <assert.h>
2880 /* Override any gcc2 internal prototype to avoid an error.  */
2881 /* We use char because int might match the return type of a gcc2
2882     builtin and then its argument prototype would still apply.  */
2883 char malloc_get_state();
2884
2885 int main() {
2886
2887 /* The GNU C library defines this for functions which it implements
2888     to always fail with ENOSYS.  Some functions are actually named
2889     something starting with __ and the normal name is an alias.  */
2890 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2891 choke me
2892 #else
2893 malloc_get_state();
2894 #endif
2895
2896 ; return 0; }
2897 EOF
2898 if { (eval echo configure:2899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2899   rm -rf conftest*
2900   eval "ac_cv_func_malloc_get_state=yes"
2901 else
2902   echo "configure: failed program was:" >&5
2903   cat conftest.$ac_ext >&5
2904   rm -rf conftest*
2905   eval "ac_cv_func_malloc_get_state=no"
2906 fi
2907 rm -f conftest*
2908
2909 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2910   echo "$ac_t""yes" 1>&6
2911   :
2912 else
2913   echo "$ac_t""no" 1>&6
2914 doug_lea_malloc=no
2915 fi
2916
2917 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2918 echo "configure:2919: checking for malloc_set_state" >&5
2919
2920 cat > conftest.$ac_ext <<EOF
2921 #line 2922 "configure"
2922 #include "confdefs.h"
2923 /* System header to define __stub macros and hopefully few prototypes,
2924     which can conflict with char malloc_set_state(); below.  */
2925 #include <assert.h>
2926 /* Override any gcc2 internal prototype to avoid an error.  */
2927 /* We use char because int might match the return type of a gcc2
2928     builtin and then its argument prototype would still apply.  */
2929 char malloc_set_state();
2930
2931 int main() {
2932
2933 /* The GNU C library defines this for functions which it implements
2934     to always fail with ENOSYS.  Some functions are actually named
2935     something starting with __ and the normal name is an alias.  */
2936 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2937 choke me
2938 #else
2939 malloc_set_state();
2940 #endif
2941
2942 ; return 0; }
2943 EOF
2944 if { (eval echo configure:2945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2945   rm -rf conftest*
2946   eval "ac_cv_func_malloc_set_state=yes"
2947 else
2948   echo "configure: failed program was:" >&5
2949   cat conftest.$ac_ext >&5
2950   rm -rf conftest*
2951   eval "ac_cv_func_malloc_set_state=no"
2952 fi
2953 rm -f conftest*
2954
2955 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2956   echo "$ac_t""yes" 1>&6
2957   :
2958 else
2959   echo "$ac_t""no" 1>&6
2960 doug_lea_malloc=no
2961 fi
2962
2963 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2964 echo "configure:2965: checking whether __after_morecore_hook exists" >&5
2965 cat > conftest.$ac_ext <<EOF
2966 #line 2967 "configure"
2967 #include "confdefs.h"
2968 extern void (* __after_morecore_hook)();
2969 int main() {
2970 __after_morecore_hook = 0
2971 ; return 0; }
2972 EOF
2973 if { (eval echo configure:2974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2974   rm -rf conftest*
2975   echo "$ac_t""yes" 1>&6
2976 else
2977   echo "configure: failed program was:" >&5
2978   cat conftest.$ac_ext >&5
2979   rm -rf conftest*
2980   echo "$ac_t""no" 1>&6
2981    after_morecore_hook_exists=no
2982 fi
2983 rm -f conftest*
2984 if test "$system_malloc" = "yes" ; then
2985   GNU_MALLOC=no
2986   GNU_MALLOC_reason="
2987   (The GNU allocators don't work with this system configuration)."
2988 elif test "$with_system_malloc" = "yes" ; then
2989   GNU_MALLOC=no
2990   GNU_MALLOC_reason="
2991   (User chose not to use GNU allocators)."
2992 elif test "$with_debug_malloc" = "yes" ; then
2993   GNU_MALLOC=no
2994   GNU_MALLOC_reason="
2995   (User chose to use Debugging Malloc)."
2996 fi
2997
2998 if test "$doug_lea_malloc" = "yes" ; then
2999   if test "$GNU_MALLOC" = yes ; then
3000     GNU_MALLOC_reason="
3001   (Using Doug Lea's new malloc from the GNU C Library.)"
3002   fi
3003   { test "$extra_verbose" = "yes" && cat << \EOF
3004     Defining DOUG_LEA_MALLOC
3005 EOF
3006 cat >> confdefs.h <<\EOF
3007 #define DOUG_LEA_MALLOC 1
3008 EOF
3009 }
3010
3011   if test "$after_morecore_hook_exists" = "no" ; then
3012     GNU_MALLOC_reason="
3013   (Using Doug Lea's new malloc from the Linux C Library.)"
3014     { test "$extra_verbose" = "yes" && cat << \EOF
3015     Defining _NO_MALLOC_WARNING_
3016 EOF
3017 cat >> confdefs.h <<\EOF
3018 #define _NO_MALLOC_WARNING_ 1
3019 EOF
3020 }
3021
3022   fi
3023   use_minimal_tagbits=yes
3024 fi
3025
3026
3027
3028
3029 # Extract the first word of "ranlib", so it can be a program name with args.
3030 set dummy ranlib; ac_word=$2
3031 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3032 echo "configure:3033: checking for $ac_word" >&5
3033
3034 if test -n "$RANLIB"; then
3035   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3036 else
3037   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3038   ac_dummy="$PATH"
3039   for ac_dir in $ac_dummy; do
3040     test -z "$ac_dir" && ac_dir=.
3041     if test -f $ac_dir/$ac_word; then
3042       ac_cv_prog_RANLIB="ranlib"
3043       break
3044     fi
3045   done
3046   IFS="$ac_save_ifs"
3047   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3048 fi
3049 RANLIB="$ac_cv_prog_RANLIB"
3050 if test -n "$RANLIB"; then
3051   echo "$ac_t""$RANLIB" 1>&6
3052 else
3053   echo "$ac_t""no" 1>&6
3054 fi
3055
3056 ac_aux_dir=
3057 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3058   if test -f $ac_dir/install-sh; then
3059     ac_aux_dir=$ac_dir
3060     ac_install_sh="$ac_aux_dir/install-sh -c"
3061     break
3062   elif test -f $ac_dir/install.sh; then
3063     ac_aux_dir=$ac_dir
3064     ac_install_sh="$ac_aux_dir/install.sh -c"
3065     break
3066   fi
3067 done
3068 if test -z "$ac_aux_dir"; then
3069   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3070 fi
3071 ac_config_guess=$ac_aux_dir/config.guess
3072 ac_config_sub=$ac_aux_dir/config.sub
3073 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3074
3075 # Find a good install program.  We prefer a C program (faster),
3076 # so one script is as good as another.  But avoid the broken or
3077 # incompatible versions:
3078 # SysV /etc/install, /usr/sbin/install
3079 # SunOS /usr/etc/install
3080 # IRIX /sbin/install
3081 # AIX /bin/install
3082 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3083 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3084 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3085 # ./install, which can be erroneously created by make from ./install.sh.
3086 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3087 echo "configure:3088: checking for a BSD compatible install" >&5
3088 if test -z "$INSTALL"; then
3089
3090   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3091   for ac_dir in $PATH; do
3092     # Account for people who put trailing slashes in PATH elements.
3093     case "$ac_dir/" in
3094     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3095     *)
3096       # OSF1 and SCO ODT 3.0 have their own names for install.
3097       # Don't use installbsd from OSF since it installs stuff as root
3098       # by default.
3099       for ac_prog in ginstall scoinst install; do
3100         if test -f $ac_dir/$ac_prog; then
3101           if test $ac_prog = install &&
3102             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3103             # AIX install.  It has an incompatible calling convention.
3104             :
3105           else
3106             ac_cv_path_install="$ac_dir/$ac_prog -c"
3107             break 2
3108           fi
3109         fi
3110       done
3111       ;;
3112     esac
3113   done
3114   IFS="$ac_save_IFS"
3115
3116   if test "${ac_cv_path_install+set}" = set; then
3117     INSTALL="$ac_cv_path_install"
3118   else
3119     # As a last resort, use the slow shell script.  We don't cache a
3120     # path for INSTALL within a source directory, because that will
3121     # break other packages using the cache if that directory is
3122     # removed, or if the path is relative.
3123     INSTALL="$ac_install_sh"
3124   fi
3125 fi
3126 echo "$ac_t""$INSTALL" 1>&6
3127
3128 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3129 # It thinks the first close brace ends the variable substitution.
3130 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3131
3132 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3133
3134 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3135
3136 for ac_prog in 'bison -y' byacc
3137 do
3138 # Extract the first word of "$ac_prog", so it can be a program name with args.
3139 set dummy $ac_prog; ac_word=$2
3140 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3141 echo "configure:3142: checking for $ac_word" >&5
3142
3143 if test -n "$YACC"; then
3144   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3145 else
3146   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3147   ac_dummy="$PATH"
3148   for ac_dir in $ac_dummy; do
3149     test -z "$ac_dir" && ac_dir=.
3150     if test -f $ac_dir/$ac_word; then
3151       ac_cv_prog_YACC="$ac_prog"
3152       break
3153     fi
3154   done
3155   IFS="$ac_save_ifs"
3156 fi
3157 YACC="$ac_cv_prog_YACC"
3158 if test -n "$YACC"; then
3159   echo "$ac_t""$YACC" 1>&6
3160 else
3161   echo "$ac_t""no" 1>&6
3162 fi
3163
3164 test -n "$YACC" && break
3165 done
3166 test -n "$YACC" || YACC="yacc"
3167
3168
3169 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
3170 do
3171 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3172 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3173 echo "configure:3174: checking for $ac_hdr" >&5
3174
3175 cat > conftest.$ac_ext <<EOF
3176 #line 3177 "configure"
3177 #include "confdefs.h"
3178 #include <$ac_hdr>
3179 EOF
3180 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3181 { (eval echo configure:3182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3182 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3183 if test -z "$ac_err"; then
3184   rm -rf conftest*
3185   eval "ac_cv_header_$ac_safe=yes"
3186 else
3187   echo "$ac_err" >&5
3188   echo "configure: failed program was:" >&5
3189   cat conftest.$ac_ext >&5
3190   rm -rf conftest*
3191   eval "ac_cv_header_$ac_safe=no"
3192 fi
3193 rm -f conftest*
3194 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3195   echo "$ac_t""yes" 1>&6
3196     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3197   { test "$extra_verbose" = "yes" && cat << EOF
3198     Defining $ac_tr_hdr
3199 EOF
3200 cat >> confdefs.h <<EOF
3201 #define $ac_tr_hdr 1
3202 EOF
3203 }
3204  
3205 else
3206   echo "$ac_t""no" 1>&6
3207 fi
3208 done
3209
3210 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3211 do
3212 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3213 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3214 echo "configure:3215: checking for $ac_hdr" >&5
3215
3216 cat > conftest.$ac_ext <<EOF
3217 #line 3218 "configure"
3218 #include "confdefs.h"
3219 #include <$ac_hdr>
3220 EOF
3221 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3222 { (eval echo configure:3223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3223 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3224 if test -z "$ac_err"; then
3225   rm -rf conftest*
3226   eval "ac_cv_header_$ac_safe=yes"
3227 else
3228   echo "$ac_err" >&5
3229   echo "configure: failed program was:" >&5
3230   cat conftest.$ac_ext >&5
3231   rm -rf conftest*
3232   eval "ac_cv_header_$ac_safe=no"
3233 fi
3234 rm -f conftest*
3235 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3236   echo "$ac_t""yes" 1>&6
3237     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3238   { test "$extra_verbose" = "yes" && cat << EOF
3239     Defining $ac_tr_hdr
3240 EOF
3241 cat >> confdefs.h <<EOF
3242 #define $ac_tr_hdr 1
3243 EOF
3244 }
3245  
3246 else
3247   echo "$ac_t""no" 1>&6
3248 fi
3249 done
3250
3251 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3252 do
3253 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3254 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3255 echo "configure:3256: checking for $ac_hdr" >&5
3256
3257 cat > conftest.$ac_ext <<EOF
3258 #line 3259 "configure"
3259 #include "confdefs.h"
3260 #include <$ac_hdr>
3261 EOF
3262 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3263 { (eval echo configure:3264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3264 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3265 if test -z "$ac_err"; then
3266   rm -rf conftest*
3267   eval "ac_cv_header_$ac_safe=yes"
3268 else
3269   echo "$ac_err" >&5
3270   echo "configure: failed program was:" >&5
3271   cat conftest.$ac_ext >&5
3272   rm -rf conftest*
3273   eval "ac_cv_header_$ac_safe=no"
3274 fi
3275 rm -f conftest*
3276 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3277   echo "$ac_t""yes" 1>&6
3278     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3279   { test "$extra_verbose" = "yes" && cat << EOF
3280     Defining $ac_tr_hdr
3281 EOF
3282 cat >> confdefs.h <<EOF
3283 #define $ac_tr_hdr 1
3284 EOF
3285 }
3286  
3287 else
3288   echo "$ac_t""no" 1>&6
3289 fi
3290 done
3291
3292 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3293 echo "configure:3294: checking for sys/wait.h that is POSIX.1 compatible" >&5
3294
3295 cat > conftest.$ac_ext <<EOF
3296 #line 3297 "configure"
3297 #include "confdefs.h"
3298 #include <sys/types.h>
3299 #include <sys/wait.h>
3300 #ifndef WEXITSTATUS
3301 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3302 #endif
3303 #ifndef WIFEXITED
3304 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3305 #endif
3306 int main() {
3307 int s;
3308 wait (&s);
3309 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3310 ; return 0; }
3311 EOF
3312 if { (eval echo configure:3313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3313   rm -rf conftest*
3314   ac_cv_header_sys_wait_h=yes
3315 else
3316   echo "configure: failed program was:" >&5
3317   cat conftest.$ac_ext >&5
3318   rm -rf conftest*
3319   ac_cv_header_sys_wait_h=no
3320 fi
3321 rm -f conftest*
3322
3323 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3324 if test $ac_cv_header_sys_wait_h = yes; then
3325   { test "$extra_verbose" = "yes" && cat << \EOF
3326     Defining HAVE_SYS_WAIT_H
3327 EOF
3328 cat >> confdefs.h <<\EOF
3329 #define HAVE_SYS_WAIT_H 1
3330 EOF
3331 }
3332
3333 fi
3334
3335 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3336 echo "configure:3337: checking for ANSI C header files" >&5
3337
3338 cat > conftest.$ac_ext <<EOF
3339 #line 3340 "configure"
3340 #include "confdefs.h"
3341 #include <stdlib.h>
3342 #include <stdarg.h>
3343 #include <string.h>
3344 #include <float.h>
3345 EOF
3346 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3347 { (eval echo configure:3348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3348 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3349 if test -z "$ac_err"; then
3350   rm -rf conftest*
3351   ac_cv_header_stdc=yes
3352 else
3353   echo "$ac_err" >&5
3354   echo "configure: failed program was:" >&5
3355   cat conftest.$ac_ext >&5
3356   rm -rf conftest*
3357   ac_cv_header_stdc=no
3358 fi
3359 rm -f conftest*
3360
3361 if test $ac_cv_header_stdc = yes; then
3362   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3363 cat > conftest.$ac_ext <<EOF
3364 #line 3365 "configure"
3365 #include "confdefs.h"
3366 #include <string.h>
3367 EOF
3368 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3369   egrep "memchr" >/dev/null 2>&1; then
3370   :
3371 else
3372   rm -rf conftest*
3373   ac_cv_header_stdc=no
3374 fi
3375 rm -f conftest*
3376
3377 fi
3378
3379 if test $ac_cv_header_stdc = yes; then
3380   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3381 cat > conftest.$ac_ext <<EOF
3382 #line 3383 "configure"
3383 #include "confdefs.h"
3384 #include <stdlib.h>
3385 EOF
3386 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3387   egrep "free" >/dev/null 2>&1; then
3388   :
3389 else
3390   rm -rf conftest*
3391   ac_cv_header_stdc=no
3392 fi
3393 rm -f conftest*
3394
3395 fi
3396
3397 if test $ac_cv_header_stdc = yes; then
3398   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3399 cat > conftest.$ac_ext <<EOF
3400 #line 3401 "configure"
3401 #include "confdefs.h"
3402 #include <ctype.h>
3403 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3404 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3405 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3406 int main () { int i; for (i = 0; i < 256; i++)
3407 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3408 exit (0); }
3409
3410 EOF
3411 if { (eval echo configure:3412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3412 then
3413   :
3414 else
3415   conftest_rc="$?"
3416   echo "configure: failed program was:" >&5
3417   cat conftest.$ac_ext >&5
3418   rm -fr conftest*
3419   ac_cv_header_stdc=no
3420 fi
3421 rm -fr conftest*
3422 fi
3423
3424 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3425 if test $ac_cv_header_stdc = yes; then
3426   { test "$extra_verbose" = "yes" && cat << \EOF
3427     Defining STDC_HEADERS
3428 EOF
3429 cat >> confdefs.h <<\EOF
3430 #define STDC_HEADERS 1
3431 EOF
3432 }
3433
3434 fi
3435
3436 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3437 echo "configure:3438: checking whether time.h and sys/time.h may both be included" >&5
3438
3439 cat > conftest.$ac_ext <<EOF
3440 #line 3441 "configure"
3441 #include "confdefs.h"
3442 #include <sys/types.h>
3443 #include <sys/time.h>
3444 #include <time.h>
3445 int main() {
3446 struct tm *tp;
3447 ; return 0; }
3448 EOF
3449 if { (eval echo configure:3450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3450   rm -rf conftest*
3451   ac_cv_header_time=yes
3452 else
3453   echo "configure: failed program was:" >&5
3454   cat conftest.$ac_ext >&5
3455   rm -rf conftest*
3456   ac_cv_header_time=no
3457 fi
3458 rm -f conftest*
3459
3460 echo "$ac_t""$ac_cv_header_time" 1>&6
3461 if test $ac_cv_header_time = yes; then
3462   { test "$extra_verbose" = "yes" && cat << \EOF
3463     Defining TIME_WITH_SYS_TIME
3464 EOF
3465 cat >> confdefs.h <<\EOF
3466 #define TIME_WITH_SYS_TIME 1
3467 EOF
3468 }
3469
3470 fi
3471
3472 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3473 echo "configure:3474: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3474
3475 cat > conftest.$ac_ext <<EOF
3476 #line 3477 "configure"
3477 #include "confdefs.h"
3478 #include <sys/types.h>
3479 #include <signal.h>
3480 /* NetBSD declares sys_siglist in unistd.h.  */
3481 #ifdef HAVE_UNISTD_H
3482 #include <unistd.h>
3483 #endif
3484 int main() {
3485 char *msg = *(sys_siglist + 1);
3486 ; return 0; }
3487 EOF
3488 if { (eval echo configure:3489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3489   rm -rf conftest*
3490   ac_cv_decl_sys_siglist=yes
3491 else
3492   echo "configure: failed program was:" >&5
3493   cat conftest.$ac_ext >&5
3494   rm -rf conftest*
3495   ac_cv_decl_sys_siglist=no
3496 fi
3497 rm -f conftest*
3498
3499 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3500 if test $ac_cv_decl_sys_siglist = yes; then
3501   { test "$extra_verbose" = "yes" && cat << \EOF
3502     Defining SYS_SIGLIST_DECLARED
3503 EOF
3504 cat >> confdefs.h <<\EOF
3505 #define SYS_SIGLIST_DECLARED 1
3506 EOF
3507 }
3508
3509 fi
3510
3511
3512 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3513 echo "configure:3514: checking for struct utimbuf" >&5
3514 cat > conftest.$ac_ext <<EOF
3515 #line 3516 "configure"
3516 #include "confdefs.h"
3517 #ifdef TIME_WITH_SYS_TIME
3518 #include <sys/time.h>
3519 #include <time.h>
3520 #else
3521 #ifdef HAVE_SYS_TIME_H
3522 #include <sys/time.h>
3523 #else
3524 #include <time.h>
3525 #endif
3526 #endif
3527 #ifdef HAVE_UTIME_H
3528 #include <utime.h>
3529 #endif
3530 int main() {
3531 static struct utimbuf x; x.actime = x.modtime;
3532 ; return 0; }
3533 EOF
3534 if { (eval echo configure:3535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3535   rm -rf conftest*
3536   echo "$ac_t""yes" 1>&6
3537    { test "$extra_verbose" = "yes" && cat << \EOF
3538     Defining HAVE_STRUCT_UTIMBUF
3539 EOF
3540 cat >> confdefs.h <<\EOF
3541 #define HAVE_STRUCT_UTIMBUF 1
3542 EOF
3543 }
3544
3545 else
3546   echo "configure: failed program was:" >&5
3547   cat conftest.$ac_ext >&5
3548   rm -rf conftest*
3549   echo "$ac_t""no" 1>&6
3550 fi
3551 rm -f conftest*
3552
3553 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3554 echo "configure:3555: checking return type of signal handlers" >&5
3555
3556 cat > conftest.$ac_ext <<EOF
3557 #line 3558 "configure"
3558 #include "confdefs.h"
3559 #include <sys/types.h>
3560 #include <signal.h>
3561 #ifdef signal
3562 #undef signal
3563 #endif
3564 #ifdef __cplusplus
3565 extern "C" void (*signal (int, void (*)(int)))(int);
3566 #else
3567 void (*signal ()) ();
3568 #endif
3569
3570 int main() {
3571 int i;
3572 ; return 0; }
3573 EOF
3574 if { (eval echo configure:3575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3575   rm -rf conftest*
3576   ac_cv_type_signal=void
3577 else
3578   echo "configure: failed program was:" >&5
3579   cat conftest.$ac_ext >&5
3580   rm -rf conftest*
3581   ac_cv_type_signal=int
3582 fi
3583 rm -f conftest*
3584
3585 echo "$ac_t""$ac_cv_type_signal" 1>&6
3586 { test "$extra_verbose" = "yes" && cat << EOF
3587     Defining RETSIGTYPE = $ac_cv_type_signal
3588 EOF
3589 cat >> confdefs.h <<EOF
3590 #define RETSIGTYPE $ac_cv_type_signal
3591 EOF
3592 }
3593
3594
3595 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3596 echo "configure:3597: checking for size_t" >&5
3597
3598 cat > conftest.$ac_ext <<EOF
3599 #line 3600 "configure"
3600 #include "confdefs.h"
3601 #include <sys/types.h>
3602 #if STDC_HEADERS
3603 #include <stdlib.h>
3604 #include <stddef.h>
3605 #endif
3606 EOF
3607 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3608   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3609   rm -rf conftest*
3610   ac_cv_type_size_t=yes
3611 else
3612   rm -rf conftest*
3613   ac_cv_type_size_t=no
3614 fi
3615 rm -f conftest*
3616
3617 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3618 if test $ac_cv_type_size_t = no; then
3619   { test "$extra_verbose" = "yes" && cat << \EOF
3620     Defining size_t = unsigned
3621 EOF
3622 cat >> confdefs.h <<\EOF
3623 #define size_t unsigned
3624 EOF
3625 }
3626
3627 fi
3628
3629 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3630 echo "configure:3631: checking for pid_t" >&5
3631
3632 cat > conftest.$ac_ext <<EOF
3633 #line 3634 "configure"
3634 #include "confdefs.h"
3635 #include <sys/types.h>
3636 #if STDC_HEADERS
3637 #include <stdlib.h>
3638 #include <stddef.h>
3639 #endif
3640 EOF
3641 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3642   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3643   rm -rf conftest*
3644   ac_cv_type_pid_t=yes
3645 else
3646   rm -rf conftest*
3647   ac_cv_type_pid_t=no
3648 fi
3649 rm -f conftest*
3650
3651 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3652 if test $ac_cv_type_pid_t = no; then
3653   { test "$extra_verbose" = "yes" && cat << \EOF
3654     Defining pid_t = int
3655 EOF
3656 cat >> confdefs.h <<\EOF
3657 #define pid_t int
3658 EOF
3659 }
3660
3661 fi
3662
3663 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3664 echo "configure:3665: checking for uid_t in sys/types.h" >&5
3665
3666 cat > conftest.$ac_ext <<EOF
3667 #line 3668 "configure"
3668 #include "confdefs.h"
3669 #include <sys/types.h>
3670 EOF
3671 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3672   egrep "uid_t" >/dev/null 2>&1; then
3673   rm -rf conftest*
3674   ac_cv_type_uid_t=yes
3675 else
3676   rm -rf conftest*
3677   ac_cv_type_uid_t=no
3678 fi
3679 rm -f conftest*
3680
3681
3682 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3683 if test $ac_cv_type_uid_t = no; then
3684   { test "$extra_verbose" = "yes" && cat << \EOF
3685     Defining uid_t = int
3686 EOF
3687 cat >> confdefs.h <<\EOF
3688 #define uid_t int
3689 EOF
3690 }
3691
3692   { test "$extra_verbose" = "yes" && cat << \EOF
3693     Defining gid_t = int
3694 EOF
3695 cat >> confdefs.h <<\EOF
3696 #define gid_t int
3697 EOF
3698 }
3699
3700 fi
3701
3702 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3703 echo "configure:3704: checking for mode_t" >&5
3704
3705 cat > conftest.$ac_ext <<EOF
3706 #line 3707 "configure"
3707 #include "confdefs.h"
3708 #include <sys/types.h>
3709 #if STDC_HEADERS
3710 #include <stdlib.h>
3711 #include <stddef.h>
3712 #endif
3713 EOF
3714 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3715   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3716   rm -rf conftest*
3717   ac_cv_type_mode_t=yes
3718 else
3719   rm -rf conftest*
3720   ac_cv_type_mode_t=no
3721 fi
3722 rm -f conftest*
3723
3724 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3725 if test $ac_cv_type_mode_t = no; then
3726   { test "$extra_verbose" = "yes" && cat << \EOF
3727     Defining mode_t = int
3728 EOF
3729 cat >> confdefs.h <<\EOF
3730 #define mode_t int
3731 EOF
3732 }
3733
3734 fi
3735
3736 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3737 echo "configure:3738: checking for off_t" >&5
3738
3739 cat > conftest.$ac_ext <<EOF
3740 #line 3741 "configure"
3741 #include "confdefs.h"
3742 #include <sys/types.h>
3743 #if STDC_HEADERS
3744 #include <stdlib.h>
3745 #include <stddef.h>
3746 #endif
3747 EOF
3748 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3749   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3750   rm -rf conftest*
3751   ac_cv_type_off_t=yes
3752 else
3753   rm -rf conftest*
3754   ac_cv_type_off_t=no
3755 fi
3756 rm -f conftest*
3757
3758 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3759 if test $ac_cv_type_off_t = no; then
3760   { test "$extra_verbose" = "yes" && cat << \EOF
3761     Defining off_t = long
3762 EOF
3763 cat >> confdefs.h <<\EOF
3764 #define off_t long
3765 EOF
3766 }
3767
3768 fi
3769
3770
3771 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3772 echo "configure:3773: checking for struct timeval" >&5
3773 cat > conftest.$ac_ext <<EOF
3774 #line 3775 "configure"
3775 #include "confdefs.h"
3776 #ifdef TIME_WITH_SYS_TIME
3777 #include <sys/time.h>
3778 #include <time.h>
3779 #else
3780 #ifdef HAVE_SYS_TIME_H
3781 #include <sys/time.h>
3782 #else
3783 #include <time.h>
3784 #endif
3785 #endif
3786 int main() {
3787 static struct timeval x; x.tv_sec = x.tv_usec;
3788 ; return 0; }
3789 EOF
3790 if { (eval echo configure:3791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3791   rm -rf conftest*
3792   echo "$ac_t""yes" 1>&6
3793   HAVE_TIMEVAL=yes
3794   { test "$extra_verbose" = "yes" && cat << \EOF
3795     Defining HAVE_TIMEVAL
3796 EOF
3797 cat >> confdefs.h <<\EOF
3798 #define HAVE_TIMEVAL 1
3799 EOF
3800 }
3801
3802 else
3803   echo "configure: failed program was:" >&5
3804   cat conftest.$ac_ext >&5
3805   rm -rf conftest*
3806   echo "$ac_t""no" 1>&6
3807    HAVE_TIMEVAL=no
3808 fi
3809 rm -f conftest*
3810
3811 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3812 echo "configure:3813: checking whether struct tm is in sys/time.h or time.h" >&5
3813
3814 cat > conftest.$ac_ext <<EOF
3815 #line 3816 "configure"
3816 #include "confdefs.h"
3817 #include <sys/types.h>
3818 #include <time.h>
3819 int main() {
3820 struct tm *tp; tp->tm_sec;
3821 ; return 0; }
3822 EOF
3823 if { (eval echo configure:3824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3824   rm -rf conftest*
3825   ac_cv_struct_tm=time.h
3826 else
3827   echo "configure: failed program was:" >&5
3828   cat conftest.$ac_ext >&5
3829   rm -rf conftest*
3830   ac_cv_struct_tm=sys/time.h
3831 fi
3832 rm -f conftest*
3833
3834 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3835 if test $ac_cv_struct_tm = sys/time.h; then
3836   { test "$extra_verbose" = "yes" && cat << \EOF
3837     Defining TM_IN_SYS_TIME
3838 EOF
3839 cat >> confdefs.h <<\EOF
3840 #define TM_IN_SYS_TIME 1
3841 EOF
3842 }
3843
3844 fi
3845
3846 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3847 echo "configure:3848: checking for tm_zone in struct tm" >&5
3848
3849 cat > conftest.$ac_ext <<EOF
3850 #line 3851 "configure"
3851 #include "confdefs.h"
3852 #include <sys/types.h>
3853 #include <$ac_cv_struct_tm>
3854 int main() {
3855 struct tm tm; tm.tm_zone;
3856 ; return 0; }
3857 EOF
3858 if { (eval echo configure:3859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3859   rm -rf conftest*
3860   ac_cv_struct_tm_zone=yes
3861 else
3862   echo "configure: failed program was:" >&5
3863   cat conftest.$ac_ext >&5
3864   rm -rf conftest*
3865   ac_cv_struct_tm_zone=no
3866 fi
3867 rm -f conftest*
3868
3869 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3870 if test "$ac_cv_struct_tm_zone" = yes; then
3871   { test "$extra_verbose" = "yes" && cat << \EOF
3872     Defining HAVE_TM_ZONE
3873 EOF
3874 cat >> confdefs.h <<\EOF
3875 #define HAVE_TM_ZONE 1
3876 EOF
3877 }
3878
3879 else
3880   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3881 echo "configure:3882: checking for tzname" >&5
3882
3883 cat > conftest.$ac_ext <<EOF
3884 #line 3885 "configure"
3885 #include "confdefs.h"
3886 #include <time.h>
3887 #ifndef tzname /* For SGI.  */
3888 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3889 #endif
3890 int main() {
3891 atoi(*tzname);
3892 ; return 0; }
3893 EOF
3894 if { (eval echo configure:3895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3895   rm -rf conftest*
3896   ac_cv_var_tzname=yes
3897 else
3898   echo "configure: failed program was:" >&5
3899   cat conftest.$ac_ext >&5
3900   rm -rf conftest*
3901   ac_cv_var_tzname=no
3902 fi
3903 rm -f conftest*
3904
3905 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3906   if test $ac_cv_var_tzname = yes; then
3907     { test "$extra_verbose" = "yes" && cat << \EOF
3908     Defining HAVE_TZNAME
3909 EOF
3910 cat >> confdefs.h <<\EOF
3911 #define HAVE_TZNAME 1
3912 EOF
3913 }
3914
3915   fi
3916 fi
3917
3918
3919 echo $ac_n "checking for working const""... $ac_c" 1>&6
3920 echo "configure:3921: checking for working const" >&5
3921
3922 cat > conftest.$ac_ext <<EOF
3923 #line 3924 "configure"
3924 #include "confdefs.h"
3925
3926 int main() {
3927
3928 /* Ultrix mips cc rejects this.  */
3929 typedef int charset[2]; const charset x;
3930 /* SunOS 4.1.1 cc rejects this.  */
3931 char const *const *ccp;
3932 char **p;
3933 /* NEC SVR4.0.2 mips cc rejects this.  */
3934 struct point {int x, y;};
3935 static struct point const zero = {0,0};
3936 /* AIX XL C 1.02.0.0 rejects this.
3937    It does not let you subtract one const X* pointer from another in an arm
3938    of an if-expression whose if-part is not a constant expression */
3939 const char *g = "string";
3940 ccp = &g + (g ? g-g : 0);
3941 /* HPUX 7.0 cc rejects these. */
3942 ++ccp;
3943 p = (char**) ccp;
3944 ccp = (char const *const *) p;
3945 { /* SCO 3.2v4 cc rejects this.  */
3946   char *t;
3947   char const *s = 0 ? (char *) 0 : (char const *) 0;
3948
3949   *t++ = 0;
3950 }
3951 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3952   int x[] = {25, 17};
3953   const int *foo = &x[0];
3954   ++foo;
3955 }
3956 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3957   typedef const int *iptr;
3958   iptr p = 0;
3959   ++p;
3960 }
3961 { /* AIX XL C 1.02.0.0 rejects this saying
3962      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3963   struct s { int j; const int *ap[3]; };
3964   struct s *b; b->j = 5;
3965 }
3966 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3967   const int foo = 10;
3968 }
3969
3970 ; return 0; }
3971 EOF
3972 if { (eval echo configure:3973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3973   rm -rf conftest*
3974   ac_cv_c_const=yes
3975 else
3976   echo "configure: failed program was:" >&5
3977   cat conftest.$ac_ext >&5
3978   rm -rf conftest*
3979   ac_cv_c_const=no
3980 fi
3981 rm -f conftest*
3982
3983 echo "$ac_t""$ac_cv_c_const" 1>&6
3984 if test $ac_cv_c_const = no; then
3985   { test "$extra_verbose" = "yes" && cat << \EOF
3986     Defining const = 
3987 EOF
3988 cat >> confdefs.h <<\EOF
3989 #define const 
3990 EOF
3991 }
3992
3993 fi
3994
3995
3996 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3997 echo "configure:3998: checking whether ${MAKE-make} sets \${MAKE}" >&5
3998 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3999
4000 cat > conftestmake <<\EOF
4001 all:
4002         @echo 'ac_maketemp="${MAKE}"'
4003 EOF
4004 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4005 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4006 if test -n "$ac_maketemp"; then
4007   eval ac_cv_prog_make_${ac_make}_set=yes
4008 else
4009   eval ac_cv_prog_make_${ac_make}_set=no
4010 fi
4011 rm -f conftestmake
4012 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4013   echo "$ac_t""yes" 1>&6
4014   SET_MAKE=
4015 else
4016   echo "$ac_t""no" 1>&6
4017   SET_MAKE="MAKE=${MAKE-make}"
4018 fi
4019
4020
4021 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4022 echo "configure:4023: checking whether byte ordering is bigendian" >&5
4023
4024 ac_cv_c_bigendian=unknown
4025 # See if sys/param.h defines the BYTE_ORDER macro.
4026 cat > conftest.$ac_ext <<EOF
4027 #line 4028 "configure"
4028 #include "confdefs.h"
4029 #include <sys/types.h>
4030 #include <sys/param.h>
4031 int main() {
4032
4033 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4034  bogus endian macros
4035 #endif
4036 ; return 0; }
4037 EOF
4038 if { (eval echo configure:4039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4039   rm -rf conftest*
4040   # It does; now see whether it defined to BIG_ENDIAN or not.
4041 cat > conftest.$ac_ext <<EOF
4042 #line 4043 "configure"
4043 #include "confdefs.h"
4044 #include <sys/types.h>
4045 #include <sys/param.h>
4046 int main() {
4047
4048 #if BYTE_ORDER != BIG_ENDIAN
4049  not big endian
4050 #endif
4051 ; return 0; }
4052 EOF
4053 if { (eval echo configure:4054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4054   rm -rf conftest*
4055   ac_cv_c_bigendian=yes
4056 else
4057   echo "configure: failed program was:" >&5
4058   cat conftest.$ac_ext >&5
4059   rm -rf conftest*
4060   ac_cv_c_bigendian=no
4061 fi
4062 rm -f conftest*
4063 else
4064   echo "configure: failed program was:" >&5
4065   cat conftest.$ac_ext >&5
4066 fi
4067 rm -f conftest*
4068 if test $ac_cv_c_bigendian = unknown; then
4069 cat > conftest.$ac_ext <<EOF
4070 #line 4071 "configure"
4071 #include "confdefs.h"
4072 main () {
4073   /* Are we little or big endian?  From Harbison&Steele.  */
4074   union
4075   {
4076     long l;
4077     char c[sizeof (long)];
4078   } u;
4079   u.l = 1;
4080   exit (u.c[sizeof (long) - 1] == 1);
4081 }
4082 EOF
4083 if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4084 then
4085   ac_cv_c_bigendian=no
4086 else
4087   conftest_rc="$?"
4088   echo "configure: failed program was:" >&5
4089   cat conftest.$ac_ext >&5
4090   rm -fr conftest*
4091   ac_cv_c_bigendian=yes
4092 fi
4093 rm -fr conftest*
4094 fi
4095
4096 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4097 if test $ac_cv_c_bigendian = yes; then
4098   { test "$extra_verbose" = "yes" && cat << \EOF
4099     Defining WORDS_BIGENDIAN
4100 EOF
4101 cat >> confdefs.h <<\EOF
4102 #define WORDS_BIGENDIAN 1
4103 EOF
4104 }
4105
4106 fi
4107
4108
4109 echo $ac_n "checking size of short""... $ac_c" 1>&6
4110 echo "configure:4111: checking size of short" >&5
4111
4112 cat > conftest.$ac_ext <<EOF
4113 #line 4114 "configure"
4114 #include "confdefs.h"
4115 #include <stdio.h>
4116 main()
4117 {
4118   FILE *f=fopen("conftestval", "w");
4119   if (!f) exit(1);
4120   fprintf(f, "%d\n", sizeof(short));
4121   exit(0);
4122 }
4123 EOF
4124 if { (eval echo configure:4125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4125 then
4126   ac_cv_sizeof_short=`cat conftestval`
4127 else
4128   conftest_rc="$?"
4129   echo "configure: failed program was:" >&5
4130   cat conftest.$ac_ext >&5
4131   rm -fr conftest*
4132   ac_cv_sizeof_short=0
4133 fi
4134 rm -fr conftest*
4135 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4136 { test "$extra_verbose" = "yes" && cat << EOF
4137     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4138 EOF
4139 cat >> confdefs.h <<EOF
4140 #define SIZEOF_SHORT $ac_cv_sizeof_short
4141 EOF
4142 }
4143
4144
4145 if test "$ac_cv_sizeof_short" = 0; then
4146   echo ""
4147   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4148   echo "*** PANIC *** Please examine config.log for compilation errors."
4149   exit 1
4150 fi
4151 echo $ac_n "checking size of int""... $ac_c" 1>&6
4152 echo "configure:4153: checking size of int" >&5
4153
4154 cat > conftest.$ac_ext <<EOF
4155 #line 4156 "configure"
4156 #include "confdefs.h"
4157 #include <stdio.h>
4158 main()
4159 {
4160   FILE *f=fopen("conftestval", "w");
4161   if (!f) exit(1);
4162   fprintf(f, "%d\n", sizeof(int));
4163   exit(0);
4164 }
4165 EOF
4166 if { (eval echo configure:4167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4167 then
4168   ac_cv_sizeof_int=`cat conftestval`
4169 else
4170   conftest_rc="$?"
4171   echo "configure: failed program was:" >&5
4172   cat conftest.$ac_ext >&5
4173   rm -fr conftest*
4174   ac_cv_sizeof_int=0
4175 fi
4176 rm -fr conftest*
4177 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4178 { test "$extra_verbose" = "yes" && cat << EOF
4179     Defining SIZEOF_INT = $ac_cv_sizeof_int
4180 EOF
4181 cat >> confdefs.h <<EOF
4182 #define SIZEOF_INT $ac_cv_sizeof_int
4183 EOF
4184 }
4185
4186
4187 echo $ac_n "checking size of long""... $ac_c" 1>&6
4188 echo "configure:4189: checking size of long" >&5
4189
4190 cat > conftest.$ac_ext <<EOF
4191 #line 4192 "configure"
4192 #include "confdefs.h"
4193 #include <stdio.h>
4194 main()
4195 {
4196   FILE *f=fopen("conftestval", "w");
4197   if (!f) exit(1);
4198   fprintf(f, "%d\n", sizeof(long));
4199   exit(0);
4200 }
4201 EOF
4202 if { (eval echo configure:4203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4203 then
4204   ac_cv_sizeof_long=`cat conftestval`
4205 else
4206   conftest_rc="$?"
4207   echo "configure: failed program was:" >&5
4208   cat conftest.$ac_ext >&5
4209   rm -fr conftest*
4210   ac_cv_sizeof_long=0
4211 fi
4212 rm -fr conftest*
4213 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4214 { test "$extra_verbose" = "yes" && cat << EOF
4215     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4216 EOF
4217 cat >> confdefs.h <<EOF
4218 #define SIZEOF_LONG $ac_cv_sizeof_long
4219 EOF
4220 }
4221
4222
4223 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4224 echo "configure:4225: checking size of long long" >&5
4225
4226 cat > conftest.$ac_ext <<EOF
4227 #line 4228 "configure"
4228 #include "confdefs.h"
4229 #include <stdio.h>
4230 main()
4231 {
4232   FILE *f=fopen("conftestval", "w");
4233   if (!f) exit(1);
4234   fprintf(f, "%d\n", sizeof(long long));
4235   exit(0);
4236 }
4237 EOF
4238 if { (eval echo configure:4239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4239 then
4240   ac_cv_sizeof_long_long=`cat conftestval`
4241 else
4242   conftest_rc="$?"
4243   echo "configure: failed program was:" >&5
4244   cat conftest.$ac_ext >&5
4245   rm -fr conftest*
4246   ac_cv_sizeof_long_long=0
4247 fi
4248 rm -fr conftest*
4249 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4250 { test "$extra_verbose" = "yes" && cat << EOF
4251     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4252 EOF
4253 cat >> confdefs.h <<EOF
4254 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4255 EOF
4256 }
4257
4258
4259 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4260 echo "configure:4261: checking size of void *" >&5
4261
4262 cat > conftest.$ac_ext <<EOF
4263 #line 4264 "configure"
4264 #include "confdefs.h"
4265 #include <stdio.h>
4266 main()
4267 {
4268   FILE *f=fopen("conftestval", "w");
4269   if (!f) exit(1);
4270   fprintf(f, "%d\n", sizeof(void *));
4271   exit(0);
4272 }
4273 EOF
4274 if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4275 then
4276   ac_cv_sizeof_void_p=`cat conftestval`
4277 else
4278   conftest_rc="$?"
4279   echo "configure: failed program was:" >&5
4280   cat conftest.$ac_ext >&5
4281   rm -fr conftest*
4282   ac_cv_sizeof_void_p=0
4283 fi
4284 rm -fr conftest*
4285 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4286 { test "$extra_verbose" = "yes" && cat << EOF
4287     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4288 EOF
4289 cat >> confdefs.h <<EOF
4290 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4291 EOF
4292 }
4293
4294
4295
4296 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4297 echo "configure:4298: checking for long file names" >&5
4298
4299 ac_cv_sys_long_file_names=yes
4300 # Test for long file names in all the places we know might matter:
4301 #      .                the current directory, where building will happen
4302 #      $prefix/lib      where we will be installing things
4303 #      $exec_prefix/lib likewise
4304 # eval it to expand exec_prefix.
4305 #      $TMPDIR          if set, where it might want to write temporary files
4306 # if $TMPDIR is not set:
4307 #      /tmp             where it might want to write temporary files
4308 #      /var/tmp         likewise
4309 #      /usr/tmp         likewise
4310 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4311   ac_tmpdirs="$TMPDIR"
4312 else
4313   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4314 fi
4315 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4316   test -d $ac_dir || continue
4317   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4318   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4319   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4320   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4321   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4322     ac_cv_sys_long_file_names=no
4323     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4324     break
4325   fi
4326   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4327 done
4328
4329 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4330 if test $ac_cv_sys_long_file_names = yes; then
4331   { test "$extra_verbose" = "yes" && cat << \EOF
4332     Defining HAVE_LONG_FILE_NAMES
4333 EOF
4334 cat >> confdefs.h <<\EOF
4335 #define HAVE_LONG_FILE_NAMES 1
4336 EOF
4337 }
4338
4339 fi
4340
4341
4342 echo $ac_n "checking for sin""... $ac_c" 1>&6
4343 echo "configure:4344: checking for sin" >&5
4344
4345 cat > conftest.$ac_ext <<EOF
4346 #line 4347 "configure"
4347 #include "confdefs.h"
4348 /* System header to define __stub macros and hopefully few prototypes,
4349     which can conflict with char sin(); below.  */
4350 #include <assert.h>
4351 /* Override any gcc2 internal prototype to avoid an error.  */
4352 /* We use char because int might match the return type of a gcc2
4353     builtin and then its argument prototype would still apply.  */
4354 char sin();
4355
4356 int main() {
4357
4358 /* The GNU C library defines this for functions which it implements
4359     to always fail with ENOSYS.  Some functions are actually named
4360     something starting with __ and the normal name is an alias.  */
4361 #if defined (__stub_sin) || defined (__stub___sin)
4362 choke me
4363 #else
4364 sin();
4365 #endif
4366
4367 ; return 0; }
4368 EOF
4369 if { (eval echo configure:4370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4370   rm -rf conftest*
4371   eval "ac_cv_func_sin=yes"
4372 else
4373   echo "configure: failed program was:" >&5
4374   cat conftest.$ac_ext >&5
4375   rm -rf conftest*
4376   eval "ac_cv_func_sin=no"
4377 fi
4378 rm -f conftest*
4379
4380 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4381   echo "$ac_t""yes" 1>&6
4382   :
4383 else
4384   echo "$ac_t""no" 1>&6
4385
4386 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4387 echo "configure:4388: checking for sin in -lm" >&5
4388 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4389
4390 xe_check_libs=" -lm "
4391 cat > conftest.$ac_ext <<EOF
4392 #line 4393 "configure"
4393 #include "confdefs.h"
4394 /* Override any gcc2 internal prototype to avoid an error.  */
4395 /* We use char because int might match the return type of a gcc2
4396     builtin and then its argument prototype would still apply.  */
4397 char sin();
4398
4399 int main() {
4400 sin()
4401 ; return 0; }
4402 EOF
4403 if { (eval echo configure:4404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4404   rm -rf conftest*
4405   eval "ac_cv_lib_$ac_lib_var=yes"
4406 else
4407   echo "configure: failed program was:" >&5
4408   cat conftest.$ac_ext >&5
4409   rm -rf conftest*
4410   eval "ac_cv_lib_$ac_lib_var=no"
4411 fi
4412 rm -f conftest*
4413 xe_check_libs=""
4414
4415 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4416   echo "$ac_t""yes" 1>&6
4417     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4418     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4419   { test "$extra_verbose" = "yes" && cat << EOF
4420     Defining $ac_tr_lib
4421 EOF
4422 cat >> confdefs.h <<EOF
4423 #define $ac_tr_lib 1
4424 EOF
4425 }
4426
4427   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4428
4429 else
4430   echo "$ac_t""no" 1>&6
4431 fi
4432
4433
4434 fi
4435
4436
4437 { test "$extra_verbose" = "yes" && cat << \EOF
4438     Defining LISP_FLOAT_TYPE
4439 EOF
4440 cat >> confdefs.h <<\EOF
4441 #define LISP_FLOAT_TYPE 1
4442 EOF
4443 }
4444
4445
4446 cat > conftest.$ac_ext <<EOF
4447 #line 4448 "configure"
4448 #include "confdefs.h"
4449 #include <math.h>
4450 int main() {
4451 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4452 ; return 0; }
4453 EOF
4454 if { (eval echo configure:4455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4455   rm -rf conftest*
4456   { test "$extra_verbose" = "yes" && cat << \EOF
4457     Defining HAVE_INVERSE_HYPERBOLIC
4458 EOF
4459 cat >> confdefs.h <<\EOF
4460 #define HAVE_INVERSE_HYPERBOLIC 1
4461 EOF
4462 }
4463
4464 else
4465   echo "configure: failed program was:" >&5
4466   cat conftest.$ac_ext >&5
4467 fi
4468 rm -f conftest*
4469
4470 echo "checking type of mail spool file locking" 1>&6
4471 echo "configure:4472: checking type of mail spool file locking" >&5
4472 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4473 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4474 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4475     Defining REAL_MAIL_USE_LOCKF
4476 EOF
4477 cat >> confdefs.h <<\EOF
4478 #define REAL_MAIL_USE_LOCKF 1
4479 EOF
4480 }
4481
4482 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4483     Defining REAL_MAIL_USE_FLOCK
4484 EOF
4485 cat >> confdefs.h <<\EOF
4486 #define REAL_MAIL_USE_FLOCK 1
4487 EOF
4488 }
4489
4490 else mail_locking="dot-locking"
4491 fi
4492
4493 case "$opsys" in decosf*)
4494   
4495 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4496 echo "configure:4497: checking for cma_open in -lpthreads" >&5
4497 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4498
4499 xe_check_libs=" -lpthreads "
4500 cat > conftest.$ac_ext <<EOF
4501 #line 4502 "configure"
4502 #include "confdefs.h"
4503 /* Override any gcc2 internal prototype to avoid an error.  */
4504 /* We use char because int might match the return type of a gcc2
4505     builtin and then its argument prototype would still apply.  */
4506 char cma_open();
4507
4508 int main() {
4509 cma_open()
4510 ; return 0; }
4511 EOF
4512 if { (eval echo configure:4513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4513   rm -rf conftest*
4514   eval "ac_cv_lib_$ac_lib_var=yes"
4515 else
4516   echo "configure: failed program was:" >&5
4517   cat conftest.$ac_ext >&5
4518   rm -rf conftest*
4519   eval "ac_cv_lib_$ac_lib_var=no"
4520 fi
4521 rm -f conftest*
4522 xe_check_libs=""
4523
4524 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4525   echo "$ac_t""yes" 1>&6
4526     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4527     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4528   { test "$extra_verbose" = "yes" && cat << EOF
4529     Defining $ac_tr_lib
4530 EOF
4531 cat >> confdefs.h <<EOF
4532 #define $ac_tr_lib 1
4533 EOF
4534 }
4535
4536   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4537
4538 else
4539   echo "$ac_t""no" 1>&6
4540 fi
4541
4542
4543   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4544     c_switch_site="$c_switch_site -threads" ;;
4545 esac
4546
4547 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4548 echo "configure:4549: checking whether the -xildoff compiler flag is required" >&5
4549 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4550   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4551     then echo "$ac_t""no" 1>&6;
4552     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
4553   fi
4554   else echo "$ac_t""no" 1>&6
4555 fi
4556
4557 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4558   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4559 echo "configure:4560: checking for \"-z ignore\" linker flag" >&5
4560   case "`ld -h 2>&1`" in
4561     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4562       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4563     *) echo "$ac_t""no" 1>&6 ;;
4564   esac
4565 fi
4566
4567
4568 echo "checking "for specified window system"" 1>&6
4569 echo "configure:4570: checking "for specified window system"" >&5
4570
4571 if test "$with_x11" != "no"; then
4572     test "$x_includes $x_libraries" != "NONE NONE" && \
4573    window_system=x11 with_x11=yes
4574
4575         
4576       if test "$x_includes $x_libraries" = "NONE NONE" \
4577     -a -n "$OPENWINHOME" \
4578     -a "$OPENWINHOME" != "/usr/openwin" \
4579     -a -d "$OPENWINHOME"; then
4580       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4581       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4582       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4583   fi
4584
4585   if test "$x_includes" = "NONE"; then
4586                     for dir in "/usr/X11" "/usr/X11R6"; do
4587       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4588     done
4589   fi
4590
4591   if test "$x_libraries" = "NONE"; then
4592     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4593       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4594     done
4595   fi
4596
4597   # If we find X, set shell vars x_includes and x_libraries to the
4598 # paths, otherwise set no_x=yes.
4599 # Uses ac_ vars as temps to allow command line to override cache and checks.
4600 # --without-x overrides everything else, but does not touch the cache.
4601 echo $ac_n "checking for X""... $ac_c" 1>&6
4602 echo "configure:4603: checking for X" >&5
4603
4604 # Check whether --with-x or --without-x was given.
4605 if test "${with_x+set}" = set; then
4606   withval="$with_x"
4607   :
4608 fi
4609
4610 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4611 if test "x$with_x" = xno; then
4612   # The user explicitly disabled X.
4613   have_x=disabled
4614 else
4615   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4616     # Both variables are already set.
4617     have_x=yes
4618   else
4619
4620 # One or both of the vars are not set, and there is no cached value.
4621 ac_x_includes=NO ac_x_libraries=NO
4622 rm -fr conftestdir
4623 if mkdir conftestdir; then
4624   cd conftestdir
4625   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4626   cat > Imakefile <<'EOF'
4627 acfindx:
4628         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4629 EOF
4630   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4631     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4632     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4633     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4634     for ac_extension in a so sl; do
4635       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4636         test -f $ac_im_libdir/libX11.$ac_extension; then
4637         ac_im_usrlibdir=$ac_im_libdir; break
4638       fi
4639     done
4640     # Screen out bogus values from the imake configuration.  They are
4641     # bogus both because they are the default anyway, and because
4642     # using them would break gcc on systems where it needs fixed includes.
4643     case "$ac_im_incroot" in
4644         /usr/include) ;;
4645         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4646     esac
4647     case "$ac_im_usrlibdir" in
4648         /usr/lib | /lib) ;;
4649         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4650     esac
4651   fi
4652   cd ..
4653   rm -fr conftestdir
4654 fi
4655
4656 if test "$ac_x_includes" = NO; then
4657   # Guess where to find include files, by looking for this one X11 .h file.
4658   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4659
4660   # First, try using that file with no special directory specified.
4661 cat > conftest.$ac_ext <<EOF
4662 #line 4663 "configure"
4663 #include "confdefs.h"
4664 #include <$x_direct_test_include>
4665 EOF
4666 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4667 { (eval echo configure:4668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4668 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4669 if test -z "$ac_err"; then
4670   rm -rf conftest*
4671   # We can compile using X headers with no special include directory.
4672 ac_x_includes=
4673 else
4674   echo "$ac_err" >&5
4675   echo "configure: failed program was:" >&5
4676   cat conftest.$ac_ext >&5
4677   rm -rf conftest*
4678   # Look for the header file in a standard set of common directories.
4679 # Check X11 before X11Rn because it is often a symlink to the current release.
4680   for ac_dir in               \
4681     /usr/X11/include          \
4682     /usr/X11R6/include        \
4683     /usr/X11R5/include        \
4684     /usr/X11R4/include        \
4685                               \
4686     /usr/include/X11          \
4687     /usr/include/X11R6        \
4688     /usr/include/X11R5        \
4689     /usr/include/X11R4        \
4690                               \
4691     /usr/local/X11/include    \
4692     /usr/local/X11R6/include  \
4693     /usr/local/X11R5/include  \
4694     /usr/local/X11R4/include  \
4695                               \
4696     /usr/local/include/X11    \
4697     /usr/local/include/X11R6  \
4698     /usr/local/include/X11R5  \
4699     /usr/local/include/X11R4  \
4700                               \
4701     /usr/X386/include         \
4702     /usr/x386/include         \
4703     /usr/XFree86/include/X11  \
4704                               \
4705     /usr/include              \
4706     /usr/local/include        \
4707     /usr/unsupported/include  \
4708     /usr/athena/include       \
4709     /usr/local/x11r5/include  \
4710     /usr/lpp/Xamples/include  \
4711                               \
4712     /usr/openwin/include      \
4713     /usr/openwin/share/include \
4714     ; \
4715   do
4716     if test -r "$ac_dir/$x_direct_test_include"; then
4717       ac_x_includes=$ac_dir
4718       break
4719     fi
4720   done
4721 fi
4722 rm -f conftest*
4723 fi # $ac_x_includes = NO
4724
4725 if test "$ac_x_libraries" = NO; then
4726   # Check for the libraries.
4727
4728   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4729   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4730
4731   # See if we find them without any special options.
4732   # Don't add to $LIBS permanently.
4733   ac_save_LIBS="$LIBS"
4734   LIBS="-l$x_direct_test_library $LIBS"
4735 cat > conftest.$ac_ext <<EOF
4736 #line 4737 "configure"
4737 #include "confdefs.h"
4738
4739 int main() {
4740 ${x_direct_test_function}()
4741 ; return 0; }
4742 EOF
4743 if { (eval echo configure:4744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4744   rm -rf conftest*
4745   LIBS="$ac_save_LIBS"
4746 # We can link X programs with no special library path.
4747 ac_x_libraries=
4748 else
4749   echo "configure: failed program was:" >&5
4750   cat conftest.$ac_ext >&5
4751   rm -rf conftest*
4752   LIBS="$ac_save_LIBS"
4753 # First see if replacing the include by lib works.
4754 # Check X11 before X11Rn because it is often a symlink to the current release.
4755 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4756     /usr/X11/lib          \
4757     /usr/X11R6/lib        \
4758     /usr/X11R5/lib        \
4759     /usr/X11R4/lib        \
4760                           \
4761     /usr/lib/X11          \
4762     /usr/lib/X11R6        \
4763     /usr/lib/X11R5        \
4764     /usr/lib/X11R4        \
4765                           \
4766     /usr/local/X11/lib    \
4767     /usr/local/X11R6/lib  \
4768     /usr/local/X11R5/lib  \
4769     /usr/local/X11R4/lib  \
4770                           \
4771     /usr/local/lib/X11    \
4772     /usr/local/lib/X11R6  \
4773     /usr/local/lib/X11R5  \
4774     /usr/local/lib/X11R4  \
4775                           \
4776     /usr/X386/lib         \
4777     /usr/x386/lib         \
4778     /usr/XFree86/lib/X11  \
4779                           \
4780     /usr/lib              \
4781     /usr/local/lib        \
4782     /usr/unsupported/lib  \
4783     /usr/athena/lib       \
4784     /usr/local/x11r5/lib  \
4785     /usr/lpp/Xamples/lib  \
4786     /lib/usr/lib/X11      \
4787                           \
4788     /usr/openwin/lib      \
4789     /usr/openwin/share/lib \
4790     ; \
4791 do
4792   for ac_extension in a so sl; do
4793     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4794       ac_x_libraries=$ac_dir
4795       break 2
4796     fi
4797   done
4798 done
4799 fi
4800 rm -f conftest*
4801 fi # $ac_x_libraries = NO
4802
4803 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4804   # Didn't find X anywhere.  Cache the known absence of X.
4805   ac_cv_have_x="have_x=no"
4806 else
4807   # Record where we found X for the cache.
4808   ac_cv_have_x="have_x=yes \
4809                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4810 fi
4811   fi
4812   eval "$ac_cv_have_x"
4813 fi # $with_x != no
4814
4815 if test "$have_x" != yes; then
4816   echo "$ac_t""$have_x" 1>&6
4817   no_x=yes
4818 else
4819   # If each of the values was on the command line, it overrides each guess.
4820   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4821   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4822   # Update the cache value to reflect the command line values.
4823   ac_cv_have_x="have_x=yes \
4824                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4825   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4826 fi
4827
4828 if test "$no_x" = yes; then
4829   # Not all programs may use this symbol, but it does not hurt to define it.
4830   { test "$extra_verbose" = "yes" && cat << \EOF
4831     Defining X_DISPLAY_MISSING
4832 EOF
4833 cat >> confdefs.h <<\EOF
4834 #define X_DISPLAY_MISSING 1
4835 EOF
4836 }
4837
4838   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4839 else
4840   if test -n "$x_includes"; then
4841     X_CFLAGS="$X_CFLAGS -I$x_includes"
4842   fi
4843
4844   # It would also be nice to do this for all -L options, not just this one.
4845   if test -n "$x_libraries"; then
4846     X_LIBS="$X_LIBS -L$x_libraries"
4847     # For Solaris; some versions of Sun CC require a space after -R and
4848     # others require no space.  Words are not sufficient . . . .
4849     case "`(uname -sr) 2>/dev/null`" in
4850     "SunOS 5"*)
4851       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4852 echo "configure:4853: checking whether -R must be followed by a space" >&5
4853       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4854       cat > conftest.$ac_ext <<EOF
4855 #line 4856 "configure"
4856 #include "confdefs.h"
4857
4858 int main() {
4859
4860 ; return 0; }
4861 EOF
4862 if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4863   rm -rf conftest*
4864   ac_R_nospace=yes
4865 else
4866   echo "configure: failed program was:" >&5
4867   cat conftest.$ac_ext >&5
4868   rm -rf conftest*
4869   ac_R_nospace=no
4870 fi
4871 rm -f conftest*
4872       if test $ac_R_nospace = yes; then
4873         echo "$ac_t""no" 1>&6
4874         X_LIBS="$X_LIBS -R$x_libraries"
4875       else
4876         LIBS="$ac_xsave_LIBS -R $x_libraries"
4877         cat > conftest.$ac_ext <<EOF
4878 #line 4879 "configure"
4879 #include "confdefs.h"
4880
4881 int main() {
4882
4883 ; return 0; }
4884 EOF
4885 if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4886   rm -rf conftest*
4887   ac_R_space=yes
4888 else
4889   echo "configure: failed program was:" >&5
4890   cat conftest.$ac_ext >&5
4891   rm -rf conftest*
4892   ac_R_space=no
4893 fi
4894 rm -f conftest*
4895         if test $ac_R_space = yes; then
4896           echo "$ac_t""yes" 1>&6
4897           X_LIBS="$X_LIBS -R $x_libraries"
4898         else
4899           echo "$ac_t""neither works" 1>&6
4900         fi
4901       fi
4902       LIBS="$ac_xsave_LIBS"
4903     esac
4904   fi
4905
4906   # Check for system-dependent libraries X programs must link with.
4907   # Do this before checking for the system-independent R6 libraries
4908   # (-lICE), since we may need -lsocket or whatever for X linking.
4909
4910   if test "$ISC" = yes; then
4911     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4912   else
4913     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4914     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4915     # the Alpha needs dnet_stub (dnet does not exist).
4916     if test "$with_dnet" = "no" ; then
4917 ac_cv_lib_dnet_dnet_ntoa=no
4918 else
4919
4920 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4921 echo "configure:4922: checking for dnet_ntoa in -ldnet" >&5
4922 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4923
4924 xe_check_libs=" -ldnet "
4925 cat > conftest.$ac_ext <<EOF
4926 #line 4927 "configure"
4927 #include "confdefs.h"
4928 /* Override any gcc2 internal prototype to avoid an error.  */
4929 /* We use char because int might match the return type of a gcc2
4930     builtin and then its argument prototype would still apply.  */
4931 char dnet_ntoa();
4932
4933 int main() {
4934 dnet_ntoa()
4935 ; return 0; }
4936 EOF
4937 if { (eval echo configure:4938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4938   rm -rf conftest*
4939   eval "ac_cv_lib_$ac_lib_var=yes"
4940 else
4941   echo "configure: failed program was:" >&5
4942   cat conftest.$ac_ext >&5
4943   rm -rf conftest*
4944   eval "ac_cv_lib_$ac_lib_var=no"
4945 fi
4946 rm -f conftest*
4947 xe_check_libs=""
4948
4949 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4950   echo "$ac_t""yes" 1>&6
4951   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4952 else
4953   echo "$ac_t""no" 1>&6
4954 fi
4955
4956 fi
4957
4958     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4959       
4960 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4961 echo "configure:4962: checking for dnet_ntoa in -ldnet_stub" >&5
4962 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4963
4964 xe_check_libs=" -ldnet_stub "
4965 cat > conftest.$ac_ext <<EOF
4966 #line 4967 "configure"
4967 #include "confdefs.h"
4968 /* Override any gcc2 internal prototype to avoid an error.  */
4969 /* We use char because int might match the return type of a gcc2
4970     builtin and then its argument prototype would still apply.  */
4971 char dnet_ntoa();
4972
4973 int main() {
4974 dnet_ntoa()
4975 ; return 0; }
4976 EOF
4977 if { (eval echo configure:4978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4978   rm -rf conftest*
4979   eval "ac_cv_lib_$ac_lib_var=yes"
4980 else
4981   echo "configure: failed program was:" >&5
4982   cat conftest.$ac_ext >&5
4983   rm -rf conftest*
4984   eval "ac_cv_lib_$ac_lib_var=no"
4985 fi
4986 rm -f conftest*
4987 xe_check_libs=""
4988
4989 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4990   echo "$ac_t""yes" 1>&6
4991   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4992 else
4993   echo "$ac_t""no" 1>&6
4994 fi
4995
4996
4997     fi
4998
4999     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
5000     # to get the SysV transport functions.
5001     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5002     # needs -lnsl.
5003     # The nsl library prevents programs from opening the X display
5004     # on Irix 5.2, according to dickey@clark.net.
5005     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5006 echo "configure:5007: checking for gethostbyname" >&5
5007
5008 cat > conftest.$ac_ext <<EOF
5009 #line 5010 "configure"
5010 #include "confdefs.h"
5011 /* System header to define __stub macros and hopefully few prototypes,
5012     which can conflict with char gethostbyname(); below.  */
5013 #include <assert.h>
5014 /* Override any gcc2 internal prototype to avoid an error.  */
5015 /* We use char because int might match the return type of a gcc2
5016     builtin and then its argument prototype would still apply.  */
5017 char gethostbyname();
5018
5019 int main() {
5020
5021 /* The GNU C library defines this for functions which it implements
5022     to always fail with ENOSYS.  Some functions are actually named
5023     something starting with __ and the normal name is an alias.  */
5024 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5025 choke me
5026 #else
5027 gethostbyname();
5028 #endif
5029
5030 ; return 0; }
5031 EOF
5032 if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5033   rm -rf conftest*
5034   eval "ac_cv_func_gethostbyname=yes"
5035 else
5036   echo "configure: failed program was:" >&5
5037   cat conftest.$ac_ext >&5
5038   rm -rf conftest*
5039   eval "ac_cv_func_gethostbyname=no"
5040 fi
5041 rm -f conftest*
5042
5043 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5044   echo "$ac_t""yes" 1>&6
5045   :
5046 else
5047   echo "$ac_t""no" 1>&6
5048 fi
5049
5050     if test $ac_cv_func_gethostbyname = no; then
5051       
5052 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5053 echo "configure:5054: checking for gethostbyname in -lnsl" >&5
5054 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5055
5056 xe_check_libs=" -lnsl "
5057 cat > conftest.$ac_ext <<EOF
5058 #line 5059 "configure"
5059 #include "confdefs.h"
5060 /* Override any gcc2 internal prototype to avoid an error.  */
5061 /* We use char because int might match the return type of a gcc2
5062     builtin and then its argument prototype would still apply.  */
5063 char gethostbyname();
5064
5065 int main() {
5066 gethostbyname()
5067 ; return 0; }
5068 EOF
5069 if { (eval echo configure:5070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5070   rm -rf conftest*
5071   eval "ac_cv_lib_$ac_lib_var=yes"
5072 else
5073   echo "configure: failed program was:" >&5
5074   cat conftest.$ac_ext >&5
5075   rm -rf conftest*
5076   eval "ac_cv_lib_$ac_lib_var=no"
5077 fi
5078 rm -f conftest*
5079 xe_check_libs=""
5080
5081 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5082   echo "$ac_t""yes" 1>&6
5083   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5084 else
5085   echo "$ac_t""no" 1>&6
5086 fi
5087
5088
5089     fi
5090
5091     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5092     # socket/setsockopt and other routines are undefined under SCO ODT
5093     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5094     # on later versions), says simon@lia.di.epfl.ch: it contains
5095     # gethostby* variants that don't use the nameserver (or something).
5096     # -lsocket must be given before -lnsl if both are needed.
5097     # We assume that if connect needs -lnsl, so does gethostbyname.
5098     echo $ac_n "checking for connect""... $ac_c" 1>&6
5099 echo "configure:5100: checking for connect" >&5
5100
5101 cat > conftest.$ac_ext <<EOF
5102 #line 5103 "configure"
5103 #include "confdefs.h"
5104 /* System header to define __stub macros and hopefully few prototypes,
5105     which can conflict with char connect(); below.  */
5106 #include <assert.h>
5107 /* Override any gcc2 internal prototype to avoid an error.  */
5108 /* We use char because int might match the return type of a gcc2
5109     builtin and then its argument prototype would still apply.  */
5110 char connect();
5111
5112 int main() {
5113
5114 /* The GNU C library defines this for functions which it implements
5115     to always fail with ENOSYS.  Some functions are actually named
5116     something starting with __ and the normal name is an alias.  */
5117 #if defined (__stub_connect) || defined (__stub___connect)
5118 choke me
5119 #else
5120 connect();
5121 #endif
5122
5123 ; return 0; }
5124 EOF
5125 if { (eval echo configure:5126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5126   rm -rf conftest*
5127   eval "ac_cv_func_connect=yes"
5128 else
5129   echo "configure: failed program was:" >&5
5130   cat conftest.$ac_ext >&5
5131   rm -rf conftest*
5132   eval "ac_cv_func_connect=no"
5133 fi
5134 rm -f conftest*
5135
5136 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5137   echo "$ac_t""yes" 1>&6
5138   :
5139 else
5140   echo "$ac_t""no" 1>&6
5141 fi
5142
5143     if test $ac_cv_func_connect = no; then
5144       
5145 xe_msg_checking="for connect in -lsocket"
5146 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5147 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5148 echo "configure:5149: checking "$xe_msg_checking"" >&5
5149 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5150
5151 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5152 cat > conftest.$ac_ext <<EOF
5153 #line 5154 "configure"
5154 #include "confdefs.h"
5155 /* Override any gcc2 internal prototype to avoid an error.  */
5156 /* We use char because int might match the return type of a gcc2
5157     builtin and then its argument prototype would still apply.  */
5158 char connect();
5159
5160 int main() {
5161 connect()
5162 ; return 0; }
5163 EOF
5164 if { (eval echo configure:5165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5165   rm -rf conftest*
5166   eval "ac_cv_lib_$ac_lib_var=yes"
5167 else
5168   echo "configure: failed program was:" >&5
5169   cat conftest.$ac_ext >&5
5170   rm -rf conftest*
5171   eval "ac_cv_lib_$ac_lib_var=no"
5172 fi
5173 rm -f conftest*
5174 xe_check_libs=""
5175
5176 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5177   echo "$ac_t""yes" 1>&6
5178   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5179 else
5180   echo "$ac_t""no" 1>&6
5181 fi
5182
5183
5184     fi
5185
5186     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5187     echo $ac_n "checking for remove""... $ac_c" 1>&6
5188 echo "configure:5189: checking for remove" >&5
5189
5190 cat > conftest.$ac_ext <<EOF
5191 #line 5192 "configure"
5192 #include "confdefs.h"
5193 /* System header to define __stub macros and hopefully few prototypes,
5194     which can conflict with char remove(); below.  */
5195 #include <assert.h>
5196 /* Override any gcc2 internal prototype to avoid an error.  */
5197 /* We use char because int might match the return type of a gcc2
5198     builtin and then its argument prototype would still apply.  */
5199 char remove();
5200
5201 int main() {
5202
5203 /* The GNU C library defines this for functions which it implements
5204     to always fail with ENOSYS.  Some functions are actually named
5205     something starting with __ and the normal name is an alias.  */
5206 #if defined (__stub_remove) || defined (__stub___remove)
5207 choke me
5208 #else
5209 remove();
5210 #endif
5211
5212 ; return 0; }
5213 EOF
5214 if { (eval echo configure:5215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5215   rm -rf conftest*
5216   eval "ac_cv_func_remove=yes"
5217 else
5218   echo "configure: failed program was:" >&5
5219   cat conftest.$ac_ext >&5
5220   rm -rf conftest*
5221   eval "ac_cv_func_remove=no"
5222 fi
5223 rm -f conftest*
5224
5225 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5226   echo "$ac_t""yes" 1>&6
5227   :
5228 else
5229   echo "$ac_t""no" 1>&6
5230 fi
5231
5232     if test $ac_cv_func_remove = no; then
5233       
5234 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5235 echo "configure:5236: checking for remove in -lposix" >&5
5236 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5237
5238 xe_check_libs=" -lposix "
5239 cat > conftest.$ac_ext <<EOF
5240 #line 5241 "configure"
5241 #include "confdefs.h"
5242 /* Override any gcc2 internal prototype to avoid an error.  */
5243 /* We use char because int might match the return type of a gcc2
5244     builtin and then its argument prototype would still apply.  */
5245 char remove();
5246
5247 int main() {
5248 remove()
5249 ; return 0; }
5250 EOF
5251 if { (eval echo configure:5252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5252   rm -rf conftest*
5253   eval "ac_cv_lib_$ac_lib_var=yes"
5254 else
5255   echo "configure: failed program was:" >&5
5256   cat conftest.$ac_ext >&5
5257   rm -rf conftest*
5258   eval "ac_cv_lib_$ac_lib_var=no"
5259 fi
5260 rm -f conftest*
5261 xe_check_libs=""
5262
5263 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5264   echo "$ac_t""yes" 1>&6
5265   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5266 else
5267   echo "$ac_t""no" 1>&6
5268 fi
5269
5270
5271     fi
5272
5273     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5274     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5275 echo "configure:5276: checking for shmat" >&5
5276
5277 cat > conftest.$ac_ext <<EOF
5278 #line 5279 "configure"
5279 #include "confdefs.h"
5280 /* System header to define __stub macros and hopefully few prototypes,
5281     which can conflict with char shmat(); below.  */
5282 #include <assert.h>
5283 /* Override any gcc2 internal prototype to avoid an error.  */
5284 /* We use char because int might match the return type of a gcc2
5285     builtin and then its argument prototype would still apply.  */
5286 char shmat();
5287
5288 int main() {
5289
5290 /* The GNU C library defines this for functions which it implements
5291     to always fail with ENOSYS.  Some functions are actually named
5292     something starting with __ and the normal name is an alias.  */
5293 #if defined (__stub_shmat) || defined (__stub___shmat)
5294 choke me
5295 #else
5296 shmat();
5297 #endif
5298
5299 ; return 0; }
5300 EOF
5301 if { (eval echo configure:5302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5302   rm -rf conftest*
5303   eval "ac_cv_func_shmat=yes"
5304 else
5305   echo "configure: failed program was:" >&5
5306   cat conftest.$ac_ext >&5
5307   rm -rf conftest*
5308   eval "ac_cv_func_shmat=no"
5309 fi
5310 rm -f conftest*
5311
5312 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5313   echo "$ac_t""yes" 1>&6
5314   :
5315 else
5316   echo "$ac_t""no" 1>&6
5317 fi
5318
5319     if test $ac_cv_func_shmat = no; then
5320       
5321 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5322 echo "configure:5323: checking for shmat in -lipc" >&5
5323 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5324
5325 xe_check_libs=" -lipc "
5326 cat > conftest.$ac_ext <<EOF
5327 #line 5328 "configure"
5328 #include "confdefs.h"
5329 /* Override any gcc2 internal prototype to avoid an error.  */
5330 /* We use char because int might match the return type of a gcc2
5331     builtin and then its argument prototype would still apply.  */
5332 char shmat();
5333
5334 int main() {
5335 shmat()
5336 ; return 0; }
5337 EOF
5338 if { (eval echo configure:5339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5339   rm -rf conftest*
5340   eval "ac_cv_lib_$ac_lib_var=yes"
5341 else
5342   echo "configure: failed program was:" >&5
5343   cat conftest.$ac_ext >&5
5344   rm -rf conftest*
5345   eval "ac_cv_lib_$ac_lib_var=no"
5346 fi
5347 rm -f conftest*
5348 xe_check_libs=""
5349
5350 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5351   echo "$ac_t""yes" 1>&6
5352   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5353 else
5354   echo "$ac_t""no" 1>&6
5355 fi
5356
5357
5358     fi
5359   fi
5360
5361   # Check for libraries that X11R6 Xt/Xaw programs need.
5362   ac_save_LDFLAGS="$LDFLAGS"
5363   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5364   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5365   # check for ICE first), but we must link in the order -lSM -lICE or
5366   # we get undefined symbols.  So assume we have SM if we have ICE.
5367   # These have to be linked with before -lX11, unlike the other
5368   # libraries we check for below, so use a different variable.
5369   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5370   
5371 xe_msg_checking="for IceConnectionNumber in -lICE"
5372 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5373 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5374 echo "configure:5375: checking "$xe_msg_checking"" >&5
5375 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5376
5377 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5378 cat > conftest.$ac_ext <<EOF
5379 #line 5380 "configure"
5380 #include "confdefs.h"
5381 /* Override any gcc2 internal prototype to avoid an error.  */
5382 /* We use char because int might match the return type of a gcc2
5383     builtin and then its argument prototype would still apply.  */
5384 char IceConnectionNumber();
5385
5386 int main() {
5387 IceConnectionNumber()
5388 ; return 0; }
5389 EOF
5390 if { (eval echo configure:5391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5391   rm -rf conftest*
5392   eval "ac_cv_lib_$ac_lib_var=yes"
5393 else
5394   echo "configure: failed program was:" >&5
5395   cat conftest.$ac_ext >&5
5396   rm -rf conftest*
5397   eval "ac_cv_lib_$ac_lib_var=no"
5398 fi
5399 rm -f conftest*
5400 xe_check_libs=""
5401
5402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5403   echo "$ac_t""yes" 1>&6
5404   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5405 else
5406   echo "$ac_t""no" 1>&6
5407 fi
5408
5409
5410   LDFLAGS="$ac_save_LDFLAGS"
5411
5412 fi
5413  # Autoconf claims to find X library and include dirs for us.
5414   if test "$no_x" = "yes"
5415   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5416   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5417   fi
5418 fi
5419
5420 case "$with_x11" in
5421   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5422   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5423 esac
5424
5425 if test "$with_x11" = "yes"; then
5426   { test "$extra_verbose" = "yes" && cat << \EOF
5427     Defining HAVE_X_WINDOWS
5428 EOF
5429 cat >> confdefs.h <<\EOF
5430 #define HAVE_X_WINDOWS 1
5431 EOF
5432 }
5433
5434   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5435   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5436
5437       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5438     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5439     if test -d "$lib_dir" -a -d "$inc_dir"; then
5440       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5441         x_libraries="$lib_dir $x_libraries"
5442         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5443       esac
5444       case "$x_includes" in "$inc_dir"* ) ;; *)
5445         x_includes="$inc_dir $x_includes"
5446         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5447       esac
5448       break;       fi
5449   done
5450
5451     for rel in "X11R6" "X11R5" "X11R4"; do
5452     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5453     if test -d "$lib_dir" -a -d "$inc_dir"; then
5454       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5455         x_libraries="$x_libraries $lib_dir"
5456         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5457       esac
5458       case "$x_includes" in "$inc_dir"* ) ;; *)
5459         x_includes="$x_includes $inc_dir"
5460         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5461       esac
5462       break;     fi
5463   done
5464
5465     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
5466
5467   ld_switch_x_site="$X_LIBS"
5468
5469   
5470 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5471     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5472   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5473   
5474         runpath="" runpath_dirs=""
5475   if test -n "$LD_RUN_PATH"; then
5476     runpath="$LD_RUN_PATH"
5477   elif test "$GCC" = "yes"; then
5478         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5479     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5480     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5481     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5482       case "$arg" in P,* | -L* | -R* )
5483         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5484           {
5485 xe_runpath_dir="$dir"
5486   test "$xe_runpath_dir" != "/lib"     -a \
5487         "$xe_runpath_dir" != "/usr/lib" -a \
5488         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5489   eval "$xe_add_unique_runpath_dir"
5490 }
5491         done ;;
5492       esac
5493     done
5494     ld_switch_run="$ld_switch_run_save"
5495     rm -f conftest*
5496   else
5497         for arg in $ld_switch_site $ld_switch_x_site; do
5498       case "$arg" in -L*) {
5499 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5500   test "$xe_runpath_dir" != "/lib"     -a \
5501         "$xe_runpath_dir" != "/usr/lib" -a \
5502         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5503   eval "$xe_add_unique_runpath_dir"
5504 };; esac
5505     done
5506         if test "$opsys $need_motif" = "sol2 yes"; then
5507       xe_runpath_dir="/opt/SUNWdt/lib";
5508       eval "$xe_add_unique_runpath_dir";
5509     fi
5510   fi 
5511   if test -n "$runpath"; then
5512     ld_switch_run="${dash_r}${runpath}"
5513     
5514 if test "$GCC" = "yes"; then
5515   set x $ld_switch_run; shift; ld_switch_run=""
5516   while test -n "$1"; do
5517     case $1 in
5518       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5519       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5520       -Xlinker* ) ;;
5521       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5522     esac
5523     shift
5524   done
5525 fi
5526     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5527   fi
5528 fi
5529
5530
5531   if test "$extra_verbose" = "yes"; then
5532     echo; echo "X11 compilation variables:"
5533     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5534     echo
5535   fi
5536
5537             bitmapdirs=
5538   if test "$x_includes" != NONE; then
5539     for i in $x_includes; do
5540       if test -d "$i/bitmaps"; then
5541         bitmapdirs="$i/bitmaps:$bitmapdirs"
5542       fi
5543       if test -d "$i/X11/bitmaps"; then
5544         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5545       fi
5546     done
5547     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5548   fi
5549   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5550     Defining BITMAPDIR = "$bitmapdirs"
5551 EOF
5552 cat >> confdefs.h <<EOF
5553 #define BITMAPDIR "$bitmapdirs"
5554 EOF
5555 }
5556
5557
5558     echo "checking for X defines extracted by xmkmf" 1>&6
5559 echo "configure:5560: checking for X defines extracted by xmkmf" >&5
5560   rm -fr conftestdir
5561   if mkdir conftestdir; then
5562     cd conftestdir
5563     cat > Imakefile <<'EOF'
5564 xetest:
5565         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5566 EOF
5567     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5568       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5569       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5570     fi
5571     cd ..
5572     rm -fr conftestdir
5573     for word in $xmkmf_defines; do
5574       case "$word" in
5575         -D*=* ) ;;
5576         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5577               { test "$extra_verbose" = "yes" && cat << EOF
5578     Defining $word
5579 EOF
5580 cat >> confdefs.h <<EOF
5581 #define $word 1
5582 EOF
5583 }
5584  ;;
5585       esac
5586     done
5587   fi
5588
5589     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5590 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5591 echo "configure:5592: checking for X11/Intrinsic.h" >&5
5592
5593 cat > conftest.$ac_ext <<EOF
5594 #line 5595 "configure"
5595 #include "confdefs.h"
5596 #include <X11/Intrinsic.h>
5597 EOF
5598 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5599 { (eval echo configure:5600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5600 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5601 if test -z "$ac_err"; then
5602   rm -rf conftest*
5603   eval "ac_cv_header_$ac_safe=yes"
5604 else
5605   echo "$ac_err" >&5
5606   echo "configure: failed program was:" >&5
5607   cat conftest.$ac_ext >&5
5608   rm -rf conftest*
5609   eval "ac_cv_header_$ac_safe=no"
5610 fi
5611 rm -f conftest*
5612 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5613   echo "$ac_t""yes" 1>&6
5614   :
5615 else
5616   echo "$ac_t""no" 1>&6
5617 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5618 fi
5619
5620
5621       
5622 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5623 echo "configure:5624: checking for XOpenDisplay in -lX11" >&5
5624 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5625
5626 xe_check_libs=" -lX11 "
5627 cat > conftest.$ac_ext <<EOF
5628 #line 5629 "configure"
5629 #include "confdefs.h"
5630 /* Override any gcc2 internal prototype to avoid an error.  */
5631 /* We use char because int might match the return type of a gcc2
5632     builtin and then its argument prototype would still apply.  */
5633 char XOpenDisplay();
5634
5635 int main() {
5636 XOpenDisplay()
5637 ; return 0; }
5638 EOF
5639 if { (eval echo configure:5640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5640   rm -rf conftest*
5641   eval "ac_cv_lib_$ac_lib_var=yes"
5642 else
5643   echo "configure: failed program was:" >&5
5644   cat conftest.$ac_ext >&5
5645   rm -rf conftest*
5646   eval "ac_cv_lib_$ac_lib_var=no"
5647 fi
5648 rm -f conftest*
5649 xe_check_libs=""
5650
5651 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5652   echo "$ac_t""yes" 1>&6
5653   have_lib_x11=yes
5654 else
5655   echo "$ac_t""no" 1>&6
5656 fi
5657
5658
5659   if test "$have_lib_x11" != "yes"; then
5660     
5661 xe_msg_checking="for XGetFontProperty in -lX11"
5662 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5663 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5664 echo "configure:5665: checking "$xe_msg_checking"" >&5
5665 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5666
5667 xe_check_libs=" -lX11 -b i486-linuxaout"
5668 cat > conftest.$ac_ext <<EOF
5669 #line 5670 "configure"
5670 #include "confdefs.h"
5671 /* Override any gcc2 internal prototype to avoid an error.  */
5672 /* We use char because int might match the return type of a gcc2
5673     builtin and then its argument prototype would still apply.  */
5674 char XGetFontProperty();
5675
5676 int main() {
5677 XGetFontProperty()
5678 ; return 0; }
5679 EOF
5680 if { (eval echo configure:5681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5681   rm -rf conftest*
5682   eval "ac_cv_lib_$ac_lib_var=yes"
5683 else
5684   echo "configure: failed program was:" >&5
5685   cat conftest.$ac_ext >&5
5686   rm -rf conftest*
5687   eval "ac_cv_lib_$ac_lib_var=no"
5688 fi
5689 rm -f conftest*
5690 xe_check_libs=""
5691
5692 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5693   echo "$ac_t""yes" 1>&6
5694   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5695 else
5696   echo "$ac_t""no" 1>&6
5697 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5698 fi
5699
5700
5701   fi
5702   libs_x="-lX11"
5703   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5704
5705     
5706 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5707 echo "configure:5708: checking for XShapeSelectInput in -lXext" >&5
5708 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5709
5710 xe_check_libs=" -lXext "
5711 cat > conftest.$ac_ext <<EOF
5712 #line 5713 "configure"
5713 #include "confdefs.h"
5714 /* Override any gcc2 internal prototype to avoid an error.  */
5715 /* We use char because int might match the return type of a gcc2
5716     builtin and then its argument prototype would still apply.  */
5717 char XShapeSelectInput();
5718
5719 int main() {
5720 XShapeSelectInput()
5721 ; return 0; }
5722 EOF
5723 if { (eval echo configure:5724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5724   rm -rf conftest*
5725   eval "ac_cv_lib_$ac_lib_var=yes"
5726 else
5727   echo "configure: failed program was:" >&5
5728   cat conftest.$ac_ext >&5
5729   rm -rf conftest*
5730   eval "ac_cv_lib_$ac_lib_var=no"
5731 fi
5732 rm -f conftest*
5733 xe_check_libs=""
5734
5735 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5736   echo "$ac_t""yes" 1>&6
5737   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5738 else
5739   echo "$ac_t""no" 1>&6
5740 fi
5741
5742
5743
5744     
5745 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5746 echo "configure:5747: checking for XtOpenDisplay in -lXt" >&5
5747 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5748
5749 xe_check_libs=" -lXt "
5750 cat > conftest.$ac_ext <<EOF
5751 #line 5752 "configure"
5752 #include "confdefs.h"
5753 /* Override any gcc2 internal prototype to avoid an error.  */
5754 /* We use char because int might match the return type of a gcc2
5755     builtin and then its argument prototype would still apply.  */
5756 char XtOpenDisplay();
5757
5758 int main() {
5759 XtOpenDisplay()
5760 ; return 0; }
5761 EOF
5762 if { (eval echo configure:5763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5763   rm -rf conftest*
5764   eval "ac_cv_lib_$ac_lib_var=yes"
5765 else
5766   echo "configure: failed program was:" >&5
5767   cat conftest.$ac_ext >&5
5768   rm -rf conftest*
5769   eval "ac_cv_lib_$ac_lib_var=no"
5770 fi
5771 rm -f conftest*
5772 xe_check_libs=""
5773
5774 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5775   echo "$ac_t""yes" 1>&6
5776   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5777 else
5778   echo "$ac_t""no" 1>&6
5779 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5780 fi
5781
5782
5783
5784   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5785 echo "configure:5786: checking the version of X11 being used" >&5
5786   cat > conftest.$ac_ext <<EOF
5787 #line 5788 "configure"
5788 #include "confdefs.h"
5789 #include <X11/Intrinsic.h>
5790     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5791 EOF
5792 if { (eval echo configure:5793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5793 then
5794   ./conftest foobar; x11_release=$?
5795 else
5796   conftest_rc="$?"
5797   echo "configure: failed program was:" >&5
5798   cat conftest.$ac_ext >&5
5799   rm -fr conftest*
5800   x11_release=4
5801 fi
5802 rm -fr conftest*
5803   echo "$ac_t""R${x11_release}" 1>&6
5804   { test "$extra_verbose" = "yes" && cat << EOF
5805     Defining THIS_IS_X11R${x11_release}
5806 EOF
5807 cat >> confdefs.h <<EOF
5808 #define THIS_IS_X11R${x11_release} 1
5809 EOF
5810 }
5811
5812
5813   for ac_hdr in X11/Xlocale.h
5814 do
5815 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5816 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5817 echo "configure:5818: checking for $ac_hdr" >&5
5818
5819 cat > conftest.$ac_ext <<EOF
5820 #line 5821 "configure"
5821 #include "confdefs.h"
5822 #include <$ac_hdr>
5823 EOF
5824 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5825 { (eval echo configure:5826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5826 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5827 if test -z "$ac_err"; then
5828   rm -rf conftest*
5829   eval "ac_cv_header_$ac_safe=yes"
5830 else
5831   echo "$ac_err" >&5
5832   echo "configure: failed program was:" >&5
5833   cat conftest.$ac_ext >&5
5834   rm -rf conftest*
5835   eval "ac_cv_header_$ac_safe=no"
5836 fi
5837 rm -f conftest*
5838 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5839   echo "$ac_t""yes" 1>&6
5840     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5841   { test "$extra_verbose" = "yes" && cat << EOF
5842     Defining $ac_tr_hdr
5843 EOF
5844 cat >> confdefs.h <<EOF
5845 #define $ac_tr_hdr 1
5846 EOF
5847 }
5848  
5849 else
5850   echo "$ac_t""no" 1>&6
5851 fi
5852 done
5853
5854
5855     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5856 echo "configure:5857: checking for XFree86" >&5
5857   if test -d "/usr/X386/include" -o \
5858           -f "/etc/XF86Config"    -o \
5859           -f "/etc/X11/XF86Config" -o \
5860           -f "/usr/X11R6/lib/X11/XF86Config"; then
5861     echo "$ac_t""yes" 1>&6
5862     { test "$extra_verbose" = "yes" && cat << \EOF
5863     Defining HAVE_XFREE386
5864 EOF
5865 cat >> confdefs.h <<\EOF
5866 #define HAVE_XFREE386 1
5867 EOF
5868 }
5869
5870   else
5871     echo "$ac_t""no" 1>&6
5872   fi
5873
5874     test -z "$with_xmu" && { 
5875 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5876 echo "configure:5877: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5877 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5878
5879 xe_check_libs=" -lXmu "
5880 cat > conftest.$ac_ext <<EOF
5881 #line 5882 "configure"
5882 #include "confdefs.h"
5883 /* Override any gcc2 internal prototype to avoid an error.  */
5884 /* We use char because int might match the return type of a gcc2
5885     builtin and then its argument prototype would still apply.  */
5886 char XmuReadBitmapDataFromFile();
5887
5888 int main() {
5889 XmuReadBitmapDataFromFile()
5890 ; return 0; }
5891 EOF
5892 if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5893   rm -rf conftest*
5894   eval "ac_cv_lib_$ac_lib_var=yes"
5895 else
5896   echo "configure: failed program was:" >&5
5897   cat conftest.$ac_ext >&5
5898   rm -rf conftest*
5899   eval "ac_cv_lib_$ac_lib_var=no"
5900 fi
5901 rm -f conftest*
5902 xe_check_libs=""
5903
5904 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5905   echo "$ac_t""yes" 1>&6
5906   with_xmu=yes
5907 else
5908   echo "$ac_t""no" 1>&6
5909 with_xmu=no
5910 fi
5911
5912  }
5913   if test "$with_xmu" = "no"; then
5914     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5915    echo "    xemacs will be linked with \"xmu.o\""
5916  fi
5917   else
5918     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5919     { test "$extra_verbose" = "yes" && cat << \EOF
5920     Defining HAVE_XMU
5921 EOF
5922 cat >> confdefs.h <<\EOF
5923 #define HAVE_XMU 1
5924 EOF
5925 }
5926
5927   fi
5928
5929       
5930 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5931 echo "configure:5932: checking for main in -lXbsd" >&5
5932 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5933
5934 xe_check_libs=" -lXbsd "
5935 cat > conftest.$ac_ext <<EOF
5936 #line 5937 "configure"
5937 #include "confdefs.h"
5938
5939 int main() {
5940 main()
5941 ; return 0; }
5942 EOF
5943 if { (eval echo configure:5944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5944   rm -rf conftest*
5945   eval "ac_cv_lib_$ac_lib_var=yes"
5946 else
5947   echo "configure: failed program was:" >&5
5948   cat conftest.$ac_ext >&5
5949   rm -rf conftest*
5950   eval "ac_cv_lib_$ac_lib_var=no"
5951 fi
5952 rm -f conftest*
5953 xe_check_libs=""
5954
5955 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5956   echo "$ac_t""yes" 1>&6
5957   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5958 else
5959   echo "$ac_t""no" 1>&6
5960 fi
5961
5962
5963
5964     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5965         if test "$GCC" = "yes"; then
5966       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5967       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5968     else
5969       case "$CC" in
5970         "xlc" ) CC="xlc_r" ;;
5971         "xlC" ) CC="xlC_r" ;;
5972         "cc"  ) CC="cc_r" ;;
5973       esac
5974     fi
5975   fi
5976
5977 fi 
5978 if test "$with_msw" != "no"; then
5979   echo "checking for MS-Windows" 1>&6
5980 echo "configure:5981: checking for MS-Windows" >&5
5981   
5982 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5983 echo "configure:5984: checking for main in -lgdi32" >&5
5984 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5985
5986 xe_check_libs=" -lgdi32 "
5987 cat > conftest.$ac_ext <<EOF
5988 #line 5989 "configure"
5989 #include "confdefs.h"
5990
5991 int main() {
5992 main()
5993 ; return 0; }
5994 EOF
5995 if { (eval echo configure:5996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5996   rm -rf conftest*
5997   eval "ac_cv_lib_$ac_lib_var=yes"
5998 else
5999   echo "configure: failed program was:" >&5
6000   cat conftest.$ac_ext >&5
6001   rm -rf conftest*
6002   eval "ac_cv_lib_$ac_lib_var=no"
6003 fi
6004 rm -f conftest*
6005 xe_check_libs=""
6006
6007 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6008   echo "$ac_t""yes" 1>&6
6009   with_msw=yes
6010 else
6011   echo "$ac_t""no" 1>&6
6012 fi
6013
6014
6015   if test "$with_msw" = "yes"; then
6016     { test "$extra_verbose" = "yes" && cat << \EOF
6017     Defining HAVE_MS_WINDOWS
6018 EOF
6019 cat >> confdefs.h <<\EOF
6020 #define HAVE_MS_WINDOWS 1
6021 EOF
6022 }
6023
6024     install_pp="$blddir/lib-src/installexe.sh"
6025     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
6026     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6027     if test "$window_system" != x11; then
6028         window_system=msw
6029         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6030             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6031    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6032  fi
6033         test "$with_menubars"   != "no" && with_menubars=msw \
6034             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6035    echo "    xemacs will be linked with \"menubar-msw.o\""
6036  fi
6037         test "$with_toolbars"   != "no" && with_toolbars=msw \
6038             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6039    echo "    xemacs will be linked with \"toolbar-msw.o\""
6040  fi
6041         test "$with_dialogs"   != "no" && with_dialogs=msw \
6042             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6043    echo "    xemacs will be linked with \"dialog-msw.o\""
6044  fi
6045     else
6046         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6047    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6048  fi
6049         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6050    echo "    xemacs will be linked with \"menubar-msw.o\""
6051  fi
6052         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6053    echo "    xemacs will be linked with \"toolbar-msw.o\""
6054  fi
6055         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6056    echo "    xemacs will be linked with \"dialog-msw.o\""
6057  fi
6058     fi
6059         cat > conftest.$ac_ext <<EOF
6060 #line 6061 "configure"
6061 #include "confdefs.h"
6062 #include <fcntl.h>
6063     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6064 EOF
6065 if { (eval echo configure:6066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6066 then
6067   { test "$extra_verbose" = "yes" && cat << \EOF
6068     Defining HAVE_MSG_SELECT
6069 EOF
6070 cat >> confdefs.h <<\EOF
6071 #define HAVE_MSG_SELECT 1
6072 EOF
6073 }
6074
6075 else
6076   conftest_rc="$?"
6077   echo "configure: failed program was:" >&5
6078   cat conftest.$ac_ext >&5
6079 fi
6080 rm -fr conftest*
6081     const_is_losing=no
6082     with_file_coding=yes
6083     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
6084    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\""
6085  fi
6086   fi
6087 fi
6088
6089
6090
6091 test -z "$window_system" && window_system="none"
6092
6093 if test "$window_system" = "none"; then
6094   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6095   do
6096     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6097        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6098     fi
6099     eval "with_${feature}=no"
6100   done
6101 else
6102   test -z "$with_toolbars" && with_toolbars=yes
6103 fi
6104
6105 if test "$with_msw" != "yes"; then
6106   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6107   do
6108     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6109        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6110     fi
6111     eval "with_${feature}=no"
6112   done
6113 else
6114   :
6115 fi
6116
6117 if test "$with_x11" != "yes"; then
6118             for feature in tooltalk cde offix wmcommand xim xmu
6119   do
6120     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6121        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6122     fi
6123     eval "with_${feature}=no"
6124   done
6125 fi
6126
6127 bitmapdir=
6128
6129 case "$window_system" in
6130   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6131   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6132   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6133 esac
6134
6135 case "$x_libraries" in *X11R4* )
6136   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6137   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6138 esac
6139
6140 echo "checking for WM_COMMAND option" 1>&6
6141 echo "configure:6142: checking for WM_COMMAND option" >&5;
6142 if test "$with_wmcommand" != "no"; then
6143   { test "$extra_verbose" = "yes" && cat << \EOF
6144     Defining HAVE_WMCOMMAND
6145 EOF
6146 cat >> confdefs.h <<\EOF
6147 #define HAVE_WMCOMMAND 1
6148 EOF
6149 }
6150
6151 fi
6152
6153 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6154 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6155 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6156 echo "configure:6157: checking for X11/Xauth.h" >&5
6157
6158 cat > conftest.$ac_ext <<EOF
6159 #line 6160 "configure"
6160 #include "confdefs.h"
6161 #include <X11/Xauth.h>
6162 EOF
6163 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6164 { (eval echo configure:6165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6165 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6166 if test -z "$ac_err"; then
6167   rm -rf conftest*
6168   eval "ac_cv_header_$ac_safe=yes"
6169 else
6170   echo "$ac_err" >&5
6171   echo "configure: failed program was:" >&5
6172   cat conftest.$ac_ext >&5
6173   rm -rf conftest*
6174   eval "ac_cv_header_$ac_safe=no"
6175 fi
6176 rm -f conftest*
6177 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6178   echo "$ac_t""yes" 1>&6
6179   :
6180 else
6181   echo "$ac_t""no" 1>&6
6182 with_xauth=no
6183 fi
6184  }
6185 test -z "$with_xauth" && { 
6186 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6187 echo "configure:6188: checking for XauGetAuthByAddr in -lXau" >&5
6188 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6189
6190 xe_check_libs=" -lXau "
6191 cat > conftest.$ac_ext <<EOF
6192 #line 6193 "configure"
6193 #include "confdefs.h"
6194 /* Override any gcc2 internal prototype to avoid an error.  */
6195 /* We use char because int might match the return type of a gcc2
6196     builtin and then its argument prototype would still apply.  */
6197 char XauGetAuthByAddr();
6198
6199 int main() {
6200 XauGetAuthByAddr()
6201 ; return 0; }
6202 EOF
6203 if { (eval echo configure:6204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6204   rm -rf conftest*
6205   eval "ac_cv_lib_$ac_lib_var=yes"
6206 else
6207   echo "configure: failed program was:" >&5
6208   cat conftest.$ac_ext >&5
6209   rm -rf conftest*
6210   eval "ac_cv_lib_$ac_lib_var=no"
6211 fi
6212 rm -f conftest*
6213 xe_check_libs=""
6214
6215 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6216   echo "$ac_t""yes" 1>&6
6217   :
6218 else
6219   echo "$ac_t""no" 1>&6
6220 with_xauth=no
6221 fi
6222
6223  }
6224 test -z "$with_xauth" && with_xauth=yes
6225 if test "$with_xauth" = "yes"; then
6226   { test "$extra_verbose" = "yes" && cat << \EOF
6227     Defining HAVE_XAUTH
6228 EOF
6229 cat >> confdefs.h <<\EOF
6230 #define HAVE_XAUTH 1
6231 EOF
6232 }
6233
6234   
6235 T=""
6236 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
6237 libs_xauth="$T"
6238
6239 fi
6240
6241
6242
6243
6244 if test "$with_tooltalk" != "no" ; then
6245       for dir in "" "Tt/" "desktop/" ; do
6246     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6247 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6248 echo "configure:6249: checking for ${dir}tt_c.h" >&5
6249
6250 cat > conftest.$ac_ext <<EOF
6251 #line 6252 "configure"
6252 #include "confdefs.h"
6253 #include <${dir}tt_c.h>
6254 EOF
6255 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6256 { (eval echo configure:6257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6257 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6258 if test -z "$ac_err"; then
6259   rm -rf conftest*
6260   eval "ac_cv_header_$ac_safe=yes"
6261 else
6262   echo "$ac_err" >&5
6263   echo "configure: failed program was:" >&5
6264   cat conftest.$ac_ext >&5
6265   rm -rf conftest*
6266   eval "ac_cv_header_$ac_safe=no"
6267 fi
6268 rm -f conftest*
6269 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6270   echo "$ac_t""yes" 1>&6
6271   tt_c_h_path="${dir}tt_c.h"; break
6272 else
6273   echo "$ac_t""no" 1>&6
6274 fi
6275
6276   done
6277   if test -z "$tt_c_h_path"; then
6278     if test "$with_tooltalk" = "yes"; then
6279       (echo "$progname: Usage error:"
6280 echo " " "Unable to find required tooltalk header files."
6281 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6282     fi
6283     with_tooltalk=no
6284   fi
6285 fi
6286 if test "$with_tooltalk" != "no" ; then
6287   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6288     
6289 xe_msg_checking="for tt_message_create in -ltt"
6290 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6291 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6292 echo "configure:6293: checking "$xe_msg_checking"" >&5
6293 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6294
6295 xe_check_libs=" -ltt $extra_libs"
6296 cat > conftest.$ac_ext <<EOF
6297 #line 6298 "configure"
6298 #include "confdefs.h"
6299 /* Override any gcc2 internal prototype to avoid an error.  */
6300 /* We use char because int might match the return type of a gcc2
6301     builtin and then its argument prototype would still apply.  */
6302 char tt_message_create();
6303
6304 int main() {
6305 tt_message_create()
6306 ; return 0; }
6307 EOF
6308 if { (eval echo configure:6309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6309   rm -rf conftest*
6310   eval "ac_cv_lib_$ac_lib_var=yes"
6311 else
6312   echo "configure: failed program was:" >&5
6313   cat conftest.$ac_ext >&5
6314   rm -rf conftest*
6315   eval "ac_cv_lib_$ac_lib_var=no"
6316 fi
6317 rm -f conftest*
6318 xe_check_libs=""
6319
6320 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6321   echo "$ac_t""yes" 1>&6
6322   tt_libs="-ltt $extra_libs"; break
6323 else
6324   echo "$ac_t""no" 1>&6
6325 :
6326 fi
6327
6328
6329   done
6330   if test -z "$tt_libs"; then
6331     if test "$with_tooltalk" = "yes"; then
6332       (echo "$progname: Usage error:"
6333 echo " " "Unable to find required tooltalk libraries."
6334 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6335     fi
6336     with_tooltalk=no
6337   fi
6338 fi
6339 test -z "$with_tooltalk" && with_tooltalk=yes
6340 if test "$with_tooltalk" = "yes"; then
6341   { test "$extra_verbose" = "yes" && cat << \EOF
6342     Defining TOOLTALK
6343 EOF
6344 cat >> confdefs.h <<\EOF
6345 #define TOOLTALK 1
6346 EOF
6347 }
6348
6349   { test "$extra_verbose" = "yes" && cat << EOF
6350     Defining TT_C_H_PATH = "$tt_c_h_path"
6351 EOF
6352 cat >> confdefs.h <<EOF
6353 #define TT_C_H_PATH "$tt_c_h_path"
6354 EOF
6355 }
6356
6357   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6358   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6359    echo "    xemacs will be linked with \"tooltalk.o\""
6360  fi
6361 fi
6362
6363 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6364 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6365 echo "configure:6366: checking for Dt/Dt.h" >&5
6366
6367 cat > conftest.$ac_ext <<EOF
6368 #line 6369 "configure"
6369 #include "confdefs.h"
6370 #include <Dt/Dt.h>
6371 EOF
6372 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6373 { (eval echo configure:6374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6374 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6375 if test -z "$ac_err"; then
6376   rm -rf conftest*
6377   eval "ac_cv_header_$ac_safe=yes"
6378 else
6379   echo "$ac_err" >&5
6380   echo "configure: failed program was:" >&5
6381   cat conftest.$ac_ext >&5
6382   rm -rf conftest*
6383   eval "ac_cv_header_$ac_safe=no"
6384 fi
6385 rm -f conftest*
6386 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6387   echo "$ac_t""yes" 1>&6
6388   :
6389 else
6390   echo "$ac_t""no" 1>&6
6391 with_cde=no
6392 fi
6393  }
6394 test -z "$with_cde" && { 
6395 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6396 echo "configure:6397: checking for DtDndDragStart in -lDtSvc" >&5
6397 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6398
6399 xe_check_libs=" -lDtSvc "
6400 cat > conftest.$ac_ext <<EOF
6401 #line 6402 "configure"
6402 #include "confdefs.h"
6403 /* Override any gcc2 internal prototype to avoid an error.  */
6404 /* We use char because int might match the return type of a gcc2
6405     builtin and then its argument prototype would still apply.  */
6406 char DtDndDragStart();
6407
6408 int main() {
6409 DtDndDragStart()
6410 ; return 0; }
6411 EOF
6412 if { (eval echo configure:6413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6413   rm -rf conftest*
6414   eval "ac_cv_lib_$ac_lib_var=yes"
6415 else
6416   echo "configure: failed program was:" >&5
6417   cat conftest.$ac_ext >&5
6418   rm -rf conftest*
6419   eval "ac_cv_lib_$ac_lib_var=no"
6420 fi
6421 rm -f conftest*
6422 xe_check_libs=""
6423
6424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6425   echo "$ac_t""yes" 1>&6
6426   :
6427 else
6428   echo "$ac_t""no" 1>&6
6429 with_cde=no
6430 fi
6431
6432  }
6433 test -z "$with_cde" && with_cde=yes
6434 if test "$with_dragndrop" = no; then
6435   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6436   with_cde=no
6437 fi
6438 if test "$with_cde" = "yes" ; then
6439   { test "$extra_verbose" = "yes" && cat << \EOF
6440     Defining HAVE_CDE
6441 EOF
6442 cat >> confdefs.h <<\EOF
6443 #define HAVE_CDE 1
6444 EOF
6445 }
6446
6447   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6448   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6449   with_tooltalk=yes # CDE requires Tooltalk
6450   need_motif=yes    # CDE requires Motif
6451 fi
6452
6453 test "$window_system" != "x11" && with_offix=no
6454 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6455   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6456   with_offix=no
6457 fi
6458 if test "$with_dragndrop" = no; then
6459   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6460   with_offix=no
6461 fi
6462 if test "$with_cde" = yes; then
6463   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6464   with_offix=no
6465 fi
6466 test -z "$with_offix" && with_offix=no
6467 if test "$with_offix" = "yes"; then
6468   { test "$extra_verbose" = "yes" && cat << \EOF
6469     Defining HAVE_OFFIX_DND
6470 EOF
6471 cat >> confdefs.h <<\EOF
6472 #define HAVE_OFFIX_DND 1
6473 EOF
6474 }
6475
6476   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6477   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6478 fi
6479
6480 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6481 echo "configure:6482: checking if drag and drop API is needed" >&5
6482 if test "$with_dragndrop" != "no" ; then
6483   if test -n "$dragndrop_proto" ; then
6484     with_dragndrop=yes
6485     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6486     { test "$extra_verbose" = "yes" && cat << \EOF
6487     Defining HAVE_DRAGNDROP
6488 EOF
6489 cat >> confdefs.h <<\EOF
6490 #define HAVE_DRAGNDROP 1
6491 EOF
6492 }
6493
6494     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6495   else
6496     with_dragndrop=no
6497     echo "$ac_t""no" 1>&6
6498   fi
6499 fi
6500
6501 echo "checking for LDAP" 1>&6
6502 echo "configure:6503: checking for LDAP" >&5
6503 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6504 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6505 echo "configure:6506: checking for ldap.h" >&5
6506
6507 cat > conftest.$ac_ext <<EOF
6508 #line 6509 "configure"
6509 #include "confdefs.h"
6510 #include <ldap.h>
6511 EOF
6512 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6513 { (eval echo configure:6514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6514 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6515 if test -z "$ac_err"; then
6516   rm -rf conftest*
6517   eval "ac_cv_header_$ac_safe=yes"
6518 else
6519   echo "$ac_err" >&5
6520   echo "configure: failed program was:" >&5
6521   cat conftest.$ac_ext >&5
6522   rm -rf conftest*
6523   eval "ac_cv_header_$ac_safe=no"
6524 fi
6525 rm -f conftest*
6526 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6527   echo "$ac_t""yes" 1>&6
6528   :
6529 else
6530   echo "$ac_t""no" 1>&6
6531 with_ldap=no
6532 fi
6533  }
6534 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6535 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6536 echo "configure:6537: checking for lber.h" >&5
6537
6538 cat > conftest.$ac_ext <<EOF
6539 #line 6540 "configure"
6540 #include "confdefs.h"
6541 #include <lber.h>
6542 EOF
6543 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6544 { (eval echo configure:6545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6545 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6546 if test -z "$ac_err"; then
6547   rm -rf conftest*
6548   eval "ac_cv_header_$ac_safe=yes"
6549 else
6550   echo "$ac_err" >&5
6551   echo "configure: failed program was:" >&5
6552   cat conftest.$ac_ext >&5
6553   rm -rf conftest*
6554   eval "ac_cv_header_$ac_safe=no"
6555 fi
6556 rm -f conftest*
6557 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6558   echo "$ac_t""yes" 1>&6
6559   :
6560 else
6561   echo "$ac_t""no" 1>&6
6562 with_ldap=no
6563 fi
6564  }
6565 if test "$with_ldap" != "no"; then
6566   test -z "$with_umich_ldap" && { 
6567 xe_msg_checking="for ldap_open in -lldap"
6568 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6569 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6570 echo "configure:6571: checking "$xe_msg_checking"" >&5
6571 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6572
6573 xe_check_libs=" -lldap -llber"
6574 cat > conftest.$ac_ext <<EOF
6575 #line 6576 "configure"
6576 #include "confdefs.h"
6577 /* Override any gcc2 internal prototype to avoid an error.  */
6578 /* We use char because int might match the return type of a gcc2
6579     builtin and then its argument prototype would still apply.  */
6580 char ldap_open();
6581
6582 int main() {
6583 ldap_open()
6584 ; return 0; }
6585 EOF
6586 if { (eval echo configure:6587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6587   rm -rf conftest*
6588   eval "ac_cv_lib_$ac_lib_var=yes"
6589 else
6590   echo "configure: failed program was:" >&5
6591   cat conftest.$ac_ext >&5
6592   rm -rf conftest*
6593   eval "ac_cv_lib_$ac_lib_var=no"
6594 fi
6595 rm -f conftest*
6596 xe_check_libs=""
6597
6598 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6599   echo "$ac_t""yes" 1>&6
6600   with_umich_ldap=yes
6601 else
6602   echo "$ac_t""no" 1>&6
6603 with_umich_ldap=no
6604 fi
6605
6606  }
6607   test "$with_umich_ldap" = "no" && { 
6608 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6609 echo "configure:6610: checking for ldap_set_option in -lldap10" >&5
6610 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6611
6612 xe_check_libs=" -lldap10 "
6613 cat > conftest.$ac_ext <<EOF
6614 #line 6615 "configure"
6615 #include "confdefs.h"
6616 /* Override any gcc2 internal prototype to avoid an error.  */
6617 /* We use char because int might match the return type of a gcc2
6618     builtin and then its argument prototype would still apply.  */
6619 char ldap_set_option();
6620
6621 int main() {
6622 ldap_set_option()
6623 ; return 0; }
6624 EOF
6625 if { (eval echo configure:6626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6626   rm -rf conftest*
6627   eval "ac_cv_lib_$ac_lib_var=yes"
6628 else
6629   echo "configure: failed program was:" >&5
6630   cat conftest.$ac_ext >&5
6631   rm -rf conftest*
6632   eval "ac_cv_lib_$ac_lib_var=no"
6633 fi
6634 rm -f conftest*
6635 xe_check_libs=""
6636
6637 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6638   echo "$ac_t""yes" 1>&6
6639   with_ns_ldap=yes
6640 else
6641   echo "$ac_t""no" 1>&6
6642 with_ns_ldap=no
6643 fi
6644
6645  }
6646   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6647 fi
6648 if test "$with_ldap" = "yes"; then
6649   { test "$extra_verbose" = "yes" && cat << \EOF
6650     Defining HAVE_LDAP
6651 EOF
6652 cat >> confdefs.h <<\EOF
6653 #define HAVE_LDAP 1
6654 EOF
6655 }
6656
6657   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6658    echo "    xemacs will be linked with \"eldap.o\""
6659  fi
6660   if test "$with_umich_ldap" = "yes" ; then
6661     { test "$extra_verbose" = "yes" && cat << \EOF
6662     Defining HAVE_UMICH_LDAP
6663 EOF
6664 cat >> confdefs.h <<\EOF
6665 #define HAVE_UMICH_LDAP 1
6666 EOF
6667 }
6668
6669     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6670     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6671   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6672     { test "$extra_verbose" = "yes" && cat << \EOF
6673     Defining HAVE_NS_LDAP
6674 EOF
6675 cat >> confdefs.h <<\EOF
6676 #define HAVE_NS_LDAP 1
6677 EOF
6678 }
6679
6680     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6681   elif test "$with_ldap" = "yes" ; then
6682     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6683   fi
6684 fi
6685
6686
6687 if test "$window_system" != "none"; then
6688   echo "checking for graphics libraries" 1>&6
6689 echo "configure:6690: checking for graphics libraries" >&5
6690
6691     xpm_problem=""
6692   if test -z "$with_xpm"; then
6693     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6694 echo "configure:6695: checking for Xpm - no older than 3.4f" >&5
6695     xe_check_libs=-lXpm
6696     cat > conftest.$ac_ext <<EOF
6697 #line 6698 "configure"
6698 #include "confdefs.h"
6699 #include <X11/xpm.h>
6700     int main(int c, char **v) {
6701     return c == 1 ? 0 :
6702       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6703       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6704 EOF
6705 if { (eval echo configure:6706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6706 then
6707   ./conftest dummy_arg; xpm_status=$?;
6708       if test "$xpm_status" = "0"; then
6709         with_xpm=yes;
6710       else
6711         with_xpm=no;
6712         if test "$xpm_status" = "1"; then
6713           xpm_problem="Xpm library version and header file version don't match!"
6714         elif test "$xpm_status" = "2"; then
6715           xpm_problem="Xpm library version is too old!"
6716         else
6717           xpm_problem="Internal xpm detection logic error!"
6718         fi
6719         echo "
6720 *** WARNING *** $xpm_problem
6721   I'm not touching that with a 10-foot pole!
6722   If you really want to use the installed version of Xpm, rerun
6723   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6724     fi
6725 else
6726   conftest_rc="$?"
6727   echo "configure: failed program was:" >&5
6728   cat conftest.$ac_ext >&5
6729   rm -fr conftest*
6730   with_xpm=no
6731 fi
6732 rm -fr conftest*
6733     xe_check_libs=
6734     echo "$ac_t""$with_xpm" 1>&6
6735   fi
6736   if test "$with_xpm" = "yes"; then
6737     { test "$extra_verbose" = "yes" && cat << \EOF
6738     Defining HAVE_XPM
6739 EOF
6740 cat >> confdefs.h <<\EOF
6741 #define HAVE_XPM 1
6742 EOF
6743 }
6744
6745     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6746     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6747 echo "configure:6748: checking for \"FOR_MSW\" xpm" >&5
6748     xe_check_libs=-lXpm
6749     cat > conftest.$ac_ext <<EOF
6750 #line 6751 "configure"
6751 #include "confdefs.h"
6752
6753 int main() {
6754 XpmCreatePixmapFromData()
6755 ; return 0; }
6756 EOF
6757 if { (eval echo configure:6758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6758   rm -rf conftest*
6759   xpm_for_msw=no
6760 else
6761   echo "configure: failed program was:" >&5
6762   cat conftest.$ac_ext >&5
6763   rm -rf conftest*
6764   xpm_for_msw=yes
6765 fi
6766 rm -f conftest*
6767     xe_check_libs=
6768     echo "$ac_t""$xpm_for_msw" 1>&6
6769     if test "$xpm_for_msw" = "yes"; then
6770       { test "$extra_verbose" = "yes" && cat << \EOF
6771     Defining FOR_MSW
6772 EOF
6773 cat >> confdefs.h <<\EOF
6774 #define FOR_MSW 1
6775 EOF
6776 }
6777
6778     fi
6779   fi
6780
6781     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6782 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6783 echo "configure:6784: checking for compface.h" >&5
6784
6785 cat > conftest.$ac_ext <<EOF
6786 #line 6787 "configure"
6787 #include "confdefs.h"
6788 #include <compface.h>
6789 EOF
6790 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6791 { (eval echo configure:6792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6792 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6793 if test -z "$ac_err"; then
6794   rm -rf conftest*
6795   eval "ac_cv_header_$ac_safe=yes"
6796 else
6797   echo "$ac_err" >&5
6798   echo "configure: failed program was:" >&5
6799   cat conftest.$ac_ext >&5
6800   rm -rf conftest*
6801   eval "ac_cv_header_$ac_safe=no"
6802 fi
6803 rm -f conftest*
6804 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6805   echo "$ac_t""yes" 1>&6
6806   :
6807 else
6808   echo "$ac_t""no" 1>&6
6809 with_xface=no
6810 fi
6811  }
6812   test -z "$with_xface" && { 
6813 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6814 echo "configure:6815: checking for UnGenFace in -lcompface" >&5
6815 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6816
6817 xe_check_libs=" -lcompface "
6818 cat > conftest.$ac_ext <<EOF
6819 #line 6820 "configure"
6820 #include "confdefs.h"
6821 /* Override any gcc2 internal prototype to avoid an error.  */
6822 /* We use char because int might match the return type of a gcc2
6823     builtin and then its argument prototype would still apply.  */
6824 char UnGenFace();
6825
6826 int main() {
6827 UnGenFace()
6828 ; return 0; }
6829 EOF
6830 if { (eval echo configure:6831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6831   rm -rf conftest*
6832   eval "ac_cv_lib_$ac_lib_var=yes"
6833 else
6834   echo "configure: failed program was:" >&5
6835   cat conftest.$ac_ext >&5
6836   rm -rf conftest*
6837   eval "ac_cv_lib_$ac_lib_var=no"
6838 fi
6839 rm -f conftest*
6840 xe_check_libs=""
6841
6842 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6843   echo "$ac_t""yes" 1>&6
6844   : 
6845 else
6846   echo "$ac_t""no" 1>&6
6847 with_xface=no
6848 fi
6849
6850  }
6851   test -z "$with_xface" && with_xface=yes
6852   if test "$with_xface" = "yes"; then
6853     { test "$extra_verbose" = "yes" && cat << \EOF
6854     Defining HAVE_XFACE
6855 EOF
6856 cat >> confdefs.h <<\EOF
6857 #define HAVE_XFACE 1
6858 EOF
6859 }
6860
6861     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
6862   fi
6863
6864         if test "$with_gif" != "no"; then
6865     with_gif="yes"
6866     { test "$extra_verbose" = "yes" && cat << \EOF
6867     Defining HAVE_GIF
6868 EOF
6869 cat >> confdefs.h <<\EOF
6870 #define HAVE_GIF 1
6871 EOF
6872 }
6873
6874     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6875    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6876  fi
6877   fi
6878
6879       if test "$with_png $with_tiff" != "no no"; then
6880     
6881 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6882 echo "configure:6883: checking for inflate in -lc" >&5
6883 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6884
6885 xe_check_libs=" -lc "
6886 cat > conftest.$ac_ext <<EOF
6887 #line 6888 "configure"
6888 #include "confdefs.h"
6889 /* Override any gcc2 internal prototype to avoid an error.  */
6890 /* We use char because int might match the return type of a gcc2
6891     builtin and then its argument prototype would still apply.  */
6892 char inflate();
6893
6894 int main() {
6895 inflate()
6896 ; return 0; }
6897 EOF
6898 if { (eval echo configure:6899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6899   rm -rf conftest*
6900   eval "ac_cv_lib_$ac_lib_var=yes"
6901 else
6902   echo "configure: failed program was:" >&5
6903   cat conftest.$ac_ext >&5
6904   rm -rf conftest*
6905   eval "ac_cv_lib_$ac_lib_var=no"
6906 fi
6907 rm -f conftest*
6908 xe_check_libs=""
6909
6910 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6911   echo "$ac_t""yes" 1>&6
6912   :
6913 else
6914   echo "$ac_t""no" 1>&6
6915
6916 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6917 echo "configure:6918: checking for inflate in -lz" >&5
6918 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6919
6920 xe_check_libs=" -lz "
6921 cat > conftest.$ac_ext <<EOF
6922 #line 6923 "configure"
6923 #include "confdefs.h"
6924 /* Override any gcc2 internal prototype to avoid an error.  */
6925 /* We use char because int might match the return type of a gcc2
6926     builtin and then its argument prototype would still apply.  */
6927 char inflate();
6928
6929 int main() {
6930 inflate()
6931 ; return 0; }
6932 EOF
6933 if { (eval echo configure:6934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6934   rm -rf conftest*
6935   eval "ac_cv_lib_$ac_lib_var=yes"
6936 else
6937   echo "configure: failed program was:" >&5
6938   cat conftest.$ac_ext >&5
6939   rm -rf conftest*
6940   eval "ac_cv_lib_$ac_lib_var=no"
6941 fi
6942 rm -f conftest*
6943 xe_check_libs=""
6944
6945 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6946   echo "$ac_t""yes" 1>&6
6947   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6948 else
6949   echo "$ac_t""no" 1>&6
6950
6951 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6952 echo "configure:6953: checking for inflate in -lgz" >&5
6953 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6954
6955 xe_check_libs=" -lgz "
6956 cat > conftest.$ac_ext <<EOF
6957 #line 6958 "configure"
6958 #include "confdefs.h"
6959 /* Override any gcc2 internal prototype to avoid an error.  */
6960 /* We use char because int might match the return type of a gcc2
6961     builtin and then its argument prototype would still apply.  */
6962 char inflate();
6963
6964 int main() {
6965 inflate()
6966 ; return 0; }
6967 EOF
6968 if { (eval echo configure:6969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6969   rm -rf conftest*
6970   eval "ac_cv_lib_$ac_lib_var=yes"
6971 else
6972   echo "configure: failed program was:" >&5
6973   cat conftest.$ac_ext >&5
6974   rm -rf conftest*
6975   eval "ac_cv_lib_$ac_lib_var=no"
6976 fi
6977 rm -f conftest*
6978 xe_check_libs=""
6979
6980 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6981   echo "$ac_t""yes" 1>&6
6982   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6983 else
6984   echo "$ac_t""no" 1>&6
6985 fi
6986
6987
6988 fi
6989
6990
6991 fi
6992
6993
6994   fi
6995
6996     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6997 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6998 echo "configure:6999: checking for jpeglib.h" >&5
6999
7000 cat > conftest.$ac_ext <<EOF
7001 #line 7002 "configure"
7002 #include "confdefs.h"
7003 #include <jpeglib.h>
7004 EOF
7005 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7006 { (eval echo configure:7007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7007 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7008 if test -z "$ac_err"; then
7009   rm -rf conftest*
7010   eval "ac_cv_header_$ac_safe=yes"
7011 else
7012   echo "$ac_err" >&5
7013   echo "configure: failed program was:" >&5
7014   cat conftest.$ac_ext >&5
7015   rm -rf conftest*
7016   eval "ac_cv_header_$ac_safe=no"
7017 fi
7018 rm -f conftest*
7019 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7020   echo "$ac_t""yes" 1>&6
7021   :
7022 else
7023   echo "$ac_t""no" 1>&6
7024 with_jpeg=no
7025 fi
7026  }
7027   test -z "$with_jpeg" && { 
7028 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7029 echo "configure:7030: checking for jpeg_destroy_decompress in -ljpeg" >&5
7030 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7031
7032 xe_check_libs=" -ljpeg "
7033 cat > conftest.$ac_ext <<EOF
7034 #line 7035 "configure"
7035 #include "confdefs.h"
7036 /* Override any gcc2 internal prototype to avoid an error.  */
7037 /* We use char because int might match the return type of a gcc2
7038     builtin and then its argument prototype would still apply.  */
7039 char jpeg_destroy_decompress();
7040
7041 int main() {
7042 jpeg_destroy_decompress()
7043 ; return 0; }
7044 EOF
7045 if { (eval echo configure:7046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7046   rm -rf conftest*
7047   eval "ac_cv_lib_$ac_lib_var=yes"
7048 else
7049   echo "configure: failed program was:" >&5
7050   cat conftest.$ac_ext >&5
7051   rm -rf conftest*
7052   eval "ac_cv_lib_$ac_lib_var=no"
7053 fi
7054 rm -f conftest*
7055 xe_check_libs=""
7056
7057 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7058   echo "$ac_t""yes" 1>&6
7059   :
7060 else
7061   echo "$ac_t""no" 1>&6
7062 with_jpeg=no
7063 fi
7064
7065  }
7066   test -z "$with_jpeg" && with_jpeg=yes
7067   if test "$with_jpeg" = "yes"; then
7068     { test "$extra_verbose" = "yes" && cat << \EOF
7069     Defining HAVE_JPEG
7070 EOF
7071 cat >> confdefs.h <<\EOF
7072 #define HAVE_JPEG 1
7073 EOF
7074 }
7075
7076     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7077   fi
7078
7079     png_problem=""
7080   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7081 echo "configure:7082: checking for pow" >&5
7082
7083 cat > conftest.$ac_ext <<EOF
7084 #line 7085 "configure"
7085 #include "confdefs.h"
7086 /* System header to define __stub macros and hopefully few prototypes,
7087     which can conflict with char pow(); below.  */
7088 #include <assert.h>
7089 /* Override any gcc2 internal prototype to avoid an error.  */
7090 /* We use char because int might match the return type of a gcc2
7091     builtin and then its argument prototype would still apply.  */
7092 char pow();
7093
7094 int main() {
7095
7096 /* The GNU C library defines this for functions which it implements
7097     to always fail with ENOSYS.  Some functions are actually named
7098     something starting with __ and the normal name is an alias.  */
7099 #if defined (__stub_pow) || defined (__stub___pow)
7100 choke me
7101 #else
7102 pow();
7103 #endif
7104
7105 ; return 0; }
7106 EOF
7107 if { (eval echo configure:7108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7108   rm -rf conftest*
7109   eval "ac_cv_func_pow=yes"
7110 else
7111   echo "configure: failed program was:" >&5
7112   cat conftest.$ac_ext >&5
7113   rm -rf conftest*
7114   eval "ac_cv_func_pow=no"
7115 fi
7116 rm -f conftest*
7117
7118 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7119   echo "$ac_t""yes" 1>&6
7120   :
7121 else
7122   echo "$ac_t""no" 1>&6
7123 with_png=no
7124 fi
7125  }
7126   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7127 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7128 echo "configure:7129: checking for png.h" >&5
7129
7130 cat > conftest.$ac_ext <<EOF
7131 #line 7132 "configure"
7132 #include "confdefs.h"
7133 #include <png.h>
7134 EOF
7135 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7136 { (eval echo configure:7137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7137 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7138 if test -z "$ac_err"; then
7139   rm -rf conftest*
7140   eval "ac_cv_header_$ac_safe=yes"
7141 else
7142   echo "$ac_err" >&5
7143   echo "configure: failed program was:" >&5
7144   cat conftest.$ac_ext >&5
7145   rm -rf conftest*
7146   eval "ac_cv_header_$ac_safe=no"
7147 fi
7148 rm -f conftest*
7149 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7150   echo "$ac_t""yes" 1>&6
7151   :
7152 else
7153   echo "$ac_t""no" 1>&6
7154 with_png=no
7155 fi
7156  }
7157   test -z "$with_png" && { 
7158 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7159 echo "configure:7160: checking for png_read_image in -lpng" >&5
7160 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7161
7162 xe_check_libs=" -lpng "
7163 cat > conftest.$ac_ext <<EOF
7164 #line 7165 "configure"
7165 #include "confdefs.h"
7166 /* Override any gcc2 internal prototype to avoid an error.  */
7167 /* We use char because int might match the return type of a gcc2
7168     builtin and then its argument prototype would still apply.  */
7169 char png_read_image();
7170
7171 int main() {
7172 png_read_image()
7173 ; return 0; }
7174 EOF
7175 if { (eval echo configure:7176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7176   rm -rf conftest*
7177   eval "ac_cv_lib_$ac_lib_var=yes"
7178 else
7179   echo "configure: failed program was:" >&5
7180   cat conftest.$ac_ext >&5
7181   rm -rf conftest*
7182   eval "ac_cv_lib_$ac_lib_var=no"
7183 fi
7184 rm -f conftest*
7185 xe_check_libs=""
7186
7187 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7188   echo "$ac_t""yes" 1>&6
7189   :
7190 else
7191   echo "$ac_t""no" 1>&6
7192 with_png=no
7193 fi
7194
7195  }
7196   if test -z "$with_png"; then
7197     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7198 echo "configure:7199: checking for workable png version information" >&5
7199     xe_check_libs="-lpng -lz"
7200     cat > conftest.$ac_ext <<EOF
7201 #line 7202 "configure"
7202 #include "confdefs.h"
7203 #include <png.h>
7204     int main(int c, char **v) {
7205     if (c == 1) return 0;
7206     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7207     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7208 EOF
7209 if { (eval echo configure:7210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7210 then
7211   ./conftest dummy_arg; png_status=$?;
7212       if test "$png_status" = "0"; then
7213         with_png=yes;
7214       else
7215         with_png=no;
7216         if test "$png_status" = "1"; then
7217           png_problem="PNG library version and header file don't match!"
7218         elif test "$png_status" = "2"; then
7219           png_problem="PNG library version too old (pre 1.0.2)!"
7220         fi
7221         echo "
7222 *** WARNING *** $png_problem
7223   I'm not touching that with a 10-foot pole!
7224   If you really want to use the installed version of libPNG, rerun
7225   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7226     fi
7227 else
7228   conftest_rc="$?"
7229   echo "configure: failed program was:" >&5
7230   cat conftest.$ac_ext >&5
7231   rm -fr conftest*
7232   with_png=no
7233 fi
7234 rm -fr conftest*
7235     xe_check_libs=
7236     echo "$ac_t""$with_png" 1>&6
7237   fi
7238   if test "$with_png" = "yes"; then
7239     { test "$extra_verbose" = "yes" && cat << \EOF
7240     Defining HAVE_PNG
7241 EOF
7242 cat >> confdefs.h <<\EOF
7243 #define HAVE_PNG 1
7244 EOF
7245 }
7246
7247     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7248   fi
7249
7250     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7251 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7252 echo "configure:7253: checking for tiffio.h" >&5
7253
7254 cat > conftest.$ac_ext <<EOF
7255 #line 7256 "configure"
7256 #include "confdefs.h"
7257 #include <tiffio.h>
7258 EOF
7259 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7260 { (eval echo configure:7261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7261 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7262 if test -z "$ac_err"; then
7263   rm -rf conftest*
7264   eval "ac_cv_header_$ac_safe=yes"
7265 else
7266   echo "$ac_err" >&5
7267   echo "configure: failed program was:" >&5
7268   cat conftest.$ac_ext >&5
7269   rm -rf conftest*
7270   eval "ac_cv_header_$ac_safe=no"
7271 fi
7272 rm -f conftest*
7273 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7274   echo "$ac_t""yes" 1>&6
7275   :
7276 else
7277   echo "$ac_t""no" 1>&6
7278 with_tiff=no
7279 fi
7280  }
7281   test -z "$with_tiff" && { 
7282 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7283 echo "configure:7284: checking for TIFFClientOpen in -ltiff" >&5
7284 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7285
7286 xe_check_libs=" -ltiff "
7287 cat > conftest.$ac_ext <<EOF
7288 #line 7289 "configure"
7289 #include "confdefs.h"
7290 /* Override any gcc2 internal prototype to avoid an error.  */
7291 /* We use char because int might match the return type of a gcc2
7292     builtin and then its argument prototype would still apply.  */
7293 char TIFFClientOpen();
7294
7295 int main() {
7296 TIFFClientOpen()
7297 ; return 0; }
7298 EOF
7299 if { (eval echo configure:7300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7300   rm -rf conftest*
7301   eval "ac_cv_lib_$ac_lib_var=yes"
7302 else
7303   echo "configure: failed program was:" >&5
7304   cat conftest.$ac_ext >&5
7305   rm -rf conftest*
7306   eval "ac_cv_lib_$ac_lib_var=no"
7307 fi
7308 rm -f conftest*
7309 xe_check_libs=""
7310
7311 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7312   echo "$ac_t""yes" 1>&6
7313   :
7314 else
7315   echo "$ac_t""no" 1>&6
7316 with_tiff=no
7317 fi
7318
7319  }
7320   test -z "$with_tiff" && with_tiff=yes
7321   if test "$with_tiff" = "yes"; then
7322     { test "$extra_verbose" = "yes" && cat << \EOF
7323     Defining HAVE_TIFF
7324 EOF
7325 cat >> confdefs.h <<\EOF
7326 #define HAVE_TIFF 1
7327 EOF
7328 }
7329
7330     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7331   fi
7332 fi
7333
7334
7335 if test "$with_x11" = "yes"; then
7336
7337   echo "checking for X11 graphics libraries" 1>&6
7338 echo "configure:7339: checking for X11 graphics libraries" >&5
7339
7340     
7341 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7342 echo "configure:7343: checking for XawScrollbarSetThumb in -lXaw" >&5
7343 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7344
7345 xe_check_libs=" -lXaw "
7346 cat > conftest.$ac_ext <<EOF
7347 #line 7348 "configure"
7348 #include "confdefs.h"
7349 /* Override any gcc2 internal prototype to avoid an error.  */
7350 /* We use char because int might match the return type of a gcc2
7351     builtin and then its argument prototype would still apply.  */
7352 char XawScrollbarSetThumb();
7353
7354 int main() {
7355 XawScrollbarSetThumb()
7356 ; return 0; }
7357 EOF
7358 if { (eval echo configure:7359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7359   rm -rf conftest*
7360   eval "ac_cv_lib_$ac_lib_var=yes"
7361 else
7362   echo "configure: failed program was:" >&5
7363   cat conftest.$ac_ext >&5
7364   rm -rf conftest*
7365   eval "ac_cv_lib_$ac_lib_var=no"
7366 fi
7367 rm -f conftest*
7368 xe_check_libs=""
7369
7370 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7371   echo "$ac_t""yes" 1>&6
7372   have_xaw=yes
7373 else
7374   echo "$ac_t""no" 1>&6
7375 have_xaw=no
7376 fi
7377
7378
7379                     
7380     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7381 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7382 echo "configure:7383: checking for Xm/Xm.h" >&5
7383
7384 cat > conftest.$ac_ext <<EOF
7385 #line 7386 "configure"
7386 #include "confdefs.h"
7387 #include <Xm/Xm.h>
7388 EOF
7389 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7390 { (eval echo configure:7391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7391 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7392 if test -z "$ac_err"; then
7393   rm -rf conftest*
7394   eval "ac_cv_header_$ac_safe=yes"
7395 else
7396   echo "$ac_err" >&5
7397   echo "configure: failed program was:" >&5
7398   cat conftest.$ac_ext >&5
7399   rm -rf conftest*
7400   eval "ac_cv_header_$ac_safe=no"
7401 fi
7402 rm -f conftest*
7403 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7404   echo "$ac_t""yes" 1>&6
7405   
7406 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7407 echo "configure:7408: checking for XmStringFree in -lXm" >&5
7408 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7409
7410 xe_check_libs=" -lXm "
7411 cat > conftest.$ac_ext <<EOF
7412 #line 7413 "configure"
7413 #include "confdefs.h"
7414 /* Override any gcc2 internal prototype to avoid an error.  */
7415 /* We use char because int might match the return type of a gcc2
7416     builtin and then its argument prototype would still apply.  */
7417 char XmStringFree();
7418
7419 int main() {
7420 XmStringFree()
7421 ; return 0; }
7422 EOF
7423 if { (eval echo configure:7424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7424   rm -rf conftest*
7425   eval "ac_cv_lib_$ac_lib_var=yes"
7426 else
7427   echo "configure: failed program was:" >&5
7428   cat conftest.$ac_ext >&5
7429   rm -rf conftest*
7430   eval "ac_cv_lib_$ac_lib_var=no"
7431 fi
7432 rm -f conftest*
7433 xe_check_libs=""
7434
7435 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7436   echo "$ac_t""yes" 1>&6
7437   have_motif=yes
7438 else
7439   echo "$ac_t""no" 1>&6
7440 have_motif=no
7441 fi
7442
7443
7444 else
7445   echo "$ac_t""no" 1>&6
7446 have_motif=no
7447 fi
7448
7449
7450   if test "$have_motif" = "yes"; then
7451         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7452 echo "configure:7453: checking for Lesstif" >&5
7453     cat > conftest.$ac_ext <<EOF
7454 #line 7455 "configure"
7455 #include "confdefs.h"
7456 #include <Xm/Xm.h>
7457 #ifdef LESSTIF_VERSION
7458 yes
7459 #endif
7460
7461 EOF
7462 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7463   egrep "yes" >/dev/null 2>&1; then
7464   rm -rf conftest*
7465   have_lesstif=yes
7466 else
7467   rm -rf conftest*
7468   have_lesstif=no
7469 fi
7470 rm -f conftest*
7471
7472   echo "$ac_t""$have_lesstif" 1>&6
7473   fi
7474
7475 fi 
7476
7477 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7478   with_menubars="lucid" ;;
7479 esac
7480 case "$with_dialogs" in "" | "yes" | "lucid" )
7481   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7482   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7483   else with_dialogs=no
7484   fi ;;
7485 esac
7486 case "$with_scrollbars" in "" | "yes" )
7487   with_scrollbars="lucid" ;;
7488 esac
7489
7490 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7491
7492 case "$all_widgets" in *athena* )
7493   { test "$extra_verbose" = "yes" && cat << \EOF
7494     Defining LWLIB_USES_ATHENA
7495 EOF
7496 cat >> confdefs.h <<\EOF
7497 #define LWLIB_USES_ATHENA 1
7498 EOF
7499 }
7500
7501   { test "$extra_verbose" = "yes" && cat << \EOF
7502     Defining NEED_ATHENA
7503 EOF
7504 cat >> confdefs.h <<\EOF
7505 #define NEED_ATHENA 1
7506 EOF
7507 }
7508
7509   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7510   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7511 esac
7512
7513 case "$all_widgets" in *motif* )
7514   { test "$extra_verbose" = "yes" && cat << \EOF
7515     Defining LWLIB_USES_MOTIF
7516 EOF
7517 cat >> confdefs.h <<\EOF
7518 #define LWLIB_USES_MOTIF 1
7519 EOF
7520 }
7521
7522   { test "$extra_verbose" = "yes" && cat << \EOF
7523     Defining NEED_MOTIF
7524 EOF
7525 cat >> confdefs.h <<\EOF
7526 #define NEED_MOTIF 1
7527 EOF
7528 }
7529
7530   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7531   need_motif=yes ;;
7532 esac
7533
7534 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7535 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7536 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7537 case "$all_widgets" in *lucid* )
7538   { test "$extra_verbose" = "yes" && cat << \EOF
7539     Defining NEED_LUCID
7540 EOF
7541 cat >> confdefs.h <<\EOF
7542 #define NEED_LUCID 1
7543 EOF
7544 }
7545
7546   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7547 esac
7548
7549
7550
7551 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7552     Defining LWLIB_SCROLLBARS_ATHENA
7553 EOF
7554 cat >> confdefs.h <<\EOF
7555 #define LWLIB_SCROLLBARS_ATHENA 1
7556 EOF
7557 }
7558 ;; esac
7559 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7560     Defining LWLIB_DIALOGS_ATHENA
7561 EOF
7562 cat >> confdefs.h <<\EOF
7563 #define LWLIB_DIALOGS_ATHENA 1
7564 EOF
7565 }
7566    ;; esac
7567 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7568     Defining LWLIB_SCROLLBARS_ATHENA3D
7569 EOF
7570 cat >> confdefs.h <<\EOF
7571 #define LWLIB_SCROLLBARS_ATHENA3D 1
7572 EOF
7573 }
7574
7575 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7576     Defining LWLIB_DIALOGS_ATHENA3D
7577 EOF
7578 cat >> confdefs.h <<\EOF
7579 #define LWLIB_DIALOGS_ATHENA3D 1
7580 EOF
7581 }
7582
7583
7584 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7585     Defining HAVE_MENUBARS
7586 EOF
7587 cat >> confdefs.h <<\EOF
7588 #define HAVE_MENUBARS 1
7589 EOF
7590 }
7591
7592 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7593     Defining HAVE_SCROLLBARS
7594 EOF
7595 cat >> confdefs.h <<\EOF
7596 #define HAVE_SCROLLBARS 1
7597 EOF
7598 }
7599
7600 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7601     Defining HAVE_DIALOGS
7602 EOF
7603 cat >> confdefs.h <<\EOF
7604 #define HAVE_DIALOGS 1
7605 EOF
7606 }
7607
7608 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7609     Defining HAVE_TOOLBARS
7610 EOF
7611 cat >> confdefs.h <<\EOF
7612 #define HAVE_TOOLBARS 1
7613 EOF
7614 }
7615
7616
7617 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7618     Defining LWLIB_MENUBARS_LUCID
7619 EOF
7620 cat >> confdefs.h <<\EOF
7621 #define LWLIB_MENUBARS_LUCID 1
7622 EOF
7623 }
7624
7625 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7626     Defining LWLIB_SCROLLBARS_LUCID
7627 EOF
7628 cat >> confdefs.h <<\EOF
7629 #define LWLIB_SCROLLBARS_LUCID 1
7630 EOF
7631 }
7632
7633
7634 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7635     Defining LWLIB_MENUBARS_MOTIF
7636 EOF
7637 cat >> confdefs.h <<\EOF
7638 #define LWLIB_MENUBARS_MOTIF 1
7639 EOF
7640 }
7641
7642 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7643     Defining LWLIB_SCROLLBARS_MOTIF
7644 EOF
7645 cat >> confdefs.h <<\EOF
7646 #define LWLIB_SCROLLBARS_MOTIF 1
7647 EOF
7648 }
7649
7650 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7651     Defining LWLIB_DIALOGS_MOTIF
7652 EOF
7653 cat >> confdefs.h <<\EOF
7654 #define LWLIB_DIALOGS_MOTIF 1
7655 EOF
7656 }
7657
7658
7659 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7660    echo "    xemacs will be linked with \"menubar.o\""
7661  fi
7662 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7663    echo "    xemacs will be linked with \"scrollbar.o\""
7664  fi
7665 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7666    echo "    xemacs will be linked with \"dialog.o\""
7667  fi
7668 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7669    echo "    xemacs will be linked with \"toolbar.o\""
7670  fi
7671
7672 if test "$with_x11" = "yes"; then
7673   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7674    echo "    xemacs will be linked with \"menubar-x.o\""
7675  fi
7676   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7677    echo "    xemacs will be linked with \"scrollbar-x.o\""
7678  fi
7679   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7680    echo "    xemacs will be linked with \"dialog-x.o\""
7681  fi
7682   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7683    echo "    xemacs will be linked with \"toolbar-x.o\""
7684  fi
7685   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7686    echo "    xemacs will be linked with \"gui-x.o\""
7687  fi
7688 else
7689   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7690     echo "Attempt to Build NAS sound without X"
7691     echo "Please remove NAS configuration or build with X"
7692     exit 1
7693   fi
7694 fi
7695
7696
7697 test -z "$with_mule" && with_mule=no
7698 test -z "$with_file_coding" && with_file_coding=no
7699
7700
7701 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7702   { test "$extra_verbose" = "yes" && cat << \EOF
7703     Defining FILE_CODING
7704 EOF
7705 cat >> confdefs.h <<\EOF
7706 #define FILE_CODING 1
7707 EOF
7708 }
7709
7710   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7711    echo "    xemacs will be linked with \"file-coding.o\""
7712  fi
7713 fi
7714
7715 if test "$with_mule" = "yes" ; then
7716   echo "checking for Mule-related features" 1>&6
7717 echo "configure:7718: checking for Mule-related features" >&5
7718   { test "$extra_verbose" = "yes" && cat << \EOF
7719     Defining MULE
7720 EOF
7721 cat >> confdefs.h <<\EOF
7722 #define MULE 1
7723 EOF
7724 }
7725
7726   { test "$extra_verbose" = "yes" && cat << \EOF
7727     Defining FILE_CODING
7728 EOF
7729 cat >> confdefs.h <<\EOF
7730 #define FILE_CODING 1
7731 EOF
7732 }
7733
7734   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7735    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7736  fi
7737
7738     for ac_hdr in libintl.h
7739 do
7740 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7741 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7742 echo "configure:7743: checking for $ac_hdr" >&5
7743
7744 cat > conftest.$ac_ext <<EOF
7745 #line 7746 "configure"
7746 #include "confdefs.h"
7747 #include <$ac_hdr>
7748 EOF
7749 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7750 { (eval echo configure:7751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7751 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7752 if test -z "$ac_err"; then
7753   rm -rf conftest*
7754   eval "ac_cv_header_$ac_safe=yes"
7755 else
7756   echo "$ac_err" >&5
7757   echo "configure: failed program was:" >&5
7758   cat conftest.$ac_ext >&5
7759   rm -rf conftest*
7760   eval "ac_cv_header_$ac_safe=no"
7761 fi
7762 rm -f conftest*
7763 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7764   echo "$ac_t""yes" 1>&6
7765     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7766   { test "$extra_verbose" = "yes" && cat << EOF
7767     Defining $ac_tr_hdr
7768 EOF
7769 cat >> confdefs.h <<EOF
7770 #define $ac_tr_hdr 1
7771 EOF
7772 }
7773  
7774 else
7775   echo "$ac_t""no" 1>&6
7776 fi
7777 done
7778
7779   
7780 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7781 echo "configure:7782: checking for strerror in -lintl" >&5
7782 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7783
7784 xe_check_libs=" -lintl "
7785 cat > conftest.$ac_ext <<EOF
7786 #line 7787 "configure"
7787 #include "confdefs.h"
7788 /* Override any gcc2 internal prototype to avoid an error.  */
7789 /* We use char because int might match the return type of a gcc2
7790     builtin and then its argument prototype would still apply.  */
7791 char strerror();
7792
7793 int main() {
7794 strerror()
7795 ; return 0; }
7796 EOF
7797 if { (eval echo configure:7798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7798   rm -rf conftest*
7799   eval "ac_cv_lib_$ac_lib_var=yes"
7800 else
7801   echo "configure: failed program was:" >&5
7802   cat conftest.$ac_ext >&5
7803   rm -rf conftest*
7804   eval "ac_cv_lib_$ac_lib_var=no"
7805 fi
7806 rm -f conftest*
7807 xe_check_libs=""
7808
7809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7810   echo "$ac_t""yes" 1>&6
7811     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7812     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7813   { test "$extra_verbose" = "yes" && cat << EOF
7814     Defining $ac_tr_lib
7815 EOF
7816 cat >> confdefs.h <<EOF
7817 #define $ac_tr_lib 1
7818 EOF
7819 }
7820
7821   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7822
7823 else
7824   echo "$ac_t""no" 1>&6
7825 fi
7826
7827
7828
7829   if test "$with_utf_2000" = "yes" ; then
7830     { test "$extra_verbose" = "yes" && cat << \EOF
7831     Defining CHAR_IS_UCS4
7832 EOF
7833 cat >> confdefs.h <<\EOF
7834 #define CHAR_IS_UCS4 1
7835 EOF
7836 }
7837
7838     { test "$extra_verbose" = "yes" && cat << \EOF
7839     Defining UTF2000
7840 EOF
7841 cat >> confdefs.h <<\EOF
7842 #define UTF2000 1
7843 EOF
7844 }
7845
7846   elif test "$with_ucs4" = "yes" ; then
7847     { test "$extra_verbose" = "yes" && cat << \EOF
7848     Defining CHAR_IS_UCS4
7849 EOF
7850 cat >> confdefs.h <<\EOF
7851 #define CHAR_IS_UCS4 1
7852 EOF
7853 }
7854
7855   fi
7856
7857   echo "checking for Mule input methods" 1>&6
7858 echo "configure:7859: checking for Mule input methods" >&5
7859         case "$with_xim" in "" | "yes" )
7860     echo "checking for XIM" 1>&6
7861 echo "configure:7862: checking for XIM" >&5
7862     
7863 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
7864 echo "configure:7865: checking for XOpenIM in -lX11" >&5
7865 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
7866
7867 xe_check_libs=" -lX11 "
7868 cat > conftest.$ac_ext <<EOF
7869 #line 7870 "configure"
7870 #include "confdefs.h"
7871 /* Override any gcc2 internal prototype to avoid an error.  */
7872 /* We use char because int might match the return type of a gcc2
7873     builtin and then its argument prototype would still apply.  */
7874 char XOpenIM();
7875
7876 int main() {
7877 XOpenIM()
7878 ; return 0; }
7879 EOF
7880 if { (eval echo configure:7881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7881   rm -rf conftest*
7882   eval "ac_cv_lib_$ac_lib_var=yes"
7883 else
7884   echo "configure: failed program was:" >&5
7885   cat conftest.$ac_ext >&5
7886   rm -rf conftest*
7887   eval "ac_cv_lib_$ac_lib_var=no"
7888 fi
7889 rm -f conftest*
7890 xe_check_libs=""
7891
7892 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7893   echo "$ac_t""yes" 1>&6
7894   with_xim=xlib
7895 else
7896   echo "$ac_t""no" 1>&6
7897 with_xim=no
7898 fi
7899
7900
7901         if test "$have_motif $have_lesstif" = "yes no"; then
7902       
7903 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7904 echo "configure:7905: checking for XmImMbLookupString in -lXm" >&5
7905 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7906
7907 xe_check_libs=" -lXm "
7908 cat > conftest.$ac_ext <<EOF
7909 #line 7910 "configure"
7910 #include "confdefs.h"
7911 /* Override any gcc2 internal prototype to avoid an error.  */
7912 /* We use char because int might match the return type of a gcc2
7913     builtin and then its argument prototype would still apply.  */
7914 char XmImMbLookupString();
7915
7916 int main() {
7917 XmImMbLookupString()
7918 ; return 0; }
7919 EOF
7920 if { (eval echo configure:7921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7921   rm -rf conftest*
7922   eval "ac_cv_lib_$ac_lib_var=yes"
7923 else
7924   echo "configure: failed program was:" >&5
7925   cat conftest.$ac_ext >&5
7926   rm -rf conftest*
7927   eval "ac_cv_lib_$ac_lib_var=no"
7928 fi
7929 rm -f conftest*
7930 xe_check_libs=""
7931
7932 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7933   echo "$ac_t""yes" 1>&6
7934   with_xim=motif
7935 else
7936   echo "$ac_t""no" 1>&6
7937 fi
7938
7939
7940     fi ;;
7941   esac
7942   if test "$with_xim" != "no"; then
7943     { test "$extra_verbose" = "yes" && cat << \EOF
7944     Defining HAVE_XIM
7945 EOF
7946 cat >> confdefs.h <<\EOF
7947 #define HAVE_XIM 1
7948 EOF
7949 }
7950
7951     if test "$with_xim" = "xlib"; then
7952       { test "$extra_verbose" = "yes" && cat << \EOF
7953     Defining XIM_XLIB
7954 EOF
7955 cat >> confdefs.h <<\EOF
7956 #define XIM_XLIB 1
7957 EOF
7958 }
7959
7960       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7961    echo "    xemacs will be linked with \"input-method-xlib.o\""
7962  fi
7963     fi
7964     if test "$with_xim" = "motif"; then
7965       { test "$extra_verbose" = "yes" && cat << \EOF
7966     Defining XIM_MOTIF
7967 EOF
7968 cat >> confdefs.h <<\EOF
7969 #define XIM_MOTIF 1
7970 EOF
7971 }
7972
7973       need_motif=yes
7974       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7975    echo "    xemacs will be linked with \"input-method-motif.o\""
7976  fi
7977     fi
7978     if test "$with_xim" = "motif"; then
7979       with_xfs=no
7980     fi
7981   fi
7982
7983     if test "$with_xfs" = "yes" ; then
7984     echo "checking for XFontSet" 1>&6
7985 echo "configure:7986: checking for XFontSet" >&5
7986     
7987 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7988 echo "configure:7989: checking for XmbDrawString in -lX11" >&5
7989 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7990
7991 xe_check_libs=" -lX11 "
7992 cat > conftest.$ac_ext <<EOF
7993 #line 7994 "configure"
7994 #include "confdefs.h"
7995 /* Override any gcc2 internal prototype to avoid an error.  */
7996 /* We use char because int might match the return type of a gcc2
7997     builtin and then its argument prototype would still apply.  */
7998 char XmbDrawString();
7999
8000 int main() {
8001 XmbDrawString()
8002 ; return 0; }
8003 EOF
8004 if { (eval echo configure:8005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8005   rm -rf conftest*
8006   eval "ac_cv_lib_$ac_lib_var=yes"
8007 else
8008   echo "configure: failed program was:" >&5
8009   cat conftest.$ac_ext >&5
8010   rm -rf conftest*
8011   eval "ac_cv_lib_$ac_lib_var=no"
8012 fi
8013 rm -f conftest*
8014 xe_check_libs=""
8015
8016 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8017   echo "$ac_t""yes" 1>&6
8018   :
8019 else
8020   echo "$ac_t""no" 1>&6
8021 with_xfs=no
8022 fi
8023
8024
8025     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
8026       { test "$extra_verbose" = "yes" && cat << \EOF
8027     Defining USE_XFONTSET
8028 EOF
8029 cat >> confdefs.h <<\EOF
8030 #define USE_XFONTSET 1
8031 EOF
8032 }
8033
8034       if test "$with_xim" = "no" ; then
8035         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
8036    echo "    xemacs will be linked with \"input-method-xfs.o\""
8037  fi
8038       fi
8039     fi
8040   fi 
8041     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
8042   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
8043 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
8044 echo "configure:8045: checking for wnn/jllib.h" >&5
8045
8046 cat > conftest.$ac_ext <<EOF
8047 #line 8048 "configure"
8048 #include "confdefs.h"
8049 #include <wnn/jllib.h>
8050 EOF
8051 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8052 { (eval echo configure:8053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8053 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8054 if test -z "$ac_err"; then
8055   rm -rf conftest*
8056   eval "ac_cv_header_$ac_safe=yes"
8057 else
8058   echo "$ac_err" >&5
8059   echo "configure: failed program was:" >&5
8060   cat conftest.$ac_ext >&5
8061   rm -rf conftest*
8062   eval "ac_cv_header_$ac_safe=no"
8063 fi
8064 rm -f conftest*
8065 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8066   echo "$ac_t""yes" 1>&6
8067   :
8068 else
8069   echo "$ac_t""no" 1>&6
8070 with_wnn=no
8071 fi
8072  }
8073     if test "$with_wnn" != "no"; then
8074     for ac_func in crypt
8075 do
8076 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8077 echo "configure:8078: checking for $ac_func" >&5
8078
8079 cat > conftest.$ac_ext <<EOF
8080 #line 8081 "configure"
8081 #include "confdefs.h"
8082 /* System header to define __stub macros and hopefully few prototypes,
8083     which can conflict with char $ac_func(); below.  */
8084 #include <assert.h>
8085 /* Override any gcc2 internal prototype to avoid an error.  */
8086 /* We use char because int might match the return type of a gcc2
8087     builtin and then its argument prototype would still apply.  */
8088 char $ac_func();
8089
8090 int main() {
8091
8092 /* The GNU C library defines this for functions which it implements
8093     to always fail with ENOSYS.  Some functions are actually named
8094     something starting with __ and the normal name is an alias.  */
8095 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8096 choke me
8097 #else
8098 $ac_func();
8099 #endif
8100
8101 ; return 0; }
8102 EOF
8103 if { (eval echo configure:8104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8104   rm -rf conftest*
8105   eval "ac_cv_func_$ac_func=yes"
8106 else
8107   echo "configure: failed program was:" >&5
8108   cat conftest.$ac_ext >&5
8109   rm -rf conftest*
8110   eval "ac_cv_func_$ac_func=no"
8111 fi
8112 rm -f conftest*
8113
8114 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8115   echo "$ac_t""yes" 1>&6
8116     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8117   { test "$extra_verbose" = "yes" && cat << EOF
8118     Defining $ac_tr_func
8119 EOF
8120 cat >> confdefs.h <<EOF
8121 #define $ac_tr_func 1
8122 EOF
8123 }
8124  
8125 else
8126   echo "$ac_t""no" 1>&6
8127 fi
8128 done
8129
8130     test "$ac_cv_func_crypt" != "yes" && { 
8131 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
8132 echo "configure:8133: checking for crypt in -lcrypt" >&5
8133 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
8134
8135 xe_check_libs=" -lcrypt "
8136 cat > conftest.$ac_ext <<EOF
8137 #line 8138 "configure"
8138 #include "confdefs.h"
8139 /* Override any gcc2 internal prototype to avoid an error.  */
8140 /* We use char because int might match the return type of a gcc2
8141     builtin and then its argument prototype would still apply.  */
8142 char crypt();
8143
8144 int main() {
8145 crypt()
8146 ; return 0; }
8147 EOF
8148 if { (eval echo configure:8149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8149   rm -rf conftest*
8150   eval "ac_cv_lib_$ac_lib_var=yes"
8151 else
8152   echo "configure: failed program was:" >&5
8153   cat conftest.$ac_ext >&5
8154   rm -rf conftest*
8155   eval "ac_cv_lib_$ac_lib_var=no"
8156 fi
8157 rm -f conftest*
8158 xe_check_libs=""
8159
8160 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8161   echo "$ac_t""yes" 1>&6
8162     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8163     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8164   { test "$extra_verbose" = "yes" && cat << EOF
8165     Defining $ac_tr_lib
8166 EOF
8167 cat >> confdefs.h <<EOF
8168 #define $ac_tr_lib 1
8169 EOF
8170 }
8171
8172   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
8173
8174 else
8175   echo "$ac_t""no" 1>&6
8176 fi
8177
8178  }
8179   fi
8180     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8181     
8182 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8183 echo "configure:8184: checking for jl_dic_list_e in -lwnn" >&5
8184 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8185
8186 xe_check_libs=" -lwnn "
8187 cat > conftest.$ac_ext <<EOF
8188 #line 8189 "configure"
8189 #include "confdefs.h"
8190 /* Override any gcc2 internal prototype to avoid an error.  */
8191 /* We use char because int might match the return type of a gcc2
8192     builtin and then its argument prototype would still apply.  */
8193 char jl_dic_list_e();
8194
8195 int main() {
8196 jl_dic_list_e()
8197 ; return 0; }
8198 EOF
8199 if { (eval echo configure:8200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8200   rm -rf conftest*
8201   eval "ac_cv_lib_$ac_lib_var=yes"
8202 else
8203   echo "configure: failed program was:" >&5
8204   cat conftest.$ac_ext >&5
8205   rm -rf conftest*
8206   eval "ac_cv_lib_$ac_lib_var=no"
8207 fi
8208 rm -f conftest*
8209 xe_check_libs=""
8210
8211 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8212   echo "$ac_t""yes" 1>&6
8213   libwnn=wnn
8214 else
8215   echo "$ac_t""no" 1>&6
8216 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8217 echo "configure:8218: checking for jl_dic_list_e in -lwnn4" >&5
8218 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8219
8220 xe_check_libs=" -lwnn4 "
8221 cat > conftest.$ac_ext <<EOF
8222 #line 8223 "configure"
8223 #include "confdefs.h"
8224 /* Override any gcc2 internal prototype to avoid an error.  */
8225 /* We use char because int might match the return type of a gcc2
8226     builtin and then its argument prototype would still apply.  */
8227 char jl_dic_list_e();
8228
8229 int main() {
8230 jl_dic_list_e()
8231 ; return 0; }
8232 EOF
8233 if { (eval echo configure:8234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8234   rm -rf conftest*
8235   eval "ac_cv_lib_$ac_lib_var=yes"
8236 else
8237   echo "configure: failed program was:" >&5
8238   cat conftest.$ac_ext >&5
8239   rm -rf conftest*
8240   eval "ac_cv_lib_$ac_lib_var=no"
8241 fi
8242 rm -f conftest*
8243 xe_check_libs=""
8244
8245 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8246   echo "$ac_t""yes" 1>&6
8247   libwnn=wnn4
8248 else
8249   echo "$ac_t""no" 1>&6
8250 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8251 echo "configure:8252: checking for jl_dic_list_e in -lwnn6" >&5
8252 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8253
8254 xe_check_libs=" -lwnn6 "
8255 cat > conftest.$ac_ext <<EOF
8256 #line 8257 "configure"
8257 #include "confdefs.h"
8258 /* Override any gcc2 internal prototype to avoid an error.  */
8259 /* We use char because int might match the return type of a gcc2
8260     builtin and then its argument prototype would still apply.  */
8261 char jl_dic_list_e();
8262
8263 int main() {
8264 jl_dic_list_e()
8265 ; return 0; }
8266 EOF
8267 if { (eval echo configure:8268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8268   rm -rf conftest*
8269   eval "ac_cv_lib_$ac_lib_var=yes"
8270 else
8271   echo "configure: failed program was:" >&5
8272   cat conftest.$ac_ext >&5
8273   rm -rf conftest*
8274   eval "ac_cv_lib_$ac_lib_var=no"
8275 fi
8276 rm -f conftest*
8277 xe_check_libs=""
8278
8279 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8280   echo "$ac_t""yes" 1>&6
8281   libwnn=wnn6
8282 else
8283   echo "$ac_t""no" 1>&6
8284 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8285 echo "configure:8286: checking for dic_list_e in -lwnn6_fromsrc" >&5
8286 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8287
8288 xe_check_libs=" -lwnn6_fromsrc "
8289 cat > conftest.$ac_ext <<EOF
8290 #line 8291 "configure"
8291 #include "confdefs.h"
8292 /* Override any gcc2 internal prototype to avoid an error.  */
8293 /* We use char because int might match the return type of a gcc2
8294     builtin and then its argument prototype would still apply.  */
8295 char dic_list_e();
8296
8297 int main() {
8298 dic_list_e()
8299 ; return 0; }
8300 EOF
8301 if { (eval echo configure:8302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8302   rm -rf conftest*
8303   eval "ac_cv_lib_$ac_lib_var=yes"
8304 else
8305   echo "configure: failed program was:" >&5
8306   cat conftest.$ac_ext >&5
8307   rm -rf conftest*
8308   eval "ac_cv_lib_$ac_lib_var=no"
8309 fi
8310 rm -f conftest*
8311 xe_check_libs=""
8312
8313 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8314   echo "$ac_t""yes" 1>&6
8315   libwnn=wnn6_fromsrc
8316 else
8317   echo "$ac_t""no" 1>&6
8318 with_wnn=no
8319 fi
8320
8321
8322 fi
8323
8324
8325 fi
8326
8327
8328 fi
8329
8330
8331   fi
8332   test -z "$with_wnn" && with_wnn=yes
8333   if test "$with_wnn" = "yes"; then
8334     { test "$extra_verbose" = "yes" && cat << \EOF
8335     Defining HAVE_WNN
8336 EOF
8337 cat >> confdefs.h <<\EOF
8338 #define HAVE_WNN 1
8339 EOF
8340 }
8341
8342     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8343     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8344    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8345  fi
8346     if test "$with_wnn6" != "no"; then
8347       
8348 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8349 echo "configure:8350: checking for jl_fi_dic_list in -l$libwnn" >&5
8350 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8351
8352 xe_check_libs=" -l$libwnn "
8353 cat > conftest.$ac_ext <<EOF
8354 #line 8355 "configure"
8355 #include "confdefs.h"
8356 /* Override any gcc2 internal prototype to avoid an error.  */
8357 /* We use char because int might match the return type of a gcc2
8358     builtin and then its argument prototype would still apply.  */
8359 char jl_fi_dic_list();
8360
8361 int main() {
8362 jl_fi_dic_list()
8363 ; return 0; }
8364 EOF
8365 if { (eval echo configure:8366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8366   rm -rf conftest*
8367   eval "ac_cv_lib_$ac_lib_var=yes"
8368 else
8369   echo "configure: failed program was:" >&5
8370   cat conftest.$ac_ext >&5
8371   rm -rf conftest*
8372   eval "ac_cv_lib_$ac_lib_var=no"
8373 fi
8374 rm -f conftest*
8375 xe_check_libs=""
8376
8377 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8378   echo "$ac_t""yes" 1>&6
8379   with_wnn6=yes
8380 else
8381   echo "$ac_t""no" 1>&6
8382 fi
8383
8384
8385       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8386     Defining WNN6
8387 EOF
8388 cat >> confdefs.h <<\EOF
8389 #define WNN6 1
8390 EOF
8391 }
8392
8393     fi
8394   fi
8395
8396     canna_includes_found=no
8397   if test "$with_canna" != "no"; then
8398     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8399 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8400 echo "configure:8401: checking for canna/jrkanji.h" >&5
8401
8402 cat > conftest.$ac_ext <<EOF
8403 #line 8404 "configure"
8404 #include "confdefs.h"
8405 #include <canna/jrkanji.h>
8406 EOF
8407 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8408 { (eval echo configure:8409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8409 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8410 if test -z "$ac_err"; then
8411   rm -rf conftest*
8412   eval "ac_cv_header_$ac_safe=yes"
8413 else
8414   echo "$ac_err" >&5
8415   echo "configure: failed program was:" >&5
8416   cat conftest.$ac_ext >&5
8417   rm -rf conftest*
8418   eval "ac_cv_header_$ac_safe=no"
8419 fi
8420 rm -f conftest*
8421 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8422   echo "$ac_t""yes" 1>&6
8423   canna_includes_found=yes
8424 else
8425   echo "$ac_t""no" 1>&6
8426 fi
8427
8428   fi
8429   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8430       -d "/usr/local/canna/include"; then
8431     save_c_switch_site="$c_switch_site"
8432     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8433     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8434 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8435 echo "configure:8436: checking for canna/jrkanji.h" >&5
8436
8437 cat > conftest.$ac_ext <<EOF
8438 #line 8439 "configure"
8439 #include "confdefs.h"
8440 #include <canna/jrkanji.h>
8441 EOF
8442 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8443 { (eval echo configure:8444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8444 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8445 if test -z "$ac_err"; then
8446   rm -rf conftest*
8447   eval "ac_cv_header_$ac_safe=yes"
8448 else
8449   echo "$ac_err" >&5
8450   echo "configure: failed program was:" >&5
8451   cat conftest.$ac_ext >&5
8452   rm -rf conftest*
8453   eval "ac_cv_header_$ac_safe=no"
8454 fi
8455 rm -f conftest*
8456 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8457   echo "$ac_t""yes" 1>&6
8458   canna_includes_found=yes
8459 else
8460   echo "$ac_t""no" 1>&6
8461 fi
8462
8463     if test "$canna_includes_found" != "yes"; then
8464       c_switch_site="$save_c_switch_site"
8465       with_canna="no"
8466     fi
8467   fi
8468
8469   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8470 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8471 echo "configure:8472: checking for canna/RK.h" >&5
8472
8473 cat > conftest.$ac_ext <<EOF
8474 #line 8475 "configure"
8475 #include "confdefs.h"
8476 #include <canna/RK.h>
8477 EOF
8478 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8479 { (eval echo configure:8480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8480 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8481 if test -z "$ac_err"; then
8482   rm -rf conftest*
8483   eval "ac_cv_header_$ac_safe=yes"
8484 else
8485   echo "$ac_err" >&5
8486   echo "configure: failed program was:" >&5
8487   cat conftest.$ac_ext >&5
8488   rm -rf conftest*
8489   eval "ac_cv_header_$ac_safe=no"
8490 fi
8491 rm -f conftest*
8492 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8493   echo "$ac_t""yes" 1>&6
8494   :
8495 else
8496   echo "$ac_t""no" 1>&6
8497 with_canna=no
8498 fi
8499  }
8500   test -z "$with_canna" && { 
8501 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8502 echo "configure:8503: checking for RkBgnBun in -lRKC" >&5
8503 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8504
8505 xe_check_libs=" -lRKC "
8506 cat > conftest.$ac_ext <<EOF
8507 #line 8508 "configure"
8508 #include "confdefs.h"
8509 /* Override any gcc2 internal prototype to avoid an error.  */
8510 /* We use char because int might match the return type of a gcc2
8511     builtin and then its argument prototype would still apply.  */
8512 char RkBgnBun();
8513
8514 int main() {
8515 RkBgnBun()
8516 ; return 0; }
8517 EOF
8518 if { (eval echo configure:8519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8519   rm -rf conftest*
8520   eval "ac_cv_lib_$ac_lib_var=yes"
8521 else
8522   echo "configure: failed program was:" >&5
8523   cat conftest.$ac_ext >&5
8524   rm -rf conftest*
8525   eval "ac_cv_lib_$ac_lib_var=no"
8526 fi
8527 rm -f conftest*
8528 xe_check_libs=""
8529
8530 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8531   echo "$ac_t""yes" 1>&6
8532   :
8533 else
8534   echo "$ac_t""no" 1>&6
8535 with_canna=no
8536 fi
8537
8538  }
8539   test -z "$with_canna" && { 
8540 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8541 echo "configure:8542: checking for jrKanjiControl in -lcanna" >&5
8542 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8543
8544 xe_check_libs=" -lcanna "
8545 cat > conftest.$ac_ext <<EOF
8546 #line 8547 "configure"
8547 #include "confdefs.h"
8548 /* Override any gcc2 internal prototype to avoid an error.  */
8549 /* We use char because int might match the return type of a gcc2
8550     builtin and then its argument prototype would still apply.  */
8551 char jrKanjiControl();
8552
8553 int main() {
8554 jrKanjiControl()
8555 ; return 0; }
8556 EOF
8557 if { (eval echo configure:8558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8558   rm -rf conftest*
8559   eval "ac_cv_lib_$ac_lib_var=yes"
8560 else
8561   echo "configure: failed program was:" >&5
8562   cat conftest.$ac_ext >&5
8563   rm -rf conftest*
8564   eval "ac_cv_lib_$ac_lib_var=no"
8565 fi
8566 rm -f conftest*
8567 xe_check_libs=""
8568
8569 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8570   echo "$ac_t""yes" 1>&6
8571   :
8572 else
8573   echo "$ac_t""no" 1>&6
8574 with_canna=no
8575 fi
8576
8577  }
8578   test -z "$with_canna" && with_canna=yes
8579   if test "$with_canna" = "yes"; then
8580     { test "$extra_verbose" = "yes" && cat << \EOF
8581     Defining HAVE_CANNA
8582 EOF
8583 cat >> confdefs.h <<\EOF
8584 #define HAVE_CANNA 1
8585 EOF
8586 }
8587
8588     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8589     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8590    echo "    xemacs will be linked with \"mule-canna.o\""
8591  fi
8592   fi
8593
8594 else   for feature in xim canna wnn; do
8595     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8596       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8597     fi
8598     eval "with_${feature}=no"
8599   done
8600 fi 
8601
8602 if test "$need_motif" = "yes" ; then
8603   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8604     
8605 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8606 echo "configure:8607: checking for layout_object_getvalue in -li18n" >&5
8607 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8608
8609 xe_check_libs=" -li18n "
8610 cat > conftest.$ac_ext <<EOF
8611 #line 8612 "configure"
8612 #include "confdefs.h"
8613 /* Override any gcc2 internal prototype to avoid an error.  */
8614 /* We use char because int might match the return type of a gcc2
8615     builtin and then its argument prototype would still apply.  */
8616 char layout_object_getvalue();
8617
8618 int main() {
8619 layout_object_getvalue()
8620 ; return 0; }
8621 EOF
8622 if { (eval echo configure:8623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8623   rm -rf conftest*
8624   eval "ac_cv_lib_$ac_lib_var=yes"
8625 else
8626   echo "configure: failed program was:" >&5
8627   cat conftest.$ac_ext >&5
8628   rm -rf conftest*
8629   eval "ac_cv_lib_$ac_lib_var=no"
8630 fi
8631 rm -f conftest*
8632 xe_check_libs=""
8633
8634 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8635   echo "$ac_t""yes" 1>&6
8636   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8637 else
8638   echo "$ac_t""no" 1>&6
8639 fi
8640
8641
8642   
8643 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8644     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8645   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8646   
8647         runpath="" runpath_dirs=""
8648   if test -n "$LD_RUN_PATH"; then
8649     runpath="$LD_RUN_PATH"
8650   elif test "$GCC" = "yes"; then
8651         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8652     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8653     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8654     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8655       case "$arg" in P,* | -L* | -R* )
8656         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8657           {
8658 xe_runpath_dir="$dir"
8659   test "$xe_runpath_dir" != "/lib"     -a \
8660         "$xe_runpath_dir" != "/usr/lib" -a \
8661         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8662   eval "$xe_add_unique_runpath_dir"
8663 }
8664         done ;;
8665       esac
8666     done
8667     ld_switch_run="$ld_switch_run_save"
8668     rm -f conftest*
8669   else
8670         for arg in $ld_switch_site $ld_switch_x_site; do
8671       case "$arg" in -L*) {
8672 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8673   test "$xe_runpath_dir" != "/lib"     -a \
8674         "$xe_runpath_dir" != "/usr/lib" -a \
8675         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8676   eval "$xe_add_unique_runpath_dir"
8677 };; esac
8678     done
8679         if test "$opsys $need_motif" = "sol2 yes"; then
8680       xe_runpath_dir="/opt/SUNWdt/lib";
8681       eval "$xe_add_unique_runpath_dir";
8682     fi
8683   fi 
8684   if test -n "$runpath"; then
8685     ld_switch_run="${dash_r}${runpath}"
8686     
8687 if test "$GCC" = "yes"; then
8688   set x $ld_switch_run; shift; ld_switch_run=""
8689   while test -n "$1"; do
8690     case $1 in
8691       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8692       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8693       -Xlinker* ) ;;
8694       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8695     esac
8696     shift
8697   done
8698 fi
8699     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8700   fi
8701 fi
8702
8703 fi
8704
8705 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
8706 do
8707 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8708 echo "configure:8709: checking for $ac_func" >&5
8709
8710 cat > conftest.$ac_ext <<EOF
8711 #line 8712 "configure"
8712 #include "confdefs.h"
8713 /* System header to define __stub macros and hopefully few prototypes,
8714     which can conflict with char $ac_func(); below.  */
8715 #include <assert.h>
8716 /* Override any gcc2 internal prototype to avoid an error.  */
8717 /* We use char because int might match the return type of a gcc2
8718     builtin and then its argument prototype would still apply.  */
8719 char $ac_func();
8720
8721 int main() {
8722
8723 /* The GNU C library defines this for functions which it implements
8724     to always fail with ENOSYS.  Some functions are actually named
8725     something starting with __ and the normal name is an alias.  */
8726 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8727 choke me
8728 #else
8729 $ac_func();
8730 #endif
8731
8732 ; return 0; }
8733 EOF
8734 if { (eval echo configure:8735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8735   rm -rf conftest*
8736   eval "ac_cv_func_$ac_func=yes"
8737 else
8738   echo "configure: failed program was:" >&5
8739   cat conftest.$ac_ext >&5
8740   rm -rf conftest*
8741   eval "ac_cv_func_$ac_func=no"
8742 fi
8743 rm -f conftest*
8744
8745 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8746   echo "$ac_t""yes" 1>&6
8747     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8748   { test "$extra_verbose" = "yes" && cat << EOF
8749     Defining $ac_tr_func
8750 EOF
8751 cat >> confdefs.h <<EOF
8752 #define $ac_tr_func 1
8753 EOF
8754 }
8755  
8756 else
8757   echo "$ac_t""no" 1>&6
8758 fi
8759 done
8760
8761
8762
8763 case "$opsys" in
8764   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8765    echo "    xemacs will be linked with \"realpath.o\""
8766  fi ;;
8767   * )
8768     case "$canonical" in
8769       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8770    echo "    xemacs will be linked with \"realpath.o\""
8771  fi ;;
8772       * ) for ac_func in realpath
8773 do
8774 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8775 echo "configure:8776: checking for $ac_func" >&5
8776
8777 cat > conftest.$ac_ext <<EOF
8778 #line 8779 "configure"
8779 #include "confdefs.h"
8780 /* System header to define __stub macros and hopefully few prototypes,
8781     which can conflict with char $ac_func(); below.  */
8782 #include <assert.h>
8783 /* Override any gcc2 internal prototype to avoid an error.  */
8784 /* We use char because int might match the return type of a gcc2
8785     builtin and then its argument prototype would still apply.  */
8786 char $ac_func();
8787
8788 int main() {
8789
8790 /* The GNU C library defines this for functions which it implements
8791     to always fail with ENOSYS.  Some functions are actually named
8792     something starting with __ and the normal name is an alias.  */
8793 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8794 choke me
8795 #else
8796 $ac_func();
8797 #endif
8798
8799 ; return 0; }
8800 EOF
8801 if { (eval echo configure:8802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8802   rm -rf conftest*
8803   eval "ac_cv_func_$ac_func=yes"
8804 else
8805   echo "configure: failed program was:" >&5
8806   cat conftest.$ac_ext >&5
8807   rm -rf conftest*
8808   eval "ac_cv_func_$ac_func=no"
8809 fi
8810 rm -f conftest*
8811
8812 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8813   echo "$ac_t""yes" 1>&6
8814     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8815   { test "$extra_verbose" = "yes" && cat << EOF
8816     Defining $ac_tr_func
8817 EOF
8818 cat >> confdefs.h <<EOF
8819 #define $ac_tr_func 1
8820 EOF
8821 }
8822  
8823 else
8824   echo "$ac_t""no" 1>&6
8825 fi
8826 done
8827
8828           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8829    echo "    xemacs will be linked with \"realpath.o\""
8830  fi ;;
8831     esac ;;
8832 esac
8833
8834 for ac_func in getloadavg
8835 do
8836 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8837 echo "configure:8838: checking for $ac_func" >&5
8838
8839 cat > conftest.$ac_ext <<EOF
8840 #line 8841 "configure"
8841 #include "confdefs.h"
8842 /* System header to define __stub macros and hopefully few prototypes,
8843     which can conflict with char $ac_func(); below.  */
8844 #include <assert.h>
8845 /* Override any gcc2 internal prototype to avoid an error.  */
8846 /* We use char because int might match the return type of a gcc2
8847     builtin and then its argument prototype would still apply.  */
8848 char $ac_func();
8849
8850 int main() {
8851
8852 /* The GNU C library defines this for functions which it implements
8853     to always fail with ENOSYS.  Some functions are actually named
8854     something starting with __ and the normal name is an alias.  */
8855 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8856 choke me
8857 #else
8858 $ac_func();
8859 #endif
8860
8861 ; return 0; }
8862 EOF
8863 if { (eval echo configure:8864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8864   rm -rf conftest*
8865   eval "ac_cv_func_$ac_func=yes"
8866 else
8867   echo "configure: failed program was:" >&5
8868   cat conftest.$ac_ext >&5
8869   rm -rf conftest*
8870   eval "ac_cv_func_$ac_func=no"
8871 fi
8872 rm -f conftest*
8873
8874 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8875   echo "$ac_t""yes" 1>&6
8876     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8877   { test "$extra_verbose" = "yes" && cat << EOF
8878     Defining $ac_tr_func
8879 EOF
8880 cat >> confdefs.h <<EOF
8881 #define $ac_tr_func 1
8882 EOF
8883 }
8884  
8885 else
8886   echo "$ac_t""no" 1>&6
8887 fi
8888 done
8889
8890
8891 if test "$ac_cv_func_getloadavg" != "yes"
8892 then
8893   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
8894    echo "    xemacs will be linked with \"getloadavg.o\""
8895  fi
8896
8897     
8898 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
8899 echo "configure:8900: checking for kstat_open in -lkstat" >&5
8900 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
8901
8902 xe_check_libs=" -lkstat "
8903 cat > conftest.$ac_ext <<EOF
8904 #line 8905 "configure"
8905 #include "confdefs.h"
8906 /* Override any gcc2 internal prototype to avoid an error.  */
8907 /* We use char because int might match the return type of a gcc2
8908     builtin and then its argument prototype would still apply.  */
8909 char kstat_open();
8910
8911 int main() {
8912 kstat_open()
8913 ; return 0; }
8914 EOF
8915 if { (eval echo configure:8916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8916   rm -rf conftest*
8917   eval "ac_cv_lib_$ac_lib_var=yes"
8918 else
8919   echo "configure: failed program was:" >&5
8920   cat conftest.$ac_ext >&5
8921   rm -rf conftest*
8922   eval "ac_cv_lib_$ac_lib_var=no"
8923 fi
8924 rm -f conftest*
8925 xe_check_libs=""
8926
8927 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8928   echo "$ac_t""yes" 1>&6
8929     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8930     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8931   { test "$extra_verbose" = "yes" && cat << EOF
8932     Defining $ac_tr_lib
8933 EOF
8934 cat >> confdefs.h <<EOF
8935 #define $ac_tr_lib 1
8936 EOF
8937 }
8938
8939   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
8940
8941 else
8942   echo "$ac_t""no" 1>&6
8943 fi
8944
8945
8946
8947     
8948 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
8949 echo "configure:8950: checking for kvm_read in -lkvm" >&5
8950 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
8951
8952 xe_check_libs=" -lkvm "
8953 cat > conftest.$ac_ext <<EOF
8954 #line 8955 "configure"
8955 #include "confdefs.h"
8956 /* Override any gcc2 internal prototype to avoid an error.  */
8957 /* We use char because int might match the return type of a gcc2
8958     builtin and then its argument prototype would still apply.  */
8959 char kvm_read();
8960
8961 int main() {
8962 kvm_read()
8963 ; return 0; }
8964 EOF
8965 if { (eval echo configure:8966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8966   rm -rf conftest*
8967   eval "ac_cv_lib_$ac_lib_var=yes"
8968 else
8969   echo "configure: failed program was:" >&5
8970   cat conftest.$ac_ext >&5
8971   rm -rf conftest*
8972   eval "ac_cv_lib_$ac_lib_var=no"
8973 fi
8974 rm -f conftest*
8975 xe_check_libs=""
8976
8977 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8978   echo "$ac_t""yes" 1>&6
8979     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8980     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8981   { test "$extra_verbose" = "yes" && cat << EOF
8982     Defining $ac_tr_lib
8983 EOF
8984 cat >> confdefs.h <<EOF
8985 #define $ac_tr_lib 1
8986 EOF
8987 }
8988
8989   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
8990
8991 else
8992   echo "$ac_t""no" 1>&6
8993 fi
8994
8995
8996 fi
8997
8998 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8999 echo "configure:9000: checking whether netdb declares h_errno" >&5
9000 cat > conftest.$ac_ext <<EOF
9001 #line 9002 "configure"
9002 #include "confdefs.h"
9003 #include <netdb.h>
9004 int main() {
9005 return h_errno;
9006 ; return 0; }
9007 EOF
9008 if { (eval echo configure:9009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9009   rm -rf conftest*
9010   echo "$ac_t""yes" 1>&6
9011    { test "$extra_verbose" = "yes" && cat << \EOF
9012     Defining HAVE_H_ERRNO
9013 EOF
9014 cat >> confdefs.h <<\EOF
9015 #define HAVE_H_ERRNO 1
9016 EOF
9017 }
9018
9019 else
9020   echo "configure: failed program was:" >&5
9021   cat conftest.$ac_ext >&5
9022   rm -rf conftest*
9023   echo "$ac_t""no" 1>&6
9024 fi
9025 rm -f conftest*
9026
9027 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
9028 echo "configure:9029: checking for sigsetjmp" >&5
9029 cat > conftest.$ac_ext <<EOF
9030 #line 9031 "configure"
9031 #include "confdefs.h"
9032 #include <setjmp.h>
9033 int main() {
9034 sigjmp_buf bar; sigsetjmp (bar, 0);
9035 ; return 0; }
9036 EOF
9037 if { (eval echo configure:9038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9038   rm -rf conftest*
9039   echo "$ac_t""yes" 1>&6
9040    { test "$extra_verbose" = "yes" && cat << \EOF
9041     Defining HAVE_SIGSETJMP
9042 EOF
9043 cat >> confdefs.h <<\EOF
9044 #define HAVE_SIGSETJMP 1
9045 EOF
9046 }
9047
9048 else
9049   echo "configure: failed program was:" >&5
9050   cat conftest.$ac_ext >&5
9051   rm -rf conftest*
9052   echo "$ac_t""no" 1>&6
9053 fi
9054 rm -f conftest*
9055
9056 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
9057 echo "configure:9058: checking whether localtime caches TZ" >&5
9058
9059 if test "$ac_cv_func_tzset" = "yes"; then
9060 cat > conftest.$ac_ext <<EOF
9061 #line 9062 "configure"
9062 #include "confdefs.h"
9063 #include <time.h>
9064 #if STDC_HEADERS
9065 # include <stdlib.h>
9066 #endif
9067 extern char **environ;
9068 unset_TZ ()
9069 {
9070   char **from, **to;
9071   for (to = from = environ; (*to = *from); from++)
9072     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
9073       to++;
9074 }
9075 char TZ_GMT0[] = "TZ=GMT0";
9076 char TZ_PST8[] = "TZ=PST8";
9077 main()
9078 {
9079   time_t now = time ((time_t *) 0);
9080   int hour_GMT0, hour_unset;
9081   if (putenv (TZ_GMT0) != 0)
9082     exit (1);
9083   hour_GMT0 = localtime (&now)->tm_hour;
9084   unset_TZ ();
9085   hour_unset = localtime (&now)->tm_hour;
9086   if (putenv (TZ_PST8) != 0)
9087     exit (1);
9088   if (localtime (&now)->tm_hour == hour_GMT0)
9089     exit (1);
9090   unset_TZ ();
9091   if (localtime (&now)->tm_hour != hour_unset)
9092     exit (1);
9093   exit (0);
9094 }
9095 EOF
9096 if { (eval echo configure:9097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9097 then
9098   emacs_cv_localtime_cache=no
9099 else
9100   conftest_rc="$?"
9101   echo "configure: failed program was:" >&5
9102   cat conftest.$ac_ext >&5
9103   rm -fr conftest*
9104   emacs_cv_localtime_cache=yes
9105 fi
9106 rm -fr conftest*
9107 else
9108         # If we lack tzset, report that localtime does not cache TZ,
9109         # since we can't invalidate the cache if we don't have tzset.
9110         emacs_cv_localtime_cache=no
9111 fi
9112 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
9113 if test $emacs_cv_localtime_cache = yes; then
9114   { test "$extra_verbose" = "yes" && cat << \EOF
9115     Defining LOCALTIME_CACHE
9116 EOF
9117 cat >> confdefs.h <<\EOF
9118 #define LOCALTIME_CACHE 1
9119 EOF
9120 }
9121
9122 fi
9123
9124 if test "$HAVE_TIMEVAL" = "yes"; then
9125 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
9126 echo "configure:9127: checking whether gettimeofday accepts one or two arguments" >&5
9127 cat > conftest.$ac_ext <<EOF
9128 #line 9129 "configure"
9129 #include "confdefs.h"
9130
9131 #ifdef TIME_WITH_SYS_TIME
9132 #include <sys/time.h>
9133 #include <time.h>
9134 #else
9135 #ifdef HAVE_SYS_TIME_H
9136 #include <sys/time.h>
9137 #else
9138 #include <time.h>
9139 #endif
9140 #endif
9141   
9142 int main() {
9143
9144   struct timeval time;
9145   struct timezone dummy;
9146   gettimeofday (&time, &dummy);
9147
9148 ; return 0; }
9149 EOF
9150 if { (eval echo configure:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9151   rm -rf conftest*
9152   echo "$ac_t""two" 1>&6
9153 else
9154   echo "configure: failed program was:" >&5
9155   cat conftest.$ac_ext >&5
9156   rm -rf conftest*
9157   echo "$ac_t""one" 1>&6
9158    { test "$extra_verbose" = "yes" && cat << \EOF
9159     Defining GETTIMEOFDAY_ONE_ARGUMENT
9160 EOF
9161 cat >> confdefs.h <<\EOF
9162 #define GETTIMEOFDAY_ONE_ARGUMENT 1
9163 EOF
9164 }
9165
9166 fi
9167 rm -f conftest*
9168 fi
9169
9170
9171 echo $ac_n "checking for inline""... $ac_c" 1>&6
9172 echo "configure:9173: checking for inline" >&5
9173
9174 ac_cv_c_inline=no
9175 for ac_kw in inline __inline__ __inline; do
9176   cat > conftest.$ac_ext <<EOF
9177 #line 9178 "configure"
9178 #include "confdefs.h"
9179
9180 int main() {
9181 } $ac_kw foo() {
9182 ; return 0; }
9183 EOF
9184 if { (eval echo configure:9185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9185   rm -rf conftest*
9186   ac_cv_c_inline=$ac_kw; break
9187 else
9188   echo "configure: failed program was:" >&5
9189   cat conftest.$ac_ext >&5
9190 fi
9191 rm -f conftest*
9192 done
9193
9194
9195 echo "$ac_t""$ac_cv_c_inline" 1>&6
9196 case "$ac_cv_c_inline" in
9197   inline | yes) ;;
9198   no) { test "$extra_verbose" = "yes" && cat << \EOF
9199     Defining inline = 
9200 EOF
9201 cat >> confdefs.h <<\EOF
9202 #define inline 
9203 EOF
9204 }
9205  ;;
9206   *)  { test "$extra_verbose" = "yes" && cat << EOF
9207     Defining inline = $ac_cv_c_inline
9208 EOF
9209 cat >> confdefs.h <<EOF
9210 #define inline $ac_cv_c_inline
9211 EOF
9212 }
9213  ;;
9214 esac
9215
9216 if test "$ac_cv_c_inline" != "no"; then
9217   { test "$extra_verbose" = "yes" && cat << \EOF
9218     Defining HAVE_INLINE
9219 EOF
9220 cat >> confdefs.h <<\EOF
9221 #define HAVE_INLINE 1
9222 EOF
9223 }
9224
9225   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9226    echo "    xemacs will be linked with \"inline.o\""
9227  fi
9228 fi
9229
9230
9231 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9232 # for constant arguments.  Useless!
9233 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9234 echo "configure:9235: checking for working alloca.h" >&5
9235
9236 cat > conftest.$ac_ext <<EOF
9237 #line 9238 "configure"
9238 #include "confdefs.h"
9239 #include <alloca.h>
9240 int main() {
9241 char *p = alloca(2 * sizeof(int));
9242 ; return 0; }
9243 EOF
9244 if { (eval echo configure:9245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9245   rm -rf conftest*
9246   ac_cv_header_alloca_h=yes
9247 else
9248   echo "configure: failed program was:" >&5
9249   cat conftest.$ac_ext >&5
9250   rm -rf conftest*
9251   ac_cv_header_alloca_h=no
9252 fi
9253 rm -f conftest*
9254
9255 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9256 if test $ac_cv_header_alloca_h = yes; then
9257   { test "$extra_verbose" = "yes" && cat << \EOF
9258     Defining HAVE_ALLOCA_H
9259 EOF
9260 cat >> confdefs.h <<\EOF
9261 #define HAVE_ALLOCA_H 1
9262 EOF
9263 }
9264
9265 fi
9266
9267 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9268 echo "configure:9269: checking for alloca" >&5
9269
9270 cat > conftest.$ac_ext <<EOF
9271 #line 9272 "configure"
9272 #include "confdefs.h"
9273
9274 #ifdef __GNUC__
9275 # define alloca __builtin_alloca
9276 #else
9277 # ifdef _MSC_VER
9278 #  include <malloc.h>
9279 #  define alloca _alloca
9280 # else
9281 #  if HAVE_ALLOCA_H
9282 #   include <alloca.h>
9283 #  else
9284 #   ifdef _AIX
9285  #pragma alloca
9286 #   else
9287 #    ifndef alloca /* predefined by HP cc +Olibcalls */
9288 char *alloca ();
9289 #    endif
9290 #   endif
9291 #  endif
9292 # endif
9293 #endif
9294
9295 int main() {
9296 char *p = (char *) alloca(1);
9297 ; return 0; }
9298 EOF
9299 if { (eval echo configure:9300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9300   rm -rf conftest*
9301   ac_cv_func_alloca_works=yes
9302 else
9303   echo "configure: failed program was:" >&5
9304   cat conftest.$ac_ext >&5
9305   rm -rf conftest*
9306   ac_cv_func_alloca_works=no
9307 fi
9308 rm -f conftest*
9309
9310 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9311 if test $ac_cv_func_alloca_works = yes; then
9312   { test "$extra_verbose" = "yes" && cat << \EOF
9313     Defining HAVE_ALLOCA
9314 EOF
9315 cat >> confdefs.h <<\EOF
9316 #define HAVE_ALLOCA 1
9317 EOF
9318 }
9319
9320 fi
9321
9322 if test $ac_cv_func_alloca_works = no; then
9323   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9324   # that cause trouble.  Some versions do not even contain alloca or
9325   # contain a buggy version.  If you still want to use their alloca,
9326   # use ar to extract alloca.o from them instead of compiling alloca.c.
9327   ALLOCA=alloca.${ac_objext}
9328   { test "$extra_verbose" = "yes" && cat << \EOF
9329     Defining C_ALLOCA
9330 EOF
9331 cat >> confdefs.h <<\EOF
9332 #define C_ALLOCA 1
9333 EOF
9334 }
9335
9336
9337 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9338 echo "configure:9339: checking whether alloca needs Cray hooks" >&5
9339
9340 cat > conftest.$ac_ext <<EOF
9341 #line 9342 "configure"
9342 #include "confdefs.h"
9343 #if defined(CRAY) && ! defined(CRAY2)
9344 webecray
9345 #else
9346 wenotbecray
9347 #endif
9348
9349 EOF
9350 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9351   egrep "webecray" >/dev/null 2>&1; then
9352   rm -rf conftest*
9353   ac_cv_os_cray=yes
9354 else
9355   rm -rf conftest*
9356   ac_cv_os_cray=no
9357 fi
9358 rm -f conftest*
9359
9360
9361 echo "$ac_t""$ac_cv_os_cray" 1>&6
9362 if test $ac_cv_os_cray = yes; then
9363 for ac_func in _getb67 GETB67 getb67; do
9364   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9365 echo "configure:9366: checking for $ac_func" >&5
9366
9367 cat > conftest.$ac_ext <<EOF
9368 #line 9369 "configure"
9369 #include "confdefs.h"
9370 /* System header to define __stub macros and hopefully few prototypes,
9371     which can conflict with char $ac_func(); below.  */
9372 #include <assert.h>
9373 /* Override any gcc2 internal prototype to avoid an error.  */
9374 /* We use char because int might match the return type of a gcc2
9375     builtin and then its argument prototype would still apply.  */
9376 char $ac_func();
9377
9378 int main() {
9379
9380 /* The GNU C library defines this for functions which it implements
9381     to always fail with ENOSYS.  Some functions are actually named
9382     something starting with __ and the normal name is an alias.  */
9383 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9384 choke me
9385 #else
9386 $ac_func();
9387 #endif
9388
9389 ; return 0; }
9390 EOF
9391 if { (eval echo configure:9392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9392   rm -rf conftest*
9393   eval "ac_cv_func_$ac_func=yes"
9394 else
9395   echo "configure: failed program was:" >&5
9396   cat conftest.$ac_ext >&5
9397   rm -rf conftest*
9398   eval "ac_cv_func_$ac_func=no"
9399 fi
9400 rm -f conftest*
9401
9402 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9403   echo "$ac_t""yes" 1>&6
9404   { test "$extra_verbose" = "yes" && cat << EOF
9405     Defining CRAY_STACKSEG_END = $ac_func
9406 EOF
9407 cat >> confdefs.h <<EOF
9408 #define CRAY_STACKSEG_END $ac_func
9409 EOF
9410 }
9411
9412   break
9413 else
9414   echo "$ac_t""no" 1>&6
9415 fi
9416
9417 done
9418 fi
9419
9420 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9421 echo "configure:9422: checking stack direction for C alloca" >&5
9422
9423 cat > conftest.$ac_ext <<EOF
9424 #line 9425 "configure"
9425 #include "confdefs.h"
9426 find_stack_direction ()
9427 {
9428   static char *addr = 0;
9429   auto char dummy;
9430   if (addr == 0)
9431     {
9432       addr = &dummy;
9433       return find_stack_direction ();
9434     }
9435   else
9436     return (&dummy > addr) ? 1 : -1;
9437 }
9438 main ()
9439 {
9440   exit (find_stack_direction() < 0);
9441 }
9442 EOF
9443 if { (eval echo configure:9444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9444 then
9445   ac_cv_c_stack_direction=1
9446 else
9447   conftest_rc="$?"
9448   echo "configure: failed program was:" >&5
9449   cat conftest.$ac_ext >&5
9450   rm -fr conftest*
9451   ac_cv_c_stack_direction=-1
9452 fi
9453 rm -fr conftest*
9454
9455 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9456 { test "$extra_verbose" = "yes" && cat << EOF
9457     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9458 EOF
9459 cat >> confdefs.h <<EOF
9460 #define STACK_DIRECTION $ac_cv_c_stack_direction
9461 EOF
9462 }
9463
9464 fi
9465
9466 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9467    echo "    xemacs will be linked with \"$ALLOCA\""
9468  fi
9469
9470 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9471 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9472 echo "configure:9473: checking for vfork.h" >&5
9473
9474 cat > conftest.$ac_ext <<EOF
9475 #line 9476 "configure"
9476 #include "confdefs.h"
9477 #include <vfork.h>
9478 EOF
9479 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9480 { (eval echo configure:9481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9481 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9482 if test -z "$ac_err"; then
9483   rm -rf conftest*
9484   eval "ac_cv_header_$ac_safe=yes"
9485 else
9486   echo "$ac_err" >&5
9487   echo "configure: failed program was:" >&5
9488   cat conftest.$ac_ext >&5
9489   rm -rf conftest*
9490   eval "ac_cv_header_$ac_safe=no"
9491 fi
9492 rm -f conftest*
9493 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9494   echo "$ac_t""yes" 1>&6
9495   { test "$extra_verbose" = "yes" && cat << \EOF
9496     Defining HAVE_VFORK_H
9497 EOF
9498 cat >> confdefs.h <<\EOF
9499 #define HAVE_VFORK_H 1
9500 EOF
9501 }
9502
9503 else
9504   echo "$ac_t""no" 1>&6
9505 fi
9506
9507 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9508 echo "configure:9509: checking for working vfork" >&5
9509
9510 cat > conftest.$ac_ext <<EOF
9511 #line 9512 "configure"
9512 #include "confdefs.h"
9513 /* Thanks to Paul Eggert for this test.  */
9514 #include <stdio.h>
9515 #include <sys/types.h>
9516 #include <sys/stat.h>
9517 #ifdef HAVE_UNISTD_H
9518 #include <unistd.h>
9519 #endif
9520 #ifdef HAVE_VFORK_H
9521 #include <vfork.h>
9522 #endif
9523 /* On some sparc systems, changes by the child to local and incoming
9524    argument registers are propagated back to the parent.
9525    The compiler is told about this with #include <vfork.h>,
9526    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9527    Test for this by using a static variable whose address
9528    is put into a register that is clobbered by the vfork.  */
9529 static
9530 #ifdef __cplusplus
9531 sparc_address_test (int arg)
9532 #else
9533 sparc_address_test (arg) int arg;
9534 #endif
9535 {
9536   static pid_t child;
9537   if (!child) {
9538     child = vfork ();
9539     if (child < 0) {
9540       perror ("vfork");
9541       _exit(2);
9542     }
9543     if (!child) {
9544       arg = getpid();
9545       write(-1, "", 0);
9546       _exit (arg);
9547     }
9548   }
9549 }
9550 main() {
9551   pid_t parent = getpid ();
9552   pid_t child;
9553
9554   sparc_address_test ();
9555
9556   child = vfork ();
9557
9558   if (child == 0) {
9559     /* Here is another test for sparc vfork register problems.
9560        This test uses lots of local variables, at least
9561        as many local variables as main has allocated so far
9562        including compiler temporaries.  4 locals are enough for
9563        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9564        A buggy compiler should reuse the register of parent
9565        for one of the local variables, since it will think that
9566        parent can't possibly be used any more in this routine.
9567        Assigning to the local variable will thus munge parent
9568        in the parent process.  */
9569     pid_t
9570       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9571       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9572     /* Convince the compiler that p..p7 are live; otherwise, it might
9573        use the same hardware register for all 8 local variables.  */
9574     if (p != p1 || p != p2 || p != p3 || p != p4
9575         || p != p5 || p != p6 || p != p7)
9576       _exit(1);
9577
9578     /* On some systems (e.g. IRIX 3.3),
9579        vfork doesn't separate parent from child file descriptors.
9580        If the child closes a descriptor before it execs or exits,
9581        this munges the parent's descriptor as well.
9582        Test for this by closing stdout in the child.  */
9583     _exit(close(fileno(stdout)) != 0);
9584   } else {
9585     int status;
9586     struct stat st;
9587
9588     while (wait(&status) != child)
9589       ;
9590     exit(
9591          /* Was there some problem with vforking?  */
9592          child < 0
9593
9594          /* Did the child fail?  (This shouldn't happen.)  */
9595          || status
9596
9597          /* Did the vfork/compiler bug occur?  */
9598          || parent != getpid()
9599
9600          /* Did the file descriptor bug occur?  */
9601          || fstat(fileno(stdout), &st) != 0
9602          );
9603   }
9604 }
9605 EOF
9606 if { (eval echo configure:9607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9607 then
9608   ac_cv_func_vfork_works=yes
9609 else
9610   conftest_rc="$?"
9611   echo "configure: failed program was:" >&5
9612   cat conftest.$ac_ext >&5
9613   rm -fr conftest*
9614   ac_cv_func_vfork_works=no
9615 fi
9616 rm -fr conftest*
9617
9618 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9619 if test $ac_cv_func_vfork_works = no; then
9620   { test "$extra_verbose" = "yes" && cat << \EOF
9621     Defining vfork = fork
9622 EOF
9623 cat >> confdefs.h <<\EOF
9624 #define vfork fork
9625 EOF
9626 }
9627
9628 fi
9629
9630
9631 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9632 echo "configure:9633: checking for working strcoll" >&5
9633
9634 cat > conftest.$ac_ext <<EOF
9635 #line 9636 "configure"
9636 #include "confdefs.h"
9637 #include <string.h>
9638 main ()
9639 {
9640   exit (strcoll ("abc", "def") >= 0 ||
9641         strcoll ("ABC", "DEF") >= 0 ||
9642         strcoll ("123", "456") >= 0);
9643 }
9644 EOF
9645 if { (eval echo configure:9646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9646 then
9647   ac_cv_func_strcoll_works=yes
9648 else
9649   conftest_rc="$?"
9650   echo "configure: failed program was:" >&5
9651   cat conftest.$ac_ext >&5
9652   rm -fr conftest*
9653   ac_cv_func_strcoll_works=no
9654 fi
9655 rm -fr conftest*
9656
9657 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9658 if test $ac_cv_func_strcoll_works = yes; then
9659   { test "$extra_verbose" = "yes" && cat << \EOF
9660     Defining HAVE_STRCOLL
9661 EOF
9662 cat >> confdefs.h <<\EOF
9663 #define HAVE_STRCOLL 1
9664 EOF
9665 }
9666
9667 fi
9668
9669
9670 for ac_func in getpgrp
9671 do
9672 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9673 echo "configure:9674: checking for $ac_func" >&5
9674
9675 cat > conftest.$ac_ext <<EOF
9676 #line 9677 "configure"
9677 #include "confdefs.h"
9678 /* System header to define __stub macros and hopefully few prototypes,
9679     which can conflict with char $ac_func(); below.  */
9680 #include <assert.h>
9681 /* Override any gcc2 internal prototype to avoid an error.  */
9682 /* We use char because int might match the return type of a gcc2
9683     builtin and then its argument prototype would still apply.  */
9684 char $ac_func();
9685
9686 int main() {
9687
9688 /* The GNU C library defines this for functions which it implements
9689     to always fail with ENOSYS.  Some functions are actually named
9690     something starting with __ and the normal name is an alias.  */
9691 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9692 choke me
9693 #else
9694 $ac_func();
9695 #endif
9696
9697 ; return 0; }
9698 EOF
9699 if { (eval echo configure:9700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9700   rm -rf conftest*
9701   eval "ac_cv_func_$ac_func=yes"
9702 else
9703   echo "configure: failed program was:" >&5
9704   cat conftest.$ac_ext >&5
9705   rm -rf conftest*
9706   eval "ac_cv_func_$ac_func=no"
9707 fi
9708 rm -f conftest*
9709
9710 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9711   echo "$ac_t""yes" 1>&6
9712     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9713   { test "$extra_verbose" = "yes" && cat << EOF
9714     Defining $ac_tr_func
9715 EOF
9716 cat >> confdefs.h <<EOF
9717 #define $ac_tr_func 1
9718 EOF
9719 }
9720  
9721 else
9722   echo "$ac_t""no" 1>&6
9723 fi
9724 done
9725
9726 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9727 echo "configure:9728: checking whether getpgrp takes no argument" >&5
9728
9729 cat > conftest.$ac_ext <<EOF
9730 #line 9731 "configure"
9731 #include "confdefs.h"
9732
9733 /*
9734  * If this system has a BSD-style getpgrp(),
9735  * which takes a pid argument, exit unsuccessfully.
9736  *
9737  * Snarfed from Chet Ramey's bash pgrp.c test program
9738  */
9739 #include <stdio.h>
9740 #include <sys/types.h>
9741
9742 int     pid;
9743 int     pg1, pg2, pg3, pg4;
9744 int     ng, np, s, child;
9745
9746 main()
9747 {
9748         pid = getpid();
9749         pg1 = getpgrp(0);
9750         pg2 = getpgrp();
9751         pg3 = getpgrp(pid);
9752         pg4 = getpgrp(1);
9753
9754         /*
9755          * If all of these values are the same, it's pretty sure that
9756          * we're on a system that ignores getpgrp's first argument.
9757          */
9758         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9759                 exit(0);
9760
9761         child = fork();
9762         if (child < 0)
9763                 exit(1);
9764         else if (child == 0) {
9765                 np = getpid();
9766                 /*
9767                  * If this is Sys V, this will not work; pgrp will be
9768                  * set to np because setpgrp just changes a pgrp to be
9769                  * the same as the pid.
9770                  */
9771                 setpgrp(np, pg1);
9772                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9773                 if (ng == pg1) {
9774                         exit(1);
9775                 } else {
9776                         exit(0);
9777                 }
9778         } else {
9779                 wait(&s);
9780                 exit(s>>8);
9781         }
9782 }
9783
9784 EOF
9785 if { (eval echo configure:9786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9786 then
9787   ac_cv_func_getpgrp_void=yes
9788 else
9789   conftest_rc="$?"
9790   echo "configure: failed program was:" >&5
9791   cat conftest.$ac_ext >&5
9792   rm -fr conftest*
9793   ac_cv_func_getpgrp_void=no
9794 fi
9795 rm -fr conftest*
9796
9797
9798 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9799 if test $ac_cv_func_getpgrp_void = yes; then
9800   { test "$extra_verbose" = "yes" && cat << \EOF
9801     Defining GETPGRP_VOID
9802 EOF
9803 cat >> confdefs.h <<\EOF
9804 #define GETPGRP_VOID 1
9805 EOF
9806 }
9807
9808 fi
9809
9810
9811 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9812 echo "configure:9813: checking for working mmap" >&5
9813 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9814 cat > conftest.$ac_ext <<EOF
9815 #line 9816 "configure"
9816 #include "confdefs.h"
9817 #include <stdio.h>
9818 #include <unistd.h>
9819 #include <fcntl.h>
9820 #include <sys/mman.h>
9821
9822 #ifndef MAP_VARIABLE
9823 #define MAP_VARIABLE 0
9824 #endif
9825
9826 #ifndef MAP_FAILED
9827 #define MAP_FAILED -1
9828 #endif
9829
9830 int main (int argc, char *argv[])
9831 {
9832   int fd = -1;
9833   caddr_t p;
9834 #ifndef MAP_ANONYMOUS
9835   fd = open ("/dev/zero", O_RDWR);
9836   if (fd < 0)
9837     return 1;
9838 #define MAP_ANONYMOUS 0
9839 #endif
9840   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9841            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9842            fd, 0) != (void *) MAP_FAILED)
9843     return 0;
9844   perror ("conftest: mmap failed");
9845   return 1;
9846 }
9847 EOF
9848 if { (eval echo configure:9849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9849 then
9850   have_mmap=yes
9851 else
9852   conftest_rc="$?"
9853   echo "configure: failed program was:" >&5
9854   cat conftest.$ac_ext >&5
9855   rm -fr conftest*
9856   have_mmap=no
9857 fi
9858 rm -fr conftest* ;;
9859 esac
9860 echo "$ac_t""$have_mmap" 1>&6
9861 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9862     Defining HAVE_MMAP
9863 EOF
9864 cat >> confdefs.h <<\EOF
9865 #define HAVE_MMAP 1
9866 EOF
9867 }
9868
9869 for ac_hdr in unistd.h
9870 do
9871 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9872 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9873 echo "configure:9874: checking for $ac_hdr" >&5
9874
9875 cat > conftest.$ac_ext <<EOF
9876 #line 9877 "configure"
9877 #include "confdefs.h"
9878 #include <$ac_hdr>
9879 EOF
9880 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9881 { (eval echo configure:9882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9882 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9883 if test -z "$ac_err"; then
9884   rm -rf conftest*
9885   eval "ac_cv_header_$ac_safe=yes"
9886 else
9887   echo "$ac_err" >&5
9888   echo "configure: failed program was:" >&5
9889   cat conftest.$ac_ext >&5
9890   rm -rf conftest*
9891   eval "ac_cv_header_$ac_safe=no"
9892 fi
9893 rm -f conftest*
9894 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9895   echo "$ac_t""yes" 1>&6
9896     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9897   { test "$extra_verbose" = "yes" && cat << EOF
9898     Defining $ac_tr_hdr
9899 EOF
9900 cat >> confdefs.h <<EOF
9901 #define $ac_tr_hdr 1
9902 EOF
9903 }
9904  
9905 else
9906   echo "$ac_t""no" 1>&6
9907 fi
9908 done
9909
9910 for ac_func in getpagesize
9911 do
9912 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9913 echo "configure:9914: checking for $ac_func" >&5
9914
9915 cat > conftest.$ac_ext <<EOF
9916 #line 9917 "configure"
9917 #include "confdefs.h"
9918 /* System header to define __stub macros and hopefully few prototypes,
9919     which can conflict with char $ac_func(); below.  */
9920 #include <assert.h>
9921 /* Override any gcc2 internal prototype to avoid an error.  */
9922 /* We use char because int might match the return type of a gcc2
9923     builtin and then its argument prototype would still apply.  */
9924 char $ac_func();
9925
9926 int main() {
9927
9928 /* The GNU C library defines this for functions which it implements
9929     to always fail with ENOSYS.  Some functions are actually named
9930     something starting with __ and the normal name is an alias.  */
9931 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9932 choke me
9933 #else
9934 $ac_func();
9935 #endif
9936
9937 ; return 0; }
9938 EOF
9939 if { (eval echo configure:9940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9940   rm -rf conftest*
9941   eval "ac_cv_func_$ac_func=yes"
9942 else
9943   echo "configure: failed program was:" >&5
9944   cat conftest.$ac_ext >&5
9945   rm -rf conftest*
9946   eval "ac_cv_func_$ac_func=no"
9947 fi
9948 rm -f conftest*
9949
9950 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9951   echo "$ac_t""yes" 1>&6
9952     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9953   { test "$extra_verbose" = "yes" && cat << EOF
9954     Defining $ac_tr_func
9955 EOF
9956 cat >> confdefs.h <<EOF
9957 #define $ac_tr_func 1
9958 EOF
9959 }
9960  
9961 else
9962   echo "$ac_t""no" 1>&6
9963 fi
9964 done
9965
9966 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9967 echo "configure:9968: checking for working mmap" >&5
9968
9969 cat > conftest.$ac_ext <<EOF
9970 #line 9971 "configure"
9971 #include "confdefs.h"
9972
9973 /* Thanks to Mike Haertel and Jim Avera for this test.
9974    Here is a matrix of mmap possibilities:
9975         mmap private not fixed
9976         mmap private fixed at somewhere currently unmapped
9977         mmap private fixed at somewhere already mapped
9978         mmap shared not fixed
9979         mmap shared fixed at somewhere currently unmapped
9980         mmap shared fixed at somewhere already mapped
9981    For private mappings, we should verify that changes cannot be read()
9982    back from the file, nor mmap's back from the file at a different
9983    address.  (There have been systems where private was not correctly
9984    implemented like the infamous i386 svr4.0, and systems where the
9985    VM page cache was not coherent with the filesystem buffer cache
9986    like early versions of FreeBSD and possibly contemporary NetBSD.)
9987    For shared mappings, we should conversely verify that changes get
9988    propogated back to all the places they're supposed to be.
9989
9990    Grep wants private fixed already mapped.
9991    The main things grep needs to know about mmap are:
9992    * does it exist and is it safe to write into the mmap'd area
9993    * how to use it (BSD variants)  */
9994 #include <sys/types.h>
9995 #include <fcntl.h>
9996 #include <sys/mman.h>
9997
9998 /* This mess was copied from the GNU getpagesize.h.  */
9999 #ifndef HAVE_GETPAGESIZE
10000 # ifdef HAVE_UNISTD_H
10001 #  include <unistd.h>
10002 # endif
10003
10004 /* Assume that all systems that can run configure have sys/param.h.  */
10005 # ifndef HAVE_SYS_PARAM_H
10006 #  define HAVE_SYS_PARAM_H 1
10007 # endif
10008
10009 # ifdef _SC_PAGESIZE
10010 #  define getpagesize() sysconf(_SC_PAGESIZE)
10011 # else /* no _SC_PAGESIZE */
10012 #  ifdef HAVE_SYS_PARAM_H
10013 #   include <sys/param.h>
10014 #   ifdef EXEC_PAGESIZE
10015 #    define getpagesize() EXEC_PAGESIZE
10016 #   else /* no EXEC_PAGESIZE */
10017 #    ifdef NBPG
10018 #     define getpagesize() NBPG * CLSIZE
10019 #     ifndef CLSIZE
10020 #      define CLSIZE 1
10021 #     endif /* no CLSIZE */
10022 #    else /* no NBPG */
10023 #     ifdef NBPC
10024 #      define getpagesize() NBPC
10025 #     else /* no NBPC */
10026 #      ifdef PAGESIZE
10027 #       define getpagesize() PAGESIZE
10028 #      endif /* PAGESIZE */
10029 #     endif /* no NBPC */
10030 #    endif /* no NBPG */
10031 #   endif /* no EXEC_PAGESIZE */
10032 #  else /* no HAVE_SYS_PARAM_H */
10033 #   define getpagesize() 8192   /* punt totally */
10034 #  endif /* no HAVE_SYS_PARAM_H */
10035 # endif /* no _SC_PAGESIZE */
10036
10037 #endif /* no HAVE_GETPAGESIZE */
10038
10039 #ifdef __cplusplus
10040 extern "C" { void *malloc(unsigned); }
10041 #else
10042 char *malloc();
10043 #endif
10044
10045 int
10046 main()
10047 {
10048         char *data, *data2, *data3;
10049         int i, pagesize;
10050         int fd;
10051
10052         pagesize = getpagesize();
10053
10054         /*
10055          * First, make a file with some known garbage in it.
10056          */
10057         data = malloc(pagesize);
10058         if (!data)
10059                 exit(1);
10060         for (i = 0; i < pagesize; ++i)
10061                 *(data + i) = rand();
10062         umask(0);
10063         fd = creat("conftestmmap", 0600);
10064         if (fd < 0)
10065                 exit(1);
10066         if (write(fd, data, pagesize) != pagesize)
10067                 exit(1);
10068         close(fd);
10069
10070         /*
10071          * Next, try to mmap the file at a fixed address which
10072          * already has something else allocated at it.  If we can,
10073          * also make sure that we see the same garbage.
10074          */
10075         fd = open("conftestmmap", O_RDWR);
10076         if (fd < 0)
10077                 exit(1);
10078         data2 = malloc(2 * pagesize);
10079         if (!data2)
10080                 exit(1);
10081         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
10082         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
10083             MAP_PRIVATE | MAP_FIXED, fd, 0L))
10084                 exit(1);
10085         for (i = 0; i < pagesize; ++i)
10086                 if (*(data + i) != *(data2 + i))
10087                         exit(1);
10088
10089         /*
10090          * Finally, make sure that changes to the mapped area
10091          * do not percolate back to the file as seen by read().
10092          * (This is a bug on some variants of i386 svr4.0.)
10093          */
10094         for (i = 0; i < pagesize; ++i)
10095                 *(data2 + i) = *(data2 + i) + 1;
10096         data3 = malloc(pagesize);
10097         if (!data3)
10098                 exit(1);
10099         if (read(fd, data3, pagesize) != pagesize)
10100                 exit(1);
10101         for (i = 0; i < pagesize; ++i)
10102                 if (*(data + i) != *(data3 + i))
10103                         exit(1);
10104         close(fd);
10105         unlink("conftestmmap");
10106         exit(0);
10107 }
10108
10109 EOF
10110 if { (eval echo configure:10111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10111 then
10112   ac_cv_func_mmap_fixed_mapped=yes
10113 else
10114   conftest_rc="$?"
10115   echo "configure: failed program was:" >&5
10116   cat conftest.$ac_ext >&5
10117   rm -fr conftest*
10118   ac_cv_func_mmap_fixed_mapped=no
10119 fi
10120 rm -fr conftest*
10121
10122 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
10123 if test $ac_cv_func_mmap_fixed_mapped = yes; then
10124   { test "$extra_verbose" = "yes" && cat << \EOF
10125     Defining HAVE_MMAP
10126 EOF
10127 cat >> confdefs.h <<\EOF
10128 #define HAVE_MMAP 1
10129 EOF
10130 }
10131
10132 fi
10133
10134
10135 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
10136 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
10137 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10138     Defining REL_ALLOC
10139 EOF
10140 cat >> confdefs.h <<\EOF
10141 #define REL_ALLOC 1
10142 EOF
10143 }
10144
10145
10146 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
10147 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
10148 echo "configure:10149: checking for termios.h" >&5
10149
10150 cat > conftest.$ac_ext <<EOF
10151 #line 10152 "configure"
10152 #include "confdefs.h"
10153 #include <termios.h>
10154 EOF
10155 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10156 { (eval echo configure:10157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10157 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10158 if test -z "$ac_err"; then
10159   rm -rf conftest*
10160   eval "ac_cv_header_$ac_safe=yes"
10161 else
10162   echo "$ac_err" >&5
10163   echo "configure: failed program was:" >&5
10164   cat conftest.$ac_ext >&5
10165   rm -rf conftest*
10166   eval "ac_cv_header_$ac_safe=no"
10167 fi
10168 rm -f conftest*
10169 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10170   echo "$ac_t""yes" 1>&6
10171   { test "$extra_verbose" = "yes" && cat << \EOF
10172     Defining HAVE_TERMIOS
10173 EOF
10174 cat >> confdefs.h <<\EOF
10175 #define HAVE_TERMIOS 1
10176 EOF
10177 }
10178
10179   { test "$extra_verbose" = "yes" && cat << \EOF
10180     Defining SIGNALS_VIA_CHARACTERS
10181 EOF
10182 cat >> confdefs.h <<\EOF
10183 #define SIGNALS_VIA_CHARACTERS 1
10184 EOF
10185 }
10186
10187   { test "$extra_verbose" = "yes" && cat << \EOF
10188     Defining NO_TERMIO
10189 EOF
10190 cat >> confdefs.h <<\EOF
10191 #define NO_TERMIO 1
10192 EOF
10193 }
10194
10195 else
10196   echo "$ac_t""no" 1>&6
10197 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10198 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10199 echo "configure:10200: checking for termio.h" >&5
10200
10201 cat > conftest.$ac_ext <<EOF
10202 #line 10203 "configure"
10203 #include "confdefs.h"
10204 #include <termio.h>
10205 EOF
10206 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10207 { (eval echo configure:10208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10208 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10209 if test -z "$ac_err"; then
10210   rm -rf conftest*
10211   eval "ac_cv_header_$ac_safe=yes"
10212 else
10213   echo "$ac_err" >&5
10214   echo "configure: failed program was:" >&5
10215   cat conftest.$ac_ext >&5
10216   rm -rf conftest*
10217   eval "ac_cv_header_$ac_safe=no"
10218 fi
10219 rm -f conftest*
10220 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10221   echo "$ac_t""yes" 1>&6
10222   { test "$extra_verbose" = "yes" && cat << \EOF
10223     Defining HAVE_TERMIO
10224 EOF
10225 cat >> confdefs.h <<\EOF
10226 #define HAVE_TERMIO 1
10227 EOF
10228 }
10229
10230 else
10231   echo "$ac_t""no" 1>&6
10232 fi
10233
10234 fi
10235
10236
10237
10238 echo $ac_n "checking for socket""... $ac_c" 1>&6
10239 echo "configure:10240: checking for socket" >&5
10240
10241 cat > conftest.$ac_ext <<EOF
10242 #line 10243 "configure"
10243 #include "confdefs.h"
10244 /* System header to define __stub macros and hopefully few prototypes,
10245     which can conflict with char socket(); below.  */
10246 #include <assert.h>
10247 /* Override any gcc2 internal prototype to avoid an error.  */
10248 /* We use char because int might match the return type of a gcc2
10249     builtin and then its argument prototype would still apply.  */
10250 char socket();
10251
10252 int main() {
10253
10254 /* The GNU C library defines this for functions which it implements
10255     to always fail with ENOSYS.  Some functions are actually named
10256     something starting with __ and the normal name is an alias.  */
10257 #if defined (__stub_socket) || defined (__stub___socket)
10258 choke me
10259 #else
10260 socket();
10261 #endif
10262
10263 ; return 0; }
10264 EOF
10265 if { (eval echo configure:10266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10266   rm -rf conftest*
10267   eval "ac_cv_func_socket=yes"
10268 else
10269   echo "configure: failed program was:" >&5
10270   cat conftest.$ac_ext >&5
10271   rm -rf conftest*
10272   eval "ac_cv_func_socket=no"
10273 fi
10274 rm -f conftest*
10275
10276 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10277   echo "$ac_t""yes" 1>&6
10278   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10279 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10280 echo "configure:10281: checking for netinet/in.h" >&5
10281
10282 cat > conftest.$ac_ext <<EOF
10283 #line 10284 "configure"
10284 #include "confdefs.h"
10285 #include <netinet/in.h>
10286 EOF
10287 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10288 { (eval echo configure:10289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10289 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10290 if test -z "$ac_err"; then
10291   rm -rf conftest*
10292   eval "ac_cv_header_$ac_safe=yes"
10293 else
10294   echo "$ac_err" >&5
10295   echo "configure: failed program was:" >&5
10296   cat conftest.$ac_ext >&5
10297   rm -rf conftest*
10298   eval "ac_cv_header_$ac_safe=no"
10299 fi
10300 rm -f conftest*
10301 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10302   echo "$ac_t""yes" 1>&6
10303   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10304 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10305 echo "configure:10306: checking for arpa/inet.h" >&5
10306
10307 cat > conftest.$ac_ext <<EOF
10308 #line 10309 "configure"
10309 #include "confdefs.h"
10310 #include <arpa/inet.h>
10311 EOF
10312 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10313 { (eval echo configure:10314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10314 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10315 if test -z "$ac_err"; then
10316   rm -rf conftest*
10317   eval "ac_cv_header_$ac_safe=yes"
10318 else
10319   echo "$ac_err" >&5
10320   echo "configure: failed program was:" >&5
10321   cat conftest.$ac_ext >&5
10322   rm -rf conftest*
10323   eval "ac_cv_header_$ac_safe=no"
10324 fi
10325 rm -f conftest*
10326 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10327   echo "$ac_t""yes" 1>&6
10328   
10329   { test "$extra_verbose" = "yes" && cat << \EOF
10330     Defining HAVE_SOCKETS
10331 EOF
10332 cat >> confdefs.h <<\EOF
10333 #define HAVE_SOCKETS 1
10334 EOF
10335 }
10336
10337       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10338 echo "configure:10339: checking "for sun_len member in struct sockaddr_un"" >&5
10339       cat > conftest.$ac_ext <<EOF
10340 #line 10341 "configure"
10341 #include "confdefs.h"
10342
10343 #include <sys/types.h>
10344 #include <sys/socket.h>
10345 #include <sys/un.h>
10346       
10347 int main() {
10348 static struct sockaddr_un x; x.sun_len = 1;
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_SOCKADDR_SUN_LEN
10355 EOF
10356 cat >> confdefs.h <<\EOF
10357 #define HAVE_SOCKADDR_SUN_LEN 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       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10369 echo "configure:10370: checking "for ip_mreq struct in netinet/in.h"" >&5
10370       cat > conftest.$ac_ext <<EOF
10371 #line 10372 "configure"
10372 #include "confdefs.h"
10373
10374 #include <sys/types.h>
10375 #include <netinet/in.h>
10376       
10377 int main() {
10378 static struct ip_mreq x;
10379 ; return 0; }
10380 EOF
10381 if { (eval echo configure:10382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10382   rm -rf conftest*
10383   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10384     Defining HAVE_MULTICAST
10385 EOF
10386 cat >> confdefs.h <<\EOF
10387 #define HAVE_MULTICAST 1
10388 EOF
10389 }
10390
10391 else
10392   echo "configure: failed program was:" >&5
10393   cat conftest.$ac_ext >&5
10394   rm -rf conftest*
10395   echo "$ac_t""no" 1>&6
10396 fi
10397 rm -f conftest*
10398 else
10399   echo "$ac_t""no" 1>&6
10400 fi
10401
10402 else
10403   echo "$ac_t""no" 1>&6
10404 fi
10405
10406 else
10407   echo "$ac_t""no" 1>&6
10408 fi
10409
10410
10411 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10412 echo "configure:10413: checking for msgget" >&5
10413
10414 cat > conftest.$ac_ext <<EOF
10415 #line 10416 "configure"
10416 #include "confdefs.h"
10417 /* System header to define __stub macros and hopefully few prototypes,
10418     which can conflict with char msgget(); below.  */
10419 #include <assert.h>
10420 /* Override any gcc2 internal prototype to avoid an error.  */
10421 /* We use char because int might match the return type of a gcc2
10422     builtin and then its argument prototype would still apply.  */
10423 char msgget();
10424
10425 int main() {
10426
10427 /* The GNU C library defines this for functions which it implements
10428     to always fail with ENOSYS.  Some functions are actually named
10429     something starting with __ and the normal name is an alias.  */
10430 #if defined (__stub_msgget) || defined (__stub___msgget)
10431 choke me
10432 #else
10433 msgget();
10434 #endif
10435
10436 ; return 0; }
10437 EOF
10438 if { (eval echo configure:10439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10439   rm -rf conftest*
10440   eval "ac_cv_func_msgget=yes"
10441 else
10442   echo "configure: failed program was:" >&5
10443   cat conftest.$ac_ext >&5
10444   rm -rf conftest*
10445   eval "ac_cv_func_msgget=no"
10446 fi
10447 rm -f conftest*
10448
10449 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10450   echo "$ac_t""yes" 1>&6
10451   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10452 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10453 echo "configure:10454: checking for sys/ipc.h" >&5
10454
10455 cat > conftest.$ac_ext <<EOF
10456 #line 10457 "configure"
10457 #include "confdefs.h"
10458 #include <sys/ipc.h>
10459 EOF
10460 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10461 { (eval echo configure:10462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10462 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10463 if test -z "$ac_err"; then
10464   rm -rf conftest*
10465   eval "ac_cv_header_$ac_safe=yes"
10466 else
10467   echo "$ac_err" >&5
10468   echo "configure: failed program was:" >&5
10469   cat conftest.$ac_ext >&5
10470   rm -rf conftest*
10471   eval "ac_cv_header_$ac_safe=no"
10472 fi
10473 rm -f conftest*
10474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10475   echo "$ac_t""yes" 1>&6
10476   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10477 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10478 echo "configure:10479: checking for sys/msg.h" >&5
10479
10480 cat > conftest.$ac_ext <<EOF
10481 #line 10482 "configure"
10482 #include "confdefs.h"
10483 #include <sys/msg.h>
10484 EOF
10485 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10486 { (eval echo configure:10487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10487 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10488 if test -z "$ac_err"; then
10489   rm -rf conftest*
10490   eval "ac_cv_header_$ac_safe=yes"
10491 else
10492   echo "$ac_err" >&5
10493   echo "configure: failed program was:" >&5
10494   cat conftest.$ac_ext >&5
10495   rm -rf conftest*
10496   eval "ac_cv_header_$ac_safe=no"
10497 fi
10498 rm -f conftest*
10499 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10500   echo "$ac_t""yes" 1>&6
10501   { test "$extra_verbose" = "yes" && cat << \EOF
10502     Defining HAVE_SYSVIPC
10503 EOF
10504 cat >> confdefs.h <<\EOF
10505 #define HAVE_SYSVIPC 1
10506 EOF
10507 }
10508
10509 else
10510   echo "$ac_t""no" 1>&6
10511 fi
10512
10513 else
10514   echo "$ac_t""no" 1>&6
10515 fi
10516
10517 else
10518   echo "$ac_t""no" 1>&6
10519 fi
10520
10521
10522 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10523 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10524 echo "configure:10525: checking for dirent.h" >&5
10525
10526 cat > conftest.$ac_ext <<EOF
10527 #line 10528 "configure"
10528 #include "confdefs.h"
10529 #include <dirent.h>
10530 EOF
10531 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10532 { (eval echo configure:10533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10533 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10534 if test -z "$ac_err"; then
10535   rm -rf conftest*
10536   eval "ac_cv_header_$ac_safe=yes"
10537 else
10538   echo "$ac_err" >&5
10539   echo "configure: failed program was:" >&5
10540   cat conftest.$ac_ext >&5
10541   rm -rf conftest*
10542   eval "ac_cv_header_$ac_safe=no"
10543 fi
10544 rm -f conftest*
10545 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10546   echo "$ac_t""yes" 1>&6
10547   { test "$extra_verbose" = "yes" && cat << \EOF
10548     Defining SYSV_SYSTEM_DIR
10549 EOF
10550 cat >> confdefs.h <<\EOF
10551 #define SYSV_SYSTEM_DIR 1
10552 EOF
10553 }
10554
10555 else
10556   echo "$ac_t""no" 1>&6
10557 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10558 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10559 echo "configure:10560: checking for sys/dir.h" >&5
10560
10561 cat > conftest.$ac_ext <<EOF
10562 #line 10563 "configure"
10563 #include "confdefs.h"
10564 #include <sys/dir.h>
10565 EOF
10566 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10567 { (eval echo configure:10568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10568 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10569 if test -z "$ac_err"; then
10570   rm -rf conftest*
10571   eval "ac_cv_header_$ac_safe=yes"
10572 else
10573   echo "$ac_err" >&5
10574   echo "configure: failed program was:" >&5
10575   cat conftest.$ac_ext >&5
10576   rm -rf conftest*
10577   eval "ac_cv_header_$ac_safe=no"
10578 fi
10579 rm -f conftest*
10580 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10581   echo "$ac_t""yes" 1>&6
10582   :
10583 else
10584   echo "$ac_t""no" 1>&6
10585 { test "$extra_verbose" = "yes" && cat << \EOF
10586     Defining NONSYSTEM_DIR_LIBRARY
10587 EOF
10588 cat >> confdefs.h <<\EOF
10589 #define NONSYSTEM_DIR_LIBRARY 1
10590 EOF
10591 }
10592
10593 fi
10594
10595 fi
10596
10597
10598 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10599 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10600 echo "configure:10601: checking for nlist.h" >&5
10601
10602 cat > conftest.$ac_ext <<EOF
10603 #line 10604 "configure"
10604 #include "confdefs.h"
10605 #include <nlist.h>
10606 EOF
10607 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10608 { (eval echo configure:10609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10609 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10610 if test -z "$ac_err"; then
10611   rm -rf conftest*
10612   eval "ac_cv_header_$ac_safe=yes"
10613 else
10614   echo "$ac_err" >&5
10615   echo "configure: failed program was:" >&5
10616   cat conftest.$ac_ext >&5
10617   rm -rf conftest*
10618   eval "ac_cv_header_$ac_safe=no"
10619 fi
10620 rm -f conftest*
10621 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10622   echo "$ac_t""yes" 1>&6
10623   { test "$extra_verbose" = "yes" && cat << \EOF
10624     Defining NLIST_STRUCT
10625 EOF
10626 cat >> confdefs.h <<\EOF
10627 #define NLIST_STRUCT 1
10628 EOF
10629 }
10630
10631 else
10632   echo "$ac_t""no" 1>&6
10633 fi
10634
10635
10636
10637 echo "checking "for sound support"" 1>&6
10638 echo "configure:10639: checking "for sound support"" >&5
10639 case "$with_sound" in
10640   native | both ) with_native_sound=yes;;
10641   nas    | no   ) with_native_sound=no;;
10642 esac
10643 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10644
10645 if test "$with_native_sound" != "no"; then
10646     if test -n "$native_sound_lib"; then
10647     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10648 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10649 echo "configure:10650: checking for multimedia/audio_device.h" >&5
10650
10651 cat > conftest.$ac_ext <<EOF
10652 #line 10653 "configure"
10653 #include "confdefs.h"
10654 #include <multimedia/audio_device.h>
10655 EOF
10656 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10657 { (eval echo configure:10658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10658 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10659 if test -z "$ac_err"; then
10660   rm -rf conftest*
10661   eval "ac_cv_header_$ac_safe=yes"
10662 else
10663   echo "$ac_err" >&5
10664   echo "configure: failed program was:" >&5
10665   cat conftest.$ac_ext >&5
10666   rm -rf conftest*
10667   eval "ac_cv_header_$ac_safe=no"
10668 fi
10669 rm -f conftest*
10670 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10671   echo "$ac_t""yes" 1>&6
10672   sound_found=yes sound_cflags=""
10673       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10674    echo "    xemacs will be linked with \"sunplay.o\""
10675  fi
10676 else
10677   echo "$ac_t""no" 1>&6
10678 fi
10679
10680   fi
10681
10682     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10683     sound_found=yes
10684     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10685    echo "    xemacs will be linked with \"sunplay.o\""
10686  fi
10687     if test -d "/usr/demo/SOUND/include"
10688       then sound_cflags="-I/usr/demo/SOUND/include"
10689       else sound_cflags="-I/usr/demo/SOUND"
10690     fi
10691     if test -z "$native_sound_lib" ; then
10692       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10693         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10694         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10695       fi
10696     fi
10697   fi
10698
10699     if test -z "$sound_found"; then
10700     case "$canonical" in
10701     *-sgi-* )
10702       if test -z "$native_sound_lib"; then
10703         
10704 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10705 echo "configure:10706: checking for ALopenport in -laudio" >&5
10706 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10707
10708 xe_check_libs=" -laudio "
10709 cat > conftest.$ac_ext <<EOF
10710 #line 10711 "configure"
10711 #include "confdefs.h"
10712 /* Override any gcc2 internal prototype to avoid an error.  */
10713 /* We use char because int might match the return type of a gcc2
10714     builtin and then its argument prototype would still apply.  */
10715 char ALopenport();
10716
10717 int main() {
10718 ALopenport()
10719 ; return 0; }
10720 EOF
10721 if { (eval echo configure:10722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10722   rm -rf conftest*
10723   eval "ac_cv_lib_$ac_lib_var=yes"
10724 else
10725   echo "configure: failed program was:" >&5
10726   cat conftest.$ac_ext >&5
10727   rm -rf conftest*
10728   eval "ac_cv_lib_$ac_lib_var=no"
10729 fi
10730 rm -f conftest*
10731 xe_check_libs=""
10732
10733 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10734   echo "$ac_t""yes" 1>&6
10735   native_sound_lib="-laudio"
10736 else
10737   echo "$ac_t""no" 1>&6
10738 fi
10739
10740
10741       fi
10742       if test -n "$native_sound_lib"; then
10743         sound_found=yes sound_cflags=""
10744         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10745    echo "    xemacs will be linked with \"sgiplay.o\""
10746  fi
10747       fi ;;
10748     hppa*-hp-hpux* )
10749       if test -z "$native_sound_lib"; then
10750         
10751 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10752 echo "configure:10753: checking for AOpenAudio in -lAlib" >&5
10753 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10754
10755 xe_check_libs=" -lAlib "
10756 cat > conftest.$ac_ext <<EOF
10757 #line 10758 "configure"
10758 #include "confdefs.h"
10759 /* Override any gcc2 internal prototype to avoid an error.  */
10760 /* We use char because int might match the return type of a gcc2
10761     builtin and then its argument prototype would still apply.  */
10762 char AOpenAudio();
10763
10764 int main() {
10765 AOpenAudio()
10766 ; return 0; }
10767 EOF
10768 if { (eval echo configure:10769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10769   rm -rf conftest*
10770   eval "ac_cv_lib_$ac_lib_var=yes"
10771 else
10772   echo "configure: failed program was:" >&5
10773   cat conftest.$ac_ext >&5
10774   rm -rf conftest*
10775   eval "ac_cv_lib_$ac_lib_var=no"
10776 fi
10777 rm -f conftest*
10778 xe_check_libs=""
10779
10780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10781   echo "$ac_t""yes" 1>&6
10782   native_sound_lib="-lAlib"
10783 else
10784   echo "$ac_t""no" 1>&6
10785 fi
10786
10787
10788       fi
10789       if test -n "$native_sound_lib"; then
10790         sound_found=yes
10791         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10792    echo "    xemacs will be linked with \"hpplay.o\""
10793  fi
10794         if test "$GCC" = "yes" # Kludge city
10795           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10796           else sound_cflags="+e -I/usr/audio/examples"
10797         fi
10798       fi ;;
10799     esac
10800   fi
10801
10802     if test -z "$sound_found"; then
10803     for dir in "machine" "sys" "linux"; do
10804       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10805 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10806 echo "configure:10807: checking for ${dir}/soundcard.h" >&5
10807
10808 cat > conftest.$ac_ext <<EOF
10809 #line 10810 "configure"
10810 #include "confdefs.h"
10811 #include <${dir}/soundcard.h>
10812 EOF
10813 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10814 { (eval echo configure:10815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10815 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10816 if test -z "$ac_err"; then
10817   rm -rf conftest*
10818   eval "ac_cv_header_$ac_safe=yes"
10819 else
10820   echo "$ac_err" >&5
10821   echo "configure: failed program was:" >&5
10822   cat conftest.$ac_ext >&5
10823   rm -rf conftest*
10824   eval "ac_cv_header_$ac_safe=no"
10825 fi
10826 rm -f conftest*
10827 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10828   echo "$ac_t""yes" 1>&6
10829   sound_found=yes
10830         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10831    echo "    xemacs will be linked with \"linuxplay.o\""
10832  fi
10833         { test "$extra_verbose" = "yes" && cat << EOF
10834     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10835 EOF
10836 cat >> confdefs.h <<EOF
10837 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10838 EOF
10839 }
10840
10841         break
10842 else
10843   echo "$ac_t""no" 1>&6
10844 fi
10845
10846     done
10847   fi
10848
10849   test "$sound_found" = "yes" && with_native_sound=yes
10850 fi
10851
10852 if test -z "$with_sound"; then
10853   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10854     with_sound=native
10855   fi
10856 fi
10857
10858 if test "$with_native_sound" = "yes"; then
10859   { test "$extra_verbose" = "yes" && cat << \EOF
10860     Defining HAVE_NATIVE_SOUND
10861 EOF
10862 cat >> confdefs.h <<\EOF
10863 #define HAVE_NATIVE_SOUND 1
10864 EOF
10865 }
10866
10867   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10868 fi
10869
10870 case "$with_sound" in both | nas )
10871   { test "$extra_verbose" = "yes" && cat << \EOF
10872     Defining HAVE_NAS_SOUND
10873 EOF
10874 cat >> confdefs.h <<\EOF
10875 #define HAVE_NAS_SOUND 1
10876 EOF
10877 }
10878
10879   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10880    echo "    xemacs will be linked with \"nas.o\""
10881  fi
10882   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10883       cat > conftest.$ac_ext <<EOF
10884 #line 10885 "configure"
10885 #include "confdefs.h"
10886 #include <audio/Xtutil.h>
10887 EOF
10888 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10889   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10890   :
10891 else
10892   rm -rf conftest*
10893   { test "$extra_verbose" = "yes" && cat << \EOF
10894     Defining NAS_NO_ERROR_JUMP
10895 EOF
10896 cat >> confdefs.h <<\EOF
10897 #define NAS_NO_ERROR_JUMP 1
10898 EOF
10899 }
10900
10901 fi
10902 rm -f conftest*
10903
10904 esac
10905
10906
10907 test -z "$with_tty" && with_tty=yes
10908
10909 if test "$with_tty" = "yes"  ; then
10910   echo "checking for TTY-related features" 1>&6
10911 echo "configure:10912: checking for TTY-related features" >&5
10912   { test "$extra_verbose" = "yes" && cat << \EOF
10913     Defining HAVE_TTY
10914 EOF
10915 cat >> confdefs.h <<\EOF
10916 #define HAVE_TTY 1
10917 EOF
10918 }
10919
10920   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
10921    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\""
10922  fi
10923
10924     if test -z "$with_ncurses"; then
10925     
10926 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10927 echo "configure:10928: checking for tgetent in -lncurses" >&5
10928 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10929
10930 xe_check_libs=" -lncurses "
10931 cat > conftest.$ac_ext <<EOF
10932 #line 10933 "configure"
10933 #include "confdefs.h"
10934 /* Override any gcc2 internal prototype to avoid an error.  */
10935 /* We use char because int might match the return type of a gcc2
10936     builtin and then its argument prototype would still apply.  */
10937 char tgetent();
10938
10939 int main() {
10940 tgetent()
10941 ; return 0; }
10942 EOF
10943 if { (eval echo configure:10944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10944   rm -rf conftest*
10945   eval "ac_cv_lib_$ac_lib_var=yes"
10946 else
10947   echo "configure: failed program was:" >&5
10948   cat conftest.$ac_ext >&5
10949   rm -rf conftest*
10950   eval "ac_cv_lib_$ac_lib_var=no"
10951 fi
10952 rm -f conftest*
10953 xe_check_libs=""
10954
10955 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10956   echo "$ac_t""yes" 1>&6
10957   with_ncurses=yes
10958 else
10959   echo "$ac_t""no" 1>&6
10960 with_ncurses=no
10961 fi
10962
10963
10964   fi
10965   if test "$with_ncurses" = "yes"; then
10966     { test "$extra_verbose" = "yes" && cat << \EOF
10967     Defining HAVE_NCURSES
10968 EOF
10969 cat >> confdefs.h <<\EOF
10970 #define HAVE_NCURSES 1
10971 EOF
10972 }
10973
10974     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10975 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10976 echo "configure:10977: checking for ncurses/curses.h" >&5
10977
10978 cat > conftest.$ac_ext <<EOF
10979 #line 10980 "configure"
10980 #include "confdefs.h"
10981 #include <ncurses/curses.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   curses_h_path=ncurses/curses.h
11000 else
11001   echo "$ac_t""no" 1>&6
11002 fi
11003
11004     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
11005 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
11006 echo "configure:11007: checking for ncurses/term.h" >&5
11007
11008 cat > conftest.$ac_ext <<EOF
11009 #line 11010 "configure"
11010 #include "confdefs.h"
11011 #include <ncurses/term.h>
11012 EOF
11013 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11014 { (eval echo configure:11015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11015 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11016 if test -z "$ac_err"; then
11017   rm -rf conftest*
11018   eval "ac_cv_header_$ac_safe=yes"
11019 else
11020   echo "$ac_err" >&5
11021   echo "configure: failed program was:" >&5
11022   cat conftest.$ac_ext >&5
11023   rm -rf conftest*
11024   eval "ac_cv_header_$ac_safe=no"
11025 fi
11026 rm -f conftest*
11027 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11028   echo "$ac_t""yes" 1>&6
11029   term_h_path=ncurses/term.h
11030 else
11031   echo "$ac_t""no" 1>&6
11032 fi
11033
11034     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
11035    echo "    xemacs will be linked with \"terminfo.o\""
11036  fi
11037     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
11038
11039     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
11040                         save_c_switch_site="$c_switch_site"
11041       c_switch_site="$c_switch_site -I/usr/include/ncurses"
11042       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
11043 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
11044 echo "configure:11045: checking for ncurses/curses.h" >&5
11045
11046 cat > conftest.$ac_ext <<EOF
11047 #line 11048 "configure"
11048 #include "confdefs.h"
11049 #include <ncurses/curses.h>
11050 EOF
11051 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11052 { (eval echo configure:11053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11053 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11054 if test -z "$ac_err"; then
11055   rm -rf conftest*
11056   eval "ac_cv_header_$ac_safe=yes"
11057 else
11058   echo "$ac_err" >&5
11059   echo "configure: failed program was:" >&5
11060   cat conftest.$ac_ext >&5
11061   rm -rf conftest*
11062   eval "ac_cv_header_$ac_safe=no"
11063 fi
11064 rm -f conftest*
11065 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11066   echo "$ac_t""yes" 1>&6
11067   curses_h_path=ncurses/curses.h
11068 else
11069   echo "$ac_t""no" 1>&6
11070 fi
11071
11072       if test "$ac_cv_header_ncurses_curses_h" = "yes"
11073         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
11074         else c_switch_site="$save_c_switch_site"
11075       fi
11076     fi
11077   else         if test "$have_terminfo" = "yes"; then
11078       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
11079    echo "    xemacs will be linked with \"terminfo.o\""
11080  fi
11081       if test -n "$libs_termcap"; then
11082         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11083       else
11084         for lib in curses termlib termcap; do
11085           
11086 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
11087 echo "configure:11088: checking for tgetent in -l$lib" >&5
11088 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
11089
11090 xe_check_libs=" -l$lib "
11091 cat > conftest.$ac_ext <<EOF
11092 #line 11093 "configure"
11093 #include "confdefs.h"
11094 /* Override any gcc2 internal prototype to avoid an error.  */
11095 /* We use char because int might match the return type of a gcc2
11096     builtin and then its argument prototype would still apply.  */
11097 char tgetent();
11098
11099 int main() {
11100 tgetent()
11101 ; return 0; }
11102 EOF
11103 if { (eval echo configure:11104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11104   rm -rf conftest*
11105   eval "ac_cv_lib_$ac_lib_var=yes"
11106 else
11107   echo "configure: failed program was:" >&5
11108   cat conftest.$ac_ext >&5
11109   rm -rf conftest*
11110   eval "ac_cv_lib_$ac_lib_var=no"
11111 fi
11112 rm -f conftest*
11113 xe_check_libs=""
11114
11115 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11116   echo "$ac_t""yes" 1>&6
11117   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
11118 else
11119   echo "$ac_t""no" 1>&6
11120 fi
11121
11122
11123         done
11124       fi
11125     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
11126    echo "    xemacs will be linked with \"tparam.o\""
11127  fi
11128                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
11129       if test -n "$libs_termcap"; then
11130         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11131       else
11132         
11133 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
11134 echo "configure:11135: checking for tgetent in -lcurses" >&5
11135 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
11136
11137 xe_check_libs=" -lcurses "
11138 cat > conftest.$ac_ext <<EOF
11139 #line 11140 "configure"
11140 #include "confdefs.h"
11141 /* Override any gcc2 internal prototype to avoid an error.  */
11142 /* We use char because int might match the return type of a gcc2
11143     builtin and then its argument prototype would still apply.  */
11144 char tgetent();
11145
11146 int main() {
11147 tgetent()
11148 ; return 0; }
11149 EOF
11150 if { (eval echo configure:11151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11151   rm -rf conftest*
11152   eval "ac_cv_lib_$ac_lib_var=yes"
11153 else
11154   echo "configure: failed program was:" >&5
11155   cat conftest.$ac_ext >&5
11156   rm -rf conftest*
11157   eval "ac_cv_lib_$ac_lib_var=no"
11158 fi
11159 rm -f conftest*
11160 xe_check_libs=""
11161
11162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11163   echo "$ac_t""yes" 1>&6
11164   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
11165 else
11166   echo "$ac_t""no" 1>&6
11167 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
11168 echo "configure:11169: checking for tgetent in -ltermcap" >&5
11169 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
11170
11171 xe_check_libs=" -ltermcap "
11172 cat > conftest.$ac_ext <<EOF
11173 #line 11174 "configure"
11174 #include "confdefs.h"
11175 /* Override any gcc2 internal prototype to avoid an error.  */
11176 /* We use char because int might match the return type of a gcc2
11177     builtin and then its argument prototype would still apply.  */
11178 char tgetent();
11179
11180 int main() {
11181 tgetent()
11182 ; return 0; }
11183 EOF
11184 if { (eval echo configure:11185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11185   rm -rf conftest*
11186   eval "ac_cv_lib_$ac_lib_var=yes"
11187 else
11188   echo "configure: failed program was:" >&5
11189   cat conftest.$ac_ext >&5
11190   rm -rf conftest*
11191   eval "ac_cv_lib_$ac_lib_var=no"
11192 fi
11193 rm -f conftest*
11194 xe_check_libs=""
11195
11196 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11197   echo "$ac_t""yes" 1>&6
11198   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11199 else
11200   echo "$ac_t""no" 1>&6
11201 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11202    echo "    xemacs will be linked with \"termcap.o\""
11203  fi
11204 fi
11205
11206
11207 fi
11208
11209
11210       fi
11211     fi
11212   fi
11213   { test "$extra_verbose" = "yes" && cat << EOF
11214     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11215 EOF
11216 cat >> confdefs.h <<EOF
11217 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11218 EOF
11219 }
11220
11221   { test "$extra_verbose" = "yes" && cat << EOF
11222     Defining TERM_H_PATH = "${term_h_path-term.h}"
11223 EOF
11224 cat >> confdefs.h <<EOF
11225 #define TERM_H_PATH "${term_h_path-term.h}"
11226 EOF
11227 }
11228
11229
11230     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11231 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11232 echo "configure:11233: checking for gpm.h" >&5
11233
11234 cat > conftest.$ac_ext <<EOF
11235 #line 11236 "configure"
11236 #include "confdefs.h"
11237 #include <gpm.h>
11238 EOF
11239 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11240 { (eval echo configure:11241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11241 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11242 if test -z "$ac_err"; then
11243   rm -rf conftest*
11244   eval "ac_cv_header_$ac_safe=yes"
11245 else
11246   echo "$ac_err" >&5
11247   echo "configure: failed program was:" >&5
11248   cat conftest.$ac_ext >&5
11249   rm -rf conftest*
11250   eval "ac_cv_header_$ac_safe=no"
11251 fi
11252 rm -f conftest*
11253 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11254   echo "$ac_t""yes" 1>&6
11255   :
11256 else
11257   echo "$ac_t""no" 1>&6
11258 with_gpm=no
11259 fi
11260  }
11261   test -z "$with_gpm" && { 
11262 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11263 echo "configure:11264: checking for Gpm_Open in -lgpm" >&5
11264 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11265
11266 xe_check_libs=" -lgpm "
11267 cat > conftest.$ac_ext <<EOF
11268 #line 11269 "configure"
11269 #include "confdefs.h"
11270 /* Override any gcc2 internal prototype to avoid an error.  */
11271 /* We use char because int might match the return type of a gcc2
11272     builtin and then its argument prototype would still apply.  */
11273 char Gpm_Open();
11274
11275 int main() {
11276 Gpm_Open()
11277 ; return 0; }
11278 EOF
11279 if { (eval echo configure:11280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11280   rm -rf conftest*
11281   eval "ac_cv_lib_$ac_lib_var=yes"
11282 else
11283   echo "configure: failed program was:" >&5
11284   cat conftest.$ac_ext >&5
11285   rm -rf conftest*
11286   eval "ac_cv_lib_$ac_lib_var=no"
11287 fi
11288 rm -f conftest*
11289 xe_check_libs=""
11290
11291 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11292   echo "$ac_t""yes" 1>&6
11293   with_gpm=yes
11294 else
11295   echo "$ac_t""no" 1>&6
11296 with_gpm=no
11297 fi
11298
11299  }
11300   if test "$with_gpm" = "yes"; then
11301     { test "$extra_verbose" = "yes" && cat << \EOF
11302     Defining HAVE_GPM
11303 EOF
11304 cat >> confdefs.h <<\EOF
11305 #define HAVE_GPM 1
11306 EOF
11307 }
11308
11309     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11310    echo "    xemacs will be linked with \"gpmevent.o\""
11311  fi
11312     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11313   fi
11314
11315 else   for feature in ncurses gpm; do
11316     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11317       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11318     fi
11319     eval "with_${feature}=no"
11320   done
11321 fi 
11322 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11323    echo "    xemacs will be linked with \"event-unixoid.o\""
11324  fi
11325
11326
11327 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11328   != "no no no" && echo "checking for database support" 1>&6
11329 echo "configure:11330: checking for database support" >&5
11330
11331 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11332   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11333 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11334 echo "configure:11335: checking for ndbm.h" >&5
11335
11336 cat > conftest.$ac_ext <<EOF
11337 #line 11338 "configure"
11338 #include "confdefs.h"
11339 #include <ndbm.h>
11340 EOF
11341 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11342 { (eval echo configure:11343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11343 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11344 if test -z "$ac_err"; then
11345   rm -rf conftest*
11346   eval "ac_cv_header_$ac_safe=yes"
11347 else
11348   echo "$ac_err" >&5
11349   echo "configure: failed program was:" >&5
11350   cat conftest.$ac_ext >&5
11351   rm -rf conftest*
11352   eval "ac_cv_header_$ac_safe=no"
11353 fi
11354 rm -f conftest*
11355 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11356   echo "$ac_t""yes" 1>&6
11357   :
11358 else
11359   echo "$ac_t""no" 1>&6
11360
11361     test "$with_database_gnudbm" = "yes" -o \
11362          "$with_database_dbm"    = "yes" && \
11363       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11364     with_database_gnudbm=no with_database_dbm=no
11365 fi
11366
11367 fi
11368
11369 if test "$with_database_gnudbm" != "no"; then
11370   
11371 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11372 echo "configure:11373: checking for dbm_open in -lgdbm" >&5
11373 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11374
11375 xe_check_libs=" -lgdbm "
11376 cat > conftest.$ac_ext <<EOF
11377 #line 11378 "configure"
11378 #include "confdefs.h"
11379 /* Override any gcc2 internal prototype to avoid an error.  */
11380 /* We use char because int might match the return type of a gcc2
11381     builtin and then its argument prototype would still apply.  */
11382 char dbm_open();
11383
11384 int main() {
11385 dbm_open()
11386 ; return 0; }
11387 EOF
11388 if { (eval echo configure:11389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11389   rm -rf conftest*
11390   eval "ac_cv_lib_$ac_lib_var=yes"
11391 else
11392   echo "configure: failed program was:" >&5
11393   cat conftest.$ac_ext >&5
11394   rm -rf conftest*
11395   eval "ac_cv_lib_$ac_lib_var=no"
11396 fi
11397 rm -f conftest*
11398 xe_check_libs=""
11399
11400 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11401   echo "$ac_t""yes" 1>&6
11402   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11403 else
11404   echo "$ac_t""no" 1>&6
11405 if test "$with_database_gnudbm" = "yes"; then
11406      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11407    fi
11408    with_database_gnudbm=no
11409 fi
11410
11411
11412 fi
11413
11414 if test "$with_database_dbm" != "no"; then
11415   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11416 echo "configure:11417: checking for dbm_open" >&5
11417
11418 cat > conftest.$ac_ext <<EOF
11419 #line 11420 "configure"
11420 #include "confdefs.h"
11421 /* System header to define __stub macros and hopefully few prototypes,
11422     which can conflict with char dbm_open(); below.  */
11423 #include <assert.h>
11424 /* Override any gcc2 internal prototype to avoid an error.  */
11425 /* We use char because int might match the return type of a gcc2
11426     builtin and then its argument prototype would still apply.  */
11427 char dbm_open();
11428
11429 int main() {
11430
11431 /* The GNU C library defines this for functions which it implements
11432     to always fail with ENOSYS.  Some functions are actually named
11433     something starting with __ and the normal name is an alias.  */
11434 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11435 choke me
11436 #else
11437 dbm_open();
11438 #endif
11439
11440 ; return 0; }
11441 EOF
11442 if { (eval echo configure:11443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11443   rm -rf conftest*
11444   eval "ac_cv_func_dbm_open=yes"
11445 else
11446   echo "configure: failed program was:" >&5
11447   cat conftest.$ac_ext >&5
11448   rm -rf conftest*
11449   eval "ac_cv_func_dbm_open=no"
11450 fi
11451 rm -f conftest*
11452
11453 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11454   echo "$ac_t""yes" 1>&6
11455   with_database_dbm=yes libdbm=
11456 else
11457   echo "$ac_t""no" 1>&6
11458
11459     
11460 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11461 echo "configure:11462: checking for dbm_open in -ldbm" >&5
11462 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11463
11464 xe_check_libs=" -ldbm "
11465 cat > conftest.$ac_ext <<EOF
11466 #line 11467 "configure"
11467 #include "confdefs.h"
11468 /* Override any gcc2 internal prototype to avoid an error.  */
11469 /* We use char because int might match the return type of a gcc2
11470     builtin and then its argument prototype would still apply.  */
11471 char dbm_open();
11472
11473 int main() {
11474 dbm_open()
11475 ; return 0; }
11476 EOF
11477 if { (eval echo configure:11478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11478   rm -rf conftest*
11479   eval "ac_cv_lib_$ac_lib_var=yes"
11480 else
11481   echo "configure: failed program was:" >&5
11482   cat conftest.$ac_ext >&5
11483   rm -rf conftest*
11484   eval "ac_cv_lib_$ac_lib_var=no"
11485 fi
11486 rm -f conftest*
11487 xe_check_libs=""
11488
11489 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11490   echo "$ac_t""yes" 1>&6
11491   with_database_dbm=yes libdbm=-ldbm
11492 else
11493   echo "$ac_t""no" 1>&6
11494 test "$with_database_dbm" = "yes" && \
11495         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11496       with_database_dbm=no
11497 fi
11498
11499
11500 fi
11501
11502 fi
11503
11504 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11505 test "$with_database_gnudbm" = "yes" -o \
11506      "$with_database_dbm"    = "yes" && \
11507   { test "$extra_verbose" = "yes" && cat << \EOF
11508     Defining HAVE_DBM
11509 EOF
11510 cat >> confdefs.h <<\EOF
11511 #define HAVE_DBM 1
11512 EOF
11513 }
11514
11515
11516 if test "$with_database_berkdb" != "no"; then
11517   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11518 echo "configure:11519: checking for Berkeley db.h" >&5
11519   for path in "db/db.h" "db.h"; do
11520     cat > conftest.$ac_ext <<EOF
11521 #line 11522 "configure"
11522 #include "confdefs.h"
11523 #ifdef HAVE_INTTYPES_H
11524 #define __BIT_TYPES_DEFINED__
11525 #include <inttypes.h>
11526 typedef uint8_t  u_int8_t;
11527 typedef uint16_t u_int16_t;
11528 typedef uint32_t u_int32_t;
11529 #ifdef WE_DONT_NEED_QUADS
11530 typedef uint64_t u_int64_t;
11531 #endif
11532 #endif
11533 #include <$path>
11534
11535 int main() {
11536
11537 ; return 0; }
11538 EOF
11539 if { (eval echo configure:11540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11540   rm -rf conftest*
11541   db_h_path="$path"; break
11542 else
11543   echo "configure: failed program was:" >&5
11544   cat conftest.$ac_ext >&5
11545 fi
11546 rm -f conftest*
11547   done
11548   if test -z "$db_h_path"
11549   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11550   else echo "$ac_t""$db_h_path" 1>&6
11551   fi
11552
11553   if test "$with_database_berkdb" != "no"; then
11554     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11555 echo "configure:11556: checking for Berkeley DB version" >&5
11556     cat > conftest.$ac_ext <<EOF
11557 #line 11558 "configure"
11558 #include "confdefs.h"
11559 #include <$db_h_path>
11560 #if DB_VERSION_MAJOR > 1
11561 yes
11562 #endif
11563
11564 EOF
11565 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11566   egrep "yes" >/dev/null 2>&1; then
11567   rm -rf conftest*
11568   echo "$ac_t""2" 1>&6; dbfunc=db_open
11569 else
11570   rm -rf conftest*
11571   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11572 fi
11573 rm -f conftest*
11574
11575     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11576 echo "configure:11577: checking for $dbfunc" >&5
11577
11578 cat > conftest.$ac_ext <<EOF
11579 #line 11580 "configure"
11580 #include "confdefs.h"
11581 /* System header to define __stub macros and hopefully few prototypes,
11582     which can conflict with char $dbfunc(); below.  */
11583 #include <assert.h>
11584 /* Override any gcc2 internal prototype to avoid an error.  */
11585 /* We use char because int might match the return type of a gcc2
11586     builtin and then its argument prototype would still apply.  */
11587 char $dbfunc();
11588
11589 int main() {
11590
11591 /* The GNU C library defines this for functions which it implements
11592     to always fail with ENOSYS.  Some functions are actually named
11593     something starting with __ and the normal name is an alias.  */
11594 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11595 choke me
11596 #else
11597 $dbfunc();
11598 #endif
11599
11600 ; return 0; }
11601 EOF
11602 if { (eval echo configure:11603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11603   rm -rf conftest*
11604   eval "ac_cv_func_$dbfunc=yes"
11605 else
11606   echo "configure: failed program was:" >&5
11607   cat conftest.$ac_ext >&5
11608   rm -rf conftest*
11609   eval "ac_cv_func_$dbfunc=no"
11610 fi
11611 rm -f conftest*
11612
11613 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11614   echo "$ac_t""yes" 1>&6
11615   with_database_berkdb=yes need_libdb=no
11616 else
11617   echo "$ac_t""no" 1>&6
11618
11619     
11620 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11621 echo "configure:11622: checking for $dbfunc in -ldb" >&5
11622 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11623
11624 xe_check_libs=" -ldb "
11625 cat > conftest.$ac_ext <<EOF
11626 #line 11627 "configure"
11627 #include "confdefs.h"
11628 /* Override any gcc2 internal prototype to avoid an error.  */
11629 /* We use char because int might match the return type of a gcc2
11630     builtin and then its argument prototype would still apply.  */
11631 char $dbfunc();
11632
11633 int main() {
11634 $dbfunc()
11635 ; return 0; }
11636 EOF
11637 if { (eval echo configure:11638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11638   rm -rf conftest*
11639   eval "ac_cv_lib_$ac_lib_var=yes"
11640 else
11641   echo "configure: failed program was:" >&5
11642   cat conftest.$ac_ext >&5
11643   rm -rf conftest*
11644   eval "ac_cv_lib_$ac_lib_var=no"
11645 fi
11646 rm -f conftest*
11647 xe_check_libs=""
11648
11649 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11650   echo "$ac_t""yes" 1>&6
11651   with_database_berkdb=yes need_libdb=yes
11652 else
11653   echo "$ac_t""no" 1>&6
11654 fi
11655
11656
11657 fi
11658
11659   fi
11660
11661   if test "$with_database_berkdb" = "yes"; then
11662     { test "$extra_verbose" = "yes" && cat << EOF
11663     Defining DB_H_PATH = "$db_h_path"
11664 EOF
11665 cat >> confdefs.h <<EOF
11666 #define DB_H_PATH "$db_h_path"
11667 EOF
11668 }
11669
11670     { test "$extra_verbose" = "yes" && cat << \EOF
11671     Defining HAVE_BERKELEY_DB
11672 EOF
11673 cat >> confdefs.h <<\EOF
11674 #define HAVE_BERKELEY_DB 1
11675 EOF
11676 }
11677
11678     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11679   else with_database_berkdb=no
11680   fi
11681 fi
11682
11683 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11684      != "no no no"; then
11685   { test "$extra_verbose" = "yes" && cat << \EOF
11686     Defining HAVE_DATABASE
11687 EOF
11688 cat >> confdefs.h <<\EOF
11689 #define HAVE_DATABASE 1
11690 EOF
11691 }
11692
11693   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11694    echo "    xemacs will be linked with \"database.o\""
11695  fi
11696 fi
11697
11698 if test "$with_socks" = "yes"; then
11699   
11700 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11701 echo "configure:11702: checking for SOCKSinit in -lsocks" >&5
11702 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11703
11704 xe_check_libs=" -lsocks "
11705 cat > conftest.$ac_ext <<EOF
11706 #line 11707 "configure"
11707 #include "confdefs.h"
11708 /* Override any gcc2 internal prototype to avoid an error.  */
11709 /* We use char because int might match the return type of a gcc2
11710     builtin and then its argument prototype would still apply.  */
11711 char SOCKSinit();
11712
11713 int main() {
11714 SOCKSinit()
11715 ; return 0; }
11716 EOF
11717 if { (eval echo configure:11718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11718   rm -rf conftest*
11719   eval "ac_cv_lib_$ac_lib_var=yes"
11720 else
11721   echo "configure: failed program was:" >&5
11722   cat conftest.$ac_ext >&5
11723   rm -rf conftest*
11724   eval "ac_cv_lib_$ac_lib_var=no"
11725 fi
11726 rm -f conftest*
11727 xe_check_libs=""
11728
11729 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11730   echo "$ac_t""yes" 1>&6
11731     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11732     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11733   { test "$extra_verbose" = "yes" && cat << EOF
11734     Defining $ac_tr_lib
11735 EOF
11736 cat >> confdefs.h <<EOF
11737 #define $ac_tr_lib 1
11738 EOF
11739 }
11740
11741   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11742
11743 else
11744   echo "$ac_t""no" 1>&6
11745 fi
11746
11747
11748   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11749     Defining HAVE_SOCKS
11750 EOF
11751 cat >> confdefs.h <<\EOF
11752 #define HAVE_SOCKS 1
11753 EOF
11754 }
11755
11756 fi
11757
11758 if test "$usage_tracking" = "yes"; then
11759   { test "$extra_verbose" = "yes" && cat << \EOF
11760     Defining USAGE_TRACKING
11761 EOF
11762 cat >> confdefs.h <<\EOF
11763 #define USAGE_TRACKING 1
11764 EOF
11765 }
11766
11767   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11768 fi
11769
11770 for ac_hdr in dlfcn.h
11771 do
11772 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11773 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11774 echo "configure:11775: checking for $ac_hdr" >&5
11775
11776 cat > conftest.$ac_ext <<EOF
11777 #line 11778 "configure"
11778 #include "confdefs.h"
11779 #include <$ac_hdr>
11780 EOF
11781 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11782 { (eval echo configure:11783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11783 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11784 if test -z "$ac_err"; then
11785   rm -rf conftest*
11786   eval "ac_cv_header_$ac_safe=yes"
11787 else
11788   echo "$ac_err" >&5
11789   echo "configure: failed program was:" >&5
11790   cat conftest.$ac_ext >&5
11791   rm -rf conftest*
11792   eval "ac_cv_header_$ac_safe=no"
11793 fi
11794 rm -f conftest*
11795 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11796   echo "$ac_t""yes" 1>&6
11797     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11798   { test "$extra_verbose" = "yes" && cat << EOF
11799     Defining $ac_tr_hdr
11800 EOF
11801 cat >> confdefs.h <<EOF
11802 #define $ac_tr_hdr 1
11803 EOF
11804 }
11805  have_dlfcn=yes
11806   { test "$extra_verbose" = "yes" && cat << \EOF
11807     Defining HAVE_DLFCN_H
11808 EOF
11809 cat >> confdefs.h <<\EOF
11810 #define HAVE_DLFCN_H 1
11811 EOF
11812 }
11813
11814 else
11815   echo "$ac_t""no" 1>&6
11816 fi
11817 done
11818
11819 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11820 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11821 echo "configure:11822: checking for dlopen in -ldl" >&5
11822 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11823
11824 xe_check_libs=" -ldl "
11825 cat > conftest.$ac_ext <<EOF
11826 #line 11827 "configure"
11827 #include "confdefs.h"
11828 /* Override any gcc2 internal prototype to avoid an error.  */
11829 /* We use char because int might match the return type of a gcc2
11830     builtin and then its argument prototype would still apply.  */
11831 char dlopen();
11832
11833 int main() {
11834 dlopen()
11835 ; return 0; }
11836 EOF
11837 if { (eval echo configure:11838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11838   rm -rf conftest*
11839   eval "ac_cv_lib_$ac_lib_var=yes"
11840 else
11841   echo "configure: failed program was:" >&5
11842   cat conftest.$ac_ext >&5
11843   rm -rf conftest*
11844   eval "ac_cv_lib_$ac_lib_var=no"
11845 fi
11846 rm -f conftest*
11847 xe_check_libs=""
11848
11849 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11850   echo "$ac_t""yes" 1>&6
11851   { test "$extra_verbose" = "yes" && cat << \EOF
11852     Defining HAVE_DLOPEN
11853 EOF
11854 cat >> confdefs.h <<\EOF
11855 #define HAVE_DLOPEN 1
11856 EOF
11857 }
11858  DLL_LIB=dl;  with_shlib=yes
11859 else
11860   echo "$ac_t""no" 1>&6
11861 fi
11862
11863  }
11864 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11865 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11866 echo "configure:11867: checking for _dlopen in -lc" >&5
11867 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11868
11869 xe_check_libs=" -lc "
11870 cat > conftest.$ac_ext <<EOF
11871 #line 11872 "configure"
11872 #include "confdefs.h"
11873 /* Override any gcc2 internal prototype to avoid an error.  */
11874 /* We use char because int might match the return type of a gcc2
11875     builtin and then its argument prototype would still apply.  */
11876 char _dlopen();
11877
11878 int main() {
11879 _dlopen()
11880 ; return 0; }
11881 EOF
11882 if { (eval echo configure:11883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11883   rm -rf conftest*
11884   eval "ac_cv_lib_$ac_lib_var=yes"
11885 else
11886   echo "configure: failed program was:" >&5
11887   cat conftest.$ac_ext >&5
11888   rm -rf conftest*
11889   eval "ac_cv_lib_$ac_lib_var=no"
11890 fi
11891 rm -f conftest*
11892 xe_check_libs=""
11893
11894 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11895   echo "$ac_t""yes" 1>&6
11896   { test "$extra_verbose" = "yes" && cat << \EOF
11897     Defining HAVE_DLOPEN
11898 EOF
11899 cat >> confdefs.h <<\EOF
11900 #define HAVE_DLOPEN 1
11901 EOF
11902 }
11903  DLL_LIB=;   with_shlib=yes
11904 else
11905   echo "$ac_t""no" 1>&6
11906 fi
11907
11908  }
11909 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11910 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11911 echo "configure:11912: checking for dlopen in -lc" >&5
11912 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11913
11914 xe_check_libs=" -lc "
11915 cat > conftest.$ac_ext <<EOF
11916 #line 11917 "configure"
11917 #include "confdefs.h"
11918 /* Override any gcc2 internal prototype to avoid an error.  */
11919 /* We use char because int might match the return type of a gcc2
11920     builtin and then its argument prototype would still apply.  */
11921 char dlopen();
11922
11923 int main() {
11924 dlopen()
11925 ; return 0; }
11926 EOF
11927 if { (eval echo configure:11928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11928   rm -rf conftest*
11929   eval "ac_cv_lib_$ac_lib_var=yes"
11930 else
11931   echo "configure: failed program was:" >&5
11932   cat conftest.$ac_ext >&5
11933   rm -rf conftest*
11934   eval "ac_cv_lib_$ac_lib_var=no"
11935 fi
11936 rm -f conftest*
11937 xe_check_libs=""
11938
11939 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11940   echo "$ac_t""yes" 1>&6
11941   { test "$extra_verbose" = "yes" && cat << \EOF
11942     Defining HAVE_DLOPEN
11943 EOF
11944 cat >> confdefs.h <<\EOF
11945 #define HAVE_DLOPEN 1
11946 EOF
11947 }
11948  DLL_LIB=;   with_shlib=yes
11949 else
11950   echo "$ac_t""no" 1>&6
11951 fi
11952
11953  }
11954 test -z "$with_shlib" && { 
11955 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11956 echo "configure:11957: checking for shl_load in -ldld" >&5
11957 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11958
11959 xe_check_libs=" -ldld "
11960 cat > conftest.$ac_ext <<EOF
11961 #line 11962 "configure"
11962 #include "confdefs.h"
11963 /* Override any gcc2 internal prototype to avoid an error.  */
11964 /* We use char because int might match the return type of a gcc2
11965     builtin and then its argument prototype would still apply.  */
11966 char shl_load();
11967
11968 int main() {
11969 shl_load()
11970 ; return 0; }
11971 EOF
11972 if { (eval echo configure:11973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11973   rm -rf conftest*
11974   eval "ac_cv_lib_$ac_lib_var=yes"
11975 else
11976   echo "configure: failed program was:" >&5
11977   cat conftest.$ac_ext >&5
11978   rm -rf conftest*
11979   eval "ac_cv_lib_$ac_lib_var=no"
11980 fi
11981 rm -f conftest*
11982 xe_check_libs=""
11983
11984 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11985   echo "$ac_t""yes" 1>&6
11986   { test "$extra_verbose" = "yes" && cat << \EOF
11987     Defining HAVE_SHL_LOAD
11988 EOF
11989 cat >> confdefs.h <<\EOF
11990 #define HAVE_SHL_LOAD 1
11991 EOF
11992 }
11993  DLL_LIB=dld; with_shlib=yes
11994 else
11995   echo "$ac_t""no" 1>&6
11996 fi
11997
11998  }
11999 test -z "$with_shlib" && { 
12000 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
12001 echo "configure:12002: checking for dld_init in -ldld" >&5
12002 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
12003
12004 xe_check_libs=" -ldld "
12005 cat > conftest.$ac_ext <<EOF
12006 #line 12007 "configure"
12007 #include "confdefs.h"
12008 /* Override any gcc2 internal prototype to avoid an error.  */
12009 /* We use char because int might match the return type of a gcc2
12010     builtin and then its argument prototype would still apply.  */
12011 char dld_init();
12012
12013 int main() {
12014 dld_init()
12015 ; return 0; }
12016 EOF
12017 if { (eval echo configure:12018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12018   rm -rf conftest*
12019   eval "ac_cv_lib_$ac_lib_var=yes"
12020 else
12021   echo "configure: failed program was:" >&5
12022   cat conftest.$ac_ext >&5
12023   rm -rf conftest*
12024   eval "ac_cv_lib_$ac_lib_var=no"
12025 fi
12026 rm -f conftest*
12027 xe_check_libs=""
12028
12029 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
12030   echo "$ac_t""yes" 1>&6
12031   { test "$extra_verbose" = "yes" && cat << \EOF
12032     Defining HAVE_DLD_INIT
12033 EOF
12034 cat >> confdefs.h <<\EOF
12035 #define HAVE_DLD_INIT 1
12036 EOF
12037 }
12038  DLL_LIB=dld; with_shlib=yes
12039 else
12040   echo "$ac_t""no" 1>&6
12041 fi
12042
12043  }
12044 if test "$with_shlib" = "yes"; then
12045   
12046 dll_ld=
12047 dll_ldflags=
12048 dll_cflags=
12049 dll_post=
12050 dll_ldo="-o"
12051 ld_dynamic_link_flags=
12052 xehost=$canonical
12053 xealias=$internal_configuration
12054
12055 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
12056 echo "configure:12057: checking how to build dynamic libraries for ${xehost}" >&5
12057 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
12058 case "$xehost" in
12059 *-*-linux-gnu*) ;;
12060 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
12061 esac
12062
12063 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
12064 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
12065 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
12066
12067 case "$xehost_os" in
12068 aix3*)
12069   # AIX sometimes has problems with the GCC collect2 program.  For some
12070   # reason, if we set the COLLECT_NAMES environment variable, the problems
12071   # vanish in a puff of smoke.
12072   if test "${COLLECT_NAMES+set}" != set; then
12073     COLLECT_NAMES=
12074     export COLLECT_NAMES
12075   fi
12076   ;;
12077 esac
12078
12079 # Now see if the compiler is really GCC.
12080 if test "$GCC" = "yes"; then
12081   XEGCC=yes
12082 else
12083   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
12084 echo "configure:12085: checking checking whether we are using GNU C" >&5
12085   cat > conftest.$ac_ext <<EOF
12086 #line 12087 "configure"
12087 #include "confdefs.h"
12088
12089 #ifdef __GNUC__
12090   yes;
12091 #endif
12092
12093 EOF
12094 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12095   egrep "yes" >/dev/null 2>&1; then
12096   rm -rf conftest*
12097   XEGCC=yes
12098 else
12099   rm -rf conftest*
12100   XEGCC=no
12101 fi
12102 rm -f conftest*
12103
12104   echo "$ac_t""${XEGCC}" 1>&6
12105 fi
12106
12107 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
12108 echo "configure:12109: checking how to produce PIC code" >&5
12109 wl=
12110
12111 can_build_shared=yes
12112 if test "$XEGCC" = yes; then
12113   wl='-Wl,'
12114
12115   case "$xehost_os" in
12116   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
12117     # PIC is the default for these OSes.
12118     ;;
12119
12120   os2*)
12121     # We can build DLLs from non-PIC.
12122     ;;
12123   amigaos*)
12124     # FIXME: we need at least 68020 code to build shared libraries, but
12125     # adding the `-m68020' flag to GCC prevents building anything better,
12126     # like `-m68040'.
12127     dll_cflags='-m68020 -resident32 -malways-restore-a4'
12128     ;;
12129   *)
12130     dll_cflags='-fPIC'
12131     ;;
12132   esac
12133 else
12134   # PORTME Check for PIC flags for the system compiler.
12135   case "$xehost_os" in
12136   hpux9* | hpux10*)
12137     # Is there a better link_static_flag that works with the bundled CC?
12138     wl='-Wl,'
12139     dll_cflags='+Z'
12140     ;;
12141
12142   irix5* | irix6*)
12143     wl='-Wl,'
12144     # PIC (with -KPIC) is the default.
12145     ;;
12146
12147   os2*)
12148     # We can build DLLs from non-PIC.
12149     ;;
12150
12151   osf3* | osf4*)
12152     # All OSF/1 code is PIC.
12153     wl='-Wl,'
12154     ;;
12155
12156   sco3.2v5*)
12157     dll_cflags='-belf -Kpic'
12158     wl='-Wl,'
12159     ;;
12160
12161   unixware*)
12162     dll_cflags="-KPIC"
12163     wl="-Wl,"
12164     ;;
12165
12166   sysv4*)
12167     dll_cflags="-KPIC"
12168     wl="-Wl,"
12169     ;;
12170
12171   sysv5*)
12172     dll_cflags="-KPIC"
12173     wl="-Wl,"
12174     ;;
12175
12176   solaris2*)
12177     dll_cflags='-KPIC'
12178     wl='-Wl,'
12179     ;;
12180
12181   sunos4*)
12182     dll_cflags='-PIC'
12183     wl='-Qoption ld '
12184     ;;
12185
12186   uts4*)
12187     dll_cflags='-pic'
12188     ;;
12189
12190   *)
12191     can_build_shared=no
12192     ;;
12193   esac
12194 fi
12195
12196 if test -n "$dll_cflags"; then
12197   echo "$ac_t""${dll_cflags}" 1>&6
12198   
12199   # Check to make sure the dll_cflags actually works.
12200   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12201 echo "configure:12202: checking if PIC flag ${dll_cflags} really works" >&5
12202   save_CFLAGS="$CFLAGS"
12203   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12204   cat > conftest.$ac_ext <<EOF
12205 #line 12206 "configure"
12206 #include "confdefs.h"
12207
12208 int main() {
12209 int x=0;
12210 ; return 0; }
12211 EOF
12212 if { (eval echo configure:12213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12213   rm -rf conftest*
12214   
12215     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12216     # reports no error.  So, we need to grep stderr for (Bundled).
12217     if grep '(Bundled)' config.log >/dev/null; then
12218       echo "$ac_t""no" 1>&6
12219       can_build_shared=no
12220       dll_cflags=
12221     else
12222       echo "$ac_t""yes" 1>&6
12223     fi
12224 else
12225   echo "configure: failed program was:" >&5
12226   cat conftest.$ac_ext >&5
12227   rm -rf conftest*
12228   echo "$ac_t""no" 1>&6
12229     can_build_shared=no
12230     dll_cflags=
12231 fi
12232 rm -f conftest*
12233   CFLAGS="$save_CFLAGS"
12234 else
12235   echo "$ac_t""none" 1>&6
12236 fi
12237
12238 if test "$can_build_shared" = "yes"; then
12239 cc_produces_so=no
12240 xldf=
12241 xcldf=
12242 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12243 echo "configure:12244: checking if C compiler can produce shared libraries" >&5
12244 if test "$XEGCC" = yes; then
12245   xcldf="-shared"
12246   xldf="-shared"
12247 else # Not using GCC
12248   case "$xehost_os" in
12249     aix3* | aix4*)
12250       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12251       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12252       ;;
12253
12254     freebsd2* | netbsd* | openbsd*)
12255       xldf="-Bshareable"
12256       xcldf="${wl}-Bshareable"
12257       ;;
12258
12259     freebsd3*)
12260       xcldf="-shared"
12261       ;;
12262
12263     hpux*)
12264       xldf="-b +s"
12265       xcldf="${wl}-b ${wl}+s"
12266       ;;
12267
12268     irix5* | irix6* | osf3* | osf4*)
12269       xcldf="${wl}-shared"
12270       xldf="-shared"
12271       ;;
12272
12273     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12274       xcldf="-G"
12275       xldf="-G"
12276       ;;
12277
12278     sunos4*)
12279       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12280       xldf="-assert pure-text -Bstatic"
12281       ;;
12282   esac
12283 fi # End if if we are using gcc
12284
12285 if test -n "$xcldf"; then
12286   save_LDFLAGS=$LDFLAGS
12287   save_LIBS=$LIBS
12288   save_xe_libs=$xe_libs
12289   LDFLAGS="$xcldf $LDFLAGS"
12290   LIBS=
12291   xe_libs=
12292   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12293   cat > conftest.$ac_ext <<EOF
12294 #line 12295 "configure"
12295 #include "confdefs.h"
12296
12297 int main() {
12298 int x=0;
12299 ; return 0; }
12300 EOF
12301 if { (eval echo configure:12302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12302   rm -rf conftest*
12303   cc_produces_so=yes
12304 else
12305   echo "configure: failed program was:" >&5
12306   cat conftest.$ac_ext >&5
12307   rm -rf conftest*
12308   cc_produces_so=no
12309 fi
12310 rm -f conftest*
12311   LDFLAGS=$save_LDFLAGS
12312   LIBS=$save_LIBS
12313   xe_libs=$save_xe_libs
12314   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12315 else
12316   cc_produces_so=no
12317 fi
12318 echo "$ac_t""${cc_produces_so}" 1>&6
12319
12320 LTLD=$LD
12321 if test -z "$LTLD"; then
12322   ac_prog=ld
12323   if test "$XEGCC" = yes; then
12324     # Check if gcc -print-prog-name=ld gives a path.
12325     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12326 echo "configure:12327: checking for ld used by GCC" >&5
12327     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12328     case "$ac_prog" in
12329     # Accept absolute paths.
12330     /*)
12331       if test -z "$LTLD"; then
12332         case "$ac_prog" in
12333           *gcc-lib*) LTLD="$CC"
12334                      ;;
12335           *)         LTLD="$ac_prog"
12336                      ;;
12337         esac
12338       fi
12339       ;;
12340     "")
12341       # If it fails, then pretend we aren't using GCC.
12342       ac_prog=ld
12343       ;;
12344     *)
12345       # If it is relative, then search for the first ld in PATH.
12346       with_gnu_ld=unknown
12347       ;;
12348     esac
12349   else
12350     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12351 echo "configure:12352: checking for GNU ld" >&5
12352   fi
12353
12354   if test -z "$LTLD"; then
12355     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12356     for ac_dir in $PATH; do
12357       test -z "$ac_dir" && ac_dir=.
12358       if test -f "$ac_dir/$ac_prog"; then
12359         LTLD="$ac_dir/$ac_prog"
12360         # Check to see if the program is GNU ld.  I'd rather use --version,
12361         # but apparently some GNU ld's only accept -v.
12362         # Break only if it was the GNU/non-GNU ld that we prefer.
12363         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12364           xe_gnu_ld=yes
12365         else
12366           xe_gnu_ld=no
12367         fi
12368       fi
12369     done
12370     IFS="$ac_save_ifs"
12371   fi
12372
12373   if test -n "$LTLD"; then
12374     echo "$ac_t""${LTLD}" 1>&6
12375   else
12376     echo "$ac_t""no" 1>&6
12377   fi
12378
12379   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12380     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12381     exit 1
12382   fi
12383 fi
12384
12385 ld_dynamic_link_flags=
12386
12387 # Check to see if it really is or isn't GNU ld.
12388 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12389 echo "configure:12390: checking if the linker is GNU ld" >&5
12390 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12391 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12392   xe_gnu_ld=yes
12393 else
12394   xe_gnu_ld=no
12395 fi
12396 echo "$ac_t""${xe_gnu_ld}" 1>&6
12397
12398 case "$xehost_os" in
12399   amigaos* | sunos4*)
12400     # On these operating systems, we should treat GNU ld like the system ld.
12401     gnu_ld_acts_native=yes
12402     ;;
12403   *)
12404     gnu_ld_acts_native=no
12405     ;;
12406 esac
12407
12408 if test "$cc_produces_so" = "yes"; then
12409   dll_ld=$CC
12410   dll_ldflags=$xcldf
12411   can_build_shared=yes
12412 else
12413   # OK - only NOW do we futz about with ld.
12414   # See if the linker supports building shared libraries.
12415   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12416 echo "configure:12417: checking whether the linker supports shared libraries" >&5
12417   dll_ld=$CC
12418   dll_ldflags=$LDFLAGS
12419   ld_shlibs=yes
12420   can_build_shared=yes
12421   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12422     # See if GNU ld supports shared libraries.
12423     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12424       dll_ld=$CC
12425       dll_ldflags="-shared"
12426       ld_shlibs=yes
12427     else
12428       ld_shlibs=no
12429     fi
12430   else
12431     # PORTME fill in a description of your system's linker (not GNU ld)
12432     case "$xehost_os" in
12433     aix3*)
12434       dll_ld=$LTLD
12435       dll_ldflags=$xldf
12436       ;;
12437
12438     aix4*)
12439       dll_ldflags=$xcldf
12440       ;;
12441
12442     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12443     # support.  Future versions do this automatically, but an explicit c++rt0.o
12444     # doesn't break anything, and helps significantly (at the cost of a little
12445     # extra space).
12446     freebsd2.2*)
12447       dll_ld=$LTLD
12448       dll_ldflags=$xldf
12449       dll_post="/usr/lib/c++rt0.o"
12450       ;;
12451
12452     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12453     freebsd2*)
12454       dll_ld=$LTLD
12455       dll_ldflags="-Bshareable"
12456       ;;
12457
12458     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12459     freebsd3*)
12460       dll_ldflags="-shared"
12461       ;;
12462
12463     hpux*)
12464       dll_ld=$LTLD
12465       dll_ldflags=$xldf
12466       ;;
12467
12468     irix5* | irix6*)
12469       dll_ld=$LTLD
12470       dll_ldflags=$xldf
12471       ;;
12472
12473     netbsd*)
12474       # Tested with NetBSD 1.2 ld
12475       dll_ld=$LTLD
12476       dll_ldflags=$xldf
12477       ;;
12478
12479     openbsd*)
12480       dll_ld=$LTLD
12481       dll_ldflags=$xldf
12482       ;;
12483
12484     osf3* | osf4*)
12485       dll_ld=$LTLD
12486       dll_ldflags=$xldf
12487       ;;
12488
12489     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12490     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12491       dll_ld=$LTLD
12492       case "$dll_ld" in
12493         *gcc*) dll_ldflags="-shared"
12494                dll_ld=$CC
12495                ;;
12496         *)     dll_ldflags="-G"
12497                ;;
12498       esac
12499       ;;
12500
12501     sunos4*)
12502       if test "$XEGCC" = yes; then
12503         dll_ld=$CC
12504       else
12505         dll_ld=$LTLD
12506       fi
12507       dll_ldflags=$xldf
12508       ;;
12509
12510     uts4*)
12511       dll_ld=$LTLD
12512       dll_ldflags="-G"
12513       ;;
12514
12515     bsdi*)
12516       dll_ldflags="-r"
12517       dll_ld="shlicc2"
12518       ;;
12519
12520     *)
12521       ld_shlibs=no
12522       can_build_shared=no
12523       ;;
12524     esac
12525   fi
12526   echo "$ac_t""${ld_shlibs}" 1>&6
12527   if test "$ld_shlibs" = "no"; then
12528     can_build_shared=no
12529   fi
12530 fi # End of if cc_produces_so = no
12531
12532
12533 if test "$xe_gnu_ld" = yes; then
12534   if test "$ld_shlibs" = yes; then
12535     ld_dynamic_link_flags="${wl}-export-dynamic"
12536   fi
12537 fi
12538
12539 if test -z "$ld_dynamic_link_flags"; then
12540   case "$xehost_os" in
12541   aix3*)
12542     ld_dynamic_link_flags=
12543     ;;
12544
12545   aix4*)
12546     ld_dynamic_link_flags=
12547     ;;
12548
12549   freebsd2.2*)
12550     ld_dynamic_link_flags=
12551     ;;
12552
12553   freebsd2*)
12554     ld_dynamic_link_flags=
12555     ;;
12556
12557   freebsd3*)
12558     ld_dynamic_link_flags=
12559     ;;
12560
12561   hpux*)
12562     ld_dynamic_link_flags="${wl}-E"
12563     ;;
12564
12565   irix5* | irix6*)
12566     ld_dynamic_link_flags=
12567     ;;
12568
12569   netbsd*)
12570     ld_dynamic_link_flags=
12571     ;;
12572
12573   openbsd*)
12574     ld_dynamic_link_flags=
12575     ;;
12576
12577   osf3* | osf4*)
12578     ld_dynamic_link_flags=
12579     ;;
12580
12581   solaris2* | solaris7*)
12582     ld_dynamic_link_flags="${wl}-Bdynamic"
12583     ;;
12584
12585   sco3.2v5* | unixware* | sysv5* | sysv4*)
12586     ld_dynamic_link_flags="${wl}-Bexport"
12587     ;;
12588
12589   sunos4*)
12590     ld_dynamic_link_flags=
12591     ;;
12592
12593   uts4*)
12594     ld_dynamic_link_flags=
12595     ;;
12596
12597   bsdi*)
12598     ld_dynamic_link_flags=
12599     ;;
12600
12601   esac
12602 fi # End of if -z ld_dynamic_link_flags
12603 fi # End of if test "$can_build_shared" = "yes"
12604
12605
12606
12607
12608
12609
12610
12611
12612   if test "$can_build_shared" = "yes"; then
12613     { test "$extra_verbose" = "yes" && cat << \EOF
12614     Defining HAVE_SHLIB
12615 EOF
12616 cat >> confdefs.h <<\EOF
12617 #define HAVE_SHLIB 1
12618 EOF
12619 }
12620
12621     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12622    echo "    xemacs will be linked with \"sysdll.o\""
12623  fi
12624     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12625    echo "    xemacs will be linked with \"emodules.o\""
12626  fi
12627     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12628     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12629     for ac_func in dlerror _dlerror
12630 do
12631 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12632 echo "configure:12633: checking for $ac_func" >&5
12633
12634 cat > conftest.$ac_ext <<EOF
12635 #line 12636 "configure"
12636 #include "confdefs.h"
12637 /* System header to define __stub macros and hopefully few prototypes,
12638     which can conflict with char $ac_func(); below.  */
12639 #include <assert.h>
12640 /* Override any gcc2 internal prototype to avoid an error.  */
12641 /* We use char because int might match the return type of a gcc2
12642     builtin and then its argument prototype would still apply.  */
12643 char $ac_func();
12644
12645 int main() {
12646
12647 /* The GNU C library defines this for functions which it implements
12648     to always fail with ENOSYS.  Some functions are actually named
12649     something starting with __ and the normal name is an alias.  */
12650 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12651 choke me
12652 #else
12653 $ac_func();
12654 #endif
12655
12656 ; return 0; }
12657 EOF
12658 if { (eval echo configure:12659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12659   rm -rf conftest*
12660   eval "ac_cv_func_$ac_func=yes"
12661 else
12662   echo "configure: failed program was:" >&5
12663   cat conftest.$ac_ext >&5
12664   rm -rf conftest*
12665   eval "ac_cv_func_$ac_func=no"
12666 fi
12667 rm -f conftest*
12668
12669 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12670   echo "$ac_t""yes" 1>&6
12671     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12672   { test "$extra_verbose" = "yes" && cat << EOF
12673     Defining $ac_tr_func
12674 EOF
12675 cat >> confdefs.h <<EOF
12676 #define $ac_tr_func 1
12677 EOF
12678 }
12679  
12680 else
12681   echo "$ac_t""no" 1>&6
12682 fi
12683 done
12684
12685   else
12686     echo "configure: warning: disabling shared library support" 1>&2
12687     with_shlib=no
12688   fi
12689 fi
12690
12691 cat > conftest.$ac_ext <<EOF
12692 #line 12693 "configure"
12693 #include "confdefs.h"
12694 int main(int c,char *v[]){return 0;}
12695 EOF
12696 if { (eval echo configure:12697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12697 then
12698   :
12699 else
12700   conftest_rc="$?"
12701   echo "configure: failed program was:" >&5
12702   cat conftest.$ac_ext >&5
12703   rm -fr conftest*
12704   
12705   echo ""
12706   echo "*** PANIC *** The C compiler can no longer build working executables."
12707   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12708   echo "*** PANIC *** The most likely reason for this problem is that configure"
12709   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12710   echo "*** PANIC *** found at run time."
12711   echo "*** PANIC ***"
12712   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12713   echo "*** PANIC *** On other systems, try telling configure where to find the"
12714   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12715   echo "*** PANIC ***"
12716   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12717   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12718   echo "*** PANIC *** on your system.  Don't do that."
12719   exit 1
12720 fi
12721 rm -fr conftest*
12722
12723 if test "$win32_processes" = "yes"; then
12724   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12725    echo "    xemacs will be linked with \"process-nt.o\""
12726  fi
12727 else
12728   { test "$extra_verbose" = "yes" && cat << \EOF
12729     Defining HAVE_UNIX_PROCESSES
12730 EOF
12731 cat >> confdefs.h <<\EOF
12732 #define HAVE_UNIX_PROCESSES 1
12733 EOF
12734 }
12735
12736   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12737    echo "    xemacs will be linked with \"process-unix.o\""
12738  fi
12739 fi
12740
12741
12742
12743 T=""
12744 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12745 CFLAGS="$T"
12746
12747
12748 T=""
12749 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12750 extra_objs="$T"
12751
12752
12753 T=""
12754 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
12755 c_switch_general="$T"
12756
12757
12758 T=""
12759 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12760 c_switch_window_system="$T"
12761
12762
12763 T=""
12764 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12765 c_switch_all="$T"
12766
12767
12768 T=""
12769 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
12770 ld_switch_general="$T"
12771
12772
12773 T=""
12774 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12775 ld_switch_window_system="$T"
12776
12777
12778 T=""
12779 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12780 ld_switch_all="$T"
12781
12782
12783 T=""
12784 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12785 ld_libs_general="$T"
12786
12787
12788 T=""
12789 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
12790 ld_libs_window_system="$T"
12791
12792
12793 T=""
12794 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12795 ld_libs_all="$T"
12796
12797
12798
12799 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12800 internal_makefile_list="Makefile.in"
12801 SUBDIR_MAKEFILES=''
12802 test -d lock || mkdir lock
12803 for dir in $MAKE_SUBDIR; do
12804   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12805         test -d "$d" || mkdir "$d"; cd "$d"
12806       done ) ;;
12807    * ) test -d "$dir" || mkdir "$dir" ;;
12808   esac
12809   
12810 T=""
12811 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12812 SUBDIR_MAKEFILES="$T"
12813
12814   
12815 T=""
12816 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12817 internal_makefile_list="$T"
12818
12819 done
12820
12821
12822
12823
12824 for dir in src/s src/m; do
12825   if test ! -d "$dir" ; then
12826     echo Making symbolic link to "$srcdir/$dir"
12827     ${LN_S} "$srcdir/$dir" "$dir"
12828   fi
12829 done
12830
12831 if test "$extra_verbose" = "yes"; then
12832   echo ""
12833   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
12834   echo ""
12835 fi
12836
12837 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12838   echo "creating src/gdbinit"; echo ""
12839   echo "source $srcdir/src/gdbinit" > src/gdbinit
12840 fi
12841
12842 if test "$__SUNPRO_C" = "yes"; then
12843   echo "creating .sbinit"; echo ""
12844   ( echo "# For use with Sun WorkShop's Source browser."
12845     echo "# See sbquery(1) and sbinit(4) for more information"
12846     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12847   ) > .sbinit
12848 fi
12849
12850 rm -f core
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867 PREFIX=$prefix
12868 while true; do
12869   case "$PREFIX" in
12870     *\$* ) eval "PREFIX=$PREFIX" ;;
12871     *) break ;;
12872   esac
12873 done
12874
12875
12876
12877 EXEC_PREFIX=$exec_prefix
12878 while true; do
12879   case "$EXEC_PREFIX" in
12880     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12881     *) break ;;
12882   esac
12883 done
12884
12885
12886
12887
12888 INFODIR=$infodir
12889 while true; do
12890   case "$INFODIR" in
12891     *\$* ) eval "INFODIR=$INFODIR" ;;
12892     *) break ;;
12893   esac
12894 done
12895
12896
12897
12898
12899 INFOPATH=$infopath
12900 while true; do
12901   case "$INFOPATH" in
12902     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12903     *) break ;;
12904   esac
12905 done
12906
12907
12908
12909
12910 PACKAGE_PATH=$package_path
12911 while true; do
12912   case "$PACKAGE_PATH" in
12913     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12914     *) break ;;
12915   esac
12916 done
12917
12918
12919
12920
12921 LISPDIR=$lispdir
12922 while true; do
12923   case "$LISPDIR" in
12924     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12925     *) break ;;
12926   esac
12927 done
12928
12929
12930
12931
12932 MODULEDIR=$moduledir
12933 while true; do
12934   case "$MODULEDIR" in
12935     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12936     *) break ;;
12937   esac
12938 done
12939
12940
12941
12942
12943 SITELISPDIR=$sitelispdir
12944 while true; do
12945   case "$SITELISPDIR" in
12946     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12947     *) break ;;
12948   esac
12949 done
12950
12951
12952
12953
12954 SITEMODULEDIR=$sitemoduledir
12955 while true; do
12956   case "$SITEMODULEDIR" in
12957     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12958     *) break ;;
12959   esac
12960 done
12961
12962
12963
12964
12965 ETCDIR=$etcdir
12966 while true; do
12967   case "$ETCDIR" in
12968     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12969     *) break ;;
12970   esac
12971 done
12972
12973
12974
12975
12976 LOCKDIR=$lockdir
12977 while true; do
12978   case "$LOCKDIR" in
12979     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12980     *) break ;;
12981   esac
12982 done
12983
12984
12985
12986
12987 ARCHLIBDIR=$archlibdir
12988 while true; do
12989   case "$ARCHLIBDIR" in
12990     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12991     *) break ;;
12992   esac
12993 done
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
13015
13016
13017
13018
13019
13020
13021
13022 : ${XEMACS_CC:=$CC}
13023
13024
13025
13026 if test "$with_site_lisp" = "no"; then
13027   { test "$extra_verbose" = "yes" && cat << \EOF
13028     Defining INHIBIT_SITE_LISP
13029 EOF
13030 cat >> confdefs.h <<\EOF
13031 #define INHIBIT_SITE_LISP 1
13032 EOF
13033 }
13034
13035 fi
13036 if test "$with_site_modules" = "no"; then
13037   { test "$extra_verbose" = "yes" && cat << \EOF
13038     Defining INHIBIT_SITE_MODULES
13039 EOF
13040 cat >> confdefs.h <<\EOF
13041 #define INHIBIT_SITE_MODULES 1
13042 EOF
13043 }
13044
13045 fi
13046
13047
13048 T=""
13049 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
13050 ac_configure_args="$T"
13051
13052 { test "$extra_verbose" = "yes" && cat << EOF
13053     Defining EMACS_CONFIGURATION = "$canonical"
13054 EOF
13055 cat >> confdefs.h <<EOF
13056 #define EMACS_CONFIGURATION "$canonical"
13057 EOF
13058 }
13059
13060 { test "$extra_verbose" = "yes" && cat << EOF
13061     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
13062 EOF
13063 cat >> confdefs.h <<EOF
13064 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
13065 EOF
13066 }
13067
13068 { test "$extra_verbose" = "yes" && cat << EOF
13069     Defining config_machfile = "$machfile"
13070 EOF
13071 cat >> confdefs.h <<EOF
13072 #define config_machfile "$machfile"
13073 EOF
13074 }
13075
13076 { test "$extra_verbose" = "yes" && cat << EOF
13077     Defining config_opsysfile = "$opsysfile"
13078 EOF
13079 cat >> confdefs.h <<EOF
13080 #define config_opsysfile "$opsysfile"
13081 EOF
13082 }
13083
13084
13085
13086 null_string=""
13087 { test "$extra_verbose" = "yes" && cat << EOF
13088     Defining LD_SWITCH_X_SITE = $null_string
13089 EOF
13090 cat >> confdefs.h <<EOF
13091 #define LD_SWITCH_X_SITE $null_string
13092 EOF
13093 }
13094
13095 { test "$extra_verbose" = "yes" && cat << EOF
13096     Defining LD_SWITCH_X_SITE_AUX = $null_string
13097 EOF
13098 cat >> confdefs.h <<EOF
13099 #define LD_SWITCH_X_SITE_AUX $null_string
13100 EOF
13101 }
13102
13103 { test "$extra_verbose" = "yes" && cat << EOF
13104     Defining C_SWITCH_X_SITE = $null_string
13105 EOF
13106 cat >> confdefs.h <<EOF
13107 #define C_SWITCH_X_SITE $null_string
13108 EOF
13109 }
13110
13111 { test "$extra_verbose" = "yes" && cat << EOF
13112     Defining LD_SWITCH_SITE = $null_string
13113 EOF
13114 cat >> confdefs.h <<EOF
13115 #define LD_SWITCH_SITE $null_string
13116 EOF
13117 }
13118
13119 { test "$extra_verbose" = "yes" && cat << EOF
13120     Defining C_SWITCH_SITE = $null_string
13121 EOF
13122 cat >> confdefs.h <<EOF
13123 #define C_SWITCH_SITE $null_string
13124 EOF
13125 }
13126
13127
13128
13129 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13130     Defining GNU_MALLOC
13131 EOF
13132 cat >> confdefs.h <<\EOF
13133 #define GNU_MALLOC 1
13134 EOF
13135 }
13136
13137 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13138     Defining USE_SYSTEM_MALLOC
13139 EOF
13140 cat >> confdefs.h <<\EOF
13141 #define USE_SYSTEM_MALLOC 1
13142 EOF
13143 }
13144
13145 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13146     Defining USE_DEBUG_MALLOC
13147 EOF
13148 cat >> confdefs.h <<\EOF
13149 #define USE_DEBUG_MALLOC 1
13150 EOF
13151 }
13152
13153                                               { test "$extra_verbose" = "yes" && cat << \EOF
13154     Defining USE_SYSTEM_MALLOC
13155 EOF
13156 cat >> confdefs.h <<\EOF
13157 #define USE_SYSTEM_MALLOC 1
13158 EOF
13159 }
13160
13161 fi
13162 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13163     Defining I18N3
13164 EOF
13165 cat >> confdefs.h <<\EOF
13166 #define I18N3 1
13167 EOF
13168 }
13169
13170 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13171     Defining USE_GCC
13172 EOF
13173 cat >> confdefs.h <<\EOF
13174 #define USE_GCC 1
13175 EOF
13176 }
13177
13178 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13179     Defining EXTERNAL_WIDGET
13180 EOF
13181 cat >> confdefs.h <<\EOF
13182 #define EXTERNAL_WIDGET 1
13183 EOF
13184 }
13185
13186 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13187     Defining NO_DOC_FILE
13188 EOF
13189 cat >> confdefs.h <<\EOF
13190 #define NO_DOC_FILE 1
13191 EOF
13192 }
13193
13194 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13195     Defining PURIFY
13196 EOF
13197 cat >> confdefs.h <<\EOF
13198 #define PURIFY 1
13199 EOF
13200 }
13201
13202 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13203     Defining QUANTIFY
13204 EOF
13205 cat >> confdefs.h <<\EOF
13206 #define QUANTIFY 1
13207 EOF
13208 }
13209
13210 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13211     Defining MAIL_USE_POP
13212 EOF
13213 cat >> confdefs.h <<\EOF
13214 #define MAIL_USE_POP 1
13215 EOF
13216 }
13217
13218 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13219     Defining KERBEROS
13220 EOF
13221 cat >> confdefs.h <<\EOF
13222 #define KERBEROS 1
13223 EOF
13224 }
13225
13226 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13227     Defining HESIOD
13228 EOF
13229 cat >> confdefs.h <<\EOF
13230 #define HESIOD 1
13231 EOF
13232 }
13233
13234 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13235     Defining USE_UNION_TYPE
13236 EOF
13237 cat >> confdefs.h <<\EOF
13238 #define USE_UNION_TYPE 1
13239 EOF
13240 }
13241
13242
13243
13244 (
13245 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13246 else
13247   echo "uname -a: `uname -a`"
13248 fi
13249 echo ""
13250 echo "$0 $quoted_arguments"
13251 ) > Installation
13252
13253 if test ! -z ${emacs_beta_version} ; then
13254   if test -z "${emacs_is_beta}" ; then
13255         xemacs_betaname=".${emacs_beta_version}"
13256   else
13257         xemacs_betaname="-b${emacs_beta_version}"
13258   fi
13259 else
13260   xemacs_betaname=""    
13261 fi
13262
13263 (
13264 echo "
13265
13266 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13267
13268   Where should the build process find the source code?    $srcdir
13269   What installation prefix should install use?            $prefix
13270   What operating system and machine description files should XEmacs use?
13271         \`$opsysfile' and \`$machfile'
13272   What compiler should XEmacs be built with?              $CC $CFLAGS
13273   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13274   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13275   What window system should XEmacs use?                   ${window_system}"
13276 if test "$with_x11" = "yes"; then
13277   echo "  Where do we find X Windows header files?                $x_includes"
13278   echo "  Where do we find X Windows libraries?                   $x_libraries"
13279 fi
13280 if test -n "$site_includes"; then
13281   echo "  Additional header files:                                $site_includes"
13282 fi
13283 if test -n "$site_libraries"; then
13284   echo "  Additional libraries:                                   $site_libraries"
13285 fi
13286 if test -n "$site_prefixes"; then
13287   echo "  Additional prefixes:                                    $site_prefixes"
13288 fi
13289 if test -n "$runpath"; then
13290   echo "  Runtime library search path:                            $runpath"
13291 fi
13292 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13293 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13294 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13295 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13296   echo "  No Xmu; substituting equivalent routines."
13297 fi
13298
13299 if test "$with_xpm" = yes; then
13300   echo "  Compiling in support for XPM images."
13301 elif test "$with_x11" = yes; then
13302   echo "  --------------------------------------------------------------------"
13303   echo "  WARNING: Compiling without XPM support."
13304   if test "$xpm_problem" != ""; then
13305     echo "  Reason: $xpm_problem"
13306   fi
13307   echo "  WARNING: You should strongly consider installing XPM."
13308   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13309   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13310   echo "  --------------------------------------------------------------------"
13311 fi
13312 if test "$with_png" = yes; then
13313   echo "  Compiling in support for PNG image handling."
13314 elif test "$window_system" != "none"; then
13315   echo "  --------------------------------------------------------------------"
13316   echo "  WARNING: Compiling without PNG image support."
13317   if test "$png_problem" != ""; then
13318     echo "  Reason: $png_problem"
13319   fi
13320   echo "  WARNING: You should strongly consider installing the PNG libraries."
13321   echo "  WARNING: Otherwise certain images and glyphs may not display."
13322   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13323   echo "  --------------------------------------------------------------------"
13324 fi
13325 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13326 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13327 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13328 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13329 case "$with_sound" in
13330   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13331   native ) echo "  Compiling in native sound support." ;;
13332   both   ) echo "  Compiling in both network and native sound support." ;;
13333 esac
13334 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13335
13336 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13337 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13338 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13339
13340 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
13341 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
13342 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
13343
13344 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13345 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13346
13347 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13348 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13349 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13350 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13351 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13352 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13353 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13354 if test "$with_wnn" = yes; then
13355   echo "  Compiling in support for the WNN input method on Mule."
13356   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13357 fi
13358 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13359
13360 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13361 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13362 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13363 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13364 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13365 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13366 case "$with_menubars" in
13367   lucid ) echo "  Using Lucid menubars." ;;
13368   motif ) echo "  Using Motif menubars."
13369           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13370           echo "             We recommend using the Lucid menubar instead."
13371           echo "             Re-run configure with --with-menubars='lucid'." ;;
13372 esac
13373 case "$with_scrollbars" in
13374   lucid    ) echo "  Using Lucid scrollbars."     ;;
13375   motif    ) echo "  Using Motif scrollbars."     ;;
13376   athena   ) echo "  Using Athena scrollbars."    ;;
13377   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13378 esac
13379 case "$with_dialogs" in
13380   motif    )
13381     echo "  Using Motif dialog boxes."
13382     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13383       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13384       echo "             We recommend using the Athena dialog boxes instead."
13385       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13386       echo "             Read the PROBLEMS file for more information."
13387     fi; fi
13388     ;;
13389   athena   ) echo "  Using Athena dialog boxes."    ;;
13390   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13391 esac
13392 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
13393 test "$with_clash_detection" = yes && \
13394   echo "  Clash detection will use \"$lockdir\" for locking files."
13395 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13396 test "$with_pop"        = yes && echo "  Using POP for mail access."
13397 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13398 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13399 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13400 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13401 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13402 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13403   != "no no no no no"; then
13404   echo "  WARNING: ---------------------------------------------------------"
13405   echo "  WARNING: Compiling in support for runtime error checking."
13406   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13407   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13408   echo "  WARNING: ---------------------------------------------------------"
13409 fi
13410 echo ""
13411 ) | tee -a Installation
13412 echo ""
13413
13414
13415 # Remove any trailing slashes in these variables.
13416 test -n "$prefix" &&
13417   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13418 test -n "$exec_prefix" &&
13419   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13420
13421
13422 for file in $internal_makefile_list; do
13423   test "$file" = src/Makefile.in && \
13424     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13425   ac_output_files="${ac_output_files+$ac_output_files }$file"
13426 done
13427 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13428 if test "$with_shlib" = "yes"; then
13429   ac_output_files="$ac_output_files lib-src/ellcc.h"
13430 fi
13431
13432 trap '' 1 2 15
13433
13434 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13435
13436 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13437 # Let make expand exec_prefix.
13438 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13439
13440 # Any assignment to VPATH causes Sun make to only execute
13441 # the first set of double-colon rules, so remove it if not needed.
13442 # If there is a colon in the path, we need to keep it.
13443 if test "x$srcdir" = x.; then
13444   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13445 fi
13446
13447 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13448
13449 DEFS=-DHAVE_CONFIG_H
13450
13451 # Without the "./", some shells look in PATH for config.status.
13452 : ${CONFIG_STATUS=./config.status}
13453
13454 echo creating $CONFIG_STATUS
13455 rm -f $CONFIG_STATUS
13456 cat > $CONFIG_STATUS <<EOF
13457 #! /bin/sh
13458 # Generated automatically by configure.
13459 # Run this file to recreate the current configuration.
13460 # This directory was configured as follows,
13461 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13462 #
13463 # $0 $ac_configure_args
13464 #
13465 # Compiler output produced by configure, useful for debugging
13466 # configure, is in ./config.log if it exists.
13467
13468 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13469 for ac_option
13470 do
13471   case "\$ac_option" in
13472   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13473     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13474     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13475   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13476     echo "$CONFIG_STATUS generated by autoconf version 2.13"
13477     exit 0 ;;
13478   -help | --help | --hel | --he | --h)
13479     echo "\$ac_cs_usage"; exit 0 ;;
13480   *) echo "\$ac_cs_usage"; exit 1 ;;
13481   esac
13482 done
13483
13484 ac_given_srcdir=$srcdir
13485 ac_given_INSTALL="$INSTALL"
13486
13487 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13488 EOF
13489 cat >> $CONFIG_STATUS <<EOF
13490
13491 # Protect against being on the right side of a sed subst in config.status.
13492 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13493  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13494 $ac_vpsub
13495 $extrasub
13496 s%@SHELL@%$SHELL%g
13497 s%@CFLAGS@%$CFLAGS%g
13498 s%@CPPFLAGS@%$CPPFLAGS%g
13499 s%@CXXFLAGS@%$CXXFLAGS%g
13500 s%@FFLAGS@%$FFLAGS%g
13501 s%@DEFS@%$DEFS%g
13502 s%@LDFLAGS@%$LDFLAGS%g
13503 s%@LIBS@%$LIBS%g
13504 s%@exec_prefix@%$exec_prefix%g
13505 s%@prefix@%$prefix%g
13506 s%@program_transform_name@%$program_transform_name%g
13507 s%@bindir@%$bindir%g
13508 s%@sbindir@%$sbindir%g
13509 s%@libexecdir@%$libexecdir%g
13510 s%@datadir@%$datadir%g
13511 s%@sysconfdir@%$sysconfdir%g
13512 s%@sharedstatedir@%$sharedstatedir%g
13513 s%@localstatedir@%$localstatedir%g
13514 s%@libdir@%$libdir%g
13515 s%@includedir@%$includedir%g
13516 s%@oldincludedir@%$oldincludedir%g
13517 s%@infodir@%$infodir%g
13518 s%@mandir@%$mandir%g
13519 s%@LN_S@%$LN_S%g
13520 s%@blddir@%$blddir%g
13521 s%@CC@%$CC%g
13522 s%@CPP@%$CPP%g
13523 s%@start_flags@%$start_flags%g
13524 s%@ld_switch_shared@%$ld_switch_shared%g
13525 s%@start_files@%$start_files%g
13526 s%@ld@%$ld%g
13527 s%@lib_gcc@%$lib_gcc%g
13528 s%@RANLIB@%$RANLIB%g
13529 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13530 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
13531 s%@INSTALL_DATA@%$INSTALL_DATA%g
13532 s%@YACC@%$YACC%g
13533 s%@SET_MAKE@%$SET_MAKE%g
13534 s%@X_CFLAGS@%$X_CFLAGS%g
13535 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13536 s%@X_LIBS@%$X_LIBS%g
13537 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13538 s%@install_pp@%$install_pp%g
13539 s%@libs_xauth@%$libs_xauth%g
13540 s%@dnd_objs@%$dnd_objs%g
13541 s%@lwlib_objs@%$lwlib_objs%g
13542 s%@ALLOCA@%$ALLOCA%g
13543 s%@dll_ld@%$dll_ld%g
13544 s%@dll_cflags@%$dll_cflags%g
13545 s%@dll_ldflags@%$dll_ldflags%g
13546 s%@dll_post@%$dll_post%g
13547 s%@dll_ldo@%$dll_ldo%g
13548 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13549 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13550 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13551 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13552 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13553 s%@PROGNAME@%$PROGNAME%g
13554 s%@version@%$version%g
13555 s%@configuration@%$configuration%g
13556 s%@canonical@%$canonical%g
13557 s%@srcdir@%$srcdir%g
13558 s%@pkgdir@%$pkgdir%g
13559 s%@statedir@%$statedir%g
13560 s%@PREFIX@%$PREFIX%g
13561 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13562 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13563 s%@INFODIR@%$INFODIR%g
13564 s%@infopath@%$infopath%g
13565 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13566 s%@INFOPATH@%$INFOPATH%g
13567 s%@package_path@%$package_path%g
13568 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13569 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13570 s%@lispdir@%$lispdir%g
13571 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13572 s%@LISPDIR@%$LISPDIR%g
13573 s%@moduledir@%$moduledir%g
13574 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13575 s%@MODULEDIR@%$MODULEDIR%g
13576 s%@sitelispdir@%$sitelispdir%g
13577 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13578 s%@SITELISPDIR@%$SITELISPDIR%g
13579 s%@sitemoduledir@%$sitemoduledir%g
13580 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13581 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13582 s%@etcdir@%$etcdir%g
13583 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13584 s%@ETCDIR@%$ETCDIR%g
13585 s%@lockdir@%$lockdir%g
13586 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13587 s%@LOCKDIR@%$LOCKDIR%g
13588 s%@archlibdir@%$archlibdir%g
13589 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13590 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13591 s%@docdir@%$docdir%g
13592 s%@bitmapdir@%$bitmapdir%g
13593 s%@extra_objs@%$extra_objs%g
13594 s%@machfile@%$machfile%g
13595 s%@opsysfile@%$opsysfile%g
13596 s%@c_switch_general@%$c_switch_general%g
13597 s%@c_switch_window_system@%$c_switch_window_system%g
13598 s%@c_switch_all@%$c_switch_all%g
13599 s%@ld_switch_general@%$ld_switch_general%g
13600 s%@ld_switch_window_system@%$ld_switch_window_system%g
13601 s%@ld_switch_all@%$ld_switch_all%g
13602 s%@ld_libs_general@%$ld_libs_general%g
13603 s%@ld_libs_window_system@%$ld_libs_window_system%g
13604 s%@ld_libs_all@%$ld_libs_all%g
13605 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13606 s%@native_sound_lib@%$native_sound_lib%g
13607 s%@sound_cflags@%$sound_cflags%g
13608 s%@dynodump_arch@%$dynodump_arch%g
13609 s%@XEMACS_CC@%$XEMACS_CC%g
13610 s%@internal_makefile_list@%$internal_makefile_list%g
13611
13612 CEOF
13613 EOF
13614
13615 cat >> $CONFIG_STATUS <<\EOF
13616
13617 # Split the substitutions into bite-sized pieces for seds with
13618 # small command number limits, like on Digital OSF/1 and HP-UX.
13619 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13620 ac_file=1 # Number of current file.
13621 ac_beg=1 # First line for current file.
13622 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13623 ac_more_lines=:
13624 ac_sed_cmds=""
13625 while $ac_more_lines; do
13626   if test $ac_beg -gt 1; then
13627     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13628   else
13629     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13630   fi
13631   if test ! -s conftest.s$ac_file; then
13632     ac_more_lines=false
13633     rm -f conftest.s$ac_file
13634   else
13635     if test -z "$ac_sed_cmds"; then
13636       ac_sed_cmds="sed -f conftest.s$ac_file"
13637     else
13638       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13639     fi
13640     ac_file=`expr $ac_file + 1`
13641     ac_beg=$ac_end
13642     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13643   fi
13644 done
13645 if test -z "$ac_sed_cmds"; then
13646   ac_sed_cmds=cat
13647 fi
13648 EOF
13649
13650 cat >> $CONFIG_STATUS <<EOF
13651
13652 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13653 EOF
13654 cat >> $CONFIG_STATUS <<\EOF
13655 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13656   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13657   case "$ac_file" in
13658   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13659        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13660   *) ac_file_in="${ac_file}.in" ;;
13661   esac
13662
13663   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13664
13665   # Remove last slash and all that follows it.  Not all systems have dirname.
13666   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13667   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13668     # The file is in a subdirectory.
13669     test ! -d "$ac_dir" && mkdir "$ac_dir"
13670     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13671     # A "../" for each directory in $ac_dir_suffix.
13672     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13673   else
13674     ac_dir_suffix= ac_dots=
13675   fi
13676
13677   case "$ac_given_srcdir" in
13678   .)  srcdir=.
13679       if test -z "$ac_dots"; then top_srcdir=.
13680       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13681   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13682   *) # Relative path.
13683     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13684     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13685   esac
13686
13687   case "$ac_given_INSTALL" in
13688   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13689   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13690   esac
13691
13692   echo creating "$ac_file"
13693   rm -f "$ac_file"
13694   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13695   case "$ac_file" in
13696   *Makefile*) ac_comsub="1i\\
13697 # $configure_input" ;;
13698   *) ac_comsub= ;;
13699   esac
13700
13701   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13702   sed -e "$ac_comsub
13703 s%@configure_input@%$configure_input%g
13704 s%@srcdir@%$srcdir%g
13705 s%@top_srcdir@%$top_srcdir%g
13706 s%@INSTALL@%$INSTALL%g
13707 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13708 fi; done
13709 rm -f conftest.s*
13710
13711 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13712 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13713 #
13714 # ac_d sets the value in "#define NAME VALUE" lines.
13715 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13716 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13717 ac_dC='\3'
13718 ac_dD='%g'
13719 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13720 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13721 ac_uB='\([      ]\)%\1#\2define\3'
13722 ac_uC=' '
13723 ac_uD='\4%g'
13724 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13725 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13726 ac_eB='$%\1#\2define\3'
13727 ac_eC=' '
13728 ac_eD='%g'
13729
13730 if test "${CONFIG_HEADERS+set}" != set; then
13731 EOF
13732 cat >> $CONFIG_STATUS <<EOF
13733   CONFIG_HEADERS="src/config.h lwlib/config.h"
13734 EOF
13735 cat >> $CONFIG_STATUS <<\EOF
13736 fi
13737 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13738   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13739   case "$ac_file" in
13740   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13741        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13742   *) ac_file_in="${ac_file}.in" ;;
13743   esac
13744
13745   echo creating $ac_file
13746
13747   rm -f conftest.frag conftest.in conftest.out
13748   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13749   cat $ac_file_inputs > conftest.in
13750
13751 EOF
13752
13753 # Transform confdefs.h into a sed script conftest.vals that substitutes
13754 # the proper values into config.h.in to produce config.h.  And first:
13755 # Protect against being on the right side of a sed subst in config.status.
13756 # Protect against being in an unquoted here document in config.status.
13757 rm -f conftest.vals
13758 cat > conftest.hdr <<\EOF
13759 s/[\\&%]/\\&/g
13760 s%[\\$`]%\\&%g
13761 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13762 s%ac_d%ac_u%gp
13763 s%ac_u%ac_e%gp
13764 EOF
13765 sed -n -f conftest.hdr confdefs.h > conftest.vals
13766 rm -f conftest.hdr
13767
13768 # This sed command replaces #undef with comments.  This is necessary, for
13769 # example, in the case of _POSIX_SOURCE, which is predefined and required
13770 # on some systems where configure will not decide to define it.
13771 cat >> conftest.vals <<\EOF
13772 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13773 EOF
13774
13775 # Break up conftest.vals because some shells have a limit on
13776 # the size of here documents, and old seds have small limits too.
13777
13778 rm -f conftest.tail
13779 while :
13780 do
13781   ac_lines=`grep -c . conftest.vals`
13782   # grep -c gives empty output for an empty file on some AIX systems.
13783   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13784   # Write a limited-size here document to conftest.frag.
13785   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13786   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13787   echo 'CEOF
13788   sed -f conftest.frag conftest.in > conftest.out
13789   rm -f conftest.in
13790   mv conftest.out conftest.in
13791 ' >> $CONFIG_STATUS
13792   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13793   rm -f conftest.vals
13794   mv conftest.tail conftest.vals
13795 done
13796 rm -f conftest.vals
13797
13798 cat >> $CONFIG_STATUS <<\EOF
13799   rm -f conftest.frag conftest.h
13800   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13801   cat conftest.in >> conftest.h
13802   rm -f conftest.in
13803   if cmp -s $ac_file conftest.h 2>/dev/null; then
13804     echo "$ac_file is unchanged"
13805     rm -f conftest.h
13806   else
13807     # Remove last slash and all that follows it.  Not all systems have dirname.
13808       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13809       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13810       # The file is in a subdirectory.
13811       test ! -d "$ac_dir" && mkdir "$ac_dir"
13812     fi
13813     rm -f $ac_file
13814     mv conftest.h $ac_file
13815   fi
13816 fi; done
13817
13818 EOF
13819 cat >> $CONFIG_STATUS <<EOF
13820 CPP="$CPP"
13821  top_srcdir="$srcdir"
13822  MAKE_SUBDIR="$MAKE_SUBDIR"
13823
13824 EOF
13825 cat >> $CONFIG_STATUS <<\EOF
13826 for dir in . $MAKE_SUBDIR; do
13827   (
13828     cd $dir
13829     rm -f junk.c
13830     < Makefile.in \
13831       sed -e '/^# Generated/d' \
13832           -e 's%/\*\*/#.*%%' \
13833           -e 's/^ *# */#/' \
13834           -e '/^##/d' \
13835           -e '/^#/ {
13836 p
13837 d
13838 }'        \
13839           -e '/./ {
13840 s/\([\"]\)/\\\1/g
13841 s/^/"/
13842 s/$/"/
13843 }'  > junk.c;
13844
13845
13846
13847     echo creating $dir/Makefile
13848 $CPP -I. -I${top_srcdir}/src  junk.c \
13849   | sed -e 's/^\#.*//'          \
13850         -e 's/^[        ][      ]*$//'\
13851         -e 's/^ /       /'              \
13852   | sed -n -e '/^..*$/p'        \
13853   | sed '/^\"/ {
13854         s/\\\([\"]\)/\1/g
13855         s/^[    ]*\"//
13856         s/\"[   ]*$//
13857 }' > Makefile.new
13858     chmod 444 Makefile.new
13859     mv -f Makefile.new Makefile
13860
13861     echo creating $dir/GNUmakefile
13862 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13863   | sed -e 's/^\#.*//'          \
13864         -e 's/^[        ][      ]*$//'\
13865         -e 's/^ /       /'              \
13866   | sed -n -e '/^..*$/p'        \
13867   | sed '/^\"/ {
13868         s/\\\([\"]\)/\1/g
13869         s/^[    ]*\"//
13870         s/\"[   ]*$//
13871 }' > Makefile.new
13872     chmod 444 Makefile.new
13873     mv -f Makefile.new GNUmakefile
13874
13875     rm -f junk.c
13876   )
13877 done
13878
13879 sed < config.status >> lib-src/config.values \
13880   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13881   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13882   -e 's/^\([^ ]*\) $/\1 ""/' \
13883   -e 's/ 1$/ t/'
13884
13885
13886 exit 0
13887 EOF
13888 chmod +x $CONFIG_STATUS
13889 rm -fr confdefs* $ac_clean_files
13890 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1