XEmacs 21.2.17 "Chiyoda".
[chise/xemacs-chise.git.1] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.12 
6 #### Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
7 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
8 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
9 #### Copyright (C) 1995, 1996 Ben Wing.
10 #### Copyright (C) 1998, 1999 J. Kean Johnston.
11
12 ### Don't edit this script!
13 ### This script was automatically generated by the `autoconf' program
14 ### from the file `./configure.in'.
15 ### To rebuild it, execute the command
16 ###     autoconf
17 ### in the this directory.  You must have autoconf version 2.12 or later.
18
19 ### This file is part of XEmacs.
20
21 ### XEmacs is free software; you can redistribute it and/or modify it
22 ### under the terms of the GNU General Public License as published by
23 ### the Free Software Foundation; either version 2, or (at your
24 ### option) any later version.
25
26 ### XEmacs is distributed in the hope that it will be useful, but
27 ### WITHOUT ANY WARRANTY; without even the implied warranty of
28 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29 ### General Public License for more details.
30
31 ### You should have received a copy of the GNU General Public License
32 ### along with XEmacs; see the file COPYING.  If not, write to the Free
33 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 ### 02111-1307, USA.
35
36 ### For usage, run `./configure --help'
37 ### For more detailed information on building and installing XEmacs,
38 ### read the file `INSTALL'.
39 ###
40 ### If configure succeeds, it leaves its status in config.status.
41 ### A log of configuration tests can be found in config.log.
42 ### If configure fails after disturbing the status quo,
43 ###     config.status is removed.
44
45 ac_help="$ac_help
46   --with-x                use the X Window System"
47
48
49
50 if test -n "$ZSH_VERSION"; then
51     setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
52   setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
53   setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
54   setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
55       if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
56 elif test -n "$BASH_VERSION"; then
57     set -o posix
58   unset CDPATH
59 else
60   if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
61 fi
62
63 exec_prefix=NONE
64 host=NONE
65 no_create=
66 nonopt=NONE
67 no_recursion=
68 prefix=NONE
69 program_prefix=NONE
70 program_suffix=NONE
71 program_transform_name=s,x,x,
72 silent=
73 site=
74 srcdir=
75 target=NONE
76 verbose=
77 x_includes=NONE
78 x_libraries=NONE
79
80 bindir='${exec_prefix}/bin'
81 sbindir='${exec_prefix}/sbin'
82 libexecdir='${exec_prefix}/libexec'
83 datadir='${prefix}/share'
84 sysconfdir='${prefix}/etc'
85 sharedstatedir='${prefix}/com'
86 localstatedir='${prefix}/var'
87 libdir='${{exec_prefix}}/lib'
88 includedir='${prefix}/include'
89 oldincludedir='/usr/include'
90 infodir='${prefix}/info'
91 mandir='${prefix}/man'
92
93 subdirs=
94 MFLAGS= MAKEFLAGS=
95 ac_max_here_lines=12
96
97 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
98
99 # File descriptor usage:
100 # 0 standard input
101 # 1 file creation
102 # 2 errors and warnings
103 # 3 some systems may open it to /dev/tty
104 # 4 used on the Kubota Titan
105 # 6 checking for... messages and results
106 # 5 compiler messages saved in config.log
107 if test "$silent" = yes; then
108   exec 6>/dev/null
109 else
110   exec 6>&1
111 fi
112 exec 5>./config.log
113
114 echo "\
115 This file contains any messages produced by compilers while
116 running configure, to aid debugging if configure makes a mistake.
117 " 1>&5
118
119 # Strip out --no-create and --no-recursion so they do not pile up.
120 # Also quote any args containing shell metacharacters.
121 ac_configure_args=
122 for ac_arg
123 do
124   case "$ac_arg" in
125   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
126   | --no-cr | --no-c) ;;
127   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
128   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
129   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
130   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
131   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
132   esac
133 done
134
135 # NLS nuisances.
136 # Only set these to C if already set.  These must not be set unconditionally
137 # because not all systems understand e.g. LANG=C (notably SCO).
138 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
139 # Non-C LC_CTYPE values break the ctype check.
140 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
141 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
142 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
143 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
144
145 # confdefs.h avoids OS command line length limits that DEFS can exceed.
146 rm -rf conftest* confdefs.h
147 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
148 echo > confdefs.h
149
150 # A filename unique to this package, relative to the directory that
151 # configure is in, which we can look for to find out if srcdir is correct.
152 ac_unique_file=src/lisp.h
153
154 # Find the source files, if location was not specified.
155 if test -z "$srcdir"; then
156   ac_srcdir_defaulted=yes
157   # Try the directory containing this script, then its parent.
158   ac_prog=$0
159   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
160   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
161   srcdir=$ac_confdir
162   if test ! -r $srcdir/$ac_unique_file; then
163     srcdir=..
164   fi
165 else
166   ac_srcdir_defaulted=no
167 fi
168 if test ! -r $srcdir/$ac_unique_file; then
169   if test "$ac_srcdir_defaulted" = yes; then
170     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
171   else
172     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
173   fi
174 fi
175 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
176
177 # Prefer explicitly selected file to automatically selected ones.
178 if test -z "$CONFIG_SITE"; then
179   if test "x$prefix" != xNONE; then
180     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
181   else
182     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
183   fi
184 fi
185 for ac_site_file in $CONFIG_SITE; do
186   if test -r "$ac_site_file"; then
187     echo "loading site script $ac_site_file"
188     . "$ac_site_file"
189   fi
190 done
191
192
193 ac_ext=c
194 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
195 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
196 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
197 ac_cpp='$CPP '"$xe_cppflags"
198 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
199 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
200 cross_compiling=no
201
202 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
203   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
204   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
205     ac_n= ac_c='
206 ' ac_t='        '
207   else
208     ac_n=-n ac_c= ac_t=
209   fi
210 else
211   ac_n= ac_c='\c' ac_t=
212 fi
213
214
215 progname="`echo $0 | sed 's:^\./\./:\./:'`"
216
217
218 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
219 INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
220
221 prefix='/usr/local'
222 exec_prefix='${prefix}'
223 bindir='${exec_prefix}/bin'
224 datadir='${prefix}/lib'
225 statedir='${prefix}/lib'
226 libdir='${exec_prefix}/lib'
227 mandir='${prefix}/man/man1'
228 infodir='${datadir}/${PROGNAME}-${version}/info'
229 infopath=''
230 install_pp=''
231 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
232 moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
233 sitelispdir='${datadir}/xemacs/site-lisp'
234 sitemoduledir='${datadir}/xemacs/site-modules'
235 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
236 package_path=''
237 etcdir='${datadir}/${PROGNAME}-${version}/etc'
238 lockdir='${statedir}/${PROGNAME}/lock'
239 archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
240 with_site_lisp='no'
241 with_site_modules='yes'
242 with_menubars=''
243 with_scrollbars=''
244 with_dialogs=''
245 with_file_coding=''
246 cpp='' cppflags='' libs='' ldflags=''
247 dynamic=''
248 with_x11=''
249 with_msw=''
250 rel_alloc='default'
251 with_system_malloc='default'
252 with_dlmalloc='default'
253 native_sound_lib=''
254 use_assertions="yes"
255 with_toolbars=""
256 with_tty=""
257 use_union_type="no"
258 with_dnet=""
259
260
261
262
263 arguments="$@"
264
265 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
266 quoted_arguments=
267 for i in "$@"; do
268    case "$i" in
269    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
270    | --no-cr | --no-c) ;;
271    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
272    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
273    *)
274    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
275    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
276    esac
277 done
278
279 while test $# != 0; do
280   arg="$1"; shift
281   case "$arg" in
282     --no-create|--no-recursion) ;;
283         -* )
284             case "$arg" in
285         -*=*)
286           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
287           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
288           valomitted=no
289         ;;
290                                                                           -*)
291                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
292           val="yes" valomitted=yes
293         ;;
294       esac
295
296             optname="$opt"
297       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
298
299             case "${valomitted}-${opt}" in yes-without_* )
300         opt=`echo $opt | sed 's/without/with/'`
301         valomitted="no" val="no" ;;
302       esac
303
304             case "$opt" in
305
306         with_site_lisp  | \
307     with_site_modules | \
308         with_x          | \
309         with_x11        | \
310         with_msw        | \
311         with_gcc        | \
312         dynamic         | \
313         with_ncurses    | \
314         with_dnet       | \
315         with_socks      | \
316         with_dragndrop  | \
317         with_cde        | \
318         with_offix      | \
319         with_gpm        | \
320         with_xpm        | \
321         with_xface      | \
322         with_gif        | \
323         with_jpeg       | \
324         with_png        | \
325         with_tiff       | \
326         with_wmcommand  | \
327         with_xmu        | \
328         with_purify     | \
329         with_quantify   | \
330         with_toolbars   | \
331         with_tty        | \
332         with_xfs        | \
333         with_i18n3      | \
334         with_mule       | \
335         with_file_coding| \
336         with_canna      | \
337         with_wnn        | \
338         with_wnn6       | \
339         with_workshop   | \
340         with_sparcworks | \
341         with_tooltalk   | \
342         with_ldap       | \
343         with_pop        | \
344         with_kerberos   | \
345         with_hesiod     | \
346         with_dnet       | \
347         with_infodock   | \
348         external_widget | \
349         verbose         | \
350         extra_verbose   | \
351         const_is_losing | \
352         usage_tracking  | \
353         use_union_type  | \
354         debug           | \
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         cache_file      | \
378         native_sound_lib| \
379         site_lisp       | \
380         x_includes      | \
381         x_libraries     | \
382         site_includes   | \
383         site_libraries  | \
384         site_prefixes   | \
385         site_runtime_libraries )
386                   if test "$valomitted" = "yes" ; then
387                     if test "$#" = 0 ; then
388               (echo "$progname: Usage error:"
389 echo " " "The \`--$optname' option requires a value."
390 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
391             fi
392             val="$1"; shift
393           fi
394           eval "$opt=\"$val\""
395         ;;
396
397                 rel_alloc | \
398         with_dlmalloc | \
399         with_debug_malloc  | use_debug_malloc | \
400         with_system_malloc | use_system_malloc )
401           case "$val" in
402             y | ye | yes )      val=yes ;;
403             n | no )            val=no  ;;
404             d | de | def | defa | defau | defaul | default ) val=default ;;
405             * ) (echo "$progname: Usage error:"
406 echo " " "The \`--$optname' option requires one of these values:
407   \`yes', \`no', or \`default'."
408 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
409           esac
410           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
411           eval "$opt=\"$val\""
412         ;;
413
414                 "with_database" )
415           with_database_berkdb=no
416           with_database_dbm=no
417           with_database_gnudbm=no
418           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
419             case "$x" in
420                 no ) ;;
421                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
422                 d | db | dbm )                          with_database_dbm=yes    ;;
423                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
424                 * ) (echo "$progname: Usage error:"
425 echo " " "The \`--$optname' option value
426   must be either \`no' or a comma-separated list
427   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
428 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
429             esac
430           done
431           if test "$with_database_dbm"    = "yes" -a \
432                   "$with_database_gnudbm" = "yes"; then
433           (echo "$progname: Usage error:"
434 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
435   with the \`--$optname' option."
436 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
437           fi
438         ;;
439
440                 "with_sound" )
441                           case "$val" in
442             y | ye | yes )                      val=native ;;
443             n | no | non | none )               val=no;;
444             na | nat | nati | nativ | native )  val=native  ;;
445             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
446             b | bo | bot | both )               val=both;;
447             * ) (echo "$progname: Usage error:"
448 echo " " "The \`--$optname' option must have one of these values:
449   \`native', \`nas', \`both', or \`none'."
450 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
451           esac
452           eval "$opt=\"$val\""
453         ;;
454
455                 "with_xim" )
456           case "$val" in
457             y | ye | yes )                val=yes   ;;
458             n | no | non | none )         val=no    ;;
459             x | xl | xli | xlib )         val=xlib  ;;
460             m | mo | mot | moti | motif ) val=motif ;;
461             * ) (echo "$progname: Usage error:"
462 echo " " "The \`--$optname' option must have one of these values:
463   \`motif', \`xlib', \`yes', or \`no'."
464 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
465           esac
466           eval "$opt=\"$val\""
467         ;;
468
469                 "mail_locking" )
470           case "$val" in
471             lockf )     val=lockf ;;
472             flock )     val=flock ;;
473             file )      val=file  ;;
474             * ) (echo "$progname: Usage error:"
475 echo " " "The \`--$optname' option must have one of these values:
476   \`lockf', \`flock', or \`file'."
477 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
478           esac
479           eval "$opt=\"$val\""
480         ;;
481
482                 "error_checking" )
483                           
484           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
485             case "$x" in
486                       n | no | non | none ) new_default=no ;;
487               a | al | all )        new_default=yes ;;
488
489               extents )       error_check_extents=yes ;;
490               noextents )     error_check_extents=no ;;
491
492               typecheck )     error_check_typecheck=yes ;;
493               notypecheck )   error_check_typecheck=no ;;
494
495               bufpos )        error_check_bufpos=yes ;;
496               nobufpos )      error_check_bufpos=no ;;
497
498               gc )            error_check_gc=yes ;;
499               nogc )          error_check_gc=no ;;
500
501               malloc )        error_check_malloc=yes ;;
502               nomalloc )      error_check_malloc=no ;;
503
504               byte_code )     error_check_byte_code=yes ;;
505               nobyte_code )   error_check_byte_code=no ;;
506
507               * ) bogus_error_check=yes ;;
508             esac
509             if test "$bogus_error_check" -o \
510                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
511                 if test "$error_check_default" = yes ; then
512                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
513                 else
514                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
515                 fi
516                 (echo "$progname: Usage error:"
517 echo " " "Valid types for the \`--$optname' option are:
518   $types."
519 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
520             elif test -n "$new_default" ; then
521                 error_check_extents=$new_default
522                 error_check_typecheck=$new_default
523                 error_check_bufpos=$new_default
524                 error_check_gc=$new_default
525                 error_check_malloc=$new_default
526                 error_check_byte_code=$new_default
527                 new_default=    # reset this
528             fi
529             echeck_notfirst=true
530           done
531         ;;
532
533                                 
534                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
535         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
536         archlibdir | docdir | package_path )
537                    if test "$valomitted" = "yes"; then
538              if test "$#" = 0; then
539                  (echo "$progname: Usage error:"
540 echo " " "The \`--$optname' option requires a value."
541 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
542              fi
543              val="$1"; shift
544            fi
545            eval "$opt=\"$val\""
546
547                            case "$opt" in
548              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
549     Defining LISPDIR_USER_DEFINED
550 EOF
551 cat >> confdefs.h <<\EOF
552 #define LISPDIR_USER_DEFINED 1
553 EOF
554 }
555  ;;
556              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
557     Defining SITELISPDIR_USER_DEFINED
558 EOF
559 cat >> confdefs.h <<\EOF
560 #define SITELISPDIR_USER_DEFINED 1
561 EOF
562 }
563  ;;
564              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
565     Defining MODULEDIR_USER_DEFINED
566 EOF
567 cat >> confdefs.h <<\EOF
568 #define MODULEDIR_USER_DEFINED 1
569 EOF
570 }
571  ;;
572              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
573     Defining ETCDIR_USER_DEFINED
574 EOF
575 cat >> confdefs.h <<\EOF
576 #define ETCDIR_USER_DEFINED 1
577 EOF
578 }
579  ;;
580              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
581     Defining INFODIR_USER_DEFINED
582 EOF
583 cat >> confdefs.h <<\EOF
584 #define INFODIR_USER_DEFINED 1
585 EOF
586 }
587  ;;
588              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
589     Defining INFOPATH_USER_DEFINED
590 EOF
591 cat >> confdefs.h <<\EOF
592 #define INFOPATH_USER_DEFINED 1
593 EOF
594 }
595  ;;
596              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
597     Defining PACKAGE_PATH_USER_DEFINED
598 EOF
599 cat >> confdefs.h <<\EOF
600 #define PACKAGE_PATH_USER_DEFINED 1
601 EOF
602 }
603  ;;
604              datadir )
605                 { test "$extra_verbose" = "yes" && cat << \EOF
606     Defining INFODIR_USER_DEFINED
607 EOF
608 cat >> confdefs.h <<\EOF
609 #define INFODIR_USER_DEFINED 1
610 EOF
611 }
612
613                 { test "$extra_verbose" = "yes" && cat << \EOF
614     Defining LISPDIR_USER_DEFINED
615 EOF
616 cat >> confdefs.h <<\EOF
617 #define LISPDIR_USER_DEFINED 1
618 EOF
619 }
620
621             { test "$extra_verbose" = "yes" && cat << \EOF
622     Defining MODULEDIR_USER_DEFINED
623 EOF
624 cat >> confdefs.h <<\EOF
625 #define MODULEDIR_USER_DEFINED 1
626 EOF
627 }
628
629                 { test "$extra_verbose" = "yes" && cat << \EOF
630     Defining ETCDIR_USER_DEFINED
631 EOF
632 cat >> confdefs.h <<\EOF
633 #define ETCDIR_USER_DEFINED 1
634 EOF
635 }
636  ;;
637              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
638     Defining LOCKDIR_USER_DEFINED
639 EOF
640 cat >> confdefs.h <<\EOF
641 #define LOCKDIR_USER_DEFINED 1
642 EOF
643 }
644  ;;
645              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
646     Defining ARCHLIBDIR_USER_DEFINED
647 EOF
648 cat >> confdefs.h <<\EOF
649 #define ARCHLIBDIR_USER_DEFINED 1
650 EOF
651 }
652  ;;
653            esac
654         ;;
655
656                 "no_create" ) ;;
657
658                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
659
660                 "with_menubars"   | \
661         "with_scrollbars" | \
662         "with_dialogs" )
663           case "$val" in
664             l | lu | luc | luci | lucid )               val=lucid  ;;
665             m | mo | mot | moti | motif )               val=motif  ;;
666             athena3d | athena-3d )                      val=athena3d ;;
667             a | at | ath | athe | athen | athena )      val=athena ;;
668             n | no | non | none )                       val=no ;;
669             * ) (echo "$progname: Usage error:"
670 echo " " "The \`--$optname' option must have one of these values:
671   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
672 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
673           esac
674           eval "$opt=\"$val\""
675         ;;
676
677                 "run_in_place"  | \
678         "with_gnu_make" )
679           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
680         ;;
681
682                 * ) (echo "$progname: Usage error:"
683 echo " " "Unrecognized option: $arg"
684 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
685
686       esac
687     ;;
688
689         *-*-*) configuration="$arg" ;;
690
691         *) (echo "$progname: Usage error:"
692 echo " " "Unrecognized argument: $arg"
693 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
694
695   esac
696 done
697
698
699 test -n "$cpp"      && CPP="$cpp"
700 test -n "$cppflags" && CPPFLAGS="$cppflags"
701 test -n "$libs"     && LIBS="$libs"
702 test -n "$ldflags"  && LDFLAGS="$ldflags"
703
704 eval set x "$quoted_arguments"; shift
705
706 test "$extra_verbose" = "yes" && verbose=yes
707
708 test -n "$with_x" && with_x11="$with_x"
709
710 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
711   test "$with_system_malloc" = "default" && with_system_malloc=yes
712 fi
713
714
715
716 if test "$with_cde $with_tooltalk" = "yes no"; then
717   (echo "$progname: Usage error:"
718 echo " " "--with-cde requires --with-tooltalk"
719 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
720 elif test "$with_tooltalk" = "no" ; then with_cde=no
721 elif test "$with_cde" = "yes"; then with_tooltalk=yes
722 fi
723
724
725 case "$srcdir" in
726
727     "" )
728     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
729       if test -f "$dir/src/lisp.h" -a \
730               -f "$dir/lisp/version.el" ; then
731         srcdir="$dir"
732         break
733       fi
734     done
735     if test -z "$srcdir" ; then
736       (echo "$progname: Usage error:"
737 echo " " "Neither the current directory nor its parent seem to
738   contain the XEmacs sources.  If you do not want to build XEmacs in its
739   source tree, you should run \`$progname' in the directory in which
740   you wish to build XEmacs, using the \`--srcdir' option to say where the
741   sources may be found."
742 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
743     fi
744   ;;
745
746     * )
747     if test ! -f "$srcdir/src/lisp.h" -o \
748             ! -f "$srcdir/lisp/version.el" ; then
749       (echo "$progname: Usage error:"
750 echo " " "The directory specified with the \`--srcdir' option,
751   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
752   either run the \`$progname' script at the top of the XEmacs source
753   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
754 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
755     fi
756   ;;
757 esac
758
759 if test -z "$configuration"; then
760     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
761   if test -z "$configuration"; then
762     (echo "$progname: Usage error:"
763 echo " " "XEmacs has not been ported to this host type.
764 Try explicitly specifying the CONFIGURATION when rerunning configure."
765 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
766   fi
767 fi
768
769 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
770 echo "configure:771: checking whether ln -s works" >&5
771
772 rm -f conftestdata
773 if ln -s X conftestdata 2>/dev/null
774 then
775   rm -f conftestdata
776   ac_cv_prog_LN_S="ln -s"
777 else
778   ac_cv_prog_LN_S=ln
779 fi
780 LN_S="$ac_cv_prog_LN_S"
781 if test "$ac_cv_prog_LN_S" = "ln -s"; then
782   echo "$ac_t""yes" 1>&6
783 else
784   echo "$ac_t""no" 1>&6
785 fi
786
787
788 for dir in lisp etc man info; do
789   if test ! -d "$dir" ; then
790     echo Making symbolic link to "$srcdir/$dir"
791     ${LN_S} "$srcdir/$dir" "$dir"
792   fi
793 done
794
795
796 absolute_pwd="`pwd`";
797 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
798 then blddir="$PWD"
799 else blddir="$absolute_pwd"; if test -d "/net"; then
800   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
801   blddir=`echo "$blddir" | \
802    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
803 fi
804 fi
805
806
807 case "$srcdir" in
808   /* ) ;;
809   .  ) srcdir="$blddir" ;;
810   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
811   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
812   srcdir=`echo "$srcdir" | \
813    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
814 fi ;;
815 esac
816
817 if test `pwd` != `sh -c cd $srcdir && pwd`  \
818    && test -f "$srcdir/src/config.h"; then
819   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
820    echo "   as a build directory right now; it has been configured in its own"
821    echo "   right.  To configure in another directory as well, you MUST"
822    echo "   use GNU make.  If you do not have GNU make, then you must"
823    echo "   now do \`make distclean' in $srcdir,"
824    echo "   and then run $progname again.") >&2
825   extrasub='/^VPATH[     ]*=/c\
826 vpath %.c $(srcdir)\
827 vpath %.h $(srcdir)\
828 vpath %.y $(srcdir)\
829 vpath %.l $(srcdir)\
830 vpath %.s $(srcdir)\
831 vpath %.in $(srcdir)'
832 fi
833
834 . "$srcdir/version.sh" || exit 1;
835 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
836 : "${extra_verbose=$beta}"
837 version="${emacs_major_version}.${emacs_minor_version}"
838 { test "$extra_verbose" = "yes" && cat << EOF
839     Defining EMACS_MAJOR_VERSION = $emacs_major_version
840 EOF
841 cat >> confdefs.h <<EOF
842 #define EMACS_MAJOR_VERSION $emacs_major_version
843 EOF
844 }
845
846 { test "$extra_verbose" = "yes" && cat << EOF
847     Defining EMACS_MINOR_VERSION = $emacs_minor_version
848 EOF
849 cat >> confdefs.h <<EOF
850 #define EMACS_MINOR_VERSION $emacs_minor_version
851 EOF
852 }
853
854 if test -n "$emacs_beta_version" ; then
855   if test "$beta" = "yes"; then
856         version="${version}-b${emacs_beta_version}"
857         { test "$extra_verbose" = "yes" && cat << EOF
858     Defining EMACS_BETA_VERSION = $emacs_beta_version
859 EOF
860 cat >> confdefs.h <<EOF
861 #define EMACS_BETA_VERSION $emacs_beta_version
862 EOF
863 }
864
865   else
866         version="${version}.${emacs_beta_version}"
867         { test "$extra_verbose" = "yes" && cat << EOF
868     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
869 EOF
870 cat >> confdefs.h <<EOF
871 #define EMACS_PATCH_LEVEL $emacs_beta_version
872 EOF
873 }
874
875   fi
876 fi
877 { test "$extra_verbose" = "yes" && cat << EOF
878     Defining XEMACS_CODENAME = "$xemacs_codename"
879 EOF
880 cat >> confdefs.h <<EOF
881 #define XEMACS_CODENAME "$xemacs_codename"
882 EOF
883 }
884
885 { test "$extra_verbose" = "yes" && cat << EOF
886     Defining EMACS_VERSION = "$version"
887 EOF
888 cat >> confdefs.h <<EOF
889 #define EMACS_VERSION "$version"
890 EOF
891 }
892
893
894 if test "$with_infodock" = "yes"; then
895   if test ! -f ../ID-INSTALL; then
896     echo "Cannot build InfoDock without InfoDock sources"
897     with_infodock=no
898   fi
899 fi
900
901 if test "$with_infodock" = "yes"; then
902       { test "$extra_verbose" = "yes" && cat << EOF
903     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
904 EOF
905 cat >> confdefs.h <<EOF
906 #define INFODOCK_MAJOR_VERSION $infodock_major_version
907 EOF
908 }
909
910   { test "$extra_verbose" = "yes" && cat << EOF
911     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
912 EOF
913 cat >> confdefs.h <<EOF
914 #define INFODOCK_MINOR_VERSION $infodock_minor_version
915 EOF
916 }
917
918   { test "$extra_verbose" = "yes" && cat << EOF
919     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
920 EOF
921 cat >> confdefs.h <<EOF
922 #define INFODOCK_BUILD_VERSION $infodock_build_version
923 EOF
924 }
925
926   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
927   PROGNAME=infodock
928   CPPFLAGS="$CPPFLAGS -DINFODOCK"
929 else
930   PROGNAME=xemacs
931 fi
932
933 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
934 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
935     Defining ERROR_CHECK_EXTENTS
936 EOF
937 cat >> confdefs.h <<\EOF
938 #define ERROR_CHECK_EXTENTS 1
939 EOF
940 }
941
942 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
943     Defining ERROR_CHECK_TYPECHECK
944 EOF
945 cat >> confdefs.h <<\EOF
946 #define ERROR_CHECK_TYPECHECK 1
947 EOF
948 }
949
950 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
951     Defining ERROR_CHECK_BUFPOS
952 EOF
953 cat >> confdefs.h <<\EOF
954 #define ERROR_CHECK_BUFPOS 1
955 EOF
956 }
957
958 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
959     Defining ERROR_CHECK_GC
960 EOF
961 cat >> confdefs.h <<\EOF
962 #define ERROR_CHECK_GC 1
963 EOF
964 }
965
966 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
967     Defining ERROR_CHECK_MALLOC
968 EOF
969 cat >> confdefs.h <<\EOF
970 #define ERROR_CHECK_MALLOC 1
971 EOF
972 }
973
974 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
975     Defining ERROR_CHECK_BYTE_CODE
976 EOF
977 cat >> confdefs.h <<\EOF
978 #define ERROR_CHECK_BYTE_CODE 1
979 EOF
980 }
981
982 if test "${debug:=$beta}" = "yes"; then
983   use_assertions=yes memory_usage_stats=yes
984   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
985    echo "    xemacs will be linked with \"debug.o\""
986  fi
987   { test "$extra_verbose" = "yes" && cat << \EOF
988     Defining DEBUG_XEMACS
989 EOF
990 cat >> confdefs.h <<\EOF
991 #define DEBUG_XEMACS 1
992 EOF
993 }
994
995 fi
996 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
997     Defining USE_ASSERTIONS
998 EOF
999 cat >> confdefs.h <<\EOF
1000 #define USE_ASSERTIONS 1
1001 EOF
1002 }
1003
1004 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1005     Defining MEMORY_USAGE_STATS
1006 EOF
1007 cat >> confdefs.h <<\EOF
1008 #define MEMORY_USAGE_STATS 1
1009 EOF
1010 }
1011
1012
1013
1014 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1015 echo "configure:1016: checking "host system type"" >&5
1016 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1017 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1018 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1019 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1020 echo "$ac_t""$configuration" 1>&6
1021
1022
1023
1024
1025
1026 machine='' opsys=''
1027
1028 case "$canonical" in
1029   sparc-*-*        ) machine=sparc ;;
1030   alpha*-*-*       ) machine=alpha ;;
1031   vax-*-*          ) machine=vax ;;
1032   mips-dec-*       ) machine=pmax ;;
1033   mips-sgi-*       ) machine=iris4d ;;
1034   romp-ibm-*       ) machine=ibmrt ;;
1035   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1036   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1037   powerpc*-*       ) machine=powerpc ;;
1038   hppa-*-*         ) machine=hp800 ;;
1039   m88k-dg-*        ) machine=aviion ;;
1040   m68*-sony-*      ) machine=news ;;
1041   mips-sony-*      ) machine=news-risc ;;
1042   clipper-*        ) machine=clipper ;;
1043   arm-*            ) machine=arm ;;
1044   ns32k-*          ) machine=ns32000 ;;
1045 esac
1046
1047 case "$canonical" in
1048   *-*-linux*    ) opsys=linux ;;
1049   *-*-netbsd*   ) opsys=netbsd ;;
1050   *-*-openbsd*  ) opsys=openbsd ;;
1051   *-*-nextstep* ) opsys=nextstep ;;
1052   *-*-vms       ) opsys=vms ;;
1053
1054     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1055   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1056   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1057   *-dec-osf3*                ) opsys=decosf3-1 ;;
1058   *-dec-osf4*                ) opsys=decosf4-0 ;;
1059
1060     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1061   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1062   *-*-ultrix* )         opsys=ultrix4-3 ;;
1063
1064     *-*-aix3.1*  ) opsys=aix3-1 ;;
1065   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1066   *-*-aix3*    ) opsys=aix3-2   ;;
1067   *-*-aix4.0*  ) opsys=aix4     ;;
1068   *-*-aix4.1*  ) opsys=aix4-1   ;;
1069   *-*-aix4*    ) opsys=aix4-2   ;;
1070
1071     *-gnu* )                    opsys=gnu    ;;
1072   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1073   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1074   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1075   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1076   *-*-aos*   )                  opsys=bsd4-3 ;;
1077   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1078   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1079   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1080   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1081   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1082   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1083         if test -z "$NON_GNU_CPP" ; then
1084           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1085             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1086           done
1087         fi
1088         opsys=usg5-4-2 ;;
1089     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1090     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1091 esac
1092
1093 case "$canonical" in
1094
1095     *-*-netbsd* )
1096     case "$canonical" in
1097       i[3-9]86-*-netbsd*) machine=intel386 ;;
1098       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1099                                             machine=hp9000s300 ;;
1100       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1101       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1102     esac
1103   ;;
1104
1105     *-*-openbsd* )
1106     case "${canonical}" in
1107       i386-*-openbsd*)          machine=intel386 ;;
1108       m68k-*-openbsd*)          machine=hp9000s300 ;;
1109       mipsel-*-openbsd*)        machine=pmax ;;
1110      esac
1111    ;;
1112
1113     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1114   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1115
1116     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1117   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1118
1119     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1120
1121     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1122
1123     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1124
1125     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1126
1127     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1128
1129     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1130   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1131   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1132
1133   
1134     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1135
1136     *-convex-bsd* | *-convex-convexos* )
1137     machine=convex opsys=bsd4-3
1138     NON_GNU_CPP="cc -E -P"
1139   ;;
1140
1141     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1142
1143     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1144   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1145   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1146   m88k-dg-dgux*                           ) opsys=dgux     ;;
1147
1148     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1149   m88k-motorola-sysv4* )
1150                     machine=delta88k opsys=usg5-4-2
1151   ;;
1152   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1153
1154     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1155   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1156
1157     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1158
1159     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1160   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1161   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1162
1163       m88k-harris-cxux* )
1164         case "`uname -r`" in
1165        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1166        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1167     esac
1168     NON_GNU_CPP="/lib/cpp"
1169   ;;
1170     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1171     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1172
1173     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1174
1175     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1176
1177     *-hp-hpux* )
1178         case "$canonical" in
1179       m68*  ) machine=hp9000s300 ;;
1180       hppa* ) machine=hp800      ;;
1181     esac
1182
1183     case "$canonical" in
1184       *-hp-hpux7*  )  opsys=hpux   ;;
1185       *-hp-hpux8*  )  opsys=hpux8  ;;
1186       *-hp-hpux9*  )  opsys=hpux9  ;;
1187       *-hp-hpux10* )  opsys=hpux10 ;;
1188       *-hp-hpux11* )  opsys=hpux11 ;;
1189       *            )  opsys=hpux   ;;
1190     esac
1191
1192         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1193    echo "    xemacs will be linked with \"strcat.o\""
1194  fi ;; esac
1195
1196     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1197         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1198     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1199
1200     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1201   ;;
1202
1203     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1204   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1205
1206     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1207   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1208   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1209   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1210   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1211   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1212
1213     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1214   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1215
1216     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1217
1218     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1219
1220     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1221
1222     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1223
1224       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1225
1226     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1227
1228     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1229
1230     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1231
1232     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1233
1234         mips-mips-usg* ) machine=mips4 ;;
1235   mips-mips-riscos4 )
1236     machine=mips4
1237     NON_GNU_CC="cc -systype bsd43"
1238     NON_GNU_CPP="cc -systype bsd43 -E"
1239     case "$canonical" in
1240       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1241       mips-mips-riscos5* ) opsys=riscos5 ;;
1242     esac
1243   ;;
1244   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1245   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1246
1247     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1248
1249     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1250
1251     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1252   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1253
1254     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1255
1256     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1257
1258     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1259
1260     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1261
1262     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1263   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1264
1265     mips-siemens-sysv* | mips-sni-sysv*)
1266     machine=mips-siemens opsys=usg5-4
1267     NON_GNU_CC=/usr/ccs/bin/cc
1268     NON_GNU_CPP=/usr/ccs/lib/cpp
1269   ;;
1270
1271     mips-nec-sysv*)
1272     machine=mips-nec
1273     NON_GNU_CC=/usr/ccs/bin/cc
1274     NON_GNU_CPP=/usr/ccs/lib/cpp
1275   ;;
1276
1277       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1278   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1279     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1280   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1281   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1282   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1283   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1284   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1285   mips-sgi-irix*      ) opsys=irix5-0 ;;
1286
1287     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1288   *-sony-news* ) opsys=newsos5 ;;
1289
1290     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1291
1292     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1293         case "$canonical" in
1294       m68*-sunos1* )             machine=sun1     ;;
1295       m68*-sunos2* )             machine=sun2     ;;
1296       m68* )                     machine=sun3     ;;
1297       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1298       i*86-*-* )                 machine=intel386 ;;
1299       rs6000* )                  machine=rs6000   ;;
1300     esac
1301
1302         case "$canonical" in *-sunos5*)
1303       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1304     esac
1305
1306                     case "$canonical" in
1307       *-sunos4* )
1308         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1309         : ;;
1310       *-solaris2* )
1311         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1312         RANLIB=':' ;;
1313     esac
1314
1315     case "$canonical" in
1316       *-solaris*          )
1317         opsys=sol2
1318         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1319         { test "$extra_verbose" = "yes" && cat << EOF
1320     Defining OS_RELEASE = $os_release
1321 EOF
1322 cat >> confdefs.h <<EOF
1323 #define OS_RELEASE $os_release
1324 EOF
1325 }
1326  ;;
1327
1328             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1329       *-sunos4.0*         ) opsys=sunos4-0      ;;
1330       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1331       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1332       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1333       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1334       *-mach*             ) opsys=mach-bsd4-3   ;;
1335       *                   ) opsys=bsd4-2        ;;
1336     esac
1337
1338     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1339
1340         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1341   ;;
1342
1343     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1344
1345     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1346   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1347
1348     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1349
1350     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1351
1352     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1353       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1354
1355     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1356
1357     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1358
1359     vax-dec-* )
1360     case "$canonical" in
1361       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1362       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1363       *-mach* )                         opsys=mach-bsd4-3 ;;
1364     esac
1365   ;;
1366
1367     ns16k-whitechapel-* ) machine=mg1 ;;
1368
1369     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1370
1371     i[3-9]86-*-* )
1372     machine=intel386
1373     case "$canonical" in
1374       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1375       *-isc2.2* )               opsys=isc2-2 ;;
1376       *-isc4.0* )               opsys=isc4-0 ;;
1377       *-isc4.* )                opsys=isc4-1
1378                                 GCC_TEST_OPTIONS=-posix
1379                                 NON_GCC_TEST_OPTIONS=-Xp
1380                                 ;;
1381       *-isc* )                  opsys=isc3-0 ;;
1382       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1383       *-esix* )                 opsys=esix ;;
1384       *-mach* )                 opsys=mach-bsd4-3 ;;
1385       *-xenix* )                opsys=xenix ;;
1386       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1387       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1388       *-bsdi4* )                opsys=bsdos4 ;;
1389       *-bsdi3* )                opsys=bsdos3 ;;
1390       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1391       *-bsdi2* )                opsys=bsdos2 ;;
1392       *-sco3.2v5* )             opsys=sco5 ;
1393                                                         if test "$dynamic" = "yes" ; then
1394                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1395         else
1396                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1397         fi ;;
1398       *-386bsd* )               opsys=386bsd ;;
1399       *-freebsd* )              opsys=freebsd ;;
1400       *-nextstep* )             opsys=nextstep ;;
1401       *-pc-cygwin* )            opsys=cygwin32 ;;
1402       *-pc-mingw* )             opsys=mingw32 ;
1403                                 test -z "$with_tty" && with_tty="no";;
1404           esac
1405   ;;
1406
1407     m68k-*-linux* ) machine=m68k opsys=linux ;;
1408
1409 esac
1410
1411 if test -z "$machine" -o -z "$opsys"; then
1412   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1413    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1414   ) >&2
1415   exit 1
1416 fi
1417
1418 if test -z "$dynamic"; then
1419   case "$opsys" in
1420     hpux* | sunos4* ) dynamic=no ;;
1421     *) dynamic=yes ;;
1422   esac
1423 fi
1424 if test "$dynamic" = "yes"; then
1425   case "$opsys" in
1426     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1427     decosf* ) ld_call_shared="-call_shared" ;;
1428   esac
1429 else   case "$opsys" in
1430     sol2 )
1431       echo "Static linking is not supported on Solaris 2."
1432       echo "Rerun configure without specifying --dynamic=no."
1433       exit 1 ;;
1434     linux   ) ld_call_shared="-Bstatic" ;;
1435     decosf* ) ld_call_shared="-non_shared" ;;
1436   esac
1437 fi
1438
1439 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1440
1441 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1442 { test "$extra_verbose" = "yes" && cat << EOF
1443     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1444 EOF
1445 cat >> confdefs.h <<EOF
1446 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1447 EOF
1448 }
1449
1450
1451 machfile="m/${machine}.h"
1452 opsysfile="s/${opsys}.h"
1453
1454
1455 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1456 if test "$with_workshop $with_tooltalk" = "yes no"; then
1457   (echo "$progname: Usage error:"
1458 echo " " "--with-workshop requires --with-tooltalk"
1459 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1460 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1461 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1462 fi
1463
1464 if test "$with_workshop" = "yes"; then
1465   { test "$extra_verbose" = "yes" && cat << \EOF
1466     Defining SUNPRO
1467 EOF
1468 cat >> confdefs.h <<\EOF
1469 #define SUNPRO 1
1470 EOF
1471 }
1472
1473   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1474    echo "    xemacs will be linked with \"sunpro.o\""
1475  fi
1476 fi
1477
1478 if test "$with_clash_detection" = "yes"; then
1479   { test "$extra_verbose" = "yes" && cat << \EOF
1480     Defining CLASH_DETECTION
1481 EOF
1482 cat >> confdefs.h <<\EOF
1483 #define CLASH_DETECTION 1
1484 EOF
1485 }
1486
1487   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1488    echo "    xemacs will be linked with \"filelock.o\""
1489  fi
1490 fi
1491
1492 test -n "$compiler" && CC="$compiler"
1493 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1494 fi
1495
1496 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1497 if test "${CFLAGS-unset}" != unset
1498   then cflags_specified=yes;
1499   else cflags_specified=no;
1500 fi
1501
1502 xe_save_CFLAGS="$CFLAGS"
1503
1504 # Extract the first word of "gcc", so it can be a program name with args.
1505 set dummy gcc; ac_word=$2
1506 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1507 echo "configure:1508: checking for $ac_word" >&5
1508
1509 if test -n "$CC"; then
1510   ac_cv_prog_CC="$CC" # Let the user override the test.
1511 else
1512   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1513   for ac_dir in $PATH; do
1514     test -z "$ac_dir" && ac_dir=.
1515     if test -f $ac_dir/$ac_word; then
1516       ac_cv_prog_CC="gcc"
1517       break
1518     fi
1519   done
1520   IFS="$ac_save_ifs"
1521 fi
1522 CC="$ac_cv_prog_CC"
1523 if test -n "$CC"; then
1524   echo "$ac_t""$CC" 1>&6
1525 else
1526   echo "$ac_t""no" 1>&6
1527 fi
1528
1529 if test -z "$CC"; then
1530   # Extract the first word of "cc", so it can be a program name with args.
1531 set dummy cc; ac_word=$2
1532 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1533 echo "configure:1534: checking for $ac_word" >&5
1534
1535 if test -n "$CC"; then
1536   ac_cv_prog_CC="$CC" # Let the user override the test.
1537 else
1538   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1539   ac_prog_rejected=no
1540   for ac_dir in $PATH; do
1541     test -z "$ac_dir" && ac_dir=.
1542     if test -f $ac_dir/$ac_word; then
1543       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1544         ac_prog_rejected=yes
1545         continue
1546       fi
1547       ac_cv_prog_CC="cc"
1548       break
1549     fi
1550   done
1551   IFS="$ac_save_ifs"
1552 if test $ac_prog_rejected = yes; then
1553   # We found a bogon in the path, so make sure we never use it.
1554   set dummy $ac_cv_prog_CC
1555   shift
1556   if test $# -gt 0; then
1557     # We chose a different compiler from the bogus one.
1558     # However, it has the same basename, so the bogon will be chosen
1559     # first if we set CC to just the basename; use the full file name.
1560     shift
1561     set dummy "$ac_dir/$ac_word" "$@"
1562     shift
1563     ac_cv_prog_CC="$@"
1564   fi
1565 fi
1566 fi
1567 CC="$ac_cv_prog_CC"
1568 if test -n "$CC"; then
1569   echo "$ac_t""$CC" 1>&6
1570 else
1571   echo "$ac_t""no" 1>&6
1572 fi
1573
1574   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1575 fi
1576
1577 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1578 echo "configure:1579: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1579
1580 ac_ext=c
1581 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1582 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1583 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1584 ac_cpp='$CPP '"$xe_cppflags"
1585 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1586 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1587 cross_compiling=no
1588
1589 cat > conftest.$ac_ext <<EOF
1590 #line 1591 "configure"
1591 #include "confdefs.h"
1592 main(){return(0);}
1593 EOF
1594 if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1595   ac_cv_prog_cc_works=yes
1596   # If we can't run a trivial program, we are probably using a cross compiler.
1597   if (./conftest; exit) 2>/dev/null; then
1598     ac_cv_prog_cc_cross=no
1599   else
1600     ac_cv_prog_cc_cross=yes
1601   fi
1602 else
1603   echo "configure: failed program was:" >&5
1604   cat conftest.$ac_ext >&5
1605   ac_cv_prog_cc_works=no
1606 fi
1607 rm -fr conftest*
1608
1609 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1610 if test $ac_cv_prog_cc_works = no; then
1611   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1612 fi
1613 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1614 echo "configure:1615: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1615 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1616 cross_compiling=$ac_cv_prog_cc_cross
1617
1618 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1619 echo "configure:1620: checking whether we are using GNU C" >&5
1620
1621 cat > conftest.c <<EOF
1622 #ifdef __GNUC__
1623   yes;
1624 #endif
1625 EOF
1626 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1627   ac_cv_prog_gcc=yes
1628 else
1629   ac_cv_prog_gcc=no
1630 fi
1631
1632 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1633
1634 if test $ac_cv_prog_gcc = yes; then
1635   GCC=yes
1636   ac_test_CFLAGS="${CFLAGS+set}"
1637   ac_save_CFLAGS="$CFLAGS"
1638   CFLAGS=
1639   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1640 echo "configure:1641: checking whether ${CC-cc} accepts -g" >&5
1641
1642 echo 'void f(){}' > conftest.c
1643 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1644   ac_cv_prog_cc_g=yes
1645 else
1646   ac_cv_prog_cc_g=no
1647 fi
1648 rm -f conftest*
1649
1650
1651 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1652   if test "$ac_test_CFLAGS" = set; then
1653     CFLAGS="$ac_save_CFLAGS"
1654   elif test $ac_cv_prog_cc_g = yes; then
1655     CFLAGS="-g -O2"
1656   else
1657     CFLAGS="-O2"
1658   fi
1659 else
1660   GCC=
1661   test "${CFLAGS+set}" = set || CFLAGS="-g"
1662 fi
1663  
1664 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1665   CC=${NON_GNU_CC-cc}
1666   # Extract the first word of "gcc", so it can be a program name with args.
1667 set dummy gcc; ac_word=$2
1668 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1669 echo "configure:1670: checking for $ac_word" >&5
1670
1671 if test -n "$CC"; then
1672   ac_cv_prog_CC="$CC" # Let the user override the test.
1673 else
1674   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1675   for ac_dir in $PATH; do
1676     test -z "$ac_dir" && ac_dir=.
1677     if test -f $ac_dir/$ac_word; then
1678       ac_cv_prog_CC="gcc"
1679       break
1680     fi
1681   done
1682   IFS="$ac_save_ifs"
1683 fi
1684 CC="$ac_cv_prog_CC"
1685 if test -n "$CC"; then
1686   echo "$ac_t""$CC" 1>&6
1687 else
1688   echo "$ac_t""no" 1>&6
1689 fi
1690
1691 if test -z "$CC"; then
1692   # Extract the first word of "cc", so it can be a program name with args.
1693 set dummy cc; ac_word=$2
1694 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1695 echo "configure:1696: checking for $ac_word" >&5
1696
1697 if test -n "$CC"; then
1698   ac_cv_prog_CC="$CC" # Let the user override the test.
1699 else
1700   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1701   ac_prog_rejected=no
1702   for ac_dir in $PATH; do
1703     test -z "$ac_dir" && ac_dir=.
1704     if test -f $ac_dir/$ac_word; then
1705       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1706         ac_prog_rejected=yes
1707         continue
1708       fi
1709       ac_cv_prog_CC="cc"
1710       break
1711     fi
1712   done
1713   IFS="$ac_save_ifs"
1714 if test $ac_prog_rejected = yes; then
1715   # We found a bogon in the path, so make sure we never use it.
1716   set dummy $ac_cv_prog_CC
1717   shift
1718   if test $# -gt 0; then
1719     # We chose a different compiler from the bogus one.
1720     # However, it has the same basename, so the bogon will be chosen
1721     # first if we set CC to just the basename; use the full file name.
1722     shift
1723     set dummy "$ac_dir/$ac_word" "$@"
1724     shift
1725     ac_cv_prog_CC="$@"
1726   fi
1727 fi
1728 fi
1729 CC="$ac_cv_prog_CC"
1730 if test -n "$CC"; then
1731   echo "$ac_t""$CC" 1>&6
1732 else
1733   echo "$ac_t""no" 1>&6
1734 fi
1735
1736   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1737 fi
1738
1739 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1740 echo "configure:1741: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1741
1742 ac_ext=c
1743 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1744 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1745 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1746 ac_cpp='$CPP '"$xe_cppflags"
1747 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1748 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1749 cross_compiling=no
1750
1751 cat > conftest.$ac_ext <<EOF
1752 #line 1753 "configure"
1753 #include "confdefs.h"
1754 main(){return(0);}
1755 EOF
1756 if { (eval echo configure:1757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1757   ac_cv_prog_cc_works=yes
1758   # If we can't run a trivial program, we are probably using a cross compiler.
1759   if (./conftest; exit) 2>/dev/null; then
1760     ac_cv_prog_cc_cross=no
1761   else
1762     ac_cv_prog_cc_cross=yes
1763   fi
1764 else
1765   echo "configure: failed program was:" >&5
1766   cat conftest.$ac_ext >&5
1767   ac_cv_prog_cc_works=no
1768 fi
1769 rm -fr conftest*
1770
1771 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1772 if test $ac_cv_prog_cc_works = no; then
1773   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1774 fi
1775 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1776 echo "configure:1777: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1777 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1778 cross_compiling=$ac_cv_prog_cc_cross
1779
1780 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1781 echo "configure:1782: checking whether we are using GNU C" >&5
1782
1783 cat > conftest.c <<EOF
1784 #ifdef __GNUC__
1785   yes;
1786 #endif
1787 EOF
1788 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1789   ac_cv_prog_gcc=yes
1790 else
1791   ac_cv_prog_gcc=no
1792 fi
1793
1794 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1795
1796 if test $ac_cv_prog_gcc = yes; then
1797   GCC=yes
1798   ac_test_CFLAGS="${CFLAGS+set}"
1799   ac_save_CFLAGS="$CFLAGS"
1800   CFLAGS=
1801   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1802 echo "configure:1803: checking whether ${CC-cc} accepts -g" >&5
1803
1804 echo 'void f(){}' > conftest.c
1805 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1806   ac_cv_prog_cc_g=yes
1807 else
1808   ac_cv_prog_cc_g=no
1809 fi
1810 rm -f conftest*
1811
1812
1813 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1814   if test "$ac_test_CFLAGS" = set; then
1815     CFLAGS="$ac_save_CFLAGS"
1816   elif test $ac_cv_prog_cc_g = yes; then
1817     CFLAGS="-g -O2"
1818   else
1819     CFLAGS="-O2"
1820   fi
1821 else
1822   GCC=
1823   test "${CFLAGS+set}" = set || CFLAGS="-g"
1824 fi
1825
1826 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1827   CC=gcc
1828   # Extract the first word of "gcc", so it can be a program name with args.
1829 set dummy gcc; ac_word=$2
1830 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1831 echo "configure:1832: checking for $ac_word" >&5
1832
1833 if test -n "$CC"; then
1834   ac_cv_prog_CC="$CC" # Let the user override the test.
1835 else
1836   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1837   for ac_dir in $PATH; do
1838     test -z "$ac_dir" && ac_dir=.
1839     if test -f $ac_dir/$ac_word; then
1840       ac_cv_prog_CC="gcc"
1841       break
1842     fi
1843   done
1844   IFS="$ac_save_ifs"
1845 fi
1846 CC="$ac_cv_prog_CC"
1847 if test -n "$CC"; then
1848   echo "$ac_t""$CC" 1>&6
1849 else
1850   echo "$ac_t""no" 1>&6
1851 fi
1852
1853 if test -z "$CC"; then
1854   # Extract the first word of "cc", so it can be a program name with args.
1855 set dummy cc; ac_word=$2
1856 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1857 echo "configure:1858: checking for $ac_word" >&5
1858
1859 if test -n "$CC"; then
1860   ac_cv_prog_CC="$CC" # Let the user override the test.
1861 else
1862   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1863   ac_prog_rejected=no
1864   for ac_dir in $PATH; do
1865     test -z "$ac_dir" && ac_dir=.
1866     if test -f $ac_dir/$ac_word; then
1867       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1868         ac_prog_rejected=yes
1869         continue
1870       fi
1871       ac_cv_prog_CC="cc"
1872       break
1873     fi
1874   done
1875   IFS="$ac_save_ifs"
1876 if test $ac_prog_rejected = yes; then
1877   # We found a bogon in the path, so make sure we never use it.
1878   set dummy $ac_cv_prog_CC
1879   shift
1880   if test $# -gt 0; then
1881     # We chose a different compiler from the bogus one.
1882     # However, it has the same basename, so the bogon will be chosen
1883     # first if we set CC to just the basename; use the full file name.
1884     shift
1885     set dummy "$ac_dir/$ac_word" "$@"
1886     shift
1887     ac_cv_prog_CC="$@"
1888   fi
1889 fi
1890 fi
1891 CC="$ac_cv_prog_CC"
1892 if test -n "$CC"; then
1893   echo "$ac_t""$CC" 1>&6
1894 else
1895   echo "$ac_t""no" 1>&6
1896 fi
1897
1898   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1899 fi
1900
1901 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1902 echo "configure:1903: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1903
1904 ac_ext=c
1905 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1906 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1907 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1908 ac_cpp='$CPP '"$xe_cppflags"
1909 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1910 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1911 cross_compiling=no
1912
1913 cat > conftest.$ac_ext <<EOF
1914 #line 1915 "configure"
1915 #include "confdefs.h"
1916 main(){return(0);}
1917 EOF
1918 if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1919   ac_cv_prog_cc_works=yes
1920   # If we can't run a trivial program, we are probably using a cross compiler.
1921   if (./conftest; exit) 2>/dev/null; then
1922     ac_cv_prog_cc_cross=no
1923   else
1924     ac_cv_prog_cc_cross=yes
1925   fi
1926 else
1927   echo "configure: failed program was:" >&5
1928   cat conftest.$ac_ext >&5
1929   ac_cv_prog_cc_works=no
1930 fi
1931 rm -fr conftest*
1932
1933 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1934 if test $ac_cv_prog_cc_works = no; then
1935   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1936 fi
1937 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1938 echo "configure:1939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1939 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1940 cross_compiling=$ac_cv_prog_cc_cross
1941
1942 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1943 echo "configure:1944: checking whether we are using GNU C" >&5
1944
1945 cat > conftest.c <<EOF
1946 #ifdef __GNUC__
1947   yes;
1948 #endif
1949 EOF
1950 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1951   ac_cv_prog_gcc=yes
1952 else
1953   ac_cv_prog_gcc=no
1954 fi
1955
1956 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1957
1958 if test $ac_cv_prog_gcc = yes; then
1959   GCC=yes
1960   ac_test_CFLAGS="${CFLAGS+set}"
1961   ac_save_CFLAGS="$CFLAGS"
1962   CFLAGS=
1963   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1964 echo "configure:1965: checking whether ${CC-cc} accepts -g" >&5
1965
1966 echo 'void f(){}' > conftest.c
1967 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1968   ac_cv_prog_cc_g=yes
1969 else
1970   ac_cv_prog_cc_g=no
1971 fi
1972 rm -f conftest*
1973
1974
1975 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1976   if test "$ac_test_CFLAGS" = set; then
1977     CFLAGS="$ac_save_CFLAGS"
1978   elif test $ac_cv_prog_cc_g = yes; then
1979     CFLAGS="-g -O2"
1980   else
1981     CFLAGS="-O2"
1982   fi
1983 else
1984   GCC=
1985   test "${CFLAGS+set}" = set || CFLAGS="-g"
1986 fi
1987
1988 fi
1989 CFLAGS="$xe_save_CFLAGS"
1990
1991
1992 test -n "$CPP" -a -d "$CPP" && CPP=
1993
1994 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1995
1996 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1997 echo "configure:1998: checking how to run the C preprocessor" >&5
1998 # On Suns, sometimes $CPP names a directory.
1999 if test -n "$CPP" && test -d "$CPP"; then
2000   CPP=
2001 fi
2002 if test -z "$CPP"; then
2003
2004   # This must be in double quotes, not single quotes, because CPP may get
2005   # substituted into the Makefile and "${CC-cc}" will confuse make.
2006   CPP="${CC-cc} -E"
2007   # On the NeXT, cc -E runs the code through the compiler's parser,
2008   # not just through cpp.
2009   cat > conftest.$ac_ext <<EOF
2010 #line 2011 "configure"
2011 #include "confdefs.h"
2012 #include <assert.h>
2013 Syntax Error
2014 EOF
2015 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2016 { (eval echo configure:2017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2017 ac_err=`grep -v '^ *+' conftest.out`
2018 if test -z "$ac_err"; then
2019   :
2020 else
2021   echo "$ac_err" >&5
2022   echo "configure: failed program was:" >&5
2023   cat conftest.$ac_ext >&5
2024   rm -rf conftest*
2025   CPP="${CC-cc} -E -traditional-cpp"
2026   cat > conftest.$ac_ext <<EOF
2027 #line 2028 "configure"
2028 #include "confdefs.h"
2029 #include <assert.h>
2030 Syntax Error
2031 EOF
2032 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2033 { (eval echo configure:2034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2034 ac_err=`grep -v '^ *+' conftest.out`
2035 if test -z "$ac_err"; then
2036   :
2037 else
2038   echo "$ac_err" >&5
2039   echo "configure: failed program was:" >&5
2040   cat conftest.$ac_ext >&5
2041   rm -rf conftest*
2042   CPP=/lib/cpp
2043 fi
2044 rm -f conftest*
2045 fi
2046 rm -f conftest*
2047   ac_cv_prog_CPP="$CPP"
2048   CPP="$ac_cv_prog_CPP"
2049 else
2050   ac_cv_prog_CPP="$CPP"
2051 fi
2052 echo "$ac_t""$CPP" 1>&6
2053
2054
2055 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2056 echo "configure:2057: checking for AIX" >&5
2057 cat > conftest.$ac_ext <<EOF
2058 #line 2059 "configure"
2059 #include "confdefs.h"
2060 #ifdef _AIX
2061   yes
2062 #endif
2063
2064 EOF
2065 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2066   egrep "yes" >/dev/null 2>&1; then
2067   rm -rf conftest*
2068   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2069     Defining _ALL_SOURCE
2070 EOF
2071 cat >> confdefs.h <<\EOF
2072 #define _ALL_SOURCE 1
2073 EOF
2074 }
2075
2076 else
2077   rm -rf conftest*
2078   echo "$ac_t""no" 1>&6
2079 fi
2080 rm -f conftest*
2081
2082
2083
2084 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2085 echo "configure:2086: checking for GNU libc" >&5
2086 cat > conftest.$ac_ext <<EOF
2087 #line 2088 "configure"
2088 #include "confdefs.h"
2089 #include <features.h>
2090 int main() {
2091
2092 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2093 #error Not a GNU libc system :-(
2094 ******* ======= ******** &&&&&&&&
2095 #endif
2096
2097 ; return 0; }
2098 EOF
2099 if { (eval echo configure:2100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2100   rm -rf conftest*
2101   have_glibc=yes
2102 else
2103   echo "configure: failed program was:" >&5
2104   cat conftest.$ac_ext >&5
2105   rm -rf conftest*
2106   have_glibc=no
2107 fi
2108 rm -f conftest*
2109 echo "$ac_t""$have_glibc" 1>&6
2110 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2111     Defining _GNU_SOURCE
2112 EOF
2113 cat >> confdefs.h <<\EOF
2114 #define _GNU_SOURCE 1
2115 EOF
2116 }
2117
2118
2119
2120 cat > conftest.$ac_ext <<EOF
2121 #line 2122 "configure"
2122 #include "confdefs.h"
2123 int main () {
2124 #if defined __SUNPRO_C
2125 return 11;
2126 #elif defined __DECC
2127 return 12;
2128 #else
2129 return 0;
2130 #endif
2131 }
2132 EOF
2133 if { (eval echo configure:2134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2134 then
2135   :
2136 else
2137   conftest_rc="$?"
2138   echo "configure: failed program was:" >&5
2139   cat conftest.$ac_ext >&5
2140   rm -fr conftest*
2141   case "$conftest_rc" in
2142   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2143   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2144 esac
2145 fi
2146 rm -fr conftest*
2147
2148
2149
2150
2151 echo "Extracting information from the machine- and system-dependent headers..."
2152
2153 tempcname="conftest.c"
2154
2155
2156
2157 cat > $tempcname <<EOF
2158 #define NOT_C_CODE
2159 #define C_SWITCH_SITE
2160 #define C_SWITCH_X_SITE
2161 #define LD_SWITCH_SITE
2162 #define LD_SWITCH_X_SITE
2163 #define LD_SWITCH_X_SITE_AUX
2164 #define OS_RELEASE $os_release
2165 #include "$srcdir/src/$opsysfile"
2166 #include "$srcdir/src/$machfile"
2167
2168 #ifndef LIBS_MACHINE
2169 #define LIBS_MACHINE
2170 #endif
2171 configure___ libs_machine=LIBS_MACHINE
2172
2173 #ifndef LIBS_SYSTEM
2174 #define LIBS_SYSTEM
2175 #endif
2176 configure___ libs_system=LIBS_SYSTEM
2177
2178 #ifndef LIBS_TERMCAP
2179 #define LIBS_TERMCAP
2180 #endif
2181 configure___ libs_termcap=LIBS_TERMCAP
2182
2183 #ifndef LIB_STANDARD
2184 #define LIB_STANDARD
2185 #endif
2186 configure___ libs_standard=LIB_STANDARD
2187
2188
2189 #ifndef OBJECTS_MACHINE
2190 #define OBJECTS_MACHINE
2191 #endif
2192 configure___ objects_machine=OBJECTS_MACHINE
2193
2194 #ifndef OBJECTS_SYSTEM
2195 #define OBJECTS_SYSTEM
2196 #endif
2197 configure___ objects_system=OBJECTS_SYSTEM
2198
2199
2200 #ifndef C_SWITCH_MACHINE
2201 #define C_SWITCH_MACHINE
2202 #endif
2203 configure___ c_switch_machine=C_SWITCH_MACHINE
2204
2205 #ifndef C_SWITCH_SYSTEM
2206 #define C_SWITCH_SYSTEM
2207 #endif
2208 configure___ c_switch_system=C_SWITCH_SYSTEM
2209
2210
2211 #ifndef LD_SWITCH_MACHINE
2212 #define LD_SWITCH_MACHINE
2213 #endif
2214 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2215
2216 #ifndef LD_SWITCH_SYSTEM
2217 #define LD_SWITCH_SYSTEM
2218 #endif
2219 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2220
2221
2222 #ifndef UNEXEC
2223 #define UNEXEC "unexec.o"
2224 #endif
2225 configure___ unexec=UNEXEC
2226
2227
2228 #ifndef LD_SWITCH_SHARED
2229 #define LD_SWITCH_SHARED "-c"
2230 #endif
2231 configure___ ld_switch_shared=LD_SWITCH_SHARED
2232
2233
2234 #ifdef ORDINARY_LINK
2235 #define LD "\$(CC) \$(CFLAGS)"
2236 #else /* no ORDINARY LINK */
2237 #ifdef COFF_ENCAPSULATE
2238 #define LD "\$(CC) -nostdlib"
2239 #else /* not COFF_ENCAPSULATE */
2240 #ifdef LINKER
2241 #define LD LINKER
2242 #else /* ! defined (LINKER) */
2243 #define LD "ld"
2244 #endif /* ! defined (LINKER) */
2245 #endif /* ! defined (COFF_ENCAPSULATE) */
2246 #endif /* not ORDINARY_LINK */
2247 configure___ ld=LD
2248
2249 #ifndef LIB_GCC
2250 #define LIB_GCC
2251 #endif
2252 configure___ lib_gcc=LIB_GCC
2253
2254 #ifndef LD_TEXT_START_ADDR
2255 #define LD_TEXT_START_ADDR
2256 #endif
2257 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2258
2259
2260 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2261 #ifdef NO_REMAP
2262 #ifdef COFF_ENCAPSULATE
2263 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2264 #else /* ! defined (COFF_ENCAPSULATE) */
2265 #define START_FILES "pre-crt0.o /lib/crt0.o"
2266 #endif /* ! defined (COFF_ENCAPSULATE) */
2267 #else /* ! defined (NO_REMAP) */
2268 #define START_FILES "ecrt0.o"
2269 #endif /* ! defined (NO_REMAP) */
2270 #endif /* no ORDINARY_LINK */
2271 #ifndef START_FILES
2272 #define START_FILES
2273 #endif
2274 configure___ start_files=START_FILES
2275
2276 #ifdef ORDINARY_LINK
2277 configure___ ordinary_link=yes
2278 #else
2279 configure___ ordinary_link=no
2280 #endif
2281
2282 #ifdef SYSTEM_MALLOC
2283 configure___ system_malloc=yes
2284 #else
2285 configure___ system_malloc=no
2286 #endif
2287
2288 #ifdef TERMINFO
2289 configure___ have_terminfo=yes
2290 #else
2291 configure___ have_terminfo=no
2292 #endif
2293
2294 #ifdef MAIL_USE_FLOCK
2295 configure___ mail_use_flock=yes
2296 #else
2297 configure___ mail_use_flock=no
2298 #endif
2299
2300 #ifdef MAIL_USE_LOCKF
2301 configure___ mail_use_lockf=yes
2302 #else
2303 configure___ mail_use_lockf=no
2304 #endif
2305
2306 #ifdef HAVE_WIN32_PROCESSES
2307 configure___ win32_processes=yes
2308 #else
2309 configure___ win32_processes=no
2310 #endif
2311
2312 EOF
2313
2314 CPP=`eval "echo $CPP $CPPFLAGS"`
2315 eval `$CPP -Isrc $tempcname \
2316         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2317
2318 rm $tempcname
2319
2320 test "$extra_verbose" = "yes" && \
2321   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 ""
2322
2323 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2324
2325 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2326
2327 if test "$cflags_specified" = "no"; then
2328       if   test "$GCC" = "yes"; then
2329     CFLAGS="-g -O3 -Wall -Wno-switch"
2330               elif test "$__SUNPRO_C" = "yes"; then
2331     case "$opsys" in
2332       sol2    ) CFLAGS="-v -xO4" ;;
2333       sunos4* ) CFLAGS="-xO2";;
2334     esac
2335   elif test "$__DECC" = "yes"; then
2336     CFLAGS="-O3"
2337   elif test "$CC" = "xlc"; then
2338     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2339     else
2340     CFLAGS="-O" ;  fi
2341 fi
2342
2343
2344 if test "$GCC" = "yes"; then
2345   set x $ld_switch_system; shift; ld_switch_system=""
2346   while test -n "$1"; do
2347     case $1 in
2348       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2349       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2350       -Xlinker* ) ;;
2351       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2352     esac
2353     shift
2354   done
2355 fi
2356
2357 if test "$GCC" = "yes"; then
2358   set x $ld_switch_machine; shift; ld_switch_machine=""
2359   while test -n "$1"; do
2360     case $1 in
2361       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2362       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2363       -Xlinker* ) ;;
2364       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2365     esac
2366     shift
2367   done
2368 fi
2369
2370 if test "$GCC" = "yes"; then
2371   set x $LDFLAGS; shift; LDFLAGS=""
2372   while test -n "$1"; do
2373     case $1 in
2374       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2375       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2376       -Xlinker* ) ;;
2377       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2378     esac
2379     shift
2380   done
2381 fi
2382
2383 if test "$GCC" = "yes"; then
2384   set x $ld_call_shared; shift; ld_call_shared=""
2385   while test -n "$1"; do
2386     case $1 in
2387       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2388       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2389       -Xlinker* ) ;;
2390       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2391     esac
2392     shift
2393   done
2394 fi
2395
2396 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2397    echo "    xemacs will be linked with \"$objects_machine\""
2398  fi
2399 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2400    echo "    xemacs will be linked with \"$objects_system\""
2401  fi
2402 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2403    echo "    xemacs will be linked with \"$unexec\""
2404  fi
2405
2406 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2407 echo "configure:2408: checking for dynodump" >&5
2408 if test "$unexec" != "unexsol2.o"; then
2409   echo "$ac_t""no" 1>&6
2410 else
2411   echo "$ac_t""yes" 1>&6
2412   { test "$extra_verbose" = "yes" && cat << \EOF
2413     Defining DYNODUMP
2414 EOF
2415 cat >> confdefs.h <<\EOF
2416 #define DYNODUMP 1
2417 EOF
2418 }
2419
2420   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2421   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2422   case "$machine" in
2423     sparc   ) dynodump_arch=sparc ;;
2424     *86*    ) dynodump_arch=i386  ;;
2425     powerpc ) dynodump_arch=ppc   ;;
2426   esac
2427     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
2428 fi
2429
2430
2431 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2432
2433 if test "$unexec" = "unexaix.o"; then
2434   if   test "$dynamic" = "no"; then
2435   start_flags="-Wl,-bnso,-bnodelcsect"
2436   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2437   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2438     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2439   done
2440   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2441     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2442   done
2443   
2444 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2445 echo "configure:2446: checking for terminateAndUnload in -lC" >&5
2446 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2447
2448 xe_check_libs=" -lC "
2449 cat > conftest.$ac_ext <<EOF
2450 #line 2451 "configure"
2451 #include "confdefs.h"
2452 /* Override any gcc2 internal prototype to avoid an error.  */
2453 /* We use char because int might match the return type of a gcc2
2454     builtin and then its argument prototype would still apply.  */
2455 char terminateAndUnload();
2456
2457 int main() {
2458 terminateAndUnload()
2459 ; return 0; }
2460 EOF
2461 if { (eval echo configure:2462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2462   rm -rf conftest*
2463   eval "ac_cv_lib_$ac_lib_var=yes"
2464 else
2465   echo "configure: failed program was:" >&5
2466   cat conftest.$ac_ext >&5
2467   rm -rf conftest*
2468   eval "ac_cv_lib_$ac_lib_var=no"
2469 fi
2470 rm -f conftest*
2471 xe_check_libs=""
2472
2473 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2474   echo "$ac_t""yes" 1>&6
2475   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2476 else
2477   echo "$ac_t""no" 1>&6
2478 fi
2479
2480
2481   fi
2482 elif test -n "$ld_text_start_addr"; then
2483   start_flags="-T $ld_text_start_addr -e __start"
2484 fi
2485
2486
2487
2488
2489 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2490  test -z "$linker" &&  linker='$(CC) -nostdlib'
2491  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2492 fi
2493 test "$GCC" != "yes" && lib_gcc=
2494
2495
2496
2497
2498
2499 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2500 if test -n "$site_libraries"; then
2501   for arg in $site_libraries; do
2502     case "$arg" in
2503      -* ) ;;
2504      * ) test -d "$arg" || \
2505            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2506        arg="-L${arg}" ;;
2507     esac
2508     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2509   done
2510 fi
2511
2512 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2513 if test -n "$site_includes"; then
2514   for arg in $site_includes; do
2515     case "$arg" in
2516       -* ) ;;
2517       * ) test -d "$arg" || \
2518            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2519       arg="-I${arg}" ;;
2520     esac
2521     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2522   done
2523 fi
2524
2525 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2526 if test -n "$site_prefixes"; then
2527   for dir in $site_prefixes; do
2528     lib_dir="${dir}/lib"
2529     inc_dir="${dir}/include"
2530     if test ! -d "$dir"; then
2531       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2532     elif test ! -d "$lib_dir"; then
2533       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2534     else
2535       if test -d "$inc_dir"; then
2536         c_switch_site="$c_switch_site "-I$inc_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-I$inc_dir"\" to \$c_switch_site"; fi
2537       fi
2538       ld_switch_site="$ld_switch_site "-L$lib_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-L$lib_dir"\" to \$ld_switch_site"; fi
2539     fi
2540   done
2541 fi
2542
2543
2544 for dir in "/usr/ccs/lib"; do
2545   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
2546 done
2547
2548 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2549 if test -n "$site_runtime_libraries"; then
2550   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2551   export LD_RUN_PATH
2552 fi
2553
2554
2555 if   test "$dynamic" = "no"; then add_runtime_path=no
2556 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2557 else case "$opsys" in
2558        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2559        * ) add_runtime_path=no ;;
2560      esac
2561 fi
2562
2563 if test "$add_runtime_path" = "yes"; then
2564       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2565 echo "configure:2566: checking "for runtime libraries flag"" >&5
2566   case "$opsys" in
2567     sol2 ) dash_r="-R" ;;
2568     decosf* | linux* | irix*) dash_r="-rpath " ;;
2569     *)
2570       dash_r=""
2571       for try_dash_r in "-R" "-R " "-rpath "; do
2572         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2573         
2574 if test "$GCC" = "yes"; then
2575   set x $xe_check_libs; shift; xe_check_libs=""
2576   while test -n "$1"; do
2577     case $1 in
2578       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2579       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2580       -Xlinker* ) ;;
2581       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2582     esac
2583     shift
2584   done
2585 fi
2586         cat > conftest.$ac_ext <<EOF
2587 #line 2588 "configure"
2588 #include "confdefs.h"
2589
2590 int main() {
2591
2592 ; return 0; }
2593 EOF
2594 if { (eval echo configure:2595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2595   rm -rf conftest*
2596   dash_r="$try_dash_r"
2597 else
2598   echo "configure: failed program was:" >&5
2599   cat conftest.$ac_ext >&5
2600 fi
2601 rm -f conftest*
2602         xe_check_libs=""
2603         test -n "$dash_r" && break
2604       done ;;
2605   esac
2606   if test -n "$dash_r";
2607     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2608     else echo "$ac_t""NONE" 1>&6
2609   fi
2610 fi
2611
2612 xe_add_unique_runpath_dir='
2613   xe_add_p=yes
2614   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2615   done
2616   if test "$xe_add_p" = "yes"; then
2617     test -n "$runpath" && runpath="${runpath}:"
2618     runpath="${runpath}${xe_runpath_dir}"
2619     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2620   fi'
2621
2622
2623
2624
2625 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2626     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2627   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2628   
2629         runpath="" runpath_dirs=""
2630   if test -n "$LD_RUN_PATH"; then
2631     runpath="$LD_RUN_PATH"
2632   elif test "$GCC" = "yes"; then
2633         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2634     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2635     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2636     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2637       case "$arg" in P,* | -L* | -R* )
2638         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2639           {
2640 xe_runpath_dir="$dir"
2641   test "$xe_runpath_dir" != "/lib"     -a \
2642         "$xe_runpath_dir" != "/usr/lib" -a \
2643         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2644   eval "$xe_add_unique_runpath_dir"
2645 }
2646         done ;;
2647       esac
2648     done
2649     ld_switch_run="$ld_switch_run_save"
2650     rm -f conftest*
2651   else
2652         for arg in $ld_switch_site $ld_switch_x_site; do
2653       case "$arg" in -L*) {
2654 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2655   test "$xe_runpath_dir" != "/lib"     -a \
2656         "$xe_runpath_dir" != "/usr/lib" -a \
2657         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2658   eval "$xe_add_unique_runpath_dir"
2659 };; esac
2660     done
2661         if test "$opsys $need_motif" = "sol2 yes"; then
2662       xe_runpath_dir="/opt/SUNWdt/lib";
2663       eval "$xe_add_unique_runpath_dir";
2664     fi
2665   fi 
2666   if test -n "$runpath"; then
2667     ld_switch_run="${dash_r}${runpath}"
2668     
2669 if test "$GCC" = "yes"; then
2670   set x $ld_switch_run; shift; ld_switch_run=""
2671   while test -n "$1"; do
2672     case $1 in
2673       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2674       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2675       -Xlinker* ) ;;
2676       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2677     esac
2678     shift
2679   done
2680 fi
2681     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2682   fi
2683 fi
2684
2685
2686
2687
2688 GNU_MALLOC=yes
2689 if test "$with_dlmalloc" != "no"; then
2690         doug_lea_malloc=yes
2691 else
2692         doug_lea_malloc=no
2693 fi
2694 after_morecore_hook_exists=yes
2695 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2696 echo "configure:2697: checking for malloc_get_state" >&5
2697
2698 cat > conftest.$ac_ext <<EOF
2699 #line 2700 "configure"
2700 #include "confdefs.h"
2701 /* System header to define __stub macros and hopefully few prototypes,
2702     which can conflict with char malloc_get_state(); below.  */
2703 #include <assert.h>
2704 /* Override any gcc2 internal prototype to avoid an error.  */
2705 /* We use char because int might match the return type of a gcc2
2706     builtin and then its argument prototype would still apply.  */
2707 char malloc_get_state();
2708
2709 int main() {
2710
2711 /* The GNU C library defines this for functions which it implements
2712     to always fail with ENOSYS.  Some functions are actually named
2713     something starting with __ and the normal name is an alias.  */
2714 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2715 choke me
2716 #else
2717 malloc_get_state();
2718 #endif
2719
2720 ; return 0; }
2721 EOF
2722 if { (eval echo configure:2723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2723   rm -rf conftest*
2724   eval "ac_cv_func_malloc_get_state=yes"
2725 else
2726   echo "configure: failed program was:" >&5
2727   cat conftest.$ac_ext >&5
2728   rm -rf conftest*
2729   eval "ac_cv_func_malloc_get_state=no"
2730 fi
2731 rm -f conftest*
2732
2733 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2734   echo "$ac_t""yes" 1>&6
2735   :
2736 else
2737   echo "$ac_t""no" 1>&6
2738 doug_lea_malloc=no
2739 fi
2740
2741 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2742 echo "configure:2743: checking for malloc_set_state" >&5
2743
2744 cat > conftest.$ac_ext <<EOF
2745 #line 2746 "configure"
2746 #include "confdefs.h"
2747 /* System header to define __stub macros and hopefully few prototypes,
2748     which can conflict with char malloc_set_state(); below.  */
2749 #include <assert.h>
2750 /* Override any gcc2 internal prototype to avoid an error.  */
2751 /* We use char because int might match the return type of a gcc2
2752     builtin and then its argument prototype would still apply.  */
2753 char malloc_set_state();
2754
2755 int main() {
2756
2757 /* The GNU C library defines this for functions which it implements
2758     to always fail with ENOSYS.  Some functions are actually named
2759     something starting with __ and the normal name is an alias.  */
2760 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2761 choke me
2762 #else
2763 malloc_set_state();
2764 #endif
2765
2766 ; return 0; }
2767 EOF
2768 if { (eval echo configure:2769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2769   rm -rf conftest*
2770   eval "ac_cv_func_malloc_set_state=yes"
2771 else
2772   echo "configure: failed program was:" >&5
2773   cat conftest.$ac_ext >&5
2774   rm -rf conftest*
2775   eval "ac_cv_func_malloc_set_state=no"
2776 fi
2777 rm -f conftest*
2778
2779 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2780   echo "$ac_t""yes" 1>&6
2781   :
2782 else
2783   echo "$ac_t""no" 1>&6
2784 doug_lea_malloc=no
2785 fi
2786
2787 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2788 echo "configure:2789: checking whether __after_morecore_hook exists" >&5
2789 cat > conftest.$ac_ext <<EOF
2790 #line 2791 "configure"
2791 #include "confdefs.h"
2792 extern void (* __after_morecore_hook)();
2793 int main() {
2794 __after_morecore_hook = 0
2795 ; return 0; }
2796 EOF
2797 if { (eval echo configure:2798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2798   rm -rf conftest*
2799   echo "$ac_t""yes" 1>&6
2800 else
2801   echo "configure: failed program was:" >&5
2802   cat conftest.$ac_ext >&5
2803   rm -rf conftest*
2804   echo "$ac_t""no" 1>&6
2805    after_morecore_hook_exists=no
2806 fi
2807 rm -f conftest*
2808 if test "$system_malloc" = "yes" ; then
2809   GNU_MALLOC=no
2810   GNU_MALLOC_reason="
2811   (The GNU allocators don't work with this system configuration)."
2812 elif test "$with_system_malloc" = "yes" ; then
2813   GNU_MALLOC=no
2814   GNU_MALLOC_reason="
2815   (User chose not to use GNU allocators)."
2816 elif test "$with_debug_malloc" = "yes" ; then
2817   GNU_MALLOC=no
2818   GNU_MALLOC_reason="
2819   (User chose to use Debugging Malloc)."
2820 fi
2821
2822 if test "$doug_lea_malloc" = "yes" ; then
2823   if test "$GNU_MALLOC" = yes ; then
2824     GNU_MALLOC_reason="
2825   (Using Doug Lea's new malloc from the GNU C Library.)"
2826   fi
2827   { test "$extra_verbose" = "yes" && cat << \EOF
2828     Defining DOUG_LEA_MALLOC
2829 EOF
2830 cat >> confdefs.h <<\EOF
2831 #define DOUG_LEA_MALLOC 1
2832 EOF
2833 }
2834
2835   if test "$after_morecore_hook_exists" = "no" ; then
2836     GNU_MALLOC_reason="
2837   (Using Doug Lea's new malloc from the Linux C Library.)"
2838     { test "$extra_verbose" = "yes" && cat << \EOF
2839     Defining _NO_MALLOC_WARNING_
2840 EOF
2841 cat >> confdefs.h <<\EOF
2842 #define _NO_MALLOC_WARNING_ 1
2843 EOF
2844 }
2845
2846   fi
2847   use_minimal_tagbits=yes
2848 fi
2849
2850
2851
2852
2853 # Extract the first word of "ranlib", so it can be a program name with args.
2854 set dummy ranlib; ac_word=$2
2855 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2856 echo "configure:2857: checking for $ac_word" >&5
2857
2858 if test -n "$RANLIB"; then
2859   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2860 else
2861   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2862   for ac_dir in $PATH; do
2863     test -z "$ac_dir" && ac_dir=.
2864     if test -f $ac_dir/$ac_word; then
2865       ac_cv_prog_RANLIB="ranlib"
2866       break
2867     fi
2868   done
2869   IFS="$ac_save_ifs"
2870   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2871 fi
2872 RANLIB="$ac_cv_prog_RANLIB"
2873 if test -n "$RANLIB"; then
2874   echo "$ac_t""$RANLIB" 1>&6
2875 else
2876   echo "$ac_t""no" 1>&6
2877 fi
2878
2879 ac_aux_dir=
2880 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2881   if test -f $ac_dir/install-sh; then
2882     ac_aux_dir=$ac_dir
2883     ac_install_sh="$ac_aux_dir/install-sh -c"
2884     break
2885   elif test -f $ac_dir/install.sh; then
2886     ac_aux_dir=$ac_dir
2887     ac_install_sh="$ac_aux_dir/install.sh -c"
2888     break
2889   fi
2890 done
2891 if test -z "$ac_aux_dir"; then
2892   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2893 fi
2894 ac_config_guess=$ac_aux_dir/config.guess
2895 ac_config_sub=$ac_aux_dir/config.sub
2896 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2897
2898 # Find a good install program.  We prefer a C program (faster),
2899 # so one script is as good as another.  But avoid the broken or
2900 # incompatible versions:
2901 # SysV /etc/install, /usr/sbin/install
2902 # SunOS /usr/etc/install
2903 # IRIX /sbin/install
2904 # AIX /bin/install
2905 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2906 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2907 # ./install, which can be erroneously created by make from ./install.sh.
2908 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2909 echo "configure:2910: checking for a BSD compatible install" >&5
2910 if test -z "$INSTALL"; then
2911
2912   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2913   for ac_dir in $PATH; do
2914     # Account for people who put trailing slashes in PATH elements.
2915     case "$ac_dir/" in
2916     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2917     *)
2918       # OSF1 and SCO ODT 3.0 have their own names for install.
2919       for ac_prog in ginstall installbsd scoinst install; do
2920         if test -f $ac_dir/$ac_prog; then
2921           if test $ac_prog = install &&
2922             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2923             # AIX install.  It has an incompatible calling convention.
2924             # OSF/1 installbsd also uses dspmsg, but is usable.
2925             :
2926           else
2927             ac_cv_path_install="$ac_dir/$ac_prog -c"
2928             break 2
2929           fi
2930         fi
2931       done
2932       ;;
2933     esac
2934   done
2935   IFS="$ac_save_IFS"
2936
2937   if test "${ac_cv_path_install+set}" = set; then
2938     INSTALL="$ac_cv_path_install"
2939   else
2940     # As a last resort, use the slow shell script.  We don't cache a
2941     # path for INSTALL within a source directory, because that will
2942     # break other packages using the cache if that directory is
2943     # removed, or if the path is relative.
2944     INSTALL="$ac_install_sh"
2945   fi
2946 fi
2947 echo "$ac_t""$INSTALL" 1>&6
2948
2949 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2950 # It thinks the first close brace ends the variable substitution.
2951 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2952
2953 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2954
2955 for ac_prog in 'bison -y' byacc
2956 do
2957 # Extract the first word of "$ac_prog", so it can be a program name with args.
2958 set dummy $ac_prog; ac_word=$2
2959 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2960 echo "configure:2961: checking for $ac_word" >&5
2961
2962 if test -n "$YACC"; then
2963   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2964 else
2965   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2966   for ac_dir in $PATH; do
2967     test -z "$ac_dir" && ac_dir=.
2968     if test -f $ac_dir/$ac_word; then
2969       ac_cv_prog_YACC="$ac_prog"
2970       break
2971     fi
2972   done
2973   IFS="$ac_save_ifs"
2974 fi
2975 YACC="$ac_cv_prog_YACC"
2976 if test -n "$YACC"; then
2977   echo "$ac_t""$YACC" 1>&6
2978 else
2979   echo "$ac_t""no" 1>&6
2980 fi
2981
2982 test -n "$YACC" && break
2983 done
2984 test -n "$YACC" || YACC="yacc"
2985
2986
2987 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
2988 do
2989 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2990 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2991 echo "configure:2992: checking for $ac_hdr" >&5
2992
2993 cat > conftest.$ac_ext <<EOF
2994 #line 2995 "configure"
2995 #include "confdefs.h"
2996 #include <$ac_hdr>
2997 EOF
2998 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2999 { (eval echo configure:3000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3000 ac_err=`grep -v '^ *+' conftest.out`
3001 if test -z "$ac_err"; then
3002   rm -rf conftest*
3003   eval "ac_cv_header_$ac_safe=yes"
3004 else
3005   echo "$ac_err" >&5
3006   echo "configure: failed program was:" >&5
3007   cat conftest.$ac_ext >&5
3008   rm -rf conftest*
3009   eval "ac_cv_header_$ac_safe=no"
3010 fi
3011 rm -f conftest*
3012 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3013   echo "$ac_t""yes" 1>&6
3014     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3015   { test "$extra_verbose" = "yes" && cat << EOF
3016     Defining $ac_tr_hdr
3017 EOF
3018 cat >> confdefs.h <<EOF
3019 #define $ac_tr_hdr 1
3020 EOF
3021 }
3022  
3023 else
3024   echo "$ac_t""no" 1>&6
3025 fi
3026 done
3027
3028 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3029 do
3030 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3031 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3032 echo "configure:3033: checking for $ac_hdr" >&5
3033
3034 cat > conftest.$ac_ext <<EOF
3035 #line 3036 "configure"
3036 #include "confdefs.h"
3037 #include <$ac_hdr>
3038 EOF
3039 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3040 { (eval echo configure:3041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3041 ac_err=`grep -v '^ *+' conftest.out`
3042 if test -z "$ac_err"; then
3043   rm -rf conftest*
3044   eval "ac_cv_header_$ac_safe=yes"
3045 else
3046   echo "$ac_err" >&5
3047   echo "configure: failed program was:" >&5
3048   cat conftest.$ac_ext >&5
3049   rm -rf conftest*
3050   eval "ac_cv_header_$ac_safe=no"
3051 fi
3052 rm -f conftest*
3053 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3054   echo "$ac_t""yes" 1>&6
3055     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3056   { test "$extra_verbose" = "yes" && cat << EOF
3057     Defining $ac_tr_hdr
3058 EOF
3059 cat >> confdefs.h <<EOF
3060 #define $ac_tr_hdr 1
3061 EOF
3062 }
3063  
3064 else
3065   echo "$ac_t""no" 1>&6
3066 fi
3067 done
3068
3069 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3070 do
3071 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3072 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3073 echo "configure:3074: checking for $ac_hdr" >&5
3074
3075 cat > conftest.$ac_ext <<EOF
3076 #line 3077 "configure"
3077 #include "confdefs.h"
3078 #include <$ac_hdr>
3079 EOF
3080 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3081 { (eval echo configure:3082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3082 ac_err=`grep -v '^ *+' conftest.out`
3083 if test -z "$ac_err"; then
3084   rm -rf conftest*
3085   eval "ac_cv_header_$ac_safe=yes"
3086 else
3087   echo "$ac_err" >&5
3088   echo "configure: failed program was:" >&5
3089   cat conftest.$ac_ext >&5
3090   rm -rf conftest*
3091   eval "ac_cv_header_$ac_safe=no"
3092 fi
3093 rm -f conftest*
3094 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3095   echo "$ac_t""yes" 1>&6
3096     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3097   { test "$extra_verbose" = "yes" && cat << EOF
3098     Defining $ac_tr_hdr
3099 EOF
3100 cat >> confdefs.h <<EOF
3101 #define $ac_tr_hdr 1
3102 EOF
3103 }
3104  
3105 else
3106   echo "$ac_t""no" 1>&6
3107 fi
3108 done
3109
3110 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3111 echo "configure:3112: checking for sys/wait.h that is POSIX.1 compatible" >&5
3112
3113 cat > conftest.$ac_ext <<EOF
3114 #line 3115 "configure"
3115 #include "confdefs.h"
3116 #include <sys/types.h>
3117 #include <sys/wait.h>
3118 #ifndef WEXITSTATUS
3119 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3120 #endif
3121 #ifndef WIFEXITED
3122 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3123 #endif
3124 int main() {
3125 int s;
3126 wait (&s);
3127 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3128 ; return 0; }
3129 EOF
3130 if { (eval echo configure:3131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3131   rm -rf conftest*
3132   ac_cv_header_sys_wait_h=yes
3133 else
3134   echo "configure: failed program was:" >&5
3135   cat conftest.$ac_ext >&5
3136   rm -rf conftest*
3137   ac_cv_header_sys_wait_h=no
3138 fi
3139 rm -f conftest*
3140
3141 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3142 if test $ac_cv_header_sys_wait_h = yes; then
3143   { test "$extra_verbose" = "yes" && cat << \EOF
3144     Defining HAVE_SYS_WAIT_H
3145 EOF
3146 cat >> confdefs.h <<\EOF
3147 #define HAVE_SYS_WAIT_H 1
3148 EOF
3149 }
3150
3151 fi
3152
3153 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3154 echo "configure:3155: checking for ANSI C header files" >&5
3155
3156 cat > conftest.$ac_ext <<EOF
3157 #line 3158 "configure"
3158 #include "confdefs.h"
3159 #include <stdlib.h>
3160 #include <stdarg.h>
3161 #include <string.h>
3162 #include <float.h>
3163 EOF
3164 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3165 { (eval echo configure:3166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3166 ac_err=`grep -v '^ *+' conftest.out`
3167 if test -z "$ac_err"; then
3168   rm -rf conftest*
3169   ac_cv_header_stdc=yes
3170 else
3171   echo "$ac_err" >&5
3172   echo "configure: failed program was:" >&5
3173   cat conftest.$ac_ext >&5
3174   rm -rf conftest*
3175   ac_cv_header_stdc=no
3176 fi
3177 rm -f conftest*
3178
3179 if test $ac_cv_header_stdc = yes; then
3180   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3181 cat > conftest.$ac_ext <<EOF
3182 #line 3183 "configure"
3183 #include "confdefs.h"
3184 #include <string.h>
3185 EOF
3186 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3187   egrep "memchr" >/dev/null 2>&1; then
3188   :
3189 else
3190   rm -rf conftest*
3191   ac_cv_header_stdc=no
3192 fi
3193 rm -f conftest*
3194
3195 fi
3196
3197 if test $ac_cv_header_stdc = yes; then
3198   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3199 cat > conftest.$ac_ext <<EOF
3200 #line 3201 "configure"
3201 #include "confdefs.h"
3202 #include <stdlib.h>
3203 EOF
3204 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3205   egrep "free" >/dev/null 2>&1; then
3206   :
3207 else
3208   rm -rf conftest*
3209   ac_cv_header_stdc=no
3210 fi
3211 rm -f conftest*
3212
3213 fi
3214
3215 if test $ac_cv_header_stdc = yes; then
3216   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3217 cat > conftest.$ac_ext <<EOF
3218 #line 3219 "configure"
3219 #include "confdefs.h"
3220 #include <ctype.h>
3221 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3222 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3223 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3224 int main () { int i; for (i = 0; i < 256; i++)
3225 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3226 exit (0); }
3227
3228 EOF
3229 if { (eval echo configure:3230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3230 then
3231   :
3232 else
3233   conftest_rc="$?"
3234   echo "configure: failed program was:" >&5
3235   cat conftest.$ac_ext >&5
3236   rm -fr conftest*
3237   ac_cv_header_stdc=no
3238 fi
3239 rm -fr conftest*
3240 fi
3241
3242 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3243 if test $ac_cv_header_stdc = yes; then
3244   { test "$extra_verbose" = "yes" && cat << \EOF
3245     Defining STDC_HEADERS
3246 EOF
3247 cat >> confdefs.h <<\EOF
3248 #define STDC_HEADERS 1
3249 EOF
3250 }
3251
3252 fi
3253
3254 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3255 echo "configure:3256: checking whether time.h and sys/time.h may both be included" >&5
3256
3257 cat > conftest.$ac_ext <<EOF
3258 #line 3259 "configure"
3259 #include "confdefs.h"
3260 #include <sys/types.h>
3261 #include <sys/time.h>
3262 #include <time.h>
3263 int main() {
3264 struct tm *tp;
3265 ; return 0; }
3266 EOF
3267 if { (eval echo configure:3268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3268   rm -rf conftest*
3269   ac_cv_header_time=yes
3270 else
3271   echo "configure: failed program was:" >&5
3272   cat conftest.$ac_ext >&5
3273   rm -rf conftest*
3274   ac_cv_header_time=no
3275 fi
3276 rm -f conftest*
3277
3278 echo "$ac_t""$ac_cv_header_time" 1>&6
3279 if test $ac_cv_header_time = yes; then
3280   { test "$extra_verbose" = "yes" && cat << \EOF
3281     Defining TIME_WITH_SYS_TIME
3282 EOF
3283 cat >> confdefs.h <<\EOF
3284 #define TIME_WITH_SYS_TIME 1
3285 EOF
3286 }
3287
3288 fi
3289
3290 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3291 echo "configure:3292: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3292
3293 cat > conftest.$ac_ext <<EOF
3294 #line 3295 "configure"
3295 #include "confdefs.h"
3296 #include <sys/types.h>
3297 #include <signal.h>
3298 /* NetBSD declares sys_siglist in unistd.h.  */
3299 #ifdef HAVE_UNISTD_H
3300 #include <unistd.h>
3301 #endif
3302 int main() {
3303 char *msg = *(sys_siglist + 1);
3304 ; return 0; }
3305 EOF
3306 if { (eval echo configure:3307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3307   rm -rf conftest*
3308   ac_cv_decl_sys_siglist=yes
3309 else
3310   echo "configure: failed program was:" >&5
3311   cat conftest.$ac_ext >&5
3312   rm -rf conftest*
3313   ac_cv_decl_sys_siglist=no
3314 fi
3315 rm -f conftest*
3316
3317 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3318 if test $ac_cv_decl_sys_siglist = yes; then
3319   { test "$extra_verbose" = "yes" && cat << \EOF
3320     Defining SYS_SIGLIST_DECLARED
3321 EOF
3322 cat >> confdefs.h <<\EOF
3323 #define SYS_SIGLIST_DECLARED 1
3324 EOF
3325 }
3326
3327 fi
3328
3329
3330 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3331 echo "configure:3332: checking for struct utimbuf" >&5
3332 cat > conftest.$ac_ext <<EOF
3333 #line 3334 "configure"
3334 #include "confdefs.h"
3335 #ifdef TIME_WITH_SYS_TIME
3336 #include <sys/time.h>
3337 #include <time.h>
3338 #else
3339 #ifdef HAVE_SYS_TIME_H
3340 #include <sys/time.h>
3341 #else
3342 #include <time.h>
3343 #endif
3344 #endif
3345 #ifdef HAVE_UTIME_H
3346 #include <utime.h>
3347 #endif
3348 int main() {
3349 static struct utimbuf x; x.actime = x.modtime;
3350 ; return 0; }
3351 EOF
3352 if { (eval echo configure:3353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3353   rm -rf conftest*
3354   echo "$ac_t""yes" 1>&6
3355    { test "$extra_verbose" = "yes" && cat << \EOF
3356     Defining HAVE_STRUCT_UTIMBUF
3357 EOF
3358 cat >> confdefs.h <<\EOF
3359 #define HAVE_STRUCT_UTIMBUF 1
3360 EOF
3361 }
3362
3363 else
3364   echo "configure: failed program was:" >&5
3365   cat conftest.$ac_ext >&5
3366   rm -rf conftest*
3367   echo "$ac_t""no" 1>&6
3368 fi
3369 rm -f conftest*
3370
3371 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3372 echo "configure:3373: checking return type of signal handlers" >&5
3373
3374 cat > conftest.$ac_ext <<EOF
3375 #line 3376 "configure"
3376 #include "confdefs.h"
3377 #include <sys/types.h>
3378 #include <signal.h>
3379 #ifdef signal
3380 #undef signal
3381 #endif
3382 #ifdef __cplusplus
3383 extern "C" void (*signal (int, void (*)(int)))(int);
3384 #else
3385 void (*signal ()) ();
3386 #endif
3387
3388 int main() {
3389 int i;
3390 ; return 0; }
3391 EOF
3392 if { (eval echo configure:3393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3393   rm -rf conftest*
3394   ac_cv_type_signal=void
3395 else
3396   echo "configure: failed program was:" >&5
3397   cat conftest.$ac_ext >&5
3398   rm -rf conftest*
3399   ac_cv_type_signal=int
3400 fi
3401 rm -f conftest*
3402
3403 echo "$ac_t""$ac_cv_type_signal" 1>&6
3404 { test "$extra_verbose" = "yes" && cat << EOF
3405     Defining RETSIGTYPE = $ac_cv_type_signal
3406 EOF
3407 cat >> confdefs.h <<EOF
3408 #define RETSIGTYPE $ac_cv_type_signal
3409 EOF
3410 }
3411
3412
3413 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3414 echo "configure:3415: checking for size_t" >&5
3415
3416 cat > conftest.$ac_ext <<EOF
3417 #line 3418 "configure"
3418 #include "confdefs.h"
3419 #include <sys/types.h>
3420 #if STDC_HEADERS
3421 #include <stdlib.h>
3422 #include <stddef.h>
3423 #endif
3424 EOF
3425 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3426   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3427   rm -rf conftest*
3428   ac_cv_type_size_t=yes
3429 else
3430   rm -rf conftest*
3431   ac_cv_type_size_t=no
3432 fi
3433 rm -f conftest*
3434
3435 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3436 if test $ac_cv_type_size_t = no; then
3437   { test "$extra_verbose" = "yes" && cat << \EOF
3438     Defining size_t = unsigned
3439 EOF
3440 cat >> confdefs.h <<\EOF
3441 #define size_t unsigned
3442 EOF
3443 }
3444
3445 fi
3446
3447 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3448 echo "configure:3449: checking for pid_t" >&5
3449
3450 cat > conftest.$ac_ext <<EOF
3451 #line 3452 "configure"
3452 #include "confdefs.h"
3453 #include <sys/types.h>
3454 #if STDC_HEADERS
3455 #include <stdlib.h>
3456 #include <stddef.h>
3457 #endif
3458 EOF
3459 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3460   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3461   rm -rf conftest*
3462   ac_cv_type_pid_t=yes
3463 else
3464   rm -rf conftest*
3465   ac_cv_type_pid_t=no
3466 fi
3467 rm -f conftest*
3468
3469 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3470 if test $ac_cv_type_pid_t = no; then
3471   { test "$extra_verbose" = "yes" && cat << \EOF
3472     Defining pid_t = int
3473 EOF
3474 cat >> confdefs.h <<\EOF
3475 #define pid_t int
3476 EOF
3477 }
3478
3479 fi
3480
3481 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3482 echo "configure:3483: checking for uid_t in sys/types.h" >&5
3483
3484 cat > conftest.$ac_ext <<EOF
3485 #line 3486 "configure"
3486 #include "confdefs.h"
3487 #include <sys/types.h>
3488 EOF
3489 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3490   egrep "uid_t" >/dev/null 2>&1; then
3491   rm -rf conftest*
3492   ac_cv_type_uid_t=yes
3493 else
3494   rm -rf conftest*
3495   ac_cv_type_uid_t=no
3496 fi
3497 rm -f conftest*
3498
3499
3500 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3501 if test $ac_cv_type_uid_t = no; then
3502   { test "$extra_verbose" = "yes" && cat << \EOF
3503     Defining uid_t = int
3504 EOF
3505 cat >> confdefs.h <<\EOF
3506 #define uid_t int
3507 EOF
3508 }
3509
3510   { test "$extra_verbose" = "yes" && cat << \EOF
3511     Defining gid_t = int
3512 EOF
3513 cat >> confdefs.h <<\EOF
3514 #define gid_t int
3515 EOF
3516 }
3517
3518 fi
3519
3520 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3521 echo "configure:3522: checking for mode_t" >&5
3522
3523 cat > conftest.$ac_ext <<EOF
3524 #line 3525 "configure"
3525 #include "confdefs.h"
3526 #include <sys/types.h>
3527 #if STDC_HEADERS
3528 #include <stdlib.h>
3529 #include <stddef.h>
3530 #endif
3531 EOF
3532 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3533   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3534   rm -rf conftest*
3535   ac_cv_type_mode_t=yes
3536 else
3537   rm -rf conftest*
3538   ac_cv_type_mode_t=no
3539 fi
3540 rm -f conftest*
3541
3542 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3543 if test $ac_cv_type_mode_t = no; then
3544   { test "$extra_verbose" = "yes" && cat << \EOF
3545     Defining mode_t = int
3546 EOF
3547 cat >> confdefs.h <<\EOF
3548 #define mode_t int
3549 EOF
3550 }
3551
3552 fi
3553
3554 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3555 echo "configure:3556: checking for off_t" >&5
3556
3557 cat > conftest.$ac_ext <<EOF
3558 #line 3559 "configure"
3559 #include "confdefs.h"
3560 #include <sys/types.h>
3561 #if STDC_HEADERS
3562 #include <stdlib.h>
3563 #include <stddef.h>
3564 #endif
3565 EOF
3566 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3567   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3568   rm -rf conftest*
3569   ac_cv_type_off_t=yes
3570 else
3571   rm -rf conftest*
3572   ac_cv_type_off_t=no
3573 fi
3574 rm -f conftest*
3575
3576 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3577 if test $ac_cv_type_off_t = no; then
3578   { test "$extra_verbose" = "yes" && cat << \EOF
3579     Defining off_t = long
3580 EOF
3581 cat >> confdefs.h <<\EOF
3582 #define off_t long
3583 EOF
3584 }
3585
3586 fi
3587
3588
3589 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3590 echo "configure:3591: checking for struct timeval" >&5
3591 cat > conftest.$ac_ext <<EOF
3592 #line 3593 "configure"
3593 #include "confdefs.h"
3594 #ifdef TIME_WITH_SYS_TIME
3595 #include <sys/time.h>
3596 #include <time.h>
3597 #else
3598 #ifdef HAVE_SYS_TIME_H
3599 #include <sys/time.h>
3600 #else
3601 #include <time.h>
3602 #endif
3603 #endif
3604 int main() {
3605 static struct timeval x; x.tv_sec = x.tv_usec;
3606 ; return 0; }
3607 EOF
3608 if { (eval echo configure:3609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3609   rm -rf conftest*
3610   echo "$ac_t""yes" 1>&6
3611   HAVE_TIMEVAL=yes
3612   { test "$extra_verbose" = "yes" && cat << \EOF
3613     Defining HAVE_TIMEVAL
3614 EOF
3615 cat >> confdefs.h <<\EOF
3616 #define HAVE_TIMEVAL 1
3617 EOF
3618 }
3619
3620 else
3621   echo "configure: failed program was:" >&5
3622   cat conftest.$ac_ext >&5
3623   rm -rf conftest*
3624   echo "$ac_t""no" 1>&6
3625    HAVE_TIMEVAL=no
3626 fi
3627 rm -f conftest*
3628
3629 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3630 echo "configure:3631: checking whether struct tm is in sys/time.h or time.h" >&5
3631
3632 cat > conftest.$ac_ext <<EOF
3633 #line 3634 "configure"
3634 #include "confdefs.h"
3635 #include <sys/types.h>
3636 #include <time.h>
3637 int main() {
3638 struct tm *tp; tp->tm_sec;
3639 ; return 0; }
3640 EOF
3641 if { (eval echo configure:3642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3642   rm -rf conftest*
3643   ac_cv_struct_tm=time.h
3644 else
3645   echo "configure: failed program was:" >&5
3646   cat conftest.$ac_ext >&5
3647   rm -rf conftest*
3648   ac_cv_struct_tm=sys/time.h
3649 fi
3650 rm -f conftest*
3651
3652 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3653 if test $ac_cv_struct_tm = sys/time.h; then
3654   { test "$extra_verbose" = "yes" && cat << \EOF
3655     Defining TM_IN_SYS_TIME
3656 EOF
3657 cat >> confdefs.h <<\EOF
3658 #define TM_IN_SYS_TIME 1
3659 EOF
3660 }
3661
3662 fi
3663
3664 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3665 echo "configure:3666: checking for tm_zone in struct tm" >&5
3666
3667 cat > conftest.$ac_ext <<EOF
3668 #line 3669 "configure"
3669 #include "confdefs.h"
3670 #include <sys/types.h>
3671 #include <$ac_cv_struct_tm>
3672 int main() {
3673 struct tm tm; tm.tm_zone;
3674 ; return 0; }
3675 EOF
3676 if { (eval echo configure:3677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3677   rm -rf conftest*
3678   ac_cv_struct_tm_zone=yes
3679 else
3680   echo "configure: failed program was:" >&5
3681   cat conftest.$ac_ext >&5
3682   rm -rf conftest*
3683   ac_cv_struct_tm_zone=no
3684 fi
3685 rm -f conftest*
3686
3687 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3688 if test "$ac_cv_struct_tm_zone" = yes; then
3689   { test "$extra_verbose" = "yes" && cat << \EOF
3690     Defining HAVE_TM_ZONE
3691 EOF
3692 cat >> confdefs.h <<\EOF
3693 #define HAVE_TM_ZONE 1
3694 EOF
3695 }
3696
3697 else
3698   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3699 echo "configure:3700: checking for tzname" >&5
3700
3701 cat > conftest.$ac_ext <<EOF
3702 #line 3703 "configure"
3703 #include "confdefs.h"
3704 #include <time.h>
3705 #ifndef tzname /* For SGI.  */
3706 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3707 #endif
3708 int main() {
3709 atoi(*tzname);
3710 ; return 0; }
3711 EOF
3712 if { (eval echo configure:3713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3713   rm -rf conftest*
3714   ac_cv_var_tzname=yes
3715 else
3716   echo "configure: failed program was:" >&5
3717   cat conftest.$ac_ext >&5
3718   rm -rf conftest*
3719   ac_cv_var_tzname=no
3720 fi
3721 rm -f conftest*
3722
3723 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3724   if test $ac_cv_var_tzname = yes; then
3725     { test "$extra_verbose" = "yes" && cat << \EOF
3726     Defining HAVE_TZNAME
3727 EOF
3728 cat >> confdefs.h <<\EOF
3729 #define HAVE_TZNAME 1
3730 EOF
3731 }
3732
3733   fi
3734 fi
3735
3736
3737 echo $ac_n "checking for working const""... $ac_c" 1>&6
3738 echo "configure:3739: checking for working const" >&5
3739
3740 cat > conftest.$ac_ext <<EOF
3741 #line 3742 "configure"
3742 #include "confdefs.h"
3743
3744 int main() {
3745
3746 /* Ultrix mips cc rejects this.  */
3747 typedef int charset[2]; const charset x;
3748 /* SunOS 4.1.1 cc rejects this.  */
3749 char const *const *ccp;
3750 char **p;
3751 /* NEC SVR4.0.2 mips cc rejects this.  */
3752 struct point {int x, y;};
3753 static struct point const zero = {0,0};
3754 /* AIX XL C 1.02.0.0 rejects this.
3755    It does not let you subtract one const X* pointer from another in an arm
3756    of an if-expression whose if-part is not a constant expression */
3757 const char *g = "string";
3758 ccp = &g + (g ? g-g : 0);
3759 /* HPUX 7.0 cc rejects these. */
3760 ++ccp;
3761 p = (char**) ccp;
3762 ccp = (char const *const *) p;
3763 { /* SCO 3.2v4 cc rejects this.  */
3764   char *t;
3765   char const *s = 0 ? (char *) 0 : (char const *) 0;
3766
3767   *t++ = 0;
3768 }
3769 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3770   int x[] = {25, 17};
3771   const int *foo = &x[0];
3772   ++foo;
3773 }
3774 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3775   typedef const int *iptr;
3776   iptr p = 0;
3777   ++p;
3778 }
3779 { /* AIX XL C 1.02.0.0 rejects this saying
3780      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3781   struct s { int j; const int *ap[3]; };
3782   struct s *b; b->j = 5;
3783 }
3784 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3785   const int foo = 10;
3786 }
3787
3788 ; return 0; }
3789 EOF
3790 if { (eval echo configure:3791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3791   rm -rf conftest*
3792   ac_cv_c_const=yes
3793 else
3794   echo "configure: failed program was:" >&5
3795   cat conftest.$ac_ext >&5
3796   rm -rf conftest*
3797   ac_cv_c_const=no
3798 fi
3799 rm -f conftest*
3800
3801 echo "$ac_t""$ac_cv_c_const" 1>&6
3802 if test $ac_cv_c_const = no; then
3803   { test "$extra_verbose" = "yes" && cat << \EOF
3804     Defining const = 
3805 EOF
3806 cat >> confdefs.h <<\EOF
3807 #define const 
3808 EOF
3809 }
3810
3811 fi
3812
3813
3814 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3815 echo "configure:3816: checking whether ${MAKE-make} sets \${MAKE}" >&5
3816 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3817
3818 cat > conftestmake <<\EOF
3819 all:
3820         @echo 'ac_maketemp="${MAKE}"'
3821 EOF
3822 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3823 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3824 if test -n "$ac_maketemp"; then
3825   eval ac_cv_prog_make_${ac_make}_set=yes
3826 else
3827   eval ac_cv_prog_make_${ac_make}_set=no
3828 fi
3829 rm -f conftestmake
3830 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3831   echo "$ac_t""yes" 1>&6
3832   SET_MAKE=
3833 else
3834   echo "$ac_t""no" 1>&6
3835   SET_MAKE="MAKE=${MAKE-make}"
3836 fi
3837
3838
3839 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3840 echo "configure:3841: checking whether byte ordering is bigendian" >&5
3841
3842 ac_cv_c_bigendian=unknown
3843 # See if sys/param.h defines the BYTE_ORDER macro.
3844 cat > conftest.$ac_ext <<EOF
3845 #line 3846 "configure"
3846 #include "confdefs.h"
3847 #include <sys/types.h>
3848 #include <sys/param.h>
3849 int main() {
3850
3851 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3852  bogus endian macros
3853 #endif
3854 ; return 0; }
3855 EOF
3856 if { (eval echo configure:3857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3857   rm -rf conftest*
3858   # It does; now see whether it defined to BIG_ENDIAN or not.
3859 cat > conftest.$ac_ext <<EOF
3860 #line 3861 "configure"
3861 #include "confdefs.h"
3862 #include <sys/types.h>
3863 #include <sys/param.h>
3864 int main() {
3865
3866 #if BYTE_ORDER != BIG_ENDIAN
3867  not big endian
3868 #endif
3869 ; return 0; }
3870 EOF
3871 if { (eval echo configure:3872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3872   rm -rf conftest*
3873   ac_cv_c_bigendian=yes
3874 else
3875   echo "configure: failed program was:" >&5
3876   cat conftest.$ac_ext >&5
3877   rm -rf conftest*
3878   ac_cv_c_bigendian=no
3879 fi
3880 rm -f conftest*
3881 else
3882   echo "configure: failed program was:" >&5
3883   cat conftest.$ac_ext >&5
3884 fi
3885 rm -f conftest*
3886 if test $ac_cv_c_bigendian = unknown; then
3887 cat > conftest.$ac_ext <<EOF
3888 #line 3889 "configure"
3889 #include "confdefs.h"
3890 main () {
3891   /* Are we little or big endian?  From Harbison&Steele.  */
3892   union
3893   {
3894     long l;
3895     char c[sizeof (long)];
3896   } u;
3897   u.l = 1;
3898   exit (u.c[sizeof (long) - 1] == 1);
3899 }
3900 EOF
3901 if { (eval echo configure:3902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3902 then
3903   ac_cv_c_bigendian=no
3904 else
3905   conftest_rc="$?"
3906   echo "configure: failed program was:" >&5
3907   cat conftest.$ac_ext >&5
3908   rm -fr conftest*
3909   ac_cv_c_bigendian=yes
3910 fi
3911 rm -fr conftest*
3912 fi
3913
3914 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3915 if test $ac_cv_c_bigendian = yes; then
3916   { test "$extra_verbose" = "yes" && cat << \EOF
3917     Defining WORDS_BIGENDIAN
3918 EOF
3919 cat >> confdefs.h <<\EOF
3920 #define WORDS_BIGENDIAN 1
3921 EOF
3922 }
3923
3924 fi
3925
3926
3927 echo $ac_n "checking size of short""... $ac_c" 1>&6
3928 echo "configure:3929: checking size of short" >&5
3929
3930 cat > conftest.$ac_ext <<EOF
3931 #line 3932 "configure"
3932 #include "confdefs.h"
3933 #include <stdio.h>
3934 main()
3935 {
3936   FILE *f=fopen("conftestval", "w");
3937   if (!f) exit(1);
3938   fprintf(f, "%d\n", sizeof(short));
3939   exit(0);
3940 }
3941 EOF
3942 if { (eval echo configure:3943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3943 then
3944   ac_cv_sizeof_short=`cat conftestval`
3945 else
3946   conftest_rc="$?"
3947   echo "configure: failed program was:" >&5
3948   cat conftest.$ac_ext >&5
3949   rm -fr conftest*
3950   ac_cv_sizeof_short=0
3951 fi
3952 rm -fr conftest*
3953 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
3954 { test "$extra_verbose" = "yes" && cat << EOF
3955     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
3956 EOF
3957 cat >> confdefs.h <<EOF
3958 #define SIZEOF_SHORT $ac_cv_sizeof_short
3959 EOF
3960 }
3961
3962
3963 if test "$ac_cv_sizeof_short" = 0; then
3964   echo ""
3965   echo "*** PANIC *** Configure tests are not working - compiler is broken."
3966   echo "*** PANIC *** Please examine config.log for compilation errors."
3967   exit 1
3968 fi
3969 echo $ac_n "checking size of int""... $ac_c" 1>&6
3970 echo "configure:3971: checking size of int" >&5
3971
3972 cat > conftest.$ac_ext <<EOF
3973 #line 3974 "configure"
3974 #include "confdefs.h"
3975 #include <stdio.h>
3976 main()
3977 {
3978   FILE *f=fopen("conftestval", "w");
3979   if (!f) exit(1);
3980   fprintf(f, "%d\n", sizeof(int));
3981   exit(0);
3982 }
3983 EOF
3984 if { (eval echo configure:3985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3985 then
3986   ac_cv_sizeof_int=`cat conftestval`
3987 else
3988   conftest_rc="$?"
3989   echo "configure: failed program was:" >&5
3990   cat conftest.$ac_ext >&5
3991   rm -fr conftest*
3992   ac_cv_sizeof_int=0
3993 fi
3994 rm -fr conftest*
3995 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
3996 { test "$extra_verbose" = "yes" && cat << EOF
3997     Defining SIZEOF_INT = $ac_cv_sizeof_int
3998 EOF
3999 cat >> confdefs.h <<EOF
4000 #define SIZEOF_INT $ac_cv_sizeof_int
4001 EOF
4002 }
4003
4004
4005 echo $ac_n "checking size of long""... $ac_c" 1>&6
4006 echo "configure:4007: checking size of long" >&5
4007
4008 cat > conftest.$ac_ext <<EOF
4009 #line 4010 "configure"
4010 #include "confdefs.h"
4011 #include <stdio.h>
4012 main()
4013 {
4014   FILE *f=fopen("conftestval", "w");
4015   if (!f) exit(1);
4016   fprintf(f, "%d\n", sizeof(long));
4017   exit(0);
4018 }
4019 EOF
4020 if { (eval echo configure:4021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4021 then
4022   ac_cv_sizeof_long=`cat conftestval`
4023 else
4024   conftest_rc="$?"
4025   echo "configure: failed program was:" >&5
4026   cat conftest.$ac_ext >&5
4027   rm -fr conftest*
4028   ac_cv_sizeof_long=0
4029 fi
4030 rm -fr conftest*
4031 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4032 { test "$extra_verbose" = "yes" && cat << EOF
4033     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4034 EOF
4035 cat >> confdefs.h <<EOF
4036 #define SIZEOF_LONG $ac_cv_sizeof_long
4037 EOF
4038 }
4039
4040
4041 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4042 echo "configure:4043: checking size of long long" >&5
4043
4044 cat > conftest.$ac_ext <<EOF
4045 #line 4046 "configure"
4046 #include "confdefs.h"
4047 #include <stdio.h>
4048 main()
4049 {
4050   FILE *f=fopen("conftestval", "w");
4051   if (!f) exit(1);
4052   fprintf(f, "%d\n", sizeof(long long));
4053   exit(0);
4054 }
4055 EOF
4056 if { (eval echo configure:4057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4057 then
4058   ac_cv_sizeof_long_long=`cat conftestval`
4059 else
4060   conftest_rc="$?"
4061   echo "configure: failed program was:" >&5
4062   cat conftest.$ac_ext >&5
4063   rm -fr conftest*
4064   ac_cv_sizeof_long_long=0
4065 fi
4066 rm -fr conftest*
4067 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4068 { test "$extra_verbose" = "yes" && cat << EOF
4069     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4070 EOF
4071 cat >> confdefs.h <<EOF
4072 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4073 EOF
4074 }
4075
4076
4077 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4078 echo "configure:4079: checking size of void *" >&5
4079
4080 cat > conftest.$ac_ext <<EOF
4081 #line 4082 "configure"
4082 #include "confdefs.h"
4083 #include <stdio.h>
4084 main()
4085 {
4086   FILE *f=fopen("conftestval", "w");
4087   if (!f) exit(1);
4088   fprintf(f, "%d\n", sizeof(void *));
4089   exit(0);
4090 }
4091 EOF
4092 if { (eval echo configure:4093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4093 then
4094   ac_cv_sizeof_void_p=`cat conftestval`
4095 else
4096   conftest_rc="$?"
4097   echo "configure: failed program was:" >&5
4098   cat conftest.$ac_ext >&5
4099   rm -fr conftest*
4100   ac_cv_sizeof_void_p=0
4101 fi
4102 rm -fr conftest*
4103 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4104 { test "$extra_verbose" = "yes" && cat << EOF
4105     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4106 EOF
4107 cat >> confdefs.h <<EOF
4108 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4109 EOF
4110 }
4111
4112
4113
4114 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4115 echo "configure:4116: checking for long file names" >&5
4116
4117 ac_cv_sys_long_file_names=yes
4118 # Test for long file names in all the places we know might matter:
4119 #      .                the current directory, where building will happen
4120 #      $prefix/lib      where we will be installing things
4121 #      $exec_prefix/lib likewise
4122 # eval it to expand exec_prefix.
4123 #      $TMPDIR          if set, where it might want to write temporary files
4124 # if $TMPDIR is not set:
4125 #      /tmp             where it might want to write temporary files
4126 #      /var/tmp         likewise
4127 #      /usr/tmp         likewise
4128 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4129   ac_tmpdirs="$TMPDIR"
4130 else
4131   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4132 fi
4133 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4134   test -d $ac_dir || continue
4135   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4136   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4137   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4138   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4139   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4140     ac_cv_sys_long_file_names=no
4141     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4142     break
4143   fi
4144   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4145 done
4146
4147 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4148 if test $ac_cv_sys_long_file_names = yes; then
4149   { test "$extra_verbose" = "yes" && cat << \EOF
4150     Defining HAVE_LONG_FILE_NAMES
4151 EOF
4152 cat >> confdefs.h <<\EOF
4153 #define HAVE_LONG_FILE_NAMES 1
4154 EOF
4155 }
4156
4157 fi
4158
4159
4160 echo $ac_n "checking for sin""... $ac_c" 1>&6
4161 echo "configure:4162: checking for sin" >&5
4162
4163 cat > conftest.$ac_ext <<EOF
4164 #line 4165 "configure"
4165 #include "confdefs.h"
4166 /* System header to define __stub macros and hopefully few prototypes,
4167     which can conflict with char sin(); below.  */
4168 #include <assert.h>
4169 /* Override any gcc2 internal prototype to avoid an error.  */
4170 /* We use char because int might match the return type of a gcc2
4171     builtin and then its argument prototype would still apply.  */
4172 char sin();
4173
4174 int main() {
4175
4176 /* The GNU C library defines this for functions which it implements
4177     to always fail with ENOSYS.  Some functions are actually named
4178     something starting with __ and the normal name is an alias.  */
4179 #if defined (__stub_sin) || defined (__stub___sin)
4180 choke me
4181 #else
4182 sin();
4183 #endif
4184
4185 ; return 0; }
4186 EOF
4187 if { (eval echo configure:4188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4188   rm -rf conftest*
4189   eval "ac_cv_func_sin=yes"
4190 else
4191   echo "configure: failed program was:" >&5
4192   cat conftest.$ac_ext >&5
4193   rm -rf conftest*
4194   eval "ac_cv_func_sin=no"
4195 fi
4196 rm -f conftest*
4197
4198 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4199   echo "$ac_t""yes" 1>&6
4200   :
4201 else
4202   echo "$ac_t""no" 1>&6
4203
4204 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4205 echo "configure:4206: checking for sin in -lm" >&5
4206 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4207
4208 xe_check_libs=" -lm "
4209 cat > conftest.$ac_ext <<EOF
4210 #line 4211 "configure"
4211 #include "confdefs.h"
4212 /* Override any gcc2 internal prototype to avoid an error.  */
4213 /* We use char because int might match the return type of a gcc2
4214     builtin and then its argument prototype would still apply.  */
4215 char sin();
4216
4217 int main() {
4218 sin()
4219 ; return 0; }
4220 EOF
4221 if { (eval echo configure:4222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4222   rm -rf conftest*
4223   eval "ac_cv_lib_$ac_lib_var=yes"
4224 else
4225   echo "configure: failed program was:" >&5
4226   cat conftest.$ac_ext >&5
4227   rm -rf conftest*
4228   eval "ac_cv_lib_$ac_lib_var=no"
4229 fi
4230 rm -f conftest*
4231 xe_check_libs=""
4232
4233 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4234   echo "$ac_t""yes" 1>&6
4235     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4236     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4237   { test "$extra_verbose" = "yes" && cat << EOF
4238     Defining $ac_tr_lib
4239 EOF
4240 cat >> confdefs.h <<EOF
4241 #define $ac_tr_lib 1
4242 EOF
4243 }
4244
4245   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4246
4247 else
4248   echo "$ac_t""no" 1>&6
4249 fi
4250
4251
4252 fi
4253
4254
4255 { test "$extra_verbose" = "yes" && cat << \EOF
4256     Defining LISP_FLOAT_TYPE
4257 EOF
4258 cat >> confdefs.h <<\EOF
4259 #define LISP_FLOAT_TYPE 1
4260 EOF
4261 }
4262
4263
4264 cat > conftest.$ac_ext <<EOF
4265 #line 4266 "configure"
4266 #include "confdefs.h"
4267 #include <math.h>
4268 int main() {
4269 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4270 ; return 0; }
4271 EOF
4272 if { (eval echo configure:4273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4273   rm -rf conftest*
4274   { test "$extra_verbose" = "yes" && cat << \EOF
4275     Defining HAVE_INVERSE_HYPERBOLIC
4276 EOF
4277 cat >> confdefs.h <<\EOF
4278 #define HAVE_INVERSE_HYPERBOLIC 1
4279 EOF
4280 }
4281
4282 else
4283   echo "configure: failed program was:" >&5
4284   cat conftest.$ac_ext >&5
4285 fi
4286 rm -f conftest*
4287
4288 echo "checking type of mail spool file locking" 1>&6
4289 echo "configure:4290: checking type of mail spool file locking" >&5
4290 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4291 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4292 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4293     Defining REAL_MAIL_USE_LOCKF
4294 EOF
4295 cat >> confdefs.h <<\EOF
4296 #define REAL_MAIL_USE_LOCKF 1
4297 EOF
4298 }
4299
4300 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4301     Defining REAL_MAIL_USE_FLOCK
4302 EOF
4303 cat >> confdefs.h <<\EOF
4304 #define REAL_MAIL_USE_FLOCK 1
4305 EOF
4306 }
4307
4308 else mail_locking="dot-locking"
4309 fi
4310
4311 case "$opsys" in decosf*)
4312   
4313 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4314 echo "configure:4315: checking for cma_open in -lpthreads" >&5
4315 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4316
4317 xe_check_libs=" -lpthreads "
4318 cat > conftest.$ac_ext <<EOF
4319 #line 4320 "configure"
4320 #include "confdefs.h"
4321 /* Override any gcc2 internal prototype to avoid an error.  */
4322 /* We use char because int might match the return type of a gcc2
4323     builtin and then its argument prototype would still apply.  */
4324 char cma_open();
4325
4326 int main() {
4327 cma_open()
4328 ; return 0; }
4329 EOF
4330 if { (eval echo configure:4331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4331   rm -rf conftest*
4332   eval "ac_cv_lib_$ac_lib_var=yes"
4333 else
4334   echo "configure: failed program was:" >&5
4335   cat conftest.$ac_ext >&5
4336   rm -rf conftest*
4337   eval "ac_cv_lib_$ac_lib_var=no"
4338 fi
4339 rm -f conftest*
4340 xe_check_libs=""
4341
4342 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4343   echo "$ac_t""yes" 1>&6
4344     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4345     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4346   { test "$extra_verbose" = "yes" && cat << EOF
4347     Defining $ac_tr_lib
4348 EOF
4349 cat >> confdefs.h <<EOF
4350 #define $ac_tr_lib 1
4351 EOF
4352 }
4353
4354   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4355
4356 else
4357   echo "$ac_t""no" 1>&6
4358 fi
4359
4360
4361   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4362     c_switch_site="$c_switch_site -threads" ;;
4363 esac
4364
4365 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4366 echo "configure:4367: checking whether the -xildoff compiler flag is required" >&5
4367 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4368   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4369     then echo "$ac_t""no" 1>&6;
4370     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
4371   fi
4372   else echo "$ac_t""no" 1>&6
4373 fi
4374
4375 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4376   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4377 echo "configure:4378: checking for \"-z ignore\" linker flag" >&5
4378   case "`ld -h 2>&1`" in
4379     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4380       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4381     *) echo "$ac_t""no" 1>&6 ;;
4382   esac
4383 fi
4384
4385
4386 echo "checking "for specified window system"" 1>&6
4387 echo "configure:4388: checking "for specified window system"" >&5
4388
4389 if test "$with_x11" != "no"; then
4390     test "$x_includes $x_libraries" != "NONE NONE" && \
4391    window_system=x11 with_x11=yes
4392
4393         
4394       if test "$x_includes $x_libraries" = "NONE NONE" \
4395     -a -n "$OPENWINHOME" \
4396     -a "$OPENWINHOME" != "/usr/openwin" \
4397     -a -d "$OPENWINHOME"; then
4398       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4399       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4400       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4401   fi
4402
4403   if test "$x_includes" = "NONE"; then
4404                     for dir in "/usr/X11" "/usr/X11R6"; do
4405       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4406     done
4407   fi
4408
4409   if test "$x_libraries" = "NONE"; then
4410     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4411       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4412     done
4413   fi
4414
4415   # If we find X, set shell vars x_includes and x_libraries to the
4416 # paths, otherwise set no_x=yes.
4417 # Uses ac_ vars as temps to allow command line to override cache and checks.
4418 # --without-x overrides everything else, but does not touch the cache.
4419 echo $ac_n "checking for X""... $ac_c" 1>&6
4420 echo "configure:4421: checking for X" >&5
4421
4422 # Check whether --with-x or --without-x was given.
4423 if test "${with_x+set}" = set; then
4424   withval="$with_x"
4425   :
4426 fi
4427
4428 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4429 if test "x$with_x" = xno; then
4430   # The user explicitly disabled X.
4431   have_x=disabled
4432 else
4433   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4434     # Both variables are already set.
4435     have_x=yes
4436   else
4437
4438 # One or both of the vars are not set, and there is no cached value.
4439 ac_x_includes=NO ac_x_libraries=NO
4440 rm -fr conftestdir
4441 if mkdir conftestdir; then
4442   cd conftestdir
4443   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4444   cat > Imakefile <<'EOF'
4445 acfindx:
4446         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4447 EOF
4448   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4449     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4450     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4451     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4452     for ac_extension in a so sl; do
4453       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4454         test -f $ac_im_libdir/libX11.$ac_extension; then
4455         ac_im_usrlibdir=$ac_im_libdir; break
4456       fi
4457     done
4458     # Screen out bogus values from the imake configuration.  They are
4459     # bogus both because they are the default anyway, and because
4460     # using them would break gcc on systems where it needs fixed includes.
4461     case "$ac_im_incroot" in
4462         /usr/include) ;;
4463         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4464     esac
4465     case "$ac_im_usrlibdir" in
4466         /usr/lib | /lib) ;;
4467         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4468     esac
4469   fi
4470   cd ..
4471   rm -fr conftestdir
4472 fi
4473
4474 if test "$ac_x_includes" = NO; then
4475   # Guess where to find include files, by looking for this one X11 .h file.
4476   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4477
4478   # First, try using that file with no special directory specified.
4479 cat > conftest.$ac_ext <<EOF
4480 #line 4481 "configure"
4481 #include "confdefs.h"
4482 #include <$x_direct_test_include>
4483 EOF
4484 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4485 { (eval echo configure:4486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4486 ac_err=`grep -v '^ *+' conftest.out`
4487 if test -z "$ac_err"; then
4488   rm -rf conftest*
4489   # We can compile using X headers with no special include directory.
4490 ac_x_includes=
4491 else
4492   echo "$ac_err" >&5
4493   echo "configure: failed program was:" >&5
4494   cat conftest.$ac_ext >&5
4495   rm -rf conftest*
4496   # Look for the header file in a standard set of common directories.
4497 # Check X11 before X11Rn because it is often a symlink to the current release.
4498   for ac_dir in               \
4499     /usr/X11/include          \
4500     /usr/X11R6/include        \
4501     /usr/X11R5/include        \
4502     /usr/X11R4/include        \
4503                               \
4504     /usr/include/X11          \
4505     /usr/include/X11R6        \
4506     /usr/include/X11R5        \
4507     /usr/include/X11R4        \
4508                               \
4509     /usr/local/X11/include    \
4510     /usr/local/X11R6/include  \
4511     /usr/local/X11R5/include  \
4512     /usr/local/X11R4/include  \
4513                               \
4514     /usr/local/include/X11    \
4515     /usr/local/include/X11R6  \
4516     /usr/local/include/X11R5  \
4517     /usr/local/include/X11R4  \
4518                               \
4519     /usr/X386/include         \
4520     /usr/x386/include         \
4521     /usr/XFree86/include/X11  \
4522                               \
4523     /usr/include              \
4524     /usr/local/include        \
4525     /usr/unsupported/include  \
4526     /usr/athena/include       \
4527     /usr/local/x11r5/include  \
4528     /usr/lpp/Xamples/include  \
4529                               \
4530     /usr/openwin/include      \
4531     /usr/openwin/share/include \
4532     ; \
4533   do
4534     if test -r "$ac_dir/$x_direct_test_include"; then
4535       ac_x_includes=$ac_dir
4536       break
4537     fi
4538   done
4539 fi
4540 rm -f conftest*
4541 fi # $ac_x_includes = NO
4542
4543 if test "$ac_x_libraries" = NO; then
4544   # Check for the libraries.
4545
4546   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4547   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4548
4549   # See if we find them without any special options.
4550   # Don't add to $LIBS permanently.
4551   ac_save_LIBS="$LIBS"
4552   LIBS="-l$x_direct_test_library $LIBS"
4553 cat > conftest.$ac_ext <<EOF
4554 #line 4555 "configure"
4555 #include "confdefs.h"
4556
4557 int main() {
4558 ${x_direct_test_function}()
4559 ; return 0; }
4560 EOF
4561 if { (eval echo configure:4562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4562   rm -rf conftest*
4563   LIBS="$ac_save_LIBS"
4564 # We can link X programs with no special library path.
4565 ac_x_libraries=
4566 else
4567   echo "configure: failed program was:" >&5
4568   cat conftest.$ac_ext >&5
4569   rm -rf conftest*
4570   LIBS="$ac_save_LIBS"
4571 # First see if replacing the include by lib works.
4572 # Check X11 before X11Rn because it is often a symlink to the current release.
4573 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4574     /usr/X11/lib          \
4575     /usr/X11R6/lib        \
4576     /usr/X11R5/lib        \
4577     /usr/X11R4/lib        \
4578                           \
4579     /usr/lib/X11          \
4580     /usr/lib/X11R6        \
4581     /usr/lib/X11R5        \
4582     /usr/lib/X11R4        \
4583                           \
4584     /usr/local/X11/lib    \
4585     /usr/local/X11R6/lib  \
4586     /usr/local/X11R5/lib  \
4587     /usr/local/X11R4/lib  \
4588                           \
4589     /usr/local/lib/X11    \
4590     /usr/local/lib/X11R6  \
4591     /usr/local/lib/X11R5  \
4592     /usr/local/lib/X11R4  \
4593                           \
4594     /usr/X386/lib         \
4595     /usr/x386/lib         \
4596     /usr/XFree86/lib/X11  \
4597                           \
4598     /usr/lib              \
4599     /usr/local/lib        \
4600     /usr/unsupported/lib  \
4601     /usr/athena/lib       \
4602     /usr/local/x11r5/lib  \
4603     /usr/lpp/Xamples/lib  \
4604     /lib/usr/lib/X11      \
4605                           \
4606     /usr/openwin/lib      \
4607     /usr/openwin/share/lib \
4608     ; \
4609 do
4610   for ac_extension in a so sl; do
4611     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4612       ac_x_libraries=$ac_dir
4613       break 2
4614     fi
4615   done
4616 done
4617 fi
4618 rm -f conftest*
4619 fi # $ac_x_libraries = NO
4620
4621 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4622   # Didn't find X anywhere.  Cache the known absence of X.
4623   ac_cv_have_x="have_x=no"
4624 else
4625   # Record where we found X for the cache.
4626   ac_cv_have_x="have_x=yes \
4627                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4628 fi
4629   fi
4630   eval "$ac_cv_have_x"
4631 fi # $with_x != no
4632
4633 if test "$have_x" != yes; then
4634   echo "$ac_t""$have_x" 1>&6
4635   no_x=yes
4636 else
4637   # If each of the values was on the command line, it overrides each guess.
4638   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4639   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4640   # Update the cache value to reflect the command line values.
4641   ac_cv_have_x="have_x=yes \
4642                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4643   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4644 fi
4645
4646 if test "$no_x" = yes; then
4647   # Not all programs may use this symbol, but it does not hurt to define it.
4648   { test "$extra_verbose" = "yes" && cat << \EOF
4649     Defining X_DISPLAY_MISSING
4650 EOF
4651 cat >> confdefs.h <<\EOF
4652 #define X_DISPLAY_MISSING 1
4653 EOF
4654 }
4655
4656   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4657 else
4658   if test -n "$x_includes"; then
4659     X_CFLAGS="$X_CFLAGS -I$x_includes"
4660   fi
4661
4662   # It would also be nice to do this for all -L options, not just this one.
4663   if test -n "$x_libraries"; then
4664     X_LIBS="$X_LIBS -L$x_libraries"
4665     # For Solaris; some versions of Sun CC require a space after -R and
4666     # others require no space.  Words are not sufficient . . . .
4667     case "`(uname -sr) 2>/dev/null`" in
4668     "SunOS 5"*)
4669       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4670 echo "configure:4671: checking whether -R must be followed by a space" >&5
4671       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4672       cat > conftest.$ac_ext <<EOF
4673 #line 4674 "configure"
4674 #include "confdefs.h"
4675
4676 int main() {
4677
4678 ; return 0; }
4679 EOF
4680 if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4681   rm -rf conftest*
4682   ac_R_nospace=yes
4683 else
4684   echo "configure: failed program was:" >&5
4685   cat conftest.$ac_ext >&5
4686   rm -rf conftest*
4687   ac_R_nospace=no
4688 fi
4689 rm -f conftest*
4690       if test $ac_R_nospace = yes; then
4691         echo "$ac_t""no" 1>&6
4692         X_LIBS="$X_LIBS -R$x_libraries"
4693       else
4694         LIBS="$ac_xsave_LIBS -R $x_libraries"
4695         cat > conftest.$ac_ext <<EOF
4696 #line 4697 "configure"
4697 #include "confdefs.h"
4698
4699 int main() {
4700
4701 ; return 0; }
4702 EOF
4703 if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4704   rm -rf conftest*
4705   ac_R_space=yes
4706 else
4707   echo "configure: failed program was:" >&5
4708   cat conftest.$ac_ext >&5
4709   rm -rf conftest*
4710   ac_R_space=no
4711 fi
4712 rm -f conftest*
4713         if test $ac_R_space = yes; then
4714           echo "$ac_t""yes" 1>&6
4715           X_LIBS="$X_LIBS -R $x_libraries"
4716         else
4717           echo "$ac_t""neither works" 1>&6
4718         fi
4719       fi
4720       LIBS="$ac_xsave_LIBS"
4721     esac
4722   fi
4723
4724   # Check for system-dependent libraries X programs must link with.
4725   # Do this before checking for the system-independent R6 libraries
4726   # (-lICE), since we may need -lsocket or whatever for X linking.
4727
4728   if test "$ISC" = yes; then
4729     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4730   else
4731     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4732     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4733     # the Alpha needs dnet_stub (dnet does not exist).
4734     if test "$with_dnet" = "no" ; then
4735 ac_cv_lib_dnet_dnet_ntoa=no
4736 else
4737
4738 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4739 echo "configure:4740: checking for dnet_ntoa in -ldnet" >&5
4740 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4741
4742 xe_check_libs=" -ldnet "
4743 cat > conftest.$ac_ext <<EOF
4744 #line 4745 "configure"
4745 #include "confdefs.h"
4746 /* Override any gcc2 internal prototype to avoid an error.  */
4747 /* We use char because int might match the return type of a gcc2
4748     builtin and then its argument prototype would still apply.  */
4749 char dnet_ntoa();
4750
4751 int main() {
4752 dnet_ntoa()
4753 ; return 0; }
4754 EOF
4755 if { (eval echo configure:4756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4756   rm -rf conftest*
4757   eval "ac_cv_lib_$ac_lib_var=yes"
4758 else
4759   echo "configure: failed program was:" >&5
4760   cat conftest.$ac_ext >&5
4761   rm -rf conftest*
4762   eval "ac_cv_lib_$ac_lib_var=no"
4763 fi
4764 rm -f conftest*
4765 xe_check_libs=""
4766
4767 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4768   echo "$ac_t""yes" 1>&6
4769   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4770 else
4771   echo "$ac_t""no" 1>&6
4772 fi
4773
4774 fi
4775
4776     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4777       
4778 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4779 echo "configure:4780: checking for dnet_ntoa in -ldnet_stub" >&5
4780 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4781
4782 xe_check_libs=" -ldnet_stub "
4783 cat > conftest.$ac_ext <<EOF
4784 #line 4785 "configure"
4785 #include "confdefs.h"
4786 /* Override any gcc2 internal prototype to avoid an error.  */
4787 /* We use char because int might match the return type of a gcc2
4788     builtin and then its argument prototype would still apply.  */
4789 char dnet_ntoa();
4790
4791 int main() {
4792 dnet_ntoa()
4793 ; return 0; }
4794 EOF
4795 if { (eval echo configure:4796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4796   rm -rf conftest*
4797   eval "ac_cv_lib_$ac_lib_var=yes"
4798 else
4799   echo "configure: failed program was:" >&5
4800   cat conftest.$ac_ext >&5
4801   rm -rf conftest*
4802   eval "ac_cv_lib_$ac_lib_var=no"
4803 fi
4804 rm -f conftest*
4805 xe_check_libs=""
4806
4807 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4808   echo "$ac_t""yes" 1>&6
4809   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4810 else
4811   echo "$ac_t""no" 1>&6
4812 fi
4813
4814
4815     fi
4816
4817     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4818     # to get the SysV transport functions.
4819     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4820     # needs -lnsl.
4821     # The nsl library prevents programs from opening the X display
4822     # on Irix 5.2, according to dickey@clark.net.
4823     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4824 echo "configure:4825: checking for gethostbyname" >&5
4825
4826 cat > conftest.$ac_ext <<EOF
4827 #line 4828 "configure"
4828 #include "confdefs.h"
4829 /* System header to define __stub macros and hopefully few prototypes,
4830     which can conflict with char gethostbyname(); below.  */
4831 #include <assert.h>
4832 /* Override any gcc2 internal prototype to avoid an error.  */
4833 /* We use char because int might match the return type of a gcc2
4834     builtin and then its argument prototype would still apply.  */
4835 char gethostbyname();
4836
4837 int main() {
4838
4839 /* The GNU C library defines this for functions which it implements
4840     to always fail with ENOSYS.  Some functions are actually named
4841     something starting with __ and the normal name is an alias.  */
4842 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4843 choke me
4844 #else
4845 gethostbyname();
4846 #endif
4847
4848 ; return 0; }
4849 EOF
4850 if { (eval echo configure:4851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4851   rm -rf conftest*
4852   eval "ac_cv_func_gethostbyname=yes"
4853 else
4854   echo "configure: failed program was:" >&5
4855   cat conftest.$ac_ext >&5
4856   rm -rf conftest*
4857   eval "ac_cv_func_gethostbyname=no"
4858 fi
4859 rm -f conftest*
4860
4861 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4862   echo "$ac_t""yes" 1>&6
4863   :
4864 else
4865   echo "$ac_t""no" 1>&6
4866 fi
4867
4868     if test $ac_cv_func_gethostbyname = no; then
4869       
4870 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4871 echo "configure:4872: checking for gethostbyname in -lnsl" >&5
4872 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4873
4874 xe_check_libs=" -lnsl "
4875 cat > conftest.$ac_ext <<EOF
4876 #line 4877 "configure"
4877 #include "confdefs.h"
4878 /* Override any gcc2 internal prototype to avoid an error.  */
4879 /* We use char because int might match the return type of a gcc2
4880     builtin and then its argument prototype would still apply.  */
4881 char gethostbyname();
4882
4883 int main() {
4884 gethostbyname()
4885 ; return 0; }
4886 EOF
4887 if { (eval echo configure:4888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4888   rm -rf conftest*
4889   eval "ac_cv_lib_$ac_lib_var=yes"
4890 else
4891   echo "configure: failed program was:" >&5
4892   cat conftest.$ac_ext >&5
4893   rm -rf conftest*
4894   eval "ac_cv_lib_$ac_lib_var=no"
4895 fi
4896 rm -f conftest*
4897 xe_check_libs=""
4898
4899 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4900   echo "$ac_t""yes" 1>&6
4901   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4902 else
4903   echo "$ac_t""no" 1>&6
4904 fi
4905
4906
4907     fi
4908
4909     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4910     # socket/setsockopt and other routines are undefined under SCO ODT
4911     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4912     # on later versions), says simon@lia.di.epfl.ch: it contains
4913     # gethostby* variants that don't use the nameserver (or something).
4914     # -lsocket must be given before -lnsl if both are needed.
4915     # We assume that if connect needs -lnsl, so does gethostbyname.
4916     echo $ac_n "checking for connect""... $ac_c" 1>&6
4917 echo "configure:4918: checking for connect" >&5
4918
4919 cat > conftest.$ac_ext <<EOF
4920 #line 4921 "configure"
4921 #include "confdefs.h"
4922 /* System header to define __stub macros and hopefully few prototypes,
4923     which can conflict with char connect(); below.  */
4924 #include <assert.h>
4925 /* Override any gcc2 internal prototype to avoid an error.  */
4926 /* We use char because int might match the return type of a gcc2
4927     builtin and then its argument prototype would still apply.  */
4928 char connect();
4929
4930 int main() {
4931
4932 /* The GNU C library defines this for functions which it implements
4933     to always fail with ENOSYS.  Some functions are actually named
4934     something starting with __ and the normal name is an alias.  */
4935 #if defined (__stub_connect) || defined (__stub___connect)
4936 choke me
4937 #else
4938 connect();
4939 #endif
4940
4941 ; return 0; }
4942 EOF
4943 if { (eval echo configure:4944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4944   rm -rf conftest*
4945   eval "ac_cv_func_connect=yes"
4946 else
4947   echo "configure: failed program was:" >&5
4948   cat conftest.$ac_ext >&5
4949   rm -rf conftest*
4950   eval "ac_cv_func_connect=no"
4951 fi
4952 rm -f conftest*
4953
4954 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4955   echo "$ac_t""yes" 1>&6
4956   :
4957 else
4958   echo "$ac_t""no" 1>&6
4959 fi
4960
4961     if test $ac_cv_func_connect = no; then
4962       
4963 xe_msg_checking="for connect in -lsocket"
4964 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
4965 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
4966 echo "configure:4967: checking "$xe_msg_checking"" >&5
4967 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
4968
4969 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
4970 cat > conftest.$ac_ext <<EOF
4971 #line 4972 "configure"
4972 #include "confdefs.h"
4973 /* Override any gcc2 internal prototype to avoid an error.  */
4974 /* We use char because int might match the return type of a gcc2
4975     builtin and then its argument prototype would still apply.  */
4976 char connect();
4977
4978 int main() {
4979 connect()
4980 ; return 0; }
4981 EOF
4982 if { (eval echo configure:4983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4983   rm -rf conftest*
4984   eval "ac_cv_lib_$ac_lib_var=yes"
4985 else
4986   echo "configure: failed program was:" >&5
4987   cat conftest.$ac_ext >&5
4988   rm -rf conftest*
4989   eval "ac_cv_lib_$ac_lib_var=no"
4990 fi
4991 rm -f conftest*
4992 xe_check_libs=""
4993
4994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4995   echo "$ac_t""yes" 1>&6
4996   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
4997 else
4998   echo "$ac_t""no" 1>&6
4999 fi
5000
5001
5002     fi
5003
5004     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5005     echo $ac_n "checking for remove""... $ac_c" 1>&6
5006 echo "configure:5007: checking for remove" >&5
5007
5008 cat > conftest.$ac_ext <<EOF
5009 #line 5010 "configure"
5010 #include "confdefs.h"
5011 /* System header to define __stub macros and hopefully few prototypes,
5012     which can conflict with char remove(); below.  */
5013 #include <assert.h>
5014 /* Override any gcc2 internal prototype to avoid an error.  */
5015 /* We use char because int might match the return type of a gcc2
5016     builtin and then its argument prototype would still apply.  */
5017 char remove();
5018
5019 int main() {
5020
5021 /* The GNU C library defines this for functions which it implements
5022     to always fail with ENOSYS.  Some functions are actually named
5023     something starting with __ and the normal name is an alias.  */
5024 #if defined (__stub_remove) || defined (__stub___remove)
5025 choke me
5026 #else
5027 remove();
5028 #endif
5029
5030 ; return 0; }
5031 EOF
5032 if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5033   rm -rf conftest*
5034   eval "ac_cv_func_remove=yes"
5035 else
5036   echo "configure: failed program was:" >&5
5037   cat conftest.$ac_ext >&5
5038   rm -rf conftest*
5039   eval "ac_cv_func_remove=no"
5040 fi
5041 rm -f conftest*
5042
5043 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5044   echo "$ac_t""yes" 1>&6
5045   :
5046 else
5047   echo "$ac_t""no" 1>&6
5048 fi
5049
5050     if test $ac_cv_func_remove = no; then
5051       
5052 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5053 echo "configure:5054: checking for remove in -lposix" >&5
5054 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5055
5056 xe_check_libs=" -lposix "
5057 cat > conftest.$ac_ext <<EOF
5058 #line 5059 "configure"
5059 #include "confdefs.h"
5060 /* Override any gcc2 internal prototype to avoid an error.  */
5061 /* We use char because int might match the return type of a gcc2
5062     builtin and then its argument prototype would still apply.  */
5063 char remove();
5064
5065 int main() {
5066 remove()
5067 ; return 0; }
5068 EOF
5069 if { (eval echo configure:5070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5070   rm -rf conftest*
5071   eval "ac_cv_lib_$ac_lib_var=yes"
5072 else
5073   echo "configure: failed program was:" >&5
5074   cat conftest.$ac_ext >&5
5075   rm -rf conftest*
5076   eval "ac_cv_lib_$ac_lib_var=no"
5077 fi
5078 rm -f conftest*
5079 xe_check_libs=""
5080
5081 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5082   echo "$ac_t""yes" 1>&6
5083   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5084 else
5085   echo "$ac_t""no" 1>&6
5086 fi
5087
5088
5089     fi
5090
5091     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5092     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5093 echo "configure:5094: checking for shmat" >&5
5094
5095 cat > conftest.$ac_ext <<EOF
5096 #line 5097 "configure"
5097 #include "confdefs.h"
5098 /* System header to define __stub macros and hopefully few prototypes,
5099     which can conflict with char shmat(); below.  */
5100 #include <assert.h>
5101 /* Override any gcc2 internal prototype to avoid an error.  */
5102 /* We use char because int might match the return type of a gcc2
5103     builtin and then its argument prototype would still apply.  */
5104 char shmat();
5105
5106 int main() {
5107
5108 /* The GNU C library defines this for functions which it implements
5109     to always fail with ENOSYS.  Some functions are actually named
5110     something starting with __ and the normal name is an alias.  */
5111 #if defined (__stub_shmat) || defined (__stub___shmat)
5112 choke me
5113 #else
5114 shmat();
5115 #endif
5116
5117 ; return 0; }
5118 EOF
5119 if { (eval echo configure:5120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5120   rm -rf conftest*
5121   eval "ac_cv_func_shmat=yes"
5122 else
5123   echo "configure: failed program was:" >&5
5124   cat conftest.$ac_ext >&5
5125   rm -rf conftest*
5126   eval "ac_cv_func_shmat=no"
5127 fi
5128 rm -f conftest*
5129
5130 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5131   echo "$ac_t""yes" 1>&6
5132   :
5133 else
5134   echo "$ac_t""no" 1>&6
5135 fi
5136
5137     if test $ac_cv_func_shmat = no; then
5138       
5139 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5140 echo "configure:5141: checking for shmat in -lipc" >&5
5141 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5142
5143 xe_check_libs=" -lipc "
5144 cat > conftest.$ac_ext <<EOF
5145 #line 5146 "configure"
5146 #include "confdefs.h"
5147 /* Override any gcc2 internal prototype to avoid an error.  */
5148 /* We use char because int might match the return type of a gcc2
5149     builtin and then its argument prototype would still apply.  */
5150 char shmat();
5151
5152 int main() {
5153 shmat()
5154 ; return 0; }
5155 EOF
5156 if { (eval echo configure:5157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5157   rm -rf conftest*
5158   eval "ac_cv_lib_$ac_lib_var=yes"
5159 else
5160   echo "configure: failed program was:" >&5
5161   cat conftest.$ac_ext >&5
5162   rm -rf conftest*
5163   eval "ac_cv_lib_$ac_lib_var=no"
5164 fi
5165 rm -f conftest*
5166 xe_check_libs=""
5167
5168 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5169   echo "$ac_t""yes" 1>&6
5170   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5171 else
5172   echo "$ac_t""no" 1>&6
5173 fi
5174
5175
5176     fi
5177   fi
5178
5179   # Check for libraries that X11R6 Xt/Xaw programs need.
5180   ac_save_LDFLAGS="$LDFLAGS"
5181   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5182   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5183   # check for ICE first), but we must link in the order -lSM -lICE or
5184   # we get undefined symbols.  So assume we have SM if we have ICE.
5185   # These have to be linked with before -lX11, unlike the other
5186   # libraries we check for below, so use a different variable.
5187   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5188   
5189 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5190 echo "configure:5191: checking for IceConnectionNumber in -lICE" >&5
5191 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5192
5193 xe_check_libs=" -lICE "
5194 cat > conftest.$ac_ext <<EOF
5195 #line 5196 "configure"
5196 #include "confdefs.h"
5197 /* Override any gcc2 internal prototype to avoid an error.  */
5198 /* We use char because int might match the return type of a gcc2
5199     builtin and then its argument prototype would still apply.  */
5200 char IceConnectionNumber();
5201
5202 int main() {
5203 IceConnectionNumber()
5204 ; return 0; }
5205 EOF
5206 if { (eval echo configure:5207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5207   rm -rf conftest*
5208   eval "ac_cv_lib_$ac_lib_var=yes"
5209 else
5210   echo "configure: failed program was:" >&5
5211   cat conftest.$ac_ext >&5
5212   rm -rf conftest*
5213   eval "ac_cv_lib_$ac_lib_var=no"
5214 fi
5215 rm -f conftest*
5216 xe_check_libs=""
5217
5218 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5219   echo "$ac_t""yes" 1>&6
5220   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5221 else
5222   echo "$ac_t""no" 1>&6
5223 fi
5224
5225
5226   LDFLAGS="$ac_save_LDFLAGS"
5227
5228 fi
5229  # Autoconf claims to find X library and include dirs for us.
5230   if test "$no_x" = "yes"
5231   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5232   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5233   fi
5234 fi
5235
5236 case "$with_x11" in
5237   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5238   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5239 esac
5240
5241 if test "$with_x11" = "yes"; then
5242   { test "$extra_verbose" = "yes" && cat << \EOF
5243     Defining HAVE_X_WINDOWS
5244 EOF
5245 cat >> confdefs.h <<\EOF
5246 #define HAVE_X_WINDOWS 1
5247 EOF
5248 }
5249
5250   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5251   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5252
5253       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5254     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5255     if test -d "$lib_dir" -a -d "$inc_dir"; then
5256       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5257         x_libraries="$lib_dir $x_libraries"
5258         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5259       esac
5260       case "$x_includes" in "$inc_dir"* ) ;; *)
5261         x_includes="$inc_dir $x_includes"
5262         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5263       esac
5264       break;       fi
5265   done
5266
5267     for rel in "X11R6" "X11R5" "X11R4"; do
5268     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5269     if test -d "$lib_dir" -a -d "$inc_dir"; then
5270       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5271         x_libraries="$x_libraries $lib_dir"
5272         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5273       esac
5274       case "$x_includes" in "$inc_dir"* ) ;; *)
5275         x_includes="$x_includes $inc_dir"
5276         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5277       esac
5278       break;     fi
5279   done
5280
5281     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
5282
5283   ld_switch_x_site="$X_LIBS"
5284
5285   
5286 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5287     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5288   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5289   
5290         runpath="" runpath_dirs=""
5291   if test -n "$LD_RUN_PATH"; then
5292     runpath="$LD_RUN_PATH"
5293   elif test "$GCC" = "yes"; then
5294         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5295     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5296     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5297     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5298       case "$arg" in P,* | -L* | -R* )
5299         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5300           {
5301 xe_runpath_dir="$dir"
5302   test "$xe_runpath_dir" != "/lib"     -a \
5303         "$xe_runpath_dir" != "/usr/lib" -a \
5304         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5305   eval "$xe_add_unique_runpath_dir"
5306 }
5307         done ;;
5308       esac
5309     done
5310     ld_switch_run="$ld_switch_run_save"
5311     rm -f conftest*
5312   else
5313         for arg in $ld_switch_site $ld_switch_x_site; do
5314       case "$arg" in -L*) {
5315 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5316   test "$xe_runpath_dir" != "/lib"     -a \
5317         "$xe_runpath_dir" != "/usr/lib" -a \
5318         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5319   eval "$xe_add_unique_runpath_dir"
5320 };; esac
5321     done
5322         if test "$opsys $need_motif" = "sol2 yes"; then
5323       xe_runpath_dir="/opt/SUNWdt/lib";
5324       eval "$xe_add_unique_runpath_dir";
5325     fi
5326   fi 
5327   if test -n "$runpath"; then
5328     ld_switch_run="${dash_r}${runpath}"
5329     
5330 if test "$GCC" = "yes"; then
5331   set x $ld_switch_run; shift; ld_switch_run=""
5332   while test -n "$1"; do
5333     case $1 in
5334       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5335       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5336       -Xlinker* ) ;;
5337       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5338     esac
5339     shift
5340   done
5341 fi
5342     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5343   fi
5344 fi
5345
5346
5347   if test "$extra_verbose" = "yes"; then
5348     echo; echo "X11 compilation variables:"
5349     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5350     echo
5351   fi
5352
5353             bitmapdirs=
5354   if test "$x_includes" != NONE; then
5355     for i in $x_includes; do
5356       if test -d "$i/bitmaps"; then
5357         bitmapdirs="$i/bitmaps:$bitmapdirs"
5358       fi
5359       if test -d "$i/X11/bitmaps"; then
5360         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5361       fi
5362     done
5363     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5364   fi
5365   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5366     Defining BITMAPDIR = "$bitmapdirs"
5367 EOF
5368 cat >> confdefs.h <<EOF
5369 #define BITMAPDIR "$bitmapdirs"
5370 EOF
5371 }
5372
5373
5374     echo "checking for X defines extracted by xmkmf" 1>&6
5375 echo "configure:5376: checking for X defines extracted by xmkmf" >&5
5376   rm -fr conftestdir
5377   if mkdir conftestdir; then
5378     cd conftestdir
5379     cat > Imakefile <<'EOF'
5380 xetest:
5381         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5382 EOF
5383     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5384       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5385       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5386     fi
5387     cd ..
5388     rm -fr conftestdir
5389     for word in $xmkmf_defines; do
5390       case "$word" in
5391         -D*=* ) ;;
5392         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5393               { test "$extra_verbose" = "yes" && cat << EOF
5394     Defining $word
5395 EOF
5396 cat >> confdefs.h <<EOF
5397 #define $word 1
5398 EOF
5399 }
5400  ;;
5401       esac
5402     done
5403   fi
5404
5405     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5406 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5407 echo "configure:5408: checking for X11/Intrinsic.h" >&5
5408
5409 cat > conftest.$ac_ext <<EOF
5410 #line 5411 "configure"
5411 #include "confdefs.h"
5412 #include <X11/Intrinsic.h>
5413 EOF
5414 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5415 { (eval echo configure:5416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5416 ac_err=`grep -v '^ *+' conftest.out`
5417 if test -z "$ac_err"; then
5418   rm -rf conftest*
5419   eval "ac_cv_header_$ac_safe=yes"
5420 else
5421   echo "$ac_err" >&5
5422   echo "configure: failed program was:" >&5
5423   cat conftest.$ac_ext >&5
5424   rm -rf conftest*
5425   eval "ac_cv_header_$ac_safe=no"
5426 fi
5427 rm -f conftest*
5428 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5429   echo "$ac_t""yes" 1>&6
5430   :
5431 else
5432   echo "$ac_t""no" 1>&6
5433 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5434 fi
5435
5436
5437       
5438 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5439 echo "configure:5440: checking for XOpenDisplay in -lX11" >&5
5440 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5441
5442 xe_check_libs=" -lX11 "
5443 cat > conftest.$ac_ext <<EOF
5444 #line 5445 "configure"
5445 #include "confdefs.h"
5446 /* Override any gcc2 internal prototype to avoid an error.  */
5447 /* We use char because int might match the return type of a gcc2
5448     builtin and then its argument prototype would still apply.  */
5449 char XOpenDisplay();
5450
5451 int main() {
5452 XOpenDisplay()
5453 ; return 0; }
5454 EOF
5455 if { (eval echo configure:5456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5456   rm -rf conftest*
5457   eval "ac_cv_lib_$ac_lib_var=yes"
5458 else
5459   echo "configure: failed program was:" >&5
5460   cat conftest.$ac_ext >&5
5461   rm -rf conftest*
5462   eval "ac_cv_lib_$ac_lib_var=no"
5463 fi
5464 rm -f conftest*
5465 xe_check_libs=""
5466
5467 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5468   echo "$ac_t""yes" 1>&6
5469   have_lib_x11=yes
5470 else
5471   echo "$ac_t""no" 1>&6
5472 fi
5473
5474
5475   if test "$have_lib_x11" != "yes"; then
5476     
5477 xe_msg_checking="for XGetFontProperty in -lX11"
5478 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5479 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5480 echo "configure:5481: checking "$xe_msg_checking"" >&5
5481 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5482
5483 xe_check_libs=" -lX11 -b i486-linuxaout"
5484 cat > conftest.$ac_ext <<EOF
5485 #line 5486 "configure"
5486 #include "confdefs.h"
5487 /* Override any gcc2 internal prototype to avoid an error.  */
5488 /* We use char because int might match the return type of a gcc2
5489     builtin and then its argument prototype would still apply.  */
5490 char XGetFontProperty();
5491
5492 int main() {
5493 XGetFontProperty()
5494 ; return 0; }
5495 EOF
5496 if { (eval echo configure:5497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5497   rm -rf conftest*
5498   eval "ac_cv_lib_$ac_lib_var=yes"
5499 else
5500   echo "configure: failed program was:" >&5
5501   cat conftest.$ac_ext >&5
5502   rm -rf conftest*
5503   eval "ac_cv_lib_$ac_lib_var=no"
5504 fi
5505 rm -f conftest*
5506 xe_check_libs=""
5507
5508 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5509   echo "$ac_t""yes" 1>&6
5510   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5511 else
5512   echo "$ac_t""no" 1>&6
5513 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5514 fi
5515
5516
5517   fi
5518   libs_x="-lX11"
5519   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5520
5521     
5522 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5523 echo "configure:5524: checking for XShapeSelectInput in -lXext" >&5
5524 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5525
5526 xe_check_libs=" -lXext "
5527 cat > conftest.$ac_ext <<EOF
5528 #line 5529 "configure"
5529 #include "confdefs.h"
5530 /* Override any gcc2 internal prototype to avoid an error.  */
5531 /* We use char because int might match the return type of a gcc2
5532     builtin and then its argument prototype would still apply.  */
5533 char XShapeSelectInput();
5534
5535 int main() {
5536 XShapeSelectInput()
5537 ; return 0; }
5538 EOF
5539 if { (eval echo configure:5540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5540   rm -rf conftest*
5541   eval "ac_cv_lib_$ac_lib_var=yes"
5542 else
5543   echo "configure: failed program was:" >&5
5544   cat conftest.$ac_ext >&5
5545   rm -rf conftest*
5546   eval "ac_cv_lib_$ac_lib_var=no"
5547 fi
5548 rm -f conftest*
5549 xe_check_libs=""
5550
5551 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5552   echo "$ac_t""yes" 1>&6
5553   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5554 else
5555   echo "$ac_t""no" 1>&6
5556 fi
5557
5558
5559
5560     
5561 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5562 echo "configure:5563: checking for XtOpenDisplay in -lXt" >&5
5563 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5564
5565 xe_check_libs=" -lXt "
5566 cat > conftest.$ac_ext <<EOF
5567 #line 5568 "configure"
5568 #include "confdefs.h"
5569 /* Override any gcc2 internal prototype to avoid an error.  */
5570 /* We use char because int might match the return type of a gcc2
5571     builtin and then its argument prototype would still apply.  */
5572 char XtOpenDisplay();
5573
5574 int main() {
5575 XtOpenDisplay()
5576 ; return 0; }
5577 EOF
5578 if { (eval echo configure:5579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5579   rm -rf conftest*
5580   eval "ac_cv_lib_$ac_lib_var=yes"
5581 else
5582   echo "configure: failed program was:" >&5
5583   cat conftest.$ac_ext >&5
5584   rm -rf conftest*
5585   eval "ac_cv_lib_$ac_lib_var=no"
5586 fi
5587 rm -f conftest*
5588 xe_check_libs=""
5589
5590 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5591   echo "$ac_t""yes" 1>&6
5592   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5593 else
5594   echo "$ac_t""no" 1>&6
5595 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5596 fi
5597
5598
5599
5600   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5601 echo "configure:5602: checking the version of X11 being used" >&5
5602   cat > conftest.$ac_ext <<EOF
5603 #line 5604 "configure"
5604 #include "confdefs.h"
5605 #include <X11/Intrinsic.h>
5606     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5607 EOF
5608 if { (eval echo configure:5609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5609 then
5610   ./conftest foobar; x11_release=$?
5611 else
5612   conftest_rc="$?"
5613   echo "configure: failed program was:" >&5
5614   cat conftest.$ac_ext >&5
5615   rm -fr conftest*
5616   x11_release=4
5617 fi
5618 rm -fr conftest*
5619   echo "$ac_t""R${x11_release}" 1>&6
5620   { test "$extra_verbose" = "yes" && cat << EOF
5621     Defining THIS_IS_X11R${x11_release}
5622 EOF
5623 cat >> confdefs.h <<EOF
5624 #define THIS_IS_X11R${x11_release} 1
5625 EOF
5626 }
5627
5628
5629   for ac_hdr in X11/Xlocale.h
5630 do
5631 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5632 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5633 echo "configure:5634: checking for $ac_hdr" >&5
5634
5635 cat > conftest.$ac_ext <<EOF
5636 #line 5637 "configure"
5637 #include "confdefs.h"
5638 #include <$ac_hdr>
5639 EOF
5640 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5641 { (eval echo configure:5642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5642 ac_err=`grep -v '^ *+' conftest.out`
5643 if test -z "$ac_err"; then
5644   rm -rf conftest*
5645   eval "ac_cv_header_$ac_safe=yes"
5646 else
5647   echo "$ac_err" >&5
5648   echo "configure: failed program was:" >&5
5649   cat conftest.$ac_ext >&5
5650   rm -rf conftest*
5651   eval "ac_cv_header_$ac_safe=no"
5652 fi
5653 rm -f conftest*
5654 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5655   echo "$ac_t""yes" 1>&6
5656     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5657   { test "$extra_verbose" = "yes" && cat << EOF
5658     Defining $ac_tr_hdr
5659 EOF
5660 cat >> confdefs.h <<EOF
5661 #define $ac_tr_hdr 1
5662 EOF
5663 }
5664  
5665 else
5666   echo "$ac_t""no" 1>&6
5667 fi
5668 done
5669
5670
5671     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5672 echo "configure:5673: checking for XFree86" >&5
5673   if test -d "/usr/X386/include" -o \
5674           -f "/etc/XF86Config"    -o \
5675           -f "/etc/X11/XF86Config" -o \
5676           -f "/usr/X11R6/lib/X11/XF86Config"; then
5677     echo "$ac_t""yes" 1>&6
5678     { test "$extra_verbose" = "yes" && cat << \EOF
5679     Defining HAVE_XFREE386
5680 EOF
5681 cat >> confdefs.h <<\EOF
5682 #define HAVE_XFREE386 1
5683 EOF
5684 }
5685
5686   else
5687     echo "$ac_t""no" 1>&6
5688   fi
5689
5690     test -z "$with_xmu" && { 
5691 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5692 echo "configure:5693: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5693 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5694
5695 xe_check_libs=" -lXmu "
5696 cat > conftest.$ac_ext <<EOF
5697 #line 5698 "configure"
5698 #include "confdefs.h"
5699 /* Override any gcc2 internal prototype to avoid an error.  */
5700 /* We use char because int might match the return type of a gcc2
5701     builtin and then its argument prototype would still apply.  */
5702 char XmuReadBitmapDataFromFile();
5703
5704 int main() {
5705 XmuReadBitmapDataFromFile()
5706 ; return 0; }
5707 EOF
5708 if { (eval echo configure:5709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5709   rm -rf conftest*
5710   eval "ac_cv_lib_$ac_lib_var=yes"
5711 else
5712   echo "configure: failed program was:" >&5
5713   cat conftest.$ac_ext >&5
5714   rm -rf conftest*
5715   eval "ac_cv_lib_$ac_lib_var=no"
5716 fi
5717 rm -f conftest*
5718 xe_check_libs=""
5719
5720 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5721   echo "$ac_t""yes" 1>&6
5722   with_xmu=yes
5723 else
5724   echo "$ac_t""no" 1>&6
5725 with_xmu=no
5726 fi
5727
5728  }
5729   if test "$with_xmu" = "no"; then
5730     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5731    echo "    xemacs will be linked with \"xmu.o\""
5732  fi
5733   else
5734     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5735     { test "$extra_verbose" = "yes" && cat << \EOF
5736     Defining HAVE_XMU
5737 EOF
5738 cat >> confdefs.h <<\EOF
5739 #define HAVE_XMU 1
5740 EOF
5741 }
5742
5743   fi
5744
5745       
5746 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5747 echo "configure:5748: checking for main in -lXbsd" >&5
5748 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5749
5750 xe_check_libs=" -lXbsd "
5751 cat > conftest.$ac_ext <<EOF
5752 #line 5753 "configure"
5753 #include "confdefs.h"
5754
5755 int main() {
5756 main()
5757 ; return 0; }
5758 EOF
5759 if { (eval echo configure:5760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5760   rm -rf conftest*
5761   eval "ac_cv_lib_$ac_lib_var=yes"
5762 else
5763   echo "configure: failed program was:" >&5
5764   cat conftest.$ac_ext >&5
5765   rm -rf conftest*
5766   eval "ac_cv_lib_$ac_lib_var=no"
5767 fi
5768 rm -f conftest*
5769 xe_check_libs=""
5770
5771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5772   echo "$ac_t""yes" 1>&6
5773   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5774 else
5775   echo "$ac_t""no" 1>&6
5776 fi
5777
5778
5779
5780     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5781         if test "$GCC" = "yes"; then
5782       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5783       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5784     else
5785       case "$CC" in
5786         "xlc" ) CC="xlc_r" ;;
5787         "xlC" ) CC="xlC_r" ;;
5788         "cc"  ) CC="cc_r" ;;
5789       esac
5790     fi
5791   fi
5792
5793 fi 
5794 if test "$with_msw" != "no"; then
5795   echo "checking for MS-Windows" 1>&6
5796 echo "configure:5797: checking for MS-Windows" >&5
5797   
5798 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5799 echo "configure:5800: checking for main in -lgdi32" >&5
5800 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5801
5802 xe_check_libs=" -lgdi32 "
5803 cat > conftest.$ac_ext <<EOF
5804 #line 5805 "configure"
5805 #include "confdefs.h"
5806
5807 int main() {
5808 main()
5809 ; return 0; }
5810 EOF
5811 if { (eval echo configure:5812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5812   rm -rf conftest*
5813   eval "ac_cv_lib_$ac_lib_var=yes"
5814 else
5815   echo "configure: failed program was:" >&5
5816   cat conftest.$ac_ext >&5
5817   rm -rf conftest*
5818   eval "ac_cv_lib_$ac_lib_var=no"
5819 fi
5820 rm -f conftest*
5821 xe_check_libs=""
5822
5823 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5824   echo "$ac_t""yes" 1>&6
5825   with_msw=yes
5826 else
5827   echo "$ac_t""no" 1>&6
5828 fi
5829
5830
5831   if test "$with_msw" = "yes"; then
5832     { test "$extra_verbose" = "yes" && cat << \EOF
5833     Defining HAVE_MS_WINDOWS
5834 EOF
5835 cat >> confdefs.h <<\EOF
5836 #define HAVE_MS_WINDOWS 1
5837 EOF
5838 }
5839
5840     install_pp="$blddir/lib-src/installexe.sh"
5841     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
5842     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
5843     if test "$window_system" != x11; then
5844         window_system=msw
5845         test "$with_scrollbars" != "no" && with_scrollbars=msw \
5846             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5847    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5848  fi
5849         test "$with_menubars"   != "no" && with_menubars=msw \
5850             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5851    echo "    xemacs will be linked with \"menubar-msw.o\""
5852  fi
5853         test "$with_toolbars"   != "no" && with_toolbars=msw \
5854             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5855    echo "    xemacs will be linked with \"toolbar-msw.o\""
5856  fi
5857         test "$with_dialogs"   != "no" && with_dialogs=msw \
5858             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5859    echo "    xemacs will be linked with \"dialog-msw.o\""
5860  fi
5861     else
5862         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5863    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5864  fi
5865         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5866    echo "    xemacs will be linked with \"menubar-msw.o\""
5867  fi
5868         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5869    echo "    xemacs will be linked with \"toolbar-msw.o\""
5870  fi
5871         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5872    echo "    xemacs will be linked with \"dialog-msw.o\""
5873  fi
5874     fi
5875         cat > conftest.$ac_ext <<EOF
5876 #line 5877 "configure"
5877 #include "confdefs.h"
5878 #include <fcntl.h>
5879     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
5880 EOF
5881 if { (eval echo configure:5882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5882 then
5883   { test "$extra_verbose" = "yes" && cat << \EOF
5884     Defining HAVE_MSG_SELECT
5885 EOF
5886 cat >> confdefs.h <<\EOF
5887 #define HAVE_MSG_SELECT 1
5888 EOF
5889 }
5890
5891 else
5892   conftest_rc="$?"
5893   echo "configure: failed program was:" >&5
5894   cat conftest.$ac_ext >&5
5895 fi
5896 rm -fr conftest*
5897     const_is_losing=no
5898     with_file_coding=yes
5899     extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o" &&  if test "$extra_verbose" = "yes"; then
5900    echo "    xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o\""
5901  fi
5902   fi
5903 fi
5904
5905
5906
5907 test -z "$window_system" && window_system="none"
5908
5909 if test "$window_system" = "none"; then
5910   for feature in menubars scrollbars toolbars dialogs dragndrop xface
5911   do
5912     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5913        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
5914     fi
5915     eval "with_${feature}=no"
5916   done
5917 else
5918   test -z "$with_toolbars" && with_toolbars=yes
5919 fi
5920
5921 if test "$with_msw" != "yes"; then
5922   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
5923   do
5924     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5925        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
5926     fi
5927     eval "with_${feature}=no"
5928   done
5929 else
5930   :
5931 fi
5932
5933 if test "$with_x11" != "yes"; then
5934             for feature in tooltalk cde offix wmcommand xim xmu
5935   do
5936     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5937        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
5938     fi
5939     eval "with_${feature}=no"
5940   done
5941 fi
5942
5943 bitmapdir=
5944
5945 case "$window_system" in
5946   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
5947   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
5948   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
5949 esac
5950
5951 case "$x_libraries" in *X11R4* )
5952   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
5953   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
5954 esac
5955
5956 echo "checking for WM_COMMAND option" 1>&6
5957 echo "configure:5958: checking for WM_COMMAND option" >&5;
5958 if test "$with_wmcommand" != "no"; then
5959   { test "$extra_verbose" = "yes" && cat << \EOF
5960     Defining HAVE_WMCOMMAND
5961 EOF
5962 cat >> confdefs.h <<\EOF
5963 #define HAVE_WMCOMMAND 1
5964 EOF
5965 }
5966
5967 fi
5968
5969 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
5970 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
5971 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
5972 echo "configure:5973: checking for X11/Xauth.h" >&5
5973
5974 cat > conftest.$ac_ext <<EOF
5975 #line 5976 "configure"
5976 #include "confdefs.h"
5977 #include <X11/Xauth.h>
5978 EOF
5979 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5980 { (eval echo configure:5981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5981 ac_err=`grep -v '^ *+' conftest.out`
5982 if test -z "$ac_err"; then
5983   rm -rf conftest*
5984   eval "ac_cv_header_$ac_safe=yes"
5985 else
5986   echo "$ac_err" >&5
5987   echo "configure: failed program was:" >&5
5988   cat conftest.$ac_ext >&5
5989   rm -rf conftest*
5990   eval "ac_cv_header_$ac_safe=no"
5991 fi
5992 rm -f conftest*
5993 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5994   echo "$ac_t""yes" 1>&6
5995   :
5996 else
5997   echo "$ac_t""no" 1>&6
5998 with_xauth=no
5999 fi
6000  }
6001 test -z "$with_xauth" && { 
6002 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6003 echo "configure:6004: checking for XauGetAuthByAddr in -lXau" >&5
6004 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6005
6006 xe_check_libs=" -lXau "
6007 cat > conftest.$ac_ext <<EOF
6008 #line 6009 "configure"
6009 #include "confdefs.h"
6010 /* Override any gcc2 internal prototype to avoid an error.  */
6011 /* We use char because int might match the return type of a gcc2
6012     builtin and then its argument prototype would still apply.  */
6013 char XauGetAuthByAddr();
6014
6015 int main() {
6016 XauGetAuthByAddr()
6017 ; return 0; }
6018 EOF
6019 if { (eval echo configure:6020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6020   rm -rf conftest*
6021   eval "ac_cv_lib_$ac_lib_var=yes"
6022 else
6023   echo "configure: failed program was:" >&5
6024   cat conftest.$ac_ext >&5
6025   rm -rf conftest*
6026   eval "ac_cv_lib_$ac_lib_var=no"
6027 fi
6028 rm -f conftest*
6029 xe_check_libs=""
6030
6031 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6032   echo "$ac_t""yes" 1>&6
6033   :
6034 else
6035   echo "$ac_t""no" 1>&6
6036 with_xauth=no
6037 fi
6038
6039  }
6040 test -z "$with_xauth" && with_xauth=yes
6041 if test "$with_xauth" = "yes"; then
6042   { test "$extra_verbose" = "yes" && cat << \EOF
6043     Defining HAVE_XAUTH
6044 EOF
6045 cat >> confdefs.h <<\EOF
6046 #define HAVE_XAUTH 1
6047 EOF
6048 }
6049
6050   
6051 T=""
6052 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
6053 libs_xauth="$T"
6054
6055 fi
6056
6057
6058
6059
6060 if test "$with_tooltalk" != "no" ; then
6061       for dir in "" "Tt/" "desktop/" ; do
6062     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6063 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6064 echo "configure:6065: checking for ${dir}tt_c.h" >&5
6065
6066 cat > conftest.$ac_ext <<EOF
6067 #line 6068 "configure"
6068 #include "confdefs.h"
6069 #include <${dir}tt_c.h>
6070 EOF
6071 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6072 { (eval echo configure:6073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6073 ac_err=`grep -v '^ *+' conftest.out`
6074 if test -z "$ac_err"; then
6075   rm -rf conftest*
6076   eval "ac_cv_header_$ac_safe=yes"
6077 else
6078   echo "$ac_err" >&5
6079   echo "configure: failed program was:" >&5
6080   cat conftest.$ac_ext >&5
6081   rm -rf conftest*
6082   eval "ac_cv_header_$ac_safe=no"
6083 fi
6084 rm -f conftest*
6085 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6086   echo "$ac_t""yes" 1>&6
6087   tt_c_h_path="${dir}tt_c.h"; break
6088 else
6089   echo "$ac_t""no" 1>&6
6090 fi
6091
6092   done
6093   if test -z "$tt_c_h_path"; then
6094     if test "$with_tooltalk" = "yes"; then
6095       (echo "$progname: Usage error:"
6096 echo " " "Unable to find required tooltalk header files."
6097 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6098     fi
6099     with_tooltalk=no
6100   fi
6101 fi
6102 if test "$with_tooltalk" != "no" ; then
6103   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6104     
6105 xe_msg_checking="for tt_message_create in -ltt"
6106 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6107 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6108 echo "configure:6109: checking "$xe_msg_checking"" >&5
6109 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6110
6111 xe_check_libs=" -ltt $extra_libs"
6112 cat > conftest.$ac_ext <<EOF
6113 #line 6114 "configure"
6114 #include "confdefs.h"
6115 /* Override any gcc2 internal prototype to avoid an error.  */
6116 /* We use char because int might match the return type of a gcc2
6117     builtin and then its argument prototype would still apply.  */
6118 char tt_message_create();
6119
6120 int main() {
6121 tt_message_create()
6122 ; return 0; }
6123 EOF
6124 if { (eval echo configure:6125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6125   rm -rf conftest*
6126   eval "ac_cv_lib_$ac_lib_var=yes"
6127 else
6128   echo "configure: failed program was:" >&5
6129   cat conftest.$ac_ext >&5
6130   rm -rf conftest*
6131   eval "ac_cv_lib_$ac_lib_var=no"
6132 fi
6133 rm -f conftest*
6134 xe_check_libs=""
6135
6136 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6137   echo "$ac_t""yes" 1>&6
6138   tt_libs="-ltt $extra_libs"; break
6139 else
6140   echo "$ac_t""no" 1>&6
6141 :
6142 fi
6143
6144
6145   done
6146   if test -z "$tt_libs"; then
6147     if test "$with_tooltalk" = "yes"; then
6148       (echo "$progname: Usage error:"
6149 echo " " "Unable to find required tooltalk libraries."
6150 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6151     fi
6152     with_tooltalk=no
6153   fi
6154 fi
6155 test -z "$with_tooltalk" && with_tooltalk=yes
6156 if test "$with_tooltalk" = "yes"; then
6157   { test "$extra_verbose" = "yes" && cat << \EOF
6158     Defining TOOLTALK
6159 EOF
6160 cat >> confdefs.h <<\EOF
6161 #define TOOLTALK 1
6162 EOF
6163 }
6164
6165   { test "$extra_verbose" = "yes" && cat << EOF
6166     Defining TT_C_H_PATH = "$tt_c_h_path"
6167 EOF
6168 cat >> confdefs.h <<EOF
6169 #define TT_C_H_PATH "$tt_c_h_path"
6170 EOF
6171 }
6172
6173   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6174   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6175    echo "    xemacs will be linked with \"tooltalk.o\""
6176  fi
6177 fi
6178
6179 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6180 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6181 echo "configure:6182: checking for Dt/Dt.h" >&5
6182
6183 cat > conftest.$ac_ext <<EOF
6184 #line 6185 "configure"
6185 #include "confdefs.h"
6186 #include <Dt/Dt.h>
6187 EOF
6188 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6189 { (eval echo configure:6190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6190 ac_err=`grep -v '^ *+' conftest.out`
6191 if test -z "$ac_err"; then
6192   rm -rf conftest*
6193   eval "ac_cv_header_$ac_safe=yes"
6194 else
6195   echo "$ac_err" >&5
6196   echo "configure: failed program was:" >&5
6197   cat conftest.$ac_ext >&5
6198   rm -rf conftest*
6199   eval "ac_cv_header_$ac_safe=no"
6200 fi
6201 rm -f conftest*
6202 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6203   echo "$ac_t""yes" 1>&6
6204   :
6205 else
6206   echo "$ac_t""no" 1>&6
6207 with_cde=no
6208 fi
6209  }
6210 test -z "$with_cde" && { 
6211 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6212 echo "configure:6213: checking for DtDndDragStart in -lDtSvc" >&5
6213 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6214
6215 xe_check_libs=" -lDtSvc "
6216 cat > conftest.$ac_ext <<EOF
6217 #line 6218 "configure"
6218 #include "confdefs.h"
6219 /* Override any gcc2 internal prototype to avoid an error.  */
6220 /* We use char because int might match the return type of a gcc2
6221     builtin and then its argument prototype would still apply.  */
6222 char DtDndDragStart();
6223
6224 int main() {
6225 DtDndDragStart()
6226 ; return 0; }
6227 EOF
6228 if { (eval echo configure:6229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6229   rm -rf conftest*
6230   eval "ac_cv_lib_$ac_lib_var=yes"
6231 else
6232   echo "configure: failed program was:" >&5
6233   cat conftest.$ac_ext >&5
6234   rm -rf conftest*
6235   eval "ac_cv_lib_$ac_lib_var=no"
6236 fi
6237 rm -f conftest*
6238 xe_check_libs=""
6239
6240 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6241   echo "$ac_t""yes" 1>&6
6242   :
6243 else
6244   echo "$ac_t""no" 1>&6
6245 with_cde=no
6246 fi
6247
6248  }
6249 test -z "$with_cde" && with_cde=yes
6250 if test "$with_dragndrop" = no; then
6251   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6252   with_cde=no
6253 fi
6254 if test "$with_cde" = "yes" ; then
6255   { test "$extra_verbose" = "yes" && cat << \EOF
6256     Defining HAVE_CDE
6257 EOF
6258 cat >> confdefs.h <<\EOF
6259 #define HAVE_CDE 1
6260 EOF
6261 }
6262
6263   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6264   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6265   with_tooltalk=yes # CDE requires Tooltalk
6266   need_motif=yes    # CDE requires Motif
6267 fi
6268
6269 test "$window_system" != "x11" && with_offix=no
6270 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6271   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6272   with_offix=no
6273 fi
6274 if test "$with_dragndrop" = no; then
6275   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6276   with_offix=no
6277 fi
6278 if test "$with_cde" = yes; then
6279   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6280   with_offix=no
6281 fi
6282 test -z "$with_offix" && with_offix=no
6283 if test "$with_offix" = "yes"; then
6284   { test "$extra_verbose" = "yes" && cat << \EOF
6285     Defining HAVE_OFFIX_DND
6286 EOF
6287 cat >> confdefs.h <<\EOF
6288 #define HAVE_OFFIX_DND 1
6289 EOF
6290 }
6291
6292   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6293   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6294 fi
6295
6296 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6297 echo "configure:6298: checking if drag and drop API is needed" >&5
6298 if test "$with_dragndrop" != "no" ; then
6299   if test -n "$dragndrop_proto" ; then
6300     with_dragndrop=yes
6301     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6302     { test "$extra_verbose" = "yes" && cat << \EOF
6303     Defining HAVE_DRAGNDROP
6304 EOF
6305 cat >> confdefs.h <<\EOF
6306 #define HAVE_DRAGNDROP 1
6307 EOF
6308 }
6309
6310     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6311   else
6312     with_dragndrop=no
6313     echo "$ac_t""no" 1>&6
6314   fi
6315 fi
6316
6317 echo "checking for LDAP" 1>&6
6318 echo "configure:6319: checking for LDAP" >&5
6319 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6320 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6321 echo "configure:6322: checking for ldap.h" >&5
6322
6323 cat > conftest.$ac_ext <<EOF
6324 #line 6325 "configure"
6325 #include "confdefs.h"
6326 #include <ldap.h>
6327 EOF
6328 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6329 { (eval echo configure:6330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6330 ac_err=`grep -v '^ *+' conftest.out`
6331 if test -z "$ac_err"; then
6332   rm -rf conftest*
6333   eval "ac_cv_header_$ac_safe=yes"
6334 else
6335   echo "$ac_err" >&5
6336   echo "configure: failed program was:" >&5
6337   cat conftest.$ac_ext >&5
6338   rm -rf conftest*
6339   eval "ac_cv_header_$ac_safe=no"
6340 fi
6341 rm -f conftest*
6342 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6343   echo "$ac_t""yes" 1>&6
6344   :
6345 else
6346   echo "$ac_t""no" 1>&6
6347 with_ldap=no
6348 fi
6349  }
6350 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6351 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6352 echo "configure:6353: checking for lber.h" >&5
6353
6354 cat > conftest.$ac_ext <<EOF
6355 #line 6356 "configure"
6356 #include "confdefs.h"
6357 #include <lber.h>
6358 EOF
6359 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6360 { (eval echo configure:6361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6361 ac_err=`grep -v '^ *+' conftest.out`
6362 if test -z "$ac_err"; then
6363   rm -rf conftest*
6364   eval "ac_cv_header_$ac_safe=yes"
6365 else
6366   echo "$ac_err" >&5
6367   echo "configure: failed program was:" >&5
6368   cat conftest.$ac_ext >&5
6369   rm -rf conftest*
6370   eval "ac_cv_header_$ac_safe=no"
6371 fi
6372 rm -f conftest*
6373 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6374   echo "$ac_t""yes" 1>&6
6375   :
6376 else
6377   echo "$ac_t""no" 1>&6
6378 with_ldap=no
6379 fi
6380  }
6381 if test "$with_ldap" != "no"; then
6382   
6383 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
6384 echo "configure:6385: checking for ldap_search in -lldap" >&5
6385 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
6386
6387 xe_check_libs=" -lldap "
6388 cat > conftest.$ac_ext <<EOF
6389 #line 6390 "configure"
6390 #include "confdefs.h"
6391 /* Override any gcc2 internal prototype to avoid an error.  */
6392 /* We use char because int might match the return type of a gcc2
6393     builtin and then its argument prototype would still apply.  */
6394 char ldap_search();
6395
6396 int main() {
6397 ldap_search()
6398 ; return 0; }
6399 EOF
6400 if { (eval echo configure:6401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6401   rm -rf conftest*
6402   eval "ac_cv_lib_$ac_lib_var=yes"
6403 else
6404   echo "configure: failed program was:" >&5
6405   cat conftest.$ac_ext >&5
6406   rm -rf conftest*
6407   eval "ac_cv_lib_$ac_lib_var=no"
6408 fi
6409 rm -f conftest*
6410 xe_check_libs=""
6411
6412 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6413   echo "$ac_t""yes" 1>&6
6414   with_ldap_nolber=yes
6415 else
6416   echo "$ac_t""no" 1>&6
6417 with_ldap_nolber=no
6418 fi
6419
6420
6421   test "$with_ldap_nolber" = "no" && { 
6422 xe_msg_checking="for ldap_open in -lldap"
6423 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6424 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6425 echo "configure:6426: checking "$xe_msg_checking"" >&5
6426 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6427
6428 xe_check_libs=" -lldap -llber"
6429 cat > conftest.$ac_ext <<EOF
6430 #line 6431 "configure"
6431 #include "confdefs.h"
6432 /* Override any gcc2 internal prototype to avoid an error.  */
6433 /* We use char because int might match the return type of a gcc2
6434     builtin and then its argument prototype would still apply.  */
6435 char ldap_open();
6436
6437 int main() {
6438 ldap_open()
6439 ; return 0; }
6440 EOF
6441 if { (eval echo configure:6442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6442   rm -rf conftest*
6443   eval "ac_cv_lib_$ac_lib_var=yes"
6444 else
6445   echo "configure: failed program was:" >&5
6446   cat conftest.$ac_ext >&5
6447   rm -rf conftest*
6448   eval "ac_cv_lib_$ac_lib_var=no"
6449 fi
6450 rm -f conftest*
6451 xe_check_libs=""
6452
6453 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6454   echo "$ac_t""yes" 1>&6
6455   with_ldap_lber=yes
6456 else
6457   echo "$ac_t""no" 1>&6
6458 with_ldap_lber=no
6459 fi
6460
6461  }
6462   test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" \) && with_ldap=yes
6463 fi
6464 if test "$with_ldap" = "yes"; then
6465   { test "$extra_verbose" = "yes" && cat << \EOF
6466     Defining HAVE_LDAP
6467 EOF
6468 cat >> confdefs.h <<\EOF
6469 #define HAVE_LDAP 1
6470 EOF
6471 }
6472
6473   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6474    echo "    xemacs will be linked with \"eldap.o\""
6475  fi
6476   if test "$with_ldap_nolber" = "yes" ; then
6477     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6478   else
6479     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6480     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6481   fi
6482   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
6483 do
6484 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6485 echo "configure:6486: checking for $ac_func" >&5
6486
6487 cat > conftest.$ac_ext <<EOF
6488 #line 6489 "configure"
6489 #include "confdefs.h"
6490 /* System header to define __stub macros and hopefully few prototypes,
6491     which can conflict with char $ac_func(); below.  */
6492 #include <assert.h>
6493 /* Override any gcc2 internal prototype to avoid an error.  */
6494 /* We use char because int might match the return type of a gcc2
6495     builtin and then its argument prototype would still apply.  */
6496 char $ac_func();
6497
6498 int main() {
6499
6500 /* The GNU C library defines this for functions which it implements
6501     to always fail with ENOSYS.  Some functions are actually named
6502     something starting with __ and the normal name is an alias.  */
6503 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6504 choke me
6505 #else
6506 $ac_func();
6507 #endif
6508
6509 ; return 0; }
6510 EOF
6511 if { (eval echo configure:6512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6512   rm -rf conftest*
6513   eval "ac_cv_func_$ac_func=yes"
6514 else
6515   echo "configure: failed program was:" >&5
6516   cat conftest.$ac_ext >&5
6517   rm -rf conftest*
6518   eval "ac_cv_func_$ac_func=no"
6519 fi
6520 rm -f conftest*
6521
6522 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6523   echo "$ac_t""yes" 1>&6
6524     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6525   { test "$extra_verbose" = "yes" && cat << EOF
6526     Defining $ac_tr_func
6527 EOF
6528 cat >> confdefs.h <<EOF
6529 #define $ac_tr_func 1
6530 EOF
6531 }
6532  
6533 else
6534   echo "$ac_t""no" 1>&6
6535 fi
6536 done
6537
6538 fi
6539
6540
6541 if test "$window_system" != "none"; then
6542   echo "checking for graphics libraries" 1>&6
6543 echo "configure:6544: checking for graphics libraries" >&5
6544
6545     xpm_problem=""
6546   if test -z "$with_xpm"; then
6547     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6548 echo "configure:6549: checking for Xpm - no older than 3.4f" >&5
6549     xe_check_libs=-lXpm
6550     cat > conftest.$ac_ext <<EOF
6551 #line 6552 "configure"
6552 #include "confdefs.h"
6553 #include <X11/xpm.h>
6554     int main(int c, char **v) {
6555     return c == 1 ? 0 :
6556       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6557       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6558 EOF
6559 if { (eval echo configure:6560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6560 then
6561   ./conftest dummy_arg; xpm_status=$?;
6562       if test "$xpm_status" = "0"; then
6563         with_xpm=yes;
6564       else
6565         with_xpm=no;
6566         if test "$xpm_status" = "1"; then
6567           xpm_problem="Xpm library version and header file version don't match!"
6568         elif test "$xpm_status" = "2"; then
6569           xpm_problem="Xpm library version is too old!"
6570         else
6571           xpm_problem="Internal xpm detection logic error!"
6572         fi
6573         echo "
6574 *** WARNING *** $xpm_problem
6575   I'm not touching that with a 10-foot pole!
6576   If you really want to use the installed version of Xpm, rerun
6577   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6578     fi
6579 else
6580   conftest_rc="$?"
6581   echo "configure: failed program was:" >&5
6582   cat conftest.$ac_ext >&5
6583   rm -fr conftest*
6584   with_xpm=no
6585 fi
6586 rm -fr conftest*
6587     xe_check_libs=
6588     echo "$ac_t""$with_xpm" 1>&6
6589   fi
6590   if test "$with_xpm" = "yes"; then
6591     { test "$extra_verbose" = "yes" && cat << \EOF
6592     Defining HAVE_XPM
6593 EOF
6594 cat >> confdefs.h <<\EOF
6595 #define HAVE_XPM 1
6596 EOF
6597 }
6598
6599     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6600     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6601 echo "configure:6602: checking for \"FOR_MSW\" xpm" >&5
6602     xe_check_libs=-lXpm
6603     cat > conftest.$ac_ext <<EOF
6604 #line 6605 "configure"
6605 #include "confdefs.h"
6606
6607 int main() {
6608 XpmCreatePixmapFromData()
6609 ; return 0; }
6610 EOF
6611 if { (eval echo configure:6612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6612   rm -rf conftest*
6613   xpm_for_msw=no
6614 else
6615   echo "configure: failed program was:" >&5
6616   cat conftest.$ac_ext >&5
6617   rm -rf conftest*
6618   xpm_for_msw=yes
6619 fi
6620 rm -f conftest*
6621     xe_check_libs=
6622     echo "$ac_t""$xpm_for_msw" 1>&6
6623     if test "$xpm_for_msw" = "yes"; then
6624       { test "$extra_verbose" = "yes" && cat << \EOF
6625     Defining FOR_MSW
6626 EOF
6627 cat >> confdefs.h <<\EOF
6628 #define FOR_MSW 1
6629 EOF
6630 }
6631
6632     fi
6633   fi
6634
6635     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6636 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6637 echo "configure:6638: checking for compface.h" >&5
6638
6639 cat > conftest.$ac_ext <<EOF
6640 #line 6641 "configure"
6641 #include "confdefs.h"
6642 #include <compface.h>
6643 EOF
6644 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6645 { (eval echo configure:6646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6646 ac_err=`grep -v '^ *+' conftest.out`
6647 if test -z "$ac_err"; then
6648   rm -rf conftest*
6649   eval "ac_cv_header_$ac_safe=yes"
6650 else
6651   echo "$ac_err" >&5
6652   echo "configure: failed program was:" >&5
6653   cat conftest.$ac_ext >&5
6654   rm -rf conftest*
6655   eval "ac_cv_header_$ac_safe=no"
6656 fi
6657 rm -f conftest*
6658 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6659   echo "$ac_t""yes" 1>&6
6660   :
6661 else
6662   echo "$ac_t""no" 1>&6
6663 with_xface=no
6664 fi
6665  }
6666   test -z "$with_xface" && { 
6667 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6668 echo "configure:6669: checking for UnGenFace in -lcompface" >&5
6669 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6670
6671 xe_check_libs=" -lcompface "
6672 cat > conftest.$ac_ext <<EOF
6673 #line 6674 "configure"
6674 #include "confdefs.h"
6675 /* Override any gcc2 internal prototype to avoid an error.  */
6676 /* We use char because int might match the return type of a gcc2
6677     builtin and then its argument prototype would still apply.  */
6678 char UnGenFace();
6679
6680 int main() {
6681 UnGenFace()
6682 ; return 0; }
6683 EOF
6684 if { (eval echo configure:6685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6685   rm -rf conftest*
6686   eval "ac_cv_lib_$ac_lib_var=yes"
6687 else
6688   echo "configure: failed program was:" >&5
6689   cat conftest.$ac_ext >&5
6690   rm -rf conftest*
6691   eval "ac_cv_lib_$ac_lib_var=no"
6692 fi
6693 rm -f conftest*
6694 xe_check_libs=""
6695
6696 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6697   echo "$ac_t""yes" 1>&6
6698   : 
6699 else
6700   echo "$ac_t""no" 1>&6
6701 with_xface=no
6702 fi
6703
6704  }
6705   test -z "$with_xface" && with_xface=yes
6706   if test "$with_xface" = "yes"; then
6707     { test "$extra_verbose" = "yes" && cat << \EOF
6708     Defining HAVE_XFACE
6709 EOF
6710 cat >> confdefs.h <<\EOF
6711 #define HAVE_XFACE 1
6712 EOF
6713 }
6714
6715     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
6716   fi
6717
6718         if test "$with_gif" != "no"; then
6719     with_gif="yes"
6720     { test "$extra_verbose" = "yes" && cat << \EOF
6721     Defining HAVE_GIF
6722 EOF
6723 cat >> confdefs.h <<\EOF
6724 #define HAVE_GIF 1
6725 EOF
6726 }
6727
6728     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6729    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6730  fi
6731   fi
6732
6733       if test "$with_png $with_tiff" != "no no"; then
6734     
6735 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6736 echo "configure:6737: checking for inflate in -lc" >&5
6737 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6738
6739 xe_check_libs=" -lc "
6740 cat > conftest.$ac_ext <<EOF
6741 #line 6742 "configure"
6742 #include "confdefs.h"
6743 /* Override any gcc2 internal prototype to avoid an error.  */
6744 /* We use char because int might match the return type of a gcc2
6745     builtin and then its argument prototype would still apply.  */
6746 char inflate();
6747
6748 int main() {
6749 inflate()
6750 ; return 0; }
6751 EOF
6752 if { (eval echo configure:6753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6753   rm -rf conftest*
6754   eval "ac_cv_lib_$ac_lib_var=yes"
6755 else
6756   echo "configure: failed program was:" >&5
6757   cat conftest.$ac_ext >&5
6758   rm -rf conftest*
6759   eval "ac_cv_lib_$ac_lib_var=no"
6760 fi
6761 rm -f conftest*
6762 xe_check_libs=""
6763
6764 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6765   echo "$ac_t""yes" 1>&6
6766   :
6767 else
6768   echo "$ac_t""no" 1>&6
6769
6770 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6771 echo "configure:6772: checking for inflate in -lz" >&5
6772 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6773
6774 xe_check_libs=" -lz "
6775 cat > conftest.$ac_ext <<EOF
6776 #line 6777 "configure"
6777 #include "confdefs.h"
6778 /* Override any gcc2 internal prototype to avoid an error.  */
6779 /* We use char because int might match the return type of a gcc2
6780     builtin and then its argument prototype would still apply.  */
6781 char inflate();
6782
6783 int main() {
6784 inflate()
6785 ; return 0; }
6786 EOF
6787 if { (eval echo configure:6788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6788   rm -rf conftest*
6789   eval "ac_cv_lib_$ac_lib_var=yes"
6790 else
6791   echo "configure: failed program was:" >&5
6792   cat conftest.$ac_ext >&5
6793   rm -rf conftest*
6794   eval "ac_cv_lib_$ac_lib_var=no"
6795 fi
6796 rm -f conftest*
6797 xe_check_libs=""
6798
6799 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6800   echo "$ac_t""yes" 1>&6
6801   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6802 else
6803   echo "$ac_t""no" 1>&6
6804
6805 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6806 echo "configure:6807: checking for inflate in -lgz" >&5
6807 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6808
6809 xe_check_libs=" -lgz "
6810 cat > conftest.$ac_ext <<EOF
6811 #line 6812 "configure"
6812 #include "confdefs.h"
6813 /* Override any gcc2 internal prototype to avoid an error.  */
6814 /* We use char because int might match the return type of a gcc2
6815     builtin and then its argument prototype would still apply.  */
6816 char inflate();
6817
6818 int main() {
6819 inflate()
6820 ; return 0; }
6821 EOF
6822 if { (eval echo configure:6823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6823   rm -rf conftest*
6824   eval "ac_cv_lib_$ac_lib_var=yes"
6825 else
6826   echo "configure: failed program was:" >&5
6827   cat conftest.$ac_ext >&5
6828   rm -rf conftest*
6829   eval "ac_cv_lib_$ac_lib_var=no"
6830 fi
6831 rm -f conftest*
6832 xe_check_libs=""
6833
6834 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6835   echo "$ac_t""yes" 1>&6
6836   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6837 else
6838   echo "$ac_t""no" 1>&6
6839 fi
6840
6841
6842 fi
6843
6844
6845 fi
6846
6847
6848   fi
6849
6850     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6851 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6852 echo "configure:6853: checking for jpeglib.h" >&5
6853
6854 cat > conftest.$ac_ext <<EOF
6855 #line 6856 "configure"
6856 #include "confdefs.h"
6857 #include <jpeglib.h>
6858 EOF
6859 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6860 { (eval echo configure:6861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6861 ac_err=`grep -v '^ *+' conftest.out`
6862 if test -z "$ac_err"; then
6863   rm -rf conftest*
6864   eval "ac_cv_header_$ac_safe=yes"
6865 else
6866   echo "$ac_err" >&5
6867   echo "configure: failed program was:" >&5
6868   cat conftest.$ac_ext >&5
6869   rm -rf conftest*
6870   eval "ac_cv_header_$ac_safe=no"
6871 fi
6872 rm -f conftest*
6873 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6874   echo "$ac_t""yes" 1>&6
6875   :
6876 else
6877   echo "$ac_t""no" 1>&6
6878 with_jpeg=no
6879 fi
6880  }
6881   test -z "$with_jpeg" && { 
6882 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
6883 echo "configure:6884: checking for jpeg_destroy_decompress in -ljpeg" >&5
6884 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
6885
6886 xe_check_libs=" -ljpeg "
6887 cat > conftest.$ac_ext <<EOF
6888 #line 6889 "configure"
6889 #include "confdefs.h"
6890 /* Override any gcc2 internal prototype to avoid an error.  */
6891 /* We use char because int might match the return type of a gcc2
6892     builtin and then its argument prototype would still apply.  */
6893 char jpeg_destroy_decompress();
6894
6895 int main() {
6896 jpeg_destroy_decompress()
6897 ; return 0; }
6898 EOF
6899 if { (eval echo configure:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6900   rm -rf conftest*
6901   eval "ac_cv_lib_$ac_lib_var=yes"
6902 else
6903   echo "configure: failed program was:" >&5
6904   cat conftest.$ac_ext >&5
6905   rm -rf conftest*
6906   eval "ac_cv_lib_$ac_lib_var=no"
6907 fi
6908 rm -f conftest*
6909 xe_check_libs=""
6910
6911 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6912   echo "$ac_t""yes" 1>&6
6913   :
6914 else
6915   echo "$ac_t""no" 1>&6
6916 with_jpeg=no
6917 fi
6918
6919  }
6920   test -z "$with_jpeg" && with_jpeg=yes
6921   if test "$with_jpeg" = "yes"; then
6922     { test "$extra_verbose" = "yes" && cat << \EOF
6923     Defining HAVE_JPEG
6924 EOF
6925 cat >> confdefs.h <<\EOF
6926 #define HAVE_JPEG 1
6927 EOF
6928 }
6929
6930     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
6931   fi
6932
6933     png_problem=""
6934   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
6935 echo "configure:6936: checking for pow" >&5
6936
6937 cat > conftest.$ac_ext <<EOF
6938 #line 6939 "configure"
6939 #include "confdefs.h"
6940 /* System header to define __stub macros and hopefully few prototypes,
6941     which can conflict with char pow(); below.  */
6942 #include <assert.h>
6943 /* Override any gcc2 internal prototype to avoid an error.  */
6944 /* We use char because int might match the return type of a gcc2
6945     builtin and then its argument prototype would still apply.  */
6946 char pow();
6947
6948 int main() {
6949
6950 /* The GNU C library defines this for functions which it implements
6951     to always fail with ENOSYS.  Some functions are actually named
6952     something starting with __ and the normal name is an alias.  */
6953 #if defined (__stub_pow) || defined (__stub___pow)
6954 choke me
6955 #else
6956 pow();
6957 #endif
6958
6959 ; return 0; }
6960 EOF
6961 if { (eval echo configure:6962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6962   rm -rf conftest*
6963   eval "ac_cv_func_pow=yes"
6964 else
6965   echo "configure: failed program was:" >&5
6966   cat conftest.$ac_ext >&5
6967   rm -rf conftest*
6968   eval "ac_cv_func_pow=no"
6969 fi
6970 rm -f conftest*
6971
6972 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
6973   echo "$ac_t""yes" 1>&6
6974   :
6975 else
6976   echo "$ac_t""no" 1>&6
6977 with_png=no
6978 fi
6979  }
6980   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
6981 echo $ac_n "checking for png.h""... $ac_c" 1>&6
6982 echo "configure:6983: checking for png.h" >&5
6983
6984 cat > conftest.$ac_ext <<EOF
6985 #line 6986 "configure"
6986 #include "confdefs.h"
6987 #include <png.h>
6988 EOF
6989 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6990 { (eval echo configure:6991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6991 ac_err=`grep -v '^ *+' conftest.out`
6992 if test -z "$ac_err"; then
6993   rm -rf conftest*
6994   eval "ac_cv_header_$ac_safe=yes"
6995 else
6996   echo "$ac_err" >&5
6997   echo "configure: failed program was:" >&5
6998   cat conftest.$ac_ext >&5
6999   rm -rf conftest*
7000   eval "ac_cv_header_$ac_safe=no"
7001 fi
7002 rm -f conftest*
7003 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7004   echo "$ac_t""yes" 1>&6
7005   :
7006 else
7007   echo "$ac_t""no" 1>&6
7008 with_png=no
7009 fi
7010  }
7011   test -z "$with_png" && { 
7012 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7013 echo "configure:7014: checking for png_read_image in -lpng" >&5
7014 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7015
7016 xe_check_libs=" -lpng "
7017 cat > conftest.$ac_ext <<EOF
7018 #line 7019 "configure"
7019 #include "confdefs.h"
7020 /* Override any gcc2 internal prototype to avoid an error.  */
7021 /* We use char because int might match the return type of a gcc2
7022     builtin and then its argument prototype would still apply.  */
7023 char png_read_image();
7024
7025 int main() {
7026 png_read_image()
7027 ; return 0; }
7028 EOF
7029 if { (eval echo configure:7030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7030   rm -rf conftest*
7031   eval "ac_cv_lib_$ac_lib_var=yes"
7032 else
7033   echo "configure: failed program was:" >&5
7034   cat conftest.$ac_ext >&5
7035   rm -rf conftest*
7036   eval "ac_cv_lib_$ac_lib_var=no"
7037 fi
7038 rm -f conftest*
7039 xe_check_libs=""
7040
7041 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7042   echo "$ac_t""yes" 1>&6
7043   :
7044 else
7045   echo "$ac_t""no" 1>&6
7046 with_png=no
7047 fi
7048
7049  }
7050   if test -z "$with_png"; then
7051     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7052 echo "configure:7053: checking for workable png version information" >&5
7053     xe_check_libs="-lpng -lz"
7054     cat > conftest.$ac_ext <<EOF
7055 #line 7056 "configure"
7056 #include "confdefs.h"
7057 #include <png.h>
7058     int main(int c, char **v) {
7059     if (c == 1) return 0;
7060     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7061     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7062 EOF
7063 if { (eval echo configure:7064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7064 then
7065   ./conftest dummy_arg; png_status=$?;
7066       if test "$png_status" = "0"; then
7067         with_png=yes;
7068       else
7069         with_png=no;
7070         if test "$png_status" = "1"; then
7071           png_problem="PNG library version and header file don't match!"
7072         elif test "$png_status" = "2"; then
7073           png_problem="PNG library version too old (pre 1.0.2)!"
7074         fi
7075         echo "
7076 *** WARNING *** $png_problem
7077   I'm not touching that with a 10-foot pole!
7078   If you really want to use the installed version of libPNG, rerun
7079   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7080     fi
7081 else
7082   conftest_rc="$?"
7083   echo "configure: failed program was:" >&5
7084   cat conftest.$ac_ext >&5
7085   rm -fr conftest*
7086   with_png=no
7087 fi
7088 rm -fr conftest*
7089     xe_check_libs=
7090     echo "$ac_t""$with_png" 1>&6
7091   fi
7092   if test "$with_png" = "yes"; then
7093     { test "$extra_verbose" = "yes" && cat << \EOF
7094     Defining HAVE_PNG
7095 EOF
7096 cat >> confdefs.h <<\EOF
7097 #define HAVE_PNG 1
7098 EOF
7099 }
7100
7101     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7102   fi
7103
7104     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7105 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7106 echo "configure:7107: checking for tiffio.h" >&5
7107
7108 cat > conftest.$ac_ext <<EOF
7109 #line 7110 "configure"
7110 #include "confdefs.h"
7111 #include <tiffio.h>
7112 EOF
7113 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7114 { (eval echo configure:7115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7115 ac_err=`grep -v '^ *+' conftest.out`
7116 if test -z "$ac_err"; then
7117   rm -rf conftest*
7118   eval "ac_cv_header_$ac_safe=yes"
7119 else
7120   echo "$ac_err" >&5
7121   echo "configure: failed program was:" >&5
7122   cat conftest.$ac_ext >&5
7123   rm -rf conftest*
7124   eval "ac_cv_header_$ac_safe=no"
7125 fi
7126 rm -f conftest*
7127 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7128   echo "$ac_t""yes" 1>&6
7129   :
7130 else
7131   echo "$ac_t""no" 1>&6
7132 with_tiff=no
7133 fi
7134  }
7135   test -z "$with_tiff" && { 
7136 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7137 echo "configure:7138: checking for TIFFClientOpen in -ltiff" >&5
7138 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7139
7140 xe_check_libs=" -ltiff "
7141 cat > conftest.$ac_ext <<EOF
7142 #line 7143 "configure"
7143 #include "confdefs.h"
7144 /* Override any gcc2 internal prototype to avoid an error.  */
7145 /* We use char because int might match the return type of a gcc2
7146     builtin and then its argument prototype would still apply.  */
7147 char TIFFClientOpen();
7148
7149 int main() {
7150 TIFFClientOpen()
7151 ; return 0; }
7152 EOF
7153 if { (eval echo configure:7154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7154   rm -rf conftest*
7155   eval "ac_cv_lib_$ac_lib_var=yes"
7156 else
7157   echo "configure: failed program was:" >&5
7158   cat conftest.$ac_ext >&5
7159   rm -rf conftest*
7160   eval "ac_cv_lib_$ac_lib_var=no"
7161 fi
7162 rm -f conftest*
7163 xe_check_libs=""
7164
7165 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7166   echo "$ac_t""yes" 1>&6
7167   :
7168 else
7169   echo "$ac_t""no" 1>&6
7170 with_tiff=no
7171 fi
7172
7173  }
7174   test -z "$with_tiff" && with_tiff=yes
7175   if test "$with_tiff" = "yes"; then
7176     { test "$extra_verbose" = "yes" && cat << \EOF
7177     Defining HAVE_TIFF
7178 EOF
7179 cat >> confdefs.h <<\EOF
7180 #define HAVE_TIFF 1
7181 EOF
7182 }
7183
7184     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7185   fi
7186 fi
7187
7188
7189 if test "$with_x11" = "yes"; then
7190
7191   echo "checking for X11 graphics libraries" 1>&6
7192 echo "configure:7193: checking for X11 graphics libraries" >&5
7193
7194     
7195 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7196 echo "configure:7197: checking for XawScrollbarSetThumb in -lXaw" >&5
7197 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7198
7199 xe_check_libs=" -lXaw "
7200 cat > conftest.$ac_ext <<EOF
7201 #line 7202 "configure"
7202 #include "confdefs.h"
7203 /* Override any gcc2 internal prototype to avoid an error.  */
7204 /* We use char because int might match the return type of a gcc2
7205     builtin and then its argument prototype would still apply.  */
7206 char XawScrollbarSetThumb();
7207
7208 int main() {
7209 XawScrollbarSetThumb()
7210 ; return 0; }
7211 EOF
7212 if { (eval echo configure:7213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7213   rm -rf conftest*
7214   eval "ac_cv_lib_$ac_lib_var=yes"
7215 else
7216   echo "configure: failed program was:" >&5
7217   cat conftest.$ac_ext >&5
7218   rm -rf conftest*
7219   eval "ac_cv_lib_$ac_lib_var=no"
7220 fi
7221 rm -f conftest*
7222 xe_check_libs=""
7223
7224 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7225   echo "$ac_t""yes" 1>&6
7226   have_xaw=yes
7227 else
7228   echo "$ac_t""no" 1>&6
7229 have_xaw=no
7230 fi
7231
7232
7233                     
7234     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7235 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7236 echo "configure:7237: checking for Xm/Xm.h" >&5
7237
7238 cat > conftest.$ac_ext <<EOF
7239 #line 7240 "configure"
7240 #include "confdefs.h"
7241 #include <Xm/Xm.h>
7242 EOF
7243 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7244 { (eval echo configure:7245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7245 ac_err=`grep -v '^ *+' conftest.out`
7246 if test -z "$ac_err"; then
7247   rm -rf conftest*
7248   eval "ac_cv_header_$ac_safe=yes"
7249 else
7250   echo "$ac_err" >&5
7251   echo "configure: failed program was:" >&5
7252   cat conftest.$ac_ext >&5
7253   rm -rf conftest*
7254   eval "ac_cv_header_$ac_safe=no"
7255 fi
7256 rm -f conftest*
7257 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7258   echo "$ac_t""yes" 1>&6
7259   
7260 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7261 echo "configure:7262: checking for XmStringFree in -lXm" >&5
7262 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7263
7264 xe_check_libs=" -lXm "
7265 cat > conftest.$ac_ext <<EOF
7266 #line 7267 "configure"
7267 #include "confdefs.h"
7268 /* Override any gcc2 internal prototype to avoid an error.  */
7269 /* We use char because int might match the return type of a gcc2
7270     builtin and then its argument prototype would still apply.  */
7271 char XmStringFree();
7272
7273 int main() {
7274 XmStringFree()
7275 ; return 0; }
7276 EOF
7277 if { (eval echo configure:7278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7278   rm -rf conftest*
7279   eval "ac_cv_lib_$ac_lib_var=yes"
7280 else
7281   echo "configure: failed program was:" >&5
7282   cat conftest.$ac_ext >&5
7283   rm -rf conftest*
7284   eval "ac_cv_lib_$ac_lib_var=no"
7285 fi
7286 rm -f conftest*
7287 xe_check_libs=""
7288
7289 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7290   echo "$ac_t""yes" 1>&6
7291   have_motif=yes
7292 else
7293   echo "$ac_t""no" 1>&6
7294 have_motif=no
7295 fi
7296
7297
7298 else
7299   echo "$ac_t""no" 1>&6
7300 have_motif=no
7301 fi
7302
7303
7304   if test "$have_motif" = "yes"; then
7305         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7306 echo "configure:7307: checking for Lesstif" >&5
7307     cat > conftest.$ac_ext <<EOF
7308 #line 7309 "configure"
7309 #include "confdefs.h"
7310 #include <Xm/Xm.h>
7311 #ifdef LESSTIF_VERSION
7312 yes
7313 #endif
7314
7315 EOF
7316 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7317   egrep "yes" >/dev/null 2>&1; then
7318   rm -rf conftest*
7319   have_lesstif=yes
7320 else
7321   rm -rf conftest*
7322   have_lesstif=no
7323 fi
7324 rm -f conftest*
7325
7326   echo "$ac_t""$have_lesstif" 1>&6
7327   fi
7328
7329 fi 
7330
7331 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7332   with_menubars="lucid" ;;
7333 esac
7334 case "$with_dialogs" in "" | "yes" | "lucid" )
7335   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7336   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7337   else with_dialogs=no
7338   fi ;;
7339 esac
7340 case "$with_scrollbars" in "" | "yes" )
7341   with_scrollbars="lucid" ;;
7342 esac
7343
7344 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7345
7346 case "$all_widgets" in *athena* )
7347   { test "$extra_verbose" = "yes" && cat << \EOF
7348     Defining LWLIB_USES_ATHENA
7349 EOF
7350 cat >> confdefs.h <<\EOF
7351 #define LWLIB_USES_ATHENA 1
7352 EOF
7353 }
7354
7355   { test "$extra_verbose" = "yes" && cat << \EOF
7356     Defining NEED_ATHENA
7357 EOF
7358 cat >> confdefs.h <<\EOF
7359 #define NEED_ATHENA 1
7360 EOF
7361 }
7362
7363   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7364   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7365 esac
7366
7367 case "$all_widgets" in *motif* )
7368   { test "$extra_verbose" = "yes" && cat << \EOF
7369     Defining LWLIB_USES_MOTIF
7370 EOF
7371 cat >> confdefs.h <<\EOF
7372 #define LWLIB_USES_MOTIF 1
7373 EOF
7374 }
7375
7376   { test "$extra_verbose" = "yes" && cat << \EOF
7377     Defining NEED_MOTIF
7378 EOF
7379 cat >> confdefs.h <<\EOF
7380 #define NEED_MOTIF 1
7381 EOF
7382 }
7383
7384   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7385   need_motif=yes ;;
7386 esac
7387
7388 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7389 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7390 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7391 case "$all_widgets" in *lucid* )
7392   { test "$extra_verbose" = "yes" && cat << \EOF
7393     Defining NEED_LUCID
7394 EOF
7395 cat >> confdefs.h <<\EOF
7396 #define NEED_LUCID 1
7397 EOF
7398 }
7399
7400   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7401 esac
7402
7403
7404
7405 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7406     Defining LWLIB_SCROLLBARS_ATHENA
7407 EOF
7408 cat >> confdefs.h <<\EOF
7409 #define LWLIB_SCROLLBARS_ATHENA 1
7410 EOF
7411 }
7412 ;; esac
7413 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7414     Defining LWLIB_DIALOGS_ATHENA
7415 EOF
7416 cat >> confdefs.h <<\EOF
7417 #define LWLIB_DIALOGS_ATHENA 1
7418 EOF
7419 }
7420    ;; esac
7421 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7422     Defining LWLIB_SCROLLBARS_ATHENA3D
7423 EOF
7424 cat >> confdefs.h <<\EOF
7425 #define LWLIB_SCROLLBARS_ATHENA3D 1
7426 EOF
7427 }
7428
7429 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7430     Defining LWLIB_DIALOGS_ATHENA3D
7431 EOF
7432 cat >> confdefs.h <<\EOF
7433 #define LWLIB_DIALOGS_ATHENA3D 1
7434 EOF
7435 }
7436
7437
7438 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7439     Defining HAVE_MENUBARS
7440 EOF
7441 cat >> confdefs.h <<\EOF
7442 #define HAVE_MENUBARS 1
7443 EOF
7444 }
7445
7446 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7447     Defining HAVE_SCROLLBARS
7448 EOF
7449 cat >> confdefs.h <<\EOF
7450 #define HAVE_SCROLLBARS 1
7451 EOF
7452 }
7453
7454 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7455     Defining HAVE_DIALOGS
7456 EOF
7457 cat >> confdefs.h <<\EOF
7458 #define HAVE_DIALOGS 1
7459 EOF
7460 }
7461
7462 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7463     Defining HAVE_TOOLBARS
7464 EOF
7465 cat >> confdefs.h <<\EOF
7466 #define HAVE_TOOLBARS 1
7467 EOF
7468 }
7469
7470
7471 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7472     Defining LWLIB_MENUBARS_LUCID
7473 EOF
7474 cat >> confdefs.h <<\EOF
7475 #define LWLIB_MENUBARS_LUCID 1
7476 EOF
7477 }
7478
7479 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7480     Defining LWLIB_SCROLLBARS_LUCID
7481 EOF
7482 cat >> confdefs.h <<\EOF
7483 #define LWLIB_SCROLLBARS_LUCID 1
7484 EOF
7485 }
7486
7487
7488 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7489     Defining LWLIB_MENUBARS_MOTIF
7490 EOF
7491 cat >> confdefs.h <<\EOF
7492 #define LWLIB_MENUBARS_MOTIF 1
7493 EOF
7494 }
7495
7496 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7497     Defining LWLIB_SCROLLBARS_MOTIF
7498 EOF
7499 cat >> confdefs.h <<\EOF
7500 #define LWLIB_SCROLLBARS_MOTIF 1
7501 EOF
7502 }
7503
7504 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7505     Defining LWLIB_DIALOGS_MOTIF
7506 EOF
7507 cat >> confdefs.h <<\EOF
7508 #define LWLIB_DIALOGS_MOTIF 1
7509 EOF
7510 }
7511
7512
7513 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7514    echo "    xemacs will be linked with \"menubar.o\""
7515  fi
7516 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7517    echo "    xemacs will be linked with \"scrollbar.o\""
7518  fi
7519 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7520    echo "    xemacs will be linked with \"dialog.o\""
7521  fi
7522 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7523    echo "    xemacs will be linked with \"toolbar.o\""
7524  fi
7525
7526 if test "$with_x11" = "yes"; then
7527   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7528    echo "    xemacs will be linked with \"menubar-x.o\""
7529  fi
7530   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7531    echo "    xemacs will be linked with \"scrollbar-x.o\""
7532  fi
7533   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7534    echo "    xemacs will be linked with \"dialog-x.o\""
7535  fi
7536   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7537    echo "    xemacs will be linked with \"toolbar-x.o\""
7538  fi
7539   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7540    echo "    xemacs will be linked with \"gui-x.o\""
7541  fi
7542 else
7543   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7544     echo "Attempt to Build NAS sound without X"
7545     echo "Please remove NAS configuration or build with X"
7546     exit 1
7547   fi
7548 fi
7549
7550
7551 test -z "$with_mule" && with_mule=no
7552 test -z "$with_file_coding" && with_file_coding=no
7553
7554
7555 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7556   { test "$extra_verbose" = "yes" && cat << \EOF
7557     Defining FILE_CODING
7558 EOF
7559 cat >> confdefs.h <<\EOF
7560 #define FILE_CODING 1
7561 EOF
7562 }
7563
7564   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7565    echo "    xemacs will be linked with \"file-coding.o\""
7566  fi
7567 fi
7568
7569 if test "$with_mule" = "yes" ; then
7570   echo "checking for Mule-related features" 1>&6
7571 echo "configure:7572: checking for Mule-related features" >&5
7572   { test "$extra_verbose" = "yes" && cat << \EOF
7573     Defining MULE
7574 EOF
7575 cat >> confdefs.h <<\EOF
7576 #define MULE 1
7577 EOF
7578 }
7579
7580   { test "$extra_verbose" = "yes" && cat << \EOF
7581     Defining FILE_CODING
7582 EOF
7583 cat >> confdefs.h <<\EOF
7584 #define FILE_CODING 1
7585 EOF
7586 }
7587
7588   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7589    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7590  fi
7591
7592     for ac_hdr in libintl.h
7593 do
7594 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7595 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7596 echo "configure:7597: checking for $ac_hdr" >&5
7597
7598 cat > conftest.$ac_ext <<EOF
7599 #line 7600 "configure"
7600 #include "confdefs.h"
7601 #include <$ac_hdr>
7602 EOF
7603 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7604 { (eval echo configure:7605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7605 ac_err=`grep -v '^ *+' conftest.out`
7606 if test -z "$ac_err"; then
7607   rm -rf conftest*
7608   eval "ac_cv_header_$ac_safe=yes"
7609 else
7610   echo "$ac_err" >&5
7611   echo "configure: failed program was:" >&5
7612   cat conftest.$ac_ext >&5
7613   rm -rf conftest*
7614   eval "ac_cv_header_$ac_safe=no"
7615 fi
7616 rm -f conftest*
7617 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7618   echo "$ac_t""yes" 1>&6
7619     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7620   { test "$extra_verbose" = "yes" && cat << EOF
7621     Defining $ac_tr_hdr
7622 EOF
7623 cat >> confdefs.h <<EOF
7624 #define $ac_tr_hdr 1
7625 EOF
7626 }
7627  
7628 else
7629   echo "$ac_t""no" 1>&6
7630 fi
7631 done
7632
7633   
7634 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7635 echo "configure:7636: checking for strerror in -lintl" >&5
7636 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7637
7638 xe_check_libs=" -lintl "
7639 cat > conftest.$ac_ext <<EOF
7640 #line 7641 "configure"
7641 #include "confdefs.h"
7642 /* Override any gcc2 internal prototype to avoid an error.  */
7643 /* We use char because int might match the return type of a gcc2
7644     builtin and then its argument prototype would still apply.  */
7645 char strerror();
7646
7647 int main() {
7648 strerror()
7649 ; return 0; }
7650 EOF
7651 if { (eval echo configure:7652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7652   rm -rf conftest*
7653   eval "ac_cv_lib_$ac_lib_var=yes"
7654 else
7655   echo "configure: failed program was:" >&5
7656   cat conftest.$ac_ext >&5
7657   rm -rf conftest*
7658   eval "ac_cv_lib_$ac_lib_var=no"
7659 fi
7660 rm -f conftest*
7661 xe_check_libs=""
7662
7663 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7664   echo "$ac_t""yes" 1>&6
7665     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7666     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7667   { test "$extra_verbose" = "yes" && cat << EOF
7668     Defining $ac_tr_lib
7669 EOF
7670 cat >> confdefs.h <<EOF
7671 #define $ac_tr_lib 1
7672 EOF
7673 }
7674
7675   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7676
7677 else
7678   echo "$ac_t""no" 1>&6
7679 fi
7680
7681
7682
7683   echo "checking for Mule input methods" 1>&6
7684 echo "configure:7685: checking for Mule input methods" >&5
7685         case "$with_xim" in "" | "yes" )
7686     echo "checking for XIM" 1>&6
7687 echo "configure:7688: checking for XIM" >&5
7688     
7689 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
7690 echo "configure:7691: checking for XOpenIM in -lX11" >&5
7691 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
7692
7693 xe_check_libs=" -lX11 "
7694 cat > conftest.$ac_ext <<EOF
7695 #line 7696 "configure"
7696 #include "confdefs.h"
7697 /* Override any gcc2 internal prototype to avoid an error.  */
7698 /* We use char because int might match the return type of a gcc2
7699     builtin and then its argument prototype would still apply.  */
7700 char XOpenIM();
7701
7702 int main() {
7703 XOpenIM()
7704 ; return 0; }
7705 EOF
7706 if { (eval echo configure:7707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7707   rm -rf conftest*
7708   eval "ac_cv_lib_$ac_lib_var=yes"
7709 else
7710   echo "configure: failed program was:" >&5
7711   cat conftest.$ac_ext >&5
7712   rm -rf conftest*
7713   eval "ac_cv_lib_$ac_lib_var=no"
7714 fi
7715 rm -f conftest*
7716 xe_check_libs=""
7717
7718 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7719   echo "$ac_t""yes" 1>&6
7720   with_xim=xlib
7721 else
7722   echo "$ac_t""no" 1>&6
7723 with_xim=no
7724 fi
7725
7726
7727         if test "$have_motif $have_lesstif" = "yes no"; then
7728       
7729 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7730 echo "configure:7731: checking for XmImMbLookupString in -lXm" >&5
7731 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7732
7733 xe_check_libs=" -lXm "
7734 cat > conftest.$ac_ext <<EOF
7735 #line 7736 "configure"
7736 #include "confdefs.h"
7737 /* Override any gcc2 internal prototype to avoid an error.  */
7738 /* We use char because int might match the return type of a gcc2
7739     builtin and then its argument prototype would still apply.  */
7740 char XmImMbLookupString();
7741
7742 int main() {
7743 XmImMbLookupString()
7744 ; return 0; }
7745 EOF
7746 if { (eval echo configure:7747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7747   rm -rf conftest*
7748   eval "ac_cv_lib_$ac_lib_var=yes"
7749 else
7750   echo "configure: failed program was:" >&5
7751   cat conftest.$ac_ext >&5
7752   rm -rf conftest*
7753   eval "ac_cv_lib_$ac_lib_var=no"
7754 fi
7755 rm -f conftest*
7756 xe_check_libs=""
7757
7758 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7759   echo "$ac_t""yes" 1>&6
7760   with_xim=motif
7761 else
7762   echo "$ac_t""no" 1>&6
7763 fi
7764
7765
7766     fi ;;
7767   esac
7768   if test "$with_xim" != "no"; then
7769     { test "$extra_verbose" = "yes" && cat << \EOF
7770     Defining HAVE_XIM
7771 EOF
7772 cat >> confdefs.h <<\EOF
7773 #define HAVE_XIM 1
7774 EOF
7775 }
7776
7777     if test "$with_xim" = "xlib"; then
7778       { test "$extra_verbose" = "yes" && cat << \EOF
7779     Defining XIM_XLIB
7780 EOF
7781 cat >> confdefs.h <<\EOF
7782 #define XIM_XLIB 1
7783 EOF
7784 }
7785
7786       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7787    echo "    xemacs will be linked with \"input-method-xlib.o\""
7788  fi
7789     fi
7790     if test "$with_xim" = "motif"; then
7791       { test "$extra_verbose" = "yes" && cat << \EOF
7792     Defining XIM_MOTIF
7793 EOF
7794 cat >> confdefs.h <<\EOF
7795 #define XIM_MOTIF 1
7796 EOF
7797 }
7798
7799       need_motif=yes
7800       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7801    echo "    xemacs will be linked with \"input-method-motif.o\""
7802  fi
7803     fi
7804     if test "$with_xim" = "motif"; then
7805       with_xfs=no
7806     fi
7807   fi
7808
7809     if test "$with_xfs" = "yes" ; then
7810     echo "checking for XFontSet" 1>&6
7811 echo "configure:7812: checking for XFontSet" >&5
7812     
7813 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7814 echo "configure:7815: checking for XmbDrawString in -lX11" >&5
7815 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7816
7817 xe_check_libs=" -lX11 "
7818 cat > conftest.$ac_ext <<EOF
7819 #line 7820 "configure"
7820 #include "confdefs.h"
7821 /* Override any gcc2 internal prototype to avoid an error.  */
7822 /* We use char because int might match the return type of a gcc2
7823     builtin and then its argument prototype would still apply.  */
7824 char XmbDrawString();
7825
7826 int main() {
7827 XmbDrawString()
7828 ; return 0; }
7829 EOF
7830 if { (eval echo configure:7831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7831   rm -rf conftest*
7832   eval "ac_cv_lib_$ac_lib_var=yes"
7833 else
7834   echo "configure: failed program was:" >&5
7835   cat conftest.$ac_ext >&5
7836   rm -rf conftest*
7837   eval "ac_cv_lib_$ac_lib_var=no"
7838 fi
7839 rm -f conftest*
7840 xe_check_libs=""
7841
7842 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7843   echo "$ac_t""yes" 1>&6
7844   :
7845 else
7846   echo "$ac_t""no" 1>&6
7847 with_xfs=no
7848 fi
7849
7850
7851     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7852       { test "$extra_verbose" = "yes" && cat << \EOF
7853     Defining USE_XFONTSET
7854 EOF
7855 cat >> confdefs.h <<\EOF
7856 #define USE_XFONTSET 1
7857 EOF
7858 }
7859
7860       if test "$with_xim" = "no" ; then
7861         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
7862    echo "    xemacs will be linked with \"input-method-xfs.o\""
7863  fi
7864       fi
7865     fi
7866   fi 
7867     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
7868   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
7869 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
7870 echo "configure:7871: checking for wnn/jllib.h" >&5
7871
7872 cat > conftest.$ac_ext <<EOF
7873 #line 7874 "configure"
7874 #include "confdefs.h"
7875 #include <wnn/jllib.h>
7876 EOF
7877 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7878 { (eval echo configure:7879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7879 ac_err=`grep -v '^ *+' conftest.out`
7880 if test -z "$ac_err"; then
7881   rm -rf conftest*
7882   eval "ac_cv_header_$ac_safe=yes"
7883 else
7884   echo "$ac_err" >&5
7885   echo "configure: failed program was:" >&5
7886   cat conftest.$ac_ext >&5
7887   rm -rf conftest*
7888   eval "ac_cv_header_$ac_safe=no"
7889 fi
7890 rm -f conftest*
7891 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7892   echo "$ac_t""yes" 1>&6
7893   :
7894 else
7895   echo "$ac_t""no" 1>&6
7896 with_wnn=no
7897 fi
7898  }
7899     if test "$with_wnn" != "no"; then
7900     for ac_func in crypt
7901 do
7902 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7903 echo "configure:7904: checking for $ac_func" >&5
7904
7905 cat > conftest.$ac_ext <<EOF
7906 #line 7907 "configure"
7907 #include "confdefs.h"
7908 /* System header to define __stub macros and hopefully few prototypes,
7909     which can conflict with char $ac_func(); below.  */
7910 #include <assert.h>
7911 /* Override any gcc2 internal prototype to avoid an error.  */
7912 /* We use char because int might match the return type of a gcc2
7913     builtin and then its argument prototype would still apply.  */
7914 char $ac_func();
7915
7916 int main() {
7917
7918 /* The GNU C library defines this for functions which it implements
7919     to always fail with ENOSYS.  Some functions are actually named
7920     something starting with __ and the normal name is an alias.  */
7921 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7922 choke me
7923 #else
7924 $ac_func();
7925 #endif
7926
7927 ; return 0; }
7928 EOF
7929 if { (eval echo configure:7930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7930   rm -rf conftest*
7931   eval "ac_cv_func_$ac_func=yes"
7932 else
7933   echo "configure: failed program was:" >&5
7934   cat conftest.$ac_ext >&5
7935   rm -rf conftest*
7936   eval "ac_cv_func_$ac_func=no"
7937 fi
7938 rm -f conftest*
7939
7940 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7941   echo "$ac_t""yes" 1>&6
7942     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7943   { test "$extra_verbose" = "yes" && cat << EOF
7944     Defining $ac_tr_func
7945 EOF
7946 cat >> confdefs.h <<EOF
7947 #define $ac_tr_func 1
7948 EOF
7949 }
7950  
7951 else
7952   echo "$ac_t""no" 1>&6
7953 fi
7954 done
7955
7956     test "$ac_cv_func_crypt" != "yes" && { 
7957 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7958 echo "configure:7959: checking for crypt in -lcrypt" >&5
7959 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7960
7961 xe_check_libs=" -lcrypt "
7962 cat > conftest.$ac_ext <<EOF
7963 #line 7964 "configure"
7964 #include "confdefs.h"
7965 /* Override any gcc2 internal prototype to avoid an error.  */
7966 /* We use char because int might match the return type of a gcc2
7967     builtin and then its argument prototype would still apply.  */
7968 char crypt();
7969
7970 int main() {
7971 crypt()
7972 ; return 0; }
7973 EOF
7974 if { (eval echo configure:7975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7975   rm -rf conftest*
7976   eval "ac_cv_lib_$ac_lib_var=yes"
7977 else
7978   echo "configure: failed program was:" >&5
7979   cat conftest.$ac_ext >&5
7980   rm -rf conftest*
7981   eval "ac_cv_lib_$ac_lib_var=no"
7982 fi
7983 rm -f conftest*
7984 xe_check_libs=""
7985
7986 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7987   echo "$ac_t""yes" 1>&6
7988     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7989     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7990   { test "$extra_verbose" = "yes" && cat << EOF
7991     Defining $ac_tr_lib
7992 EOF
7993 cat >> confdefs.h <<EOF
7994 #define $ac_tr_lib 1
7995 EOF
7996 }
7997
7998   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
7999
8000 else
8001   echo "$ac_t""no" 1>&6
8002 fi
8003
8004  }
8005   fi
8006     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8007     
8008 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8009 echo "configure:8010: checking for jl_dic_list_e in -lwnn" >&5
8010 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8011
8012 xe_check_libs=" -lwnn "
8013 cat > conftest.$ac_ext <<EOF
8014 #line 8015 "configure"
8015 #include "confdefs.h"
8016 /* Override any gcc2 internal prototype to avoid an error.  */
8017 /* We use char because int might match the return type of a gcc2
8018     builtin and then its argument prototype would still apply.  */
8019 char jl_dic_list_e();
8020
8021 int main() {
8022 jl_dic_list_e()
8023 ; return 0; }
8024 EOF
8025 if { (eval echo configure:8026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8026   rm -rf conftest*
8027   eval "ac_cv_lib_$ac_lib_var=yes"
8028 else
8029   echo "configure: failed program was:" >&5
8030   cat conftest.$ac_ext >&5
8031   rm -rf conftest*
8032   eval "ac_cv_lib_$ac_lib_var=no"
8033 fi
8034 rm -f conftest*
8035 xe_check_libs=""
8036
8037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8038   echo "$ac_t""yes" 1>&6
8039   libwnn=wnn
8040 else
8041   echo "$ac_t""no" 1>&6
8042 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8043 echo "configure:8044: checking for jl_dic_list_e in -lwnn4" >&5
8044 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8045
8046 xe_check_libs=" -lwnn4 "
8047 cat > conftest.$ac_ext <<EOF
8048 #line 8049 "configure"
8049 #include "confdefs.h"
8050 /* Override any gcc2 internal prototype to avoid an error.  */
8051 /* We use char because int might match the return type of a gcc2
8052     builtin and then its argument prototype would still apply.  */
8053 char jl_dic_list_e();
8054
8055 int main() {
8056 jl_dic_list_e()
8057 ; return 0; }
8058 EOF
8059 if { (eval echo configure:8060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8060   rm -rf conftest*
8061   eval "ac_cv_lib_$ac_lib_var=yes"
8062 else
8063   echo "configure: failed program was:" >&5
8064   cat conftest.$ac_ext >&5
8065   rm -rf conftest*
8066   eval "ac_cv_lib_$ac_lib_var=no"
8067 fi
8068 rm -f conftest*
8069 xe_check_libs=""
8070
8071 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8072   echo "$ac_t""yes" 1>&6
8073   libwnn=wnn4
8074 else
8075   echo "$ac_t""no" 1>&6
8076 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8077 echo "configure:8078: checking for jl_dic_list_e in -lwnn6" >&5
8078 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8079
8080 xe_check_libs=" -lwnn6 "
8081 cat > conftest.$ac_ext <<EOF
8082 #line 8083 "configure"
8083 #include "confdefs.h"
8084 /* Override any gcc2 internal prototype to avoid an error.  */
8085 /* We use char because int might match the return type of a gcc2
8086     builtin and then its argument prototype would still apply.  */
8087 char jl_dic_list_e();
8088
8089 int main() {
8090 jl_dic_list_e()
8091 ; return 0; }
8092 EOF
8093 if { (eval echo configure:8094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8094   rm -rf conftest*
8095   eval "ac_cv_lib_$ac_lib_var=yes"
8096 else
8097   echo "configure: failed program was:" >&5
8098   cat conftest.$ac_ext >&5
8099   rm -rf conftest*
8100   eval "ac_cv_lib_$ac_lib_var=no"
8101 fi
8102 rm -f conftest*
8103 xe_check_libs=""
8104
8105 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8106   echo "$ac_t""yes" 1>&6
8107   libwnn=wnn6
8108 else
8109   echo "$ac_t""no" 1>&6
8110 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8111 echo "configure:8112: checking for dic_list_e in -lwnn6_fromsrc" >&5
8112 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8113
8114 xe_check_libs=" -lwnn6_fromsrc "
8115 cat > conftest.$ac_ext <<EOF
8116 #line 8117 "configure"
8117 #include "confdefs.h"
8118 /* Override any gcc2 internal prototype to avoid an error.  */
8119 /* We use char because int might match the return type of a gcc2
8120     builtin and then its argument prototype would still apply.  */
8121 char dic_list_e();
8122
8123 int main() {
8124 dic_list_e()
8125 ; return 0; }
8126 EOF
8127 if { (eval echo configure:8128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8128   rm -rf conftest*
8129   eval "ac_cv_lib_$ac_lib_var=yes"
8130 else
8131   echo "configure: failed program was:" >&5
8132   cat conftest.$ac_ext >&5
8133   rm -rf conftest*
8134   eval "ac_cv_lib_$ac_lib_var=no"
8135 fi
8136 rm -f conftest*
8137 xe_check_libs=""
8138
8139 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8140   echo "$ac_t""yes" 1>&6
8141   libwnn=wnn6_fromsrc
8142 else
8143   echo "$ac_t""no" 1>&6
8144 with_wnn=no
8145 fi
8146
8147
8148 fi
8149
8150
8151 fi
8152
8153
8154 fi
8155
8156
8157   fi
8158   test -z "$with_wnn" && with_wnn=yes
8159   if test "$with_wnn" = "yes"; then
8160     { test "$extra_verbose" = "yes" && cat << \EOF
8161     Defining HAVE_WNN
8162 EOF
8163 cat >> confdefs.h <<\EOF
8164 #define HAVE_WNN 1
8165 EOF
8166 }
8167
8168     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8169     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8170    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8171  fi
8172     if test "$with_wnn6" != "no"; then
8173       
8174 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8175 echo "configure:8176: checking for jl_fi_dic_list in -l$libwnn" >&5
8176 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8177
8178 xe_check_libs=" -l$libwnn "
8179 cat > conftest.$ac_ext <<EOF
8180 #line 8181 "configure"
8181 #include "confdefs.h"
8182 /* Override any gcc2 internal prototype to avoid an error.  */
8183 /* We use char because int might match the return type of a gcc2
8184     builtin and then its argument prototype would still apply.  */
8185 char jl_fi_dic_list();
8186
8187 int main() {
8188 jl_fi_dic_list()
8189 ; return 0; }
8190 EOF
8191 if { (eval echo configure:8192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8192   rm -rf conftest*
8193   eval "ac_cv_lib_$ac_lib_var=yes"
8194 else
8195   echo "configure: failed program was:" >&5
8196   cat conftest.$ac_ext >&5
8197   rm -rf conftest*
8198   eval "ac_cv_lib_$ac_lib_var=no"
8199 fi
8200 rm -f conftest*
8201 xe_check_libs=""
8202
8203 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8204   echo "$ac_t""yes" 1>&6
8205   with_wnn6=yes
8206 else
8207   echo "$ac_t""no" 1>&6
8208 fi
8209
8210
8211       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8212     Defining WNN6
8213 EOF
8214 cat >> confdefs.h <<\EOF
8215 #define WNN6 1
8216 EOF
8217 }
8218
8219     fi
8220   fi
8221
8222     canna_includes_found=no
8223   if test "$with_canna" != "no"; then
8224     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8225 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8226 echo "configure:8227: checking for canna/jrkanji.h" >&5
8227
8228 cat > conftest.$ac_ext <<EOF
8229 #line 8230 "configure"
8230 #include "confdefs.h"
8231 #include <canna/jrkanji.h>
8232 EOF
8233 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8234 { (eval echo configure:8235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8235 ac_err=`grep -v '^ *+' conftest.out`
8236 if test -z "$ac_err"; then
8237   rm -rf conftest*
8238   eval "ac_cv_header_$ac_safe=yes"
8239 else
8240   echo "$ac_err" >&5
8241   echo "configure: failed program was:" >&5
8242   cat conftest.$ac_ext >&5
8243   rm -rf conftest*
8244   eval "ac_cv_header_$ac_safe=no"
8245 fi
8246 rm -f conftest*
8247 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8248   echo "$ac_t""yes" 1>&6
8249   canna_includes_found=yes
8250 else
8251   echo "$ac_t""no" 1>&6
8252 fi
8253
8254   fi
8255   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8256       -d "/usr/local/canna/include"; then
8257     save_c_switch_site="$c_switch_site"
8258     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8259     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8260 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8261 echo "configure:8262: checking for canna/jrkanji.h" >&5
8262
8263 cat > conftest.$ac_ext <<EOF
8264 #line 8265 "configure"
8265 #include "confdefs.h"
8266 #include <canna/jrkanji.h>
8267 EOF
8268 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8269 { (eval echo configure:8270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8270 ac_err=`grep -v '^ *+' conftest.out`
8271 if test -z "$ac_err"; then
8272   rm -rf conftest*
8273   eval "ac_cv_header_$ac_safe=yes"
8274 else
8275   echo "$ac_err" >&5
8276   echo "configure: failed program was:" >&5
8277   cat conftest.$ac_ext >&5
8278   rm -rf conftest*
8279   eval "ac_cv_header_$ac_safe=no"
8280 fi
8281 rm -f conftest*
8282 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8283   echo "$ac_t""yes" 1>&6
8284   canna_includes_found=yes
8285 else
8286   echo "$ac_t""no" 1>&6
8287 fi
8288
8289     if test "$canna_includes_found" != "yes"; then
8290       c_switch_site="$save_c_switch_site"
8291       with_canna="no"
8292     fi
8293   fi
8294
8295   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8296 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8297 echo "configure:8298: checking for canna/RK.h" >&5
8298
8299 cat > conftest.$ac_ext <<EOF
8300 #line 8301 "configure"
8301 #include "confdefs.h"
8302 #include <canna/RK.h>
8303 EOF
8304 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8305 { (eval echo configure:8306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8306 ac_err=`grep -v '^ *+' conftest.out`
8307 if test -z "$ac_err"; then
8308   rm -rf conftest*
8309   eval "ac_cv_header_$ac_safe=yes"
8310 else
8311   echo "$ac_err" >&5
8312   echo "configure: failed program was:" >&5
8313   cat conftest.$ac_ext >&5
8314   rm -rf conftest*
8315   eval "ac_cv_header_$ac_safe=no"
8316 fi
8317 rm -f conftest*
8318 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8319   echo "$ac_t""yes" 1>&6
8320   :
8321 else
8322   echo "$ac_t""no" 1>&6
8323 with_canna=no
8324 fi
8325  }
8326   test -z "$with_canna" && { 
8327 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8328 echo "configure:8329: checking for RkBgnBun in -lRKC" >&5
8329 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8330
8331 xe_check_libs=" -lRKC "
8332 cat > conftest.$ac_ext <<EOF
8333 #line 8334 "configure"
8334 #include "confdefs.h"
8335 /* Override any gcc2 internal prototype to avoid an error.  */
8336 /* We use char because int might match the return type of a gcc2
8337     builtin and then its argument prototype would still apply.  */
8338 char RkBgnBun();
8339
8340 int main() {
8341 RkBgnBun()
8342 ; return 0; }
8343 EOF
8344 if { (eval echo configure:8345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8345   rm -rf conftest*
8346   eval "ac_cv_lib_$ac_lib_var=yes"
8347 else
8348   echo "configure: failed program was:" >&5
8349   cat conftest.$ac_ext >&5
8350   rm -rf conftest*
8351   eval "ac_cv_lib_$ac_lib_var=no"
8352 fi
8353 rm -f conftest*
8354 xe_check_libs=""
8355
8356 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8357   echo "$ac_t""yes" 1>&6
8358   :
8359 else
8360   echo "$ac_t""no" 1>&6
8361 with_canna=no
8362 fi
8363
8364  }
8365   test -z "$with_canna" && { 
8366 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8367 echo "configure:8368: checking for jrKanjiControl in -lcanna" >&5
8368 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8369
8370 xe_check_libs=" -lcanna "
8371 cat > conftest.$ac_ext <<EOF
8372 #line 8373 "configure"
8373 #include "confdefs.h"
8374 /* Override any gcc2 internal prototype to avoid an error.  */
8375 /* We use char because int might match the return type of a gcc2
8376     builtin and then its argument prototype would still apply.  */
8377 char jrKanjiControl();
8378
8379 int main() {
8380 jrKanjiControl()
8381 ; return 0; }
8382 EOF
8383 if { (eval echo configure:8384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8384   rm -rf conftest*
8385   eval "ac_cv_lib_$ac_lib_var=yes"
8386 else
8387   echo "configure: failed program was:" >&5
8388   cat conftest.$ac_ext >&5
8389   rm -rf conftest*
8390   eval "ac_cv_lib_$ac_lib_var=no"
8391 fi
8392 rm -f conftest*
8393 xe_check_libs=""
8394
8395 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8396   echo "$ac_t""yes" 1>&6
8397   :
8398 else
8399   echo "$ac_t""no" 1>&6
8400 with_canna=no
8401 fi
8402
8403  }
8404   test -z "$with_canna" && with_canna=yes
8405   if test "$with_canna" = "yes"; then
8406     { test "$extra_verbose" = "yes" && cat << \EOF
8407     Defining HAVE_CANNA
8408 EOF
8409 cat >> confdefs.h <<\EOF
8410 #define HAVE_CANNA 1
8411 EOF
8412 }
8413
8414     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8415     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8416    echo "    xemacs will be linked with \"mule-canna.o\""
8417  fi
8418   fi
8419
8420 else   for feature in xim canna wnn; do
8421     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8422       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8423     fi
8424     eval "with_${feature}=no"
8425   done
8426 fi 
8427
8428 if test "$need_motif" = "yes" ; then
8429   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8430     
8431 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8432 echo "configure:8433: checking for layout_object_getvalue in -li18n" >&5
8433 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8434
8435 xe_check_libs=" -li18n "
8436 cat > conftest.$ac_ext <<EOF
8437 #line 8438 "configure"
8438 #include "confdefs.h"
8439 /* Override any gcc2 internal prototype to avoid an error.  */
8440 /* We use char because int might match the return type of a gcc2
8441     builtin and then its argument prototype would still apply.  */
8442 char layout_object_getvalue();
8443
8444 int main() {
8445 layout_object_getvalue()
8446 ; return 0; }
8447 EOF
8448 if { (eval echo configure:8449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8449   rm -rf conftest*
8450   eval "ac_cv_lib_$ac_lib_var=yes"
8451 else
8452   echo "configure: failed program was:" >&5
8453   cat conftest.$ac_ext >&5
8454   rm -rf conftest*
8455   eval "ac_cv_lib_$ac_lib_var=no"
8456 fi
8457 rm -f conftest*
8458 xe_check_libs=""
8459
8460 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8461   echo "$ac_t""yes" 1>&6
8462   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8463 else
8464   echo "$ac_t""no" 1>&6
8465 fi
8466
8467
8468   
8469 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8470     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8471   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8472   
8473         runpath="" runpath_dirs=""
8474   if test -n "$LD_RUN_PATH"; then
8475     runpath="$LD_RUN_PATH"
8476   elif test "$GCC" = "yes"; then
8477         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8478     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8479     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8480     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8481       case "$arg" in P,* | -L* | -R* )
8482         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8483           {
8484 xe_runpath_dir="$dir"
8485   test "$xe_runpath_dir" != "/lib"     -a \
8486         "$xe_runpath_dir" != "/usr/lib" -a \
8487         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8488   eval "$xe_add_unique_runpath_dir"
8489 }
8490         done ;;
8491       esac
8492     done
8493     ld_switch_run="$ld_switch_run_save"
8494     rm -f conftest*
8495   else
8496         for arg in $ld_switch_site $ld_switch_x_site; do
8497       case "$arg" in -L*) {
8498 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8499   test "$xe_runpath_dir" != "/lib"     -a \
8500         "$xe_runpath_dir" != "/usr/lib" -a \
8501         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8502   eval "$xe_add_unique_runpath_dir"
8503 };; esac
8504     done
8505         if test "$opsys $need_motif" = "sol2 yes"; then
8506       xe_runpath_dir="/opt/SUNWdt/lib";
8507       eval "$xe_add_unique_runpath_dir";
8508     fi
8509   fi 
8510   if test -n "$runpath"; then
8511     ld_switch_run="${dash_r}${runpath}"
8512     
8513 if test "$GCC" = "yes"; then
8514   set x $ld_switch_run; shift; ld_switch_run=""
8515   while test -n "$1"; do
8516     case $1 in
8517       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8518       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8519       -Xlinker* ) ;;
8520       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8521     esac
8522     shift
8523   done
8524 fi
8525     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8526   fi
8527 fi
8528
8529 fi
8530
8531 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
8532 do
8533 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8534 echo "configure:8535: checking for $ac_func" >&5
8535
8536 cat > conftest.$ac_ext <<EOF
8537 #line 8538 "configure"
8538 #include "confdefs.h"
8539 /* System header to define __stub macros and hopefully few prototypes,
8540     which can conflict with char $ac_func(); below.  */
8541 #include <assert.h>
8542 /* Override any gcc2 internal prototype to avoid an error.  */
8543 /* We use char because int might match the return type of a gcc2
8544     builtin and then its argument prototype would still apply.  */
8545 char $ac_func();
8546
8547 int main() {
8548
8549 /* The GNU C library defines this for functions which it implements
8550     to always fail with ENOSYS.  Some functions are actually named
8551     something starting with __ and the normal name is an alias.  */
8552 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8553 choke me
8554 #else
8555 $ac_func();
8556 #endif
8557
8558 ; return 0; }
8559 EOF
8560 if { (eval echo configure:8561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8561   rm -rf conftest*
8562   eval "ac_cv_func_$ac_func=yes"
8563 else
8564   echo "configure: failed program was:" >&5
8565   cat conftest.$ac_ext >&5
8566   rm -rf conftest*
8567   eval "ac_cv_func_$ac_func=no"
8568 fi
8569 rm -f conftest*
8570
8571 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8572   echo "$ac_t""yes" 1>&6
8573     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8574   { test "$extra_verbose" = "yes" && cat << EOF
8575     Defining $ac_tr_func
8576 EOF
8577 cat >> confdefs.h <<EOF
8578 #define $ac_tr_func 1
8579 EOF
8580 }
8581  
8582 else
8583   echo "$ac_t""no" 1>&6
8584 fi
8585 done
8586
8587
8588
8589 case "$opsys" in
8590   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8591    echo "    xemacs will be linked with \"realpath.o\""
8592  fi ;;
8593   * )
8594     case "$canonical" in
8595       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8596    echo "    xemacs will be linked with \"realpath.o\""
8597  fi ;;
8598       * ) for ac_func in realpath
8599 do
8600 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8601 echo "configure:8602: checking for $ac_func" >&5
8602
8603 cat > conftest.$ac_ext <<EOF
8604 #line 8605 "configure"
8605 #include "confdefs.h"
8606 /* System header to define __stub macros and hopefully few prototypes,
8607     which can conflict with char $ac_func(); below.  */
8608 #include <assert.h>
8609 /* Override any gcc2 internal prototype to avoid an error.  */
8610 /* We use char because int might match the return type of a gcc2
8611     builtin and then its argument prototype would still apply.  */
8612 char $ac_func();
8613
8614 int main() {
8615
8616 /* The GNU C library defines this for functions which it implements
8617     to always fail with ENOSYS.  Some functions are actually named
8618     something starting with __ and the normal name is an alias.  */
8619 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8620 choke me
8621 #else
8622 $ac_func();
8623 #endif
8624
8625 ; return 0; }
8626 EOF
8627 if { (eval echo configure:8628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8628   rm -rf conftest*
8629   eval "ac_cv_func_$ac_func=yes"
8630 else
8631   echo "configure: failed program was:" >&5
8632   cat conftest.$ac_ext >&5
8633   rm -rf conftest*
8634   eval "ac_cv_func_$ac_func=no"
8635 fi
8636 rm -f conftest*
8637
8638 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8639   echo "$ac_t""yes" 1>&6
8640     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8641   { test "$extra_verbose" = "yes" && cat << EOF
8642     Defining $ac_tr_func
8643 EOF
8644 cat >> confdefs.h <<EOF
8645 #define $ac_tr_func 1
8646 EOF
8647 }
8648  
8649 else
8650   echo "$ac_t""no" 1>&6
8651 fi
8652 done
8653
8654           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8655    echo "    xemacs will be linked with \"realpath.o\""
8656  fi ;;
8657     esac ;;
8658 esac
8659
8660 for ac_func in getloadavg
8661 do
8662 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8663 echo "configure:8664: checking for $ac_func" >&5
8664
8665 cat > conftest.$ac_ext <<EOF
8666 #line 8667 "configure"
8667 #include "confdefs.h"
8668 /* System header to define __stub macros and hopefully few prototypes,
8669     which can conflict with char $ac_func(); below.  */
8670 #include <assert.h>
8671 /* Override any gcc2 internal prototype to avoid an error.  */
8672 /* We use char because int might match the return type of a gcc2
8673     builtin and then its argument prototype would still apply.  */
8674 char $ac_func();
8675
8676 int main() {
8677
8678 /* The GNU C library defines this for functions which it implements
8679     to always fail with ENOSYS.  Some functions are actually named
8680     something starting with __ and the normal name is an alias.  */
8681 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8682 choke me
8683 #else
8684 $ac_func();
8685 #endif
8686
8687 ; return 0; }
8688 EOF
8689 if { (eval echo configure:8690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8690   rm -rf conftest*
8691   eval "ac_cv_func_$ac_func=yes"
8692 else
8693   echo "configure: failed program was:" >&5
8694   cat conftest.$ac_ext >&5
8695   rm -rf conftest*
8696   eval "ac_cv_func_$ac_func=no"
8697 fi
8698 rm -f conftest*
8699
8700 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8701   echo "$ac_t""yes" 1>&6
8702     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8703   { test "$extra_verbose" = "yes" && cat << EOF
8704     Defining $ac_tr_func
8705 EOF
8706 cat >> confdefs.h <<EOF
8707 #define $ac_tr_func 1
8708 EOF
8709 }
8710  
8711 else
8712   echo "$ac_t""no" 1>&6
8713 fi
8714 done
8715
8716
8717 if test "$ac_cv_func_getloadavg" != "yes"
8718 then
8719   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
8720    echo "    xemacs will be linked with \"getloadavg.o\""
8721  fi
8722
8723     
8724 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
8725 echo "configure:8726: checking for kstat_open in -lkstat" >&5
8726 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
8727
8728 xe_check_libs=" -lkstat "
8729 cat > conftest.$ac_ext <<EOF
8730 #line 8731 "configure"
8731 #include "confdefs.h"
8732 /* Override any gcc2 internal prototype to avoid an error.  */
8733 /* We use char because int might match the return type of a gcc2
8734     builtin and then its argument prototype would still apply.  */
8735 char kstat_open();
8736
8737 int main() {
8738 kstat_open()
8739 ; return 0; }
8740 EOF
8741 if { (eval echo configure:8742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8742   rm -rf conftest*
8743   eval "ac_cv_lib_$ac_lib_var=yes"
8744 else
8745   echo "configure: failed program was:" >&5
8746   cat conftest.$ac_ext >&5
8747   rm -rf conftest*
8748   eval "ac_cv_lib_$ac_lib_var=no"
8749 fi
8750 rm -f conftest*
8751 xe_check_libs=""
8752
8753 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8754   echo "$ac_t""yes" 1>&6
8755     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8756     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8757   { test "$extra_verbose" = "yes" && cat << EOF
8758     Defining $ac_tr_lib
8759 EOF
8760 cat >> confdefs.h <<EOF
8761 #define $ac_tr_lib 1
8762 EOF
8763 }
8764
8765   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
8766
8767 else
8768   echo "$ac_t""no" 1>&6
8769 fi
8770
8771
8772
8773     
8774 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
8775 echo "configure:8776: checking for kvm_read in -lkvm" >&5
8776 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
8777
8778 xe_check_libs=" -lkvm "
8779 cat > conftest.$ac_ext <<EOF
8780 #line 8781 "configure"
8781 #include "confdefs.h"
8782 /* Override any gcc2 internal prototype to avoid an error.  */
8783 /* We use char because int might match the return type of a gcc2
8784     builtin and then its argument prototype would still apply.  */
8785 char kvm_read();
8786
8787 int main() {
8788 kvm_read()
8789 ; return 0; }
8790 EOF
8791 if { (eval echo configure:8792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8792   rm -rf conftest*
8793   eval "ac_cv_lib_$ac_lib_var=yes"
8794 else
8795   echo "configure: failed program was:" >&5
8796   cat conftest.$ac_ext >&5
8797   rm -rf conftest*
8798   eval "ac_cv_lib_$ac_lib_var=no"
8799 fi
8800 rm -f conftest*
8801 xe_check_libs=""
8802
8803 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8804   echo "$ac_t""yes" 1>&6
8805     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8806     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8807   { test "$extra_verbose" = "yes" && cat << EOF
8808     Defining $ac_tr_lib
8809 EOF
8810 cat >> confdefs.h <<EOF
8811 #define $ac_tr_lib 1
8812 EOF
8813 }
8814
8815   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
8816
8817 else
8818   echo "$ac_t""no" 1>&6
8819 fi
8820
8821
8822 fi
8823
8824 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8825 echo "configure:8826: checking whether netdb declares h_errno" >&5
8826 cat > conftest.$ac_ext <<EOF
8827 #line 8828 "configure"
8828 #include "confdefs.h"
8829 #include <netdb.h>
8830 int main() {
8831 return h_errno;
8832 ; return 0; }
8833 EOF
8834 if { (eval echo configure:8835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8835   rm -rf conftest*
8836   echo "$ac_t""yes" 1>&6
8837    { test "$extra_verbose" = "yes" && cat << \EOF
8838     Defining HAVE_H_ERRNO
8839 EOF
8840 cat >> confdefs.h <<\EOF
8841 #define HAVE_H_ERRNO 1
8842 EOF
8843 }
8844
8845 else
8846   echo "configure: failed program was:" >&5
8847   cat conftest.$ac_ext >&5
8848   rm -rf conftest*
8849   echo "$ac_t""no" 1>&6
8850 fi
8851 rm -f conftest*
8852
8853 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8854 echo "configure:8855: checking for sigsetjmp" >&5
8855 cat > conftest.$ac_ext <<EOF
8856 #line 8857 "configure"
8857 #include "confdefs.h"
8858 #include <setjmp.h>
8859 int main() {
8860 sigjmp_buf bar; sigsetjmp (bar, 0);
8861 ; return 0; }
8862 EOF
8863 if { (eval echo configure:8864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8864   rm -rf conftest*
8865   echo "$ac_t""yes" 1>&6
8866    { test "$extra_verbose" = "yes" && cat << \EOF
8867     Defining HAVE_SIGSETJMP
8868 EOF
8869 cat >> confdefs.h <<\EOF
8870 #define HAVE_SIGSETJMP 1
8871 EOF
8872 }
8873
8874 else
8875   echo "configure: failed program was:" >&5
8876   cat conftest.$ac_ext >&5
8877   rm -rf conftest*
8878   echo "$ac_t""no" 1>&6
8879 fi
8880 rm -f conftest*
8881
8882 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
8883 echo "configure:8884: checking whether localtime caches TZ" >&5
8884
8885 if test "$ac_cv_func_tzset" = "yes"; then
8886 cat > conftest.$ac_ext <<EOF
8887 #line 8888 "configure"
8888 #include "confdefs.h"
8889 #include <time.h>
8890 #if STDC_HEADERS
8891 # include <stdlib.h>
8892 #endif
8893 extern char **environ;
8894 unset_TZ ()
8895 {
8896   char **from, **to;
8897   for (to = from = environ; (*to = *from); from++)
8898     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
8899       to++;
8900 }
8901 char TZ_GMT0[] = "TZ=GMT0";
8902 char TZ_PST8[] = "TZ=PST8";
8903 main()
8904 {
8905   time_t now = time ((time_t *) 0);
8906   int hour_GMT0, hour_unset;
8907   if (putenv (TZ_GMT0) != 0)
8908     exit (1);
8909   hour_GMT0 = localtime (&now)->tm_hour;
8910   unset_TZ ();
8911   hour_unset = localtime (&now)->tm_hour;
8912   if (putenv (TZ_PST8) != 0)
8913     exit (1);
8914   if (localtime (&now)->tm_hour == hour_GMT0)
8915     exit (1);
8916   unset_TZ ();
8917   if (localtime (&now)->tm_hour != hour_unset)
8918     exit (1);
8919   exit (0);
8920 }
8921 EOF
8922 if { (eval echo configure:8923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8923 then
8924   emacs_cv_localtime_cache=no
8925 else
8926   conftest_rc="$?"
8927   echo "configure: failed program was:" >&5
8928   cat conftest.$ac_ext >&5
8929   rm -fr conftest*
8930   emacs_cv_localtime_cache=yes
8931 fi
8932 rm -fr conftest*
8933 else
8934         # If we lack tzset, report that localtime does not cache TZ,
8935         # since we can't invalidate the cache if we don't have tzset.
8936         emacs_cv_localtime_cache=no
8937 fi
8938 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
8939 if test $emacs_cv_localtime_cache = yes; then
8940   { test "$extra_verbose" = "yes" && cat << \EOF
8941     Defining LOCALTIME_CACHE
8942 EOF
8943 cat >> confdefs.h <<\EOF
8944 #define LOCALTIME_CACHE 1
8945 EOF
8946 }
8947
8948 fi
8949
8950 if test "$HAVE_TIMEVAL" = "yes"; then
8951 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
8952 echo "configure:8953: checking whether gettimeofday accepts one or two arguments" >&5
8953 cat > conftest.$ac_ext <<EOF
8954 #line 8955 "configure"
8955 #include "confdefs.h"
8956
8957 #ifdef TIME_WITH_SYS_TIME
8958 #include <sys/time.h>
8959 #include <time.h>
8960 #else
8961 #ifdef HAVE_SYS_TIME_H
8962 #include <sys/time.h>
8963 #else
8964 #include <time.h>
8965 #endif
8966 #endif
8967   
8968 int main() {
8969
8970   struct timeval time;
8971   struct timezone dummy;
8972   gettimeofday (&time, &dummy);
8973
8974 ; return 0; }
8975 EOF
8976 if { (eval echo configure:8977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8977   rm -rf conftest*
8978   echo "$ac_t""two" 1>&6
8979 else
8980   echo "configure: failed program was:" >&5
8981   cat conftest.$ac_ext >&5
8982   rm -rf conftest*
8983   echo "$ac_t""one" 1>&6
8984    { test "$extra_verbose" = "yes" && cat << \EOF
8985     Defining GETTIMEOFDAY_ONE_ARGUMENT
8986 EOF
8987 cat >> confdefs.h <<\EOF
8988 #define GETTIMEOFDAY_ONE_ARGUMENT 1
8989 EOF
8990 }
8991
8992 fi
8993 rm -f conftest*
8994 fi
8995
8996
8997 echo $ac_n "checking for inline""... $ac_c" 1>&6
8998 echo "configure:8999: checking for inline" >&5
8999
9000 ac_cv_c_inline=no
9001 for ac_kw in inline __inline__ __inline; do
9002   cat > conftest.$ac_ext <<EOF
9003 #line 9004 "configure"
9004 #include "confdefs.h"
9005
9006 int main() {
9007 } $ac_kw foo() {
9008 ; return 0; }
9009 EOF
9010 if { (eval echo configure:9011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9011   rm -rf conftest*
9012   ac_cv_c_inline=$ac_kw; break
9013 else
9014   echo "configure: failed program was:" >&5
9015   cat conftest.$ac_ext >&5
9016 fi
9017 rm -f conftest*
9018 done
9019
9020
9021 echo "$ac_t""$ac_cv_c_inline" 1>&6
9022 case "$ac_cv_c_inline" in
9023   inline | yes) ;;
9024   no) { test "$extra_verbose" = "yes" && cat << \EOF
9025     Defining inline = 
9026 EOF
9027 cat >> confdefs.h <<\EOF
9028 #define inline 
9029 EOF
9030 }
9031  ;;
9032   *)  { test "$extra_verbose" = "yes" && cat << EOF
9033     Defining inline = $ac_cv_c_inline
9034 EOF
9035 cat >> confdefs.h <<EOF
9036 #define inline $ac_cv_c_inline
9037 EOF
9038 }
9039  ;;
9040 esac
9041
9042 if test "$ac_cv_c_inline" != "no"; then
9043   { test "$extra_verbose" = "yes" && cat << \EOF
9044     Defining HAVE_INLINE
9045 EOF
9046 cat >> confdefs.h <<\EOF
9047 #define HAVE_INLINE 1
9048 EOF
9049 }
9050
9051   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9052    echo "    xemacs will be linked with \"inline.o\""
9053  fi
9054 fi
9055
9056
9057 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9058 # for constant arguments.  Useless!
9059 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9060 echo "configure:9061: checking for working alloca.h" >&5
9061
9062 cat > conftest.$ac_ext <<EOF
9063 #line 9064 "configure"
9064 #include "confdefs.h"
9065 #include <alloca.h>
9066 int main() {
9067 char *p = alloca(2 * sizeof(int));
9068 ; return 0; }
9069 EOF
9070 if { (eval echo configure:9071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9071   rm -rf conftest*
9072   ac_cv_header_alloca_h=yes
9073 else
9074   echo "configure: failed program was:" >&5
9075   cat conftest.$ac_ext >&5
9076   rm -rf conftest*
9077   ac_cv_header_alloca_h=no
9078 fi
9079 rm -f conftest*
9080
9081 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9082 if test $ac_cv_header_alloca_h = yes; then
9083   { test "$extra_verbose" = "yes" && cat << \EOF
9084     Defining HAVE_ALLOCA_H
9085 EOF
9086 cat >> confdefs.h <<\EOF
9087 #define HAVE_ALLOCA_H 1
9088 EOF
9089 }
9090
9091 fi
9092
9093 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9094 echo "configure:9095: checking for alloca" >&5
9095
9096 cat > conftest.$ac_ext <<EOF
9097 #line 9098 "configure"
9098 #include "confdefs.h"
9099
9100 #ifdef __GNUC__
9101 # define alloca __builtin_alloca
9102 #else
9103 # if HAVE_ALLOCA_H
9104 #  include <alloca.h>
9105 # else
9106 #  ifdef _AIX
9107  #pragma alloca
9108 #  else
9109 #   ifndef alloca /* predefined by HP cc +Olibcalls */
9110 char *alloca ();
9111 #   endif
9112 #  endif
9113 # endif
9114 #endif
9115
9116 int main() {
9117 char *p = (char *) alloca(1);
9118 ; return 0; }
9119 EOF
9120 if { (eval echo configure:9121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9121   rm -rf conftest*
9122   ac_cv_func_alloca_works=yes
9123 else
9124   echo "configure: failed program was:" >&5
9125   cat conftest.$ac_ext >&5
9126   rm -rf conftest*
9127   ac_cv_func_alloca_works=no
9128 fi
9129 rm -f conftest*
9130
9131 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9132 if test $ac_cv_func_alloca_works = yes; then
9133   { test "$extra_verbose" = "yes" && cat << \EOF
9134     Defining HAVE_ALLOCA
9135 EOF
9136 cat >> confdefs.h <<\EOF
9137 #define HAVE_ALLOCA 1
9138 EOF
9139 }
9140
9141 fi
9142
9143 if test $ac_cv_func_alloca_works = no; then
9144   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9145   # that cause trouble.  Some versions do not even contain alloca or
9146   # contain a buggy version.  If you still want to use their alloca,
9147   # use ar to extract alloca.o from them instead of compiling alloca.c.
9148   ALLOCA=alloca.o
9149   { test "$extra_verbose" = "yes" && cat << \EOF
9150     Defining C_ALLOCA
9151 EOF
9152 cat >> confdefs.h <<\EOF
9153 #define C_ALLOCA 1
9154 EOF
9155 }
9156
9157
9158 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9159 echo "configure:9160: checking whether alloca needs Cray hooks" >&5
9160
9161 cat > conftest.$ac_ext <<EOF
9162 #line 9163 "configure"
9163 #include "confdefs.h"
9164 #if defined(CRAY) && ! defined(CRAY2)
9165 webecray
9166 #else
9167 wenotbecray
9168 #endif
9169
9170 EOF
9171 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9172   egrep "webecray" >/dev/null 2>&1; then
9173   rm -rf conftest*
9174   ac_cv_os_cray=yes
9175 else
9176   rm -rf conftest*
9177   ac_cv_os_cray=no
9178 fi
9179 rm -f conftest*
9180
9181
9182 echo "$ac_t""$ac_cv_os_cray" 1>&6
9183 if test $ac_cv_os_cray = yes; then
9184 for ac_func in _getb67 GETB67 getb67; do
9185   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9186 echo "configure:9187: checking for $ac_func" >&5
9187
9188 cat > conftest.$ac_ext <<EOF
9189 #line 9190 "configure"
9190 #include "confdefs.h"
9191 /* System header to define __stub macros and hopefully few prototypes,
9192     which can conflict with char $ac_func(); below.  */
9193 #include <assert.h>
9194 /* Override any gcc2 internal prototype to avoid an error.  */
9195 /* We use char because int might match the return type of a gcc2
9196     builtin and then its argument prototype would still apply.  */
9197 char $ac_func();
9198
9199 int main() {
9200
9201 /* The GNU C library defines this for functions which it implements
9202     to always fail with ENOSYS.  Some functions are actually named
9203     something starting with __ and the normal name is an alias.  */
9204 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9205 choke me
9206 #else
9207 $ac_func();
9208 #endif
9209
9210 ; return 0; }
9211 EOF
9212 if { (eval echo configure:9213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9213   rm -rf conftest*
9214   eval "ac_cv_func_$ac_func=yes"
9215 else
9216   echo "configure: failed program was:" >&5
9217   cat conftest.$ac_ext >&5
9218   rm -rf conftest*
9219   eval "ac_cv_func_$ac_func=no"
9220 fi
9221 rm -f conftest*
9222
9223 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9224   echo "$ac_t""yes" 1>&6
9225   { test "$extra_verbose" = "yes" && cat << EOF
9226     Defining CRAY_STACKSEG_END = $ac_func
9227 EOF
9228 cat >> confdefs.h <<EOF
9229 #define CRAY_STACKSEG_END $ac_func
9230 EOF
9231 }
9232
9233   break
9234 else
9235   echo "$ac_t""no" 1>&6
9236 fi
9237
9238 done
9239 fi
9240
9241 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9242 echo "configure:9243: checking stack direction for C alloca" >&5
9243
9244 cat > conftest.$ac_ext <<EOF
9245 #line 9246 "configure"
9246 #include "confdefs.h"
9247 find_stack_direction ()
9248 {
9249   static char *addr = 0;
9250   auto char dummy;
9251   if (addr == 0)
9252     {
9253       addr = &dummy;
9254       return find_stack_direction ();
9255     }
9256   else
9257     return (&dummy > addr) ? 1 : -1;
9258 }
9259 main ()
9260 {
9261   exit (find_stack_direction() < 0);
9262 }
9263 EOF
9264 if { (eval echo configure:9265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9265 then
9266   ac_cv_c_stack_direction=1
9267 else
9268   conftest_rc="$?"
9269   echo "configure: failed program was:" >&5
9270   cat conftest.$ac_ext >&5
9271   rm -fr conftest*
9272   ac_cv_c_stack_direction=-1
9273 fi
9274 rm -fr conftest*
9275
9276 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9277 { test "$extra_verbose" = "yes" && cat << EOF
9278     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9279 EOF
9280 cat >> confdefs.h <<EOF
9281 #define STACK_DIRECTION $ac_cv_c_stack_direction
9282 EOF
9283 }
9284
9285 fi
9286
9287 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9288    echo "    xemacs will be linked with \"$ALLOCA\""
9289  fi
9290
9291 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9292 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9293 echo "configure:9294: checking for vfork.h" >&5
9294
9295 cat > conftest.$ac_ext <<EOF
9296 #line 9297 "configure"
9297 #include "confdefs.h"
9298 #include <vfork.h>
9299 EOF
9300 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9301 { (eval echo configure:9302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9302 ac_err=`grep -v '^ *+' conftest.out`
9303 if test -z "$ac_err"; then
9304   rm -rf conftest*
9305   eval "ac_cv_header_$ac_safe=yes"
9306 else
9307   echo "$ac_err" >&5
9308   echo "configure: failed program was:" >&5
9309   cat conftest.$ac_ext >&5
9310   rm -rf conftest*
9311   eval "ac_cv_header_$ac_safe=no"
9312 fi
9313 rm -f conftest*
9314 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9315   echo "$ac_t""yes" 1>&6
9316   { test "$extra_verbose" = "yes" && cat << \EOF
9317     Defining HAVE_VFORK_H
9318 EOF
9319 cat >> confdefs.h <<\EOF
9320 #define HAVE_VFORK_H 1
9321 EOF
9322 }
9323
9324 else
9325   echo "$ac_t""no" 1>&6
9326 fi
9327
9328 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9329 echo "configure:9330: checking for working vfork" >&5
9330
9331 cat > conftest.$ac_ext <<EOF
9332 #line 9333 "configure"
9333 #include "confdefs.h"
9334 /* Thanks to Paul Eggert for this test.  */
9335 #include <stdio.h>
9336 #include <sys/types.h>
9337 #include <sys/stat.h>
9338 #ifdef HAVE_UNISTD_H
9339 #include <unistd.h>
9340 #endif
9341 #ifdef HAVE_VFORK_H
9342 #include <vfork.h>
9343 #endif
9344 /* On some sparc systems, changes by the child to local and incoming
9345    argument registers are propagated back to the parent.
9346    The compiler is told about this with #include <vfork.h>,
9347    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9348    Test for this by using a static variable whose address
9349    is put into a register that is clobbered by the vfork.  */
9350 static
9351 #ifdef __cplusplus
9352 sparc_address_test (int arg)
9353 #else
9354 sparc_address_test (arg) int arg;
9355 #endif
9356 {
9357   static pid_t child;
9358   if (!child) {
9359     child = vfork ();
9360     if (child < 0) {
9361       perror ("vfork");
9362       _exit(2);
9363     }
9364     if (!child) {
9365       arg = getpid();
9366       write(-1, "", 0);
9367       _exit (arg);
9368     }
9369   }
9370 }
9371 main() {
9372   pid_t parent = getpid ();
9373   pid_t child;
9374
9375   sparc_address_test ();
9376
9377   child = vfork ();
9378
9379   if (child == 0) {
9380     /* Here is another test for sparc vfork register problems.
9381        This test uses lots of local variables, at least
9382        as many local variables as main has allocated so far
9383        including compiler temporaries.  4 locals are enough for
9384        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9385        A buggy compiler should reuse the register of parent
9386        for one of the local variables, since it will think that
9387        parent can't possibly be used any more in this routine.
9388        Assigning to the local variable will thus munge parent
9389        in the parent process.  */
9390     pid_t
9391       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9392       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9393     /* Convince the compiler that p..p7 are live; otherwise, it might
9394        use the same hardware register for all 8 local variables.  */
9395     if (p != p1 || p != p2 || p != p3 || p != p4
9396         || p != p5 || p != p6 || p != p7)
9397       _exit(1);
9398
9399     /* On some systems (e.g. IRIX 3.3),
9400        vfork doesn't separate parent from child file descriptors.
9401        If the child closes a descriptor before it execs or exits,
9402        this munges the parent's descriptor as well.
9403        Test for this by closing stdout in the child.  */
9404     _exit(close(fileno(stdout)) != 0);
9405   } else {
9406     int status;
9407     struct stat st;
9408
9409     while (wait(&status) != child)
9410       ;
9411     exit(
9412          /* Was there some problem with vforking?  */
9413          child < 0
9414
9415          /* Did the child fail?  (This shouldn't happen.)  */
9416          || status
9417
9418          /* Did the vfork/compiler bug occur?  */
9419          || parent != getpid()
9420
9421          /* Did the file descriptor bug occur?  */
9422          || fstat(fileno(stdout), &st) != 0
9423          );
9424   }
9425 }
9426 EOF
9427 if { (eval echo configure:9428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9428 then
9429   ac_cv_func_vfork_works=yes
9430 else
9431   conftest_rc="$?"
9432   echo "configure: failed program was:" >&5
9433   cat conftest.$ac_ext >&5
9434   rm -fr conftest*
9435   ac_cv_func_vfork_works=no
9436 fi
9437 rm -fr conftest*
9438
9439 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9440 if test $ac_cv_func_vfork_works = no; then
9441   { test "$extra_verbose" = "yes" && cat << \EOF
9442     Defining vfork = fork
9443 EOF
9444 cat >> confdefs.h <<\EOF
9445 #define vfork fork
9446 EOF
9447 }
9448
9449 fi
9450
9451
9452 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9453 echo "configure:9454: checking for working strcoll" >&5
9454
9455 cat > conftest.$ac_ext <<EOF
9456 #line 9457 "configure"
9457 #include "confdefs.h"
9458 #include <string.h>
9459 main ()
9460 {
9461   exit (strcoll ("abc", "def") >= 0 ||
9462         strcoll ("ABC", "DEF") >= 0 ||
9463         strcoll ("123", "456") >= 0);
9464 }
9465 EOF
9466 if { (eval echo configure:9467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9467 then
9468   ac_cv_func_strcoll_works=yes
9469 else
9470   conftest_rc="$?"
9471   echo "configure: failed program was:" >&5
9472   cat conftest.$ac_ext >&5
9473   rm -fr conftest*
9474   ac_cv_func_strcoll_works=no
9475 fi
9476 rm -fr conftest*
9477
9478 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9479 if test $ac_cv_func_strcoll_works = yes; then
9480   { test "$extra_verbose" = "yes" && cat << \EOF
9481     Defining HAVE_STRCOLL
9482 EOF
9483 cat >> confdefs.h <<\EOF
9484 #define HAVE_STRCOLL 1
9485 EOF
9486 }
9487
9488 fi
9489
9490
9491 for ac_func in getpgrp
9492 do
9493 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9494 echo "configure:9495: checking for $ac_func" >&5
9495
9496 cat > conftest.$ac_ext <<EOF
9497 #line 9498 "configure"
9498 #include "confdefs.h"
9499 /* System header to define __stub macros and hopefully few prototypes,
9500     which can conflict with char $ac_func(); below.  */
9501 #include <assert.h>
9502 /* Override any gcc2 internal prototype to avoid an error.  */
9503 /* We use char because int might match the return type of a gcc2
9504     builtin and then its argument prototype would still apply.  */
9505 char $ac_func();
9506
9507 int main() {
9508
9509 /* The GNU C library defines this for functions which it implements
9510     to always fail with ENOSYS.  Some functions are actually named
9511     something starting with __ and the normal name is an alias.  */
9512 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9513 choke me
9514 #else
9515 $ac_func();
9516 #endif
9517
9518 ; return 0; }
9519 EOF
9520 if { (eval echo configure:9521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9521   rm -rf conftest*
9522   eval "ac_cv_func_$ac_func=yes"
9523 else
9524   echo "configure: failed program was:" >&5
9525   cat conftest.$ac_ext >&5
9526   rm -rf conftest*
9527   eval "ac_cv_func_$ac_func=no"
9528 fi
9529 rm -f conftest*
9530
9531 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9532   echo "$ac_t""yes" 1>&6
9533     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9534   { test "$extra_verbose" = "yes" && cat << EOF
9535     Defining $ac_tr_func
9536 EOF
9537 cat >> confdefs.h <<EOF
9538 #define $ac_tr_func 1
9539 EOF
9540 }
9541  
9542 else
9543   echo "$ac_t""no" 1>&6
9544 fi
9545 done
9546
9547 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9548 echo "configure:9549: checking whether getpgrp takes no argument" >&5
9549
9550 cat > conftest.$ac_ext <<EOF
9551 #line 9552 "configure"
9552 #include "confdefs.h"
9553
9554 /*
9555  * If this system has a BSD-style getpgrp(),
9556  * which takes a pid argument, exit unsuccessfully.
9557  *
9558  * Snarfed from Chet Ramey's bash pgrp.c test program
9559  */
9560 #include <stdio.h>
9561 #include <sys/types.h>
9562
9563 int     pid;
9564 int     pg1, pg2, pg3, pg4;
9565 int     ng, np, s, child;
9566
9567 main()
9568 {
9569         pid = getpid();
9570         pg1 = getpgrp(0);
9571         pg2 = getpgrp();
9572         pg3 = getpgrp(pid);
9573         pg4 = getpgrp(1);
9574
9575         /*
9576          * If all of these values are the same, it's pretty sure that
9577          * we're on a system that ignores getpgrp's first argument.
9578          */
9579         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9580                 exit(0);
9581
9582         child = fork();
9583         if (child < 0)
9584                 exit(1);
9585         else if (child == 0) {
9586                 np = getpid();
9587                 /*
9588                  * If this is Sys V, this will not work; pgrp will be
9589                  * set to np because setpgrp just changes a pgrp to be
9590                  * the same as the pid.
9591                  */
9592                 setpgrp(np, pg1);
9593                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9594                 if (ng == pg1) {
9595                         exit(1);
9596                 } else {
9597                         exit(0);
9598                 }
9599         } else {
9600                 wait(&s);
9601                 exit(s>>8);
9602         }
9603 }
9604
9605 EOF
9606 if { (eval echo configure:9607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9607 then
9608   ac_cv_func_getpgrp_void=yes
9609 else
9610   conftest_rc="$?"
9611   echo "configure: failed program was:" >&5
9612   cat conftest.$ac_ext >&5
9613   rm -fr conftest*
9614   ac_cv_func_getpgrp_void=no
9615 fi
9616 rm -fr conftest*
9617
9618
9619 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9620 if test $ac_cv_func_getpgrp_void = yes; then
9621   { test "$extra_verbose" = "yes" && cat << \EOF
9622     Defining GETPGRP_VOID
9623 EOF
9624 cat >> confdefs.h <<\EOF
9625 #define GETPGRP_VOID 1
9626 EOF
9627 }
9628
9629 fi
9630
9631
9632 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9633 echo "configure:9634: checking for working mmap" >&5
9634 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9635 cat > conftest.$ac_ext <<EOF
9636 #line 9637 "configure"
9637 #include "confdefs.h"
9638 #include <stdio.h>
9639 #include <unistd.h>
9640 #include <fcntl.h>
9641 #include <sys/mman.h>
9642
9643 #ifndef MAP_VARIABLE
9644 #define MAP_VARIABLE 0
9645 #endif
9646
9647 #ifndef MAP_FAILED
9648 #define MAP_FAILED -1
9649 #endif
9650
9651 int main (int argc, char *argv[])
9652 {
9653   int fd = -1;
9654   caddr_t p;
9655 #ifndef MAP_ANONYMOUS
9656   fd = open ("/dev/zero", O_RDWR);
9657   if (fd < 0)
9658     return 1;
9659 #define MAP_ANONYMOUS 0
9660 #endif
9661   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9662            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9663            fd, 0) != (void *) MAP_FAILED)
9664     return 0;
9665   perror ("conftest: mmap failed");
9666   return 1;
9667 }
9668 EOF
9669 if { (eval echo configure:9670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9670 then
9671   have_mmap=yes
9672 else
9673   conftest_rc="$?"
9674   echo "configure: failed program was:" >&5
9675   cat conftest.$ac_ext >&5
9676   rm -fr conftest*
9677   have_mmap=no
9678 fi
9679 rm -fr conftest* ;;
9680 esac
9681 echo "$ac_t""$have_mmap" 1>&6
9682 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9683     Defining HAVE_MMAP
9684 EOF
9685 cat >> confdefs.h <<\EOF
9686 #define HAVE_MMAP 1
9687 EOF
9688 }
9689
9690 for ac_hdr in unistd.h
9691 do
9692 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9693 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9694 echo "configure:9695: checking for $ac_hdr" >&5
9695
9696 cat > conftest.$ac_ext <<EOF
9697 #line 9698 "configure"
9698 #include "confdefs.h"
9699 #include <$ac_hdr>
9700 EOF
9701 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9702 { (eval echo configure:9703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9703 ac_err=`grep -v '^ *+' conftest.out`
9704 if test -z "$ac_err"; then
9705   rm -rf conftest*
9706   eval "ac_cv_header_$ac_safe=yes"
9707 else
9708   echo "$ac_err" >&5
9709   echo "configure: failed program was:" >&5
9710   cat conftest.$ac_ext >&5
9711   rm -rf conftest*
9712   eval "ac_cv_header_$ac_safe=no"
9713 fi
9714 rm -f conftest*
9715 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9716   echo "$ac_t""yes" 1>&6
9717     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9718   { test "$extra_verbose" = "yes" && cat << EOF
9719     Defining $ac_tr_hdr
9720 EOF
9721 cat >> confdefs.h <<EOF
9722 #define $ac_tr_hdr 1
9723 EOF
9724 }
9725  
9726 else
9727   echo "$ac_t""no" 1>&6
9728 fi
9729 done
9730
9731 for ac_func in getpagesize
9732 do
9733 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9734 echo "configure:9735: checking for $ac_func" >&5
9735
9736 cat > conftest.$ac_ext <<EOF
9737 #line 9738 "configure"
9738 #include "confdefs.h"
9739 /* System header to define __stub macros and hopefully few prototypes,
9740     which can conflict with char $ac_func(); below.  */
9741 #include <assert.h>
9742 /* Override any gcc2 internal prototype to avoid an error.  */
9743 /* We use char because int might match the return type of a gcc2
9744     builtin and then its argument prototype would still apply.  */
9745 char $ac_func();
9746
9747 int main() {
9748
9749 /* The GNU C library defines this for functions which it implements
9750     to always fail with ENOSYS.  Some functions are actually named
9751     something starting with __ and the normal name is an alias.  */
9752 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9753 choke me
9754 #else
9755 $ac_func();
9756 #endif
9757
9758 ; return 0; }
9759 EOF
9760 if { (eval echo configure:9761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9761   rm -rf conftest*
9762   eval "ac_cv_func_$ac_func=yes"
9763 else
9764   echo "configure: failed program was:" >&5
9765   cat conftest.$ac_ext >&5
9766   rm -rf conftest*
9767   eval "ac_cv_func_$ac_func=no"
9768 fi
9769 rm -f conftest*
9770
9771 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9772   echo "$ac_t""yes" 1>&6
9773     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9774   { test "$extra_verbose" = "yes" && cat << EOF
9775     Defining $ac_tr_func
9776 EOF
9777 cat >> confdefs.h <<EOF
9778 #define $ac_tr_func 1
9779 EOF
9780 }
9781  
9782 else
9783   echo "$ac_t""no" 1>&6
9784 fi
9785 done
9786
9787 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9788 echo "configure:9789: checking for working mmap" >&5
9789
9790 cat > conftest.$ac_ext <<EOF
9791 #line 9792 "configure"
9792 #include "confdefs.h"
9793
9794 /* Thanks to Mike Haertel and Jim Avera for this test.
9795    Here is a matrix of mmap possibilities:
9796         mmap private not fixed
9797         mmap private fixed at somewhere currently unmapped
9798         mmap private fixed at somewhere already mapped
9799         mmap shared not fixed
9800         mmap shared fixed at somewhere currently unmapped
9801         mmap shared fixed at somewhere already mapped
9802    For private mappings, we should verify that changes cannot be read()
9803    back from the file, nor mmap's back from the file at a different
9804    address.  (There have been systems where private was not correctly
9805    implemented like the infamous i386 svr4.0, and systems where the
9806    VM page cache was not coherent with the filesystem buffer cache
9807    like early versions of FreeBSD and possibly contemporary NetBSD.)
9808    For shared mappings, we should conversely verify that changes get
9809    propogated back to all the places they're supposed to be.
9810
9811    Grep wants private fixed already mapped.
9812    The main things grep needs to know about mmap are:
9813    * does it exist and is it safe to write into the mmap'd area
9814    * how to use it (BSD variants)  */
9815 #include <sys/types.h>
9816 #include <fcntl.h>
9817 #include <sys/mman.h>
9818
9819 /* This mess was copied from the GNU getpagesize.h.  */
9820 #ifndef HAVE_GETPAGESIZE
9821 # ifdef HAVE_UNISTD_H
9822 #  include <unistd.h>
9823 # endif
9824
9825 /* Assume that all systems that can run configure have sys/param.h.  */
9826 # ifndef HAVE_SYS_PARAM_H
9827 #  define HAVE_SYS_PARAM_H 1
9828 # endif
9829
9830 # ifdef _SC_PAGESIZE
9831 #  define getpagesize() sysconf(_SC_PAGESIZE)
9832 # else /* no _SC_PAGESIZE */
9833 #  ifdef HAVE_SYS_PARAM_H
9834 #   include <sys/param.h>
9835 #   ifdef EXEC_PAGESIZE
9836 #    define getpagesize() EXEC_PAGESIZE
9837 #   else /* no EXEC_PAGESIZE */
9838 #    ifdef NBPG
9839 #     define getpagesize() NBPG * CLSIZE
9840 #     ifndef CLSIZE
9841 #      define CLSIZE 1
9842 #     endif /* no CLSIZE */
9843 #    else /* no NBPG */
9844 #     ifdef NBPC
9845 #      define getpagesize() NBPC
9846 #     else /* no NBPC */
9847 #      ifdef PAGESIZE
9848 #       define getpagesize() PAGESIZE
9849 #      endif /* PAGESIZE */
9850 #     endif /* no NBPC */
9851 #    endif /* no NBPG */
9852 #   endif /* no EXEC_PAGESIZE */
9853 #  else /* no HAVE_SYS_PARAM_H */
9854 #   define getpagesize() 8192   /* punt totally */
9855 #  endif /* no HAVE_SYS_PARAM_H */
9856 # endif /* no _SC_PAGESIZE */
9857
9858 #endif /* no HAVE_GETPAGESIZE */
9859
9860 #ifdef __cplusplus
9861 extern "C" { void *malloc(unsigned); }
9862 #else
9863 char *malloc();
9864 #endif
9865
9866 int
9867 main()
9868 {
9869         char *data, *data2, *data3;
9870         int i, pagesize;
9871         int fd;
9872
9873         pagesize = getpagesize();
9874
9875         /*
9876          * First, make a file with some known garbage in it.
9877          */
9878         data = malloc(pagesize);
9879         if (!data)
9880                 exit(1);
9881         for (i = 0; i < pagesize; ++i)
9882                 *(data + i) = rand();
9883         umask(0);
9884         fd = creat("conftestmmap", 0600);
9885         if (fd < 0)
9886                 exit(1);
9887         if (write(fd, data, pagesize) != pagesize)
9888                 exit(1);
9889         close(fd);
9890
9891         /*
9892          * Next, try to mmap the file at a fixed address which
9893          * already has something else allocated at it.  If we can,
9894          * also make sure that we see the same garbage.
9895          */
9896         fd = open("conftestmmap", O_RDWR);
9897         if (fd < 0)
9898                 exit(1);
9899         data2 = malloc(2 * pagesize);
9900         if (!data2)
9901                 exit(1);
9902         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
9903         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
9904             MAP_PRIVATE | MAP_FIXED, fd, 0L))
9905                 exit(1);
9906         for (i = 0; i < pagesize; ++i)
9907                 if (*(data + i) != *(data2 + i))
9908                         exit(1);
9909
9910         /*
9911          * Finally, make sure that changes to the mapped area
9912          * do not percolate back to the file as seen by read().
9913          * (This is a bug on some variants of i386 svr4.0.)
9914          */
9915         for (i = 0; i < pagesize; ++i)
9916                 *(data2 + i) = *(data2 + i) + 1;
9917         data3 = malloc(pagesize);
9918         if (!data3)
9919                 exit(1);
9920         if (read(fd, data3, pagesize) != pagesize)
9921                 exit(1);
9922         for (i = 0; i < pagesize; ++i)
9923                 if (*(data + i) != *(data3 + i))
9924                         exit(1);
9925         close(fd);
9926         unlink("conftestmmap");
9927         exit(0);
9928 }
9929
9930 EOF
9931 if { (eval echo configure:9932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9932 then
9933   ac_cv_func_mmap_fixed_mapped=yes
9934 else
9935   conftest_rc="$?"
9936   echo "configure: failed program was:" >&5
9937   cat conftest.$ac_ext >&5
9938   rm -fr conftest*
9939   ac_cv_func_mmap_fixed_mapped=no
9940 fi
9941 rm -fr conftest*
9942
9943 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
9944 if test $ac_cv_func_mmap_fixed_mapped = yes; then
9945   { test "$extra_verbose" = "yes" && cat << \EOF
9946     Defining HAVE_MMAP
9947 EOF
9948 cat >> confdefs.h <<\EOF
9949 #define HAVE_MMAP 1
9950 EOF
9951 }
9952
9953 fi
9954
9955
9956 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9957 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9958 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9959     Defining REL_ALLOC
9960 EOF
9961 cat >> confdefs.h <<\EOF
9962 #define REL_ALLOC 1
9963 EOF
9964 }
9965
9966
9967 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
9968 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
9969 echo "configure:9970: checking for termios.h" >&5
9970
9971 cat > conftest.$ac_ext <<EOF
9972 #line 9973 "configure"
9973 #include "confdefs.h"
9974 #include <termios.h>
9975 EOF
9976 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9977 { (eval echo configure:9978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9978 ac_err=`grep -v '^ *+' conftest.out`
9979 if test -z "$ac_err"; then
9980   rm -rf conftest*
9981   eval "ac_cv_header_$ac_safe=yes"
9982 else
9983   echo "$ac_err" >&5
9984   echo "configure: failed program was:" >&5
9985   cat conftest.$ac_ext >&5
9986   rm -rf conftest*
9987   eval "ac_cv_header_$ac_safe=no"
9988 fi
9989 rm -f conftest*
9990 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9991   echo "$ac_t""yes" 1>&6
9992   { test "$extra_verbose" = "yes" && cat << \EOF
9993     Defining HAVE_TERMIOS
9994 EOF
9995 cat >> confdefs.h <<\EOF
9996 #define HAVE_TERMIOS 1
9997 EOF
9998 }
9999
10000   { test "$extra_verbose" = "yes" && cat << \EOF
10001     Defining SIGNALS_VIA_CHARACTERS
10002 EOF
10003 cat >> confdefs.h <<\EOF
10004 #define SIGNALS_VIA_CHARACTERS 1
10005 EOF
10006 }
10007
10008   { test "$extra_verbose" = "yes" && cat << \EOF
10009     Defining NO_TERMIO
10010 EOF
10011 cat >> confdefs.h <<\EOF
10012 #define NO_TERMIO 1
10013 EOF
10014 }
10015
10016 else
10017   echo "$ac_t""no" 1>&6
10018 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10019 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10020 echo "configure:10021: checking for termio.h" >&5
10021
10022 cat > conftest.$ac_ext <<EOF
10023 #line 10024 "configure"
10024 #include "confdefs.h"
10025 #include <termio.h>
10026 EOF
10027 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10028 { (eval echo configure:10029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10029 ac_err=`grep -v '^ *+' conftest.out`
10030 if test -z "$ac_err"; then
10031   rm -rf conftest*
10032   eval "ac_cv_header_$ac_safe=yes"
10033 else
10034   echo "$ac_err" >&5
10035   echo "configure: failed program was:" >&5
10036   cat conftest.$ac_ext >&5
10037   rm -rf conftest*
10038   eval "ac_cv_header_$ac_safe=no"
10039 fi
10040 rm -f conftest*
10041 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10042   echo "$ac_t""yes" 1>&6
10043   { test "$extra_verbose" = "yes" && cat << \EOF
10044     Defining HAVE_TERMIO
10045 EOF
10046 cat >> confdefs.h <<\EOF
10047 #define HAVE_TERMIO 1
10048 EOF
10049 }
10050
10051 else
10052   echo "$ac_t""no" 1>&6
10053 fi
10054
10055 fi
10056
10057
10058
10059 echo $ac_n "checking for socket""... $ac_c" 1>&6
10060 echo "configure:10061: checking for socket" >&5
10061
10062 cat > conftest.$ac_ext <<EOF
10063 #line 10064 "configure"
10064 #include "confdefs.h"
10065 /* System header to define __stub macros and hopefully few prototypes,
10066     which can conflict with char socket(); below.  */
10067 #include <assert.h>
10068 /* Override any gcc2 internal prototype to avoid an error.  */
10069 /* We use char because int might match the return type of a gcc2
10070     builtin and then its argument prototype would still apply.  */
10071 char socket();
10072
10073 int main() {
10074
10075 /* The GNU C library defines this for functions which it implements
10076     to always fail with ENOSYS.  Some functions are actually named
10077     something starting with __ and the normal name is an alias.  */
10078 #if defined (__stub_socket) || defined (__stub___socket)
10079 choke me
10080 #else
10081 socket();
10082 #endif
10083
10084 ; return 0; }
10085 EOF
10086 if { (eval echo configure:10087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10087   rm -rf conftest*
10088   eval "ac_cv_func_socket=yes"
10089 else
10090   echo "configure: failed program was:" >&5
10091   cat conftest.$ac_ext >&5
10092   rm -rf conftest*
10093   eval "ac_cv_func_socket=no"
10094 fi
10095 rm -f conftest*
10096
10097 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10098   echo "$ac_t""yes" 1>&6
10099   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10100 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10101 echo "configure:10102: checking for netinet/in.h" >&5
10102
10103 cat > conftest.$ac_ext <<EOF
10104 #line 10105 "configure"
10105 #include "confdefs.h"
10106 #include <netinet/in.h>
10107 EOF
10108 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10109 { (eval echo configure:10110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10110 ac_err=`grep -v '^ *+' conftest.out`
10111 if test -z "$ac_err"; then
10112   rm -rf conftest*
10113   eval "ac_cv_header_$ac_safe=yes"
10114 else
10115   echo "$ac_err" >&5
10116   echo "configure: failed program was:" >&5
10117   cat conftest.$ac_ext >&5
10118   rm -rf conftest*
10119   eval "ac_cv_header_$ac_safe=no"
10120 fi
10121 rm -f conftest*
10122 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10123   echo "$ac_t""yes" 1>&6
10124   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10125 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10126 echo "configure:10127: checking for arpa/inet.h" >&5
10127
10128 cat > conftest.$ac_ext <<EOF
10129 #line 10130 "configure"
10130 #include "confdefs.h"
10131 #include <arpa/inet.h>
10132 EOF
10133 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10134 { (eval echo configure:10135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10135 ac_err=`grep -v '^ *+' conftest.out`
10136 if test -z "$ac_err"; then
10137   rm -rf conftest*
10138   eval "ac_cv_header_$ac_safe=yes"
10139 else
10140   echo "$ac_err" >&5
10141   echo "configure: failed program was:" >&5
10142   cat conftest.$ac_ext >&5
10143   rm -rf conftest*
10144   eval "ac_cv_header_$ac_safe=no"
10145 fi
10146 rm -f conftest*
10147 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10148   echo "$ac_t""yes" 1>&6
10149   
10150   { test "$extra_verbose" = "yes" && cat << \EOF
10151     Defining HAVE_SOCKETS
10152 EOF
10153 cat >> confdefs.h <<\EOF
10154 #define HAVE_SOCKETS 1
10155 EOF
10156 }
10157
10158       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10159 echo "configure:10160: checking "for sun_len member in struct sockaddr_un"" >&5
10160       cat > conftest.$ac_ext <<EOF
10161 #line 10162 "configure"
10162 #include "confdefs.h"
10163
10164 #include <sys/types.h>
10165 #include <sys/socket.h>
10166 #include <sys/un.h>
10167       
10168 int main() {
10169 static struct sockaddr_un x; x.sun_len = 1;
10170 ; return 0; }
10171 EOF
10172 if { (eval echo configure:10173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10173   rm -rf conftest*
10174   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10175     Defining HAVE_SOCKADDR_SUN_LEN
10176 EOF
10177 cat >> confdefs.h <<\EOF
10178 #define HAVE_SOCKADDR_SUN_LEN 1
10179 EOF
10180 }
10181
10182 else
10183   echo "configure: failed program was:" >&5
10184   cat conftest.$ac_ext >&5
10185   rm -rf conftest*
10186   echo "$ac_t""no" 1>&6
10187 fi
10188 rm -f conftest*
10189       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10190 echo "configure:10191: checking "for ip_mreq struct in netinet/in.h"" >&5
10191       cat > conftest.$ac_ext <<EOF
10192 #line 10193 "configure"
10193 #include "confdefs.h"
10194
10195 #include <sys/types.h>
10196 #include <netinet/in.h>
10197       
10198 int main() {
10199 static struct ip_mreq x;
10200 ; return 0; }
10201 EOF
10202 if { (eval echo configure:10203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10203   rm -rf conftest*
10204   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10205     Defining HAVE_MULTICAST
10206 EOF
10207 cat >> confdefs.h <<\EOF
10208 #define HAVE_MULTICAST 1
10209 EOF
10210 }
10211
10212 else
10213   echo "configure: failed program was:" >&5
10214   cat conftest.$ac_ext >&5
10215   rm -rf conftest*
10216   echo "$ac_t""no" 1>&6
10217 fi
10218 rm -f conftest*
10219 else
10220   echo "$ac_t""no" 1>&6
10221 fi
10222
10223 else
10224   echo "$ac_t""no" 1>&6
10225 fi
10226
10227 else
10228   echo "$ac_t""no" 1>&6
10229 fi
10230
10231
10232 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10233 echo "configure:10234: checking for msgget" >&5
10234
10235 cat > conftest.$ac_ext <<EOF
10236 #line 10237 "configure"
10237 #include "confdefs.h"
10238 /* System header to define __stub macros and hopefully few prototypes,
10239     which can conflict with char msgget(); below.  */
10240 #include <assert.h>
10241 /* Override any gcc2 internal prototype to avoid an error.  */
10242 /* We use char because int might match the return type of a gcc2
10243     builtin and then its argument prototype would still apply.  */
10244 char msgget();
10245
10246 int main() {
10247
10248 /* The GNU C library defines this for functions which it implements
10249     to always fail with ENOSYS.  Some functions are actually named
10250     something starting with __ and the normal name is an alias.  */
10251 #if defined (__stub_msgget) || defined (__stub___msgget)
10252 choke me
10253 #else
10254 msgget();
10255 #endif
10256
10257 ; return 0; }
10258 EOF
10259 if { (eval echo configure:10260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10260   rm -rf conftest*
10261   eval "ac_cv_func_msgget=yes"
10262 else
10263   echo "configure: failed program was:" >&5
10264   cat conftest.$ac_ext >&5
10265   rm -rf conftest*
10266   eval "ac_cv_func_msgget=no"
10267 fi
10268 rm -f conftest*
10269
10270 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10271   echo "$ac_t""yes" 1>&6
10272   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10273 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10274 echo "configure:10275: checking for sys/ipc.h" >&5
10275
10276 cat > conftest.$ac_ext <<EOF
10277 #line 10278 "configure"
10278 #include "confdefs.h"
10279 #include <sys/ipc.h>
10280 EOF
10281 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10282 { (eval echo configure:10283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10283 ac_err=`grep -v '^ *+' conftest.out`
10284 if test -z "$ac_err"; then
10285   rm -rf conftest*
10286   eval "ac_cv_header_$ac_safe=yes"
10287 else
10288   echo "$ac_err" >&5
10289   echo "configure: failed program was:" >&5
10290   cat conftest.$ac_ext >&5
10291   rm -rf conftest*
10292   eval "ac_cv_header_$ac_safe=no"
10293 fi
10294 rm -f conftest*
10295 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10296   echo "$ac_t""yes" 1>&6
10297   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10298 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10299 echo "configure:10300: checking for sys/msg.h" >&5
10300
10301 cat > conftest.$ac_ext <<EOF
10302 #line 10303 "configure"
10303 #include "confdefs.h"
10304 #include <sys/msg.h>
10305 EOF
10306 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10307 { (eval echo configure:10308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10308 ac_err=`grep -v '^ *+' conftest.out`
10309 if test -z "$ac_err"; then
10310   rm -rf conftest*
10311   eval "ac_cv_header_$ac_safe=yes"
10312 else
10313   echo "$ac_err" >&5
10314   echo "configure: failed program was:" >&5
10315   cat conftest.$ac_ext >&5
10316   rm -rf conftest*
10317   eval "ac_cv_header_$ac_safe=no"
10318 fi
10319 rm -f conftest*
10320 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10321   echo "$ac_t""yes" 1>&6
10322   { test "$extra_verbose" = "yes" && cat << \EOF
10323     Defining HAVE_SYSVIPC
10324 EOF
10325 cat >> confdefs.h <<\EOF
10326 #define HAVE_SYSVIPC 1
10327 EOF
10328 }
10329
10330 else
10331   echo "$ac_t""no" 1>&6
10332 fi
10333
10334 else
10335   echo "$ac_t""no" 1>&6
10336 fi
10337
10338 else
10339   echo "$ac_t""no" 1>&6
10340 fi
10341
10342
10343 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10344 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10345 echo "configure:10346: checking for dirent.h" >&5
10346
10347 cat > conftest.$ac_ext <<EOF
10348 #line 10349 "configure"
10349 #include "confdefs.h"
10350 #include <dirent.h>
10351 EOF
10352 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10353 { (eval echo configure:10354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10354 ac_err=`grep -v '^ *+' conftest.out`
10355 if test -z "$ac_err"; then
10356   rm -rf conftest*
10357   eval "ac_cv_header_$ac_safe=yes"
10358 else
10359   echo "$ac_err" >&5
10360   echo "configure: failed program was:" >&5
10361   cat conftest.$ac_ext >&5
10362   rm -rf conftest*
10363   eval "ac_cv_header_$ac_safe=no"
10364 fi
10365 rm -f conftest*
10366 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10367   echo "$ac_t""yes" 1>&6
10368   { test "$extra_verbose" = "yes" && cat << \EOF
10369     Defining SYSV_SYSTEM_DIR
10370 EOF
10371 cat >> confdefs.h <<\EOF
10372 #define SYSV_SYSTEM_DIR 1
10373 EOF
10374 }
10375
10376 else
10377   echo "$ac_t""no" 1>&6
10378 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10379 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10380 echo "configure:10381: checking for sys/dir.h" >&5
10381
10382 cat > conftest.$ac_ext <<EOF
10383 #line 10384 "configure"
10384 #include "confdefs.h"
10385 #include <sys/dir.h>
10386 EOF
10387 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10388 { (eval echo configure:10389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10389 ac_err=`grep -v '^ *+' conftest.out`
10390 if test -z "$ac_err"; then
10391   rm -rf conftest*
10392   eval "ac_cv_header_$ac_safe=yes"
10393 else
10394   echo "$ac_err" >&5
10395   echo "configure: failed program was:" >&5
10396   cat conftest.$ac_ext >&5
10397   rm -rf conftest*
10398   eval "ac_cv_header_$ac_safe=no"
10399 fi
10400 rm -f conftest*
10401 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10402   echo "$ac_t""yes" 1>&6
10403   :
10404 else
10405   echo "$ac_t""no" 1>&6
10406 { test "$extra_verbose" = "yes" && cat << \EOF
10407     Defining NONSYSTEM_DIR_LIBRARY
10408 EOF
10409 cat >> confdefs.h <<\EOF
10410 #define NONSYSTEM_DIR_LIBRARY 1
10411 EOF
10412 }
10413
10414 fi
10415
10416 fi
10417
10418
10419 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10420 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10421 echo "configure:10422: checking for nlist.h" >&5
10422
10423 cat > conftest.$ac_ext <<EOF
10424 #line 10425 "configure"
10425 #include "confdefs.h"
10426 #include <nlist.h>
10427 EOF
10428 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10429 { (eval echo configure:10430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10430 ac_err=`grep -v '^ *+' conftest.out`
10431 if test -z "$ac_err"; then
10432   rm -rf conftest*
10433   eval "ac_cv_header_$ac_safe=yes"
10434 else
10435   echo "$ac_err" >&5
10436   echo "configure: failed program was:" >&5
10437   cat conftest.$ac_ext >&5
10438   rm -rf conftest*
10439   eval "ac_cv_header_$ac_safe=no"
10440 fi
10441 rm -f conftest*
10442 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10443   echo "$ac_t""yes" 1>&6
10444   { test "$extra_verbose" = "yes" && cat << \EOF
10445     Defining NLIST_STRUCT
10446 EOF
10447 cat >> confdefs.h <<\EOF
10448 #define NLIST_STRUCT 1
10449 EOF
10450 }
10451
10452 else
10453   echo "$ac_t""no" 1>&6
10454 fi
10455
10456
10457
10458 echo "checking "for sound support"" 1>&6
10459 echo "configure:10460: checking "for sound support"" >&5
10460 case "$with_sound" in
10461   native | both ) with_native_sound=yes;;
10462   nas    | no   ) with_native_sound=no;;
10463 esac
10464 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10465
10466 if test "$with_native_sound" != "no"; then
10467     if test -n "$native_sound_lib"; then
10468     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10469 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10470 echo "configure:10471: checking for multimedia/audio_device.h" >&5
10471
10472 cat > conftest.$ac_ext <<EOF
10473 #line 10474 "configure"
10474 #include "confdefs.h"
10475 #include <multimedia/audio_device.h>
10476 EOF
10477 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10478 { (eval echo configure:10479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10479 ac_err=`grep -v '^ *+' conftest.out`
10480 if test -z "$ac_err"; then
10481   rm -rf conftest*
10482   eval "ac_cv_header_$ac_safe=yes"
10483 else
10484   echo "$ac_err" >&5
10485   echo "configure: failed program was:" >&5
10486   cat conftest.$ac_ext >&5
10487   rm -rf conftest*
10488   eval "ac_cv_header_$ac_safe=no"
10489 fi
10490 rm -f conftest*
10491 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10492   echo "$ac_t""yes" 1>&6
10493   sound_found=yes sound_cflags=""
10494       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10495    echo "    xemacs will be linked with \"sunplay.o\""
10496  fi
10497 else
10498   echo "$ac_t""no" 1>&6
10499 fi
10500
10501   fi
10502
10503     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10504     sound_found=yes
10505     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10506    echo "    xemacs will be linked with \"sunplay.o\""
10507  fi
10508     if test -d "/usr/demo/SOUND/include"
10509       then sound_cflags="-I/usr/demo/SOUND/include"
10510       else sound_cflags="-I/usr/demo/SOUND"
10511     fi
10512     if test -z "$native_sound_lib" ; then
10513       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10514         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10515         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10516       fi
10517     fi
10518   fi
10519
10520     if test -z "$sound_found"; then
10521     case "$canonical" in
10522     *-sgi-* )
10523       if test -z "$native_sound_lib"; then
10524         
10525 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10526 echo "configure:10527: checking for ALopenport in -laudio" >&5
10527 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10528
10529 xe_check_libs=" -laudio "
10530 cat > conftest.$ac_ext <<EOF
10531 #line 10532 "configure"
10532 #include "confdefs.h"
10533 /* Override any gcc2 internal prototype to avoid an error.  */
10534 /* We use char because int might match the return type of a gcc2
10535     builtin and then its argument prototype would still apply.  */
10536 char ALopenport();
10537
10538 int main() {
10539 ALopenport()
10540 ; return 0; }
10541 EOF
10542 if { (eval echo configure:10543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10543   rm -rf conftest*
10544   eval "ac_cv_lib_$ac_lib_var=yes"
10545 else
10546   echo "configure: failed program was:" >&5
10547   cat conftest.$ac_ext >&5
10548   rm -rf conftest*
10549   eval "ac_cv_lib_$ac_lib_var=no"
10550 fi
10551 rm -f conftest*
10552 xe_check_libs=""
10553
10554 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10555   echo "$ac_t""yes" 1>&6
10556   native_sound_lib="-laudio"
10557 else
10558   echo "$ac_t""no" 1>&6
10559 fi
10560
10561
10562       fi
10563       if test -n "$native_sound_lib"; then
10564         sound_found=yes sound_cflags=""
10565         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10566    echo "    xemacs will be linked with \"sgiplay.o\""
10567  fi
10568       fi ;;
10569     hppa*-hp-hpux* )
10570       if test -z "$native_sound_lib"; then
10571         
10572 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10573 echo "configure:10574: checking for AOpenAudio in -lAlib" >&5
10574 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10575
10576 xe_check_libs=" -lAlib "
10577 cat > conftest.$ac_ext <<EOF
10578 #line 10579 "configure"
10579 #include "confdefs.h"
10580 /* Override any gcc2 internal prototype to avoid an error.  */
10581 /* We use char because int might match the return type of a gcc2
10582     builtin and then its argument prototype would still apply.  */
10583 char AOpenAudio();
10584
10585 int main() {
10586 AOpenAudio()
10587 ; return 0; }
10588 EOF
10589 if { (eval echo configure:10590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10590   rm -rf conftest*
10591   eval "ac_cv_lib_$ac_lib_var=yes"
10592 else
10593   echo "configure: failed program was:" >&5
10594   cat conftest.$ac_ext >&5
10595   rm -rf conftest*
10596   eval "ac_cv_lib_$ac_lib_var=no"
10597 fi
10598 rm -f conftest*
10599 xe_check_libs=""
10600
10601 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10602   echo "$ac_t""yes" 1>&6
10603   native_sound_lib="-lAlib"
10604 else
10605   echo "$ac_t""no" 1>&6
10606 fi
10607
10608
10609       fi
10610       if test -n "$native_sound_lib"; then
10611         sound_found=yes
10612         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10613    echo "    xemacs will be linked with \"hpplay.o\""
10614  fi
10615         if test "$GCC" = "yes" # Kludge city
10616           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10617           else sound_cflags="+e -I/usr/audio/examples"
10618         fi
10619       fi ;;
10620     esac
10621   fi
10622
10623     if test -z "$sound_found"; then
10624     for dir in "machine" "sys" "linux"; do
10625       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10626 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10627 echo "configure:10628: checking for ${dir}/soundcard.h" >&5
10628
10629 cat > conftest.$ac_ext <<EOF
10630 #line 10631 "configure"
10631 #include "confdefs.h"
10632 #include <${dir}/soundcard.h>
10633 EOF
10634 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10635 { (eval echo configure:10636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10636 ac_err=`grep -v '^ *+' conftest.out`
10637 if test -z "$ac_err"; then
10638   rm -rf conftest*
10639   eval "ac_cv_header_$ac_safe=yes"
10640 else
10641   echo "$ac_err" >&5
10642   echo "configure: failed program was:" >&5
10643   cat conftest.$ac_ext >&5
10644   rm -rf conftest*
10645   eval "ac_cv_header_$ac_safe=no"
10646 fi
10647 rm -f conftest*
10648 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10649   echo "$ac_t""yes" 1>&6
10650   sound_found=yes
10651         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10652    echo "    xemacs will be linked with \"linuxplay.o\""
10653  fi
10654         { test "$extra_verbose" = "yes" && cat << EOF
10655     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10656 EOF
10657 cat >> confdefs.h <<EOF
10658 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10659 EOF
10660 }
10661
10662         break
10663 else
10664   echo "$ac_t""no" 1>&6
10665 fi
10666
10667     done
10668   fi
10669
10670   test "$sound_found" = "yes" && with_native_sound=yes
10671 fi
10672
10673 if test -z "$with_sound"; then
10674   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10675     with_sound=native
10676   fi
10677 fi
10678
10679 if test "$with_native_sound" = "yes"; then
10680   { test "$extra_verbose" = "yes" && cat << \EOF
10681     Defining HAVE_NATIVE_SOUND
10682 EOF
10683 cat >> confdefs.h <<\EOF
10684 #define HAVE_NATIVE_SOUND 1
10685 EOF
10686 }
10687
10688   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10689 fi
10690
10691 case "$with_sound" in both | nas )
10692   { test "$extra_verbose" = "yes" && cat << \EOF
10693     Defining HAVE_NAS_SOUND
10694 EOF
10695 cat >> confdefs.h <<\EOF
10696 #define HAVE_NAS_SOUND 1
10697 EOF
10698 }
10699
10700   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10701    echo "    xemacs will be linked with \"nas.o\""
10702  fi
10703   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10704       cat > conftest.$ac_ext <<EOF
10705 #line 10706 "configure"
10706 #include "confdefs.h"
10707 #include <audio/Xtutil.h>
10708 EOF
10709 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10710   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10711   :
10712 else
10713   rm -rf conftest*
10714   { test "$extra_verbose" = "yes" && cat << \EOF
10715     Defining NAS_NO_ERROR_JUMP
10716 EOF
10717 cat >> confdefs.h <<\EOF
10718 #define NAS_NO_ERROR_JUMP 1
10719 EOF
10720 }
10721
10722 fi
10723 rm -f conftest*
10724
10725 esac
10726
10727
10728 test -z "$with_tty" && with_tty=yes
10729
10730 if test "$with_tty" = "yes"  ; then
10731   echo "checking for TTY-related features" 1>&6
10732 echo "configure:10733: checking for TTY-related features" >&5
10733   { test "$extra_verbose" = "yes" && cat << \EOF
10734     Defining HAVE_TTY
10735 EOF
10736 cat >> confdefs.h <<\EOF
10737 #define HAVE_TTY 1
10738 EOF
10739 }
10740
10741   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
10742    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\""
10743  fi
10744
10745     if test -z "$with_ncurses"; then
10746     
10747 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10748 echo "configure:10749: checking for tgetent in -lncurses" >&5
10749 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10750
10751 xe_check_libs=" -lncurses "
10752 cat > conftest.$ac_ext <<EOF
10753 #line 10754 "configure"
10754 #include "confdefs.h"
10755 /* Override any gcc2 internal prototype to avoid an error.  */
10756 /* We use char because int might match the return type of a gcc2
10757     builtin and then its argument prototype would still apply.  */
10758 char tgetent();
10759
10760 int main() {
10761 tgetent()
10762 ; return 0; }
10763 EOF
10764 if { (eval echo configure:10765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10765   rm -rf conftest*
10766   eval "ac_cv_lib_$ac_lib_var=yes"
10767 else
10768   echo "configure: failed program was:" >&5
10769   cat conftest.$ac_ext >&5
10770   rm -rf conftest*
10771   eval "ac_cv_lib_$ac_lib_var=no"
10772 fi
10773 rm -f conftest*
10774 xe_check_libs=""
10775
10776 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10777   echo "$ac_t""yes" 1>&6
10778   with_ncurses=yes
10779 else
10780   echo "$ac_t""no" 1>&6
10781 with_ncurses=no
10782 fi
10783
10784
10785   fi
10786   if test "$with_ncurses" = "yes"; then
10787     { test "$extra_verbose" = "yes" && cat << \EOF
10788     Defining HAVE_NCURSES
10789 EOF
10790 cat >> confdefs.h <<\EOF
10791 #define HAVE_NCURSES 1
10792 EOF
10793 }
10794
10795     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10796 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10797 echo "configure:10798: checking for ncurses/curses.h" >&5
10798
10799 cat > conftest.$ac_ext <<EOF
10800 #line 10801 "configure"
10801 #include "confdefs.h"
10802 #include <ncurses/curses.h>
10803 EOF
10804 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10805 { (eval echo configure:10806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10806 ac_err=`grep -v '^ *+' conftest.out`
10807 if test -z "$ac_err"; then
10808   rm -rf conftest*
10809   eval "ac_cv_header_$ac_safe=yes"
10810 else
10811   echo "$ac_err" >&5
10812   echo "configure: failed program was:" >&5
10813   cat conftest.$ac_ext >&5
10814   rm -rf conftest*
10815   eval "ac_cv_header_$ac_safe=no"
10816 fi
10817 rm -f conftest*
10818 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10819   echo "$ac_t""yes" 1>&6
10820   curses_h_path=ncurses/curses.h
10821 else
10822   echo "$ac_t""no" 1>&6
10823 fi
10824
10825     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10826 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10827 echo "configure:10828: checking for ncurses/term.h" >&5
10828
10829 cat > conftest.$ac_ext <<EOF
10830 #line 10831 "configure"
10831 #include "confdefs.h"
10832 #include <ncurses/term.h>
10833 EOF
10834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10835 { (eval echo configure:10836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10836 ac_err=`grep -v '^ *+' conftest.out`
10837 if test -z "$ac_err"; then
10838   rm -rf conftest*
10839   eval "ac_cv_header_$ac_safe=yes"
10840 else
10841   echo "$ac_err" >&5
10842   echo "configure: failed program was:" >&5
10843   cat conftest.$ac_ext >&5
10844   rm -rf conftest*
10845   eval "ac_cv_header_$ac_safe=no"
10846 fi
10847 rm -f conftest*
10848 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10849   echo "$ac_t""yes" 1>&6
10850   term_h_path=ncurses/term.h
10851 else
10852   echo "$ac_t""no" 1>&6
10853 fi
10854
10855     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10856    echo "    xemacs will be linked with \"terminfo.o\""
10857  fi
10858     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10859
10860     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10861                         save_c_switch_site="$c_switch_site"
10862       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10863       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10864 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10865 echo "configure:10866: checking for ncurses/curses.h" >&5
10866
10867 cat > conftest.$ac_ext <<EOF
10868 #line 10869 "configure"
10869 #include "confdefs.h"
10870 #include <ncurses/curses.h>
10871 EOF
10872 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10873 { (eval echo configure:10874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10874 ac_err=`grep -v '^ *+' conftest.out`
10875 if test -z "$ac_err"; then
10876   rm -rf conftest*
10877   eval "ac_cv_header_$ac_safe=yes"
10878 else
10879   echo "$ac_err" >&5
10880   echo "configure: failed program was:" >&5
10881   cat conftest.$ac_ext >&5
10882   rm -rf conftest*
10883   eval "ac_cv_header_$ac_safe=no"
10884 fi
10885 rm -f conftest*
10886 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10887   echo "$ac_t""yes" 1>&6
10888   curses_h_path=ncurses/curses.h
10889 else
10890   echo "$ac_t""no" 1>&6
10891 fi
10892
10893       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10894         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10895         else c_switch_site="$save_c_switch_site"
10896       fi
10897     fi
10898   else         if test "$have_terminfo" = "yes"; then
10899       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10900    echo "    xemacs will be linked with \"terminfo.o\""
10901  fi
10902       if test -n "$libs_termcap"; then
10903         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10904       else
10905         for lib in curses termlib termcap; do
10906           
10907 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10908 echo "configure:10909: checking for tgetent in -l$lib" >&5
10909 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10910
10911 xe_check_libs=" -l$lib "
10912 cat > conftest.$ac_ext <<EOF
10913 #line 10914 "configure"
10914 #include "confdefs.h"
10915 /* Override any gcc2 internal prototype to avoid an error.  */
10916 /* We use char because int might match the return type of a gcc2
10917     builtin and then its argument prototype would still apply.  */
10918 char tgetent();
10919
10920 int main() {
10921 tgetent()
10922 ; return 0; }
10923 EOF
10924 if { (eval echo configure:10925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10925   rm -rf conftest*
10926   eval "ac_cv_lib_$ac_lib_var=yes"
10927 else
10928   echo "configure: failed program was:" >&5
10929   cat conftest.$ac_ext >&5
10930   rm -rf conftest*
10931   eval "ac_cv_lib_$ac_lib_var=no"
10932 fi
10933 rm -f conftest*
10934 xe_check_libs=""
10935
10936 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10937   echo "$ac_t""yes" 1>&6
10938   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10939 else
10940   echo "$ac_t""no" 1>&6
10941 fi
10942
10943
10944         done
10945       fi
10946     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10947    echo "    xemacs will be linked with \"tparam.o\""
10948  fi
10949                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10950       if test -n "$libs_termcap"; then
10951         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10952       else
10953         
10954 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10955 echo "configure:10956: checking for tgetent in -lcurses" >&5
10956 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10957
10958 xe_check_libs=" -lcurses "
10959 cat > conftest.$ac_ext <<EOF
10960 #line 10961 "configure"
10961 #include "confdefs.h"
10962 /* Override any gcc2 internal prototype to avoid an error.  */
10963 /* We use char because int might match the return type of a gcc2
10964     builtin and then its argument prototype would still apply.  */
10965 char tgetent();
10966
10967 int main() {
10968 tgetent()
10969 ; return 0; }
10970 EOF
10971 if { (eval echo configure:10972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10972   rm -rf conftest*
10973   eval "ac_cv_lib_$ac_lib_var=yes"
10974 else
10975   echo "configure: failed program was:" >&5
10976   cat conftest.$ac_ext >&5
10977   rm -rf conftest*
10978   eval "ac_cv_lib_$ac_lib_var=no"
10979 fi
10980 rm -f conftest*
10981 xe_check_libs=""
10982
10983 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10984   echo "$ac_t""yes" 1>&6
10985   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
10986 else
10987   echo "$ac_t""no" 1>&6
10988 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
10989 echo "configure:10990: checking for tgetent in -ltermcap" >&5
10990 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
10991
10992 xe_check_libs=" -ltermcap "
10993 cat > conftest.$ac_ext <<EOF
10994 #line 10995 "configure"
10995 #include "confdefs.h"
10996 /* Override any gcc2 internal prototype to avoid an error.  */
10997 /* We use char because int might match the return type of a gcc2
10998     builtin and then its argument prototype would still apply.  */
10999 char tgetent();
11000
11001 int main() {
11002 tgetent()
11003 ; return 0; }
11004 EOF
11005 if { (eval echo configure:11006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11006   rm -rf conftest*
11007   eval "ac_cv_lib_$ac_lib_var=yes"
11008 else
11009   echo "configure: failed program was:" >&5
11010   cat conftest.$ac_ext >&5
11011   rm -rf conftest*
11012   eval "ac_cv_lib_$ac_lib_var=no"
11013 fi
11014 rm -f conftest*
11015 xe_check_libs=""
11016
11017 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11018   echo "$ac_t""yes" 1>&6
11019   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11020 else
11021   echo "$ac_t""no" 1>&6
11022 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11023    echo "    xemacs will be linked with \"termcap.o\""
11024  fi
11025 fi
11026
11027
11028 fi
11029
11030
11031       fi
11032     fi
11033   fi
11034   { test "$extra_verbose" = "yes" && cat << EOF
11035     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11036 EOF
11037 cat >> confdefs.h <<EOF
11038 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11039 EOF
11040 }
11041
11042   { test "$extra_verbose" = "yes" && cat << EOF
11043     Defining TERM_H_PATH = "${term_h_path-term.h}"
11044 EOF
11045 cat >> confdefs.h <<EOF
11046 #define TERM_H_PATH "${term_h_path-term.h}"
11047 EOF
11048 }
11049
11050
11051     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11052 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11053 echo "configure:11054: checking for gpm.h" >&5
11054
11055 cat > conftest.$ac_ext <<EOF
11056 #line 11057 "configure"
11057 #include "confdefs.h"
11058 #include <gpm.h>
11059 EOF
11060 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11061 { (eval echo configure:11062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11062 ac_err=`grep -v '^ *+' conftest.out`
11063 if test -z "$ac_err"; then
11064   rm -rf conftest*
11065   eval "ac_cv_header_$ac_safe=yes"
11066 else
11067   echo "$ac_err" >&5
11068   echo "configure: failed program was:" >&5
11069   cat conftest.$ac_ext >&5
11070   rm -rf conftest*
11071   eval "ac_cv_header_$ac_safe=no"
11072 fi
11073 rm -f conftest*
11074 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11075   echo "$ac_t""yes" 1>&6
11076   :
11077 else
11078   echo "$ac_t""no" 1>&6
11079 with_gpm=no
11080 fi
11081  }
11082   test -z "$with_gpm" && { 
11083 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11084 echo "configure:11085: checking for Gpm_Open in -lgpm" >&5
11085 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11086
11087 xe_check_libs=" -lgpm "
11088 cat > conftest.$ac_ext <<EOF
11089 #line 11090 "configure"
11090 #include "confdefs.h"
11091 /* Override any gcc2 internal prototype to avoid an error.  */
11092 /* We use char because int might match the return type of a gcc2
11093     builtin and then its argument prototype would still apply.  */
11094 char Gpm_Open();
11095
11096 int main() {
11097 Gpm_Open()
11098 ; return 0; }
11099 EOF
11100 if { (eval echo configure:11101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11101   rm -rf conftest*
11102   eval "ac_cv_lib_$ac_lib_var=yes"
11103 else
11104   echo "configure: failed program was:" >&5
11105   cat conftest.$ac_ext >&5
11106   rm -rf conftest*
11107   eval "ac_cv_lib_$ac_lib_var=no"
11108 fi
11109 rm -f conftest*
11110 xe_check_libs=""
11111
11112 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11113   echo "$ac_t""yes" 1>&6
11114   with_gpm=yes
11115 else
11116   echo "$ac_t""no" 1>&6
11117 with_gpm=no
11118 fi
11119
11120  }
11121   if test "$with_gpm" = "yes"; then
11122     { test "$extra_verbose" = "yes" && cat << \EOF
11123     Defining HAVE_GPM
11124 EOF
11125 cat >> confdefs.h <<\EOF
11126 #define HAVE_GPM 1
11127 EOF
11128 }
11129
11130     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11131    echo "    xemacs will be linked with \"gpmevent.o\""
11132  fi
11133     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11134   fi
11135
11136 else   for feature in ncurses gpm; do
11137     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11138       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11139     fi
11140     eval "with_${feature}=no"
11141   done
11142 fi 
11143 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11144    echo "    xemacs will be linked with \"event-unixoid.o\""
11145  fi
11146
11147
11148 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11149   != "no no no" && echo "checking for database support" 1>&6
11150 echo "configure:11151: checking for database support" >&5
11151
11152 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11153   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11154 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11155 echo "configure:11156: checking for ndbm.h" >&5
11156
11157 cat > conftest.$ac_ext <<EOF
11158 #line 11159 "configure"
11159 #include "confdefs.h"
11160 #include <ndbm.h>
11161 EOF
11162 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11163 { (eval echo configure:11164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11164 ac_err=`grep -v '^ *+' conftest.out`
11165 if test -z "$ac_err"; then
11166   rm -rf conftest*
11167   eval "ac_cv_header_$ac_safe=yes"
11168 else
11169   echo "$ac_err" >&5
11170   echo "configure: failed program was:" >&5
11171   cat conftest.$ac_ext >&5
11172   rm -rf conftest*
11173   eval "ac_cv_header_$ac_safe=no"
11174 fi
11175 rm -f conftest*
11176 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11177   echo "$ac_t""yes" 1>&6
11178   :
11179 else
11180   echo "$ac_t""no" 1>&6
11181
11182     test "$with_database_gnudbm" = "yes" -o \
11183          "$with_database_dbm"    = "yes" && \
11184       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11185     with_database_gnudbm=no with_database_dbm=no
11186 fi
11187
11188 fi
11189
11190 if test "$with_database_gnudbm" != "no"; then
11191   
11192 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11193 echo "configure:11194: checking for dbm_open in -lgdbm" >&5
11194 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11195
11196 xe_check_libs=" -lgdbm "
11197 cat > conftest.$ac_ext <<EOF
11198 #line 11199 "configure"
11199 #include "confdefs.h"
11200 /* Override any gcc2 internal prototype to avoid an error.  */
11201 /* We use char because int might match the return type of a gcc2
11202     builtin and then its argument prototype would still apply.  */
11203 char dbm_open();
11204
11205 int main() {
11206 dbm_open()
11207 ; return 0; }
11208 EOF
11209 if { (eval echo configure:11210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11210   rm -rf conftest*
11211   eval "ac_cv_lib_$ac_lib_var=yes"
11212 else
11213   echo "configure: failed program was:" >&5
11214   cat conftest.$ac_ext >&5
11215   rm -rf conftest*
11216   eval "ac_cv_lib_$ac_lib_var=no"
11217 fi
11218 rm -f conftest*
11219 xe_check_libs=""
11220
11221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11222   echo "$ac_t""yes" 1>&6
11223   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11224 else
11225   echo "$ac_t""no" 1>&6
11226 if test "$with_database_gnudbm" = "yes"; then
11227      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11228    fi
11229    with_database_gnudbm=no
11230 fi
11231
11232
11233 fi
11234
11235 if test "$with_database_dbm" != "no"; then
11236   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11237 echo "configure:11238: checking for dbm_open" >&5
11238
11239 cat > conftest.$ac_ext <<EOF
11240 #line 11241 "configure"
11241 #include "confdefs.h"
11242 /* System header to define __stub macros and hopefully few prototypes,
11243     which can conflict with char dbm_open(); below.  */
11244 #include <assert.h>
11245 /* Override any gcc2 internal prototype to avoid an error.  */
11246 /* We use char because int might match the return type of a gcc2
11247     builtin and then its argument prototype would still apply.  */
11248 char dbm_open();
11249
11250 int main() {
11251
11252 /* The GNU C library defines this for functions which it implements
11253     to always fail with ENOSYS.  Some functions are actually named
11254     something starting with __ and the normal name is an alias.  */
11255 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11256 choke me
11257 #else
11258 dbm_open();
11259 #endif
11260
11261 ; return 0; }
11262 EOF
11263 if { (eval echo configure:11264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11264   rm -rf conftest*
11265   eval "ac_cv_func_dbm_open=yes"
11266 else
11267   echo "configure: failed program was:" >&5
11268   cat conftest.$ac_ext >&5
11269   rm -rf conftest*
11270   eval "ac_cv_func_dbm_open=no"
11271 fi
11272 rm -f conftest*
11273
11274 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11275   echo "$ac_t""yes" 1>&6
11276   with_database_dbm=yes libdbm=
11277 else
11278   echo "$ac_t""no" 1>&6
11279
11280     
11281 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11282 echo "configure:11283: checking for dbm_open in -ldbm" >&5
11283 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11284
11285 xe_check_libs=" -ldbm "
11286 cat > conftest.$ac_ext <<EOF
11287 #line 11288 "configure"
11288 #include "confdefs.h"
11289 /* Override any gcc2 internal prototype to avoid an error.  */
11290 /* We use char because int might match the return type of a gcc2
11291     builtin and then its argument prototype would still apply.  */
11292 char dbm_open();
11293
11294 int main() {
11295 dbm_open()
11296 ; return 0; }
11297 EOF
11298 if { (eval echo configure:11299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11299   rm -rf conftest*
11300   eval "ac_cv_lib_$ac_lib_var=yes"
11301 else
11302   echo "configure: failed program was:" >&5
11303   cat conftest.$ac_ext >&5
11304   rm -rf conftest*
11305   eval "ac_cv_lib_$ac_lib_var=no"
11306 fi
11307 rm -f conftest*
11308 xe_check_libs=""
11309
11310 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11311   echo "$ac_t""yes" 1>&6
11312   with_database_dbm=yes libdbm=-ldbm
11313 else
11314   echo "$ac_t""no" 1>&6
11315 test "$with_database_dbm" = "yes" && \
11316         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11317       with_database_dbm=no
11318 fi
11319
11320
11321 fi
11322
11323 fi
11324
11325 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11326 test "$with_database_gnudbm" = "yes" -o \
11327      "$with_database_dbm"    = "yes" && \
11328   { test "$extra_verbose" = "yes" && cat << \EOF
11329     Defining HAVE_DBM
11330 EOF
11331 cat >> confdefs.h <<\EOF
11332 #define HAVE_DBM 1
11333 EOF
11334 }
11335
11336
11337 if test "$with_database_berkdb" != "no"; then
11338   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11339 echo "configure:11340: checking for Berkeley db.h" >&5
11340   for path in "db/db.h" "db.h"; do
11341     cat > conftest.$ac_ext <<EOF
11342 #line 11343 "configure"
11343 #include "confdefs.h"
11344 #ifdef HAVE_INTTYPES_H
11345 #define __BIT_TYPES_DEFINED__
11346 #include <inttypes.h>
11347 typedef uint8_t  u_int8_t;
11348 typedef uint16_t u_int16_t;
11349 typedef uint32_t u_int32_t;
11350 #ifdef WE_DONT_NEED_QUADS
11351 typedef uint64_t u_int64_t;
11352 #endif
11353 #endif
11354 #include <$path>
11355
11356 int main() {
11357
11358 ; return 0; }
11359 EOF
11360 if { (eval echo configure:11361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11361   rm -rf conftest*
11362   db_h_path="$path"; break
11363 else
11364   echo "configure: failed program was:" >&5
11365   cat conftest.$ac_ext >&5
11366 fi
11367 rm -f conftest*
11368   done
11369   if test -z "$db_h_path"
11370   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11371   else echo "$ac_t""$db_h_path" 1>&6
11372   fi
11373
11374   if test "$with_database_berkdb" != "no"; then
11375     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11376 echo "configure:11377: checking for Berkeley DB version" >&5
11377     cat > conftest.$ac_ext <<EOF
11378 #line 11379 "configure"
11379 #include "confdefs.h"
11380 #include <$db_h_path>
11381 #if DB_VERSION_MAJOR > 1
11382 yes
11383 #endif
11384
11385 EOF
11386 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11387   egrep "yes" >/dev/null 2>&1; then
11388   rm -rf conftest*
11389   echo "$ac_t""2" 1>&6; dbfunc=db_open
11390 else
11391   rm -rf conftest*
11392   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11393 fi
11394 rm -f conftest*
11395
11396     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11397 echo "configure:11398: checking for $dbfunc" >&5
11398
11399 cat > conftest.$ac_ext <<EOF
11400 #line 11401 "configure"
11401 #include "confdefs.h"
11402 /* System header to define __stub macros and hopefully few prototypes,
11403     which can conflict with char $dbfunc(); below.  */
11404 #include <assert.h>
11405 /* Override any gcc2 internal prototype to avoid an error.  */
11406 /* We use char because int might match the return type of a gcc2
11407     builtin and then its argument prototype would still apply.  */
11408 char $dbfunc();
11409
11410 int main() {
11411
11412 /* The GNU C library defines this for functions which it implements
11413     to always fail with ENOSYS.  Some functions are actually named
11414     something starting with __ and the normal name is an alias.  */
11415 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11416 choke me
11417 #else
11418 $dbfunc();
11419 #endif
11420
11421 ; return 0; }
11422 EOF
11423 if { (eval echo configure:11424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11424   rm -rf conftest*
11425   eval "ac_cv_func_$dbfunc=yes"
11426 else
11427   echo "configure: failed program was:" >&5
11428   cat conftest.$ac_ext >&5
11429   rm -rf conftest*
11430   eval "ac_cv_func_$dbfunc=no"
11431 fi
11432 rm -f conftest*
11433
11434 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11435   echo "$ac_t""yes" 1>&6
11436   with_database_berkdb=yes need_libdb=no
11437 else
11438   echo "$ac_t""no" 1>&6
11439
11440     
11441 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11442 echo "configure:11443: checking for $dbfunc in -ldb" >&5
11443 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11444
11445 xe_check_libs=" -ldb "
11446 cat > conftest.$ac_ext <<EOF
11447 #line 11448 "configure"
11448 #include "confdefs.h"
11449 /* Override any gcc2 internal prototype to avoid an error.  */
11450 /* We use char because int might match the return type of a gcc2
11451     builtin and then its argument prototype would still apply.  */
11452 char $dbfunc();
11453
11454 int main() {
11455 $dbfunc()
11456 ; return 0; }
11457 EOF
11458 if { (eval echo configure:11459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11459   rm -rf conftest*
11460   eval "ac_cv_lib_$ac_lib_var=yes"
11461 else
11462   echo "configure: failed program was:" >&5
11463   cat conftest.$ac_ext >&5
11464   rm -rf conftest*
11465   eval "ac_cv_lib_$ac_lib_var=no"
11466 fi
11467 rm -f conftest*
11468 xe_check_libs=""
11469
11470 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11471   echo "$ac_t""yes" 1>&6
11472   with_database_berkdb=yes need_libdb=yes
11473 else
11474   echo "$ac_t""no" 1>&6
11475 fi
11476
11477
11478 fi
11479
11480   fi
11481
11482   if test "$with_database_berkdb" = "yes"; then
11483     { test "$extra_verbose" = "yes" && cat << EOF
11484     Defining DB_H_PATH = "$db_h_path"
11485 EOF
11486 cat >> confdefs.h <<EOF
11487 #define DB_H_PATH "$db_h_path"
11488 EOF
11489 }
11490
11491     { test "$extra_verbose" = "yes" && cat << \EOF
11492     Defining HAVE_BERKELEY_DB
11493 EOF
11494 cat >> confdefs.h <<\EOF
11495 #define HAVE_BERKELEY_DB 1
11496 EOF
11497 }
11498
11499     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11500   else with_database_berkdb=no
11501   fi
11502 fi
11503
11504 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11505      != "no no no"; then
11506   { test "$extra_verbose" = "yes" && cat << \EOF
11507     Defining HAVE_DATABASE
11508 EOF
11509 cat >> confdefs.h <<\EOF
11510 #define HAVE_DATABASE 1
11511 EOF
11512 }
11513
11514   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11515    echo "    xemacs will be linked with \"database.o\""
11516  fi
11517 fi
11518
11519 if test "$with_socks" = "yes"; then
11520   
11521 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11522 echo "configure:11523: checking for SOCKSinit in -lsocks" >&5
11523 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11524
11525 xe_check_libs=" -lsocks "
11526 cat > conftest.$ac_ext <<EOF
11527 #line 11528 "configure"
11528 #include "confdefs.h"
11529 /* Override any gcc2 internal prototype to avoid an error.  */
11530 /* We use char because int might match the return type of a gcc2
11531     builtin and then its argument prototype would still apply.  */
11532 char SOCKSinit();
11533
11534 int main() {
11535 SOCKSinit()
11536 ; return 0; }
11537 EOF
11538 if { (eval echo configure:11539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11539   rm -rf conftest*
11540   eval "ac_cv_lib_$ac_lib_var=yes"
11541 else
11542   echo "configure: failed program was:" >&5
11543   cat conftest.$ac_ext >&5
11544   rm -rf conftest*
11545   eval "ac_cv_lib_$ac_lib_var=no"
11546 fi
11547 rm -f conftest*
11548 xe_check_libs=""
11549
11550 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11551   echo "$ac_t""yes" 1>&6
11552     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11553     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11554   { test "$extra_verbose" = "yes" && cat << EOF
11555     Defining $ac_tr_lib
11556 EOF
11557 cat >> confdefs.h <<EOF
11558 #define $ac_tr_lib 1
11559 EOF
11560 }
11561
11562   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11563
11564 else
11565   echo "$ac_t""no" 1>&6
11566 fi
11567
11568
11569   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11570     Defining HAVE_SOCKS
11571 EOF
11572 cat >> confdefs.h <<\EOF
11573 #define HAVE_SOCKS 1
11574 EOF
11575 }
11576
11577 fi
11578
11579 if test "$usage_tracking" = "yes"; then
11580   { test "$extra_verbose" = "yes" && cat << \EOF
11581     Defining USAGE_TRACKING
11582 EOF
11583 cat >> confdefs.h <<\EOF
11584 #define USAGE_TRACKING 1
11585 EOF
11586 }
11587
11588   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11589 fi
11590
11591 for ac_hdr in dlfcn.h
11592 do
11593 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11594 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11595 echo "configure:11596: checking for $ac_hdr" >&5
11596
11597 cat > conftest.$ac_ext <<EOF
11598 #line 11599 "configure"
11599 #include "confdefs.h"
11600 #include <$ac_hdr>
11601 EOF
11602 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11603 { (eval echo configure:11604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11604 ac_err=`grep -v '^ *+' conftest.out`
11605 if test -z "$ac_err"; then
11606   rm -rf conftest*
11607   eval "ac_cv_header_$ac_safe=yes"
11608 else
11609   echo "$ac_err" >&5
11610   echo "configure: failed program was:" >&5
11611   cat conftest.$ac_ext >&5
11612   rm -rf conftest*
11613   eval "ac_cv_header_$ac_safe=no"
11614 fi
11615 rm -f conftest*
11616 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11617   echo "$ac_t""yes" 1>&6
11618     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11619   { test "$extra_verbose" = "yes" && cat << EOF
11620     Defining $ac_tr_hdr
11621 EOF
11622 cat >> confdefs.h <<EOF
11623 #define $ac_tr_hdr 1
11624 EOF
11625 }
11626  have_dlfcn=yes
11627   { test "$extra_verbose" = "yes" && cat << \EOF
11628     Defining HAVE_DLFCN_H
11629 EOF
11630 cat >> confdefs.h <<\EOF
11631 #define HAVE_DLFCN_H 1
11632 EOF
11633 }
11634
11635 else
11636   echo "$ac_t""no" 1>&6
11637 fi
11638 done
11639
11640 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11641 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11642 echo "configure:11643: checking for dlopen in -ldl" >&5
11643 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11644
11645 xe_check_libs=" -ldl "
11646 cat > conftest.$ac_ext <<EOF
11647 #line 11648 "configure"
11648 #include "confdefs.h"
11649 /* Override any gcc2 internal prototype to avoid an error.  */
11650 /* We use char because int might match the return type of a gcc2
11651     builtin and then its argument prototype would still apply.  */
11652 char dlopen();
11653
11654 int main() {
11655 dlopen()
11656 ; return 0; }
11657 EOF
11658 if { (eval echo configure:11659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11659   rm -rf conftest*
11660   eval "ac_cv_lib_$ac_lib_var=yes"
11661 else
11662   echo "configure: failed program was:" >&5
11663   cat conftest.$ac_ext >&5
11664   rm -rf conftest*
11665   eval "ac_cv_lib_$ac_lib_var=no"
11666 fi
11667 rm -f conftest*
11668 xe_check_libs=""
11669
11670 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11671   echo "$ac_t""yes" 1>&6
11672   { test "$extra_verbose" = "yes" && cat << \EOF
11673     Defining HAVE_DLOPEN
11674 EOF
11675 cat >> confdefs.h <<\EOF
11676 #define HAVE_DLOPEN 1
11677 EOF
11678 }
11679  DLL_LIB=dl;  with_shlib=yes
11680 else
11681   echo "$ac_t""no" 1>&6
11682 fi
11683
11684  }
11685 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11686 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11687 echo "configure:11688: checking for _dlopen in -lc" >&5
11688 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11689
11690 xe_check_libs=" -lc "
11691 cat > conftest.$ac_ext <<EOF
11692 #line 11693 "configure"
11693 #include "confdefs.h"
11694 /* Override any gcc2 internal prototype to avoid an error.  */
11695 /* We use char because int might match the return type of a gcc2
11696     builtin and then its argument prototype would still apply.  */
11697 char _dlopen();
11698
11699 int main() {
11700 _dlopen()
11701 ; return 0; }
11702 EOF
11703 if { (eval echo configure:11704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11704   rm -rf conftest*
11705   eval "ac_cv_lib_$ac_lib_var=yes"
11706 else
11707   echo "configure: failed program was:" >&5
11708   cat conftest.$ac_ext >&5
11709   rm -rf conftest*
11710   eval "ac_cv_lib_$ac_lib_var=no"
11711 fi
11712 rm -f conftest*
11713 xe_check_libs=""
11714
11715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11716   echo "$ac_t""yes" 1>&6
11717   { test "$extra_verbose" = "yes" && cat << \EOF
11718     Defining HAVE_DLOPEN
11719 EOF
11720 cat >> confdefs.h <<\EOF
11721 #define HAVE_DLOPEN 1
11722 EOF
11723 }
11724  DLL_LIB=;   with_shlib=yes
11725 else
11726   echo "$ac_t""no" 1>&6
11727 fi
11728
11729  }
11730 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11731 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11732 echo "configure:11733: checking for dlopen in -lc" >&5
11733 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11734
11735 xe_check_libs=" -lc "
11736 cat > conftest.$ac_ext <<EOF
11737 #line 11738 "configure"
11738 #include "confdefs.h"
11739 /* Override any gcc2 internal prototype to avoid an error.  */
11740 /* We use char because int might match the return type of a gcc2
11741     builtin and then its argument prototype would still apply.  */
11742 char dlopen();
11743
11744 int main() {
11745 dlopen()
11746 ; return 0; }
11747 EOF
11748 if { (eval echo configure:11749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11749   rm -rf conftest*
11750   eval "ac_cv_lib_$ac_lib_var=yes"
11751 else
11752   echo "configure: failed program was:" >&5
11753   cat conftest.$ac_ext >&5
11754   rm -rf conftest*
11755   eval "ac_cv_lib_$ac_lib_var=no"
11756 fi
11757 rm -f conftest*
11758 xe_check_libs=""
11759
11760 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11761   echo "$ac_t""yes" 1>&6
11762   { test "$extra_verbose" = "yes" && cat << \EOF
11763     Defining HAVE_DLOPEN
11764 EOF
11765 cat >> confdefs.h <<\EOF
11766 #define HAVE_DLOPEN 1
11767 EOF
11768 }
11769  DLL_LIB=;   with_shlib=yes
11770 else
11771   echo "$ac_t""no" 1>&6
11772 fi
11773
11774  }
11775 test -z "$with_shlib" && { 
11776 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11777 echo "configure:11778: checking for shl_load in -ldld" >&5
11778 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11779
11780 xe_check_libs=" -ldld "
11781 cat > conftest.$ac_ext <<EOF
11782 #line 11783 "configure"
11783 #include "confdefs.h"
11784 /* Override any gcc2 internal prototype to avoid an error.  */
11785 /* We use char because int might match the return type of a gcc2
11786     builtin and then its argument prototype would still apply.  */
11787 char shl_load();
11788
11789 int main() {
11790 shl_load()
11791 ; return 0; }
11792 EOF
11793 if { (eval echo configure:11794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11794   rm -rf conftest*
11795   eval "ac_cv_lib_$ac_lib_var=yes"
11796 else
11797   echo "configure: failed program was:" >&5
11798   cat conftest.$ac_ext >&5
11799   rm -rf conftest*
11800   eval "ac_cv_lib_$ac_lib_var=no"
11801 fi
11802 rm -f conftest*
11803 xe_check_libs=""
11804
11805 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11806   echo "$ac_t""yes" 1>&6
11807   { test "$extra_verbose" = "yes" && cat << \EOF
11808     Defining HAVE_SHL_LOAD
11809 EOF
11810 cat >> confdefs.h <<\EOF
11811 #define HAVE_SHL_LOAD 1
11812 EOF
11813 }
11814  DLL_LIB=dld; with_shlib=yes
11815 else
11816   echo "$ac_t""no" 1>&6
11817 fi
11818
11819  }
11820 test -z "$with_shlib" && { 
11821 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11822 echo "configure:11823: checking for dld_init in -ldld" >&5
11823 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11824
11825 xe_check_libs=" -ldld "
11826 cat > conftest.$ac_ext <<EOF
11827 #line 11828 "configure"
11828 #include "confdefs.h"
11829 /* Override any gcc2 internal prototype to avoid an error.  */
11830 /* We use char because int might match the return type of a gcc2
11831     builtin and then its argument prototype would still apply.  */
11832 char dld_init();
11833
11834 int main() {
11835 dld_init()
11836 ; return 0; }
11837 EOF
11838 if { (eval echo configure:11839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11839   rm -rf conftest*
11840   eval "ac_cv_lib_$ac_lib_var=yes"
11841 else
11842   echo "configure: failed program was:" >&5
11843   cat conftest.$ac_ext >&5
11844   rm -rf conftest*
11845   eval "ac_cv_lib_$ac_lib_var=no"
11846 fi
11847 rm -f conftest*
11848 xe_check_libs=""
11849
11850 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11851   echo "$ac_t""yes" 1>&6
11852   { test "$extra_verbose" = "yes" && cat << \EOF
11853     Defining HAVE_DLD_INIT
11854 EOF
11855 cat >> confdefs.h <<\EOF
11856 #define HAVE_DLD_INIT 1
11857 EOF
11858 }
11859  DLL_LIB=dld; with_shlib=yes
11860 else
11861   echo "$ac_t""no" 1>&6
11862 fi
11863
11864  }
11865 if test "$with_shlib" = "yes"; then
11866   
11867 dll_ld=
11868 dll_ldflags=
11869 dll_cflags=
11870 dll_post=
11871 dll_ldo="-o"
11872 ld_dynamic_link_flags=
11873 xehost=$canonical
11874 xealias=$internal_configuration
11875
11876 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
11877 echo "configure:11878: checking how to build dynamic libraries for ${xehost}" >&5
11878 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
11879 case "$xehost" in
11880 *-*-linux-gnu*) ;;
11881 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
11882 esac
11883
11884 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
11885 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
11886 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
11887
11888 case "$xehost_os" in
11889 aix3*)
11890   # AIX sometimes has problems with the GCC collect2 program.  For some
11891   # reason, if we set the COLLECT_NAMES environment variable, the problems
11892   # vanish in a puff of smoke.
11893   if test "${COLLECT_NAMES+set}" != set; then
11894     COLLECT_NAMES=
11895     export COLLECT_NAMES
11896   fi
11897   ;;
11898 esac
11899
11900 # Now see if the compiler is really GCC.
11901 if test "$GCC" = "yes"; then
11902   XEGCC=yes
11903 else
11904   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
11905 echo "configure:11906: checking checking whether we are using GNU C" >&5
11906   cat > conftest.$ac_ext <<EOF
11907 #line 11908 "configure"
11908 #include "confdefs.h"
11909
11910 #ifdef __GNUC__
11911   yes;
11912 #endif
11913
11914 EOF
11915 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11916   egrep "yes" >/dev/null 2>&1; then
11917   rm -rf conftest*
11918   XEGCC=yes
11919 else
11920   rm -rf conftest*
11921   XEGCC=no
11922 fi
11923 rm -f conftest*
11924
11925   echo "$ac_t""${XEGCC}" 1>&6
11926 fi
11927
11928 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
11929 echo "configure:11930: checking how to produce PIC code" >&5
11930 wl=
11931
11932 can_build_shared=yes
11933 if test "$XEGCC" = yes; then
11934   wl='-Wl,'
11935
11936   case "$xehost_os" in
11937   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
11938     # PIC is the default for these OSes.
11939     ;;
11940
11941   os2*)
11942     # We can build DLLs from non-PIC.
11943     ;;
11944   amigaos*)
11945     # FIXME: we need at least 68020 code to build shared libraries, but
11946     # adding the `-m68020' flag to GCC prevents building anything better,
11947     # like `-m68040'.
11948     dll_cflags='-m68020 -resident32 -malways-restore-a4'
11949     ;;
11950   *)
11951     dll_cflags='-fPIC'
11952     ;;
11953   esac
11954 else
11955   # PORTME Check for PIC flags for the system compiler.
11956   case "$xehost_os" in
11957   hpux9* | hpux10*)
11958     # Is there a better link_static_flag that works with the bundled CC?
11959     wl='-Wl,'
11960     dll_cflags='+Z'
11961     ;;
11962
11963   irix5* | irix6*)
11964     wl='-Wl,'
11965     # PIC (with -KPIC) is the default.
11966     ;;
11967
11968   os2*)
11969     # We can build DLLs from non-PIC.
11970     ;;
11971
11972   osf3* | osf4*)
11973     # All OSF/1 code is PIC.
11974     wl='-Wl,'
11975     ;;
11976
11977   sco3.2v5*)
11978     dll_cflags='-belf -Kpic'
11979     wl='-Wl,'
11980     ;;
11981
11982   unixware*)
11983     dll_cflags="-KPIC"
11984     wl="-Wl,"
11985     ;;
11986
11987   sysv4*)
11988     dll_cflags="-KPIC"
11989     wl="-Wl,"
11990     ;;
11991
11992   sysv5*)
11993     dll_cflags="-KPIC"
11994     wl="-Wl,"
11995     ;;
11996
11997   solaris2*)
11998     dll_cflags='-KPIC'
11999     wl='-Wl,'
12000     ;;
12001
12002   sunos4*)
12003     dll_cflags='-PIC'
12004     wl='-Qoption ld '
12005     ;;
12006
12007   uts4*)
12008     dll_cflags='-pic'
12009     ;;
12010
12011   *)
12012     can_build_shared=no
12013     ;;
12014   esac
12015 fi
12016
12017 if test -n "$dll_cflags"; then
12018   echo "$ac_t""${dll_cflags}" 1>&6
12019   
12020   # Check to make sure the dll_cflags actually works.
12021   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12022 echo "configure:12023: checking if PIC flag ${dll_cflags} really works" >&5
12023   save_CFLAGS="$CFLAGS"
12024   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12025   cat > conftest.$ac_ext <<EOF
12026 #line 12027 "configure"
12027 #include "confdefs.h"
12028
12029 int main() {
12030 int x=0;
12031 ; return 0; }
12032 EOF
12033 if { (eval echo configure:12034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12034   rm -rf conftest*
12035   
12036     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12037     # reports no error.  So, we need to grep stderr for (Bundled).
12038     if grep '(Bundled)' config.log >/dev/null; then
12039       echo "$ac_t""no" 1>&6
12040       can_build_shared=no
12041       dll_cflags=
12042     else
12043       echo "$ac_t""yes" 1>&6
12044     fi
12045 else
12046   echo "configure: failed program was:" >&5
12047   cat conftest.$ac_ext >&5
12048   rm -rf conftest*
12049   echo "$ac_t""no" 1>&6
12050     can_build_shared=no
12051     dll_cflags=
12052 fi
12053 rm -f conftest*
12054   CFLAGS="$save_CFLAGS"
12055 else
12056   echo "$ac_t""none" 1>&6
12057 fi
12058
12059 if test "$can_build_shared" = "yes"; then
12060 cc_produces_so=no
12061 xldf=
12062 xcldf=
12063 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12064 echo "configure:12065: checking if C compiler can produce shared libraries" >&5
12065 if test "$XEGCC" = yes; then
12066   xcldf="-shared"
12067   xldf="-shared"
12068 else # Not using GCC
12069   case "$xehost_os" in
12070     aix3* | aix4*)
12071       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12072       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12073       ;;
12074
12075     freebsd2* | netbsd* | openbsd*)
12076       xldf="-Bshareable"
12077       xcldf="${wl}-Bshareable"
12078       ;;
12079
12080     freebsd3*)
12081       xcldf="-shared"
12082       ;;
12083
12084     hpux*)
12085       xldf="-b +s"
12086       xcldf="${wl}-b ${wl}+s"
12087       ;;
12088
12089     irix5* | irix6* | osf3* | osf4*)
12090       xcldf="${wl}-shared"
12091       xldf="-shared"
12092       ;;
12093
12094     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12095       xcldf="-G"
12096       xldf="-G"
12097       ;;
12098
12099     sunos4*)
12100       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12101       xldf="-assert pure-text -Bstatic"
12102       ;;
12103   esac
12104 fi # End if if we are using gcc
12105
12106 if test -n "$xcldf"; then
12107   save_LDFLAGS=$LDFLAGS
12108   save_LIBS=$LIBS
12109   save_xe_libs=$xe_libs
12110   LDFLAGS="$xcldf $LDFLAGS"
12111   LIBS=
12112   xe_libs=
12113   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12114   cat > conftest.$ac_ext <<EOF
12115 #line 12116 "configure"
12116 #include "confdefs.h"
12117
12118 int main() {
12119 int x=0;
12120 ; return 0; }
12121 EOF
12122 if { (eval echo configure:12123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12123   rm -rf conftest*
12124   cc_produces_so=yes
12125 else
12126   echo "configure: failed program was:" >&5
12127   cat conftest.$ac_ext >&5
12128   rm -rf conftest*
12129   cc_produces_so=no
12130 fi
12131 rm -f conftest*
12132   LDFLAGS=$save_LDFLAGS
12133   LIBS=$save_LIBS
12134   xe_libs=$save_xe_libs
12135   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12136 else
12137   cc_produces_so=no
12138 fi
12139 echo "$ac_t""${cc_produces_so}" 1>&6
12140
12141 LTLD=$LD
12142 if test -z "$LTLD"; then
12143   ac_prog=ld
12144   if test "$XEGCC" = yes; then
12145     # Check if gcc -print-prog-name=ld gives a path.
12146     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12147 echo "configure:12148: checking for ld used by GCC" >&5
12148     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12149     case "$ac_prog" in
12150     # Accept absolute paths.
12151     /*)
12152       if test -z "$LTLD"; then
12153         case "$ac_prog" in
12154           *gcc-lib*) LTLD="$CC"
12155                      ;;
12156           *)         LTLD="$ac_prog"
12157                      ;;
12158         esac
12159       fi
12160       ;;
12161     "")
12162       # If it fails, then pretend we aren't using GCC.
12163       ac_prog=ld
12164       ;;
12165     *)
12166       # If it is relative, then search for the first ld in PATH.
12167       with_gnu_ld=unknown
12168       ;;
12169     esac
12170   else
12171     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12172 echo "configure:12173: checking for GNU ld" >&5
12173   fi
12174
12175   if test -z "$LTLD"; then
12176     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12177     for ac_dir in $PATH; do
12178       test -z "$ac_dir" && ac_dir=.
12179       if test -f "$ac_dir/$ac_prog"; then
12180         LTLD="$ac_dir/$ac_prog"
12181         # Check to see if the program is GNU ld.  I'd rather use --version,
12182         # but apparently some GNU ld's only accept -v.
12183         # Break only if it was the GNU/non-GNU ld that we prefer.
12184         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12185           xe_gnu_ld=yes
12186         else
12187           xe_gnu_ld=no
12188         fi
12189       fi
12190     done
12191     IFS="$ac_save_ifs"
12192   fi
12193
12194   if test -n "$LTLD"; then
12195     echo "$ac_t""${LTLD}" 1>&6
12196   else
12197     echo "$ac_t""no" 1>&6
12198   fi
12199
12200   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12201     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12202     exit 1
12203   fi
12204 fi
12205
12206 ld_dynamic_link_flags=
12207
12208 # Check to see if it really is or isn't GNU ld.
12209 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12210 echo "configure:12211: checking if the linker is GNU ld" >&5
12211 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12212 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12213   xe_gnu_ld=yes
12214 else
12215   xe_gnu_ld=no
12216 fi
12217 echo "$ac_t""${xe_gnu_ld}" 1>&6
12218
12219 case "$xehost_os" in
12220   amigaos* | sunos4*)
12221     # On these operating systems, we should treat GNU ld like the system ld.
12222     gnu_ld_acts_native=yes
12223     ;;
12224   *)
12225     gnu_ld_acts_native=no
12226     ;;
12227 esac
12228
12229 if test "$cc_produces_so" = "yes"; then
12230   dll_ld=$CC
12231   dll_ldflags=$xcldf
12232   can_build_shared=yes
12233 else
12234   # OK - only NOW do we futz about with ld.
12235   # See if the linker supports building shared libraries.
12236   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12237 echo "configure:12238: checking whether the linker supports shared libraries" >&5
12238   dll_ld=$CC
12239   dll_ldflags=$LDFLAGS
12240   ld_shlibs=yes
12241   can_build_shared=yes
12242   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12243     # See if GNU ld supports shared libraries.
12244     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12245       dll_ld=$CC
12246       dll_ldflags="-shared"
12247       ld_shlibs=yes
12248     else
12249       ld_shlibs=no
12250     fi
12251   else
12252     # PORTME fill in a description of your system's linker (not GNU ld)
12253     case "$xehost_os" in
12254     aix3*)
12255       dll_ld=$LTLD
12256       dll_ldflags=$xldf
12257       ;;
12258
12259     aix4*)
12260       dll_ldflags=$xcldf
12261       ;;
12262
12263     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12264     # support.  Future versions do this automatically, but an explicit c++rt0.o
12265     # doesn't break anything, and helps significantly (at the cost of a little
12266     # extra space).
12267     freebsd2.2*)
12268       dll_ld=$LTLD
12269       dll_ldflags=$xldf
12270       dll_post="/usr/lib/c++rt0.o"
12271       ;;
12272
12273     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12274     freebsd2*)
12275       dll_ld=$LTLD
12276       dll_ldflags="-Bshareable"
12277       ;;
12278
12279     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12280     freebsd3*)
12281       dll_ldflags="-shared"
12282       ;;
12283
12284     hpux*)
12285       dll_ld=$LTLD
12286       dll_ldflags=$xldf
12287       ;;
12288
12289     irix5* | irix6*)
12290       dll_ld=$LTLD
12291       dll_ldflags=$xldf
12292       ;;
12293
12294     netbsd*)
12295       # Tested with NetBSD 1.2 ld
12296       dll_ld=$LTLD
12297       dll_ldflags=$xldf
12298       ;;
12299
12300     openbsd*)
12301       dll_ld=$LTLD
12302       dll_ldflags=$xldf
12303       ;;
12304
12305     osf3* | osf4*)
12306       dll_ld=$LTLD
12307       dll_ldflags=$xldf
12308       ;;
12309
12310     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12311     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12312       dll_ld=$LTLD
12313       case "$dll_ld" in
12314         *gcc*) dll_ldflags="-shared"
12315                dll_ld=$CC
12316                ;;
12317         *)     dll_ldflags="-G"
12318                ;;
12319       esac
12320       ;;
12321
12322     sunos4*)
12323       if test "$XEGCC" = yes; then
12324         dll_ld=$CC
12325       else
12326         dll_ld=$LTLD
12327       fi
12328       dll_ldflags=$xldf
12329       ;;
12330
12331     uts4*)
12332       dll_ld=$LTLD
12333       dll_ldflags="-G"
12334       ;;
12335
12336     bsdi*)
12337       dll_ldflags="-r"
12338       dll_ld="shlicc2"
12339       ;;
12340
12341     *)
12342       ld_shlibs=no
12343       can_build_shared=no
12344       ;;
12345     esac
12346   fi
12347   echo "$ac_t""${ld_shlibs}" 1>&6
12348   if test "$ld_shlibs" = "no"; then
12349     can_build_shared=no
12350   fi
12351 fi # End of if cc_produces_so = no
12352
12353
12354 if test "$xe_gnu_ld" = yes; then
12355   if test "$ld_shlibs" = yes; then
12356     ld_dynamic_link_flags="${wl}-export-dynamic"
12357   fi
12358 fi
12359
12360 if test -z "$ld_dynamic_link_flags"; then
12361   case "$xehost_os" in
12362   aix3*)
12363     ld_dynamic_link_flags=
12364     ;;
12365
12366   aix4*)
12367     ld_dynamic_link_flags=
12368     ;;
12369
12370   freebsd2.2*)
12371     ld_dynamic_link_flags=
12372     ;;
12373
12374   freebsd2*)
12375     ld_dynamic_link_flags=
12376     ;;
12377
12378   freebsd3*)
12379     ld_dynamic_link_flags=
12380     ;;
12381
12382   hpux*)
12383     ld_dynamic_link_flags="${wl}-E"
12384     ;;
12385
12386   irix5* | irix6*)
12387     ld_dynamic_link_flags=
12388     ;;
12389
12390   netbsd*)
12391     ld_dynamic_link_flags=
12392     ;;
12393
12394   openbsd*)
12395     ld_dynamic_link_flags=
12396     ;;
12397
12398   osf3* | osf4*)
12399     ld_dynamic_link_flags=
12400     ;;
12401
12402   solaris2* | solaris7*)
12403     ld_dynamic_link_flags="${wl}-Bdynamic"
12404     ;;
12405
12406   sco3.2v5* | unixware* | sysv5* | sysv4*)
12407     ld_dynamic_link_flags="${wl}-Bexport"
12408     ;;
12409
12410   sunos4*)
12411     ld_dynamic_link_flags=
12412     ;;
12413
12414   uts4*)
12415     ld_dynamic_link_flags=
12416     ;;
12417
12418   bsdi*)
12419     ld_dynamic_link_flags=
12420     ;;
12421
12422   esac
12423 fi # End of if -z ld_dynamic_link_flags
12424 fi # End of if test "$can_build_shared" = "yes"
12425
12426
12427
12428
12429
12430
12431
12432
12433   if test "$can_build_shared" = "yes"; then
12434     { test "$extra_verbose" = "yes" && cat << \EOF
12435     Defining HAVE_SHLIB
12436 EOF
12437 cat >> confdefs.h <<\EOF
12438 #define HAVE_SHLIB 1
12439 EOF
12440 }
12441
12442     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12443    echo "    xemacs will be linked with \"sysdll.o\""
12444  fi
12445     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12446    echo "    xemacs will be linked with \"emodules.o\""
12447  fi
12448     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12449     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12450     for ac_func in dlerror _dlerror
12451 do
12452 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12453 echo "configure:12454: checking for $ac_func" >&5
12454
12455 cat > conftest.$ac_ext <<EOF
12456 #line 12457 "configure"
12457 #include "confdefs.h"
12458 /* System header to define __stub macros and hopefully few prototypes,
12459     which can conflict with char $ac_func(); below.  */
12460 #include <assert.h>
12461 /* Override any gcc2 internal prototype to avoid an error.  */
12462 /* We use char because int might match the return type of a gcc2
12463     builtin and then its argument prototype would still apply.  */
12464 char $ac_func();
12465
12466 int main() {
12467
12468 /* The GNU C library defines this for functions which it implements
12469     to always fail with ENOSYS.  Some functions are actually named
12470     something starting with __ and the normal name is an alias.  */
12471 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12472 choke me
12473 #else
12474 $ac_func();
12475 #endif
12476
12477 ; return 0; }
12478 EOF
12479 if { (eval echo configure:12480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12480   rm -rf conftest*
12481   eval "ac_cv_func_$ac_func=yes"
12482 else
12483   echo "configure: failed program was:" >&5
12484   cat conftest.$ac_ext >&5
12485   rm -rf conftest*
12486   eval "ac_cv_func_$ac_func=no"
12487 fi
12488 rm -f conftest*
12489
12490 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12491   echo "$ac_t""yes" 1>&6
12492     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12493   { test "$extra_verbose" = "yes" && cat << EOF
12494     Defining $ac_tr_func
12495 EOF
12496 cat >> confdefs.h <<EOF
12497 #define $ac_tr_func 1
12498 EOF
12499 }
12500  
12501 else
12502   echo "$ac_t""no" 1>&6
12503 fi
12504 done
12505
12506   else
12507     echo "configure: warning: disabling shared library support" 1>&2
12508     with_shlib=no
12509   fi
12510 fi
12511
12512 cat > conftest.$ac_ext <<EOF
12513 #line 12514 "configure"
12514 #include "confdefs.h"
12515 int main(int c,char *v[]){return 0;}
12516 EOF
12517 if { (eval echo configure:12518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12518 then
12519   :
12520 else
12521   conftest_rc="$?"
12522   echo "configure: failed program was:" >&5
12523   cat conftest.$ac_ext >&5
12524   rm -fr conftest*
12525   
12526   echo ""
12527   echo "*** PANIC *** The C compiler can no longer build working executables."
12528   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12529   echo "*** PANIC *** The most likely reason for this problem is that configure"
12530   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12531   echo "*** PANIC *** found at run time."
12532   echo "*** PANIC ***"
12533   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12534   echo "*** PANIC *** On other systems, try telling configure where to find the"
12535   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12536   echo "*** PANIC ***"
12537   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12538   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12539   echo "*** PANIC *** on your system.  Don't do that."
12540   exit 1
12541 fi
12542 rm -fr conftest*
12543
12544 if test "$win32_processes" = "yes"; then
12545   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12546    echo "    xemacs will be linked with \"process-nt.o\""
12547  fi
12548 else
12549   { test "$extra_verbose" = "yes" && cat << \EOF
12550     Defining HAVE_UNIX_PROCESSES
12551 EOF
12552 cat >> confdefs.h <<\EOF
12553 #define HAVE_UNIX_PROCESSES 1
12554 EOF
12555 }
12556
12557   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12558    echo "    xemacs will be linked with \"process-unix.o\""
12559  fi
12560 fi
12561
12562
12563
12564 T=""
12565 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12566 CFLAGS="$T"
12567
12568
12569 T=""
12570 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12571 extra_objs="$T"
12572
12573
12574 T=""
12575 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
12576 c_switch_general="$T"
12577
12578
12579 T=""
12580 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12581 c_switch_window_system="$T"
12582
12583
12584 T=""
12585 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12586 c_switch_all="$T"
12587
12588
12589 T=""
12590 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
12591 ld_switch_general="$T"
12592
12593
12594 T=""
12595 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12596 ld_switch_window_system="$T"
12597
12598
12599 T=""
12600 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12601 ld_switch_all="$T"
12602
12603
12604 T=""
12605 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12606 ld_libs_general="$T"
12607
12608
12609 T=""
12610 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
12611 ld_libs_window_system="$T"
12612
12613
12614 T=""
12615 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12616 ld_libs_all="$T"
12617
12618
12619
12620 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12621 internal_makefile_list="Makefile.in"
12622 SUBDIR_MAKEFILES=''
12623 test -d lock || mkdir lock
12624 for dir in $MAKE_SUBDIR; do
12625   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12626         test -d "$d" || mkdir "$d"; cd "$d"
12627       done ) ;;
12628    * ) test -d "$dir" || mkdir "$dir" ;;
12629   esac
12630   
12631 T=""
12632 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12633 SUBDIR_MAKEFILES="$T"
12634
12635   
12636 T=""
12637 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12638 internal_makefile_list="$T"
12639
12640 done
12641
12642
12643
12644
12645 for dir in src/s src/m; do
12646   if test ! -d "$dir" ; then
12647     echo Making symbolic link to "$srcdir/$dir"
12648     ${LN_S} "$srcdir/$dir" "$dir"
12649   fi
12650 done
12651
12652 if test "$extra_verbose" = "yes"; then
12653   echo ""
12654   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
12655   echo ""
12656 fi
12657
12658 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12659   echo "creating src/gdbinit"; echo ""
12660   echo "source $srcdir/src/gdbinit" > src/gdbinit
12661 fi
12662
12663 if test "$__SUNPRO_C" = "yes"; then
12664   echo "creating .sbinit"; echo ""
12665   ( echo "# For use with Sun WorkShop's Source browser."
12666     echo "# See sbquery(1) and sbinit(4) for more information"
12667     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12668   ) > .sbinit
12669 fi
12670
12671 rm -f core
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688 PREFIX=$prefix
12689 while true; do
12690   case "$PREFIX" in
12691     *\$* ) eval "PREFIX=$PREFIX" ;;
12692     *) break ;;
12693   esac
12694 done
12695
12696
12697
12698 EXEC_PREFIX=$exec_prefix
12699 while true; do
12700   case "$EXEC_PREFIX" in
12701     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12702     *) break ;;
12703   esac
12704 done
12705
12706
12707
12708
12709 INFODIR=$infodir
12710 while true; do
12711   case "$INFODIR" in
12712     *\$* ) eval "INFODIR=$INFODIR" ;;
12713     *) break ;;
12714   esac
12715 done
12716
12717
12718
12719
12720 INFOPATH=$infopath
12721 while true; do
12722   case "$INFOPATH" in
12723     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12724     *) break ;;
12725   esac
12726 done
12727
12728
12729
12730
12731 PACKAGE_PATH=$package_path
12732 while true; do
12733   case "$PACKAGE_PATH" in
12734     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12735     *) break ;;
12736   esac
12737 done
12738
12739
12740
12741
12742 LISPDIR=$lispdir
12743 while true; do
12744   case "$LISPDIR" in
12745     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12746     *) break ;;
12747   esac
12748 done
12749
12750
12751
12752
12753 MODULEDIR=$moduledir
12754 while true; do
12755   case "$MODULEDIR" in
12756     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12757     *) break ;;
12758   esac
12759 done
12760
12761
12762
12763
12764 SITELISPDIR=$sitelispdir
12765 while true; do
12766   case "$SITELISPDIR" in
12767     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12768     *) break ;;
12769   esac
12770 done
12771
12772
12773
12774
12775 SITEMODULEDIR=$sitemoduledir
12776 while true; do
12777   case "$SITEMODULEDIR" in
12778     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12779     *) break ;;
12780   esac
12781 done
12782
12783
12784
12785
12786 ETCDIR=$etcdir
12787 while true; do
12788   case "$ETCDIR" in
12789     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12790     *) break ;;
12791   esac
12792 done
12793
12794
12795
12796
12797 LOCKDIR=$lockdir
12798 while true; do
12799   case "$LOCKDIR" in
12800     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12801     *) break ;;
12802   esac
12803 done
12804
12805
12806
12807
12808 ARCHLIBDIR=$archlibdir
12809 while true; do
12810   case "$ARCHLIBDIR" in
12811     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12812     *) break ;;
12813   esac
12814 done
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12836
12837
12838
12839
12840
12841
12842
12843 : ${XEMACS_CC:=$CC}
12844
12845
12846
12847 if test "$with_site_lisp" = "no"; then
12848   { test "$extra_verbose" = "yes" && cat << \EOF
12849     Defining INHIBIT_SITE_LISP
12850 EOF
12851 cat >> confdefs.h <<\EOF
12852 #define INHIBIT_SITE_LISP 1
12853 EOF
12854 }
12855
12856 fi
12857 if test "$with_site_modules" = "no"; then
12858   { test "$extra_verbose" = "yes" && cat << \EOF
12859     Defining INHIBIT_SITE_MODULES
12860 EOF
12861 cat >> confdefs.h <<\EOF
12862 #define INHIBIT_SITE_MODULES 1
12863 EOF
12864 }
12865
12866 fi
12867
12868
12869 T=""
12870 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12871 ac_configure_args="$T"
12872
12873 { test "$extra_verbose" = "yes" && cat << EOF
12874     Defining EMACS_CONFIGURATION = "$canonical"
12875 EOF
12876 cat >> confdefs.h <<EOF
12877 #define EMACS_CONFIGURATION "$canonical"
12878 EOF
12879 }
12880
12881 { test "$extra_verbose" = "yes" && cat << EOF
12882     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12883 EOF
12884 cat >> confdefs.h <<EOF
12885 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12886 EOF
12887 }
12888
12889 { test "$extra_verbose" = "yes" && cat << EOF
12890     Defining config_machfile = "$machfile"
12891 EOF
12892 cat >> confdefs.h <<EOF
12893 #define config_machfile "$machfile"
12894 EOF
12895 }
12896
12897 { test "$extra_verbose" = "yes" && cat << EOF
12898     Defining config_opsysfile = "$opsysfile"
12899 EOF
12900 cat >> confdefs.h <<EOF
12901 #define config_opsysfile "$opsysfile"
12902 EOF
12903 }
12904
12905
12906
12907 null_string=""
12908 { test "$extra_verbose" = "yes" && cat << EOF
12909     Defining LD_SWITCH_X_SITE = $null_string
12910 EOF
12911 cat >> confdefs.h <<EOF
12912 #define LD_SWITCH_X_SITE $null_string
12913 EOF
12914 }
12915
12916 { test "$extra_verbose" = "yes" && cat << EOF
12917     Defining LD_SWITCH_X_SITE_AUX = $null_string
12918 EOF
12919 cat >> confdefs.h <<EOF
12920 #define LD_SWITCH_X_SITE_AUX $null_string
12921 EOF
12922 }
12923
12924 { test "$extra_verbose" = "yes" && cat << EOF
12925     Defining C_SWITCH_X_SITE = $null_string
12926 EOF
12927 cat >> confdefs.h <<EOF
12928 #define C_SWITCH_X_SITE $null_string
12929 EOF
12930 }
12931
12932 { test "$extra_verbose" = "yes" && cat << EOF
12933     Defining LD_SWITCH_SITE = $null_string
12934 EOF
12935 cat >> confdefs.h <<EOF
12936 #define LD_SWITCH_SITE $null_string
12937 EOF
12938 }
12939
12940 { test "$extra_verbose" = "yes" && cat << EOF
12941     Defining C_SWITCH_SITE = $null_string
12942 EOF
12943 cat >> confdefs.h <<EOF
12944 #define C_SWITCH_SITE $null_string
12945 EOF
12946 }
12947
12948
12949
12950 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12951     Defining GNU_MALLOC
12952 EOF
12953 cat >> confdefs.h <<\EOF
12954 #define GNU_MALLOC 1
12955 EOF
12956 }
12957
12958 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12959     Defining USE_SYSTEM_MALLOC
12960 EOF
12961 cat >> confdefs.h <<\EOF
12962 #define USE_SYSTEM_MALLOC 1
12963 EOF
12964 }
12965
12966 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12967     Defining USE_DEBUG_MALLOC
12968 EOF
12969 cat >> confdefs.h <<\EOF
12970 #define USE_DEBUG_MALLOC 1
12971 EOF
12972 }
12973
12974                                               { test "$extra_verbose" = "yes" && cat << \EOF
12975     Defining USE_SYSTEM_MALLOC
12976 EOF
12977 cat >> confdefs.h <<\EOF
12978 #define USE_SYSTEM_MALLOC 1
12979 EOF
12980 }
12981
12982 fi
12983 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12984     Defining I18N3
12985 EOF
12986 cat >> confdefs.h <<\EOF
12987 #define I18N3 1
12988 EOF
12989 }
12990
12991 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12992     Defining USE_GCC
12993 EOF
12994 cat >> confdefs.h <<\EOF
12995 #define USE_GCC 1
12996 EOF
12997 }
12998
12999 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13000     Defining EXTERNAL_WIDGET
13001 EOF
13002 cat >> confdefs.h <<\EOF
13003 #define EXTERNAL_WIDGET 1
13004 EOF
13005 }
13006
13007 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13008     Defining NO_DOC_FILE
13009 EOF
13010 cat >> confdefs.h <<\EOF
13011 #define NO_DOC_FILE 1
13012 EOF
13013 }
13014
13015 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13016     Defining PURIFY
13017 EOF
13018 cat >> confdefs.h <<\EOF
13019 #define PURIFY 1
13020 EOF
13021 }
13022
13023 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13024     Defining QUANTIFY
13025 EOF
13026 cat >> confdefs.h <<\EOF
13027 #define QUANTIFY 1
13028 EOF
13029 }
13030
13031 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13032     Defining MAIL_USE_POP
13033 EOF
13034 cat >> confdefs.h <<\EOF
13035 #define MAIL_USE_POP 1
13036 EOF
13037 }
13038
13039 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13040     Defining KERBEROS
13041 EOF
13042 cat >> confdefs.h <<\EOF
13043 #define KERBEROS 1
13044 EOF
13045 }
13046
13047 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13048     Defining HESIOD
13049 EOF
13050 cat >> confdefs.h <<\EOF
13051 #define HESIOD 1
13052 EOF
13053 }
13054
13055 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13056     Defining USE_UNION_TYPE
13057 EOF
13058 cat >> confdefs.h <<\EOF
13059 #define USE_UNION_TYPE 1
13060 EOF
13061 }
13062
13063
13064
13065 (
13066 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13067 else
13068   echo "uname -a: `uname -a`"
13069 fi
13070 echo ""
13071 echo "$0 $quoted_arguments"
13072 ) > Installation
13073
13074 if test ! -z ${emacs_beta_version} ; then
13075   if test -z "${emacs_is_beta}" ; then
13076         xemacs_betaname=".${emacs_beta_version}"
13077   else
13078         xemacs_betaname="-b${emacs_beta_version}"
13079   fi
13080 else
13081   xemacs_betaname=""    
13082 fi
13083
13084 (
13085 echo "
13086
13087 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13088
13089   Where should the build process find the source code?    $srcdir
13090   What installation prefix should install use?            $prefix
13091   What operating system and machine description files should XEmacs use?
13092         \`$opsysfile' and \`$machfile'
13093   What compiler should XEmacs be built with?              $CC $CFLAGS
13094   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13095   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13096   What window system should XEmacs use?                   ${window_system}"
13097 if test "$with_x11" = "yes"; then
13098   echo "  Where do we find X Windows header files?                $x_includes"
13099   echo "  Where do we find X Windows libraries?                   $x_libraries"
13100 fi
13101 if test -n "$site_includes"; then
13102   echo "  Additional header files:                                $site_includes"
13103 fi
13104 if test -n "$site_libraries"; then
13105   echo "  Additional libraries:                                   $site_libraries"
13106 fi
13107 if test -n "$site_prefixes"; then
13108   echo "  Additional prefixes:                                    $site_prefixes"
13109 fi
13110 if test -n "$runpath"; then
13111   echo "  Runtime library search path:                            $runpath"
13112 fi
13113 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13114 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13115 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13116 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13117   echo "  No Xmu; substituting equivalent routines."
13118 fi
13119
13120 if test "$with_xpm" = yes; then
13121   echo "  Compiling in support for XPM images."
13122 elif test "$with_x11" = yes; then
13123   echo "  --------------------------------------------------------------------"
13124   echo "  WARNING: Compiling without XPM support."
13125   if test "$xpm_problem" != ""; then
13126     echo "  Reason: $xpm_problem"
13127   fi
13128   echo "  WARNING: You should strongly consider installing XPM."
13129   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13130   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13131   echo "  --------------------------------------------------------------------"
13132 fi
13133 if test "$with_png" = yes; then
13134   echo "  Compiling in support for PNG image handling."
13135 elif test "$window_system" != "none"; then
13136   echo "  --------------------------------------------------------------------"
13137   echo "  WARNING: Compiling without PNG image support."
13138   if test "$png_problem" != ""; then
13139     echo "  Reason: $png_problem"
13140   fi
13141   echo "  WARNING: You should strongly consider installing the PNG libraries."
13142   echo "  WARNING: Otherwise certain images and glyphs may not display."
13143   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13144   echo "  --------------------------------------------------------------------"
13145 fi
13146 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13147 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13148 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13149 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13150 case "$with_sound" in
13151   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13152   native ) echo "  Compiling in native sound support." ;;
13153   both   ) echo "  Compiling in both network and native sound support." ;;
13154 esac
13155 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13156
13157 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13158 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13159 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13160
13161 test "$with_ldap"            = yes && echo "  Compiling in support for LDAP."
13162
13163 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13164 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13165
13166 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13167 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13168 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13169 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13170 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13171 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13172 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13173 if test "$with_wnn" = yes; then
13174   echo "  Compiling in support for the WNN input method on Mule."
13175   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13176 fi
13177 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13178
13179 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13180 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13181 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13182 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13183 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13184 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13185 case "$with_menubars" in
13186   lucid ) echo "  Using Lucid menubars." ;;
13187   motif ) echo "  Using Motif menubars."
13188           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13189           echo "             We recommend using the Lucid menubar instead."
13190           echo "             Re-run configure with --with-menubars='lucid'." ;;
13191 esac
13192 case "$with_scrollbars" in
13193   lucid    ) echo "  Using Lucid scrollbars."     ;;
13194   motif    ) echo "  Using Motif scrollbars."     ;;
13195   athena   ) echo "  Using Athena scrollbars."    ;;
13196   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13197 esac
13198 case "$with_dialogs" in
13199   motif    )
13200     echo "  Using Motif dialog boxes."
13201     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13202       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13203       echo "             We recommend using the Athena dialog boxes instead."
13204       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13205       echo "             Read the PROBLEMS file for more information."
13206     fi; fi
13207     ;;
13208   athena   ) echo "  Using Athena dialog boxes."    ;;
13209   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13210 esac
13211 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
13212 test "$with_clash_detection" = yes && \
13213   echo "  Clash detection will use \"$lockdir\" for locking files."
13214 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13215 test "$with_pop"        = yes && echo "  Using POP for mail access."
13216 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13217 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13218 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13219 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13220 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13221 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13222   != "no no no no no"; then
13223   echo "  WARNING: ---------------------------------------------------------"
13224   echo "  WARNING: Compiling in support for runtime error checking."
13225   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13226   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13227   echo "  WARNING: ---------------------------------------------------------"
13228 fi
13229 echo ""
13230 ) | tee -a Installation
13231 echo ""
13232
13233
13234 # Remove any trailing slashes in these variables.
13235 test -n "$prefix" &&
13236   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13237 test -n "$exec_prefix" &&
13238   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13239
13240
13241 for file in $internal_makefile_list; do
13242   test "$file" = src/Makefile.in && \
13243     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13244   ac_output_files="${ac_output_files+$ac_output_files }$file"
13245 done
13246 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13247 if test "$with_shlib" = "yes"; then
13248   ac_output_files="$ac_output_files lib-src/ellcc.h"
13249 fi
13250
13251 trap '' 1 2 15
13252
13253 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13254
13255 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13256 # Let make expand exec_prefix.
13257 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13258
13259 # Any assignment to VPATH causes Sun make to only execute
13260 # the first set of double-colon rules, so remove it if not needed.
13261 # If there is a colon in the path, we need to keep it.
13262 if test "x$srcdir" = x.; then
13263   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13264 fi
13265
13266 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13267
13268 DEFS=-DHAVE_CONFIG_H
13269
13270 # Without the "./", some shells look in PATH for config.status.
13271 : ${CONFIG_STATUS=./config.status}
13272
13273 echo creating $CONFIG_STATUS
13274 rm -f $CONFIG_STATUS
13275 cat > $CONFIG_STATUS <<EOF
13276 #! /bin/sh
13277 # Generated automatically by configure.
13278 # Run this file to recreate the current configuration.
13279 # This directory was configured as follows,
13280 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13281 #
13282 # $0 $ac_configure_args
13283 #
13284 # Compiler output produced by configure, useful for debugging
13285 # configure, is in ./config.log if it exists.
13286
13287 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13288 for ac_option
13289 do
13290   case "\$ac_option" in
13291   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13292     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13293     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13294   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13295     echo "$CONFIG_STATUS generated by autoconf version 2.12"
13296     exit 0 ;;
13297   -help | --help | --hel | --he | --h)
13298     echo "\$ac_cs_usage"; exit 0 ;;
13299   *) echo "\$ac_cs_usage"; exit 1 ;;
13300   esac
13301 done
13302
13303 ac_given_srcdir=$srcdir
13304 ac_given_INSTALL="$INSTALL"
13305
13306 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13307 EOF
13308 cat >> $CONFIG_STATUS <<EOF
13309
13310 # Protect against being on the right side of a sed subst in config.status.
13311 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13312  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13313 $ac_vpsub
13314 $extrasub
13315 s%@CFLAGS@%$CFLAGS%g
13316 s%@CPPFLAGS@%$CPPFLAGS%g
13317 s%@CXXFLAGS@%$CXXFLAGS%g
13318 s%@DEFS@%$DEFS%g
13319 s%@LDFLAGS@%$LDFLAGS%g
13320 s%@LIBS@%$LIBS%g
13321 s%@exec_prefix@%$exec_prefix%g
13322 s%@prefix@%$prefix%g
13323 s%@program_transform_name@%$program_transform_name%g
13324 s%@bindir@%$bindir%g
13325 s%@sbindir@%$sbindir%g
13326 s%@libexecdir@%$libexecdir%g
13327 s%@datadir@%$datadir%g
13328 s%@sysconfdir@%$sysconfdir%g
13329 s%@sharedstatedir@%$sharedstatedir%g
13330 s%@localstatedir@%$localstatedir%g
13331 s%@libdir@%$libdir%g
13332 s%@includedir@%$includedir%g
13333 s%@oldincludedir@%$oldincludedir%g
13334 s%@infodir@%$infodir%g
13335 s%@mandir@%$mandir%g
13336 s%@LN_S@%$LN_S%g
13337 s%@blddir@%$blddir%g
13338 s%@CC@%$CC%g
13339 s%@CPP@%$CPP%g
13340 s%@start_flags@%$start_flags%g
13341 s%@ld_switch_shared@%$ld_switch_shared%g
13342 s%@start_files@%$start_files%g
13343 s%@ld@%$ld%g
13344 s%@lib_gcc@%$lib_gcc%g
13345 s%@RANLIB@%$RANLIB%g
13346 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13347 s%@INSTALL_DATA@%$INSTALL_DATA%g
13348 s%@YACC@%$YACC%g
13349 s%@SET_MAKE@%$SET_MAKE%g
13350 s%@X_CFLAGS@%$X_CFLAGS%g
13351 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13352 s%@X_LIBS@%$X_LIBS%g
13353 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13354 s%@install_pp@%$install_pp%g
13355 s%@libs_xauth@%$libs_xauth%g
13356 s%@dnd_objs@%$dnd_objs%g
13357 s%@lwlib_objs@%$lwlib_objs%g
13358 s%@ALLOCA@%$ALLOCA%g
13359 s%@dll_ld@%$dll_ld%g
13360 s%@dll_cflags@%$dll_cflags%g
13361 s%@dll_ldflags@%$dll_ldflags%g
13362 s%@dll_post@%$dll_post%g
13363 s%@dll_ldo@%$dll_ldo%g
13364 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13365 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13366 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13367 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13368 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13369 s%@PROGNAME@%$PROGNAME%g
13370 s%@version@%$version%g
13371 s%@configuration@%$configuration%g
13372 s%@canonical@%$canonical%g
13373 s%@srcdir@%$srcdir%g
13374 s%@pkgdir@%$pkgdir%g
13375 s%@statedir@%$statedir%g
13376 s%@PREFIX@%$PREFIX%g
13377 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13378 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13379 s%@INFODIR@%$INFODIR%g
13380 s%@infopath@%$infopath%g
13381 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13382 s%@INFOPATH@%$INFOPATH%g
13383 s%@package_path@%$package_path%g
13384 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13385 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13386 s%@lispdir@%$lispdir%g
13387 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13388 s%@LISPDIR@%$LISPDIR%g
13389 s%@moduledir@%$moduledir%g
13390 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13391 s%@MODULEDIR@%$MODULEDIR%g
13392 s%@sitelispdir@%$sitelispdir%g
13393 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13394 s%@SITELISPDIR@%$SITELISPDIR%g
13395 s%@sitemoduledir@%$sitemoduledir%g
13396 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13397 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13398 s%@etcdir@%$etcdir%g
13399 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13400 s%@ETCDIR@%$ETCDIR%g
13401 s%@lockdir@%$lockdir%g
13402 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13403 s%@LOCKDIR@%$LOCKDIR%g
13404 s%@archlibdir@%$archlibdir%g
13405 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13406 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13407 s%@docdir@%$docdir%g
13408 s%@bitmapdir@%$bitmapdir%g
13409 s%@extra_objs@%$extra_objs%g
13410 s%@machfile@%$machfile%g
13411 s%@opsysfile@%$opsysfile%g
13412 s%@c_switch_general@%$c_switch_general%g
13413 s%@c_switch_window_system@%$c_switch_window_system%g
13414 s%@c_switch_all@%$c_switch_all%g
13415 s%@ld_switch_general@%$ld_switch_general%g
13416 s%@ld_switch_window_system@%$ld_switch_window_system%g
13417 s%@ld_switch_all@%$ld_switch_all%g
13418 s%@ld_libs_general@%$ld_libs_general%g
13419 s%@ld_libs_window_system@%$ld_libs_window_system%g
13420 s%@ld_libs_all@%$ld_libs_all%g
13421 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13422 s%@native_sound_lib@%$native_sound_lib%g
13423 s%@sound_cflags@%$sound_cflags%g
13424 s%@dynodump_arch@%$dynodump_arch%g
13425 s%@XEMACS_CC@%$XEMACS_CC%g
13426 s%@internal_makefile_list@%$internal_makefile_list%g
13427
13428 CEOF
13429 EOF
13430
13431 cat >> $CONFIG_STATUS <<\EOF
13432
13433 # Split the substitutions into bite-sized pieces for seds with
13434 # small command number limits, like on Digital OSF/1 and HP-UX.
13435 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13436 ac_file=1 # Number of current file.
13437 ac_beg=1 # First line for current file.
13438 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13439 ac_more_lines=:
13440 ac_sed_cmds=""
13441 while $ac_more_lines; do
13442   if test $ac_beg -gt 1; then
13443     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13444   else
13445     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13446   fi
13447   if test ! -s conftest.s$ac_file; then
13448     ac_more_lines=false
13449     rm -f conftest.s$ac_file
13450   else
13451     if test -z "$ac_sed_cmds"; then
13452       ac_sed_cmds="sed -f conftest.s$ac_file"
13453     else
13454       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13455     fi
13456     ac_file=`expr $ac_file + 1`
13457     ac_beg=$ac_end
13458     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13459   fi
13460 done
13461 if test -z "$ac_sed_cmds"; then
13462   ac_sed_cmds=cat
13463 fi
13464 EOF
13465
13466 cat >> $CONFIG_STATUS <<EOF
13467
13468 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13469 EOF
13470 cat >> $CONFIG_STATUS <<\EOF
13471 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13472   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13473   case "$ac_file" in
13474   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13475        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13476   *) ac_file_in="${ac_file}.in" ;;
13477   esac
13478
13479   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13480
13481   # Remove last slash and all that follows it.  Not all systems have dirname.
13482   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13483   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13484     # The file is in a subdirectory.
13485     test ! -d "$ac_dir" && mkdir "$ac_dir"
13486     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13487     # A "../" for each directory in $ac_dir_suffix.
13488     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13489   else
13490     ac_dir_suffix= ac_dots=
13491   fi
13492
13493   case "$ac_given_srcdir" in
13494   .)  srcdir=.
13495       if test -z "$ac_dots"; then top_srcdir=.
13496       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13497   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13498   *) # Relative path.
13499     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13500     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13501   esac
13502
13503   case "$ac_given_INSTALL" in
13504   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13505   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13506   esac
13507
13508   echo creating "$ac_file"
13509   rm -f "$ac_file"
13510   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13511   case "$ac_file" in
13512   *Makefile*) ac_comsub="1i\\
13513 # $configure_input" ;;
13514   *) ac_comsub= ;;
13515   esac
13516
13517   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13518   sed -e "$ac_comsub
13519 s%@configure_input@%$configure_input%g
13520 s%@srcdir@%$srcdir%g
13521 s%@top_srcdir@%$top_srcdir%g
13522 s%@INSTALL@%$INSTALL%g
13523 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13524 fi; done
13525 rm -f conftest.s*
13526
13527 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13528 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13529 #
13530 # ac_d sets the value in "#define NAME VALUE" lines.
13531 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13532 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13533 ac_dC='\3'
13534 ac_dD='%g'
13535 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13536 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13537 ac_uB='\([      ]\)%\1#\2define\3'
13538 ac_uC=' '
13539 ac_uD='\4%g'
13540 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13541 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13542 ac_eB='$%\1#\2define\3'
13543 ac_eC=' '
13544 ac_eD='%g'
13545
13546 if test "${CONFIG_HEADERS+set}" != set; then
13547 EOF
13548 cat >> $CONFIG_STATUS <<EOF
13549   CONFIG_HEADERS="src/config.h lwlib/config.h"
13550 EOF
13551 cat >> $CONFIG_STATUS <<\EOF
13552 fi
13553 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13554   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13555   case "$ac_file" in
13556   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13557        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13558   *) ac_file_in="${ac_file}.in" ;;
13559   esac
13560
13561   echo creating $ac_file
13562
13563   rm -f conftest.frag conftest.in conftest.out
13564   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13565   cat $ac_file_inputs > conftest.in
13566
13567 EOF
13568
13569 # Transform confdefs.h into a sed script conftest.vals that substitutes
13570 # the proper values into config.h.in to produce config.h.  And first:
13571 # Protect against being on the right side of a sed subst in config.status.
13572 # Protect against being in an unquoted here document in config.status.
13573 rm -f conftest.vals
13574 cat > conftest.hdr <<\EOF
13575 s/[\\&%]/\\&/g
13576 s%[\\$`]%\\&%g
13577 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13578 s%ac_d%ac_u%gp
13579 s%ac_u%ac_e%gp
13580 EOF
13581 sed -n -f conftest.hdr confdefs.h > conftest.vals
13582 rm -f conftest.hdr
13583
13584 # This sed command replaces #undef with comments.  This is necessary, for
13585 # example, in the case of _POSIX_SOURCE, which is predefined and required
13586 # on some systems where configure will not decide to define it.
13587 cat >> conftest.vals <<\EOF
13588 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13589 EOF
13590
13591 # Break up conftest.vals because some shells have a limit on
13592 # the size of here documents, and old seds have small limits too.
13593
13594 rm -f conftest.tail
13595 while :
13596 do
13597   ac_lines=`grep -c . conftest.vals`
13598   # grep -c gives empty output for an empty file on some AIX systems.
13599   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13600   # Write a limited-size here document to conftest.frag.
13601   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13602   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13603   echo 'CEOF
13604   sed -f conftest.frag conftest.in > conftest.out
13605   rm -f conftest.in
13606   mv conftest.out conftest.in
13607 ' >> $CONFIG_STATUS
13608   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13609   rm -f conftest.vals
13610   mv conftest.tail conftest.vals
13611 done
13612 rm -f conftest.vals
13613
13614 cat >> $CONFIG_STATUS <<\EOF
13615   rm -f conftest.frag conftest.h
13616   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13617   cat conftest.in >> conftest.h
13618   rm -f conftest.in
13619   if cmp -s $ac_file conftest.h 2>/dev/null; then
13620     echo "$ac_file is unchanged"
13621     rm -f conftest.h
13622   else
13623     # Remove last slash and all that follows it.  Not all systems have dirname.
13624       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13625       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13626       # The file is in a subdirectory.
13627       test ! -d "$ac_dir" && mkdir "$ac_dir"
13628     fi
13629     rm -f $ac_file
13630     mv conftest.h $ac_file
13631   fi
13632 fi; done
13633
13634 EOF
13635 cat >> $CONFIG_STATUS <<EOF
13636 CPP="$CPP"
13637  top_srcdir="$srcdir"
13638  MAKE_SUBDIR="$MAKE_SUBDIR"
13639
13640 EOF
13641 cat >> $CONFIG_STATUS <<\EOF
13642 for dir in . $MAKE_SUBDIR; do
13643   (
13644     cd $dir
13645     rm -f junk.c
13646     < Makefile.in \
13647       sed -e '/^# Generated/d' \
13648           -e 's%/\*\*/#.*%%' \
13649           -e 's/^ *# */#/' \
13650           -e '/^##/d' \
13651           -e '/^#/ {
13652 p
13653 d
13654 }'        \
13655           -e '/./ {
13656 s/\([\"]\)/\\\1/g
13657 s/^/"/
13658 s/$/"/
13659 }'  > junk.c;
13660
13661
13662
13663     echo creating $dir/Makefile
13664 $CPP -I. -I${top_srcdir}/src  junk.c \
13665   | sed -e 's/^\#.*//'          \
13666         -e 's/^[        ][      ]*$//'\
13667         -e 's/^ /       /'              \
13668   | sed -n -e '/^..*$/p'        \
13669   | sed '/^\"/ {
13670         s/\\\([\"]\)/\1/g
13671         s/^[    ]*\"//
13672         s/\"[   ]*$//
13673 }' > Makefile.new
13674     chmod 444 Makefile.new
13675     mv -f Makefile.new Makefile
13676
13677     echo creating $dir/GNUmakefile
13678 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13679   | sed -e 's/^\#.*//'          \
13680         -e 's/^[        ][      ]*$//'\
13681         -e 's/^ /       /'              \
13682   | sed -n -e '/^..*$/p'        \
13683   | sed '/^\"/ {
13684         s/\\\([\"]\)/\1/g
13685         s/^[    ]*\"//
13686         s/\"[   ]*$//
13687 }' > Makefile.new
13688     chmod 444 Makefile.new
13689     mv -f Makefile.new GNUmakefile
13690
13691     rm -f junk.c
13692   )
13693 done
13694
13695 sed < config.status >> lib-src/config.values \
13696   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13697   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13698   -e 's/^\([^ ]*\) $/\1 ""/' \
13699   -e 's/ 1$/ t/'
13700
13701
13702 exit 0
13703 EOF
13704 chmod +x $CONFIG_STATUS
13705 rm -fr confdefs* $ac_clean_files
13706 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1