XEmacs 21.2-b2
[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         run_in_place    | \
303         with_site_lisp  | \
304         with_x          | \
305         with_x11        | \
306         with_msw        | \
307         with_gcc        | \
308         with_gnu_make   | \
309         dynamic         | \
310         with_ncurses    | \
311         with_dnet       | \
312         with_socks      | \
313         with_dragndrop  | \
314         with_cde        | \
315         with_offix      | \
316         with_gpm        | \
317         with_xpm        | \
318         with_xface      | \
319         with_gif        | \
320         with_jpeg       | \
321         with_png        | \
322         with_tiff       | \
323         with_session    | \
324         with_xmu        | \
325         with_quantify   | \
326         with_toolbars   | \
327         with_tty        | \
328         with_xfs        | \
329         with_i18n3      | \
330         with_mule       | \
331         with_file_coding        | \
332         with_canna      | \
333         with_wnn        | \
334         with_wnn6       | \
335         with_workshop   | \
336         with_sparcworks | \
337         with_tooltalk   | \
338         with_ldap       | \
339         with_pop        | \
340         with_kerberos   | \
341         with_hesiod     | \
342         with_dnet       | \
343         with_infodock   | \
344         external_widget | \
345         verbose         | \
346         extra_verbose   | \
347         const_is_losing | \
348         usage_tracking  | \
349         use_union_type  | \
350         debug           | \
351         use_assertions  | \
352         use_minimal_tagbits                     | \
353         use_indexed_lrecord_implementation      | \
354         gung_ho         | \
355         use_assertions  | \
356         memory_usage_stats | \
357         with_clash_detection | \
358         with_shlib | \
359         no_doc_file )
360                   case "$val" in
361             y | ye | yes )      val=yes ;;
362             n | no )            val=no  ;;
363             * ) (echo "$progname: Usage error:"
364 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
365 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
366           esac
367           eval "$opt=\"$val\"" ;;
368
369
370                         srcdir          | \
371         compiler        | \
372         cflags          | \
373         cpp             | \
374         cppflags        | \
375         libs            | \
376         ldflags         | \
377         puresize        | \
378         cache_file      | \
379         native_sound_lib | \
380         site_lisp       | \
381         x_includes      | \
382         x_libraries     | \
383         site_includes   | \
384         site_libraries  | \
385         site_prefixes   | \
386         site_runtime_libraries )
387                   if test "$valomitted" = "yes" ; then
388                     if test "$#" = 0 ; then
389               (echo "$progname: Usage error:"
390 echo " " "The \`--$optname' option requires a value."
391 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
392             fi
393             val="$1"; shift
394           fi
395           eval "$opt=\"$val\""
396         ;;
397
398                 rel_alloc | \
399         with_dlmalloc | \
400         with_debug_malloc  | use_debug_malloc | \
401         with_system_malloc | use_system_malloc )
402           case "$val" in
403             y | ye | yes )      val=yes ;;
404             n | no )            val=no  ;;
405             d | de | def | defa | defau | defaul | default ) val=default ;;
406             * ) (echo "$progname: Usage error:"
407 echo " " "The \`--$optname' option requires one of these values:
408   \`yes', \`no', or \`default'."
409 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
410           esac
411           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
412           eval "$opt=\"$val\""
413         ;;
414
415                 "with_database" )
416           with_database_berkdb=no
417           with_database_dbm=no
418           with_database_gnudbm=no
419           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
420             case "$x" in
421                 no ) ;;
422                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
423                 d | db | dbm )                          with_database_dbm=yes    ;;
424                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
425                 * ) (echo "$progname: Usage error:"
426 echo " " "The \`--$optname' option value
427   must be either \`no' or a comma-separated list
428   of one or more of \`berkdb', \`dbm', or \`gnudbm'."
429 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
430             esac
431           done
432           if test "$with_database_dbm"    = "yes" -a \
433                   "$with_database_gnudbm" = "yes"; then
434           (echo "$progname: Usage error:"
435 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
436   with the \`--$optname' option."
437 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
438           fi
439         ;;
440
441                 "with_sound" )
442                           case "$val" in
443             y | ye | yes )                      val=native ;;
444             n | no | non | none )               val=no;;
445             na | nat | nati | nativ | native )  val=native  ;;
446             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
447             b | bo | bot | both )               val=both;;
448             * ) (echo "$progname: Usage error:"
449 echo " " "The \`--$optname' option must have one of these values:
450   \`native', \`nas', \`both', or \`none'."
451 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
452           esac
453           eval "$opt=\"$val\""
454         ;;
455
456                 "with_xim" )
457           case "$val" in
458             y | ye | yes )                val=yes   ;;
459             n | no | non | none )         val=no    ;;
460             x | xl | xli | xlib )         val=xlib  ;;
461             m | mo | mot | moti | motif ) val=motif ;;
462             * ) (echo "$progname: Usage error:"
463 echo " " "The \`--$optname' option must have one of these values:
464   \`motif', \`xlib', \`yes', or \`no'."
465 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
466           esac
467           eval "$opt=\"$val\""
468         ;;
469
470                 "with_xfs" )
471           case "$val" in
472           y | ye | yes )                val=yes ;;
473           n | no | non | none )         val=no  ;;
474           * ) (echo "$progname: Usage error:"
475 echo " " "The \`--$optname' option must have one of these values:
476  \`yes', or \`no'."
477 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
478           esac
479           eval "$opt=\"$val\""
480         ;;
481
482                 "mail_locking" )
483           case "$val" in
484             lockf )     val=lockf ;;
485             flock )     val=flock ;;
486             file )      val=file  ;;
487             * ) (echo "$progname: Usage error:"
488 echo " " "The \`--$optname' option must have one of these values:
489   \`lockf', \`flock', or \`file'."
490 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
491           esac
492           eval "$opt=\"$val\""
493         ;;
494
495                 "error_checking" )
496                           
497           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
498             case "$x" in
499                       n | no | non | none ) new_default=no ;;
500               a | al | all )        new_default=yes ;;
501
502               extents )       error_check_extents=yes ;;
503               noextents )     error_check_extents=no ;;
504
505               typecheck )     error_check_typecheck=yes ;;
506               notypecheck )   error_check_typecheck=no ;;
507
508               bufpos )        error_check_bufpos=yes ;;
509               nobufpos )      error_check_bufpos=no ;;
510
511               gc )            error_check_gc=yes ;;
512               nogc )          error_check_gc=no ;;
513
514               malloc )        error_check_malloc=yes ;;
515               nomalloc )      error_check_malloc=no ;;
516
517               * ) bogus_error_check=yes ;;
518             esac
519             if test "$bogus_error_check" -o \
520                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
521                 if test "$error_check_default" = yes ; then
522                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', and \`nomalloc'."
523                 else
524                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'."
525                 fi
526                 (echo "$progname: Usage error:"
527 echo " " "Valid types for the \`--$optname' option are:
528   $types."
529 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
530             elif test -n "$new_default" ; then
531                 error_check_extents=$new_default
532                 error_check_typecheck=$new_default
533                 error_check_bufpos=$new_default
534                 error_check_gc=$new_default
535                 error_check_malloc=$new_default
536                 new_default=    # reset this
537             fi
538             echeck_notfirst=true
539           done
540         ;;
541
542                                 
543                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
544         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
545         archlibdir | docdir | package_path )    
546                    if test "$valomitted" = "yes"; then
547              if test "$#" = 0; then
548                  (echo "$progname: Usage error:"
549 echo " " "The \`--$optname' option requires a value."
550 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
551              fi
552              val="$1"; shift
553            fi
554            eval "$opt=\"$val\""
555
556                            case "$opt" in
557              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
558     Defining LISPDIR_USER_DEFINED
559 EOF
560 cat >> confdefs.h <<\EOF
561 #define LISPDIR_USER_DEFINED 1
562 EOF
563 }
564  ;;
565              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
566     Defining ETCDIR_USER_DEFINED
567 EOF
568 cat >> confdefs.h <<\EOF
569 #define ETCDIR_USER_DEFINED 1
570 EOF
571 }
572  ;;
573              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
574     Defining INFODIR_USER_DEFINED
575 EOF
576 cat >> confdefs.h <<\EOF
577 #define INFODIR_USER_DEFINED 1
578 EOF
579 }
580  ;;
581              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
582     Defining INFOPATH_USER_DEFINED
583 EOF
584 cat >> confdefs.h <<\EOF
585 #define INFOPATH_USER_DEFINED 1
586 EOF
587 }
588  ;;
589              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
590     Defining PACKAGE_PATH_USER_DEFINED
591 EOF
592 cat >> confdefs.h <<\EOF
593 #define PACKAGE_PATH_USER_DEFINED 1
594 EOF
595 }
596  ;;
597              datadir )
598                 { test "$extra_verbose" = "yes" && cat << \EOF
599     Defining INFODIR_USER_DEFINED
600 EOF
601 cat >> confdefs.h <<\EOF
602 #define INFODIR_USER_DEFINED 1
603 EOF
604 }
605
606                 { test "$extra_verbose" = "yes" && cat << \EOF
607     Defining LISPDIR_USER_DEFINED
608 EOF
609 cat >> confdefs.h <<\EOF
610 #define LISPDIR_USER_DEFINED 1
611 EOF
612 }
613
614                 { test "$extra_verbose" = "yes" && cat << \EOF
615     Defining ETCDIR_USER_DEFINED
616 EOF
617 cat >> confdefs.h <<\EOF
618 #define ETCDIR_USER_DEFINED 1
619 EOF
620 }
621  ;;
622              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
623     Defining LOCKDIR_USER_DEFINED
624 EOF
625 cat >> confdefs.h <<\EOF
626 #define LOCKDIR_USER_DEFINED 1
627 EOF
628 }
629  ;;
630              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
631     Defining ARCHLIBDIR_USER_DEFINED
632 EOF
633 cat >> confdefs.h <<\EOF
634 #define ARCHLIBDIR_USER_DEFINED 1
635 EOF
636 }
637  ;;
638            esac
639         ;;
640
641                 "no_create" ) ;;
642
643                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
644
645                         "with_menubars" | "with_scrollbars" | "with_dialogs" )
646           case "$val" in
647             l | lu | luc | luci | lucid )               val=lucid  ;;
648             m | mo | mot | moti | motif )               val=motif  ;;
649             athena3d | athena-3d )                      val=athena3d ;;
650             a | at | ath | athe | athen | athena )      val=athena ;;
651             n | no | non | none )                       val=no ;;
652             * ) (echo "$progname: Usage error:"
653 echo " " "The \`--$optname' option must have one of these values:
654   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
655 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
656           esac
657           eval "$opt=\"$val\""
658         ;;
659
660                 * ) (echo "$progname: Usage error:"
661 echo " " "Unrecognized option: $arg"
662 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
663
664       esac
665     ;;
666
667         *-*-*) configuration="$arg" ;;
668
669         *) (echo "$progname: Usage error:"
670 echo " " "Unrecognized argument: $arg"
671 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
672
673   esac
674 done
675
676
677 test -n "$cpp"      && CPP="$cpp"
678 test -n "$cppflags" && CPPFLAGS="$cppflags"
679 test -n "$libs"     && LIBS="$libs"
680 test -n "$ldflags"  && LDFLAGS="$ldflags"
681
682 eval set x "$quoted_arguments"; shift
683
684 test "$extra_verbose" = "yes" && verbose=yes
685
686 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
687 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
688 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
689 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
690
691 test -n "$with_x" && with_x11="$with_x"
692
693
694 if test -n "$gung_ho"; then
695   test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho"
696   test -z "$use_indexed_lrecord_implementation" && \
697     use_indexed_lrecord_implementation="$gung_ho"
698 fi
699 if test "$use_minimal_tagbits" = "no"; then
700   test "$with_dlmalloc" = "yes" && \
701     (echo "$progname: Usage error:"
702 echo " " "--with-dlmalloc requires --use-minimal-tagbits"
703 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
704   with_dlmalloc=no
705 fi
706
707
708
709 if test "$with_cde $with_tooltalk" = "yes no"; then
710   (echo "$progname: Usage error:"
711 echo " " "--with-cde requires --with-tooltalk"
712 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
713 elif test "$with_tooltalk" = "no" ; then with_cde=no
714 elif test "$with_cde" = "yes"; then with_tooltalk=yes
715 fi
716
717
718 if test "$run_in_place" = "yes"; then
719   echo "configure: warning: "The --run-in-place option is ignored because it is unnecessary."" 1>&2
720 fi
721
722 case "$srcdir" in
723
724     "" )
725     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
726       if test -f "$dir/src/lisp.h" -a \
727               -f "$dir/lisp/version.el" ; then
728         srcdir="$dir"
729         break
730       fi
731     done
732     if test -z "$srcdir" ; then
733       (echo "$progname: Usage error:"
734 echo " " "Neither the current directory nor its parent seem to
735   contain the XEmacs sources.  If you do not want to build XEmacs in its
736   source tree, you should run \`$progname' in the directory in which
737   you wish to build XEmacs, using the \`--srcdir' option to say where the
738   sources may be found."
739 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
740     fi
741   ;;
742
743     * )
744     if test ! -f "$srcdir/src/lisp.h" -o \
745             ! -f "$srcdir/lisp/version.el" ; then
746       (echo "$progname: Usage error:"
747 echo " " "The directory specified with the \`--srcdir' option,
748   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
749   either run the \`$progname' script at the top of the XEmacs source
750   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
751 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
752     fi
753   ;;
754 esac
755
756 if test -z "$configuration"; then
757   echo $ac_n "checking "host system type"""... $ac_c" 1>&6
758 echo "configure:759: checking "host system type"" >&5
759     if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \
760     sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then
761     echo "$ac_t""$configuration" 1>&6
762   else
763     echo "$ac_t""unknown" 1>&6
764     (echo "$progname: Usage error:"
765 echo " " "XEmacs has not been ported to this host type.
766 Try explicitly specifying the CONFIGURATION when rerunning configure."
767 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
768   fi
769 fi
770
771 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
772 echo "configure:773: checking whether ln -s works" >&5
773
774 rm -f conftestdata
775 if ln -s X conftestdata 2>/dev/null
776 then
777   rm -f conftestdata
778   ac_cv_prog_LN_S="ln -s"
779 else
780   ac_cv_prog_LN_S=ln
781 fi
782 LN_S="$ac_cv_prog_LN_S"
783 if test "$ac_cv_prog_LN_S" = "ln -s"; then
784   echo "$ac_t""yes" 1>&6
785 else
786   echo "$ac_t""no" 1>&6
787 fi
788
789
790 for dir in lisp etc man info; do
791   if test ! -d "$dir" ; then
792     echo Making symbolic link to "$srcdir/$dir"
793     ${LN_S} "$srcdir/$dir" "$dir"
794   fi
795 done
796
797 absolute_pwd="`pwd`";
798 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
799 then blddir="$PWD"
800 else blddir="$absolute_pwd"
801 fi
802
803
804 case "$srcdir" in
805   /* ) ;;
806   .  ) srcdir="$blddir" ;;
807   *  ) srcdir="`cd $srcdir && pwd`" ;;
808 esac
809
810 if test `pwd` != `sh -c cd $srcdir && pwd`  \
811    && test -f "$srcdir/src/config.h"; then
812   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
813    echo "   as a build directory right now; it has been configured in its own"
814    echo "   right.  To configure in another directory as well, you MUST"
815    echo "   use GNU make.  If you do not have GNU make, then you must"
816    echo "   now do \`make distclean' in $srcdir,"
817    echo "   and then run $progname again.") >&2
818   extrasub='/^VPATH[     ]*=/c\
819 vpath %.c $(srcdir)\
820 vpath %.h $(srcdir)\
821 vpath %.y $(srcdir)\
822 vpath %.l $(srcdir)\
823 vpath %.s $(srcdir)\
824 vpath %.in $(srcdir)'
825 fi
826
827 . "$srcdir/version.sh" || exit 1;
828 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
829 : "${extra_verbose=$beta}"
830 version="${emacs_major_version}.${emacs_minor_version}"
831 { test "$extra_verbose" = "yes" && cat << EOF
832     Defining EMACS_MAJOR_VERSION = $emacs_major_version
833 EOF
834 cat >> confdefs.h <<EOF
835 #define EMACS_MAJOR_VERSION $emacs_major_version
836 EOF
837 }
838
839 { test "$extra_verbose" = "yes" && cat << EOF
840     Defining EMACS_MINOR_VERSION = $emacs_minor_version
841 EOF
842 cat >> confdefs.h <<EOF
843 #define EMACS_MINOR_VERSION $emacs_minor_version
844 EOF
845 }
846
847 if test -n "$emacs_beta_version"; then
848   version="${version}-b${emacs_beta_version}"
849   { test "$extra_verbose" = "yes" && cat << EOF
850     Defining EMACS_BETA_VERSION = $emacs_beta_version
851 EOF
852 cat >> confdefs.h <<EOF
853 #define EMACS_BETA_VERSION $emacs_beta_version
854 EOF
855 }
856
857 fi
858 { test "$extra_verbose" = "yes" && cat << EOF
859     Defining XEMACS_CODENAME = "$xemacs_codename"
860 EOF
861 cat >> confdefs.h <<EOF
862 #define XEMACS_CODENAME "$xemacs_codename"
863 EOF
864 }
865
866 { test "$extra_verbose" = "yes" && cat << EOF
867     Defining EMACS_VERSION = "$version"
868 EOF
869 cat >> confdefs.h <<EOF
870 #define EMACS_VERSION "$version"
871 EOF
872 }
873
874
875 if test "$with_infodock" = "yes"; then
876   if test ! -f ../ID-INSTALL; then
877     echo "Cannot build InfoDock without InfoDock sources"
878     with_infodock=no
879   fi
880 fi
881
882 if test "$with_infodock" = "yes"; then
883       { test "$extra_verbose" = "yes" && cat << EOF
884     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
885 EOF
886 cat >> confdefs.h <<EOF
887 #define INFODOCK_MAJOR_VERSION $infodock_major_version
888 EOF
889 }
890
891   { test "$extra_verbose" = "yes" && cat << EOF
892     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
893 EOF
894 cat >> confdefs.h <<EOF
895 #define INFODOCK_MINOR_VERSION $infodock_minor_version
896 EOF
897 }
898
899   { test "$extra_verbose" = "yes" && cat << EOF
900     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
901 EOF
902 cat >> confdefs.h <<EOF
903 #define INFODOCK_BUILD_VERSION $infodock_build_version
904 EOF
905 }
906
907   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
908   PROGNAME=infodock
909   CPPFLAGS="$CPPFLAGS -DINFODOCK"
910 else
911   PROGNAME=xemacs
912 fi
913
914 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
915 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
916     Defining ERROR_CHECK_EXTENTS
917 EOF
918 cat >> confdefs.h <<\EOF
919 #define ERROR_CHECK_EXTENTS 1
920 EOF
921 }
922
923 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
924     Defining ERROR_CHECK_TYPECHECK
925 EOF
926 cat >> confdefs.h <<\EOF
927 #define ERROR_CHECK_TYPECHECK 1
928 EOF
929 }
930
931 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
932     Defining ERROR_CHECK_BUFPOS
933 EOF
934 cat >> confdefs.h <<\EOF
935 #define ERROR_CHECK_BUFPOS 1
936 EOF
937 }
938
939 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
940     Defining ERROR_CHECK_GC
941 EOF
942 cat >> confdefs.h <<\EOF
943 #define ERROR_CHECK_GC 1
944 EOF
945 }
946
947 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
948     Defining ERROR_CHECK_MALLOC
949 EOF
950 cat >> confdefs.h <<\EOF
951 #define ERROR_CHECK_MALLOC 1
952 EOF
953 }
954
955 if test "${debug:=$beta}" = "yes"; then
956   use_assertions=yes memory_usage_stats=yes
957   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
958    echo "    xemacs will be linked with \"debug.o\""
959  fi
960   { test "$extra_verbose" = "yes" && cat << \EOF
961     Defining DEBUG_XEMACS
962 EOF
963 cat >> confdefs.h <<\EOF
964 #define DEBUG_XEMACS 1
965 EOF
966 }
967
968 fi
969 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
970     Defining USE_ASSERTIONS
971 EOF
972 cat >> confdefs.h <<\EOF
973 #define USE_ASSERTIONS 1
974 EOF
975 }
976
977 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
978     Defining MEMORY_USAGE_STATS
979 EOF
980 cat >> confdefs.h <<\EOF
981 #define MEMORY_USAGE_STATS 1
982 EOF
983 }
984
985
986
987 echo "checking "the configuration name"" 1>&6
988 echo "configure:989: checking "the configuration name"" >&5
989 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
990 if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else
991   exit $?
992 fi
993
994
995
996
997
998 machine='' opsys=''
999
1000 case "$canonical" in
1001   sparc-*-*        ) machine=sparc ;;
1002   alpha*-*-*       ) machine=alpha ;;
1003   vax-*-*          ) machine=vax ;;
1004   mips-dec-*       ) machine=pmax ;;
1005   mips-sgi-*       ) machine=iris4d ;;
1006   romp-ibm-*       ) machine=ibmrt ;;
1007   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1008   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1009   powerpc*-*       ) machine=powerpc ;;
1010   hppa-*-*         ) machine=hp800 ;;
1011   m88k-dg-*        ) machine=aviion ;;
1012   m68*-sony-*      ) machine=news ;;
1013   mips-sony-*      ) machine=news-risc ;;
1014   clipper-*        ) machine=clipper ;;
1015 esac
1016
1017 case "$canonical" in
1018   *-*-linux*    ) opsys=linux ;;
1019   *-*-netbsd*   ) opsys=netbsd ;;
1020   *-*-openbsd*  ) opsys=openbsd ;;
1021   *-*-nextstep* ) opsys=nextstep ;;
1022   *-*-vms       ) opsys=vms ;;
1023
1024     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1025   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1026   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1027   *-dec-osf3*                ) opsys=decosf3-1 ;;
1028   *-dec-osf4*                ) opsys=decosf4-0 ;;
1029
1030     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1031   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1032   *-*-ultrix* )         opsys=ultrix4-3 ;;
1033
1034     *-*-aix3.1*  ) opsys=aix3-1 ;;
1035   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1036   *-*-aix3*    ) opsys=aix3-2   ;;
1037   *-*-aix4.0*  ) opsys=aix4     ;;
1038   *-*-aix4.1*  ) opsys=aix4-1   ;;
1039   *-*-aix4*    ) opsys=aix4-2   ;;
1040
1041     *-gnu* )                    opsys=gnu    ;;
1042   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1043   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1044   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1045   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1046   *-*-aos*   )                  opsys=bsd4-3 ;;
1047   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1048   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1049   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1050   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1051   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1052   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1053         if test -z "$NON_GNU_CPP" ; then
1054           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1055             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1056           done
1057         fi
1058         opsys=usg5-4-2 ;;
1059     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1060     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1061 esac
1062
1063 case "$canonical" in
1064
1065     *-*-netbsd* )
1066     case "$canonical" in
1067       i[3-9]86-*-netbsd*) machine=intel386 ;;
1068       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1069                                             machine=hp9000s300 ;;
1070       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1071       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1072     esac
1073   ;;
1074
1075     *-*-openbsd* )
1076     case "${canonical}" in
1077       alpha*-*-openbsd*)        machine=alpha ;;
1078       i386-*-openbsd*)          machine=intel386 ;;
1079       m68k-*-openbsd*)          machine=hp9000s300 ;;
1080       mipsel-*-openbsd*)        machine=pmax ;;
1081       ns32k-*-openbsd*)         machine=ns32000 ;;
1082       sparc-*-openbsd*)         machine=sparc ;;
1083       vax-*-openbsd*)           machine=vax ;;
1084      esac
1085    ;;
1086
1087     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1088   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1089
1090     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1091   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1092
1093     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1094
1095     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1096
1097     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1098
1099     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1100
1101     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1102
1103     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1104   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1105   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1106
1107   
1108     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1109
1110     *-convex-bsd* | *-convex-convexos* )
1111     machine=convex opsys=bsd4-3
1112     NON_GNU_CPP="cc -E -P"
1113   ;;
1114
1115     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1116
1117     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1118   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1119   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1120   m88k-dg-dgux*                           ) opsys=dgux     ;;
1121
1122     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1123   m88k-motorola-sysv4* )
1124                     machine=delta88k opsys=usg5-4-2
1125   ;;
1126   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1127
1128     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1129   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1130
1131     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1132
1133     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1134   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1135   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1136
1137       m88k-harris-cxux* )
1138         case "`uname -r`" in
1139        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1140        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1141     esac
1142     NON_GNU_CPP="/lib/cpp"
1143   ;;
1144     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1145     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1146
1147     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1148
1149     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1150
1151     *-hp-hpux* )
1152         case "$canonical" in
1153       m68*  ) machine=hp9000s300 ;;
1154       hppa* ) machine=hp800      ;;
1155     esac
1156
1157     case "$canonical" in
1158       *-hp-hpux7*  )  opsys=hpux   ;;
1159       *-hp-hpux8*  )  opsys=hpux8  ;;
1160       *-hp-hpux9*  )  opsys=hpux9  ;;
1161       *-hp-hpux10* )  opsys=hpux10 ;;
1162       *-hp-hpux11* )  opsys=hpux11 ;;
1163       *            )  opsys=hpux   ;;
1164     esac
1165
1166         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1167    echo "    xemacs will be linked with \"strcat.o\""
1168  fi ;; esac
1169
1170     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1171         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1172     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1173
1174     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1175   ;;
1176
1177     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1178   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1179
1180     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1181   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1182   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1183   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1184   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1185   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1186
1187     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1188   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1189
1190     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1191
1192     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1193
1194     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1195
1196     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1197
1198       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1199
1200     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1201
1202     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1203
1204     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1205
1206     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1207
1208         mips-mips-usg* ) machine=mips4 ;;
1209   mips-mips-riscos4 )
1210     machine=mips4
1211     NON_GNU_CC="cc -systype bsd43"
1212     NON_GNU_CPP="cc -systype bsd43 -E"
1213     case "$canonical" in
1214       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1215       mips-mips-riscos5* ) opsys=riscos5 ;;
1216     esac
1217   ;;
1218   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1219   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1220
1221     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1222
1223     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1224
1225     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1226   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1227
1228     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1229
1230     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1231
1232     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1233
1234     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1235
1236     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1237   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1238
1239     mips-siemens-sysv* | mips-sni-sysv*)
1240     machine=mips-siemens opsys=usg5-4
1241     NON_GNU_CC=/usr/ccs/bin/cc
1242     NON_GNU_CPP=/usr/ccs/lib/cpp
1243   ;;
1244
1245       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1246   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1247     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1248   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1249   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1250   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1251   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1252   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1253   mips-sgi-irix*      ) opsys=irix5-0 ;;
1254
1255     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1256   *-sony-news* ) opsys=newsos5 ;;
1257
1258     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1259
1260     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1261         case "$canonical" in
1262       m68*-sunos1* )             machine=sun1     ;;
1263       m68*-sunos2* )             machine=sun2     ;;
1264       m68* )                     machine=sun3     ;;
1265       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1266       i*86-*-* )                 machine=intel386 ;;
1267       rs6000* )                  machine=rs6000   ;;
1268     esac
1269
1270         case "$canonical" in *-sunos5*)
1271       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1272     esac
1273
1274                     case "$canonical" in
1275       *-sunos4* )
1276         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1277         : ;;
1278       *-solaris2* )
1279         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1280         RANLIB=':' ;;
1281     esac
1282
1283     case "$canonical" in
1284       *-solaris*          )
1285         opsys=sol2
1286         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1287         { test "$extra_verbose" = "yes" && cat << EOF
1288     Defining OS_RELEASE = $os_release
1289 EOF
1290 cat >> confdefs.h <<EOF
1291 #define OS_RELEASE $os_release
1292 EOF
1293 }
1294  ;;
1295
1296             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1297       *-sunos4.0*         ) opsys=sunos4-0      ;;
1298       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1299       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1300       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1301       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1302       *-mach*             ) opsys=mach-bsd4-3   ;;
1303       *                   ) opsys=bsd4-2        ;;
1304     esac
1305
1306     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1307
1308         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1309   ;;
1310
1311     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1312
1313     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1314   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1315
1316     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1317
1318     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1319
1320     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1321       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1322
1323     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1324
1325     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1326
1327     vax-dec-* )
1328     case "$canonical" in
1329       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1330       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1331       *-mach* )                         opsys=mach-bsd4-3 ;;
1332     esac
1333   ;;
1334
1335     ns16k-whitechapel-* ) machine=mg1 ;;
1336
1337     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1338
1339     i[3-9]86-*-* )
1340     machine=intel386
1341     case "$canonical" in
1342       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1343       *-isc2.2* )               opsys=isc2-2 ;;
1344       *-isc4.0* )               opsys=isc4-0 ;;
1345       *-isc4.* )                opsys=isc4-1
1346                                 GCC_TEST_OPTIONS=-posix
1347                                 NON_GCC_TEST_OPTIONS=-Xp
1348                                 ;;
1349       *-isc* )                  opsys=isc3-0 ;;
1350       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1351       *-esix* )                 opsys=esix ;;
1352       *-mach* )                 opsys=mach-bsd4-3 ;;
1353       *-xenix* )                opsys=xenix ;;
1354       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1355       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1356       *-bsdi3* )                opsys=bsdos3 ;;
1357       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1358       *-bsdi2* )                opsys=bsdos2 ;;
1359       *-sco3.2v5* )             opsys=sco5 ;
1360                                                         if test "$dynamic" = "yes" ; then
1361                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1362         else
1363                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1364         fi ;;
1365       *-386bsd* )               opsys=386bsd ;;
1366       *-freebsd* )              opsys=freebsd ;;
1367       *-nextstep* )             opsys=nextstep ;;
1368       *-pc-cygwin32 )           opsys=cygwin32 ;;
1369           esac
1370   ;;
1371
1372     m68k-*-linux* ) machine=m68k opsys=linux ;;
1373
1374 esac
1375
1376 if test -z "$machine" -o -z "$opsys"; then
1377   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1378    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1379   ) >&2
1380   exit 1
1381 fi
1382
1383 if test -z "$dynamic"; then
1384   case "$opsys" in
1385     hpux* | sunos4* | sco5 ) dynamic=no ;;
1386     *) dynamic=yes ;;
1387   esac
1388 fi
1389 if test "$dynamic" = "yes"; then
1390   case "$opsys" in
1391     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1392     decosf* ) ld_call_shared="-call_shared" ;;
1393   esac
1394 else   case "$opsys" in
1395     sol2 )
1396       echo "Static linking is not supported on Solaris 2."
1397       echo "Rerun configure without specifying --dynamic=no."
1398       exit 1 ;;
1399     linux   ) ld_call_shared="-Bstatic" ;;
1400     decosf* ) ld_call_shared="-non_shared" ;;
1401   esac
1402 fi
1403
1404 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1405
1406 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1407 { test "$extra_verbose" = "yes" && cat << EOF
1408     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1409 EOF
1410 cat >> confdefs.h <<EOF
1411 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1412 EOF
1413 }
1414
1415
1416 machfile="m/${machine}.h"
1417 opsysfile="s/${opsys}.h"
1418
1419
1420 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1421 if test "$with_workshop $with_tooltalk" = "yes no"; then
1422   (echo "$progname: Usage error:"
1423 echo " " "--with-workshop requires --with-tooltalk"
1424 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1425 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1426 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1427 fi
1428
1429 if test "$with_workshop" = "yes"; then
1430   { test "$extra_verbose" = "yes" && cat << \EOF
1431     Defining SUNPRO
1432 EOF
1433 cat >> confdefs.h <<\EOF
1434 #define SUNPRO 1
1435 EOF
1436 }
1437
1438   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1439    echo "    xemacs will be linked with \"sunpro.o\""
1440  fi
1441 fi
1442
1443 if test "$with_clash_detection" = "yes"; then
1444   { test "$extra_verbose" = "yes" && cat << \EOF
1445     Defining CLASH_DETECTION
1446 EOF
1447 cat >> confdefs.h <<\EOF
1448 #define CLASH_DETECTION 1
1449 EOF
1450 }
1451
1452   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1453    echo "    xemacs will be linked with \"filelock.o\""
1454  fi
1455 fi
1456
1457 test -n "$compiler" && CC="$compiler"
1458 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1459 fi
1460
1461 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1462 if test "${CFLAGS-unset}" != unset
1463   then cflags_specified=yes;
1464   else cflags_specified=no;
1465 fi
1466
1467 xe_save_CFLAGS="$CFLAGS"
1468
1469 # Extract the first word of "gcc", so it can be a program name with args.
1470 set dummy gcc; ac_word=$2
1471 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1472 echo "configure:1473: checking for $ac_word" >&5
1473
1474 if test -n "$CC"; then
1475   ac_cv_prog_CC="$CC" # Let the user override the test.
1476 else
1477   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1478   for ac_dir in $PATH; do
1479     test -z "$ac_dir" && ac_dir=.
1480     if test -f $ac_dir/$ac_word; then
1481       ac_cv_prog_CC="gcc"
1482       break
1483     fi
1484   done
1485   IFS="$ac_save_ifs"
1486 fi
1487 CC="$ac_cv_prog_CC"
1488 if test -n "$CC"; then
1489   echo "$ac_t""$CC" 1>&6
1490 else
1491   echo "$ac_t""no" 1>&6
1492 fi
1493
1494 if test -z "$CC"; then
1495   # Extract the first word of "cc", so it can be a program name with args.
1496 set dummy cc; ac_word=$2
1497 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1498 echo "configure:1499: checking for $ac_word" >&5
1499
1500 if test -n "$CC"; then
1501   ac_cv_prog_CC="$CC" # Let the user override the test.
1502 else
1503   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1504   ac_prog_rejected=no
1505   for ac_dir in $PATH; do
1506     test -z "$ac_dir" && ac_dir=.
1507     if test -f $ac_dir/$ac_word; then
1508       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1509         ac_prog_rejected=yes
1510         continue
1511       fi
1512       ac_cv_prog_CC="cc"
1513       break
1514     fi
1515   done
1516   IFS="$ac_save_ifs"
1517 if test $ac_prog_rejected = yes; then
1518   # We found a bogon in the path, so make sure we never use it.
1519   set dummy $ac_cv_prog_CC
1520   shift
1521   if test $# -gt 0; then
1522     # We chose a different compiler from the bogus one.
1523     # However, it has the same basename, so the bogon will be chosen
1524     # first if we set CC to just the basename; use the full file name.
1525     shift
1526     set dummy "$ac_dir/$ac_word" "$@"
1527     shift
1528     ac_cv_prog_CC="$@"
1529   fi
1530 fi
1531 fi
1532 CC="$ac_cv_prog_CC"
1533 if test -n "$CC"; then
1534   echo "$ac_t""$CC" 1>&6
1535 else
1536   echo "$ac_t""no" 1>&6
1537 fi
1538
1539   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1540 fi
1541
1542 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1543 echo "configure:1544: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1544
1545 ac_ext=c
1546 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1547 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1548 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1549 ac_cpp='$CPP '"$xe_cppflags"
1550 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1551 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1552 cross_compiling=no
1553
1554 cat > conftest.$ac_ext <<EOF
1555 #line 1556 "configure"
1556 #include "confdefs.h"
1557 main(){return(0);}
1558 EOF
1559 if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1560   ac_cv_prog_cc_works=yes
1561   # If we can't run a trivial program, we are probably using a cross compiler.
1562   if (./conftest; exit) 2>/dev/null; then
1563     ac_cv_prog_cc_cross=no
1564   else
1565     ac_cv_prog_cc_cross=yes
1566   fi
1567 else
1568   echo "configure: failed program was:" >&5
1569   cat conftest.$ac_ext >&5
1570   ac_cv_prog_cc_works=no
1571 fi
1572 rm -fr conftest*
1573
1574 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1575 if test $ac_cv_prog_cc_works = no; then
1576   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1577 fi
1578 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1579 echo "configure:1580: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1580 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1581 cross_compiling=$ac_cv_prog_cc_cross
1582
1583 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1584 echo "configure:1585: checking whether we are using GNU C" >&5
1585
1586 cat > conftest.c <<EOF
1587 #ifdef __GNUC__
1588   yes;
1589 #endif
1590 EOF
1591 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1592   ac_cv_prog_gcc=yes
1593 else
1594   ac_cv_prog_gcc=no
1595 fi
1596
1597 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1598
1599 if test $ac_cv_prog_gcc = yes; then
1600   GCC=yes
1601   ac_test_CFLAGS="${CFLAGS+set}"
1602   ac_save_CFLAGS="$CFLAGS"
1603   CFLAGS=
1604   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1605 echo "configure:1606: checking whether ${CC-cc} accepts -g" >&5
1606
1607 echo 'void f(){}' > conftest.c
1608 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1609   ac_cv_prog_cc_g=yes
1610 else
1611   ac_cv_prog_cc_g=no
1612 fi
1613 rm -f conftest*
1614
1615
1616 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1617   if test "$ac_test_CFLAGS" = set; then
1618     CFLAGS="$ac_save_CFLAGS"
1619   elif test $ac_cv_prog_cc_g = yes; then
1620     CFLAGS="-g -O2"
1621   else
1622     CFLAGS="-O2"
1623   fi
1624 else
1625   GCC=
1626   test "${CFLAGS+set}" = set || CFLAGS="-g"
1627 fi
1628  
1629 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1630   CC=${NON_GNU_CC-cc}
1631   # Extract the first word of "gcc", so it can be a program name with args.
1632 set dummy gcc; ac_word=$2
1633 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1634 echo "configure:1635: checking for $ac_word" >&5
1635
1636 if test -n "$CC"; then
1637   ac_cv_prog_CC="$CC" # Let the user override the test.
1638 else
1639   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1640   for ac_dir in $PATH; do
1641     test -z "$ac_dir" && ac_dir=.
1642     if test -f $ac_dir/$ac_word; then
1643       ac_cv_prog_CC="gcc"
1644       break
1645     fi
1646   done
1647   IFS="$ac_save_ifs"
1648 fi
1649 CC="$ac_cv_prog_CC"
1650 if test -n "$CC"; then
1651   echo "$ac_t""$CC" 1>&6
1652 else
1653   echo "$ac_t""no" 1>&6
1654 fi
1655
1656 if test -z "$CC"; then
1657   # Extract the first word of "cc", so it can be a program name with args.
1658 set dummy cc; ac_word=$2
1659 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1660 echo "configure:1661: checking for $ac_word" >&5
1661
1662 if test -n "$CC"; then
1663   ac_cv_prog_CC="$CC" # Let the user override the test.
1664 else
1665   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1666   ac_prog_rejected=no
1667   for ac_dir in $PATH; do
1668     test -z "$ac_dir" && ac_dir=.
1669     if test -f $ac_dir/$ac_word; then
1670       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1671         ac_prog_rejected=yes
1672         continue
1673       fi
1674       ac_cv_prog_CC="cc"
1675       break
1676     fi
1677   done
1678   IFS="$ac_save_ifs"
1679 if test $ac_prog_rejected = yes; then
1680   # We found a bogon in the path, so make sure we never use it.
1681   set dummy $ac_cv_prog_CC
1682   shift
1683   if test $# -gt 0; then
1684     # We chose a different compiler from the bogus one.
1685     # However, it has the same basename, so the bogon will be chosen
1686     # first if we set CC to just the basename; use the full file name.
1687     shift
1688     set dummy "$ac_dir/$ac_word" "$@"
1689     shift
1690     ac_cv_prog_CC="$@"
1691   fi
1692 fi
1693 fi
1694 CC="$ac_cv_prog_CC"
1695 if test -n "$CC"; then
1696   echo "$ac_t""$CC" 1>&6
1697 else
1698   echo "$ac_t""no" 1>&6
1699 fi
1700
1701   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1702 fi
1703
1704 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1705 echo "configure:1706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1706
1707 ac_ext=c
1708 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1709 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1710 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1711 ac_cpp='$CPP '"$xe_cppflags"
1712 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1713 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1714 cross_compiling=no
1715
1716 cat > conftest.$ac_ext <<EOF
1717 #line 1718 "configure"
1718 #include "confdefs.h"
1719 main(){return(0);}
1720 EOF
1721 if { (eval echo configure:1722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1722   ac_cv_prog_cc_works=yes
1723   # If we can't run a trivial program, we are probably using a cross compiler.
1724   if (./conftest; exit) 2>/dev/null; then
1725     ac_cv_prog_cc_cross=no
1726   else
1727     ac_cv_prog_cc_cross=yes
1728   fi
1729 else
1730   echo "configure: failed program was:" >&5
1731   cat conftest.$ac_ext >&5
1732   ac_cv_prog_cc_works=no
1733 fi
1734 rm -fr conftest*
1735
1736 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1737 if test $ac_cv_prog_cc_works = no; then
1738   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1739 fi
1740 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1741 echo "configure:1742: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1742 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1743 cross_compiling=$ac_cv_prog_cc_cross
1744
1745 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1746 echo "configure:1747: checking whether we are using GNU C" >&5
1747
1748 cat > conftest.c <<EOF
1749 #ifdef __GNUC__
1750   yes;
1751 #endif
1752 EOF
1753 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1754   ac_cv_prog_gcc=yes
1755 else
1756   ac_cv_prog_gcc=no
1757 fi
1758
1759 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1760
1761 if test $ac_cv_prog_gcc = yes; then
1762   GCC=yes
1763   ac_test_CFLAGS="${CFLAGS+set}"
1764   ac_save_CFLAGS="$CFLAGS"
1765   CFLAGS=
1766   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1767 echo "configure:1768: checking whether ${CC-cc} accepts -g" >&5
1768
1769 echo 'void f(){}' > conftest.c
1770 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1771   ac_cv_prog_cc_g=yes
1772 else
1773   ac_cv_prog_cc_g=no
1774 fi
1775 rm -f conftest*
1776
1777
1778 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1779   if test "$ac_test_CFLAGS" = set; then
1780     CFLAGS="$ac_save_CFLAGS"
1781   elif test $ac_cv_prog_cc_g = yes; then
1782     CFLAGS="-g -O2"
1783   else
1784     CFLAGS="-O2"
1785   fi
1786 else
1787   GCC=
1788   test "${CFLAGS+set}" = set || CFLAGS="-g"
1789 fi
1790
1791 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1792   CC=gcc
1793   # Extract the first word of "gcc", so it can be a program name with args.
1794 set dummy gcc; ac_word=$2
1795 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1796 echo "configure:1797: checking for $ac_word" >&5
1797
1798 if test -n "$CC"; then
1799   ac_cv_prog_CC="$CC" # Let the user override the test.
1800 else
1801   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1802   for ac_dir in $PATH; do
1803     test -z "$ac_dir" && ac_dir=.
1804     if test -f $ac_dir/$ac_word; then
1805       ac_cv_prog_CC="gcc"
1806       break
1807     fi
1808   done
1809   IFS="$ac_save_ifs"
1810 fi
1811 CC="$ac_cv_prog_CC"
1812 if test -n "$CC"; then
1813   echo "$ac_t""$CC" 1>&6
1814 else
1815   echo "$ac_t""no" 1>&6
1816 fi
1817
1818 if test -z "$CC"; then
1819   # Extract the first word of "cc", so it can be a program name with args.
1820 set dummy cc; ac_word=$2
1821 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1822 echo "configure:1823: checking for $ac_word" >&5
1823
1824 if test -n "$CC"; then
1825   ac_cv_prog_CC="$CC" # Let the user override the test.
1826 else
1827   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1828   ac_prog_rejected=no
1829   for ac_dir in $PATH; do
1830     test -z "$ac_dir" && ac_dir=.
1831     if test -f $ac_dir/$ac_word; then
1832       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1833         ac_prog_rejected=yes
1834         continue
1835       fi
1836       ac_cv_prog_CC="cc"
1837       break
1838     fi
1839   done
1840   IFS="$ac_save_ifs"
1841 if test $ac_prog_rejected = yes; then
1842   # We found a bogon in the path, so make sure we never use it.
1843   set dummy $ac_cv_prog_CC
1844   shift
1845   if test $# -gt 0; then
1846     # We chose a different compiler from the bogus one.
1847     # However, it has the same basename, so the bogon will be chosen
1848     # first if we set CC to just the basename; use the full file name.
1849     shift
1850     set dummy "$ac_dir/$ac_word" "$@"
1851     shift
1852     ac_cv_prog_CC="$@"
1853   fi
1854 fi
1855 fi
1856 CC="$ac_cv_prog_CC"
1857 if test -n "$CC"; then
1858   echo "$ac_t""$CC" 1>&6
1859 else
1860   echo "$ac_t""no" 1>&6
1861 fi
1862
1863   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1864 fi
1865
1866 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1867 echo "configure:1868: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1868
1869 ac_ext=c
1870 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1871 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1872 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1873 ac_cpp='$CPP '"$xe_cppflags"
1874 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1875 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1876 cross_compiling=no
1877
1878 cat > conftest.$ac_ext <<EOF
1879 #line 1880 "configure"
1880 #include "confdefs.h"
1881 main(){return(0);}
1882 EOF
1883 if { (eval echo configure:1884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1884   ac_cv_prog_cc_works=yes
1885   # If we can't run a trivial program, we are probably using a cross compiler.
1886   if (./conftest; exit) 2>/dev/null; then
1887     ac_cv_prog_cc_cross=no
1888   else
1889     ac_cv_prog_cc_cross=yes
1890   fi
1891 else
1892   echo "configure: failed program was:" >&5
1893   cat conftest.$ac_ext >&5
1894   ac_cv_prog_cc_works=no
1895 fi
1896 rm -fr conftest*
1897
1898 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1899 if test $ac_cv_prog_cc_works = no; then
1900   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1901 fi
1902 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1903 echo "configure:1904: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1904 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1905 cross_compiling=$ac_cv_prog_cc_cross
1906
1907 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1908 echo "configure:1909: checking whether we are using GNU C" >&5
1909
1910 cat > conftest.c <<EOF
1911 #ifdef __GNUC__
1912   yes;
1913 #endif
1914 EOF
1915 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1916   ac_cv_prog_gcc=yes
1917 else
1918   ac_cv_prog_gcc=no
1919 fi
1920
1921 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1922
1923 if test $ac_cv_prog_gcc = yes; then
1924   GCC=yes
1925   ac_test_CFLAGS="${CFLAGS+set}"
1926   ac_save_CFLAGS="$CFLAGS"
1927   CFLAGS=
1928   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1929 echo "configure:1930: checking whether ${CC-cc} accepts -g" >&5
1930
1931 echo 'void f(){}' > conftest.c
1932 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1933   ac_cv_prog_cc_g=yes
1934 else
1935   ac_cv_prog_cc_g=no
1936 fi
1937 rm -f conftest*
1938
1939
1940 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1941   if test "$ac_test_CFLAGS" = set; then
1942     CFLAGS="$ac_save_CFLAGS"
1943   elif test $ac_cv_prog_cc_g = yes; then
1944     CFLAGS="-g -O2"
1945   else
1946     CFLAGS="-O2"
1947   fi
1948 else
1949   GCC=
1950   test "${CFLAGS+set}" = set || CFLAGS="-g"
1951 fi
1952
1953 fi
1954 CFLAGS="$xe_save_CFLAGS"
1955
1956
1957 test -n "$CPP" -a -d "$CPP" && CPP=
1958
1959 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1960
1961 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1962 echo "configure:1963: checking how to run the C preprocessor" >&5
1963 # On Suns, sometimes $CPP names a directory.
1964 if test -n "$CPP" && test -d "$CPP"; then
1965   CPP=
1966 fi
1967 if test -z "$CPP"; then
1968
1969   # This must be in double quotes, not single quotes, because CPP may get
1970   # substituted into the Makefile and "${CC-cc}" will confuse make.
1971   CPP="${CC-cc} -E"
1972   # On the NeXT, cc -E runs the code through the compiler's parser,
1973   # not just through cpp.
1974   cat > conftest.$ac_ext <<EOF
1975 #line 1976 "configure"
1976 #include "confdefs.h"
1977 #include <assert.h>
1978 Syntax Error
1979 EOF
1980 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1981 { (eval echo configure:1982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1982 ac_err=`grep -v '^ *+' conftest.out`
1983 if test -z "$ac_err"; then
1984   :
1985 else
1986   echo "$ac_err" >&5
1987   echo "configure: failed program was:" >&5
1988   cat conftest.$ac_ext >&5
1989   rm -rf conftest*
1990   CPP="${CC-cc} -E -traditional-cpp"
1991   cat > conftest.$ac_ext <<EOF
1992 #line 1993 "configure"
1993 #include "confdefs.h"
1994 #include <assert.h>
1995 Syntax Error
1996 EOF
1997 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1998 { (eval echo configure:1999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1999 ac_err=`grep -v '^ *+' conftest.out`
2000 if test -z "$ac_err"; then
2001   :
2002 else
2003   echo "$ac_err" >&5
2004   echo "configure: failed program was:" >&5
2005   cat conftest.$ac_ext >&5
2006   rm -rf conftest*
2007   CPP=/lib/cpp
2008 fi
2009 rm -f conftest*
2010 fi
2011 rm -f conftest*
2012   ac_cv_prog_CPP="$CPP"
2013   CPP="$ac_cv_prog_CPP"
2014 else
2015   ac_cv_prog_CPP="$CPP"
2016 fi
2017 echo "$ac_t""$CPP" 1>&6
2018
2019
2020 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2021 echo "configure:2022: checking for AIX" >&5
2022 cat > conftest.$ac_ext <<EOF
2023 #line 2024 "configure"
2024 #include "confdefs.h"
2025 #ifdef _AIX
2026   yes
2027 #endif
2028
2029 EOF
2030 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2031   egrep "yes" >/dev/null 2>&1; then
2032   rm -rf conftest*
2033   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2034     Defining _ALL_SOURCE
2035 EOF
2036 cat >> confdefs.h <<\EOF
2037 #define _ALL_SOURCE 1
2038 EOF
2039 }
2040
2041 else
2042   rm -rf conftest*
2043   echo "$ac_t""no" 1>&6
2044 fi
2045 rm -f conftest*
2046
2047
2048
2049 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2050 echo "configure:2051: checking for GNU libc" >&5
2051 cat > conftest.$ac_ext <<EOF
2052 #line 2053 "configure"
2053 #include "confdefs.h"
2054 #include <features.h>
2055 int main() {
2056
2057 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2058 #error Not a GNU libc system :-(
2059 ******* ======= ******** &&&&&&&&
2060 #endif
2061
2062 ; return 0; }
2063 EOF
2064 if { (eval echo configure:2065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2065   rm -rf conftest*
2066   have_glibc=yes
2067 else
2068   echo "configure: failed program was:" >&5
2069   cat conftest.$ac_ext >&5
2070   rm -rf conftest*
2071   have_glibc=no
2072 fi
2073 rm -f conftest*
2074 echo "$ac_t""$have_glibc" 1>&6
2075 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2076     Defining _GNU_SOURCE
2077 EOF
2078 cat >> confdefs.h <<\EOF
2079 #define _GNU_SOURCE 1
2080 EOF
2081 }
2082
2083
2084
2085 cat > conftest.$ac_ext <<EOF
2086 #line 2087 "configure"
2087 #include "confdefs.h"
2088 int main () {
2089 #if defined __SUNPRO_C
2090 return 11;
2091 #elif defined __DECC
2092 return 12;
2093 #else
2094 return 0;
2095 #endif
2096 }
2097 EOF
2098 if { (eval echo configure:2099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2099 then
2100   :
2101 else
2102   conftest_rc="$?"
2103   echo "configure: failed program was:" >&5
2104   cat conftest.$ac_ext >&5
2105   rm -fr conftest*
2106   case "$conftest_rc" in
2107   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2108   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2109 esac
2110 fi
2111 rm -fr conftest*
2112
2113
2114
2115
2116 echo "Extracting information from the machine- and system-dependent headers..."
2117
2118 tempcname="conftest.c"
2119
2120
2121
2122 cat > $tempcname <<EOF
2123 #define NOT_C_CODE
2124 #define C_SWITCH_SITE
2125 #define C_SWITCH_X_SITE
2126 #define LD_SWITCH_SITE
2127 #define LD_SWITCH_X_SITE
2128 #define LD_SWITCH_X_SITE_AUX
2129 #define OS_RELEASE $os_release
2130 #include "$srcdir/src/$opsysfile"
2131 #include "$srcdir/src/$machfile"
2132
2133 #ifndef LIBS_MACHINE
2134 #define LIBS_MACHINE
2135 #endif
2136 configure___ libs_machine=LIBS_MACHINE
2137
2138 #ifndef LIBS_SYSTEM
2139 #define LIBS_SYSTEM
2140 #endif
2141 configure___ libs_system=LIBS_SYSTEM
2142
2143 #ifndef LIBS_TERMCAP
2144 #define LIBS_TERMCAP
2145 #endif
2146 configure___ libs_termcap=LIBS_TERMCAP
2147
2148 #ifndef LIB_STANDARD
2149 #define LIB_STANDARD
2150 #endif
2151 configure___ libs_standard=LIB_STANDARD
2152
2153
2154 #ifndef OBJECTS_MACHINE
2155 #define OBJECTS_MACHINE
2156 #endif
2157 configure___ objects_machine=OBJECTS_MACHINE
2158
2159 #ifndef OBJECTS_SYSTEM
2160 #define OBJECTS_SYSTEM
2161 #endif
2162 configure___ objects_system=OBJECTS_SYSTEM
2163
2164
2165 #ifndef C_SWITCH_MACHINE
2166 #define C_SWITCH_MACHINE
2167 #endif
2168 configure___ c_switch_machine=C_SWITCH_MACHINE
2169
2170 #ifndef C_SWITCH_SYSTEM
2171 #define C_SWITCH_SYSTEM
2172 #endif
2173 configure___ c_switch_system=C_SWITCH_SYSTEM
2174
2175
2176 #ifndef LD_SWITCH_MACHINE
2177 #define LD_SWITCH_MACHINE
2178 #endif
2179 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2180
2181 #ifndef LD_SWITCH_SYSTEM
2182 #define LD_SWITCH_SYSTEM
2183 #endif
2184 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2185
2186
2187 #ifndef UNEXEC
2188 #define UNEXEC "unexec.o"
2189 #endif
2190 configure___ unexec=UNEXEC
2191
2192
2193 #ifndef LD_SWITCH_SHARED
2194 #define LD_SWITCH_SHARED "-c"
2195 #endif
2196 configure___ ld_switch_shared=LD_SWITCH_SHARED
2197
2198
2199 #ifdef ORDINARY_LINK
2200 #define LD "\$(CC) \$(CFLAGS)"
2201 #else /* no ORDINARY LINK */
2202 #ifdef COFF_ENCAPSULATE
2203 #define LD "\$(CC) -nostdlib"
2204 #else /* not COFF_ENCAPSULATE */
2205 #ifdef LINKER
2206 #define LD LINKER
2207 #else /* ! defined (LINKER) */
2208 #define LD "ld"
2209 #endif /* ! defined (LINKER) */
2210 #endif /* ! defined (COFF_ENCAPSULATE) */
2211 #endif /* not ORDINARY_LINK */
2212 configure___ ld=LD
2213
2214 #ifndef LIB_GCC
2215 #define LIB_GCC
2216 #endif
2217 configure___ lib_gcc=LIB_GCC
2218
2219 #ifndef LD_TEXT_START_ADDR
2220 #define LD_TEXT_START_ADDR
2221 #endif
2222 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2223
2224
2225 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2226 #ifdef NO_REMAP
2227 #ifdef COFF_ENCAPSULATE
2228 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2229 #else /* ! defined (COFF_ENCAPSULATE) */
2230 #define START_FILES "pre-crt0.o /lib/crt0.o"
2231 #endif /* ! defined (COFF_ENCAPSULATE) */
2232 #else /* ! defined (NO_REMAP) */
2233 #define START_FILES "ecrt0.o"
2234 #endif /* ! defined (NO_REMAP) */
2235 #endif /* no ORDINARY_LINK */
2236 #ifndef START_FILES
2237 #define START_FILES
2238 #endif
2239 configure___ start_files=START_FILES
2240
2241 #ifdef ORDINARY_LINK
2242 configure___ ordinary_link=yes
2243 #else
2244 configure___ ordinary_link=no
2245 #endif
2246
2247 #ifdef SYSTEM_MALLOC
2248 configure___ system_malloc=yes
2249 #else
2250 configure___ system_malloc=no
2251 #endif
2252
2253 #ifdef TERMINFO
2254 configure___ have_terminfo=yes
2255 #else
2256 configure___ have_terminfo=no
2257 #endif
2258
2259 #ifdef MAIL_USE_FLOCK
2260 configure___ mail_use_flock=yes
2261 #else
2262 configure___ mail_use_flock=no
2263 #endif
2264
2265 #ifdef MAIL_USE_LOCKF
2266 configure___ mail_use_lockf=yes
2267 #else
2268 configure___ mail_use_lockf=no
2269 #endif
2270
2271 EOF
2272
2273 CPP=`eval "echo $CPP"`
2274 eval `$CPP -Isrc $tempcname \
2275         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2276
2277 rm $tempcname
2278
2279 test "$extra_verbose" = "yes" && \
2280   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 ""
2281
2282 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2283
2284 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2285
2286 if test "$cflags_specified" = "no"; then
2287       if   test "$GCC" = "yes"; then
2288     CFLAGS="-g -O3 -Wall -Wno-switch"
2289                     test "$opsys $machine" = "cygwin32 intel386" && \
2290       CFLAGS="-g -O2 -Wall -Wno-switch"
2291   elif test "$__SUNPRO_C" = "yes"; then
2292     case "$opsys" in
2293       sol2    ) CFLAGS="-v -xO4" ;;
2294       sunos4* ) CFLAGS="-xO2";;
2295     esac
2296   elif test "$__DECC" = "yes"; then
2297     CFLAGS="-O3"
2298   elif test "$CC" = "xlc"; then
2299     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2300     else
2301     CFLAGS="-O" ;  fi
2302 fi
2303
2304
2305 if test "$GCC" = "yes"; then
2306   set x $ld_switch_system; shift; ld_switch_system=""
2307   while test -n "$1"; do
2308     case $1 in
2309       -L  | -l  | -u         ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2310       -L* | -l* | -u* | -Wl* ) ld_switch_system="$ld_switch_system $1" ;;
2311       -Xlinker* ) ;;
2312       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2313     esac
2314     shift
2315   done
2316 fi
2317
2318 if test "$GCC" = "yes"; then
2319   set x $ld_switch_machine; shift; ld_switch_machine=""
2320   while test -n "$1"; do
2321     case $1 in
2322       -L  | -l  | -u         ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2323       -L* | -l* | -u* | -Wl* ) ld_switch_machine="$ld_switch_machine $1" ;;
2324       -Xlinker* ) ;;
2325       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2326     esac
2327     shift
2328   done
2329 fi
2330
2331 if test "$GCC" = "yes"; then
2332   set x $LDFLAGS; shift; LDFLAGS=""
2333   while test -n "$1"; do
2334     case $1 in
2335       -L  | -l  | -u         ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2336       -L* | -l* | -u* | -Wl* ) LDFLAGS="$LDFLAGS $1" ;;
2337       -Xlinker* ) ;;
2338       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2339     esac
2340     shift
2341   done
2342 fi
2343
2344 if test "$GCC" = "yes"; then
2345   set x $ld_call_shared; shift; ld_call_shared=""
2346   while test -n "$1"; do
2347     case $1 in
2348       -L  | -l  | -u         ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2349       -L* | -l* | -u* | -Wl* ) ld_call_shared="$ld_call_shared $1" ;;
2350       -Xlinker* ) ;;
2351       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2352     esac
2353     shift
2354   done
2355 fi
2356
2357 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2358    echo "    xemacs will be linked with \"$objects_machine\""
2359  fi
2360 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2361    echo "    xemacs will be linked with \"$objects_system\""
2362  fi
2363 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2364    echo "    xemacs will be linked with \"$unexec\""
2365  fi
2366
2367 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2368 echo "configure:2369: checking for dynodump" >&5
2369 if test "$unexec" != "unexsol2.o"; then
2370   echo "$ac_t""no" 1>&6
2371 else
2372   echo "$ac_t""yes" 1>&6
2373   { test "$extra_verbose" = "yes" && cat << \EOF
2374     Defining DYNODUMP
2375 EOF
2376 cat >> confdefs.h <<\EOF
2377 #define DYNODUMP 1
2378 EOF
2379 }
2380
2381   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2382   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2383   case "$machine" in
2384     sparc   ) dynodump_arch=sparc ;;
2385     *86*    ) dynodump_arch=i386  ;;
2386     powerpc ) dynodump_arch=ppc   ;;
2387   esac
2388     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
2389 fi
2390
2391
2392 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2393
2394 if test "$unexec" = "unexaix.o"; then
2395   if   test "$dynamic" = "no"; then
2396   start_flags="-Wl,-bnso,-bnodelcsect"
2397   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2398   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2399     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2400   done
2401   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2402     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2403   done
2404   
2405 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2406 echo "configure:2407: checking for terminateAndUnload in -lC" >&5
2407 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2408
2409 xe_check_libs=" -lC "
2410 cat > conftest.$ac_ext <<EOF
2411 #line 2412 "configure"
2412 #include "confdefs.h"
2413 /* Override any gcc2 internal prototype to avoid an error.  */
2414 /* We use char because int might match the return type of a gcc2
2415     builtin and then its argument prototype would still apply.  */
2416 char terminateAndUnload();
2417
2418 int main() {
2419 terminateAndUnload()
2420 ; return 0; }
2421 EOF
2422 if { (eval echo configure:2423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2423   rm -rf conftest*
2424   eval "ac_cv_lib_$ac_lib_var=yes"
2425 else
2426   echo "configure: failed program was:" >&5
2427   cat conftest.$ac_ext >&5
2428   rm -rf conftest*
2429   eval "ac_cv_lib_$ac_lib_var=no"
2430 fi
2431 rm -f conftest*
2432 xe_check_libs=""
2433
2434 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2435   echo "$ac_t""yes" 1>&6
2436   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2437 else
2438   echo "$ac_t""no" 1>&6
2439 fi
2440
2441
2442   fi
2443 elif test -n "$ld_text_start_addr"; then
2444   start_flags="-T $ld_text_start_addr -e __start"
2445 fi
2446
2447
2448
2449
2450 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2451  test -z "$linker" &&  linker='$(CC) -nostdlib'
2452  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2453 fi
2454 test "$GCC" != "yes" && lib_gcc=
2455
2456
2457
2458
2459
2460 if test -n "$site_prefixes"; then
2461   for arg in $site_prefixes; do
2462     case "$arg" in
2463         -* ) ;;
2464         * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;;
2465     esac
2466     c_switch_site="$c_switch_site $argi" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argi\" to \$c_switch_site"; fi
2467     ld_switch_site="$ld_switch_site $argl" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argl\" to \$ld_switch_site"; fi
2468   done
2469 fi
2470
2471 if test -n "$site_libraries"; then
2472   for arg in $site_libraries; do
2473     case "$arg" in -* ) ;; * ) arg="-L${arg}" ;; esac
2474     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2475   done
2476 fi
2477
2478 if test -n "$site_includes"; then
2479   for arg in $site_includes; do
2480     case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac
2481     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2482   done
2483 fi
2484
2485
2486 for dir in "/usr/ccs/lib"; do
2487   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
2488 done
2489
2490 if test -n "$site_runtime_libraries"; then
2491   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2492   export LD_RUN_PATH
2493 fi
2494
2495
2496 if   test "$dynamic" = "no"; then add_runtime_path=no
2497 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2498 else case "$opsys" in
2499        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2500        * ) add_runtime_path=no ;;
2501      esac
2502 fi
2503
2504 if test "$add_runtime_path" = "yes"; then
2505       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2506 echo "configure:2507: checking "for runtime libraries flag"" >&5
2507   case "$opsys" in
2508     sol2 ) dash_r = "-R" ;;
2509     decosf* | linux* ) dash_r = "-rpath " ;;
2510     *)
2511       dash_r=""
2512       for try_dash_r in "-R" "-R " "-rpath "; do
2513         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2514         
2515 if test "$GCC" = "yes"; then
2516   set x $xe_check_libs; shift; xe_check_libs=""
2517   while test -n "$1"; do
2518     case $1 in
2519       -L  | -l  | -u         ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2520       -L* | -l* | -u* | -Wl* ) xe_check_libs="$xe_check_libs $1" ;;
2521       -Xlinker* ) ;;
2522       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2523     esac
2524     shift
2525   done
2526 fi
2527         cat > conftest.$ac_ext <<EOF
2528 #line 2529 "configure"
2529 #include "confdefs.h"
2530
2531 int main() {
2532
2533 ; return 0; }
2534 EOF
2535 if { (eval echo configure:2536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2536   rm -rf conftest*
2537   dash_r="$try_dash_r"
2538 else
2539   echo "configure: failed program was:" >&5
2540   cat conftest.$ac_ext >&5
2541 fi
2542 rm -f conftest*
2543         xe_check_libs=""
2544         test -n "$dash_r" && break
2545       done ;;
2546   esac
2547   if test -n "$dash_r";
2548     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2549     else echo "$ac_t""NONE" 1>&6
2550   fi
2551 fi
2552
2553 xe_add_unique_runpath_dir='
2554   xe_add_p=yes
2555   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2556   done
2557   if test "$xe_add_p" = "yes"; then
2558     test -n "$runpath" && runpath="${runpath}:"
2559     runpath="${runpath}${xe_runpath_dir}"
2560     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2561   fi'
2562
2563
2564
2565
2566 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2567     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2568   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2569   
2570         runpath="" runpath_dirs=""
2571   if test -n "$LD_RUN_PATH"; then
2572     runpath="$LD_RUN_PATH"
2573   elif test "$GCC" = "yes"; then
2574         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2575     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2576     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2577     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2578       case "$arg" in P,* | -L* | -R* )
2579         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2580           {
2581 xe_runpath_dir="$dir"
2582   test "$xe_runpath_dir" != "/lib"     -a \
2583         "$xe_runpath_dir" != "/usr/lib" -a \
2584         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2585   eval "$xe_add_unique_runpath_dir"
2586 }
2587         done ;;
2588       esac
2589     done
2590     ld_switch_run="$ld_switch_run_save"
2591     rm -f conftest*
2592   else
2593         for arg in $ld_switch_site $ld_switch_x_site; do
2594       case "$arg" in -L*) {
2595 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2596   test "$xe_runpath_dir" != "/lib"     -a \
2597         "$xe_runpath_dir" != "/usr/lib" -a \
2598         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2599   eval "$xe_add_unique_runpath_dir"
2600 };; esac
2601     done
2602         if test "$opsys $need_motif" = "sol2 yes"; then
2603       xe_runpath_dir="/opt/SUNWdt/lib";
2604       eval "$xe_add_unique_runpath_dir";
2605     fi
2606   fi 
2607   if test -n "$runpath"; then
2608     ld_switch_run="${dash_r}${runpath}"
2609     
2610 if test "$GCC" = "yes"; then
2611   set x $ld_switch_run; shift; ld_switch_run=""
2612   while test -n "$1"; do
2613     case $1 in
2614       -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2615       -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
2616       -Xlinker* ) ;;
2617       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2618     esac
2619     shift
2620   done
2621 fi
2622     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2623   fi
2624 fi
2625
2626
2627
2628 GNU_MALLOC=yes
2629 if test "$with_dlmalloc" != "no"; then
2630         doug_lea_malloc=yes
2631 else
2632         doug_lea_malloc=no
2633 fi
2634 after_morecore_hook_exists=yes
2635 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2636 echo "configure:2637: checking for malloc_get_state" >&5
2637
2638 cat > conftest.$ac_ext <<EOF
2639 #line 2640 "configure"
2640 #include "confdefs.h"
2641 /* System header to define __stub macros and hopefully few prototypes,
2642     which can conflict with char malloc_get_state(); below.  */
2643 #include <assert.h>
2644 /* Override any gcc2 internal prototype to avoid an error.  */
2645 /* We use char because int might match the return type of a gcc2
2646     builtin and then its argument prototype would still apply.  */
2647 char malloc_get_state();
2648
2649 int main() {
2650
2651 /* The GNU C library defines this for functions which it implements
2652     to always fail with ENOSYS.  Some functions are actually named
2653     something starting with __ and the normal name is an alias.  */
2654 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2655 choke me
2656 #else
2657 malloc_get_state();
2658 #endif
2659
2660 ; return 0; }
2661 EOF
2662 if { (eval echo configure:2663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2663   rm -rf conftest*
2664   eval "ac_cv_func_malloc_get_state=yes"
2665 else
2666   echo "configure: failed program was:" >&5
2667   cat conftest.$ac_ext >&5
2668   rm -rf conftest*
2669   eval "ac_cv_func_malloc_get_state=no"
2670 fi
2671 rm -f conftest*
2672
2673 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2674   echo "$ac_t""yes" 1>&6
2675   :
2676 else
2677   echo "$ac_t""no" 1>&6
2678 doug_lea_malloc=no
2679 fi
2680
2681 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2682 echo "configure:2683: checking for malloc_set_state" >&5
2683
2684 cat > conftest.$ac_ext <<EOF
2685 #line 2686 "configure"
2686 #include "confdefs.h"
2687 /* System header to define __stub macros and hopefully few prototypes,
2688     which can conflict with char malloc_set_state(); below.  */
2689 #include <assert.h>
2690 /* Override any gcc2 internal prototype to avoid an error.  */
2691 /* We use char because int might match the return type of a gcc2
2692     builtin and then its argument prototype would still apply.  */
2693 char malloc_set_state();
2694
2695 int main() {
2696
2697 /* The GNU C library defines this for functions which it implements
2698     to always fail with ENOSYS.  Some functions are actually named
2699     something starting with __ and the normal name is an alias.  */
2700 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2701 choke me
2702 #else
2703 malloc_set_state();
2704 #endif
2705
2706 ; return 0; }
2707 EOF
2708 if { (eval echo configure:2709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2709   rm -rf conftest*
2710   eval "ac_cv_func_malloc_set_state=yes"
2711 else
2712   echo "configure: failed program was:" >&5
2713   cat conftest.$ac_ext >&5
2714   rm -rf conftest*
2715   eval "ac_cv_func_malloc_set_state=no"
2716 fi
2717 rm -f conftest*
2718
2719 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2720   echo "$ac_t""yes" 1>&6
2721   :
2722 else
2723   echo "$ac_t""no" 1>&6
2724 doug_lea_malloc=no
2725 fi
2726
2727 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2728 echo "configure:2729: checking whether __after_morecore_hook exists" >&5
2729 cat > conftest.$ac_ext <<EOF
2730 #line 2731 "configure"
2731 #include "confdefs.h"
2732 extern void (* __after_morecore_hook)();
2733 int main() {
2734 __after_morecore_hook = 0
2735 ; return 0; }
2736 EOF
2737 if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2738   rm -rf conftest*
2739   echo "$ac_t""yes" 1>&6
2740 else
2741   echo "configure: failed program was:" >&5
2742   cat conftest.$ac_ext >&5
2743   rm -rf conftest*
2744   echo "$ac_t""no" 1>&6
2745    after_morecore_hook_exists=no
2746 fi
2747 rm -f conftest*
2748 if test "$system_malloc" = "yes" ; then
2749   GNU_MALLOC=no
2750   GNU_MALLOC_reason="
2751   (The GNU allocators don't work with this system configuration)."
2752 elif test "$with_system_malloc" = "yes" ; then
2753   GNU_MALLOC=no
2754   GNU_MALLOC_reason="
2755   (User chose not to use GNU allocators)."
2756 elif test "$with_debug_malloc" = "yes" ; then
2757   GNU_MALLOC=no
2758   GNU_MALLOC_reason="
2759   (User chose to use Debugging Malloc)."
2760 fi
2761
2762 if test "$doug_lea_malloc" = "yes" ; then
2763   if test "$GNU_MALLOC" = yes ; then
2764     GNU_MALLOC_reason="
2765   (Using Doug Lea's new malloc from the GNU C Library.)"
2766   fi
2767   { test "$extra_verbose" = "yes" && cat << \EOF
2768     Defining DOUG_LEA_MALLOC
2769 EOF
2770 cat >> confdefs.h <<\EOF
2771 #define DOUG_LEA_MALLOC 1
2772 EOF
2773 }
2774
2775   if test "$after_morecore_hook_exists" = "no" ; then
2776     GNU_MALLOC_reason="
2777   (Using Doug Lea's new malloc from the Linux C Library.)"
2778     { test "$extra_verbose" = "yes" && cat << \EOF
2779     Defining _NO_MALLOC_WARNING_
2780 EOF
2781 cat >> confdefs.h <<\EOF
2782 #define _NO_MALLOC_WARNING_ 1
2783 EOF
2784 }
2785
2786   fi
2787   use_minimal_tagbits=yes
2788 fi
2789
2790
2791
2792
2793 # Extract the first word of "ranlib", so it can be a program name with args.
2794 set dummy ranlib; ac_word=$2
2795 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2796 echo "configure:2797: checking for $ac_word" >&5
2797
2798 if test -n "$RANLIB"; then
2799   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2800 else
2801   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2802   for ac_dir in $PATH; do
2803     test -z "$ac_dir" && ac_dir=.
2804     if test -f $ac_dir/$ac_word; then
2805       ac_cv_prog_RANLIB="ranlib"
2806       break
2807     fi
2808   done
2809   IFS="$ac_save_ifs"
2810   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2811 fi
2812 RANLIB="$ac_cv_prog_RANLIB"
2813 if test -n "$RANLIB"; then
2814   echo "$ac_t""$RANLIB" 1>&6
2815 else
2816   echo "$ac_t""no" 1>&6
2817 fi
2818
2819 ac_aux_dir=
2820 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2821   if test -f $ac_dir/install-sh; then
2822     ac_aux_dir=$ac_dir
2823     ac_install_sh="$ac_aux_dir/install-sh -c"
2824     break
2825   elif test -f $ac_dir/install.sh; then
2826     ac_aux_dir=$ac_dir
2827     ac_install_sh="$ac_aux_dir/install.sh -c"
2828     break
2829   fi
2830 done
2831 if test -z "$ac_aux_dir"; then
2832   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2833 fi
2834 ac_config_guess=$ac_aux_dir/config.guess
2835 ac_config_sub=$ac_aux_dir/config.sub
2836 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2837
2838 # Find a good install program.  We prefer a C program (faster),
2839 # so one script is as good as another.  But avoid the broken or
2840 # incompatible versions:
2841 # SysV /etc/install, /usr/sbin/install
2842 # SunOS /usr/etc/install
2843 # IRIX /sbin/install
2844 # AIX /bin/install
2845 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2846 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2847 # ./install, which can be erroneously created by make from ./install.sh.
2848 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2849 echo "configure:2850: checking for a BSD compatible install" >&5
2850 if test -z "$INSTALL"; then
2851
2852   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2853   for ac_dir in $PATH; do
2854     # Account for people who put trailing slashes in PATH elements.
2855     case "$ac_dir/" in
2856     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2857     *)
2858       # OSF1 and SCO ODT 3.0 have their own names for install.
2859       for ac_prog in ginstall installbsd scoinst install; do
2860         if test -f $ac_dir/$ac_prog; then
2861           if test $ac_prog = install &&
2862             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2863             # AIX install.  It has an incompatible calling convention.
2864             # OSF/1 installbsd also uses dspmsg, but is usable.
2865             :
2866           else
2867             ac_cv_path_install="$ac_dir/$ac_prog -c"
2868             break 2
2869           fi
2870         fi
2871       done
2872       ;;
2873     esac
2874   done
2875   IFS="$ac_save_IFS"
2876
2877   if test "${ac_cv_path_install+set}" = set; then
2878     INSTALL="$ac_cv_path_install"
2879   else
2880     # As a last resort, use the slow shell script.  We don't cache a
2881     # path for INSTALL within a source directory, because that will
2882     # break other packages using the cache if that directory is
2883     # removed, or if the path is relative.
2884     INSTALL="$ac_install_sh"
2885   fi
2886 fi
2887 echo "$ac_t""$INSTALL" 1>&6
2888
2889 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2890 # It thinks the first close brace ends the variable substitution.
2891 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2892
2893 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2894
2895 for ac_prog in 'bison -y' byacc
2896 do
2897 # Extract the first word of "$ac_prog", so it can be a program name with args.
2898 set dummy $ac_prog; ac_word=$2
2899 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2900 echo "configure:2901: checking for $ac_word" >&5
2901
2902 if test -n "$YACC"; then
2903   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2904 else
2905   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2906   for ac_dir in $PATH; do
2907     test -z "$ac_dir" && ac_dir=.
2908     if test -f $ac_dir/$ac_word; then
2909       ac_cv_prog_YACC="$ac_prog"
2910       break
2911     fi
2912   done
2913   IFS="$ac_save_ifs"
2914 fi
2915 YACC="$ac_cv_prog_YACC"
2916 if test -n "$YACC"; then
2917   echo "$ac_t""$YACC" 1>&6
2918 else
2919   echo "$ac_t""no" 1>&6
2920 fi
2921
2922 test -n "$YACC" && break
2923 done
2924 test -n "$YACC" || YACC="yacc"
2925
2926
2927 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
2928 do
2929 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2930 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2931 echo "configure:2932: checking for $ac_hdr" >&5
2932
2933 cat > conftest.$ac_ext <<EOF
2934 #line 2935 "configure"
2935 #include "confdefs.h"
2936 #include <$ac_hdr>
2937 EOF
2938 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2939 { (eval echo configure:2940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2940 ac_err=`grep -v '^ *+' conftest.out`
2941 if test -z "$ac_err"; then
2942   rm -rf conftest*
2943   eval "ac_cv_header_$ac_safe=yes"
2944 else
2945   echo "$ac_err" >&5
2946   echo "configure: failed program was:" >&5
2947   cat conftest.$ac_ext >&5
2948   rm -rf conftest*
2949   eval "ac_cv_header_$ac_safe=no"
2950 fi
2951 rm -f conftest*
2952 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2953   echo "$ac_t""yes" 1>&6
2954     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2955   { test "$extra_verbose" = "yes" && cat << EOF
2956     Defining $ac_tr_hdr
2957 EOF
2958 cat >> confdefs.h <<EOF
2959 #define $ac_tr_hdr 1
2960 EOF
2961 }
2962  
2963 else
2964   echo "$ac_t""no" 1>&6
2965 fi
2966 done
2967
2968 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin32/version.h
2969 do
2970 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2971 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2972 echo "configure:2973: checking for $ac_hdr" >&5
2973
2974 cat > conftest.$ac_ext <<EOF
2975 #line 2976 "configure"
2976 #include "confdefs.h"
2977 #include <$ac_hdr>
2978 EOF
2979 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2980 { (eval echo configure:2981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2981 ac_err=`grep -v '^ *+' conftest.out`
2982 if test -z "$ac_err"; then
2983   rm -rf conftest*
2984   eval "ac_cv_header_$ac_safe=yes"
2985 else
2986   echo "$ac_err" >&5
2987   echo "configure: failed program was:" >&5
2988   cat conftest.$ac_ext >&5
2989   rm -rf conftest*
2990   eval "ac_cv_header_$ac_safe=no"
2991 fi
2992 rm -f conftest*
2993 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2994   echo "$ac_t""yes" 1>&6
2995     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2996   { test "$extra_verbose" = "yes" && cat << EOF
2997     Defining $ac_tr_hdr
2998 EOF
2999 cat >> confdefs.h <<EOF
3000 #define $ac_tr_hdr 1
3001 EOF
3002 }
3003  
3004 else
3005   echo "$ac_t""no" 1>&6
3006 fi
3007 done
3008
3009 for ac_hdr in linux/version.h kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3010 do
3011 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3012 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3013 echo "configure:3014: checking for $ac_hdr" >&5
3014
3015 cat > conftest.$ac_ext <<EOF
3016 #line 3017 "configure"
3017 #include "confdefs.h"
3018 #include <$ac_hdr>
3019 EOF
3020 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3021 { (eval echo configure:3022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3022 ac_err=`grep -v '^ *+' conftest.out`
3023 if test -z "$ac_err"; then
3024   rm -rf conftest*
3025   eval "ac_cv_header_$ac_safe=yes"
3026 else
3027   echo "$ac_err" >&5
3028   echo "configure: failed program was:" >&5
3029   cat conftest.$ac_ext >&5
3030   rm -rf conftest*
3031   eval "ac_cv_header_$ac_safe=no"
3032 fi
3033 rm -f conftest*
3034 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3035   echo "$ac_t""yes" 1>&6
3036     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3037   { test "$extra_verbose" = "yes" && cat << EOF
3038     Defining $ac_tr_hdr
3039 EOF
3040 cat >> confdefs.h <<EOF
3041 #define $ac_tr_hdr 1
3042 EOF
3043 }
3044  
3045 else
3046   echo "$ac_t""no" 1>&6
3047 fi
3048 done
3049
3050 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3051 echo "configure:3052: checking for sys/wait.h that is POSIX.1 compatible" >&5
3052
3053 cat > conftest.$ac_ext <<EOF
3054 #line 3055 "configure"
3055 #include "confdefs.h"
3056 #include <sys/types.h>
3057 #include <sys/wait.h>
3058 #ifndef WEXITSTATUS
3059 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3060 #endif
3061 #ifndef WIFEXITED
3062 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3063 #endif
3064 int main() {
3065 int s;
3066 wait (&s);
3067 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3068 ; return 0; }
3069 EOF
3070 if { (eval echo configure:3071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3071   rm -rf conftest*
3072   ac_cv_header_sys_wait_h=yes
3073 else
3074   echo "configure: failed program was:" >&5
3075   cat conftest.$ac_ext >&5
3076   rm -rf conftest*
3077   ac_cv_header_sys_wait_h=no
3078 fi
3079 rm -f conftest*
3080
3081 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3082 if test $ac_cv_header_sys_wait_h = yes; then
3083   { test "$extra_verbose" = "yes" && cat << \EOF
3084     Defining HAVE_SYS_WAIT_H
3085 EOF
3086 cat >> confdefs.h <<\EOF
3087 #define HAVE_SYS_WAIT_H 1
3088 EOF
3089 }
3090
3091 fi
3092
3093 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3094 echo "configure:3095: checking for ANSI C header files" >&5
3095
3096 cat > conftest.$ac_ext <<EOF
3097 #line 3098 "configure"
3098 #include "confdefs.h"
3099 #include <stdlib.h>
3100 #include <stdarg.h>
3101 #include <string.h>
3102 #include <float.h>
3103 EOF
3104 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3105 { (eval echo configure:3106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3106 ac_err=`grep -v '^ *+' conftest.out`
3107 if test -z "$ac_err"; then
3108   rm -rf conftest*
3109   ac_cv_header_stdc=yes
3110 else
3111   echo "$ac_err" >&5
3112   echo "configure: failed program was:" >&5
3113   cat conftest.$ac_ext >&5
3114   rm -rf conftest*
3115   ac_cv_header_stdc=no
3116 fi
3117 rm -f conftest*
3118
3119 if test $ac_cv_header_stdc = yes; then
3120   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3121 cat > conftest.$ac_ext <<EOF
3122 #line 3123 "configure"
3123 #include "confdefs.h"
3124 #include <string.h>
3125 EOF
3126 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3127   egrep "memchr" >/dev/null 2>&1; then
3128   :
3129 else
3130   rm -rf conftest*
3131   ac_cv_header_stdc=no
3132 fi
3133 rm -f conftest*
3134
3135 fi
3136
3137 if test $ac_cv_header_stdc = yes; then
3138   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3139 cat > conftest.$ac_ext <<EOF
3140 #line 3141 "configure"
3141 #include "confdefs.h"
3142 #include <stdlib.h>
3143 EOF
3144 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3145   egrep "free" >/dev/null 2>&1; then
3146   :
3147 else
3148   rm -rf conftest*
3149   ac_cv_header_stdc=no
3150 fi
3151 rm -f conftest*
3152
3153 fi
3154
3155 if test $ac_cv_header_stdc = yes; then
3156   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3157 cat > conftest.$ac_ext <<EOF
3158 #line 3159 "configure"
3159 #include "confdefs.h"
3160 #include <ctype.h>
3161 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3162 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3163 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3164 int main () { int i; for (i = 0; i < 256; i++)
3165 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3166 exit (0); }
3167
3168 EOF
3169 if { (eval echo configure:3170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3170 then
3171   :
3172 else
3173   conftest_rc="$?"
3174   echo "configure: failed program was:" >&5
3175   cat conftest.$ac_ext >&5
3176   rm -fr conftest*
3177   ac_cv_header_stdc=no
3178 fi
3179 rm -fr conftest*
3180 fi
3181
3182 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3183 if test $ac_cv_header_stdc = yes; then
3184   { test "$extra_verbose" = "yes" && cat << \EOF
3185     Defining STDC_HEADERS
3186 EOF
3187 cat >> confdefs.h <<\EOF
3188 #define STDC_HEADERS 1
3189 EOF
3190 }
3191
3192 fi
3193
3194 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3195 echo "configure:3196: checking whether time.h and sys/time.h may both be included" >&5
3196
3197 cat > conftest.$ac_ext <<EOF
3198 #line 3199 "configure"
3199 #include "confdefs.h"
3200 #include <sys/types.h>
3201 #include <sys/time.h>
3202 #include <time.h>
3203 int main() {
3204 struct tm *tp;
3205 ; return 0; }
3206 EOF
3207 if { (eval echo configure:3208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3208   rm -rf conftest*
3209   ac_cv_header_time=yes
3210 else
3211   echo "configure: failed program was:" >&5
3212   cat conftest.$ac_ext >&5
3213   rm -rf conftest*
3214   ac_cv_header_time=no
3215 fi
3216 rm -f conftest*
3217
3218 echo "$ac_t""$ac_cv_header_time" 1>&6
3219 if test $ac_cv_header_time = yes; then
3220   { test "$extra_verbose" = "yes" && cat << \EOF
3221     Defining TIME_WITH_SYS_TIME
3222 EOF
3223 cat >> confdefs.h <<\EOF
3224 #define TIME_WITH_SYS_TIME 1
3225 EOF
3226 }
3227
3228 fi
3229
3230 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3231 echo "configure:3232: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3232
3233 cat > conftest.$ac_ext <<EOF
3234 #line 3235 "configure"
3235 #include "confdefs.h"
3236 #include <sys/types.h>
3237 #include <signal.h>
3238 /* NetBSD declares sys_siglist in unistd.h.  */
3239 #ifdef HAVE_UNISTD_H
3240 #include <unistd.h>
3241 #endif
3242 int main() {
3243 char *msg = *(sys_siglist + 1);
3244 ; return 0; }
3245 EOF
3246 if { (eval echo configure:3247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3247   rm -rf conftest*
3248   ac_cv_decl_sys_siglist=yes
3249 else
3250   echo "configure: failed program was:" >&5
3251   cat conftest.$ac_ext >&5
3252   rm -rf conftest*
3253   ac_cv_decl_sys_siglist=no
3254 fi
3255 rm -f conftest*
3256
3257 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3258 if test $ac_cv_decl_sys_siglist = yes; then
3259   { test "$extra_verbose" = "yes" && cat << \EOF
3260     Defining SYS_SIGLIST_DECLARED
3261 EOF
3262 cat >> confdefs.h <<\EOF
3263 #define SYS_SIGLIST_DECLARED 1
3264 EOF
3265 }
3266
3267 fi
3268
3269
3270 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3271 echo "configure:3272: checking for struct utimbuf" >&5
3272 cat > conftest.$ac_ext <<EOF
3273 #line 3274 "configure"
3274 #include "confdefs.h"
3275 #ifdef TIME_WITH_SYS_TIME
3276 #include <sys/time.h>
3277 #include <time.h>
3278 #else
3279 #ifdef HAVE_SYS_TIME_H
3280 #include <sys/time.h>
3281 #else
3282 #include <time.h>
3283 #endif
3284 #endif
3285 #ifdef HAVE_UTIME_H
3286 #include <utime.h>
3287 #endif
3288 int main() {
3289 static struct utimbuf x; x.actime = x.modtime;
3290 ; return 0; }
3291 EOF
3292 if { (eval echo configure:3293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3293   rm -rf conftest*
3294   echo "$ac_t""yes" 1>&6
3295    { test "$extra_verbose" = "yes" && cat << \EOF
3296     Defining HAVE_STRUCT_UTIMBUF
3297 EOF
3298 cat >> confdefs.h <<\EOF
3299 #define HAVE_STRUCT_UTIMBUF 1
3300 EOF
3301 }
3302
3303 else
3304   echo "configure: failed program was:" >&5
3305   cat conftest.$ac_ext >&5
3306   rm -rf conftest*
3307   echo "$ac_t""no" 1>&6
3308 fi
3309 rm -f conftest*
3310
3311 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3312 echo "configure:3313: checking return type of signal handlers" >&5
3313
3314 cat > conftest.$ac_ext <<EOF
3315 #line 3316 "configure"
3316 #include "confdefs.h"
3317 #include <sys/types.h>
3318 #include <signal.h>
3319 #ifdef signal
3320 #undef signal
3321 #endif
3322 #ifdef __cplusplus
3323 extern "C" void (*signal (int, void (*)(int)))(int);
3324 #else
3325 void (*signal ()) ();
3326 #endif
3327
3328 int main() {
3329 int i;
3330 ; return 0; }
3331 EOF
3332 if { (eval echo configure:3333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3333   rm -rf conftest*
3334   ac_cv_type_signal=void
3335 else
3336   echo "configure: failed program was:" >&5
3337   cat conftest.$ac_ext >&5
3338   rm -rf conftest*
3339   ac_cv_type_signal=int
3340 fi
3341 rm -f conftest*
3342
3343 echo "$ac_t""$ac_cv_type_signal" 1>&6
3344 { test "$extra_verbose" = "yes" && cat << EOF
3345     Defining RETSIGTYPE = $ac_cv_type_signal
3346 EOF
3347 cat >> confdefs.h <<EOF
3348 #define RETSIGTYPE $ac_cv_type_signal
3349 EOF
3350 }
3351
3352
3353 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3354 echo "configure:3355: checking for size_t" >&5
3355
3356 cat > conftest.$ac_ext <<EOF
3357 #line 3358 "configure"
3358 #include "confdefs.h"
3359 #include <sys/types.h>
3360 #if STDC_HEADERS
3361 #include <stdlib.h>
3362 #include <stddef.h>
3363 #endif
3364 EOF
3365 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3366   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3367   rm -rf conftest*
3368   ac_cv_type_size_t=yes
3369 else
3370   rm -rf conftest*
3371   ac_cv_type_size_t=no
3372 fi
3373 rm -f conftest*
3374
3375 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3376 if test $ac_cv_type_size_t = no; then
3377   { test "$extra_verbose" = "yes" && cat << \EOF
3378     Defining size_t = unsigned
3379 EOF
3380 cat >> confdefs.h <<\EOF
3381 #define size_t unsigned
3382 EOF
3383 }
3384
3385 fi
3386
3387 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3388 echo "configure:3389: checking for pid_t" >&5
3389
3390 cat > conftest.$ac_ext <<EOF
3391 #line 3392 "configure"
3392 #include "confdefs.h"
3393 #include <sys/types.h>
3394 #if STDC_HEADERS
3395 #include <stdlib.h>
3396 #include <stddef.h>
3397 #endif
3398 EOF
3399 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3400   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3401   rm -rf conftest*
3402   ac_cv_type_pid_t=yes
3403 else
3404   rm -rf conftest*
3405   ac_cv_type_pid_t=no
3406 fi
3407 rm -f conftest*
3408
3409 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3410 if test $ac_cv_type_pid_t = no; then
3411   { test "$extra_verbose" = "yes" && cat << \EOF
3412     Defining pid_t = int
3413 EOF
3414 cat >> confdefs.h <<\EOF
3415 #define pid_t int
3416 EOF
3417 }
3418
3419 fi
3420
3421 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3422 echo "configure:3423: checking for uid_t in sys/types.h" >&5
3423
3424 cat > conftest.$ac_ext <<EOF
3425 #line 3426 "configure"
3426 #include "confdefs.h"
3427 #include <sys/types.h>
3428 EOF
3429 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3430   egrep "uid_t" >/dev/null 2>&1; then
3431   rm -rf conftest*
3432   ac_cv_type_uid_t=yes
3433 else
3434   rm -rf conftest*
3435   ac_cv_type_uid_t=no
3436 fi
3437 rm -f conftest*
3438
3439
3440 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3441 if test $ac_cv_type_uid_t = no; then
3442   { test "$extra_verbose" = "yes" && cat << \EOF
3443     Defining uid_t = int
3444 EOF
3445 cat >> confdefs.h <<\EOF
3446 #define uid_t int
3447 EOF
3448 }
3449
3450   { test "$extra_verbose" = "yes" && cat << \EOF
3451     Defining gid_t = int
3452 EOF
3453 cat >> confdefs.h <<\EOF
3454 #define gid_t int
3455 EOF
3456 }
3457
3458 fi
3459
3460 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3461 echo "configure:3462: checking for mode_t" >&5
3462
3463 cat > conftest.$ac_ext <<EOF
3464 #line 3465 "configure"
3465 #include "confdefs.h"
3466 #include <sys/types.h>
3467 #if STDC_HEADERS
3468 #include <stdlib.h>
3469 #include <stddef.h>
3470 #endif
3471 EOF
3472 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3473   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3474   rm -rf conftest*
3475   ac_cv_type_mode_t=yes
3476 else
3477   rm -rf conftest*
3478   ac_cv_type_mode_t=no
3479 fi
3480 rm -f conftest*
3481
3482 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3483 if test $ac_cv_type_mode_t = no; then
3484   { test "$extra_verbose" = "yes" && cat << \EOF
3485     Defining mode_t = int
3486 EOF
3487 cat >> confdefs.h <<\EOF
3488 #define mode_t int
3489 EOF
3490 }
3491
3492 fi
3493
3494 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3495 echo "configure:3496: checking for off_t" >&5
3496
3497 cat > conftest.$ac_ext <<EOF
3498 #line 3499 "configure"
3499 #include "confdefs.h"
3500 #include <sys/types.h>
3501 #if STDC_HEADERS
3502 #include <stdlib.h>
3503 #include <stddef.h>
3504 #endif
3505 EOF
3506 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3507   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3508   rm -rf conftest*
3509   ac_cv_type_off_t=yes
3510 else
3511   rm -rf conftest*
3512   ac_cv_type_off_t=no
3513 fi
3514 rm -f conftest*
3515
3516 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3517 if test $ac_cv_type_off_t = no; then
3518   { test "$extra_verbose" = "yes" && cat << \EOF
3519     Defining off_t = long
3520 EOF
3521 cat >> confdefs.h <<\EOF
3522 #define off_t long
3523 EOF
3524 }
3525
3526 fi
3527
3528
3529 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3530 echo "configure:3531: checking for struct timeval" >&5
3531 cat > conftest.$ac_ext <<EOF
3532 #line 3533 "configure"
3533 #include "confdefs.h"
3534 #ifdef TIME_WITH_SYS_TIME
3535 #include <sys/time.h>
3536 #include <time.h>
3537 #else
3538 #ifdef HAVE_SYS_TIME_H
3539 #include <sys/time.h>
3540 #else
3541 #include <time.h>
3542 #endif
3543 #endif
3544 int main() {
3545 static struct timeval x; x.tv_sec = x.tv_usec;
3546 ; return 0; }
3547 EOF
3548 if { (eval echo configure:3549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3549   rm -rf conftest*
3550   echo "$ac_t""yes" 1>&6
3551   HAVE_TIMEVAL=yes
3552   { test "$extra_verbose" = "yes" && cat << \EOF
3553     Defining HAVE_TIMEVAL
3554 EOF
3555 cat >> confdefs.h <<\EOF
3556 #define HAVE_TIMEVAL 1
3557 EOF
3558 }
3559
3560 else
3561   echo "configure: failed program was:" >&5
3562   cat conftest.$ac_ext >&5
3563   rm -rf conftest*
3564   echo "$ac_t""no" 1>&6
3565    HAVE_TIMEVAL=no
3566 fi
3567 rm -f conftest*
3568
3569 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3570 echo "configure:3571: checking whether struct tm is in sys/time.h or time.h" >&5
3571
3572 cat > conftest.$ac_ext <<EOF
3573 #line 3574 "configure"
3574 #include "confdefs.h"
3575 #include <sys/types.h>
3576 #include <time.h>
3577 int main() {
3578 struct tm *tp; tp->tm_sec;
3579 ; return 0; }
3580 EOF
3581 if { (eval echo configure:3582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3582   rm -rf conftest*
3583   ac_cv_struct_tm=time.h
3584 else
3585   echo "configure: failed program was:" >&5
3586   cat conftest.$ac_ext >&5
3587   rm -rf conftest*
3588   ac_cv_struct_tm=sys/time.h
3589 fi
3590 rm -f conftest*
3591
3592 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3593 if test $ac_cv_struct_tm = sys/time.h; then
3594   { test "$extra_verbose" = "yes" && cat << \EOF
3595     Defining TM_IN_SYS_TIME
3596 EOF
3597 cat >> confdefs.h <<\EOF
3598 #define TM_IN_SYS_TIME 1
3599 EOF
3600 }
3601
3602 fi
3603
3604 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3605 echo "configure:3606: checking for tm_zone in struct tm" >&5
3606
3607 cat > conftest.$ac_ext <<EOF
3608 #line 3609 "configure"
3609 #include "confdefs.h"
3610 #include <sys/types.h>
3611 #include <$ac_cv_struct_tm>
3612 int main() {
3613 struct tm tm; tm.tm_zone;
3614 ; return 0; }
3615 EOF
3616 if { (eval echo configure:3617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3617   rm -rf conftest*
3618   ac_cv_struct_tm_zone=yes
3619 else
3620   echo "configure: failed program was:" >&5
3621   cat conftest.$ac_ext >&5
3622   rm -rf conftest*
3623   ac_cv_struct_tm_zone=no
3624 fi
3625 rm -f conftest*
3626
3627 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3628 if test "$ac_cv_struct_tm_zone" = yes; then
3629   { test "$extra_verbose" = "yes" && cat << \EOF
3630     Defining HAVE_TM_ZONE
3631 EOF
3632 cat >> confdefs.h <<\EOF
3633 #define HAVE_TM_ZONE 1
3634 EOF
3635 }
3636
3637 else
3638   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3639 echo "configure:3640: checking for tzname" >&5
3640
3641 cat > conftest.$ac_ext <<EOF
3642 #line 3643 "configure"
3643 #include "confdefs.h"
3644 #include <time.h>
3645 #ifndef tzname /* For SGI.  */
3646 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3647 #endif
3648 int main() {
3649 atoi(*tzname);
3650 ; return 0; }
3651 EOF
3652 if { (eval echo configure:3653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3653   rm -rf conftest*
3654   ac_cv_var_tzname=yes
3655 else
3656   echo "configure: failed program was:" >&5
3657   cat conftest.$ac_ext >&5
3658   rm -rf conftest*
3659   ac_cv_var_tzname=no
3660 fi
3661 rm -f conftest*
3662
3663 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3664   if test $ac_cv_var_tzname = yes; then
3665     { test "$extra_verbose" = "yes" && cat << \EOF
3666     Defining HAVE_TZNAME
3667 EOF
3668 cat >> confdefs.h <<\EOF
3669 #define HAVE_TZNAME 1
3670 EOF
3671 }
3672
3673   fi
3674 fi
3675
3676
3677 echo $ac_n "checking for working const""... $ac_c" 1>&6
3678 echo "configure:3679: checking for working const" >&5
3679
3680 cat > conftest.$ac_ext <<EOF
3681 #line 3682 "configure"
3682 #include "confdefs.h"
3683
3684 int main() {
3685
3686 /* Ultrix mips cc rejects this.  */
3687 typedef int charset[2]; const charset x;
3688 /* SunOS 4.1.1 cc rejects this.  */
3689 char const *const *ccp;
3690 char **p;
3691 /* NEC SVR4.0.2 mips cc rejects this.  */
3692 struct point {int x, y;};
3693 static struct point const zero = {0,0};
3694 /* AIX XL C 1.02.0.0 rejects this.
3695    It does not let you subtract one const X* pointer from another in an arm
3696    of an if-expression whose if-part is not a constant expression */
3697 const char *g = "string";
3698 ccp = &g + (g ? g-g : 0);
3699 /* HPUX 7.0 cc rejects these. */
3700 ++ccp;
3701 p = (char**) ccp;
3702 ccp = (char const *const *) p;
3703 { /* SCO 3.2v4 cc rejects this.  */
3704   char *t;
3705   char const *s = 0 ? (char *) 0 : (char const *) 0;
3706
3707   *t++ = 0;
3708 }
3709 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3710   int x[] = {25, 17};
3711   const int *foo = &x[0];
3712   ++foo;
3713 }
3714 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3715   typedef const int *iptr;
3716   iptr p = 0;
3717   ++p;
3718 }
3719 { /* AIX XL C 1.02.0.0 rejects this saying
3720      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3721   struct s { int j; const int *ap[3]; };
3722   struct s *b; b->j = 5;
3723 }
3724 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3725   const int foo = 10;
3726 }
3727
3728 ; return 0; }
3729 EOF
3730 if { (eval echo configure:3731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3731   rm -rf conftest*
3732   ac_cv_c_const=yes
3733 else
3734   echo "configure: failed program was:" >&5
3735   cat conftest.$ac_ext >&5
3736   rm -rf conftest*
3737   ac_cv_c_const=no
3738 fi
3739 rm -f conftest*
3740
3741 echo "$ac_t""$ac_cv_c_const" 1>&6
3742 if test $ac_cv_c_const = no; then
3743   { test "$extra_verbose" = "yes" && cat << \EOF
3744     Defining const = 
3745 EOF
3746 cat >> confdefs.h <<\EOF
3747 #define const 
3748 EOF
3749 }
3750
3751 fi
3752
3753
3754 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3755 echo "configure:3756: checking whether ${MAKE-make} sets \${MAKE}" >&5
3756 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3757
3758 cat > conftestmake <<\EOF
3759 all:
3760         @echo 'ac_maketemp="${MAKE}"'
3761 EOF
3762 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3763 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3764 if test -n "$ac_maketemp"; then
3765   eval ac_cv_prog_make_${ac_make}_set=yes
3766 else
3767   eval ac_cv_prog_make_${ac_make}_set=no
3768 fi
3769 rm -f conftestmake
3770 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3771   echo "$ac_t""yes" 1>&6
3772   SET_MAKE=
3773 else
3774   echo "$ac_t""no" 1>&6
3775   SET_MAKE="MAKE=${MAKE-make}"
3776 fi
3777
3778
3779 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3780 echo "configure:3781: checking whether byte ordering is bigendian" >&5
3781
3782 ac_cv_c_bigendian=unknown
3783 # See if sys/param.h defines the BYTE_ORDER macro.
3784 cat > conftest.$ac_ext <<EOF
3785 #line 3786 "configure"
3786 #include "confdefs.h"
3787 #include <sys/types.h>
3788 #include <sys/param.h>
3789 int main() {
3790
3791 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3792  bogus endian macros
3793 #endif
3794 ; return 0; }
3795 EOF
3796 if { (eval echo configure:3797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3797   rm -rf conftest*
3798   # It does; now see whether it defined to BIG_ENDIAN or not.
3799 cat > conftest.$ac_ext <<EOF
3800 #line 3801 "configure"
3801 #include "confdefs.h"
3802 #include <sys/types.h>
3803 #include <sys/param.h>
3804 int main() {
3805
3806 #if BYTE_ORDER != BIG_ENDIAN
3807  not big endian
3808 #endif
3809 ; return 0; }
3810 EOF
3811 if { (eval echo configure:3812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3812   rm -rf conftest*
3813   ac_cv_c_bigendian=yes
3814 else
3815   echo "configure: failed program was:" >&5
3816   cat conftest.$ac_ext >&5
3817   rm -rf conftest*
3818   ac_cv_c_bigendian=no
3819 fi
3820 rm -f conftest*
3821 else
3822   echo "configure: failed program was:" >&5
3823   cat conftest.$ac_ext >&5
3824 fi
3825 rm -f conftest*
3826 if test $ac_cv_c_bigendian = unknown; then
3827 cat > conftest.$ac_ext <<EOF
3828 #line 3829 "configure"
3829 #include "confdefs.h"
3830 main () {
3831   /* Are we little or big endian?  From Harbison&Steele.  */
3832   union
3833   {
3834     long l;
3835     char c[sizeof (long)];
3836   } u;
3837   u.l = 1;
3838   exit (u.c[sizeof (long) - 1] == 1);
3839 }
3840 EOF
3841 if { (eval echo configure:3842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3842 then
3843   ac_cv_c_bigendian=no
3844 else
3845   conftest_rc="$?"
3846   echo "configure: failed program was:" >&5
3847   cat conftest.$ac_ext >&5
3848   rm -fr conftest*
3849   ac_cv_c_bigendian=yes
3850 fi
3851 rm -fr conftest*
3852 fi
3853
3854 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3855 if test $ac_cv_c_bigendian = yes; then
3856   { test "$extra_verbose" = "yes" && cat << \EOF
3857     Defining WORDS_BIGENDIAN
3858 EOF
3859 cat >> confdefs.h <<\EOF
3860 #define WORDS_BIGENDIAN 1
3861 EOF
3862 }
3863
3864 fi
3865
3866
3867 echo $ac_n "checking size of short""... $ac_c" 1>&6
3868 echo "configure:3869: checking size of short" >&5
3869
3870 cat > conftest.$ac_ext <<EOF
3871 #line 3872 "configure"
3872 #include "confdefs.h"
3873 #include <stdio.h>
3874 main()
3875 {
3876   FILE *f=fopen("conftestval", "w");
3877   if (!f) exit(1);
3878   fprintf(f, "%d\n", sizeof(short));
3879   exit(0);
3880 }
3881 EOF
3882 if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3883 then
3884   ac_cv_sizeof_short=`cat conftestval`
3885 else
3886   conftest_rc="$?"
3887   echo "configure: failed program was:" >&5
3888   cat conftest.$ac_ext >&5
3889   rm -fr conftest*
3890   ac_cv_sizeof_short=0
3891 fi
3892 rm -fr conftest*
3893 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
3894 { test "$extra_verbose" = "yes" && cat << EOF
3895     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
3896 EOF
3897 cat >> confdefs.h <<EOF
3898 #define SIZEOF_SHORT $ac_cv_sizeof_short
3899 EOF
3900 }
3901
3902
3903 if test "$ac_cv_sizeof_short" = 0; then
3904   echo ""
3905   echo "*** PANIC *** Configure tests are not working - compiler is broken."
3906   echo "*** PANIC *** Please examine config.log for compilation errors."
3907   exit 1
3908 fi
3909 echo $ac_n "checking size of int""... $ac_c" 1>&6
3910 echo "configure:3911: checking size of int" >&5
3911
3912 cat > conftest.$ac_ext <<EOF
3913 #line 3914 "configure"
3914 #include "confdefs.h"
3915 #include <stdio.h>
3916 main()
3917 {
3918   FILE *f=fopen("conftestval", "w");
3919   if (!f) exit(1);
3920   fprintf(f, "%d\n", sizeof(int));
3921   exit(0);
3922 }
3923 EOF
3924 if { (eval echo configure:3925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3925 then
3926   ac_cv_sizeof_int=`cat conftestval`
3927 else
3928   conftest_rc="$?"
3929   echo "configure: failed program was:" >&5
3930   cat conftest.$ac_ext >&5
3931   rm -fr conftest*
3932   ac_cv_sizeof_int=0
3933 fi
3934 rm -fr conftest*
3935 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
3936 { test "$extra_verbose" = "yes" && cat << EOF
3937     Defining SIZEOF_INT = $ac_cv_sizeof_int
3938 EOF
3939 cat >> confdefs.h <<EOF
3940 #define SIZEOF_INT $ac_cv_sizeof_int
3941 EOF
3942 }
3943
3944
3945 echo $ac_n "checking size of long""... $ac_c" 1>&6
3946 echo "configure:3947: checking size of long" >&5
3947
3948 cat > conftest.$ac_ext <<EOF
3949 #line 3950 "configure"
3950 #include "confdefs.h"
3951 #include <stdio.h>
3952 main()
3953 {
3954   FILE *f=fopen("conftestval", "w");
3955   if (!f) exit(1);
3956   fprintf(f, "%d\n", sizeof(long));
3957   exit(0);
3958 }
3959 EOF
3960 if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3961 then
3962   ac_cv_sizeof_long=`cat conftestval`
3963 else
3964   conftest_rc="$?"
3965   echo "configure: failed program was:" >&5
3966   cat conftest.$ac_ext >&5
3967   rm -fr conftest*
3968   ac_cv_sizeof_long=0
3969 fi
3970 rm -fr conftest*
3971 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
3972 { test "$extra_verbose" = "yes" && cat << EOF
3973     Defining SIZEOF_LONG = $ac_cv_sizeof_long
3974 EOF
3975 cat >> confdefs.h <<EOF
3976 #define SIZEOF_LONG $ac_cv_sizeof_long
3977 EOF
3978 }
3979
3980
3981 echo $ac_n "checking size of long long""... $ac_c" 1>&6
3982 echo "configure:3983: checking size of long long" >&5
3983
3984 cat > conftest.$ac_ext <<EOF
3985 #line 3986 "configure"
3986 #include "confdefs.h"
3987 #include <stdio.h>
3988 main()
3989 {
3990   FILE *f=fopen("conftestval", "w");
3991   if (!f) exit(1);
3992   fprintf(f, "%d\n", sizeof(long long));
3993   exit(0);
3994 }
3995 EOF
3996 if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3997 then
3998   ac_cv_sizeof_long_long=`cat conftestval`
3999 else
4000   conftest_rc="$?"
4001   echo "configure: failed program was:" >&5
4002   cat conftest.$ac_ext >&5
4003   rm -fr conftest*
4004   ac_cv_sizeof_long_long=0
4005 fi
4006 rm -fr conftest*
4007 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4008 { test "$extra_verbose" = "yes" && cat << EOF
4009     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4010 EOF
4011 cat >> confdefs.h <<EOF
4012 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4013 EOF
4014 }
4015
4016
4017 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4018 echo "configure:4019: checking size of void *" >&5
4019
4020 cat > conftest.$ac_ext <<EOF
4021 #line 4022 "configure"
4022 #include "confdefs.h"
4023 #include <stdio.h>
4024 main()
4025 {
4026   FILE *f=fopen("conftestval", "w");
4027   if (!f) exit(1);
4028   fprintf(f, "%d\n", sizeof(void *));
4029   exit(0);
4030 }
4031 EOF
4032 if { (eval echo configure:4033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4033 then
4034   ac_cv_sizeof_void_p=`cat conftestval`
4035 else
4036   conftest_rc="$?"
4037   echo "configure: failed program was:" >&5
4038   cat conftest.$ac_ext >&5
4039   rm -fr conftest*
4040   ac_cv_sizeof_void_p=0
4041 fi
4042 rm -fr conftest*
4043 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4044 { test "$extra_verbose" = "yes" && cat << EOF
4045     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4046 EOF
4047 cat >> confdefs.h <<EOF
4048 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4049 EOF
4050 }
4051
4052
4053
4054 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4055 echo "configure:4056: checking for long file names" >&5
4056
4057 ac_cv_sys_long_file_names=yes
4058 # Test for long file names in all the places we know might matter:
4059 #      .                the current directory, where building will happen
4060 #      $prefix/lib      where we will be installing things
4061 #      $exec_prefix/lib likewise
4062 # eval it to expand exec_prefix.
4063 #      $TMPDIR          if set, where it might want to write temporary files
4064 # if $TMPDIR is not set:
4065 #      /tmp             where it might want to write temporary files
4066 #      /var/tmp         likewise
4067 #      /usr/tmp         likewise
4068 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4069   ac_tmpdirs="$TMPDIR"
4070 else
4071   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4072 fi
4073 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4074   test -d $ac_dir || continue
4075   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4076   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4077   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4078   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4079   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4080     ac_cv_sys_long_file_names=no
4081     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4082     break
4083   fi
4084   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4085 done
4086
4087 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4088 if test $ac_cv_sys_long_file_names = yes; then
4089   { test "$extra_verbose" = "yes" && cat << \EOF
4090     Defining HAVE_LONG_FILE_NAMES
4091 EOF
4092 cat >> confdefs.h <<\EOF
4093 #define HAVE_LONG_FILE_NAMES 1
4094 EOF
4095 }
4096
4097 fi
4098
4099
4100
4101 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4102 echo "configure:4103: checking for sin in -lm" >&5
4103 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4104
4105 xe_check_libs=" -lm "
4106 cat > conftest.$ac_ext <<EOF
4107 #line 4108 "configure"
4108 #include "confdefs.h"
4109 /* Override any gcc2 internal prototype to avoid an error.  */
4110 /* We use char because int might match the return type of a gcc2
4111     builtin and then its argument prototype would still apply.  */
4112 char sin();
4113
4114 int main() {
4115 sin()
4116 ; return 0; }
4117 EOF
4118 if { (eval echo configure:4119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4119   rm -rf conftest*
4120   eval "ac_cv_lib_$ac_lib_var=yes"
4121 else
4122   echo "configure: failed program was:" >&5
4123   cat conftest.$ac_ext >&5
4124   rm -rf conftest*
4125   eval "ac_cv_lib_$ac_lib_var=no"
4126 fi
4127 rm -f conftest*
4128 xe_check_libs=""
4129
4130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4131   echo "$ac_t""yes" 1>&6
4132     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4133     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4134   { test "$extra_verbose" = "yes" && cat << EOF
4135     Defining $ac_tr_lib
4136 EOF
4137 cat >> confdefs.h <<EOF
4138 #define $ac_tr_lib 1
4139 EOF
4140 }
4141
4142   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4143
4144 else
4145   echo "$ac_t""no" 1>&6
4146 fi
4147
4148
4149
4150 { test "$extra_verbose" = "yes" && cat << \EOF
4151     Defining LISP_FLOAT_TYPE
4152 EOF
4153 cat >> confdefs.h <<\EOF
4154 #define LISP_FLOAT_TYPE 1
4155 EOF
4156 }
4157
4158
4159 cat > conftest.$ac_ext <<EOF
4160 #line 4161 "configure"
4161 #include "confdefs.h"
4162 #include <math.h>
4163 int main() {
4164 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4165 ; return 0; }
4166 EOF
4167 if { (eval echo configure:4168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4168   rm -rf conftest*
4169   { test "$extra_verbose" = "yes" && cat << \EOF
4170     Defining HAVE_INVERSE_HYPERBOLIC
4171 EOF
4172 cat >> confdefs.h <<\EOF
4173 #define HAVE_INVERSE_HYPERBOLIC 1
4174 EOF
4175 }
4176
4177 else
4178   echo "configure: failed program was:" >&5
4179   cat conftest.$ac_ext >&5
4180 fi
4181 rm -f conftest*
4182
4183 echo "checking type of mail spool file locking" 1>&6
4184 echo "configure:4185: checking type of mail spool file locking" >&5
4185 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4186 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4187 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4188     Defining REAL_MAIL_USE_LOCKF
4189 EOF
4190 cat >> confdefs.h <<\EOF
4191 #define REAL_MAIL_USE_LOCKF 1
4192 EOF
4193 }
4194
4195 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4196     Defining REAL_MAIL_USE_FLOCK
4197 EOF
4198 cat >> confdefs.h <<\EOF
4199 #define REAL_MAIL_USE_FLOCK 1
4200 EOF
4201 }
4202
4203 else mail_locking="dot-locking"
4204 fi
4205
4206
4207 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
4208 echo "configure:4209: checking for kstat_open in -lkstat" >&5
4209 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
4210
4211 xe_check_libs=" -lkstat "
4212 cat > conftest.$ac_ext <<EOF
4213 #line 4214 "configure"
4214 #include "confdefs.h"
4215 /* Override any gcc2 internal prototype to avoid an error.  */
4216 /* We use char because int might match the return type of a gcc2
4217     builtin and then its argument prototype would still apply.  */
4218 char kstat_open();
4219
4220 int main() {
4221 kstat_open()
4222 ; return 0; }
4223 EOF
4224 if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4225   rm -rf conftest*
4226   eval "ac_cv_lib_$ac_lib_var=yes"
4227 else
4228   echo "configure: failed program was:" >&5
4229   cat conftest.$ac_ext >&5
4230   rm -rf conftest*
4231   eval "ac_cv_lib_$ac_lib_var=no"
4232 fi
4233 rm -f conftest*
4234 xe_check_libs=""
4235
4236 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4237   echo "$ac_t""yes" 1>&6
4238     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4239     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4240   { test "$extra_verbose" = "yes" && cat << EOF
4241     Defining $ac_tr_lib
4242 EOF
4243 cat >> confdefs.h <<EOF
4244 #define $ac_tr_lib 1
4245 EOF
4246 }
4247
4248   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
4249
4250 else
4251   echo "$ac_t""no" 1>&6
4252 fi
4253
4254
4255
4256
4257 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
4258 echo "configure:4259: checking for kvm_read in -lkvm" >&5
4259 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
4260
4261 xe_check_libs=" -lkvm "
4262 cat > conftest.$ac_ext <<EOF
4263 #line 4264 "configure"
4264 #include "confdefs.h"
4265 /* Override any gcc2 internal prototype to avoid an error.  */
4266 /* We use char because int might match the return type of a gcc2
4267     builtin and then its argument prototype would still apply.  */
4268 char kvm_read();
4269
4270 int main() {
4271 kvm_read()
4272 ; return 0; }
4273 EOF
4274 if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4275   rm -rf conftest*
4276   eval "ac_cv_lib_$ac_lib_var=yes"
4277 else
4278   echo "configure: failed program was:" >&5
4279   cat conftest.$ac_ext >&5
4280   rm -rf conftest*
4281   eval "ac_cv_lib_$ac_lib_var=no"
4282 fi
4283 rm -f conftest*
4284 xe_check_libs=""
4285
4286 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4287   echo "$ac_t""yes" 1>&6
4288     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4289     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4290   { test "$extra_verbose" = "yes" && cat << EOF
4291     Defining $ac_tr_lib
4292 EOF
4293 cat >> confdefs.h <<EOF
4294 #define $ac_tr_lib 1
4295 EOF
4296 }
4297
4298   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
4299
4300 else
4301   echo "$ac_t""no" 1>&6
4302 fi
4303
4304
4305
4306 case "$opsys" in decosf*)
4307   
4308 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4309 echo "configure:4310: checking for cma_open in -lpthreads" >&5
4310 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4311
4312 xe_check_libs=" -lpthreads "
4313 cat > conftest.$ac_ext <<EOF
4314 #line 4315 "configure"
4315 #include "confdefs.h"
4316 /* Override any gcc2 internal prototype to avoid an error.  */
4317 /* We use char because int might match the return type of a gcc2
4318     builtin and then its argument prototype would still apply.  */
4319 char cma_open();
4320
4321 int main() {
4322 cma_open()
4323 ; return 0; }
4324 EOF
4325 if { (eval echo configure:4326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4326   rm -rf conftest*
4327   eval "ac_cv_lib_$ac_lib_var=yes"
4328 else
4329   echo "configure: failed program was:" >&5
4330   cat conftest.$ac_ext >&5
4331   rm -rf conftest*
4332   eval "ac_cv_lib_$ac_lib_var=no"
4333 fi
4334 rm -f conftest*
4335 xe_check_libs=""
4336
4337 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4338   echo "$ac_t""yes" 1>&6
4339     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4340     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4341   { test "$extra_verbose" = "yes" && cat << EOF
4342     Defining $ac_tr_lib
4343 EOF
4344 cat >> confdefs.h <<EOF
4345 #define $ac_tr_lib 1
4346 EOF
4347 }
4348
4349   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4350
4351 else
4352   echo "$ac_t""no" 1>&6
4353 fi
4354
4355
4356   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4357     c_switch_site="$c_switch_site -threads" ;;
4358 esac
4359
4360 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4361 echo "configure:4362: checking whether the -xildoff compiler flag is required" >&5
4362 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4363   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4364     then echo "$ac_t""no" 1>&6;
4365     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
4366   fi
4367   else echo "$ac_t""no" 1>&6
4368 fi
4369
4370 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4371   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4372 echo "configure:4373: checking for \"-z ignore\" linker flag" >&5
4373   case "`ld -h 2>&1`" in
4374     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4375       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4376     *) echo "$ac_t""no" 1>&6 ;;
4377   esac
4378 fi
4379
4380
4381 echo "checking "for specified window system"" 1>&6
4382 echo "configure:4383: checking "for specified window system"" >&5
4383
4384 if test "$with_x11" != "no"; then
4385     test "$x_includes $x_libraries" != "NONE NONE" && \
4386    window_system=x11 with_x11=yes
4387
4388         
4389       if test "$x_includes $x_libraries" = "NONE NONE" \
4390     -a -n "$OPENWINHOME" \
4391     -a "$OPENWINHOME" != "/usr/openwin" \
4392     -a -d "$OPENWINHOME"; then
4393       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4394       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4395       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4396   fi
4397
4398   if test "$x_includes" = "NONE"; then
4399                     for dir in "/usr/X11" "/usr/X11R6"; do
4400       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4401     done
4402   fi
4403
4404   if test "$x_libraries" = "NONE"; then
4405     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4406       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4407     done
4408   fi
4409
4410   # If we find X, set shell vars x_includes and x_libraries to the
4411 # paths, otherwise set no_x=yes.
4412 # Uses ac_ vars as temps to allow command line to override cache and checks.
4413 # --without-x overrides everything else, but does not touch the cache.
4414 echo $ac_n "checking for X""... $ac_c" 1>&6
4415 echo "configure:4416: checking for X" >&5
4416
4417 # Check whether --with-x or --without-x was given.
4418 if test "${with_x+set}" = set; then
4419   withval="$with_x"
4420   :
4421 fi
4422
4423 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4424 if test "x$with_x" = xno; then
4425   # The user explicitly disabled X.
4426   have_x=disabled
4427 else
4428   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4429     # Both variables are already set.
4430     have_x=yes
4431   else
4432
4433 # One or both of the vars are not set, and there is no cached value.
4434 ac_x_includes=NO ac_x_libraries=NO
4435 rm -fr conftestdir
4436 if mkdir conftestdir; then
4437   cd conftestdir
4438   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4439   cat > Imakefile <<'EOF'
4440 acfindx:
4441         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4442 EOF
4443   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4444     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4445     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4446     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4447     for ac_extension in a so sl; do
4448       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4449         test -f $ac_im_libdir/libX11.$ac_extension; then
4450         ac_im_usrlibdir=$ac_im_libdir; break
4451       fi
4452     done
4453     # Screen out bogus values from the imake configuration.  They are
4454     # bogus both because they are the default anyway, and because
4455     # using them would break gcc on systems where it needs fixed includes.
4456     case "$ac_im_incroot" in
4457         /usr/include) ;;
4458         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4459     esac
4460     case "$ac_im_usrlibdir" in
4461         /usr/lib | /lib) ;;
4462         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4463     esac
4464   fi
4465   cd ..
4466   rm -fr conftestdir
4467 fi
4468
4469 if test "$ac_x_includes" = NO; then
4470   # Guess where to find include files, by looking for this one X11 .h file.
4471   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4472
4473   # First, try using that file with no special directory specified.
4474 cat > conftest.$ac_ext <<EOF
4475 #line 4476 "configure"
4476 #include "confdefs.h"
4477 #include <$x_direct_test_include>
4478 EOF
4479 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4480 { (eval echo configure:4481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4481 ac_err=`grep -v '^ *+' conftest.out`
4482 if test -z "$ac_err"; then
4483   rm -rf conftest*
4484   # We can compile using X headers with no special include directory.
4485 ac_x_includes=
4486 else
4487   echo "$ac_err" >&5
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490   rm -rf conftest*
4491   # Look for the header file in a standard set of common directories.
4492 # Check X11 before X11Rn because it is often a symlink to the current release.
4493   for ac_dir in               \
4494     /usr/X11/include          \
4495     /usr/X11R6/include        \
4496     /usr/X11R5/include        \
4497     /usr/X11R4/include        \
4498                               \
4499     /usr/include/X11          \
4500     /usr/include/X11R6        \
4501     /usr/include/X11R5        \
4502     /usr/include/X11R4        \
4503                               \
4504     /usr/local/X11/include    \
4505     /usr/local/X11R6/include  \
4506     /usr/local/X11R5/include  \
4507     /usr/local/X11R4/include  \
4508                               \
4509     /usr/local/include/X11    \
4510     /usr/local/include/X11R6  \
4511     /usr/local/include/X11R5  \
4512     /usr/local/include/X11R4  \
4513                               \
4514     /usr/X386/include         \
4515     /usr/x386/include         \
4516     /usr/XFree86/include/X11  \
4517                               \
4518     /usr/include              \
4519     /usr/local/include        \
4520     /usr/unsupported/include  \
4521     /usr/athena/include       \
4522     /usr/local/x11r5/include  \
4523     /usr/lpp/Xamples/include  \
4524                               \
4525     /usr/openwin/include      \
4526     /usr/openwin/share/include \
4527     ; \
4528   do
4529     if test -r "$ac_dir/$x_direct_test_include"; then
4530       ac_x_includes=$ac_dir
4531       break
4532     fi
4533   done
4534 fi
4535 rm -f conftest*
4536 fi # $ac_x_includes = NO
4537
4538 if test "$ac_x_libraries" = NO; then
4539   # Check for the libraries.
4540
4541   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4542   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4543
4544   # See if we find them without any special options.
4545   # Don't add to $LIBS permanently.
4546   ac_save_LIBS="$LIBS"
4547   LIBS="-l$x_direct_test_library $LIBS"
4548 cat > conftest.$ac_ext <<EOF
4549 #line 4550 "configure"
4550 #include "confdefs.h"
4551
4552 int main() {
4553 ${x_direct_test_function}()
4554 ; return 0; }
4555 EOF
4556 if { (eval echo configure:4557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4557   rm -rf conftest*
4558   LIBS="$ac_save_LIBS"
4559 # We can link X programs with no special library path.
4560 ac_x_libraries=
4561 else
4562   echo "configure: failed program was:" >&5
4563   cat conftest.$ac_ext >&5
4564   rm -rf conftest*
4565   LIBS="$ac_save_LIBS"
4566 # First see if replacing the include by lib works.
4567 # Check X11 before X11Rn because it is often a symlink to the current release.
4568 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4569     /usr/X11/lib          \
4570     /usr/X11R6/lib        \
4571     /usr/X11R5/lib        \
4572     /usr/X11R4/lib        \
4573                           \
4574     /usr/lib/X11          \
4575     /usr/lib/X11R6        \
4576     /usr/lib/X11R5        \
4577     /usr/lib/X11R4        \
4578                           \
4579     /usr/local/X11/lib    \
4580     /usr/local/X11R6/lib  \
4581     /usr/local/X11R5/lib  \
4582     /usr/local/X11R4/lib  \
4583                           \
4584     /usr/local/lib/X11    \
4585     /usr/local/lib/X11R6  \
4586     /usr/local/lib/X11R5  \
4587     /usr/local/lib/X11R4  \
4588                           \
4589     /usr/X386/lib         \
4590     /usr/x386/lib         \
4591     /usr/XFree86/lib/X11  \
4592                           \
4593     /usr/lib              \
4594     /usr/local/lib        \
4595     /usr/unsupported/lib  \
4596     /usr/athena/lib       \
4597     /usr/local/x11r5/lib  \
4598     /usr/lpp/Xamples/lib  \
4599     /lib/usr/lib/X11      \
4600                           \
4601     /usr/openwin/lib      \
4602     /usr/openwin/share/lib \
4603     ; \
4604 do
4605   for ac_extension in a so sl; do
4606     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4607       ac_x_libraries=$ac_dir
4608       break 2
4609     fi
4610   done
4611 done
4612 fi
4613 rm -f conftest*
4614 fi # $ac_x_libraries = NO
4615
4616 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4617   # Didn't find X anywhere.  Cache the known absence of X.
4618   ac_cv_have_x="have_x=no"
4619 else
4620   # Record where we found X for the cache.
4621   ac_cv_have_x="have_x=yes \
4622                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4623 fi
4624   fi
4625   eval "$ac_cv_have_x"
4626 fi # $with_x != no
4627
4628 if test "$have_x" != yes; then
4629   echo "$ac_t""$have_x" 1>&6
4630   no_x=yes
4631 else
4632   # If each of the values was on the command line, it overrides each guess.
4633   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4634   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4635   # Update the cache value to reflect the command line values.
4636   ac_cv_have_x="have_x=yes \
4637                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4638   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4639 fi
4640
4641 if test "$no_x" = yes; then
4642   # Not all programs may use this symbol, but it does not hurt to define it.
4643   { test "$extra_verbose" = "yes" && cat << \EOF
4644     Defining X_DISPLAY_MISSING
4645 EOF
4646 cat >> confdefs.h <<\EOF
4647 #define X_DISPLAY_MISSING 1
4648 EOF
4649 }
4650
4651   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4652 else
4653   if test -n "$x_includes"; then
4654     X_CFLAGS="$X_CFLAGS -I$x_includes"
4655   fi
4656
4657   # It would also be nice to do this for all -L options, not just this one.
4658   if test -n "$x_libraries"; then
4659     X_LIBS="$X_LIBS -L$x_libraries"
4660     # For Solaris; some versions of Sun CC require a space after -R and
4661     # others require no space.  Words are not sufficient . . . .
4662     case "`(uname -sr) 2>/dev/null`" in
4663     "SunOS 5"*)
4664       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4665 echo "configure:4666: checking whether -R must be followed by a space" >&5
4666       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4667       cat > conftest.$ac_ext <<EOF
4668 #line 4669 "configure"
4669 #include "confdefs.h"
4670
4671 int main() {
4672
4673 ; return 0; }
4674 EOF
4675 if { (eval echo configure:4676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4676   rm -rf conftest*
4677   ac_R_nospace=yes
4678 else
4679   echo "configure: failed program was:" >&5
4680   cat conftest.$ac_ext >&5
4681   rm -rf conftest*
4682   ac_R_nospace=no
4683 fi
4684 rm -f conftest*
4685       if test $ac_R_nospace = yes; then
4686         echo "$ac_t""no" 1>&6
4687         X_LIBS="$X_LIBS -R$x_libraries"
4688       else
4689         LIBS="$ac_xsave_LIBS -R $x_libraries"
4690         cat > conftest.$ac_ext <<EOF
4691 #line 4692 "configure"
4692 #include "confdefs.h"
4693
4694 int main() {
4695
4696 ; return 0; }
4697 EOF
4698 if { (eval echo configure:4699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4699   rm -rf conftest*
4700   ac_R_space=yes
4701 else
4702   echo "configure: failed program was:" >&5
4703   cat conftest.$ac_ext >&5
4704   rm -rf conftest*
4705   ac_R_space=no
4706 fi
4707 rm -f conftest*
4708         if test $ac_R_space = yes; then
4709           echo "$ac_t""yes" 1>&6
4710           X_LIBS="$X_LIBS -R $x_libraries"
4711         else
4712           echo "$ac_t""neither works" 1>&6
4713         fi
4714       fi
4715       LIBS="$ac_xsave_LIBS"
4716     esac
4717   fi
4718
4719   # Check for system-dependent libraries X programs must link with.
4720   # Do this before checking for the system-independent R6 libraries
4721   # (-lICE), since we may need -lsocket or whatever for X linking.
4722
4723   if test "$ISC" = yes; then
4724     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4725   else
4726     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4727     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4728     # the Alpha needs dnet_stub (dnet does not exist).
4729     if test "$with_dnet" = "no" ; then
4730 ac_cv_lib_dnet_dnet_ntoa=no
4731 else
4732
4733 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4734 echo "configure:4735: checking for dnet_ntoa in -ldnet" >&5
4735 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4736
4737 xe_check_libs=" -ldnet "
4738 cat > conftest.$ac_ext <<EOF
4739 #line 4740 "configure"
4740 #include "confdefs.h"
4741 /* Override any gcc2 internal prototype to avoid an error.  */
4742 /* We use char because int might match the return type of a gcc2
4743     builtin and then its argument prototype would still apply.  */
4744 char dnet_ntoa();
4745
4746 int main() {
4747 dnet_ntoa()
4748 ; return 0; }
4749 EOF
4750 if { (eval echo configure:4751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4751   rm -rf conftest*
4752   eval "ac_cv_lib_$ac_lib_var=yes"
4753 else
4754   echo "configure: failed program was:" >&5
4755   cat conftest.$ac_ext >&5
4756   rm -rf conftest*
4757   eval "ac_cv_lib_$ac_lib_var=no"
4758 fi
4759 rm -f conftest*
4760 xe_check_libs=""
4761
4762 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4763   echo "$ac_t""yes" 1>&6
4764   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4765 else
4766   echo "$ac_t""no" 1>&6
4767 fi
4768
4769 fi
4770
4771     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4772       
4773 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4774 echo "configure:4775: checking for dnet_ntoa in -ldnet_stub" >&5
4775 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4776
4777 xe_check_libs=" -ldnet_stub "
4778 cat > conftest.$ac_ext <<EOF
4779 #line 4780 "configure"
4780 #include "confdefs.h"
4781 /* Override any gcc2 internal prototype to avoid an error.  */
4782 /* We use char because int might match the return type of a gcc2
4783     builtin and then its argument prototype would still apply.  */
4784 char dnet_ntoa();
4785
4786 int main() {
4787 dnet_ntoa()
4788 ; return 0; }
4789 EOF
4790 if { (eval echo configure:4791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4791   rm -rf conftest*
4792   eval "ac_cv_lib_$ac_lib_var=yes"
4793 else
4794   echo "configure: failed program was:" >&5
4795   cat conftest.$ac_ext >&5
4796   rm -rf conftest*
4797   eval "ac_cv_lib_$ac_lib_var=no"
4798 fi
4799 rm -f conftest*
4800 xe_check_libs=""
4801
4802 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4803   echo "$ac_t""yes" 1>&6
4804   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4805 else
4806   echo "$ac_t""no" 1>&6
4807 fi
4808
4809
4810     fi
4811
4812     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4813     # to get the SysV transport functions.
4814     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4815     # needs -lnsl.
4816     # The nsl library prevents programs from opening the X display
4817     # on Irix 5.2, according to dickey@clark.net.
4818     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4819 echo "configure:4820: checking for gethostbyname" >&5
4820
4821 cat > conftest.$ac_ext <<EOF
4822 #line 4823 "configure"
4823 #include "confdefs.h"
4824 /* System header to define __stub macros and hopefully few prototypes,
4825     which can conflict with char gethostbyname(); below.  */
4826 #include <assert.h>
4827 /* Override any gcc2 internal prototype to avoid an error.  */
4828 /* We use char because int might match the return type of a gcc2
4829     builtin and then its argument prototype would still apply.  */
4830 char gethostbyname();
4831
4832 int main() {
4833
4834 /* The GNU C library defines this for functions which it implements
4835     to always fail with ENOSYS.  Some functions are actually named
4836     something starting with __ and the normal name is an alias.  */
4837 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4838 choke me
4839 #else
4840 gethostbyname();
4841 #endif
4842
4843 ; return 0; }
4844 EOF
4845 if { (eval echo configure:4846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4846   rm -rf conftest*
4847   eval "ac_cv_func_gethostbyname=yes"
4848 else
4849   echo "configure: failed program was:" >&5
4850   cat conftest.$ac_ext >&5
4851   rm -rf conftest*
4852   eval "ac_cv_func_gethostbyname=no"
4853 fi
4854 rm -f conftest*
4855
4856 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4857   echo "$ac_t""yes" 1>&6
4858   :
4859 else
4860   echo "$ac_t""no" 1>&6
4861 fi
4862
4863     if test $ac_cv_func_gethostbyname = no; then
4864       
4865 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4866 echo "configure:4867: checking for gethostbyname in -lnsl" >&5
4867 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4868
4869 xe_check_libs=" -lnsl "
4870 cat > conftest.$ac_ext <<EOF
4871 #line 4872 "configure"
4872 #include "confdefs.h"
4873 /* Override any gcc2 internal prototype to avoid an error.  */
4874 /* We use char because int might match the return type of a gcc2
4875     builtin and then its argument prototype would still apply.  */
4876 char gethostbyname();
4877
4878 int main() {
4879 gethostbyname()
4880 ; return 0; }
4881 EOF
4882 if { (eval echo configure:4883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4883   rm -rf conftest*
4884   eval "ac_cv_lib_$ac_lib_var=yes"
4885 else
4886   echo "configure: failed program was:" >&5
4887   cat conftest.$ac_ext >&5
4888   rm -rf conftest*
4889   eval "ac_cv_lib_$ac_lib_var=no"
4890 fi
4891 rm -f conftest*
4892 xe_check_libs=""
4893
4894 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4895   echo "$ac_t""yes" 1>&6
4896   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4897 else
4898   echo "$ac_t""no" 1>&6
4899 fi
4900
4901
4902     fi
4903
4904     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4905     # socket/setsockopt and other routines are undefined under SCO ODT
4906     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4907     # on later versions), says simon@lia.di.epfl.ch: it contains
4908     # gethostby* variants that don't use the nameserver (or something).
4909     # -lsocket must be given before -lnsl if both are needed.
4910     # We assume that if connect needs -lnsl, so does gethostbyname.
4911     echo $ac_n "checking for connect""... $ac_c" 1>&6
4912 echo "configure:4913: checking for connect" >&5
4913
4914 cat > conftest.$ac_ext <<EOF
4915 #line 4916 "configure"
4916 #include "confdefs.h"
4917 /* System header to define __stub macros and hopefully few prototypes,
4918     which can conflict with char connect(); below.  */
4919 #include <assert.h>
4920 /* Override any gcc2 internal prototype to avoid an error.  */
4921 /* We use char because int might match the return type of a gcc2
4922     builtin and then its argument prototype would still apply.  */
4923 char connect();
4924
4925 int main() {
4926
4927 /* The GNU C library defines this for functions which it implements
4928     to always fail with ENOSYS.  Some functions are actually named
4929     something starting with __ and the normal name is an alias.  */
4930 #if defined (__stub_connect) || defined (__stub___connect)
4931 choke me
4932 #else
4933 connect();
4934 #endif
4935
4936 ; return 0; }
4937 EOF
4938 if { (eval echo configure:4939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4939   rm -rf conftest*
4940   eval "ac_cv_func_connect=yes"
4941 else
4942   echo "configure: failed program was:" >&5
4943   cat conftest.$ac_ext >&5
4944   rm -rf conftest*
4945   eval "ac_cv_func_connect=no"
4946 fi
4947 rm -f conftest*
4948
4949 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4950   echo "$ac_t""yes" 1>&6
4951   :
4952 else
4953   echo "$ac_t""no" 1>&6
4954 fi
4955
4956     if test $ac_cv_func_connect = no; then
4957       
4958 xe_msg_checking="for connect in -lsocket"
4959 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
4960 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
4961 echo "configure:4962: checking "$xe_msg_checking"" >&5
4962 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
4963
4964 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
4965 cat > conftest.$ac_ext <<EOF
4966 #line 4967 "configure"
4967 #include "confdefs.h"
4968 /* Override any gcc2 internal prototype to avoid an error.  */
4969 /* We use char because int might match the return type of a gcc2
4970     builtin and then its argument prototype would still apply.  */
4971 char connect();
4972
4973 int main() {
4974 connect()
4975 ; return 0; }
4976 EOF
4977 if { (eval echo configure:4978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4978   rm -rf conftest*
4979   eval "ac_cv_lib_$ac_lib_var=yes"
4980 else
4981   echo "configure: failed program was:" >&5
4982   cat conftest.$ac_ext >&5
4983   rm -rf conftest*
4984   eval "ac_cv_lib_$ac_lib_var=no"
4985 fi
4986 rm -f conftest*
4987 xe_check_libs=""
4988
4989 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4990   echo "$ac_t""yes" 1>&6
4991   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
4992 else
4993   echo "$ac_t""no" 1>&6
4994 fi
4995
4996
4997     fi
4998
4999     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5000     echo $ac_n "checking for remove""... $ac_c" 1>&6
5001 echo "configure:5002: checking for remove" >&5
5002
5003 cat > conftest.$ac_ext <<EOF
5004 #line 5005 "configure"
5005 #include "confdefs.h"
5006 /* System header to define __stub macros and hopefully few prototypes,
5007     which can conflict with char remove(); below.  */
5008 #include <assert.h>
5009 /* Override any gcc2 internal prototype to avoid an error.  */
5010 /* We use char because int might match the return type of a gcc2
5011     builtin and then its argument prototype would still apply.  */
5012 char remove();
5013
5014 int main() {
5015
5016 /* The GNU C library defines this for functions which it implements
5017     to always fail with ENOSYS.  Some functions are actually named
5018     something starting with __ and the normal name is an alias.  */
5019 #if defined (__stub_remove) || defined (__stub___remove)
5020 choke me
5021 #else
5022 remove();
5023 #endif
5024
5025 ; return 0; }
5026 EOF
5027 if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5028   rm -rf conftest*
5029   eval "ac_cv_func_remove=yes"
5030 else
5031   echo "configure: failed program was:" >&5
5032   cat conftest.$ac_ext >&5
5033   rm -rf conftest*
5034   eval "ac_cv_func_remove=no"
5035 fi
5036 rm -f conftest*
5037
5038 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5039   echo "$ac_t""yes" 1>&6
5040   :
5041 else
5042   echo "$ac_t""no" 1>&6
5043 fi
5044
5045     if test $ac_cv_func_remove = no; then
5046       
5047 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5048 echo "configure:5049: checking for remove in -lposix" >&5
5049 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5050
5051 xe_check_libs=" -lposix "
5052 cat > conftest.$ac_ext <<EOF
5053 #line 5054 "configure"
5054 #include "confdefs.h"
5055 /* Override any gcc2 internal prototype to avoid an error.  */
5056 /* We use char because int might match the return type of a gcc2
5057     builtin and then its argument prototype would still apply.  */
5058 char remove();
5059
5060 int main() {
5061 remove()
5062 ; return 0; }
5063 EOF
5064 if { (eval echo configure:5065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5065   rm -rf conftest*
5066   eval "ac_cv_lib_$ac_lib_var=yes"
5067 else
5068   echo "configure: failed program was:" >&5
5069   cat conftest.$ac_ext >&5
5070   rm -rf conftest*
5071   eval "ac_cv_lib_$ac_lib_var=no"
5072 fi
5073 rm -f conftest*
5074 xe_check_libs=""
5075
5076 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5077   echo "$ac_t""yes" 1>&6
5078   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5079 else
5080   echo "$ac_t""no" 1>&6
5081 fi
5082
5083
5084     fi
5085
5086     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5087     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5088 echo "configure:5089: checking for shmat" >&5
5089
5090 cat > conftest.$ac_ext <<EOF
5091 #line 5092 "configure"
5092 #include "confdefs.h"
5093 /* System header to define __stub macros and hopefully few prototypes,
5094     which can conflict with char shmat(); below.  */
5095 #include <assert.h>
5096 /* Override any gcc2 internal prototype to avoid an error.  */
5097 /* We use char because int might match the return type of a gcc2
5098     builtin and then its argument prototype would still apply.  */
5099 char shmat();
5100
5101 int main() {
5102
5103 /* The GNU C library defines this for functions which it implements
5104     to always fail with ENOSYS.  Some functions are actually named
5105     something starting with __ and the normal name is an alias.  */
5106 #if defined (__stub_shmat) || defined (__stub___shmat)
5107 choke me
5108 #else
5109 shmat();
5110 #endif
5111
5112 ; return 0; }
5113 EOF
5114 if { (eval echo configure:5115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5115   rm -rf conftest*
5116   eval "ac_cv_func_shmat=yes"
5117 else
5118   echo "configure: failed program was:" >&5
5119   cat conftest.$ac_ext >&5
5120   rm -rf conftest*
5121   eval "ac_cv_func_shmat=no"
5122 fi
5123 rm -f conftest*
5124
5125 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5126   echo "$ac_t""yes" 1>&6
5127   :
5128 else
5129   echo "$ac_t""no" 1>&6
5130 fi
5131
5132     if test $ac_cv_func_shmat = no; then
5133       
5134 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5135 echo "configure:5136: checking for shmat in -lipc" >&5
5136 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5137
5138 xe_check_libs=" -lipc "
5139 cat > conftest.$ac_ext <<EOF
5140 #line 5141 "configure"
5141 #include "confdefs.h"
5142 /* Override any gcc2 internal prototype to avoid an error.  */
5143 /* We use char because int might match the return type of a gcc2
5144     builtin and then its argument prototype would still apply.  */
5145 char shmat();
5146
5147 int main() {
5148 shmat()
5149 ; return 0; }
5150 EOF
5151 if { (eval echo configure:5152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5152   rm -rf conftest*
5153   eval "ac_cv_lib_$ac_lib_var=yes"
5154 else
5155   echo "configure: failed program was:" >&5
5156   cat conftest.$ac_ext >&5
5157   rm -rf conftest*
5158   eval "ac_cv_lib_$ac_lib_var=no"
5159 fi
5160 rm -f conftest*
5161 xe_check_libs=""
5162
5163 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5164   echo "$ac_t""yes" 1>&6
5165   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5166 else
5167   echo "$ac_t""no" 1>&6
5168 fi
5169
5170
5171     fi
5172   fi
5173
5174   # Check for libraries that X11R6 Xt/Xaw programs need.
5175   ac_save_LDFLAGS="$LDFLAGS"
5176   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5177   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5178   # check for ICE first), but we must link in the order -lSM -lICE or
5179   # we get undefined symbols.  So assume we have SM if we have ICE.
5180   # These have to be linked with before -lX11, unlike the other
5181   # libraries we check for below, so use a different variable.
5182   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5183   
5184 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5185 echo "configure:5186: checking for IceConnectionNumber in -lICE" >&5
5186 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5187
5188 xe_check_libs=" -lICE "
5189 cat > conftest.$ac_ext <<EOF
5190 #line 5191 "configure"
5191 #include "confdefs.h"
5192 /* Override any gcc2 internal prototype to avoid an error.  */
5193 /* We use char because int might match the return type of a gcc2
5194     builtin and then its argument prototype would still apply.  */
5195 char IceConnectionNumber();
5196
5197 int main() {
5198 IceConnectionNumber()
5199 ; return 0; }
5200 EOF
5201 if { (eval echo configure:5202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5202   rm -rf conftest*
5203   eval "ac_cv_lib_$ac_lib_var=yes"
5204 else
5205   echo "configure: failed program was:" >&5
5206   cat conftest.$ac_ext >&5
5207   rm -rf conftest*
5208   eval "ac_cv_lib_$ac_lib_var=no"
5209 fi
5210 rm -f conftest*
5211 xe_check_libs=""
5212
5213 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5214   echo "$ac_t""yes" 1>&6
5215   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5216 else
5217   echo "$ac_t""no" 1>&6
5218 fi
5219
5220
5221   LDFLAGS="$ac_save_LDFLAGS"
5222
5223 fi
5224  # Autoconf claims to find X library and include dirs for us.
5225   if test "$no_x" = "yes"
5226   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5227   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5228   fi
5229 fi
5230
5231 case "$with_x11" in
5232   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5233   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5234 esac
5235
5236 if test "$with_x11" = "yes"; then
5237   { test "$extra_verbose" = "yes" && cat << \EOF
5238     Defining HAVE_X_WINDOWS
5239 EOF
5240 cat >> confdefs.h <<\EOF
5241 #define HAVE_X_WINDOWS 1
5242 EOF
5243 }
5244
5245   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5246   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5247
5248       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5249     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5250     if test -d "$lib_dir" -a -d "$inc_dir"; then
5251       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5252         x_libraries="$lib_dir $x_libraries"
5253         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5254       esac
5255       case "$x_includes" in "$inc_dir"* ) ;; *)
5256         x_includes="$inc_dir $x_includes"
5257         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5258       esac
5259       break;       fi
5260   done
5261
5262     for rel in "X11R6" "X11R5" "X11R4"; do
5263     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5264     if test -d "$lib_dir" -a -d "$inc_dir"; then
5265       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5266         x_libraries="$x_libraries $lib_dir"
5267         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5268       esac
5269       case "$x_includes" in "$inc_dir"* ) ;; *)
5270         x_includes="$x_includes $inc_dir"
5271         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5272       esac
5273       break;     fi
5274   done
5275
5276     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
5277
5278   ld_switch_x_site="$X_LIBS"
5279
5280   
5281 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5282     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5283   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5284   
5285         runpath="" runpath_dirs=""
5286   if test -n "$LD_RUN_PATH"; then
5287     runpath="$LD_RUN_PATH"
5288   elif test "$GCC" = "yes"; then
5289         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5290     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5291     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5292     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5293       case "$arg" in P,* | -L* | -R* )
5294         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5295           {
5296 xe_runpath_dir="$dir"
5297   test "$xe_runpath_dir" != "/lib"     -a \
5298         "$xe_runpath_dir" != "/usr/lib" -a \
5299         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5300   eval "$xe_add_unique_runpath_dir"
5301 }
5302         done ;;
5303       esac
5304     done
5305     ld_switch_run="$ld_switch_run_save"
5306     rm -f conftest*
5307   else
5308         for arg in $ld_switch_site $ld_switch_x_site; do
5309       case "$arg" in -L*) {
5310 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5311   test "$xe_runpath_dir" != "/lib"     -a \
5312         "$xe_runpath_dir" != "/usr/lib" -a \
5313         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5314   eval "$xe_add_unique_runpath_dir"
5315 };; esac
5316     done
5317         if test "$opsys $need_motif" = "sol2 yes"; then
5318       xe_runpath_dir="/opt/SUNWdt/lib";
5319       eval "$xe_add_unique_runpath_dir";
5320     fi
5321   fi 
5322   if test -n "$runpath"; then
5323     ld_switch_run="${dash_r}${runpath}"
5324     
5325 if test "$GCC" = "yes"; then
5326   set x $ld_switch_run; shift; ld_switch_run=""
5327   while test -n "$1"; do
5328     case $1 in
5329       -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5330       -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
5331       -Xlinker* ) ;;
5332       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5333     esac
5334     shift
5335   done
5336 fi
5337     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5338   fi
5339 fi
5340
5341
5342   if test "$extra_verbose" = "yes"; then
5343     echo; echo "X11 compilation variables:"
5344     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5345     echo
5346   fi
5347
5348             bitmapdirs=
5349   if test "$x_includes" != NONE; then
5350     for i in $x_includes; do
5351       if test -d "$i/bitmaps"; then
5352         bitmapdirs="$i/bitmaps:$bitmapdirs"
5353       fi
5354       if test -d "$i/X11/bitmaps"; then
5355         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5356       fi
5357     done
5358     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5359   fi
5360   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5361     Defining BITMAPDIR = "$bitmapdirs"
5362 EOF
5363 cat >> confdefs.h <<EOF
5364 #define BITMAPDIR "$bitmapdirs"
5365 EOF
5366 }
5367
5368
5369     echo "checking for X defines extracted by xmkmf" 1>&6
5370 echo "configure:5371: checking for X defines extracted by xmkmf" >&5
5371   rm -fr conftestdir
5372   if mkdir conftestdir; then
5373     cd conftestdir
5374     cat > Imakefile <<'EOF'
5375 xetest:
5376         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5377 EOF
5378     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5379       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5380       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5381     fi
5382     cd ..
5383     rm -fr conftestdir
5384     for word in $xmkmf_defines; do
5385       case "$word" in
5386         -D*=* ) ;;
5387         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5388               { test "$extra_verbose" = "yes" && cat << EOF
5389     Defining $word
5390 EOF
5391 cat >> confdefs.h <<EOF
5392 #define $word 1
5393 EOF
5394 }
5395  ;;
5396       esac
5397     done
5398   fi
5399
5400     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5401 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5402 echo "configure:5403: checking for X11/Intrinsic.h" >&5
5403
5404 cat > conftest.$ac_ext <<EOF
5405 #line 5406 "configure"
5406 #include "confdefs.h"
5407 #include <X11/Intrinsic.h>
5408 EOF
5409 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5410 { (eval echo configure:5411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5411 ac_err=`grep -v '^ *+' conftest.out`
5412 if test -z "$ac_err"; then
5413   rm -rf conftest*
5414   eval "ac_cv_header_$ac_safe=yes"
5415 else
5416   echo "$ac_err" >&5
5417   echo "configure: failed program was:" >&5
5418   cat conftest.$ac_ext >&5
5419   rm -rf conftest*
5420   eval "ac_cv_header_$ac_safe=no"
5421 fi
5422 rm -f conftest*
5423 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5424   echo "$ac_t""yes" 1>&6
5425   :
5426 else
5427   echo "$ac_t""no" 1>&6
5428 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5429 fi
5430
5431
5432       
5433 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5434 echo "configure:5435: checking for XOpenDisplay in -lX11" >&5
5435 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5436
5437 xe_check_libs=" -lX11 "
5438 cat > conftest.$ac_ext <<EOF
5439 #line 5440 "configure"
5440 #include "confdefs.h"
5441 /* Override any gcc2 internal prototype to avoid an error.  */
5442 /* We use char because int might match the return type of a gcc2
5443     builtin and then its argument prototype would still apply.  */
5444 char XOpenDisplay();
5445
5446 int main() {
5447 XOpenDisplay()
5448 ; return 0; }
5449 EOF
5450 if { (eval echo configure:5451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5451   rm -rf conftest*
5452   eval "ac_cv_lib_$ac_lib_var=yes"
5453 else
5454   echo "configure: failed program was:" >&5
5455   cat conftest.$ac_ext >&5
5456   rm -rf conftest*
5457   eval "ac_cv_lib_$ac_lib_var=no"
5458 fi
5459 rm -f conftest*
5460 xe_check_libs=""
5461
5462 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5463   echo "$ac_t""yes" 1>&6
5464   have_lib_x11=yes
5465 else
5466   echo "$ac_t""no" 1>&6
5467 fi
5468
5469
5470   if test "$have_lib_x11" != "yes"; then
5471     
5472 xe_msg_checking="for XGetFontProperty in -lX11"
5473 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5474 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5475 echo "configure:5476: checking "$xe_msg_checking"" >&5
5476 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5477
5478 xe_check_libs=" -lX11 -b i486-linuxaout"
5479 cat > conftest.$ac_ext <<EOF
5480 #line 5481 "configure"
5481 #include "confdefs.h"
5482 /* Override any gcc2 internal prototype to avoid an error.  */
5483 /* We use char because int might match the return type of a gcc2
5484     builtin and then its argument prototype would still apply.  */
5485 char XGetFontProperty();
5486
5487 int main() {
5488 XGetFontProperty()
5489 ; return 0; }
5490 EOF
5491 if { (eval echo configure:5492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5492   rm -rf conftest*
5493   eval "ac_cv_lib_$ac_lib_var=yes"
5494 else
5495   echo "configure: failed program was:" >&5
5496   cat conftest.$ac_ext >&5
5497   rm -rf conftest*
5498   eval "ac_cv_lib_$ac_lib_var=no"
5499 fi
5500 rm -f conftest*
5501 xe_check_libs=""
5502
5503 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5504   echo "$ac_t""yes" 1>&6
5505   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5506 else
5507   echo "$ac_t""no" 1>&6
5508 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5509 fi
5510
5511
5512   fi
5513   libs_x="-lX11"
5514   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5515
5516     
5517 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5518 echo "configure:5519: checking for XShapeSelectInput in -lXext" >&5
5519 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5520
5521 xe_check_libs=" -lXext "
5522 cat > conftest.$ac_ext <<EOF
5523 #line 5524 "configure"
5524 #include "confdefs.h"
5525 /* Override any gcc2 internal prototype to avoid an error.  */
5526 /* We use char because int might match the return type of a gcc2
5527     builtin and then its argument prototype would still apply.  */
5528 char XShapeSelectInput();
5529
5530 int main() {
5531 XShapeSelectInput()
5532 ; return 0; }
5533 EOF
5534 if { (eval echo configure:5535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5535   rm -rf conftest*
5536   eval "ac_cv_lib_$ac_lib_var=yes"
5537 else
5538   echo "configure: failed program was:" >&5
5539   cat conftest.$ac_ext >&5
5540   rm -rf conftest*
5541   eval "ac_cv_lib_$ac_lib_var=no"
5542 fi
5543 rm -f conftest*
5544 xe_check_libs=""
5545
5546 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5547   echo "$ac_t""yes" 1>&6
5548   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5549 else
5550   echo "$ac_t""no" 1>&6
5551 fi
5552
5553
5554
5555     
5556 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5557 echo "configure:5558: checking for XtOpenDisplay in -lXt" >&5
5558 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5559
5560 xe_check_libs=" -lXt "
5561 cat > conftest.$ac_ext <<EOF
5562 #line 5563 "configure"
5563 #include "confdefs.h"
5564 /* Override any gcc2 internal prototype to avoid an error.  */
5565 /* We use char because int might match the return type of a gcc2
5566     builtin and then its argument prototype would still apply.  */
5567 char XtOpenDisplay();
5568
5569 int main() {
5570 XtOpenDisplay()
5571 ; return 0; }
5572 EOF
5573 if { (eval echo configure:5574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5574   rm -rf conftest*
5575   eval "ac_cv_lib_$ac_lib_var=yes"
5576 else
5577   echo "configure: failed program was:" >&5
5578   cat conftest.$ac_ext >&5
5579   rm -rf conftest*
5580   eval "ac_cv_lib_$ac_lib_var=no"
5581 fi
5582 rm -f conftest*
5583 xe_check_libs=""
5584
5585 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5586   echo "$ac_t""yes" 1>&6
5587   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5588 else
5589   echo "$ac_t""no" 1>&6
5590 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5591 fi
5592
5593
5594
5595   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5596 echo "configure:5597: checking the version of X11 being used" >&5
5597   cat > conftest.$ac_ext <<EOF
5598 #line 5599 "configure"
5599 #include "confdefs.h"
5600 #include <X11/Intrinsic.h>
5601     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5602 EOF
5603 if { (eval echo configure:5604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5604 then
5605   ./conftest foobar; x11_release=$?
5606 else
5607   conftest_rc="$?"
5608   echo "configure: failed program was:" >&5
5609   cat conftest.$ac_ext >&5
5610   rm -fr conftest*
5611   x11_release=4
5612 fi
5613 rm -fr conftest*
5614   echo "$ac_t""R${x11_release}" 1>&6
5615   { test "$extra_verbose" = "yes" && cat << EOF
5616     Defining THIS_IS_X11R${x11_release}
5617 EOF
5618 cat >> confdefs.h <<EOF
5619 #define THIS_IS_X11R${x11_release} 1
5620 EOF
5621 }
5622
5623
5624   for ac_hdr in X11/Xlocale.h
5625 do
5626 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5627 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5628 echo "configure:5629: checking for $ac_hdr" >&5
5629
5630 cat > conftest.$ac_ext <<EOF
5631 #line 5632 "configure"
5632 #include "confdefs.h"
5633 #include <$ac_hdr>
5634 EOF
5635 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5636 { (eval echo configure:5637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5637 ac_err=`grep -v '^ *+' conftest.out`
5638 if test -z "$ac_err"; then
5639   rm -rf conftest*
5640   eval "ac_cv_header_$ac_safe=yes"
5641 else
5642   echo "$ac_err" >&5
5643   echo "configure: failed program was:" >&5
5644   cat conftest.$ac_ext >&5
5645   rm -rf conftest*
5646   eval "ac_cv_header_$ac_safe=no"
5647 fi
5648 rm -f conftest*
5649 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5650   echo "$ac_t""yes" 1>&6
5651     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5652   { test "$extra_verbose" = "yes" && cat << EOF
5653     Defining $ac_tr_hdr
5654 EOF
5655 cat >> confdefs.h <<EOF
5656 #define $ac_tr_hdr 1
5657 EOF
5658 }
5659  
5660 else
5661   echo "$ac_t""no" 1>&6
5662 fi
5663 done
5664
5665
5666     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5667 echo "configure:5668: checking for XFree86" >&5
5668   if test -d "/usr/X386/include" -o \
5669           -f "/etc/XF86Config"    -o \
5670           -f "/etc/X11/XF86Config" -o \
5671           -f "/usr/X11R6/lib/X11/XF86Config"; then
5672     echo "$ac_t""yes" 1>&6
5673     { test "$extra_verbose" = "yes" && cat << \EOF
5674     Defining HAVE_XFREE386
5675 EOF
5676 cat >> confdefs.h <<\EOF
5677 #define HAVE_XFREE386 1
5678 EOF
5679 }
5680
5681   else
5682     echo "$ac_t""no" 1>&6
5683   fi
5684
5685     test -z "$with_xmu" && { 
5686 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5687 echo "configure:5688: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5688 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5689
5690 xe_check_libs=" -lXmu "
5691 cat > conftest.$ac_ext <<EOF
5692 #line 5693 "configure"
5693 #include "confdefs.h"
5694 /* Override any gcc2 internal prototype to avoid an error.  */
5695 /* We use char because int might match the return type of a gcc2
5696     builtin and then its argument prototype would still apply.  */
5697 char XmuReadBitmapDataFromFile();
5698
5699 int main() {
5700 XmuReadBitmapDataFromFile()
5701 ; return 0; }
5702 EOF
5703 if { (eval echo configure:5704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5704   rm -rf conftest*
5705   eval "ac_cv_lib_$ac_lib_var=yes"
5706 else
5707   echo "configure: failed program was:" >&5
5708   cat conftest.$ac_ext >&5
5709   rm -rf conftest*
5710   eval "ac_cv_lib_$ac_lib_var=no"
5711 fi
5712 rm -f conftest*
5713 xe_check_libs=""
5714
5715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5716   echo "$ac_t""yes" 1>&6
5717   with_xmu=yes
5718 else
5719   echo "$ac_t""no" 1>&6
5720 with_xmu=no
5721 fi
5722
5723  }
5724   if test "$with_xmu" = "no"; then
5725     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5726    echo "    xemacs will be linked with \"xmu.o\""
5727  fi
5728   else
5729     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5730     { test "$extra_verbose" = "yes" && cat << \EOF
5731     Defining HAVE_XMU
5732 EOF
5733 cat >> confdefs.h <<\EOF
5734 #define HAVE_XMU 1
5735 EOF
5736 }
5737
5738   fi
5739
5740       
5741 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5742 echo "configure:5743: checking for main in -lXbsd" >&5
5743 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5744
5745 xe_check_libs=" -lXbsd "
5746 cat > conftest.$ac_ext <<EOF
5747 #line 5748 "configure"
5748 #include "confdefs.h"
5749
5750 int main() {
5751 main()
5752 ; return 0; }
5753 EOF
5754 if { (eval echo configure:5755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5755   rm -rf conftest*
5756   eval "ac_cv_lib_$ac_lib_var=yes"
5757 else
5758   echo "configure: failed program was:" >&5
5759   cat conftest.$ac_ext >&5
5760   rm -rf conftest*
5761   eval "ac_cv_lib_$ac_lib_var=no"
5762 fi
5763 rm -f conftest*
5764 xe_check_libs=""
5765
5766 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5767   echo "$ac_t""yes" 1>&6
5768   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5769 else
5770   echo "$ac_t""no" 1>&6
5771 fi
5772
5773
5774
5775     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5776         if test "$GCC" = "yes"; then
5777       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5778       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5779     else
5780       case "$CC" in
5781         "xlc" ) CC="xlc_r" ;;
5782         "xlC" ) CC="xlC_r" ;;
5783         "cc"  ) CC="cc_r" ;;
5784       esac
5785     fi
5786   fi
5787
5788 fi 
5789 if test "$with_msw" != "no"; then
5790   echo "checking for MS-Windows" 1>&6
5791 echo "configure:5792: checking for MS-Windows" >&5
5792   
5793 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5794 echo "configure:5795: checking for main in -lgdi32" >&5
5795 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5796
5797 xe_check_libs=" -lgdi32 "
5798 cat > conftest.$ac_ext <<EOF
5799 #line 5800 "configure"
5800 #include "confdefs.h"
5801
5802 int main() {
5803 main()
5804 ; return 0; }
5805 EOF
5806 if { (eval echo configure:5807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5807   rm -rf conftest*
5808   eval "ac_cv_lib_$ac_lib_var=yes"
5809 else
5810   echo "configure: failed program was:" >&5
5811   cat conftest.$ac_ext >&5
5812   rm -rf conftest*
5813   eval "ac_cv_lib_$ac_lib_var=no"
5814 fi
5815 rm -f conftest*
5816 xe_check_libs=""
5817
5818 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5819   echo "$ac_t""yes" 1>&6
5820   with_msw=yes
5821 else
5822   echo "$ac_t""no" 1>&6
5823 fi
5824
5825
5826   if test "$with_msw" = "yes"; then
5827     { test "$extra_verbose" = "yes" && cat << \EOF
5828     Defining HAVE_MS_WINDOWS
5829 EOF
5830 cat >> confdefs.h <<\EOF
5831 #define HAVE_MS_WINDOWS 1
5832 EOF
5833 }
5834
5835     install_pp="$blddir/lib-src/installexe.sh"
5836     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
5837     if test "$window_system" != x11; then
5838         window_system=msw
5839         test "$with_scrollbars" != "no" && with_scrollbars=msw \
5840             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5841    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5842  fi
5843         test "$with_menubars"   != "no" && with_menubars=msw \
5844             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5845    echo "    xemacs will be linked with \"menubar-msw.o\""
5846  fi
5847         test "$with_toolbars"   != "no" && with_toolbars=msw \
5848             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5849    echo "    xemacs will be linked with \"toolbar-msw.o\""
5850  fi
5851         test "$with_dialogs"   != "no" && with_dialogs=msw \
5852             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5853    echo "    xemacs will be linked with \"dialog-msw.o\""
5854  fi
5855     else
5856         test "$with_scrollbars"   != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5857    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5858  fi
5859         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5860    echo "    xemacs will be linked with \"menubar-msw.o\""
5861  fi
5862         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5863    echo "    xemacs will be linked with \"toolbar-msw.o\""
5864  fi
5865         test "$with_dialogs"   != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5866    echo "    xemacs will be linked with \"dialog-msw.o\""
5867  fi
5868     fi
5869         cat > conftest.$ac_ext <<EOF
5870 #line 5871 "configure"
5871 #include "confdefs.h"
5872 #include <fcntl.h>
5873     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
5874 EOF
5875 if { (eval echo configure:5876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5876 then
5877   { test "$extra_verbose" = "yes" && cat << \EOF
5878     Defining HAVE_MSG_SELECT
5879 EOF
5880 cat >> confdefs.h <<\EOF
5881 #define HAVE_MSG_SELECT 1
5882 EOF
5883 }
5884
5885 else
5886   conftest_rc="$?"
5887   echo "configure: failed program was:" >&5
5888   cat conftest.$ac_ext >&5
5889 fi
5890 rm -fr conftest*
5891     const_is_losing=no
5892     with_file_coding=yes
5893     use_minimal_tagbits=yes
5894     use_indexed_lrecord_implementation=yes
5895     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
5896    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\""
5897  fi
5898   fi
5899 fi
5900
5901
5902
5903 test -z "$window_system" && window_system="none"
5904
5905 if test "$window_system" = "none"; then
5906   for feature in menubars scrollbars toolbars dialogs dragndrop
5907   do
5908     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5909        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
5910     fi
5911     eval "with_${feature}=no"
5912   done
5913 else
5914   test -z "$with_toolbars" && with_toolbars=yes
5915 fi
5916
5917 if test "$with_msw" != "yes"; then
5918   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
5919   do
5920     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5921        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
5922     fi
5923     eval "with_${feature}=no"
5924   done
5925 else
5926   :
5927 fi
5928
5929 if test "$with_x11" != "yes"; then
5930             for feature in tooltalk cde offix session xim xmu \
5931                  xface
5932   do
5933     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5934        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
5935     fi
5936     eval "with_${feature}=no"
5937   done
5938 fi
5939
5940 bitmapdir=
5941
5942 case "$window_system" in
5943   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
5944   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
5945   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
5946 esac
5947
5948 case "$x_libraries" in *X11R4* )
5949   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
5950   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
5951 esac
5952
5953 echo "checking for session-management option" 1>&6
5954 echo "configure:5955: checking for session-management option" >&5;
5955 if test "$with_session" != "no"; then
5956   { test "$extra_verbose" = "yes" && cat << \EOF
5957     Defining HAVE_SESSION
5958 EOF
5959 cat >> confdefs.h <<\EOF
5960 #define HAVE_SESSION 1
5961 EOF
5962 }
5963
5964 fi
5965
5966 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
5967 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
5968 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
5969 echo "configure:5970: checking for X11/Xauth.h" >&5
5970
5971 cat > conftest.$ac_ext <<EOF
5972 #line 5973 "configure"
5973 #include "confdefs.h"
5974 #include <X11/Xauth.h>
5975 EOF
5976 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5977 { (eval echo configure:5978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5978 ac_err=`grep -v '^ *+' conftest.out`
5979 if test -z "$ac_err"; then
5980   rm -rf conftest*
5981   eval "ac_cv_header_$ac_safe=yes"
5982 else
5983   echo "$ac_err" >&5
5984   echo "configure: failed program was:" >&5
5985   cat conftest.$ac_ext >&5
5986   rm -rf conftest*
5987   eval "ac_cv_header_$ac_safe=no"
5988 fi
5989 rm -f conftest*
5990 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5991   echo "$ac_t""yes" 1>&6
5992   :
5993 else
5994   echo "$ac_t""no" 1>&6
5995 with_xauth=no
5996 fi
5997  }
5998 test -z "$with_xauth" && { 
5999 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6000 echo "configure:6001: checking for XauGetAuthByAddr in -lXau" >&5
6001 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6002
6003 xe_check_libs=" -lXau "
6004 cat > conftest.$ac_ext <<EOF
6005 #line 6006 "configure"
6006 #include "confdefs.h"
6007 /* Override any gcc2 internal prototype to avoid an error.  */
6008 /* We use char because int might match the return type of a gcc2
6009     builtin and then its argument prototype would still apply.  */
6010 char XauGetAuthByAddr();
6011
6012 int main() {
6013 XauGetAuthByAddr()
6014 ; return 0; }
6015 EOF
6016 if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6017   rm -rf conftest*
6018   eval "ac_cv_lib_$ac_lib_var=yes"
6019 else
6020   echo "configure: failed program was:" >&5
6021   cat conftest.$ac_ext >&5
6022   rm -rf conftest*
6023   eval "ac_cv_lib_$ac_lib_var=no"
6024 fi
6025 rm -f conftest*
6026 xe_check_libs=""
6027
6028 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6029   echo "$ac_t""yes" 1>&6
6030   :
6031 else
6032   echo "$ac_t""no" 1>&6
6033 with_xauth=no
6034 fi
6035
6036  }
6037 test -z "$with_xauth" && with_xauth=yes
6038 if test "$with_xauth" = "yes"; then
6039   { test "$extra_verbose" = "yes" && cat << \EOF
6040     Defining HAVE_XAUTH
6041 EOF
6042 cat >> confdefs.h <<\EOF
6043 #define HAVE_XAUTH 1
6044 EOF
6045 }
6046
6047   
6048 T=""
6049 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
6050 libs_xauth="$T"
6051
6052 fi
6053
6054
6055
6056
6057 if test "$with_tooltalk" != "no" ; then
6058       for dir in "" "Tt/" "desktop/" ; do
6059     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6060 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6061 echo "configure:6062: checking for ${dir}tt_c.h" >&5
6062
6063 cat > conftest.$ac_ext <<EOF
6064 #line 6065 "configure"
6065 #include "confdefs.h"
6066 #include <${dir}tt_c.h>
6067 EOF
6068 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6069 { (eval echo configure:6070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6070 ac_err=`grep -v '^ *+' conftest.out`
6071 if test -z "$ac_err"; then
6072   rm -rf conftest*
6073   eval "ac_cv_header_$ac_safe=yes"
6074 else
6075   echo "$ac_err" >&5
6076   echo "configure: failed program was:" >&5
6077   cat conftest.$ac_ext >&5
6078   rm -rf conftest*
6079   eval "ac_cv_header_$ac_safe=no"
6080 fi
6081 rm -f conftest*
6082 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6083   echo "$ac_t""yes" 1>&6
6084   tt_c_h_path="${dir}tt_c.h"; break
6085 else
6086   echo "$ac_t""no" 1>&6
6087 fi
6088
6089   done
6090   if test -z "$tt_c_h_path"; then
6091     if test "$with_tooltalk" = "yes"; then
6092       (echo "$progname: Usage error:"
6093 echo " " "Unable to find required tooltalk header files."
6094 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6095     fi
6096     with_tooltalk=no
6097   fi
6098 fi
6099 if test "$with_tooltalk" != "no" ; then
6100   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6101     
6102 xe_msg_checking="for tt_message_create in -ltt"
6103 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6104 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6105 echo "configure:6106: checking "$xe_msg_checking"" >&5
6106 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6107
6108 xe_check_libs=" -ltt $extra_libs"
6109 cat > conftest.$ac_ext <<EOF
6110 #line 6111 "configure"
6111 #include "confdefs.h"
6112 /* Override any gcc2 internal prototype to avoid an error.  */
6113 /* We use char because int might match the return type of a gcc2
6114     builtin and then its argument prototype would still apply.  */
6115 char tt_message_create();
6116
6117 int main() {
6118 tt_message_create()
6119 ; return 0; }
6120 EOF
6121 if { (eval echo configure:6122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6122   rm -rf conftest*
6123   eval "ac_cv_lib_$ac_lib_var=yes"
6124 else
6125   echo "configure: failed program was:" >&5
6126   cat conftest.$ac_ext >&5
6127   rm -rf conftest*
6128   eval "ac_cv_lib_$ac_lib_var=no"
6129 fi
6130 rm -f conftest*
6131 xe_check_libs=""
6132
6133 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6134   echo "$ac_t""yes" 1>&6
6135   tt_libs="-ltt $extra_libs"; break
6136 else
6137   echo "$ac_t""no" 1>&6
6138 :
6139 fi
6140
6141
6142   done
6143   if test -z "$tt_libs"; then
6144     if test "$with_tooltalk" = "yes"; then
6145       (echo "$progname: Usage error:"
6146 echo " " "Unable to find required tooltalk libraries."
6147 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6148     fi
6149     with_tooltalk=no
6150   fi
6151 fi
6152 test -z "$with_tooltalk" && with_tooltalk=yes
6153 if test "$with_tooltalk" = "yes"; then
6154   { test "$extra_verbose" = "yes" && cat << \EOF
6155     Defining TOOLTALK
6156 EOF
6157 cat >> confdefs.h <<\EOF
6158 #define TOOLTALK 1
6159 EOF
6160 }
6161
6162   { test "$extra_verbose" = "yes" && cat << EOF
6163     Defining TT_C_H_PATH = "$tt_c_h_path"
6164 EOF
6165 cat >> confdefs.h <<EOF
6166 #define TT_C_H_PATH "$tt_c_h_path"
6167 EOF
6168 }
6169
6170   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6171   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6172    echo "    xemacs will be linked with \"tooltalk.o\""
6173  fi
6174 fi
6175
6176 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6177 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6178 echo "configure:6179: checking for Dt/Dt.h" >&5
6179
6180 cat > conftest.$ac_ext <<EOF
6181 #line 6182 "configure"
6182 #include "confdefs.h"
6183 #include <Dt/Dt.h>
6184 EOF
6185 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6186 { (eval echo configure:6187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6187 ac_err=`grep -v '^ *+' conftest.out`
6188 if test -z "$ac_err"; then
6189   rm -rf conftest*
6190   eval "ac_cv_header_$ac_safe=yes"
6191 else
6192   echo "$ac_err" >&5
6193   echo "configure: failed program was:" >&5
6194   cat conftest.$ac_ext >&5
6195   rm -rf conftest*
6196   eval "ac_cv_header_$ac_safe=no"
6197 fi
6198 rm -f conftest*
6199 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6200   echo "$ac_t""yes" 1>&6
6201   :
6202 else
6203   echo "$ac_t""no" 1>&6
6204 with_cde=no
6205 fi
6206  }
6207 test -z "$with_cde" && { 
6208 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6209 echo "configure:6210: checking for DtDndDragStart in -lDtSvc" >&5
6210 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6211
6212 xe_check_libs=" -lDtSvc "
6213 cat > conftest.$ac_ext <<EOF
6214 #line 6215 "configure"
6215 #include "confdefs.h"
6216 /* Override any gcc2 internal prototype to avoid an error.  */
6217 /* We use char because int might match the return type of a gcc2
6218     builtin and then its argument prototype would still apply.  */
6219 char DtDndDragStart();
6220
6221 int main() {
6222 DtDndDragStart()
6223 ; return 0; }
6224 EOF
6225 if { (eval echo configure:6226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6226   rm -rf conftest*
6227   eval "ac_cv_lib_$ac_lib_var=yes"
6228 else
6229   echo "configure: failed program was:" >&5
6230   cat conftest.$ac_ext >&5
6231   rm -rf conftest*
6232   eval "ac_cv_lib_$ac_lib_var=no"
6233 fi
6234 rm -f conftest*
6235 xe_check_libs=""
6236
6237 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6238   echo "$ac_t""yes" 1>&6
6239   :
6240 else
6241   echo "$ac_t""no" 1>&6
6242 with_cde=no
6243 fi
6244
6245  }
6246 test -z "$with_cde" && with_cde=yes
6247 if test "$with_dragndrop" = no; then
6248   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6249   with_cde=no
6250 fi
6251 if test "$with_cde" = "yes" ; then
6252   { test "$extra_verbose" = "yes" && cat << \EOF
6253     Defining HAVE_CDE
6254 EOF
6255 cat >> confdefs.h <<\EOF
6256 #define HAVE_CDE 1
6257 EOF
6258 }
6259
6260   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6261   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6262   with_tooltalk=yes # CDE requires Tooltalk
6263   need_motif=yes    # CDE requires Motif
6264 fi
6265
6266 test "$window_system" != "x11" && with_offix=no
6267 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6268   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6269   with_offix=no
6270 fi
6271 if test "$with_dragndrop" = no; then
6272   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6273   with_offix=no
6274 fi
6275 if test "$with_cde" = yes; then
6276   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6277   with_offix=no
6278 fi
6279 test -z "$with_offix" && with_offix=no
6280 if test "$with_offix" = "yes"; then
6281   { test "$extra_verbose" = "yes" && cat << \EOF
6282     Defining HAVE_OFFIX_DND
6283 EOF
6284 cat >> confdefs.h <<\EOF
6285 #define HAVE_OFFIX_DND 1
6286 EOF
6287 }
6288
6289   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6290   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6291 fi
6292
6293 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6294 echo "configure:6295: checking if drag and drop API is needed" >&5
6295 if test "$with_dragndrop" != "no" ; then
6296   if test -n "$dragndrop_proto" ; then
6297     with_dragndrop=yes
6298     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6299     { test "$extra_verbose" = "yes" && cat << \EOF
6300     Defining HAVE_DRAGNDROP
6301 EOF
6302 cat >> confdefs.h <<\EOF
6303 #define HAVE_DRAGNDROP 1
6304 EOF
6305 }
6306
6307     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6308   else
6309     with_dragndrop=no
6310     echo "$ac_t""no" 1>&6
6311   fi
6312 fi
6313
6314 echo "checking for LDAP" 1>&6
6315 echo "configure:6316: checking for LDAP" >&5
6316 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6317 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6318 echo "configure:6319: checking for ldap.h" >&5
6319
6320 cat > conftest.$ac_ext <<EOF
6321 #line 6322 "configure"
6322 #include "confdefs.h"
6323 #include <ldap.h>
6324 EOF
6325 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6326 { (eval echo configure:6327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6327 ac_err=`grep -v '^ *+' conftest.out`
6328 if test -z "$ac_err"; then
6329   rm -rf conftest*
6330   eval "ac_cv_header_$ac_safe=yes"
6331 else
6332   echo "$ac_err" >&5
6333   echo "configure: failed program was:" >&5
6334   cat conftest.$ac_ext >&5
6335   rm -rf conftest*
6336   eval "ac_cv_header_$ac_safe=no"
6337 fi
6338 rm -f conftest*
6339 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6340   echo "$ac_t""yes" 1>&6
6341   :
6342 else
6343   echo "$ac_t""no" 1>&6
6344 with_ldap=no
6345 fi
6346  }
6347 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6348 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6349 echo "configure:6350: checking for lber.h" >&5
6350
6351 cat > conftest.$ac_ext <<EOF
6352 #line 6353 "configure"
6353 #include "confdefs.h"
6354 #include <lber.h>
6355 EOF
6356 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6357 { (eval echo configure:6358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6358 ac_err=`grep -v '^ *+' conftest.out`
6359 if test -z "$ac_err"; then
6360   rm -rf conftest*
6361   eval "ac_cv_header_$ac_safe=yes"
6362 else
6363   echo "$ac_err" >&5
6364   echo "configure: failed program was:" >&5
6365   cat conftest.$ac_ext >&5
6366   rm -rf conftest*
6367   eval "ac_cv_header_$ac_safe=no"
6368 fi
6369 rm -f conftest*
6370 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6371   echo "$ac_t""yes" 1>&6
6372   :
6373 else
6374   echo "$ac_t""no" 1>&6
6375 with_ldap=no
6376 fi
6377  }
6378 if test "$with_ldap" != "no"; then
6379   test -z "$with_umich_ldap" && { 
6380 xe_msg_checking="for ldap_open in -lldap"
6381 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6382 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6383 echo "configure:6384: checking "$xe_msg_checking"" >&5
6384 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6385
6386 xe_check_libs=" -lldap -llber"
6387 cat > conftest.$ac_ext <<EOF
6388 #line 6389 "configure"
6389 #include "confdefs.h"
6390 /* Override any gcc2 internal prototype to avoid an error.  */
6391 /* We use char because int might match the return type of a gcc2
6392     builtin and then its argument prototype would still apply.  */
6393 char ldap_open();
6394
6395 int main() {
6396 ldap_open()
6397 ; return 0; }
6398 EOF
6399 if { (eval echo configure:6400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6400   rm -rf conftest*
6401   eval "ac_cv_lib_$ac_lib_var=yes"
6402 else
6403   echo "configure: failed program was:" >&5
6404   cat conftest.$ac_ext >&5
6405   rm -rf conftest*
6406   eval "ac_cv_lib_$ac_lib_var=no"
6407 fi
6408 rm -f conftest*
6409 xe_check_libs=""
6410
6411 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6412   echo "$ac_t""yes" 1>&6
6413   with_umich_ldap=yes
6414 else
6415   echo "$ac_t""no" 1>&6
6416 with_umich_ldap=no
6417 fi
6418
6419  }
6420   test "$with_umich_ldap" = "no" && { 
6421 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6422 echo "configure:6423: checking for ldap_set_option in -lldap10" >&5
6423 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6424
6425 xe_check_libs=" -lldap10 "
6426 cat > conftest.$ac_ext <<EOF
6427 #line 6428 "configure"
6428 #include "confdefs.h"
6429 /* Override any gcc2 internal prototype to avoid an error.  */
6430 /* We use char because int might match the return type of a gcc2
6431     builtin and then its argument prototype would still apply.  */
6432 char ldap_set_option();
6433
6434 int main() {
6435 ldap_set_option()
6436 ; return 0; }
6437 EOF
6438 if { (eval echo configure:6439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6439   rm -rf conftest*
6440   eval "ac_cv_lib_$ac_lib_var=yes"
6441 else
6442   echo "configure: failed program was:" >&5
6443   cat conftest.$ac_ext >&5
6444   rm -rf conftest*
6445   eval "ac_cv_lib_$ac_lib_var=no"
6446 fi
6447 rm -f conftest*
6448 xe_check_libs=""
6449
6450 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6451   echo "$ac_t""yes" 1>&6
6452   with_ns_ldap=yes
6453 else
6454   echo "$ac_t""no" 1>&6
6455 with_ns_ldap=no
6456 fi
6457
6458  }
6459   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6460 fi
6461 if test "$with_ldap" = "yes"; then
6462   { test "$extra_verbose" = "yes" && cat << \EOF
6463     Defining HAVE_LDAP
6464 EOF
6465 cat >> confdefs.h <<\EOF
6466 #define HAVE_LDAP 1
6467 EOF
6468 }
6469
6470   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6471    echo "    xemacs will be linked with \"eldap.o\""
6472  fi
6473   if test "$with_umich_ldap" = "yes" ; then
6474     { test "$extra_verbose" = "yes" && cat << \EOF
6475     Defining HAVE_UMICH_LDAP
6476 EOF
6477 cat >> confdefs.h <<\EOF
6478 #define HAVE_UMICH_LDAP 1
6479 EOF
6480 }
6481
6482     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6483     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6484   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6485     { test "$extra_verbose" = "yes" && cat << \EOF
6486     Defining HAVE_NS_LDAP
6487 EOF
6488 cat >> confdefs.h <<\EOF
6489 #define HAVE_NS_LDAP 1
6490 EOF
6491 }
6492
6493     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6494   elif test "$with_ldap" = "yes" ; then
6495     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6496   fi
6497 fi
6498
6499
6500 if test "$window_system" != "none"; then
6501   echo "checking for graphics libraries" 1>&6
6502 echo "configure:6503: checking for graphics libraries" >&5
6503
6504     xpm_problem=""
6505   if test -z "$with_xpm"; then
6506     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6507 echo "configure:6508: checking for Xpm - no older than 3.4f" >&5
6508     xe_check_libs=-lXpm
6509     cat > conftest.$ac_ext <<EOF
6510 #line 6511 "configure"
6511 #include "confdefs.h"
6512 #include <X11/xpm.h>
6513     int main(int c, char **v) {
6514     return c == 1 ? 0 :
6515       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6516       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6517 EOF
6518 if { (eval echo configure:6519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6519 then
6520   ./conftest dummy_arg; xpm_status=$?;
6521       if test "$xpm_status" = "0"; then
6522         with_xpm=yes;
6523       else
6524         with_xpm=no;
6525         if test "$xpm_status" = "1"; then
6526           xpm_problem="Xpm library version and header file version don't match!"
6527         elif test "$xpm_status" = "2"; then
6528           xpm_problem="Xpm library version is too old!"
6529         else
6530           xpm_problem="Internal xpm detection logic error!"
6531         fi
6532         echo "
6533 *** WARNING *** $xpm_problem
6534   I'm not touching that with a 10-foot pole!
6535   If you really want to use the installed version of Xpm, rerun
6536   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6537     fi
6538 else
6539   conftest_rc="$?"
6540   echo "configure: failed program was:" >&5
6541   cat conftest.$ac_ext >&5
6542   rm -fr conftest*
6543   with_xpm=no
6544 fi
6545 rm -fr conftest*
6546     xe_check_libs=
6547     echo "$ac_t""$with_xpm" 1>&6
6548   fi
6549   if test "$with_xpm" = "yes"; then
6550     { test "$extra_verbose" = "yes" && cat << \EOF
6551     Defining HAVE_XPM
6552 EOF
6553 cat >> confdefs.h <<\EOF
6554 #define HAVE_XPM 1
6555 EOF
6556 }
6557
6558     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6559     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6560 echo "configure:6561: checking for \"FOR_MSW\" xpm" >&5
6561     xe_check_libs=-lXpm
6562     cat > conftest.$ac_ext <<EOF
6563 #line 6564 "configure"
6564 #include "confdefs.h"
6565
6566 int main() {
6567 XpmCreatePixmapFromData()
6568 ; return 0; }
6569 EOF
6570 if { (eval echo configure:6571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6571   rm -rf conftest*
6572   xpm_for_msw=no
6573 else
6574   echo "configure: failed program was:" >&5
6575   cat conftest.$ac_ext >&5
6576   rm -rf conftest*
6577   xpm_for_msw=yes
6578 fi
6579 rm -f conftest*
6580     xe_check_libs=
6581     echo "$ac_t""$xpm_for_msw" 1>&6
6582     if test "$xpm_for_msw" = "yes"; then
6583       { test "$extra_verbose" = "yes" && cat << \EOF
6584     Defining FOR_MSW
6585 EOF
6586 cat >> confdefs.h <<\EOF
6587 #define FOR_MSW 1
6588 EOF
6589 }
6590
6591     fi
6592   fi
6593
6594         if test "$with_gif" != "no"; then
6595     with_gif="yes"
6596     { test "$extra_verbose" = "yes" && cat << \EOF
6597     Defining HAVE_GIF
6598 EOF
6599 cat >> confdefs.h <<\EOF
6600 #define HAVE_GIF 1
6601 EOF
6602 }
6603
6604     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6605    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6606  fi
6607   fi
6608
6609       if test "$with_png $with_tiff" != "no no"; then
6610     
6611 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6612 echo "configure:6613: checking for inflate in -lc" >&5
6613 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6614
6615 xe_check_libs=" -lc "
6616 cat > conftest.$ac_ext <<EOF
6617 #line 6618 "configure"
6618 #include "confdefs.h"
6619 /* Override any gcc2 internal prototype to avoid an error.  */
6620 /* We use char because int might match the return type of a gcc2
6621     builtin and then its argument prototype would still apply.  */
6622 char inflate();
6623
6624 int main() {
6625 inflate()
6626 ; return 0; }
6627 EOF
6628 if { (eval echo configure:6629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6629   rm -rf conftest*
6630   eval "ac_cv_lib_$ac_lib_var=yes"
6631 else
6632   echo "configure: failed program was:" >&5
6633   cat conftest.$ac_ext >&5
6634   rm -rf conftest*
6635   eval "ac_cv_lib_$ac_lib_var=no"
6636 fi
6637 rm -f conftest*
6638 xe_check_libs=""
6639
6640 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6641   echo "$ac_t""yes" 1>&6
6642   :
6643 else
6644   echo "$ac_t""no" 1>&6
6645
6646 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6647 echo "configure:6648: checking for inflate in -lz" >&5
6648 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6649
6650 xe_check_libs=" -lz "
6651 cat > conftest.$ac_ext <<EOF
6652 #line 6653 "configure"
6653 #include "confdefs.h"
6654 /* Override any gcc2 internal prototype to avoid an error.  */
6655 /* We use char because int might match the return type of a gcc2
6656     builtin and then its argument prototype would still apply.  */
6657 char inflate();
6658
6659 int main() {
6660 inflate()
6661 ; return 0; }
6662 EOF
6663 if { (eval echo configure:6664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6664   rm -rf conftest*
6665   eval "ac_cv_lib_$ac_lib_var=yes"
6666 else
6667   echo "configure: failed program was:" >&5
6668   cat conftest.$ac_ext >&5
6669   rm -rf conftest*
6670   eval "ac_cv_lib_$ac_lib_var=no"
6671 fi
6672 rm -f conftest*
6673 xe_check_libs=""
6674
6675 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6676   echo "$ac_t""yes" 1>&6
6677   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6678 else
6679   echo "$ac_t""no" 1>&6
6680
6681 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6682 echo "configure:6683: checking for inflate in -lgz" >&5
6683 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6684
6685 xe_check_libs=" -lgz "
6686 cat > conftest.$ac_ext <<EOF
6687 #line 6688 "configure"
6688 #include "confdefs.h"
6689 /* Override any gcc2 internal prototype to avoid an error.  */
6690 /* We use char because int might match the return type of a gcc2
6691     builtin and then its argument prototype would still apply.  */
6692 char inflate();
6693
6694 int main() {
6695 inflate()
6696 ; return 0; }
6697 EOF
6698 if { (eval echo configure:6699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6699   rm -rf conftest*
6700   eval "ac_cv_lib_$ac_lib_var=yes"
6701 else
6702   echo "configure: failed program was:" >&5
6703   cat conftest.$ac_ext >&5
6704   rm -rf conftest*
6705   eval "ac_cv_lib_$ac_lib_var=no"
6706 fi
6707 rm -f conftest*
6708 xe_check_libs=""
6709
6710 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6711   echo "$ac_t""yes" 1>&6
6712   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6713 else
6714   echo "$ac_t""no" 1>&6
6715 fi
6716
6717
6718 fi
6719
6720
6721 fi
6722
6723
6724   fi
6725
6726     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6727 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6728 echo "configure:6729: checking for jpeglib.h" >&5
6729
6730 cat > conftest.$ac_ext <<EOF
6731 #line 6732 "configure"
6732 #include "confdefs.h"
6733 #include <jpeglib.h>
6734 EOF
6735 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6736 { (eval echo configure:6737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6737 ac_err=`grep -v '^ *+' conftest.out`
6738 if test -z "$ac_err"; then
6739   rm -rf conftest*
6740   eval "ac_cv_header_$ac_safe=yes"
6741 else
6742   echo "$ac_err" >&5
6743   echo "configure: failed program was:" >&5
6744   cat conftest.$ac_ext >&5
6745   rm -rf conftest*
6746   eval "ac_cv_header_$ac_safe=no"
6747 fi
6748 rm -f conftest*
6749 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6750   echo "$ac_t""yes" 1>&6
6751   :
6752 else
6753   echo "$ac_t""no" 1>&6
6754 with_jpeg=no
6755 fi
6756  }
6757   test -z "$with_jpeg" && { 
6758 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
6759 echo "configure:6760: checking for jpeg_destroy_decompress in -ljpeg" >&5
6760 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
6761
6762 xe_check_libs=" -ljpeg "
6763 cat > conftest.$ac_ext <<EOF
6764 #line 6765 "configure"
6765 #include "confdefs.h"
6766 /* Override any gcc2 internal prototype to avoid an error.  */
6767 /* We use char because int might match the return type of a gcc2
6768     builtin and then its argument prototype would still apply.  */
6769 char jpeg_destroy_decompress();
6770
6771 int main() {
6772 jpeg_destroy_decompress()
6773 ; return 0; }
6774 EOF
6775 if { (eval echo configure:6776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6776   rm -rf conftest*
6777   eval "ac_cv_lib_$ac_lib_var=yes"
6778 else
6779   echo "configure: failed program was:" >&5
6780   cat conftest.$ac_ext >&5
6781   rm -rf conftest*
6782   eval "ac_cv_lib_$ac_lib_var=no"
6783 fi
6784 rm -f conftest*
6785 xe_check_libs=""
6786
6787 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6788   echo "$ac_t""yes" 1>&6
6789   :
6790 else
6791   echo "$ac_t""no" 1>&6
6792 with_jpeg=no
6793 fi
6794
6795  }
6796   test -z "$with_jpeg" && with_jpeg=yes
6797   if test "$with_jpeg" = "yes"; then
6798     { test "$extra_verbose" = "yes" && cat << \EOF
6799     Defining HAVE_JPEG
6800 EOF
6801 cat >> confdefs.h <<\EOF
6802 #define HAVE_JPEG 1
6803 EOF
6804 }
6805
6806     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
6807   fi
6808
6809     png_problem=""
6810   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
6811 echo "configure:6812: checking for pow" >&5
6812
6813 cat > conftest.$ac_ext <<EOF
6814 #line 6815 "configure"
6815 #include "confdefs.h"
6816 /* System header to define __stub macros and hopefully few prototypes,
6817     which can conflict with char pow(); below.  */
6818 #include <assert.h>
6819 /* Override any gcc2 internal prototype to avoid an error.  */
6820 /* We use char because int might match the return type of a gcc2
6821     builtin and then its argument prototype would still apply.  */
6822 char pow();
6823
6824 int main() {
6825
6826 /* The GNU C library defines this for functions which it implements
6827     to always fail with ENOSYS.  Some functions are actually named
6828     something starting with __ and the normal name is an alias.  */
6829 #if defined (__stub_pow) || defined (__stub___pow)
6830 choke me
6831 #else
6832 pow();
6833 #endif
6834
6835 ; return 0; }
6836 EOF
6837 if { (eval echo configure:6838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6838   rm -rf conftest*
6839   eval "ac_cv_func_pow=yes"
6840 else
6841   echo "configure: failed program was:" >&5
6842   cat conftest.$ac_ext >&5
6843   rm -rf conftest*
6844   eval "ac_cv_func_pow=no"
6845 fi
6846 rm -f conftest*
6847
6848 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
6849   echo "$ac_t""yes" 1>&6
6850   :
6851 else
6852   echo "$ac_t""no" 1>&6
6853 with_png=no
6854 fi
6855  }
6856   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
6857 echo $ac_n "checking for png.h""... $ac_c" 1>&6
6858 echo "configure:6859: checking for png.h" >&5
6859
6860 cat > conftest.$ac_ext <<EOF
6861 #line 6862 "configure"
6862 #include "confdefs.h"
6863 #include <png.h>
6864 EOF
6865 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6866 { (eval echo configure:6867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6867 ac_err=`grep -v '^ *+' conftest.out`
6868 if test -z "$ac_err"; then
6869   rm -rf conftest*
6870   eval "ac_cv_header_$ac_safe=yes"
6871 else
6872   echo "$ac_err" >&5
6873   echo "configure: failed program was:" >&5
6874   cat conftest.$ac_ext >&5
6875   rm -rf conftest*
6876   eval "ac_cv_header_$ac_safe=no"
6877 fi
6878 rm -f conftest*
6879 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6880   echo "$ac_t""yes" 1>&6
6881   :
6882 else
6883   echo "$ac_t""no" 1>&6
6884 with_png=no
6885 fi
6886  }
6887   test -z "$with_png" && { 
6888 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
6889 echo "configure:6890: checking for png_read_image in -lpng" >&5
6890 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
6891
6892 xe_check_libs=" -lpng "
6893 cat > conftest.$ac_ext <<EOF
6894 #line 6895 "configure"
6895 #include "confdefs.h"
6896 /* Override any gcc2 internal prototype to avoid an error.  */
6897 /* We use char because int might match the return type of a gcc2
6898     builtin and then its argument prototype would still apply.  */
6899 char png_read_image();
6900
6901 int main() {
6902 png_read_image()
6903 ; return 0; }
6904 EOF
6905 if { (eval echo configure:6906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6906   rm -rf conftest*
6907   eval "ac_cv_lib_$ac_lib_var=yes"
6908 else
6909   echo "configure: failed program was:" >&5
6910   cat conftest.$ac_ext >&5
6911   rm -rf conftest*
6912   eval "ac_cv_lib_$ac_lib_var=no"
6913 fi
6914 rm -f conftest*
6915 xe_check_libs=""
6916
6917 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6918   echo "$ac_t""yes" 1>&6
6919   :
6920 else
6921   echo "$ac_t""no" 1>&6
6922 with_png=no
6923 fi
6924
6925  }
6926   if test -z "$with_png"; then
6927     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
6928 echo "configure:6929: checking for workable png version information" >&5
6929     xe_check_libs="-lpng -lz"
6930     cat > conftest.$ac_ext <<EOF
6931 #line 6932 "configure"
6932 #include "confdefs.h"
6933 #include <png.h>
6934     int main(int c, char **v) {
6935     if (c == 1) return 0;
6936     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
6937     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
6938 EOF
6939 if { (eval echo configure:6940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6940 then
6941   ./conftest dummy_arg; png_status=$?;
6942       if test "$png_status" = "0"; then
6943         with_png=yes;
6944       else
6945         with_png=no;
6946         if test "$png_status" = "1"; then
6947           png_problem="PNG library version and header file don't match!"
6948         elif test "$png_status" = "2"; then
6949           png_problem="PNG library version too old (pre 1.0.2)!"
6950         fi
6951         echo "
6952 *** WARNING *** $png_problem
6953   I'm not touching that with a 10-foot pole!
6954   If you really want to use the installed version of libPNG, rerun
6955   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
6956     fi
6957 else
6958   conftest_rc="$?"
6959   echo "configure: failed program was:" >&5
6960   cat conftest.$ac_ext >&5
6961   rm -fr conftest*
6962   with_png=no
6963 fi
6964 rm -fr conftest*
6965     xe_check_libs=
6966     echo "$ac_t""$with_png" 1>&6
6967   fi
6968   if test "$with_png" = "yes"; then
6969     { test "$extra_verbose" = "yes" && cat << \EOF
6970     Defining HAVE_PNG
6971 EOF
6972 cat >> confdefs.h <<\EOF
6973 #define HAVE_PNG 1
6974 EOF
6975 }
6976
6977     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
6978   fi
6979
6980     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
6981 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
6982 echo "configure:6983: checking for tiffio.h" >&5
6983
6984 cat > conftest.$ac_ext <<EOF
6985 #line 6986 "configure"
6986 #include "confdefs.h"
6987 #include <tiffio.h>
6988 EOF
6989 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6990 { (eval echo configure:6991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6991 ac_err=`grep -v '^ *+' conftest.out`
6992 if test -z "$ac_err"; then
6993   rm -rf conftest*
6994   eval "ac_cv_header_$ac_safe=yes"
6995 else
6996   echo "$ac_err" >&5
6997   echo "configure: failed program was:" >&5
6998   cat conftest.$ac_ext >&5
6999   rm -rf conftest*
7000   eval "ac_cv_header_$ac_safe=no"
7001 fi
7002 rm -f conftest*
7003 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7004   echo "$ac_t""yes" 1>&6
7005   :
7006 else
7007   echo "$ac_t""no" 1>&6
7008 with_tiff=no
7009 fi
7010  }
7011   test -z "$with_tiff" && { 
7012 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7013 echo "configure:7014: checking for TIFFClientOpen in -ltiff" >&5
7014 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7015
7016 xe_check_libs=" -ltiff "
7017 cat > conftest.$ac_ext <<EOF
7018 #line 7019 "configure"
7019 #include "confdefs.h"
7020 /* Override any gcc2 internal prototype to avoid an error.  */
7021 /* We use char because int might match the return type of a gcc2
7022     builtin and then its argument prototype would still apply.  */
7023 char TIFFClientOpen();
7024
7025 int main() {
7026 TIFFClientOpen()
7027 ; return 0; }
7028 EOF
7029 if { (eval echo configure:7030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7030   rm -rf conftest*
7031   eval "ac_cv_lib_$ac_lib_var=yes"
7032 else
7033   echo "configure: failed program was:" >&5
7034   cat conftest.$ac_ext >&5
7035   rm -rf conftest*
7036   eval "ac_cv_lib_$ac_lib_var=no"
7037 fi
7038 rm -f conftest*
7039 xe_check_libs=""
7040
7041 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7042   echo "$ac_t""yes" 1>&6
7043   :
7044 else
7045   echo "$ac_t""no" 1>&6
7046 with_tiff=no
7047 fi
7048
7049  }
7050   test -z "$with_tiff" && with_tiff=yes
7051   if test "$with_tiff" = "yes"; then
7052     { test "$extra_verbose" = "yes" && cat << \EOF
7053     Defining HAVE_TIFF
7054 EOF
7055 cat >> confdefs.h <<\EOF
7056 #define HAVE_TIFF 1
7057 EOF
7058 }
7059
7060     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7061   fi
7062 fi
7063
7064
7065 if test "$with_x11" = "yes"; then
7066
7067   echo "checking for X11 graphics libraries" 1>&6
7068 echo "configure:7069: checking for X11 graphics libraries" >&5
7069
7070     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
7071 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
7072 echo "configure:7073: checking for compface.h" >&5
7073
7074 cat > conftest.$ac_ext <<EOF
7075 #line 7076 "configure"
7076 #include "confdefs.h"
7077 #include <compface.h>
7078 EOF
7079 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7080 { (eval echo configure:7081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7081 ac_err=`grep -v '^ *+' conftest.out`
7082 if test -z "$ac_err"; then
7083   rm -rf conftest*
7084   eval "ac_cv_header_$ac_safe=yes"
7085 else
7086   echo "$ac_err" >&5
7087   echo "configure: failed program was:" >&5
7088   cat conftest.$ac_ext >&5
7089   rm -rf conftest*
7090   eval "ac_cv_header_$ac_safe=no"
7091 fi
7092 rm -f conftest*
7093 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7094   echo "$ac_t""yes" 1>&6
7095   :
7096 else
7097   echo "$ac_t""no" 1>&6
7098 with_xface=no
7099 fi
7100  }
7101   test -z "$with_xface" && { 
7102 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
7103 echo "configure:7104: checking for UnGenFace in -lcompface" >&5
7104 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
7105
7106 xe_check_libs=" -lcompface "
7107 cat > conftest.$ac_ext <<EOF
7108 #line 7109 "configure"
7109 #include "confdefs.h"
7110 /* Override any gcc2 internal prototype to avoid an error.  */
7111 /* We use char because int might match the return type of a gcc2
7112     builtin and then its argument prototype would still apply.  */
7113 char UnGenFace();
7114
7115 int main() {
7116 UnGenFace()
7117 ; return 0; }
7118 EOF
7119 if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7120   rm -rf conftest*
7121   eval "ac_cv_lib_$ac_lib_var=yes"
7122 else
7123   echo "configure: failed program was:" >&5
7124   cat conftest.$ac_ext >&5
7125   rm -rf conftest*
7126   eval "ac_cv_lib_$ac_lib_var=no"
7127 fi
7128 rm -f conftest*
7129 xe_check_libs=""
7130
7131 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7132   echo "$ac_t""yes" 1>&6
7133   : 
7134 else
7135   echo "$ac_t""no" 1>&6
7136 with_xface=no
7137 fi
7138
7139  }
7140   test -z "$with_xface" && with_xface=yes
7141   if test "$with_xface" = "yes"; then
7142     { test "$extra_verbose" = "yes" && cat << \EOF
7143     Defining HAVE_XFACE
7144 EOF
7145 cat >> confdefs.h <<\EOF
7146 #define HAVE_XFACE 1
7147 EOF
7148 }
7149
7150     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7151   fi
7152
7153     
7154 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7155 echo "configure:7156: checking for XawScrollbarSetThumb in -lXaw" >&5
7156 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7157
7158 xe_check_libs=" -lXaw "
7159 cat > conftest.$ac_ext <<EOF
7160 #line 7161 "configure"
7161 #include "confdefs.h"
7162 /* Override any gcc2 internal prototype to avoid an error.  */
7163 /* We use char because int might match the return type of a gcc2
7164     builtin and then its argument prototype would still apply.  */
7165 char XawScrollbarSetThumb();
7166
7167 int main() {
7168 XawScrollbarSetThumb()
7169 ; return 0; }
7170 EOF
7171 if { (eval echo configure:7172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7172   rm -rf conftest*
7173   eval "ac_cv_lib_$ac_lib_var=yes"
7174 else
7175   echo "configure: failed program was:" >&5
7176   cat conftest.$ac_ext >&5
7177   rm -rf conftest*
7178   eval "ac_cv_lib_$ac_lib_var=no"
7179 fi
7180 rm -f conftest*
7181 xe_check_libs=""
7182
7183 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7184   echo "$ac_t""yes" 1>&6
7185   have_xaw=yes
7186 else
7187   echo "$ac_t""no" 1>&6
7188 have_xaw=no
7189 fi
7190
7191
7192                     
7193     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7194 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7195 echo "configure:7196: checking for Xm/Xm.h" >&5
7196
7197 cat > conftest.$ac_ext <<EOF
7198 #line 7199 "configure"
7199 #include "confdefs.h"
7200 #include <Xm/Xm.h>
7201 EOF
7202 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7203 { (eval echo configure:7204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7204 ac_err=`grep -v '^ *+' conftest.out`
7205 if test -z "$ac_err"; then
7206   rm -rf conftest*
7207   eval "ac_cv_header_$ac_safe=yes"
7208 else
7209   echo "$ac_err" >&5
7210   echo "configure: failed program was:" >&5
7211   cat conftest.$ac_ext >&5
7212   rm -rf conftest*
7213   eval "ac_cv_header_$ac_safe=no"
7214 fi
7215 rm -f conftest*
7216 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7217   echo "$ac_t""yes" 1>&6
7218   
7219 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7220 echo "configure:7221: checking for XmStringFree in -lXm" >&5
7221 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7222
7223 xe_check_libs=" -lXm "
7224 cat > conftest.$ac_ext <<EOF
7225 #line 7226 "configure"
7226 #include "confdefs.h"
7227 /* Override any gcc2 internal prototype to avoid an error.  */
7228 /* We use char because int might match the return type of a gcc2
7229     builtin and then its argument prototype would still apply.  */
7230 char XmStringFree();
7231
7232 int main() {
7233 XmStringFree()
7234 ; return 0; }
7235 EOF
7236 if { (eval echo configure:7237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7237   rm -rf conftest*
7238   eval "ac_cv_lib_$ac_lib_var=yes"
7239 else
7240   echo "configure: failed program was:" >&5
7241   cat conftest.$ac_ext >&5
7242   rm -rf conftest*
7243   eval "ac_cv_lib_$ac_lib_var=no"
7244 fi
7245 rm -f conftest*
7246 xe_check_libs=""
7247
7248 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7249   echo "$ac_t""yes" 1>&6
7250   have_motif=yes
7251 else
7252   echo "$ac_t""no" 1>&6
7253 have_motif=no
7254 fi
7255
7256
7257 else
7258   echo "$ac_t""no" 1>&6
7259 have_motif=no
7260 fi
7261
7262
7263   if test "$have_motif" = "yes"; then
7264         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7265 echo "configure:7266: checking for Lesstif" >&5
7266     cat > conftest.$ac_ext <<EOF
7267 #line 7268 "configure"
7268 #include "confdefs.h"
7269 #include <Xm/Xm.h>
7270 #ifdef LESSTIF_VERSION
7271 yes
7272 #endif
7273
7274 EOF
7275 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7276   egrep "yes" >/dev/null 2>&1; then
7277   rm -rf conftest*
7278   have_lesstif=yes
7279 else
7280   rm -rf conftest*
7281   have_lesstif=no
7282 fi
7283 rm -f conftest*
7284
7285   echo "$ac_t""$have_lesstif" 1>&6
7286   fi
7287
7288 fi 
7289
7290 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7291   with_menubars="lucid" ;;
7292 esac
7293 case "$with_dialogs" in "" | "yes" | "lucid" )
7294   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7295   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7296   else with_dialogs=no
7297   fi ;;
7298 esac
7299 case "$with_scrollbars" in "" | "yes" )
7300   with_scrollbars="lucid" ;;
7301 esac
7302
7303 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7304
7305 case "$all_widgets" in *athena* )
7306   { test "$extra_verbose" = "yes" && cat << \EOF
7307     Defining LWLIB_USES_ATHENA
7308 EOF
7309 cat >> confdefs.h <<\EOF
7310 #define LWLIB_USES_ATHENA 1
7311 EOF
7312 }
7313
7314   { test "$extra_verbose" = "yes" && cat << \EOF
7315     Defining NEED_ATHENA
7316 EOF
7317 cat >> confdefs.h <<\EOF
7318 #define NEED_ATHENA 1
7319 EOF
7320 }
7321
7322   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7323   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7324 esac
7325
7326 case "$all_widgets" in *motif* )
7327   { test "$extra_verbose" = "yes" && cat << \EOF
7328     Defining LWLIB_USES_MOTIF
7329 EOF
7330 cat >> confdefs.h <<\EOF
7331 #define LWLIB_USES_MOTIF 1
7332 EOF
7333 }
7334
7335   { test "$extra_verbose" = "yes" && cat << \EOF
7336     Defining NEED_MOTIF
7337 EOF
7338 cat >> confdefs.h <<\EOF
7339 #define NEED_MOTIF 1
7340 EOF
7341 }
7342
7343   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7344   need_motif=yes ;;
7345 esac
7346
7347 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7348 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7349 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7350 case "$all_widgets" in *lucid* )
7351   { test "$extra_verbose" = "yes" && cat << \EOF
7352     Defining NEED_LUCID
7353 EOF
7354 cat >> confdefs.h <<\EOF
7355 #define NEED_LUCID 1
7356 EOF
7357 }
7358
7359   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7360 esac
7361
7362
7363
7364 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7365     Defining LWLIB_SCROLLBARS_ATHENA
7366 EOF
7367 cat >> confdefs.h <<\EOF
7368 #define LWLIB_SCROLLBARS_ATHENA 1
7369 EOF
7370 }
7371 ;; esac
7372 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7373     Defining LWLIB_DIALOGS_ATHENA
7374 EOF
7375 cat >> confdefs.h <<\EOF
7376 #define LWLIB_DIALOGS_ATHENA 1
7377 EOF
7378 }
7379    ;; esac
7380 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7381     Defining LWLIB_SCROLLBARS_ATHENA3D
7382 EOF
7383 cat >> confdefs.h <<\EOF
7384 #define LWLIB_SCROLLBARS_ATHENA3D 1
7385 EOF
7386 }
7387
7388 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7389     Defining LWLIB_DIALOGS_ATHENA3D
7390 EOF
7391 cat >> confdefs.h <<\EOF
7392 #define LWLIB_DIALOGS_ATHENA3D 1
7393 EOF
7394 }
7395
7396
7397 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7398     Defining HAVE_MENUBARS
7399 EOF
7400 cat >> confdefs.h <<\EOF
7401 #define HAVE_MENUBARS 1
7402 EOF
7403 }
7404
7405 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7406     Defining HAVE_SCROLLBARS
7407 EOF
7408 cat >> confdefs.h <<\EOF
7409 #define HAVE_SCROLLBARS 1
7410 EOF
7411 }
7412
7413 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7414     Defining HAVE_DIALOGS
7415 EOF
7416 cat >> confdefs.h <<\EOF
7417 #define HAVE_DIALOGS 1
7418 EOF
7419 }
7420
7421 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7422     Defining HAVE_TOOLBARS
7423 EOF
7424 cat >> confdefs.h <<\EOF
7425 #define HAVE_TOOLBARS 1
7426 EOF
7427 }
7428
7429
7430 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7431     Defining LWLIB_MENUBARS_LUCID
7432 EOF
7433 cat >> confdefs.h <<\EOF
7434 #define LWLIB_MENUBARS_LUCID 1
7435 EOF
7436 }
7437
7438 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7439     Defining LWLIB_SCROLLBARS_LUCID
7440 EOF
7441 cat >> confdefs.h <<\EOF
7442 #define LWLIB_SCROLLBARS_LUCID 1
7443 EOF
7444 }
7445
7446
7447 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7448     Defining LWLIB_MENUBARS_MOTIF
7449 EOF
7450 cat >> confdefs.h <<\EOF
7451 #define LWLIB_MENUBARS_MOTIF 1
7452 EOF
7453 }
7454
7455 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7456     Defining LWLIB_SCROLLBARS_MOTIF
7457 EOF
7458 cat >> confdefs.h <<\EOF
7459 #define LWLIB_SCROLLBARS_MOTIF 1
7460 EOF
7461 }
7462
7463 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7464     Defining LWLIB_DIALOGS_MOTIF
7465 EOF
7466 cat >> confdefs.h <<\EOF
7467 #define LWLIB_DIALOGS_MOTIF 1
7468 EOF
7469 }
7470
7471
7472 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7473    echo "    xemacs will be linked with \"menubar.o\""
7474  fi
7475 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7476    echo "    xemacs will be linked with \"scrollbar.o\""
7477  fi
7478 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7479    echo "    xemacs will be linked with \"dialog.o\""
7480  fi
7481 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7482    echo "    xemacs will be linked with \"toolbar.o\""
7483  fi
7484 test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" &&  if test "$extra_verbose" = "yes"; then
7485    echo "    xemacs will be linked with \"gui.o\""
7486  fi
7487
7488 if test "$with_x11" = "yes"; then
7489   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7490    echo "    xemacs will be linked with \"menubar-x.o\""
7491  fi
7492   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7493    echo "    xemacs will be linked with \"scrollbar-x.o\""
7494  fi
7495   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7496    echo "    xemacs will be linked with \"dialog-x.o\""
7497  fi
7498   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7499    echo "    xemacs will be linked with \"toolbar-x.o\""
7500  fi
7501   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7502    echo "    xemacs will be linked with \"gui-x.o\""
7503  fi
7504 else
7505   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7506     echo "Attempt to Build NAS sound without X"
7507     echo "Please remove NAS configuration or build with X"
7508     exit 1
7509   fi
7510 fi
7511
7512 test "$use_minimal_tagbits" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
7513     Defining USE_MINIMAL_TAGBITS
7514 EOF
7515 cat >> confdefs.h <<\EOF
7516 #define USE_MINIMAL_TAGBITS 1
7517 EOF
7518 }
7519
7520 test "$use_indexed_lrecord_implementation" = "yes" && \
7521   { test "$extra_verbose" = "yes" && cat << \EOF
7522     Defining USE_INDEXED_LRECORD_IMPLEMENTATION
7523 EOF
7524 cat >> confdefs.h <<\EOF
7525 #define USE_INDEXED_LRECORD_IMPLEMENTATION 1
7526 EOF
7527 }
7528
7529
7530
7531 test -z "$with_mule" && with_mule=no
7532 test -z "$with_file_coding" && with_file_coding=no
7533
7534
7535 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7536   { test "$extra_verbose" = "yes" && cat << \EOF
7537     Defining FILE_CODING
7538 EOF
7539 cat >> confdefs.h <<\EOF
7540 #define FILE_CODING 1
7541 EOF
7542 }
7543
7544   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7545    echo "    xemacs will be linked with \"file-coding.o\""
7546  fi
7547 fi
7548
7549 if test "$with_mule" = "yes" ; then
7550   echo "checking for Mule-related features" 1>&6
7551 echo "configure:7552: checking for Mule-related features" >&5
7552   { test "$extra_verbose" = "yes" && cat << \EOF
7553     Defining MULE
7554 EOF
7555 cat >> confdefs.h <<\EOF
7556 #define MULE 1
7557 EOF
7558 }
7559
7560   { test "$extra_verbose" = "yes" && cat << \EOF
7561     Defining FILE_CODING
7562 EOF
7563 cat >> confdefs.h <<\EOF
7564 #define FILE_CODING 1
7565 EOF
7566 }
7567
7568   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7569    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o\""
7570  fi
7571
7572     for ac_hdr in libintl.h
7573 do
7574 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7575 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7576 echo "configure:7577: checking for $ac_hdr" >&5
7577
7578 cat > conftest.$ac_ext <<EOF
7579 #line 7580 "configure"
7580 #include "confdefs.h"
7581 #include <$ac_hdr>
7582 EOF
7583 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7584 { (eval echo configure:7585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7585 ac_err=`grep -v '^ *+' conftest.out`
7586 if test -z "$ac_err"; then
7587   rm -rf conftest*
7588   eval "ac_cv_header_$ac_safe=yes"
7589 else
7590   echo "$ac_err" >&5
7591   echo "configure: failed program was:" >&5
7592   cat conftest.$ac_ext >&5
7593   rm -rf conftest*
7594   eval "ac_cv_header_$ac_safe=no"
7595 fi
7596 rm -f conftest*
7597 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7598   echo "$ac_t""yes" 1>&6
7599     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7600   { test "$extra_verbose" = "yes" && cat << EOF
7601     Defining $ac_tr_hdr
7602 EOF
7603 cat >> confdefs.h <<EOF
7604 #define $ac_tr_hdr 1
7605 EOF
7606 }
7607  
7608 else
7609   echo "$ac_t""no" 1>&6
7610 fi
7611 done
7612
7613   
7614 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7615 echo "configure:7616: checking for strerror in -lintl" >&5
7616 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7617
7618 xe_check_libs=" -lintl "
7619 cat > conftest.$ac_ext <<EOF
7620 #line 7621 "configure"
7621 #include "confdefs.h"
7622 /* Override any gcc2 internal prototype to avoid an error.  */
7623 /* We use char because int might match the return type of a gcc2
7624     builtin and then its argument prototype would still apply.  */
7625 char strerror();
7626
7627 int main() {
7628 strerror()
7629 ; return 0; }
7630 EOF
7631 if { (eval echo configure:7632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7632   rm -rf conftest*
7633   eval "ac_cv_lib_$ac_lib_var=yes"
7634 else
7635   echo "configure: failed program was:" >&5
7636   cat conftest.$ac_ext >&5
7637   rm -rf conftest*
7638   eval "ac_cv_lib_$ac_lib_var=no"
7639 fi
7640 rm -f conftest*
7641 xe_check_libs=""
7642
7643 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7644   echo "$ac_t""yes" 1>&6
7645     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7646     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7647   { test "$extra_verbose" = "yes" && cat << EOF
7648     Defining $ac_tr_lib
7649 EOF
7650 cat >> confdefs.h <<EOF
7651 #define $ac_tr_lib 1
7652 EOF
7653 }
7654
7655   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7656
7657 else
7658   echo "$ac_t""no" 1>&6
7659 fi
7660
7661
7662
7663   echo "checking for Mule input methods" 1>&6
7664 echo "configure:7665: checking for Mule input methods" >&5
7665         case "$with_xim" in "" | "yes" )
7666     echo "checking for XIM" 1>&6
7667 echo "configure:7668: checking for XIM" >&5
7668         if test "$have_lesstif" = "yes"; then with_xim=xlib
7669     else 
7670 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7671 echo "configure:7672: checking for XmImMbLookupString in -lXm" >&5
7672 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7673
7674 xe_check_libs=" -lXm "
7675 cat > conftest.$ac_ext <<EOF
7676 #line 7677 "configure"
7677 #include "confdefs.h"
7678 /* Override any gcc2 internal prototype to avoid an error.  */
7679 /* We use char because int might match the return type of a gcc2
7680     builtin and then its argument prototype would still apply.  */
7681 char XmImMbLookupString();
7682
7683 int main() {
7684 XmImMbLookupString()
7685 ; return 0; }
7686 EOF
7687 if { (eval echo configure:7688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7688   rm -rf conftest*
7689   eval "ac_cv_lib_$ac_lib_var=yes"
7690 else
7691   echo "configure: failed program was:" >&5
7692   cat conftest.$ac_ext >&5
7693   rm -rf conftest*
7694   eval "ac_cv_lib_$ac_lib_var=no"
7695 fi
7696 rm -f conftest*
7697 xe_check_libs=""
7698
7699 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7700   echo "$ac_t""yes" 1>&6
7701   with_xim=motif
7702 else
7703   echo "$ac_t""no" 1>&6
7704 with_xim=xlib
7705 fi
7706
7707
7708     fi
7709   esac
7710   if test "$with_xim" != "no"; then
7711     { test "$extra_verbose" = "yes" && cat << \EOF
7712     Defining HAVE_XIM
7713 EOF
7714 cat >> confdefs.h <<\EOF
7715 #define HAVE_XIM 1
7716 EOF
7717 }
7718
7719     if test "$with_xim" = "xlib"; then
7720       { test "$extra_verbose" = "yes" && cat << \EOF
7721     Defining XIM_XLIB
7722 EOF
7723 cat >> confdefs.h <<\EOF
7724 #define XIM_XLIB 1
7725 EOF
7726 }
7727
7728       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7729    echo "    xemacs will be linked with \"input-method-xlib.o\""
7730  fi
7731     fi
7732     if test "$with_xim" = "motif"; then
7733       { test "$extra_verbose" = "yes" && cat << \EOF
7734     Defining XIM_MOTIF
7735 EOF
7736 cat >> confdefs.h <<\EOF
7737 #define XIM_MOTIF 1
7738 EOF
7739 }
7740
7741       need_motif=yes
7742       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7743    echo "    xemacs will be linked with \"input-method-motif.o\""
7744  fi
7745     fi
7746     if test "$with_xim" = "motif"; then
7747       with_xfs=no
7748     fi
7749   fi
7750
7751     if test "$with_xfs" = "yes" ; then
7752     echo "checking for XFontSet" 1>&6
7753 echo "configure:7754: checking for XFontSet" >&5
7754     
7755 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7756 echo "configure:7757: checking for XmbDrawString in -lX11" >&5
7757 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7758
7759 xe_check_libs=" -lX11 "
7760 cat > conftest.$ac_ext <<EOF
7761 #line 7762 "configure"
7762 #include "confdefs.h"
7763 /* Override any gcc2 internal prototype to avoid an error.  */
7764 /* We use char because int might match the return type of a gcc2
7765     builtin and then its argument prototype would still apply.  */
7766 char XmbDrawString();
7767
7768 int main() {
7769 XmbDrawString()
7770 ; return 0; }
7771 EOF
7772 if { (eval echo configure:7773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7773   rm -rf conftest*
7774   eval "ac_cv_lib_$ac_lib_var=yes"
7775 else
7776   echo "configure: failed program was:" >&5
7777   cat conftest.$ac_ext >&5
7778   rm -rf conftest*
7779   eval "ac_cv_lib_$ac_lib_var=no"
7780 fi
7781 rm -f conftest*
7782 xe_check_libs=""
7783
7784 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7785   echo "$ac_t""yes" 1>&6
7786   :
7787 else
7788   echo "$ac_t""no" 1>&6
7789 with_xfs=no
7790 fi
7791
7792
7793     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7794       { test "$extra_verbose" = "yes" && cat << \EOF
7795     Defining USE_XFONTSET
7796 EOF
7797 cat >> confdefs.h <<\EOF
7798 #define USE_XFONTSET 1
7799 EOF
7800 }
7801
7802       if test "$with_xim" = "no" ; then
7803         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
7804    echo "    xemacs will be linked with \"input-method-xfs.o\""
7805  fi
7806       fi
7807     fi
7808   fi 
7809     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
7810   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
7811 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
7812 echo "configure:7813: checking for wnn/jllib.h" >&5
7813
7814 cat > conftest.$ac_ext <<EOF
7815 #line 7816 "configure"
7816 #include "confdefs.h"
7817 #include <wnn/jllib.h>
7818 EOF
7819 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7820 { (eval echo configure:7821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7821 ac_err=`grep -v '^ *+' conftest.out`
7822 if test -z "$ac_err"; then
7823   rm -rf conftest*
7824   eval "ac_cv_header_$ac_safe=yes"
7825 else
7826   echo "$ac_err" >&5
7827   echo "configure: failed program was:" >&5
7828   cat conftest.$ac_ext >&5
7829   rm -rf conftest*
7830   eval "ac_cv_header_$ac_safe=no"
7831 fi
7832 rm -f conftest*
7833 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7834   echo "$ac_t""yes" 1>&6
7835   :
7836 else
7837   echo "$ac_t""no" 1>&6
7838 with_wnn=no
7839 fi
7840  }
7841     if test "$with_wnn" != "no"; then
7842     for ac_func in crypt
7843 do
7844 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7845 echo "configure:7846: checking for $ac_func" >&5
7846
7847 cat > conftest.$ac_ext <<EOF
7848 #line 7849 "configure"
7849 #include "confdefs.h"
7850 /* System header to define __stub macros and hopefully few prototypes,
7851     which can conflict with char $ac_func(); below.  */
7852 #include <assert.h>
7853 /* Override any gcc2 internal prototype to avoid an error.  */
7854 /* We use char because int might match the return type of a gcc2
7855     builtin and then its argument prototype would still apply.  */
7856 char $ac_func();
7857
7858 int main() {
7859
7860 /* The GNU C library defines this for functions which it implements
7861     to always fail with ENOSYS.  Some functions are actually named
7862     something starting with __ and the normal name is an alias.  */
7863 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7864 choke me
7865 #else
7866 $ac_func();
7867 #endif
7868
7869 ; return 0; }
7870 EOF
7871 if { (eval echo configure:7872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7872   rm -rf conftest*
7873   eval "ac_cv_func_$ac_func=yes"
7874 else
7875   echo "configure: failed program was:" >&5
7876   cat conftest.$ac_ext >&5
7877   rm -rf conftest*
7878   eval "ac_cv_func_$ac_func=no"
7879 fi
7880 rm -f conftest*
7881
7882 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7883   echo "$ac_t""yes" 1>&6
7884     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7885   { test "$extra_verbose" = "yes" && cat << EOF
7886     Defining $ac_tr_func
7887 EOF
7888 cat >> confdefs.h <<EOF
7889 #define $ac_tr_func 1
7890 EOF
7891 }
7892  
7893 else
7894   echo "$ac_t""no" 1>&6
7895 fi
7896 done
7897
7898     test "$ac_cv_func_crypt" != "yes" && { 
7899 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7900 echo "configure:7901: checking for crypt in -lcrypt" >&5
7901 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7902
7903 xe_check_libs=" -lcrypt "
7904 cat > conftest.$ac_ext <<EOF
7905 #line 7906 "configure"
7906 #include "confdefs.h"
7907 /* Override any gcc2 internal prototype to avoid an error.  */
7908 /* We use char because int might match the return type of a gcc2
7909     builtin and then its argument prototype would still apply.  */
7910 char crypt();
7911
7912 int main() {
7913 crypt()
7914 ; return 0; }
7915 EOF
7916 if { (eval echo configure:7917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7917   rm -rf conftest*
7918   eval "ac_cv_lib_$ac_lib_var=yes"
7919 else
7920   echo "configure: failed program was:" >&5
7921   cat conftest.$ac_ext >&5
7922   rm -rf conftest*
7923   eval "ac_cv_lib_$ac_lib_var=no"
7924 fi
7925 rm -f conftest*
7926 xe_check_libs=""
7927
7928 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7929   echo "$ac_t""yes" 1>&6
7930     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7931     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7932   { test "$extra_verbose" = "yes" && cat << EOF
7933     Defining $ac_tr_lib
7934 EOF
7935 cat >> confdefs.h <<EOF
7936 #define $ac_tr_lib 1
7937 EOF
7938 }
7939
7940   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
7941
7942 else
7943   echo "$ac_t""no" 1>&6
7944 fi
7945
7946  }
7947   fi
7948     test -z "$with_wnn" && { 
7949 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
7950 echo "configure:7951: checking for jl_dic_list_e in -lwnn" >&5
7951 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7952
7953 xe_check_libs=" -lwnn "
7954 cat > conftest.$ac_ext <<EOF
7955 #line 7956 "configure"
7956 #include "confdefs.h"
7957 /* Override any gcc2 internal prototype to avoid an error.  */
7958 /* We use char because int might match the return type of a gcc2
7959     builtin and then its argument prototype would still apply.  */
7960 char jl_dic_list_e();
7961
7962 int main() {
7963 jl_dic_list_e()
7964 ; return 0; }
7965 EOF
7966 if { (eval echo configure:7967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7967   rm -rf conftest*
7968   eval "ac_cv_lib_$ac_lib_var=yes"
7969 else
7970   echo "configure: failed program was:" >&5
7971   cat conftest.$ac_ext >&5
7972   rm -rf conftest*
7973   eval "ac_cv_lib_$ac_lib_var=no"
7974 fi
7975 rm -f conftest*
7976 xe_check_libs=""
7977
7978 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7979   echo "$ac_t""yes" 1>&6
7980   :
7981 else
7982   echo "$ac_t""no" 1>&6
7983 with_wnn=no
7984 fi
7985
7986  }
7987   test -z "$with_wnn" && with_wnn=yes
7988   if test "$with_wnn" = "yes"; then
7989     { test "$extra_verbose" = "yes" && cat << \EOF
7990     Defining HAVE_WNN
7991 EOF
7992 cat >> confdefs.h <<\EOF
7993 #define HAVE_WNN 1
7994 EOF
7995 }
7996
7997     libs_x="-lwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lwnn\" to \$libs_x"; fi
7998     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
7999    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8000  fi
8001     if test "$with_wnn6" != "no"; then
8002       
8003 echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
8004 echo "configure:8005: checking for jl_fi_dic_list in -lwnn" >&5
8005 ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8006
8007 xe_check_libs=" -lwnn "
8008 cat > conftest.$ac_ext <<EOF
8009 #line 8010 "configure"
8010 #include "confdefs.h"
8011 /* Override any gcc2 internal prototype to avoid an error.  */
8012 /* We use char because int might match the return type of a gcc2
8013     builtin and then its argument prototype would still apply.  */
8014 char jl_fi_dic_list();
8015
8016 int main() {
8017 jl_fi_dic_list()
8018 ; return 0; }
8019 EOF
8020 if { (eval echo configure:8021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8021   rm -rf conftest*
8022   eval "ac_cv_lib_$ac_lib_var=yes"
8023 else
8024   echo "configure: failed program was:" >&5
8025   cat conftest.$ac_ext >&5
8026   rm -rf conftest*
8027   eval "ac_cv_lib_$ac_lib_var=no"
8028 fi
8029 rm -f conftest*
8030 xe_check_libs=""
8031
8032 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8033   echo "$ac_t""yes" 1>&6
8034   with_wnn6=yes
8035 else
8036   echo "$ac_t""no" 1>&6
8037 fi
8038
8039
8040       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8041     Defining WNN6
8042 EOF
8043 cat >> confdefs.h <<\EOF
8044 #define WNN6 1
8045 EOF
8046 }
8047
8048     fi
8049   fi
8050
8051     canna_includes_found=no
8052   if test "$with_canna" != "no"; then
8053     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8054 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8055 echo "configure:8056: checking for canna/jrkanji.h" >&5
8056
8057 cat > conftest.$ac_ext <<EOF
8058 #line 8059 "configure"
8059 #include "confdefs.h"
8060 #include <canna/jrkanji.h>
8061 EOF
8062 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8063 { (eval echo configure:8064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8064 ac_err=`grep -v '^ *+' conftest.out`
8065 if test -z "$ac_err"; then
8066   rm -rf conftest*
8067   eval "ac_cv_header_$ac_safe=yes"
8068 else
8069   echo "$ac_err" >&5
8070   echo "configure: failed program was:" >&5
8071   cat conftest.$ac_ext >&5
8072   rm -rf conftest*
8073   eval "ac_cv_header_$ac_safe=no"
8074 fi
8075 rm -f conftest*
8076 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8077   echo "$ac_t""yes" 1>&6
8078   canna_includes_found=yes
8079 else
8080   echo "$ac_t""no" 1>&6
8081 fi
8082
8083   fi
8084   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8085       -d "/usr/local/canna/include"; then
8086     save_c_switch_site="$c_switch_site"
8087     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8088     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8089 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8090 echo "configure:8091: checking for canna/jrkanji.h" >&5
8091
8092 cat > conftest.$ac_ext <<EOF
8093 #line 8094 "configure"
8094 #include "confdefs.h"
8095 #include <canna/jrkanji.h>
8096 EOF
8097 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8098 { (eval echo configure:8099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8099 ac_err=`grep -v '^ *+' conftest.out`
8100 if test -z "$ac_err"; then
8101   rm -rf conftest*
8102   eval "ac_cv_header_$ac_safe=yes"
8103 else
8104   echo "$ac_err" >&5
8105   echo "configure: failed program was:" >&5
8106   cat conftest.$ac_ext >&5
8107   rm -rf conftest*
8108   eval "ac_cv_header_$ac_safe=no"
8109 fi
8110 rm -f conftest*
8111 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8112   echo "$ac_t""yes" 1>&6
8113   canna_includes_found=yes
8114 else
8115   echo "$ac_t""no" 1>&6
8116 fi
8117
8118     if test "$canna_includes_found" != "yes"; then
8119       c_switch_site="$save_c_switch_site"
8120       with_canna="no"
8121     fi
8122   fi
8123
8124   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8125 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8126 echo "configure:8127: checking for canna/RK.h" >&5
8127
8128 cat > conftest.$ac_ext <<EOF
8129 #line 8130 "configure"
8130 #include "confdefs.h"
8131 #include <canna/RK.h>
8132 EOF
8133 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8134 { (eval echo configure:8135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8135 ac_err=`grep -v '^ *+' conftest.out`
8136 if test -z "$ac_err"; then
8137   rm -rf conftest*
8138   eval "ac_cv_header_$ac_safe=yes"
8139 else
8140   echo "$ac_err" >&5
8141   echo "configure: failed program was:" >&5
8142   cat conftest.$ac_ext >&5
8143   rm -rf conftest*
8144   eval "ac_cv_header_$ac_safe=no"
8145 fi
8146 rm -f conftest*
8147 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8148   echo "$ac_t""yes" 1>&6
8149   :
8150 else
8151   echo "$ac_t""no" 1>&6
8152 with_canna=no
8153 fi
8154  }
8155   test -z "$with_canna" && { 
8156 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8157 echo "configure:8158: checking for RkBgnBun in -lRKC" >&5
8158 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8159
8160 xe_check_libs=" -lRKC "
8161 cat > conftest.$ac_ext <<EOF
8162 #line 8163 "configure"
8163 #include "confdefs.h"
8164 /* Override any gcc2 internal prototype to avoid an error.  */
8165 /* We use char because int might match the return type of a gcc2
8166     builtin and then its argument prototype would still apply.  */
8167 char RkBgnBun();
8168
8169 int main() {
8170 RkBgnBun()
8171 ; return 0; }
8172 EOF
8173 if { (eval echo configure:8174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8174   rm -rf conftest*
8175   eval "ac_cv_lib_$ac_lib_var=yes"
8176 else
8177   echo "configure: failed program was:" >&5
8178   cat conftest.$ac_ext >&5
8179   rm -rf conftest*
8180   eval "ac_cv_lib_$ac_lib_var=no"
8181 fi
8182 rm -f conftest*
8183 xe_check_libs=""
8184
8185 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8186   echo "$ac_t""yes" 1>&6
8187   :
8188 else
8189   echo "$ac_t""no" 1>&6
8190 with_canna=no
8191 fi
8192
8193  }
8194   test -z "$with_canna" && { 
8195 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8196 echo "configure:8197: checking for jrKanjiControl in -lcanna" >&5
8197 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8198
8199 xe_check_libs=" -lcanna "
8200 cat > conftest.$ac_ext <<EOF
8201 #line 8202 "configure"
8202 #include "confdefs.h"
8203 /* Override any gcc2 internal prototype to avoid an error.  */
8204 /* We use char because int might match the return type of a gcc2
8205     builtin and then its argument prototype would still apply.  */
8206 char jrKanjiControl();
8207
8208 int main() {
8209 jrKanjiControl()
8210 ; return 0; }
8211 EOF
8212 if { (eval echo configure:8213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8213   rm -rf conftest*
8214   eval "ac_cv_lib_$ac_lib_var=yes"
8215 else
8216   echo "configure: failed program was:" >&5
8217   cat conftest.$ac_ext >&5
8218   rm -rf conftest*
8219   eval "ac_cv_lib_$ac_lib_var=no"
8220 fi
8221 rm -f conftest*
8222 xe_check_libs=""
8223
8224 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8225   echo "$ac_t""yes" 1>&6
8226   :
8227 else
8228   echo "$ac_t""no" 1>&6
8229 with_canna=no
8230 fi
8231
8232  }
8233   test -z "$with_canna" && with_canna=yes
8234   if test "$with_canna" = "yes"; then
8235     { test "$extra_verbose" = "yes" && cat << \EOF
8236     Defining HAVE_CANNA
8237 EOF
8238 cat >> confdefs.h <<\EOF
8239 #define HAVE_CANNA 1
8240 EOF
8241 }
8242
8243     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8244     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8245    echo "    xemacs will be linked with \"mule-canna.o\""
8246  fi
8247   fi
8248
8249 else   for feature in xim canna wnn; do
8250     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8251       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8252     fi
8253     eval "with_${feature}=no"
8254   done
8255 fi 
8256
8257 if test "$need_motif" = "yes" ; then
8258   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8259     
8260 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8261 echo "configure:8262: checking for layout_object_getvalue in -li18n" >&5
8262 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8263
8264 xe_check_libs=" -li18n "
8265 cat > conftest.$ac_ext <<EOF
8266 #line 8267 "configure"
8267 #include "confdefs.h"
8268 /* Override any gcc2 internal prototype to avoid an error.  */
8269 /* We use char because int might match the return type of a gcc2
8270     builtin and then its argument prototype would still apply.  */
8271 char layout_object_getvalue();
8272
8273 int main() {
8274 layout_object_getvalue()
8275 ; return 0; }
8276 EOF
8277 if { (eval echo configure:8278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8278   rm -rf conftest*
8279   eval "ac_cv_lib_$ac_lib_var=yes"
8280 else
8281   echo "configure: failed program was:" >&5
8282   cat conftest.$ac_ext >&5
8283   rm -rf conftest*
8284   eval "ac_cv_lib_$ac_lib_var=no"
8285 fi
8286 rm -f conftest*
8287 xe_check_libs=""
8288
8289 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8290   echo "$ac_t""yes" 1>&6
8291   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8292 else
8293   echo "$ac_t""no" 1>&6
8294 fi
8295
8296
8297   
8298 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8299     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8300   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8301   
8302         runpath="" runpath_dirs=""
8303   if test -n "$LD_RUN_PATH"; then
8304     runpath="$LD_RUN_PATH"
8305   elif test "$GCC" = "yes"; then
8306         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8307     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8308     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8309     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8310       case "$arg" in P,* | -L* | -R* )
8311         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8312           {
8313 xe_runpath_dir="$dir"
8314   test "$xe_runpath_dir" != "/lib"     -a \
8315         "$xe_runpath_dir" != "/usr/lib" -a \
8316         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8317   eval "$xe_add_unique_runpath_dir"
8318 }
8319         done ;;
8320       esac
8321     done
8322     ld_switch_run="$ld_switch_run_save"
8323     rm -f conftest*
8324   else
8325         for arg in $ld_switch_site $ld_switch_x_site; do
8326       case "$arg" in -L*) {
8327 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8328   test "$xe_runpath_dir" != "/lib"     -a \
8329         "$xe_runpath_dir" != "/usr/lib" -a \
8330         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8331   eval "$xe_add_unique_runpath_dir"
8332 };; esac
8333     done
8334         if test "$opsys $need_motif" = "sol2 yes"; then
8335       xe_runpath_dir="/opt/SUNWdt/lib";
8336       eval "$xe_add_unique_runpath_dir";
8337     fi
8338   fi 
8339   if test -n "$runpath"; then
8340     ld_switch_run="${dash_r}${runpath}"
8341     
8342 if test "$GCC" = "yes"; then
8343   set x $ld_switch_run; shift; ld_switch_run=""
8344   while test -n "$1"; do
8345     case $1 in
8346       -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8347       -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
8348       -Xlinker* ) ;;
8349       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8350     esac
8351     shift
8352   done
8353 fi
8354     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8355   fi
8356 fi
8357
8358 fi
8359
8360 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
8361 do
8362 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8363 echo "configure:8364: checking for $ac_func" >&5
8364
8365 cat > conftest.$ac_ext <<EOF
8366 #line 8367 "configure"
8367 #include "confdefs.h"
8368 /* System header to define __stub macros and hopefully few prototypes,
8369     which can conflict with char $ac_func(); below.  */
8370 #include <assert.h>
8371 /* Override any gcc2 internal prototype to avoid an error.  */
8372 /* We use char because int might match the return type of a gcc2
8373     builtin and then its argument prototype would still apply.  */
8374 char $ac_func();
8375
8376 int main() {
8377
8378 /* The GNU C library defines this for functions which it implements
8379     to always fail with ENOSYS.  Some functions are actually named
8380     something starting with __ and the normal name is an alias.  */
8381 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8382 choke me
8383 #else
8384 $ac_func();
8385 #endif
8386
8387 ; return 0; }
8388 EOF
8389 if { (eval echo configure:8390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8390   rm -rf conftest*
8391   eval "ac_cv_func_$ac_func=yes"
8392 else
8393   echo "configure: failed program was:" >&5
8394   cat conftest.$ac_ext >&5
8395   rm -rf conftest*
8396   eval "ac_cv_func_$ac_func=no"
8397 fi
8398 rm -f conftest*
8399
8400 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8401   echo "$ac_t""yes" 1>&6
8402     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8403   { test "$extra_verbose" = "yes" && cat << EOF
8404     Defining $ac_tr_func
8405 EOF
8406 cat >> confdefs.h <<EOF
8407 #define $ac_tr_func 1
8408 EOF
8409 }
8410  
8411 else
8412   echo "$ac_t""no" 1>&6
8413 fi
8414 done
8415
8416
8417
8418 case "$opsys" in
8419   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8420    echo "    xemacs will be linked with \"realpath.o\""
8421  fi ;;
8422   * )
8423     for ac_func in realpath
8424 do
8425 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8426 echo "configure:8427: checking for $ac_func" >&5
8427
8428 cat > conftest.$ac_ext <<EOF
8429 #line 8430 "configure"
8430 #include "confdefs.h"
8431 /* System header to define __stub macros and hopefully few prototypes,
8432     which can conflict with char $ac_func(); below.  */
8433 #include <assert.h>
8434 /* Override any gcc2 internal prototype to avoid an error.  */
8435 /* We use char because int might match the return type of a gcc2
8436     builtin and then its argument prototype would still apply.  */
8437 char $ac_func();
8438
8439 int main() {
8440
8441 /* The GNU C library defines this for functions which it implements
8442     to always fail with ENOSYS.  Some functions are actually named
8443     something starting with __ and the normal name is an alias.  */
8444 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8445 choke me
8446 #else
8447 $ac_func();
8448 #endif
8449
8450 ; return 0; }
8451 EOF
8452 if { (eval echo configure:8453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8453   rm -rf conftest*
8454   eval "ac_cv_func_$ac_func=yes"
8455 else
8456   echo "configure: failed program was:" >&5
8457   cat conftest.$ac_ext >&5
8458   rm -rf conftest*
8459   eval "ac_cv_func_$ac_func=no"
8460 fi
8461 rm -f conftest*
8462
8463 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8464   echo "$ac_t""yes" 1>&6
8465     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8466   { test "$extra_verbose" = "yes" && cat << EOF
8467     Defining $ac_tr_func
8468 EOF
8469 cat >> confdefs.h <<EOF
8470 #define $ac_tr_func 1
8471 EOF
8472 }
8473  
8474 else
8475   echo "$ac_t""no" 1>&6
8476 fi
8477 done
8478
8479     test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8480    echo "    xemacs will be linked with \"realpath.o\""
8481  fi ;;
8482 esac
8483
8484 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8485 echo "configure:8486: checking whether netdb declares h_errno" >&5
8486 cat > conftest.$ac_ext <<EOF
8487 #line 8488 "configure"
8488 #include "confdefs.h"
8489 #include <netdb.h>
8490 int main() {
8491 return h_errno;
8492 ; return 0; }
8493 EOF
8494 if { (eval echo configure:8495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8495   rm -rf conftest*
8496   echo "$ac_t""yes" 1>&6
8497    { test "$extra_verbose" = "yes" && cat << \EOF
8498     Defining HAVE_H_ERRNO
8499 EOF
8500 cat >> confdefs.h <<\EOF
8501 #define HAVE_H_ERRNO 1
8502 EOF
8503 }
8504
8505 else
8506   echo "configure: failed program was:" >&5
8507   cat conftest.$ac_ext >&5
8508   rm -rf conftest*
8509   echo "$ac_t""no" 1>&6
8510 fi
8511 rm -f conftest*
8512
8513 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8514 echo "configure:8515: checking for sigsetjmp" >&5
8515 cat > conftest.$ac_ext <<EOF
8516 #line 8517 "configure"
8517 #include "confdefs.h"
8518 #include <setjmp.h>
8519 int main() {
8520 sigjmp_buf bar; sigsetjmp (bar, 0);
8521 ; return 0; }
8522 EOF
8523 if { (eval echo configure:8524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8524   rm -rf conftest*
8525   echo "$ac_t""yes" 1>&6
8526    { test "$extra_verbose" = "yes" && cat << \EOF
8527     Defining HAVE_SIGSETJMP
8528 EOF
8529 cat >> confdefs.h <<\EOF
8530 #define HAVE_SIGSETJMP 1
8531 EOF
8532 }
8533
8534 else
8535   echo "configure: failed program was:" >&5
8536   cat conftest.$ac_ext >&5
8537   rm -rf conftest*
8538   echo "$ac_t""no" 1>&6
8539 fi
8540 rm -f conftest*
8541
8542 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
8543 echo "configure:8544: checking whether localtime caches TZ" >&5
8544
8545 if test "$ac_cv_func_tzset" = "yes"; then
8546 cat > conftest.$ac_ext <<EOF
8547 #line 8548 "configure"
8548 #include "confdefs.h"
8549 #include <time.h>
8550 #if STDC_HEADERS
8551 # include <stdlib.h>
8552 #endif
8553 extern char **environ;
8554 unset_TZ ()
8555 {
8556   char **from, **to;
8557   for (to = from = environ; (*to = *from); from++)
8558     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
8559       to++;
8560 }
8561 char TZ_GMT0[] = "TZ=GMT0";
8562 char TZ_PST8[] = "TZ=PST8";
8563 main()
8564 {
8565   time_t now = time ((time_t *) 0);
8566   int hour_GMT0, hour_unset;
8567   if (putenv (TZ_GMT0) != 0)
8568     exit (1);
8569   hour_GMT0 = localtime (&now)->tm_hour;
8570   unset_TZ ();
8571   hour_unset = localtime (&now)->tm_hour;
8572   if (putenv (TZ_PST8) != 0)
8573     exit (1);
8574   if (localtime (&now)->tm_hour == hour_GMT0)
8575     exit (1);
8576   unset_TZ ();
8577   if (localtime (&now)->tm_hour != hour_unset)
8578     exit (1);
8579   exit (0);
8580 }
8581 EOF
8582 if { (eval echo configure:8583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8583 then
8584   emacs_cv_localtime_cache=no
8585 else
8586   conftest_rc="$?"
8587   echo "configure: failed program was:" >&5
8588   cat conftest.$ac_ext >&5
8589   rm -fr conftest*
8590   emacs_cv_localtime_cache=yes
8591 fi
8592 rm -fr conftest*
8593 else
8594         # If we lack tzset, report that localtime does not cache TZ,
8595         # since we can't invalidate the cache if we don't have tzset.
8596         emacs_cv_localtime_cache=no
8597 fi
8598 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
8599 if test $emacs_cv_localtime_cache = yes; then
8600   { test "$extra_verbose" = "yes" && cat << \EOF
8601     Defining LOCALTIME_CACHE
8602 EOF
8603 cat >> confdefs.h <<\EOF
8604 #define LOCALTIME_CACHE 1
8605 EOF
8606 }
8607
8608 fi
8609
8610 if test "$HAVE_TIMEVAL" = "yes"; then
8611 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
8612 echo "configure:8613: checking whether gettimeofday accepts one or two arguments" >&5
8613 cat > conftest.$ac_ext <<EOF
8614 #line 8615 "configure"
8615 #include "confdefs.h"
8616
8617 #ifdef TIME_WITH_SYS_TIME
8618 #include <sys/time.h>
8619 #include <time.h>
8620 #else
8621 #ifdef HAVE_SYS_TIME_H
8622 #include <sys/time.h>
8623 #else
8624 #include <time.h>
8625 #endif
8626 #endif
8627   
8628 int main() {
8629
8630   struct timeval time;
8631   struct timezone dummy;
8632   gettimeofday (&time, &dummy);
8633
8634 ; return 0; }
8635 EOF
8636 if { (eval echo configure:8637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8637   rm -rf conftest*
8638   echo "$ac_t""two" 1>&6
8639 else
8640   echo "configure: failed program was:" >&5
8641   cat conftest.$ac_ext >&5
8642   rm -rf conftest*
8643   echo "$ac_t""one" 1>&6
8644    { test "$extra_verbose" = "yes" && cat << \EOF
8645     Defining GETTIMEOFDAY_ONE_ARGUMENT
8646 EOF
8647 cat >> confdefs.h <<\EOF
8648 #define GETTIMEOFDAY_ONE_ARGUMENT 1
8649 EOF
8650 }
8651
8652 fi
8653 rm -f conftest*
8654 fi
8655
8656
8657 echo $ac_n "checking for inline""... $ac_c" 1>&6
8658 echo "configure:8659: checking for inline" >&5
8659
8660 ac_cv_c_inline=no
8661 for ac_kw in inline __inline__ __inline; do
8662   cat > conftest.$ac_ext <<EOF
8663 #line 8664 "configure"
8664 #include "confdefs.h"
8665
8666 int main() {
8667 } $ac_kw foo() {
8668 ; return 0; }
8669 EOF
8670 if { (eval echo configure:8671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8671   rm -rf conftest*
8672   ac_cv_c_inline=$ac_kw; break
8673 else
8674   echo "configure: failed program was:" >&5
8675   cat conftest.$ac_ext >&5
8676 fi
8677 rm -f conftest*
8678 done
8679
8680
8681 echo "$ac_t""$ac_cv_c_inline" 1>&6
8682 case "$ac_cv_c_inline" in
8683   inline | yes) ;;
8684   no) { test "$extra_verbose" = "yes" && cat << \EOF
8685     Defining inline = 
8686 EOF
8687 cat >> confdefs.h <<\EOF
8688 #define inline 
8689 EOF
8690 }
8691  ;;
8692   *)  { test "$extra_verbose" = "yes" && cat << EOF
8693     Defining inline = $ac_cv_c_inline
8694 EOF
8695 cat >> confdefs.h <<EOF
8696 #define inline $ac_cv_c_inline
8697 EOF
8698 }
8699  ;;
8700 esac
8701
8702 if test "$ac_cv_c_inline" != "no"; then
8703   { test "$extra_verbose" = "yes" && cat << \EOF
8704     Defining HAVE_INLINE
8705 EOF
8706 cat >> confdefs.h <<\EOF
8707 #define HAVE_INLINE 1
8708 EOF
8709 }
8710
8711   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
8712    echo "    xemacs will be linked with \"inline.o\""
8713  fi
8714 fi
8715
8716
8717 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
8718 # for constant arguments.  Useless!
8719 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
8720 echo "configure:8721: checking for working alloca.h" >&5
8721
8722 cat > conftest.$ac_ext <<EOF
8723 #line 8724 "configure"
8724 #include "confdefs.h"
8725 #include <alloca.h>
8726 int main() {
8727 char *p = alloca(2 * sizeof(int));
8728 ; return 0; }
8729 EOF
8730 if { (eval echo configure:8731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8731   rm -rf conftest*
8732   ac_cv_header_alloca_h=yes
8733 else
8734   echo "configure: failed program was:" >&5
8735   cat conftest.$ac_ext >&5
8736   rm -rf conftest*
8737   ac_cv_header_alloca_h=no
8738 fi
8739 rm -f conftest*
8740
8741 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
8742 if test $ac_cv_header_alloca_h = yes; then
8743   { test "$extra_verbose" = "yes" && cat << \EOF
8744     Defining HAVE_ALLOCA_H
8745 EOF
8746 cat >> confdefs.h <<\EOF
8747 #define HAVE_ALLOCA_H 1
8748 EOF
8749 }
8750
8751 fi
8752
8753 echo $ac_n "checking for alloca""... $ac_c" 1>&6
8754 echo "configure:8755: checking for alloca" >&5
8755
8756 cat > conftest.$ac_ext <<EOF
8757 #line 8758 "configure"
8758 #include "confdefs.h"
8759
8760 #ifdef __GNUC__
8761 # define alloca __builtin_alloca
8762 #else
8763 # if HAVE_ALLOCA_H
8764 #  include <alloca.h>
8765 # else
8766 #  ifdef _AIX
8767  #pragma alloca
8768 #  else
8769 #   ifndef alloca /* predefined by HP cc +Olibcalls */
8770 char *alloca ();
8771 #   endif
8772 #  endif
8773 # endif
8774 #endif
8775
8776 int main() {
8777 char *p = (char *) alloca(1);
8778 ; return 0; }
8779 EOF
8780 if { (eval echo configure:8781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8781   rm -rf conftest*
8782   ac_cv_func_alloca_works=yes
8783 else
8784   echo "configure: failed program was:" >&5
8785   cat conftest.$ac_ext >&5
8786   rm -rf conftest*
8787   ac_cv_func_alloca_works=no
8788 fi
8789 rm -f conftest*
8790
8791 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
8792 if test $ac_cv_func_alloca_works = yes; then
8793   { test "$extra_verbose" = "yes" && cat << \EOF
8794     Defining HAVE_ALLOCA
8795 EOF
8796 cat >> confdefs.h <<\EOF
8797 #define HAVE_ALLOCA 1
8798 EOF
8799 }
8800
8801 fi
8802
8803 if test $ac_cv_func_alloca_works = no; then
8804   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
8805   # that cause trouble.  Some versions do not even contain alloca or
8806   # contain a buggy version.  If you still want to use their alloca,
8807   # use ar to extract alloca.o from them instead of compiling alloca.c.
8808   ALLOCA=alloca.o
8809   { test "$extra_verbose" = "yes" && cat << \EOF
8810     Defining C_ALLOCA
8811 EOF
8812 cat >> confdefs.h <<\EOF
8813 #define C_ALLOCA 1
8814 EOF
8815 }
8816
8817
8818 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
8819 echo "configure:8820: checking whether alloca needs Cray hooks" >&5
8820
8821 cat > conftest.$ac_ext <<EOF
8822 #line 8823 "configure"
8823 #include "confdefs.h"
8824 #if defined(CRAY) && ! defined(CRAY2)
8825 webecray
8826 #else
8827 wenotbecray
8828 #endif
8829
8830 EOF
8831 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8832   egrep "webecray" >/dev/null 2>&1; then
8833   rm -rf conftest*
8834   ac_cv_os_cray=yes
8835 else
8836   rm -rf conftest*
8837   ac_cv_os_cray=no
8838 fi
8839 rm -f conftest*
8840
8841
8842 echo "$ac_t""$ac_cv_os_cray" 1>&6
8843 if test $ac_cv_os_cray = yes; then
8844 for ac_func in _getb67 GETB67 getb67; do
8845   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8846 echo "configure:8847: checking for $ac_func" >&5
8847
8848 cat > conftest.$ac_ext <<EOF
8849 #line 8850 "configure"
8850 #include "confdefs.h"
8851 /* System header to define __stub macros and hopefully few prototypes,
8852     which can conflict with char $ac_func(); below.  */
8853 #include <assert.h>
8854 /* Override any gcc2 internal prototype to avoid an error.  */
8855 /* We use char because int might match the return type of a gcc2
8856     builtin and then its argument prototype would still apply.  */
8857 char $ac_func();
8858
8859 int main() {
8860
8861 /* The GNU C library defines this for functions which it implements
8862     to always fail with ENOSYS.  Some functions are actually named
8863     something starting with __ and the normal name is an alias.  */
8864 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8865 choke me
8866 #else
8867 $ac_func();
8868 #endif
8869
8870 ; return 0; }
8871 EOF
8872 if { (eval echo configure:8873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8873   rm -rf conftest*
8874   eval "ac_cv_func_$ac_func=yes"
8875 else
8876   echo "configure: failed program was:" >&5
8877   cat conftest.$ac_ext >&5
8878   rm -rf conftest*
8879   eval "ac_cv_func_$ac_func=no"
8880 fi
8881 rm -f conftest*
8882
8883 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8884   echo "$ac_t""yes" 1>&6
8885   { test "$extra_verbose" = "yes" && cat << EOF
8886     Defining CRAY_STACKSEG_END = $ac_func
8887 EOF
8888 cat >> confdefs.h <<EOF
8889 #define CRAY_STACKSEG_END $ac_func
8890 EOF
8891 }
8892
8893   break
8894 else
8895   echo "$ac_t""no" 1>&6
8896 fi
8897
8898 done
8899 fi
8900
8901 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
8902 echo "configure:8903: checking stack direction for C alloca" >&5
8903
8904 cat > conftest.$ac_ext <<EOF
8905 #line 8906 "configure"
8906 #include "confdefs.h"
8907 find_stack_direction ()
8908 {
8909   static char *addr = 0;
8910   auto char dummy;
8911   if (addr == 0)
8912     {
8913       addr = &dummy;
8914       return find_stack_direction ();
8915     }
8916   else
8917     return (&dummy > addr) ? 1 : -1;
8918 }
8919 main ()
8920 {
8921   exit (find_stack_direction() < 0);
8922 }
8923 EOF
8924 if { (eval echo configure:8925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8925 then
8926   ac_cv_c_stack_direction=1
8927 else
8928   conftest_rc="$?"
8929   echo "configure: failed program was:" >&5
8930   cat conftest.$ac_ext >&5
8931   rm -fr conftest*
8932   ac_cv_c_stack_direction=-1
8933 fi
8934 rm -fr conftest*
8935
8936 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
8937 { test "$extra_verbose" = "yes" && cat << EOF
8938     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
8939 EOF
8940 cat >> confdefs.h <<EOF
8941 #define STACK_DIRECTION $ac_cv_c_stack_direction
8942 EOF
8943 }
8944
8945 fi
8946
8947 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
8948    echo "    xemacs will be linked with \"$ALLOCA\""
8949  fi
8950
8951 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
8952 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
8953 echo "configure:8954: checking for vfork.h" >&5
8954
8955 cat > conftest.$ac_ext <<EOF
8956 #line 8957 "configure"
8957 #include "confdefs.h"
8958 #include <vfork.h>
8959 EOF
8960 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8961 { (eval echo configure:8962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8962 ac_err=`grep -v '^ *+' conftest.out`
8963 if test -z "$ac_err"; then
8964   rm -rf conftest*
8965   eval "ac_cv_header_$ac_safe=yes"
8966 else
8967   echo "$ac_err" >&5
8968   echo "configure: failed program was:" >&5
8969   cat conftest.$ac_ext >&5
8970   rm -rf conftest*
8971   eval "ac_cv_header_$ac_safe=no"
8972 fi
8973 rm -f conftest*
8974 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8975   echo "$ac_t""yes" 1>&6
8976   { test "$extra_verbose" = "yes" && cat << \EOF
8977     Defining HAVE_VFORK_H
8978 EOF
8979 cat >> confdefs.h <<\EOF
8980 #define HAVE_VFORK_H 1
8981 EOF
8982 }
8983
8984 else
8985   echo "$ac_t""no" 1>&6
8986 fi
8987
8988 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
8989 echo "configure:8990: checking for working vfork" >&5
8990
8991 cat > conftest.$ac_ext <<EOF
8992 #line 8993 "configure"
8993 #include "confdefs.h"
8994 /* Thanks to Paul Eggert for this test.  */
8995 #include <stdio.h>
8996 #include <sys/types.h>
8997 #include <sys/stat.h>
8998 #ifdef HAVE_UNISTD_H
8999 #include <unistd.h>
9000 #endif
9001 #ifdef HAVE_VFORK_H
9002 #include <vfork.h>
9003 #endif
9004 /* On some sparc systems, changes by the child to local and incoming
9005    argument registers are propagated back to the parent.
9006    The compiler is told about this with #include <vfork.h>,
9007    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9008    Test for this by using a static variable whose address
9009    is put into a register that is clobbered by the vfork.  */
9010 static
9011 #ifdef __cplusplus
9012 sparc_address_test (int arg)
9013 #else
9014 sparc_address_test (arg) int arg;
9015 #endif
9016 {
9017   static pid_t child;
9018   if (!child) {
9019     child = vfork ();
9020     if (child < 0) {
9021       perror ("vfork");
9022       _exit(2);
9023     }
9024     if (!child) {
9025       arg = getpid();
9026       write(-1, "", 0);
9027       _exit (arg);
9028     }
9029   }
9030 }
9031 main() {
9032   pid_t parent = getpid ();
9033   pid_t child;
9034
9035   sparc_address_test ();
9036
9037   child = vfork ();
9038
9039   if (child == 0) {
9040     /* Here is another test for sparc vfork register problems.
9041        This test uses lots of local variables, at least
9042        as many local variables as main has allocated so far
9043        including compiler temporaries.  4 locals are enough for
9044        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9045        A buggy compiler should reuse the register of parent
9046        for one of the local variables, since it will think that
9047        parent can't possibly be used any more in this routine.
9048        Assigning to the local variable will thus munge parent
9049        in the parent process.  */
9050     pid_t
9051       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9052       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9053     /* Convince the compiler that p..p7 are live; otherwise, it might
9054        use the same hardware register for all 8 local variables.  */
9055     if (p != p1 || p != p2 || p != p3 || p != p4
9056         || p != p5 || p != p6 || p != p7)
9057       _exit(1);
9058
9059     /* On some systems (e.g. IRIX 3.3),
9060        vfork doesn't separate parent from child file descriptors.
9061        If the child closes a descriptor before it execs or exits,
9062        this munges the parent's descriptor as well.
9063        Test for this by closing stdout in the child.  */
9064     _exit(close(fileno(stdout)) != 0);
9065   } else {
9066     int status;
9067     struct stat st;
9068
9069     while (wait(&status) != child)
9070       ;
9071     exit(
9072          /* Was there some problem with vforking?  */
9073          child < 0
9074
9075          /* Did the child fail?  (This shouldn't happen.)  */
9076          || status
9077
9078          /* Did the vfork/compiler bug occur?  */
9079          || parent != getpid()
9080
9081          /* Did the file descriptor bug occur?  */
9082          || fstat(fileno(stdout), &st) != 0
9083          );
9084   }
9085 }
9086 EOF
9087 if { (eval echo configure:9088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9088 then
9089   ac_cv_func_vfork_works=yes
9090 else
9091   conftest_rc="$?"
9092   echo "configure: failed program was:" >&5
9093   cat conftest.$ac_ext >&5
9094   rm -fr conftest*
9095   ac_cv_func_vfork_works=no
9096 fi
9097 rm -fr conftest*
9098
9099 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9100 if test $ac_cv_func_vfork_works = no; then
9101   { test "$extra_verbose" = "yes" && cat << \EOF
9102     Defining vfork = fork
9103 EOF
9104 cat >> confdefs.h <<\EOF
9105 #define vfork fork
9106 EOF
9107 }
9108
9109 fi
9110
9111
9112 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9113 echo "configure:9114: checking for working strcoll" >&5
9114
9115 cat > conftest.$ac_ext <<EOF
9116 #line 9117 "configure"
9117 #include "confdefs.h"
9118 #include <string.h>
9119 main ()
9120 {
9121   exit (strcoll ("abc", "def") >= 0 ||
9122         strcoll ("ABC", "DEF") >= 0 ||
9123         strcoll ("123", "456") >= 0);
9124 }
9125 EOF
9126 if { (eval echo configure:9127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9127 then
9128   ac_cv_func_strcoll_works=yes
9129 else
9130   conftest_rc="$?"
9131   echo "configure: failed program was:" >&5
9132   cat conftest.$ac_ext >&5
9133   rm -fr conftest*
9134   ac_cv_func_strcoll_works=no
9135 fi
9136 rm -fr conftest*
9137
9138 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9139 if test $ac_cv_func_strcoll_works = yes; then
9140   { test "$extra_verbose" = "yes" && cat << \EOF
9141     Defining HAVE_STRCOLL
9142 EOF
9143 cat >> confdefs.h <<\EOF
9144 #define HAVE_STRCOLL 1
9145 EOF
9146 }
9147
9148 fi
9149
9150
9151 for ac_func in getpgrp
9152 do
9153 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9154 echo "configure:9155: checking for $ac_func" >&5
9155
9156 cat > conftest.$ac_ext <<EOF
9157 #line 9158 "configure"
9158 #include "confdefs.h"
9159 /* System header to define __stub macros and hopefully few prototypes,
9160     which can conflict with char $ac_func(); below.  */
9161 #include <assert.h>
9162 /* Override any gcc2 internal prototype to avoid an error.  */
9163 /* We use char because int might match the return type of a gcc2
9164     builtin and then its argument prototype would still apply.  */
9165 char $ac_func();
9166
9167 int main() {
9168
9169 /* The GNU C library defines this for functions which it implements
9170     to always fail with ENOSYS.  Some functions are actually named
9171     something starting with __ and the normal name is an alias.  */
9172 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9173 choke me
9174 #else
9175 $ac_func();
9176 #endif
9177
9178 ; return 0; }
9179 EOF
9180 if { (eval echo configure:9181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9181   rm -rf conftest*
9182   eval "ac_cv_func_$ac_func=yes"
9183 else
9184   echo "configure: failed program was:" >&5
9185   cat conftest.$ac_ext >&5
9186   rm -rf conftest*
9187   eval "ac_cv_func_$ac_func=no"
9188 fi
9189 rm -f conftest*
9190
9191 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9192   echo "$ac_t""yes" 1>&6
9193     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9194   { test "$extra_verbose" = "yes" && cat << EOF
9195     Defining $ac_tr_func
9196 EOF
9197 cat >> confdefs.h <<EOF
9198 #define $ac_tr_func 1
9199 EOF
9200 }
9201  
9202 else
9203   echo "$ac_t""no" 1>&6
9204 fi
9205 done
9206
9207 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9208 echo "configure:9209: checking whether getpgrp takes no argument" >&5
9209
9210 cat > conftest.$ac_ext <<EOF
9211 #line 9212 "configure"
9212 #include "confdefs.h"
9213
9214 /*
9215  * If this system has a BSD-style getpgrp(),
9216  * which takes a pid argument, exit unsuccessfully.
9217  *
9218  * Snarfed from Chet Ramey's bash pgrp.c test program
9219  */
9220 #include <stdio.h>
9221 #include <sys/types.h>
9222
9223 int     pid;
9224 int     pg1, pg2, pg3, pg4;
9225 int     ng, np, s, child;
9226
9227 main()
9228 {
9229         pid = getpid();
9230         pg1 = getpgrp(0);
9231         pg2 = getpgrp();
9232         pg3 = getpgrp(pid);
9233         pg4 = getpgrp(1);
9234
9235         /*
9236          * If all of these values are the same, it's pretty sure that
9237          * we're on a system that ignores getpgrp's first argument.
9238          */
9239         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9240                 exit(0);
9241
9242         child = fork();
9243         if (child < 0)
9244                 exit(1);
9245         else if (child == 0) {
9246                 np = getpid();
9247                 /*
9248                  * If this is Sys V, this will not work; pgrp will be
9249                  * set to np because setpgrp just changes a pgrp to be
9250                  * the same as the pid.
9251                  */
9252                 setpgrp(np, pg1);
9253                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9254                 if (ng == pg1) {
9255                         exit(1);
9256                 } else {
9257                         exit(0);
9258                 }
9259         } else {
9260                 wait(&s);
9261                 exit(s>>8);
9262         }
9263 }
9264
9265 EOF
9266 if { (eval echo configure:9267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9267 then
9268   ac_cv_func_getpgrp_void=yes
9269 else
9270   conftest_rc="$?"
9271   echo "configure: failed program was:" >&5
9272   cat conftest.$ac_ext >&5
9273   rm -fr conftest*
9274   ac_cv_func_getpgrp_void=no
9275 fi
9276 rm -fr conftest*
9277
9278
9279 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9280 if test $ac_cv_func_getpgrp_void = yes; then
9281   { test "$extra_verbose" = "yes" && cat << \EOF
9282     Defining GETPGRP_VOID
9283 EOF
9284 cat >> confdefs.h <<\EOF
9285 #define GETPGRP_VOID 1
9286 EOF
9287 }
9288
9289 fi
9290
9291
9292 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9293 echo "configure:9294: checking for working mmap" >&5
9294 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9295 cat > conftest.$ac_ext <<EOF
9296 #line 9297 "configure"
9297 #include "confdefs.h"
9298 #include <stdio.h>
9299 #include <unistd.h>
9300 #include <fcntl.h>
9301 #include <sys/mman.h>
9302
9303 #ifndef MAP_VARIABLE
9304 #define MAP_VARIABLE 0
9305 #endif
9306
9307 #ifndef MAP_FAILED
9308 #define MAP_FAILED -1
9309 #endif
9310
9311 int main (int argc, char *argv[])
9312 {
9313   int fd = -1;
9314   caddr_t p;
9315 #ifndef MAP_ANONYMOUS
9316   fd = open ("/dev/zero", O_RDWR);
9317   if (fd < 0)
9318     return 1;
9319 #define MAP_ANONYMOUS 0
9320 #endif
9321   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9322            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9323            fd, 0) != (void *) MAP_FAILED)
9324     return 0;
9325   perror ("conftest: mmap failed");
9326   return 1;
9327 }
9328 EOF
9329 if { (eval echo configure:9330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9330 then
9331   have_mmap=yes
9332 else
9333   conftest_rc="$?"
9334   echo "configure: failed program was:" >&5
9335   cat conftest.$ac_ext >&5
9336   rm -fr conftest*
9337   have_mmap=no
9338 fi
9339 rm -fr conftest* ;;
9340 esac
9341 echo "$ac_t""$have_mmap" 1>&6
9342 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9343     Defining HAVE_MMAP
9344 EOF
9345 cat >> confdefs.h <<\EOF
9346 #define HAVE_MMAP 1
9347 EOF
9348 }
9349
9350 for ac_hdr in unistd.h
9351 do
9352 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9353 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9354 echo "configure:9355: checking for $ac_hdr" >&5
9355
9356 cat > conftest.$ac_ext <<EOF
9357 #line 9358 "configure"
9358 #include "confdefs.h"
9359 #include <$ac_hdr>
9360 EOF
9361 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9362 { (eval echo configure:9363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9363 ac_err=`grep -v '^ *+' conftest.out`
9364 if test -z "$ac_err"; then
9365   rm -rf conftest*
9366   eval "ac_cv_header_$ac_safe=yes"
9367 else
9368   echo "$ac_err" >&5
9369   echo "configure: failed program was:" >&5
9370   cat conftest.$ac_ext >&5
9371   rm -rf conftest*
9372   eval "ac_cv_header_$ac_safe=no"
9373 fi
9374 rm -f conftest*
9375 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9376   echo "$ac_t""yes" 1>&6
9377     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9378   { test "$extra_verbose" = "yes" && cat << EOF
9379     Defining $ac_tr_hdr
9380 EOF
9381 cat >> confdefs.h <<EOF
9382 #define $ac_tr_hdr 1
9383 EOF
9384 }
9385  
9386 else
9387   echo "$ac_t""no" 1>&6
9388 fi
9389 done
9390
9391 for ac_func in getpagesize
9392 do
9393 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9394 echo "configure:9395: checking for $ac_func" >&5
9395
9396 cat > conftest.$ac_ext <<EOF
9397 #line 9398 "configure"
9398 #include "confdefs.h"
9399 /* System header to define __stub macros and hopefully few prototypes,
9400     which can conflict with char $ac_func(); below.  */
9401 #include <assert.h>
9402 /* Override any gcc2 internal prototype to avoid an error.  */
9403 /* We use char because int might match the return type of a gcc2
9404     builtin and then its argument prototype would still apply.  */
9405 char $ac_func();
9406
9407 int main() {
9408
9409 /* The GNU C library defines this for functions which it implements
9410     to always fail with ENOSYS.  Some functions are actually named
9411     something starting with __ and the normal name is an alias.  */
9412 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9413 choke me
9414 #else
9415 $ac_func();
9416 #endif
9417
9418 ; return 0; }
9419 EOF
9420 if { (eval echo configure:9421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9421   rm -rf conftest*
9422   eval "ac_cv_func_$ac_func=yes"
9423 else
9424   echo "configure: failed program was:" >&5
9425   cat conftest.$ac_ext >&5
9426   rm -rf conftest*
9427   eval "ac_cv_func_$ac_func=no"
9428 fi
9429 rm -f conftest*
9430
9431 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9432   echo "$ac_t""yes" 1>&6
9433     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9434   { test "$extra_verbose" = "yes" && cat << EOF
9435     Defining $ac_tr_func
9436 EOF
9437 cat >> confdefs.h <<EOF
9438 #define $ac_tr_func 1
9439 EOF
9440 }
9441  
9442 else
9443   echo "$ac_t""no" 1>&6
9444 fi
9445 done
9446
9447 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9448 echo "configure:9449: checking for working mmap" >&5
9449
9450 cat > conftest.$ac_ext <<EOF
9451 #line 9452 "configure"
9452 #include "confdefs.h"
9453
9454 /* Thanks to Mike Haertel and Jim Avera for this test.
9455    Here is a matrix of mmap possibilities:
9456         mmap private not fixed
9457         mmap private fixed at somewhere currently unmapped
9458         mmap private fixed at somewhere already mapped
9459         mmap shared not fixed
9460         mmap shared fixed at somewhere currently unmapped
9461         mmap shared fixed at somewhere already mapped
9462    For private mappings, we should verify that changes cannot be read()
9463    back from the file, nor mmap's back from the file at a different
9464    address.  (There have been systems where private was not correctly
9465    implemented like the infamous i386 svr4.0, and systems where the
9466    VM page cache was not coherent with the filesystem buffer cache
9467    like early versions of FreeBSD and possibly contemporary NetBSD.)
9468    For shared mappings, we should conversely verify that changes get
9469    propogated back to all the places they're supposed to be.
9470
9471    Grep wants private fixed already mapped.
9472    The main things grep needs to know about mmap are:
9473    * does it exist and is it safe to write into the mmap'd area
9474    * how to use it (BSD variants)  */
9475 #include <sys/types.h>
9476 #include <fcntl.h>
9477 #include <sys/mman.h>
9478
9479 /* This mess was copied from the GNU getpagesize.h.  */
9480 #ifndef HAVE_GETPAGESIZE
9481 # ifdef HAVE_UNISTD_H
9482 #  include <unistd.h>
9483 # endif
9484
9485 /* Assume that all systems that can run configure have sys/param.h.  */
9486 # ifndef HAVE_SYS_PARAM_H
9487 #  define HAVE_SYS_PARAM_H 1
9488 # endif
9489
9490 # ifdef _SC_PAGESIZE
9491 #  define getpagesize() sysconf(_SC_PAGESIZE)
9492 # else /* no _SC_PAGESIZE */
9493 #  ifdef HAVE_SYS_PARAM_H
9494 #   include <sys/param.h>
9495 #   ifdef EXEC_PAGESIZE
9496 #    define getpagesize() EXEC_PAGESIZE
9497 #   else /* no EXEC_PAGESIZE */
9498 #    ifdef NBPG
9499 #     define getpagesize() NBPG * CLSIZE
9500 #     ifndef CLSIZE
9501 #      define CLSIZE 1
9502 #     endif /* no CLSIZE */
9503 #    else /* no NBPG */
9504 #     ifdef NBPC
9505 #      define getpagesize() NBPC
9506 #     else /* no NBPC */
9507 #      ifdef PAGESIZE
9508 #       define getpagesize() PAGESIZE
9509 #      endif /* PAGESIZE */
9510 #     endif /* no NBPC */
9511 #    endif /* no NBPG */
9512 #   endif /* no EXEC_PAGESIZE */
9513 #  else /* no HAVE_SYS_PARAM_H */
9514 #   define getpagesize() 8192   /* punt totally */
9515 #  endif /* no HAVE_SYS_PARAM_H */
9516 # endif /* no _SC_PAGESIZE */
9517
9518 #endif /* no HAVE_GETPAGESIZE */
9519
9520 #ifdef __cplusplus
9521 extern "C" { void *malloc(unsigned); }
9522 #else
9523 char *malloc();
9524 #endif
9525
9526 int
9527 main()
9528 {
9529         char *data, *data2, *data3;
9530         int i, pagesize;
9531         int fd;
9532
9533         pagesize = getpagesize();
9534
9535         /*
9536          * First, make a file with some known garbage in it.
9537          */
9538         data = malloc(pagesize);
9539         if (!data)
9540                 exit(1);
9541         for (i = 0; i < pagesize; ++i)
9542                 *(data + i) = rand();
9543         umask(0);
9544         fd = creat("conftestmmap", 0600);
9545         if (fd < 0)
9546                 exit(1);
9547         if (write(fd, data, pagesize) != pagesize)
9548                 exit(1);
9549         close(fd);
9550
9551         /*
9552          * Next, try to mmap the file at a fixed address which
9553          * already has something else allocated at it.  If we can,
9554          * also make sure that we see the same garbage.
9555          */
9556         fd = open("conftestmmap", O_RDWR);
9557         if (fd < 0)
9558                 exit(1);
9559         data2 = malloc(2 * pagesize);
9560         if (!data2)
9561                 exit(1);
9562         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
9563         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
9564             MAP_PRIVATE | MAP_FIXED, fd, 0L))
9565                 exit(1);
9566         for (i = 0; i < pagesize; ++i)
9567                 if (*(data + i) != *(data2 + i))
9568                         exit(1);
9569
9570         /*
9571          * Finally, make sure that changes to the mapped area
9572          * do not percolate back to the file as seen by read().
9573          * (This is a bug on some variants of i386 svr4.0.)
9574          */
9575         for (i = 0; i < pagesize; ++i)
9576                 *(data2 + i) = *(data2 + i) + 1;
9577         data3 = malloc(pagesize);
9578         if (!data3)
9579                 exit(1);
9580         if (read(fd, data3, pagesize) != pagesize)
9581                 exit(1);
9582         for (i = 0; i < pagesize; ++i)
9583                 if (*(data + i) != *(data3 + i))
9584                         exit(1);
9585         close(fd);
9586         unlink("conftestmmap");
9587         exit(0);
9588 }
9589
9590 EOF
9591 if { (eval echo configure:9592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9592 then
9593   ac_cv_func_mmap_fixed_mapped=yes
9594 else
9595   conftest_rc="$?"
9596   echo "configure: failed program was:" >&5
9597   cat conftest.$ac_ext >&5
9598   rm -fr conftest*
9599   ac_cv_func_mmap_fixed_mapped=no
9600 fi
9601 rm -fr conftest*
9602
9603 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
9604 if test $ac_cv_func_mmap_fixed_mapped = yes; then
9605   { test "$extra_verbose" = "yes" && cat << \EOF
9606     Defining HAVE_MMAP
9607 EOF
9608 cat >> confdefs.h <<\EOF
9609 #define HAVE_MMAP 1
9610 EOF
9611 }
9612
9613 fi
9614
9615
9616 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9617 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9618 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9619     Defining REL_ALLOC
9620 EOF
9621 cat >> confdefs.h <<\EOF
9622 #define REL_ALLOC 1
9623 EOF
9624 }
9625
9626
9627 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
9628 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
9629 echo "configure:9630: checking for termios.h" >&5
9630
9631 cat > conftest.$ac_ext <<EOF
9632 #line 9633 "configure"
9633 #include "confdefs.h"
9634 #include <termios.h>
9635 EOF
9636 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9637 { (eval echo configure:9638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9638 ac_err=`grep -v '^ *+' conftest.out`
9639 if test -z "$ac_err"; then
9640   rm -rf conftest*
9641   eval "ac_cv_header_$ac_safe=yes"
9642 else
9643   echo "$ac_err" >&5
9644   echo "configure: failed program was:" >&5
9645   cat conftest.$ac_ext >&5
9646   rm -rf conftest*
9647   eval "ac_cv_header_$ac_safe=no"
9648 fi
9649 rm -f conftest*
9650 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9651   echo "$ac_t""yes" 1>&6
9652   { test "$extra_verbose" = "yes" && cat << \EOF
9653     Defining HAVE_TERMIOS
9654 EOF
9655 cat >> confdefs.h <<\EOF
9656 #define HAVE_TERMIOS 1
9657 EOF
9658 }
9659
9660   { test "$extra_verbose" = "yes" && cat << \EOF
9661     Defining SIGNALS_VIA_CHARACTERS
9662 EOF
9663 cat >> confdefs.h <<\EOF
9664 #define SIGNALS_VIA_CHARACTERS 1
9665 EOF
9666 }
9667
9668   { test "$extra_verbose" = "yes" && cat << \EOF
9669     Defining NO_TERMIO
9670 EOF
9671 cat >> confdefs.h <<\EOF
9672 #define NO_TERMIO 1
9673 EOF
9674 }
9675
9676 else
9677   echo "$ac_t""no" 1>&6
9678 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
9679 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
9680 echo "configure:9681: checking for termio.h" >&5
9681
9682 cat > conftest.$ac_ext <<EOF
9683 #line 9684 "configure"
9684 #include "confdefs.h"
9685 #include <termio.h>
9686 EOF
9687 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9688 { (eval echo configure:9689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9689 ac_err=`grep -v '^ *+' conftest.out`
9690 if test -z "$ac_err"; then
9691   rm -rf conftest*
9692   eval "ac_cv_header_$ac_safe=yes"
9693 else
9694   echo "$ac_err" >&5
9695   echo "configure: failed program was:" >&5
9696   cat conftest.$ac_ext >&5
9697   rm -rf conftest*
9698   eval "ac_cv_header_$ac_safe=no"
9699 fi
9700 rm -f conftest*
9701 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9702   echo "$ac_t""yes" 1>&6
9703   { test "$extra_verbose" = "yes" && cat << \EOF
9704     Defining HAVE_TERMIO
9705 EOF
9706 cat >> confdefs.h <<\EOF
9707 #define HAVE_TERMIO 1
9708 EOF
9709 }
9710
9711 else
9712   echo "$ac_t""no" 1>&6
9713 fi
9714
9715 fi
9716
9717
9718
9719 echo $ac_n "checking for socket""... $ac_c" 1>&6
9720 echo "configure:9721: checking for socket" >&5
9721
9722 cat > conftest.$ac_ext <<EOF
9723 #line 9724 "configure"
9724 #include "confdefs.h"
9725 /* System header to define __stub macros and hopefully few prototypes,
9726     which can conflict with char socket(); below.  */
9727 #include <assert.h>
9728 /* Override any gcc2 internal prototype to avoid an error.  */
9729 /* We use char because int might match the return type of a gcc2
9730     builtin and then its argument prototype would still apply.  */
9731 char socket();
9732
9733 int main() {
9734
9735 /* The GNU C library defines this for functions which it implements
9736     to always fail with ENOSYS.  Some functions are actually named
9737     something starting with __ and the normal name is an alias.  */
9738 #if defined (__stub_socket) || defined (__stub___socket)
9739 choke me
9740 #else
9741 socket();
9742 #endif
9743
9744 ; return 0; }
9745 EOF
9746 if { (eval echo configure:9747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9747   rm -rf conftest*
9748   eval "ac_cv_func_socket=yes"
9749 else
9750   echo "configure: failed program was:" >&5
9751   cat conftest.$ac_ext >&5
9752   rm -rf conftest*
9753   eval "ac_cv_func_socket=no"
9754 fi
9755 rm -f conftest*
9756
9757 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9758   echo "$ac_t""yes" 1>&6
9759   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
9760 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
9761 echo "configure:9762: checking for netinet/in.h" >&5
9762
9763 cat > conftest.$ac_ext <<EOF
9764 #line 9765 "configure"
9765 #include "confdefs.h"
9766 #include <netinet/in.h>
9767 EOF
9768 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9769 { (eval echo configure:9770: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9770 ac_err=`grep -v '^ *+' conftest.out`
9771 if test -z "$ac_err"; then
9772   rm -rf conftest*
9773   eval "ac_cv_header_$ac_safe=yes"
9774 else
9775   echo "$ac_err" >&5
9776   echo "configure: failed program was:" >&5
9777   cat conftest.$ac_ext >&5
9778   rm -rf conftest*
9779   eval "ac_cv_header_$ac_safe=no"
9780 fi
9781 rm -f conftest*
9782 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9783   echo "$ac_t""yes" 1>&6
9784   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
9785 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
9786 echo "configure:9787: checking for arpa/inet.h" >&5
9787
9788 cat > conftest.$ac_ext <<EOF
9789 #line 9790 "configure"
9790 #include "confdefs.h"
9791 #include <arpa/inet.h>
9792 EOF
9793 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9794 { (eval echo configure:9795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9795 ac_err=`grep -v '^ *+' conftest.out`
9796 if test -z "$ac_err"; then
9797   rm -rf conftest*
9798   eval "ac_cv_header_$ac_safe=yes"
9799 else
9800   echo "$ac_err" >&5
9801   echo "configure: failed program was:" >&5
9802   cat conftest.$ac_ext >&5
9803   rm -rf conftest*
9804   eval "ac_cv_header_$ac_safe=no"
9805 fi
9806 rm -f conftest*
9807 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9808   echo "$ac_t""yes" 1>&6
9809   
9810   { test "$extra_verbose" = "yes" && cat << \EOF
9811     Defining HAVE_SOCKETS
9812 EOF
9813 cat >> confdefs.h <<\EOF
9814 #define HAVE_SOCKETS 1
9815 EOF
9816 }
9817
9818       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
9819 echo "configure:9820: checking "for sun_len member in struct sockaddr_un"" >&5
9820       cat > conftest.$ac_ext <<EOF
9821 #line 9822 "configure"
9822 #include "confdefs.h"
9823
9824 #include <sys/types.h>
9825 #include <sys/socket.h>
9826 #include <sys/un.h>
9827       
9828 int main() {
9829 static struct sockaddr_un x; x.sun_len = 1;
9830 ; return 0; }
9831 EOF
9832 if { (eval echo configure:9833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9833   rm -rf conftest*
9834   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
9835     Defining HAVE_SOCKADDR_SUN_LEN
9836 EOF
9837 cat >> confdefs.h <<\EOF
9838 #define HAVE_SOCKADDR_SUN_LEN 1
9839 EOF
9840 }
9841
9842 else
9843   echo "configure: failed program was:" >&5
9844   cat conftest.$ac_ext >&5
9845   rm -rf conftest*
9846   echo "$ac_t""no" 1>&6
9847 fi
9848 rm -f conftest*
9849       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
9850 echo "configure:9851: checking "for ip_mreq struct in netinet/in.h"" >&5
9851       cat > conftest.$ac_ext <<EOF
9852 #line 9853 "configure"
9853 #include "confdefs.h"
9854
9855 #include <sys/types.h>
9856 #include <netinet/in.h>
9857       
9858 int main() {
9859 static struct ip_mreq x;
9860 ; return 0; }
9861 EOF
9862 if { (eval echo configure:9863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9863   rm -rf conftest*
9864   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
9865     Defining HAVE_MULTICAST
9866 EOF
9867 cat >> confdefs.h <<\EOF
9868 #define HAVE_MULTICAST 1
9869 EOF
9870 }
9871
9872 else
9873   echo "configure: failed program was:" >&5
9874   cat conftest.$ac_ext >&5
9875   rm -rf conftest*
9876   echo "$ac_t""no" 1>&6
9877 fi
9878 rm -f conftest*
9879 else
9880   echo "$ac_t""no" 1>&6
9881 fi
9882
9883 else
9884   echo "$ac_t""no" 1>&6
9885 fi
9886
9887 else
9888   echo "$ac_t""no" 1>&6
9889 fi
9890
9891
9892 echo $ac_n "checking for msgget""... $ac_c" 1>&6
9893 echo "configure:9894: checking for msgget" >&5
9894
9895 cat > conftest.$ac_ext <<EOF
9896 #line 9897 "configure"
9897 #include "confdefs.h"
9898 /* System header to define __stub macros and hopefully few prototypes,
9899     which can conflict with char msgget(); below.  */
9900 #include <assert.h>
9901 /* Override any gcc2 internal prototype to avoid an error.  */
9902 /* We use char because int might match the return type of a gcc2
9903     builtin and then its argument prototype would still apply.  */
9904 char msgget();
9905
9906 int main() {
9907
9908 /* The GNU C library defines this for functions which it implements
9909     to always fail with ENOSYS.  Some functions are actually named
9910     something starting with __ and the normal name is an alias.  */
9911 #if defined (__stub_msgget) || defined (__stub___msgget)
9912 choke me
9913 #else
9914 msgget();
9915 #endif
9916
9917 ; return 0; }
9918 EOF
9919 if { (eval echo configure:9920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9920   rm -rf conftest*
9921   eval "ac_cv_func_msgget=yes"
9922 else
9923   echo "configure: failed program was:" >&5
9924   cat conftest.$ac_ext >&5
9925   rm -rf conftest*
9926   eval "ac_cv_func_msgget=no"
9927 fi
9928 rm -f conftest*
9929
9930 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
9931   echo "$ac_t""yes" 1>&6
9932   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
9933 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
9934 echo "configure:9935: checking for sys/ipc.h" >&5
9935
9936 cat > conftest.$ac_ext <<EOF
9937 #line 9938 "configure"
9938 #include "confdefs.h"
9939 #include <sys/ipc.h>
9940 EOF
9941 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9942 { (eval echo configure:9943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9943 ac_err=`grep -v '^ *+' conftest.out`
9944 if test -z "$ac_err"; then
9945   rm -rf conftest*
9946   eval "ac_cv_header_$ac_safe=yes"
9947 else
9948   echo "$ac_err" >&5
9949   echo "configure: failed program was:" >&5
9950   cat conftest.$ac_ext >&5
9951   rm -rf conftest*
9952   eval "ac_cv_header_$ac_safe=no"
9953 fi
9954 rm -f conftest*
9955 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9956   echo "$ac_t""yes" 1>&6
9957   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
9958 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
9959 echo "configure:9960: checking for sys/msg.h" >&5
9960
9961 cat > conftest.$ac_ext <<EOF
9962 #line 9963 "configure"
9963 #include "confdefs.h"
9964 #include <sys/msg.h>
9965 EOF
9966 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9967 { (eval echo configure:9968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9968 ac_err=`grep -v '^ *+' conftest.out`
9969 if test -z "$ac_err"; then
9970   rm -rf conftest*
9971   eval "ac_cv_header_$ac_safe=yes"
9972 else
9973   echo "$ac_err" >&5
9974   echo "configure: failed program was:" >&5
9975   cat conftest.$ac_ext >&5
9976   rm -rf conftest*
9977   eval "ac_cv_header_$ac_safe=no"
9978 fi
9979 rm -f conftest*
9980 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9981   echo "$ac_t""yes" 1>&6
9982   { test "$extra_verbose" = "yes" && cat << \EOF
9983     Defining HAVE_SYSVIPC
9984 EOF
9985 cat >> confdefs.h <<\EOF
9986 #define HAVE_SYSVIPC 1
9987 EOF
9988 }
9989
9990 else
9991   echo "$ac_t""no" 1>&6
9992 fi
9993
9994 else
9995   echo "$ac_t""no" 1>&6
9996 fi
9997
9998 else
9999   echo "$ac_t""no" 1>&6
10000 fi
10001
10002
10003 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10004 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10005 echo "configure:10006: checking for dirent.h" >&5
10006
10007 cat > conftest.$ac_ext <<EOF
10008 #line 10009 "configure"
10009 #include "confdefs.h"
10010 #include <dirent.h>
10011 EOF
10012 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10013 { (eval echo configure:10014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10014 ac_err=`grep -v '^ *+' conftest.out`
10015 if test -z "$ac_err"; then
10016   rm -rf conftest*
10017   eval "ac_cv_header_$ac_safe=yes"
10018 else
10019   echo "$ac_err" >&5
10020   echo "configure: failed program was:" >&5
10021   cat conftest.$ac_ext >&5
10022   rm -rf conftest*
10023   eval "ac_cv_header_$ac_safe=no"
10024 fi
10025 rm -f conftest*
10026 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10027   echo "$ac_t""yes" 1>&6
10028   { test "$extra_verbose" = "yes" && cat << \EOF
10029     Defining SYSV_SYSTEM_DIR
10030 EOF
10031 cat >> confdefs.h <<\EOF
10032 #define SYSV_SYSTEM_DIR 1
10033 EOF
10034 }
10035
10036 else
10037   echo "$ac_t""no" 1>&6
10038 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10039 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10040 echo "configure:10041: checking for sys/dir.h" >&5
10041
10042 cat > conftest.$ac_ext <<EOF
10043 #line 10044 "configure"
10044 #include "confdefs.h"
10045 #include <sys/dir.h>
10046 EOF
10047 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10048 { (eval echo configure:10049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10049 ac_err=`grep -v '^ *+' conftest.out`
10050 if test -z "$ac_err"; then
10051   rm -rf conftest*
10052   eval "ac_cv_header_$ac_safe=yes"
10053 else
10054   echo "$ac_err" >&5
10055   echo "configure: failed program was:" >&5
10056   cat conftest.$ac_ext >&5
10057   rm -rf conftest*
10058   eval "ac_cv_header_$ac_safe=no"
10059 fi
10060 rm -f conftest*
10061 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10062   echo "$ac_t""yes" 1>&6
10063   :
10064 else
10065   echo "$ac_t""no" 1>&6
10066 { test "$extra_verbose" = "yes" && cat << \EOF
10067     Defining NONSYSTEM_DIR_LIBRARY
10068 EOF
10069 cat >> confdefs.h <<\EOF
10070 #define NONSYSTEM_DIR_LIBRARY 1
10071 EOF
10072 }
10073
10074 fi
10075
10076 fi
10077
10078
10079 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10080 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10081 echo "configure:10082: checking for nlist.h" >&5
10082
10083 cat > conftest.$ac_ext <<EOF
10084 #line 10085 "configure"
10085 #include "confdefs.h"
10086 #include <nlist.h>
10087 EOF
10088 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10089 { (eval echo configure:10090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10090 ac_err=`grep -v '^ *+' conftest.out`
10091 if test -z "$ac_err"; then
10092   rm -rf conftest*
10093   eval "ac_cv_header_$ac_safe=yes"
10094 else
10095   echo "$ac_err" >&5
10096   echo "configure: failed program was:" >&5
10097   cat conftest.$ac_ext >&5
10098   rm -rf conftest*
10099   eval "ac_cv_header_$ac_safe=no"
10100 fi
10101 rm -f conftest*
10102 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10103   echo "$ac_t""yes" 1>&6
10104   { test "$extra_verbose" = "yes" && cat << \EOF
10105     Defining NLIST_STRUCT
10106 EOF
10107 cat >> confdefs.h <<\EOF
10108 #define NLIST_STRUCT 1
10109 EOF
10110 }
10111
10112 else
10113   echo "$ac_t""no" 1>&6
10114 fi
10115
10116
10117
10118 echo "checking "for sound support"" 1>&6
10119 echo "configure:10120: checking "for sound support"" >&5
10120 case "$with_sound" in
10121   native | both ) with_native_sound=yes;;
10122   nas    | no   ) with_native_sound=no;;
10123 esac
10124 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10125
10126 if test "$with_native_sound" != "no"; then
10127     if test -n "$native_sound_lib"; then
10128     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10129 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10130 echo "configure:10131: checking for multimedia/audio_device.h" >&5
10131
10132 cat > conftest.$ac_ext <<EOF
10133 #line 10134 "configure"
10134 #include "confdefs.h"
10135 #include <multimedia/audio_device.h>
10136 EOF
10137 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10138 { (eval echo configure:10139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10139 ac_err=`grep -v '^ *+' conftest.out`
10140 if test -z "$ac_err"; then
10141   rm -rf conftest*
10142   eval "ac_cv_header_$ac_safe=yes"
10143 else
10144   echo "$ac_err" >&5
10145   echo "configure: failed program was:" >&5
10146   cat conftest.$ac_ext >&5
10147   rm -rf conftest*
10148   eval "ac_cv_header_$ac_safe=no"
10149 fi
10150 rm -f conftest*
10151 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10152   echo "$ac_t""yes" 1>&6
10153   sound_found=yes sound_cflags=""
10154       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10155    echo "    xemacs will be linked with \"sunplay.o\""
10156  fi
10157 else
10158   echo "$ac_t""no" 1>&6
10159 fi
10160
10161   fi
10162
10163     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10164     sound_found=yes
10165     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10166    echo "    xemacs will be linked with \"sunplay.o\""
10167  fi
10168     if test -d "/usr/demo/SOUND/include"
10169       then sound_cflags="-I/usr/demo/SOUND/include"
10170       else sound_cflags="-I/usr/demo/SOUND"
10171     fi
10172     if test -z "$native_sound_lib" ; then
10173       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10174         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10175         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10176       fi
10177     fi
10178   fi
10179
10180     if test -z "$sound_found"; then
10181     case "$canonical" in
10182     *-sgi-* )
10183       if test -z "$native_sound_lib"; then
10184         
10185 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10186 echo "configure:10187: checking for ALopenport in -laudio" >&5
10187 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10188
10189 xe_check_libs=" -laudio "
10190 cat > conftest.$ac_ext <<EOF
10191 #line 10192 "configure"
10192 #include "confdefs.h"
10193 /* Override any gcc2 internal prototype to avoid an error.  */
10194 /* We use char because int might match the return type of a gcc2
10195     builtin and then its argument prototype would still apply.  */
10196 char ALopenport();
10197
10198 int main() {
10199 ALopenport()
10200 ; return 0; }
10201 EOF
10202 if { (eval echo configure:10203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10203   rm -rf conftest*
10204   eval "ac_cv_lib_$ac_lib_var=yes"
10205 else
10206   echo "configure: failed program was:" >&5
10207   cat conftest.$ac_ext >&5
10208   rm -rf conftest*
10209   eval "ac_cv_lib_$ac_lib_var=no"
10210 fi
10211 rm -f conftest*
10212 xe_check_libs=""
10213
10214 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10215   echo "$ac_t""yes" 1>&6
10216   native_sound_lib="-laudio"
10217 else
10218   echo "$ac_t""no" 1>&6
10219 fi
10220
10221
10222       fi
10223       if test -n "$native_sound_lib"; then
10224         sound_found=yes sound_cflags=""
10225         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10226    echo "    xemacs will be linked with \"sgiplay.o\""
10227  fi
10228       fi ;;
10229     hppa*-hp-hpux* )
10230       if test -z "$native_sound_lib"; then
10231         
10232 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10233 echo "configure:10234: checking for AOpenAudio in -lAlib" >&5
10234 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10235
10236 xe_check_libs=" -lAlib "
10237 cat > conftest.$ac_ext <<EOF
10238 #line 10239 "configure"
10239 #include "confdefs.h"
10240 /* Override any gcc2 internal prototype to avoid an error.  */
10241 /* We use char because int might match the return type of a gcc2
10242     builtin and then its argument prototype would still apply.  */
10243 char AOpenAudio();
10244
10245 int main() {
10246 AOpenAudio()
10247 ; return 0; }
10248 EOF
10249 if { (eval echo configure:10250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10250   rm -rf conftest*
10251   eval "ac_cv_lib_$ac_lib_var=yes"
10252 else
10253   echo "configure: failed program was:" >&5
10254   cat conftest.$ac_ext >&5
10255   rm -rf conftest*
10256   eval "ac_cv_lib_$ac_lib_var=no"
10257 fi
10258 rm -f conftest*
10259 xe_check_libs=""
10260
10261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10262   echo "$ac_t""yes" 1>&6
10263   native_sound_lib="-lAlib"
10264 else
10265   echo "$ac_t""no" 1>&6
10266 fi
10267
10268
10269       fi
10270       if test -n "$native_sound_lib"; then
10271         sound_found=yes
10272         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10273    echo "    xemacs will be linked with \"hpplay.o\""
10274  fi
10275         if test "$GCC" = "yes" # Kludge city
10276           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10277           else sound_cflags="+e -I/usr/audio/examples"
10278         fi
10279       fi ;;
10280     esac
10281   fi
10282
10283     if test -z "$sound_found"; then
10284     for dir in "machine" "sys" "linux"; do
10285       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10286 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10287 echo "configure:10288: checking for ${dir}/soundcard.h" >&5
10288
10289 cat > conftest.$ac_ext <<EOF
10290 #line 10291 "configure"
10291 #include "confdefs.h"
10292 #include <${dir}/soundcard.h>
10293 EOF
10294 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10295 { (eval echo configure:10296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10296 ac_err=`grep -v '^ *+' conftest.out`
10297 if test -z "$ac_err"; then
10298   rm -rf conftest*
10299   eval "ac_cv_header_$ac_safe=yes"
10300 else
10301   echo "$ac_err" >&5
10302   echo "configure: failed program was:" >&5
10303   cat conftest.$ac_ext >&5
10304   rm -rf conftest*
10305   eval "ac_cv_header_$ac_safe=no"
10306 fi
10307 rm -f conftest*
10308 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10309   echo "$ac_t""yes" 1>&6
10310   sound_found=yes
10311         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10312    echo "    xemacs will be linked with \"linuxplay.o\""
10313  fi
10314         { test "$extra_verbose" = "yes" && cat << EOF
10315     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10316 EOF
10317 cat >> confdefs.h <<EOF
10318 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10319 EOF
10320 }
10321
10322         break
10323 else
10324   echo "$ac_t""no" 1>&6
10325 fi
10326
10327     done
10328   fi
10329
10330   test "$sound_found" = "yes" && with_native_sound=yes
10331 fi
10332
10333 if test -z "$with_sound"; then
10334   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10335     with_sound=native
10336   fi
10337 fi
10338
10339 if test "$with_native_sound" = "yes"; then
10340   { test "$extra_verbose" = "yes" && cat << \EOF
10341     Defining HAVE_NATIVE_SOUND
10342 EOF
10343 cat >> confdefs.h <<\EOF
10344 #define HAVE_NATIVE_SOUND 1
10345 EOF
10346 }
10347
10348   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10349 fi
10350
10351 case "$with_sound" in both | nas )
10352   { test "$extra_verbose" = "yes" && cat << \EOF
10353     Defining HAVE_NAS_SOUND
10354 EOF
10355 cat >> confdefs.h <<\EOF
10356 #define HAVE_NAS_SOUND 1
10357 EOF
10358 }
10359
10360   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10361    echo "    xemacs will be linked with \"nas.o\""
10362  fi
10363   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10364       cat > conftest.$ac_ext <<EOF
10365 #line 10366 "configure"
10366 #include "confdefs.h"
10367 #include <audio/Xtutil.h>
10368 EOF
10369 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10370   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10371   :
10372 else
10373   rm -rf conftest*
10374   { test "$extra_verbose" = "yes" && cat << \EOF
10375     Defining NAS_NO_ERROR_JUMP
10376 EOF
10377 cat >> confdefs.h <<\EOF
10378 #define NAS_NO_ERROR_JUMP 1
10379 EOF
10380 }
10381
10382 fi
10383 rm -f conftest*
10384
10385 esac
10386
10387
10388 test -z "$with_tty" && with_tty=yes
10389
10390 if test "$with_tty" = "yes"  ; then
10391   echo "checking for TTY-related features" 1>&6
10392 echo "configure:10393: checking for TTY-related features" >&5
10393   { test "$extra_verbose" = "yes" && cat << \EOF
10394     Defining HAVE_TTY
10395 EOF
10396 cat >> confdefs.h <<\EOF
10397 #define HAVE_TTY 1
10398 EOF
10399 }
10400
10401   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
10402    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\""
10403  fi
10404
10405     if test -z "$with_ncurses"; then
10406     
10407 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10408 echo "configure:10409: checking for tgetent in -lncurses" >&5
10409 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10410
10411 xe_check_libs=" -lncurses "
10412 cat > conftest.$ac_ext <<EOF
10413 #line 10414 "configure"
10414 #include "confdefs.h"
10415 /* Override any gcc2 internal prototype to avoid an error.  */
10416 /* We use char because int might match the return type of a gcc2
10417     builtin and then its argument prototype would still apply.  */
10418 char tgetent();
10419
10420 int main() {
10421 tgetent()
10422 ; return 0; }
10423 EOF
10424 if { (eval echo configure:10425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10425   rm -rf conftest*
10426   eval "ac_cv_lib_$ac_lib_var=yes"
10427 else
10428   echo "configure: failed program was:" >&5
10429   cat conftest.$ac_ext >&5
10430   rm -rf conftest*
10431   eval "ac_cv_lib_$ac_lib_var=no"
10432 fi
10433 rm -f conftest*
10434 xe_check_libs=""
10435
10436 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10437   echo "$ac_t""yes" 1>&6
10438   with_ncurses=yes
10439 else
10440   echo "$ac_t""no" 1>&6
10441 with_ncurses=no
10442 fi
10443
10444
10445   fi
10446   if test "$with_ncurses" = "yes"; then
10447     { test "$extra_verbose" = "yes" && cat << \EOF
10448     Defining HAVE_NCURSES
10449 EOF
10450 cat >> confdefs.h <<\EOF
10451 #define HAVE_NCURSES 1
10452 EOF
10453 }
10454
10455     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10456 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10457 echo "configure:10458: checking for ncurses/curses.h" >&5
10458
10459 cat > conftest.$ac_ext <<EOF
10460 #line 10461 "configure"
10461 #include "confdefs.h"
10462 #include <ncurses/curses.h>
10463 EOF
10464 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10465 { (eval echo configure:10466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10466 ac_err=`grep -v '^ *+' conftest.out`
10467 if test -z "$ac_err"; then
10468   rm -rf conftest*
10469   eval "ac_cv_header_$ac_safe=yes"
10470 else
10471   echo "$ac_err" >&5
10472   echo "configure: failed program was:" >&5
10473   cat conftest.$ac_ext >&5
10474   rm -rf conftest*
10475   eval "ac_cv_header_$ac_safe=no"
10476 fi
10477 rm -f conftest*
10478 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10479   echo "$ac_t""yes" 1>&6
10480   curses_h_path=ncurses/curses.h
10481 else
10482   echo "$ac_t""no" 1>&6
10483 fi
10484
10485     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10486 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10487 echo "configure:10488: checking for ncurses/term.h" >&5
10488
10489 cat > conftest.$ac_ext <<EOF
10490 #line 10491 "configure"
10491 #include "confdefs.h"
10492 #include <ncurses/term.h>
10493 EOF
10494 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10495 { (eval echo configure:10496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10496 ac_err=`grep -v '^ *+' conftest.out`
10497 if test -z "$ac_err"; then
10498   rm -rf conftest*
10499   eval "ac_cv_header_$ac_safe=yes"
10500 else
10501   echo "$ac_err" >&5
10502   echo "configure: failed program was:" >&5
10503   cat conftest.$ac_ext >&5
10504   rm -rf conftest*
10505   eval "ac_cv_header_$ac_safe=no"
10506 fi
10507 rm -f conftest*
10508 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10509   echo "$ac_t""yes" 1>&6
10510   term_h_path=ncurses/term.h
10511 else
10512   echo "$ac_t""no" 1>&6
10513 fi
10514
10515     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10516    echo "    xemacs will be linked with \"terminfo.o\""
10517  fi
10518     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10519
10520     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10521                         save_c_switch_site="$c_switch_site"
10522       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10523       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10524 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10525 echo "configure:10526: checking for ncurses/curses.h" >&5
10526
10527 cat > conftest.$ac_ext <<EOF
10528 #line 10529 "configure"
10529 #include "confdefs.h"
10530 #include <ncurses/curses.h>
10531 EOF
10532 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10533 { (eval echo configure:10534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10534 ac_err=`grep -v '^ *+' conftest.out`
10535 if test -z "$ac_err"; then
10536   rm -rf conftest*
10537   eval "ac_cv_header_$ac_safe=yes"
10538 else
10539   echo "$ac_err" >&5
10540   echo "configure: failed program was:" >&5
10541   cat conftest.$ac_ext >&5
10542   rm -rf conftest*
10543   eval "ac_cv_header_$ac_safe=no"
10544 fi
10545 rm -f conftest*
10546 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10547   echo "$ac_t""yes" 1>&6
10548   curses_h_path=ncurses/curses.h
10549 else
10550   echo "$ac_t""no" 1>&6
10551 fi
10552
10553       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10554         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10555         else c_switch_site="$save_c_switch_site"
10556       fi
10557     fi
10558   else         if test "$have_terminfo" = "yes"; then
10559       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10560    echo "    xemacs will be linked with \"terminfo.o\""
10561  fi
10562       if test -n "$libs_termcap"; then
10563         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10564       else
10565         for lib in curses termlib termcap; do
10566           
10567 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10568 echo "configure:10569: checking for tgetent in -l$lib" >&5
10569 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10570
10571 xe_check_libs=" -l$lib "
10572 cat > conftest.$ac_ext <<EOF
10573 #line 10574 "configure"
10574 #include "confdefs.h"
10575 /* Override any gcc2 internal prototype to avoid an error.  */
10576 /* We use char because int might match the return type of a gcc2
10577     builtin and then its argument prototype would still apply.  */
10578 char tgetent();
10579
10580 int main() {
10581 tgetent()
10582 ; return 0; }
10583 EOF
10584 if { (eval echo configure:10585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10585   rm -rf conftest*
10586   eval "ac_cv_lib_$ac_lib_var=yes"
10587 else
10588   echo "configure: failed program was:" >&5
10589   cat conftest.$ac_ext >&5
10590   rm -rf conftest*
10591   eval "ac_cv_lib_$ac_lib_var=no"
10592 fi
10593 rm -f conftest*
10594 xe_check_libs=""
10595
10596 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10597   echo "$ac_t""yes" 1>&6
10598   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10599 else
10600   echo "$ac_t""no" 1>&6
10601 fi
10602
10603
10604         done
10605       fi
10606     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10607    echo "    xemacs will be linked with \"tparam.o\""
10608  fi
10609                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10610       if test -n "$libs_termcap"; then
10611         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10612       else
10613         
10614 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10615 echo "configure:10616: checking for tgetent in -lcurses" >&5
10616 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10617
10618 xe_check_libs=" -lcurses "
10619 cat > conftest.$ac_ext <<EOF
10620 #line 10621 "configure"
10621 #include "confdefs.h"
10622 /* Override any gcc2 internal prototype to avoid an error.  */
10623 /* We use char because int might match the return type of a gcc2
10624     builtin and then its argument prototype would still apply.  */
10625 char tgetent();
10626
10627 int main() {
10628 tgetent()
10629 ; return 0; }
10630 EOF
10631 if { (eval echo configure:10632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10632   rm -rf conftest*
10633   eval "ac_cv_lib_$ac_lib_var=yes"
10634 else
10635   echo "configure: failed program was:" >&5
10636   cat conftest.$ac_ext >&5
10637   rm -rf conftest*
10638   eval "ac_cv_lib_$ac_lib_var=no"
10639 fi
10640 rm -f conftest*
10641 xe_check_libs=""
10642
10643 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10644   echo "$ac_t""yes" 1>&6
10645   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
10646 else
10647   echo "$ac_t""no" 1>&6
10648 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
10649 echo "configure:10650: checking for tgetent in -ltermcap" >&5
10650 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
10651
10652 xe_check_libs=" -ltermcap "
10653 cat > conftest.$ac_ext <<EOF
10654 #line 10655 "configure"
10655 #include "confdefs.h"
10656 /* Override any gcc2 internal prototype to avoid an error.  */
10657 /* We use char because int might match the return type of a gcc2
10658     builtin and then its argument prototype would still apply.  */
10659 char tgetent();
10660
10661 int main() {
10662 tgetent()
10663 ; return 0; }
10664 EOF
10665 if { (eval echo configure:10666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10666   rm -rf conftest*
10667   eval "ac_cv_lib_$ac_lib_var=yes"
10668 else
10669   echo "configure: failed program was:" >&5
10670   cat conftest.$ac_ext >&5
10671   rm -rf conftest*
10672   eval "ac_cv_lib_$ac_lib_var=no"
10673 fi
10674 rm -f conftest*
10675 xe_check_libs=""
10676
10677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10678   echo "$ac_t""yes" 1>&6
10679   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
10680 else
10681   echo "$ac_t""no" 1>&6
10682 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
10683    echo "    xemacs will be linked with \"termcap.o\""
10684  fi
10685 fi
10686
10687
10688 fi
10689
10690
10691       fi
10692     fi
10693   fi
10694   { test "$extra_verbose" = "yes" && cat << EOF
10695     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
10696 EOF
10697 cat >> confdefs.h <<EOF
10698 #define CURSES_H_PATH "${curses_h_path-curses.h}"
10699 EOF
10700 }
10701
10702   { test "$extra_verbose" = "yes" && cat << EOF
10703     Defining TERM_H_PATH = "${term_h_path-term.h}"
10704 EOF
10705 cat >> confdefs.h <<EOF
10706 #define TERM_H_PATH "${term_h_path-term.h}"
10707 EOF
10708 }
10709
10710
10711     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
10712 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
10713 echo "configure:10714: checking for gpm.h" >&5
10714
10715 cat > conftest.$ac_ext <<EOF
10716 #line 10717 "configure"
10717 #include "confdefs.h"
10718 #include <gpm.h>
10719 EOF
10720 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10721 { (eval echo configure:10722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10722 ac_err=`grep -v '^ *+' conftest.out`
10723 if test -z "$ac_err"; then
10724   rm -rf conftest*
10725   eval "ac_cv_header_$ac_safe=yes"
10726 else
10727   echo "$ac_err" >&5
10728   echo "configure: failed program was:" >&5
10729   cat conftest.$ac_ext >&5
10730   rm -rf conftest*
10731   eval "ac_cv_header_$ac_safe=no"
10732 fi
10733 rm -f conftest*
10734 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10735   echo "$ac_t""yes" 1>&6
10736   :
10737 else
10738   echo "$ac_t""no" 1>&6
10739 with_gpm=no
10740 fi
10741  }
10742   test -z "$with_gpm" && { 
10743 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
10744 echo "configure:10745: checking for Gpm_Open in -lgpm" >&5
10745 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
10746
10747 xe_check_libs=" -lgpm "
10748 cat > conftest.$ac_ext <<EOF
10749 #line 10750 "configure"
10750 #include "confdefs.h"
10751 /* Override any gcc2 internal prototype to avoid an error.  */
10752 /* We use char because int might match the return type of a gcc2
10753     builtin and then its argument prototype would still apply.  */
10754 char Gpm_Open();
10755
10756 int main() {
10757 Gpm_Open()
10758 ; return 0; }
10759 EOF
10760 if { (eval echo configure:10761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10761   rm -rf conftest*
10762   eval "ac_cv_lib_$ac_lib_var=yes"
10763 else
10764   echo "configure: failed program was:" >&5
10765   cat conftest.$ac_ext >&5
10766   rm -rf conftest*
10767   eval "ac_cv_lib_$ac_lib_var=no"
10768 fi
10769 rm -f conftest*
10770 xe_check_libs=""
10771
10772 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10773   echo "$ac_t""yes" 1>&6
10774   with_gpm=yes
10775 else
10776   echo "$ac_t""no" 1>&6
10777 with_gpm=no
10778 fi
10779
10780  }
10781   if test "$with_gpm" = "yes"; then
10782     { test "$extra_verbose" = "yes" && cat << \EOF
10783     Defining HAVE_GPM
10784 EOF
10785 cat >> confdefs.h <<\EOF
10786 #define HAVE_GPM 1
10787 EOF
10788 }
10789
10790     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
10791    echo "    xemacs will be linked with \"gpmevent.o\""
10792  fi
10793     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
10794   fi
10795
10796 else   for feature in ncurses gpm; do
10797     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
10798       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
10799     fi
10800     eval "with_${feature}=no"
10801   done
10802 fi 
10803 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
10804    echo "    xemacs will be linked with \"event-unixoid.o\""
10805  fi
10806
10807
10808 echo "checking for database support" 1>&6
10809 echo "configure:10810: checking for database support" >&5
10810
10811 if test "$with_database_gnudbm" != "no"; then
10812   for ac_hdr in ndbm.h
10813 do
10814 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10815 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10816 echo "configure:10817: checking for $ac_hdr" >&5
10817
10818 cat > conftest.$ac_ext <<EOF
10819 #line 10820 "configure"
10820 #include "confdefs.h"
10821 #include <$ac_hdr>
10822 EOF
10823 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10824 { (eval echo configure:10825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10825 ac_err=`grep -v '^ *+' conftest.out`
10826 if test -z "$ac_err"; then
10827   rm -rf conftest*
10828   eval "ac_cv_header_$ac_safe=yes"
10829 else
10830   echo "$ac_err" >&5
10831   echo "configure: failed program was:" >&5
10832   cat conftest.$ac_ext >&5
10833   rm -rf conftest*
10834   eval "ac_cv_header_$ac_safe=no"
10835 fi
10836 rm -f conftest*
10837 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10838   echo "$ac_t""yes" 1>&6
10839     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10840   { test "$extra_verbose" = "yes" && cat << EOF
10841     Defining $ac_tr_hdr
10842 EOF
10843 cat >> confdefs.h <<EOF
10844 #define $ac_tr_hdr 1
10845 EOF
10846 }
10847  have_ndbm_h=yes
10848 else
10849   echo "$ac_t""no" 1>&6
10850 fi
10851 done
10852
10853   if test "$have_ndbm_h" = "yes"; then
10854     
10855 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
10856 echo "configure:10857: checking for dbm_open in -lgdbm" >&5
10857 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
10858
10859 xe_check_libs=" -lgdbm "
10860 cat > conftest.$ac_ext <<EOF
10861 #line 10862 "configure"
10862 #include "confdefs.h"
10863 /* Override any gcc2 internal prototype to avoid an error.  */
10864 /* We use char because int might match the return type of a gcc2
10865     builtin and then its argument prototype would still apply.  */
10866 char dbm_open();
10867
10868 int main() {
10869 dbm_open()
10870 ; return 0; }
10871 EOF
10872 if { (eval echo configure:10873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10873   rm -rf conftest*
10874   eval "ac_cv_lib_$ac_lib_var=yes"
10875 else
10876   echo "configure: failed program was:" >&5
10877   cat conftest.$ac_ext >&5
10878   rm -rf conftest*
10879   eval "ac_cv_lib_$ac_lib_var=no"
10880 fi
10881 rm -f conftest*
10882 xe_check_libs=""
10883
10884 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10885   echo "$ac_t""yes" 1>&6
10886   with_database_gnudbm=yes have_libgdbm=yes
10887 else
10888   echo "$ac_t""no" 1>&6
10889 fi
10890
10891
10892   fi
10893   if test "$with_database_gnudbm" != "yes"; then
10894     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
10895 echo "configure:10896: checking for dbm_open" >&5
10896
10897 cat > conftest.$ac_ext <<EOF
10898 #line 10899 "configure"
10899 #include "confdefs.h"
10900 /* System header to define __stub macros and hopefully few prototypes,
10901     which can conflict with char dbm_open(); below.  */
10902 #include <assert.h>
10903 /* Override any gcc2 internal prototype to avoid an error.  */
10904 /* We use char because int might match the return type of a gcc2
10905     builtin and then its argument prototype would still apply.  */
10906 char dbm_open();
10907
10908 int main() {
10909
10910 /* The GNU C library defines this for functions which it implements
10911     to always fail with ENOSYS.  Some functions are actually named
10912     something starting with __ and the normal name is an alias.  */
10913 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
10914 choke me
10915 #else
10916 dbm_open();
10917 #endif
10918
10919 ; return 0; }
10920 EOF
10921 if { (eval echo configure:10922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10922   rm -rf conftest*
10923   eval "ac_cv_func_dbm_open=yes"
10924 else
10925   echo "configure: failed program was:" >&5
10926   cat conftest.$ac_ext >&5
10927   rm -rf conftest*
10928   eval "ac_cv_func_dbm_open=no"
10929 fi
10930 rm -f conftest*
10931
10932 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
10933   echo "$ac_t""yes" 1>&6
10934   with_database_gnudbm=yes
10935 else
10936   echo "$ac_t""no" 1>&6
10937 fi
10938
10939       fi
10940   if test "$with_database_gnudbm" = "yes"; then
10941     { test "$extra_verbose" = "yes" && cat << \EOF
10942     Defining HAVE_DBM
10943 EOF
10944 cat >> confdefs.h <<\EOF
10945 #define HAVE_DBM 1
10946 EOF
10947 }
10948
10949     test "$have_libgdbm" = "yes" && LIBS="-lgdbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgdbm\" to \$LIBS"; fi
10950     with_database_dbm=no
10951   else with_database_gnudbm=no
10952   fi
10953 fi
10954
10955 if test "$with_database_dbm" != "no"; then
10956   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
10957 echo "configure:10958: checking for dbm_open" >&5
10958
10959 cat > conftest.$ac_ext <<EOF
10960 #line 10961 "configure"
10961 #include "confdefs.h"
10962 /* System header to define __stub macros and hopefully few prototypes,
10963     which can conflict with char dbm_open(); below.  */
10964 #include <assert.h>
10965 /* Override any gcc2 internal prototype to avoid an error.  */
10966 /* We use char because int might match the return type of a gcc2
10967     builtin and then its argument prototype would still apply.  */
10968 char dbm_open();
10969
10970 int main() {
10971
10972 /* The GNU C library defines this for functions which it implements
10973     to always fail with ENOSYS.  Some functions are actually named
10974     something starting with __ and the normal name is an alias.  */
10975 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
10976 choke me
10977 #else
10978 dbm_open();
10979 #endif
10980
10981 ; return 0; }
10982 EOF
10983 if { (eval echo configure:10984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10984   rm -rf conftest*
10985   eval "ac_cv_func_dbm_open=yes"
10986 else
10987   echo "configure: failed program was:" >&5
10988   cat conftest.$ac_ext >&5
10989   rm -rf conftest*
10990   eval "ac_cv_func_dbm_open=no"
10991 fi
10992 rm -f conftest*
10993
10994 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
10995   echo "$ac_t""yes" 1>&6
10996   with_database_dbm=yes need_libdbm=no
10997 else
10998   echo "$ac_t""no" 1>&6
10999 fi
11000
11001   if test "$need_libdbm" != "no"; then
11002     
11003 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11004 echo "configure:11005: checking for dbm_open in -ldbm" >&5
11005 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11006
11007 xe_check_libs=" -ldbm "
11008 cat > conftest.$ac_ext <<EOF
11009 #line 11010 "configure"
11010 #include "confdefs.h"
11011 /* Override any gcc2 internal prototype to avoid an error.  */
11012 /* We use char because int might match the return type of a gcc2
11013     builtin and then its argument prototype would still apply.  */
11014 char dbm_open();
11015
11016 int main() {
11017 dbm_open()
11018 ; return 0; }
11019 EOF
11020 if { (eval echo configure:11021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11021   rm -rf conftest*
11022   eval "ac_cv_lib_$ac_lib_var=yes"
11023 else
11024   echo "configure: failed program was:" >&5
11025   cat conftest.$ac_ext >&5
11026   rm -rf conftest*
11027   eval "ac_cv_lib_$ac_lib_var=no"
11028 fi
11029 rm -f conftest*
11030 xe_check_libs=""
11031
11032 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11033   echo "$ac_t""yes" 1>&6
11034   with_database_dbm=yes need_libdbm=yes
11035 else
11036   echo "$ac_t""no" 1>&6
11037 fi
11038
11039
11040   fi
11041   if test "$with_database_dbm" = "yes"; then
11042     { test "$extra_verbose" = "yes" && cat << \EOF
11043     Defining HAVE_DBM
11044 EOF
11045 cat >> confdefs.h <<\EOF
11046 #define HAVE_DBM 1
11047 EOF
11048 }
11049
11050     test "$need_libdbm" = "yes" && LIBS="-ldbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldbm\" to \$LIBS"; fi
11051   else with_database_dbm=no
11052   fi
11053 fi
11054
11055 if test "$with_database_berkdb" != "no"; then
11056   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11057 echo "configure:11058: checking for Berkeley db.h" >&5
11058   for path in "db/db.h" "db.h"; do
11059     cat > conftest.$ac_ext <<EOF
11060 #line 11061 "configure"
11061 #include "confdefs.h"
11062 #ifdef HAVE_INTTYPES_H
11063 #define __BIT_TYPES_DEFINED__
11064 #include <inttypes.h>
11065 typedef uint8_t  u_int8_t;
11066 typedef uint16_t u_int16_t;
11067 typedef uint32_t u_int32_t;
11068 #ifdef WE_DONT_NEED_QUADS
11069 typedef uint64_t u_int64_t;
11070 #endif
11071 #endif
11072 #include <$path>
11073
11074 int main() {
11075
11076 ; return 0; }
11077 EOF
11078 if { (eval echo configure:11079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11079   rm -rf conftest*
11080   db_h_path="$path"; break
11081 else
11082   echo "configure: failed program was:" >&5
11083   cat conftest.$ac_ext >&5
11084 fi
11085 rm -f conftest*
11086   done
11087   if test -z "$db_h_path"
11088   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11089   else echo "$ac_t""$db_h_path" 1>&6
11090   fi
11091
11092   if test "$with_database_berkdb" != "no"; then
11093     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11094 echo "configure:11095: checking for Berkeley DB version" >&5
11095     cat > conftest.$ac_ext <<EOF
11096 #line 11097 "configure"
11097 #include "confdefs.h"
11098 #include <$db_h_path>
11099 #if DB_VERSION_MAJOR > 1
11100 yes
11101 #endif
11102
11103 EOF
11104 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11105   egrep "yes" >/dev/null 2>&1; then
11106   rm -rf conftest*
11107   echo "$ac_t""2" 1>&6; dbfunc=db_open
11108 else
11109   rm -rf conftest*
11110   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11111 fi
11112 rm -f conftest*
11113
11114     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11115 echo "configure:11116: checking for $dbfunc" >&5
11116
11117 cat > conftest.$ac_ext <<EOF
11118 #line 11119 "configure"
11119 #include "confdefs.h"
11120 /* System header to define __stub macros and hopefully few prototypes,
11121     which can conflict with char $dbfunc(); below.  */
11122 #include <assert.h>
11123 /* Override any gcc2 internal prototype to avoid an error.  */
11124 /* We use char because int might match the return type of a gcc2
11125     builtin and then its argument prototype would still apply.  */
11126 char $dbfunc();
11127
11128 int main() {
11129
11130 /* The GNU C library defines this for functions which it implements
11131     to always fail with ENOSYS.  Some functions are actually named
11132     something starting with __ and the normal name is an alias.  */
11133 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11134 choke me
11135 #else
11136 $dbfunc();
11137 #endif
11138
11139 ; return 0; }
11140 EOF
11141 if { (eval echo configure:11142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11142   rm -rf conftest*
11143   eval "ac_cv_func_$dbfunc=yes"
11144 else
11145   echo "configure: failed program was:" >&5
11146   cat conftest.$ac_ext >&5
11147   rm -rf conftest*
11148   eval "ac_cv_func_$dbfunc=no"
11149 fi
11150 rm -f conftest*
11151
11152 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11153   echo "$ac_t""yes" 1>&6
11154   with_database_berkdb=yes need_libdb=no
11155 else
11156   echo "$ac_t""no" 1>&6
11157
11158     
11159 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11160 echo "configure:11161: checking for $dbfunc in -ldb" >&5
11161 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11162
11163 xe_check_libs=" -ldb "
11164 cat > conftest.$ac_ext <<EOF
11165 #line 11166 "configure"
11166 #include "confdefs.h"
11167 /* Override any gcc2 internal prototype to avoid an error.  */
11168 /* We use char because int might match the return type of a gcc2
11169     builtin and then its argument prototype would still apply.  */
11170 char $dbfunc();
11171
11172 int main() {
11173 $dbfunc()
11174 ; return 0; }
11175 EOF
11176 if { (eval echo configure:11177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11177   rm -rf conftest*
11178   eval "ac_cv_lib_$ac_lib_var=yes"
11179 else
11180   echo "configure: failed program was:" >&5
11181   cat conftest.$ac_ext >&5
11182   rm -rf conftest*
11183   eval "ac_cv_lib_$ac_lib_var=no"
11184 fi
11185 rm -f conftest*
11186 xe_check_libs=""
11187
11188 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11189   echo "$ac_t""yes" 1>&6
11190   with_database_berkdb=yes need_libdb=yes
11191 else
11192   echo "$ac_t""no" 1>&6
11193 fi
11194
11195
11196 fi
11197
11198   fi
11199
11200   if test "$with_database_berkdb" = "yes"; then
11201     { test "$extra_verbose" = "yes" && cat << EOF
11202     Defining DB_H_PATH = "$db_h_path"
11203 EOF
11204 cat >> confdefs.h <<EOF
11205 #define DB_H_PATH "$db_h_path"
11206 EOF
11207 }
11208
11209     { test "$extra_verbose" = "yes" && cat << \EOF
11210     Defining HAVE_BERKELEY_DB
11211 EOF
11212 cat >> confdefs.h <<\EOF
11213 #define HAVE_BERKELEY_DB 1
11214 EOF
11215 }
11216
11217     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11218   else with_database_berkdb=no
11219   fi
11220 fi
11221
11222 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11223      != "no no no"; then
11224   { test "$extra_verbose" = "yes" && cat << \EOF
11225     Defining HAVE_DATABASE
11226 EOF
11227 cat >> confdefs.h <<\EOF
11228 #define HAVE_DATABASE 1
11229 EOF
11230 }
11231
11232   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11233    echo "    xemacs will be linked with \"database.o\""
11234  fi
11235 fi
11236
11237 if test "$with_socks" = "yes"; then
11238   
11239 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11240 echo "configure:11241: checking for SOCKSinit in -lsocks" >&5
11241 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11242
11243 xe_check_libs=" -lsocks "
11244 cat > conftest.$ac_ext <<EOF
11245 #line 11246 "configure"
11246 #include "confdefs.h"
11247 /* Override any gcc2 internal prototype to avoid an error.  */
11248 /* We use char because int might match the return type of a gcc2
11249     builtin and then its argument prototype would still apply.  */
11250 char SOCKSinit();
11251
11252 int main() {
11253 SOCKSinit()
11254 ; return 0; }
11255 EOF
11256 if { (eval echo configure:11257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11257   rm -rf conftest*
11258   eval "ac_cv_lib_$ac_lib_var=yes"
11259 else
11260   echo "configure: failed program was:" >&5
11261   cat conftest.$ac_ext >&5
11262   rm -rf conftest*
11263   eval "ac_cv_lib_$ac_lib_var=no"
11264 fi
11265 rm -f conftest*
11266 xe_check_libs=""
11267
11268 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11269   echo "$ac_t""yes" 1>&6
11270     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11271     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11272   { test "$extra_verbose" = "yes" && cat << EOF
11273     Defining $ac_tr_lib
11274 EOF
11275 cat >> confdefs.h <<EOF
11276 #define $ac_tr_lib 1
11277 EOF
11278 }
11279
11280   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11281
11282 else
11283   echo "$ac_t""no" 1>&6
11284 fi
11285
11286
11287   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11288     Defining HAVE_SOCKS
11289 EOF
11290 cat >> confdefs.h <<\EOF
11291 #define HAVE_SOCKS 1
11292 EOF
11293 }
11294
11295 fi
11296
11297 if test "$usage_tracking" = "yes"; then
11298   { test "$extra_verbose" = "yes" && cat << \EOF
11299     Defining USAGE_TRACKING
11300 EOF
11301 cat >> confdefs.h <<\EOF
11302 #define USAGE_TRACKING 1
11303 EOF
11304 }
11305
11306   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11307 fi
11308
11309 for ac_hdr in dlfcn.h
11310 do
11311 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11312 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11313 echo "configure:11314: checking for $ac_hdr" >&5
11314
11315 cat > conftest.$ac_ext <<EOF
11316 #line 11317 "configure"
11317 #include "confdefs.h"
11318 #include <$ac_hdr>
11319 EOF
11320 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11321 { (eval echo configure:11322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11322 ac_err=`grep -v '^ *+' conftest.out`
11323 if test -z "$ac_err"; then
11324   rm -rf conftest*
11325   eval "ac_cv_header_$ac_safe=yes"
11326 else
11327   echo "$ac_err" >&5
11328   echo "configure: failed program was:" >&5
11329   cat conftest.$ac_ext >&5
11330   rm -rf conftest*
11331   eval "ac_cv_header_$ac_safe=no"
11332 fi
11333 rm -f conftest*
11334 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11335   echo "$ac_t""yes" 1>&6
11336     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11337   { test "$extra_verbose" = "yes" && cat << EOF
11338     Defining $ac_tr_hdr
11339 EOF
11340 cat >> confdefs.h <<EOF
11341 #define $ac_tr_hdr 1
11342 EOF
11343 }
11344  have_dlfcn=yes
11345 else
11346   echo "$ac_t""no" 1>&6
11347 fi
11348 done
11349
11350 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11351 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11352 echo "configure:11353: checking for dlopen in -ldl" >&5
11353 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11354
11355 xe_check_libs=" -ldl "
11356 cat > conftest.$ac_ext <<EOF
11357 #line 11358 "configure"
11358 #include "confdefs.h"
11359 /* Override any gcc2 internal prototype to avoid an error.  */
11360 /* We use char because int might match the return type of a gcc2
11361     builtin and then its argument prototype would still apply.  */
11362 char dlopen();
11363
11364 int main() {
11365 dlopen()
11366 ; return 0; }
11367 EOF
11368 if { (eval echo configure:11369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11369   rm -rf conftest*
11370   eval "ac_cv_lib_$ac_lib_var=yes"
11371 else
11372   echo "configure: failed program was:" >&5
11373   cat conftest.$ac_ext >&5
11374   rm -rf conftest*
11375   eval "ac_cv_lib_$ac_lib_var=no"
11376 fi
11377 rm -f conftest*
11378 xe_check_libs=""
11379
11380 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11381   echo "$ac_t""yes" 1>&6
11382   { test "$extra_verbose" = "yes" && cat << \EOF
11383     Defining HAVE_DLOPEN
11384 EOF
11385 cat >> confdefs.h <<\EOF
11386 #define HAVE_DLOPEN 1
11387 EOF
11388 }
11389  DLL_LIB=dl;  with_shlib=yes
11390 else
11391   echo "$ac_t""no" 1>&6
11392 fi
11393
11394  }
11395 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11396 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11397 echo "configure:11398: checking for _dlopen in -lc" >&5
11398 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11399
11400 xe_check_libs=" -lc "
11401 cat > conftest.$ac_ext <<EOF
11402 #line 11403 "configure"
11403 #include "confdefs.h"
11404 /* Override any gcc2 internal prototype to avoid an error.  */
11405 /* We use char because int might match the return type of a gcc2
11406     builtin and then its argument prototype would still apply.  */
11407 char _dlopen();
11408
11409 int main() {
11410 _dlopen()
11411 ; return 0; }
11412 EOF
11413 if { (eval echo configure:11414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11414   rm -rf conftest*
11415   eval "ac_cv_lib_$ac_lib_var=yes"
11416 else
11417   echo "configure: failed program was:" >&5
11418   cat conftest.$ac_ext >&5
11419   rm -rf conftest*
11420   eval "ac_cv_lib_$ac_lib_var=no"
11421 fi
11422 rm -f conftest*
11423 xe_check_libs=""
11424
11425 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11426   echo "$ac_t""yes" 1>&6
11427   { test "$extra_verbose" = "yes" && cat << \EOF
11428     Defining HAVE_DLOPEN
11429 EOF
11430 cat >> confdefs.h <<\EOF
11431 #define HAVE_DLOPEN 1
11432 EOF
11433 }
11434  DLL_LIB=;   with_shlib=yes
11435 else
11436   echo "$ac_t""no" 1>&6
11437 fi
11438
11439  }
11440 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11441 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11442 echo "configure:11443: checking for dlopen in -lc" >&5
11443 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11444
11445 xe_check_libs=" -lc "
11446 cat > conftest.$ac_ext <<EOF
11447 #line 11448 "configure"
11448 #include "confdefs.h"
11449 /* Override any gcc2 internal prototype to avoid an error.  */
11450 /* We use char because int might match the return type of a gcc2
11451     builtin and then its argument prototype would still apply.  */
11452 char dlopen();
11453
11454 int main() {
11455 dlopen()
11456 ; return 0; }
11457 EOF
11458 if { (eval echo configure:11459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11459   rm -rf conftest*
11460   eval "ac_cv_lib_$ac_lib_var=yes"
11461 else
11462   echo "configure: failed program was:" >&5
11463   cat conftest.$ac_ext >&5
11464   rm -rf conftest*
11465   eval "ac_cv_lib_$ac_lib_var=no"
11466 fi
11467 rm -f conftest*
11468 xe_check_libs=""
11469
11470 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11471   echo "$ac_t""yes" 1>&6
11472   { test "$extra_verbose" = "yes" && cat << \EOF
11473     Defining HAVE_DLOPEN
11474 EOF
11475 cat >> confdefs.h <<\EOF
11476 #define HAVE_DLOPEN 1
11477 EOF
11478 }
11479  DLL_LIB=;   with_shlib=yes
11480 else
11481   echo "$ac_t""no" 1>&6
11482 fi
11483
11484  }
11485 test -z "$with_shlib" && { 
11486 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11487 echo "configure:11488: checking for shl_load in -ldld" >&5
11488 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11489
11490 xe_check_libs=" -ldld "
11491 cat > conftest.$ac_ext <<EOF
11492 #line 11493 "configure"
11493 #include "confdefs.h"
11494 /* Override any gcc2 internal prototype to avoid an error.  */
11495 /* We use char because int might match the return type of a gcc2
11496     builtin and then its argument prototype would still apply.  */
11497 char shl_load();
11498
11499 int main() {
11500 shl_load()
11501 ; return 0; }
11502 EOF
11503 if { (eval echo configure:11504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11504   rm -rf conftest*
11505   eval "ac_cv_lib_$ac_lib_var=yes"
11506 else
11507   echo "configure: failed program was:" >&5
11508   cat conftest.$ac_ext >&5
11509   rm -rf conftest*
11510   eval "ac_cv_lib_$ac_lib_var=no"
11511 fi
11512 rm -f conftest*
11513 xe_check_libs=""
11514
11515 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11516   echo "$ac_t""yes" 1>&6
11517   { test "$extra_verbose" = "yes" && cat << \EOF
11518     Defining HAVE_SHL_LOAD
11519 EOF
11520 cat >> confdefs.h <<\EOF
11521 #define HAVE_SHL_LOAD 1
11522 EOF
11523 }
11524  DLL_LIB=dld; with_shlib=yes
11525 else
11526   echo "$ac_t""no" 1>&6
11527 fi
11528
11529  }
11530 test -z "$with_shlib" && { 
11531 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11532 echo "configure:11533: checking for dld_init in -ldld" >&5
11533 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11534
11535 xe_check_libs=" -ldld "
11536 cat > conftest.$ac_ext <<EOF
11537 #line 11538 "configure"
11538 #include "confdefs.h"
11539 /* Override any gcc2 internal prototype to avoid an error.  */
11540 /* We use char because int might match the return type of a gcc2
11541     builtin and then its argument prototype would still apply.  */
11542 char dld_init();
11543
11544 int main() {
11545 dld_init()
11546 ; return 0; }
11547 EOF
11548 if { (eval echo configure:11549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11549   rm -rf conftest*
11550   eval "ac_cv_lib_$ac_lib_var=yes"
11551 else
11552   echo "configure: failed program was:" >&5
11553   cat conftest.$ac_ext >&5
11554   rm -rf conftest*
11555   eval "ac_cv_lib_$ac_lib_var=no"
11556 fi
11557 rm -f conftest*
11558 xe_check_libs=""
11559
11560 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11561   echo "$ac_t""yes" 1>&6
11562   { test "$extra_verbose" = "yes" && cat << \EOF
11563     Defining HAVE_DLD_INIT
11564 EOF
11565 cat >> confdefs.h <<\EOF
11566 #define HAVE_DLD_INIT 1
11567 EOF
11568 }
11569  DLL_LIB=dld; with_shlib=yes
11570 else
11571   echo "$ac_t""no" 1>&6
11572 fi
11573
11574  }
11575 if test "$with_shlib" = "yes"; then
11576   { test "$extra_verbose" = "yes" && cat << \EOF
11577     Defining HAVE_SHLIB
11578 EOF
11579 cat >> confdefs.h <<\EOF
11580 #define HAVE_SHLIB 1
11581 EOF
11582 }
11583
11584   extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
11585    echo "    xemacs will be linked with \"sysdll.o\""
11586  fi
11587   extra_objs="$extra_objs dll.o" &&  if test "$extra_verbose" = "yes"; then
11588    echo "    xemacs will be linked with \"dll.o\""
11589  fi
11590   test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
11591   
11592 dll_ld="ld"
11593 dll_lflags="-shared"
11594 dll_cflags="-r"
11595 dll_oflags="-o "
11596
11597 echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6
11598 echo "configure:11599: checking how to build a shared library" >&5
11599 case `uname -rs` in
11600         UNIX_SV*|UNIX_System_V*)
11601                 dll_lflags="-G"
11602                 dll_cflags=-Kpic
11603                 dll_ld="ld"
11604                 ;;
11605         BSD/OS*)
11606                 dll_cflags=
11607                 dll_lflags="-r"
11608                 dll_ld="shlicc2"
11609                 ;;
11610         FreeBSD*2*)
11611                 dll_lflags="-Bshareable"
11612                 dll_cflags="-fPIC -DPIC"
11613                 dll_ld=ld
11614                 ;;
11615         SunOS*4.*)
11616                 dll_cflags="-P"
11617                 dll_lflags="-dp -assert pure-text -assert nodefinitions"
11618                 ;;
11619         SunOS*5.*)
11620                 dll_ld="cc"
11621                 dll_cflags="-KPIC"
11622                 dll_lflags="-G"
11623                 dll_oflags="-W0,-y-o -W0,-y"
11624                 ;;      
11625         IRIX*5.*|IRIX*6.*)
11626                 dll_cflags="-KPIC"
11627                 ;;
11628         OSF1*)
11629                 ;;
11630         HP-UX*)
11631                 dll_ld="ld"
11632                 dll_lflags="-b"
11633                 dll_cflags="+z"
11634                 ;;
11635         SCO_SV*)
11636                 dll_ld="ld"
11637                 dll_lflags="-G"
11638                 dll_cflags="-Kpic"
11639                 ;;
11640         AIX*)
11641                 dll_lflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:\${@:.ell=.exp} -b noentry -lc"
11642                 dll_ld="ld"
11643                 ;;
11644         *)
11645                 ;;
11646         esac
11647
11648         if test "$GCC" = "yes" ; then
11649                 dll_cflags="-fPIC"
11650                 case `uname -rs` in
11651                 SunOS*5.*)
11652                         dll_ld="ld"
11653                         dll_oflags="-o "
11654                         dll_lflags="-G"
11655                         ;;
11656                 SCO_SV*)
11657                         dll_ld="ld"
11658                         dll_lflags="-G"
11659                         dll_cflags="-b elf"
11660                         ;;
11661                 FreeBSD*)
11662                         dll_cflags="-DDLSYM_NEEDS_UNDERSCORE -DPIC -fPIC"
11663                         dll_lflags="-Bshareable"
11664                         dll_ld=ld
11665                         ;;
11666                 BSD/OS*)
11667                         dll_cflags=
11668                         dll_lflags="-r"
11669                         dll_ld="shlicc2"
11670                         ;;
11671                 UNIX_SV*)
11672                         dll_cflags="-fPIC"
11673                         ;;
11674                 *)
11675                         dll_ld="$CC"
11676                         dll_lflags="-shared"
11677                 esac
11678         fi
11679
11680         echo "$ac_t"""lflags: $dll_lflags cflags: $dll_cflags"" 1>&6
11681
11682
11683
11684
11685
11686   for ac_func in dlerror
11687 do
11688 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11689 echo "configure:11690: checking for $ac_func" >&5
11690
11691 cat > conftest.$ac_ext <<EOF
11692 #line 11693 "configure"
11693 #include "confdefs.h"
11694 /* System header to define __stub macros and hopefully few prototypes,
11695     which can conflict with char $ac_func(); below.  */
11696 #include <assert.h>
11697 /* Override any gcc2 internal prototype to avoid an error.  */
11698 /* We use char because int might match the return type of a gcc2
11699     builtin and then its argument prototype would still apply.  */
11700 char $ac_func();
11701
11702 int main() {
11703
11704 /* The GNU C library defines this for functions which it implements
11705     to always fail with ENOSYS.  Some functions are actually named
11706     something starting with __ and the normal name is an alias.  */
11707 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11708 choke me
11709 #else
11710 $ac_func();
11711 #endif
11712
11713 ; return 0; }
11714 EOF
11715 if { (eval echo configure:11716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11716   rm -rf conftest*
11717   eval "ac_cv_func_$ac_func=yes"
11718 else
11719   echo "configure: failed program was:" >&5
11720   cat conftest.$ac_ext >&5
11721   rm -rf conftest*
11722   eval "ac_cv_func_$ac_func=no"
11723 fi
11724 rm -f conftest*
11725
11726 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11727   echo "$ac_t""yes" 1>&6
11728     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11729   { test "$extra_verbose" = "yes" && cat << EOF
11730     Defining $ac_tr_func
11731 EOF
11732 cat >> confdefs.h <<EOF
11733 #define $ac_tr_func 1
11734 EOF
11735 }
11736  
11737 else
11738   echo "$ac_t""no" 1>&6
11739 fi
11740 done
11741
11742   ld_dynamic_link_flags=
11743     case "$opsys" in
11744   hpux*)  ld_dynamic_link_flags="-Wl,-E" ;;
11745   linux*) ld_dynamic_link_flags="-rdynamic" ;;
11746   *) ;;
11747   esac
11748 fi
11749
11750 cat > conftest.$ac_ext <<EOF
11751 #line 11752 "configure"
11752 #include "confdefs.h"
11753 int main(int c,char *v[]){return 0;}
11754 EOF
11755 if { (eval echo configure:11756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11756 then
11757   :
11758 else
11759   conftest_rc="$?"
11760   echo "configure: failed program was:" >&5
11761   cat conftest.$ac_ext >&5
11762   rm -fr conftest*
11763   
11764   echo ""
11765   echo "*** PANIC *** The C compiler can no longer build working executables."
11766   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
11767   echo "*** PANIC *** The most likely reason for this problem is that configure"
11768   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
11769   echo "*** PANIC *** found at run time."
11770   echo "*** PANIC ***"
11771   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
11772   echo "*** PANIC *** On other systems, try telling configure where to find the"
11773   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
11774   echo "*** PANIC ***"
11775   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
11776   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
11777   echo "*** PANIC *** on your system.  Don't do that."
11778   exit 1
11779 fi
11780 rm -fr conftest*
11781
11782
11783 { test "$extra_verbose" = "yes" && cat << \EOF
11784     Defining HAVE_UNIX_PROCESSES
11785 EOF
11786 cat >> confdefs.h <<\EOF
11787 #define HAVE_UNIX_PROCESSES 1
11788 EOF
11789 }
11790
11791 extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
11792    echo "    xemacs will be linked with \"process-unix.o\""
11793  fi
11794
11795
11796
11797 T=""
11798 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11799 CFLAGS="$T"
11800
11801
11802 T=""
11803 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11804 extra_objs="$T"
11805
11806
11807 T=""
11808 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
11809 c_switch_general="$T"
11810
11811
11812 T=""
11813 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11814 c_switch_window_system="$T"
11815
11816
11817 T=""
11818 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11819 c_switch_all="$T"
11820
11821
11822 T=""
11823 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
11824 ld_switch_general="$T"
11825
11826
11827 T=""
11828 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11829 ld_switch_window_system="$T"
11830
11831
11832 T=""
11833 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11834 ld_switch_all="$T"
11835
11836
11837 T=""
11838 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11839 ld_libs_general="$T"
11840
11841
11842 T=""
11843 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
11844 ld_libs_window_system="$T"
11845
11846
11847 T=""
11848 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11849 ld_libs_all="$T"
11850
11851
11852
11853 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
11854 internal_makefile_list="Makefile"
11855 SUBDIR_MAKEFILES=''
11856 test -d lock || mkdir lock
11857 for dir in $MAKE_SUBDIR; do
11858   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
11859         test -d "$d" || mkdir "$d"; cd "$d"
11860       done ) ;;
11861    * ) test -d "$dir" || mkdir "$dir" ;;
11862   esac
11863   
11864 T=""
11865 for W in $SUBDIR_MAKEFILES $dir/Makefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11866 SUBDIR_MAKEFILES="$T"
11867
11868   
11869 T=""
11870 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11871 internal_makefile_list="$T"
11872
11873 done
11874
11875
11876
11877
11878 for dir in src/s src/m; do
11879   if test ! -d "$dir" ; then
11880     echo Making symbolic link to "$srcdir/$dir"
11881     ${LN_S} "$srcdir/$dir" "$dir"
11882   fi
11883 done
11884
11885 if test "$extra_verbose" = "yes"; then
11886   echo ""
11887   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
11888   echo ""
11889 fi
11890
11891 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
11892   echo "creating src/gdbinit"; echo ""
11893   echo "source $srcdir/src/gdbinit" > src/gdbinit
11894 fi
11895
11896 if test "$__SUNPRO_C" = "yes"; then
11897   echo "creating .sbinit"; echo ""
11898   ( echo "# For use with Sun WorkShop's Source browser."
11899     echo "# See sbquery(1) and sbinit(4) for more information"
11900     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
11901   ) > .sbinit
11902 fi
11903
11904 rm -f core
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921 PREFIX=$prefix
11922 while true; do
11923   case "$PREFIX" in
11924     *\$* ) eval "PREFIX=$PREFIX" ;;
11925     *) break ;;
11926   esac
11927 done
11928
11929
11930
11931 EXEC_PREFIX=$exec_prefix
11932 while true; do
11933   case "$EXEC_PREFIX" in
11934     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
11935     *) break ;;
11936   esac
11937 done
11938
11939
11940
11941
11942 INFODIR=$infodir
11943 while true; do
11944   case "$INFODIR" in
11945     *\$* ) eval "INFODIR=$INFODIR" ;;
11946     *) break ;;
11947   esac
11948 done
11949
11950
11951
11952
11953 INFOPATH=$infopath
11954 while true; do
11955   case "$INFOPATH" in
11956     *\$* ) eval "INFOPATH=$INFOPATH" ;;
11957     *) break ;;
11958   esac
11959 done
11960
11961
11962
11963
11964 PACKAGE_PATH=$package_path
11965 while true; do
11966   case "$PACKAGE_PATH" in
11967     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
11968     *) break ;;
11969   esac
11970 done
11971
11972
11973
11974
11975 LISPDIR=$lispdir
11976 while true; do
11977   case "$LISPDIR" in
11978     *\$* ) eval "LISPDIR=$LISPDIR" ;;
11979     *) break ;;
11980   esac
11981 done
11982
11983
11984
11985
11986
11987 ETCDIR=$etcdir
11988 while true; do
11989   case "$ETCDIR" in
11990     *\$* ) eval "ETCDIR=$ETCDIR" ;;
11991     *) break ;;
11992   esac
11993 done
11994
11995
11996
11997
11998 LOCKDIR=$lockdir
11999 while true; do
12000   case "$LOCKDIR" in
12001     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12002     *) break ;;
12003   esac
12004 done
12005
12006
12007
12008
12009 ARCHLIBDIR=$archlibdir
12010 while true; do
12011   case "$ARCHLIBDIR" in
12012     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12013     *) break ;;
12014   esac
12015 done
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12038
12039
12040
12041
12042
12043
12044
12045 # The default is yes
12046 if test "$with_site_lisp" = "no"; then
12047   { test "$extra_verbose" = "yes" && cat << \EOF
12048     Defining INHIBIT_SITE_LISP
12049 EOF
12050 cat >> confdefs.h <<\EOF
12051 #define INHIBIT_SITE_LISP 1
12052 EOF
12053 }
12054
12055 fi
12056
12057
12058 T=""
12059 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12060 ac_configure_args="$T"
12061
12062 { test "$extra_verbose" = "yes" && cat << EOF
12063     Defining EMACS_CONFIGURATION = "$canonical"
12064 EOF
12065 cat >> confdefs.h <<EOF
12066 #define EMACS_CONFIGURATION "$canonical"
12067 EOF
12068 }
12069
12070 { test "$extra_verbose" = "yes" && cat << EOF
12071     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12072 EOF
12073 cat >> confdefs.h <<EOF
12074 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12075 EOF
12076 }
12077
12078 { test "$extra_verbose" = "yes" && cat << EOF
12079     Defining config_machfile = "$machfile"
12080 EOF
12081 cat >> confdefs.h <<EOF
12082 #define config_machfile "$machfile"
12083 EOF
12084 }
12085
12086 { test "$extra_verbose" = "yes" && cat << EOF
12087     Defining config_opsysfile = "$opsysfile"
12088 EOF
12089 cat >> confdefs.h <<EOF
12090 #define config_opsysfile "$opsysfile"
12091 EOF
12092 }
12093
12094
12095
12096 null_string=""
12097 { test "$extra_verbose" = "yes" && cat << EOF
12098     Defining LD_SWITCH_X_SITE = $null_string
12099 EOF
12100 cat >> confdefs.h <<EOF
12101 #define LD_SWITCH_X_SITE $null_string
12102 EOF
12103 }
12104
12105 { test "$extra_verbose" = "yes" && cat << EOF
12106     Defining LD_SWITCH_X_SITE_AUX = $null_string
12107 EOF
12108 cat >> confdefs.h <<EOF
12109 #define LD_SWITCH_X_SITE_AUX $null_string
12110 EOF
12111 }
12112
12113 { test "$extra_verbose" = "yes" && cat << EOF
12114     Defining C_SWITCH_X_SITE = $null_string
12115 EOF
12116 cat >> confdefs.h <<EOF
12117 #define C_SWITCH_X_SITE $null_string
12118 EOF
12119 }
12120
12121 { test "$extra_verbose" = "yes" && cat << EOF
12122     Defining LD_SWITCH_SITE = $null_string
12123 EOF
12124 cat >> confdefs.h <<EOF
12125 #define LD_SWITCH_SITE $null_string
12126 EOF
12127 }
12128
12129 { test "$extra_verbose" = "yes" && cat << EOF
12130     Defining C_SWITCH_SITE = $null_string
12131 EOF
12132 cat >> confdefs.h <<EOF
12133 #define C_SWITCH_SITE $null_string
12134 EOF
12135 }
12136
12137
12138
12139 test -n "$puresize" && { test "$extra_verbose" = "yes" && cat << EOF
12140     Defining RAW_PURESIZE = $puresize
12141 EOF
12142 cat >> confdefs.h <<EOF
12143 #define RAW_PURESIZE $puresize
12144 EOF
12145 }
12146
12147
12148 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12149     Defining GNU_MALLOC
12150 EOF
12151 cat >> confdefs.h <<\EOF
12152 #define GNU_MALLOC 1
12153 EOF
12154 }
12155
12156 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12157     Defining USE_SYSTEM_MALLOC
12158 EOF
12159 cat >> confdefs.h <<\EOF
12160 #define USE_SYSTEM_MALLOC 1
12161 EOF
12162 }
12163
12164 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12165     Defining USE_DEBUG_MALLOC
12166 EOF
12167 cat >> confdefs.h <<\EOF
12168 #define USE_DEBUG_MALLOC 1
12169 EOF
12170 }
12171
12172                                               { test "$extra_verbose" = "yes" && cat << \EOF
12173     Defining USE_SYSTEM_MALLOC
12174 EOF
12175 cat >> confdefs.h <<\EOF
12176 #define USE_SYSTEM_MALLOC 1
12177 EOF
12178 }
12179
12180 fi
12181 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12182     Defining I18N3
12183 EOF
12184 cat >> confdefs.h <<\EOF
12185 #define I18N3 1
12186 EOF
12187 }
12188
12189 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12190     Defining USE_GCC
12191 EOF
12192 cat >> confdefs.h <<\EOF
12193 #define USE_GCC 1
12194 EOF
12195 }
12196
12197 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12198     Defining EXTERNAL_WIDGET
12199 EOF
12200 cat >> confdefs.h <<\EOF
12201 #define EXTERNAL_WIDGET 1
12202 EOF
12203 }
12204
12205 test "$with_gnu_make"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12206     Defining USE_GNU_MAKE
12207 EOF
12208 cat >> confdefs.h <<\EOF
12209 #define USE_GNU_MAKE 1
12210 EOF
12211 }
12212
12213 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12214     Defining NO_DOC_FILE
12215 EOF
12216 cat >> confdefs.h <<\EOF
12217 #define NO_DOC_FILE 1
12218 EOF
12219 }
12220
12221 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12222     Defining QUANTIFY
12223 EOF
12224 cat >> confdefs.h <<\EOF
12225 #define QUANTIFY 1
12226 EOF
12227 }
12228
12229 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12230     Defining MAIL_USE_POP
12231 EOF
12232 cat >> confdefs.h <<\EOF
12233 #define MAIL_USE_POP 1
12234 EOF
12235 }
12236
12237 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12238     Defining KERBEROS
12239 EOF
12240 cat >> confdefs.h <<\EOF
12241 #define KERBEROS 1
12242 EOF
12243 }
12244
12245 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12246     Defining HESIOD
12247 EOF
12248 cat >> confdefs.h <<\EOF
12249 #define HESIOD 1
12250 EOF
12251 }
12252
12253 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12254     Defining USE_UNION_TYPE
12255 EOF
12256 cat >> confdefs.h <<\EOF
12257 #define USE_UNION_TYPE 1
12258 EOF
12259 }
12260
12261
12262
12263 (
12264 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
12265 else
12266   echo "uname -a: `uname -a`"
12267 fi
12268 echo ""
12269 echo "$0 $quoted_arguments"
12270 ) > Installation
12271
12272 xemacs_betaname=""
12273 test ! -z "${emacs_beta_version}" && xemacs_betaname="-b${emacs_beta_version}"
12274
12275 (
12276 echo "
12277
12278 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
12279
12280   Where should the build process find the source code?    $srcdir
12281   What installation prefix should install use?            $prefix
12282   What operating system and machine description files should XEmacs use?
12283         \`$opsysfile' and \`$machfile'
12284   What compiler should XEmacs be built with?              $CC $CFLAGS
12285   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
12286   Should XEmacs use the relocating allocator for buffers? $rel_alloc
12287   What window system should XEmacs use?                   ${window_system}"
12288 if test "$with_x11" = "yes"; then
12289   echo "  Where do we find X Windows header files?                $x_includes"
12290   echo "  Where do we find X Windows libraries?                   $x_libraries"
12291 fi
12292 if test -n "$site_includes"; then
12293   echo "  Additional header files:                                $site_includes"
12294 fi
12295 if test -n "$site_libraries"; then
12296   echo "  Additional libraries:                                   $site_libraries"
12297 fi
12298 if test -n "$site_prefixes"; then
12299   echo "  Additional prefixes:                                    $site_prefixes"
12300 fi
12301 if test -n "$runpath"; then
12302   echo "  Runtime library search path:                            $runpath"
12303 fi
12304 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
12305 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
12306 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
12307 if test "$with_xmu" != yes -a "$with_x11" = yes; then
12308   echo "  No Xmu; substituting equivalent routines."
12309 fi
12310
12311 if test "$with_xpm" = yes; then
12312   echo "  Compiling in support for XPM images."
12313 elif test "$with_x11" = yes; then
12314   echo "  --------------------------------------------------------------------"
12315   echo "  WARNING: Compiling without XPM support."
12316   if test "$xpm_problem" != ""; then
12317     echo "  Reason: $xpm_problem"
12318   fi
12319   echo "  WARNING: You should strongly consider installing XPM."
12320   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
12321   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12322   echo "  --------------------------------------------------------------------"
12323 fi
12324 if test "$with_png" = yes; then
12325   echo "  Compiling in support for PNG image handling."
12326 elif test "$window_system" != "none"; then
12327   echo "  --------------------------------------------------------------------"
12328   echo "  WARNING: Compiling without PNG image support."
12329   if test "$png_problem" != ""; then
12330     echo "  Reason: $png_problem"
12331   fi
12332   echo "  WARNING: You should strongly consider installing the PNG libraries."
12333   echo "  WARNING: Otherwise certain images and glyphs may not display."
12334   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12335   echo "  --------------------------------------------------------------------"
12336 fi
12337 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
12338 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
12339 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
12340 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
12341 case "$with_sound" in
12342   nas    ) echo "  Compiling in network sound (NAS) support." ;;
12343   native ) echo "  Compiling in native sound support." ;;
12344   both   ) echo "  Compiling in both network and native sound support." ;;
12345 esac
12346 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously"
12347
12348 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
12349 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
12350 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
12351
12352 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
12353 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
12354 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
12355
12356 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
12357 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
12358
12359 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
12360 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
12361 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
12362 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
12363 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
12364 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
12365 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
12366 if test "$with_wnn" = yes; then
12367   echo "  Compiling in support for the WNN input method on Mule."
12368   test "$with_wnn6" = yes && echo "    Using WNN version 6."
12369 fi
12370 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
12371
12372 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
12373 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
12374 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
12375 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
12376 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
12377 test "$with_session"  != no && echo "  Compiling in support for proper session-management."
12378 case "$with_menubars" in
12379   lucid ) echo "  Using Lucid menubars." ;;
12380   motif ) echo "  Using Motif menubars."
12381           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
12382           echo "             We recommend using the Lucid menubar instead."
12383           echo "             Re-run configure with --with-menubars='lucid'." ;;
12384 esac
12385 case "$with_scrollbars" in
12386   lucid    ) echo "  Using Lucid scrollbars."     ;;
12387   motif    ) echo "  Using Motif scrollbars."     ;;
12388   athena   ) echo "  Using Athena scrollbars."    ;;
12389   athena3d ) echo "  Using Athena-3d scrollbars." ;;
12390 esac
12391 case "$with_dialogs" in
12392   motif    ) echo "  Using Motif dialog boxes."     ;;
12393   athena   ) echo "  Using Athena dialog boxes."    ;;
12394   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
12395 esac
12396 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
12397 test "$with_clash_detection" = yes && \
12398   echo "  Clash detection will use \"$lockdir\" for locking files."
12399 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
12400 test "$with_pop"        = yes && echo "  Using POP for mail access"
12401 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication"
12402 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host"
12403 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
12404 test "$use_minimal_tagbits" = yes && echo "  Using Lisp_Objects with minimal tagbits."
12405 test "$use_indexed_lrecord_implementation" = yes && echo "  Using indexed lrecord implementation."
12406 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
12407 test "$memory_usage_stats" = yes && echo "  Compiling in code for checking XEmacs memory usage."
12408 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
12409 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
12410   != "no no no no no"; then
12411   echo "  WARNING: ---------------------------------------------------------"
12412   echo "  WARNING: Compiling in support for runtime error checking."
12413   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
12414   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
12415   echo "  WARNING: ---------------------------------------------------------"
12416 fi
12417 echo ""
12418 ) | tee -a Installation
12419 echo ""
12420
12421 echo '(setq Installation-string "' > Installation.el
12422 sed 's/"/\\"/g' Installation >> Installation.el
12423 echo '")' >> Installation.el
12424
12425
12426
12427 # Remove any trailing slashes in these variables.
12428 test -n "$prefix" &&
12429   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
12430 test -n "$exec_prefix" &&
12431   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
12432
12433
12434 for file in $internal_makefile_list; do
12435   test "$file" = src/Makefile.in && \
12436     file="src/Makefile.in:src/Makefile.in.in:src/depend"
12437   ac_output_files="${ac_output_files+$ac_output_files }$file"
12438 done
12439 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
12440
12441 trap '' 1 2 15
12442
12443 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
12444
12445 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12446 # Let make expand exec_prefix.
12447 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12448
12449 # Any assignment to VPATH causes Sun make to only execute
12450 # the first set of double-colon rules, so remove it if not needed.
12451 # If there is a colon in the path, we need to keep it.
12452 if test "x$srcdir" = x.; then
12453   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
12454 fi
12455
12456 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
12457
12458 DEFS=-DHAVE_CONFIG_H
12459
12460 # Without the "./", some shells look in PATH for config.status.
12461 : ${CONFIG_STATUS=./config.status}
12462
12463 echo creating $CONFIG_STATUS
12464 rm -f $CONFIG_STATUS
12465 cat > $CONFIG_STATUS <<EOF
12466 #! /bin/sh
12467 # Generated automatically by configure.
12468 # Run this file to recreate the current configuration.
12469 # This directory was configured as follows,
12470 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
12471 #
12472 # $0 $ac_configure_args
12473 #
12474 # Compiler output produced by configure, useful for debugging
12475 # configure, is in ./config.log if it exists.
12476
12477 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
12478 for ac_option
12479 do
12480   case "\$ac_option" in
12481   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12482     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
12483     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
12484   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
12485     echo "$CONFIG_STATUS generated by autoconf version 2.12"
12486     exit 0 ;;
12487   -help | --help | --hel | --he | --h)
12488     echo "\$ac_cs_usage"; exit 0 ;;
12489   *) echo "\$ac_cs_usage"; exit 1 ;;
12490   esac
12491 done
12492
12493 ac_given_srcdir=$srcdir
12494 ac_given_INSTALL="$INSTALL"
12495
12496 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
12497 EOF
12498 cat >> $CONFIG_STATUS <<EOF
12499
12500 # Protect against being on the right side of a sed subst in config.status.
12501 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
12502  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
12503 $ac_vpsub
12504 $extrasub
12505 s%@CFLAGS@%$CFLAGS%g
12506 s%@CPPFLAGS@%$CPPFLAGS%g
12507 s%@CXXFLAGS@%$CXXFLAGS%g
12508 s%@DEFS@%$DEFS%g
12509 s%@LDFLAGS@%$LDFLAGS%g
12510 s%@LIBS@%$LIBS%g
12511 s%@exec_prefix@%$exec_prefix%g
12512 s%@prefix@%$prefix%g
12513 s%@program_transform_name@%$program_transform_name%g
12514 s%@bindir@%$bindir%g
12515 s%@sbindir@%$sbindir%g
12516 s%@libexecdir@%$libexecdir%g
12517 s%@datadir@%$datadir%g
12518 s%@sysconfdir@%$sysconfdir%g
12519 s%@sharedstatedir@%$sharedstatedir%g
12520 s%@localstatedir@%$localstatedir%g
12521 s%@libdir@%$libdir%g
12522 s%@includedir@%$includedir%g
12523 s%@oldincludedir@%$oldincludedir%g
12524 s%@infodir@%$infodir%g
12525 s%@mandir@%$mandir%g
12526 s%@LN_S@%$LN_S%g
12527 s%@blddir@%$blddir%g
12528 s%@CC@%$CC%g
12529 s%@CPP@%$CPP%g
12530 s%@start_flags@%$start_flags%g
12531 s%@ld_switch_shared@%$ld_switch_shared%g
12532 s%@start_files@%$start_files%g
12533 s%@ld@%$ld%g
12534 s%@lib_gcc@%$lib_gcc%g
12535 s%@RANLIB@%$RANLIB%g
12536 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
12537 s%@INSTALL_DATA@%$INSTALL_DATA%g
12538 s%@YACC@%$YACC%g
12539 s%@SET_MAKE@%$SET_MAKE%g
12540 s%@X_CFLAGS@%$X_CFLAGS%g
12541 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
12542 s%@X_LIBS@%$X_LIBS%g
12543 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
12544 s%@install_pp@%$install_pp%g
12545 s%@libs_xauth@%$libs_xauth%g
12546 s%@dnd_objs@%$dnd_objs%g
12547 s%@lwlib_objs@%$lwlib_objs%g
12548 s%@ALLOCA@%$ALLOCA%g
12549 s%@dll_ld@%$dll_ld%g
12550 s%@dll_cflags@%$dll_cflags%g
12551 s%@dll_oflags@%$dll_oflags%g
12552 s%@dll_lflags@%$dll_lflags%g
12553 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
12554 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
12555 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
12556 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
12557 s%@PROGNAME@%$PROGNAME%g
12558 s%@version@%$version%g
12559 s%@configuration@%$configuration%g
12560 s%@canonical@%$canonical%g
12561 s%@srcdir@%$srcdir%g
12562 s%@pkgdir@%$pkgdir%g
12563 s%@statedir@%$statedir%g
12564 s%@PREFIX@%$PREFIX%g
12565 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
12566 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
12567 s%@INFODIR@%$INFODIR%g
12568 s%@infopath@%$infopath%g
12569 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
12570 s%@INFOPATH@%$INFOPATH%g
12571 s%@package_path@%$package_path%g
12572 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
12573 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
12574 s%@lispdir@%$lispdir%g
12575 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
12576 s%@LISPDIR@%$LISPDIR%g
12577 s%@etcdir@%$etcdir%g
12578 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
12579 s%@ETCDIR@%$ETCDIR%g
12580 s%@lockdir@%$lockdir%g
12581 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
12582 s%@LOCKDIR@%$LOCKDIR%g
12583 s%@archlibdir@%$archlibdir%g
12584 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
12585 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
12586 s%@docdir@%$docdir%g
12587 s%@bitmapdir@%$bitmapdir%g
12588 s%@extra_objs@%$extra_objs%g
12589 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
12590 s%@machfile@%$machfile%g
12591 s%@opsysfile@%$opsysfile%g
12592 s%@c_switch_general@%$c_switch_general%g
12593 s%@c_switch_window_system@%$c_switch_window_system%g
12594 s%@c_switch_all@%$c_switch_all%g
12595 s%@ld_switch_general@%$ld_switch_general%g
12596 s%@ld_switch_window_system@%$ld_switch_window_system%g
12597 s%@ld_switch_all@%$ld_switch_all%g
12598 s%@ld_libs_general@%$ld_libs_general%g
12599 s%@ld_libs_window_system@%$ld_libs_window_system%g
12600 s%@ld_libs_all@%$ld_libs_all%g
12601 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
12602 s%@native_sound_lib@%$native_sound_lib%g
12603 s%@sound_cflags@%$sound_cflags%g
12604 s%@dynodump_arch@%$dynodump_arch%g
12605 s%@internal_makefile_list@%$internal_makefile_list%g
12606
12607 CEOF
12608 EOF
12609
12610 cat >> $CONFIG_STATUS <<\EOF
12611
12612 # Split the substitutions into bite-sized pieces for seds with
12613 # small command number limits, like on Digital OSF/1 and HP-UX.
12614 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
12615 ac_file=1 # Number of current file.
12616 ac_beg=1 # First line for current file.
12617 ac_end=$ac_max_sed_cmds # Line after last line for current file.
12618 ac_more_lines=:
12619 ac_sed_cmds=""
12620 while $ac_more_lines; do
12621   if test $ac_beg -gt 1; then
12622     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
12623   else
12624     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
12625   fi
12626   if test ! -s conftest.s$ac_file; then
12627     ac_more_lines=false
12628     rm -f conftest.s$ac_file
12629   else
12630     if test -z "$ac_sed_cmds"; then
12631       ac_sed_cmds="sed -f conftest.s$ac_file"
12632     else
12633       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
12634     fi
12635     ac_file=`expr $ac_file + 1`
12636     ac_beg=$ac_end
12637     ac_end=`expr $ac_end + $ac_max_sed_cmds`
12638   fi
12639 done
12640 if test -z "$ac_sed_cmds"; then
12641   ac_sed_cmds=cat
12642 fi
12643 EOF
12644
12645 cat >> $CONFIG_STATUS <<EOF
12646
12647 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
12648 EOF
12649 cat >> $CONFIG_STATUS <<\EOF
12650 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
12651   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12652   case "$ac_file" in
12653   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12654        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12655   *) ac_file_in="${ac_file}.in" ;;
12656   esac
12657
12658   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
12659
12660   # Remove last slash and all that follows it.  Not all systems have dirname.
12661   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12662   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12663     # The file is in a subdirectory.
12664     test ! -d "$ac_dir" && mkdir "$ac_dir"
12665     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
12666     # A "../" for each directory in $ac_dir_suffix.
12667     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
12668   else
12669     ac_dir_suffix= ac_dots=
12670   fi
12671
12672   case "$ac_given_srcdir" in
12673   .)  srcdir=.
12674       if test -z "$ac_dots"; then top_srcdir=.
12675       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
12676   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
12677   *) # Relative path.
12678     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
12679     top_srcdir="$ac_dots$ac_given_srcdir" ;;
12680   esac
12681
12682   case "$ac_given_INSTALL" in
12683   [/$]*) INSTALL="$ac_given_INSTALL" ;;
12684   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
12685   esac
12686
12687   echo creating "$ac_file"
12688   rm -f "$ac_file"
12689   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
12690   case "$ac_file" in
12691   *Makefile*) ac_comsub="1i\\
12692 # $configure_input" ;;
12693   *) ac_comsub= ;;
12694   esac
12695
12696   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12697   sed -e "$ac_comsub
12698 s%@configure_input@%$configure_input%g
12699 s%@srcdir@%$srcdir%g
12700 s%@top_srcdir@%$top_srcdir%g
12701 s%@INSTALL@%$INSTALL%g
12702 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12703 fi; done
12704 rm -f conftest.s*
12705
12706 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12707 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12708 #
12709 # ac_d sets the value in "#define NAME VALUE" lines.
12710 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12711 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12712 ac_dC='\3'
12713 ac_dD='%g'
12714 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12715 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12716 ac_uB='\([      ]\)%\1#\2define\3'
12717 ac_uC=' '
12718 ac_uD='\4%g'
12719 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12720 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12721 ac_eB='$%\1#\2define\3'
12722 ac_eC=' '
12723 ac_eD='%g'
12724
12725 if test "${CONFIG_HEADERS+set}" != set; then
12726 EOF
12727 cat >> $CONFIG_STATUS <<EOF
12728   CONFIG_HEADERS="src/config.h lwlib/config.h"
12729 EOF
12730 cat >> $CONFIG_STATUS <<\EOF
12731 fi
12732 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12733   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12734   case "$ac_file" in
12735   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12736        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12737   *) ac_file_in="${ac_file}.in" ;;
12738   esac
12739
12740   echo creating $ac_file
12741
12742   rm -f conftest.frag conftest.in conftest.out
12743   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12744   cat $ac_file_inputs > conftest.in
12745
12746 EOF
12747
12748 # Transform confdefs.h into a sed script conftest.vals that substitutes
12749 # the proper values into config.h.in to produce config.h.  And first:
12750 # Protect against being on the right side of a sed subst in config.status.
12751 # Protect against being in an unquoted here document in config.status.
12752 rm -f conftest.vals
12753 cat > conftest.hdr <<\EOF
12754 s/[\\&%]/\\&/g
12755 s%[\\$`]%\\&%g
12756 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12757 s%ac_d%ac_u%gp
12758 s%ac_u%ac_e%gp
12759 EOF
12760 sed -n -f conftest.hdr confdefs.h > conftest.vals
12761 rm -f conftest.hdr
12762
12763 # This sed command replaces #undef with comments.  This is necessary, for
12764 # example, in the case of _POSIX_SOURCE, which is predefined and required
12765 # on some systems where configure will not decide to define it.
12766 cat >> conftest.vals <<\EOF
12767 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12768 EOF
12769
12770 # Break up conftest.vals because some shells have a limit on
12771 # the size of here documents, and old seds have small limits too.
12772
12773 rm -f conftest.tail
12774 while :
12775 do
12776   ac_lines=`grep -c . conftest.vals`
12777   # grep -c gives empty output for an empty file on some AIX systems.
12778   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12779   # Write a limited-size here document to conftest.frag.
12780   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12781   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12782   echo 'CEOF
12783   sed -f conftest.frag conftest.in > conftest.out
12784   rm -f conftest.in
12785   mv conftest.out conftest.in
12786 ' >> $CONFIG_STATUS
12787   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12788   rm -f conftest.vals
12789   mv conftest.tail conftest.vals
12790 done
12791 rm -f conftest.vals
12792
12793 cat >> $CONFIG_STATUS <<\EOF
12794   rm -f conftest.frag conftest.h
12795   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12796   cat conftest.in >> conftest.h
12797   rm -f conftest.in
12798   if cmp -s $ac_file conftest.h 2>/dev/null; then
12799     echo "$ac_file is unchanged"
12800     rm -f conftest.h
12801   else
12802     # Remove last slash and all that follows it.  Not all systems have dirname.
12803       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12804       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12805       # The file is in a subdirectory.
12806       test ! -d "$ac_dir" && mkdir "$ac_dir"
12807     fi
12808     rm -f $ac_file
12809     mv conftest.h $ac_file
12810   fi
12811 fi; done
12812
12813 EOF
12814 cat >> $CONFIG_STATUS <<EOF
12815 CPP="$CPP"
12816  CPPFLAGS="$CPPFLAGS"
12817  top_srcdir="$srcdir"
12818  MAKE_SUBDIR="$MAKE_SUBDIR"
12819
12820 EOF
12821 cat >> $CONFIG_STATUS <<\EOF
12822 for dir in $MAKE_SUBDIR; do
12823   echo creating $dir/Makefile
12824   (
12825     cd $dir
12826     rm -f junk.c
12827     < Makefile.in \
12828       sed -e '/^# Generated/d' \
12829           -e 's%/\*\*/#.*%%' \
12830           -e 's/^ *# */#/' \
12831           -e '/^##/d' \
12832           -e '/^#/ {
12833 p
12834 d
12835 }'        -e '/./ {
12836 s/\([\"]\)/\\\1/g
12837 s/^/"/
12838 s/$/"/
12839 }'  > junk.c;
12840     $CPP -I. -I${top_srcdir}/src $CPPFLAGS junk.c > junk.cpp;
12841     < junk.cpp                          \
12842       sed -e 's/^#.*//'                 \
12843         -e 's/^[        ][      ]*$//'  \
12844         -e 's/^ /       /'                      \
12845         | sed -n -e '/^..*$/p'          \
12846         | sed '/^"/ {
12847 s/\\\([\"]\)/\1/g
12848 s/^[    ]*"//
12849 s/"[    ]*$//
12850 }'      > Makefile.new
12851     chmod 444 Makefile.new
12852     mv -f Makefile.new Makefile
12853     rm -f junk.c junk.cpp
12854 )
12855 done
12856
12857 sed < config.status >> lib-src/config.values \
12858   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
12859   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
12860   -e 's/^\([^ ]*\) $/\1 ""/' \
12861   -e 's/ 1$/ t/'
12862
12863
12864 exit 0
12865 EOF
12866 chmod +x $CONFIG_STATUS
12867 rm -fr confdefs* $ac_clean_files
12868 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
12869