XEmacs 21.2.9
[chise/xemacs-chise.git.1] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.12 
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 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
203   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
204   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
205     ac_n= ac_c='
206 ' ac_t='        '
207   else
208     ac_n=-n ac_c= ac_t=
209   fi
210 else
211   ac_n= ac_c='\c' ac_t=
212 fi
213
214
215 progname="`echo $0 | sed 's:^\./\./:\./:'`"
216
217
218 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
219 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
220
221 prefix='/usr/local'
222 exec_prefix='${prefix}'
223 bindir='${exec_prefix}/bin'
224 datadir='${prefix}/lib'
225 statedir='${prefix}/lib'
226 libdir='${exec_prefix}/lib'
227 mandir='${prefix}/man/man1'
228 infodir='${datadir}/${PROGNAME}-${version}/info'
229 infopath=''
230 install_pp=''
231 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
232 moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
233 sitelispdir='${datadir}/xemacs/site-lisp'
234 sitemoduledir='${datadir}/xemacs/site-modules'
235 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
236 package_path=''
237 etcdir='${datadir}/${PROGNAME}-${version}/etc'
238 lockdir='${statedir}/${PROGNAME}/lock'
239 archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
240 with_site_lisp='no'
241 with_site_modules='yes'
242 with_menubars=''
243 with_scrollbars=''
244 with_dialogs=''
245 with_file_coding=''
246 puresize=''
247 cpp='' cppflags='' libs='' ldflags=''
248 dynamic=''
249 with_x11=''
250 with_msw=''
251 rel_alloc='default'
252 with_system_malloc='default'
253 with_dlmalloc='default'
254 native_sound_lib=''
255 use_assertions="yes"
256 with_toolbars=""
257 with_tty=""
258 use_union_type="no"
259 with_dnet=""
260
261
262
263
264 arguments="$@"
265
266 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
267 quoted_arguments=
268 for i in "$@"; do
269    case "$i" in
270    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
271    | --no-cr | --no-c) ;;
272    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
273    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
274    *)
275    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
276    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
277    esac
278 done
279
280 while test $# != 0; do
281   arg="$1"; shift
282   case "$arg" in
283     --no-create|--no-recursion) ;;
284         -* )
285             case "$arg" in
286         -*=*)
287           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
288           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
289           valomitted=no
290         ;;
291                                                                           -*)
292                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
293           val="yes" valomitted=yes
294         ;;
295       esac
296
297             optname="$opt"
298       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
299
300             case "${valomitted}-${opt}" in yes-without_* )
301         opt=`echo $opt | sed 's/without/with/'`
302         valomitted="no" val="no" ;;
303       esac
304
305             case "$opt" in
306
307         with_site_lisp  | \
308     with_site_modules | \
309         with_x          | \
310         with_x11        | \
311         with_msw        | \
312         with_gcc        | \
313         dynamic         | \
314         with_ncurses    | \
315         with_dnet       | \
316         with_socks      | \
317         with_dragndrop  | \
318         with_cde        | \
319         with_offix      | \
320         with_gpm        | \
321         with_xpm        | \
322         with_xface      | \
323         with_gif        | \
324         with_jpeg       | \
325         with_png        | \
326         with_tiff       | \
327         with_session    | \
328         with_xmu        | \
329         with_purify     | \
330         with_quantify   | \
331         with_toolbars   | \
332         with_tty        | \
333         with_xfs        | \
334         with_i18n3      | \
335         with_mule       | \
336         with_file_coding| \
337         with_canna      | \
338         with_wnn        | \
339         with_wnn6       | \
340         with_workshop   | \
341         with_sparcworks | \
342         with_tooltalk   | \
343         with_ldap       | \
344         with_pop        | \
345         with_kerberos   | \
346         with_hesiod     | \
347         with_dnet       | \
348         with_infodock   | \
349         external_widget | \
350         verbose         | \
351         extra_verbose   | \
352         const_is_losing | \
353         usage_tracking  | \
354         use_union_type  | \
355         debug           | \
356         use_assertions  | \
357         gung_ho         | \
358         use_minimal_tagbits                     | \
359         use_indexed_lrecord_implementation      | \
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         puresize        | \
382         cache_file      | \
383         native_sound_lib| \
384         site_lisp       | \
385         x_includes      | \
386         x_libraries     | \
387         site_includes   | \
388         site_libraries  | \
389         site_prefixes   | \
390         site_runtime_libraries )
391                   if test "$valomitted" = "yes" ; then
392                     if test "$#" = 0 ; then
393               (echo "$progname: Usage error:"
394 echo " " "The \`--$optname' option requires a value."
395 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
396             fi
397             val="$1"; shift
398           fi
399           eval "$opt=\"$val\""
400         ;;
401
402                 rel_alloc | \
403         with_dlmalloc | \
404         with_debug_malloc  | use_debug_malloc | \
405         with_system_malloc | use_system_malloc )
406           case "$val" in
407             y | ye | yes )      val=yes ;;
408             n | no )            val=no  ;;
409             d | de | def | defa | defau | defaul | default ) val=default ;;
410             * ) (echo "$progname: Usage error:"
411 echo " " "The \`--$optname' option requires one of these values:
412   \`yes', \`no', or \`default'."
413 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
414           esac
415           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
416           eval "$opt=\"$val\""
417         ;;
418
419                 "with_database" )
420           with_database_berkdb=no
421           with_database_dbm=no
422           with_database_gnudbm=no
423           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
424             case "$x" in
425                 no ) ;;
426                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
427                 d | db | dbm )                          with_database_dbm=yes    ;;
428                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
429                 * ) (echo "$progname: Usage error:"
430 echo " " "The \`--$optname' option value
431   must be either \`no' or a comma-separated list
432   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
433 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
434             esac
435           done
436           if test "$with_database_dbm"    = "yes" -a \
437                   "$with_database_gnudbm" = "yes"; then
438           (echo "$progname: Usage error:"
439 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
440   with the \`--$optname' option."
441 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
442           fi
443         ;;
444
445                 "with_sound" )
446                           case "$val" in
447             y | ye | yes )                      val=native ;;
448             n | no | non | none )               val=no;;
449             na | nat | nati | nativ | native )  val=native  ;;
450             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
451             b | bo | bot | both )               val=both;;
452             * ) (echo "$progname: Usage error:"
453 echo " " "The \`--$optname' option must have one of these values:
454   \`native', \`nas', \`both', or \`none'."
455 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
456           esac
457           eval "$opt=\"$val\""
458         ;;
459
460                 "with_xim" )
461           case "$val" in
462             y | ye | yes )                val=yes   ;;
463             n | no | non | none )         val=no    ;;
464             x | xl | xli | xlib )         val=xlib  ;;
465             m | mo | mot | moti | motif ) val=motif ;;
466             * ) (echo "$progname: Usage error:"
467 echo " " "The \`--$optname' option must have one of these values:
468   \`motif', \`xlib', \`yes', or \`no'."
469 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
470           esac
471           eval "$opt=\"$val\""
472         ;;
473
474                 "mail_locking" )
475           case "$val" in
476             lockf )     val=lockf ;;
477             flock )     val=flock ;;
478             file )      val=file  ;;
479             * ) (echo "$progname: Usage error:"
480 echo " " "The \`--$optname' option must have one of these values:
481   \`lockf', \`flock', or \`file'."
482 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
483           esac
484           eval "$opt=\"$val\""
485         ;;
486
487                 "error_checking" )
488                           
489           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
490             case "$x" in
491                       n | no | non | none ) new_default=no ;;
492               a | al | all )        new_default=yes ;;
493
494               extents )       error_check_extents=yes ;;
495               noextents )     error_check_extents=no ;;
496
497               typecheck )     error_check_typecheck=yes ;;
498               notypecheck )   error_check_typecheck=no ;;
499
500               bufpos )        error_check_bufpos=yes ;;
501               nobufpos )      error_check_bufpos=no ;;
502
503               gc )            error_check_gc=yes ;;
504               nogc )          error_check_gc=no ;;
505
506               malloc )        error_check_malloc=yes ;;
507               nomalloc )      error_check_malloc=no ;;
508
509               * ) bogus_error_check=yes ;;
510             esac
511             if test "$bogus_error_check" -o \
512                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
513                 if test "$error_check_default" = yes ; then
514                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', and \`nomalloc'."
515                 else
516                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'."
517                 fi
518                 (echo "$progname: Usage error:"
519 echo " " "Valid types for the \`--$optname' option are:
520   $types."
521 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
522             elif test -n "$new_default" ; then
523                 error_check_extents=$new_default
524                 error_check_typecheck=$new_default
525                 error_check_bufpos=$new_default
526                 error_check_gc=$new_default
527                 error_check_malloc=$new_default
528                 new_default=    # reset this
529             fi
530             echeck_notfirst=true
531           done
532         ;;
533
534                                 
535                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
536         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
537         archlibdir | docdir | package_path )
538                    if test "$valomitted" = "yes"; then
539              if test "$#" = 0; then
540                  (echo "$progname: Usage error:"
541 echo " " "The \`--$optname' option requires a value."
542 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
543              fi
544              val="$1"; shift
545            fi
546            eval "$opt=\"$val\""
547
548                            case "$opt" in
549              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
550     Defining LISPDIR_USER_DEFINED
551 EOF
552 cat >> confdefs.h <<\EOF
553 #define LISPDIR_USER_DEFINED 1
554 EOF
555 }
556  ;;
557              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
558     Defining SITELISPDIR_USER_DEFINED
559 EOF
560 cat >> confdefs.h <<\EOF
561 #define SITELISPDIR_USER_DEFINED 1
562 EOF
563 }
564  ;;
565              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
566     Defining MODULEDIR_USER_DEFINED
567 EOF
568 cat >> confdefs.h <<\EOF
569 #define MODULEDIR_USER_DEFINED 1
570 EOF
571 }
572  ;;
573              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
574     Defining ETCDIR_USER_DEFINED
575 EOF
576 cat >> confdefs.h <<\EOF
577 #define ETCDIR_USER_DEFINED 1
578 EOF
579 }
580  ;;
581              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
582     Defining INFODIR_USER_DEFINED
583 EOF
584 cat >> confdefs.h <<\EOF
585 #define INFODIR_USER_DEFINED 1
586 EOF
587 }
588  ;;
589              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
590     Defining INFOPATH_USER_DEFINED
591 EOF
592 cat >> confdefs.h <<\EOF
593 #define INFOPATH_USER_DEFINED 1
594 EOF
595 }
596  ;;
597              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
598     Defining PACKAGE_PATH_USER_DEFINED
599 EOF
600 cat >> confdefs.h <<\EOF
601 #define PACKAGE_PATH_USER_DEFINED 1
602 EOF
603 }
604  ;;
605              datadir )
606                 { test "$extra_verbose" = "yes" && cat << \EOF
607     Defining INFODIR_USER_DEFINED
608 EOF
609 cat >> confdefs.h <<\EOF
610 #define INFODIR_USER_DEFINED 1
611 EOF
612 }
613
614                 { test "$extra_verbose" = "yes" && cat << \EOF
615     Defining LISPDIR_USER_DEFINED
616 EOF
617 cat >> confdefs.h <<\EOF
618 #define LISPDIR_USER_DEFINED 1
619 EOF
620 }
621
622             { test "$extra_verbose" = "yes" && cat << \EOF
623     Defining MODULEDIR_USER_DEFINED
624 EOF
625 cat >> confdefs.h <<\EOF
626 #define MODULEDIR_USER_DEFINED 1
627 EOF
628 }
629
630                 { test "$extra_verbose" = "yes" && cat << \EOF
631     Defining ETCDIR_USER_DEFINED
632 EOF
633 cat >> confdefs.h <<\EOF
634 #define ETCDIR_USER_DEFINED 1
635 EOF
636 }
637  ;;
638              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
639     Defining LOCKDIR_USER_DEFINED
640 EOF
641 cat >> confdefs.h <<\EOF
642 #define LOCKDIR_USER_DEFINED 1
643 EOF
644 }
645  ;;
646              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
647     Defining ARCHLIBDIR_USER_DEFINED
648 EOF
649 cat >> confdefs.h <<\EOF
650 #define ARCHLIBDIR_USER_DEFINED 1
651 EOF
652 }
653  ;;
654            esac
655         ;;
656
657                 "no_create" ) ;;
658
659                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
660
661                 "with_menubars"   | \
662         "with_scrollbars" | \
663         "with_dialogs" )
664           case "$val" in
665             l | lu | luc | luci | lucid )               val=lucid  ;;
666             m | mo | mot | moti | motif )               val=motif  ;;
667             athena3d | athena-3d )                      val=athena3d ;;
668             a | at | ath | athe | athen | athena )      val=athena ;;
669             n | no | non | none )                       val=no ;;
670             * ) (echo "$progname: Usage error:"
671 echo " " "The \`--$optname' option must have one of these values:
672   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
673 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
674           esac
675           eval "$opt=\"$val\""
676         ;;
677
678                 "run_in_place"  | \
679         "with_gnu_make" )
680           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
681         ;;
682
683                 * ) (echo "$progname: Usage error:"
684 echo " " "Unrecognized option: $arg"
685 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
686
687       esac
688     ;;
689
690         *-*-*) configuration="$arg" ;;
691
692         *) (echo "$progname: Usage error:"
693 echo " " "Unrecognized argument: $arg"
694 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
695
696   esac
697 done
698
699
700 test -n "$cpp"      && CPP="$cpp"
701 test -n "$cppflags" && CPPFLAGS="$cppflags"
702 test -n "$libs"     && LIBS="$libs"
703 test -n "$ldflags"  && LDFLAGS="$ldflags"
704
705 eval set x "$quoted_arguments"; shift
706
707 test "$extra_verbose" = "yes" && verbose=yes
708
709 test -n "$with_x" && with_x11="$with_x"
710
711 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
712   test "$with_system_malloc" = "default" && with_system_malloc=yes
713 fi
714
715 if test -n "$gung_ho"; then
716   test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho"
717   test -z "$use_indexed_lrecord_implementation" && \
718     use_indexed_lrecord_implementation="$gung_ho"
719 fi
720 if test "$use_minimal_tagbits" = "no"; then
721   test "$with_dlmalloc" = "yes" && \
722     (echo "$progname: Usage error:"
723 echo " " "--with-dlmalloc requires --use-minimal-tagbits"
724 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
725   with_dlmalloc=no
726 fi
727
728
729
730 if test "$with_cde $with_tooltalk" = "yes no"; then
731   (echo "$progname: Usage error:"
732 echo " " "--with-cde requires --with-tooltalk"
733 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
734 elif test "$with_tooltalk" = "no" ; then with_cde=no
735 elif test "$with_cde" = "yes"; then with_tooltalk=yes
736 fi
737
738
739 case "$srcdir" in
740
741     "" )
742     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
743       if test -f "$dir/src/lisp.h" -a \
744               -f "$dir/lisp/version.el" ; then
745         srcdir="$dir"
746         break
747       fi
748     done
749     if test -z "$srcdir" ; then
750       (echo "$progname: Usage error:"
751 echo " " "Neither the current directory nor its parent seem to
752   contain the XEmacs sources.  If you do not want to build XEmacs in its
753   source tree, you should run \`$progname' in the directory in which
754   you wish to build XEmacs, using the \`--srcdir' option to say where the
755   sources may be found."
756 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
757     fi
758   ;;
759
760     * )
761     if test ! -f "$srcdir/src/lisp.h" -o \
762             ! -f "$srcdir/lisp/version.el" ; then
763       (echo "$progname: Usage error:"
764 echo " " "The directory specified with the \`--srcdir' option,
765   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
766   either run the \`$progname' script at the top of the XEmacs source
767   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
768 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
769     fi
770   ;;
771 esac
772
773 if test -z "$configuration"; then
774     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
775   if test -z "$configuration"; then
776     (echo "$progname: Usage error:"
777 echo " " "XEmacs has not been ported to this host type.
778 Try explicitly specifying the CONFIGURATION when rerunning configure."
779 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
780   fi
781 fi
782
783 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
784 echo "configure:785: checking whether ln -s works" >&5
785
786 rm -f conftestdata
787 if ln -s X conftestdata 2>/dev/null
788 then
789   rm -f conftestdata
790   ac_cv_prog_LN_S="ln -s"
791 else
792   ac_cv_prog_LN_S=ln
793 fi
794 LN_S="$ac_cv_prog_LN_S"
795 if test "$ac_cv_prog_LN_S" = "ln -s"; then
796   echo "$ac_t""yes" 1>&6
797 else
798   echo "$ac_t""no" 1>&6
799 fi
800
801
802 for dir in lisp etc man info; do
803   if test ! -d "$dir" ; then
804     echo Making symbolic link to "$srcdir/$dir"
805     ${LN_S} "$srcdir/$dir" "$dir"
806   fi
807 done
808
809 absolute_pwd="`pwd`";
810 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
811 then blddir="$PWD"
812 else blddir="$absolute_pwd"
813 fi
814
815
816 case "$srcdir" in
817   /* ) ;;
818   .  ) srcdir="$blddir" ;;
819   *  ) srcdir="`cd $srcdir && pwd`" ;;
820 esac
821
822 if test `pwd` != `sh -c cd $srcdir && pwd`  \
823    && test -f "$srcdir/src/config.h"; then
824   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
825    echo "   as a build directory right now; it has been configured in its own"
826    echo "   right.  To configure in another directory as well, you MUST"
827    echo "   use GNU make.  If you do not have GNU make, then you must"
828    echo "   now do \`make distclean' in $srcdir,"
829    echo "   and then run $progname again.") >&2
830   extrasub='/^VPATH[     ]*=/c\
831 vpath %.c $(srcdir)\
832 vpath %.h $(srcdir)\
833 vpath %.y $(srcdir)\
834 vpath %.l $(srcdir)\
835 vpath %.s $(srcdir)\
836 vpath %.in $(srcdir)'
837 fi
838
839 . "$srcdir/version.sh" || exit 1;
840 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
841 : "${extra_verbose=$beta}"
842 version="${emacs_major_version}.${emacs_minor_version}"
843 { test "$extra_verbose" = "yes" && cat << EOF
844     Defining EMACS_MAJOR_VERSION = $emacs_major_version
845 EOF
846 cat >> confdefs.h <<EOF
847 #define EMACS_MAJOR_VERSION $emacs_major_version
848 EOF
849 }
850
851 { test "$extra_verbose" = "yes" && cat << EOF
852     Defining EMACS_MINOR_VERSION = $emacs_minor_version
853 EOF
854 cat >> confdefs.h <<EOF
855 #define EMACS_MINOR_VERSION $emacs_minor_version
856 EOF
857 }
858
859 if test -n "$emacs_beta_version"; 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 fi
870 { test "$extra_verbose" = "yes" && cat << EOF
871     Defining XEMACS_CODENAME = "$xemacs_codename"
872 EOF
873 cat >> confdefs.h <<EOF
874 #define XEMACS_CODENAME "$xemacs_codename"
875 EOF
876 }
877
878 { test "$extra_verbose" = "yes" && cat << EOF
879     Defining EMACS_VERSION = "$version"
880 EOF
881 cat >> confdefs.h <<EOF
882 #define EMACS_VERSION "$version"
883 EOF
884 }
885
886
887 if test "$with_infodock" = "yes"; then
888   if test ! -f ../ID-INSTALL; then
889     echo "Cannot build InfoDock without InfoDock sources"
890     with_infodock=no
891   fi
892 fi
893
894 if test "$with_infodock" = "yes"; then
895       { test "$extra_verbose" = "yes" && cat << EOF
896     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
897 EOF
898 cat >> confdefs.h <<EOF
899 #define INFODOCK_MAJOR_VERSION $infodock_major_version
900 EOF
901 }
902
903   { test "$extra_verbose" = "yes" && cat << EOF
904     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
905 EOF
906 cat >> confdefs.h <<EOF
907 #define INFODOCK_MINOR_VERSION $infodock_minor_version
908 EOF
909 }
910
911   { test "$extra_verbose" = "yes" && cat << EOF
912     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
913 EOF
914 cat >> confdefs.h <<EOF
915 #define INFODOCK_BUILD_VERSION $infodock_build_version
916 EOF
917 }
918
919   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
920   PROGNAME=infodock
921   CPPFLAGS="$CPPFLAGS -DINFODOCK"
922 else
923   PROGNAME=xemacs
924 fi
925
926 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
927 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
928     Defining ERROR_CHECK_EXTENTS
929 EOF
930 cat >> confdefs.h <<\EOF
931 #define ERROR_CHECK_EXTENTS 1
932 EOF
933 }
934
935 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
936     Defining ERROR_CHECK_TYPECHECK
937 EOF
938 cat >> confdefs.h <<\EOF
939 #define ERROR_CHECK_TYPECHECK 1
940 EOF
941 }
942
943 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
944     Defining ERROR_CHECK_BUFPOS
945 EOF
946 cat >> confdefs.h <<\EOF
947 #define ERROR_CHECK_BUFPOS 1
948 EOF
949 }
950
951 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
952     Defining ERROR_CHECK_GC
953 EOF
954 cat >> confdefs.h <<\EOF
955 #define ERROR_CHECK_GC 1
956 EOF
957 }
958
959 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
960     Defining ERROR_CHECK_MALLOC
961 EOF
962 cat >> confdefs.h <<\EOF
963 #define ERROR_CHECK_MALLOC 1
964 EOF
965 }
966
967 if test "${debug:=$beta}" = "yes"; then
968   use_assertions=yes memory_usage_stats=yes
969   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
970    echo "    xemacs will be linked with \"debug.o\""
971  fi
972   { test "$extra_verbose" = "yes" && cat << \EOF
973     Defining DEBUG_XEMACS
974 EOF
975 cat >> confdefs.h <<\EOF
976 #define DEBUG_XEMACS 1
977 EOF
978 }
979
980 fi
981 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
982     Defining USE_ASSERTIONS
983 EOF
984 cat >> confdefs.h <<\EOF
985 #define USE_ASSERTIONS 1
986 EOF
987 }
988
989 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
990     Defining MEMORY_USAGE_STATS
991 EOF
992 cat >> confdefs.h <<\EOF
993 #define MEMORY_USAGE_STATS 1
994 EOF
995 }
996
997
998
999 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1000 echo "configure:1001: checking "host system type"" >&5
1001 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1002 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1003 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1004 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1005 echo "$ac_t""$configuration" 1>&6
1006
1007
1008
1009
1010
1011 machine='' opsys=''
1012
1013 case "$canonical" in
1014   sparc-*-*        ) machine=sparc ;;
1015   alpha*-*-*       ) machine=alpha ;;
1016   vax-*-*          ) machine=vax ;;
1017   mips-dec-*       ) machine=pmax ;;
1018   mips-sgi-*       ) machine=iris4d ;;
1019   romp-ibm-*       ) machine=ibmrt ;;
1020   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1021   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1022   powerpc*-*       ) machine=powerpc ;;
1023   hppa-*-*         ) machine=hp800 ;;
1024   m88k-dg-*        ) machine=aviion ;;
1025   m68*-sony-*      ) machine=news ;;
1026   mips-sony-*      ) machine=news-risc ;;
1027   clipper-*        ) machine=clipper ;;
1028   arm-*            ) machine=arm ;;
1029   ns32k-*          ) machine=ns32000 ;;
1030 esac
1031
1032 case "$canonical" in
1033   *-*-linux*    ) opsys=linux ;;
1034   *-*-netbsd*   ) opsys=netbsd ;;
1035   *-*-openbsd*  ) opsys=openbsd ;;
1036   *-*-nextstep* ) opsys=nextstep ;;
1037   *-*-vms       ) opsys=vms ;;
1038
1039     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1040   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1041   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1042   *-dec-osf3*                ) opsys=decosf3-1 ;;
1043   *-dec-osf4*                ) opsys=decosf4-0 ;;
1044
1045     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1046   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1047   *-*-ultrix* )         opsys=ultrix4-3 ;;
1048
1049     *-*-aix3.1*  ) opsys=aix3-1 ;;
1050   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1051   *-*-aix3*    ) opsys=aix3-2   ;;
1052   *-*-aix4.0*  ) opsys=aix4     ;;
1053   *-*-aix4.1*  ) opsys=aix4-1   ;;
1054   *-*-aix4*    ) opsys=aix4-2   ;;
1055
1056     *-gnu* )                    opsys=gnu    ;;
1057   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1058   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1059   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1060   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1061   *-*-aos*   )                  opsys=bsd4-3 ;;
1062   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1063   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1064   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1065   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1066   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1067   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1068         if test -z "$NON_GNU_CPP" ; then
1069           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1070             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1071           done
1072         fi
1073         opsys=usg5-4-2 ;;
1074     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1075     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1076 esac
1077
1078 case "$canonical" in
1079
1080     *-*-netbsd* )
1081     case "$canonical" in
1082       i[3-9]86-*-netbsd*) machine=intel386 ;;
1083       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1084                                             machine=hp9000s300 ;;
1085       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1086       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1087     esac
1088   ;;
1089
1090     *-*-openbsd* )
1091     case "${canonical}" in
1092       i386-*-openbsd*)          machine=intel386 ;;
1093       m68k-*-openbsd*)          machine=hp9000s300 ;;
1094       mipsel-*-openbsd*)        machine=pmax ;;
1095      esac
1096    ;;
1097
1098     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1099   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1100
1101     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1102   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1103
1104     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1105
1106     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1107
1108     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1109
1110     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1111
1112     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1113
1114     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1115   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1116   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1117
1118   
1119     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1120
1121     *-convex-bsd* | *-convex-convexos* )
1122     machine=convex opsys=bsd4-3
1123     NON_GNU_CPP="cc -E -P"
1124   ;;
1125
1126     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1127
1128     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1129   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1130   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1131   m88k-dg-dgux*                           ) opsys=dgux     ;;
1132
1133     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1134   m88k-motorola-sysv4* )
1135                     machine=delta88k opsys=usg5-4-2
1136   ;;
1137   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1138
1139     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1140   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1141
1142     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1143
1144     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1145   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1146   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1147
1148       m88k-harris-cxux* )
1149         case "`uname -r`" in
1150        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1151        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1152     esac
1153     NON_GNU_CPP="/lib/cpp"
1154   ;;
1155     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1156     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1157
1158     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1159
1160     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1161
1162     *-hp-hpux* )
1163         case "$canonical" in
1164       m68*  ) machine=hp9000s300 ;;
1165       hppa* ) machine=hp800      ;;
1166     esac
1167
1168     case "$canonical" in
1169       *-hp-hpux7*  )  opsys=hpux   ;;
1170       *-hp-hpux8*  )  opsys=hpux8  ;;
1171       *-hp-hpux9*  )  opsys=hpux9  ;;
1172       *-hp-hpux10* )  opsys=hpux10 ;;
1173       *-hp-hpux11* )  opsys=hpux11 ;;
1174       *            )  opsys=hpux   ;;
1175     esac
1176
1177         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1178    echo "    xemacs will be linked with \"strcat.o\""
1179  fi ;; esac
1180
1181     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1182         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1183     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1184
1185     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1186   ;;
1187
1188     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1189   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1190
1191     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1192   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1193   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1194   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1195   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1196   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1197
1198     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1199   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1200
1201     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1202
1203     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1204
1205     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1206
1207     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1208
1209       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1210
1211     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1212
1213     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1214
1215     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1216
1217     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1218
1219         mips-mips-usg* ) machine=mips4 ;;
1220   mips-mips-riscos4 )
1221     machine=mips4
1222     NON_GNU_CC="cc -systype bsd43"
1223     NON_GNU_CPP="cc -systype bsd43 -E"
1224     case "$canonical" in
1225       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1226       mips-mips-riscos5* ) opsys=riscos5 ;;
1227     esac
1228   ;;
1229   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1230   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1231
1232     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1233
1234     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1235
1236     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1237   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1238
1239     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1240
1241     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1242
1243     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1244
1245     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1246
1247     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1248   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1249
1250     mips-siemens-sysv* | mips-sni-sysv*)
1251     machine=mips-siemens opsys=usg5-4
1252     NON_GNU_CC=/usr/ccs/bin/cc
1253     NON_GNU_CPP=/usr/ccs/lib/cpp
1254   ;;
1255
1256     mips-nec-sysv*)
1257     machine=mips-nec
1258     NON_GNU_CC=/usr/ccs/bin/cc
1259     NON_GNU_CPP=/usr/ccs/lib/cpp
1260   ;;
1261
1262       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1263   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1264     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1265   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1266   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1267   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1268   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1269   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1270   mips-sgi-irix*      ) opsys=irix5-0 ;;
1271
1272     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1273   *-sony-news* ) opsys=newsos5 ;;
1274
1275     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1276
1277     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1278         case "$canonical" in
1279       m68*-sunos1* )             machine=sun1     ;;
1280       m68*-sunos2* )             machine=sun2     ;;
1281       m68* )                     machine=sun3     ;;
1282       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1283       i*86-*-* )                 machine=intel386 ;;
1284       rs6000* )                  machine=rs6000   ;;
1285     esac
1286
1287         case "$canonical" in *-sunos5*)
1288       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1289     esac
1290
1291                     case "$canonical" in
1292       *-sunos4* )
1293         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1294         : ;;
1295       *-solaris2* )
1296         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1297         RANLIB=':' ;;
1298     esac
1299
1300     case "$canonical" in
1301       *-solaris*          )
1302         opsys=sol2
1303         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1304         { test "$extra_verbose" = "yes" && cat << EOF
1305     Defining OS_RELEASE = $os_release
1306 EOF
1307 cat >> confdefs.h <<EOF
1308 #define OS_RELEASE $os_release
1309 EOF
1310 }
1311  ;;
1312
1313             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1314       *-sunos4.0*         ) opsys=sunos4-0      ;;
1315       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1316       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1317       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1318       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1319       *-mach*             ) opsys=mach-bsd4-3   ;;
1320       *                   ) opsys=bsd4-2        ;;
1321     esac
1322
1323     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1324
1325         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1326   ;;
1327
1328     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1329
1330     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1331   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1332
1333     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1334
1335     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1336
1337     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1338       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1339
1340     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1341
1342     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1343
1344     vax-dec-* )
1345     case "$canonical" in
1346       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1347       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1348       *-mach* )                         opsys=mach-bsd4-3 ;;
1349     esac
1350   ;;
1351
1352     ns16k-whitechapel-* ) machine=mg1 ;;
1353
1354     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1355
1356     i[3-9]86-*-* )
1357     machine=intel386
1358     case "$canonical" in
1359       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1360       *-isc2.2* )               opsys=isc2-2 ;;
1361       *-isc4.0* )               opsys=isc4-0 ;;
1362       *-isc4.* )                opsys=isc4-1
1363                                 GCC_TEST_OPTIONS=-posix
1364                                 NON_GCC_TEST_OPTIONS=-Xp
1365                                 ;;
1366       *-isc* )                  opsys=isc3-0 ;;
1367       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1368       *-esix* )                 opsys=esix ;;
1369       *-mach* )                 opsys=mach-bsd4-3 ;;
1370       *-xenix* )                opsys=xenix ;;
1371       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1372       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1373       *-bsdi3* )                opsys=bsdos3 ;;
1374       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1375       *-bsdi2* )                opsys=bsdos2 ;;
1376       *-sco3.2v5* )             opsys=sco5 ;
1377                                                         if test "$dynamic" = "yes" ; then
1378                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1379         else
1380                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1381         fi ;;
1382       *-386bsd* )               opsys=386bsd ;;
1383       *-freebsd* )              opsys=freebsd ;;
1384       *-nextstep* )             opsys=nextstep ;;
1385       *-pc-cygwin32 )           opsys=cygwin32 ;;
1386           esac
1387   ;;
1388
1389     m68k-*-linux* ) machine=m68k opsys=linux ;;
1390
1391 esac
1392
1393 if test -z "$machine" -o -z "$opsys"; then
1394   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1395    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1396   ) >&2
1397   exit 1
1398 fi
1399
1400 if test -z "$dynamic"; then
1401   case "$opsys" in
1402     hpux* | sunos4* ) dynamic=no ;;
1403     *) dynamic=yes ;;
1404   esac
1405 fi
1406 if test "$dynamic" = "yes"; then
1407   case "$opsys" in
1408     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1409     decosf* ) ld_call_shared="-call_shared" ;;
1410   esac
1411 else   case "$opsys" in
1412     sol2 )
1413       echo "Static linking is not supported on Solaris 2."
1414       echo "Rerun configure without specifying --dynamic=no."
1415       exit 1 ;;
1416     linux   ) ld_call_shared="-Bstatic" ;;
1417     decosf* ) ld_call_shared="-non_shared" ;;
1418   esac
1419 fi
1420
1421 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1422
1423 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1424 { test "$extra_verbose" = "yes" && cat << EOF
1425     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1426 EOF
1427 cat >> confdefs.h <<EOF
1428 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1429 EOF
1430 }
1431
1432
1433 machfile="m/${machine}.h"
1434 opsysfile="s/${opsys}.h"
1435
1436
1437 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1438 if test "$with_workshop $with_tooltalk" = "yes no"; then
1439   (echo "$progname: Usage error:"
1440 echo " " "--with-workshop requires --with-tooltalk"
1441 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1442 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1443 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1444 fi
1445
1446 if test "$with_workshop" = "yes"; then
1447   { test "$extra_verbose" = "yes" && cat << \EOF
1448     Defining SUNPRO
1449 EOF
1450 cat >> confdefs.h <<\EOF
1451 #define SUNPRO 1
1452 EOF
1453 }
1454
1455   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1456    echo "    xemacs will be linked with \"sunpro.o\""
1457  fi
1458 fi
1459
1460 if test "$with_clash_detection" = "yes"; then
1461   { test "$extra_verbose" = "yes" && cat << \EOF
1462     Defining CLASH_DETECTION
1463 EOF
1464 cat >> confdefs.h <<\EOF
1465 #define CLASH_DETECTION 1
1466 EOF
1467 }
1468
1469   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1470    echo "    xemacs will be linked with \"filelock.o\""
1471  fi
1472 fi
1473
1474 test -n "$compiler" && CC="$compiler"
1475 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1476 fi
1477
1478 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1479 if test "${CFLAGS-unset}" != unset
1480   then cflags_specified=yes;
1481   else cflags_specified=no;
1482 fi
1483
1484 xe_save_CFLAGS="$CFLAGS"
1485
1486 # Extract the first word of "gcc", so it can be a program name with args.
1487 set dummy gcc; ac_word=$2
1488 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1489 echo "configure:1490: checking for $ac_word" >&5
1490
1491 if test -n "$CC"; then
1492   ac_cv_prog_CC="$CC" # Let the user override the test.
1493 else
1494   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1495   for ac_dir in $PATH; do
1496     test -z "$ac_dir" && ac_dir=.
1497     if test -f $ac_dir/$ac_word; then
1498       ac_cv_prog_CC="gcc"
1499       break
1500     fi
1501   done
1502   IFS="$ac_save_ifs"
1503 fi
1504 CC="$ac_cv_prog_CC"
1505 if test -n "$CC"; then
1506   echo "$ac_t""$CC" 1>&6
1507 else
1508   echo "$ac_t""no" 1>&6
1509 fi
1510
1511 if test -z "$CC"; then
1512   # Extract the first word of "cc", so it can be a program name with args.
1513 set dummy cc; ac_word=$2
1514 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1515 echo "configure:1516: checking for $ac_word" >&5
1516
1517 if test -n "$CC"; then
1518   ac_cv_prog_CC="$CC" # Let the user override the test.
1519 else
1520   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1521   ac_prog_rejected=no
1522   for ac_dir in $PATH; do
1523     test -z "$ac_dir" && ac_dir=.
1524     if test -f $ac_dir/$ac_word; then
1525       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1526         ac_prog_rejected=yes
1527         continue
1528       fi
1529       ac_cv_prog_CC="cc"
1530       break
1531     fi
1532   done
1533   IFS="$ac_save_ifs"
1534 if test $ac_prog_rejected = yes; then
1535   # We found a bogon in the path, so make sure we never use it.
1536   set dummy $ac_cv_prog_CC
1537   shift
1538   if test $# -gt 0; then
1539     # We chose a different compiler from the bogus one.
1540     # However, it has the same basename, so the bogon will be chosen
1541     # first if we set CC to just the basename; use the full file name.
1542     shift
1543     set dummy "$ac_dir/$ac_word" "$@"
1544     shift
1545     ac_cv_prog_CC="$@"
1546   fi
1547 fi
1548 fi
1549 CC="$ac_cv_prog_CC"
1550 if test -n "$CC"; then
1551   echo "$ac_t""$CC" 1>&6
1552 else
1553   echo "$ac_t""no" 1>&6
1554 fi
1555
1556   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1557 fi
1558
1559 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1560 echo "configure:1561: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1561
1562 ac_ext=c
1563 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1564 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1565 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1566 ac_cpp='$CPP '"$xe_cppflags"
1567 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1568 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1569 cross_compiling=no
1570
1571 cat > conftest.$ac_ext <<EOF
1572 #line 1573 "configure"
1573 #include "confdefs.h"
1574 main(){return(0);}
1575 EOF
1576 if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1577   ac_cv_prog_cc_works=yes
1578   # If we can't run a trivial program, we are probably using a cross compiler.
1579   if (./conftest; exit) 2>/dev/null; then
1580     ac_cv_prog_cc_cross=no
1581   else
1582     ac_cv_prog_cc_cross=yes
1583   fi
1584 else
1585   echo "configure: failed program was:" >&5
1586   cat conftest.$ac_ext >&5
1587   ac_cv_prog_cc_works=no
1588 fi
1589 rm -fr conftest*
1590
1591 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1592 if test $ac_cv_prog_cc_works = no; then
1593   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1594 fi
1595 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1596 echo "configure:1597: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1597 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1598 cross_compiling=$ac_cv_prog_cc_cross
1599
1600 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1601 echo "configure:1602: checking whether we are using GNU C" >&5
1602
1603 cat > conftest.c <<EOF
1604 #ifdef __GNUC__
1605   yes;
1606 #endif
1607 EOF
1608 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1609   ac_cv_prog_gcc=yes
1610 else
1611   ac_cv_prog_gcc=no
1612 fi
1613
1614 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1615
1616 if test $ac_cv_prog_gcc = yes; then
1617   GCC=yes
1618   ac_test_CFLAGS="${CFLAGS+set}"
1619   ac_save_CFLAGS="$CFLAGS"
1620   CFLAGS=
1621   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1622 echo "configure:1623: checking whether ${CC-cc} accepts -g" >&5
1623
1624 echo 'void f(){}' > conftest.c
1625 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1626   ac_cv_prog_cc_g=yes
1627 else
1628   ac_cv_prog_cc_g=no
1629 fi
1630 rm -f conftest*
1631
1632
1633 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1634   if test "$ac_test_CFLAGS" = set; then
1635     CFLAGS="$ac_save_CFLAGS"
1636   elif test $ac_cv_prog_cc_g = yes; then
1637     CFLAGS="-g -O2"
1638   else
1639     CFLAGS="-O2"
1640   fi
1641 else
1642   GCC=
1643   test "${CFLAGS+set}" = set || CFLAGS="-g"
1644 fi
1645  
1646 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1647   CC=${NON_GNU_CC-cc}
1648   # Extract the first word of "gcc", so it can be a program name with args.
1649 set dummy gcc; ac_word=$2
1650 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1651 echo "configure:1652: checking for $ac_word" >&5
1652
1653 if test -n "$CC"; then
1654   ac_cv_prog_CC="$CC" # Let the user override the test.
1655 else
1656   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1657   for ac_dir in $PATH; do
1658     test -z "$ac_dir" && ac_dir=.
1659     if test -f $ac_dir/$ac_word; then
1660       ac_cv_prog_CC="gcc"
1661       break
1662     fi
1663   done
1664   IFS="$ac_save_ifs"
1665 fi
1666 CC="$ac_cv_prog_CC"
1667 if test -n "$CC"; then
1668   echo "$ac_t""$CC" 1>&6
1669 else
1670   echo "$ac_t""no" 1>&6
1671 fi
1672
1673 if test -z "$CC"; then
1674   # Extract the first word of "cc", so it can be a program name with args.
1675 set dummy cc; ac_word=$2
1676 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1677 echo "configure:1678: checking for $ac_word" >&5
1678
1679 if test -n "$CC"; then
1680   ac_cv_prog_CC="$CC" # Let the user override the test.
1681 else
1682   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1683   ac_prog_rejected=no
1684   for ac_dir in $PATH; do
1685     test -z "$ac_dir" && ac_dir=.
1686     if test -f $ac_dir/$ac_word; then
1687       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1688         ac_prog_rejected=yes
1689         continue
1690       fi
1691       ac_cv_prog_CC="cc"
1692       break
1693     fi
1694   done
1695   IFS="$ac_save_ifs"
1696 if test $ac_prog_rejected = yes; then
1697   # We found a bogon in the path, so make sure we never use it.
1698   set dummy $ac_cv_prog_CC
1699   shift
1700   if test $# -gt 0; then
1701     # We chose a different compiler from the bogus one.
1702     # However, it has the same basename, so the bogon will be chosen
1703     # first if we set CC to just the basename; use the full file name.
1704     shift
1705     set dummy "$ac_dir/$ac_word" "$@"
1706     shift
1707     ac_cv_prog_CC="$@"
1708   fi
1709 fi
1710 fi
1711 CC="$ac_cv_prog_CC"
1712 if test -n "$CC"; then
1713   echo "$ac_t""$CC" 1>&6
1714 else
1715   echo "$ac_t""no" 1>&6
1716 fi
1717
1718   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1719 fi
1720
1721 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1722 echo "configure:1723: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1723
1724 ac_ext=c
1725 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1726 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1727 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1728 ac_cpp='$CPP '"$xe_cppflags"
1729 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1730 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1731 cross_compiling=no
1732
1733 cat > conftest.$ac_ext <<EOF
1734 #line 1735 "configure"
1735 #include "confdefs.h"
1736 main(){return(0);}
1737 EOF
1738 if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1739   ac_cv_prog_cc_works=yes
1740   # If we can't run a trivial program, we are probably using a cross compiler.
1741   if (./conftest; exit) 2>/dev/null; then
1742     ac_cv_prog_cc_cross=no
1743   else
1744     ac_cv_prog_cc_cross=yes
1745   fi
1746 else
1747   echo "configure: failed program was:" >&5
1748   cat conftest.$ac_ext >&5
1749   ac_cv_prog_cc_works=no
1750 fi
1751 rm -fr conftest*
1752
1753 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1754 if test $ac_cv_prog_cc_works = no; then
1755   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1756 fi
1757 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1758 echo "configure:1759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1759 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1760 cross_compiling=$ac_cv_prog_cc_cross
1761
1762 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1763 echo "configure:1764: checking whether we are using GNU C" >&5
1764
1765 cat > conftest.c <<EOF
1766 #ifdef __GNUC__
1767   yes;
1768 #endif
1769 EOF
1770 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1771   ac_cv_prog_gcc=yes
1772 else
1773   ac_cv_prog_gcc=no
1774 fi
1775
1776 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1777
1778 if test $ac_cv_prog_gcc = yes; then
1779   GCC=yes
1780   ac_test_CFLAGS="${CFLAGS+set}"
1781   ac_save_CFLAGS="$CFLAGS"
1782   CFLAGS=
1783   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1784 echo "configure:1785: checking whether ${CC-cc} accepts -g" >&5
1785
1786 echo 'void f(){}' > conftest.c
1787 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1788   ac_cv_prog_cc_g=yes
1789 else
1790   ac_cv_prog_cc_g=no
1791 fi
1792 rm -f conftest*
1793
1794
1795 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1796   if test "$ac_test_CFLAGS" = set; then
1797     CFLAGS="$ac_save_CFLAGS"
1798   elif test $ac_cv_prog_cc_g = yes; then
1799     CFLAGS="-g -O2"
1800   else
1801     CFLAGS="-O2"
1802   fi
1803 else
1804   GCC=
1805   test "${CFLAGS+set}" = set || CFLAGS="-g"
1806 fi
1807
1808 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1809   CC=gcc
1810   # Extract the first word of "gcc", so it can be a program name with args.
1811 set dummy gcc; ac_word=$2
1812 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1813 echo "configure:1814: checking for $ac_word" >&5
1814
1815 if test -n "$CC"; then
1816   ac_cv_prog_CC="$CC" # Let the user override the test.
1817 else
1818   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1819   for ac_dir in $PATH; do
1820     test -z "$ac_dir" && ac_dir=.
1821     if test -f $ac_dir/$ac_word; then
1822       ac_cv_prog_CC="gcc"
1823       break
1824     fi
1825   done
1826   IFS="$ac_save_ifs"
1827 fi
1828 CC="$ac_cv_prog_CC"
1829 if test -n "$CC"; then
1830   echo "$ac_t""$CC" 1>&6
1831 else
1832   echo "$ac_t""no" 1>&6
1833 fi
1834
1835 if test -z "$CC"; then
1836   # Extract the first word of "cc", so it can be a program name with args.
1837 set dummy cc; ac_word=$2
1838 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1839 echo "configure:1840: checking for $ac_word" >&5
1840
1841 if test -n "$CC"; then
1842   ac_cv_prog_CC="$CC" # Let the user override the test.
1843 else
1844   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1845   ac_prog_rejected=no
1846   for ac_dir in $PATH; do
1847     test -z "$ac_dir" && ac_dir=.
1848     if test -f $ac_dir/$ac_word; then
1849       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1850         ac_prog_rejected=yes
1851         continue
1852       fi
1853       ac_cv_prog_CC="cc"
1854       break
1855     fi
1856   done
1857   IFS="$ac_save_ifs"
1858 if test $ac_prog_rejected = yes; then
1859   # We found a bogon in the path, so make sure we never use it.
1860   set dummy $ac_cv_prog_CC
1861   shift
1862   if test $# -gt 0; then
1863     # We chose a different compiler from the bogus one.
1864     # However, it has the same basename, so the bogon will be chosen
1865     # first if we set CC to just the basename; use the full file name.
1866     shift
1867     set dummy "$ac_dir/$ac_word" "$@"
1868     shift
1869     ac_cv_prog_CC="$@"
1870   fi
1871 fi
1872 fi
1873 CC="$ac_cv_prog_CC"
1874 if test -n "$CC"; then
1875   echo "$ac_t""$CC" 1>&6
1876 else
1877   echo "$ac_t""no" 1>&6
1878 fi
1879
1880   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1881 fi
1882
1883 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1884 echo "configure:1885: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1885
1886 ac_ext=c
1887 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1888 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1889 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1890 ac_cpp='$CPP '"$xe_cppflags"
1891 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1892 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1893 cross_compiling=no
1894
1895 cat > conftest.$ac_ext <<EOF
1896 #line 1897 "configure"
1897 #include "confdefs.h"
1898 main(){return(0);}
1899 EOF
1900 if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1901   ac_cv_prog_cc_works=yes
1902   # If we can't run a trivial program, we are probably using a cross compiler.
1903   if (./conftest; exit) 2>/dev/null; then
1904     ac_cv_prog_cc_cross=no
1905   else
1906     ac_cv_prog_cc_cross=yes
1907   fi
1908 else
1909   echo "configure: failed program was:" >&5
1910   cat conftest.$ac_ext >&5
1911   ac_cv_prog_cc_works=no
1912 fi
1913 rm -fr conftest*
1914
1915 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1916 if test $ac_cv_prog_cc_works = no; then
1917   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1918 fi
1919 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1920 echo "configure:1921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1921 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1922 cross_compiling=$ac_cv_prog_cc_cross
1923
1924 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1925 echo "configure:1926: checking whether we are using GNU C" >&5
1926
1927 cat > conftest.c <<EOF
1928 #ifdef __GNUC__
1929   yes;
1930 #endif
1931 EOF
1932 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1933   ac_cv_prog_gcc=yes
1934 else
1935   ac_cv_prog_gcc=no
1936 fi
1937
1938 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1939
1940 if test $ac_cv_prog_gcc = yes; then
1941   GCC=yes
1942   ac_test_CFLAGS="${CFLAGS+set}"
1943   ac_save_CFLAGS="$CFLAGS"
1944   CFLAGS=
1945   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1946 echo "configure:1947: checking whether ${CC-cc} accepts -g" >&5
1947
1948 echo 'void f(){}' > conftest.c
1949 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1950   ac_cv_prog_cc_g=yes
1951 else
1952   ac_cv_prog_cc_g=no
1953 fi
1954 rm -f conftest*
1955
1956
1957 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1958   if test "$ac_test_CFLAGS" = set; then
1959     CFLAGS="$ac_save_CFLAGS"
1960   elif test $ac_cv_prog_cc_g = yes; then
1961     CFLAGS="-g -O2"
1962   else
1963     CFLAGS="-O2"
1964   fi
1965 else
1966   GCC=
1967   test "${CFLAGS+set}" = set || CFLAGS="-g"
1968 fi
1969
1970 fi
1971 CFLAGS="$xe_save_CFLAGS"
1972
1973
1974 test -n "$CPP" -a -d "$CPP" && CPP=
1975
1976 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1977
1978 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1979 echo "configure:1980: checking how to run the C preprocessor" >&5
1980 # On Suns, sometimes $CPP names a directory.
1981 if test -n "$CPP" && test -d "$CPP"; then
1982   CPP=
1983 fi
1984 if test -z "$CPP"; then
1985
1986   # This must be in double quotes, not single quotes, because CPP may get
1987   # substituted into the Makefile and "${CC-cc}" will confuse make.
1988   CPP="${CC-cc} -E"
1989   # On the NeXT, cc -E runs the code through the compiler's parser,
1990   # not just through cpp.
1991   cat > conftest.$ac_ext <<EOF
1992 #line 1993 "configure"
1993 #include "confdefs.h"
1994 #include <assert.h>
1995 Syntax Error
1996 EOF
1997 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1998 { (eval echo configure:1999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1999 ac_err=`grep -v '^ *+' conftest.out`
2000 if test -z "$ac_err"; then
2001   :
2002 else
2003   echo "$ac_err" >&5
2004   echo "configure: failed program was:" >&5
2005   cat conftest.$ac_ext >&5
2006   rm -rf conftest*
2007   CPP="${CC-cc} -E -traditional-cpp"
2008   cat > conftest.$ac_ext <<EOF
2009 #line 2010 "configure"
2010 #include "confdefs.h"
2011 #include <assert.h>
2012 Syntax Error
2013 EOF
2014 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2015 { (eval echo configure:2016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2016 ac_err=`grep -v '^ *+' conftest.out`
2017 if test -z "$ac_err"; then
2018   :
2019 else
2020   echo "$ac_err" >&5
2021   echo "configure: failed program was:" >&5
2022   cat conftest.$ac_ext >&5
2023   rm -rf conftest*
2024   CPP=/lib/cpp
2025 fi
2026 rm -f conftest*
2027 fi
2028 rm -f conftest*
2029   ac_cv_prog_CPP="$CPP"
2030   CPP="$ac_cv_prog_CPP"
2031 else
2032   ac_cv_prog_CPP="$CPP"
2033 fi
2034 echo "$ac_t""$CPP" 1>&6
2035
2036
2037 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2038 echo "configure:2039: checking for AIX" >&5
2039 cat > conftest.$ac_ext <<EOF
2040 #line 2041 "configure"
2041 #include "confdefs.h"
2042 #ifdef _AIX
2043   yes
2044 #endif
2045
2046 EOF
2047 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2048   egrep "yes" >/dev/null 2>&1; then
2049   rm -rf conftest*
2050   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2051     Defining _ALL_SOURCE
2052 EOF
2053 cat >> confdefs.h <<\EOF
2054 #define _ALL_SOURCE 1
2055 EOF
2056 }
2057
2058 else
2059   rm -rf conftest*
2060   echo "$ac_t""no" 1>&6
2061 fi
2062 rm -f conftest*
2063
2064
2065
2066 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2067 echo "configure:2068: checking for GNU libc" >&5
2068 cat > conftest.$ac_ext <<EOF
2069 #line 2070 "configure"
2070 #include "confdefs.h"
2071 #include <features.h>
2072 int main() {
2073
2074 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2075 #error Not a GNU libc system :-(
2076 ******* ======= ******** &&&&&&&&
2077 #endif
2078
2079 ; return 0; }
2080 EOF
2081 if { (eval echo configure:2082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2082   rm -rf conftest*
2083   have_glibc=yes
2084 else
2085   echo "configure: failed program was:" >&5
2086   cat conftest.$ac_ext >&5
2087   rm -rf conftest*
2088   have_glibc=no
2089 fi
2090 rm -f conftest*
2091 echo "$ac_t""$have_glibc" 1>&6
2092 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2093     Defining _GNU_SOURCE
2094 EOF
2095 cat >> confdefs.h <<\EOF
2096 #define _GNU_SOURCE 1
2097 EOF
2098 }
2099
2100
2101
2102 cat > conftest.$ac_ext <<EOF
2103 #line 2104 "configure"
2104 #include "confdefs.h"
2105 int main () {
2106 #if defined __SUNPRO_C
2107 return 11;
2108 #elif defined __DECC
2109 return 12;
2110 #else
2111 return 0;
2112 #endif
2113 }
2114 EOF
2115 if { (eval echo configure:2116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2116 then
2117   :
2118 else
2119   conftest_rc="$?"
2120   echo "configure: failed program was:" >&5
2121   cat conftest.$ac_ext >&5
2122   rm -fr conftest*
2123   case "$conftest_rc" in
2124   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2125   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2126 esac
2127 fi
2128 rm -fr conftest*
2129
2130
2131
2132
2133 echo "Extracting information from the machine- and system-dependent headers..."
2134
2135 tempcname="conftest.c"
2136
2137
2138
2139 cat > $tempcname <<EOF
2140 #define NOT_C_CODE
2141 #define C_SWITCH_SITE
2142 #define C_SWITCH_X_SITE
2143 #define LD_SWITCH_SITE
2144 #define LD_SWITCH_X_SITE
2145 #define LD_SWITCH_X_SITE_AUX
2146 #define OS_RELEASE $os_release
2147 #include "$srcdir/src/$opsysfile"
2148 #include "$srcdir/src/$machfile"
2149
2150 #ifndef LIBS_MACHINE
2151 #define LIBS_MACHINE
2152 #endif
2153 configure___ libs_machine=LIBS_MACHINE
2154
2155 #ifndef LIBS_SYSTEM
2156 #define LIBS_SYSTEM
2157 #endif
2158 configure___ libs_system=LIBS_SYSTEM
2159
2160 #ifndef LIBS_TERMCAP
2161 #define LIBS_TERMCAP
2162 #endif
2163 configure___ libs_termcap=LIBS_TERMCAP
2164
2165 #ifndef LIB_STANDARD
2166 #define LIB_STANDARD
2167 #endif
2168 configure___ libs_standard=LIB_STANDARD
2169
2170
2171 #ifndef OBJECTS_MACHINE
2172 #define OBJECTS_MACHINE
2173 #endif
2174 configure___ objects_machine=OBJECTS_MACHINE
2175
2176 #ifndef OBJECTS_SYSTEM
2177 #define OBJECTS_SYSTEM
2178 #endif
2179 configure___ objects_system=OBJECTS_SYSTEM
2180
2181
2182 #ifndef C_SWITCH_MACHINE
2183 #define C_SWITCH_MACHINE
2184 #endif
2185 configure___ c_switch_machine=C_SWITCH_MACHINE
2186
2187 #ifndef C_SWITCH_SYSTEM
2188 #define C_SWITCH_SYSTEM
2189 #endif
2190 configure___ c_switch_system=C_SWITCH_SYSTEM
2191
2192
2193 #ifndef LD_SWITCH_MACHINE
2194 #define LD_SWITCH_MACHINE
2195 #endif
2196 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2197
2198 #ifndef LD_SWITCH_SYSTEM
2199 #define LD_SWITCH_SYSTEM
2200 #endif
2201 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2202
2203
2204 #ifndef UNEXEC
2205 #define UNEXEC "unexec.o"
2206 #endif
2207 configure___ unexec=UNEXEC
2208
2209
2210 #ifndef LD_SWITCH_SHARED
2211 #define LD_SWITCH_SHARED "-c"
2212 #endif
2213 configure___ ld_switch_shared=LD_SWITCH_SHARED
2214
2215
2216 #ifdef ORDINARY_LINK
2217 #define LD "\$(CC) \$(CFLAGS)"
2218 #else /* no ORDINARY LINK */
2219 #ifdef COFF_ENCAPSULATE
2220 #define LD "\$(CC) -nostdlib"
2221 #else /* not COFF_ENCAPSULATE */
2222 #ifdef LINKER
2223 #define LD LINKER
2224 #else /* ! defined (LINKER) */
2225 #define LD "ld"
2226 #endif /* ! defined (LINKER) */
2227 #endif /* ! defined (COFF_ENCAPSULATE) */
2228 #endif /* not ORDINARY_LINK */
2229 configure___ ld=LD
2230
2231 #ifndef LIB_GCC
2232 #define LIB_GCC
2233 #endif
2234 configure___ lib_gcc=LIB_GCC
2235
2236 #ifndef LD_TEXT_START_ADDR
2237 #define LD_TEXT_START_ADDR
2238 #endif
2239 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2240
2241
2242 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2243 #ifdef NO_REMAP
2244 #ifdef COFF_ENCAPSULATE
2245 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2246 #else /* ! defined (COFF_ENCAPSULATE) */
2247 #define START_FILES "pre-crt0.o /lib/crt0.o"
2248 #endif /* ! defined (COFF_ENCAPSULATE) */
2249 #else /* ! defined (NO_REMAP) */
2250 #define START_FILES "ecrt0.o"
2251 #endif /* ! defined (NO_REMAP) */
2252 #endif /* no ORDINARY_LINK */
2253 #ifndef START_FILES
2254 #define START_FILES
2255 #endif
2256 configure___ start_files=START_FILES
2257
2258 #ifdef ORDINARY_LINK
2259 configure___ ordinary_link=yes
2260 #else
2261 configure___ ordinary_link=no
2262 #endif
2263
2264 #ifdef SYSTEM_MALLOC
2265 configure___ system_malloc=yes
2266 #else
2267 configure___ system_malloc=no
2268 #endif
2269
2270 #ifdef TERMINFO
2271 configure___ have_terminfo=yes
2272 #else
2273 configure___ have_terminfo=no
2274 #endif
2275
2276 #ifdef MAIL_USE_FLOCK
2277 configure___ mail_use_flock=yes
2278 #else
2279 configure___ mail_use_flock=no
2280 #endif
2281
2282 #ifdef MAIL_USE_LOCKF
2283 configure___ mail_use_lockf=yes
2284 #else
2285 configure___ mail_use_lockf=no
2286 #endif
2287
2288 EOF
2289
2290 CPP=`eval "echo $CPP $CPPFLAGS"`
2291 eval `$CPP -Isrc $tempcname \
2292         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2293
2294 rm $tempcname
2295
2296 test "$extra_verbose" = "yes" && \
2297   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 ""
2298
2299 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2300
2301 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2302
2303 if test "$cflags_specified" = "no"; then
2304       if   test "$GCC" = "yes"; then
2305     CFLAGS="-g -O3 -Wall -Wno-switch"
2306                           elif test "$__SUNPRO_C" = "yes"; then
2307     case "$opsys" in
2308       sol2    ) CFLAGS="-v -xO4" ;;
2309       sunos4* ) CFLAGS="-xO2";;
2310     esac
2311   elif test "$__DECC" = "yes"; then
2312     CFLAGS="-O3"
2313   elif test "$CC" = "xlc"; then
2314     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2315     else
2316     CFLAGS="-O" ;  fi
2317 fi
2318
2319
2320 if test "$GCC" = "yes"; then
2321   set x $ld_switch_system; shift; ld_switch_system=""
2322   while test -n "$1"; do
2323     case $1 in
2324       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2325       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2326       -Xlinker* ) ;;
2327       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2328     esac
2329     shift
2330   done
2331 fi
2332
2333 if test "$GCC" = "yes"; then
2334   set x $ld_switch_machine; shift; ld_switch_machine=""
2335   while test -n "$1"; do
2336     case $1 in
2337       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2338       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2339       -Xlinker* ) ;;
2340       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2341     esac
2342     shift
2343   done
2344 fi
2345
2346 if test "$GCC" = "yes"; then
2347   set x $LDFLAGS; shift; LDFLAGS=""
2348   while test -n "$1"; do
2349     case $1 in
2350       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2351       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2352       -Xlinker* ) ;;
2353       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2354     esac
2355     shift
2356   done
2357 fi
2358
2359 if test "$GCC" = "yes"; then
2360   set x $ld_call_shared; shift; ld_call_shared=""
2361   while test -n "$1"; do
2362     case $1 in
2363       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2364       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2365       -Xlinker* ) ;;
2366       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2367     esac
2368     shift
2369   done
2370 fi
2371
2372 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2373    echo "    xemacs will be linked with \"$objects_machine\""
2374  fi
2375 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2376    echo "    xemacs will be linked with \"$objects_system\""
2377  fi
2378 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2379    echo "    xemacs will be linked with \"$unexec\""
2380  fi
2381
2382 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2383 echo "configure:2384: checking for dynodump" >&5
2384 if test "$unexec" != "unexsol2.o"; then
2385   echo "$ac_t""no" 1>&6
2386 else
2387   echo "$ac_t""yes" 1>&6
2388   { test "$extra_verbose" = "yes" && cat << \EOF
2389     Defining DYNODUMP
2390 EOF
2391 cat >> confdefs.h <<\EOF
2392 #define DYNODUMP 1
2393 EOF
2394 }
2395
2396   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2397   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2398   case "$machine" in
2399     sparc   ) dynodump_arch=sparc ;;
2400     *86*    ) dynodump_arch=i386  ;;
2401     powerpc ) dynodump_arch=ppc   ;;
2402   esac
2403     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
2404 fi
2405
2406
2407 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2408
2409 if test "$unexec" = "unexaix.o"; then
2410   if   test "$dynamic" = "no"; then
2411   start_flags="-Wl,-bnso,-bnodelcsect"
2412   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2413   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2414     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2415   done
2416   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2417     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2418   done
2419   
2420 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2421 echo "configure:2422: checking for terminateAndUnload in -lC" >&5
2422 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2423
2424 xe_check_libs=" -lC "
2425 cat > conftest.$ac_ext <<EOF
2426 #line 2427 "configure"
2427 #include "confdefs.h"
2428 /* Override any gcc2 internal prototype to avoid an error.  */
2429 /* We use char because int might match the return type of a gcc2
2430     builtin and then its argument prototype would still apply.  */
2431 char terminateAndUnload();
2432
2433 int main() {
2434 terminateAndUnload()
2435 ; return 0; }
2436 EOF
2437 if { (eval echo configure:2438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2438   rm -rf conftest*
2439   eval "ac_cv_lib_$ac_lib_var=yes"
2440 else
2441   echo "configure: failed program was:" >&5
2442   cat conftest.$ac_ext >&5
2443   rm -rf conftest*
2444   eval "ac_cv_lib_$ac_lib_var=no"
2445 fi
2446 rm -f conftest*
2447 xe_check_libs=""
2448
2449 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2450   echo "$ac_t""yes" 1>&6
2451   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2452 else
2453   echo "$ac_t""no" 1>&6
2454 fi
2455
2456
2457   fi
2458 elif test -n "$ld_text_start_addr"; then
2459   start_flags="-T $ld_text_start_addr -e __start"
2460 fi
2461
2462
2463
2464
2465 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2466  test -z "$linker" &&  linker='$(CC) -nostdlib'
2467  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2468 fi
2469 test "$GCC" != "yes" && lib_gcc=
2470
2471
2472
2473
2474
2475 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2476 if test -n "$site_libraries"; then
2477   for arg in $site_libraries; do
2478     case "$arg" in
2479      -* ) ;;
2480      * ) test -d "$arg" || \
2481            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2482        arg="-L${arg}" ;;
2483     esac
2484     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2485   done
2486 fi
2487
2488 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2489 if test -n "$site_includes"; then
2490   for arg in $site_includes; do
2491     case "$arg" in
2492       -* ) ;;
2493       * ) test -d "$arg" || \
2494            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2495       arg="-I${arg}" ;;
2496     esac
2497     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2498   done
2499 fi
2500
2501 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2502 if test -n "$site_prefixes"; then
2503   for dir in $site_prefixes; do
2504     inc_dir="${dir}/include"
2505     lib_dir="${dir}/lib"
2506     if test ! -d "$dir"; then
2507       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2508     elif test ! -d "$inc_dir"; then
2509       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$inc_dir'" >&2; exit 1; }
2510     elif test ! -d "$lib_dir"; then
2511       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2512     else
2513       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
2514       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
2515     fi
2516   done
2517 fi
2518
2519
2520 for dir in "/usr/ccs/lib"; do
2521   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
2522 done
2523
2524 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2525 if test -n "$site_runtime_libraries"; then
2526   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2527   export LD_RUN_PATH
2528 fi
2529
2530
2531 if   test "$dynamic" = "no"; then add_runtime_path=no
2532 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2533 else case "$opsys" in
2534        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2535        * ) add_runtime_path=no ;;
2536      esac
2537 fi
2538
2539 if test "$add_runtime_path" = "yes"; then
2540       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2541 echo "configure:2542: checking "for runtime libraries flag"" >&5
2542   case "$opsys" in
2543     sol2 ) dash_r="-R" ;;
2544     decosf* | linux* ) dash_r="-rpath " ;;
2545     *)
2546       dash_r=""
2547       for try_dash_r in "-R" "-R " "-rpath "; do
2548         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2549         
2550 if test "$GCC" = "yes"; then
2551   set x $xe_check_libs; shift; xe_check_libs=""
2552   while test -n "$1"; do
2553     case $1 in
2554       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2555       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2556       -Xlinker* ) ;;
2557       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2558     esac
2559     shift
2560   done
2561 fi
2562         cat > conftest.$ac_ext <<EOF
2563 #line 2564 "configure"
2564 #include "confdefs.h"
2565
2566 int main() {
2567
2568 ; return 0; }
2569 EOF
2570 if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2571   rm -rf conftest*
2572   dash_r="$try_dash_r"
2573 else
2574   echo "configure: failed program was:" >&5
2575   cat conftest.$ac_ext >&5
2576 fi
2577 rm -f conftest*
2578         xe_check_libs=""
2579         test -n "$dash_r" && break
2580       done ;;
2581   esac
2582   if test -n "$dash_r";
2583     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2584     else echo "$ac_t""NONE" 1>&6
2585   fi
2586 fi
2587
2588 xe_add_unique_runpath_dir='
2589   xe_add_p=yes
2590   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2591   done
2592   if test "$xe_add_p" = "yes"; then
2593     test -n "$runpath" && runpath="${runpath}:"
2594     runpath="${runpath}${xe_runpath_dir}"
2595     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2596   fi'
2597
2598
2599
2600
2601 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2602     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2603   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2604   
2605         runpath="" runpath_dirs=""
2606   if test -n "$LD_RUN_PATH"; then
2607     runpath="$LD_RUN_PATH"
2608   elif test "$GCC" = "yes"; then
2609         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2610     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2611     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2612     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2613       case "$arg" in P,* | -L* | -R* )
2614         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2615           {
2616 xe_runpath_dir="$dir"
2617   test "$xe_runpath_dir" != "/lib"     -a \
2618         "$xe_runpath_dir" != "/usr/lib" -a \
2619         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2620   eval "$xe_add_unique_runpath_dir"
2621 }
2622         done ;;
2623       esac
2624     done
2625     ld_switch_run="$ld_switch_run_save"
2626     rm -f conftest*
2627   else
2628         for arg in $ld_switch_site $ld_switch_x_site; do
2629       case "$arg" in -L*) {
2630 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2631   test "$xe_runpath_dir" != "/lib"     -a \
2632         "$xe_runpath_dir" != "/usr/lib" -a \
2633         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2634   eval "$xe_add_unique_runpath_dir"
2635 };; esac
2636     done
2637         if test "$opsys $need_motif" = "sol2 yes"; then
2638       xe_runpath_dir="/opt/SUNWdt/lib";
2639       eval "$xe_add_unique_runpath_dir";
2640     fi
2641   fi 
2642   if test -n "$runpath"; then
2643     ld_switch_run="${dash_r}${runpath}"
2644     
2645 if test "$GCC" = "yes"; then
2646   set x $ld_switch_run; shift; ld_switch_run=""
2647   while test -n "$1"; do
2648     case $1 in
2649       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2650       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2651       -Xlinker* ) ;;
2652       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2653     esac
2654     shift
2655   done
2656 fi
2657     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2658   fi
2659 fi
2660
2661
2662
2663
2664 GNU_MALLOC=yes
2665 if test "$with_dlmalloc" != "no"; then
2666         doug_lea_malloc=yes
2667 else
2668         doug_lea_malloc=no
2669 fi
2670 after_morecore_hook_exists=yes
2671 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2672 echo "configure:2673: checking for malloc_get_state" >&5
2673
2674 cat > conftest.$ac_ext <<EOF
2675 #line 2676 "configure"
2676 #include "confdefs.h"
2677 /* System header to define __stub macros and hopefully few prototypes,
2678     which can conflict with char malloc_get_state(); below.  */
2679 #include <assert.h>
2680 /* Override any gcc2 internal prototype to avoid an error.  */
2681 /* We use char because int might match the return type of a gcc2
2682     builtin and then its argument prototype would still apply.  */
2683 char malloc_get_state();
2684
2685 int main() {
2686
2687 /* The GNU C library defines this for functions which it implements
2688     to always fail with ENOSYS.  Some functions are actually named
2689     something starting with __ and the normal name is an alias.  */
2690 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2691 choke me
2692 #else
2693 malloc_get_state();
2694 #endif
2695
2696 ; return 0; }
2697 EOF
2698 if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2699   rm -rf conftest*
2700   eval "ac_cv_func_malloc_get_state=yes"
2701 else
2702   echo "configure: failed program was:" >&5
2703   cat conftest.$ac_ext >&5
2704   rm -rf conftest*
2705   eval "ac_cv_func_malloc_get_state=no"
2706 fi
2707 rm -f conftest*
2708
2709 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2710   echo "$ac_t""yes" 1>&6
2711   :
2712 else
2713   echo "$ac_t""no" 1>&6
2714 doug_lea_malloc=no
2715 fi
2716
2717 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2718 echo "configure:2719: checking for malloc_set_state" >&5
2719
2720 cat > conftest.$ac_ext <<EOF
2721 #line 2722 "configure"
2722 #include "confdefs.h"
2723 /* System header to define __stub macros and hopefully few prototypes,
2724     which can conflict with char malloc_set_state(); below.  */
2725 #include <assert.h>
2726 /* Override any gcc2 internal prototype to avoid an error.  */
2727 /* We use char because int might match the return type of a gcc2
2728     builtin and then its argument prototype would still apply.  */
2729 char malloc_set_state();
2730
2731 int main() {
2732
2733 /* The GNU C library defines this for functions which it implements
2734     to always fail with ENOSYS.  Some functions are actually named
2735     something starting with __ and the normal name is an alias.  */
2736 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2737 choke me
2738 #else
2739 malloc_set_state();
2740 #endif
2741
2742 ; return 0; }
2743 EOF
2744 if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2745   rm -rf conftest*
2746   eval "ac_cv_func_malloc_set_state=yes"
2747 else
2748   echo "configure: failed program was:" >&5
2749   cat conftest.$ac_ext >&5
2750   rm -rf conftest*
2751   eval "ac_cv_func_malloc_set_state=no"
2752 fi
2753 rm -f conftest*
2754
2755 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2756   echo "$ac_t""yes" 1>&6
2757   :
2758 else
2759   echo "$ac_t""no" 1>&6
2760 doug_lea_malloc=no
2761 fi
2762
2763 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2764 echo "configure:2765: checking whether __after_morecore_hook exists" >&5
2765 cat > conftest.$ac_ext <<EOF
2766 #line 2767 "configure"
2767 #include "confdefs.h"
2768 extern void (* __after_morecore_hook)();
2769 int main() {
2770 __after_morecore_hook = 0
2771 ; return 0; }
2772 EOF
2773 if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2774   rm -rf conftest*
2775   echo "$ac_t""yes" 1>&6
2776 else
2777   echo "configure: failed program was:" >&5
2778   cat conftest.$ac_ext >&5
2779   rm -rf conftest*
2780   echo "$ac_t""no" 1>&6
2781    after_morecore_hook_exists=no
2782 fi
2783 rm -f conftest*
2784 if test "$system_malloc" = "yes" ; then
2785   GNU_MALLOC=no
2786   GNU_MALLOC_reason="
2787   (The GNU allocators don't work with this system configuration)."
2788 elif test "$with_system_malloc" = "yes" ; then
2789   GNU_MALLOC=no
2790   GNU_MALLOC_reason="
2791   (User chose not to use GNU allocators)."
2792 elif test "$with_debug_malloc" = "yes" ; then
2793   GNU_MALLOC=no
2794   GNU_MALLOC_reason="
2795   (User chose to use Debugging Malloc)."
2796 fi
2797
2798 if test "$doug_lea_malloc" = "yes" ; then
2799   if test "$GNU_MALLOC" = yes ; then
2800     GNU_MALLOC_reason="
2801   (Using Doug Lea's new malloc from the GNU C Library.)"
2802   fi
2803   { test "$extra_verbose" = "yes" && cat << \EOF
2804     Defining DOUG_LEA_MALLOC
2805 EOF
2806 cat >> confdefs.h <<\EOF
2807 #define DOUG_LEA_MALLOC 1
2808 EOF
2809 }
2810
2811   if test "$after_morecore_hook_exists" = "no" ; then
2812     GNU_MALLOC_reason="
2813   (Using Doug Lea's new malloc from the Linux C Library.)"
2814     { test "$extra_verbose" = "yes" && cat << \EOF
2815     Defining _NO_MALLOC_WARNING_
2816 EOF
2817 cat >> confdefs.h <<\EOF
2818 #define _NO_MALLOC_WARNING_ 1
2819 EOF
2820 }
2821
2822   fi
2823   use_minimal_tagbits=yes
2824 fi
2825
2826
2827
2828
2829 # Extract the first word of "ranlib", so it can be a program name with args.
2830 set dummy ranlib; ac_word=$2
2831 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2832 echo "configure:2833: checking for $ac_word" >&5
2833
2834 if test -n "$RANLIB"; then
2835   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2836 else
2837   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2838   for ac_dir in $PATH; do
2839     test -z "$ac_dir" && ac_dir=.
2840     if test -f $ac_dir/$ac_word; then
2841       ac_cv_prog_RANLIB="ranlib"
2842       break
2843     fi
2844   done
2845   IFS="$ac_save_ifs"
2846   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2847 fi
2848 RANLIB="$ac_cv_prog_RANLIB"
2849 if test -n "$RANLIB"; then
2850   echo "$ac_t""$RANLIB" 1>&6
2851 else
2852   echo "$ac_t""no" 1>&6
2853 fi
2854
2855 ac_aux_dir=
2856 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2857   if test -f $ac_dir/install-sh; then
2858     ac_aux_dir=$ac_dir
2859     ac_install_sh="$ac_aux_dir/install-sh -c"
2860     break
2861   elif test -f $ac_dir/install.sh; then
2862     ac_aux_dir=$ac_dir
2863     ac_install_sh="$ac_aux_dir/install.sh -c"
2864     break
2865   fi
2866 done
2867 if test -z "$ac_aux_dir"; then
2868   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2869 fi
2870 ac_config_guess=$ac_aux_dir/config.guess
2871 ac_config_sub=$ac_aux_dir/config.sub
2872 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2873
2874 # Find a good install program.  We prefer a C program (faster),
2875 # so one script is as good as another.  But avoid the broken or
2876 # incompatible versions:
2877 # SysV /etc/install, /usr/sbin/install
2878 # SunOS /usr/etc/install
2879 # IRIX /sbin/install
2880 # AIX /bin/install
2881 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2882 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2883 # ./install, which can be erroneously created by make from ./install.sh.
2884 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2885 echo "configure:2886: checking for a BSD compatible install" >&5
2886 if test -z "$INSTALL"; then
2887
2888   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2889   for ac_dir in $PATH; do
2890     # Account for people who put trailing slashes in PATH elements.
2891     case "$ac_dir/" in
2892     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2893     *)
2894       # OSF1 and SCO ODT 3.0 have their own names for install.
2895       for ac_prog in ginstall installbsd scoinst install; do
2896         if test -f $ac_dir/$ac_prog; then
2897           if test $ac_prog = install &&
2898             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2899             # AIX install.  It has an incompatible calling convention.
2900             # OSF/1 installbsd also uses dspmsg, but is usable.
2901             :
2902           else
2903             ac_cv_path_install="$ac_dir/$ac_prog -c"
2904             break 2
2905           fi
2906         fi
2907       done
2908       ;;
2909     esac
2910   done
2911   IFS="$ac_save_IFS"
2912
2913   if test "${ac_cv_path_install+set}" = set; then
2914     INSTALL="$ac_cv_path_install"
2915   else
2916     # As a last resort, use the slow shell script.  We don't cache a
2917     # path for INSTALL within a source directory, because that will
2918     # break other packages using the cache if that directory is
2919     # removed, or if the path is relative.
2920     INSTALL="$ac_install_sh"
2921   fi
2922 fi
2923 echo "$ac_t""$INSTALL" 1>&6
2924
2925 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2926 # It thinks the first close brace ends the variable substitution.
2927 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2928
2929 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2930
2931 for ac_prog in 'bison -y' byacc
2932 do
2933 # Extract the first word of "$ac_prog", so it can be a program name with args.
2934 set dummy $ac_prog; ac_word=$2
2935 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2936 echo "configure:2937: checking for $ac_word" >&5
2937
2938 if test -n "$YACC"; then
2939   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2940 else
2941   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2942   for ac_dir in $PATH; do
2943     test -z "$ac_dir" && ac_dir=.
2944     if test -f $ac_dir/$ac_word; then
2945       ac_cv_prog_YACC="$ac_prog"
2946       break
2947     fi
2948   done
2949   IFS="$ac_save_ifs"
2950 fi
2951 YACC="$ac_cv_prog_YACC"
2952 if test -n "$YACC"; then
2953   echo "$ac_t""$YACC" 1>&6
2954 else
2955   echo "$ac_t""no" 1>&6
2956 fi
2957
2958 test -n "$YACC" && break
2959 done
2960 test -n "$YACC" || YACC="yacc"
2961
2962
2963 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
2964 do
2965 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2966 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2967 echo "configure:2968: checking for $ac_hdr" >&5
2968
2969 cat > conftest.$ac_ext <<EOF
2970 #line 2971 "configure"
2971 #include "confdefs.h"
2972 #include <$ac_hdr>
2973 EOF
2974 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2975 { (eval echo configure:2976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2976 ac_err=`grep -v '^ *+' conftest.out`
2977 if test -z "$ac_err"; then
2978   rm -rf conftest*
2979   eval "ac_cv_header_$ac_safe=yes"
2980 else
2981   echo "$ac_err" >&5
2982   echo "configure: failed program was:" >&5
2983   cat conftest.$ac_ext >&5
2984   rm -rf conftest*
2985   eval "ac_cv_header_$ac_safe=no"
2986 fi
2987 rm -f conftest*
2988 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2989   echo "$ac_t""yes" 1>&6
2990     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2991   { test "$extra_verbose" = "yes" && cat << EOF
2992     Defining $ac_tr_hdr
2993 EOF
2994 cat >> confdefs.h <<EOF
2995 #define $ac_tr_hdr 1
2996 EOF
2997 }
2998  
2999 else
3000   echo "$ac_t""no" 1>&6
3001 fi
3002 done
3003
3004 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3005 do
3006 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3007 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3008 echo "configure:3009: checking for $ac_hdr" >&5
3009
3010 cat > conftest.$ac_ext <<EOF
3011 #line 3012 "configure"
3012 #include "confdefs.h"
3013 #include <$ac_hdr>
3014 EOF
3015 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3016 { (eval echo configure:3017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3017 ac_err=`grep -v '^ *+' conftest.out`
3018 if test -z "$ac_err"; then
3019   rm -rf conftest*
3020   eval "ac_cv_header_$ac_safe=yes"
3021 else
3022   echo "$ac_err" >&5
3023   echo "configure: failed program was:" >&5
3024   cat conftest.$ac_ext >&5
3025   rm -rf conftest*
3026   eval "ac_cv_header_$ac_safe=no"
3027 fi
3028 rm -f conftest*
3029 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3030   echo "$ac_t""yes" 1>&6
3031     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3032   { test "$extra_verbose" = "yes" && cat << EOF
3033     Defining $ac_tr_hdr
3034 EOF
3035 cat >> confdefs.h <<EOF
3036 #define $ac_tr_hdr 1
3037 EOF
3038 }
3039  
3040 else
3041   echo "$ac_t""no" 1>&6
3042 fi
3043 done
3044
3045 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3046 do
3047 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3048 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3049 echo "configure:3050: checking for $ac_hdr" >&5
3050
3051 cat > conftest.$ac_ext <<EOF
3052 #line 3053 "configure"
3053 #include "confdefs.h"
3054 #include <$ac_hdr>
3055 EOF
3056 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3057 { (eval echo configure:3058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3058 ac_err=`grep -v '^ *+' conftest.out`
3059 if test -z "$ac_err"; then
3060   rm -rf conftest*
3061   eval "ac_cv_header_$ac_safe=yes"
3062 else
3063   echo "$ac_err" >&5
3064   echo "configure: failed program was:" >&5
3065   cat conftest.$ac_ext >&5
3066   rm -rf conftest*
3067   eval "ac_cv_header_$ac_safe=no"
3068 fi
3069 rm -f conftest*
3070 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3071   echo "$ac_t""yes" 1>&6
3072     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3073   { test "$extra_verbose" = "yes" && cat << EOF
3074     Defining $ac_tr_hdr
3075 EOF
3076 cat >> confdefs.h <<EOF
3077 #define $ac_tr_hdr 1
3078 EOF
3079 }
3080  
3081 else
3082   echo "$ac_t""no" 1>&6
3083 fi
3084 done
3085
3086 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3087 echo "configure:3088: checking for sys/wait.h that is POSIX.1 compatible" >&5
3088
3089 cat > conftest.$ac_ext <<EOF
3090 #line 3091 "configure"
3091 #include "confdefs.h"
3092 #include <sys/types.h>
3093 #include <sys/wait.h>
3094 #ifndef WEXITSTATUS
3095 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3096 #endif
3097 #ifndef WIFEXITED
3098 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3099 #endif
3100 int main() {
3101 int s;
3102 wait (&s);
3103 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3104 ; return 0; }
3105 EOF
3106 if { (eval echo configure:3107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3107   rm -rf conftest*
3108   ac_cv_header_sys_wait_h=yes
3109 else
3110   echo "configure: failed program was:" >&5
3111   cat conftest.$ac_ext >&5
3112   rm -rf conftest*
3113   ac_cv_header_sys_wait_h=no
3114 fi
3115 rm -f conftest*
3116
3117 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3118 if test $ac_cv_header_sys_wait_h = yes; then
3119   { test "$extra_verbose" = "yes" && cat << \EOF
3120     Defining HAVE_SYS_WAIT_H
3121 EOF
3122 cat >> confdefs.h <<\EOF
3123 #define HAVE_SYS_WAIT_H 1
3124 EOF
3125 }
3126
3127 fi
3128
3129 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3130 echo "configure:3131: checking for ANSI C header files" >&5
3131
3132 cat > conftest.$ac_ext <<EOF
3133 #line 3134 "configure"
3134 #include "confdefs.h"
3135 #include <stdlib.h>
3136 #include <stdarg.h>
3137 #include <string.h>
3138 #include <float.h>
3139 EOF
3140 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3141 { (eval echo configure:3142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3142 ac_err=`grep -v '^ *+' conftest.out`
3143 if test -z "$ac_err"; then
3144   rm -rf conftest*
3145   ac_cv_header_stdc=yes
3146 else
3147   echo "$ac_err" >&5
3148   echo "configure: failed program was:" >&5
3149   cat conftest.$ac_ext >&5
3150   rm -rf conftest*
3151   ac_cv_header_stdc=no
3152 fi
3153 rm -f conftest*
3154
3155 if test $ac_cv_header_stdc = yes; then
3156   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3157 cat > conftest.$ac_ext <<EOF
3158 #line 3159 "configure"
3159 #include "confdefs.h"
3160 #include <string.h>
3161 EOF
3162 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3163   egrep "memchr" >/dev/null 2>&1; then
3164   :
3165 else
3166   rm -rf conftest*
3167   ac_cv_header_stdc=no
3168 fi
3169 rm -f conftest*
3170
3171 fi
3172
3173 if test $ac_cv_header_stdc = yes; then
3174   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3175 cat > conftest.$ac_ext <<EOF
3176 #line 3177 "configure"
3177 #include "confdefs.h"
3178 #include <stdlib.h>
3179 EOF
3180 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3181   egrep "free" >/dev/null 2>&1; then
3182   :
3183 else
3184   rm -rf conftest*
3185   ac_cv_header_stdc=no
3186 fi
3187 rm -f conftest*
3188
3189 fi
3190
3191 if test $ac_cv_header_stdc = yes; then
3192   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3193 cat > conftest.$ac_ext <<EOF
3194 #line 3195 "configure"
3195 #include "confdefs.h"
3196 #include <ctype.h>
3197 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3198 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3199 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3200 int main () { int i; for (i = 0; i < 256; i++)
3201 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3202 exit (0); }
3203
3204 EOF
3205 if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3206 then
3207   :
3208 else
3209   conftest_rc="$?"
3210   echo "configure: failed program was:" >&5
3211   cat conftest.$ac_ext >&5
3212   rm -fr conftest*
3213   ac_cv_header_stdc=no
3214 fi
3215 rm -fr conftest*
3216 fi
3217
3218 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3219 if test $ac_cv_header_stdc = yes; then
3220   { test "$extra_verbose" = "yes" && cat << \EOF
3221     Defining STDC_HEADERS
3222 EOF
3223 cat >> confdefs.h <<\EOF
3224 #define STDC_HEADERS 1
3225 EOF
3226 }
3227
3228 fi
3229
3230 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3231 echo "configure:3232: checking whether time.h and sys/time.h may both be included" >&5
3232
3233 cat > conftest.$ac_ext <<EOF
3234 #line 3235 "configure"
3235 #include "confdefs.h"
3236 #include <sys/types.h>
3237 #include <sys/time.h>
3238 #include <time.h>
3239 int main() {
3240 struct tm *tp;
3241 ; return 0; }
3242 EOF
3243 if { (eval echo configure:3244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3244   rm -rf conftest*
3245   ac_cv_header_time=yes
3246 else
3247   echo "configure: failed program was:" >&5
3248   cat conftest.$ac_ext >&5
3249   rm -rf conftest*
3250   ac_cv_header_time=no
3251 fi
3252 rm -f conftest*
3253
3254 echo "$ac_t""$ac_cv_header_time" 1>&6
3255 if test $ac_cv_header_time = yes; then
3256   { test "$extra_verbose" = "yes" && cat << \EOF
3257     Defining TIME_WITH_SYS_TIME
3258 EOF
3259 cat >> confdefs.h <<\EOF
3260 #define TIME_WITH_SYS_TIME 1
3261 EOF
3262 }
3263
3264 fi
3265
3266 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3267 echo "configure:3268: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3268
3269 cat > conftest.$ac_ext <<EOF
3270 #line 3271 "configure"
3271 #include "confdefs.h"
3272 #include <sys/types.h>
3273 #include <signal.h>
3274 /* NetBSD declares sys_siglist in unistd.h.  */
3275 #ifdef HAVE_UNISTD_H
3276 #include <unistd.h>
3277 #endif
3278 int main() {
3279 char *msg = *(sys_siglist + 1);
3280 ; return 0; }
3281 EOF
3282 if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3283   rm -rf conftest*
3284   ac_cv_decl_sys_siglist=yes
3285 else
3286   echo "configure: failed program was:" >&5
3287   cat conftest.$ac_ext >&5
3288   rm -rf conftest*
3289   ac_cv_decl_sys_siglist=no
3290 fi
3291 rm -f conftest*
3292
3293 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3294 if test $ac_cv_decl_sys_siglist = yes; then
3295   { test "$extra_verbose" = "yes" && cat << \EOF
3296     Defining SYS_SIGLIST_DECLARED
3297 EOF
3298 cat >> confdefs.h <<\EOF
3299 #define SYS_SIGLIST_DECLARED 1
3300 EOF
3301 }
3302
3303 fi
3304
3305
3306 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3307 echo "configure:3308: checking for struct utimbuf" >&5
3308 cat > conftest.$ac_ext <<EOF
3309 #line 3310 "configure"
3310 #include "confdefs.h"
3311 #ifdef TIME_WITH_SYS_TIME
3312 #include <sys/time.h>
3313 #include <time.h>
3314 #else
3315 #ifdef HAVE_SYS_TIME_H
3316 #include <sys/time.h>
3317 #else
3318 #include <time.h>
3319 #endif
3320 #endif
3321 #ifdef HAVE_UTIME_H
3322 #include <utime.h>
3323 #endif
3324 int main() {
3325 static struct utimbuf x; x.actime = x.modtime;
3326 ; return 0; }
3327 EOF
3328 if { (eval echo configure:3329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3329   rm -rf conftest*
3330   echo "$ac_t""yes" 1>&6
3331    { test "$extra_verbose" = "yes" && cat << \EOF
3332     Defining HAVE_STRUCT_UTIMBUF
3333 EOF
3334 cat >> confdefs.h <<\EOF
3335 #define HAVE_STRUCT_UTIMBUF 1
3336 EOF
3337 }
3338
3339 else
3340   echo "configure: failed program was:" >&5
3341   cat conftest.$ac_ext >&5
3342   rm -rf conftest*
3343   echo "$ac_t""no" 1>&6
3344 fi
3345 rm -f conftest*
3346
3347 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3348 echo "configure:3349: checking return type of signal handlers" >&5
3349
3350 cat > conftest.$ac_ext <<EOF
3351 #line 3352 "configure"
3352 #include "confdefs.h"
3353 #include <sys/types.h>
3354 #include <signal.h>
3355 #ifdef signal
3356 #undef signal
3357 #endif
3358 #ifdef __cplusplus
3359 extern "C" void (*signal (int, void (*)(int)))(int);
3360 #else
3361 void (*signal ()) ();
3362 #endif
3363
3364 int main() {
3365 int i;
3366 ; return 0; }
3367 EOF
3368 if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3369   rm -rf conftest*
3370   ac_cv_type_signal=void
3371 else
3372   echo "configure: failed program was:" >&5
3373   cat conftest.$ac_ext >&5
3374   rm -rf conftest*
3375   ac_cv_type_signal=int
3376 fi
3377 rm -f conftest*
3378
3379 echo "$ac_t""$ac_cv_type_signal" 1>&6
3380 { test "$extra_verbose" = "yes" && cat << EOF
3381     Defining RETSIGTYPE = $ac_cv_type_signal
3382 EOF
3383 cat >> confdefs.h <<EOF
3384 #define RETSIGTYPE $ac_cv_type_signal
3385 EOF
3386 }
3387
3388
3389 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3390 echo "configure:3391: checking for size_t" >&5
3391
3392 cat > conftest.$ac_ext <<EOF
3393 #line 3394 "configure"
3394 #include "confdefs.h"
3395 #include <sys/types.h>
3396 #if STDC_HEADERS
3397 #include <stdlib.h>
3398 #include <stddef.h>
3399 #endif
3400 EOF
3401 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3402   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3403   rm -rf conftest*
3404   ac_cv_type_size_t=yes
3405 else
3406   rm -rf conftest*
3407   ac_cv_type_size_t=no
3408 fi
3409 rm -f conftest*
3410
3411 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3412 if test $ac_cv_type_size_t = no; then
3413   { test "$extra_verbose" = "yes" && cat << \EOF
3414     Defining size_t = unsigned
3415 EOF
3416 cat >> confdefs.h <<\EOF
3417 #define size_t unsigned
3418 EOF
3419 }
3420
3421 fi
3422
3423 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3424 echo "configure:3425: checking for pid_t" >&5
3425
3426 cat > conftest.$ac_ext <<EOF
3427 #line 3428 "configure"
3428 #include "confdefs.h"
3429 #include <sys/types.h>
3430 #if STDC_HEADERS
3431 #include <stdlib.h>
3432 #include <stddef.h>
3433 #endif
3434 EOF
3435 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3436   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3437   rm -rf conftest*
3438   ac_cv_type_pid_t=yes
3439 else
3440   rm -rf conftest*
3441   ac_cv_type_pid_t=no
3442 fi
3443 rm -f conftest*
3444
3445 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3446 if test $ac_cv_type_pid_t = no; then
3447   { test "$extra_verbose" = "yes" && cat << \EOF
3448     Defining pid_t = int
3449 EOF
3450 cat >> confdefs.h <<\EOF
3451 #define pid_t int
3452 EOF
3453 }
3454
3455 fi
3456
3457 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3458 echo "configure:3459: checking for uid_t in sys/types.h" >&5
3459
3460 cat > conftest.$ac_ext <<EOF
3461 #line 3462 "configure"
3462 #include "confdefs.h"
3463 #include <sys/types.h>
3464 EOF
3465 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3466   egrep "uid_t" >/dev/null 2>&1; then
3467   rm -rf conftest*
3468   ac_cv_type_uid_t=yes
3469 else
3470   rm -rf conftest*
3471   ac_cv_type_uid_t=no
3472 fi
3473 rm -f conftest*
3474
3475
3476 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3477 if test $ac_cv_type_uid_t = no; then
3478   { test "$extra_verbose" = "yes" && cat << \EOF
3479     Defining uid_t = int
3480 EOF
3481 cat >> confdefs.h <<\EOF
3482 #define uid_t int
3483 EOF
3484 }
3485
3486   { test "$extra_verbose" = "yes" && cat << \EOF
3487     Defining gid_t = int
3488 EOF
3489 cat >> confdefs.h <<\EOF
3490 #define gid_t int
3491 EOF
3492 }
3493
3494 fi
3495
3496 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3497 echo "configure:3498: checking for mode_t" >&5
3498
3499 cat > conftest.$ac_ext <<EOF
3500 #line 3501 "configure"
3501 #include "confdefs.h"
3502 #include <sys/types.h>
3503 #if STDC_HEADERS
3504 #include <stdlib.h>
3505 #include <stddef.h>
3506 #endif
3507 EOF
3508 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3509   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3510   rm -rf conftest*
3511   ac_cv_type_mode_t=yes
3512 else
3513   rm -rf conftest*
3514   ac_cv_type_mode_t=no
3515 fi
3516 rm -f conftest*
3517
3518 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3519 if test $ac_cv_type_mode_t = no; then
3520   { test "$extra_verbose" = "yes" && cat << \EOF
3521     Defining mode_t = int
3522 EOF
3523 cat >> confdefs.h <<\EOF
3524 #define mode_t int
3525 EOF
3526 }
3527
3528 fi
3529
3530 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3531 echo "configure:3532: checking for off_t" >&5
3532
3533 cat > conftest.$ac_ext <<EOF
3534 #line 3535 "configure"
3535 #include "confdefs.h"
3536 #include <sys/types.h>
3537 #if STDC_HEADERS
3538 #include <stdlib.h>
3539 #include <stddef.h>
3540 #endif
3541 EOF
3542 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3543   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3544   rm -rf conftest*
3545   ac_cv_type_off_t=yes
3546 else
3547   rm -rf conftest*
3548   ac_cv_type_off_t=no
3549 fi
3550 rm -f conftest*
3551
3552 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3553 if test $ac_cv_type_off_t = no; then
3554   { test "$extra_verbose" = "yes" && cat << \EOF
3555     Defining off_t = long
3556 EOF
3557 cat >> confdefs.h <<\EOF
3558 #define off_t long
3559 EOF
3560 }
3561
3562 fi
3563
3564
3565 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3566 echo "configure:3567: checking for struct timeval" >&5
3567 cat > conftest.$ac_ext <<EOF
3568 #line 3569 "configure"
3569 #include "confdefs.h"
3570 #ifdef TIME_WITH_SYS_TIME
3571 #include <sys/time.h>
3572 #include <time.h>
3573 #else
3574 #ifdef HAVE_SYS_TIME_H
3575 #include <sys/time.h>
3576 #else
3577 #include <time.h>
3578 #endif
3579 #endif
3580 int main() {
3581 static struct timeval x; x.tv_sec = x.tv_usec;
3582 ; return 0; }
3583 EOF
3584 if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3585   rm -rf conftest*
3586   echo "$ac_t""yes" 1>&6
3587   HAVE_TIMEVAL=yes
3588   { test "$extra_verbose" = "yes" && cat << \EOF
3589     Defining HAVE_TIMEVAL
3590 EOF
3591 cat >> confdefs.h <<\EOF
3592 #define HAVE_TIMEVAL 1
3593 EOF
3594 }
3595
3596 else
3597   echo "configure: failed program was:" >&5
3598   cat conftest.$ac_ext >&5
3599   rm -rf conftest*
3600   echo "$ac_t""no" 1>&6
3601    HAVE_TIMEVAL=no
3602 fi
3603 rm -f conftest*
3604
3605 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3606 echo "configure:3607: checking whether struct tm is in sys/time.h or time.h" >&5
3607
3608 cat > conftest.$ac_ext <<EOF
3609 #line 3610 "configure"
3610 #include "confdefs.h"
3611 #include <sys/types.h>
3612 #include <time.h>
3613 int main() {
3614 struct tm *tp; tp->tm_sec;
3615 ; return 0; }
3616 EOF
3617 if { (eval echo configure:3618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3618   rm -rf conftest*
3619   ac_cv_struct_tm=time.h
3620 else
3621   echo "configure: failed program was:" >&5
3622   cat conftest.$ac_ext >&5
3623   rm -rf conftest*
3624   ac_cv_struct_tm=sys/time.h
3625 fi
3626 rm -f conftest*
3627
3628 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3629 if test $ac_cv_struct_tm = sys/time.h; then
3630   { test "$extra_verbose" = "yes" && cat << \EOF
3631     Defining TM_IN_SYS_TIME
3632 EOF
3633 cat >> confdefs.h <<\EOF
3634 #define TM_IN_SYS_TIME 1
3635 EOF
3636 }
3637
3638 fi
3639
3640 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3641 echo "configure:3642: checking for tm_zone in struct tm" >&5
3642
3643 cat > conftest.$ac_ext <<EOF
3644 #line 3645 "configure"
3645 #include "confdefs.h"
3646 #include <sys/types.h>
3647 #include <$ac_cv_struct_tm>
3648 int main() {
3649 struct tm tm; tm.tm_zone;
3650 ; return 0; }
3651 EOF
3652 if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3653   rm -rf conftest*
3654   ac_cv_struct_tm_zone=yes
3655 else
3656   echo "configure: failed program was:" >&5
3657   cat conftest.$ac_ext >&5
3658   rm -rf conftest*
3659   ac_cv_struct_tm_zone=no
3660 fi
3661 rm -f conftest*
3662
3663 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3664 if test "$ac_cv_struct_tm_zone" = yes; then
3665   { test "$extra_verbose" = "yes" && cat << \EOF
3666     Defining HAVE_TM_ZONE
3667 EOF
3668 cat >> confdefs.h <<\EOF
3669 #define HAVE_TM_ZONE 1
3670 EOF
3671 }
3672
3673 else
3674   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3675 echo "configure:3676: checking for tzname" >&5
3676
3677 cat > conftest.$ac_ext <<EOF
3678 #line 3679 "configure"
3679 #include "confdefs.h"
3680 #include <time.h>
3681 #ifndef tzname /* For SGI.  */
3682 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3683 #endif
3684 int main() {
3685 atoi(*tzname);
3686 ; return 0; }
3687 EOF
3688 if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3689   rm -rf conftest*
3690   ac_cv_var_tzname=yes
3691 else
3692   echo "configure: failed program was:" >&5
3693   cat conftest.$ac_ext >&5
3694   rm -rf conftest*
3695   ac_cv_var_tzname=no
3696 fi
3697 rm -f conftest*
3698
3699 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3700   if test $ac_cv_var_tzname = yes; then
3701     { test "$extra_verbose" = "yes" && cat << \EOF
3702     Defining HAVE_TZNAME
3703 EOF
3704 cat >> confdefs.h <<\EOF
3705 #define HAVE_TZNAME 1
3706 EOF
3707 }
3708
3709   fi
3710 fi
3711
3712
3713 echo $ac_n "checking for working const""... $ac_c" 1>&6
3714 echo "configure:3715: checking for working const" >&5
3715
3716 cat > conftest.$ac_ext <<EOF
3717 #line 3718 "configure"
3718 #include "confdefs.h"
3719
3720 int main() {
3721
3722 /* Ultrix mips cc rejects this.  */
3723 typedef int charset[2]; const charset x;
3724 /* SunOS 4.1.1 cc rejects this.  */
3725 char const *const *ccp;
3726 char **p;
3727 /* NEC SVR4.0.2 mips cc rejects this.  */
3728 struct point {int x, y;};
3729 static struct point const zero = {0,0};
3730 /* AIX XL C 1.02.0.0 rejects this.
3731    It does not let you subtract one const X* pointer from another in an arm
3732    of an if-expression whose if-part is not a constant expression */
3733 const char *g = "string";
3734 ccp = &g + (g ? g-g : 0);
3735 /* HPUX 7.0 cc rejects these. */
3736 ++ccp;
3737 p = (char**) ccp;
3738 ccp = (char const *const *) p;
3739 { /* SCO 3.2v4 cc rejects this.  */
3740   char *t;
3741   char const *s = 0 ? (char *) 0 : (char const *) 0;
3742
3743   *t++ = 0;
3744 }
3745 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3746   int x[] = {25, 17};
3747   const int *foo = &x[0];
3748   ++foo;
3749 }
3750 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3751   typedef const int *iptr;
3752   iptr p = 0;
3753   ++p;
3754 }
3755 { /* AIX XL C 1.02.0.0 rejects this saying
3756      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3757   struct s { int j; const int *ap[3]; };
3758   struct s *b; b->j = 5;
3759 }
3760 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3761   const int foo = 10;
3762 }
3763
3764 ; return 0; }
3765 EOF
3766 if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3767   rm -rf conftest*
3768   ac_cv_c_const=yes
3769 else
3770   echo "configure: failed program was:" >&5
3771   cat conftest.$ac_ext >&5
3772   rm -rf conftest*
3773   ac_cv_c_const=no
3774 fi
3775 rm -f conftest*
3776
3777 echo "$ac_t""$ac_cv_c_const" 1>&6
3778 if test $ac_cv_c_const = no; then
3779   { test "$extra_verbose" = "yes" && cat << \EOF
3780     Defining const = 
3781 EOF
3782 cat >> confdefs.h <<\EOF
3783 #define const 
3784 EOF
3785 }
3786
3787 fi
3788
3789
3790 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3791 echo "configure:3792: checking whether ${MAKE-make} sets \${MAKE}" >&5
3792 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3793
3794 cat > conftestmake <<\EOF
3795 all:
3796         @echo 'ac_maketemp="${MAKE}"'
3797 EOF
3798 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3799 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3800 if test -n "$ac_maketemp"; then
3801   eval ac_cv_prog_make_${ac_make}_set=yes
3802 else
3803   eval ac_cv_prog_make_${ac_make}_set=no
3804 fi
3805 rm -f conftestmake
3806 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3807   echo "$ac_t""yes" 1>&6
3808   SET_MAKE=
3809 else
3810   echo "$ac_t""no" 1>&6
3811   SET_MAKE="MAKE=${MAKE-make}"
3812 fi
3813
3814
3815 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3816 echo "configure:3817: checking whether byte ordering is bigendian" >&5
3817
3818 ac_cv_c_bigendian=unknown
3819 # See if sys/param.h defines the BYTE_ORDER macro.
3820 cat > conftest.$ac_ext <<EOF
3821 #line 3822 "configure"
3822 #include "confdefs.h"
3823 #include <sys/types.h>
3824 #include <sys/param.h>
3825 int main() {
3826
3827 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3828  bogus endian macros
3829 #endif
3830 ; return 0; }
3831 EOF
3832 if { (eval echo configure:3833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3833   rm -rf conftest*
3834   # It does; now see whether it defined to BIG_ENDIAN or not.
3835 cat > conftest.$ac_ext <<EOF
3836 #line 3837 "configure"
3837 #include "confdefs.h"
3838 #include <sys/types.h>
3839 #include <sys/param.h>
3840 int main() {
3841
3842 #if BYTE_ORDER != BIG_ENDIAN
3843  not big endian
3844 #endif
3845 ; return 0; }
3846 EOF
3847 if { (eval echo configure:3848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3848   rm -rf conftest*
3849   ac_cv_c_bigendian=yes
3850 else
3851   echo "configure: failed program was:" >&5
3852   cat conftest.$ac_ext >&5
3853   rm -rf conftest*
3854   ac_cv_c_bigendian=no
3855 fi
3856 rm -f conftest*
3857 else
3858   echo "configure: failed program was:" >&5
3859   cat conftest.$ac_ext >&5
3860 fi
3861 rm -f conftest*
3862 if test $ac_cv_c_bigendian = unknown; then
3863 cat > conftest.$ac_ext <<EOF
3864 #line 3865 "configure"
3865 #include "confdefs.h"
3866 main () {
3867   /* Are we little or big endian?  From Harbison&Steele.  */
3868   union
3869   {
3870     long l;
3871     char c[sizeof (long)];
3872   } u;
3873   u.l = 1;
3874   exit (u.c[sizeof (long) - 1] == 1);
3875 }
3876 EOF
3877 if { (eval echo configure:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3878 then
3879   ac_cv_c_bigendian=no
3880 else
3881   conftest_rc="$?"
3882   echo "configure: failed program was:" >&5
3883   cat conftest.$ac_ext >&5
3884   rm -fr conftest*
3885   ac_cv_c_bigendian=yes
3886 fi
3887 rm -fr conftest*
3888 fi
3889
3890 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3891 if test $ac_cv_c_bigendian = yes; then
3892   { test "$extra_verbose" = "yes" && cat << \EOF
3893     Defining WORDS_BIGENDIAN
3894 EOF
3895 cat >> confdefs.h <<\EOF
3896 #define WORDS_BIGENDIAN 1
3897 EOF
3898 }
3899
3900 fi
3901
3902
3903 echo $ac_n "checking size of short""... $ac_c" 1>&6
3904 echo "configure:3905: checking size of short" >&5
3905
3906 cat > conftest.$ac_ext <<EOF
3907 #line 3908 "configure"
3908 #include "confdefs.h"
3909 #include <stdio.h>
3910 main()
3911 {
3912   FILE *f=fopen("conftestval", "w");
3913   if (!f) exit(1);
3914   fprintf(f, "%d\n", sizeof(short));
3915   exit(0);
3916 }
3917 EOF
3918 if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3919 then
3920   ac_cv_sizeof_short=`cat conftestval`
3921 else
3922   conftest_rc="$?"
3923   echo "configure: failed program was:" >&5
3924   cat conftest.$ac_ext >&5
3925   rm -fr conftest*
3926   ac_cv_sizeof_short=0
3927 fi
3928 rm -fr conftest*
3929 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
3930 { test "$extra_verbose" = "yes" && cat << EOF
3931     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
3932 EOF
3933 cat >> confdefs.h <<EOF
3934 #define SIZEOF_SHORT $ac_cv_sizeof_short
3935 EOF
3936 }
3937
3938
3939 if test "$ac_cv_sizeof_short" = 0; then
3940   echo ""
3941   echo "*** PANIC *** Configure tests are not working - compiler is broken."
3942   echo "*** PANIC *** Please examine config.log for compilation errors."
3943   exit 1
3944 fi
3945 echo $ac_n "checking size of int""... $ac_c" 1>&6
3946 echo "configure:3947: checking size of int" >&5
3947
3948 cat > conftest.$ac_ext <<EOF
3949 #line 3950 "configure"
3950 #include "confdefs.h"
3951 #include <stdio.h>
3952 main()
3953 {
3954   FILE *f=fopen("conftestval", "w");
3955   if (!f) exit(1);
3956   fprintf(f, "%d\n", sizeof(int));
3957   exit(0);
3958 }
3959 EOF
3960 if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3961 then
3962   ac_cv_sizeof_int=`cat conftestval`
3963 else
3964   conftest_rc="$?"
3965   echo "configure: failed program was:" >&5
3966   cat conftest.$ac_ext >&5
3967   rm -fr conftest*
3968   ac_cv_sizeof_int=0
3969 fi
3970 rm -fr conftest*
3971 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
3972 { test "$extra_verbose" = "yes" && cat << EOF
3973     Defining SIZEOF_INT = $ac_cv_sizeof_int
3974 EOF
3975 cat >> confdefs.h <<EOF
3976 #define SIZEOF_INT $ac_cv_sizeof_int
3977 EOF
3978 }
3979
3980
3981 echo $ac_n "checking size of long""... $ac_c" 1>&6
3982 echo "configure:3983: checking size of long" >&5
3983
3984 cat > conftest.$ac_ext <<EOF
3985 #line 3986 "configure"
3986 #include "confdefs.h"
3987 #include <stdio.h>
3988 main()
3989 {
3990   FILE *f=fopen("conftestval", "w");
3991   if (!f) exit(1);
3992   fprintf(f, "%d\n", sizeof(long));
3993   exit(0);
3994 }
3995 EOF
3996 if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3997 then
3998   ac_cv_sizeof_long=`cat conftestval`
3999 else
4000   conftest_rc="$?"
4001   echo "configure: failed program was:" >&5
4002   cat conftest.$ac_ext >&5
4003   rm -fr conftest*
4004   ac_cv_sizeof_long=0
4005 fi
4006 rm -fr conftest*
4007 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4008 { test "$extra_verbose" = "yes" && cat << EOF
4009     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4010 EOF
4011 cat >> confdefs.h <<EOF
4012 #define SIZEOF_LONG $ac_cv_sizeof_long
4013 EOF
4014 }
4015
4016
4017 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4018 echo "configure:4019: checking size of long long" >&5
4019
4020 cat > conftest.$ac_ext <<EOF
4021 #line 4022 "configure"
4022 #include "confdefs.h"
4023 #include <stdio.h>
4024 main()
4025 {
4026   FILE *f=fopen("conftestval", "w");
4027   if (!f) exit(1);
4028   fprintf(f, "%d\n", sizeof(long long));
4029   exit(0);
4030 }
4031 EOF
4032 if { (eval echo configure:4033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4033 then
4034   ac_cv_sizeof_long_long=`cat conftestval`
4035 else
4036   conftest_rc="$?"
4037   echo "configure: failed program was:" >&5
4038   cat conftest.$ac_ext >&5
4039   rm -fr conftest*
4040   ac_cv_sizeof_long_long=0
4041 fi
4042 rm -fr conftest*
4043 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4044 { test "$extra_verbose" = "yes" && cat << EOF
4045     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4046 EOF
4047 cat >> confdefs.h <<EOF
4048 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4049 EOF
4050 }
4051
4052
4053 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4054 echo "configure:4055: checking size of void *" >&5
4055
4056 cat > conftest.$ac_ext <<EOF
4057 #line 4058 "configure"
4058 #include "confdefs.h"
4059 #include <stdio.h>
4060 main()
4061 {
4062   FILE *f=fopen("conftestval", "w");
4063   if (!f) exit(1);
4064   fprintf(f, "%d\n", sizeof(void *));
4065   exit(0);
4066 }
4067 EOF
4068 if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4069 then
4070   ac_cv_sizeof_void_p=`cat conftestval`
4071 else
4072   conftest_rc="$?"
4073   echo "configure: failed program was:" >&5
4074   cat conftest.$ac_ext >&5
4075   rm -fr conftest*
4076   ac_cv_sizeof_void_p=0
4077 fi
4078 rm -fr conftest*
4079 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4080 { test "$extra_verbose" = "yes" && cat << EOF
4081     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4082 EOF
4083 cat >> confdefs.h <<EOF
4084 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4085 EOF
4086 }
4087
4088
4089
4090 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4091 echo "configure:4092: checking for long file names" >&5
4092
4093 ac_cv_sys_long_file_names=yes
4094 # Test for long file names in all the places we know might matter:
4095 #      .                the current directory, where building will happen
4096 #      $prefix/lib      where we will be installing things
4097 #      $exec_prefix/lib likewise
4098 # eval it to expand exec_prefix.
4099 #      $TMPDIR          if set, where it might want to write temporary files
4100 # if $TMPDIR is not set:
4101 #      /tmp             where it might want to write temporary files
4102 #      /var/tmp         likewise
4103 #      /usr/tmp         likewise
4104 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4105   ac_tmpdirs="$TMPDIR"
4106 else
4107   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4108 fi
4109 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4110   test -d $ac_dir || continue
4111   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4112   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4113   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4114   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4115   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4116     ac_cv_sys_long_file_names=no
4117     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4118     break
4119   fi
4120   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4121 done
4122
4123 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4124 if test $ac_cv_sys_long_file_names = yes; then
4125   { test "$extra_verbose" = "yes" && cat << \EOF
4126     Defining HAVE_LONG_FILE_NAMES
4127 EOF
4128 cat >> confdefs.h <<\EOF
4129 #define HAVE_LONG_FILE_NAMES 1
4130 EOF
4131 }
4132
4133 fi
4134
4135
4136
4137 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4138 echo "configure:4139: checking for sin in -lm" >&5
4139 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4140
4141 xe_check_libs=" -lm "
4142 cat > conftest.$ac_ext <<EOF
4143 #line 4144 "configure"
4144 #include "confdefs.h"
4145 /* Override any gcc2 internal prototype to avoid an error.  */
4146 /* We use char because int might match the return type of a gcc2
4147     builtin and then its argument prototype would still apply.  */
4148 char sin();
4149
4150 int main() {
4151 sin()
4152 ; return 0; }
4153 EOF
4154 if { (eval echo configure:4155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4155   rm -rf conftest*
4156   eval "ac_cv_lib_$ac_lib_var=yes"
4157 else
4158   echo "configure: failed program was:" >&5
4159   cat conftest.$ac_ext >&5
4160   rm -rf conftest*
4161   eval "ac_cv_lib_$ac_lib_var=no"
4162 fi
4163 rm -f conftest*
4164 xe_check_libs=""
4165
4166 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4167   echo "$ac_t""yes" 1>&6
4168     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4169     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4170   { test "$extra_verbose" = "yes" && cat << EOF
4171     Defining $ac_tr_lib
4172 EOF
4173 cat >> confdefs.h <<EOF
4174 #define $ac_tr_lib 1
4175 EOF
4176 }
4177
4178   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4179
4180 else
4181   echo "$ac_t""no" 1>&6
4182 fi
4183
4184
4185
4186 { test "$extra_verbose" = "yes" && cat << \EOF
4187     Defining LISP_FLOAT_TYPE
4188 EOF
4189 cat >> confdefs.h <<\EOF
4190 #define LISP_FLOAT_TYPE 1
4191 EOF
4192 }
4193
4194
4195 cat > conftest.$ac_ext <<EOF
4196 #line 4197 "configure"
4197 #include "confdefs.h"
4198 #include <math.h>
4199 int main() {
4200 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4201 ; return 0; }
4202 EOF
4203 if { (eval echo configure:4204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4204   rm -rf conftest*
4205   { test "$extra_verbose" = "yes" && cat << \EOF
4206     Defining HAVE_INVERSE_HYPERBOLIC
4207 EOF
4208 cat >> confdefs.h <<\EOF
4209 #define HAVE_INVERSE_HYPERBOLIC 1
4210 EOF
4211 }
4212
4213 else
4214   echo "configure: failed program was:" >&5
4215   cat conftest.$ac_ext >&5
4216 fi
4217 rm -f conftest*
4218
4219 echo "checking type of mail spool file locking" 1>&6
4220 echo "configure:4221: checking type of mail spool file locking" >&5
4221 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4222 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4223 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4224     Defining REAL_MAIL_USE_LOCKF
4225 EOF
4226 cat >> confdefs.h <<\EOF
4227 #define REAL_MAIL_USE_LOCKF 1
4228 EOF
4229 }
4230
4231 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4232     Defining REAL_MAIL_USE_FLOCK
4233 EOF
4234 cat >> confdefs.h <<\EOF
4235 #define REAL_MAIL_USE_FLOCK 1
4236 EOF
4237 }
4238
4239 else mail_locking="dot-locking"
4240 fi
4241
4242
4243 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
4244 echo "configure:4245: checking for kstat_open in -lkstat" >&5
4245 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
4246
4247 xe_check_libs=" -lkstat "
4248 cat > conftest.$ac_ext <<EOF
4249 #line 4250 "configure"
4250 #include "confdefs.h"
4251 /* Override any gcc2 internal prototype to avoid an error.  */
4252 /* We use char because int might match the return type of a gcc2
4253     builtin and then its argument prototype would still apply.  */
4254 char kstat_open();
4255
4256 int main() {
4257 kstat_open()
4258 ; return 0; }
4259 EOF
4260 if { (eval echo configure:4261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4261   rm -rf conftest*
4262   eval "ac_cv_lib_$ac_lib_var=yes"
4263 else
4264   echo "configure: failed program was:" >&5
4265   cat conftest.$ac_ext >&5
4266   rm -rf conftest*
4267   eval "ac_cv_lib_$ac_lib_var=no"
4268 fi
4269 rm -f conftest*
4270 xe_check_libs=""
4271
4272 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4273   echo "$ac_t""yes" 1>&6
4274     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4275     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4276   { test "$extra_verbose" = "yes" && cat << EOF
4277     Defining $ac_tr_lib
4278 EOF
4279 cat >> confdefs.h <<EOF
4280 #define $ac_tr_lib 1
4281 EOF
4282 }
4283
4284   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
4285
4286 else
4287   echo "$ac_t""no" 1>&6
4288 fi
4289
4290
4291
4292
4293 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
4294 echo "configure:4295: checking for kvm_read in -lkvm" >&5
4295 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
4296
4297 xe_check_libs=" -lkvm "
4298 cat > conftest.$ac_ext <<EOF
4299 #line 4300 "configure"
4300 #include "confdefs.h"
4301 /* Override any gcc2 internal prototype to avoid an error.  */
4302 /* We use char because int might match the return type of a gcc2
4303     builtin and then its argument prototype would still apply.  */
4304 char kvm_read();
4305
4306 int main() {
4307 kvm_read()
4308 ; return 0; }
4309 EOF
4310 if { (eval echo configure:4311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4311   rm -rf conftest*
4312   eval "ac_cv_lib_$ac_lib_var=yes"
4313 else
4314   echo "configure: failed program was:" >&5
4315   cat conftest.$ac_ext >&5
4316   rm -rf conftest*
4317   eval "ac_cv_lib_$ac_lib_var=no"
4318 fi
4319 rm -f conftest*
4320 xe_check_libs=""
4321
4322 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4323   echo "$ac_t""yes" 1>&6
4324     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4325     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4326   { test "$extra_verbose" = "yes" && cat << EOF
4327     Defining $ac_tr_lib
4328 EOF
4329 cat >> confdefs.h <<EOF
4330 #define $ac_tr_lib 1
4331 EOF
4332 }
4333
4334   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
4335
4336 else
4337   echo "$ac_t""no" 1>&6
4338 fi
4339
4340
4341
4342 case "$opsys" in decosf*)
4343   
4344 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4345 echo "configure:4346: checking for cma_open in -lpthreads" >&5
4346 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4347
4348 xe_check_libs=" -lpthreads "
4349 cat > conftest.$ac_ext <<EOF
4350 #line 4351 "configure"
4351 #include "confdefs.h"
4352 /* Override any gcc2 internal prototype to avoid an error.  */
4353 /* We use char because int might match the return type of a gcc2
4354     builtin and then its argument prototype would still apply.  */
4355 char cma_open();
4356
4357 int main() {
4358 cma_open()
4359 ; return 0; }
4360 EOF
4361 if { (eval echo configure:4362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4362   rm -rf conftest*
4363   eval "ac_cv_lib_$ac_lib_var=yes"
4364 else
4365   echo "configure: failed program was:" >&5
4366   cat conftest.$ac_ext >&5
4367   rm -rf conftest*
4368   eval "ac_cv_lib_$ac_lib_var=no"
4369 fi
4370 rm -f conftest*
4371 xe_check_libs=""
4372
4373 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4374   echo "$ac_t""yes" 1>&6
4375     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4376     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4377   { test "$extra_verbose" = "yes" && cat << EOF
4378     Defining $ac_tr_lib
4379 EOF
4380 cat >> confdefs.h <<EOF
4381 #define $ac_tr_lib 1
4382 EOF
4383 }
4384
4385   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4386
4387 else
4388   echo "$ac_t""no" 1>&6
4389 fi
4390
4391
4392   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4393     c_switch_site="$c_switch_site -threads" ;;
4394 esac
4395
4396 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4397 echo "configure:4398: checking whether the -xildoff compiler flag is required" >&5
4398 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4399   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4400     then echo "$ac_t""no" 1>&6;
4401     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
4402   fi
4403   else echo "$ac_t""no" 1>&6
4404 fi
4405
4406 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4407   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4408 echo "configure:4409: checking for \"-z ignore\" linker flag" >&5
4409   case "`ld -h 2>&1`" in
4410     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4411       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4412     *) echo "$ac_t""no" 1>&6 ;;
4413   esac
4414 fi
4415
4416
4417 echo "checking "for specified window system"" 1>&6
4418 echo "configure:4419: checking "for specified window system"" >&5
4419
4420 if test "$with_x11" != "no"; then
4421     test "$x_includes $x_libraries" != "NONE NONE" && \
4422    window_system=x11 with_x11=yes
4423
4424         
4425       if test "$x_includes $x_libraries" = "NONE NONE" \
4426     -a -n "$OPENWINHOME" \
4427     -a "$OPENWINHOME" != "/usr/openwin" \
4428     -a -d "$OPENWINHOME"; then
4429       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4430       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4431       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4432   fi
4433
4434   if test "$x_includes" = "NONE"; then
4435                     for dir in "/usr/X11" "/usr/X11R6"; do
4436       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4437     done
4438   fi
4439
4440   if test "$x_libraries" = "NONE"; then
4441     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4442       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4443     done
4444   fi
4445
4446   # If we find X, set shell vars x_includes and x_libraries to the
4447 # paths, otherwise set no_x=yes.
4448 # Uses ac_ vars as temps to allow command line to override cache and checks.
4449 # --without-x overrides everything else, but does not touch the cache.
4450 echo $ac_n "checking for X""... $ac_c" 1>&6
4451 echo "configure:4452: checking for X" >&5
4452
4453 # Check whether --with-x or --without-x was given.
4454 if test "${with_x+set}" = set; then
4455   withval="$with_x"
4456   :
4457 fi
4458
4459 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4460 if test "x$with_x" = xno; then
4461   # The user explicitly disabled X.
4462   have_x=disabled
4463 else
4464   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4465     # Both variables are already set.
4466     have_x=yes
4467   else
4468
4469 # One or both of the vars are not set, and there is no cached value.
4470 ac_x_includes=NO ac_x_libraries=NO
4471 rm -fr conftestdir
4472 if mkdir conftestdir; then
4473   cd conftestdir
4474   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4475   cat > Imakefile <<'EOF'
4476 acfindx:
4477         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4478 EOF
4479   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4480     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4481     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4482     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4483     for ac_extension in a so sl; do
4484       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4485         test -f $ac_im_libdir/libX11.$ac_extension; then
4486         ac_im_usrlibdir=$ac_im_libdir; break
4487       fi
4488     done
4489     # Screen out bogus values from the imake configuration.  They are
4490     # bogus both because they are the default anyway, and because
4491     # using them would break gcc on systems where it needs fixed includes.
4492     case "$ac_im_incroot" in
4493         /usr/include) ;;
4494         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4495     esac
4496     case "$ac_im_usrlibdir" in
4497         /usr/lib | /lib) ;;
4498         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4499     esac
4500   fi
4501   cd ..
4502   rm -fr conftestdir
4503 fi
4504
4505 if test "$ac_x_includes" = NO; then
4506   # Guess where to find include files, by looking for this one X11 .h file.
4507   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4508
4509   # First, try using that file with no special directory specified.
4510 cat > conftest.$ac_ext <<EOF
4511 #line 4512 "configure"
4512 #include "confdefs.h"
4513 #include <$x_direct_test_include>
4514 EOF
4515 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4516 { (eval echo configure:4517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4517 ac_err=`grep -v '^ *+' conftest.out`
4518 if test -z "$ac_err"; then
4519   rm -rf conftest*
4520   # We can compile using X headers with no special include directory.
4521 ac_x_includes=
4522 else
4523   echo "$ac_err" >&5
4524   echo "configure: failed program was:" >&5
4525   cat conftest.$ac_ext >&5
4526   rm -rf conftest*
4527   # Look for the header file in a standard set of common directories.
4528 # Check X11 before X11Rn because it is often a symlink to the current release.
4529   for ac_dir in               \
4530     /usr/X11/include          \
4531     /usr/X11R6/include        \
4532     /usr/X11R5/include        \
4533     /usr/X11R4/include        \
4534                               \
4535     /usr/include/X11          \
4536     /usr/include/X11R6        \
4537     /usr/include/X11R5        \
4538     /usr/include/X11R4        \
4539                               \
4540     /usr/local/X11/include    \
4541     /usr/local/X11R6/include  \
4542     /usr/local/X11R5/include  \
4543     /usr/local/X11R4/include  \
4544                               \
4545     /usr/local/include/X11    \
4546     /usr/local/include/X11R6  \
4547     /usr/local/include/X11R5  \
4548     /usr/local/include/X11R4  \
4549                               \
4550     /usr/X386/include         \
4551     /usr/x386/include         \
4552     /usr/XFree86/include/X11  \
4553                               \
4554     /usr/include              \
4555     /usr/local/include        \
4556     /usr/unsupported/include  \
4557     /usr/athena/include       \
4558     /usr/local/x11r5/include  \
4559     /usr/lpp/Xamples/include  \
4560                               \
4561     /usr/openwin/include      \
4562     /usr/openwin/share/include \
4563     ; \
4564   do
4565     if test -r "$ac_dir/$x_direct_test_include"; then
4566       ac_x_includes=$ac_dir
4567       break
4568     fi
4569   done
4570 fi
4571 rm -f conftest*
4572 fi # $ac_x_includes = NO
4573
4574 if test "$ac_x_libraries" = NO; then
4575   # Check for the libraries.
4576
4577   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4578   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4579
4580   # See if we find them without any special options.
4581   # Don't add to $LIBS permanently.
4582   ac_save_LIBS="$LIBS"
4583   LIBS="-l$x_direct_test_library $LIBS"
4584 cat > conftest.$ac_ext <<EOF
4585 #line 4586 "configure"
4586 #include "confdefs.h"
4587
4588 int main() {
4589 ${x_direct_test_function}()
4590 ; return 0; }
4591 EOF
4592 if { (eval echo configure:4593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4593   rm -rf conftest*
4594   LIBS="$ac_save_LIBS"
4595 # We can link X programs with no special library path.
4596 ac_x_libraries=
4597 else
4598   echo "configure: failed program was:" >&5
4599   cat conftest.$ac_ext >&5
4600   rm -rf conftest*
4601   LIBS="$ac_save_LIBS"
4602 # First see if replacing the include by lib works.
4603 # Check X11 before X11Rn because it is often a symlink to the current release.
4604 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4605     /usr/X11/lib          \
4606     /usr/X11R6/lib        \
4607     /usr/X11R5/lib        \
4608     /usr/X11R4/lib        \
4609                           \
4610     /usr/lib/X11          \
4611     /usr/lib/X11R6        \
4612     /usr/lib/X11R5        \
4613     /usr/lib/X11R4        \
4614                           \
4615     /usr/local/X11/lib    \
4616     /usr/local/X11R6/lib  \
4617     /usr/local/X11R5/lib  \
4618     /usr/local/X11R4/lib  \
4619                           \
4620     /usr/local/lib/X11    \
4621     /usr/local/lib/X11R6  \
4622     /usr/local/lib/X11R5  \
4623     /usr/local/lib/X11R4  \
4624                           \
4625     /usr/X386/lib         \
4626     /usr/x386/lib         \
4627     /usr/XFree86/lib/X11  \
4628                           \
4629     /usr/lib              \
4630     /usr/local/lib        \
4631     /usr/unsupported/lib  \
4632     /usr/athena/lib       \
4633     /usr/local/x11r5/lib  \
4634     /usr/lpp/Xamples/lib  \
4635     /lib/usr/lib/X11      \
4636                           \
4637     /usr/openwin/lib      \
4638     /usr/openwin/share/lib \
4639     ; \
4640 do
4641   for ac_extension in a so sl; do
4642     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4643       ac_x_libraries=$ac_dir
4644       break 2
4645     fi
4646   done
4647 done
4648 fi
4649 rm -f conftest*
4650 fi # $ac_x_libraries = NO
4651
4652 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4653   # Didn't find X anywhere.  Cache the known absence of X.
4654   ac_cv_have_x="have_x=no"
4655 else
4656   # Record where we found X for the cache.
4657   ac_cv_have_x="have_x=yes \
4658                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4659 fi
4660   fi
4661   eval "$ac_cv_have_x"
4662 fi # $with_x != no
4663
4664 if test "$have_x" != yes; then
4665   echo "$ac_t""$have_x" 1>&6
4666   no_x=yes
4667 else
4668   # If each of the values was on the command line, it overrides each guess.
4669   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4670   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4671   # Update the cache value to reflect the command line values.
4672   ac_cv_have_x="have_x=yes \
4673                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4674   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4675 fi
4676
4677 if test "$no_x" = yes; then
4678   # Not all programs may use this symbol, but it does not hurt to define it.
4679   { test "$extra_verbose" = "yes" && cat << \EOF
4680     Defining X_DISPLAY_MISSING
4681 EOF
4682 cat >> confdefs.h <<\EOF
4683 #define X_DISPLAY_MISSING 1
4684 EOF
4685 }
4686
4687   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4688 else
4689   if test -n "$x_includes"; then
4690     X_CFLAGS="$X_CFLAGS -I$x_includes"
4691   fi
4692
4693   # It would also be nice to do this for all -L options, not just this one.
4694   if test -n "$x_libraries"; then
4695     X_LIBS="$X_LIBS -L$x_libraries"
4696     # For Solaris; some versions of Sun CC require a space after -R and
4697     # others require no space.  Words are not sufficient . . . .
4698     case "`(uname -sr) 2>/dev/null`" in
4699     "SunOS 5"*)
4700       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4701 echo "configure:4702: checking whether -R must be followed by a space" >&5
4702       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4703       cat > conftest.$ac_ext <<EOF
4704 #line 4705 "configure"
4705 #include "confdefs.h"
4706
4707 int main() {
4708
4709 ; return 0; }
4710 EOF
4711 if { (eval echo configure:4712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4712   rm -rf conftest*
4713   ac_R_nospace=yes
4714 else
4715   echo "configure: failed program was:" >&5
4716   cat conftest.$ac_ext >&5
4717   rm -rf conftest*
4718   ac_R_nospace=no
4719 fi
4720 rm -f conftest*
4721       if test $ac_R_nospace = yes; then
4722         echo "$ac_t""no" 1>&6
4723         X_LIBS="$X_LIBS -R$x_libraries"
4724       else
4725         LIBS="$ac_xsave_LIBS -R $x_libraries"
4726         cat > conftest.$ac_ext <<EOF
4727 #line 4728 "configure"
4728 #include "confdefs.h"
4729
4730 int main() {
4731
4732 ; return 0; }
4733 EOF
4734 if { (eval echo configure:4735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4735   rm -rf conftest*
4736   ac_R_space=yes
4737 else
4738   echo "configure: failed program was:" >&5
4739   cat conftest.$ac_ext >&5
4740   rm -rf conftest*
4741   ac_R_space=no
4742 fi
4743 rm -f conftest*
4744         if test $ac_R_space = yes; then
4745           echo "$ac_t""yes" 1>&6
4746           X_LIBS="$X_LIBS -R $x_libraries"
4747         else
4748           echo "$ac_t""neither works" 1>&6
4749         fi
4750       fi
4751       LIBS="$ac_xsave_LIBS"
4752     esac
4753   fi
4754
4755   # Check for system-dependent libraries X programs must link with.
4756   # Do this before checking for the system-independent R6 libraries
4757   # (-lICE), since we may need -lsocket or whatever for X linking.
4758
4759   if test "$ISC" = yes; then
4760     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4761   else
4762     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4763     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4764     # the Alpha needs dnet_stub (dnet does not exist).
4765     if test "$with_dnet" = "no" ; then
4766 ac_cv_lib_dnet_dnet_ntoa=no
4767 else
4768
4769 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4770 echo "configure:4771: checking for dnet_ntoa in -ldnet" >&5
4771 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4772
4773 xe_check_libs=" -ldnet "
4774 cat > conftest.$ac_ext <<EOF
4775 #line 4776 "configure"
4776 #include "confdefs.h"
4777 /* Override any gcc2 internal prototype to avoid an error.  */
4778 /* We use char because int might match the return type of a gcc2
4779     builtin and then its argument prototype would still apply.  */
4780 char dnet_ntoa();
4781
4782 int main() {
4783 dnet_ntoa()
4784 ; return 0; }
4785 EOF
4786 if { (eval echo configure:4787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4787   rm -rf conftest*
4788   eval "ac_cv_lib_$ac_lib_var=yes"
4789 else
4790   echo "configure: failed program was:" >&5
4791   cat conftest.$ac_ext >&5
4792   rm -rf conftest*
4793   eval "ac_cv_lib_$ac_lib_var=no"
4794 fi
4795 rm -f conftest*
4796 xe_check_libs=""
4797
4798 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4799   echo "$ac_t""yes" 1>&6
4800   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4801 else
4802   echo "$ac_t""no" 1>&6
4803 fi
4804
4805 fi
4806
4807     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4808       
4809 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4810 echo "configure:4811: checking for dnet_ntoa in -ldnet_stub" >&5
4811 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4812
4813 xe_check_libs=" -ldnet_stub "
4814 cat > conftest.$ac_ext <<EOF
4815 #line 4816 "configure"
4816 #include "confdefs.h"
4817 /* Override any gcc2 internal prototype to avoid an error.  */
4818 /* We use char because int might match the return type of a gcc2
4819     builtin and then its argument prototype would still apply.  */
4820 char dnet_ntoa();
4821
4822 int main() {
4823 dnet_ntoa()
4824 ; return 0; }
4825 EOF
4826 if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4827   rm -rf conftest*
4828   eval "ac_cv_lib_$ac_lib_var=yes"
4829 else
4830   echo "configure: failed program was:" >&5
4831   cat conftest.$ac_ext >&5
4832   rm -rf conftest*
4833   eval "ac_cv_lib_$ac_lib_var=no"
4834 fi
4835 rm -f conftest*
4836 xe_check_libs=""
4837
4838 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4839   echo "$ac_t""yes" 1>&6
4840   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4841 else
4842   echo "$ac_t""no" 1>&6
4843 fi
4844
4845
4846     fi
4847
4848     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4849     # to get the SysV transport functions.
4850     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4851     # needs -lnsl.
4852     # The nsl library prevents programs from opening the X display
4853     # on Irix 5.2, according to dickey@clark.net.
4854     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4855 echo "configure:4856: checking for gethostbyname" >&5
4856
4857 cat > conftest.$ac_ext <<EOF
4858 #line 4859 "configure"
4859 #include "confdefs.h"
4860 /* System header to define __stub macros and hopefully few prototypes,
4861     which can conflict with char gethostbyname(); below.  */
4862 #include <assert.h>
4863 /* Override any gcc2 internal prototype to avoid an error.  */
4864 /* We use char because int might match the return type of a gcc2
4865     builtin and then its argument prototype would still apply.  */
4866 char gethostbyname();
4867
4868 int main() {
4869
4870 /* The GNU C library defines this for functions which it implements
4871     to always fail with ENOSYS.  Some functions are actually named
4872     something starting with __ and the normal name is an alias.  */
4873 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4874 choke me
4875 #else
4876 gethostbyname();
4877 #endif
4878
4879 ; return 0; }
4880 EOF
4881 if { (eval echo configure:4882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4882   rm -rf conftest*
4883   eval "ac_cv_func_gethostbyname=yes"
4884 else
4885   echo "configure: failed program was:" >&5
4886   cat conftest.$ac_ext >&5
4887   rm -rf conftest*
4888   eval "ac_cv_func_gethostbyname=no"
4889 fi
4890 rm -f conftest*
4891
4892 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4893   echo "$ac_t""yes" 1>&6
4894   :
4895 else
4896   echo "$ac_t""no" 1>&6
4897 fi
4898
4899     if test $ac_cv_func_gethostbyname = no; then
4900       
4901 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4902 echo "configure:4903: checking for gethostbyname in -lnsl" >&5
4903 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4904
4905 xe_check_libs=" -lnsl "
4906 cat > conftest.$ac_ext <<EOF
4907 #line 4908 "configure"
4908 #include "confdefs.h"
4909 /* Override any gcc2 internal prototype to avoid an error.  */
4910 /* We use char because int might match the return type of a gcc2
4911     builtin and then its argument prototype would still apply.  */
4912 char gethostbyname();
4913
4914 int main() {
4915 gethostbyname()
4916 ; return 0; }
4917 EOF
4918 if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4919   rm -rf conftest*
4920   eval "ac_cv_lib_$ac_lib_var=yes"
4921 else
4922   echo "configure: failed program was:" >&5
4923   cat conftest.$ac_ext >&5
4924   rm -rf conftest*
4925   eval "ac_cv_lib_$ac_lib_var=no"
4926 fi
4927 rm -f conftest*
4928 xe_check_libs=""
4929
4930 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4931   echo "$ac_t""yes" 1>&6
4932   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4933 else
4934   echo "$ac_t""no" 1>&6
4935 fi
4936
4937
4938     fi
4939
4940     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4941     # socket/setsockopt and other routines are undefined under SCO ODT
4942     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4943     # on later versions), says simon@lia.di.epfl.ch: it contains
4944     # gethostby* variants that don't use the nameserver (or something).
4945     # -lsocket must be given before -lnsl if both are needed.
4946     # We assume that if connect needs -lnsl, so does gethostbyname.
4947     echo $ac_n "checking for connect""... $ac_c" 1>&6
4948 echo "configure:4949: checking for connect" >&5
4949
4950 cat > conftest.$ac_ext <<EOF
4951 #line 4952 "configure"
4952 #include "confdefs.h"
4953 /* System header to define __stub macros and hopefully few prototypes,
4954     which can conflict with char connect(); below.  */
4955 #include <assert.h>
4956 /* Override any gcc2 internal prototype to avoid an error.  */
4957 /* We use char because int might match the return type of a gcc2
4958     builtin and then its argument prototype would still apply.  */
4959 char connect();
4960
4961 int main() {
4962
4963 /* The GNU C library defines this for functions which it implements
4964     to always fail with ENOSYS.  Some functions are actually named
4965     something starting with __ and the normal name is an alias.  */
4966 #if defined (__stub_connect) || defined (__stub___connect)
4967 choke me
4968 #else
4969 connect();
4970 #endif
4971
4972 ; return 0; }
4973 EOF
4974 if { (eval echo configure:4975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4975   rm -rf conftest*
4976   eval "ac_cv_func_connect=yes"
4977 else
4978   echo "configure: failed program was:" >&5
4979   cat conftest.$ac_ext >&5
4980   rm -rf conftest*
4981   eval "ac_cv_func_connect=no"
4982 fi
4983 rm -f conftest*
4984
4985 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4986   echo "$ac_t""yes" 1>&6
4987   :
4988 else
4989   echo "$ac_t""no" 1>&6
4990 fi
4991
4992     if test $ac_cv_func_connect = no; then
4993       
4994 xe_msg_checking="for connect in -lsocket"
4995 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
4996 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
4997 echo "configure:4998: checking "$xe_msg_checking"" >&5
4998 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
4999
5000 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5001 cat > conftest.$ac_ext <<EOF
5002 #line 5003 "configure"
5003 #include "confdefs.h"
5004 /* Override any gcc2 internal prototype to avoid an error.  */
5005 /* We use char because int might match the return type of a gcc2
5006     builtin and then its argument prototype would still apply.  */
5007 char connect();
5008
5009 int main() {
5010 connect()
5011 ; return 0; }
5012 EOF
5013 if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5014   rm -rf conftest*
5015   eval "ac_cv_lib_$ac_lib_var=yes"
5016 else
5017   echo "configure: failed program was:" >&5
5018   cat conftest.$ac_ext >&5
5019   rm -rf conftest*
5020   eval "ac_cv_lib_$ac_lib_var=no"
5021 fi
5022 rm -f conftest*
5023 xe_check_libs=""
5024
5025 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5026   echo "$ac_t""yes" 1>&6
5027   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5028 else
5029   echo "$ac_t""no" 1>&6
5030 fi
5031
5032
5033     fi
5034
5035     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5036     echo $ac_n "checking for remove""... $ac_c" 1>&6
5037 echo "configure:5038: checking for remove" >&5
5038
5039 cat > conftest.$ac_ext <<EOF
5040 #line 5041 "configure"
5041 #include "confdefs.h"
5042 /* System header to define __stub macros and hopefully few prototypes,
5043     which can conflict with char remove(); below.  */
5044 #include <assert.h>
5045 /* Override any gcc2 internal prototype to avoid an error.  */
5046 /* We use char because int might match the return type of a gcc2
5047     builtin and then its argument prototype would still apply.  */
5048 char remove();
5049
5050 int main() {
5051
5052 /* The GNU C library defines this for functions which it implements
5053     to always fail with ENOSYS.  Some functions are actually named
5054     something starting with __ and the normal name is an alias.  */
5055 #if defined (__stub_remove) || defined (__stub___remove)
5056 choke me
5057 #else
5058 remove();
5059 #endif
5060
5061 ; return 0; }
5062 EOF
5063 if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5064   rm -rf conftest*
5065   eval "ac_cv_func_remove=yes"
5066 else
5067   echo "configure: failed program was:" >&5
5068   cat conftest.$ac_ext >&5
5069   rm -rf conftest*
5070   eval "ac_cv_func_remove=no"
5071 fi
5072 rm -f conftest*
5073
5074 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5075   echo "$ac_t""yes" 1>&6
5076   :
5077 else
5078   echo "$ac_t""no" 1>&6
5079 fi
5080
5081     if test $ac_cv_func_remove = no; then
5082       
5083 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5084 echo "configure:5085: checking for remove in -lposix" >&5
5085 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5086
5087 xe_check_libs=" -lposix "
5088 cat > conftest.$ac_ext <<EOF
5089 #line 5090 "configure"
5090 #include "confdefs.h"
5091 /* Override any gcc2 internal prototype to avoid an error.  */
5092 /* We use char because int might match the return type of a gcc2
5093     builtin and then its argument prototype would still apply.  */
5094 char remove();
5095
5096 int main() {
5097 remove()
5098 ; return 0; }
5099 EOF
5100 if { (eval echo configure:5101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5101   rm -rf conftest*
5102   eval "ac_cv_lib_$ac_lib_var=yes"
5103 else
5104   echo "configure: failed program was:" >&5
5105   cat conftest.$ac_ext >&5
5106   rm -rf conftest*
5107   eval "ac_cv_lib_$ac_lib_var=no"
5108 fi
5109 rm -f conftest*
5110 xe_check_libs=""
5111
5112 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5113   echo "$ac_t""yes" 1>&6
5114   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5115 else
5116   echo "$ac_t""no" 1>&6
5117 fi
5118
5119
5120     fi
5121
5122     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5123     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5124 echo "configure:5125: checking for shmat" >&5
5125
5126 cat > conftest.$ac_ext <<EOF
5127 #line 5128 "configure"
5128 #include "confdefs.h"
5129 /* System header to define __stub macros and hopefully few prototypes,
5130     which can conflict with char shmat(); below.  */
5131 #include <assert.h>
5132 /* Override any gcc2 internal prototype to avoid an error.  */
5133 /* We use char because int might match the return type of a gcc2
5134     builtin and then its argument prototype would still apply.  */
5135 char shmat();
5136
5137 int main() {
5138
5139 /* The GNU C library defines this for functions which it implements
5140     to always fail with ENOSYS.  Some functions are actually named
5141     something starting with __ and the normal name is an alias.  */
5142 #if defined (__stub_shmat) || defined (__stub___shmat)
5143 choke me
5144 #else
5145 shmat();
5146 #endif
5147
5148 ; return 0; }
5149 EOF
5150 if { (eval echo configure:5151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5151   rm -rf conftest*
5152   eval "ac_cv_func_shmat=yes"
5153 else
5154   echo "configure: failed program was:" >&5
5155   cat conftest.$ac_ext >&5
5156   rm -rf conftest*
5157   eval "ac_cv_func_shmat=no"
5158 fi
5159 rm -f conftest*
5160
5161 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5162   echo "$ac_t""yes" 1>&6
5163   :
5164 else
5165   echo "$ac_t""no" 1>&6
5166 fi
5167
5168     if test $ac_cv_func_shmat = no; then
5169       
5170 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5171 echo "configure:5172: checking for shmat in -lipc" >&5
5172 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5173
5174 xe_check_libs=" -lipc "
5175 cat > conftest.$ac_ext <<EOF
5176 #line 5177 "configure"
5177 #include "confdefs.h"
5178 /* Override any gcc2 internal prototype to avoid an error.  */
5179 /* We use char because int might match the return type of a gcc2
5180     builtin and then its argument prototype would still apply.  */
5181 char shmat();
5182
5183 int main() {
5184 shmat()
5185 ; return 0; }
5186 EOF
5187 if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5188   rm -rf conftest*
5189   eval "ac_cv_lib_$ac_lib_var=yes"
5190 else
5191   echo "configure: failed program was:" >&5
5192   cat conftest.$ac_ext >&5
5193   rm -rf conftest*
5194   eval "ac_cv_lib_$ac_lib_var=no"
5195 fi
5196 rm -f conftest*
5197 xe_check_libs=""
5198
5199 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5200   echo "$ac_t""yes" 1>&6
5201   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5202 else
5203   echo "$ac_t""no" 1>&6
5204 fi
5205
5206
5207     fi
5208   fi
5209
5210   # Check for libraries that X11R6 Xt/Xaw programs need.
5211   ac_save_LDFLAGS="$LDFLAGS"
5212   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5213   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5214   # check for ICE first), but we must link in the order -lSM -lICE or
5215   # we get undefined symbols.  So assume we have SM if we have ICE.
5216   # These have to be linked with before -lX11, unlike the other
5217   # libraries we check for below, so use a different variable.
5218   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5219   
5220 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5221 echo "configure:5222: checking for IceConnectionNumber in -lICE" >&5
5222 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5223
5224 xe_check_libs=" -lICE "
5225 cat > conftest.$ac_ext <<EOF
5226 #line 5227 "configure"
5227 #include "confdefs.h"
5228 /* Override any gcc2 internal prototype to avoid an error.  */
5229 /* We use char because int might match the return type of a gcc2
5230     builtin and then its argument prototype would still apply.  */
5231 char IceConnectionNumber();
5232
5233 int main() {
5234 IceConnectionNumber()
5235 ; return 0; }
5236 EOF
5237 if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5238   rm -rf conftest*
5239   eval "ac_cv_lib_$ac_lib_var=yes"
5240 else
5241   echo "configure: failed program was:" >&5
5242   cat conftest.$ac_ext >&5
5243   rm -rf conftest*
5244   eval "ac_cv_lib_$ac_lib_var=no"
5245 fi
5246 rm -f conftest*
5247 xe_check_libs=""
5248
5249 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5250   echo "$ac_t""yes" 1>&6
5251   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5252 else
5253   echo "$ac_t""no" 1>&6
5254 fi
5255
5256
5257   LDFLAGS="$ac_save_LDFLAGS"
5258
5259 fi
5260  # Autoconf claims to find X library and include dirs for us.
5261   if test "$no_x" = "yes"
5262   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5263   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5264   fi
5265 fi
5266
5267 case "$with_x11" in
5268   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5269   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5270 esac
5271
5272 if test "$with_x11" = "yes"; then
5273   { test "$extra_verbose" = "yes" && cat << \EOF
5274     Defining HAVE_X_WINDOWS
5275 EOF
5276 cat >> confdefs.h <<\EOF
5277 #define HAVE_X_WINDOWS 1
5278 EOF
5279 }
5280
5281   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5282   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5283
5284       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5285     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5286     if test -d "$lib_dir" -a -d "$inc_dir"; then
5287       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5288         x_libraries="$lib_dir $x_libraries"
5289         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5290       esac
5291       case "$x_includes" in "$inc_dir"* ) ;; *)
5292         x_includes="$inc_dir $x_includes"
5293         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5294       esac
5295       break;       fi
5296   done
5297
5298     for rel in "X11R6" "X11R5" "X11R4"; do
5299     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5300     if test -d "$lib_dir" -a -d "$inc_dir"; then
5301       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5302         x_libraries="$x_libraries $lib_dir"
5303         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5304       esac
5305       case "$x_includes" in "$inc_dir"* ) ;; *)
5306         x_includes="$x_includes $inc_dir"
5307         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5308       esac
5309       break;     fi
5310   done
5311
5312     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
5313
5314   ld_switch_x_site="$X_LIBS"
5315
5316   
5317 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5318     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5319   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5320   
5321         runpath="" runpath_dirs=""
5322   if test -n "$LD_RUN_PATH"; then
5323     runpath="$LD_RUN_PATH"
5324   elif test "$GCC" = "yes"; then
5325         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5326     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5327     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5328     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5329       case "$arg" in P,* | -L* | -R* )
5330         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5331           {
5332 xe_runpath_dir="$dir"
5333   test "$xe_runpath_dir" != "/lib"     -a \
5334         "$xe_runpath_dir" != "/usr/lib" -a \
5335         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5336   eval "$xe_add_unique_runpath_dir"
5337 }
5338         done ;;
5339       esac
5340     done
5341     ld_switch_run="$ld_switch_run_save"
5342     rm -f conftest*
5343   else
5344         for arg in $ld_switch_site $ld_switch_x_site; do
5345       case "$arg" in -L*) {
5346 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5347   test "$xe_runpath_dir" != "/lib"     -a \
5348         "$xe_runpath_dir" != "/usr/lib" -a \
5349         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5350   eval "$xe_add_unique_runpath_dir"
5351 };; esac
5352     done
5353         if test "$opsys $need_motif" = "sol2 yes"; then
5354       xe_runpath_dir="/opt/SUNWdt/lib";
5355       eval "$xe_add_unique_runpath_dir";
5356     fi
5357   fi 
5358   if test -n "$runpath"; then
5359     ld_switch_run="${dash_r}${runpath}"
5360     
5361 if test "$GCC" = "yes"; then
5362   set x $ld_switch_run; shift; ld_switch_run=""
5363   while test -n "$1"; do
5364     case $1 in
5365       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5366       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5367       -Xlinker* ) ;;
5368       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5369     esac
5370     shift
5371   done
5372 fi
5373     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5374   fi
5375 fi
5376
5377
5378   if test "$extra_verbose" = "yes"; then
5379     echo; echo "X11 compilation variables:"
5380     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5381     echo
5382   fi
5383
5384             bitmapdirs=
5385   if test "$x_includes" != NONE; then
5386     for i in $x_includes; do
5387       if test -d "$i/bitmaps"; then
5388         bitmapdirs="$i/bitmaps:$bitmapdirs"
5389       fi
5390       if test -d "$i/X11/bitmaps"; then
5391         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5392       fi
5393     done
5394     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5395   fi
5396   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5397     Defining BITMAPDIR = "$bitmapdirs"
5398 EOF
5399 cat >> confdefs.h <<EOF
5400 #define BITMAPDIR "$bitmapdirs"
5401 EOF
5402 }
5403
5404
5405     echo "checking for X defines extracted by xmkmf" 1>&6
5406 echo "configure:5407: checking for X defines extracted by xmkmf" >&5
5407   rm -fr conftestdir
5408   if mkdir conftestdir; then
5409     cd conftestdir
5410     cat > Imakefile <<'EOF'
5411 xetest:
5412         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5413 EOF
5414     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5415       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5416       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5417     fi
5418     cd ..
5419     rm -fr conftestdir
5420     for word in $xmkmf_defines; do
5421       case "$word" in
5422         -D*=* ) ;;
5423         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5424               { test "$extra_verbose" = "yes" && cat << EOF
5425     Defining $word
5426 EOF
5427 cat >> confdefs.h <<EOF
5428 #define $word 1
5429 EOF
5430 }
5431  ;;
5432       esac
5433     done
5434   fi
5435
5436     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5437 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5438 echo "configure:5439: checking for X11/Intrinsic.h" >&5
5439
5440 cat > conftest.$ac_ext <<EOF
5441 #line 5442 "configure"
5442 #include "confdefs.h"
5443 #include <X11/Intrinsic.h>
5444 EOF
5445 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5446 { (eval echo configure:5447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5447 ac_err=`grep -v '^ *+' conftest.out`
5448 if test -z "$ac_err"; then
5449   rm -rf conftest*
5450   eval "ac_cv_header_$ac_safe=yes"
5451 else
5452   echo "$ac_err" >&5
5453   echo "configure: failed program was:" >&5
5454   cat conftest.$ac_ext >&5
5455   rm -rf conftest*
5456   eval "ac_cv_header_$ac_safe=no"
5457 fi
5458 rm -f conftest*
5459 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5460   echo "$ac_t""yes" 1>&6
5461   :
5462 else
5463   echo "$ac_t""no" 1>&6
5464 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5465 fi
5466
5467
5468       
5469 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5470 echo "configure:5471: checking for XOpenDisplay in -lX11" >&5
5471 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5472
5473 xe_check_libs=" -lX11 "
5474 cat > conftest.$ac_ext <<EOF
5475 #line 5476 "configure"
5476 #include "confdefs.h"
5477 /* Override any gcc2 internal prototype to avoid an error.  */
5478 /* We use char because int might match the return type of a gcc2
5479     builtin and then its argument prototype would still apply.  */
5480 char XOpenDisplay();
5481
5482 int main() {
5483 XOpenDisplay()
5484 ; return 0; }
5485 EOF
5486 if { (eval echo configure:5487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5487   rm -rf conftest*
5488   eval "ac_cv_lib_$ac_lib_var=yes"
5489 else
5490   echo "configure: failed program was:" >&5
5491   cat conftest.$ac_ext >&5
5492   rm -rf conftest*
5493   eval "ac_cv_lib_$ac_lib_var=no"
5494 fi
5495 rm -f conftest*
5496 xe_check_libs=""
5497
5498 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5499   echo "$ac_t""yes" 1>&6
5500   have_lib_x11=yes
5501 else
5502   echo "$ac_t""no" 1>&6
5503 fi
5504
5505
5506   if test "$have_lib_x11" != "yes"; then
5507     
5508 xe_msg_checking="for XGetFontProperty in -lX11"
5509 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5510 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5511 echo "configure:5512: checking "$xe_msg_checking"" >&5
5512 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5513
5514 xe_check_libs=" -lX11 -b i486-linuxaout"
5515 cat > conftest.$ac_ext <<EOF
5516 #line 5517 "configure"
5517 #include "confdefs.h"
5518 /* Override any gcc2 internal prototype to avoid an error.  */
5519 /* We use char because int might match the return type of a gcc2
5520     builtin and then its argument prototype would still apply.  */
5521 char XGetFontProperty();
5522
5523 int main() {
5524 XGetFontProperty()
5525 ; return 0; }
5526 EOF
5527 if { (eval echo configure:5528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5528   rm -rf conftest*
5529   eval "ac_cv_lib_$ac_lib_var=yes"
5530 else
5531   echo "configure: failed program was:" >&5
5532   cat conftest.$ac_ext >&5
5533   rm -rf conftest*
5534   eval "ac_cv_lib_$ac_lib_var=no"
5535 fi
5536 rm -f conftest*
5537 xe_check_libs=""
5538
5539 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5540   echo "$ac_t""yes" 1>&6
5541   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5542 else
5543   echo "$ac_t""no" 1>&6
5544 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5545 fi
5546
5547
5548   fi
5549   libs_x="-lX11"
5550   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5551
5552     
5553 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5554 echo "configure:5555: checking for XShapeSelectInput in -lXext" >&5
5555 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5556
5557 xe_check_libs=" -lXext "
5558 cat > conftest.$ac_ext <<EOF
5559 #line 5560 "configure"
5560 #include "confdefs.h"
5561 /* Override any gcc2 internal prototype to avoid an error.  */
5562 /* We use char because int might match the return type of a gcc2
5563     builtin and then its argument prototype would still apply.  */
5564 char XShapeSelectInput();
5565
5566 int main() {
5567 XShapeSelectInput()
5568 ; return 0; }
5569 EOF
5570 if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5571   rm -rf conftest*
5572   eval "ac_cv_lib_$ac_lib_var=yes"
5573 else
5574   echo "configure: failed program was:" >&5
5575   cat conftest.$ac_ext >&5
5576   rm -rf conftest*
5577   eval "ac_cv_lib_$ac_lib_var=no"
5578 fi
5579 rm -f conftest*
5580 xe_check_libs=""
5581
5582 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5583   echo "$ac_t""yes" 1>&6
5584   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5585 else
5586   echo "$ac_t""no" 1>&6
5587 fi
5588
5589
5590
5591     
5592 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5593 echo "configure:5594: checking for XtOpenDisplay in -lXt" >&5
5594 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5595
5596 xe_check_libs=" -lXt "
5597 cat > conftest.$ac_ext <<EOF
5598 #line 5599 "configure"
5599 #include "confdefs.h"
5600 /* Override any gcc2 internal prototype to avoid an error.  */
5601 /* We use char because int might match the return type of a gcc2
5602     builtin and then its argument prototype would still apply.  */
5603 char XtOpenDisplay();
5604
5605 int main() {
5606 XtOpenDisplay()
5607 ; return 0; }
5608 EOF
5609 if { (eval echo configure:5610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5610   rm -rf conftest*
5611   eval "ac_cv_lib_$ac_lib_var=yes"
5612 else
5613   echo "configure: failed program was:" >&5
5614   cat conftest.$ac_ext >&5
5615   rm -rf conftest*
5616   eval "ac_cv_lib_$ac_lib_var=no"
5617 fi
5618 rm -f conftest*
5619 xe_check_libs=""
5620
5621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5622   echo "$ac_t""yes" 1>&6
5623   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5624 else
5625   echo "$ac_t""no" 1>&6
5626 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5627 fi
5628
5629
5630
5631   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5632 echo "configure:5633: checking the version of X11 being used" >&5
5633   cat > conftest.$ac_ext <<EOF
5634 #line 5635 "configure"
5635 #include "confdefs.h"
5636 #include <X11/Intrinsic.h>
5637     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5638 EOF
5639 if { (eval echo configure:5640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5640 then
5641   ./conftest foobar; x11_release=$?
5642 else
5643   conftest_rc="$?"
5644   echo "configure: failed program was:" >&5
5645   cat conftest.$ac_ext >&5
5646   rm -fr conftest*
5647   x11_release=4
5648 fi
5649 rm -fr conftest*
5650   echo "$ac_t""R${x11_release}" 1>&6
5651   { test "$extra_verbose" = "yes" && cat << EOF
5652     Defining THIS_IS_X11R${x11_release}
5653 EOF
5654 cat >> confdefs.h <<EOF
5655 #define THIS_IS_X11R${x11_release} 1
5656 EOF
5657 }
5658
5659
5660   for ac_hdr in X11/Xlocale.h
5661 do
5662 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5663 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5664 echo "configure:5665: checking for $ac_hdr" >&5
5665
5666 cat > conftest.$ac_ext <<EOF
5667 #line 5668 "configure"
5668 #include "confdefs.h"
5669 #include <$ac_hdr>
5670 EOF
5671 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5672 { (eval echo configure:5673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5673 ac_err=`grep -v '^ *+' conftest.out`
5674 if test -z "$ac_err"; then
5675   rm -rf conftest*
5676   eval "ac_cv_header_$ac_safe=yes"
5677 else
5678   echo "$ac_err" >&5
5679   echo "configure: failed program was:" >&5
5680   cat conftest.$ac_ext >&5
5681   rm -rf conftest*
5682   eval "ac_cv_header_$ac_safe=no"
5683 fi
5684 rm -f conftest*
5685 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5686   echo "$ac_t""yes" 1>&6
5687     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5688   { test "$extra_verbose" = "yes" && cat << EOF
5689     Defining $ac_tr_hdr
5690 EOF
5691 cat >> confdefs.h <<EOF
5692 #define $ac_tr_hdr 1
5693 EOF
5694 }
5695  
5696 else
5697   echo "$ac_t""no" 1>&6
5698 fi
5699 done
5700
5701
5702     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5703 echo "configure:5704: checking for XFree86" >&5
5704   if test -d "/usr/X386/include" -o \
5705           -f "/etc/XF86Config"    -o \
5706           -f "/etc/X11/XF86Config" -o \
5707           -f "/usr/X11R6/lib/X11/XF86Config"; then
5708     echo "$ac_t""yes" 1>&6
5709     { test "$extra_verbose" = "yes" && cat << \EOF
5710     Defining HAVE_XFREE386
5711 EOF
5712 cat >> confdefs.h <<\EOF
5713 #define HAVE_XFREE386 1
5714 EOF
5715 }
5716
5717   else
5718     echo "$ac_t""no" 1>&6
5719   fi
5720
5721     test -z "$with_xmu" && { 
5722 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5723 echo "configure:5724: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5724 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5725
5726 xe_check_libs=" -lXmu "
5727 cat > conftest.$ac_ext <<EOF
5728 #line 5729 "configure"
5729 #include "confdefs.h"
5730 /* Override any gcc2 internal prototype to avoid an error.  */
5731 /* We use char because int might match the return type of a gcc2
5732     builtin and then its argument prototype would still apply.  */
5733 char XmuReadBitmapDataFromFile();
5734
5735 int main() {
5736 XmuReadBitmapDataFromFile()
5737 ; return 0; }
5738 EOF
5739 if { (eval echo configure:5740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5740   rm -rf conftest*
5741   eval "ac_cv_lib_$ac_lib_var=yes"
5742 else
5743   echo "configure: failed program was:" >&5
5744   cat conftest.$ac_ext >&5
5745   rm -rf conftest*
5746   eval "ac_cv_lib_$ac_lib_var=no"
5747 fi
5748 rm -f conftest*
5749 xe_check_libs=""
5750
5751 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5752   echo "$ac_t""yes" 1>&6
5753   with_xmu=yes
5754 else
5755   echo "$ac_t""no" 1>&6
5756 with_xmu=no
5757 fi
5758
5759  }
5760   if test "$with_xmu" = "no"; then
5761     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5762    echo "    xemacs will be linked with \"xmu.o\""
5763  fi
5764   else
5765     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5766     { test "$extra_verbose" = "yes" && cat << \EOF
5767     Defining HAVE_XMU
5768 EOF
5769 cat >> confdefs.h <<\EOF
5770 #define HAVE_XMU 1
5771 EOF
5772 }
5773
5774   fi
5775
5776       
5777 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5778 echo "configure:5779: checking for main in -lXbsd" >&5
5779 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5780
5781 xe_check_libs=" -lXbsd "
5782 cat > conftest.$ac_ext <<EOF
5783 #line 5784 "configure"
5784 #include "confdefs.h"
5785
5786 int main() {
5787 main()
5788 ; return 0; }
5789 EOF
5790 if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5791   rm -rf conftest*
5792   eval "ac_cv_lib_$ac_lib_var=yes"
5793 else
5794   echo "configure: failed program was:" >&5
5795   cat conftest.$ac_ext >&5
5796   rm -rf conftest*
5797   eval "ac_cv_lib_$ac_lib_var=no"
5798 fi
5799 rm -f conftest*
5800 xe_check_libs=""
5801
5802 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5803   echo "$ac_t""yes" 1>&6
5804   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5805 else
5806   echo "$ac_t""no" 1>&6
5807 fi
5808
5809
5810
5811     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5812         if test "$GCC" = "yes"; then
5813       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5814       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5815     else
5816       case "$CC" in
5817         "xlc" ) CC="xlc_r" ;;
5818         "xlC" ) CC="xlC_r" ;;
5819         "cc"  ) CC="cc_r" ;;
5820       esac
5821     fi
5822   fi
5823
5824 fi 
5825 if test "$with_msw" != "no"; then
5826   echo "checking for MS-Windows" 1>&6
5827 echo "configure:5828: checking for MS-Windows" >&5
5828   
5829 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5830 echo "configure:5831: checking for main in -lgdi32" >&5
5831 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5832
5833 xe_check_libs=" -lgdi32 "
5834 cat > conftest.$ac_ext <<EOF
5835 #line 5836 "configure"
5836 #include "confdefs.h"
5837
5838 int main() {
5839 main()
5840 ; return 0; }
5841 EOF
5842 if { (eval echo configure:5843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5843   rm -rf conftest*
5844   eval "ac_cv_lib_$ac_lib_var=yes"
5845 else
5846   echo "configure: failed program was:" >&5
5847   cat conftest.$ac_ext >&5
5848   rm -rf conftest*
5849   eval "ac_cv_lib_$ac_lib_var=no"
5850 fi
5851 rm -f conftest*
5852 xe_check_libs=""
5853
5854 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5855   echo "$ac_t""yes" 1>&6
5856   with_msw=yes
5857 else
5858   echo "$ac_t""no" 1>&6
5859 fi
5860
5861
5862   if test "$with_msw" = "yes"; then
5863     { test "$extra_verbose" = "yes" && cat << \EOF
5864     Defining HAVE_MS_WINDOWS
5865 EOF
5866 cat >> confdefs.h <<\EOF
5867 #define HAVE_MS_WINDOWS 1
5868 EOF
5869 }
5870
5871     install_pp="$blddir/lib-src/installexe.sh"
5872     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
5873     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
5874     if test "$window_system" != x11; then
5875         window_system=msw
5876         test "$with_scrollbars" != "no" && with_scrollbars=msw \
5877             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5878    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5879  fi
5880         test "$with_menubars"   != "no" && with_menubars=msw \
5881             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5882    echo "    xemacs will be linked with \"menubar-msw.o\""
5883  fi
5884         test "$with_toolbars"   != "no" && with_toolbars=msw \
5885             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5886    echo "    xemacs will be linked with \"toolbar-msw.o\""
5887  fi
5888         test "$with_dialogs"   != "no" && with_dialogs=msw \
5889             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5890    echo "    xemacs will be linked with \"dialog-msw.o\""
5891  fi
5892     else
5893         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5894    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5895  fi
5896         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5897    echo "    xemacs will be linked with \"menubar-msw.o\""
5898  fi
5899         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5900    echo "    xemacs will be linked with \"toolbar-msw.o\""
5901  fi
5902         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5903    echo "    xemacs will be linked with \"dialog-msw.o\""
5904  fi
5905     fi
5906         cat > conftest.$ac_ext <<EOF
5907 #line 5908 "configure"
5908 #include "confdefs.h"
5909 #include <fcntl.h>
5910     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
5911 EOF
5912 if { (eval echo configure:5913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5913 then
5914   { test "$extra_verbose" = "yes" && cat << \EOF
5915     Defining HAVE_MSG_SELECT
5916 EOF
5917 cat >> confdefs.h <<\EOF
5918 #define HAVE_MSG_SELECT 1
5919 EOF
5920 }
5921
5922 else
5923   conftest_rc="$?"
5924   echo "configure: failed program was:" >&5
5925   cat conftest.$ac_ext >&5
5926 fi
5927 rm -fr conftest*
5928     const_is_losing=no
5929     with_file_coding=yes
5930     use_minimal_tagbits=yes
5931     use_indexed_lrecord_implementation=yes
5932     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
5933    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\""
5934  fi
5935   fi
5936 fi
5937
5938
5939
5940 test -z "$window_system" && window_system="none"
5941
5942 if test "$window_system" = "none"; then
5943   for feature in menubars scrollbars toolbars dialogs dragndrop xface
5944   do
5945     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5946        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
5947     fi
5948     eval "with_${feature}=no"
5949   done
5950 else
5951   test -z "$with_toolbars" && with_toolbars=yes
5952 fi
5953
5954 if test "$with_msw" != "yes"; then
5955   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
5956   do
5957     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5958        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
5959     fi
5960     eval "with_${feature}=no"
5961   done
5962 else
5963   :
5964 fi
5965
5966 if test "$with_x11" != "yes"; then
5967             for feature in tooltalk cde offix session xim xmu 
5968   do
5969     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5970        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
5971     fi
5972     eval "with_${feature}=no"
5973   done
5974 fi
5975
5976 bitmapdir=
5977
5978 case "$window_system" in
5979   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
5980   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
5981   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
5982 esac
5983
5984 case "$x_libraries" in *X11R4* )
5985   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
5986   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
5987 esac
5988
5989 echo "checking for session-management option" 1>&6
5990 echo "configure:5991: checking for session-management option" >&5;
5991 if test "$with_session" != "no"; then
5992   { test "$extra_verbose" = "yes" && cat << \EOF
5993     Defining HAVE_SESSION
5994 EOF
5995 cat >> confdefs.h <<\EOF
5996 #define HAVE_SESSION 1
5997 EOF
5998 }
5999
6000 fi
6001
6002 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6003 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6004 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6005 echo "configure:6006: checking for X11/Xauth.h" >&5
6006
6007 cat > conftest.$ac_ext <<EOF
6008 #line 6009 "configure"
6009 #include "confdefs.h"
6010 #include <X11/Xauth.h>
6011 EOF
6012 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6013 { (eval echo configure:6014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6014 ac_err=`grep -v '^ *+' conftest.out`
6015 if test -z "$ac_err"; then
6016   rm -rf conftest*
6017   eval "ac_cv_header_$ac_safe=yes"
6018 else
6019   echo "$ac_err" >&5
6020   echo "configure: failed program was:" >&5
6021   cat conftest.$ac_ext >&5
6022   rm -rf conftest*
6023   eval "ac_cv_header_$ac_safe=no"
6024 fi
6025 rm -f conftest*
6026 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6027   echo "$ac_t""yes" 1>&6
6028   :
6029 else
6030   echo "$ac_t""no" 1>&6
6031 with_xauth=no
6032 fi
6033  }
6034 test -z "$with_xauth" && { 
6035 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6036 echo "configure:6037: checking for XauGetAuthByAddr in -lXau" >&5
6037 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6038
6039 xe_check_libs=" -lXau "
6040 cat > conftest.$ac_ext <<EOF
6041 #line 6042 "configure"
6042 #include "confdefs.h"
6043 /* Override any gcc2 internal prototype to avoid an error.  */
6044 /* We use char because int might match the return type of a gcc2
6045     builtin and then its argument prototype would still apply.  */
6046 char XauGetAuthByAddr();
6047
6048 int main() {
6049 XauGetAuthByAddr()
6050 ; return 0; }
6051 EOF
6052 if { (eval echo configure:6053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6053   rm -rf conftest*
6054   eval "ac_cv_lib_$ac_lib_var=yes"
6055 else
6056   echo "configure: failed program was:" >&5
6057   cat conftest.$ac_ext >&5
6058   rm -rf conftest*
6059   eval "ac_cv_lib_$ac_lib_var=no"
6060 fi
6061 rm -f conftest*
6062 xe_check_libs=""
6063
6064 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6065   echo "$ac_t""yes" 1>&6
6066   :
6067 else
6068   echo "$ac_t""no" 1>&6
6069 with_xauth=no
6070 fi
6071
6072  }
6073 test -z "$with_xauth" && with_xauth=yes
6074 if test "$with_xauth" = "yes"; then
6075   { test "$extra_verbose" = "yes" && cat << \EOF
6076     Defining HAVE_XAUTH
6077 EOF
6078 cat >> confdefs.h <<\EOF
6079 #define HAVE_XAUTH 1
6080 EOF
6081 }
6082
6083   
6084 T=""
6085 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
6086 libs_xauth="$T"
6087
6088 fi
6089
6090
6091
6092
6093 if test "$with_tooltalk" != "no" ; then
6094       for dir in "" "Tt/" "desktop/" ; do
6095     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6096 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6097 echo "configure:6098: checking for ${dir}tt_c.h" >&5
6098
6099 cat > conftest.$ac_ext <<EOF
6100 #line 6101 "configure"
6101 #include "confdefs.h"
6102 #include <${dir}tt_c.h>
6103 EOF
6104 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6105 { (eval echo configure:6106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6106 ac_err=`grep -v '^ *+' conftest.out`
6107 if test -z "$ac_err"; then
6108   rm -rf conftest*
6109   eval "ac_cv_header_$ac_safe=yes"
6110 else
6111   echo "$ac_err" >&5
6112   echo "configure: failed program was:" >&5
6113   cat conftest.$ac_ext >&5
6114   rm -rf conftest*
6115   eval "ac_cv_header_$ac_safe=no"
6116 fi
6117 rm -f conftest*
6118 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6119   echo "$ac_t""yes" 1>&6
6120   tt_c_h_path="${dir}tt_c.h"; break
6121 else
6122   echo "$ac_t""no" 1>&6
6123 fi
6124
6125   done
6126   if test -z "$tt_c_h_path"; then
6127     if test "$with_tooltalk" = "yes"; then
6128       (echo "$progname: Usage error:"
6129 echo " " "Unable to find required tooltalk header files."
6130 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6131     fi
6132     with_tooltalk=no
6133   fi
6134 fi
6135 if test "$with_tooltalk" != "no" ; then
6136   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6137     
6138 xe_msg_checking="for tt_message_create in -ltt"
6139 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6140 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6141 echo "configure:6142: checking "$xe_msg_checking"" >&5
6142 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6143
6144 xe_check_libs=" -ltt $extra_libs"
6145 cat > conftest.$ac_ext <<EOF
6146 #line 6147 "configure"
6147 #include "confdefs.h"
6148 /* Override any gcc2 internal prototype to avoid an error.  */
6149 /* We use char because int might match the return type of a gcc2
6150     builtin and then its argument prototype would still apply.  */
6151 char tt_message_create();
6152
6153 int main() {
6154 tt_message_create()
6155 ; return 0; }
6156 EOF
6157 if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6158   rm -rf conftest*
6159   eval "ac_cv_lib_$ac_lib_var=yes"
6160 else
6161   echo "configure: failed program was:" >&5
6162   cat conftest.$ac_ext >&5
6163   rm -rf conftest*
6164   eval "ac_cv_lib_$ac_lib_var=no"
6165 fi
6166 rm -f conftest*
6167 xe_check_libs=""
6168
6169 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6170   echo "$ac_t""yes" 1>&6
6171   tt_libs="-ltt $extra_libs"; break
6172 else
6173   echo "$ac_t""no" 1>&6
6174 :
6175 fi
6176
6177
6178   done
6179   if test -z "$tt_libs"; then
6180     if test "$with_tooltalk" = "yes"; then
6181       (echo "$progname: Usage error:"
6182 echo " " "Unable to find required tooltalk libraries."
6183 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6184     fi
6185     with_tooltalk=no
6186   fi
6187 fi
6188 test -z "$with_tooltalk" && with_tooltalk=yes
6189 if test "$with_tooltalk" = "yes"; then
6190   { test "$extra_verbose" = "yes" && cat << \EOF
6191     Defining TOOLTALK
6192 EOF
6193 cat >> confdefs.h <<\EOF
6194 #define TOOLTALK 1
6195 EOF
6196 }
6197
6198   { test "$extra_verbose" = "yes" && cat << EOF
6199     Defining TT_C_H_PATH = "$tt_c_h_path"
6200 EOF
6201 cat >> confdefs.h <<EOF
6202 #define TT_C_H_PATH "$tt_c_h_path"
6203 EOF
6204 }
6205
6206   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6207   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6208    echo "    xemacs will be linked with \"tooltalk.o\""
6209  fi
6210 fi
6211
6212 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6213 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6214 echo "configure:6215: checking for Dt/Dt.h" >&5
6215
6216 cat > conftest.$ac_ext <<EOF
6217 #line 6218 "configure"
6218 #include "confdefs.h"
6219 #include <Dt/Dt.h>
6220 EOF
6221 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6222 { (eval echo configure:6223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6223 ac_err=`grep -v '^ *+' conftest.out`
6224 if test -z "$ac_err"; then
6225   rm -rf conftest*
6226   eval "ac_cv_header_$ac_safe=yes"
6227 else
6228   echo "$ac_err" >&5
6229   echo "configure: failed program was:" >&5
6230   cat conftest.$ac_ext >&5
6231   rm -rf conftest*
6232   eval "ac_cv_header_$ac_safe=no"
6233 fi
6234 rm -f conftest*
6235 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6236   echo "$ac_t""yes" 1>&6
6237   :
6238 else
6239   echo "$ac_t""no" 1>&6
6240 with_cde=no
6241 fi
6242  }
6243 test -z "$with_cde" && { 
6244 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6245 echo "configure:6246: checking for DtDndDragStart in -lDtSvc" >&5
6246 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6247
6248 xe_check_libs=" -lDtSvc "
6249 cat > conftest.$ac_ext <<EOF
6250 #line 6251 "configure"
6251 #include "confdefs.h"
6252 /* Override any gcc2 internal prototype to avoid an error.  */
6253 /* We use char because int might match the return type of a gcc2
6254     builtin and then its argument prototype would still apply.  */
6255 char DtDndDragStart();
6256
6257 int main() {
6258 DtDndDragStart()
6259 ; return 0; }
6260 EOF
6261 if { (eval echo configure:6262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6262   rm -rf conftest*
6263   eval "ac_cv_lib_$ac_lib_var=yes"
6264 else
6265   echo "configure: failed program was:" >&5
6266   cat conftest.$ac_ext >&5
6267   rm -rf conftest*
6268   eval "ac_cv_lib_$ac_lib_var=no"
6269 fi
6270 rm -f conftest*
6271 xe_check_libs=""
6272
6273 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6274   echo "$ac_t""yes" 1>&6
6275   :
6276 else
6277   echo "$ac_t""no" 1>&6
6278 with_cde=no
6279 fi
6280
6281  }
6282 test -z "$with_cde" && with_cde=yes
6283 if test "$with_dragndrop" = no; then
6284   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6285   with_cde=no
6286 fi
6287 if test "$with_cde" = "yes" ; then
6288   { test "$extra_verbose" = "yes" && cat << \EOF
6289     Defining HAVE_CDE
6290 EOF
6291 cat >> confdefs.h <<\EOF
6292 #define HAVE_CDE 1
6293 EOF
6294 }
6295
6296   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6297   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6298   with_tooltalk=yes # CDE requires Tooltalk
6299   need_motif=yes    # CDE requires Motif
6300 fi
6301
6302 test "$window_system" != "x11" && with_offix=no
6303 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6304   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6305   with_offix=no
6306 fi
6307 if test "$with_dragndrop" = no; then
6308   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6309   with_offix=no
6310 fi
6311 if test "$with_cde" = yes; then
6312   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6313   with_offix=no
6314 fi
6315 test -z "$with_offix" && with_offix=no
6316 if test "$with_offix" = "yes"; then
6317   { test "$extra_verbose" = "yes" && cat << \EOF
6318     Defining HAVE_OFFIX_DND
6319 EOF
6320 cat >> confdefs.h <<\EOF
6321 #define HAVE_OFFIX_DND 1
6322 EOF
6323 }
6324
6325   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6326   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6327 fi
6328
6329 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6330 echo "configure:6331: checking if drag and drop API is needed" >&5
6331 if test "$with_dragndrop" != "no" ; then
6332   if test -n "$dragndrop_proto" ; then
6333     with_dragndrop=yes
6334     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6335     { test "$extra_verbose" = "yes" && cat << \EOF
6336     Defining HAVE_DRAGNDROP
6337 EOF
6338 cat >> confdefs.h <<\EOF
6339 #define HAVE_DRAGNDROP 1
6340 EOF
6341 }
6342
6343     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6344   else
6345     with_dragndrop=no
6346     echo "$ac_t""no" 1>&6
6347   fi
6348 fi
6349
6350 echo "checking for LDAP" 1>&6
6351 echo "configure:6352: checking for LDAP" >&5
6352 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6353 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6354 echo "configure:6355: checking for ldap.h" >&5
6355
6356 cat > conftest.$ac_ext <<EOF
6357 #line 6358 "configure"
6358 #include "confdefs.h"
6359 #include <ldap.h>
6360 EOF
6361 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6362 { (eval echo configure:6363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6363 ac_err=`grep -v '^ *+' conftest.out`
6364 if test -z "$ac_err"; then
6365   rm -rf conftest*
6366   eval "ac_cv_header_$ac_safe=yes"
6367 else
6368   echo "$ac_err" >&5
6369   echo "configure: failed program was:" >&5
6370   cat conftest.$ac_ext >&5
6371   rm -rf conftest*
6372   eval "ac_cv_header_$ac_safe=no"
6373 fi
6374 rm -f conftest*
6375 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6376   echo "$ac_t""yes" 1>&6
6377   :
6378 else
6379   echo "$ac_t""no" 1>&6
6380 with_ldap=no
6381 fi
6382  }
6383 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6384 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6385 echo "configure:6386: checking for lber.h" >&5
6386
6387 cat > conftest.$ac_ext <<EOF
6388 #line 6389 "configure"
6389 #include "confdefs.h"
6390 #include <lber.h>
6391 EOF
6392 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6393 { (eval echo configure:6394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6394 ac_err=`grep -v '^ *+' conftest.out`
6395 if test -z "$ac_err"; then
6396   rm -rf conftest*
6397   eval "ac_cv_header_$ac_safe=yes"
6398 else
6399   echo "$ac_err" >&5
6400   echo "configure: failed program was:" >&5
6401   cat conftest.$ac_ext >&5
6402   rm -rf conftest*
6403   eval "ac_cv_header_$ac_safe=no"
6404 fi
6405 rm -f conftest*
6406 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6407   echo "$ac_t""yes" 1>&6
6408   :
6409 else
6410   echo "$ac_t""no" 1>&6
6411 with_ldap=no
6412 fi
6413  }
6414 if test "$with_ldap" != "no"; then
6415   test -z "$with_umich_ldap" && { 
6416 xe_msg_checking="for ldap_open in -lldap"
6417 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6418 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6419 echo "configure:6420: checking "$xe_msg_checking"" >&5
6420 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6421
6422 xe_check_libs=" -lldap -llber"
6423 cat > conftest.$ac_ext <<EOF
6424 #line 6425 "configure"
6425 #include "confdefs.h"
6426 /* Override any gcc2 internal prototype to avoid an error.  */
6427 /* We use char because int might match the return type of a gcc2
6428     builtin and then its argument prototype would still apply.  */
6429 char ldap_open();
6430
6431 int main() {
6432 ldap_open()
6433 ; return 0; }
6434 EOF
6435 if { (eval echo configure:6436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6436   rm -rf conftest*
6437   eval "ac_cv_lib_$ac_lib_var=yes"
6438 else
6439   echo "configure: failed program was:" >&5
6440   cat conftest.$ac_ext >&5
6441   rm -rf conftest*
6442   eval "ac_cv_lib_$ac_lib_var=no"
6443 fi
6444 rm -f conftest*
6445 xe_check_libs=""
6446
6447 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6448   echo "$ac_t""yes" 1>&6
6449   with_umich_ldap=yes
6450 else
6451   echo "$ac_t""no" 1>&6
6452 with_umich_ldap=no
6453 fi
6454
6455  }
6456   test "$with_umich_ldap" = "no" && { 
6457 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6458 echo "configure:6459: checking for ldap_set_option in -lldap10" >&5
6459 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6460
6461 xe_check_libs=" -lldap10 "
6462 cat > conftest.$ac_ext <<EOF
6463 #line 6464 "configure"
6464 #include "confdefs.h"
6465 /* Override any gcc2 internal prototype to avoid an error.  */
6466 /* We use char because int might match the return type of a gcc2
6467     builtin and then its argument prototype would still apply.  */
6468 char ldap_set_option();
6469
6470 int main() {
6471 ldap_set_option()
6472 ; return 0; }
6473 EOF
6474 if { (eval echo configure:6475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6475   rm -rf conftest*
6476   eval "ac_cv_lib_$ac_lib_var=yes"
6477 else
6478   echo "configure: failed program was:" >&5
6479   cat conftest.$ac_ext >&5
6480   rm -rf conftest*
6481   eval "ac_cv_lib_$ac_lib_var=no"
6482 fi
6483 rm -f conftest*
6484 xe_check_libs=""
6485
6486 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6487   echo "$ac_t""yes" 1>&6
6488   with_ns_ldap=yes
6489 else
6490   echo "$ac_t""no" 1>&6
6491 with_ns_ldap=no
6492 fi
6493
6494  }
6495   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6496 fi
6497 if test "$with_ldap" = "yes"; then
6498   { test "$extra_verbose" = "yes" && cat << \EOF
6499     Defining HAVE_LDAP
6500 EOF
6501 cat >> confdefs.h <<\EOF
6502 #define HAVE_LDAP 1
6503 EOF
6504 }
6505
6506   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6507    echo "    xemacs will be linked with \"eldap.o\""
6508  fi
6509   if test "$with_umich_ldap" = "yes" ; then
6510     { test "$extra_verbose" = "yes" && cat << \EOF
6511     Defining HAVE_UMICH_LDAP
6512 EOF
6513 cat >> confdefs.h <<\EOF
6514 #define HAVE_UMICH_LDAP 1
6515 EOF
6516 }
6517
6518     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6519     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6520   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6521     { test "$extra_verbose" = "yes" && cat << \EOF
6522     Defining HAVE_NS_LDAP
6523 EOF
6524 cat >> confdefs.h <<\EOF
6525 #define HAVE_NS_LDAP 1
6526 EOF
6527 }
6528
6529     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6530   elif test "$with_ldap" = "yes" ; then
6531     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6532   fi
6533 fi
6534
6535
6536 if test "$window_system" != "none"; then
6537   echo "checking for graphics libraries" 1>&6
6538 echo "configure:6539: checking for graphics libraries" >&5
6539
6540     xpm_problem=""
6541   if test -z "$with_xpm"; then
6542     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6543 echo "configure:6544: checking for Xpm - no older than 3.4f" >&5
6544     xe_check_libs=-lXpm
6545     cat > conftest.$ac_ext <<EOF
6546 #line 6547 "configure"
6547 #include "confdefs.h"
6548 #include <X11/xpm.h>
6549     int main(int c, char **v) {
6550     return c == 1 ? 0 :
6551       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6552       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6553 EOF
6554 if { (eval echo configure:6555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6555 then
6556   ./conftest dummy_arg; xpm_status=$?;
6557       if test "$xpm_status" = "0"; then
6558         with_xpm=yes;
6559       else
6560         with_xpm=no;
6561         if test "$xpm_status" = "1"; then
6562           xpm_problem="Xpm library version and header file version don't match!"
6563         elif test "$xpm_status" = "2"; then
6564           xpm_problem="Xpm library version is too old!"
6565         else
6566           xpm_problem="Internal xpm detection logic error!"
6567         fi
6568         echo "
6569 *** WARNING *** $xpm_problem
6570   I'm not touching that with a 10-foot pole!
6571   If you really want to use the installed version of Xpm, rerun
6572   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6573     fi
6574 else
6575   conftest_rc="$?"
6576   echo "configure: failed program was:" >&5
6577   cat conftest.$ac_ext >&5
6578   rm -fr conftest*
6579   with_xpm=no
6580 fi
6581 rm -fr conftest*
6582     xe_check_libs=
6583     echo "$ac_t""$with_xpm" 1>&6
6584   fi
6585   if test "$with_xpm" = "yes"; then
6586     { test "$extra_verbose" = "yes" && cat << \EOF
6587     Defining HAVE_XPM
6588 EOF
6589 cat >> confdefs.h <<\EOF
6590 #define HAVE_XPM 1
6591 EOF
6592 }
6593
6594     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6595     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6596 echo "configure:6597: checking for \"FOR_MSW\" xpm" >&5
6597     xe_check_libs=-lXpm
6598     cat > conftest.$ac_ext <<EOF
6599 #line 6600 "configure"
6600 #include "confdefs.h"
6601
6602 int main() {
6603 XpmCreatePixmapFromData()
6604 ; return 0; }
6605 EOF
6606 if { (eval echo configure:6607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6607   rm -rf conftest*
6608   xpm_for_msw=no
6609 else
6610   echo "configure: failed program was:" >&5
6611   cat conftest.$ac_ext >&5
6612   rm -rf conftest*
6613   xpm_for_msw=yes
6614 fi
6615 rm -f conftest*
6616     xe_check_libs=
6617     echo "$ac_t""$xpm_for_msw" 1>&6
6618     if test "$xpm_for_msw" = "yes"; then
6619       { test "$extra_verbose" = "yes" && cat << \EOF
6620     Defining FOR_MSW
6621 EOF
6622 cat >> confdefs.h <<\EOF
6623 #define FOR_MSW 1
6624 EOF
6625 }
6626
6627     fi
6628   fi
6629
6630     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6631 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6632 echo "configure:6633: checking for compface.h" >&5
6633
6634 cat > conftest.$ac_ext <<EOF
6635 #line 6636 "configure"
6636 #include "confdefs.h"
6637 #include <compface.h>
6638 EOF
6639 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6640 { (eval echo configure:6641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6641 ac_err=`grep -v '^ *+' conftest.out`
6642 if test -z "$ac_err"; then
6643   rm -rf conftest*
6644   eval "ac_cv_header_$ac_safe=yes"
6645 else
6646   echo "$ac_err" >&5
6647   echo "configure: failed program was:" >&5
6648   cat conftest.$ac_ext >&5
6649   rm -rf conftest*
6650   eval "ac_cv_header_$ac_safe=no"
6651 fi
6652 rm -f conftest*
6653 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6654   echo "$ac_t""yes" 1>&6
6655   :
6656 else
6657   echo "$ac_t""no" 1>&6
6658 with_xface=no
6659 fi
6660  }
6661   test -z "$with_xface" && { 
6662 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6663 echo "configure:6664: checking for UnGenFace in -lcompface" >&5
6664 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6665
6666 xe_check_libs=" -lcompface "
6667 cat > conftest.$ac_ext <<EOF
6668 #line 6669 "configure"
6669 #include "confdefs.h"
6670 /* Override any gcc2 internal prototype to avoid an error.  */
6671 /* We use char because int might match the return type of a gcc2
6672     builtin and then its argument prototype would still apply.  */
6673 char UnGenFace();
6674
6675 int main() {
6676 UnGenFace()
6677 ; return 0; }
6678 EOF
6679 if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6680   rm -rf conftest*
6681   eval "ac_cv_lib_$ac_lib_var=yes"
6682 else
6683   echo "configure: failed program was:" >&5
6684   cat conftest.$ac_ext >&5
6685   rm -rf conftest*
6686   eval "ac_cv_lib_$ac_lib_var=no"
6687 fi
6688 rm -f conftest*
6689 xe_check_libs=""
6690
6691 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6692   echo "$ac_t""yes" 1>&6
6693   : 
6694 else
6695   echo "$ac_t""no" 1>&6
6696 with_xface=no
6697 fi
6698
6699  }
6700   test -z "$with_xface" && with_xface=yes
6701   if test "$with_xface" = "yes"; then
6702     { test "$extra_verbose" = "yes" && cat << \EOF
6703     Defining HAVE_XFACE
6704 EOF
6705 cat >> confdefs.h <<\EOF
6706 #define HAVE_XFACE 1
6707 EOF
6708 }
6709
6710     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
6711   fi
6712
6713         if test "$with_gif" != "no"; then
6714     with_gif="yes"
6715     { test "$extra_verbose" = "yes" && cat << \EOF
6716     Defining HAVE_GIF
6717 EOF
6718 cat >> confdefs.h <<\EOF
6719 #define HAVE_GIF 1
6720 EOF
6721 }
6722
6723     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6724    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6725  fi
6726   fi
6727
6728       if test "$with_png $with_tiff" != "no no"; then
6729     
6730 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6731 echo "configure:6732: checking for inflate in -lc" >&5
6732 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6733
6734 xe_check_libs=" -lc "
6735 cat > conftest.$ac_ext <<EOF
6736 #line 6737 "configure"
6737 #include "confdefs.h"
6738 /* Override any gcc2 internal prototype to avoid an error.  */
6739 /* We use char because int might match the return type of a gcc2
6740     builtin and then its argument prototype would still apply.  */
6741 char inflate();
6742
6743 int main() {
6744 inflate()
6745 ; return 0; }
6746 EOF
6747 if { (eval echo configure:6748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6748   rm -rf conftest*
6749   eval "ac_cv_lib_$ac_lib_var=yes"
6750 else
6751   echo "configure: failed program was:" >&5
6752   cat conftest.$ac_ext >&5
6753   rm -rf conftest*
6754   eval "ac_cv_lib_$ac_lib_var=no"
6755 fi
6756 rm -f conftest*
6757 xe_check_libs=""
6758
6759 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6760   echo "$ac_t""yes" 1>&6
6761   :
6762 else
6763   echo "$ac_t""no" 1>&6
6764
6765 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6766 echo "configure:6767: checking for inflate in -lz" >&5
6767 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6768
6769 xe_check_libs=" -lz "
6770 cat > conftest.$ac_ext <<EOF
6771 #line 6772 "configure"
6772 #include "confdefs.h"
6773 /* Override any gcc2 internal prototype to avoid an error.  */
6774 /* We use char because int might match the return type of a gcc2
6775     builtin and then its argument prototype would still apply.  */
6776 char inflate();
6777
6778 int main() {
6779 inflate()
6780 ; return 0; }
6781 EOF
6782 if { (eval echo configure:6783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6783   rm -rf conftest*
6784   eval "ac_cv_lib_$ac_lib_var=yes"
6785 else
6786   echo "configure: failed program was:" >&5
6787   cat conftest.$ac_ext >&5
6788   rm -rf conftest*
6789   eval "ac_cv_lib_$ac_lib_var=no"
6790 fi
6791 rm -f conftest*
6792 xe_check_libs=""
6793
6794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6795   echo "$ac_t""yes" 1>&6
6796   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6797 else
6798   echo "$ac_t""no" 1>&6
6799
6800 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6801 echo "configure:6802: checking for inflate in -lgz" >&5
6802 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6803
6804 xe_check_libs=" -lgz "
6805 cat > conftest.$ac_ext <<EOF
6806 #line 6807 "configure"
6807 #include "confdefs.h"
6808 /* Override any gcc2 internal prototype to avoid an error.  */
6809 /* We use char because int might match the return type of a gcc2
6810     builtin and then its argument prototype would still apply.  */
6811 char inflate();
6812
6813 int main() {
6814 inflate()
6815 ; return 0; }
6816 EOF
6817 if { (eval echo configure:6818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6818   rm -rf conftest*
6819   eval "ac_cv_lib_$ac_lib_var=yes"
6820 else
6821   echo "configure: failed program was:" >&5
6822   cat conftest.$ac_ext >&5
6823   rm -rf conftest*
6824   eval "ac_cv_lib_$ac_lib_var=no"
6825 fi
6826 rm -f conftest*
6827 xe_check_libs=""
6828
6829 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6830   echo "$ac_t""yes" 1>&6
6831   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6832 else
6833   echo "$ac_t""no" 1>&6
6834 fi
6835
6836
6837 fi
6838
6839
6840 fi
6841
6842
6843   fi
6844
6845     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6846 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6847 echo "configure:6848: checking for jpeglib.h" >&5
6848
6849 cat > conftest.$ac_ext <<EOF
6850 #line 6851 "configure"
6851 #include "confdefs.h"
6852 #include <jpeglib.h>
6853 EOF
6854 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6855 { (eval echo configure:6856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6856 ac_err=`grep -v '^ *+' conftest.out`
6857 if test -z "$ac_err"; then
6858   rm -rf conftest*
6859   eval "ac_cv_header_$ac_safe=yes"
6860 else
6861   echo "$ac_err" >&5
6862   echo "configure: failed program was:" >&5
6863   cat conftest.$ac_ext >&5
6864   rm -rf conftest*
6865   eval "ac_cv_header_$ac_safe=no"
6866 fi
6867 rm -f conftest*
6868 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6869   echo "$ac_t""yes" 1>&6
6870   :
6871 else
6872   echo "$ac_t""no" 1>&6
6873 with_jpeg=no
6874 fi
6875  }
6876   test -z "$with_jpeg" && { 
6877 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
6878 echo "configure:6879: checking for jpeg_destroy_decompress in -ljpeg" >&5
6879 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
6880
6881 xe_check_libs=" -ljpeg "
6882 cat > conftest.$ac_ext <<EOF
6883 #line 6884 "configure"
6884 #include "confdefs.h"
6885 /* Override any gcc2 internal prototype to avoid an error.  */
6886 /* We use char because int might match the return type of a gcc2
6887     builtin and then its argument prototype would still apply.  */
6888 char jpeg_destroy_decompress();
6889
6890 int main() {
6891 jpeg_destroy_decompress()
6892 ; return 0; }
6893 EOF
6894 if { (eval echo configure:6895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6895   rm -rf conftest*
6896   eval "ac_cv_lib_$ac_lib_var=yes"
6897 else
6898   echo "configure: failed program was:" >&5
6899   cat conftest.$ac_ext >&5
6900   rm -rf conftest*
6901   eval "ac_cv_lib_$ac_lib_var=no"
6902 fi
6903 rm -f conftest*
6904 xe_check_libs=""
6905
6906 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6907   echo "$ac_t""yes" 1>&6
6908   :
6909 else
6910   echo "$ac_t""no" 1>&6
6911 with_jpeg=no
6912 fi
6913
6914  }
6915   test -z "$with_jpeg" && with_jpeg=yes
6916   if test "$with_jpeg" = "yes"; then
6917     { test "$extra_verbose" = "yes" && cat << \EOF
6918     Defining HAVE_JPEG
6919 EOF
6920 cat >> confdefs.h <<\EOF
6921 #define HAVE_JPEG 1
6922 EOF
6923 }
6924
6925     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
6926   fi
6927
6928     png_problem=""
6929   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
6930 echo "configure:6931: checking for pow" >&5
6931
6932 cat > conftest.$ac_ext <<EOF
6933 #line 6934 "configure"
6934 #include "confdefs.h"
6935 /* System header to define __stub macros and hopefully few prototypes,
6936     which can conflict with char pow(); below.  */
6937 #include <assert.h>
6938 /* Override any gcc2 internal prototype to avoid an error.  */
6939 /* We use char because int might match the return type of a gcc2
6940     builtin and then its argument prototype would still apply.  */
6941 char pow();
6942
6943 int main() {
6944
6945 /* The GNU C library defines this for functions which it implements
6946     to always fail with ENOSYS.  Some functions are actually named
6947     something starting with __ and the normal name is an alias.  */
6948 #if defined (__stub_pow) || defined (__stub___pow)
6949 choke me
6950 #else
6951 pow();
6952 #endif
6953
6954 ; return 0; }
6955 EOF
6956 if { (eval echo configure:6957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6957   rm -rf conftest*
6958   eval "ac_cv_func_pow=yes"
6959 else
6960   echo "configure: failed program was:" >&5
6961   cat conftest.$ac_ext >&5
6962   rm -rf conftest*
6963   eval "ac_cv_func_pow=no"
6964 fi
6965 rm -f conftest*
6966
6967 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
6968   echo "$ac_t""yes" 1>&6
6969   :
6970 else
6971   echo "$ac_t""no" 1>&6
6972 with_png=no
6973 fi
6974  }
6975   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
6976 echo $ac_n "checking for png.h""... $ac_c" 1>&6
6977 echo "configure:6978: checking for png.h" >&5
6978
6979 cat > conftest.$ac_ext <<EOF
6980 #line 6981 "configure"
6981 #include "confdefs.h"
6982 #include <png.h>
6983 EOF
6984 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6985 { (eval echo configure:6986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6986 ac_err=`grep -v '^ *+' conftest.out`
6987 if test -z "$ac_err"; then
6988   rm -rf conftest*
6989   eval "ac_cv_header_$ac_safe=yes"
6990 else
6991   echo "$ac_err" >&5
6992   echo "configure: failed program was:" >&5
6993   cat conftest.$ac_ext >&5
6994   rm -rf conftest*
6995   eval "ac_cv_header_$ac_safe=no"
6996 fi
6997 rm -f conftest*
6998 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6999   echo "$ac_t""yes" 1>&6
7000   :
7001 else
7002   echo "$ac_t""no" 1>&6
7003 with_png=no
7004 fi
7005  }
7006   test -z "$with_png" && { 
7007 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7008 echo "configure:7009: checking for png_read_image in -lpng" >&5
7009 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7010
7011 xe_check_libs=" -lpng "
7012 cat > conftest.$ac_ext <<EOF
7013 #line 7014 "configure"
7014 #include "confdefs.h"
7015 /* Override any gcc2 internal prototype to avoid an error.  */
7016 /* We use char because int might match the return type of a gcc2
7017     builtin and then its argument prototype would still apply.  */
7018 char png_read_image();
7019
7020 int main() {
7021 png_read_image()
7022 ; return 0; }
7023 EOF
7024 if { (eval echo configure:7025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7025   rm -rf conftest*
7026   eval "ac_cv_lib_$ac_lib_var=yes"
7027 else
7028   echo "configure: failed program was:" >&5
7029   cat conftest.$ac_ext >&5
7030   rm -rf conftest*
7031   eval "ac_cv_lib_$ac_lib_var=no"
7032 fi
7033 rm -f conftest*
7034 xe_check_libs=""
7035
7036 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7037   echo "$ac_t""yes" 1>&6
7038   :
7039 else
7040   echo "$ac_t""no" 1>&6
7041 with_png=no
7042 fi
7043
7044  }
7045   if test -z "$with_png"; then
7046     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7047 echo "configure:7048: checking for workable png version information" >&5
7048     xe_check_libs="-lpng -lz"
7049     cat > conftest.$ac_ext <<EOF
7050 #line 7051 "configure"
7051 #include "confdefs.h"
7052 #include <png.h>
7053     int main(int c, char **v) {
7054     if (c == 1) return 0;
7055     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7056     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7057 EOF
7058 if { (eval echo configure:7059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7059 then
7060   ./conftest dummy_arg; png_status=$?;
7061       if test "$png_status" = "0"; then
7062         with_png=yes;
7063       else
7064         with_png=no;
7065         if test "$png_status" = "1"; then
7066           png_problem="PNG library version and header file don't match!"
7067         elif test "$png_status" = "2"; then
7068           png_problem="PNG library version too old (pre 1.0.2)!"
7069         fi
7070         echo "
7071 *** WARNING *** $png_problem
7072   I'm not touching that with a 10-foot pole!
7073   If you really want to use the installed version of libPNG, rerun
7074   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7075     fi
7076 else
7077   conftest_rc="$?"
7078   echo "configure: failed program was:" >&5
7079   cat conftest.$ac_ext >&5
7080   rm -fr conftest*
7081   with_png=no
7082 fi
7083 rm -fr conftest*
7084     xe_check_libs=
7085     echo "$ac_t""$with_png" 1>&6
7086   fi
7087   if test "$with_png" = "yes"; then
7088     { test "$extra_verbose" = "yes" && cat << \EOF
7089     Defining HAVE_PNG
7090 EOF
7091 cat >> confdefs.h <<\EOF
7092 #define HAVE_PNG 1
7093 EOF
7094 }
7095
7096     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7097   fi
7098
7099     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7100 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7101 echo "configure:7102: checking for tiffio.h" >&5
7102
7103 cat > conftest.$ac_ext <<EOF
7104 #line 7105 "configure"
7105 #include "confdefs.h"
7106 #include <tiffio.h>
7107 EOF
7108 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7109 { (eval echo configure:7110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7110 ac_err=`grep -v '^ *+' conftest.out`
7111 if test -z "$ac_err"; then
7112   rm -rf conftest*
7113   eval "ac_cv_header_$ac_safe=yes"
7114 else
7115   echo "$ac_err" >&5
7116   echo "configure: failed program was:" >&5
7117   cat conftest.$ac_ext >&5
7118   rm -rf conftest*
7119   eval "ac_cv_header_$ac_safe=no"
7120 fi
7121 rm -f conftest*
7122 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7123   echo "$ac_t""yes" 1>&6
7124   :
7125 else
7126   echo "$ac_t""no" 1>&6
7127 with_tiff=no
7128 fi
7129  }
7130   test -z "$with_tiff" && { 
7131 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7132 echo "configure:7133: checking for TIFFClientOpen in -ltiff" >&5
7133 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7134
7135 xe_check_libs=" -ltiff "
7136 cat > conftest.$ac_ext <<EOF
7137 #line 7138 "configure"
7138 #include "confdefs.h"
7139 /* Override any gcc2 internal prototype to avoid an error.  */
7140 /* We use char because int might match the return type of a gcc2
7141     builtin and then its argument prototype would still apply.  */
7142 char TIFFClientOpen();
7143
7144 int main() {
7145 TIFFClientOpen()
7146 ; return 0; }
7147 EOF
7148 if { (eval echo configure:7149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7149   rm -rf conftest*
7150   eval "ac_cv_lib_$ac_lib_var=yes"
7151 else
7152   echo "configure: failed program was:" >&5
7153   cat conftest.$ac_ext >&5
7154   rm -rf conftest*
7155   eval "ac_cv_lib_$ac_lib_var=no"
7156 fi
7157 rm -f conftest*
7158 xe_check_libs=""
7159
7160 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7161   echo "$ac_t""yes" 1>&6
7162   :
7163 else
7164   echo "$ac_t""no" 1>&6
7165 with_tiff=no
7166 fi
7167
7168  }
7169   test -z "$with_tiff" && with_tiff=yes
7170   if test "$with_tiff" = "yes"; then
7171     { test "$extra_verbose" = "yes" && cat << \EOF
7172     Defining HAVE_TIFF
7173 EOF
7174 cat >> confdefs.h <<\EOF
7175 #define HAVE_TIFF 1
7176 EOF
7177 }
7178
7179     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7180   fi
7181 fi
7182
7183
7184 if test "$with_x11" = "yes"; then
7185
7186   echo "checking for X11 graphics libraries" 1>&6
7187 echo "configure:7188: checking for X11 graphics libraries" >&5
7188
7189     
7190 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7191 echo "configure:7192: checking for XawScrollbarSetThumb in -lXaw" >&5
7192 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7193
7194 xe_check_libs=" -lXaw "
7195 cat > conftest.$ac_ext <<EOF
7196 #line 7197 "configure"
7197 #include "confdefs.h"
7198 /* Override any gcc2 internal prototype to avoid an error.  */
7199 /* We use char because int might match the return type of a gcc2
7200     builtin and then its argument prototype would still apply.  */
7201 char XawScrollbarSetThumb();
7202
7203 int main() {
7204 XawScrollbarSetThumb()
7205 ; return 0; }
7206 EOF
7207 if { (eval echo configure:7208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7208   rm -rf conftest*
7209   eval "ac_cv_lib_$ac_lib_var=yes"
7210 else
7211   echo "configure: failed program was:" >&5
7212   cat conftest.$ac_ext >&5
7213   rm -rf conftest*
7214   eval "ac_cv_lib_$ac_lib_var=no"
7215 fi
7216 rm -f conftest*
7217 xe_check_libs=""
7218
7219 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7220   echo "$ac_t""yes" 1>&6
7221   have_xaw=yes
7222 else
7223   echo "$ac_t""no" 1>&6
7224 have_xaw=no
7225 fi
7226
7227
7228                     
7229     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7230 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7231 echo "configure:7232: checking for Xm/Xm.h" >&5
7232
7233 cat > conftest.$ac_ext <<EOF
7234 #line 7235 "configure"
7235 #include "confdefs.h"
7236 #include <Xm/Xm.h>
7237 EOF
7238 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7239 { (eval echo configure:7240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7240 ac_err=`grep -v '^ *+' conftest.out`
7241 if test -z "$ac_err"; then
7242   rm -rf conftest*
7243   eval "ac_cv_header_$ac_safe=yes"
7244 else
7245   echo "$ac_err" >&5
7246   echo "configure: failed program was:" >&5
7247   cat conftest.$ac_ext >&5
7248   rm -rf conftest*
7249   eval "ac_cv_header_$ac_safe=no"
7250 fi
7251 rm -f conftest*
7252 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7253   echo "$ac_t""yes" 1>&6
7254   
7255 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7256 echo "configure:7257: checking for XmStringFree in -lXm" >&5
7257 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7258
7259 xe_check_libs=" -lXm "
7260 cat > conftest.$ac_ext <<EOF
7261 #line 7262 "configure"
7262 #include "confdefs.h"
7263 /* Override any gcc2 internal prototype to avoid an error.  */
7264 /* We use char because int might match the return type of a gcc2
7265     builtin and then its argument prototype would still apply.  */
7266 char XmStringFree();
7267
7268 int main() {
7269 XmStringFree()
7270 ; return 0; }
7271 EOF
7272 if { (eval echo configure:7273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7273   rm -rf conftest*
7274   eval "ac_cv_lib_$ac_lib_var=yes"
7275 else
7276   echo "configure: failed program was:" >&5
7277   cat conftest.$ac_ext >&5
7278   rm -rf conftest*
7279   eval "ac_cv_lib_$ac_lib_var=no"
7280 fi
7281 rm -f conftest*
7282 xe_check_libs=""
7283
7284 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7285   echo "$ac_t""yes" 1>&6
7286   have_motif=yes
7287 else
7288   echo "$ac_t""no" 1>&6
7289 have_motif=no
7290 fi
7291
7292
7293 else
7294   echo "$ac_t""no" 1>&6
7295 have_motif=no
7296 fi
7297
7298
7299   if test "$have_motif" = "yes"; then
7300         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7301 echo "configure:7302: checking for Lesstif" >&5
7302     cat > conftest.$ac_ext <<EOF
7303 #line 7304 "configure"
7304 #include "confdefs.h"
7305 #include <Xm/Xm.h>
7306 #ifdef LESSTIF_VERSION
7307 yes
7308 #endif
7309
7310 EOF
7311 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7312   egrep "yes" >/dev/null 2>&1; then
7313   rm -rf conftest*
7314   have_lesstif=yes
7315 else
7316   rm -rf conftest*
7317   have_lesstif=no
7318 fi
7319 rm -f conftest*
7320
7321   echo "$ac_t""$have_lesstif" 1>&6
7322   fi
7323
7324 fi 
7325
7326 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7327   with_menubars="lucid" ;;
7328 esac
7329 case "$with_dialogs" in "" | "yes" | "lucid" )
7330   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7331   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7332   else with_dialogs=no
7333   fi ;;
7334 esac
7335 case "$with_scrollbars" in "" | "yes" )
7336   with_scrollbars="lucid" ;;
7337 esac
7338
7339 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7340
7341 case "$all_widgets" in *athena* )
7342   { test "$extra_verbose" = "yes" && cat << \EOF
7343     Defining LWLIB_USES_ATHENA
7344 EOF
7345 cat >> confdefs.h <<\EOF
7346 #define LWLIB_USES_ATHENA 1
7347 EOF
7348 }
7349
7350   { test "$extra_verbose" = "yes" && cat << \EOF
7351     Defining NEED_ATHENA
7352 EOF
7353 cat >> confdefs.h <<\EOF
7354 #define NEED_ATHENA 1
7355 EOF
7356 }
7357
7358   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7359   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7360 esac
7361
7362 case "$all_widgets" in *motif* )
7363   { test "$extra_verbose" = "yes" && cat << \EOF
7364     Defining LWLIB_USES_MOTIF
7365 EOF
7366 cat >> confdefs.h <<\EOF
7367 #define LWLIB_USES_MOTIF 1
7368 EOF
7369 }
7370
7371   { test "$extra_verbose" = "yes" && cat << \EOF
7372     Defining NEED_MOTIF
7373 EOF
7374 cat >> confdefs.h <<\EOF
7375 #define NEED_MOTIF 1
7376 EOF
7377 }
7378
7379   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7380   need_motif=yes ;;
7381 esac
7382
7383 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7384 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7385 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7386 case "$all_widgets" in *lucid* )
7387   { test "$extra_verbose" = "yes" && cat << \EOF
7388     Defining NEED_LUCID
7389 EOF
7390 cat >> confdefs.h <<\EOF
7391 #define NEED_LUCID 1
7392 EOF
7393 }
7394
7395   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7396 esac
7397
7398
7399
7400 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7401     Defining LWLIB_SCROLLBARS_ATHENA
7402 EOF
7403 cat >> confdefs.h <<\EOF
7404 #define LWLIB_SCROLLBARS_ATHENA 1
7405 EOF
7406 }
7407 ;; esac
7408 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7409     Defining LWLIB_DIALOGS_ATHENA
7410 EOF
7411 cat >> confdefs.h <<\EOF
7412 #define LWLIB_DIALOGS_ATHENA 1
7413 EOF
7414 }
7415    ;; esac
7416 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7417     Defining LWLIB_SCROLLBARS_ATHENA3D
7418 EOF
7419 cat >> confdefs.h <<\EOF
7420 #define LWLIB_SCROLLBARS_ATHENA3D 1
7421 EOF
7422 }
7423
7424 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7425     Defining LWLIB_DIALOGS_ATHENA3D
7426 EOF
7427 cat >> confdefs.h <<\EOF
7428 #define LWLIB_DIALOGS_ATHENA3D 1
7429 EOF
7430 }
7431
7432
7433 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7434     Defining HAVE_MENUBARS
7435 EOF
7436 cat >> confdefs.h <<\EOF
7437 #define HAVE_MENUBARS 1
7438 EOF
7439 }
7440
7441 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7442     Defining HAVE_SCROLLBARS
7443 EOF
7444 cat >> confdefs.h <<\EOF
7445 #define HAVE_SCROLLBARS 1
7446 EOF
7447 }
7448
7449 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7450     Defining HAVE_DIALOGS
7451 EOF
7452 cat >> confdefs.h <<\EOF
7453 #define HAVE_DIALOGS 1
7454 EOF
7455 }
7456
7457 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7458     Defining HAVE_TOOLBARS
7459 EOF
7460 cat >> confdefs.h <<\EOF
7461 #define HAVE_TOOLBARS 1
7462 EOF
7463 }
7464
7465
7466 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7467     Defining LWLIB_MENUBARS_LUCID
7468 EOF
7469 cat >> confdefs.h <<\EOF
7470 #define LWLIB_MENUBARS_LUCID 1
7471 EOF
7472 }
7473
7474 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7475     Defining LWLIB_SCROLLBARS_LUCID
7476 EOF
7477 cat >> confdefs.h <<\EOF
7478 #define LWLIB_SCROLLBARS_LUCID 1
7479 EOF
7480 }
7481
7482
7483 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7484     Defining LWLIB_MENUBARS_MOTIF
7485 EOF
7486 cat >> confdefs.h <<\EOF
7487 #define LWLIB_MENUBARS_MOTIF 1
7488 EOF
7489 }
7490
7491 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7492     Defining LWLIB_SCROLLBARS_MOTIF
7493 EOF
7494 cat >> confdefs.h <<\EOF
7495 #define LWLIB_SCROLLBARS_MOTIF 1
7496 EOF
7497 }
7498
7499 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7500     Defining LWLIB_DIALOGS_MOTIF
7501 EOF
7502 cat >> confdefs.h <<\EOF
7503 #define LWLIB_DIALOGS_MOTIF 1
7504 EOF
7505 }
7506
7507
7508 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7509    echo "    xemacs will be linked with \"menubar.o\""
7510  fi
7511 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7512    echo "    xemacs will be linked with \"scrollbar.o\""
7513  fi
7514 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7515    echo "    xemacs will be linked with \"dialog.o\""
7516  fi
7517 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7518    echo "    xemacs will be linked with \"toolbar.o\""
7519  fi
7520
7521 if test "$with_x11" = "yes"; then
7522   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7523    echo "    xemacs will be linked with \"menubar-x.o\""
7524  fi
7525   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7526    echo "    xemacs will be linked with \"scrollbar-x.o\""
7527  fi
7528   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7529    echo "    xemacs will be linked with \"dialog-x.o\""
7530  fi
7531   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7532    echo "    xemacs will be linked with \"toolbar-x.o\""
7533  fi
7534   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7535    echo "    xemacs will be linked with \"gui-x.o\""
7536  fi
7537 else
7538   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7539     echo "Attempt to Build NAS sound without X"
7540     echo "Please remove NAS configuration or build with X"
7541     exit 1
7542   fi
7543 fi
7544
7545 test "$use_minimal_tagbits" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
7546     Defining USE_MINIMAL_TAGBITS
7547 EOF
7548 cat >> confdefs.h <<\EOF
7549 #define USE_MINIMAL_TAGBITS 1
7550 EOF
7551 }
7552
7553 test "$use_indexed_lrecord_implementation" = "yes" && \
7554   { test "$extra_verbose" = "yes" && cat << \EOF
7555     Defining USE_INDEXED_LRECORD_IMPLEMENTATION
7556 EOF
7557 cat >> confdefs.h <<\EOF
7558 #define USE_INDEXED_LRECORD_IMPLEMENTATION 1
7559 EOF
7560 }
7561
7562
7563
7564 test -z "$with_mule" && with_mule=no
7565 test -z "$with_file_coding" && with_file_coding=no
7566
7567
7568 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7569   { test "$extra_verbose" = "yes" && cat << \EOF
7570     Defining FILE_CODING
7571 EOF
7572 cat >> confdefs.h <<\EOF
7573 #define FILE_CODING 1
7574 EOF
7575 }
7576
7577   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7578    echo "    xemacs will be linked with \"file-coding.o\""
7579  fi
7580 fi
7581
7582 if test "$with_mule" = "yes" ; then
7583   echo "checking for Mule-related features" 1>&6
7584 echo "configure:7585: checking for Mule-related features" >&5
7585   { test "$extra_verbose" = "yes" && cat << \EOF
7586     Defining MULE
7587 EOF
7588 cat >> confdefs.h <<\EOF
7589 #define MULE 1
7590 EOF
7591 }
7592
7593   { test "$extra_verbose" = "yes" && cat << \EOF
7594     Defining FILE_CODING
7595 EOF
7596 cat >> confdefs.h <<\EOF
7597 #define FILE_CODING 1
7598 EOF
7599 }
7600
7601   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7602    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o\""
7603  fi
7604
7605     for ac_hdr in libintl.h
7606 do
7607 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7608 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7609 echo "configure:7610: checking for $ac_hdr" >&5
7610
7611 cat > conftest.$ac_ext <<EOF
7612 #line 7613 "configure"
7613 #include "confdefs.h"
7614 #include <$ac_hdr>
7615 EOF
7616 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7617 { (eval echo configure:7618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7618 ac_err=`grep -v '^ *+' conftest.out`
7619 if test -z "$ac_err"; then
7620   rm -rf conftest*
7621   eval "ac_cv_header_$ac_safe=yes"
7622 else
7623   echo "$ac_err" >&5
7624   echo "configure: failed program was:" >&5
7625   cat conftest.$ac_ext >&5
7626   rm -rf conftest*
7627   eval "ac_cv_header_$ac_safe=no"
7628 fi
7629 rm -f conftest*
7630 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7631   echo "$ac_t""yes" 1>&6
7632     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7633   { test "$extra_verbose" = "yes" && cat << EOF
7634     Defining $ac_tr_hdr
7635 EOF
7636 cat >> confdefs.h <<EOF
7637 #define $ac_tr_hdr 1
7638 EOF
7639 }
7640  
7641 else
7642   echo "$ac_t""no" 1>&6
7643 fi
7644 done
7645
7646   
7647 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7648 echo "configure:7649: checking for strerror in -lintl" >&5
7649 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7650
7651 xe_check_libs=" -lintl "
7652 cat > conftest.$ac_ext <<EOF
7653 #line 7654 "configure"
7654 #include "confdefs.h"
7655 /* Override any gcc2 internal prototype to avoid an error.  */
7656 /* We use char because int might match the return type of a gcc2
7657     builtin and then its argument prototype would still apply.  */
7658 char strerror();
7659
7660 int main() {
7661 strerror()
7662 ; return 0; }
7663 EOF
7664 if { (eval echo configure:7665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7665   rm -rf conftest*
7666   eval "ac_cv_lib_$ac_lib_var=yes"
7667 else
7668   echo "configure: failed program was:" >&5
7669   cat conftest.$ac_ext >&5
7670   rm -rf conftest*
7671   eval "ac_cv_lib_$ac_lib_var=no"
7672 fi
7673 rm -f conftest*
7674 xe_check_libs=""
7675
7676 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7677   echo "$ac_t""yes" 1>&6
7678     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7679     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7680   { test "$extra_verbose" = "yes" && cat << EOF
7681     Defining $ac_tr_lib
7682 EOF
7683 cat >> confdefs.h <<EOF
7684 #define $ac_tr_lib 1
7685 EOF
7686 }
7687
7688   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7689
7690 else
7691   echo "$ac_t""no" 1>&6
7692 fi
7693
7694
7695
7696   echo "checking for Mule input methods" 1>&6
7697 echo "configure:7698: checking for Mule input methods" >&5
7698         case "$with_xim" in "" | "yes" )
7699     echo "checking for XIM" 1>&6
7700 echo "configure:7701: checking for XIM" >&5
7701         if test "$have_lesstif" = "yes"; then with_xim=xlib
7702     else 
7703 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7704 echo "configure:7705: checking for XmImMbLookupString in -lXm" >&5
7705 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7706
7707 xe_check_libs=" -lXm "
7708 cat > conftest.$ac_ext <<EOF
7709 #line 7710 "configure"
7710 #include "confdefs.h"
7711 /* Override any gcc2 internal prototype to avoid an error.  */
7712 /* We use char because int might match the return type of a gcc2
7713     builtin and then its argument prototype would still apply.  */
7714 char XmImMbLookupString();
7715
7716 int main() {
7717 XmImMbLookupString()
7718 ; return 0; }
7719 EOF
7720 if { (eval echo configure:7721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7721   rm -rf conftest*
7722   eval "ac_cv_lib_$ac_lib_var=yes"
7723 else
7724   echo "configure: failed program was:" >&5
7725   cat conftest.$ac_ext >&5
7726   rm -rf conftest*
7727   eval "ac_cv_lib_$ac_lib_var=no"
7728 fi
7729 rm -f conftest*
7730 xe_check_libs=""
7731
7732 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7733   echo "$ac_t""yes" 1>&6
7734   with_xim=motif
7735 else
7736   echo "$ac_t""no" 1>&6
7737 with_xim=xlib
7738 fi
7739
7740
7741     fi
7742   esac
7743   if test "$with_xim" != "no"; then
7744     { test "$extra_verbose" = "yes" && cat << \EOF
7745     Defining HAVE_XIM
7746 EOF
7747 cat >> confdefs.h <<\EOF
7748 #define HAVE_XIM 1
7749 EOF
7750 }
7751
7752     if test "$with_xim" = "xlib"; then
7753       { test "$extra_verbose" = "yes" && cat << \EOF
7754     Defining XIM_XLIB
7755 EOF
7756 cat >> confdefs.h <<\EOF
7757 #define XIM_XLIB 1
7758 EOF
7759 }
7760
7761       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7762    echo "    xemacs will be linked with \"input-method-xlib.o\""
7763  fi
7764     fi
7765     if test "$with_xim" = "motif"; then
7766       { test "$extra_verbose" = "yes" && cat << \EOF
7767     Defining XIM_MOTIF
7768 EOF
7769 cat >> confdefs.h <<\EOF
7770 #define XIM_MOTIF 1
7771 EOF
7772 }
7773
7774       need_motif=yes
7775       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7776    echo "    xemacs will be linked with \"input-method-motif.o\""
7777  fi
7778     fi
7779     if test "$with_xim" = "motif"; then
7780       with_xfs=no
7781     fi
7782   fi
7783
7784     if test "$with_xfs" = "yes" ; then
7785     echo "checking for XFontSet" 1>&6
7786 echo "configure:7787: checking for XFontSet" >&5
7787     
7788 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7789 echo "configure:7790: checking for XmbDrawString in -lX11" >&5
7790 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7791
7792 xe_check_libs=" -lX11 "
7793 cat > conftest.$ac_ext <<EOF
7794 #line 7795 "configure"
7795 #include "confdefs.h"
7796 /* Override any gcc2 internal prototype to avoid an error.  */
7797 /* We use char because int might match the return type of a gcc2
7798     builtin and then its argument prototype would still apply.  */
7799 char XmbDrawString();
7800
7801 int main() {
7802 XmbDrawString()
7803 ; return 0; }
7804 EOF
7805 if { (eval echo configure:7806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7806   rm -rf conftest*
7807   eval "ac_cv_lib_$ac_lib_var=yes"
7808 else
7809   echo "configure: failed program was:" >&5
7810   cat conftest.$ac_ext >&5
7811   rm -rf conftest*
7812   eval "ac_cv_lib_$ac_lib_var=no"
7813 fi
7814 rm -f conftest*
7815 xe_check_libs=""
7816
7817 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7818   echo "$ac_t""yes" 1>&6
7819   :
7820 else
7821   echo "$ac_t""no" 1>&6
7822 with_xfs=no
7823 fi
7824
7825
7826     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7827       { test "$extra_verbose" = "yes" && cat << \EOF
7828     Defining USE_XFONTSET
7829 EOF
7830 cat >> confdefs.h <<\EOF
7831 #define USE_XFONTSET 1
7832 EOF
7833 }
7834
7835       if test "$with_xim" = "no" ; then
7836         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
7837    echo "    xemacs will be linked with \"input-method-xfs.o\""
7838  fi
7839       fi
7840     fi
7841   fi 
7842     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
7843   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
7844 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
7845 echo "configure:7846: checking for wnn/jllib.h" >&5
7846
7847 cat > conftest.$ac_ext <<EOF
7848 #line 7849 "configure"
7849 #include "confdefs.h"
7850 #include <wnn/jllib.h>
7851 EOF
7852 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7853 { (eval echo configure:7854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7854 ac_err=`grep -v '^ *+' conftest.out`
7855 if test -z "$ac_err"; then
7856   rm -rf conftest*
7857   eval "ac_cv_header_$ac_safe=yes"
7858 else
7859   echo "$ac_err" >&5
7860   echo "configure: failed program was:" >&5
7861   cat conftest.$ac_ext >&5
7862   rm -rf conftest*
7863   eval "ac_cv_header_$ac_safe=no"
7864 fi
7865 rm -f conftest*
7866 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7867   echo "$ac_t""yes" 1>&6
7868   :
7869 else
7870   echo "$ac_t""no" 1>&6
7871 with_wnn=no
7872 fi
7873  }
7874     if test "$with_wnn" != "no"; then
7875     for ac_func in crypt
7876 do
7877 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7878 echo "configure:7879: checking for $ac_func" >&5
7879
7880 cat > conftest.$ac_ext <<EOF
7881 #line 7882 "configure"
7882 #include "confdefs.h"
7883 /* System header to define __stub macros and hopefully few prototypes,
7884     which can conflict with char $ac_func(); below.  */
7885 #include <assert.h>
7886 /* Override any gcc2 internal prototype to avoid an error.  */
7887 /* We use char because int might match the return type of a gcc2
7888     builtin and then its argument prototype would still apply.  */
7889 char $ac_func();
7890
7891 int main() {
7892
7893 /* The GNU C library defines this for functions which it implements
7894     to always fail with ENOSYS.  Some functions are actually named
7895     something starting with __ and the normal name is an alias.  */
7896 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7897 choke me
7898 #else
7899 $ac_func();
7900 #endif
7901
7902 ; return 0; }
7903 EOF
7904 if { (eval echo configure:7905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7905   rm -rf conftest*
7906   eval "ac_cv_func_$ac_func=yes"
7907 else
7908   echo "configure: failed program was:" >&5
7909   cat conftest.$ac_ext >&5
7910   rm -rf conftest*
7911   eval "ac_cv_func_$ac_func=no"
7912 fi
7913 rm -f conftest*
7914
7915 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7916   echo "$ac_t""yes" 1>&6
7917     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7918   { test "$extra_verbose" = "yes" && cat << EOF
7919     Defining $ac_tr_func
7920 EOF
7921 cat >> confdefs.h <<EOF
7922 #define $ac_tr_func 1
7923 EOF
7924 }
7925  
7926 else
7927   echo "$ac_t""no" 1>&6
7928 fi
7929 done
7930
7931     test "$ac_cv_func_crypt" != "yes" && { 
7932 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7933 echo "configure:7934: checking for crypt in -lcrypt" >&5
7934 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7935
7936 xe_check_libs=" -lcrypt "
7937 cat > conftest.$ac_ext <<EOF
7938 #line 7939 "configure"
7939 #include "confdefs.h"
7940 /* Override any gcc2 internal prototype to avoid an error.  */
7941 /* We use char because int might match the return type of a gcc2
7942     builtin and then its argument prototype would still apply.  */
7943 char crypt();
7944
7945 int main() {
7946 crypt()
7947 ; return 0; }
7948 EOF
7949 if { (eval echo configure:7950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7950   rm -rf conftest*
7951   eval "ac_cv_lib_$ac_lib_var=yes"
7952 else
7953   echo "configure: failed program was:" >&5
7954   cat conftest.$ac_ext >&5
7955   rm -rf conftest*
7956   eval "ac_cv_lib_$ac_lib_var=no"
7957 fi
7958 rm -f conftest*
7959 xe_check_libs=""
7960
7961 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7962   echo "$ac_t""yes" 1>&6
7963     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7964     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7965   { test "$extra_verbose" = "yes" && cat << EOF
7966     Defining $ac_tr_lib
7967 EOF
7968 cat >> confdefs.h <<EOF
7969 #define $ac_tr_lib 1
7970 EOF
7971 }
7972
7973   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
7974
7975 else
7976   echo "$ac_t""no" 1>&6
7977 fi
7978
7979  }
7980   fi
7981     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
7982     
7983 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
7984 echo "configure:7985: checking for jl_dic_list_e in -lwnn" >&5
7985 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7986
7987 xe_check_libs=" -lwnn "
7988 cat > conftest.$ac_ext <<EOF
7989 #line 7990 "configure"
7990 #include "confdefs.h"
7991 /* Override any gcc2 internal prototype to avoid an error.  */
7992 /* We use char because int might match the return type of a gcc2
7993     builtin and then its argument prototype would still apply.  */
7994 char jl_dic_list_e();
7995
7996 int main() {
7997 jl_dic_list_e()
7998 ; return 0; }
7999 EOF
8000 if { (eval echo configure:8001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8001   rm -rf conftest*
8002   eval "ac_cv_lib_$ac_lib_var=yes"
8003 else
8004   echo "configure: failed program was:" >&5
8005   cat conftest.$ac_ext >&5
8006   rm -rf conftest*
8007   eval "ac_cv_lib_$ac_lib_var=no"
8008 fi
8009 rm -f conftest*
8010 xe_check_libs=""
8011
8012 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8013   echo "$ac_t""yes" 1>&6
8014   libwnn=wnn
8015 else
8016   echo "$ac_t""no" 1>&6
8017 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8018 echo "configure:8019: checking for jl_dic_list_e in -lwnn4" >&5
8019 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8020
8021 xe_check_libs=" -lwnn4 "
8022 cat > conftest.$ac_ext <<EOF
8023 #line 8024 "configure"
8024 #include "confdefs.h"
8025 /* Override any gcc2 internal prototype to avoid an error.  */
8026 /* We use char because int might match the return type of a gcc2
8027     builtin and then its argument prototype would still apply.  */
8028 char jl_dic_list_e();
8029
8030 int main() {
8031 jl_dic_list_e()
8032 ; return 0; }
8033 EOF
8034 if { (eval echo configure:8035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8035   rm -rf conftest*
8036   eval "ac_cv_lib_$ac_lib_var=yes"
8037 else
8038   echo "configure: failed program was:" >&5
8039   cat conftest.$ac_ext >&5
8040   rm -rf conftest*
8041   eval "ac_cv_lib_$ac_lib_var=no"
8042 fi
8043 rm -f conftest*
8044 xe_check_libs=""
8045
8046 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8047   echo "$ac_t""yes" 1>&6
8048   libwnn=wnn4
8049 else
8050   echo "$ac_t""no" 1>&6
8051 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8052 echo "configure:8053: checking for jl_dic_list_e in -lwnn6" >&5
8053 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8054
8055 xe_check_libs=" -lwnn6 "
8056 cat > conftest.$ac_ext <<EOF
8057 #line 8058 "configure"
8058 #include "confdefs.h"
8059 /* Override any gcc2 internal prototype to avoid an error.  */
8060 /* We use char because int might match the return type of a gcc2
8061     builtin and then its argument prototype would still apply.  */
8062 char jl_dic_list_e();
8063
8064 int main() {
8065 jl_dic_list_e()
8066 ; return 0; }
8067 EOF
8068 if { (eval echo configure:8069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8069   rm -rf conftest*
8070   eval "ac_cv_lib_$ac_lib_var=yes"
8071 else
8072   echo "configure: failed program was:" >&5
8073   cat conftest.$ac_ext >&5
8074   rm -rf conftest*
8075   eval "ac_cv_lib_$ac_lib_var=no"
8076 fi
8077 rm -f conftest*
8078 xe_check_libs=""
8079
8080 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8081   echo "$ac_t""yes" 1>&6
8082   libwnn=wnn6
8083 else
8084   echo "$ac_t""no" 1>&6
8085 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8086 echo "configure:8087: checking for dic_list_e in -lwnn6_fromsrc" >&5
8087 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8088
8089 xe_check_libs=" -lwnn6_fromsrc "
8090 cat > conftest.$ac_ext <<EOF
8091 #line 8092 "configure"
8092 #include "confdefs.h"
8093 /* Override any gcc2 internal prototype to avoid an error.  */
8094 /* We use char because int might match the return type of a gcc2
8095     builtin and then its argument prototype would still apply.  */
8096 char dic_list_e();
8097
8098 int main() {
8099 dic_list_e()
8100 ; return 0; }
8101 EOF
8102 if { (eval echo configure:8103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8103   rm -rf conftest*
8104   eval "ac_cv_lib_$ac_lib_var=yes"
8105 else
8106   echo "configure: failed program was:" >&5
8107   cat conftest.$ac_ext >&5
8108   rm -rf conftest*
8109   eval "ac_cv_lib_$ac_lib_var=no"
8110 fi
8111 rm -f conftest*
8112 xe_check_libs=""
8113
8114 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8115   echo "$ac_t""yes" 1>&6
8116   libwnn=wnn6_fromsrc
8117 else
8118   echo "$ac_t""no" 1>&6
8119 with_wnn=no
8120 fi
8121
8122
8123 fi
8124
8125
8126 fi
8127
8128
8129 fi
8130
8131
8132   fi
8133   test -z "$with_wnn" && with_wnn=yes
8134   if test "$with_wnn" = "yes"; then
8135     { test "$extra_verbose" = "yes" && cat << \EOF
8136     Defining HAVE_WNN
8137 EOF
8138 cat >> confdefs.h <<\EOF
8139 #define HAVE_WNN 1
8140 EOF
8141 }
8142
8143     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8144     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8145    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8146  fi
8147     if test "$with_wnn6" != "no"; then
8148       
8149 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8150 echo "configure:8151: checking for jl_fi_dic_list in -l$libwnn" >&5
8151 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8152
8153 xe_check_libs=" -l$libwnn "
8154 cat > conftest.$ac_ext <<EOF
8155 #line 8156 "configure"
8156 #include "confdefs.h"
8157 /* Override any gcc2 internal prototype to avoid an error.  */
8158 /* We use char because int might match the return type of a gcc2
8159     builtin and then its argument prototype would still apply.  */
8160 char jl_fi_dic_list();
8161
8162 int main() {
8163 jl_fi_dic_list()
8164 ; return 0; }
8165 EOF
8166 if { (eval echo configure:8167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8167   rm -rf conftest*
8168   eval "ac_cv_lib_$ac_lib_var=yes"
8169 else
8170   echo "configure: failed program was:" >&5
8171   cat conftest.$ac_ext >&5
8172   rm -rf conftest*
8173   eval "ac_cv_lib_$ac_lib_var=no"
8174 fi
8175 rm -f conftest*
8176 xe_check_libs=""
8177
8178 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8179   echo "$ac_t""yes" 1>&6
8180   with_wnn6=yes
8181 else
8182   echo "$ac_t""no" 1>&6
8183 fi
8184
8185
8186       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8187     Defining WNN6
8188 EOF
8189 cat >> confdefs.h <<\EOF
8190 #define WNN6 1
8191 EOF
8192 }
8193
8194     fi
8195   fi
8196
8197     canna_includes_found=no
8198   if test "$with_canna" != "no"; then
8199     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8200 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8201 echo "configure:8202: checking for canna/jrkanji.h" >&5
8202
8203 cat > conftest.$ac_ext <<EOF
8204 #line 8205 "configure"
8205 #include "confdefs.h"
8206 #include <canna/jrkanji.h>
8207 EOF
8208 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8209 { (eval echo configure:8210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8210 ac_err=`grep -v '^ *+' conftest.out`
8211 if test -z "$ac_err"; then
8212   rm -rf conftest*
8213   eval "ac_cv_header_$ac_safe=yes"
8214 else
8215   echo "$ac_err" >&5
8216   echo "configure: failed program was:" >&5
8217   cat conftest.$ac_ext >&5
8218   rm -rf conftest*
8219   eval "ac_cv_header_$ac_safe=no"
8220 fi
8221 rm -f conftest*
8222 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8223   echo "$ac_t""yes" 1>&6
8224   canna_includes_found=yes
8225 else
8226   echo "$ac_t""no" 1>&6
8227 fi
8228
8229   fi
8230   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8231       -d "/usr/local/canna/include"; then
8232     save_c_switch_site="$c_switch_site"
8233     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8234     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8235 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8236 echo "configure:8237: checking for canna/jrkanji.h" >&5
8237
8238 cat > conftest.$ac_ext <<EOF
8239 #line 8240 "configure"
8240 #include "confdefs.h"
8241 #include <canna/jrkanji.h>
8242 EOF
8243 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8244 { (eval echo configure:8245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8245 ac_err=`grep -v '^ *+' conftest.out`
8246 if test -z "$ac_err"; then
8247   rm -rf conftest*
8248   eval "ac_cv_header_$ac_safe=yes"
8249 else
8250   echo "$ac_err" >&5
8251   echo "configure: failed program was:" >&5
8252   cat conftest.$ac_ext >&5
8253   rm -rf conftest*
8254   eval "ac_cv_header_$ac_safe=no"
8255 fi
8256 rm -f conftest*
8257 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8258   echo "$ac_t""yes" 1>&6
8259   canna_includes_found=yes
8260 else
8261   echo "$ac_t""no" 1>&6
8262 fi
8263
8264     if test "$canna_includes_found" != "yes"; then
8265       c_switch_site="$save_c_switch_site"
8266       with_canna="no"
8267     fi
8268   fi
8269
8270   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8271 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8272 echo "configure:8273: checking for canna/RK.h" >&5
8273
8274 cat > conftest.$ac_ext <<EOF
8275 #line 8276 "configure"
8276 #include "confdefs.h"
8277 #include <canna/RK.h>
8278 EOF
8279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8280 { (eval echo configure:8281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8281 ac_err=`grep -v '^ *+' conftest.out`
8282 if test -z "$ac_err"; then
8283   rm -rf conftest*
8284   eval "ac_cv_header_$ac_safe=yes"
8285 else
8286   echo "$ac_err" >&5
8287   echo "configure: failed program was:" >&5
8288   cat conftest.$ac_ext >&5
8289   rm -rf conftest*
8290   eval "ac_cv_header_$ac_safe=no"
8291 fi
8292 rm -f conftest*
8293 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8294   echo "$ac_t""yes" 1>&6
8295   :
8296 else
8297   echo "$ac_t""no" 1>&6
8298 with_canna=no
8299 fi
8300  }
8301   test -z "$with_canna" && { 
8302 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8303 echo "configure:8304: checking for RkBgnBun in -lRKC" >&5
8304 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8305
8306 xe_check_libs=" -lRKC "
8307 cat > conftest.$ac_ext <<EOF
8308 #line 8309 "configure"
8309 #include "confdefs.h"
8310 /* Override any gcc2 internal prototype to avoid an error.  */
8311 /* We use char because int might match the return type of a gcc2
8312     builtin and then its argument prototype would still apply.  */
8313 char RkBgnBun();
8314
8315 int main() {
8316 RkBgnBun()
8317 ; return 0; }
8318 EOF
8319 if { (eval echo configure:8320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8320   rm -rf conftest*
8321   eval "ac_cv_lib_$ac_lib_var=yes"
8322 else
8323   echo "configure: failed program was:" >&5
8324   cat conftest.$ac_ext >&5
8325   rm -rf conftest*
8326   eval "ac_cv_lib_$ac_lib_var=no"
8327 fi
8328 rm -f conftest*
8329 xe_check_libs=""
8330
8331 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8332   echo "$ac_t""yes" 1>&6
8333   :
8334 else
8335   echo "$ac_t""no" 1>&6
8336 with_canna=no
8337 fi
8338
8339  }
8340   test -z "$with_canna" && { 
8341 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8342 echo "configure:8343: checking for jrKanjiControl in -lcanna" >&5
8343 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8344
8345 xe_check_libs=" -lcanna "
8346 cat > conftest.$ac_ext <<EOF
8347 #line 8348 "configure"
8348 #include "confdefs.h"
8349 /* Override any gcc2 internal prototype to avoid an error.  */
8350 /* We use char because int might match the return type of a gcc2
8351     builtin and then its argument prototype would still apply.  */
8352 char jrKanjiControl();
8353
8354 int main() {
8355 jrKanjiControl()
8356 ; return 0; }
8357 EOF
8358 if { (eval echo configure:8359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8359   rm -rf conftest*
8360   eval "ac_cv_lib_$ac_lib_var=yes"
8361 else
8362   echo "configure: failed program was:" >&5
8363   cat conftest.$ac_ext >&5
8364   rm -rf conftest*
8365   eval "ac_cv_lib_$ac_lib_var=no"
8366 fi
8367 rm -f conftest*
8368 xe_check_libs=""
8369
8370 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8371   echo "$ac_t""yes" 1>&6
8372   :
8373 else
8374   echo "$ac_t""no" 1>&6
8375 with_canna=no
8376 fi
8377
8378  }
8379   test -z "$with_canna" && with_canna=yes
8380   if test "$with_canna" = "yes"; then
8381     { test "$extra_verbose" = "yes" && cat << \EOF
8382     Defining HAVE_CANNA
8383 EOF
8384 cat >> confdefs.h <<\EOF
8385 #define HAVE_CANNA 1
8386 EOF
8387 }
8388
8389     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8390     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8391    echo "    xemacs will be linked with \"mule-canna.o\""
8392  fi
8393   fi
8394
8395 else   for feature in xim canna wnn; do
8396     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8397       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8398     fi
8399     eval "with_${feature}=no"
8400   done
8401 fi 
8402
8403 if test "$need_motif" = "yes" ; then
8404   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8405     
8406 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8407 echo "configure:8408: checking for layout_object_getvalue in -li18n" >&5
8408 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8409
8410 xe_check_libs=" -li18n "
8411 cat > conftest.$ac_ext <<EOF
8412 #line 8413 "configure"
8413 #include "confdefs.h"
8414 /* Override any gcc2 internal prototype to avoid an error.  */
8415 /* We use char because int might match the return type of a gcc2
8416     builtin and then its argument prototype would still apply.  */
8417 char layout_object_getvalue();
8418
8419 int main() {
8420 layout_object_getvalue()
8421 ; return 0; }
8422 EOF
8423 if { (eval echo configure:8424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8424   rm -rf conftest*
8425   eval "ac_cv_lib_$ac_lib_var=yes"
8426 else
8427   echo "configure: failed program was:" >&5
8428   cat conftest.$ac_ext >&5
8429   rm -rf conftest*
8430   eval "ac_cv_lib_$ac_lib_var=no"
8431 fi
8432 rm -f conftest*
8433 xe_check_libs=""
8434
8435 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8436   echo "$ac_t""yes" 1>&6
8437   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8438 else
8439   echo "$ac_t""no" 1>&6
8440 fi
8441
8442
8443   
8444 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8445     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8446   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8447   
8448         runpath="" runpath_dirs=""
8449   if test -n "$LD_RUN_PATH"; then
8450     runpath="$LD_RUN_PATH"
8451   elif test "$GCC" = "yes"; then
8452         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8453     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8454     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8455     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8456       case "$arg" in P,* | -L* | -R* )
8457         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8458           {
8459 xe_runpath_dir="$dir"
8460   test "$xe_runpath_dir" != "/lib"     -a \
8461         "$xe_runpath_dir" != "/usr/lib" -a \
8462         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8463   eval "$xe_add_unique_runpath_dir"
8464 }
8465         done ;;
8466       esac
8467     done
8468     ld_switch_run="$ld_switch_run_save"
8469     rm -f conftest*
8470   else
8471         for arg in $ld_switch_site $ld_switch_x_site; do
8472       case "$arg" in -L*) {
8473 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8474   test "$xe_runpath_dir" != "/lib"     -a \
8475         "$xe_runpath_dir" != "/usr/lib" -a \
8476         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8477   eval "$xe_add_unique_runpath_dir"
8478 };; esac
8479     done
8480         if test "$opsys $need_motif" = "sol2 yes"; then
8481       xe_runpath_dir="/opt/SUNWdt/lib";
8482       eval "$xe_add_unique_runpath_dir";
8483     fi
8484   fi 
8485   if test -n "$runpath"; then
8486     ld_switch_run="${dash_r}${runpath}"
8487     
8488 if test "$GCC" = "yes"; then
8489   set x $ld_switch_run; shift; ld_switch_run=""
8490   while test -n "$1"; do
8491     case $1 in
8492       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8493       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8494       -Xlinker* ) ;;
8495       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8496     esac
8497     shift
8498   done
8499 fi
8500     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8501   fi
8502 fi
8503
8504 fi
8505
8506 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
8507 do
8508 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8509 echo "configure:8510: checking for $ac_func" >&5
8510
8511 cat > conftest.$ac_ext <<EOF
8512 #line 8513 "configure"
8513 #include "confdefs.h"
8514 /* System header to define __stub macros and hopefully few prototypes,
8515     which can conflict with char $ac_func(); below.  */
8516 #include <assert.h>
8517 /* Override any gcc2 internal prototype to avoid an error.  */
8518 /* We use char because int might match the return type of a gcc2
8519     builtin and then its argument prototype would still apply.  */
8520 char $ac_func();
8521
8522 int main() {
8523
8524 /* The GNU C library defines this for functions which it implements
8525     to always fail with ENOSYS.  Some functions are actually named
8526     something starting with __ and the normal name is an alias.  */
8527 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8528 choke me
8529 #else
8530 $ac_func();
8531 #endif
8532
8533 ; return 0; }
8534 EOF
8535 if { (eval echo configure:8536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8536   rm -rf conftest*
8537   eval "ac_cv_func_$ac_func=yes"
8538 else
8539   echo "configure: failed program was:" >&5
8540   cat conftest.$ac_ext >&5
8541   rm -rf conftest*
8542   eval "ac_cv_func_$ac_func=no"
8543 fi
8544 rm -f conftest*
8545
8546 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8547   echo "$ac_t""yes" 1>&6
8548     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8549   { test "$extra_verbose" = "yes" && cat << EOF
8550     Defining $ac_tr_func
8551 EOF
8552 cat >> confdefs.h <<EOF
8553 #define $ac_tr_func 1
8554 EOF
8555 }
8556  
8557 else
8558   echo "$ac_t""no" 1>&6
8559 fi
8560 done
8561
8562
8563
8564 case "$opsys" in
8565   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8566    echo "    xemacs will be linked with \"realpath.o\""
8567  fi ;;
8568   * )
8569     case "$canonical" in
8570       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8571    echo "    xemacs will be linked with \"realpath.o\""
8572  fi ;;
8573       * ) for ac_func in realpath
8574 do
8575 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8576 echo "configure:8577: checking for $ac_func" >&5
8577
8578 cat > conftest.$ac_ext <<EOF
8579 #line 8580 "configure"
8580 #include "confdefs.h"
8581 /* System header to define __stub macros and hopefully few prototypes,
8582     which can conflict with char $ac_func(); below.  */
8583 #include <assert.h>
8584 /* Override any gcc2 internal prototype to avoid an error.  */
8585 /* We use char because int might match the return type of a gcc2
8586     builtin and then its argument prototype would still apply.  */
8587 char $ac_func();
8588
8589 int main() {
8590
8591 /* The GNU C library defines this for functions which it implements
8592     to always fail with ENOSYS.  Some functions are actually named
8593     something starting with __ and the normal name is an alias.  */
8594 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8595 choke me
8596 #else
8597 $ac_func();
8598 #endif
8599
8600 ; return 0; }
8601 EOF
8602 if { (eval echo configure:8603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8603   rm -rf conftest*
8604   eval "ac_cv_func_$ac_func=yes"
8605 else
8606   echo "configure: failed program was:" >&5
8607   cat conftest.$ac_ext >&5
8608   rm -rf conftest*
8609   eval "ac_cv_func_$ac_func=no"
8610 fi
8611 rm -f conftest*
8612
8613 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8614   echo "$ac_t""yes" 1>&6
8615     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8616   { test "$extra_verbose" = "yes" && cat << EOF
8617     Defining $ac_tr_func
8618 EOF
8619 cat >> confdefs.h <<EOF
8620 #define $ac_tr_func 1
8621 EOF
8622 }
8623  
8624 else
8625   echo "$ac_t""no" 1>&6
8626 fi
8627 done
8628
8629           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8630    echo "    xemacs will be linked with \"realpath.o\""
8631  fi ;;
8632     esac ;;
8633 esac
8634
8635 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8636 echo "configure:8637: checking whether netdb declares h_errno" >&5
8637 cat > conftest.$ac_ext <<EOF
8638 #line 8639 "configure"
8639 #include "confdefs.h"
8640 #include <netdb.h>
8641 int main() {
8642 return h_errno;
8643 ; return 0; }
8644 EOF
8645 if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8646   rm -rf conftest*
8647   echo "$ac_t""yes" 1>&6
8648    { test "$extra_verbose" = "yes" && cat << \EOF
8649     Defining HAVE_H_ERRNO
8650 EOF
8651 cat >> confdefs.h <<\EOF
8652 #define HAVE_H_ERRNO 1
8653 EOF
8654 }
8655
8656 else
8657   echo "configure: failed program was:" >&5
8658   cat conftest.$ac_ext >&5
8659   rm -rf conftest*
8660   echo "$ac_t""no" 1>&6
8661 fi
8662 rm -f conftest*
8663
8664 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8665 echo "configure:8666: checking for sigsetjmp" >&5
8666 cat > conftest.$ac_ext <<EOF
8667 #line 8668 "configure"
8668 #include "confdefs.h"
8669 #include <setjmp.h>
8670 int main() {
8671 sigjmp_buf bar; sigsetjmp (bar, 0);
8672 ; return 0; }
8673 EOF
8674 if { (eval echo configure:8675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8675   rm -rf conftest*
8676   echo "$ac_t""yes" 1>&6
8677    { test "$extra_verbose" = "yes" && cat << \EOF
8678     Defining HAVE_SIGSETJMP
8679 EOF
8680 cat >> confdefs.h <<\EOF
8681 #define HAVE_SIGSETJMP 1
8682 EOF
8683 }
8684
8685 else
8686   echo "configure: failed program was:" >&5
8687   cat conftest.$ac_ext >&5
8688   rm -rf conftest*
8689   echo "$ac_t""no" 1>&6
8690 fi
8691 rm -f conftest*
8692
8693 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
8694 echo "configure:8695: checking whether localtime caches TZ" >&5
8695
8696 if test "$ac_cv_func_tzset" = "yes"; then
8697 cat > conftest.$ac_ext <<EOF
8698 #line 8699 "configure"
8699 #include "confdefs.h"
8700 #include <time.h>
8701 #if STDC_HEADERS
8702 # include <stdlib.h>
8703 #endif
8704 extern char **environ;
8705 unset_TZ ()
8706 {
8707   char **from, **to;
8708   for (to = from = environ; (*to = *from); from++)
8709     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
8710       to++;
8711 }
8712 char TZ_GMT0[] = "TZ=GMT0";
8713 char TZ_PST8[] = "TZ=PST8";
8714 main()
8715 {
8716   time_t now = time ((time_t *) 0);
8717   int hour_GMT0, hour_unset;
8718   if (putenv (TZ_GMT0) != 0)
8719     exit (1);
8720   hour_GMT0 = localtime (&now)->tm_hour;
8721   unset_TZ ();
8722   hour_unset = localtime (&now)->tm_hour;
8723   if (putenv (TZ_PST8) != 0)
8724     exit (1);
8725   if (localtime (&now)->tm_hour == hour_GMT0)
8726     exit (1);
8727   unset_TZ ();
8728   if (localtime (&now)->tm_hour != hour_unset)
8729     exit (1);
8730   exit (0);
8731 }
8732 EOF
8733 if { (eval echo configure:8734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8734 then
8735   emacs_cv_localtime_cache=no
8736 else
8737   conftest_rc="$?"
8738   echo "configure: failed program was:" >&5
8739   cat conftest.$ac_ext >&5
8740   rm -fr conftest*
8741   emacs_cv_localtime_cache=yes
8742 fi
8743 rm -fr conftest*
8744 else
8745         # If we lack tzset, report that localtime does not cache TZ,
8746         # since we can't invalidate the cache if we don't have tzset.
8747         emacs_cv_localtime_cache=no
8748 fi
8749 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
8750 if test $emacs_cv_localtime_cache = yes; then
8751   { test "$extra_verbose" = "yes" && cat << \EOF
8752     Defining LOCALTIME_CACHE
8753 EOF
8754 cat >> confdefs.h <<\EOF
8755 #define LOCALTIME_CACHE 1
8756 EOF
8757 }
8758
8759 fi
8760
8761 if test "$HAVE_TIMEVAL" = "yes"; then
8762 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
8763 echo "configure:8764: checking whether gettimeofday accepts one or two arguments" >&5
8764 cat > conftest.$ac_ext <<EOF
8765 #line 8766 "configure"
8766 #include "confdefs.h"
8767
8768 #ifdef TIME_WITH_SYS_TIME
8769 #include <sys/time.h>
8770 #include <time.h>
8771 #else
8772 #ifdef HAVE_SYS_TIME_H
8773 #include <sys/time.h>
8774 #else
8775 #include <time.h>
8776 #endif
8777 #endif
8778   
8779 int main() {
8780
8781   struct timeval time;
8782   struct timezone dummy;
8783   gettimeofday (&time, &dummy);
8784
8785 ; return 0; }
8786 EOF
8787 if { (eval echo configure:8788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8788   rm -rf conftest*
8789   echo "$ac_t""two" 1>&6
8790 else
8791   echo "configure: failed program was:" >&5
8792   cat conftest.$ac_ext >&5
8793   rm -rf conftest*
8794   echo "$ac_t""one" 1>&6
8795    { test "$extra_verbose" = "yes" && cat << \EOF
8796     Defining GETTIMEOFDAY_ONE_ARGUMENT
8797 EOF
8798 cat >> confdefs.h <<\EOF
8799 #define GETTIMEOFDAY_ONE_ARGUMENT 1
8800 EOF
8801 }
8802
8803 fi
8804 rm -f conftest*
8805 fi
8806
8807
8808 echo $ac_n "checking for inline""... $ac_c" 1>&6
8809 echo "configure:8810: checking for inline" >&5
8810
8811 ac_cv_c_inline=no
8812 for ac_kw in inline __inline__ __inline; do
8813   cat > conftest.$ac_ext <<EOF
8814 #line 8815 "configure"
8815 #include "confdefs.h"
8816
8817 int main() {
8818 } $ac_kw foo() {
8819 ; return 0; }
8820 EOF
8821 if { (eval echo configure:8822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8822   rm -rf conftest*
8823   ac_cv_c_inline=$ac_kw; break
8824 else
8825   echo "configure: failed program was:" >&5
8826   cat conftest.$ac_ext >&5
8827 fi
8828 rm -f conftest*
8829 done
8830
8831
8832 echo "$ac_t""$ac_cv_c_inline" 1>&6
8833 case "$ac_cv_c_inline" in
8834   inline | yes) ;;
8835   no) { test "$extra_verbose" = "yes" && cat << \EOF
8836     Defining inline = 
8837 EOF
8838 cat >> confdefs.h <<\EOF
8839 #define inline 
8840 EOF
8841 }
8842  ;;
8843   *)  { test "$extra_verbose" = "yes" && cat << EOF
8844     Defining inline = $ac_cv_c_inline
8845 EOF
8846 cat >> confdefs.h <<EOF
8847 #define inline $ac_cv_c_inline
8848 EOF
8849 }
8850  ;;
8851 esac
8852
8853 if test "$ac_cv_c_inline" != "no"; then
8854   { test "$extra_verbose" = "yes" && cat << \EOF
8855     Defining HAVE_INLINE
8856 EOF
8857 cat >> confdefs.h <<\EOF
8858 #define HAVE_INLINE 1
8859 EOF
8860 }
8861
8862   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
8863    echo "    xemacs will be linked with \"inline.o\""
8864  fi
8865 fi
8866
8867
8868 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
8869 # for constant arguments.  Useless!
8870 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
8871 echo "configure:8872: checking for working alloca.h" >&5
8872
8873 cat > conftest.$ac_ext <<EOF
8874 #line 8875 "configure"
8875 #include "confdefs.h"
8876 #include <alloca.h>
8877 int main() {
8878 char *p = alloca(2 * sizeof(int));
8879 ; return 0; }
8880 EOF
8881 if { (eval echo configure:8882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8882   rm -rf conftest*
8883   ac_cv_header_alloca_h=yes
8884 else
8885   echo "configure: failed program was:" >&5
8886   cat conftest.$ac_ext >&5
8887   rm -rf conftest*
8888   ac_cv_header_alloca_h=no
8889 fi
8890 rm -f conftest*
8891
8892 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
8893 if test $ac_cv_header_alloca_h = yes; then
8894   { test "$extra_verbose" = "yes" && cat << \EOF
8895     Defining HAVE_ALLOCA_H
8896 EOF
8897 cat >> confdefs.h <<\EOF
8898 #define HAVE_ALLOCA_H 1
8899 EOF
8900 }
8901
8902 fi
8903
8904 echo $ac_n "checking for alloca""... $ac_c" 1>&6
8905 echo "configure:8906: checking for alloca" >&5
8906
8907 cat > conftest.$ac_ext <<EOF
8908 #line 8909 "configure"
8909 #include "confdefs.h"
8910
8911 #ifdef __GNUC__
8912 # define alloca __builtin_alloca
8913 #else
8914 # if HAVE_ALLOCA_H
8915 #  include <alloca.h>
8916 # else
8917 #  ifdef _AIX
8918  #pragma alloca
8919 #  else
8920 #   ifndef alloca /* predefined by HP cc +Olibcalls */
8921 char *alloca ();
8922 #   endif
8923 #  endif
8924 # endif
8925 #endif
8926
8927 int main() {
8928 char *p = (char *) alloca(1);
8929 ; return 0; }
8930 EOF
8931 if { (eval echo configure:8932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8932   rm -rf conftest*
8933   ac_cv_func_alloca_works=yes
8934 else
8935   echo "configure: failed program was:" >&5
8936   cat conftest.$ac_ext >&5
8937   rm -rf conftest*
8938   ac_cv_func_alloca_works=no
8939 fi
8940 rm -f conftest*
8941
8942 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
8943 if test $ac_cv_func_alloca_works = yes; then
8944   { test "$extra_verbose" = "yes" && cat << \EOF
8945     Defining HAVE_ALLOCA
8946 EOF
8947 cat >> confdefs.h <<\EOF
8948 #define HAVE_ALLOCA 1
8949 EOF
8950 }
8951
8952 fi
8953
8954 if test $ac_cv_func_alloca_works = no; then
8955   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
8956   # that cause trouble.  Some versions do not even contain alloca or
8957   # contain a buggy version.  If you still want to use their alloca,
8958   # use ar to extract alloca.o from them instead of compiling alloca.c.
8959   ALLOCA=alloca.o
8960   { test "$extra_verbose" = "yes" && cat << \EOF
8961     Defining C_ALLOCA
8962 EOF
8963 cat >> confdefs.h <<\EOF
8964 #define C_ALLOCA 1
8965 EOF
8966 }
8967
8968
8969 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
8970 echo "configure:8971: checking whether alloca needs Cray hooks" >&5
8971
8972 cat > conftest.$ac_ext <<EOF
8973 #line 8974 "configure"
8974 #include "confdefs.h"
8975 #if defined(CRAY) && ! defined(CRAY2)
8976 webecray
8977 #else
8978 wenotbecray
8979 #endif
8980
8981 EOF
8982 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8983   egrep "webecray" >/dev/null 2>&1; then
8984   rm -rf conftest*
8985   ac_cv_os_cray=yes
8986 else
8987   rm -rf conftest*
8988   ac_cv_os_cray=no
8989 fi
8990 rm -f conftest*
8991
8992
8993 echo "$ac_t""$ac_cv_os_cray" 1>&6
8994 if test $ac_cv_os_cray = yes; then
8995 for ac_func in _getb67 GETB67 getb67; do
8996   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8997 echo "configure:8998: checking for $ac_func" >&5
8998
8999 cat > conftest.$ac_ext <<EOF
9000 #line 9001 "configure"
9001 #include "confdefs.h"
9002 /* System header to define __stub macros and hopefully few prototypes,
9003     which can conflict with char $ac_func(); below.  */
9004 #include <assert.h>
9005 /* Override any gcc2 internal prototype to avoid an error.  */
9006 /* We use char because int might match the return type of a gcc2
9007     builtin and then its argument prototype would still apply.  */
9008 char $ac_func();
9009
9010 int main() {
9011
9012 /* The GNU C library defines this for functions which it implements
9013     to always fail with ENOSYS.  Some functions are actually named
9014     something starting with __ and the normal name is an alias.  */
9015 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9016 choke me
9017 #else
9018 $ac_func();
9019 #endif
9020
9021 ; return 0; }
9022 EOF
9023 if { (eval echo configure:9024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9024   rm -rf conftest*
9025   eval "ac_cv_func_$ac_func=yes"
9026 else
9027   echo "configure: failed program was:" >&5
9028   cat conftest.$ac_ext >&5
9029   rm -rf conftest*
9030   eval "ac_cv_func_$ac_func=no"
9031 fi
9032 rm -f conftest*
9033
9034 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9035   echo "$ac_t""yes" 1>&6
9036   { test "$extra_verbose" = "yes" && cat << EOF
9037     Defining CRAY_STACKSEG_END = $ac_func
9038 EOF
9039 cat >> confdefs.h <<EOF
9040 #define CRAY_STACKSEG_END $ac_func
9041 EOF
9042 }
9043
9044   break
9045 else
9046   echo "$ac_t""no" 1>&6
9047 fi
9048
9049 done
9050 fi
9051
9052 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9053 echo "configure:9054: checking stack direction for C alloca" >&5
9054
9055 cat > conftest.$ac_ext <<EOF
9056 #line 9057 "configure"
9057 #include "confdefs.h"
9058 find_stack_direction ()
9059 {
9060   static char *addr = 0;
9061   auto char dummy;
9062   if (addr == 0)
9063     {
9064       addr = &dummy;
9065       return find_stack_direction ();
9066     }
9067   else
9068     return (&dummy > addr) ? 1 : -1;
9069 }
9070 main ()
9071 {
9072   exit (find_stack_direction() < 0);
9073 }
9074 EOF
9075 if { (eval echo configure:9076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9076 then
9077   ac_cv_c_stack_direction=1
9078 else
9079   conftest_rc="$?"
9080   echo "configure: failed program was:" >&5
9081   cat conftest.$ac_ext >&5
9082   rm -fr conftest*
9083   ac_cv_c_stack_direction=-1
9084 fi
9085 rm -fr conftest*
9086
9087 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9088 { test "$extra_verbose" = "yes" && cat << EOF
9089     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9090 EOF
9091 cat >> confdefs.h <<EOF
9092 #define STACK_DIRECTION $ac_cv_c_stack_direction
9093 EOF
9094 }
9095
9096 fi
9097
9098 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9099    echo "    xemacs will be linked with \"$ALLOCA\""
9100  fi
9101
9102 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9103 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9104 echo "configure:9105: checking for vfork.h" >&5
9105
9106 cat > conftest.$ac_ext <<EOF
9107 #line 9108 "configure"
9108 #include "confdefs.h"
9109 #include <vfork.h>
9110 EOF
9111 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9112 { (eval echo configure:9113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9113 ac_err=`grep -v '^ *+' conftest.out`
9114 if test -z "$ac_err"; then
9115   rm -rf conftest*
9116   eval "ac_cv_header_$ac_safe=yes"
9117 else
9118   echo "$ac_err" >&5
9119   echo "configure: failed program was:" >&5
9120   cat conftest.$ac_ext >&5
9121   rm -rf conftest*
9122   eval "ac_cv_header_$ac_safe=no"
9123 fi
9124 rm -f conftest*
9125 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9126   echo "$ac_t""yes" 1>&6
9127   { test "$extra_verbose" = "yes" && cat << \EOF
9128     Defining HAVE_VFORK_H
9129 EOF
9130 cat >> confdefs.h <<\EOF
9131 #define HAVE_VFORK_H 1
9132 EOF
9133 }
9134
9135 else
9136   echo "$ac_t""no" 1>&6
9137 fi
9138
9139 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9140 echo "configure:9141: checking for working vfork" >&5
9141
9142 cat > conftest.$ac_ext <<EOF
9143 #line 9144 "configure"
9144 #include "confdefs.h"
9145 /* Thanks to Paul Eggert for this test.  */
9146 #include <stdio.h>
9147 #include <sys/types.h>
9148 #include <sys/stat.h>
9149 #ifdef HAVE_UNISTD_H
9150 #include <unistd.h>
9151 #endif
9152 #ifdef HAVE_VFORK_H
9153 #include <vfork.h>
9154 #endif
9155 /* On some sparc systems, changes by the child to local and incoming
9156    argument registers are propagated back to the parent.
9157    The compiler is told about this with #include <vfork.h>,
9158    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9159    Test for this by using a static variable whose address
9160    is put into a register that is clobbered by the vfork.  */
9161 static
9162 #ifdef __cplusplus
9163 sparc_address_test (int arg)
9164 #else
9165 sparc_address_test (arg) int arg;
9166 #endif
9167 {
9168   static pid_t child;
9169   if (!child) {
9170     child = vfork ();
9171     if (child < 0) {
9172       perror ("vfork");
9173       _exit(2);
9174     }
9175     if (!child) {
9176       arg = getpid();
9177       write(-1, "", 0);
9178       _exit (arg);
9179     }
9180   }
9181 }
9182 main() {
9183   pid_t parent = getpid ();
9184   pid_t child;
9185
9186   sparc_address_test ();
9187
9188   child = vfork ();
9189
9190   if (child == 0) {
9191     /* Here is another test for sparc vfork register problems.
9192        This test uses lots of local variables, at least
9193        as many local variables as main has allocated so far
9194        including compiler temporaries.  4 locals are enough for
9195        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9196        A buggy compiler should reuse the register of parent
9197        for one of the local variables, since it will think that
9198        parent can't possibly be used any more in this routine.
9199        Assigning to the local variable will thus munge parent
9200        in the parent process.  */
9201     pid_t
9202       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9203       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9204     /* Convince the compiler that p..p7 are live; otherwise, it might
9205        use the same hardware register for all 8 local variables.  */
9206     if (p != p1 || p != p2 || p != p3 || p != p4
9207         || p != p5 || p != p6 || p != p7)
9208       _exit(1);
9209
9210     /* On some systems (e.g. IRIX 3.3),
9211        vfork doesn't separate parent from child file descriptors.
9212        If the child closes a descriptor before it execs or exits,
9213        this munges the parent's descriptor as well.
9214        Test for this by closing stdout in the child.  */
9215     _exit(close(fileno(stdout)) != 0);
9216   } else {
9217     int status;
9218     struct stat st;
9219
9220     while (wait(&status) != child)
9221       ;
9222     exit(
9223          /* Was there some problem with vforking?  */
9224          child < 0
9225
9226          /* Did the child fail?  (This shouldn't happen.)  */
9227          || status
9228
9229          /* Did the vfork/compiler bug occur?  */
9230          || parent != getpid()
9231
9232          /* Did the file descriptor bug occur?  */
9233          || fstat(fileno(stdout), &st) != 0
9234          );
9235   }
9236 }
9237 EOF
9238 if { (eval echo configure:9239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9239 then
9240   ac_cv_func_vfork_works=yes
9241 else
9242   conftest_rc="$?"
9243   echo "configure: failed program was:" >&5
9244   cat conftest.$ac_ext >&5
9245   rm -fr conftest*
9246   ac_cv_func_vfork_works=no
9247 fi
9248 rm -fr conftest*
9249
9250 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9251 if test $ac_cv_func_vfork_works = no; then
9252   { test "$extra_verbose" = "yes" && cat << \EOF
9253     Defining vfork = fork
9254 EOF
9255 cat >> confdefs.h <<\EOF
9256 #define vfork fork
9257 EOF
9258 }
9259
9260 fi
9261
9262
9263 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9264 echo "configure:9265: checking for working strcoll" >&5
9265
9266 cat > conftest.$ac_ext <<EOF
9267 #line 9268 "configure"
9268 #include "confdefs.h"
9269 #include <string.h>
9270 main ()
9271 {
9272   exit (strcoll ("abc", "def") >= 0 ||
9273         strcoll ("ABC", "DEF") >= 0 ||
9274         strcoll ("123", "456") >= 0);
9275 }
9276 EOF
9277 if { (eval echo configure:9278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9278 then
9279   ac_cv_func_strcoll_works=yes
9280 else
9281   conftest_rc="$?"
9282   echo "configure: failed program was:" >&5
9283   cat conftest.$ac_ext >&5
9284   rm -fr conftest*
9285   ac_cv_func_strcoll_works=no
9286 fi
9287 rm -fr conftest*
9288
9289 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9290 if test $ac_cv_func_strcoll_works = yes; then
9291   { test "$extra_verbose" = "yes" && cat << \EOF
9292     Defining HAVE_STRCOLL
9293 EOF
9294 cat >> confdefs.h <<\EOF
9295 #define HAVE_STRCOLL 1
9296 EOF
9297 }
9298
9299 fi
9300
9301
9302 for ac_func in getpgrp
9303 do
9304 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9305 echo "configure:9306: checking for $ac_func" >&5
9306
9307 cat > conftest.$ac_ext <<EOF
9308 #line 9309 "configure"
9309 #include "confdefs.h"
9310 /* System header to define __stub macros and hopefully few prototypes,
9311     which can conflict with char $ac_func(); below.  */
9312 #include <assert.h>
9313 /* Override any gcc2 internal prototype to avoid an error.  */
9314 /* We use char because int might match the return type of a gcc2
9315     builtin and then its argument prototype would still apply.  */
9316 char $ac_func();
9317
9318 int main() {
9319
9320 /* The GNU C library defines this for functions which it implements
9321     to always fail with ENOSYS.  Some functions are actually named
9322     something starting with __ and the normal name is an alias.  */
9323 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9324 choke me
9325 #else
9326 $ac_func();
9327 #endif
9328
9329 ; return 0; }
9330 EOF
9331 if { (eval echo configure:9332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9332   rm -rf conftest*
9333   eval "ac_cv_func_$ac_func=yes"
9334 else
9335   echo "configure: failed program was:" >&5
9336   cat conftest.$ac_ext >&5
9337   rm -rf conftest*
9338   eval "ac_cv_func_$ac_func=no"
9339 fi
9340 rm -f conftest*
9341
9342 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9343   echo "$ac_t""yes" 1>&6
9344     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9345   { test "$extra_verbose" = "yes" && cat << EOF
9346     Defining $ac_tr_func
9347 EOF
9348 cat >> confdefs.h <<EOF
9349 #define $ac_tr_func 1
9350 EOF
9351 }
9352  
9353 else
9354   echo "$ac_t""no" 1>&6
9355 fi
9356 done
9357
9358 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9359 echo "configure:9360: checking whether getpgrp takes no argument" >&5
9360
9361 cat > conftest.$ac_ext <<EOF
9362 #line 9363 "configure"
9363 #include "confdefs.h"
9364
9365 /*
9366  * If this system has a BSD-style getpgrp(),
9367  * which takes a pid argument, exit unsuccessfully.
9368  *
9369  * Snarfed from Chet Ramey's bash pgrp.c test program
9370  */
9371 #include <stdio.h>
9372 #include <sys/types.h>
9373
9374 int     pid;
9375 int     pg1, pg2, pg3, pg4;
9376 int     ng, np, s, child;
9377
9378 main()
9379 {
9380         pid = getpid();
9381         pg1 = getpgrp(0);
9382         pg2 = getpgrp();
9383         pg3 = getpgrp(pid);
9384         pg4 = getpgrp(1);
9385
9386         /*
9387          * If all of these values are the same, it's pretty sure that
9388          * we're on a system that ignores getpgrp's first argument.
9389          */
9390         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9391                 exit(0);
9392
9393         child = fork();
9394         if (child < 0)
9395                 exit(1);
9396         else if (child == 0) {
9397                 np = getpid();
9398                 /*
9399                  * If this is Sys V, this will not work; pgrp will be
9400                  * set to np because setpgrp just changes a pgrp to be
9401                  * the same as the pid.
9402                  */
9403                 setpgrp(np, pg1);
9404                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9405                 if (ng == pg1) {
9406                         exit(1);
9407                 } else {
9408                         exit(0);
9409                 }
9410         } else {
9411                 wait(&s);
9412                 exit(s>>8);
9413         }
9414 }
9415
9416 EOF
9417 if { (eval echo configure:9418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9418 then
9419   ac_cv_func_getpgrp_void=yes
9420 else
9421   conftest_rc="$?"
9422   echo "configure: failed program was:" >&5
9423   cat conftest.$ac_ext >&5
9424   rm -fr conftest*
9425   ac_cv_func_getpgrp_void=no
9426 fi
9427 rm -fr conftest*
9428
9429
9430 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9431 if test $ac_cv_func_getpgrp_void = yes; then
9432   { test "$extra_verbose" = "yes" && cat << \EOF
9433     Defining GETPGRP_VOID
9434 EOF
9435 cat >> confdefs.h <<\EOF
9436 #define GETPGRP_VOID 1
9437 EOF
9438 }
9439
9440 fi
9441
9442
9443 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9444 echo "configure:9445: checking for working mmap" >&5
9445 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9446 cat > conftest.$ac_ext <<EOF
9447 #line 9448 "configure"
9448 #include "confdefs.h"
9449 #include <stdio.h>
9450 #include <unistd.h>
9451 #include <fcntl.h>
9452 #include <sys/mman.h>
9453
9454 #ifndef MAP_VARIABLE
9455 #define MAP_VARIABLE 0
9456 #endif
9457
9458 #ifndef MAP_FAILED
9459 #define MAP_FAILED -1
9460 #endif
9461
9462 int main (int argc, char *argv[])
9463 {
9464   int fd = -1;
9465   caddr_t p;
9466 #ifndef MAP_ANONYMOUS
9467   fd = open ("/dev/zero", O_RDWR);
9468   if (fd < 0)
9469     return 1;
9470 #define MAP_ANONYMOUS 0
9471 #endif
9472   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9473            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9474            fd, 0) != (void *) MAP_FAILED)
9475     return 0;
9476   perror ("conftest: mmap failed");
9477   return 1;
9478 }
9479 EOF
9480 if { (eval echo configure:9481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9481 then
9482   have_mmap=yes
9483 else
9484   conftest_rc="$?"
9485   echo "configure: failed program was:" >&5
9486   cat conftest.$ac_ext >&5
9487   rm -fr conftest*
9488   have_mmap=no
9489 fi
9490 rm -fr conftest* ;;
9491 esac
9492 echo "$ac_t""$have_mmap" 1>&6
9493 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9494     Defining HAVE_MMAP
9495 EOF
9496 cat >> confdefs.h <<\EOF
9497 #define HAVE_MMAP 1
9498 EOF
9499 }
9500
9501 for ac_hdr in unistd.h
9502 do
9503 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9504 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9505 echo "configure:9506: checking for $ac_hdr" >&5
9506
9507 cat > conftest.$ac_ext <<EOF
9508 #line 9509 "configure"
9509 #include "confdefs.h"
9510 #include <$ac_hdr>
9511 EOF
9512 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9513 { (eval echo configure:9514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9514 ac_err=`grep -v '^ *+' conftest.out`
9515 if test -z "$ac_err"; then
9516   rm -rf conftest*
9517   eval "ac_cv_header_$ac_safe=yes"
9518 else
9519   echo "$ac_err" >&5
9520   echo "configure: failed program was:" >&5
9521   cat conftest.$ac_ext >&5
9522   rm -rf conftest*
9523   eval "ac_cv_header_$ac_safe=no"
9524 fi
9525 rm -f conftest*
9526 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9527   echo "$ac_t""yes" 1>&6
9528     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9529   { test "$extra_verbose" = "yes" && cat << EOF
9530     Defining $ac_tr_hdr
9531 EOF
9532 cat >> confdefs.h <<EOF
9533 #define $ac_tr_hdr 1
9534 EOF
9535 }
9536  
9537 else
9538   echo "$ac_t""no" 1>&6
9539 fi
9540 done
9541
9542 for ac_func in getpagesize
9543 do
9544 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9545 echo "configure:9546: checking for $ac_func" >&5
9546
9547 cat > conftest.$ac_ext <<EOF
9548 #line 9549 "configure"
9549 #include "confdefs.h"
9550 /* System header to define __stub macros and hopefully few prototypes,
9551     which can conflict with char $ac_func(); below.  */
9552 #include <assert.h>
9553 /* Override any gcc2 internal prototype to avoid an error.  */
9554 /* We use char because int might match the return type of a gcc2
9555     builtin and then its argument prototype would still apply.  */
9556 char $ac_func();
9557
9558 int main() {
9559
9560 /* The GNU C library defines this for functions which it implements
9561     to always fail with ENOSYS.  Some functions are actually named
9562     something starting with __ and the normal name is an alias.  */
9563 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9564 choke me
9565 #else
9566 $ac_func();
9567 #endif
9568
9569 ; return 0; }
9570 EOF
9571 if { (eval echo configure:9572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9572   rm -rf conftest*
9573   eval "ac_cv_func_$ac_func=yes"
9574 else
9575   echo "configure: failed program was:" >&5
9576   cat conftest.$ac_ext >&5
9577   rm -rf conftest*
9578   eval "ac_cv_func_$ac_func=no"
9579 fi
9580 rm -f conftest*
9581
9582 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9583   echo "$ac_t""yes" 1>&6
9584     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9585   { test "$extra_verbose" = "yes" && cat << EOF
9586     Defining $ac_tr_func
9587 EOF
9588 cat >> confdefs.h <<EOF
9589 #define $ac_tr_func 1
9590 EOF
9591 }
9592  
9593 else
9594   echo "$ac_t""no" 1>&6
9595 fi
9596 done
9597
9598 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9599 echo "configure:9600: checking for working mmap" >&5
9600
9601 cat > conftest.$ac_ext <<EOF
9602 #line 9603 "configure"
9603 #include "confdefs.h"
9604
9605 /* Thanks to Mike Haertel and Jim Avera for this test.
9606    Here is a matrix of mmap possibilities:
9607         mmap private not fixed
9608         mmap private fixed at somewhere currently unmapped
9609         mmap private fixed at somewhere already mapped
9610         mmap shared not fixed
9611         mmap shared fixed at somewhere currently unmapped
9612         mmap shared fixed at somewhere already mapped
9613    For private mappings, we should verify that changes cannot be read()
9614    back from the file, nor mmap's back from the file at a different
9615    address.  (There have been systems where private was not correctly
9616    implemented like the infamous i386 svr4.0, and systems where the
9617    VM page cache was not coherent with the filesystem buffer cache
9618    like early versions of FreeBSD and possibly contemporary NetBSD.)
9619    For shared mappings, we should conversely verify that changes get
9620    propogated back to all the places they're supposed to be.
9621
9622    Grep wants private fixed already mapped.
9623    The main things grep needs to know about mmap are:
9624    * does it exist and is it safe to write into the mmap'd area
9625    * how to use it (BSD variants)  */
9626 #include <sys/types.h>
9627 #include <fcntl.h>
9628 #include <sys/mman.h>
9629
9630 /* This mess was copied from the GNU getpagesize.h.  */
9631 #ifndef HAVE_GETPAGESIZE
9632 # ifdef HAVE_UNISTD_H
9633 #  include <unistd.h>
9634 # endif
9635
9636 /* Assume that all systems that can run configure have sys/param.h.  */
9637 # ifndef HAVE_SYS_PARAM_H
9638 #  define HAVE_SYS_PARAM_H 1
9639 # endif
9640
9641 # ifdef _SC_PAGESIZE
9642 #  define getpagesize() sysconf(_SC_PAGESIZE)
9643 # else /* no _SC_PAGESIZE */
9644 #  ifdef HAVE_SYS_PARAM_H
9645 #   include <sys/param.h>
9646 #   ifdef EXEC_PAGESIZE
9647 #    define getpagesize() EXEC_PAGESIZE
9648 #   else /* no EXEC_PAGESIZE */
9649 #    ifdef NBPG
9650 #     define getpagesize() NBPG * CLSIZE
9651 #     ifndef CLSIZE
9652 #      define CLSIZE 1
9653 #     endif /* no CLSIZE */
9654 #    else /* no NBPG */
9655 #     ifdef NBPC
9656 #      define getpagesize() NBPC
9657 #     else /* no NBPC */
9658 #      ifdef PAGESIZE
9659 #       define getpagesize() PAGESIZE
9660 #      endif /* PAGESIZE */
9661 #     endif /* no NBPC */
9662 #    endif /* no NBPG */
9663 #   endif /* no EXEC_PAGESIZE */
9664 #  else /* no HAVE_SYS_PARAM_H */
9665 #   define getpagesize() 8192   /* punt totally */
9666 #  endif /* no HAVE_SYS_PARAM_H */
9667 # endif /* no _SC_PAGESIZE */
9668
9669 #endif /* no HAVE_GETPAGESIZE */
9670
9671 #ifdef __cplusplus
9672 extern "C" { void *malloc(unsigned); }
9673 #else
9674 char *malloc();
9675 #endif
9676
9677 int
9678 main()
9679 {
9680         char *data, *data2, *data3;
9681         int i, pagesize;
9682         int fd;
9683
9684         pagesize = getpagesize();
9685
9686         /*
9687          * First, make a file with some known garbage in it.
9688          */
9689         data = malloc(pagesize);
9690         if (!data)
9691                 exit(1);
9692         for (i = 0; i < pagesize; ++i)
9693                 *(data + i) = rand();
9694         umask(0);
9695         fd = creat("conftestmmap", 0600);
9696         if (fd < 0)
9697                 exit(1);
9698         if (write(fd, data, pagesize) != pagesize)
9699                 exit(1);
9700         close(fd);
9701
9702         /*
9703          * Next, try to mmap the file at a fixed address which
9704          * already has something else allocated at it.  If we can,
9705          * also make sure that we see the same garbage.
9706          */
9707         fd = open("conftestmmap", O_RDWR);
9708         if (fd < 0)
9709                 exit(1);
9710         data2 = malloc(2 * pagesize);
9711         if (!data2)
9712                 exit(1);
9713         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
9714         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
9715             MAP_PRIVATE | MAP_FIXED, fd, 0L))
9716                 exit(1);
9717         for (i = 0; i < pagesize; ++i)
9718                 if (*(data + i) != *(data2 + i))
9719                         exit(1);
9720
9721         /*
9722          * Finally, make sure that changes to the mapped area
9723          * do not percolate back to the file as seen by read().
9724          * (This is a bug on some variants of i386 svr4.0.)
9725          */
9726         for (i = 0; i < pagesize; ++i)
9727                 *(data2 + i) = *(data2 + i) + 1;
9728         data3 = malloc(pagesize);
9729         if (!data3)
9730                 exit(1);
9731         if (read(fd, data3, pagesize) != pagesize)
9732                 exit(1);
9733         for (i = 0; i < pagesize; ++i)
9734                 if (*(data + i) != *(data3 + i))
9735                         exit(1);
9736         close(fd);
9737         unlink("conftestmmap");
9738         exit(0);
9739 }
9740
9741 EOF
9742 if { (eval echo configure:9743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9743 then
9744   ac_cv_func_mmap_fixed_mapped=yes
9745 else
9746   conftest_rc="$?"
9747   echo "configure: failed program was:" >&5
9748   cat conftest.$ac_ext >&5
9749   rm -fr conftest*
9750   ac_cv_func_mmap_fixed_mapped=no
9751 fi
9752 rm -fr conftest*
9753
9754 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
9755 if test $ac_cv_func_mmap_fixed_mapped = yes; then
9756   { test "$extra_verbose" = "yes" && cat << \EOF
9757     Defining HAVE_MMAP
9758 EOF
9759 cat >> confdefs.h <<\EOF
9760 #define HAVE_MMAP 1
9761 EOF
9762 }
9763
9764 fi
9765
9766
9767 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9768 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9769 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9770     Defining REL_ALLOC
9771 EOF
9772 cat >> confdefs.h <<\EOF
9773 #define REL_ALLOC 1
9774 EOF
9775 }
9776
9777
9778 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
9779 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
9780 echo "configure:9781: checking for termios.h" >&5
9781
9782 cat > conftest.$ac_ext <<EOF
9783 #line 9784 "configure"
9784 #include "confdefs.h"
9785 #include <termios.h>
9786 EOF
9787 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9788 { (eval echo configure:9789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9789 ac_err=`grep -v '^ *+' conftest.out`
9790 if test -z "$ac_err"; then
9791   rm -rf conftest*
9792   eval "ac_cv_header_$ac_safe=yes"
9793 else
9794   echo "$ac_err" >&5
9795   echo "configure: failed program was:" >&5
9796   cat conftest.$ac_ext >&5
9797   rm -rf conftest*
9798   eval "ac_cv_header_$ac_safe=no"
9799 fi
9800 rm -f conftest*
9801 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9802   echo "$ac_t""yes" 1>&6
9803   { test "$extra_verbose" = "yes" && cat << \EOF
9804     Defining HAVE_TERMIOS
9805 EOF
9806 cat >> confdefs.h <<\EOF
9807 #define HAVE_TERMIOS 1
9808 EOF
9809 }
9810
9811   { test "$extra_verbose" = "yes" && cat << \EOF
9812     Defining SIGNALS_VIA_CHARACTERS
9813 EOF
9814 cat >> confdefs.h <<\EOF
9815 #define SIGNALS_VIA_CHARACTERS 1
9816 EOF
9817 }
9818
9819   { test "$extra_verbose" = "yes" && cat << \EOF
9820     Defining NO_TERMIO
9821 EOF
9822 cat >> confdefs.h <<\EOF
9823 #define NO_TERMIO 1
9824 EOF
9825 }
9826
9827 else
9828   echo "$ac_t""no" 1>&6
9829 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
9830 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
9831 echo "configure:9832: checking for termio.h" >&5
9832
9833 cat > conftest.$ac_ext <<EOF
9834 #line 9835 "configure"
9835 #include "confdefs.h"
9836 #include <termio.h>
9837 EOF
9838 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9839 { (eval echo configure:9840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9840 ac_err=`grep -v '^ *+' conftest.out`
9841 if test -z "$ac_err"; then
9842   rm -rf conftest*
9843   eval "ac_cv_header_$ac_safe=yes"
9844 else
9845   echo "$ac_err" >&5
9846   echo "configure: failed program was:" >&5
9847   cat conftest.$ac_ext >&5
9848   rm -rf conftest*
9849   eval "ac_cv_header_$ac_safe=no"
9850 fi
9851 rm -f conftest*
9852 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9853   echo "$ac_t""yes" 1>&6
9854   { test "$extra_verbose" = "yes" && cat << \EOF
9855     Defining HAVE_TERMIO
9856 EOF
9857 cat >> confdefs.h <<\EOF
9858 #define HAVE_TERMIO 1
9859 EOF
9860 }
9861
9862 else
9863   echo "$ac_t""no" 1>&6
9864 fi
9865
9866 fi
9867
9868
9869
9870 echo $ac_n "checking for socket""... $ac_c" 1>&6
9871 echo "configure:9872: checking for socket" >&5
9872
9873 cat > conftest.$ac_ext <<EOF
9874 #line 9875 "configure"
9875 #include "confdefs.h"
9876 /* System header to define __stub macros and hopefully few prototypes,
9877     which can conflict with char socket(); below.  */
9878 #include <assert.h>
9879 /* Override any gcc2 internal prototype to avoid an error.  */
9880 /* We use char because int might match the return type of a gcc2
9881     builtin and then its argument prototype would still apply.  */
9882 char socket();
9883
9884 int main() {
9885
9886 /* The GNU C library defines this for functions which it implements
9887     to always fail with ENOSYS.  Some functions are actually named
9888     something starting with __ and the normal name is an alias.  */
9889 #if defined (__stub_socket) || defined (__stub___socket)
9890 choke me
9891 #else
9892 socket();
9893 #endif
9894
9895 ; return 0; }
9896 EOF
9897 if { (eval echo configure:9898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9898   rm -rf conftest*
9899   eval "ac_cv_func_socket=yes"
9900 else
9901   echo "configure: failed program was:" >&5
9902   cat conftest.$ac_ext >&5
9903   rm -rf conftest*
9904   eval "ac_cv_func_socket=no"
9905 fi
9906 rm -f conftest*
9907
9908 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9909   echo "$ac_t""yes" 1>&6
9910   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
9911 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
9912 echo "configure:9913: checking for netinet/in.h" >&5
9913
9914 cat > conftest.$ac_ext <<EOF
9915 #line 9916 "configure"
9916 #include "confdefs.h"
9917 #include <netinet/in.h>
9918 EOF
9919 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9920 { (eval echo configure:9921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9921 ac_err=`grep -v '^ *+' conftest.out`
9922 if test -z "$ac_err"; then
9923   rm -rf conftest*
9924   eval "ac_cv_header_$ac_safe=yes"
9925 else
9926   echo "$ac_err" >&5
9927   echo "configure: failed program was:" >&5
9928   cat conftest.$ac_ext >&5
9929   rm -rf conftest*
9930   eval "ac_cv_header_$ac_safe=no"
9931 fi
9932 rm -f conftest*
9933 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9934   echo "$ac_t""yes" 1>&6
9935   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
9936 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
9937 echo "configure:9938: checking for arpa/inet.h" >&5
9938
9939 cat > conftest.$ac_ext <<EOF
9940 #line 9941 "configure"
9941 #include "confdefs.h"
9942 #include <arpa/inet.h>
9943 EOF
9944 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9945 { (eval echo configure:9946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9946 ac_err=`grep -v '^ *+' conftest.out`
9947 if test -z "$ac_err"; then
9948   rm -rf conftest*
9949   eval "ac_cv_header_$ac_safe=yes"
9950 else
9951   echo "$ac_err" >&5
9952   echo "configure: failed program was:" >&5
9953   cat conftest.$ac_ext >&5
9954   rm -rf conftest*
9955   eval "ac_cv_header_$ac_safe=no"
9956 fi
9957 rm -f conftest*
9958 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9959   echo "$ac_t""yes" 1>&6
9960   
9961   { test "$extra_verbose" = "yes" && cat << \EOF
9962     Defining HAVE_SOCKETS
9963 EOF
9964 cat >> confdefs.h <<\EOF
9965 #define HAVE_SOCKETS 1
9966 EOF
9967 }
9968
9969       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
9970 echo "configure:9971: checking "for sun_len member in struct sockaddr_un"" >&5
9971       cat > conftest.$ac_ext <<EOF
9972 #line 9973 "configure"
9973 #include "confdefs.h"
9974
9975 #include <sys/types.h>
9976 #include <sys/socket.h>
9977 #include <sys/un.h>
9978       
9979 int main() {
9980 static struct sockaddr_un x; x.sun_len = 1;
9981 ; return 0; }
9982 EOF
9983 if { (eval echo configure:9984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9984   rm -rf conftest*
9985   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
9986     Defining HAVE_SOCKADDR_SUN_LEN
9987 EOF
9988 cat >> confdefs.h <<\EOF
9989 #define HAVE_SOCKADDR_SUN_LEN 1
9990 EOF
9991 }
9992
9993 else
9994   echo "configure: failed program was:" >&5
9995   cat conftest.$ac_ext >&5
9996   rm -rf conftest*
9997   echo "$ac_t""no" 1>&6
9998 fi
9999 rm -f conftest*
10000       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10001 echo "configure:10002: checking "for ip_mreq struct in netinet/in.h"" >&5
10002       cat > conftest.$ac_ext <<EOF
10003 #line 10004 "configure"
10004 #include "confdefs.h"
10005
10006 #include <sys/types.h>
10007 #include <netinet/in.h>
10008       
10009 int main() {
10010 static struct ip_mreq x;
10011 ; return 0; }
10012 EOF
10013 if { (eval echo configure:10014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10014   rm -rf conftest*
10015   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10016     Defining HAVE_MULTICAST
10017 EOF
10018 cat >> confdefs.h <<\EOF
10019 #define HAVE_MULTICAST 1
10020 EOF
10021 }
10022
10023 else
10024   echo "configure: failed program was:" >&5
10025   cat conftest.$ac_ext >&5
10026   rm -rf conftest*
10027   echo "$ac_t""no" 1>&6
10028 fi
10029 rm -f conftest*
10030 else
10031   echo "$ac_t""no" 1>&6
10032 fi
10033
10034 else
10035   echo "$ac_t""no" 1>&6
10036 fi
10037
10038 else
10039   echo "$ac_t""no" 1>&6
10040 fi
10041
10042
10043 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10044 echo "configure:10045: checking for msgget" >&5
10045
10046 cat > conftest.$ac_ext <<EOF
10047 #line 10048 "configure"
10048 #include "confdefs.h"
10049 /* System header to define __stub macros and hopefully few prototypes,
10050     which can conflict with char msgget(); below.  */
10051 #include <assert.h>
10052 /* Override any gcc2 internal prototype to avoid an error.  */
10053 /* We use char because int might match the return type of a gcc2
10054     builtin and then its argument prototype would still apply.  */
10055 char msgget();
10056
10057 int main() {
10058
10059 /* The GNU C library defines this for functions which it implements
10060     to always fail with ENOSYS.  Some functions are actually named
10061     something starting with __ and the normal name is an alias.  */
10062 #if defined (__stub_msgget) || defined (__stub___msgget)
10063 choke me
10064 #else
10065 msgget();
10066 #endif
10067
10068 ; return 0; }
10069 EOF
10070 if { (eval echo configure:10071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10071   rm -rf conftest*
10072   eval "ac_cv_func_msgget=yes"
10073 else
10074   echo "configure: failed program was:" >&5
10075   cat conftest.$ac_ext >&5
10076   rm -rf conftest*
10077   eval "ac_cv_func_msgget=no"
10078 fi
10079 rm -f conftest*
10080
10081 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10082   echo "$ac_t""yes" 1>&6
10083   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10084 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10085 echo "configure:10086: checking for sys/ipc.h" >&5
10086
10087 cat > conftest.$ac_ext <<EOF
10088 #line 10089 "configure"
10089 #include "confdefs.h"
10090 #include <sys/ipc.h>
10091 EOF
10092 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10093 { (eval echo configure:10094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10094 ac_err=`grep -v '^ *+' conftest.out`
10095 if test -z "$ac_err"; then
10096   rm -rf conftest*
10097   eval "ac_cv_header_$ac_safe=yes"
10098 else
10099   echo "$ac_err" >&5
10100   echo "configure: failed program was:" >&5
10101   cat conftest.$ac_ext >&5
10102   rm -rf conftest*
10103   eval "ac_cv_header_$ac_safe=no"
10104 fi
10105 rm -f conftest*
10106 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10107   echo "$ac_t""yes" 1>&6
10108   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10109 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10110 echo "configure:10111: checking for sys/msg.h" >&5
10111
10112 cat > conftest.$ac_ext <<EOF
10113 #line 10114 "configure"
10114 #include "confdefs.h"
10115 #include <sys/msg.h>
10116 EOF
10117 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10118 { (eval echo configure:10119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10119 ac_err=`grep -v '^ *+' conftest.out`
10120 if test -z "$ac_err"; then
10121   rm -rf conftest*
10122   eval "ac_cv_header_$ac_safe=yes"
10123 else
10124   echo "$ac_err" >&5
10125   echo "configure: failed program was:" >&5
10126   cat conftest.$ac_ext >&5
10127   rm -rf conftest*
10128   eval "ac_cv_header_$ac_safe=no"
10129 fi
10130 rm -f conftest*
10131 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10132   echo "$ac_t""yes" 1>&6
10133   { test "$extra_verbose" = "yes" && cat << \EOF
10134     Defining HAVE_SYSVIPC
10135 EOF
10136 cat >> confdefs.h <<\EOF
10137 #define HAVE_SYSVIPC 1
10138 EOF
10139 }
10140
10141 else
10142   echo "$ac_t""no" 1>&6
10143 fi
10144
10145 else
10146   echo "$ac_t""no" 1>&6
10147 fi
10148
10149 else
10150   echo "$ac_t""no" 1>&6
10151 fi
10152
10153
10154 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10155 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10156 echo "configure:10157: checking for dirent.h" >&5
10157
10158 cat > conftest.$ac_ext <<EOF
10159 #line 10160 "configure"
10160 #include "confdefs.h"
10161 #include <dirent.h>
10162 EOF
10163 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10164 { (eval echo configure:10165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10165 ac_err=`grep -v '^ *+' conftest.out`
10166 if test -z "$ac_err"; then
10167   rm -rf conftest*
10168   eval "ac_cv_header_$ac_safe=yes"
10169 else
10170   echo "$ac_err" >&5
10171   echo "configure: failed program was:" >&5
10172   cat conftest.$ac_ext >&5
10173   rm -rf conftest*
10174   eval "ac_cv_header_$ac_safe=no"
10175 fi
10176 rm -f conftest*
10177 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10178   echo "$ac_t""yes" 1>&6
10179   { test "$extra_verbose" = "yes" && cat << \EOF
10180     Defining SYSV_SYSTEM_DIR
10181 EOF
10182 cat >> confdefs.h <<\EOF
10183 #define SYSV_SYSTEM_DIR 1
10184 EOF
10185 }
10186
10187 else
10188   echo "$ac_t""no" 1>&6
10189 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10190 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10191 echo "configure:10192: checking for sys/dir.h" >&5
10192
10193 cat > conftest.$ac_ext <<EOF
10194 #line 10195 "configure"
10195 #include "confdefs.h"
10196 #include <sys/dir.h>
10197 EOF
10198 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10199 { (eval echo configure:10200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10200 ac_err=`grep -v '^ *+' conftest.out`
10201 if test -z "$ac_err"; then
10202   rm -rf conftest*
10203   eval "ac_cv_header_$ac_safe=yes"
10204 else
10205   echo "$ac_err" >&5
10206   echo "configure: failed program was:" >&5
10207   cat conftest.$ac_ext >&5
10208   rm -rf conftest*
10209   eval "ac_cv_header_$ac_safe=no"
10210 fi
10211 rm -f conftest*
10212 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10213   echo "$ac_t""yes" 1>&6
10214   :
10215 else
10216   echo "$ac_t""no" 1>&6
10217 { test "$extra_verbose" = "yes" && cat << \EOF
10218     Defining NONSYSTEM_DIR_LIBRARY
10219 EOF
10220 cat >> confdefs.h <<\EOF
10221 #define NONSYSTEM_DIR_LIBRARY 1
10222 EOF
10223 }
10224
10225 fi
10226
10227 fi
10228
10229
10230 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10231 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10232 echo "configure:10233: checking for nlist.h" >&5
10233
10234 cat > conftest.$ac_ext <<EOF
10235 #line 10236 "configure"
10236 #include "confdefs.h"
10237 #include <nlist.h>
10238 EOF
10239 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10240 { (eval echo configure:10241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10241 ac_err=`grep -v '^ *+' conftest.out`
10242 if test -z "$ac_err"; then
10243   rm -rf conftest*
10244   eval "ac_cv_header_$ac_safe=yes"
10245 else
10246   echo "$ac_err" >&5
10247   echo "configure: failed program was:" >&5
10248   cat conftest.$ac_ext >&5
10249   rm -rf conftest*
10250   eval "ac_cv_header_$ac_safe=no"
10251 fi
10252 rm -f conftest*
10253 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10254   echo "$ac_t""yes" 1>&6
10255   { test "$extra_verbose" = "yes" && cat << \EOF
10256     Defining NLIST_STRUCT
10257 EOF
10258 cat >> confdefs.h <<\EOF
10259 #define NLIST_STRUCT 1
10260 EOF
10261 }
10262
10263 else
10264   echo "$ac_t""no" 1>&6
10265 fi
10266
10267
10268
10269 echo "checking "for sound support"" 1>&6
10270 echo "configure:10271: checking "for sound support"" >&5
10271 case "$with_sound" in
10272   native | both ) with_native_sound=yes;;
10273   nas    | no   ) with_native_sound=no;;
10274 esac
10275 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10276
10277 if test "$with_native_sound" != "no"; then
10278     if test -n "$native_sound_lib"; then
10279     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10280 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10281 echo "configure:10282: checking for multimedia/audio_device.h" >&5
10282
10283 cat > conftest.$ac_ext <<EOF
10284 #line 10285 "configure"
10285 #include "confdefs.h"
10286 #include <multimedia/audio_device.h>
10287 EOF
10288 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10289 { (eval echo configure:10290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10290 ac_err=`grep -v '^ *+' conftest.out`
10291 if test -z "$ac_err"; then
10292   rm -rf conftest*
10293   eval "ac_cv_header_$ac_safe=yes"
10294 else
10295   echo "$ac_err" >&5
10296   echo "configure: failed program was:" >&5
10297   cat conftest.$ac_ext >&5
10298   rm -rf conftest*
10299   eval "ac_cv_header_$ac_safe=no"
10300 fi
10301 rm -f conftest*
10302 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10303   echo "$ac_t""yes" 1>&6
10304   sound_found=yes sound_cflags=""
10305       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10306    echo "    xemacs will be linked with \"sunplay.o\""
10307  fi
10308 else
10309   echo "$ac_t""no" 1>&6
10310 fi
10311
10312   fi
10313
10314     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10315     sound_found=yes
10316     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10317    echo "    xemacs will be linked with \"sunplay.o\""
10318  fi
10319     if test -d "/usr/demo/SOUND/include"
10320       then sound_cflags="-I/usr/demo/SOUND/include"
10321       else sound_cflags="-I/usr/demo/SOUND"
10322     fi
10323     if test -z "$native_sound_lib" ; then
10324       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10325         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10326         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10327       fi
10328     fi
10329   fi
10330
10331     if test -z "$sound_found"; then
10332     case "$canonical" in
10333     *-sgi-* )
10334       if test -z "$native_sound_lib"; then
10335         
10336 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10337 echo "configure:10338: checking for ALopenport in -laudio" >&5
10338 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10339
10340 xe_check_libs=" -laudio "
10341 cat > conftest.$ac_ext <<EOF
10342 #line 10343 "configure"
10343 #include "confdefs.h"
10344 /* Override any gcc2 internal prototype to avoid an error.  */
10345 /* We use char because int might match the return type of a gcc2
10346     builtin and then its argument prototype would still apply.  */
10347 char ALopenport();
10348
10349 int main() {
10350 ALopenport()
10351 ; return 0; }
10352 EOF
10353 if { (eval echo configure:10354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10354   rm -rf conftest*
10355   eval "ac_cv_lib_$ac_lib_var=yes"
10356 else
10357   echo "configure: failed program was:" >&5
10358   cat conftest.$ac_ext >&5
10359   rm -rf conftest*
10360   eval "ac_cv_lib_$ac_lib_var=no"
10361 fi
10362 rm -f conftest*
10363 xe_check_libs=""
10364
10365 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10366   echo "$ac_t""yes" 1>&6
10367   native_sound_lib="-laudio"
10368 else
10369   echo "$ac_t""no" 1>&6
10370 fi
10371
10372
10373       fi
10374       if test -n "$native_sound_lib"; then
10375         sound_found=yes sound_cflags=""
10376         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10377    echo "    xemacs will be linked with \"sgiplay.o\""
10378  fi
10379       fi ;;
10380     hppa*-hp-hpux* )
10381       if test -z "$native_sound_lib"; then
10382         
10383 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10384 echo "configure:10385: checking for AOpenAudio in -lAlib" >&5
10385 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10386
10387 xe_check_libs=" -lAlib "
10388 cat > conftest.$ac_ext <<EOF
10389 #line 10390 "configure"
10390 #include "confdefs.h"
10391 /* Override any gcc2 internal prototype to avoid an error.  */
10392 /* We use char because int might match the return type of a gcc2
10393     builtin and then its argument prototype would still apply.  */
10394 char AOpenAudio();
10395
10396 int main() {
10397 AOpenAudio()
10398 ; return 0; }
10399 EOF
10400 if { (eval echo configure:10401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10401   rm -rf conftest*
10402   eval "ac_cv_lib_$ac_lib_var=yes"
10403 else
10404   echo "configure: failed program was:" >&5
10405   cat conftest.$ac_ext >&5
10406   rm -rf conftest*
10407   eval "ac_cv_lib_$ac_lib_var=no"
10408 fi
10409 rm -f conftest*
10410 xe_check_libs=""
10411
10412 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10413   echo "$ac_t""yes" 1>&6
10414   native_sound_lib="-lAlib"
10415 else
10416   echo "$ac_t""no" 1>&6
10417 fi
10418
10419
10420       fi
10421       if test -n "$native_sound_lib"; then
10422         sound_found=yes
10423         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10424    echo "    xemacs will be linked with \"hpplay.o\""
10425  fi
10426         if test "$GCC" = "yes" # Kludge city
10427           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10428           else sound_cflags="+e -I/usr/audio/examples"
10429         fi
10430       fi ;;
10431     esac
10432   fi
10433
10434     if test -z "$sound_found"; then
10435     for dir in "machine" "sys" "linux"; do
10436       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10437 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10438 echo "configure:10439: checking for ${dir}/soundcard.h" >&5
10439
10440 cat > conftest.$ac_ext <<EOF
10441 #line 10442 "configure"
10442 #include "confdefs.h"
10443 #include <${dir}/soundcard.h>
10444 EOF
10445 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10446 { (eval echo configure:10447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10447 ac_err=`grep -v '^ *+' conftest.out`
10448 if test -z "$ac_err"; then
10449   rm -rf conftest*
10450   eval "ac_cv_header_$ac_safe=yes"
10451 else
10452   echo "$ac_err" >&5
10453   echo "configure: failed program was:" >&5
10454   cat conftest.$ac_ext >&5
10455   rm -rf conftest*
10456   eval "ac_cv_header_$ac_safe=no"
10457 fi
10458 rm -f conftest*
10459 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10460   echo "$ac_t""yes" 1>&6
10461   sound_found=yes
10462         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10463    echo "    xemacs will be linked with \"linuxplay.o\""
10464  fi
10465         { test "$extra_verbose" = "yes" && cat << EOF
10466     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10467 EOF
10468 cat >> confdefs.h <<EOF
10469 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10470 EOF
10471 }
10472
10473         break
10474 else
10475   echo "$ac_t""no" 1>&6
10476 fi
10477
10478     done
10479   fi
10480
10481   test "$sound_found" = "yes" && with_native_sound=yes
10482 fi
10483
10484 if test -z "$with_sound"; then
10485   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10486     with_sound=native
10487   fi
10488 fi
10489
10490 if test "$with_native_sound" = "yes"; then
10491   { test "$extra_verbose" = "yes" && cat << \EOF
10492     Defining HAVE_NATIVE_SOUND
10493 EOF
10494 cat >> confdefs.h <<\EOF
10495 #define HAVE_NATIVE_SOUND 1
10496 EOF
10497 }
10498
10499   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10500 fi
10501
10502 case "$with_sound" in both | nas )
10503   { test "$extra_verbose" = "yes" && cat << \EOF
10504     Defining HAVE_NAS_SOUND
10505 EOF
10506 cat >> confdefs.h <<\EOF
10507 #define HAVE_NAS_SOUND 1
10508 EOF
10509 }
10510
10511   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10512    echo "    xemacs will be linked with \"nas.o\""
10513  fi
10514   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10515       cat > conftest.$ac_ext <<EOF
10516 #line 10517 "configure"
10517 #include "confdefs.h"
10518 #include <audio/Xtutil.h>
10519 EOF
10520 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10521   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10522   :
10523 else
10524   rm -rf conftest*
10525   { test "$extra_verbose" = "yes" && cat << \EOF
10526     Defining NAS_NO_ERROR_JUMP
10527 EOF
10528 cat >> confdefs.h <<\EOF
10529 #define NAS_NO_ERROR_JUMP 1
10530 EOF
10531 }
10532
10533 fi
10534 rm -f conftest*
10535
10536 esac
10537
10538
10539 test -z "$with_tty" && with_tty=yes
10540
10541 if test "$with_tty" = "yes"  ; then
10542   echo "checking for TTY-related features" 1>&6
10543 echo "configure:10544: checking for TTY-related features" >&5
10544   { test "$extra_verbose" = "yes" && cat << \EOF
10545     Defining HAVE_TTY
10546 EOF
10547 cat >> confdefs.h <<\EOF
10548 #define HAVE_TTY 1
10549 EOF
10550 }
10551
10552   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
10553    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\""
10554  fi
10555
10556     if test -z "$with_ncurses"; then
10557     
10558 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10559 echo "configure:10560: checking for tgetent in -lncurses" >&5
10560 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10561
10562 xe_check_libs=" -lncurses "
10563 cat > conftest.$ac_ext <<EOF
10564 #line 10565 "configure"
10565 #include "confdefs.h"
10566 /* Override any gcc2 internal prototype to avoid an error.  */
10567 /* We use char because int might match the return type of a gcc2
10568     builtin and then its argument prototype would still apply.  */
10569 char tgetent();
10570
10571 int main() {
10572 tgetent()
10573 ; return 0; }
10574 EOF
10575 if { (eval echo configure:10576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10576   rm -rf conftest*
10577   eval "ac_cv_lib_$ac_lib_var=yes"
10578 else
10579   echo "configure: failed program was:" >&5
10580   cat conftest.$ac_ext >&5
10581   rm -rf conftest*
10582   eval "ac_cv_lib_$ac_lib_var=no"
10583 fi
10584 rm -f conftest*
10585 xe_check_libs=""
10586
10587 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10588   echo "$ac_t""yes" 1>&6
10589   with_ncurses=yes
10590 else
10591   echo "$ac_t""no" 1>&6
10592 with_ncurses=no
10593 fi
10594
10595
10596   fi
10597   if test "$with_ncurses" = "yes"; then
10598     { test "$extra_verbose" = "yes" && cat << \EOF
10599     Defining HAVE_NCURSES
10600 EOF
10601 cat >> confdefs.h <<\EOF
10602 #define HAVE_NCURSES 1
10603 EOF
10604 }
10605
10606     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10607 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10608 echo "configure:10609: checking for ncurses/curses.h" >&5
10609
10610 cat > conftest.$ac_ext <<EOF
10611 #line 10612 "configure"
10612 #include "confdefs.h"
10613 #include <ncurses/curses.h>
10614 EOF
10615 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10616 { (eval echo configure:10617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10617 ac_err=`grep -v '^ *+' conftest.out`
10618 if test -z "$ac_err"; then
10619   rm -rf conftest*
10620   eval "ac_cv_header_$ac_safe=yes"
10621 else
10622   echo "$ac_err" >&5
10623   echo "configure: failed program was:" >&5
10624   cat conftest.$ac_ext >&5
10625   rm -rf conftest*
10626   eval "ac_cv_header_$ac_safe=no"
10627 fi
10628 rm -f conftest*
10629 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10630   echo "$ac_t""yes" 1>&6
10631   curses_h_path=ncurses/curses.h
10632 else
10633   echo "$ac_t""no" 1>&6
10634 fi
10635
10636     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10637 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10638 echo "configure:10639: checking for ncurses/term.h" >&5
10639
10640 cat > conftest.$ac_ext <<EOF
10641 #line 10642 "configure"
10642 #include "confdefs.h"
10643 #include <ncurses/term.h>
10644 EOF
10645 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10646 { (eval echo configure:10647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10647 ac_err=`grep -v '^ *+' conftest.out`
10648 if test -z "$ac_err"; then
10649   rm -rf conftest*
10650   eval "ac_cv_header_$ac_safe=yes"
10651 else
10652   echo "$ac_err" >&5
10653   echo "configure: failed program was:" >&5
10654   cat conftest.$ac_ext >&5
10655   rm -rf conftest*
10656   eval "ac_cv_header_$ac_safe=no"
10657 fi
10658 rm -f conftest*
10659 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10660   echo "$ac_t""yes" 1>&6
10661   term_h_path=ncurses/term.h
10662 else
10663   echo "$ac_t""no" 1>&6
10664 fi
10665
10666     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10667    echo "    xemacs will be linked with \"terminfo.o\""
10668  fi
10669     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10670
10671     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10672                         save_c_switch_site="$c_switch_site"
10673       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10674       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10675 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10676 echo "configure:10677: checking for ncurses/curses.h" >&5
10677
10678 cat > conftest.$ac_ext <<EOF
10679 #line 10680 "configure"
10680 #include "confdefs.h"
10681 #include <ncurses/curses.h>
10682 EOF
10683 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10684 { (eval echo configure:10685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10685 ac_err=`grep -v '^ *+' conftest.out`
10686 if test -z "$ac_err"; then
10687   rm -rf conftest*
10688   eval "ac_cv_header_$ac_safe=yes"
10689 else
10690   echo "$ac_err" >&5
10691   echo "configure: failed program was:" >&5
10692   cat conftest.$ac_ext >&5
10693   rm -rf conftest*
10694   eval "ac_cv_header_$ac_safe=no"
10695 fi
10696 rm -f conftest*
10697 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10698   echo "$ac_t""yes" 1>&6
10699   curses_h_path=ncurses/curses.h
10700 else
10701   echo "$ac_t""no" 1>&6
10702 fi
10703
10704       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10705         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10706         else c_switch_site="$save_c_switch_site"
10707       fi
10708     fi
10709   else         if test "$have_terminfo" = "yes"; then
10710       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10711    echo "    xemacs will be linked with \"terminfo.o\""
10712  fi
10713       if test -n "$libs_termcap"; then
10714         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10715       else
10716         for lib in curses termlib termcap; do
10717           
10718 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10719 echo "configure:10720: checking for tgetent in -l$lib" >&5
10720 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10721
10722 xe_check_libs=" -l$lib "
10723 cat > conftest.$ac_ext <<EOF
10724 #line 10725 "configure"
10725 #include "confdefs.h"
10726 /* Override any gcc2 internal prototype to avoid an error.  */
10727 /* We use char because int might match the return type of a gcc2
10728     builtin and then its argument prototype would still apply.  */
10729 char tgetent();
10730
10731 int main() {
10732 tgetent()
10733 ; return 0; }
10734 EOF
10735 if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10736   rm -rf conftest*
10737   eval "ac_cv_lib_$ac_lib_var=yes"
10738 else
10739   echo "configure: failed program was:" >&5
10740   cat conftest.$ac_ext >&5
10741   rm -rf conftest*
10742   eval "ac_cv_lib_$ac_lib_var=no"
10743 fi
10744 rm -f conftest*
10745 xe_check_libs=""
10746
10747 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10748   echo "$ac_t""yes" 1>&6
10749   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10750 else
10751   echo "$ac_t""no" 1>&6
10752 fi
10753
10754
10755         done
10756       fi
10757     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10758    echo "    xemacs will be linked with \"tparam.o\""
10759  fi
10760                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10761       if test -n "$libs_termcap"; then
10762         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10763       else
10764         
10765 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10766 echo "configure:10767: checking for tgetent in -lcurses" >&5
10767 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10768
10769 xe_check_libs=" -lcurses "
10770 cat > conftest.$ac_ext <<EOF
10771 #line 10772 "configure"
10772 #include "confdefs.h"
10773 /* Override any gcc2 internal prototype to avoid an error.  */
10774 /* We use char because int might match the return type of a gcc2
10775     builtin and then its argument prototype would still apply.  */
10776 char tgetent();
10777
10778 int main() {
10779 tgetent()
10780 ; return 0; }
10781 EOF
10782 if { (eval echo configure:10783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10783   rm -rf conftest*
10784   eval "ac_cv_lib_$ac_lib_var=yes"
10785 else
10786   echo "configure: failed program was:" >&5
10787   cat conftest.$ac_ext >&5
10788   rm -rf conftest*
10789   eval "ac_cv_lib_$ac_lib_var=no"
10790 fi
10791 rm -f conftest*
10792 xe_check_libs=""
10793
10794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10795   echo "$ac_t""yes" 1>&6
10796   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
10797 else
10798   echo "$ac_t""no" 1>&6
10799 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
10800 echo "configure:10801: checking for tgetent in -ltermcap" >&5
10801 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
10802
10803 xe_check_libs=" -ltermcap "
10804 cat > conftest.$ac_ext <<EOF
10805 #line 10806 "configure"
10806 #include "confdefs.h"
10807 /* Override any gcc2 internal prototype to avoid an error.  */
10808 /* We use char because int might match the return type of a gcc2
10809     builtin and then its argument prototype would still apply.  */
10810 char tgetent();
10811
10812 int main() {
10813 tgetent()
10814 ; return 0; }
10815 EOF
10816 if { (eval echo configure:10817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10817   rm -rf conftest*
10818   eval "ac_cv_lib_$ac_lib_var=yes"
10819 else
10820   echo "configure: failed program was:" >&5
10821   cat conftest.$ac_ext >&5
10822   rm -rf conftest*
10823   eval "ac_cv_lib_$ac_lib_var=no"
10824 fi
10825 rm -f conftest*
10826 xe_check_libs=""
10827
10828 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10829   echo "$ac_t""yes" 1>&6
10830   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
10831 else
10832   echo "$ac_t""no" 1>&6
10833 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
10834    echo "    xemacs will be linked with \"termcap.o\""
10835  fi
10836 fi
10837
10838
10839 fi
10840
10841
10842       fi
10843     fi
10844   fi
10845   { test "$extra_verbose" = "yes" && cat << EOF
10846     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
10847 EOF
10848 cat >> confdefs.h <<EOF
10849 #define CURSES_H_PATH "${curses_h_path-curses.h}"
10850 EOF
10851 }
10852
10853   { test "$extra_verbose" = "yes" && cat << EOF
10854     Defining TERM_H_PATH = "${term_h_path-term.h}"
10855 EOF
10856 cat >> confdefs.h <<EOF
10857 #define TERM_H_PATH "${term_h_path-term.h}"
10858 EOF
10859 }
10860
10861
10862     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
10863 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
10864 echo "configure:10865: checking for gpm.h" >&5
10865
10866 cat > conftest.$ac_ext <<EOF
10867 #line 10868 "configure"
10868 #include "confdefs.h"
10869 #include <gpm.h>
10870 EOF
10871 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10872 { (eval echo configure:10873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10873 ac_err=`grep -v '^ *+' conftest.out`
10874 if test -z "$ac_err"; then
10875   rm -rf conftest*
10876   eval "ac_cv_header_$ac_safe=yes"
10877 else
10878   echo "$ac_err" >&5
10879   echo "configure: failed program was:" >&5
10880   cat conftest.$ac_ext >&5
10881   rm -rf conftest*
10882   eval "ac_cv_header_$ac_safe=no"
10883 fi
10884 rm -f conftest*
10885 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10886   echo "$ac_t""yes" 1>&6
10887   :
10888 else
10889   echo "$ac_t""no" 1>&6
10890 with_gpm=no
10891 fi
10892  }
10893   test -z "$with_gpm" && { 
10894 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
10895 echo "configure:10896: checking for Gpm_Open in -lgpm" >&5
10896 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
10897
10898 xe_check_libs=" -lgpm "
10899 cat > conftest.$ac_ext <<EOF
10900 #line 10901 "configure"
10901 #include "confdefs.h"
10902 /* Override any gcc2 internal prototype to avoid an error.  */
10903 /* We use char because int might match the return type of a gcc2
10904     builtin and then its argument prototype would still apply.  */
10905 char Gpm_Open();
10906
10907 int main() {
10908 Gpm_Open()
10909 ; return 0; }
10910 EOF
10911 if { (eval echo configure:10912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10912   rm -rf conftest*
10913   eval "ac_cv_lib_$ac_lib_var=yes"
10914 else
10915   echo "configure: failed program was:" >&5
10916   cat conftest.$ac_ext >&5
10917   rm -rf conftest*
10918   eval "ac_cv_lib_$ac_lib_var=no"
10919 fi
10920 rm -f conftest*
10921 xe_check_libs=""
10922
10923 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10924   echo "$ac_t""yes" 1>&6
10925   with_gpm=yes
10926 else
10927   echo "$ac_t""no" 1>&6
10928 with_gpm=no
10929 fi
10930
10931  }
10932   if test "$with_gpm" = "yes"; then
10933     { test "$extra_verbose" = "yes" && cat << \EOF
10934     Defining HAVE_GPM
10935 EOF
10936 cat >> confdefs.h <<\EOF
10937 #define HAVE_GPM 1
10938 EOF
10939 }
10940
10941     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
10942    echo "    xemacs will be linked with \"gpmevent.o\""
10943  fi
10944     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
10945   fi
10946
10947 else   for feature in ncurses gpm; do
10948     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
10949       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
10950     fi
10951     eval "with_${feature}=no"
10952   done
10953 fi 
10954 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
10955    echo "    xemacs will be linked with \"event-unixoid.o\""
10956  fi
10957
10958
10959 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
10960   != "no no no" && echo "checking for database support" 1>&6
10961 echo "configure:10962: checking for database support" >&5
10962
10963 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
10964   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
10965 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
10966 echo "configure:10967: checking for ndbm.h" >&5
10967
10968 cat > conftest.$ac_ext <<EOF
10969 #line 10970 "configure"
10970 #include "confdefs.h"
10971 #include <ndbm.h>
10972 EOF
10973 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10974 { (eval echo configure:10975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10975 ac_err=`grep -v '^ *+' conftest.out`
10976 if test -z "$ac_err"; then
10977   rm -rf conftest*
10978   eval "ac_cv_header_$ac_safe=yes"
10979 else
10980   echo "$ac_err" >&5
10981   echo "configure: failed program was:" >&5
10982   cat conftest.$ac_ext >&5
10983   rm -rf conftest*
10984   eval "ac_cv_header_$ac_safe=no"
10985 fi
10986 rm -f conftest*
10987 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10988   echo "$ac_t""yes" 1>&6
10989   :
10990 else
10991   echo "$ac_t""no" 1>&6
10992
10993     test "$with_database_gnudbm" = "yes" -o \
10994          "$with_database_dbm"    = "yes" && \
10995       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
10996     with_database_gnudbm=no with_database_dbm=no
10997 fi
10998
10999 fi
11000
11001 if test "$with_database_gnudbm" != "no"; then
11002   
11003 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11004 echo "configure:11005: checking for dbm_open in -lgdbm" >&5
11005 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11006
11007 xe_check_libs=" -lgdbm "
11008 cat > conftest.$ac_ext <<EOF
11009 #line 11010 "configure"
11010 #include "confdefs.h"
11011 /* Override any gcc2 internal prototype to avoid an error.  */
11012 /* We use char because int might match the return type of a gcc2
11013     builtin and then its argument prototype would still apply.  */
11014 char dbm_open();
11015
11016 int main() {
11017 dbm_open()
11018 ; return 0; }
11019 EOF
11020 if { (eval echo configure:11021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11021   rm -rf conftest*
11022   eval "ac_cv_lib_$ac_lib_var=yes"
11023 else
11024   echo "configure: failed program was:" >&5
11025   cat conftest.$ac_ext >&5
11026   rm -rf conftest*
11027   eval "ac_cv_lib_$ac_lib_var=no"
11028 fi
11029 rm -f conftest*
11030 xe_check_libs=""
11031
11032 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11033   echo "$ac_t""yes" 1>&6
11034   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11035 else
11036   echo "$ac_t""no" 1>&6
11037 if test "$with_database_gnudbm" = "yes"; then
11038      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11039    fi
11040    with_database_gnudbm=no
11041 fi
11042
11043
11044 fi
11045
11046 if test "$with_database_dbm" != "no"; then
11047   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11048 echo "configure:11049: checking for dbm_open" >&5
11049
11050 cat > conftest.$ac_ext <<EOF
11051 #line 11052 "configure"
11052 #include "confdefs.h"
11053 /* System header to define __stub macros and hopefully few prototypes,
11054     which can conflict with char dbm_open(); below.  */
11055 #include <assert.h>
11056 /* Override any gcc2 internal prototype to avoid an error.  */
11057 /* We use char because int might match the return type of a gcc2
11058     builtin and then its argument prototype would still apply.  */
11059 char dbm_open();
11060
11061 int main() {
11062
11063 /* The GNU C library defines this for functions which it implements
11064     to always fail with ENOSYS.  Some functions are actually named
11065     something starting with __ and the normal name is an alias.  */
11066 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11067 choke me
11068 #else
11069 dbm_open();
11070 #endif
11071
11072 ; return 0; }
11073 EOF
11074 if { (eval echo configure:11075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11075   rm -rf conftest*
11076   eval "ac_cv_func_dbm_open=yes"
11077 else
11078   echo "configure: failed program was:" >&5
11079   cat conftest.$ac_ext >&5
11080   rm -rf conftest*
11081   eval "ac_cv_func_dbm_open=no"
11082 fi
11083 rm -f conftest*
11084
11085 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11086   echo "$ac_t""yes" 1>&6
11087   with_database_dbm=yes libdbm=
11088 else
11089   echo "$ac_t""no" 1>&6
11090
11091     
11092 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11093 echo "configure:11094: checking for dbm_open in -ldbm" >&5
11094 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11095
11096 xe_check_libs=" -ldbm "
11097 cat > conftest.$ac_ext <<EOF
11098 #line 11099 "configure"
11099 #include "confdefs.h"
11100 /* Override any gcc2 internal prototype to avoid an error.  */
11101 /* We use char because int might match the return type of a gcc2
11102     builtin and then its argument prototype would still apply.  */
11103 char dbm_open();
11104
11105 int main() {
11106 dbm_open()
11107 ; return 0; }
11108 EOF
11109 if { (eval echo configure:11110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11110   rm -rf conftest*
11111   eval "ac_cv_lib_$ac_lib_var=yes"
11112 else
11113   echo "configure: failed program was:" >&5
11114   cat conftest.$ac_ext >&5
11115   rm -rf conftest*
11116   eval "ac_cv_lib_$ac_lib_var=no"
11117 fi
11118 rm -f conftest*
11119 xe_check_libs=""
11120
11121 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11122   echo "$ac_t""yes" 1>&6
11123   with_database_dbm=yes libdbm=-ldbm
11124 else
11125   echo "$ac_t""no" 1>&6
11126 test "$with_database_dbm" = "yes" && \
11127         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11128       with_database_dbm=no
11129 fi
11130
11131
11132 fi
11133
11134 fi
11135
11136 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11137 test "$with_database_gnudbm" = "yes" -o \
11138      "$with_database_dbm"    = "yes" && \
11139   { test "$extra_verbose" = "yes" && cat << \EOF
11140     Defining HAVE_DBM
11141 EOF
11142 cat >> confdefs.h <<\EOF
11143 #define HAVE_DBM 1
11144 EOF
11145 }
11146
11147
11148 if test "$with_database_berkdb" != "no"; then
11149   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11150 echo "configure:11151: checking for Berkeley db.h" >&5
11151   for path in "db/db.h" "db.h"; do
11152     cat > conftest.$ac_ext <<EOF
11153 #line 11154 "configure"
11154 #include "confdefs.h"
11155 #ifdef HAVE_INTTYPES_H
11156 #define __BIT_TYPES_DEFINED__
11157 #include <inttypes.h>
11158 typedef uint8_t  u_int8_t;
11159 typedef uint16_t u_int16_t;
11160 typedef uint32_t u_int32_t;
11161 #ifdef WE_DONT_NEED_QUADS
11162 typedef uint64_t u_int64_t;
11163 #endif
11164 #endif
11165 #include <$path>
11166
11167 int main() {
11168
11169 ; return 0; }
11170 EOF
11171 if { (eval echo configure:11172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11172   rm -rf conftest*
11173   db_h_path="$path"; break
11174 else
11175   echo "configure: failed program was:" >&5
11176   cat conftest.$ac_ext >&5
11177 fi
11178 rm -f conftest*
11179   done
11180   if test -z "$db_h_path"
11181   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11182   else echo "$ac_t""$db_h_path" 1>&6
11183   fi
11184
11185   if test "$with_database_berkdb" != "no"; then
11186     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11187 echo "configure:11188: checking for Berkeley DB version" >&5
11188     cat > conftest.$ac_ext <<EOF
11189 #line 11190 "configure"
11190 #include "confdefs.h"
11191 #include <$db_h_path>
11192 #if DB_VERSION_MAJOR > 1
11193 yes
11194 #endif
11195
11196 EOF
11197 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11198   egrep "yes" >/dev/null 2>&1; then
11199   rm -rf conftest*
11200   echo "$ac_t""2" 1>&6; dbfunc=db_open
11201 else
11202   rm -rf conftest*
11203   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11204 fi
11205 rm -f conftest*
11206
11207     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11208 echo "configure:11209: checking for $dbfunc" >&5
11209
11210 cat > conftest.$ac_ext <<EOF
11211 #line 11212 "configure"
11212 #include "confdefs.h"
11213 /* System header to define __stub macros and hopefully few prototypes,
11214     which can conflict with char $dbfunc(); below.  */
11215 #include <assert.h>
11216 /* Override any gcc2 internal prototype to avoid an error.  */
11217 /* We use char because int might match the return type of a gcc2
11218     builtin and then its argument prototype would still apply.  */
11219 char $dbfunc();
11220
11221 int main() {
11222
11223 /* The GNU C library defines this for functions which it implements
11224     to always fail with ENOSYS.  Some functions are actually named
11225     something starting with __ and the normal name is an alias.  */
11226 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11227 choke me
11228 #else
11229 $dbfunc();
11230 #endif
11231
11232 ; return 0; }
11233 EOF
11234 if { (eval echo configure:11235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11235   rm -rf conftest*
11236   eval "ac_cv_func_$dbfunc=yes"
11237 else
11238   echo "configure: failed program was:" >&5
11239   cat conftest.$ac_ext >&5
11240   rm -rf conftest*
11241   eval "ac_cv_func_$dbfunc=no"
11242 fi
11243 rm -f conftest*
11244
11245 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11246   echo "$ac_t""yes" 1>&6
11247   with_database_berkdb=yes need_libdb=no
11248 else
11249   echo "$ac_t""no" 1>&6
11250
11251     
11252 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11253 echo "configure:11254: checking for $dbfunc in -ldb" >&5
11254 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11255
11256 xe_check_libs=" -ldb "
11257 cat > conftest.$ac_ext <<EOF
11258 #line 11259 "configure"
11259 #include "confdefs.h"
11260 /* Override any gcc2 internal prototype to avoid an error.  */
11261 /* We use char because int might match the return type of a gcc2
11262     builtin and then its argument prototype would still apply.  */
11263 char $dbfunc();
11264
11265 int main() {
11266 $dbfunc()
11267 ; return 0; }
11268 EOF
11269 if { (eval echo configure:11270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11270   rm -rf conftest*
11271   eval "ac_cv_lib_$ac_lib_var=yes"
11272 else
11273   echo "configure: failed program was:" >&5
11274   cat conftest.$ac_ext >&5
11275   rm -rf conftest*
11276   eval "ac_cv_lib_$ac_lib_var=no"
11277 fi
11278 rm -f conftest*
11279 xe_check_libs=""
11280
11281 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11282   echo "$ac_t""yes" 1>&6
11283   with_database_berkdb=yes need_libdb=yes
11284 else
11285   echo "$ac_t""no" 1>&6
11286 fi
11287
11288
11289 fi
11290
11291   fi
11292
11293   if test "$with_database_berkdb" = "yes"; then
11294     { test "$extra_verbose" = "yes" && cat << EOF
11295     Defining DB_H_PATH = "$db_h_path"
11296 EOF
11297 cat >> confdefs.h <<EOF
11298 #define DB_H_PATH "$db_h_path"
11299 EOF
11300 }
11301
11302     { test "$extra_verbose" = "yes" && cat << \EOF
11303     Defining HAVE_BERKELEY_DB
11304 EOF
11305 cat >> confdefs.h <<\EOF
11306 #define HAVE_BERKELEY_DB 1
11307 EOF
11308 }
11309
11310     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11311   else with_database_berkdb=no
11312   fi
11313 fi
11314
11315 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11316      != "no no no"; then
11317   { test "$extra_verbose" = "yes" && cat << \EOF
11318     Defining HAVE_DATABASE
11319 EOF
11320 cat >> confdefs.h <<\EOF
11321 #define HAVE_DATABASE 1
11322 EOF
11323 }
11324
11325   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11326    echo "    xemacs will be linked with \"database.o\""
11327  fi
11328 fi
11329
11330 if test "$with_socks" = "yes"; then
11331   
11332 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11333 echo "configure:11334: checking for SOCKSinit in -lsocks" >&5
11334 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11335
11336 xe_check_libs=" -lsocks "
11337 cat > conftest.$ac_ext <<EOF
11338 #line 11339 "configure"
11339 #include "confdefs.h"
11340 /* Override any gcc2 internal prototype to avoid an error.  */
11341 /* We use char because int might match the return type of a gcc2
11342     builtin and then its argument prototype would still apply.  */
11343 char SOCKSinit();
11344
11345 int main() {
11346 SOCKSinit()
11347 ; return 0; }
11348 EOF
11349 if { (eval echo configure:11350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11350   rm -rf conftest*
11351   eval "ac_cv_lib_$ac_lib_var=yes"
11352 else
11353   echo "configure: failed program was:" >&5
11354   cat conftest.$ac_ext >&5
11355   rm -rf conftest*
11356   eval "ac_cv_lib_$ac_lib_var=no"
11357 fi
11358 rm -f conftest*
11359 xe_check_libs=""
11360
11361 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11362   echo "$ac_t""yes" 1>&6
11363     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11364     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11365   { test "$extra_verbose" = "yes" && cat << EOF
11366     Defining $ac_tr_lib
11367 EOF
11368 cat >> confdefs.h <<EOF
11369 #define $ac_tr_lib 1
11370 EOF
11371 }
11372
11373   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11374
11375 else
11376   echo "$ac_t""no" 1>&6
11377 fi
11378
11379
11380   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11381     Defining HAVE_SOCKS
11382 EOF
11383 cat >> confdefs.h <<\EOF
11384 #define HAVE_SOCKS 1
11385 EOF
11386 }
11387
11388 fi
11389
11390 if test "$usage_tracking" = "yes"; then
11391   { test "$extra_verbose" = "yes" && cat << \EOF
11392     Defining USAGE_TRACKING
11393 EOF
11394 cat >> confdefs.h <<\EOF
11395 #define USAGE_TRACKING 1
11396 EOF
11397 }
11398
11399   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11400 fi
11401
11402 for ac_hdr in dlfcn.h
11403 do
11404 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11405 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11406 echo "configure:11407: checking for $ac_hdr" >&5
11407
11408 cat > conftest.$ac_ext <<EOF
11409 #line 11410 "configure"
11410 #include "confdefs.h"
11411 #include <$ac_hdr>
11412 EOF
11413 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11414 { (eval echo configure:11415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11415 ac_err=`grep -v '^ *+' conftest.out`
11416 if test -z "$ac_err"; then
11417   rm -rf conftest*
11418   eval "ac_cv_header_$ac_safe=yes"
11419 else
11420   echo "$ac_err" >&5
11421   echo "configure: failed program was:" >&5
11422   cat conftest.$ac_ext >&5
11423   rm -rf conftest*
11424   eval "ac_cv_header_$ac_safe=no"
11425 fi
11426 rm -f conftest*
11427 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11428   echo "$ac_t""yes" 1>&6
11429     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11430   { test "$extra_verbose" = "yes" && cat << EOF
11431     Defining $ac_tr_hdr
11432 EOF
11433 cat >> confdefs.h <<EOF
11434 #define $ac_tr_hdr 1
11435 EOF
11436 }
11437  have_dlfcn=yes
11438   { test "$extra_verbose" = "yes" && cat << \EOF
11439     Defining HAVE_DLFCN_H
11440 EOF
11441 cat >> confdefs.h <<\EOF
11442 #define HAVE_DLFCN_H 1
11443 EOF
11444 }
11445
11446 else
11447   echo "$ac_t""no" 1>&6
11448 fi
11449 done
11450
11451 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11452 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11453 echo "configure:11454: checking for dlopen in -ldl" >&5
11454 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11455
11456 xe_check_libs=" -ldl "
11457 cat > conftest.$ac_ext <<EOF
11458 #line 11459 "configure"
11459 #include "confdefs.h"
11460 /* Override any gcc2 internal prototype to avoid an error.  */
11461 /* We use char because int might match the return type of a gcc2
11462     builtin and then its argument prototype would still apply.  */
11463 char dlopen();
11464
11465 int main() {
11466 dlopen()
11467 ; return 0; }
11468 EOF
11469 if { (eval echo configure:11470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11470   rm -rf conftest*
11471   eval "ac_cv_lib_$ac_lib_var=yes"
11472 else
11473   echo "configure: failed program was:" >&5
11474   cat conftest.$ac_ext >&5
11475   rm -rf conftest*
11476   eval "ac_cv_lib_$ac_lib_var=no"
11477 fi
11478 rm -f conftest*
11479 xe_check_libs=""
11480
11481 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11482   echo "$ac_t""yes" 1>&6
11483   { test "$extra_verbose" = "yes" && cat << \EOF
11484     Defining HAVE_DLOPEN
11485 EOF
11486 cat >> confdefs.h <<\EOF
11487 #define HAVE_DLOPEN 1
11488 EOF
11489 }
11490  DLL_LIB=dl;  with_shlib=yes
11491 else
11492   echo "$ac_t""no" 1>&6
11493 fi
11494
11495  }
11496 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11497 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11498 echo "configure:11499: checking for _dlopen in -lc" >&5
11499 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11500
11501 xe_check_libs=" -lc "
11502 cat > conftest.$ac_ext <<EOF
11503 #line 11504 "configure"
11504 #include "confdefs.h"
11505 /* Override any gcc2 internal prototype to avoid an error.  */
11506 /* We use char because int might match the return type of a gcc2
11507     builtin and then its argument prototype would still apply.  */
11508 char _dlopen();
11509
11510 int main() {
11511 _dlopen()
11512 ; return 0; }
11513 EOF
11514 if { (eval echo configure:11515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11515   rm -rf conftest*
11516   eval "ac_cv_lib_$ac_lib_var=yes"
11517 else
11518   echo "configure: failed program was:" >&5
11519   cat conftest.$ac_ext >&5
11520   rm -rf conftest*
11521   eval "ac_cv_lib_$ac_lib_var=no"
11522 fi
11523 rm -f conftest*
11524 xe_check_libs=""
11525
11526 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11527   echo "$ac_t""yes" 1>&6
11528   { test "$extra_verbose" = "yes" && cat << \EOF
11529     Defining HAVE_DLOPEN
11530 EOF
11531 cat >> confdefs.h <<\EOF
11532 #define HAVE_DLOPEN 1
11533 EOF
11534 }
11535  DLL_LIB=;   with_shlib=yes
11536 else
11537   echo "$ac_t""no" 1>&6
11538 fi
11539
11540  }
11541 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11542 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11543 echo "configure:11544: checking for dlopen in -lc" >&5
11544 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11545
11546 xe_check_libs=" -lc "
11547 cat > conftest.$ac_ext <<EOF
11548 #line 11549 "configure"
11549 #include "confdefs.h"
11550 /* Override any gcc2 internal prototype to avoid an error.  */
11551 /* We use char because int might match the return type of a gcc2
11552     builtin and then its argument prototype would still apply.  */
11553 char dlopen();
11554
11555 int main() {
11556 dlopen()
11557 ; return 0; }
11558 EOF
11559 if { (eval echo configure:11560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11560   rm -rf conftest*
11561   eval "ac_cv_lib_$ac_lib_var=yes"
11562 else
11563   echo "configure: failed program was:" >&5
11564   cat conftest.$ac_ext >&5
11565   rm -rf conftest*
11566   eval "ac_cv_lib_$ac_lib_var=no"
11567 fi
11568 rm -f conftest*
11569 xe_check_libs=""
11570
11571 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11572   echo "$ac_t""yes" 1>&6
11573   { test "$extra_verbose" = "yes" && cat << \EOF
11574     Defining HAVE_DLOPEN
11575 EOF
11576 cat >> confdefs.h <<\EOF
11577 #define HAVE_DLOPEN 1
11578 EOF
11579 }
11580  DLL_LIB=;   with_shlib=yes
11581 else
11582   echo "$ac_t""no" 1>&6
11583 fi
11584
11585  }
11586 test -z "$with_shlib" && { 
11587 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11588 echo "configure:11589: checking for shl_load in -ldld" >&5
11589 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11590
11591 xe_check_libs=" -ldld "
11592 cat > conftest.$ac_ext <<EOF
11593 #line 11594 "configure"
11594 #include "confdefs.h"
11595 /* Override any gcc2 internal prototype to avoid an error.  */
11596 /* We use char because int might match the return type of a gcc2
11597     builtin and then its argument prototype would still apply.  */
11598 char shl_load();
11599
11600 int main() {
11601 shl_load()
11602 ; return 0; }
11603 EOF
11604 if { (eval echo configure:11605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11605   rm -rf conftest*
11606   eval "ac_cv_lib_$ac_lib_var=yes"
11607 else
11608   echo "configure: failed program was:" >&5
11609   cat conftest.$ac_ext >&5
11610   rm -rf conftest*
11611   eval "ac_cv_lib_$ac_lib_var=no"
11612 fi
11613 rm -f conftest*
11614 xe_check_libs=""
11615
11616 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11617   echo "$ac_t""yes" 1>&6
11618   { test "$extra_verbose" = "yes" && cat << \EOF
11619     Defining HAVE_SHL_LOAD
11620 EOF
11621 cat >> confdefs.h <<\EOF
11622 #define HAVE_SHL_LOAD 1
11623 EOF
11624 }
11625  DLL_LIB=dld; with_shlib=yes
11626 else
11627   echo "$ac_t""no" 1>&6
11628 fi
11629
11630  }
11631 test -z "$with_shlib" && { 
11632 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11633 echo "configure:11634: checking for dld_init in -ldld" >&5
11634 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11635
11636 xe_check_libs=" -ldld "
11637 cat > conftest.$ac_ext <<EOF
11638 #line 11639 "configure"
11639 #include "confdefs.h"
11640 /* Override any gcc2 internal prototype to avoid an error.  */
11641 /* We use char because int might match the return type of a gcc2
11642     builtin and then its argument prototype would still apply.  */
11643 char dld_init();
11644
11645 int main() {
11646 dld_init()
11647 ; return 0; }
11648 EOF
11649 if { (eval echo configure:11650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11650   rm -rf conftest*
11651   eval "ac_cv_lib_$ac_lib_var=yes"
11652 else
11653   echo "configure: failed program was:" >&5
11654   cat conftest.$ac_ext >&5
11655   rm -rf conftest*
11656   eval "ac_cv_lib_$ac_lib_var=no"
11657 fi
11658 rm -f conftest*
11659 xe_check_libs=""
11660
11661 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11662   echo "$ac_t""yes" 1>&6
11663   { test "$extra_verbose" = "yes" && cat << \EOF
11664     Defining HAVE_DLD_INIT
11665 EOF
11666 cat >> confdefs.h <<\EOF
11667 #define HAVE_DLD_INIT 1
11668 EOF
11669 }
11670  DLL_LIB=dld; with_shlib=yes
11671 else
11672   echo "$ac_t""no" 1>&6
11673 fi
11674
11675  }
11676 if test "$with_shlib" = "yes"; then
11677   
11678 dll_ld=
11679 dll_ldflags=
11680 dll_cflags=
11681 dll_post=
11682 dll_ldo="-o"
11683 ld_dynamic_link_flags=
11684 xehost=$canonical
11685 xealias=$internal_configuration
11686
11687 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
11688 echo "configure:11689: checking how to build dynamic libraries for ${xehost}" >&5
11689 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
11690 case "$xehost" in
11691 *-*-linux-gnu*) ;;
11692 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
11693 esac
11694
11695 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
11696 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
11697 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
11698
11699 case "$xehost_os" in
11700 aix3*)
11701   # AIX sometimes has problems with the GCC collect2 program.  For some
11702   # reason, if we set the COLLECT_NAMES environment variable, the problems
11703   # vanish in a puff of smoke.
11704   if test "${COLLECT_NAMES+set}" != set; then
11705     COLLECT_NAMES=
11706     export COLLECT_NAMES
11707   fi
11708   ;;
11709 esac
11710
11711 # Now see if the compiler is really GCC.
11712 if test "$GCC" = "yes"; then
11713   XEGCC=yes
11714 else
11715   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
11716 echo "configure:11717: checking checking whether we are using GNU C" >&5
11717   cat > conftest.$ac_ext <<EOF
11718 #line 11719 "configure"
11719 #include "confdefs.h"
11720
11721 #ifdef __GNUC__
11722   yes;
11723 #endif
11724
11725 EOF
11726 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11727   egrep "yes" >/dev/null 2>&1; then
11728   rm -rf conftest*
11729   XEGCC=yes
11730 else
11731   rm -rf conftest*
11732   XEGCC=no
11733 fi
11734 rm -f conftest*
11735
11736   echo "$ac_t""${XEGCC}" 1>&6
11737 fi
11738
11739 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
11740 echo "configure:11741: checking how to produce PIC code" >&5
11741 wl=
11742
11743 can_build_shared=yes
11744 if test "$XEGCC" = yes; then
11745   wl='-Wl,'
11746
11747   case "$xehost_os" in
11748   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
11749     # PIC is the default for these OSes.
11750     ;;
11751
11752   os2*)
11753     # We can build DLLs from non-PIC.
11754     ;;
11755   amigaos*)
11756     # FIXME: we need at least 68020 code to build shared libraries, but
11757     # adding the `-m68020' flag to GCC prevents building anything better,
11758     # like `-m68040'.
11759     dll_cflags='-m68020 -resident32 -malways-restore-a4'
11760     ;;
11761   *)
11762     dll_cflags='-fPIC'
11763     ;;
11764   esac
11765 else
11766   # PORTME Check for PIC flags for the system compiler.
11767   case "$xehost_os" in
11768   hpux9* | hpux10*)
11769     # Is there a better link_static_flag that works with the bundled CC?
11770     wl='-Wl,'
11771     dll_cflags='+Z'
11772     ;;
11773
11774   irix5* | irix6*)
11775     wl='-Wl,'
11776     # PIC (with -KPIC) is the default.
11777     ;;
11778
11779   os2*)
11780     # We can build DLLs from non-PIC.
11781     ;;
11782
11783   osf3* | osf4*)
11784     # All OSF/1 code is PIC.
11785     wl='-Wl,'
11786     ;;
11787
11788   sco3.2v5*)
11789     dll_cflags='-belf -Kpic'
11790     wl='-Wl,'
11791     ;;
11792
11793   unixware*)
11794     dll_cflags="-KPIC"
11795     wl="-Wl,"
11796     ;;
11797
11798   sysv4*)
11799     dll_cflags="-KPIC"
11800     wl="-Wl,"
11801     ;;
11802
11803   sysv5*)
11804     dll_cflags="-KPIC"
11805     wl="-Wl,"
11806     ;;
11807
11808   solaris2*)
11809     dll_cflags='-KPIC'
11810     wl='-Wl,'
11811     ;;
11812
11813   sunos4*)
11814     dll_cflags='-PIC'
11815     wl='-Qoption ld '
11816     ;;
11817
11818   uts4*)
11819     dll_cflags='-pic'
11820     ;;
11821
11822   *)
11823     can_build_shared=no
11824     ;;
11825   esac
11826 fi
11827
11828 if test -n "$dll_cflags"; then
11829   echo "$ac_t""${dll_cflags}" 1>&6
11830   
11831   # Check to make sure the dll_cflags actually works.
11832   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
11833 echo "configure:11834: checking if PIC flag ${dll_cflags} really works" >&5
11834   save_CFLAGS="$CFLAGS"
11835   CFLAGS="$CFLAGS $dll_cflags -DPIC"
11836   cat > conftest.$ac_ext <<EOF
11837 #line 11838 "configure"
11838 #include "confdefs.h"
11839
11840 int main() {
11841 int x=0;
11842 ; return 0; }
11843 EOF
11844 if { (eval echo configure:11845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11845   rm -rf conftest*
11846   
11847     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
11848     # reports no error.  So, we need to grep stderr for (Bundled).
11849     if grep '(Bundled)' config.log >/dev/null; then
11850       echo "$ac_t""no" 1>&6
11851       can_build_shared=no
11852       dll_cflags=
11853     else
11854       echo "$ac_t""yes" 1>&6
11855     fi
11856 else
11857   echo "configure: failed program was:" >&5
11858   cat conftest.$ac_ext >&5
11859   rm -rf conftest*
11860   echo "$ac_t""no" 1>&6
11861     can_build_shared=no
11862     dll_cflags=
11863 fi
11864 rm -f conftest*
11865   CFLAGS="$save_CFLAGS"
11866 else
11867   echo "$ac_t""none" 1>&6
11868 fi
11869
11870 if test "$can_build_shared" = "yes"; then
11871 cc_produces_so=no
11872 xldf=
11873 xcldf=
11874 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
11875 echo "configure:11876: checking if C compiler can produce shared libraries" >&5
11876 if test "$XEGCC" = yes; then
11877   xcldf="-shared"
11878   xldf="-shared"
11879 else # Not using GCC
11880   case "$xehost_os" in
11881     aix3* | aix4*)
11882       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
11883       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
11884       ;;
11885
11886     freebsd2* | netbsd* | openbsd*)
11887       xldf="-Bshareable"
11888       xcldf="${wl}-Bshareable"
11889       ;;
11890
11891     freebsd3*)
11892       xcldf="-shared"
11893       ;;
11894
11895     hpux*)
11896       xldf="-b +s"
11897       xcldf="${wl}-b ${wl}+s"
11898       ;;
11899
11900     irix5* | irix6* | osf3* | osf4*)
11901       xcldf="${wl}-shared"
11902       xldf="-shared"
11903       ;;
11904
11905     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
11906       xcldf="-G"
11907       xldf="-G"
11908       ;;
11909
11910     sunos4*)
11911       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
11912       xldf="-assert pure-text -Bstatic"
11913       ;;
11914   esac
11915 fi # End if if we are using gcc
11916
11917 if test -n "$xcldf"; then
11918   save_LDFLAGS=$LDFLAGS
11919   save_LIBS=$LIBS
11920   save_xe_libs=$xe_libs
11921   LDFLAGS="$xcldf $LDFLAGS"
11922   LIBS=
11923   xe_libs=
11924   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
11925   cat > conftest.$ac_ext <<EOF
11926 #line 11927 "configure"
11927 #include "confdefs.h"
11928
11929 int main() {
11930 int x=0;
11931 ; return 0; }
11932 EOF
11933 if { (eval echo configure:11934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11934   rm -rf conftest*
11935   cc_produces_so=yes
11936 else
11937   echo "configure: failed program was:" >&5
11938   cat conftest.$ac_ext >&5
11939   rm -rf conftest*
11940   cc_produces_so=no
11941 fi
11942 rm -f conftest*
11943   LDFLAGS=$save_LDFLAGS
11944   LIBS=$save_LIBS
11945   xe_libs=$save_xe_libs
11946   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
11947 else
11948   cc_produces_so=no
11949 fi
11950 echo "$ac_t""${cc_produces_so}" 1>&6
11951
11952 LTLD=$LD
11953 if test -z "$LTLD"; then
11954   ac_prog=ld
11955   if test "$XEGCC" = yes; then
11956     # Check if gcc -print-prog-name=ld gives a path.
11957     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
11958 echo "configure:11959: checking for ld used by GCC" >&5
11959     ac_prog=`($CC -print-prog-name=ld) 2>&5`
11960     case "$ac_prog" in
11961     # Accept absolute paths.
11962     /*)
11963       if test -z "$LTLD"; then
11964         case "$ac_prog" in
11965           *gcc-lib*) LTLD="$CC"
11966                      ;;
11967           *)         LTLD="$ac_prog"
11968                      ;;
11969         esac
11970       fi
11971       ;;
11972     "")
11973       # If it fails, then pretend we aren't using GCC.
11974       ac_prog=ld
11975       ;;
11976     *)
11977       # If it is relative, then search for the first ld in PATH.
11978       with_gnu_ld=unknown
11979       ;;
11980     esac
11981   else
11982     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
11983 echo "configure:11984: checking for GNU ld" >&5
11984   fi
11985
11986   if test -z "$LTLD"; then
11987     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
11988     for ac_dir in $PATH; do
11989       test -z "$ac_dir" && ac_dir=.
11990       if test -f "$ac_dir/$ac_prog"; then
11991         LTLD="$ac_dir/$ac_prog"
11992         # Check to see if the program is GNU ld.  I'd rather use --version,
11993         # but apparently some GNU ld's only accept -v.
11994         # Break only if it was the GNU/non-GNU ld that we prefer.
11995         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
11996           xe_gnu_ld=yes
11997         else
11998           xe_gnu_ld=no
11999         fi
12000       fi
12001     done
12002     IFS="$ac_save_ifs"
12003   fi
12004
12005   if test -n "$LTLD"; then
12006     echo "$ac_t""${LTLD}" 1>&6
12007   else
12008     echo "$ac_t""no" 1>&6
12009   fi
12010
12011   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12012     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12013     exit 1
12014   fi
12015 fi
12016
12017 ld_dynamic_link_flags=
12018
12019 # Check to see if it really is or isn't GNU ld.
12020 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12021 echo "configure:12022: checking if the linker is GNU ld" >&5
12022 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12023 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12024   xe_gnu_ld=yes
12025 else
12026   xe_gnu_ld=no
12027 fi
12028 echo "$ac_t""${xe_gnu_ld}" 1>&6
12029
12030 case "$xehost_os" in
12031   amigaos* | sunos4*)
12032     # On these operating systems, we should treat GNU ld like the system ld.
12033     gnu_ld_acts_native=yes
12034     ;;
12035   *)
12036     gnu_ld_acts_native=no
12037     ;;
12038 esac
12039
12040 if test "$cc_produces_so" = "yes"; then
12041   dll_ld=$CC
12042   dll_ldflags=$xcldf
12043   can_build_shared=yes
12044 else
12045   # OK - only NOW do we futz about with ld.
12046   # See if the linker supports building shared libraries.
12047   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12048 echo "configure:12049: checking whether the linker supports shared libraries" >&5
12049   dll_ld=$CC
12050   dll_ldflags=$LDFLAGS
12051   ld_shlibs=yes
12052   can_build_shared=yes
12053   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12054     # See if GNU ld supports shared libraries.
12055     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12056       dll_ld=$CC
12057       dll_ldflags="-shared"
12058       ld_shlibs=yes
12059     else
12060       ld_shlibs=no
12061     fi
12062   else
12063     # PORTME fill in a description of your system's linker (not GNU ld)
12064     case "$xehost_os" in
12065     aix3*)
12066       dll_ld=$LTLD
12067       dll_ldflags=$xldf
12068       ;;
12069
12070     aix4*)
12071       dll_ldflags=$xcldf
12072       ;;
12073
12074     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12075     # support.  Future versions do this automatically, but an explicit c++rt0.o
12076     # doesn't break anything, and helps significantly (at the cost of a little
12077     # extra space).
12078     freebsd2.2*)
12079       dll_ld=$LTLD
12080       dll_ldflags=$xldf
12081       dll_post="/usr/lib/c++rt0.o"
12082       ;;
12083
12084     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12085     freebsd2*)
12086       dll_ld=$LTLD
12087       dll_ldflags="-Bshareable"
12088       ;;
12089
12090     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12091     freebsd3*)
12092       dll_ldflags="-shared"
12093       ;;
12094
12095     hpux*)
12096       dll_ld=$LTLD
12097       dll_ldflags=$xldf
12098       ;;
12099
12100     irix5* | irix6*)
12101       dll_ld=$LTLD
12102       dll_ldflags=$xldf
12103       ;;
12104
12105     netbsd*)
12106       # Tested with NetBSD 1.2 ld
12107       dll_ld=$LTLD
12108       dll_ldflags=$xldf
12109       ;;
12110
12111     openbsd*)
12112       dll_ld=$LTLD
12113       dll_ldflags=$xldf
12114       ;;
12115
12116     osf3* | osf4*)
12117       dll_ld=$LTLD
12118       dll_ldflags=$xldf
12119       ;;
12120
12121     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12122     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12123       dll_ld=$LTLD
12124       case "$dll_ld" in
12125         *gcc*) dll_ldflags="-shared"
12126                dll_ld=$CC
12127                ;;
12128         *)     dll_ldflags="-G"
12129                ;;
12130       esac
12131       ;;
12132
12133     sunos4*)
12134       if test "$XEGCC" = yes; then
12135         dll_ld=$CC
12136       else
12137         dll_ld=$LTLD
12138       fi
12139       dll_ldflags=$xldf
12140       ;;
12141
12142     uts4*)
12143       dll_ld=$LTLD
12144       dll_ldflags="-G"
12145       ;;
12146
12147     bsdi*)
12148       dll_ldflags="-r"
12149       dll_ld="shlicc2"
12150       ;;
12151
12152     *)
12153       ld_shlibs=no
12154       can_build_shared=no
12155       ;;
12156     esac
12157   fi
12158   echo "$ac_t""${ld_shlibs}" 1>&6
12159   if test "$ld_shlibs" = "no"; then
12160     can_build_shared=no
12161   fi
12162 fi # End of if cc_produces_so = no
12163
12164
12165 if test "$xe_gnu_ld" = yes; then
12166   if test "$ld_shlibs" = yes; then
12167     ld_dynamic_link_flags="${wl}-export-dynamic"
12168   fi
12169 fi
12170
12171 if test -z "$ld_dynamic_link_flags"; then
12172   case "$xehost_os" in
12173   aix3*)
12174     ld_dynamic_link_flags=
12175     ;;
12176
12177   aix4*)
12178     ld_dynamic_link_flags=
12179     ;;
12180
12181   freebsd2.2*)
12182     ld_dynamic_link_flags=
12183     ;;
12184
12185   freebsd2*)
12186     ld_dynamic_link_flags=
12187     ;;
12188
12189   freebsd3*)
12190     ld_dynamic_link_flags=
12191     ;;
12192
12193   hpux*)
12194     ld_dynamic_link_flags="${wl}-E"
12195     ;;
12196
12197   irix5* | irix6*)
12198     ld_dynamic_link_flags=
12199     ;;
12200
12201   netbsd*)
12202     ld_dynamic_link_flags=
12203     ;;
12204
12205   openbsd*)
12206     ld_dynamic_link_flags=
12207     ;;
12208
12209   osf3* | osf4*)
12210     ld_dynamic_link_flags=
12211     ;;
12212
12213   sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12214     ld_dynamic_link_flags="${wl}-Bexport"
12215     ;;
12216
12217   sunos4*)
12218     ld_dynamic_link_flags=
12219     ;;
12220
12221   uts4*)
12222     ld_dynamic_link_flags=
12223     ;;
12224
12225   bsdi*)
12226     ld_dynamic_link_flags=
12227     ;;
12228
12229   esac
12230 fi # End of if -z ld_dynamic_link_flags
12231 fi # End of if test "$can_build_shared" = "yes"
12232
12233
12234
12235
12236
12237
12238
12239
12240   if test "$can_build_shared" = "yes"; then
12241     { test "$extra_verbose" = "yes" && cat << \EOF
12242     Defining HAVE_SHLIB
12243 EOF
12244 cat >> confdefs.h <<\EOF
12245 #define HAVE_SHLIB 1
12246 EOF
12247 }
12248
12249     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12250    echo "    xemacs will be linked with \"sysdll.o\""
12251  fi
12252     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12253    echo "    xemacs will be linked with \"emodules.o\""
12254  fi
12255     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12256     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12257     for ac_func in dlerror _dlerror
12258 do
12259 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12260 echo "configure:12261: checking for $ac_func" >&5
12261
12262 cat > conftest.$ac_ext <<EOF
12263 #line 12264 "configure"
12264 #include "confdefs.h"
12265 /* System header to define __stub macros and hopefully few prototypes,
12266     which can conflict with char $ac_func(); below.  */
12267 #include <assert.h>
12268 /* Override any gcc2 internal prototype to avoid an error.  */
12269 /* We use char because int might match the return type of a gcc2
12270     builtin and then its argument prototype would still apply.  */
12271 char $ac_func();
12272
12273 int main() {
12274
12275 /* The GNU C library defines this for functions which it implements
12276     to always fail with ENOSYS.  Some functions are actually named
12277     something starting with __ and the normal name is an alias.  */
12278 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12279 choke me
12280 #else
12281 $ac_func();
12282 #endif
12283
12284 ; return 0; }
12285 EOF
12286 if { (eval echo configure:12287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12287   rm -rf conftest*
12288   eval "ac_cv_func_$ac_func=yes"
12289 else
12290   echo "configure: failed program was:" >&5
12291   cat conftest.$ac_ext >&5
12292   rm -rf conftest*
12293   eval "ac_cv_func_$ac_func=no"
12294 fi
12295 rm -f conftest*
12296
12297 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12298   echo "$ac_t""yes" 1>&6
12299     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12300   { test "$extra_verbose" = "yes" && cat << EOF
12301     Defining $ac_tr_func
12302 EOF
12303 cat >> confdefs.h <<EOF
12304 #define $ac_tr_func 1
12305 EOF
12306 }
12307  
12308 else
12309   echo "$ac_t""no" 1>&6
12310 fi
12311 done
12312
12313   else
12314     echo "configure: warning: disabling shared library support" 1>&2
12315     with_shlib=no
12316   fi
12317 fi
12318
12319 cat > conftest.$ac_ext <<EOF
12320 #line 12321 "configure"
12321 #include "confdefs.h"
12322 int main(int c,char *v[]){return 0;}
12323 EOF
12324 if { (eval echo configure:12325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12325 then
12326   :
12327 else
12328   conftest_rc="$?"
12329   echo "configure: failed program was:" >&5
12330   cat conftest.$ac_ext >&5
12331   rm -fr conftest*
12332   
12333   echo ""
12334   echo "*** PANIC *** The C compiler can no longer build working executables."
12335   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12336   echo "*** PANIC *** The most likely reason for this problem is that configure"
12337   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12338   echo "*** PANIC *** found at run time."
12339   echo "*** PANIC ***"
12340   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12341   echo "*** PANIC *** On other systems, try telling configure where to find the"
12342   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12343   echo "*** PANIC ***"
12344   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12345   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12346   echo "*** PANIC *** on your system.  Don't do that."
12347   exit 1
12348 fi
12349 rm -fr conftest*
12350
12351
12352 { test "$extra_verbose" = "yes" && cat << \EOF
12353     Defining HAVE_UNIX_PROCESSES
12354 EOF
12355 cat >> confdefs.h <<\EOF
12356 #define HAVE_UNIX_PROCESSES 1
12357 EOF
12358 }
12359
12360 extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12361    echo "    xemacs will be linked with \"process-unix.o\""
12362  fi
12363
12364
12365
12366 T=""
12367 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12368 CFLAGS="$T"
12369
12370
12371 T=""
12372 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12373 extra_objs="$T"
12374
12375
12376 T=""
12377 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
12378 c_switch_general="$T"
12379
12380
12381 T=""
12382 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12383 c_switch_window_system="$T"
12384
12385
12386 T=""
12387 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12388 c_switch_all="$T"
12389
12390
12391 T=""
12392 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
12393 ld_switch_general="$T"
12394
12395
12396 T=""
12397 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12398 ld_switch_window_system="$T"
12399
12400
12401 T=""
12402 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12403 ld_switch_all="$T"
12404
12405
12406 T=""
12407 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12408 ld_libs_general="$T"
12409
12410
12411 T=""
12412 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
12413 ld_libs_window_system="$T"
12414
12415
12416 T=""
12417 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12418 ld_libs_all="$T"
12419
12420
12421
12422 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12423 internal_makefile_list="Makefile.in"
12424 SUBDIR_MAKEFILES=''
12425 test -d lock || mkdir lock
12426 for dir in $MAKE_SUBDIR; do
12427   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12428         test -d "$d" || mkdir "$d"; cd "$d"
12429       done ) ;;
12430    * ) test -d "$dir" || mkdir "$dir" ;;
12431   esac
12432   
12433 T=""
12434 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12435 SUBDIR_MAKEFILES="$T"
12436
12437   
12438 T=""
12439 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12440 internal_makefile_list="$T"
12441
12442 done
12443
12444
12445
12446
12447 for dir in src/s src/m; do
12448   if test ! -d "$dir" ; then
12449     echo Making symbolic link to "$srcdir/$dir"
12450     ${LN_S} "$srcdir/$dir" "$dir"
12451   fi
12452 done
12453
12454 if test "$extra_verbose" = "yes"; then
12455   echo ""
12456   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
12457   echo ""
12458 fi
12459
12460 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12461   echo "creating src/gdbinit"; echo ""
12462   echo "source $srcdir/src/gdbinit" > src/gdbinit
12463 fi
12464
12465 if test "$__SUNPRO_C" = "yes"; then
12466   echo "creating .sbinit"; echo ""
12467   ( echo "# For use with Sun WorkShop's Source browser."
12468     echo "# See sbquery(1) and sbinit(4) for more information"
12469     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12470   ) > .sbinit
12471 fi
12472
12473 rm -f core
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490 PREFIX=$prefix
12491 while true; do
12492   case "$PREFIX" in
12493     *\$* ) eval "PREFIX=$PREFIX" ;;
12494     *) break ;;
12495   esac
12496 done
12497
12498
12499
12500 EXEC_PREFIX=$exec_prefix
12501 while true; do
12502   case "$EXEC_PREFIX" in
12503     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12504     *) break ;;
12505   esac
12506 done
12507
12508
12509
12510
12511 INFODIR=$infodir
12512 while true; do
12513   case "$INFODIR" in
12514     *\$* ) eval "INFODIR=$INFODIR" ;;
12515     *) break ;;
12516   esac
12517 done
12518
12519
12520
12521
12522 INFOPATH=$infopath
12523 while true; do
12524   case "$INFOPATH" in
12525     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12526     *) break ;;
12527   esac
12528 done
12529
12530
12531
12532
12533 PACKAGE_PATH=$package_path
12534 while true; do
12535   case "$PACKAGE_PATH" in
12536     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12537     *) break ;;
12538   esac
12539 done
12540
12541
12542
12543
12544 LISPDIR=$lispdir
12545 while true; do
12546   case "$LISPDIR" in
12547     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12548     *) break ;;
12549   esac
12550 done
12551
12552
12553
12554
12555 MODULEDIR=$moduledir
12556 while true; do
12557   case "$MODULEDIR" in
12558     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12559     *) break ;;
12560   esac
12561 done
12562
12563
12564
12565
12566 SITELISPDIR=$sitelispdir
12567 while true; do
12568   case "$SITELISPDIR" in
12569     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12570     *) break ;;
12571   esac
12572 done
12573
12574
12575
12576
12577 SITEMODULEDIR=$sitemoduledir
12578 while true; do
12579   case "$SITEMODULEDIR" in
12580     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12581     *) break ;;
12582   esac
12583 done
12584
12585
12586
12587
12588 ETCDIR=$etcdir
12589 while true; do
12590   case "$ETCDIR" in
12591     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12592     *) break ;;
12593   esac
12594 done
12595
12596
12597
12598
12599 LOCKDIR=$lockdir
12600 while true; do
12601   case "$LOCKDIR" in
12602     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12603     *) break ;;
12604   esac
12605 done
12606
12607
12608
12609
12610 ARCHLIBDIR=$archlibdir
12611 while true; do
12612   case "$ARCHLIBDIR" in
12613     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12614     *) break ;;
12615   esac
12616 done
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12638
12639
12640
12641
12642
12643
12644
12645 : ${XEMACS_CC:=$CC}
12646
12647
12648
12649 if test "$with_site_lisp" = "no"; then
12650   { test "$extra_verbose" = "yes" && cat << \EOF
12651     Defining INHIBIT_SITE_LISP
12652 EOF
12653 cat >> confdefs.h <<\EOF
12654 #define INHIBIT_SITE_LISP 1
12655 EOF
12656 }
12657
12658 fi
12659 if test "$with_site_modules" = "no"; then
12660   { test "$extra_verbose" = "yes" && cat << \EOF
12661     Defining INHIBIT_SITE_MODULES
12662 EOF
12663 cat >> confdefs.h <<\EOF
12664 #define INHIBIT_SITE_MODULES 1
12665 EOF
12666 }
12667
12668 fi
12669
12670
12671 T=""
12672 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12673 ac_configure_args="$T"
12674
12675 { test "$extra_verbose" = "yes" && cat << EOF
12676     Defining EMACS_CONFIGURATION = "$canonical"
12677 EOF
12678 cat >> confdefs.h <<EOF
12679 #define EMACS_CONFIGURATION "$canonical"
12680 EOF
12681 }
12682
12683 { test "$extra_verbose" = "yes" && cat << EOF
12684     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12685 EOF
12686 cat >> confdefs.h <<EOF
12687 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12688 EOF
12689 }
12690
12691 { test "$extra_verbose" = "yes" && cat << EOF
12692     Defining config_machfile = "$machfile"
12693 EOF
12694 cat >> confdefs.h <<EOF
12695 #define config_machfile "$machfile"
12696 EOF
12697 }
12698
12699 { test "$extra_verbose" = "yes" && cat << EOF
12700     Defining config_opsysfile = "$opsysfile"
12701 EOF
12702 cat >> confdefs.h <<EOF
12703 #define config_opsysfile "$opsysfile"
12704 EOF
12705 }
12706
12707
12708
12709 null_string=""
12710 { test "$extra_verbose" = "yes" && cat << EOF
12711     Defining LD_SWITCH_X_SITE = $null_string
12712 EOF
12713 cat >> confdefs.h <<EOF
12714 #define LD_SWITCH_X_SITE $null_string
12715 EOF
12716 }
12717
12718 { test "$extra_verbose" = "yes" && cat << EOF
12719     Defining LD_SWITCH_X_SITE_AUX = $null_string
12720 EOF
12721 cat >> confdefs.h <<EOF
12722 #define LD_SWITCH_X_SITE_AUX $null_string
12723 EOF
12724 }
12725
12726 { test "$extra_verbose" = "yes" && cat << EOF
12727     Defining C_SWITCH_X_SITE = $null_string
12728 EOF
12729 cat >> confdefs.h <<EOF
12730 #define C_SWITCH_X_SITE $null_string
12731 EOF
12732 }
12733
12734 { test "$extra_verbose" = "yes" && cat << EOF
12735     Defining LD_SWITCH_SITE = $null_string
12736 EOF
12737 cat >> confdefs.h <<EOF
12738 #define LD_SWITCH_SITE $null_string
12739 EOF
12740 }
12741
12742 { test "$extra_verbose" = "yes" && cat << EOF
12743     Defining C_SWITCH_SITE = $null_string
12744 EOF
12745 cat >> confdefs.h <<EOF
12746 #define C_SWITCH_SITE $null_string
12747 EOF
12748 }
12749
12750
12751
12752 test -n "$puresize" && { test "$extra_verbose" = "yes" && cat << EOF
12753     Defining RAW_PURESIZE = $puresize
12754 EOF
12755 cat >> confdefs.h <<EOF
12756 #define RAW_PURESIZE $puresize
12757 EOF
12758 }
12759
12760
12761 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12762     Defining GNU_MALLOC
12763 EOF
12764 cat >> confdefs.h <<\EOF
12765 #define GNU_MALLOC 1
12766 EOF
12767 }
12768
12769 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12770     Defining USE_SYSTEM_MALLOC
12771 EOF
12772 cat >> confdefs.h <<\EOF
12773 #define USE_SYSTEM_MALLOC 1
12774 EOF
12775 }
12776
12777 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12778     Defining USE_DEBUG_MALLOC
12779 EOF
12780 cat >> confdefs.h <<\EOF
12781 #define USE_DEBUG_MALLOC 1
12782 EOF
12783 }
12784
12785                                               { test "$extra_verbose" = "yes" && cat << \EOF
12786     Defining USE_SYSTEM_MALLOC
12787 EOF
12788 cat >> confdefs.h <<\EOF
12789 #define USE_SYSTEM_MALLOC 1
12790 EOF
12791 }
12792
12793 fi
12794 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12795     Defining I18N3
12796 EOF
12797 cat >> confdefs.h <<\EOF
12798 #define I18N3 1
12799 EOF
12800 }
12801
12802 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12803     Defining USE_GCC
12804 EOF
12805 cat >> confdefs.h <<\EOF
12806 #define USE_GCC 1
12807 EOF
12808 }
12809
12810 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12811     Defining EXTERNAL_WIDGET
12812 EOF
12813 cat >> confdefs.h <<\EOF
12814 #define EXTERNAL_WIDGET 1
12815 EOF
12816 }
12817
12818 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12819     Defining NO_DOC_FILE
12820 EOF
12821 cat >> confdefs.h <<\EOF
12822 #define NO_DOC_FILE 1
12823 EOF
12824 }
12825
12826 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12827     Defining PURIFY
12828 EOF
12829 cat >> confdefs.h <<\EOF
12830 #define PURIFY 1
12831 EOF
12832 }
12833
12834 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12835     Defining QUANTIFY
12836 EOF
12837 cat >> confdefs.h <<\EOF
12838 #define QUANTIFY 1
12839 EOF
12840 }
12841
12842 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12843     Defining MAIL_USE_POP
12844 EOF
12845 cat >> confdefs.h <<\EOF
12846 #define MAIL_USE_POP 1
12847 EOF
12848 }
12849
12850 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12851     Defining KERBEROS
12852 EOF
12853 cat >> confdefs.h <<\EOF
12854 #define KERBEROS 1
12855 EOF
12856 }
12857
12858 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12859     Defining HESIOD
12860 EOF
12861 cat >> confdefs.h <<\EOF
12862 #define HESIOD 1
12863 EOF
12864 }
12865
12866 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12867     Defining USE_UNION_TYPE
12868 EOF
12869 cat >> confdefs.h <<\EOF
12870 #define USE_UNION_TYPE 1
12871 EOF
12872 }
12873
12874
12875
12876 (
12877 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
12878 else
12879   echo "uname -a: `uname -a`"
12880 fi
12881 echo ""
12882 echo "$0 $quoted_arguments"
12883 ) > Installation
12884
12885 xemacs_betaname=""
12886 test ! -z "${emacs_beta_version}" && xemacs_betaname="-b${emacs_beta_version}"
12887
12888 (
12889 echo "
12890
12891 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
12892
12893   Where should the build process find the source code?    $srcdir
12894   What installation prefix should install use?            $prefix
12895   What operating system and machine description files should XEmacs use?
12896         \`$opsysfile' and \`$machfile'
12897   What compiler should XEmacs be built with?              $CC $CFLAGS
12898   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
12899   Should XEmacs use the relocating allocator for buffers? $rel_alloc
12900   What window system should XEmacs use?                   ${window_system}"
12901 if test "$with_x11" = "yes"; then
12902   echo "  Where do we find X Windows header files?                $x_includes"
12903   echo "  Where do we find X Windows libraries?                   $x_libraries"
12904 fi
12905 if test -n "$site_includes"; then
12906   echo "  Additional header files:                                $site_includes"
12907 fi
12908 if test -n "$site_libraries"; then
12909   echo "  Additional libraries:                                   $site_libraries"
12910 fi
12911 if test -n "$site_prefixes"; then
12912   echo "  Additional prefixes:                                    $site_prefixes"
12913 fi
12914 if test -n "$runpath"; then
12915   echo "  Runtime library search path:                            $runpath"
12916 fi
12917 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
12918 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
12919 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
12920 if test "$with_xmu" != yes -a "$with_x11" = yes; then
12921   echo "  No Xmu; substituting equivalent routines."
12922 fi
12923
12924 if test "$with_xpm" = yes; then
12925   echo "  Compiling in support for XPM images."
12926 elif test "$with_x11" = yes; then
12927   echo "  --------------------------------------------------------------------"
12928   echo "  WARNING: Compiling without XPM support."
12929   if test "$xpm_problem" != ""; then
12930     echo "  Reason: $xpm_problem"
12931   fi
12932   echo "  WARNING: You should strongly consider installing XPM."
12933   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
12934   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12935   echo "  --------------------------------------------------------------------"
12936 fi
12937 if test "$with_png" = yes; then
12938   echo "  Compiling in support for PNG image handling."
12939 elif test "$window_system" != "none"; then
12940   echo "  --------------------------------------------------------------------"
12941   echo "  WARNING: Compiling without PNG image support."
12942   if test "$png_problem" != ""; then
12943     echo "  Reason: $png_problem"
12944   fi
12945   echo "  WARNING: You should strongly consider installing the PNG libraries."
12946   echo "  WARNING: Otherwise certain images and glyphs may not display."
12947   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12948   echo "  --------------------------------------------------------------------"
12949 fi
12950 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
12951 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
12952 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
12953 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
12954 case "$with_sound" in
12955   nas    ) echo "  Compiling in network sound (NAS) support." ;;
12956   native ) echo "  Compiling in native sound support." ;;
12957   both   ) echo "  Compiling in both network and native sound support." ;;
12958 esac
12959 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
12960
12961 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
12962 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
12963 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
12964
12965 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
12966 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
12967 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
12968
12969 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
12970 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
12971
12972 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
12973 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
12974 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
12975 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
12976 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
12977 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
12978 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
12979 if test "$with_wnn" = yes; then
12980   echo "  Compiling in support for the WNN input method on Mule."
12981   test "$with_wnn6" = yes && echo "    Using WNN version 6."
12982 fi
12983 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
12984
12985 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
12986 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
12987 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
12988 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
12989 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
12990 test "$with_session"  != no && echo "  Compiling in support for proper session-management."
12991 case "$with_menubars" in
12992   lucid ) echo "  Using Lucid menubars." ;;
12993   motif ) echo "  Using Motif menubars."
12994           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
12995           echo "             We recommend using the Lucid menubar instead."
12996           echo "             Re-run configure with --with-menubars='lucid'." ;;
12997 esac
12998 case "$with_scrollbars" in
12999   lucid    ) echo "  Using Lucid scrollbars."     ;;
13000   motif    ) echo "  Using Motif scrollbars."     ;;
13001   athena   ) echo "  Using Athena scrollbars."    ;;
13002   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13003 esac
13004 case "$with_dialogs" in
13005   motif    ) echo "  Using Motif dialog boxes."     ;;
13006   athena   ) echo "  Using Athena dialog boxes."    ;;
13007   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13008 esac
13009 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
13010 test "$with_clash_detection" = yes && \
13011   echo "  Clash detection will use \"$lockdir\" for locking files."
13012 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13013 test "$with_pop"        = yes && echo "  Using POP for mail access."
13014 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13015 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13016 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13017 test "$use_minimal_tagbits" = yes && echo "  Using Lisp_Objects with minimal tagbits."
13018 test "$use_indexed_lrecord_implementation" = yes && echo "  Using indexed lrecord implementation."
13019 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13020 test "$memory_usage_stats" = yes && echo "  Compiling in code for checking XEmacs memory usage."
13021 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13022 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13023   != "no no no no no"; then
13024   echo "  WARNING: ---------------------------------------------------------"
13025   echo "  WARNING: Compiling in support for runtime error checking."
13026   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13027   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13028   echo "  WARNING: ---------------------------------------------------------"
13029 fi
13030 echo ""
13031 ) | tee -a Installation
13032 echo ""
13033
13034 echo '(setq Installation-string "' > Installation.el
13035 sed 's/"/\\"/g' Installation >> Installation.el
13036 echo '")' >> Installation.el
13037
13038
13039 # Remove any trailing slashes in these variables.
13040 test -n "$prefix" &&
13041   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13042 test -n "$exec_prefix" &&
13043   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13044
13045
13046 for file in $internal_makefile_list; do
13047   test "$file" = src/Makefile.in && \
13048     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13049   ac_output_files="${ac_output_files+$ac_output_files }$file"
13050 done
13051 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13052 if test "$with_shlib" = "yes"; then
13053   ac_output_files="$ac_output_files lib-src/ellcc.h"
13054 fi
13055
13056 trap '' 1 2 15
13057
13058 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13059
13060 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13061 # Let make expand exec_prefix.
13062 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13063
13064 # Any assignment to VPATH causes Sun make to only execute
13065 # the first set of double-colon rules, so remove it if not needed.
13066 # If there is a colon in the path, we need to keep it.
13067 if test "x$srcdir" = x.; then
13068   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13069 fi
13070
13071 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13072
13073 DEFS=-DHAVE_CONFIG_H
13074
13075 # Without the "./", some shells look in PATH for config.status.
13076 : ${CONFIG_STATUS=./config.status}
13077
13078 echo creating $CONFIG_STATUS
13079 rm -f $CONFIG_STATUS
13080 cat > $CONFIG_STATUS <<EOF
13081 #! /bin/sh
13082 # Generated automatically by configure.
13083 # Run this file to recreate the current configuration.
13084 # This directory was configured as follows,
13085 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13086 #
13087 # $0 $ac_configure_args
13088 #
13089 # Compiler output produced by configure, useful for debugging
13090 # configure, is in ./config.log if it exists.
13091
13092 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13093 for ac_option
13094 do
13095   case "\$ac_option" in
13096   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13097     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13098     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13099   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13100     echo "$CONFIG_STATUS generated by autoconf version 2.12"
13101     exit 0 ;;
13102   -help | --help | --hel | --he | --h)
13103     echo "\$ac_cs_usage"; exit 0 ;;
13104   *) echo "\$ac_cs_usage"; exit 1 ;;
13105   esac
13106 done
13107
13108 ac_given_srcdir=$srcdir
13109 ac_given_INSTALL="$INSTALL"
13110
13111 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13112 EOF
13113 cat >> $CONFIG_STATUS <<EOF
13114
13115 # Protect against being on the right side of a sed subst in config.status.
13116 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13117  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13118 $ac_vpsub
13119 $extrasub
13120 s%@CFLAGS@%$CFLAGS%g
13121 s%@CPPFLAGS@%$CPPFLAGS%g
13122 s%@CXXFLAGS@%$CXXFLAGS%g
13123 s%@DEFS@%$DEFS%g
13124 s%@LDFLAGS@%$LDFLAGS%g
13125 s%@LIBS@%$LIBS%g
13126 s%@exec_prefix@%$exec_prefix%g
13127 s%@prefix@%$prefix%g
13128 s%@program_transform_name@%$program_transform_name%g
13129 s%@bindir@%$bindir%g
13130 s%@sbindir@%$sbindir%g
13131 s%@libexecdir@%$libexecdir%g
13132 s%@datadir@%$datadir%g
13133 s%@sysconfdir@%$sysconfdir%g
13134 s%@sharedstatedir@%$sharedstatedir%g
13135 s%@localstatedir@%$localstatedir%g
13136 s%@libdir@%$libdir%g
13137 s%@includedir@%$includedir%g
13138 s%@oldincludedir@%$oldincludedir%g
13139 s%@infodir@%$infodir%g
13140 s%@mandir@%$mandir%g
13141 s%@LN_S@%$LN_S%g
13142 s%@blddir@%$blddir%g
13143 s%@CC@%$CC%g
13144 s%@CPP@%$CPP%g
13145 s%@start_flags@%$start_flags%g
13146 s%@ld_switch_shared@%$ld_switch_shared%g
13147 s%@start_files@%$start_files%g
13148 s%@ld@%$ld%g
13149 s%@lib_gcc@%$lib_gcc%g
13150 s%@RANLIB@%$RANLIB%g
13151 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13152 s%@INSTALL_DATA@%$INSTALL_DATA%g
13153 s%@YACC@%$YACC%g
13154 s%@SET_MAKE@%$SET_MAKE%g
13155 s%@X_CFLAGS@%$X_CFLAGS%g
13156 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13157 s%@X_LIBS@%$X_LIBS%g
13158 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13159 s%@install_pp@%$install_pp%g
13160 s%@libs_xauth@%$libs_xauth%g
13161 s%@dnd_objs@%$dnd_objs%g
13162 s%@lwlib_objs@%$lwlib_objs%g
13163 s%@ALLOCA@%$ALLOCA%g
13164 s%@dll_ld@%$dll_ld%g
13165 s%@dll_cflags@%$dll_cflags%g
13166 s%@dll_ldflags@%$dll_ldflags%g
13167 s%@dll_post@%$dll_post%g
13168 s%@dll_ldo@%$dll_ldo%g
13169 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13170 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13171 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13172 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13173 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13174 s%@PROGNAME@%$PROGNAME%g
13175 s%@version@%$version%g
13176 s%@configuration@%$configuration%g
13177 s%@canonical@%$canonical%g
13178 s%@srcdir@%$srcdir%g
13179 s%@pkgdir@%$pkgdir%g
13180 s%@statedir@%$statedir%g
13181 s%@PREFIX@%$PREFIX%g
13182 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13183 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13184 s%@INFODIR@%$INFODIR%g
13185 s%@infopath@%$infopath%g
13186 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13187 s%@INFOPATH@%$INFOPATH%g
13188 s%@package_path@%$package_path%g
13189 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13190 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13191 s%@lispdir@%$lispdir%g
13192 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13193 s%@LISPDIR@%$LISPDIR%g
13194 s%@moduledir@%$moduledir%g
13195 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13196 s%@MODULEDIR@%$MODULEDIR%g
13197 s%@sitelispdir@%$sitelispdir%g
13198 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13199 s%@SITELISPDIR@%$SITELISPDIR%g
13200 s%@sitemoduledir@%$sitemoduledir%g
13201 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13202 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13203 s%@etcdir@%$etcdir%g
13204 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13205 s%@ETCDIR@%$ETCDIR%g
13206 s%@lockdir@%$lockdir%g
13207 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13208 s%@LOCKDIR@%$LOCKDIR%g
13209 s%@archlibdir@%$archlibdir%g
13210 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13211 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13212 s%@docdir@%$docdir%g
13213 s%@bitmapdir@%$bitmapdir%g
13214 s%@extra_objs@%$extra_objs%g
13215 s%@machfile@%$machfile%g
13216 s%@opsysfile@%$opsysfile%g
13217 s%@c_switch_general@%$c_switch_general%g
13218 s%@c_switch_window_system@%$c_switch_window_system%g
13219 s%@c_switch_all@%$c_switch_all%g
13220 s%@ld_switch_general@%$ld_switch_general%g
13221 s%@ld_switch_window_system@%$ld_switch_window_system%g
13222 s%@ld_switch_all@%$ld_switch_all%g
13223 s%@ld_libs_general@%$ld_libs_general%g
13224 s%@ld_libs_window_system@%$ld_libs_window_system%g
13225 s%@ld_libs_all@%$ld_libs_all%g
13226 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13227 s%@native_sound_lib@%$native_sound_lib%g
13228 s%@sound_cflags@%$sound_cflags%g
13229 s%@dynodump_arch@%$dynodump_arch%g
13230 s%@XEMACS_CC@%$XEMACS_CC%g
13231 s%@internal_makefile_list@%$internal_makefile_list%g
13232
13233 CEOF
13234 EOF
13235
13236 cat >> $CONFIG_STATUS <<\EOF
13237
13238 # Split the substitutions into bite-sized pieces for seds with
13239 # small command number limits, like on Digital OSF/1 and HP-UX.
13240 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13241 ac_file=1 # Number of current file.
13242 ac_beg=1 # First line for current file.
13243 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13244 ac_more_lines=:
13245 ac_sed_cmds=""
13246 while $ac_more_lines; do
13247   if test $ac_beg -gt 1; then
13248     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13249   else
13250     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13251   fi
13252   if test ! -s conftest.s$ac_file; then
13253     ac_more_lines=false
13254     rm -f conftest.s$ac_file
13255   else
13256     if test -z "$ac_sed_cmds"; then
13257       ac_sed_cmds="sed -f conftest.s$ac_file"
13258     else
13259       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13260     fi
13261     ac_file=`expr $ac_file + 1`
13262     ac_beg=$ac_end
13263     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13264   fi
13265 done
13266 if test -z "$ac_sed_cmds"; then
13267   ac_sed_cmds=cat
13268 fi
13269 EOF
13270
13271 cat >> $CONFIG_STATUS <<EOF
13272
13273 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13274 EOF
13275 cat >> $CONFIG_STATUS <<\EOF
13276 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13277   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13278   case "$ac_file" in
13279   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13280        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13281   *) ac_file_in="${ac_file}.in" ;;
13282   esac
13283
13284   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13285
13286   # Remove last slash and all that follows it.  Not all systems have dirname.
13287   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13288   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13289     # The file is in a subdirectory.
13290     test ! -d "$ac_dir" && mkdir "$ac_dir"
13291     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13292     # A "../" for each directory in $ac_dir_suffix.
13293     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13294   else
13295     ac_dir_suffix= ac_dots=
13296   fi
13297
13298   case "$ac_given_srcdir" in
13299   .)  srcdir=.
13300       if test -z "$ac_dots"; then top_srcdir=.
13301       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13302   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13303   *) # Relative path.
13304     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13305     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13306   esac
13307
13308   case "$ac_given_INSTALL" in
13309   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13310   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13311   esac
13312
13313   echo creating "$ac_file"
13314   rm -f "$ac_file"
13315   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13316   case "$ac_file" in
13317   *Makefile*) ac_comsub="1i\\
13318 # $configure_input" ;;
13319   *) ac_comsub= ;;
13320   esac
13321
13322   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13323   sed -e "$ac_comsub
13324 s%@configure_input@%$configure_input%g
13325 s%@srcdir@%$srcdir%g
13326 s%@top_srcdir@%$top_srcdir%g
13327 s%@INSTALL@%$INSTALL%g
13328 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13329 fi; done
13330 rm -f conftest.s*
13331
13332 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13333 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13334 #
13335 # ac_d sets the value in "#define NAME VALUE" lines.
13336 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13337 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13338 ac_dC='\3'
13339 ac_dD='%g'
13340 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13341 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13342 ac_uB='\([      ]\)%\1#\2define\3'
13343 ac_uC=' '
13344 ac_uD='\4%g'
13345 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13346 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13347 ac_eB='$%\1#\2define\3'
13348 ac_eC=' '
13349 ac_eD='%g'
13350
13351 if test "${CONFIG_HEADERS+set}" != set; then
13352 EOF
13353 cat >> $CONFIG_STATUS <<EOF
13354   CONFIG_HEADERS="src/config.h lwlib/config.h"
13355 EOF
13356 cat >> $CONFIG_STATUS <<\EOF
13357 fi
13358 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13359   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13360   case "$ac_file" in
13361   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13362        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13363   *) ac_file_in="${ac_file}.in" ;;
13364   esac
13365
13366   echo creating $ac_file
13367
13368   rm -f conftest.frag conftest.in conftest.out
13369   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13370   cat $ac_file_inputs > conftest.in
13371
13372 EOF
13373
13374 # Transform confdefs.h into a sed script conftest.vals that substitutes
13375 # the proper values into config.h.in to produce config.h.  And first:
13376 # Protect against being on the right side of a sed subst in config.status.
13377 # Protect against being in an unquoted here document in config.status.
13378 rm -f conftest.vals
13379 cat > conftest.hdr <<\EOF
13380 s/[\\&%]/\\&/g
13381 s%[\\$`]%\\&%g
13382 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13383 s%ac_d%ac_u%gp
13384 s%ac_u%ac_e%gp
13385 EOF
13386 sed -n -f conftest.hdr confdefs.h > conftest.vals
13387 rm -f conftest.hdr
13388
13389 # This sed command replaces #undef with comments.  This is necessary, for
13390 # example, in the case of _POSIX_SOURCE, which is predefined and required
13391 # on some systems where configure will not decide to define it.
13392 cat >> conftest.vals <<\EOF
13393 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13394 EOF
13395
13396 # Break up conftest.vals because some shells have a limit on
13397 # the size of here documents, and old seds have small limits too.
13398
13399 rm -f conftest.tail
13400 while :
13401 do
13402   ac_lines=`grep -c . conftest.vals`
13403   # grep -c gives empty output for an empty file on some AIX systems.
13404   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13405   # Write a limited-size here document to conftest.frag.
13406   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13407   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13408   echo 'CEOF
13409   sed -f conftest.frag conftest.in > conftest.out
13410   rm -f conftest.in
13411   mv conftest.out conftest.in
13412 ' >> $CONFIG_STATUS
13413   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13414   rm -f conftest.vals
13415   mv conftest.tail conftest.vals
13416 done
13417 rm -f conftest.vals
13418
13419 cat >> $CONFIG_STATUS <<\EOF
13420   rm -f conftest.frag conftest.h
13421   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13422   cat conftest.in >> conftest.h
13423   rm -f conftest.in
13424   if cmp -s $ac_file conftest.h 2>/dev/null; then
13425     echo "$ac_file is unchanged"
13426     rm -f conftest.h
13427   else
13428     # Remove last slash and all that follows it.  Not all systems have dirname.
13429       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13430       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13431       # The file is in a subdirectory.
13432       test ! -d "$ac_dir" && mkdir "$ac_dir"
13433     fi
13434     rm -f $ac_file
13435     mv conftest.h $ac_file
13436   fi
13437 fi; done
13438
13439 EOF
13440 cat >> $CONFIG_STATUS <<EOF
13441 CPP="$CPP"
13442  top_srcdir="$srcdir"
13443  MAKE_SUBDIR="$MAKE_SUBDIR"
13444
13445 EOF
13446 cat >> $CONFIG_STATUS <<\EOF
13447 for dir in . $MAKE_SUBDIR; do
13448   (
13449     cd $dir
13450     rm -f junk.c
13451     < Makefile.in \
13452       sed -e '/^# Generated/d' \
13453           -e 's%/\*\*/#.*%%' \
13454           -e 's/^ *# */#/' \
13455           -e '/^##/d' \
13456           -e '/^#/ {
13457 p
13458 d
13459 }'        \
13460           -e '/./ {
13461 s/\([\"]\)/\\\1/g
13462 s/^/"/
13463 s/$/"/
13464 }'  > junk.c;
13465
13466
13467
13468     echo creating $dir/Makefile
13469 $CPP -I. -I${top_srcdir}/src  junk.c \
13470   | sed -e 's/^\#.*//'          \
13471         -e 's/^[        ][      ]*$//'\
13472         -e 's/^ /       /'              \
13473   | sed -n -e '/^..*$/p'        \
13474   | sed '/^\"/ {
13475         s/\\\([\"]\)/\1/g
13476         s/^[    ]*\"//
13477         s/\"[   ]*$//
13478 }' > Makefile.new
13479     chmod 444 Makefile.new
13480     mv -f Makefile.new Makefile
13481
13482     echo creating $dir/GNUmakefile
13483 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13484   | sed -e 's/^\#.*//'          \
13485         -e 's/^[        ][      ]*$//'\
13486         -e 's/^ /       /'              \
13487   | sed -n -e '/^..*$/p'        \
13488   | sed '/^\"/ {
13489         s/\\\([\"]\)/\1/g
13490         s/^[    ]*\"//
13491         s/\"[   ]*$//
13492 }' > Makefile.new
13493     chmod 444 Makefile.new
13494     mv -f Makefile.new GNUmakefile
13495
13496     rm -f junk.c
13497   )
13498 done
13499
13500 sed < config.status >> lib-src/config.values \
13501   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13502   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13503   -e 's/^\([^ ]*\) $/\1 ""/' \
13504   -e 's/ 1$/ t/'
13505
13506
13507 exit 0
13508 EOF
13509 chmod +x $CONFIG_STATUS
13510 rm -fr confdefs* $ac_clean_files
13511 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1