XEmacs 21.2.14.
[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_session    | \
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               * ) bogus_error_check=yes ;;
505             esac
506             if test "$bogus_error_check" -o \
507                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
508                 if test "$error_check_default" = yes ; then
509                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', and \`nomalloc'."
510                 else
511                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'."
512                 fi
513                 (echo "$progname: Usage error:"
514 echo " " "Valid types for the \`--$optname' option are:
515   $types."
516 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
517             elif test -n "$new_default" ; then
518                 error_check_extents=$new_default
519                 error_check_typecheck=$new_default
520                 error_check_bufpos=$new_default
521                 error_check_gc=$new_default
522                 error_check_malloc=$new_default
523                 new_default=    # reset this
524             fi
525             echeck_notfirst=true
526           done
527         ;;
528
529                                 
530                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
531         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
532         archlibdir | docdir | package_path )
533                    if test "$valomitted" = "yes"; then
534              if test "$#" = 0; then
535                  (echo "$progname: Usage error:"
536 echo " " "The \`--$optname' option requires a value."
537 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
538              fi
539              val="$1"; shift
540            fi
541            eval "$opt=\"$val\""
542
543                            case "$opt" in
544              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
545     Defining LISPDIR_USER_DEFINED
546 EOF
547 cat >> confdefs.h <<\EOF
548 #define LISPDIR_USER_DEFINED 1
549 EOF
550 }
551  ;;
552              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
553     Defining SITELISPDIR_USER_DEFINED
554 EOF
555 cat >> confdefs.h <<\EOF
556 #define SITELISPDIR_USER_DEFINED 1
557 EOF
558 }
559  ;;
560              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
561     Defining MODULEDIR_USER_DEFINED
562 EOF
563 cat >> confdefs.h <<\EOF
564 #define MODULEDIR_USER_DEFINED 1
565 EOF
566 }
567  ;;
568              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
569     Defining ETCDIR_USER_DEFINED
570 EOF
571 cat >> confdefs.h <<\EOF
572 #define ETCDIR_USER_DEFINED 1
573 EOF
574 }
575  ;;
576              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
577     Defining INFODIR_USER_DEFINED
578 EOF
579 cat >> confdefs.h <<\EOF
580 #define INFODIR_USER_DEFINED 1
581 EOF
582 }
583  ;;
584              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
585     Defining INFOPATH_USER_DEFINED
586 EOF
587 cat >> confdefs.h <<\EOF
588 #define INFOPATH_USER_DEFINED 1
589 EOF
590 }
591  ;;
592              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
593     Defining PACKAGE_PATH_USER_DEFINED
594 EOF
595 cat >> confdefs.h <<\EOF
596 #define PACKAGE_PATH_USER_DEFINED 1
597 EOF
598 }
599  ;;
600              datadir )
601                 { test "$extra_verbose" = "yes" && cat << \EOF
602     Defining INFODIR_USER_DEFINED
603 EOF
604 cat >> confdefs.h <<\EOF
605 #define INFODIR_USER_DEFINED 1
606 EOF
607 }
608
609                 { test "$extra_verbose" = "yes" && cat << \EOF
610     Defining LISPDIR_USER_DEFINED
611 EOF
612 cat >> confdefs.h <<\EOF
613 #define LISPDIR_USER_DEFINED 1
614 EOF
615 }
616
617             { test "$extra_verbose" = "yes" && cat << \EOF
618     Defining MODULEDIR_USER_DEFINED
619 EOF
620 cat >> confdefs.h <<\EOF
621 #define MODULEDIR_USER_DEFINED 1
622 EOF
623 }
624
625                 { test "$extra_verbose" = "yes" && cat << \EOF
626     Defining ETCDIR_USER_DEFINED
627 EOF
628 cat >> confdefs.h <<\EOF
629 #define ETCDIR_USER_DEFINED 1
630 EOF
631 }
632  ;;
633              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
634     Defining LOCKDIR_USER_DEFINED
635 EOF
636 cat >> confdefs.h <<\EOF
637 #define LOCKDIR_USER_DEFINED 1
638 EOF
639 }
640  ;;
641              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
642     Defining ARCHLIBDIR_USER_DEFINED
643 EOF
644 cat >> confdefs.h <<\EOF
645 #define ARCHLIBDIR_USER_DEFINED 1
646 EOF
647 }
648  ;;
649            esac
650         ;;
651
652                 "no_create" ) ;;
653
654                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
655
656                 "with_menubars"   | \
657         "with_scrollbars" | \
658         "with_dialogs" )
659           case "$val" in
660             l | lu | luc | luci | lucid )               val=lucid  ;;
661             m | mo | mot | moti | motif )               val=motif  ;;
662             athena3d | athena-3d )                      val=athena3d ;;
663             a | at | ath | athe | athen | athena )      val=athena ;;
664             n | no | non | none )                       val=no ;;
665             * ) (echo "$progname: Usage error:"
666 echo " " "The \`--$optname' option must have one of these values:
667   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
668 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
669           esac
670           eval "$opt=\"$val\""
671         ;;
672
673                 "run_in_place"  | \
674         "with_gnu_make" )
675           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
676         ;;
677
678                 * ) (echo "$progname: Usage error:"
679 echo " " "Unrecognized option: $arg"
680 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
681
682       esac
683     ;;
684
685         *-*-*) configuration="$arg" ;;
686
687         *) (echo "$progname: Usage error:"
688 echo " " "Unrecognized argument: $arg"
689 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
690
691   esac
692 done
693
694
695 test -n "$cpp"      && CPP="$cpp"
696 test -n "$cppflags" && CPPFLAGS="$cppflags"
697 test -n "$libs"     && LIBS="$libs"
698 test -n "$ldflags"  && LDFLAGS="$ldflags"
699
700 eval set x "$quoted_arguments"; shift
701
702 test "$extra_verbose" = "yes" && verbose=yes
703
704 test -n "$with_x" && with_x11="$with_x"
705
706 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
707   test "$with_system_malloc" = "default" && with_system_malloc=yes
708 fi
709
710
711
712 if test "$with_cde $with_tooltalk" = "yes no"; then
713   (echo "$progname: Usage error:"
714 echo " " "--with-cde requires --with-tooltalk"
715 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
716 elif test "$with_tooltalk" = "no" ; then with_cde=no
717 elif test "$with_cde" = "yes"; then with_tooltalk=yes
718 fi
719
720
721 case "$srcdir" in
722
723     "" )
724     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
725       if test -f "$dir/src/lisp.h" -a \
726               -f "$dir/lisp/version.el" ; then
727         srcdir="$dir"
728         break
729       fi
730     done
731     if test -z "$srcdir" ; then
732       (echo "$progname: Usage error:"
733 echo " " "Neither the current directory nor its parent seem to
734   contain the XEmacs sources.  If you do not want to build XEmacs in its
735   source tree, you should run \`$progname' in the directory in which
736   you wish to build XEmacs, using the \`--srcdir' option to say where the
737   sources may be found."
738 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
739     fi
740   ;;
741
742     * )
743     if test ! -f "$srcdir/src/lisp.h" -o \
744             ! -f "$srcdir/lisp/version.el" ; then
745       (echo "$progname: Usage error:"
746 echo " " "The directory specified with the \`--srcdir' option,
747   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
748   either run the \`$progname' script at the top of the XEmacs source
749   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
750 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
751     fi
752   ;;
753 esac
754
755 if test -z "$configuration"; then
756     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
757   if test -z "$configuration"; then
758     (echo "$progname: Usage error:"
759 echo " " "XEmacs has not been ported to this host type.
760 Try explicitly specifying the CONFIGURATION when rerunning configure."
761 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
762   fi
763 fi
764
765 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
766 echo "configure:767: checking whether ln -s works" >&5
767
768 rm -f conftestdata
769 if ln -s X conftestdata 2>/dev/null
770 then
771   rm -f conftestdata
772   ac_cv_prog_LN_S="ln -s"
773 else
774   ac_cv_prog_LN_S=ln
775 fi
776 LN_S="$ac_cv_prog_LN_S"
777 if test "$ac_cv_prog_LN_S" = "ln -s"; then
778   echo "$ac_t""yes" 1>&6
779 else
780   echo "$ac_t""no" 1>&6
781 fi
782
783
784 for dir in lisp etc man info; do
785   if test ! -d "$dir" ; then
786     echo Making symbolic link to "$srcdir/$dir"
787     ${LN_S} "$srcdir/$dir" "$dir"
788   fi
789 done
790
791
792 absolute_pwd="`pwd`";
793 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
794 then blddir="$PWD"
795 else blddir="$absolute_pwd"; if test -d "/net"; then
796   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
797   blddir=`echo "$blddir" | \
798    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
799 fi
800 fi
801
802
803 case "$srcdir" in
804   /* ) ;;
805   .  ) srcdir="$blddir" ;;
806   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
807   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
808   srcdir=`echo "$srcdir" | \
809    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
810 fi ;;
811 esac
812
813 if test `pwd` != `sh -c cd $srcdir && pwd`  \
814    && test -f "$srcdir/src/config.h"; then
815   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
816    echo "   as a build directory right now; it has been configured in its own"
817    echo "   right.  To configure in another directory as well, you MUST"
818    echo "   use GNU make.  If you do not have GNU make, then you must"
819    echo "   now do \`make distclean' in $srcdir,"
820    echo "   and then run $progname again.") >&2
821   extrasub='/^VPATH[     ]*=/c\
822 vpath %.c $(srcdir)\
823 vpath %.h $(srcdir)\
824 vpath %.y $(srcdir)\
825 vpath %.l $(srcdir)\
826 vpath %.s $(srcdir)\
827 vpath %.in $(srcdir)'
828 fi
829
830 . "$srcdir/version.sh" || exit 1;
831 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
832 : "${extra_verbose=$beta}"
833 version="${emacs_major_version}.${emacs_minor_version}"
834 { test "$extra_verbose" = "yes" && cat << EOF
835     Defining EMACS_MAJOR_VERSION = $emacs_major_version
836 EOF
837 cat >> confdefs.h <<EOF
838 #define EMACS_MAJOR_VERSION $emacs_major_version
839 EOF
840 }
841
842 { test "$extra_verbose" = "yes" && cat << EOF
843     Defining EMACS_MINOR_VERSION = $emacs_minor_version
844 EOF
845 cat >> confdefs.h <<EOF
846 #define EMACS_MINOR_VERSION $emacs_minor_version
847 EOF
848 }
849
850 if test -n "$emacs_beta_version"; then
851   version="${version}-b${emacs_beta_version}"
852   { test "$extra_verbose" = "yes" && cat << EOF
853     Defining EMACS_BETA_VERSION = $emacs_beta_version
854 EOF
855 cat >> confdefs.h <<EOF
856 #define EMACS_BETA_VERSION $emacs_beta_version
857 EOF
858 }
859
860 fi
861 { test "$extra_verbose" = "yes" && cat << EOF
862     Defining XEMACS_CODENAME = "$xemacs_codename"
863 EOF
864 cat >> confdefs.h <<EOF
865 #define XEMACS_CODENAME "$xemacs_codename"
866 EOF
867 }
868
869 { test "$extra_verbose" = "yes" && cat << EOF
870     Defining EMACS_VERSION = "$version"
871 EOF
872 cat >> confdefs.h <<EOF
873 #define EMACS_VERSION "$version"
874 EOF
875 }
876
877
878 if test "$with_infodock" = "yes"; then
879   if test ! -f ../ID-INSTALL; then
880     echo "Cannot build InfoDock without InfoDock sources"
881     with_infodock=no
882   fi
883 fi
884
885 if test "$with_infodock" = "yes"; then
886       { test "$extra_verbose" = "yes" && cat << EOF
887     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
888 EOF
889 cat >> confdefs.h <<EOF
890 #define INFODOCK_MAJOR_VERSION $infodock_major_version
891 EOF
892 }
893
894   { test "$extra_verbose" = "yes" && cat << EOF
895     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
896 EOF
897 cat >> confdefs.h <<EOF
898 #define INFODOCK_MINOR_VERSION $infodock_minor_version
899 EOF
900 }
901
902   { test "$extra_verbose" = "yes" && cat << EOF
903     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
904 EOF
905 cat >> confdefs.h <<EOF
906 #define INFODOCK_BUILD_VERSION $infodock_build_version
907 EOF
908 }
909
910   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
911   PROGNAME=infodock
912   CPPFLAGS="$CPPFLAGS -DINFODOCK"
913 else
914   PROGNAME=xemacs
915 fi
916
917 if test -n "$emacs_beta_version"; then beta=yes; else beta=no; fi
918 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
919     Defining ERROR_CHECK_EXTENTS
920 EOF
921 cat >> confdefs.h <<\EOF
922 #define ERROR_CHECK_EXTENTS 1
923 EOF
924 }
925
926 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
927     Defining ERROR_CHECK_TYPECHECK
928 EOF
929 cat >> confdefs.h <<\EOF
930 #define ERROR_CHECK_TYPECHECK 1
931 EOF
932 }
933
934 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
935     Defining ERROR_CHECK_BUFPOS
936 EOF
937 cat >> confdefs.h <<\EOF
938 #define ERROR_CHECK_BUFPOS 1
939 EOF
940 }
941
942 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
943     Defining ERROR_CHECK_GC
944 EOF
945 cat >> confdefs.h <<\EOF
946 #define ERROR_CHECK_GC 1
947 EOF
948 }
949
950 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
951     Defining ERROR_CHECK_MALLOC
952 EOF
953 cat >> confdefs.h <<\EOF
954 #define ERROR_CHECK_MALLOC 1
955 EOF
956 }
957
958 if test "${debug:=$beta}" = "yes"; then
959   use_assertions=yes memory_usage_stats=yes
960   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
961    echo "    xemacs will be linked with \"debug.o\""
962  fi
963   { test "$extra_verbose" = "yes" && cat << \EOF
964     Defining DEBUG_XEMACS
965 EOF
966 cat >> confdefs.h <<\EOF
967 #define DEBUG_XEMACS 1
968 EOF
969 }
970
971 fi
972 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
973     Defining USE_ASSERTIONS
974 EOF
975 cat >> confdefs.h <<\EOF
976 #define USE_ASSERTIONS 1
977 EOF
978 }
979
980 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
981     Defining MEMORY_USAGE_STATS
982 EOF
983 cat >> confdefs.h <<\EOF
984 #define MEMORY_USAGE_STATS 1
985 EOF
986 }
987
988
989
990 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
991 echo "configure:992: checking "host system type"" >&5
992 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
993 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
994 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
995 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
996 echo "$ac_t""$configuration" 1>&6
997
998
999
1000
1001
1002 machine='' opsys=''
1003
1004 case "$canonical" in
1005   sparc-*-*        ) machine=sparc ;;
1006   alpha*-*-*       ) machine=alpha ;;
1007   vax-*-*          ) machine=vax ;;
1008   mips-dec-*       ) machine=pmax ;;
1009   mips-sgi-*       ) machine=iris4d ;;
1010   romp-ibm-*       ) machine=ibmrt ;;
1011   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1012   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1013   powerpc*-*       ) machine=powerpc ;;
1014   hppa-*-*         ) machine=hp800 ;;
1015   m88k-dg-*        ) machine=aviion ;;
1016   m68*-sony-*      ) machine=news ;;
1017   mips-sony-*      ) machine=news-risc ;;
1018   clipper-*        ) machine=clipper ;;
1019   arm-*            ) machine=arm ;;
1020   ns32k-*          ) machine=ns32000 ;;
1021 esac
1022
1023 case "$canonical" in
1024   *-*-linux*    ) opsys=linux ;;
1025   *-*-netbsd*   ) opsys=netbsd ;;
1026   *-*-openbsd*  ) opsys=openbsd ;;
1027   *-*-nextstep* ) opsys=nextstep ;;
1028   *-*-vms       ) opsys=vms ;;
1029
1030     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1031   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1032   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1033   *-dec-osf3*                ) opsys=decosf3-1 ;;
1034   *-dec-osf4*                ) opsys=decosf4-0 ;;
1035
1036     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1037   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1038   *-*-ultrix* )         opsys=ultrix4-3 ;;
1039
1040     *-*-aix3.1*  ) opsys=aix3-1 ;;
1041   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1042   *-*-aix3*    ) opsys=aix3-2   ;;
1043   *-*-aix4.0*  ) opsys=aix4     ;;
1044   *-*-aix4.1*  ) opsys=aix4-1   ;;
1045   *-*-aix4*    ) opsys=aix4-2   ;;
1046
1047     *-gnu* )                    opsys=gnu    ;;
1048   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1049   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1050   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1051   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1052   *-*-aos*   )                  opsys=bsd4-3 ;;
1053   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1054   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1055   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1056   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1057   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1058   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1059         if test -z "$NON_GNU_CPP" ; then
1060           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1061             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1062           done
1063         fi
1064         opsys=usg5-4-2 ;;
1065     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1066     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1067 esac
1068
1069 case "$canonical" in
1070
1071     *-*-netbsd* )
1072     case "$canonical" in
1073       i[3-9]86-*-netbsd*) machine=intel386 ;;
1074       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1075                                             machine=hp9000s300 ;;
1076       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1077       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1078     esac
1079   ;;
1080
1081     *-*-openbsd* )
1082     case "${canonical}" in
1083       i386-*-openbsd*)          machine=intel386 ;;
1084       m68k-*-openbsd*)          machine=hp9000s300 ;;
1085       mipsel-*-openbsd*)        machine=pmax ;;
1086      esac
1087    ;;
1088
1089     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1090   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1091
1092     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1093   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1094
1095     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1096
1097     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1098
1099     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1100
1101     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1102
1103     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1104
1105     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1106   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1107   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1108
1109   
1110     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1111
1112     *-convex-bsd* | *-convex-convexos* )
1113     machine=convex opsys=bsd4-3
1114     NON_GNU_CPP="cc -E -P"
1115   ;;
1116
1117     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1118
1119     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1120   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1121   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1122   m88k-dg-dgux*                           ) opsys=dgux     ;;
1123
1124     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1125   m88k-motorola-sysv4* )
1126                     machine=delta88k opsys=usg5-4-2
1127   ;;
1128   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1129
1130     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1131   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1132
1133     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1134
1135     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1136   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1137   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1138
1139       m88k-harris-cxux* )
1140         case "`uname -r`" in
1141        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1142        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1143     esac
1144     NON_GNU_CPP="/lib/cpp"
1145   ;;
1146     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1147     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1148
1149     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1150
1151     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1152
1153     *-hp-hpux* )
1154         case "$canonical" in
1155       m68*  ) machine=hp9000s300 ;;
1156       hppa* ) machine=hp800      ;;
1157     esac
1158
1159     case "$canonical" in
1160       *-hp-hpux7*  )  opsys=hpux   ;;
1161       *-hp-hpux8*  )  opsys=hpux8  ;;
1162       *-hp-hpux9*  )  opsys=hpux9  ;;
1163       *-hp-hpux10* )  opsys=hpux10 ;;
1164       *-hp-hpux11* )  opsys=hpux11 ;;
1165       *            )  opsys=hpux   ;;
1166     esac
1167
1168         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1169    echo "    xemacs will be linked with \"strcat.o\""
1170  fi ;; esac
1171
1172     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1173         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1174     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1175
1176     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1177   ;;
1178
1179     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1180   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1181
1182     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1183   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1184   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1185   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1186   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1187   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1188
1189     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1190   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1191
1192     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1193
1194     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1195
1196     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1197
1198     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1199
1200       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1201
1202     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1203
1204     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1205
1206     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1207
1208     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1209
1210         mips-mips-usg* ) machine=mips4 ;;
1211   mips-mips-riscos4 )
1212     machine=mips4
1213     NON_GNU_CC="cc -systype bsd43"
1214     NON_GNU_CPP="cc -systype bsd43 -E"
1215     case "$canonical" in
1216       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1217       mips-mips-riscos5* ) opsys=riscos5 ;;
1218     esac
1219   ;;
1220   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1221   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1222
1223     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1224
1225     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1226
1227     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1228   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1229
1230     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1231
1232     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1233
1234     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1235
1236     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1237
1238     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1239   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1240
1241     mips-siemens-sysv* | mips-sni-sysv*)
1242     machine=mips-siemens opsys=usg5-4
1243     NON_GNU_CC=/usr/ccs/bin/cc
1244     NON_GNU_CPP=/usr/ccs/lib/cpp
1245   ;;
1246
1247     mips-nec-sysv*)
1248     machine=mips-nec
1249     NON_GNU_CC=/usr/ccs/bin/cc
1250     NON_GNU_CPP=/usr/ccs/lib/cpp
1251   ;;
1252
1253       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1254   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1255     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1256   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1257   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1258   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1259   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1260   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1261   mips-sgi-irix*      ) opsys=irix5-0 ;;
1262
1263     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1264   *-sony-news* ) opsys=newsos5 ;;
1265
1266     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1267
1268     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1269         case "$canonical" in
1270       m68*-sunos1* )             machine=sun1     ;;
1271       m68*-sunos2* )             machine=sun2     ;;
1272       m68* )                     machine=sun3     ;;
1273       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1274       i*86-*-* )                 machine=intel386 ;;
1275       rs6000* )                  machine=rs6000   ;;
1276     esac
1277
1278         case "$canonical" in *-sunos5*)
1279       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1280     esac
1281
1282                     case "$canonical" in
1283       *-sunos4* )
1284         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1285         : ;;
1286       *-solaris2* )
1287         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1288         RANLIB=':' ;;
1289     esac
1290
1291     case "$canonical" in
1292       *-solaris*          )
1293         opsys=sol2
1294         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1295         { test "$extra_verbose" = "yes" && cat << EOF
1296     Defining OS_RELEASE = $os_release
1297 EOF
1298 cat >> confdefs.h <<EOF
1299 #define OS_RELEASE $os_release
1300 EOF
1301 }
1302  ;;
1303
1304             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1305       *-sunos4.0*         ) opsys=sunos4-0      ;;
1306       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1307       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1308       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1309       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1310       *-mach*             ) opsys=mach-bsd4-3   ;;
1311       *                   ) opsys=bsd4-2        ;;
1312     esac
1313
1314     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1315
1316         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1317   ;;
1318
1319     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1320
1321     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1322   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1323
1324     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1325
1326     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1327
1328     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1329       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1330
1331     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1332
1333     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1334
1335     vax-dec-* )
1336     case "$canonical" in
1337       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1338       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1339       *-mach* )                         opsys=mach-bsd4-3 ;;
1340     esac
1341   ;;
1342
1343     ns16k-whitechapel-* ) machine=mg1 ;;
1344
1345     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1346
1347     i[3-9]86-*-* )
1348     machine=intel386
1349     case "$canonical" in
1350       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1351       *-isc2.2* )               opsys=isc2-2 ;;
1352       *-isc4.0* )               opsys=isc4-0 ;;
1353       *-isc4.* )                opsys=isc4-1
1354                                 GCC_TEST_OPTIONS=-posix
1355                                 NON_GCC_TEST_OPTIONS=-Xp
1356                                 ;;
1357       *-isc* )                  opsys=isc3-0 ;;
1358       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1359       *-esix* )                 opsys=esix ;;
1360       *-mach* )                 opsys=mach-bsd4-3 ;;
1361       *-xenix* )                opsys=xenix ;;
1362       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1363       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1364       *-bsdi4* )                opsys=bsdos4 ;;
1365       *-bsdi3* )                opsys=bsdos3 ;;
1366       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1367       *-bsdi2* )                opsys=bsdos2 ;;
1368       *-sco3.2v5* )             opsys=sco5 ;
1369                                                         if test "$dynamic" = "yes" ; then
1370                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1371         else
1372                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1373         fi ;;
1374       *-386bsd* )               opsys=386bsd ;;
1375       *-freebsd* )              opsys=freebsd ;;
1376       *-nextstep* )             opsys=nextstep ;;
1377       *-pc-cygwin* )            opsys=cygwin32 ;;
1378       *-pc-mingw* )             opsys=mingw32 ;
1379                                 test -z "$with_tty" && with_tty="no";;
1380           esac
1381   ;;
1382
1383     m68k-*-linux* ) machine=m68k opsys=linux ;;
1384
1385 esac
1386
1387 if test -z "$machine" -o -z "$opsys"; then
1388   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1389    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1390   ) >&2
1391   exit 1
1392 fi
1393
1394 if test -z "$dynamic"; then
1395   case "$opsys" in
1396     hpux* | sunos4* ) dynamic=no ;;
1397     *) dynamic=yes ;;
1398   esac
1399 fi
1400 if test "$dynamic" = "yes"; then
1401   case "$opsys" in
1402     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1403     decosf* ) ld_call_shared="-call_shared" ;;
1404   esac
1405 else   case "$opsys" in
1406     sol2 )
1407       echo "Static linking is not supported on Solaris 2."
1408       echo "Rerun configure without specifying --dynamic=no."
1409       exit 1 ;;
1410     linux   ) ld_call_shared="-Bstatic" ;;
1411     decosf* ) ld_call_shared="-non_shared" ;;
1412   esac
1413 fi
1414
1415 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1416
1417 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1418 { test "$extra_verbose" = "yes" && cat << EOF
1419     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1420 EOF
1421 cat >> confdefs.h <<EOF
1422 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1423 EOF
1424 }
1425
1426
1427 machfile="m/${machine}.h"
1428 opsysfile="s/${opsys}.h"
1429
1430
1431 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1432 if test "$with_workshop $with_tooltalk" = "yes no"; then
1433   (echo "$progname: Usage error:"
1434 echo " " "--with-workshop requires --with-tooltalk"
1435 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1436 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1437 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1438 fi
1439
1440 if test "$with_workshop" = "yes"; then
1441   { test "$extra_verbose" = "yes" && cat << \EOF
1442     Defining SUNPRO
1443 EOF
1444 cat >> confdefs.h <<\EOF
1445 #define SUNPRO 1
1446 EOF
1447 }
1448
1449   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1450    echo "    xemacs will be linked with \"sunpro.o\""
1451  fi
1452 fi
1453
1454 if test "$with_clash_detection" = "yes"; then
1455   { test "$extra_verbose" = "yes" && cat << \EOF
1456     Defining CLASH_DETECTION
1457 EOF
1458 cat >> confdefs.h <<\EOF
1459 #define CLASH_DETECTION 1
1460 EOF
1461 }
1462
1463   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1464    echo "    xemacs will be linked with \"filelock.o\""
1465  fi
1466 fi
1467
1468 test -n "$compiler" && CC="$compiler"
1469 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1470 fi
1471
1472 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1473 if test "${CFLAGS-unset}" != unset
1474   then cflags_specified=yes;
1475   else cflags_specified=no;
1476 fi
1477
1478 xe_save_CFLAGS="$CFLAGS"
1479
1480 # Extract the first word of "gcc", so it can be a program name with args.
1481 set dummy gcc; ac_word=$2
1482 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1483 echo "configure:1484: checking for $ac_word" >&5
1484
1485 if test -n "$CC"; then
1486   ac_cv_prog_CC="$CC" # Let the user override the test.
1487 else
1488   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1489   for ac_dir in $PATH; do
1490     test -z "$ac_dir" && ac_dir=.
1491     if test -f $ac_dir/$ac_word; then
1492       ac_cv_prog_CC="gcc"
1493       break
1494     fi
1495   done
1496   IFS="$ac_save_ifs"
1497 fi
1498 CC="$ac_cv_prog_CC"
1499 if test -n "$CC"; then
1500   echo "$ac_t""$CC" 1>&6
1501 else
1502   echo "$ac_t""no" 1>&6
1503 fi
1504
1505 if test -z "$CC"; then
1506   # Extract the first word of "cc", so it can be a program name with args.
1507 set dummy cc; ac_word=$2
1508 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1509 echo "configure:1510: checking for $ac_word" >&5
1510
1511 if test -n "$CC"; then
1512   ac_cv_prog_CC="$CC" # Let the user override the test.
1513 else
1514   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1515   ac_prog_rejected=no
1516   for ac_dir in $PATH; do
1517     test -z "$ac_dir" && ac_dir=.
1518     if test -f $ac_dir/$ac_word; then
1519       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1520         ac_prog_rejected=yes
1521         continue
1522       fi
1523       ac_cv_prog_CC="cc"
1524       break
1525     fi
1526   done
1527   IFS="$ac_save_ifs"
1528 if test $ac_prog_rejected = yes; then
1529   # We found a bogon in the path, so make sure we never use it.
1530   set dummy $ac_cv_prog_CC
1531   shift
1532   if test $# -gt 0; then
1533     # We chose a different compiler from the bogus one.
1534     # However, it has the same basename, so the bogon will be chosen
1535     # first if we set CC to just the basename; use the full file name.
1536     shift
1537     set dummy "$ac_dir/$ac_word" "$@"
1538     shift
1539     ac_cv_prog_CC="$@"
1540   fi
1541 fi
1542 fi
1543 CC="$ac_cv_prog_CC"
1544 if test -n "$CC"; then
1545   echo "$ac_t""$CC" 1>&6
1546 else
1547   echo "$ac_t""no" 1>&6
1548 fi
1549
1550   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1551 fi
1552
1553 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1554 echo "configure:1555: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1555
1556 ac_ext=c
1557 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1558 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1559 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1560 ac_cpp='$CPP '"$xe_cppflags"
1561 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1562 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1563 cross_compiling=no
1564
1565 cat > conftest.$ac_ext <<EOF
1566 #line 1567 "configure"
1567 #include "confdefs.h"
1568 main(){return(0);}
1569 EOF
1570 if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1571   ac_cv_prog_cc_works=yes
1572   # If we can't run a trivial program, we are probably using a cross compiler.
1573   if (./conftest; exit) 2>/dev/null; then
1574     ac_cv_prog_cc_cross=no
1575   else
1576     ac_cv_prog_cc_cross=yes
1577   fi
1578 else
1579   echo "configure: failed program was:" >&5
1580   cat conftest.$ac_ext >&5
1581   ac_cv_prog_cc_works=no
1582 fi
1583 rm -fr conftest*
1584
1585 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1586 if test $ac_cv_prog_cc_works = no; then
1587   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1588 fi
1589 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1590 echo "configure:1591: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1591 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1592 cross_compiling=$ac_cv_prog_cc_cross
1593
1594 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1595 echo "configure:1596: checking whether we are using GNU C" >&5
1596
1597 cat > conftest.c <<EOF
1598 #ifdef __GNUC__
1599   yes;
1600 #endif
1601 EOF
1602 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1603   ac_cv_prog_gcc=yes
1604 else
1605   ac_cv_prog_gcc=no
1606 fi
1607
1608 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1609
1610 if test $ac_cv_prog_gcc = yes; then
1611   GCC=yes
1612   ac_test_CFLAGS="${CFLAGS+set}"
1613   ac_save_CFLAGS="$CFLAGS"
1614   CFLAGS=
1615   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1616 echo "configure:1617: checking whether ${CC-cc} accepts -g" >&5
1617
1618 echo 'void f(){}' > conftest.c
1619 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1620   ac_cv_prog_cc_g=yes
1621 else
1622   ac_cv_prog_cc_g=no
1623 fi
1624 rm -f conftest*
1625
1626
1627 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1628   if test "$ac_test_CFLAGS" = set; then
1629     CFLAGS="$ac_save_CFLAGS"
1630   elif test $ac_cv_prog_cc_g = yes; then
1631     CFLAGS="-g -O2"
1632   else
1633     CFLAGS="-O2"
1634   fi
1635 else
1636   GCC=
1637   test "${CFLAGS+set}" = set || CFLAGS="-g"
1638 fi
1639  
1640 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1641   CC=${NON_GNU_CC-cc}
1642   # Extract the first word of "gcc", so it can be a program name with args.
1643 set dummy gcc; ac_word=$2
1644 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1645 echo "configure:1646: checking for $ac_word" >&5
1646
1647 if test -n "$CC"; then
1648   ac_cv_prog_CC="$CC" # Let the user override the test.
1649 else
1650   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1651   for ac_dir in $PATH; do
1652     test -z "$ac_dir" && ac_dir=.
1653     if test -f $ac_dir/$ac_word; then
1654       ac_cv_prog_CC="gcc"
1655       break
1656     fi
1657   done
1658   IFS="$ac_save_ifs"
1659 fi
1660 CC="$ac_cv_prog_CC"
1661 if test -n "$CC"; then
1662   echo "$ac_t""$CC" 1>&6
1663 else
1664   echo "$ac_t""no" 1>&6
1665 fi
1666
1667 if test -z "$CC"; then
1668   # Extract the first word of "cc", so it can be a program name with args.
1669 set dummy cc; ac_word=$2
1670 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1671 echo "configure:1672: checking for $ac_word" >&5
1672
1673 if test -n "$CC"; then
1674   ac_cv_prog_CC="$CC" # Let the user override the test.
1675 else
1676   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1677   ac_prog_rejected=no
1678   for ac_dir in $PATH; do
1679     test -z "$ac_dir" && ac_dir=.
1680     if test -f $ac_dir/$ac_word; then
1681       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1682         ac_prog_rejected=yes
1683         continue
1684       fi
1685       ac_cv_prog_CC="cc"
1686       break
1687     fi
1688   done
1689   IFS="$ac_save_ifs"
1690 if test $ac_prog_rejected = yes; then
1691   # We found a bogon in the path, so make sure we never use it.
1692   set dummy $ac_cv_prog_CC
1693   shift
1694   if test $# -gt 0; then
1695     # We chose a different compiler from the bogus one.
1696     # However, it has the same basename, so the bogon will be chosen
1697     # first if we set CC to just the basename; use the full file name.
1698     shift
1699     set dummy "$ac_dir/$ac_word" "$@"
1700     shift
1701     ac_cv_prog_CC="$@"
1702   fi
1703 fi
1704 fi
1705 CC="$ac_cv_prog_CC"
1706 if test -n "$CC"; then
1707   echo "$ac_t""$CC" 1>&6
1708 else
1709   echo "$ac_t""no" 1>&6
1710 fi
1711
1712   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1713 fi
1714
1715 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1716 echo "configure:1717: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1717
1718 ac_ext=c
1719 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1720 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1721 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1722 ac_cpp='$CPP '"$xe_cppflags"
1723 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1724 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1725 cross_compiling=no
1726
1727 cat > conftest.$ac_ext <<EOF
1728 #line 1729 "configure"
1729 #include "confdefs.h"
1730 main(){return(0);}
1731 EOF
1732 if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1733   ac_cv_prog_cc_works=yes
1734   # If we can't run a trivial program, we are probably using a cross compiler.
1735   if (./conftest; exit) 2>/dev/null; then
1736     ac_cv_prog_cc_cross=no
1737   else
1738     ac_cv_prog_cc_cross=yes
1739   fi
1740 else
1741   echo "configure: failed program was:" >&5
1742   cat conftest.$ac_ext >&5
1743   ac_cv_prog_cc_works=no
1744 fi
1745 rm -fr conftest*
1746
1747 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1748 if test $ac_cv_prog_cc_works = no; then
1749   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1750 fi
1751 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1752 echo "configure:1753: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1753 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1754 cross_compiling=$ac_cv_prog_cc_cross
1755
1756 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1757 echo "configure:1758: checking whether we are using GNU C" >&5
1758
1759 cat > conftest.c <<EOF
1760 #ifdef __GNUC__
1761   yes;
1762 #endif
1763 EOF
1764 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1765   ac_cv_prog_gcc=yes
1766 else
1767   ac_cv_prog_gcc=no
1768 fi
1769
1770 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1771
1772 if test $ac_cv_prog_gcc = yes; then
1773   GCC=yes
1774   ac_test_CFLAGS="${CFLAGS+set}"
1775   ac_save_CFLAGS="$CFLAGS"
1776   CFLAGS=
1777   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1778 echo "configure:1779: checking whether ${CC-cc} accepts -g" >&5
1779
1780 echo 'void f(){}' > conftest.c
1781 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1782   ac_cv_prog_cc_g=yes
1783 else
1784   ac_cv_prog_cc_g=no
1785 fi
1786 rm -f conftest*
1787
1788
1789 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1790   if test "$ac_test_CFLAGS" = set; then
1791     CFLAGS="$ac_save_CFLAGS"
1792   elif test $ac_cv_prog_cc_g = yes; then
1793     CFLAGS="-g -O2"
1794   else
1795     CFLAGS="-O2"
1796   fi
1797 else
1798   GCC=
1799   test "${CFLAGS+set}" = set || CFLAGS="-g"
1800 fi
1801
1802 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1803   CC=gcc
1804   # Extract the first word of "gcc", so it can be a program name with args.
1805 set dummy gcc; ac_word=$2
1806 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1807 echo "configure:1808: checking for $ac_word" >&5
1808
1809 if test -n "$CC"; then
1810   ac_cv_prog_CC="$CC" # Let the user override the test.
1811 else
1812   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1813   for ac_dir in $PATH; do
1814     test -z "$ac_dir" && ac_dir=.
1815     if test -f $ac_dir/$ac_word; then
1816       ac_cv_prog_CC="gcc"
1817       break
1818     fi
1819   done
1820   IFS="$ac_save_ifs"
1821 fi
1822 CC="$ac_cv_prog_CC"
1823 if test -n "$CC"; then
1824   echo "$ac_t""$CC" 1>&6
1825 else
1826   echo "$ac_t""no" 1>&6
1827 fi
1828
1829 if test -z "$CC"; then
1830   # Extract the first word of "cc", so it can be a program name with args.
1831 set dummy cc; ac_word=$2
1832 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1833 echo "configure:1834: checking for $ac_word" >&5
1834
1835 if test -n "$CC"; then
1836   ac_cv_prog_CC="$CC" # Let the user override the test.
1837 else
1838   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1839   ac_prog_rejected=no
1840   for ac_dir in $PATH; do
1841     test -z "$ac_dir" && ac_dir=.
1842     if test -f $ac_dir/$ac_word; then
1843       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1844         ac_prog_rejected=yes
1845         continue
1846       fi
1847       ac_cv_prog_CC="cc"
1848       break
1849     fi
1850   done
1851   IFS="$ac_save_ifs"
1852 if test $ac_prog_rejected = yes; then
1853   # We found a bogon in the path, so make sure we never use it.
1854   set dummy $ac_cv_prog_CC
1855   shift
1856   if test $# -gt 0; then
1857     # We chose a different compiler from the bogus one.
1858     # However, it has the same basename, so the bogon will be chosen
1859     # first if we set CC to just the basename; use the full file name.
1860     shift
1861     set dummy "$ac_dir/$ac_word" "$@"
1862     shift
1863     ac_cv_prog_CC="$@"
1864   fi
1865 fi
1866 fi
1867 CC="$ac_cv_prog_CC"
1868 if test -n "$CC"; then
1869   echo "$ac_t""$CC" 1>&6
1870 else
1871   echo "$ac_t""no" 1>&6
1872 fi
1873
1874   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1875 fi
1876
1877 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1878 echo "configure:1879: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1879
1880 ac_ext=c
1881 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1882 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1883 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1884 ac_cpp='$CPP '"$xe_cppflags"
1885 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1886 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1887 cross_compiling=no
1888
1889 cat > conftest.$ac_ext <<EOF
1890 #line 1891 "configure"
1891 #include "confdefs.h"
1892 main(){return(0);}
1893 EOF
1894 if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1895   ac_cv_prog_cc_works=yes
1896   # If we can't run a trivial program, we are probably using a cross compiler.
1897   if (./conftest; exit) 2>/dev/null; then
1898     ac_cv_prog_cc_cross=no
1899   else
1900     ac_cv_prog_cc_cross=yes
1901   fi
1902 else
1903   echo "configure: failed program was:" >&5
1904   cat conftest.$ac_ext >&5
1905   ac_cv_prog_cc_works=no
1906 fi
1907 rm -fr conftest*
1908
1909 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1910 if test $ac_cv_prog_cc_works = no; then
1911   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1912 fi
1913 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1914 echo "configure:1915: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1915 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1916 cross_compiling=$ac_cv_prog_cc_cross
1917
1918 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1919 echo "configure:1920: checking whether we are using GNU C" >&5
1920
1921 cat > conftest.c <<EOF
1922 #ifdef __GNUC__
1923   yes;
1924 #endif
1925 EOF
1926 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1927   ac_cv_prog_gcc=yes
1928 else
1929   ac_cv_prog_gcc=no
1930 fi
1931
1932 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1933
1934 if test $ac_cv_prog_gcc = yes; then
1935   GCC=yes
1936   ac_test_CFLAGS="${CFLAGS+set}"
1937   ac_save_CFLAGS="$CFLAGS"
1938   CFLAGS=
1939   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1940 echo "configure:1941: checking whether ${CC-cc} accepts -g" >&5
1941
1942 echo 'void f(){}' > conftest.c
1943 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1944   ac_cv_prog_cc_g=yes
1945 else
1946   ac_cv_prog_cc_g=no
1947 fi
1948 rm -f conftest*
1949
1950
1951 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1952   if test "$ac_test_CFLAGS" = set; then
1953     CFLAGS="$ac_save_CFLAGS"
1954   elif test $ac_cv_prog_cc_g = yes; then
1955     CFLAGS="-g -O2"
1956   else
1957     CFLAGS="-O2"
1958   fi
1959 else
1960   GCC=
1961   test "${CFLAGS+set}" = set || CFLAGS="-g"
1962 fi
1963
1964 fi
1965 CFLAGS="$xe_save_CFLAGS"
1966
1967
1968 test -n "$CPP" -a -d "$CPP" && CPP=
1969
1970 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1971
1972 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1973 echo "configure:1974: checking how to run the C preprocessor" >&5
1974 # On Suns, sometimes $CPP names a directory.
1975 if test -n "$CPP" && test -d "$CPP"; then
1976   CPP=
1977 fi
1978 if test -z "$CPP"; then
1979
1980   # This must be in double quotes, not single quotes, because CPP may get
1981   # substituted into the Makefile and "${CC-cc}" will confuse make.
1982   CPP="${CC-cc} -E"
1983   # On the NeXT, cc -E runs the code through the compiler's parser,
1984   # not just through cpp.
1985   cat > conftest.$ac_ext <<EOF
1986 #line 1987 "configure"
1987 #include "confdefs.h"
1988 #include <assert.h>
1989 Syntax Error
1990 EOF
1991 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1992 { (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1993 ac_err=`grep -v '^ *+' conftest.out`
1994 if test -z "$ac_err"; then
1995   :
1996 else
1997   echo "$ac_err" >&5
1998   echo "configure: failed program was:" >&5
1999   cat conftest.$ac_ext >&5
2000   rm -rf conftest*
2001   CPP="${CC-cc} -E -traditional-cpp"
2002   cat > conftest.$ac_ext <<EOF
2003 #line 2004 "configure"
2004 #include "confdefs.h"
2005 #include <assert.h>
2006 Syntax Error
2007 EOF
2008 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2009 { (eval echo configure:2010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2010 ac_err=`grep -v '^ *+' conftest.out`
2011 if test -z "$ac_err"; then
2012   :
2013 else
2014   echo "$ac_err" >&5
2015   echo "configure: failed program was:" >&5
2016   cat conftest.$ac_ext >&5
2017   rm -rf conftest*
2018   CPP=/lib/cpp
2019 fi
2020 rm -f conftest*
2021 fi
2022 rm -f conftest*
2023   ac_cv_prog_CPP="$CPP"
2024   CPP="$ac_cv_prog_CPP"
2025 else
2026   ac_cv_prog_CPP="$CPP"
2027 fi
2028 echo "$ac_t""$CPP" 1>&6
2029
2030
2031 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2032 echo "configure:2033: checking for AIX" >&5
2033 cat > conftest.$ac_ext <<EOF
2034 #line 2035 "configure"
2035 #include "confdefs.h"
2036 #ifdef _AIX
2037   yes
2038 #endif
2039
2040 EOF
2041 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2042   egrep "yes" >/dev/null 2>&1; then
2043   rm -rf conftest*
2044   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2045     Defining _ALL_SOURCE
2046 EOF
2047 cat >> confdefs.h <<\EOF
2048 #define _ALL_SOURCE 1
2049 EOF
2050 }
2051
2052 else
2053   rm -rf conftest*
2054   echo "$ac_t""no" 1>&6
2055 fi
2056 rm -f conftest*
2057
2058
2059
2060 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2061 echo "configure:2062: checking for GNU libc" >&5
2062 cat > conftest.$ac_ext <<EOF
2063 #line 2064 "configure"
2064 #include "confdefs.h"
2065 #include <features.h>
2066 int main() {
2067
2068 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2069 #error Not a GNU libc system :-(
2070 ******* ======= ******** &&&&&&&&
2071 #endif
2072
2073 ; return 0; }
2074 EOF
2075 if { (eval echo configure:2076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2076   rm -rf conftest*
2077   have_glibc=yes
2078 else
2079   echo "configure: failed program was:" >&5
2080   cat conftest.$ac_ext >&5
2081   rm -rf conftest*
2082   have_glibc=no
2083 fi
2084 rm -f conftest*
2085 echo "$ac_t""$have_glibc" 1>&6
2086 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2087     Defining _GNU_SOURCE
2088 EOF
2089 cat >> confdefs.h <<\EOF
2090 #define _GNU_SOURCE 1
2091 EOF
2092 }
2093
2094
2095
2096 cat > conftest.$ac_ext <<EOF
2097 #line 2098 "configure"
2098 #include "confdefs.h"
2099 int main () {
2100 #if defined __SUNPRO_C
2101 return 11;
2102 #elif defined __DECC
2103 return 12;
2104 #else
2105 return 0;
2106 #endif
2107 }
2108 EOF
2109 if { (eval echo configure:2110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2110 then
2111   :
2112 else
2113   conftest_rc="$?"
2114   echo "configure: failed program was:" >&5
2115   cat conftest.$ac_ext >&5
2116   rm -fr conftest*
2117   case "$conftest_rc" in
2118   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2119   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2120 esac
2121 fi
2122 rm -fr conftest*
2123
2124
2125
2126
2127 echo "Extracting information from the machine- and system-dependent headers..."
2128
2129 tempcname="conftest.c"
2130
2131
2132
2133 cat > $tempcname <<EOF
2134 #define NOT_C_CODE
2135 #define C_SWITCH_SITE
2136 #define C_SWITCH_X_SITE
2137 #define LD_SWITCH_SITE
2138 #define LD_SWITCH_X_SITE
2139 #define LD_SWITCH_X_SITE_AUX
2140 #define OS_RELEASE $os_release
2141 #include "$srcdir/src/$opsysfile"
2142 #include "$srcdir/src/$machfile"
2143
2144 #ifndef LIBS_MACHINE
2145 #define LIBS_MACHINE
2146 #endif
2147 configure___ libs_machine=LIBS_MACHINE
2148
2149 #ifndef LIBS_SYSTEM
2150 #define LIBS_SYSTEM
2151 #endif
2152 configure___ libs_system=LIBS_SYSTEM
2153
2154 #ifndef LIBS_TERMCAP
2155 #define LIBS_TERMCAP
2156 #endif
2157 configure___ libs_termcap=LIBS_TERMCAP
2158
2159 #ifndef LIB_STANDARD
2160 #define LIB_STANDARD
2161 #endif
2162 configure___ libs_standard=LIB_STANDARD
2163
2164
2165 #ifndef OBJECTS_MACHINE
2166 #define OBJECTS_MACHINE
2167 #endif
2168 configure___ objects_machine=OBJECTS_MACHINE
2169
2170 #ifndef OBJECTS_SYSTEM
2171 #define OBJECTS_SYSTEM
2172 #endif
2173 configure___ objects_system=OBJECTS_SYSTEM
2174
2175
2176 #ifndef C_SWITCH_MACHINE
2177 #define C_SWITCH_MACHINE
2178 #endif
2179 configure___ c_switch_machine=C_SWITCH_MACHINE
2180
2181 #ifndef C_SWITCH_SYSTEM
2182 #define C_SWITCH_SYSTEM
2183 #endif
2184 configure___ c_switch_system=C_SWITCH_SYSTEM
2185
2186
2187 #ifndef LD_SWITCH_MACHINE
2188 #define LD_SWITCH_MACHINE
2189 #endif
2190 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2191
2192 #ifndef LD_SWITCH_SYSTEM
2193 #define LD_SWITCH_SYSTEM
2194 #endif
2195 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2196
2197
2198 #ifndef UNEXEC
2199 #define UNEXEC "unexec.o"
2200 #endif
2201 configure___ unexec=UNEXEC
2202
2203
2204 #ifndef LD_SWITCH_SHARED
2205 #define LD_SWITCH_SHARED "-c"
2206 #endif
2207 configure___ ld_switch_shared=LD_SWITCH_SHARED
2208
2209
2210 #ifdef ORDINARY_LINK
2211 #define LD "\$(CC) \$(CFLAGS)"
2212 #else /* no ORDINARY LINK */
2213 #ifdef COFF_ENCAPSULATE
2214 #define LD "\$(CC) -nostdlib"
2215 #else /* not COFF_ENCAPSULATE */
2216 #ifdef LINKER
2217 #define LD LINKER
2218 #else /* ! defined (LINKER) */
2219 #define LD "ld"
2220 #endif /* ! defined (LINKER) */
2221 #endif /* ! defined (COFF_ENCAPSULATE) */
2222 #endif /* not ORDINARY_LINK */
2223 configure___ ld=LD
2224
2225 #ifndef LIB_GCC
2226 #define LIB_GCC
2227 #endif
2228 configure___ lib_gcc=LIB_GCC
2229
2230 #ifndef LD_TEXT_START_ADDR
2231 #define LD_TEXT_START_ADDR
2232 #endif
2233 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2234
2235
2236 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2237 #ifdef NO_REMAP
2238 #ifdef COFF_ENCAPSULATE
2239 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2240 #else /* ! defined (COFF_ENCAPSULATE) */
2241 #define START_FILES "pre-crt0.o /lib/crt0.o"
2242 #endif /* ! defined (COFF_ENCAPSULATE) */
2243 #else /* ! defined (NO_REMAP) */
2244 #define START_FILES "ecrt0.o"
2245 #endif /* ! defined (NO_REMAP) */
2246 #endif /* no ORDINARY_LINK */
2247 #ifndef START_FILES
2248 #define START_FILES
2249 #endif
2250 configure___ start_files=START_FILES
2251
2252 #ifdef ORDINARY_LINK
2253 configure___ ordinary_link=yes
2254 #else
2255 configure___ ordinary_link=no
2256 #endif
2257
2258 #ifdef SYSTEM_MALLOC
2259 configure___ system_malloc=yes
2260 #else
2261 configure___ system_malloc=no
2262 #endif
2263
2264 #ifdef TERMINFO
2265 configure___ have_terminfo=yes
2266 #else
2267 configure___ have_terminfo=no
2268 #endif
2269
2270 #ifdef MAIL_USE_FLOCK
2271 configure___ mail_use_flock=yes
2272 #else
2273 configure___ mail_use_flock=no
2274 #endif
2275
2276 #ifdef MAIL_USE_LOCKF
2277 configure___ mail_use_lockf=yes
2278 #else
2279 configure___ mail_use_lockf=no
2280 #endif
2281
2282 #ifdef HAVE_WIN32_PROCESSES
2283 configure___ win32_processes=yes
2284 #else
2285 configure___ win32_processes=no
2286 #endif
2287
2288 EOF
2289
2290 CPP=`eval "echo $CPP $CPPFLAGS"`
2291 eval `$CPP -Isrc $tempcname \
2292         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2293
2294 rm $tempcname
2295
2296 test "$extra_verbose" = "yes" && \
2297   for var in libs_machine libs_system libs_termcap libs_standard   objects_machine objects_system c_switch_machine c_switch_system   ld_switch_machine ld_switch_system unexec ld_switch_shared   ld lib_gcc ld_text_start_addr start_files ordinary_link   have_terminfo mail_use_flock mail_use_lockf; do eval "echo \"$var = '\$$var'\""; done && echo ""
2298
2299 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2300
2301 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2302
2303 if test "$cflags_specified" = "no"; then
2304       if   test "$GCC" = "yes"; then
2305     CFLAGS="-g -O3 -Wall -Wno-switch"
2306               elif test "$__SUNPRO_C" = "yes"; then
2307     case "$opsys" in
2308       sol2    ) CFLAGS="-v -xO4" ;;
2309       sunos4* ) CFLAGS="-xO2";;
2310     esac
2311   elif test "$__DECC" = "yes"; then
2312     CFLAGS="-O3"
2313   elif test "$CC" = "xlc"; then
2314     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2315     else
2316     CFLAGS="-O" ;  fi
2317 fi
2318
2319
2320 if test "$GCC" = "yes"; then
2321   set x $ld_switch_system; shift; ld_switch_system=""
2322   while test -n "$1"; do
2323     case $1 in
2324       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2325       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2326       -Xlinker* ) ;;
2327       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2328     esac
2329     shift
2330   done
2331 fi
2332
2333 if test "$GCC" = "yes"; then
2334   set x $ld_switch_machine; shift; ld_switch_machine=""
2335   while test -n "$1"; do
2336     case $1 in
2337       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2338       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2339       -Xlinker* ) ;;
2340       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2341     esac
2342     shift
2343   done
2344 fi
2345
2346 if test "$GCC" = "yes"; then
2347   set x $LDFLAGS; shift; LDFLAGS=""
2348   while test -n "$1"; do
2349     case $1 in
2350       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2351       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2352       -Xlinker* ) ;;
2353       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2354     esac
2355     shift
2356   done
2357 fi
2358
2359 if test "$GCC" = "yes"; then
2360   set x $ld_call_shared; shift; ld_call_shared=""
2361   while test -n "$1"; do
2362     case $1 in
2363       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2364       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2365       -Xlinker* ) ;;
2366       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2367     esac
2368     shift
2369   done
2370 fi
2371
2372 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2373    echo "    xemacs will be linked with \"$objects_machine\""
2374  fi
2375 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2376    echo "    xemacs will be linked with \"$objects_system\""
2377  fi
2378 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2379    echo "    xemacs will be linked with \"$unexec\""
2380  fi
2381
2382 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2383 echo "configure:2384: checking for dynodump" >&5
2384 if test "$unexec" != "unexsol2.o"; then
2385   echo "$ac_t""no" 1>&6
2386 else
2387   echo "$ac_t""yes" 1>&6
2388   { test "$extra_verbose" = "yes" && cat << \EOF
2389     Defining DYNODUMP
2390 EOF
2391 cat >> confdefs.h <<\EOF
2392 #define DYNODUMP 1
2393 EOF
2394 }
2395
2396   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2397   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2398   case "$machine" in
2399     sparc   ) dynodump_arch=sparc ;;
2400     *86*    ) dynodump_arch=i386  ;;
2401     powerpc ) dynodump_arch=ppc   ;;
2402   esac
2403     test "$GCC" = "yes" && ld_switch_site="$ld_switch_site -fno-gnu-linker" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-fno-gnu-linker\" to \$ld_switch_site"; fi
2404 fi
2405
2406
2407 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2408
2409 if test "$unexec" = "unexaix.o"; then
2410   if   test "$dynamic" = "no"; then
2411   start_flags="-Wl,-bnso,-bnodelcsect"
2412   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2413   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2414     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2415   done
2416   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2417     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2418   done
2419   
2420 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2421 echo "configure:2422: checking for terminateAndUnload in -lC" >&5
2422 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2423
2424 xe_check_libs=" -lC "
2425 cat > conftest.$ac_ext <<EOF
2426 #line 2427 "configure"
2427 #include "confdefs.h"
2428 /* Override any gcc2 internal prototype to avoid an error.  */
2429 /* We use char because int might match the return type of a gcc2
2430     builtin and then its argument prototype would still apply.  */
2431 char terminateAndUnload();
2432
2433 int main() {
2434 terminateAndUnload()
2435 ; return 0; }
2436 EOF
2437 if { (eval echo configure:2438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2438   rm -rf conftest*
2439   eval "ac_cv_lib_$ac_lib_var=yes"
2440 else
2441   echo "configure: failed program was:" >&5
2442   cat conftest.$ac_ext >&5
2443   rm -rf conftest*
2444   eval "ac_cv_lib_$ac_lib_var=no"
2445 fi
2446 rm -f conftest*
2447 xe_check_libs=""
2448
2449 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2450   echo "$ac_t""yes" 1>&6
2451   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2452 else
2453   echo "$ac_t""no" 1>&6
2454 fi
2455
2456
2457   fi
2458 elif test -n "$ld_text_start_addr"; then
2459   start_flags="-T $ld_text_start_addr -e __start"
2460 fi
2461
2462
2463
2464
2465 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2466  test -z "$linker" &&  linker='$(CC) -nostdlib'
2467  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2468 fi
2469 test "$GCC" != "yes" && lib_gcc=
2470
2471
2472
2473
2474
2475 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2476 if test -n "$site_libraries"; then
2477   for arg in $site_libraries; do
2478     case "$arg" in
2479      -* ) ;;
2480      * ) test -d "$arg" || \
2481            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2482        arg="-L${arg}" ;;
2483     esac
2484     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2485   done
2486 fi
2487
2488 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2489 if test -n "$site_includes"; then
2490   for arg in $site_includes; do
2491     case "$arg" in
2492       -* ) ;;
2493       * ) test -d "$arg" || \
2494            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2495       arg="-I${arg}" ;;
2496     esac
2497     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2498   done
2499 fi
2500
2501 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2502 if test -n "$site_prefixes"; then
2503   for dir in $site_prefixes; do
2504     inc_dir="${dir}/include"
2505     lib_dir="${dir}/lib"
2506     if test ! -d "$dir"; then
2507       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2508     elif test ! -d "$inc_dir"; then
2509       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$inc_dir'" >&2; exit 1; }
2510     elif test ! -d "$lib_dir"; then
2511       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2512     else
2513       c_switch_site="$c_switch_site "-I$inc_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-I$inc_dir"\" to \$c_switch_site"; fi
2514       ld_switch_site="$ld_switch_site "-L$lib_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-L$lib_dir"\" to \$ld_switch_site"; fi
2515     fi
2516   done
2517 fi
2518
2519
2520 for dir in "/usr/ccs/lib"; do
2521   test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${dir}\" to \$ld_switch_site"; fi
2522 done
2523
2524 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2525 if test -n "$site_runtime_libraries"; then
2526   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2527   export LD_RUN_PATH
2528 fi
2529
2530
2531 if   test "$dynamic" = "no"; then add_runtime_path=no
2532 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2533 else case "$opsys" in
2534        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2535        * ) add_runtime_path=no ;;
2536      esac
2537 fi
2538
2539 if test "$add_runtime_path" = "yes"; then
2540       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2541 echo "configure:2542: checking "for runtime libraries flag"" >&5
2542   case "$opsys" in
2543     sol2 ) dash_r="-R" ;;
2544     decosf* | linux* | irix*) dash_r="-rpath " ;;
2545     *)
2546       dash_r=""
2547       for try_dash_r in "-R" "-R " "-rpath "; do
2548         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2549         
2550 if test "$GCC" = "yes"; then
2551   set x $xe_check_libs; shift; xe_check_libs=""
2552   while test -n "$1"; do
2553     case $1 in
2554       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2555       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2556       -Xlinker* ) ;;
2557       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2558     esac
2559     shift
2560   done
2561 fi
2562         cat > conftest.$ac_ext <<EOF
2563 #line 2564 "configure"
2564 #include "confdefs.h"
2565
2566 int main() {
2567
2568 ; return 0; }
2569 EOF
2570 if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2571   rm -rf conftest*
2572   dash_r="$try_dash_r"
2573 else
2574   echo "configure: failed program was:" >&5
2575   cat conftest.$ac_ext >&5
2576 fi
2577 rm -f conftest*
2578         xe_check_libs=""
2579         test -n "$dash_r" && break
2580       done ;;
2581   esac
2582   if test -n "$dash_r";
2583     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2584     else echo "$ac_t""NONE" 1>&6
2585   fi
2586 fi
2587
2588 xe_add_unique_runpath_dir='
2589   xe_add_p=yes
2590   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2591   done
2592   if test "$xe_add_p" = "yes"; then
2593     test -n "$runpath" && runpath="${runpath}:"
2594     runpath="${runpath}${xe_runpath_dir}"
2595     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2596   fi'
2597
2598
2599
2600
2601 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2602     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2603   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2604   
2605         runpath="" runpath_dirs=""
2606   if test -n "$LD_RUN_PATH"; then
2607     runpath="$LD_RUN_PATH"
2608   elif test "$GCC" = "yes"; then
2609         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2610     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2611     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2612     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2613       case "$arg" in P,* | -L* | -R* )
2614         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2615           {
2616 xe_runpath_dir="$dir"
2617   test "$xe_runpath_dir" != "/lib"     -a \
2618         "$xe_runpath_dir" != "/usr/lib" -a \
2619         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2620   eval "$xe_add_unique_runpath_dir"
2621 }
2622         done ;;
2623       esac
2624     done
2625     ld_switch_run="$ld_switch_run_save"
2626     rm -f conftest*
2627   else
2628         for arg in $ld_switch_site $ld_switch_x_site; do
2629       case "$arg" in -L*) {
2630 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2631   test "$xe_runpath_dir" != "/lib"     -a \
2632         "$xe_runpath_dir" != "/usr/lib" -a \
2633         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2634   eval "$xe_add_unique_runpath_dir"
2635 };; esac
2636     done
2637         if test "$opsys $need_motif" = "sol2 yes"; then
2638       xe_runpath_dir="/opt/SUNWdt/lib";
2639       eval "$xe_add_unique_runpath_dir";
2640     fi
2641   fi 
2642   if test -n "$runpath"; then
2643     ld_switch_run="${dash_r}${runpath}"
2644     
2645 if test "$GCC" = "yes"; then
2646   set x $ld_switch_run; shift; ld_switch_run=""
2647   while test -n "$1"; do
2648     case $1 in
2649       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2650       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2651       -Xlinker* ) ;;
2652       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2653     esac
2654     shift
2655   done
2656 fi
2657     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2658   fi
2659 fi
2660
2661
2662
2663
2664 GNU_MALLOC=yes
2665 if test "$with_dlmalloc" != "no"; then
2666         doug_lea_malloc=yes
2667 else
2668         doug_lea_malloc=no
2669 fi
2670 after_morecore_hook_exists=yes
2671 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2672 echo "configure:2673: checking for malloc_get_state" >&5
2673
2674 cat > conftest.$ac_ext <<EOF
2675 #line 2676 "configure"
2676 #include "confdefs.h"
2677 /* System header to define __stub macros and hopefully few prototypes,
2678     which can conflict with char malloc_get_state(); below.  */
2679 #include <assert.h>
2680 /* Override any gcc2 internal prototype to avoid an error.  */
2681 /* We use char because int might match the return type of a gcc2
2682     builtin and then its argument prototype would still apply.  */
2683 char malloc_get_state();
2684
2685 int main() {
2686
2687 /* The GNU C library defines this for functions which it implements
2688     to always fail with ENOSYS.  Some functions are actually named
2689     something starting with __ and the normal name is an alias.  */
2690 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2691 choke me
2692 #else
2693 malloc_get_state();
2694 #endif
2695
2696 ; return 0; }
2697 EOF
2698 if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2699   rm -rf conftest*
2700   eval "ac_cv_func_malloc_get_state=yes"
2701 else
2702   echo "configure: failed program was:" >&5
2703   cat conftest.$ac_ext >&5
2704   rm -rf conftest*
2705   eval "ac_cv_func_malloc_get_state=no"
2706 fi
2707 rm -f conftest*
2708
2709 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2710   echo "$ac_t""yes" 1>&6
2711   :
2712 else
2713   echo "$ac_t""no" 1>&6
2714 doug_lea_malloc=no
2715 fi
2716
2717 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2718 echo "configure:2719: checking for malloc_set_state" >&5
2719
2720 cat > conftest.$ac_ext <<EOF
2721 #line 2722 "configure"
2722 #include "confdefs.h"
2723 /* System header to define __stub macros and hopefully few prototypes,
2724     which can conflict with char malloc_set_state(); below.  */
2725 #include <assert.h>
2726 /* Override any gcc2 internal prototype to avoid an error.  */
2727 /* We use char because int might match the return type of a gcc2
2728     builtin and then its argument prototype would still apply.  */
2729 char malloc_set_state();
2730
2731 int main() {
2732
2733 /* The GNU C library defines this for functions which it implements
2734     to always fail with ENOSYS.  Some functions are actually named
2735     something starting with __ and the normal name is an alias.  */
2736 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2737 choke me
2738 #else
2739 malloc_set_state();
2740 #endif
2741
2742 ; return 0; }
2743 EOF
2744 if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2745   rm -rf conftest*
2746   eval "ac_cv_func_malloc_set_state=yes"
2747 else
2748   echo "configure: failed program was:" >&5
2749   cat conftest.$ac_ext >&5
2750   rm -rf conftest*
2751   eval "ac_cv_func_malloc_set_state=no"
2752 fi
2753 rm -f conftest*
2754
2755 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2756   echo "$ac_t""yes" 1>&6
2757   :
2758 else
2759   echo "$ac_t""no" 1>&6
2760 doug_lea_malloc=no
2761 fi
2762
2763 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2764 echo "configure:2765: checking whether __after_morecore_hook exists" >&5
2765 cat > conftest.$ac_ext <<EOF
2766 #line 2767 "configure"
2767 #include "confdefs.h"
2768 extern void (* __after_morecore_hook)();
2769 int main() {
2770 __after_morecore_hook = 0
2771 ; return 0; }
2772 EOF
2773 if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2774   rm -rf conftest*
2775   echo "$ac_t""yes" 1>&6
2776 else
2777   echo "configure: failed program was:" >&5
2778   cat conftest.$ac_ext >&5
2779   rm -rf conftest*
2780   echo "$ac_t""no" 1>&6
2781    after_morecore_hook_exists=no
2782 fi
2783 rm -f conftest*
2784 if test "$system_malloc" = "yes" ; then
2785   GNU_MALLOC=no
2786   GNU_MALLOC_reason="
2787   (The GNU allocators don't work with this system configuration)."
2788 elif test "$with_system_malloc" = "yes" ; then
2789   GNU_MALLOC=no
2790   GNU_MALLOC_reason="
2791   (User chose not to use GNU allocators)."
2792 elif test "$with_debug_malloc" = "yes" ; then
2793   GNU_MALLOC=no
2794   GNU_MALLOC_reason="
2795   (User chose to use Debugging Malloc)."
2796 fi
2797
2798 if test "$doug_lea_malloc" = "yes" ; then
2799   if test "$GNU_MALLOC" = yes ; then
2800     GNU_MALLOC_reason="
2801   (Using Doug Lea's new malloc from the GNU C Library.)"
2802   fi
2803   { test "$extra_verbose" = "yes" && cat << \EOF
2804     Defining DOUG_LEA_MALLOC
2805 EOF
2806 cat >> confdefs.h <<\EOF
2807 #define DOUG_LEA_MALLOC 1
2808 EOF
2809 }
2810
2811   if test "$after_morecore_hook_exists" = "no" ; then
2812     GNU_MALLOC_reason="
2813   (Using Doug Lea's new malloc from the Linux C Library.)"
2814     { test "$extra_verbose" = "yes" && cat << \EOF
2815     Defining _NO_MALLOC_WARNING_
2816 EOF
2817 cat >> confdefs.h <<\EOF
2818 #define _NO_MALLOC_WARNING_ 1
2819 EOF
2820 }
2821
2822   fi
2823   use_minimal_tagbits=yes
2824 fi
2825
2826
2827
2828
2829 # Extract the first word of "ranlib", so it can be a program name with args.
2830 set dummy ranlib; ac_word=$2
2831 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2832 echo "configure:2833: checking for $ac_word" >&5
2833
2834 if test -n "$RANLIB"; then
2835   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2836 else
2837   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2838   for ac_dir in $PATH; do
2839     test -z "$ac_dir" && ac_dir=.
2840     if test -f $ac_dir/$ac_word; then
2841       ac_cv_prog_RANLIB="ranlib"
2842       break
2843     fi
2844   done
2845   IFS="$ac_save_ifs"
2846   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2847 fi
2848 RANLIB="$ac_cv_prog_RANLIB"
2849 if test -n "$RANLIB"; then
2850   echo "$ac_t""$RANLIB" 1>&6
2851 else
2852   echo "$ac_t""no" 1>&6
2853 fi
2854
2855 ac_aux_dir=
2856 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2857   if test -f $ac_dir/install-sh; then
2858     ac_aux_dir=$ac_dir
2859     ac_install_sh="$ac_aux_dir/install-sh -c"
2860     break
2861   elif test -f $ac_dir/install.sh; then
2862     ac_aux_dir=$ac_dir
2863     ac_install_sh="$ac_aux_dir/install.sh -c"
2864     break
2865   fi
2866 done
2867 if test -z "$ac_aux_dir"; then
2868   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2869 fi
2870 ac_config_guess=$ac_aux_dir/config.guess
2871 ac_config_sub=$ac_aux_dir/config.sub
2872 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2873
2874 # Find a good install program.  We prefer a C program (faster),
2875 # so one script is as good as another.  But avoid the broken or
2876 # incompatible versions:
2877 # SysV /etc/install, /usr/sbin/install
2878 # SunOS /usr/etc/install
2879 # IRIX /sbin/install
2880 # AIX /bin/install
2881 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2882 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2883 # ./install, which can be erroneously created by make from ./install.sh.
2884 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2885 echo "configure:2886: checking for a BSD compatible install" >&5
2886 if test -z "$INSTALL"; then
2887
2888   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2889   for ac_dir in $PATH; do
2890     # Account for people who put trailing slashes in PATH elements.
2891     case "$ac_dir/" in
2892     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2893     *)
2894       # OSF1 and SCO ODT 3.0 have their own names for install.
2895       for ac_prog in ginstall installbsd scoinst install; do
2896         if test -f $ac_dir/$ac_prog; then
2897           if test $ac_prog = install &&
2898             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2899             # AIX install.  It has an incompatible calling convention.
2900             # OSF/1 installbsd also uses dspmsg, but is usable.
2901             :
2902           else
2903             ac_cv_path_install="$ac_dir/$ac_prog -c"
2904             break 2
2905           fi
2906         fi
2907       done
2908       ;;
2909     esac
2910   done
2911   IFS="$ac_save_IFS"
2912
2913   if test "${ac_cv_path_install+set}" = set; then
2914     INSTALL="$ac_cv_path_install"
2915   else
2916     # As a last resort, use the slow shell script.  We don't cache a
2917     # path for INSTALL within a source directory, because that will
2918     # break other packages using the cache if that directory is
2919     # removed, or if the path is relative.
2920     INSTALL="$ac_install_sh"
2921   fi
2922 fi
2923 echo "$ac_t""$INSTALL" 1>&6
2924
2925 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2926 # It thinks the first close brace ends the variable substitution.
2927 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2928
2929 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2930
2931 for ac_prog in 'bison -y' byacc
2932 do
2933 # Extract the first word of "$ac_prog", so it can be a program name with args.
2934 set dummy $ac_prog; ac_word=$2
2935 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2936 echo "configure:2937: checking for $ac_word" >&5
2937
2938 if test -n "$YACC"; then
2939   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2940 else
2941   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2942   for ac_dir in $PATH; do
2943     test -z "$ac_dir" && ac_dir=.
2944     if test -f $ac_dir/$ac_word; then
2945       ac_cv_prog_YACC="$ac_prog"
2946       break
2947     fi
2948   done
2949   IFS="$ac_save_ifs"
2950 fi
2951 YACC="$ac_cv_prog_YACC"
2952 if test -n "$YACC"; then
2953   echo "$ac_t""$YACC" 1>&6
2954 else
2955   echo "$ac_t""no" 1>&6
2956 fi
2957
2958 test -n "$YACC" && break
2959 done
2960 test -n "$YACC" || YACC="yacc"
2961
2962
2963 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
2964 do
2965 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2966 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2967 echo "configure:2968: checking for $ac_hdr" >&5
2968
2969 cat > conftest.$ac_ext <<EOF
2970 #line 2971 "configure"
2971 #include "confdefs.h"
2972 #include <$ac_hdr>
2973 EOF
2974 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2975 { (eval echo configure:2976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2976 ac_err=`grep -v '^ *+' conftest.out`
2977 if test -z "$ac_err"; then
2978   rm -rf conftest*
2979   eval "ac_cv_header_$ac_safe=yes"
2980 else
2981   echo "$ac_err" >&5
2982   echo "configure: failed program was:" >&5
2983   cat conftest.$ac_ext >&5
2984   rm -rf conftest*
2985   eval "ac_cv_header_$ac_safe=no"
2986 fi
2987 rm -f conftest*
2988 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2989   echo "$ac_t""yes" 1>&6
2990     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2991   { test "$extra_verbose" = "yes" && cat << EOF
2992     Defining $ac_tr_hdr
2993 EOF
2994 cat >> confdefs.h <<EOF
2995 #define $ac_tr_hdr 1
2996 EOF
2997 }
2998  
2999 else
3000   echo "$ac_t""no" 1>&6
3001 fi
3002 done
3003
3004 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3005 do
3006 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3007 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3008 echo "configure:3009: checking for $ac_hdr" >&5
3009
3010 cat > conftest.$ac_ext <<EOF
3011 #line 3012 "configure"
3012 #include "confdefs.h"
3013 #include <$ac_hdr>
3014 EOF
3015 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3016 { (eval echo configure:3017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3017 ac_err=`grep -v '^ *+' conftest.out`
3018 if test -z "$ac_err"; then
3019   rm -rf conftest*
3020   eval "ac_cv_header_$ac_safe=yes"
3021 else
3022   echo "$ac_err" >&5
3023   echo "configure: failed program was:" >&5
3024   cat conftest.$ac_ext >&5
3025   rm -rf conftest*
3026   eval "ac_cv_header_$ac_safe=no"
3027 fi
3028 rm -f conftest*
3029 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3030   echo "$ac_t""yes" 1>&6
3031     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3032   { test "$extra_verbose" = "yes" && cat << EOF
3033     Defining $ac_tr_hdr
3034 EOF
3035 cat >> confdefs.h <<EOF
3036 #define $ac_tr_hdr 1
3037 EOF
3038 }
3039  
3040 else
3041   echo "$ac_t""no" 1>&6
3042 fi
3043 done
3044
3045 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3046 do
3047 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3048 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3049 echo "configure:3050: checking for $ac_hdr" >&5
3050
3051 cat > conftest.$ac_ext <<EOF
3052 #line 3053 "configure"
3053 #include "confdefs.h"
3054 #include <$ac_hdr>
3055 EOF
3056 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3057 { (eval echo configure:3058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3058 ac_err=`grep -v '^ *+' conftest.out`
3059 if test -z "$ac_err"; then
3060   rm -rf conftest*
3061   eval "ac_cv_header_$ac_safe=yes"
3062 else
3063   echo "$ac_err" >&5
3064   echo "configure: failed program was:" >&5
3065   cat conftest.$ac_ext >&5
3066   rm -rf conftest*
3067   eval "ac_cv_header_$ac_safe=no"
3068 fi
3069 rm -f conftest*
3070 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3071   echo "$ac_t""yes" 1>&6
3072     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3073   { test "$extra_verbose" = "yes" && cat << EOF
3074     Defining $ac_tr_hdr
3075 EOF
3076 cat >> confdefs.h <<EOF
3077 #define $ac_tr_hdr 1
3078 EOF
3079 }
3080  
3081 else
3082   echo "$ac_t""no" 1>&6
3083 fi
3084 done
3085
3086 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3087 echo "configure:3088: checking for sys/wait.h that is POSIX.1 compatible" >&5
3088
3089 cat > conftest.$ac_ext <<EOF
3090 #line 3091 "configure"
3091 #include "confdefs.h"
3092 #include <sys/types.h>
3093 #include <sys/wait.h>
3094 #ifndef WEXITSTATUS
3095 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3096 #endif
3097 #ifndef WIFEXITED
3098 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3099 #endif
3100 int main() {
3101 int s;
3102 wait (&s);
3103 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3104 ; return 0; }
3105 EOF
3106 if { (eval echo configure:3107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3107   rm -rf conftest*
3108   ac_cv_header_sys_wait_h=yes
3109 else
3110   echo "configure: failed program was:" >&5
3111   cat conftest.$ac_ext >&5
3112   rm -rf conftest*
3113   ac_cv_header_sys_wait_h=no
3114 fi
3115 rm -f conftest*
3116
3117 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3118 if test $ac_cv_header_sys_wait_h = yes; then
3119   { test "$extra_verbose" = "yes" && cat << \EOF
3120     Defining HAVE_SYS_WAIT_H
3121 EOF
3122 cat >> confdefs.h <<\EOF
3123 #define HAVE_SYS_WAIT_H 1
3124 EOF
3125 }
3126
3127 fi
3128
3129 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3130 echo "configure:3131: checking for ANSI C header files" >&5
3131
3132 cat > conftest.$ac_ext <<EOF
3133 #line 3134 "configure"
3134 #include "confdefs.h"
3135 #include <stdlib.h>
3136 #include <stdarg.h>
3137 #include <string.h>
3138 #include <float.h>
3139 EOF
3140 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3141 { (eval echo configure:3142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3142 ac_err=`grep -v '^ *+' conftest.out`
3143 if test -z "$ac_err"; then
3144   rm -rf conftest*
3145   ac_cv_header_stdc=yes
3146 else
3147   echo "$ac_err" >&5
3148   echo "configure: failed program was:" >&5
3149   cat conftest.$ac_ext >&5
3150   rm -rf conftest*
3151   ac_cv_header_stdc=no
3152 fi
3153 rm -f conftest*
3154
3155 if test $ac_cv_header_stdc = yes; then
3156   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3157 cat > conftest.$ac_ext <<EOF
3158 #line 3159 "configure"
3159 #include "confdefs.h"
3160 #include <string.h>
3161 EOF
3162 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3163   egrep "memchr" >/dev/null 2>&1; then
3164   :
3165 else
3166   rm -rf conftest*
3167   ac_cv_header_stdc=no
3168 fi
3169 rm -f conftest*
3170
3171 fi
3172
3173 if test $ac_cv_header_stdc = yes; then
3174   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3175 cat > conftest.$ac_ext <<EOF
3176 #line 3177 "configure"
3177 #include "confdefs.h"
3178 #include <stdlib.h>
3179 EOF
3180 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3181   egrep "free" >/dev/null 2>&1; then
3182   :
3183 else
3184   rm -rf conftest*
3185   ac_cv_header_stdc=no
3186 fi
3187 rm -f conftest*
3188
3189 fi
3190
3191 if test $ac_cv_header_stdc = yes; then
3192   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3193 cat > conftest.$ac_ext <<EOF
3194 #line 3195 "configure"
3195 #include "confdefs.h"
3196 #include <ctype.h>
3197 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3198 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3199 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3200 int main () { int i; for (i = 0; i < 256; i++)
3201 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3202 exit (0); }
3203
3204 EOF
3205 if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3206 then
3207   :
3208 else
3209   conftest_rc="$?"
3210   echo "configure: failed program was:" >&5
3211   cat conftest.$ac_ext >&5
3212   rm -fr conftest*
3213   ac_cv_header_stdc=no
3214 fi
3215 rm -fr conftest*
3216 fi
3217
3218 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3219 if test $ac_cv_header_stdc = yes; then
3220   { test "$extra_verbose" = "yes" && cat << \EOF
3221     Defining STDC_HEADERS
3222 EOF
3223 cat >> confdefs.h <<\EOF
3224 #define STDC_HEADERS 1
3225 EOF
3226 }
3227
3228 fi
3229
3230 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3231 echo "configure:3232: checking whether time.h and sys/time.h may both be included" >&5
3232
3233 cat > conftest.$ac_ext <<EOF
3234 #line 3235 "configure"
3235 #include "confdefs.h"
3236 #include <sys/types.h>
3237 #include <sys/time.h>
3238 #include <time.h>
3239 int main() {
3240 struct tm *tp;
3241 ; return 0; }
3242 EOF
3243 if { (eval echo configure:3244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3244   rm -rf conftest*
3245   ac_cv_header_time=yes
3246 else
3247   echo "configure: failed program was:" >&5
3248   cat conftest.$ac_ext >&5
3249   rm -rf conftest*
3250   ac_cv_header_time=no
3251 fi
3252 rm -f conftest*
3253
3254 echo "$ac_t""$ac_cv_header_time" 1>&6
3255 if test $ac_cv_header_time = yes; then
3256   { test "$extra_verbose" = "yes" && cat << \EOF
3257     Defining TIME_WITH_SYS_TIME
3258 EOF
3259 cat >> confdefs.h <<\EOF
3260 #define TIME_WITH_SYS_TIME 1
3261 EOF
3262 }
3263
3264 fi
3265
3266 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3267 echo "configure:3268: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3268
3269 cat > conftest.$ac_ext <<EOF
3270 #line 3271 "configure"
3271 #include "confdefs.h"
3272 #include <sys/types.h>
3273 #include <signal.h>
3274 /* NetBSD declares sys_siglist in unistd.h.  */
3275 #ifdef HAVE_UNISTD_H
3276 #include <unistd.h>
3277 #endif
3278 int main() {
3279 char *msg = *(sys_siglist + 1);
3280 ; return 0; }
3281 EOF
3282 if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3283   rm -rf conftest*
3284   ac_cv_decl_sys_siglist=yes
3285 else
3286   echo "configure: failed program was:" >&5
3287   cat conftest.$ac_ext >&5
3288   rm -rf conftest*
3289   ac_cv_decl_sys_siglist=no
3290 fi
3291 rm -f conftest*
3292
3293 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3294 if test $ac_cv_decl_sys_siglist = yes; then
3295   { test "$extra_verbose" = "yes" && cat << \EOF
3296     Defining SYS_SIGLIST_DECLARED
3297 EOF
3298 cat >> confdefs.h <<\EOF
3299 #define SYS_SIGLIST_DECLARED 1
3300 EOF
3301 }
3302
3303 fi
3304
3305
3306 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3307 echo "configure:3308: checking for struct utimbuf" >&5
3308 cat > conftest.$ac_ext <<EOF
3309 #line 3310 "configure"
3310 #include "confdefs.h"
3311 #ifdef TIME_WITH_SYS_TIME
3312 #include <sys/time.h>
3313 #include <time.h>
3314 #else
3315 #ifdef HAVE_SYS_TIME_H
3316 #include <sys/time.h>
3317 #else
3318 #include <time.h>
3319 #endif
3320 #endif
3321 #ifdef HAVE_UTIME_H
3322 #include <utime.h>
3323 #endif
3324 int main() {
3325 static struct utimbuf x; x.actime = x.modtime;
3326 ; return 0; }
3327 EOF
3328 if { (eval echo configure:3329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3329   rm -rf conftest*
3330   echo "$ac_t""yes" 1>&6
3331    { test "$extra_verbose" = "yes" && cat << \EOF
3332     Defining HAVE_STRUCT_UTIMBUF
3333 EOF
3334 cat >> confdefs.h <<\EOF
3335 #define HAVE_STRUCT_UTIMBUF 1
3336 EOF
3337 }
3338
3339 else
3340   echo "configure: failed program was:" >&5
3341   cat conftest.$ac_ext >&5
3342   rm -rf conftest*
3343   echo "$ac_t""no" 1>&6
3344 fi
3345 rm -f conftest*
3346
3347 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3348 echo "configure:3349: checking return type of signal handlers" >&5
3349
3350 cat > conftest.$ac_ext <<EOF
3351 #line 3352 "configure"
3352 #include "confdefs.h"
3353 #include <sys/types.h>
3354 #include <signal.h>
3355 #ifdef signal
3356 #undef signal
3357 #endif
3358 #ifdef __cplusplus
3359 extern "C" void (*signal (int, void (*)(int)))(int);
3360 #else
3361 void (*signal ()) ();
3362 #endif
3363
3364 int main() {
3365 int i;
3366 ; return 0; }
3367 EOF
3368 if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3369   rm -rf conftest*
3370   ac_cv_type_signal=void
3371 else
3372   echo "configure: failed program was:" >&5
3373   cat conftest.$ac_ext >&5
3374   rm -rf conftest*
3375   ac_cv_type_signal=int
3376 fi
3377 rm -f conftest*
3378
3379 echo "$ac_t""$ac_cv_type_signal" 1>&6
3380 { test "$extra_verbose" = "yes" && cat << EOF
3381     Defining RETSIGTYPE = $ac_cv_type_signal
3382 EOF
3383 cat >> confdefs.h <<EOF
3384 #define RETSIGTYPE $ac_cv_type_signal
3385 EOF
3386 }
3387
3388
3389 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3390 echo "configure:3391: checking for size_t" >&5
3391
3392 cat > conftest.$ac_ext <<EOF
3393 #line 3394 "configure"
3394 #include "confdefs.h"
3395 #include <sys/types.h>
3396 #if STDC_HEADERS
3397 #include <stdlib.h>
3398 #include <stddef.h>
3399 #endif
3400 EOF
3401 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3402   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3403   rm -rf conftest*
3404   ac_cv_type_size_t=yes
3405 else
3406   rm -rf conftest*
3407   ac_cv_type_size_t=no
3408 fi
3409 rm -f conftest*
3410
3411 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3412 if test $ac_cv_type_size_t = no; then
3413   { test "$extra_verbose" = "yes" && cat << \EOF
3414     Defining size_t = unsigned
3415 EOF
3416 cat >> confdefs.h <<\EOF
3417 #define size_t unsigned
3418 EOF
3419 }
3420
3421 fi
3422
3423 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3424 echo "configure:3425: checking for pid_t" >&5
3425
3426 cat > conftest.$ac_ext <<EOF
3427 #line 3428 "configure"
3428 #include "confdefs.h"
3429 #include <sys/types.h>
3430 #if STDC_HEADERS
3431 #include <stdlib.h>
3432 #include <stddef.h>
3433 #endif
3434 EOF
3435 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3436   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3437   rm -rf conftest*
3438   ac_cv_type_pid_t=yes
3439 else
3440   rm -rf conftest*
3441   ac_cv_type_pid_t=no
3442 fi
3443 rm -f conftest*
3444
3445 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3446 if test $ac_cv_type_pid_t = no; then
3447   { test "$extra_verbose" = "yes" && cat << \EOF
3448     Defining pid_t = int
3449 EOF
3450 cat >> confdefs.h <<\EOF
3451 #define pid_t int
3452 EOF
3453 }
3454
3455 fi
3456
3457 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3458 echo "configure:3459: checking for uid_t in sys/types.h" >&5
3459
3460 cat > conftest.$ac_ext <<EOF
3461 #line 3462 "configure"
3462 #include "confdefs.h"
3463 #include <sys/types.h>
3464 EOF
3465 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3466   egrep "uid_t" >/dev/null 2>&1; then
3467   rm -rf conftest*
3468   ac_cv_type_uid_t=yes
3469 else
3470   rm -rf conftest*
3471   ac_cv_type_uid_t=no
3472 fi
3473 rm -f conftest*
3474
3475
3476 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3477 if test $ac_cv_type_uid_t = no; then
3478   { test "$extra_verbose" = "yes" && cat << \EOF
3479     Defining uid_t = int
3480 EOF
3481 cat >> confdefs.h <<\EOF
3482 #define uid_t int
3483 EOF
3484 }
3485
3486   { test "$extra_verbose" = "yes" && cat << \EOF
3487     Defining gid_t = int
3488 EOF
3489 cat >> confdefs.h <<\EOF
3490 #define gid_t int
3491 EOF
3492 }
3493
3494 fi
3495
3496 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3497 echo "configure:3498: checking for mode_t" >&5
3498
3499 cat > conftest.$ac_ext <<EOF
3500 #line 3501 "configure"
3501 #include "confdefs.h"
3502 #include <sys/types.h>
3503 #if STDC_HEADERS
3504 #include <stdlib.h>
3505 #include <stddef.h>
3506 #endif
3507 EOF
3508 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3509   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3510   rm -rf conftest*
3511   ac_cv_type_mode_t=yes
3512 else
3513   rm -rf conftest*
3514   ac_cv_type_mode_t=no
3515 fi
3516 rm -f conftest*
3517
3518 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3519 if test $ac_cv_type_mode_t = no; then
3520   { test "$extra_verbose" = "yes" && cat << \EOF
3521     Defining mode_t = int
3522 EOF
3523 cat >> confdefs.h <<\EOF
3524 #define mode_t int
3525 EOF
3526 }
3527
3528 fi
3529
3530 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3531 echo "configure:3532: checking for off_t" >&5
3532
3533 cat > conftest.$ac_ext <<EOF
3534 #line 3535 "configure"
3535 #include "confdefs.h"
3536 #include <sys/types.h>
3537 #if STDC_HEADERS
3538 #include <stdlib.h>
3539 #include <stddef.h>
3540 #endif
3541 EOF
3542 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3543   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3544   rm -rf conftest*
3545   ac_cv_type_off_t=yes
3546 else
3547   rm -rf conftest*
3548   ac_cv_type_off_t=no
3549 fi
3550 rm -f conftest*
3551
3552 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3553 if test $ac_cv_type_off_t = no; then
3554   { test "$extra_verbose" = "yes" && cat << \EOF
3555     Defining off_t = long
3556 EOF
3557 cat >> confdefs.h <<\EOF
3558 #define off_t long
3559 EOF
3560 }
3561
3562 fi
3563
3564
3565 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3566 echo "configure:3567: checking for struct timeval" >&5
3567 cat > conftest.$ac_ext <<EOF
3568 #line 3569 "configure"
3569 #include "confdefs.h"
3570 #ifdef TIME_WITH_SYS_TIME
3571 #include <sys/time.h>
3572 #include <time.h>
3573 #else
3574 #ifdef HAVE_SYS_TIME_H
3575 #include <sys/time.h>
3576 #else
3577 #include <time.h>
3578 #endif
3579 #endif
3580 int main() {
3581 static struct timeval x; x.tv_sec = x.tv_usec;
3582 ; return 0; }
3583 EOF
3584 if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3585   rm -rf conftest*
3586   echo "$ac_t""yes" 1>&6
3587   HAVE_TIMEVAL=yes
3588   { test "$extra_verbose" = "yes" && cat << \EOF
3589     Defining HAVE_TIMEVAL
3590 EOF
3591 cat >> confdefs.h <<\EOF
3592 #define HAVE_TIMEVAL 1
3593 EOF
3594 }
3595
3596 else
3597   echo "configure: failed program was:" >&5
3598   cat conftest.$ac_ext >&5
3599   rm -rf conftest*
3600   echo "$ac_t""no" 1>&6
3601    HAVE_TIMEVAL=no
3602 fi
3603 rm -f conftest*
3604
3605 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3606 echo "configure:3607: checking whether struct tm is in sys/time.h or time.h" >&5
3607
3608 cat > conftest.$ac_ext <<EOF
3609 #line 3610 "configure"
3610 #include "confdefs.h"
3611 #include <sys/types.h>
3612 #include <time.h>
3613 int main() {
3614 struct tm *tp; tp->tm_sec;
3615 ; return 0; }
3616 EOF
3617 if { (eval echo configure:3618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3618   rm -rf conftest*
3619   ac_cv_struct_tm=time.h
3620 else
3621   echo "configure: failed program was:" >&5
3622   cat conftest.$ac_ext >&5
3623   rm -rf conftest*
3624   ac_cv_struct_tm=sys/time.h
3625 fi
3626 rm -f conftest*
3627
3628 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3629 if test $ac_cv_struct_tm = sys/time.h; then
3630   { test "$extra_verbose" = "yes" && cat << \EOF
3631     Defining TM_IN_SYS_TIME
3632 EOF
3633 cat >> confdefs.h <<\EOF
3634 #define TM_IN_SYS_TIME 1
3635 EOF
3636 }
3637
3638 fi
3639
3640 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3641 echo "configure:3642: checking for tm_zone in struct tm" >&5
3642
3643 cat > conftest.$ac_ext <<EOF
3644 #line 3645 "configure"
3645 #include "confdefs.h"
3646 #include <sys/types.h>
3647 #include <$ac_cv_struct_tm>
3648 int main() {
3649 struct tm tm; tm.tm_zone;
3650 ; return 0; }
3651 EOF
3652 if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3653   rm -rf conftest*
3654   ac_cv_struct_tm_zone=yes
3655 else
3656   echo "configure: failed program was:" >&5
3657   cat conftest.$ac_ext >&5
3658   rm -rf conftest*
3659   ac_cv_struct_tm_zone=no
3660 fi
3661 rm -f conftest*
3662
3663 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3664 if test "$ac_cv_struct_tm_zone" = yes; then
3665   { test "$extra_verbose" = "yes" && cat << \EOF
3666     Defining HAVE_TM_ZONE
3667 EOF
3668 cat >> confdefs.h <<\EOF
3669 #define HAVE_TM_ZONE 1
3670 EOF
3671 }
3672
3673 else
3674   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3675 echo "configure:3676: checking for tzname" >&5
3676
3677 cat > conftest.$ac_ext <<EOF
3678 #line 3679 "configure"
3679 #include "confdefs.h"
3680 #include <time.h>
3681 #ifndef tzname /* For SGI.  */
3682 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3683 #endif
3684 int main() {
3685 atoi(*tzname);
3686 ; return 0; }
3687 EOF
3688 if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3689   rm -rf conftest*
3690   ac_cv_var_tzname=yes
3691 else
3692   echo "configure: failed program was:" >&5
3693   cat conftest.$ac_ext >&5
3694   rm -rf conftest*
3695   ac_cv_var_tzname=no
3696 fi
3697 rm -f conftest*
3698
3699 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3700   if test $ac_cv_var_tzname = yes; then
3701     { test "$extra_verbose" = "yes" && cat << \EOF
3702     Defining HAVE_TZNAME
3703 EOF
3704 cat >> confdefs.h <<\EOF
3705 #define HAVE_TZNAME 1
3706 EOF
3707 }
3708
3709   fi
3710 fi
3711
3712
3713 echo $ac_n "checking for working const""... $ac_c" 1>&6
3714 echo "configure:3715: checking for working const" >&5
3715
3716 cat > conftest.$ac_ext <<EOF
3717 #line 3718 "configure"
3718 #include "confdefs.h"
3719
3720 int main() {
3721
3722 /* Ultrix mips cc rejects this.  */
3723 typedef int charset[2]; const charset x;
3724 /* SunOS 4.1.1 cc rejects this.  */
3725 char const *const *ccp;
3726 char **p;
3727 /* NEC SVR4.0.2 mips cc rejects this.  */
3728 struct point {int x, y;};
3729 static struct point const zero = {0,0};
3730 /* AIX XL C 1.02.0.0 rejects this.
3731    It does not let you subtract one const X* pointer from another in an arm
3732    of an if-expression whose if-part is not a constant expression */
3733 const char *g = "string";
3734 ccp = &g + (g ? g-g : 0);
3735 /* HPUX 7.0 cc rejects these. */
3736 ++ccp;
3737 p = (char**) ccp;
3738 ccp = (char const *const *) p;
3739 { /* SCO 3.2v4 cc rejects this.  */
3740   char *t;
3741   char const *s = 0 ? (char *) 0 : (char const *) 0;
3742
3743   *t++ = 0;
3744 }
3745 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3746   int x[] = {25, 17};
3747   const int *foo = &x[0];
3748   ++foo;
3749 }
3750 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3751   typedef const int *iptr;
3752   iptr p = 0;
3753   ++p;
3754 }
3755 { /* AIX XL C 1.02.0.0 rejects this saying
3756      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3757   struct s { int j; const int *ap[3]; };
3758   struct s *b; b->j = 5;
3759 }
3760 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3761   const int foo = 10;
3762 }
3763
3764 ; return 0; }
3765 EOF
3766 if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3767   rm -rf conftest*
3768   ac_cv_c_const=yes
3769 else
3770   echo "configure: failed program was:" >&5
3771   cat conftest.$ac_ext >&5
3772   rm -rf conftest*
3773   ac_cv_c_const=no
3774 fi
3775 rm -f conftest*
3776
3777 echo "$ac_t""$ac_cv_c_const" 1>&6
3778 if test $ac_cv_c_const = no; then
3779   { test "$extra_verbose" = "yes" && cat << \EOF
3780     Defining const = 
3781 EOF
3782 cat >> confdefs.h <<\EOF
3783 #define const 
3784 EOF
3785 }
3786
3787 fi
3788
3789
3790 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3791 echo "configure:3792: checking whether ${MAKE-make} sets \${MAKE}" >&5
3792 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3793
3794 cat > conftestmake <<\EOF
3795 all:
3796         @echo 'ac_maketemp="${MAKE}"'
3797 EOF
3798 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3799 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3800 if test -n "$ac_maketemp"; then
3801   eval ac_cv_prog_make_${ac_make}_set=yes
3802 else
3803   eval ac_cv_prog_make_${ac_make}_set=no
3804 fi
3805 rm -f conftestmake
3806 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3807   echo "$ac_t""yes" 1>&6
3808   SET_MAKE=
3809 else
3810   echo "$ac_t""no" 1>&6
3811   SET_MAKE="MAKE=${MAKE-make}"
3812 fi
3813
3814
3815 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3816 echo "configure:3817: checking whether byte ordering is bigendian" >&5
3817
3818 ac_cv_c_bigendian=unknown
3819 # See if sys/param.h defines the BYTE_ORDER macro.
3820 cat > conftest.$ac_ext <<EOF
3821 #line 3822 "configure"
3822 #include "confdefs.h"
3823 #include <sys/types.h>
3824 #include <sys/param.h>
3825 int main() {
3826
3827 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3828  bogus endian macros
3829 #endif
3830 ; return 0; }
3831 EOF
3832 if { (eval echo configure:3833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3833   rm -rf conftest*
3834   # It does; now see whether it defined to BIG_ENDIAN or not.
3835 cat > conftest.$ac_ext <<EOF
3836 #line 3837 "configure"
3837 #include "confdefs.h"
3838 #include <sys/types.h>
3839 #include <sys/param.h>
3840 int main() {
3841
3842 #if BYTE_ORDER != BIG_ENDIAN
3843  not big endian
3844 #endif
3845 ; return 0; }
3846 EOF
3847 if { (eval echo configure:3848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3848   rm -rf conftest*
3849   ac_cv_c_bigendian=yes
3850 else
3851   echo "configure: failed program was:" >&5
3852   cat conftest.$ac_ext >&5
3853   rm -rf conftest*
3854   ac_cv_c_bigendian=no
3855 fi
3856 rm -f conftest*
3857 else
3858   echo "configure: failed program was:" >&5
3859   cat conftest.$ac_ext >&5
3860 fi
3861 rm -f conftest*
3862 if test $ac_cv_c_bigendian = unknown; then
3863 cat > conftest.$ac_ext <<EOF
3864 #line 3865 "configure"
3865 #include "confdefs.h"
3866 main () {
3867   /* Are we little or big endian?  From Harbison&Steele.  */
3868   union
3869   {
3870     long l;
3871     char c[sizeof (long)];
3872   } u;
3873   u.l = 1;
3874   exit (u.c[sizeof (long) - 1] == 1);
3875 }
3876 EOF
3877 if { (eval echo configure:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3878 then
3879   ac_cv_c_bigendian=no
3880 else
3881   conftest_rc="$?"
3882   echo "configure: failed program was:" >&5
3883   cat conftest.$ac_ext >&5
3884   rm -fr conftest*
3885   ac_cv_c_bigendian=yes
3886 fi
3887 rm -fr conftest*
3888 fi
3889
3890 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3891 if test $ac_cv_c_bigendian = yes; then
3892   { test "$extra_verbose" = "yes" && cat << \EOF
3893     Defining WORDS_BIGENDIAN
3894 EOF
3895 cat >> confdefs.h <<\EOF
3896 #define WORDS_BIGENDIAN 1
3897 EOF
3898 }
3899
3900 fi
3901
3902
3903 echo $ac_n "checking size of short""... $ac_c" 1>&6
3904 echo "configure:3905: checking size of short" >&5
3905
3906 cat > conftest.$ac_ext <<EOF
3907 #line 3908 "configure"
3908 #include "confdefs.h"
3909 #include <stdio.h>
3910 main()
3911 {
3912   FILE *f=fopen("conftestval", "w");
3913   if (!f) exit(1);
3914   fprintf(f, "%d\n", sizeof(short));
3915   exit(0);
3916 }
3917 EOF
3918 if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3919 then
3920   ac_cv_sizeof_short=`cat conftestval`
3921 else
3922   conftest_rc="$?"
3923   echo "configure: failed program was:" >&5
3924   cat conftest.$ac_ext >&5
3925   rm -fr conftest*
3926   ac_cv_sizeof_short=0
3927 fi
3928 rm -fr conftest*
3929 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
3930 { test "$extra_verbose" = "yes" && cat << EOF
3931     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
3932 EOF
3933 cat >> confdefs.h <<EOF
3934 #define SIZEOF_SHORT $ac_cv_sizeof_short
3935 EOF
3936 }
3937
3938
3939 if test "$ac_cv_sizeof_short" = 0; then
3940   echo ""
3941   echo "*** PANIC *** Configure tests are not working - compiler is broken."
3942   echo "*** PANIC *** Please examine config.log for compilation errors."
3943   exit 1
3944 fi
3945 echo $ac_n "checking size of int""... $ac_c" 1>&6
3946 echo "configure:3947: checking size of int" >&5
3947
3948 cat > conftest.$ac_ext <<EOF
3949 #line 3950 "configure"
3950 #include "confdefs.h"
3951 #include <stdio.h>
3952 main()
3953 {
3954   FILE *f=fopen("conftestval", "w");
3955   if (!f) exit(1);
3956   fprintf(f, "%d\n", sizeof(int));
3957   exit(0);
3958 }
3959 EOF
3960 if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3961 then
3962   ac_cv_sizeof_int=`cat conftestval`
3963 else
3964   conftest_rc="$?"
3965   echo "configure: failed program was:" >&5
3966   cat conftest.$ac_ext >&5
3967   rm -fr conftest*
3968   ac_cv_sizeof_int=0
3969 fi
3970 rm -fr conftest*
3971 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
3972 { test "$extra_verbose" = "yes" && cat << EOF
3973     Defining SIZEOF_INT = $ac_cv_sizeof_int
3974 EOF
3975 cat >> confdefs.h <<EOF
3976 #define SIZEOF_INT $ac_cv_sizeof_int
3977 EOF
3978 }
3979
3980
3981 echo $ac_n "checking size of long""... $ac_c" 1>&6
3982 echo "configure:3983: checking size of long" >&5
3983
3984 cat > conftest.$ac_ext <<EOF
3985 #line 3986 "configure"
3986 #include "confdefs.h"
3987 #include <stdio.h>
3988 main()
3989 {
3990   FILE *f=fopen("conftestval", "w");
3991   if (!f) exit(1);
3992   fprintf(f, "%d\n", sizeof(long));
3993   exit(0);
3994 }
3995 EOF
3996 if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3997 then
3998   ac_cv_sizeof_long=`cat conftestval`
3999 else
4000   conftest_rc="$?"
4001   echo "configure: failed program was:" >&5
4002   cat conftest.$ac_ext >&5
4003   rm -fr conftest*
4004   ac_cv_sizeof_long=0
4005 fi
4006 rm -fr conftest*
4007 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4008 { test "$extra_verbose" = "yes" && cat << EOF
4009     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4010 EOF
4011 cat >> confdefs.h <<EOF
4012 #define SIZEOF_LONG $ac_cv_sizeof_long
4013 EOF
4014 }
4015
4016
4017 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4018 echo "configure:4019: checking size of long long" >&5
4019
4020 cat > conftest.$ac_ext <<EOF
4021 #line 4022 "configure"
4022 #include "confdefs.h"
4023 #include <stdio.h>
4024 main()
4025 {
4026   FILE *f=fopen("conftestval", "w");
4027   if (!f) exit(1);
4028   fprintf(f, "%d\n", sizeof(long long));
4029   exit(0);
4030 }
4031 EOF
4032 if { (eval echo configure:4033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4033 then
4034   ac_cv_sizeof_long_long=`cat conftestval`
4035 else
4036   conftest_rc="$?"
4037   echo "configure: failed program was:" >&5
4038   cat conftest.$ac_ext >&5
4039   rm -fr conftest*
4040   ac_cv_sizeof_long_long=0
4041 fi
4042 rm -fr conftest*
4043 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4044 { test "$extra_verbose" = "yes" && cat << EOF
4045     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4046 EOF
4047 cat >> confdefs.h <<EOF
4048 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4049 EOF
4050 }
4051
4052
4053 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4054 echo "configure:4055: checking size of void *" >&5
4055
4056 cat > conftest.$ac_ext <<EOF
4057 #line 4058 "configure"
4058 #include "confdefs.h"
4059 #include <stdio.h>
4060 main()
4061 {
4062   FILE *f=fopen("conftestval", "w");
4063   if (!f) exit(1);
4064   fprintf(f, "%d\n", sizeof(void *));
4065   exit(0);
4066 }
4067 EOF
4068 if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4069 then
4070   ac_cv_sizeof_void_p=`cat conftestval`
4071 else
4072   conftest_rc="$?"
4073   echo "configure: failed program was:" >&5
4074   cat conftest.$ac_ext >&5
4075   rm -fr conftest*
4076   ac_cv_sizeof_void_p=0
4077 fi
4078 rm -fr conftest*
4079 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4080 { test "$extra_verbose" = "yes" && cat << EOF
4081     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4082 EOF
4083 cat >> confdefs.h <<EOF
4084 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4085 EOF
4086 }
4087
4088
4089
4090 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4091 echo "configure:4092: checking for long file names" >&5
4092
4093 ac_cv_sys_long_file_names=yes
4094 # Test for long file names in all the places we know might matter:
4095 #      .                the current directory, where building will happen
4096 #      $prefix/lib      where we will be installing things
4097 #      $exec_prefix/lib likewise
4098 # eval it to expand exec_prefix.
4099 #      $TMPDIR          if set, where it might want to write temporary files
4100 # if $TMPDIR is not set:
4101 #      /tmp             where it might want to write temporary files
4102 #      /var/tmp         likewise
4103 #      /usr/tmp         likewise
4104 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4105   ac_tmpdirs="$TMPDIR"
4106 else
4107   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4108 fi
4109 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4110   test -d $ac_dir || continue
4111   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4112   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4113   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4114   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4115   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4116     ac_cv_sys_long_file_names=no
4117     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4118     break
4119   fi
4120   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4121 done
4122
4123 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4124 if test $ac_cv_sys_long_file_names = yes; then
4125   { test "$extra_verbose" = "yes" && cat << \EOF
4126     Defining HAVE_LONG_FILE_NAMES
4127 EOF
4128 cat >> confdefs.h <<\EOF
4129 #define HAVE_LONG_FILE_NAMES 1
4130 EOF
4131 }
4132
4133 fi
4134
4135
4136 echo $ac_n "checking for sin""... $ac_c" 1>&6
4137 echo "configure:4138: checking for sin" >&5
4138
4139 cat > conftest.$ac_ext <<EOF
4140 #line 4141 "configure"
4141 #include "confdefs.h"
4142 /* System header to define __stub macros and hopefully few prototypes,
4143     which can conflict with char sin(); below.  */
4144 #include <assert.h>
4145 /* Override any gcc2 internal prototype to avoid an error.  */
4146 /* We use char because int might match the return type of a gcc2
4147     builtin and then its argument prototype would still apply.  */
4148 char sin();
4149
4150 int main() {
4151
4152 /* The GNU C library defines this for functions which it implements
4153     to always fail with ENOSYS.  Some functions are actually named
4154     something starting with __ and the normal name is an alias.  */
4155 #if defined (__stub_sin) || defined (__stub___sin)
4156 choke me
4157 #else
4158 sin();
4159 #endif
4160
4161 ; return 0; }
4162 EOF
4163 if { (eval echo configure:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4164   rm -rf conftest*
4165   eval "ac_cv_func_sin=yes"
4166 else
4167   echo "configure: failed program was:" >&5
4168   cat conftest.$ac_ext >&5
4169   rm -rf conftest*
4170   eval "ac_cv_func_sin=no"
4171 fi
4172 rm -f conftest*
4173
4174 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4175   echo "$ac_t""yes" 1>&6
4176   :
4177 else
4178   echo "$ac_t""no" 1>&6
4179
4180 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4181 echo "configure:4182: checking for sin in -lm" >&5
4182 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4183
4184 xe_check_libs=" -lm "
4185 cat > conftest.$ac_ext <<EOF
4186 #line 4187 "configure"
4187 #include "confdefs.h"
4188 /* Override any gcc2 internal prototype to avoid an error.  */
4189 /* We use char because int might match the return type of a gcc2
4190     builtin and then its argument prototype would still apply.  */
4191 char sin();
4192
4193 int main() {
4194 sin()
4195 ; return 0; }
4196 EOF
4197 if { (eval echo configure:4198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4198   rm -rf conftest*
4199   eval "ac_cv_lib_$ac_lib_var=yes"
4200 else
4201   echo "configure: failed program was:" >&5
4202   cat conftest.$ac_ext >&5
4203   rm -rf conftest*
4204   eval "ac_cv_lib_$ac_lib_var=no"
4205 fi
4206 rm -f conftest*
4207 xe_check_libs=""
4208
4209 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4210   echo "$ac_t""yes" 1>&6
4211     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4212     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4213   { test "$extra_verbose" = "yes" && cat << EOF
4214     Defining $ac_tr_lib
4215 EOF
4216 cat >> confdefs.h <<EOF
4217 #define $ac_tr_lib 1
4218 EOF
4219 }
4220
4221   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4222
4223 else
4224   echo "$ac_t""no" 1>&6
4225 fi
4226
4227
4228 fi
4229
4230
4231 { test "$extra_verbose" = "yes" && cat << \EOF
4232     Defining LISP_FLOAT_TYPE
4233 EOF
4234 cat >> confdefs.h <<\EOF
4235 #define LISP_FLOAT_TYPE 1
4236 EOF
4237 }
4238
4239
4240 cat > conftest.$ac_ext <<EOF
4241 #line 4242 "configure"
4242 #include "confdefs.h"
4243 #include <math.h>
4244 int main() {
4245 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4246 ; return 0; }
4247 EOF
4248 if { (eval echo configure:4249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4249   rm -rf conftest*
4250   { test "$extra_verbose" = "yes" && cat << \EOF
4251     Defining HAVE_INVERSE_HYPERBOLIC
4252 EOF
4253 cat >> confdefs.h <<\EOF
4254 #define HAVE_INVERSE_HYPERBOLIC 1
4255 EOF
4256 }
4257
4258 else
4259   echo "configure: failed program was:" >&5
4260   cat conftest.$ac_ext >&5
4261 fi
4262 rm -f conftest*
4263
4264 echo "checking type of mail spool file locking" 1>&6
4265 echo "configure:4266: checking type of mail spool file locking" >&5
4266 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4267 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4268 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4269     Defining REAL_MAIL_USE_LOCKF
4270 EOF
4271 cat >> confdefs.h <<\EOF
4272 #define REAL_MAIL_USE_LOCKF 1
4273 EOF
4274 }
4275
4276 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4277     Defining REAL_MAIL_USE_FLOCK
4278 EOF
4279 cat >> confdefs.h <<\EOF
4280 #define REAL_MAIL_USE_FLOCK 1
4281 EOF
4282 }
4283
4284 else mail_locking="dot-locking"
4285 fi
4286
4287 case "$opsys" in decosf*)
4288   
4289 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4290 echo "configure:4291: checking for cma_open in -lpthreads" >&5
4291 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4292
4293 xe_check_libs=" -lpthreads "
4294 cat > conftest.$ac_ext <<EOF
4295 #line 4296 "configure"
4296 #include "confdefs.h"
4297 /* Override any gcc2 internal prototype to avoid an error.  */
4298 /* We use char because int might match the return type of a gcc2
4299     builtin and then its argument prototype would still apply.  */
4300 char cma_open();
4301
4302 int main() {
4303 cma_open()
4304 ; return 0; }
4305 EOF
4306 if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4307   rm -rf conftest*
4308   eval "ac_cv_lib_$ac_lib_var=yes"
4309 else
4310   echo "configure: failed program was:" >&5
4311   cat conftest.$ac_ext >&5
4312   rm -rf conftest*
4313   eval "ac_cv_lib_$ac_lib_var=no"
4314 fi
4315 rm -f conftest*
4316 xe_check_libs=""
4317
4318 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4319   echo "$ac_t""yes" 1>&6
4320     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4321     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4322   { test "$extra_verbose" = "yes" && cat << EOF
4323     Defining $ac_tr_lib
4324 EOF
4325 cat >> confdefs.h <<EOF
4326 #define $ac_tr_lib 1
4327 EOF
4328 }
4329
4330   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4331
4332 else
4333   echo "$ac_t""no" 1>&6
4334 fi
4335
4336
4337   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4338     c_switch_site="$c_switch_site -threads" ;;
4339 esac
4340
4341 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4342 echo "configure:4343: checking whether the -xildoff compiler flag is required" >&5
4343 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4344   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4345     then echo "$ac_t""no" 1>&6;
4346     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
4347   fi
4348   else echo "$ac_t""no" 1>&6
4349 fi
4350
4351 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4352   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4353 echo "configure:4354: checking for \"-z ignore\" linker flag" >&5
4354   case "`ld -h 2>&1`" in
4355     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4356       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4357     *) echo "$ac_t""no" 1>&6 ;;
4358   esac
4359 fi
4360
4361
4362 echo "checking "for specified window system"" 1>&6
4363 echo "configure:4364: checking "for specified window system"" >&5
4364
4365 if test "$with_x11" != "no"; then
4366     test "$x_includes $x_libraries" != "NONE NONE" && \
4367    window_system=x11 with_x11=yes
4368
4369         
4370       if test "$x_includes $x_libraries" = "NONE NONE" \
4371     -a -n "$OPENWINHOME" \
4372     -a "$OPENWINHOME" != "/usr/openwin" \
4373     -a -d "$OPENWINHOME"; then
4374       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4375       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4376       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4377   fi
4378
4379   if test "$x_includes" = "NONE"; then
4380                     for dir in "/usr/X11" "/usr/X11R6"; do
4381       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4382     done
4383   fi
4384
4385   if test "$x_libraries" = "NONE"; then
4386     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4387       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4388     done
4389   fi
4390
4391   # If we find X, set shell vars x_includes and x_libraries to the
4392 # paths, otherwise set no_x=yes.
4393 # Uses ac_ vars as temps to allow command line to override cache and checks.
4394 # --without-x overrides everything else, but does not touch the cache.
4395 echo $ac_n "checking for X""... $ac_c" 1>&6
4396 echo "configure:4397: checking for X" >&5
4397
4398 # Check whether --with-x or --without-x was given.
4399 if test "${with_x+set}" = set; then
4400   withval="$with_x"
4401   :
4402 fi
4403
4404 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4405 if test "x$with_x" = xno; then
4406   # The user explicitly disabled X.
4407   have_x=disabled
4408 else
4409   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4410     # Both variables are already set.
4411     have_x=yes
4412   else
4413
4414 # One or both of the vars are not set, and there is no cached value.
4415 ac_x_includes=NO ac_x_libraries=NO
4416 rm -fr conftestdir
4417 if mkdir conftestdir; then
4418   cd conftestdir
4419   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4420   cat > Imakefile <<'EOF'
4421 acfindx:
4422         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4423 EOF
4424   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4425     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4426     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4427     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4428     for ac_extension in a so sl; do
4429       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4430         test -f $ac_im_libdir/libX11.$ac_extension; then
4431         ac_im_usrlibdir=$ac_im_libdir; break
4432       fi
4433     done
4434     # Screen out bogus values from the imake configuration.  They are
4435     # bogus both because they are the default anyway, and because
4436     # using them would break gcc on systems where it needs fixed includes.
4437     case "$ac_im_incroot" in
4438         /usr/include) ;;
4439         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4440     esac
4441     case "$ac_im_usrlibdir" in
4442         /usr/lib | /lib) ;;
4443         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4444     esac
4445   fi
4446   cd ..
4447   rm -fr conftestdir
4448 fi
4449
4450 if test "$ac_x_includes" = NO; then
4451   # Guess where to find include files, by looking for this one X11 .h file.
4452   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4453
4454   # First, try using that file with no special directory specified.
4455 cat > conftest.$ac_ext <<EOF
4456 #line 4457 "configure"
4457 #include "confdefs.h"
4458 #include <$x_direct_test_include>
4459 EOF
4460 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4461 { (eval echo configure:4462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4462 ac_err=`grep -v '^ *+' conftest.out`
4463 if test -z "$ac_err"; then
4464   rm -rf conftest*
4465   # We can compile using X headers with no special include directory.
4466 ac_x_includes=
4467 else
4468   echo "$ac_err" >&5
4469   echo "configure: failed program was:" >&5
4470   cat conftest.$ac_ext >&5
4471   rm -rf conftest*
4472   # Look for the header file in a standard set of common directories.
4473 # Check X11 before X11Rn because it is often a symlink to the current release.
4474   for ac_dir in               \
4475     /usr/X11/include          \
4476     /usr/X11R6/include        \
4477     /usr/X11R5/include        \
4478     /usr/X11R4/include        \
4479                               \
4480     /usr/include/X11          \
4481     /usr/include/X11R6        \
4482     /usr/include/X11R5        \
4483     /usr/include/X11R4        \
4484                               \
4485     /usr/local/X11/include    \
4486     /usr/local/X11R6/include  \
4487     /usr/local/X11R5/include  \
4488     /usr/local/X11R4/include  \
4489                               \
4490     /usr/local/include/X11    \
4491     /usr/local/include/X11R6  \
4492     /usr/local/include/X11R5  \
4493     /usr/local/include/X11R4  \
4494                               \
4495     /usr/X386/include         \
4496     /usr/x386/include         \
4497     /usr/XFree86/include/X11  \
4498                               \
4499     /usr/include              \
4500     /usr/local/include        \
4501     /usr/unsupported/include  \
4502     /usr/athena/include       \
4503     /usr/local/x11r5/include  \
4504     /usr/lpp/Xamples/include  \
4505                               \
4506     /usr/openwin/include      \
4507     /usr/openwin/share/include \
4508     ; \
4509   do
4510     if test -r "$ac_dir/$x_direct_test_include"; then
4511       ac_x_includes=$ac_dir
4512       break
4513     fi
4514   done
4515 fi
4516 rm -f conftest*
4517 fi # $ac_x_includes = NO
4518
4519 if test "$ac_x_libraries" = NO; then
4520   # Check for the libraries.
4521
4522   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4523   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4524
4525   # See if we find them without any special options.
4526   # Don't add to $LIBS permanently.
4527   ac_save_LIBS="$LIBS"
4528   LIBS="-l$x_direct_test_library $LIBS"
4529 cat > conftest.$ac_ext <<EOF
4530 #line 4531 "configure"
4531 #include "confdefs.h"
4532
4533 int main() {
4534 ${x_direct_test_function}()
4535 ; return 0; }
4536 EOF
4537 if { (eval echo configure:4538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4538   rm -rf conftest*
4539   LIBS="$ac_save_LIBS"
4540 # We can link X programs with no special library path.
4541 ac_x_libraries=
4542 else
4543   echo "configure: failed program was:" >&5
4544   cat conftest.$ac_ext >&5
4545   rm -rf conftest*
4546   LIBS="$ac_save_LIBS"
4547 # First see if replacing the include by lib works.
4548 # Check X11 before X11Rn because it is often a symlink to the current release.
4549 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4550     /usr/X11/lib          \
4551     /usr/X11R6/lib        \
4552     /usr/X11R5/lib        \
4553     /usr/X11R4/lib        \
4554                           \
4555     /usr/lib/X11          \
4556     /usr/lib/X11R6        \
4557     /usr/lib/X11R5        \
4558     /usr/lib/X11R4        \
4559                           \
4560     /usr/local/X11/lib    \
4561     /usr/local/X11R6/lib  \
4562     /usr/local/X11R5/lib  \
4563     /usr/local/X11R4/lib  \
4564                           \
4565     /usr/local/lib/X11    \
4566     /usr/local/lib/X11R6  \
4567     /usr/local/lib/X11R5  \
4568     /usr/local/lib/X11R4  \
4569                           \
4570     /usr/X386/lib         \
4571     /usr/x386/lib         \
4572     /usr/XFree86/lib/X11  \
4573                           \
4574     /usr/lib              \
4575     /usr/local/lib        \
4576     /usr/unsupported/lib  \
4577     /usr/athena/lib       \
4578     /usr/local/x11r5/lib  \
4579     /usr/lpp/Xamples/lib  \
4580     /lib/usr/lib/X11      \
4581                           \
4582     /usr/openwin/lib      \
4583     /usr/openwin/share/lib \
4584     ; \
4585 do
4586   for ac_extension in a so sl; do
4587     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4588       ac_x_libraries=$ac_dir
4589       break 2
4590     fi
4591   done
4592 done
4593 fi
4594 rm -f conftest*
4595 fi # $ac_x_libraries = NO
4596
4597 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4598   # Didn't find X anywhere.  Cache the known absence of X.
4599   ac_cv_have_x="have_x=no"
4600 else
4601   # Record where we found X for the cache.
4602   ac_cv_have_x="have_x=yes \
4603                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4604 fi
4605   fi
4606   eval "$ac_cv_have_x"
4607 fi # $with_x != no
4608
4609 if test "$have_x" != yes; then
4610   echo "$ac_t""$have_x" 1>&6
4611   no_x=yes
4612 else
4613   # If each of the values was on the command line, it overrides each guess.
4614   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4615   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4616   # Update the cache value to reflect the command line values.
4617   ac_cv_have_x="have_x=yes \
4618                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4619   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4620 fi
4621
4622 if test "$no_x" = yes; then
4623   # Not all programs may use this symbol, but it does not hurt to define it.
4624   { test "$extra_verbose" = "yes" && cat << \EOF
4625     Defining X_DISPLAY_MISSING
4626 EOF
4627 cat >> confdefs.h <<\EOF
4628 #define X_DISPLAY_MISSING 1
4629 EOF
4630 }
4631
4632   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4633 else
4634   if test -n "$x_includes"; then
4635     X_CFLAGS="$X_CFLAGS -I$x_includes"
4636   fi
4637
4638   # It would also be nice to do this for all -L options, not just this one.
4639   if test -n "$x_libraries"; then
4640     X_LIBS="$X_LIBS -L$x_libraries"
4641     # For Solaris; some versions of Sun CC require a space after -R and
4642     # others require no space.  Words are not sufficient . . . .
4643     case "`(uname -sr) 2>/dev/null`" in
4644     "SunOS 5"*)
4645       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4646 echo "configure:4647: checking whether -R must be followed by a space" >&5
4647       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4648       cat > conftest.$ac_ext <<EOF
4649 #line 4650 "configure"
4650 #include "confdefs.h"
4651
4652 int main() {
4653
4654 ; return 0; }
4655 EOF
4656 if { (eval echo configure:4657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4657   rm -rf conftest*
4658   ac_R_nospace=yes
4659 else
4660   echo "configure: failed program was:" >&5
4661   cat conftest.$ac_ext >&5
4662   rm -rf conftest*
4663   ac_R_nospace=no
4664 fi
4665 rm -f conftest*
4666       if test $ac_R_nospace = yes; then
4667         echo "$ac_t""no" 1>&6
4668         X_LIBS="$X_LIBS -R$x_libraries"
4669       else
4670         LIBS="$ac_xsave_LIBS -R $x_libraries"
4671         cat > conftest.$ac_ext <<EOF
4672 #line 4673 "configure"
4673 #include "confdefs.h"
4674
4675 int main() {
4676
4677 ; return 0; }
4678 EOF
4679 if { (eval echo configure:4680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4680   rm -rf conftest*
4681   ac_R_space=yes
4682 else
4683   echo "configure: failed program was:" >&5
4684   cat conftest.$ac_ext >&5
4685   rm -rf conftest*
4686   ac_R_space=no
4687 fi
4688 rm -f conftest*
4689         if test $ac_R_space = yes; then
4690           echo "$ac_t""yes" 1>&6
4691           X_LIBS="$X_LIBS -R $x_libraries"
4692         else
4693           echo "$ac_t""neither works" 1>&6
4694         fi
4695       fi
4696       LIBS="$ac_xsave_LIBS"
4697     esac
4698   fi
4699
4700   # Check for system-dependent libraries X programs must link with.
4701   # Do this before checking for the system-independent R6 libraries
4702   # (-lICE), since we may need -lsocket or whatever for X linking.
4703
4704   if test "$ISC" = yes; then
4705     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4706   else
4707     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4708     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4709     # the Alpha needs dnet_stub (dnet does not exist).
4710     if test "$with_dnet" = "no" ; then
4711 ac_cv_lib_dnet_dnet_ntoa=no
4712 else
4713
4714 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4715 echo "configure:4716: checking for dnet_ntoa in -ldnet" >&5
4716 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4717
4718 xe_check_libs=" -ldnet "
4719 cat > conftest.$ac_ext <<EOF
4720 #line 4721 "configure"
4721 #include "confdefs.h"
4722 /* Override any gcc2 internal prototype to avoid an error.  */
4723 /* We use char because int might match the return type of a gcc2
4724     builtin and then its argument prototype would still apply.  */
4725 char dnet_ntoa();
4726
4727 int main() {
4728 dnet_ntoa()
4729 ; return 0; }
4730 EOF
4731 if { (eval echo configure:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4732   rm -rf conftest*
4733   eval "ac_cv_lib_$ac_lib_var=yes"
4734 else
4735   echo "configure: failed program was:" >&5
4736   cat conftest.$ac_ext >&5
4737   rm -rf conftest*
4738   eval "ac_cv_lib_$ac_lib_var=no"
4739 fi
4740 rm -f conftest*
4741 xe_check_libs=""
4742
4743 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4744   echo "$ac_t""yes" 1>&6
4745   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4746 else
4747   echo "$ac_t""no" 1>&6
4748 fi
4749
4750 fi
4751
4752     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4753       
4754 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4755 echo "configure:4756: checking for dnet_ntoa in -ldnet_stub" >&5
4756 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4757
4758 xe_check_libs=" -ldnet_stub "
4759 cat > conftest.$ac_ext <<EOF
4760 #line 4761 "configure"
4761 #include "confdefs.h"
4762 /* Override any gcc2 internal prototype to avoid an error.  */
4763 /* We use char because int might match the return type of a gcc2
4764     builtin and then its argument prototype would still apply.  */
4765 char dnet_ntoa();
4766
4767 int main() {
4768 dnet_ntoa()
4769 ; return 0; }
4770 EOF
4771 if { (eval echo configure:4772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4772   rm -rf conftest*
4773   eval "ac_cv_lib_$ac_lib_var=yes"
4774 else
4775   echo "configure: failed program was:" >&5
4776   cat conftest.$ac_ext >&5
4777   rm -rf conftest*
4778   eval "ac_cv_lib_$ac_lib_var=no"
4779 fi
4780 rm -f conftest*
4781 xe_check_libs=""
4782
4783 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4784   echo "$ac_t""yes" 1>&6
4785   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4786 else
4787   echo "$ac_t""no" 1>&6
4788 fi
4789
4790
4791     fi
4792
4793     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4794     # to get the SysV transport functions.
4795     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4796     # needs -lnsl.
4797     # The nsl library prevents programs from opening the X display
4798     # on Irix 5.2, according to dickey@clark.net.
4799     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4800 echo "configure:4801: checking for gethostbyname" >&5
4801
4802 cat > conftest.$ac_ext <<EOF
4803 #line 4804 "configure"
4804 #include "confdefs.h"
4805 /* System header to define __stub macros and hopefully few prototypes,
4806     which can conflict with char gethostbyname(); below.  */
4807 #include <assert.h>
4808 /* Override any gcc2 internal prototype to avoid an error.  */
4809 /* We use char because int might match the return type of a gcc2
4810     builtin and then its argument prototype would still apply.  */
4811 char gethostbyname();
4812
4813 int main() {
4814
4815 /* The GNU C library defines this for functions which it implements
4816     to always fail with ENOSYS.  Some functions are actually named
4817     something starting with __ and the normal name is an alias.  */
4818 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4819 choke me
4820 #else
4821 gethostbyname();
4822 #endif
4823
4824 ; return 0; }
4825 EOF
4826 if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4827   rm -rf conftest*
4828   eval "ac_cv_func_gethostbyname=yes"
4829 else
4830   echo "configure: failed program was:" >&5
4831   cat conftest.$ac_ext >&5
4832   rm -rf conftest*
4833   eval "ac_cv_func_gethostbyname=no"
4834 fi
4835 rm -f conftest*
4836
4837 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4838   echo "$ac_t""yes" 1>&6
4839   :
4840 else
4841   echo "$ac_t""no" 1>&6
4842 fi
4843
4844     if test $ac_cv_func_gethostbyname = no; then
4845       
4846 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4847 echo "configure:4848: checking for gethostbyname in -lnsl" >&5
4848 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4849
4850 xe_check_libs=" -lnsl "
4851 cat > conftest.$ac_ext <<EOF
4852 #line 4853 "configure"
4853 #include "confdefs.h"
4854 /* Override any gcc2 internal prototype to avoid an error.  */
4855 /* We use char because int might match the return type of a gcc2
4856     builtin and then its argument prototype would still apply.  */
4857 char gethostbyname();
4858
4859 int main() {
4860 gethostbyname()
4861 ; return 0; }
4862 EOF
4863 if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4864   rm -rf conftest*
4865   eval "ac_cv_lib_$ac_lib_var=yes"
4866 else
4867   echo "configure: failed program was:" >&5
4868   cat conftest.$ac_ext >&5
4869   rm -rf conftest*
4870   eval "ac_cv_lib_$ac_lib_var=no"
4871 fi
4872 rm -f conftest*
4873 xe_check_libs=""
4874
4875 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4876   echo "$ac_t""yes" 1>&6
4877   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4878 else
4879   echo "$ac_t""no" 1>&6
4880 fi
4881
4882
4883     fi
4884
4885     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4886     # socket/setsockopt and other routines are undefined under SCO ODT
4887     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4888     # on later versions), says simon@lia.di.epfl.ch: it contains
4889     # gethostby* variants that don't use the nameserver (or something).
4890     # -lsocket must be given before -lnsl if both are needed.
4891     # We assume that if connect needs -lnsl, so does gethostbyname.
4892     echo $ac_n "checking for connect""... $ac_c" 1>&6
4893 echo "configure:4894: checking for connect" >&5
4894
4895 cat > conftest.$ac_ext <<EOF
4896 #line 4897 "configure"
4897 #include "confdefs.h"
4898 /* System header to define __stub macros and hopefully few prototypes,
4899     which can conflict with char connect(); below.  */
4900 #include <assert.h>
4901 /* Override any gcc2 internal prototype to avoid an error.  */
4902 /* We use char because int might match the return type of a gcc2
4903     builtin and then its argument prototype would still apply.  */
4904 char connect();
4905
4906 int main() {
4907
4908 /* The GNU C library defines this for functions which it implements
4909     to always fail with ENOSYS.  Some functions are actually named
4910     something starting with __ and the normal name is an alias.  */
4911 #if defined (__stub_connect) || defined (__stub___connect)
4912 choke me
4913 #else
4914 connect();
4915 #endif
4916
4917 ; return 0; }
4918 EOF
4919 if { (eval echo configure:4920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4920   rm -rf conftest*
4921   eval "ac_cv_func_connect=yes"
4922 else
4923   echo "configure: failed program was:" >&5
4924   cat conftest.$ac_ext >&5
4925   rm -rf conftest*
4926   eval "ac_cv_func_connect=no"
4927 fi
4928 rm -f conftest*
4929
4930 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4931   echo "$ac_t""yes" 1>&6
4932   :
4933 else
4934   echo "$ac_t""no" 1>&6
4935 fi
4936
4937     if test $ac_cv_func_connect = no; then
4938       
4939 xe_msg_checking="for connect in -lsocket"
4940 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
4941 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
4942 echo "configure:4943: checking "$xe_msg_checking"" >&5
4943 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
4944
4945 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
4946 cat > conftest.$ac_ext <<EOF
4947 #line 4948 "configure"
4948 #include "confdefs.h"
4949 /* Override any gcc2 internal prototype to avoid an error.  */
4950 /* We use char because int might match the return type of a gcc2
4951     builtin and then its argument prototype would still apply.  */
4952 char connect();
4953
4954 int main() {
4955 connect()
4956 ; return 0; }
4957 EOF
4958 if { (eval echo configure:4959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4959   rm -rf conftest*
4960   eval "ac_cv_lib_$ac_lib_var=yes"
4961 else
4962   echo "configure: failed program was:" >&5
4963   cat conftest.$ac_ext >&5
4964   rm -rf conftest*
4965   eval "ac_cv_lib_$ac_lib_var=no"
4966 fi
4967 rm -f conftest*
4968 xe_check_libs=""
4969
4970 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4971   echo "$ac_t""yes" 1>&6
4972   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
4973 else
4974   echo "$ac_t""no" 1>&6
4975 fi
4976
4977
4978     fi
4979
4980     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
4981     echo $ac_n "checking for remove""... $ac_c" 1>&6
4982 echo "configure:4983: checking for remove" >&5
4983
4984 cat > conftest.$ac_ext <<EOF
4985 #line 4986 "configure"
4986 #include "confdefs.h"
4987 /* System header to define __stub macros and hopefully few prototypes,
4988     which can conflict with char remove(); below.  */
4989 #include <assert.h>
4990 /* Override any gcc2 internal prototype to avoid an error.  */
4991 /* We use char because int might match the return type of a gcc2
4992     builtin and then its argument prototype would still apply.  */
4993 char remove();
4994
4995 int main() {
4996
4997 /* The GNU C library defines this for functions which it implements
4998     to always fail with ENOSYS.  Some functions are actually named
4999     something starting with __ and the normal name is an alias.  */
5000 #if defined (__stub_remove) || defined (__stub___remove)
5001 choke me
5002 #else
5003 remove();
5004 #endif
5005
5006 ; return 0; }
5007 EOF
5008 if { (eval echo configure:5009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5009   rm -rf conftest*
5010   eval "ac_cv_func_remove=yes"
5011 else
5012   echo "configure: failed program was:" >&5
5013   cat conftest.$ac_ext >&5
5014   rm -rf conftest*
5015   eval "ac_cv_func_remove=no"
5016 fi
5017 rm -f conftest*
5018
5019 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5020   echo "$ac_t""yes" 1>&6
5021   :
5022 else
5023   echo "$ac_t""no" 1>&6
5024 fi
5025
5026     if test $ac_cv_func_remove = no; then
5027       
5028 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5029 echo "configure:5030: checking for remove in -lposix" >&5
5030 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5031
5032 xe_check_libs=" -lposix "
5033 cat > conftest.$ac_ext <<EOF
5034 #line 5035 "configure"
5035 #include "confdefs.h"
5036 /* Override any gcc2 internal prototype to avoid an error.  */
5037 /* We use char because int might match the return type of a gcc2
5038     builtin and then its argument prototype would still apply.  */
5039 char remove();
5040
5041 int main() {
5042 remove()
5043 ; return 0; }
5044 EOF
5045 if { (eval echo configure:5046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5046   rm -rf conftest*
5047   eval "ac_cv_lib_$ac_lib_var=yes"
5048 else
5049   echo "configure: failed program was:" >&5
5050   cat conftest.$ac_ext >&5
5051   rm -rf conftest*
5052   eval "ac_cv_lib_$ac_lib_var=no"
5053 fi
5054 rm -f conftest*
5055 xe_check_libs=""
5056
5057 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5058   echo "$ac_t""yes" 1>&6
5059   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5060 else
5061   echo "$ac_t""no" 1>&6
5062 fi
5063
5064
5065     fi
5066
5067     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5068     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5069 echo "configure:5070: checking for shmat" >&5
5070
5071 cat > conftest.$ac_ext <<EOF
5072 #line 5073 "configure"
5073 #include "confdefs.h"
5074 /* System header to define __stub macros and hopefully few prototypes,
5075     which can conflict with char shmat(); below.  */
5076 #include <assert.h>
5077 /* Override any gcc2 internal prototype to avoid an error.  */
5078 /* We use char because int might match the return type of a gcc2
5079     builtin and then its argument prototype would still apply.  */
5080 char shmat();
5081
5082 int main() {
5083
5084 /* The GNU C library defines this for functions which it implements
5085     to always fail with ENOSYS.  Some functions are actually named
5086     something starting with __ and the normal name is an alias.  */
5087 #if defined (__stub_shmat) || defined (__stub___shmat)
5088 choke me
5089 #else
5090 shmat();
5091 #endif
5092
5093 ; return 0; }
5094 EOF
5095 if { (eval echo configure:5096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5096   rm -rf conftest*
5097   eval "ac_cv_func_shmat=yes"
5098 else
5099   echo "configure: failed program was:" >&5
5100   cat conftest.$ac_ext >&5
5101   rm -rf conftest*
5102   eval "ac_cv_func_shmat=no"
5103 fi
5104 rm -f conftest*
5105
5106 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5107   echo "$ac_t""yes" 1>&6
5108   :
5109 else
5110   echo "$ac_t""no" 1>&6
5111 fi
5112
5113     if test $ac_cv_func_shmat = no; then
5114       
5115 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5116 echo "configure:5117: checking for shmat in -lipc" >&5
5117 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5118
5119 xe_check_libs=" -lipc "
5120 cat > conftest.$ac_ext <<EOF
5121 #line 5122 "configure"
5122 #include "confdefs.h"
5123 /* Override any gcc2 internal prototype to avoid an error.  */
5124 /* We use char because int might match the return type of a gcc2
5125     builtin and then its argument prototype would still apply.  */
5126 char shmat();
5127
5128 int main() {
5129 shmat()
5130 ; return 0; }
5131 EOF
5132 if { (eval echo configure:5133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5133   rm -rf conftest*
5134   eval "ac_cv_lib_$ac_lib_var=yes"
5135 else
5136   echo "configure: failed program was:" >&5
5137   cat conftest.$ac_ext >&5
5138   rm -rf conftest*
5139   eval "ac_cv_lib_$ac_lib_var=no"
5140 fi
5141 rm -f conftest*
5142 xe_check_libs=""
5143
5144 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5145   echo "$ac_t""yes" 1>&6
5146   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5147 else
5148   echo "$ac_t""no" 1>&6
5149 fi
5150
5151
5152     fi
5153   fi
5154
5155   # Check for libraries that X11R6 Xt/Xaw programs need.
5156   ac_save_LDFLAGS="$LDFLAGS"
5157   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5158   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5159   # check for ICE first), but we must link in the order -lSM -lICE or
5160   # we get undefined symbols.  So assume we have SM if we have ICE.
5161   # These have to be linked with before -lX11, unlike the other
5162   # libraries we check for below, so use a different variable.
5163   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5164   
5165 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5166 echo "configure:5167: checking for IceConnectionNumber in -lICE" >&5
5167 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5168
5169 xe_check_libs=" -lICE "
5170 cat > conftest.$ac_ext <<EOF
5171 #line 5172 "configure"
5172 #include "confdefs.h"
5173 /* Override any gcc2 internal prototype to avoid an error.  */
5174 /* We use char because int might match the return type of a gcc2
5175     builtin and then its argument prototype would still apply.  */
5176 char IceConnectionNumber();
5177
5178 int main() {
5179 IceConnectionNumber()
5180 ; return 0; }
5181 EOF
5182 if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5183   rm -rf conftest*
5184   eval "ac_cv_lib_$ac_lib_var=yes"
5185 else
5186   echo "configure: failed program was:" >&5
5187   cat conftest.$ac_ext >&5
5188   rm -rf conftest*
5189   eval "ac_cv_lib_$ac_lib_var=no"
5190 fi
5191 rm -f conftest*
5192 xe_check_libs=""
5193
5194 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5195   echo "$ac_t""yes" 1>&6
5196   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5197 else
5198   echo "$ac_t""no" 1>&6
5199 fi
5200
5201
5202   LDFLAGS="$ac_save_LDFLAGS"
5203
5204 fi
5205  # Autoconf claims to find X library and include dirs for us.
5206   if test "$no_x" = "yes"
5207   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5208   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5209   fi
5210 fi
5211
5212 case "$with_x11" in
5213   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5214   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5215 esac
5216
5217 if test "$with_x11" = "yes"; then
5218   { test "$extra_verbose" = "yes" && cat << \EOF
5219     Defining HAVE_X_WINDOWS
5220 EOF
5221 cat >> confdefs.h <<\EOF
5222 #define HAVE_X_WINDOWS 1
5223 EOF
5224 }
5225
5226   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5227   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5228
5229       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5230     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5231     if test -d "$lib_dir" -a -d "$inc_dir"; then
5232       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5233         x_libraries="$lib_dir $x_libraries"
5234         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5235       esac
5236       case "$x_includes" in "$inc_dir"* ) ;; *)
5237         x_includes="$inc_dir $x_includes"
5238         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5239       esac
5240       break;       fi
5241   done
5242
5243     for rel in "X11R6" "X11R5" "X11R4"; do
5244     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5245     if test -d "$lib_dir" -a -d "$inc_dir"; then
5246       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5247         x_libraries="$x_libraries $lib_dir"
5248         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5249       esac
5250       case "$x_includes" in "$inc_dir"* ) ;; *)
5251         x_includes="$x_includes $inc_dir"
5252         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5253       esac
5254       break;     fi
5255   done
5256
5257     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
5258
5259   ld_switch_x_site="$X_LIBS"
5260
5261   
5262 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5263     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5264   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5265   
5266         runpath="" runpath_dirs=""
5267   if test -n "$LD_RUN_PATH"; then
5268     runpath="$LD_RUN_PATH"
5269   elif test "$GCC" = "yes"; then
5270         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5271     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5272     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5273     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5274       case "$arg" in P,* | -L* | -R* )
5275         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5276           {
5277 xe_runpath_dir="$dir"
5278   test "$xe_runpath_dir" != "/lib"     -a \
5279         "$xe_runpath_dir" != "/usr/lib" -a \
5280         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5281   eval "$xe_add_unique_runpath_dir"
5282 }
5283         done ;;
5284       esac
5285     done
5286     ld_switch_run="$ld_switch_run_save"
5287     rm -f conftest*
5288   else
5289         for arg in $ld_switch_site $ld_switch_x_site; do
5290       case "$arg" in -L*) {
5291 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5292   test "$xe_runpath_dir" != "/lib"     -a \
5293         "$xe_runpath_dir" != "/usr/lib" -a \
5294         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5295   eval "$xe_add_unique_runpath_dir"
5296 };; esac
5297     done
5298         if test "$opsys $need_motif" = "sol2 yes"; then
5299       xe_runpath_dir="/opt/SUNWdt/lib";
5300       eval "$xe_add_unique_runpath_dir";
5301     fi
5302   fi 
5303   if test -n "$runpath"; then
5304     ld_switch_run="${dash_r}${runpath}"
5305     
5306 if test "$GCC" = "yes"; then
5307   set x $ld_switch_run; shift; ld_switch_run=""
5308   while test -n "$1"; do
5309     case $1 in
5310       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5311       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5312       -Xlinker* ) ;;
5313       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5314     esac
5315     shift
5316   done
5317 fi
5318     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5319   fi
5320 fi
5321
5322
5323   if test "$extra_verbose" = "yes"; then
5324     echo; echo "X11 compilation variables:"
5325     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5326     echo
5327   fi
5328
5329             bitmapdirs=
5330   if test "$x_includes" != NONE; then
5331     for i in $x_includes; do
5332       if test -d "$i/bitmaps"; then
5333         bitmapdirs="$i/bitmaps:$bitmapdirs"
5334       fi
5335       if test -d "$i/X11/bitmaps"; then
5336         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5337       fi
5338     done
5339     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5340   fi
5341   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5342     Defining BITMAPDIR = "$bitmapdirs"
5343 EOF
5344 cat >> confdefs.h <<EOF
5345 #define BITMAPDIR "$bitmapdirs"
5346 EOF
5347 }
5348
5349
5350     echo "checking for X defines extracted by xmkmf" 1>&6
5351 echo "configure:5352: checking for X defines extracted by xmkmf" >&5
5352   rm -fr conftestdir
5353   if mkdir conftestdir; then
5354     cd conftestdir
5355     cat > Imakefile <<'EOF'
5356 xetest:
5357         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5358 EOF
5359     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5360       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5361       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5362     fi
5363     cd ..
5364     rm -fr conftestdir
5365     for word in $xmkmf_defines; do
5366       case "$word" in
5367         -D*=* ) ;;
5368         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5369               { test "$extra_verbose" = "yes" && cat << EOF
5370     Defining $word
5371 EOF
5372 cat >> confdefs.h <<EOF
5373 #define $word 1
5374 EOF
5375 }
5376  ;;
5377       esac
5378     done
5379   fi
5380
5381     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5382 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5383 echo "configure:5384: checking for X11/Intrinsic.h" >&5
5384
5385 cat > conftest.$ac_ext <<EOF
5386 #line 5387 "configure"
5387 #include "confdefs.h"
5388 #include <X11/Intrinsic.h>
5389 EOF
5390 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5391 { (eval echo configure:5392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5392 ac_err=`grep -v '^ *+' conftest.out`
5393 if test -z "$ac_err"; then
5394   rm -rf conftest*
5395   eval "ac_cv_header_$ac_safe=yes"
5396 else
5397   echo "$ac_err" >&5
5398   echo "configure: failed program was:" >&5
5399   cat conftest.$ac_ext >&5
5400   rm -rf conftest*
5401   eval "ac_cv_header_$ac_safe=no"
5402 fi
5403 rm -f conftest*
5404 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5405   echo "$ac_t""yes" 1>&6
5406   :
5407 else
5408   echo "$ac_t""no" 1>&6
5409 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5410 fi
5411
5412
5413       
5414 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5415 echo "configure:5416: checking for XOpenDisplay in -lX11" >&5
5416 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5417
5418 xe_check_libs=" -lX11 "
5419 cat > conftest.$ac_ext <<EOF
5420 #line 5421 "configure"
5421 #include "confdefs.h"
5422 /* Override any gcc2 internal prototype to avoid an error.  */
5423 /* We use char because int might match the return type of a gcc2
5424     builtin and then its argument prototype would still apply.  */
5425 char XOpenDisplay();
5426
5427 int main() {
5428 XOpenDisplay()
5429 ; return 0; }
5430 EOF
5431 if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5432   rm -rf conftest*
5433   eval "ac_cv_lib_$ac_lib_var=yes"
5434 else
5435   echo "configure: failed program was:" >&5
5436   cat conftest.$ac_ext >&5
5437   rm -rf conftest*
5438   eval "ac_cv_lib_$ac_lib_var=no"
5439 fi
5440 rm -f conftest*
5441 xe_check_libs=""
5442
5443 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5444   echo "$ac_t""yes" 1>&6
5445   have_lib_x11=yes
5446 else
5447   echo "$ac_t""no" 1>&6
5448 fi
5449
5450
5451   if test "$have_lib_x11" != "yes"; then
5452     
5453 xe_msg_checking="for XGetFontProperty in -lX11"
5454 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5455 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5456 echo "configure:5457: checking "$xe_msg_checking"" >&5
5457 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5458
5459 xe_check_libs=" -lX11 -b i486-linuxaout"
5460 cat > conftest.$ac_ext <<EOF
5461 #line 5462 "configure"
5462 #include "confdefs.h"
5463 /* Override any gcc2 internal prototype to avoid an error.  */
5464 /* We use char because int might match the return type of a gcc2
5465     builtin and then its argument prototype would still apply.  */
5466 char XGetFontProperty();
5467
5468 int main() {
5469 XGetFontProperty()
5470 ; return 0; }
5471 EOF
5472 if { (eval echo configure:5473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5473   rm -rf conftest*
5474   eval "ac_cv_lib_$ac_lib_var=yes"
5475 else
5476   echo "configure: failed program was:" >&5
5477   cat conftest.$ac_ext >&5
5478   rm -rf conftest*
5479   eval "ac_cv_lib_$ac_lib_var=no"
5480 fi
5481 rm -f conftest*
5482 xe_check_libs=""
5483
5484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5485   echo "$ac_t""yes" 1>&6
5486   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5487 else
5488   echo "$ac_t""no" 1>&6
5489 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5490 fi
5491
5492
5493   fi
5494   libs_x="-lX11"
5495   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5496
5497     
5498 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5499 echo "configure:5500: checking for XShapeSelectInput in -lXext" >&5
5500 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5501
5502 xe_check_libs=" -lXext "
5503 cat > conftest.$ac_ext <<EOF
5504 #line 5505 "configure"
5505 #include "confdefs.h"
5506 /* Override any gcc2 internal prototype to avoid an error.  */
5507 /* We use char because int might match the return type of a gcc2
5508     builtin and then its argument prototype would still apply.  */
5509 char XShapeSelectInput();
5510
5511 int main() {
5512 XShapeSelectInput()
5513 ; return 0; }
5514 EOF
5515 if { (eval echo configure:5516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5516   rm -rf conftest*
5517   eval "ac_cv_lib_$ac_lib_var=yes"
5518 else
5519   echo "configure: failed program was:" >&5
5520   cat conftest.$ac_ext >&5
5521   rm -rf conftest*
5522   eval "ac_cv_lib_$ac_lib_var=no"
5523 fi
5524 rm -f conftest*
5525 xe_check_libs=""
5526
5527 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5528   echo "$ac_t""yes" 1>&6
5529   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5530 else
5531   echo "$ac_t""no" 1>&6
5532 fi
5533
5534
5535
5536     
5537 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5538 echo "configure:5539: checking for XtOpenDisplay in -lXt" >&5
5539 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5540
5541 xe_check_libs=" -lXt "
5542 cat > conftest.$ac_ext <<EOF
5543 #line 5544 "configure"
5544 #include "confdefs.h"
5545 /* Override any gcc2 internal prototype to avoid an error.  */
5546 /* We use char because int might match the return type of a gcc2
5547     builtin and then its argument prototype would still apply.  */
5548 char XtOpenDisplay();
5549
5550 int main() {
5551 XtOpenDisplay()
5552 ; return 0; }
5553 EOF
5554 if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5555   rm -rf conftest*
5556   eval "ac_cv_lib_$ac_lib_var=yes"
5557 else
5558   echo "configure: failed program was:" >&5
5559   cat conftest.$ac_ext >&5
5560   rm -rf conftest*
5561   eval "ac_cv_lib_$ac_lib_var=no"
5562 fi
5563 rm -f conftest*
5564 xe_check_libs=""
5565
5566 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5567   echo "$ac_t""yes" 1>&6
5568   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5569 else
5570   echo "$ac_t""no" 1>&6
5571 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5572 fi
5573
5574
5575
5576   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5577 echo "configure:5578: checking the version of X11 being used" >&5
5578   cat > conftest.$ac_ext <<EOF
5579 #line 5580 "configure"
5580 #include "confdefs.h"
5581 #include <X11/Intrinsic.h>
5582     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5583 EOF
5584 if { (eval echo configure:5585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5585 then
5586   ./conftest foobar; x11_release=$?
5587 else
5588   conftest_rc="$?"
5589   echo "configure: failed program was:" >&5
5590   cat conftest.$ac_ext >&5
5591   rm -fr conftest*
5592   x11_release=4
5593 fi
5594 rm -fr conftest*
5595   echo "$ac_t""R${x11_release}" 1>&6
5596   { test "$extra_verbose" = "yes" && cat << EOF
5597     Defining THIS_IS_X11R${x11_release}
5598 EOF
5599 cat >> confdefs.h <<EOF
5600 #define THIS_IS_X11R${x11_release} 1
5601 EOF
5602 }
5603
5604
5605   for ac_hdr in X11/Xlocale.h
5606 do
5607 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5608 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5609 echo "configure:5610: checking for $ac_hdr" >&5
5610
5611 cat > conftest.$ac_ext <<EOF
5612 #line 5613 "configure"
5613 #include "confdefs.h"
5614 #include <$ac_hdr>
5615 EOF
5616 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5617 { (eval echo configure:5618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5618 ac_err=`grep -v '^ *+' conftest.out`
5619 if test -z "$ac_err"; then
5620   rm -rf conftest*
5621   eval "ac_cv_header_$ac_safe=yes"
5622 else
5623   echo "$ac_err" >&5
5624   echo "configure: failed program was:" >&5
5625   cat conftest.$ac_ext >&5
5626   rm -rf conftest*
5627   eval "ac_cv_header_$ac_safe=no"
5628 fi
5629 rm -f conftest*
5630 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5631   echo "$ac_t""yes" 1>&6
5632     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5633   { test "$extra_verbose" = "yes" && cat << EOF
5634     Defining $ac_tr_hdr
5635 EOF
5636 cat >> confdefs.h <<EOF
5637 #define $ac_tr_hdr 1
5638 EOF
5639 }
5640  
5641 else
5642   echo "$ac_t""no" 1>&6
5643 fi
5644 done
5645
5646
5647     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5648 echo "configure:5649: checking for XFree86" >&5
5649   if test -d "/usr/X386/include" -o \
5650           -f "/etc/XF86Config"    -o \
5651           -f "/etc/X11/XF86Config" -o \
5652           -f "/usr/X11R6/lib/X11/XF86Config"; then
5653     echo "$ac_t""yes" 1>&6
5654     { test "$extra_verbose" = "yes" && cat << \EOF
5655     Defining HAVE_XFREE386
5656 EOF
5657 cat >> confdefs.h <<\EOF
5658 #define HAVE_XFREE386 1
5659 EOF
5660 }
5661
5662   else
5663     echo "$ac_t""no" 1>&6
5664   fi
5665
5666     test -z "$with_xmu" && { 
5667 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5668 echo "configure:5669: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5669 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5670
5671 xe_check_libs=" -lXmu "
5672 cat > conftest.$ac_ext <<EOF
5673 #line 5674 "configure"
5674 #include "confdefs.h"
5675 /* Override any gcc2 internal prototype to avoid an error.  */
5676 /* We use char because int might match the return type of a gcc2
5677     builtin and then its argument prototype would still apply.  */
5678 char XmuReadBitmapDataFromFile();
5679
5680 int main() {
5681 XmuReadBitmapDataFromFile()
5682 ; return 0; }
5683 EOF
5684 if { (eval echo configure:5685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5685   rm -rf conftest*
5686   eval "ac_cv_lib_$ac_lib_var=yes"
5687 else
5688   echo "configure: failed program was:" >&5
5689   cat conftest.$ac_ext >&5
5690   rm -rf conftest*
5691   eval "ac_cv_lib_$ac_lib_var=no"
5692 fi
5693 rm -f conftest*
5694 xe_check_libs=""
5695
5696 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5697   echo "$ac_t""yes" 1>&6
5698   with_xmu=yes
5699 else
5700   echo "$ac_t""no" 1>&6
5701 with_xmu=no
5702 fi
5703
5704  }
5705   if test "$with_xmu" = "no"; then
5706     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5707    echo "    xemacs will be linked with \"xmu.o\""
5708  fi
5709   else
5710     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5711     { test "$extra_verbose" = "yes" && cat << \EOF
5712     Defining HAVE_XMU
5713 EOF
5714 cat >> confdefs.h <<\EOF
5715 #define HAVE_XMU 1
5716 EOF
5717 }
5718
5719   fi
5720
5721       
5722 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5723 echo "configure:5724: checking for main in -lXbsd" >&5
5724 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5725
5726 xe_check_libs=" -lXbsd "
5727 cat > conftest.$ac_ext <<EOF
5728 #line 5729 "configure"
5729 #include "confdefs.h"
5730
5731 int main() {
5732 main()
5733 ; return 0; }
5734 EOF
5735 if { (eval echo configure:5736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5736   rm -rf conftest*
5737   eval "ac_cv_lib_$ac_lib_var=yes"
5738 else
5739   echo "configure: failed program was:" >&5
5740   cat conftest.$ac_ext >&5
5741   rm -rf conftest*
5742   eval "ac_cv_lib_$ac_lib_var=no"
5743 fi
5744 rm -f conftest*
5745 xe_check_libs=""
5746
5747 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5748   echo "$ac_t""yes" 1>&6
5749   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5750 else
5751   echo "$ac_t""no" 1>&6
5752 fi
5753
5754
5755
5756     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5757         if test "$GCC" = "yes"; then
5758       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5759       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5760     else
5761       case "$CC" in
5762         "xlc" ) CC="xlc_r" ;;
5763         "xlC" ) CC="xlC_r" ;;
5764         "cc"  ) CC="cc_r" ;;
5765       esac
5766     fi
5767   fi
5768
5769 fi 
5770 if test "$with_msw" != "no"; then
5771   echo "checking for MS-Windows" 1>&6
5772 echo "configure:5773: checking for MS-Windows" >&5
5773   
5774 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5775 echo "configure:5776: checking for main in -lgdi32" >&5
5776 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5777
5778 xe_check_libs=" -lgdi32 "
5779 cat > conftest.$ac_ext <<EOF
5780 #line 5781 "configure"
5781 #include "confdefs.h"
5782
5783 int main() {
5784 main()
5785 ; return 0; }
5786 EOF
5787 if { (eval echo configure:5788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5788   rm -rf conftest*
5789   eval "ac_cv_lib_$ac_lib_var=yes"
5790 else
5791   echo "configure: failed program was:" >&5
5792   cat conftest.$ac_ext >&5
5793   rm -rf conftest*
5794   eval "ac_cv_lib_$ac_lib_var=no"
5795 fi
5796 rm -f conftest*
5797 xe_check_libs=""
5798
5799 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5800   echo "$ac_t""yes" 1>&6
5801   with_msw=yes
5802 else
5803   echo "$ac_t""no" 1>&6
5804 fi
5805
5806
5807   if test "$with_msw" = "yes"; then
5808     { test "$extra_verbose" = "yes" && cat << \EOF
5809     Defining HAVE_MS_WINDOWS
5810 EOF
5811 cat >> confdefs.h <<\EOF
5812 #define HAVE_MS_WINDOWS 1
5813 EOF
5814 }
5815
5816     install_pp="$blddir/lib-src/installexe.sh"
5817     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
5818     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
5819     if test "$window_system" != x11; then
5820         window_system=msw
5821         test "$with_scrollbars" != "no" && with_scrollbars=msw \
5822             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5823    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5824  fi
5825         test "$with_menubars"   != "no" && with_menubars=msw \
5826             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5827    echo "    xemacs will be linked with \"menubar-msw.o\""
5828  fi
5829         test "$with_toolbars"   != "no" && with_toolbars=msw \
5830             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5831    echo "    xemacs will be linked with \"toolbar-msw.o\""
5832  fi
5833         test "$with_dialogs"   != "no" && with_dialogs=msw \
5834             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5835    echo "    xemacs will be linked with \"dialog-msw.o\""
5836  fi
5837     else
5838         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5839    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5840  fi
5841         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5842    echo "    xemacs will be linked with \"menubar-msw.o\""
5843  fi
5844         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5845    echo "    xemacs will be linked with \"toolbar-msw.o\""
5846  fi
5847         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5848    echo "    xemacs will be linked with \"dialog-msw.o\""
5849  fi
5850     fi
5851         cat > conftest.$ac_ext <<EOF
5852 #line 5853 "configure"
5853 #include "confdefs.h"
5854 #include <fcntl.h>
5855     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
5856 EOF
5857 if { (eval echo configure:5858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5858 then
5859   { test "$extra_verbose" = "yes" && cat << \EOF
5860     Defining HAVE_MSG_SELECT
5861 EOF
5862 cat >> confdefs.h <<\EOF
5863 #define HAVE_MSG_SELECT 1
5864 EOF
5865 }
5866
5867 else
5868   conftest_rc="$?"
5869   echo "configure: failed program was:" >&5
5870   cat conftest.$ac_ext >&5
5871 fi
5872 rm -fr conftest*
5873     const_is_losing=no
5874     with_file_coding=yes
5875     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
5876    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\""
5877  fi
5878   fi
5879 fi
5880
5881
5882
5883 test -z "$window_system" && window_system="none"
5884
5885 if test "$window_system" = "none"; then
5886   for feature in menubars scrollbars toolbars dialogs dragndrop xface
5887   do
5888     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5889        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
5890     fi
5891     eval "with_${feature}=no"
5892   done
5893 else
5894   test -z "$with_toolbars" && with_toolbars=yes
5895 fi
5896
5897 if test "$with_msw" != "yes"; then
5898   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
5899   do
5900     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5901        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
5902     fi
5903     eval "with_${feature}=no"
5904   done
5905 else
5906   :
5907 fi
5908
5909 if test "$with_x11" != "yes"; then
5910             for feature in tooltalk cde offix session xim xmu
5911   do
5912     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5913        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
5914     fi
5915     eval "with_${feature}=no"
5916   done
5917 fi
5918
5919 bitmapdir=
5920
5921 case "$window_system" in
5922   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
5923   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
5924   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
5925 esac
5926
5927 case "$x_libraries" in *X11R4* )
5928   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
5929   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
5930 esac
5931
5932 echo "checking for session-management option" 1>&6
5933 echo "configure:5934: checking for session-management option" >&5;
5934 if test "$with_session" != "no"; then
5935   { test "$extra_verbose" = "yes" && cat << \EOF
5936     Defining HAVE_SESSION
5937 EOF
5938 cat >> confdefs.h <<\EOF
5939 #define HAVE_SESSION 1
5940 EOF
5941 }
5942
5943 fi
5944
5945 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
5946 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
5947 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
5948 echo "configure:5949: checking for X11/Xauth.h" >&5
5949
5950 cat > conftest.$ac_ext <<EOF
5951 #line 5952 "configure"
5952 #include "confdefs.h"
5953 #include <X11/Xauth.h>
5954 EOF
5955 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5956 { (eval echo configure:5957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5957 ac_err=`grep -v '^ *+' conftest.out`
5958 if test -z "$ac_err"; then
5959   rm -rf conftest*
5960   eval "ac_cv_header_$ac_safe=yes"
5961 else
5962   echo "$ac_err" >&5
5963   echo "configure: failed program was:" >&5
5964   cat conftest.$ac_ext >&5
5965   rm -rf conftest*
5966   eval "ac_cv_header_$ac_safe=no"
5967 fi
5968 rm -f conftest*
5969 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5970   echo "$ac_t""yes" 1>&6
5971   :
5972 else
5973   echo "$ac_t""no" 1>&6
5974 with_xauth=no
5975 fi
5976  }
5977 test -z "$with_xauth" && { 
5978 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
5979 echo "configure:5980: checking for XauGetAuthByAddr in -lXau" >&5
5980 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
5981
5982 xe_check_libs=" -lXau "
5983 cat > conftest.$ac_ext <<EOF
5984 #line 5985 "configure"
5985 #include "confdefs.h"
5986 /* Override any gcc2 internal prototype to avoid an error.  */
5987 /* We use char because int might match the return type of a gcc2
5988     builtin and then its argument prototype would still apply.  */
5989 char XauGetAuthByAddr();
5990
5991 int main() {
5992 XauGetAuthByAddr()
5993 ; return 0; }
5994 EOF
5995 if { (eval echo configure:5996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5996   rm -rf conftest*
5997   eval "ac_cv_lib_$ac_lib_var=yes"
5998 else
5999   echo "configure: failed program was:" >&5
6000   cat conftest.$ac_ext >&5
6001   rm -rf conftest*
6002   eval "ac_cv_lib_$ac_lib_var=no"
6003 fi
6004 rm -f conftest*
6005 xe_check_libs=""
6006
6007 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6008   echo "$ac_t""yes" 1>&6
6009   :
6010 else
6011   echo "$ac_t""no" 1>&6
6012 with_xauth=no
6013 fi
6014
6015  }
6016 test -z "$with_xauth" && with_xauth=yes
6017 if test "$with_xauth" = "yes"; then
6018   { test "$extra_verbose" = "yes" && cat << \EOF
6019     Defining HAVE_XAUTH
6020 EOF
6021 cat >> confdefs.h <<\EOF
6022 #define HAVE_XAUTH 1
6023 EOF
6024 }
6025
6026   
6027 T=""
6028 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
6029 libs_xauth="$T"
6030
6031 fi
6032
6033
6034
6035
6036 if test "$with_tooltalk" != "no" ; then
6037       for dir in "" "Tt/" "desktop/" ; do
6038     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6039 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6040 echo "configure:6041: checking for ${dir}tt_c.h" >&5
6041
6042 cat > conftest.$ac_ext <<EOF
6043 #line 6044 "configure"
6044 #include "confdefs.h"
6045 #include <${dir}tt_c.h>
6046 EOF
6047 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6048 { (eval echo configure:6049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6049 ac_err=`grep -v '^ *+' conftest.out`
6050 if test -z "$ac_err"; then
6051   rm -rf conftest*
6052   eval "ac_cv_header_$ac_safe=yes"
6053 else
6054   echo "$ac_err" >&5
6055   echo "configure: failed program was:" >&5
6056   cat conftest.$ac_ext >&5
6057   rm -rf conftest*
6058   eval "ac_cv_header_$ac_safe=no"
6059 fi
6060 rm -f conftest*
6061 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6062   echo "$ac_t""yes" 1>&6
6063   tt_c_h_path="${dir}tt_c.h"; break
6064 else
6065   echo "$ac_t""no" 1>&6
6066 fi
6067
6068   done
6069   if test -z "$tt_c_h_path"; then
6070     if test "$with_tooltalk" = "yes"; then
6071       (echo "$progname: Usage error:"
6072 echo " " "Unable to find required tooltalk header files."
6073 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6074     fi
6075     with_tooltalk=no
6076   fi
6077 fi
6078 if test "$with_tooltalk" != "no" ; then
6079   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6080     
6081 xe_msg_checking="for tt_message_create in -ltt"
6082 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6083 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6084 echo "configure:6085: checking "$xe_msg_checking"" >&5
6085 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6086
6087 xe_check_libs=" -ltt $extra_libs"
6088 cat > conftest.$ac_ext <<EOF
6089 #line 6090 "configure"
6090 #include "confdefs.h"
6091 /* Override any gcc2 internal prototype to avoid an error.  */
6092 /* We use char because int might match the return type of a gcc2
6093     builtin and then its argument prototype would still apply.  */
6094 char tt_message_create();
6095
6096 int main() {
6097 tt_message_create()
6098 ; return 0; }
6099 EOF
6100 if { (eval echo configure:6101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6101   rm -rf conftest*
6102   eval "ac_cv_lib_$ac_lib_var=yes"
6103 else
6104   echo "configure: failed program was:" >&5
6105   cat conftest.$ac_ext >&5
6106   rm -rf conftest*
6107   eval "ac_cv_lib_$ac_lib_var=no"
6108 fi
6109 rm -f conftest*
6110 xe_check_libs=""
6111
6112 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6113   echo "$ac_t""yes" 1>&6
6114   tt_libs="-ltt $extra_libs"; break
6115 else
6116   echo "$ac_t""no" 1>&6
6117 :
6118 fi
6119
6120
6121   done
6122   if test -z "$tt_libs"; then
6123     if test "$with_tooltalk" = "yes"; then
6124       (echo "$progname: Usage error:"
6125 echo " " "Unable to find required tooltalk libraries."
6126 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6127     fi
6128     with_tooltalk=no
6129   fi
6130 fi
6131 test -z "$with_tooltalk" && with_tooltalk=yes
6132 if test "$with_tooltalk" = "yes"; then
6133   { test "$extra_verbose" = "yes" && cat << \EOF
6134     Defining TOOLTALK
6135 EOF
6136 cat >> confdefs.h <<\EOF
6137 #define TOOLTALK 1
6138 EOF
6139 }
6140
6141   { test "$extra_verbose" = "yes" && cat << EOF
6142     Defining TT_C_H_PATH = "$tt_c_h_path"
6143 EOF
6144 cat >> confdefs.h <<EOF
6145 #define TT_C_H_PATH "$tt_c_h_path"
6146 EOF
6147 }
6148
6149   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6150   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6151    echo "    xemacs will be linked with \"tooltalk.o\""
6152  fi
6153 fi
6154
6155 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6156 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6157 echo "configure:6158: checking for Dt/Dt.h" >&5
6158
6159 cat > conftest.$ac_ext <<EOF
6160 #line 6161 "configure"
6161 #include "confdefs.h"
6162 #include <Dt/Dt.h>
6163 EOF
6164 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6165 { (eval echo configure:6166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6166 ac_err=`grep -v '^ *+' conftest.out`
6167 if test -z "$ac_err"; then
6168   rm -rf conftest*
6169   eval "ac_cv_header_$ac_safe=yes"
6170 else
6171   echo "$ac_err" >&5
6172   echo "configure: failed program was:" >&5
6173   cat conftest.$ac_ext >&5
6174   rm -rf conftest*
6175   eval "ac_cv_header_$ac_safe=no"
6176 fi
6177 rm -f conftest*
6178 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6179   echo "$ac_t""yes" 1>&6
6180   :
6181 else
6182   echo "$ac_t""no" 1>&6
6183 with_cde=no
6184 fi
6185  }
6186 test -z "$with_cde" && { 
6187 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6188 echo "configure:6189: checking for DtDndDragStart in -lDtSvc" >&5
6189 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6190
6191 xe_check_libs=" -lDtSvc "
6192 cat > conftest.$ac_ext <<EOF
6193 #line 6194 "configure"
6194 #include "confdefs.h"
6195 /* Override any gcc2 internal prototype to avoid an error.  */
6196 /* We use char because int might match the return type of a gcc2
6197     builtin and then its argument prototype would still apply.  */
6198 char DtDndDragStart();
6199
6200 int main() {
6201 DtDndDragStart()
6202 ; return 0; }
6203 EOF
6204 if { (eval echo configure:6205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6205   rm -rf conftest*
6206   eval "ac_cv_lib_$ac_lib_var=yes"
6207 else
6208   echo "configure: failed program was:" >&5
6209   cat conftest.$ac_ext >&5
6210   rm -rf conftest*
6211   eval "ac_cv_lib_$ac_lib_var=no"
6212 fi
6213 rm -f conftest*
6214 xe_check_libs=""
6215
6216 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6217   echo "$ac_t""yes" 1>&6
6218   :
6219 else
6220   echo "$ac_t""no" 1>&6
6221 with_cde=no
6222 fi
6223
6224  }
6225 test -z "$with_cde" && with_cde=yes
6226 if test "$with_dragndrop" = no; then
6227   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6228   with_cde=no
6229 fi
6230 if test "$with_cde" = "yes" ; then
6231   { test "$extra_verbose" = "yes" && cat << \EOF
6232     Defining HAVE_CDE
6233 EOF
6234 cat >> confdefs.h <<\EOF
6235 #define HAVE_CDE 1
6236 EOF
6237 }
6238
6239   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6240   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6241   with_tooltalk=yes # CDE requires Tooltalk
6242   need_motif=yes    # CDE requires Motif
6243 fi
6244
6245 test "$window_system" != "x11" && with_offix=no
6246 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6247   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6248   with_offix=no
6249 fi
6250 if test "$with_dragndrop" = no; then
6251   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6252   with_offix=no
6253 fi
6254 if test "$with_cde" = yes; then
6255   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6256   with_offix=no
6257 fi
6258 test -z "$with_offix" && with_offix=no
6259 if test "$with_offix" = "yes"; then
6260   { test "$extra_verbose" = "yes" && cat << \EOF
6261     Defining HAVE_OFFIX_DND
6262 EOF
6263 cat >> confdefs.h <<\EOF
6264 #define HAVE_OFFIX_DND 1
6265 EOF
6266 }
6267
6268   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6269   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6270 fi
6271
6272 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6273 echo "configure:6274: checking if drag and drop API is needed" >&5
6274 if test "$with_dragndrop" != "no" ; then
6275   if test -n "$dragndrop_proto" ; then
6276     with_dragndrop=yes
6277     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6278     { test "$extra_verbose" = "yes" && cat << \EOF
6279     Defining HAVE_DRAGNDROP
6280 EOF
6281 cat >> confdefs.h <<\EOF
6282 #define HAVE_DRAGNDROP 1
6283 EOF
6284 }
6285
6286     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6287   else
6288     with_dragndrop=no
6289     echo "$ac_t""no" 1>&6
6290   fi
6291 fi
6292
6293 echo "checking for LDAP" 1>&6
6294 echo "configure:6295: checking for LDAP" >&5
6295 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6296 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6297 echo "configure:6298: checking for ldap.h" >&5
6298
6299 cat > conftest.$ac_ext <<EOF
6300 #line 6301 "configure"
6301 #include "confdefs.h"
6302 #include <ldap.h>
6303 EOF
6304 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6305 { (eval echo configure:6306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6306 ac_err=`grep -v '^ *+' conftest.out`
6307 if test -z "$ac_err"; then
6308   rm -rf conftest*
6309   eval "ac_cv_header_$ac_safe=yes"
6310 else
6311   echo "$ac_err" >&5
6312   echo "configure: failed program was:" >&5
6313   cat conftest.$ac_ext >&5
6314   rm -rf conftest*
6315   eval "ac_cv_header_$ac_safe=no"
6316 fi
6317 rm -f conftest*
6318 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6319   echo "$ac_t""yes" 1>&6
6320   :
6321 else
6322   echo "$ac_t""no" 1>&6
6323 with_ldap=no
6324 fi
6325  }
6326 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6327 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6328 echo "configure:6329: checking for lber.h" >&5
6329
6330 cat > conftest.$ac_ext <<EOF
6331 #line 6332 "configure"
6332 #include "confdefs.h"
6333 #include <lber.h>
6334 EOF
6335 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6336 { (eval echo configure:6337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6337 ac_err=`grep -v '^ *+' conftest.out`
6338 if test -z "$ac_err"; then
6339   rm -rf conftest*
6340   eval "ac_cv_header_$ac_safe=yes"
6341 else
6342   echo "$ac_err" >&5
6343   echo "configure: failed program was:" >&5
6344   cat conftest.$ac_ext >&5
6345   rm -rf conftest*
6346   eval "ac_cv_header_$ac_safe=no"
6347 fi
6348 rm -f conftest*
6349 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6350   echo "$ac_t""yes" 1>&6
6351   :
6352 else
6353   echo "$ac_t""no" 1>&6
6354 with_ldap=no
6355 fi
6356  }
6357 if test "$with_ldap" != "no"; then
6358   test -z "$with_umich_ldap" && { 
6359 xe_msg_checking="for ldap_open in -lldap"
6360 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6361 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6362 echo "configure:6363: checking "$xe_msg_checking"" >&5
6363 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6364
6365 xe_check_libs=" -lldap -llber"
6366 cat > conftest.$ac_ext <<EOF
6367 #line 6368 "configure"
6368 #include "confdefs.h"
6369 /* Override any gcc2 internal prototype to avoid an error.  */
6370 /* We use char because int might match the return type of a gcc2
6371     builtin and then its argument prototype would still apply.  */
6372 char ldap_open();
6373
6374 int main() {
6375 ldap_open()
6376 ; return 0; }
6377 EOF
6378 if { (eval echo configure:6379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6379   rm -rf conftest*
6380   eval "ac_cv_lib_$ac_lib_var=yes"
6381 else
6382   echo "configure: failed program was:" >&5
6383   cat conftest.$ac_ext >&5
6384   rm -rf conftest*
6385   eval "ac_cv_lib_$ac_lib_var=no"
6386 fi
6387 rm -f conftest*
6388 xe_check_libs=""
6389
6390 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6391   echo "$ac_t""yes" 1>&6
6392   with_umich_ldap=yes
6393 else
6394   echo "$ac_t""no" 1>&6
6395 with_umich_ldap=no
6396 fi
6397
6398  }
6399   test "$with_umich_ldap" = "no" && { 
6400 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
6401 echo "configure:6402: checking for ldap_set_option in -lldap10" >&5
6402 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
6403
6404 xe_check_libs=" -lldap10 "
6405 cat > conftest.$ac_ext <<EOF
6406 #line 6407 "configure"
6407 #include "confdefs.h"
6408 /* Override any gcc2 internal prototype to avoid an error.  */
6409 /* We use char because int might match the return type of a gcc2
6410     builtin and then its argument prototype would still apply.  */
6411 char ldap_set_option();
6412
6413 int main() {
6414 ldap_set_option()
6415 ; return 0; }
6416 EOF
6417 if { (eval echo configure:6418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6418   rm -rf conftest*
6419   eval "ac_cv_lib_$ac_lib_var=yes"
6420 else
6421   echo "configure: failed program was:" >&5
6422   cat conftest.$ac_ext >&5
6423   rm -rf conftest*
6424   eval "ac_cv_lib_$ac_lib_var=no"
6425 fi
6426 rm -f conftest*
6427 xe_check_libs=""
6428
6429 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6430   echo "$ac_t""yes" 1>&6
6431   with_ns_ldap=yes
6432 else
6433   echo "$ac_t""no" 1>&6
6434 with_ns_ldap=no
6435 fi
6436
6437  }
6438   test -z "$with_ldap" -a \( "$with_umich_ldap" = "yes" -o "$with_ns_ldap" = "yes" \) && with_ldap=yes
6439 fi
6440 if test "$with_ldap" = "yes"; then
6441   { test "$extra_verbose" = "yes" && cat << \EOF
6442     Defining HAVE_LDAP
6443 EOF
6444 cat >> confdefs.h <<\EOF
6445 #define HAVE_LDAP 1
6446 EOF
6447 }
6448
6449   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6450    echo "    xemacs will be linked with \"eldap.o\""
6451  fi
6452   if test "$with_umich_ldap" = "yes" ; then
6453     { test "$extra_verbose" = "yes" && cat << \EOF
6454     Defining HAVE_UMICH_LDAP
6455 EOF
6456 cat >> confdefs.h <<\EOF
6457 #define HAVE_UMICH_LDAP 1
6458 EOF
6459 }
6460
6461     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6462     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6463   elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then
6464     { test "$extra_verbose" = "yes" && cat << \EOF
6465     Defining HAVE_NS_LDAP
6466 EOF
6467 cat >> confdefs.h <<\EOF
6468 #define HAVE_NS_LDAP 1
6469 EOF
6470 }
6471
6472     LIBS="-lldap10 $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap10\" to \$LIBS"; fi
6473   elif test "$with_ldap" = "yes" ; then
6474     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6475   fi
6476 fi
6477
6478
6479 if test "$window_system" != "none"; then
6480   echo "checking for graphics libraries" 1>&6
6481 echo "configure:6482: checking for graphics libraries" >&5
6482
6483     xpm_problem=""
6484   if test -z "$with_xpm"; then
6485     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6486 echo "configure:6487: checking for Xpm - no older than 3.4f" >&5
6487     xe_check_libs=-lXpm
6488     cat > conftest.$ac_ext <<EOF
6489 #line 6490 "configure"
6490 #include "confdefs.h"
6491 #include <X11/xpm.h>
6492     int main(int c, char **v) {
6493     return c == 1 ? 0 :
6494       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6495       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6496 EOF
6497 if { (eval echo configure:6498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6498 then
6499   ./conftest dummy_arg; xpm_status=$?;
6500       if test "$xpm_status" = "0"; then
6501         with_xpm=yes;
6502       else
6503         with_xpm=no;
6504         if test "$xpm_status" = "1"; then
6505           xpm_problem="Xpm library version and header file version don't match!"
6506         elif test "$xpm_status" = "2"; then
6507           xpm_problem="Xpm library version is too old!"
6508         else
6509           xpm_problem="Internal xpm detection logic error!"
6510         fi
6511         echo "
6512 *** WARNING *** $xpm_problem
6513   I'm not touching that with a 10-foot pole!
6514   If you really want to use the installed version of Xpm, rerun
6515   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6516     fi
6517 else
6518   conftest_rc="$?"
6519   echo "configure: failed program was:" >&5
6520   cat conftest.$ac_ext >&5
6521   rm -fr conftest*
6522   with_xpm=no
6523 fi
6524 rm -fr conftest*
6525     xe_check_libs=
6526     echo "$ac_t""$with_xpm" 1>&6
6527   fi
6528   if test "$with_xpm" = "yes"; then
6529     { test "$extra_verbose" = "yes" && cat << \EOF
6530     Defining HAVE_XPM
6531 EOF
6532 cat >> confdefs.h <<\EOF
6533 #define HAVE_XPM 1
6534 EOF
6535 }
6536
6537     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6538     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6539 echo "configure:6540: checking for \"FOR_MSW\" xpm" >&5
6540     xe_check_libs=-lXpm
6541     cat > conftest.$ac_ext <<EOF
6542 #line 6543 "configure"
6543 #include "confdefs.h"
6544
6545 int main() {
6546 XpmCreatePixmapFromData()
6547 ; return 0; }
6548 EOF
6549 if { (eval echo configure:6550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6550   rm -rf conftest*
6551   xpm_for_msw=no
6552 else
6553   echo "configure: failed program was:" >&5
6554   cat conftest.$ac_ext >&5
6555   rm -rf conftest*
6556   xpm_for_msw=yes
6557 fi
6558 rm -f conftest*
6559     xe_check_libs=
6560     echo "$ac_t""$xpm_for_msw" 1>&6
6561     if test "$xpm_for_msw" = "yes"; then
6562       { test "$extra_verbose" = "yes" && cat << \EOF
6563     Defining FOR_MSW
6564 EOF
6565 cat >> confdefs.h <<\EOF
6566 #define FOR_MSW 1
6567 EOF
6568 }
6569
6570     fi
6571   fi
6572
6573     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6574 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6575 echo "configure:6576: checking for compface.h" >&5
6576
6577 cat > conftest.$ac_ext <<EOF
6578 #line 6579 "configure"
6579 #include "confdefs.h"
6580 #include <compface.h>
6581 EOF
6582 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6583 { (eval echo configure:6584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6584 ac_err=`grep -v '^ *+' conftest.out`
6585 if test -z "$ac_err"; then
6586   rm -rf conftest*
6587   eval "ac_cv_header_$ac_safe=yes"
6588 else
6589   echo "$ac_err" >&5
6590   echo "configure: failed program was:" >&5
6591   cat conftest.$ac_ext >&5
6592   rm -rf conftest*
6593   eval "ac_cv_header_$ac_safe=no"
6594 fi
6595 rm -f conftest*
6596 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6597   echo "$ac_t""yes" 1>&6
6598   :
6599 else
6600   echo "$ac_t""no" 1>&6
6601 with_xface=no
6602 fi
6603  }
6604   test -z "$with_xface" && { 
6605 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6606 echo "configure:6607: checking for UnGenFace in -lcompface" >&5
6607 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6608
6609 xe_check_libs=" -lcompface "
6610 cat > conftest.$ac_ext <<EOF
6611 #line 6612 "configure"
6612 #include "confdefs.h"
6613 /* Override any gcc2 internal prototype to avoid an error.  */
6614 /* We use char because int might match the return type of a gcc2
6615     builtin and then its argument prototype would still apply.  */
6616 char UnGenFace();
6617
6618 int main() {
6619 UnGenFace()
6620 ; return 0; }
6621 EOF
6622 if { (eval echo configure:6623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6623   rm -rf conftest*
6624   eval "ac_cv_lib_$ac_lib_var=yes"
6625 else
6626   echo "configure: failed program was:" >&5
6627   cat conftest.$ac_ext >&5
6628   rm -rf conftest*
6629   eval "ac_cv_lib_$ac_lib_var=no"
6630 fi
6631 rm -f conftest*
6632 xe_check_libs=""
6633
6634 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6635   echo "$ac_t""yes" 1>&6
6636   : 
6637 else
6638   echo "$ac_t""no" 1>&6
6639 with_xface=no
6640 fi
6641
6642  }
6643   test -z "$with_xface" && with_xface=yes
6644   if test "$with_xface" = "yes"; then
6645     { test "$extra_verbose" = "yes" && cat << \EOF
6646     Defining HAVE_XFACE
6647 EOF
6648 cat >> confdefs.h <<\EOF
6649 #define HAVE_XFACE 1
6650 EOF
6651 }
6652
6653     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
6654   fi
6655
6656         if test "$with_gif" != "no"; then
6657     with_gif="yes"
6658     { test "$extra_verbose" = "yes" && cat << \EOF
6659     Defining HAVE_GIF
6660 EOF
6661 cat >> confdefs.h <<\EOF
6662 #define HAVE_GIF 1
6663 EOF
6664 }
6665
6666     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6667    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6668  fi
6669   fi
6670
6671       if test "$with_png $with_tiff" != "no no"; then
6672     
6673 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6674 echo "configure:6675: checking for inflate in -lc" >&5
6675 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6676
6677 xe_check_libs=" -lc "
6678 cat > conftest.$ac_ext <<EOF
6679 #line 6680 "configure"
6680 #include "confdefs.h"
6681 /* Override any gcc2 internal prototype to avoid an error.  */
6682 /* We use char because int might match the return type of a gcc2
6683     builtin and then its argument prototype would still apply.  */
6684 char inflate();
6685
6686 int main() {
6687 inflate()
6688 ; return 0; }
6689 EOF
6690 if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6691   rm -rf conftest*
6692   eval "ac_cv_lib_$ac_lib_var=yes"
6693 else
6694   echo "configure: failed program was:" >&5
6695   cat conftest.$ac_ext >&5
6696   rm -rf conftest*
6697   eval "ac_cv_lib_$ac_lib_var=no"
6698 fi
6699 rm -f conftest*
6700 xe_check_libs=""
6701
6702 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6703   echo "$ac_t""yes" 1>&6
6704   :
6705 else
6706   echo "$ac_t""no" 1>&6
6707
6708 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6709 echo "configure:6710: checking for inflate in -lz" >&5
6710 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6711
6712 xe_check_libs=" -lz "
6713 cat > conftest.$ac_ext <<EOF
6714 #line 6715 "configure"
6715 #include "confdefs.h"
6716 /* Override any gcc2 internal prototype to avoid an error.  */
6717 /* We use char because int might match the return type of a gcc2
6718     builtin and then its argument prototype would still apply.  */
6719 char inflate();
6720
6721 int main() {
6722 inflate()
6723 ; return 0; }
6724 EOF
6725 if { (eval echo configure:6726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6726   rm -rf conftest*
6727   eval "ac_cv_lib_$ac_lib_var=yes"
6728 else
6729   echo "configure: failed program was:" >&5
6730   cat conftest.$ac_ext >&5
6731   rm -rf conftest*
6732   eval "ac_cv_lib_$ac_lib_var=no"
6733 fi
6734 rm -f conftest*
6735 xe_check_libs=""
6736
6737 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6738   echo "$ac_t""yes" 1>&6
6739   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6740 else
6741   echo "$ac_t""no" 1>&6
6742
6743 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6744 echo "configure:6745: checking for inflate in -lgz" >&5
6745 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6746
6747 xe_check_libs=" -lgz "
6748 cat > conftest.$ac_ext <<EOF
6749 #line 6750 "configure"
6750 #include "confdefs.h"
6751 /* Override any gcc2 internal prototype to avoid an error.  */
6752 /* We use char because int might match the return type of a gcc2
6753     builtin and then its argument prototype would still apply.  */
6754 char inflate();
6755
6756 int main() {
6757 inflate()
6758 ; return 0; }
6759 EOF
6760 if { (eval echo configure:6761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6761   rm -rf conftest*
6762   eval "ac_cv_lib_$ac_lib_var=yes"
6763 else
6764   echo "configure: failed program was:" >&5
6765   cat conftest.$ac_ext >&5
6766   rm -rf conftest*
6767   eval "ac_cv_lib_$ac_lib_var=no"
6768 fi
6769 rm -f conftest*
6770 xe_check_libs=""
6771
6772 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6773   echo "$ac_t""yes" 1>&6
6774   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6775 else
6776   echo "$ac_t""no" 1>&6
6777 fi
6778
6779
6780 fi
6781
6782
6783 fi
6784
6785
6786   fi
6787
6788     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6789 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6790 echo "configure:6791: checking for jpeglib.h" >&5
6791
6792 cat > conftest.$ac_ext <<EOF
6793 #line 6794 "configure"
6794 #include "confdefs.h"
6795 #include <jpeglib.h>
6796 EOF
6797 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6798 { (eval echo configure:6799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6799 ac_err=`grep -v '^ *+' conftest.out`
6800 if test -z "$ac_err"; then
6801   rm -rf conftest*
6802   eval "ac_cv_header_$ac_safe=yes"
6803 else
6804   echo "$ac_err" >&5
6805   echo "configure: failed program was:" >&5
6806   cat conftest.$ac_ext >&5
6807   rm -rf conftest*
6808   eval "ac_cv_header_$ac_safe=no"
6809 fi
6810 rm -f conftest*
6811 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6812   echo "$ac_t""yes" 1>&6
6813   :
6814 else
6815   echo "$ac_t""no" 1>&6
6816 with_jpeg=no
6817 fi
6818  }
6819   test -z "$with_jpeg" && { 
6820 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
6821 echo "configure:6822: checking for jpeg_destroy_decompress in -ljpeg" >&5
6822 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
6823
6824 xe_check_libs=" -ljpeg "
6825 cat > conftest.$ac_ext <<EOF
6826 #line 6827 "configure"
6827 #include "confdefs.h"
6828 /* Override any gcc2 internal prototype to avoid an error.  */
6829 /* We use char because int might match the return type of a gcc2
6830     builtin and then its argument prototype would still apply.  */
6831 char jpeg_destroy_decompress();
6832
6833 int main() {
6834 jpeg_destroy_decompress()
6835 ; return 0; }
6836 EOF
6837 if { (eval echo configure:6838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6838   rm -rf conftest*
6839   eval "ac_cv_lib_$ac_lib_var=yes"
6840 else
6841   echo "configure: failed program was:" >&5
6842   cat conftest.$ac_ext >&5
6843   rm -rf conftest*
6844   eval "ac_cv_lib_$ac_lib_var=no"
6845 fi
6846 rm -f conftest*
6847 xe_check_libs=""
6848
6849 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6850   echo "$ac_t""yes" 1>&6
6851   :
6852 else
6853   echo "$ac_t""no" 1>&6
6854 with_jpeg=no
6855 fi
6856
6857  }
6858   test -z "$with_jpeg" && with_jpeg=yes
6859   if test "$with_jpeg" = "yes"; then
6860     { test "$extra_verbose" = "yes" && cat << \EOF
6861     Defining HAVE_JPEG
6862 EOF
6863 cat >> confdefs.h <<\EOF
6864 #define HAVE_JPEG 1
6865 EOF
6866 }
6867
6868     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
6869   fi
6870
6871     png_problem=""
6872   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
6873 echo "configure:6874: checking for pow" >&5
6874
6875 cat > conftest.$ac_ext <<EOF
6876 #line 6877 "configure"
6877 #include "confdefs.h"
6878 /* System header to define __stub macros and hopefully few prototypes,
6879     which can conflict with char pow(); below.  */
6880 #include <assert.h>
6881 /* Override any gcc2 internal prototype to avoid an error.  */
6882 /* We use char because int might match the return type of a gcc2
6883     builtin and then its argument prototype would still apply.  */
6884 char pow();
6885
6886 int main() {
6887
6888 /* The GNU C library defines this for functions which it implements
6889     to always fail with ENOSYS.  Some functions are actually named
6890     something starting with __ and the normal name is an alias.  */
6891 #if defined (__stub_pow) || defined (__stub___pow)
6892 choke me
6893 #else
6894 pow();
6895 #endif
6896
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_func_pow=yes"
6902 else
6903   echo "configure: failed program was:" >&5
6904   cat conftest.$ac_ext >&5
6905   rm -rf conftest*
6906   eval "ac_cv_func_pow=no"
6907 fi
6908 rm -f conftest*
6909
6910 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
6911   echo "$ac_t""yes" 1>&6
6912   :
6913 else
6914   echo "$ac_t""no" 1>&6
6915 with_png=no
6916 fi
6917  }
6918   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
6919 echo $ac_n "checking for png.h""... $ac_c" 1>&6
6920 echo "configure:6921: checking for png.h" >&5
6921
6922 cat > conftest.$ac_ext <<EOF
6923 #line 6924 "configure"
6924 #include "confdefs.h"
6925 #include <png.h>
6926 EOF
6927 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6928 { (eval echo configure:6929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6929 ac_err=`grep -v '^ *+' conftest.out`
6930 if test -z "$ac_err"; then
6931   rm -rf conftest*
6932   eval "ac_cv_header_$ac_safe=yes"
6933 else
6934   echo "$ac_err" >&5
6935   echo "configure: failed program was:" >&5
6936   cat conftest.$ac_ext >&5
6937   rm -rf conftest*
6938   eval "ac_cv_header_$ac_safe=no"
6939 fi
6940 rm -f conftest*
6941 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6942   echo "$ac_t""yes" 1>&6
6943   :
6944 else
6945   echo "$ac_t""no" 1>&6
6946 with_png=no
6947 fi
6948  }
6949   test -z "$with_png" && { 
6950 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
6951 echo "configure:6952: checking for png_read_image in -lpng" >&5
6952 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
6953
6954 xe_check_libs=" -lpng "
6955 cat > conftest.$ac_ext <<EOF
6956 #line 6957 "configure"
6957 #include "confdefs.h"
6958 /* Override any gcc2 internal prototype to avoid an error.  */
6959 /* We use char because int might match the return type of a gcc2
6960     builtin and then its argument prototype would still apply.  */
6961 char png_read_image();
6962
6963 int main() {
6964 png_read_image()
6965 ; return 0; }
6966 EOF
6967 if { (eval echo configure:6968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6968   rm -rf conftest*
6969   eval "ac_cv_lib_$ac_lib_var=yes"
6970 else
6971   echo "configure: failed program was:" >&5
6972   cat conftest.$ac_ext >&5
6973   rm -rf conftest*
6974   eval "ac_cv_lib_$ac_lib_var=no"
6975 fi
6976 rm -f conftest*
6977 xe_check_libs=""
6978
6979 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6980   echo "$ac_t""yes" 1>&6
6981   :
6982 else
6983   echo "$ac_t""no" 1>&6
6984 with_png=no
6985 fi
6986
6987  }
6988   if test -z "$with_png"; then
6989     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
6990 echo "configure:6991: checking for workable png version information" >&5
6991     xe_check_libs="-lpng -lz"
6992     cat > conftest.$ac_ext <<EOF
6993 #line 6994 "configure"
6994 #include "confdefs.h"
6995 #include <png.h>
6996     int main(int c, char **v) {
6997     if (c == 1) return 0;
6998     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
6999     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7000 EOF
7001 if { (eval echo configure:7002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7002 then
7003   ./conftest dummy_arg; png_status=$?;
7004       if test "$png_status" = "0"; then
7005         with_png=yes;
7006       else
7007         with_png=no;
7008         if test "$png_status" = "1"; then
7009           png_problem="PNG library version and header file don't match!"
7010         elif test "$png_status" = "2"; then
7011           png_problem="PNG library version too old (pre 1.0.2)!"
7012         fi
7013         echo "
7014 *** WARNING *** $png_problem
7015   I'm not touching that with a 10-foot pole!
7016   If you really want to use the installed version of libPNG, rerun
7017   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7018     fi
7019 else
7020   conftest_rc="$?"
7021   echo "configure: failed program was:" >&5
7022   cat conftest.$ac_ext >&5
7023   rm -fr conftest*
7024   with_png=no
7025 fi
7026 rm -fr conftest*
7027     xe_check_libs=
7028     echo "$ac_t""$with_png" 1>&6
7029   fi
7030   if test "$with_png" = "yes"; then
7031     { test "$extra_verbose" = "yes" && cat << \EOF
7032     Defining HAVE_PNG
7033 EOF
7034 cat >> confdefs.h <<\EOF
7035 #define HAVE_PNG 1
7036 EOF
7037 }
7038
7039     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7040   fi
7041
7042     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7043 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7044 echo "configure:7045: checking for tiffio.h" >&5
7045
7046 cat > conftest.$ac_ext <<EOF
7047 #line 7048 "configure"
7048 #include "confdefs.h"
7049 #include <tiffio.h>
7050 EOF
7051 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7052 { (eval echo configure:7053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7053 ac_err=`grep -v '^ *+' conftest.out`
7054 if test -z "$ac_err"; then
7055   rm -rf conftest*
7056   eval "ac_cv_header_$ac_safe=yes"
7057 else
7058   echo "$ac_err" >&5
7059   echo "configure: failed program was:" >&5
7060   cat conftest.$ac_ext >&5
7061   rm -rf conftest*
7062   eval "ac_cv_header_$ac_safe=no"
7063 fi
7064 rm -f conftest*
7065 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7066   echo "$ac_t""yes" 1>&6
7067   :
7068 else
7069   echo "$ac_t""no" 1>&6
7070 with_tiff=no
7071 fi
7072  }
7073   test -z "$with_tiff" && { 
7074 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7075 echo "configure:7076: checking for TIFFClientOpen in -ltiff" >&5
7076 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7077
7078 xe_check_libs=" -ltiff "
7079 cat > conftest.$ac_ext <<EOF
7080 #line 7081 "configure"
7081 #include "confdefs.h"
7082 /* Override any gcc2 internal prototype to avoid an error.  */
7083 /* We use char because int might match the return type of a gcc2
7084     builtin and then its argument prototype would still apply.  */
7085 char TIFFClientOpen();
7086
7087 int main() {
7088 TIFFClientOpen()
7089 ; return 0; }
7090 EOF
7091 if { (eval echo configure:7092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7092   rm -rf conftest*
7093   eval "ac_cv_lib_$ac_lib_var=yes"
7094 else
7095   echo "configure: failed program was:" >&5
7096   cat conftest.$ac_ext >&5
7097   rm -rf conftest*
7098   eval "ac_cv_lib_$ac_lib_var=no"
7099 fi
7100 rm -f conftest*
7101 xe_check_libs=""
7102
7103 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7104   echo "$ac_t""yes" 1>&6
7105   :
7106 else
7107   echo "$ac_t""no" 1>&6
7108 with_tiff=no
7109 fi
7110
7111  }
7112   test -z "$with_tiff" && with_tiff=yes
7113   if test "$with_tiff" = "yes"; then
7114     { test "$extra_verbose" = "yes" && cat << \EOF
7115     Defining HAVE_TIFF
7116 EOF
7117 cat >> confdefs.h <<\EOF
7118 #define HAVE_TIFF 1
7119 EOF
7120 }
7121
7122     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7123   fi
7124 fi
7125
7126
7127 if test "$with_x11" = "yes"; then
7128
7129   echo "checking for X11 graphics libraries" 1>&6
7130 echo "configure:7131: checking for X11 graphics libraries" >&5
7131
7132     
7133 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7134 echo "configure:7135: checking for XawScrollbarSetThumb in -lXaw" >&5
7135 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7136
7137 xe_check_libs=" -lXaw "
7138 cat > conftest.$ac_ext <<EOF
7139 #line 7140 "configure"
7140 #include "confdefs.h"
7141 /* Override any gcc2 internal prototype to avoid an error.  */
7142 /* We use char because int might match the return type of a gcc2
7143     builtin and then its argument prototype would still apply.  */
7144 char XawScrollbarSetThumb();
7145
7146 int main() {
7147 XawScrollbarSetThumb()
7148 ; return 0; }
7149 EOF
7150 if { (eval echo configure:7151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7151   rm -rf conftest*
7152   eval "ac_cv_lib_$ac_lib_var=yes"
7153 else
7154   echo "configure: failed program was:" >&5
7155   cat conftest.$ac_ext >&5
7156   rm -rf conftest*
7157   eval "ac_cv_lib_$ac_lib_var=no"
7158 fi
7159 rm -f conftest*
7160 xe_check_libs=""
7161
7162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7163   echo "$ac_t""yes" 1>&6
7164   have_xaw=yes
7165 else
7166   echo "$ac_t""no" 1>&6
7167 have_xaw=no
7168 fi
7169
7170
7171                     
7172     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7173 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7174 echo "configure:7175: checking for Xm/Xm.h" >&5
7175
7176 cat > conftest.$ac_ext <<EOF
7177 #line 7178 "configure"
7178 #include "confdefs.h"
7179 #include <Xm/Xm.h>
7180 EOF
7181 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7182 { (eval echo configure:7183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7183 ac_err=`grep -v '^ *+' conftest.out`
7184 if test -z "$ac_err"; then
7185   rm -rf conftest*
7186   eval "ac_cv_header_$ac_safe=yes"
7187 else
7188   echo "$ac_err" >&5
7189   echo "configure: failed program was:" >&5
7190   cat conftest.$ac_ext >&5
7191   rm -rf conftest*
7192   eval "ac_cv_header_$ac_safe=no"
7193 fi
7194 rm -f conftest*
7195 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7196   echo "$ac_t""yes" 1>&6
7197   
7198 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7199 echo "configure:7200: checking for XmStringFree in -lXm" >&5
7200 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7201
7202 xe_check_libs=" -lXm "
7203 cat > conftest.$ac_ext <<EOF
7204 #line 7205 "configure"
7205 #include "confdefs.h"
7206 /* Override any gcc2 internal prototype to avoid an error.  */
7207 /* We use char because int might match the return type of a gcc2
7208     builtin and then its argument prototype would still apply.  */
7209 char XmStringFree();
7210
7211 int main() {
7212 XmStringFree()
7213 ; return 0; }
7214 EOF
7215 if { (eval echo configure:7216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7216   rm -rf conftest*
7217   eval "ac_cv_lib_$ac_lib_var=yes"
7218 else
7219   echo "configure: failed program was:" >&5
7220   cat conftest.$ac_ext >&5
7221   rm -rf conftest*
7222   eval "ac_cv_lib_$ac_lib_var=no"
7223 fi
7224 rm -f conftest*
7225 xe_check_libs=""
7226
7227 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7228   echo "$ac_t""yes" 1>&6
7229   have_motif=yes
7230 else
7231   echo "$ac_t""no" 1>&6
7232 have_motif=no
7233 fi
7234
7235
7236 else
7237   echo "$ac_t""no" 1>&6
7238 have_motif=no
7239 fi
7240
7241
7242   if test "$have_motif" = "yes"; then
7243         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7244 echo "configure:7245: checking for Lesstif" >&5
7245     cat > conftest.$ac_ext <<EOF
7246 #line 7247 "configure"
7247 #include "confdefs.h"
7248 #include <Xm/Xm.h>
7249 #ifdef LESSTIF_VERSION
7250 yes
7251 #endif
7252
7253 EOF
7254 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7255   egrep "yes" >/dev/null 2>&1; then
7256   rm -rf conftest*
7257   have_lesstif=yes
7258 else
7259   rm -rf conftest*
7260   have_lesstif=no
7261 fi
7262 rm -f conftest*
7263
7264   echo "$ac_t""$have_lesstif" 1>&6
7265   fi
7266
7267 fi 
7268
7269 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7270   with_menubars="lucid" ;;
7271 esac
7272 case "$with_dialogs" in "" | "yes" | "lucid" )
7273   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7274   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7275   else with_dialogs=no
7276   fi ;;
7277 esac
7278 case "$with_scrollbars" in "" | "yes" )
7279   with_scrollbars="lucid" ;;
7280 esac
7281
7282 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7283
7284 case "$all_widgets" in *athena* )
7285   { test "$extra_verbose" = "yes" && cat << \EOF
7286     Defining LWLIB_USES_ATHENA
7287 EOF
7288 cat >> confdefs.h <<\EOF
7289 #define LWLIB_USES_ATHENA 1
7290 EOF
7291 }
7292
7293   { test "$extra_verbose" = "yes" && cat << \EOF
7294     Defining NEED_ATHENA
7295 EOF
7296 cat >> confdefs.h <<\EOF
7297 #define NEED_ATHENA 1
7298 EOF
7299 }
7300
7301   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7302   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7303 esac
7304
7305 case "$all_widgets" in *motif* )
7306   { test "$extra_verbose" = "yes" && cat << \EOF
7307     Defining LWLIB_USES_MOTIF
7308 EOF
7309 cat >> confdefs.h <<\EOF
7310 #define LWLIB_USES_MOTIF 1
7311 EOF
7312 }
7313
7314   { test "$extra_verbose" = "yes" && cat << \EOF
7315     Defining NEED_MOTIF
7316 EOF
7317 cat >> confdefs.h <<\EOF
7318 #define NEED_MOTIF 1
7319 EOF
7320 }
7321
7322   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7323   need_motif=yes ;;
7324 esac
7325
7326 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7327 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7328 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7329 case "$all_widgets" in *lucid* )
7330   { test "$extra_verbose" = "yes" && cat << \EOF
7331     Defining NEED_LUCID
7332 EOF
7333 cat >> confdefs.h <<\EOF
7334 #define NEED_LUCID 1
7335 EOF
7336 }
7337
7338   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7339 esac
7340
7341
7342
7343 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7344     Defining LWLIB_SCROLLBARS_ATHENA
7345 EOF
7346 cat >> confdefs.h <<\EOF
7347 #define LWLIB_SCROLLBARS_ATHENA 1
7348 EOF
7349 }
7350 ;; esac
7351 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7352     Defining LWLIB_DIALOGS_ATHENA
7353 EOF
7354 cat >> confdefs.h <<\EOF
7355 #define LWLIB_DIALOGS_ATHENA 1
7356 EOF
7357 }
7358    ;; esac
7359 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7360     Defining LWLIB_SCROLLBARS_ATHENA3D
7361 EOF
7362 cat >> confdefs.h <<\EOF
7363 #define LWLIB_SCROLLBARS_ATHENA3D 1
7364 EOF
7365 }
7366
7367 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7368     Defining LWLIB_DIALOGS_ATHENA3D
7369 EOF
7370 cat >> confdefs.h <<\EOF
7371 #define LWLIB_DIALOGS_ATHENA3D 1
7372 EOF
7373 }
7374
7375
7376 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7377     Defining HAVE_MENUBARS
7378 EOF
7379 cat >> confdefs.h <<\EOF
7380 #define HAVE_MENUBARS 1
7381 EOF
7382 }
7383
7384 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7385     Defining HAVE_SCROLLBARS
7386 EOF
7387 cat >> confdefs.h <<\EOF
7388 #define HAVE_SCROLLBARS 1
7389 EOF
7390 }
7391
7392 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7393     Defining HAVE_DIALOGS
7394 EOF
7395 cat >> confdefs.h <<\EOF
7396 #define HAVE_DIALOGS 1
7397 EOF
7398 }
7399
7400 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7401     Defining HAVE_TOOLBARS
7402 EOF
7403 cat >> confdefs.h <<\EOF
7404 #define HAVE_TOOLBARS 1
7405 EOF
7406 }
7407
7408
7409 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7410     Defining LWLIB_MENUBARS_LUCID
7411 EOF
7412 cat >> confdefs.h <<\EOF
7413 #define LWLIB_MENUBARS_LUCID 1
7414 EOF
7415 }
7416
7417 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7418     Defining LWLIB_SCROLLBARS_LUCID
7419 EOF
7420 cat >> confdefs.h <<\EOF
7421 #define LWLIB_SCROLLBARS_LUCID 1
7422 EOF
7423 }
7424
7425
7426 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7427     Defining LWLIB_MENUBARS_MOTIF
7428 EOF
7429 cat >> confdefs.h <<\EOF
7430 #define LWLIB_MENUBARS_MOTIF 1
7431 EOF
7432 }
7433
7434 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7435     Defining LWLIB_SCROLLBARS_MOTIF
7436 EOF
7437 cat >> confdefs.h <<\EOF
7438 #define LWLIB_SCROLLBARS_MOTIF 1
7439 EOF
7440 }
7441
7442 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7443     Defining LWLIB_DIALOGS_MOTIF
7444 EOF
7445 cat >> confdefs.h <<\EOF
7446 #define LWLIB_DIALOGS_MOTIF 1
7447 EOF
7448 }
7449
7450
7451 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7452    echo "    xemacs will be linked with \"menubar.o\""
7453  fi
7454 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7455    echo "    xemacs will be linked with \"scrollbar.o\""
7456  fi
7457 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7458    echo "    xemacs will be linked with \"dialog.o\""
7459  fi
7460 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7461    echo "    xemacs will be linked with \"toolbar.o\""
7462  fi
7463
7464 if test "$with_x11" = "yes"; then
7465   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7466    echo "    xemacs will be linked with \"menubar-x.o\""
7467  fi
7468   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7469    echo "    xemacs will be linked with \"scrollbar-x.o\""
7470  fi
7471   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7472    echo "    xemacs will be linked with \"dialog-x.o\""
7473  fi
7474   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7475    echo "    xemacs will be linked with \"toolbar-x.o\""
7476  fi
7477   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7478    echo "    xemacs will be linked with \"gui-x.o\""
7479  fi
7480 else
7481   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7482     echo "Attempt to Build NAS sound without X"
7483     echo "Please remove NAS configuration or build with X"
7484     exit 1
7485   fi
7486 fi
7487
7488
7489 test -z "$with_mule" && with_mule=no
7490 test -z "$with_file_coding" && with_file_coding=no
7491
7492
7493 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7494   { test "$extra_verbose" = "yes" && cat << \EOF
7495     Defining FILE_CODING
7496 EOF
7497 cat >> confdefs.h <<\EOF
7498 #define FILE_CODING 1
7499 EOF
7500 }
7501
7502   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7503    echo "    xemacs will be linked with \"file-coding.o\""
7504  fi
7505 fi
7506
7507 if test "$with_mule" = "yes" ; then
7508   echo "checking for Mule-related features" 1>&6
7509 echo "configure:7510: checking for Mule-related features" >&5
7510   { test "$extra_verbose" = "yes" && cat << \EOF
7511     Defining MULE
7512 EOF
7513 cat >> confdefs.h <<\EOF
7514 #define MULE 1
7515 EOF
7516 }
7517
7518   { test "$extra_verbose" = "yes" && cat << \EOF
7519     Defining FILE_CODING
7520 EOF
7521 cat >> confdefs.h <<\EOF
7522 #define FILE_CODING 1
7523 EOF
7524 }
7525
7526   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7527    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7528  fi
7529
7530     for ac_hdr in libintl.h
7531 do
7532 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7533 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7534 echo "configure:7535: checking for $ac_hdr" >&5
7535
7536 cat > conftest.$ac_ext <<EOF
7537 #line 7538 "configure"
7538 #include "confdefs.h"
7539 #include <$ac_hdr>
7540 EOF
7541 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7542 { (eval echo configure:7543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7543 ac_err=`grep -v '^ *+' conftest.out`
7544 if test -z "$ac_err"; then
7545   rm -rf conftest*
7546   eval "ac_cv_header_$ac_safe=yes"
7547 else
7548   echo "$ac_err" >&5
7549   echo "configure: failed program was:" >&5
7550   cat conftest.$ac_ext >&5
7551   rm -rf conftest*
7552   eval "ac_cv_header_$ac_safe=no"
7553 fi
7554 rm -f conftest*
7555 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7556   echo "$ac_t""yes" 1>&6
7557     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7558   { test "$extra_verbose" = "yes" && cat << EOF
7559     Defining $ac_tr_hdr
7560 EOF
7561 cat >> confdefs.h <<EOF
7562 #define $ac_tr_hdr 1
7563 EOF
7564 }
7565  
7566 else
7567   echo "$ac_t""no" 1>&6
7568 fi
7569 done
7570
7571   
7572 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7573 echo "configure:7574: checking for strerror in -lintl" >&5
7574 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7575
7576 xe_check_libs=" -lintl "
7577 cat > conftest.$ac_ext <<EOF
7578 #line 7579 "configure"
7579 #include "confdefs.h"
7580 /* Override any gcc2 internal prototype to avoid an error.  */
7581 /* We use char because int might match the return type of a gcc2
7582     builtin and then its argument prototype would still apply.  */
7583 char strerror();
7584
7585 int main() {
7586 strerror()
7587 ; return 0; }
7588 EOF
7589 if { (eval echo configure:7590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7590   rm -rf conftest*
7591   eval "ac_cv_lib_$ac_lib_var=yes"
7592 else
7593   echo "configure: failed program was:" >&5
7594   cat conftest.$ac_ext >&5
7595   rm -rf conftest*
7596   eval "ac_cv_lib_$ac_lib_var=no"
7597 fi
7598 rm -f conftest*
7599 xe_check_libs=""
7600
7601 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7602   echo "$ac_t""yes" 1>&6
7603     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7604     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7605   { test "$extra_verbose" = "yes" && cat << EOF
7606     Defining $ac_tr_lib
7607 EOF
7608 cat >> confdefs.h <<EOF
7609 #define $ac_tr_lib 1
7610 EOF
7611 }
7612
7613   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7614
7615 else
7616   echo "$ac_t""no" 1>&6
7617 fi
7618
7619
7620
7621   echo "checking for Mule input methods" 1>&6
7622 echo "configure:7623: checking for Mule input methods" >&5
7623         case "$with_xim" in "" | "yes" )
7624     echo "checking for XIM" 1>&6
7625 echo "configure:7626: checking for XIM" >&5
7626     
7627 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
7628 echo "configure:7629: checking for XOpenIM in -lX11" >&5
7629 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
7630
7631 xe_check_libs=" -lX11 "
7632 cat > conftest.$ac_ext <<EOF
7633 #line 7634 "configure"
7634 #include "confdefs.h"
7635 /* Override any gcc2 internal prototype to avoid an error.  */
7636 /* We use char because int might match the return type of a gcc2
7637     builtin and then its argument prototype would still apply.  */
7638 char XOpenIM();
7639
7640 int main() {
7641 XOpenIM()
7642 ; return 0; }
7643 EOF
7644 if { (eval echo configure:7645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7645   rm -rf conftest*
7646   eval "ac_cv_lib_$ac_lib_var=yes"
7647 else
7648   echo "configure: failed program was:" >&5
7649   cat conftest.$ac_ext >&5
7650   rm -rf conftest*
7651   eval "ac_cv_lib_$ac_lib_var=no"
7652 fi
7653 rm -f conftest*
7654 xe_check_libs=""
7655
7656 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7657   echo "$ac_t""yes" 1>&6
7658   with_xim=xlib
7659 else
7660   echo "$ac_t""no" 1>&6
7661 with_xim=no
7662 fi
7663
7664
7665         if test "$have_motif $have_lesstif" = "yes no"; then
7666       
7667 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7668 echo "configure:7669: checking for XmImMbLookupString in -lXm" >&5
7669 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7670
7671 xe_check_libs=" -lXm "
7672 cat > conftest.$ac_ext <<EOF
7673 #line 7674 "configure"
7674 #include "confdefs.h"
7675 /* Override any gcc2 internal prototype to avoid an error.  */
7676 /* We use char because int might match the return type of a gcc2
7677     builtin and then its argument prototype would still apply.  */
7678 char XmImMbLookupString();
7679
7680 int main() {
7681 XmImMbLookupString()
7682 ; return 0; }
7683 EOF
7684 if { (eval echo configure:7685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7685   rm -rf conftest*
7686   eval "ac_cv_lib_$ac_lib_var=yes"
7687 else
7688   echo "configure: failed program was:" >&5
7689   cat conftest.$ac_ext >&5
7690   rm -rf conftest*
7691   eval "ac_cv_lib_$ac_lib_var=no"
7692 fi
7693 rm -f conftest*
7694 xe_check_libs=""
7695
7696 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7697   echo "$ac_t""yes" 1>&6
7698   with_xim=motif
7699 else
7700   echo "$ac_t""no" 1>&6
7701 fi
7702
7703
7704     fi ;;
7705   esac
7706   if test "$with_xim" != "no"; then
7707     { test "$extra_verbose" = "yes" && cat << \EOF
7708     Defining HAVE_XIM
7709 EOF
7710 cat >> confdefs.h <<\EOF
7711 #define HAVE_XIM 1
7712 EOF
7713 }
7714
7715     if test "$with_xim" = "xlib"; then
7716       { test "$extra_verbose" = "yes" && cat << \EOF
7717     Defining XIM_XLIB
7718 EOF
7719 cat >> confdefs.h <<\EOF
7720 #define XIM_XLIB 1
7721 EOF
7722 }
7723
7724       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7725    echo "    xemacs will be linked with \"input-method-xlib.o\""
7726  fi
7727     fi
7728     if test "$with_xim" = "motif"; then
7729       { test "$extra_verbose" = "yes" && cat << \EOF
7730     Defining XIM_MOTIF
7731 EOF
7732 cat >> confdefs.h <<\EOF
7733 #define XIM_MOTIF 1
7734 EOF
7735 }
7736
7737       need_motif=yes
7738       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7739    echo "    xemacs will be linked with \"input-method-motif.o\""
7740  fi
7741     fi
7742     if test "$with_xim" = "motif"; then
7743       with_xfs=no
7744     fi
7745   fi
7746
7747     if test "$with_xfs" = "yes" ; then
7748     echo "checking for XFontSet" 1>&6
7749 echo "configure:7750: checking for XFontSet" >&5
7750     
7751 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7752 echo "configure:7753: checking for XmbDrawString in -lX11" >&5
7753 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7754
7755 xe_check_libs=" -lX11 "
7756 cat > conftest.$ac_ext <<EOF
7757 #line 7758 "configure"
7758 #include "confdefs.h"
7759 /* Override any gcc2 internal prototype to avoid an error.  */
7760 /* We use char because int might match the return type of a gcc2
7761     builtin and then its argument prototype would still apply.  */
7762 char XmbDrawString();
7763
7764 int main() {
7765 XmbDrawString()
7766 ; return 0; }
7767 EOF
7768 if { (eval echo configure:7769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7769   rm -rf conftest*
7770   eval "ac_cv_lib_$ac_lib_var=yes"
7771 else
7772   echo "configure: failed program was:" >&5
7773   cat conftest.$ac_ext >&5
7774   rm -rf conftest*
7775   eval "ac_cv_lib_$ac_lib_var=no"
7776 fi
7777 rm -f conftest*
7778 xe_check_libs=""
7779
7780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7781   echo "$ac_t""yes" 1>&6
7782   :
7783 else
7784   echo "$ac_t""no" 1>&6
7785 with_xfs=no
7786 fi
7787
7788
7789     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7790       { test "$extra_verbose" = "yes" && cat << \EOF
7791     Defining USE_XFONTSET
7792 EOF
7793 cat >> confdefs.h <<\EOF
7794 #define USE_XFONTSET 1
7795 EOF
7796 }
7797
7798       if test "$with_xim" = "no" ; then
7799         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
7800    echo "    xemacs will be linked with \"input-method-xfs.o\""
7801  fi
7802       fi
7803     fi
7804   fi 
7805     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
7806   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
7807 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
7808 echo "configure:7809: checking for wnn/jllib.h" >&5
7809
7810 cat > conftest.$ac_ext <<EOF
7811 #line 7812 "configure"
7812 #include "confdefs.h"
7813 #include <wnn/jllib.h>
7814 EOF
7815 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7816 { (eval echo configure:7817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7817 ac_err=`grep -v '^ *+' conftest.out`
7818 if test -z "$ac_err"; then
7819   rm -rf conftest*
7820   eval "ac_cv_header_$ac_safe=yes"
7821 else
7822   echo "$ac_err" >&5
7823   echo "configure: failed program was:" >&5
7824   cat conftest.$ac_ext >&5
7825   rm -rf conftest*
7826   eval "ac_cv_header_$ac_safe=no"
7827 fi
7828 rm -f conftest*
7829 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7830   echo "$ac_t""yes" 1>&6
7831   :
7832 else
7833   echo "$ac_t""no" 1>&6
7834 with_wnn=no
7835 fi
7836  }
7837     if test "$with_wnn" != "no"; then
7838     for ac_func in crypt
7839 do
7840 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7841 echo "configure:7842: checking for $ac_func" >&5
7842
7843 cat > conftest.$ac_ext <<EOF
7844 #line 7845 "configure"
7845 #include "confdefs.h"
7846 /* System header to define __stub macros and hopefully few prototypes,
7847     which can conflict with char $ac_func(); below.  */
7848 #include <assert.h>
7849 /* Override any gcc2 internal prototype to avoid an error.  */
7850 /* We use char because int might match the return type of a gcc2
7851     builtin and then its argument prototype would still apply.  */
7852 char $ac_func();
7853
7854 int main() {
7855
7856 /* The GNU C library defines this for functions which it implements
7857     to always fail with ENOSYS.  Some functions are actually named
7858     something starting with __ and the normal name is an alias.  */
7859 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7860 choke me
7861 #else
7862 $ac_func();
7863 #endif
7864
7865 ; return 0; }
7866 EOF
7867 if { (eval echo configure:7868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7868   rm -rf conftest*
7869   eval "ac_cv_func_$ac_func=yes"
7870 else
7871   echo "configure: failed program was:" >&5
7872   cat conftest.$ac_ext >&5
7873   rm -rf conftest*
7874   eval "ac_cv_func_$ac_func=no"
7875 fi
7876 rm -f conftest*
7877
7878 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7879   echo "$ac_t""yes" 1>&6
7880     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7881   { test "$extra_verbose" = "yes" && cat << EOF
7882     Defining $ac_tr_func
7883 EOF
7884 cat >> confdefs.h <<EOF
7885 #define $ac_tr_func 1
7886 EOF
7887 }
7888  
7889 else
7890   echo "$ac_t""no" 1>&6
7891 fi
7892 done
7893
7894     test "$ac_cv_func_crypt" != "yes" && { 
7895 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7896 echo "configure:7897: checking for crypt in -lcrypt" >&5
7897 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7898
7899 xe_check_libs=" -lcrypt "
7900 cat > conftest.$ac_ext <<EOF
7901 #line 7902 "configure"
7902 #include "confdefs.h"
7903 /* Override any gcc2 internal prototype to avoid an error.  */
7904 /* We use char because int might match the return type of a gcc2
7905     builtin and then its argument prototype would still apply.  */
7906 char crypt();
7907
7908 int main() {
7909 crypt()
7910 ; return 0; }
7911 EOF
7912 if { (eval echo configure:7913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7913   rm -rf conftest*
7914   eval "ac_cv_lib_$ac_lib_var=yes"
7915 else
7916   echo "configure: failed program was:" >&5
7917   cat conftest.$ac_ext >&5
7918   rm -rf conftest*
7919   eval "ac_cv_lib_$ac_lib_var=no"
7920 fi
7921 rm -f conftest*
7922 xe_check_libs=""
7923
7924 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7925   echo "$ac_t""yes" 1>&6
7926     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7927     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7928   { test "$extra_verbose" = "yes" && cat << EOF
7929     Defining $ac_tr_lib
7930 EOF
7931 cat >> confdefs.h <<EOF
7932 #define $ac_tr_lib 1
7933 EOF
7934 }
7935
7936   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
7937
7938 else
7939   echo "$ac_t""no" 1>&6
7940 fi
7941
7942  }
7943   fi
7944     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
7945     
7946 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
7947 echo "configure:7948: checking for jl_dic_list_e in -lwnn" >&5
7948 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7949
7950 xe_check_libs=" -lwnn "
7951 cat > conftest.$ac_ext <<EOF
7952 #line 7953 "configure"
7953 #include "confdefs.h"
7954 /* Override any gcc2 internal prototype to avoid an error.  */
7955 /* We use char because int might match the return type of a gcc2
7956     builtin and then its argument prototype would still apply.  */
7957 char jl_dic_list_e();
7958
7959 int main() {
7960 jl_dic_list_e()
7961 ; return 0; }
7962 EOF
7963 if { (eval echo configure:7964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7964   rm -rf conftest*
7965   eval "ac_cv_lib_$ac_lib_var=yes"
7966 else
7967   echo "configure: failed program was:" >&5
7968   cat conftest.$ac_ext >&5
7969   rm -rf conftest*
7970   eval "ac_cv_lib_$ac_lib_var=no"
7971 fi
7972 rm -f conftest*
7973 xe_check_libs=""
7974
7975 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7976   echo "$ac_t""yes" 1>&6
7977   libwnn=wnn
7978 else
7979   echo "$ac_t""no" 1>&6
7980 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
7981 echo "configure:7982: checking for jl_dic_list_e in -lwnn4" >&5
7982 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
7983
7984 xe_check_libs=" -lwnn4 "
7985 cat > conftest.$ac_ext <<EOF
7986 #line 7987 "configure"
7987 #include "confdefs.h"
7988 /* Override any gcc2 internal prototype to avoid an error.  */
7989 /* We use char because int might match the return type of a gcc2
7990     builtin and then its argument prototype would still apply.  */
7991 char jl_dic_list_e();
7992
7993 int main() {
7994 jl_dic_list_e()
7995 ; return 0; }
7996 EOF
7997 if { (eval echo configure:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7998   rm -rf conftest*
7999   eval "ac_cv_lib_$ac_lib_var=yes"
8000 else
8001   echo "configure: failed program was:" >&5
8002   cat conftest.$ac_ext >&5
8003   rm -rf conftest*
8004   eval "ac_cv_lib_$ac_lib_var=no"
8005 fi
8006 rm -f conftest*
8007 xe_check_libs=""
8008
8009 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8010   echo "$ac_t""yes" 1>&6
8011   libwnn=wnn4
8012 else
8013   echo "$ac_t""no" 1>&6
8014 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8015 echo "configure:8016: checking for jl_dic_list_e in -lwnn6" >&5
8016 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8017
8018 xe_check_libs=" -lwnn6 "
8019 cat > conftest.$ac_ext <<EOF
8020 #line 8021 "configure"
8021 #include "confdefs.h"
8022 /* Override any gcc2 internal prototype to avoid an error.  */
8023 /* We use char because int might match the return type of a gcc2
8024     builtin and then its argument prototype would still apply.  */
8025 char jl_dic_list_e();
8026
8027 int main() {
8028 jl_dic_list_e()
8029 ; return 0; }
8030 EOF
8031 if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8032   rm -rf conftest*
8033   eval "ac_cv_lib_$ac_lib_var=yes"
8034 else
8035   echo "configure: failed program was:" >&5
8036   cat conftest.$ac_ext >&5
8037   rm -rf conftest*
8038   eval "ac_cv_lib_$ac_lib_var=no"
8039 fi
8040 rm -f conftest*
8041 xe_check_libs=""
8042
8043 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8044   echo "$ac_t""yes" 1>&6
8045   libwnn=wnn6
8046 else
8047   echo "$ac_t""no" 1>&6
8048 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8049 echo "configure:8050: checking for dic_list_e in -lwnn6_fromsrc" >&5
8050 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8051
8052 xe_check_libs=" -lwnn6_fromsrc "
8053 cat > conftest.$ac_ext <<EOF
8054 #line 8055 "configure"
8055 #include "confdefs.h"
8056 /* Override any gcc2 internal prototype to avoid an error.  */
8057 /* We use char because int might match the return type of a gcc2
8058     builtin and then its argument prototype would still apply.  */
8059 char dic_list_e();
8060
8061 int main() {
8062 dic_list_e()
8063 ; return 0; }
8064 EOF
8065 if { (eval echo configure:8066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8066   rm -rf conftest*
8067   eval "ac_cv_lib_$ac_lib_var=yes"
8068 else
8069   echo "configure: failed program was:" >&5
8070   cat conftest.$ac_ext >&5
8071   rm -rf conftest*
8072   eval "ac_cv_lib_$ac_lib_var=no"
8073 fi
8074 rm -f conftest*
8075 xe_check_libs=""
8076
8077 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8078   echo "$ac_t""yes" 1>&6
8079   libwnn=wnn6_fromsrc
8080 else
8081   echo "$ac_t""no" 1>&6
8082 with_wnn=no
8083 fi
8084
8085
8086 fi
8087
8088
8089 fi
8090
8091
8092 fi
8093
8094
8095   fi
8096   test -z "$with_wnn" && with_wnn=yes
8097   if test "$with_wnn" = "yes"; then
8098     { test "$extra_verbose" = "yes" && cat << \EOF
8099     Defining HAVE_WNN
8100 EOF
8101 cat >> confdefs.h <<\EOF
8102 #define HAVE_WNN 1
8103 EOF
8104 }
8105
8106     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8107     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8108    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8109  fi
8110     if test "$with_wnn6" != "no"; then
8111       
8112 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8113 echo "configure:8114: checking for jl_fi_dic_list in -l$libwnn" >&5
8114 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8115
8116 xe_check_libs=" -l$libwnn "
8117 cat > conftest.$ac_ext <<EOF
8118 #line 8119 "configure"
8119 #include "confdefs.h"
8120 /* Override any gcc2 internal prototype to avoid an error.  */
8121 /* We use char because int might match the return type of a gcc2
8122     builtin and then its argument prototype would still apply.  */
8123 char jl_fi_dic_list();
8124
8125 int main() {
8126 jl_fi_dic_list()
8127 ; return 0; }
8128 EOF
8129 if { (eval echo configure:8130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8130   rm -rf conftest*
8131   eval "ac_cv_lib_$ac_lib_var=yes"
8132 else
8133   echo "configure: failed program was:" >&5
8134   cat conftest.$ac_ext >&5
8135   rm -rf conftest*
8136   eval "ac_cv_lib_$ac_lib_var=no"
8137 fi
8138 rm -f conftest*
8139 xe_check_libs=""
8140
8141 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8142   echo "$ac_t""yes" 1>&6
8143   with_wnn6=yes
8144 else
8145   echo "$ac_t""no" 1>&6
8146 fi
8147
8148
8149       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8150     Defining WNN6
8151 EOF
8152 cat >> confdefs.h <<\EOF
8153 #define WNN6 1
8154 EOF
8155 }
8156
8157     fi
8158   fi
8159
8160     canna_includes_found=no
8161   if test "$with_canna" != "no"; then
8162     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8163 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8164 echo "configure:8165: checking for canna/jrkanji.h" >&5
8165
8166 cat > conftest.$ac_ext <<EOF
8167 #line 8168 "configure"
8168 #include "confdefs.h"
8169 #include <canna/jrkanji.h>
8170 EOF
8171 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8172 { (eval echo configure:8173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8173 ac_err=`grep -v '^ *+' conftest.out`
8174 if test -z "$ac_err"; then
8175   rm -rf conftest*
8176   eval "ac_cv_header_$ac_safe=yes"
8177 else
8178   echo "$ac_err" >&5
8179   echo "configure: failed program was:" >&5
8180   cat conftest.$ac_ext >&5
8181   rm -rf conftest*
8182   eval "ac_cv_header_$ac_safe=no"
8183 fi
8184 rm -f conftest*
8185 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8186   echo "$ac_t""yes" 1>&6
8187   canna_includes_found=yes
8188 else
8189   echo "$ac_t""no" 1>&6
8190 fi
8191
8192   fi
8193   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8194       -d "/usr/local/canna/include"; then
8195     save_c_switch_site="$c_switch_site"
8196     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8197     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8198 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8199 echo "configure:8200: checking for canna/jrkanji.h" >&5
8200
8201 cat > conftest.$ac_ext <<EOF
8202 #line 8203 "configure"
8203 #include "confdefs.h"
8204 #include <canna/jrkanji.h>
8205 EOF
8206 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8207 { (eval echo configure:8208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8208 ac_err=`grep -v '^ *+' conftest.out`
8209 if test -z "$ac_err"; then
8210   rm -rf conftest*
8211   eval "ac_cv_header_$ac_safe=yes"
8212 else
8213   echo "$ac_err" >&5
8214   echo "configure: failed program was:" >&5
8215   cat conftest.$ac_ext >&5
8216   rm -rf conftest*
8217   eval "ac_cv_header_$ac_safe=no"
8218 fi
8219 rm -f conftest*
8220 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8221   echo "$ac_t""yes" 1>&6
8222   canna_includes_found=yes
8223 else
8224   echo "$ac_t""no" 1>&6
8225 fi
8226
8227     if test "$canna_includes_found" != "yes"; then
8228       c_switch_site="$save_c_switch_site"
8229       with_canna="no"
8230     fi
8231   fi
8232
8233   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8234 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8235 echo "configure:8236: checking for canna/RK.h" >&5
8236
8237 cat > conftest.$ac_ext <<EOF
8238 #line 8239 "configure"
8239 #include "confdefs.h"
8240 #include <canna/RK.h>
8241 EOF
8242 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8243 { (eval echo configure:8244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8244 ac_err=`grep -v '^ *+' conftest.out`
8245 if test -z "$ac_err"; then
8246   rm -rf conftest*
8247   eval "ac_cv_header_$ac_safe=yes"
8248 else
8249   echo "$ac_err" >&5
8250   echo "configure: failed program was:" >&5
8251   cat conftest.$ac_ext >&5
8252   rm -rf conftest*
8253   eval "ac_cv_header_$ac_safe=no"
8254 fi
8255 rm -f conftest*
8256 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8257   echo "$ac_t""yes" 1>&6
8258   :
8259 else
8260   echo "$ac_t""no" 1>&6
8261 with_canna=no
8262 fi
8263  }
8264   test -z "$with_canna" && { 
8265 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8266 echo "configure:8267: checking for RkBgnBun in -lRKC" >&5
8267 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8268
8269 xe_check_libs=" -lRKC "
8270 cat > conftest.$ac_ext <<EOF
8271 #line 8272 "configure"
8272 #include "confdefs.h"
8273 /* Override any gcc2 internal prototype to avoid an error.  */
8274 /* We use char because int might match the return type of a gcc2
8275     builtin and then its argument prototype would still apply.  */
8276 char RkBgnBun();
8277
8278 int main() {
8279 RkBgnBun()
8280 ; return 0; }
8281 EOF
8282 if { (eval echo configure:8283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8283   rm -rf conftest*
8284   eval "ac_cv_lib_$ac_lib_var=yes"
8285 else
8286   echo "configure: failed program was:" >&5
8287   cat conftest.$ac_ext >&5
8288   rm -rf conftest*
8289   eval "ac_cv_lib_$ac_lib_var=no"
8290 fi
8291 rm -f conftest*
8292 xe_check_libs=""
8293
8294 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8295   echo "$ac_t""yes" 1>&6
8296   :
8297 else
8298   echo "$ac_t""no" 1>&6
8299 with_canna=no
8300 fi
8301
8302  }
8303   test -z "$with_canna" && { 
8304 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8305 echo "configure:8306: checking for jrKanjiControl in -lcanna" >&5
8306 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8307
8308 xe_check_libs=" -lcanna "
8309 cat > conftest.$ac_ext <<EOF
8310 #line 8311 "configure"
8311 #include "confdefs.h"
8312 /* Override any gcc2 internal prototype to avoid an error.  */
8313 /* We use char because int might match the return type of a gcc2
8314     builtin and then its argument prototype would still apply.  */
8315 char jrKanjiControl();
8316
8317 int main() {
8318 jrKanjiControl()
8319 ; return 0; }
8320 EOF
8321 if { (eval echo configure:8322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8322   rm -rf conftest*
8323   eval "ac_cv_lib_$ac_lib_var=yes"
8324 else
8325   echo "configure: failed program was:" >&5
8326   cat conftest.$ac_ext >&5
8327   rm -rf conftest*
8328   eval "ac_cv_lib_$ac_lib_var=no"
8329 fi
8330 rm -f conftest*
8331 xe_check_libs=""
8332
8333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8334   echo "$ac_t""yes" 1>&6
8335   :
8336 else
8337   echo "$ac_t""no" 1>&6
8338 with_canna=no
8339 fi
8340
8341  }
8342   test -z "$with_canna" && with_canna=yes
8343   if test "$with_canna" = "yes"; then
8344     { test "$extra_verbose" = "yes" && cat << \EOF
8345     Defining HAVE_CANNA
8346 EOF
8347 cat >> confdefs.h <<\EOF
8348 #define HAVE_CANNA 1
8349 EOF
8350 }
8351
8352     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8353     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8354    echo "    xemacs will be linked with \"mule-canna.o\""
8355  fi
8356   fi
8357
8358 else   for feature in xim canna wnn; do
8359     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8360       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8361     fi
8362     eval "with_${feature}=no"
8363   done
8364 fi 
8365
8366 if test "$need_motif" = "yes" ; then
8367   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8368     
8369 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8370 echo "configure:8371: checking for layout_object_getvalue in -li18n" >&5
8371 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8372
8373 xe_check_libs=" -li18n "
8374 cat > conftest.$ac_ext <<EOF
8375 #line 8376 "configure"
8376 #include "confdefs.h"
8377 /* Override any gcc2 internal prototype to avoid an error.  */
8378 /* We use char because int might match the return type of a gcc2
8379     builtin and then its argument prototype would still apply.  */
8380 char layout_object_getvalue();
8381
8382 int main() {
8383 layout_object_getvalue()
8384 ; return 0; }
8385 EOF
8386 if { (eval echo configure:8387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8387   rm -rf conftest*
8388   eval "ac_cv_lib_$ac_lib_var=yes"
8389 else
8390   echo "configure: failed program was:" >&5
8391   cat conftest.$ac_ext >&5
8392   rm -rf conftest*
8393   eval "ac_cv_lib_$ac_lib_var=no"
8394 fi
8395 rm -f conftest*
8396 xe_check_libs=""
8397
8398 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8399   echo "$ac_t""yes" 1>&6
8400   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8401 else
8402   echo "$ac_t""no" 1>&6
8403 fi
8404
8405
8406   
8407 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8408     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8409   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8410   
8411         runpath="" runpath_dirs=""
8412   if test -n "$LD_RUN_PATH"; then
8413     runpath="$LD_RUN_PATH"
8414   elif test "$GCC" = "yes"; then
8415         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8416     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8417     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8418     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8419       case "$arg" in P,* | -L* | -R* )
8420         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8421           {
8422 xe_runpath_dir="$dir"
8423   test "$xe_runpath_dir" != "/lib"     -a \
8424         "$xe_runpath_dir" != "/usr/lib" -a \
8425         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8426   eval "$xe_add_unique_runpath_dir"
8427 }
8428         done ;;
8429       esac
8430     done
8431     ld_switch_run="$ld_switch_run_save"
8432     rm -f conftest*
8433   else
8434         for arg in $ld_switch_site $ld_switch_x_site; do
8435       case "$arg" in -L*) {
8436 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8437   test "$xe_runpath_dir" != "/lib"     -a \
8438         "$xe_runpath_dir" != "/usr/lib" -a \
8439         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8440   eval "$xe_add_unique_runpath_dir"
8441 };; esac
8442     done
8443         if test "$opsys $need_motif" = "sol2 yes"; then
8444       xe_runpath_dir="/opt/SUNWdt/lib";
8445       eval "$xe_add_unique_runpath_dir";
8446     fi
8447   fi 
8448   if test -n "$runpath"; then
8449     ld_switch_run="${dash_r}${runpath}"
8450     
8451 if test "$GCC" = "yes"; then
8452   set x $ld_switch_run; shift; ld_switch_run=""
8453   while test -n "$1"; do
8454     case $1 in
8455       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8456       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8457       -Xlinker* ) ;;
8458       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8459     esac
8460     shift
8461   done
8462 fi
8463     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8464   fi
8465 fi
8466
8467 fi
8468
8469 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
8470 do
8471 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8472 echo "configure:8473: checking for $ac_func" >&5
8473
8474 cat > conftest.$ac_ext <<EOF
8475 #line 8476 "configure"
8476 #include "confdefs.h"
8477 /* System header to define __stub macros and hopefully few prototypes,
8478     which can conflict with char $ac_func(); below.  */
8479 #include <assert.h>
8480 /* Override any gcc2 internal prototype to avoid an error.  */
8481 /* We use char because int might match the return type of a gcc2
8482     builtin and then its argument prototype would still apply.  */
8483 char $ac_func();
8484
8485 int main() {
8486
8487 /* The GNU C library defines this for functions which it implements
8488     to always fail with ENOSYS.  Some functions are actually named
8489     something starting with __ and the normal name is an alias.  */
8490 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8491 choke me
8492 #else
8493 $ac_func();
8494 #endif
8495
8496 ; return 0; }
8497 EOF
8498 if { (eval echo configure:8499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8499   rm -rf conftest*
8500   eval "ac_cv_func_$ac_func=yes"
8501 else
8502   echo "configure: failed program was:" >&5
8503   cat conftest.$ac_ext >&5
8504   rm -rf conftest*
8505   eval "ac_cv_func_$ac_func=no"
8506 fi
8507 rm -f conftest*
8508
8509 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8510   echo "$ac_t""yes" 1>&6
8511     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8512   { test "$extra_verbose" = "yes" && cat << EOF
8513     Defining $ac_tr_func
8514 EOF
8515 cat >> confdefs.h <<EOF
8516 #define $ac_tr_func 1
8517 EOF
8518 }
8519  
8520 else
8521   echo "$ac_t""no" 1>&6
8522 fi
8523 done
8524
8525
8526
8527 case "$opsys" in
8528   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8529    echo "    xemacs will be linked with \"realpath.o\""
8530  fi ;;
8531   * )
8532     case "$canonical" in
8533       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8534    echo "    xemacs will be linked with \"realpath.o\""
8535  fi ;;
8536       * ) for ac_func in realpath
8537 do
8538 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8539 echo "configure:8540: checking for $ac_func" >&5
8540
8541 cat > conftest.$ac_ext <<EOF
8542 #line 8543 "configure"
8543 #include "confdefs.h"
8544 /* System header to define __stub macros and hopefully few prototypes,
8545     which can conflict with char $ac_func(); below.  */
8546 #include <assert.h>
8547 /* Override any gcc2 internal prototype to avoid an error.  */
8548 /* We use char because int might match the return type of a gcc2
8549     builtin and then its argument prototype would still apply.  */
8550 char $ac_func();
8551
8552 int main() {
8553
8554 /* The GNU C library defines this for functions which it implements
8555     to always fail with ENOSYS.  Some functions are actually named
8556     something starting with __ and the normal name is an alias.  */
8557 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8558 choke me
8559 #else
8560 $ac_func();
8561 #endif
8562
8563 ; return 0; }
8564 EOF
8565 if { (eval echo configure:8566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8566   rm -rf conftest*
8567   eval "ac_cv_func_$ac_func=yes"
8568 else
8569   echo "configure: failed program was:" >&5
8570   cat conftest.$ac_ext >&5
8571   rm -rf conftest*
8572   eval "ac_cv_func_$ac_func=no"
8573 fi
8574 rm -f conftest*
8575
8576 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8577   echo "$ac_t""yes" 1>&6
8578     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8579   { test "$extra_verbose" = "yes" && cat << EOF
8580     Defining $ac_tr_func
8581 EOF
8582 cat >> confdefs.h <<EOF
8583 #define $ac_tr_func 1
8584 EOF
8585 }
8586  
8587 else
8588   echo "$ac_t""no" 1>&6
8589 fi
8590 done
8591
8592           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8593    echo "    xemacs will be linked with \"realpath.o\""
8594  fi ;;
8595     esac ;;
8596 esac
8597
8598 for ac_func in getloadavg
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
8655 if test "$ac_cv_func_getloadavg" != "yes"
8656 then
8657   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
8658    echo "    xemacs will be linked with \"getloadavg.o\""
8659  fi
8660
8661     
8662 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
8663 echo "configure:8664: checking for kstat_open in -lkstat" >&5
8664 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
8665
8666 xe_check_libs=" -lkstat "
8667 cat > conftest.$ac_ext <<EOF
8668 #line 8669 "configure"
8669 #include "confdefs.h"
8670 /* Override any gcc2 internal prototype to avoid an error.  */
8671 /* We use char because int might match the return type of a gcc2
8672     builtin and then its argument prototype would still apply.  */
8673 char kstat_open();
8674
8675 int main() {
8676 kstat_open()
8677 ; return 0; }
8678 EOF
8679 if { (eval echo configure:8680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8680   rm -rf conftest*
8681   eval "ac_cv_lib_$ac_lib_var=yes"
8682 else
8683   echo "configure: failed program was:" >&5
8684   cat conftest.$ac_ext >&5
8685   rm -rf conftest*
8686   eval "ac_cv_lib_$ac_lib_var=no"
8687 fi
8688 rm -f conftest*
8689 xe_check_libs=""
8690
8691 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8692   echo "$ac_t""yes" 1>&6
8693     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8694     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8695   { test "$extra_verbose" = "yes" && cat << EOF
8696     Defining $ac_tr_lib
8697 EOF
8698 cat >> confdefs.h <<EOF
8699 #define $ac_tr_lib 1
8700 EOF
8701 }
8702
8703   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
8704
8705 else
8706   echo "$ac_t""no" 1>&6
8707 fi
8708
8709
8710
8711     
8712 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
8713 echo "configure:8714: checking for kvm_read in -lkvm" >&5
8714 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
8715
8716 xe_check_libs=" -lkvm "
8717 cat > conftest.$ac_ext <<EOF
8718 #line 8719 "configure"
8719 #include "confdefs.h"
8720 /* Override any gcc2 internal prototype to avoid an error.  */
8721 /* We use char because int might match the return type of a gcc2
8722     builtin and then its argument prototype would still apply.  */
8723 char kvm_read();
8724
8725 int main() {
8726 kvm_read()
8727 ; return 0; }
8728 EOF
8729 if { (eval echo configure:8730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8730   rm -rf conftest*
8731   eval "ac_cv_lib_$ac_lib_var=yes"
8732 else
8733   echo "configure: failed program was:" >&5
8734   cat conftest.$ac_ext >&5
8735   rm -rf conftest*
8736   eval "ac_cv_lib_$ac_lib_var=no"
8737 fi
8738 rm -f conftest*
8739 xe_check_libs=""
8740
8741 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8742   echo "$ac_t""yes" 1>&6
8743     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8744     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8745   { test "$extra_verbose" = "yes" && cat << EOF
8746     Defining $ac_tr_lib
8747 EOF
8748 cat >> confdefs.h <<EOF
8749 #define $ac_tr_lib 1
8750 EOF
8751 }
8752
8753   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
8754
8755 else
8756   echo "$ac_t""no" 1>&6
8757 fi
8758
8759
8760 fi
8761
8762 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8763 echo "configure:8764: checking whether netdb declares h_errno" >&5
8764 cat > conftest.$ac_ext <<EOF
8765 #line 8766 "configure"
8766 #include "confdefs.h"
8767 #include <netdb.h>
8768 int main() {
8769 return h_errno;
8770 ; return 0; }
8771 EOF
8772 if { (eval echo configure:8773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8773   rm -rf conftest*
8774   echo "$ac_t""yes" 1>&6
8775    { test "$extra_verbose" = "yes" && cat << \EOF
8776     Defining HAVE_H_ERRNO
8777 EOF
8778 cat >> confdefs.h <<\EOF
8779 #define HAVE_H_ERRNO 1
8780 EOF
8781 }
8782
8783 else
8784   echo "configure: failed program was:" >&5
8785   cat conftest.$ac_ext >&5
8786   rm -rf conftest*
8787   echo "$ac_t""no" 1>&6
8788 fi
8789 rm -f conftest*
8790
8791 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8792 echo "configure:8793: checking for sigsetjmp" >&5
8793 cat > conftest.$ac_ext <<EOF
8794 #line 8795 "configure"
8795 #include "confdefs.h"
8796 #include <setjmp.h>
8797 int main() {
8798 sigjmp_buf bar; sigsetjmp (bar, 0);
8799 ; return 0; }
8800 EOF
8801 if { (eval echo configure:8802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8802   rm -rf conftest*
8803   echo "$ac_t""yes" 1>&6
8804    { test "$extra_verbose" = "yes" && cat << \EOF
8805     Defining HAVE_SIGSETJMP
8806 EOF
8807 cat >> confdefs.h <<\EOF
8808 #define HAVE_SIGSETJMP 1
8809 EOF
8810 }
8811
8812 else
8813   echo "configure: failed program was:" >&5
8814   cat conftest.$ac_ext >&5
8815   rm -rf conftest*
8816   echo "$ac_t""no" 1>&6
8817 fi
8818 rm -f conftest*
8819
8820 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
8821 echo "configure:8822: checking whether localtime caches TZ" >&5
8822
8823 if test "$ac_cv_func_tzset" = "yes"; then
8824 cat > conftest.$ac_ext <<EOF
8825 #line 8826 "configure"
8826 #include "confdefs.h"
8827 #include <time.h>
8828 #if STDC_HEADERS
8829 # include <stdlib.h>
8830 #endif
8831 extern char **environ;
8832 unset_TZ ()
8833 {
8834   char **from, **to;
8835   for (to = from = environ; (*to = *from); from++)
8836     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
8837       to++;
8838 }
8839 char TZ_GMT0[] = "TZ=GMT0";
8840 char TZ_PST8[] = "TZ=PST8";
8841 main()
8842 {
8843   time_t now = time ((time_t *) 0);
8844   int hour_GMT0, hour_unset;
8845   if (putenv (TZ_GMT0) != 0)
8846     exit (1);
8847   hour_GMT0 = localtime (&now)->tm_hour;
8848   unset_TZ ();
8849   hour_unset = localtime (&now)->tm_hour;
8850   if (putenv (TZ_PST8) != 0)
8851     exit (1);
8852   if (localtime (&now)->tm_hour == hour_GMT0)
8853     exit (1);
8854   unset_TZ ();
8855   if (localtime (&now)->tm_hour != hour_unset)
8856     exit (1);
8857   exit (0);
8858 }
8859 EOF
8860 if { (eval echo configure:8861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8861 then
8862   emacs_cv_localtime_cache=no
8863 else
8864   conftest_rc="$?"
8865   echo "configure: failed program was:" >&5
8866   cat conftest.$ac_ext >&5
8867   rm -fr conftest*
8868   emacs_cv_localtime_cache=yes
8869 fi
8870 rm -fr conftest*
8871 else
8872         # If we lack tzset, report that localtime does not cache TZ,
8873         # since we can't invalidate the cache if we don't have tzset.
8874         emacs_cv_localtime_cache=no
8875 fi
8876 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
8877 if test $emacs_cv_localtime_cache = yes; then
8878   { test "$extra_verbose" = "yes" && cat << \EOF
8879     Defining LOCALTIME_CACHE
8880 EOF
8881 cat >> confdefs.h <<\EOF
8882 #define LOCALTIME_CACHE 1
8883 EOF
8884 }
8885
8886 fi
8887
8888 if test "$HAVE_TIMEVAL" = "yes"; then
8889 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
8890 echo "configure:8891: checking whether gettimeofday accepts one or two arguments" >&5
8891 cat > conftest.$ac_ext <<EOF
8892 #line 8893 "configure"
8893 #include "confdefs.h"
8894
8895 #ifdef TIME_WITH_SYS_TIME
8896 #include <sys/time.h>
8897 #include <time.h>
8898 #else
8899 #ifdef HAVE_SYS_TIME_H
8900 #include <sys/time.h>
8901 #else
8902 #include <time.h>
8903 #endif
8904 #endif
8905   
8906 int main() {
8907
8908   struct timeval time;
8909   struct timezone dummy;
8910   gettimeofday (&time, &dummy);
8911
8912 ; return 0; }
8913 EOF
8914 if { (eval echo configure:8915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8915   rm -rf conftest*
8916   echo "$ac_t""two" 1>&6
8917 else
8918   echo "configure: failed program was:" >&5
8919   cat conftest.$ac_ext >&5
8920   rm -rf conftest*
8921   echo "$ac_t""one" 1>&6
8922    { test "$extra_verbose" = "yes" && cat << \EOF
8923     Defining GETTIMEOFDAY_ONE_ARGUMENT
8924 EOF
8925 cat >> confdefs.h <<\EOF
8926 #define GETTIMEOFDAY_ONE_ARGUMENT 1
8927 EOF
8928 }
8929
8930 fi
8931 rm -f conftest*
8932 fi
8933
8934
8935 echo $ac_n "checking for inline""... $ac_c" 1>&6
8936 echo "configure:8937: checking for inline" >&5
8937
8938 ac_cv_c_inline=no
8939 for ac_kw in inline __inline__ __inline; do
8940   cat > conftest.$ac_ext <<EOF
8941 #line 8942 "configure"
8942 #include "confdefs.h"
8943
8944 int main() {
8945 } $ac_kw foo() {
8946 ; return 0; }
8947 EOF
8948 if { (eval echo configure:8949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8949   rm -rf conftest*
8950   ac_cv_c_inline=$ac_kw; break
8951 else
8952   echo "configure: failed program was:" >&5
8953   cat conftest.$ac_ext >&5
8954 fi
8955 rm -f conftest*
8956 done
8957
8958
8959 echo "$ac_t""$ac_cv_c_inline" 1>&6
8960 case "$ac_cv_c_inline" in
8961   inline | yes) ;;
8962   no) { test "$extra_verbose" = "yes" && cat << \EOF
8963     Defining inline = 
8964 EOF
8965 cat >> confdefs.h <<\EOF
8966 #define inline 
8967 EOF
8968 }
8969  ;;
8970   *)  { test "$extra_verbose" = "yes" && cat << EOF
8971     Defining inline = $ac_cv_c_inline
8972 EOF
8973 cat >> confdefs.h <<EOF
8974 #define inline $ac_cv_c_inline
8975 EOF
8976 }
8977  ;;
8978 esac
8979
8980 if test "$ac_cv_c_inline" != "no"; then
8981   { test "$extra_verbose" = "yes" && cat << \EOF
8982     Defining HAVE_INLINE
8983 EOF
8984 cat >> confdefs.h <<\EOF
8985 #define HAVE_INLINE 1
8986 EOF
8987 }
8988
8989   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
8990    echo "    xemacs will be linked with \"inline.o\""
8991  fi
8992 fi
8993
8994
8995 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
8996 # for constant arguments.  Useless!
8997 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
8998 echo "configure:8999: checking for working alloca.h" >&5
8999
9000 cat > conftest.$ac_ext <<EOF
9001 #line 9002 "configure"
9002 #include "confdefs.h"
9003 #include <alloca.h>
9004 int main() {
9005 char *p = alloca(2 * sizeof(int));
9006 ; return 0; }
9007 EOF
9008 if { (eval echo configure:9009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9009   rm -rf conftest*
9010   ac_cv_header_alloca_h=yes
9011 else
9012   echo "configure: failed program was:" >&5
9013   cat conftest.$ac_ext >&5
9014   rm -rf conftest*
9015   ac_cv_header_alloca_h=no
9016 fi
9017 rm -f conftest*
9018
9019 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9020 if test $ac_cv_header_alloca_h = yes; then
9021   { test "$extra_verbose" = "yes" && cat << \EOF
9022     Defining HAVE_ALLOCA_H
9023 EOF
9024 cat >> confdefs.h <<\EOF
9025 #define HAVE_ALLOCA_H 1
9026 EOF
9027 }
9028
9029 fi
9030
9031 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9032 echo "configure:9033: checking for alloca" >&5
9033
9034 cat > conftest.$ac_ext <<EOF
9035 #line 9036 "configure"
9036 #include "confdefs.h"
9037
9038 #ifdef __GNUC__
9039 # define alloca __builtin_alloca
9040 #else
9041 # if HAVE_ALLOCA_H
9042 #  include <alloca.h>
9043 # else
9044 #  ifdef _AIX
9045  #pragma alloca
9046 #  else
9047 #   ifndef alloca /* predefined by HP cc +Olibcalls */
9048 char *alloca ();
9049 #   endif
9050 #  endif
9051 # endif
9052 #endif
9053
9054 int main() {
9055 char *p = (char *) alloca(1);
9056 ; return 0; }
9057 EOF
9058 if { (eval echo configure:9059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9059   rm -rf conftest*
9060   ac_cv_func_alloca_works=yes
9061 else
9062   echo "configure: failed program was:" >&5
9063   cat conftest.$ac_ext >&5
9064   rm -rf conftest*
9065   ac_cv_func_alloca_works=no
9066 fi
9067 rm -f conftest*
9068
9069 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9070 if test $ac_cv_func_alloca_works = yes; then
9071   { test "$extra_verbose" = "yes" && cat << \EOF
9072     Defining HAVE_ALLOCA
9073 EOF
9074 cat >> confdefs.h <<\EOF
9075 #define HAVE_ALLOCA 1
9076 EOF
9077 }
9078
9079 fi
9080
9081 if test $ac_cv_func_alloca_works = no; then
9082   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9083   # that cause trouble.  Some versions do not even contain alloca or
9084   # contain a buggy version.  If you still want to use their alloca,
9085   # use ar to extract alloca.o from them instead of compiling alloca.c.
9086   ALLOCA=alloca.o
9087   { test "$extra_verbose" = "yes" && cat << \EOF
9088     Defining C_ALLOCA
9089 EOF
9090 cat >> confdefs.h <<\EOF
9091 #define C_ALLOCA 1
9092 EOF
9093 }
9094
9095
9096 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9097 echo "configure:9098: checking whether alloca needs Cray hooks" >&5
9098
9099 cat > conftest.$ac_ext <<EOF
9100 #line 9101 "configure"
9101 #include "confdefs.h"
9102 #if defined(CRAY) && ! defined(CRAY2)
9103 webecray
9104 #else
9105 wenotbecray
9106 #endif
9107
9108 EOF
9109 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9110   egrep "webecray" >/dev/null 2>&1; then
9111   rm -rf conftest*
9112   ac_cv_os_cray=yes
9113 else
9114   rm -rf conftest*
9115   ac_cv_os_cray=no
9116 fi
9117 rm -f conftest*
9118
9119
9120 echo "$ac_t""$ac_cv_os_cray" 1>&6
9121 if test $ac_cv_os_cray = yes; then
9122 for ac_func in _getb67 GETB67 getb67; do
9123   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9124 echo "configure:9125: checking for $ac_func" >&5
9125
9126 cat > conftest.$ac_ext <<EOF
9127 #line 9128 "configure"
9128 #include "confdefs.h"
9129 /* System header to define __stub macros and hopefully few prototypes,
9130     which can conflict with char $ac_func(); below.  */
9131 #include <assert.h>
9132 /* Override any gcc2 internal prototype to avoid an error.  */
9133 /* We use char because int might match the return type of a gcc2
9134     builtin and then its argument prototype would still apply.  */
9135 char $ac_func();
9136
9137 int main() {
9138
9139 /* The GNU C library defines this for functions which it implements
9140     to always fail with ENOSYS.  Some functions are actually named
9141     something starting with __ and the normal name is an alias.  */
9142 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9143 choke me
9144 #else
9145 $ac_func();
9146 #endif
9147
9148 ; return 0; }
9149 EOF
9150 if { (eval echo configure:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9151   rm -rf conftest*
9152   eval "ac_cv_func_$ac_func=yes"
9153 else
9154   echo "configure: failed program was:" >&5
9155   cat conftest.$ac_ext >&5
9156   rm -rf conftest*
9157   eval "ac_cv_func_$ac_func=no"
9158 fi
9159 rm -f conftest*
9160
9161 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9162   echo "$ac_t""yes" 1>&6
9163   { test "$extra_verbose" = "yes" && cat << EOF
9164     Defining CRAY_STACKSEG_END = $ac_func
9165 EOF
9166 cat >> confdefs.h <<EOF
9167 #define CRAY_STACKSEG_END $ac_func
9168 EOF
9169 }
9170
9171   break
9172 else
9173   echo "$ac_t""no" 1>&6
9174 fi
9175
9176 done
9177 fi
9178
9179 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9180 echo "configure:9181: checking stack direction for C alloca" >&5
9181
9182 cat > conftest.$ac_ext <<EOF
9183 #line 9184 "configure"
9184 #include "confdefs.h"
9185 find_stack_direction ()
9186 {
9187   static char *addr = 0;
9188   auto char dummy;
9189   if (addr == 0)
9190     {
9191       addr = &dummy;
9192       return find_stack_direction ();
9193     }
9194   else
9195     return (&dummy > addr) ? 1 : -1;
9196 }
9197 main ()
9198 {
9199   exit (find_stack_direction() < 0);
9200 }
9201 EOF
9202 if { (eval echo configure:9203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9203 then
9204   ac_cv_c_stack_direction=1
9205 else
9206   conftest_rc="$?"
9207   echo "configure: failed program was:" >&5
9208   cat conftest.$ac_ext >&5
9209   rm -fr conftest*
9210   ac_cv_c_stack_direction=-1
9211 fi
9212 rm -fr conftest*
9213
9214 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9215 { test "$extra_verbose" = "yes" && cat << EOF
9216     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9217 EOF
9218 cat >> confdefs.h <<EOF
9219 #define STACK_DIRECTION $ac_cv_c_stack_direction
9220 EOF
9221 }
9222
9223 fi
9224
9225 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9226    echo "    xemacs will be linked with \"$ALLOCA\""
9227  fi
9228
9229 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9230 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9231 echo "configure:9232: checking for vfork.h" >&5
9232
9233 cat > conftest.$ac_ext <<EOF
9234 #line 9235 "configure"
9235 #include "confdefs.h"
9236 #include <vfork.h>
9237 EOF
9238 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9239 { (eval echo configure:9240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9240 ac_err=`grep -v '^ *+' conftest.out`
9241 if test -z "$ac_err"; then
9242   rm -rf conftest*
9243   eval "ac_cv_header_$ac_safe=yes"
9244 else
9245   echo "$ac_err" >&5
9246   echo "configure: failed program was:" >&5
9247   cat conftest.$ac_ext >&5
9248   rm -rf conftest*
9249   eval "ac_cv_header_$ac_safe=no"
9250 fi
9251 rm -f conftest*
9252 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9253   echo "$ac_t""yes" 1>&6
9254   { test "$extra_verbose" = "yes" && cat << \EOF
9255     Defining HAVE_VFORK_H
9256 EOF
9257 cat >> confdefs.h <<\EOF
9258 #define HAVE_VFORK_H 1
9259 EOF
9260 }
9261
9262 else
9263   echo "$ac_t""no" 1>&6
9264 fi
9265
9266 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9267 echo "configure:9268: checking for working vfork" >&5
9268
9269 cat > conftest.$ac_ext <<EOF
9270 #line 9271 "configure"
9271 #include "confdefs.h"
9272 /* Thanks to Paul Eggert for this test.  */
9273 #include <stdio.h>
9274 #include <sys/types.h>
9275 #include <sys/stat.h>
9276 #ifdef HAVE_UNISTD_H
9277 #include <unistd.h>
9278 #endif
9279 #ifdef HAVE_VFORK_H
9280 #include <vfork.h>
9281 #endif
9282 /* On some sparc systems, changes by the child to local and incoming
9283    argument registers are propagated back to the parent.
9284    The compiler is told about this with #include <vfork.h>,
9285    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9286    Test for this by using a static variable whose address
9287    is put into a register that is clobbered by the vfork.  */
9288 static
9289 #ifdef __cplusplus
9290 sparc_address_test (int arg)
9291 #else
9292 sparc_address_test (arg) int arg;
9293 #endif
9294 {
9295   static pid_t child;
9296   if (!child) {
9297     child = vfork ();
9298     if (child < 0) {
9299       perror ("vfork");
9300       _exit(2);
9301     }
9302     if (!child) {
9303       arg = getpid();
9304       write(-1, "", 0);
9305       _exit (arg);
9306     }
9307   }
9308 }
9309 main() {
9310   pid_t parent = getpid ();
9311   pid_t child;
9312
9313   sparc_address_test ();
9314
9315   child = vfork ();
9316
9317   if (child == 0) {
9318     /* Here is another test for sparc vfork register problems.
9319        This test uses lots of local variables, at least
9320        as many local variables as main has allocated so far
9321        including compiler temporaries.  4 locals are enough for
9322        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9323        A buggy compiler should reuse the register of parent
9324        for one of the local variables, since it will think that
9325        parent can't possibly be used any more in this routine.
9326        Assigning to the local variable will thus munge parent
9327        in the parent process.  */
9328     pid_t
9329       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9330       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9331     /* Convince the compiler that p..p7 are live; otherwise, it might
9332        use the same hardware register for all 8 local variables.  */
9333     if (p != p1 || p != p2 || p != p3 || p != p4
9334         || p != p5 || p != p6 || p != p7)
9335       _exit(1);
9336
9337     /* On some systems (e.g. IRIX 3.3),
9338        vfork doesn't separate parent from child file descriptors.
9339        If the child closes a descriptor before it execs or exits,
9340        this munges the parent's descriptor as well.
9341        Test for this by closing stdout in the child.  */
9342     _exit(close(fileno(stdout)) != 0);
9343   } else {
9344     int status;
9345     struct stat st;
9346
9347     while (wait(&status) != child)
9348       ;
9349     exit(
9350          /* Was there some problem with vforking?  */
9351          child < 0
9352
9353          /* Did the child fail?  (This shouldn't happen.)  */
9354          || status
9355
9356          /* Did the vfork/compiler bug occur?  */
9357          || parent != getpid()
9358
9359          /* Did the file descriptor bug occur?  */
9360          || fstat(fileno(stdout), &st) != 0
9361          );
9362   }
9363 }
9364 EOF
9365 if { (eval echo configure:9366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9366 then
9367   ac_cv_func_vfork_works=yes
9368 else
9369   conftest_rc="$?"
9370   echo "configure: failed program was:" >&5
9371   cat conftest.$ac_ext >&5
9372   rm -fr conftest*
9373   ac_cv_func_vfork_works=no
9374 fi
9375 rm -fr conftest*
9376
9377 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9378 if test $ac_cv_func_vfork_works = no; then
9379   { test "$extra_verbose" = "yes" && cat << \EOF
9380     Defining vfork = fork
9381 EOF
9382 cat >> confdefs.h <<\EOF
9383 #define vfork fork
9384 EOF
9385 }
9386
9387 fi
9388
9389
9390 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9391 echo "configure:9392: checking for working strcoll" >&5
9392
9393 cat > conftest.$ac_ext <<EOF
9394 #line 9395 "configure"
9395 #include "confdefs.h"
9396 #include <string.h>
9397 main ()
9398 {
9399   exit (strcoll ("abc", "def") >= 0 ||
9400         strcoll ("ABC", "DEF") >= 0 ||
9401         strcoll ("123", "456") >= 0);
9402 }
9403 EOF
9404 if { (eval echo configure:9405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9405 then
9406   ac_cv_func_strcoll_works=yes
9407 else
9408   conftest_rc="$?"
9409   echo "configure: failed program was:" >&5
9410   cat conftest.$ac_ext >&5
9411   rm -fr conftest*
9412   ac_cv_func_strcoll_works=no
9413 fi
9414 rm -fr conftest*
9415
9416 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9417 if test $ac_cv_func_strcoll_works = yes; then
9418   { test "$extra_verbose" = "yes" && cat << \EOF
9419     Defining HAVE_STRCOLL
9420 EOF
9421 cat >> confdefs.h <<\EOF
9422 #define HAVE_STRCOLL 1
9423 EOF
9424 }
9425
9426 fi
9427
9428
9429 for ac_func in getpgrp
9430 do
9431 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9432 echo "configure:9433: checking for $ac_func" >&5
9433
9434 cat > conftest.$ac_ext <<EOF
9435 #line 9436 "configure"
9436 #include "confdefs.h"
9437 /* System header to define __stub macros and hopefully few prototypes,
9438     which can conflict with char $ac_func(); below.  */
9439 #include <assert.h>
9440 /* Override any gcc2 internal prototype to avoid an error.  */
9441 /* We use char because int might match the return type of a gcc2
9442     builtin and then its argument prototype would still apply.  */
9443 char $ac_func();
9444
9445 int main() {
9446
9447 /* The GNU C library defines this for functions which it implements
9448     to always fail with ENOSYS.  Some functions are actually named
9449     something starting with __ and the normal name is an alias.  */
9450 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9451 choke me
9452 #else
9453 $ac_func();
9454 #endif
9455
9456 ; return 0; }
9457 EOF
9458 if { (eval echo configure:9459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9459   rm -rf conftest*
9460   eval "ac_cv_func_$ac_func=yes"
9461 else
9462   echo "configure: failed program was:" >&5
9463   cat conftest.$ac_ext >&5
9464   rm -rf conftest*
9465   eval "ac_cv_func_$ac_func=no"
9466 fi
9467 rm -f conftest*
9468
9469 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9470   echo "$ac_t""yes" 1>&6
9471     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9472   { test "$extra_verbose" = "yes" && cat << EOF
9473     Defining $ac_tr_func
9474 EOF
9475 cat >> confdefs.h <<EOF
9476 #define $ac_tr_func 1
9477 EOF
9478 }
9479  
9480 else
9481   echo "$ac_t""no" 1>&6
9482 fi
9483 done
9484
9485 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9486 echo "configure:9487: checking whether getpgrp takes no argument" >&5
9487
9488 cat > conftest.$ac_ext <<EOF
9489 #line 9490 "configure"
9490 #include "confdefs.h"
9491
9492 /*
9493  * If this system has a BSD-style getpgrp(),
9494  * which takes a pid argument, exit unsuccessfully.
9495  *
9496  * Snarfed from Chet Ramey's bash pgrp.c test program
9497  */
9498 #include <stdio.h>
9499 #include <sys/types.h>
9500
9501 int     pid;
9502 int     pg1, pg2, pg3, pg4;
9503 int     ng, np, s, child;
9504
9505 main()
9506 {
9507         pid = getpid();
9508         pg1 = getpgrp(0);
9509         pg2 = getpgrp();
9510         pg3 = getpgrp(pid);
9511         pg4 = getpgrp(1);
9512
9513         /*
9514          * If all of these values are the same, it's pretty sure that
9515          * we're on a system that ignores getpgrp's first argument.
9516          */
9517         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9518                 exit(0);
9519
9520         child = fork();
9521         if (child < 0)
9522                 exit(1);
9523         else if (child == 0) {
9524                 np = getpid();
9525                 /*
9526                  * If this is Sys V, this will not work; pgrp will be
9527                  * set to np because setpgrp just changes a pgrp to be
9528                  * the same as the pid.
9529                  */
9530                 setpgrp(np, pg1);
9531                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9532                 if (ng == pg1) {
9533                         exit(1);
9534                 } else {
9535                         exit(0);
9536                 }
9537         } else {
9538                 wait(&s);
9539                 exit(s>>8);
9540         }
9541 }
9542
9543 EOF
9544 if { (eval echo configure:9545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9545 then
9546   ac_cv_func_getpgrp_void=yes
9547 else
9548   conftest_rc="$?"
9549   echo "configure: failed program was:" >&5
9550   cat conftest.$ac_ext >&5
9551   rm -fr conftest*
9552   ac_cv_func_getpgrp_void=no
9553 fi
9554 rm -fr conftest*
9555
9556
9557 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9558 if test $ac_cv_func_getpgrp_void = yes; then
9559   { test "$extra_verbose" = "yes" && cat << \EOF
9560     Defining GETPGRP_VOID
9561 EOF
9562 cat >> confdefs.h <<\EOF
9563 #define GETPGRP_VOID 1
9564 EOF
9565 }
9566
9567 fi
9568
9569
9570 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9571 echo "configure:9572: checking for working mmap" >&5
9572 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9573 cat > conftest.$ac_ext <<EOF
9574 #line 9575 "configure"
9575 #include "confdefs.h"
9576 #include <stdio.h>
9577 #include <unistd.h>
9578 #include <fcntl.h>
9579 #include <sys/mman.h>
9580
9581 #ifndef MAP_VARIABLE
9582 #define MAP_VARIABLE 0
9583 #endif
9584
9585 #ifndef MAP_FAILED
9586 #define MAP_FAILED -1
9587 #endif
9588
9589 int main (int argc, char *argv[])
9590 {
9591   int fd = -1;
9592   caddr_t p;
9593 #ifndef MAP_ANONYMOUS
9594   fd = open ("/dev/zero", O_RDWR);
9595   if (fd < 0)
9596     return 1;
9597 #define MAP_ANONYMOUS 0
9598 #endif
9599   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9600            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9601            fd, 0) != (void *) MAP_FAILED)
9602     return 0;
9603   perror ("conftest: mmap failed");
9604   return 1;
9605 }
9606 EOF
9607 if { (eval echo configure:9608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9608 then
9609   have_mmap=yes
9610 else
9611   conftest_rc="$?"
9612   echo "configure: failed program was:" >&5
9613   cat conftest.$ac_ext >&5
9614   rm -fr conftest*
9615   have_mmap=no
9616 fi
9617 rm -fr conftest* ;;
9618 esac
9619 echo "$ac_t""$have_mmap" 1>&6
9620 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9621     Defining HAVE_MMAP
9622 EOF
9623 cat >> confdefs.h <<\EOF
9624 #define HAVE_MMAP 1
9625 EOF
9626 }
9627
9628 for ac_hdr in unistd.h
9629 do
9630 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9631 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9632 echo "configure:9633: checking for $ac_hdr" >&5
9633
9634 cat > conftest.$ac_ext <<EOF
9635 #line 9636 "configure"
9636 #include "confdefs.h"
9637 #include <$ac_hdr>
9638 EOF
9639 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9640 { (eval echo configure:9641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9641 ac_err=`grep -v '^ *+' conftest.out`
9642 if test -z "$ac_err"; then
9643   rm -rf conftest*
9644   eval "ac_cv_header_$ac_safe=yes"
9645 else
9646   echo "$ac_err" >&5
9647   echo "configure: failed program was:" >&5
9648   cat conftest.$ac_ext >&5
9649   rm -rf conftest*
9650   eval "ac_cv_header_$ac_safe=no"
9651 fi
9652 rm -f conftest*
9653 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9654   echo "$ac_t""yes" 1>&6
9655     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9656   { test "$extra_verbose" = "yes" && cat << EOF
9657     Defining $ac_tr_hdr
9658 EOF
9659 cat >> confdefs.h <<EOF
9660 #define $ac_tr_hdr 1
9661 EOF
9662 }
9663  
9664 else
9665   echo "$ac_t""no" 1>&6
9666 fi
9667 done
9668
9669 for ac_func in getpagesize
9670 do
9671 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9672 echo "configure:9673: checking for $ac_func" >&5
9673
9674 cat > conftest.$ac_ext <<EOF
9675 #line 9676 "configure"
9676 #include "confdefs.h"
9677 /* System header to define __stub macros and hopefully few prototypes,
9678     which can conflict with char $ac_func(); below.  */
9679 #include <assert.h>
9680 /* Override any gcc2 internal prototype to avoid an error.  */
9681 /* We use char because int might match the return type of a gcc2
9682     builtin and then its argument prototype would still apply.  */
9683 char $ac_func();
9684
9685 int main() {
9686
9687 /* The GNU C library defines this for functions which it implements
9688     to always fail with ENOSYS.  Some functions are actually named
9689     something starting with __ and the normal name is an alias.  */
9690 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9691 choke me
9692 #else
9693 $ac_func();
9694 #endif
9695
9696 ; return 0; }
9697 EOF
9698 if { (eval echo configure:9699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9699   rm -rf conftest*
9700   eval "ac_cv_func_$ac_func=yes"
9701 else
9702   echo "configure: failed program was:" >&5
9703   cat conftest.$ac_ext >&5
9704   rm -rf conftest*
9705   eval "ac_cv_func_$ac_func=no"
9706 fi
9707 rm -f conftest*
9708
9709 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9710   echo "$ac_t""yes" 1>&6
9711     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9712   { test "$extra_verbose" = "yes" && cat << EOF
9713     Defining $ac_tr_func
9714 EOF
9715 cat >> confdefs.h <<EOF
9716 #define $ac_tr_func 1
9717 EOF
9718 }
9719  
9720 else
9721   echo "$ac_t""no" 1>&6
9722 fi
9723 done
9724
9725 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9726 echo "configure:9727: checking for working mmap" >&5
9727
9728 cat > conftest.$ac_ext <<EOF
9729 #line 9730 "configure"
9730 #include "confdefs.h"
9731
9732 /* Thanks to Mike Haertel and Jim Avera for this test.
9733    Here is a matrix of mmap possibilities:
9734         mmap private not fixed
9735         mmap private fixed at somewhere currently unmapped
9736         mmap private fixed at somewhere already mapped
9737         mmap shared not fixed
9738         mmap shared fixed at somewhere currently unmapped
9739         mmap shared fixed at somewhere already mapped
9740    For private mappings, we should verify that changes cannot be read()
9741    back from the file, nor mmap's back from the file at a different
9742    address.  (There have been systems where private was not correctly
9743    implemented like the infamous i386 svr4.0, and systems where the
9744    VM page cache was not coherent with the filesystem buffer cache
9745    like early versions of FreeBSD and possibly contemporary NetBSD.)
9746    For shared mappings, we should conversely verify that changes get
9747    propogated back to all the places they're supposed to be.
9748
9749    Grep wants private fixed already mapped.
9750    The main things grep needs to know about mmap are:
9751    * does it exist and is it safe to write into the mmap'd area
9752    * how to use it (BSD variants)  */
9753 #include <sys/types.h>
9754 #include <fcntl.h>
9755 #include <sys/mman.h>
9756
9757 /* This mess was copied from the GNU getpagesize.h.  */
9758 #ifndef HAVE_GETPAGESIZE
9759 # ifdef HAVE_UNISTD_H
9760 #  include <unistd.h>
9761 # endif
9762
9763 /* Assume that all systems that can run configure have sys/param.h.  */
9764 # ifndef HAVE_SYS_PARAM_H
9765 #  define HAVE_SYS_PARAM_H 1
9766 # endif
9767
9768 # ifdef _SC_PAGESIZE
9769 #  define getpagesize() sysconf(_SC_PAGESIZE)
9770 # else /* no _SC_PAGESIZE */
9771 #  ifdef HAVE_SYS_PARAM_H
9772 #   include <sys/param.h>
9773 #   ifdef EXEC_PAGESIZE
9774 #    define getpagesize() EXEC_PAGESIZE
9775 #   else /* no EXEC_PAGESIZE */
9776 #    ifdef NBPG
9777 #     define getpagesize() NBPG * CLSIZE
9778 #     ifndef CLSIZE
9779 #      define CLSIZE 1
9780 #     endif /* no CLSIZE */
9781 #    else /* no NBPG */
9782 #     ifdef NBPC
9783 #      define getpagesize() NBPC
9784 #     else /* no NBPC */
9785 #      ifdef PAGESIZE
9786 #       define getpagesize() PAGESIZE
9787 #      endif /* PAGESIZE */
9788 #     endif /* no NBPC */
9789 #    endif /* no NBPG */
9790 #   endif /* no EXEC_PAGESIZE */
9791 #  else /* no HAVE_SYS_PARAM_H */
9792 #   define getpagesize() 8192   /* punt totally */
9793 #  endif /* no HAVE_SYS_PARAM_H */
9794 # endif /* no _SC_PAGESIZE */
9795
9796 #endif /* no HAVE_GETPAGESIZE */
9797
9798 #ifdef __cplusplus
9799 extern "C" { void *malloc(unsigned); }
9800 #else
9801 char *malloc();
9802 #endif
9803
9804 int
9805 main()
9806 {
9807         char *data, *data2, *data3;
9808         int i, pagesize;
9809         int fd;
9810
9811         pagesize = getpagesize();
9812
9813         /*
9814          * First, make a file with some known garbage in it.
9815          */
9816         data = malloc(pagesize);
9817         if (!data)
9818                 exit(1);
9819         for (i = 0; i < pagesize; ++i)
9820                 *(data + i) = rand();
9821         umask(0);
9822         fd = creat("conftestmmap", 0600);
9823         if (fd < 0)
9824                 exit(1);
9825         if (write(fd, data, pagesize) != pagesize)
9826                 exit(1);
9827         close(fd);
9828
9829         /*
9830          * Next, try to mmap the file at a fixed address which
9831          * already has something else allocated at it.  If we can,
9832          * also make sure that we see the same garbage.
9833          */
9834         fd = open("conftestmmap", O_RDWR);
9835         if (fd < 0)
9836                 exit(1);
9837         data2 = malloc(2 * pagesize);
9838         if (!data2)
9839                 exit(1);
9840         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
9841         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
9842             MAP_PRIVATE | MAP_FIXED, fd, 0L))
9843                 exit(1);
9844         for (i = 0; i < pagesize; ++i)
9845                 if (*(data + i) != *(data2 + i))
9846                         exit(1);
9847
9848         /*
9849          * Finally, make sure that changes to the mapped area
9850          * do not percolate back to the file as seen by read().
9851          * (This is a bug on some variants of i386 svr4.0.)
9852          */
9853         for (i = 0; i < pagesize; ++i)
9854                 *(data2 + i) = *(data2 + i) + 1;
9855         data3 = malloc(pagesize);
9856         if (!data3)
9857                 exit(1);
9858         if (read(fd, data3, pagesize) != pagesize)
9859                 exit(1);
9860         for (i = 0; i < pagesize; ++i)
9861                 if (*(data + i) != *(data3 + i))
9862                         exit(1);
9863         close(fd);
9864         unlink("conftestmmap");
9865         exit(0);
9866 }
9867
9868 EOF
9869 if { (eval echo configure:9870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9870 then
9871   ac_cv_func_mmap_fixed_mapped=yes
9872 else
9873   conftest_rc="$?"
9874   echo "configure: failed program was:" >&5
9875   cat conftest.$ac_ext >&5
9876   rm -fr conftest*
9877   ac_cv_func_mmap_fixed_mapped=no
9878 fi
9879 rm -fr conftest*
9880
9881 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
9882 if test $ac_cv_func_mmap_fixed_mapped = yes; then
9883   { test "$extra_verbose" = "yes" && cat << \EOF
9884     Defining HAVE_MMAP
9885 EOF
9886 cat >> confdefs.h <<\EOF
9887 #define HAVE_MMAP 1
9888 EOF
9889 }
9890
9891 fi
9892
9893
9894 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9895 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9896 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9897     Defining REL_ALLOC
9898 EOF
9899 cat >> confdefs.h <<\EOF
9900 #define REL_ALLOC 1
9901 EOF
9902 }
9903
9904
9905 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
9906 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
9907 echo "configure:9908: checking for termios.h" >&5
9908
9909 cat > conftest.$ac_ext <<EOF
9910 #line 9911 "configure"
9911 #include "confdefs.h"
9912 #include <termios.h>
9913 EOF
9914 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9915 { (eval echo configure:9916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9916 ac_err=`grep -v '^ *+' conftest.out`
9917 if test -z "$ac_err"; then
9918   rm -rf conftest*
9919   eval "ac_cv_header_$ac_safe=yes"
9920 else
9921   echo "$ac_err" >&5
9922   echo "configure: failed program was:" >&5
9923   cat conftest.$ac_ext >&5
9924   rm -rf conftest*
9925   eval "ac_cv_header_$ac_safe=no"
9926 fi
9927 rm -f conftest*
9928 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9929   echo "$ac_t""yes" 1>&6
9930   { test "$extra_verbose" = "yes" && cat << \EOF
9931     Defining HAVE_TERMIOS
9932 EOF
9933 cat >> confdefs.h <<\EOF
9934 #define HAVE_TERMIOS 1
9935 EOF
9936 }
9937
9938   { test "$extra_verbose" = "yes" && cat << \EOF
9939     Defining SIGNALS_VIA_CHARACTERS
9940 EOF
9941 cat >> confdefs.h <<\EOF
9942 #define SIGNALS_VIA_CHARACTERS 1
9943 EOF
9944 }
9945
9946   { test "$extra_verbose" = "yes" && cat << \EOF
9947     Defining NO_TERMIO
9948 EOF
9949 cat >> confdefs.h <<\EOF
9950 #define NO_TERMIO 1
9951 EOF
9952 }
9953
9954 else
9955   echo "$ac_t""no" 1>&6
9956 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
9957 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
9958 echo "configure:9959: checking for termio.h" >&5
9959
9960 cat > conftest.$ac_ext <<EOF
9961 #line 9962 "configure"
9962 #include "confdefs.h"
9963 #include <termio.h>
9964 EOF
9965 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9966 { (eval echo configure:9967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9967 ac_err=`grep -v '^ *+' conftest.out`
9968 if test -z "$ac_err"; then
9969   rm -rf conftest*
9970   eval "ac_cv_header_$ac_safe=yes"
9971 else
9972   echo "$ac_err" >&5
9973   echo "configure: failed program was:" >&5
9974   cat conftest.$ac_ext >&5
9975   rm -rf conftest*
9976   eval "ac_cv_header_$ac_safe=no"
9977 fi
9978 rm -f conftest*
9979 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9980   echo "$ac_t""yes" 1>&6
9981   { test "$extra_verbose" = "yes" && cat << \EOF
9982     Defining HAVE_TERMIO
9983 EOF
9984 cat >> confdefs.h <<\EOF
9985 #define HAVE_TERMIO 1
9986 EOF
9987 }
9988
9989 else
9990   echo "$ac_t""no" 1>&6
9991 fi
9992
9993 fi
9994
9995
9996
9997 echo $ac_n "checking for socket""... $ac_c" 1>&6
9998 echo "configure:9999: checking for socket" >&5
9999
10000 cat > conftest.$ac_ext <<EOF
10001 #line 10002 "configure"
10002 #include "confdefs.h"
10003 /* System header to define __stub macros and hopefully few prototypes,
10004     which can conflict with char socket(); below.  */
10005 #include <assert.h>
10006 /* Override any gcc2 internal prototype to avoid an error.  */
10007 /* We use char because int might match the return type of a gcc2
10008     builtin and then its argument prototype would still apply.  */
10009 char socket();
10010
10011 int main() {
10012
10013 /* The GNU C library defines this for functions which it implements
10014     to always fail with ENOSYS.  Some functions are actually named
10015     something starting with __ and the normal name is an alias.  */
10016 #if defined (__stub_socket) || defined (__stub___socket)
10017 choke me
10018 #else
10019 socket();
10020 #endif
10021
10022 ; return 0; }
10023 EOF
10024 if { (eval echo configure:10025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10025   rm -rf conftest*
10026   eval "ac_cv_func_socket=yes"
10027 else
10028   echo "configure: failed program was:" >&5
10029   cat conftest.$ac_ext >&5
10030   rm -rf conftest*
10031   eval "ac_cv_func_socket=no"
10032 fi
10033 rm -f conftest*
10034
10035 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10036   echo "$ac_t""yes" 1>&6
10037   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10038 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10039 echo "configure:10040: checking for netinet/in.h" >&5
10040
10041 cat > conftest.$ac_ext <<EOF
10042 #line 10043 "configure"
10043 #include "confdefs.h"
10044 #include <netinet/in.h>
10045 EOF
10046 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10047 { (eval echo configure:10048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10048 ac_err=`grep -v '^ *+' conftest.out`
10049 if test -z "$ac_err"; then
10050   rm -rf conftest*
10051   eval "ac_cv_header_$ac_safe=yes"
10052 else
10053   echo "$ac_err" >&5
10054   echo "configure: failed program was:" >&5
10055   cat conftest.$ac_ext >&5
10056   rm -rf conftest*
10057   eval "ac_cv_header_$ac_safe=no"
10058 fi
10059 rm -f conftest*
10060 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10061   echo "$ac_t""yes" 1>&6
10062   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10063 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10064 echo "configure:10065: checking for arpa/inet.h" >&5
10065
10066 cat > conftest.$ac_ext <<EOF
10067 #line 10068 "configure"
10068 #include "confdefs.h"
10069 #include <arpa/inet.h>
10070 EOF
10071 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10072 { (eval echo configure:10073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10073 ac_err=`grep -v '^ *+' conftest.out`
10074 if test -z "$ac_err"; then
10075   rm -rf conftest*
10076   eval "ac_cv_header_$ac_safe=yes"
10077 else
10078   echo "$ac_err" >&5
10079   echo "configure: failed program was:" >&5
10080   cat conftest.$ac_ext >&5
10081   rm -rf conftest*
10082   eval "ac_cv_header_$ac_safe=no"
10083 fi
10084 rm -f conftest*
10085 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10086   echo "$ac_t""yes" 1>&6
10087   
10088   { test "$extra_verbose" = "yes" && cat << \EOF
10089     Defining HAVE_SOCKETS
10090 EOF
10091 cat >> confdefs.h <<\EOF
10092 #define HAVE_SOCKETS 1
10093 EOF
10094 }
10095
10096       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10097 echo "configure:10098: checking "for sun_len member in struct sockaddr_un"" >&5
10098       cat > conftest.$ac_ext <<EOF
10099 #line 10100 "configure"
10100 #include "confdefs.h"
10101
10102 #include <sys/types.h>
10103 #include <sys/socket.h>
10104 #include <sys/un.h>
10105       
10106 int main() {
10107 static struct sockaddr_un x; x.sun_len = 1;
10108 ; return 0; }
10109 EOF
10110 if { (eval echo configure:10111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10111   rm -rf conftest*
10112   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10113     Defining HAVE_SOCKADDR_SUN_LEN
10114 EOF
10115 cat >> confdefs.h <<\EOF
10116 #define HAVE_SOCKADDR_SUN_LEN 1
10117 EOF
10118 }
10119
10120 else
10121   echo "configure: failed program was:" >&5
10122   cat conftest.$ac_ext >&5
10123   rm -rf conftest*
10124   echo "$ac_t""no" 1>&6
10125 fi
10126 rm -f conftest*
10127       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10128 echo "configure:10129: checking "for ip_mreq struct in netinet/in.h"" >&5
10129       cat > conftest.$ac_ext <<EOF
10130 #line 10131 "configure"
10131 #include "confdefs.h"
10132
10133 #include <sys/types.h>
10134 #include <netinet/in.h>
10135       
10136 int main() {
10137 static struct ip_mreq x;
10138 ; return 0; }
10139 EOF
10140 if { (eval echo configure:10141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10141   rm -rf conftest*
10142   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10143     Defining HAVE_MULTICAST
10144 EOF
10145 cat >> confdefs.h <<\EOF
10146 #define HAVE_MULTICAST 1
10147 EOF
10148 }
10149
10150 else
10151   echo "configure: failed program was:" >&5
10152   cat conftest.$ac_ext >&5
10153   rm -rf conftest*
10154   echo "$ac_t""no" 1>&6
10155 fi
10156 rm -f conftest*
10157 else
10158   echo "$ac_t""no" 1>&6
10159 fi
10160
10161 else
10162   echo "$ac_t""no" 1>&6
10163 fi
10164
10165 else
10166   echo "$ac_t""no" 1>&6
10167 fi
10168
10169
10170 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10171 echo "configure:10172: checking for msgget" >&5
10172
10173 cat > conftest.$ac_ext <<EOF
10174 #line 10175 "configure"
10175 #include "confdefs.h"
10176 /* System header to define __stub macros and hopefully few prototypes,
10177     which can conflict with char msgget(); below.  */
10178 #include <assert.h>
10179 /* Override any gcc2 internal prototype to avoid an error.  */
10180 /* We use char because int might match the return type of a gcc2
10181     builtin and then its argument prototype would still apply.  */
10182 char msgget();
10183
10184 int main() {
10185
10186 /* The GNU C library defines this for functions which it implements
10187     to always fail with ENOSYS.  Some functions are actually named
10188     something starting with __ and the normal name is an alias.  */
10189 #if defined (__stub_msgget) || defined (__stub___msgget)
10190 choke me
10191 #else
10192 msgget();
10193 #endif
10194
10195 ; return 0; }
10196 EOF
10197 if { (eval echo configure:10198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10198   rm -rf conftest*
10199   eval "ac_cv_func_msgget=yes"
10200 else
10201   echo "configure: failed program was:" >&5
10202   cat conftest.$ac_ext >&5
10203   rm -rf conftest*
10204   eval "ac_cv_func_msgget=no"
10205 fi
10206 rm -f conftest*
10207
10208 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10209   echo "$ac_t""yes" 1>&6
10210   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10211 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10212 echo "configure:10213: checking for sys/ipc.h" >&5
10213
10214 cat > conftest.$ac_ext <<EOF
10215 #line 10216 "configure"
10216 #include "confdefs.h"
10217 #include <sys/ipc.h>
10218 EOF
10219 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10220 { (eval echo configure:10221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10221 ac_err=`grep -v '^ *+' conftest.out`
10222 if test -z "$ac_err"; then
10223   rm -rf conftest*
10224   eval "ac_cv_header_$ac_safe=yes"
10225 else
10226   echo "$ac_err" >&5
10227   echo "configure: failed program was:" >&5
10228   cat conftest.$ac_ext >&5
10229   rm -rf conftest*
10230   eval "ac_cv_header_$ac_safe=no"
10231 fi
10232 rm -f conftest*
10233 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10234   echo "$ac_t""yes" 1>&6
10235   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10236 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10237 echo "configure:10238: checking for sys/msg.h" >&5
10238
10239 cat > conftest.$ac_ext <<EOF
10240 #line 10241 "configure"
10241 #include "confdefs.h"
10242 #include <sys/msg.h>
10243 EOF
10244 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10245 { (eval echo configure:10246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10246 ac_err=`grep -v '^ *+' conftest.out`
10247 if test -z "$ac_err"; then
10248   rm -rf conftest*
10249   eval "ac_cv_header_$ac_safe=yes"
10250 else
10251   echo "$ac_err" >&5
10252   echo "configure: failed program was:" >&5
10253   cat conftest.$ac_ext >&5
10254   rm -rf conftest*
10255   eval "ac_cv_header_$ac_safe=no"
10256 fi
10257 rm -f conftest*
10258 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10259   echo "$ac_t""yes" 1>&6
10260   { test "$extra_verbose" = "yes" && cat << \EOF
10261     Defining HAVE_SYSVIPC
10262 EOF
10263 cat >> confdefs.h <<\EOF
10264 #define HAVE_SYSVIPC 1
10265 EOF
10266 }
10267
10268 else
10269   echo "$ac_t""no" 1>&6
10270 fi
10271
10272 else
10273   echo "$ac_t""no" 1>&6
10274 fi
10275
10276 else
10277   echo "$ac_t""no" 1>&6
10278 fi
10279
10280
10281 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10282 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10283 echo "configure:10284: checking for dirent.h" >&5
10284
10285 cat > conftest.$ac_ext <<EOF
10286 #line 10287 "configure"
10287 #include "confdefs.h"
10288 #include <dirent.h>
10289 EOF
10290 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10291 { (eval echo configure:10292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10292 ac_err=`grep -v '^ *+' conftest.out`
10293 if test -z "$ac_err"; then
10294   rm -rf conftest*
10295   eval "ac_cv_header_$ac_safe=yes"
10296 else
10297   echo "$ac_err" >&5
10298   echo "configure: failed program was:" >&5
10299   cat conftest.$ac_ext >&5
10300   rm -rf conftest*
10301   eval "ac_cv_header_$ac_safe=no"
10302 fi
10303 rm -f conftest*
10304 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10305   echo "$ac_t""yes" 1>&6
10306   { test "$extra_verbose" = "yes" && cat << \EOF
10307     Defining SYSV_SYSTEM_DIR
10308 EOF
10309 cat >> confdefs.h <<\EOF
10310 #define SYSV_SYSTEM_DIR 1
10311 EOF
10312 }
10313
10314 else
10315   echo "$ac_t""no" 1>&6
10316 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10317 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10318 echo "configure:10319: checking for sys/dir.h" >&5
10319
10320 cat > conftest.$ac_ext <<EOF
10321 #line 10322 "configure"
10322 #include "confdefs.h"
10323 #include <sys/dir.h>
10324 EOF
10325 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10326 { (eval echo configure:10327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10327 ac_err=`grep -v '^ *+' conftest.out`
10328 if test -z "$ac_err"; then
10329   rm -rf conftest*
10330   eval "ac_cv_header_$ac_safe=yes"
10331 else
10332   echo "$ac_err" >&5
10333   echo "configure: failed program was:" >&5
10334   cat conftest.$ac_ext >&5
10335   rm -rf conftest*
10336   eval "ac_cv_header_$ac_safe=no"
10337 fi
10338 rm -f conftest*
10339 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10340   echo "$ac_t""yes" 1>&6
10341   :
10342 else
10343   echo "$ac_t""no" 1>&6
10344 { test "$extra_verbose" = "yes" && cat << \EOF
10345     Defining NONSYSTEM_DIR_LIBRARY
10346 EOF
10347 cat >> confdefs.h <<\EOF
10348 #define NONSYSTEM_DIR_LIBRARY 1
10349 EOF
10350 }
10351
10352 fi
10353
10354 fi
10355
10356
10357 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10358 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10359 echo "configure:10360: checking for nlist.h" >&5
10360
10361 cat > conftest.$ac_ext <<EOF
10362 #line 10363 "configure"
10363 #include "confdefs.h"
10364 #include <nlist.h>
10365 EOF
10366 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10367 { (eval echo configure:10368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10368 ac_err=`grep -v '^ *+' conftest.out`
10369 if test -z "$ac_err"; then
10370   rm -rf conftest*
10371   eval "ac_cv_header_$ac_safe=yes"
10372 else
10373   echo "$ac_err" >&5
10374   echo "configure: failed program was:" >&5
10375   cat conftest.$ac_ext >&5
10376   rm -rf conftest*
10377   eval "ac_cv_header_$ac_safe=no"
10378 fi
10379 rm -f conftest*
10380 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10381   echo "$ac_t""yes" 1>&6
10382   { test "$extra_verbose" = "yes" && cat << \EOF
10383     Defining NLIST_STRUCT
10384 EOF
10385 cat >> confdefs.h <<\EOF
10386 #define NLIST_STRUCT 1
10387 EOF
10388 }
10389
10390 else
10391   echo "$ac_t""no" 1>&6
10392 fi
10393
10394
10395
10396 echo "checking "for sound support"" 1>&6
10397 echo "configure:10398: checking "for sound support"" >&5
10398 case "$with_sound" in
10399   native | both ) with_native_sound=yes;;
10400   nas    | no   ) with_native_sound=no;;
10401 esac
10402 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10403
10404 if test "$with_native_sound" != "no"; then
10405     if test -n "$native_sound_lib"; then
10406     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10407 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10408 echo "configure:10409: checking for multimedia/audio_device.h" >&5
10409
10410 cat > conftest.$ac_ext <<EOF
10411 #line 10412 "configure"
10412 #include "confdefs.h"
10413 #include <multimedia/audio_device.h>
10414 EOF
10415 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10416 { (eval echo configure:10417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10417 ac_err=`grep -v '^ *+' conftest.out`
10418 if test -z "$ac_err"; then
10419   rm -rf conftest*
10420   eval "ac_cv_header_$ac_safe=yes"
10421 else
10422   echo "$ac_err" >&5
10423   echo "configure: failed program was:" >&5
10424   cat conftest.$ac_ext >&5
10425   rm -rf conftest*
10426   eval "ac_cv_header_$ac_safe=no"
10427 fi
10428 rm -f conftest*
10429 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10430   echo "$ac_t""yes" 1>&6
10431   sound_found=yes sound_cflags=""
10432       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10433    echo "    xemacs will be linked with \"sunplay.o\""
10434  fi
10435 else
10436   echo "$ac_t""no" 1>&6
10437 fi
10438
10439   fi
10440
10441     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10442     sound_found=yes
10443     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10444    echo "    xemacs will be linked with \"sunplay.o\""
10445  fi
10446     if test -d "/usr/demo/SOUND/include"
10447       then sound_cflags="-I/usr/demo/SOUND/include"
10448       else sound_cflags="-I/usr/demo/SOUND"
10449     fi
10450     if test -z "$native_sound_lib" ; then
10451       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10452         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10453         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10454       fi
10455     fi
10456   fi
10457
10458     if test -z "$sound_found"; then
10459     case "$canonical" in
10460     *-sgi-* )
10461       if test -z "$native_sound_lib"; then
10462         
10463 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10464 echo "configure:10465: checking for ALopenport in -laudio" >&5
10465 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10466
10467 xe_check_libs=" -laudio "
10468 cat > conftest.$ac_ext <<EOF
10469 #line 10470 "configure"
10470 #include "confdefs.h"
10471 /* Override any gcc2 internal prototype to avoid an error.  */
10472 /* We use char because int might match the return type of a gcc2
10473     builtin and then its argument prototype would still apply.  */
10474 char ALopenport();
10475
10476 int main() {
10477 ALopenport()
10478 ; return 0; }
10479 EOF
10480 if { (eval echo configure:10481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10481   rm -rf conftest*
10482   eval "ac_cv_lib_$ac_lib_var=yes"
10483 else
10484   echo "configure: failed program was:" >&5
10485   cat conftest.$ac_ext >&5
10486   rm -rf conftest*
10487   eval "ac_cv_lib_$ac_lib_var=no"
10488 fi
10489 rm -f conftest*
10490 xe_check_libs=""
10491
10492 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10493   echo "$ac_t""yes" 1>&6
10494   native_sound_lib="-laudio"
10495 else
10496   echo "$ac_t""no" 1>&6
10497 fi
10498
10499
10500       fi
10501       if test -n "$native_sound_lib"; then
10502         sound_found=yes sound_cflags=""
10503         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10504    echo "    xemacs will be linked with \"sgiplay.o\""
10505  fi
10506       fi ;;
10507     hppa*-hp-hpux* )
10508       if test -z "$native_sound_lib"; then
10509         
10510 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10511 echo "configure:10512: checking for AOpenAudio in -lAlib" >&5
10512 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10513
10514 xe_check_libs=" -lAlib "
10515 cat > conftest.$ac_ext <<EOF
10516 #line 10517 "configure"
10517 #include "confdefs.h"
10518 /* Override any gcc2 internal prototype to avoid an error.  */
10519 /* We use char because int might match the return type of a gcc2
10520     builtin and then its argument prototype would still apply.  */
10521 char AOpenAudio();
10522
10523 int main() {
10524 AOpenAudio()
10525 ; return 0; }
10526 EOF
10527 if { (eval echo configure:10528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10528   rm -rf conftest*
10529   eval "ac_cv_lib_$ac_lib_var=yes"
10530 else
10531   echo "configure: failed program was:" >&5
10532   cat conftest.$ac_ext >&5
10533   rm -rf conftest*
10534   eval "ac_cv_lib_$ac_lib_var=no"
10535 fi
10536 rm -f conftest*
10537 xe_check_libs=""
10538
10539 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10540   echo "$ac_t""yes" 1>&6
10541   native_sound_lib="-lAlib"
10542 else
10543   echo "$ac_t""no" 1>&6
10544 fi
10545
10546
10547       fi
10548       if test -n "$native_sound_lib"; then
10549         sound_found=yes
10550         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10551    echo "    xemacs will be linked with \"hpplay.o\""
10552  fi
10553         if test "$GCC" = "yes" # Kludge city
10554           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10555           else sound_cflags="+e -I/usr/audio/examples"
10556         fi
10557       fi ;;
10558     esac
10559   fi
10560
10561     if test -z "$sound_found"; then
10562     for dir in "machine" "sys" "linux"; do
10563       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10564 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10565 echo "configure:10566: checking for ${dir}/soundcard.h" >&5
10566
10567 cat > conftest.$ac_ext <<EOF
10568 #line 10569 "configure"
10569 #include "confdefs.h"
10570 #include <${dir}/soundcard.h>
10571 EOF
10572 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10573 { (eval echo configure:10574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10574 ac_err=`grep -v '^ *+' conftest.out`
10575 if test -z "$ac_err"; then
10576   rm -rf conftest*
10577   eval "ac_cv_header_$ac_safe=yes"
10578 else
10579   echo "$ac_err" >&5
10580   echo "configure: failed program was:" >&5
10581   cat conftest.$ac_ext >&5
10582   rm -rf conftest*
10583   eval "ac_cv_header_$ac_safe=no"
10584 fi
10585 rm -f conftest*
10586 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10587   echo "$ac_t""yes" 1>&6
10588   sound_found=yes
10589         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10590    echo "    xemacs will be linked with \"linuxplay.o\""
10591  fi
10592         { test "$extra_verbose" = "yes" && cat << EOF
10593     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10594 EOF
10595 cat >> confdefs.h <<EOF
10596 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10597 EOF
10598 }
10599
10600         break
10601 else
10602   echo "$ac_t""no" 1>&6
10603 fi
10604
10605     done
10606   fi
10607
10608   test "$sound_found" = "yes" && with_native_sound=yes
10609 fi
10610
10611 if test -z "$with_sound"; then
10612   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10613     with_sound=native
10614   fi
10615 fi
10616
10617 if test "$with_native_sound" = "yes"; then
10618   { test "$extra_verbose" = "yes" && cat << \EOF
10619     Defining HAVE_NATIVE_SOUND
10620 EOF
10621 cat >> confdefs.h <<\EOF
10622 #define HAVE_NATIVE_SOUND 1
10623 EOF
10624 }
10625
10626   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10627 fi
10628
10629 case "$with_sound" in both | nas )
10630   { test "$extra_verbose" = "yes" && cat << \EOF
10631     Defining HAVE_NAS_SOUND
10632 EOF
10633 cat >> confdefs.h <<\EOF
10634 #define HAVE_NAS_SOUND 1
10635 EOF
10636 }
10637
10638   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10639    echo "    xemacs will be linked with \"nas.o\""
10640  fi
10641   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10642       cat > conftest.$ac_ext <<EOF
10643 #line 10644 "configure"
10644 #include "confdefs.h"
10645 #include <audio/Xtutil.h>
10646 EOF
10647 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10648   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10649   :
10650 else
10651   rm -rf conftest*
10652   { test "$extra_verbose" = "yes" && cat << \EOF
10653     Defining NAS_NO_ERROR_JUMP
10654 EOF
10655 cat >> confdefs.h <<\EOF
10656 #define NAS_NO_ERROR_JUMP 1
10657 EOF
10658 }
10659
10660 fi
10661 rm -f conftest*
10662
10663 esac
10664
10665
10666 test -z "$with_tty" && with_tty=yes
10667
10668 if test "$with_tty" = "yes"  ; then
10669   echo "checking for TTY-related features" 1>&6
10670 echo "configure:10671: checking for TTY-related features" >&5
10671   { test "$extra_verbose" = "yes" && cat << \EOF
10672     Defining HAVE_TTY
10673 EOF
10674 cat >> confdefs.h <<\EOF
10675 #define HAVE_TTY 1
10676 EOF
10677 }
10678
10679   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
10680    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\""
10681  fi
10682
10683     if test -z "$with_ncurses"; then
10684     
10685 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10686 echo "configure:10687: checking for tgetent in -lncurses" >&5
10687 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10688
10689 xe_check_libs=" -lncurses "
10690 cat > conftest.$ac_ext <<EOF
10691 #line 10692 "configure"
10692 #include "confdefs.h"
10693 /* Override any gcc2 internal prototype to avoid an error.  */
10694 /* We use char because int might match the return type of a gcc2
10695     builtin and then its argument prototype would still apply.  */
10696 char tgetent();
10697
10698 int main() {
10699 tgetent()
10700 ; return 0; }
10701 EOF
10702 if { (eval echo configure:10703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10703   rm -rf conftest*
10704   eval "ac_cv_lib_$ac_lib_var=yes"
10705 else
10706   echo "configure: failed program was:" >&5
10707   cat conftest.$ac_ext >&5
10708   rm -rf conftest*
10709   eval "ac_cv_lib_$ac_lib_var=no"
10710 fi
10711 rm -f conftest*
10712 xe_check_libs=""
10713
10714 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10715   echo "$ac_t""yes" 1>&6
10716   with_ncurses=yes
10717 else
10718   echo "$ac_t""no" 1>&6
10719 with_ncurses=no
10720 fi
10721
10722
10723   fi
10724   if test "$with_ncurses" = "yes"; then
10725     { test "$extra_verbose" = "yes" && cat << \EOF
10726     Defining HAVE_NCURSES
10727 EOF
10728 cat >> confdefs.h <<\EOF
10729 #define HAVE_NCURSES 1
10730 EOF
10731 }
10732
10733     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10734 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10735 echo "configure:10736: checking for ncurses/curses.h" >&5
10736
10737 cat > conftest.$ac_ext <<EOF
10738 #line 10739 "configure"
10739 #include "confdefs.h"
10740 #include <ncurses/curses.h>
10741 EOF
10742 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10743 { (eval echo configure:10744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10744 ac_err=`grep -v '^ *+' conftest.out`
10745 if test -z "$ac_err"; then
10746   rm -rf conftest*
10747   eval "ac_cv_header_$ac_safe=yes"
10748 else
10749   echo "$ac_err" >&5
10750   echo "configure: failed program was:" >&5
10751   cat conftest.$ac_ext >&5
10752   rm -rf conftest*
10753   eval "ac_cv_header_$ac_safe=no"
10754 fi
10755 rm -f conftest*
10756 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10757   echo "$ac_t""yes" 1>&6
10758   curses_h_path=ncurses/curses.h
10759 else
10760   echo "$ac_t""no" 1>&6
10761 fi
10762
10763     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10764 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10765 echo "configure:10766: checking for ncurses/term.h" >&5
10766
10767 cat > conftest.$ac_ext <<EOF
10768 #line 10769 "configure"
10769 #include "confdefs.h"
10770 #include <ncurses/term.h>
10771 EOF
10772 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10773 { (eval echo configure:10774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10774 ac_err=`grep -v '^ *+' conftest.out`
10775 if test -z "$ac_err"; then
10776   rm -rf conftest*
10777   eval "ac_cv_header_$ac_safe=yes"
10778 else
10779   echo "$ac_err" >&5
10780   echo "configure: failed program was:" >&5
10781   cat conftest.$ac_ext >&5
10782   rm -rf conftest*
10783   eval "ac_cv_header_$ac_safe=no"
10784 fi
10785 rm -f conftest*
10786 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10787   echo "$ac_t""yes" 1>&6
10788   term_h_path=ncurses/term.h
10789 else
10790   echo "$ac_t""no" 1>&6
10791 fi
10792
10793     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10794    echo "    xemacs will be linked with \"terminfo.o\""
10795  fi
10796     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10797
10798     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10799                         save_c_switch_site="$c_switch_site"
10800       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10801       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10802 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10803 echo "configure:10804: checking for ncurses/curses.h" >&5
10804
10805 cat > conftest.$ac_ext <<EOF
10806 #line 10807 "configure"
10807 #include "confdefs.h"
10808 #include <ncurses/curses.h>
10809 EOF
10810 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10811 { (eval echo configure:10812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10812 ac_err=`grep -v '^ *+' conftest.out`
10813 if test -z "$ac_err"; then
10814   rm -rf conftest*
10815   eval "ac_cv_header_$ac_safe=yes"
10816 else
10817   echo "$ac_err" >&5
10818   echo "configure: failed program was:" >&5
10819   cat conftest.$ac_ext >&5
10820   rm -rf conftest*
10821   eval "ac_cv_header_$ac_safe=no"
10822 fi
10823 rm -f conftest*
10824 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10825   echo "$ac_t""yes" 1>&6
10826   curses_h_path=ncurses/curses.h
10827 else
10828   echo "$ac_t""no" 1>&6
10829 fi
10830
10831       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10832         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10833         else c_switch_site="$save_c_switch_site"
10834       fi
10835     fi
10836   else         if test "$have_terminfo" = "yes"; then
10837       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10838    echo "    xemacs will be linked with \"terminfo.o\""
10839  fi
10840       if test -n "$libs_termcap"; then
10841         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10842       else
10843         for lib in curses termlib termcap; do
10844           
10845 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10846 echo "configure:10847: checking for tgetent in -l$lib" >&5
10847 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10848
10849 xe_check_libs=" -l$lib "
10850 cat > conftest.$ac_ext <<EOF
10851 #line 10852 "configure"
10852 #include "confdefs.h"
10853 /* Override any gcc2 internal prototype to avoid an error.  */
10854 /* We use char because int might match the return type of a gcc2
10855     builtin and then its argument prototype would still apply.  */
10856 char tgetent();
10857
10858 int main() {
10859 tgetent()
10860 ; return 0; }
10861 EOF
10862 if { (eval echo configure:10863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10863   rm -rf conftest*
10864   eval "ac_cv_lib_$ac_lib_var=yes"
10865 else
10866   echo "configure: failed program was:" >&5
10867   cat conftest.$ac_ext >&5
10868   rm -rf conftest*
10869   eval "ac_cv_lib_$ac_lib_var=no"
10870 fi
10871 rm -f conftest*
10872 xe_check_libs=""
10873
10874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10875   echo "$ac_t""yes" 1>&6
10876   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10877 else
10878   echo "$ac_t""no" 1>&6
10879 fi
10880
10881
10882         done
10883       fi
10884     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10885    echo "    xemacs will be linked with \"tparam.o\""
10886  fi
10887                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10888       if test -n "$libs_termcap"; then
10889         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10890       else
10891         
10892 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10893 echo "configure:10894: checking for tgetent in -lcurses" >&5
10894 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10895
10896 xe_check_libs=" -lcurses "
10897 cat > conftest.$ac_ext <<EOF
10898 #line 10899 "configure"
10899 #include "confdefs.h"
10900 /* Override any gcc2 internal prototype to avoid an error.  */
10901 /* We use char because int might match the return type of a gcc2
10902     builtin and then its argument prototype would still apply.  */
10903 char tgetent();
10904
10905 int main() {
10906 tgetent()
10907 ; return 0; }
10908 EOF
10909 if { (eval echo configure:10910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10910   rm -rf conftest*
10911   eval "ac_cv_lib_$ac_lib_var=yes"
10912 else
10913   echo "configure: failed program was:" >&5
10914   cat conftest.$ac_ext >&5
10915   rm -rf conftest*
10916   eval "ac_cv_lib_$ac_lib_var=no"
10917 fi
10918 rm -f conftest*
10919 xe_check_libs=""
10920
10921 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10922   echo "$ac_t""yes" 1>&6
10923   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
10924 else
10925   echo "$ac_t""no" 1>&6
10926 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
10927 echo "configure:10928: checking for tgetent in -ltermcap" >&5
10928 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
10929
10930 xe_check_libs=" -ltermcap "
10931 cat > conftest.$ac_ext <<EOF
10932 #line 10933 "configure"
10933 #include "confdefs.h"
10934 /* Override any gcc2 internal prototype to avoid an error.  */
10935 /* We use char because int might match the return type of a gcc2
10936     builtin and then its argument prototype would still apply.  */
10937 char tgetent();
10938
10939 int main() {
10940 tgetent()
10941 ; return 0; }
10942 EOF
10943 if { (eval echo configure:10944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10944   rm -rf conftest*
10945   eval "ac_cv_lib_$ac_lib_var=yes"
10946 else
10947   echo "configure: failed program was:" >&5
10948   cat conftest.$ac_ext >&5
10949   rm -rf conftest*
10950   eval "ac_cv_lib_$ac_lib_var=no"
10951 fi
10952 rm -f conftest*
10953 xe_check_libs=""
10954
10955 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10956   echo "$ac_t""yes" 1>&6
10957   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
10958 else
10959   echo "$ac_t""no" 1>&6
10960 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
10961    echo "    xemacs will be linked with \"termcap.o\""
10962  fi
10963 fi
10964
10965
10966 fi
10967
10968
10969       fi
10970     fi
10971   fi
10972   { test "$extra_verbose" = "yes" && cat << EOF
10973     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
10974 EOF
10975 cat >> confdefs.h <<EOF
10976 #define CURSES_H_PATH "${curses_h_path-curses.h}"
10977 EOF
10978 }
10979
10980   { test "$extra_verbose" = "yes" && cat << EOF
10981     Defining TERM_H_PATH = "${term_h_path-term.h}"
10982 EOF
10983 cat >> confdefs.h <<EOF
10984 #define TERM_H_PATH "${term_h_path-term.h}"
10985 EOF
10986 }
10987
10988
10989     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
10990 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
10991 echo "configure:10992: checking for gpm.h" >&5
10992
10993 cat > conftest.$ac_ext <<EOF
10994 #line 10995 "configure"
10995 #include "confdefs.h"
10996 #include <gpm.h>
10997 EOF
10998 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10999 { (eval echo configure:11000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11000 ac_err=`grep -v '^ *+' conftest.out`
11001 if test -z "$ac_err"; then
11002   rm -rf conftest*
11003   eval "ac_cv_header_$ac_safe=yes"
11004 else
11005   echo "$ac_err" >&5
11006   echo "configure: failed program was:" >&5
11007   cat conftest.$ac_ext >&5
11008   rm -rf conftest*
11009   eval "ac_cv_header_$ac_safe=no"
11010 fi
11011 rm -f conftest*
11012 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11013   echo "$ac_t""yes" 1>&6
11014   :
11015 else
11016   echo "$ac_t""no" 1>&6
11017 with_gpm=no
11018 fi
11019  }
11020   test -z "$with_gpm" && { 
11021 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11022 echo "configure:11023: checking for Gpm_Open in -lgpm" >&5
11023 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11024
11025 xe_check_libs=" -lgpm "
11026 cat > conftest.$ac_ext <<EOF
11027 #line 11028 "configure"
11028 #include "confdefs.h"
11029 /* Override any gcc2 internal prototype to avoid an error.  */
11030 /* We use char because int might match the return type of a gcc2
11031     builtin and then its argument prototype would still apply.  */
11032 char Gpm_Open();
11033
11034 int main() {
11035 Gpm_Open()
11036 ; return 0; }
11037 EOF
11038 if { (eval echo configure:11039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11039   rm -rf conftest*
11040   eval "ac_cv_lib_$ac_lib_var=yes"
11041 else
11042   echo "configure: failed program was:" >&5
11043   cat conftest.$ac_ext >&5
11044   rm -rf conftest*
11045   eval "ac_cv_lib_$ac_lib_var=no"
11046 fi
11047 rm -f conftest*
11048 xe_check_libs=""
11049
11050 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11051   echo "$ac_t""yes" 1>&6
11052   with_gpm=yes
11053 else
11054   echo "$ac_t""no" 1>&6
11055 with_gpm=no
11056 fi
11057
11058  }
11059   if test "$with_gpm" = "yes"; then
11060     { test "$extra_verbose" = "yes" && cat << \EOF
11061     Defining HAVE_GPM
11062 EOF
11063 cat >> confdefs.h <<\EOF
11064 #define HAVE_GPM 1
11065 EOF
11066 }
11067
11068     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11069    echo "    xemacs will be linked with \"gpmevent.o\""
11070  fi
11071     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11072   fi
11073
11074 else   for feature in ncurses gpm; do
11075     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11076       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11077     fi
11078     eval "with_${feature}=no"
11079   done
11080 fi 
11081 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11082    echo "    xemacs will be linked with \"event-unixoid.o\""
11083  fi
11084
11085
11086 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11087   != "no no no" && echo "checking for database support" 1>&6
11088 echo "configure:11089: checking for database support" >&5
11089
11090 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11091   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11092 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11093 echo "configure:11094: checking for ndbm.h" >&5
11094
11095 cat > conftest.$ac_ext <<EOF
11096 #line 11097 "configure"
11097 #include "confdefs.h"
11098 #include <ndbm.h>
11099 EOF
11100 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11101 { (eval echo configure:11102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11102 ac_err=`grep -v '^ *+' conftest.out`
11103 if test -z "$ac_err"; then
11104   rm -rf conftest*
11105   eval "ac_cv_header_$ac_safe=yes"
11106 else
11107   echo "$ac_err" >&5
11108   echo "configure: failed program was:" >&5
11109   cat conftest.$ac_ext >&5
11110   rm -rf conftest*
11111   eval "ac_cv_header_$ac_safe=no"
11112 fi
11113 rm -f conftest*
11114 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11115   echo "$ac_t""yes" 1>&6
11116   :
11117 else
11118   echo "$ac_t""no" 1>&6
11119
11120     test "$with_database_gnudbm" = "yes" -o \
11121          "$with_database_dbm"    = "yes" && \
11122       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11123     with_database_gnudbm=no with_database_dbm=no
11124 fi
11125
11126 fi
11127
11128 if test "$with_database_gnudbm" != "no"; then
11129   
11130 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11131 echo "configure:11132: checking for dbm_open in -lgdbm" >&5
11132 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11133
11134 xe_check_libs=" -lgdbm "
11135 cat > conftest.$ac_ext <<EOF
11136 #line 11137 "configure"
11137 #include "confdefs.h"
11138 /* Override any gcc2 internal prototype to avoid an error.  */
11139 /* We use char because int might match the return type of a gcc2
11140     builtin and then its argument prototype would still apply.  */
11141 char dbm_open();
11142
11143 int main() {
11144 dbm_open()
11145 ; return 0; }
11146 EOF
11147 if { (eval echo configure:11148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11148   rm -rf conftest*
11149   eval "ac_cv_lib_$ac_lib_var=yes"
11150 else
11151   echo "configure: failed program was:" >&5
11152   cat conftest.$ac_ext >&5
11153   rm -rf conftest*
11154   eval "ac_cv_lib_$ac_lib_var=no"
11155 fi
11156 rm -f conftest*
11157 xe_check_libs=""
11158
11159 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11160   echo "$ac_t""yes" 1>&6
11161   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11162 else
11163   echo "$ac_t""no" 1>&6
11164 if test "$with_database_gnudbm" = "yes"; then
11165      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11166    fi
11167    with_database_gnudbm=no
11168 fi
11169
11170
11171 fi
11172
11173 if test "$with_database_dbm" != "no"; then
11174   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11175 echo "configure:11176: checking for dbm_open" >&5
11176
11177 cat > conftest.$ac_ext <<EOF
11178 #line 11179 "configure"
11179 #include "confdefs.h"
11180 /* System header to define __stub macros and hopefully few prototypes,
11181     which can conflict with char dbm_open(); below.  */
11182 #include <assert.h>
11183 /* Override any gcc2 internal prototype to avoid an error.  */
11184 /* We use char because int might match the return type of a gcc2
11185     builtin and then its argument prototype would still apply.  */
11186 char dbm_open();
11187
11188 int main() {
11189
11190 /* The GNU C library defines this for functions which it implements
11191     to always fail with ENOSYS.  Some functions are actually named
11192     something starting with __ and the normal name is an alias.  */
11193 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11194 choke me
11195 #else
11196 dbm_open();
11197 #endif
11198
11199 ; return 0; }
11200 EOF
11201 if { (eval echo configure:11202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11202   rm -rf conftest*
11203   eval "ac_cv_func_dbm_open=yes"
11204 else
11205   echo "configure: failed program was:" >&5
11206   cat conftest.$ac_ext >&5
11207   rm -rf conftest*
11208   eval "ac_cv_func_dbm_open=no"
11209 fi
11210 rm -f conftest*
11211
11212 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11213   echo "$ac_t""yes" 1>&6
11214   with_database_dbm=yes libdbm=
11215 else
11216   echo "$ac_t""no" 1>&6
11217
11218     
11219 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11220 echo "configure:11221: checking for dbm_open in -ldbm" >&5
11221 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11222
11223 xe_check_libs=" -ldbm "
11224 cat > conftest.$ac_ext <<EOF
11225 #line 11226 "configure"
11226 #include "confdefs.h"
11227 /* Override any gcc2 internal prototype to avoid an error.  */
11228 /* We use char because int might match the return type of a gcc2
11229     builtin and then its argument prototype would still apply.  */
11230 char dbm_open();
11231
11232 int main() {
11233 dbm_open()
11234 ; return 0; }
11235 EOF
11236 if { (eval echo configure:11237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11237   rm -rf conftest*
11238   eval "ac_cv_lib_$ac_lib_var=yes"
11239 else
11240   echo "configure: failed program was:" >&5
11241   cat conftest.$ac_ext >&5
11242   rm -rf conftest*
11243   eval "ac_cv_lib_$ac_lib_var=no"
11244 fi
11245 rm -f conftest*
11246 xe_check_libs=""
11247
11248 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11249   echo "$ac_t""yes" 1>&6
11250   with_database_dbm=yes libdbm=-ldbm
11251 else
11252   echo "$ac_t""no" 1>&6
11253 test "$with_database_dbm" = "yes" && \
11254         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11255       with_database_dbm=no
11256 fi
11257
11258
11259 fi
11260
11261 fi
11262
11263 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11264 test "$with_database_gnudbm" = "yes" -o \
11265      "$with_database_dbm"    = "yes" && \
11266   { test "$extra_verbose" = "yes" && cat << \EOF
11267     Defining HAVE_DBM
11268 EOF
11269 cat >> confdefs.h <<\EOF
11270 #define HAVE_DBM 1
11271 EOF
11272 }
11273
11274
11275 if test "$with_database_berkdb" != "no"; then
11276   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11277 echo "configure:11278: checking for Berkeley db.h" >&5
11278   for path in "db/db.h" "db.h"; do
11279     cat > conftest.$ac_ext <<EOF
11280 #line 11281 "configure"
11281 #include "confdefs.h"
11282 #ifdef HAVE_INTTYPES_H
11283 #define __BIT_TYPES_DEFINED__
11284 #include <inttypes.h>
11285 typedef uint8_t  u_int8_t;
11286 typedef uint16_t u_int16_t;
11287 typedef uint32_t u_int32_t;
11288 #ifdef WE_DONT_NEED_QUADS
11289 typedef uint64_t u_int64_t;
11290 #endif
11291 #endif
11292 #include <$path>
11293
11294 int main() {
11295
11296 ; return 0; }
11297 EOF
11298 if { (eval echo configure:11299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11299   rm -rf conftest*
11300   db_h_path="$path"; break
11301 else
11302   echo "configure: failed program was:" >&5
11303   cat conftest.$ac_ext >&5
11304 fi
11305 rm -f conftest*
11306   done
11307   if test -z "$db_h_path"
11308   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11309   else echo "$ac_t""$db_h_path" 1>&6
11310   fi
11311
11312   if test "$with_database_berkdb" != "no"; then
11313     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11314 echo "configure:11315: checking for Berkeley DB version" >&5
11315     cat > conftest.$ac_ext <<EOF
11316 #line 11317 "configure"
11317 #include "confdefs.h"
11318 #include <$db_h_path>
11319 #if DB_VERSION_MAJOR > 1
11320 yes
11321 #endif
11322
11323 EOF
11324 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11325   egrep "yes" >/dev/null 2>&1; then
11326   rm -rf conftest*
11327   echo "$ac_t""2" 1>&6; dbfunc=db_open
11328 else
11329   rm -rf conftest*
11330   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11331 fi
11332 rm -f conftest*
11333
11334     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11335 echo "configure:11336: checking for $dbfunc" >&5
11336
11337 cat > conftest.$ac_ext <<EOF
11338 #line 11339 "configure"
11339 #include "confdefs.h"
11340 /* System header to define __stub macros and hopefully few prototypes,
11341     which can conflict with char $dbfunc(); below.  */
11342 #include <assert.h>
11343 /* Override any gcc2 internal prototype to avoid an error.  */
11344 /* We use char because int might match the return type of a gcc2
11345     builtin and then its argument prototype would still apply.  */
11346 char $dbfunc();
11347
11348 int main() {
11349
11350 /* The GNU C library defines this for functions which it implements
11351     to always fail with ENOSYS.  Some functions are actually named
11352     something starting with __ and the normal name is an alias.  */
11353 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11354 choke me
11355 #else
11356 $dbfunc();
11357 #endif
11358
11359 ; return 0; }
11360 EOF
11361 if { (eval echo configure:11362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11362   rm -rf conftest*
11363   eval "ac_cv_func_$dbfunc=yes"
11364 else
11365   echo "configure: failed program was:" >&5
11366   cat conftest.$ac_ext >&5
11367   rm -rf conftest*
11368   eval "ac_cv_func_$dbfunc=no"
11369 fi
11370 rm -f conftest*
11371
11372 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11373   echo "$ac_t""yes" 1>&6
11374   with_database_berkdb=yes need_libdb=no
11375 else
11376   echo "$ac_t""no" 1>&6
11377
11378     
11379 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11380 echo "configure:11381: checking for $dbfunc in -ldb" >&5
11381 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11382
11383 xe_check_libs=" -ldb "
11384 cat > conftest.$ac_ext <<EOF
11385 #line 11386 "configure"
11386 #include "confdefs.h"
11387 /* Override any gcc2 internal prototype to avoid an error.  */
11388 /* We use char because int might match the return type of a gcc2
11389     builtin and then its argument prototype would still apply.  */
11390 char $dbfunc();
11391
11392 int main() {
11393 $dbfunc()
11394 ; return 0; }
11395 EOF
11396 if { (eval echo configure:11397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11397   rm -rf conftest*
11398   eval "ac_cv_lib_$ac_lib_var=yes"
11399 else
11400   echo "configure: failed program was:" >&5
11401   cat conftest.$ac_ext >&5
11402   rm -rf conftest*
11403   eval "ac_cv_lib_$ac_lib_var=no"
11404 fi
11405 rm -f conftest*
11406 xe_check_libs=""
11407
11408 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11409   echo "$ac_t""yes" 1>&6
11410   with_database_berkdb=yes need_libdb=yes
11411 else
11412   echo "$ac_t""no" 1>&6
11413 fi
11414
11415
11416 fi
11417
11418   fi
11419
11420   if test "$with_database_berkdb" = "yes"; then
11421     { test "$extra_verbose" = "yes" && cat << EOF
11422     Defining DB_H_PATH = "$db_h_path"
11423 EOF
11424 cat >> confdefs.h <<EOF
11425 #define DB_H_PATH "$db_h_path"
11426 EOF
11427 }
11428
11429     { test "$extra_verbose" = "yes" && cat << \EOF
11430     Defining HAVE_BERKELEY_DB
11431 EOF
11432 cat >> confdefs.h <<\EOF
11433 #define HAVE_BERKELEY_DB 1
11434 EOF
11435 }
11436
11437     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11438   else with_database_berkdb=no
11439   fi
11440 fi
11441
11442 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11443      != "no no no"; then
11444   { test "$extra_verbose" = "yes" && cat << \EOF
11445     Defining HAVE_DATABASE
11446 EOF
11447 cat >> confdefs.h <<\EOF
11448 #define HAVE_DATABASE 1
11449 EOF
11450 }
11451
11452   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11453    echo "    xemacs will be linked with \"database.o\""
11454  fi
11455 fi
11456
11457 if test "$with_socks" = "yes"; then
11458   
11459 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11460 echo "configure:11461: checking for SOCKSinit in -lsocks" >&5
11461 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11462
11463 xe_check_libs=" -lsocks "
11464 cat > conftest.$ac_ext <<EOF
11465 #line 11466 "configure"
11466 #include "confdefs.h"
11467 /* Override any gcc2 internal prototype to avoid an error.  */
11468 /* We use char because int might match the return type of a gcc2
11469     builtin and then its argument prototype would still apply.  */
11470 char SOCKSinit();
11471
11472 int main() {
11473 SOCKSinit()
11474 ; return 0; }
11475 EOF
11476 if { (eval echo configure:11477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11477   rm -rf conftest*
11478   eval "ac_cv_lib_$ac_lib_var=yes"
11479 else
11480   echo "configure: failed program was:" >&5
11481   cat conftest.$ac_ext >&5
11482   rm -rf conftest*
11483   eval "ac_cv_lib_$ac_lib_var=no"
11484 fi
11485 rm -f conftest*
11486 xe_check_libs=""
11487
11488 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11489   echo "$ac_t""yes" 1>&6
11490     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11491     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11492   { test "$extra_verbose" = "yes" && cat << EOF
11493     Defining $ac_tr_lib
11494 EOF
11495 cat >> confdefs.h <<EOF
11496 #define $ac_tr_lib 1
11497 EOF
11498 }
11499
11500   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11501
11502 else
11503   echo "$ac_t""no" 1>&6
11504 fi
11505
11506
11507   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11508     Defining HAVE_SOCKS
11509 EOF
11510 cat >> confdefs.h <<\EOF
11511 #define HAVE_SOCKS 1
11512 EOF
11513 }
11514
11515 fi
11516
11517 if test "$usage_tracking" = "yes"; then
11518   { test "$extra_verbose" = "yes" && cat << \EOF
11519     Defining USAGE_TRACKING
11520 EOF
11521 cat >> confdefs.h <<\EOF
11522 #define USAGE_TRACKING 1
11523 EOF
11524 }
11525
11526   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11527 fi
11528
11529 for ac_hdr in dlfcn.h
11530 do
11531 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11532 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11533 echo "configure:11534: checking for $ac_hdr" >&5
11534
11535 cat > conftest.$ac_ext <<EOF
11536 #line 11537 "configure"
11537 #include "confdefs.h"
11538 #include <$ac_hdr>
11539 EOF
11540 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11541 { (eval echo configure:11542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11542 ac_err=`grep -v '^ *+' conftest.out`
11543 if test -z "$ac_err"; then
11544   rm -rf conftest*
11545   eval "ac_cv_header_$ac_safe=yes"
11546 else
11547   echo "$ac_err" >&5
11548   echo "configure: failed program was:" >&5
11549   cat conftest.$ac_ext >&5
11550   rm -rf conftest*
11551   eval "ac_cv_header_$ac_safe=no"
11552 fi
11553 rm -f conftest*
11554 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11555   echo "$ac_t""yes" 1>&6
11556     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11557   { test "$extra_verbose" = "yes" && cat << EOF
11558     Defining $ac_tr_hdr
11559 EOF
11560 cat >> confdefs.h <<EOF
11561 #define $ac_tr_hdr 1
11562 EOF
11563 }
11564  have_dlfcn=yes
11565   { test "$extra_verbose" = "yes" && cat << \EOF
11566     Defining HAVE_DLFCN_H
11567 EOF
11568 cat >> confdefs.h <<\EOF
11569 #define HAVE_DLFCN_H 1
11570 EOF
11571 }
11572
11573 else
11574   echo "$ac_t""no" 1>&6
11575 fi
11576 done
11577
11578 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11579 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11580 echo "configure:11581: checking for dlopen in -ldl" >&5
11581 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11582
11583 xe_check_libs=" -ldl "
11584 cat > conftest.$ac_ext <<EOF
11585 #line 11586 "configure"
11586 #include "confdefs.h"
11587 /* Override any gcc2 internal prototype to avoid an error.  */
11588 /* We use char because int might match the return type of a gcc2
11589     builtin and then its argument prototype would still apply.  */
11590 char dlopen();
11591
11592 int main() {
11593 dlopen()
11594 ; return 0; }
11595 EOF
11596 if { (eval echo configure:11597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11597   rm -rf conftest*
11598   eval "ac_cv_lib_$ac_lib_var=yes"
11599 else
11600   echo "configure: failed program was:" >&5
11601   cat conftest.$ac_ext >&5
11602   rm -rf conftest*
11603   eval "ac_cv_lib_$ac_lib_var=no"
11604 fi
11605 rm -f conftest*
11606 xe_check_libs=""
11607
11608 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11609   echo "$ac_t""yes" 1>&6
11610   { test "$extra_verbose" = "yes" && cat << \EOF
11611     Defining HAVE_DLOPEN
11612 EOF
11613 cat >> confdefs.h <<\EOF
11614 #define HAVE_DLOPEN 1
11615 EOF
11616 }
11617  DLL_LIB=dl;  with_shlib=yes
11618 else
11619   echo "$ac_t""no" 1>&6
11620 fi
11621
11622  }
11623 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11624 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11625 echo "configure:11626: checking for _dlopen in -lc" >&5
11626 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11627
11628 xe_check_libs=" -lc "
11629 cat > conftest.$ac_ext <<EOF
11630 #line 11631 "configure"
11631 #include "confdefs.h"
11632 /* Override any gcc2 internal prototype to avoid an error.  */
11633 /* We use char because int might match the return type of a gcc2
11634     builtin and then its argument prototype would still apply.  */
11635 char _dlopen();
11636
11637 int main() {
11638 _dlopen()
11639 ; return 0; }
11640 EOF
11641 if { (eval echo configure:11642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11642   rm -rf conftest*
11643   eval "ac_cv_lib_$ac_lib_var=yes"
11644 else
11645   echo "configure: failed program was:" >&5
11646   cat conftest.$ac_ext >&5
11647   rm -rf conftest*
11648   eval "ac_cv_lib_$ac_lib_var=no"
11649 fi
11650 rm -f conftest*
11651 xe_check_libs=""
11652
11653 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11654   echo "$ac_t""yes" 1>&6
11655   { test "$extra_verbose" = "yes" && cat << \EOF
11656     Defining HAVE_DLOPEN
11657 EOF
11658 cat >> confdefs.h <<\EOF
11659 #define HAVE_DLOPEN 1
11660 EOF
11661 }
11662  DLL_LIB=;   with_shlib=yes
11663 else
11664   echo "$ac_t""no" 1>&6
11665 fi
11666
11667  }
11668 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11669 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11670 echo "configure:11671: checking for dlopen in -lc" >&5
11671 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11672
11673 xe_check_libs=" -lc "
11674 cat > conftest.$ac_ext <<EOF
11675 #line 11676 "configure"
11676 #include "confdefs.h"
11677 /* Override any gcc2 internal prototype to avoid an error.  */
11678 /* We use char because int might match the return type of a gcc2
11679     builtin and then its argument prototype would still apply.  */
11680 char dlopen();
11681
11682 int main() {
11683 dlopen()
11684 ; return 0; }
11685 EOF
11686 if { (eval echo configure:11687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11687   rm -rf conftest*
11688   eval "ac_cv_lib_$ac_lib_var=yes"
11689 else
11690   echo "configure: failed program was:" >&5
11691   cat conftest.$ac_ext >&5
11692   rm -rf conftest*
11693   eval "ac_cv_lib_$ac_lib_var=no"
11694 fi
11695 rm -f conftest*
11696 xe_check_libs=""
11697
11698 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11699   echo "$ac_t""yes" 1>&6
11700   { test "$extra_verbose" = "yes" && cat << \EOF
11701     Defining HAVE_DLOPEN
11702 EOF
11703 cat >> confdefs.h <<\EOF
11704 #define HAVE_DLOPEN 1
11705 EOF
11706 }
11707  DLL_LIB=;   with_shlib=yes
11708 else
11709   echo "$ac_t""no" 1>&6
11710 fi
11711
11712  }
11713 test -z "$with_shlib" && { 
11714 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11715 echo "configure:11716: checking for shl_load in -ldld" >&5
11716 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11717
11718 xe_check_libs=" -ldld "
11719 cat > conftest.$ac_ext <<EOF
11720 #line 11721 "configure"
11721 #include "confdefs.h"
11722 /* Override any gcc2 internal prototype to avoid an error.  */
11723 /* We use char because int might match the return type of a gcc2
11724     builtin and then its argument prototype would still apply.  */
11725 char shl_load();
11726
11727 int main() {
11728 shl_load()
11729 ; return 0; }
11730 EOF
11731 if { (eval echo configure:11732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11732   rm -rf conftest*
11733   eval "ac_cv_lib_$ac_lib_var=yes"
11734 else
11735   echo "configure: failed program was:" >&5
11736   cat conftest.$ac_ext >&5
11737   rm -rf conftest*
11738   eval "ac_cv_lib_$ac_lib_var=no"
11739 fi
11740 rm -f conftest*
11741 xe_check_libs=""
11742
11743 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11744   echo "$ac_t""yes" 1>&6
11745   { test "$extra_verbose" = "yes" && cat << \EOF
11746     Defining HAVE_SHL_LOAD
11747 EOF
11748 cat >> confdefs.h <<\EOF
11749 #define HAVE_SHL_LOAD 1
11750 EOF
11751 }
11752  DLL_LIB=dld; with_shlib=yes
11753 else
11754   echo "$ac_t""no" 1>&6
11755 fi
11756
11757  }
11758 test -z "$with_shlib" && { 
11759 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11760 echo "configure:11761: checking for dld_init in -ldld" >&5
11761 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11762
11763 xe_check_libs=" -ldld "
11764 cat > conftest.$ac_ext <<EOF
11765 #line 11766 "configure"
11766 #include "confdefs.h"
11767 /* Override any gcc2 internal prototype to avoid an error.  */
11768 /* We use char because int might match the return type of a gcc2
11769     builtin and then its argument prototype would still apply.  */
11770 char dld_init();
11771
11772 int main() {
11773 dld_init()
11774 ; return 0; }
11775 EOF
11776 if { (eval echo configure:11777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11777   rm -rf conftest*
11778   eval "ac_cv_lib_$ac_lib_var=yes"
11779 else
11780   echo "configure: failed program was:" >&5
11781   cat conftest.$ac_ext >&5
11782   rm -rf conftest*
11783   eval "ac_cv_lib_$ac_lib_var=no"
11784 fi
11785 rm -f conftest*
11786 xe_check_libs=""
11787
11788 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11789   echo "$ac_t""yes" 1>&6
11790   { test "$extra_verbose" = "yes" && cat << \EOF
11791     Defining HAVE_DLD_INIT
11792 EOF
11793 cat >> confdefs.h <<\EOF
11794 #define HAVE_DLD_INIT 1
11795 EOF
11796 }
11797  DLL_LIB=dld; with_shlib=yes
11798 else
11799   echo "$ac_t""no" 1>&6
11800 fi
11801
11802  }
11803 if test "$with_shlib" = "yes"; then
11804   
11805 dll_ld=
11806 dll_ldflags=
11807 dll_cflags=
11808 dll_post=
11809 dll_ldo="-o"
11810 ld_dynamic_link_flags=
11811 xehost=$canonical
11812 xealias=$internal_configuration
11813
11814 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
11815 echo "configure:11816: checking how to build dynamic libraries for ${xehost}" >&5
11816 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
11817 case "$xehost" in
11818 *-*-linux-gnu*) ;;
11819 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
11820 esac
11821
11822 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
11823 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
11824 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
11825
11826 case "$xehost_os" in
11827 aix3*)
11828   # AIX sometimes has problems with the GCC collect2 program.  For some
11829   # reason, if we set the COLLECT_NAMES environment variable, the problems
11830   # vanish in a puff of smoke.
11831   if test "${COLLECT_NAMES+set}" != set; then
11832     COLLECT_NAMES=
11833     export COLLECT_NAMES
11834   fi
11835   ;;
11836 esac
11837
11838 # Now see if the compiler is really GCC.
11839 if test "$GCC" = "yes"; then
11840   XEGCC=yes
11841 else
11842   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
11843 echo "configure:11844: checking checking whether we are using GNU C" >&5
11844   cat > conftest.$ac_ext <<EOF
11845 #line 11846 "configure"
11846 #include "confdefs.h"
11847
11848 #ifdef __GNUC__
11849   yes;
11850 #endif
11851
11852 EOF
11853 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11854   egrep "yes" >/dev/null 2>&1; then
11855   rm -rf conftest*
11856   XEGCC=yes
11857 else
11858   rm -rf conftest*
11859   XEGCC=no
11860 fi
11861 rm -f conftest*
11862
11863   echo "$ac_t""${XEGCC}" 1>&6
11864 fi
11865
11866 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
11867 echo "configure:11868: checking how to produce PIC code" >&5
11868 wl=
11869
11870 can_build_shared=yes
11871 if test "$XEGCC" = yes; then
11872   wl='-Wl,'
11873
11874   case "$xehost_os" in
11875   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
11876     # PIC is the default for these OSes.
11877     ;;
11878
11879   os2*)
11880     # We can build DLLs from non-PIC.
11881     ;;
11882   amigaos*)
11883     # FIXME: we need at least 68020 code to build shared libraries, but
11884     # adding the `-m68020' flag to GCC prevents building anything better,
11885     # like `-m68040'.
11886     dll_cflags='-m68020 -resident32 -malways-restore-a4'
11887     ;;
11888   *)
11889     dll_cflags='-fPIC'
11890     ;;
11891   esac
11892 else
11893   # PORTME Check for PIC flags for the system compiler.
11894   case "$xehost_os" in
11895   hpux9* | hpux10*)
11896     # Is there a better link_static_flag that works with the bundled CC?
11897     wl='-Wl,'
11898     dll_cflags='+Z'
11899     ;;
11900
11901   irix5* | irix6*)
11902     wl='-Wl,'
11903     # PIC (with -KPIC) is the default.
11904     ;;
11905
11906   os2*)
11907     # We can build DLLs from non-PIC.
11908     ;;
11909
11910   osf3* | osf4*)
11911     # All OSF/1 code is PIC.
11912     wl='-Wl,'
11913     ;;
11914
11915   sco3.2v5*)
11916     dll_cflags='-belf -Kpic'
11917     wl='-Wl,'
11918     ;;
11919
11920   unixware*)
11921     dll_cflags="-KPIC"
11922     wl="-Wl,"
11923     ;;
11924
11925   sysv4*)
11926     dll_cflags="-KPIC"
11927     wl="-Wl,"
11928     ;;
11929
11930   sysv5*)
11931     dll_cflags="-KPIC"
11932     wl="-Wl,"
11933     ;;
11934
11935   solaris2*)
11936     dll_cflags='-KPIC'
11937     wl='-Wl,'
11938     ;;
11939
11940   sunos4*)
11941     dll_cflags='-PIC'
11942     wl='-Qoption ld '
11943     ;;
11944
11945   uts4*)
11946     dll_cflags='-pic'
11947     ;;
11948
11949   *)
11950     can_build_shared=no
11951     ;;
11952   esac
11953 fi
11954
11955 if test -n "$dll_cflags"; then
11956   echo "$ac_t""${dll_cflags}" 1>&6
11957   
11958   # Check to make sure the dll_cflags actually works.
11959   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
11960 echo "configure:11961: checking if PIC flag ${dll_cflags} really works" >&5
11961   save_CFLAGS="$CFLAGS"
11962   CFLAGS="$CFLAGS $dll_cflags -DPIC"
11963   cat > conftest.$ac_ext <<EOF
11964 #line 11965 "configure"
11965 #include "confdefs.h"
11966
11967 int main() {
11968 int x=0;
11969 ; return 0; }
11970 EOF
11971 if { (eval echo configure:11972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11972   rm -rf conftest*
11973   
11974     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
11975     # reports no error.  So, we need to grep stderr for (Bundled).
11976     if grep '(Bundled)' config.log >/dev/null; then
11977       echo "$ac_t""no" 1>&6
11978       can_build_shared=no
11979       dll_cflags=
11980     else
11981       echo "$ac_t""yes" 1>&6
11982     fi
11983 else
11984   echo "configure: failed program was:" >&5
11985   cat conftest.$ac_ext >&5
11986   rm -rf conftest*
11987   echo "$ac_t""no" 1>&6
11988     can_build_shared=no
11989     dll_cflags=
11990 fi
11991 rm -f conftest*
11992   CFLAGS="$save_CFLAGS"
11993 else
11994   echo "$ac_t""none" 1>&6
11995 fi
11996
11997 if test "$can_build_shared" = "yes"; then
11998 cc_produces_so=no
11999 xldf=
12000 xcldf=
12001 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12002 echo "configure:12003: checking if C compiler can produce shared libraries" >&5
12003 if test "$XEGCC" = yes; then
12004   xcldf="-shared"
12005   xldf="-shared"
12006 else # Not using GCC
12007   case "$xehost_os" in
12008     aix3* | aix4*)
12009       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12010       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12011       ;;
12012
12013     freebsd2* | netbsd* | openbsd*)
12014       xldf="-Bshareable"
12015       xcldf="${wl}-Bshareable"
12016       ;;
12017
12018     freebsd3*)
12019       xcldf="-shared"
12020       ;;
12021
12022     hpux*)
12023       xldf="-b +s"
12024       xcldf="${wl}-b ${wl}+s"
12025       ;;
12026
12027     irix5* | irix6* | osf3* | osf4*)
12028       xcldf="${wl}-shared"
12029       xldf="-shared"
12030       ;;
12031
12032     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12033       xcldf="-G"
12034       xldf="-G"
12035       ;;
12036
12037     sunos4*)
12038       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12039       xldf="-assert pure-text -Bstatic"
12040       ;;
12041   esac
12042 fi # End if if we are using gcc
12043
12044 if test -n "$xcldf"; then
12045   save_LDFLAGS=$LDFLAGS
12046   save_LIBS=$LIBS
12047   save_xe_libs=$xe_libs
12048   LDFLAGS="$xcldf $LDFLAGS"
12049   LIBS=
12050   xe_libs=
12051   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12052   cat > conftest.$ac_ext <<EOF
12053 #line 12054 "configure"
12054 #include "confdefs.h"
12055
12056 int main() {
12057 int x=0;
12058 ; return 0; }
12059 EOF
12060 if { (eval echo configure:12061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12061   rm -rf conftest*
12062   cc_produces_so=yes
12063 else
12064   echo "configure: failed program was:" >&5
12065   cat conftest.$ac_ext >&5
12066   rm -rf conftest*
12067   cc_produces_so=no
12068 fi
12069 rm -f conftest*
12070   LDFLAGS=$save_LDFLAGS
12071   LIBS=$save_LIBS
12072   xe_libs=$save_xe_libs
12073   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12074 else
12075   cc_produces_so=no
12076 fi
12077 echo "$ac_t""${cc_produces_so}" 1>&6
12078
12079 LTLD=$LD
12080 if test -z "$LTLD"; then
12081   ac_prog=ld
12082   if test "$XEGCC" = yes; then
12083     # Check if gcc -print-prog-name=ld gives a path.
12084     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12085 echo "configure:12086: checking for ld used by GCC" >&5
12086     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12087     case "$ac_prog" in
12088     # Accept absolute paths.
12089     /*)
12090       if test -z "$LTLD"; then
12091         case "$ac_prog" in
12092           *gcc-lib*) LTLD="$CC"
12093                      ;;
12094           *)         LTLD="$ac_prog"
12095                      ;;
12096         esac
12097       fi
12098       ;;
12099     "")
12100       # If it fails, then pretend we aren't using GCC.
12101       ac_prog=ld
12102       ;;
12103     *)
12104       # If it is relative, then search for the first ld in PATH.
12105       with_gnu_ld=unknown
12106       ;;
12107     esac
12108   else
12109     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12110 echo "configure:12111: checking for GNU ld" >&5
12111   fi
12112
12113   if test -z "$LTLD"; then
12114     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12115     for ac_dir in $PATH; do
12116       test -z "$ac_dir" && ac_dir=.
12117       if test -f "$ac_dir/$ac_prog"; then
12118         LTLD="$ac_dir/$ac_prog"
12119         # Check to see if the program is GNU ld.  I'd rather use --version,
12120         # but apparently some GNU ld's only accept -v.
12121         # Break only if it was the GNU/non-GNU ld that we prefer.
12122         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12123           xe_gnu_ld=yes
12124         else
12125           xe_gnu_ld=no
12126         fi
12127       fi
12128     done
12129     IFS="$ac_save_ifs"
12130   fi
12131
12132   if test -n "$LTLD"; then
12133     echo "$ac_t""${LTLD}" 1>&6
12134   else
12135     echo "$ac_t""no" 1>&6
12136   fi
12137
12138   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12139     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12140     exit 1
12141   fi
12142 fi
12143
12144 ld_dynamic_link_flags=
12145
12146 # Check to see if it really is or isn't GNU ld.
12147 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12148 echo "configure:12149: checking if the linker is GNU ld" >&5
12149 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12150 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12151   xe_gnu_ld=yes
12152 else
12153   xe_gnu_ld=no
12154 fi
12155 echo "$ac_t""${xe_gnu_ld}" 1>&6
12156
12157 case "$xehost_os" in
12158   amigaos* | sunos4*)
12159     # On these operating systems, we should treat GNU ld like the system ld.
12160     gnu_ld_acts_native=yes
12161     ;;
12162   *)
12163     gnu_ld_acts_native=no
12164     ;;
12165 esac
12166
12167 if test "$cc_produces_so" = "yes"; then
12168   dll_ld=$CC
12169   dll_ldflags=$xcldf
12170   can_build_shared=yes
12171 else
12172   # OK - only NOW do we futz about with ld.
12173   # See if the linker supports building shared libraries.
12174   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12175 echo "configure:12176: checking whether the linker supports shared libraries" >&5
12176   dll_ld=$CC
12177   dll_ldflags=$LDFLAGS
12178   ld_shlibs=yes
12179   can_build_shared=yes
12180   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12181     # See if GNU ld supports shared libraries.
12182     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12183       dll_ld=$CC
12184       dll_ldflags="-shared"
12185       ld_shlibs=yes
12186     else
12187       ld_shlibs=no
12188     fi
12189   else
12190     # PORTME fill in a description of your system's linker (not GNU ld)
12191     case "$xehost_os" in
12192     aix3*)
12193       dll_ld=$LTLD
12194       dll_ldflags=$xldf
12195       ;;
12196
12197     aix4*)
12198       dll_ldflags=$xcldf
12199       ;;
12200
12201     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12202     # support.  Future versions do this automatically, but an explicit c++rt0.o
12203     # doesn't break anything, and helps significantly (at the cost of a little
12204     # extra space).
12205     freebsd2.2*)
12206       dll_ld=$LTLD
12207       dll_ldflags=$xldf
12208       dll_post="/usr/lib/c++rt0.o"
12209       ;;
12210
12211     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12212     freebsd2*)
12213       dll_ld=$LTLD
12214       dll_ldflags="-Bshareable"
12215       ;;
12216
12217     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12218     freebsd3*)
12219       dll_ldflags="-shared"
12220       ;;
12221
12222     hpux*)
12223       dll_ld=$LTLD
12224       dll_ldflags=$xldf
12225       ;;
12226
12227     irix5* | irix6*)
12228       dll_ld=$LTLD
12229       dll_ldflags=$xldf
12230       ;;
12231
12232     netbsd*)
12233       # Tested with NetBSD 1.2 ld
12234       dll_ld=$LTLD
12235       dll_ldflags=$xldf
12236       ;;
12237
12238     openbsd*)
12239       dll_ld=$LTLD
12240       dll_ldflags=$xldf
12241       ;;
12242
12243     osf3* | osf4*)
12244       dll_ld=$LTLD
12245       dll_ldflags=$xldf
12246       ;;
12247
12248     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12249     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12250       dll_ld=$LTLD
12251       case "$dll_ld" in
12252         *gcc*) dll_ldflags="-shared"
12253                dll_ld=$CC
12254                ;;
12255         *)     dll_ldflags="-G"
12256                ;;
12257       esac
12258       ;;
12259
12260     sunos4*)
12261       if test "$XEGCC" = yes; then
12262         dll_ld=$CC
12263       else
12264         dll_ld=$LTLD
12265       fi
12266       dll_ldflags=$xldf
12267       ;;
12268
12269     uts4*)
12270       dll_ld=$LTLD
12271       dll_ldflags="-G"
12272       ;;
12273
12274     bsdi*)
12275       dll_ldflags="-r"
12276       dll_ld="shlicc2"
12277       ;;
12278
12279     *)
12280       ld_shlibs=no
12281       can_build_shared=no
12282       ;;
12283     esac
12284   fi
12285   echo "$ac_t""${ld_shlibs}" 1>&6
12286   if test "$ld_shlibs" = "no"; then
12287     can_build_shared=no
12288   fi
12289 fi # End of if cc_produces_so = no
12290
12291
12292 if test "$xe_gnu_ld" = yes; then
12293   if test "$ld_shlibs" = yes; then
12294     ld_dynamic_link_flags="${wl}-export-dynamic"
12295   fi
12296 fi
12297
12298 if test -z "$ld_dynamic_link_flags"; then
12299   case "$xehost_os" in
12300   aix3*)
12301     ld_dynamic_link_flags=
12302     ;;
12303
12304   aix4*)
12305     ld_dynamic_link_flags=
12306     ;;
12307
12308   freebsd2.2*)
12309     ld_dynamic_link_flags=
12310     ;;
12311
12312   freebsd2*)
12313     ld_dynamic_link_flags=
12314     ;;
12315
12316   freebsd3*)
12317     ld_dynamic_link_flags=
12318     ;;
12319
12320   hpux*)
12321     ld_dynamic_link_flags="${wl}-E"
12322     ;;
12323
12324   irix5* | irix6*)
12325     ld_dynamic_link_flags=
12326     ;;
12327
12328   netbsd*)
12329     ld_dynamic_link_flags=
12330     ;;
12331
12332   openbsd*)
12333     ld_dynamic_link_flags=
12334     ;;
12335
12336   osf3* | osf4*)
12337     ld_dynamic_link_flags=
12338     ;;
12339
12340   solaris2* | solaris7*)
12341     ld_dynamic_link_flags="${wl}-Bdynamic"
12342     ;;
12343
12344   sco3.2v5* | unixware* | sysv5* | sysv4*)
12345     ld_dynamic_link_flags="${wl}-Bexport"
12346     ;;
12347
12348   sunos4*)
12349     ld_dynamic_link_flags=
12350     ;;
12351
12352   uts4*)
12353     ld_dynamic_link_flags=
12354     ;;
12355
12356   bsdi*)
12357     ld_dynamic_link_flags=
12358     ;;
12359
12360   esac
12361 fi # End of if -z ld_dynamic_link_flags
12362 fi # End of if test "$can_build_shared" = "yes"
12363
12364
12365
12366
12367
12368
12369
12370
12371   if test "$can_build_shared" = "yes"; then
12372     { test "$extra_verbose" = "yes" && cat << \EOF
12373     Defining HAVE_SHLIB
12374 EOF
12375 cat >> confdefs.h <<\EOF
12376 #define HAVE_SHLIB 1
12377 EOF
12378 }
12379
12380     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12381    echo "    xemacs will be linked with \"sysdll.o\""
12382  fi
12383     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12384    echo "    xemacs will be linked with \"emodules.o\""
12385  fi
12386     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12387     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12388     for ac_func in dlerror _dlerror
12389 do
12390 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12391 echo "configure:12392: checking for $ac_func" >&5
12392
12393 cat > conftest.$ac_ext <<EOF
12394 #line 12395 "configure"
12395 #include "confdefs.h"
12396 /* System header to define __stub macros and hopefully few prototypes,
12397     which can conflict with char $ac_func(); below.  */
12398 #include <assert.h>
12399 /* Override any gcc2 internal prototype to avoid an error.  */
12400 /* We use char because int might match the return type of a gcc2
12401     builtin and then its argument prototype would still apply.  */
12402 char $ac_func();
12403
12404 int main() {
12405
12406 /* The GNU C library defines this for functions which it implements
12407     to always fail with ENOSYS.  Some functions are actually named
12408     something starting with __ and the normal name is an alias.  */
12409 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12410 choke me
12411 #else
12412 $ac_func();
12413 #endif
12414
12415 ; return 0; }
12416 EOF
12417 if { (eval echo configure:12418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12418   rm -rf conftest*
12419   eval "ac_cv_func_$ac_func=yes"
12420 else
12421   echo "configure: failed program was:" >&5
12422   cat conftest.$ac_ext >&5
12423   rm -rf conftest*
12424   eval "ac_cv_func_$ac_func=no"
12425 fi
12426 rm -f conftest*
12427
12428 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12429   echo "$ac_t""yes" 1>&6
12430     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12431   { test "$extra_verbose" = "yes" && cat << EOF
12432     Defining $ac_tr_func
12433 EOF
12434 cat >> confdefs.h <<EOF
12435 #define $ac_tr_func 1
12436 EOF
12437 }
12438  
12439 else
12440   echo "$ac_t""no" 1>&6
12441 fi
12442 done
12443
12444   else
12445     echo "configure: warning: disabling shared library support" 1>&2
12446     with_shlib=no
12447   fi
12448 fi
12449
12450 cat > conftest.$ac_ext <<EOF
12451 #line 12452 "configure"
12452 #include "confdefs.h"
12453 int main(int c,char *v[]){return 0;}
12454 EOF
12455 if { (eval echo configure:12456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12456 then
12457   :
12458 else
12459   conftest_rc="$?"
12460   echo "configure: failed program was:" >&5
12461   cat conftest.$ac_ext >&5
12462   rm -fr conftest*
12463   
12464   echo ""
12465   echo "*** PANIC *** The C compiler can no longer build working executables."
12466   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12467   echo "*** PANIC *** The most likely reason for this problem is that configure"
12468   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12469   echo "*** PANIC *** found at run time."
12470   echo "*** PANIC ***"
12471   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12472   echo "*** PANIC *** On other systems, try telling configure where to find the"
12473   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12474   echo "*** PANIC ***"
12475   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12476   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12477   echo "*** PANIC *** on your system.  Don't do that."
12478   exit 1
12479 fi
12480 rm -fr conftest*
12481
12482 if test "$win32_processes" = "yes"; then
12483   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12484    echo "    xemacs will be linked with \"process-nt.o\""
12485  fi
12486 else
12487   { test "$extra_verbose" = "yes" && cat << \EOF
12488     Defining HAVE_UNIX_PROCESSES
12489 EOF
12490 cat >> confdefs.h <<\EOF
12491 #define HAVE_UNIX_PROCESSES 1
12492 EOF
12493 }
12494
12495   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12496    echo "    xemacs will be linked with \"process-unix.o\""
12497  fi
12498 fi
12499
12500
12501
12502 T=""
12503 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12504 CFLAGS="$T"
12505
12506
12507 T=""
12508 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12509 extra_objs="$T"
12510
12511
12512 T=""
12513 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
12514 c_switch_general="$T"
12515
12516
12517 T=""
12518 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12519 c_switch_window_system="$T"
12520
12521
12522 T=""
12523 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12524 c_switch_all="$T"
12525
12526
12527 T=""
12528 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
12529 ld_switch_general="$T"
12530
12531
12532 T=""
12533 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12534 ld_switch_window_system="$T"
12535
12536
12537 T=""
12538 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12539 ld_switch_all="$T"
12540
12541
12542 T=""
12543 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12544 ld_libs_general="$T"
12545
12546
12547 T=""
12548 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
12549 ld_libs_window_system="$T"
12550
12551
12552 T=""
12553 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12554 ld_libs_all="$T"
12555
12556
12557
12558 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12559 internal_makefile_list="Makefile.in"
12560 SUBDIR_MAKEFILES=''
12561 test -d lock || mkdir lock
12562 for dir in $MAKE_SUBDIR; do
12563   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12564         test -d "$d" || mkdir "$d"; cd "$d"
12565       done ) ;;
12566    * ) test -d "$dir" || mkdir "$dir" ;;
12567   esac
12568   
12569 T=""
12570 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12571 SUBDIR_MAKEFILES="$T"
12572
12573   
12574 T=""
12575 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12576 internal_makefile_list="$T"
12577
12578 done
12579
12580
12581
12582
12583 for dir in src/s src/m; do
12584   if test ! -d "$dir" ; then
12585     echo Making symbolic link to "$srcdir/$dir"
12586     ${LN_S} "$srcdir/$dir" "$dir"
12587   fi
12588 done
12589
12590 if test "$extra_verbose" = "yes"; then
12591   echo ""
12592   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
12593   echo ""
12594 fi
12595
12596 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12597   echo "creating src/gdbinit"; echo ""
12598   echo "source $srcdir/src/gdbinit" > src/gdbinit
12599 fi
12600
12601 if test "$__SUNPRO_C" = "yes"; then
12602   echo "creating .sbinit"; echo ""
12603   ( echo "# For use with Sun WorkShop's Source browser."
12604     echo "# See sbquery(1) and sbinit(4) for more information"
12605     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12606   ) > .sbinit
12607 fi
12608
12609 rm -f core
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626 PREFIX=$prefix
12627 while true; do
12628   case "$PREFIX" in
12629     *\$* ) eval "PREFIX=$PREFIX" ;;
12630     *) break ;;
12631   esac
12632 done
12633
12634
12635
12636 EXEC_PREFIX=$exec_prefix
12637 while true; do
12638   case "$EXEC_PREFIX" in
12639     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12640     *) break ;;
12641   esac
12642 done
12643
12644
12645
12646
12647 INFODIR=$infodir
12648 while true; do
12649   case "$INFODIR" in
12650     *\$* ) eval "INFODIR=$INFODIR" ;;
12651     *) break ;;
12652   esac
12653 done
12654
12655
12656
12657
12658 INFOPATH=$infopath
12659 while true; do
12660   case "$INFOPATH" in
12661     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12662     *) break ;;
12663   esac
12664 done
12665
12666
12667
12668
12669 PACKAGE_PATH=$package_path
12670 while true; do
12671   case "$PACKAGE_PATH" in
12672     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12673     *) break ;;
12674   esac
12675 done
12676
12677
12678
12679
12680 LISPDIR=$lispdir
12681 while true; do
12682   case "$LISPDIR" in
12683     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12684     *) break ;;
12685   esac
12686 done
12687
12688
12689
12690
12691 MODULEDIR=$moduledir
12692 while true; do
12693   case "$MODULEDIR" in
12694     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12695     *) break ;;
12696   esac
12697 done
12698
12699
12700
12701
12702 SITELISPDIR=$sitelispdir
12703 while true; do
12704   case "$SITELISPDIR" in
12705     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12706     *) break ;;
12707   esac
12708 done
12709
12710
12711
12712
12713 SITEMODULEDIR=$sitemoduledir
12714 while true; do
12715   case "$SITEMODULEDIR" in
12716     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12717     *) break ;;
12718   esac
12719 done
12720
12721
12722
12723
12724 ETCDIR=$etcdir
12725 while true; do
12726   case "$ETCDIR" in
12727     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12728     *) break ;;
12729   esac
12730 done
12731
12732
12733
12734
12735 LOCKDIR=$lockdir
12736 while true; do
12737   case "$LOCKDIR" in
12738     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12739     *) break ;;
12740   esac
12741 done
12742
12743
12744
12745
12746 ARCHLIBDIR=$archlibdir
12747 while true; do
12748   case "$ARCHLIBDIR" in
12749     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12750     *) break ;;
12751   esac
12752 done
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12774
12775
12776
12777
12778
12779
12780
12781 : ${XEMACS_CC:=$CC}
12782
12783
12784
12785 if test "$with_site_lisp" = "no"; then
12786   { test "$extra_verbose" = "yes" && cat << \EOF
12787     Defining INHIBIT_SITE_LISP
12788 EOF
12789 cat >> confdefs.h <<\EOF
12790 #define INHIBIT_SITE_LISP 1
12791 EOF
12792 }
12793
12794 fi
12795 if test "$with_site_modules" = "no"; then
12796   { test "$extra_verbose" = "yes" && cat << \EOF
12797     Defining INHIBIT_SITE_MODULES
12798 EOF
12799 cat >> confdefs.h <<\EOF
12800 #define INHIBIT_SITE_MODULES 1
12801 EOF
12802 }
12803
12804 fi
12805
12806
12807 T=""
12808 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12809 ac_configure_args="$T"
12810
12811 { test "$extra_verbose" = "yes" && cat << EOF
12812     Defining EMACS_CONFIGURATION = "$canonical"
12813 EOF
12814 cat >> confdefs.h <<EOF
12815 #define EMACS_CONFIGURATION "$canonical"
12816 EOF
12817 }
12818
12819 { test "$extra_verbose" = "yes" && cat << EOF
12820     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12821 EOF
12822 cat >> confdefs.h <<EOF
12823 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12824 EOF
12825 }
12826
12827 { test "$extra_verbose" = "yes" && cat << EOF
12828     Defining config_machfile = "$machfile"
12829 EOF
12830 cat >> confdefs.h <<EOF
12831 #define config_machfile "$machfile"
12832 EOF
12833 }
12834
12835 { test "$extra_verbose" = "yes" && cat << EOF
12836     Defining config_opsysfile = "$opsysfile"
12837 EOF
12838 cat >> confdefs.h <<EOF
12839 #define config_opsysfile "$opsysfile"
12840 EOF
12841 }
12842
12843
12844
12845 null_string=""
12846 { test "$extra_verbose" = "yes" && cat << EOF
12847     Defining LD_SWITCH_X_SITE = $null_string
12848 EOF
12849 cat >> confdefs.h <<EOF
12850 #define LD_SWITCH_X_SITE $null_string
12851 EOF
12852 }
12853
12854 { test "$extra_verbose" = "yes" && cat << EOF
12855     Defining LD_SWITCH_X_SITE_AUX = $null_string
12856 EOF
12857 cat >> confdefs.h <<EOF
12858 #define LD_SWITCH_X_SITE_AUX $null_string
12859 EOF
12860 }
12861
12862 { test "$extra_verbose" = "yes" && cat << EOF
12863     Defining C_SWITCH_X_SITE = $null_string
12864 EOF
12865 cat >> confdefs.h <<EOF
12866 #define C_SWITCH_X_SITE $null_string
12867 EOF
12868 }
12869
12870 { test "$extra_verbose" = "yes" && cat << EOF
12871     Defining LD_SWITCH_SITE = $null_string
12872 EOF
12873 cat >> confdefs.h <<EOF
12874 #define LD_SWITCH_SITE $null_string
12875 EOF
12876 }
12877
12878 { test "$extra_verbose" = "yes" && cat << EOF
12879     Defining C_SWITCH_SITE = $null_string
12880 EOF
12881 cat >> confdefs.h <<EOF
12882 #define C_SWITCH_SITE $null_string
12883 EOF
12884 }
12885
12886
12887
12888 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12889     Defining GNU_MALLOC
12890 EOF
12891 cat >> confdefs.h <<\EOF
12892 #define GNU_MALLOC 1
12893 EOF
12894 }
12895
12896 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12897     Defining USE_SYSTEM_MALLOC
12898 EOF
12899 cat >> confdefs.h <<\EOF
12900 #define USE_SYSTEM_MALLOC 1
12901 EOF
12902 }
12903
12904 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12905     Defining USE_DEBUG_MALLOC
12906 EOF
12907 cat >> confdefs.h <<\EOF
12908 #define USE_DEBUG_MALLOC 1
12909 EOF
12910 }
12911
12912                                               { test "$extra_verbose" = "yes" && cat << \EOF
12913     Defining USE_SYSTEM_MALLOC
12914 EOF
12915 cat >> confdefs.h <<\EOF
12916 #define USE_SYSTEM_MALLOC 1
12917 EOF
12918 }
12919
12920 fi
12921 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12922     Defining I18N3
12923 EOF
12924 cat >> confdefs.h <<\EOF
12925 #define I18N3 1
12926 EOF
12927 }
12928
12929 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12930     Defining USE_GCC
12931 EOF
12932 cat >> confdefs.h <<\EOF
12933 #define USE_GCC 1
12934 EOF
12935 }
12936
12937 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12938     Defining EXTERNAL_WIDGET
12939 EOF
12940 cat >> confdefs.h <<\EOF
12941 #define EXTERNAL_WIDGET 1
12942 EOF
12943 }
12944
12945 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12946     Defining NO_DOC_FILE
12947 EOF
12948 cat >> confdefs.h <<\EOF
12949 #define NO_DOC_FILE 1
12950 EOF
12951 }
12952
12953 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12954     Defining PURIFY
12955 EOF
12956 cat >> confdefs.h <<\EOF
12957 #define PURIFY 1
12958 EOF
12959 }
12960
12961 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12962     Defining QUANTIFY
12963 EOF
12964 cat >> confdefs.h <<\EOF
12965 #define QUANTIFY 1
12966 EOF
12967 }
12968
12969 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12970     Defining MAIL_USE_POP
12971 EOF
12972 cat >> confdefs.h <<\EOF
12973 #define MAIL_USE_POP 1
12974 EOF
12975 }
12976
12977 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12978     Defining KERBEROS
12979 EOF
12980 cat >> confdefs.h <<\EOF
12981 #define KERBEROS 1
12982 EOF
12983 }
12984
12985 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12986     Defining HESIOD
12987 EOF
12988 cat >> confdefs.h <<\EOF
12989 #define HESIOD 1
12990 EOF
12991 }
12992
12993 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
12994     Defining USE_UNION_TYPE
12995 EOF
12996 cat >> confdefs.h <<\EOF
12997 #define USE_UNION_TYPE 1
12998 EOF
12999 }
13000
13001
13002
13003 (
13004 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13005 else
13006   echo "uname -a: `uname -a`"
13007 fi
13008 echo ""
13009 echo "$0 $quoted_arguments"
13010 ) > Installation
13011
13012 xemacs_betaname=""
13013 test ! -z "${emacs_beta_version}" && xemacs_betaname="-b${emacs_beta_version}"
13014
13015 (
13016 echo "
13017
13018 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13019
13020   Where should the build process find the source code?    $srcdir
13021   What installation prefix should install use?            $prefix
13022   What operating system and machine description files should XEmacs use?
13023         \`$opsysfile' and \`$machfile'
13024   What compiler should XEmacs be built with?              $CC $CFLAGS
13025   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13026   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13027   What window system should XEmacs use?                   ${window_system}"
13028 if test "$with_x11" = "yes"; then
13029   echo "  Where do we find X Windows header files?                $x_includes"
13030   echo "  Where do we find X Windows libraries?                   $x_libraries"
13031 fi
13032 if test -n "$site_includes"; then
13033   echo "  Additional header files:                                $site_includes"
13034 fi
13035 if test -n "$site_libraries"; then
13036   echo "  Additional libraries:                                   $site_libraries"
13037 fi
13038 if test -n "$site_prefixes"; then
13039   echo "  Additional prefixes:                                    $site_prefixes"
13040 fi
13041 if test -n "$runpath"; then
13042   echo "  Runtime library search path:                            $runpath"
13043 fi
13044 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13045 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13046 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13047 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13048   echo "  No Xmu; substituting equivalent routines."
13049 fi
13050
13051 if test "$with_xpm" = yes; then
13052   echo "  Compiling in support for XPM images."
13053 elif test "$with_x11" = yes; then
13054   echo "  --------------------------------------------------------------------"
13055   echo "  WARNING: Compiling without XPM support."
13056   if test "$xpm_problem" != ""; then
13057     echo "  Reason: $xpm_problem"
13058   fi
13059   echo "  WARNING: You should strongly consider installing XPM."
13060   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13061   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13062   echo "  --------------------------------------------------------------------"
13063 fi
13064 if test "$with_png" = yes; then
13065   echo "  Compiling in support for PNG image handling."
13066 elif test "$window_system" != "none"; then
13067   echo "  --------------------------------------------------------------------"
13068   echo "  WARNING: Compiling without PNG image support."
13069   if test "$png_problem" != ""; then
13070     echo "  Reason: $png_problem"
13071   fi
13072   echo "  WARNING: You should strongly consider installing the PNG libraries."
13073   echo "  WARNING: Otherwise certain images and glyphs may not display."
13074   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13075   echo "  --------------------------------------------------------------------"
13076 fi
13077 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13078 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13079 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13080 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13081 case "$with_sound" in
13082   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13083   native ) echo "  Compiling in native sound support." ;;
13084   both   ) echo "  Compiling in both network and native sound support." ;;
13085 esac
13086 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13087
13088 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13089 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13090 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13091
13092 test "$with_umich_ldap"      = yes && echo "  Compiling in support for LDAP (UMich libs)."
13093 test "$with_ns_ldap"         = yes && echo "  Compiling in support for LDAP (Netscape SDK)."
13094 test "$with_ldap" = yes -a "$with_umich_ldap" = no -a "$with_ns_ldap" = no && echo "  Compiling in support for LDAP (Generic)."
13095
13096 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13097 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13098
13099 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13100 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13101 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13102 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13103 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13104 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13105 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13106 if test "$with_wnn" = yes; then
13107   echo "  Compiling in support for the WNN input method on Mule."
13108   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13109 fi
13110 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13111
13112 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13113 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13114 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13115 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13116 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13117 test "$with_session"  != no && echo "  Compiling in support for proper session-management."
13118 case "$with_menubars" in
13119   lucid ) echo "  Using Lucid menubars." ;;
13120   motif ) echo "  Using Motif menubars."
13121           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13122           echo "             We recommend using the Lucid menubar instead."
13123           echo "             Re-run configure with --with-menubars='lucid'." ;;
13124 esac
13125 case "$with_scrollbars" in
13126   lucid    ) echo "  Using Lucid scrollbars."     ;;
13127   motif    ) echo "  Using Motif scrollbars."     ;;
13128   athena   ) echo "  Using Athena scrollbars."    ;;
13129   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13130 esac
13131 case "$with_dialogs" in
13132   motif    )
13133     echo "  Using Motif dialog boxes."
13134     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13135       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13136       echo "             We recommend using the Athena dialog boxes instead."
13137       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13138       echo "             Read the PROBLEMS file for more information."
13139     fi; fi
13140     ;;
13141   athena   ) echo "  Using Athena dialog boxes."    ;;
13142   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13143 esac
13144 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
13145 test "$with_clash_detection" = yes && \
13146   echo "  Clash detection will use \"$lockdir\" for locking files."
13147 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13148 test "$with_pop"        = yes && echo "  Using POP for mail access."
13149 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13150 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13151 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13152 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13153 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13154 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13155   != "no no no no no"; then
13156   echo "  WARNING: ---------------------------------------------------------"
13157   echo "  WARNING: Compiling in support for runtime error checking."
13158   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13159   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13160   echo "  WARNING: ---------------------------------------------------------"
13161 fi
13162 echo ""
13163 ) | tee -a Installation
13164 echo ""
13165
13166
13167 # Remove any trailing slashes in these variables.
13168 test -n "$prefix" &&
13169   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13170 test -n "$exec_prefix" &&
13171   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13172
13173
13174 for file in $internal_makefile_list; do
13175   test "$file" = src/Makefile.in && \
13176     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13177   ac_output_files="${ac_output_files+$ac_output_files }$file"
13178 done
13179 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13180 if test "$with_shlib" = "yes"; then
13181   ac_output_files="$ac_output_files lib-src/ellcc.h"
13182 fi
13183
13184 trap '' 1 2 15
13185
13186 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13187
13188 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13189 # Let make expand exec_prefix.
13190 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13191
13192 # Any assignment to VPATH causes Sun make to only execute
13193 # the first set of double-colon rules, so remove it if not needed.
13194 # If there is a colon in the path, we need to keep it.
13195 if test "x$srcdir" = x.; then
13196   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13197 fi
13198
13199 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13200
13201 DEFS=-DHAVE_CONFIG_H
13202
13203 # Without the "./", some shells look in PATH for config.status.
13204 : ${CONFIG_STATUS=./config.status}
13205
13206 echo creating $CONFIG_STATUS
13207 rm -f $CONFIG_STATUS
13208 cat > $CONFIG_STATUS <<EOF
13209 #! /bin/sh
13210 # Generated automatically by configure.
13211 # Run this file to recreate the current configuration.
13212 # This directory was configured as follows,
13213 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13214 #
13215 # $0 $ac_configure_args
13216 #
13217 # Compiler output produced by configure, useful for debugging
13218 # configure, is in ./config.log if it exists.
13219
13220 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13221 for ac_option
13222 do
13223   case "\$ac_option" in
13224   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13225     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13226     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13227   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13228     echo "$CONFIG_STATUS generated by autoconf version 2.12"
13229     exit 0 ;;
13230   -help | --help | --hel | --he | --h)
13231     echo "\$ac_cs_usage"; exit 0 ;;
13232   *) echo "\$ac_cs_usage"; exit 1 ;;
13233   esac
13234 done
13235
13236 ac_given_srcdir=$srcdir
13237 ac_given_INSTALL="$INSTALL"
13238
13239 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13240 EOF
13241 cat >> $CONFIG_STATUS <<EOF
13242
13243 # Protect against being on the right side of a sed subst in config.status.
13244 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13245  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13246 $ac_vpsub
13247 $extrasub
13248 s%@CFLAGS@%$CFLAGS%g
13249 s%@CPPFLAGS@%$CPPFLAGS%g
13250 s%@CXXFLAGS@%$CXXFLAGS%g
13251 s%@DEFS@%$DEFS%g
13252 s%@LDFLAGS@%$LDFLAGS%g
13253 s%@LIBS@%$LIBS%g
13254 s%@exec_prefix@%$exec_prefix%g
13255 s%@prefix@%$prefix%g
13256 s%@program_transform_name@%$program_transform_name%g
13257 s%@bindir@%$bindir%g
13258 s%@sbindir@%$sbindir%g
13259 s%@libexecdir@%$libexecdir%g
13260 s%@datadir@%$datadir%g
13261 s%@sysconfdir@%$sysconfdir%g
13262 s%@sharedstatedir@%$sharedstatedir%g
13263 s%@localstatedir@%$localstatedir%g
13264 s%@libdir@%$libdir%g
13265 s%@includedir@%$includedir%g
13266 s%@oldincludedir@%$oldincludedir%g
13267 s%@infodir@%$infodir%g
13268 s%@mandir@%$mandir%g
13269 s%@LN_S@%$LN_S%g
13270 s%@blddir@%$blddir%g
13271 s%@CC@%$CC%g
13272 s%@CPP@%$CPP%g
13273 s%@start_flags@%$start_flags%g
13274 s%@ld_switch_shared@%$ld_switch_shared%g
13275 s%@start_files@%$start_files%g
13276 s%@ld@%$ld%g
13277 s%@lib_gcc@%$lib_gcc%g
13278 s%@RANLIB@%$RANLIB%g
13279 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13280 s%@INSTALL_DATA@%$INSTALL_DATA%g
13281 s%@YACC@%$YACC%g
13282 s%@SET_MAKE@%$SET_MAKE%g
13283 s%@X_CFLAGS@%$X_CFLAGS%g
13284 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13285 s%@X_LIBS@%$X_LIBS%g
13286 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13287 s%@install_pp@%$install_pp%g
13288 s%@libs_xauth@%$libs_xauth%g
13289 s%@dnd_objs@%$dnd_objs%g
13290 s%@lwlib_objs@%$lwlib_objs%g
13291 s%@ALLOCA@%$ALLOCA%g
13292 s%@dll_ld@%$dll_ld%g
13293 s%@dll_cflags@%$dll_cflags%g
13294 s%@dll_ldflags@%$dll_ldflags%g
13295 s%@dll_post@%$dll_post%g
13296 s%@dll_ldo@%$dll_ldo%g
13297 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13298 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13299 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13300 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13301 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13302 s%@PROGNAME@%$PROGNAME%g
13303 s%@version@%$version%g
13304 s%@configuration@%$configuration%g
13305 s%@canonical@%$canonical%g
13306 s%@srcdir@%$srcdir%g
13307 s%@pkgdir@%$pkgdir%g
13308 s%@statedir@%$statedir%g
13309 s%@PREFIX@%$PREFIX%g
13310 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13311 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13312 s%@INFODIR@%$INFODIR%g
13313 s%@infopath@%$infopath%g
13314 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13315 s%@INFOPATH@%$INFOPATH%g
13316 s%@package_path@%$package_path%g
13317 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13318 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13319 s%@lispdir@%$lispdir%g
13320 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13321 s%@LISPDIR@%$LISPDIR%g
13322 s%@moduledir@%$moduledir%g
13323 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13324 s%@MODULEDIR@%$MODULEDIR%g
13325 s%@sitelispdir@%$sitelispdir%g
13326 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13327 s%@SITELISPDIR@%$SITELISPDIR%g
13328 s%@sitemoduledir@%$sitemoduledir%g
13329 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13330 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13331 s%@etcdir@%$etcdir%g
13332 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13333 s%@ETCDIR@%$ETCDIR%g
13334 s%@lockdir@%$lockdir%g
13335 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13336 s%@LOCKDIR@%$LOCKDIR%g
13337 s%@archlibdir@%$archlibdir%g
13338 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13339 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13340 s%@docdir@%$docdir%g
13341 s%@bitmapdir@%$bitmapdir%g
13342 s%@extra_objs@%$extra_objs%g
13343 s%@machfile@%$machfile%g
13344 s%@opsysfile@%$opsysfile%g
13345 s%@c_switch_general@%$c_switch_general%g
13346 s%@c_switch_window_system@%$c_switch_window_system%g
13347 s%@c_switch_all@%$c_switch_all%g
13348 s%@ld_switch_general@%$ld_switch_general%g
13349 s%@ld_switch_window_system@%$ld_switch_window_system%g
13350 s%@ld_switch_all@%$ld_switch_all%g
13351 s%@ld_libs_general@%$ld_libs_general%g
13352 s%@ld_libs_window_system@%$ld_libs_window_system%g
13353 s%@ld_libs_all@%$ld_libs_all%g
13354 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13355 s%@native_sound_lib@%$native_sound_lib%g
13356 s%@sound_cflags@%$sound_cflags%g
13357 s%@dynodump_arch@%$dynodump_arch%g
13358 s%@XEMACS_CC@%$XEMACS_CC%g
13359 s%@internal_makefile_list@%$internal_makefile_list%g
13360
13361 CEOF
13362 EOF
13363
13364 cat >> $CONFIG_STATUS <<\EOF
13365
13366 # Split the substitutions into bite-sized pieces for seds with
13367 # small command number limits, like on Digital OSF/1 and HP-UX.
13368 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13369 ac_file=1 # Number of current file.
13370 ac_beg=1 # First line for current file.
13371 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13372 ac_more_lines=:
13373 ac_sed_cmds=""
13374 while $ac_more_lines; do
13375   if test $ac_beg -gt 1; then
13376     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13377   else
13378     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13379   fi
13380   if test ! -s conftest.s$ac_file; then
13381     ac_more_lines=false
13382     rm -f conftest.s$ac_file
13383   else
13384     if test -z "$ac_sed_cmds"; then
13385       ac_sed_cmds="sed -f conftest.s$ac_file"
13386     else
13387       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13388     fi
13389     ac_file=`expr $ac_file + 1`
13390     ac_beg=$ac_end
13391     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13392   fi
13393 done
13394 if test -z "$ac_sed_cmds"; then
13395   ac_sed_cmds=cat
13396 fi
13397 EOF
13398
13399 cat >> $CONFIG_STATUS <<EOF
13400
13401 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13402 EOF
13403 cat >> $CONFIG_STATUS <<\EOF
13404 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13405   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13406   case "$ac_file" in
13407   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13408        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13409   *) ac_file_in="${ac_file}.in" ;;
13410   esac
13411
13412   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13413
13414   # Remove last slash and all that follows it.  Not all systems have dirname.
13415   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13416   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13417     # The file is in a subdirectory.
13418     test ! -d "$ac_dir" && mkdir "$ac_dir"
13419     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13420     # A "../" for each directory in $ac_dir_suffix.
13421     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13422   else
13423     ac_dir_suffix= ac_dots=
13424   fi
13425
13426   case "$ac_given_srcdir" in
13427   .)  srcdir=.
13428       if test -z "$ac_dots"; then top_srcdir=.
13429       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13430   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13431   *) # Relative path.
13432     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13433     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13434   esac
13435
13436   case "$ac_given_INSTALL" in
13437   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13438   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13439   esac
13440
13441   echo creating "$ac_file"
13442   rm -f "$ac_file"
13443   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13444   case "$ac_file" in
13445   *Makefile*) ac_comsub="1i\\
13446 # $configure_input" ;;
13447   *) ac_comsub= ;;
13448   esac
13449
13450   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13451   sed -e "$ac_comsub
13452 s%@configure_input@%$configure_input%g
13453 s%@srcdir@%$srcdir%g
13454 s%@top_srcdir@%$top_srcdir%g
13455 s%@INSTALL@%$INSTALL%g
13456 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13457 fi; done
13458 rm -f conftest.s*
13459
13460 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13461 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13462 #
13463 # ac_d sets the value in "#define NAME VALUE" lines.
13464 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13465 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13466 ac_dC='\3'
13467 ac_dD='%g'
13468 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13469 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13470 ac_uB='\([      ]\)%\1#\2define\3'
13471 ac_uC=' '
13472 ac_uD='\4%g'
13473 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13474 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13475 ac_eB='$%\1#\2define\3'
13476 ac_eC=' '
13477 ac_eD='%g'
13478
13479 if test "${CONFIG_HEADERS+set}" != set; then
13480 EOF
13481 cat >> $CONFIG_STATUS <<EOF
13482   CONFIG_HEADERS="src/config.h lwlib/config.h"
13483 EOF
13484 cat >> $CONFIG_STATUS <<\EOF
13485 fi
13486 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13487   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13488   case "$ac_file" in
13489   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13490        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13491   *) ac_file_in="${ac_file}.in" ;;
13492   esac
13493
13494   echo creating $ac_file
13495
13496   rm -f conftest.frag conftest.in conftest.out
13497   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13498   cat $ac_file_inputs > conftest.in
13499
13500 EOF
13501
13502 # Transform confdefs.h into a sed script conftest.vals that substitutes
13503 # the proper values into config.h.in to produce config.h.  And first:
13504 # Protect against being on the right side of a sed subst in config.status.
13505 # Protect against being in an unquoted here document in config.status.
13506 rm -f conftest.vals
13507 cat > conftest.hdr <<\EOF
13508 s/[\\&%]/\\&/g
13509 s%[\\$`]%\\&%g
13510 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13511 s%ac_d%ac_u%gp
13512 s%ac_u%ac_e%gp
13513 EOF
13514 sed -n -f conftest.hdr confdefs.h > conftest.vals
13515 rm -f conftest.hdr
13516
13517 # This sed command replaces #undef with comments.  This is necessary, for
13518 # example, in the case of _POSIX_SOURCE, which is predefined and required
13519 # on some systems where configure will not decide to define it.
13520 cat >> conftest.vals <<\EOF
13521 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13522 EOF
13523
13524 # Break up conftest.vals because some shells have a limit on
13525 # the size of here documents, and old seds have small limits too.
13526
13527 rm -f conftest.tail
13528 while :
13529 do
13530   ac_lines=`grep -c . conftest.vals`
13531   # grep -c gives empty output for an empty file on some AIX systems.
13532   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13533   # Write a limited-size here document to conftest.frag.
13534   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13535   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13536   echo 'CEOF
13537   sed -f conftest.frag conftest.in > conftest.out
13538   rm -f conftest.in
13539   mv conftest.out conftest.in
13540 ' >> $CONFIG_STATUS
13541   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13542   rm -f conftest.vals
13543   mv conftest.tail conftest.vals
13544 done
13545 rm -f conftest.vals
13546
13547 cat >> $CONFIG_STATUS <<\EOF
13548   rm -f conftest.frag conftest.h
13549   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13550   cat conftest.in >> conftest.h
13551   rm -f conftest.in
13552   if cmp -s $ac_file conftest.h 2>/dev/null; then
13553     echo "$ac_file is unchanged"
13554     rm -f conftest.h
13555   else
13556     # Remove last slash and all that follows it.  Not all systems have dirname.
13557       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13558       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13559       # The file is in a subdirectory.
13560       test ! -d "$ac_dir" && mkdir "$ac_dir"
13561     fi
13562     rm -f $ac_file
13563     mv conftest.h $ac_file
13564   fi
13565 fi; done
13566
13567 EOF
13568 cat >> $CONFIG_STATUS <<EOF
13569 CPP="$CPP"
13570  top_srcdir="$srcdir"
13571  MAKE_SUBDIR="$MAKE_SUBDIR"
13572
13573 EOF
13574 cat >> $CONFIG_STATUS <<\EOF
13575 for dir in . $MAKE_SUBDIR; do
13576   (
13577     cd $dir
13578     rm -f junk.c
13579     < Makefile.in \
13580       sed -e '/^# Generated/d' \
13581           -e 's%/\*\*/#.*%%' \
13582           -e 's/^ *# */#/' \
13583           -e '/^##/d' \
13584           -e '/^#/ {
13585 p
13586 d
13587 }'        \
13588           -e '/./ {
13589 s/\([\"]\)/\\\1/g
13590 s/^/"/
13591 s/$/"/
13592 }'  > junk.c;
13593
13594
13595
13596     echo creating $dir/Makefile
13597 $CPP -I. -I${top_srcdir}/src  junk.c \
13598   | sed -e 's/^\#.*//'          \
13599         -e 's/^[        ][      ]*$//'\
13600         -e 's/^ /       /'              \
13601   | sed -n -e '/^..*$/p'        \
13602   | sed '/^\"/ {
13603         s/\\\([\"]\)/\1/g
13604         s/^[    ]*\"//
13605         s/\"[   ]*$//
13606 }' > Makefile.new
13607     chmod 444 Makefile.new
13608     mv -f Makefile.new Makefile
13609
13610     echo creating $dir/GNUmakefile
13611 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13612   | sed -e 's/^\#.*//'          \
13613         -e 's/^[        ][      ]*$//'\
13614         -e 's/^ /       /'              \
13615   | sed -n -e '/^..*$/p'        \
13616   | sed '/^\"/ {
13617         s/\\\([\"]\)/\1/g
13618         s/^[    ]*\"//
13619         s/\"[   ]*$//
13620 }' > Makefile.new
13621     chmod 444 Makefile.new
13622     mv -f Makefile.new GNUmakefile
13623
13624     rm -f junk.c
13625   )
13626 done
13627
13628 sed < config.status >> lib-src/config.values \
13629   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13630   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13631   -e 's/^\([^ ]*\) $/\1 ""/' \
13632   -e 's/ 1$/ t/'
13633
13634
13635 exit 0
13636 EOF
13637 chmod +x $CONFIG_STATUS
13638 rm -fr confdefs* $ac_clean_files
13639 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1