XEmacs 21.2-b4
[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     mips-nec-sysv*)
1246     machine=mips-nec
1247     NON_GNU_CC=/usr/ccs/bin/cc
1248     NON_GNU_CPP=/usr/ccs/lib/cpp
1249   ;;
1250
1251       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1252   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1253     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1254   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1255   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1256   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1257   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1258   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1259   mips-sgi-irix*      ) opsys=irix5-0 ;;
1260
1261     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1262   *-sony-news* ) opsys=newsos5 ;;
1263
1264     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1265
1266     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1267         case "$canonical" in
1268       m68*-sunos1* )             machine=sun1     ;;
1269       m68*-sunos2* )             machine=sun2     ;;
1270       m68* )                     machine=sun3     ;;
1271       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1272       i*86-*-* )                 machine=intel386 ;;
1273       rs6000* )                  machine=rs6000   ;;
1274     esac
1275
1276         case "$canonical" in *-sunos5*)
1277       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1278     esac
1279
1280                     case "$canonical" in
1281       *-sunos4* )
1282         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1283         : ;;
1284       *-solaris2* )
1285         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1286         RANLIB=':' ;;
1287     esac
1288
1289     case "$canonical" in
1290       *-solaris*          )
1291         opsys=sol2
1292         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1293         { test "$extra_verbose" = "yes" && cat << EOF
1294     Defining OS_RELEASE = $os_release
1295 EOF
1296 cat >> confdefs.h <<EOF
1297 #define OS_RELEASE $os_release
1298 EOF
1299 }
1300  ;;
1301
1302             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1303       *-sunos4.0*         ) opsys=sunos4-0      ;;
1304       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1305       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1306       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1307       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1308       *-mach*             ) opsys=mach-bsd4-3   ;;
1309       *                   ) opsys=bsd4-2        ;;
1310     esac
1311
1312     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1313
1314         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1315   ;;
1316
1317     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1318
1319     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1320   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1321
1322     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1323
1324     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1325
1326     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1327       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1328
1329     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1330
1331     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1332
1333     vax-dec-* )
1334     case "$canonical" in
1335       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1336       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1337       *-mach* )                         opsys=mach-bsd4-3 ;;
1338     esac
1339   ;;
1340
1341     ns16k-whitechapel-* ) machine=mg1 ;;
1342
1343     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1344
1345     i[3-9]86-*-* )
1346     machine=intel386
1347     case "$canonical" in
1348       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1349       *-isc2.2* )               opsys=isc2-2 ;;
1350       *-isc4.0* )               opsys=isc4-0 ;;
1351       *-isc4.* )                opsys=isc4-1
1352                                 GCC_TEST_OPTIONS=-posix
1353                                 NON_GCC_TEST_OPTIONS=-Xp
1354                                 ;;
1355       *-isc* )                  opsys=isc3-0 ;;
1356       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1357       *-esix* )                 opsys=esix ;;
1358       *-mach* )                 opsys=mach-bsd4-3 ;;
1359       *-xenix* )                opsys=xenix ;;
1360       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1361       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1362       *-bsdi3* )                opsys=bsdos3 ;;
1363       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1364       *-bsdi2* )                opsys=bsdos2 ;;
1365       *-sco3.2v5* )             opsys=sco5 ;
1366                                                         if test "$dynamic" = "yes" ; then
1367                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1368         else
1369                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1370         fi ;;
1371       *-386bsd* )               opsys=386bsd ;;
1372       *-freebsd* )              opsys=freebsd ;;
1373       *-nextstep* )             opsys=nextstep ;;
1374       *-pc-cygwin32 )           opsys=cygwin32 ;;
1375           esac
1376   ;;
1377
1378     m68k-*-linux* ) machine=m68k opsys=linux ;;
1379
1380     arm-*-linux* ) machine=arm opsys=linux ;;
1381
1382 esac
1383
1384 if test -z "$machine" -o -z "$opsys"; then
1385   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1386    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1387   ) >&2
1388   exit 1
1389 fi
1390
1391 if test -z "$dynamic"; then
1392   case "$opsys" in
1393     hpux* | sunos4* | sco5 ) dynamic=no ;;
1394     *) dynamic=yes ;;
1395   esac
1396 fi
1397 if test "$dynamic" = "yes"; then
1398   case "$opsys" in
1399     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1400     decosf* ) ld_call_shared="-call_shared" ;;
1401   esac
1402 else   case "$opsys" in
1403     sol2 )
1404       echo "Static linking is not supported on Solaris 2."
1405       echo "Rerun configure without specifying --dynamic=no."
1406       exit 1 ;;
1407     linux   ) ld_call_shared="-Bstatic" ;;
1408     decosf* ) ld_call_shared="-non_shared" ;;
1409   esac
1410 fi
1411
1412 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1413
1414 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1415 { test "$extra_verbose" = "yes" && cat << EOF
1416     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1417 EOF
1418 cat >> confdefs.h <<EOF
1419 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1420 EOF
1421 }
1422
1423
1424 machfile="m/${machine}.h"
1425 opsysfile="s/${opsys}.h"
1426
1427
1428 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1429 if test "$with_workshop $with_tooltalk" = "yes no"; then
1430   (echo "$progname: Usage error:"
1431 echo " " "--with-workshop requires --with-tooltalk"
1432 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1433 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1434 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1435 fi
1436
1437 if test "$with_workshop" = "yes"; then
1438   { test "$extra_verbose" = "yes" && cat << \EOF
1439     Defining SUNPRO
1440 EOF
1441 cat >> confdefs.h <<\EOF
1442 #define SUNPRO 1
1443 EOF
1444 }
1445
1446   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1447    echo "    xemacs will be linked with \"sunpro.o\""
1448  fi
1449 fi
1450
1451 if test "$with_clash_detection" = "yes"; then
1452   { test "$extra_verbose" = "yes" && cat << \EOF
1453     Defining CLASH_DETECTION
1454 EOF
1455 cat >> confdefs.h <<\EOF
1456 #define CLASH_DETECTION 1
1457 EOF
1458 }
1459
1460   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1461    echo "    xemacs will be linked with \"filelock.o\""
1462  fi
1463 fi
1464
1465 test -n "$compiler" && CC="$compiler"
1466 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1467 fi
1468
1469 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1470 if test "${CFLAGS-unset}" != unset
1471   then cflags_specified=yes;
1472   else cflags_specified=no;
1473 fi
1474
1475 xe_save_CFLAGS="$CFLAGS"
1476
1477 # Extract the first word of "gcc", so it can be a program name with args.
1478 set dummy gcc; ac_word=$2
1479 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1480 echo "configure:1481: checking for $ac_word" >&5
1481
1482 if test -n "$CC"; then
1483   ac_cv_prog_CC="$CC" # Let the user override the test.
1484 else
1485   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1486   for ac_dir in $PATH; do
1487     test -z "$ac_dir" && ac_dir=.
1488     if test -f $ac_dir/$ac_word; then
1489       ac_cv_prog_CC="gcc"
1490       break
1491     fi
1492   done
1493   IFS="$ac_save_ifs"
1494 fi
1495 CC="$ac_cv_prog_CC"
1496 if test -n "$CC"; then
1497   echo "$ac_t""$CC" 1>&6
1498 else
1499   echo "$ac_t""no" 1>&6
1500 fi
1501
1502 if test -z "$CC"; then
1503   # Extract the first word of "cc", so it can be a program name with args.
1504 set dummy cc; ac_word=$2
1505 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1506 echo "configure:1507: checking for $ac_word" >&5
1507
1508 if test -n "$CC"; then
1509   ac_cv_prog_CC="$CC" # Let the user override the test.
1510 else
1511   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1512   ac_prog_rejected=no
1513   for ac_dir in $PATH; do
1514     test -z "$ac_dir" && ac_dir=.
1515     if test -f $ac_dir/$ac_word; then
1516       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1517         ac_prog_rejected=yes
1518         continue
1519       fi
1520       ac_cv_prog_CC="cc"
1521       break
1522     fi
1523   done
1524   IFS="$ac_save_ifs"
1525 if test $ac_prog_rejected = yes; then
1526   # We found a bogon in the path, so make sure we never use it.
1527   set dummy $ac_cv_prog_CC
1528   shift
1529   if test $# -gt 0; then
1530     # We chose a different compiler from the bogus one.
1531     # However, it has the same basename, so the bogon will be chosen
1532     # first if we set CC to just the basename; use the full file name.
1533     shift
1534     set dummy "$ac_dir/$ac_word" "$@"
1535     shift
1536     ac_cv_prog_CC="$@"
1537   fi
1538 fi
1539 fi
1540 CC="$ac_cv_prog_CC"
1541 if test -n "$CC"; then
1542   echo "$ac_t""$CC" 1>&6
1543 else
1544   echo "$ac_t""no" 1>&6
1545 fi
1546
1547   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1548 fi
1549
1550 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1551 echo "configure:1552: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1552
1553 ac_ext=c
1554 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1555 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1556 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1557 ac_cpp='$CPP '"$xe_cppflags"
1558 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1559 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1560 cross_compiling=no
1561
1562 cat > conftest.$ac_ext <<EOF
1563 #line 1564 "configure"
1564 #include "confdefs.h"
1565 main(){return(0);}
1566 EOF
1567 if { (eval echo configure:1568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1568   ac_cv_prog_cc_works=yes
1569   # If we can't run a trivial program, we are probably using a cross compiler.
1570   if (./conftest; exit) 2>/dev/null; then
1571     ac_cv_prog_cc_cross=no
1572   else
1573     ac_cv_prog_cc_cross=yes
1574   fi
1575 else
1576   echo "configure: failed program was:" >&5
1577   cat conftest.$ac_ext >&5
1578   ac_cv_prog_cc_works=no
1579 fi
1580 rm -fr conftest*
1581
1582 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1583 if test $ac_cv_prog_cc_works = no; then
1584   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1585 fi
1586 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1587 echo "configure:1588: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1588 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1589 cross_compiling=$ac_cv_prog_cc_cross
1590
1591 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1592 echo "configure:1593: checking whether we are using GNU C" >&5
1593
1594 cat > conftest.c <<EOF
1595 #ifdef __GNUC__
1596   yes;
1597 #endif
1598 EOF
1599 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1600   ac_cv_prog_gcc=yes
1601 else
1602   ac_cv_prog_gcc=no
1603 fi
1604
1605 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1606
1607 if test $ac_cv_prog_gcc = yes; then
1608   GCC=yes
1609   ac_test_CFLAGS="${CFLAGS+set}"
1610   ac_save_CFLAGS="$CFLAGS"
1611   CFLAGS=
1612   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1613 echo "configure:1614: checking whether ${CC-cc} accepts -g" >&5
1614
1615 echo 'void f(){}' > conftest.c
1616 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1617   ac_cv_prog_cc_g=yes
1618 else
1619   ac_cv_prog_cc_g=no
1620 fi
1621 rm -f conftest*
1622
1623
1624 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1625   if test "$ac_test_CFLAGS" = set; then
1626     CFLAGS="$ac_save_CFLAGS"
1627   elif test $ac_cv_prog_cc_g = yes; then
1628     CFLAGS="-g -O2"
1629   else
1630     CFLAGS="-O2"
1631   fi
1632 else
1633   GCC=
1634   test "${CFLAGS+set}" = set || CFLAGS="-g"
1635 fi
1636  
1637 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1638   CC=${NON_GNU_CC-cc}
1639   # Extract the first word of "gcc", so it can be a program name with args.
1640 set dummy gcc; ac_word=$2
1641 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1642 echo "configure:1643: checking for $ac_word" >&5
1643
1644 if test -n "$CC"; then
1645   ac_cv_prog_CC="$CC" # Let the user override the test.
1646 else
1647   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1648   for ac_dir in $PATH; do
1649     test -z "$ac_dir" && ac_dir=.
1650     if test -f $ac_dir/$ac_word; then
1651       ac_cv_prog_CC="gcc"
1652       break
1653     fi
1654   done
1655   IFS="$ac_save_ifs"
1656 fi
1657 CC="$ac_cv_prog_CC"
1658 if test -n "$CC"; then
1659   echo "$ac_t""$CC" 1>&6
1660 else
1661   echo "$ac_t""no" 1>&6
1662 fi
1663
1664 if test -z "$CC"; then
1665   # Extract the first word of "cc", so it can be a program name with args.
1666 set dummy cc; ac_word=$2
1667 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1668 echo "configure:1669: checking for $ac_word" >&5
1669
1670 if test -n "$CC"; then
1671   ac_cv_prog_CC="$CC" # Let the user override the test.
1672 else
1673   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1674   ac_prog_rejected=no
1675   for ac_dir in $PATH; do
1676     test -z "$ac_dir" && ac_dir=.
1677     if test -f $ac_dir/$ac_word; then
1678       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1679         ac_prog_rejected=yes
1680         continue
1681       fi
1682       ac_cv_prog_CC="cc"
1683       break
1684     fi
1685   done
1686   IFS="$ac_save_ifs"
1687 if test $ac_prog_rejected = yes; then
1688   # We found a bogon in the path, so make sure we never use it.
1689   set dummy $ac_cv_prog_CC
1690   shift
1691   if test $# -gt 0; then
1692     # We chose a different compiler from the bogus one.
1693     # However, it has the same basename, so the bogon will be chosen
1694     # first if we set CC to just the basename; use the full file name.
1695     shift
1696     set dummy "$ac_dir/$ac_word" "$@"
1697     shift
1698     ac_cv_prog_CC="$@"
1699   fi
1700 fi
1701 fi
1702 CC="$ac_cv_prog_CC"
1703 if test -n "$CC"; then
1704   echo "$ac_t""$CC" 1>&6
1705 else
1706   echo "$ac_t""no" 1>&6
1707 fi
1708
1709   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1710 fi
1711
1712 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1713 echo "configure:1714: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1714
1715 ac_ext=c
1716 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1717 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1718 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1719 ac_cpp='$CPP '"$xe_cppflags"
1720 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1721 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1722 cross_compiling=no
1723
1724 cat > conftest.$ac_ext <<EOF
1725 #line 1726 "configure"
1726 #include "confdefs.h"
1727 main(){return(0);}
1728 EOF
1729 if { (eval echo configure:1730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1730   ac_cv_prog_cc_works=yes
1731   # If we can't run a trivial program, we are probably using a cross compiler.
1732   if (./conftest; exit) 2>/dev/null; then
1733     ac_cv_prog_cc_cross=no
1734   else
1735     ac_cv_prog_cc_cross=yes
1736   fi
1737 else
1738   echo "configure: failed program was:" >&5
1739   cat conftest.$ac_ext >&5
1740   ac_cv_prog_cc_works=no
1741 fi
1742 rm -fr conftest*
1743
1744 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1745 if test $ac_cv_prog_cc_works = no; then
1746   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1747 fi
1748 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1749 echo "configure:1750: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1750 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1751 cross_compiling=$ac_cv_prog_cc_cross
1752
1753 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1754 echo "configure:1755: checking whether we are using GNU C" >&5
1755
1756 cat > conftest.c <<EOF
1757 #ifdef __GNUC__
1758   yes;
1759 #endif
1760 EOF
1761 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1762   ac_cv_prog_gcc=yes
1763 else
1764   ac_cv_prog_gcc=no
1765 fi
1766
1767 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1768
1769 if test $ac_cv_prog_gcc = yes; then
1770   GCC=yes
1771   ac_test_CFLAGS="${CFLAGS+set}"
1772   ac_save_CFLAGS="$CFLAGS"
1773   CFLAGS=
1774   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1775 echo "configure:1776: checking whether ${CC-cc} accepts -g" >&5
1776
1777 echo 'void f(){}' > conftest.c
1778 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1779   ac_cv_prog_cc_g=yes
1780 else
1781   ac_cv_prog_cc_g=no
1782 fi
1783 rm -f conftest*
1784
1785
1786 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1787   if test "$ac_test_CFLAGS" = set; then
1788     CFLAGS="$ac_save_CFLAGS"
1789   elif test $ac_cv_prog_cc_g = yes; then
1790     CFLAGS="-g -O2"
1791   else
1792     CFLAGS="-O2"
1793   fi
1794 else
1795   GCC=
1796   test "${CFLAGS+set}" = set || CFLAGS="-g"
1797 fi
1798
1799 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1800   CC=gcc
1801   # Extract the first word of "gcc", so it can be a program name with args.
1802 set dummy gcc; ac_word=$2
1803 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1804 echo "configure:1805: checking for $ac_word" >&5
1805
1806 if test -n "$CC"; then
1807   ac_cv_prog_CC="$CC" # Let the user override the test.
1808 else
1809   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1810   for ac_dir in $PATH; do
1811     test -z "$ac_dir" && ac_dir=.
1812     if test -f $ac_dir/$ac_word; then
1813       ac_cv_prog_CC="gcc"
1814       break
1815     fi
1816   done
1817   IFS="$ac_save_ifs"
1818 fi
1819 CC="$ac_cv_prog_CC"
1820 if test -n "$CC"; then
1821   echo "$ac_t""$CC" 1>&6
1822 else
1823   echo "$ac_t""no" 1>&6
1824 fi
1825
1826 if test -z "$CC"; then
1827   # Extract the first word of "cc", so it can be a program name with args.
1828 set dummy cc; ac_word=$2
1829 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1830 echo "configure:1831: checking for $ac_word" >&5
1831
1832 if test -n "$CC"; then
1833   ac_cv_prog_CC="$CC" # Let the user override the test.
1834 else
1835   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1836   ac_prog_rejected=no
1837   for ac_dir in $PATH; do
1838     test -z "$ac_dir" && ac_dir=.
1839     if test -f $ac_dir/$ac_word; then
1840       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1841         ac_prog_rejected=yes
1842         continue
1843       fi
1844       ac_cv_prog_CC="cc"
1845       break
1846     fi
1847   done
1848   IFS="$ac_save_ifs"
1849 if test $ac_prog_rejected = yes; then
1850   # We found a bogon in the path, so make sure we never use it.
1851   set dummy $ac_cv_prog_CC
1852   shift
1853   if test $# -gt 0; then
1854     # We chose a different compiler from the bogus one.
1855     # However, it has the same basename, so the bogon will be chosen
1856     # first if we set CC to just the basename; use the full file name.
1857     shift
1858     set dummy "$ac_dir/$ac_word" "$@"
1859     shift
1860     ac_cv_prog_CC="$@"
1861   fi
1862 fi
1863 fi
1864 CC="$ac_cv_prog_CC"
1865 if test -n "$CC"; then
1866   echo "$ac_t""$CC" 1>&6
1867 else
1868   echo "$ac_t""no" 1>&6
1869 fi
1870
1871   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1872 fi
1873
1874 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1875 echo "configure:1876: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1876
1877 ac_ext=c
1878 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1879 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1880 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1881 ac_cpp='$CPP '"$xe_cppflags"
1882 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1883 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1884 cross_compiling=no
1885
1886 cat > conftest.$ac_ext <<EOF
1887 #line 1888 "configure"
1888 #include "confdefs.h"
1889 main(){return(0);}
1890 EOF
1891 if { (eval echo configure:1892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1892   ac_cv_prog_cc_works=yes
1893   # If we can't run a trivial program, we are probably using a cross compiler.
1894   if (./conftest; exit) 2>/dev/null; then
1895     ac_cv_prog_cc_cross=no
1896   else
1897     ac_cv_prog_cc_cross=yes
1898   fi
1899 else
1900   echo "configure: failed program was:" >&5
1901   cat conftest.$ac_ext >&5
1902   ac_cv_prog_cc_works=no
1903 fi
1904 rm -fr conftest*
1905
1906 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1907 if test $ac_cv_prog_cc_works = no; then
1908   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1909 fi
1910 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1911 echo "configure:1912: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1912 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1913 cross_compiling=$ac_cv_prog_cc_cross
1914
1915 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1916 echo "configure:1917: checking whether we are using GNU C" >&5
1917
1918 cat > conftest.c <<EOF
1919 #ifdef __GNUC__
1920   yes;
1921 #endif
1922 EOF
1923 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1924   ac_cv_prog_gcc=yes
1925 else
1926   ac_cv_prog_gcc=no
1927 fi
1928
1929 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1930
1931 if test $ac_cv_prog_gcc = yes; then
1932   GCC=yes
1933   ac_test_CFLAGS="${CFLAGS+set}"
1934   ac_save_CFLAGS="$CFLAGS"
1935   CFLAGS=
1936   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1937 echo "configure:1938: checking whether ${CC-cc} accepts -g" >&5
1938
1939 echo 'void f(){}' > conftest.c
1940 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1941   ac_cv_prog_cc_g=yes
1942 else
1943   ac_cv_prog_cc_g=no
1944 fi
1945 rm -f conftest*
1946
1947
1948 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1949   if test "$ac_test_CFLAGS" = set; then
1950     CFLAGS="$ac_save_CFLAGS"
1951   elif test $ac_cv_prog_cc_g = yes; then
1952     CFLAGS="-g -O2"
1953   else
1954     CFLAGS="-O2"
1955   fi
1956 else
1957   GCC=
1958   test "${CFLAGS+set}" = set || CFLAGS="-g"
1959 fi
1960
1961 fi
1962 CFLAGS="$xe_save_CFLAGS"
1963
1964
1965 test -n "$CPP" -a -d "$CPP" && CPP=
1966
1967 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1968
1969 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1970 echo "configure:1971: checking how to run the C preprocessor" >&5
1971 # On Suns, sometimes $CPP names a directory.
1972 if test -n "$CPP" && test -d "$CPP"; then
1973   CPP=
1974 fi
1975 if test -z "$CPP"; then
1976
1977   # This must be in double quotes, not single quotes, because CPP may get
1978   # substituted into the Makefile and "${CC-cc}" will confuse make.
1979   CPP="${CC-cc} -E"
1980   # On the NeXT, cc -E runs the code through the compiler's parser,
1981   # not just through cpp.
1982   cat > conftest.$ac_ext <<EOF
1983 #line 1984 "configure"
1984 #include "confdefs.h"
1985 #include <assert.h>
1986 Syntax Error
1987 EOF
1988 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1989 { (eval echo configure:1990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1990 ac_err=`grep -v '^ *+' conftest.out`
1991 if test -z "$ac_err"; then
1992   :
1993 else
1994   echo "$ac_err" >&5
1995   echo "configure: failed program was:" >&5
1996   cat conftest.$ac_ext >&5
1997   rm -rf conftest*
1998   CPP="${CC-cc} -E -traditional-cpp"
1999   cat > conftest.$ac_ext <<EOF
2000 #line 2001 "configure"
2001 #include "confdefs.h"
2002 #include <assert.h>
2003 Syntax Error
2004 EOF
2005 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2006 { (eval echo configure:2007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2007 ac_err=`grep -v '^ *+' conftest.out`
2008 if test -z "$ac_err"; then
2009   :
2010 else
2011   echo "$ac_err" >&5
2012   echo "configure: failed program was:" >&5
2013   cat conftest.$ac_ext >&5
2014   rm -rf conftest*
2015   CPP=/lib/cpp
2016 fi
2017 rm -f conftest*
2018 fi
2019 rm -f conftest*
2020   ac_cv_prog_CPP="$CPP"
2021   CPP="$ac_cv_prog_CPP"
2022 else
2023   ac_cv_prog_CPP="$CPP"
2024 fi
2025 echo "$ac_t""$CPP" 1>&6
2026
2027
2028 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2029 echo "configure:2030: checking for AIX" >&5
2030 cat > conftest.$ac_ext <<EOF
2031 #line 2032 "configure"
2032 #include "confdefs.h"
2033 #ifdef _AIX
2034   yes
2035 #endif
2036
2037 EOF
2038 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2039   egrep "yes" >/dev/null 2>&1; then
2040   rm -rf conftest*
2041   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2042     Defining _ALL_SOURCE
2043 EOF
2044 cat >> confdefs.h <<\EOF
2045 #define _ALL_SOURCE 1
2046 EOF
2047 }
2048
2049 else
2050   rm -rf conftest*
2051   echo "$ac_t""no" 1>&6
2052 fi
2053 rm -f conftest*
2054
2055
2056
2057 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2058 echo "configure:2059: checking for GNU libc" >&5
2059 cat > conftest.$ac_ext <<EOF
2060 #line 2061 "configure"
2061 #include "confdefs.h"
2062 #include <features.h>
2063 int main() {
2064
2065 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2066 #error Not a GNU libc system :-(
2067 ******* ======= ******** &&&&&&&&
2068 #endif
2069
2070 ; return 0; }
2071 EOF
2072 if { (eval echo configure:2073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2073   rm -rf conftest*
2074   have_glibc=yes
2075 else
2076   echo "configure: failed program was:" >&5
2077   cat conftest.$ac_ext >&5
2078   rm -rf conftest*
2079   have_glibc=no
2080 fi
2081 rm -f conftest*
2082 echo "$ac_t""$have_glibc" 1>&6
2083 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2084     Defining _GNU_SOURCE
2085 EOF
2086 cat >> confdefs.h <<\EOF
2087 #define _GNU_SOURCE 1
2088 EOF
2089 }
2090
2091
2092
2093 cat > conftest.$ac_ext <<EOF
2094 #line 2095 "configure"
2095 #include "confdefs.h"
2096 int main () {
2097 #if defined __SUNPRO_C
2098 return 11;
2099 #elif defined __DECC
2100 return 12;
2101 #else
2102 return 0;
2103 #endif
2104 }
2105 EOF
2106 if { (eval echo configure:2107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2107 then
2108   :
2109 else
2110   conftest_rc="$?"
2111   echo "configure: failed program was:" >&5
2112   cat conftest.$ac_ext >&5
2113   rm -fr conftest*
2114   case "$conftest_rc" in
2115   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2116   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2117 esac
2118 fi
2119 rm -fr conftest*
2120
2121
2122
2123
2124 echo "Extracting information from the machine- and system-dependent headers..."
2125
2126 tempcname="conftest.c"
2127
2128
2129
2130 cat > $tempcname <<EOF
2131 #define NOT_C_CODE
2132 #define C_SWITCH_SITE
2133 #define C_SWITCH_X_SITE
2134 #define LD_SWITCH_SITE
2135 #define LD_SWITCH_X_SITE
2136 #define LD_SWITCH_X_SITE_AUX
2137 #define OS_RELEASE $os_release
2138 #include "$srcdir/src/$opsysfile"
2139 #include "$srcdir/src/$machfile"
2140
2141 #ifndef LIBS_MACHINE
2142 #define LIBS_MACHINE
2143 #endif
2144 configure___ libs_machine=LIBS_MACHINE
2145
2146 #ifndef LIBS_SYSTEM
2147 #define LIBS_SYSTEM
2148 #endif
2149 configure___ libs_system=LIBS_SYSTEM
2150
2151 #ifndef LIBS_TERMCAP
2152 #define LIBS_TERMCAP
2153 #endif
2154 configure___ libs_termcap=LIBS_TERMCAP
2155
2156 #ifndef LIB_STANDARD
2157 #define LIB_STANDARD
2158 #endif
2159 configure___ libs_standard=LIB_STANDARD
2160
2161
2162 #ifndef OBJECTS_MACHINE
2163 #define OBJECTS_MACHINE
2164 #endif
2165 configure___ objects_machine=OBJECTS_MACHINE
2166
2167 #ifndef OBJECTS_SYSTEM
2168 #define OBJECTS_SYSTEM
2169 #endif
2170 configure___ objects_system=OBJECTS_SYSTEM
2171
2172
2173 #ifndef C_SWITCH_MACHINE
2174 #define C_SWITCH_MACHINE
2175 #endif
2176 configure___ c_switch_machine=C_SWITCH_MACHINE
2177
2178 #ifndef C_SWITCH_SYSTEM
2179 #define C_SWITCH_SYSTEM
2180 #endif
2181 configure___ c_switch_system=C_SWITCH_SYSTEM
2182
2183
2184 #ifndef LD_SWITCH_MACHINE
2185 #define LD_SWITCH_MACHINE
2186 #endif
2187 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2188
2189 #ifndef LD_SWITCH_SYSTEM
2190 #define LD_SWITCH_SYSTEM
2191 #endif
2192 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2193
2194
2195 #ifndef UNEXEC
2196 #define UNEXEC "unexec.o"
2197 #endif
2198 configure___ unexec=UNEXEC
2199
2200
2201 #ifndef LD_SWITCH_SHARED
2202 #define LD_SWITCH_SHARED "-c"
2203 #endif
2204 configure___ ld_switch_shared=LD_SWITCH_SHARED
2205
2206
2207 #ifdef ORDINARY_LINK
2208 #define LD "\$(CC) \$(CFLAGS)"
2209 #else /* no ORDINARY LINK */
2210 #ifdef COFF_ENCAPSULATE
2211 #define LD "\$(CC) -nostdlib"
2212 #else /* not COFF_ENCAPSULATE */
2213 #ifdef LINKER
2214 #define LD LINKER
2215 #else /* ! defined (LINKER) */
2216 #define LD "ld"
2217 #endif /* ! defined (LINKER) */
2218 #endif /* ! defined (COFF_ENCAPSULATE) */
2219 #endif /* not ORDINARY_LINK */
2220 configure___ ld=LD
2221
2222 #ifndef LIB_GCC
2223 #define LIB_GCC
2224 #endif
2225 configure___ lib_gcc=LIB_GCC
2226
2227 #ifndef LD_TEXT_START_ADDR
2228 #define LD_TEXT_START_ADDR
2229 #endif
2230 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2231
2232
2233 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2234 #ifdef NO_REMAP
2235 #ifdef COFF_ENCAPSULATE
2236 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2237 #else /* ! defined (COFF_ENCAPSULATE) */
2238 #define START_FILES "pre-crt0.o /lib/crt0.o"
2239 #endif /* ! defined (COFF_ENCAPSULATE) */
2240 #else /* ! defined (NO_REMAP) */
2241 #define START_FILES "ecrt0.o"
2242 #endif /* ! defined (NO_REMAP) */
2243 #endif /* no ORDINARY_LINK */
2244 #ifndef START_FILES
2245 #define START_FILES
2246 #endif
2247 configure___ start_files=START_FILES
2248
2249 #ifdef ORDINARY_LINK
2250 configure___ ordinary_link=yes
2251 #else
2252 configure___ ordinary_link=no
2253 #endif
2254
2255 #ifdef SYSTEM_MALLOC
2256 configure___ system_malloc=yes
2257 #else
2258 configure___ system_malloc=no
2259 #endif
2260
2261 #ifdef TERMINFO
2262 configure___ have_terminfo=yes
2263 #else
2264 configure___ have_terminfo=no
2265 #endif
2266
2267 #ifdef MAIL_USE_FLOCK
2268 configure___ mail_use_flock=yes
2269 #else
2270 configure___ mail_use_flock=no
2271 #endif
2272
2273 #ifdef MAIL_USE_LOCKF
2274 configure___ mail_use_lockf=yes
2275 #else
2276 configure___ mail_use_lockf=no
2277 #endif
2278
2279 EOF
2280
2281 CPP=`eval "echo $CPP"`
2282 eval `$CPP -Isrc $tempcname \
2283         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2284
2285 rm $tempcname
2286
2287 test "$extra_verbose" = "yes" && \
2288   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 ""
2289
2290 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2291
2292 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2293
2294 if test "$cflags_specified" = "no"; then
2295       if   test "$GCC" = "yes"; then
2296     CFLAGS="-g -O3 -Wall -Wno-switch"
2297                     test "$opsys $machine" = "cygwin32 intel386" && \
2298       CFLAGS="-g -O2 -Wall -Wno-switch"
2299   elif test "$__SUNPRO_C" = "yes"; then
2300     case "$opsys" in
2301       sol2    ) CFLAGS="-v -xO4" ;;
2302       sunos4* ) CFLAGS="-xO2";;
2303     esac
2304   elif test "$__DECC" = "yes"; then
2305     CFLAGS="-O3"
2306   elif test "$CC" = "xlc"; then
2307     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2308     else
2309     CFLAGS="-O" ;  fi
2310 fi
2311
2312
2313 if test "$GCC" = "yes"; then
2314   set x $ld_switch_system; shift; ld_switch_system=""
2315   while test -n "$1"; do
2316     case $1 in
2317       -L  | -l  | -u         ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2318       -L* | -l* | -u* | -Wl* ) ld_switch_system="$ld_switch_system $1" ;;
2319       -Xlinker* ) ;;
2320       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2321     esac
2322     shift
2323   done
2324 fi
2325
2326 if test "$GCC" = "yes"; then
2327   set x $ld_switch_machine; shift; ld_switch_machine=""
2328   while test -n "$1"; do
2329     case $1 in
2330       -L  | -l  | -u         ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2331       -L* | -l* | -u* | -Wl* ) ld_switch_machine="$ld_switch_machine $1" ;;
2332       -Xlinker* ) ;;
2333       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2334     esac
2335     shift
2336   done
2337 fi
2338
2339 if test "$GCC" = "yes"; then
2340   set x $LDFLAGS; shift; LDFLAGS=""
2341   while test -n "$1"; do
2342     case $1 in
2343       -L  | -l  | -u         ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2344       -L* | -l* | -u* | -Wl* ) LDFLAGS="$LDFLAGS $1" ;;
2345       -Xlinker* ) ;;
2346       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2347     esac
2348     shift
2349   done
2350 fi
2351
2352 if test "$GCC" = "yes"; then
2353   set x $ld_call_shared; shift; ld_call_shared=""
2354   while test -n "$1"; do
2355     case $1 in
2356       -L  | -l  | -u         ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2357       -L* | -l* | -u* | -Wl* ) ld_call_shared="$ld_call_shared $1" ;;
2358       -Xlinker* ) ;;
2359       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2360     esac
2361     shift
2362   done
2363 fi
2364
2365 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2366    echo "    xemacs will be linked with \"$objects_machine\""
2367  fi
2368 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2369    echo "    xemacs will be linked with \"$objects_system\""
2370  fi
2371 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2372    echo "    xemacs will be linked with \"$unexec\""
2373  fi
2374
2375 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2376 echo "configure:2377: checking for dynodump" >&5
2377 if test "$unexec" != "unexsol2.o"; then
2378   echo "$ac_t""no" 1>&6
2379 else
2380   echo "$ac_t""yes" 1>&6
2381   { test "$extra_verbose" = "yes" && cat << \EOF
2382     Defining DYNODUMP
2383 EOF
2384 cat >> confdefs.h <<\EOF
2385 #define DYNODUMP 1
2386 EOF
2387 }
2388
2389   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2390   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2391   case "$machine" in
2392     sparc   ) dynodump_arch=sparc ;;
2393     *86*    ) dynodump_arch=i386  ;;
2394     powerpc ) dynodump_arch=ppc   ;;
2395   esac
2396     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
2397 fi
2398
2399
2400 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2401
2402 if test "$unexec" = "unexaix.o"; then
2403   if   test "$dynamic" = "no"; then
2404   start_flags="-Wl,-bnso,-bnodelcsect"
2405   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2406   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2407     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2408   done
2409   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2410     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2411   done
2412   
2413 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2414 echo "configure:2415: checking for terminateAndUnload in -lC" >&5
2415 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2416
2417 xe_check_libs=" -lC "
2418 cat > conftest.$ac_ext <<EOF
2419 #line 2420 "configure"
2420 #include "confdefs.h"
2421 /* Override any gcc2 internal prototype to avoid an error.  */
2422 /* We use char because int might match the return type of a gcc2
2423     builtin and then its argument prototype would still apply.  */
2424 char terminateAndUnload();
2425
2426 int main() {
2427 terminateAndUnload()
2428 ; return 0; }
2429 EOF
2430 if { (eval echo configure:2431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2431   rm -rf conftest*
2432   eval "ac_cv_lib_$ac_lib_var=yes"
2433 else
2434   echo "configure: failed program was:" >&5
2435   cat conftest.$ac_ext >&5
2436   rm -rf conftest*
2437   eval "ac_cv_lib_$ac_lib_var=no"
2438 fi
2439 rm -f conftest*
2440 xe_check_libs=""
2441
2442 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2443   echo "$ac_t""yes" 1>&6
2444   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2445 else
2446   echo "$ac_t""no" 1>&6
2447 fi
2448
2449
2450   fi
2451 elif test -n "$ld_text_start_addr"; then
2452   start_flags="-T $ld_text_start_addr -e __start"
2453 fi
2454
2455
2456
2457
2458 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2459  test -z "$linker" &&  linker='$(CC) -nostdlib'
2460  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2461 fi
2462 test "$GCC" != "yes" && lib_gcc=
2463
2464
2465
2466
2467
2468 if test -n "$site_prefixes"; then
2469   for arg in $site_prefixes; do
2470     case "$arg" in
2471         -* ) ;;
2472         * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;;
2473     esac
2474     c_switch_site="$c_switch_site $argi" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argi\" to \$c_switch_site"; fi
2475     ld_switch_site="$ld_switch_site $argl" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argl\" to \$ld_switch_site"; fi
2476   done
2477 fi
2478
2479 if test -n "$site_libraries"; then
2480   for arg in $site_libraries; do
2481     case "$arg" in -* ) ;; * ) arg="-L${arg}" ;; esac
2482     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2483   done
2484 fi
2485
2486 if test -n "$site_includes"; then
2487   for arg in $site_includes; do
2488     case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac
2489     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2490   done
2491 fi
2492
2493
2494 for dir in "/usr/ccs/lib"; do
2495   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
2496 done
2497
2498 if test -n "$site_runtime_libraries"; then
2499   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2500   export LD_RUN_PATH
2501 fi
2502
2503
2504 if   test "$dynamic" = "no"; then add_runtime_path=no
2505 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2506 else case "$opsys" in
2507        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2508        * ) add_runtime_path=no ;;
2509      esac
2510 fi
2511
2512 if test "$add_runtime_path" = "yes"; then
2513       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2514 echo "configure:2515: checking "for runtime libraries flag"" >&5
2515   case "$opsys" in
2516     sol2 ) dash_r="-R" ;;
2517     decosf* | linux* ) dash_r="-rpath " ;;
2518     *)
2519       dash_r=""
2520       for try_dash_r in "-R" "-R " "-rpath "; do
2521         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2522         
2523 if test "$GCC" = "yes"; then
2524   set x $xe_check_libs; shift; xe_check_libs=""
2525   while test -n "$1"; do
2526     case $1 in
2527       -L  | -l  | -u         ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2528       -L* | -l* | -u* | -Wl* ) xe_check_libs="$xe_check_libs $1" ;;
2529       -Xlinker* ) ;;
2530       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2531     esac
2532     shift
2533   done
2534 fi
2535         cat > conftest.$ac_ext <<EOF
2536 #line 2537 "configure"
2537 #include "confdefs.h"
2538
2539 int main() {
2540
2541 ; return 0; }
2542 EOF
2543 if { (eval echo configure:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2544   rm -rf conftest*
2545   dash_r="$try_dash_r"
2546 else
2547   echo "configure: failed program was:" >&5
2548   cat conftest.$ac_ext >&5
2549 fi
2550 rm -f conftest*
2551         xe_check_libs=""
2552         test -n "$dash_r" && break
2553       done ;;
2554   esac
2555   if test -n "$dash_r";
2556     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2557     else echo "$ac_t""NONE" 1>&6
2558   fi
2559 fi
2560
2561 xe_add_unique_runpath_dir='
2562   xe_add_p=yes
2563   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2564   done
2565   if test "$xe_add_p" = "yes"; then
2566     test -n "$runpath" && runpath="${runpath}:"
2567     runpath="${runpath}${xe_runpath_dir}"
2568     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2569   fi'
2570
2571
2572
2573
2574 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2575     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2576   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2577   
2578         runpath="" runpath_dirs=""
2579   if test -n "$LD_RUN_PATH"; then
2580     runpath="$LD_RUN_PATH"
2581   elif test "$GCC" = "yes"; then
2582         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2583     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2584     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2585     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2586       case "$arg" in P,* | -L* | -R* )
2587         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2588           {
2589 xe_runpath_dir="$dir"
2590   test "$xe_runpath_dir" != "/lib"     -a \
2591         "$xe_runpath_dir" != "/usr/lib" -a \
2592         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2593   eval "$xe_add_unique_runpath_dir"
2594 }
2595         done ;;
2596       esac
2597     done
2598     ld_switch_run="$ld_switch_run_save"
2599     rm -f conftest*
2600   else
2601         for arg in $ld_switch_site $ld_switch_x_site; do
2602       case "$arg" in -L*) {
2603 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2604   test "$xe_runpath_dir" != "/lib"     -a \
2605         "$xe_runpath_dir" != "/usr/lib" -a \
2606         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2607   eval "$xe_add_unique_runpath_dir"
2608 };; esac
2609     done
2610         if test "$opsys $need_motif" = "sol2 yes"; then
2611       xe_runpath_dir="/opt/SUNWdt/lib";
2612       eval "$xe_add_unique_runpath_dir";
2613     fi
2614   fi 
2615   if test -n "$runpath"; then
2616     ld_switch_run="${dash_r}${runpath}"
2617     
2618 if test "$GCC" = "yes"; then
2619   set x $ld_switch_run; shift; ld_switch_run=""
2620   while test -n "$1"; do
2621     case $1 in
2622       -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2623       -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
2624       -Xlinker* ) ;;
2625       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2626     esac
2627     shift
2628   done
2629 fi
2630     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2631   fi
2632 fi
2633
2634
2635
2636 GNU_MALLOC=yes
2637 if test "$with_dlmalloc" != "no"; then
2638         doug_lea_malloc=yes
2639 else
2640         doug_lea_malloc=no
2641 fi
2642 after_morecore_hook_exists=yes
2643 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2644 echo "configure:2645: checking for malloc_get_state" >&5
2645
2646 cat > conftest.$ac_ext <<EOF
2647 #line 2648 "configure"
2648 #include "confdefs.h"
2649 /* System header to define __stub macros and hopefully few prototypes,
2650     which can conflict with char malloc_get_state(); below.  */
2651 #include <assert.h>
2652 /* Override any gcc2 internal prototype to avoid an error.  */
2653 /* We use char because int might match the return type of a gcc2
2654     builtin and then its argument prototype would still apply.  */
2655 char malloc_get_state();
2656
2657 int main() {
2658
2659 /* The GNU C library defines this for functions which it implements
2660     to always fail with ENOSYS.  Some functions are actually named
2661     something starting with __ and the normal name is an alias.  */
2662 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2663 choke me
2664 #else
2665 malloc_get_state();
2666 #endif
2667
2668 ; return 0; }
2669 EOF
2670 if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2671   rm -rf conftest*
2672   eval "ac_cv_func_malloc_get_state=yes"
2673 else
2674   echo "configure: failed program was:" >&5
2675   cat conftest.$ac_ext >&5
2676   rm -rf conftest*
2677   eval "ac_cv_func_malloc_get_state=no"
2678 fi
2679 rm -f conftest*
2680
2681 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2682   echo "$ac_t""yes" 1>&6
2683   :
2684 else
2685   echo "$ac_t""no" 1>&6
2686 doug_lea_malloc=no
2687 fi
2688
2689 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2690 echo "configure:2691: checking for malloc_set_state" >&5
2691
2692 cat > conftest.$ac_ext <<EOF
2693 #line 2694 "configure"
2694 #include "confdefs.h"
2695 /* System header to define __stub macros and hopefully few prototypes,
2696     which can conflict with char malloc_set_state(); below.  */
2697 #include <assert.h>
2698 /* Override any gcc2 internal prototype to avoid an error.  */
2699 /* We use char because int might match the return type of a gcc2
2700     builtin and then its argument prototype would still apply.  */
2701 char malloc_set_state();
2702
2703 int main() {
2704
2705 /* The GNU C library defines this for functions which it implements
2706     to always fail with ENOSYS.  Some functions are actually named
2707     something starting with __ and the normal name is an alias.  */
2708 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2709 choke me
2710 #else
2711 malloc_set_state();
2712 #endif
2713
2714 ; return 0; }
2715 EOF
2716 if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2717   rm -rf conftest*
2718   eval "ac_cv_func_malloc_set_state=yes"
2719 else
2720   echo "configure: failed program was:" >&5
2721   cat conftest.$ac_ext >&5
2722   rm -rf conftest*
2723   eval "ac_cv_func_malloc_set_state=no"
2724 fi
2725 rm -f conftest*
2726
2727 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2728   echo "$ac_t""yes" 1>&6
2729   :
2730 else
2731   echo "$ac_t""no" 1>&6
2732 doug_lea_malloc=no
2733 fi
2734
2735 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2736 echo "configure:2737: checking whether __after_morecore_hook exists" >&5
2737 cat > conftest.$ac_ext <<EOF
2738 #line 2739 "configure"
2739 #include "confdefs.h"
2740 extern void (* __after_morecore_hook)();
2741 int main() {
2742 __after_morecore_hook = 0
2743 ; return 0; }
2744 EOF
2745 if { (eval echo configure:2746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2746   rm -rf conftest*
2747   echo "$ac_t""yes" 1>&6
2748 else
2749   echo "configure: failed program was:" >&5
2750   cat conftest.$ac_ext >&5
2751   rm -rf conftest*
2752   echo "$ac_t""no" 1>&6
2753    after_morecore_hook_exists=no
2754 fi
2755 rm -f conftest*
2756 if test "$system_malloc" = "yes" ; then
2757   GNU_MALLOC=no
2758   GNU_MALLOC_reason="
2759   (The GNU allocators don't work with this system configuration)."
2760 elif test "$with_system_malloc" = "yes" ; then
2761   GNU_MALLOC=no
2762   GNU_MALLOC_reason="
2763   (User chose not to use GNU allocators)."
2764 elif test "$with_debug_malloc" = "yes" ; then
2765   GNU_MALLOC=no
2766   GNU_MALLOC_reason="
2767   (User chose to use Debugging Malloc)."
2768 fi
2769
2770 if test "$doug_lea_malloc" = "yes" ; then
2771   if test "$GNU_MALLOC" = yes ; then
2772     GNU_MALLOC_reason="
2773   (Using Doug Lea's new malloc from the GNU C Library.)"
2774   fi
2775   { test "$extra_verbose" = "yes" && cat << \EOF
2776     Defining DOUG_LEA_MALLOC
2777 EOF
2778 cat >> confdefs.h <<\EOF
2779 #define DOUG_LEA_MALLOC 1
2780 EOF
2781 }
2782
2783   if test "$after_morecore_hook_exists" = "no" ; then
2784     GNU_MALLOC_reason="
2785   (Using Doug Lea's new malloc from the Linux C Library.)"
2786     { test "$extra_verbose" = "yes" && cat << \EOF
2787     Defining _NO_MALLOC_WARNING_
2788 EOF
2789 cat >> confdefs.h <<\EOF
2790 #define _NO_MALLOC_WARNING_ 1
2791 EOF
2792 }
2793
2794   fi
2795   use_minimal_tagbits=yes
2796 fi
2797
2798
2799
2800
2801 # Extract the first word of "ranlib", so it can be a program name with args.
2802 set dummy ranlib; ac_word=$2
2803 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2804 echo "configure:2805: checking for $ac_word" >&5
2805
2806 if test -n "$RANLIB"; then
2807   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2808 else
2809   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2810   for ac_dir in $PATH; do
2811     test -z "$ac_dir" && ac_dir=.
2812     if test -f $ac_dir/$ac_word; then
2813       ac_cv_prog_RANLIB="ranlib"
2814       break
2815     fi
2816   done
2817   IFS="$ac_save_ifs"
2818   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2819 fi
2820 RANLIB="$ac_cv_prog_RANLIB"
2821 if test -n "$RANLIB"; then
2822   echo "$ac_t""$RANLIB" 1>&6
2823 else
2824   echo "$ac_t""no" 1>&6
2825 fi
2826
2827 ac_aux_dir=
2828 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2829   if test -f $ac_dir/install-sh; then
2830     ac_aux_dir=$ac_dir
2831     ac_install_sh="$ac_aux_dir/install-sh -c"
2832     break
2833   elif test -f $ac_dir/install.sh; then
2834     ac_aux_dir=$ac_dir
2835     ac_install_sh="$ac_aux_dir/install.sh -c"
2836     break
2837   fi
2838 done
2839 if test -z "$ac_aux_dir"; then
2840   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2841 fi
2842 ac_config_guess=$ac_aux_dir/config.guess
2843 ac_config_sub=$ac_aux_dir/config.sub
2844 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2845
2846 # Find a good install program.  We prefer a C program (faster),
2847 # so one script is as good as another.  But avoid the broken or
2848 # incompatible versions:
2849 # SysV /etc/install, /usr/sbin/install
2850 # SunOS /usr/etc/install
2851 # IRIX /sbin/install
2852 # AIX /bin/install
2853 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2854 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2855 # ./install, which can be erroneously created by make from ./install.sh.
2856 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2857 echo "configure:2858: checking for a BSD compatible install" >&5
2858 if test -z "$INSTALL"; then
2859
2860   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2861   for ac_dir in $PATH; do
2862     # Account for people who put trailing slashes in PATH elements.
2863     case "$ac_dir/" in
2864     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2865     *)
2866       # OSF1 and SCO ODT 3.0 have their own names for install.
2867       for ac_prog in ginstall installbsd scoinst install; do
2868         if test -f $ac_dir/$ac_prog; then
2869           if test $ac_prog = install &&
2870             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2871             # AIX install.  It has an incompatible calling convention.
2872             # OSF/1 installbsd also uses dspmsg, but is usable.
2873             :
2874           else
2875             ac_cv_path_install="$ac_dir/$ac_prog -c"
2876             break 2
2877           fi
2878         fi
2879       done
2880       ;;
2881     esac
2882   done
2883   IFS="$ac_save_IFS"
2884
2885   if test "${ac_cv_path_install+set}" = set; then
2886     INSTALL="$ac_cv_path_install"
2887   else
2888     # As a last resort, use the slow shell script.  We don't cache a
2889     # path for INSTALL within a source directory, because that will
2890     # break other packages using the cache if that directory is
2891     # removed, or if the path is relative.
2892     INSTALL="$ac_install_sh"
2893   fi
2894 fi
2895 echo "$ac_t""$INSTALL" 1>&6
2896
2897 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2898 # It thinks the first close brace ends the variable substitution.
2899 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2900
2901 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2902
2903 for ac_prog in 'bison -y' byacc
2904 do
2905 # Extract the first word of "$ac_prog", so it can be a program name with args.
2906 set dummy $ac_prog; ac_word=$2
2907 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2908 echo "configure:2909: checking for $ac_word" >&5
2909
2910 if test -n "$YACC"; then
2911   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2912 else
2913   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2914   for ac_dir in $PATH; do
2915     test -z "$ac_dir" && ac_dir=.
2916     if test -f $ac_dir/$ac_word; then
2917       ac_cv_prog_YACC="$ac_prog"
2918       break
2919     fi
2920   done
2921   IFS="$ac_save_ifs"
2922 fi
2923 YACC="$ac_cv_prog_YACC"
2924 if test -n "$YACC"; then
2925   echo "$ac_t""$YACC" 1>&6
2926 else
2927   echo "$ac_t""no" 1>&6
2928 fi
2929
2930 test -n "$YACC" && break
2931 done
2932 test -n "$YACC" || YACC="yacc"
2933
2934
2935 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
2936 do
2937 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2938 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2939 echo "configure:2940: checking for $ac_hdr" >&5
2940
2941 cat > conftest.$ac_ext <<EOF
2942 #line 2943 "configure"
2943 #include "confdefs.h"
2944 #include <$ac_hdr>
2945 EOF
2946 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2947 { (eval echo configure:2948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2948 ac_err=`grep -v '^ *+' conftest.out`
2949 if test -z "$ac_err"; then
2950   rm -rf conftest*
2951   eval "ac_cv_header_$ac_safe=yes"
2952 else
2953   echo "$ac_err" >&5
2954   echo "configure: failed program was:" >&5
2955   cat conftest.$ac_ext >&5
2956   rm -rf conftest*
2957   eval "ac_cv_header_$ac_safe=no"
2958 fi
2959 rm -f conftest*
2960 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2961   echo "$ac_t""yes" 1>&6
2962     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2963   { test "$extra_verbose" = "yes" && cat << EOF
2964     Defining $ac_tr_hdr
2965 EOF
2966 cat >> confdefs.h <<EOF
2967 #define $ac_tr_hdr 1
2968 EOF
2969 }
2970  
2971 else
2972   echo "$ac_t""no" 1>&6
2973 fi
2974 done
2975
2976 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
2977 do
2978 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2979 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2980 echo "configure:2981: checking for $ac_hdr" >&5
2981
2982 cat > conftest.$ac_ext <<EOF
2983 #line 2984 "configure"
2984 #include "confdefs.h"
2985 #include <$ac_hdr>
2986 EOF
2987 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2988 { (eval echo configure:2989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2989 ac_err=`grep -v '^ *+' conftest.out`
2990 if test -z "$ac_err"; then
2991   rm -rf conftest*
2992   eval "ac_cv_header_$ac_safe=yes"
2993 else
2994   echo "$ac_err" >&5
2995   echo "configure: failed program was:" >&5
2996   cat conftest.$ac_ext >&5
2997   rm -rf conftest*
2998   eval "ac_cv_header_$ac_safe=no"
2999 fi
3000 rm -f conftest*
3001 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3002   echo "$ac_t""yes" 1>&6
3003     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3004   { test "$extra_verbose" = "yes" && cat << EOF
3005     Defining $ac_tr_hdr
3006 EOF
3007 cat >> confdefs.h <<EOF
3008 #define $ac_tr_hdr 1
3009 EOF
3010 }
3011  
3012 else
3013   echo "$ac_t""no" 1>&6
3014 fi
3015 done
3016
3017 for ac_hdr in linux/version.h kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3018 do
3019 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3020 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3021 echo "configure:3022: checking for $ac_hdr" >&5
3022
3023 cat > conftest.$ac_ext <<EOF
3024 #line 3025 "configure"
3025 #include "confdefs.h"
3026 #include <$ac_hdr>
3027 EOF
3028 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3029 { (eval echo configure:3030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3030 ac_err=`grep -v '^ *+' conftest.out`
3031 if test -z "$ac_err"; then
3032   rm -rf conftest*
3033   eval "ac_cv_header_$ac_safe=yes"
3034 else
3035   echo "$ac_err" >&5
3036   echo "configure: failed program was:" >&5
3037   cat conftest.$ac_ext >&5
3038   rm -rf conftest*
3039   eval "ac_cv_header_$ac_safe=no"
3040 fi
3041 rm -f conftest*
3042 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3043   echo "$ac_t""yes" 1>&6
3044     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3045   { test "$extra_verbose" = "yes" && cat << EOF
3046     Defining $ac_tr_hdr
3047 EOF
3048 cat >> confdefs.h <<EOF
3049 #define $ac_tr_hdr 1
3050 EOF
3051 }
3052  
3053 else
3054   echo "$ac_t""no" 1>&6
3055 fi
3056 done
3057
3058 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3059 echo "configure:3060: checking for sys/wait.h that is POSIX.1 compatible" >&5
3060
3061 cat > conftest.$ac_ext <<EOF
3062 #line 3063 "configure"
3063 #include "confdefs.h"
3064 #include <sys/types.h>
3065 #include <sys/wait.h>
3066 #ifndef WEXITSTATUS
3067 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3068 #endif
3069 #ifndef WIFEXITED
3070 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3071 #endif
3072 int main() {
3073 int s;
3074 wait (&s);
3075 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3076 ; return 0; }
3077 EOF
3078 if { (eval echo configure:3079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3079   rm -rf conftest*
3080   ac_cv_header_sys_wait_h=yes
3081 else
3082   echo "configure: failed program was:" >&5
3083   cat conftest.$ac_ext >&5
3084   rm -rf conftest*
3085   ac_cv_header_sys_wait_h=no
3086 fi
3087 rm -f conftest*
3088
3089 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3090 if test $ac_cv_header_sys_wait_h = yes; then
3091   { test "$extra_verbose" = "yes" && cat << \EOF
3092     Defining HAVE_SYS_WAIT_H
3093 EOF
3094 cat >> confdefs.h <<\EOF
3095 #define HAVE_SYS_WAIT_H 1
3096 EOF
3097 }
3098
3099 fi
3100
3101 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3102 echo "configure:3103: checking for ANSI C header files" >&5
3103
3104 cat > conftest.$ac_ext <<EOF
3105 #line 3106 "configure"
3106 #include "confdefs.h"
3107 #include <stdlib.h>
3108 #include <stdarg.h>
3109 #include <string.h>
3110 #include <float.h>
3111 EOF
3112 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3113 { (eval echo configure:3114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3114 ac_err=`grep -v '^ *+' conftest.out`
3115 if test -z "$ac_err"; then
3116   rm -rf conftest*
3117   ac_cv_header_stdc=yes
3118 else
3119   echo "$ac_err" >&5
3120   echo "configure: failed program was:" >&5
3121   cat conftest.$ac_ext >&5
3122   rm -rf conftest*
3123   ac_cv_header_stdc=no
3124 fi
3125 rm -f conftest*
3126
3127 if test $ac_cv_header_stdc = yes; then
3128   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3129 cat > conftest.$ac_ext <<EOF
3130 #line 3131 "configure"
3131 #include "confdefs.h"
3132 #include <string.h>
3133 EOF
3134 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3135   egrep "memchr" >/dev/null 2>&1; then
3136   :
3137 else
3138   rm -rf conftest*
3139   ac_cv_header_stdc=no
3140 fi
3141 rm -f conftest*
3142
3143 fi
3144
3145 if test $ac_cv_header_stdc = yes; then
3146   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3147 cat > conftest.$ac_ext <<EOF
3148 #line 3149 "configure"
3149 #include "confdefs.h"
3150 #include <stdlib.h>
3151 EOF
3152 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3153   egrep "free" >/dev/null 2>&1; then
3154   :
3155 else
3156   rm -rf conftest*
3157   ac_cv_header_stdc=no
3158 fi
3159 rm -f conftest*
3160
3161 fi
3162
3163 if test $ac_cv_header_stdc = yes; then
3164   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3165 cat > conftest.$ac_ext <<EOF
3166 #line 3167 "configure"
3167 #include "confdefs.h"
3168 #include <ctype.h>
3169 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3170 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3171 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3172 int main () { int i; for (i = 0; i < 256; i++)
3173 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3174 exit (0); }
3175
3176 EOF
3177 if { (eval echo configure:3178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3178 then
3179   :
3180 else
3181   conftest_rc="$?"
3182   echo "configure: failed program was:" >&5
3183   cat conftest.$ac_ext >&5
3184   rm -fr conftest*
3185   ac_cv_header_stdc=no
3186 fi
3187 rm -fr conftest*
3188 fi
3189
3190 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3191 if test $ac_cv_header_stdc = yes; then
3192   { test "$extra_verbose" = "yes" && cat << \EOF
3193     Defining STDC_HEADERS
3194 EOF
3195 cat >> confdefs.h <<\EOF
3196 #define STDC_HEADERS 1
3197 EOF
3198 }
3199
3200 fi
3201
3202 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3203 echo "configure:3204: checking whether time.h and sys/time.h may both be included" >&5
3204
3205 cat > conftest.$ac_ext <<EOF
3206 #line 3207 "configure"
3207 #include "confdefs.h"
3208 #include <sys/types.h>
3209 #include <sys/time.h>
3210 #include <time.h>
3211 int main() {
3212 struct tm *tp;
3213 ; return 0; }
3214 EOF
3215 if { (eval echo configure:3216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3216   rm -rf conftest*
3217   ac_cv_header_time=yes
3218 else
3219   echo "configure: failed program was:" >&5
3220   cat conftest.$ac_ext >&5
3221   rm -rf conftest*
3222   ac_cv_header_time=no
3223 fi
3224 rm -f conftest*
3225
3226 echo "$ac_t""$ac_cv_header_time" 1>&6
3227 if test $ac_cv_header_time = yes; then
3228   { test "$extra_verbose" = "yes" && cat << \EOF
3229     Defining TIME_WITH_SYS_TIME
3230 EOF
3231 cat >> confdefs.h <<\EOF
3232 #define TIME_WITH_SYS_TIME 1
3233 EOF
3234 }
3235
3236 fi
3237
3238 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3239 echo "configure:3240: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3240
3241 cat > conftest.$ac_ext <<EOF
3242 #line 3243 "configure"
3243 #include "confdefs.h"
3244 #include <sys/types.h>
3245 #include <signal.h>
3246 /* NetBSD declares sys_siglist in unistd.h.  */
3247 #ifdef HAVE_UNISTD_H
3248 #include <unistd.h>
3249 #endif
3250 int main() {
3251 char *msg = *(sys_siglist + 1);
3252 ; return 0; }
3253 EOF
3254 if { (eval echo configure:3255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3255   rm -rf conftest*
3256   ac_cv_decl_sys_siglist=yes
3257 else
3258   echo "configure: failed program was:" >&5
3259   cat conftest.$ac_ext >&5
3260   rm -rf conftest*
3261   ac_cv_decl_sys_siglist=no
3262 fi
3263 rm -f conftest*
3264
3265 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3266 if test $ac_cv_decl_sys_siglist = yes; then
3267   { test "$extra_verbose" = "yes" && cat << \EOF
3268     Defining SYS_SIGLIST_DECLARED
3269 EOF
3270 cat >> confdefs.h <<\EOF
3271 #define SYS_SIGLIST_DECLARED 1
3272 EOF
3273 }
3274
3275 fi
3276
3277
3278 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3279 echo "configure:3280: checking for struct utimbuf" >&5
3280 cat > conftest.$ac_ext <<EOF
3281 #line 3282 "configure"
3282 #include "confdefs.h"
3283 #ifdef TIME_WITH_SYS_TIME
3284 #include <sys/time.h>
3285 #include <time.h>
3286 #else
3287 #ifdef HAVE_SYS_TIME_H
3288 #include <sys/time.h>
3289 #else
3290 #include <time.h>
3291 #endif
3292 #endif
3293 #ifdef HAVE_UTIME_H
3294 #include <utime.h>
3295 #endif
3296 int main() {
3297 static struct utimbuf x; x.actime = x.modtime;
3298 ; return 0; }
3299 EOF
3300 if { (eval echo configure:3301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3301   rm -rf conftest*
3302   echo "$ac_t""yes" 1>&6
3303    { test "$extra_verbose" = "yes" && cat << \EOF
3304     Defining HAVE_STRUCT_UTIMBUF
3305 EOF
3306 cat >> confdefs.h <<\EOF
3307 #define HAVE_STRUCT_UTIMBUF 1
3308 EOF
3309 }
3310
3311 else
3312   echo "configure: failed program was:" >&5
3313   cat conftest.$ac_ext >&5
3314   rm -rf conftest*
3315   echo "$ac_t""no" 1>&6
3316 fi
3317 rm -f conftest*
3318
3319 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3320 echo "configure:3321: checking return type of signal handlers" >&5
3321
3322 cat > conftest.$ac_ext <<EOF
3323 #line 3324 "configure"
3324 #include "confdefs.h"
3325 #include <sys/types.h>
3326 #include <signal.h>
3327 #ifdef signal
3328 #undef signal
3329 #endif
3330 #ifdef __cplusplus
3331 extern "C" void (*signal (int, void (*)(int)))(int);
3332 #else
3333 void (*signal ()) ();
3334 #endif
3335
3336 int main() {
3337 int i;
3338 ; return 0; }
3339 EOF
3340 if { (eval echo configure:3341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3341   rm -rf conftest*
3342   ac_cv_type_signal=void
3343 else
3344   echo "configure: failed program was:" >&5
3345   cat conftest.$ac_ext >&5
3346   rm -rf conftest*
3347   ac_cv_type_signal=int
3348 fi
3349 rm -f conftest*
3350
3351 echo "$ac_t""$ac_cv_type_signal" 1>&6
3352 { test "$extra_verbose" = "yes" && cat << EOF
3353     Defining RETSIGTYPE = $ac_cv_type_signal
3354 EOF
3355 cat >> confdefs.h <<EOF
3356 #define RETSIGTYPE $ac_cv_type_signal
3357 EOF
3358 }
3359
3360
3361 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3362 echo "configure:3363: checking for size_t" >&5
3363
3364 cat > conftest.$ac_ext <<EOF
3365 #line 3366 "configure"
3366 #include "confdefs.h"
3367 #include <sys/types.h>
3368 #if STDC_HEADERS
3369 #include <stdlib.h>
3370 #include <stddef.h>
3371 #endif
3372 EOF
3373 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3374   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3375   rm -rf conftest*
3376   ac_cv_type_size_t=yes
3377 else
3378   rm -rf conftest*
3379   ac_cv_type_size_t=no
3380 fi
3381 rm -f conftest*
3382
3383 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3384 if test $ac_cv_type_size_t = no; then
3385   { test "$extra_verbose" = "yes" && cat << \EOF
3386     Defining size_t = unsigned
3387 EOF
3388 cat >> confdefs.h <<\EOF
3389 #define size_t unsigned
3390 EOF
3391 }
3392
3393 fi
3394
3395 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3396 echo "configure:3397: checking for pid_t" >&5
3397
3398 cat > conftest.$ac_ext <<EOF
3399 #line 3400 "configure"
3400 #include "confdefs.h"
3401 #include <sys/types.h>
3402 #if STDC_HEADERS
3403 #include <stdlib.h>
3404 #include <stddef.h>
3405 #endif
3406 EOF
3407 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3408   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3409   rm -rf conftest*
3410   ac_cv_type_pid_t=yes
3411 else
3412   rm -rf conftest*
3413   ac_cv_type_pid_t=no
3414 fi
3415 rm -f conftest*
3416
3417 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3418 if test $ac_cv_type_pid_t = no; then
3419   { test "$extra_verbose" = "yes" && cat << \EOF
3420     Defining pid_t = int
3421 EOF
3422 cat >> confdefs.h <<\EOF
3423 #define pid_t int
3424 EOF
3425 }
3426
3427 fi
3428
3429 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3430 echo "configure:3431: checking for uid_t in sys/types.h" >&5
3431
3432 cat > conftest.$ac_ext <<EOF
3433 #line 3434 "configure"
3434 #include "confdefs.h"
3435 #include <sys/types.h>
3436 EOF
3437 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3438   egrep "uid_t" >/dev/null 2>&1; then
3439   rm -rf conftest*
3440   ac_cv_type_uid_t=yes
3441 else
3442   rm -rf conftest*
3443   ac_cv_type_uid_t=no
3444 fi
3445 rm -f conftest*
3446
3447
3448 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3449 if test $ac_cv_type_uid_t = no; then
3450   { test "$extra_verbose" = "yes" && cat << \EOF
3451     Defining uid_t = int
3452 EOF
3453 cat >> confdefs.h <<\EOF
3454 #define uid_t int
3455 EOF
3456 }
3457
3458   { test "$extra_verbose" = "yes" && cat << \EOF
3459     Defining gid_t = int
3460 EOF
3461 cat >> confdefs.h <<\EOF
3462 #define gid_t int
3463 EOF
3464 }
3465
3466 fi
3467
3468 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3469 echo "configure:3470: checking for mode_t" >&5
3470
3471 cat > conftest.$ac_ext <<EOF
3472 #line 3473 "configure"
3473 #include "confdefs.h"
3474 #include <sys/types.h>
3475 #if STDC_HEADERS
3476 #include <stdlib.h>
3477 #include <stddef.h>
3478 #endif
3479 EOF
3480 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3481   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3482   rm -rf conftest*
3483   ac_cv_type_mode_t=yes
3484 else
3485   rm -rf conftest*
3486   ac_cv_type_mode_t=no
3487 fi
3488 rm -f conftest*
3489
3490 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3491 if test $ac_cv_type_mode_t = no; then
3492   { test "$extra_verbose" = "yes" && cat << \EOF
3493     Defining mode_t = int
3494 EOF
3495 cat >> confdefs.h <<\EOF
3496 #define mode_t int
3497 EOF
3498 }
3499
3500 fi
3501
3502 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3503 echo "configure:3504: checking for off_t" >&5
3504
3505 cat > conftest.$ac_ext <<EOF
3506 #line 3507 "configure"
3507 #include "confdefs.h"
3508 #include <sys/types.h>
3509 #if STDC_HEADERS
3510 #include <stdlib.h>
3511 #include <stddef.h>
3512 #endif
3513 EOF
3514 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3515   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3516   rm -rf conftest*
3517   ac_cv_type_off_t=yes
3518 else
3519   rm -rf conftest*
3520   ac_cv_type_off_t=no
3521 fi
3522 rm -f conftest*
3523
3524 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3525 if test $ac_cv_type_off_t = no; then
3526   { test "$extra_verbose" = "yes" && cat << \EOF
3527     Defining off_t = long
3528 EOF
3529 cat >> confdefs.h <<\EOF
3530 #define off_t long
3531 EOF
3532 }
3533
3534 fi
3535
3536
3537 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3538 echo "configure:3539: checking for struct timeval" >&5
3539 cat > conftest.$ac_ext <<EOF
3540 #line 3541 "configure"
3541 #include "confdefs.h"
3542 #ifdef TIME_WITH_SYS_TIME
3543 #include <sys/time.h>
3544 #include <time.h>
3545 #else
3546 #ifdef HAVE_SYS_TIME_H
3547 #include <sys/time.h>
3548 #else
3549 #include <time.h>
3550 #endif
3551 #endif
3552 int main() {
3553 static struct timeval x; x.tv_sec = x.tv_usec;
3554 ; return 0; }
3555 EOF
3556 if { (eval echo configure:3557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3557   rm -rf conftest*
3558   echo "$ac_t""yes" 1>&6
3559   HAVE_TIMEVAL=yes
3560   { test "$extra_verbose" = "yes" && cat << \EOF
3561     Defining HAVE_TIMEVAL
3562 EOF
3563 cat >> confdefs.h <<\EOF
3564 #define HAVE_TIMEVAL 1
3565 EOF
3566 }
3567
3568 else
3569   echo "configure: failed program was:" >&5
3570   cat conftest.$ac_ext >&5
3571   rm -rf conftest*
3572   echo "$ac_t""no" 1>&6
3573    HAVE_TIMEVAL=no
3574 fi
3575 rm -f conftest*
3576
3577 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3578 echo "configure:3579: checking whether struct tm is in sys/time.h or time.h" >&5
3579
3580 cat > conftest.$ac_ext <<EOF
3581 #line 3582 "configure"
3582 #include "confdefs.h"
3583 #include <sys/types.h>
3584 #include <time.h>
3585 int main() {
3586 struct tm *tp; tp->tm_sec;
3587 ; return 0; }
3588 EOF
3589 if { (eval echo configure:3590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3590   rm -rf conftest*
3591   ac_cv_struct_tm=time.h
3592 else
3593   echo "configure: failed program was:" >&5
3594   cat conftest.$ac_ext >&5
3595   rm -rf conftest*
3596   ac_cv_struct_tm=sys/time.h
3597 fi
3598 rm -f conftest*
3599
3600 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3601 if test $ac_cv_struct_tm = sys/time.h; then
3602   { test "$extra_verbose" = "yes" && cat << \EOF
3603     Defining TM_IN_SYS_TIME
3604 EOF
3605 cat >> confdefs.h <<\EOF
3606 #define TM_IN_SYS_TIME 1
3607 EOF
3608 }
3609
3610 fi
3611
3612 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3613 echo "configure:3614: checking for tm_zone in struct tm" >&5
3614
3615 cat > conftest.$ac_ext <<EOF
3616 #line 3617 "configure"
3617 #include "confdefs.h"
3618 #include <sys/types.h>
3619 #include <$ac_cv_struct_tm>
3620 int main() {
3621 struct tm tm; tm.tm_zone;
3622 ; return 0; }
3623 EOF
3624 if { (eval echo configure:3625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3625   rm -rf conftest*
3626   ac_cv_struct_tm_zone=yes
3627 else
3628   echo "configure: failed program was:" >&5
3629   cat conftest.$ac_ext >&5
3630   rm -rf conftest*
3631   ac_cv_struct_tm_zone=no
3632 fi
3633 rm -f conftest*
3634
3635 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3636 if test "$ac_cv_struct_tm_zone" = yes; then
3637   { test "$extra_verbose" = "yes" && cat << \EOF
3638     Defining HAVE_TM_ZONE
3639 EOF
3640 cat >> confdefs.h <<\EOF
3641 #define HAVE_TM_ZONE 1
3642 EOF
3643 }
3644
3645 else
3646   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3647 echo "configure:3648: checking for tzname" >&5
3648
3649 cat > conftest.$ac_ext <<EOF
3650 #line 3651 "configure"
3651 #include "confdefs.h"
3652 #include <time.h>
3653 #ifndef tzname /* For SGI.  */
3654 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3655 #endif
3656 int main() {
3657 atoi(*tzname);
3658 ; return 0; }
3659 EOF
3660 if { (eval echo configure:3661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3661   rm -rf conftest*
3662   ac_cv_var_tzname=yes
3663 else
3664   echo "configure: failed program was:" >&5
3665   cat conftest.$ac_ext >&5
3666   rm -rf conftest*
3667   ac_cv_var_tzname=no
3668 fi
3669 rm -f conftest*
3670
3671 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3672   if test $ac_cv_var_tzname = yes; then
3673     { test "$extra_verbose" = "yes" && cat << \EOF
3674     Defining HAVE_TZNAME
3675 EOF
3676 cat >> confdefs.h <<\EOF
3677 #define HAVE_TZNAME 1
3678 EOF
3679 }
3680
3681   fi
3682 fi
3683
3684
3685 echo $ac_n "checking for working const""... $ac_c" 1>&6
3686 echo "configure:3687: checking for working const" >&5
3687
3688 cat > conftest.$ac_ext <<EOF
3689 #line 3690 "configure"
3690 #include "confdefs.h"
3691
3692 int main() {
3693
3694 /* Ultrix mips cc rejects this.  */
3695 typedef int charset[2]; const charset x;
3696 /* SunOS 4.1.1 cc rejects this.  */
3697 char const *const *ccp;
3698 char **p;
3699 /* NEC SVR4.0.2 mips cc rejects this.  */
3700 struct point {int x, y;};
3701 static struct point const zero = {0,0};
3702 /* AIX XL C 1.02.0.0 rejects this.
3703    It does not let you subtract one const X* pointer from another in an arm
3704    of an if-expression whose if-part is not a constant expression */
3705 const char *g = "string";
3706 ccp = &g + (g ? g-g : 0);
3707 /* HPUX 7.0 cc rejects these. */
3708 ++ccp;
3709 p = (char**) ccp;
3710 ccp = (char const *const *) p;
3711 { /* SCO 3.2v4 cc rejects this.  */
3712   char *t;
3713   char const *s = 0 ? (char *) 0 : (char const *) 0;
3714
3715   *t++ = 0;
3716 }
3717 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3718   int x[] = {25, 17};
3719   const int *foo = &x[0];
3720   ++foo;
3721 }
3722 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3723   typedef const int *iptr;
3724   iptr p = 0;
3725   ++p;
3726 }
3727 { /* AIX XL C 1.02.0.0 rejects this saying
3728      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3729   struct s { int j; const int *ap[3]; };
3730   struct s *b; b->j = 5;
3731 }
3732 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3733   const int foo = 10;
3734 }
3735
3736 ; return 0; }
3737 EOF
3738 if { (eval echo configure:3739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3739   rm -rf conftest*
3740   ac_cv_c_const=yes
3741 else
3742   echo "configure: failed program was:" >&5
3743   cat conftest.$ac_ext >&5
3744   rm -rf conftest*
3745   ac_cv_c_const=no
3746 fi
3747 rm -f conftest*
3748
3749 echo "$ac_t""$ac_cv_c_const" 1>&6
3750 if test $ac_cv_c_const = no; then
3751   { test "$extra_verbose" = "yes" && cat << \EOF
3752     Defining const = 
3753 EOF
3754 cat >> confdefs.h <<\EOF
3755 #define const 
3756 EOF
3757 }
3758
3759 fi
3760
3761
3762 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3763 echo "configure:3764: checking whether ${MAKE-make} sets \${MAKE}" >&5
3764 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3765
3766 cat > conftestmake <<\EOF
3767 all:
3768         @echo 'ac_maketemp="${MAKE}"'
3769 EOF
3770 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3771 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3772 if test -n "$ac_maketemp"; then
3773   eval ac_cv_prog_make_${ac_make}_set=yes
3774 else
3775   eval ac_cv_prog_make_${ac_make}_set=no
3776 fi
3777 rm -f conftestmake
3778 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3779   echo "$ac_t""yes" 1>&6
3780   SET_MAKE=
3781 else
3782   echo "$ac_t""no" 1>&6
3783   SET_MAKE="MAKE=${MAKE-make}"
3784 fi
3785
3786
3787 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3788 echo "configure:3789: checking whether byte ordering is bigendian" >&5
3789
3790 ac_cv_c_bigendian=unknown
3791 # See if sys/param.h defines the BYTE_ORDER macro.
3792 cat > conftest.$ac_ext <<EOF
3793 #line 3794 "configure"
3794 #include "confdefs.h"
3795 #include <sys/types.h>
3796 #include <sys/param.h>
3797 int main() {
3798
3799 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3800  bogus endian macros
3801 #endif
3802 ; return 0; }
3803 EOF
3804 if { (eval echo configure:3805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3805   rm -rf conftest*
3806   # It does; now see whether it defined to BIG_ENDIAN or not.
3807 cat > conftest.$ac_ext <<EOF
3808 #line 3809 "configure"
3809 #include "confdefs.h"
3810 #include <sys/types.h>
3811 #include <sys/param.h>
3812 int main() {
3813
3814 #if BYTE_ORDER != BIG_ENDIAN
3815  not big endian
3816 #endif
3817 ; return 0; }
3818 EOF
3819 if { (eval echo configure:3820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3820   rm -rf conftest*
3821   ac_cv_c_bigendian=yes
3822 else
3823   echo "configure: failed program was:" >&5
3824   cat conftest.$ac_ext >&5
3825   rm -rf conftest*
3826   ac_cv_c_bigendian=no
3827 fi
3828 rm -f conftest*
3829 else
3830   echo "configure: failed program was:" >&5
3831   cat conftest.$ac_ext >&5
3832 fi
3833 rm -f conftest*
3834 if test $ac_cv_c_bigendian = unknown; then
3835 cat > conftest.$ac_ext <<EOF
3836 #line 3837 "configure"
3837 #include "confdefs.h"
3838 main () {
3839   /* Are we little or big endian?  From Harbison&Steele.  */
3840   union
3841   {
3842     long l;
3843     char c[sizeof (long)];
3844   } u;
3845   u.l = 1;
3846   exit (u.c[sizeof (long) - 1] == 1);
3847 }
3848 EOF
3849 if { (eval echo configure:3850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3850 then
3851   ac_cv_c_bigendian=no
3852 else
3853   conftest_rc="$?"
3854   echo "configure: failed program was:" >&5
3855   cat conftest.$ac_ext >&5
3856   rm -fr conftest*
3857   ac_cv_c_bigendian=yes
3858 fi
3859 rm -fr conftest*
3860 fi
3861
3862 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3863 if test $ac_cv_c_bigendian = yes; then
3864   { test "$extra_verbose" = "yes" && cat << \EOF
3865     Defining WORDS_BIGENDIAN
3866 EOF
3867 cat >> confdefs.h <<\EOF
3868 #define WORDS_BIGENDIAN 1
3869 EOF
3870 }
3871
3872 fi
3873
3874
3875 echo $ac_n "checking size of short""... $ac_c" 1>&6
3876 echo "configure:3877: checking size of short" >&5
3877
3878 cat > conftest.$ac_ext <<EOF
3879 #line 3880 "configure"
3880 #include "confdefs.h"
3881 #include <stdio.h>
3882 main()
3883 {
3884   FILE *f=fopen("conftestval", "w");
3885   if (!f) exit(1);
3886   fprintf(f, "%d\n", sizeof(short));
3887   exit(0);
3888 }
3889 EOF
3890 if { (eval echo configure:3891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3891 then
3892   ac_cv_sizeof_short=`cat conftestval`
3893 else
3894   conftest_rc="$?"
3895   echo "configure: failed program was:" >&5
3896   cat conftest.$ac_ext >&5
3897   rm -fr conftest*
3898   ac_cv_sizeof_short=0
3899 fi
3900 rm -fr conftest*
3901 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
3902 { test "$extra_verbose" = "yes" && cat << EOF
3903     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
3904 EOF
3905 cat >> confdefs.h <<EOF
3906 #define SIZEOF_SHORT $ac_cv_sizeof_short
3907 EOF
3908 }
3909
3910
3911 if test "$ac_cv_sizeof_short" = 0; then
3912   echo ""
3913   echo "*** PANIC *** Configure tests are not working - compiler is broken."
3914   echo "*** PANIC *** Please examine config.log for compilation errors."
3915   exit 1
3916 fi
3917 echo $ac_n "checking size of int""... $ac_c" 1>&6
3918 echo "configure:3919: checking size of int" >&5
3919
3920 cat > conftest.$ac_ext <<EOF
3921 #line 3922 "configure"
3922 #include "confdefs.h"
3923 #include <stdio.h>
3924 main()
3925 {
3926   FILE *f=fopen("conftestval", "w");
3927   if (!f) exit(1);
3928   fprintf(f, "%d\n", sizeof(int));
3929   exit(0);
3930 }
3931 EOF
3932 if { (eval echo configure:3933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3933 then
3934   ac_cv_sizeof_int=`cat conftestval`
3935 else
3936   conftest_rc="$?"
3937   echo "configure: failed program was:" >&5
3938   cat conftest.$ac_ext >&5
3939   rm -fr conftest*
3940   ac_cv_sizeof_int=0
3941 fi
3942 rm -fr conftest*
3943 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
3944 { test "$extra_verbose" = "yes" && cat << EOF
3945     Defining SIZEOF_INT = $ac_cv_sizeof_int
3946 EOF
3947 cat >> confdefs.h <<EOF
3948 #define SIZEOF_INT $ac_cv_sizeof_int
3949 EOF
3950 }
3951
3952
3953 echo $ac_n "checking size of long""... $ac_c" 1>&6
3954 echo "configure:3955: checking size of long" >&5
3955
3956 cat > conftest.$ac_ext <<EOF
3957 #line 3958 "configure"
3958 #include "confdefs.h"
3959 #include <stdio.h>
3960 main()
3961 {
3962   FILE *f=fopen("conftestval", "w");
3963   if (!f) exit(1);
3964   fprintf(f, "%d\n", sizeof(long));
3965   exit(0);
3966 }
3967 EOF
3968 if { (eval echo configure:3969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3969 then
3970   ac_cv_sizeof_long=`cat conftestval`
3971 else
3972   conftest_rc="$?"
3973   echo "configure: failed program was:" >&5
3974   cat conftest.$ac_ext >&5
3975   rm -fr conftest*
3976   ac_cv_sizeof_long=0
3977 fi
3978 rm -fr conftest*
3979 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
3980 { test "$extra_verbose" = "yes" && cat << EOF
3981     Defining SIZEOF_LONG = $ac_cv_sizeof_long
3982 EOF
3983 cat >> confdefs.h <<EOF
3984 #define SIZEOF_LONG $ac_cv_sizeof_long
3985 EOF
3986 }
3987
3988
3989 echo $ac_n "checking size of long long""... $ac_c" 1>&6
3990 echo "configure:3991: checking size of long long" >&5
3991
3992 cat > conftest.$ac_ext <<EOF
3993 #line 3994 "configure"
3994 #include "confdefs.h"
3995 #include <stdio.h>
3996 main()
3997 {
3998   FILE *f=fopen("conftestval", "w");
3999   if (!f) exit(1);
4000   fprintf(f, "%d\n", sizeof(long long));
4001   exit(0);
4002 }
4003 EOF
4004 if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4005 then
4006   ac_cv_sizeof_long_long=`cat conftestval`
4007 else
4008   conftest_rc="$?"
4009   echo "configure: failed program was:" >&5
4010   cat conftest.$ac_ext >&5
4011   rm -fr conftest*
4012   ac_cv_sizeof_long_long=0
4013 fi
4014 rm -fr conftest*
4015 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4016 { test "$extra_verbose" = "yes" && cat << EOF
4017     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4018 EOF
4019 cat >> confdefs.h <<EOF
4020 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4021 EOF
4022 }
4023
4024
4025 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4026 echo "configure:4027: checking size of void *" >&5
4027
4028 cat > conftest.$ac_ext <<EOF
4029 #line 4030 "configure"
4030 #include "confdefs.h"
4031 #include <stdio.h>
4032 main()
4033 {
4034   FILE *f=fopen("conftestval", "w");
4035   if (!f) exit(1);
4036   fprintf(f, "%d\n", sizeof(void *));
4037   exit(0);
4038 }
4039 EOF
4040 if { (eval echo configure:4041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4041 then
4042   ac_cv_sizeof_void_p=`cat conftestval`
4043 else
4044   conftest_rc="$?"
4045   echo "configure: failed program was:" >&5
4046   cat conftest.$ac_ext >&5
4047   rm -fr conftest*
4048   ac_cv_sizeof_void_p=0
4049 fi
4050 rm -fr conftest*
4051 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4052 { test "$extra_verbose" = "yes" && cat << EOF
4053     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4054 EOF
4055 cat >> confdefs.h <<EOF
4056 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4057 EOF
4058 }
4059
4060
4061
4062 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4063 echo "configure:4064: checking for long file names" >&5
4064
4065 ac_cv_sys_long_file_names=yes
4066 # Test for long file names in all the places we know might matter:
4067 #      .                the current directory, where building will happen
4068 #      $prefix/lib      where we will be installing things
4069 #      $exec_prefix/lib likewise
4070 # eval it to expand exec_prefix.
4071 #      $TMPDIR          if set, where it might want to write temporary files
4072 # if $TMPDIR is not set:
4073 #      /tmp             where it might want to write temporary files
4074 #      /var/tmp         likewise
4075 #      /usr/tmp         likewise
4076 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4077   ac_tmpdirs="$TMPDIR"
4078 else
4079   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4080 fi
4081 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4082   test -d $ac_dir || continue
4083   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4084   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4085   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4086   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4087   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4088     ac_cv_sys_long_file_names=no
4089     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4090     break
4091   fi
4092   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4093 done
4094
4095 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4096 if test $ac_cv_sys_long_file_names = yes; then
4097   { test "$extra_verbose" = "yes" && cat << \EOF
4098     Defining HAVE_LONG_FILE_NAMES
4099 EOF
4100 cat >> confdefs.h <<\EOF
4101 #define HAVE_LONG_FILE_NAMES 1
4102 EOF
4103 }
4104
4105 fi
4106
4107
4108
4109 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4110 echo "configure:4111: checking for sin in -lm" >&5
4111 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4112
4113 xe_check_libs=" -lm "
4114 cat > conftest.$ac_ext <<EOF
4115 #line 4116 "configure"
4116 #include "confdefs.h"
4117 /* Override any gcc2 internal prototype to avoid an error.  */
4118 /* We use char because int might match the return type of a gcc2
4119     builtin and then its argument prototype would still apply.  */
4120 char sin();
4121
4122 int main() {
4123 sin()
4124 ; return 0; }
4125 EOF
4126 if { (eval echo configure:4127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4127   rm -rf conftest*
4128   eval "ac_cv_lib_$ac_lib_var=yes"
4129 else
4130   echo "configure: failed program was:" >&5
4131   cat conftest.$ac_ext >&5
4132   rm -rf conftest*
4133   eval "ac_cv_lib_$ac_lib_var=no"
4134 fi
4135 rm -f conftest*
4136 xe_check_libs=""
4137
4138 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4139   echo "$ac_t""yes" 1>&6
4140     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4141     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4142   { test "$extra_verbose" = "yes" && cat << EOF
4143     Defining $ac_tr_lib
4144 EOF
4145 cat >> confdefs.h <<EOF
4146 #define $ac_tr_lib 1
4147 EOF
4148 }
4149
4150   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4151
4152 else
4153   echo "$ac_t""no" 1>&6
4154 fi
4155
4156
4157
4158 { test "$extra_verbose" = "yes" && cat << \EOF
4159     Defining LISP_FLOAT_TYPE
4160 EOF
4161 cat >> confdefs.h <<\EOF
4162 #define LISP_FLOAT_TYPE 1
4163 EOF
4164 }
4165
4166
4167 cat > conftest.$ac_ext <<EOF
4168 #line 4169 "configure"
4169 #include "confdefs.h"
4170 #include <math.h>
4171 int main() {
4172 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4173 ; return 0; }
4174 EOF
4175 if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4176   rm -rf conftest*
4177   { test "$extra_verbose" = "yes" && cat << \EOF
4178     Defining HAVE_INVERSE_HYPERBOLIC
4179 EOF
4180 cat >> confdefs.h <<\EOF
4181 #define HAVE_INVERSE_HYPERBOLIC 1
4182 EOF
4183 }
4184
4185 else
4186   echo "configure: failed program was:" >&5
4187   cat conftest.$ac_ext >&5
4188 fi
4189 rm -f conftest*
4190
4191 echo "checking type of mail spool file locking" 1>&6
4192 echo "configure:4193: checking type of mail spool file locking" >&5
4193 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4194 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4195 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4196     Defining REAL_MAIL_USE_LOCKF
4197 EOF
4198 cat >> confdefs.h <<\EOF
4199 #define REAL_MAIL_USE_LOCKF 1
4200 EOF
4201 }
4202
4203 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4204     Defining REAL_MAIL_USE_FLOCK
4205 EOF
4206 cat >> confdefs.h <<\EOF
4207 #define REAL_MAIL_USE_FLOCK 1
4208 EOF
4209 }
4210
4211 else mail_locking="dot-locking"
4212 fi
4213
4214
4215 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
4216 echo "configure:4217: checking for kstat_open in -lkstat" >&5
4217 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
4218
4219 xe_check_libs=" -lkstat "
4220 cat > conftest.$ac_ext <<EOF
4221 #line 4222 "configure"
4222 #include "confdefs.h"
4223 /* Override any gcc2 internal prototype to avoid an error.  */
4224 /* We use char because int might match the return type of a gcc2
4225     builtin and then its argument prototype would still apply.  */
4226 char kstat_open();
4227
4228 int main() {
4229 kstat_open()
4230 ; return 0; }
4231 EOF
4232 if { (eval echo configure:4233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4233   rm -rf conftest*
4234   eval "ac_cv_lib_$ac_lib_var=yes"
4235 else
4236   echo "configure: failed program was:" >&5
4237   cat conftest.$ac_ext >&5
4238   rm -rf conftest*
4239   eval "ac_cv_lib_$ac_lib_var=no"
4240 fi
4241 rm -f conftest*
4242 xe_check_libs=""
4243
4244 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4245   echo "$ac_t""yes" 1>&6
4246     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4247     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4248   { test "$extra_verbose" = "yes" && cat << EOF
4249     Defining $ac_tr_lib
4250 EOF
4251 cat >> confdefs.h <<EOF
4252 #define $ac_tr_lib 1
4253 EOF
4254 }
4255
4256   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
4257
4258 else
4259   echo "$ac_t""no" 1>&6
4260 fi
4261
4262
4263
4264
4265 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
4266 echo "configure:4267: checking for kvm_read in -lkvm" >&5
4267 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
4268
4269 xe_check_libs=" -lkvm "
4270 cat > conftest.$ac_ext <<EOF
4271 #line 4272 "configure"
4272 #include "confdefs.h"
4273 /* Override any gcc2 internal prototype to avoid an error.  */
4274 /* We use char because int might match the return type of a gcc2
4275     builtin and then its argument prototype would still apply.  */
4276 char kvm_read();
4277
4278 int main() {
4279 kvm_read()
4280 ; return 0; }
4281 EOF
4282 if { (eval echo configure:4283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4283   rm -rf conftest*
4284   eval "ac_cv_lib_$ac_lib_var=yes"
4285 else
4286   echo "configure: failed program was:" >&5
4287   cat conftest.$ac_ext >&5
4288   rm -rf conftest*
4289   eval "ac_cv_lib_$ac_lib_var=no"
4290 fi
4291 rm -f conftest*
4292 xe_check_libs=""
4293
4294 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4295   echo "$ac_t""yes" 1>&6
4296     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4297     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4298   { test "$extra_verbose" = "yes" && cat << EOF
4299     Defining $ac_tr_lib
4300 EOF
4301 cat >> confdefs.h <<EOF
4302 #define $ac_tr_lib 1
4303 EOF
4304 }
4305
4306   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
4307
4308 else
4309   echo "$ac_t""no" 1>&6
4310 fi
4311
4312
4313
4314 case "$opsys" in decosf*)
4315   
4316 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4317 echo "configure:4318: checking for cma_open in -lpthreads" >&5
4318 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4319
4320 xe_check_libs=" -lpthreads "
4321 cat > conftest.$ac_ext <<EOF
4322 #line 4323 "configure"
4323 #include "confdefs.h"
4324 /* Override any gcc2 internal prototype to avoid an error.  */
4325 /* We use char because int might match the return type of a gcc2
4326     builtin and then its argument prototype would still apply.  */
4327 char cma_open();
4328
4329 int main() {
4330 cma_open()
4331 ; return 0; }
4332 EOF
4333 if { (eval echo configure:4334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4334   rm -rf conftest*
4335   eval "ac_cv_lib_$ac_lib_var=yes"
4336 else
4337   echo "configure: failed program was:" >&5
4338   cat conftest.$ac_ext >&5
4339   rm -rf conftest*
4340   eval "ac_cv_lib_$ac_lib_var=no"
4341 fi
4342 rm -f conftest*
4343 xe_check_libs=""
4344
4345 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4346   echo "$ac_t""yes" 1>&6
4347     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4348     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4349   { test "$extra_verbose" = "yes" && cat << EOF
4350     Defining $ac_tr_lib
4351 EOF
4352 cat >> confdefs.h <<EOF
4353 #define $ac_tr_lib 1
4354 EOF
4355 }
4356
4357   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4358
4359 else
4360   echo "$ac_t""no" 1>&6
4361 fi
4362
4363
4364   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4365     c_switch_site="$c_switch_site -threads" ;;
4366 esac
4367
4368 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4369 echo "configure:4370: checking whether the -xildoff compiler flag is required" >&5
4370 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4371   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4372     then echo "$ac_t""no" 1>&6;
4373     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
4374   fi
4375   else echo "$ac_t""no" 1>&6
4376 fi
4377
4378 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4379   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4380 echo "configure:4381: checking for \"-z ignore\" linker flag" >&5
4381   case "`ld -h 2>&1`" in
4382     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4383       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4384     *) echo "$ac_t""no" 1>&6 ;;
4385   esac
4386 fi
4387
4388
4389 echo "checking "for specified window system"" 1>&6
4390 echo "configure:4391: checking "for specified window system"" >&5
4391
4392 if test "$with_x11" != "no"; then
4393     test "$x_includes $x_libraries" != "NONE NONE" && \
4394    window_system=x11 with_x11=yes
4395
4396         
4397       if test "$x_includes $x_libraries" = "NONE NONE" \
4398     -a -n "$OPENWINHOME" \
4399     -a "$OPENWINHOME" != "/usr/openwin" \
4400     -a -d "$OPENWINHOME"; then
4401       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4402       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4403       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4404   fi
4405
4406   if test "$x_includes" = "NONE"; then
4407                     for dir in "/usr/X11" "/usr/X11R6"; do
4408       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4409     done
4410   fi
4411
4412   if test "$x_libraries" = "NONE"; then
4413     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4414       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4415     done
4416   fi
4417
4418   # If we find X, set shell vars x_includes and x_libraries to the
4419 # paths, otherwise set no_x=yes.
4420 # Uses ac_ vars as temps to allow command line to override cache and checks.
4421 # --without-x overrides everything else, but does not touch the cache.
4422 echo $ac_n "checking for X""... $ac_c" 1>&6
4423 echo "configure:4424: checking for X" >&5
4424
4425 # Check whether --with-x or --without-x was given.
4426 if test "${with_x+set}" = set; then
4427   withval="$with_x"
4428   :
4429 fi
4430
4431 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4432 if test "x$with_x" = xno; then
4433   # The user explicitly disabled X.
4434   have_x=disabled
4435 else
4436   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4437     # Both variables are already set.
4438     have_x=yes
4439   else
4440
4441 # One or both of the vars are not set, and there is no cached value.
4442 ac_x_includes=NO ac_x_libraries=NO
4443 rm -fr conftestdir
4444 if mkdir conftestdir; then
4445   cd conftestdir
4446   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4447   cat > Imakefile <<'EOF'
4448 acfindx:
4449         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4450 EOF
4451   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4452     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4453     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4454     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4455     for ac_extension in a so sl; do
4456       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4457         test -f $ac_im_libdir/libX11.$ac_extension; then
4458         ac_im_usrlibdir=$ac_im_libdir; break
4459       fi
4460     done
4461     # Screen out bogus values from the imake configuration.  They are
4462     # bogus both because they are the default anyway, and because
4463     # using them would break gcc on systems where it needs fixed includes.
4464     case "$ac_im_incroot" in
4465         /usr/include) ;;
4466         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4467     esac
4468     case "$ac_im_usrlibdir" in
4469         /usr/lib | /lib) ;;
4470         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4471     esac
4472   fi
4473   cd ..
4474   rm -fr conftestdir
4475 fi
4476
4477 if test "$ac_x_includes" = NO; then
4478   # Guess where to find include files, by looking for this one X11 .h file.
4479   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4480
4481   # First, try using that file with no special directory specified.
4482 cat > conftest.$ac_ext <<EOF
4483 #line 4484 "configure"
4484 #include "confdefs.h"
4485 #include <$x_direct_test_include>
4486 EOF
4487 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4488 { (eval echo configure:4489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4489 ac_err=`grep -v '^ *+' conftest.out`
4490 if test -z "$ac_err"; then
4491   rm -rf conftest*
4492   # We can compile using X headers with no special include directory.
4493 ac_x_includes=
4494 else
4495   echo "$ac_err" >&5
4496   echo "configure: failed program was:" >&5
4497   cat conftest.$ac_ext >&5
4498   rm -rf conftest*
4499   # Look for the header file in a standard set of common directories.
4500 # Check X11 before X11Rn because it is often a symlink to the current release.
4501   for ac_dir in               \
4502     /usr/X11/include          \
4503     /usr/X11R6/include        \
4504     /usr/X11R5/include        \
4505     /usr/X11R4/include        \
4506                               \
4507     /usr/include/X11          \
4508     /usr/include/X11R6        \
4509     /usr/include/X11R5        \
4510     /usr/include/X11R4        \
4511                               \
4512     /usr/local/X11/include    \
4513     /usr/local/X11R6/include  \
4514     /usr/local/X11R5/include  \
4515     /usr/local/X11R4/include  \
4516                               \
4517     /usr/local/include/X11    \
4518     /usr/local/include/X11R6  \
4519     /usr/local/include/X11R5  \
4520     /usr/local/include/X11R4  \
4521                               \
4522     /usr/X386/include         \
4523     /usr/x386/include         \
4524     /usr/XFree86/include/X11  \
4525                               \
4526     /usr/include              \
4527     /usr/local/include        \
4528     /usr/unsupported/include  \
4529     /usr/athena/include       \
4530     /usr/local/x11r5/include  \
4531     /usr/lpp/Xamples/include  \
4532                               \
4533     /usr/openwin/include      \
4534     /usr/openwin/share/include \
4535     ; \
4536   do
4537     if test -r "$ac_dir/$x_direct_test_include"; then
4538       ac_x_includes=$ac_dir
4539       break
4540     fi
4541   done
4542 fi
4543 rm -f conftest*
4544 fi # $ac_x_includes = NO
4545
4546 if test "$ac_x_libraries" = NO; then
4547   # Check for the libraries.
4548
4549   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4550   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4551
4552   # See if we find them without any special options.
4553   # Don't add to $LIBS permanently.
4554   ac_save_LIBS="$LIBS"
4555   LIBS="-l$x_direct_test_library $LIBS"
4556 cat > conftest.$ac_ext <<EOF
4557 #line 4558 "configure"
4558 #include "confdefs.h"
4559
4560 int main() {
4561 ${x_direct_test_function}()
4562 ; return 0; }
4563 EOF
4564 if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4565   rm -rf conftest*
4566   LIBS="$ac_save_LIBS"
4567 # We can link X programs with no special library path.
4568 ac_x_libraries=
4569 else
4570   echo "configure: failed program was:" >&5
4571   cat conftest.$ac_ext >&5
4572   rm -rf conftest*
4573   LIBS="$ac_save_LIBS"
4574 # First see if replacing the include by lib works.
4575 # Check X11 before X11Rn because it is often a symlink to the current release.
4576 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4577     /usr/X11/lib          \
4578     /usr/X11R6/lib        \
4579     /usr/X11R5/lib        \
4580     /usr/X11R4/lib        \
4581                           \
4582     /usr/lib/X11          \
4583     /usr/lib/X11R6        \
4584     /usr/lib/X11R5        \
4585     /usr/lib/X11R4        \
4586                           \
4587     /usr/local/X11/lib    \
4588     /usr/local/X11R6/lib  \
4589     /usr/local/X11R5/lib  \
4590     /usr/local/X11R4/lib  \
4591                           \
4592     /usr/local/lib/X11    \
4593     /usr/local/lib/X11R6  \
4594     /usr/local/lib/X11R5  \
4595     /usr/local/lib/X11R4  \
4596                           \
4597     /usr/X386/lib         \
4598     /usr/x386/lib         \
4599     /usr/XFree86/lib/X11  \
4600                           \
4601     /usr/lib              \
4602     /usr/local/lib        \
4603     /usr/unsupported/lib  \
4604     /usr/athena/lib       \
4605     /usr/local/x11r5/lib  \
4606     /usr/lpp/Xamples/lib  \
4607     /lib/usr/lib/X11      \
4608                           \
4609     /usr/openwin/lib      \
4610     /usr/openwin/share/lib \
4611     ; \
4612 do
4613   for ac_extension in a so sl; do
4614     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4615       ac_x_libraries=$ac_dir
4616       break 2
4617     fi
4618   done
4619 done
4620 fi
4621 rm -f conftest*
4622 fi # $ac_x_libraries = NO
4623
4624 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4625   # Didn't find X anywhere.  Cache the known absence of X.
4626   ac_cv_have_x="have_x=no"
4627 else
4628   # Record where we found X for the cache.
4629   ac_cv_have_x="have_x=yes \
4630                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4631 fi
4632   fi
4633   eval "$ac_cv_have_x"
4634 fi # $with_x != no
4635
4636 if test "$have_x" != yes; then
4637   echo "$ac_t""$have_x" 1>&6
4638   no_x=yes
4639 else
4640   # If each of the values was on the command line, it overrides each guess.
4641   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4642   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4643   # Update the cache value to reflect the command line values.
4644   ac_cv_have_x="have_x=yes \
4645                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4646   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4647 fi
4648
4649 if test "$no_x" = yes; then
4650   # Not all programs may use this symbol, but it does not hurt to define it.
4651   { test "$extra_verbose" = "yes" && cat << \EOF
4652     Defining X_DISPLAY_MISSING
4653 EOF
4654 cat >> confdefs.h <<\EOF
4655 #define X_DISPLAY_MISSING 1
4656 EOF
4657 }
4658
4659   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4660 else
4661   if test -n "$x_includes"; then
4662     X_CFLAGS="$X_CFLAGS -I$x_includes"
4663   fi
4664
4665   # It would also be nice to do this for all -L options, not just this one.
4666   if test -n "$x_libraries"; then
4667     X_LIBS="$X_LIBS -L$x_libraries"
4668     # For Solaris; some versions of Sun CC require a space after -R and
4669     # others require no space.  Words are not sufficient . . . .
4670     case "`(uname -sr) 2>/dev/null`" in
4671     "SunOS 5"*)
4672       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4673 echo "configure:4674: checking whether -R must be followed by a space" >&5
4674       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4675       cat > conftest.$ac_ext <<EOF
4676 #line 4677 "configure"
4677 #include "confdefs.h"
4678
4679 int main() {
4680
4681 ; return 0; }
4682 EOF
4683 if { (eval echo configure:4684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4684   rm -rf conftest*
4685   ac_R_nospace=yes
4686 else
4687   echo "configure: failed program was:" >&5
4688   cat conftest.$ac_ext >&5
4689   rm -rf conftest*
4690   ac_R_nospace=no
4691 fi
4692 rm -f conftest*
4693       if test $ac_R_nospace = yes; then
4694         echo "$ac_t""no" 1>&6
4695         X_LIBS="$X_LIBS -R$x_libraries"
4696       else
4697         LIBS="$ac_xsave_LIBS -R $x_libraries"
4698         cat > conftest.$ac_ext <<EOF
4699 #line 4700 "configure"
4700 #include "confdefs.h"
4701
4702 int main() {
4703
4704 ; return 0; }
4705 EOF
4706 if { (eval echo configure:4707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4707   rm -rf conftest*
4708   ac_R_space=yes
4709 else
4710   echo "configure: failed program was:" >&5
4711   cat conftest.$ac_ext >&5
4712   rm -rf conftest*
4713   ac_R_space=no
4714 fi
4715 rm -f conftest*
4716         if test $ac_R_space = yes; then
4717           echo "$ac_t""yes" 1>&6
4718           X_LIBS="$X_LIBS -R $x_libraries"
4719         else
4720           echo "$ac_t""neither works" 1>&6
4721         fi
4722       fi
4723       LIBS="$ac_xsave_LIBS"
4724     esac
4725   fi
4726
4727   # Check for system-dependent libraries X programs must link with.
4728   # Do this before checking for the system-independent R6 libraries
4729   # (-lICE), since we may need -lsocket or whatever for X linking.
4730
4731   if test "$ISC" = yes; then
4732     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4733   else
4734     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4735     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4736     # the Alpha needs dnet_stub (dnet does not exist).
4737     if test "$with_dnet" = "no" ; then
4738 ac_cv_lib_dnet_dnet_ntoa=no
4739 else
4740
4741 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4742 echo "configure:4743: checking for dnet_ntoa in -ldnet" >&5
4743 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4744
4745 xe_check_libs=" -ldnet "
4746 cat > conftest.$ac_ext <<EOF
4747 #line 4748 "configure"
4748 #include "confdefs.h"
4749 /* Override any gcc2 internal prototype to avoid an error.  */
4750 /* We use char because int might match the return type of a gcc2
4751     builtin and then its argument prototype would still apply.  */
4752 char dnet_ntoa();
4753
4754 int main() {
4755 dnet_ntoa()
4756 ; return 0; }
4757 EOF
4758 if { (eval echo configure:4759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4759   rm -rf conftest*
4760   eval "ac_cv_lib_$ac_lib_var=yes"
4761 else
4762   echo "configure: failed program was:" >&5
4763   cat conftest.$ac_ext >&5
4764   rm -rf conftest*
4765   eval "ac_cv_lib_$ac_lib_var=no"
4766 fi
4767 rm -f conftest*
4768 xe_check_libs=""
4769
4770 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4771   echo "$ac_t""yes" 1>&6
4772   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4773 else
4774   echo "$ac_t""no" 1>&6
4775 fi
4776
4777 fi
4778
4779     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4780       
4781 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4782 echo "configure:4783: checking for dnet_ntoa in -ldnet_stub" >&5
4783 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4784
4785 xe_check_libs=" -ldnet_stub "
4786 cat > conftest.$ac_ext <<EOF
4787 #line 4788 "configure"
4788 #include "confdefs.h"
4789 /* Override any gcc2 internal prototype to avoid an error.  */
4790 /* We use char because int might match the return type of a gcc2
4791     builtin and then its argument prototype would still apply.  */
4792 char dnet_ntoa();
4793
4794 int main() {
4795 dnet_ntoa()
4796 ; return 0; }
4797 EOF
4798 if { (eval echo configure:4799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4799   rm -rf conftest*
4800   eval "ac_cv_lib_$ac_lib_var=yes"
4801 else
4802   echo "configure: failed program was:" >&5
4803   cat conftest.$ac_ext >&5
4804   rm -rf conftest*
4805   eval "ac_cv_lib_$ac_lib_var=no"
4806 fi
4807 rm -f conftest*
4808 xe_check_libs=""
4809
4810 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4811   echo "$ac_t""yes" 1>&6
4812   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4813 else
4814   echo "$ac_t""no" 1>&6
4815 fi
4816
4817
4818     fi
4819
4820     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4821     # to get the SysV transport functions.
4822     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4823     # needs -lnsl.
4824     # The nsl library prevents programs from opening the X display
4825     # on Irix 5.2, according to dickey@clark.net.
4826     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4827 echo "configure:4828: checking for gethostbyname" >&5
4828
4829 cat > conftest.$ac_ext <<EOF
4830 #line 4831 "configure"
4831 #include "confdefs.h"
4832 /* System header to define __stub macros and hopefully few prototypes,
4833     which can conflict with char gethostbyname(); below.  */
4834 #include <assert.h>
4835 /* Override any gcc2 internal prototype to avoid an error.  */
4836 /* We use char because int might match the return type of a gcc2
4837     builtin and then its argument prototype would still apply.  */
4838 char gethostbyname();
4839
4840 int main() {
4841
4842 /* The GNU C library defines this for functions which it implements
4843     to always fail with ENOSYS.  Some functions are actually named
4844     something starting with __ and the normal name is an alias.  */
4845 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4846 choke me
4847 #else
4848 gethostbyname();
4849 #endif
4850
4851 ; return 0; }
4852 EOF
4853 if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4854   rm -rf conftest*
4855   eval "ac_cv_func_gethostbyname=yes"
4856 else
4857   echo "configure: failed program was:" >&5
4858   cat conftest.$ac_ext >&5
4859   rm -rf conftest*
4860   eval "ac_cv_func_gethostbyname=no"
4861 fi
4862 rm -f conftest*
4863
4864 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4865   echo "$ac_t""yes" 1>&6
4866   :
4867 else
4868   echo "$ac_t""no" 1>&6
4869 fi
4870
4871     if test $ac_cv_func_gethostbyname = no; then
4872       
4873 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4874 echo "configure:4875: checking for gethostbyname in -lnsl" >&5
4875 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4876
4877 xe_check_libs=" -lnsl "
4878 cat > conftest.$ac_ext <<EOF
4879 #line 4880 "configure"
4880 #include "confdefs.h"
4881 /* Override any gcc2 internal prototype to avoid an error.  */
4882 /* We use char because int might match the return type of a gcc2
4883     builtin and then its argument prototype would still apply.  */
4884 char gethostbyname();
4885
4886 int main() {
4887 gethostbyname()
4888 ; return 0; }
4889 EOF
4890 if { (eval echo configure:4891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4891   rm -rf conftest*
4892   eval "ac_cv_lib_$ac_lib_var=yes"
4893 else
4894   echo "configure: failed program was:" >&5
4895   cat conftest.$ac_ext >&5
4896   rm -rf conftest*
4897   eval "ac_cv_lib_$ac_lib_var=no"
4898 fi
4899 rm -f conftest*
4900 xe_check_libs=""
4901
4902 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4903   echo "$ac_t""yes" 1>&6
4904   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4905 else
4906   echo "$ac_t""no" 1>&6
4907 fi
4908
4909
4910     fi
4911
4912     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4913     # socket/setsockopt and other routines are undefined under SCO ODT
4914     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4915     # on later versions), says simon@lia.di.epfl.ch: it contains
4916     # gethostby* variants that don't use the nameserver (or something).
4917     # -lsocket must be given before -lnsl if both are needed.
4918     # We assume that if connect needs -lnsl, so does gethostbyname.
4919     echo $ac_n "checking for connect""... $ac_c" 1>&6
4920 echo "configure:4921: checking for connect" >&5
4921
4922 cat > conftest.$ac_ext <<EOF
4923 #line 4924 "configure"
4924 #include "confdefs.h"
4925 /* System header to define __stub macros and hopefully few prototypes,
4926     which can conflict with char connect(); below.  */
4927 #include <assert.h>
4928 /* Override any gcc2 internal prototype to avoid an error.  */
4929 /* We use char because int might match the return type of a gcc2
4930     builtin and then its argument prototype would still apply.  */
4931 char connect();
4932
4933 int main() {
4934
4935 /* The GNU C library defines this for functions which it implements
4936     to always fail with ENOSYS.  Some functions are actually named
4937     something starting with __ and the normal name is an alias.  */
4938 #if defined (__stub_connect) || defined (__stub___connect)
4939 choke me
4940 #else
4941 connect();
4942 #endif
4943
4944 ; return 0; }
4945 EOF
4946 if { (eval echo configure:4947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4947   rm -rf conftest*
4948   eval "ac_cv_func_connect=yes"
4949 else
4950   echo "configure: failed program was:" >&5
4951   cat conftest.$ac_ext >&5
4952   rm -rf conftest*
4953   eval "ac_cv_func_connect=no"
4954 fi
4955 rm -f conftest*
4956
4957 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4958   echo "$ac_t""yes" 1>&6
4959   :
4960 else
4961   echo "$ac_t""no" 1>&6
4962 fi
4963
4964     if test $ac_cv_func_connect = no; then
4965       
4966 xe_msg_checking="for connect in -lsocket"
4967 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
4968 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
4969 echo "configure:4970: checking "$xe_msg_checking"" >&5
4970 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
4971
4972 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
4973 cat > conftest.$ac_ext <<EOF
4974 #line 4975 "configure"
4975 #include "confdefs.h"
4976 /* Override any gcc2 internal prototype to avoid an error.  */
4977 /* We use char because int might match the return type of a gcc2
4978     builtin and then its argument prototype would still apply.  */
4979 char connect();
4980
4981 int main() {
4982 connect()
4983 ; return 0; }
4984 EOF
4985 if { (eval echo configure:4986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4986   rm -rf conftest*
4987   eval "ac_cv_lib_$ac_lib_var=yes"
4988 else
4989   echo "configure: failed program was:" >&5
4990   cat conftest.$ac_ext >&5
4991   rm -rf conftest*
4992   eval "ac_cv_lib_$ac_lib_var=no"
4993 fi
4994 rm -f conftest*
4995 xe_check_libs=""
4996
4997 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4998   echo "$ac_t""yes" 1>&6
4999   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5000 else
5001   echo "$ac_t""no" 1>&6
5002 fi
5003
5004
5005     fi
5006
5007     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5008     echo $ac_n "checking for remove""... $ac_c" 1>&6
5009 echo "configure:5010: checking for remove" >&5
5010
5011 cat > conftest.$ac_ext <<EOF
5012 #line 5013 "configure"
5013 #include "confdefs.h"
5014 /* System header to define __stub macros and hopefully few prototypes,
5015     which can conflict with char remove(); below.  */
5016 #include <assert.h>
5017 /* Override any gcc2 internal prototype to avoid an error.  */
5018 /* We use char because int might match the return type of a gcc2
5019     builtin and then its argument prototype would still apply.  */
5020 char remove();
5021
5022 int main() {
5023
5024 /* The GNU C library defines this for functions which it implements
5025     to always fail with ENOSYS.  Some functions are actually named
5026     something starting with __ and the normal name is an alias.  */
5027 #if defined (__stub_remove) || defined (__stub___remove)
5028 choke me
5029 #else
5030 remove();
5031 #endif
5032
5033 ; return 0; }
5034 EOF
5035 if { (eval echo configure:5036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5036   rm -rf conftest*
5037   eval "ac_cv_func_remove=yes"
5038 else
5039   echo "configure: failed program was:" >&5
5040   cat conftest.$ac_ext >&5
5041   rm -rf conftest*
5042   eval "ac_cv_func_remove=no"
5043 fi
5044 rm -f conftest*
5045
5046 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5047   echo "$ac_t""yes" 1>&6
5048   :
5049 else
5050   echo "$ac_t""no" 1>&6
5051 fi
5052
5053     if test $ac_cv_func_remove = no; then
5054       
5055 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5056 echo "configure:5057: checking for remove in -lposix" >&5
5057 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5058
5059 xe_check_libs=" -lposix "
5060 cat > conftest.$ac_ext <<EOF
5061 #line 5062 "configure"
5062 #include "confdefs.h"
5063 /* Override any gcc2 internal prototype to avoid an error.  */
5064 /* We use char because int might match the return type of a gcc2
5065     builtin and then its argument prototype would still apply.  */
5066 char remove();
5067
5068 int main() {
5069 remove()
5070 ; return 0; }
5071 EOF
5072 if { (eval echo configure:5073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5073   rm -rf conftest*
5074   eval "ac_cv_lib_$ac_lib_var=yes"
5075 else
5076   echo "configure: failed program was:" >&5
5077   cat conftest.$ac_ext >&5
5078   rm -rf conftest*
5079   eval "ac_cv_lib_$ac_lib_var=no"
5080 fi
5081 rm -f conftest*
5082 xe_check_libs=""
5083
5084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5085   echo "$ac_t""yes" 1>&6
5086   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5087 else
5088   echo "$ac_t""no" 1>&6
5089 fi
5090
5091
5092     fi
5093
5094     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5095     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5096 echo "configure:5097: checking for shmat" >&5
5097
5098 cat > conftest.$ac_ext <<EOF
5099 #line 5100 "configure"
5100 #include "confdefs.h"
5101 /* System header to define __stub macros and hopefully few prototypes,
5102     which can conflict with char shmat(); below.  */
5103 #include <assert.h>
5104 /* Override any gcc2 internal prototype to avoid an error.  */
5105 /* We use char because int might match the return type of a gcc2
5106     builtin and then its argument prototype would still apply.  */
5107 char shmat();
5108
5109 int main() {
5110
5111 /* The GNU C library defines this for functions which it implements
5112     to always fail with ENOSYS.  Some functions are actually named
5113     something starting with __ and the normal name is an alias.  */
5114 #if defined (__stub_shmat) || defined (__stub___shmat)
5115 choke me
5116 #else
5117 shmat();
5118 #endif
5119
5120 ; return 0; }
5121 EOF
5122 if { (eval echo configure:5123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5123   rm -rf conftest*
5124   eval "ac_cv_func_shmat=yes"
5125 else
5126   echo "configure: failed program was:" >&5
5127   cat conftest.$ac_ext >&5
5128   rm -rf conftest*
5129   eval "ac_cv_func_shmat=no"
5130 fi
5131 rm -f conftest*
5132
5133 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5134   echo "$ac_t""yes" 1>&6
5135   :
5136 else
5137   echo "$ac_t""no" 1>&6
5138 fi
5139
5140     if test $ac_cv_func_shmat = no; then
5141       
5142 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5143 echo "configure:5144: checking for shmat in -lipc" >&5
5144 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5145
5146 xe_check_libs=" -lipc "
5147 cat > conftest.$ac_ext <<EOF
5148 #line 5149 "configure"
5149 #include "confdefs.h"
5150 /* Override any gcc2 internal prototype to avoid an error.  */
5151 /* We use char because int might match the return type of a gcc2
5152     builtin and then its argument prototype would still apply.  */
5153 char shmat();
5154
5155 int main() {
5156 shmat()
5157 ; return 0; }
5158 EOF
5159 if { (eval echo configure:5160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5160   rm -rf conftest*
5161   eval "ac_cv_lib_$ac_lib_var=yes"
5162 else
5163   echo "configure: failed program was:" >&5
5164   cat conftest.$ac_ext >&5
5165   rm -rf conftest*
5166   eval "ac_cv_lib_$ac_lib_var=no"
5167 fi
5168 rm -f conftest*
5169 xe_check_libs=""
5170
5171 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5172   echo "$ac_t""yes" 1>&6
5173   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5174 else
5175   echo "$ac_t""no" 1>&6
5176 fi
5177
5178
5179     fi
5180   fi
5181
5182   # Check for libraries that X11R6 Xt/Xaw programs need.
5183   ac_save_LDFLAGS="$LDFLAGS"
5184   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5185   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5186   # check for ICE first), but we must link in the order -lSM -lICE or
5187   # we get undefined symbols.  So assume we have SM if we have ICE.
5188   # These have to be linked with before -lX11, unlike the other
5189   # libraries we check for below, so use a different variable.
5190   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5191   
5192 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5193 echo "configure:5194: checking for IceConnectionNumber in -lICE" >&5
5194 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5195
5196 xe_check_libs=" -lICE "
5197 cat > conftest.$ac_ext <<EOF
5198 #line 5199 "configure"
5199 #include "confdefs.h"
5200 /* Override any gcc2 internal prototype to avoid an error.  */
5201 /* We use char because int might match the return type of a gcc2
5202     builtin and then its argument prototype would still apply.  */
5203 char IceConnectionNumber();
5204
5205 int main() {
5206 IceConnectionNumber()
5207 ; return 0; }
5208 EOF
5209 if { (eval echo configure:5210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5210   rm -rf conftest*
5211   eval "ac_cv_lib_$ac_lib_var=yes"
5212 else
5213   echo "configure: failed program was:" >&5
5214   cat conftest.$ac_ext >&5
5215   rm -rf conftest*
5216   eval "ac_cv_lib_$ac_lib_var=no"
5217 fi
5218 rm -f conftest*
5219 xe_check_libs=""
5220
5221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5222   echo "$ac_t""yes" 1>&6
5223   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5224 else
5225   echo "$ac_t""no" 1>&6
5226 fi
5227
5228
5229   LDFLAGS="$ac_save_LDFLAGS"
5230
5231 fi
5232  # Autoconf claims to find X library and include dirs for us.
5233   if test "$no_x" = "yes"
5234   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5235   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5236   fi
5237 fi
5238
5239 case "$with_x11" in
5240   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5241   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5242 esac
5243
5244 if test "$with_x11" = "yes"; then
5245   { test "$extra_verbose" = "yes" && cat << \EOF
5246     Defining HAVE_X_WINDOWS
5247 EOF
5248 cat >> confdefs.h <<\EOF
5249 #define HAVE_X_WINDOWS 1
5250 EOF
5251 }
5252
5253   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5254   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5255
5256       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5257     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5258     if test -d "$lib_dir" -a -d "$inc_dir"; then
5259       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5260         x_libraries="$lib_dir $x_libraries"
5261         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5262       esac
5263       case "$x_includes" in "$inc_dir"* ) ;; *)
5264         x_includes="$inc_dir $x_includes"
5265         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5266       esac
5267       break;       fi
5268   done
5269
5270     for rel in "X11R6" "X11R5" "X11R4"; do
5271     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5272     if test -d "$lib_dir" -a -d "$inc_dir"; then
5273       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5274         x_libraries="$x_libraries $lib_dir"
5275         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5276       esac
5277       case "$x_includes" in "$inc_dir"* ) ;; *)
5278         x_includes="$x_includes $inc_dir"
5279         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5280       esac
5281       break;     fi
5282   done
5283
5284     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
5285
5286   ld_switch_x_site="$X_LIBS"
5287
5288   
5289 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5290     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5291   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5292   
5293         runpath="" runpath_dirs=""
5294   if test -n "$LD_RUN_PATH"; then
5295     runpath="$LD_RUN_PATH"
5296   elif test "$GCC" = "yes"; then
5297         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5298     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5299     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5300     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5301       case "$arg" in P,* | -L* | -R* )
5302         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5303           {
5304 xe_runpath_dir="$dir"
5305   test "$xe_runpath_dir" != "/lib"     -a \
5306         "$xe_runpath_dir" != "/usr/lib" -a \
5307         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5308   eval "$xe_add_unique_runpath_dir"
5309 }
5310         done ;;
5311       esac
5312     done
5313     ld_switch_run="$ld_switch_run_save"
5314     rm -f conftest*
5315   else
5316         for arg in $ld_switch_site $ld_switch_x_site; do
5317       case "$arg" in -L*) {
5318 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5319   test "$xe_runpath_dir" != "/lib"     -a \
5320         "$xe_runpath_dir" != "/usr/lib" -a \
5321         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5322   eval "$xe_add_unique_runpath_dir"
5323 };; esac
5324     done
5325         if test "$opsys $need_motif" = "sol2 yes"; then
5326       xe_runpath_dir="/opt/SUNWdt/lib";
5327       eval "$xe_add_unique_runpath_dir";
5328     fi
5329   fi 
5330   if test -n "$runpath"; then
5331     ld_switch_run="${dash_r}${runpath}"
5332     
5333 if test "$GCC" = "yes"; then
5334   set x $ld_switch_run; shift; ld_switch_run=""
5335   while test -n "$1"; do
5336     case $1 in
5337       -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5338       -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
5339       -Xlinker* ) ;;
5340       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5341     esac
5342     shift
5343   done
5344 fi
5345     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5346   fi
5347 fi
5348
5349
5350   if test "$extra_verbose" = "yes"; then
5351     echo; echo "X11 compilation variables:"
5352     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5353     echo
5354   fi
5355
5356             bitmapdirs=
5357   if test "$x_includes" != NONE; then
5358     for i in $x_includes; do
5359       if test -d "$i/bitmaps"; then
5360         bitmapdirs="$i/bitmaps:$bitmapdirs"
5361       fi
5362       if test -d "$i/X11/bitmaps"; then
5363         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5364       fi
5365     done
5366     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5367   fi
5368   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5369     Defining BITMAPDIR = "$bitmapdirs"
5370 EOF
5371 cat >> confdefs.h <<EOF
5372 #define BITMAPDIR "$bitmapdirs"
5373 EOF
5374 }
5375
5376
5377     echo "checking for X defines extracted by xmkmf" 1>&6
5378 echo "configure:5379: checking for X defines extracted by xmkmf" >&5
5379   rm -fr conftestdir
5380   if mkdir conftestdir; then
5381     cd conftestdir
5382     cat > Imakefile <<'EOF'
5383 xetest:
5384         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5385 EOF
5386     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5387       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5388       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5389     fi
5390     cd ..
5391     rm -fr conftestdir
5392     for word in $xmkmf_defines; do
5393       case "$word" in
5394         -D*=* ) ;;
5395         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5396               { test "$extra_verbose" = "yes" && cat << EOF
5397     Defining $word
5398 EOF
5399 cat >> confdefs.h <<EOF
5400 #define $word 1
5401 EOF
5402 }
5403  ;;
5404       esac
5405     done
5406   fi
5407
5408     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5409 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5410 echo "configure:5411: checking for X11/Intrinsic.h" >&5
5411
5412 cat > conftest.$ac_ext <<EOF
5413 #line 5414 "configure"
5414 #include "confdefs.h"
5415 #include <X11/Intrinsic.h>
5416 EOF
5417 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5418 { (eval echo configure:5419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5419 ac_err=`grep -v '^ *+' conftest.out`
5420 if test -z "$ac_err"; then
5421   rm -rf conftest*
5422   eval "ac_cv_header_$ac_safe=yes"
5423 else
5424   echo "$ac_err" >&5
5425   echo "configure: failed program was:" >&5
5426   cat conftest.$ac_ext >&5
5427   rm -rf conftest*
5428   eval "ac_cv_header_$ac_safe=no"
5429 fi
5430 rm -f conftest*
5431 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5432   echo "$ac_t""yes" 1>&6
5433   :
5434 else
5435   echo "$ac_t""no" 1>&6
5436 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5437 fi
5438
5439
5440       
5441 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5442 echo "configure:5443: checking for XOpenDisplay in -lX11" >&5
5443 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5444
5445 xe_check_libs=" -lX11 "
5446 cat > conftest.$ac_ext <<EOF
5447 #line 5448 "configure"
5448 #include "confdefs.h"
5449 /* Override any gcc2 internal prototype to avoid an error.  */
5450 /* We use char because int might match the return type of a gcc2
5451     builtin and then its argument prototype would still apply.  */
5452 char XOpenDisplay();
5453
5454 int main() {
5455 XOpenDisplay()
5456 ; return 0; }
5457 EOF
5458 if { (eval echo configure:5459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5459   rm -rf conftest*
5460   eval "ac_cv_lib_$ac_lib_var=yes"
5461 else
5462   echo "configure: failed program was:" >&5
5463   cat conftest.$ac_ext >&5
5464   rm -rf conftest*
5465   eval "ac_cv_lib_$ac_lib_var=no"
5466 fi
5467 rm -f conftest*
5468 xe_check_libs=""
5469
5470 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5471   echo "$ac_t""yes" 1>&6
5472   have_lib_x11=yes
5473 else
5474   echo "$ac_t""no" 1>&6
5475 fi
5476
5477
5478   if test "$have_lib_x11" != "yes"; then
5479     
5480 xe_msg_checking="for XGetFontProperty in -lX11"
5481 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5482 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5483 echo "configure:5484: checking "$xe_msg_checking"" >&5
5484 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5485
5486 xe_check_libs=" -lX11 -b i486-linuxaout"
5487 cat > conftest.$ac_ext <<EOF
5488 #line 5489 "configure"
5489 #include "confdefs.h"
5490 /* Override any gcc2 internal prototype to avoid an error.  */
5491 /* We use char because int might match the return type of a gcc2
5492     builtin and then its argument prototype would still apply.  */
5493 char XGetFontProperty();
5494
5495 int main() {
5496 XGetFontProperty()
5497 ; return 0; }
5498 EOF
5499 if { (eval echo configure:5500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5500   rm -rf conftest*
5501   eval "ac_cv_lib_$ac_lib_var=yes"
5502 else
5503   echo "configure: failed program was:" >&5
5504   cat conftest.$ac_ext >&5
5505   rm -rf conftest*
5506   eval "ac_cv_lib_$ac_lib_var=no"
5507 fi
5508 rm -f conftest*
5509 xe_check_libs=""
5510
5511 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5512   echo "$ac_t""yes" 1>&6
5513   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5514 else
5515   echo "$ac_t""no" 1>&6
5516 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5517 fi
5518
5519
5520   fi
5521   libs_x="-lX11"
5522   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5523
5524     
5525 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5526 echo "configure:5527: checking for XShapeSelectInput in -lXext" >&5
5527 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5528
5529 xe_check_libs=" -lXext "
5530 cat > conftest.$ac_ext <<EOF
5531 #line 5532 "configure"
5532 #include "confdefs.h"
5533 /* Override any gcc2 internal prototype to avoid an error.  */
5534 /* We use char because int might match the return type of a gcc2
5535     builtin and then its argument prototype would still apply.  */
5536 char XShapeSelectInput();
5537
5538 int main() {
5539 XShapeSelectInput()
5540 ; return 0; }
5541 EOF
5542 if { (eval echo configure:5543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5543   rm -rf conftest*
5544   eval "ac_cv_lib_$ac_lib_var=yes"
5545 else
5546   echo "configure: failed program was:" >&5
5547   cat conftest.$ac_ext >&5
5548   rm -rf conftest*
5549   eval "ac_cv_lib_$ac_lib_var=no"
5550 fi
5551 rm -f conftest*
5552 xe_check_libs=""
5553
5554 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5555   echo "$ac_t""yes" 1>&6
5556   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5557 else
5558   echo "$ac_t""no" 1>&6
5559 fi
5560
5561
5562
5563     
5564 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5565 echo "configure:5566: checking for XtOpenDisplay in -lXt" >&5
5566 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5567
5568 xe_check_libs=" -lXt "
5569 cat > conftest.$ac_ext <<EOF
5570 #line 5571 "configure"
5571 #include "confdefs.h"
5572 /* Override any gcc2 internal prototype to avoid an error.  */
5573 /* We use char because int might match the return type of a gcc2
5574     builtin and then its argument prototype would still apply.  */
5575 char XtOpenDisplay();
5576
5577 int main() {
5578 XtOpenDisplay()
5579 ; return 0; }
5580 EOF
5581 if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5582   rm -rf conftest*
5583   eval "ac_cv_lib_$ac_lib_var=yes"
5584 else
5585   echo "configure: failed program was:" >&5
5586   cat conftest.$ac_ext >&5
5587   rm -rf conftest*
5588   eval "ac_cv_lib_$ac_lib_var=no"
5589 fi
5590 rm -f conftest*
5591 xe_check_libs=""
5592
5593 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5594   echo "$ac_t""yes" 1>&6
5595   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5596 else
5597   echo "$ac_t""no" 1>&6
5598 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5599 fi
5600
5601
5602
5603   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5604 echo "configure:5605: checking the version of X11 being used" >&5
5605   cat > conftest.$ac_ext <<EOF
5606 #line 5607 "configure"
5607 #include "confdefs.h"
5608 #include <X11/Intrinsic.h>
5609     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5610 EOF
5611 if { (eval echo configure:5612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5612 then
5613   ./conftest foobar; x11_release=$?
5614 else
5615   conftest_rc="$?"
5616   echo "configure: failed program was:" >&5
5617   cat conftest.$ac_ext >&5
5618   rm -fr conftest*
5619   x11_release=4
5620 fi
5621 rm -fr conftest*
5622   echo "$ac_t""R${x11_release}" 1>&6
5623   { test "$extra_verbose" = "yes" && cat << EOF
5624     Defining THIS_IS_X11R${x11_release}
5625 EOF
5626 cat >> confdefs.h <<EOF
5627 #define THIS_IS_X11R${x11_release} 1
5628 EOF
5629 }
5630
5631
5632   for ac_hdr in X11/Xlocale.h
5633 do
5634 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5635 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5636 echo "configure:5637: checking for $ac_hdr" >&5
5637
5638 cat > conftest.$ac_ext <<EOF
5639 #line 5640 "configure"
5640 #include "confdefs.h"
5641 #include <$ac_hdr>
5642 EOF
5643 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5644 { (eval echo configure:5645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5645 ac_err=`grep -v '^ *+' conftest.out`
5646 if test -z "$ac_err"; then
5647   rm -rf conftest*
5648   eval "ac_cv_header_$ac_safe=yes"
5649 else
5650   echo "$ac_err" >&5
5651   echo "configure: failed program was:" >&5
5652   cat conftest.$ac_ext >&5
5653   rm -rf conftest*
5654   eval "ac_cv_header_$ac_safe=no"
5655 fi
5656 rm -f conftest*
5657 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5658   echo "$ac_t""yes" 1>&6
5659     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5660   { test "$extra_verbose" = "yes" && cat << EOF
5661     Defining $ac_tr_hdr
5662 EOF
5663 cat >> confdefs.h <<EOF
5664 #define $ac_tr_hdr 1
5665 EOF
5666 }
5667  
5668 else
5669   echo "$ac_t""no" 1>&6
5670 fi
5671 done
5672
5673
5674     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5675 echo "configure:5676: checking for XFree86" >&5
5676   if test -d "/usr/X386/include" -o \
5677           -f "/etc/XF86Config"    -o \
5678           -f "/etc/X11/XF86Config" -o \
5679           -f "/usr/X11R6/lib/X11/XF86Config"; then
5680     echo "$ac_t""yes" 1>&6
5681     { test "$extra_verbose" = "yes" && cat << \EOF
5682     Defining HAVE_XFREE386
5683 EOF
5684 cat >> confdefs.h <<\EOF
5685 #define HAVE_XFREE386 1
5686 EOF
5687 }
5688
5689   else
5690     echo "$ac_t""no" 1>&6
5691   fi
5692
5693     test -z "$with_xmu" && { 
5694 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5695 echo "configure:5696: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5696 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5697
5698 xe_check_libs=" -lXmu "
5699 cat > conftest.$ac_ext <<EOF
5700 #line 5701 "configure"
5701 #include "confdefs.h"
5702 /* Override any gcc2 internal prototype to avoid an error.  */
5703 /* We use char because int might match the return type of a gcc2
5704     builtin and then its argument prototype would still apply.  */
5705 char XmuReadBitmapDataFromFile();
5706
5707 int main() {
5708 XmuReadBitmapDataFromFile()
5709 ; return 0; }
5710 EOF
5711 if { (eval echo configure:5712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5712   rm -rf conftest*
5713   eval "ac_cv_lib_$ac_lib_var=yes"
5714 else
5715   echo "configure: failed program was:" >&5
5716   cat conftest.$ac_ext >&5
5717   rm -rf conftest*
5718   eval "ac_cv_lib_$ac_lib_var=no"
5719 fi
5720 rm -f conftest*
5721 xe_check_libs=""
5722
5723 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5724   echo "$ac_t""yes" 1>&6
5725   with_xmu=yes
5726 else
5727   echo "$ac_t""no" 1>&6
5728 with_xmu=no
5729 fi
5730
5731  }
5732   if test "$with_xmu" = "no"; then
5733     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5734    echo "    xemacs will be linked with \"xmu.o\""
5735  fi
5736   else
5737     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5738     { test "$extra_verbose" = "yes" && cat << \EOF
5739     Defining HAVE_XMU
5740 EOF
5741 cat >> confdefs.h <<\EOF
5742 #define HAVE_XMU 1
5743 EOF
5744 }
5745
5746   fi
5747
5748       
5749 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5750 echo "configure:5751: checking for main in -lXbsd" >&5
5751 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5752
5753 xe_check_libs=" -lXbsd "
5754 cat > conftest.$ac_ext <<EOF
5755 #line 5756 "configure"
5756 #include "confdefs.h"
5757
5758 int main() {
5759 main()
5760 ; return 0; }
5761 EOF
5762 if { (eval echo configure:5763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5763   rm -rf conftest*
5764   eval "ac_cv_lib_$ac_lib_var=yes"
5765 else
5766   echo "configure: failed program was:" >&5
5767   cat conftest.$ac_ext >&5
5768   rm -rf conftest*
5769   eval "ac_cv_lib_$ac_lib_var=no"
5770 fi
5771 rm -f conftest*
5772 xe_check_libs=""
5773
5774 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5775   echo "$ac_t""yes" 1>&6
5776   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5777 else
5778   echo "$ac_t""no" 1>&6
5779 fi
5780
5781
5782
5783     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5784         if test "$GCC" = "yes"; then
5785       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5786       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5787     else
5788       case "$CC" in
5789         "xlc" ) CC="xlc_r" ;;
5790         "xlC" ) CC="xlC_r" ;;
5791         "cc"  ) CC="cc_r" ;;
5792       esac
5793     fi
5794   fi
5795
5796 fi 
5797 if test "$with_msw" != "no"; then
5798   echo "checking for MS-Windows" 1>&6
5799 echo "configure:5800: checking for MS-Windows" >&5
5800   
5801 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5802 echo "configure:5803: checking for main in -lgdi32" >&5
5803 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5804
5805 xe_check_libs=" -lgdi32 "
5806 cat > conftest.$ac_ext <<EOF
5807 #line 5808 "configure"
5808 #include "confdefs.h"
5809
5810 int main() {
5811 main()
5812 ; return 0; }
5813 EOF
5814 if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5815   rm -rf conftest*
5816   eval "ac_cv_lib_$ac_lib_var=yes"
5817 else
5818   echo "configure: failed program was:" >&5
5819   cat conftest.$ac_ext >&5
5820   rm -rf conftest*
5821   eval "ac_cv_lib_$ac_lib_var=no"
5822 fi
5823 rm -f conftest*
5824 xe_check_libs=""
5825
5826 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5827   echo "$ac_t""yes" 1>&6
5828   with_msw=yes
5829 else
5830   echo "$ac_t""no" 1>&6
5831 fi
5832
5833
5834   if test "$with_msw" = "yes"; then
5835     { test "$extra_verbose" = "yes" && cat << \EOF
5836     Defining HAVE_MS_WINDOWS
5837 EOF
5838 cat >> confdefs.h <<\EOF
5839 #define HAVE_MS_WINDOWS 1
5840 EOF
5841 }
5842
5843     install_pp="$blddir/lib-src/installexe.sh"
5844     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
5845     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
5846     if test "$window_system" != x11; then
5847         window_system=msw
5848         test "$with_scrollbars" != "no" && with_scrollbars=msw \
5849             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5850    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5851  fi
5852         test "$with_menubars"   != "no" && with_menubars=msw \
5853             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5854    echo "    xemacs will be linked with \"menubar-msw.o\""
5855  fi
5856         test "$with_toolbars"   != "no" && with_toolbars=msw \
5857             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5858    echo "    xemacs will be linked with \"toolbar-msw.o\""
5859  fi
5860         test "$with_dialogs"   != "no" && with_dialogs=msw \
5861             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5862    echo "    xemacs will be linked with \"dialog-msw.o\""
5863  fi
5864     else
5865         test "$with_scrollbars"   != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5866    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5867  fi
5868         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5869    echo "    xemacs will be linked with \"menubar-msw.o\""
5870  fi
5871         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5872    echo "    xemacs will be linked with \"toolbar-msw.o\""
5873  fi
5874         test "$with_dialogs"   != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5875    echo "    xemacs will be linked with \"dialog-msw.o\""
5876  fi
5877     fi
5878         cat > conftest.$ac_ext <<EOF
5879 #line 5880 "configure"
5880 #include "confdefs.h"
5881 #include <fcntl.h>
5882     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
5883 EOF
5884 if { (eval echo configure:5885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5885 then
5886   { test "$extra_verbose" = "yes" && cat << \EOF
5887     Defining HAVE_MSG_SELECT
5888 EOF
5889 cat >> confdefs.h <<\EOF
5890 #define HAVE_MSG_SELECT 1
5891 EOF
5892 }
5893
5894 else
5895   conftest_rc="$?"
5896   echo "configure: failed program was:" >&5
5897   cat conftest.$ac_ext >&5
5898 fi
5899 rm -fr conftest*
5900     const_is_losing=no
5901     with_file_coding=yes
5902     use_minimal_tagbits=yes
5903     use_indexed_lrecord_implementation=yes
5904     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
5905    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\""
5906  fi
5907   fi
5908 fi
5909
5910
5911
5912 test -z "$window_system" && window_system="none"
5913
5914 if test "$window_system" = "none"; then
5915   for feature in menubars scrollbars toolbars dialogs dragndrop
5916   do
5917     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5918        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
5919     fi
5920     eval "with_${feature}=no"
5921   done
5922 else
5923   test -z "$with_toolbars" && with_toolbars=yes
5924 fi
5925
5926 if test "$with_msw" != "yes"; then
5927   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
5928   do
5929     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5930        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
5931     fi
5932     eval "with_${feature}=no"
5933   done
5934 else
5935   :
5936 fi
5937
5938 if test "$with_x11" != "yes"; then
5939             for feature in tooltalk cde offix session xim xmu \
5940                  xface
5941   do
5942     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5943        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
5944     fi
5945     eval "with_${feature}=no"
5946   done
5947 fi
5948
5949 bitmapdir=
5950
5951 case "$window_system" in
5952   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
5953   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
5954   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
5955 esac
5956
5957 case "$x_libraries" in *X11R4* )
5958   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
5959   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
5960 esac
5961
5962 echo "checking for session-management option" 1>&6
5963 echo "configure:5964: checking for session-management option" >&5;
5964 if test "$with_session" != "no"; then
5965   { test "$extra_verbose" = "yes" && cat << \EOF
5966     Defining HAVE_SESSION
5967 EOF
5968 cat >> confdefs.h <<\EOF
5969 #define HAVE_SESSION 1
5970 EOF
5971 }
5972
5973 fi
5974
5975 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
5976 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
5977 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
5978 echo "configure:5979: checking for X11/Xauth.h" >&5
5979
5980 cat > conftest.$ac_ext <<EOF
5981 #line 5982 "configure"
5982 #include "confdefs.h"
5983 #include <X11/Xauth.h>
5984 EOF
5985 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5986 { (eval echo configure:5987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5987 ac_err=`grep -v '^ *+' conftest.out`
5988 if test -z "$ac_err"; then
5989   rm -rf conftest*
5990   eval "ac_cv_header_$ac_safe=yes"
5991 else
5992   echo "$ac_err" >&5
5993   echo "configure: failed program was:" >&5
5994   cat conftest.$ac_ext >&5
5995   rm -rf conftest*
5996   eval "ac_cv_header_$ac_safe=no"
5997 fi
5998 rm -f conftest*
5999 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6000   echo "$ac_t""yes" 1>&6
6001   :
6002 else
6003   echo "$ac_t""no" 1>&6
6004 with_xauth=no
6005 fi
6006  }
6007 test -z "$with_xauth" && { 
6008 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6009 echo "configure:6010: checking for XauGetAuthByAddr in -lXau" >&5
6010 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6011
6012 xe_check_libs=" -lXau "
6013 cat > conftest.$ac_ext <<EOF
6014 #line 6015 "configure"
6015 #include "confdefs.h"
6016 /* Override any gcc2 internal prototype to avoid an error.  */
6017 /* We use char because int might match the return type of a gcc2
6018     builtin and then its argument prototype would still apply.  */
6019 char XauGetAuthByAddr();
6020
6021 int main() {
6022 XauGetAuthByAddr()
6023 ; return 0; }
6024 EOF
6025 if { (eval echo configure:6026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6026   rm -rf conftest*
6027   eval "ac_cv_lib_$ac_lib_var=yes"
6028 else
6029   echo "configure: failed program was:" >&5
6030   cat conftest.$ac_ext >&5
6031   rm -rf conftest*
6032   eval "ac_cv_lib_$ac_lib_var=no"
6033 fi
6034 rm -f conftest*
6035 xe_check_libs=""
6036
6037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6038   echo "$ac_t""yes" 1>&6
6039   :
6040 else
6041   echo "$ac_t""no" 1>&6
6042 with_xauth=no
6043 fi
6044
6045  }
6046 test -z "$with_xauth" && with_xauth=yes
6047 if test "$with_xauth" = "yes"; then
6048   { test "$extra_verbose" = "yes" && cat << \EOF
6049     Defining HAVE_XAUTH
6050 EOF
6051 cat >> confdefs.h <<\EOF
6052 #define HAVE_XAUTH 1
6053 EOF
6054 }
6055
6056   
6057 T=""
6058 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
6059 libs_xauth="$T"
6060
6061 fi
6062
6063
6064
6065
6066 if test "$with_tooltalk" != "no" ; then
6067       for dir in "" "Tt/" "desktop/" ; do
6068     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6069 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6070 echo "configure:6071: checking for ${dir}tt_c.h" >&5
6071
6072 cat > conftest.$ac_ext <<EOF
6073 #line 6074 "configure"
6074 #include "confdefs.h"
6075 #include <${dir}tt_c.h>
6076 EOF
6077 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6078 { (eval echo configure:6079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6079 ac_err=`grep -v '^ *+' conftest.out`
6080 if test -z "$ac_err"; then
6081   rm -rf conftest*
6082   eval "ac_cv_header_$ac_safe=yes"
6083 else
6084   echo "$ac_err" >&5
6085   echo "configure: failed program was:" >&5
6086   cat conftest.$ac_ext >&5
6087   rm -rf conftest*
6088   eval "ac_cv_header_$ac_safe=no"
6089 fi
6090 rm -f conftest*
6091 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6092   echo "$ac_t""yes" 1>&6
6093   tt_c_h_path="${dir}tt_c.h"; break
6094 else
6095   echo "$ac_t""no" 1>&6
6096 fi
6097
6098   done
6099   if test -z "$tt_c_h_path"; then
6100     if test "$with_tooltalk" = "yes"; then
6101       (echo "$progname: Usage error:"
6102 echo " " "Unable to find required tooltalk header files."
6103 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6104     fi
6105     with_tooltalk=no
6106   fi
6107 fi
6108 if test "$with_tooltalk" != "no" ; then
6109   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6110     
6111 xe_msg_checking="for tt_message_create in -ltt"
6112 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6113 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6114 echo "configure:6115: checking "$xe_msg_checking"" >&5
6115 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6116
6117 xe_check_libs=" -ltt $extra_libs"
6118 cat > conftest.$ac_ext <<EOF
6119 #line 6120 "configure"
6120 #include "confdefs.h"
6121 /* Override any gcc2 internal prototype to avoid an error.  */
6122 /* We use char because int might match the return type of a gcc2
6123     builtin and then its argument prototype would still apply.  */
6124 char tt_message_create();
6125
6126 int main() {
6127 tt_message_create()
6128 ; return 0; }
6129 EOF
6130 if { (eval echo configure:6131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6131   rm -rf conftest*
6132   eval "ac_cv_lib_$ac_lib_var=yes"
6133 else
6134   echo "configure: failed program was:" >&5
6135   cat conftest.$ac_ext >&5
6136   rm -rf conftest*
6137   eval "ac_cv_lib_$ac_lib_var=no"
6138 fi
6139 rm -f conftest*
6140 xe_check_libs=""
6141
6142 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6143   echo "$ac_t""yes" 1>&6
6144   tt_libs="-ltt $extra_libs"; break
6145 else
6146   echo "$ac_t""no" 1>&6
6147 :
6148 fi
6149
6150
6151   done
6152   if test -z "$tt_libs"; then
6153     if test "$with_tooltalk" = "yes"; then
6154       (echo "$progname: Usage error:"
6155 echo " " "Unable to find required tooltalk libraries."
6156 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6157     fi
6158     with_tooltalk=no
6159   fi
6160 fi
6161 test -z "$with_tooltalk" && with_tooltalk=yes
6162 if test "$with_tooltalk" = "yes"; then
6163   { test "$extra_verbose" = "yes" && cat << \EOF
6164     Defining TOOLTALK
6165 EOF
6166 cat >> confdefs.h <<\EOF
6167 #define TOOLTALK 1
6168 EOF
6169 }
6170
6171   { test "$extra_verbose" = "yes" && cat << EOF
6172     Defining TT_C_H_PATH = "$tt_c_h_path"
6173 EOF
6174 cat >> confdefs.h <<EOF
6175 #define TT_C_H_PATH "$tt_c_h_path"
6176 EOF
6177 }
6178
6179   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6180   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6181    echo "    xemacs will be linked with \"tooltalk.o\""
6182  fi
6183 fi
6184
6185 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6186 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6187 echo "configure:6188: checking for Dt/Dt.h" >&5
6188
6189 cat > conftest.$ac_ext <<EOF
6190 #line 6191 "configure"
6191 #include "confdefs.h"
6192 #include <Dt/Dt.h>
6193 EOF
6194 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6195 { (eval echo configure:6196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6196 ac_err=`grep -v '^ *+' conftest.out`
6197 if test -z "$ac_err"; then
6198   rm -rf conftest*
6199   eval "ac_cv_header_$ac_safe=yes"
6200 else
6201   echo "$ac_err" >&5
6202   echo "configure: failed program was:" >&5
6203   cat conftest.$ac_ext >&5
6204   rm -rf conftest*
6205   eval "ac_cv_header_$ac_safe=no"
6206 fi
6207 rm -f conftest*
6208 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6209   echo "$ac_t""yes" 1>&6
6210   :
6211 else
6212   echo "$ac_t""no" 1>&6
6213 with_cde=no
6214 fi
6215  }
6216 test -z "$with_cde" && { 
6217 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6218 echo "configure:6219: checking for DtDndDragStart in -lDtSvc" >&5
6219 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6220
6221 xe_check_libs=" -lDtSvc "
6222 cat > conftest.$ac_ext <<EOF
6223 #line 6224 "configure"
6224 #include "confdefs.h"
6225 /* Override any gcc2 internal prototype to avoid an error.  */
6226 /* We use char because int might match the return type of a gcc2
6227     builtin and then its argument prototype would still apply.  */
6228 char DtDndDragStart();
6229
6230 int main() {
6231 DtDndDragStart()
6232 ; return 0; }
6233 EOF
6234 if { (eval echo configure:6235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6235   rm -rf conftest*
6236   eval "ac_cv_lib_$ac_lib_var=yes"
6237 else
6238   echo "configure: failed program was:" >&5
6239   cat conftest.$ac_ext >&5
6240   rm -rf conftest*
6241   eval "ac_cv_lib_$ac_lib_var=no"
6242 fi
6243 rm -f conftest*
6244 xe_check_libs=""
6245
6246 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6247   echo "$ac_t""yes" 1>&6
6248   :
6249 else
6250   echo "$ac_t""no" 1>&6
6251 with_cde=no
6252 fi
6253
6254  }
6255 test -z "$with_cde" && with_cde=yes
6256 if test "$with_dragndrop" = no; then
6257   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6258   with_cde=no
6259 fi
6260 if test "$with_cde" = "yes" ; then
6261   { test "$extra_verbose" = "yes" && cat << \EOF
6262     Defining HAVE_CDE
6263 EOF
6264 cat >> confdefs.h <<\EOF
6265 #define HAVE_CDE 1
6266 EOF
6267 }
6268
6269   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6270   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6271   with_tooltalk=yes # CDE requires Tooltalk
6272   need_motif=yes    # CDE requires Motif
6273 fi
6274
6275 test "$window_system" != "x11" && with_offix=no
6276 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6277   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6278   with_offix=no
6279 fi
6280 if test "$with_dragndrop" = no; then
6281   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6282   with_offix=no
6283 fi
6284 if test "$with_cde" = yes; then
6285   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6286   with_offix=no
6287 fi
6288 test -z "$with_offix" && with_offix=no
6289 if test "$with_offix" = "yes"; then
6290   { test "$extra_verbose" = "yes" && cat << \EOF
6291     Defining HAVE_OFFIX_DND
6292 EOF
6293 cat >> confdefs.h <<\EOF
6294 #define HAVE_OFFIX_DND 1
6295 EOF
6296 }
6297
6298   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6299   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6300 fi
6301
6302 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6303 echo "configure:6304: checking if drag and drop API is needed" >&5
6304 if test "$with_dragndrop" != "no" ; then
6305   if test -n "$dragndrop_proto" ; then
6306     with_dragndrop=yes
6307     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6308     { test "$extra_verbose" = "yes" && cat << \EOF
6309     Defining HAVE_DRAGNDROP
6310 EOF
6311 cat >> confdefs.h <<\EOF
6312 #define HAVE_DRAGNDROP 1
6313 EOF
6314 }
6315
6316     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6317   else
6318     with_dragndrop=no
6319     echo "$ac_t""no" 1>&6
6320   fi
6321 fi
6322
6323 echo "checking for LDAP" 1>&6
6324 echo "configure:6325: checking for LDAP" >&5
6325 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6326 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6327 echo "configure:6328: checking for ldap.h" >&5
6328
6329 cat > conftest.$ac_ext <<EOF
6330 #line 6331 "configure"
6331 #include "confdefs.h"
6332 #include <ldap.h>
6333 EOF
6334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6335 { (eval echo configure:6336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6336 ac_err=`grep -v '^ *+' conftest.out`
6337 if test -z "$ac_err"; then
6338   rm -rf conftest*
6339   eval "ac_cv_header_$ac_safe=yes"
6340 else
6341   echo "$ac_err" >&5
6342   echo "configure: failed program was:" >&5
6343   cat conftest.$ac_ext >&5
6344   rm -rf conftest*
6345   eval "ac_cv_header_$ac_safe=no"
6346 fi
6347 rm -f conftest*
6348 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6349   echo "$ac_t""yes" 1>&6
6350   :
6351 else
6352   echo "$ac_t""no" 1>&6
6353 with_ldap=no
6354 fi
6355  }
6356 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6357 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6358 echo "configure:6359: checking for lber.h" >&5
6359
6360 cat > conftest.$ac_ext <<EOF
6361 #line 6362 "configure"
6362 #include "confdefs.h"
6363 #include <lber.h>
6364 EOF
6365 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6366 { (eval echo configure:6367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6367 ac_err=`grep -v '^ *+' conftest.out`
6368 if test -z "$ac_err"; then
6369   rm -rf conftest*
6370   eval "ac_cv_header_$ac_safe=yes"
6371 else
6372   echo "$ac_err" >&5
6373   echo "configure: failed program was:" >&5
6374   cat conftest.$ac_ext >&5
6375   rm -rf conftest*
6376   eval "ac_cv_header_$ac_safe=no"
6377 fi
6378 rm -f conftest*
6379 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6380   echo "$ac_t""yes" 1>&6
6381   :
6382 else
6383   echo "$ac_t""no" 1>&6
6384 with_ldap=no
6385 fi
6386  }
6387 if test "$with_ldap" != "no"; then
6388   test -z "$with_umich_ldap" && { 
6389 xe_msg_checking="for ldap_open in -lldap"
6390 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6391 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6392 echo "configure:6393: checking "$xe_msg_checking"" >&5
6393 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6394
6395 xe_check_libs=" -lldap -llber"
6396 cat > conftest.$ac_ext <<EOF
6397 #line 6398 "configure"
6398 #include "confdefs.h"
6399 /* Override any gcc2 internal prototype to avoid an error.  */
6400 /* We use char because int might match the return type of a gcc2
6401     builtin and then its argument prototype would still apply.  */
6402 char ldap_open();
6403
6404 int main() {
6405 ldap_open()
6406 ; return 0; }
6407 EOF
6408 if { (eval echo configure:6409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6409   rm -rf conftest*
6410   eval "ac_cv_lib_$ac_lib_var=yes"
6411 else
6412   echo "configure: failed program was:" >&5
6413   cat conftest.$ac_ext >&5
6414   rm -rf conftest*
6415   eval "ac_cv_lib_$ac_lib_var=no"
6416 fi
6417 rm -f conftest*
6418 xe_check_libs=""
6419
6420 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6421   echo "$ac_t""yes" 1>&6
6422   with_umich_ldap=yes
6423 else
6424   echo "$ac_t""no" 1>&6
6425 with_umich_ldap=no
6426 fi
6427
6428  }
6429   test "$with_umich_ldap" = "no" && { 
6430 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6431 echo "configure:6432: checking for ldap_set_option in -lldap10" >&5
6432 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6433
6434 xe_check_libs=" -lldap10 "
6435 cat > conftest.$ac_ext <<EOF
6436 #line 6437 "configure"
6437 #include "confdefs.h"
6438 /* Override any gcc2 internal prototype to avoid an error.  */
6439 /* We use char because int might match the return type of a gcc2
6440     builtin and then its argument prototype would still apply.  */
6441 char ldap_set_option();
6442
6443 int main() {
6444 ldap_set_option()
6445 ; return 0; }
6446 EOF
6447 if { (eval echo configure:6448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6448   rm -rf conftest*
6449   eval "ac_cv_lib_$ac_lib_var=yes"
6450 else
6451   echo "configure: failed program was:" >&5
6452   cat conftest.$ac_ext >&5
6453   rm -rf conftest*
6454   eval "ac_cv_lib_$ac_lib_var=no"
6455 fi
6456 rm -f conftest*
6457 xe_check_libs=""
6458
6459 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6460   echo "$ac_t""yes" 1>&6
6461   with_ns_ldap=yes
6462 else
6463   echo "$ac_t""no" 1>&6
6464 with_ns_ldap=no
6465 fi
6466
6467  }
6468   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6469 fi
6470 if test "$with_ldap" = "yes"; then
6471   { test "$extra_verbose" = "yes" && cat << \EOF
6472     Defining HAVE_LDAP
6473 EOF
6474 cat >> confdefs.h <<\EOF
6475 #define HAVE_LDAP 1
6476 EOF
6477 }
6478
6479   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6480    echo "    xemacs will be linked with \"eldap.o\""
6481  fi
6482   if test "$with_umich_ldap" = "yes" ; then
6483     { test "$extra_verbose" = "yes" && cat << \EOF
6484     Defining HAVE_UMICH_LDAP
6485 EOF
6486 cat >> confdefs.h <<\EOF
6487 #define HAVE_UMICH_LDAP 1
6488 EOF
6489 }
6490
6491     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6492     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6493   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6494     { test "$extra_verbose" = "yes" && cat << \EOF
6495     Defining HAVE_NS_LDAP
6496 EOF
6497 cat >> confdefs.h <<\EOF
6498 #define HAVE_NS_LDAP 1
6499 EOF
6500 }
6501
6502     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6503   elif test "$with_ldap" = "yes" ; then
6504     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6505   fi
6506 fi
6507
6508
6509 if test "$window_system" != "none"; then
6510   echo "checking for graphics libraries" 1>&6
6511 echo "configure:6512: checking for graphics libraries" >&5
6512
6513     xpm_problem=""
6514   if test -z "$with_xpm"; then
6515     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6516 echo "configure:6517: checking for Xpm - no older than 3.4f" >&5
6517     xe_check_libs=-lXpm
6518     cat > conftest.$ac_ext <<EOF
6519 #line 6520 "configure"
6520 #include "confdefs.h"
6521 #include <X11/xpm.h>
6522     int main(int c, char **v) {
6523     return c == 1 ? 0 :
6524       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6525       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6526 EOF
6527 if { (eval echo configure:6528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6528 then
6529   ./conftest dummy_arg; xpm_status=$?;
6530       if test "$xpm_status" = "0"; then
6531         with_xpm=yes;
6532       else
6533         with_xpm=no;
6534         if test "$xpm_status" = "1"; then
6535           xpm_problem="Xpm library version and header file version don't match!"
6536         elif test "$xpm_status" = "2"; then
6537           xpm_problem="Xpm library version is too old!"
6538         else
6539           xpm_problem="Internal xpm detection logic error!"
6540         fi
6541         echo "
6542 *** WARNING *** $xpm_problem
6543   I'm not touching that with a 10-foot pole!
6544   If you really want to use the installed version of Xpm, rerun
6545   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6546     fi
6547 else
6548   conftest_rc="$?"
6549   echo "configure: failed program was:" >&5
6550   cat conftest.$ac_ext >&5
6551   rm -fr conftest*
6552   with_xpm=no
6553 fi
6554 rm -fr conftest*
6555     xe_check_libs=
6556     echo "$ac_t""$with_xpm" 1>&6
6557   fi
6558   if test "$with_xpm" = "yes"; then
6559     { test "$extra_verbose" = "yes" && cat << \EOF
6560     Defining HAVE_XPM
6561 EOF
6562 cat >> confdefs.h <<\EOF
6563 #define HAVE_XPM 1
6564 EOF
6565 }
6566
6567     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6568     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6569 echo "configure:6570: checking for \"FOR_MSW\" xpm" >&5
6570     xe_check_libs=-lXpm
6571     cat > conftest.$ac_ext <<EOF
6572 #line 6573 "configure"
6573 #include "confdefs.h"
6574
6575 int main() {
6576 XpmCreatePixmapFromData()
6577 ; return 0; }
6578 EOF
6579 if { (eval echo configure:6580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6580   rm -rf conftest*
6581   xpm_for_msw=no
6582 else
6583   echo "configure: failed program was:" >&5
6584   cat conftest.$ac_ext >&5
6585   rm -rf conftest*
6586   xpm_for_msw=yes
6587 fi
6588 rm -f conftest*
6589     xe_check_libs=
6590     echo "$ac_t""$xpm_for_msw" 1>&6
6591     if test "$xpm_for_msw" = "yes"; then
6592       { test "$extra_verbose" = "yes" && cat << \EOF
6593     Defining FOR_MSW
6594 EOF
6595 cat >> confdefs.h <<\EOF
6596 #define FOR_MSW 1
6597 EOF
6598 }
6599
6600     fi
6601   fi
6602
6603         if test "$with_gif" != "no"; then
6604     with_gif="yes"
6605     { test "$extra_verbose" = "yes" && cat << \EOF
6606     Defining HAVE_GIF
6607 EOF
6608 cat >> confdefs.h <<\EOF
6609 #define HAVE_GIF 1
6610 EOF
6611 }
6612
6613     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6614    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6615  fi
6616   fi
6617
6618       if test "$with_png $with_tiff" != "no no"; then
6619     
6620 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6621 echo "configure:6622: checking for inflate in -lc" >&5
6622 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6623
6624 xe_check_libs=" -lc "
6625 cat > conftest.$ac_ext <<EOF
6626 #line 6627 "configure"
6627 #include "confdefs.h"
6628 /* Override any gcc2 internal prototype to avoid an error.  */
6629 /* We use char because int might match the return type of a gcc2
6630     builtin and then its argument prototype would still apply.  */
6631 char inflate();
6632
6633 int main() {
6634 inflate()
6635 ; return 0; }
6636 EOF
6637 if { (eval echo configure:6638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6638   rm -rf conftest*
6639   eval "ac_cv_lib_$ac_lib_var=yes"
6640 else
6641   echo "configure: failed program was:" >&5
6642   cat conftest.$ac_ext >&5
6643   rm -rf conftest*
6644   eval "ac_cv_lib_$ac_lib_var=no"
6645 fi
6646 rm -f conftest*
6647 xe_check_libs=""
6648
6649 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6650   echo "$ac_t""yes" 1>&6
6651   :
6652 else
6653   echo "$ac_t""no" 1>&6
6654
6655 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6656 echo "configure:6657: checking for inflate in -lz" >&5
6657 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6658
6659 xe_check_libs=" -lz "
6660 cat > conftest.$ac_ext <<EOF
6661 #line 6662 "configure"
6662 #include "confdefs.h"
6663 /* Override any gcc2 internal prototype to avoid an error.  */
6664 /* We use char because int might match the return type of a gcc2
6665     builtin and then its argument prototype would still apply.  */
6666 char inflate();
6667
6668 int main() {
6669 inflate()
6670 ; return 0; }
6671 EOF
6672 if { (eval echo configure:6673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6673   rm -rf conftest*
6674   eval "ac_cv_lib_$ac_lib_var=yes"
6675 else
6676   echo "configure: failed program was:" >&5
6677   cat conftest.$ac_ext >&5
6678   rm -rf conftest*
6679   eval "ac_cv_lib_$ac_lib_var=no"
6680 fi
6681 rm -f conftest*
6682 xe_check_libs=""
6683
6684 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6685   echo "$ac_t""yes" 1>&6
6686   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6687 else
6688   echo "$ac_t""no" 1>&6
6689
6690 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6691 echo "configure:6692: checking for inflate in -lgz" >&5
6692 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6693
6694 xe_check_libs=" -lgz "
6695 cat > conftest.$ac_ext <<EOF
6696 #line 6697 "configure"
6697 #include "confdefs.h"
6698 /* Override any gcc2 internal prototype to avoid an error.  */
6699 /* We use char because int might match the return type of a gcc2
6700     builtin and then its argument prototype would still apply.  */
6701 char inflate();
6702
6703 int main() {
6704 inflate()
6705 ; return 0; }
6706 EOF
6707 if { (eval echo configure:6708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6708   rm -rf conftest*
6709   eval "ac_cv_lib_$ac_lib_var=yes"
6710 else
6711   echo "configure: failed program was:" >&5
6712   cat conftest.$ac_ext >&5
6713   rm -rf conftest*
6714   eval "ac_cv_lib_$ac_lib_var=no"
6715 fi
6716 rm -f conftest*
6717 xe_check_libs=""
6718
6719 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6720   echo "$ac_t""yes" 1>&6
6721   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6722 else
6723   echo "$ac_t""no" 1>&6
6724 fi
6725
6726
6727 fi
6728
6729
6730 fi
6731
6732
6733   fi
6734
6735     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6736 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6737 echo "configure:6738: checking for jpeglib.h" >&5
6738
6739 cat > conftest.$ac_ext <<EOF
6740 #line 6741 "configure"
6741 #include "confdefs.h"
6742 #include <jpeglib.h>
6743 EOF
6744 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6745 { (eval echo configure:6746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6746 ac_err=`grep -v '^ *+' conftest.out`
6747 if test -z "$ac_err"; then
6748   rm -rf conftest*
6749   eval "ac_cv_header_$ac_safe=yes"
6750 else
6751   echo "$ac_err" >&5
6752   echo "configure: failed program was:" >&5
6753   cat conftest.$ac_ext >&5
6754   rm -rf conftest*
6755   eval "ac_cv_header_$ac_safe=no"
6756 fi
6757 rm -f conftest*
6758 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6759   echo "$ac_t""yes" 1>&6
6760   :
6761 else
6762   echo "$ac_t""no" 1>&6
6763 with_jpeg=no
6764 fi
6765  }
6766   test -z "$with_jpeg" && { 
6767 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
6768 echo "configure:6769: checking for jpeg_destroy_decompress in -ljpeg" >&5
6769 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
6770
6771 xe_check_libs=" -ljpeg "
6772 cat > conftest.$ac_ext <<EOF
6773 #line 6774 "configure"
6774 #include "confdefs.h"
6775 /* Override any gcc2 internal prototype to avoid an error.  */
6776 /* We use char because int might match the return type of a gcc2
6777     builtin and then its argument prototype would still apply.  */
6778 char jpeg_destroy_decompress();
6779
6780 int main() {
6781 jpeg_destroy_decompress()
6782 ; return 0; }
6783 EOF
6784 if { (eval echo configure:6785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6785   rm -rf conftest*
6786   eval "ac_cv_lib_$ac_lib_var=yes"
6787 else
6788   echo "configure: failed program was:" >&5
6789   cat conftest.$ac_ext >&5
6790   rm -rf conftest*
6791   eval "ac_cv_lib_$ac_lib_var=no"
6792 fi
6793 rm -f conftest*
6794 xe_check_libs=""
6795
6796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6797   echo "$ac_t""yes" 1>&6
6798   :
6799 else
6800   echo "$ac_t""no" 1>&6
6801 with_jpeg=no
6802 fi
6803
6804  }
6805   test -z "$with_jpeg" && with_jpeg=yes
6806   if test "$with_jpeg" = "yes"; then
6807     { test "$extra_verbose" = "yes" && cat << \EOF
6808     Defining HAVE_JPEG
6809 EOF
6810 cat >> confdefs.h <<\EOF
6811 #define HAVE_JPEG 1
6812 EOF
6813 }
6814
6815     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
6816   fi
6817
6818     png_problem=""
6819   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
6820 echo "configure:6821: checking for pow" >&5
6821
6822 cat > conftest.$ac_ext <<EOF
6823 #line 6824 "configure"
6824 #include "confdefs.h"
6825 /* System header to define __stub macros and hopefully few prototypes,
6826     which can conflict with char pow(); below.  */
6827 #include <assert.h>
6828 /* Override any gcc2 internal prototype to avoid an error.  */
6829 /* We use char because int might match the return type of a gcc2
6830     builtin and then its argument prototype would still apply.  */
6831 char pow();
6832
6833 int main() {
6834
6835 /* The GNU C library defines this for functions which it implements
6836     to always fail with ENOSYS.  Some functions are actually named
6837     something starting with __ and the normal name is an alias.  */
6838 #if defined (__stub_pow) || defined (__stub___pow)
6839 choke me
6840 #else
6841 pow();
6842 #endif
6843
6844 ; return 0; }
6845 EOF
6846 if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6847   rm -rf conftest*
6848   eval "ac_cv_func_pow=yes"
6849 else
6850   echo "configure: failed program was:" >&5
6851   cat conftest.$ac_ext >&5
6852   rm -rf conftest*
6853   eval "ac_cv_func_pow=no"
6854 fi
6855 rm -f conftest*
6856
6857 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
6858   echo "$ac_t""yes" 1>&6
6859   :
6860 else
6861   echo "$ac_t""no" 1>&6
6862 with_png=no
6863 fi
6864  }
6865   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
6866 echo $ac_n "checking for png.h""... $ac_c" 1>&6
6867 echo "configure:6868: checking for png.h" >&5
6868
6869 cat > conftest.$ac_ext <<EOF
6870 #line 6871 "configure"
6871 #include "confdefs.h"
6872 #include <png.h>
6873 EOF
6874 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6875 { (eval echo configure:6876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6876 ac_err=`grep -v '^ *+' conftest.out`
6877 if test -z "$ac_err"; then
6878   rm -rf conftest*
6879   eval "ac_cv_header_$ac_safe=yes"
6880 else
6881   echo "$ac_err" >&5
6882   echo "configure: failed program was:" >&5
6883   cat conftest.$ac_ext >&5
6884   rm -rf conftest*
6885   eval "ac_cv_header_$ac_safe=no"
6886 fi
6887 rm -f conftest*
6888 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6889   echo "$ac_t""yes" 1>&6
6890   :
6891 else
6892   echo "$ac_t""no" 1>&6
6893 with_png=no
6894 fi
6895  }
6896   test -z "$with_png" && { 
6897 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
6898 echo "configure:6899: checking for png_read_image in -lpng" >&5
6899 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
6900
6901 xe_check_libs=" -lpng "
6902 cat > conftest.$ac_ext <<EOF
6903 #line 6904 "configure"
6904 #include "confdefs.h"
6905 /* Override any gcc2 internal prototype to avoid an error.  */
6906 /* We use char because int might match the return type of a gcc2
6907     builtin and then its argument prototype would still apply.  */
6908 char png_read_image();
6909
6910 int main() {
6911 png_read_image()
6912 ; return 0; }
6913 EOF
6914 if { (eval echo configure:6915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6915   rm -rf conftest*
6916   eval "ac_cv_lib_$ac_lib_var=yes"
6917 else
6918   echo "configure: failed program was:" >&5
6919   cat conftest.$ac_ext >&5
6920   rm -rf conftest*
6921   eval "ac_cv_lib_$ac_lib_var=no"
6922 fi
6923 rm -f conftest*
6924 xe_check_libs=""
6925
6926 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6927   echo "$ac_t""yes" 1>&6
6928   :
6929 else
6930   echo "$ac_t""no" 1>&6
6931 with_png=no
6932 fi
6933
6934  }
6935   if test -z "$with_png"; then
6936     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
6937 echo "configure:6938: checking for workable png version information" >&5
6938     xe_check_libs="-lpng -lz"
6939     cat > conftest.$ac_ext <<EOF
6940 #line 6941 "configure"
6941 #include "confdefs.h"
6942 #include <png.h>
6943     int main(int c, char **v) {
6944     if (c == 1) return 0;
6945     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
6946     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
6947 EOF
6948 if { (eval echo configure:6949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6949 then
6950   ./conftest dummy_arg; png_status=$?;
6951       if test "$png_status" = "0"; then
6952         with_png=yes;
6953       else
6954         with_png=no;
6955         if test "$png_status" = "1"; then
6956           png_problem="PNG library version and header file don't match!"
6957         elif test "$png_status" = "2"; then
6958           png_problem="PNG library version too old (pre 1.0.2)!"
6959         fi
6960         echo "
6961 *** WARNING *** $png_problem
6962   I'm not touching that with a 10-foot pole!
6963   If you really want to use the installed version of libPNG, rerun
6964   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
6965     fi
6966 else
6967   conftest_rc="$?"
6968   echo "configure: failed program was:" >&5
6969   cat conftest.$ac_ext >&5
6970   rm -fr conftest*
6971   with_png=no
6972 fi
6973 rm -fr conftest*
6974     xe_check_libs=
6975     echo "$ac_t""$with_png" 1>&6
6976   fi
6977   if test "$with_png" = "yes"; then
6978     { test "$extra_verbose" = "yes" && cat << \EOF
6979     Defining HAVE_PNG
6980 EOF
6981 cat >> confdefs.h <<\EOF
6982 #define HAVE_PNG 1
6983 EOF
6984 }
6985
6986     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
6987   fi
6988
6989     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
6990 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
6991 echo "configure:6992: checking for tiffio.h" >&5
6992
6993 cat > conftest.$ac_ext <<EOF
6994 #line 6995 "configure"
6995 #include "confdefs.h"
6996 #include <tiffio.h>
6997 EOF
6998 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6999 { (eval echo configure:7000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7000 ac_err=`grep -v '^ *+' conftest.out`
7001 if test -z "$ac_err"; then
7002   rm -rf conftest*
7003   eval "ac_cv_header_$ac_safe=yes"
7004 else
7005   echo "$ac_err" >&5
7006   echo "configure: failed program was:" >&5
7007   cat conftest.$ac_ext >&5
7008   rm -rf conftest*
7009   eval "ac_cv_header_$ac_safe=no"
7010 fi
7011 rm -f conftest*
7012 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7013   echo "$ac_t""yes" 1>&6
7014   :
7015 else
7016   echo "$ac_t""no" 1>&6
7017 with_tiff=no
7018 fi
7019  }
7020   test -z "$with_tiff" && { 
7021 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7022 echo "configure:7023: checking for TIFFClientOpen in -ltiff" >&5
7023 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7024
7025 xe_check_libs=" -ltiff "
7026 cat > conftest.$ac_ext <<EOF
7027 #line 7028 "configure"
7028 #include "confdefs.h"
7029 /* Override any gcc2 internal prototype to avoid an error.  */
7030 /* We use char because int might match the return type of a gcc2
7031     builtin and then its argument prototype would still apply.  */
7032 char TIFFClientOpen();
7033
7034 int main() {
7035 TIFFClientOpen()
7036 ; return 0; }
7037 EOF
7038 if { (eval echo configure:7039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7039   rm -rf conftest*
7040   eval "ac_cv_lib_$ac_lib_var=yes"
7041 else
7042   echo "configure: failed program was:" >&5
7043   cat conftest.$ac_ext >&5
7044   rm -rf conftest*
7045   eval "ac_cv_lib_$ac_lib_var=no"
7046 fi
7047 rm -f conftest*
7048 xe_check_libs=""
7049
7050 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7051   echo "$ac_t""yes" 1>&6
7052   :
7053 else
7054   echo "$ac_t""no" 1>&6
7055 with_tiff=no
7056 fi
7057
7058  }
7059   test -z "$with_tiff" && with_tiff=yes
7060   if test "$with_tiff" = "yes"; then
7061     { test "$extra_verbose" = "yes" && cat << \EOF
7062     Defining HAVE_TIFF
7063 EOF
7064 cat >> confdefs.h <<\EOF
7065 #define HAVE_TIFF 1
7066 EOF
7067 }
7068
7069     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7070   fi
7071 fi
7072
7073
7074 if test "$with_x11" = "yes"; then
7075
7076   echo "checking for X11 graphics libraries" 1>&6
7077 echo "configure:7078: checking for X11 graphics libraries" >&5
7078
7079     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
7080 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
7081 echo "configure:7082: checking for compface.h" >&5
7082
7083 cat > conftest.$ac_ext <<EOF
7084 #line 7085 "configure"
7085 #include "confdefs.h"
7086 #include <compface.h>
7087 EOF
7088 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7089 { (eval echo configure:7090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7090 ac_err=`grep -v '^ *+' conftest.out`
7091 if test -z "$ac_err"; then
7092   rm -rf conftest*
7093   eval "ac_cv_header_$ac_safe=yes"
7094 else
7095   echo "$ac_err" >&5
7096   echo "configure: failed program was:" >&5
7097   cat conftest.$ac_ext >&5
7098   rm -rf conftest*
7099   eval "ac_cv_header_$ac_safe=no"
7100 fi
7101 rm -f conftest*
7102 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7103   echo "$ac_t""yes" 1>&6
7104   :
7105 else
7106   echo "$ac_t""no" 1>&6
7107 with_xface=no
7108 fi
7109  }
7110   test -z "$with_xface" && { 
7111 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
7112 echo "configure:7113: checking for UnGenFace in -lcompface" >&5
7113 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
7114
7115 xe_check_libs=" -lcompface "
7116 cat > conftest.$ac_ext <<EOF
7117 #line 7118 "configure"
7118 #include "confdefs.h"
7119 /* Override any gcc2 internal prototype to avoid an error.  */
7120 /* We use char because int might match the return type of a gcc2
7121     builtin and then its argument prototype would still apply.  */
7122 char UnGenFace();
7123
7124 int main() {
7125 UnGenFace()
7126 ; return 0; }
7127 EOF
7128 if { (eval echo configure:7129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7129   rm -rf conftest*
7130   eval "ac_cv_lib_$ac_lib_var=yes"
7131 else
7132   echo "configure: failed program was:" >&5
7133   cat conftest.$ac_ext >&5
7134   rm -rf conftest*
7135   eval "ac_cv_lib_$ac_lib_var=no"
7136 fi
7137 rm -f conftest*
7138 xe_check_libs=""
7139
7140 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7141   echo "$ac_t""yes" 1>&6
7142   : 
7143 else
7144   echo "$ac_t""no" 1>&6
7145 with_xface=no
7146 fi
7147
7148  }
7149   test -z "$with_xface" && with_xface=yes
7150   if test "$with_xface" = "yes"; then
7151     { test "$extra_verbose" = "yes" && cat << \EOF
7152     Defining HAVE_XFACE
7153 EOF
7154 cat >> confdefs.h <<\EOF
7155 #define HAVE_XFACE 1
7156 EOF
7157 }
7158
7159     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7160   fi
7161
7162     
7163 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7164 echo "configure:7165: checking for XawScrollbarSetThumb in -lXaw" >&5
7165 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7166
7167 xe_check_libs=" -lXaw "
7168 cat > conftest.$ac_ext <<EOF
7169 #line 7170 "configure"
7170 #include "confdefs.h"
7171 /* Override any gcc2 internal prototype to avoid an error.  */
7172 /* We use char because int might match the return type of a gcc2
7173     builtin and then its argument prototype would still apply.  */
7174 char XawScrollbarSetThumb();
7175
7176 int main() {
7177 XawScrollbarSetThumb()
7178 ; return 0; }
7179 EOF
7180 if { (eval echo configure:7181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7181   rm -rf conftest*
7182   eval "ac_cv_lib_$ac_lib_var=yes"
7183 else
7184   echo "configure: failed program was:" >&5
7185   cat conftest.$ac_ext >&5
7186   rm -rf conftest*
7187   eval "ac_cv_lib_$ac_lib_var=no"
7188 fi
7189 rm -f conftest*
7190 xe_check_libs=""
7191
7192 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7193   echo "$ac_t""yes" 1>&6
7194   have_xaw=yes
7195 else
7196   echo "$ac_t""no" 1>&6
7197 have_xaw=no
7198 fi
7199
7200
7201                     
7202     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7203 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7204 echo "configure:7205: checking for Xm/Xm.h" >&5
7205
7206 cat > conftest.$ac_ext <<EOF
7207 #line 7208 "configure"
7208 #include "confdefs.h"
7209 #include <Xm/Xm.h>
7210 EOF
7211 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7212 { (eval echo configure:7213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7213 ac_err=`grep -v '^ *+' conftest.out`
7214 if test -z "$ac_err"; then
7215   rm -rf conftest*
7216   eval "ac_cv_header_$ac_safe=yes"
7217 else
7218   echo "$ac_err" >&5
7219   echo "configure: failed program was:" >&5
7220   cat conftest.$ac_ext >&5
7221   rm -rf conftest*
7222   eval "ac_cv_header_$ac_safe=no"
7223 fi
7224 rm -f conftest*
7225 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7226   echo "$ac_t""yes" 1>&6
7227   
7228 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7229 echo "configure:7230: checking for XmStringFree in -lXm" >&5
7230 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7231
7232 xe_check_libs=" -lXm "
7233 cat > conftest.$ac_ext <<EOF
7234 #line 7235 "configure"
7235 #include "confdefs.h"
7236 /* Override any gcc2 internal prototype to avoid an error.  */
7237 /* We use char because int might match the return type of a gcc2
7238     builtin and then its argument prototype would still apply.  */
7239 char XmStringFree();
7240
7241 int main() {
7242 XmStringFree()
7243 ; return 0; }
7244 EOF
7245 if { (eval echo configure:7246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7246   rm -rf conftest*
7247   eval "ac_cv_lib_$ac_lib_var=yes"
7248 else
7249   echo "configure: failed program was:" >&5
7250   cat conftest.$ac_ext >&5
7251   rm -rf conftest*
7252   eval "ac_cv_lib_$ac_lib_var=no"
7253 fi
7254 rm -f conftest*
7255 xe_check_libs=""
7256
7257 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7258   echo "$ac_t""yes" 1>&6
7259   have_motif=yes
7260 else
7261   echo "$ac_t""no" 1>&6
7262 have_motif=no
7263 fi
7264
7265
7266 else
7267   echo "$ac_t""no" 1>&6
7268 have_motif=no
7269 fi
7270
7271
7272   if test "$have_motif" = "yes"; then
7273         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7274 echo "configure:7275: checking for Lesstif" >&5
7275     cat > conftest.$ac_ext <<EOF
7276 #line 7277 "configure"
7277 #include "confdefs.h"
7278 #include <Xm/Xm.h>
7279 #ifdef LESSTIF_VERSION
7280 yes
7281 #endif
7282
7283 EOF
7284 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7285   egrep "yes" >/dev/null 2>&1; then
7286   rm -rf conftest*
7287   have_lesstif=yes
7288 else
7289   rm -rf conftest*
7290   have_lesstif=no
7291 fi
7292 rm -f conftest*
7293
7294   echo "$ac_t""$have_lesstif" 1>&6
7295   fi
7296
7297 fi 
7298
7299 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7300   with_menubars="lucid" ;;
7301 esac
7302 case "$with_dialogs" in "" | "yes" | "lucid" )
7303   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7304   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7305   else with_dialogs=no
7306   fi ;;
7307 esac
7308 case "$with_scrollbars" in "" | "yes" )
7309   with_scrollbars="lucid" ;;
7310 esac
7311
7312 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7313
7314 case "$all_widgets" in *athena* )
7315   { test "$extra_verbose" = "yes" && cat << \EOF
7316     Defining LWLIB_USES_ATHENA
7317 EOF
7318 cat >> confdefs.h <<\EOF
7319 #define LWLIB_USES_ATHENA 1
7320 EOF
7321 }
7322
7323   { test "$extra_verbose" = "yes" && cat << \EOF
7324     Defining NEED_ATHENA
7325 EOF
7326 cat >> confdefs.h <<\EOF
7327 #define NEED_ATHENA 1
7328 EOF
7329 }
7330
7331   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7332   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7333 esac
7334
7335 case "$all_widgets" in *motif* )
7336   { test "$extra_verbose" = "yes" && cat << \EOF
7337     Defining LWLIB_USES_MOTIF
7338 EOF
7339 cat >> confdefs.h <<\EOF
7340 #define LWLIB_USES_MOTIF 1
7341 EOF
7342 }
7343
7344   { test "$extra_verbose" = "yes" && cat << \EOF
7345     Defining NEED_MOTIF
7346 EOF
7347 cat >> confdefs.h <<\EOF
7348 #define NEED_MOTIF 1
7349 EOF
7350 }
7351
7352   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7353   need_motif=yes ;;
7354 esac
7355
7356 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7357 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7358 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7359 case "$all_widgets" in *lucid* )
7360   { test "$extra_verbose" = "yes" && cat << \EOF
7361     Defining NEED_LUCID
7362 EOF
7363 cat >> confdefs.h <<\EOF
7364 #define NEED_LUCID 1
7365 EOF
7366 }
7367
7368   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7369 esac
7370
7371
7372
7373 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7374     Defining LWLIB_SCROLLBARS_ATHENA
7375 EOF
7376 cat >> confdefs.h <<\EOF
7377 #define LWLIB_SCROLLBARS_ATHENA 1
7378 EOF
7379 }
7380 ;; esac
7381 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7382     Defining LWLIB_DIALOGS_ATHENA
7383 EOF
7384 cat >> confdefs.h <<\EOF
7385 #define LWLIB_DIALOGS_ATHENA 1
7386 EOF
7387 }
7388    ;; esac
7389 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7390     Defining LWLIB_SCROLLBARS_ATHENA3D
7391 EOF
7392 cat >> confdefs.h <<\EOF
7393 #define LWLIB_SCROLLBARS_ATHENA3D 1
7394 EOF
7395 }
7396
7397 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7398     Defining LWLIB_DIALOGS_ATHENA3D
7399 EOF
7400 cat >> confdefs.h <<\EOF
7401 #define LWLIB_DIALOGS_ATHENA3D 1
7402 EOF
7403 }
7404
7405
7406 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7407     Defining HAVE_MENUBARS
7408 EOF
7409 cat >> confdefs.h <<\EOF
7410 #define HAVE_MENUBARS 1
7411 EOF
7412 }
7413
7414 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7415     Defining HAVE_SCROLLBARS
7416 EOF
7417 cat >> confdefs.h <<\EOF
7418 #define HAVE_SCROLLBARS 1
7419 EOF
7420 }
7421
7422 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7423     Defining HAVE_DIALOGS
7424 EOF
7425 cat >> confdefs.h <<\EOF
7426 #define HAVE_DIALOGS 1
7427 EOF
7428 }
7429
7430 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7431     Defining HAVE_TOOLBARS
7432 EOF
7433 cat >> confdefs.h <<\EOF
7434 #define HAVE_TOOLBARS 1
7435 EOF
7436 }
7437
7438
7439 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7440     Defining LWLIB_MENUBARS_LUCID
7441 EOF
7442 cat >> confdefs.h <<\EOF
7443 #define LWLIB_MENUBARS_LUCID 1
7444 EOF
7445 }
7446
7447 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7448     Defining LWLIB_SCROLLBARS_LUCID
7449 EOF
7450 cat >> confdefs.h <<\EOF
7451 #define LWLIB_SCROLLBARS_LUCID 1
7452 EOF
7453 }
7454
7455
7456 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7457     Defining LWLIB_MENUBARS_MOTIF
7458 EOF
7459 cat >> confdefs.h <<\EOF
7460 #define LWLIB_MENUBARS_MOTIF 1
7461 EOF
7462 }
7463
7464 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7465     Defining LWLIB_SCROLLBARS_MOTIF
7466 EOF
7467 cat >> confdefs.h <<\EOF
7468 #define LWLIB_SCROLLBARS_MOTIF 1
7469 EOF
7470 }
7471
7472 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7473     Defining LWLIB_DIALOGS_MOTIF
7474 EOF
7475 cat >> confdefs.h <<\EOF
7476 #define LWLIB_DIALOGS_MOTIF 1
7477 EOF
7478 }
7479
7480
7481 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7482    echo "    xemacs will be linked with \"menubar.o\""
7483  fi
7484 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7485    echo "    xemacs will be linked with \"scrollbar.o\""
7486  fi
7487 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7488    echo "    xemacs will be linked with \"dialog.o\""
7489  fi
7490 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7491    echo "    xemacs will be linked with \"toolbar.o\""
7492  fi
7493 test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" &&  if test "$extra_verbose" = "yes"; then
7494    echo "    xemacs will be linked with \"gui.o\""
7495  fi
7496
7497 if test "$with_x11" = "yes"; then
7498   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7499    echo "    xemacs will be linked with \"menubar-x.o\""
7500  fi
7501   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7502    echo "    xemacs will be linked with \"scrollbar-x.o\""
7503  fi
7504   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7505    echo "    xemacs will be linked with \"dialog-x.o\""
7506  fi
7507   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7508    echo "    xemacs will be linked with \"toolbar-x.o\""
7509  fi
7510   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7511    echo "    xemacs will be linked with \"gui-x.o\""
7512  fi
7513 else
7514   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7515     echo "Attempt to Build NAS sound without X"
7516     echo "Please remove NAS configuration or build with X"
7517     exit 1
7518   fi
7519 fi
7520
7521 test "$use_minimal_tagbits" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
7522     Defining USE_MINIMAL_TAGBITS
7523 EOF
7524 cat >> confdefs.h <<\EOF
7525 #define USE_MINIMAL_TAGBITS 1
7526 EOF
7527 }
7528
7529 test "$use_indexed_lrecord_implementation" = "yes" && \
7530   { test "$extra_verbose" = "yes" && cat << \EOF
7531     Defining USE_INDEXED_LRECORD_IMPLEMENTATION
7532 EOF
7533 cat >> confdefs.h <<\EOF
7534 #define USE_INDEXED_LRECORD_IMPLEMENTATION 1
7535 EOF
7536 }
7537
7538
7539
7540 test -z "$with_mule" && with_mule=no
7541 test -z "$with_file_coding" && with_file_coding=no
7542
7543
7544 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7545   { test "$extra_verbose" = "yes" && cat << \EOF
7546     Defining FILE_CODING
7547 EOF
7548 cat >> confdefs.h <<\EOF
7549 #define FILE_CODING 1
7550 EOF
7551 }
7552
7553   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7554    echo "    xemacs will be linked with \"file-coding.o\""
7555  fi
7556 fi
7557
7558 if test "$with_mule" = "yes" ; then
7559   echo "checking for Mule-related features" 1>&6
7560 echo "configure:7561: checking for Mule-related features" >&5
7561   { test "$extra_verbose" = "yes" && cat << \EOF
7562     Defining MULE
7563 EOF
7564 cat >> confdefs.h <<\EOF
7565 #define MULE 1
7566 EOF
7567 }
7568
7569   { test "$extra_verbose" = "yes" && cat << \EOF
7570     Defining FILE_CODING
7571 EOF
7572 cat >> confdefs.h <<\EOF
7573 #define FILE_CODING 1
7574 EOF
7575 }
7576
7577   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7578    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o mule-coding.o file-coding.o\""
7579  fi
7580
7581     for ac_hdr in libintl.h
7582 do
7583 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7584 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7585 echo "configure:7586: checking for $ac_hdr" >&5
7586
7587 cat > conftest.$ac_ext <<EOF
7588 #line 7589 "configure"
7589 #include "confdefs.h"
7590 #include <$ac_hdr>
7591 EOF
7592 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7593 { (eval echo configure:7594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7594 ac_err=`grep -v '^ *+' conftest.out`
7595 if test -z "$ac_err"; then
7596   rm -rf conftest*
7597   eval "ac_cv_header_$ac_safe=yes"
7598 else
7599   echo "$ac_err" >&5
7600   echo "configure: failed program was:" >&5
7601   cat conftest.$ac_ext >&5
7602   rm -rf conftest*
7603   eval "ac_cv_header_$ac_safe=no"
7604 fi
7605 rm -f conftest*
7606 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7607   echo "$ac_t""yes" 1>&6
7608     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7609   { test "$extra_verbose" = "yes" && cat << EOF
7610     Defining $ac_tr_hdr
7611 EOF
7612 cat >> confdefs.h <<EOF
7613 #define $ac_tr_hdr 1
7614 EOF
7615 }
7616  
7617 else
7618   echo "$ac_t""no" 1>&6
7619 fi
7620 done
7621
7622   
7623 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7624 echo "configure:7625: checking for strerror in -lintl" >&5
7625 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7626
7627 xe_check_libs=" -lintl "
7628 cat > conftest.$ac_ext <<EOF
7629 #line 7630 "configure"
7630 #include "confdefs.h"
7631 /* Override any gcc2 internal prototype to avoid an error.  */
7632 /* We use char because int might match the return type of a gcc2
7633     builtin and then its argument prototype would still apply.  */
7634 char strerror();
7635
7636 int main() {
7637 strerror()
7638 ; return 0; }
7639 EOF
7640 if { (eval echo configure:7641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7641   rm -rf conftest*
7642   eval "ac_cv_lib_$ac_lib_var=yes"
7643 else
7644   echo "configure: failed program was:" >&5
7645   cat conftest.$ac_ext >&5
7646   rm -rf conftest*
7647   eval "ac_cv_lib_$ac_lib_var=no"
7648 fi
7649 rm -f conftest*
7650 xe_check_libs=""
7651
7652 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7653   echo "$ac_t""yes" 1>&6
7654     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7655     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7656   { test "$extra_verbose" = "yes" && cat << EOF
7657     Defining $ac_tr_lib
7658 EOF
7659 cat >> confdefs.h <<EOF
7660 #define $ac_tr_lib 1
7661 EOF
7662 }
7663
7664   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7665
7666 else
7667   echo "$ac_t""no" 1>&6
7668 fi
7669
7670
7671
7672   echo "checking for Mule input methods" 1>&6
7673 echo "configure:7674: checking for Mule input methods" >&5
7674         case "$with_xim" in "" | "yes" )
7675     echo "checking for XIM" 1>&6
7676 echo "configure:7677: checking for XIM" >&5
7677         if test "$have_lesstif" = "yes"; then with_xim=xlib
7678     else 
7679 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7680 echo "configure:7681: checking for XmImMbLookupString in -lXm" >&5
7681 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7682
7683 xe_check_libs=" -lXm "
7684 cat > conftest.$ac_ext <<EOF
7685 #line 7686 "configure"
7686 #include "confdefs.h"
7687 /* Override any gcc2 internal prototype to avoid an error.  */
7688 /* We use char because int might match the return type of a gcc2
7689     builtin and then its argument prototype would still apply.  */
7690 char XmImMbLookupString();
7691
7692 int main() {
7693 XmImMbLookupString()
7694 ; return 0; }
7695 EOF
7696 if { (eval echo configure:7697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7697   rm -rf conftest*
7698   eval "ac_cv_lib_$ac_lib_var=yes"
7699 else
7700   echo "configure: failed program was:" >&5
7701   cat conftest.$ac_ext >&5
7702   rm -rf conftest*
7703   eval "ac_cv_lib_$ac_lib_var=no"
7704 fi
7705 rm -f conftest*
7706 xe_check_libs=""
7707
7708 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7709   echo "$ac_t""yes" 1>&6
7710   with_xim=motif
7711 else
7712   echo "$ac_t""no" 1>&6
7713 with_xim=xlib
7714 fi
7715
7716
7717     fi
7718   esac
7719   if test "$with_xim" != "no"; then
7720     { test "$extra_verbose" = "yes" && cat << \EOF
7721     Defining HAVE_XIM
7722 EOF
7723 cat >> confdefs.h <<\EOF
7724 #define HAVE_XIM 1
7725 EOF
7726 }
7727
7728     if test "$with_xim" = "xlib"; then
7729       { test "$extra_verbose" = "yes" && cat << \EOF
7730     Defining XIM_XLIB
7731 EOF
7732 cat >> confdefs.h <<\EOF
7733 #define XIM_XLIB 1
7734 EOF
7735 }
7736
7737       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7738    echo "    xemacs will be linked with \"input-method-xlib.o\""
7739  fi
7740     fi
7741     if test "$with_xim" = "motif"; then
7742       { test "$extra_verbose" = "yes" && cat << \EOF
7743     Defining XIM_MOTIF
7744 EOF
7745 cat >> confdefs.h <<\EOF
7746 #define XIM_MOTIF 1
7747 EOF
7748 }
7749
7750       need_motif=yes
7751       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7752    echo "    xemacs will be linked with \"input-method-motif.o\""
7753  fi
7754     fi
7755     if test "$with_xim" = "motif"; then
7756       with_xfs=no
7757     fi
7758   fi
7759
7760     if test "$with_xfs" = "yes" ; then
7761     echo "checking for XFontSet" 1>&6
7762 echo "configure:7763: checking for XFontSet" >&5
7763     
7764 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7765 echo "configure:7766: checking for XmbDrawString in -lX11" >&5
7766 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7767
7768 xe_check_libs=" -lX11 "
7769 cat > conftest.$ac_ext <<EOF
7770 #line 7771 "configure"
7771 #include "confdefs.h"
7772 /* Override any gcc2 internal prototype to avoid an error.  */
7773 /* We use char because int might match the return type of a gcc2
7774     builtin and then its argument prototype would still apply.  */
7775 char XmbDrawString();
7776
7777 int main() {
7778 XmbDrawString()
7779 ; return 0; }
7780 EOF
7781 if { (eval echo configure:7782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7782   rm -rf conftest*
7783   eval "ac_cv_lib_$ac_lib_var=yes"
7784 else
7785   echo "configure: failed program was:" >&5
7786   cat conftest.$ac_ext >&5
7787   rm -rf conftest*
7788   eval "ac_cv_lib_$ac_lib_var=no"
7789 fi
7790 rm -f conftest*
7791 xe_check_libs=""
7792
7793 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7794   echo "$ac_t""yes" 1>&6
7795   :
7796 else
7797   echo "$ac_t""no" 1>&6
7798 with_xfs=no
7799 fi
7800
7801
7802     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7803       { test "$extra_verbose" = "yes" && cat << \EOF
7804     Defining USE_XFONTSET
7805 EOF
7806 cat >> confdefs.h <<\EOF
7807 #define USE_XFONTSET 1
7808 EOF
7809 }
7810
7811       if test "$with_xim" = "no" ; then
7812         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
7813    echo "    xemacs will be linked with \"input-method-xfs.o\""
7814  fi
7815       fi
7816     fi
7817   fi 
7818     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
7819   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
7820 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
7821 echo "configure:7822: checking for wnn/jllib.h" >&5
7822
7823 cat > conftest.$ac_ext <<EOF
7824 #line 7825 "configure"
7825 #include "confdefs.h"
7826 #include <wnn/jllib.h>
7827 EOF
7828 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7829 { (eval echo configure:7830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7830 ac_err=`grep -v '^ *+' conftest.out`
7831 if test -z "$ac_err"; then
7832   rm -rf conftest*
7833   eval "ac_cv_header_$ac_safe=yes"
7834 else
7835   echo "$ac_err" >&5
7836   echo "configure: failed program was:" >&5
7837   cat conftest.$ac_ext >&5
7838   rm -rf conftest*
7839   eval "ac_cv_header_$ac_safe=no"
7840 fi
7841 rm -f conftest*
7842 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7843   echo "$ac_t""yes" 1>&6
7844   :
7845 else
7846   echo "$ac_t""no" 1>&6
7847 with_wnn=no
7848 fi
7849  }
7850     if test "$with_wnn" != "no"; then
7851     for ac_func in crypt
7852 do
7853 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7854 echo "configure:7855: checking for $ac_func" >&5
7855
7856 cat > conftest.$ac_ext <<EOF
7857 #line 7858 "configure"
7858 #include "confdefs.h"
7859 /* System header to define __stub macros and hopefully few prototypes,
7860     which can conflict with char $ac_func(); below.  */
7861 #include <assert.h>
7862 /* Override any gcc2 internal prototype to avoid an error.  */
7863 /* We use char because int might match the return type of a gcc2
7864     builtin and then its argument prototype would still apply.  */
7865 char $ac_func();
7866
7867 int main() {
7868
7869 /* The GNU C library defines this for functions which it implements
7870     to always fail with ENOSYS.  Some functions are actually named
7871     something starting with __ and the normal name is an alias.  */
7872 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7873 choke me
7874 #else
7875 $ac_func();
7876 #endif
7877
7878 ; return 0; }
7879 EOF
7880 if { (eval echo configure:7881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7881   rm -rf conftest*
7882   eval "ac_cv_func_$ac_func=yes"
7883 else
7884   echo "configure: failed program was:" >&5
7885   cat conftest.$ac_ext >&5
7886   rm -rf conftest*
7887   eval "ac_cv_func_$ac_func=no"
7888 fi
7889 rm -f conftest*
7890
7891 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7892   echo "$ac_t""yes" 1>&6
7893     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7894   { test "$extra_verbose" = "yes" && cat << EOF
7895     Defining $ac_tr_func
7896 EOF
7897 cat >> confdefs.h <<EOF
7898 #define $ac_tr_func 1
7899 EOF
7900 }
7901  
7902 else
7903   echo "$ac_t""no" 1>&6
7904 fi
7905 done
7906
7907     test "$ac_cv_func_crypt" != "yes" && { 
7908 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7909 echo "configure:7910: checking for crypt in -lcrypt" >&5
7910 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7911
7912 xe_check_libs=" -lcrypt "
7913 cat > conftest.$ac_ext <<EOF
7914 #line 7915 "configure"
7915 #include "confdefs.h"
7916 /* Override any gcc2 internal prototype to avoid an error.  */
7917 /* We use char because int might match the return type of a gcc2
7918     builtin and then its argument prototype would still apply.  */
7919 char crypt();
7920
7921 int main() {
7922 crypt()
7923 ; return 0; }
7924 EOF
7925 if { (eval echo configure:7926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7926   rm -rf conftest*
7927   eval "ac_cv_lib_$ac_lib_var=yes"
7928 else
7929   echo "configure: failed program was:" >&5
7930   cat conftest.$ac_ext >&5
7931   rm -rf conftest*
7932   eval "ac_cv_lib_$ac_lib_var=no"
7933 fi
7934 rm -f conftest*
7935 xe_check_libs=""
7936
7937 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7938   echo "$ac_t""yes" 1>&6
7939     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7940     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7941   { test "$extra_verbose" = "yes" && cat << EOF
7942     Defining $ac_tr_lib
7943 EOF
7944 cat >> confdefs.h <<EOF
7945 #define $ac_tr_lib 1
7946 EOF
7947 }
7948
7949   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
7950
7951 else
7952   echo "$ac_t""no" 1>&6
7953 fi
7954
7955  }
7956   fi
7957     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
7958     
7959 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
7960 echo "configure:7961: checking for jl_dic_list_e in -lwnn" >&5
7961 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7962
7963 xe_check_libs=" -lwnn "
7964 cat > conftest.$ac_ext <<EOF
7965 #line 7966 "configure"
7966 #include "confdefs.h"
7967 /* Override any gcc2 internal prototype to avoid an error.  */
7968 /* We use char because int might match the return type of a gcc2
7969     builtin and then its argument prototype would still apply.  */
7970 char jl_dic_list_e();
7971
7972 int main() {
7973 jl_dic_list_e()
7974 ; return 0; }
7975 EOF
7976 if { (eval echo configure:7977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7977   rm -rf conftest*
7978   eval "ac_cv_lib_$ac_lib_var=yes"
7979 else
7980   echo "configure: failed program was:" >&5
7981   cat conftest.$ac_ext >&5
7982   rm -rf conftest*
7983   eval "ac_cv_lib_$ac_lib_var=no"
7984 fi
7985 rm -f conftest*
7986 xe_check_libs=""
7987
7988 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7989   echo "$ac_t""yes" 1>&6
7990   libwnn=wnn
7991 else
7992   echo "$ac_t""no" 1>&6
7993 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
7994 echo "configure:7995: checking for jl_dic_list_e in -lwnn4" >&5
7995 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7996
7997 xe_check_libs=" -lwnn4 "
7998 cat > conftest.$ac_ext <<EOF
7999 #line 8000 "configure"
8000 #include "confdefs.h"
8001 /* Override any gcc2 internal prototype to avoid an error.  */
8002 /* We use char because int might match the return type of a gcc2
8003     builtin and then its argument prototype would still apply.  */
8004 char jl_dic_list_e();
8005
8006 int main() {
8007 jl_dic_list_e()
8008 ; return 0; }
8009 EOF
8010 if { (eval echo configure:8011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8011   rm -rf conftest*
8012   eval "ac_cv_lib_$ac_lib_var=yes"
8013 else
8014   echo "configure: failed program was:" >&5
8015   cat conftest.$ac_ext >&5
8016   rm -rf conftest*
8017   eval "ac_cv_lib_$ac_lib_var=no"
8018 fi
8019 rm -f conftest*
8020 xe_check_libs=""
8021
8022 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8023   echo "$ac_t""yes" 1>&6
8024   libwnn=wnn4
8025 else
8026   echo "$ac_t""no" 1>&6
8027 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8028 echo "configure:8029: checking for jl_dic_list_e in -lwnn6" >&5
8029 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8030
8031 xe_check_libs=" -lwnn6 "
8032 cat > conftest.$ac_ext <<EOF
8033 #line 8034 "configure"
8034 #include "confdefs.h"
8035 /* Override any gcc2 internal prototype to avoid an error.  */
8036 /* We use char because int might match the return type of a gcc2
8037     builtin and then its argument prototype would still apply.  */
8038 char jl_dic_list_e();
8039
8040 int main() {
8041 jl_dic_list_e()
8042 ; return 0; }
8043 EOF
8044 if { (eval echo configure:8045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8045   rm -rf conftest*
8046   eval "ac_cv_lib_$ac_lib_var=yes"
8047 else
8048   echo "configure: failed program was:" >&5
8049   cat conftest.$ac_ext >&5
8050   rm -rf conftest*
8051   eval "ac_cv_lib_$ac_lib_var=no"
8052 fi
8053 rm -f conftest*
8054 xe_check_libs=""
8055
8056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8057   echo "$ac_t""yes" 1>&6
8058   libwnn=wnn6
8059 else
8060   echo "$ac_t""no" 1>&6
8061 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8062 echo "configure:8063: checking for dic_list_e in -lwnn6_fromsrc" >&5
8063 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8064
8065 xe_check_libs=" -lwnn6_fromsrc "
8066 cat > conftest.$ac_ext <<EOF
8067 #line 8068 "configure"
8068 #include "confdefs.h"
8069 /* Override any gcc2 internal prototype to avoid an error.  */
8070 /* We use char because int might match the return type of a gcc2
8071     builtin and then its argument prototype would still apply.  */
8072 char dic_list_e();
8073
8074 int main() {
8075 dic_list_e()
8076 ; return 0; }
8077 EOF
8078 if { (eval echo configure:8079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8079   rm -rf conftest*
8080   eval "ac_cv_lib_$ac_lib_var=yes"
8081 else
8082   echo "configure: failed program was:" >&5
8083   cat conftest.$ac_ext >&5
8084   rm -rf conftest*
8085   eval "ac_cv_lib_$ac_lib_var=no"
8086 fi
8087 rm -f conftest*
8088 xe_check_libs=""
8089
8090 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8091   echo "$ac_t""yes" 1>&6
8092   libwnn=wnn6_fromsrc
8093 else
8094   echo "$ac_t""no" 1>&6
8095 with_wnn=no
8096 fi
8097
8098
8099 fi
8100
8101
8102 fi
8103
8104
8105 fi
8106
8107
8108   fi
8109   test -z "$with_wnn" && with_wnn=yes
8110   if test "$with_wnn" = "yes"; then
8111     { test "$extra_verbose" = "yes" && cat << \EOF
8112     Defining HAVE_WNN
8113 EOF
8114 cat >> confdefs.h <<\EOF
8115 #define HAVE_WNN 1
8116 EOF
8117 }
8118
8119     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8120     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8121    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8122  fi
8123     if test "$with_wnn6" != "no"; then
8124       
8125 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8126 echo "configure:8127: checking for jl_fi_dic_list in -l$libwnn" >&5
8127 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8128
8129 xe_check_libs=" -l$libwnn "
8130 cat > conftest.$ac_ext <<EOF
8131 #line 8132 "configure"
8132 #include "confdefs.h"
8133 /* Override any gcc2 internal prototype to avoid an error.  */
8134 /* We use char because int might match the return type of a gcc2
8135     builtin and then its argument prototype would still apply.  */
8136 char jl_fi_dic_list();
8137
8138 int main() {
8139 jl_fi_dic_list()
8140 ; return 0; }
8141 EOF
8142 if { (eval echo configure:8143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8143   rm -rf conftest*
8144   eval "ac_cv_lib_$ac_lib_var=yes"
8145 else
8146   echo "configure: failed program was:" >&5
8147   cat conftest.$ac_ext >&5
8148   rm -rf conftest*
8149   eval "ac_cv_lib_$ac_lib_var=no"
8150 fi
8151 rm -f conftest*
8152 xe_check_libs=""
8153
8154 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8155   echo "$ac_t""yes" 1>&6
8156   with_wnn6=yes
8157 else
8158   echo "$ac_t""no" 1>&6
8159 fi
8160
8161
8162       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8163     Defining WNN6
8164 EOF
8165 cat >> confdefs.h <<\EOF
8166 #define WNN6 1
8167 EOF
8168 }
8169
8170     fi
8171   fi
8172
8173     canna_includes_found=no
8174   if test "$with_canna" != "no"; then
8175     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8176 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8177 echo "configure:8178: checking for canna/jrkanji.h" >&5
8178
8179 cat > conftest.$ac_ext <<EOF
8180 #line 8181 "configure"
8181 #include "confdefs.h"
8182 #include <canna/jrkanji.h>
8183 EOF
8184 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8185 { (eval echo configure:8186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8186 ac_err=`grep -v '^ *+' conftest.out`
8187 if test -z "$ac_err"; then
8188   rm -rf conftest*
8189   eval "ac_cv_header_$ac_safe=yes"
8190 else
8191   echo "$ac_err" >&5
8192   echo "configure: failed program was:" >&5
8193   cat conftest.$ac_ext >&5
8194   rm -rf conftest*
8195   eval "ac_cv_header_$ac_safe=no"
8196 fi
8197 rm -f conftest*
8198 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8199   echo "$ac_t""yes" 1>&6
8200   canna_includes_found=yes
8201 else
8202   echo "$ac_t""no" 1>&6
8203 fi
8204
8205   fi
8206   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8207       -d "/usr/local/canna/include"; then
8208     save_c_switch_site="$c_switch_site"
8209     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8210     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8211 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8212 echo "configure:8213: checking for canna/jrkanji.h" >&5
8213
8214 cat > conftest.$ac_ext <<EOF
8215 #line 8216 "configure"
8216 #include "confdefs.h"
8217 #include <canna/jrkanji.h>
8218 EOF
8219 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8220 { (eval echo configure:8221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8221 ac_err=`grep -v '^ *+' conftest.out`
8222 if test -z "$ac_err"; then
8223   rm -rf conftest*
8224   eval "ac_cv_header_$ac_safe=yes"
8225 else
8226   echo "$ac_err" >&5
8227   echo "configure: failed program was:" >&5
8228   cat conftest.$ac_ext >&5
8229   rm -rf conftest*
8230   eval "ac_cv_header_$ac_safe=no"
8231 fi
8232 rm -f conftest*
8233 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8234   echo "$ac_t""yes" 1>&6
8235   canna_includes_found=yes
8236 else
8237   echo "$ac_t""no" 1>&6
8238 fi
8239
8240     if test "$canna_includes_found" != "yes"; then
8241       c_switch_site="$save_c_switch_site"
8242       with_canna="no"
8243     fi
8244   fi
8245
8246   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8247 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8248 echo "configure:8249: checking for canna/RK.h" >&5
8249
8250 cat > conftest.$ac_ext <<EOF
8251 #line 8252 "configure"
8252 #include "confdefs.h"
8253 #include <canna/RK.h>
8254 EOF
8255 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8256 { (eval echo configure:8257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8257 ac_err=`grep -v '^ *+' conftest.out`
8258 if test -z "$ac_err"; then
8259   rm -rf conftest*
8260   eval "ac_cv_header_$ac_safe=yes"
8261 else
8262   echo "$ac_err" >&5
8263   echo "configure: failed program was:" >&5
8264   cat conftest.$ac_ext >&5
8265   rm -rf conftest*
8266   eval "ac_cv_header_$ac_safe=no"
8267 fi
8268 rm -f conftest*
8269 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8270   echo "$ac_t""yes" 1>&6
8271   :
8272 else
8273   echo "$ac_t""no" 1>&6
8274 with_canna=no
8275 fi
8276  }
8277   test -z "$with_canna" && { 
8278 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8279 echo "configure:8280: checking for RkBgnBun in -lRKC" >&5
8280 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8281
8282 xe_check_libs=" -lRKC "
8283 cat > conftest.$ac_ext <<EOF
8284 #line 8285 "configure"
8285 #include "confdefs.h"
8286 /* Override any gcc2 internal prototype to avoid an error.  */
8287 /* We use char because int might match the return type of a gcc2
8288     builtin and then its argument prototype would still apply.  */
8289 char RkBgnBun();
8290
8291 int main() {
8292 RkBgnBun()
8293 ; return 0; }
8294 EOF
8295 if { (eval echo configure:8296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8296   rm -rf conftest*
8297   eval "ac_cv_lib_$ac_lib_var=yes"
8298 else
8299   echo "configure: failed program was:" >&5
8300   cat conftest.$ac_ext >&5
8301   rm -rf conftest*
8302   eval "ac_cv_lib_$ac_lib_var=no"
8303 fi
8304 rm -f conftest*
8305 xe_check_libs=""
8306
8307 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8308   echo "$ac_t""yes" 1>&6
8309   :
8310 else
8311   echo "$ac_t""no" 1>&6
8312 with_canna=no
8313 fi
8314
8315  }
8316   test -z "$with_canna" && { 
8317 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8318 echo "configure:8319: checking for jrKanjiControl in -lcanna" >&5
8319 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8320
8321 xe_check_libs=" -lcanna "
8322 cat > conftest.$ac_ext <<EOF
8323 #line 8324 "configure"
8324 #include "confdefs.h"
8325 /* Override any gcc2 internal prototype to avoid an error.  */
8326 /* We use char because int might match the return type of a gcc2
8327     builtin and then its argument prototype would still apply.  */
8328 char jrKanjiControl();
8329
8330 int main() {
8331 jrKanjiControl()
8332 ; return 0; }
8333 EOF
8334 if { (eval echo configure:8335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8335   rm -rf conftest*
8336   eval "ac_cv_lib_$ac_lib_var=yes"
8337 else
8338   echo "configure: failed program was:" >&5
8339   cat conftest.$ac_ext >&5
8340   rm -rf conftest*
8341   eval "ac_cv_lib_$ac_lib_var=no"
8342 fi
8343 rm -f conftest*
8344 xe_check_libs=""
8345
8346 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8347   echo "$ac_t""yes" 1>&6
8348   :
8349 else
8350   echo "$ac_t""no" 1>&6
8351 with_canna=no
8352 fi
8353
8354  }
8355   test -z "$with_canna" && with_canna=yes
8356   if test "$with_canna" = "yes"; then
8357     { test "$extra_verbose" = "yes" && cat << \EOF
8358     Defining HAVE_CANNA
8359 EOF
8360 cat >> confdefs.h <<\EOF
8361 #define HAVE_CANNA 1
8362 EOF
8363 }
8364
8365     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8366     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8367    echo "    xemacs will be linked with \"mule-canna.o\""
8368  fi
8369   fi
8370
8371 else   for feature in xim canna wnn; do
8372     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8373       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8374     fi
8375     eval "with_${feature}=no"
8376   done
8377 fi 
8378
8379 if test "$need_motif" = "yes" ; then
8380   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8381     
8382 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8383 echo "configure:8384: checking for layout_object_getvalue in -li18n" >&5
8384 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8385
8386 xe_check_libs=" -li18n "
8387 cat > conftest.$ac_ext <<EOF
8388 #line 8389 "configure"
8389 #include "confdefs.h"
8390 /* Override any gcc2 internal prototype to avoid an error.  */
8391 /* We use char because int might match the return type of a gcc2
8392     builtin and then its argument prototype would still apply.  */
8393 char layout_object_getvalue();
8394
8395 int main() {
8396 layout_object_getvalue()
8397 ; return 0; }
8398 EOF
8399 if { (eval echo configure:8400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8400   rm -rf conftest*
8401   eval "ac_cv_lib_$ac_lib_var=yes"
8402 else
8403   echo "configure: failed program was:" >&5
8404   cat conftest.$ac_ext >&5
8405   rm -rf conftest*
8406   eval "ac_cv_lib_$ac_lib_var=no"
8407 fi
8408 rm -f conftest*
8409 xe_check_libs=""
8410
8411 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8412   echo "$ac_t""yes" 1>&6
8413   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8414 else
8415   echo "$ac_t""no" 1>&6
8416 fi
8417
8418
8419   
8420 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8421     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8422   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8423   
8424         runpath="" runpath_dirs=""
8425   if test -n "$LD_RUN_PATH"; then
8426     runpath="$LD_RUN_PATH"
8427   elif test "$GCC" = "yes"; then
8428         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8429     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8430     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8431     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8432       case "$arg" in P,* | -L* | -R* )
8433         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8434           {
8435 xe_runpath_dir="$dir"
8436   test "$xe_runpath_dir" != "/lib"     -a \
8437         "$xe_runpath_dir" != "/usr/lib" -a \
8438         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8439   eval "$xe_add_unique_runpath_dir"
8440 }
8441         done ;;
8442       esac
8443     done
8444     ld_switch_run="$ld_switch_run_save"
8445     rm -f conftest*
8446   else
8447         for arg in $ld_switch_site $ld_switch_x_site; do
8448       case "$arg" in -L*) {
8449 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8450   test "$xe_runpath_dir" != "/lib"     -a \
8451         "$xe_runpath_dir" != "/usr/lib" -a \
8452         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8453   eval "$xe_add_unique_runpath_dir"
8454 };; esac
8455     done
8456         if test "$opsys $need_motif" = "sol2 yes"; then
8457       xe_runpath_dir="/opt/SUNWdt/lib";
8458       eval "$xe_add_unique_runpath_dir";
8459     fi
8460   fi 
8461   if test -n "$runpath"; then
8462     ld_switch_run="${dash_r}${runpath}"
8463     
8464 if test "$GCC" = "yes"; then
8465   set x $ld_switch_run; shift; ld_switch_run=""
8466   while test -n "$1"; do
8467     case $1 in
8468       -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8469       -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
8470       -Xlinker* ) ;;
8471       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8472     esac
8473     shift
8474   done
8475 fi
8476     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8477   fi
8478 fi
8479
8480 fi
8481
8482 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
8483 do
8484 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8485 echo "configure:8486: checking for $ac_func" >&5
8486
8487 cat > conftest.$ac_ext <<EOF
8488 #line 8489 "configure"
8489 #include "confdefs.h"
8490 /* System header to define __stub macros and hopefully few prototypes,
8491     which can conflict with char $ac_func(); below.  */
8492 #include <assert.h>
8493 /* Override any gcc2 internal prototype to avoid an error.  */
8494 /* We use char because int might match the return type of a gcc2
8495     builtin and then its argument prototype would still apply.  */
8496 char $ac_func();
8497
8498 int main() {
8499
8500 /* The GNU C library defines this for functions which it implements
8501     to always fail with ENOSYS.  Some functions are actually named
8502     something starting with __ and the normal name is an alias.  */
8503 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8504 choke me
8505 #else
8506 $ac_func();
8507 #endif
8508
8509 ; return 0; }
8510 EOF
8511 if { (eval echo configure:8512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8512   rm -rf conftest*
8513   eval "ac_cv_func_$ac_func=yes"
8514 else
8515   echo "configure: failed program was:" >&5
8516   cat conftest.$ac_ext >&5
8517   rm -rf conftest*
8518   eval "ac_cv_func_$ac_func=no"
8519 fi
8520 rm -f conftest*
8521
8522 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8523   echo "$ac_t""yes" 1>&6
8524     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8525   { test "$extra_verbose" = "yes" && cat << EOF
8526     Defining $ac_tr_func
8527 EOF
8528 cat >> confdefs.h <<EOF
8529 #define $ac_tr_func 1
8530 EOF
8531 }
8532  
8533 else
8534   echo "$ac_t""no" 1>&6
8535 fi
8536 done
8537
8538
8539
8540 case "$opsys" in
8541   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8542    echo "    xemacs will be linked with \"realpath.o\""
8543  fi ;;
8544   * )
8545     case "$canonical" in
8546       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8547    echo "    xemacs will be linked with \"realpath.o\""
8548  fi ;;
8549       * ) for ac_func in realpath
8550 do
8551 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8552 echo "configure:8553: checking for $ac_func" >&5
8553
8554 cat > conftest.$ac_ext <<EOF
8555 #line 8556 "configure"
8556 #include "confdefs.h"
8557 /* System header to define __stub macros and hopefully few prototypes,
8558     which can conflict with char $ac_func(); below.  */
8559 #include <assert.h>
8560 /* Override any gcc2 internal prototype to avoid an error.  */
8561 /* We use char because int might match the return type of a gcc2
8562     builtin and then its argument prototype would still apply.  */
8563 char $ac_func();
8564
8565 int main() {
8566
8567 /* The GNU C library defines this for functions which it implements
8568     to always fail with ENOSYS.  Some functions are actually named
8569     something starting with __ and the normal name is an alias.  */
8570 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8571 choke me
8572 #else
8573 $ac_func();
8574 #endif
8575
8576 ; return 0; }
8577 EOF
8578 if { (eval echo configure:8579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8579   rm -rf conftest*
8580   eval "ac_cv_func_$ac_func=yes"
8581 else
8582   echo "configure: failed program was:" >&5
8583   cat conftest.$ac_ext >&5
8584   rm -rf conftest*
8585   eval "ac_cv_func_$ac_func=no"
8586 fi
8587 rm -f conftest*
8588
8589 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8590   echo "$ac_t""yes" 1>&6
8591     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8592   { test "$extra_verbose" = "yes" && cat << EOF
8593     Defining $ac_tr_func
8594 EOF
8595 cat >> confdefs.h <<EOF
8596 #define $ac_tr_func 1
8597 EOF
8598 }
8599  
8600 else
8601   echo "$ac_t""no" 1>&6
8602 fi
8603 done
8604
8605           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8606    echo "    xemacs will be linked with \"realpath.o\""
8607  fi ;;
8608     esac ;;
8609 esac
8610
8611 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8612 echo "configure:8613: checking whether netdb declares h_errno" >&5
8613 cat > conftest.$ac_ext <<EOF
8614 #line 8615 "configure"
8615 #include "confdefs.h"
8616 #include <netdb.h>
8617 int main() {
8618 return h_errno;
8619 ; return 0; }
8620 EOF
8621 if { (eval echo configure:8622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8622   rm -rf conftest*
8623   echo "$ac_t""yes" 1>&6
8624    { test "$extra_verbose" = "yes" && cat << \EOF
8625     Defining HAVE_H_ERRNO
8626 EOF
8627 cat >> confdefs.h <<\EOF
8628 #define HAVE_H_ERRNO 1
8629 EOF
8630 }
8631
8632 else
8633   echo "configure: failed program was:" >&5
8634   cat conftest.$ac_ext >&5
8635   rm -rf conftest*
8636   echo "$ac_t""no" 1>&6
8637 fi
8638 rm -f conftest*
8639
8640 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8641 echo "configure:8642: checking for sigsetjmp" >&5
8642 cat > conftest.$ac_ext <<EOF
8643 #line 8644 "configure"
8644 #include "confdefs.h"
8645 #include <setjmp.h>
8646 int main() {
8647 sigjmp_buf bar; sigsetjmp (bar, 0);
8648 ; return 0; }
8649 EOF
8650 if { (eval echo configure:8651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8651   rm -rf conftest*
8652   echo "$ac_t""yes" 1>&6
8653    { test "$extra_verbose" = "yes" && cat << \EOF
8654     Defining HAVE_SIGSETJMP
8655 EOF
8656 cat >> confdefs.h <<\EOF
8657 #define HAVE_SIGSETJMP 1
8658 EOF
8659 }
8660
8661 else
8662   echo "configure: failed program was:" >&5
8663   cat conftest.$ac_ext >&5
8664   rm -rf conftest*
8665   echo "$ac_t""no" 1>&6
8666 fi
8667 rm -f conftest*
8668
8669 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
8670 echo "configure:8671: checking whether localtime caches TZ" >&5
8671
8672 if test "$ac_cv_func_tzset" = "yes"; then
8673 cat > conftest.$ac_ext <<EOF
8674 #line 8675 "configure"
8675 #include "confdefs.h"
8676 #include <time.h>
8677 #if STDC_HEADERS
8678 # include <stdlib.h>
8679 #endif
8680 extern char **environ;
8681 unset_TZ ()
8682 {
8683   char **from, **to;
8684   for (to = from = environ; (*to = *from); from++)
8685     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
8686       to++;
8687 }
8688 char TZ_GMT0[] = "TZ=GMT0";
8689 char TZ_PST8[] = "TZ=PST8";
8690 main()
8691 {
8692   time_t now = time ((time_t *) 0);
8693   int hour_GMT0, hour_unset;
8694   if (putenv (TZ_GMT0) != 0)
8695     exit (1);
8696   hour_GMT0 = localtime (&now)->tm_hour;
8697   unset_TZ ();
8698   hour_unset = localtime (&now)->tm_hour;
8699   if (putenv (TZ_PST8) != 0)
8700     exit (1);
8701   if (localtime (&now)->tm_hour == hour_GMT0)
8702     exit (1);
8703   unset_TZ ();
8704   if (localtime (&now)->tm_hour != hour_unset)
8705     exit (1);
8706   exit (0);
8707 }
8708 EOF
8709 if { (eval echo configure:8710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8710 then
8711   emacs_cv_localtime_cache=no
8712 else
8713   conftest_rc="$?"
8714   echo "configure: failed program was:" >&5
8715   cat conftest.$ac_ext >&5
8716   rm -fr conftest*
8717   emacs_cv_localtime_cache=yes
8718 fi
8719 rm -fr conftest*
8720 else
8721         # If we lack tzset, report that localtime does not cache TZ,
8722         # since we can't invalidate the cache if we don't have tzset.
8723         emacs_cv_localtime_cache=no
8724 fi
8725 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
8726 if test $emacs_cv_localtime_cache = yes; then
8727   { test "$extra_verbose" = "yes" && cat << \EOF
8728     Defining LOCALTIME_CACHE
8729 EOF
8730 cat >> confdefs.h <<\EOF
8731 #define LOCALTIME_CACHE 1
8732 EOF
8733 }
8734
8735 fi
8736
8737 if test "$HAVE_TIMEVAL" = "yes"; then
8738 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
8739 echo "configure:8740: checking whether gettimeofday accepts one or two arguments" >&5
8740 cat > conftest.$ac_ext <<EOF
8741 #line 8742 "configure"
8742 #include "confdefs.h"
8743
8744 #ifdef TIME_WITH_SYS_TIME
8745 #include <sys/time.h>
8746 #include <time.h>
8747 #else
8748 #ifdef HAVE_SYS_TIME_H
8749 #include <sys/time.h>
8750 #else
8751 #include <time.h>
8752 #endif
8753 #endif
8754   
8755 int main() {
8756
8757   struct timeval time;
8758   struct timezone dummy;
8759   gettimeofday (&time, &dummy);
8760
8761 ; return 0; }
8762 EOF
8763 if { (eval echo configure:8764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8764   rm -rf conftest*
8765   echo "$ac_t""two" 1>&6
8766 else
8767   echo "configure: failed program was:" >&5
8768   cat conftest.$ac_ext >&5
8769   rm -rf conftest*
8770   echo "$ac_t""one" 1>&6
8771    { test "$extra_verbose" = "yes" && cat << \EOF
8772     Defining GETTIMEOFDAY_ONE_ARGUMENT
8773 EOF
8774 cat >> confdefs.h <<\EOF
8775 #define GETTIMEOFDAY_ONE_ARGUMENT 1
8776 EOF
8777 }
8778
8779 fi
8780 rm -f conftest*
8781 fi
8782
8783
8784 echo $ac_n "checking for inline""... $ac_c" 1>&6
8785 echo "configure:8786: checking for inline" >&5
8786
8787 ac_cv_c_inline=no
8788 for ac_kw in inline __inline__ __inline; do
8789   cat > conftest.$ac_ext <<EOF
8790 #line 8791 "configure"
8791 #include "confdefs.h"
8792
8793 int main() {
8794 } $ac_kw foo() {
8795 ; return 0; }
8796 EOF
8797 if { (eval echo configure:8798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8798   rm -rf conftest*
8799   ac_cv_c_inline=$ac_kw; break
8800 else
8801   echo "configure: failed program was:" >&5
8802   cat conftest.$ac_ext >&5
8803 fi
8804 rm -f conftest*
8805 done
8806
8807
8808 echo "$ac_t""$ac_cv_c_inline" 1>&6
8809 case "$ac_cv_c_inline" in
8810   inline | yes) ;;
8811   no) { test "$extra_verbose" = "yes" && cat << \EOF
8812     Defining inline = 
8813 EOF
8814 cat >> confdefs.h <<\EOF
8815 #define inline 
8816 EOF
8817 }
8818  ;;
8819   *)  { test "$extra_verbose" = "yes" && cat << EOF
8820     Defining inline = $ac_cv_c_inline
8821 EOF
8822 cat >> confdefs.h <<EOF
8823 #define inline $ac_cv_c_inline
8824 EOF
8825 }
8826  ;;
8827 esac
8828
8829 if test "$ac_cv_c_inline" != "no"; then
8830   { test "$extra_verbose" = "yes" && cat << \EOF
8831     Defining HAVE_INLINE
8832 EOF
8833 cat >> confdefs.h <<\EOF
8834 #define HAVE_INLINE 1
8835 EOF
8836 }
8837
8838   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
8839    echo "    xemacs will be linked with \"inline.o\""
8840  fi
8841 fi
8842
8843
8844 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
8845 # for constant arguments.  Useless!
8846 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
8847 echo "configure:8848: checking for working alloca.h" >&5
8848
8849 cat > conftest.$ac_ext <<EOF
8850 #line 8851 "configure"
8851 #include "confdefs.h"
8852 #include <alloca.h>
8853 int main() {
8854 char *p = alloca(2 * sizeof(int));
8855 ; return 0; }
8856 EOF
8857 if { (eval echo configure:8858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8858   rm -rf conftest*
8859   ac_cv_header_alloca_h=yes
8860 else
8861   echo "configure: failed program was:" >&5
8862   cat conftest.$ac_ext >&5
8863   rm -rf conftest*
8864   ac_cv_header_alloca_h=no
8865 fi
8866 rm -f conftest*
8867
8868 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
8869 if test $ac_cv_header_alloca_h = yes; then
8870   { test "$extra_verbose" = "yes" && cat << \EOF
8871     Defining HAVE_ALLOCA_H
8872 EOF
8873 cat >> confdefs.h <<\EOF
8874 #define HAVE_ALLOCA_H 1
8875 EOF
8876 }
8877
8878 fi
8879
8880 echo $ac_n "checking for alloca""... $ac_c" 1>&6
8881 echo "configure:8882: checking for alloca" >&5
8882
8883 cat > conftest.$ac_ext <<EOF
8884 #line 8885 "configure"
8885 #include "confdefs.h"
8886
8887 #ifdef __GNUC__
8888 # define alloca __builtin_alloca
8889 #else
8890 # if HAVE_ALLOCA_H
8891 #  include <alloca.h>
8892 # else
8893 #  ifdef _AIX
8894  #pragma alloca
8895 #  else
8896 #   ifndef alloca /* predefined by HP cc +Olibcalls */
8897 char *alloca ();
8898 #   endif
8899 #  endif
8900 # endif
8901 #endif
8902
8903 int main() {
8904 char *p = (char *) alloca(1);
8905 ; return 0; }
8906 EOF
8907 if { (eval echo configure:8908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8908   rm -rf conftest*
8909   ac_cv_func_alloca_works=yes
8910 else
8911   echo "configure: failed program was:" >&5
8912   cat conftest.$ac_ext >&5
8913   rm -rf conftest*
8914   ac_cv_func_alloca_works=no
8915 fi
8916 rm -f conftest*
8917
8918 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
8919 if test $ac_cv_func_alloca_works = yes; then
8920   { test "$extra_verbose" = "yes" && cat << \EOF
8921     Defining HAVE_ALLOCA
8922 EOF
8923 cat >> confdefs.h <<\EOF
8924 #define HAVE_ALLOCA 1
8925 EOF
8926 }
8927
8928 fi
8929
8930 if test $ac_cv_func_alloca_works = no; then
8931   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
8932   # that cause trouble.  Some versions do not even contain alloca or
8933   # contain a buggy version.  If you still want to use their alloca,
8934   # use ar to extract alloca.o from them instead of compiling alloca.c.
8935   ALLOCA=alloca.o
8936   { test "$extra_verbose" = "yes" && cat << \EOF
8937     Defining C_ALLOCA
8938 EOF
8939 cat >> confdefs.h <<\EOF
8940 #define C_ALLOCA 1
8941 EOF
8942 }
8943
8944
8945 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
8946 echo "configure:8947: checking whether alloca needs Cray hooks" >&5
8947
8948 cat > conftest.$ac_ext <<EOF
8949 #line 8950 "configure"
8950 #include "confdefs.h"
8951 #if defined(CRAY) && ! defined(CRAY2)
8952 webecray
8953 #else
8954 wenotbecray
8955 #endif
8956
8957 EOF
8958 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8959   egrep "webecray" >/dev/null 2>&1; then
8960   rm -rf conftest*
8961   ac_cv_os_cray=yes
8962 else
8963   rm -rf conftest*
8964   ac_cv_os_cray=no
8965 fi
8966 rm -f conftest*
8967
8968
8969 echo "$ac_t""$ac_cv_os_cray" 1>&6
8970 if test $ac_cv_os_cray = yes; then
8971 for ac_func in _getb67 GETB67 getb67; do
8972   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8973 echo "configure:8974: checking for $ac_func" >&5
8974
8975 cat > conftest.$ac_ext <<EOF
8976 #line 8977 "configure"
8977 #include "confdefs.h"
8978 /* System header to define __stub macros and hopefully few prototypes,
8979     which can conflict with char $ac_func(); below.  */
8980 #include <assert.h>
8981 /* Override any gcc2 internal prototype to avoid an error.  */
8982 /* We use char because int might match the return type of a gcc2
8983     builtin and then its argument prototype would still apply.  */
8984 char $ac_func();
8985
8986 int main() {
8987
8988 /* The GNU C library defines this for functions which it implements
8989     to always fail with ENOSYS.  Some functions are actually named
8990     something starting with __ and the normal name is an alias.  */
8991 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8992 choke me
8993 #else
8994 $ac_func();
8995 #endif
8996
8997 ; return 0; }
8998 EOF
8999 if { (eval echo configure:9000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9000   rm -rf conftest*
9001   eval "ac_cv_func_$ac_func=yes"
9002 else
9003   echo "configure: failed program was:" >&5
9004   cat conftest.$ac_ext >&5
9005   rm -rf conftest*
9006   eval "ac_cv_func_$ac_func=no"
9007 fi
9008 rm -f conftest*
9009
9010 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9011   echo "$ac_t""yes" 1>&6
9012   { test "$extra_verbose" = "yes" && cat << EOF
9013     Defining CRAY_STACKSEG_END = $ac_func
9014 EOF
9015 cat >> confdefs.h <<EOF
9016 #define CRAY_STACKSEG_END $ac_func
9017 EOF
9018 }
9019
9020   break
9021 else
9022   echo "$ac_t""no" 1>&6
9023 fi
9024
9025 done
9026 fi
9027
9028 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9029 echo "configure:9030: checking stack direction for C alloca" >&5
9030
9031 cat > conftest.$ac_ext <<EOF
9032 #line 9033 "configure"
9033 #include "confdefs.h"
9034 find_stack_direction ()
9035 {
9036   static char *addr = 0;
9037   auto char dummy;
9038   if (addr == 0)
9039     {
9040       addr = &dummy;
9041       return find_stack_direction ();
9042     }
9043   else
9044     return (&dummy > addr) ? 1 : -1;
9045 }
9046 main ()
9047 {
9048   exit (find_stack_direction() < 0);
9049 }
9050 EOF
9051 if { (eval echo configure:9052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9052 then
9053   ac_cv_c_stack_direction=1
9054 else
9055   conftest_rc="$?"
9056   echo "configure: failed program was:" >&5
9057   cat conftest.$ac_ext >&5
9058   rm -fr conftest*
9059   ac_cv_c_stack_direction=-1
9060 fi
9061 rm -fr conftest*
9062
9063 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9064 { test "$extra_verbose" = "yes" && cat << EOF
9065     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9066 EOF
9067 cat >> confdefs.h <<EOF
9068 #define STACK_DIRECTION $ac_cv_c_stack_direction
9069 EOF
9070 }
9071
9072 fi
9073
9074 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9075    echo "    xemacs will be linked with \"$ALLOCA\""
9076  fi
9077
9078 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9079 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9080 echo "configure:9081: checking for vfork.h" >&5
9081
9082 cat > conftest.$ac_ext <<EOF
9083 #line 9084 "configure"
9084 #include "confdefs.h"
9085 #include <vfork.h>
9086 EOF
9087 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9088 { (eval echo configure:9089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9089 ac_err=`grep -v '^ *+' conftest.out`
9090 if test -z "$ac_err"; then
9091   rm -rf conftest*
9092   eval "ac_cv_header_$ac_safe=yes"
9093 else
9094   echo "$ac_err" >&5
9095   echo "configure: failed program was:" >&5
9096   cat conftest.$ac_ext >&5
9097   rm -rf conftest*
9098   eval "ac_cv_header_$ac_safe=no"
9099 fi
9100 rm -f conftest*
9101 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9102   echo "$ac_t""yes" 1>&6
9103   { test "$extra_verbose" = "yes" && cat << \EOF
9104     Defining HAVE_VFORK_H
9105 EOF
9106 cat >> confdefs.h <<\EOF
9107 #define HAVE_VFORK_H 1
9108 EOF
9109 }
9110
9111 else
9112   echo "$ac_t""no" 1>&6
9113 fi
9114
9115 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9116 echo "configure:9117: checking for working vfork" >&5
9117
9118 cat > conftest.$ac_ext <<EOF
9119 #line 9120 "configure"
9120 #include "confdefs.h"
9121 /* Thanks to Paul Eggert for this test.  */
9122 #include <stdio.h>
9123 #include <sys/types.h>
9124 #include <sys/stat.h>
9125 #ifdef HAVE_UNISTD_H
9126 #include <unistd.h>
9127 #endif
9128 #ifdef HAVE_VFORK_H
9129 #include <vfork.h>
9130 #endif
9131 /* On some sparc systems, changes by the child to local and incoming
9132    argument registers are propagated back to the parent.
9133    The compiler is told about this with #include <vfork.h>,
9134    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9135    Test for this by using a static variable whose address
9136    is put into a register that is clobbered by the vfork.  */
9137 static
9138 #ifdef __cplusplus
9139 sparc_address_test (int arg)
9140 #else
9141 sparc_address_test (arg) int arg;
9142 #endif
9143 {
9144   static pid_t child;
9145   if (!child) {
9146     child = vfork ();
9147     if (child < 0) {
9148       perror ("vfork");
9149       _exit(2);
9150     }
9151     if (!child) {
9152       arg = getpid();
9153       write(-1, "", 0);
9154       _exit (arg);
9155     }
9156   }
9157 }
9158 main() {
9159   pid_t parent = getpid ();
9160   pid_t child;
9161
9162   sparc_address_test ();
9163
9164   child = vfork ();
9165
9166   if (child == 0) {
9167     /* Here is another test for sparc vfork register problems.
9168        This test uses lots of local variables, at least
9169        as many local variables as main has allocated so far
9170        including compiler temporaries.  4 locals are enough for
9171        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9172        A buggy compiler should reuse the register of parent
9173        for one of the local variables, since it will think that
9174        parent can't possibly be used any more in this routine.
9175        Assigning to the local variable will thus munge parent
9176        in the parent process.  */
9177     pid_t
9178       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9179       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9180     /* Convince the compiler that p..p7 are live; otherwise, it might
9181        use the same hardware register for all 8 local variables.  */
9182     if (p != p1 || p != p2 || p != p3 || p != p4
9183         || p != p5 || p != p6 || p != p7)
9184       _exit(1);
9185
9186     /* On some systems (e.g. IRIX 3.3),
9187        vfork doesn't separate parent from child file descriptors.
9188        If the child closes a descriptor before it execs or exits,
9189        this munges the parent's descriptor as well.
9190        Test for this by closing stdout in the child.  */
9191     _exit(close(fileno(stdout)) != 0);
9192   } else {
9193     int status;
9194     struct stat st;
9195
9196     while (wait(&status) != child)
9197       ;
9198     exit(
9199          /* Was there some problem with vforking?  */
9200          child < 0
9201
9202          /* Did the child fail?  (This shouldn't happen.)  */
9203          || status
9204
9205          /* Did the vfork/compiler bug occur?  */
9206          || parent != getpid()
9207
9208          /* Did the file descriptor bug occur?  */
9209          || fstat(fileno(stdout), &st) != 0
9210          );
9211   }
9212 }
9213 EOF
9214 if { (eval echo configure:9215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9215 then
9216   ac_cv_func_vfork_works=yes
9217 else
9218   conftest_rc="$?"
9219   echo "configure: failed program was:" >&5
9220   cat conftest.$ac_ext >&5
9221   rm -fr conftest*
9222   ac_cv_func_vfork_works=no
9223 fi
9224 rm -fr conftest*
9225
9226 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9227 if test $ac_cv_func_vfork_works = no; then
9228   { test "$extra_verbose" = "yes" && cat << \EOF
9229     Defining vfork = fork
9230 EOF
9231 cat >> confdefs.h <<\EOF
9232 #define vfork fork
9233 EOF
9234 }
9235
9236 fi
9237
9238
9239 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9240 echo "configure:9241: checking for working strcoll" >&5
9241
9242 cat > conftest.$ac_ext <<EOF
9243 #line 9244 "configure"
9244 #include "confdefs.h"
9245 #include <string.h>
9246 main ()
9247 {
9248   exit (strcoll ("abc", "def") >= 0 ||
9249         strcoll ("ABC", "DEF") >= 0 ||
9250         strcoll ("123", "456") >= 0);
9251 }
9252 EOF
9253 if { (eval echo configure:9254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9254 then
9255   ac_cv_func_strcoll_works=yes
9256 else
9257   conftest_rc="$?"
9258   echo "configure: failed program was:" >&5
9259   cat conftest.$ac_ext >&5
9260   rm -fr conftest*
9261   ac_cv_func_strcoll_works=no
9262 fi
9263 rm -fr conftest*
9264
9265 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9266 if test $ac_cv_func_strcoll_works = yes; then
9267   { test "$extra_verbose" = "yes" && cat << \EOF
9268     Defining HAVE_STRCOLL
9269 EOF
9270 cat >> confdefs.h <<\EOF
9271 #define HAVE_STRCOLL 1
9272 EOF
9273 }
9274
9275 fi
9276
9277
9278 for ac_func in getpgrp
9279 do
9280 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9281 echo "configure:9282: checking for $ac_func" >&5
9282
9283 cat > conftest.$ac_ext <<EOF
9284 #line 9285 "configure"
9285 #include "confdefs.h"
9286 /* System header to define __stub macros and hopefully few prototypes,
9287     which can conflict with char $ac_func(); below.  */
9288 #include <assert.h>
9289 /* Override any gcc2 internal prototype to avoid an error.  */
9290 /* We use char because int might match the return type of a gcc2
9291     builtin and then its argument prototype would still apply.  */
9292 char $ac_func();
9293
9294 int main() {
9295
9296 /* The GNU C library defines this for functions which it implements
9297     to always fail with ENOSYS.  Some functions are actually named
9298     something starting with __ and the normal name is an alias.  */
9299 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9300 choke me
9301 #else
9302 $ac_func();
9303 #endif
9304
9305 ; return 0; }
9306 EOF
9307 if { (eval echo configure:9308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9308   rm -rf conftest*
9309   eval "ac_cv_func_$ac_func=yes"
9310 else
9311   echo "configure: failed program was:" >&5
9312   cat conftest.$ac_ext >&5
9313   rm -rf conftest*
9314   eval "ac_cv_func_$ac_func=no"
9315 fi
9316 rm -f conftest*
9317
9318 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9319   echo "$ac_t""yes" 1>&6
9320     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9321   { test "$extra_verbose" = "yes" && cat << EOF
9322     Defining $ac_tr_func
9323 EOF
9324 cat >> confdefs.h <<EOF
9325 #define $ac_tr_func 1
9326 EOF
9327 }
9328  
9329 else
9330   echo "$ac_t""no" 1>&6
9331 fi
9332 done
9333
9334 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9335 echo "configure:9336: checking whether getpgrp takes no argument" >&5
9336
9337 cat > conftest.$ac_ext <<EOF
9338 #line 9339 "configure"
9339 #include "confdefs.h"
9340
9341 /*
9342  * If this system has a BSD-style getpgrp(),
9343  * which takes a pid argument, exit unsuccessfully.
9344  *
9345  * Snarfed from Chet Ramey's bash pgrp.c test program
9346  */
9347 #include <stdio.h>
9348 #include <sys/types.h>
9349
9350 int     pid;
9351 int     pg1, pg2, pg3, pg4;
9352 int     ng, np, s, child;
9353
9354 main()
9355 {
9356         pid = getpid();
9357         pg1 = getpgrp(0);
9358         pg2 = getpgrp();
9359         pg3 = getpgrp(pid);
9360         pg4 = getpgrp(1);
9361
9362         /*
9363          * If all of these values are the same, it's pretty sure that
9364          * we're on a system that ignores getpgrp's first argument.
9365          */
9366         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9367                 exit(0);
9368
9369         child = fork();
9370         if (child < 0)
9371                 exit(1);
9372         else if (child == 0) {
9373                 np = getpid();
9374                 /*
9375                  * If this is Sys V, this will not work; pgrp will be
9376                  * set to np because setpgrp just changes a pgrp to be
9377                  * the same as the pid.
9378                  */
9379                 setpgrp(np, pg1);
9380                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9381                 if (ng == pg1) {
9382                         exit(1);
9383                 } else {
9384                         exit(0);
9385                 }
9386         } else {
9387                 wait(&s);
9388                 exit(s>>8);
9389         }
9390 }
9391
9392 EOF
9393 if { (eval echo configure:9394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9394 then
9395   ac_cv_func_getpgrp_void=yes
9396 else
9397   conftest_rc="$?"
9398   echo "configure: failed program was:" >&5
9399   cat conftest.$ac_ext >&5
9400   rm -fr conftest*
9401   ac_cv_func_getpgrp_void=no
9402 fi
9403 rm -fr conftest*
9404
9405
9406 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9407 if test $ac_cv_func_getpgrp_void = yes; then
9408   { test "$extra_verbose" = "yes" && cat << \EOF
9409     Defining GETPGRP_VOID
9410 EOF
9411 cat >> confdefs.h <<\EOF
9412 #define GETPGRP_VOID 1
9413 EOF
9414 }
9415
9416 fi
9417
9418
9419 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9420 echo "configure:9421: checking for working mmap" >&5
9421 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9422 cat > conftest.$ac_ext <<EOF
9423 #line 9424 "configure"
9424 #include "confdefs.h"
9425 #include <stdio.h>
9426 #include <unistd.h>
9427 #include <fcntl.h>
9428 #include <sys/mman.h>
9429
9430 #ifndef MAP_VARIABLE
9431 #define MAP_VARIABLE 0
9432 #endif
9433
9434 #ifndef MAP_FAILED
9435 #define MAP_FAILED -1
9436 #endif
9437
9438 int main (int argc, char *argv[])
9439 {
9440   int fd = -1;
9441   caddr_t p;
9442 #ifndef MAP_ANONYMOUS
9443   fd = open ("/dev/zero", O_RDWR);
9444   if (fd < 0)
9445     return 1;
9446 #define MAP_ANONYMOUS 0
9447 #endif
9448   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9449            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9450            fd, 0) != (void *) MAP_FAILED)
9451     return 0;
9452   perror ("conftest: mmap failed");
9453   return 1;
9454 }
9455 EOF
9456 if { (eval echo configure:9457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9457 then
9458   have_mmap=yes
9459 else
9460   conftest_rc="$?"
9461   echo "configure: failed program was:" >&5
9462   cat conftest.$ac_ext >&5
9463   rm -fr conftest*
9464   have_mmap=no
9465 fi
9466 rm -fr conftest* ;;
9467 esac
9468 echo "$ac_t""$have_mmap" 1>&6
9469 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9470     Defining HAVE_MMAP
9471 EOF
9472 cat >> confdefs.h <<\EOF
9473 #define HAVE_MMAP 1
9474 EOF
9475 }
9476
9477 for ac_hdr in unistd.h
9478 do
9479 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9480 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9481 echo "configure:9482: checking for $ac_hdr" >&5
9482
9483 cat > conftest.$ac_ext <<EOF
9484 #line 9485 "configure"
9485 #include "confdefs.h"
9486 #include <$ac_hdr>
9487 EOF
9488 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9489 { (eval echo configure:9490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9490 ac_err=`grep -v '^ *+' conftest.out`
9491 if test -z "$ac_err"; then
9492   rm -rf conftest*
9493   eval "ac_cv_header_$ac_safe=yes"
9494 else
9495   echo "$ac_err" >&5
9496   echo "configure: failed program was:" >&5
9497   cat conftest.$ac_ext >&5
9498   rm -rf conftest*
9499   eval "ac_cv_header_$ac_safe=no"
9500 fi
9501 rm -f conftest*
9502 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9503   echo "$ac_t""yes" 1>&6
9504     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9505   { test "$extra_verbose" = "yes" && cat << EOF
9506     Defining $ac_tr_hdr
9507 EOF
9508 cat >> confdefs.h <<EOF
9509 #define $ac_tr_hdr 1
9510 EOF
9511 }
9512  
9513 else
9514   echo "$ac_t""no" 1>&6
9515 fi
9516 done
9517
9518 for ac_func in getpagesize
9519 do
9520 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9521 echo "configure:9522: checking for $ac_func" >&5
9522
9523 cat > conftest.$ac_ext <<EOF
9524 #line 9525 "configure"
9525 #include "confdefs.h"
9526 /* System header to define __stub macros and hopefully few prototypes,
9527     which can conflict with char $ac_func(); below.  */
9528 #include <assert.h>
9529 /* Override any gcc2 internal prototype to avoid an error.  */
9530 /* We use char because int might match the return type of a gcc2
9531     builtin and then its argument prototype would still apply.  */
9532 char $ac_func();
9533
9534 int main() {
9535
9536 /* The GNU C library defines this for functions which it implements
9537     to always fail with ENOSYS.  Some functions are actually named
9538     something starting with __ and the normal name is an alias.  */
9539 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9540 choke me
9541 #else
9542 $ac_func();
9543 #endif
9544
9545 ; return 0; }
9546 EOF
9547 if { (eval echo configure:9548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9548   rm -rf conftest*
9549   eval "ac_cv_func_$ac_func=yes"
9550 else
9551   echo "configure: failed program was:" >&5
9552   cat conftest.$ac_ext >&5
9553   rm -rf conftest*
9554   eval "ac_cv_func_$ac_func=no"
9555 fi
9556 rm -f conftest*
9557
9558 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9559   echo "$ac_t""yes" 1>&6
9560     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9561   { test "$extra_verbose" = "yes" && cat << EOF
9562     Defining $ac_tr_func
9563 EOF
9564 cat >> confdefs.h <<EOF
9565 #define $ac_tr_func 1
9566 EOF
9567 }
9568  
9569 else
9570   echo "$ac_t""no" 1>&6
9571 fi
9572 done
9573
9574 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9575 echo "configure:9576: checking for working mmap" >&5
9576
9577 cat > conftest.$ac_ext <<EOF
9578 #line 9579 "configure"
9579 #include "confdefs.h"
9580
9581 /* Thanks to Mike Haertel and Jim Avera for this test.
9582    Here is a matrix of mmap possibilities:
9583         mmap private not fixed
9584         mmap private fixed at somewhere currently unmapped
9585         mmap private fixed at somewhere already mapped
9586         mmap shared not fixed
9587         mmap shared fixed at somewhere currently unmapped
9588         mmap shared fixed at somewhere already mapped
9589    For private mappings, we should verify that changes cannot be read()
9590    back from the file, nor mmap's back from the file at a different
9591    address.  (There have been systems where private was not correctly
9592    implemented like the infamous i386 svr4.0, and systems where the
9593    VM page cache was not coherent with the filesystem buffer cache
9594    like early versions of FreeBSD and possibly contemporary NetBSD.)
9595    For shared mappings, we should conversely verify that changes get
9596    propogated back to all the places they're supposed to be.
9597
9598    Grep wants private fixed already mapped.
9599    The main things grep needs to know about mmap are:
9600    * does it exist and is it safe to write into the mmap'd area
9601    * how to use it (BSD variants)  */
9602 #include <sys/types.h>
9603 #include <fcntl.h>
9604 #include <sys/mman.h>
9605
9606 /* This mess was copied from the GNU getpagesize.h.  */
9607 #ifndef HAVE_GETPAGESIZE
9608 # ifdef HAVE_UNISTD_H
9609 #  include <unistd.h>
9610 # endif
9611
9612 /* Assume that all systems that can run configure have sys/param.h.  */
9613 # ifndef HAVE_SYS_PARAM_H
9614 #  define HAVE_SYS_PARAM_H 1
9615 # endif
9616
9617 # ifdef _SC_PAGESIZE
9618 #  define getpagesize() sysconf(_SC_PAGESIZE)
9619 # else /* no _SC_PAGESIZE */
9620 #  ifdef HAVE_SYS_PARAM_H
9621 #   include <sys/param.h>
9622 #   ifdef EXEC_PAGESIZE
9623 #    define getpagesize() EXEC_PAGESIZE
9624 #   else /* no EXEC_PAGESIZE */
9625 #    ifdef NBPG
9626 #     define getpagesize() NBPG * CLSIZE
9627 #     ifndef CLSIZE
9628 #      define CLSIZE 1
9629 #     endif /* no CLSIZE */
9630 #    else /* no NBPG */
9631 #     ifdef NBPC
9632 #      define getpagesize() NBPC
9633 #     else /* no NBPC */
9634 #      ifdef PAGESIZE
9635 #       define getpagesize() PAGESIZE
9636 #      endif /* PAGESIZE */
9637 #     endif /* no NBPC */
9638 #    endif /* no NBPG */
9639 #   endif /* no EXEC_PAGESIZE */
9640 #  else /* no HAVE_SYS_PARAM_H */
9641 #   define getpagesize() 8192   /* punt totally */
9642 #  endif /* no HAVE_SYS_PARAM_H */
9643 # endif /* no _SC_PAGESIZE */
9644
9645 #endif /* no HAVE_GETPAGESIZE */
9646
9647 #ifdef __cplusplus
9648 extern "C" { void *malloc(unsigned); }
9649 #else
9650 char *malloc();
9651 #endif
9652
9653 int
9654 main()
9655 {
9656         char *data, *data2, *data3;
9657         int i, pagesize;
9658         int fd;
9659
9660         pagesize = getpagesize();
9661
9662         /*
9663          * First, make a file with some known garbage in it.
9664          */
9665         data = malloc(pagesize);
9666         if (!data)
9667                 exit(1);
9668         for (i = 0; i < pagesize; ++i)
9669                 *(data + i) = rand();
9670         umask(0);
9671         fd = creat("conftestmmap", 0600);
9672         if (fd < 0)
9673                 exit(1);
9674         if (write(fd, data, pagesize) != pagesize)
9675                 exit(1);
9676         close(fd);
9677
9678         /*
9679          * Next, try to mmap the file at a fixed address which
9680          * already has something else allocated at it.  If we can,
9681          * also make sure that we see the same garbage.
9682          */
9683         fd = open("conftestmmap", O_RDWR);
9684         if (fd < 0)
9685                 exit(1);
9686         data2 = malloc(2 * pagesize);
9687         if (!data2)
9688                 exit(1);
9689         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
9690         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
9691             MAP_PRIVATE | MAP_FIXED, fd, 0L))
9692                 exit(1);
9693         for (i = 0; i < pagesize; ++i)
9694                 if (*(data + i) != *(data2 + i))
9695                         exit(1);
9696
9697         /*
9698          * Finally, make sure that changes to the mapped area
9699          * do not percolate back to the file as seen by read().
9700          * (This is a bug on some variants of i386 svr4.0.)
9701          */
9702         for (i = 0; i < pagesize; ++i)
9703                 *(data2 + i) = *(data2 + i) + 1;
9704         data3 = malloc(pagesize);
9705         if (!data3)
9706                 exit(1);
9707         if (read(fd, data3, pagesize) != pagesize)
9708                 exit(1);
9709         for (i = 0; i < pagesize; ++i)
9710                 if (*(data + i) != *(data3 + i))
9711                         exit(1);
9712         close(fd);
9713         unlink("conftestmmap");
9714         exit(0);
9715 }
9716
9717 EOF
9718 if { (eval echo configure:9719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9719 then
9720   ac_cv_func_mmap_fixed_mapped=yes
9721 else
9722   conftest_rc="$?"
9723   echo "configure: failed program was:" >&5
9724   cat conftest.$ac_ext >&5
9725   rm -fr conftest*
9726   ac_cv_func_mmap_fixed_mapped=no
9727 fi
9728 rm -fr conftest*
9729
9730 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
9731 if test $ac_cv_func_mmap_fixed_mapped = yes; then
9732   { test "$extra_verbose" = "yes" && cat << \EOF
9733     Defining HAVE_MMAP
9734 EOF
9735 cat >> confdefs.h <<\EOF
9736 #define HAVE_MMAP 1
9737 EOF
9738 }
9739
9740 fi
9741
9742
9743 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9744 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9745 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9746     Defining REL_ALLOC
9747 EOF
9748 cat >> confdefs.h <<\EOF
9749 #define REL_ALLOC 1
9750 EOF
9751 }
9752
9753
9754 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
9755 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
9756 echo "configure:9757: checking for termios.h" >&5
9757
9758 cat > conftest.$ac_ext <<EOF
9759 #line 9760 "configure"
9760 #include "confdefs.h"
9761 #include <termios.h>
9762 EOF
9763 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9764 { (eval echo configure:9765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9765 ac_err=`grep -v '^ *+' conftest.out`
9766 if test -z "$ac_err"; then
9767   rm -rf conftest*
9768   eval "ac_cv_header_$ac_safe=yes"
9769 else
9770   echo "$ac_err" >&5
9771   echo "configure: failed program was:" >&5
9772   cat conftest.$ac_ext >&5
9773   rm -rf conftest*
9774   eval "ac_cv_header_$ac_safe=no"
9775 fi
9776 rm -f conftest*
9777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9778   echo "$ac_t""yes" 1>&6
9779   { test "$extra_verbose" = "yes" && cat << \EOF
9780     Defining HAVE_TERMIOS
9781 EOF
9782 cat >> confdefs.h <<\EOF
9783 #define HAVE_TERMIOS 1
9784 EOF
9785 }
9786
9787   { test "$extra_verbose" = "yes" && cat << \EOF
9788     Defining SIGNALS_VIA_CHARACTERS
9789 EOF
9790 cat >> confdefs.h <<\EOF
9791 #define SIGNALS_VIA_CHARACTERS 1
9792 EOF
9793 }
9794
9795   { test "$extra_verbose" = "yes" && cat << \EOF
9796     Defining NO_TERMIO
9797 EOF
9798 cat >> confdefs.h <<\EOF
9799 #define NO_TERMIO 1
9800 EOF
9801 }
9802
9803 else
9804   echo "$ac_t""no" 1>&6
9805 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
9806 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
9807 echo "configure:9808: checking for termio.h" >&5
9808
9809 cat > conftest.$ac_ext <<EOF
9810 #line 9811 "configure"
9811 #include "confdefs.h"
9812 #include <termio.h>
9813 EOF
9814 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9815 { (eval echo configure:9816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9816 ac_err=`grep -v '^ *+' conftest.out`
9817 if test -z "$ac_err"; then
9818   rm -rf conftest*
9819   eval "ac_cv_header_$ac_safe=yes"
9820 else
9821   echo "$ac_err" >&5
9822   echo "configure: failed program was:" >&5
9823   cat conftest.$ac_ext >&5
9824   rm -rf conftest*
9825   eval "ac_cv_header_$ac_safe=no"
9826 fi
9827 rm -f conftest*
9828 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9829   echo "$ac_t""yes" 1>&6
9830   { test "$extra_verbose" = "yes" && cat << \EOF
9831     Defining HAVE_TERMIO
9832 EOF
9833 cat >> confdefs.h <<\EOF
9834 #define HAVE_TERMIO 1
9835 EOF
9836 }
9837
9838 else
9839   echo "$ac_t""no" 1>&6
9840 fi
9841
9842 fi
9843
9844
9845
9846 echo $ac_n "checking for socket""... $ac_c" 1>&6
9847 echo "configure:9848: checking for socket" >&5
9848
9849 cat > conftest.$ac_ext <<EOF
9850 #line 9851 "configure"
9851 #include "confdefs.h"
9852 /* System header to define __stub macros and hopefully few prototypes,
9853     which can conflict with char socket(); below.  */
9854 #include <assert.h>
9855 /* Override any gcc2 internal prototype to avoid an error.  */
9856 /* We use char because int might match the return type of a gcc2
9857     builtin and then its argument prototype would still apply.  */
9858 char socket();
9859
9860 int main() {
9861
9862 /* The GNU C library defines this for functions which it implements
9863     to always fail with ENOSYS.  Some functions are actually named
9864     something starting with __ and the normal name is an alias.  */
9865 #if defined (__stub_socket) || defined (__stub___socket)
9866 choke me
9867 #else
9868 socket();
9869 #endif
9870
9871 ; return 0; }
9872 EOF
9873 if { (eval echo configure:9874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9874   rm -rf conftest*
9875   eval "ac_cv_func_socket=yes"
9876 else
9877   echo "configure: failed program was:" >&5
9878   cat conftest.$ac_ext >&5
9879   rm -rf conftest*
9880   eval "ac_cv_func_socket=no"
9881 fi
9882 rm -f conftest*
9883
9884 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9885   echo "$ac_t""yes" 1>&6
9886   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
9887 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
9888 echo "configure:9889: checking for netinet/in.h" >&5
9889
9890 cat > conftest.$ac_ext <<EOF
9891 #line 9892 "configure"
9892 #include "confdefs.h"
9893 #include <netinet/in.h>
9894 EOF
9895 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9896 { (eval echo configure:9897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9897 ac_err=`grep -v '^ *+' conftest.out`
9898 if test -z "$ac_err"; then
9899   rm -rf conftest*
9900   eval "ac_cv_header_$ac_safe=yes"
9901 else
9902   echo "$ac_err" >&5
9903   echo "configure: failed program was:" >&5
9904   cat conftest.$ac_ext >&5
9905   rm -rf conftest*
9906   eval "ac_cv_header_$ac_safe=no"
9907 fi
9908 rm -f conftest*
9909 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9910   echo "$ac_t""yes" 1>&6
9911   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
9912 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
9913 echo "configure:9914: checking for arpa/inet.h" >&5
9914
9915 cat > conftest.$ac_ext <<EOF
9916 #line 9917 "configure"
9917 #include "confdefs.h"
9918 #include <arpa/inet.h>
9919 EOF
9920 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9921 { (eval echo configure:9922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9922 ac_err=`grep -v '^ *+' conftest.out`
9923 if test -z "$ac_err"; then
9924   rm -rf conftest*
9925   eval "ac_cv_header_$ac_safe=yes"
9926 else
9927   echo "$ac_err" >&5
9928   echo "configure: failed program was:" >&5
9929   cat conftest.$ac_ext >&5
9930   rm -rf conftest*
9931   eval "ac_cv_header_$ac_safe=no"
9932 fi
9933 rm -f conftest*
9934 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9935   echo "$ac_t""yes" 1>&6
9936   
9937   { test "$extra_verbose" = "yes" && cat << \EOF
9938     Defining HAVE_SOCKETS
9939 EOF
9940 cat >> confdefs.h <<\EOF
9941 #define HAVE_SOCKETS 1
9942 EOF
9943 }
9944
9945       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
9946 echo "configure:9947: checking "for sun_len member in struct sockaddr_un"" >&5
9947       cat > conftest.$ac_ext <<EOF
9948 #line 9949 "configure"
9949 #include "confdefs.h"
9950
9951 #include <sys/types.h>
9952 #include <sys/socket.h>
9953 #include <sys/un.h>
9954       
9955 int main() {
9956 static struct sockaddr_un x; x.sun_len = 1;
9957 ; return 0; }
9958 EOF
9959 if { (eval echo configure:9960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9960   rm -rf conftest*
9961   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
9962     Defining HAVE_SOCKADDR_SUN_LEN
9963 EOF
9964 cat >> confdefs.h <<\EOF
9965 #define HAVE_SOCKADDR_SUN_LEN 1
9966 EOF
9967 }
9968
9969 else
9970   echo "configure: failed program was:" >&5
9971   cat conftest.$ac_ext >&5
9972   rm -rf conftest*
9973   echo "$ac_t""no" 1>&6
9974 fi
9975 rm -f conftest*
9976       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
9977 echo "configure:9978: checking "for ip_mreq struct in netinet/in.h"" >&5
9978       cat > conftest.$ac_ext <<EOF
9979 #line 9980 "configure"
9980 #include "confdefs.h"
9981
9982 #include <sys/types.h>
9983 #include <netinet/in.h>
9984       
9985 int main() {
9986 static struct ip_mreq x;
9987 ; return 0; }
9988 EOF
9989 if { (eval echo configure:9990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9990   rm -rf conftest*
9991   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
9992     Defining HAVE_MULTICAST
9993 EOF
9994 cat >> confdefs.h <<\EOF
9995 #define HAVE_MULTICAST 1
9996 EOF
9997 }
9998
9999 else
10000   echo "configure: failed program was:" >&5
10001   cat conftest.$ac_ext >&5
10002   rm -rf conftest*
10003   echo "$ac_t""no" 1>&6
10004 fi
10005 rm -f conftest*
10006 else
10007   echo "$ac_t""no" 1>&6
10008 fi
10009
10010 else
10011   echo "$ac_t""no" 1>&6
10012 fi
10013
10014 else
10015   echo "$ac_t""no" 1>&6
10016 fi
10017
10018
10019 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10020 echo "configure:10021: checking for msgget" >&5
10021
10022 cat > conftest.$ac_ext <<EOF
10023 #line 10024 "configure"
10024 #include "confdefs.h"
10025 /* System header to define __stub macros and hopefully few prototypes,
10026     which can conflict with char msgget(); below.  */
10027 #include <assert.h>
10028 /* Override any gcc2 internal prototype to avoid an error.  */
10029 /* We use char because int might match the return type of a gcc2
10030     builtin and then its argument prototype would still apply.  */
10031 char msgget();
10032
10033 int main() {
10034
10035 /* The GNU C library defines this for functions which it implements
10036     to always fail with ENOSYS.  Some functions are actually named
10037     something starting with __ and the normal name is an alias.  */
10038 #if defined (__stub_msgget) || defined (__stub___msgget)
10039 choke me
10040 #else
10041 msgget();
10042 #endif
10043
10044 ; return 0; }
10045 EOF
10046 if { (eval echo configure:10047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10047   rm -rf conftest*
10048   eval "ac_cv_func_msgget=yes"
10049 else
10050   echo "configure: failed program was:" >&5
10051   cat conftest.$ac_ext >&5
10052   rm -rf conftest*
10053   eval "ac_cv_func_msgget=no"
10054 fi
10055 rm -f conftest*
10056
10057 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10058   echo "$ac_t""yes" 1>&6
10059   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10060 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10061 echo "configure:10062: checking for sys/ipc.h" >&5
10062
10063 cat > conftest.$ac_ext <<EOF
10064 #line 10065 "configure"
10065 #include "confdefs.h"
10066 #include <sys/ipc.h>
10067 EOF
10068 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10069 { (eval echo configure:10070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10070 ac_err=`grep -v '^ *+' conftest.out`
10071 if test -z "$ac_err"; then
10072   rm -rf conftest*
10073   eval "ac_cv_header_$ac_safe=yes"
10074 else
10075   echo "$ac_err" >&5
10076   echo "configure: failed program was:" >&5
10077   cat conftest.$ac_ext >&5
10078   rm -rf conftest*
10079   eval "ac_cv_header_$ac_safe=no"
10080 fi
10081 rm -f conftest*
10082 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10083   echo "$ac_t""yes" 1>&6
10084   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10085 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10086 echo "configure:10087: checking for sys/msg.h" >&5
10087
10088 cat > conftest.$ac_ext <<EOF
10089 #line 10090 "configure"
10090 #include "confdefs.h"
10091 #include <sys/msg.h>
10092 EOF
10093 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10094 { (eval echo configure:10095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10095 ac_err=`grep -v '^ *+' conftest.out`
10096 if test -z "$ac_err"; then
10097   rm -rf conftest*
10098   eval "ac_cv_header_$ac_safe=yes"
10099 else
10100   echo "$ac_err" >&5
10101   echo "configure: failed program was:" >&5
10102   cat conftest.$ac_ext >&5
10103   rm -rf conftest*
10104   eval "ac_cv_header_$ac_safe=no"
10105 fi
10106 rm -f conftest*
10107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10108   echo "$ac_t""yes" 1>&6
10109   { test "$extra_verbose" = "yes" && cat << \EOF
10110     Defining HAVE_SYSVIPC
10111 EOF
10112 cat >> confdefs.h <<\EOF
10113 #define HAVE_SYSVIPC 1
10114 EOF
10115 }
10116
10117 else
10118   echo "$ac_t""no" 1>&6
10119 fi
10120
10121 else
10122   echo "$ac_t""no" 1>&6
10123 fi
10124
10125 else
10126   echo "$ac_t""no" 1>&6
10127 fi
10128
10129
10130 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10131 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10132 echo "configure:10133: checking for dirent.h" >&5
10133
10134 cat > conftest.$ac_ext <<EOF
10135 #line 10136 "configure"
10136 #include "confdefs.h"
10137 #include <dirent.h>
10138 EOF
10139 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10140 { (eval echo configure:10141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10141 ac_err=`grep -v '^ *+' conftest.out`
10142 if test -z "$ac_err"; then
10143   rm -rf conftest*
10144   eval "ac_cv_header_$ac_safe=yes"
10145 else
10146   echo "$ac_err" >&5
10147   echo "configure: failed program was:" >&5
10148   cat conftest.$ac_ext >&5
10149   rm -rf conftest*
10150   eval "ac_cv_header_$ac_safe=no"
10151 fi
10152 rm -f conftest*
10153 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10154   echo "$ac_t""yes" 1>&6
10155   { test "$extra_verbose" = "yes" && cat << \EOF
10156     Defining SYSV_SYSTEM_DIR
10157 EOF
10158 cat >> confdefs.h <<\EOF
10159 #define SYSV_SYSTEM_DIR 1
10160 EOF
10161 }
10162
10163 else
10164   echo "$ac_t""no" 1>&6
10165 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10166 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10167 echo "configure:10168: checking for sys/dir.h" >&5
10168
10169 cat > conftest.$ac_ext <<EOF
10170 #line 10171 "configure"
10171 #include "confdefs.h"
10172 #include <sys/dir.h>
10173 EOF
10174 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10175 { (eval echo configure:10176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10176 ac_err=`grep -v '^ *+' conftest.out`
10177 if test -z "$ac_err"; then
10178   rm -rf conftest*
10179   eval "ac_cv_header_$ac_safe=yes"
10180 else
10181   echo "$ac_err" >&5
10182   echo "configure: failed program was:" >&5
10183   cat conftest.$ac_ext >&5
10184   rm -rf conftest*
10185   eval "ac_cv_header_$ac_safe=no"
10186 fi
10187 rm -f conftest*
10188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10189   echo "$ac_t""yes" 1>&6
10190   :
10191 else
10192   echo "$ac_t""no" 1>&6
10193 { test "$extra_verbose" = "yes" && cat << \EOF
10194     Defining NONSYSTEM_DIR_LIBRARY
10195 EOF
10196 cat >> confdefs.h <<\EOF
10197 #define NONSYSTEM_DIR_LIBRARY 1
10198 EOF
10199 }
10200
10201 fi
10202
10203 fi
10204
10205
10206 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10207 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10208 echo "configure:10209: checking for nlist.h" >&5
10209
10210 cat > conftest.$ac_ext <<EOF
10211 #line 10212 "configure"
10212 #include "confdefs.h"
10213 #include <nlist.h>
10214 EOF
10215 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10216 { (eval echo configure:10217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10217 ac_err=`grep -v '^ *+' conftest.out`
10218 if test -z "$ac_err"; then
10219   rm -rf conftest*
10220   eval "ac_cv_header_$ac_safe=yes"
10221 else
10222   echo "$ac_err" >&5
10223   echo "configure: failed program was:" >&5
10224   cat conftest.$ac_ext >&5
10225   rm -rf conftest*
10226   eval "ac_cv_header_$ac_safe=no"
10227 fi
10228 rm -f conftest*
10229 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10230   echo "$ac_t""yes" 1>&6
10231   { test "$extra_verbose" = "yes" && cat << \EOF
10232     Defining NLIST_STRUCT
10233 EOF
10234 cat >> confdefs.h <<\EOF
10235 #define NLIST_STRUCT 1
10236 EOF
10237 }
10238
10239 else
10240   echo "$ac_t""no" 1>&6
10241 fi
10242
10243
10244
10245 echo "checking "for sound support"" 1>&6
10246 echo "configure:10247: checking "for sound support"" >&5
10247 case "$with_sound" in
10248   native | both ) with_native_sound=yes;;
10249   nas    | no   ) with_native_sound=no;;
10250 esac
10251 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10252
10253 if test "$with_native_sound" != "no"; then
10254     if test -n "$native_sound_lib"; then
10255     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10256 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10257 echo "configure:10258: checking for multimedia/audio_device.h" >&5
10258
10259 cat > conftest.$ac_ext <<EOF
10260 #line 10261 "configure"
10261 #include "confdefs.h"
10262 #include <multimedia/audio_device.h>
10263 EOF
10264 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10265 { (eval echo configure:10266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10266 ac_err=`grep -v '^ *+' conftest.out`
10267 if test -z "$ac_err"; then
10268   rm -rf conftest*
10269   eval "ac_cv_header_$ac_safe=yes"
10270 else
10271   echo "$ac_err" >&5
10272   echo "configure: failed program was:" >&5
10273   cat conftest.$ac_ext >&5
10274   rm -rf conftest*
10275   eval "ac_cv_header_$ac_safe=no"
10276 fi
10277 rm -f conftest*
10278 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10279   echo "$ac_t""yes" 1>&6
10280   sound_found=yes sound_cflags=""
10281       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10282    echo "    xemacs will be linked with \"sunplay.o\""
10283  fi
10284 else
10285   echo "$ac_t""no" 1>&6
10286 fi
10287
10288   fi
10289
10290     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10291     sound_found=yes
10292     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10293    echo "    xemacs will be linked with \"sunplay.o\""
10294  fi
10295     if test -d "/usr/demo/SOUND/include"
10296       then sound_cflags="-I/usr/demo/SOUND/include"
10297       else sound_cflags="-I/usr/demo/SOUND"
10298     fi
10299     if test -z "$native_sound_lib" ; then
10300       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10301         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10302         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10303       fi
10304     fi
10305   fi
10306
10307     if test -z "$sound_found"; then
10308     case "$canonical" in
10309     *-sgi-* )
10310       if test -z "$native_sound_lib"; then
10311         
10312 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10313 echo "configure:10314: checking for ALopenport in -laudio" >&5
10314 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10315
10316 xe_check_libs=" -laudio "
10317 cat > conftest.$ac_ext <<EOF
10318 #line 10319 "configure"
10319 #include "confdefs.h"
10320 /* Override any gcc2 internal prototype to avoid an error.  */
10321 /* We use char because int might match the return type of a gcc2
10322     builtin and then its argument prototype would still apply.  */
10323 char ALopenport();
10324
10325 int main() {
10326 ALopenport()
10327 ; return 0; }
10328 EOF
10329 if { (eval echo configure:10330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10330   rm -rf conftest*
10331   eval "ac_cv_lib_$ac_lib_var=yes"
10332 else
10333   echo "configure: failed program was:" >&5
10334   cat conftest.$ac_ext >&5
10335   rm -rf conftest*
10336   eval "ac_cv_lib_$ac_lib_var=no"
10337 fi
10338 rm -f conftest*
10339 xe_check_libs=""
10340
10341 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10342   echo "$ac_t""yes" 1>&6
10343   native_sound_lib="-laudio"
10344 else
10345   echo "$ac_t""no" 1>&6
10346 fi
10347
10348
10349       fi
10350       if test -n "$native_sound_lib"; then
10351         sound_found=yes sound_cflags=""
10352         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10353    echo "    xemacs will be linked with \"sgiplay.o\""
10354  fi
10355       fi ;;
10356     hppa*-hp-hpux* )
10357       if test -z "$native_sound_lib"; then
10358         
10359 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10360 echo "configure:10361: checking for AOpenAudio in -lAlib" >&5
10361 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10362
10363 xe_check_libs=" -lAlib "
10364 cat > conftest.$ac_ext <<EOF
10365 #line 10366 "configure"
10366 #include "confdefs.h"
10367 /* Override any gcc2 internal prototype to avoid an error.  */
10368 /* We use char because int might match the return type of a gcc2
10369     builtin and then its argument prototype would still apply.  */
10370 char AOpenAudio();
10371
10372 int main() {
10373 AOpenAudio()
10374 ; return 0; }
10375 EOF
10376 if { (eval echo configure:10377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10377   rm -rf conftest*
10378   eval "ac_cv_lib_$ac_lib_var=yes"
10379 else
10380   echo "configure: failed program was:" >&5
10381   cat conftest.$ac_ext >&5
10382   rm -rf conftest*
10383   eval "ac_cv_lib_$ac_lib_var=no"
10384 fi
10385 rm -f conftest*
10386 xe_check_libs=""
10387
10388 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10389   echo "$ac_t""yes" 1>&6
10390   native_sound_lib="-lAlib"
10391 else
10392   echo "$ac_t""no" 1>&6
10393 fi
10394
10395
10396       fi
10397       if test -n "$native_sound_lib"; then
10398         sound_found=yes
10399         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10400    echo "    xemacs will be linked with \"hpplay.o\""
10401  fi
10402         if test "$GCC" = "yes" # Kludge city
10403           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10404           else sound_cflags="+e -I/usr/audio/examples"
10405         fi
10406       fi ;;
10407     esac
10408   fi
10409
10410     if test -z "$sound_found"; then
10411     for dir in "machine" "sys" "linux"; do
10412       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10413 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10414 echo "configure:10415: checking for ${dir}/soundcard.h" >&5
10415
10416 cat > conftest.$ac_ext <<EOF
10417 #line 10418 "configure"
10418 #include "confdefs.h"
10419 #include <${dir}/soundcard.h>
10420 EOF
10421 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10422 { (eval echo configure:10423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10423 ac_err=`grep -v '^ *+' conftest.out`
10424 if test -z "$ac_err"; then
10425   rm -rf conftest*
10426   eval "ac_cv_header_$ac_safe=yes"
10427 else
10428   echo "$ac_err" >&5
10429   echo "configure: failed program was:" >&5
10430   cat conftest.$ac_ext >&5
10431   rm -rf conftest*
10432   eval "ac_cv_header_$ac_safe=no"
10433 fi
10434 rm -f conftest*
10435 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10436   echo "$ac_t""yes" 1>&6
10437   sound_found=yes
10438         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10439    echo "    xemacs will be linked with \"linuxplay.o\""
10440  fi
10441         { test "$extra_verbose" = "yes" && cat << EOF
10442     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10443 EOF
10444 cat >> confdefs.h <<EOF
10445 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10446 EOF
10447 }
10448
10449         break
10450 else
10451   echo "$ac_t""no" 1>&6
10452 fi
10453
10454     done
10455   fi
10456
10457   test "$sound_found" = "yes" && with_native_sound=yes
10458 fi
10459
10460 if test -z "$with_sound"; then
10461   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10462     with_sound=native
10463   fi
10464 fi
10465
10466 if test "$with_native_sound" = "yes"; then
10467   { test "$extra_verbose" = "yes" && cat << \EOF
10468     Defining HAVE_NATIVE_SOUND
10469 EOF
10470 cat >> confdefs.h <<\EOF
10471 #define HAVE_NATIVE_SOUND 1
10472 EOF
10473 }
10474
10475   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10476 fi
10477
10478 case "$with_sound" in both | nas )
10479   { test "$extra_verbose" = "yes" && cat << \EOF
10480     Defining HAVE_NAS_SOUND
10481 EOF
10482 cat >> confdefs.h <<\EOF
10483 #define HAVE_NAS_SOUND 1
10484 EOF
10485 }
10486
10487   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10488    echo "    xemacs will be linked with \"nas.o\""
10489  fi
10490   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10491       cat > conftest.$ac_ext <<EOF
10492 #line 10493 "configure"
10493 #include "confdefs.h"
10494 #include <audio/Xtutil.h>
10495 EOF
10496 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10497   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10498   :
10499 else
10500   rm -rf conftest*
10501   { test "$extra_verbose" = "yes" && cat << \EOF
10502     Defining NAS_NO_ERROR_JUMP
10503 EOF
10504 cat >> confdefs.h <<\EOF
10505 #define NAS_NO_ERROR_JUMP 1
10506 EOF
10507 }
10508
10509 fi
10510 rm -f conftest*
10511
10512 esac
10513
10514
10515 test -z "$with_tty" && with_tty=yes
10516
10517 if test "$with_tty" = "yes"  ; then
10518   echo "checking for TTY-related features" 1>&6
10519 echo "configure:10520: checking for TTY-related features" >&5
10520   { test "$extra_verbose" = "yes" && cat << \EOF
10521     Defining HAVE_TTY
10522 EOF
10523 cat >> confdefs.h <<\EOF
10524 #define HAVE_TTY 1
10525 EOF
10526 }
10527
10528   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
10529    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\""
10530  fi
10531
10532     if test -z "$with_ncurses"; then
10533     
10534 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10535 echo "configure:10536: checking for tgetent in -lncurses" >&5
10536 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10537
10538 xe_check_libs=" -lncurses "
10539 cat > conftest.$ac_ext <<EOF
10540 #line 10541 "configure"
10541 #include "confdefs.h"
10542 /* Override any gcc2 internal prototype to avoid an error.  */
10543 /* We use char because int might match the return type of a gcc2
10544     builtin and then its argument prototype would still apply.  */
10545 char tgetent();
10546
10547 int main() {
10548 tgetent()
10549 ; return 0; }
10550 EOF
10551 if { (eval echo configure:10552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10552   rm -rf conftest*
10553   eval "ac_cv_lib_$ac_lib_var=yes"
10554 else
10555   echo "configure: failed program was:" >&5
10556   cat conftest.$ac_ext >&5
10557   rm -rf conftest*
10558   eval "ac_cv_lib_$ac_lib_var=no"
10559 fi
10560 rm -f conftest*
10561 xe_check_libs=""
10562
10563 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10564   echo "$ac_t""yes" 1>&6
10565   with_ncurses=yes
10566 else
10567   echo "$ac_t""no" 1>&6
10568 with_ncurses=no
10569 fi
10570
10571
10572   fi
10573   if test "$with_ncurses" = "yes"; then
10574     { test "$extra_verbose" = "yes" && cat << \EOF
10575     Defining HAVE_NCURSES
10576 EOF
10577 cat >> confdefs.h <<\EOF
10578 #define HAVE_NCURSES 1
10579 EOF
10580 }
10581
10582     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10583 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10584 echo "configure:10585: checking for ncurses/curses.h" >&5
10585
10586 cat > conftest.$ac_ext <<EOF
10587 #line 10588 "configure"
10588 #include "confdefs.h"
10589 #include <ncurses/curses.h>
10590 EOF
10591 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10592 { (eval echo configure:10593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10593 ac_err=`grep -v '^ *+' conftest.out`
10594 if test -z "$ac_err"; then
10595   rm -rf conftest*
10596   eval "ac_cv_header_$ac_safe=yes"
10597 else
10598   echo "$ac_err" >&5
10599   echo "configure: failed program was:" >&5
10600   cat conftest.$ac_ext >&5
10601   rm -rf conftest*
10602   eval "ac_cv_header_$ac_safe=no"
10603 fi
10604 rm -f conftest*
10605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10606   echo "$ac_t""yes" 1>&6
10607   curses_h_path=ncurses/curses.h
10608 else
10609   echo "$ac_t""no" 1>&6
10610 fi
10611
10612     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10613 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10614 echo "configure:10615: checking for ncurses/term.h" >&5
10615
10616 cat > conftest.$ac_ext <<EOF
10617 #line 10618 "configure"
10618 #include "confdefs.h"
10619 #include <ncurses/term.h>
10620 EOF
10621 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10622 { (eval echo configure:10623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10623 ac_err=`grep -v '^ *+' conftest.out`
10624 if test -z "$ac_err"; then
10625   rm -rf conftest*
10626   eval "ac_cv_header_$ac_safe=yes"
10627 else
10628   echo "$ac_err" >&5
10629   echo "configure: failed program was:" >&5
10630   cat conftest.$ac_ext >&5
10631   rm -rf conftest*
10632   eval "ac_cv_header_$ac_safe=no"
10633 fi
10634 rm -f conftest*
10635 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10636   echo "$ac_t""yes" 1>&6
10637   term_h_path=ncurses/term.h
10638 else
10639   echo "$ac_t""no" 1>&6
10640 fi
10641
10642     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10643    echo "    xemacs will be linked with \"terminfo.o\""
10644  fi
10645     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10646
10647     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10648                         save_c_switch_site="$c_switch_site"
10649       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10650       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10651 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10652 echo "configure:10653: checking for ncurses/curses.h" >&5
10653
10654 cat > conftest.$ac_ext <<EOF
10655 #line 10656 "configure"
10656 #include "confdefs.h"
10657 #include <ncurses/curses.h>
10658 EOF
10659 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10660 { (eval echo configure:10661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10661 ac_err=`grep -v '^ *+' conftest.out`
10662 if test -z "$ac_err"; then
10663   rm -rf conftest*
10664   eval "ac_cv_header_$ac_safe=yes"
10665 else
10666   echo "$ac_err" >&5
10667   echo "configure: failed program was:" >&5
10668   cat conftest.$ac_ext >&5
10669   rm -rf conftest*
10670   eval "ac_cv_header_$ac_safe=no"
10671 fi
10672 rm -f conftest*
10673 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10674   echo "$ac_t""yes" 1>&6
10675   curses_h_path=ncurses/curses.h
10676 else
10677   echo "$ac_t""no" 1>&6
10678 fi
10679
10680       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10681         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10682         else c_switch_site="$save_c_switch_site"
10683       fi
10684     fi
10685   else         if test "$have_terminfo" = "yes"; then
10686       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10687    echo "    xemacs will be linked with \"terminfo.o\""
10688  fi
10689       if test -n "$libs_termcap"; then
10690         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10691       else
10692         for lib in curses termlib termcap; do
10693           
10694 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10695 echo "configure:10696: checking for tgetent in -l$lib" >&5
10696 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10697
10698 xe_check_libs=" -l$lib "
10699 cat > conftest.$ac_ext <<EOF
10700 #line 10701 "configure"
10701 #include "confdefs.h"
10702 /* Override any gcc2 internal prototype to avoid an error.  */
10703 /* We use char because int might match the return type of a gcc2
10704     builtin and then its argument prototype would still apply.  */
10705 char tgetent();
10706
10707 int main() {
10708 tgetent()
10709 ; return 0; }
10710 EOF
10711 if { (eval echo configure:10712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10712   rm -rf conftest*
10713   eval "ac_cv_lib_$ac_lib_var=yes"
10714 else
10715   echo "configure: failed program was:" >&5
10716   cat conftest.$ac_ext >&5
10717   rm -rf conftest*
10718   eval "ac_cv_lib_$ac_lib_var=no"
10719 fi
10720 rm -f conftest*
10721 xe_check_libs=""
10722
10723 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10724   echo "$ac_t""yes" 1>&6
10725   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10726 else
10727   echo "$ac_t""no" 1>&6
10728 fi
10729
10730
10731         done
10732       fi
10733     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10734    echo "    xemacs will be linked with \"tparam.o\""
10735  fi
10736                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10737       if test -n "$libs_termcap"; then
10738         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10739       else
10740         
10741 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10742 echo "configure:10743: checking for tgetent in -lcurses" >&5
10743 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10744
10745 xe_check_libs=" -lcurses "
10746 cat > conftest.$ac_ext <<EOF
10747 #line 10748 "configure"
10748 #include "confdefs.h"
10749 /* Override any gcc2 internal prototype to avoid an error.  */
10750 /* We use char because int might match the return type of a gcc2
10751     builtin and then its argument prototype would still apply.  */
10752 char tgetent();
10753
10754 int main() {
10755 tgetent()
10756 ; return 0; }
10757 EOF
10758 if { (eval echo configure:10759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10759   rm -rf conftest*
10760   eval "ac_cv_lib_$ac_lib_var=yes"
10761 else
10762   echo "configure: failed program was:" >&5
10763   cat conftest.$ac_ext >&5
10764   rm -rf conftest*
10765   eval "ac_cv_lib_$ac_lib_var=no"
10766 fi
10767 rm -f conftest*
10768 xe_check_libs=""
10769
10770 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10771   echo "$ac_t""yes" 1>&6
10772   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
10773 else
10774   echo "$ac_t""no" 1>&6
10775 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
10776 echo "configure:10777: checking for tgetent in -ltermcap" >&5
10777 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
10778
10779 xe_check_libs=" -ltermcap "
10780 cat > conftest.$ac_ext <<EOF
10781 #line 10782 "configure"
10782 #include "confdefs.h"
10783 /* Override any gcc2 internal prototype to avoid an error.  */
10784 /* We use char because int might match the return type of a gcc2
10785     builtin and then its argument prototype would still apply.  */
10786 char tgetent();
10787
10788 int main() {
10789 tgetent()
10790 ; return 0; }
10791 EOF
10792 if { (eval echo configure:10793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10793   rm -rf conftest*
10794   eval "ac_cv_lib_$ac_lib_var=yes"
10795 else
10796   echo "configure: failed program was:" >&5
10797   cat conftest.$ac_ext >&5
10798   rm -rf conftest*
10799   eval "ac_cv_lib_$ac_lib_var=no"
10800 fi
10801 rm -f conftest*
10802 xe_check_libs=""
10803
10804 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10805   echo "$ac_t""yes" 1>&6
10806   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
10807 else
10808   echo "$ac_t""no" 1>&6
10809 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
10810    echo "    xemacs will be linked with \"termcap.o\""
10811  fi
10812 fi
10813
10814
10815 fi
10816
10817
10818       fi
10819     fi
10820   fi
10821   { test "$extra_verbose" = "yes" && cat << EOF
10822     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
10823 EOF
10824 cat >> confdefs.h <<EOF
10825 #define CURSES_H_PATH "${curses_h_path-curses.h}"
10826 EOF
10827 }
10828
10829   { test "$extra_verbose" = "yes" && cat << EOF
10830     Defining TERM_H_PATH = "${term_h_path-term.h}"
10831 EOF
10832 cat >> confdefs.h <<EOF
10833 #define TERM_H_PATH "${term_h_path-term.h}"
10834 EOF
10835 }
10836
10837
10838     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
10839 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
10840 echo "configure:10841: checking for gpm.h" >&5
10841
10842 cat > conftest.$ac_ext <<EOF
10843 #line 10844 "configure"
10844 #include "confdefs.h"
10845 #include <gpm.h>
10846 EOF
10847 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10848 { (eval echo configure:10849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10849 ac_err=`grep -v '^ *+' conftest.out`
10850 if test -z "$ac_err"; then
10851   rm -rf conftest*
10852   eval "ac_cv_header_$ac_safe=yes"
10853 else
10854   echo "$ac_err" >&5
10855   echo "configure: failed program was:" >&5
10856   cat conftest.$ac_ext >&5
10857   rm -rf conftest*
10858   eval "ac_cv_header_$ac_safe=no"
10859 fi
10860 rm -f conftest*
10861 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10862   echo "$ac_t""yes" 1>&6
10863   :
10864 else
10865   echo "$ac_t""no" 1>&6
10866 with_gpm=no
10867 fi
10868  }
10869   test -z "$with_gpm" && { 
10870 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
10871 echo "configure:10872: checking for Gpm_Open in -lgpm" >&5
10872 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
10873
10874 xe_check_libs=" -lgpm "
10875 cat > conftest.$ac_ext <<EOF
10876 #line 10877 "configure"
10877 #include "confdefs.h"
10878 /* Override any gcc2 internal prototype to avoid an error.  */
10879 /* We use char because int might match the return type of a gcc2
10880     builtin and then its argument prototype would still apply.  */
10881 char Gpm_Open();
10882
10883 int main() {
10884 Gpm_Open()
10885 ; return 0; }
10886 EOF
10887 if { (eval echo configure:10888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10888   rm -rf conftest*
10889   eval "ac_cv_lib_$ac_lib_var=yes"
10890 else
10891   echo "configure: failed program was:" >&5
10892   cat conftest.$ac_ext >&5
10893   rm -rf conftest*
10894   eval "ac_cv_lib_$ac_lib_var=no"
10895 fi
10896 rm -f conftest*
10897 xe_check_libs=""
10898
10899 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10900   echo "$ac_t""yes" 1>&6
10901   with_gpm=yes
10902 else
10903   echo "$ac_t""no" 1>&6
10904 with_gpm=no
10905 fi
10906
10907  }
10908   if test "$with_gpm" = "yes"; then
10909     { test "$extra_verbose" = "yes" && cat << \EOF
10910     Defining HAVE_GPM
10911 EOF
10912 cat >> confdefs.h <<\EOF
10913 #define HAVE_GPM 1
10914 EOF
10915 }
10916
10917     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
10918    echo "    xemacs will be linked with \"gpmevent.o\""
10919  fi
10920     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
10921   fi
10922
10923 else   for feature in ncurses gpm; do
10924     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
10925       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
10926     fi
10927     eval "with_${feature}=no"
10928   done
10929 fi 
10930 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
10931    echo "    xemacs will be linked with \"event-unixoid.o\""
10932  fi
10933
10934
10935 echo "checking for database support" 1>&6
10936 echo "configure:10937: checking for database support" >&5
10937
10938 if test "$with_database_gnudbm" != "no"; then
10939   for ac_hdr in ndbm.h
10940 do
10941 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10942 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10943 echo "configure:10944: checking for $ac_hdr" >&5
10944
10945 cat > conftest.$ac_ext <<EOF
10946 #line 10947 "configure"
10947 #include "confdefs.h"
10948 #include <$ac_hdr>
10949 EOF
10950 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10951 { (eval echo configure:10952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10952 ac_err=`grep -v '^ *+' conftest.out`
10953 if test -z "$ac_err"; then
10954   rm -rf conftest*
10955   eval "ac_cv_header_$ac_safe=yes"
10956 else
10957   echo "$ac_err" >&5
10958   echo "configure: failed program was:" >&5
10959   cat conftest.$ac_ext >&5
10960   rm -rf conftest*
10961   eval "ac_cv_header_$ac_safe=no"
10962 fi
10963 rm -f conftest*
10964 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10965   echo "$ac_t""yes" 1>&6
10966     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10967   { test "$extra_verbose" = "yes" && cat << EOF
10968     Defining $ac_tr_hdr
10969 EOF
10970 cat >> confdefs.h <<EOF
10971 #define $ac_tr_hdr 1
10972 EOF
10973 }
10974  have_ndbm_h=yes
10975 else
10976   echo "$ac_t""no" 1>&6
10977 fi
10978 done
10979
10980   if test "$have_ndbm_h" = "yes"; then
10981     
10982 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
10983 echo "configure:10984: checking for dbm_open in -lgdbm" >&5
10984 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
10985
10986 xe_check_libs=" -lgdbm "
10987 cat > conftest.$ac_ext <<EOF
10988 #line 10989 "configure"
10989 #include "confdefs.h"
10990 /* Override any gcc2 internal prototype to avoid an error.  */
10991 /* We use char because int might match the return type of a gcc2
10992     builtin and then its argument prototype would still apply.  */
10993 char dbm_open();
10994
10995 int main() {
10996 dbm_open()
10997 ; return 0; }
10998 EOF
10999 if { (eval echo configure:11000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11000   rm -rf conftest*
11001   eval "ac_cv_lib_$ac_lib_var=yes"
11002 else
11003   echo "configure: failed program was:" >&5
11004   cat conftest.$ac_ext >&5
11005   rm -rf conftest*
11006   eval "ac_cv_lib_$ac_lib_var=no"
11007 fi
11008 rm -f conftest*
11009 xe_check_libs=""
11010
11011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11012   echo "$ac_t""yes" 1>&6
11013   with_database_gnudbm=yes have_libgdbm=yes
11014 else
11015   echo "$ac_t""no" 1>&6
11016 fi
11017
11018
11019   fi
11020   if test "$with_database_gnudbm" != "yes"; then
11021     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11022 echo "configure:11023: checking for dbm_open" >&5
11023
11024 cat > conftest.$ac_ext <<EOF
11025 #line 11026 "configure"
11026 #include "confdefs.h"
11027 /* System header to define __stub macros and hopefully few prototypes,
11028     which can conflict with char dbm_open(); below.  */
11029 #include <assert.h>
11030 /* Override any gcc2 internal prototype to avoid an error.  */
11031 /* We use char because int might match the return type of a gcc2
11032     builtin and then its argument prototype would still apply.  */
11033 char dbm_open();
11034
11035 int main() {
11036
11037 /* The GNU C library defines this for functions which it implements
11038     to always fail with ENOSYS.  Some functions are actually named
11039     something starting with __ and the normal name is an alias.  */
11040 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11041 choke me
11042 #else
11043 dbm_open();
11044 #endif
11045
11046 ; return 0; }
11047 EOF
11048 if { (eval echo configure:11049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11049   rm -rf conftest*
11050   eval "ac_cv_func_dbm_open=yes"
11051 else
11052   echo "configure: failed program was:" >&5
11053   cat conftest.$ac_ext >&5
11054   rm -rf conftest*
11055   eval "ac_cv_func_dbm_open=no"
11056 fi
11057 rm -f conftest*
11058
11059 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11060   echo "$ac_t""yes" 1>&6
11061   with_database_gnudbm=yes
11062 else
11063   echo "$ac_t""no" 1>&6
11064 fi
11065
11066       fi
11067   if test "$with_database_gnudbm" = "yes"; then
11068     { test "$extra_verbose" = "yes" && cat << \EOF
11069     Defining HAVE_DBM
11070 EOF
11071 cat >> confdefs.h <<\EOF
11072 #define HAVE_DBM 1
11073 EOF
11074 }
11075
11076     test "$have_libgdbm" = "yes" && LIBS="-lgdbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgdbm\" to \$LIBS"; fi
11077     with_database_dbm=no
11078   else with_database_gnudbm=no
11079   fi
11080 fi
11081
11082 if test "$with_database_dbm" != "no"; then
11083   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11084 echo "configure:11085: checking for dbm_open" >&5
11085
11086 cat > conftest.$ac_ext <<EOF
11087 #line 11088 "configure"
11088 #include "confdefs.h"
11089 /* System header to define __stub macros and hopefully few prototypes,
11090     which can conflict with char dbm_open(); below.  */
11091 #include <assert.h>
11092 /* Override any gcc2 internal prototype to avoid an error.  */
11093 /* We use char because int might match the return type of a gcc2
11094     builtin and then its argument prototype would still apply.  */
11095 char dbm_open();
11096
11097 int main() {
11098
11099 /* The GNU C library defines this for functions which it implements
11100     to always fail with ENOSYS.  Some functions are actually named
11101     something starting with __ and the normal name is an alias.  */
11102 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11103 choke me
11104 #else
11105 dbm_open();
11106 #endif
11107
11108 ; return 0; }
11109 EOF
11110 if { (eval echo configure:11111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11111   rm -rf conftest*
11112   eval "ac_cv_func_dbm_open=yes"
11113 else
11114   echo "configure: failed program was:" >&5
11115   cat conftest.$ac_ext >&5
11116   rm -rf conftest*
11117   eval "ac_cv_func_dbm_open=no"
11118 fi
11119 rm -f conftest*
11120
11121 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11122   echo "$ac_t""yes" 1>&6
11123   with_database_dbm=yes need_libdbm=no
11124 else
11125   echo "$ac_t""no" 1>&6
11126 fi
11127
11128   if test "$need_libdbm" != "no"; then
11129     
11130 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11131 echo "configure:11132: checking for dbm_open in -ldbm" >&5
11132 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11133
11134 xe_check_libs=" -ldbm "
11135 cat > conftest.$ac_ext <<EOF
11136 #line 11137 "configure"
11137 #include "confdefs.h"
11138 /* Override any gcc2 internal prototype to avoid an error.  */
11139 /* We use char because int might match the return type of a gcc2
11140     builtin and then its argument prototype would still apply.  */
11141 char dbm_open();
11142
11143 int main() {
11144 dbm_open()
11145 ; return 0; }
11146 EOF
11147 if { (eval echo configure:11148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11148   rm -rf conftest*
11149   eval "ac_cv_lib_$ac_lib_var=yes"
11150 else
11151   echo "configure: failed program was:" >&5
11152   cat conftest.$ac_ext >&5
11153   rm -rf conftest*
11154   eval "ac_cv_lib_$ac_lib_var=no"
11155 fi
11156 rm -f conftest*
11157 xe_check_libs=""
11158
11159 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11160   echo "$ac_t""yes" 1>&6
11161   with_database_dbm=yes need_libdbm=yes
11162 else
11163   echo "$ac_t""no" 1>&6
11164 fi
11165
11166
11167   fi
11168   if test "$with_database_dbm" = "yes"; then
11169     { test "$extra_verbose" = "yes" && cat << \EOF
11170     Defining HAVE_DBM
11171 EOF
11172 cat >> confdefs.h <<\EOF
11173 #define HAVE_DBM 1
11174 EOF
11175 }
11176
11177     test "$need_libdbm" = "yes" && LIBS="-ldbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldbm\" to \$LIBS"; fi
11178   else with_database_dbm=no
11179   fi
11180 fi
11181
11182 if test "$with_database_berkdb" != "no"; then
11183   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11184 echo "configure:11185: checking for Berkeley db.h" >&5
11185   for path in "db/db.h" "db.h"; do
11186     cat > conftest.$ac_ext <<EOF
11187 #line 11188 "configure"
11188 #include "confdefs.h"
11189 #ifdef HAVE_INTTYPES_H
11190 #define __BIT_TYPES_DEFINED__
11191 #include <inttypes.h>
11192 typedef uint8_t  u_int8_t;
11193 typedef uint16_t u_int16_t;
11194 typedef uint32_t u_int32_t;
11195 #ifdef WE_DONT_NEED_QUADS
11196 typedef uint64_t u_int64_t;
11197 #endif
11198 #endif
11199 #include <$path>
11200
11201 int main() {
11202
11203 ; return 0; }
11204 EOF
11205 if { (eval echo configure:11206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11206   rm -rf conftest*
11207   db_h_path="$path"; break
11208 else
11209   echo "configure: failed program was:" >&5
11210   cat conftest.$ac_ext >&5
11211 fi
11212 rm -f conftest*
11213   done
11214   if test -z "$db_h_path"
11215   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11216   else echo "$ac_t""$db_h_path" 1>&6
11217   fi
11218
11219   if test "$with_database_berkdb" != "no"; then
11220     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11221 echo "configure:11222: checking for Berkeley DB version" >&5
11222     cat > conftest.$ac_ext <<EOF
11223 #line 11224 "configure"
11224 #include "confdefs.h"
11225 #include <$db_h_path>
11226 #if DB_VERSION_MAJOR > 1
11227 yes
11228 #endif
11229
11230 EOF
11231 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11232   egrep "yes" >/dev/null 2>&1; then
11233   rm -rf conftest*
11234   echo "$ac_t""2" 1>&6; dbfunc=db_open
11235 else
11236   rm -rf conftest*
11237   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11238 fi
11239 rm -f conftest*
11240
11241     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11242 echo "configure:11243: checking for $dbfunc" >&5
11243
11244 cat > conftest.$ac_ext <<EOF
11245 #line 11246 "configure"
11246 #include "confdefs.h"
11247 /* System header to define __stub macros and hopefully few prototypes,
11248     which can conflict with char $dbfunc(); below.  */
11249 #include <assert.h>
11250 /* Override any gcc2 internal prototype to avoid an error.  */
11251 /* We use char because int might match the return type of a gcc2
11252     builtin and then its argument prototype would still apply.  */
11253 char $dbfunc();
11254
11255 int main() {
11256
11257 /* The GNU C library defines this for functions which it implements
11258     to always fail with ENOSYS.  Some functions are actually named
11259     something starting with __ and the normal name is an alias.  */
11260 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11261 choke me
11262 #else
11263 $dbfunc();
11264 #endif
11265
11266 ; return 0; }
11267 EOF
11268 if { (eval echo configure:11269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11269   rm -rf conftest*
11270   eval "ac_cv_func_$dbfunc=yes"
11271 else
11272   echo "configure: failed program was:" >&5
11273   cat conftest.$ac_ext >&5
11274   rm -rf conftest*
11275   eval "ac_cv_func_$dbfunc=no"
11276 fi
11277 rm -f conftest*
11278
11279 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11280   echo "$ac_t""yes" 1>&6
11281   with_database_berkdb=yes need_libdb=no
11282 else
11283   echo "$ac_t""no" 1>&6
11284
11285     
11286 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11287 echo "configure:11288: checking for $dbfunc in -ldb" >&5
11288 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11289
11290 xe_check_libs=" -ldb "
11291 cat > conftest.$ac_ext <<EOF
11292 #line 11293 "configure"
11293 #include "confdefs.h"
11294 /* Override any gcc2 internal prototype to avoid an error.  */
11295 /* We use char because int might match the return type of a gcc2
11296     builtin and then its argument prototype would still apply.  */
11297 char $dbfunc();
11298
11299 int main() {
11300 $dbfunc()
11301 ; return 0; }
11302 EOF
11303 if { (eval echo configure:11304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11304   rm -rf conftest*
11305   eval "ac_cv_lib_$ac_lib_var=yes"
11306 else
11307   echo "configure: failed program was:" >&5
11308   cat conftest.$ac_ext >&5
11309   rm -rf conftest*
11310   eval "ac_cv_lib_$ac_lib_var=no"
11311 fi
11312 rm -f conftest*
11313 xe_check_libs=""
11314
11315 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11316   echo "$ac_t""yes" 1>&6
11317   with_database_berkdb=yes need_libdb=yes
11318 else
11319   echo "$ac_t""no" 1>&6
11320 fi
11321
11322
11323 fi
11324
11325   fi
11326
11327   if test "$with_database_berkdb" = "yes"; then
11328     { test "$extra_verbose" = "yes" && cat << EOF
11329     Defining DB_H_PATH = "$db_h_path"
11330 EOF
11331 cat >> confdefs.h <<EOF
11332 #define DB_H_PATH "$db_h_path"
11333 EOF
11334 }
11335
11336     { test "$extra_verbose" = "yes" && cat << \EOF
11337     Defining HAVE_BERKELEY_DB
11338 EOF
11339 cat >> confdefs.h <<\EOF
11340 #define HAVE_BERKELEY_DB 1
11341 EOF
11342 }
11343
11344     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11345   else with_database_berkdb=no
11346   fi
11347 fi
11348
11349 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11350      != "no no no"; then
11351   { test "$extra_verbose" = "yes" && cat << \EOF
11352     Defining HAVE_DATABASE
11353 EOF
11354 cat >> confdefs.h <<\EOF
11355 #define HAVE_DATABASE 1
11356 EOF
11357 }
11358
11359   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11360    echo "    xemacs will be linked with \"database.o\""
11361  fi
11362 fi
11363
11364 if test "$with_socks" = "yes"; then
11365   
11366 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11367 echo "configure:11368: checking for SOCKSinit in -lsocks" >&5
11368 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11369
11370 xe_check_libs=" -lsocks "
11371 cat > conftest.$ac_ext <<EOF
11372 #line 11373 "configure"
11373 #include "confdefs.h"
11374 /* Override any gcc2 internal prototype to avoid an error.  */
11375 /* We use char because int might match the return type of a gcc2
11376     builtin and then its argument prototype would still apply.  */
11377 char SOCKSinit();
11378
11379 int main() {
11380 SOCKSinit()
11381 ; return 0; }
11382 EOF
11383 if { (eval echo configure:11384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11384   rm -rf conftest*
11385   eval "ac_cv_lib_$ac_lib_var=yes"
11386 else
11387   echo "configure: failed program was:" >&5
11388   cat conftest.$ac_ext >&5
11389   rm -rf conftest*
11390   eval "ac_cv_lib_$ac_lib_var=no"
11391 fi
11392 rm -f conftest*
11393 xe_check_libs=""
11394
11395 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11396   echo "$ac_t""yes" 1>&6
11397     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11398     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11399   { test "$extra_verbose" = "yes" && cat << EOF
11400     Defining $ac_tr_lib
11401 EOF
11402 cat >> confdefs.h <<EOF
11403 #define $ac_tr_lib 1
11404 EOF
11405 }
11406
11407   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11408
11409 else
11410   echo "$ac_t""no" 1>&6
11411 fi
11412
11413
11414   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11415     Defining HAVE_SOCKS
11416 EOF
11417 cat >> confdefs.h <<\EOF
11418 #define HAVE_SOCKS 1
11419 EOF
11420 }
11421
11422 fi
11423
11424 if test "$usage_tracking" = "yes"; then
11425   { test "$extra_verbose" = "yes" && cat << \EOF
11426     Defining USAGE_TRACKING
11427 EOF
11428 cat >> confdefs.h <<\EOF
11429 #define USAGE_TRACKING 1
11430 EOF
11431 }
11432
11433   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11434 fi
11435
11436 test -z "$with_shlib" && test "$opsys $machine" = "cygwin32 intel386" && with_shlib=no
11437
11438 for ac_hdr in dlfcn.h
11439 do
11440 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11441 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11442 echo "configure:11443: checking for $ac_hdr" >&5
11443
11444 cat > conftest.$ac_ext <<EOF
11445 #line 11446 "configure"
11446 #include "confdefs.h"
11447 #include <$ac_hdr>
11448 EOF
11449 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11450 { (eval echo configure:11451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11451 ac_err=`grep -v '^ *+' conftest.out`
11452 if test -z "$ac_err"; then
11453   rm -rf conftest*
11454   eval "ac_cv_header_$ac_safe=yes"
11455 else
11456   echo "$ac_err" >&5
11457   echo "configure: failed program was:" >&5
11458   cat conftest.$ac_ext >&5
11459   rm -rf conftest*
11460   eval "ac_cv_header_$ac_safe=no"
11461 fi
11462 rm -f conftest*
11463 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11464   echo "$ac_t""yes" 1>&6
11465     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11466   { test "$extra_verbose" = "yes" && cat << EOF
11467     Defining $ac_tr_hdr
11468 EOF
11469 cat >> confdefs.h <<EOF
11470 #define $ac_tr_hdr 1
11471 EOF
11472 }
11473  have_dlfcn=yes
11474 else
11475   echo "$ac_t""no" 1>&6
11476 fi
11477 done
11478
11479 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11480 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11481 echo "configure:11482: checking for dlopen in -ldl" >&5
11482 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11483
11484 xe_check_libs=" -ldl "
11485 cat > conftest.$ac_ext <<EOF
11486 #line 11487 "configure"
11487 #include "confdefs.h"
11488 /* Override any gcc2 internal prototype to avoid an error.  */
11489 /* We use char because int might match the return type of a gcc2
11490     builtin and then its argument prototype would still apply.  */
11491 char dlopen();
11492
11493 int main() {
11494 dlopen()
11495 ; return 0; }
11496 EOF
11497 if { (eval echo configure:11498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11498   rm -rf conftest*
11499   eval "ac_cv_lib_$ac_lib_var=yes"
11500 else
11501   echo "configure: failed program was:" >&5
11502   cat conftest.$ac_ext >&5
11503   rm -rf conftest*
11504   eval "ac_cv_lib_$ac_lib_var=no"
11505 fi
11506 rm -f conftest*
11507 xe_check_libs=""
11508
11509 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11510   echo "$ac_t""yes" 1>&6
11511   { test "$extra_verbose" = "yes" && cat << \EOF
11512     Defining HAVE_DLOPEN
11513 EOF
11514 cat >> confdefs.h <<\EOF
11515 #define HAVE_DLOPEN 1
11516 EOF
11517 }
11518  DLL_LIB=dl;  with_shlib=yes
11519 else
11520   echo "$ac_t""no" 1>&6
11521 fi
11522
11523  }
11524 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11525 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11526 echo "configure:11527: checking for _dlopen in -lc" >&5
11527 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11528
11529 xe_check_libs=" -lc "
11530 cat > conftest.$ac_ext <<EOF
11531 #line 11532 "configure"
11532 #include "confdefs.h"
11533 /* Override any gcc2 internal prototype to avoid an error.  */
11534 /* We use char because int might match the return type of a gcc2
11535     builtin and then its argument prototype would still apply.  */
11536 char _dlopen();
11537
11538 int main() {
11539 _dlopen()
11540 ; return 0; }
11541 EOF
11542 if { (eval echo configure:11543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11543   rm -rf conftest*
11544   eval "ac_cv_lib_$ac_lib_var=yes"
11545 else
11546   echo "configure: failed program was:" >&5
11547   cat conftest.$ac_ext >&5
11548   rm -rf conftest*
11549   eval "ac_cv_lib_$ac_lib_var=no"
11550 fi
11551 rm -f conftest*
11552 xe_check_libs=""
11553
11554 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11555   echo "$ac_t""yes" 1>&6
11556   { test "$extra_verbose" = "yes" && cat << \EOF
11557     Defining HAVE_DLOPEN
11558 EOF
11559 cat >> confdefs.h <<\EOF
11560 #define HAVE_DLOPEN 1
11561 EOF
11562 }
11563  DLL_LIB=;   with_shlib=yes
11564 else
11565   echo "$ac_t""no" 1>&6
11566 fi
11567
11568  }
11569 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11570 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11571 echo "configure:11572: checking for dlopen in -lc" >&5
11572 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11573
11574 xe_check_libs=" -lc "
11575 cat > conftest.$ac_ext <<EOF
11576 #line 11577 "configure"
11577 #include "confdefs.h"
11578 /* Override any gcc2 internal prototype to avoid an error.  */
11579 /* We use char because int might match the return type of a gcc2
11580     builtin and then its argument prototype would still apply.  */
11581 char dlopen();
11582
11583 int main() {
11584 dlopen()
11585 ; return 0; }
11586 EOF
11587 if { (eval echo configure:11588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11588   rm -rf conftest*
11589   eval "ac_cv_lib_$ac_lib_var=yes"
11590 else
11591   echo "configure: failed program was:" >&5
11592   cat conftest.$ac_ext >&5
11593   rm -rf conftest*
11594   eval "ac_cv_lib_$ac_lib_var=no"
11595 fi
11596 rm -f conftest*
11597 xe_check_libs=""
11598
11599 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11600   echo "$ac_t""yes" 1>&6
11601   { test "$extra_verbose" = "yes" && cat << \EOF
11602     Defining HAVE_DLOPEN
11603 EOF
11604 cat >> confdefs.h <<\EOF
11605 #define HAVE_DLOPEN 1
11606 EOF
11607 }
11608  DLL_LIB=;   with_shlib=yes
11609 else
11610   echo "$ac_t""no" 1>&6
11611 fi
11612
11613  }
11614 test -z "$with_shlib" && { 
11615 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11616 echo "configure:11617: checking for shl_load in -ldld" >&5
11617 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11618
11619 xe_check_libs=" -ldld "
11620 cat > conftest.$ac_ext <<EOF
11621 #line 11622 "configure"
11622 #include "confdefs.h"
11623 /* Override any gcc2 internal prototype to avoid an error.  */
11624 /* We use char because int might match the return type of a gcc2
11625     builtin and then its argument prototype would still apply.  */
11626 char shl_load();
11627
11628 int main() {
11629 shl_load()
11630 ; return 0; }
11631 EOF
11632 if { (eval echo configure:11633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11633   rm -rf conftest*
11634   eval "ac_cv_lib_$ac_lib_var=yes"
11635 else
11636   echo "configure: failed program was:" >&5
11637   cat conftest.$ac_ext >&5
11638   rm -rf conftest*
11639   eval "ac_cv_lib_$ac_lib_var=no"
11640 fi
11641 rm -f conftest*
11642 xe_check_libs=""
11643
11644 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11645   echo "$ac_t""yes" 1>&6
11646   { test "$extra_verbose" = "yes" && cat << \EOF
11647     Defining HAVE_SHL_LOAD
11648 EOF
11649 cat >> confdefs.h <<\EOF
11650 #define HAVE_SHL_LOAD 1
11651 EOF
11652 }
11653  DLL_LIB=dld; with_shlib=yes
11654 else
11655   echo "$ac_t""no" 1>&6
11656 fi
11657
11658  }
11659 test -z "$with_shlib" && { 
11660 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11661 echo "configure:11662: checking for dld_init in -ldld" >&5
11662 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11663
11664 xe_check_libs=" -ldld "
11665 cat > conftest.$ac_ext <<EOF
11666 #line 11667 "configure"
11667 #include "confdefs.h"
11668 /* Override any gcc2 internal prototype to avoid an error.  */
11669 /* We use char because int might match the return type of a gcc2
11670     builtin and then its argument prototype would still apply.  */
11671 char dld_init();
11672
11673 int main() {
11674 dld_init()
11675 ; return 0; }
11676 EOF
11677 if { (eval echo configure:11678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11678   rm -rf conftest*
11679   eval "ac_cv_lib_$ac_lib_var=yes"
11680 else
11681   echo "configure: failed program was:" >&5
11682   cat conftest.$ac_ext >&5
11683   rm -rf conftest*
11684   eval "ac_cv_lib_$ac_lib_var=no"
11685 fi
11686 rm -f conftest*
11687 xe_check_libs=""
11688
11689 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11690   echo "$ac_t""yes" 1>&6
11691   { test "$extra_verbose" = "yes" && cat << \EOF
11692     Defining HAVE_DLD_INIT
11693 EOF
11694 cat >> confdefs.h <<\EOF
11695 #define HAVE_DLD_INIT 1
11696 EOF
11697 }
11698  DLL_LIB=dld; with_shlib=yes
11699 else
11700   echo "$ac_t""no" 1>&6
11701 fi
11702
11703  }
11704 if test "$with_shlib" = "yes"; then
11705   { test "$extra_verbose" = "yes" && cat << \EOF
11706     Defining HAVE_SHLIB
11707 EOF
11708 cat >> confdefs.h <<\EOF
11709 #define HAVE_SHLIB 1
11710 EOF
11711 }
11712
11713   extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
11714    echo "    xemacs will be linked with \"sysdll.o\""
11715  fi
11716   extra_objs="$extra_objs dll.o" &&  if test "$extra_verbose" = "yes"; then
11717    echo "    xemacs will be linked with \"dll.o\""
11718  fi
11719   test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
11720   
11721 dll_ld="ld"
11722 dll_lflags="-shared"
11723 dll_cflags="-r"
11724 dll_oflags="-o "
11725
11726 echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6
11727 echo "configure:11728: checking how to build a shared library" >&5
11728 case `uname -rs` in
11729         UNIX_SV*|UNIX_System_V*)
11730                 dll_lflags="-G"
11731                 dll_cflags=-Kpic
11732                 dll_ld="ld"
11733                 ;;
11734         BSD/OS*)
11735                 dll_cflags=
11736                 dll_lflags="-r"
11737                 dll_ld="shlicc2"
11738                 ;;
11739         FreeBSD*2*)
11740                 dll_lflags="-Bshareable"
11741                 dll_cflags="-fPIC -DPIC"
11742                 dll_ld=ld
11743                 ;;
11744         SunOS*4.*)
11745                 dll_cflags="-P"
11746                 dll_lflags="-dp -assert pure-text -assert nodefinitions"
11747                 ;;
11748         SunOS*5.*)
11749                 dll_ld="cc"
11750                 dll_cflags="-KPIC"
11751                 dll_lflags="-G"
11752                 dll_oflags="-W0,-y-o -W0,-y"
11753                 ;;      
11754         IRIX*5.*|IRIX*6.*)
11755                 dll_cflags="-KPIC"
11756                 ;;
11757         OSF1*)
11758                 ;;
11759         HP-UX*)
11760                 dll_ld="ld"
11761                 dll_lflags="-b"
11762                 dll_cflags="+z"
11763                 ;;
11764         SCO_SV*)
11765                 dll_ld="ld"
11766                 dll_lflags="-G"
11767                 dll_cflags="-Kpic"
11768                 ;;
11769         AIX*)
11770                 dll_lflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:\${@:.ell=.exp} -b noentry -lc"
11771                 dll_ld="ld"
11772                 ;;
11773         *)
11774                 ;;
11775         esac
11776
11777         if test "$GCC" = "yes" ; then
11778                 dll_cflags="-fPIC"
11779                 case `uname -rs` in
11780                 SunOS*5.*)
11781                         dll_ld="ld"
11782                         dll_oflags="-o "
11783                         dll_lflags="-G"
11784                         ;;
11785                 SCO_SV*)
11786                         dll_ld="ld"
11787                         dll_lflags="-G"
11788                         dll_cflags="-b elf"
11789                         ;;
11790                 FreeBSD*)
11791                         dll_cflags="-DDLSYM_NEEDS_UNDERSCORE -DPIC -fPIC"
11792                         dll_lflags="-Bshareable"
11793                         dll_ld=ld
11794                         ;;
11795                 BSD/OS*)
11796                         dll_cflags=
11797                         dll_lflags="-r"
11798                         dll_ld="shlicc2"
11799                         ;;
11800                 UNIX_SV*)
11801                         dll_cflags="-fPIC"
11802                         ;;
11803                 *)
11804                         dll_ld="$CC"
11805                         dll_lflags="-shared"
11806                 esac
11807         fi
11808
11809         echo "$ac_t"""lflags: $dll_lflags cflags: $dll_cflags"" 1>&6
11810
11811
11812
11813
11814
11815   for ac_func in dlerror
11816 do
11817 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11818 echo "configure:11819: checking for $ac_func" >&5
11819
11820 cat > conftest.$ac_ext <<EOF
11821 #line 11822 "configure"
11822 #include "confdefs.h"
11823 /* System header to define __stub macros and hopefully few prototypes,
11824     which can conflict with char $ac_func(); below.  */
11825 #include <assert.h>
11826 /* Override any gcc2 internal prototype to avoid an error.  */
11827 /* We use char because int might match the return type of a gcc2
11828     builtin and then its argument prototype would still apply.  */
11829 char $ac_func();
11830
11831 int main() {
11832
11833 /* The GNU C library defines this for functions which it implements
11834     to always fail with ENOSYS.  Some functions are actually named
11835     something starting with __ and the normal name is an alias.  */
11836 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11837 choke me
11838 #else
11839 $ac_func();
11840 #endif
11841
11842 ; return 0; }
11843 EOF
11844 if { (eval echo configure:11845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11845   rm -rf conftest*
11846   eval "ac_cv_func_$ac_func=yes"
11847 else
11848   echo "configure: failed program was:" >&5
11849   cat conftest.$ac_ext >&5
11850   rm -rf conftest*
11851   eval "ac_cv_func_$ac_func=no"
11852 fi
11853 rm -f conftest*
11854
11855 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11856   echo "$ac_t""yes" 1>&6
11857     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11858   { test "$extra_verbose" = "yes" && cat << EOF
11859     Defining $ac_tr_func
11860 EOF
11861 cat >> confdefs.h <<EOF
11862 #define $ac_tr_func 1
11863 EOF
11864 }
11865  
11866 else
11867   echo "$ac_t""no" 1>&6
11868 fi
11869 done
11870
11871   ld_dynamic_link_flags=
11872     case "$opsys" in
11873   hpux*)  ld_dynamic_link_flags="-Wl,-E" ;;
11874   linux*) ld_dynamic_link_flags="-rdynamic" ;;
11875   *) ;;
11876   esac
11877 fi
11878
11879 cat > conftest.$ac_ext <<EOF
11880 #line 11881 "configure"
11881 #include "confdefs.h"
11882 int main(int c,char *v[]){return 0;}
11883 EOF
11884 if { (eval echo configure:11885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
11885 then
11886   :
11887 else
11888   conftest_rc="$?"
11889   echo "configure: failed program was:" >&5
11890   cat conftest.$ac_ext >&5
11891   rm -fr conftest*
11892   
11893   echo ""
11894   echo "*** PANIC *** The C compiler can no longer build working executables."
11895   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
11896   echo "*** PANIC *** The most likely reason for this problem is that configure"
11897   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
11898   echo "*** PANIC *** found at run time."
11899   echo "*** PANIC ***"
11900   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
11901   echo "*** PANIC *** On other systems, try telling configure where to find the"
11902   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
11903   echo "*** PANIC ***"
11904   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
11905   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
11906   echo "*** PANIC *** on your system.  Don't do that."
11907   exit 1
11908 fi
11909 rm -fr conftest*
11910
11911
11912 { test "$extra_verbose" = "yes" && cat << \EOF
11913     Defining HAVE_UNIX_PROCESSES
11914 EOF
11915 cat >> confdefs.h <<\EOF
11916 #define HAVE_UNIX_PROCESSES 1
11917 EOF
11918 }
11919
11920 extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
11921    echo "    xemacs will be linked with \"process-unix.o\""
11922  fi
11923
11924
11925
11926 T=""
11927 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11928 CFLAGS="$T"
11929
11930
11931 T=""
11932 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11933 extra_objs="$T"
11934
11935
11936 T=""
11937 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
11938 c_switch_general="$T"
11939
11940
11941 T=""
11942 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11943 c_switch_window_system="$T"
11944
11945
11946 T=""
11947 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11948 c_switch_all="$T"
11949
11950
11951 T=""
11952 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
11953 ld_switch_general="$T"
11954
11955
11956 T=""
11957 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11958 ld_switch_window_system="$T"
11959
11960
11961 T=""
11962 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11963 ld_switch_all="$T"
11964
11965
11966 T=""
11967 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11968 ld_libs_general="$T"
11969
11970
11971 T=""
11972 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
11973 ld_libs_window_system="$T"
11974
11975
11976 T=""
11977 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11978 ld_libs_all="$T"
11979
11980
11981
11982 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
11983 internal_makefile_list="Makefile"
11984 SUBDIR_MAKEFILES=''
11985 test -d lock || mkdir lock
11986 for dir in $MAKE_SUBDIR; do
11987   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
11988         test -d "$d" || mkdir "$d"; cd "$d"
11989       done ) ;;
11990    * ) test -d "$dir" || mkdir "$dir" ;;
11991   esac
11992   
11993 T=""
11994 for W in $SUBDIR_MAKEFILES $dir/Makefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
11995 SUBDIR_MAKEFILES="$T"
11996
11997   
11998 T=""
11999 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12000 internal_makefile_list="$T"
12001
12002 done
12003
12004
12005
12006
12007 for dir in src/s src/m; do
12008   if test ! -d "$dir" ; then
12009     echo Making symbolic link to "$srcdir/$dir"
12010     ${LN_S} "$srcdir/$dir" "$dir"
12011   fi
12012 done
12013
12014 if test "$extra_verbose" = "yes"; then
12015   echo ""
12016   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
12017   echo ""
12018 fi
12019
12020 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12021   echo "creating src/gdbinit"; echo ""
12022   echo "source $srcdir/src/gdbinit" > src/gdbinit
12023 fi
12024
12025 if test "$__SUNPRO_C" = "yes"; then
12026   echo "creating .sbinit"; echo ""
12027   ( echo "# For use with Sun WorkShop's Source browser."
12028     echo "# See sbquery(1) and sbinit(4) for more information"
12029     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12030   ) > .sbinit
12031 fi
12032
12033 rm -f core
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050 PREFIX=$prefix
12051 while true; do
12052   case "$PREFIX" in
12053     *\$* ) eval "PREFIX=$PREFIX" ;;
12054     *) break ;;
12055   esac
12056 done
12057
12058
12059
12060 EXEC_PREFIX=$exec_prefix
12061 while true; do
12062   case "$EXEC_PREFIX" in
12063     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12064     *) break ;;
12065   esac
12066 done
12067
12068
12069
12070
12071 INFODIR=$infodir
12072 while true; do
12073   case "$INFODIR" in
12074     *\$* ) eval "INFODIR=$INFODIR" ;;
12075     *) break ;;
12076   esac
12077 done
12078
12079
12080
12081
12082 INFOPATH=$infopath
12083 while true; do
12084   case "$INFOPATH" in
12085     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12086     *) break ;;
12087   esac
12088 done
12089
12090
12091
12092
12093 PACKAGE_PATH=$package_path
12094 while true; do
12095   case "$PACKAGE_PATH" in
12096     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12097     *) break ;;
12098   esac
12099 done
12100
12101
12102
12103
12104 LISPDIR=$lispdir
12105 while true; do
12106   case "$LISPDIR" in
12107     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12108     *) break ;;
12109   esac
12110 done
12111
12112
12113
12114
12115
12116 ETCDIR=$etcdir
12117 while true; do
12118   case "$ETCDIR" in
12119     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12120     *) break ;;
12121   esac
12122 done
12123
12124
12125
12126
12127 LOCKDIR=$lockdir
12128 while true; do
12129   case "$LOCKDIR" in
12130     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12131     *) break ;;
12132   esac
12133 done
12134
12135
12136
12137
12138 ARCHLIBDIR=$archlibdir
12139 while true; do
12140   case "$ARCHLIBDIR" in
12141     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12142     *) break ;;
12143   esac
12144 done
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12167
12168
12169
12170
12171
12172
12173
12174 # The default is yes
12175 if test "$with_site_lisp" = "no"; then
12176   { test "$extra_verbose" = "yes" && cat << \EOF
12177     Defining INHIBIT_SITE_LISP
12178 EOF
12179 cat >> confdefs.h <<\EOF
12180 #define INHIBIT_SITE_LISP 1
12181 EOF
12182 }
12183
12184 fi
12185
12186
12187 T=""
12188 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12189 ac_configure_args="$T"
12190
12191 { test "$extra_verbose" = "yes" && cat << EOF
12192     Defining EMACS_CONFIGURATION = "$canonical"
12193 EOF
12194 cat >> confdefs.h <<EOF
12195 #define EMACS_CONFIGURATION "$canonical"
12196 EOF
12197 }
12198
12199 { test "$extra_verbose" = "yes" && cat << EOF
12200     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12201 EOF
12202 cat >> confdefs.h <<EOF
12203 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12204 EOF
12205 }
12206
12207 { test "$extra_verbose" = "yes" && cat << EOF
12208     Defining config_machfile = "$machfile"
12209 EOF
12210 cat >> confdefs.h <<EOF
12211 #define config_machfile "$machfile"
12212 EOF
12213 }
12214
12215 { test "$extra_verbose" = "yes" && cat << EOF
12216     Defining config_opsysfile = "$opsysfile"
12217 EOF
12218 cat >> confdefs.h <<EOF
12219 #define config_opsysfile "$opsysfile"
12220 EOF
12221 }
12222
12223
12224
12225 null_string=""
12226 { test "$extra_verbose" = "yes" && cat << EOF
12227     Defining LD_SWITCH_X_SITE = $null_string
12228 EOF
12229 cat >> confdefs.h <<EOF
12230 #define LD_SWITCH_X_SITE $null_string
12231 EOF
12232 }
12233
12234 { test "$extra_verbose" = "yes" && cat << EOF
12235     Defining LD_SWITCH_X_SITE_AUX = $null_string
12236 EOF
12237 cat >> confdefs.h <<EOF
12238 #define LD_SWITCH_X_SITE_AUX $null_string
12239 EOF
12240 }
12241
12242 { test "$extra_verbose" = "yes" && cat << EOF
12243     Defining C_SWITCH_X_SITE = $null_string
12244 EOF
12245 cat >> confdefs.h <<EOF
12246 #define C_SWITCH_X_SITE $null_string
12247 EOF
12248 }
12249
12250 { test "$extra_verbose" = "yes" && cat << EOF
12251     Defining LD_SWITCH_SITE = $null_string
12252 EOF
12253 cat >> confdefs.h <<EOF
12254 #define LD_SWITCH_SITE $null_string
12255 EOF
12256 }
12257
12258 { test "$extra_verbose" = "yes" && cat << EOF
12259     Defining C_SWITCH_SITE = $null_string
12260 EOF
12261 cat >> confdefs.h <<EOF
12262 #define C_SWITCH_SITE $null_string
12263 EOF
12264 }
12265
12266
12267
12268 test -n "$puresize" && { test "$extra_verbose" = "yes" && cat << EOF
12269     Defining RAW_PURESIZE = $puresize
12270 EOF
12271 cat >> confdefs.h <<EOF
12272 #define RAW_PURESIZE $puresize
12273 EOF
12274 }
12275
12276
12277 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12278     Defining GNU_MALLOC
12279 EOF
12280 cat >> confdefs.h <<\EOF
12281 #define GNU_MALLOC 1
12282 EOF
12283 }
12284
12285 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12286     Defining USE_SYSTEM_MALLOC
12287 EOF
12288 cat >> confdefs.h <<\EOF
12289 #define USE_SYSTEM_MALLOC 1
12290 EOF
12291 }
12292
12293 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12294     Defining USE_DEBUG_MALLOC
12295 EOF
12296 cat >> confdefs.h <<\EOF
12297 #define USE_DEBUG_MALLOC 1
12298 EOF
12299 }
12300
12301                                               { test "$extra_verbose" = "yes" && cat << \EOF
12302     Defining USE_SYSTEM_MALLOC
12303 EOF
12304 cat >> confdefs.h <<\EOF
12305 #define USE_SYSTEM_MALLOC 1
12306 EOF
12307 }
12308
12309 fi
12310 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12311     Defining I18N3
12312 EOF
12313 cat >> confdefs.h <<\EOF
12314 #define I18N3 1
12315 EOF
12316 }
12317
12318 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12319     Defining USE_GCC
12320 EOF
12321 cat >> confdefs.h <<\EOF
12322 #define USE_GCC 1
12323 EOF
12324 }
12325
12326 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12327     Defining EXTERNAL_WIDGET
12328 EOF
12329 cat >> confdefs.h <<\EOF
12330 #define EXTERNAL_WIDGET 1
12331 EOF
12332 }
12333
12334 test "$with_gnu_make"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12335     Defining USE_GNU_MAKE
12336 EOF
12337 cat >> confdefs.h <<\EOF
12338 #define USE_GNU_MAKE 1
12339 EOF
12340 }
12341
12342 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12343     Defining NO_DOC_FILE
12344 EOF
12345 cat >> confdefs.h <<\EOF
12346 #define NO_DOC_FILE 1
12347 EOF
12348 }
12349
12350 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12351     Defining QUANTIFY
12352 EOF
12353 cat >> confdefs.h <<\EOF
12354 #define QUANTIFY 1
12355 EOF
12356 }
12357
12358 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12359     Defining MAIL_USE_POP
12360 EOF
12361 cat >> confdefs.h <<\EOF
12362 #define MAIL_USE_POP 1
12363 EOF
12364 }
12365
12366 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12367     Defining KERBEROS
12368 EOF
12369 cat >> confdefs.h <<\EOF
12370 #define KERBEROS 1
12371 EOF
12372 }
12373
12374 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12375     Defining HESIOD
12376 EOF
12377 cat >> confdefs.h <<\EOF
12378 #define HESIOD 1
12379 EOF
12380 }
12381
12382 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12383     Defining USE_UNION_TYPE
12384 EOF
12385 cat >> confdefs.h <<\EOF
12386 #define USE_UNION_TYPE 1
12387 EOF
12388 }
12389
12390
12391
12392 (
12393 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
12394 else
12395   echo "uname -a: `uname -a`"
12396 fi
12397 echo ""
12398 echo "$0 $quoted_arguments"
12399 ) > Installation
12400
12401 xemacs_betaname=""
12402 test ! -z "${emacs_beta_version}" && xemacs_betaname="-b${emacs_beta_version}"
12403
12404 (
12405 echo "
12406
12407 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
12408
12409   Where should the build process find the source code?    $srcdir
12410   What installation prefix should install use?            $prefix
12411   What operating system and machine description files should XEmacs use?
12412         \`$opsysfile' and \`$machfile'
12413   What compiler should XEmacs be built with?              $CC $CFLAGS
12414   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
12415   Should XEmacs use the relocating allocator for buffers? $rel_alloc
12416   What window system should XEmacs use?                   ${window_system}"
12417 if test "$with_x11" = "yes"; then
12418   echo "  Where do we find X Windows header files?                $x_includes"
12419   echo "  Where do we find X Windows libraries?                   $x_libraries"
12420 fi
12421 if test -n "$site_includes"; then
12422   echo "  Additional header files:                                $site_includes"
12423 fi
12424 if test -n "$site_libraries"; then
12425   echo "  Additional libraries:                                   $site_libraries"
12426 fi
12427 if test -n "$site_prefixes"; then
12428   echo "  Additional prefixes:                                    $site_prefixes"
12429 fi
12430 if test -n "$runpath"; then
12431   echo "  Runtime library search path:                            $runpath"
12432 fi
12433 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
12434 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
12435 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
12436 if test "$with_xmu" != yes -a "$with_x11" = yes; then
12437   echo "  No Xmu; substituting equivalent routines."
12438 fi
12439
12440 if test "$with_xpm" = yes; then
12441   echo "  Compiling in support for XPM images."
12442 elif test "$with_x11" = yes; then
12443   echo "  --------------------------------------------------------------------"
12444   echo "  WARNING: Compiling without XPM support."
12445   if test "$xpm_problem" != ""; then
12446     echo "  Reason: $xpm_problem"
12447   fi
12448   echo "  WARNING: You should strongly consider installing XPM."
12449   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
12450   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12451   echo "  --------------------------------------------------------------------"
12452 fi
12453 if test "$with_png" = yes; then
12454   echo "  Compiling in support for PNG image handling."
12455 elif test "$window_system" != "none"; then
12456   echo "  --------------------------------------------------------------------"
12457   echo "  WARNING: Compiling without PNG image support."
12458   if test "$png_problem" != ""; then
12459     echo "  Reason: $png_problem"
12460   fi
12461   echo "  WARNING: You should strongly consider installing the PNG libraries."
12462   echo "  WARNING: Otherwise certain images and glyphs may not display."
12463   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
12464   echo "  --------------------------------------------------------------------"
12465 fi
12466 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
12467 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
12468 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
12469 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
12470 case "$with_sound" in
12471   nas    ) echo "  Compiling in network sound (NAS) support." ;;
12472   native ) echo "  Compiling in native sound support." ;;
12473   both   ) echo "  Compiling in both network and native sound support." ;;
12474 esac
12475 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously"
12476
12477 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
12478 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
12479 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
12480
12481 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
12482 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
12483 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
12484
12485 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
12486 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
12487
12488 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
12489 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
12490 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
12491 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
12492 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
12493 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
12494 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
12495 if test "$with_wnn" = yes; then
12496   echo "  Compiling in support for the WNN input method on Mule."
12497   test "$with_wnn6" = yes && echo "    Using WNN version 6."
12498 fi
12499 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
12500
12501 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
12502 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
12503 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
12504 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
12505 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
12506 test "$with_session"  != no && echo "  Compiling in support for proper session-management."
12507 case "$with_menubars" in
12508   lucid ) echo "  Using Lucid menubars." ;;
12509   motif ) echo "  Using Motif menubars."
12510           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
12511           echo "             We recommend using the Lucid menubar instead."
12512           echo "             Re-run configure with --with-menubars='lucid'." ;;
12513 esac
12514 case "$with_scrollbars" in
12515   lucid    ) echo "  Using Lucid scrollbars."     ;;
12516   motif    ) echo "  Using Motif scrollbars."     ;;
12517   athena   ) echo "  Using Athena scrollbars."    ;;
12518   athena3d ) echo "  Using Athena-3d scrollbars." ;;
12519 esac
12520 case "$with_dialogs" in
12521   motif    ) echo "  Using Motif dialog boxes."     ;;
12522   athena   ) echo "  Using Athena dialog boxes."    ;;
12523   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
12524 esac
12525 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
12526 test "$with_clash_detection" = yes && \
12527   echo "  Clash detection will use \"$lockdir\" for locking files."
12528 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
12529 test "$with_pop"        = yes && echo "  Using POP for mail access"
12530 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication"
12531 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host"
12532 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
12533 test "$use_minimal_tagbits" = yes && echo "  Using Lisp_Objects with minimal tagbits."
12534 test "$use_indexed_lrecord_implementation" = yes && echo "  Using indexed lrecord implementation."
12535 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
12536 test "$memory_usage_stats" = yes && echo "  Compiling in code for checking XEmacs memory usage."
12537 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
12538 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
12539   != "no no no no no"; then
12540   echo "  WARNING: ---------------------------------------------------------"
12541   echo "  WARNING: Compiling in support for runtime error checking."
12542   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
12543   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
12544   echo "  WARNING: ---------------------------------------------------------"
12545 fi
12546 echo ""
12547 ) | tee -a Installation
12548 echo ""
12549
12550 echo '(setq Installation-string "' > Installation.el
12551 sed 's/"/\\"/g' Installation >> Installation.el
12552 echo '")' >> Installation.el
12553
12554
12555
12556 # Remove any trailing slashes in these variables.
12557 test -n "$prefix" &&
12558   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
12559 test -n "$exec_prefix" &&
12560   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
12561
12562
12563 for file in $internal_makefile_list; do
12564   test "$file" = src/Makefile.in && \
12565     file="src/Makefile.in:src/Makefile.in.in:src/depend"
12566   ac_output_files="${ac_output_files+$ac_output_files }$file"
12567 done
12568 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
12569
12570 trap '' 1 2 15
12571
12572 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
12573
12574 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12575 # Let make expand exec_prefix.
12576 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12577
12578 # Any assignment to VPATH causes Sun make to only execute
12579 # the first set of double-colon rules, so remove it if not needed.
12580 # If there is a colon in the path, we need to keep it.
12581 if test "x$srcdir" = x.; then
12582   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
12583 fi
12584
12585 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
12586
12587 DEFS=-DHAVE_CONFIG_H
12588
12589 # Without the "./", some shells look in PATH for config.status.
12590 : ${CONFIG_STATUS=./config.status}
12591
12592 echo creating $CONFIG_STATUS
12593 rm -f $CONFIG_STATUS
12594 cat > $CONFIG_STATUS <<EOF
12595 #! /bin/sh
12596 # Generated automatically by configure.
12597 # Run this file to recreate the current configuration.
12598 # This directory was configured as follows,
12599 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
12600 #
12601 # $0 $ac_configure_args
12602 #
12603 # Compiler output produced by configure, useful for debugging
12604 # configure, is in ./config.log if it exists.
12605
12606 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
12607 for ac_option
12608 do
12609   case "\$ac_option" in
12610   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12611     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
12612     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
12613   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
12614     echo "$CONFIG_STATUS generated by autoconf version 2.12"
12615     exit 0 ;;
12616   -help | --help | --hel | --he | --h)
12617     echo "\$ac_cs_usage"; exit 0 ;;
12618   *) echo "\$ac_cs_usage"; exit 1 ;;
12619   esac
12620 done
12621
12622 ac_given_srcdir=$srcdir
12623 ac_given_INSTALL="$INSTALL"
12624
12625 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
12626 EOF
12627 cat >> $CONFIG_STATUS <<EOF
12628
12629 # Protect against being on the right side of a sed subst in config.status.
12630 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
12631  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
12632 $ac_vpsub
12633 $extrasub
12634 s%@CFLAGS@%$CFLAGS%g
12635 s%@CPPFLAGS@%$CPPFLAGS%g
12636 s%@CXXFLAGS@%$CXXFLAGS%g
12637 s%@DEFS@%$DEFS%g
12638 s%@LDFLAGS@%$LDFLAGS%g
12639 s%@LIBS@%$LIBS%g
12640 s%@exec_prefix@%$exec_prefix%g
12641 s%@prefix@%$prefix%g
12642 s%@program_transform_name@%$program_transform_name%g
12643 s%@bindir@%$bindir%g
12644 s%@sbindir@%$sbindir%g
12645 s%@libexecdir@%$libexecdir%g
12646 s%@datadir@%$datadir%g
12647 s%@sysconfdir@%$sysconfdir%g
12648 s%@sharedstatedir@%$sharedstatedir%g
12649 s%@localstatedir@%$localstatedir%g
12650 s%@libdir@%$libdir%g
12651 s%@includedir@%$includedir%g
12652 s%@oldincludedir@%$oldincludedir%g
12653 s%@infodir@%$infodir%g
12654 s%@mandir@%$mandir%g
12655 s%@LN_S@%$LN_S%g
12656 s%@blddir@%$blddir%g
12657 s%@CC@%$CC%g
12658 s%@CPP@%$CPP%g
12659 s%@start_flags@%$start_flags%g
12660 s%@ld_switch_shared@%$ld_switch_shared%g
12661 s%@start_files@%$start_files%g
12662 s%@ld@%$ld%g
12663 s%@lib_gcc@%$lib_gcc%g
12664 s%@RANLIB@%$RANLIB%g
12665 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
12666 s%@INSTALL_DATA@%$INSTALL_DATA%g
12667 s%@YACC@%$YACC%g
12668 s%@SET_MAKE@%$SET_MAKE%g
12669 s%@X_CFLAGS@%$X_CFLAGS%g
12670 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
12671 s%@X_LIBS@%$X_LIBS%g
12672 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
12673 s%@install_pp@%$install_pp%g
12674 s%@libs_xauth@%$libs_xauth%g
12675 s%@dnd_objs@%$dnd_objs%g
12676 s%@lwlib_objs@%$lwlib_objs%g
12677 s%@ALLOCA@%$ALLOCA%g
12678 s%@dll_ld@%$dll_ld%g
12679 s%@dll_cflags@%$dll_cflags%g
12680 s%@dll_oflags@%$dll_oflags%g
12681 s%@dll_lflags@%$dll_lflags%g
12682 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
12683 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
12684 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
12685 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
12686 s%@PROGNAME@%$PROGNAME%g
12687 s%@version@%$version%g
12688 s%@configuration@%$configuration%g
12689 s%@canonical@%$canonical%g
12690 s%@srcdir@%$srcdir%g
12691 s%@pkgdir@%$pkgdir%g
12692 s%@statedir@%$statedir%g
12693 s%@PREFIX@%$PREFIX%g
12694 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
12695 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
12696 s%@INFODIR@%$INFODIR%g
12697 s%@infopath@%$infopath%g
12698 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
12699 s%@INFOPATH@%$INFOPATH%g
12700 s%@package_path@%$package_path%g
12701 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
12702 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
12703 s%@lispdir@%$lispdir%g
12704 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
12705 s%@LISPDIR@%$LISPDIR%g
12706 s%@etcdir@%$etcdir%g
12707 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
12708 s%@ETCDIR@%$ETCDIR%g
12709 s%@lockdir@%$lockdir%g
12710 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
12711 s%@LOCKDIR@%$LOCKDIR%g
12712 s%@archlibdir@%$archlibdir%g
12713 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
12714 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
12715 s%@docdir@%$docdir%g
12716 s%@bitmapdir@%$bitmapdir%g
12717 s%@extra_objs@%$extra_objs%g
12718 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
12719 s%@machfile@%$machfile%g
12720 s%@opsysfile@%$opsysfile%g
12721 s%@c_switch_general@%$c_switch_general%g
12722 s%@c_switch_window_system@%$c_switch_window_system%g
12723 s%@c_switch_all@%$c_switch_all%g
12724 s%@ld_switch_general@%$ld_switch_general%g
12725 s%@ld_switch_window_system@%$ld_switch_window_system%g
12726 s%@ld_switch_all@%$ld_switch_all%g
12727 s%@ld_libs_general@%$ld_libs_general%g
12728 s%@ld_libs_window_system@%$ld_libs_window_system%g
12729 s%@ld_libs_all@%$ld_libs_all%g
12730 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
12731 s%@native_sound_lib@%$native_sound_lib%g
12732 s%@sound_cflags@%$sound_cflags%g
12733 s%@dynodump_arch@%$dynodump_arch%g
12734 s%@internal_makefile_list@%$internal_makefile_list%g
12735
12736 CEOF
12737 EOF
12738
12739 cat >> $CONFIG_STATUS <<\EOF
12740
12741 # Split the substitutions into bite-sized pieces for seds with
12742 # small command number limits, like on Digital OSF/1 and HP-UX.
12743 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
12744 ac_file=1 # Number of current file.
12745 ac_beg=1 # First line for current file.
12746 ac_end=$ac_max_sed_cmds # Line after last line for current file.
12747 ac_more_lines=:
12748 ac_sed_cmds=""
12749 while $ac_more_lines; do
12750   if test $ac_beg -gt 1; then
12751     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
12752   else
12753     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
12754   fi
12755   if test ! -s conftest.s$ac_file; then
12756     ac_more_lines=false
12757     rm -f conftest.s$ac_file
12758   else
12759     if test -z "$ac_sed_cmds"; then
12760       ac_sed_cmds="sed -f conftest.s$ac_file"
12761     else
12762       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
12763     fi
12764     ac_file=`expr $ac_file + 1`
12765     ac_beg=$ac_end
12766     ac_end=`expr $ac_end + $ac_max_sed_cmds`
12767   fi
12768 done
12769 if test -z "$ac_sed_cmds"; then
12770   ac_sed_cmds=cat
12771 fi
12772 EOF
12773
12774 cat >> $CONFIG_STATUS <<EOF
12775
12776 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
12777 EOF
12778 cat >> $CONFIG_STATUS <<\EOF
12779 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
12780   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12781   case "$ac_file" in
12782   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12783        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12784   *) ac_file_in="${ac_file}.in" ;;
12785   esac
12786
12787   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
12788
12789   # Remove last slash and all that follows it.  Not all systems have dirname.
12790   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12791   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12792     # The file is in a subdirectory.
12793     test ! -d "$ac_dir" && mkdir "$ac_dir"
12794     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
12795     # A "../" for each directory in $ac_dir_suffix.
12796     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
12797   else
12798     ac_dir_suffix= ac_dots=
12799   fi
12800
12801   case "$ac_given_srcdir" in
12802   .)  srcdir=.
12803       if test -z "$ac_dots"; then top_srcdir=.
12804       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
12805   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
12806   *) # Relative path.
12807     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
12808     top_srcdir="$ac_dots$ac_given_srcdir" ;;
12809   esac
12810
12811   case "$ac_given_INSTALL" in
12812   [/$]*) INSTALL="$ac_given_INSTALL" ;;
12813   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
12814   esac
12815
12816   echo creating "$ac_file"
12817   rm -f "$ac_file"
12818   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
12819   case "$ac_file" in
12820   *Makefile*) ac_comsub="1i\\
12821 # $configure_input" ;;
12822   *) ac_comsub= ;;
12823   esac
12824
12825   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12826   sed -e "$ac_comsub
12827 s%@configure_input@%$configure_input%g
12828 s%@srcdir@%$srcdir%g
12829 s%@top_srcdir@%$top_srcdir%g
12830 s%@INSTALL@%$INSTALL%g
12831 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12832 fi; done
12833 rm -f conftest.s*
12834
12835 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12836 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12837 #
12838 # ac_d sets the value in "#define NAME VALUE" lines.
12839 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12840 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12841 ac_dC='\3'
12842 ac_dD='%g'
12843 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12844 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12845 ac_uB='\([      ]\)%\1#\2define\3'
12846 ac_uC=' '
12847 ac_uD='\4%g'
12848 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12849 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12850 ac_eB='$%\1#\2define\3'
12851 ac_eC=' '
12852 ac_eD='%g'
12853
12854 if test "${CONFIG_HEADERS+set}" != set; then
12855 EOF
12856 cat >> $CONFIG_STATUS <<EOF
12857   CONFIG_HEADERS="src/config.h lwlib/config.h"
12858 EOF
12859 cat >> $CONFIG_STATUS <<\EOF
12860 fi
12861 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12862   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12863   case "$ac_file" in
12864   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12865        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12866   *) ac_file_in="${ac_file}.in" ;;
12867   esac
12868
12869   echo creating $ac_file
12870
12871   rm -f conftest.frag conftest.in conftest.out
12872   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12873   cat $ac_file_inputs > conftest.in
12874
12875 EOF
12876
12877 # Transform confdefs.h into a sed script conftest.vals that substitutes
12878 # the proper values into config.h.in to produce config.h.  And first:
12879 # Protect against being on the right side of a sed subst in config.status.
12880 # Protect against being in an unquoted here document in config.status.
12881 rm -f conftest.vals
12882 cat > conftest.hdr <<\EOF
12883 s/[\\&%]/\\&/g
12884 s%[\\$`]%\\&%g
12885 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12886 s%ac_d%ac_u%gp
12887 s%ac_u%ac_e%gp
12888 EOF
12889 sed -n -f conftest.hdr confdefs.h > conftest.vals
12890 rm -f conftest.hdr
12891
12892 # This sed command replaces #undef with comments.  This is necessary, for
12893 # example, in the case of _POSIX_SOURCE, which is predefined and required
12894 # on some systems where configure will not decide to define it.
12895 cat >> conftest.vals <<\EOF
12896 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12897 EOF
12898
12899 # Break up conftest.vals because some shells have a limit on
12900 # the size of here documents, and old seds have small limits too.
12901
12902 rm -f conftest.tail
12903 while :
12904 do
12905   ac_lines=`grep -c . conftest.vals`
12906   # grep -c gives empty output for an empty file on some AIX systems.
12907   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12908   # Write a limited-size here document to conftest.frag.
12909   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12910   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12911   echo 'CEOF
12912   sed -f conftest.frag conftest.in > conftest.out
12913   rm -f conftest.in
12914   mv conftest.out conftest.in
12915 ' >> $CONFIG_STATUS
12916   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12917   rm -f conftest.vals
12918   mv conftest.tail conftest.vals
12919 done
12920 rm -f conftest.vals
12921
12922 cat >> $CONFIG_STATUS <<\EOF
12923   rm -f conftest.frag conftest.h
12924   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12925   cat conftest.in >> conftest.h
12926   rm -f conftest.in
12927   if cmp -s $ac_file conftest.h 2>/dev/null; then
12928     echo "$ac_file is unchanged"
12929     rm -f conftest.h
12930   else
12931     # Remove last slash and all that follows it.  Not all systems have dirname.
12932       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12933       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12934       # The file is in a subdirectory.
12935       test ! -d "$ac_dir" && mkdir "$ac_dir"
12936     fi
12937     rm -f $ac_file
12938     mv conftest.h $ac_file
12939   fi
12940 fi; done
12941
12942 EOF
12943 cat >> $CONFIG_STATUS <<EOF
12944 CPP="$CPP"
12945  CPPFLAGS="$CPPFLAGS"
12946  top_srcdir="$srcdir"
12947  MAKE_SUBDIR="$MAKE_SUBDIR"
12948
12949 EOF
12950 cat >> $CONFIG_STATUS <<\EOF
12951 for dir in $MAKE_SUBDIR; do
12952   echo creating $dir/Makefile
12953   (
12954     cd $dir
12955     rm -f junk.c
12956     < Makefile.in \
12957       sed -e '/^# Generated/d' \
12958           -e 's%/\*\*/#.*%%' \
12959           -e 's/^ *# */#/' \
12960           -e '/^##/d' \
12961           -e '/^#/ {
12962 p
12963 d
12964 }'        -e '/./ {
12965 s/\([\"]\)/\\\1/g
12966 s/^/"/
12967 s/$/"/
12968 }'  > junk.c;
12969     $CPP -I. -I${top_srcdir}/src $CPPFLAGS junk.c > junk.cpp;
12970     < junk.cpp                          \
12971       sed -e 's/^#.*//'                 \
12972         -e 's/^[        ][      ]*$//'  \
12973         -e 's/^ /       /'                      \
12974         | sed -n -e '/^..*$/p'          \
12975         | sed '/^"/ {
12976 s/\\\([\"]\)/\1/g
12977 s/^[    ]*"//
12978 s/"[    ]*$//
12979 }'      > Makefile.new
12980     chmod 444 Makefile.new
12981     mv -f Makefile.new Makefile
12982     rm -f junk.c junk.cpp
12983 )
12984 done
12985
12986 sed < config.status >> lib-src/config.values \
12987   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
12988   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
12989   -e 's/^\([^ ]*\) $/\1 ""/' \
12990   -e 's/ 1$/ t/'
12991
12992
12993 exit 0
12994 EOF
12995 chmod +x $CONFIG_STATUS
12996 rm -fr confdefs* $ac_clean_files
12997 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
12998