XEmacs 21.2.5
[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
11 ### Don't edit this script!
12 ### This script was automatically generated by the `autoconf' program
13 ### from the file `./configure.in'.
14 ### To rebuild it, execute the command
15 ###     autoconf
16 ### in the this directory.  You must have autoconf version 2.12 or later.
17
18 ### This file is part of XEmacs.
19
20 ### XEmacs is free software; you can redistribute it and/or modify it
21 ### under the terms of the GNU General Public License as published by
22 ### the Free Software Foundation; either version 2, or (at your
23 ### option) any later version.
24
25 ### XEmacs is distributed in the hope that it will be useful, but
26 ### WITHOUT ANY WARRANTY; without even the implied warranty of
27 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
28 ### General Public License for more details.
29
30 ### You should have received a copy of the GNU General Public License
31 ### along with XEmacs; see the file COPYING.  If not, write to the Free
32 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
33 ### 02111-1307, USA.
34
35 ### For usage, run `./configure --help'
36 ### For more detailed information on building and installing XEmacs,
37 ### read the file `INSTALL'.
38 ###
39 ### If configure succeeds, it leaves its status in config.status.
40 ### A log of configuration tests can be found in config.log.
41 ### If configure fails after disturbing the status quo,
42 ###     config.status is removed.
43
44 ac_help="$ac_help
45   --with-x                use the X Window System"
46
47
48
49 if test -n "$ZSH_VERSION"; then
50     setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
51   setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
52   setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
53   setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
54       if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
55 elif test -n "$BASH_VERSION"; then
56     set -o posix
57   unset CDPATH
58 else
59   if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
60 fi
61
62 exec_prefix=NONE
63 host=NONE
64 no_create=
65 nonopt=NONE
66 no_recursion=
67 prefix=NONE
68 program_prefix=NONE
69 program_suffix=NONE
70 program_transform_name=s,x,x,
71 silent=
72 site=
73 srcdir=
74 target=NONE
75 verbose=
76 x_includes=NONE
77 x_libraries=NONE
78
79 bindir='${exec_prefix}/bin'
80 sbindir='${exec_prefix}/sbin'
81 libexecdir='${exec_prefix}/libexec'
82 datadir='${prefix}/share'
83 sysconfdir='${prefix}/etc'
84 sharedstatedir='${prefix}/com'
85 localstatedir='${prefix}/var'
86 libdir='${{exec_prefix}}/lib'
87 includedir='${prefix}/include'
88 oldincludedir='/usr/include'
89 infodir='${prefix}/info'
90 mandir='${prefix}/man'
91
92 subdirs=
93 MFLAGS= MAKEFLAGS=
94 ac_max_here_lines=12
95
96 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
97
98 # File descriptor usage:
99 # 0 standard input
100 # 1 file creation
101 # 2 errors and warnings
102 # 3 some systems may open it to /dev/tty
103 # 4 used on the Kubota Titan
104 # 6 checking for... messages and results
105 # 5 compiler messages saved in config.log
106 if test "$silent" = yes; then
107   exec 6>/dev/null
108 else
109   exec 6>&1
110 fi
111 exec 5>./config.log
112
113 echo "\
114 This file contains any messages produced by compilers while
115 running configure, to aid debugging if configure makes a mistake.
116 " 1>&5
117
118 # Strip out --no-create and --no-recursion so they do not pile up.
119 # Also quote any args containing shell metacharacters.
120 ac_configure_args=
121 for ac_arg
122 do
123   case "$ac_arg" in
124   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
125   | --no-cr | --no-c) ;;
126   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
127   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
128   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
129   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
130   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
131   esac
132 done
133
134 # NLS nuisances.
135 # Only set these to C if already set.  These must not be set unconditionally
136 # because not all systems understand e.g. LANG=C (notably SCO).
137 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
138 # Non-C LC_CTYPE values break the ctype check.
139 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
140 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
141 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
142 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
143
144 # confdefs.h avoids OS command line length limits that DEFS can exceed.
145 rm -rf conftest* confdefs.h
146 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
147 echo > confdefs.h
148
149 # A filename unique to this package, relative to the directory that
150 # configure is in, which we can look for to find out if srcdir is correct.
151 ac_unique_file=src/lisp.h
152
153 # Find the source files, if location was not specified.
154 if test -z "$srcdir"; then
155   ac_srcdir_defaulted=yes
156   # Try the directory containing this script, then its parent.
157   ac_prog=$0
158   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
159   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
160   srcdir=$ac_confdir
161   if test ! -r $srcdir/$ac_unique_file; then
162     srcdir=..
163   fi
164 else
165   ac_srcdir_defaulted=no
166 fi
167 if test ! -r $srcdir/$ac_unique_file; then
168   if test "$ac_srcdir_defaulted" = yes; then
169     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
170   else
171     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
172   fi
173 fi
174 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
175
176 # Prefer explicitly selected file to automatically selected ones.
177 if test -z "$CONFIG_SITE"; then
178   if test "x$prefix" != xNONE; then
179     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
180   else
181     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
182   fi
183 fi
184 for ac_site_file in $CONFIG_SITE; do
185   if test -r "$ac_site_file"; then
186     echo "loading site script $ac_site_file"
187     . "$ac_site_file"
188   fi
189 done
190
191
192 ac_ext=c
193 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
194 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
195 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
196 ac_cpp='$CPP '"$xe_cppflags"
197 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
198 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
199 cross_compiling=no
200
201 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
202   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
203   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
204     ac_n= ac_c='
205 ' ac_t='        '
206   else
207     ac_n=-n ac_c= ac_t=
208   fi
209 else
210   ac_n= ac_c='\c' ac_t=
211 fi
212
213
214 progname="`echo $0 | sed 's:^\./\./:\./:'`"
215
216
217 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
218 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
219
220 prefix='/usr/local'
221 exec_prefix='${prefix}'
222 bindir='${exec_prefix}/bin'
223 datadir='${prefix}/lib'
224 statedir='${prefix}/lib'
225 libdir='${exec_prefix}/lib'
226 mandir='${prefix}/man/man1'
227 infodir='${datadir}/${PROGNAME}-${version}/info'
228 infopath=''
229 install_pp=''
230 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
231 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
232 package_path=''
233 etcdir='${datadir}/${PROGNAME}-${version}/etc'
234 lockdir='${statedir}/${PROGNAME}/lock'
235 archlibdir='${libdir}/${PROGNAME}-${version}/${configuration}'
236 with_site_lisp='no'
237 with_menubars=''
238 with_scrollbars=''
239 with_dialogs=''
240 with_file_coding=''
241 puresize=''
242 cpp='' cppflags='' libs='' ldflags=''
243 dynamic=''
244 with_x11=''
245 with_msw=''
246 rel_alloc='default'
247 with_system_malloc='default'
248 with_dlmalloc='default'
249 native_sound_lib=''
250 use_assertions="yes"
251 with_toolbars=""
252 with_tty=""
253 use_union_type="no"
254 with_dnet=""
255
256
257
258
259 arguments="$@"
260
261 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
262 quoted_arguments=
263 for i in "$@"; do
264    case "$i" in
265    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
266    | --no-cr | --no-c) ;;
267    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
268    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
269    *)
270    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
271    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
272    esac
273 done
274
275 while test $# != 0; do
276   arg="$1"; shift
277   case "$arg" in
278     --no-create|--no-recursion) ;;
279         -* )
280             case "$arg" in
281         -*=*)
282           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
283           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
284           valomitted=no
285         ;;
286                                                                           -*)
287                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
288           val="yes" valomitted=yes
289         ;;
290       esac
291
292             optname="$opt"
293       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
294
295             case "${valomitted}-${opt}" in yes-without_* )
296         opt=`echo $opt | sed 's/without/with/'`
297         valomitted="no" val="no" ;;
298       esac
299
300             case "$opt" in
301
302         with_site_lisp  | \
303         with_x          | \
304         with_x11        | \
305         with_msw        | \
306         with_gcc        | \
307         dynamic         | \
308         with_ncurses    | \
309         with_dnet       | \
310         with_socks      | \
311         with_dragndrop  | \
312         with_cde        | \
313         with_offix      | \
314         with_gpm        | \
315         with_xpm        | \
316         with_xface      | \
317         with_gif        | \
318         with_jpeg       | \
319         with_png        | \
320         with_tiff       | \
321         with_session    | \
322         with_xmu        | \
323         with_purify     | \
324         with_quantify   | \
325         with_toolbars   | \
326         with_tty        | \
327         with_xfs        | \
328         with_i18n3      | \
329         with_mule       | \
330         with_file_coding| \
331         with_canna      | \
332         with_wnn        | \
333         with_wnn6       | \
334         with_workshop   | \
335         with_sparcworks | \
336         with_tooltalk   | \
337         with_ldap       | \
338         with_pop        | \
339         with_kerberos   | \
340         with_hesiod     | \
341         with_dnet       | \
342         with_infodock   | \
343         external_widget | \
344         verbose         | \
345         extra_verbose   | \
346         const_is_losing | \
347         usage_tracking  | \
348         use_union_type  | \
349         debug           | \
350         use_assertions  | \
351         gung_ho         | \
352         use_minimal_tagbits                     | \
353         use_indexed_lrecord_implementation      | \
354         memory_usage_stats | \
355         with_clash_detection | \
356         with_shlib | \
357         no_doc_file )
358                   case "$val" in
359             y | ye | yes )      val=yes ;;
360             n | no )            val=no  ;;
361             * ) (echo "$progname: Usage error:"
362 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
363 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
364           esac
365           eval "$opt=\"$val\"" ;;
366
367
368                         srcdir          | \
369         compiler        | \
370         cflags          | \
371         cpp             | \
372         cppflags        | \
373         libs            | \
374         ldflags         | \
375         puresize        | \
376         cache_file      | \
377         native_sound_lib| \
378         site_lisp       | \
379         x_includes      | \
380         x_libraries     | \
381         site_includes   | \
382         site_libraries  | \
383         site_prefixes   | \
384         site_runtime_libraries )
385                   if test "$valomitted" = "yes" ; then
386                     if test "$#" = 0 ; then
387               (echo "$progname: Usage error:"
388 echo " " "The \`--$optname' option requires a value."
389 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
390             fi
391             val="$1"; shift
392           fi
393           eval "$opt=\"$val\""
394         ;;
395
396                 rel_alloc | \
397         with_dlmalloc | \
398         with_debug_malloc  | use_debug_malloc | \
399         with_system_malloc | use_system_malloc )
400           case "$val" in
401             y | ye | yes )      val=yes ;;
402             n | no )            val=no  ;;
403             d | de | def | defa | defau | defaul | default ) val=default ;;
404             * ) (echo "$progname: Usage error:"
405 echo " " "The \`--$optname' option requires one of these values:
406   \`yes', \`no', or \`default'."
407 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
408           esac
409           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
410           eval "$opt=\"$val\""
411         ;;
412
413                 "with_database" )
414           with_database_berkdb=no
415           with_database_dbm=no
416           with_database_gnudbm=no
417           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
418             case "$x" in
419                 no ) ;;
420                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
421                 d | db | dbm )                          with_database_dbm=yes    ;;
422                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
423                 * ) (echo "$progname: Usage error:"
424 echo " " "The \`--$optname' option value
425   must be either \`no' or a comma-separated list
426   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
427 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
428             esac
429           done
430           if test "$with_database_dbm"    = "yes" -a \
431                   "$with_database_gnudbm" = "yes"; then
432           (echo "$progname: Usage error:"
433 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
434   with the \`--$optname' option."
435 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
436           fi
437         ;;
438
439                 "with_sound" )
440                           case "$val" in
441             y | ye | yes )                      val=native ;;
442             n | no | non | none )               val=no;;
443             na | nat | nati | nativ | native )  val=native  ;;
444             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
445             b | bo | bot | both )               val=both;;
446             * ) (echo "$progname: Usage error:"
447 echo " " "The \`--$optname' option must have one of these values:
448   \`native', \`nas', \`both', or \`none'."
449 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
450           esac
451           eval "$opt=\"$val\""
452         ;;
453
454                 "with_xim" )
455           case "$val" in
456             y | ye | yes )                val=yes   ;;
457             n | no | non | none )         val=no    ;;
458             x | xl | xli | xlib )         val=xlib  ;;
459             m | mo | mot | moti | motif ) val=motif ;;
460             * ) (echo "$progname: Usage error:"
461 echo " " "The \`--$optname' option must have one of these values:
462   \`motif', \`xlib', \`yes', or \`no'."
463 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
464           esac
465           eval "$opt=\"$val\""
466         ;;
467
468                 "mail_locking" )
469           case "$val" in
470             lockf )     val=lockf ;;
471             flock )     val=flock ;;
472             file )      val=file  ;;
473             * ) (echo "$progname: Usage error:"
474 echo " " "The \`--$optname' option must have one of these values:
475   \`lockf', \`flock', or \`file'."
476 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
477           esac
478           eval "$opt=\"$val\""
479         ;;
480
481                 "error_checking" )
482                           
483           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
484             case "$x" in
485                       n | no | non | none ) new_default=no ;;
486               a | al | all )        new_default=yes ;;
487
488               extents )       error_check_extents=yes ;;
489               noextents )     error_check_extents=no ;;
490
491               typecheck )     error_check_typecheck=yes ;;
492               notypecheck )   error_check_typecheck=no ;;
493
494               bufpos )        error_check_bufpos=yes ;;
495               nobufpos )      error_check_bufpos=no ;;
496
497               gc )            error_check_gc=yes ;;
498               nogc )          error_check_gc=no ;;
499
500               malloc )        error_check_malloc=yes ;;
501               nomalloc )      error_check_malloc=no ;;
502
503               * ) bogus_error_check=yes ;;
504             esac
505             if test "$bogus_error_check" -o \
506                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
507                 if test "$error_check_default" = yes ; then
508                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', and \`nomalloc'."
509                 else
510                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'."
511                 fi
512                 (echo "$progname: Usage error:"
513 echo " " "Valid types for the \`--$optname' option are:
514   $types."
515 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
516             elif test -n "$new_default" ; then
517                 error_check_extents=$new_default
518                 error_check_typecheck=$new_default
519                 error_check_bufpos=$new_default
520                 error_check_gc=$new_default
521                 error_check_malloc=$new_default
522                 new_default=    # reset this
523             fi
524             echeck_notfirst=true
525           done
526         ;;
527
528                                 
529                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
530         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
531         archlibdir | docdir | package_path )
532                    if test "$valomitted" = "yes"; then
533              if test "$#" = 0; then
534                  (echo "$progname: Usage error:"
535 echo " " "The \`--$optname' option requires a value."
536 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
537              fi
538              val="$1"; shift
539            fi
540            eval "$opt=\"$val\""
541
542                            case "$opt" in
543              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
544     Defining LISPDIR_USER_DEFINED
545 EOF
546 cat >> confdefs.h <<\EOF
547 #define LISPDIR_USER_DEFINED 1
548 EOF
549 }
550  ;;
551              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
552     Defining ETCDIR_USER_DEFINED
553 EOF
554 cat >> confdefs.h <<\EOF
555 #define ETCDIR_USER_DEFINED 1
556 EOF
557 }
558  ;;
559              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
560     Defining INFODIR_USER_DEFINED
561 EOF
562 cat >> confdefs.h <<\EOF
563 #define INFODIR_USER_DEFINED 1
564 EOF
565 }
566  ;;
567              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
568     Defining INFOPATH_USER_DEFINED
569 EOF
570 cat >> confdefs.h <<\EOF
571 #define INFOPATH_USER_DEFINED 1
572 EOF
573 }
574  ;;
575              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
576     Defining PACKAGE_PATH_USER_DEFINED
577 EOF
578 cat >> confdefs.h <<\EOF
579 #define PACKAGE_PATH_USER_DEFINED 1
580 EOF
581 }
582  ;;
583              datadir )
584                 { test "$extra_verbose" = "yes" && cat << \EOF
585     Defining INFODIR_USER_DEFINED
586 EOF
587 cat >> confdefs.h <<\EOF
588 #define INFODIR_USER_DEFINED 1
589 EOF
590 }
591
592                 { test "$extra_verbose" = "yes" && cat << \EOF
593     Defining LISPDIR_USER_DEFINED
594 EOF
595 cat >> confdefs.h <<\EOF
596 #define LISPDIR_USER_DEFINED 1
597 EOF
598 }
599
600                 { test "$extra_verbose" = "yes" && cat << \EOF
601     Defining ETCDIR_USER_DEFINED
602 EOF
603 cat >> confdefs.h <<\EOF
604 #define ETCDIR_USER_DEFINED 1
605 EOF
606 }
607  ;;
608              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
609     Defining LOCKDIR_USER_DEFINED
610 EOF
611 cat >> confdefs.h <<\EOF
612 #define LOCKDIR_USER_DEFINED 1
613 EOF
614 }
615  ;;
616              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
617     Defining ARCHLIBDIR_USER_DEFINED
618 EOF
619 cat >> confdefs.h <<\EOF
620 #define ARCHLIBDIR_USER_DEFINED 1
621 EOF
622 }
623  ;;
624            esac
625         ;;
626
627                 "no_create" ) ;;
628
629                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
630
631                 "with_menubars"   | \
632         "with_scrollbars" | \
633         "with_dialogs" )
634           case "$val" in
635             l | lu | luc | luci | lucid )               val=lucid  ;;
636             m | mo | mot | moti | motif )               val=motif  ;;
637             athena3d | athena-3d )                      val=athena3d ;;
638             a | at | ath | athe | athen | athena )      val=athena ;;
639             n | no | non | none )                       val=no ;;
640             * ) (echo "$progname: Usage error:"
641 echo " " "The \`--$optname' option must have one of these values:
642   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
643 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
644           esac
645           eval "$opt=\"$val\""
646         ;;
647
648                 "run_in_place"  | \
649         "with_gnu_make" )
650           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
651         ;;
652
653                 * ) (echo "$progname: Usage error:"
654 echo " " "Unrecognized option: $arg"
655 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
656
657       esac
658     ;;
659
660         *-*-*) configuration="$arg" ;;
661
662         *) (echo "$progname: Usage error:"
663 echo " " "Unrecognized argument: $arg"
664 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
665
666   esac
667 done
668
669
670 test -n "$cpp"      && CPP="$cpp"
671 test -n "$cppflags" && CPPFLAGS="$cppflags"
672 test -n "$libs"     && LIBS="$libs"
673 test -n "$ldflags"  && LDFLAGS="$ldflags"
674
675 eval set x "$quoted_arguments"; shift
676
677 test "$extra_verbose" = "yes" && verbose=yes
678
679 test -n "$with_x" && with_x11="$with_x"
680
681 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
682   test "$with_system_malloc" = "default" && with_system_malloc=yes
683 fi
684
685 if test -n "$gung_ho"; then
686   test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho"
687   test -z "$use_indexed_lrecord_implementation" && \
688     use_indexed_lrecord_implementation="$gung_ho"
689 fi
690 if test "$use_minimal_tagbits" = "no"; then
691   test "$with_dlmalloc" = "yes" && \
692     (echo "$progname: Usage error:"
693 echo " " "--with-dlmalloc requires --use-minimal-tagbits"
694 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
695   with_dlmalloc=no
696 fi
697
698
699
700 if test "$with_cde $with_tooltalk" = "yes no"; then
701   (echo "$progname: Usage error:"
702 echo " " "--with-cde requires --with-tooltalk"
703 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
704 elif test "$with_tooltalk" = "no" ; then with_cde=no
705 elif test "$with_cde" = "yes"; then with_tooltalk=yes
706 fi
707
708
709 case "$srcdir" in
710
711     "" )
712     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
713       if test -f "$dir/src/lisp.h" -a \
714               -f "$dir/lisp/version.el" ; then
715         srcdir="$dir"
716         break
717       fi
718     done
719     if test -z "$srcdir" ; then
720       (echo "$progname: Usage error:"
721 echo " " "Neither the current directory nor its parent seem to
722   contain the XEmacs sources.  If you do not want to build XEmacs in its
723   source tree, you should run \`$progname' in the directory in which
724   you wish to build XEmacs, using the \`--srcdir' option to say where the
725   sources may be found."
726 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
727     fi
728   ;;
729
730     * )
731     if test ! -f "$srcdir/src/lisp.h" -o \
732             ! -f "$srcdir/lisp/version.el" ; then
733       (echo "$progname: Usage error:"
734 echo " " "The directory specified with the \`--srcdir' option,
735   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
736   either run the \`$progname' script at the top of the XEmacs source
737   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
738 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
739     fi
740   ;;
741 esac
742
743 if test -z "$configuration"; then
744     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
745   if test -z "$configuration"; then
746     (echo "$progname: Usage error:"
747 echo " " "XEmacs has not been ported to this host type.
748 Try explicitly specifying the CONFIGURATION when rerunning configure."
749 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
750   fi
751 fi
752
753 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
754 echo "configure:755: checking whether ln -s works" >&5
755
756 rm -f conftestdata
757 if ln -s X conftestdata 2>/dev/null
758 then
759   rm -f conftestdata
760   ac_cv_prog_LN_S="ln -s"
761 else
762   ac_cv_prog_LN_S=ln
763 fi
764 LN_S="$ac_cv_prog_LN_S"
765 if test "$ac_cv_prog_LN_S" = "ln -s"; then
766   echo "$ac_t""yes" 1>&6
767 else
768   echo "$ac_t""no" 1>&6
769 fi
770
771
772 for dir in lisp etc man info; do
773   if test ! -d "$dir" ; then
774     echo Making symbolic link to "$srcdir/$dir"
775     ${LN_S} "$srcdir/$dir" "$dir"
776   fi
777 done
778
779 absolute_pwd="`pwd`";
780 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
781 then blddir="$PWD"
782 else blddir="$absolute_pwd"
783 fi
784
785
786 case "$srcdir" in
787   /* ) ;;
788   .  ) srcdir="$blddir" ;;
789   *  ) srcdir="`cd $srcdir && pwd`" ;;
790 esac
791
792 if test `pwd` != `sh -c cd $srcdir && pwd`  \
793    && test -f "$srcdir/src/config.h"; then
794   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
795    echo "   as a build directory right now; it has been configured in its own"
796    echo "   right.  To configure in another directory as well, you MUST"
797    echo "   use GNU make.  If you do not have GNU make, then you must"
798    echo "   now do \`make distclean' in $srcdir,"
799    echo "   and then run $progname again.") >&2
800   extrasub='/^VPATH[     ]*=/c\
801 vpath %.c $(srcdir)\
802 vpath %.h $(srcdir)\
803 vpath %.y $(srcdir)\
804 vpath %.l $(srcdir)\
805 vpath %.s $(srcdir)\
806 vpath %.in $(srcdir)'
807 fi
808
809 . "$srcdir/version.sh" || exit 1;
810 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
811 : "${extra_verbose=$beta}"
812 version="${emacs_major_version}.${emacs_minor_version}"
813 { test "$extra_verbose" = "yes" && cat << EOF
814     Defining EMACS_MAJOR_VERSION = $emacs_major_version
815 EOF
816 cat >> confdefs.h <<EOF
817 #define EMACS_MAJOR_VERSION $emacs_major_version
818 EOF
819 }
820
821 { test "$extra_verbose" = "yes" && cat << EOF
822     Defining EMACS_MINOR_VERSION = $emacs_minor_version
823 EOF
824 cat >> confdefs.h <<EOF
825 #define EMACS_MINOR_VERSION $emacs_minor_version
826 EOF
827 }
828
829 if test -n "$emacs_beta_version"; then
830   version="${version}-b${emacs_beta_version}"
831   { test "$extra_verbose" = "yes" && cat << EOF
832     Defining EMACS_BETA_VERSION = $emacs_beta_version
833 EOF
834 cat >> confdefs.h <<EOF
835 #define EMACS_BETA_VERSION $emacs_beta_version
836 EOF
837 }
838
839 fi
840 { test "$extra_verbose" = "yes" && cat << EOF
841     Defining XEMACS_CODENAME = "$xemacs_codename"
842 EOF
843 cat >> confdefs.h <<EOF
844 #define XEMACS_CODENAME "$xemacs_codename"
845 EOF
846 }
847
848 { test "$extra_verbose" = "yes" && cat << EOF
849     Defining EMACS_VERSION = "$version"
850 EOF
851 cat >> confdefs.h <<EOF
852 #define EMACS_VERSION "$version"
853 EOF
854 }
855
856
857 if test "$with_infodock" = "yes"; then
858   if test ! -f ../ID-INSTALL; then
859     echo "Cannot build InfoDock without InfoDock sources"
860     with_infodock=no
861   fi
862 fi
863
864 if test "$with_infodock" = "yes"; then
865       { test "$extra_verbose" = "yes" && cat << EOF
866     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
867 EOF
868 cat >> confdefs.h <<EOF
869 #define INFODOCK_MAJOR_VERSION $infodock_major_version
870 EOF
871 }
872
873   { test "$extra_verbose" = "yes" && cat << EOF
874     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
875 EOF
876 cat >> confdefs.h <<EOF
877 #define INFODOCK_MINOR_VERSION $infodock_minor_version
878 EOF
879 }
880
881   { test "$extra_verbose" = "yes" && cat << EOF
882     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
883 EOF
884 cat >> confdefs.h <<EOF
885 #define INFODOCK_BUILD_VERSION $infodock_build_version
886 EOF
887 }
888
889   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
890   PROGNAME=infodock
891   CPPFLAGS="$CPPFLAGS -DINFODOCK"
892 else
893   PROGNAME=xemacs
894 fi
895
896 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
897 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
898     Defining ERROR_CHECK_EXTENTS
899 EOF
900 cat >> confdefs.h <<\EOF
901 #define ERROR_CHECK_EXTENTS 1
902 EOF
903 }
904
905 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
906     Defining ERROR_CHECK_TYPECHECK
907 EOF
908 cat >> confdefs.h <<\EOF
909 #define ERROR_CHECK_TYPECHECK 1
910 EOF
911 }
912
913 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
914     Defining ERROR_CHECK_BUFPOS
915 EOF
916 cat >> confdefs.h <<\EOF
917 #define ERROR_CHECK_BUFPOS 1
918 EOF
919 }
920
921 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
922     Defining ERROR_CHECK_GC
923 EOF
924 cat >> confdefs.h <<\EOF
925 #define ERROR_CHECK_GC 1
926 EOF
927 }
928
929 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
930     Defining ERROR_CHECK_MALLOC
931 EOF
932 cat >> confdefs.h <<\EOF
933 #define ERROR_CHECK_MALLOC 1
934 EOF
935 }
936
937 if test "${debug:=$beta}" = "yes"; then
938   use_assertions=yes memory_usage_stats=yes
939   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
940    echo "    xemacs will be linked with \"debug.o\""
941  fi
942   { test "$extra_verbose" = "yes" && cat << \EOF
943     Defining DEBUG_XEMACS
944 EOF
945 cat >> confdefs.h <<\EOF
946 #define DEBUG_XEMACS 1
947 EOF
948 }
949
950 fi
951 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
952     Defining USE_ASSERTIONS
953 EOF
954 cat >> confdefs.h <<\EOF
955 #define USE_ASSERTIONS 1
956 EOF
957 }
958
959 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
960     Defining MEMORY_USAGE_STATS
961 EOF
962 cat >> confdefs.h <<\EOF
963 #define MEMORY_USAGE_STATS 1
964 EOF
965 }
966
967
968
969 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
970 echo "configure:971: checking "host system type"" >&5
971 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
972 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
973 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
974 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
975 echo "$ac_t""$configuration" 1>&6
976
977
978
979
980
981 machine='' opsys=''
982
983 case "$canonical" in
984   sparc-*-*        ) machine=sparc ;;
985   alpha*-*-*       ) machine=alpha ;;
986   vax-*-*          ) machine=vax ;;
987   mips-dec-*       ) machine=pmax ;;
988   mips-sgi-*       ) machine=iris4d ;;
989   romp-ibm-*       ) machine=ibmrt ;;
990   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
991   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
992   powerpc*-*       ) machine=powerpc ;;
993   hppa-*-*         ) machine=hp800 ;;
994   m88k-dg-*        ) machine=aviion ;;
995   m68*-sony-*      ) machine=news ;;
996   mips-sony-*      ) machine=news-risc ;;
997   clipper-*        ) machine=clipper ;;
998   arm-*            ) machine=arm ;;
999   ns32k-*          ) machine=ns32000 ;;
1000 esac
1001
1002 case "$canonical" in
1003   *-*-linux*    ) opsys=linux ;;
1004   *-*-netbsd*   ) opsys=netbsd ;;
1005   *-*-openbsd*  ) opsys=openbsd ;;
1006   *-*-nextstep* ) opsys=nextstep ;;
1007   *-*-vms       ) opsys=vms ;;
1008
1009     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1010   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1011   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1012   *-dec-osf3*                ) opsys=decosf3-1 ;;
1013   *-dec-osf4*                ) opsys=decosf4-0 ;;
1014
1015     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1016   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1017   *-*-ultrix* )         opsys=ultrix4-3 ;;
1018
1019     *-*-aix3.1*  ) opsys=aix3-1 ;;
1020   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1021   *-*-aix3*    ) opsys=aix3-2   ;;
1022   *-*-aix4.0*  ) opsys=aix4     ;;
1023   *-*-aix4.1*  ) opsys=aix4-1   ;;
1024   *-*-aix4*    ) opsys=aix4-2   ;;
1025
1026     *-gnu* )                    opsys=gnu    ;;
1027   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1028   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1029   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1030   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1031   *-*-aos*   )                  opsys=bsd4-3 ;;
1032   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1033   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1034   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1035   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1036   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1037   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1038         if test -z "$NON_GNU_CPP" ; then
1039           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1040             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1041           done
1042         fi
1043         opsys=usg5-4-2 ;;
1044     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1045     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1046 esac
1047
1048 case "$canonical" in
1049
1050     *-*-netbsd* )
1051     case "$canonical" in
1052       i[3-9]86-*-netbsd*) machine=intel386 ;;
1053       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1054                                             machine=hp9000s300 ;;
1055       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1056       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1057     esac
1058   ;;
1059
1060     *-*-openbsd* )
1061     case "${canonical}" in
1062       i386-*-openbsd*)          machine=intel386 ;;
1063       m68k-*-openbsd*)          machine=hp9000s300 ;;
1064       mipsel-*-openbsd*)        machine=pmax ;;
1065      esac
1066    ;;
1067
1068     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1069   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1070
1071     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1072   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1073
1074     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1075
1076     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1077
1078     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1079
1080     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1081
1082     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1083
1084     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1085   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1086   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1087
1088   
1089     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1090
1091     *-convex-bsd* | *-convex-convexos* )
1092     machine=convex opsys=bsd4-3
1093     NON_GNU_CPP="cc -E -P"
1094   ;;
1095
1096     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1097
1098     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1099   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1100   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1101   m88k-dg-dgux*                           ) opsys=dgux     ;;
1102
1103     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1104   m88k-motorola-sysv4* )
1105                     machine=delta88k opsys=usg5-4-2
1106   ;;
1107   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1108
1109     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1110   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1111
1112     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1113
1114     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1115   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1116   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1117
1118       m88k-harris-cxux* )
1119         case "`uname -r`" in
1120        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1121        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1122     esac
1123     NON_GNU_CPP="/lib/cpp"
1124   ;;
1125     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1126     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1127
1128     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1129
1130     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1131
1132     *-hp-hpux* )
1133         case "$canonical" in
1134       m68*  ) machine=hp9000s300 ;;
1135       hppa* ) machine=hp800      ;;
1136     esac
1137
1138     case "$canonical" in
1139       *-hp-hpux7*  )  opsys=hpux   ;;
1140       *-hp-hpux8*  )  opsys=hpux8  ;;
1141       *-hp-hpux9*  )  opsys=hpux9  ;;
1142       *-hp-hpux10* )  opsys=hpux10 ;;
1143       *-hp-hpux11* )  opsys=hpux11 ;;
1144       *            )  opsys=hpux   ;;
1145     esac
1146
1147         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1148    echo "    xemacs will be linked with \"strcat.o\""
1149  fi ;; esac
1150
1151     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1152         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1153     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1154
1155     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1156   ;;
1157
1158     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1159   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1160
1161     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1162   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1163   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1164   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1165   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1166   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1167
1168     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1169   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1170
1171     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1172
1173     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1174
1175     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1176
1177     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1178
1179       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1180
1181     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1182
1183     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1184
1185     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1186
1187     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1188
1189         mips-mips-usg* ) machine=mips4 ;;
1190   mips-mips-riscos4 )
1191     machine=mips4
1192     NON_GNU_CC="cc -systype bsd43"
1193     NON_GNU_CPP="cc -systype bsd43 -E"
1194     case "$canonical" in
1195       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1196       mips-mips-riscos5* ) opsys=riscos5 ;;
1197     esac
1198   ;;
1199   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1200   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1201
1202     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1203
1204     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1205
1206     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1207   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1208
1209     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1210
1211     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1212
1213     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1214
1215     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1216
1217     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1218   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1219
1220     mips-siemens-sysv* | mips-sni-sysv*)
1221     machine=mips-siemens opsys=usg5-4
1222     NON_GNU_CC=/usr/ccs/bin/cc
1223     NON_GNU_CPP=/usr/ccs/lib/cpp
1224   ;;
1225
1226     mips-nec-sysv*)
1227     machine=mips-nec
1228     NON_GNU_CC=/usr/ccs/bin/cc
1229     NON_GNU_CPP=/usr/ccs/lib/cpp
1230   ;;
1231
1232       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1233   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1234     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1235   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1236   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1237   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1238   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1239   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1240   mips-sgi-irix*      ) opsys=irix5-0 ;;
1241
1242     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1243   *-sony-news* ) opsys=newsos5 ;;
1244
1245     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1246
1247     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1248         case "$canonical" in
1249       m68*-sunos1* )             machine=sun1     ;;
1250       m68*-sunos2* )             machine=sun2     ;;
1251       m68* )                     machine=sun3     ;;
1252       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1253       i*86-*-* )                 machine=intel386 ;;
1254       rs6000* )                  machine=rs6000   ;;
1255     esac
1256
1257         case "$canonical" in *-sunos5*)
1258       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1259     esac
1260
1261                     case "$canonical" in
1262       *-sunos4* )
1263         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1264         : ;;
1265       *-solaris2* )
1266         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1267         RANLIB=':' ;;
1268     esac
1269
1270     case "$canonical" in
1271       *-solaris*          )
1272         opsys=sol2
1273         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1274         { test "$extra_verbose" = "yes" && cat << EOF
1275     Defining OS_RELEASE = $os_release
1276 EOF
1277 cat >> confdefs.h <<EOF
1278 #define OS_RELEASE $os_release
1279 EOF
1280 }
1281  ;;
1282
1283             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1284       *-sunos4.0*         ) opsys=sunos4-0      ;;
1285       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1286       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1287       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1288       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1289       *-mach*             ) opsys=mach-bsd4-3   ;;
1290       *                   ) opsys=bsd4-2        ;;
1291     esac
1292
1293     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1294
1295         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1296   ;;
1297
1298     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1299
1300     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1301   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1302
1303     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1304
1305     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1306
1307     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1308       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1309
1310     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1311
1312     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1313
1314     vax-dec-* )
1315     case "$canonical" in
1316       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1317       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1318       *-mach* )                         opsys=mach-bsd4-3 ;;
1319     esac
1320   ;;
1321
1322     ns16k-whitechapel-* ) machine=mg1 ;;
1323
1324     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1325
1326     i[3-9]86-*-* )
1327     machine=intel386
1328     case "$canonical" in
1329       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1330       *-isc2.2* )               opsys=isc2-2 ;;
1331       *-isc4.0* )               opsys=isc4-0 ;;
1332       *-isc4.* )                opsys=isc4-1
1333                                 GCC_TEST_OPTIONS=-posix
1334                                 NON_GCC_TEST_OPTIONS=-Xp
1335                                 ;;
1336       *-isc* )                  opsys=isc3-0 ;;
1337       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1338       *-esix* )                 opsys=esix ;;
1339       *-mach* )                 opsys=mach-bsd4-3 ;;
1340       *-xenix* )                opsys=xenix ;;
1341       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1342       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1343       *-bsdi3* )                opsys=bsdos3 ;;
1344       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1345       *-bsdi2* )                opsys=bsdos2 ;;
1346       *-sco3.2v5* )             opsys=sco5 ;
1347                                                         if test "$dynamic" = "yes" ; then
1348                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1349         else
1350                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1351         fi ;;
1352       *-386bsd* )               opsys=386bsd ;;
1353       *-freebsd* )              opsys=freebsd ;;
1354       *-nextstep* )             opsys=nextstep ;;
1355       *-pc-cygwin32 )           opsys=cygwin32 ;;
1356           esac
1357   ;;
1358
1359     m68k-*-linux* ) machine=m68k opsys=linux ;;
1360
1361 esac
1362
1363 if test -z "$machine" -o -z "$opsys"; then
1364   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1365    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1366   ) >&2
1367   exit 1
1368 fi
1369
1370 if test -z "$dynamic"; then
1371   case "$opsys" in
1372     hpux* | sunos4* | sco5 ) dynamic=no ;;
1373     *) dynamic=yes ;;
1374   esac
1375 fi
1376 if test "$dynamic" = "yes"; then
1377   case "$opsys" in
1378     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1379     decosf* ) ld_call_shared="-call_shared" ;;
1380   esac
1381 else   case "$opsys" in
1382     sol2 )
1383       echo "Static linking is not supported on Solaris 2."
1384       echo "Rerun configure without specifying --dynamic=no."
1385       exit 1 ;;
1386     linux   ) ld_call_shared="-Bstatic" ;;
1387     decosf* ) ld_call_shared="-non_shared" ;;
1388   esac
1389 fi
1390
1391 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1392
1393 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1394 { test "$extra_verbose" = "yes" && cat << EOF
1395     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1396 EOF
1397 cat >> confdefs.h <<EOF
1398 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1399 EOF
1400 }
1401
1402
1403 machfile="m/${machine}.h"
1404 opsysfile="s/${opsys}.h"
1405
1406
1407 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1408 if test "$with_workshop $with_tooltalk" = "yes no"; then
1409   (echo "$progname: Usage error:"
1410 echo " " "--with-workshop requires --with-tooltalk"
1411 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1412 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1413 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1414 fi
1415
1416 if test "$with_workshop" = "yes"; then
1417   { test "$extra_verbose" = "yes" && cat << \EOF
1418     Defining SUNPRO
1419 EOF
1420 cat >> confdefs.h <<\EOF
1421 #define SUNPRO 1
1422 EOF
1423 }
1424
1425   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1426    echo "    xemacs will be linked with \"sunpro.o\""
1427  fi
1428 fi
1429
1430 if test "$with_clash_detection" = "yes"; then
1431   { test "$extra_verbose" = "yes" && cat << \EOF
1432     Defining CLASH_DETECTION
1433 EOF
1434 cat >> confdefs.h <<\EOF
1435 #define CLASH_DETECTION 1
1436 EOF
1437 }
1438
1439   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1440    echo "    xemacs will be linked with \"filelock.o\""
1441  fi
1442 fi
1443
1444 test -n "$compiler" && CC="$compiler"
1445 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1446 fi
1447
1448 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1449 if test "${CFLAGS-unset}" != unset
1450   then cflags_specified=yes;
1451   else cflags_specified=no;
1452 fi
1453
1454 xe_save_CFLAGS="$CFLAGS"
1455
1456 # Extract the first word of "gcc", so it can be a program name with args.
1457 set dummy gcc; ac_word=$2
1458 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1459 echo "configure:1460: checking for $ac_word" >&5
1460
1461 if test -n "$CC"; then
1462   ac_cv_prog_CC="$CC" # Let the user override the test.
1463 else
1464   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1465   for ac_dir in $PATH; do
1466     test -z "$ac_dir" && ac_dir=.
1467     if test -f $ac_dir/$ac_word; then
1468       ac_cv_prog_CC="gcc"
1469       break
1470     fi
1471   done
1472   IFS="$ac_save_ifs"
1473 fi
1474 CC="$ac_cv_prog_CC"
1475 if test -n "$CC"; then
1476   echo "$ac_t""$CC" 1>&6
1477 else
1478   echo "$ac_t""no" 1>&6
1479 fi
1480
1481 if test -z "$CC"; then
1482   # Extract the first word of "cc", so it can be a program name with args.
1483 set dummy cc; ac_word=$2
1484 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1485 echo "configure:1486: checking for $ac_word" >&5
1486
1487 if test -n "$CC"; then
1488   ac_cv_prog_CC="$CC" # Let the user override the test.
1489 else
1490   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1491   ac_prog_rejected=no
1492   for ac_dir in $PATH; do
1493     test -z "$ac_dir" && ac_dir=.
1494     if test -f $ac_dir/$ac_word; then
1495       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1496         ac_prog_rejected=yes
1497         continue
1498       fi
1499       ac_cv_prog_CC="cc"
1500       break
1501     fi
1502   done
1503   IFS="$ac_save_ifs"
1504 if test $ac_prog_rejected = yes; then
1505   # We found a bogon in the path, so make sure we never use it.
1506   set dummy $ac_cv_prog_CC
1507   shift
1508   if test $# -gt 0; then
1509     # We chose a different compiler from the bogus one.
1510     # However, it has the same basename, so the bogon will be chosen
1511     # first if we set CC to just the basename; use the full file name.
1512     shift
1513     set dummy "$ac_dir/$ac_word" "$@"
1514     shift
1515     ac_cv_prog_CC="$@"
1516   fi
1517 fi
1518 fi
1519 CC="$ac_cv_prog_CC"
1520 if test -n "$CC"; then
1521   echo "$ac_t""$CC" 1>&6
1522 else
1523   echo "$ac_t""no" 1>&6
1524 fi
1525
1526   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1527 fi
1528
1529 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1530 echo "configure:1531: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1531
1532 ac_ext=c
1533 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1534 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1535 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1536 ac_cpp='$CPP '"$xe_cppflags"
1537 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1538 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1539 cross_compiling=no
1540
1541 cat > conftest.$ac_ext <<EOF
1542 #line 1543 "configure"
1543 #include "confdefs.h"
1544 main(){return(0);}
1545 EOF
1546 if { (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1547   ac_cv_prog_cc_works=yes
1548   # If we can't run a trivial program, we are probably using a cross compiler.
1549   if (./conftest; exit) 2>/dev/null; then
1550     ac_cv_prog_cc_cross=no
1551   else
1552     ac_cv_prog_cc_cross=yes
1553   fi
1554 else
1555   echo "configure: failed program was:" >&5
1556   cat conftest.$ac_ext >&5
1557   ac_cv_prog_cc_works=no
1558 fi
1559 rm -fr conftest*
1560
1561 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1562 if test $ac_cv_prog_cc_works = no; then
1563   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1564 fi
1565 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1566 echo "configure:1567: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1567 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1568 cross_compiling=$ac_cv_prog_cc_cross
1569
1570 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1571 echo "configure:1572: checking whether we are using GNU C" >&5
1572
1573 cat > conftest.c <<EOF
1574 #ifdef __GNUC__
1575   yes;
1576 #endif
1577 EOF
1578 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1579   ac_cv_prog_gcc=yes
1580 else
1581   ac_cv_prog_gcc=no
1582 fi
1583
1584 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1585
1586 if test $ac_cv_prog_gcc = yes; then
1587   GCC=yes
1588   ac_test_CFLAGS="${CFLAGS+set}"
1589   ac_save_CFLAGS="$CFLAGS"
1590   CFLAGS=
1591   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1592 echo "configure:1593: checking whether ${CC-cc} accepts -g" >&5
1593
1594 echo 'void f(){}' > conftest.c
1595 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1596   ac_cv_prog_cc_g=yes
1597 else
1598   ac_cv_prog_cc_g=no
1599 fi
1600 rm -f conftest*
1601
1602
1603 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1604   if test "$ac_test_CFLAGS" = set; then
1605     CFLAGS="$ac_save_CFLAGS"
1606   elif test $ac_cv_prog_cc_g = yes; then
1607     CFLAGS="-g -O2"
1608   else
1609     CFLAGS="-O2"
1610   fi
1611 else
1612   GCC=
1613   test "${CFLAGS+set}" = set || CFLAGS="-g"
1614 fi
1615  
1616 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1617   CC=${NON_GNU_CC-cc}
1618   # Extract the first word of "gcc", so it can be a program name with args.
1619 set dummy gcc; ac_word=$2
1620 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1621 echo "configure:1622: checking for $ac_word" >&5
1622
1623 if test -n "$CC"; then
1624   ac_cv_prog_CC="$CC" # Let the user override the test.
1625 else
1626   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1627   for ac_dir in $PATH; do
1628     test -z "$ac_dir" && ac_dir=.
1629     if test -f $ac_dir/$ac_word; then
1630       ac_cv_prog_CC="gcc"
1631       break
1632     fi
1633   done
1634   IFS="$ac_save_ifs"
1635 fi
1636 CC="$ac_cv_prog_CC"
1637 if test -n "$CC"; then
1638   echo "$ac_t""$CC" 1>&6
1639 else
1640   echo "$ac_t""no" 1>&6
1641 fi
1642
1643 if test -z "$CC"; then
1644   # Extract the first word of "cc", so it can be a program name with args.
1645 set dummy cc; ac_word=$2
1646 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1647 echo "configure:1648: checking for $ac_word" >&5
1648
1649 if test -n "$CC"; then
1650   ac_cv_prog_CC="$CC" # Let the user override the test.
1651 else
1652   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1653   ac_prog_rejected=no
1654   for ac_dir in $PATH; do
1655     test -z "$ac_dir" && ac_dir=.
1656     if test -f $ac_dir/$ac_word; then
1657       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1658         ac_prog_rejected=yes
1659         continue
1660       fi
1661       ac_cv_prog_CC="cc"
1662       break
1663     fi
1664   done
1665   IFS="$ac_save_ifs"
1666 if test $ac_prog_rejected = yes; then
1667   # We found a bogon in the path, so make sure we never use it.
1668   set dummy $ac_cv_prog_CC
1669   shift
1670   if test $# -gt 0; then
1671     # We chose a different compiler from the bogus one.
1672     # However, it has the same basename, so the bogon will be chosen
1673     # first if we set CC to just the basename; use the full file name.
1674     shift
1675     set dummy "$ac_dir/$ac_word" "$@"
1676     shift
1677     ac_cv_prog_CC="$@"
1678   fi
1679 fi
1680 fi
1681 CC="$ac_cv_prog_CC"
1682 if test -n "$CC"; then
1683   echo "$ac_t""$CC" 1>&6
1684 else
1685   echo "$ac_t""no" 1>&6
1686 fi
1687
1688   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1689 fi
1690
1691 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1692 echo "configure:1693: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1693
1694 ac_ext=c
1695 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1696 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1697 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1698 ac_cpp='$CPP '"$xe_cppflags"
1699 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1700 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1701 cross_compiling=no
1702
1703 cat > conftest.$ac_ext <<EOF
1704 #line 1705 "configure"
1705 #include "confdefs.h"
1706 main(){return(0);}
1707 EOF
1708 if { (eval echo configure:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1709   ac_cv_prog_cc_works=yes
1710   # If we can't run a trivial program, we are probably using a cross compiler.
1711   if (./conftest; exit) 2>/dev/null; then
1712     ac_cv_prog_cc_cross=no
1713   else
1714     ac_cv_prog_cc_cross=yes
1715   fi
1716 else
1717   echo "configure: failed program was:" >&5
1718   cat conftest.$ac_ext >&5
1719   ac_cv_prog_cc_works=no
1720 fi
1721 rm -fr conftest*
1722
1723 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1724 if test $ac_cv_prog_cc_works = no; then
1725   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1726 fi
1727 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1728 echo "configure:1729: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1729 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1730 cross_compiling=$ac_cv_prog_cc_cross
1731
1732 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1733 echo "configure:1734: checking whether we are using GNU C" >&5
1734
1735 cat > conftest.c <<EOF
1736 #ifdef __GNUC__
1737   yes;
1738 #endif
1739 EOF
1740 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1741   ac_cv_prog_gcc=yes
1742 else
1743   ac_cv_prog_gcc=no
1744 fi
1745
1746 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1747
1748 if test $ac_cv_prog_gcc = yes; then
1749   GCC=yes
1750   ac_test_CFLAGS="${CFLAGS+set}"
1751   ac_save_CFLAGS="$CFLAGS"
1752   CFLAGS=
1753   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1754 echo "configure:1755: checking whether ${CC-cc} accepts -g" >&5
1755
1756 echo 'void f(){}' > conftest.c
1757 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1758   ac_cv_prog_cc_g=yes
1759 else
1760   ac_cv_prog_cc_g=no
1761 fi
1762 rm -f conftest*
1763
1764
1765 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1766   if test "$ac_test_CFLAGS" = set; then
1767     CFLAGS="$ac_save_CFLAGS"
1768   elif test $ac_cv_prog_cc_g = yes; then
1769     CFLAGS="-g -O2"
1770   else
1771     CFLAGS="-O2"
1772   fi
1773 else
1774   GCC=
1775   test "${CFLAGS+set}" = set || CFLAGS="-g"
1776 fi
1777
1778 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1779   CC=gcc
1780   # Extract the first word of "gcc", so it can be a program name with args.
1781 set dummy gcc; ac_word=$2
1782 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1783 echo "configure:1784: checking for $ac_word" >&5
1784
1785 if test -n "$CC"; then
1786   ac_cv_prog_CC="$CC" # Let the user override the test.
1787 else
1788   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1789   for ac_dir in $PATH; do
1790     test -z "$ac_dir" && ac_dir=.
1791     if test -f $ac_dir/$ac_word; then
1792       ac_cv_prog_CC="gcc"
1793       break
1794     fi
1795   done
1796   IFS="$ac_save_ifs"
1797 fi
1798 CC="$ac_cv_prog_CC"
1799 if test -n "$CC"; then
1800   echo "$ac_t""$CC" 1>&6
1801 else
1802   echo "$ac_t""no" 1>&6
1803 fi
1804
1805 if test -z "$CC"; then
1806   # Extract the first word of "cc", so it can be a program name with args.
1807 set dummy cc; ac_word=$2
1808 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1809 echo "configure:1810: checking for $ac_word" >&5
1810
1811 if test -n "$CC"; then
1812   ac_cv_prog_CC="$CC" # Let the user override the test.
1813 else
1814   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1815   ac_prog_rejected=no
1816   for ac_dir in $PATH; do
1817     test -z "$ac_dir" && ac_dir=.
1818     if test -f $ac_dir/$ac_word; then
1819       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1820         ac_prog_rejected=yes
1821         continue
1822       fi
1823       ac_cv_prog_CC="cc"
1824       break
1825     fi
1826   done
1827   IFS="$ac_save_ifs"
1828 if test $ac_prog_rejected = yes; then
1829   # We found a bogon in the path, so make sure we never use it.
1830   set dummy $ac_cv_prog_CC
1831   shift
1832   if test $# -gt 0; then
1833     # We chose a different compiler from the bogus one.
1834     # However, it has the same basename, so the bogon will be chosen
1835     # first if we set CC to just the basename; use the full file name.
1836     shift
1837     set dummy "$ac_dir/$ac_word" "$@"
1838     shift
1839     ac_cv_prog_CC="$@"
1840   fi
1841 fi
1842 fi
1843 CC="$ac_cv_prog_CC"
1844 if test -n "$CC"; then
1845   echo "$ac_t""$CC" 1>&6
1846 else
1847   echo "$ac_t""no" 1>&6
1848 fi
1849
1850   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1851 fi
1852
1853 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1854 echo "configure:1855: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1855
1856 ac_ext=c
1857 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1858 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1859 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1860 ac_cpp='$CPP '"$xe_cppflags"
1861 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1862 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1863 cross_compiling=no
1864
1865 cat > conftest.$ac_ext <<EOF
1866 #line 1867 "configure"
1867 #include "confdefs.h"
1868 main(){return(0);}
1869 EOF
1870 if { (eval echo configure:1871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1871   ac_cv_prog_cc_works=yes
1872   # If we can't run a trivial program, we are probably using a cross compiler.
1873   if (./conftest; exit) 2>/dev/null; then
1874     ac_cv_prog_cc_cross=no
1875   else
1876     ac_cv_prog_cc_cross=yes
1877   fi
1878 else
1879   echo "configure: failed program was:" >&5
1880   cat conftest.$ac_ext >&5
1881   ac_cv_prog_cc_works=no
1882 fi
1883 rm -fr conftest*
1884
1885 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1886 if test $ac_cv_prog_cc_works = no; then
1887   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1888 fi
1889 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1890 echo "configure:1891: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1891 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1892 cross_compiling=$ac_cv_prog_cc_cross
1893
1894 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1895 echo "configure:1896: checking whether we are using GNU C" >&5
1896
1897 cat > conftest.c <<EOF
1898 #ifdef __GNUC__
1899   yes;
1900 #endif
1901 EOF
1902 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1903   ac_cv_prog_gcc=yes
1904 else
1905   ac_cv_prog_gcc=no
1906 fi
1907
1908 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1909
1910 if test $ac_cv_prog_gcc = yes; then
1911   GCC=yes
1912   ac_test_CFLAGS="${CFLAGS+set}"
1913   ac_save_CFLAGS="$CFLAGS"
1914   CFLAGS=
1915   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1916 echo "configure:1917: checking whether ${CC-cc} accepts -g" >&5
1917
1918 echo 'void f(){}' > conftest.c
1919 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1920   ac_cv_prog_cc_g=yes
1921 else
1922   ac_cv_prog_cc_g=no
1923 fi
1924 rm -f conftest*
1925
1926
1927 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1928   if test "$ac_test_CFLAGS" = set; then
1929     CFLAGS="$ac_save_CFLAGS"
1930   elif test $ac_cv_prog_cc_g = yes; then
1931     CFLAGS="-g -O2"
1932   else
1933     CFLAGS="-O2"
1934   fi
1935 else
1936   GCC=
1937   test "${CFLAGS+set}" = set || CFLAGS="-g"
1938 fi
1939
1940 fi
1941 CFLAGS="$xe_save_CFLAGS"
1942
1943
1944 test -n "$CPP" -a -d "$CPP" && CPP=
1945
1946 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1947
1948 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1949 echo "configure:1950: checking how to run the C preprocessor" >&5
1950 # On Suns, sometimes $CPP names a directory.
1951 if test -n "$CPP" && test -d "$CPP"; then
1952   CPP=
1953 fi
1954 if test -z "$CPP"; then
1955
1956   # This must be in double quotes, not single quotes, because CPP may get
1957   # substituted into the Makefile and "${CC-cc}" will confuse make.
1958   CPP="${CC-cc} -E"
1959   # On the NeXT, cc -E runs the code through the compiler's parser,
1960   # not just through cpp.
1961   cat > conftest.$ac_ext <<EOF
1962 #line 1963 "configure"
1963 #include "confdefs.h"
1964 #include <assert.h>
1965 Syntax Error
1966 EOF
1967 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1968 { (eval echo configure:1969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1969 ac_err=`grep -v '^ *+' conftest.out`
1970 if test -z "$ac_err"; then
1971   :
1972 else
1973   echo "$ac_err" >&5
1974   echo "configure: failed program was:" >&5
1975   cat conftest.$ac_ext >&5
1976   rm -rf conftest*
1977   CPP="${CC-cc} -E -traditional-cpp"
1978   cat > conftest.$ac_ext <<EOF
1979 #line 1980 "configure"
1980 #include "confdefs.h"
1981 #include <assert.h>
1982 Syntax Error
1983 EOF
1984 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1985 { (eval echo configure:1986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1986 ac_err=`grep -v '^ *+' conftest.out`
1987 if test -z "$ac_err"; then
1988   :
1989 else
1990   echo "$ac_err" >&5
1991   echo "configure: failed program was:" >&5
1992   cat conftest.$ac_ext >&5
1993   rm -rf conftest*
1994   CPP=/lib/cpp
1995 fi
1996 rm -f conftest*
1997 fi
1998 rm -f conftest*
1999   ac_cv_prog_CPP="$CPP"
2000   CPP="$ac_cv_prog_CPP"
2001 else
2002   ac_cv_prog_CPP="$CPP"
2003 fi
2004 echo "$ac_t""$CPP" 1>&6
2005
2006
2007 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2008 echo "configure:2009: checking for AIX" >&5
2009 cat > conftest.$ac_ext <<EOF
2010 #line 2011 "configure"
2011 #include "confdefs.h"
2012 #ifdef _AIX
2013   yes
2014 #endif
2015
2016 EOF
2017 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2018   egrep "yes" >/dev/null 2>&1; then
2019   rm -rf conftest*
2020   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2021     Defining _ALL_SOURCE
2022 EOF
2023 cat >> confdefs.h <<\EOF
2024 #define _ALL_SOURCE 1
2025 EOF
2026 }
2027
2028 else
2029   rm -rf conftest*
2030   echo "$ac_t""no" 1>&6
2031 fi
2032 rm -f conftest*
2033
2034
2035
2036 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2037 echo "configure:2038: checking for GNU libc" >&5
2038 cat > conftest.$ac_ext <<EOF
2039 #line 2040 "configure"
2040 #include "confdefs.h"
2041 #include <features.h>
2042 int main() {
2043
2044 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2045 #error Not a GNU libc system :-(
2046 ******* ======= ******** &&&&&&&&
2047 #endif
2048
2049 ; return 0; }
2050 EOF
2051 if { (eval echo configure:2052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2052   rm -rf conftest*
2053   have_glibc=yes
2054 else
2055   echo "configure: failed program was:" >&5
2056   cat conftest.$ac_ext >&5
2057   rm -rf conftest*
2058   have_glibc=no
2059 fi
2060 rm -f conftest*
2061 echo "$ac_t""$have_glibc" 1>&6
2062 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2063     Defining _GNU_SOURCE
2064 EOF
2065 cat >> confdefs.h <<\EOF
2066 #define _GNU_SOURCE 1
2067 EOF
2068 }
2069
2070
2071
2072 cat > conftest.$ac_ext <<EOF
2073 #line 2074 "configure"
2074 #include "confdefs.h"
2075 int main () {
2076 #if defined __SUNPRO_C
2077 return 11;
2078 #elif defined __DECC
2079 return 12;
2080 #else
2081 return 0;
2082 #endif
2083 }
2084 EOF
2085 if { (eval echo configure:2086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2086 then
2087   :
2088 else
2089   conftest_rc="$?"
2090   echo "configure: failed program was:" >&5
2091   cat conftest.$ac_ext >&5
2092   rm -fr conftest*
2093   case "$conftest_rc" in
2094   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2095   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2096 esac
2097 fi
2098 rm -fr conftest*
2099
2100
2101
2102
2103 echo "Extracting information from the machine- and system-dependent headers..."
2104
2105 tempcname="conftest.c"
2106
2107
2108
2109 cat > $tempcname <<EOF
2110 #define NOT_C_CODE
2111 #define C_SWITCH_SITE
2112 #define C_SWITCH_X_SITE
2113 #define LD_SWITCH_SITE
2114 #define LD_SWITCH_X_SITE
2115 #define LD_SWITCH_X_SITE_AUX
2116 #define OS_RELEASE $os_release
2117 #include "$srcdir/src/$opsysfile"
2118 #include "$srcdir/src/$machfile"
2119
2120 #ifndef LIBS_MACHINE
2121 #define LIBS_MACHINE
2122 #endif
2123 configure___ libs_machine=LIBS_MACHINE
2124
2125 #ifndef LIBS_SYSTEM
2126 #define LIBS_SYSTEM
2127 #endif
2128 configure___ libs_system=LIBS_SYSTEM
2129
2130 #ifndef LIBS_TERMCAP
2131 #define LIBS_TERMCAP
2132 #endif
2133 configure___ libs_termcap=LIBS_TERMCAP
2134
2135 #ifndef LIB_STANDARD
2136 #define LIB_STANDARD
2137 #endif
2138 configure___ libs_standard=LIB_STANDARD
2139
2140
2141 #ifndef OBJECTS_MACHINE
2142 #define OBJECTS_MACHINE
2143 #endif
2144 configure___ objects_machine=OBJECTS_MACHINE
2145
2146 #ifndef OBJECTS_SYSTEM
2147 #define OBJECTS_SYSTEM
2148 #endif
2149 configure___ objects_system=OBJECTS_SYSTEM
2150
2151
2152 #ifndef C_SWITCH_MACHINE
2153 #define C_SWITCH_MACHINE
2154 #endif
2155 configure___ c_switch_machine=C_SWITCH_MACHINE
2156
2157 #ifndef C_SWITCH_SYSTEM
2158 #define C_SWITCH_SYSTEM
2159 #endif
2160 configure___ c_switch_system=C_SWITCH_SYSTEM
2161
2162
2163 #ifndef LD_SWITCH_MACHINE
2164 #define LD_SWITCH_MACHINE
2165 #endif
2166 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2167
2168 #ifndef LD_SWITCH_SYSTEM
2169 #define LD_SWITCH_SYSTEM
2170 #endif
2171 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2172
2173
2174 #ifndef UNEXEC
2175 #define UNEXEC "unexec.o"
2176 #endif
2177 configure___ unexec=UNEXEC
2178
2179
2180 #ifndef LD_SWITCH_SHARED
2181 #define LD_SWITCH_SHARED "-c"
2182 #endif
2183 configure___ ld_switch_shared=LD_SWITCH_SHARED
2184
2185
2186 #ifdef ORDINARY_LINK
2187 #define LD "\$(CC) \$(CFLAGS)"
2188 #else /* no ORDINARY LINK */
2189 #ifdef COFF_ENCAPSULATE
2190 #define LD "\$(CC) -nostdlib"
2191 #else /* not COFF_ENCAPSULATE */
2192 #ifdef LINKER
2193 #define LD LINKER
2194 #else /* ! defined (LINKER) */
2195 #define LD "ld"
2196 #endif /* ! defined (LINKER) */
2197 #endif /* ! defined (COFF_ENCAPSULATE) */
2198 #endif /* not ORDINARY_LINK */
2199 configure___ ld=LD
2200
2201 #ifndef LIB_GCC
2202 #define LIB_GCC
2203 #endif
2204 configure___ lib_gcc=LIB_GCC
2205
2206 #ifndef LD_TEXT_START_ADDR
2207 #define LD_TEXT_START_ADDR
2208 #endif
2209 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2210
2211
2212 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2213 #ifdef NO_REMAP
2214 #ifdef COFF_ENCAPSULATE
2215 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2216 #else /* ! defined (COFF_ENCAPSULATE) */
2217 #define START_FILES "pre-crt0.o /lib/crt0.o"
2218 #endif /* ! defined (COFF_ENCAPSULATE) */
2219 #else /* ! defined (NO_REMAP) */
2220 #define START_FILES "ecrt0.o"
2221 #endif /* ! defined (NO_REMAP) */
2222 #endif /* no ORDINARY_LINK */
2223 #ifndef START_FILES
2224 #define START_FILES
2225 #endif
2226 configure___ start_files=START_FILES
2227
2228 #ifdef ORDINARY_LINK
2229 configure___ ordinary_link=yes
2230 #else
2231 configure___ ordinary_link=no
2232 #endif
2233
2234 #ifdef SYSTEM_MALLOC
2235 configure___ system_malloc=yes
2236 #else
2237 configure___ system_malloc=no
2238 #endif
2239
2240 #ifdef TERMINFO
2241 configure___ have_terminfo=yes
2242 #else
2243 configure___ have_terminfo=no
2244 #endif
2245
2246 #ifdef MAIL_USE_FLOCK
2247 configure___ mail_use_flock=yes
2248 #else
2249 configure___ mail_use_flock=no
2250 #endif
2251
2252 #ifdef MAIL_USE_LOCKF
2253 configure___ mail_use_lockf=yes
2254 #else
2255 configure___ mail_use_lockf=no
2256 #endif
2257
2258 EOF
2259
2260 CPP=`eval "echo $CPP $CPPFLAGS"`
2261 eval `$CPP -Isrc $tempcname \
2262         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2263
2264 rm $tempcname
2265
2266 test "$extra_verbose" = "yes" && \
2267   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 ""
2268
2269 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2270
2271 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2272
2273 if test "$cflags_specified" = "no"; then
2274       if   test "$GCC" = "yes"; then
2275     CFLAGS="-g -O3 -Wall -Wno-switch"
2276                     test "$opsys $machine" = "cygwin32 intel386" && \
2277       CFLAGS="-g -O2 -Wall -Wno-switch"
2278   elif test "$__SUNPRO_C" = "yes"; then
2279     case "$opsys" in
2280       sol2    ) CFLAGS="-v -xO4" ;;
2281       sunos4* ) CFLAGS="-xO2";;
2282     esac
2283   elif test "$__DECC" = "yes"; then
2284     CFLAGS="-O3"
2285   elif test "$CC" = "xlc"; then
2286     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2287     else
2288     CFLAGS="-O" ;  fi
2289 fi
2290
2291
2292 if test "$GCC" = "yes"; then
2293   set x $ld_switch_system; shift; ld_switch_system=""
2294   while test -n "$1"; do
2295     case $1 in
2296       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2297       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2298       -Xlinker* ) ;;
2299       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2300     esac
2301     shift
2302   done
2303 fi
2304
2305 if test "$GCC" = "yes"; then
2306   set x $ld_switch_machine; shift; ld_switch_machine=""
2307   while test -n "$1"; do
2308     case $1 in
2309       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2310       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2311       -Xlinker* ) ;;
2312       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2313     esac
2314     shift
2315   done
2316 fi
2317
2318 if test "$GCC" = "yes"; then
2319   set x $LDFLAGS; shift; LDFLAGS=""
2320   while test -n "$1"; do
2321     case $1 in
2322       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2323       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2324       -Xlinker* ) ;;
2325       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2326     esac
2327     shift
2328   done
2329 fi
2330
2331 if test "$GCC" = "yes"; then
2332   set x $ld_call_shared; shift; ld_call_shared=""
2333   while test -n "$1"; do
2334     case $1 in
2335       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2336       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2337       -Xlinker* ) ;;
2338       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2339     esac
2340     shift
2341   done
2342 fi
2343
2344 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2345    echo "    xemacs will be linked with \"$objects_machine\""
2346  fi
2347 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2348    echo "    xemacs will be linked with \"$objects_system\""
2349  fi
2350 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2351    echo "    xemacs will be linked with \"$unexec\""
2352  fi
2353
2354 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2355 echo "configure:2356: checking for dynodump" >&5
2356 if test "$unexec" != "unexsol2.o"; then
2357   echo "$ac_t""no" 1>&6
2358 else
2359   echo "$ac_t""yes" 1>&6
2360   { test "$extra_verbose" = "yes" && cat << \EOF
2361     Defining DYNODUMP
2362 EOF
2363 cat >> confdefs.h <<\EOF
2364 #define DYNODUMP 1
2365 EOF
2366 }
2367
2368   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2369   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2370   case "$machine" in
2371     sparc   ) dynodump_arch=sparc ;;
2372     *86*    ) dynodump_arch=i386  ;;
2373     powerpc ) dynodump_arch=ppc   ;;
2374   esac
2375     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
2376 fi
2377
2378
2379 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2380
2381 if test "$unexec" = "unexaix.o"; then
2382   if   test "$dynamic" = "no"; then
2383   start_flags="-Wl,-bnso,-bnodelcsect"
2384   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2385   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2386     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2387   done
2388   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2389     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2390   done
2391   
2392 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2393 echo "configure:2394: checking for terminateAndUnload in -lC" >&5
2394 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2395
2396 xe_check_libs=" -lC "
2397 cat > conftest.$ac_ext <<EOF
2398 #line 2399 "configure"
2399 #include "confdefs.h"
2400 /* Override any gcc2 internal prototype to avoid an error.  */
2401 /* We use char because int might match the return type of a gcc2
2402     builtin and then its argument prototype would still apply.  */
2403 char terminateAndUnload();
2404
2405 int main() {
2406 terminateAndUnload()
2407 ; return 0; }
2408 EOF
2409 if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2410   rm -rf conftest*
2411   eval "ac_cv_lib_$ac_lib_var=yes"
2412 else
2413   echo "configure: failed program was:" >&5
2414   cat conftest.$ac_ext >&5
2415   rm -rf conftest*
2416   eval "ac_cv_lib_$ac_lib_var=no"
2417 fi
2418 rm -f conftest*
2419 xe_check_libs=""
2420
2421 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2422   echo "$ac_t""yes" 1>&6
2423   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2424 else
2425   echo "$ac_t""no" 1>&6
2426 fi
2427
2428
2429   fi
2430 elif test -n "$ld_text_start_addr"; then
2431   start_flags="-T $ld_text_start_addr -e __start"
2432 fi
2433
2434
2435
2436
2437 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2438  test -z "$linker" &&  linker='$(CC) -nostdlib'
2439  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2440 fi
2441 test "$GCC" != "yes" && lib_gcc=
2442
2443
2444
2445
2446
2447 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2448 if test -n "$site_libraries"; then
2449   for arg in $site_libraries; do
2450     case "$arg" in
2451      -* ) ;;
2452      * ) test -d "$arg" || \
2453            { echo "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2454        arg="-L${arg}" ;;
2455     esac
2456     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2457   done
2458 fi
2459
2460 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2461 if test -n "$site_includes"; then
2462   for arg in $site_includes; do
2463     case "$arg" in
2464       -* ) ;;
2465       * ) test -d "$arg" || \
2466            { echo "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2467       arg="-I${arg}" ;;
2468     esac
2469     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2470   done
2471 fi
2472
2473 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2474 if test -n "$site_prefixes"; then
2475   for dir in $site_prefixes; do
2476     inc_dir="${dir}/include"
2477     lib_dir="${dir}/lib"
2478     if test ! -d "$dir"; then
2479       { echo "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2480     elif test ! -d "$inc_dir"; then
2481       { echo "Invalid site prefix \`$dir': no such directory \`$inc_dir'" >&2; exit 1; }
2482     elif test ! -d "$lib_dir"; then
2483       { echo "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2484     else
2485       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
2486       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
2487     fi
2488   done
2489 fi
2490
2491
2492 for dir in "/usr/ccs/lib"; do
2493   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
2494 done
2495
2496 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2497 if test -n "$site_runtime_libraries"; then
2498   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2499   export LD_RUN_PATH
2500 fi
2501
2502
2503 if   test "$dynamic" = "no"; then add_runtime_path=no
2504 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2505 else case "$opsys" in
2506        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2507        * ) add_runtime_path=no ;;
2508      esac
2509 fi
2510
2511 if test "$add_runtime_path" = "yes"; then
2512       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2513 echo "configure:2514: checking "for runtime libraries flag"" >&5
2514   case "$opsys" in
2515     sol2 ) dash_r="-R" ;;
2516     decosf* | linux* ) dash_r="-rpath " ;;
2517     *)
2518       dash_r=""
2519       for try_dash_r in "-R" "-R " "-rpath "; do
2520         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2521         
2522 if test "$GCC" = "yes"; then
2523   set x $xe_check_libs; shift; xe_check_libs=""
2524   while test -n "$1"; do
2525     case $1 in
2526       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2527       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2528       -Xlinker* ) ;;
2529       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2530     esac
2531     shift
2532   done
2533 fi
2534         cat > conftest.$ac_ext <<EOF
2535 #line 2536 "configure"
2536 #include "confdefs.h"
2537
2538 int main() {
2539
2540 ; return 0; }
2541 EOF
2542 if { (eval echo configure:2543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2543   rm -rf conftest*
2544   dash_r="$try_dash_r"
2545 else
2546   echo "configure: failed program was:" >&5
2547   cat conftest.$ac_ext >&5
2548 fi
2549 rm -f conftest*
2550         xe_check_libs=""
2551         test -n "$dash_r" && break
2552       done ;;
2553   esac
2554   if test -n "$dash_r";
2555     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2556     else echo "$ac_t""NONE" 1>&6
2557   fi
2558 fi
2559
2560 xe_add_unique_runpath_dir='
2561   xe_add_p=yes
2562   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2563   done
2564   if test "$xe_add_p" = "yes"; then
2565     test -n "$runpath" && runpath="${runpath}:"
2566     runpath="${runpath}${xe_runpath_dir}"
2567     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2568   fi'
2569
2570
2571
2572
2573 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2574     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2575   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2576   
2577         runpath="" runpath_dirs=""
2578   if test -n "$LD_RUN_PATH"; then
2579     runpath="$LD_RUN_PATH"
2580   elif test "$GCC" = "yes"; then
2581         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2582     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2583     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2584     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2585       case "$arg" in P,* | -L* | -R* )
2586         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2587           {
2588 xe_runpath_dir="$dir"
2589   test "$xe_runpath_dir" != "/lib"     -a \
2590         "$xe_runpath_dir" != "/usr/lib" -a \
2591         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2592   eval "$xe_add_unique_runpath_dir"
2593 }
2594         done ;;
2595       esac
2596     done
2597     ld_switch_run="$ld_switch_run_save"
2598     rm -f conftest*
2599   else
2600         for arg in $ld_switch_site $ld_switch_x_site; do
2601       case "$arg" in -L*) {
2602 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2603   test "$xe_runpath_dir" != "/lib"     -a \
2604         "$xe_runpath_dir" != "/usr/lib" -a \
2605         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2606   eval "$xe_add_unique_runpath_dir"
2607 };; esac
2608     done
2609         if test "$opsys $need_motif" = "sol2 yes"; then
2610       xe_runpath_dir="/opt/SUNWdt/lib";
2611       eval "$xe_add_unique_runpath_dir";
2612     fi
2613   fi 
2614   if test -n "$runpath"; then
2615     ld_switch_run="${dash_r}${runpath}"
2616     
2617 if test "$GCC" = "yes"; then
2618   set x $ld_switch_run; shift; ld_switch_run=""
2619   while test -n "$1"; do
2620     case $1 in
2621       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2622       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2623       -Xlinker* ) ;;
2624       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2625     esac
2626     shift
2627   done
2628 fi
2629     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2630   fi
2631 fi
2632
2633
2634
2635 GNU_MALLOC=yes
2636 if test "$with_dlmalloc" != "no"; then
2637         doug_lea_malloc=yes
2638 else
2639         doug_lea_malloc=no
2640 fi
2641 after_morecore_hook_exists=yes
2642 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2643 echo "configure:2644: checking for malloc_get_state" >&5
2644
2645 cat > conftest.$ac_ext <<EOF
2646 #line 2647 "configure"
2647 #include "confdefs.h"
2648 /* System header to define __stub macros and hopefully few prototypes,
2649     which can conflict with char malloc_get_state(); below.  */
2650 #include <assert.h>
2651 /* Override any gcc2 internal prototype to avoid an error.  */
2652 /* We use char because int might match the return type of a gcc2
2653     builtin and then its argument prototype would still apply.  */
2654 char malloc_get_state();
2655
2656 int main() {
2657
2658 /* The GNU C library defines this for functions which it implements
2659     to always fail with ENOSYS.  Some functions are actually named
2660     something starting with __ and the normal name is an alias.  */
2661 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2662 choke me
2663 #else
2664 malloc_get_state();
2665 #endif
2666
2667 ; return 0; }
2668 EOF
2669 if { (eval echo configure:2670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2670   rm -rf conftest*
2671   eval "ac_cv_func_malloc_get_state=yes"
2672 else
2673   echo "configure: failed program was:" >&5
2674   cat conftest.$ac_ext >&5
2675   rm -rf conftest*
2676   eval "ac_cv_func_malloc_get_state=no"
2677 fi
2678 rm -f conftest*
2679
2680 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2681   echo "$ac_t""yes" 1>&6
2682   :
2683 else
2684   echo "$ac_t""no" 1>&6
2685 doug_lea_malloc=no
2686 fi
2687
2688 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2689 echo "configure:2690: checking for malloc_set_state" >&5
2690
2691 cat > conftest.$ac_ext <<EOF
2692 #line 2693 "configure"
2693 #include "confdefs.h"
2694 /* System header to define __stub macros and hopefully few prototypes,
2695     which can conflict with char malloc_set_state(); below.  */
2696 #include <assert.h>
2697 /* Override any gcc2 internal prototype to avoid an error.  */
2698 /* We use char because int might match the return type of a gcc2
2699     builtin and then its argument prototype would still apply.  */
2700 char malloc_set_state();
2701
2702 int main() {
2703
2704 /* The GNU C library defines this for functions which it implements
2705     to always fail with ENOSYS.  Some functions are actually named
2706     something starting with __ and the normal name is an alias.  */
2707 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2708 choke me
2709 #else
2710 malloc_set_state();
2711 #endif
2712
2713 ; return 0; }
2714 EOF
2715 if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2716   rm -rf conftest*
2717   eval "ac_cv_func_malloc_set_state=yes"
2718 else
2719   echo "configure: failed program was:" >&5
2720   cat conftest.$ac_ext >&5
2721   rm -rf conftest*
2722   eval "ac_cv_func_malloc_set_state=no"
2723 fi
2724 rm -f conftest*
2725
2726 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2727   echo "$ac_t""yes" 1>&6
2728   :
2729 else
2730   echo "$ac_t""no" 1>&6
2731 doug_lea_malloc=no
2732 fi
2733
2734 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2735 echo "configure:2736: checking whether __after_morecore_hook exists" >&5
2736 cat > conftest.$ac_ext <<EOF
2737 #line 2738 "configure"
2738 #include "confdefs.h"
2739 extern void (* __after_morecore_hook)();
2740 int main() {
2741 __after_morecore_hook = 0
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   echo "$ac_t""yes" 1>&6
2747 else
2748   echo "configure: failed program was:" >&5
2749   cat conftest.$ac_ext >&5
2750   rm -rf conftest*
2751   echo "$ac_t""no" 1>&6
2752    after_morecore_hook_exists=no
2753 fi
2754 rm -f conftest*
2755 if test "$system_malloc" = "yes" ; then
2756   GNU_MALLOC=no
2757   GNU_MALLOC_reason="
2758   (The GNU allocators don't work with this system configuration)."
2759 elif test "$with_system_malloc" = "yes" ; then
2760   GNU_MALLOC=no
2761   GNU_MALLOC_reason="
2762   (User chose not to use GNU allocators)."
2763 elif test "$with_debug_malloc" = "yes" ; then
2764   GNU_MALLOC=no
2765   GNU_MALLOC_reason="
2766   (User chose to use Debugging Malloc)."
2767 fi
2768
2769 if test "$doug_lea_malloc" = "yes" ; then
2770   if test "$GNU_MALLOC" = yes ; then
2771     GNU_MALLOC_reason="
2772   (Using Doug Lea's new malloc from the GNU C Library.)"
2773   fi
2774   { test "$extra_verbose" = "yes" && cat << \EOF
2775     Defining DOUG_LEA_MALLOC
2776 EOF
2777 cat >> confdefs.h <<\EOF
2778 #define DOUG_LEA_MALLOC 1
2779 EOF
2780 }
2781
2782   if test "$after_morecore_hook_exists" = "no" ; then
2783     GNU_MALLOC_reason="
2784   (Using Doug Lea's new malloc from the Linux C Library.)"
2785     { test "$extra_verbose" = "yes" && cat << \EOF
2786     Defining _NO_MALLOC_WARNING_
2787 EOF
2788 cat >> confdefs.h <<\EOF
2789 #define _NO_MALLOC_WARNING_ 1
2790 EOF
2791 }
2792
2793   fi
2794   use_minimal_tagbits=yes
2795 fi
2796
2797
2798
2799
2800 # Extract the first word of "ranlib", so it can be a program name with args.
2801 set dummy ranlib; ac_word=$2
2802 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2803 echo "configure:2804: checking for $ac_word" >&5
2804
2805 if test -n "$RANLIB"; then
2806   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2807 else
2808   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2809   for ac_dir in $PATH; do
2810     test -z "$ac_dir" && ac_dir=.
2811     if test -f $ac_dir/$ac_word; then
2812       ac_cv_prog_RANLIB="ranlib"
2813       break
2814     fi
2815   done
2816   IFS="$ac_save_ifs"
2817   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2818 fi
2819 RANLIB="$ac_cv_prog_RANLIB"
2820 if test -n "$RANLIB"; then
2821   echo "$ac_t""$RANLIB" 1>&6
2822 else
2823   echo "$ac_t""no" 1>&6
2824 fi
2825
2826 ac_aux_dir=
2827 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2828   if test -f $ac_dir/install-sh; then
2829     ac_aux_dir=$ac_dir
2830     ac_install_sh="$ac_aux_dir/install-sh -c"
2831     break
2832   elif test -f $ac_dir/install.sh; then
2833     ac_aux_dir=$ac_dir
2834     ac_install_sh="$ac_aux_dir/install.sh -c"
2835     break
2836   fi
2837 done
2838 if test -z "$ac_aux_dir"; then
2839   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2840 fi
2841 ac_config_guess=$ac_aux_dir/config.guess
2842 ac_config_sub=$ac_aux_dir/config.sub
2843 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2844
2845 # Find a good install program.  We prefer a C program (faster),
2846 # so one script is as good as another.  But avoid the broken or
2847 # incompatible versions:
2848 # SysV /etc/install, /usr/sbin/install
2849 # SunOS /usr/etc/install
2850 # IRIX /sbin/install
2851 # AIX /bin/install
2852 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2853 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2854 # ./install, which can be erroneously created by make from ./install.sh.
2855 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2856 echo "configure:2857: checking for a BSD compatible install" >&5
2857 if test -z "$INSTALL"; then
2858
2859   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2860   for ac_dir in $PATH; do
2861     # Account for people who put trailing slashes in PATH elements.
2862     case "$ac_dir/" in
2863     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2864     *)
2865       # OSF1 and SCO ODT 3.0 have their own names for install.
2866       for ac_prog in ginstall installbsd scoinst install; do
2867         if test -f $ac_dir/$ac_prog; then
2868           if test $ac_prog = install &&
2869             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2870             # AIX install.  It has an incompatible calling convention.
2871             # OSF/1 installbsd also uses dspmsg, but is usable.
2872             :
2873           else
2874             ac_cv_path_install="$ac_dir/$ac_prog -c"
2875             break 2
2876           fi
2877         fi
2878       done
2879       ;;
2880     esac
2881   done
2882   IFS="$ac_save_IFS"
2883
2884   if test "${ac_cv_path_install+set}" = set; then
2885     INSTALL="$ac_cv_path_install"
2886   else
2887     # As a last resort, use the slow shell script.  We don't cache a
2888     # path for INSTALL within a source directory, because that will
2889     # break other packages using the cache if that directory is
2890     # removed, or if the path is relative.
2891     INSTALL="$ac_install_sh"
2892   fi
2893 fi
2894 echo "$ac_t""$INSTALL" 1>&6
2895
2896 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2897 # It thinks the first close brace ends the variable substitution.
2898 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2899
2900 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2901
2902 for ac_prog in 'bison -y' byacc
2903 do
2904 # Extract the first word of "$ac_prog", so it can be a program name with args.
2905 set dummy $ac_prog; ac_word=$2
2906 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2907 echo "configure:2908: checking for $ac_word" >&5
2908
2909 if test -n "$YACC"; then
2910   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2911 else
2912   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2913   for ac_dir in $PATH; do
2914     test -z "$ac_dir" && ac_dir=.
2915     if test -f $ac_dir/$ac_word; then
2916       ac_cv_prog_YACC="$ac_prog"
2917       break
2918     fi
2919   done
2920   IFS="$ac_save_ifs"
2921 fi
2922 YACC="$ac_cv_prog_YACC"
2923 if test -n "$YACC"; then
2924   echo "$ac_t""$YACC" 1>&6
2925 else
2926   echo "$ac_t""no" 1>&6
2927 fi
2928
2929 test -n "$YACC" && break
2930 done
2931 test -n "$YACC" || YACC="yacc"
2932
2933
2934 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
2935 do
2936 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2937 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2938 echo "configure:2939: checking for $ac_hdr" >&5
2939
2940 cat > conftest.$ac_ext <<EOF
2941 #line 2942 "configure"
2942 #include "confdefs.h"
2943 #include <$ac_hdr>
2944 EOF
2945 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2946 { (eval echo configure:2947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2947 ac_err=`grep -v '^ *+' conftest.out`
2948 if test -z "$ac_err"; then
2949   rm -rf conftest*
2950   eval "ac_cv_header_$ac_safe=yes"
2951 else
2952   echo "$ac_err" >&5
2953   echo "configure: failed program was:" >&5
2954   cat conftest.$ac_ext >&5
2955   rm -rf conftest*
2956   eval "ac_cv_header_$ac_safe=no"
2957 fi
2958 rm -f conftest*
2959 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2960   echo "$ac_t""yes" 1>&6
2961     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2962   { test "$extra_verbose" = "yes" && cat << EOF
2963     Defining $ac_tr_hdr
2964 EOF
2965 cat >> confdefs.h <<EOF
2966 #define $ac_tr_hdr 1
2967 EOF
2968 }
2969  
2970 else
2971   echo "$ac_t""no" 1>&6
2972 fi
2973 done
2974
2975 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
2976 do
2977 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2978 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2979 echo "configure:2980: checking for $ac_hdr" >&5
2980
2981 cat > conftest.$ac_ext <<EOF
2982 #line 2983 "configure"
2983 #include "confdefs.h"
2984 #include <$ac_hdr>
2985 EOF
2986 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2987 { (eval echo configure:2988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2988 ac_err=`grep -v '^ *+' conftest.out`
2989 if test -z "$ac_err"; then
2990   rm -rf conftest*
2991   eval "ac_cv_header_$ac_safe=yes"
2992 else
2993   echo "$ac_err" >&5
2994   echo "configure: failed program was:" >&5
2995   cat conftest.$ac_ext >&5
2996   rm -rf conftest*
2997   eval "ac_cv_header_$ac_safe=no"
2998 fi
2999 rm -f conftest*
3000 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3001   echo "$ac_t""yes" 1>&6
3002     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3003   { test "$extra_verbose" = "yes" && cat << EOF
3004     Defining $ac_tr_hdr
3005 EOF
3006 cat >> confdefs.h <<EOF
3007 #define $ac_tr_hdr 1
3008 EOF
3009 }
3010  
3011 else
3012   echo "$ac_t""no" 1>&6
3013 fi
3014 done
3015
3016 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3017 do
3018 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3019 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3020 echo "configure:3021: checking for $ac_hdr" >&5
3021
3022 cat > conftest.$ac_ext <<EOF
3023 #line 3024 "configure"
3024 #include "confdefs.h"
3025 #include <$ac_hdr>
3026 EOF
3027 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3028 { (eval echo configure:3029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3029 ac_err=`grep -v '^ *+' conftest.out`
3030 if test -z "$ac_err"; then
3031   rm -rf conftest*
3032   eval "ac_cv_header_$ac_safe=yes"
3033 else
3034   echo "$ac_err" >&5
3035   echo "configure: failed program was:" >&5
3036   cat conftest.$ac_ext >&5
3037   rm -rf conftest*
3038   eval "ac_cv_header_$ac_safe=no"
3039 fi
3040 rm -f conftest*
3041 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3042   echo "$ac_t""yes" 1>&6
3043     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3044   { test "$extra_verbose" = "yes" && cat << EOF
3045     Defining $ac_tr_hdr
3046 EOF
3047 cat >> confdefs.h <<EOF
3048 #define $ac_tr_hdr 1
3049 EOF
3050 }
3051  
3052 else
3053   echo "$ac_t""no" 1>&6
3054 fi
3055 done
3056
3057 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3058 echo "configure:3059: checking for sys/wait.h that is POSIX.1 compatible" >&5
3059
3060 cat > conftest.$ac_ext <<EOF
3061 #line 3062 "configure"
3062 #include "confdefs.h"
3063 #include <sys/types.h>
3064 #include <sys/wait.h>
3065 #ifndef WEXITSTATUS
3066 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3067 #endif
3068 #ifndef WIFEXITED
3069 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3070 #endif
3071 int main() {
3072 int s;
3073 wait (&s);
3074 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3075 ; return 0; }
3076 EOF
3077 if { (eval echo configure:3078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3078   rm -rf conftest*
3079   ac_cv_header_sys_wait_h=yes
3080 else
3081   echo "configure: failed program was:" >&5
3082   cat conftest.$ac_ext >&5
3083   rm -rf conftest*
3084   ac_cv_header_sys_wait_h=no
3085 fi
3086 rm -f conftest*
3087
3088 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3089 if test $ac_cv_header_sys_wait_h = yes; then
3090   { test "$extra_verbose" = "yes" && cat << \EOF
3091     Defining HAVE_SYS_WAIT_H
3092 EOF
3093 cat >> confdefs.h <<\EOF
3094 #define HAVE_SYS_WAIT_H 1
3095 EOF
3096 }
3097
3098 fi
3099
3100 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3101 echo "configure:3102: checking for ANSI C header files" >&5
3102
3103 cat > conftest.$ac_ext <<EOF
3104 #line 3105 "configure"
3105 #include "confdefs.h"
3106 #include <stdlib.h>
3107 #include <stdarg.h>
3108 #include <string.h>
3109 #include <float.h>
3110 EOF
3111 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3112 { (eval echo configure:3113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3113 ac_err=`grep -v '^ *+' conftest.out`
3114 if test -z "$ac_err"; then
3115   rm -rf conftest*
3116   ac_cv_header_stdc=yes
3117 else
3118   echo "$ac_err" >&5
3119   echo "configure: failed program was:" >&5
3120   cat conftest.$ac_ext >&5
3121   rm -rf conftest*
3122   ac_cv_header_stdc=no
3123 fi
3124 rm -f conftest*
3125
3126 if test $ac_cv_header_stdc = yes; then
3127   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3128 cat > conftest.$ac_ext <<EOF
3129 #line 3130 "configure"
3130 #include "confdefs.h"
3131 #include <string.h>
3132 EOF
3133 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3134   egrep "memchr" >/dev/null 2>&1; then
3135   :
3136 else
3137   rm -rf conftest*
3138   ac_cv_header_stdc=no
3139 fi
3140 rm -f conftest*
3141
3142 fi
3143
3144 if test $ac_cv_header_stdc = yes; then
3145   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3146 cat > conftest.$ac_ext <<EOF
3147 #line 3148 "configure"
3148 #include "confdefs.h"
3149 #include <stdlib.h>
3150 EOF
3151 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3152   egrep "free" >/dev/null 2>&1; then
3153   :
3154 else
3155   rm -rf conftest*
3156   ac_cv_header_stdc=no
3157 fi
3158 rm -f conftest*
3159
3160 fi
3161
3162 if test $ac_cv_header_stdc = yes; then
3163   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3164 cat > conftest.$ac_ext <<EOF
3165 #line 3166 "configure"
3166 #include "confdefs.h"
3167 #include <ctype.h>
3168 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3169 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3170 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3171 int main () { int i; for (i = 0; i < 256; i++)
3172 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3173 exit (0); }
3174
3175 EOF
3176 if { (eval echo configure:3177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3177 then
3178   :
3179 else
3180   conftest_rc="$?"
3181   echo "configure: failed program was:" >&5
3182   cat conftest.$ac_ext >&5
3183   rm -fr conftest*
3184   ac_cv_header_stdc=no
3185 fi
3186 rm -fr conftest*
3187 fi
3188
3189 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3190 if test $ac_cv_header_stdc = yes; then
3191   { test "$extra_verbose" = "yes" && cat << \EOF
3192     Defining STDC_HEADERS
3193 EOF
3194 cat >> confdefs.h <<\EOF
3195 #define STDC_HEADERS 1
3196 EOF
3197 }
3198
3199 fi
3200
3201 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3202 echo "configure:3203: checking whether time.h and sys/time.h may both be included" >&5
3203
3204 cat > conftest.$ac_ext <<EOF
3205 #line 3206 "configure"
3206 #include "confdefs.h"
3207 #include <sys/types.h>
3208 #include <sys/time.h>
3209 #include <time.h>
3210 int main() {
3211 struct tm *tp;
3212 ; return 0; }
3213 EOF
3214 if { (eval echo configure:3215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3215   rm -rf conftest*
3216   ac_cv_header_time=yes
3217 else
3218   echo "configure: failed program was:" >&5
3219   cat conftest.$ac_ext >&5
3220   rm -rf conftest*
3221   ac_cv_header_time=no
3222 fi
3223 rm -f conftest*
3224
3225 echo "$ac_t""$ac_cv_header_time" 1>&6
3226 if test $ac_cv_header_time = yes; then
3227   { test "$extra_verbose" = "yes" && cat << \EOF
3228     Defining TIME_WITH_SYS_TIME
3229 EOF
3230 cat >> confdefs.h <<\EOF
3231 #define TIME_WITH_SYS_TIME 1
3232 EOF
3233 }
3234
3235 fi
3236
3237 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3238 echo "configure:3239: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3239
3240 cat > conftest.$ac_ext <<EOF
3241 #line 3242 "configure"
3242 #include "confdefs.h"
3243 #include <sys/types.h>
3244 #include <signal.h>
3245 /* NetBSD declares sys_siglist in unistd.h.  */
3246 #ifdef HAVE_UNISTD_H
3247 #include <unistd.h>
3248 #endif
3249 int main() {
3250 char *msg = *(sys_siglist + 1);
3251 ; return 0; }
3252 EOF
3253 if { (eval echo configure:3254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3254   rm -rf conftest*
3255   ac_cv_decl_sys_siglist=yes
3256 else
3257   echo "configure: failed program was:" >&5
3258   cat conftest.$ac_ext >&5
3259   rm -rf conftest*
3260   ac_cv_decl_sys_siglist=no
3261 fi
3262 rm -f conftest*
3263
3264 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3265 if test $ac_cv_decl_sys_siglist = yes; then
3266   { test "$extra_verbose" = "yes" && cat << \EOF
3267     Defining SYS_SIGLIST_DECLARED
3268 EOF
3269 cat >> confdefs.h <<\EOF
3270 #define SYS_SIGLIST_DECLARED 1
3271 EOF
3272 }
3273
3274 fi
3275
3276
3277 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3278 echo "configure:3279: checking for struct utimbuf" >&5
3279 cat > conftest.$ac_ext <<EOF
3280 #line 3281 "configure"
3281 #include "confdefs.h"
3282 #ifdef TIME_WITH_SYS_TIME
3283 #include <sys/time.h>
3284 #include <time.h>
3285 #else
3286 #ifdef HAVE_SYS_TIME_H
3287 #include <sys/time.h>
3288 #else
3289 #include <time.h>
3290 #endif
3291 #endif
3292 #ifdef HAVE_UTIME_H
3293 #include <utime.h>
3294 #endif
3295 int main() {
3296 static struct utimbuf x; x.actime = x.modtime;
3297 ; return 0; }
3298 EOF
3299 if { (eval echo configure:3300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3300   rm -rf conftest*
3301   echo "$ac_t""yes" 1>&6
3302    { test "$extra_verbose" = "yes" && cat << \EOF
3303     Defining HAVE_STRUCT_UTIMBUF
3304 EOF
3305 cat >> confdefs.h <<\EOF
3306 #define HAVE_STRUCT_UTIMBUF 1
3307 EOF
3308 }
3309
3310 else
3311   echo "configure: failed program was:" >&5
3312   cat conftest.$ac_ext >&5
3313   rm -rf conftest*
3314   echo "$ac_t""no" 1>&6
3315 fi
3316 rm -f conftest*
3317
3318 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3319 echo "configure:3320: checking return type of signal handlers" >&5
3320
3321 cat > conftest.$ac_ext <<EOF
3322 #line 3323 "configure"
3323 #include "confdefs.h"
3324 #include <sys/types.h>
3325 #include <signal.h>
3326 #ifdef signal
3327 #undef signal
3328 #endif
3329 #ifdef __cplusplus
3330 extern "C" void (*signal (int, void (*)(int)))(int);
3331 #else
3332 void (*signal ()) ();
3333 #endif
3334
3335 int main() {
3336 int i;
3337 ; return 0; }
3338 EOF
3339 if { (eval echo configure:3340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3340   rm -rf conftest*
3341   ac_cv_type_signal=void
3342 else
3343   echo "configure: failed program was:" >&5
3344   cat conftest.$ac_ext >&5
3345   rm -rf conftest*
3346   ac_cv_type_signal=int
3347 fi
3348 rm -f conftest*
3349
3350 echo "$ac_t""$ac_cv_type_signal" 1>&6
3351 { test "$extra_verbose" = "yes" && cat << EOF
3352     Defining RETSIGTYPE = $ac_cv_type_signal
3353 EOF
3354 cat >> confdefs.h <<EOF
3355 #define RETSIGTYPE $ac_cv_type_signal
3356 EOF
3357 }
3358
3359
3360 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3361 echo "configure:3362: checking for size_t" >&5
3362
3363 cat > conftest.$ac_ext <<EOF
3364 #line 3365 "configure"
3365 #include "confdefs.h"
3366 #include <sys/types.h>
3367 #if STDC_HEADERS
3368 #include <stdlib.h>
3369 #include <stddef.h>
3370 #endif
3371 EOF
3372 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3373   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3374   rm -rf conftest*
3375   ac_cv_type_size_t=yes
3376 else
3377   rm -rf conftest*
3378   ac_cv_type_size_t=no
3379 fi
3380 rm -f conftest*
3381
3382 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3383 if test $ac_cv_type_size_t = no; then
3384   { test "$extra_verbose" = "yes" && cat << \EOF
3385     Defining size_t = unsigned
3386 EOF
3387 cat >> confdefs.h <<\EOF
3388 #define size_t unsigned
3389 EOF
3390 }
3391
3392 fi
3393
3394 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3395 echo "configure:3396: checking for pid_t" >&5
3396
3397 cat > conftest.$ac_ext <<EOF
3398 #line 3399 "configure"
3399 #include "confdefs.h"
3400 #include <sys/types.h>
3401 #if STDC_HEADERS
3402 #include <stdlib.h>
3403 #include <stddef.h>
3404 #endif
3405 EOF
3406 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3407   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3408   rm -rf conftest*
3409   ac_cv_type_pid_t=yes
3410 else
3411   rm -rf conftest*
3412   ac_cv_type_pid_t=no
3413 fi
3414 rm -f conftest*
3415
3416 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3417 if test $ac_cv_type_pid_t = no; then
3418   { test "$extra_verbose" = "yes" && cat << \EOF
3419     Defining pid_t = int
3420 EOF
3421 cat >> confdefs.h <<\EOF
3422 #define pid_t int
3423 EOF
3424 }
3425
3426 fi
3427
3428 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3429 echo "configure:3430: checking for uid_t in sys/types.h" >&5
3430
3431 cat > conftest.$ac_ext <<EOF
3432 #line 3433 "configure"
3433 #include "confdefs.h"
3434 #include <sys/types.h>
3435 EOF
3436 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3437   egrep "uid_t" >/dev/null 2>&1; then
3438   rm -rf conftest*
3439   ac_cv_type_uid_t=yes
3440 else
3441   rm -rf conftest*
3442   ac_cv_type_uid_t=no
3443 fi
3444 rm -f conftest*
3445
3446
3447 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3448 if test $ac_cv_type_uid_t = no; then
3449   { test "$extra_verbose" = "yes" && cat << \EOF
3450     Defining uid_t = int
3451 EOF
3452 cat >> confdefs.h <<\EOF
3453 #define uid_t int
3454 EOF
3455 }
3456
3457   { test "$extra_verbose" = "yes" && cat << \EOF
3458     Defining gid_t = int
3459 EOF
3460 cat >> confdefs.h <<\EOF
3461 #define gid_t int
3462 EOF
3463 }
3464
3465 fi
3466
3467 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3468 echo "configure:3469: checking for mode_t" >&5
3469
3470 cat > conftest.$ac_ext <<EOF
3471 #line 3472 "configure"
3472 #include "confdefs.h"
3473 #include <sys/types.h>
3474 #if STDC_HEADERS
3475 #include <stdlib.h>
3476 #include <stddef.h>
3477 #endif
3478 EOF
3479 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3480   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3481   rm -rf conftest*
3482   ac_cv_type_mode_t=yes
3483 else
3484   rm -rf conftest*
3485   ac_cv_type_mode_t=no
3486 fi
3487 rm -f conftest*
3488
3489 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3490 if test $ac_cv_type_mode_t = no; then
3491   { test "$extra_verbose" = "yes" && cat << \EOF
3492     Defining mode_t = int
3493 EOF
3494 cat >> confdefs.h <<\EOF
3495 #define mode_t int
3496 EOF
3497 }
3498
3499 fi
3500
3501 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3502 echo "configure:3503: checking for off_t" >&5
3503
3504 cat > conftest.$ac_ext <<EOF
3505 #line 3506 "configure"
3506 #include "confdefs.h"
3507 #include <sys/types.h>
3508 #if STDC_HEADERS
3509 #include <stdlib.h>
3510 #include <stddef.h>
3511 #endif
3512 EOF
3513 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3514   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3515   rm -rf conftest*
3516   ac_cv_type_off_t=yes
3517 else
3518   rm -rf conftest*
3519   ac_cv_type_off_t=no
3520 fi
3521 rm -f conftest*
3522
3523 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3524 if test $ac_cv_type_off_t = no; then
3525   { test "$extra_verbose" = "yes" && cat << \EOF
3526     Defining off_t = long
3527 EOF
3528 cat >> confdefs.h <<\EOF
3529 #define off_t long
3530 EOF
3531 }
3532
3533 fi
3534
3535
3536 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3537 echo "configure:3538: checking for struct timeval" >&5
3538 cat > conftest.$ac_ext <<EOF
3539 #line 3540 "configure"
3540 #include "confdefs.h"
3541 #ifdef TIME_WITH_SYS_TIME
3542 #include <sys/time.h>
3543 #include <time.h>
3544 #else
3545 #ifdef HAVE_SYS_TIME_H
3546 #include <sys/time.h>
3547 #else
3548 #include <time.h>
3549 #endif
3550 #endif
3551 int main() {
3552 static struct timeval x; x.tv_sec = x.tv_usec;
3553 ; return 0; }
3554 EOF
3555 if { (eval echo configure:3556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3556   rm -rf conftest*
3557   echo "$ac_t""yes" 1>&6
3558   HAVE_TIMEVAL=yes
3559   { test "$extra_verbose" = "yes" && cat << \EOF
3560     Defining HAVE_TIMEVAL
3561 EOF
3562 cat >> confdefs.h <<\EOF
3563 #define HAVE_TIMEVAL 1
3564 EOF
3565 }
3566
3567 else
3568   echo "configure: failed program was:" >&5
3569   cat conftest.$ac_ext >&5
3570   rm -rf conftest*
3571   echo "$ac_t""no" 1>&6
3572    HAVE_TIMEVAL=no
3573 fi
3574 rm -f conftest*
3575
3576 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3577 echo "configure:3578: checking whether struct tm is in sys/time.h or time.h" >&5
3578
3579 cat > conftest.$ac_ext <<EOF
3580 #line 3581 "configure"
3581 #include "confdefs.h"
3582 #include <sys/types.h>
3583 #include <time.h>
3584 int main() {
3585 struct tm *tp; tp->tm_sec;
3586 ; return 0; }
3587 EOF
3588 if { (eval echo configure:3589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3589   rm -rf conftest*
3590   ac_cv_struct_tm=time.h
3591 else
3592   echo "configure: failed program was:" >&5
3593   cat conftest.$ac_ext >&5
3594   rm -rf conftest*
3595   ac_cv_struct_tm=sys/time.h
3596 fi
3597 rm -f conftest*
3598
3599 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3600 if test $ac_cv_struct_tm = sys/time.h; then
3601   { test "$extra_verbose" = "yes" && cat << \EOF
3602     Defining TM_IN_SYS_TIME
3603 EOF
3604 cat >> confdefs.h <<\EOF
3605 #define TM_IN_SYS_TIME 1
3606 EOF
3607 }
3608
3609 fi
3610
3611 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3612 echo "configure:3613: checking for tm_zone in struct tm" >&5
3613
3614 cat > conftest.$ac_ext <<EOF
3615 #line 3616 "configure"
3616 #include "confdefs.h"
3617 #include <sys/types.h>
3618 #include <$ac_cv_struct_tm>
3619 int main() {
3620 struct tm tm; tm.tm_zone;
3621 ; return 0; }
3622 EOF
3623 if { (eval echo configure:3624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3624   rm -rf conftest*
3625   ac_cv_struct_tm_zone=yes
3626 else
3627   echo "configure: failed program was:" >&5
3628   cat conftest.$ac_ext >&5
3629   rm -rf conftest*
3630   ac_cv_struct_tm_zone=no
3631 fi
3632 rm -f conftest*
3633
3634 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3635 if test "$ac_cv_struct_tm_zone" = yes; then
3636   { test "$extra_verbose" = "yes" && cat << \EOF
3637     Defining HAVE_TM_ZONE
3638 EOF
3639 cat >> confdefs.h <<\EOF
3640 #define HAVE_TM_ZONE 1
3641 EOF
3642 }
3643
3644 else
3645   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3646 echo "configure:3647: checking for tzname" >&5
3647
3648 cat > conftest.$ac_ext <<EOF
3649 #line 3650 "configure"
3650 #include "confdefs.h"
3651 #include <time.h>
3652 #ifndef tzname /* For SGI.  */
3653 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3654 #endif
3655 int main() {
3656 atoi(*tzname);
3657 ; return 0; }
3658 EOF
3659 if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3660   rm -rf conftest*
3661   ac_cv_var_tzname=yes
3662 else
3663   echo "configure: failed program was:" >&5
3664   cat conftest.$ac_ext >&5
3665   rm -rf conftest*
3666   ac_cv_var_tzname=no
3667 fi
3668 rm -f conftest*
3669
3670 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3671   if test $ac_cv_var_tzname = yes; then
3672     { test "$extra_verbose" = "yes" && cat << \EOF
3673     Defining HAVE_TZNAME
3674 EOF
3675 cat >> confdefs.h <<\EOF
3676 #define HAVE_TZNAME 1
3677 EOF
3678 }
3679
3680   fi
3681 fi
3682
3683
3684 echo $ac_n "checking for working const""... $ac_c" 1>&6
3685 echo "configure:3686: checking for working const" >&5
3686
3687 cat > conftest.$ac_ext <<EOF
3688 #line 3689 "configure"
3689 #include "confdefs.h"
3690
3691 int main() {
3692
3693 /* Ultrix mips cc rejects this.  */
3694 typedef int charset[2]; const charset x;
3695 /* SunOS 4.1.1 cc rejects this.  */
3696 char const *const *ccp;
3697 char **p;
3698 /* NEC SVR4.0.2 mips cc rejects this.  */
3699 struct point {int x, y;};
3700 static struct point const zero = {0,0};
3701 /* AIX XL C 1.02.0.0 rejects this.
3702    It does not let you subtract one const X* pointer from another in an arm
3703    of an if-expression whose if-part is not a constant expression */
3704 const char *g = "string";
3705 ccp = &g + (g ? g-g : 0);
3706 /* HPUX 7.0 cc rejects these. */
3707 ++ccp;
3708 p = (char**) ccp;
3709 ccp = (char const *const *) p;
3710 { /* SCO 3.2v4 cc rejects this.  */
3711   char *t;
3712   char const *s = 0 ? (char *) 0 : (char const *) 0;
3713
3714   *t++ = 0;
3715 }
3716 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3717   int x[] = {25, 17};
3718   const int *foo = &x[0];
3719   ++foo;
3720 }
3721 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3722   typedef const int *iptr;
3723   iptr p = 0;
3724   ++p;
3725 }
3726 { /* AIX XL C 1.02.0.0 rejects this saying
3727      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3728   struct s { int j; const int *ap[3]; };
3729   struct s *b; b->j = 5;
3730 }
3731 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3732   const int foo = 10;
3733 }
3734
3735 ; return 0; }
3736 EOF
3737 if { (eval echo configure:3738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3738   rm -rf conftest*
3739   ac_cv_c_const=yes
3740 else
3741   echo "configure: failed program was:" >&5
3742   cat conftest.$ac_ext >&5
3743   rm -rf conftest*
3744   ac_cv_c_const=no
3745 fi
3746 rm -f conftest*
3747
3748 echo "$ac_t""$ac_cv_c_const" 1>&6
3749 if test $ac_cv_c_const = no; then
3750   { test "$extra_verbose" = "yes" && cat << \EOF
3751     Defining const = 
3752 EOF
3753 cat >> confdefs.h <<\EOF
3754 #define const 
3755 EOF
3756 }
3757
3758 fi
3759
3760
3761 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3762 echo "configure:3763: checking whether ${MAKE-make} sets \${MAKE}" >&5
3763 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3764
3765 cat > conftestmake <<\EOF
3766 all:
3767         @echo 'ac_maketemp="${MAKE}"'
3768 EOF
3769 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3770 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3771 if test -n "$ac_maketemp"; then
3772   eval ac_cv_prog_make_${ac_make}_set=yes
3773 else
3774   eval ac_cv_prog_make_${ac_make}_set=no
3775 fi
3776 rm -f conftestmake
3777 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3778   echo "$ac_t""yes" 1>&6
3779   SET_MAKE=
3780 else
3781   echo "$ac_t""no" 1>&6
3782   SET_MAKE="MAKE=${MAKE-make}"
3783 fi
3784
3785
3786 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3787 echo "configure:3788: checking whether byte ordering is bigendian" >&5
3788
3789 ac_cv_c_bigendian=unknown
3790 # See if sys/param.h defines the BYTE_ORDER macro.
3791 cat > conftest.$ac_ext <<EOF
3792 #line 3793 "configure"
3793 #include "confdefs.h"
3794 #include <sys/types.h>
3795 #include <sys/param.h>
3796 int main() {
3797
3798 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3799  bogus endian macros
3800 #endif
3801 ; return 0; }
3802 EOF
3803 if { (eval echo configure:3804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3804   rm -rf conftest*
3805   # It does; now see whether it defined to BIG_ENDIAN or not.
3806 cat > conftest.$ac_ext <<EOF
3807 #line 3808 "configure"
3808 #include "confdefs.h"
3809 #include <sys/types.h>
3810 #include <sys/param.h>
3811 int main() {
3812
3813 #if BYTE_ORDER != BIG_ENDIAN
3814  not big endian
3815 #endif
3816 ; return 0; }
3817 EOF
3818 if { (eval echo configure:3819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3819   rm -rf conftest*
3820   ac_cv_c_bigendian=yes
3821 else
3822   echo "configure: failed program was:" >&5
3823   cat conftest.$ac_ext >&5
3824   rm -rf conftest*
3825   ac_cv_c_bigendian=no
3826 fi
3827 rm -f conftest*
3828 else
3829   echo "configure: failed program was:" >&5
3830   cat conftest.$ac_ext >&5
3831 fi
3832 rm -f conftest*
3833 if test $ac_cv_c_bigendian = unknown; then
3834 cat > conftest.$ac_ext <<EOF
3835 #line 3836 "configure"
3836 #include "confdefs.h"
3837 main () {
3838   /* Are we little or big endian?  From Harbison&Steele.  */
3839   union
3840   {
3841     long l;
3842     char c[sizeof (long)];
3843   } u;
3844   u.l = 1;
3845   exit (u.c[sizeof (long) - 1] == 1);
3846 }
3847 EOF
3848 if { (eval echo configure:3849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3849 then
3850   ac_cv_c_bigendian=no
3851 else
3852   conftest_rc="$?"
3853   echo "configure: failed program was:" >&5
3854   cat conftest.$ac_ext >&5
3855   rm -fr conftest*
3856   ac_cv_c_bigendian=yes
3857 fi
3858 rm -fr conftest*
3859 fi
3860
3861 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3862 if test $ac_cv_c_bigendian = yes; then
3863   { test "$extra_verbose" = "yes" && cat << \EOF
3864     Defining WORDS_BIGENDIAN
3865 EOF
3866 cat >> confdefs.h <<\EOF
3867 #define WORDS_BIGENDIAN 1
3868 EOF
3869 }
3870
3871 fi
3872
3873
3874 echo $ac_n "checking size of short""... $ac_c" 1>&6
3875 echo "configure:3876: checking size of short" >&5
3876
3877 cat > conftest.$ac_ext <<EOF
3878 #line 3879 "configure"
3879 #include "confdefs.h"
3880 #include <stdio.h>
3881 main()
3882 {
3883   FILE *f=fopen("conftestval", "w");
3884   if (!f) exit(1);
3885   fprintf(f, "%d\n", sizeof(short));
3886   exit(0);
3887 }
3888 EOF
3889 if { (eval echo configure:3890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3890 then
3891   ac_cv_sizeof_short=`cat conftestval`
3892 else
3893   conftest_rc="$?"
3894   echo "configure: failed program was:" >&5
3895   cat conftest.$ac_ext >&5
3896   rm -fr conftest*
3897   ac_cv_sizeof_short=0
3898 fi
3899 rm -fr conftest*
3900 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
3901 { test "$extra_verbose" = "yes" && cat << EOF
3902     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
3903 EOF
3904 cat >> confdefs.h <<EOF
3905 #define SIZEOF_SHORT $ac_cv_sizeof_short
3906 EOF
3907 }
3908
3909
3910 if test "$ac_cv_sizeof_short" = 0; then
3911   echo ""
3912   echo "*** PANIC *** Configure tests are not working - compiler is broken."
3913   echo "*** PANIC *** Please examine config.log for compilation errors."
3914   exit 1
3915 fi
3916 echo $ac_n "checking size of int""... $ac_c" 1>&6
3917 echo "configure:3918: checking size of int" >&5
3918
3919 cat > conftest.$ac_ext <<EOF
3920 #line 3921 "configure"
3921 #include "confdefs.h"
3922 #include <stdio.h>
3923 main()
3924 {
3925   FILE *f=fopen("conftestval", "w");
3926   if (!f) exit(1);
3927   fprintf(f, "%d\n", sizeof(int));
3928   exit(0);
3929 }
3930 EOF
3931 if { (eval echo configure:3932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3932 then
3933   ac_cv_sizeof_int=`cat conftestval`
3934 else
3935   conftest_rc="$?"
3936   echo "configure: failed program was:" >&5
3937   cat conftest.$ac_ext >&5
3938   rm -fr conftest*
3939   ac_cv_sizeof_int=0
3940 fi
3941 rm -fr conftest*
3942 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
3943 { test "$extra_verbose" = "yes" && cat << EOF
3944     Defining SIZEOF_INT = $ac_cv_sizeof_int
3945 EOF
3946 cat >> confdefs.h <<EOF
3947 #define SIZEOF_INT $ac_cv_sizeof_int
3948 EOF
3949 }
3950
3951
3952 echo $ac_n "checking size of long""... $ac_c" 1>&6
3953 echo "configure:3954: checking size of long" >&5
3954
3955 cat > conftest.$ac_ext <<EOF
3956 #line 3957 "configure"
3957 #include "confdefs.h"
3958 #include <stdio.h>
3959 main()
3960 {
3961   FILE *f=fopen("conftestval", "w");
3962   if (!f) exit(1);
3963   fprintf(f, "%d\n", sizeof(long));
3964   exit(0);
3965 }
3966 EOF
3967 if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3968 then
3969   ac_cv_sizeof_long=`cat conftestval`
3970 else
3971   conftest_rc="$?"
3972   echo "configure: failed program was:" >&5
3973   cat conftest.$ac_ext >&5
3974   rm -fr conftest*
3975   ac_cv_sizeof_long=0
3976 fi
3977 rm -fr conftest*
3978 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
3979 { test "$extra_verbose" = "yes" && cat << EOF
3980     Defining SIZEOF_LONG = $ac_cv_sizeof_long
3981 EOF
3982 cat >> confdefs.h <<EOF
3983 #define SIZEOF_LONG $ac_cv_sizeof_long
3984 EOF
3985 }
3986
3987
3988 echo $ac_n "checking size of long long""... $ac_c" 1>&6
3989 echo "configure:3990: checking size of long long" >&5
3990
3991 cat > conftest.$ac_ext <<EOF
3992 #line 3993 "configure"
3993 #include "confdefs.h"
3994 #include <stdio.h>
3995 main()
3996 {
3997   FILE *f=fopen("conftestval", "w");
3998   if (!f) exit(1);
3999   fprintf(f, "%d\n", sizeof(long long));
4000   exit(0);
4001 }
4002 EOF
4003 if { (eval echo configure:4004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4004 then
4005   ac_cv_sizeof_long_long=`cat conftestval`
4006 else
4007   conftest_rc="$?"
4008   echo "configure: failed program was:" >&5
4009   cat conftest.$ac_ext >&5
4010   rm -fr conftest*
4011   ac_cv_sizeof_long_long=0
4012 fi
4013 rm -fr conftest*
4014 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4015 { test "$extra_verbose" = "yes" && cat << EOF
4016     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4017 EOF
4018 cat >> confdefs.h <<EOF
4019 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4020 EOF
4021 }
4022
4023
4024 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4025 echo "configure:4026: checking size of void *" >&5
4026
4027 cat > conftest.$ac_ext <<EOF
4028 #line 4029 "configure"
4029 #include "confdefs.h"
4030 #include <stdio.h>
4031 main()
4032 {
4033   FILE *f=fopen("conftestval", "w");
4034   if (!f) exit(1);
4035   fprintf(f, "%d\n", sizeof(void *));
4036   exit(0);
4037 }
4038 EOF
4039 if { (eval echo configure:4040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4040 then
4041   ac_cv_sizeof_void_p=`cat conftestval`
4042 else
4043   conftest_rc="$?"
4044   echo "configure: failed program was:" >&5
4045   cat conftest.$ac_ext >&5
4046   rm -fr conftest*
4047   ac_cv_sizeof_void_p=0
4048 fi
4049 rm -fr conftest*
4050 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4051 { test "$extra_verbose" = "yes" && cat << EOF
4052     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4053 EOF
4054 cat >> confdefs.h <<EOF
4055 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4056 EOF
4057 }
4058
4059
4060
4061 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4062 echo "configure:4063: checking for long file names" >&5
4063
4064 ac_cv_sys_long_file_names=yes
4065 # Test for long file names in all the places we know might matter:
4066 #      .                the current directory, where building will happen
4067 #      $prefix/lib      where we will be installing things
4068 #      $exec_prefix/lib likewise
4069 # eval it to expand exec_prefix.
4070 #      $TMPDIR          if set, where it might want to write temporary files
4071 # if $TMPDIR is not set:
4072 #      /tmp             where it might want to write temporary files
4073 #      /var/tmp         likewise
4074 #      /usr/tmp         likewise
4075 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4076   ac_tmpdirs="$TMPDIR"
4077 else
4078   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4079 fi
4080 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4081   test -d $ac_dir || continue
4082   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4083   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4084   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4085   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4086   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4087     ac_cv_sys_long_file_names=no
4088     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4089     break
4090   fi
4091   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4092 done
4093
4094 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4095 if test $ac_cv_sys_long_file_names = yes; then
4096   { test "$extra_verbose" = "yes" && cat << \EOF
4097     Defining HAVE_LONG_FILE_NAMES
4098 EOF
4099 cat >> confdefs.h <<\EOF
4100 #define HAVE_LONG_FILE_NAMES 1
4101 EOF
4102 }
4103
4104 fi
4105
4106
4107
4108 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4109 echo "configure:4110: checking for sin in -lm" >&5
4110 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4111
4112 xe_check_libs=" -lm "
4113 cat > conftest.$ac_ext <<EOF
4114 #line 4115 "configure"
4115 #include "confdefs.h"
4116 /* Override any gcc2 internal prototype to avoid an error.  */
4117 /* We use char because int might match the return type of a gcc2
4118     builtin and then its argument prototype would still apply.  */
4119 char sin();
4120
4121 int main() {
4122 sin()
4123 ; return 0; }
4124 EOF
4125 if { (eval echo configure:4126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4126   rm -rf conftest*
4127   eval "ac_cv_lib_$ac_lib_var=yes"
4128 else
4129   echo "configure: failed program was:" >&5
4130   cat conftest.$ac_ext >&5
4131   rm -rf conftest*
4132   eval "ac_cv_lib_$ac_lib_var=no"
4133 fi
4134 rm -f conftest*
4135 xe_check_libs=""
4136
4137 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4138   echo "$ac_t""yes" 1>&6
4139     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4140     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4141   { test "$extra_verbose" = "yes" && cat << EOF
4142     Defining $ac_tr_lib
4143 EOF
4144 cat >> confdefs.h <<EOF
4145 #define $ac_tr_lib 1
4146 EOF
4147 }
4148
4149   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4150
4151 else
4152   echo "$ac_t""no" 1>&6
4153 fi
4154
4155
4156
4157 { test "$extra_verbose" = "yes" && cat << \EOF
4158     Defining LISP_FLOAT_TYPE
4159 EOF
4160 cat >> confdefs.h <<\EOF
4161 #define LISP_FLOAT_TYPE 1
4162 EOF
4163 }
4164
4165
4166 cat > conftest.$ac_ext <<EOF
4167 #line 4168 "configure"
4168 #include "confdefs.h"
4169 #include <math.h>
4170 int main() {
4171 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4172 ; return 0; }
4173 EOF
4174 if { (eval echo configure:4175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4175   rm -rf conftest*
4176   { test "$extra_verbose" = "yes" && cat << \EOF
4177     Defining HAVE_INVERSE_HYPERBOLIC
4178 EOF
4179 cat >> confdefs.h <<\EOF
4180 #define HAVE_INVERSE_HYPERBOLIC 1
4181 EOF
4182 }
4183
4184 else
4185   echo "configure: failed program was:" >&5
4186   cat conftest.$ac_ext >&5
4187 fi
4188 rm -f conftest*
4189
4190 echo "checking type of mail spool file locking" 1>&6
4191 echo "configure:4192: checking type of mail spool file locking" >&5
4192 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4193 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4194 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4195     Defining REAL_MAIL_USE_LOCKF
4196 EOF
4197 cat >> confdefs.h <<\EOF
4198 #define REAL_MAIL_USE_LOCKF 1
4199 EOF
4200 }
4201
4202 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4203     Defining REAL_MAIL_USE_FLOCK
4204 EOF
4205 cat >> confdefs.h <<\EOF
4206 #define REAL_MAIL_USE_FLOCK 1
4207 EOF
4208 }
4209
4210 else mail_locking="dot-locking"
4211 fi
4212
4213
4214 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
4215 echo "configure:4216: checking for kstat_open in -lkstat" >&5
4216 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
4217
4218 xe_check_libs=" -lkstat "
4219 cat > conftest.$ac_ext <<EOF
4220 #line 4221 "configure"
4221 #include "confdefs.h"
4222 /* Override any gcc2 internal prototype to avoid an error.  */
4223 /* We use char because int might match the return type of a gcc2
4224     builtin and then its argument prototype would still apply.  */
4225 char kstat_open();
4226
4227 int main() {
4228 kstat_open()
4229 ; return 0; }
4230 EOF
4231 if { (eval echo configure:4232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4232   rm -rf conftest*
4233   eval "ac_cv_lib_$ac_lib_var=yes"
4234 else
4235   echo "configure: failed program was:" >&5
4236   cat conftest.$ac_ext >&5
4237   rm -rf conftest*
4238   eval "ac_cv_lib_$ac_lib_var=no"
4239 fi
4240 rm -f conftest*
4241 xe_check_libs=""
4242
4243 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4244   echo "$ac_t""yes" 1>&6
4245     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4246     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4247   { test "$extra_verbose" = "yes" && cat << EOF
4248     Defining $ac_tr_lib
4249 EOF
4250 cat >> confdefs.h <<EOF
4251 #define $ac_tr_lib 1
4252 EOF
4253 }
4254
4255   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
4256
4257 else
4258   echo "$ac_t""no" 1>&6
4259 fi
4260
4261
4262
4263
4264 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
4265 echo "configure:4266: checking for kvm_read in -lkvm" >&5
4266 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
4267
4268 xe_check_libs=" -lkvm "
4269 cat > conftest.$ac_ext <<EOF
4270 #line 4271 "configure"
4271 #include "confdefs.h"
4272 /* Override any gcc2 internal prototype to avoid an error.  */
4273 /* We use char because int might match the return type of a gcc2
4274     builtin and then its argument prototype would still apply.  */
4275 char kvm_read();
4276
4277 int main() {
4278 kvm_read()
4279 ; return 0; }
4280 EOF
4281 if { (eval echo configure:4282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4282   rm -rf conftest*
4283   eval "ac_cv_lib_$ac_lib_var=yes"
4284 else
4285   echo "configure: failed program was:" >&5
4286   cat conftest.$ac_ext >&5
4287   rm -rf conftest*
4288   eval "ac_cv_lib_$ac_lib_var=no"
4289 fi
4290 rm -f conftest*
4291 xe_check_libs=""
4292
4293 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4294   echo "$ac_t""yes" 1>&6
4295     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4296     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4297   { test "$extra_verbose" = "yes" && cat << EOF
4298     Defining $ac_tr_lib
4299 EOF
4300 cat >> confdefs.h <<EOF
4301 #define $ac_tr_lib 1
4302 EOF
4303 }
4304
4305   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
4306
4307 else
4308   echo "$ac_t""no" 1>&6
4309 fi
4310
4311
4312
4313 case "$opsys" in decosf*)
4314   
4315 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4316 echo "configure:4317: checking for cma_open in -lpthreads" >&5
4317 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4318
4319 xe_check_libs=" -lpthreads "
4320 cat > conftest.$ac_ext <<EOF
4321 #line 4322 "configure"
4322 #include "confdefs.h"
4323 /* Override any gcc2 internal prototype to avoid an error.  */
4324 /* We use char because int might match the return type of a gcc2
4325     builtin and then its argument prototype would still apply.  */
4326 char cma_open();
4327
4328 int main() {
4329 cma_open()
4330 ; return 0; }
4331 EOF
4332 if { (eval echo configure:4333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4333   rm -rf conftest*
4334   eval "ac_cv_lib_$ac_lib_var=yes"
4335 else
4336   echo "configure: failed program was:" >&5
4337   cat conftest.$ac_ext >&5
4338   rm -rf conftest*
4339   eval "ac_cv_lib_$ac_lib_var=no"
4340 fi
4341 rm -f conftest*
4342 xe_check_libs=""
4343
4344 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4345   echo "$ac_t""yes" 1>&6
4346     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4347     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4348   { test "$extra_verbose" = "yes" && cat << EOF
4349     Defining $ac_tr_lib
4350 EOF
4351 cat >> confdefs.h <<EOF
4352 #define $ac_tr_lib 1
4353 EOF
4354 }
4355
4356   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4357
4358 else
4359   echo "$ac_t""no" 1>&6
4360 fi
4361
4362
4363   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4364     c_switch_site="$c_switch_site -threads" ;;
4365 esac
4366
4367 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4368 echo "configure:4369: checking whether the -xildoff compiler flag is required" >&5
4369 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4370   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4371     then echo "$ac_t""no" 1>&6;
4372     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
4373   fi
4374   else echo "$ac_t""no" 1>&6
4375 fi
4376
4377 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4378   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4379 echo "configure:4380: checking for \"-z ignore\" linker flag" >&5
4380   case "`ld -h 2>&1`" in
4381     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4382       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4383     *) echo "$ac_t""no" 1>&6 ;;
4384   esac
4385 fi
4386
4387
4388 echo "checking "for specified window system"" 1>&6
4389 echo "configure:4390: checking "for specified window system"" >&5
4390
4391 if test "$with_x11" != "no"; then
4392     test "$x_includes $x_libraries" != "NONE NONE" && \
4393    window_system=x11 with_x11=yes
4394
4395         
4396       if test "$x_includes $x_libraries" = "NONE NONE" \
4397     -a -n "$OPENWINHOME" \
4398     -a "$OPENWINHOME" != "/usr/openwin" \
4399     -a -d "$OPENWINHOME"; then
4400       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4401       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4402       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4403   fi
4404
4405   if test "$x_includes" = "NONE"; then
4406                     for dir in "/usr/X11" "/usr/X11R6"; do
4407       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4408     done
4409   fi
4410
4411   if test "$x_libraries" = "NONE"; then
4412     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4413       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4414     done
4415   fi
4416
4417   # If we find X, set shell vars x_includes and x_libraries to the
4418 # paths, otherwise set no_x=yes.
4419 # Uses ac_ vars as temps to allow command line to override cache and checks.
4420 # --without-x overrides everything else, but does not touch the cache.
4421 echo $ac_n "checking for X""... $ac_c" 1>&6
4422 echo "configure:4423: checking for X" >&5
4423
4424 # Check whether --with-x or --without-x was given.
4425 if test "${with_x+set}" = set; then
4426   withval="$with_x"
4427   :
4428 fi
4429
4430 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4431 if test "x$with_x" = xno; then
4432   # The user explicitly disabled X.
4433   have_x=disabled
4434 else
4435   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4436     # Both variables are already set.
4437     have_x=yes
4438   else
4439
4440 # One or both of the vars are not set, and there is no cached value.
4441 ac_x_includes=NO ac_x_libraries=NO
4442 rm -fr conftestdir
4443 if mkdir conftestdir; then
4444   cd conftestdir
4445   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4446   cat > Imakefile <<'EOF'
4447 acfindx:
4448         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4449 EOF
4450   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4451     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4452     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4453     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4454     for ac_extension in a so sl; do
4455       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4456         test -f $ac_im_libdir/libX11.$ac_extension; then
4457         ac_im_usrlibdir=$ac_im_libdir; break
4458       fi
4459     done
4460     # Screen out bogus values from the imake configuration.  They are
4461     # bogus both because they are the default anyway, and because
4462     # using them would break gcc on systems where it needs fixed includes.
4463     case "$ac_im_incroot" in
4464         /usr/include) ;;
4465         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4466     esac
4467     case "$ac_im_usrlibdir" in
4468         /usr/lib | /lib) ;;
4469         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4470     esac
4471   fi
4472   cd ..
4473   rm -fr conftestdir
4474 fi
4475
4476 if test "$ac_x_includes" = NO; then
4477   # Guess where to find include files, by looking for this one X11 .h file.
4478   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4479
4480   # First, try using that file with no special directory specified.
4481 cat > conftest.$ac_ext <<EOF
4482 #line 4483 "configure"
4483 #include "confdefs.h"
4484 #include <$x_direct_test_include>
4485 EOF
4486 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4487 { (eval echo configure:4488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4488 ac_err=`grep -v '^ *+' conftest.out`
4489 if test -z "$ac_err"; then
4490   rm -rf conftest*
4491   # We can compile using X headers with no special include directory.
4492 ac_x_includes=
4493 else
4494   echo "$ac_err" >&5
4495   echo "configure: failed program was:" >&5
4496   cat conftest.$ac_ext >&5
4497   rm -rf conftest*
4498   # Look for the header file in a standard set of common directories.
4499 # Check X11 before X11Rn because it is often a symlink to the current release.
4500   for ac_dir in               \
4501     /usr/X11/include          \
4502     /usr/X11R6/include        \
4503     /usr/X11R5/include        \
4504     /usr/X11R4/include        \
4505                               \
4506     /usr/include/X11          \
4507     /usr/include/X11R6        \
4508     /usr/include/X11R5        \
4509     /usr/include/X11R4        \
4510                               \
4511     /usr/local/X11/include    \
4512     /usr/local/X11R6/include  \
4513     /usr/local/X11R5/include  \
4514     /usr/local/X11R4/include  \
4515                               \
4516     /usr/local/include/X11    \
4517     /usr/local/include/X11R6  \
4518     /usr/local/include/X11R5  \
4519     /usr/local/include/X11R4  \
4520                               \
4521     /usr/X386/include         \
4522     /usr/x386/include         \
4523     /usr/XFree86/include/X11  \
4524                               \
4525     /usr/include              \
4526     /usr/local/include        \
4527     /usr/unsupported/include  \
4528     /usr/athena/include       \
4529     /usr/local/x11r5/include  \
4530     /usr/lpp/Xamples/include  \
4531                               \
4532     /usr/openwin/include      \
4533     /usr/openwin/share/include \
4534     ; \
4535   do
4536     if test -r "$ac_dir/$x_direct_test_include"; then
4537       ac_x_includes=$ac_dir
4538       break
4539     fi
4540   done
4541 fi
4542 rm -f conftest*
4543 fi # $ac_x_includes = NO
4544
4545 if test "$ac_x_libraries" = NO; then
4546   # Check for the libraries.
4547
4548   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4549   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4550
4551   # See if we find them without any special options.
4552   # Don't add to $LIBS permanently.
4553   ac_save_LIBS="$LIBS"
4554   LIBS="-l$x_direct_test_library $LIBS"
4555 cat > conftest.$ac_ext <<EOF
4556 #line 4557 "configure"
4557 #include "confdefs.h"
4558
4559 int main() {
4560 ${x_direct_test_function}()
4561 ; return 0; }
4562 EOF
4563 if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4564   rm -rf conftest*
4565   LIBS="$ac_save_LIBS"
4566 # We can link X programs with no special library path.
4567 ac_x_libraries=
4568 else
4569   echo "configure: failed program was:" >&5
4570   cat conftest.$ac_ext >&5
4571   rm -rf conftest*
4572   LIBS="$ac_save_LIBS"
4573 # First see if replacing the include by lib works.
4574 # Check X11 before X11Rn because it is often a symlink to the current release.
4575 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4576     /usr/X11/lib          \
4577     /usr/X11R6/lib        \
4578     /usr/X11R5/lib        \
4579     /usr/X11R4/lib        \
4580                           \
4581     /usr/lib/X11          \
4582     /usr/lib/X11R6        \
4583     /usr/lib/X11R5        \
4584     /usr/lib/X11R4        \
4585                           \
4586     /usr/local/X11/lib    \
4587     /usr/local/X11R6/lib  \
4588     /usr/local/X11R5/lib  \
4589     /usr/local/X11R4/lib  \
4590                           \
4591     /usr/local/lib/X11    \
4592     /usr/local/lib/X11R6  \
4593     /usr/local/lib/X11R5  \
4594     /usr/local/lib/X11R4  \
4595                           \
4596     /usr/X386/lib         \
4597     /usr/x386/lib         \
4598     /usr/XFree86/lib/X11  \
4599                           \
4600     /usr/lib              \
4601     /usr/local/lib        \
4602     /usr/unsupported/lib  \
4603     /usr/athena/lib       \
4604     /usr/local/x11r5/lib  \
4605     /usr/lpp/Xamples/lib  \
4606     /lib/usr/lib/X11      \
4607                           \
4608     /usr/openwin/lib      \
4609     /usr/openwin/share/lib \
4610     ; \
4611 do
4612   for ac_extension in a so sl; do
4613     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4614       ac_x_libraries=$ac_dir
4615       break 2
4616     fi
4617   done
4618 done
4619 fi
4620 rm -f conftest*
4621 fi # $ac_x_libraries = NO
4622
4623 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4624   # Didn't find X anywhere.  Cache the known absence of X.
4625   ac_cv_have_x="have_x=no"
4626 else
4627   # Record where we found X for the cache.
4628   ac_cv_have_x="have_x=yes \
4629                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4630 fi
4631   fi
4632   eval "$ac_cv_have_x"
4633 fi # $with_x != no
4634
4635 if test "$have_x" != yes; then
4636   echo "$ac_t""$have_x" 1>&6
4637   no_x=yes
4638 else
4639   # If each of the values was on the command line, it overrides each guess.
4640   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4641   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4642   # Update the cache value to reflect the command line values.
4643   ac_cv_have_x="have_x=yes \
4644                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4645   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4646 fi
4647
4648 if test "$no_x" = yes; then
4649   # Not all programs may use this symbol, but it does not hurt to define it.
4650   { test "$extra_verbose" = "yes" && cat << \EOF
4651     Defining X_DISPLAY_MISSING
4652 EOF
4653 cat >> confdefs.h <<\EOF
4654 #define X_DISPLAY_MISSING 1
4655 EOF
4656 }
4657
4658   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4659 else
4660   if test -n "$x_includes"; then
4661     X_CFLAGS="$X_CFLAGS -I$x_includes"
4662   fi
4663
4664   # It would also be nice to do this for all -L options, not just this one.
4665   if test -n "$x_libraries"; then
4666     X_LIBS="$X_LIBS -L$x_libraries"
4667     # For Solaris; some versions of Sun CC require a space after -R and
4668     # others require no space.  Words are not sufficient . . . .
4669     case "`(uname -sr) 2>/dev/null`" in
4670     "SunOS 5"*)
4671       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4672 echo "configure:4673: checking whether -R must be followed by a space" >&5
4673       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4674       cat > conftest.$ac_ext <<EOF
4675 #line 4676 "configure"
4676 #include "confdefs.h"
4677
4678 int main() {
4679
4680 ; return 0; }
4681 EOF
4682 if { (eval echo configure:4683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4683   rm -rf conftest*
4684   ac_R_nospace=yes
4685 else
4686   echo "configure: failed program was:" >&5
4687   cat conftest.$ac_ext >&5
4688   rm -rf conftest*
4689   ac_R_nospace=no
4690 fi
4691 rm -f conftest*
4692       if test $ac_R_nospace = yes; then
4693         echo "$ac_t""no" 1>&6
4694         X_LIBS="$X_LIBS -R$x_libraries"
4695       else
4696         LIBS="$ac_xsave_LIBS -R $x_libraries"
4697         cat > conftest.$ac_ext <<EOF
4698 #line 4699 "configure"
4699 #include "confdefs.h"
4700
4701 int main() {
4702
4703 ; return 0; }
4704 EOF
4705 if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4706   rm -rf conftest*
4707   ac_R_space=yes
4708 else
4709   echo "configure: failed program was:" >&5
4710   cat conftest.$ac_ext >&5
4711   rm -rf conftest*
4712   ac_R_space=no
4713 fi
4714 rm -f conftest*
4715         if test $ac_R_space = yes; then
4716           echo "$ac_t""yes" 1>&6
4717           X_LIBS="$X_LIBS -R $x_libraries"
4718         else
4719           echo "$ac_t""neither works" 1>&6
4720         fi
4721       fi
4722       LIBS="$ac_xsave_LIBS"
4723     esac
4724   fi
4725
4726   # Check for system-dependent libraries X programs must link with.
4727   # Do this before checking for the system-independent R6 libraries
4728   # (-lICE), since we may need -lsocket or whatever for X linking.
4729
4730   if test "$ISC" = yes; then
4731     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4732   else
4733     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4734     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4735     # the Alpha needs dnet_stub (dnet does not exist).
4736     if test "$with_dnet" = "no" ; then
4737 ac_cv_lib_dnet_dnet_ntoa=no
4738 else
4739
4740 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4741 echo "configure:4742: checking for dnet_ntoa in -ldnet" >&5
4742 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4743
4744 xe_check_libs=" -ldnet "
4745 cat > conftest.$ac_ext <<EOF
4746 #line 4747 "configure"
4747 #include "confdefs.h"
4748 /* Override any gcc2 internal prototype to avoid an error.  */
4749 /* We use char because int might match the return type of a gcc2
4750     builtin and then its argument prototype would still apply.  */
4751 char dnet_ntoa();
4752
4753 int main() {
4754 dnet_ntoa()
4755 ; return 0; }
4756 EOF
4757 if { (eval echo configure:4758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4758   rm -rf conftest*
4759   eval "ac_cv_lib_$ac_lib_var=yes"
4760 else
4761   echo "configure: failed program was:" >&5
4762   cat conftest.$ac_ext >&5
4763   rm -rf conftest*
4764   eval "ac_cv_lib_$ac_lib_var=no"
4765 fi
4766 rm -f conftest*
4767 xe_check_libs=""
4768
4769 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4770   echo "$ac_t""yes" 1>&6
4771   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4772 else
4773   echo "$ac_t""no" 1>&6
4774 fi
4775
4776 fi
4777
4778     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4779       
4780 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4781 echo "configure:4782: checking for dnet_ntoa in -ldnet_stub" >&5
4782 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4783
4784 xe_check_libs=" -ldnet_stub "
4785 cat > conftest.$ac_ext <<EOF
4786 #line 4787 "configure"
4787 #include "confdefs.h"
4788 /* Override any gcc2 internal prototype to avoid an error.  */
4789 /* We use char because int might match the return type of a gcc2
4790     builtin and then its argument prototype would still apply.  */
4791 char dnet_ntoa();
4792
4793 int main() {
4794 dnet_ntoa()
4795 ; return 0; }
4796 EOF
4797 if { (eval echo configure:4798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4798   rm -rf conftest*
4799   eval "ac_cv_lib_$ac_lib_var=yes"
4800 else
4801   echo "configure: failed program was:" >&5
4802   cat conftest.$ac_ext >&5
4803   rm -rf conftest*
4804   eval "ac_cv_lib_$ac_lib_var=no"
4805 fi
4806 rm -f conftest*
4807 xe_check_libs=""
4808
4809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4810   echo "$ac_t""yes" 1>&6
4811   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4812 else
4813   echo "$ac_t""no" 1>&6
4814 fi
4815
4816
4817     fi
4818
4819     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4820     # to get the SysV transport functions.
4821     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4822     # needs -lnsl.
4823     # The nsl library prevents programs from opening the X display
4824     # on Irix 5.2, according to dickey@clark.net.
4825     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4826 echo "configure:4827: checking for gethostbyname" >&5
4827
4828 cat > conftest.$ac_ext <<EOF
4829 #line 4830 "configure"
4830 #include "confdefs.h"
4831 /* System header to define __stub macros and hopefully few prototypes,
4832     which can conflict with char gethostbyname(); below.  */
4833 #include <assert.h>
4834 /* Override any gcc2 internal prototype to avoid an error.  */
4835 /* We use char because int might match the return type of a gcc2
4836     builtin and then its argument prototype would still apply.  */
4837 char gethostbyname();
4838
4839 int main() {
4840
4841 /* The GNU C library defines this for functions which it implements
4842     to always fail with ENOSYS.  Some functions are actually named
4843     something starting with __ and the normal name is an alias.  */
4844 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4845 choke me
4846 #else
4847 gethostbyname();
4848 #endif
4849
4850 ; return 0; }
4851 EOF
4852 if { (eval echo configure:4853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4853   rm -rf conftest*
4854   eval "ac_cv_func_gethostbyname=yes"
4855 else
4856   echo "configure: failed program was:" >&5
4857   cat conftest.$ac_ext >&5
4858   rm -rf conftest*
4859   eval "ac_cv_func_gethostbyname=no"
4860 fi
4861 rm -f conftest*
4862
4863 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4864   echo "$ac_t""yes" 1>&6
4865   :
4866 else
4867   echo "$ac_t""no" 1>&6
4868 fi
4869
4870     if test $ac_cv_func_gethostbyname = no; then
4871       
4872 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4873 echo "configure:4874: checking for gethostbyname in -lnsl" >&5
4874 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4875
4876 xe_check_libs=" -lnsl "
4877 cat > conftest.$ac_ext <<EOF
4878 #line 4879 "configure"
4879 #include "confdefs.h"
4880 /* Override any gcc2 internal prototype to avoid an error.  */
4881 /* We use char because int might match the return type of a gcc2
4882     builtin and then its argument prototype would still apply.  */
4883 char gethostbyname();
4884
4885 int main() {
4886 gethostbyname()
4887 ; return 0; }
4888 EOF
4889 if { (eval echo configure:4890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4890   rm -rf conftest*
4891   eval "ac_cv_lib_$ac_lib_var=yes"
4892 else
4893   echo "configure: failed program was:" >&5
4894   cat conftest.$ac_ext >&5
4895   rm -rf conftest*
4896   eval "ac_cv_lib_$ac_lib_var=no"
4897 fi
4898 rm -f conftest*
4899 xe_check_libs=""
4900
4901 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4902   echo "$ac_t""yes" 1>&6
4903   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4904 else
4905   echo "$ac_t""no" 1>&6
4906 fi
4907
4908
4909     fi
4910
4911     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4912     # socket/setsockopt and other routines are undefined under SCO ODT
4913     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4914     # on later versions), says simon@lia.di.epfl.ch: it contains
4915     # gethostby* variants that don't use the nameserver (or something).
4916     # -lsocket must be given before -lnsl if both are needed.
4917     # We assume that if connect needs -lnsl, so does gethostbyname.
4918     echo $ac_n "checking for connect""... $ac_c" 1>&6
4919 echo "configure:4920: checking for connect" >&5
4920
4921 cat > conftest.$ac_ext <<EOF
4922 #line 4923 "configure"
4923 #include "confdefs.h"
4924 /* System header to define __stub macros and hopefully few prototypes,
4925     which can conflict with char connect(); below.  */
4926 #include <assert.h>
4927 /* Override any gcc2 internal prototype to avoid an error.  */
4928 /* We use char because int might match the return type of a gcc2
4929     builtin and then its argument prototype would still apply.  */
4930 char connect();
4931
4932 int main() {
4933
4934 /* The GNU C library defines this for functions which it implements
4935     to always fail with ENOSYS.  Some functions are actually named
4936     something starting with __ and the normal name is an alias.  */
4937 #if defined (__stub_connect) || defined (__stub___connect)
4938 choke me
4939 #else
4940 connect();
4941 #endif
4942
4943 ; return 0; }
4944 EOF
4945 if { (eval echo configure:4946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4946   rm -rf conftest*
4947   eval "ac_cv_func_connect=yes"
4948 else
4949   echo "configure: failed program was:" >&5
4950   cat conftest.$ac_ext >&5
4951   rm -rf conftest*
4952   eval "ac_cv_func_connect=no"
4953 fi
4954 rm -f conftest*
4955
4956 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4957   echo "$ac_t""yes" 1>&6
4958   :
4959 else
4960   echo "$ac_t""no" 1>&6
4961 fi
4962
4963     if test $ac_cv_func_connect = no; then
4964       
4965 xe_msg_checking="for connect in -lsocket"
4966 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
4967 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
4968 echo "configure:4969: checking "$xe_msg_checking"" >&5
4969 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
4970
4971 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
4972 cat > conftest.$ac_ext <<EOF
4973 #line 4974 "configure"
4974 #include "confdefs.h"
4975 /* Override any gcc2 internal prototype to avoid an error.  */
4976 /* We use char because int might match the return type of a gcc2
4977     builtin and then its argument prototype would still apply.  */
4978 char connect();
4979
4980 int main() {
4981 connect()
4982 ; return 0; }
4983 EOF
4984 if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4985   rm -rf conftest*
4986   eval "ac_cv_lib_$ac_lib_var=yes"
4987 else
4988   echo "configure: failed program was:" >&5
4989   cat conftest.$ac_ext >&5
4990   rm -rf conftest*
4991   eval "ac_cv_lib_$ac_lib_var=no"
4992 fi
4993 rm -f conftest*
4994 xe_check_libs=""
4995
4996 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4997   echo "$ac_t""yes" 1>&6
4998   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
4999 else
5000   echo "$ac_t""no" 1>&6
5001 fi
5002
5003
5004     fi
5005
5006     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5007     echo $ac_n "checking for remove""... $ac_c" 1>&6
5008 echo "configure:5009: checking for remove" >&5
5009
5010 cat > conftest.$ac_ext <<EOF
5011 #line 5012 "configure"
5012 #include "confdefs.h"
5013 /* System header to define __stub macros and hopefully few prototypes,
5014     which can conflict with char remove(); below.  */
5015 #include <assert.h>
5016 /* Override any gcc2 internal prototype to avoid an error.  */
5017 /* We use char because int might match the return type of a gcc2
5018     builtin and then its argument prototype would still apply.  */
5019 char remove();
5020
5021 int main() {
5022
5023 /* The GNU C library defines this for functions which it implements
5024     to always fail with ENOSYS.  Some functions are actually named
5025     something starting with __ and the normal name is an alias.  */
5026 #if defined (__stub_remove) || defined (__stub___remove)
5027 choke me
5028 #else
5029 remove();
5030 #endif
5031
5032 ; return 0; }
5033 EOF
5034 if { (eval echo configure:5035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5035   rm -rf conftest*
5036   eval "ac_cv_func_remove=yes"
5037 else
5038   echo "configure: failed program was:" >&5
5039   cat conftest.$ac_ext >&5
5040   rm -rf conftest*
5041   eval "ac_cv_func_remove=no"
5042 fi
5043 rm -f conftest*
5044
5045 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5046   echo "$ac_t""yes" 1>&6
5047   :
5048 else
5049   echo "$ac_t""no" 1>&6
5050 fi
5051
5052     if test $ac_cv_func_remove = no; then
5053       
5054 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5055 echo "configure:5056: checking for remove in -lposix" >&5
5056 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5057
5058 xe_check_libs=" -lposix "
5059 cat > conftest.$ac_ext <<EOF
5060 #line 5061 "configure"
5061 #include "confdefs.h"
5062 /* Override any gcc2 internal prototype to avoid an error.  */
5063 /* We use char because int might match the return type of a gcc2
5064     builtin and then its argument prototype would still apply.  */
5065 char remove();
5066
5067 int main() {
5068 remove()
5069 ; return 0; }
5070 EOF
5071 if { (eval echo configure:5072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5072   rm -rf conftest*
5073   eval "ac_cv_lib_$ac_lib_var=yes"
5074 else
5075   echo "configure: failed program was:" >&5
5076   cat conftest.$ac_ext >&5
5077   rm -rf conftest*
5078   eval "ac_cv_lib_$ac_lib_var=no"
5079 fi
5080 rm -f conftest*
5081 xe_check_libs=""
5082
5083 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5084   echo "$ac_t""yes" 1>&6
5085   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5086 else
5087   echo "$ac_t""no" 1>&6
5088 fi
5089
5090
5091     fi
5092
5093     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5094     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5095 echo "configure:5096: checking for shmat" >&5
5096
5097 cat > conftest.$ac_ext <<EOF
5098 #line 5099 "configure"
5099 #include "confdefs.h"
5100 /* System header to define __stub macros and hopefully few prototypes,
5101     which can conflict with char shmat(); below.  */
5102 #include <assert.h>
5103 /* Override any gcc2 internal prototype to avoid an error.  */
5104 /* We use char because int might match the return type of a gcc2
5105     builtin and then its argument prototype would still apply.  */
5106 char shmat();
5107
5108 int main() {
5109
5110 /* The GNU C library defines this for functions which it implements
5111     to always fail with ENOSYS.  Some functions are actually named
5112     something starting with __ and the normal name is an alias.  */
5113 #if defined (__stub_shmat) || defined (__stub___shmat)
5114 choke me
5115 #else
5116 shmat();
5117 #endif
5118
5119 ; return 0; }
5120 EOF
5121 if { (eval echo configure:5122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5122   rm -rf conftest*
5123   eval "ac_cv_func_shmat=yes"
5124 else
5125   echo "configure: failed program was:" >&5
5126   cat conftest.$ac_ext >&5
5127   rm -rf conftest*
5128   eval "ac_cv_func_shmat=no"
5129 fi
5130 rm -f conftest*
5131
5132 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5133   echo "$ac_t""yes" 1>&6
5134   :
5135 else
5136   echo "$ac_t""no" 1>&6
5137 fi
5138
5139     if test $ac_cv_func_shmat = no; then
5140       
5141 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5142 echo "configure:5143: checking for shmat in -lipc" >&5
5143 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5144
5145 xe_check_libs=" -lipc "
5146 cat > conftest.$ac_ext <<EOF
5147 #line 5148 "configure"
5148 #include "confdefs.h"
5149 /* Override any gcc2 internal prototype to avoid an error.  */
5150 /* We use char because int might match the return type of a gcc2
5151     builtin and then its argument prototype would still apply.  */
5152 char shmat();
5153
5154 int main() {
5155 shmat()
5156 ; return 0; }
5157 EOF
5158 if { (eval echo configure:5159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5159   rm -rf conftest*
5160   eval "ac_cv_lib_$ac_lib_var=yes"
5161 else
5162   echo "configure: failed program was:" >&5
5163   cat conftest.$ac_ext >&5
5164   rm -rf conftest*
5165   eval "ac_cv_lib_$ac_lib_var=no"
5166 fi
5167 rm -f conftest*
5168 xe_check_libs=""
5169
5170 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5171   echo "$ac_t""yes" 1>&6
5172   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5173 else
5174   echo "$ac_t""no" 1>&6
5175 fi
5176
5177
5178     fi
5179   fi
5180
5181   # Check for libraries that X11R6 Xt/Xaw programs need.
5182   ac_save_LDFLAGS="$LDFLAGS"
5183   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5184   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5185   # check for ICE first), but we must link in the order -lSM -lICE or
5186   # we get undefined symbols.  So assume we have SM if we have ICE.
5187   # These have to be linked with before -lX11, unlike the other
5188   # libraries we check for below, so use a different variable.
5189   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5190   
5191 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5192 echo "configure:5193: checking for IceConnectionNumber in -lICE" >&5
5193 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5194
5195 xe_check_libs=" -lICE "
5196 cat > conftest.$ac_ext <<EOF
5197 #line 5198 "configure"
5198 #include "confdefs.h"
5199 /* Override any gcc2 internal prototype to avoid an error.  */
5200 /* We use char because int might match the return type of a gcc2
5201     builtin and then its argument prototype would still apply.  */
5202 char IceConnectionNumber();
5203
5204 int main() {
5205 IceConnectionNumber()
5206 ; return 0; }
5207 EOF
5208 if { (eval echo configure:5209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5209   rm -rf conftest*
5210   eval "ac_cv_lib_$ac_lib_var=yes"
5211 else
5212   echo "configure: failed program was:" >&5
5213   cat conftest.$ac_ext >&5
5214   rm -rf conftest*
5215   eval "ac_cv_lib_$ac_lib_var=no"
5216 fi
5217 rm -f conftest*
5218 xe_check_libs=""
5219
5220 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5221   echo "$ac_t""yes" 1>&6
5222   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5223 else
5224   echo "$ac_t""no" 1>&6
5225 fi
5226
5227
5228   LDFLAGS="$ac_save_LDFLAGS"
5229
5230 fi
5231  # Autoconf claims to find X library and include dirs for us.
5232   if test "$no_x" = "yes"
5233   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5234   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5235   fi
5236 fi
5237
5238 case "$with_x11" in
5239   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5240   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5241 esac
5242
5243 if test "$with_x11" = "yes"; then
5244   { test "$extra_verbose" = "yes" && cat << \EOF
5245     Defining HAVE_X_WINDOWS
5246 EOF
5247 cat >> confdefs.h <<\EOF
5248 #define HAVE_X_WINDOWS 1
5249 EOF
5250 }
5251
5252   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5253   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5254
5255       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5256     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5257     if test -d "$lib_dir" -a -d "$inc_dir"; then
5258       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5259         x_libraries="$lib_dir $x_libraries"
5260         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5261       esac
5262       case "$x_includes" in "$inc_dir"* ) ;; *)
5263         x_includes="$inc_dir $x_includes"
5264         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5265       esac
5266       break;       fi
5267   done
5268
5269     for rel in "X11R6" "X11R5" "X11R4"; do
5270     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5271     if test -d "$lib_dir" -a -d "$inc_dir"; then
5272       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5273         x_libraries="$x_libraries $lib_dir"
5274         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5275       esac
5276       case "$x_includes" in "$inc_dir"* ) ;; *)
5277         x_includes="$x_includes $inc_dir"
5278         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5279       esac
5280       break;     fi
5281   done
5282
5283     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
5284
5285   ld_switch_x_site="$X_LIBS"
5286
5287   
5288 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5289     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5290   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5291   
5292         runpath="" runpath_dirs=""
5293   if test -n "$LD_RUN_PATH"; then
5294     runpath="$LD_RUN_PATH"
5295   elif test "$GCC" = "yes"; then
5296         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5297     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5298     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5299     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5300       case "$arg" in P,* | -L* | -R* )
5301         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5302           {
5303 xe_runpath_dir="$dir"
5304   test "$xe_runpath_dir" != "/lib"     -a \
5305         "$xe_runpath_dir" != "/usr/lib" -a \
5306         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5307   eval "$xe_add_unique_runpath_dir"
5308 }
5309         done ;;
5310       esac
5311     done
5312     ld_switch_run="$ld_switch_run_save"
5313     rm -f conftest*
5314   else
5315         for arg in $ld_switch_site $ld_switch_x_site; do
5316       case "$arg" in -L*) {
5317 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5318   test "$xe_runpath_dir" != "/lib"     -a \
5319         "$xe_runpath_dir" != "/usr/lib" -a \
5320         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5321   eval "$xe_add_unique_runpath_dir"
5322 };; esac
5323     done
5324         if test "$opsys $need_motif" = "sol2 yes"; then
5325       xe_runpath_dir="/opt/SUNWdt/lib";
5326       eval "$xe_add_unique_runpath_dir";
5327     fi
5328   fi 
5329   if test -n "$runpath"; then
5330     ld_switch_run="${dash_r}${runpath}"
5331     
5332 if test "$GCC" = "yes"; then
5333   set x $ld_switch_run; shift; ld_switch_run=""
5334   while test -n "$1"; do
5335     case $1 in
5336       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5337       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5338       -Xlinker* ) ;;
5339       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5340     esac
5341     shift
5342   done
5343 fi
5344     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5345   fi
5346 fi
5347
5348
5349   if test "$extra_verbose" = "yes"; then
5350     echo; echo "X11 compilation variables:"
5351     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5352     echo
5353   fi
5354
5355             bitmapdirs=
5356   if test "$x_includes" != NONE; then
5357     for i in $x_includes; do
5358       if test -d "$i/bitmaps"; then
5359         bitmapdirs="$i/bitmaps:$bitmapdirs"
5360       fi
5361       if test -d "$i/X11/bitmaps"; then
5362         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5363       fi
5364     done
5365     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5366   fi
5367   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5368     Defining BITMAPDIR = "$bitmapdirs"
5369 EOF
5370 cat >> confdefs.h <<EOF
5371 #define BITMAPDIR "$bitmapdirs"
5372 EOF
5373 }
5374
5375
5376     echo "checking for X defines extracted by xmkmf" 1>&6
5377 echo "configure:5378: checking for X defines extracted by xmkmf" >&5
5378   rm -fr conftestdir
5379   if mkdir conftestdir; then
5380     cd conftestdir
5381     cat > Imakefile <<'EOF'
5382 xetest:
5383         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5384 EOF
5385     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5386       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5387       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5388     fi
5389     cd ..
5390     rm -fr conftestdir
5391     for word in $xmkmf_defines; do
5392       case "$word" in
5393         -D*=* ) ;;
5394         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5395               { test "$extra_verbose" = "yes" && cat << EOF
5396     Defining $word
5397 EOF
5398 cat >> confdefs.h <<EOF
5399 #define $word 1
5400 EOF
5401 }
5402  ;;
5403       esac
5404     done
5405   fi
5406
5407     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5408 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5409 echo "configure:5410: checking for X11/Intrinsic.h" >&5
5410
5411 cat > conftest.$ac_ext <<EOF
5412 #line 5413 "configure"
5413 #include "confdefs.h"
5414 #include <X11/Intrinsic.h>
5415 EOF
5416 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5417 { (eval echo configure:5418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5418 ac_err=`grep -v '^ *+' conftest.out`
5419 if test -z "$ac_err"; then
5420   rm -rf conftest*
5421   eval "ac_cv_header_$ac_safe=yes"
5422 else
5423   echo "$ac_err" >&5
5424   echo "configure: failed program was:" >&5
5425   cat conftest.$ac_ext >&5
5426   rm -rf conftest*
5427   eval "ac_cv_header_$ac_safe=no"
5428 fi
5429 rm -f conftest*
5430 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5431   echo "$ac_t""yes" 1>&6
5432   :
5433 else
5434   echo "$ac_t""no" 1>&6
5435 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5436 fi
5437
5438
5439       
5440 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5441 echo "configure:5442: checking for XOpenDisplay in -lX11" >&5
5442 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5443
5444 xe_check_libs=" -lX11 "
5445 cat > conftest.$ac_ext <<EOF
5446 #line 5447 "configure"
5447 #include "confdefs.h"
5448 /* Override any gcc2 internal prototype to avoid an error.  */
5449 /* We use char because int might match the return type of a gcc2
5450     builtin and then its argument prototype would still apply.  */
5451 char XOpenDisplay();
5452
5453 int main() {
5454 XOpenDisplay()
5455 ; return 0; }
5456 EOF
5457 if { (eval echo configure:5458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5458   rm -rf conftest*
5459   eval "ac_cv_lib_$ac_lib_var=yes"
5460 else
5461   echo "configure: failed program was:" >&5
5462   cat conftest.$ac_ext >&5
5463   rm -rf conftest*
5464   eval "ac_cv_lib_$ac_lib_var=no"
5465 fi
5466 rm -f conftest*
5467 xe_check_libs=""
5468
5469 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5470   echo "$ac_t""yes" 1>&6
5471   have_lib_x11=yes
5472 else
5473   echo "$ac_t""no" 1>&6
5474 fi
5475
5476
5477   if test "$have_lib_x11" != "yes"; then
5478     
5479 xe_msg_checking="for XGetFontProperty in -lX11"
5480 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5481 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5482 echo "configure:5483: checking "$xe_msg_checking"" >&5
5483 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5484
5485 xe_check_libs=" -lX11 -b i486-linuxaout"
5486 cat > conftest.$ac_ext <<EOF
5487 #line 5488 "configure"
5488 #include "confdefs.h"
5489 /* Override any gcc2 internal prototype to avoid an error.  */
5490 /* We use char because int might match the return type of a gcc2
5491     builtin and then its argument prototype would still apply.  */
5492 char XGetFontProperty();
5493
5494 int main() {
5495 XGetFontProperty()
5496 ; return 0; }
5497 EOF
5498 if { (eval echo configure:5499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5499   rm -rf conftest*
5500   eval "ac_cv_lib_$ac_lib_var=yes"
5501 else
5502   echo "configure: failed program was:" >&5
5503   cat conftest.$ac_ext >&5
5504   rm -rf conftest*
5505   eval "ac_cv_lib_$ac_lib_var=no"
5506 fi
5507 rm -f conftest*
5508 xe_check_libs=""
5509
5510 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5511   echo "$ac_t""yes" 1>&6
5512   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5513 else
5514   echo "$ac_t""no" 1>&6
5515 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5516 fi
5517
5518
5519   fi
5520   libs_x="-lX11"
5521   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5522
5523     
5524 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5525 echo "configure:5526: checking for XShapeSelectInput in -lXext" >&5
5526 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5527
5528 xe_check_libs=" -lXext "
5529 cat > conftest.$ac_ext <<EOF
5530 #line 5531 "configure"
5531 #include "confdefs.h"
5532 /* Override any gcc2 internal prototype to avoid an error.  */
5533 /* We use char because int might match the return type of a gcc2
5534     builtin and then its argument prototype would still apply.  */
5535 char XShapeSelectInput();
5536
5537 int main() {
5538 XShapeSelectInput()
5539 ; return 0; }
5540 EOF
5541 if { (eval echo configure:5542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5542   rm -rf conftest*
5543   eval "ac_cv_lib_$ac_lib_var=yes"
5544 else
5545   echo "configure: failed program was:" >&5
5546   cat conftest.$ac_ext >&5
5547   rm -rf conftest*
5548   eval "ac_cv_lib_$ac_lib_var=no"
5549 fi
5550 rm -f conftest*
5551 xe_check_libs=""
5552
5553 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5554   echo "$ac_t""yes" 1>&6
5555   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5556 else
5557   echo "$ac_t""no" 1>&6
5558 fi
5559
5560
5561
5562     
5563 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5564 echo "configure:5565: checking for XtOpenDisplay in -lXt" >&5
5565 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5566
5567 xe_check_libs=" -lXt "
5568 cat > conftest.$ac_ext <<EOF
5569 #line 5570 "configure"
5570 #include "confdefs.h"
5571 /* Override any gcc2 internal prototype to avoid an error.  */
5572 /* We use char because int might match the return type of a gcc2
5573     builtin and then its argument prototype would still apply.  */
5574 char XtOpenDisplay();
5575
5576 int main() {
5577 XtOpenDisplay()
5578 ; return 0; }
5579 EOF
5580 if { (eval echo configure:5581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5581   rm -rf conftest*
5582   eval "ac_cv_lib_$ac_lib_var=yes"
5583 else
5584   echo "configure: failed program was:" >&5
5585   cat conftest.$ac_ext >&5
5586   rm -rf conftest*
5587   eval "ac_cv_lib_$ac_lib_var=no"
5588 fi
5589 rm -f conftest*
5590 xe_check_libs=""
5591
5592 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5593   echo "$ac_t""yes" 1>&6
5594   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5595 else
5596   echo "$ac_t""no" 1>&6
5597 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5598 fi
5599
5600
5601
5602   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5603 echo "configure:5604: checking the version of X11 being used" >&5
5604   cat > conftest.$ac_ext <<EOF
5605 #line 5606 "configure"
5606 #include "confdefs.h"
5607 #include <X11/Intrinsic.h>
5608     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5609 EOF
5610 if { (eval echo configure:5611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5611 then
5612   ./conftest foobar; x11_release=$?
5613 else
5614   conftest_rc="$?"
5615   echo "configure: failed program was:" >&5
5616   cat conftest.$ac_ext >&5
5617   rm -fr conftest*
5618   x11_release=4
5619 fi
5620 rm -fr conftest*
5621   echo "$ac_t""R${x11_release}" 1>&6
5622   { test "$extra_verbose" = "yes" && cat << EOF
5623     Defining THIS_IS_X11R${x11_release}
5624 EOF
5625 cat >> confdefs.h <<EOF
5626 #define THIS_IS_X11R${x11_release} 1
5627 EOF
5628 }
5629
5630
5631   for ac_hdr in X11/Xlocale.h
5632 do
5633 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5634 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5635 echo "configure:5636: checking for $ac_hdr" >&5
5636
5637 cat > conftest.$ac_ext <<EOF
5638 #line 5639 "configure"
5639 #include "confdefs.h"
5640 #include <$ac_hdr>
5641 EOF
5642 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5643 { (eval echo configure:5644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5644 ac_err=`grep -v '^ *+' conftest.out`
5645 if test -z "$ac_err"; then
5646   rm -rf conftest*
5647   eval "ac_cv_header_$ac_safe=yes"
5648 else
5649   echo "$ac_err" >&5
5650   echo "configure: failed program was:" >&5
5651   cat conftest.$ac_ext >&5
5652   rm -rf conftest*
5653   eval "ac_cv_header_$ac_safe=no"
5654 fi
5655 rm -f conftest*
5656 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5657   echo "$ac_t""yes" 1>&6
5658     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5659   { test "$extra_verbose" = "yes" && cat << EOF
5660     Defining $ac_tr_hdr
5661 EOF
5662 cat >> confdefs.h <<EOF
5663 #define $ac_tr_hdr 1
5664 EOF
5665 }
5666  
5667 else
5668   echo "$ac_t""no" 1>&6
5669 fi
5670 done
5671
5672
5673     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5674 echo "configure:5675: checking for XFree86" >&5
5675   if test -d "/usr/X386/include" -o \
5676           -f "/etc/XF86Config"    -o \
5677           -f "/etc/X11/XF86Config" -o \
5678           -f "/usr/X11R6/lib/X11/XF86Config"; then
5679     echo "$ac_t""yes" 1>&6
5680     { test "$extra_verbose" = "yes" && cat << \EOF
5681     Defining HAVE_XFREE386
5682 EOF
5683 cat >> confdefs.h <<\EOF
5684 #define HAVE_XFREE386 1
5685 EOF
5686 }
5687
5688   else
5689     echo "$ac_t""no" 1>&6
5690   fi
5691
5692     test -z "$with_xmu" && { 
5693 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5694 echo "configure:5695: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5695 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5696
5697 xe_check_libs=" -lXmu "
5698 cat > conftest.$ac_ext <<EOF
5699 #line 5700 "configure"
5700 #include "confdefs.h"
5701 /* Override any gcc2 internal prototype to avoid an error.  */
5702 /* We use char because int might match the return type of a gcc2
5703     builtin and then its argument prototype would still apply.  */
5704 char XmuReadBitmapDataFromFile();
5705
5706 int main() {
5707 XmuReadBitmapDataFromFile()
5708 ; return 0; }
5709 EOF
5710 if { (eval echo configure:5711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5711   rm -rf conftest*
5712   eval "ac_cv_lib_$ac_lib_var=yes"
5713 else
5714   echo "configure: failed program was:" >&5
5715   cat conftest.$ac_ext >&5
5716   rm -rf conftest*
5717   eval "ac_cv_lib_$ac_lib_var=no"
5718 fi
5719 rm -f conftest*
5720 xe_check_libs=""
5721
5722 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5723   echo "$ac_t""yes" 1>&6
5724   with_xmu=yes
5725 else
5726   echo "$ac_t""no" 1>&6
5727 with_xmu=no
5728 fi
5729
5730  }
5731   if test "$with_xmu" = "no"; then
5732     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5733    echo "    xemacs will be linked with \"xmu.o\""
5734  fi
5735   else
5736     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5737     { test "$extra_verbose" = "yes" && cat << \EOF
5738     Defining HAVE_XMU
5739 EOF
5740 cat >> confdefs.h <<\EOF
5741 #define HAVE_XMU 1
5742 EOF
5743 }
5744
5745   fi
5746
5747       
5748 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5749 echo "configure:5750: checking for main in -lXbsd" >&5
5750 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5751
5752 xe_check_libs=" -lXbsd "
5753 cat > conftest.$ac_ext <<EOF
5754 #line 5755 "configure"
5755 #include "confdefs.h"
5756
5757 int main() {
5758 main()
5759 ; return 0; }
5760 EOF
5761 if { (eval echo configure:5762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5762   rm -rf conftest*
5763   eval "ac_cv_lib_$ac_lib_var=yes"
5764 else
5765   echo "configure: failed program was:" >&5
5766   cat conftest.$ac_ext >&5
5767   rm -rf conftest*
5768   eval "ac_cv_lib_$ac_lib_var=no"
5769 fi
5770 rm -f conftest*
5771 xe_check_libs=""
5772
5773 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5774   echo "$ac_t""yes" 1>&6
5775   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5776 else
5777   echo "$ac_t""no" 1>&6
5778 fi
5779
5780
5781
5782     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5783         if test "$GCC" = "yes"; then
5784       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5785       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5786     else
5787       case "$CC" in
5788         "xlc" ) CC="xlc_r" ;;
5789         "xlC" ) CC="xlC_r" ;;
5790         "cc"  ) CC="cc_r" ;;
5791       esac
5792     fi
5793   fi
5794
5795 fi 
5796 if test "$with_msw" != "no"; then
5797   echo "checking for MS-Windows" 1>&6
5798 echo "configure:5799: checking for MS-Windows" >&5
5799   
5800 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5801 echo "configure:5802: checking for main in -lgdi32" >&5
5802 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5803
5804 xe_check_libs=" -lgdi32 "
5805 cat > conftest.$ac_ext <<EOF
5806 #line 5807 "configure"
5807 #include "confdefs.h"
5808
5809 int main() {
5810 main()
5811 ; return 0; }
5812 EOF
5813 if { (eval echo configure:5814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5814   rm -rf conftest*
5815   eval "ac_cv_lib_$ac_lib_var=yes"
5816 else
5817   echo "configure: failed program was:" >&5
5818   cat conftest.$ac_ext >&5
5819   rm -rf conftest*
5820   eval "ac_cv_lib_$ac_lib_var=no"
5821 fi
5822 rm -f conftest*
5823 xe_check_libs=""
5824
5825 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5826   echo "$ac_t""yes" 1>&6
5827   with_msw=yes
5828 else
5829   echo "$ac_t""no" 1>&6
5830 fi
5831
5832
5833   if test "$with_msw" = "yes"; then
5834     { test "$extra_verbose" = "yes" && cat << \EOF
5835     Defining HAVE_MS_WINDOWS
5836 EOF
5837 cat >> confdefs.h <<\EOF
5838 #define HAVE_MS_WINDOWS 1
5839 EOF
5840 }
5841
5842     install_pp="$blddir/lib-src/installexe.sh"
5843     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
5844     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
5845     if test "$window_system" != x11; then
5846         window_system=msw
5847         test "$with_scrollbars" != "no" && with_scrollbars=msw \
5848             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5849    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5850  fi
5851         test "$with_menubars"   != "no" && with_menubars=msw \
5852             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5853    echo "    xemacs will be linked with \"menubar-msw.o\""
5854  fi
5855         test "$with_toolbars"   != "no" && with_toolbars=msw \
5856             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5857    echo "    xemacs will be linked with \"toolbar-msw.o\""
5858  fi
5859         test "$with_dialogs"   != "no" && with_dialogs=msw \
5860             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5861    echo "    xemacs will be linked with \"dialog-msw.o\""
5862  fi
5863     else
5864         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5865    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5866  fi
5867         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5868    echo "    xemacs will be linked with \"menubar-msw.o\""
5869  fi
5870         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5871    echo "    xemacs will be linked with \"toolbar-msw.o\""
5872  fi
5873         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5874    echo "    xemacs will be linked with \"dialog-msw.o\""
5875  fi
5876     fi
5877         cat > conftest.$ac_ext <<EOF
5878 #line 5879 "configure"
5879 #include "confdefs.h"
5880 #include <fcntl.h>
5881     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
5882 EOF
5883 if { (eval echo configure:5884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5884 then
5885   { test "$extra_verbose" = "yes" && cat << \EOF
5886     Defining HAVE_MSG_SELECT
5887 EOF
5888 cat >> confdefs.h <<\EOF
5889 #define HAVE_MSG_SELECT 1
5890 EOF
5891 }
5892
5893 else
5894   conftest_rc="$?"
5895   echo "configure: failed program was:" >&5
5896   cat conftest.$ac_ext >&5
5897 fi
5898 rm -fr conftest*
5899     const_is_losing=no
5900     with_file_coding=yes
5901     use_minimal_tagbits=yes
5902     use_indexed_lrecord_implementation=yes
5903     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" &&  if test "$extra_verbose" = "yes"; then
5904    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\""
5905  fi
5906   fi
5907 fi
5908
5909
5910
5911 test -z "$window_system" && window_system="none"
5912
5913 if test "$window_system" = "none"; then
5914   for feature in menubars scrollbars toolbars dialogs dragndrop
5915   do
5916     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5917        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
5918     fi
5919     eval "with_${feature}=no"
5920   done
5921 else
5922   test -z "$with_toolbars" && with_toolbars=yes
5923 fi
5924
5925 if test "$with_msw" != "yes"; then
5926   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
5927   do
5928     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5929        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
5930     fi
5931     eval "with_${feature}=no"
5932   done
5933 else
5934   :
5935 fi
5936
5937 if test "$with_x11" != "yes"; then
5938             for feature in tooltalk cde offix session xim xmu \
5939                  xface
5940   do
5941     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5942        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
5943     fi
5944     eval "with_${feature}=no"
5945   done
5946 fi
5947
5948 bitmapdir=
5949
5950 case "$window_system" in
5951   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
5952   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
5953   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
5954 esac
5955
5956 case "$x_libraries" in *X11R4* )
5957   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
5958   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
5959 esac
5960
5961 echo "checking for session-management option" 1>&6
5962 echo "configure:5963: checking for session-management option" >&5;
5963 if test "$with_session" != "no"; then
5964   { test "$extra_verbose" = "yes" && cat << \EOF
5965     Defining HAVE_SESSION
5966 EOF
5967 cat >> confdefs.h <<\EOF
5968 #define HAVE_SESSION 1
5969 EOF
5970 }
5971
5972 fi
5973
5974 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
5975 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
5976 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
5977 echo "configure:5978: checking for X11/Xauth.h" >&5
5978
5979 cat > conftest.$ac_ext <<EOF
5980 #line 5981 "configure"
5981 #include "confdefs.h"
5982 #include <X11/Xauth.h>
5983 EOF
5984 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5985 { (eval echo configure:5986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5986 ac_err=`grep -v '^ *+' conftest.out`
5987 if test -z "$ac_err"; then
5988   rm -rf conftest*
5989   eval "ac_cv_header_$ac_safe=yes"
5990 else
5991   echo "$ac_err" >&5
5992   echo "configure: failed program was:" >&5
5993   cat conftest.$ac_ext >&5
5994   rm -rf conftest*
5995   eval "ac_cv_header_$ac_safe=no"
5996 fi
5997 rm -f conftest*
5998 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5999   echo "$ac_t""yes" 1>&6
6000   :
6001 else
6002   echo "$ac_t""no" 1>&6
6003 with_xauth=no
6004 fi
6005  }
6006 test -z "$with_xauth" && { 
6007 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6008 echo "configure:6009: checking for XauGetAuthByAddr in -lXau" >&5
6009 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6010
6011 xe_check_libs=" -lXau "
6012 cat > conftest.$ac_ext <<EOF
6013 #line 6014 "configure"
6014 #include "confdefs.h"
6015 /* Override any gcc2 internal prototype to avoid an error.  */
6016 /* We use char because int might match the return type of a gcc2
6017     builtin and then its argument prototype would still apply.  */
6018 char XauGetAuthByAddr();
6019
6020 int main() {
6021 XauGetAuthByAddr()
6022 ; return 0; }
6023 EOF
6024 if { (eval echo configure:6025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6025   rm -rf conftest*
6026   eval "ac_cv_lib_$ac_lib_var=yes"
6027 else
6028   echo "configure: failed program was:" >&5
6029   cat conftest.$ac_ext >&5
6030   rm -rf conftest*
6031   eval "ac_cv_lib_$ac_lib_var=no"
6032 fi
6033 rm -f conftest*
6034 xe_check_libs=""
6035
6036 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6037   echo "$ac_t""yes" 1>&6
6038   :
6039 else
6040   echo "$ac_t""no" 1>&6
6041 with_xauth=no
6042 fi
6043
6044  }
6045 test -z "$with_xauth" && with_xauth=yes
6046 if test "$with_xauth" = "yes"; then
6047   { test "$extra_verbose" = "yes" && cat << \EOF
6048     Defining HAVE_XAUTH
6049 EOF
6050 cat >> confdefs.h <<\EOF
6051 #define HAVE_XAUTH 1
6052 EOF
6053 }
6054
6055   
6056 T=""
6057 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
6058 libs_xauth="$T"
6059
6060 fi
6061
6062
6063
6064
6065 if test "$with_tooltalk" != "no" ; then
6066       for dir in "" "Tt/" "desktop/" ; do
6067     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6068 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6069 echo "configure:6070: checking for ${dir}tt_c.h" >&5
6070
6071 cat > conftest.$ac_ext <<EOF
6072 #line 6073 "configure"
6073 #include "confdefs.h"
6074 #include <${dir}tt_c.h>
6075 EOF
6076 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6077 { (eval echo configure:6078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6078 ac_err=`grep -v '^ *+' conftest.out`
6079 if test -z "$ac_err"; then
6080   rm -rf conftest*
6081   eval "ac_cv_header_$ac_safe=yes"
6082 else
6083   echo "$ac_err" >&5
6084   echo "configure: failed program was:" >&5
6085   cat conftest.$ac_ext >&5
6086   rm -rf conftest*
6087   eval "ac_cv_header_$ac_safe=no"
6088 fi
6089 rm -f conftest*
6090 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6091   echo "$ac_t""yes" 1>&6
6092   tt_c_h_path="${dir}tt_c.h"; break
6093 else
6094   echo "$ac_t""no" 1>&6
6095 fi
6096
6097   done
6098   if test -z "$tt_c_h_path"; then
6099     if test "$with_tooltalk" = "yes"; then
6100       (echo "$progname: Usage error:"
6101 echo " " "Unable to find required tooltalk header files."
6102 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6103     fi
6104     with_tooltalk=no
6105   fi
6106 fi
6107 if test "$with_tooltalk" != "no" ; then
6108   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6109     
6110 xe_msg_checking="for tt_message_create in -ltt"
6111 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6112 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6113 echo "configure:6114: checking "$xe_msg_checking"" >&5
6114 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6115
6116 xe_check_libs=" -ltt $extra_libs"
6117 cat > conftest.$ac_ext <<EOF
6118 #line 6119 "configure"
6119 #include "confdefs.h"
6120 /* Override any gcc2 internal prototype to avoid an error.  */
6121 /* We use char because int might match the return type of a gcc2
6122     builtin and then its argument prototype would still apply.  */
6123 char tt_message_create();
6124
6125 int main() {
6126 tt_message_create()
6127 ; return 0; }
6128 EOF
6129 if { (eval echo configure:6130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6130   rm -rf conftest*
6131   eval "ac_cv_lib_$ac_lib_var=yes"
6132 else
6133   echo "configure: failed program was:" >&5
6134   cat conftest.$ac_ext >&5
6135   rm -rf conftest*
6136   eval "ac_cv_lib_$ac_lib_var=no"
6137 fi
6138 rm -f conftest*
6139 xe_check_libs=""
6140
6141 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6142   echo "$ac_t""yes" 1>&6
6143   tt_libs="-ltt $extra_libs"; break
6144 else
6145   echo "$ac_t""no" 1>&6
6146 :
6147 fi
6148
6149
6150   done
6151   if test -z "$tt_libs"; then
6152     if test "$with_tooltalk" = "yes"; then
6153       (echo "$progname: Usage error:"
6154 echo " " "Unable to find required tooltalk libraries."
6155 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6156     fi
6157     with_tooltalk=no
6158   fi
6159 fi
6160 test -z "$with_tooltalk" && with_tooltalk=yes
6161 if test "$with_tooltalk" = "yes"; then
6162   { test "$extra_verbose" = "yes" && cat << \EOF
6163     Defining TOOLTALK
6164 EOF
6165 cat >> confdefs.h <<\EOF
6166 #define TOOLTALK 1
6167 EOF
6168 }
6169
6170   { test "$extra_verbose" = "yes" && cat << EOF
6171     Defining TT_C_H_PATH = "$tt_c_h_path"
6172 EOF
6173 cat >> confdefs.h <<EOF
6174 #define TT_C_H_PATH "$tt_c_h_path"
6175 EOF
6176 }
6177
6178   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6179   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6180    echo "    xemacs will be linked with \"tooltalk.o\""
6181  fi
6182 fi
6183
6184 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6185 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6186 echo "configure:6187: checking for Dt/Dt.h" >&5
6187
6188 cat > conftest.$ac_ext <<EOF
6189 #line 6190 "configure"
6190 #include "confdefs.h"
6191 #include <Dt/Dt.h>
6192 EOF
6193 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6194 { (eval echo configure:6195: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6195 ac_err=`grep -v '^ *+' conftest.out`
6196 if test -z "$ac_err"; then
6197   rm -rf conftest*
6198   eval "ac_cv_header_$ac_safe=yes"
6199 else
6200   echo "$ac_err" >&5
6201   echo "configure: failed program was:" >&5
6202   cat conftest.$ac_ext >&5
6203   rm -rf conftest*
6204   eval "ac_cv_header_$ac_safe=no"
6205 fi
6206 rm -f conftest*
6207 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6208   echo "$ac_t""yes" 1>&6
6209   :
6210 else
6211   echo "$ac_t""no" 1>&6
6212 with_cde=no
6213 fi
6214  }
6215 test -z "$with_cde" && { 
6216 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6217 echo "configure:6218: checking for DtDndDragStart in -lDtSvc" >&5
6218 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6219
6220 xe_check_libs=" -lDtSvc "
6221 cat > conftest.$ac_ext <<EOF
6222 #line 6223 "configure"
6223 #include "confdefs.h"
6224 /* Override any gcc2 internal prototype to avoid an error.  */
6225 /* We use char because int might match the return type of a gcc2
6226     builtin and then its argument prototype would still apply.  */
6227 char DtDndDragStart();
6228
6229 int main() {
6230 DtDndDragStart()
6231 ; return 0; }
6232 EOF
6233 if { (eval echo configure:6234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6234   rm -rf conftest*
6235   eval "ac_cv_lib_$ac_lib_var=yes"
6236 else
6237   echo "configure: failed program was:" >&5
6238   cat conftest.$ac_ext >&5
6239   rm -rf conftest*
6240   eval "ac_cv_lib_$ac_lib_var=no"
6241 fi
6242 rm -f conftest*
6243 xe_check_libs=""
6244
6245 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6246   echo "$ac_t""yes" 1>&6
6247   :
6248 else
6249   echo "$ac_t""no" 1>&6
6250 with_cde=no
6251 fi
6252
6253  }
6254 test -z "$with_cde" && with_cde=yes
6255 if test "$with_dragndrop" = no; then
6256   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6257   with_cde=no
6258 fi
6259 if test "$with_cde" = "yes" ; then
6260   { test "$extra_verbose" = "yes" && cat << \EOF
6261     Defining HAVE_CDE
6262 EOF
6263 cat >> confdefs.h <<\EOF
6264 #define HAVE_CDE 1
6265 EOF
6266 }
6267
6268   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6269   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6270   with_tooltalk=yes # CDE requires Tooltalk
6271   need_motif=yes    # CDE requires Motif
6272 fi
6273
6274 test "$window_system" != "x11" && with_offix=no
6275 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6276   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6277   with_offix=no
6278 fi
6279 if test "$with_dragndrop" = no; then
6280   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6281   with_offix=no
6282 fi
6283 if test "$with_cde" = yes; then
6284   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6285   with_offix=no
6286 fi
6287 test -z "$with_offix" && with_offix=no
6288 if test "$with_offix" = "yes"; then
6289   { test "$extra_verbose" = "yes" && cat << \EOF
6290     Defining HAVE_OFFIX_DND
6291 EOF
6292 cat >> confdefs.h <<\EOF
6293 #define HAVE_OFFIX_DND 1
6294 EOF
6295 }
6296
6297   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6298   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6299 fi
6300
6301 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6302 echo "configure:6303: checking if drag and drop API is needed" >&5
6303 if test "$with_dragndrop" != "no" ; then
6304   if test -n "$dragndrop_proto" ; then
6305     with_dragndrop=yes
6306     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6307     { test "$extra_verbose" = "yes" && cat << \EOF
6308     Defining HAVE_DRAGNDROP
6309 EOF
6310 cat >> confdefs.h <<\EOF
6311 #define HAVE_DRAGNDROP 1
6312 EOF
6313 }
6314
6315     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6316   else
6317     with_dragndrop=no
6318     echo "$ac_t""no" 1>&6
6319   fi
6320 fi
6321
6322 echo "checking for LDAP" 1>&6
6323 echo "configure:6324: checking for LDAP" >&5
6324 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6325 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6326 echo "configure:6327: checking for ldap.h" >&5
6327
6328 cat > conftest.$ac_ext <<EOF
6329 #line 6330 "configure"
6330 #include "confdefs.h"
6331 #include <ldap.h>
6332 EOF
6333 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6334 { (eval echo configure:6335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6335 ac_err=`grep -v '^ *+' conftest.out`
6336 if test -z "$ac_err"; then
6337   rm -rf conftest*
6338   eval "ac_cv_header_$ac_safe=yes"
6339 else
6340   echo "$ac_err" >&5
6341   echo "configure: failed program was:" >&5
6342   cat conftest.$ac_ext >&5
6343   rm -rf conftest*
6344   eval "ac_cv_header_$ac_safe=no"
6345 fi
6346 rm -f conftest*
6347 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6348   echo "$ac_t""yes" 1>&6
6349   :
6350 else
6351   echo "$ac_t""no" 1>&6
6352 with_ldap=no
6353 fi
6354  }
6355 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6356 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6357 echo "configure:6358: checking for lber.h" >&5
6358
6359 cat > conftest.$ac_ext <<EOF
6360 #line 6361 "configure"
6361 #include "confdefs.h"
6362 #include <lber.h>
6363 EOF
6364 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6365 { (eval echo configure:6366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6366 ac_err=`grep -v '^ *+' conftest.out`
6367 if test -z "$ac_err"; then
6368   rm -rf conftest*
6369   eval "ac_cv_header_$ac_safe=yes"
6370 else
6371   echo "$ac_err" >&5
6372   echo "configure: failed program was:" >&5
6373   cat conftest.$ac_ext >&5
6374   rm -rf conftest*
6375   eval "ac_cv_header_$ac_safe=no"
6376 fi
6377 rm -f conftest*
6378 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6379   echo "$ac_t""yes" 1>&6
6380   :
6381 else
6382   echo "$ac_t""no" 1>&6
6383 with_ldap=no
6384 fi
6385  }
6386 if test "$with_ldap" != "no"; then
6387   test -z "$with_umich_ldap" && { 
6388 xe_msg_checking="for ldap_open in -lldap"
6389 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6390 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6391 echo "configure:6392: checking "$xe_msg_checking"" >&5
6392 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6393
6394 xe_check_libs=" -lldap -llber"
6395 cat > conftest.$ac_ext <<EOF
6396 #line 6397 "configure"
6397 #include "confdefs.h"
6398 /* Override any gcc2 internal prototype to avoid an error.  */
6399 /* We use char because int might match the return type of a gcc2
6400     builtin and then its argument prototype would still apply.  */
6401 char ldap_open();
6402
6403 int main() {
6404 ldap_open()
6405 ; return 0; }
6406 EOF
6407 if { (eval echo configure:6408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6408   rm -rf conftest*
6409   eval "ac_cv_lib_$ac_lib_var=yes"
6410 else
6411   echo "configure: failed program was:" >&5
6412   cat conftest.$ac_ext >&5
6413   rm -rf conftest*
6414   eval "ac_cv_lib_$ac_lib_var=no"
6415 fi
6416 rm -f conftest*
6417 xe_check_libs=""
6418
6419 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6420   echo "$ac_t""yes" 1>&6
6421   with_umich_ldap=yes
6422 else
6423   echo "$ac_t""no" 1>&6
6424 with_umich_ldap=no
6425 fi
6426
6427  }
6428   test "$with_umich_ldap" = "no" && { 
6429 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6430 echo "configure:6431: checking for ldap_set_option in -lldap10" >&5
6431 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6432
6433 xe_check_libs=" -lldap10 "
6434 cat > conftest.$ac_ext <<EOF
6435 #line 6436 "configure"
6436 #include "confdefs.h"
6437 /* Override any gcc2 internal prototype to avoid an error.  */
6438 /* We use char because int might match the return type of a gcc2
6439     builtin and then its argument prototype would still apply.  */
6440 char ldap_set_option();
6441
6442 int main() {
6443 ldap_set_option()
6444 ; return 0; }
6445 EOF
6446 if { (eval echo configure:6447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6447   rm -rf conftest*
6448   eval "ac_cv_lib_$ac_lib_var=yes"
6449 else
6450   echo "configure: failed program was:" >&5
6451   cat conftest.$ac_ext >&5
6452   rm -rf conftest*
6453   eval "ac_cv_lib_$ac_lib_var=no"
6454 fi
6455 rm -f conftest*
6456 xe_check_libs=""
6457
6458 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6459   echo "$ac_t""yes" 1>&6
6460   with_ns_ldap=yes
6461 else
6462   echo "$ac_t""no" 1>&6
6463 with_ns_ldap=no
6464 fi
6465
6466  }
6467   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6468 fi
6469 if test "$with_ldap" = "yes"; then
6470   { test "$extra_verbose" = "yes" && cat << \EOF
6471     Defining HAVE_LDAP
6472 EOF
6473 cat >> confdefs.h <<\EOF
6474 #define HAVE_LDAP 1
6475 EOF
6476 }
6477
6478   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6479    echo "    xemacs will be linked with \"eldap.o\""
6480  fi
6481   if test "$with_umich_ldap" = "yes" ; then
6482     { test "$extra_verbose" = "yes" && cat << \EOF
6483     Defining HAVE_UMICH_LDAP
6484 EOF
6485 cat >> confdefs.h <<\EOF
6486 #define HAVE_UMICH_LDAP 1
6487 EOF
6488 }
6489
6490     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6491     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6492   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6493     { test "$extra_verbose" = "yes" && cat << \EOF
6494     Defining HAVE_NS_LDAP
6495 EOF
6496 cat >> confdefs.h <<\EOF
6497 #define HAVE_NS_LDAP 1
6498 EOF
6499 }
6500
6501     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6502   elif test "$with_ldap" = "yes" ; then
6503     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6504   fi
6505 fi
6506
6507
6508 if test "$window_system" != "none"; then
6509   echo "checking for graphics libraries" 1>&6
6510 echo "configure:6511: checking for graphics libraries" >&5
6511
6512     xpm_problem=""
6513   if test -z "$with_xpm"; then
6514     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6515 echo "configure:6516: checking for Xpm - no older than 3.4f" >&5
6516     xe_check_libs=-lXpm
6517     cat > conftest.$ac_ext <<EOF
6518 #line 6519 "configure"
6519 #include "confdefs.h"
6520 #include <X11/xpm.h>
6521     int main(int c, char **v) {
6522     return c == 1 ? 0 :
6523       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6524       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6525 EOF
6526 if { (eval echo configure:6527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6527 then
6528   ./conftest dummy_arg; xpm_status=$?;
6529       if test "$xpm_status" = "0"; then
6530         with_xpm=yes;
6531       else
6532         with_xpm=no;
6533         if test "$xpm_status" = "1"; then
6534           xpm_problem="Xpm library version and header file version don't match!"
6535         elif test "$xpm_status" = "2"; then
6536           xpm_problem="Xpm library version is too old!"
6537         else
6538           xpm_problem="Internal xpm detection logic error!"
6539         fi
6540         echo "
6541 *** WARNING *** $xpm_problem
6542   I'm not touching that with a 10-foot pole!
6543   If you really want to use the installed version of Xpm, rerun
6544   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6545     fi
6546 else
6547   conftest_rc="$?"
6548   echo "configure: failed program was:" >&5
6549   cat conftest.$ac_ext >&5
6550   rm -fr conftest*
6551   with_xpm=no
6552 fi
6553 rm -fr conftest*
6554     xe_check_libs=
6555     echo "$ac_t""$with_xpm" 1>&6
6556   fi
6557   if test "$with_xpm" = "yes"; then
6558     { test "$extra_verbose" = "yes" && cat << \EOF
6559     Defining HAVE_XPM
6560 EOF
6561 cat >> confdefs.h <<\EOF
6562 #define HAVE_XPM 1
6563 EOF
6564 }
6565
6566     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6567     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6568 echo "configure:6569: checking for \"FOR_MSW\" xpm" >&5
6569     xe_check_libs=-lXpm
6570     cat > conftest.$ac_ext <<EOF
6571 #line 6572 "configure"
6572 #include "confdefs.h"
6573
6574 int main() {
6575 XpmCreatePixmapFromData()
6576 ; return 0; }
6577 EOF
6578 if { (eval echo configure:6579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6579   rm -rf conftest*
6580   xpm_for_msw=no
6581 else
6582   echo "configure: failed program was:" >&5
6583   cat conftest.$ac_ext >&5
6584   rm -rf conftest*
6585   xpm_for_msw=yes
6586 fi
6587 rm -f conftest*
6588     xe_check_libs=
6589     echo "$ac_t""$xpm_for_msw" 1>&6
6590     if test "$xpm_for_msw" = "yes"; then
6591       { test "$extra_verbose" = "yes" && cat << \EOF
6592     Defining FOR_MSW
6593 EOF
6594 cat >> confdefs.h <<\EOF
6595 #define FOR_MSW 1
6596 EOF
6597 }
6598
6599     fi
6600   fi
6601
6602         if test "$with_gif" != "no"; then
6603     with_gif="yes"
6604     { test "$extra_verbose" = "yes" && cat << \EOF
6605     Defining HAVE_GIF
6606 EOF
6607 cat >> confdefs.h <<\EOF
6608 #define HAVE_GIF 1
6609 EOF
6610 }
6611
6612     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6613    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6614  fi
6615   fi
6616
6617       if test "$with_png $with_tiff" != "no no"; then
6618     
6619 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6620 echo "configure:6621: checking for inflate in -lc" >&5
6621 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6622
6623 xe_check_libs=" -lc "
6624 cat > conftest.$ac_ext <<EOF
6625 #line 6626 "configure"
6626 #include "confdefs.h"
6627 /* Override any gcc2 internal prototype to avoid an error.  */
6628 /* We use char because int might match the return type of a gcc2
6629     builtin and then its argument prototype would still apply.  */
6630 char inflate();
6631
6632 int main() {
6633 inflate()
6634 ; return 0; }
6635 EOF
6636 if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6637   rm -rf conftest*
6638   eval "ac_cv_lib_$ac_lib_var=yes"
6639 else
6640   echo "configure: failed program was:" >&5
6641   cat conftest.$ac_ext >&5
6642   rm -rf conftest*
6643   eval "ac_cv_lib_$ac_lib_var=no"
6644 fi
6645 rm -f conftest*
6646 xe_check_libs=""
6647
6648 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6649   echo "$ac_t""yes" 1>&6
6650   :
6651 else
6652   echo "$ac_t""no" 1>&6
6653
6654 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6655 echo "configure:6656: checking for inflate in -lz" >&5
6656 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6657
6658 xe_check_libs=" -lz "
6659 cat > conftest.$ac_ext <<EOF
6660 #line 6661 "configure"
6661 #include "confdefs.h"
6662 /* Override any gcc2 internal prototype to avoid an error.  */
6663 /* We use char because int might match the return type of a gcc2
6664     builtin and then its argument prototype would still apply.  */
6665 char inflate();
6666
6667 int main() {
6668 inflate()
6669 ; return 0; }
6670 EOF
6671 if { (eval echo configure:6672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6672   rm -rf conftest*
6673   eval "ac_cv_lib_$ac_lib_var=yes"
6674 else
6675   echo "configure: failed program was:" >&5
6676   cat conftest.$ac_ext >&5
6677   rm -rf conftest*
6678   eval "ac_cv_lib_$ac_lib_var=no"
6679 fi
6680 rm -f conftest*
6681 xe_check_libs=""
6682
6683 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6684   echo "$ac_t""yes" 1>&6
6685   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6686 else
6687   echo "$ac_t""no" 1>&6
6688
6689 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6690 echo "configure:6691: checking for inflate in -lgz" >&5
6691 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6692
6693 xe_check_libs=" -lgz "
6694 cat > conftest.$ac_ext <<EOF
6695 #line 6696 "configure"
6696 #include "confdefs.h"
6697 /* Override any gcc2 internal prototype to avoid an error.  */
6698 /* We use char because int might match the return type of a gcc2
6699     builtin and then its argument prototype would still apply.  */
6700 char inflate();
6701
6702 int main() {
6703 inflate()
6704 ; return 0; }
6705 EOF
6706 if { (eval echo configure:6707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6707   rm -rf conftest*
6708   eval "ac_cv_lib_$ac_lib_var=yes"
6709 else
6710   echo "configure: failed program was:" >&5
6711   cat conftest.$ac_ext >&5
6712   rm -rf conftest*
6713   eval "ac_cv_lib_$ac_lib_var=no"
6714 fi
6715 rm -f conftest*
6716 xe_check_libs=""
6717
6718 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6719   echo "$ac_t""yes" 1>&6
6720   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6721 else
6722   echo "$ac_t""no" 1>&6
6723 fi
6724
6725
6726 fi
6727
6728
6729 fi
6730
6731
6732   fi
6733
6734     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6735 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6736 echo "configure:6737: checking for jpeglib.h" >&5
6737
6738 cat > conftest.$ac_ext <<EOF
6739 #line 6740 "configure"
6740 #include "confdefs.h"
6741 #include <jpeglib.h>
6742 EOF
6743 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6744 { (eval echo configure:6745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6745 ac_err=`grep -v '^ *+' conftest.out`
6746 if test -z "$ac_err"; then
6747   rm -rf conftest*
6748   eval "ac_cv_header_$ac_safe=yes"
6749 else
6750   echo "$ac_err" >&5
6751   echo "configure: failed program was:" >&5
6752   cat conftest.$ac_ext >&5
6753   rm -rf conftest*
6754   eval "ac_cv_header_$ac_safe=no"
6755 fi
6756 rm -f conftest*
6757 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6758   echo "$ac_t""yes" 1>&6
6759   :
6760 else
6761   echo "$ac_t""no" 1>&6
6762 with_jpeg=no
6763 fi
6764  }
6765   test -z "$with_jpeg" && { 
6766 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
6767 echo "configure:6768: checking for jpeg_destroy_decompress in -ljpeg" >&5
6768 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
6769
6770 xe_check_libs=" -ljpeg "
6771 cat > conftest.$ac_ext <<EOF
6772 #line 6773 "configure"
6773 #include "confdefs.h"
6774 /* Override any gcc2 internal prototype to avoid an error.  */
6775 /* We use char because int might match the return type of a gcc2
6776     builtin and then its argument prototype would still apply.  */
6777 char jpeg_destroy_decompress();
6778
6779 int main() {
6780 jpeg_destroy_decompress()
6781 ; return 0; }
6782 EOF
6783 if { (eval echo configure:6784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6784   rm -rf conftest*
6785   eval "ac_cv_lib_$ac_lib_var=yes"
6786 else
6787   echo "configure: failed program was:" >&5
6788   cat conftest.$ac_ext >&5
6789   rm -rf conftest*
6790   eval "ac_cv_lib_$ac_lib_var=no"
6791 fi
6792 rm -f conftest*
6793 xe_check_libs=""
6794
6795 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6796   echo "$ac_t""yes" 1>&6
6797   :
6798 else
6799   echo "$ac_t""no" 1>&6
6800 with_jpeg=no
6801 fi
6802
6803  }
6804   test -z "$with_jpeg" && with_jpeg=yes
6805   if test "$with_jpeg" = "yes"; then
6806     { test "$extra_verbose" = "yes" && cat << \EOF
6807     Defining HAVE_JPEG
6808 EOF
6809 cat >> confdefs.h <<\EOF
6810 #define HAVE_JPEG 1
6811 EOF
6812 }
6813
6814     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
6815   fi
6816
6817     png_problem=""
6818   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
6819 echo "configure:6820: checking for pow" >&5
6820
6821 cat > conftest.$ac_ext <<EOF
6822 #line 6823 "configure"
6823 #include "confdefs.h"
6824 /* System header to define __stub macros and hopefully few prototypes,
6825     which can conflict with char pow(); below.  */
6826 #include <assert.h>
6827 /* Override any gcc2 internal prototype to avoid an error.  */
6828 /* We use char because int might match the return type of a gcc2
6829     builtin and then its argument prototype would still apply.  */
6830 char pow();
6831
6832 int main() {
6833
6834 /* The GNU C library defines this for functions which it implements
6835     to always fail with ENOSYS.  Some functions are actually named
6836     something starting with __ and the normal name is an alias.  */
6837 #if defined (__stub_pow) || defined (__stub___pow)
6838 choke me
6839 #else
6840 pow();
6841 #endif
6842
6843 ; return 0; }
6844 EOF
6845 if { (eval echo configure:6846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6846   rm -rf conftest*
6847   eval "ac_cv_func_pow=yes"
6848 else
6849   echo "configure: failed program was:" >&5
6850   cat conftest.$ac_ext >&5
6851   rm -rf conftest*
6852   eval "ac_cv_func_pow=no"
6853 fi
6854 rm -f conftest*
6855
6856 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
6857   echo "$ac_t""yes" 1>&6
6858   :
6859 else
6860   echo "$ac_t""no" 1>&6
6861 with_png=no
6862 fi
6863  }
6864   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
6865 echo $ac_n "checking for png.h""... $ac_c" 1>&6
6866 echo "configure:6867: checking for png.h" >&5
6867
6868 cat > conftest.$ac_ext <<EOF
6869 #line 6870 "configure"
6870 #include "confdefs.h"
6871 #include <png.h>
6872 EOF
6873 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6874 { (eval echo configure:6875: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6875 ac_err=`grep -v '^ *+' conftest.out`
6876 if test -z "$ac_err"; then
6877   rm -rf conftest*
6878   eval "ac_cv_header_$ac_safe=yes"
6879 else
6880   echo "$ac_err" >&5
6881   echo "configure: failed program was:" >&5
6882   cat conftest.$ac_ext >&5
6883   rm -rf conftest*
6884   eval "ac_cv_header_$ac_safe=no"
6885 fi
6886 rm -f conftest*
6887 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6888   echo "$ac_t""yes" 1>&6
6889   :
6890 else
6891   echo "$ac_t""no" 1>&6
6892 with_png=no
6893 fi
6894  }
6895   test -z "$with_png" && { 
6896 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
6897 echo "configure:6898: checking for png_read_image in -lpng" >&5
6898 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
6899
6900 xe_check_libs=" -lpng "
6901 cat > conftest.$ac_ext <<EOF
6902 #line 6903 "configure"
6903 #include "confdefs.h"
6904 /* Override any gcc2 internal prototype to avoid an error.  */
6905 /* We use char because int might match the return type of a gcc2
6906     builtin and then its argument prototype would still apply.  */
6907 char png_read_image();
6908
6909 int main() {
6910 png_read_image()
6911 ; return 0; }
6912 EOF
6913 if { (eval echo configure:6914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6914   rm -rf conftest*
6915   eval "ac_cv_lib_$ac_lib_var=yes"
6916 else
6917   echo "configure: failed program was:" >&5
6918   cat conftest.$ac_ext >&5
6919   rm -rf conftest*
6920   eval "ac_cv_lib_$ac_lib_var=no"
6921 fi
6922 rm -f conftest*
6923 xe_check_libs=""
6924
6925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6926   echo "$ac_t""yes" 1>&6
6927   :
6928 else
6929   echo "$ac_t""no" 1>&6
6930 with_png=no
6931 fi
6932
6933  }
6934   if test -z "$with_png"; then
6935     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
6936 echo "configure:6937: checking for workable png version information" >&5
6937     xe_check_libs="-lpng -lz"
6938     cat > conftest.$ac_ext <<EOF
6939 #line 6940 "configure"
6940 #include "confdefs.h"
6941 #include <png.h>
6942     int main(int c, char **v) {
6943     if (c == 1) return 0;
6944     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
6945     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
6946 EOF
6947 if { (eval echo configure:6948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6948 then
6949   ./conftest dummy_arg; png_status=$?;
6950       if test "$png_status" = "0"; then
6951         with_png=yes;
6952       else
6953         with_png=no;
6954         if test "$png_status" = "1"; then
6955           png_problem="PNG library version and header file don't match!"
6956         elif test "$png_status" = "2"; then
6957           png_problem="PNG library version too old (pre 1.0.2)!"
6958         fi
6959         echo "
6960 *** WARNING *** $png_problem
6961   I'm not touching that with a 10-foot pole!
6962   If you really want to use the installed version of libPNG, rerun
6963   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
6964     fi
6965 else
6966   conftest_rc="$?"
6967   echo "configure: failed program was:" >&5
6968   cat conftest.$ac_ext >&5
6969   rm -fr conftest*
6970   with_png=no
6971 fi
6972 rm -fr conftest*
6973     xe_check_libs=
6974     echo "$ac_t""$with_png" 1>&6
6975   fi
6976   if test "$with_png" = "yes"; then
6977     { test "$extra_verbose" = "yes" && cat << \EOF
6978     Defining HAVE_PNG
6979 EOF
6980 cat >> confdefs.h <<\EOF
6981 #define HAVE_PNG 1
6982 EOF
6983 }
6984
6985     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
6986   fi
6987
6988     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
6989 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
6990 echo "configure:6991: checking for tiffio.h" >&5
6991
6992 cat > conftest.$ac_ext <<EOF
6993 #line 6994 "configure"
6994 #include "confdefs.h"
6995 #include <tiffio.h>
6996 EOF
6997 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6998 { (eval echo configure:6999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6999 ac_err=`grep -v '^ *+' conftest.out`
7000 if test -z "$ac_err"; then
7001   rm -rf conftest*
7002   eval "ac_cv_header_$ac_safe=yes"
7003 else
7004   echo "$ac_err" >&5
7005   echo "configure: failed program was:" >&5
7006   cat conftest.$ac_ext >&5
7007   rm -rf conftest*
7008   eval "ac_cv_header_$ac_safe=no"
7009 fi
7010 rm -f conftest*
7011 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7012   echo "$ac_t""yes" 1>&6
7013   :
7014 else
7015   echo "$ac_t""no" 1>&6
7016 with_tiff=no
7017 fi
7018  }
7019   test -z "$with_tiff" && { 
7020 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7021 echo "configure:7022: checking for TIFFClientOpen in -ltiff" >&5
7022 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7023
7024 xe_check_libs=" -ltiff "
7025 cat > conftest.$ac_ext <<EOF
7026 #line 7027 "configure"
7027 #include "confdefs.h"
7028 /* Override any gcc2 internal prototype to avoid an error.  */
7029 /* We use char because int might match the return type of a gcc2
7030     builtin and then its argument prototype would still apply.  */
7031 char TIFFClientOpen();
7032
7033 int main() {
7034 TIFFClientOpen()
7035 ; return 0; }
7036 EOF
7037 if { (eval echo configure:7038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7038   rm -rf conftest*
7039   eval "ac_cv_lib_$ac_lib_var=yes"
7040 else
7041   echo "configure: failed program was:" >&5
7042   cat conftest.$ac_ext >&5
7043   rm -rf conftest*
7044   eval "ac_cv_lib_$ac_lib_var=no"
7045 fi
7046 rm -f conftest*
7047 xe_check_libs=""
7048
7049 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7050   echo "$ac_t""yes" 1>&6
7051   :
7052 else
7053   echo "$ac_t""no" 1>&6
7054 with_tiff=no
7055 fi
7056
7057  }
7058   test -z "$with_tiff" && with_tiff=yes
7059   if test "$with_tiff" = "yes"; then
7060     { test "$extra_verbose" = "yes" && cat << \EOF
7061     Defining HAVE_TIFF
7062 EOF
7063 cat >> confdefs.h <<\EOF
7064 #define HAVE_TIFF 1
7065 EOF
7066 }
7067
7068     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7069   fi
7070 fi
7071
7072
7073 if test "$with_x11" = "yes"; then
7074
7075   echo "checking for X11 graphics libraries" 1>&6
7076 echo "configure:7077: checking for X11 graphics libraries" >&5
7077
7078     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
7079 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
7080 echo "configure:7081: checking for compface.h" >&5
7081
7082 cat > conftest.$ac_ext <<EOF
7083 #line 7084 "configure"
7084 #include "confdefs.h"
7085 #include <compface.h>
7086 EOF
7087 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7088 { (eval echo configure:7089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7089 ac_err=`grep -v '^ *+' conftest.out`
7090 if test -z "$ac_err"; then
7091   rm -rf conftest*
7092   eval "ac_cv_header_$ac_safe=yes"
7093 else
7094   echo "$ac_err" >&5
7095   echo "configure: failed program was:" >&5
7096   cat conftest.$ac_ext >&5
7097   rm -rf conftest*
7098   eval "ac_cv_header_$ac_safe=no"
7099 fi
7100 rm -f conftest*
7101 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7102   echo "$ac_t""yes" 1>&6
7103   :
7104 else
7105   echo "$ac_t""no" 1>&6
7106 with_xface=no
7107 fi
7108  }
7109   test -z "$with_xface" && { 
7110 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
7111 echo "configure:7112: checking for UnGenFace in -lcompface" >&5
7112 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
7113
7114 xe_check_libs=" -lcompface "
7115 cat > conftest.$ac_ext <<EOF
7116 #line 7117 "configure"
7117 #include "confdefs.h"
7118 /* Override any gcc2 internal prototype to avoid an error.  */
7119 /* We use char because int might match the return type of a gcc2
7120     builtin and then its argument prototype would still apply.  */
7121 char UnGenFace();
7122
7123 int main() {
7124 UnGenFace()
7125 ; return 0; }
7126 EOF
7127 if { (eval echo configure:7128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7128   rm -rf conftest*
7129   eval "ac_cv_lib_$ac_lib_var=yes"
7130 else
7131   echo "configure: failed program was:" >&5
7132   cat conftest.$ac_ext >&5
7133   rm -rf conftest*
7134   eval "ac_cv_lib_$ac_lib_var=no"
7135 fi
7136 rm -f conftest*
7137 xe_check_libs=""
7138
7139 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7140   echo "$ac_t""yes" 1>&6
7141   : 
7142 else
7143   echo "$ac_t""no" 1>&6
7144 with_xface=no
7145 fi
7146
7147  }
7148   test -z "$with_xface" && with_xface=yes
7149   if test "$with_xface" = "yes"; then
7150     { test "$extra_verbose" = "yes" && cat << \EOF
7151     Defining HAVE_XFACE
7152 EOF
7153 cat >> confdefs.h <<\EOF
7154 #define HAVE_XFACE 1
7155 EOF
7156 }
7157
7158     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7159   fi
7160
7161     
7162 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7163 echo "configure:7164: checking for XawScrollbarSetThumb in -lXaw" >&5
7164 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7165
7166 xe_check_libs=" -lXaw "
7167 cat > conftest.$ac_ext <<EOF
7168 #line 7169 "configure"
7169 #include "confdefs.h"
7170 /* Override any gcc2 internal prototype to avoid an error.  */
7171 /* We use char because int might match the return type of a gcc2
7172     builtin and then its argument prototype would still apply.  */
7173 char XawScrollbarSetThumb();
7174
7175 int main() {
7176 XawScrollbarSetThumb()
7177 ; return 0; }
7178 EOF
7179 if { (eval echo configure:7180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7180   rm -rf conftest*
7181   eval "ac_cv_lib_$ac_lib_var=yes"
7182 else
7183   echo "configure: failed program was:" >&5
7184   cat conftest.$ac_ext >&5
7185   rm -rf conftest*
7186   eval "ac_cv_lib_$ac_lib_var=no"
7187 fi
7188 rm -f conftest*
7189 xe_check_libs=""
7190
7191 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7192   echo "$ac_t""yes" 1>&6
7193   have_xaw=yes
7194 else
7195   echo "$ac_t""no" 1>&6
7196 have_xaw=no
7197 fi
7198
7199
7200                     
7201     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7202 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7203 echo "configure:7204: checking for Xm/Xm.h" >&5
7204
7205 cat > conftest.$ac_ext <<EOF
7206 #line 7207 "configure"
7207 #include "confdefs.h"
7208 #include <Xm/Xm.h>
7209 EOF
7210 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7211 { (eval echo configure:7212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7212 ac_err=`grep -v '^ *+' conftest.out`
7213 if test -z "$ac_err"; then
7214   rm -rf conftest*
7215   eval "ac_cv_header_$ac_safe=yes"
7216 else
7217   echo "$ac_err" >&5
7218   echo "configure: failed program was:" >&5
7219   cat conftest.$ac_ext >&5
7220   rm -rf conftest*
7221   eval "ac_cv_header_$ac_safe=no"
7222 fi
7223 rm -f conftest*
7224 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7225   echo "$ac_t""yes" 1>&6
7226   
7227 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7228 echo "configure:7229: checking for XmStringFree in -lXm" >&5
7229 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7230
7231 xe_check_libs=" -lXm "
7232 cat > conftest.$ac_ext <<EOF
7233 #line 7234 "configure"
7234 #include "confdefs.h"
7235 /* Override any gcc2 internal prototype to avoid an error.  */
7236 /* We use char because int might match the return type of a gcc2
7237     builtin and then its argument prototype would still apply.  */
7238 char XmStringFree();
7239
7240 int main() {
7241 XmStringFree()
7242 ; return 0; }
7243 EOF
7244 if { (eval echo configure:7245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7245   rm -rf conftest*
7246   eval "ac_cv_lib_$ac_lib_var=yes"
7247 else
7248   echo "configure: failed program was:" >&5
7249   cat conftest.$ac_ext >&5
7250   rm -rf conftest*
7251   eval "ac_cv_lib_$ac_lib_var=no"
7252 fi
7253 rm -f conftest*
7254 xe_check_libs=""
7255
7256 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7257   echo "$ac_t""yes" 1>&6
7258   have_motif=yes
7259 else
7260   echo "$ac_t""no" 1>&6
7261 have_motif=no
7262 fi
7263
7264
7265 else
7266   echo "$ac_t""no" 1>&6
7267 have_motif=no
7268 fi
7269
7270
7271   if test "$have_motif" = "yes"; then
7272         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7273 echo "configure:7274: checking for Lesstif" >&5
7274     cat > conftest.$ac_ext <<EOF
7275 #line 7276 "configure"
7276 #include "confdefs.h"
7277 #include <Xm/Xm.h>
7278 #ifdef LESSTIF_VERSION
7279 yes
7280 #endif
7281
7282 EOF
7283 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7284   egrep "yes" >/dev/null 2>&1; then
7285   rm -rf conftest*
7286   have_lesstif=yes
7287 else
7288   rm -rf conftest*
7289   have_lesstif=no
7290 fi
7291 rm -f conftest*
7292
7293   echo "$ac_t""$have_lesstif" 1>&6
7294   fi
7295
7296 fi 
7297
7298 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7299   with_menubars="lucid" ;;
7300 esac
7301 case "$with_dialogs" in "" | "yes" | "lucid" )
7302   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7303   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7304   else with_dialogs=no
7305   fi ;;
7306 esac
7307 case "$with_scrollbars" in "" | "yes" )
7308   with_scrollbars="lucid" ;;
7309 esac
7310
7311 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7312
7313 case "$all_widgets" in *athena* )
7314   { test "$extra_verbose" = "yes" && cat << \EOF
7315     Defining LWLIB_USES_ATHENA
7316 EOF
7317 cat >> confdefs.h <<\EOF
7318 #define LWLIB_USES_ATHENA 1
7319 EOF
7320 }
7321
7322   { test "$extra_verbose" = "yes" && cat << \EOF
7323     Defining NEED_ATHENA
7324 EOF
7325 cat >> confdefs.h <<\EOF
7326 #define NEED_ATHENA 1
7327 EOF
7328 }
7329
7330   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7331   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7332 esac
7333
7334 case "$all_widgets" in *motif* )
7335   { test "$extra_verbose" = "yes" && cat << \EOF
7336     Defining LWLIB_USES_MOTIF
7337 EOF
7338 cat >> confdefs.h <<\EOF
7339 #define LWLIB_USES_MOTIF 1
7340 EOF
7341 }
7342
7343   { test "$extra_verbose" = "yes" && cat << \EOF
7344     Defining NEED_MOTIF
7345 EOF
7346 cat >> confdefs.h <<\EOF
7347 #define NEED_MOTIF 1
7348 EOF
7349 }
7350
7351   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7352   need_motif=yes ;;
7353 esac
7354
7355 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7356 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7357 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7358 case "$all_widgets" in *lucid* )
7359   { test "$extra_verbose" = "yes" && cat << \EOF
7360     Defining NEED_LUCID
7361 EOF
7362 cat >> confdefs.h <<\EOF
7363 #define NEED_LUCID 1
7364 EOF
7365 }
7366
7367   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7368 esac
7369
7370
7371
7372 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7373     Defining LWLIB_SCROLLBARS_ATHENA
7374 EOF
7375 cat >> confdefs.h <<\EOF
7376 #define LWLIB_SCROLLBARS_ATHENA 1
7377 EOF
7378 }
7379 ;; esac
7380 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7381     Defining LWLIB_DIALOGS_ATHENA
7382 EOF
7383 cat >> confdefs.h <<\EOF
7384 #define LWLIB_DIALOGS_ATHENA 1
7385 EOF
7386 }
7387    ;; esac
7388 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7389     Defining LWLIB_SCROLLBARS_ATHENA3D
7390 EOF
7391 cat >> confdefs.h <<\EOF
7392 #define LWLIB_SCROLLBARS_ATHENA3D 1
7393 EOF
7394 }
7395
7396 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7397     Defining LWLIB_DIALOGS_ATHENA3D
7398 EOF
7399 cat >> confdefs.h <<\EOF
7400 #define LWLIB_DIALOGS_ATHENA3D 1
7401 EOF
7402 }
7403
7404
7405 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7406     Defining HAVE_MENUBARS
7407 EOF
7408 cat >> confdefs.h <<\EOF
7409 #define HAVE_MENUBARS 1
7410 EOF
7411 }
7412
7413 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7414     Defining HAVE_SCROLLBARS
7415 EOF
7416 cat >> confdefs.h <<\EOF
7417 #define HAVE_SCROLLBARS 1
7418 EOF
7419 }
7420
7421 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7422     Defining HAVE_DIALOGS
7423 EOF
7424 cat >> confdefs.h <<\EOF
7425 #define HAVE_DIALOGS 1
7426 EOF
7427 }
7428
7429 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7430     Defining HAVE_TOOLBARS
7431 EOF
7432 cat >> confdefs.h <<\EOF
7433 #define HAVE_TOOLBARS 1
7434 EOF
7435 }
7436
7437
7438 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7439     Defining LWLIB_MENUBARS_LUCID
7440 EOF
7441 cat >> confdefs.h <<\EOF
7442 #define LWLIB_MENUBARS_LUCID 1
7443 EOF
7444 }
7445
7446 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7447     Defining LWLIB_SCROLLBARS_LUCID
7448 EOF
7449 cat >> confdefs.h <<\EOF
7450 #define LWLIB_SCROLLBARS_LUCID 1
7451 EOF
7452 }
7453
7454
7455 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7456     Defining LWLIB_MENUBARS_MOTIF
7457 EOF
7458 cat >> confdefs.h <<\EOF
7459 #define LWLIB_MENUBARS_MOTIF 1
7460 EOF
7461 }
7462
7463 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7464     Defining LWLIB_SCROLLBARS_MOTIF
7465 EOF
7466 cat >> confdefs.h <<\EOF
7467 #define LWLIB_SCROLLBARS_MOTIF 1
7468 EOF
7469 }
7470
7471 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7472     Defining LWLIB_DIALOGS_MOTIF
7473 EOF
7474 cat >> confdefs.h <<\EOF
7475 #define LWLIB_DIALOGS_MOTIF 1
7476 EOF
7477 }
7478
7479
7480 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7481    echo "    xemacs will be linked with \"menubar.o\""
7482  fi
7483 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7484    echo "    xemacs will be linked with \"scrollbar.o\""
7485  fi
7486 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7487    echo "    xemacs will be linked with \"dialog.o\""
7488  fi
7489 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7490    echo "    xemacs will be linked with \"toolbar.o\""
7491  fi
7492 test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" &&  if test "$extra_verbose" = "yes"; then
7493    echo "    xemacs will be linked with \"gui.o\""
7494  fi
7495
7496 if test "$with_x11" = "yes"; then
7497   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7498    echo "    xemacs will be linked with \"menubar-x.o\""
7499  fi
7500   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7501    echo "    xemacs will be linked with \"scrollbar-x.o\""
7502  fi
7503   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7504    echo "    xemacs will be linked with \"dialog-x.o\""
7505  fi
7506   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7507    echo "    xemacs will be linked with \"toolbar-x.o\""
7508  fi
7509   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7510    echo "    xemacs will be linked with \"gui-x.o\""
7511  fi
7512 else
7513   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7514     echo "Attempt to Build NAS sound without X"
7515     echo "Please remove NAS configuration or build with X"
7516     exit 1
7517   fi
7518 fi
7519
7520 test "$use_minimal_tagbits" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
7521     Defining USE_MINIMAL_TAGBITS
7522 EOF
7523 cat >> confdefs.h <<\EOF
7524 #define USE_MINIMAL_TAGBITS 1
7525 EOF
7526 }
7527
7528 test "$use_indexed_lrecord_implementation" = "yes" && \
7529   { test "$extra_verbose" = "yes" && cat << \EOF
7530     Defining USE_INDEXED_LRECORD_IMPLEMENTATION
7531 EOF
7532 cat >> confdefs.h <<\EOF
7533 #define USE_INDEXED_LRECORD_IMPLEMENTATION 1
7534 EOF
7535 }
7536
7537
7538
7539 test -z "$with_mule" && with_mule=no
7540 test -z "$with_file_coding" && with_file_coding=no
7541
7542
7543 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7544   { test "$extra_verbose" = "yes" && cat << \EOF
7545     Defining FILE_CODING
7546 EOF
7547 cat >> confdefs.h <<\EOF
7548 #define FILE_CODING 1
7549 EOF
7550 }
7551
7552   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7553    echo "    xemacs will be linked with \"file-coding.o\""
7554  fi
7555 fi
7556
7557 if test "$with_mule" = "yes" ; then
7558   echo "checking for Mule-related features" 1>&6
7559 echo "configure:7560: checking for Mule-related features" >&5
7560   { test "$extra_verbose" = "yes" && cat << \EOF
7561     Defining MULE
7562 EOF
7563 cat >> confdefs.h <<\EOF
7564 #define MULE 1
7565 EOF
7566 }
7567
7568   { test "$extra_verbose" = "yes" && cat << \EOF
7569     Defining FILE_CODING
7570 EOF
7571 cat >> confdefs.h <<\EOF
7572 #define FILE_CODING 1
7573 EOF
7574 }
7575
7576   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7577    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o\""
7578  fi
7579
7580     for ac_hdr in libintl.h
7581 do
7582 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7583 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7584 echo "configure:7585: checking for $ac_hdr" >&5
7585
7586 cat > conftest.$ac_ext <<EOF
7587 #line 7588 "configure"
7588 #include "confdefs.h"
7589 #include <$ac_hdr>
7590 EOF
7591 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7592 { (eval echo configure:7593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7593 ac_err=`grep -v '^ *+' conftest.out`
7594 if test -z "$ac_err"; then
7595   rm -rf conftest*
7596   eval "ac_cv_header_$ac_safe=yes"
7597 else
7598   echo "$ac_err" >&5
7599   echo "configure: failed program was:" >&5
7600   cat conftest.$ac_ext >&5
7601   rm -rf conftest*
7602   eval "ac_cv_header_$ac_safe=no"
7603 fi
7604 rm -f conftest*
7605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7606   echo "$ac_t""yes" 1>&6
7607     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7608   { test "$extra_verbose" = "yes" && cat << EOF
7609     Defining $ac_tr_hdr
7610 EOF
7611 cat >> confdefs.h <<EOF
7612 #define $ac_tr_hdr 1
7613 EOF
7614 }
7615  
7616 else
7617   echo "$ac_t""no" 1>&6
7618 fi
7619 done
7620
7621   
7622 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7623 echo "configure:7624: checking for strerror in -lintl" >&5
7624 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7625
7626 xe_check_libs=" -lintl "
7627 cat > conftest.$ac_ext <<EOF
7628 #line 7629 "configure"
7629 #include "confdefs.h"
7630 /* Override any gcc2 internal prototype to avoid an error.  */
7631 /* We use char because int might match the return type of a gcc2
7632     builtin and then its argument prototype would still apply.  */
7633 char strerror();
7634
7635 int main() {
7636 strerror()
7637 ; return 0; }
7638 EOF
7639 if { (eval echo configure:7640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7640   rm -rf conftest*
7641   eval "ac_cv_lib_$ac_lib_var=yes"
7642 else
7643   echo "configure: failed program was:" >&5
7644   cat conftest.$ac_ext >&5
7645   rm -rf conftest*
7646   eval "ac_cv_lib_$ac_lib_var=no"
7647 fi
7648 rm -f conftest*
7649 xe_check_libs=""
7650
7651 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7652   echo "$ac_t""yes" 1>&6
7653     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7654     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7655   { test "$extra_verbose" = "yes" && cat << EOF
7656     Defining $ac_tr_lib
7657 EOF
7658 cat >> confdefs.h <<EOF
7659 #define $ac_tr_lib 1
7660 EOF
7661 }
7662
7663   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7664
7665 else
7666   echo "$ac_t""no" 1>&6
7667 fi
7668
7669
7670
7671   echo "checking for Mule input methods" 1>&6
7672 echo "configure:7673: checking for Mule input methods" >&5
7673         case "$with_xim" in "" | "yes" )
7674     echo "checking for XIM" 1>&6
7675 echo "configure:7676: checking for XIM" >&5
7676         if test "$have_lesstif" = "yes"; then with_xim=xlib
7677     else 
7678 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7679 echo "configure:7680: checking for XmImMbLookupString in -lXm" >&5
7680 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7681
7682 xe_check_libs=" -lXm "
7683 cat > conftest.$ac_ext <<EOF
7684 #line 7685 "configure"
7685 #include "confdefs.h"
7686 /* Override any gcc2 internal prototype to avoid an error.  */
7687 /* We use char because int might match the return type of a gcc2
7688     builtin and then its argument prototype would still apply.  */
7689 char XmImMbLookupString();
7690
7691 int main() {
7692 XmImMbLookupString()
7693 ; return 0; }
7694 EOF
7695 if { (eval echo configure:7696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7696   rm -rf conftest*
7697   eval "ac_cv_lib_$ac_lib_var=yes"
7698 else
7699   echo "configure: failed program was:" >&5
7700   cat conftest.$ac_ext >&5
7701   rm -rf conftest*
7702   eval "ac_cv_lib_$ac_lib_var=no"
7703 fi
7704 rm -f conftest*
7705 xe_check_libs=""
7706
7707 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7708   echo "$ac_t""yes" 1>&6
7709   with_xim=motif
7710 else
7711   echo "$ac_t""no" 1>&6
7712 with_xim=xlib
7713 fi
7714
7715
7716     fi
7717   esac
7718   if test "$with_xim" != "no"; then
7719     { test "$extra_verbose" = "yes" && cat << \EOF
7720     Defining HAVE_XIM
7721 EOF
7722 cat >> confdefs.h <<\EOF
7723 #define HAVE_XIM 1
7724 EOF
7725 }
7726
7727     if test "$with_xim" = "xlib"; then
7728       { test "$extra_verbose" = "yes" && cat << \EOF
7729     Defining XIM_XLIB
7730 EOF
7731 cat >> confdefs.h <<\EOF
7732 #define XIM_XLIB 1
7733 EOF
7734 }
7735
7736       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7737    echo "    xemacs will be linked with \"input-method-xlib.o\""
7738  fi
7739     fi
7740     if test "$with_xim" = "motif"; then
7741       { test "$extra_verbose" = "yes" && cat << \EOF
7742     Defining XIM_MOTIF
7743 EOF
7744 cat >> confdefs.h <<\EOF
7745 #define XIM_MOTIF 1
7746 EOF
7747 }
7748
7749       need_motif=yes
7750       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7751    echo "    xemacs will be linked with \"input-method-motif.o\""
7752  fi
7753     fi
7754     if test "$with_xim" = "motif"; then
7755       with_xfs=no
7756     fi
7757   fi
7758
7759     if test "$with_xfs" = "yes" ; then
7760     echo "checking for XFontSet" 1>&6
7761 echo "configure:7762: checking for XFontSet" >&5
7762     
7763 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7764 echo "configure:7765: checking for XmbDrawString in -lX11" >&5
7765 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7766
7767 xe_check_libs=" -lX11 "
7768 cat > conftest.$ac_ext <<EOF
7769 #line 7770 "configure"
7770 #include "confdefs.h"
7771 /* Override any gcc2 internal prototype to avoid an error.  */
7772 /* We use char because int might match the return type of a gcc2
7773     builtin and then its argument prototype would still apply.  */
7774 char XmbDrawString();
7775
7776 int main() {
7777 XmbDrawString()
7778 ; return 0; }
7779 EOF
7780 if { (eval echo configure:7781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7781   rm -rf conftest*
7782   eval "ac_cv_lib_$ac_lib_var=yes"
7783 else
7784   echo "configure: failed program was:" >&5
7785   cat conftest.$ac_ext >&5
7786   rm -rf conftest*
7787   eval "ac_cv_lib_$ac_lib_var=no"
7788 fi
7789 rm -f conftest*
7790 xe_check_libs=""
7791
7792 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7793   echo "$ac_t""yes" 1>&6
7794   :
7795 else
7796   echo "$ac_t""no" 1>&6
7797 with_xfs=no
7798 fi
7799
7800
7801     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7802       { test "$extra_verbose" = "yes" && cat << \EOF
7803     Defining USE_XFONTSET
7804 EOF
7805 cat >> confdefs.h <<\EOF
7806 #define USE_XFONTSET 1
7807 EOF
7808 }
7809
7810       if test "$with_xim" = "no" ; then
7811         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
7812    echo "    xemacs will be linked with \"input-method-xfs.o\""
7813  fi
7814       fi
7815     fi
7816   fi 
7817     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
7818   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
7819 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
7820 echo "configure:7821: checking for wnn/jllib.h" >&5
7821
7822 cat > conftest.$ac_ext <<EOF
7823 #line 7824 "configure"
7824 #include "confdefs.h"
7825 #include <wnn/jllib.h>
7826 EOF
7827 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7828 { (eval echo configure:7829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7829 ac_err=`grep -v '^ *+' conftest.out`
7830 if test -z "$ac_err"; then
7831   rm -rf conftest*
7832   eval "ac_cv_header_$ac_safe=yes"
7833 else
7834   echo "$ac_err" >&5
7835   echo "configure: failed program was:" >&5
7836   cat conftest.$ac_ext >&5
7837   rm -rf conftest*
7838   eval "ac_cv_header_$ac_safe=no"
7839 fi
7840 rm -f conftest*
7841 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7842   echo "$ac_t""yes" 1>&6
7843   :
7844 else
7845   echo "$ac_t""no" 1>&6
7846 with_wnn=no
7847 fi
7848  }
7849     if test "$with_wnn" != "no"; then
7850     for ac_func in crypt
7851 do
7852 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7853 echo "configure:7854: checking for $ac_func" >&5
7854
7855 cat > conftest.$ac_ext <<EOF
7856 #line 7857 "configure"
7857 #include "confdefs.h"
7858 /* System header to define __stub macros and hopefully few prototypes,
7859     which can conflict with char $ac_func(); below.  */
7860 #include <assert.h>
7861 /* Override any gcc2 internal prototype to avoid an error.  */
7862 /* We use char because int might match the return type of a gcc2
7863     builtin and then its argument prototype would still apply.  */
7864 char $ac_func();
7865
7866 int main() {
7867
7868 /* The GNU C library defines this for functions which it implements
7869     to always fail with ENOSYS.  Some functions are actually named
7870     something starting with __ and the normal name is an alias.  */
7871 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7872 choke me
7873 #else
7874 $ac_func();
7875 #endif
7876
7877 ; return 0; }
7878 EOF
7879 if { (eval echo configure:7880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7880   rm -rf conftest*
7881   eval "ac_cv_func_$ac_func=yes"
7882 else
7883   echo "configure: failed program was:" >&5
7884   cat conftest.$ac_ext >&5
7885   rm -rf conftest*
7886   eval "ac_cv_func_$ac_func=no"
7887 fi
7888 rm -f conftest*
7889
7890 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7891   echo "$ac_t""yes" 1>&6
7892     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7893   { test "$extra_verbose" = "yes" && cat << EOF
7894     Defining $ac_tr_func
7895 EOF
7896 cat >> confdefs.h <<EOF
7897 #define $ac_tr_func 1
7898 EOF
7899 }
7900  
7901 else
7902   echo "$ac_t""no" 1>&6
7903 fi
7904 done
7905
7906     test "$ac_cv_func_crypt" != "yes" && { 
7907 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7908 echo "configure:7909: checking for crypt in -lcrypt" >&5
7909 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7910
7911 xe_check_libs=" -lcrypt "
7912 cat > conftest.$ac_ext <<EOF
7913 #line 7914 "configure"
7914 #include "confdefs.h"
7915 /* Override any gcc2 internal prototype to avoid an error.  */
7916 /* We use char because int might match the return type of a gcc2
7917     builtin and then its argument prototype would still apply.  */
7918 char crypt();
7919
7920 int main() {
7921 crypt()
7922 ; return 0; }
7923 EOF
7924 if { (eval echo configure:7925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7925   rm -rf conftest*
7926   eval "ac_cv_lib_$ac_lib_var=yes"
7927 else
7928   echo "configure: failed program was:" >&5
7929   cat conftest.$ac_ext >&5
7930   rm -rf conftest*
7931   eval "ac_cv_lib_$ac_lib_var=no"
7932 fi
7933 rm -f conftest*
7934 xe_check_libs=""
7935
7936 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7937   echo "$ac_t""yes" 1>&6
7938     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7939     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7940   { test "$extra_verbose" = "yes" && cat << EOF
7941     Defining $ac_tr_lib
7942 EOF
7943 cat >> confdefs.h <<EOF
7944 #define $ac_tr_lib 1
7945 EOF
7946 }
7947
7948   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
7949
7950 else
7951   echo "$ac_t""no" 1>&6
7952 fi
7953
7954  }
7955   fi
7956     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
7957     
7958 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
7959 echo "configure:7960: checking for jl_dic_list_e in -lwnn" >&5
7960 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7961
7962 xe_check_libs=" -lwnn "
7963 cat > conftest.$ac_ext <<EOF
7964 #line 7965 "configure"
7965 #include "confdefs.h"
7966 /* Override any gcc2 internal prototype to avoid an error.  */
7967 /* We use char because int might match the return type of a gcc2
7968     builtin and then its argument prototype would still apply.  */
7969 char jl_dic_list_e();
7970
7971 int main() {
7972 jl_dic_list_e()
7973 ; return 0; }
7974 EOF
7975 if { (eval echo configure:7976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7976   rm -rf conftest*
7977   eval "ac_cv_lib_$ac_lib_var=yes"
7978 else
7979   echo "configure: failed program was:" >&5
7980   cat conftest.$ac_ext >&5
7981   rm -rf conftest*
7982   eval "ac_cv_lib_$ac_lib_var=no"
7983 fi
7984 rm -f conftest*
7985 xe_check_libs=""
7986
7987 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7988   echo "$ac_t""yes" 1>&6
7989   libwnn=wnn
7990 else
7991   echo "$ac_t""no" 1>&6
7992 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
7993 echo "configure:7994: checking for jl_dic_list_e in -lwnn4" >&5
7994 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7995
7996 xe_check_libs=" -lwnn4 "
7997 cat > conftest.$ac_ext <<EOF
7998 #line 7999 "configure"
7999 #include "confdefs.h"
8000 /* Override any gcc2 internal prototype to avoid an error.  */
8001 /* We use char because int might match the return type of a gcc2
8002     builtin and then its argument prototype would still apply.  */
8003 char jl_dic_list_e();
8004
8005 int main() {
8006 jl_dic_list_e()
8007 ; return 0; }
8008 EOF
8009 if { (eval echo configure:8010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8010   rm -rf conftest*
8011   eval "ac_cv_lib_$ac_lib_var=yes"
8012 else
8013   echo "configure: failed program was:" >&5
8014   cat conftest.$ac_ext >&5
8015   rm -rf conftest*
8016   eval "ac_cv_lib_$ac_lib_var=no"
8017 fi
8018 rm -f conftest*
8019 xe_check_libs=""
8020
8021 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8022   echo "$ac_t""yes" 1>&6
8023   libwnn=wnn4
8024 else
8025   echo "$ac_t""no" 1>&6
8026 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8027 echo "configure:8028: checking for jl_dic_list_e in -lwnn6" >&5
8028 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8029
8030 xe_check_libs=" -lwnn6 "
8031 cat > conftest.$ac_ext <<EOF
8032 #line 8033 "configure"
8033 #include "confdefs.h"
8034 /* Override any gcc2 internal prototype to avoid an error.  */
8035 /* We use char because int might match the return type of a gcc2
8036     builtin and then its argument prototype would still apply.  */
8037 char jl_dic_list_e();
8038
8039 int main() {
8040 jl_dic_list_e()
8041 ; return 0; }
8042 EOF
8043 if { (eval echo configure:8044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8044   rm -rf conftest*
8045   eval "ac_cv_lib_$ac_lib_var=yes"
8046 else
8047   echo "configure: failed program was:" >&5
8048   cat conftest.$ac_ext >&5
8049   rm -rf conftest*
8050   eval "ac_cv_lib_$ac_lib_var=no"
8051 fi
8052 rm -f conftest*
8053 xe_check_libs=""
8054
8055 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8056   echo "$ac_t""yes" 1>&6
8057   libwnn=wnn6
8058 else
8059   echo "$ac_t""no" 1>&6
8060 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8061 echo "configure:8062: checking for dic_list_e in -lwnn6_fromsrc" >&5
8062 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8063
8064 xe_check_libs=" -lwnn6_fromsrc "
8065 cat > conftest.$ac_ext <<EOF
8066 #line 8067 "configure"
8067 #include "confdefs.h"
8068 /* Override any gcc2 internal prototype to avoid an error.  */
8069 /* We use char because int might match the return type of a gcc2
8070     builtin and then its argument prototype would still apply.  */
8071 char dic_list_e();
8072
8073 int main() {
8074 dic_list_e()
8075 ; return 0; }
8076 EOF
8077 if { (eval echo configure:8078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8078   rm -rf conftest*
8079   eval "ac_cv_lib_$ac_lib_var=yes"
8080 else
8081   echo "configure: failed program was:" >&5
8082   cat conftest.$ac_ext >&5
8083   rm -rf conftest*
8084   eval "ac_cv_lib_$ac_lib_var=no"
8085 fi
8086 rm -f conftest*
8087 xe_check_libs=""
8088
8089 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8090   echo "$ac_t""yes" 1>&6
8091   libwnn=wnn6_fromsrc
8092 else
8093   echo "$ac_t""no" 1>&6
8094 with_wnn=no
8095 fi
8096
8097
8098 fi
8099
8100
8101 fi
8102
8103
8104 fi
8105
8106
8107   fi
8108   test -z "$with_wnn" && with_wnn=yes
8109   if test "$with_wnn" = "yes"; then
8110     { test "$extra_verbose" = "yes" && cat << \EOF
8111     Defining HAVE_WNN
8112 EOF
8113 cat >> confdefs.h <<\EOF
8114 #define HAVE_WNN 1
8115 EOF
8116 }
8117
8118     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8119     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8120    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8121  fi
8122     if test "$with_wnn6" != "no"; then
8123       
8124 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8125 echo "configure:8126: checking for jl_fi_dic_list in -l$libwnn" >&5
8126 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8127
8128 xe_check_libs=" -l$libwnn "
8129 cat > conftest.$ac_ext <<EOF
8130 #line 8131 "configure"
8131 #include "confdefs.h"
8132 /* Override any gcc2 internal prototype to avoid an error.  */
8133 /* We use char because int might match the return type of a gcc2
8134     builtin and then its argument prototype would still apply.  */
8135 char jl_fi_dic_list();
8136
8137 int main() {
8138 jl_fi_dic_list()
8139 ; return 0; }
8140 EOF
8141 if { (eval echo configure:8142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8142   rm -rf conftest*
8143   eval "ac_cv_lib_$ac_lib_var=yes"
8144 else
8145   echo "configure: failed program was:" >&5
8146   cat conftest.$ac_ext >&5
8147   rm -rf conftest*
8148   eval "ac_cv_lib_$ac_lib_var=no"
8149 fi
8150 rm -f conftest*
8151 xe_check_libs=""
8152
8153 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8154   echo "$ac_t""yes" 1>&6
8155   with_wnn6=yes
8156 else
8157   echo "$ac_t""no" 1>&6
8158 fi
8159
8160
8161       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8162     Defining WNN6
8163 EOF
8164 cat >> confdefs.h <<\EOF
8165 #define WNN6 1
8166 EOF
8167 }
8168
8169     fi
8170   fi
8171
8172     canna_includes_found=no
8173   if test "$with_canna" != "no"; then
8174     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8175 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8176 echo "configure:8177: checking for canna/jrkanji.h" >&5
8177
8178 cat > conftest.$ac_ext <<EOF
8179 #line 8180 "configure"
8180 #include "confdefs.h"
8181 #include <canna/jrkanji.h>
8182 EOF
8183 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8184 { (eval echo configure:8185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8185 ac_err=`grep -v '^ *+' conftest.out`
8186 if test -z "$ac_err"; then
8187   rm -rf conftest*
8188   eval "ac_cv_header_$ac_safe=yes"
8189 else
8190   echo "$ac_err" >&5
8191   echo "configure: failed program was:" >&5
8192   cat conftest.$ac_ext >&5
8193   rm -rf conftest*
8194   eval "ac_cv_header_$ac_safe=no"
8195 fi
8196 rm -f conftest*
8197 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8198   echo "$ac_t""yes" 1>&6
8199   canna_includes_found=yes
8200 else
8201   echo "$ac_t""no" 1>&6
8202 fi
8203
8204   fi
8205   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8206       -d "/usr/local/canna/include"; then
8207     save_c_switch_site="$c_switch_site"
8208     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8209     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8210 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8211 echo "configure:8212: checking for canna/jrkanji.h" >&5
8212
8213 cat > conftest.$ac_ext <<EOF
8214 #line 8215 "configure"
8215 #include "confdefs.h"
8216 #include <canna/jrkanji.h>
8217 EOF
8218 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8219 { (eval echo configure:8220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8220 ac_err=`grep -v '^ *+' conftest.out`
8221 if test -z "$ac_err"; then
8222   rm -rf conftest*
8223   eval "ac_cv_header_$ac_safe=yes"
8224 else
8225   echo "$ac_err" >&5
8226   echo "configure: failed program was:" >&5
8227   cat conftest.$ac_ext >&5
8228   rm -rf conftest*
8229   eval "ac_cv_header_$ac_safe=no"
8230 fi
8231 rm -f conftest*
8232 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8233   echo "$ac_t""yes" 1>&6
8234   canna_includes_found=yes
8235 else
8236   echo "$ac_t""no" 1>&6
8237 fi
8238
8239     if test "$canna_includes_found" != "yes"; then
8240       c_switch_site="$save_c_switch_site"
8241       with_canna="no"
8242     fi
8243   fi
8244
8245   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8246 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8247 echo "configure:8248: checking for canna/RK.h" >&5
8248
8249 cat > conftest.$ac_ext <<EOF
8250 #line 8251 "configure"
8251 #include "confdefs.h"
8252 #include <canna/RK.h>
8253 EOF
8254 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8255 { (eval echo configure:8256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8256 ac_err=`grep -v '^ *+' conftest.out`
8257 if test -z "$ac_err"; then
8258   rm -rf conftest*
8259   eval "ac_cv_header_$ac_safe=yes"
8260 else
8261   echo "$ac_err" >&5
8262   echo "configure: failed program was:" >&5
8263   cat conftest.$ac_ext >&5
8264   rm -rf conftest*
8265   eval "ac_cv_header_$ac_safe=no"
8266 fi
8267 rm -f conftest*
8268 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8269   echo "$ac_t""yes" 1>&6
8270   :
8271 else
8272   echo "$ac_t""no" 1>&6
8273 with_canna=no
8274 fi
8275  }
8276   test -z "$with_canna" && { 
8277 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8278 echo "configure:8279: checking for RkBgnBun in -lRKC" >&5
8279 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8280
8281 xe_check_libs=" -lRKC "
8282 cat > conftest.$ac_ext <<EOF
8283 #line 8284 "configure"
8284 #include "confdefs.h"
8285 /* Override any gcc2 internal prototype to avoid an error.  */
8286 /* We use char because int might match the return type of a gcc2
8287     builtin and then its argument prototype would still apply.  */
8288 char RkBgnBun();
8289
8290 int main() {
8291 RkBgnBun()
8292 ; return 0; }
8293 EOF
8294 if { (eval echo configure:8295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8295   rm -rf conftest*
8296   eval "ac_cv_lib_$ac_lib_var=yes"
8297 else
8298   echo "configure: failed program was:" >&5
8299   cat conftest.$ac_ext >&5
8300   rm -rf conftest*
8301   eval "ac_cv_lib_$ac_lib_var=no"
8302 fi
8303 rm -f conftest*
8304 xe_check_libs=""
8305
8306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8307   echo "$ac_t""yes" 1>&6
8308   :
8309 else
8310   echo "$ac_t""no" 1>&6
8311 with_canna=no
8312 fi
8313
8314  }
8315   test -z "$with_canna" && { 
8316 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8317 echo "configure:8318: checking for jrKanjiControl in -lcanna" >&5
8318 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8319
8320 xe_check_libs=" -lcanna "
8321 cat > conftest.$ac_ext <<EOF
8322 #line 8323 "configure"
8323 #include "confdefs.h"
8324 /* Override any gcc2 internal prototype to avoid an error.  */
8325 /* We use char because int might match the return type of a gcc2
8326     builtin and then its argument prototype would still apply.  */
8327 char jrKanjiControl();
8328
8329 int main() {
8330 jrKanjiControl()
8331 ; return 0; }
8332 EOF
8333 if { (eval echo configure:8334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8334   rm -rf conftest*
8335   eval "ac_cv_lib_$ac_lib_var=yes"
8336 else
8337   echo "configure: failed program was:" >&5
8338   cat conftest.$ac_ext >&5
8339   rm -rf conftest*
8340   eval "ac_cv_lib_$ac_lib_var=no"
8341 fi
8342 rm -f conftest*
8343 xe_check_libs=""
8344
8345 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8346   echo "$ac_t""yes" 1>&6
8347   :
8348 else
8349   echo "$ac_t""no" 1>&6
8350 with_canna=no
8351 fi
8352
8353  }
8354   test -z "$with_canna" && with_canna=yes
8355   if test "$with_canna" = "yes"; then
8356     { test "$extra_verbose" = "yes" && cat << \EOF
8357     Defining HAVE_CANNA
8358 EOF
8359 cat >> confdefs.h <<\EOF
8360 #define HAVE_CANNA 1
8361 EOF
8362 }
8363
8364     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8365     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8366    echo "    xemacs will be linked with \"mule-canna.o\""
8367  fi
8368   fi
8369
8370 else   for feature in xim canna wnn; do
8371     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8372       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8373     fi
8374     eval "with_${feature}=no"
8375   done
8376 fi 
8377
8378 if test "$need_motif" = "yes" ; then
8379   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8380     
8381 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8382 echo "configure:8383: checking for layout_object_getvalue in -li18n" >&5
8383 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8384
8385 xe_check_libs=" -li18n "
8386 cat > conftest.$ac_ext <<EOF
8387 #line 8388 "configure"
8388 #include "confdefs.h"
8389 /* Override any gcc2 internal prototype to avoid an error.  */
8390 /* We use char because int might match the return type of a gcc2
8391     builtin and then its argument prototype would still apply.  */
8392 char layout_object_getvalue();
8393
8394 int main() {
8395 layout_object_getvalue()
8396 ; return 0; }
8397 EOF
8398 if { (eval echo configure:8399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8399   rm -rf conftest*
8400   eval "ac_cv_lib_$ac_lib_var=yes"
8401 else
8402   echo "configure: failed program was:" >&5
8403   cat conftest.$ac_ext >&5
8404   rm -rf conftest*
8405   eval "ac_cv_lib_$ac_lib_var=no"
8406 fi
8407 rm -f conftest*
8408 xe_check_libs=""
8409
8410 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8411   echo "$ac_t""yes" 1>&6
8412   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8413 else
8414   echo "$ac_t""no" 1>&6
8415 fi
8416
8417
8418   
8419 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8420     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8421   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8422   
8423         runpath="" runpath_dirs=""
8424   if test -n "$LD_RUN_PATH"; then
8425     runpath="$LD_RUN_PATH"
8426   elif test "$GCC" = "yes"; then
8427         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8428     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8429     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8430     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8431       case "$arg" in P,* | -L* | -R* )
8432         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8433           {
8434 xe_runpath_dir="$dir"
8435   test "$xe_runpath_dir" != "/lib"     -a \
8436         "$xe_runpath_dir" != "/usr/lib" -a \
8437         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8438   eval "$xe_add_unique_runpath_dir"
8439 }
8440         done ;;
8441       esac
8442     done
8443     ld_switch_run="$ld_switch_run_save"
8444     rm -f conftest*
8445   else
8446         for arg in $ld_switch_site $ld_switch_x_site; do
8447       case "$arg" in -L*) {
8448 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8449   test "$xe_runpath_dir" != "/lib"     -a \
8450         "$xe_runpath_dir" != "/usr/lib" -a \
8451         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8452   eval "$xe_add_unique_runpath_dir"
8453 };; esac
8454     done
8455         if test "$opsys $need_motif" = "sol2 yes"; then
8456       xe_runpath_dir="/opt/SUNWdt/lib";
8457       eval "$xe_add_unique_runpath_dir";
8458     fi
8459   fi 
8460   if test -n "$runpath"; then
8461     ld_switch_run="${dash_r}${runpath}"
8462     
8463 if test "$GCC" = "yes"; then
8464   set x $ld_switch_run; shift; ld_switch_run=""
8465   while test -n "$1"; do
8466     case $1 in
8467       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8468       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8469       -Xlinker* ) ;;
8470       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8471     esac
8472     shift
8473   done
8474 fi
8475     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8476   fi
8477 fi
8478
8479 fi
8480
8481 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
8482 do
8483 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8484 echo "configure:8485: checking for $ac_func" >&5
8485
8486 cat > conftest.$ac_ext <<EOF
8487 #line 8488 "configure"
8488 #include "confdefs.h"
8489 /* System header to define __stub macros and hopefully few prototypes,
8490     which can conflict with char $ac_func(); below.  */
8491 #include <assert.h>
8492 /* Override any gcc2 internal prototype to avoid an error.  */
8493 /* We use char because int might match the return type of a gcc2
8494     builtin and then its argument prototype would still apply.  */
8495 char $ac_func();
8496
8497 int main() {
8498
8499 /* The GNU C library defines this for functions which it implements
8500     to always fail with ENOSYS.  Some functions are actually named
8501     something starting with __ and the normal name is an alias.  */
8502 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8503 choke me
8504 #else
8505 $ac_func();
8506 #endif
8507
8508 ; return 0; }
8509 EOF
8510 if { (eval echo configure:8511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8511   rm -rf conftest*
8512   eval "ac_cv_func_$ac_func=yes"
8513 else
8514   echo "configure: failed program was:" >&5
8515   cat conftest.$ac_ext >&5
8516   rm -rf conftest*
8517   eval "ac_cv_func_$ac_func=no"
8518 fi
8519 rm -f conftest*
8520
8521 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8522   echo "$ac_t""yes" 1>&6
8523     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8524   { test "$extra_verbose" = "yes" && cat << EOF
8525     Defining $ac_tr_func
8526 EOF
8527 cat >> confdefs.h <<EOF
8528 #define $ac_tr_func 1
8529 EOF
8530 }
8531  
8532 else
8533   echo "$ac_t""no" 1>&6
8534 fi
8535 done
8536
8537
8538
8539 case "$opsys" in
8540   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8541    echo "    xemacs will be linked with \"realpath.o\""
8542  fi ;;
8543   * )
8544     case "$canonical" in
8545       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8546    echo "    xemacs will be linked with \"realpath.o\""
8547  fi ;;
8548       * ) for ac_func in realpath
8549 do
8550 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8551 echo "configure:8552: checking for $ac_func" >&5
8552
8553 cat > conftest.$ac_ext <<EOF
8554 #line 8555 "configure"
8555 #include "confdefs.h"
8556 /* System header to define __stub macros and hopefully few prototypes,
8557     which can conflict with char $ac_func(); below.  */
8558 #include <assert.h>
8559 /* Override any gcc2 internal prototype to avoid an error.  */
8560 /* We use char because int might match the return type of a gcc2
8561     builtin and then its argument prototype would still apply.  */
8562 char $ac_func();
8563
8564 int main() {
8565
8566 /* The GNU C library defines this for functions which it implements
8567     to always fail with ENOSYS.  Some functions are actually named
8568     something starting with __ and the normal name is an alias.  */
8569 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8570 choke me
8571 #else
8572 $ac_func();
8573 #endif
8574
8575 ; return 0; }
8576 EOF
8577 if { (eval echo configure:8578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8578   rm -rf conftest*
8579   eval "ac_cv_func_$ac_func=yes"
8580 else
8581   echo "configure: failed program was:" >&5
8582   cat conftest.$ac_ext >&5
8583   rm -rf conftest*
8584   eval "ac_cv_func_$ac_func=no"
8585 fi
8586 rm -f conftest*
8587
8588 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8589   echo "$ac_t""yes" 1>&6
8590     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8591   { test "$extra_verbose" = "yes" && cat << EOF
8592     Defining $ac_tr_func
8593 EOF
8594 cat >> confdefs.h <<EOF
8595 #define $ac_tr_func 1
8596 EOF
8597 }
8598  
8599 else
8600   echo "$ac_t""no" 1>&6
8601 fi
8602 done
8603
8604           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8605    echo "    xemacs will be linked with \"realpath.o\""
8606  fi ;;
8607     esac ;;
8608 esac
8609
8610 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8611 echo "configure:8612: checking whether netdb declares h_errno" >&5
8612 cat > conftest.$ac_ext <<EOF
8613 #line 8614 "configure"
8614 #include "confdefs.h"
8615 #include <netdb.h>
8616 int main() {
8617 return h_errno;
8618 ; return 0; }
8619 EOF
8620 if { (eval echo configure:8621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8621   rm -rf conftest*
8622   echo "$ac_t""yes" 1>&6
8623    { test "$extra_verbose" = "yes" && cat << \EOF
8624     Defining HAVE_H_ERRNO
8625 EOF
8626 cat >> confdefs.h <<\EOF
8627 #define HAVE_H_ERRNO 1
8628 EOF
8629 }
8630
8631 else
8632   echo "configure: failed program was:" >&5
8633   cat conftest.$ac_ext >&5
8634   rm -rf conftest*
8635   echo "$ac_t""no" 1>&6
8636 fi
8637 rm -f conftest*
8638
8639 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8640 echo "configure:8641: checking for sigsetjmp" >&5
8641 cat > conftest.$ac_ext <<EOF
8642 #line 8643 "configure"
8643 #include "confdefs.h"
8644 #include <setjmp.h>
8645 int main() {
8646 sigjmp_buf bar; sigsetjmp (bar, 0);
8647 ; return 0; }
8648 EOF
8649 if { (eval echo configure:8650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8650   rm -rf conftest*
8651   echo "$ac_t""yes" 1>&6
8652    { test "$extra_verbose" = "yes" && cat << \EOF
8653     Defining HAVE_SIGSETJMP
8654 EOF
8655 cat >> confdefs.h <<\EOF
8656 #define HAVE_SIGSETJMP 1
8657 EOF
8658 }
8659
8660 else
8661   echo "configure: failed program was:" >&5
8662   cat conftest.$ac_ext >&5
8663   rm -rf conftest*
8664   echo "$ac_t""no" 1>&6
8665 fi
8666 rm -f conftest*
8667
8668 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
8669 echo "configure:8670: checking whether localtime caches TZ" >&5
8670
8671 if test "$ac_cv_func_tzset" = "yes"; then
8672 cat > conftest.$ac_ext <<EOF
8673 #line 8674 "configure"
8674 #include "confdefs.h"
8675 #include <time.h>
8676 #if STDC_HEADERS
8677 # include <stdlib.h>
8678 #endif
8679 extern char **environ;
8680 unset_TZ ()
8681 {
8682   char **from, **to;
8683   for (to = from = environ; (*to = *from); from++)
8684     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
8685       to++;
8686 }
8687 char TZ_GMT0[] = "TZ=GMT0";
8688 char TZ_PST8[] = "TZ=PST8";
8689 main()
8690 {
8691   time_t now = time ((time_t *) 0);
8692   int hour_GMT0, hour_unset;
8693   if (putenv (TZ_GMT0) != 0)
8694     exit (1);
8695   hour_GMT0 = localtime (&now)->tm_hour;
8696   unset_TZ ();
8697   hour_unset = localtime (&now)->tm_hour;
8698   if (putenv (TZ_PST8) != 0)
8699     exit (1);
8700   if (localtime (&now)->tm_hour == hour_GMT0)
8701     exit (1);
8702   unset_TZ ();
8703   if (localtime (&now)->tm_hour != hour_unset)
8704     exit (1);
8705   exit (0);
8706 }
8707 EOF
8708 if { (eval echo configure:8709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8709 then
8710   emacs_cv_localtime_cache=no
8711 else
8712   conftest_rc="$?"
8713   echo "configure: failed program was:" >&5
8714   cat conftest.$ac_ext >&5
8715   rm -fr conftest*
8716   emacs_cv_localtime_cache=yes
8717 fi
8718 rm -fr conftest*
8719 else
8720         # If we lack tzset, report that localtime does not cache TZ,
8721         # since we can't invalidate the cache if we don't have tzset.
8722         emacs_cv_localtime_cache=no
8723 fi
8724 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
8725 if test $emacs_cv_localtime_cache = yes; then
8726   { test "$extra_verbose" = "yes" && cat << \EOF
8727     Defining LOCALTIME_CACHE
8728 EOF
8729 cat >> confdefs.h <<\EOF
8730 #define LOCALTIME_CACHE 1
8731 EOF
8732 }
8733
8734 fi
8735
8736 if test "$HAVE_TIMEVAL" = "yes"; then
8737 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
8738 echo "configure:8739: checking whether gettimeofday accepts one or two arguments" >&5
8739 cat > conftest.$ac_ext <<EOF
8740 #line 8741 "configure"
8741 #include "confdefs.h"
8742
8743 #ifdef TIME_WITH_SYS_TIME
8744 #include <sys/time.h>
8745 #include <time.h>
8746 #else
8747 #ifdef HAVE_SYS_TIME_H
8748 #include <sys/time.h>
8749 #else
8750 #include <time.h>
8751 #endif
8752 #endif
8753   
8754 int main() {
8755
8756   struct timeval time;
8757   struct timezone dummy;
8758   gettimeofday (&time, &dummy);
8759
8760 ; return 0; }
8761 EOF
8762 if { (eval echo configure:8763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8763   rm -rf conftest*
8764   echo "$ac_t""two" 1>&6
8765 else
8766   echo "configure: failed program was:" >&5
8767   cat conftest.$ac_ext >&5
8768   rm -rf conftest*
8769   echo "$ac_t""one" 1>&6
8770    { test "$extra_verbose" = "yes" && cat << \EOF
8771     Defining GETTIMEOFDAY_ONE_ARGUMENT
8772 EOF
8773 cat >> confdefs.h <<\EOF
8774 #define GETTIMEOFDAY_ONE_ARGUMENT 1
8775 EOF
8776 }
8777
8778 fi
8779 rm -f conftest*
8780 fi
8781
8782
8783 echo $ac_n "checking for inline""... $ac_c" 1>&6
8784 echo "configure:8785: checking for inline" >&5
8785
8786 ac_cv_c_inline=no
8787 for ac_kw in inline __inline__ __inline; do
8788   cat > conftest.$ac_ext <<EOF
8789 #line 8790 "configure"
8790 #include "confdefs.h"
8791
8792 int main() {
8793 } $ac_kw foo() {
8794 ; return 0; }
8795 EOF
8796 if { (eval echo configure:8797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8797   rm -rf conftest*
8798   ac_cv_c_inline=$ac_kw; break
8799 else
8800   echo "configure: failed program was:" >&5
8801   cat conftest.$ac_ext >&5
8802 fi
8803 rm -f conftest*
8804 done
8805
8806
8807 echo "$ac_t""$ac_cv_c_inline" 1>&6
8808 case "$ac_cv_c_inline" in
8809   inline | yes) ;;
8810   no) { test "$extra_verbose" = "yes" && cat << \EOF
8811     Defining inline = 
8812 EOF
8813 cat >> confdefs.h <<\EOF
8814 #define inline 
8815 EOF
8816 }
8817  ;;
8818   *)  { test "$extra_verbose" = "yes" && cat << EOF
8819     Defining inline = $ac_cv_c_inline
8820 EOF
8821 cat >> confdefs.h <<EOF
8822 #define inline $ac_cv_c_inline
8823 EOF
8824 }
8825  ;;
8826 esac
8827
8828 if test "$ac_cv_c_inline" != "no"; then
8829   { test "$extra_verbose" = "yes" && cat << \EOF
8830     Defining HAVE_INLINE
8831 EOF
8832 cat >> confdefs.h <<\EOF
8833 #define HAVE_INLINE 1
8834 EOF
8835 }
8836
8837   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
8838    echo "    xemacs will be linked with \"inline.o\""
8839  fi
8840 fi
8841
8842
8843 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
8844 # for constant arguments.  Useless!
8845 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
8846 echo "configure:8847: checking for working alloca.h" >&5
8847
8848 cat > conftest.$ac_ext <<EOF
8849 #line 8850 "configure"
8850 #include "confdefs.h"
8851 #include <alloca.h>
8852 int main() {
8853 char *p = alloca(2 * sizeof(int));
8854 ; return 0; }
8855 EOF
8856 if { (eval echo configure:8857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8857   rm -rf conftest*
8858   ac_cv_header_alloca_h=yes
8859 else
8860   echo "configure: failed program was:" >&5
8861   cat conftest.$ac_ext >&5
8862   rm -rf conftest*
8863   ac_cv_header_alloca_h=no
8864 fi
8865 rm -f conftest*
8866
8867 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
8868 if test $ac_cv_header_alloca_h = yes; then
8869   { test "$extra_verbose" = "yes" && cat << \EOF
8870     Defining HAVE_ALLOCA_H
8871 EOF
8872 cat >> confdefs.h <<\EOF
8873 #define HAVE_ALLOCA_H 1
8874 EOF
8875 }
8876
8877 fi
8878
8879 echo $ac_n "checking for alloca""... $ac_c" 1>&6
8880 echo "configure:8881: checking for alloca" >&5
8881
8882 cat > conftest.$ac_ext <<EOF
8883 #line 8884 "configure"
8884 #include "confdefs.h"
8885
8886 #ifdef __GNUC__
8887 # define alloca __builtin_alloca
8888 #else
8889 # if HAVE_ALLOCA_H
8890 #  include <alloca.h>
8891 # else
8892 #  ifdef _AIX
8893  #pragma alloca
8894 #  else
8895 #   ifndef alloca /* predefined by HP cc +Olibcalls */
8896 char *alloca ();
8897 #   endif
8898 #  endif
8899 # endif
8900 #endif
8901
8902 int main() {
8903 char *p = (char *) alloca(1);
8904 ; return 0; }
8905 EOF
8906 if { (eval echo configure:8907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8907   rm -rf conftest*
8908   ac_cv_func_alloca_works=yes
8909 else
8910   echo "configure: failed program was:" >&5
8911   cat conftest.$ac_ext >&5
8912   rm -rf conftest*
8913   ac_cv_func_alloca_works=no
8914 fi
8915 rm -f conftest*
8916
8917 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
8918 if test $ac_cv_func_alloca_works = yes; then
8919   { test "$extra_verbose" = "yes" && cat << \EOF
8920     Defining HAVE_ALLOCA
8921 EOF
8922 cat >> confdefs.h <<\EOF
8923 #define HAVE_ALLOCA 1
8924 EOF
8925 }
8926
8927 fi
8928
8929 if test $ac_cv_func_alloca_works = no; then
8930   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
8931   # that cause trouble.  Some versions do not even contain alloca or
8932   # contain a buggy version.  If you still want to use their alloca,
8933   # use ar to extract alloca.o from them instead of compiling alloca.c.
8934   ALLOCA=alloca.o
8935   { test "$extra_verbose" = "yes" && cat << \EOF
8936     Defining C_ALLOCA
8937 EOF
8938 cat >> confdefs.h <<\EOF
8939 #define C_ALLOCA 1
8940 EOF
8941 }
8942
8943
8944 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
8945 echo "configure:8946: checking whether alloca needs Cray hooks" >&5
8946
8947 cat > conftest.$ac_ext <<EOF
8948 #line 8949 "configure"
8949 #include "confdefs.h"
8950 #if defined(CRAY) && ! defined(CRAY2)
8951 webecray
8952 #else
8953 wenotbecray
8954 #endif
8955
8956 EOF
8957 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8958   egrep "webecray" >/dev/null 2>&1; then
8959   rm -rf conftest*
8960   ac_cv_os_cray=yes
8961 else
8962   rm -rf conftest*
8963   ac_cv_os_cray=no
8964 fi
8965 rm -f conftest*
8966
8967
8968 echo "$ac_t""$ac_cv_os_cray" 1>&6
8969 if test $ac_cv_os_cray = yes; then
8970 for ac_func in _getb67 GETB67 getb67; do
8971   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8972 echo "configure:8973: checking for $ac_func" >&5
8973
8974 cat > conftest.$ac_ext <<EOF
8975 #line 8976 "configure"
8976 #include "confdefs.h"
8977 /* System header to define __stub macros and hopefully few prototypes,
8978     which can conflict with char $ac_func(); below.  */
8979 #include <assert.h>
8980 /* Override any gcc2 internal prototype to avoid an error.  */
8981 /* We use char because int might match the return type of a gcc2
8982     builtin and then its argument prototype would still apply.  */
8983 char $ac_func();
8984
8985 int main() {
8986
8987 /* The GNU C library defines this for functions which it implements
8988     to always fail with ENOSYS.  Some functions are actually named
8989     something starting with __ and the normal name is an alias.  */
8990 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8991 choke me
8992 #else
8993 $ac_func();
8994 #endif
8995
8996 ; return 0; }
8997 EOF
8998 if { (eval echo configure:8999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8999   rm -rf conftest*
9000   eval "ac_cv_func_$ac_func=yes"
9001 else
9002   echo "configure: failed program was:" >&5
9003   cat conftest.$ac_ext >&5
9004   rm -rf conftest*
9005   eval "ac_cv_func_$ac_func=no"
9006 fi
9007 rm -f conftest*
9008
9009 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9010   echo "$ac_t""yes" 1>&6
9011   { test "$extra_verbose" = "yes" && cat << EOF
9012     Defining CRAY_STACKSEG_END = $ac_func
9013 EOF
9014 cat >> confdefs.h <<EOF
9015 #define CRAY_STACKSEG_END $ac_func
9016 EOF
9017 }
9018
9019   break
9020 else
9021   echo "$ac_t""no" 1>&6
9022 fi
9023
9024 done
9025 fi
9026
9027 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9028 echo "configure:9029: checking stack direction for C alloca" >&5
9029
9030 cat > conftest.$ac_ext <<EOF
9031 #line 9032 "configure"
9032 #include "confdefs.h"
9033 find_stack_direction ()
9034 {
9035   static char *addr = 0;
9036   auto char dummy;
9037   if (addr == 0)
9038     {
9039       addr = &dummy;
9040       return find_stack_direction ();
9041     }
9042   else
9043     return (&dummy > addr) ? 1 : -1;
9044 }
9045 main ()
9046 {
9047   exit (find_stack_direction() < 0);
9048 }
9049 EOF
9050 if { (eval echo configure:9051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9051 then
9052   ac_cv_c_stack_direction=1
9053 else
9054   conftest_rc="$?"
9055   echo "configure: failed program was:" >&5
9056   cat conftest.$ac_ext >&5
9057   rm -fr conftest*
9058   ac_cv_c_stack_direction=-1
9059 fi
9060 rm -fr conftest*
9061
9062 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9063 { test "$extra_verbose" = "yes" && cat << EOF
9064     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9065 EOF
9066 cat >> confdefs.h <<EOF
9067 #define STACK_DIRECTION $ac_cv_c_stack_direction
9068 EOF
9069 }
9070
9071 fi
9072
9073 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9074    echo "    xemacs will be linked with \"$ALLOCA\""
9075  fi
9076
9077 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9078 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9079 echo "configure:9080: checking for vfork.h" >&5
9080
9081 cat > conftest.$ac_ext <<EOF
9082 #line 9083 "configure"
9083 #include "confdefs.h"
9084 #include <vfork.h>
9085 EOF
9086 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9087 { (eval echo configure:9088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9088 ac_err=`grep -v '^ *+' conftest.out`
9089 if test -z "$ac_err"; then
9090   rm -rf conftest*
9091   eval "ac_cv_header_$ac_safe=yes"
9092 else
9093   echo "$ac_err" >&5
9094   echo "configure: failed program was:" >&5
9095   cat conftest.$ac_ext >&5
9096   rm -rf conftest*
9097   eval "ac_cv_header_$ac_safe=no"
9098 fi
9099 rm -f conftest*
9100 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9101   echo "$ac_t""yes" 1>&6
9102   { test "$extra_verbose" = "yes" && cat << \EOF
9103     Defining HAVE_VFORK_H
9104 EOF
9105 cat >> confdefs.h <<\EOF
9106 #define HAVE_VFORK_H 1
9107 EOF
9108 }
9109
9110 else
9111   echo "$ac_t""no" 1>&6
9112 fi
9113
9114 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9115 echo "configure:9116: checking for working vfork" >&5
9116
9117 cat > conftest.$ac_ext <<EOF
9118 #line 9119 "configure"
9119 #include "confdefs.h"
9120 /* Thanks to Paul Eggert for this test.  */
9121 #include <stdio.h>
9122 #include <sys/types.h>
9123 #include <sys/stat.h>
9124 #ifdef HAVE_UNISTD_H
9125 #include <unistd.h>
9126 #endif
9127 #ifdef HAVE_VFORK_H
9128 #include <vfork.h>
9129 #endif
9130 /* On some sparc systems, changes by the child to local and incoming
9131    argument registers are propagated back to the parent.
9132    The compiler is told about this with #include <vfork.h>,
9133    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9134    Test for this by using a static variable whose address
9135    is put into a register that is clobbered by the vfork.  */
9136 static
9137 #ifdef __cplusplus
9138 sparc_address_test (int arg)
9139 #else
9140 sparc_address_test (arg) int arg;
9141 #endif
9142 {
9143   static pid_t child;
9144   if (!child) {
9145     child = vfork ();
9146     if (child < 0) {
9147       perror ("vfork");
9148       _exit(2);
9149     }
9150     if (!child) {
9151       arg = getpid();
9152       write(-1, "", 0);
9153       _exit (arg);
9154     }
9155   }
9156 }
9157 main() {
9158   pid_t parent = getpid ();
9159   pid_t child;
9160
9161   sparc_address_test ();
9162
9163   child = vfork ();
9164
9165   if (child == 0) {
9166     /* Here is another test for sparc vfork register problems.
9167        This test uses lots of local variables, at least
9168        as many local variables as main has allocated so far
9169        including compiler temporaries.  4 locals are enough for
9170        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9171        A buggy compiler should reuse the register of parent
9172        for one of the local variables, since it will think that
9173        parent can't possibly be used any more in this routine.
9174        Assigning to the local variable will thus munge parent
9175        in the parent process.  */
9176     pid_t
9177       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9178       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9179     /* Convince the compiler that p..p7 are live; otherwise, it might
9180        use the same hardware register for all 8 local variables.  */
9181     if (p != p1 || p != p2 || p != p3 || p != p4
9182         || p != p5 || p != p6 || p != p7)
9183       _exit(1);
9184
9185     /* On some systems (e.g. IRIX 3.3),
9186        vfork doesn't separate parent from child file descriptors.
9187        If the child closes a descriptor before it execs or exits,
9188        this munges the parent's descriptor as well.
9189        Test for this by closing stdout in the child.  */
9190     _exit(close(fileno(stdout)) != 0);
9191   } else {
9192     int status;
9193     struct stat st;
9194
9195     while (wait(&status) != child)
9196       ;
9197     exit(
9198          /* Was there some problem with vforking?  */
9199          child < 0
9200
9201          /* Did the child fail?  (This shouldn't happen.)  */
9202          || status
9203
9204          /* Did the vfork/compiler bug occur?  */
9205          || parent != getpid()
9206
9207          /* Did the file descriptor bug occur?  */
9208          || fstat(fileno(stdout), &st) != 0
9209          );
9210   }
9211 }
9212 EOF
9213 if { (eval echo configure:9214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9214 then
9215   ac_cv_func_vfork_works=yes
9216 else
9217   conftest_rc="$?"
9218   echo "configure: failed program was:" >&5
9219   cat conftest.$ac_ext >&5
9220   rm -fr conftest*
9221   ac_cv_func_vfork_works=no
9222 fi
9223 rm -fr conftest*
9224
9225 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9226 if test $ac_cv_func_vfork_works = no; then
9227   { test "$extra_verbose" = "yes" && cat << \EOF
9228     Defining vfork = fork
9229 EOF
9230 cat >> confdefs.h <<\EOF
9231 #define vfork fork
9232 EOF
9233 }
9234
9235 fi
9236
9237
9238 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9239 echo "configure:9240: checking for working strcoll" >&5
9240
9241 cat > conftest.$ac_ext <<EOF
9242 #line 9243 "configure"
9243 #include "confdefs.h"
9244 #include <string.h>
9245 main ()
9246 {
9247   exit (strcoll ("abc", "def") >= 0 ||
9248         strcoll ("ABC", "DEF") >= 0 ||
9249         strcoll ("123", "456") >= 0);
9250 }
9251 EOF
9252 if { (eval echo configure:9253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9253 then
9254   ac_cv_func_strcoll_works=yes
9255 else
9256   conftest_rc="$?"
9257   echo "configure: failed program was:" >&5
9258   cat conftest.$ac_ext >&5
9259   rm -fr conftest*
9260   ac_cv_func_strcoll_works=no
9261 fi
9262 rm -fr conftest*
9263
9264 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9265 if test $ac_cv_func_strcoll_works = yes; then
9266   { test "$extra_verbose" = "yes" && cat << \EOF
9267     Defining HAVE_STRCOLL
9268 EOF
9269 cat >> confdefs.h <<\EOF
9270 #define HAVE_STRCOLL 1
9271 EOF
9272 }
9273
9274 fi
9275
9276
9277 for ac_func in getpgrp
9278 do
9279 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9280 echo "configure:9281: checking for $ac_func" >&5
9281
9282 cat > conftest.$ac_ext <<EOF
9283 #line 9284 "configure"
9284 #include "confdefs.h"
9285 /* System header to define __stub macros and hopefully few prototypes,
9286     which can conflict with char $ac_func(); below.  */
9287 #include <assert.h>
9288 /* Override any gcc2 internal prototype to avoid an error.  */
9289 /* We use char because int might match the return type of a gcc2
9290     builtin and then its argument prototype would still apply.  */
9291 char $ac_func();
9292
9293 int main() {
9294
9295 /* The GNU C library defines this for functions which it implements
9296     to always fail with ENOSYS.  Some functions are actually named
9297     something starting with __ and the normal name is an alias.  */
9298 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9299 choke me
9300 #else
9301 $ac_func();
9302 #endif
9303
9304 ; return 0; }
9305 EOF
9306 if { (eval echo configure:9307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9307   rm -rf conftest*
9308   eval "ac_cv_func_$ac_func=yes"
9309 else
9310   echo "configure: failed program was:" >&5
9311   cat conftest.$ac_ext >&5
9312   rm -rf conftest*
9313   eval "ac_cv_func_$ac_func=no"
9314 fi
9315 rm -f conftest*
9316
9317 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9318   echo "$ac_t""yes" 1>&6
9319     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9320   { test "$extra_verbose" = "yes" && cat << EOF
9321     Defining $ac_tr_func
9322 EOF
9323 cat >> confdefs.h <<EOF
9324 #define $ac_tr_func 1
9325 EOF
9326 }
9327  
9328 else
9329   echo "$ac_t""no" 1>&6
9330 fi
9331 done
9332
9333 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9334 echo "configure:9335: checking whether getpgrp takes no argument" >&5
9335
9336 cat > conftest.$ac_ext <<EOF
9337 #line 9338 "configure"
9338 #include "confdefs.h"
9339
9340 /*
9341  * If this system has a BSD-style getpgrp(),
9342  * which takes a pid argument, exit unsuccessfully.
9343  *
9344  * Snarfed from Chet Ramey's bash pgrp.c test program
9345  */
9346 #include <stdio.h>
9347 #include <sys/types.h>
9348
9349 int     pid;
9350 int     pg1, pg2, pg3, pg4;
9351 int     ng, np, s, child;
9352
9353 main()
9354 {
9355         pid = getpid();
9356         pg1 = getpgrp(0);
9357         pg2 = getpgrp();
9358         pg3 = getpgrp(pid);
9359         pg4 = getpgrp(1);
9360
9361         /*
9362          * If all of these values are the same, it's pretty sure that
9363          * we're on a system that ignores getpgrp's first argument.
9364          */
9365         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9366                 exit(0);
9367
9368         child = fork();
9369         if (child < 0)
9370                 exit(1);
9371         else if (child == 0) {
9372                 np = getpid();
9373                 /*
9374                  * If this is Sys V, this will not work; pgrp will be
9375                  * set to np because setpgrp just changes a pgrp to be
9376                  * the same as the pid.
9377                  */
9378                 setpgrp(np, pg1);
9379                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9380                 if (ng == pg1) {
9381                         exit(1);
9382                 } else {
9383                         exit(0);
9384                 }
9385         } else {
9386                 wait(&s);
9387                 exit(s>>8);
9388         }
9389 }
9390
9391 EOF
9392 if { (eval echo configure:9393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9393 then
9394   ac_cv_func_getpgrp_void=yes
9395 else
9396   conftest_rc="$?"
9397   echo "configure: failed program was:" >&5
9398   cat conftest.$ac_ext >&5
9399   rm -fr conftest*
9400   ac_cv_func_getpgrp_void=no
9401 fi
9402 rm -fr conftest*
9403
9404
9405 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9406 if test $ac_cv_func_getpgrp_void = yes; then
9407   { test "$extra_verbose" = "yes" && cat << \EOF
9408     Defining GETPGRP_VOID
9409 EOF
9410 cat >> confdefs.h <<\EOF
9411 #define GETPGRP_VOID 1
9412 EOF
9413 }
9414
9415 fi
9416
9417
9418 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9419 echo "configure:9420: checking for working mmap" >&5
9420 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9421 cat > conftest.$ac_ext <<EOF
9422 #line 9423 "configure"
9423 #include "confdefs.h"
9424 #include <stdio.h>
9425 #include <unistd.h>
9426 #include <fcntl.h>
9427 #include <sys/mman.h>
9428
9429 #ifndef MAP_VARIABLE
9430 #define MAP_VARIABLE 0
9431 #endif
9432
9433 #ifndef MAP_FAILED
9434 #define MAP_FAILED -1
9435 #endif
9436
9437 int main (int argc, char *argv[])
9438 {
9439   int fd = -1;
9440   caddr_t p;
9441 #ifndef MAP_ANONYMOUS
9442   fd = open ("/dev/zero", O_RDWR);
9443   if (fd < 0)
9444     return 1;
9445 #define MAP_ANONYMOUS 0
9446 #endif
9447   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9448            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9449            fd, 0) != (void *) MAP_FAILED)
9450     return 0;
9451   perror ("conftest: mmap failed");
9452   return 1;
9453 }
9454 EOF
9455 if { (eval echo configure:9456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9456 then
9457   have_mmap=yes
9458 else
9459   conftest_rc="$?"
9460   echo "configure: failed program was:" >&5
9461   cat conftest.$ac_ext >&5
9462   rm -fr conftest*
9463   have_mmap=no
9464 fi
9465 rm -fr conftest* ;;
9466 esac
9467 echo "$ac_t""$have_mmap" 1>&6
9468 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9469     Defining HAVE_MMAP
9470 EOF
9471 cat >> confdefs.h <<\EOF
9472 #define HAVE_MMAP 1
9473 EOF
9474 }
9475
9476 for ac_hdr in unistd.h
9477 do
9478 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9479 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9480 echo "configure:9481: checking for $ac_hdr" >&5
9481
9482 cat > conftest.$ac_ext <<EOF
9483 #line 9484 "configure"
9484 #include "confdefs.h"
9485 #include <$ac_hdr>
9486 EOF
9487 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9488 { (eval echo configure:9489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9489 ac_err=`grep -v '^ *+' conftest.out`
9490 if test -z "$ac_err"; then
9491   rm -rf conftest*
9492   eval "ac_cv_header_$ac_safe=yes"
9493 else
9494   echo "$ac_err" >&5
9495   echo "configure: failed program was:" >&5
9496   cat conftest.$ac_ext >&5
9497   rm -rf conftest*
9498   eval "ac_cv_header_$ac_safe=no"
9499 fi
9500 rm -f conftest*
9501 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9502   echo "$ac_t""yes" 1>&6
9503     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9504   { test "$extra_verbose" = "yes" && cat << EOF
9505     Defining $ac_tr_hdr
9506 EOF
9507 cat >> confdefs.h <<EOF
9508 #define $ac_tr_hdr 1
9509 EOF
9510 }
9511  
9512 else
9513   echo "$ac_t""no" 1>&6
9514 fi
9515 done
9516
9517 for ac_func in getpagesize
9518 do
9519 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9520 echo "configure:9521: checking for $ac_func" >&5
9521
9522 cat > conftest.$ac_ext <<EOF
9523 #line 9524 "configure"
9524 #include "confdefs.h"
9525 /* System header to define __stub macros and hopefully few prototypes,
9526     which can conflict with char $ac_func(); below.  */
9527 #include <assert.h>
9528 /* Override any gcc2 internal prototype to avoid an error.  */
9529 /* We use char because int might match the return type of a gcc2
9530     builtin and then its argument prototype would still apply.  */
9531 char $ac_func();
9532
9533 int main() {
9534
9535 /* The GNU C library defines this for functions which it implements
9536     to always fail with ENOSYS.  Some functions are actually named
9537     something starting with __ and the normal name is an alias.  */
9538 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9539 choke me
9540 #else
9541 $ac_func();
9542 #endif
9543
9544 ; return 0; }
9545 EOF
9546 if { (eval echo configure:9547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9547   rm -rf conftest*
9548   eval "ac_cv_func_$ac_func=yes"
9549 else
9550   echo "configure: failed program was:" >&5
9551   cat conftest.$ac_ext >&5
9552   rm -rf conftest*
9553   eval "ac_cv_func_$ac_func=no"
9554 fi
9555 rm -f conftest*
9556
9557 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9558   echo "$ac_t""yes" 1>&6
9559     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9560   { test "$extra_verbose" = "yes" && cat << EOF
9561     Defining $ac_tr_func
9562 EOF
9563 cat >> confdefs.h <<EOF
9564 #define $ac_tr_func 1
9565 EOF
9566 }
9567  
9568 else
9569   echo "$ac_t""no" 1>&6
9570 fi
9571 done
9572
9573 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9574 echo "configure:9575: checking for working mmap" >&5
9575
9576 cat > conftest.$ac_ext <<EOF
9577 #line 9578 "configure"
9578 #include "confdefs.h"
9579
9580 /* Thanks to Mike Haertel and Jim Avera for this test.
9581    Here is a matrix of mmap possibilities:
9582         mmap private not fixed
9583         mmap private fixed at somewhere currently unmapped
9584         mmap private fixed at somewhere already mapped
9585         mmap shared not fixed
9586         mmap shared fixed at somewhere currently unmapped
9587         mmap shared fixed at somewhere already mapped
9588    For private mappings, we should verify that changes cannot be read()
9589    back from the file, nor mmap's back from the file at a different
9590    address.  (There have been systems where private was not correctly
9591    implemented like the infamous i386 svr4.0, and systems where the
9592    VM page cache was not coherent with the filesystem buffer cache
9593    like early versions of FreeBSD and possibly contemporary NetBSD.)
9594    For shared mappings, we should conversely verify that changes get
9595    propogated back to all the places they're supposed to be.
9596
9597    Grep wants private fixed already mapped.
9598    The main things grep needs to know about mmap are:
9599    * does it exist and is it safe to write into the mmap'd area
9600    * how to use it (BSD variants)  */
9601 #include <sys/types.h>
9602 #include <fcntl.h>
9603 #include <sys/mman.h>
9604
9605 /* This mess was copied from the GNU getpagesize.h.  */
9606 #ifndef HAVE_GETPAGESIZE
9607 # ifdef HAVE_UNISTD_H
9608 #  include <unistd.h>
9609 # endif
9610
9611 /* Assume that all systems that can run configure have sys/param.h.  */
9612 # ifndef HAVE_SYS_PARAM_H
9613 #  define HAVE_SYS_PARAM_H 1
9614 # endif
9615
9616 # ifdef _SC_PAGESIZE
9617 #  define getpagesize() sysconf(_SC_PAGESIZE)
9618 # else /* no _SC_PAGESIZE */
9619 #  ifdef HAVE_SYS_PARAM_H
9620 #   include <sys/param.h>
9621 #   ifdef EXEC_PAGESIZE
9622 #    define getpagesize() EXEC_PAGESIZE
9623 #   else /* no EXEC_PAGESIZE */
9624 #    ifdef NBPG
9625 #     define getpagesize() NBPG * CLSIZE
9626 #     ifndef CLSIZE
9627 #      define CLSIZE 1
9628 #     endif /* no CLSIZE */
9629 #    else /* no NBPG */
9630 #     ifdef NBPC
9631 #      define getpagesize() NBPC
9632 #     else /* no NBPC */
9633 #      ifdef PAGESIZE
9634 #       define getpagesize() PAGESIZE
9635 #      endif /* PAGESIZE */
9636 #     endif /* no NBPC */
9637 #    endif /* no NBPG */
9638 #   endif /* no EXEC_PAGESIZE */
9639 #  else /* no HAVE_SYS_PARAM_H */
9640 #   define getpagesize() 8192   /* punt totally */
9641 #  endif /* no HAVE_SYS_PARAM_H */
9642 # endif /* no _SC_PAGESIZE */
9643
9644 #endif /* no HAVE_GETPAGESIZE */
9645
9646 #ifdef __cplusplus
9647 extern "C" { void *malloc(unsigned); }
9648 #else
9649 char *malloc();
9650 #endif
9651
9652 int
9653 main()
9654 {
9655         char *data, *data2, *data3;
9656         int i, pagesize;
9657         int fd;
9658
9659         pagesize = getpagesize();
9660
9661         /*
9662          * First, make a file with some known garbage in it.
9663          */
9664         data = malloc(pagesize);
9665         if (!data)
9666                 exit(1);
9667         for (i = 0; i < pagesize; ++i)
9668                 *(data + i) = rand();
9669         umask(0);
9670         fd = creat("conftestmmap", 0600);
9671         if (fd < 0)
9672                 exit(1);
9673         if (write(fd, data, pagesize) != pagesize)
9674                 exit(1);
9675         close(fd);
9676
9677         /*
9678          * Next, try to mmap the file at a fixed address which
9679          * already has something else allocated at it.  If we can,
9680          * also make sure that we see the same garbage.
9681          */
9682         fd = open("conftestmmap", O_RDWR);
9683         if (fd < 0)
9684                 exit(1);
9685         data2 = malloc(2 * pagesize);
9686         if (!data2)
9687                 exit(1);
9688         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
9689         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
9690             MAP_PRIVATE | MAP_FIXED, fd, 0L))
9691                 exit(1);
9692         for (i = 0; i < pagesize; ++i)
9693                 if (*(data + i) != *(data2 + i))
9694                         exit(1);
9695
9696         /*
9697          * Finally, make sure that changes to the mapped area
9698          * do not percolate back to the file as seen by read().
9699          * (This is a bug on some variants of i386 svr4.0.)
9700          */
9701         for (i = 0; i < pagesize; ++i)
9702                 *(data2 + i) = *(data2 + i) + 1;
9703         data3 = malloc(pagesize);
9704         if (!data3)
9705                 exit(1);
9706         if (read(fd, data3, pagesize) != pagesize)
9707                 exit(1);
9708         for (i = 0; i < pagesize; ++i)
9709                 if (*(data + i) != *(data3 + i))
9710                         exit(1);
9711         close(fd);
9712         unlink("conftestmmap");
9713         exit(0);
9714 }
9715
9716 EOF
9717 if { (eval echo configure:9718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9718 then
9719   ac_cv_func_mmap_fixed_mapped=yes
9720 else
9721   conftest_rc="$?"
9722   echo "configure: failed program was:" >&5
9723   cat conftest.$ac_ext >&5
9724   rm -fr conftest*
9725   ac_cv_func_mmap_fixed_mapped=no
9726 fi
9727 rm -fr conftest*
9728
9729 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
9730 if test $ac_cv_func_mmap_fixed_mapped = yes; then
9731   { test "$extra_verbose" = "yes" && cat << \EOF
9732     Defining HAVE_MMAP
9733 EOF
9734 cat >> confdefs.h <<\EOF
9735 #define HAVE_MMAP 1
9736 EOF
9737 }
9738
9739 fi
9740
9741
9742 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9743 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9744 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9745     Defining REL_ALLOC
9746 EOF
9747 cat >> confdefs.h <<\EOF
9748 #define REL_ALLOC 1
9749 EOF
9750 }
9751
9752
9753 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
9754 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
9755 echo "configure:9756: checking for termios.h" >&5
9756
9757 cat > conftest.$ac_ext <<EOF
9758 #line 9759 "configure"
9759 #include "confdefs.h"
9760 #include <termios.h>
9761 EOF
9762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9763 { (eval echo configure:9764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9764 ac_err=`grep -v '^ *+' conftest.out`
9765 if test -z "$ac_err"; then
9766   rm -rf conftest*
9767   eval "ac_cv_header_$ac_safe=yes"
9768 else
9769   echo "$ac_err" >&5
9770   echo "configure: failed program was:" >&5
9771   cat conftest.$ac_ext >&5
9772   rm -rf conftest*
9773   eval "ac_cv_header_$ac_safe=no"
9774 fi
9775 rm -f conftest*
9776 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9777   echo "$ac_t""yes" 1>&6
9778   { test "$extra_verbose" = "yes" && cat << \EOF
9779     Defining HAVE_TERMIOS
9780 EOF
9781 cat >> confdefs.h <<\EOF
9782 #define HAVE_TERMIOS 1
9783 EOF
9784 }
9785
9786   { test "$extra_verbose" = "yes" && cat << \EOF
9787     Defining SIGNALS_VIA_CHARACTERS
9788 EOF
9789 cat >> confdefs.h <<\EOF
9790 #define SIGNALS_VIA_CHARACTERS 1
9791 EOF
9792 }
9793
9794   { test "$extra_verbose" = "yes" && cat << \EOF
9795     Defining NO_TERMIO
9796 EOF
9797 cat >> confdefs.h <<\EOF
9798 #define NO_TERMIO 1
9799 EOF
9800 }
9801
9802 else
9803   echo "$ac_t""no" 1>&6
9804 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
9805 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
9806 echo "configure:9807: checking for termio.h" >&5
9807
9808 cat > conftest.$ac_ext <<EOF
9809 #line 9810 "configure"
9810 #include "confdefs.h"
9811 #include <termio.h>
9812 EOF
9813 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9814 { (eval echo configure:9815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9815 ac_err=`grep -v '^ *+' conftest.out`
9816 if test -z "$ac_err"; then
9817   rm -rf conftest*
9818   eval "ac_cv_header_$ac_safe=yes"
9819 else
9820   echo "$ac_err" >&5
9821   echo "configure: failed program was:" >&5
9822   cat conftest.$ac_ext >&5
9823   rm -rf conftest*
9824   eval "ac_cv_header_$ac_safe=no"
9825 fi
9826 rm -f conftest*
9827 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9828   echo "$ac_t""yes" 1>&6
9829   { test "$extra_verbose" = "yes" && cat << \EOF
9830     Defining HAVE_TERMIO
9831 EOF
9832 cat >> confdefs.h <<\EOF
9833 #define HAVE_TERMIO 1
9834 EOF
9835 }
9836
9837 else
9838   echo "$ac_t""no" 1>&6
9839 fi
9840
9841 fi
9842
9843
9844
9845 echo $ac_n "checking for socket""... $ac_c" 1>&6
9846 echo "configure:9847: checking for socket" >&5
9847
9848 cat > conftest.$ac_ext <<EOF
9849 #line 9850 "configure"
9850 #include "confdefs.h"
9851 /* System header to define __stub macros and hopefully few prototypes,
9852     which can conflict with char socket(); below.  */
9853 #include <assert.h>
9854 /* Override any gcc2 internal prototype to avoid an error.  */
9855 /* We use char because int might match the return type of a gcc2
9856     builtin and then its argument prototype would still apply.  */
9857 char socket();
9858
9859 int main() {
9860
9861 /* The GNU C library defines this for functions which it implements
9862     to always fail with ENOSYS.  Some functions are actually named
9863     something starting with __ and the normal name is an alias.  */
9864 #if defined (__stub_socket) || defined (__stub___socket)
9865 choke me
9866 #else
9867 socket();
9868 #endif
9869
9870 ; return 0; }
9871 EOF
9872 if { (eval echo configure:9873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9873   rm -rf conftest*
9874   eval "ac_cv_func_socket=yes"
9875 else
9876   echo "configure: failed program was:" >&5
9877   cat conftest.$ac_ext >&5
9878   rm -rf conftest*
9879   eval "ac_cv_func_socket=no"
9880 fi
9881 rm -f conftest*
9882
9883 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9884   echo "$ac_t""yes" 1>&6
9885   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
9886 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
9887 echo "configure:9888: checking for netinet/in.h" >&5
9888
9889 cat > conftest.$ac_ext <<EOF
9890 #line 9891 "configure"
9891 #include "confdefs.h"
9892 #include <netinet/in.h>
9893 EOF
9894 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9895 { (eval echo configure:9896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9896 ac_err=`grep -v '^ *+' conftest.out`
9897 if test -z "$ac_err"; then
9898   rm -rf conftest*
9899   eval "ac_cv_header_$ac_safe=yes"
9900 else
9901   echo "$ac_err" >&5
9902   echo "configure: failed program was:" >&5
9903   cat conftest.$ac_ext >&5
9904   rm -rf conftest*
9905   eval "ac_cv_header_$ac_safe=no"
9906 fi
9907 rm -f conftest*
9908 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9909   echo "$ac_t""yes" 1>&6
9910   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
9911 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
9912 echo "configure:9913: checking for arpa/inet.h" >&5
9913
9914 cat > conftest.$ac_ext <<EOF
9915 #line 9916 "configure"
9916 #include "confdefs.h"
9917 #include <arpa/inet.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   
9936   { test "$extra_verbose" = "yes" && cat << \EOF
9937     Defining HAVE_SOCKETS
9938 EOF
9939 cat >> confdefs.h <<\EOF
9940 #define HAVE_SOCKETS 1
9941 EOF
9942 }
9943
9944       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
9945 echo "configure:9946: checking "for sun_len member in struct sockaddr_un"" >&5
9946       cat > conftest.$ac_ext <<EOF
9947 #line 9948 "configure"
9948 #include "confdefs.h"
9949
9950 #include <sys/types.h>
9951 #include <sys/socket.h>
9952 #include <sys/un.h>
9953       
9954 int main() {
9955 static struct sockaddr_un x; x.sun_len = 1;
9956 ; return 0; }
9957 EOF
9958 if { (eval echo configure:9959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9959   rm -rf conftest*
9960   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
9961     Defining HAVE_SOCKADDR_SUN_LEN
9962 EOF
9963 cat >> confdefs.h <<\EOF
9964 #define HAVE_SOCKADDR_SUN_LEN 1
9965 EOF
9966 }
9967
9968 else
9969   echo "configure: failed program was:" >&5
9970   cat conftest.$ac_ext >&5
9971   rm -rf conftest*
9972   echo "$ac_t""no" 1>&6
9973 fi
9974 rm -f conftest*
9975       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
9976 echo "configure:9977: checking "for ip_mreq struct in netinet/in.h"" >&5
9977       cat > conftest.$ac_ext <<EOF
9978 #line 9979 "configure"
9979 #include "confdefs.h"
9980
9981 #include <sys/types.h>
9982 #include <netinet/in.h>
9983       
9984 int main() {
9985 static struct ip_mreq x;
9986 ; return 0; }
9987 EOF
9988 if { (eval echo configure:9989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9989   rm -rf conftest*
9990   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
9991     Defining HAVE_MULTICAST
9992 EOF
9993 cat >> confdefs.h <<\EOF
9994 #define HAVE_MULTICAST 1
9995 EOF
9996 }
9997
9998 else
9999   echo "configure: failed program was:" >&5
10000   cat conftest.$ac_ext >&5
10001   rm -rf conftest*
10002   echo "$ac_t""no" 1>&6
10003 fi
10004 rm -f conftest*
10005 else
10006   echo "$ac_t""no" 1>&6
10007 fi
10008
10009 else
10010   echo "$ac_t""no" 1>&6
10011 fi
10012
10013 else
10014   echo "$ac_t""no" 1>&6
10015 fi
10016
10017
10018 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10019 echo "configure:10020: checking for msgget" >&5
10020
10021 cat > conftest.$ac_ext <<EOF
10022 #line 10023 "configure"
10023 #include "confdefs.h"
10024 /* System header to define __stub macros and hopefully few prototypes,
10025     which can conflict with char msgget(); below.  */
10026 #include <assert.h>
10027 /* Override any gcc2 internal prototype to avoid an error.  */
10028 /* We use char because int might match the return type of a gcc2
10029     builtin and then its argument prototype would still apply.  */
10030 char msgget();
10031
10032 int main() {
10033
10034 /* The GNU C library defines this for functions which it implements
10035     to always fail with ENOSYS.  Some functions are actually named
10036     something starting with __ and the normal name is an alias.  */
10037 #if defined (__stub_msgget) || defined (__stub___msgget)
10038 choke me
10039 #else
10040 msgget();
10041 #endif
10042
10043 ; return 0; }
10044 EOF
10045 if { (eval echo configure:10046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10046   rm -rf conftest*
10047   eval "ac_cv_func_msgget=yes"
10048 else
10049   echo "configure: failed program was:" >&5
10050   cat conftest.$ac_ext >&5
10051   rm -rf conftest*
10052   eval "ac_cv_func_msgget=no"
10053 fi
10054 rm -f conftest*
10055
10056 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10057   echo "$ac_t""yes" 1>&6
10058   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10059 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10060 echo "configure:10061: checking for sys/ipc.h" >&5
10061
10062 cat > conftest.$ac_ext <<EOF
10063 #line 10064 "configure"
10064 #include "confdefs.h"
10065 #include <sys/ipc.h>
10066 EOF
10067 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10068 { (eval echo configure:10069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10069 ac_err=`grep -v '^ *+' conftest.out`
10070 if test -z "$ac_err"; then
10071   rm -rf conftest*
10072   eval "ac_cv_header_$ac_safe=yes"
10073 else
10074   echo "$ac_err" >&5
10075   echo "configure: failed program was:" >&5
10076   cat conftest.$ac_ext >&5
10077   rm -rf conftest*
10078   eval "ac_cv_header_$ac_safe=no"
10079 fi
10080 rm -f conftest*
10081 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10082   echo "$ac_t""yes" 1>&6
10083   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10084 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10085 echo "configure:10086: checking for sys/msg.h" >&5
10086
10087 cat > conftest.$ac_ext <<EOF
10088 #line 10089 "configure"
10089 #include "confdefs.h"
10090 #include <sys/msg.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   { test "$extra_verbose" = "yes" && cat << \EOF
10109     Defining HAVE_SYSVIPC
10110 EOF
10111 cat >> confdefs.h <<\EOF
10112 #define HAVE_SYSVIPC 1
10113 EOF
10114 }
10115
10116 else
10117   echo "$ac_t""no" 1>&6
10118 fi
10119
10120 else
10121   echo "$ac_t""no" 1>&6
10122 fi
10123
10124 else
10125   echo "$ac_t""no" 1>&6
10126 fi
10127
10128
10129 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10130 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10131 echo "configure:10132: checking for dirent.h" >&5
10132
10133 cat > conftest.$ac_ext <<EOF
10134 #line 10135 "configure"
10135 #include "confdefs.h"
10136 #include <dirent.h>
10137 EOF
10138 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10139 { (eval echo configure:10140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10140 ac_err=`grep -v '^ *+' conftest.out`
10141 if test -z "$ac_err"; then
10142   rm -rf conftest*
10143   eval "ac_cv_header_$ac_safe=yes"
10144 else
10145   echo "$ac_err" >&5
10146   echo "configure: failed program was:" >&5
10147   cat conftest.$ac_ext >&5
10148   rm -rf conftest*
10149   eval "ac_cv_header_$ac_safe=no"
10150 fi
10151 rm -f conftest*
10152 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10153   echo "$ac_t""yes" 1>&6
10154   { test "$extra_verbose" = "yes" && cat << \EOF
10155     Defining SYSV_SYSTEM_DIR
10156 EOF
10157 cat >> confdefs.h <<\EOF
10158 #define SYSV_SYSTEM_DIR 1
10159 EOF
10160 }
10161
10162 else
10163   echo "$ac_t""no" 1>&6
10164 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10165 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10166 echo "configure:10167: checking for sys/dir.h" >&5
10167
10168 cat > conftest.$ac_ext <<EOF
10169 #line 10170 "configure"
10170 #include "confdefs.h"
10171 #include <sys/dir.h>
10172 EOF
10173 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10174 { (eval echo configure:10175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10175 ac_err=`grep -v '^ *+' conftest.out`
10176 if test -z "$ac_err"; then
10177   rm -rf conftest*
10178   eval "ac_cv_header_$ac_safe=yes"
10179 else
10180   echo "$ac_err" >&5
10181   echo "configure: failed program was:" >&5
10182   cat conftest.$ac_ext >&5
10183   rm -rf conftest*
10184   eval "ac_cv_header_$ac_safe=no"
10185 fi
10186 rm -f conftest*
10187 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10188   echo "$ac_t""yes" 1>&6
10189   :
10190 else
10191   echo "$ac_t""no" 1>&6
10192 { test "$extra_verbose" = "yes" && cat << \EOF
10193     Defining NONSYSTEM_DIR_LIBRARY
10194 EOF
10195 cat >> confdefs.h <<\EOF
10196 #define NONSYSTEM_DIR_LIBRARY 1
10197 EOF
10198 }
10199
10200 fi
10201
10202 fi
10203
10204
10205 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10206 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10207 echo "configure:10208: checking for nlist.h" >&5
10208
10209 cat > conftest.$ac_ext <<EOF
10210 #line 10211 "configure"
10211 #include "confdefs.h"
10212 #include <nlist.h>
10213 EOF
10214 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10215 { (eval echo configure:10216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10216 ac_err=`grep -v '^ *+' conftest.out`
10217 if test -z "$ac_err"; then
10218   rm -rf conftest*
10219   eval "ac_cv_header_$ac_safe=yes"
10220 else
10221   echo "$ac_err" >&5
10222   echo "configure: failed program was:" >&5
10223   cat conftest.$ac_ext >&5
10224   rm -rf conftest*
10225   eval "ac_cv_header_$ac_safe=no"
10226 fi
10227 rm -f conftest*
10228 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10229   echo "$ac_t""yes" 1>&6
10230   { test "$extra_verbose" = "yes" && cat << \EOF
10231     Defining NLIST_STRUCT
10232 EOF
10233 cat >> confdefs.h <<\EOF
10234 #define NLIST_STRUCT 1
10235 EOF
10236 }
10237
10238 else
10239   echo "$ac_t""no" 1>&6
10240 fi
10241
10242
10243
10244 echo "checking "for sound support"" 1>&6
10245 echo "configure:10246: checking "for sound support"" >&5
10246 case "$with_sound" in
10247   native | both ) with_native_sound=yes;;
10248   nas    | no   ) with_native_sound=no;;
10249 esac
10250 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10251
10252 if test "$with_native_sound" != "no"; then
10253     if test -n "$native_sound_lib"; then
10254     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10255 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10256 echo "configure:10257: checking for multimedia/audio_device.h" >&5
10257
10258 cat > conftest.$ac_ext <<EOF
10259 #line 10260 "configure"
10260 #include "confdefs.h"
10261 #include <multimedia/audio_device.h>
10262 EOF
10263 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10264 { (eval echo configure:10265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10265 ac_err=`grep -v '^ *+' conftest.out`
10266 if test -z "$ac_err"; then
10267   rm -rf conftest*
10268   eval "ac_cv_header_$ac_safe=yes"
10269 else
10270   echo "$ac_err" >&5
10271   echo "configure: failed program was:" >&5
10272   cat conftest.$ac_ext >&5
10273   rm -rf conftest*
10274   eval "ac_cv_header_$ac_safe=no"
10275 fi
10276 rm -f conftest*
10277 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10278   echo "$ac_t""yes" 1>&6
10279   sound_found=yes sound_cflags=""
10280       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10281    echo "    xemacs will be linked with \"sunplay.o\""
10282  fi
10283 else
10284   echo "$ac_t""no" 1>&6
10285 fi
10286
10287   fi
10288
10289     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10290     sound_found=yes
10291     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10292    echo "    xemacs will be linked with \"sunplay.o\""
10293  fi
10294     if test -d "/usr/demo/SOUND/include"
10295       then sound_cflags="-I/usr/demo/SOUND/include"
10296       else sound_cflags="-I/usr/demo/SOUND"
10297     fi
10298     if test -z "$native_sound_lib" ; then
10299       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10300         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10301         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10302       fi
10303     fi
10304   fi
10305
10306     if test -z "$sound_found"; then
10307     case "$canonical" in
10308     *-sgi-* )
10309       if test -z "$native_sound_lib"; then
10310         
10311 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10312 echo "configure:10313: checking for ALopenport in -laudio" >&5
10313 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10314
10315 xe_check_libs=" -laudio "
10316 cat > conftest.$ac_ext <<EOF
10317 #line 10318 "configure"
10318 #include "confdefs.h"
10319 /* Override any gcc2 internal prototype to avoid an error.  */
10320 /* We use char because int might match the return type of a gcc2
10321     builtin and then its argument prototype would still apply.  */
10322 char ALopenport();
10323
10324 int main() {
10325 ALopenport()
10326 ; return 0; }
10327 EOF
10328 if { (eval echo configure:10329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10329   rm -rf conftest*
10330   eval "ac_cv_lib_$ac_lib_var=yes"
10331 else
10332   echo "configure: failed program was:" >&5
10333   cat conftest.$ac_ext >&5
10334   rm -rf conftest*
10335   eval "ac_cv_lib_$ac_lib_var=no"
10336 fi
10337 rm -f conftest*
10338 xe_check_libs=""
10339
10340 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10341   echo "$ac_t""yes" 1>&6
10342   native_sound_lib="-laudio"
10343 else
10344   echo "$ac_t""no" 1>&6
10345 fi
10346
10347
10348       fi
10349       if test -n "$native_sound_lib"; then
10350         sound_found=yes sound_cflags=""
10351         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10352    echo "    xemacs will be linked with \"sgiplay.o\""
10353  fi
10354       fi ;;
10355     hppa*-hp-hpux* )
10356       if test -z "$native_sound_lib"; then
10357         
10358 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10359 echo "configure:10360: checking for AOpenAudio in -lAlib" >&5
10360 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10361
10362 xe_check_libs=" -lAlib "
10363 cat > conftest.$ac_ext <<EOF
10364 #line 10365 "configure"
10365 #include "confdefs.h"
10366 /* Override any gcc2 internal prototype to avoid an error.  */
10367 /* We use char because int might match the return type of a gcc2
10368     builtin and then its argument prototype would still apply.  */
10369 char AOpenAudio();
10370
10371 int main() {
10372 AOpenAudio()
10373 ; return 0; }
10374 EOF
10375 if { (eval echo configure:10376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10376   rm -rf conftest*
10377   eval "ac_cv_lib_$ac_lib_var=yes"
10378 else
10379   echo "configure: failed program was:" >&5
10380   cat conftest.$ac_ext >&5
10381   rm -rf conftest*
10382   eval "ac_cv_lib_$ac_lib_var=no"
10383 fi
10384 rm -f conftest*
10385 xe_check_libs=""
10386
10387 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10388   echo "$ac_t""yes" 1>&6
10389   native_sound_lib="-lAlib"
10390 else
10391   echo "$ac_t""no" 1>&6
10392 fi
10393
10394
10395       fi
10396       if test -n "$native_sound_lib"; then
10397         sound_found=yes
10398         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10399    echo "    xemacs will be linked with \"hpplay.o\""
10400  fi
10401         if test "$GCC" = "yes" # Kludge city
10402           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10403           else sound_cflags="+e -I/usr/audio/examples"
10404         fi
10405       fi ;;
10406     esac
10407   fi
10408
10409     if test -z "$sound_found"; then
10410     for dir in "machine" "sys" "linux"; do
10411       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10412 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10413 echo "configure:10414: checking for ${dir}/soundcard.h" >&5
10414
10415 cat > conftest.$ac_ext <<EOF
10416 #line 10417 "configure"
10417 #include "confdefs.h"
10418 #include <${dir}/soundcard.h>
10419 EOF
10420 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10421 { (eval echo configure:10422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10422 ac_err=`grep -v '^ *+' conftest.out`
10423 if test -z "$ac_err"; then
10424   rm -rf conftest*
10425   eval "ac_cv_header_$ac_safe=yes"
10426 else
10427   echo "$ac_err" >&5
10428   echo "configure: failed program was:" >&5
10429   cat conftest.$ac_ext >&5
10430   rm -rf conftest*
10431   eval "ac_cv_header_$ac_safe=no"
10432 fi
10433 rm -f conftest*
10434 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10435   echo "$ac_t""yes" 1>&6
10436   sound_found=yes
10437         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10438    echo "    xemacs will be linked with \"linuxplay.o\""
10439  fi
10440         { test "$extra_verbose" = "yes" && cat << EOF
10441     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10442 EOF
10443 cat >> confdefs.h <<EOF
10444 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10445 EOF
10446 }
10447
10448         break
10449 else
10450   echo "$ac_t""no" 1>&6
10451 fi
10452
10453     done
10454   fi
10455
10456   test "$sound_found" = "yes" && with_native_sound=yes
10457 fi
10458
10459 if test -z "$with_sound"; then
10460   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10461     with_sound=native
10462   fi
10463 fi
10464
10465 if test "$with_native_sound" = "yes"; then
10466   { test "$extra_verbose" = "yes" && cat << \EOF
10467     Defining HAVE_NATIVE_SOUND
10468 EOF
10469 cat >> confdefs.h <<\EOF
10470 #define HAVE_NATIVE_SOUND 1
10471 EOF
10472 }
10473
10474   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10475 fi
10476
10477 case "$with_sound" in both | nas )
10478   { test "$extra_verbose" = "yes" && cat << \EOF
10479     Defining HAVE_NAS_SOUND
10480 EOF
10481 cat >> confdefs.h <<\EOF
10482 #define HAVE_NAS_SOUND 1
10483 EOF
10484 }
10485
10486   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10487    echo "    xemacs will be linked with \"nas.o\""
10488  fi
10489   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10490       cat > conftest.$ac_ext <<EOF
10491 #line 10492 "configure"
10492 #include "confdefs.h"
10493 #include <audio/Xtutil.h>
10494 EOF
10495 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10496   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10497   :
10498 else
10499   rm -rf conftest*
10500   { test "$extra_verbose" = "yes" && cat << \EOF
10501     Defining NAS_NO_ERROR_JUMP
10502 EOF
10503 cat >> confdefs.h <<\EOF
10504 #define NAS_NO_ERROR_JUMP 1
10505 EOF
10506 }
10507
10508 fi
10509 rm -f conftest*
10510
10511 esac
10512
10513
10514 test -z "$with_tty" && with_tty=yes
10515
10516 if test "$with_tty" = "yes"  ; then
10517   echo "checking for TTY-related features" 1>&6
10518 echo "configure:10519: checking for TTY-related features" >&5
10519   { test "$extra_verbose" = "yes" && cat << \EOF
10520     Defining HAVE_TTY
10521 EOF
10522 cat >> confdefs.h <<\EOF
10523 #define HAVE_TTY 1
10524 EOF
10525 }
10526
10527   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
10528    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\""
10529  fi
10530
10531     if test -z "$with_ncurses"; then
10532     
10533 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10534 echo "configure:10535: checking for tgetent in -lncurses" >&5
10535 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10536
10537 xe_check_libs=" -lncurses "
10538 cat > conftest.$ac_ext <<EOF
10539 #line 10540 "configure"
10540 #include "confdefs.h"
10541 /* Override any gcc2 internal prototype to avoid an error.  */
10542 /* We use char because int might match the return type of a gcc2
10543     builtin and then its argument prototype would still apply.  */
10544 char tgetent();
10545
10546 int main() {
10547 tgetent()
10548 ; return 0; }
10549 EOF
10550 if { (eval echo configure:10551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10551   rm -rf conftest*
10552   eval "ac_cv_lib_$ac_lib_var=yes"
10553 else
10554   echo "configure: failed program was:" >&5
10555   cat conftest.$ac_ext >&5
10556   rm -rf conftest*
10557   eval "ac_cv_lib_$ac_lib_var=no"
10558 fi
10559 rm -f conftest*
10560 xe_check_libs=""
10561
10562 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10563   echo "$ac_t""yes" 1>&6
10564   with_ncurses=yes
10565 else
10566   echo "$ac_t""no" 1>&6
10567 with_ncurses=no
10568 fi
10569
10570
10571   fi
10572   if test "$with_ncurses" = "yes"; then
10573     { test "$extra_verbose" = "yes" && cat << \EOF
10574     Defining HAVE_NCURSES
10575 EOF
10576 cat >> confdefs.h <<\EOF
10577 #define HAVE_NCURSES 1
10578 EOF
10579 }
10580
10581     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10582 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10583 echo "configure:10584: checking for ncurses/curses.h" >&5
10584
10585 cat > conftest.$ac_ext <<EOF
10586 #line 10587 "configure"
10587 #include "confdefs.h"
10588 #include <ncurses/curses.h>
10589 EOF
10590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10591 { (eval echo configure:10592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10592 ac_err=`grep -v '^ *+' conftest.out`
10593 if test -z "$ac_err"; then
10594   rm -rf conftest*
10595   eval "ac_cv_header_$ac_safe=yes"
10596 else
10597   echo "$ac_err" >&5
10598   echo "configure: failed program was:" >&5
10599   cat conftest.$ac_ext >&5
10600   rm -rf conftest*
10601   eval "ac_cv_header_$ac_safe=no"
10602 fi
10603 rm -f conftest*
10604 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10605   echo "$ac_t""yes" 1>&6
10606   curses_h_path=ncurses/curses.h
10607 else
10608   echo "$ac_t""no" 1>&6
10609 fi
10610
10611     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10612 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10613 echo "configure:10614: checking for ncurses/term.h" >&5
10614
10615 cat > conftest.$ac_ext <<EOF
10616 #line 10617 "configure"
10617 #include "confdefs.h"
10618 #include <ncurses/term.h>
10619 EOF
10620 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10621 { (eval echo configure:10622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10622 ac_err=`grep -v '^ *+' conftest.out`
10623 if test -z "$ac_err"; then
10624   rm -rf conftest*
10625   eval "ac_cv_header_$ac_safe=yes"
10626 else
10627   echo "$ac_err" >&5
10628   echo "configure: failed program was:" >&5
10629   cat conftest.$ac_ext >&5
10630   rm -rf conftest*
10631   eval "ac_cv_header_$ac_safe=no"
10632 fi
10633 rm -f conftest*
10634 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10635   echo "$ac_t""yes" 1>&6
10636   term_h_path=ncurses/term.h
10637 else
10638   echo "$ac_t""no" 1>&6
10639 fi
10640
10641     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10642    echo "    xemacs will be linked with \"terminfo.o\""
10643  fi
10644     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10645
10646     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10647                         save_c_switch_site="$c_switch_site"
10648       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10649       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10650 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10651 echo "configure:10652: checking for ncurses/curses.h" >&5
10652
10653 cat > conftest.$ac_ext <<EOF
10654 #line 10655 "configure"
10655 #include "confdefs.h"
10656 #include <ncurses/curses.h>
10657 EOF
10658 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10659 { (eval echo configure:10660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10660 ac_err=`grep -v '^ *+' conftest.out`
10661 if test -z "$ac_err"; then
10662   rm -rf conftest*
10663   eval "ac_cv_header_$ac_safe=yes"
10664 else
10665   echo "$ac_err" >&5
10666   echo "configure: failed program was:" >&5
10667   cat conftest.$ac_ext >&5
10668   rm -rf conftest*
10669   eval "ac_cv_header_$ac_safe=no"
10670 fi
10671 rm -f conftest*
10672 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10673   echo "$ac_t""yes" 1>&6
10674   curses_h_path=ncurses/curses.h
10675 else
10676   echo "$ac_t""no" 1>&6
10677 fi
10678
10679       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10680         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10681         else c_switch_site="$save_c_switch_site"
10682       fi
10683     fi
10684   else         if test "$have_terminfo" = "yes"; then
10685       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10686    echo "    xemacs will be linked with \"terminfo.o\""
10687  fi
10688       if test -n "$libs_termcap"; then
10689         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10690       else
10691         for lib in curses termlib termcap; do
10692           
10693 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10694 echo "configure:10695: checking for tgetent in -l$lib" >&5
10695 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10696
10697 xe_check_libs=" -l$lib "
10698 cat > conftest.$ac_ext <<EOF
10699 #line 10700 "configure"
10700 #include "confdefs.h"
10701 /* Override any gcc2 internal prototype to avoid an error.  */
10702 /* We use char because int might match the return type of a gcc2
10703     builtin and then its argument prototype would still apply.  */
10704 char tgetent();
10705
10706 int main() {
10707 tgetent()
10708 ; return 0; }
10709 EOF
10710 if { (eval echo configure:10711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10711   rm -rf conftest*
10712   eval "ac_cv_lib_$ac_lib_var=yes"
10713 else
10714   echo "configure: failed program was:" >&5
10715   cat conftest.$ac_ext >&5
10716   rm -rf conftest*
10717   eval "ac_cv_lib_$ac_lib_var=no"
10718 fi
10719 rm -f conftest*
10720 xe_check_libs=""
10721
10722 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10723   echo "$ac_t""yes" 1>&6
10724   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10725 else
10726   echo "$ac_t""no" 1>&6
10727 fi
10728
10729
10730         done
10731       fi
10732     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10733    echo "    xemacs will be linked with \"tparam.o\""
10734  fi
10735                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10736       if test -n "$libs_termcap"; then
10737         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10738       else
10739         
10740 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10741 echo "configure:10742: checking for tgetent in -lcurses" >&5
10742 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10743
10744 xe_check_libs=" -lcurses "
10745 cat > conftest.$ac_ext <<EOF
10746 #line 10747 "configure"
10747 #include "confdefs.h"
10748 /* Override any gcc2 internal prototype to avoid an error.  */
10749 /* We use char because int might match the return type of a gcc2
10750     builtin and then its argument prototype would still apply.  */
10751 char tgetent();
10752
10753 int main() {
10754 tgetent()
10755 ; return 0; }
10756 EOF
10757 if { (eval echo configure:10758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10758   rm -rf conftest*
10759   eval "ac_cv_lib_$ac_lib_var=yes"
10760 else
10761   echo "configure: failed program was:" >&5
10762   cat conftest.$ac_ext >&5
10763   rm -rf conftest*
10764   eval "ac_cv_lib_$ac_lib_var=no"
10765 fi
10766 rm -f conftest*
10767 xe_check_libs=""
10768
10769 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10770   echo "$ac_t""yes" 1>&6
10771   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
10772 else
10773   echo "$ac_t""no" 1>&6
10774 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
10775 echo "configure:10776: checking for tgetent in -ltermcap" >&5
10776 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
10777
10778 xe_check_libs=" -ltermcap "
10779 cat > conftest.$ac_ext <<EOF
10780 #line 10781 "configure"
10781 #include "confdefs.h"
10782 /* Override any gcc2 internal prototype to avoid an error.  */
10783 /* We use char because int might match the return type of a gcc2
10784     builtin and then its argument prototype would still apply.  */
10785 char tgetent();
10786
10787 int main() {
10788 tgetent()
10789 ; return 0; }
10790 EOF
10791 if { (eval echo configure:10792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10792   rm -rf conftest*
10793   eval "ac_cv_lib_$ac_lib_var=yes"
10794 else
10795   echo "configure: failed program was:" >&5
10796   cat conftest.$ac_ext >&5
10797   rm -rf conftest*
10798   eval "ac_cv_lib_$ac_lib_var=no"
10799 fi
10800 rm -f conftest*
10801 xe_check_libs=""
10802
10803 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10804   echo "$ac_t""yes" 1>&6
10805   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
10806 else
10807   echo "$ac_t""no" 1>&6
10808 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
10809    echo "    xemacs will be linked with \"termcap.o\""
10810  fi
10811 fi
10812
10813
10814 fi
10815
10816
10817       fi
10818     fi
10819   fi
10820   { test "$extra_verbose" = "yes" && cat << EOF
10821     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
10822 EOF
10823 cat >> confdefs.h <<EOF
10824 #define CURSES_H_PATH "${curses_h_path-curses.h}"
10825 EOF
10826 }
10827
10828   { test "$extra_verbose" = "yes" && cat << EOF
10829     Defining TERM_H_PATH = "${term_h_path-term.h}"
10830 EOF
10831 cat >> confdefs.h <<EOF
10832 #define TERM_H_PATH "${term_h_path-term.h}"
10833 EOF
10834 }
10835
10836
10837     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
10838 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
10839 echo "configure:10840: checking for gpm.h" >&5
10840
10841 cat > conftest.$ac_ext <<EOF
10842 #line 10843 "configure"
10843 #include "confdefs.h"
10844 #include <gpm.h>
10845 EOF
10846 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10847 { (eval echo configure:10848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10848 ac_err=`grep -v '^ *+' conftest.out`
10849 if test -z "$ac_err"; then
10850   rm -rf conftest*
10851   eval "ac_cv_header_$ac_safe=yes"
10852 else
10853   echo "$ac_err" >&5
10854   echo "configure: failed program was:" >&5
10855   cat conftest.$ac_ext >&5
10856   rm -rf conftest*
10857   eval "ac_cv_header_$ac_safe=no"
10858 fi
10859 rm -f conftest*
10860 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10861   echo "$ac_t""yes" 1>&6
10862   :
10863 else
10864   echo "$ac_t""no" 1>&6
10865 with_gpm=no
10866 fi
10867  }
10868   test -z "$with_gpm" && { 
10869 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
10870 echo "configure:10871: checking for Gpm_Open in -lgpm" >&5
10871 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
10872
10873 xe_check_libs=" -lgpm "
10874 cat > conftest.$ac_ext <<EOF
10875 #line 10876 "configure"
10876 #include "confdefs.h"
10877 /* Override any gcc2 internal prototype to avoid an error.  */
10878 /* We use char because int might match the return type of a gcc2
10879     builtin and then its argument prototype would still apply.  */
10880 char Gpm_Open();
10881
10882 int main() {
10883 Gpm_Open()
10884 ; return 0; }
10885 EOF
10886 if { (eval echo configure:10887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10887   rm -rf conftest*
10888   eval "ac_cv_lib_$ac_lib_var=yes"
10889 else
10890   echo "configure: failed program was:" >&5
10891   cat conftest.$ac_ext >&5
10892   rm -rf conftest*
10893   eval "ac_cv_lib_$ac_lib_var=no"
10894 fi
10895 rm -f conftest*
10896 xe_check_libs=""
10897
10898 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10899   echo "$ac_t""yes" 1>&6
10900   with_gpm=yes
10901 else
10902   echo "$ac_t""no" 1>&6
10903 with_gpm=no
10904 fi
10905
10906  }
10907   if test "$with_gpm" = "yes"; then
10908     { test "$extra_verbose" = "yes" && cat << \EOF
10909     Defining HAVE_GPM
10910 EOF
10911 cat >> confdefs.h <<\EOF
10912 #define HAVE_GPM 1
10913 EOF
10914 }
10915
10916     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
10917    echo "    xemacs will be linked with \"gpmevent.o\""
10918  fi
10919     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
10920   fi
10921
10922 else   for feature in ncurses gpm; do
10923     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
10924       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
10925     fi
10926     eval "with_${feature}=no"
10927   done
10928 fi 
10929 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
10930    echo "    xemacs will be linked with \"event-unixoid.o\""
10931  fi
10932
10933
10934 echo "checking for database support" 1>&6
10935 echo "configure:10936: checking for database support" >&5
10936
10937 if test "$with_database_gnudbm" != "no"; then
10938   for ac_hdr in ndbm.h
10939 do
10940 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10941 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10942 echo "configure:10943: checking for $ac_hdr" >&5
10943
10944 cat > conftest.$ac_ext <<EOF
10945 #line 10946 "configure"
10946 #include "confdefs.h"
10947 #include <$ac_hdr>
10948 EOF
10949 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10950 { (eval echo configure:10951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10951 ac_err=`grep -v '^ *+' conftest.out`
10952 if test -z "$ac_err"; then
10953   rm -rf conftest*
10954   eval "ac_cv_header_$ac_safe=yes"
10955 else
10956   echo "$ac_err" >&5
10957   echo "configure: failed program was:" >&5
10958   cat conftest.$ac_ext >&5
10959   rm -rf conftest*
10960   eval "ac_cv_header_$ac_safe=no"
10961 fi
10962 rm -f conftest*
10963 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10964   echo "$ac_t""yes" 1>&6
10965     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10966   { test "$extra_verbose" = "yes" && cat << EOF
10967     Defining $ac_tr_hdr
10968 EOF
10969 cat >> confdefs.h <<EOF
10970 #define $ac_tr_hdr 1
10971 EOF
10972 }
10973  have_ndbm_h=yes
10974 else
10975   echo "$ac_t""no" 1>&6
10976 fi
10977 done
10978
10979   if test "$have_ndbm_h" = "yes"; then
10980     
10981 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
10982 echo "configure:10983: checking for dbm_open in -lgdbm" >&5
10983 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
10984
10985 xe_check_libs=" -lgdbm "
10986 cat > conftest.$ac_ext <<EOF
10987 #line 10988 "configure"
10988 #include "confdefs.h"
10989 /* Override any gcc2 internal prototype to avoid an error.  */
10990 /* We use char because int might match the return type of a gcc2
10991     builtin and then its argument prototype would still apply.  */
10992 char dbm_open();
10993
10994 int main() {
10995 dbm_open()
10996 ; return 0; }
10997 EOF
10998 if { (eval echo configure:10999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10999   rm -rf conftest*
11000   eval "ac_cv_lib_$ac_lib_var=yes"
11001 else
11002   echo "configure: failed program was:" >&5
11003   cat conftest.$ac_ext >&5
11004   rm -rf conftest*
11005   eval "ac_cv_lib_$ac_lib_var=no"
11006 fi
11007 rm -f conftest*
11008 xe_check_libs=""
11009
11010 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11011   echo "$ac_t""yes" 1>&6
11012   with_database_gnudbm=yes have_libgdbm=yes
11013 else
11014   echo "$ac_t""no" 1>&6
11015 fi
11016
11017
11018   fi
11019   if test "$with_database_gnudbm" != "yes"; then
11020     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11021 echo "configure:11022: checking for dbm_open" >&5
11022
11023 cat > conftest.$ac_ext <<EOF
11024 #line 11025 "configure"
11025 #include "confdefs.h"
11026 /* System header to define __stub macros and hopefully few prototypes,
11027     which can conflict with char dbm_open(); below.  */
11028 #include <assert.h>
11029 /* Override any gcc2 internal prototype to avoid an error.  */
11030 /* We use char because int might match the return type of a gcc2
11031     builtin and then its argument prototype would still apply.  */
11032 char dbm_open();
11033
11034 int main() {
11035
11036 /* The GNU C library defines this for functions which it implements
11037     to always fail with ENOSYS.  Some functions are actually named
11038     something starting with __ and the normal name is an alias.  */
11039 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11040 choke me
11041 #else
11042 dbm_open();
11043 #endif
11044
11045 ; return 0; }
11046 EOF
11047 if { (eval echo configure:11048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11048   rm -rf conftest*
11049   eval "ac_cv_func_dbm_open=yes"
11050 else
11051   echo "configure: failed program was:" >&5
11052   cat conftest.$ac_ext >&5
11053   rm -rf conftest*
11054   eval "ac_cv_func_dbm_open=no"
11055 fi
11056 rm -f conftest*
11057
11058 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11059   echo "$ac_t""yes" 1>&6
11060   with_database_gnudbm=yes
11061 else
11062   echo "$ac_t""no" 1>&6
11063 fi
11064
11065       fi
11066   if test "$with_database_gnudbm" = "yes"; then
11067     { test "$extra_verbose" = "yes" && cat << \EOF
11068     Defining HAVE_DBM
11069 EOF
11070 cat >> confdefs.h <<\EOF
11071 #define HAVE_DBM 1
11072 EOF
11073 }
11074
11075     test "$have_libgdbm" = "yes" && LIBS="-lgdbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgdbm\" to \$LIBS"; fi
11076     with_database_dbm=no
11077   else with_database_gnudbm=no
11078   fi
11079 fi
11080
11081 if test "$with_database_dbm" != "no"; then
11082   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11083 echo "configure:11084: checking for dbm_open" >&5
11084
11085 cat > conftest.$ac_ext <<EOF
11086 #line 11087 "configure"
11087 #include "confdefs.h"
11088 /* System header to define __stub macros and hopefully few prototypes,
11089     which can conflict with char dbm_open(); below.  */
11090 #include <assert.h>
11091 /* Override any gcc2 internal prototype to avoid an error.  */
11092 /* We use char because int might match the return type of a gcc2
11093     builtin and then its argument prototype would still apply.  */
11094 char dbm_open();
11095
11096 int main() {
11097
11098 /* The GNU C library defines this for functions which it implements
11099     to always fail with ENOSYS.  Some functions are actually named
11100     something starting with __ and the normal name is an alias.  */
11101 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11102 choke me
11103 #else
11104 dbm_open();
11105 #endif
11106
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_func_dbm_open=yes"
11112 else
11113   echo "configure: failed program was:" >&5
11114   cat conftest.$ac_ext >&5
11115   rm -rf conftest*
11116   eval "ac_cv_func_dbm_open=no"
11117 fi
11118 rm -f conftest*
11119
11120 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11121   echo "$ac_t""yes" 1>&6
11122   with_database_dbm=yes need_libdbm=no
11123 else
11124   echo "$ac_t""no" 1>&6
11125 fi
11126
11127   if test "$need_libdbm" != "no"; then
11128     
11129 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11130 echo "configure:11131: checking for dbm_open in -ldbm" >&5
11131 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11132
11133 xe_check_libs=" -ldbm "
11134 cat > conftest.$ac_ext <<EOF
11135 #line 11136 "configure"
11136 #include "confdefs.h"
11137 /* Override any gcc2 internal prototype to avoid an error.  */
11138 /* We use char because int might match the return type of a gcc2
11139     builtin and then its argument prototype would still apply.  */
11140 char dbm_open();
11141
11142 int main() {
11143 dbm_open()
11144 ; return 0; }
11145 EOF
11146 if { (eval echo configure:11147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11147   rm -rf conftest*
11148   eval "ac_cv_lib_$ac_lib_var=yes"
11149 else
11150   echo "configure: failed program was:" >&5
11151   cat conftest.$ac_ext >&5
11152   rm -rf conftest*
11153   eval "ac_cv_lib_$ac_lib_var=no"
11154 fi
11155 rm -f conftest*
11156 xe_check_libs=""
11157
11158 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11159   echo "$ac_t""yes" 1>&6
11160   with_database_dbm=yes need_libdbm=yes
11161 else
11162   echo "$ac_t""no" 1>&6
11163 fi
11164
11165
11166   fi
11167   if test "$with_database_dbm" = "yes"; then
11168     { test "$extra_verbose" = "yes" && cat << \EOF
11169     Defining HAVE_DBM
11170 EOF
11171 cat >> confdefs.h <<\EOF
11172 #define HAVE_DBM 1
11173 EOF
11174 }
11175
11176     test "$need_libdbm" = "yes" && LIBS="-ldbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldbm\" to \$LIBS"; fi
11177   else with_database_dbm=no
11178   fi
11179 fi
11180
11181 if test "$with_database_berkdb" != "no"; then
11182   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11183 echo "configure:11184: checking for Berkeley db.h" >&5
11184   for path in "db/db.h" "db.h"; do
11185     cat > conftest.$ac_ext <<EOF
11186 #line 11187 "configure"
11187 #include "confdefs.h"
11188 #ifdef HAVE_INTTYPES_H
11189 #define __BIT_TYPES_DEFINED__
11190 #include <inttypes.h>
11191 typedef uint8_t  u_int8_t;
11192 typedef uint16_t u_int16_t;
11193 typedef uint32_t u_int32_t;
11194 #ifdef WE_DONT_NEED_QUADS
11195 typedef uint64_t u_int64_t;
11196 #endif
11197 #endif
11198 #include <$path>
11199
11200 int main() {
11201
11202 ; return 0; }
11203 EOF
11204 if { (eval echo configure:11205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11205   rm -rf conftest*
11206   db_h_path="$path"; break
11207 else
11208   echo "configure: failed program was:" >&5
11209   cat conftest.$ac_ext >&5
11210 fi
11211 rm -f conftest*
11212   done
11213   if test -z "$db_h_path"
11214   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11215   else echo "$ac_t""$db_h_path" 1>&6
11216   fi
11217
11218   if test "$with_database_berkdb" != "no"; then
11219     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11220 echo "configure:11221: checking for Berkeley DB version" >&5
11221     cat > conftest.$ac_ext <<EOF
11222 #line 11223 "configure"
11223 #include "confdefs.h"
11224 #include <$db_h_path>
11225 #if DB_VERSION_MAJOR > 1
11226 yes
11227 #endif
11228
11229 EOF
11230 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11231   egrep "yes" >/dev/null 2>&1; then
11232   rm -rf conftest*
11233   echo "$ac_t""2" 1>&6; dbfunc=db_open
11234 else
11235   rm -rf conftest*
11236   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11237 fi
11238 rm -f conftest*
11239
11240     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11241 echo "configure:11242: checking for $dbfunc" >&5
11242
11243 cat > conftest.$ac_ext <<EOF
11244 #line 11245 "configure"
11245 #include "confdefs.h"
11246 /* System header to define __stub macros and hopefully few prototypes,
11247     which can conflict with char $dbfunc(); below.  */
11248 #include <assert.h>
11249 /* Override any gcc2 internal prototype to avoid an error.  */
11250 /* We use char because int might match the return type of a gcc2
11251     builtin and then its argument prototype would still apply.  */
11252 char $dbfunc();
11253
11254 int main() {
11255
11256 /* The GNU C library defines this for functions which it implements
11257     to always fail with ENOSYS.  Some functions are actually named
11258     something starting with __ and the normal name is an alias.  */
11259 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11260 choke me
11261 #else
11262 $dbfunc();
11263 #endif
11264
11265 ; return 0; }
11266 EOF
11267 if { (eval echo configure:11268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11268   rm -rf conftest*
11269   eval "ac_cv_func_$dbfunc=yes"
11270 else
11271   echo "configure: failed program was:" >&5
11272   cat conftest.$ac_ext >&5
11273   rm -rf conftest*
11274   eval "ac_cv_func_$dbfunc=no"
11275 fi
11276 rm -f conftest*
11277
11278 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11279   echo "$ac_t""yes" 1>&6
11280   with_database_berkdb=yes need_libdb=no
11281 else
11282   echo "$ac_t""no" 1>&6
11283
11284     
11285 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11286 echo "configure:11287: checking for $dbfunc in -ldb" >&5
11287 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11288
11289 xe_check_libs=" -ldb "
11290 cat > conftest.$ac_ext <<EOF
11291 #line 11292 "configure"
11292 #include "confdefs.h"
11293 /* Override any gcc2 internal prototype to avoid an error.  */
11294 /* We use char because int might match the return type of a gcc2
11295     builtin and then its argument prototype would still apply.  */
11296 char $dbfunc();
11297
11298 int main() {
11299 $dbfunc()
11300 ; return 0; }
11301 EOF
11302 if { (eval echo configure:11303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11303   rm -rf conftest*
11304   eval "ac_cv_lib_$ac_lib_var=yes"
11305 else
11306   echo "configure: failed program was:" >&5
11307   cat conftest.$ac_ext >&5
11308   rm -rf conftest*
11309   eval "ac_cv_lib_$ac_lib_var=no"
11310 fi
11311 rm -f conftest*
11312 xe_check_libs=""
11313
11314 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11315   echo "$ac_t""yes" 1>&6
11316   with_database_berkdb=yes need_libdb=yes
11317 else
11318   echo "$ac_t""no" 1>&6
11319 fi
11320
11321
11322 fi
11323
11324   fi
11325
11326   if test "$with_database_berkdb" = "yes"; then
11327     { test "$extra_verbose" = "yes" && cat << EOF
11328     Defining DB_H_PATH = "$db_h_path"
11329 EOF
11330 cat >> confdefs.h <<EOF
11331 #define DB_H_PATH "$db_h_path"
11332 EOF
11333 }
11334
11335     { test "$extra_verbose" = "yes" && cat << \EOF
11336     Defining HAVE_BERKELEY_DB
11337 EOF
11338 cat >> confdefs.h <<\EOF
11339 #define HAVE_BERKELEY_DB 1
11340 EOF
11341 }
11342
11343     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11344   else with_database_berkdb=no
11345   fi
11346 fi
11347
11348 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11349      != "no no no"; then
11350   { test "$extra_verbose" = "yes" && cat << \EOF
11351     Defining HAVE_DATABASE
11352 EOF
11353 cat >> confdefs.h <<\EOF
11354 #define HAVE_DATABASE 1
11355 EOF
11356 }
11357
11358   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11359    echo "    xemacs will be linked with \"database.o\""
11360  fi
11361 fi
11362
11363 if test "$with_socks" = "yes"; then
11364   
11365 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11366 echo "configure:11367: checking for SOCKSinit in -lsocks" >&5
11367 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11368
11369 xe_check_libs=" -lsocks "
11370 cat > conftest.$ac_ext <<EOF
11371 #line 11372 "configure"
11372 #include "confdefs.h"
11373 /* Override any gcc2 internal prototype to avoid an error.  */
11374 /* We use char because int might match the return type of a gcc2
11375     builtin and then its argument prototype would still apply.  */
11376 char SOCKSinit();
11377
11378 int main() {
11379 SOCKSinit()
11380 ; return 0; }
11381 EOF
11382 if { (eval echo configure:11383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11383   rm -rf conftest*
11384   eval "ac_cv_lib_$ac_lib_var=yes"
11385 else
11386   echo "configure: failed program was:" >&5
11387   cat conftest.$ac_ext >&5
11388   rm -rf conftest*
11389   eval "ac_cv_lib_$ac_lib_var=no"
11390 fi
11391 rm -f conftest*
11392 xe_check_libs=""
11393
11394 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11395   echo "$ac_t""yes" 1>&6
11396     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11397     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11398   { test "$extra_verbose" = "yes" && cat << EOF
11399     Defining $ac_tr_lib
11400 EOF
11401 cat >> confdefs.h <<EOF
11402 #define $ac_tr_lib 1
11403 EOF
11404 }
11405
11406   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11407
11408 else
11409   echo "$ac_t""no" 1>&6
11410 fi
11411
11412
11413   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11414     Defining HAVE_SOCKS
11415 EOF
11416 cat >> confdefs.h <<\EOF
11417 #define HAVE_SOCKS 1
11418 EOF
11419 }
11420
11421 fi
11422
11423 if test "$usage_tracking" = "yes"; then
11424   { test "$extra_verbose" = "yes" && cat << \EOF
11425     Defining USAGE_TRACKING
11426 EOF
11427 cat >> confdefs.h <<\EOF
11428 #define USAGE_TRACKING 1
11429 EOF
11430 }
11431
11432   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11433 fi
11434
11435 test -z "$with_shlib" && test "$opsys $machine" = "cygwin32 intel386" && with_shlib=no
11436
11437 for ac_hdr in dlfcn.h
11438 do
11439 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11440 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11441 echo "configure:11442: checking for $ac_hdr" >&5
11442
11443 cat > conftest.$ac_ext <<EOF
11444 #line 11445 "configure"
11445 #include "confdefs.h"
11446 #include <$ac_hdr>
11447 EOF
11448 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11449 { (eval echo configure:11450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11450 ac_err=`grep -v '^ *+' conftest.out`
11451 if test -z "$ac_err"; then
11452   rm -rf conftest*
11453   eval "ac_cv_header_$ac_safe=yes"
11454 else
11455   echo "$ac_err" >&5
11456   echo "configure: failed program was:" >&5
11457   cat conftest.$ac_ext >&5
11458   rm -rf conftest*
11459   eval "ac_cv_header_$ac_safe=no"
11460 fi
11461 rm -f conftest*
11462 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11463   echo "$ac_t""yes" 1>&6
11464     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11465   { test "$extra_verbose" = "yes" && cat << EOF
11466     Defining $ac_tr_hdr
11467 EOF
11468 cat >> confdefs.h <<EOF
11469 #define $ac_tr_hdr 1
11470 EOF
11471 }
11472  have_dlfcn=yes
11473 else
11474   echo "$ac_t""no" 1>&6
11475 fi
11476 done
11477
11478 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11479 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11480 echo "configure:11481: checking for dlopen in -ldl" >&5
11481 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11482
11483 xe_check_libs=" -ldl "
11484 cat > conftest.$ac_ext <<EOF
11485 #line 11486 "configure"
11486 #include "confdefs.h"
11487 /* Override any gcc2 internal prototype to avoid an error.  */
11488 /* We use char because int might match the return type of a gcc2
11489     builtin and then its argument prototype would still apply.  */
11490 char dlopen();
11491
11492 int main() {
11493 dlopen()
11494 ; return 0; }
11495 EOF
11496 if { (eval echo configure:11497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11497   rm -rf conftest*
11498   eval "ac_cv_lib_$ac_lib_var=yes"
11499 else
11500   echo "configure: failed program was:" >&5
11501   cat conftest.$ac_ext >&5
11502   rm -rf conftest*
11503   eval "ac_cv_lib_$ac_lib_var=no"
11504 fi
11505 rm -f conftest*
11506 xe_check_libs=""
11507
11508 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11509   echo "$ac_t""yes" 1>&6
11510   { test "$extra_verbose" = "yes" && cat << \EOF
11511     Defining HAVE_DLOPEN
11512 EOF
11513 cat >> confdefs.h <<\EOF
11514 #define HAVE_DLOPEN 1
11515 EOF
11516 }
11517  DLL_LIB=dl;  with_shlib=yes
11518 else
11519   echo "$ac_t""no" 1>&6
11520 fi
11521
11522  }
11523 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11524 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11525 echo "configure:11526: checking for _dlopen in -lc" >&5
11526 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11527
11528 xe_check_libs=" -lc "
11529 cat > conftest.$ac_ext <<EOF
11530 #line 11531 "configure"
11531 #include "confdefs.h"
11532 /* Override any gcc2 internal prototype to avoid an error.  */
11533 /* We use char because int might match the return type of a gcc2
11534     builtin and then its argument prototype would still apply.  */
11535 char _dlopen();
11536
11537 int main() {
11538 _dlopen()
11539 ; return 0; }
11540 EOF
11541 if { (eval echo configure:11542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11542   rm -rf conftest*
11543   eval "ac_cv_lib_$ac_lib_var=yes"
11544 else
11545   echo "configure: failed program was:" >&5
11546   cat conftest.$ac_ext >&5
11547   rm -rf conftest*
11548   eval "ac_cv_lib_$ac_lib_var=no"
11549 fi
11550 rm -f conftest*
11551 xe_check_libs=""
11552
11553 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11554   echo "$ac_t""yes" 1>&6
11555   { test "$extra_verbose" = "yes" && cat << \EOF
11556     Defining HAVE_DLOPEN
11557 EOF
11558 cat >> confdefs.h <<\EOF
11559 #define HAVE_DLOPEN 1
11560 EOF
11561 }
11562  DLL_LIB=;   with_shlib=yes
11563 else
11564   echo "$ac_t""no" 1>&6
11565 fi
11566
11567  }
11568 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11569 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11570 echo "configure:11571: checking for dlopen in -lc" >&5
11571 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11572
11573 xe_check_libs=" -lc "
11574 cat > conftest.$ac_ext <<EOF
11575 #line 11576 "configure"
11576 #include "confdefs.h"
11577 /* Override any gcc2 internal prototype to avoid an error.  */
11578 /* We use char because int might match the return type of a gcc2
11579     builtin and then its argument prototype would still apply.  */
11580 char dlopen();
11581
11582 int main() {
11583 dlopen()
11584 ; return 0; }
11585 EOF
11586 if { (eval echo configure:11587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11587   rm -rf conftest*
11588   eval "ac_cv_lib_$ac_lib_var=yes"
11589 else
11590   echo "configure: failed program was:" >&5
11591   cat conftest.$ac_ext >&5
11592   rm -rf conftest*
11593   eval "ac_cv_lib_$ac_lib_var=no"
11594 fi
11595 rm -f conftest*
11596 xe_check_libs=""
11597
11598 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11599   echo "$ac_t""yes" 1>&6
11600   { test "$extra_verbose" = "yes" && cat << \EOF
11601     Defining HAVE_DLOPEN
11602 EOF
11603 cat >> confdefs.h <<\EOF
11604 #define HAVE_DLOPEN 1
11605 EOF
11606 }
11607  DLL_LIB=;   with_shlib=yes
11608 else
11609   echo "$ac_t""no" 1>&6
11610 fi
11611
11612  }
11613 test -z "$with_shlib" && { 
11614 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11615 echo "configure:11616: checking for shl_load in -ldld" >&5
11616 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11617
11618 xe_check_libs=" -ldld "
11619 cat > conftest.$ac_ext <<EOF
11620 #line 11621 "configure"
11621 #include "confdefs.h"
11622 /* Override any gcc2 internal prototype to avoid an error.  */
11623 /* We use char because int might match the return type of a gcc2
11624     builtin and then its argument prototype would still apply.  */
11625 char shl_load();
11626
11627 int main() {
11628 shl_load()
11629 ; return 0; }
11630 EOF
11631 if { (eval echo configure:11632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11632   rm -rf conftest*
11633   eval "ac_cv_lib_$ac_lib_var=yes"
11634 else
11635   echo "configure: failed program was:" >&5
11636   cat conftest.$ac_ext >&5
11637   rm -rf conftest*
11638   eval "ac_cv_lib_$ac_lib_var=no"
11639 fi
11640 rm -f conftest*
11641 xe_check_libs=""
11642
11643 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11644   echo "$ac_t""yes" 1>&6
11645   { test "$extra_verbose" = "yes" && cat << \EOF
11646     Defining HAVE_SHL_LOAD
11647 EOF
11648 cat >> confdefs.h <<\EOF
11649 #define HAVE_SHL_LOAD 1
11650 EOF
11651 }
11652  DLL_LIB=dld; with_shlib=yes
11653 else
11654   echo "$ac_t""no" 1>&6
11655 fi
11656
11657  }
11658 test -z "$with_shlib" && { 
11659 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11660 echo "configure:11661: checking for dld_init in -ldld" >&5
11661 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11662
11663 xe_check_libs=" -ldld "
11664 cat > conftest.$ac_ext <<EOF
11665 #line 11666 "configure"
11666 #include "confdefs.h"
11667 /* Override any gcc2 internal prototype to avoid an error.  */
11668 /* We use char because int might match the return type of a gcc2
11669     builtin and then its argument prototype would still apply.  */
11670 char dld_init();
11671
11672 int main() {
11673 dld_init()
11674 ; return 0; }
11675 EOF
11676 if { (eval echo configure:11677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11677   rm -rf conftest*
11678   eval "ac_cv_lib_$ac_lib_var=yes"
11679 else
11680   echo "configure: failed program was:" >&5
11681   cat conftest.$ac_ext >&5
11682   rm -rf conftest*
11683   eval "ac_cv_lib_$ac_lib_var=no"
11684 fi
11685 rm -f conftest*
11686 xe_check_libs=""
11687
11688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11689   echo "$ac_t""yes" 1>&6
11690   { test "$extra_verbose" = "yes" && cat << \EOF
11691     Defining HAVE_DLD_INIT
11692 EOF
11693 cat >> confdefs.h <<\EOF
11694 #define HAVE_DLD_INIT 1
11695 EOF
11696 }
11697  DLL_LIB=dld; with_shlib=yes
11698 else
11699   echo "$ac_t""no" 1>&6
11700 fi
11701
11702  }
11703 if test "$with_shlib" = "yes"; then
11704   { test "$extra_verbose" = "yes" && cat << \EOF
11705     Defining HAVE_SHLIB
11706 EOF
11707 cat >> confdefs.h <<\EOF
11708 #define HAVE_SHLIB 1
11709 EOF
11710 }
11711
11712   extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
11713    echo "    xemacs will be linked with \"sysdll.o\""
11714  fi
11715   extra_objs="$extra_objs dll.o" &&  if test "$extra_verbose" = "yes"; then
11716    echo "    xemacs will be linked with \"dll.o\""
11717  fi
11718   test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
11719   
11720 dll_ld="ld"
11721 dll_lflags="-shared"
11722 dll_cflags="-r"
11723 dll_oflags="-o "
11724
11725 echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6
11726 echo "configure:11727: checking how to build a shared library" >&5
11727 case `uname -rs` in
11728         UNIX_SV*|UNIX_System_V*)
11729                 dll_lflags="-G"
11730                 dll_cflags=-Kpic
11731                 dll_ld="ld"
11732                 ;;
11733         BSD/OS*)
11734                 dll_cflags=
11735                 dll_lflags="-r"
11736                 dll_ld="shlicc2"
11737                 ;;
11738         FreeBSD*2*)
11739                 dll_lflags="-Bshareable"
11740                 dll_cflags="-fPIC -DPIC"
11741                 dll_ld=ld
11742                 ;;
11743         SunOS*4.*)
11744                 dll_cflags="-P"
11745                 dll_lflags="-dp -assert pure-text -assert nodefinitions"
11746                 ;;
11747         SunOS*5.*)
11748                 dll_ld="cc"
11749                 dll_cflags="-KPIC"
11750                 dll_lflags="-G"
11751                 dll_oflags="-W0,-y-o -W0,-y"
11752                 ;;      
11753         IRIX*5.*|IRIX*6.*)
11754                 dll_cflags="-KPIC"
11755                 ;;
11756         OSF1*)
11757                 ;;
11758         HP-UX*)
11759                 dll_ld="ld"
11760                 dll_lflags="-b"
11761                 dll_cflags="+z"
11762                 ;;
11763         SCO_SV*)
11764                 dll_ld="ld"
11765                 dll_lflags="-G"
11766                 dll_cflags="-Kpic"
11767                 ;;
11768         AIX*)
11769                 dll_lflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:\${@:.ell=.exp} -b noentry -lc"
11770                 dll_ld="ld"
11771                 ;;
11772         *)
11773                 ;;
11774         esac
11775
11776         if test "$GCC" = "yes" ; then
11777                 dll_cflags="-fPIC"
11778                 case `uname -rs` in
11779                 SunOS*5.*)
11780                         dll_ld="ld"
11781                         dll_oflags="-o "
11782                         dll_lflags="-G"
11783                         ;;
11784                 SCO_SV*)
11785                         dll_ld="ld"
11786                         dll_lflags="-G"
11787                         dll_cflags="-b elf"
11788                         ;;
11789                 FreeBSD*)
11790                         dll_cflags="-DDLSYM_NEEDS_UNDERSCORE -DPIC -fPIC"
11791                         dll_lflags="-Bshareable"
11792                         dll_ld=ld
11793                         ;;
11794                 BSD/OS*)
11795                         dll_cflags=
11796                         dll_lflags="-r"
11797                         dll_ld="shlicc2"
11798                         ;;
11799                 UNIX_SV*)
11800                         dll_cflags="-fPIC"
11801                         ;;
11802                 *)
11803                         dll_ld="$CC"
11804                         dll_lflags="-shared"
11805                 esac
11806         fi
11807
11808         echo "$ac_t"""lflags: $dll_lflags cflags: $dll_cflags"" 1>&6
11809
11810
11811
11812
11813
11814   for ac_func in dlerror
11815 do
11816 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11817 echo "configure:11818: checking for $ac_func" >&5
11818
11819 cat > conftest.$ac_ext <<EOF
11820 #line 11821 "configure"
11821 #include "confdefs.h"
11822 /* System header to define __stub macros and hopefully few prototypes,
11823     which can conflict with char $ac_func(); below.  */
11824 #include <assert.h>
11825 /* Override any gcc2 internal prototype to avoid an error.  */
11826 /* We use char because int might match the return type of a gcc2
11827     builtin and then its argument prototype would still apply.  */
11828 char $ac_func();
11829
11830 int main() {
11831
11832 /* The GNU C library defines this for functions which it implements
11833     to always fail with ENOSYS.  Some functions are actually named
11834     something starting with __ and the normal name is an alias.  */
11835 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11836 choke me
11837 #else
11838 $ac_func();
11839 #endif
11840
11841 ; return 0; }
11842 EOF
11843 if { (eval echo configure:11844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11844   rm -rf conftest*
11845   eval "ac_cv_func_$ac_func=yes"
11846 else
11847   echo "configure: failed program was:" >&5
11848   cat conftest.$ac_ext >&5
11849   rm -rf conftest*
11850   eval "ac_cv_func_$ac_func=no"
11851 fi
11852 rm -f conftest*
11853
11854 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11855   echo "$ac_t""yes" 1>&6
11856     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11857   { test "$extra_verbose" = "yes" && cat << EOF
11858     Defining $ac_tr_func
11859 EOF
11860 cat >> confdefs.h <<EOF
11861 #define $ac_tr_func 1
11862 EOF
11863 }
11864  
11865 else
11866   echo "$ac_t""no" 1>&6
11867 fi
11868 done
11869
11870   ld_dynamic_link_flags=
11871     case "$opsys" in
11872   hpux*)  ld_dynamic_link_flags="-Wl,-E" ;;
11873   linux*) ld_dynamic_link_flags="-rdynamic" ;;
11874   *) ;;
11875   esac
11876 fi
11877
11878 cat > conftest.$ac_ext <<EOF
11879 #line 11880 "configure"
11880 #include "confdefs.h"
11881 int main(int c,char *v[]){return 0;}
11882 EOF
11883 if { (eval echo configure:11884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11884 then
11885   :
11886 else
11887   conftest_rc="$?"
11888   echo "configure: failed program was:" >&5
11889   cat conftest.$ac_ext >&5
11890   rm -fr conftest*
11891   
11892   echo ""
11893   echo "*** PANIC *** The C compiler can no longer build working executables."
11894   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
11895   echo "*** PANIC *** The most likely reason for this problem is that configure"
11896   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
11897   echo "*** PANIC *** found at run time."
11898   echo "*** PANIC ***"
11899   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
11900   echo "*** PANIC *** On other systems, try telling configure where to find the"
11901   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
11902   echo "*** PANIC ***"
11903   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
11904   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
11905   echo "*** PANIC *** on your system.  Don't do that."
11906   exit 1
11907 fi
11908 rm -fr conftest*
11909
11910
11911 { test "$extra_verbose" = "yes" && cat << \EOF
11912     Defining HAVE_UNIX_PROCESSES
11913 EOF
11914 cat >> confdefs.h <<\EOF
11915 #define HAVE_UNIX_PROCESSES 1
11916 EOF
11917 }
11918
11919 extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
11920    echo "    xemacs will be linked with \"process-unix.o\""
11921  fi
11922
11923
11924
11925 T=""
11926 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11927 CFLAGS="$T"
11928
11929
11930 T=""
11931 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11932 extra_objs="$T"
11933
11934
11935 T=""
11936 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
11937 c_switch_general="$T"
11938
11939
11940 T=""
11941 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11942 c_switch_window_system="$T"
11943
11944
11945 T=""
11946 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11947 c_switch_all="$T"
11948
11949
11950 T=""
11951 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
11952 ld_switch_general="$T"
11953
11954
11955 T=""
11956 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11957 ld_switch_window_system="$T"
11958
11959
11960 T=""
11961 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11962 ld_switch_all="$T"
11963
11964
11965 T=""
11966 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11967 ld_libs_general="$T"
11968
11969
11970 T=""
11971 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
11972 ld_libs_window_system="$T"
11973
11974
11975 T=""
11976 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11977 ld_libs_all="$T"
11978
11979
11980
11981 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
11982 internal_makefile_list="Makefile.in"
11983 SUBDIR_MAKEFILES=''
11984 test -d lock || mkdir lock
11985 for dir in $MAKE_SUBDIR; do
11986   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
11987         test -d "$d" || mkdir "$d"; cd "$d"
11988       done ) ;;
11989    * ) test -d "$dir" || mkdir "$dir" ;;
11990   esac
11991   
11992 T=""
11993 for W in $SUBDIR_MAKEFILES $dir/Makefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11994 SUBDIR_MAKEFILES="$T"
11995
11996   
11997 T=""
11998 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11999 internal_makefile_list="$T"
12000
12001 done
12002
12003
12004
12005
12006 for dir in src/s src/m; do
12007   if test ! -d "$dir" ; then
12008     echo Making symbolic link to "$srcdir/$dir"
12009     ${LN_S} "$srcdir/$dir" "$dir"
12010   fi
12011 done
12012
12013 if test "$extra_verbose" = "yes"; then
12014   echo ""
12015   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
12016   echo ""
12017 fi
12018
12019 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12020   echo "creating src/gdbinit"; echo ""
12021   echo "source $srcdir/src/gdbinit" > src/gdbinit
12022 fi
12023
12024 if test "$__SUNPRO_C" = "yes"; then
12025   echo "creating .sbinit"; echo ""
12026   ( echo "# For use with Sun WorkShop's Source browser."
12027     echo "# See sbquery(1) and sbinit(4) for more information"
12028     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12029   ) > .sbinit
12030 fi
12031
12032 rm -f core
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049 PREFIX=$prefix
12050 while true; do
12051   case "$PREFIX" in
12052     *\$* ) eval "PREFIX=$PREFIX" ;;
12053     *) break ;;
12054   esac
12055 done
12056
12057
12058
12059 EXEC_PREFIX=$exec_prefix
12060 while true; do
12061   case "$EXEC_PREFIX" in
12062     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12063     *) break ;;
12064   esac
12065 done
12066
12067
12068
12069
12070 INFODIR=$infodir
12071 while true; do
12072   case "$INFODIR" in
12073     *\$* ) eval "INFODIR=$INFODIR" ;;
12074     *) break ;;
12075   esac
12076 done
12077
12078
12079
12080
12081 INFOPATH=$infopath
12082 while true; do
12083   case "$INFOPATH" in
12084     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12085     *) break ;;
12086   esac
12087 done
12088
12089
12090
12091
12092 PACKAGE_PATH=$package_path
12093 while true; do
12094   case "$PACKAGE_PATH" in
12095     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12096     *) break ;;
12097   esac
12098 done
12099
12100
12101
12102
12103 LISPDIR=$lispdir
12104 while true; do
12105   case "$LISPDIR" in
12106     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12107     *) break ;;
12108   esac
12109 done
12110
12111
12112
12113
12114
12115 ETCDIR=$etcdir
12116 while true; do
12117   case "$ETCDIR" in
12118     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12119     *) break ;;
12120   esac
12121 done
12122
12123
12124
12125
12126 LOCKDIR=$lockdir
12127 while true; do
12128   case "$LOCKDIR" in
12129     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12130     *) break ;;
12131   esac
12132 done
12133
12134
12135
12136
12137 ARCHLIBDIR=$archlibdir
12138 while true; do
12139   case "$ARCHLIBDIR" in
12140     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12141     *) break ;;
12142   esac
12143 done
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12166
12167
12168
12169
12170
12171
12172
12173 : ${XEMACS_CC:=$CC}
12174
12175
12176
12177 if test "$with_site_lisp" = "no"; then
12178   { test "$extra_verbose" = "yes" && cat << \EOF
12179     Defining INHIBIT_SITE_LISP
12180 EOF
12181 cat >> confdefs.h <<\EOF
12182 #define INHIBIT_SITE_LISP 1
12183 EOF
12184 }
12185
12186 fi
12187
12188
12189 T=""
12190 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12191 ac_configure_args="$T"
12192
12193 { test "$extra_verbose" = "yes" && cat << EOF
12194     Defining EMACS_CONFIGURATION = "$canonical"
12195 EOF
12196 cat >> confdefs.h <<EOF
12197 #define EMACS_CONFIGURATION "$canonical"
12198 EOF
12199 }
12200
12201 { test "$extra_verbose" = "yes" && cat << EOF
12202     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12203 EOF
12204 cat >> confdefs.h <<EOF
12205 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12206 EOF
12207 }
12208
12209 { test "$extra_verbose" = "yes" && cat << EOF
12210     Defining config_machfile = "$machfile"
12211 EOF
12212 cat >> confdefs.h <<EOF
12213 #define config_machfile "$machfile"
12214 EOF
12215 }
12216
12217 { test "$extra_verbose" = "yes" && cat << EOF
12218     Defining config_opsysfile = "$opsysfile"
12219 EOF
12220 cat >> confdefs.h <<EOF
12221 #define config_opsysfile "$opsysfile"
12222 EOF
12223 }
12224
12225
12226
12227 null_string=""
12228 { test "$extra_verbose" = "yes" && cat << EOF
12229     Defining LD_SWITCH_X_SITE = $null_string
12230 EOF
12231 cat >> confdefs.h <<EOF
12232 #define LD_SWITCH_X_SITE $null_string
12233 EOF
12234 }
12235
12236 { test "$extra_verbose" = "yes" && cat << EOF
12237     Defining LD_SWITCH_X_SITE_AUX = $null_string
12238 EOF
12239 cat >> confdefs.h <<EOF
12240 #define LD_SWITCH_X_SITE_AUX $null_string
12241 EOF
12242 }
12243
12244 { test "$extra_verbose" = "yes" && cat << EOF
12245     Defining C_SWITCH_X_SITE = $null_string
12246 EOF
12247 cat >> confdefs.h <<EOF
12248 #define C_SWITCH_X_SITE $null_string
12249 EOF
12250 }
12251
12252 { test "$extra_verbose" = "yes" && cat << EOF
12253     Defining LD_SWITCH_SITE = $null_string
12254 EOF
12255 cat >> confdefs.h <<EOF
12256 #define LD_SWITCH_SITE $null_string
12257 EOF
12258 }
12259
12260 { test "$extra_verbose" = "yes" && cat << EOF
12261     Defining C_SWITCH_SITE = $null_string
12262 EOF
12263 cat >> confdefs.h <<EOF
12264 #define C_SWITCH_SITE $null_string
12265 EOF
12266 }
12267
12268
12269
12270 test -n "$puresize" && { test "$extra_verbose" = "yes" && cat << EOF
12271     Defining RAW_PURESIZE = $puresize
12272 EOF
12273 cat >> confdefs.h <<EOF
12274 #define RAW_PURESIZE $puresize
12275 EOF
12276 }
12277
12278
12279 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12280     Defining GNU_MALLOC
12281 EOF
12282 cat >> confdefs.h <<\EOF
12283 #define GNU_MALLOC 1
12284 EOF
12285 }
12286
12287 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12288     Defining USE_SYSTEM_MALLOC
12289 EOF
12290 cat >> confdefs.h <<\EOF
12291 #define USE_SYSTEM_MALLOC 1
12292 EOF
12293 }
12294
12295 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12296     Defining USE_DEBUG_MALLOC
12297 EOF
12298 cat >> confdefs.h <<\EOF
12299 #define USE_DEBUG_MALLOC 1
12300 EOF
12301 }
12302
12303                                               { test "$extra_verbose" = "yes" && cat << \EOF
12304     Defining USE_SYSTEM_MALLOC
12305 EOF
12306 cat >> confdefs.h <<\EOF
12307 #define USE_SYSTEM_MALLOC 1
12308 EOF
12309 }
12310
12311 fi
12312 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12313     Defining I18N3
12314 EOF
12315 cat >> confdefs.h <<\EOF
12316 #define I18N3 1
12317 EOF
12318 }
12319
12320 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12321     Defining USE_GCC
12322 EOF
12323 cat >> confdefs.h <<\EOF
12324 #define USE_GCC 1
12325 EOF
12326 }
12327
12328 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12329     Defining EXTERNAL_WIDGET
12330 EOF
12331 cat >> confdefs.h <<\EOF
12332 #define EXTERNAL_WIDGET 1
12333 EOF
12334 }
12335
12336 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12337     Defining NO_DOC_FILE
12338 EOF
12339 cat >> confdefs.h <<\EOF
12340 #define NO_DOC_FILE 1
12341 EOF
12342 }
12343
12344 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12345     Defining PURIFY
12346 EOF
12347 cat >> confdefs.h <<\EOF
12348 #define PURIFY 1
12349 EOF
12350 }
12351
12352 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12353     Defining QUANTIFY
12354 EOF
12355 cat >> confdefs.h <<\EOF
12356 #define QUANTIFY 1
12357 EOF
12358 }
12359
12360 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12361     Defining MAIL_USE_POP
12362 EOF
12363 cat >> confdefs.h <<\EOF
12364 #define MAIL_USE_POP 1
12365 EOF
12366 }
12367
12368 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12369     Defining KERBEROS
12370 EOF
12371 cat >> confdefs.h <<\EOF
12372 #define KERBEROS 1
12373 EOF
12374 }
12375
12376 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12377     Defining HESIOD
12378 EOF
12379 cat >> confdefs.h <<\EOF
12380 #define HESIOD 1
12381 EOF
12382 }
12383
12384 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12385     Defining USE_UNION_TYPE
12386 EOF
12387 cat >> confdefs.h <<\EOF
12388 #define USE_UNION_TYPE 1
12389 EOF
12390 }
12391
12392
12393
12394 (
12395 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
12396 else
12397   echo "uname -a: `uname -a`"
12398 fi
12399 echo ""
12400 echo "$0 $quoted_arguments"
12401 ) > Installation
12402
12403 xemacs_betaname=""
12404 test ! -z "${emacs_beta_version}" && xemacs_betaname="-b${emacs_beta_version}"
12405
12406 (
12407 echo "
12408
12409 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
12410
12411   Where should the build process find the source code?    $srcdir
12412   What installation prefix should install use?            $prefix
12413   What operating system and machine description files should XEmacs use?
12414         \`$opsysfile' and \`$machfile'
12415   What compiler should XEmacs be built with?              $CC $CFLAGS
12416   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
12417   Should XEmacs use the relocating allocator for buffers? $rel_alloc
12418   What window system should XEmacs use?                   ${window_system}"
12419 if test "$with_x11" = "yes"; then
12420   echo "  Where do we find X Windows header files?                $x_includes"
12421   echo "  Where do we find X Windows libraries?                   $x_libraries"
12422 fi
12423 if test -n "$site_includes"; then
12424   echo "  Additional header files:                                $site_includes"
12425 fi
12426 if test -n "$site_libraries"; then
12427   echo "  Additional libraries:                                   $site_libraries"
12428 fi
12429 if test -n "$site_prefixes"; then
12430   echo "  Additional prefixes:                                    $site_prefixes"
12431 fi
12432 if test -n "$runpath"; then
12433   echo "  Runtime library search path:                            $runpath"
12434 fi
12435 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
12436 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
12437 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
12438 if test "$with_xmu" != yes -a "$with_x11" = yes; then
12439   echo "  No Xmu; substituting equivalent routines."
12440 fi
12441
12442 if test "$with_xpm" = yes; then
12443   echo "  Compiling in support for XPM images."
12444 elif test "$with_x11" = yes; then
12445   echo "  --------------------------------------------------------------------"
12446   echo "  WARNING: Compiling without XPM support."
12447   if test "$xpm_problem" != ""; then
12448     echo "  Reason: $xpm_problem"
12449   fi
12450   echo "  WARNING: You should strongly consider installing XPM."
12451   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
12452   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12453   echo "  --------------------------------------------------------------------"
12454 fi
12455 if test "$with_png" = yes; then
12456   echo "  Compiling in support for PNG image handling."
12457 elif test "$window_system" != "none"; then
12458   echo "  --------------------------------------------------------------------"
12459   echo "  WARNING: Compiling without PNG image support."
12460   if test "$png_problem" != ""; then
12461     echo "  Reason: $png_problem"
12462   fi
12463   echo "  WARNING: You should strongly consider installing the PNG libraries."
12464   echo "  WARNING: Otherwise certain images and glyphs may not display."
12465   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12466   echo "  --------------------------------------------------------------------"
12467 fi
12468 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
12469 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
12470 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
12471 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
12472 case "$with_sound" in
12473   nas    ) echo "  Compiling in network sound (NAS) support." ;;
12474   native ) echo "  Compiling in native sound support." ;;
12475   both   ) echo "  Compiling in both network and native sound support." ;;
12476 esac
12477 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
12478
12479 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
12480 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
12481 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
12482
12483 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
12484 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
12485 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
12486
12487 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
12488 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
12489
12490 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
12491 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
12492 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
12493 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
12494 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
12495 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
12496 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
12497 if test "$with_wnn" = yes; then
12498   echo "  Compiling in support for the WNN input method on Mule."
12499   test "$with_wnn6" = yes && echo "    Using WNN version 6."
12500 fi
12501 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
12502
12503 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
12504 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
12505 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
12506 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
12507 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
12508 test "$with_session"  != no && echo "  Compiling in support for proper session-management."
12509 case "$with_menubars" in
12510   lucid ) echo "  Using Lucid menubars." ;;
12511   motif ) echo "  Using Motif menubars."
12512           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
12513           echo "             We recommend using the Lucid menubar instead."
12514           echo "             Re-run configure with --with-menubars='lucid'." ;;
12515 esac
12516 case "$with_scrollbars" in
12517   lucid    ) echo "  Using Lucid scrollbars."     ;;
12518   motif    ) echo "  Using Motif scrollbars."     ;;
12519   athena   ) echo "  Using Athena scrollbars."    ;;
12520   athena3d ) echo "  Using Athena-3d scrollbars." ;;
12521 esac
12522 case "$with_dialogs" in
12523   motif    ) echo "  Using Motif dialog boxes."     ;;
12524   athena   ) echo "  Using Athena dialog boxes."    ;;
12525   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
12526 esac
12527 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
12528 test "$with_clash_detection" = yes && \
12529   echo "  Clash detection will use \"$lockdir\" for locking files."
12530 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
12531 test "$with_pop"        = yes && echo "  Using POP for mail access."
12532 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
12533 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
12534 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
12535 test "$use_minimal_tagbits" = yes && echo "  Using Lisp_Objects with minimal tagbits."
12536 test "$use_indexed_lrecord_implementation" = yes && echo "  Using indexed lrecord implementation."
12537 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
12538 test "$memory_usage_stats" = yes && echo "  Compiling in code for checking XEmacs memory usage."
12539 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
12540 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
12541   != "no no no no no"; then
12542   echo "  WARNING: ---------------------------------------------------------"
12543   echo "  WARNING: Compiling in support for runtime error checking."
12544   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
12545   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
12546   echo "  WARNING: ---------------------------------------------------------"
12547 fi
12548 echo ""
12549 ) | tee -a Installation
12550 echo ""
12551
12552 echo '(setq Installation-string "' > Installation.el
12553 sed 's/"/\\"/g' Installation >> Installation.el
12554 echo '")' >> Installation.el
12555
12556
12557 # Remove any trailing slashes in these variables.
12558 test -n "$prefix" &&
12559   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
12560 test -n "$exec_prefix" &&
12561   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
12562
12563
12564 for file in $internal_makefile_list; do
12565   test "$file" = src/Makefile.in && \
12566     file="src/Makefile.in:src/Makefile.in.in:src/depend"
12567   ac_output_files="${ac_output_files+$ac_output_files }$file"
12568 done
12569 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
12570
12571 trap '' 1 2 15
12572
12573 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
12574
12575 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12576 # Let make expand exec_prefix.
12577 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12578
12579 # Any assignment to VPATH causes Sun make to only execute
12580 # the first set of double-colon rules, so remove it if not needed.
12581 # If there is a colon in the path, we need to keep it.
12582 if test "x$srcdir" = x.; then
12583   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
12584 fi
12585
12586 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
12587
12588 DEFS=-DHAVE_CONFIG_H
12589
12590 # Without the "./", some shells look in PATH for config.status.
12591 : ${CONFIG_STATUS=./config.status}
12592
12593 echo creating $CONFIG_STATUS
12594 rm -f $CONFIG_STATUS
12595 cat > $CONFIG_STATUS <<EOF
12596 #! /bin/sh
12597 # Generated automatically by configure.
12598 # Run this file to recreate the current configuration.
12599 # This directory was configured as follows,
12600 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
12601 #
12602 # $0 $ac_configure_args
12603 #
12604 # Compiler output produced by configure, useful for debugging
12605 # configure, is in ./config.log if it exists.
12606
12607 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
12608 for ac_option
12609 do
12610   case "\$ac_option" in
12611   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12612     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
12613     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
12614   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
12615     echo "$CONFIG_STATUS generated by autoconf version 2.12"
12616     exit 0 ;;
12617   -help | --help | --hel | --he | --h)
12618     echo "\$ac_cs_usage"; exit 0 ;;
12619   *) echo "\$ac_cs_usage"; exit 1 ;;
12620   esac
12621 done
12622
12623 ac_given_srcdir=$srcdir
12624 ac_given_INSTALL="$INSTALL"
12625
12626 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
12627 EOF
12628 cat >> $CONFIG_STATUS <<EOF
12629
12630 # Protect against being on the right side of a sed subst in config.status.
12631 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
12632  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
12633 $ac_vpsub
12634 $extrasub
12635 s%@CFLAGS@%$CFLAGS%g
12636 s%@CPPFLAGS@%$CPPFLAGS%g
12637 s%@CXXFLAGS@%$CXXFLAGS%g
12638 s%@DEFS@%$DEFS%g
12639 s%@LDFLAGS@%$LDFLAGS%g
12640 s%@LIBS@%$LIBS%g
12641 s%@exec_prefix@%$exec_prefix%g
12642 s%@prefix@%$prefix%g
12643 s%@program_transform_name@%$program_transform_name%g
12644 s%@bindir@%$bindir%g
12645 s%@sbindir@%$sbindir%g
12646 s%@libexecdir@%$libexecdir%g
12647 s%@datadir@%$datadir%g
12648 s%@sysconfdir@%$sysconfdir%g
12649 s%@sharedstatedir@%$sharedstatedir%g
12650 s%@localstatedir@%$localstatedir%g
12651 s%@libdir@%$libdir%g
12652 s%@includedir@%$includedir%g
12653 s%@oldincludedir@%$oldincludedir%g
12654 s%@infodir@%$infodir%g
12655 s%@mandir@%$mandir%g
12656 s%@LN_S@%$LN_S%g
12657 s%@blddir@%$blddir%g
12658 s%@CC@%$CC%g
12659 s%@CPP@%$CPP%g
12660 s%@start_flags@%$start_flags%g
12661 s%@ld_switch_shared@%$ld_switch_shared%g
12662 s%@start_files@%$start_files%g
12663 s%@ld@%$ld%g
12664 s%@lib_gcc@%$lib_gcc%g
12665 s%@RANLIB@%$RANLIB%g
12666 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
12667 s%@INSTALL_DATA@%$INSTALL_DATA%g
12668 s%@YACC@%$YACC%g
12669 s%@SET_MAKE@%$SET_MAKE%g
12670 s%@X_CFLAGS@%$X_CFLAGS%g
12671 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
12672 s%@X_LIBS@%$X_LIBS%g
12673 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
12674 s%@install_pp@%$install_pp%g
12675 s%@libs_xauth@%$libs_xauth%g
12676 s%@dnd_objs@%$dnd_objs%g
12677 s%@lwlib_objs@%$lwlib_objs%g
12678 s%@ALLOCA@%$ALLOCA%g
12679 s%@dll_ld@%$dll_ld%g
12680 s%@dll_cflags@%$dll_cflags%g
12681 s%@dll_oflags@%$dll_oflags%g
12682 s%@dll_lflags@%$dll_lflags%g
12683 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
12684 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
12685 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
12686 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
12687 s%@PROGNAME@%$PROGNAME%g
12688 s%@version@%$version%g
12689 s%@configuration@%$configuration%g
12690 s%@canonical@%$canonical%g
12691 s%@srcdir@%$srcdir%g
12692 s%@pkgdir@%$pkgdir%g
12693 s%@statedir@%$statedir%g
12694 s%@PREFIX@%$PREFIX%g
12695 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
12696 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
12697 s%@INFODIR@%$INFODIR%g
12698 s%@infopath@%$infopath%g
12699 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
12700 s%@INFOPATH@%$INFOPATH%g
12701 s%@package_path@%$package_path%g
12702 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
12703 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
12704 s%@lispdir@%$lispdir%g
12705 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
12706 s%@LISPDIR@%$LISPDIR%g
12707 s%@etcdir@%$etcdir%g
12708 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
12709 s%@ETCDIR@%$ETCDIR%g
12710 s%@lockdir@%$lockdir%g
12711 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
12712 s%@LOCKDIR@%$LOCKDIR%g
12713 s%@archlibdir@%$archlibdir%g
12714 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
12715 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
12716 s%@docdir@%$docdir%g
12717 s%@bitmapdir@%$bitmapdir%g
12718 s%@extra_objs@%$extra_objs%g
12719 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
12720 s%@machfile@%$machfile%g
12721 s%@opsysfile@%$opsysfile%g
12722 s%@c_switch_general@%$c_switch_general%g
12723 s%@c_switch_window_system@%$c_switch_window_system%g
12724 s%@c_switch_all@%$c_switch_all%g
12725 s%@ld_switch_general@%$ld_switch_general%g
12726 s%@ld_switch_window_system@%$ld_switch_window_system%g
12727 s%@ld_switch_all@%$ld_switch_all%g
12728 s%@ld_libs_general@%$ld_libs_general%g
12729 s%@ld_libs_window_system@%$ld_libs_window_system%g
12730 s%@ld_libs_all@%$ld_libs_all%g
12731 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
12732 s%@native_sound_lib@%$native_sound_lib%g
12733 s%@sound_cflags@%$sound_cflags%g
12734 s%@dynodump_arch@%$dynodump_arch%g
12735 s%@XEMACS_CC@%$XEMACS_CC%g
12736 s%@internal_makefile_list@%$internal_makefile_list%g
12737
12738 CEOF
12739 EOF
12740
12741 cat >> $CONFIG_STATUS <<\EOF
12742
12743 # Split the substitutions into bite-sized pieces for seds with
12744 # small command number limits, like on Digital OSF/1 and HP-UX.
12745 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
12746 ac_file=1 # Number of current file.
12747 ac_beg=1 # First line for current file.
12748 ac_end=$ac_max_sed_cmds # Line after last line for current file.
12749 ac_more_lines=:
12750 ac_sed_cmds=""
12751 while $ac_more_lines; do
12752   if test $ac_beg -gt 1; then
12753     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
12754   else
12755     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
12756   fi
12757   if test ! -s conftest.s$ac_file; then
12758     ac_more_lines=false
12759     rm -f conftest.s$ac_file
12760   else
12761     if test -z "$ac_sed_cmds"; then
12762       ac_sed_cmds="sed -f conftest.s$ac_file"
12763     else
12764       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
12765     fi
12766     ac_file=`expr $ac_file + 1`
12767     ac_beg=$ac_end
12768     ac_end=`expr $ac_end + $ac_max_sed_cmds`
12769   fi
12770 done
12771 if test -z "$ac_sed_cmds"; then
12772   ac_sed_cmds=cat
12773 fi
12774 EOF
12775
12776 cat >> $CONFIG_STATUS <<EOF
12777
12778 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
12779 EOF
12780 cat >> $CONFIG_STATUS <<\EOF
12781 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
12782   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12783   case "$ac_file" in
12784   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12785        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12786   *) ac_file_in="${ac_file}.in" ;;
12787   esac
12788
12789   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
12790
12791   # Remove last slash and all that follows it.  Not all systems have dirname.
12792   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12793   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12794     # The file is in a subdirectory.
12795     test ! -d "$ac_dir" && mkdir "$ac_dir"
12796     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
12797     # A "../" for each directory in $ac_dir_suffix.
12798     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
12799   else
12800     ac_dir_suffix= ac_dots=
12801   fi
12802
12803   case "$ac_given_srcdir" in
12804   .)  srcdir=.
12805       if test -z "$ac_dots"; then top_srcdir=.
12806       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
12807   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
12808   *) # Relative path.
12809     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
12810     top_srcdir="$ac_dots$ac_given_srcdir" ;;
12811   esac
12812
12813   case "$ac_given_INSTALL" in
12814   [/$]*) INSTALL="$ac_given_INSTALL" ;;
12815   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
12816   esac
12817
12818   echo creating "$ac_file"
12819   rm -f "$ac_file"
12820   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
12821   case "$ac_file" in
12822   *Makefile*) ac_comsub="1i\\
12823 # $configure_input" ;;
12824   *) ac_comsub= ;;
12825   esac
12826
12827   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12828   sed -e "$ac_comsub
12829 s%@configure_input@%$configure_input%g
12830 s%@srcdir@%$srcdir%g
12831 s%@top_srcdir@%$top_srcdir%g
12832 s%@INSTALL@%$INSTALL%g
12833 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12834 fi; done
12835 rm -f conftest.s*
12836
12837 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12838 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12839 #
12840 # ac_d sets the value in "#define NAME VALUE" lines.
12841 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12842 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12843 ac_dC='\3'
12844 ac_dD='%g'
12845 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12846 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12847 ac_uB='\([      ]\)%\1#\2define\3'
12848 ac_uC=' '
12849 ac_uD='\4%g'
12850 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12851 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12852 ac_eB='$%\1#\2define\3'
12853 ac_eC=' '
12854 ac_eD='%g'
12855
12856 if test "${CONFIG_HEADERS+set}" != set; then
12857 EOF
12858 cat >> $CONFIG_STATUS <<EOF
12859   CONFIG_HEADERS="src/config.h lwlib/config.h"
12860 EOF
12861 cat >> $CONFIG_STATUS <<\EOF
12862 fi
12863 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12864   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12865   case "$ac_file" in
12866   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12867        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12868   *) ac_file_in="${ac_file}.in" ;;
12869   esac
12870
12871   echo creating $ac_file
12872
12873   rm -f conftest.frag conftest.in conftest.out
12874   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12875   cat $ac_file_inputs > conftest.in
12876
12877 EOF
12878
12879 # Transform confdefs.h into a sed script conftest.vals that substitutes
12880 # the proper values into config.h.in to produce config.h.  And first:
12881 # Protect against being on the right side of a sed subst in config.status.
12882 # Protect against being in an unquoted here document in config.status.
12883 rm -f conftest.vals
12884 cat > conftest.hdr <<\EOF
12885 s/[\\&%]/\\&/g
12886 s%[\\$`]%\\&%g
12887 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12888 s%ac_d%ac_u%gp
12889 s%ac_u%ac_e%gp
12890 EOF
12891 sed -n -f conftest.hdr confdefs.h > conftest.vals
12892 rm -f conftest.hdr
12893
12894 # This sed command replaces #undef with comments.  This is necessary, for
12895 # example, in the case of _POSIX_SOURCE, which is predefined and required
12896 # on some systems where configure will not decide to define it.
12897 cat >> conftest.vals <<\EOF
12898 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12899 EOF
12900
12901 # Break up conftest.vals because some shells have a limit on
12902 # the size of here documents, and old seds have small limits too.
12903
12904 rm -f conftest.tail
12905 while :
12906 do
12907   ac_lines=`grep -c . conftest.vals`
12908   # grep -c gives empty output for an empty file on some AIX systems.
12909   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12910   # Write a limited-size here document to conftest.frag.
12911   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12912   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12913   echo 'CEOF
12914   sed -f conftest.frag conftest.in > conftest.out
12915   rm -f conftest.in
12916   mv conftest.out conftest.in
12917 ' >> $CONFIG_STATUS
12918   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12919   rm -f conftest.vals
12920   mv conftest.tail conftest.vals
12921 done
12922 rm -f conftest.vals
12923
12924 cat >> $CONFIG_STATUS <<\EOF
12925   rm -f conftest.frag conftest.h
12926   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12927   cat conftest.in >> conftest.h
12928   rm -f conftest.in
12929   if cmp -s $ac_file conftest.h 2>/dev/null; then
12930     echo "$ac_file is unchanged"
12931     rm -f conftest.h
12932   else
12933     # Remove last slash and all that follows it.  Not all systems have dirname.
12934       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12935       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12936       # The file is in a subdirectory.
12937       test ! -d "$ac_dir" && mkdir "$ac_dir"
12938     fi
12939     rm -f $ac_file
12940     mv conftest.h $ac_file
12941   fi
12942 fi; done
12943
12944 EOF
12945 cat >> $CONFIG_STATUS <<EOF
12946 CPP="$CPP"
12947  top_srcdir="$srcdir"
12948  MAKE_SUBDIR="$MAKE_SUBDIR"
12949
12950 EOF
12951 cat >> $CONFIG_STATUS <<\EOF
12952 for dir in . $MAKE_SUBDIR; do
12953   (
12954     cd $dir
12955     rm -f junk.c
12956     < Makefile.in \
12957       sed -e '/^# Generated/d' \
12958           -e 's%/\*\*/#.*%%' \
12959           -e 's/^ *# */#/' \
12960           -e '/^##/d' \
12961           -e '/^#/ {
12962 p
12963 d
12964 }'        \
12965           -e '/./ {
12966 s/\([\"]\)/\\\1/g
12967 s/^/"/
12968 s/$/"/
12969 }'  > junk.c;
12970
12971
12972
12973     echo creating $dir/Makefile
12974 $CPP -I. -I${top_srcdir}/src  junk.c \
12975   | sed -e 's/^\#.*//'          \
12976         -e 's/^[        ][      ]*$//'\
12977         -e 's/^ /       /'              \
12978   | sed -n -e '/^..*$/p'        \
12979   | sed '/^\"/ {
12980         s/\\\([\"]\)/\1/g
12981         s/^[    ]*\"//
12982         s/\"[   ]*$//
12983 }' > Makefile.new
12984     chmod 444 Makefile.new
12985     mv -f Makefile.new Makefile
12986
12987     echo creating $dir/GNUmakefile
12988 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
12989   | sed -e 's/^\#.*//'          \
12990         -e 's/^[        ][      ]*$//'\
12991         -e 's/^ /       /'              \
12992   | sed -n -e '/^..*$/p'        \
12993   | sed '/^\"/ {
12994         s/\\\([\"]\)/\1/g
12995         s/^[    ]*\"//
12996         s/\"[   ]*$//
12997 }' > Makefile.new
12998     chmod 444 Makefile.new
12999     mv -f Makefile.new GNUmakefile
13000
13001     rm -f junk.c
13002   )
13003 done
13004
13005 sed < config.status >> lib-src/config.values \
13006   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13007   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13008   -e 's/^\([^ ]*\) $/\1 ""/' \
13009   -e 's/ 1$/ t/'
13010
13011
13012 exit 0
13013 EOF
13014 chmod +x $CONFIG_STATUS
13015 rm -fr confdefs* $ac_clean_files
13016 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1