Sync up with r21-2-19-tomo-3.
[chise/xemacs-chise.git] / 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.13 
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 ac_exeext=
203 ac_objext=o
204 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
205   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
206   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
207     ac_n= ac_c='
208 ' ac_t='        '
209   else
210     ac_n=-n ac_c= ac_t=
211   fi
212 else
213   ac_n= ac_c='\c' ac_t=
214 fi
215
216
217 progname="`echo $0 | sed 's:^\./\./:\./:'`"
218
219
220 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
221 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
222
223 prefix='/usr/local'
224 exec_prefix='${prefix}'
225 bindir='${exec_prefix}/bin'
226 datadir='${prefix}/lib'
227 statedir='${prefix}/lib'
228 libdir='${exec_prefix}/lib'
229 mandir='${prefix}/man/man1'
230 inststaticdir='${PROGNAME}'
231 instvardir='${PROGNAME}-${version}'
232 infodir='${datadir}/${instvardir}/info'
233 infopath=''
234 install_pp=''
235 lispdir='${datadir}/${instvardir}/lisp'
236 moduledir='${datadir}/${instvardir}/${configuration}/modules'
237 sitelispdir='${datadir}/${inststaticdir}/site-lisp'
238 sitemoduledir='${datadir}/${inststaticdir}/site-modules'
239 pkgdir='${datadir}/${instvardir}/lisp'
240 package_path=''
241 etcdir='${datadir}/${instvardir}/etc'
242 lockdir='${statedir}/${inststaticdir}/lock'
243 archlibdir='${datadir}/${instvardir}/${configuration}'
244 docdir='${archlibdir}'
245 with_prefix='yes'
246 with_site_lisp='no'
247 with_site_modules='yes'
248 with_menubars=''
249 with_scrollbars=''
250 with_widgets=''
251 with_dialogs=''
252 with_file_coding=''
253 cpp='' cppflags='' libs='' ldflags=''
254 dynamic=''
255 with_x11=''
256 with_msw=''
257 rel_alloc='default'
258 with_system_malloc='default'
259 with_dlmalloc='default'
260 native_sound_lib=''
261 use_assertions="yes"
262 with_toolbars=""
263 with_tty=""
264 use_union_type="no"
265 with_dnet=""
266
267
268
269
270 arguments="$@"
271
272 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
273 quoted_arguments=
274 for i in "$@"; do
275    case "$i" in
276    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
277    | --no-cr | --no-c) ;;
278    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
279    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
280    *)
281    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
282    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
283    esac
284 done
285
286 while test $# != 0; do
287   arg="$1"; shift
288   case "$arg" in
289     --no-create|--no-recursion) ;;
290         -* )
291             case "$arg" in
292         -*=*)
293           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
294           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
295           valomitted=no
296         ;;
297                                                                           -*)
298                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
299           val="yes" valomitted=yes
300         ;;
301       esac
302
303             optname="$opt"
304       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
305
306             case "${valomitted}-${opt}" in yes-without_* )
307         opt=`echo $opt | sed 's/without/with/'`
308         valomitted="no" val="no" ;;
309       esac
310
311             case "$opt" in
312
313         with_site_lisp  | \
314         with_prefix     | \
315         with_site_modules | \
316         with_x          | \
317         with_x11        | \
318         with_msw        | \
319         with_gcc        | \
320         dynamic         | \
321         with_ncurses    | \
322         with_dnet       | \
323         with_socks      | \
324         with_dragndrop  | \
325         with_cde        | \
326         with_offix      | \
327         with_gpm        | \
328         with_xpm        | \
329         with_xface      | \
330         with_gif        | \
331         with_jpeg       | \
332         with_png        | \
333         with_tiff       | \
334         with_wmcommand  | \
335         with_xmu        | \
336         with_purify     | \
337         with_quantify   | \
338         with_toolbars   | \
339         with_tty        | \
340         with_xfs        | \
341         with_i18n3      | \
342         with_mule       | \
343         with_utf_2000   | \
344         with_ucs4       | \
345         with_file_coding| \
346         with_canna      | \
347         with_wnn        | \
348         with_wnn6       | \
349         with_workshop   | \
350         with_sparcworks | \
351         with_tooltalk   | \
352         with_ldap       | \
353         with_pop        | \
354         with_kerberos   | \
355         with_hesiod     | \
356         with_dnet       | \
357         with_infodock   | \
358         external_widget | \
359         verbose         | \
360         extra_verbose   | \
361         const_is_losing | \
362         usage_tracking  | \
363         use_union_type  | \
364         debug           | \
365         use_assertions  | \
366         memory_usage_stats | \
367         with_clash_detection | \
368         with_modules | \
369         no_doc_file )
370                   case "$val" in
371             y | ye | yes )      val=yes ;;
372             n | no )            val=no  ;;
373             * ) (echo "$progname: Usage error:"
374 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
375 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
376           esac
377           eval "$opt=\"$val\"" ;;
378
379
380                         srcdir          | \
381         compiler        | \
382         cflags          | \
383         cpp             | \
384         cppflags        | \
385         libs            | \
386         ldflags         | \
387         cache_file      | \
388         native_sound_lib| \
389         site_lisp       | \
390         x_includes      | \
391         x_libraries     | \
392         site_includes   | \
393         site_libraries  | \
394         site_prefixes   | \
395         site_runtime_libraries )
396                   if test "$valomitted" = "yes" ; then
397                     if test "$#" = 0 ; then
398               (echo "$progname: Usage error:"
399 echo " " "The \`--$optname' option requires a value."
400 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
401             fi
402             val="$1"; shift
403           fi
404           eval "$opt=\"$val\""
405         ;;
406
407                 rel_alloc | \
408         with_dlmalloc | \
409         with_debug_malloc  | use_debug_malloc | \
410         with_system_malloc | use_system_malloc )
411           case "$val" in
412             y | ye | yes )      val=yes ;;
413             n | no )            val=no  ;;
414             d | de | def | defa | defau | defaul | default ) val=default ;;
415             * ) (echo "$progname: Usage error:"
416 echo " " "The \`--$optname' option requires one of these values:
417   \`yes', \`no', or \`default'."
418 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
419           esac
420           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
421           eval "$opt=\"$val\""
422         ;;
423
424                 "with_database" )
425           with_database_berkdb=no
426           with_database_dbm=no
427           with_database_gnudbm=no
428           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
429             case "$x" in
430                 no ) ;;
431                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
432                 d | db | dbm )                          with_database_dbm=yes    ;;
433                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
434                 * ) (echo "$progname: Usage error:"
435 echo " " "The \`--$optname' option value
436   must be either \`no' or a comma-separated list
437   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
438 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
439             esac
440           done
441           if test "$with_database_dbm"    = "yes" -a \
442                   "$with_database_gnudbm" = "yes"; then
443           (echo "$progname: Usage error:"
444 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
445   with the \`--$optname' option."
446 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
447           fi
448         ;;
449
450                 "with_sound" )
451                           case "$val" in
452             y | ye | yes )                      val=native ;;
453             n | no | non | none )               val=no;;
454             na | nat | nati | nativ | native )  val=native  ;;
455             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
456             b | bo | bot | both )               val=both;;
457             * ) (echo "$progname: Usage error:"
458 echo " " "The \`--$optname' option must have one of these values:
459   \`native', \`nas', \`both', or \`none'."
460 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
461           esac
462           eval "$opt=\"$val\""
463         ;;
464
465                 "with_xim" )
466           case "$val" in
467             y | ye | yes )                val=yes   ;;
468             n | no | non | none )         val=no    ;;
469             x | xl | xli | xlib )         val=xlib  ;;
470             m | mo | mot | moti | motif ) val=motif ;;
471             * ) (echo "$progname: Usage error:"
472 echo " " "The \`--$optname' option must have one of these values:
473   \`motif', \`xlib', \`yes', or \`no'."
474 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
475           esac
476           eval "$opt=\"$val\""
477         ;;
478
479                 "mail_locking" )
480           case "$val" in
481             lockf )     val=lockf ;;
482             flock )     val=flock ;;
483             file )      val=file  ;;
484             * ) (echo "$progname: Usage error:"
485 echo " " "The \`--$optname' option must have one of these values:
486   \`lockf', \`flock', or \`file'."
487 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
488           esac
489           eval "$opt=\"$val\""
490         ;;
491
492                 "error_checking" )
493                           
494           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
495             case "$x" in
496                       n | no | non | none ) new_default=no ;;
497               a | al | all )        new_default=yes ;;
498
499               extents )       error_check_extents=yes ;;
500               noextents )     error_check_extents=no ;;
501
502               typecheck )     error_check_typecheck=yes ;;
503               notypecheck )   error_check_typecheck=no ;;
504
505               bufpos )        error_check_bufpos=yes ;;
506               nobufpos )      error_check_bufpos=no ;;
507
508               gc )            error_check_gc=yes ;;
509               nogc )          error_check_gc=no ;;
510
511               malloc )        error_check_malloc=yes ;;
512               nomalloc )      error_check_malloc=no ;;
513
514               byte_code )     error_check_byte_code=yes ;;
515               nobyte_code )   error_check_byte_code=no ;;
516
517               * ) bogus_error_check=yes ;;
518             esac
519             if test "$bogus_error_check" -o \
520                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
521                 if test "$error_check_default" = yes ; then
522                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
523                 else
524                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
525                 fi
526                 (echo "$progname: Usage error:"
527 echo " " "Valid types for the \`--$optname' option are:
528   $types."
529 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
530             elif test -n "$new_default" ; then
531                 error_check_extents=$new_default
532                 error_check_typecheck=$new_default
533                 error_check_bufpos=$new_default
534                 error_check_gc=$new_default
535                 error_check_malloc=$new_default
536                 error_check_byte_code=$new_default
537                 new_default=    # reset this
538             fi
539             echeck_notfirst=true
540           done
541         ;;
542
543                                 
544                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
545         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
546         archlibdir | docdir | package_path )
547                    if test "$valomitted" = "yes"; then
548              if test "$#" = 0; then
549                  (echo "$progname: Usage error:"
550 echo " " "The \`--$optname' option requires a value."
551 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
552              fi
553              val="$1"; shift
554            fi
555            eval "$opt=\"$val\""
556
557                            case "$opt" in
558                      exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
559     Defining EXEC_PREFIX_USER_DEFINED
560 EOF
561 cat >> confdefs.h <<\EOF
562 #define EXEC_PREFIX_USER_DEFINED 1
563 EOF
564 }
565  ;;
566              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
567     Defining LISPDIR_USER_DEFINED
568 EOF
569 cat >> confdefs.h <<\EOF
570 #define LISPDIR_USER_DEFINED 1
571 EOF
572 }
573  ;;
574              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
575     Defining SITELISPDIR_USER_DEFINED
576 EOF
577 cat >> confdefs.h <<\EOF
578 #define SITELISPDIR_USER_DEFINED 1
579 EOF
580 }
581  ;;
582              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
583     Defining MODULEDIR_USER_DEFINED
584 EOF
585 cat >> confdefs.h <<\EOF
586 #define MODULEDIR_USER_DEFINED 1
587 EOF
588 }
589  ;;
590              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
591     Defining ETCDIR_USER_DEFINED
592 EOF
593 cat >> confdefs.h <<\EOF
594 #define ETCDIR_USER_DEFINED 1
595 EOF
596 }
597  ;;
598              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
599     Defining INFODIR_USER_DEFINED
600 EOF
601 cat >> confdefs.h <<\EOF
602 #define INFODIR_USER_DEFINED 1
603 EOF
604 }
605  ;;
606              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
607     Defining INFOPATH_USER_DEFINED
608 EOF
609 cat >> confdefs.h <<\EOF
610 #define INFOPATH_USER_DEFINED 1
611 EOF
612 }
613  ;;
614              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
615     Defining PACKAGE_PATH_USER_DEFINED
616 EOF
617 cat >> confdefs.h <<\EOF
618 #define PACKAGE_PATH_USER_DEFINED 1
619 EOF
620 }
621  ;;
622              datadir )
623                 { test "$extra_verbose" = "yes" && cat << \EOF
624     Defining INFODIR_USER_DEFINED
625 EOF
626 cat >> confdefs.h <<\EOF
627 #define INFODIR_USER_DEFINED 1
628 EOF
629 }
630
631                 { test "$extra_verbose" = "yes" && cat << \EOF
632     Defining LISPDIR_USER_DEFINED
633 EOF
634 cat >> confdefs.h <<\EOF
635 #define LISPDIR_USER_DEFINED 1
636 EOF
637 }
638
639             { test "$extra_verbose" = "yes" && cat << \EOF
640     Defining MODULEDIR_USER_DEFINED
641 EOF
642 cat >> confdefs.h <<\EOF
643 #define MODULEDIR_USER_DEFINED 1
644 EOF
645 }
646
647                 { test "$extra_verbose" = "yes" && cat << \EOF
648     Defining ETCDIR_USER_DEFINED
649 EOF
650 cat >> confdefs.h <<\EOF
651 #define ETCDIR_USER_DEFINED 1
652 EOF
653 }
654  ;;
655              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
656     Defining LOCKDIR_USER_DEFINED
657 EOF
658 cat >> confdefs.h <<\EOF
659 #define LOCKDIR_USER_DEFINED 1
660 EOF
661 }
662  ;;
663              docdir ) { test "$extra_verbose" = "yes" && cat << \EOF
664     Defining DOCDIR_USER_DEFINED
665 EOF
666 cat >> confdefs.h <<\EOF
667 #define DOCDIR_USER_DEFINED 1
668 EOF
669 }
670  ;;
671              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
672     Defining ARCHLIBDIR_USER_DEFINED
673 EOF
674 cat >> confdefs.h <<\EOF
675 #define ARCHLIBDIR_USER_DEFINED 1
676 EOF
677 }
678  ;;
679            esac
680         ;;
681
682                 "no_create" ) ;;
683
684                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
685
686                 "with_menubars"   | \
687         "with_scrollbars" | \
688         "with_dialogs" | \
689         "with_widgets" )
690           case "$val" in
691             l | lu | luc | luci | lucid )               val=lucid  ;;
692             m | mo | mot | moti | motif )               val=motif  ;;
693             athena3d | athena-3d )                      val=athena3d ;;
694             a | at | ath | athe | athen | athena )      val=athena ;;
695             n | no | non | none )                       val=no ;;
696             * ) (echo "$progname: Usage error:"
697 echo " " "The \`--$optname' option must have one of these values:
698   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
699 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
700           esac
701           eval "$opt=\"$val\""
702         ;;
703
704                 "run_in_place"  | \
705         "with_gnu_make" )
706           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
707         ;;
708
709                 * ) (echo "$progname: Usage error:"
710 echo " " "Unrecognized option: $arg"
711 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
712
713       esac
714     ;;
715
716         *-*-*) configuration="$arg" ;;
717
718         *) (echo "$progname: Usage error:"
719 echo " " "Unrecognized argument: $arg"
720 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
721
722   esac
723 done
724
725
726 test -n "$cpp"      && CPP="$cpp"
727 test -n "$cppflags" && CPPFLAGS="$cppflags"
728 test -n "$libs"     && LIBS="$libs"
729 test -n "$ldflags"  && LDFLAGS="$ldflags"
730
731 eval set x "$quoted_arguments"; shift
732
733 test "$extra_verbose" = "yes" && verbose=yes
734
735 test -n "$with_x" && with_x11="$with_x"
736
737 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
738   test "$with_system_malloc" = "default" && with_system_malloc=yes
739 fi
740
741
742
743 if test "$with_cde $with_tooltalk" = "yes no"; then
744   (echo "$progname: Usage error:"
745 echo " " "--with-cde requires --with-tooltalk"
746 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
747 elif test "$with_tooltalk" = "no" ; then with_cde=no
748 elif test "$with_cde" = "yes"; then with_tooltalk=yes
749 fi
750
751
752 case "$srcdir" in
753
754     "" )
755     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
756       if test -f "$dir/src/lisp.h" -a \
757               -f "$dir/lisp/version.el" ; then
758         srcdir="$dir"
759         break
760       fi
761     done
762     if test -z "$srcdir" ; then
763       (echo "$progname: Usage error:"
764 echo " " "Neither the current directory nor its parent seem to
765   contain the XEmacs sources.  If you do not want to build XEmacs in its
766   source tree, you should run \`$progname' in the directory in which
767   you wish to build XEmacs, using the \`--srcdir' option to say where the
768   sources may be found."
769 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
770     fi
771   ;;
772
773     * )
774     if test ! -f "$srcdir/src/lisp.h" -o \
775             ! -f "$srcdir/lisp/version.el" ; then
776       (echo "$progname: Usage error:"
777 echo " " "The directory specified with the \`--srcdir' option,
778   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
779   either run the \`$progname' script at the top of the XEmacs source
780   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
781 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
782     fi
783   ;;
784 esac
785
786 if test -z "$configuration"; then
787     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
788   if test -z "$configuration"; then
789     (echo "$progname: Usage error:"
790 echo " " "XEmacs has not been ported to this host type.
791 Try explicitly specifying the CONFIGURATION when rerunning configure."
792 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
793   fi
794 fi
795
796 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
797 echo "configure:798: checking whether ln -s works" >&5
798
799 rm -f conftestdata
800 if ln -s X conftestdata 2>/dev/null
801 then
802   rm -f conftestdata
803   ac_cv_prog_LN_S="ln -s"
804 else
805   ac_cv_prog_LN_S=ln
806 fi
807 LN_S="$ac_cv_prog_LN_S"
808 if test "$ac_cv_prog_LN_S" = "ln -s"; then
809   echo "$ac_t""yes" 1>&6
810 else
811   echo "$ac_t""no" 1>&6
812 fi
813
814
815 for dir in lisp etc man info; do
816   if test ! -d "$dir" ; then
817     echo Making symbolic link to "$srcdir/$dir"
818     ${LN_S} "$srcdir/$dir" "$dir"
819   fi
820 done
821
822
823 absolute_pwd="`pwd`";
824 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
825 then blddir="$PWD"
826 else blddir="$absolute_pwd"; if test -d "/net"; then
827   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
828   blddir=`echo "$blddir" | \
829    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
830 fi
831 fi
832
833
834 case "$srcdir" in
835   /* ) ;;
836   .  ) srcdir="$blddir" ;;
837   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
838   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
839   srcdir=`echo "$srcdir" | \
840    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
841 fi ;;
842 esac
843
844 if test `pwd` != `sh -c cd $srcdir && pwd`  \
845    && test -f "$srcdir/src/config.h"; then
846   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
847    echo "   as a build directory right now; it has been configured in its own"
848    echo "   right.  To configure in another directory as well, you MUST"
849    echo "   use GNU make.  If you do not have GNU make, then you must"
850    echo "   now do \`make distclean' in $srcdir,"
851    echo "   and then run $progname again.") >&2
852   extrasub='/^VPATH[     ]*=/c\
853 vpath %.c $(srcdir)\
854 vpath %.h $(srcdir)\
855 vpath %.y $(srcdir)\
856 vpath %.l $(srcdir)\
857 vpath %.s $(srcdir)\
858 vpath %.in $(srcdir)'
859 fi
860
861 . "$srcdir/version.sh" || exit 1;
862 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
863 : "${extra_verbose=$beta}"
864 version="${emacs_major_version}.${emacs_minor_version}"
865 { test "$extra_verbose" = "yes" && cat << EOF
866     Defining EMACS_MAJOR_VERSION = $emacs_major_version
867 EOF
868 cat >> confdefs.h <<EOF
869 #define EMACS_MAJOR_VERSION $emacs_major_version
870 EOF
871 }
872
873 { test "$extra_verbose" = "yes" && cat << EOF
874     Defining EMACS_MINOR_VERSION = $emacs_minor_version
875 EOF
876 cat >> confdefs.h <<EOF
877 #define EMACS_MINOR_VERSION $emacs_minor_version
878 EOF
879 }
880
881 if test -n "$emacs_beta_version" ; then
882   if test "$beta" = "yes"; then
883         version="${version}-b${emacs_beta_version}"
884         { test "$extra_verbose" = "yes" && cat << EOF
885     Defining EMACS_BETA_VERSION = $emacs_beta_version
886 EOF
887 cat >> confdefs.h <<EOF
888 #define EMACS_BETA_VERSION $emacs_beta_version
889 EOF
890 }
891
892   else
893         version="${version}.${emacs_beta_version}"
894         { test "$extra_verbose" = "yes" && cat << EOF
895     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
896 EOF
897 cat >> confdefs.h <<EOF
898 #define EMACS_PATCH_LEVEL $emacs_beta_version
899 EOF
900 }
901
902   fi
903 fi
904 { test "$extra_verbose" = "yes" && cat << EOF
905     Defining XEMACS_CODENAME = "$xemacs_codename"
906 EOF
907 cat >> confdefs.h <<EOF
908 #define XEMACS_CODENAME "$xemacs_codename"
909 EOF
910 }
911
912 { test "$extra_verbose" = "yes" && cat << EOF
913     Defining EMACS_VERSION = "$version"
914 EOF
915 cat >> confdefs.h <<EOF
916 #define EMACS_VERSION "$version"
917 EOF
918 }
919
920
921 if test "$with_infodock" = "yes"; then
922   if test ! -f ../../ID-INSTALL; then
923     echo "Cannot build InfoDock without InfoDock sources"
924     with_infodock=no
925   fi
926 fi
927
928 if test "$with_infodock" = "yes"; then
929       { test "$extra_verbose" = "yes" && cat << EOF
930     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
931 EOF
932 cat >> confdefs.h <<EOF
933 #define INFODOCK_MAJOR_VERSION $infodock_major_version
934 EOF
935 }
936
937   { test "$extra_verbose" = "yes" && cat << EOF
938     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
939 EOF
940 cat >> confdefs.h <<EOF
941 #define INFODOCK_MINOR_VERSION $infodock_minor_version
942 EOF
943 }
944
945   { test "$extra_verbose" = "yes" && cat << EOF
946     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
947 EOF
948 cat >> confdefs.h <<EOF
949 #define INFODOCK_BUILD_VERSION $infodock_build_version
950 EOF
951 }
952
953   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
954   PROGNAME=infodock
955   CPPFLAGS="$CPPFLAGS -DINFODOCK"
956 else
957   PROGNAME=xemacs
958 fi
959
960 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
961 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
962     Defining ERROR_CHECK_EXTENTS
963 EOF
964 cat >> confdefs.h <<\EOF
965 #define ERROR_CHECK_EXTENTS 1
966 EOF
967 }
968
969 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
970     Defining ERROR_CHECK_TYPECHECK
971 EOF
972 cat >> confdefs.h <<\EOF
973 #define ERROR_CHECK_TYPECHECK 1
974 EOF
975 }
976
977 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
978     Defining ERROR_CHECK_BUFPOS
979 EOF
980 cat >> confdefs.h <<\EOF
981 #define ERROR_CHECK_BUFPOS 1
982 EOF
983 }
984
985 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
986     Defining ERROR_CHECK_GC
987 EOF
988 cat >> confdefs.h <<\EOF
989 #define ERROR_CHECK_GC 1
990 EOF
991 }
992
993 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
994     Defining ERROR_CHECK_MALLOC
995 EOF
996 cat >> confdefs.h <<\EOF
997 #define ERROR_CHECK_MALLOC 1
998 EOF
999 }
1000
1001 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1002     Defining ERROR_CHECK_BYTE_CODE
1003 EOF
1004 cat >> confdefs.h <<\EOF
1005 #define ERROR_CHECK_BYTE_CODE 1
1006 EOF
1007 }
1008
1009 if test "${debug:=$beta}" = "yes"; then
1010   use_assertions=yes memory_usage_stats=yes
1011   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
1012    echo "    xemacs will be linked with \"debug.o\""
1013  fi
1014   { test "$extra_verbose" = "yes" && cat << \EOF
1015     Defining DEBUG_XEMACS
1016 EOF
1017 cat >> confdefs.h <<\EOF
1018 #define DEBUG_XEMACS 1
1019 EOF
1020 }
1021
1022 fi
1023 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1024     Defining USE_ASSERTIONS
1025 EOF
1026 cat >> confdefs.h <<\EOF
1027 #define USE_ASSERTIONS 1
1028 EOF
1029 }
1030
1031 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1032     Defining MEMORY_USAGE_STATS
1033 EOF
1034 cat >> confdefs.h <<\EOF
1035 #define MEMORY_USAGE_STATS 1
1036 EOF
1037 }
1038
1039
1040
1041 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1042 echo "configure:1043: checking "host system type"" >&5
1043 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1044 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1045 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1046 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1047 echo "$ac_t""$configuration" 1>&6
1048
1049
1050
1051
1052
1053 machine='' opsys=''
1054
1055 case "$canonical" in
1056   sparc-*-*        ) machine=sparc ;;
1057   alpha*-*-*       ) machine=alpha ;;
1058   vax-*-*          ) machine=vax ;;
1059   mips-dec-*       ) machine=pmax ;;
1060   mips-sgi-*       ) machine=iris4d ;;
1061   romp-ibm-*       ) machine=ibmrt ;;
1062   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1063   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1064   powerpc*-*       ) machine=powerpc ;;
1065   hppa-*-*         ) machine=hp800 ;;
1066   m88k-dg-*        ) machine=aviion ;;
1067   m68*-sony-*      ) machine=news ;;
1068   mips-sony-*      ) machine=news-risc ;;
1069   clipper-*        ) machine=clipper ;;
1070   arm-*            ) machine=arm ;;
1071   ns32k-*          ) machine=ns32000 ;;
1072 esac
1073
1074 case "$canonical" in
1075   *-*-linux*    ) opsys=linux ;;
1076   *-*-netbsd*   ) opsys=netbsd ;;
1077   *-*-openbsd*  ) opsys=openbsd ;;
1078   *-*-nextstep* ) opsys=nextstep ;;
1079   *-*-vms       ) opsys=vms ;;
1080
1081     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1082   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1083   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1084   *-dec-osf3*                ) opsys=decosf3-1 ;;
1085   *-dec-osf4*                ) opsys=decosf4-0 ;;
1086
1087     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1088   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1089   *-*-ultrix* )         opsys=ultrix4-3 ;;
1090
1091     *-*-aix3.1*  ) opsys=aix3-1 ;;
1092   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1093   *-*-aix3*    ) opsys=aix3-2   ;;
1094   *-*-aix4.0*  ) opsys=aix4     ;;
1095   *-*-aix4.1*  ) opsys=aix4-1   ;;
1096   *-*-aix4*    ) opsys=aix4-2   ;;
1097
1098     *-gnu* )                    opsys=gnu    ;;
1099   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1100   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1101   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1102   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1103   *-*-aos*   )                  opsys=bsd4-3 ;;
1104   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1105   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1106   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1107   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1108   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1109   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1110         if test -z "$NON_GNU_CPP" ; then
1111           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1112             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1113           done
1114         fi
1115         opsys=usg5-4-2 ;;
1116     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1117     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1118 esac
1119
1120 case "$canonical" in
1121
1122     *-*-netbsd* )
1123     case "$canonical" in
1124       i[3-9]86-*-netbsd*) machine=intel386 ;;
1125       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1126                                             machine=hp9000s300 ;;
1127       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1128       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1129     esac
1130   ;;
1131
1132     *-*-openbsd* )
1133     case "${canonical}" in
1134       i386-*-openbsd*)          machine=intel386 ;;
1135       m68k-*-openbsd*)          machine=hp9000s300 ;;
1136       mipsel-*-openbsd*)        machine=pmax ;;
1137      esac
1138    ;;
1139
1140     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1141   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1142
1143     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1144   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1145
1146     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1147
1148     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1149
1150     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1151
1152     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1153
1154     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1155
1156     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1157   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1158   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1159
1160   
1161     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1162
1163     *-convex-bsd* | *-convex-convexos* )
1164     machine=convex opsys=bsd4-3
1165     NON_GNU_CPP="cc -E -P"
1166   ;;
1167
1168     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1169
1170     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1171   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1172   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1173   m88k-dg-dgux*                           ) opsys=dgux     ;;
1174
1175     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1176   m88k-motorola-sysv4* )
1177                     machine=delta88k opsys=usg5-4-2
1178   ;;
1179   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1180
1181     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1182   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1183
1184     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1185
1186     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1187   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1188   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1189
1190       m88k-harris-cxux* )
1191         case "`uname -r`" in
1192        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1193        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1194     esac
1195     NON_GNU_CPP="/lib/cpp"
1196   ;;
1197     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1198     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1199
1200     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1201
1202     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1203
1204     *-hp-hpux* )
1205         case "$canonical" in
1206       m68*  ) machine=hp9000s300 ;;
1207       hppa* ) machine=hp800      ;;
1208     esac
1209
1210     case "$canonical" in
1211       *-hp-hpux7*  )  opsys=hpux   ;;
1212       *-hp-hpux8*  )  opsys=hpux8  ;;
1213       *-hp-hpux9*  )  opsys=hpux9  ;;
1214       *-hp-hpux10* )  opsys=hpux10 ;;
1215       *-hp-hpux11* )  opsys=hpux11 ;;
1216       *            )  opsys=hpux   ;;
1217     esac
1218
1219         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1220    echo "    xemacs will be linked with \"strcat.o\""
1221  fi ;; esac
1222
1223     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1224         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1225     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1226
1227     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1228   ;;
1229
1230     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1231   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1232
1233     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1234   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1235   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1236   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1237   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1238   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1239
1240     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1241   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1242
1243     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1244
1245     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1246
1247     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1248
1249     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1250
1251       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1252
1253     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1254
1255     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1256
1257     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1258
1259     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1260
1261         mips-mips-usg* ) machine=mips4 ;;
1262   mips-mips-riscos4 )
1263     machine=mips4
1264     NON_GNU_CC="cc -systype bsd43"
1265     NON_GNU_CPP="cc -systype bsd43 -E"
1266     case "$canonical" in
1267       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1268       mips-mips-riscos5* ) opsys=riscos5 ;;
1269     esac
1270   ;;
1271   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1272   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1273
1274     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1275
1276     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1277
1278     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1279   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1280
1281     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1282
1283     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1284
1285     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1286
1287     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1288
1289     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1290   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1291
1292     mips-siemens-sysv* | mips-sni-sysv*)
1293     machine=mips-siemens opsys=usg5-4
1294     NON_GNU_CC=/usr/ccs/bin/cc
1295     NON_GNU_CPP=/usr/ccs/lib/cpp
1296   ;;
1297
1298     mips-nec-sysv*)
1299     machine=mips-nec
1300     NON_GNU_CC=/usr/ccs/bin/cc
1301     NON_GNU_CPP=/usr/ccs/lib/cpp
1302   ;;
1303
1304       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1305   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1306     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1307   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1308   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1309   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1310   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1311   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1312   mips-sgi-irix*      ) opsys=irix5-0 ;;
1313
1314     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1315   *-sony-news* ) opsys=newsos5 ;;
1316
1317     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1318
1319     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1320         case "$canonical" in
1321       m68*-sunos1* )             machine=sun1     ;;
1322       m68*-sunos2* )             machine=sun2     ;;
1323       m68* )                     machine=sun3     ;;
1324       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1325       i*86-*-* )                 machine=intel386 ;;
1326       rs6000* )                  machine=rs6000   ;;
1327     esac
1328
1329         case "$canonical" in *-sunos5*)
1330       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1331     esac
1332
1333                     case "$canonical" in
1334       *-sunos4* )
1335         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1336         : ;;
1337       *-solaris2* )
1338         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1339         RANLIB=':' ;;
1340     esac
1341
1342     case "$canonical" in
1343       *-solaris*          )
1344         opsys=sol2
1345         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1346         { test "$extra_verbose" = "yes" && cat << EOF
1347     Defining OS_RELEASE = $os_release
1348 EOF
1349 cat >> confdefs.h <<EOF
1350 #define OS_RELEASE $os_release
1351 EOF
1352 }
1353  ;;
1354
1355             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1356       *-sunos4.0*         ) opsys=sunos4-0      ;;
1357       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1358       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1359       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1360       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1361       *-mach*             ) opsys=mach-bsd4-3   ;;
1362       *                   ) opsys=bsd4-2        ;;
1363     esac
1364
1365     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1366
1367         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1368   ;;
1369
1370     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1371
1372     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1373   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1374
1375     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1376
1377     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1378
1379     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1380       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1381
1382     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1383
1384     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1385
1386     vax-dec-* )
1387     case "$canonical" in
1388       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1389       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1390       *-mach* )                         opsys=mach-bsd4-3 ;;
1391     esac
1392   ;;
1393
1394     ns16k-whitechapel-* ) machine=mg1 ;;
1395
1396     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1397
1398     i[3-9]86-*-* )
1399     machine=intel386
1400     case "$canonical" in
1401       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1402       *-isc2.2* )               opsys=isc2-2 ;;
1403       *-isc4.0* )               opsys=isc4-0 ;;
1404       *-isc4.* )                opsys=isc4-1
1405                                 GCC_TEST_OPTIONS=-posix
1406                                 NON_GCC_TEST_OPTIONS=-Xp
1407                                 ;;
1408       *-isc* )                  opsys=isc3-0 ;;
1409       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1410       *-esix* )                 opsys=esix ;;
1411       *-mach* )                 opsys=mach-bsd4-3 ;;
1412       *-xenix* )                opsys=xenix ;;
1413       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1414       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1415       *-bsdi4* )                opsys=bsdos4 ;;
1416       *-bsdi3* )                opsys=bsdos3 ;;
1417       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1418       *-bsdi2* )                opsys=bsdos2 ;;
1419       *-sco3.2v5* )             opsys=sco5 ;
1420                                                         if test "$dynamic" = "yes" ; then
1421                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1422         else
1423                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1424         fi ;;
1425       *-sysv5* )                opsys=sco7 ;;
1426       *-386bsd* )               opsys=386bsd ;;
1427       *-freebsd* )              opsys=freebsd ;;
1428       *-nextstep* )             opsys=nextstep ;;
1429       *-pc-cygwin* )            opsys=cygwin32 ;;
1430       *-pc-mingw* )             opsys=mingw32 ;
1431                                 test -z "$with_tty" && with_tty="no";;
1432           esac
1433   ;;
1434
1435     m68k-*-linux* ) machine=m68k opsys=linux ;;
1436
1437 esac
1438
1439 if test -z "$machine" -o -z "$opsys"; then
1440   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1441    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1442   ) >&2
1443   exit 1
1444 fi
1445
1446 if test -z "$dynamic"; then
1447   case "$opsys" in
1448     hpux* | sunos4* ) dynamic=no ;;
1449     *) dynamic=yes ;;
1450   esac
1451 fi
1452 if test "$dynamic" = "yes"; then
1453   case "$opsys" in
1454     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1455     decosf* ) ld_call_shared="-call_shared" ;;
1456   esac
1457 else   case "$opsys" in
1458     sol2 )
1459       echo "Static linking is not supported on Solaris 2."
1460       echo "Rerun configure without specifying --dynamic=no."
1461       exit 1 ;;
1462     linux   ) ld_call_shared="-Bstatic" ;;
1463     decosf* ) ld_call_shared="-non_shared" ;;
1464   esac
1465 fi
1466
1467 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1468
1469 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1470 { test "$extra_verbose" = "yes" && cat << EOF
1471     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1472 EOF
1473 cat >> confdefs.h <<EOF
1474 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1475 EOF
1476 }
1477
1478
1479 machfile="m/${machine}.h"
1480 opsysfile="s/${opsys}.h"
1481
1482
1483 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1484 if test "$with_workshop $with_tooltalk" = "yes no"; then
1485   (echo "$progname: Usage error:"
1486 echo " " "--with-workshop requires --with-tooltalk"
1487 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1488 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1489 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1490 fi
1491
1492 if test "$with_workshop" = "yes"; then
1493   { test "$extra_verbose" = "yes" && cat << \EOF
1494     Defining SUNPRO
1495 EOF
1496 cat >> confdefs.h <<\EOF
1497 #define SUNPRO 1
1498 EOF
1499 }
1500
1501   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1502    echo "    xemacs will be linked with \"sunpro.o\""
1503  fi
1504 fi
1505
1506 if test "$with_clash_detection" = "yes"; then
1507   { test "$extra_verbose" = "yes" && cat << \EOF
1508     Defining CLASH_DETECTION
1509 EOF
1510 cat >> confdefs.h <<\EOF
1511 #define CLASH_DETECTION 1
1512 EOF
1513 }
1514
1515   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1516    echo "    xemacs will be linked with \"filelock.o\""
1517  fi
1518 fi
1519
1520 test -n "$compiler" && CC="$compiler"
1521 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1522 fi
1523
1524 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1525 if test "${CFLAGS-unset}" != unset
1526   then cflags_specified=yes;
1527   else cflags_specified=no;
1528 fi
1529
1530 xe_save_CFLAGS="$CFLAGS"
1531
1532 # Extract the first word of "gcc", so it can be a program name with args.
1533 set dummy gcc; ac_word=$2
1534 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1535 echo "configure:1536: checking for $ac_word" >&5
1536
1537 if test -n "$CC"; then
1538   ac_cv_prog_CC="$CC" # Let the user override the test.
1539 else
1540   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1541   ac_dummy="$PATH"
1542   for ac_dir in $ac_dummy; do
1543     test -z "$ac_dir" && ac_dir=.
1544     if test -f $ac_dir/$ac_word; then
1545       ac_cv_prog_CC="gcc"
1546       break
1547     fi
1548   done
1549   IFS="$ac_save_ifs"
1550 fi
1551 CC="$ac_cv_prog_CC"
1552 if test -n "$CC"; then
1553   echo "$ac_t""$CC" 1>&6
1554 else
1555   echo "$ac_t""no" 1>&6
1556 fi
1557
1558 if test -z "$CC"; then
1559   # Extract the first word of "cc", so it can be a program name with args.
1560 set dummy cc; ac_word=$2
1561 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1562 echo "configure:1563: checking for $ac_word" >&5
1563
1564 if test -n "$CC"; then
1565   ac_cv_prog_CC="$CC" # Let the user override the test.
1566 else
1567   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1568   ac_prog_rejected=no
1569   ac_dummy="$PATH"
1570   for ac_dir in $ac_dummy; do
1571     test -z "$ac_dir" && ac_dir=.
1572     if test -f $ac_dir/$ac_word; then
1573       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1574         ac_prog_rejected=yes
1575         continue
1576       fi
1577       ac_cv_prog_CC="cc"
1578       break
1579     fi
1580   done
1581   IFS="$ac_save_ifs"
1582 if test $ac_prog_rejected = yes; then
1583   # We found a bogon in the path, so make sure we never use it.
1584   set dummy $ac_cv_prog_CC
1585   shift
1586   if test $# -gt 0; then
1587     # We chose a different compiler from the bogus one.
1588     # However, it has the same basename, so the bogon will be chosen
1589     # first if we set CC to just the basename; use the full file name.
1590     shift
1591     set dummy "$ac_dir/$ac_word" "$@"
1592     shift
1593     ac_cv_prog_CC="$@"
1594   fi
1595 fi
1596 fi
1597 CC="$ac_cv_prog_CC"
1598 if test -n "$CC"; then
1599   echo "$ac_t""$CC" 1>&6
1600 else
1601   echo "$ac_t""no" 1>&6
1602 fi
1603
1604   if test -z "$CC"; then
1605     case "`uname -s`" in
1606     *win32* | *WIN32*)
1607       # Extract the first word of "cl", so it can be a program name with args.
1608 set dummy cl; ac_word=$2
1609 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1610 echo "configure:1611: checking for $ac_word" >&5
1611
1612 if test -n "$CC"; then
1613   ac_cv_prog_CC="$CC" # Let the user override the test.
1614 else
1615   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1616   ac_dummy="$PATH"
1617   for ac_dir in $ac_dummy; do
1618     test -z "$ac_dir" && ac_dir=.
1619     if test -f $ac_dir/$ac_word; then
1620       ac_cv_prog_CC="cl"
1621       break
1622     fi
1623   done
1624   IFS="$ac_save_ifs"
1625 fi
1626 CC="$ac_cv_prog_CC"
1627 if test -n "$CC"; then
1628   echo "$ac_t""$CC" 1>&6
1629 else
1630   echo "$ac_t""no" 1>&6
1631 fi
1632  ;;
1633     esac
1634   fi
1635   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1636 fi
1637
1638 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1639 echo "configure:1640: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1640
1641 ac_ext=c
1642 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1643 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1644 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1645 ac_cpp='$CPP '"$xe_cppflags"
1646 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1647 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1648 cross_compiling=no
1649
1650 cat > conftest.$ac_ext << EOF
1651
1652 #line 1653 "configure"
1653 #include "confdefs.h"
1654
1655 main(){return(0);}
1656 EOF
1657 if { (eval echo configure:1658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1658   ac_cv_prog_cc_works=yes
1659   # If we can't run a trivial program, we are probably using a cross compiler.
1660   if (./conftest; exit) 2>/dev/null; then
1661     ac_cv_prog_cc_cross=no
1662   else
1663     ac_cv_prog_cc_cross=yes
1664   fi
1665 else
1666   echo "configure: failed program was:" >&5
1667   cat conftest.$ac_ext >&5
1668   ac_cv_prog_cc_works=no
1669 fi
1670 rm -fr conftest*
1671 ac_ext=c
1672 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1673 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1674 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1675 ac_cpp='$CPP '"$xe_cppflags"
1676 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1677 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1678 cross_compiling=no
1679
1680 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1681 if test $ac_cv_prog_cc_works = no; then
1682   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1683 fi
1684 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1685 echo "configure:1686: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1686 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1687 cross_compiling=$ac_cv_prog_cc_cross
1688
1689 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1690 echo "configure:1691: checking whether we are using GNU C" >&5
1691
1692 cat > conftest.c <<EOF
1693 #ifdef __GNUC__
1694   yes;
1695 #endif
1696 EOF
1697 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1698   ac_cv_prog_gcc=yes
1699 else
1700   ac_cv_prog_gcc=no
1701 fi
1702
1703 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1704
1705 if test $ac_cv_prog_gcc = yes; then
1706   GCC=yes
1707 else
1708   GCC=
1709 fi
1710
1711 ac_test_CFLAGS="${CFLAGS+set}"
1712 ac_save_CFLAGS="$CFLAGS"
1713 CFLAGS=
1714 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1715 echo "configure:1716: checking whether ${CC-cc} accepts -g" >&5
1716
1717 echo 'void f(){}' > conftest.c
1718 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1719   ac_cv_prog_cc_g=yes
1720 else
1721   ac_cv_prog_cc_g=no
1722 fi
1723 rm -f conftest*
1724
1725
1726 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1727 if test "$ac_test_CFLAGS" = set; then
1728   CFLAGS="$ac_save_CFLAGS"
1729 elif test $ac_cv_prog_cc_g = yes; then
1730   if test "$GCC" = yes; then
1731     CFLAGS="-g -O2"
1732   else
1733     CFLAGS="-g"
1734   fi
1735 else
1736   if test "$GCC" = yes; then
1737     CFLAGS="-O2"
1738   else
1739     CFLAGS=
1740   fi
1741 fi
1742  
1743 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1744   CC=${NON_GNU_CC-cc}
1745   # Extract the first word of "gcc", so it can be a program name with args.
1746 set dummy gcc; ac_word=$2
1747 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1748 echo "configure:1749: checking for $ac_word" >&5
1749
1750 if test -n "$CC"; then
1751   ac_cv_prog_CC="$CC" # Let the user override the test.
1752 else
1753   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1754   ac_dummy="$PATH"
1755   for ac_dir in $ac_dummy; do
1756     test -z "$ac_dir" && ac_dir=.
1757     if test -f $ac_dir/$ac_word; then
1758       ac_cv_prog_CC="gcc"
1759       break
1760     fi
1761   done
1762   IFS="$ac_save_ifs"
1763 fi
1764 CC="$ac_cv_prog_CC"
1765 if test -n "$CC"; then
1766   echo "$ac_t""$CC" 1>&6
1767 else
1768   echo "$ac_t""no" 1>&6
1769 fi
1770
1771 if test -z "$CC"; then
1772   # Extract the first word of "cc", so it can be a program name with args.
1773 set dummy cc; ac_word=$2
1774 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1775 echo "configure:1776: checking for $ac_word" >&5
1776
1777 if test -n "$CC"; then
1778   ac_cv_prog_CC="$CC" # Let the user override the test.
1779 else
1780   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1781   ac_prog_rejected=no
1782   ac_dummy="$PATH"
1783   for ac_dir in $ac_dummy; do
1784     test -z "$ac_dir" && ac_dir=.
1785     if test -f $ac_dir/$ac_word; then
1786       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1787         ac_prog_rejected=yes
1788         continue
1789       fi
1790       ac_cv_prog_CC="cc"
1791       break
1792     fi
1793   done
1794   IFS="$ac_save_ifs"
1795 if test $ac_prog_rejected = yes; then
1796   # We found a bogon in the path, so make sure we never use it.
1797   set dummy $ac_cv_prog_CC
1798   shift
1799   if test $# -gt 0; then
1800     # We chose a different compiler from the bogus one.
1801     # However, it has the same basename, so the bogon will be chosen
1802     # first if we set CC to just the basename; use the full file name.
1803     shift
1804     set dummy "$ac_dir/$ac_word" "$@"
1805     shift
1806     ac_cv_prog_CC="$@"
1807   fi
1808 fi
1809 fi
1810 CC="$ac_cv_prog_CC"
1811 if test -n "$CC"; then
1812   echo "$ac_t""$CC" 1>&6
1813 else
1814   echo "$ac_t""no" 1>&6
1815 fi
1816
1817   if test -z "$CC"; then
1818     case "`uname -s`" in
1819     *win32* | *WIN32*)
1820       # Extract the first word of "cl", so it can be a program name with args.
1821 set dummy cl; ac_word=$2
1822 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1823 echo "configure:1824: checking for $ac_word" >&5
1824
1825 if test -n "$CC"; then
1826   ac_cv_prog_CC="$CC" # Let the user override the test.
1827 else
1828   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1829   ac_dummy="$PATH"
1830   for ac_dir in $ac_dummy; do
1831     test -z "$ac_dir" && ac_dir=.
1832     if test -f $ac_dir/$ac_word; then
1833       ac_cv_prog_CC="cl"
1834       break
1835     fi
1836   done
1837   IFS="$ac_save_ifs"
1838 fi
1839 CC="$ac_cv_prog_CC"
1840 if test -n "$CC"; then
1841   echo "$ac_t""$CC" 1>&6
1842 else
1843   echo "$ac_t""no" 1>&6
1844 fi
1845  ;;
1846     esac
1847   fi
1848   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1849 fi
1850
1851 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1852 echo "configure:1853: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1853
1854 ac_ext=c
1855 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1856 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1857 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1858 ac_cpp='$CPP '"$xe_cppflags"
1859 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1860 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1861 cross_compiling=no
1862
1863 cat > conftest.$ac_ext << EOF
1864
1865 #line 1866 "configure"
1866 #include "confdefs.h"
1867
1868 main(){return(0);}
1869 EOF
1870 if { (eval echo configure:1871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1871   ac_cv_prog_cc_works=yes
1872   # If we can't run a trivial program, we are probably using a cross compiler.
1873   if (./conftest; exit) 2>/dev/null; then
1874     ac_cv_prog_cc_cross=no
1875   else
1876     ac_cv_prog_cc_cross=yes
1877   fi
1878 else
1879   echo "configure: failed program was:" >&5
1880   cat conftest.$ac_ext >&5
1881   ac_cv_prog_cc_works=no
1882 fi
1883 rm -fr conftest*
1884 ac_ext=c
1885 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1886 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1887 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1888 ac_cpp='$CPP '"$xe_cppflags"
1889 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1890 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1891 cross_compiling=no
1892
1893 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1894 if test $ac_cv_prog_cc_works = no; then
1895   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1896 fi
1897 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1898 echo "configure:1899: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1899 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1900 cross_compiling=$ac_cv_prog_cc_cross
1901
1902 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1903 echo "configure:1904: checking whether we are using GNU C" >&5
1904
1905 cat > conftest.c <<EOF
1906 #ifdef __GNUC__
1907   yes;
1908 #endif
1909 EOF
1910 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1911   ac_cv_prog_gcc=yes
1912 else
1913   ac_cv_prog_gcc=no
1914 fi
1915
1916 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1917
1918 if test $ac_cv_prog_gcc = yes; then
1919   GCC=yes
1920 else
1921   GCC=
1922 fi
1923
1924 ac_test_CFLAGS="${CFLAGS+set}"
1925 ac_save_CFLAGS="$CFLAGS"
1926 CFLAGS=
1927 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1928 echo "configure:1929: checking whether ${CC-cc} accepts -g" >&5
1929
1930 echo 'void f(){}' > conftest.c
1931 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1932   ac_cv_prog_cc_g=yes
1933 else
1934   ac_cv_prog_cc_g=no
1935 fi
1936 rm -f conftest*
1937
1938
1939 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1940 if test "$ac_test_CFLAGS" = set; then
1941   CFLAGS="$ac_save_CFLAGS"
1942 elif test $ac_cv_prog_cc_g = yes; then
1943   if test "$GCC" = yes; then
1944     CFLAGS="-g -O2"
1945   else
1946     CFLAGS="-g"
1947   fi
1948 else
1949   if test "$GCC" = yes; then
1950     CFLAGS="-O2"
1951   else
1952     CFLAGS=
1953   fi
1954 fi
1955
1956 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1957   CC=gcc
1958   # Extract the first word of "gcc", so it can be a program name with args.
1959 set dummy gcc; ac_word=$2
1960 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1961 echo "configure:1962: checking for $ac_word" >&5
1962
1963 if test -n "$CC"; then
1964   ac_cv_prog_CC="$CC" # Let the user override the test.
1965 else
1966   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1967   ac_dummy="$PATH"
1968   for ac_dir in $ac_dummy; do
1969     test -z "$ac_dir" && ac_dir=.
1970     if test -f $ac_dir/$ac_word; then
1971       ac_cv_prog_CC="gcc"
1972       break
1973     fi
1974   done
1975   IFS="$ac_save_ifs"
1976 fi
1977 CC="$ac_cv_prog_CC"
1978 if test -n "$CC"; then
1979   echo "$ac_t""$CC" 1>&6
1980 else
1981   echo "$ac_t""no" 1>&6
1982 fi
1983
1984 if test -z "$CC"; then
1985   # Extract the first word of "cc", so it can be a program name with args.
1986 set dummy cc; ac_word=$2
1987 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1988 echo "configure:1989: checking for $ac_word" >&5
1989
1990 if test -n "$CC"; then
1991   ac_cv_prog_CC="$CC" # Let the user override the test.
1992 else
1993   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1994   ac_prog_rejected=no
1995   ac_dummy="$PATH"
1996   for ac_dir in $ac_dummy; do
1997     test -z "$ac_dir" && ac_dir=.
1998     if test -f $ac_dir/$ac_word; then
1999       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2000         ac_prog_rejected=yes
2001         continue
2002       fi
2003       ac_cv_prog_CC="cc"
2004       break
2005     fi
2006   done
2007   IFS="$ac_save_ifs"
2008 if test $ac_prog_rejected = yes; then
2009   # We found a bogon in the path, so make sure we never use it.
2010   set dummy $ac_cv_prog_CC
2011   shift
2012   if test $# -gt 0; then
2013     # We chose a different compiler from the bogus one.
2014     # However, it has the same basename, so the bogon will be chosen
2015     # first if we set CC to just the basename; use the full file name.
2016     shift
2017     set dummy "$ac_dir/$ac_word" "$@"
2018     shift
2019     ac_cv_prog_CC="$@"
2020   fi
2021 fi
2022 fi
2023 CC="$ac_cv_prog_CC"
2024 if test -n "$CC"; then
2025   echo "$ac_t""$CC" 1>&6
2026 else
2027   echo "$ac_t""no" 1>&6
2028 fi
2029
2030   if test -z "$CC"; then
2031     case "`uname -s`" in
2032     *win32* | *WIN32*)
2033       # Extract the first word of "cl", so it can be a program name with args.
2034 set dummy cl; ac_word=$2
2035 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2036 echo "configure:2037: checking for $ac_word" >&5
2037
2038 if test -n "$CC"; then
2039   ac_cv_prog_CC="$CC" # Let the user override the test.
2040 else
2041   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2042   ac_dummy="$PATH"
2043   for ac_dir in $ac_dummy; do
2044     test -z "$ac_dir" && ac_dir=.
2045     if test -f $ac_dir/$ac_word; then
2046       ac_cv_prog_CC="cl"
2047       break
2048     fi
2049   done
2050   IFS="$ac_save_ifs"
2051 fi
2052 CC="$ac_cv_prog_CC"
2053 if test -n "$CC"; then
2054   echo "$ac_t""$CC" 1>&6
2055 else
2056   echo "$ac_t""no" 1>&6
2057 fi
2058  ;;
2059     esac
2060   fi
2061   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2062 fi
2063
2064 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2065 echo "configure:2066: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2066
2067 ac_ext=c
2068 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2069 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2070 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2071 ac_cpp='$CPP '"$xe_cppflags"
2072 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2073 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2074 cross_compiling=no
2075
2076 cat > conftest.$ac_ext << EOF
2077
2078 #line 2079 "configure"
2079 #include "confdefs.h"
2080
2081 main(){return(0);}
2082 EOF
2083 if { (eval echo configure:2084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2084   ac_cv_prog_cc_works=yes
2085   # If we can't run a trivial program, we are probably using a cross compiler.
2086   if (./conftest; exit) 2>/dev/null; then
2087     ac_cv_prog_cc_cross=no
2088   else
2089     ac_cv_prog_cc_cross=yes
2090   fi
2091 else
2092   echo "configure: failed program was:" >&5
2093   cat conftest.$ac_ext >&5
2094   ac_cv_prog_cc_works=no
2095 fi
2096 rm -fr conftest*
2097 ac_ext=c
2098 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
2099 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
2100 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
2101 ac_cpp='$CPP '"$xe_cppflags"
2102 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
2103 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
2104 cross_compiling=no
2105
2106 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2107 if test $ac_cv_prog_cc_works = no; then
2108   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2109 fi
2110 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2111 echo "configure:2112: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2112 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2113 cross_compiling=$ac_cv_prog_cc_cross
2114
2115 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2116 echo "configure:2117: checking whether we are using GNU C" >&5
2117
2118 cat > conftest.c <<EOF
2119 #ifdef __GNUC__
2120   yes;
2121 #endif
2122 EOF
2123 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2124   ac_cv_prog_gcc=yes
2125 else
2126   ac_cv_prog_gcc=no
2127 fi
2128
2129 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2130
2131 if test $ac_cv_prog_gcc = yes; then
2132   GCC=yes
2133 else
2134   GCC=
2135 fi
2136
2137 ac_test_CFLAGS="${CFLAGS+set}"
2138 ac_save_CFLAGS="$CFLAGS"
2139 CFLAGS=
2140 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2141 echo "configure:2142: checking whether ${CC-cc} accepts -g" >&5
2142
2143 echo 'void f(){}' > conftest.c
2144 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2145   ac_cv_prog_cc_g=yes
2146 else
2147   ac_cv_prog_cc_g=no
2148 fi
2149 rm -f conftest*
2150
2151
2152 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2153 if test "$ac_test_CFLAGS" = set; then
2154   CFLAGS="$ac_save_CFLAGS"
2155 elif test $ac_cv_prog_cc_g = yes; then
2156   if test "$GCC" = yes; then
2157     CFLAGS="-g -O2"
2158   else
2159     CFLAGS="-g"
2160   fi
2161 else
2162   if test "$GCC" = yes; then
2163     CFLAGS="-O2"
2164   else
2165     CFLAGS=
2166   fi
2167 fi
2168
2169 fi
2170 CFLAGS="$xe_save_CFLAGS"
2171
2172
2173 test -n "$CPP" -a -d "$CPP" && CPP=
2174
2175 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2176
2177 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2178 echo "configure:2179: checking how to run the C preprocessor" >&5
2179 # On Suns, sometimes $CPP names a directory.
2180 if test -n "$CPP" && test -d "$CPP"; then
2181   CPP=
2182 fi
2183 if test -z "$CPP"; then
2184
2185   # This must be in double quotes, not single quotes, because CPP may get
2186   # substituted into the Makefile and "${CC-cc}" will confuse make.
2187   CPP="${CC-cc} -E"
2188   # On the NeXT, cc -E runs the code through the compiler's parser,
2189   # not just through cpp.
2190   cat > conftest.$ac_ext <<EOF
2191 #line 2192 "configure"
2192 #include "confdefs.h"
2193 #include <assert.h>
2194 Syntax Error
2195 EOF
2196 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2197 { (eval echo configure:2198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2198 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2199 if test -z "$ac_err"; then
2200   :
2201 else
2202   echo "$ac_err" >&5
2203   echo "configure: failed program was:" >&5
2204   cat conftest.$ac_ext >&5
2205   rm -rf conftest*
2206   CPP="${CC-cc} -E -traditional-cpp"
2207   cat > conftest.$ac_ext <<EOF
2208 #line 2209 "configure"
2209 #include "confdefs.h"
2210 #include <assert.h>
2211 Syntax Error
2212 EOF
2213 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2214 { (eval echo configure:2215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2215 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2216 if test -z "$ac_err"; then
2217   :
2218 else
2219   echo "$ac_err" >&5
2220   echo "configure: failed program was:" >&5
2221   cat conftest.$ac_ext >&5
2222   rm -rf conftest*
2223   CPP="${CC-cc} -nologo -E"
2224   cat > conftest.$ac_ext <<EOF
2225 #line 2226 "configure"
2226 #include "confdefs.h"
2227 #include <assert.h>
2228 Syntax Error
2229 EOF
2230 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2231 { (eval echo configure:2232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2232 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2233 if test -z "$ac_err"; then
2234   :
2235 else
2236   echo "$ac_err" >&5
2237   echo "configure: failed program was:" >&5
2238   cat conftest.$ac_ext >&5
2239   rm -rf conftest*
2240   CPP=/lib/cpp
2241 fi
2242 rm -f conftest*
2243 fi
2244 rm -f conftest*
2245 fi
2246 rm -f conftest*
2247   ac_cv_prog_CPP="$CPP"
2248   CPP="$ac_cv_prog_CPP"
2249 else
2250   ac_cv_prog_CPP="$CPP"
2251 fi
2252 echo "$ac_t""$CPP" 1>&6
2253
2254
2255 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2256 echo "configure:2257: checking for AIX" >&5
2257 cat > conftest.$ac_ext <<EOF
2258 #line 2259 "configure"
2259 #include "confdefs.h"
2260 #ifdef _AIX
2261   yes
2262 #endif
2263
2264 EOF
2265 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2266   egrep "yes" >/dev/null 2>&1; then
2267   rm -rf conftest*
2268   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2269     Defining _ALL_SOURCE
2270 EOF
2271 cat >> confdefs.h <<\EOF
2272 #define _ALL_SOURCE 1
2273 EOF
2274 }
2275
2276 else
2277   rm -rf conftest*
2278   echo "$ac_t""no" 1>&6
2279 fi
2280 rm -f conftest*
2281
2282
2283
2284 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2285 echo "configure:2286: checking for GNU libc" >&5
2286 cat > conftest.$ac_ext <<EOF
2287 #line 2288 "configure"
2288 #include "confdefs.h"
2289 #include <features.h>
2290 int main() {
2291
2292 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2293 #error Not a GNU libc system :-(
2294 ******* ======= ******** &&&&&&&&
2295 #endif
2296
2297 ; return 0; }
2298 EOF
2299 if { (eval echo configure:2300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2300   rm -rf conftest*
2301   have_glibc=yes
2302 else
2303   echo "configure: failed program was:" >&5
2304   cat conftest.$ac_ext >&5
2305   rm -rf conftest*
2306   have_glibc=no
2307 fi
2308 rm -f conftest*
2309 echo "$ac_t""$have_glibc" 1>&6
2310 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2311     Defining _GNU_SOURCE
2312 EOF
2313 cat >> confdefs.h <<\EOF
2314 #define _GNU_SOURCE 1
2315 EOF
2316 }
2317
2318
2319
2320 cat > conftest.$ac_ext <<EOF
2321 #line 2322 "configure"
2322 #include "confdefs.h"
2323 int main () {
2324 #if defined __SUNPRO_C
2325 return 11;
2326 #elif defined __DECC
2327 return 12;
2328 #else
2329 return 0;
2330 #endif
2331 }
2332 EOF
2333 if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2334 then
2335   :
2336 else
2337   conftest_rc="$?"
2338   echo "configure: failed program was:" >&5
2339   cat conftest.$ac_ext >&5
2340   rm -fr conftest*
2341   case "$conftest_rc" in
2342   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2343   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2344 esac
2345 fi
2346 rm -fr conftest*
2347
2348
2349
2350
2351 echo "Extracting information from the machine- and system-dependent headers..."
2352
2353 tempcname="conftest.c"
2354
2355
2356
2357 cat > $tempcname <<EOF
2358 #define NOT_C_CODE
2359 #define C_SWITCH_SITE
2360 #define C_SWITCH_X_SITE
2361 #define LD_SWITCH_SITE
2362 #define LD_SWITCH_X_SITE
2363 #define LD_SWITCH_X_SITE_AUX
2364 #define OS_RELEASE $os_release
2365 #include "$srcdir/src/$opsysfile"
2366 #include "$srcdir/src/$machfile"
2367
2368 #ifndef LIBS_MACHINE
2369 #define LIBS_MACHINE
2370 #endif
2371 configure___ libs_machine=LIBS_MACHINE
2372
2373 #ifndef LIBS_SYSTEM
2374 #define LIBS_SYSTEM
2375 #endif
2376 configure___ libs_system=LIBS_SYSTEM
2377
2378 #ifndef LIBS_TERMCAP
2379 #define LIBS_TERMCAP
2380 #endif
2381 configure___ libs_termcap=LIBS_TERMCAP
2382
2383 #ifndef LIB_STANDARD
2384 #define LIB_STANDARD
2385 #endif
2386 configure___ libs_standard=LIB_STANDARD
2387
2388
2389 #ifndef OBJECTS_MACHINE
2390 #define OBJECTS_MACHINE
2391 #endif
2392 configure___ objects_machine=OBJECTS_MACHINE
2393
2394 #ifndef OBJECTS_SYSTEM
2395 #define OBJECTS_SYSTEM
2396 #endif
2397 configure___ objects_system=OBJECTS_SYSTEM
2398
2399
2400 #ifndef C_SWITCH_MACHINE
2401 #define C_SWITCH_MACHINE
2402 #endif
2403 configure___ c_switch_machine=C_SWITCH_MACHINE
2404
2405 #ifndef C_SWITCH_SYSTEM
2406 #define C_SWITCH_SYSTEM
2407 #endif
2408 configure___ c_switch_system=C_SWITCH_SYSTEM
2409
2410
2411 #ifndef LD_SWITCH_MACHINE
2412 #define LD_SWITCH_MACHINE
2413 #endif
2414 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2415
2416 #ifndef LD_SWITCH_SYSTEM
2417 #define LD_SWITCH_SYSTEM
2418 #endif
2419 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2420
2421
2422 #ifndef UNEXEC
2423 #define UNEXEC "unexec.o"
2424 #endif
2425 configure___ unexec=UNEXEC
2426
2427
2428 #ifndef LD_SWITCH_SHARED
2429 #define LD_SWITCH_SHARED "-c"
2430 #endif
2431 configure___ ld_switch_shared=LD_SWITCH_SHARED
2432
2433
2434 #ifdef ORDINARY_LINK
2435 #define LD "\$(CC) \$(CFLAGS)"
2436 #else /* no ORDINARY LINK */
2437 #ifdef COFF_ENCAPSULATE
2438 #define LD "\$(CC) -nostdlib"
2439 #else /* not COFF_ENCAPSULATE */
2440 #ifdef LINKER
2441 #define LD LINKER
2442 #else /* ! defined (LINKER) */
2443 #define LD "ld"
2444 #endif /* ! defined (LINKER) */
2445 #endif /* ! defined (COFF_ENCAPSULATE) */
2446 #endif /* not ORDINARY_LINK */
2447 configure___ ld=LD
2448
2449 #ifndef LIB_GCC
2450 #define LIB_GCC
2451 #endif
2452 configure___ lib_gcc=LIB_GCC
2453
2454 #ifndef LD_TEXT_START_ADDR
2455 #define LD_TEXT_START_ADDR
2456 #endif
2457 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2458
2459
2460 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2461 #ifdef NO_REMAP
2462 #ifdef COFF_ENCAPSULATE
2463 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2464 #else /* ! defined (COFF_ENCAPSULATE) */
2465 #define START_FILES "pre-crt0.o /lib/crt0.o"
2466 #endif /* ! defined (COFF_ENCAPSULATE) */
2467 #else /* ! defined (NO_REMAP) */
2468 #define START_FILES "ecrt0.o"
2469 #endif /* ! defined (NO_REMAP) */
2470 #endif /* no ORDINARY_LINK */
2471 #ifndef START_FILES
2472 #define START_FILES
2473 #endif
2474 configure___ start_files=START_FILES
2475
2476 #ifdef ORDINARY_LINK
2477 configure___ ordinary_link=yes
2478 #else
2479 configure___ ordinary_link=no
2480 #endif
2481
2482 #ifdef SYSTEM_MALLOC
2483 configure___ system_malloc=yes
2484 #else
2485 configure___ system_malloc=no
2486 #endif
2487
2488 #ifdef TERMINFO
2489 configure___ have_terminfo=yes
2490 #else
2491 configure___ have_terminfo=no
2492 #endif
2493
2494 #ifdef MAIL_USE_FLOCK
2495 configure___ mail_use_flock=yes
2496 #else
2497 configure___ mail_use_flock=no
2498 #endif
2499
2500 #ifdef MAIL_USE_LOCKF
2501 configure___ mail_use_lockf=yes
2502 #else
2503 configure___ mail_use_lockf=no
2504 #endif
2505
2506 #ifdef HAVE_WIN32_PROCESSES
2507 configure___ win32_processes=yes
2508 #else
2509 configure___ win32_processes=no
2510 #endif
2511
2512 EOF
2513
2514 CPP=`eval "echo $CPP $CPPFLAGS"`
2515 eval `$CPP -Isrc $tempcname \
2516         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2517
2518 rm $tempcname
2519
2520 test "$extra_verbose" = "yes" && \
2521   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 ""
2522
2523 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2524
2525 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2526
2527 if test "$cflags_specified" = "no"; then
2528       if   test "$GCC" = "yes"; then
2529     CFLAGS="-g -O3 -Wall -Wno-switch"
2530               elif test "$__SUNPRO_C" = "yes"; then
2531     case "$opsys" in
2532       sol2    ) CFLAGS="-v -xO4" ;;
2533       sunos4* ) CFLAGS="-xO2";;
2534     esac
2535   elif test "$__DECC" = "yes"; then
2536     CFLAGS="-O3"
2537   elif test "$CC" = "xlc"; then
2538     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2539     else
2540     CFLAGS="-O" ;  fi
2541 fi
2542
2543
2544 if test "$GCC" = "yes"; then
2545   set x $ld_switch_system; shift; ld_switch_system=""
2546   while test -n "$1"; do
2547     case $1 in
2548       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2549       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2550       -Xlinker* ) ;;
2551       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2552     esac
2553     shift
2554   done
2555 fi
2556
2557 if test "$GCC" = "yes"; then
2558   set x $ld_switch_machine; shift; ld_switch_machine=""
2559   while test -n "$1"; do
2560     case $1 in
2561       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2562       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2563       -Xlinker* ) ;;
2564       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2565     esac
2566     shift
2567   done
2568 fi
2569
2570 if test "$GCC" = "yes"; then
2571   set x $LDFLAGS; shift; LDFLAGS=""
2572   while test -n "$1"; do
2573     case $1 in
2574       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2575       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2576       -Xlinker* ) ;;
2577       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2578     esac
2579     shift
2580   done
2581 fi
2582
2583 if test "$GCC" = "yes"; then
2584   set x $ld_call_shared; shift; ld_call_shared=""
2585   while test -n "$1"; do
2586     case $1 in
2587       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2588       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2589       -Xlinker* ) ;;
2590       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2591     esac
2592     shift
2593   done
2594 fi
2595
2596 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2597    echo "    xemacs will be linked with \"$objects_machine\""
2598  fi
2599 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2600    echo "    xemacs will be linked with \"$objects_system\""
2601  fi
2602 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2603    echo "    xemacs will be linked with \"$unexec\""
2604  fi
2605
2606 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2607 echo "configure:2608: checking for dynodump" >&5
2608 if test "$unexec" != "unexsol2.o"; then
2609   echo "$ac_t""no" 1>&6
2610 else
2611   echo "$ac_t""yes" 1>&6
2612   { test "$extra_verbose" = "yes" && cat << \EOF
2613     Defining DYNODUMP
2614 EOF
2615 cat >> confdefs.h <<\EOF
2616 #define DYNODUMP 1
2617 EOF
2618 }
2619
2620   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2621   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2622   case "$machine" in
2623     sparc   ) dynodump_arch=sparc ;;
2624     *86*    ) dynodump_arch=i386  ;;
2625     powerpc ) dynodump_arch=ppc   ;;
2626   esac
2627     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
2628 fi
2629
2630
2631 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2632
2633 if test "$unexec" = "unexaix.o"; then
2634   if   test "$dynamic" = "no"; then
2635   start_flags="-Wl,-bnso,-bnodelcsect"
2636   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2637   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2638     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2639   done
2640   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2641     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2642   done
2643   
2644 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2645 echo "configure:2646: checking for terminateAndUnload in -lC" >&5
2646 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2647
2648 xe_check_libs=" -lC "
2649 cat > conftest.$ac_ext <<EOF
2650 #line 2651 "configure"
2651 #include "confdefs.h"
2652 /* Override any gcc2 internal prototype to avoid an error.  */
2653 /* We use char because int might match the return type of a gcc2
2654     builtin and then its argument prototype would still apply.  */
2655 char terminateAndUnload();
2656
2657 int main() {
2658 terminateAndUnload()
2659 ; return 0; }
2660 EOF
2661 if { (eval echo configure:2662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2662   rm -rf conftest*
2663   eval "ac_cv_lib_$ac_lib_var=yes"
2664 else
2665   echo "configure: failed program was:" >&5
2666   cat conftest.$ac_ext >&5
2667   rm -rf conftest*
2668   eval "ac_cv_lib_$ac_lib_var=no"
2669 fi
2670 rm -f conftest*
2671 xe_check_libs=""
2672
2673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2674   echo "$ac_t""yes" 1>&6
2675   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2676 else
2677   echo "$ac_t""no" 1>&6
2678 fi
2679
2680
2681   fi
2682 elif test -n "$ld_text_start_addr"; then
2683   start_flags="-T $ld_text_start_addr -e __start"
2684 fi
2685
2686
2687
2688
2689 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2690  test -z "$linker" &&  linker='$(CC) -nostdlib'
2691  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2692 fi
2693 test "$GCC" != "yes" && lib_gcc=
2694
2695
2696
2697
2698
2699 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2700 if test -n "$site_libraries"; then
2701   for arg in $site_libraries; do
2702     case "$arg" in
2703      -* ) ;;
2704      * ) test -d "$arg" || \
2705            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2706        arg="-L${arg}" ;;
2707     esac
2708     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2709   done
2710 fi
2711
2712 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2713 if test -n "$site_includes"; then
2714   for arg in $site_includes; do
2715     case "$arg" in
2716       -* ) ;;
2717       * ) test -d "$arg" || \
2718            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2719       arg="-I${arg}" ;;
2720     esac
2721     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2722   done
2723 fi
2724
2725 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2726 if test -n "$site_prefixes"; then
2727   for dir in $site_prefixes; do
2728     lib_dir="${dir}/lib"
2729     inc_dir="${dir}/include"
2730     if test ! -d "$dir"; then
2731       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2732     elif test ! -d "$lib_dir"; then
2733       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2734     else
2735       if test -d "$inc_dir"; then
2736         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
2737       fi
2738       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
2739     fi
2740   done
2741 fi
2742
2743
2744 for dir in "/usr/ccs/lib"; do
2745   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
2746 done
2747
2748 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2749 if test -n "$site_runtime_libraries"; then
2750   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2751   export LD_RUN_PATH
2752 fi
2753
2754
2755 if   test "$dynamic" = "no"; then add_runtime_path=no
2756 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2757 else case "$opsys" in
2758        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2759        * ) add_runtime_path=no ;;
2760      esac
2761 fi
2762
2763 if test "$add_runtime_path" = "yes"; then
2764       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2765 echo "configure:2766: checking "for runtime libraries flag"" >&5
2766   case "$opsys" in
2767     sol2 ) dash_r="-R" ;;
2768     decosf* | linux* | irix*) dash_r="-rpath " ;;
2769     *)
2770       dash_r=""
2771       for try_dash_r in "-R" "-R " "-rpath "; do
2772         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2773         
2774 if test "$GCC" = "yes"; then
2775   set x $xe_check_libs; shift; xe_check_libs=""
2776   while test -n "$1"; do
2777     case $1 in
2778       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2779       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2780       -Xlinker* ) ;;
2781       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2782     esac
2783     shift
2784   done
2785 fi
2786         cat > conftest.$ac_ext <<EOF
2787 #line 2788 "configure"
2788 #include "confdefs.h"
2789
2790 int main() {
2791
2792 ; return 0; }
2793 EOF
2794 if { (eval echo configure:2795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2795   rm -rf conftest*
2796   dash_r="$try_dash_r"
2797 else
2798   echo "configure: failed program was:" >&5
2799   cat conftest.$ac_ext >&5
2800 fi
2801 rm -f conftest*
2802         xe_check_libs=""
2803         test -n "$dash_r" && break
2804       done ;;
2805   esac
2806   if test -n "$dash_r";
2807     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2808     else echo "$ac_t""NONE" 1>&6
2809   fi
2810 fi
2811
2812 xe_add_unique_runpath_dir='
2813   xe_add_p=yes
2814   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2815   done
2816   if test "$xe_add_p" = "yes"; then
2817     test -n "$runpath" && runpath="${runpath}:"
2818     runpath="${runpath}${xe_runpath_dir}"
2819     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2820   fi'
2821
2822
2823
2824
2825 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2826     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2827   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2828   
2829         runpath="" runpath_dirs=""
2830   if test -n "$LD_RUN_PATH"; then
2831     runpath="$LD_RUN_PATH"
2832   elif test "$GCC" = "yes"; then
2833         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2834     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2835     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2836     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2837       case "$arg" in P,* | -L* | -R* )
2838         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2839           {
2840 xe_runpath_dir="$dir"
2841   test "$xe_runpath_dir" != "/lib"     -a \
2842         "$xe_runpath_dir" != "/usr/lib" -a \
2843         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2844   eval "$xe_add_unique_runpath_dir"
2845 }
2846         done ;;
2847       esac
2848     done
2849     ld_switch_run="$ld_switch_run_save"
2850     rm -f conftest*
2851   else
2852         for arg in $ld_switch_site $ld_switch_x_site; do
2853       case "$arg" in -L*) {
2854 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2855   test "$xe_runpath_dir" != "/lib"     -a \
2856         "$xe_runpath_dir" != "/usr/lib" -a \
2857         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2858   eval "$xe_add_unique_runpath_dir"
2859 };; esac
2860     done
2861         if test "$opsys $need_motif" = "sol2 yes"; then
2862       xe_runpath_dir="/opt/SUNWdt/lib";
2863       eval "$xe_add_unique_runpath_dir";
2864     fi
2865   fi 
2866   if test -n "$runpath"; then
2867     ld_switch_run="${dash_r}${runpath}"
2868     
2869 if test "$GCC" = "yes"; then
2870   set x $ld_switch_run; shift; ld_switch_run=""
2871   while test -n "$1"; do
2872     case $1 in
2873       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2874       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2875       -Xlinker* ) ;;
2876       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2877     esac
2878     shift
2879   done
2880 fi
2881     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2882   fi
2883 fi
2884
2885
2886
2887
2888 GNU_MALLOC=yes
2889 if test "$with_dlmalloc" != "no"; then
2890         doug_lea_malloc=yes
2891 else
2892         doug_lea_malloc=no
2893 fi
2894 after_morecore_hook_exists=yes
2895 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2896 echo "configure:2897: checking for malloc_get_state" >&5
2897
2898 cat > conftest.$ac_ext <<EOF
2899 #line 2900 "configure"
2900 #include "confdefs.h"
2901 /* System header to define __stub macros and hopefully few prototypes,
2902     which can conflict with char malloc_get_state(); below.  */
2903 #include <assert.h>
2904 /* Override any gcc2 internal prototype to avoid an error.  */
2905 /* We use char because int might match the return type of a gcc2
2906     builtin and then its argument prototype would still apply.  */
2907 char malloc_get_state();
2908
2909 int main() {
2910
2911 /* The GNU C library defines this for functions which it implements
2912     to always fail with ENOSYS.  Some functions are actually named
2913     something starting with __ and the normal name is an alias.  */
2914 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2915 choke me
2916 #else
2917 malloc_get_state();
2918 #endif
2919
2920 ; return 0; }
2921 EOF
2922 if { (eval echo configure:2923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2923   rm -rf conftest*
2924   eval "ac_cv_func_malloc_get_state=yes"
2925 else
2926   echo "configure: failed program was:" >&5
2927   cat conftest.$ac_ext >&5
2928   rm -rf conftest*
2929   eval "ac_cv_func_malloc_get_state=no"
2930 fi
2931 rm -f conftest*
2932
2933 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2934   echo "$ac_t""yes" 1>&6
2935   :
2936 else
2937   echo "$ac_t""no" 1>&6
2938 doug_lea_malloc=no
2939 fi
2940
2941 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2942 echo "configure:2943: checking for malloc_set_state" >&5
2943
2944 cat > conftest.$ac_ext <<EOF
2945 #line 2946 "configure"
2946 #include "confdefs.h"
2947 /* System header to define __stub macros and hopefully few prototypes,
2948     which can conflict with char malloc_set_state(); below.  */
2949 #include <assert.h>
2950 /* Override any gcc2 internal prototype to avoid an error.  */
2951 /* We use char because int might match the return type of a gcc2
2952     builtin and then its argument prototype would still apply.  */
2953 char malloc_set_state();
2954
2955 int main() {
2956
2957 /* The GNU C library defines this for functions which it implements
2958     to always fail with ENOSYS.  Some functions are actually named
2959     something starting with __ and the normal name is an alias.  */
2960 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2961 choke me
2962 #else
2963 malloc_set_state();
2964 #endif
2965
2966 ; return 0; }
2967 EOF
2968 if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2969   rm -rf conftest*
2970   eval "ac_cv_func_malloc_set_state=yes"
2971 else
2972   echo "configure: failed program was:" >&5
2973   cat conftest.$ac_ext >&5
2974   rm -rf conftest*
2975   eval "ac_cv_func_malloc_set_state=no"
2976 fi
2977 rm -f conftest*
2978
2979 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2980   echo "$ac_t""yes" 1>&6
2981   :
2982 else
2983   echo "$ac_t""no" 1>&6
2984 doug_lea_malloc=no
2985 fi
2986
2987 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2988 echo "configure:2989: checking whether __after_morecore_hook exists" >&5
2989 cat > conftest.$ac_ext <<EOF
2990 #line 2991 "configure"
2991 #include "confdefs.h"
2992 extern void (* __after_morecore_hook)();
2993 int main() {
2994 __after_morecore_hook = 0
2995 ; return 0; }
2996 EOF
2997 if { (eval echo configure:2998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2998   rm -rf conftest*
2999   echo "$ac_t""yes" 1>&6
3000 else
3001   echo "configure: failed program was:" >&5
3002   cat conftest.$ac_ext >&5
3003   rm -rf conftest*
3004   echo "$ac_t""no" 1>&6
3005    after_morecore_hook_exists=no
3006 fi
3007 rm -f conftest*
3008 if test "$system_malloc" = "yes" ; then
3009   GNU_MALLOC=no
3010   GNU_MALLOC_reason="
3011   (The GNU allocators don't work with this system configuration)."
3012 elif test "$with_system_malloc" = "yes" ; then
3013   GNU_MALLOC=no
3014   GNU_MALLOC_reason="
3015   (User chose not to use GNU allocators)."
3016 elif test "$with_debug_malloc" = "yes" ; then
3017   GNU_MALLOC=no
3018   GNU_MALLOC_reason="
3019   (User chose to use Debugging Malloc)."
3020 fi
3021
3022 if test "$doug_lea_malloc" = "yes" ; then
3023   if test "$GNU_MALLOC" = yes ; then
3024     GNU_MALLOC_reason="
3025   (Using Doug Lea's new malloc from the GNU C Library.)"
3026   fi
3027   { test "$extra_verbose" = "yes" && cat << \EOF
3028     Defining DOUG_LEA_MALLOC
3029 EOF
3030 cat >> confdefs.h <<\EOF
3031 #define DOUG_LEA_MALLOC 1
3032 EOF
3033 }
3034
3035   if test "$after_morecore_hook_exists" = "no" ; then
3036     GNU_MALLOC_reason="
3037   (Using Doug Lea's new malloc from the Linux C Library.)"
3038     { test "$extra_verbose" = "yes" && cat << \EOF
3039     Defining _NO_MALLOC_WARNING_
3040 EOF
3041 cat >> confdefs.h <<\EOF
3042 #define _NO_MALLOC_WARNING_ 1
3043 EOF
3044 }
3045
3046   fi
3047   use_minimal_tagbits=yes
3048 fi
3049
3050
3051
3052
3053 # Extract the first word of "ranlib", so it can be a program name with args.
3054 set dummy ranlib; ac_word=$2
3055 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3056 echo "configure:3057: checking for $ac_word" >&5
3057
3058 if test -n "$RANLIB"; then
3059   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3060 else
3061   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3062   ac_dummy="$PATH"
3063   for ac_dir in $ac_dummy; do
3064     test -z "$ac_dir" && ac_dir=.
3065     if test -f $ac_dir/$ac_word; then
3066       ac_cv_prog_RANLIB="ranlib"
3067       break
3068     fi
3069   done
3070   IFS="$ac_save_ifs"
3071   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3072 fi
3073 RANLIB="$ac_cv_prog_RANLIB"
3074 if test -n "$RANLIB"; then
3075   echo "$ac_t""$RANLIB" 1>&6
3076 else
3077   echo "$ac_t""no" 1>&6
3078 fi
3079
3080 ac_aux_dir=
3081 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3082   if test -f $ac_dir/install-sh; then
3083     ac_aux_dir=$ac_dir
3084     ac_install_sh="$ac_aux_dir/install-sh -c"
3085     break
3086   elif test -f $ac_dir/install.sh; then
3087     ac_aux_dir=$ac_dir
3088     ac_install_sh="$ac_aux_dir/install.sh -c"
3089     break
3090   fi
3091 done
3092 if test -z "$ac_aux_dir"; then
3093   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3094 fi
3095 ac_config_guess=$ac_aux_dir/config.guess
3096 ac_config_sub=$ac_aux_dir/config.sub
3097 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3098
3099 # Find a good install program.  We prefer a C program (faster),
3100 # so one script is as good as another.  But avoid the broken or
3101 # incompatible versions:
3102 # SysV /etc/install, /usr/sbin/install
3103 # SunOS /usr/etc/install
3104 # IRIX /sbin/install
3105 # AIX /bin/install
3106 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3107 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3108 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3109 # ./install, which can be erroneously created by make from ./install.sh.
3110 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3111 echo "configure:3112: checking for a BSD compatible install" >&5
3112 if test -z "$INSTALL"; then
3113
3114   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS=":"
3115   for ac_dir in $PATH; do
3116     # Account for people who put trailing slashes in PATH elements.
3117     case "$ac_dir/" in
3118     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
3119     *)
3120       # OSF1 and SCO ODT 3.0 have their own names for install.
3121       # Don't use installbsd from OSF since it installs stuff as root
3122       # by default.
3123       for ac_prog in ginstall scoinst install; do
3124         if test -f $ac_dir/$ac_prog; then
3125           if test $ac_prog = install &&
3126             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
3127             # AIX install.  It has an incompatible calling convention.
3128             :
3129           else
3130             ac_cv_path_install="$ac_dir/$ac_prog -c"
3131             break 2
3132           fi
3133         fi
3134       done
3135       ;;
3136     esac
3137   done
3138   IFS="$ac_save_IFS"
3139
3140   if test "${ac_cv_path_install+set}" = set; then
3141     INSTALL="$ac_cv_path_install"
3142   else
3143     # As a last resort, use the slow shell script.  We don't cache a
3144     # path for INSTALL within a source directory, because that will
3145     # break other packages using the cache if that directory is
3146     # removed, or if the path is relative.
3147     INSTALL="$ac_install_sh"
3148   fi
3149 fi
3150 echo "$ac_t""$INSTALL" 1>&6
3151
3152 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3153 # It thinks the first close brace ends the variable substitution.
3154 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3155
3156 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
3157
3158 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3159
3160 for ac_prog in 'bison -y' byacc
3161 do
3162 # Extract the first word of "$ac_prog", so it can be a program name with args.
3163 set dummy $ac_prog; ac_word=$2
3164 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3165 echo "configure:3166: checking for $ac_word" >&5
3166
3167 if test -n "$YACC"; then
3168   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3169 else
3170   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3171   ac_dummy="$PATH"
3172   for ac_dir in $ac_dummy; do
3173     test -z "$ac_dir" && ac_dir=.
3174     if test -f $ac_dir/$ac_word; then
3175       ac_cv_prog_YACC="$ac_prog"
3176       break
3177     fi
3178   done
3179   IFS="$ac_save_ifs"
3180 fi
3181 YACC="$ac_cv_prog_YACC"
3182 if test -n "$YACC"; then
3183   echo "$ac_t""$YACC" 1>&6
3184 else
3185   echo "$ac_t""no" 1>&6
3186 fi
3187
3188 test -n "$YACC" && break
3189 done
3190 test -n "$YACC" || YACC="yacc"
3191
3192
3193 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
3194 do
3195 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3196 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3197 echo "configure:3198: checking for $ac_hdr" >&5
3198
3199 cat > conftest.$ac_ext <<EOF
3200 #line 3201 "configure"
3201 #include "confdefs.h"
3202 #include <$ac_hdr>
3203 EOF
3204 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3205 { (eval echo configure:3206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3206 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3207 if test -z "$ac_err"; then
3208   rm -rf conftest*
3209   eval "ac_cv_header_$ac_safe=yes"
3210 else
3211   echo "$ac_err" >&5
3212   echo "configure: failed program was:" >&5
3213   cat conftest.$ac_ext >&5
3214   rm -rf conftest*
3215   eval "ac_cv_header_$ac_safe=no"
3216 fi
3217 rm -f conftest*
3218 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3219   echo "$ac_t""yes" 1>&6
3220     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3221   { test "$extra_verbose" = "yes" && cat << EOF
3222     Defining $ac_tr_hdr
3223 EOF
3224 cat >> confdefs.h <<EOF
3225 #define $ac_tr_hdr 1
3226 EOF
3227 }
3228  
3229 else
3230   echo "$ac_t""no" 1>&6
3231 fi
3232 done
3233
3234 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3235 do
3236 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3237 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3238 echo "configure:3239: checking for $ac_hdr" >&5
3239
3240 cat > conftest.$ac_ext <<EOF
3241 #line 3242 "configure"
3242 #include "confdefs.h"
3243 #include <$ac_hdr>
3244 EOF
3245 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3246 { (eval echo configure:3247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3247 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3248 if test -z "$ac_err"; then
3249   rm -rf conftest*
3250   eval "ac_cv_header_$ac_safe=yes"
3251 else
3252   echo "$ac_err" >&5
3253   echo "configure: failed program was:" >&5
3254   cat conftest.$ac_ext >&5
3255   rm -rf conftest*
3256   eval "ac_cv_header_$ac_safe=no"
3257 fi
3258 rm -f conftest*
3259 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3260   echo "$ac_t""yes" 1>&6
3261     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3262   { test "$extra_verbose" = "yes" && cat << EOF
3263     Defining $ac_tr_hdr
3264 EOF
3265 cat >> confdefs.h <<EOF
3266 #define $ac_tr_hdr 1
3267 EOF
3268 }
3269  
3270 else
3271   echo "$ac_t""no" 1>&6
3272 fi
3273 done
3274
3275 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3276 do
3277 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3278 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3279 echo "configure:3280: checking for $ac_hdr" >&5
3280
3281 cat > conftest.$ac_ext <<EOF
3282 #line 3283 "configure"
3283 #include "confdefs.h"
3284 #include <$ac_hdr>
3285 EOF
3286 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3287 { (eval echo configure:3288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3288 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3289 if test -z "$ac_err"; then
3290   rm -rf conftest*
3291   eval "ac_cv_header_$ac_safe=yes"
3292 else
3293   echo "$ac_err" >&5
3294   echo "configure: failed program was:" >&5
3295   cat conftest.$ac_ext >&5
3296   rm -rf conftest*
3297   eval "ac_cv_header_$ac_safe=no"
3298 fi
3299 rm -f conftest*
3300 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3301   echo "$ac_t""yes" 1>&6
3302     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3303   { test "$extra_verbose" = "yes" && cat << EOF
3304     Defining $ac_tr_hdr
3305 EOF
3306 cat >> confdefs.h <<EOF
3307 #define $ac_tr_hdr 1
3308 EOF
3309 }
3310  
3311 else
3312   echo "$ac_t""no" 1>&6
3313 fi
3314 done
3315
3316 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3317 echo "configure:3318: checking for sys/wait.h that is POSIX.1 compatible" >&5
3318
3319 cat > conftest.$ac_ext <<EOF
3320 #line 3321 "configure"
3321 #include "confdefs.h"
3322 #include <sys/types.h>
3323 #include <sys/wait.h>
3324 #ifndef WEXITSTATUS
3325 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3326 #endif
3327 #ifndef WIFEXITED
3328 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3329 #endif
3330 int main() {
3331 int s;
3332 wait (&s);
3333 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3334 ; return 0; }
3335 EOF
3336 if { (eval echo configure:3337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3337   rm -rf conftest*
3338   ac_cv_header_sys_wait_h=yes
3339 else
3340   echo "configure: failed program was:" >&5
3341   cat conftest.$ac_ext >&5
3342   rm -rf conftest*
3343   ac_cv_header_sys_wait_h=no
3344 fi
3345 rm -f conftest*
3346
3347 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3348 if test $ac_cv_header_sys_wait_h = yes; then
3349   { test "$extra_verbose" = "yes" && cat << \EOF
3350     Defining HAVE_SYS_WAIT_H
3351 EOF
3352 cat >> confdefs.h <<\EOF
3353 #define HAVE_SYS_WAIT_H 1
3354 EOF
3355 }
3356
3357 fi
3358
3359 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3360 echo "configure:3361: checking for ANSI C header files" >&5
3361
3362 cat > conftest.$ac_ext <<EOF
3363 #line 3364 "configure"
3364 #include "confdefs.h"
3365 #include <stdlib.h>
3366 #include <stdarg.h>
3367 #include <string.h>
3368 #include <float.h>
3369 EOF
3370 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3371 { (eval echo configure:3372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3372 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3373 if test -z "$ac_err"; then
3374   rm -rf conftest*
3375   ac_cv_header_stdc=yes
3376 else
3377   echo "$ac_err" >&5
3378   echo "configure: failed program was:" >&5
3379   cat conftest.$ac_ext >&5
3380   rm -rf conftest*
3381   ac_cv_header_stdc=no
3382 fi
3383 rm -f conftest*
3384
3385 if test $ac_cv_header_stdc = yes; then
3386   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3387 cat > conftest.$ac_ext <<EOF
3388 #line 3389 "configure"
3389 #include "confdefs.h"
3390 #include <string.h>
3391 EOF
3392 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3393   egrep "memchr" >/dev/null 2>&1; then
3394   :
3395 else
3396   rm -rf conftest*
3397   ac_cv_header_stdc=no
3398 fi
3399 rm -f conftest*
3400
3401 fi
3402
3403 if test $ac_cv_header_stdc = yes; then
3404   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3405 cat > conftest.$ac_ext <<EOF
3406 #line 3407 "configure"
3407 #include "confdefs.h"
3408 #include <stdlib.h>
3409 EOF
3410 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3411   egrep "free" >/dev/null 2>&1; then
3412   :
3413 else
3414   rm -rf conftest*
3415   ac_cv_header_stdc=no
3416 fi
3417 rm -f conftest*
3418
3419 fi
3420
3421 if test $ac_cv_header_stdc = yes; then
3422   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3423 cat > conftest.$ac_ext <<EOF
3424 #line 3425 "configure"
3425 #include "confdefs.h"
3426 #include <ctype.h>
3427 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3428 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3429 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3430 int main () { int i; for (i = 0; i < 256; i++)
3431 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3432 exit (0); }
3433
3434 EOF
3435 if { (eval echo configure:3436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3436 then
3437   :
3438 else
3439   conftest_rc="$?"
3440   echo "configure: failed program was:" >&5
3441   cat conftest.$ac_ext >&5
3442   rm -fr conftest*
3443   ac_cv_header_stdc=no
3444 fi
3445 rm -fr conftest*
3446 fi
3447
3448 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3449 if test $ac_cv_header_stdc = yes; then
3450   { test "$extra_verbose" = "yes" && cat << \EOF
3451     Defining STDC_HEADERS
3452 EOF
3453 cat >> confdefs.h <<\EOF
3454 #define STDC_HEADERS 1
3455 EOF
3456 }
3457
3458 fi
3459
3460 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3461 echo "configure:3462: checking whether time.h and sys/time.h may both be included" >&5
3462
3463 cat > conftest.$ac_ext <<EOF
3464 #line 3465 "configure"
3465 #include "confdefs.h"
3466 #include <sys/types.h>
3467 #include <sys/time.h>
3468 #include <time.h>
3469 int main() {
3470 struct tm *tp;
3471 ; return 0; }
3472 EOF
3473 if { (eval echo configure:3474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3474   rm -rf conftest*
3475   ac_cv_header_time=yes
3476 else
3477   echo "configure: failed program was:" >&5
3478   cat conftest.$ac_ext >&5
3479   rm -rf conftest*
3480   ac_cv_header_time=no
3481 fi
3482 rm -f conftest*
3483
3484 echo "$ac_t""$ac_cv_header_time" 1>&6
3485 if test $ac_cv_header_time = yes; then
3486   { test "$extra_verbose" = "yes" && cat << \EOF
3487     Defining TIME_WITH_SYS_TIME
3488 EOF
3489 cat >> confdefs.h <<\EOF
3490 #define TIME_WITH_SYS_TIME 1
3491 EOF
3492 }
3493
3494 fi
3495
3496 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3497 echo "configure:3498: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3498
3499 cat > conftest.$ac_ext <<EOF
3500 #line 3501 "configure"
3501 #include "confdefs.h"
3502 #include <sys/types.h>
3503 #include <signal.h>
3504 /* NetBSD declares sys_siglist in unistd.h.  */
3505 #ifdef HAVE_UNISTD_H
3506 #include <unistd.h>
3507 #endif
3508 int main() {
3509 char *msg = *(sys_siglist + 1);
3510 ; return 0; }
3511 EOF
3512 if { (eval echo configure:3513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3513   rm -rf conftest*
3514   ac_cv_decl_sys_siglist=yes
3515 else
3516   echo "configure: failed program was:" >&5
3517   cat conftest.$ac_ext >&5
3518   rm -rf conftest*
3519   ac_cv_decl_sys_siglist=no
3520 fi
3521 rm -f conftest*
3522
3523 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3524 if test $ac_cv_decl_sys_siglist = yes; then
3525   { test "$extra_verbose" = "yes" && cat << \EOF
3526     Defining SYS_SIGLIST_DECLARED
3527 EOF
3528 cat >> confdefs.h <<\EOF
3529 #define SYS_SIGLIST_DECLARED 1
3530 EOF
3531 }
3532
3533 fi
3534
3535
3536 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3537 echo "configure:3538: checking for struct utimbuf" >&5
3538 cat > conftest.$ac_ext <<EOF
3539 #line 3540 "configure"
3540 #include "confdefs.h"
3541 #ifdef TIME_WITH_SYS_TIME
3542 #include <sys/time.h>
3543 #include <time.h>
3544 #else
3545 #ifdef HAVE_SYS_TIME_H
3546 #include <sys/time.h>
3547 #else
3548 #include <time.h>
3549 #endif
3550 #endif
3551 #ifdef HAVE_UTIME_H
3552 #include <utime.h>
3553 #endif
3554 int main() {
3555 static struct utimbuf x; x.actime = x.modtime;
3556 ; return 0; }
3557 EOF
3558 if { (eval echo configure:3559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3559   rm -rf conftest*
3560   echo "$ac_t""yes" 1>&6
3561    { test "$extra_verbose" = "yes" && cat << \EOF
3562     Defining HAVE_STRUCT_UTIMBUF
3563 EOF
3564 cat >> confdefs.h <<\EOF
3565 #define HAVE_STRUCT_UTIMBUF 1
3566 EOF
3567 }
3568
3569 else
3570   echo "configure: failed program was:" >&5
3571   cat conftest.$ac_ext >&5
3572   rm -rf conftest*
3573   echo "$ac_t""no" 1>&6
3574 fi
3575 rm -f conftest*
3576
3577 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3578 echo "configure:3579: checking return type of signal handlers" >&5
3579
3580 cat > conftest.$ac_ext <<EOF
3581 #line 3582 "configure"
3582 #include "confdefs.h"
3583 #include <sys/types.h>
3584 #include <signal.h>
3585 #ifdef signal
3586 #undef signal
3587 #endif
3588 #ifdef __cplusplus
3589 extern "C" void (*signal (int, void (*)(int)))(int);
3590 #else
3591 void (*signal ()) ();
3592 #endif
3593
3594 int main() {
3595 int i;
3596 ; return 0; }
3597 EOF
3598 if { (eval echo configure:3599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3599   rm -rf conftest*
3600   ac_cv_type_signal=void
3601 else
3602   echo "configure: failed program was:" >&5
3603   cat conftest.$ac_ext >&5
3604   rm -rf conftest*
3605   ac_cv_type_signal=int
3606 fi
3607 rm -f conftest*
3608
3609 echo "$ac_t""$ac_cv_type_signal" 1>&6
3610 { test "$extra_verbose" = "yes" && cat << EOF
3611     Defining RETSIGTYPE = $ac_cv_type_signal
3612 EOF
3613 cat >> confdefs.h <<EOF
3614 #define RETSIGTYPE $ac_cv_type_signal
3615 EOF
3616 }
3617
3618
3619 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3620 echo "configure:3621: checking for size_t" >&5
3621
3622 cat > conftest.$ac_ext <<EOF
3623 #line 3624 "configure"
3624 #include "confdefs.h"
3625 #include <sys/types.h>
3626 #if STDC_HEADERS
3627 #include <stdlib.h>
3628 #include <stddef.h>
3629 #endif
3630 EOF
3631 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3632   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3633   rm -rf conftest*
3634   ac_cv_type_size_t=yes
3635 else
3636   rm -rf conftest*
3637   ac_cv_type_size_t=no
3638 fi
3639 rm -f conftest*
3640
3641 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3642 if test $ac_cv_type_size_t = no; then
3643   { test "$extra_verbose" = "yes" && cat << \EOF
3644     Defining size_t = unsigned
3645 EOF
3646 cat >> confdefs.h <<\EOF
3647 #define size_t unsigned
3648 EOF
3649 }
3650
3651 fi
3652
3653 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3654 echo "configure:3655: checking for pid_t" >&5
3655
3656 cat > conftest.$ac_ext <<EOF
3657 #line 3658 "configure"
3658 #include "confdefs.h"
3659 #include <sys/types.h>
3660 #if STDC_HEADERS
3661 #include <stdlib.h>
3662 #include <stddef.h>
3663 #endif
3664 EOF
3665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3666   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3667   rm -rf conftest*
3668   ac_cv_type_pid_t=yes
3669 else
3670   rm -rf conftest*
3671   ac_cv_type_pid_t=no
3672 fi
3673 rm -f conftest*
3674
3675 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3676 if test $ac_cv_type_pid_t = no; then
3677   { test "$extra_verbose" = "yes" && cat << \EOF
3678     Defining pid_t = int
3679 EOF
3680 cat >> confdefs.h <<\EOF
3681 #define pid_t int
3682 EOF
3683 }
3684
3685 fi
3686
3687 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3688 echo "configure:3689: checking for uid_t in sys/types.h" >&5
3689
3690 cat > conftest.$ac_ext <<EOF
3691 #line 3692 "configure"
3692 #include "confdefs.h"
3693 #include <sys/types.h>
3694 EOF
3695 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3696   egrep "uid_t" >/dev/null 2>&1; then
3697   rm -rf conftest*
3698   ac_cv_type_uid_t=yes
3699 else
3700   rm -rf conftest*
3701   ac_cv_type_uid_t=no
3702 fi
3703 rm -f conftest*
3704
3705
3706 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3707 if test $ac_cv_type_uid_t = no; then
3708   { test "$extra_verbose" = "yes" && cat << \EOF
3709     Defining uid_t = int
3710 EOF
3711 cat >> confdefs.h <<\EOF
3712 #define uid_t int
3713 EOF
3714 }
3715
3716   { test "$extra_verbose" = "yes" && cat << \EOF
3717     Defining gid_t = int
3718 EOF
3719 cat >> confdefs.h <<\EOF
3720 #define gid_t int
3721 EOF
3722 }
3723
3724 fi
3725
3726 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3727 echo "configure:3728: checking for mode_t" >&5
3728
3729 cat > conftest.$ac_ext <<EOF
3730 #line 3731 "configure"
3731 #include "confdefs.h"
3732 #include <sys/types.h>
3733 #if STDC_HEADERS
3734 #include <stdlib.h>
3735 #include <stddef.h>
3736 #endif
3737 EOF
3738 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3739   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3740   rm -rf conftest*
3741   ac_cv_type_mode_t=yes
3742 else
3743   rm -rf conftest*
3744   ac_cv_type_mode_t=no
3745 fi
3746 rm -f conftest*
3747
3748 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3749 if test $ac_cv_type_mode_t = no; then
3750   { test "$extra_verbose" = "yes" && cat << \EOF
3751     Defining mode_t = int
3752 EOF
3753 cat >> confdefs.h <<\EOF
3754 #define mode_t int
3755 EOF
3756 }
3757
3758 fi
3759
3760 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3761 echo "configure:3762: checking for off_t" >&5
3762
3763 cat > conftest.$ac_ext <<EOF
3764 #line 3765 "configure"
3765 #include "confdefs.h"
3766 #include <sys/types.h>
3767 #if STDC_HEADERS
3768 #include <stdlib.h>
3769 #include <stddef.h>
3770 #endif
3771 EOF
3772 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3773   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3774   rm -rf conftest*
3775   ac_cv_type_off_t=yes
3776 else
3777   rm -rf conftest*
3778   ac_cv_type_off_t=no
3779 fi
3780 rm -f conftest*
3781
3782 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3783 if test $ac_cv_type_off_t = no; then
3784   { test "$extra_verbose" = "yes" && cat << \EOF
3785     Defining off_t = long
3786 EOF
3787 cat >> confdefs.h <<\EOF
3788 #define off_t long
3789 EOF
3790 }
3791
3792 fi
3793
3794
3795 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3796 echo "configure:3797: checking for struct timeval" >&5
3797 cat > conftest.$ac_ext <<EOF
3798 #line 3799 "configure"
3799 #include "confdefs.h"
3800 #ifdef TIME_WITH_SYS_TIME
3801 #include <sys/time.h>
3802 #include <time.h>
3803 #else
3804 #ifdef HAVE_SYS_TIME_H
3805 #include <sys/time.h>
3806 #else
3807 #include <time.h>
3808 #endif
3809 #endif
3810 int main() {
3811 static struct timeval x; x.tv_sec = x.tv_usec;
3812 ; return 0; }
3813 EOF
3814 if { (eval echo configure:3815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3815   rm -rf conftest*
3816   echo "$ac_t""yes" 1>&6
3817   HAVE_TIMEVAL=yes
3818   { test "$extra_verbose" = "yes" && cat << \EOF
3819     Defining HAVE_TIMEVAL
3820 EOF
3821 cat >> confdefs.h <<\EOF
3822 #define HAVE_TIMEVAL 1
3823 EOF
3824 }
3825
3826 else
3827   echo "configure: failed program was:" >&5
3828   cat conftest.$ac_ext >&5
3829   rm -rf conftest*
3830   echo "$ac_t""no" 1>&6
3831    HAVE_TIMEVAL=no
3832 fi
3833 rm -f conftest*
3834
3835 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3836 echo "configure:3837: checking whether struct tm is in sys/time.h or time.h" >&5
3837
3838 cat > conftest.$ac_ext <<EOF
3839 #line 3840 "configure"
3840 #include "confdefs.h"
3841 #include <sys/types.h>
3842 #include <time.h>
3843 int main() {
3844 struct tm *tp; tp->tm_sec;
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_struct_tm=time.h
3850 else
3851   echo "configure: failed program was:" >&5
3852   cat conftest.$ac_ext >&5
3853   rm -rf conftest*
3854   ac_cv_struct_tm=sys/time.h
3855 fi
3856 rm -f conftest*
3857
3858 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3859 if test $ac_cv_struct_tm = sys/time.h; then
3860   { test "$extra_verbose" = "yes" && cat << \EOF
3861     Defining TM_IN_SYS_TIME
3862 EOF
3863 cat >> confdefs.h <<\EOF
3864 #define TM_IN_SYS_TIME 1
3865 EOF
3866 }
3867
3868 fi
3869
3870 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3871 echo "configure:3872: checking for tm_zone in struct tm" >&5
3872
3873 cat > conftest.$ac_ext <<EOF
3874 #line 3875 "configure"
3875 #include "confdefs.h"
3876 #include <sys/types.h>
3877 #include <$ac_cv_struct_tm>
3878 int main() {
3879 struct tm tm; tm.tm_zone;
3880 ; return 0; }
3881 EOF
3882 if { (eval echo configure:3883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3883   rm -rf conftest*
3884   ac_cv_struct_tm_zone=yes
3885 else
3886   echo "configure: failed program was:" >&5
3887   cat conftest.$ac_ext >&5
3888   rm -rf conftest*
3889   ac_cv_struct_tm_zone=no
3890 fi
3891 rm -f conftest*
3892
3893 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3894 if test "$ac_cv_struct_tm_zone" = yes; then
3895   { test "$extra_verbose" = "yes" && cat << \EOF
3896     Defining HAVE_TM_ZONE
3897 EOF
3898 cat >> confdefs.h <<\EOF
3899 #define HAVE_TM_ZONE 1
3900 EOF
3901 }
3902
3903 else
3904   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3905 echo "configure:3906: checking for tzname" >&5
3906
3907 cat > conftest.$ac_ext <<EOF
3908 #line 3909 "configure"
3909 #include "confdefs.h"
3910 #include <time.h>
3911 #ifndef tzname /* For SGI.  */
3912 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3913 #endif
3914 int main() {
3915 atoi(*tzname);
3916 ; return 0; }
3917 EOF
3918 if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3919   rm -rf conftest*
3920   ac_cv_var_tzname=yes
3921 else
3922   echo "configure: failed program was:" >&5
3923   cat conftest.$ac_ext >&5
3924   rm -rf conftest*
3925   ac_cv_var_tzname=no
3926 fi
3927 rm -f conftest*
3928
3929 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3930   if test $ac_cv_var_tzname = yes; then
3931     { test "$extra_verbose" = "yes" && cat << \EOF
3932     Defining HAVE_TZNAME
3933 EOF
3934 cat >> confdefs.h <<\EOF
3935 #define HAVE_TZNAME 1
3936 EOF
3937 }
3938
3939   fi
3940 fi
3941
3942
3943 echo $ac_n "checking for working const""... $ac_c" 1>&6
3944 echo "configure:3945: checking for working const" >&5
3945
3946 cat > conftest.$ac_ext <<EOF
3947 #line 3948 "configure"
3948 #include "confdefs.h"
3949
3950 int main() {
3951
3952 /* Ultrix mips cc rejects this.  */
3953 typedef int charset[2]; const charset x;
3954 /* SunOS 4.1.1 cc rejects this.  */
3955 char const *const *ccp;
3956 char **p;
3957 /* NEC SVR4.0.2 mips cc rejects this.  */
3958 struct point {int x, y;};
3959 static struct point const zero = {0,0};
3960 /* AIX XL C 1.02.0.0 rejects this.
3961    It does not let you subtract one const X* pointer from another in an arm
3962    of an if-expression whose if-part is not a constant expression */
3963 const char *g = "string";
3964 ccp = &g + (g ? g-g : 0);
3965 /* HPUX 7.0 cc rejects these. */
3966 ++ccp;
3967 p = (char**) ccp;
3968 ccp = (char const *const *) p;
3969 { /* SCO 3.2v4 cc rejects this.  */
3970   char *t;
3971   char const *s = 0 ? (char *) 0 : (char const *) 0;
3972
3973   *t++ = 0;
3974 }
3975 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3976   int x[] = {25, 17};
3977   const int *foo = &x[0];
3978   ++foo;
3979 }
3980 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3981   typedef const int *iptr;
3982   iptr p = 0;
3983   ++p;
3984 }
3985 { /* AIX XL C 1.02.0.0 rejects this saying
3986      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3987   struct s { int j; const int *ap[3]; };
3988   struct s *b; b->j = 5;
3989 }
3990 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3991   const int foo = 10;
3992 }
3993
3994 ; return 0; }
3995 EOF
3996 if { (eval echo configure:3997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3997   rm -rf conftest*
3998   ac_cv_c_const=yes
3999 else
4000   echo "configure: failed program was:" >&5
4001   cat conftest.$ac_ext >&5
4002   rm -rf conftest*
4003   ac_cv_c_const=no
4004 fi
4005 rm -f conftest*
4006
4007 echo "$ac_t""$ac_cv_c_const" 1>&6
4008 if test $ac_cv_c_const = no; then
4009   { test "$extra_verbose" = "yes" && cat << \EOF
4010     Defining const = 
4011 EOF
4012 cat >> confdefs.h <<\EOF
4013 #define const 
4014 EOF
4015 }
4016
4017 fi
4018
4019
4020 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
4021 echo "configure:4022: checking whether ${MAKE-make} sets \${MAKE}" >&5
4022 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
4023
4024 cat > conftestmake <<\EOF
4025 all:
4026         @echo 'ac_maketemp="${MAKE}"'
4027 EOF
4028 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4029 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
4030 if test -n "$ac_maketemp"; then
4031   eval ac_cv_prog_make_${ac_make}_set=yes
4032 else
4033   eval ac_cv_prog_make_${ac_make}_set=no
4034 fi
4035 rm -f conftestmake
4036 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
4037   echo "$ac_t""yes" 1>&6
4038   SET_MAKE=
4039 else
4040   echo "$ac_t""no" 1>&6
4041   SET_MAKE="MAKE=${MAKE-make}"
4042 fi
4043
4044
4045 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
4046 echo "configure:4047: checking whether byte ordering is bigendian" >&5
4047
4048 ac_cv_c_bigendian=unknown
4049 # See if sys/param.h defines the BYTE_ORDER macro.
4050 cat > conftest.$ac_ext <<EOF
4051 #line 4052 "configure"
4052 #include "confdefs.h"
4053 #include <sys/types.h>
4054 #include <sys/param.h>
4055 int main() {
4056
4057 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
4058  bogus endian macros
4059 #endif
4060 ; return 0; }
4061 EOF
4062 if { (eval echo configure:4063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4063   rm -rf conftest*
4064   # It does; now see whether it defined to BIG_ENDIAN or not.
4065 cat > conftest.$ac_ext <<EOF
4066 #line 4067 "configure"
4067 #include "confdefs.h"
4068 #include <sys/types.h>
4069 #include <sys/param.h>
4070 int main() {
4071
4072 #if BYTE_ORDER != BIG_ENDIAN
4073  not big endian
4074 #endif
4075 ; return 0; }
4076 EOF
4077 if { (eval echo configure:4078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4078   rm -rf conftest*
4079   ac_cv_c_bigendian=yes
4080 else
4081   echo "configure: failed program was:" >&5
4082   cat conftest.$ac_ext >&5
4083   rm -rf conftest*
4084   ac_cv_c_bigendian=no
4085 fi
4086 rm -f conftest*
4087 else
4088   echo "configure: failed program was:" >&5
4089   cat conftest.$ac_ext >&5
4090 fi
4091 rm -f conftest*
4092 if test $ac_cv_c_bigendian = unknown; then
4093 cat > conftest.$ac_ext <<EOF
4094 #line 4095 "configure"
4095 #include "confdefs.h"
4096 main () {
4097   /* Are we little or big endian?  From Harbison&Steele.  */
4098   union
4099   {
4100     long l;
4101     char c[sizeof (long)];
4102   } u;
4103   u.l = 1;
4104   exit (u.c[sizeof (long) - 1] == 1);
4105 }
4106 EOF
4107 if { (eval echo configure:4108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4108 then
4109   ac_cv_c_bigendian=no
4110 else
4111   conftest_rc="$?"
4112   echo "configure: failed program was:" >&5
4113   cat conftest.$ac_ext >&5
4114   rm -fr conftest*
4115   ac_cv_c_bigendian=yes
4116 fi
4117 rm -fr conftest*
4118 fi
4119
4120 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
4121 if test $ac_cv_c_bigendian = yes; then
4122   { test "$extra_verbose" = "yes" && cat << \EOF
4123     Defining WORDS_BIGENDIAN
4124 EOF
4125 cat >> confdefs.h <<\EOF
4126 #define WORDS_BIGENDIAN 1
4127 EOF
4128 }
4129
4130 fi
4131
4132
4133 echo $ac_n "checking size of short""... $ac_c" 1>&6
4134 echo "configure:4135: checking size of short" >&5
4135
4136 cat > conftest.$ac_ext <<EOF
4137 #line 4138 "configure"
4138 #include "confdefs.h"
4139 #include <stdio.h>
4140 main()
4141 {
4142   FILE *f=fopen("conftestval", "w");
4143   if (!f) exit(1);
4144   fprintf(f, "%d\n", sizeof(short));
4145   exit(0);
4146 }
4147 EOF
4148 if { (eval echo configure:4149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4149 then
4150   ac_cv_sizeof_short=`cat conftestval`
4151 else
4152   conftest_rc="$?"
4153   echo "configure: failed program was:" >&5
4154   cat conftest.$ac_ext >&5
4155   rm -fr conftest*
4156   ac_cv_sizeof_short=0
4157 fi
4158 rm -fr conftest*
4159 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
4160 { test "$extra_verbose" = "yes" && cat << EOF
4161     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
4162 EOF
4163 cat >> confdefs.h <<EOF
4164 #define SIZEOF_SHORT $ac_cv_sizeof_short
4165 EOF
4166 }
4167
4168
4169 if test "$ac_cv_sizeof_short" = 0; then
4170   echo ""
4171   echo "*** PANIC *** Configure tests are not working - compiler is broken."
4172   echo "*** PANIC *** Please examine config.log for compilation errors."
4173   exit 1
4174 fi
4175 echo $ac_n "checking size of int""... $ac_c" 1>&6
4176 echo "configure:4177: checking size of int" >&5
4177
4178 cat > conftest.$ac_ext <<EOF
4179 #line 4180 "configure"
4180 #include "confdefs.h"
4181 #include <stdio.h>
4182 main()
4183 {
4184   FILE *f=fopen("conftestval", "w");
4185   if (!f) exit(1);
4186   fprintf(f, "%d\n", sizeof(int));
4187   exit(0);
4188 }
4189 EOF
4190 if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4191 then
4192   ac_cv_sizeof_int=`cat conftestval`
4193 else
4194   conftest_rc="$?"
4195   echo "configure: failed program was:" >&5
4196   cat conftest.$ac_ext >&5
4197   rm -fr conftest*
4198   ac_cv_sizeof_int=0
4199 fi
4200 rm -fr conftest*
4201 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4202 { test "$extra_verbose" = "yes" && cat << EOF
4203     Defining SIZEOF_INT = $ac_cv_sizeof_int
4204 EOF
4205 cat >> confdefs.h <<EOF
4206 #define SIZEOF_INT $ac_cv_sizeof_int
4207 EOF
4208 }
4209
4210
4211 echo $ac_n "checking size of long""... $ac_c" 1>&6
4212 echo "configure:4213: checking size of long" >&5
4213
4214 cat > conftest.$ac_ext <<EOF
4215 #line 4216 "configure"
4216 #include "confdefs.h"
4217 #include <stdio.h>
4218 main()
4219 {
4220   FILE *f=fopen("conftestval", "w");
4221   if (!f) exit(1);
4222   fprintf(f, "%d\n", sizeof(long));
4223   exit(0);
4224 }
4225 EOF
4226 if { (eval echo configure:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4227 then
4228   ac_cv_sizeof_long=`cat conftestval`
4229 else
4230   conftest_rc="$?"
4231   echo "configure: failed program was:" >&5
4232   cat conftest.$ac_ext >&5
4233   rm -fr conftest*
4234   ac_cv_sizeof_long=0
4235 fi
4236 rm -fr conftest*
4237 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4238 { test "$extra_verbose" = "yes" && cat << EOF
4239     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4240 EOF
4241 cat >> confdefs.h <<EOF
4242 #define SIZEOF_LONG $ac_cv_sizeof_long
4243 EOF
4244 }
4245
4246
4247 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4248 echo "configure:4249: checking size of long long" >&5
4249
4250 cat > conftest.$ac_ext <<EOF
4251 #line 4252 "configure"
4252 #include "confdefs.h"
4253 #include <stdio.h>
4254 main()
4255 {
4256   FILE *f=fopen("conftestval", "w");
4257   if (!f) exit(1);
4258   fprintf(f, "%d\n", sizeof(long long));
4259   exit(0);
4260 }
4261 EOF
4262 if { (eval echo configure:4263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4263 then
4264   ac_cv_sizeof_long_long=`cat conftestval`
4265 else
4266   conftest_rc="$?"
4267   echo "configure: failed program was:" >&5
4268   cat conftest.$ac_ext >&5
4269   rm -fr conftest*
4270   ac_cv_sizeof_long_long=0
4271 fi
4272 rm -fr conftest*
4273 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4274 { test "$extra_verbose" = "yes" && cat << EOF
4275     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4276 EOF
4277 cat >> confdefs.h <<EOF
4278 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4279 EOF
4280 }
4281
4282
4283 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4284 echo "configure:4285: checking size of void *" >&5
4285
4286 cat > conftest.$ac_ext <<EOF
4287 #line 4288 "configure"
4288 #include "confdefs.h"
4289 #include <stdio.h>
4290 main()
4291 {
4292   FILE *f=fopen("conftestval", "w");
4293   if (!f) exit(1);
4294   fprintf(f, "%d\n", sizeof(void *));
4295   exit(0);
4296 }
4297 EOF
4298 if { (eval echo configure:4299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4299 then
4300   ac_cv_sizeof_void_p=`cat conftestval`
4301 else
4302   conftest_rc="$?"
4303   echo "configure: failed program was:" >&5
4304   cat conftest.$ac_ext >&5
4305   rm -fr conftest*
4306   ac_cv_sizeof_void_p=0
4307 fi
4308 rm -fr conftest*
4309 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4310 { test "$extra_verbose" = "yes" && cat << EOF
4311     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4312 EOF
4313 cat >> confdefs.h <<EOF
4314 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4315 EOF
4316 }
4317
4318
4319
4320 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4321 echo "configure:4322: checking for long file names" >&5
4322
4323 ac_cv_sys_long_file_names=yes
4324 # Test for long file names in all the places we know might matter:
4325 #      .                the current directory, where building will happen
4326 #      $prefix/lib      where we will be installing things
4327 #      $exec_prefix/lib likewise
4328 # eval it to expand exec_prefix.
4329 #      $TMPDIR          if set, where it might want to write temporary files
4330 # if $TMPDIR is not set:
4331 #      /tmp             where it might want to write temporary files
4332 #      /var/tmp         likewise
4333 #      /usr/tmp         likewise
4334 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4335   ac_tmpdirs="$TMPDIR"
4336 else
4337   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4338 fi
4339 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4340   test -d $ac_dir || continue
4341   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4342   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4343   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4344   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4345   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4346     ac_cv_sys_long_file_names=no
4347     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4348     break
4349   fi
4350   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4351 done
4352
4353 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4354 if test $ac_cv_sys_long_file_names = yes; then
4355   { test "$extra_verbose" = "yes" && cat << \EOF
4356     Defining HAVE_LONG_FILE_NAMES
4357 EOF
4358 cat >> confdefs.h <<\EOF
4359 #define HAVE_LONG_FILE_NAMES 1
4360 EOF
4361 }
4362
4363 fi
4364
4365
4366 echo $ac_n "checking for sin""... $ac_c" 1>&6
4367 echo "configure:4368: checking for sin" >&5
4368
4369 cat > conftest.$ac_ext <<EOF
4370 #line 4371 "configure"
4371 #include "confdefs.h"
4372 /* System header to define __stub macros and hopefully few prototypes,
4373     which can conflict with char sin(); below.  */
4374 #include <assert.h>
4375 /* Override any gcc2 internal prototype to avoid an error.  */
4376 /* We use char because int might match the return type of a gcc2
4377     builtin and then its argument prototype would still apply.  */
4378 char sin();
4379
4380 int main() {
4381
4382 /* The GNU C library defines this for functions which it implements
4383     to always fail with ENOSYS.  Some functions are actually named
4384     something starting with __ and the normal name is an alias.  */
4385 #if defined (__stub_sin) || defined (__stub___sin)
4386 choke me
4387 #else
4388 sin();
4389 #endif
4390
4391 ; return 0; }
4392 EOF
4393 if { (eval echo configure:4394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4394   rm -rf conftest*
4395   eval "ac_cv_func_sin=yes"
4396 else
4397   echo "configure: failed program was:" >&5
4398   cat conftest.$ac_ext >&5
4399   rm -rf conftest*
4400   eval "ac_cv_func_sin=no"
4401 fi
4402 rm -f conftest*
4403
4404 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4405   echo "$ac_t""yes" 1>&6
4406   :
4407 else
4408   echo "$ac_t""no" 1>&6
4409
4410 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4411 echo "configure:4412: checking for sin in -lm" >&5
4412 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4413
4414 xe_check_libs=" -lm "
4415 cat > conftest.$ac_ext <<EOF
4416 #line 4417 "configure"
4417 #include "confdefs.h"
4418 /* Override any gcc2 internal prototype to avoid an error.  */
4419 /* We use char because int might match the return type of a gcc2
4420     builtin and then its argument prototype would still apply.  */
4421 char sin();
4422
4423 int main() {
4424 sin()
4425 ; return 0; }
4426 EOF
4427 if { (eval echo configure:4428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4428   rm -rf conftest*
4429   eval "ac_cv_lib_$ac_lib_var=yes"
4430 else
4431   echo "configure: failed program was:" >&5
4432   cat conftest.$ac_ext >&5
4433   rm -rf conftest*
4434   eval "ac_cv_lib_$ac_lib_var=no"
4435 fi
4436 rm -f conftest*
4437 xe_check_libs=""
4438
4439 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4440   echo "$ac_t""yes" 1>&6
4441     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4442     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4443   { test "$extra_verbose" = "yes" && cat << EOF
4444     Defining $ac_tr_lib
4445 EOF
4446 cat >> confdefs.h <<EOF
4447 #define $ac_tr_lib 1
4448 EOF
4449 }
4450
4451   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4452
4453 else
4454   echo "$ac_t""no" 1>&6
4455 fi
4456
4457
4458 fi
4459
4460
4461 { test "$extra_verbose" = "yes" && cat << \EOF
4462     Defining LISP_FLOAT_TYPE
4463 EOF
4464 cat >> confdefs.h <<\EOF
4465 #define LISP_FLOAT_TYPE 1
4466 EOF
4467 }
4468
4469
4470 cat > conftest.$ac_ext <<EOF
4471 #line 4472 "configure"
4472 #include "confdefs.h"
4473 #include <math.h>
4474 int main() {
4475 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4476 ; return 0; }
4477 EOF
4478 if { (eval echo configure:4479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4479   rm -rf conftest*
4480   { test "$extra_verbose" = "yes" && cat << \EOF
4481     Defining HAVE_INVERSE_HYPERBOLIC
4482 EOF
4483 cat >> confdefs.h <<\EOF
4484 #define HAVE_INVERSE_HYPERBOLIC 1
4485 EOF
4486 }
4487
4488 else
4489   echo "configure: failed program was:" >&5
4490   cat conftest.$ac_ext >&5
4491 fi
4492 rm -f conftest*
4493
4494 echo "checking type of mail spool file locking" 1>&6
4495 echo "configure:4496: checking type of mail spool file locking" >&5
4496 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4497 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4498 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4499     Defining REAL_MAIL_USE_LOCKF
4500 EOF
4501 cat >> confdefs.h <<\EOF
4502 #define REAL_MAIL_USE_LOCKF 1
4503 EOF
4504 }
4505
4506 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4507     Defining REAL_MAIL_USE_FLOCK
4508 EOF
4509 cat >> confdefs.h <<\EOF
4510 #define REAL_MAIL_USE_FLOCK 1
4511 EOF
4512 }
4513
4514 else mail_locking="dot-locking"
4515 fi
4516
4517 case "$opsys" in decosf*)
4518   
4519 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4520 echo "configure:4521: checking for cma_open in -lpthreads" >&5
4521 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4522
4523 xe_check_libs=" -lpthreads "
4524 cat > conftest.$ac_ext <<EOF
4525 #line 4526 "configure"
4526 #include "confdefs.h"
4527 /* Override any gcc2 internal prototype to avoid an error.  */
4528 /* We use char because int might match the return type of a gcc2
4529     builtin and then its argument prototype would still apply.  */
4530 char cma_open();
4531
4532 int main() {
4533 cma_open()
4534 ; return 0; }
4535 EOF
4536 if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4537   rm -rf conftest*
4538   eval "ac_cv_lib_$ac_lib_var=yes"
4539 else
4540   echo "configure: failed program was:" >&5
4541   cat conftest.$ac_ext >&5
4542   rm -rf conftest*
4543   eval "ac_cv_lib_$ac_lib_var=no"
4544 fi
4545 rm -f conftest*
4546 xe_check_libs=""
4547
4548 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4549   echo "$ac_t""yes" 1>&6
4550     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4551     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4552   { test "$extra_verbose" = "yes" && cat << EOF
4553     Defining $ac_tr_lib
4554 EOF
4555 cat >> confdefs.h <<EOF
4556 #define $ac_tr_lib 1
4557 EOF
4558 }
4559
4560   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4561
4562 else
4563   echo "$ac_t""no" 1>&6
4564 fi
4565
4566
4567   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4568     c_switch_site="$c_switch_site -threads" ;;
4569 esac
4570
4571 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4572 echo "configure:4573: checking whether the -xildoff compiler flag is required" >&5
4573 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4574   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4575     then echo "$ac_t""no" 1>&6;
4576     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
4577   fi
4578   else echo "$ac_t""no" 1>&6
4579 fi
4580
4581 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4582   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4583 echo "configure:4584: checking for \"-z ignore\" linker flag" >&5
4584   case "`ld -h 2>&1`" in
4585     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4586       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4587     *) echo "$ac_t""no" 1>&6 ;;
4588   esac
4589 fi
4590
4591
4592 echo "checking "for specified window system"" 1>&6
4593 echo "configure:4594: checking "for specified window system"" >&5
4594
4595 if test "$with_x11" != "no"; then
4596     test "$x_includes $x_libraries" != "NONE NONE" && \
4597    window_system=x11 with_x11=yes
4598
4599         
4600       if test "$x_includes $x_libraries" = "NONE NONE" \
4601     -a -n "$OPENWINHOME" \
4602     -a "$OPENWINHOME" != "/usr/openwin" \
4603     -a -d "$OPENWINHOME"; then
4604       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4605       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4606       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4607   fi
4608
4609   if test "$x_includes" = "NONE"; then
4610                     for dir in "/usr/X11" "/usr/X11R6"; do
4611       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4612     done
4613   fi
4614
4615   if test "$x_libraries" = "NONE"; then
4616     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4617       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4618     done
4619   fi
4620
4621   # If we find X, set shell vars x_includes and x_libraries to the
4622 # paths, otherwise set no_x=yes.
4623 # Uses ac_ vars as temps to allow command line to override cache and checks.
4624 # --without-x overrides everything else, but does not touch the cache.
4625 echo $ac_n "checking for X""... $ac_c" 1>&6
4626 echo "configure:4627: checking for X" >&5
4627
4628 # Check whether --with-x or --without-x was given.
4629 if test "${with_x+set}" = set; then
4630   withval="$with_x"
4631   :
4632 fi
4633
4634 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4635 if test "x$with_x" = xno; then
4636   # The user explicitly disabled X.
4637   have_x=disabled
4638 else
4639   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4640     # Both variables are already set.
4641     have_x=yes
4642   else
4643
4644 # One or both of the vars are not set, and there is no cached value.
4645 ac_x_includes=NO ac_x_libraries=NO
4646 rm -fr conftestdir
4647 if mkdir conftestdir; then
4648   cd conftestdir
4649   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4650   cat > Imakefile <<'EOF'
4651 acfindx:
4652         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4653 EOF
4654   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4655     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4656     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4657     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4658     for ac_extension in a so sl; do
4659       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4660         test -f $ac_im_libdir/libX11.$ac_extension; then
4661         ac_im_usrlibdir=$ac_im_libdir; break
4662       fi
4663     done
4664     # Screen out bogus values from the imake configuration.  They are
4665     # bogus both because they are the default anyway, and because
4666     # using them would break gcc on systems where it needs fixed includes.
4667     case "$ac_im_incroot" in
4668         /usr/include) ;;
4669         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4670     esac
4671     case "$ac_im_usrlibdir" in
4672         /usr/lib | /lib) ;;
4673         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4674     esac
4675   fi
4676   cd ..
4677   rm -fr conftestdir
4678 fi
4679
4680 if test "$ac_x_includes" = NO; then
4681   # Guess where to find include files, by looking for this one X11 .h file.
4682   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4683
4684   # First, try using that file with no special directory specified.
4685 cat > conftest.$ac_ext <<EOF
4686 #line 4687 "configure"
4687 #include "confdefs.h"
4688 #include <$x_direct_test_include>
4689 EOF
4690 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4691 { (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4692 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4693 if test -z "$ac_err"; then
4694   rm -rf conftest*
4695   # We can compile using X headers with no special include directory.
4696 ac_x_includes=
4697 else
4698   echo "$ac_err" >&5
4699   echo "configure: failed program was:" >&5
4700   cat conftest.$ac_ext >&5
4701   rm -rf conftest*
4702   # Look for the header file in a standard set of common directories.
4703 # Check X11 before X11Rn because it is often a symlink to the current release.
4704   for ac_dir in               \
4705     /usr/X11/include          \
4706     /usr/X11R6/include        \
4707     /usr/X11R5/include        \
4708     /usr/X11R4/include        \
4709                               \
4710     /usr/include/X11          \
4711     /usr/include/X11R6        \
4712     /usr/include/X11R5        \
4713     /usr/include/X11R4        \
4714                               \
4715     /usr/local/X11/include    \
4716     /usr/local/X11R6/include  \
4717     /usr/local/X11R5/include  \
4718     /usr/local/X11R4/include  \
4719                               \
4720     /usr/local/include/X11    \
4721     /usr/local/include/X11R6  \
4722     /usr/local/include/X11R5  \
4723     /usr/local/include/X11R4  \
4724                               \
4725     /usr/X386/include         \
4726     /usr/x386/include         \
4727     /usr/XFree86/include/X11  \
4728                               \
4729     /usr/include              \
4730     /usr/local/include        \
4731     /usr/unsupported/include  \
4732     /usr/athena/include       \
4733     /usr/local/x11r5/include  \
4734     /usr/lpp/Xamples/include  \
4735                               \
4736     /usr/openwin/include      \
4737     /usr/openwin/share/include \
4738     ; \
4739   do
4740     if test -r "$ac_dir/$x_direct_test_include"; then
4741       ac_x_includes=$ac_dir
4742       break
4743     fi
4744   done
4745 fi
4746 rm -f conftest*
4747 fi # $ac_x_includes = NO
4748
4749 if test "$ac_x_libraries" = NO; then
4750   # Check for the libraries.
4751
4752   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4753   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4754
4755   # See if we find them without any special options.
4756   # Don't add to $LIBS permanently.
4757   ac_save_LIBS="$LIBS"
4758   LIBS="-l$x_direct_test_library $LIBS"
4759 cat > conftest.$ac_ext <<EOF
4760 #line 4761 "configure"
4761 #include "confdefs.h"
4762
4763 int main() {
4764 ${x_direct_test_function}()
4765 ; return 0; }
4766 EOF
4767 if { (eval echo configure:4768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4768   rm -rf conftest*
4769   LIBS="$ac_save_LIBS"
4770 # We can link X programs with no special library path.
4771 ac_x_libraries=
4772 else
4773   echo "configure: failed program was:" >&5
4774   cat conftest.$ac_ext >&5
4775   rm -rf conftest*
4776   LIBS="$ac_save_LIBS"
4777 # First see if replacing the include by lib works.
4778 # Check X11 before X11Rn because it is often a symlink to the current release.
4779 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4780     /usr/X11/lib          \
4781     /usr/X11R6/lib        \
4782     /usr/X11R5/lib        \
4783     /usr/X11R4/lib        \
4784                           \
4785     /usr/lib/X11          \
4786     /usr/lib/X11R6        \
4787     /usr/lib/X11R5        \
4788     /usr/lib/X11R4        \
4789                           \
4790     /usr/local/X11/lib    \
4791     /usr/local/X11R6/lib  \
4792     /usr/local/X11R5/lib  \
4793     /usr/local/X11R4/lib  \
4794                           \
4795     /usr/local/lib/X11    \
4796     /usr/local/lib/X11R6  \
4797     /usr/local/lib/X11R5  \
4798     /usr/local/lib/X11R4  \
4799                           \
4800     /usr/X386/lib         \
4801     /usr/x386/lib         \
4802     /usr/XFree86/lib/X11  \
4803                           \
4804     /usr/lib              \
4805     /usr/local/lib        \
4806     /usr/unsupported/lib  \
4807     /usr/athena/lib       \
4808     /usr/local/x11r5/lib  \
4809     /usr/lpp/Xamples/lib  \
4810     /lib/usr/lib/X11      \
4811                           \
4812     /usr/openwin/lib      \
4813     /usr/openwin/share/lib \
4814     ; \
4815 do
4816   for ac_extension in a so sl; do
4817     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4818       ac_x_libraries=$ac_dir
4819       break 2
4820     fi
4821   done
4822 done
4823 fi
4824 rm -f conftest*
4825 fi # $ac_x_libraries = NO
4826
4827 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4828   # Didn't find X anywhere.  Cache the known absence of X.
4829   ac_cv_have_x="have_x=no"
4830 else
4831   # Record where we found X for the cache.
4832   ac_cv_have_x="have_x=yes \
4833                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4834 fi
4835   fi
4836   eval "$ac_cv_have_x"
4837 fi # $with_x != no
4838
4839 if test "$have_x" != yes; then
4840   echo "$ac_t""$have_x" 1>&6
4841   no_x=yes
4842 else
4843   # If each of the values was on the command line, it overrides each guess.
4844   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4845   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4846   # Update the cache value to reflect the command line values.
4847   ac_cv_have_x="have_x=yes \
4848                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4849   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4850 fi
4851
4852 if test "$no_x" = yes; then
4853   # Not all programs may use this symbol, but it does not hurt to define it.
4854   { test "$extra_verbose" = "yes" && cat << \EOF
4855     Defining X_DISPLAY_MISSING
4856 EOF
4857 cat >> confdefs.h <<\EOF
4858 #define X_DISPLAY_MISSING 1
4859 EOF
4860 }
4861
4862   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4863 else
4864   if test -n "$x_includes"; then
4865     X_CFLAGS="$X_CFLAGS -I$x_includes"
4866   fi
4867
4868   # It would also be nice to do this for all -L options, not just this one.
4869   if test -n "$x_libraries"; then
4870     X_LIBS="$X_LIBS -L$x_libraries"
4871     # For Solaris; some versions of Sun CC require a space after -R and
4872     # others require no space.  Words are not sufficient . . . .
4873     case "`(uname -sr) 2>/dev/null`" in
4874     "SunOS 5"*)
4875       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4876 echo "configure:4877: checking whether -R must be followed by a space" >&5
4877       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4878       cat > conftest.$ac_ext <<EOF
4879 #line 4880 "configure"
4880 #include "confdefs.h"
4881
4882 int main() {
4883
4884 ; return 0; }
4885 EOF
4886 if { (eval echo configure:4887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4887   rm -rf conftest*
4888   ac_R_nospace=yes
4889 else
4890   echo "configure: failed program was:" >&5
4891   cat conftest.$ac_ext >&5
4892   rm -rf conftest*
4893   ac_R_nospace=no
4894 fi
4895 rm -f conftest*
4896       if test $ac_R_nospace = yes; then
4897         echo "$ac_t""no" 1>&6
4898         X_LIBS="$X_LIBS -R$x_libraries"
4899       else
4900         LIBS="$ac_xsave_LIBS -R $x_libraries"
4901         cat > conftest.$ac_ext <<EOF
4902 #line 4903 "configure"
4903 #include "confdefs.h"
4904
4905 int main() {
4906
4907 ; return 0; }
4908 EOF
4909 if { (eval echo configure:4910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4910   rm -rf conftest*
4911   ac_R_space=yes
4912 else
4913   echo "configure: failed program was:" >&5
4914   cat conftest.$ac_ext >&5
4915   rm -rf conftest*
4916   ac_R_space=no
4917 fi
4918 rm -f conftest*
4919         if test $ac_R_space = yes; then
4920           echo "$ac_t""yes" 1>&6
4921           X_LIBS="$X_LIBS -R $x_libraries"
4922         else
4923           echo "$ac_t""neither works" 1>&6
4924         fi
4925       fi
4926       LIBS="$ac_xsave_LIBS"
4927     esac
4928   fi
4929
4930   # Check for system-dependent libraries X programs must link with.
4931   # Do this before checking for the system-independent R6 libraries
4932   # (-lICE), since we may need -lsocket or whatever for X linking.
4933
4934   if test "$ISC" = yes; then
4935     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4936   else
4937     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4938     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4939     # the Alpha needs dnet_stub (dnet does not exist).
4940     if test "$with_dnet" = "no" ; then
4941 ac_cv_lib_dnet_dnet_ntoa=no
4942 else
4943
4944 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4945 echo "configure:4946: checking for dnet_ntoa in -ldnet" >&5
4946 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4947
4948 xe_check_libs=" -ldnet "
4949 cat > conftest.$ac_ext <<EOF
4950 #line 4951 "configure"
4951 #include "confdefs.h"
4952 /* Override any gcc2 internal prototype to avoid an error.  */
4953 /* We use char because int might match the return type of a gcc2
4954     builtin and then its argument prototype would still apply.  */
4955 char dnet_ntoa();
4956
4957 int main() {
4958 dnet_ntoa()
4959 ; return 0; }
4960 EOF
4961 if { (eval echo configure:4962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4962   rm -rf conftest*
4963   eval "ac_cv_lib_$ac_lib_var=yes"
4964 else
4965   echo "configure: failed program was:" >&5
4966   cat conftest.$ac_ext >&5
4967   rm -rf conftest*
4968   eval "ac_cv_lib_$ac_lib_var=no"
4969 fi
4970 rm -f conftest*
4971 xe_check_libs=""
4972
4973 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4974   echo "$ac_t""yes" 1>&6
4975   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4976 else
4977   echo "$ac_t""no" 1>&6
4978 fi
4979
4980 fi
4981
4982     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4983       
4984 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4985 echo "configure:4986: checking for dnet_ntoa in -ldnet_stub" >&5
4986 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4987
4988 xe_check_libs=" -ldnet_stub "
4989 cat > conftest.$ac_ext <<EOF
4990 #line 4991 "configure"
4991 #include "confdefs.h"
4992 /* Override any gcc2 internal prototype to avoid an error.  */
4993 /* We use char because int might match the return type of a gcc2
4994     builtin and then its argument prototype would still apply.  */
4995 char dnet_ntoa();
4996
4997 int main() {
4998 dnet_ntoa()
4999 ; return 0; }
5000 EOF
5001 if { (eval echo configure:5002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5002   rm -rf conftest*
5003   eval "ac_cv_lib_$ac_lib_var=yes"
5004 else
5005   echo "configure: failed program was:" >&5
5006   cat conftest.$ac_ext >&5
5007   rm -rf conftest*
5008   eval "ac_cv_lib_$ac_lib_var=no"
5009 fi
5010 rm -f conftest*
5011 xe_check_libs=""
5012
5013 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5014   echo "$ac_t""yes" 1>&6
5015   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
5016 else
5017   echo "$ac_t""no" 1>&6
5018 fi
5019
5020
5021     fi
5022
5023     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
5024     # to get the SysV transport functions.
5025     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
5026     # needs -lnsl.
5027     # The nsl library prevents programs from opening the X display
5028     # on Irix 5.2, according to dickey@clark.net.
5029     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
5030 echo "configure:5031: checking for gethostbyname" >&5
5031
5032 cat > conftest.$ac_ext <<EOF
5033 #line 5034 "configure"
5034 #include "confdefs.h"
5035 /* System header to define __stub macros and hopefully few prototypes,
5036     which can conflict with char gethostbyname(); below.  */
5037 #include <assert.h>
5038 /* Override any gcc2 internal prototype to avoid an error.  */
5039 /* We use char because int might match the return type of a gcc2
5040     builtin and then its argument prototype would still apply.  */
5041 char gethostbyname();
5042
5043 int main() {
5044
5045 /* The GNU C library defines this for functions which it implements
5046     to always fail with ENOSYS.  Some functions are actually named
5047     something starting with __ and the normal name is an alias.  */
5048 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
5049 choke me
5050 #else
5051 gethostbyname();
5052 #endif
5053
5054 ; return 0; }
5055 EOF
5056 if { (eval echo configure:5057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5057   rm -rf conftest*
5058   eval "ac_cv_func_gethostbyname=yes"
5059 else
5060   echo "configure: failed program was:" >&5
5061   cat conftest.$ac_ext >&5
5062   rm -rf conftest*
5063   eval "ac_cv_func_gethostbyname=no"
5064 fi
5065 rm -f conftest*
5066
5067 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
5068   echo "$ac_t""yes" 1>&6
5069   :
5070 else
5071   echo "$ac_t""no" 1>&6
5072 fi
5073
5074     if test $ac_cv_func_gethostbyname = no; then
5075       
5076 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
5077 echo "configure:5078: checking for gethostbyname in -lnsl" >&5
5078 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
5079
5080 xe_check_libs=" -lnsl "
5081 cat > conftest.$ac_ext <<EOF
5082 #line 5083 "configure"
5083 #include "confdefs.h"
5084 /* Override any gcc2 internal prototype to avoid an error.  */
5085 /* We use char because int might match the return type of a gcc2
5086     builtin and then its argument prototype would still apply.  */
5087 char gethostbyname();
5088
5089 int main() {
5090 gethostbyname()
5091 ; return 0; }
5092 EOF
5093 if { (eval echo configure:5094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5094   rm -rf conftest*
5095   eval "ac_cv_lib_$ac_lib_var=yes"
5096 else
5097   echo "configure: failed program was:" >&5
5098   cat conftest.$ac_ext >&5
5099   rm -rf conftest*
5100   eval "ac_cv_lib_$ac_lib_var=no"
5101 fi
5102 rm -f conftest*
5103 xe_check_libs=""
5104
5105 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5106   echo "$ac_t""yes" 1>&6
5107   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
5108 else
5109   echo "$ac_t""no" 1>&6
5110 fi
5111
5112
5113     fi
5114
5115     # lieder@skyler.mavd.honeywell.com says without -lsocket,
5116     # socket/setsockopt and other routines are undefined under SCO ODT
5117     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
5118     # on later versions), says simon@lia.di.epfl.ch: it contains
5119     # gethostby* variants that don't use the nameserver (or something).
5120     # -lsocket must be given before -lnsl if both are needed.
5121     # We assume that if connect needs -lnsl, so does gethostbyname.
5122     echo $ac_n "checking for connect""... $ac_c" 1>&6
5123 echo "configure:5124: checking for connect" >&5
5124
5125 cat > conftest.$ac_ext <<EOF
5126 #line 5127 "configure"
5127 #include "confdefs.h"
5128 /* System header to define __stub macros and hopefully few prototypes,
5129     which can conflict with char connect(); below.  */
5130 #include <assert.h>
5131 /* Override any gcc2 internal prototype to avoid an error.  */
5132 /* We use char because int might match the return type of a gcc2
5133     builtin and then its argument prototype would still apply.  */
5134 char connect();
5135
5136 int main() {
5137
5138 /* The GNU C library defines this for functions which it implements
5139     to always fail with ENOSYS.  Some functions are actually named
5140     something starting with __ and the normal name is an alias.  */
5141 #if defined (__stub_connect) || defined (__stub___connect)
5142 choke me
5143 #else
5144 connect();
5145 #endif
5146
5147 ; return 0; }
5148 EOF
5149 if { (eval echo configure:5150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5150   rm -rf conftest*
5151   eval "ac_cv_func_connect=yes"
5152 else
5153   echo "configure: failed program was:" >&5
5154   cat conftest.$ac_ext >&5
5155   rm -rf conftest*
5156   eval "ac_cv_func_connect=no"
5157 fi
5158 rm -f conftest*
5159
5160 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
5161   echo "$ac_t""yes" 1>&6
5162   :
5163 else
5164   echo "$ac_t""no" 1>&6
5165 fi
5166
5167     if test $ac_cv_func_connect = no; then
5168       
5169 xe_msg_checking="for connect in -lsocket"
5170 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5171 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5172 echo "configure:5173: checking "$xe_msg_checking"" >&5
5173 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5174
5175 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
5176 cat > conftest.$ac_ext <<EOF
5177 #line 5178 "configure"
5178 #include "confdefs.h"
5179 /* Override any gcc2 internal prototype to avoid an error.  */
5180 /* We use char because int might match the return type of a gcc2
5181     builtin and then its argument prototype would still apply.  */
5182 char connect();
5183
5184 int main() {
5185 connect()
5186 ; return 0; }
5187 EOF
5188 if { (eval echo configure:5189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5189   rm -rf conftest*
5190   eval "ac_cv_lib_$ac_lib_var=yes"
5191 else
5192   echo "configure: failed program was:" >&5
5193   cat conftest.$ac_ext >&5
5194   rm -rf conftest*
5195   eval "ac_cv_lib_$ac_lib_var=no"
5196 fi
5197 rm -f conftest*
5198 xe_check_libs=""
5199
5200 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5201   echo "$ac_t""yes" 1>&6
5202   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5203 else
5204   echo "$ac_t""no" 1>&6
5205 fi
5206
5207
5208     fi
5209
5210     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5211     echo $ac_n "checking for remove""... $ac_c" 1>&6
5212 echo "configure:5213: checking for remove" >&5
5213
5214 cat > conftest.$ac_ext <<EOF
5215 #line 5216 "configure"
5216 #include "confdefs.h"
5217 /* System header to define __stub macros and hopefully few prototypes,
5218     which can conflict with char remove(); below.  */
5219 #include <assert.h>
5220 /* Override any gcc2 internal prototype to avoid an error.  */
5221 /* We use char because int might match the return type of a gcc2
5222     builtin and then its argument prototype would still apply.  */
5223 char remove();
5224
5225 int main() {
5226
5227 /* The GNU C library defines this for functions which it implements
5228     to always fail with ENOSYS.  Some functions are actually named
5229     something starting with __ and the normal name is an alias.  */
5230 #if defined (__stub_remove) || defined (__stub___remove)
5231 choke me
5232 #else
5233 remove();
5234 #endif
5235
5236 ; return 0; }
5237 EOF
5238 if { (eval echo configure:5239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5239   rm -rf conftest*
5240   eval "ac_cv_func_remove=yes"
5241 else
5242   echo "configure: failed program was:" >&5
5243   cat conftest.$ac_ext >&5
5244   rm -rf conftest*
5245   eval "ac_cv_func_remove=no"
5246 fi
5247 rm -f conftest*
5248
5249 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5250   echo "$ac_t""yes" 1>&6
5251   :
5252 else
5253   echo "$ac_t""no" 1>&6
5254 fi
5255
5256     if test $ac_cv_func_remove = no; then
5257       
5258 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5259 echo "configure:5260: checking for remove in -lposix" >&5
5260 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5261
5262 xe_check_libs=" -lposix "
5263 cat > conftest.$ac_ext <<EOF
5264 #line 5265 "configure"
5265 #include "confdefs.h"
5266 /* Override any gcc2 internal prototype to avoid an error.  */
5267 /* We use char because int might match the return type of a gcc2
5268     builtin and then its argument prototype would still apply.  */
5269 char remove();
5270
5271 int main() {
5272 remove()
5273 ; return 0; }
5274 EOF
5275 if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5276   rm -rf conftest*
5277   eval "ac_cv_lib_$ac_lib_var=yes"
5278 else
5279   echo "configure: failed program was:" >&5
5280   cat conftest.$ac_ext >&5
5281   rm -rf conftest*
5282   eval "ac_cv_lib_$ac_lib_var=no"
5283 fi
5284 rm -f conftest*
5285 xe_check_libs=""
5286
5287 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5288   echo "$ac_t""yes" 1>&6
5289   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5290 else
5291   echo "$ac_t""no" 1>&6
5292 fi
5293
5294
5295     fi
5296
5297     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5298     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5299 echo "configure:5300: checking for shmat" >&5
5300
5301 cat > conftest.$ac_ext <<EOF
5302 #line 5303 "configure"
5303 #include "confdefs.h"
5304 /* System header to define __stub macros and hopefully few prototypes,
5305     which can conflict with char shmat(); below.  */
5306 #include <assert.h>
5307 /* Override any gcc2 internal prototype to avoid an error.  */
5308 /* We use char because int might match the return type of a gcc2
5309     builtin and then its argument prototype would still apply.  */
5310 char shmat();
5311
5312 int main() {
5313
5314 /* The GNU C library defines this for functions which it implements
5315     to always fail with ENOSYS.  Some functions are actually named
5316     something starting with __ and the normal name is an alias.  */
5317 #if defined (__stub_shmat) || defined (__stub___shmat)
5318 choke me
5319 #else
5320 shmat();
5321 #endif
5322
5323 ; return 0; }
5324 EOF
5325 if { (eval echo configure:5326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5326   rm -rf conftest*
5327   eval "ac_cv_func_shmat=yes"
5328 else
5329   echo "configure: failed program was:" >&5
5330   cat conftest.$ac_ext >&5
5331   rm -rf conftest*
5332   eval "ac_cv_func_shmat=no"
5333 fi
5334 rm -f conftest*
5335
5336 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5337   echo "$ac_t""yes" 1>&6
5338   :
5339 else
5340   echo "$ac_t""no" 1>&6
5341 fi
5342
5343     if test $ac_cv_func_shmat = no; then
5344       
5345 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5346 echo "configure:5347: checking for shmat in -lipc" >&5
5347 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5348
5349 xe_check_libs=" -lipc "
5350 cat > conftest.$ac_ext <<EOF
5351 #line 5352 "configure"
5352 #include "confdefs.h"
5353 /* Override any gcc2 internal prototype to avoid an error.  */
5354 /* We use char because int might match the return type of a gcc2
5355     builtin and then its argument prototype would still apply.  */
5356 char shmat();
5357
5358 int main() {
5359 shmat()
5360 ; return 0; }
5361 EOF
5362 if { (eval echo configure:5363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5363   rm -rf conftest*
5364   eval "ac_cv_lib_$ac_lib_var=yes"
5365 else
5366   echo "configure: failed program was:" >&5
5367   cat conftest.$ac_ext >&5
5368   rm -rf conftest*
5369   eval "ac_cv_lib_$ac_lib_var=no"
5370 fi
5371 rm -f conftest*
5372 xe_check_libs=""
5373
5374 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5375   echo "$ac_t""yes" 1>&6
5376   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5377 else
5378   echo "$ac_t""no" 1>&6
5379 fi
5380
5381
5382     fi
5383   fi
5384
5385   # Check for libraries that X11R6 Xt/Xaw programs need.
5386   ac_save_LDFLAGS="$LDFLAGS"
5387   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5388   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5389   # check for ICE first), but we must link in the order -lSM -lICE or
5390   # we get undefined symbols.  So assume we have SM if we have ICE.
5391   # These have to be linked with before -lX11, unlike the other
5392   # libraries we check for below, so use a different variable.
5393   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5394   
5395 xe_msg_checking="for IceConnectionNumber in -lICE"
5396 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
5397 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5398 echo "configure:5399: checking "$xe_msg_checking"" >&5
5399 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5400
5401 xe_check_libs=" -lICE $X_EXTRA_LIBS"
5402 cat > conftest.$ac_ext <<EOF
5403 #line 5404 "configure"
5404 #include "confdefs.h"
5405 /* Override any gcc2 internal prototype to avoid an error.  */
5406 /* We use char because int might match the return type of a gcc2
5407     builtin and then its argument prototype would still apply.  */
5408 char IceConnectionNumber();
5409
5410 int main() {
5411 IceConnectionNumber()
5412 ; return 0; }
5413 EOF
5414 if { (eval echo configure:5415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5415   rm -rf conftest*
5416   eval "ac_cv_lib_$ac_lib_var=yes"
5417 else
5418   echo "configure: failed program was:" >&5
5419   cat conftest.$ac_ext >&5
5420   rm -rf conftest*
5421   eval "ac_cv_lib_$ac_lib_var=no"
5422 fi
5423 rm -f conftest*
5424 xe_check_libs=""
5425
5426 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5427   echo "$ac_t""yes" 1>&6
5428   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5429 else
5430   echo "$ac_t""no" 1>&6
5431 fi
5432
5433
5434   LDFLAGS="$ac_save_LDFLAGS"
5435
5436 fi
5437  # Autoconf claims to find X library and include dirs for us.
5438   if test "$no_x" = "yes"
5439   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5440   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5441   fi
5442 fi
5443
5444 case "$with_x11" in
5445   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5446   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5447 esac
5448
5449 if test "$with_x11" = "yes"; then
5450   { test "$extra_verbose" = "yes" && cat << \EOF
5451     Defining HAVE_X_WINDOWS
5452 EOF
5453 cat >> confdefs.h <<\EOF
5454 #define HAVE_X_WINDOWS 1
5455 EOF
5456 }
5457
5458   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5459   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5460
5461       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5462     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5463     if test -d "$lib_dir" -a -d "$inc_dir"; then
5464       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5465         x_libraries="$lib_dir $x_libraries"
5466         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5467       esac
5468       case "$x_includes" in "$inc_dir"* ) ;; *)
5469         x_includes="$inc_dir $x_includes"
5470         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5471       esac
5472       break;       fi
5473   done
5474
5475     for rel in "X11R6" "X11R5" "X11R4"; do
5476     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5477     if test -d "$lib_dir" -a -d "$inc_dir"; then
5478       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5479         x_libraries="$x_libraries $lib_dir"
5480         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5481       esac
5482       case "$x_includes" in "$inc_dir"* ) ;; *)
5483         x_includes="$x_includes $inc_dir"
5484         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5485       esac
5486       break;     fi
5487   done
5488
5489     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
5490
5491   ld_switch_x_site="$X_LIBS"
5492
5493   
5494 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5495     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5496   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5497   
5498         runpath="" runpath_dirs=""
5499   if test -n "$LD_RUN_PATH"; then
5500     runpath="$LD_RUN_PATH"
5501   elif test "$GCC" = "yes"; then
5502         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5503     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5504     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5505     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5506       case "$arg" in P,* | -L* | -R* )
5507         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5508           {
5509 xe_runpath_dir="$dir"
5510   test "$xe_runpath_dir" != "/lib"     -a \
5511         "$xe_runpath_dir" != "/usr/lib" -a \
5512         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5513   eval "$xe_add_unique_runpath_dir"
5514 }
5515         done ;;
5516       esac
5517     done
5518     ld_switch_run="$ld_switch_run_save"
5519     rm -f conftest*
5520   else
5521         for arg in $ld_switch_site $ld_switch_x_site; do
5522       case "$arg" in -L*) {
5523 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5524   test "$xe_runpath_dir" != "/lib"     -a \
5525         "$xe_runpath_dir" != "/usr/lib" -a \
5526         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5527   eval "$xe_add_unique_runpath_dir"
5528 };; esac
5529     done
5530         if test "$opsys $need_motif" = "sol2 yes"; then
5531       xe_runpath_dir="/opt/SUNWdt/lib";
5532       eval "$xe_add_unique_runpath_dir";
5533     fi
5534   fi 
5535   if test -n "$runpath"; then
5536     ld_switch_run="${dash_r}${runpath}"
5537     
5538 if test "$GCC" = "yes"; then
5539   set x $ld_switch_run; shift; ld_switch_run=""
5540   while test -n "$1"; do
5541     case $1 in
5542       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5543       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5544       -Xlinker* ) ;;
5545       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5546     esac
5547     shift
5548   done
5549 fi
5550     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5551   fi
5552 fi
5553
5554
5555   if test "$extra_verbose" = "yes"; then
5556     echo; echo "X11 compilation variables:"
5557     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5558     echo
5559   fi
5560
5561             bitmapdirs=
5562   if test "$x_includes" != NONE; then
5563     for i in $x_includes; do
5564       if test -d "$i/bitmaps"; then
5565         bitmapdirs="$i/bitmaps:$bitmapdirs"
5566       fi
5567       if test -d "$i/X11/bitmaps"; then
5568         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5569       fi
5570     done
5571     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5572   fi
5573   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5574     Defining BITMAPDIR = "$bitmapdirs"
5575 EOF
5576 cat >> confdefs.h <<EOF
5577 #define BITMAPDIR "$bitmapdirs"
5578 EOF
5579 }
5580
5581
5582     echo "checking for X defines extracted by xmkmf" 1>&6
5583 echo "configure:5584: checking for X defines extracted by xmkmf" >&5
5584   rm -fr conftestdir
5585   if mkdir conftestdir; then
5586     cd conftestdir
5587     cat > Imakefile <<'EOF'
5588 xetest:
5589         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5590 EOF
5591     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5592       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5593       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5594     fi
5595     cd ..
5596     rm -fr conftestdir
5597     for word in $xmkmf_defines; do
5598       case "$word" in
5599         -D*=* ) ;;
5600         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5601               { test "$extra_verbose" = "yes" && cat << EOF
5602     Defining $word
5603 EOF
5604 cat >> confdefs.h <<EOF
5605 #define $word 1
5606 EOF
5607 }
5608  ;;
5609       esac
5610     done
5611   fi
5612
5613     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5614 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5615 echo "configure:5616: checking for X11/Intrinsic.h" >&5
5616
5617 cat > conftest.$ac_ext <<EOF
5618 #line 5619 "configure"
5619 #include "confdefs.h"
5620 #include <X11/Intrinsic.h>
5621 EOF
5622 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5623 { (eval echo configure:5624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5624 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5625 if test -z "$ac_err"; then
5626   rm -rf conftest*
5627   eval "ac_cv_header_$ac_safe=yes"
5628 else
5629   echo "$ac_err" >&5
5630   echo "configure: failed program was:" >&5
5631   cat conftest.$ac_ext >&5
5632   rm -rf conftest*
5633   eval "ac_cv_header_$ac_safe=no"
5634 fi
5635 rm -f conftest*
5636 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5637   echo "$ac_t""yes" 1>&6
5638   :
5639 else
5640   echo "$ac_t""no" 1>&6
5641 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5642 fi
5643
5644
5645       
5646 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5647 echo "configure:5648: checking for XOpenDisplay in -lX11" >&5
5648 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5649
5650 xe_check_libs=" -lX11 "
5651 cat > conftest.$ac_ext <<EOF
5652 #line 5653 "configure"
5653 #include "confdefs.h"
5654 /* Override any gcc2 internal prototype to avoid an error.  */
5655 /* We use char because int might match the return type of a gcc2
5656     builtin and then its argument prototype would still apply.  */
5657 char XOpenDisplay();
5658
5659 int main() {
5660 XOpenDisplay()
5661 ; return 0; }
5662 EOF
5663 if { (eval echo configure:5664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5664   rm -rf conftest*
5665   eval "ac_cv_lib_$ac_lib_var=yes"
5666 else
5667   echo "configure: failed program was:" >&5
5668   cat conftest.$ac_ext >&5
5669   rm -rf conftest*
5670   eval "ac_cv_lib_$ac_lib_var=no"
5671 fi
5672 rm -f conftest*
5673 xe_check_libs=""
5674
5675 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5676   echo "$ac_t""yes" 1>&6
5677   have_lib_x11=yes
5678 else
5679   echo "$ac_t""no" 1>&6
5680 fi
5681
5682
5683   if test "$have_lib_x11" != "yes"; then
5684     
5685 xe_msg_checking="for XGetFontProperty in -lX11"
5686 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5687 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5688 echo "configure:5689: checking "$xe_msg_checking"" >&5
5689 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5690
5691 xe_check_libs=" -lX11 -b i486-linuxaout"
5692 cat > conftest.$ac_ext <<EOF
5693 #line 5694 "configure"
5694 #include "confdefs.h"
5695 /* Override any gcc2 internal prototype to avoid an error.  */
5696 /* We use char because int might match the return type of a gcc2
5697     builtin and then its argument prototype would still apply.  */
5698 char XGetFontProperty();
5699
5700 int main() {
5701 XGetFontProperty()
5702 ; return 0; }
5703 EOF
5704 if { (eval echo configure:5705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5705   rm -rf conftest*
5706   eval "ac_cv_lib_$ac_lib_var=yes"
5707 else
5708   echo "configure: failed program was:" >&5
5709   cat conftest.$ac_ext >&5
5710   rm -rf conftest*
5711   eval "ac_cv_lib_$ac_lib_var=no"
5712 fi
5713 rm -f conftest*
5714 xe_check_libs=""
5715
5716 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5717   echo "$ac_t""yes" 1>&6
5718   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5719 else
5720   echo "$ac_t""no" 1>&6
5721 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5722 fi
5723
5724
5725   fi
5726   libs_x="-lX11"
5727   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5728
5729     
5730 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5731 echo "configure:5732: checking for XShapeSelectInput in -lXext" >&5
5732 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5733
5734 xe_check_libs=" -lXext "
5735 cat > conftest.$ac_ext <<EOF
5736 #line 5737 "configure"
5737 #include "confdefs.h"
5738 /* Override any gcc2 internal prototype to avoid an error.  */
5739 /* We use char because int might match the return type of a gcc2
5740     builtin and then its argument prototype would still apply.  */
5741 char XShapeSelectInput();
5742
5743 int main() {
5744 XShapeSelectInput()
5745 ; return 0; }
5746 EOF
5747 if { (eval echo configure:5748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5748   rm -rf conftest*
5749   eval "ac_cv_lib_$ac_lib_var=yes"
5750 else
5751   echo "configure: failed program was:" >&5
5752   cat conftest.$ac_ext >&5
5753   rm -rf conftest*
5754   eval "ac_cv_lib_$ac_lib_var=no"
5755 fi
5756 rm -f conftest*
5757 xe_check_libs=""
5758
5759 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5760   echo "$ac_t""yes" 1>&6
5761   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5762 else
5763   echo "$ac_t""no" 1>&6
5764 fi
5765
5766
5767
5768     
5769 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5770 echo "configure:5771: checking for XtOpenDisplay in -lXt" >&5
5771 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5772
5773 xe_check_libs=" -lXt "
5774 cat > conftest.$ac_ext <<EOF
5775 #line 5776 "configure"
5776 #include "confdefs.h"
5777 /* Override any gcc2 internal prototype to avoid an error.  */
5778 /* We use char because int might match the return type of a gcc2
5779     builtin and then its argument prototype would still apply.  */
5780 char XtOpenDisplay();
5781
5782 int main() {
5783 XtOpenDisplay()
5784 ; return 0; }
5785 EOF
5786 if { (eval echo configure:5787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5787   rm -rf conftest*
5788   eval "ac_cv_lib_$ac_lib_var=yes"
5789 else
5790   echo "configure: failed program was:" >&5
5791   cat conftest.$ac_ext >&5
5792   rm -rf conftest*
5793   eval "ac_cv_lib_$ac_lib_var=no"
5794 fi
5795 rm -f conftest*
5796 xe_check_libs=""
5797
5798 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5799   echo "$ac_t""yes" 1>&6
5800   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5801 else
5802   echo "$ac_t""no" 1>&6
5803 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5804 fi
5805
5806
5807
5808   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5809 echo "configure:5810: checking the version of X11 being used" >&5
5810   cat > conftest.$ac_ext <<EOF
5811 #line 5812 "configure"
5812 #include "confdefs.h"
5813 #include <X11/Intrinsic.h>
5814     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5815 EOF
5816 if { (eval echo configure:5817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5817 then
5818   ./conftest foobar; x11_release=$?
5819 else
5820   conftest_rc="$?"
5821   echo "configure: failed program was:" >&5
5822   cat conftest.$ac_ext >&5
5823   rm -fr conftest*
5824   x11_release=4
5825 fi
5826 rm -fr conftest*
5827   echo "$ac_t""R${x11_release}" 1>&6
5828   { test "$extra_verbose" = "yes" && cat << EOF
5829     Defining THIS_IS_X11R${x11_release}
5830 EOF
5831 cat >> confdefs.h <<EOF
5832 #define THIS_IS_X11R${x11_release} 1
5833 EOF
5834 }
5835
5836
5837   for ac_hdr in X11/Xlocale.h
5838 do
5839 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5840 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5841 echo "configure:5842: checking for $ac_hdr" >&5
5842
5843 cat > conftest.$ac_ext <<EOF
5844 #line 5845 "configure"
5845 #include "confdefs.h"
5846 #include <$ac_hdr>
5847 EOF
5848 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5849 { (eval echo configure:5850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5850 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5851 if test -z "$ac_err"; then
5852   rm -rf conftest*
5853   eval "ac_cv_header_$ac_safe=yes"
5854 else
5855   echo "$ac_err" >&5
5856   echo "configure: failed program was:" >&5
5857   cat conftest.$ac_ext >&5
5858   rm -rf conftest*
5859   eval "ac_cv_header_$ac_safe=no"
5860 fi
5861 rm -f conftest*
5862 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5863   echo "$ac_t""yes" 1>&6
5864     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5865   { test "$extra_verbose" = "yes" && cat << EOF
5866     Defining $ac_tr_hdr
5867 EOF
5868 cat >> confdefs.h <<EOF
5869 #define $ac_tr_hdr 1
5870 EOF
5871 }
5872  
5873 else
5874   echo "$ac_t""no" 1>&6
5875 fi
5876 done
5877
5878
5879     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5880 echo "configure:5881: checking for XFree86" >&5
5881   if test -d "/usr/X386/include" -o \
5882           -f "/etc/XF86Config"    -o \
5883           -f "/etc/X11/XF86Config" -o \
5884           -f "/usr/X11R6/lib/X11/XF86Config"; then
5885     echo "$ac_t""yes" 1>&6
5886     { test "$extra_verbose" = "yes" && cat << \EOF
5887     Defining HAVE_XFREE386
5888 EOF
5889 cat >> confdefs.h <<\EOF
5890 #define HAVE_XFREE386 1
5891 EOF
5892 }
5893
5894   else
5895     echo "$ac_t""no" 1>&6
5896   fi
5897
5898     test -z "$with_xmu" && { 
5899 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5900 echo "configure:5901: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5901 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5902
5903 xe_check_libs=" -lXmu "
5904 cat > conftest.$ac_ext <<EOF
5905 #line 5906 "configure"
5906 #include "confdefs.h"
5907 /* Override any gcc2 internal prototype to avoid an error.  */
5908 /* We use char because int might match the return type of a gcc2
5909     builtin and then its argument prototype would still apply.  */
5910 char XmuReadBitmapDataFromFile();
5911
5912 int main() {
5913 XmuReadBitmapDataFromFile()
5914 ; return 0; }
5915 EOF
5916 if { (eval echo configure:5917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5917   rm -rf conftest*
5918   eval "ac_cv_lib_$ac_lib_var=yes"
5919 else
5920   echo "configure: failed program was:" >&5
5921   cat conftest.$ac_ext >&5
5922   rm -rf conftest*
5923   eval "ac_cv_lib_$ac_lib_var=no"
5924 fi
5925 rm -f conftest*
5926 xe_check_libs=""
5927
5928 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5929   echo "$ac_t""yes" 1>&6
5930   with_xmu=yes
5931 else
5932   echo "$ac_t""no" 1>&6
5933 with_xmu=no
5934 fi
5935
5936  }
5937   if test "$with_xmu" = "no"; then
5938     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5939    echo "    xemacs will be linked with \"xmu.o\""
5940  fi
5941   else
5942     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5943     { test "$extra_verbose" = "yes" && cat << \EOF
5944     Defining HAVE_XMU
5945 EOF
5946 cat >> confdefs.h <<\EOF
5947 #define HAVE_XMU 1
5948 EOF
5949 }
5950
5951   fi
5952
5953       
5954 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5955 echo "configure:5956: checking for main in -lXbsd" >&5
5956 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5957
5958 xe_check_libs=" -lXbsd "
5959 cat > conftest.$ac_ext <<EOF
5960 #line 5961 "configure"
5961 #include "confdefs.h"
5962
5963 int main() {
5964 main()
5965 ; return 0; }
5966 EOF
5967 if { (eval echo configure:5968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5968   rm -rf conftest*
5969   eval "ac_cv_lib_$ac_lib_var=yes"
5970 else
5971   echo "configure: failed program was:" >&5
5972   cat conftest.$ac_ext >&5
5973   rm -rf conftest*
5974   eval "ac_cv_lib_$ac_lib_var=no"
5975 fi
5976 rm -f conftest*
5977 xe_check_libs=""
5978
5979 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5980   echo "$ac_t""yes" 1>&6
5981   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5982 else
5983   echo "$ac_t""no" 1>&6
5984 fi
5985
5986
5987
5988     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5989         if test "$GCC" = "yes"; then
5990       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5991       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5992     else
5993       case "$CC" in
5994         "xlc" ) CC="xlc_r" ;;
5995         "xlC" ) CC="xlC_r" ;;
5996         "cc"  ) CC="cc_r" ;;
5997       esac
5998     fi
5999   fi
6000
6001 fi 
6002 if test "$with_msw" != "no"; then
6003   echo "checking for MS-Windows" 1>&6
6004 echo "configure:6005: checking for MS-Windows" >&5
6005   
6006 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
6007 echo "configure:6008: checking for main in -lgdi32" >&5
6008 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
6009
6010 xe_check_libs=" -lgdi32 "
6011 cat > conftest.$ac_ext <<EOF
6012 #line 6013 "configure"
6013 #include "confdefs.h"
6014
6015 int main() {
6016 main()
6017 ; return 0; }
6018 EOF
6019 if { (eval echo configure:6020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6020   rm -rf conftest*
6021   eval "ac_cv_lib_$ac_lib_var=yes"
6022 else
6023   echo "configure: failed program was:" >&5
6024   cat conftest.$ac_ext >&5
6025   rm -rf conftest*
6026   eval "ac_cv_lib_$ac_lib_var=no"
6027 fi
6028 rm -f conftest*
6029 xe_check_libs=""
6030
6031 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6032   echo "$ac_t""yes" 1>&6
6033   with_msw=yes
6034 else
6035   echo "$ac_t""no" 1>&6
6036 fi
6037
6038
6039   if test "$with_msw" = "yes"; then
6040     { test "$extra_verbose" = "yes" && cat << \EOF
6041     Defining HAVE_MS_WINDOWS
6042 EOF
6043 cat >> confdefs.h <<\EOF
6044 #define HAVE_MS_WINDOWS 1
6045 EOF
6046 }
6047
6048     install_pp="$blddir/lib-src/installexe.sh"
6049     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
6050     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
6051     if test "$window_system" != x11; then
6052         window_system=msw
6053         test "$with_scrollbars" != "no" && with_scrollbars=msw \
6054             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6055    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6056  fi
6057         test "$with_menubars"   != "no" && with_menubars=msw \
6058             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6059    echo "    xemacs will be linked with \"menubar-msw.o\""
6060  fi
6061         test "$with_toolbars"   != "no" && with_toolbars=msw \
6062             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6063    echo "    xemacs will be linked with \"toolbar-msw.o\""
6064  fi
6065         test "$with_dialogs"   != "no" && with_dialogs=msw \
6066             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6067    echo "    xemacs will be linked with \"dialog-msw.o\""
6068  fi
6069         test "$with_widgets"   != "no" && with_widgets=msw
6070     else
6071         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6072    echo "    xemacs will be linked with \"scrollbar-msw.o\""
6073  fi
6074         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6075    echo "    xemacs will be linked with \"menubar-msw.o\""
6076  fi
6077         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
6078    echo "    xemacs will be linked with \"toolbar-msw.o\""
6079  fi
6080         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
6081    echo "    xemacs will be linked with \"dialog-msw.o\""
6082  fi
6083     fi
6084         cat > conftest.$ac_ext <<EOF
6085 #line 6086 "configure"
6086 #include "confdefs.h"
6087 #include <fcntl.h>
6088     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
6089 EOF
6090 if { (eval echo configure:6091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6091 then
6092   { test "$extra_verbose" = "yes" && cat << \EOF
6093     Defining HAVE_MSG_SELECT
6094 EOF
6095 cat >> confdefs.h <<\EOF
6096 #define HAVE_MSG_SELECT 1
6097 EOF
6098 }
6099
6100 else
6101   conftest_rc="$?"
6102   echo "configure: failed program was:" >&5
6103   cat conftest.$ac_ext >&5
6104 fi
6105 rm -fr conftest*
6106     const_is_losing=no
6107     with_file_coding=yes
6108     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
6109    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\""
6110  fi
6111   fi
6112 fi
6113
6114
6115
6116 test -z "$window_system" && window_system="none"
6117
6118 if test "$window_system" = "none"; then
6119   for feature in menubars scrollbars toolbars dialogs dragndrop xface
6120   do
6121     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6122        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
6123     fi
6124     eval "with_${feature}=no"
6125   done
6126 else
6127   test -z "$with_toolbars" && with_toolbars=yes
6128 fi
6129
6130 if test "$with_msw" != "yes"; then
6131   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
6132   do
6133     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6134        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
6135     fi
6136     eval "with_${feature}=no"
6137   done
6138 else
6139   :
6140 fi
6141
6142 if test "$with_x11" != "yes"; then
6143             for feature in tooltalk cde offix wmcommand xim xmu
6144   do
6145     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
6146        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
6147     fi
6148     eval "with_${feature}=no"
6149   done
6150 fi
6151
6152 bitmapdir=
6153
6154 case "$window_system" in
6155   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
6156   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
6157   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
6158 esac
6159
6160 case "$x_libraries" in *X11R4* )
6161   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
6162   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
6163 esac
6164
6165 echo "checking for WM_COMMAND option" 1>&6
6166 echo "configure:6167: checking for WM_COMMAND option" >&5;
6167 if test "$with_wmcommand" != "no"; then
6168   { test "$extra_verbose" = "yes" && cat << \EOF
6169     Defining HAVE_WMCOMMAND
6170 EOF
6171 cat >> confdefs.h <<\EOF
6172 #define HAVE_WMCOMMAND 1
6173 EOF
6174 }
6175
6176 fi
6177
6178 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
6179 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
6180 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
6181 echo "configure:6182: checking for X11/Xauth.h" >&5
6182
6183 cat > conftest.$ac_ext <<EOF
6184 #line 6185 "configure"
6185 #include "confdefs.h"
6186 #include <X11/Xauth.h>
6187 EOF
6188 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6189 { (eval echo configure:6190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6190 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6191 if test -z "$ac_err"; then
6192   rm -rf conftest*
6193   eval "ac_cv_header_$ac_safe=yes"
6194 else
6195   echo "$ac_err" >&5
6196   echo "configure: failed program was:" >&5
6197   cat conftest.$ac_ext >&5
6198   rm -rf conftest*
6199   eval "ac_cv_header_$ac_safe=no"
6200 fi
6201 rm -f conftest*
6202 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6203   echo "$ac_t""yes" 1>&6
6204   :
6205 else
6206   echo "$ac_t""no" 1>&6
6207 with_xauth=no
6208 fi
6209  }
6210 test -z "$with_xauth" && { 
6211 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6212 echo "configure:6213: checking for XauGetAuthByAddr in -lXau" >&5
6213 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6214
6215 xe_check_libs=" -lXau "
6216 cat > conftest.$ac_ext <<EOF
6217 #line 6218 "configure"
6218 #include "confdefs.h"
6219 /* Override any gcc2 internal prototype to avoid an error.  */
6220 /* We use char because int might match the return type of a gcc2
6221     builtin and then its argument prototype would still apply.  */
6222 char XauGetAuthByAddr();
6223
6224 int main() {
6225 XauGetAuthByAddr()
6226 ; return 0; }
6227 EOF
6228 if { (eval echo configure:6229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6229   rm -rf conftest*
6230   eval "ac_cv_lib_$ac_lib_var=yes"
6231 else
6232   echo "configure: failed program was:" >&5
6233   cat conftest.$ac_ext >&5
6234   rm -rf conftest*
6235   eval "ac_cv_lib_$ac_lib_var=no"
6236 fi
6237 rm -f conftest*
6238 xe_check_libs=""
6239
6240 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6241   echo "$ac_t""yes" 1>&6
6242   :
6243 else
6244   echo "$ac_t""no" 1>&6
6245 with_xauth=no
6246 fi
6247
6248  }
6249 test -z "$with_xauth" && with_xauth=yes
6250 if test "$with_xauth" = "yes"; then
6251   { test "$extra_verbose" = "yes" && cat << \EOF
6252     Defining HAVE_XAUTH
6253 EOF
6254 cat >> confdefs.h <<\EOF
6255 #define HAVE_XAUTH 1
6256 EOF
6257 }
6258
6259   
6260 T=""
6261 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
6262 libs_xauth="$T"
6263
6264 fi
6265
6266
6267
6268
6269 if test "$with_tooltalk" != "no" ; then
6270       for dir in "" "Tt/" "desktop/" ; do
6271     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6272 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6273 echo "configure:6274: checking for ${dir}tt_c.h" >&5
6274
6275 cat > conftest.$ac_ext <<EOF
6276 #line 6277 "configure"
6277 #include "confdefs.h"
6278 #include <${dir}tt_c.h>
6279 EOF
6280 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6281 { (eval echo configure:6282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6282 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6283 if test -z "$ac_err"; then
6284   rm -rf conftest*
6285   eval "ac_cv_header_$ac_safe=yes"
6286 else
6287   echo "$ac_err" >&5
6288   echo "configure: failed program was:" >&5
6289   cat conftest.$ac_ext >&5
6290   rm -rf conftest*
6291   eval "ac_cv_header_$ac_safe=no"
6292 fi
6293 rm -f conftest*
6294 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6295   echo "$ac_t""yes" 1>&6
6296   tt_c_h_path="${dir}tt_c.h"; break
6297 else
6298   echo "$ac_t""no" 1>&6
6299 fi
6300
6301   done
6302   if test -z "$tt_c_h_path"; then
6303     if test "$with_tooltalk" = "yes"; then
6304       (echo "$progname: Usage error:"
6305 echo " " "Unable to find required tooltalk header files."
6306 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6307     fi
6308     with_tooltalk=no
6309   fi
6310 fi
6311 if test "$with_tooltalk" != "no" ; then
6312   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6313     
6314 xe_msg_checking="for tt_message_create in -ltt"
6315 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6316 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6317 echo "configure:6318: checking "$xe_msg_checking"" >&5
6318 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6319
6320 xe_check_libs=" -ltt $extra_libs"
6321 cat > conftest.$ac_ext <<EOF
6322 #line 6323 "configure"
6323 #include "confdefs.h"
6324 /* Override any gcc2 internal prototype to avoid an error.  */
6325 /* We use char because int might match the return type of a gcc2
6326     builtin and then its argument prototype would still apply.  */
6327 char tt_message_create();
6328
6329 int main() {
6330 tt_message_create()
6331 ; return 0; }
6332 EOF
6333 if { (eval echo configure:6334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6334   rm -rf conftest*
6335   eval "ac_cv_lib_$ac_lib_var=yes"
6336 else
6337   echo "configure: failed program was:" >&5
6338   cat conftest.$ac_ext >&5
6339   rm -rf conftest*
6340   eval "ac_cv_lib_$ac_lib_var=no"
6341 fi
6342 rm -f conftest*
6343 xe_check_libs=""
6344
6345 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6346   echo "$ac_t""yes" 1>&6
6347   tt_libs="-ltt $extra_libs"; break
6348 else
6349   echo "$ac_t""no" 1>&6
6350 :
6351 fi
6352
6353
6354   done
6355   if test -z "$tt_libs"; then
6356     if test "$with_tooltalk" = "yes"; then
6357       (echo "$progname: Usage error:"
6358 echo " " "Unable to find required tooltalk libraries."
6359 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6360     fi
6361     with_tooltalk=no
6362   fi
6363 fi
6364 test -z "$with_tooltalk" && with_tooltalk=yes
6365 if test "$with_tooltalk" = "yes"; then
6366   { test "$extra_verbose" = "yes" && cat << \EOF
6367     Defining TOOLTALK
6368 EOF
6369 cat >> confdefs.h <<\EOF
6370 #define TOOLTALK 1
6371 EOF
6372 }
6373
6374   { test "$extra_verbose" = "yes" && cat << EOF
6375     Defining TT_C_H_PATH = "$tt_c_h_path"
6376 EOF
6377 cat >> confdefs.h <<EOF
6378 #define TT_C_H_PATH "$tt_c_h_path"
6379 EOF
6380 }
6381
6382   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6383   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6384    echo "    xemacs will be linked with \"tooltalk.o\""
6385  fi
6386 fi
6387
6388 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6389 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6390 echo "configure:6391: checking for Dt/Dt.h" >&5
6391
6392 cat > conftest.$ac_ext <<EOF
6393 #line 6394 "configure"
6394 #include "confdefs.h"
6395 #include <Dt/Dt.h>
6396 EOF
6397 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6398 { (eval echo configure:6399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6399 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6400 if test -z "$ac_err"; then
6401   rm -rf conftest*
6402   eval "ac_cv_header_$ac_safe=yes"
6403 else
6404   echo "$ac_err" >&5
6405   echo "configure: failed program was:" >&5
6406   cat conftest.$ac_ext >&5
6407   rm -rf conftest*
6408   eval "ac_cv_header_$ac_safe=no"
6409 fi
6410 rm -f conftest*
6411 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6412   echo "$ac_t""yes" 1>&6
6413   :
6414 else
6415   echo "$ac_t""no" 1>&6
6416 with_cde=no
6417 fi
6418  }
6419 test -z "$with_cde" && { 
6420 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6421 echo "configure:6422: checking for DtDndDragStart in -lDtSvc" >&5
6422 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6423
6424 xe_check_libs=" -lDtSvc "
6425 cat > conftest.$ac_ext <<EOF
6426 #line 6427 "configure"
6427 #include "confdefs.h"
6428 /* Override any gcc2 internal prototype to avoid an error.  */
6429 /* We use char because int might match the return type of a gcc2
6430     builtin and then its argument prototype would still apply.  */
6431 char DtDndDragStart();
6432
6433 int main() {
6434 DtDndDragStart()
6435 ; return 0; }
6436 EOF
6437 if { (eval echo configure:6438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6438   rm -rf conftest*
6439   eval "ac_cv_lib_$ac_lib_var=yes"
6440 else
6441   echo "configure: failed program was:" >&5
6442   cat conftest.$ac_ext >&5
6443   rm -rf conftest*
6444   eval "ac_cv_lib_$ac_lib_var=no"
6445 fi
6446 rm -f conftest*
6447 xe_check_libs=""
6448
6449 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6450   echo "$ac_t""yes" 1>&6
6451   :
6452 else
6453   echo "$ac_t""no" 1>&6
6454 with_cde=no
6455 fi
6456
6457  }
6458 test -z "$with_cde" && with_cde=yes
6459 if test "$with_dragndrop" = no; then
6460   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6461   with_cde=no
6462 fi
6463 if test "$with_cde" = "yes" ; then
6464   { test "$extra_verbose" = "yes" && cat << \EOF
6465     Defining HAVE_CDE
6466 EOF
6467 cat >> confdefs.h <<\EOF
6468 #define HAVE_CDE 1
6469 EOF
6470 }
6471
6472   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6473   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6474   with_tooltalk=yes # CDE requires Tooltalk
6475   need_motif=yes    # CDE requires Motif
6476 fi
6477
6478 test "$window_system" != "x11" && with_offix=no
6479 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6480   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6481   with_offix=no
6482 fi
6483 if test "$with_dragndrop" = no; then
6484   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6485   with_offix=no
6486 fi
6487 if test "$with_cde" = yes; then
6488   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6489   with_offix=no
6490 fi
6491 test -z "$with_offix" && with_offix=no
6492 if test "$with_offix" = "yes"; then
6493   { test "$extra_verbose" = "yes" && cat << \EOF
6494     Defining HAVE_OFFIX_DND
6495 EOF
6496 cat >> confdefs.h <<\EOF
6497 #define HAVE_OFFIX_DND 1
6498 EOF
6499 }
6500
6501   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6502   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6503 fi
6504
6505 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6506 echo "configure:6507: checking if drag and drop API is needed" >&5
6507 if test "$with_dragndrop" != "no" ; then
6508   if test -n "$dragndrop_proto" ; then
6509     with_dragndrop=yes
6510     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6511     { test "$extra_verbose" = "yes" && cat << \EOF
6512     Defining HAVE_DRAGNDROP
6513 EOF
6514 cat >> confdefs.h <<\EOF
6515 #define HAVE_DRAGNDROP 1
6516 EOF
6517 }
6518
6519     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6520   else
6521     with_dragndrop=no
6522     echo "$ac_t""no" 1>&6
6523   fi
6524 fi
6525
6526 echo "checking for LDAP" 1>&6
6527 echo "configure:6528: checking for LDAP" >&5
6528 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6529 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6530 echo "configure:6531: checking for ldap.h" >&5
6531
6532 cat > conftest.$ac_ext <<EOF
6533 #line 6534 "configure"
6534 #include "confdefs.h"
6535 #include <ldap.h>
6536 EOF
6537 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6538 { (eval echo configure:6539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6539 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6540 if test -z "$ac_err"; then
6541   rm -rf conftest*
6542   eval "ac_cv_header_$ac_safe=yes"
6543 else
6544   echo "$ac_err" >&5
6545   echo "configure: failed program was:" >&5
6546   cat conftest.$ac_ext >&5
6547   rm -rf conftest*
6548   eval "ac_cv_header_$ac_safe=no"
6549 fi
6550 rm -f conftest*
6551 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6552   echo "$ac_t""yes" 1>&6
6553   :
6554 else
6555   echo "$ac_t""no" 1>&6
6556 with_ldap=no
6557 fi
6558  }
6559 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6560 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6561 echo "configure:6562: checking for lber.h" >&5
6562
6563 cat > conftest.$ac_ext <<EOF
6564 #line 6565 "configure"
6565 #include "confdefs.h"
6566 #include <lber.h>
6567 EOF
6568 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6569 { (eval echo configure:6570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6570 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6571 if test -z "$ac_err"; then
6572   rm -rf conftest*
6573   eval "ac_cv_header_$ac_safe=yes"
6574 else
6575   echo "$ac_err" >&5
6576   echo "configure: failed program was:" >&5
6577   cat conftest.$ac_ext >&5
6578   rm -rf conftest*
6579   eval "ac_cv_header_$ac_safe=no"
6580 fi
6581 rm -f conftest*
6582 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6583   echo "$ac_t""yes" 1>&6
6584   :
6585 else
6586   echo "$ac_t""no" 1>&6
6587 with_ldap=no
6588 fi
6589  }
6590 if test "$with_ldap" != "no"; then
6591   
6592 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
6593 echo "configure:6594: checking for ldap_search in -lldap" >&5
6594 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
6595
6596 xe_check_libs=" -lldap "
6597 cat > conftest.$ac_ext <<EOF
6598 #line 6599 "configure"
6599 #include "confdefs.h"
6600 /* Override any gcc2 internal prototype to avoid an error.  */
6601 /* We use char because int might match the return type of a gcc2
6602     builtin and then its argument prototype would still apply.  */
6603 char ldap_search();
6604
6605 int main() {
6606 ldap_search()
6607 ; return 0; }
6608 EOF
6609 if { (eval echo configure:6610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6610   rm -rf conftest*
6611   eval "ac_cv_lib_$ac_lib_var=yes"
6612 else
6613   echo "configure: failed program was:" >&5
6614   cat conftest.$ac_ext >&5
6615   rm -rf conftest*
6616   eval "ac_cv_lib_$ac_lib_var=no"
6617 fi
6618 rm -f conftest*
6619 xe_check_libs=""
6620
6621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6622   echo "$ac_t""yes" 1>&6
6623   with_ldap_nolber=yes
6624 else
6625   echo "$ac_t""no" 1>&6
6626 with_ldap_nolber=no
6627 fi
6628
6629
6630   test "$with_ldap_nolber" = "no" && { 
6631 xe_msg_checking="for ldap_open in -lldap"
6632 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6633 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6634 echo "configure:6635: checking "$xe_msg_checking"" >&5
6635 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6636
6637 xe_check_libs=" -lldap -llber"
6638 cat > conftest.$ac_ext <<EOF
6639 #line 6640 "configure"
6640 #include "confdefs.h"
6641 /* Override any gcc2 internal prototype to avoid an error.  */
6642 /* We use char because int might match the return type of a gcc2
6643     builtin and then its argument prototype would still apply.  */
6644 char ldap_open();
6645
6646 int main() {
6647 ldap_open()
6648 ; return 0; }
6649 EOF
6650 if { (eval echo configure:6651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6651   rm -rf conftest*
6652   eval "ac_cv_lib_$ac_lib_var=yes"
6653 else
6654   echo "configure: failed program was:" >&5
6655   cat conftest.$ac_ext >&5
6656   rm -rf conftest*
6657   eval "ac_cv_lib_$ac_lib_var=no"
6658 fi
6659 rm -f conftest*
6660 xe_check_libs=""
6661
6662 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6663   echo "$ac_t""yes" 1>&6
6664   with_ldap_lber=yes
6665 else
6666   echo "$ac_t""no" 1>&6
6667 with_ldap_lber=no
6668 fi
6669
6670  }
6671   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { 
6672 xe_msg_checking="for ldap_open in -lldap"
6673 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
6674 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6675 echo "configure:6676: checking "$xe_msg_checking"" >&5
6676 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6677
6678 xe_check_libs=" -lldap -llber -lkrb"
6679 cat > conftest.$ac_ext <<EOF
6680 #line 6681 "configure"
6681 #include "confdefs.h"
6682 /* Override any gcc2 internal prototype to avoid an error.  */
6683 /* We use char because int might match the return type of a gcc2
6684     builtin and then its argument prototype would still apply.  */
6685 char ldap_open();
6686
6687 int main() {
6688 ldap_open()
6689 ; return 0; }
6690 EOF
6691 if { (eval echo configure:6692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6692   rm -rf conftest*
6693   eval "ac_cv_lib_$ac_lib_var=yes"
6694 else
6695   echo "configure: failed program was:" >&5
6696   cat conftest.$ac_ext >&5
6697   rm -rf conftest*
6698   eval "ac_cv_lib_$ac_lib_var=no"
6699 fi
6700 rm -f conftest*
6701 xe_check_libs=""
6702
6703 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6704   echo "$ac_t""yes" 1>&6
6705   with_ldap_krb=yes
6706 else
6707   echo "$ac_t""no" 1>&6
6708 with_ldap_krb=no
6709 fi
6710
6711  }
6712   test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { 
6713 xe_msg_checking="for ldap_open in -lldap"
6714 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
6715 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6716 echo "configure:6717: checking "$xe_msg_checking"" >&5
6717 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6718
6719 xe_check_libs=" -lldap -llber -lkrb -ldes"
6720 cat > conftest.$ac_ext <<EOF
6721 #line 6722 "configure"
6722 #include "confdefs.h"
6723 /* Override any gcc2 internal prototype to avoid an error.  */
6724 /* We use char because int might match the return type of a gcc2
6725     builtin and then its argument prototype would still apply.  */
6726 char ldap_open();
6727
6728 int main() {
6729 ldap_open()
6730 ; return 0; }
6731 EOF
6732 if { (eval echo configure:6733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6733   rm -rf conftest*
6734   eval "ac_cv_lib_$ac_lib_var=yes"
6735 else
6736   echo "configure: failed program was:" >&5
6737   cat conftest.$ac_ext >&5
6738   rm -rf conftest*
6739   eval "ac_cv_lib_$ac_lib_var=no"
6740 fi
6741 rm -f conftest*
6742 xe_check_libs=""
6743
6744 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6745   echo "$ac_t""yes" 1>&6
6746   with_ldap_krbdes=yes
6747 else
6748   echo "$ac_t""no" 1>&6
6749 with_ldap_krbdes=no
6750 fi
6751
6752  }
6753   test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes
6754 fi
6755 if test "$with_ldap" = "yes"; then
6756   { test "$extra_verbose" = "yes" && cat << \EOF
6757     Defining HAVE_LDAP
6758 EOF
6759 cat >> confdefs.h <<\EOF
6760 #define HAVE_LDAP 1
6761 EOF
6762 }
6763
6764   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6765    echo "    xemacs will be linked with \"eldap.o\""
6766  fi
6767   if test "$with_ldap_nolber" = "yes" ; then
6768     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6769   else
6770     if test "$with_ldap_krb" = "yes" ; then
6771       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
6772     fi
6773     if test "$with_ldap_krbdes" = "yes" ; then
6774       LIBS="-ldes $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldes\" to \$LIBS"; fi
6775       LIBS="-lkrb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkrb\" to \$LIBS"; fi
6776     fi
6777     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6778     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6779   fi
6780   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
6781 do
6782 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6783 echo "configure:6784: checking for $ac_func" >&5
6784
6785 cat > conftest.$ac_ext <<EOF
6786 #line 6787 "configure"
6787 #include "confdefs.h"
6788 /* System header to define __stub macros and hopefully few prototypes,
6789     which can conflict with char $ac_func(); below.  */
6790 #include <assert.h>
6791 /* Override any gcc2 internal prototype to avoid an error.  */
6792 /* We use char because int might match the return type of a gcc2
6793     builtin and then its argument prototype would still apply.  */
6794 char $ac_func();
6795
6796 int main() {
6797
6798 /* The GNU C library defines this for functions which it implements
6799     to always fail with ENOSYS.  Some functions are actually named
6800     something starting with __ and the normal name is an alias.  */
6801 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6802 choke me
6803 #else
6804 $ac_func();
6805 #endif
6806
6807 ; return 0; }
6808 EOF
6809 if { (eval echo configure:6810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6810   rm -rf conftest*
6811   eval "ac_cv_func_$ac_func=yes"
6812 else
6813   echo "configure: failed program was:" >&5
6814   cat conftest.$ac_ext >&5
6815   rm -rf conftest*
6816   eval "ac_cv_func_$ac_func=no"
6817 fi
6818 rm -f conftest*
6819
6820 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6821   echo "$ac_t""yes" 1>&6
6822     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6823   { test "$extra_verbose" = "yes" && cat << EOF
6824     Defining $ac_tr_func
6825 EOF
6826 cat >> confdefs.h <<EOF
6827 #define $ac_tr_func 1
6828 EOF
6829 }
6830  
6831 else
6832   echo "$ac_t""no" 1>&6
6833 fi
6834 done
6835
6836 fi
6837
6838
6839 if test "$window_system" != "none"; then
6840   echo "checking for graphics libraries" 1>&6
6841 echo "configure:6842: checking for graphics libraries" >&5
6842
6843     xpm_problem=""
6844   if test -z "$with_xpm"; then
6845     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6846 echo "configure:6847: checking for Xpm - no older than 3.4f" >&5
6847     xe_check_libs=-lXpm
6848     cat > conftest.$ac_ext <<EOF
6849 #line 6850 "configure"
6850 #include "confdefs.h"
6851 #include <X11/xpm.h>
6852     int main(int c, char **v) {
6853     return c == 1 ? 0 :
6854       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6855       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6856 EOF
6857 if { (eval echo configure:6858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6858 then
6859   ./conftest dummy_arg; xpm_status=$?;
6860       if test "$xpm_status" = "0"; then
6861         with_xpm=yes;
6862       else
6863         with_xpm=no;
6864         if test "$xpm_status" = "1"; then
6865           xpm_problem="Xpm library version and header file version don't match!"
6866         elif test "$xpm_status" = "2"; then
6867           xpm_problem="Xpm library version is too old!"
6868         else
6869           xpm_problem="Internal xpm detection logic error!"
6870         fi
6871         echo "
6872 *** WARNING *** $xpm_problem
6873   I'm not touching that with a 10-foot pole!
6874   If you really want to use the installed version of Xpm, rerun
6875   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6876     fi
6877 else
6878   conftest_rc="$?"
6879   echo "configure: failed program was:" >&5
6880   cat conftest.$ac_ext >&5
6881   rm -fr conftest*
6882   with_xpm=no
6883 fi
6884 rm -fr conftest*
6885     xe_check_libs=
6886     echo "$ac_t""$with_xpm" 1>&6
6887   fi
6888   if test "$with_xpm" = "yes"; then
6889     { test "$extra_verbose" = "yes" && cat << \EOF
6890     Defining HAVE_XPM
6891 EOF
6892 cat >> confdefs.h <<\EOF
6893 #define HAVE_XPM 1
6894 EOF
6895 }
6896
6897     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6898     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6899 echo "configure:6900: checking for \"FOR_MSW\" xpm" >&5
6900     xe_check_libs=-lXpm
6901     cat > conftest.$ac_ext <<EOF
6902 #line 6903 "configure"
6903 #include "confdefs.h"
6904
6905 int main() {
6906 XpmCreatePixmapFromData()
6907 ; return 0; }
6908 EOF
6909 if { (eval echo configure:6910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6910   rm -rf conftest*
6911   xpm_for_msw=no
6912 else
6913   echo "configure: failed program was:" >&5
6914   cat conftest.$ac_ext >&5
6915   rm -rf conftest*
6916   xpm_for_msw=yes
6917 fi
6918 rm -f conftest*
6919     xe_check_libs=
6920     echo "$ac_t""$xpm_for_msw" 1>&6
6921     if test "$xpm_for_msw" = "yes"; then
6922       { test "$extra_verbose" = "yes" && cat << \EOF
6923     Defining FOR_MSW
6924 EOF
6925 cat >> confdefs.h <<\EOF
6926 #define FOR_MSW 1
6927 EOF
6928 }
6929
6930     fi
6931   fi
6932
6933     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6934 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6935 echo "configure:6936: checking for compface.h" >&5
6936
6937 cat > conftest.$ac_ext <<EOF
6938 #line 6939 "configure"
6939 #include "confdefs.h"
6940 #include <compface.h>
6941 EOF
6942 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6943 { (eval echo configure:6944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6944 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6945 if test -z "$ac_err"; then
6946   rm -rf conftest*
6947   eval "ac_cv_header_$ac_safe=yes"
6948 else
6949   echo "$ac_err" >&5
6950   echo "configure: failed program was:" >&5
6951   cat conftest.$ac_ext >&5
6952   rm -rf conftest*
6953   eval "ac_cv_header_$ac_safe=no"
6954 fi
6955 rm -f conftest*
6956 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6957   echo "$ac_t""yes" 1>&6
6958   :
6959 else
6960   echo "$ac_t""no" 1>&6
6961 with_xface=no
6962 fi
6963  }
6964   test -z "$with_xface" && { 
6965 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6966 echo "configure:6967: checking for UnGenFace in -lcompface" >&5
6967 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6968
6969 xe_check_libs=" -lcompface "
6970 cat > conftest.$ac_ext <<EOF
6971 #line 6972 "configure"
6972 #include "confdefs.h"
6973 /* Override any gcc2 internal prototype to avoid an error.  */
6974 /* We use char because int might match the return type of a gcc2
6975     builtin and then its argument prototype would still apply.  */
6976 char UnGenFace();
6977
6978 int main() {
6979 UnGenFace()
6980 ; return 0; }
6981 EOF
6982 if { (eval echo configure:6983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6983   rm -rf conftest*
6984   eval "ac_cv_lib_$ac_lib_var=yes"
6985 else
6986   echo "configure: failed program was:" >&5
6987   cat conftest.$ac_ext >&5
6988   rm -rf conftest*
6989   eval "ac_cv_lib_$ac_lib_var=no"
6990 fi
6991 rm -f conftest*
6992 xe_check_libs=""
6993
6994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6995   echo "$ac_t""yes" 1>&6
6996   : 
6997 else
6998   echo "$ac_t""no" 1>&6
6999 with_xface=no
7000 fi
7001
7002  }
7003   test -z "$with_xface" && with_xface=yes
7004   if test "$with_xface" = "yes"; then
7005     { test "$extra_verbose" = "yes" && cat << \EOF
7006     Defining HAVE_XFACE
7007 EOF
7008 cat >> confdefs.h <<\EOF
7009 #define HAVE_XFACE 1
7010 EOF
7011 }
7012
7013     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
7014   fi
7015
7016         if test "$with_gif" != "no"; then
7017     with_gif="yes"
7018     { test "$extra_verbose" = "yes" && cat << \EOF
7019     Defining HAVE_GIF
7020 EOF
7021 cat >> confdefs.h <<\EOF
7022 #define HAVE_GIF 1
7023 EOF
7024 }
7025
7026     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
7027    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
7028  fi
7029   fi
7030
7031       if test "$with_png $with_tiff" != "no no"; then
7032     
7033 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
7034 echo "configure:7035: checking for inflate in -lc" >&5
7035 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
7036
7037 xe_check_libs=" -lc "
7038 cat > conftest.$ac_ext <<EOF
7039 #line 7040 "configure"
7040 #include "confdefs.h"
7041 /* Override any gcc2 internal prototype to avoid an error.  */
7042 /* We use char because int might match the return type of a gcc2
7043     builtin and then its argument prototype would still apply.  */
7044 char inflate();
7045
7046 int main() {
7047 inflate()
7048 ; return 0; }
7049 EOF
7050 if { (eval echo configure:7051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7051   rm -rf conftest*
7052   eval "ac_cv_lib_$ac_lib_var=yes"
7053 else
7054   echo "configure: failed program was:" >&5
7055   cat conftest.$ac_ext >&5
7056   rm -rf conftest*
7057   eval "ac_cv_lib_$ac_lib_var=no"
7058 fi
7059 rm -f conftest*
7060 xe_check_libs=""
7061
7062 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7063   echo "$ac_t""yes" 1>&6
7064   :
7065 else
7066   echo "$ac_t""no" 1>&6
7067
7068 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
7069 echo "configure:7070: checking for inflate in -lz" >&5
7070 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
7071
7072 xe_check_libs=" -lz "
7073 cat > conftest.$ac_ext <<EOF
7074 #line 7075 "configure"
7075 #include "confdefs.h"
7076 /* Override any gcc2 internal prototype to avoid an error.  */
7077 /* We use char because int might match the return type of a gcc2
7078     builtin and then its argument prototype would still apply.  */
7079 char inflate();
7080
7081 int main() {
7082 inflate()
7083 ; return 0; }
7084 EOF
7085 if { (eval echo configure:7086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7086   rm -rf conftest*
7087   eval "ac_cv_lib_$ac_lib_var=yes"
7088 else
7089   echo "configure: failed program was:" >&5
7090   cat conftest.$ac_ext >&5
7091   rm -rf conftest*
7092   eval "ac_cv_lib_$ac_lib_var=no"
7093 fi
7094 rm -f conftest*
7095 xe_check_libs=""
7096
7097 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7098   echo "$ac_t""yes" 1>&6
7099   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
7100 else
7101   echo "$ac_t""no" 1>&6
7102
7103 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
7104 echo "configure:7105: checking for inflate in -lgz" >&5
7105 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
7106
7107 xe_check_libs=" -lgz "
7108 cat > conftest.$ac_ext <<EOF
7109 #line 7110 "configure"
7110 #include "confdefs.h"
7111 /* Override any gcc2 internal prototype to avoid an error.  */
7112 /* We use char because int might match the return type of a gcc2
7113     builtin and then its argument prototype would still apply.  */
7114 char inflate();
7115
7116 int main() {
7117 inflate()
7118 ; return 0; }
7119 EOF
7120 if { (eval echo configure:7121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7121   rm -rf conftest*
7122   eval "ac_cv_lib_$ac_lib_var=yes"
7123 else
7124   echo "configure: failed program was:" >&5
7125   cat conftest.$ac_ext >&5
7126   rm -rf conftest*
7127   eval "ac_cv_lib_$ac_lib_var=no"
7128 fi
7129 rm -f conftest*
7130 xe_check_libs=""
7131
7132 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7133   echo "$ac_t""yes" 1>&6
7134   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
7135 else
7136   echo "$ac_t""no" 1>&6
7137 fi
7138
7139
7140 fi
7141
7142
7143 fi
7144
7145
7146   fi
7147
7148     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
7149 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
7150 echo "configure:7151: checking for jpeglib.h" >&5
7151
7152 cat > conftest.$ac_ext <<EOF
7153 #line 7154 "configure"
7154 #include "confdefs.h"
7155 #include <jpeglib.h>
7156 EOF
7157 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7158 { (eval echo configure:7159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7159 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7160 if test -z "$ac_err"; then
7161   rm -rf conftest*
7162   eval "ac_cv_header_$ac_safe=yes"
7163 else
7164   echo "$ac_err" >&5
7165   echo "configure: failed program was:" >&5
7166   cat conftest.$ac_ext >&5
7167   rm -rf conftest*
7168   eval "ac_cv_header_$ac_safe=no"
7169 fi
7170 rm -f conftest*
7171 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7172   echo "$ac_t""yes" 1>&6
7173   :
7174 else
7175   echo "$ac_t""no" 1>&6
7176 with_jpeg=no
7177 fi
7178  }
7179   test -z "$with_jpeg" && { 
7180 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
7181 echo "configure:7182: checking for jpeg_destroy_decompress in -ljpeg" >&5
7182 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
7183
7184 xe_check_libs=" -ljpeg "
7185 cat > conftest.$ac_ext <<EOF
7186 #line 7187 "configure"
7187 #include "confdefs.h"
7188 /* Override any gcc2 internal prototype to avoid an error.  */
7189 /* We use char because int might match the return type of a gcc2
7190     builtin and then its argument prototype would still apply.  */
7191 char jpeg_destroy_decompress();
7192
7193 int main() {
7194 jpeg_destroy_decompress()
7195 ; return 0; }
7196 EOF
7197 if { (eval echo configure:7198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7198   rm -rf conftest*
7199   eval "ac_cv_lib_$ac_lib_var=yes"
7200 else
7201   echo "configure: failed program was:" >&5
7202   cat conftest.$ac_ext >&5
7203   rm -rf conftest*
7204   eval "ac_cv_lib_$ac_lib_var=no"
7205 fi
7206 rm -f conftest*
7207 xe_check_libs=""
7208
7209 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7210   echo "$ac_t""yes" 1>&6
7211   :
7212 else
7213   echo "$ac_t""no" 1>&6
7214 with_jpeg=no
7215 fi
7216
7217  }
7218   test -z "$with_jpeg" && with_jpeg=yes
7219   if test "$with_jpeg" = "yes"; then
7220     { test "$extra_verbose" = "yes" && cat << \EOF
7221     Defining HAVE_JPEG
7222 EOF
7223 cat >> confdefs.h <<\EOF
7224 #define HAVE_JPEG 1
7225 EOF
7226 }
7227
7228     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
7229   fi
7230
7231     png_problem=""
7232   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
7233 echo "configure:7234: checking for pow" >&5
7234
7235 cat > conftest.$ac_ext <<EOF
7236 #line 7237 "configure"
7237 #include "confdefs.h"
7238 /* System header to define __stub macros and hopefully few prototypes,
7239     which can conflict with char pow(); below.  */
7240 #include <assert.h>
7241 /* Override any gcc2 internal prototype to avoid an error.  */
7242 /* We use char because int might match the return type of a gcc2
7243     builtin and then its argument prototype would still apply.  */
7244 char pow();
7245
7246 int main() {
7247
7248 /* The GNU C library defines this for functions which it implements
7249     to always fail with ENOSYS.  Some functions are actually named
7250     something starting with __ and the normal name is an alias.  */
7251 #if defined (__stub_pow) || defined (__stub___pow)
7252 choke me
7253 #else
7254 pow();
7255 #endif
7256
7257 ; return 0; }
7258 EOF
7259 if { (eval echo configure:7260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7260   rm -rf conftest*
7261   eval "ac_cv_func_pow=yes"
7262 else
7263   echo "configure: failed program was:" >&5
7264   cat conftest.$ac_ext >&5
7265   rm -rf conftest*
7266   eval "ac_cv_func_pow=no"
7267 fi
7268 rm -f conftest*
7269
7270 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
7271   echo "$ac_t""yes" 1>&6
7272   :
7273 else
7274   echo "$ac_t""no" 1>&6
7275 with_png=no
7276 fi
7277  }
7278   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7279 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7280 echo "configure:7281: checking for png.h" >&5
7281
7282 cat > conftest.$ac_ext <<EOF
7283 #line 7284 "configure"
7284 #include "confdefs.h"
7285 #include <png.h>
7286 EOF
7287 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7288 { (eval echo configure:7289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7289 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7290 if test -z "$ac_err"; then
7291   rm -rf conftest*
7292   eval "ac_cv_header_$ac_safe=yes"
7293 else
7294   echo "$ac_err" >&5
7295   echo "configure: failed program was:" >&5
7296   cat conftest.$ac_ext >&5
7297   rm -rf conftest*
7298   eval "ac_cv_header_$ac_safe=no"
7299 fi
7300 rm -f conftest*
7301 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7302   echo "$ac_t""yes" 1>&6
7303   :
7304 else
7305   echo "$ac_t""no" 1>&6
7306 with_png=no
7307 fi
7308  }
7309   test -z "$with_png" && { 
7310 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7311 echo "configure:7312: checking for png_read_image in -lpng" >&5
7312 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7313
7314 xe_check_libs=" -lpng "
7315 cat > conftest.$ac_ext <<EOF
7316 #line 7317 "configure"
7317 #include "confdefs.h"
7318 /* Override any gcc2 internal prototype to avoid an error.  */
7319 /* We use char because int might match the return type of a gcc2
7320     builtin and then its argument prototype would still apply.  */
7321 char png_read_image();
7322
7323 int main() {
7324 png_read_image()
7325 ; return 0; }
7326 EOF
7327 if { (eval echo configure:7328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7328   rm -rf conftest*
7329   eval "ac_cv_lib_$ac_lib_var=yes"
7330 else
7331   echo "configure: failed program was:" >&5
7332   cat conftest.$ac_ext >&5
7333   rm -rf conftest*
7334   eval "ac_cv_lib_$ac_lib_var=no"
7335 fi
7336 rm -f conftest*
7337 xe_check_libs=""
7338
7339 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7340   echo "$ac_t""yes" 1>&6
7341   :
7342 else
7343   echo "$ac_t""no" 1>&6
7344 with_png=no
7345 fi
7346
7347  }
7348   if test -z "$with_png"; then
7349     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7350 echo "configure:7351: checking for workable png version information" >&5
7351     xe_check_libs="-lpng -lz"
7352     cat > conftest.$ac_ext <<EOF
7353 #line 7354 "configure"
7354 #include "confdefs.h"
7355 #include <png.h>
7356     int main(int c, char **v) {
7357     if (c == 1) return 0;
7358     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7359     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7360 EOF
7361 if { (eval echo configure:7362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7362 then
7363   ./conftest dummy_arg; png_status=$?;
7364       if test "$png_status" = "0"; then
7365         with_png=yes;
7366       else
7367         with_png=no;
7368         if test "$png_status" = "1"; then
7369           png_problem="PNG library version and header file don't match!"
7370         elif test "$png_status" = "2"; then
7371           png_problem="PNG library version too old (pre 1.0.2)!"
7372         fi
7373         echo "
7374 *** WARNING *** $png_problem
7375   I'm not touching that with a 10-foot pole!
7376   If you really want to use the installed version of libPNG, rerun
7377   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7378     fi
7379 else
7380   conftest_rc="$?"
7381   echo "configure: failed program was:" >&5
7382   cat conftest.$ac_ext >&5
7383   rm -fr conftest*
7384   with_png=no
7385 fi
7386 rm -fr conftest*
7387     xe_check_libs=
7388     echo "$ac_t""$with_png" 1>&6
7389   fi
7390   if test "$with_png" = "yes"; then
7391     { test "$extra_verbose" = "yes" && cat << \EOF
7392     Defining HAVE_PNG
7393 EOF
7394 cat >> confdefs.h <<\EOF
7395 #define HAVE_PNG 1
7396 EOF
7397 }
7398
7399     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7400   fi
7401
7402     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7403 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7404 echo "configure:7405: checking for tiffio.h" >&5
7405
7406 cat > conftest.$ac_ext <<EOF
7407 #line 7408 "configure"
7408 #include "confdefs.h"
7409 #include <tiffio.h>
7410 EOF
7411 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7412 { (eval echo configure:7413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7413 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7414 if test -z "$ac_err"; then
7415   rm -rf conftest*
7416   eval "ac_cv_header_$ac_safe=yes"
7417 else
7418   echo "$ac_err" >&5
7419   echo "configure: failed program was:" >&5
7420   cat conftest.$ac_ext >&5
7421   rm -rf conftest*
7422   eval "ac_cv_header_$ac_safe=no"
7423 fi
7424 rm -f conftest*
7425 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7426   echo "$ac_t""yes" 1>&6
7427   :
7428 else
7429   echo "$ac_t""no" 1>&6
7430 with_tiff=no
7431 fi
7432  }
7433   test -z "$with_tiff" && { 
7434 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7435 echo "configure:7436: checking for TIFFClientOpen in -ltiff" >&5
7436 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7437
7438 xe_check_libs=" -ltiff "
7439 cat > conftest.$ac_ext <<EOF
7440 #line 7441 "configure"
7441 #include "confdefs.h"
7442 /* Override any gcc2 internal prototype to avoid an error.  */
7443 /* We use char because int might match the return type of a gcc2
7444     builtin and then its argument prototype would still apply.  */
7445 char TIFFClientOpen();
7446
7447 int main() {
7448 TIFFClientOpen()
7449 ; return 0; }
7450 EOF
7451 if { (eval echo configure:7452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7452   rm -rf conftest*
7453   eval "ac_cv_lib_$ac_lib_var=yes"
7454 else
7455   echo "configure: failed program was:" >&5
7456   cat conftest.$ac_ext >&5
7457   rm -rf conftest*
7458   eval "ac_cv_lib_$ac_lib_var=no"
7459 fi
7460 rm -f conftest*
7461 xe_check_libs=""
7462
7463 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7464   echo "$ac_t""yes" 1>&6
7465   :
7466 else
7467   echo "$ac_t""no" 1>&6
7468 with_tiff=no
7469 fi
7470
7471  }
7472   test -z "$with_tiff" && with_tiff=yes
7473   if test "$with_tiff" = "yes"; then
7474     { test "$extra_verbose" = "yes" && cat << \EOF
7475     Defining HAVE_TIFF
7476 EOF
7477 cat >> confdefs.h <<\EOF
7478 #define HAVE_TIFF 1
7479 EOF
7480 }
7481
7482     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7483   fi
7484 fi
7485
7486
7487 if test "$with_x11" = "yes"; then
7488
7489   echo "checking for X11 graphics libraries" 1>&6
7490 echo "configure:7491: checking for X11 graphics libraries" >&5
7491
7492     
7493 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7494 echo "configure:7495: checking for XawScrollbarSetThumb in -lXaw" >&5
7495 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7496
7497 xe_check_libs=" -lXaw "
7498 cat > conftest.$ac_ext <<EOF
7499 #line 7500 "configure"
7500 #include "confdefs.h"
7501 /* Override any gcc2 internal prototype to avoid an error.  */
7502 /* We use char because int might match the return type of a gcc2
7503     builtin and then its argument prototype would still apply.  */
7504 char XawScrollbarSetThumb();
7505
7506 int main() {
7507 XawScrollbarSetThumb()
7508 ; return 0; }
7509 EOF
7510 if { (eval echo configure:7511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7511   rm -rf conftest*
7512   eval "ac_cv_lib_$ac_lib_var=yes"
7513 else
7514   echo "configure: failed program was:" >&5
7515   cat conftest.$ac_ext >&5
7516   rm -rf conftest*
7517   eval "ac_cv_lib_$ac_lib_var=no"
7518 fi
7519 rm -f conftest*
7520 xe_check_libs=""
7521
7522 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7523   echo "$ac_t""yes" 1>&6
7524   have_xaw=yes
7525 else
7526   echo "$ac_t""no" 1>&6
7527 have_xaw=no
7528 fi
7529
7530
7531                     
7532     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7533 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7534 echo "configure:7535: checking for Xm/Xm.h" >&5
7535
7536 cat > conftest.$ac_ext <<EOF
7537 #line 7538 "configure"
7538 #include "confdefs.h"
7539 #include <Xm/Xm.h>
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 | grep -v "^conftest.${ac_ext}\$"`
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   
7558 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7559 echo "configure:7560: checking for XmStringFree in -lXm" >&5
7560 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7561
7562 xe_check_libs=" -lXm "
7563 cat > conftest.$ac_ext <<EOF
7564 #line 7565 "configure"
7565 #include "confdefs.h"
7566 /* Override any gcc2 internal prototype to avoid an error.  */
7567 /* We use char because int might match the return type of a gcc2
7568     builtin and then its argument prototype would still apply.  */
7569 char XmStringFree();
7570
7571 int main() {
7572 XmStringFree()
7573 ; return 0; }
7574 EOF
7575 if { (eval echo configure:7576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7576   rm -rf conftest*
7577   eval "ac_cv_lib_$ac_lib_var=yes"
7578 else
7579   echo "configure: failed program was:" >&5
7580   cat conftest.$ac_ext >&5
7581   rm -rf conftest*
7582   eval "ac_cv_lib_$ac_lib_var=no"
7583 fi
7584 rm -f conftest*
7585 xe_check_libs=""
7586
7587 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7588   echo "$ac_t""yes" 1>&6
7589   have_motif=yes
7590 else
7591   echo "$ac_t""no" 1>&6
7592 have_motif=no
7593 fi
7594
7595
7596 else
7597   echo "$ac_t""no" 1>&6
7598 have_motif=no
7599 fi
7600
7601
7602   if test "$have_motif" = "yes"; then
7603         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7604 echo "configure:7605: checking for Lesstif" >&5
7605     cat > conftest.$ac_ext <<EOF
7606 #line 7607 "configure"
7607 #include "confdefs.h"
7608 #include <Xm/Xm.h>
7609 #ifdef LESSTIF_VERSION
7610 yes
7611 #endif
7612
7613 EOF
7614 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7615   egrep "yes" >/dev/null 2>&1; then
7616   rm -rf conftest*
7617   have_lesstif=yes
7618 else
7619   rm -rf conftest*
7620   have_lesstif=no
7621 fi
7622 rm -f conftest*
7623
7624   echo "$ac_t""$have_lesstif" 1>&6
7625   fi
7626
7627 fi 
7628
7629 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7630   with_menubars="lucid" ;;
7631 esac
7632 case "$with_dialogs" in "" | "yes" | "lucid" )
7633   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7634   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7635   else with_dialogs=no
7636   fi ;;
7637 esac
7638 case "$with_scrollbars" in "" | "yes" )
7639   with_scrollbars="lucid" ;;
7640 esac
7641 case "$with_widgets" in "" | "yes" )
7642   if   test "$have_motif" = "yes"; then with_widgets="motif"
7643   else with_widgets=no
7644   fi ;;
7645 esac
7646
7647 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
7648
7649 case "$all_widgets" in *athena* )
7650   { test "$extra_verbose" = "yes" && cat << \EOF
7651     Defining LWLIB_USES_ATHENA
7652 EOF
7653 cat >> confdefs.h <<\EOF
7654 #define LWLIB_USES_ATHENA 1
7655 EOF
7656 }
7657
7658   { test "$extra_verbose" = "yes" && cat << \EOF
7659     Defining NEED_ATHENA
7660 EOF
7661 cat >> confdefs.h <<\EOF
7662 #define NEED_ATHENA 1
7663 EOF
7664 }
7665
7666   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7667   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7668 esac
7669
7670 case "$all_widgets" in *motif* )
7671   { test "$extra_verbose" = "yes" && cat << \EOF
7672     Defining LWLIB_USES_MOTIF
7673 EOF
7674 cat >> confdefs.h <<\EOF
7675 #define LWLIB_USES_MOTIF 1
7676 EOF
7677 }
7678
7679   { test "$extra_verbose" = "yes" && cat << \EOF
7680     Defining NEED_MOTIF
7681 EOF
7682 cat >> confdefs.h <<\EOF
7683 #define NEED_MOTIF 1
7684 EOF
7685 }
7686
7687   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7688   need_motif=yes ;;
7689 esac
7690
7691 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7692 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7693 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7694 case "$all_widgets" in *lucid* )
7695   { test "$extra_verbose" = "yes" && cat << \EOF
7696     Defining NEED_LUCID
7697 EOF
7698 cat >> confdefs.h <<\EOF
7699 #define NEED_LUCID 1
7700 EOF
7701 }
7702
7703   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7704 esac
7705
7706
7707
7708 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7709     Defining LWLIB_SCROLLBARS_ATHENA
7710 EOF
7711 cat >> confdefs.h <<\EOF
7712 #define LWLIB_SCROLLBARS_ATHENA 1
7713 EOF
7714 }
7715 ;; esac
7716 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7717     Defining LWLIB_DIALOGS_ATHENA
7718 EOF
7719 cat >> confdefs.h <<\EOF
7720 #define LWLIB_DIALOGS_ATHENA 1
7721 EOF
7722 }
7723    ;; esac
7724 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7725     Defining LWLIB_SCROLLBARS_ATHENA3D
7726 EOF
7727 cat >> confdefs.h <<\EOF
7728 #define LWLIB_SCROLLBARS_ATHENA3D 1
7729 EOF
7730 }
7731
7732 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7733     Defining LWLIB_DIALOGS_ATHENA3D
7734 EOF
7735 cat >> confdefs.h <<\EOF
7736 #define LWLIB_DIALOGS_ATHENA3D 1
7737 EOF
7738 }
7739
7740
7741 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7742     Defining HAVE_MENUBARS
7743 EOF
7744 cat >> confdefs.h <<\EOF
7745 #define HAVE_MENUBARS 1
7746 EOF
7747 }
7748
7749 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7750     Defining HAVE_SCROLLBARS
7751 EOF
7752 cat >> confdefs.h <<\EOF
7753 #define HAVE_SCROLLBARS 1
7754 EOF
7755 }
7756
7757 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7758     Defining HAVE_DIALOGS
7759 EOF
7760 cat >> confdefs.h <<\EOF
7761 #define HAVE_DIALOGS 1
7762 EOF
7763 }
7764
7765 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7766     Defining HAVE_TOOLBARS
7767 EOF
7768 cat >> confdefs.h <<\EOF
7769 #define HAVE_TOOLBARS 1
7770 EOF
7771 }
7772
7773
7774 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7775     Defining LWLIB_MENUBARS_LUCID
7776 EOF
7777 cat >> confdefs.h <<\EOF
7778 #define LWLIB_MENUBARS_LUCID 1
7779 EOF
7780 }
7781
7782 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7783     Defining LWLIB_SCROLLBARS_LUCID
7784 EOF
7785 cat >> confdefs.h <<\EOF
7786 #define LWLIB_SCROLLBARS_LUCID 1
7787 EOF
7788 }
7789
7790
7791 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7792     Defining LWLIB_MENUBARS_MOTIF
7793 EOF
7794 cat >> confdefs.h <<\EOF
7795 #define LWLIB_MENUBARS_MOTIF 1
7796 EOF
7797 }
7798
7799 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7800     Defining LWLIB_SCROLLBARS_MOTIF
7801 EOF
7802 cat >> confdefs.h <<\EOF
7803 #define LWLIB_SCROLLBARS_MOTIF 1
7804 EOF
7805 }
7806
7807 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7808     Defining LWLIB_DIALOGS_MOTIF
7809 EOF
7810 cat >> confdefs.h <<\EOF
7811 #define LWLIB_DIALOGS_MOTIF 1
7812 EOF
7813 }
7814
7815
7816 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7817    echo "    xemacs will be linked with \"menubar.o\""
7818  fi
7819 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7820    echo "    xemacs will be linked with \"scrollbar.o\""
7821  fi
7822 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7823    echo "    xemacs will be linked with \"dialog.o\""
7824  fi
7825 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7826    echo "    xemacs will be linked with \"toolbar.o\""
7827  fi
7828
7829 if test "$with_x11" = "yes"; then
7830   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7831    echo "    xemacs will be linked with \"menubar-x.o\""
7832  fi
7833   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7834    echo "    xemacs will be linked with \"scrollbar-x.o\""
7835  fi
7836   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7837    echo "    xemacs will be linked with \"dialog-x.o\""
7838  fi
7839   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7840    echo "    xemacs will be linked with \"toolbar-x.o\""
7841  fi
7842   test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7843    echo "    xemacs will be linked with \"gui-x.o\""
7844  fi
7845 else
7846   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7847     echo "Attempt to Build NAS sound without X"
7848     echo "Please remove NAS configuration or build with X"
7849     exit 1
7850   fi
7851 fi
7852
7853
7854 test -z "$with_mule" && with_mule=no
7855 test -z "$with_file_coding" && with_file_coding=no
7856
7857
7858 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7859   { test "$extra_verbose" = "yes" && cat << \EOF
7860     Defining FILE_CODING
7861 EOF
7862 cat >> confdefs.h <<\EOF
7863 #define FILE_CODING 1
7864 EOF
7865 }
7866
7867   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7868    echo "    xemacs will be linked with \"file-coding.o\""
7869  fi
7870 fi
7871
7872 if test "$with_mule" = "yes" ; then
7873   echo "checking for Mule-related features" 1>&6
7874 echo "configure:7875: checking for Mule-related features" >&5
7875   { test "$extra_verbose" = "yes" && cat << \EOF
7876     Defining MULE
7877 EOF
7878 cat >> confdefs.h <<\EOF
7879 #define MULE 1
7880 EOF
7881 }
7882
7883   { test "$extra_verbose" = "yes" && cat << \EOF
7884     Defining FILE_CODING
7885 EOF
7886 cat >> confdefs.h <<\EOF
7887 #define FILE_CODING 1
7888 EOF
7889 }
7890
7891   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7892    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7893  fi
7894
7895     for ac_hdr in libintl.h
7896 do
7897 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7898 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7899 echo "configure:7900: checking for $ac_hdr" >&5
7900
7901 cat > conftest.$ac_ext <<EOF
7902 #line 7903 "configure"
7903 #include "confdefs.h"
7904 #include <$ac_hdr>
7905 EOF
7906 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7907 { (eval echo configure:7908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7908 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7909 if test -z "$ac_err"; then
7910   rm -rf conftest*
7911   eval "ac_cv_header_$ac_safe=yes"
7912 else
7913   echo "$ac_err" >&5
7914   echo "configure: failed program was:" >&5
7915   cat conftest.$ac_ext >&5
7916   rm -rf conftest*
7917   eval "ac_cv_header_$ac_safe=no"
7918 fi
7919 rm -f conftest*
7920 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7921   echo "$ac_t""yes" 1>&6
7922     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7923   { test "$extra_verbose" = "yes" && cat << EOF
7924     Defining $ac_tr_hdr
7925 EOF
7926 cat >> confdefs.h <<EOF
7927 #define $ac_tr_hdr 1
7928 EOF
7929 }
7930  
7931 else
7932   echo "$ac_t""no" 1>&6
7933 fi
7934 done
7935
7936   
7937 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7938 echo "configure:7939: checking for strerror in -lintl" >&5
7939 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7940
7941 xe_check_libs=" -lintl "
7942 cat > conftest.$ac_ext <<EOF
7943 #line 7944 "configure"
7944 #include "confdefs.h"
7945 /* Override any gcc2 internal prototype to avoid an error.  */
7946 /* We use char because int might match the return type of a gcc2
7947     builtin and then its argument prototype would still apply.  */
7948 char strerror();
7949
7950 int main() {
7951 strerror()
7952 ; return 0; }
7953 EOF
7954 if { (eval echo configure:7955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7955   rm -rf conftest*
7956   eval "ac_cv_lib_$ac_lib_var=yes"
7957 else
7958   echo "configure: failed program was:" >&5
7959   cat conftest.$ac_ext >&5
7960   rm -rf conftest*
7961   eval "ac_cv_lib_$ac_lib_var=no"
7962 fi
7963 rm -f conftest*
7964 xe_check_libs=""
7965
7966 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7967   echo "$ac_t""yes" 1>&6
7968     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7969     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7970   { test "$extra_verbose" = "yes" && cat << EOF
7971     Defining $ac_tr_lib
7972 EOF
7973 cat >> confdefs.h <<EOF
7974 #define $ac_tr_lib 1
7975 EOF
7976 }
7977
7978   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7979
7980 else
7981   echo "$ac_t""no" 1>&6
7982 fi
7983
7984
7985
7986   if test "$with_utf_2000" = "yes" ; then
7987     { test "$extra_verbose" = "yes" && cat << \EOF
7988     Defining CHAR_IS_UCS4
7989 EOF
7990 cat >> confdefs.h <<\EOF
7991 #define CHAR_IS_UCS4 1
7992 EOF
7993 }
7994
7995     { test "$extra_verbose" = "yes" && cat << \EOF
7996     Defining UTF2000
7997 EOF
7998 cat >> confdefs.h <<\EOF
7999 #define UTF2000 1
8000 EOF
8001 }
8002
8003   elif test "$with_ucs4" = "yes" ; then
8004     { test "$extra_verbose" = "yes" && cat << \EOF
8005     Defining CHAR_IS_UCS4
8006 EOF
8007 cat >> confdefs.h <<\EOF
8008 #define CHAR_IS_UCS4 1
8009 EOF
8010 }
8011
8012   fi
8013
8014   echo "checking for Mule input methods" 1>&6
8015 echo "configure:8016: checking for Mule input methods" >&5
8016         case "$with_xim" in "" | "yes" )
8017     echo "checking for XIM" 1>&6
8018 echo "configure:8019: checking for XIM" >&5
8019     
8020 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
8021 echo "configure:8022: checking for XOpenIM in -lX11" >&5
8022 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
8023
8024 xe_check_libs=" -lX11 "
8025 cat > conftest.$ac_ext <<EOF
8026 #line 8027 "configure"
8027 #include "confdefs.h"
8028 /* Override any gcc2 internal prototype to avoid an error.  */
8029 /* We use char because int might match the return type of a gcc2
8030     builtin and then its argument prototype would still apply.  */
8031 char XOpenIM();
8032
8033 int main() {
8034 XOpenIM()
8035 ; return 0; }
8036 EOF
8037 if { (eval echo configure:8038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8038   rm -rf conftest*
8039   eval "ac_cv_lib_$ac_lib_var=yes"
8040 else
8041   echo "configure: failed program was:" >&5
8042   cat conftest.$ac_ext >&5
8043   rm -rf conftest*
8044   eval "ac_cv_lib_$ac_lib_var=no"
8045 fi
8046 rm -f conftest*
8047 xe_check_libs=""
8048
8049 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8050   echo "$ac_t""yes" 1>&6
8051   with_xim=xlib
8052 else
8053   echo "$ac_t""no" 1>&6
8054 with_xim=no
8055 fi
8056
8057
8058         if test "$have_motif $have_lesstif" = "yes no"; then
8059       
8060 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
8061 echo "configure:8062: checking for XmImMbLookupString in -lXm" >&5
8062 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
8063
8064 xe_check_libs=" -lXm "
8065 cat > conftest.$ac_ext <<EOF
8066 #line 8067 "configure"
8067 #include "confdefs.h"
8068 /* Override any gcc2 internal prototype to avoid an error.  */
8069 /* We use char because int might match the return type of a gcc2
8070     builtin and then its argument prototype would still apply.  */
8071 char XmImMbLookupString();
8072
8073 int main() {
8074 XmImMbLookupString()
8075 ; return 0; }
8076 EOF
8077 if { (eval echo configure:8078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8078   rm -rf conftest*
8079   eval "ac_cv_lib_$ac_lib_var=yes"
8080 else
8081   echo "configure: failed program was:" >&5
8082   cat conftest.$ac_ext >&5
8083   rm -rf conftest*
8084   eval "ac_cv_lib_$ac_lib_var=no"
8085 fi
8086 rm -f conftest*
8087 xe_check_libs=""
8088
8089 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8090   echo "$ac_t""yes" 1>&6
8091   with_xim=motif
8092 else
8093   echo "$ac_t""no" 1>&6
8094 fi
8095
8096
8097     fi ;;
8098   esac
8099   if test "$with_xim" != "no"; then
8100     { test "$extra_verbose" = "yes" && cat << \EOF
8101     Defining HAVE_XIM
8102 EOF
8103 cat >> confdefs.h <<\EOF
8104 #define HAVE_XIM 1
8105 EOF
8106 }
8107
8108     if test "$with_xim" = "xlib"; then
8109       { test "$extra_verbose" = "yes" && cat << \EOF
8110     Defining XIM_XLIB
8111 EOF
8112 cat >> confdefs.h <<\EOF
8113 #define XIM_XLIB 1
8114 EOF
8115 }
8116
8117       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
8118    echo "    xemacs will be linked with \"input-method-xlib.o\""
8119  fi
8120     fi
8121     if test "$with_xim" = "motif"; then
8122       { test "$extra_verbose" = "yes" && cat << \EOF
8123     Defining XIM_MOTIF
8124 EOF
8125 cat >> confdefs.h <<\EOF
8126 #define XIM_MOTIF 1
8127 EOF
8128 }
8129
8130       need_motif=yes
8131       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
8132    echo "    xemacs will be linked with \"input-method-motif.o\""
8133  fi
8134     fi
8135     if test "$with_xim" = "motif"; then
8136       with_xfs=no
8137     fi
8138   fi
8139
8140     if test "$with_xfs" = "yes" ; then
8141     echo "checking for XFontSet" 1>&6
8142 echo "configure:8143: checking for XFontSet" >&5
8143     
8144 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
8145 echo "configure:8146: checking for XmbDrawString in -lX11" >&5
8146 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
8147
8148 xe_check_libs=" -lX11 "
8149 cat > conftest.$ac_ext <<EOF
8150 #line 8151 "configure"
8151 #include "confdefs.h"
8152 /* Override any gcc2 internal prototype to avoid an error.  */
8153 /* We use char because int might match the return type of a gcc2
8154     builtin and then its argument prototype would still apply.  */
8155 char XmbDrawString();
8156
8157 int main() {
8158 XmbDrawString()
8159 ; return 0; }
8160 EOF
8161 if { (eval echo configure:8162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8162   rm -rf conftest*
8163   eval "ac_cv_lib_$ac_lib_var=yes"
8164 else
8165   echo "configure: failed program was:" >&5
8166   cat conftest.$ac_ext >&5
8167   rm -rf conftest*
8168   eval "ac_cv_lib_$ac_lib_var=no"
8169 fi
8170 rm -f conftest*
8171 xe_check_libs=""
8172
8173 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8174   echo "$ac_t""yes" 1>&6
8175   :
8176 else
8177   echo "$ac_t""no" 1>&6
8178 with_xfs=no
8179 fi
8180
8181
8182     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
8183       { test "$extra_verbose" = "yes" && cat << \EOF
8184     Defining USE_XFONTSET
8185 EOF
8186 cat >> confdefs.h <<\EOF
8187 #define USE_XFONTSET 1
8188 EOF
8189 }
8190
8191       if test "$with_xim" = "no" ; then
8192         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
8193    echo "    xemacs will be linked with \"input-method-xfs.o\""
8194  fi
8195       fi
8196     fi
8197   fi 
8198     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
8199   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
8200 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
8201 echo "configure:8202: checking for wnn/jllib.h" >&5
8202
8203 cat > conftest.$ac_ext <<EOF
8204 #line 8205 "configure"
8205 #include "confdefs.h"
8206 #include <wnn/jllib.h>
8207 EOF
8208 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8209 { (eval echo configure:8210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8210 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8211 if test -z "$ac_err"; then
8212   rm -rf conftest*
8213   eval "ac_cv_header_$ac_safe=yes"
8214 else
8215   echo "$ac_err" >&5
8216   echo "configure: failed program was:" >&5
8217   cat conftest.$ac_ext >&5
8218   rm -rf conftest*
8219   eval "ac_cv_header_$ac_safe=no"
8220 fi
8221 rm -f conftest*
8222 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8223   echo "$ac_t""yes" 1>&6
8224   :
8225 else
8226   echo "$ac_t""no" 1>&6
8227 with_wnn=no
8228 fi
8229  }
8230     if test "$with_wnn" != "no"; then
8231     for ac_func in crypt
8232 do
8233 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8234 echo "configure:8235: checking for $ac_func" >&5
8235
8236 cat > conftest.$ac_ext <<EOF
8237 #line 8238 "configure"
8238 #include "confdefs.h"
8239 /* System header to define __stub macros and hopefully few prototypes,
8240     which can conflict with char $ac_func(); below.  */
8241 #include <assert.h>
8242 /* Override any gcc2 internal prototype to avoid an error.  */
8243 /* We use char because int might match the return type of a gcc2
8244     builtin and then its argument prototype would still apply.  */
8245 char $ac_func();
8246
8247 int main() {
8248
8249 /* The GNU C library defines this for functions which it implements
8250     to always fail with ENOSYS.  Some functions are actually named
8251     something starting with __ and the normal name is an alias.  */
8252 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8253 choke me
8254 #else
8255 $ac_func();
8256 #endif
8257
8258 ; return 0; }
8259 EOF
8260 if { (eval echo configure:8261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8261   rm -rf conftest*
8262   eval "ac_cv_func_$ac_func=yes"
8263 else
8264   echo "configure: failed program was:" >&5
8265   cat conftest.$ac_ext >&5
8266   rm -rf conftest*
8267   eval "ac_cv_func_$ac_func=no"
8268 fi
8269 rm -f conftest*
8270
8271 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8272   echo "$ac_t""yes" 1>&6
8273     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8274   { test "$extra_verbose" = "yes" && cat << EOF
8275     Defining $ac_tr_func
8276 EOF
8277 cat >> confdefs.h <<EOF
8278 #define $ac_tr_func 1
8279 EOF
8280 }
8281  
8282 else
8283   echo "$ac_t""no" 1>&6
8284 fi
8285 done
8286
8287     test "$ac_cv_func_crypt" != "yes" && { 
8288 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
8289 echo "configure:8290: checking for crypt in -lcrypt" >&5
8290 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
8291
8292 xe_check_libs=" -lcrypt "
8293 cat > conftest.$ac_ext <<EOF
8294 #line 8295 "configure"
8295 #include "confdefs.h"
8296 /* Override any gcc2 internal prototype to avoid an error.  */
8297 /* We use char because int might match the return type of a gcc2
8298     builtin and then its argument prototype would still apply.  */
8299 char crypt();
8300
8301 int main() {
8302 crypt()
8303 ; return 0; }
8304 EOF
8305 if { (eval echo configure:8306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8306   rm -rf conftest*
8307   eval "ac_cv_lib_$ac_lib_var=yes"
8308 else
8309   echo "configure: failed program was:" >&5
8310   cat conftest.$ac_ext >&5
8311   rm -rf conftest*
8312   eval "ac_cv_lib_$ac_lib_var=no"
8313 fi
8314 rm -f conftest*
8315 xe_check_libs=""
8316
8317 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8318   echo "$ac_t""yes" 1>&6
8319     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8320     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8321   { test "$extra_verbose" = "yes" && cat << EOF
8322     Defining $ac_tr_lib
8323 EOF
8324 cat >> confdefs.h <<EOF
8325 #define $ac_tr_lib 1
8326 EOF
8327 }
8328
8329   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
8330
8331 else
8332   echo "$ac_t""no" 1>&6
8333 fi
8334
8335  }
8336   fi
8337     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8338     
8339 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8340 echo "configure:8341: checking for jl_dic_list_e in -lwnn" >&5
8341 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8342
8343 xe_check_libs=" -lwnn "
8344 cat > conftest.$ac_ext <<EOF
8345 #line 8346 "configure"
8346 #include "confdefs.h"
8347 /* Override any gcc2 internal prototype to avoid an error.  */
8348 /* We use char because int might match the return type of a gcc2
8349     builtin and then its argument prototype would still apply.  */
8350 char jl_dic_list_e();
8351
8352 int main() {
8353 jl_dic_list_e()
8354 ; return 0; }
8355 EOF
8356 if { (eval echo configure:8357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8357   rm -rf conftest*
8358   eval "ac_cv_lib_$ac_lib_var=yes"
8359 else
8360   echo "configure: failed program was:" >&5
8361   cat conftest.$ac_ext >&5
8362   rm -rf conftest*
8363   eval "ac_cv_lib_$ac_lib_var=no"
8364 fi
8365 rm -f conftest*
8366 xe_check_libs=""
8367
8368 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8369   echo "$ac_t""yes" 1>&6
8370   libwnn=wnn
8371 else
8372   echo "$ac_t""no" 1>&6
8373 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8374 echo "configure:8375: checking for jl_dic_list_e in -lwnn4" >&5
8375 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8376
8377 xe_check_libs=" -lwnn4 "
8378 cat > conftest.$ac_ext <<EOF
8379 #line 8380 "configure"
8380 #include "confdefs.h"
8381 /* Override any gcc2 internal prototype to avoid an error.  */
8382 /* We use char because int might match the return type of a gcc2
8383     builtin and then its argument prototype would still apply.  */
8384 char jl_dic_list_e();
8385
8386 int main() {
8387 jl_dic_list_e()
8388 ; return 0; }
8389 EOF
8390 if { (eval echo configure:8391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8391   rm -rf conftest*
8392   eval "ac_cv_lib_$ac_lib_var=yes"
8393 else
8394   echo "configure: failed program was:" >&5
8395   cat conftest.$ac_ext >&5
8396   rm -rf conftest*
8397   eval "ac_cv_lib_$ac_lib_var=no"
8398 fi
8399 rm -f conftest*
8400 xe_check_libs=""
8401
8402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8403   echo "$ac_t""yes" 1>&6
8404   libwnn=wnn4
8405 else
8406   echo "$ac_t""no" 1>&6
8407 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8408 echo "configure:8409: checking for jl_dic_list_e in -lwnn6" >&5
8409 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8410
8411 xe_check_libs=" -lwnn6 "
8412 cat > conftest.$ac_ext <<EOF
8413 #line 8414 "configure"
8414 #include "confdefs.h"
8415 /* Override any gcc2 internal prototype to avoid an error.  */
8416 /* We use char because int might match the return type of a gcc2
8417     builtin and then its argument prototype would still apply.  */
8418 char jl_dic_list_e();
8419
8420 int main() {
8421 jl_dic_list_e()
8422 ; return 0; }
8423 EOF
8424 if { (eval echo configure:8425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8425   rm -rf conftest*
8426   eval "ac_cv_lib_$ac_lib_var=yes"
8427 else
8428   echo "configure: failed program was:" >&5
8429   cat conftest.$ac_ext >&5
8430   rm -rf conftest*
8431   eval "ac_cv_lib_$ac_lib_var=no"
8432 fi
8433 rm -f conftest*
8434 xe_check_libs=""
8435
8436 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8437   echo "$ac_t""yes" 1>&6
8438   libwnn=wnn6
8439 else
8440   echo "$ac_t""no" 1>&6
8441 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8442 echo "configure:8443: checking for dic_list_e in -lwnn6_fromsrc" >&5
8443 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8444
8445 xe_check_libs=" -lwnn6_fromsrc "
8446 cat > conftest.$ac_ext <<EOF
8447 #line 8448 "configure"
8448 #include "confdefs.h"
8449 /* Override any gcc2 internal prototype to avoid an error.  */
8450 /* We use char because int might match the return type of a gcc2
8451     builtin and then its argument prototype would still apply.  */
8452 char dic_list_e();
8453
8454 int main() {
8455 dic_list_e()
8456 ; return 0; }
8457 EOF
8458 if { (eval echo configure:8459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8459   rm -rf conftest*
8460   eval "ac_cv_lib_$ac_lib_var=yes"
8461 else
8462   echo "configure: failed program was:" >&5
8463   cat conftest.$ac_ext >&5
8464   rm -rf conftest*
8465   eval "ac_cv_lib_$ac_lib_var=no"
8466 fi
8467 rm -f conftest*
8468 xe_check_libs=""
8469
8470 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8471   echo "$ac_t""yes" 1>&6
8472   libwnn=wnn6_fromsrc
8473 else
8474   echo "$ac_t""no" 1>&6
8475 with_wnn=no
8476 fi
8477
8478
8479 fi
8480
8481
8482 fi
8483
8484
8485 fi
8486
8487
8488   fi
8489   test -z "$with_wnn" && with_wnn=yes
8490   if test "$with_wnn" = "yes"; then
8491     { test "$extra_verbose" = "yes" && cat << \EOF
8492     Defining HAVE_WNN
8493 EOF
8494 cat >> confdefs.h <<\EOF
8495 #define HAVE_WNN 1
8496 EOF
8497 }
8498
8499     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8500     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8501    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8502  fi
8503     if test "$with_wnn6" != "no"; then
8504       
8505 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8506 echo "configure:8507: checking for jl_fi_dic_list in -l$libwnn" >&5
8507 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8508
8509 xe_check_libs=" -l$libwnn "
8510 cat > conftest.$ac_ext <<EOF
8511 #line 8512 "configure"
8512 #include "confdefs.h"
8513 /* Override any gcc2 internal prototype to avoid an error.  */
8514 /* We use char because int might match the return type of a gcc2
8515     builtin and then its argument prototype would still apply.  */
8516 char jl_fi_dic_list();
8517
8518 int main() {
8519 jl_fi_dic_list()
8520 ; return 0; }
8521 EOF
8522 if { (eval echo configure:8523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8523   rm -rf conftest*
8524   eval "ac_cv_lib_$ac_lib_var=yes"
8525 else
8526   echo "configure: failed program was:" >&5
8527   cat conftest.$ac_ext >&5
8528   rm -rf conftest*
8529   eval "ac_cv_lib_$ac_lib_var=no"
8530 fi
8531 rm -f conftest*
8532 xe_check_libs=""
8533
8534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8535   echo "$ac_t""yes" 1>&6
8536   with_wnn6=yes
8537 else
8538   echo "$ac_t""no" 1>&6
8539 fi
8540
8541
8542       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8543     Defining WNN6
8544 EOF
8545 cat >> confdefs.h <<\EOF
8546 #define WNN6 1
8547 EOF
8548 }
8549
8550     fi
8551   fi
8552
8553     canna_includes_found=no
8554   if test "$with_canna" != "no"; then
8555     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8556 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8557 echo "configure:8558: checking for canna/jrkanji.h" >&5
8558
8559 cat > conftest.$ac_ext <<EOF
8560 #line 8561 "configure"
8561 #include "confdefs.h"
8562 #include <canna/jrkanji.h>
8563 EOF
8564 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8565 { (eval echo configure:8566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8566 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8567 if test -z "$ac_err"; then
8568   rm -rf conftest*
8569   eval "ac_cv_header_$ac_safe=yes"
8570 else
8571   echo "$ac_err" >&5
8572   echo "configure: failed program was:" >&5
8573   cat conftest.$ac_ext >&5
8574   rm -rf conftest*
8575   eval "ac_cv_header_$ac_safe=no"
8576 fi
8577 rm -f conftest*
8578 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8579   echo "$ac_t""yes" 1>&6
8580   canna_includes_found=yes
8581 else
8582   echo "$ac_t""no" 1>&6
8583 fi
8584
8585   fi
8586   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8587       -d "/usr/local/canna/include"; then
8588     save_c_switch_site="$c_switch_site"
8589     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8590     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8591 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8592 echo "configure:8593: checking for canna/jrkanji.h" >&5
8593
8594 cat > conftest.$ac_ext <<EOF
8595 #line 8596 "configure"
8596 #include "confdefs.h"
8597 #include <canna/jrkanji.h>
8598 EOF
8599 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8600 { (eval echo configure:8601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8601 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8602 if test -z "$ac_err"; then
8603   rm -rf conftest*
8604   eval "ac_cv_header_$ac_safe=yes"
8605 else
8606   echo "$ac_err" >&5
8607   echo "configure: failed program was:" >&5
8608   cat conftest.$ac_ext >&5
8609   rm -rf conftest*
8610   eval "ac_cv_header_$ac_safe=no"
8611 fi
8612 rm -f conftest*
8613 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8614   echo "$ac_t""yes" 1>&6
8615   canna_includes_found=yes
8616 else
8617   echo "$ac_t""no" 1>&6
8618 fi
8619
8620     if test "$canna_includes_found" != "yes"; then
8621       c_switch_site="$save_c_switch_site"
8622       with_canna="no"
8623     fi
8624   fi
8625
8626   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8627 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8628 echo "configure:8629: checking for canna/RK.h" >&5
8629
8630 cat > conftest.$ac_ext <<EOF
8631 #line 8632 "configure"
8632 #include "confdefs.h"
8633 #include <canna/RK.h>
8634 EOF
8635 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8636 { (eval echo configure:8637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8637 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8638 if test -z "$ac_err"; then
8639   rm -rf conftest*
8640   eval "ac_cv_header_$ac_safe=yes"
8641 else
8642   echo "$ac_err" >&5
8643   echo "configure: failed program was:" >&5
8644   cat conftest.$ac_ext >&5
8645   rm -rf conftest*
8646   eval "ac_cv_header_$ac_safe=no"
8647 fi
8648 rm -f conftest*
8649 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8650   echo "$ac_t""yes" 1>&6
8651   :
8652 else
8653   echo "$ac_t""no" 1>&6
8654 with_canna=no
8655 fi
8656  }
8657   test -z "$with_canna" && { 
8658 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8659 echo "configure:8660: checking for RkBgnBun in -lRKC" >&5
8660 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8661
8662 xe_check_libs=" -lRKC "
8663 cat > conftest.$ac_ext <<EOF
8664 #line 8665 "configure"
8665 #include "confdefs.h"
8666 /* Override any gcc2 internal prototype to avoid an error.  */
8667 /* We use char because int might match the return type of a gcc2
8668     builtin and then its argument prototype would still apply.  */
8669 char RkBgnBun();
8670
8671 int main() {
8672 RkBgnBun()
8673 ; return 0; }
8674 EOF
8675 if { (eval echo configure:8676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8676   rm -rf conftest*
8677   eval "ac_cv_lib_$ac_lib_var=yes"
8678 else
8679   echo "configure: failed program was:" >&5
8680   cat conftest.$ac_ext >&5
8681   rm -rf conftest*
8682   eval "ac_cv_lib_$ac_lib_var=no"
8683 fi
8684 rm -f conftest*
8685 xe_check_libs=""
8686
8687 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8688   echo "$ac_t""yes" 1>&6
8689   :
8690 else
8691   echo "$ac_t""no" 1>&6
8692 with_canna=no
8693 fi
8694
8695  }
8696   test -z "$with_canna" && { 
8697 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8698 echo "configure:8699: checking for jrKanjiControl in -lcanna" >&5
8699 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8700
8701 xe_check_libs=" -lcanna "
8702 cat > conftest.$ac_ext <<EOF
8703 #line 8704 "configure"
8704 #include "confdefs.h"
8705 /* Override any gcc2 internal prototype to avoid an error.  */
8706 /* We use char because int might match the return type of a gcc2
8707     builtin and then its argument prototype would still apply.  */
8708 char jrKanjiControl();
8709
8710 int main() {
8711 jrKanjiControl()
8712 ; return 0; }
8713 EOF
8714 if { (eval echo configure:8715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8715   rm -rf conftest*
8716   eval "ac_cv_lib_$ac_lib_var=yes"
8717 else
8718   echo "configure: failed program was:" >&5
8719   cat conftest.$ac_ext >&5
8720   rm -rf conftest*
8721   eval "ac_cv_lib_$ac_lib_var=no"
8722 fi
8723 rm -f conftest*
8724 xe_check_libs=""
8725
8726 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8727   echo "$ac_t""yes" 1>&6
8728   :
8729 else
8730   echo "$ac_t""no" 1>&6
8731 with_canna=no
8732 fi
8733
8734  }
8735   test -z "$with_canna" && with_canna=yes
8736   if test "$with_canna" = "yes"; then
8737     { test "$extra_verbose" = "yes" && cat << \EOF
8738     Defining HAVE_CANNA
8739 EOF
8740 cat >> confdefs.h <<\EOF
8741 #define HAVE_CANNA 1
8742 EOF
8743 }
8744
8745     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8746     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8747    echo "    xemacs will be linked with \"mule-canna.o\""
8748  fi
8749   fi
8750
8751 else   for feature in xim canna wnn; do
8752     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8753       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8754     fi
8755     eval "with_${feature}=no"
8756   done
8757 fi 
8758
8759 if test "$need_motif" = "yes" ; then
8760   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8761     
8762 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8763 echo "configure:8764: checking for layout_object_getvalue in -li18n" >&5
8764 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8765
8766 xe_check_libs=" -li18n "
8767 cat > conftest.$ac_ext <<EOF
8768 #line 8769 "configure"
8769 #include "confdefs.h"
8770 /* Override any gcc2 internal prototype to avoid an error.  */
8771 /* We use char because int might match the return type of a gcc2
8772     builtin and then its argument prototype would still apply.  */
8773 char layout_object_getvalue();
8774
8775 int main() {
8776 layout_object_getvalue()
8777 ; return 0; }
8778 EOF
8779 if { (eval echo configure:8780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8780   rm -rf conftest*
8781   eval "ac_cv_lib_$ac_lib_var=yes"
8782 else
8783   echo "configure: failed program was:" >&5
8784   cat conftest.$ac_ext >&5
8785   rm -rf conftest*
8786   eval "ac_cv_lib_$ac_lib_var=no"
8787 fi
8788 rm -f conftest*
8789 xe_check_libs=""
8790
8791 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8792   echo "$ac_t""yes" 1>&6
8793   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8794 else
8795   echo "$ac_t""no" 1>&6
8796 fi
8797
8798
8799   
8800 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8801     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8802   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8803   
8804         runpath="" runpath_dirs=""
8805   if test -n "$LD_RUN_PATH"; then
8806     runpath="$LD_RUN_PATH"
8807   elif test "$GCC" = "yes"; then
8808         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8809     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8810     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8811     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8812       case "$arg" in P,* | -L* | -R* )
8813         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8814           {
8815 xe_runpath_dir="$dir"
8816   test "$xe_runpath_dir" != "/lib"     -a \
8817         "$xe_runpath_dir" != "/usr/lib" -a \
8818         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8819   eval "$xe_add_unique_runpath_dir"
8820 }
8821         done ;;
8822       esac
8823     done
8824     ld_switch_run="$ld_switch_run_save"
8825     rm -f conftest*
8826   else
8827         for arg in $ld_switch_site $ld_switch_x_site; do
8828       case "$arg" in -L*) {
8829 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8830   test "$xe_runpath_dir" != "/lib"     -a \
8831         "$xe_runpath_dir" != "/usr/lib" -a \
8832         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8833   eval "$xe_add_unique_runpath_dir"
8834 };; esac
8835     done
8836         if test "$opsys $need_motif" = "sol2 yes"; then
8837       xe_runpath_dir="/opt/SUNWdt/lib";
8838       eval "$xe_add_unique_runpath_dir";
8839     fi
8840   fi 
8841   if test -n "$runpath"; then
8842     ld_switch_run="${dash_r}${runpath}"
8843     
8844 if test "$GCC" = "yes"; then
8845   set x $ld_switch_run; shift; ld_switch_run=""
8846   while test -n "$1"; do
8847     case $1 in
8848       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8849       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8850       -Xlinker* ) ;;
8851       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8852     esac
8853     shift
8854   done
8855 fi
8856     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8857   fi
8858 fi
8859
8860 fi
8861
8862 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
8863 do
8864 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8865 echo "configure:8866: checking for $ac_func" >&5
8866
8867 cat > conftest.$ac_ext <<EOF
8868 #line 8869 "configure"
8869 #include "confdefs.h"
8870 /* System header to define __stub macros and hopefully few prototypes,
8871     which can conflict with char $ac_func(); below.  */
8872 #include <assert.h>
8873 /* Override any gcc2 internal prototype to avoid an error.  */
8874 /* We use char because int might match the return type of a gcc2
8875     builtin and then its argument prototype would still apply.  */
8876 char $ac_func();
8877
8878 int main() {
8879
8880 /* The GNU C library defines this for functions which it implements
8881     to always fail with ENOSYS.  Some functions are actually named
8882     something starting with __ and the normal name is an alias.  */
8883 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8884 choke me
8885 #else
8886 $ac_func();
8887 #endif
8888
8889 ; return 0; }
8890 EOF
8891 if { (eval echo configure:8892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8892   rm -rf conftest*
8893   eval "ac_cv_func_$ac_func=yes"
8894 else
8895   echo "configure: failed program was:" >&5
8896   cat conftest.$ac_ext >&5
8897   rm -rf conftest*
8898   eval "ac_cv_func_$ac_func=no"
8899 fi
8900 rm -f conftest*
8901
8902 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8903   echo "$ac_t""yes" 1>&6
8904     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8905   { test "$extra_verbose" = "yes" && cat << EOF
8906     Defining $ac_tr_func
8907 EOF
8908 cat >> confdefs.h <<EOF
8909 #define $ac_tr_func 1
8910 EOF
8911 }
8912  
8913 else
8914   echo "$ac_t""no" 1>&6
8915 fi
8916 done
8917
8918
8919
8920 case "$opsys" in
8921   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8922    echo "    xemacs will be linked with \"realpath.o\""
8923  fi ;;
8924   * )
8925     case "$canonical" in
8926       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8927    echo "    xemacs will be linked with \"realpath.o\""
8928  fi ;;
8929       * ) for ac_func in realpath
8930 do
8931 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8932 echo "configure:8933: checking for $ac_func" >&5
8933
8934 cat > conftest.$ac_ext <<EOF
8935 #line 8936 "configure"
8936 #include "confdefs.h"
8937 /* System header to define __stub macros and hopefully few prototypes,
8938     which can conflict with char $ac_func(); below.  */
8939 #include <assert.h>
8940 /* Override any gcc2 internal prototype to avoid an error.  */
8941 /* We use char because int might match the return type of a gcc2
8942     builtin and then its argument prototype would still apply.  */
8943 char $ac_func();
8944
8945 int main() {
8946
8947 /* The GNU C library defines this for functions which it implements
8948     to always fail with ENOSYS.  Some functions are actually named
8949     something starting with __ and the normal name is an alias.  */
8950 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8951 choke me
8952 #else
8953 $ac_func();
8954 #endif
8955
8956 ; return 0; }
8957 EOF
8958 if { (eval echo configure:8959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8959   rm -rf conftest*
8960   eval "ac_cv_func_$ac_func=yes"
8961 else
8962   echo "configure: failed program was:" >&5
8963   cat conftest.$ac_ext >&5
8964   rm -rf conftest*
8965   eval "ac_cv_func_$ac_func=no"
8966 fi
8967 rm -f conftest*
8968
8969 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8970   echo "$ac_t""yes" 1>&6
8971     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8972   { test "$extra_verbose" = "yes" && cat << EOF
8973     Defining $ac_tr_func
8974 EOF
8975 cat >> confdefs.h <<EOF
8976 #define $ac_tr_func 1
8977 EOF
8978 }
8979  
8980 else
8981   echo "$ac_t""no" 1>&6
8982 fi
8983 done
8984
8985           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8986    echo "    xemacs will be linked with \"realpath.o\""
8987  fi ;;
8988     esac ;;
8989 esac
8990
8991 for ac_func in getloadavg
8992 do
8993 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8994 echo "configure:8995: checking for $ac_func" >&5
8995
8996 cat > conftest.$ac_ext <<EOF
8997 #line 8998 "configure"
8998 #include "confdefs.h"
8999 /* System header to define __stub macros and hopefully few prototypes,
9000     which can conflict with char $ac_func(); below.  */
9001 #include <assert.h>
9002 /* Override any gcc2 internal prototype to avoid an error.  */
9003 /* We use char because int might match the return type of a gcc2
9004     builtin and then its argument prototype would still apply.  */
9005 char $ac_func();
9006
9007 int main() {
9008
9009 /* The GNU C library defines this for functions which it implements
9010     to always fail with ENOSYS.  Some functions are actually named
9011     something starting with __ and the normal name is an alias.  */
9012 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9013 choke me
9014 #else
9015 $ac_func();
9016 #endif
9017
9018 ; return 0; }
9019 EOF
9020 if { (eval echo configure:9021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9021   rm -rf conftest*
9022   eval "ac_cv_func_$ac_func=yes"
9023 else
9024   echo "configure: failed program was:" >&5
9025   cat conftest.$ac_ext >&5
9026   rm -rf conftest*
9027   eval "ac_cv_func_$ac_func=no"
9028 fi
9029 rm -f conftest*
9030
9031 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9032   echo "$ac_t""yes" 1>&6
9033     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9034   { test "$extra_verbose" = "yes" && cat << EOF
9035     Defining $ac_tr_func
9036 EOF
9037 cat >> confdefs.h <<EOF
9038 #define $ac_tr_func 1
9039 EOF
9040 }
9041  
9042 else
9043   echo "$ac_t""no" 1>&6
9044 fi
9045 done
9046
9047
9048 if test "$ac_cv_func_getloadavg" != "yes"
9049 then
9050   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
9051    echo "    xemacs will be linked with \"getloadavg.o\""
9052  fi
9053
9054     
9055 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
9056 echo "configure:9057: checking for kstat_open in -lkstat" >&5
9057 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
9058
9059 xe_check_libs=" -lkstat "
9060 cat > conftest.$ac_ext <<EOF
9061 #line 9062 "configure"
9062 #include "confdefs.h"
9063 /* Override any gcc2 internal prototype to avoid an error.  */
9064 /* We use char because int might match the return type of a gcc2
9065     builtin and then its argument prototype would still apply.  */
9066 char kstat_open();
9067
9068 int main() {
9069 kstat_open()
9070 ; return 0; }
9071 EOF
9072 if { (eval echo configure:9073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9073   rm -rf conftest*
9074   eval "ac_cv_lib_$ac_lib_var=yes"
9075 else
9076   echo "configure: failed program was:" >&5
9077   cat conftest.$ac_ext >&5
9078   rm -rf conftest*
9079   eval "ac_cv_lib_$ac_lib_var=no"
9080 fi
9081 rm -f conftest*
9082 xe_check_libs=""
9083
9084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9085   echo "$ac_t""yes" 1>&6
9086     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9087     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9088   { test "$extra_verbose" = "yes" && cat << EOF
9089     Defining $ac_tr_lib
9090 EOF
9091 cat >> confdefs.h <<EOF
9092 #define $ac_tr_lib 1
9093 EOF
9094 }
9095
9096   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
9097
9098 else
9099   echo "$ac_t""no" 1>&6
9100 fi
9101
9102
9103
9104     
9105 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
9106 echo "configure:9107: checking for kvm_read in -lkvm" >&5
9107 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
9108
9109 xe_check_libs=" -lkvm "
9110 cat > conftest.$ac_ext <<EOF
9111 #line 9112 "configure"
9112 #include "confdefs.h"
9113 /* Override any gcc2 internal prototype to avoid an error.  */
9114 /* We use char because int might match the return type of a gcc2
9115     builtin and then its argument prototype would still apply.  */
9116 char kvm_read();
9117
9118 int main() {
9119 kvm_read()
9120 ; return 0; }
9121 EOF
9122 if { (eval echo configure:9123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9123   rm -rf conftest*
9124   eval "ac_cv_lib_$ac_lib_var=yes"
9125 else
9126   echo "configure: failed program was:" >&5
9127   cat conftest.$ac_ext >&5
9128   rm -rf conftest*
9129   eval "ac_cv_lib_$ac_lib_var=no"
9130 fi
9131 rm -f conftest*
9132 xe_check_libs=""
9133
9134 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
9135   echo "$ac_t""yes" 1>&6
9136     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9137     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9138   { test "$extra_verbose" = "yes" && cat << EOF
9139     Defining $ac_tr_lib
9140 EOF
9141 cat >> confdefs.h <<EOF
9142 #define $ac_tr_lib 1
9143 EOF
9144 }
9145
9146   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
9147
9148 else
9149   echo "$ac_t""no" 1>&6
9150 fi
9151
9152
9153 fi
9154
9155 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
9156 echo "configure:9157: checking whether netdb declares h_errno" >&5
9157 cat > conftest.$ac_ext <<EOF
9158 #line 9159 "configure"
9159 #include "confdefs.h"
9160 #include <netdb.h>
9161 int main() {
9162 return h_errno;
9163 ; return 0; }
9164 EOF
9165 if { (eval echo configure:9166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9166   rm -rf conftest*
9167   echo "$ac_t""yes" 1>&6
9168    { test "$extra_verbose" = "yes" && cat << \EOF
9169     Defining HAVE_H_ERRNO
9170 EOF
9171 cat >> confdefs.h <<\EOF
9172 #define HAVE_H_ERRNO 1
9173 EOF
9174 }
9175
9176 else
9177   echo "configure: failed program was:" >&5
9178   cat conftest.$ac_ext >&5
9179   rm -rf conftest*
9180   echo "$ac_t""no" 1>&6
9181 fi
9182 rm -f conftest*
9183
9184 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
9185 echo "configure:9186: checking for sigsetjmp" >&5
9186 cat > conftest.$ac_ext <<EOF
9187 #line 9188 "configure"
9188 #include "confdefs.h"
9189 #include <setjmp.h>
9190 int main() {
9191 sigjmp_buf bar; sigsetjmp (bar, 0);
9192 ; return 0; }
9193 EOF
9194 if { (eval echo configure:9195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9195   rm -rf conftest*
9196   echo "$ac_t""yes" 1>&6
9197    { test "$extra_verbose" = "yes" && cat << \EOF
9198     Defining HAVE_SIGSETJMP
9199 EOF
9200 cat >> confdefs.h <<\EOF
9201 #define HAVE_SIGSETJMP 1
9202 EOF
9203 }
9204
9205 else
9206   echo "configure: failed program was:" >&5
9207   cat conftest.$ac_ext >&5
9208   rm -rf conftest*
9209   echo "$ac_t""no" 1>&6
9210 fi
9211 rm -f conftest*
9212
9213 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
9214 echo "configure:9215: checking whether localtime caches TZ" >&5
9215
9216 if test "$ac_cv_func_tzset" = "yes"; then
9217 cat > conftest.$ac_ext <<EOF
9218 #line 9219 "configure"
9219 #include "confdefs.h"
9220 #include <time.h>
9221 #if STDC_HEADERS
9222 # include <stdlib.h>
9223 #endif
9224 extern char **environ;
9225 unset_TZ ()
9226 {
9227   char **from, **to;
9228   for (to = from = environ; (*to = *from); from++)
9229     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
9230       to++;
9231 }
9232 char TZ_GMT0[] = "TZ=GMT0";
9233 char TZ_PST8[] = "TZ=PST8";
9234 main()
9235 {
9236   time_t now = time ((time_t *) 0);
9237   int hour_GMT0, hour_unset;
9238   if (putenv (TZ_GMT0) != 0)
9239     exit (1);
9240   hour_GMT0 = localtime (&now)->tm_hour;
9241   unset_TZ ();
9242   hour_unset = localtime (&now)->tm_hour;
9243   if (putenv (TZ_PST8) != 0)
9244     exit (1);
9245   if (localtime (&now)->tm_hour == hour_GMT0)
9246     exit (1);
9247   unset_TZ ();
9248   if (localtime (&now)->tm_hour != hour_unset)
9249     exit (1);
9250   exit (0);
9251 }
9252 EOF
9253 if { (eval echo configure:9254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9254 then
9255   emacs_cv_localtime_cache=no
9256 else
9257   conftest_rc="$?"
9258   echo "configure: failed program was:" >&5
9259   cat conftest.$ac_ext >&5
9260   rm -fr conftest*
9261   emacs_cv_localtime_cache=yes
9262 fi
9263 rm -fr conftest*
9264 else
9265         # If we lack tzset, report that localtime does not cache TZ,
9266         # since we can't invalidate the cache if we don't have tzset.
9267         emacs_cv_localtime_cache=no
9268 fi
9269 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
9270 if test $emacs_cv_localtime_cache = yes; then
9271   { test "$extra_verbose" = "yes" && cat << \EOF
9272     Defining LOCALTIME_CACHE
9273 EOF
9274 cat >> confdefs.h <<\EOF
9275 #define LOCALTIME_CACHE 1
9276 EOF
9277 }
9278
9279 fi
9280
9281 if test "$HAVE_TIMEVAL" = "yes"; then
9282 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
9283 echo "configure:9284: checking whether gettimeofday accepts one or two arguments" >&5
9284 cat > conftest.$ac_ext <<EOF
9285 #line 9286 "configure"
9286 #include "confdefs.h"
9287
9288 #ifdef TIME_WITH_SYS_TIME
9289 #include <sys/time.h>
9290 #include <time.h>
9291 #else
9292 #ifdef HAVE_SYS_TIME_H
9293 #include <sys/time.h>
9294 #else
9295 #include <time.h>
9296 #endif
9297 #endif
9298   
9299 int main() {
9300
9301   struct timeval time;
9302   struct timezone dummy;
9303   gettimeofday (&time, &dummy);
9304
9305 ; return 0; }
9306 EOF
9307 if { (eval echo configure:9308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9308   rm -rf conftest*
9309   echo "$ac_t""two" 1>&6
9310 else
9311   echo "configure: failed program was:" >&5
9312   cat conftest.$ac_ext >&5
9313   rm -rf conftest*
9314   echo "$ac_t""one" 1>&6
9315    { test "$extra_verbose" = "yes" && cat << \EOF
9316     Defining GETTIMEOFDAY_ONE_ARGUMENT
9317 EOF
9318 cat >> confdefs.h <<\EOF
9319 #define GETTIMEOFDAY_ONE_ARGUMENT 1
9320 EOF
9321 }
9322
9323 fi
9324 rm -f conftest*
9325 fi
9326
9327
9328 echo $ac_n "checking for inline""... $ac_c" 1>&6
9329 echo "configure:9330: checking for inline" >&5
9330
9331 ac_cv_c_inline=no
9332 for ac_kw in inline __inline__ __inline; do
9333   cat > conftest.$ac_ext <<EOF
9334 #line 9335 "configure"
9335 #include "confdefs.h"
9336
9337 int main() {
9338 } $ac_kw foo() {
9339 ; return 0; }
9340 EOF
9341 if { (eval echo configure:9342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9342   rm -rf conftest*
9343   ac_cv_c_inline=$ac_kw; break
9344 else
9345   echo "configure: failed program was:" >&5
9346   cat conftest.$ac_ext >&5
9347 fi
9348 rm -f conftest*
9349 done
9350
9351
9352 echo "$ac_t""$ac_cv_c_inline" 1>&6
9353 case "$ac_cv_c_inline" in
9354   inline | yes) ;;
9355   no) { test "$extra_verbose" = "yes" && cat << \EOF
9356     Defining inline = 
9357 EOF
9358 cat >> confdefs.h <<\EOF
9359 #define inline 
9360 EOF
9361 }
9362  ;;
9363   *)  { test "$extra_verbose" = "yes" && cat << EOF
9364     Defining inline = $ac_cv_c_inline
9365 EOF
9366 cat >> confdefs.h <<EOF
9367 #define inline $ac_cv_c_inline
9368 EOF
9369 }
9370  ;;
9371 esac
9372
9373 if test "$ac_cv_c_inline" != "no"; then
9374   { test "$extra_verbose" = "yes" && cat << \EOF
9375     Defining HAVE_INLINE
9376 EOF
9377 cat >> confdefs.h <<\EOF
9378 #define HAVE_INLINE 1
9379 EOF
9380 }
9381
9382   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9383    echo "    xemacs will be linked with \"inline.o\""
9384  fi
9385 fi
9386
9387
9388 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9389 # for constant arguments.  Useless!
9390 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9391 echo "configure:9392: checking for working alloca.h" >&5
9392
9393 cat > conftest.$ac_ext <<EOF
9394 #line 9395 "configure"
9395 #include "confdefs.h"
9396 #include <alloca.h>
9397 int main() {
9398 char *p = alloca(2 * sizeof(int));
9399 ; return 0; }
9400 EOF
9401 if { (eval echo configure:9402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9402   rm -rf conftest*
9403   ac_cv_header_alloca_h=yes
9404 else
9405   echo "configure: failed program was:" >&5
9406   cat conftest.$ac_ext >&5
9407   rm -rf conftest*
9408   ac_cv_header_alloca_h=no
9409 fi
9410 rm -f conftest*
9411
9412 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9413 if test $ac_cv_header_alloca_h = yes; then
9414   { test "$extra_verbose" = "yes" && cat << \EOF
9415     Defining HAVE_ALLOCA_H
9416 EOF
9417 cat >> confdefs.h <<\EOF
9418 #define HAVE_ALLOCA_H 1
9419 EOF
9420 }
9421
9422 fi
9423
9424 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9425 echo "configure:9426: checking for alloca" >&5
9426
9427 cat > conftest.$ac_ext <<EOF
9428 #line 9429 "configure"
9429 #include "confdefs.h"
9430
9431 #ifdef __GNUC__
9432 # define alloca __builtin_alloca
9433 #else
9434 # ifdef _MSC_VER
9435 #  include <malloc.h>
9436 #  define alloca _alloca
9437 # else
9438 #  if HAVE_ALLOCA_H
9439 #   include <alloca.h>
9440 #  else
9441 #   ifdef _AIX
9442  #pragma alloca
9443 #   else
9444 #    ifndef alloca /* predefined by HP cc +Olibcalls */
9445 char *alloca ();
9446 #    endif
9447 #   endif
9448 #  endif
9449 # endif
9450 #endif
9451
9452 int main() {
9453 char *p = (char *) alloca(1);
9454 ; return 0; }
9455 EOF
9456 if { (eval echo configure:9457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9457   rm -rf conftest*
9458   ac_cv_func_alloca_works=yes
9459 else
9460   echo "configure: failed program was:" >&5
9461   cat conftest.$ac_ext >&5
9462   rm -rf conftest*
9463   ac_cv_func_alloca_works=no
9464 fi
9465 rm -f conftest*
9466
9467 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9468 if test $ac_cv_func_alloca_works = yes; then
9469   { test "$extra_verbose" = "yes" && cat << \EOF
9470     Defining HAVE_ALLOCA
9471 EOF
9472 cat >> confdefs.h <<\EOF
9473 #define HAVE_ALLOCA 1
9474 EOF
9475 }
9476
9477 fi
9478
9479 if test $ac_cv_func_alloca_works = no; then
9480   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9481   # that cause trouble.  Some versions do not even contain alloca or
9482   # contain a buggy version.  If you still want to use their alloca,
9483   # use ar to extract alloca.o from them instead of compiling alloca.c.
9484   ALLOCA=alloca.${ac_objext}
9485   { test "$extra_verbose" = "yes" && cat << \EOF
9486     Defining C_ALLOCA
9487 EOF
9488 cat >> confdefs.h <<\EOF
9489 #define C_ALLOCA 1
9490 EOF
9491 }
9492
9493
9494 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9495 echo "configure:9496: checking whether alloca needs Cray hooks" >&5
9496
9497 cat > conftest.$ac_ext <<EOF
9498 #line 9499 "configure"
9499 #include "confdefs.h"
9500 #if defined(CRAY) && ! defined(CRAY2)
9501 webecray
9502 #else
9503 wenotbecray
9504 #endif
9505
9506 EOF
9507 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9508   egrep "webecray" >/dev/null 2>&1; then
9509   rm -rf conftest*
9510   ac_cv_os_cray=yes
9511 else
9512   rm -rf conftest*
9513   ac_cv_os_cray=no
9514 fi
9515 rm -f conftest*
9516
9517
9518 echo "$ac_t""$ac_cv_os_cray" 1>&6
9519 if test $ac_cv_os_cray = yes; then
9520 for ac_func in _getb67 GETB67 getb67; do
9521   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9522 echo "configure:9523: checking for $ac_func" >&5
9523
9524 cat > conftest.$ac_ext <<EOF
9525 #line 9526 "configure"
9526 #include "confdefs.h"
9527 /* System header to define __stub macros and hopefully few prototypes,
9528     which can conflict with char $ac_func(); below.  */
9529 #include <assert.h>
9530 /* Override any gcc2 internal prototype to avoid an error.  */
9531 /* We use char because int might match the return type of a gcc2
9532     builtin and then its argument prototype would still apply.  */
9533 char $ac_func();
9534
9535 int main() {
9536
9537 /* The GNU C library defines this for functions which it implements
9538     to always fail with ENOSYS.  Some functions are actually named
9539     something starting with __ and the normal name is an alias.  */
9540 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9541 choke me
9542 #else
9543 $ac_func();
9544 #endif
9545
9546 ; return 0; }
9547 EOF
9548 if { (eval echo configure:9549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9549   rm -rf conftest*
9550   eval "ac_cv_func_$ac_func=yes"
9551 else
9552   echo "configure: failed program was:" >&5
9553   cat conftest.$ac_ext >&5
9554   rm -rf conftest*
9555   eval "ac_cv_func_$ac_func=no"
9556 fi
9557 rm -f conftest*
9558
9559 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9560   echo "$ac_t""yes" 1>&6
9561   { test "$extra_verbose" = "yes" && cat << EOF
9562     Defining CRAY_STACKSEG_END = $ac_func
9563 EOF
9564 cat >> confdefs.h <<EOF
9565 #define CRAY_STACKSEG_END $ac_func
9566 EOF
9567 }
9568
9569   break
9570 else
9571   echo "$ac_t""no" 1>&6
9572 fi
9573
9574 done
9575 fi
9576
9577 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9578 echo "configure:9579: checking stack direction for C alloca" >&5
9579
9580 cat > conftest.$ac_ext <<EOF
9581 #line 9582 "configure"
9582 #include "confdefs.h"
9583 find_stack_direction ()
9584 {
9585   static char *addr = 0;
9586   auto char dummy;
9587   if (addr == 0)
9588     {
9589       addr = &dummy;
9590       return find_stack_direction ();
9591     }
9592   else
9593     return (&dummy > addr) ? 1 : -1;
9594 }
9595 main ()
9596 {
9597   exit (find_stack_direction() < 0);
9598 }
9599 EOF
9600 if { (eval echo configure:9601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9601 then
9602   ac_cv_c_stack_direction=1
9603 else
9604   conftest_rc="$?"
9605   echo "configure: failed program was:" >&5
9606   cat conftest.$ac_ext >&5
9607   rm -fr conftest*
9608   ac_cv_c_stack_direction=-1
9609 fi
9610 rm -fr conftest*
9611
9612 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9613 { test "$extra_verbose" = "yes" && cat << EOF
9614     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9615 EOF
9616 cat >> confdefs.h <<EOF
9617 #define STACK_DIRECTION $ac_cv_c_stack_direction
9618 EOF
9619 }
9620
9621 fi
9622
9623 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9624    echo "    xemacs will be linked with \"$ALLOCA\""
9625  fi
9626
9627 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9628 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9629 echo "configure:9630: checking for vfork.h" >&5
9630
9631 cat > conftest.$ac_ext <<EOF
9632 #line 9633 "configure"
9633 #include "confdefs.h"
9634 #include <vfork.h>
9635 EOF
9636 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9637 { (eval echo configure:9638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9638 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9639 if test -z "$ac_err"; then
9640   rm -rf conftest*
9641   eval "ac_cv_header_$ac_safe=yes"
9642 else
9643   echo "$ac_err" >&5
9644   echo "configure: failed program was:" >&5
9645   cat conftest.$ac_ext >&5
9646   rm -rf conftest*
9647   eval "ac_cv_header_$ac_safe=no"
9648 fi
9649 rm -f conftest*
9650 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9651   echo "$ac_t""yes" 1>&6
9652   { test "$extra_verbose" = "yes" && cat << \EOF
9653     Defining HAVE_VFORK_H
9654 EOF
9655 cat >> confdefs.h <<\EOF
9656 #define HAVE_VFORK_H 1
9657 EOF
9658 }
9659
9660 else
9661   echo "$ac_t""no" 1>&6
9662 fi
9663
9664 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9665 echo "configure:9666: checking for working vfork" >&5
9666
9667 cat > conftest.$ac_ext <<EOF
9668 #line 9669 "configure"
9669 #include "confdefs.h"
9670 /* Thanks to Paul Eggert for this test.  */
9671 #include <stdio.h>
9672 #include <sys/types.h>
9673 #include <sys/stat.h>
9674 #ifdef HAVE_UNISTD_H
9675 #include <unistd.h>
9676 #endif
9677 #ifdef HAVE_VFORK_H
9678 #include <vfork.h>
9679 #endif
9680 /* On some sparc systems, changes by the child to local and incoming
9681    argument registers are propagated back to the parent.
9682    The compiler is told about this with #include <vfork.h>,
9683    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9684    Test for this by using a static variable whose address
9685    is put into a register that is clobbered by the vfork.  */
9686 static
9687 #ifdef __cplusplus
9688 sparc_address_test (int arg)
9689 #else
9690 sparc_address_test (arg) int arg;
9691 #endif
9692 {
9693   static pid_t child;
9694   if (!child) {
9695     child = vfork ();
9696     if (child < 0) {
9697       perror ("vfork");
9698       _exit(2);
9699     }
9700     if (!child) {
9701       arg = getpid();
9702       write(-1, "", 0);
9703       _exit (arg);
9704     }
9705   }
9706 }
9707 main() {
9708   pid_t parent = getpid ();
9709   pid_t child;
9710
9711   sparc_address_test ();
9712
9713   child = vfork ();
9714
9715   if (child == 0) {
9716     /* Here is another test for sparc vfork register problems.
9717        This test uses lots of local variables, at least
9718        as many local variables as main has allocated so far
9719        including compiler temporaries.  4 locals are enough for
9720        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9721        A buggy compiler should reuse the register of parent
9722        for one of the local variables, since it will think that
9723        parent can't possibly be used any more in this routine.
9724        Assigning to the local variable will thus munge parent
9725        in the parent process.  */
9726     pid_t
9727       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9728       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9729     /* Convince the compiler that p..p7 are live; otherwise, it might
9730        use the same hardware register for all 8 local variables.  */
9731     if (p != p1 || p != p2 || p != p3 || p != p4
9732         || p != p5 || p != p6 || p != p7)
9733       _exit(1);
9734
9735     /* On some systems (e.g. IRIX 3.3),
9736        vfork doesn't separate parent from child file descriptors.
9737        If the child closes a descriptor before it execs or exits,
9738        this munges the parent's descriptor as well.
9739        Test for this by closing stdout in the child.  */
9740     _exit(close(fileno(stdout)) != 0);
9741   } else {
9742     int status;
9743     struct stat st;
9744
9745     while (wait(&status) != child)
9746       ;
9747     exit(
9748          /* Was there some problem with vforking?  */
9749          child < 0
9750
9751          /* Did the child fail?  (This shouldn't happen.)  */
9752          || status
9753
9754          /* Did the vfork/compiler bug occur?  */
9755          || parent != getpid()
9756
9757          /* Did the file descriptor bug occur?  */
9758          || fstat(fileno(stdout), &st) != 0
9759          );
9760   }
9761 }
9762 EOF
9763 if { (eval echo configure:9764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9764 then
9765   ac_cv_func_vfork_works=yes
9766 else
9767   conftest_rc="$?"
9768   echo "configure: failed program was:" >&5
9769   cat conftest.$ac_ext >&5
9770   rm -fr conftest*
9771   ac_cv_func_vfork_works=no
9772 fi
9773 rm -fr conftest*
9774
9775 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9776 if test $ac_cv_func_vfork_works = no; then
9777   { test "$extra_verbose" = "yes" && cat << \EOF
9778     Defining vfork = fork
9779 EOF
9780 cat >> confdefs.h <<\EOF
9781 #define vfork fork
9782 EOF
9783 }
9784
9785 fi
9786
9787
9788 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9789 echo "configure:9790: checking for working strcoll" >&5
9790
9791 cat > conftest.$ac_ext <<EOF
9792 #line 9793 "configure"
9793 #include "confdefs.h"
9794 #include <string.h>
9795 main ()
9796 {
9797   exit (strcoll ("abc", "def") >= 0 ||
9798         strcoll ("ABC", "DEF") >= 0 ||
9799         strcoll ("123", "456") >= 0);
9800 }
9801 EOF
9802 if { (eval echo configure:9803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9803 then
9804   ac_cv_func_strcoll_works=yes
9805 else
9806   conftest_rc="$?"
9807   echo "configure: failed program was:" >&5
9808   cat conftest.$ac_ext >&5
9809   rm -fr conftest*
9810   ac_cv_func_strcoll_works=no
9811 fi
9812 rm -fr conftest*
9813
9814 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9815 if test $ac_cv_func_strcoll_works = yes; then
9816   { test "$extra_verbose" = "yes" && cat << \EOF
9817     Defining HAVE_STRCOLL
9818 EOF
9819 cat >> confdefs.h <<\EOF
9820 #define HAVE_STRCOLL 1
9821 EOF
9822 }
9823
9824 fi
9825
9826
9827 for ac_func in getpgrp
9828 do
9829 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9830 echo "configure:9831: checking for $ac_func" >&5
9831
9832 cat > conftest.$ac_ext <<EOF
9833 #line 9834 "configure"
9834 #include "confdefs.h"
9835 /* System header to define __stub macros and hopefully few prototypes,
9836     which can conflict with char $ac_func(); below.  */
9837 #include <assert.h>
9838 /* Override any gcc2 internal prototype to avoid an error.  */
9839 /* We use char because int might match the return type of a gcc2
9840     builtin and then its argument prototype would still apply.  */
9841 char $ac_func();
9842
9843 int main() {
9844
9845 /* The GNU C library defines this for functions which it implements
9846     to always fail with ENOSYS.  Some functions are actually named
9847     something starting with __ and the normal name is an alias.  */
9848 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9849 choke me
9850 #else
9851 $ac_func();
9852 #endif
9853
9854 ; return 0; }
9855 EOF
9856 if { (eval echo configure:9857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9857   rm -rf conftest*
9858   eval "ac_cv_func_$ac_func=yes"
9859 else
9860   echo "configure: failed program was:" >&5
9861   cat conftest.$ac_ext >&5
9862   rm -rf conftest*
9863   eval "ac_cv_func_$ac_func=no"
9864 fi
9865 rm -f conftest*
9866
9867 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9868   echo "$ac_t""yes" 1>&6
9869     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9870   { test "$extra_verbose" = "yes" && cat << EOF
9871     Defining $ac_tr_func
9872 EOF
9873 cat >> confdefs.h <<EOF
9874 #define $ac_tr_func 1
9875 EOF
9876 }
9877  
9878 else
9879   echo "$ac_t""no" 1>&6
9880 fi
9881 done
9882
9883 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9884 echo "configure:9885: checking whether getpgrp takes no argument" >&5
9885
9886 cat > conftest.$ac_ext <<EOF
9887 #line 9888 "configure"
9888 #include "confdefs.h"
9889
9890 /*
9891  * If this system has a BSD-style getpgrp(),
9892  * which takes a pid argument, exit unsuccessfully.
9893  *
9894  * Snarfed from Chet Ramey's bash pgrp.c test program
9895  */
9896 #include <stdio.h>
9897 #include <sys/types.h>
9898
9899 int     pid;
9900 int     pg1, pg2, pg3, pg4;
9901 int     ng, np, s, child;
9902
9903 main()
9904 {
9905         pid = getpid();
9906         pg1 = getpgrp(0);
9907         pg2 = getpgrp();
9908         pg3 = getpgrp(pid);
9909         pg4 = getpgrp(1);
9910
9911         /*
9912          * If all of these values are the same, it's pretty sure that
9913          * we're on a system that ignores getpgrp's first argument.
9914          */
9915         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9916                 exit(0);
9917
9918         child = fork();
9919         if (child < 0)
9920                 exit(1);
9921         else if (child == 0) {
9922                 np = getpid();
9923                 /*
9924                  * If this is Sys V, this will not work; pgrp will be
9925                  * set to np because setpgrp just changes a pgrp to be
9926                  * the same as the pid.
9927                  */
9928                 setpgrp(np, pg1);
9929                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9930                 if (ng == pg1) {
9931                         exit(1);
9932                 } else {
9933                         exit(0);
9934                 }
9935         } else {
9936                 wait(&s);
9937                 exit(s>>8);
9938         }
9939 }
9940
9941 EOF
9942 if { (eval echo configure:9943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9943 then
9944   ac_cv_func_getpgrp_void=yes
9945 else
9946   conftest_rc="$?"
9947   echo "configure: failed program was:" >&5
9948   cat conftest.$ac_ext >&5
9949   rm -fr conftest*
9950   ac_cv_func_getpgrp_void=no
9951 fi
9952 rm -fr conftest*
9953
9954
9955 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9956 if test $ac_cv_func_getpgrp_void = yes; then
9957   { test "$extra_verbose" = "yes" && cat << \EOF
9958     Defining GETPGRP_VOID
9959 EOF
9960 cat >> confdefs.h <<\EOF
9961 #define GETPGRP_VOID 1
9962 EOF
9963 }
9964
9965 fi
9966
9967
9968 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9969 echo "configure:9970: checking for working mmap" >&5
9970 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9971 cat > conftest.$ac_ext <<EOF
9972 #line 9973 "configure"
9973 #include "confdefs.h"
9974 #include <stdio.h>
9975 #include <unistd.h>
9976 #include <fcntl.h>
9977 #include <sys/mman.h>
9978
9979 #ifndef MAP_VARIABLE
9980 #define MAP_VARIABLE 0
9981 #endif
9982
9983 #ifndef MAP_FAILED
9984 #define MAP_FAILED -1
9985 #endif
9986
9987 int main (int argc, char *argv[])
9988 {
9989   int fd = -1;
9990   caddr_t p;
9991 #ifndef MAP_ANONYMOUS
9992   fd = open ("/dev/zero", O_RDWR);
9993   if (fd < 0)
9994     return 1;
9995 #define MAP_ANONYMOUS 0
9996 #endif
9997   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9998            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9999            fd, 0) != (void *) MAP_FAILED)
10000     return 0;
10001   perror ("conftest: mmap failed");
10002   return 1;
10003 }
10004 EOF
10005 if { (eval echo configure:10006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
10006 then
10007   have_mmap=yes
10008 else
10009   conftest_rc="$?"
10010   echo "configure: failed program was:" >&5
10011   cat conftest.$ac_ext >&5
10012   rm -fr conftest*
10013   have_mmap=no
10014 fi
10015 rm -fr conftest* ;;
10016 esac
10017 echo "$ac_t""$have_mmap" 1>&6
10018 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10019     Defining HAVE_MMAP
10020 EOF
10021 cat >> confdefs.h <<\EOF
10022 #define HAVE_MMAP 1
10023 EOF
10024 }
10025
10026
10027 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
10028 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
10029 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
10030     Defining REL_ALLOC
10031 EOF
10032 cat >> confdefs.h <<\EOF
10033 #define REL_ALLOC 1
10034 EOF
10035 }
10036
10037
10038 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
10039 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
10040 echo "configure:10041: checking for termios.h" >&5
10041
10042 cat > conftest.$ac_ext <<EOF
10043 #line 10044 "configure"
10044 #include "confdefs.h"
10045 #include <termios.h>
10046 EOF
10047 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10048 { (eval echo configure:10049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10049 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10050 if test -z "$ac_err"; then
10051   rm -rf conftest*
10052   eval "ac_cv_header_$ac_safe=yes"
10053 else
10054   echo "$ac_err" >&5
10055   echo "configure: failed program was:" >&5
10056   cat conftest.$ac_ext >&5
10057   rm -rf conftest*
10058   eval "ac_cv_header_$ac_safe=no"
10059 fi
10060 rm -f conftest*
10061 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10062   echo "$ac_t""yes" 1>&6
10063   { test "$extra_verbose" = "yes" && cat << \EOF
10064     Defining HAVE_TERMIOS
10065 EOF
10066 cat >> confdefs.h <<\EOF
10067 #define HAVE_TERMIOS 1
10068 EOF
10069 }
10070
10071   { test "$extra_verbose" = "yes" && cat << \EOF
10072     Defining SIGNALS_VIA_CHARACTERS
10073 EOF
10074 cat >> confdefs.h <<\EOF
10075 #define SIGNALS_VIA_CHARACTERS 1
10076 EOF
10077 }
10078
10079   { test "$extra_verbose" = "yes" && cat << \EOF
10080     Defining NO_TERMIO
10081 EOF
10082 cat >> confdefs.h <<\EOF
10083 #define NO_TERMIO 1
10084 EOF
10085 }
10086
10087 else
10088   echo "$ac_t""no" 1>&6
10089 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10090 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10091 echo "configure:10092: checking for termio.h" >&5
10092
10093 cat > conftest.$ac_ext <<EOF
10094 #line 10095 "configure"
10095 #include "confdefs.h"
10096 #include <termio.h>
10097 EOF
10098 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10099 { (eval echo configure:10100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10100 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10101 if test -z "$ac_err"; then
10102   rm -rf conftest*
10103   eval "ac_cv_header_$ac_safe=yes"
10104 else
10105   echo "$ac_err" >&5
10106   echo "configure: failed program was:" >&5
10107   cat conftest.$ac_ext >&5
10108   rm -rf conftest*
10109   eval "ac_cv_header_$ac_safe=no"
10110 fi
10111 rm -f conftest*
10112 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10113   echo "$ac_t""yes" 1>&6
10114   { test "$extra_verbose" = "yes" && cat << \EOF
10115     Defining HAVE_TERMIO
10116 EOF
10117 cat >> confdefs.h <<\EOF
10118 #define HAVE_TERMIO 1
10119 EOF
10120 }
10121
10122 else
10123   echo "$ac_t""no" 1>&6
10124 fi
10125
10126 fi
10127
10128
10129
10130 echo $ac_n "checking for socket""... $ac_c" 1>&6
10131 echo "configure:10132: checking for socket" >&5
10132
10133 cat > conftest.$ac_ext <<EOF
10134 #line 10135 "configure"
10135 #include "confdefs.h"
10136 /* System header to define __stub macros and hopefully few prototypes,
10137     which can conflict with char socket(); below.  */
10138 #include <assert.h>
10139 /* Override any gcc2 internal prototype to avoid an error.  */
10140 /* We use char because int might match the return type of a gcc2
10141     builtin and then its argument prototype would still apply.  */
10142 char socket();
10143
10144 int main() {
10145
10146 /* The GNU C library defines this for functions which it implements
10147     to always fail with ENOSYS.  Some functions are actually named
10148     something starting with __ and the normal name is an alias.  */
10149 #if defined (__stub_socket) || defined (__stub___socket)
10150 choke me
10151 #else
10152 socket();
10153 #endif
10154
10155 ; return 0; }
10156 EOF
10157 if { (eval echo configure:10158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10158   rm -rf conftest*
10159   eval "ac_cv_func_socket=yes"
10160 else
10161   echo "configure: failed program was:" >&5
10162   cat conftest.$ac_ext >&5
10163   rm -rf conftest*
10164   eval "ac_cv_func_socket=no"
10165 fi
10166 rm -f conftest*
10167
10168 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10169   echo "$ac_t""yes" 1>&6
10170   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10171 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10172 echo "configure:10173: checking for netinet/in.h" >&5
10173
10174 cat > conftest.$ac_ext <<EOF
10175 #line 10176 "configure"
10176 #include "confdefs.h"
10177 #include <netinet/in.h>
10178 EOF
10179 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10180 { (eval echo configure:10181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10181 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10182 if test -z "$ac_err"; then
10183   rm -rf conftest*
10184   eval "ac_cv_header_$ac_safe=yes"
10185 else
10186   echo "$ac_err" >&5
10187   echo "configure: failed program was:" >&5
10188   cat conftest.$ac_ext >&5
10189   rm -rf conftest*
10190   eval "ac_cv_header_$ac_safe=no"
10191 fi
10192 rm -f conftest*
10193 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10194   echo "$ac_t""yes" 1>&6
10195   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10196 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10197 echo "configure:10198: checking for arpa/inet.h" >&5
10198
10199 cat > conftest.$ac_ext <<EOF
10200 #line 10201 "configure"
10201 #include "confdefs.h"
10202 #include <arpa/inet.h>
10203 EOF
10204 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10205 { (eval echo configure:10206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10206 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10207 if test -z "$ac_err"; then
10208   rm -rf conftest*
10209   eval "ac_cv_header_$ac_safe=yes"
10210 else
10211   echo "$ac_err" >&5
10212   echo "configure: failed program was:" >&5
10213   cat conftest.$ac_ext >&5
10214   rm -rf conftest*
10215   eval "ac_cv_header_$ac_safe=no"
10216 fi
10217 rm -f conftest*
10218 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10219   echo "$ac_t""yes" 1>&6
10220   
10221   { test "$extra_verbose" = "yes" && cat << \EOF
10222     Defining HAVE_SOCKETS
10223 EOF
10224 cat >> confdefs.h <<\EOF
10225 #define HAVE_SOCKETS 1
10226 EOF
10227 }
10228
10229       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10230 echo "configure:10231: checking "for sun_len member in struct sockaddr_un"" >&5
10231       cat > conftest.$ac_ext <<EOF
10232 #line 10233 "configure"
10233 #include "confdefs.h"
10234
10235 #include <sys/types.h>
10236 #include <sys/socket.h>
10237 #include <sys/un.h>
10238       
10239 int main() {
10240 static struct sockaddr_un x; x.sun_len = 1;
10241 ; return 0; }
10242 EOF
10243 if { (eval echo configure:10244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10244   rm -rf conftest*
10245   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10246     Defining HAVE_SOCKADDR_SUN_LEN
10247 EOF
10248 cat >> confdefs.h <<\EOF
10249 #define HAVE_SOCKADDR_SUN_LEN 1
10250 EOF
10251 }
10252
10253 else
10254   echo "configure: failed program was:" >&5
10255   cat conftest.$ac_ext >&5
10256   rm -rf conftest*
10257   echo "$ac_t""no" 1>&6
10258 fi
10259 rm -f conftest*
10260       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10261 echo "configure:10262: checking "for ip_mreq struct in netinet/in.h"" >&5
10262       cat > conftest.$ac_ext <<EOF
10263 #line 10264 "configure"
10264 #include "confdefs.h"
10265
10266 #include <sys/types.h>
10267 #include <netinet/in.h>
10268       
10269 int main() {
10270 static struct ip_mreq x;
10271 ; return 0; }
10272 EOF
10273 if { (eval echo configure:10274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10274   rm -rf conftest*
10275   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10276     Defining HAVE_MULTICAST
10277 EOF
10278 cat >> confdefs.h <<\EOF
10279 #define HAVE_MULTICAST 1
10280 EOF
10281 }
10282
10283 else
10284   echo "configure: failed program was:" >&5
10285   cat conftest.$ac_ext >&5
10286   rm -rf conftest*
10287   echo "$ac_t""no" 1>&6
10288 fi
10289 rm -f conftest*
10290 else
10291   echo "$ac_t""no" 1>&6
10292 fi
10293
10294 else
10295   echo "$ac_t""no" 1>&6
10296 fi
10297
10298 else
10299   echo "$ac_t""no" 1>&6
10300 fi
10301
10302
10303 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10304 echo "configure:10305: checking for msgget" >&5
10305
10306 cat > conftest.$ac_ext <<EOF
10307 #line 10308 "configure"
10308 #include "confdefs.h"
10309 /* System header to define __stub macros and hopefully few prototypes,
10310     which can conflict with char msgget(); below.  */
10311 #include <assert.h>
10312 /* Override any gcc2 internal prototype to avoid an error.  */
10313 /* We use char because int might match the return type of a gcc2
10314     builtin and then its argument prototype would still apply.  */
10315 char msgget();
10316
10317 int main() {
10318
10319 /* The GNU C library defines this for functions which it implements
10320     to always fail with ENOSYS.  Some functions are actually named
10321     something starting with __ and the normal name is an alias.  */
10322 #if defined (__stub_msgget) || defined (__stub___msgget)
10323 choke me
10324 #else
10325 msgget();
10326 #endif
10327
10328 ; return 0; }
10329 EOF
10330 if { (eval echo configure:10331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10331   rm -rf conftest*
10332   eval "ac_cv_func_msgget=yes"
10333 else
10334   echo "configure: failed program was:" >&5
10335   cat conftest.$ac_ext >&5
10336   rm -rf conftest*
10337   eval "ac_cv_func_msgget=no"
10338 fi
10339 rm -f conftest*
10340
10341 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10342   echo "$ac_t""yes" 1>&6
10343   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10344 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10345 echo "configure:10346: checking for sys/ipc.h" >&5
10346
10347 cat > conftest.$ac_ext <<EOF
10348 #line 10349 "configure"
10349 #include "confdefs.h"
10350 #include <sys/ipc.h>
10351 EOF
10352 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10353 { (eval echo configure:10354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10354 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10355 if test -z "$ac_err"; then
10356   rm -rf conftest*
10357   eval "ac_cv_header_$ac_safe=yes"
10358 else
10359   echo "$ac_err" >&5
10360   echo "configure: failed program was:" >&5
10361   cat conftest.$ac_ext >&5
10362   rm -rf conftest*
10363   eval "ac_cv_header_$ac_safe=no"
10364 fi
10365 rm -f conftest*
10366 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10367   echo "$ac_t""yes" 1>&6
10368   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10369 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10370 echo "configure:10371: checking for sys/msg.h" >&5
10371
10372 cat > conftest.$ac_ext <<EOF
10373 #line 10374 "configure"
10374 #include "confdefs.h"
10375 #include <sys/msg.h>
10376 EOF
10377 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10378 { (eval echo configure:10379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10379 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10380 if test -z "$ac_err"; then
10381   rm -rf conftest*
10382   eval "ac_cv_header_$ac_safe=yes"
10383 else
10384   echo "$ac_err" >&5
10385   echo "configure: failed program was:" >&5
10386   cat conftest.$ac_ext >&5
10387   rm -rf conftest*
10388   eval "ac_cv_header_$ac_safe=no"
10389 fi
10390 rm -f conftest*
10391 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10392   echo "$ac_t""yes" 1>&6
10393   { test "$extra_verbose" = "yes" && cat << \EOF
10394     Defining HAVE_SYSVIPC
10395 EOF
10396 cat >> confdefs.h <<\EOF
10397 #define HAVE_SYSVIPC 1
10398 EOF
10399 }
10400
10401 else
10402   echo "$ac_t""no" 1>&6
10403 fi
10404
10405 else
10406   echo "$ac_t""no" 1>&6
10407 fi
10408
10409 else
10410   echo "$ac_t""no" 1>&6
10411 fi
10412
10413
10414 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10415 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10416 echo "configure:10417: checking for dirent.h" >&5
10417
10418 cat > conftest.$ac_ext <<EOF
10419 #line 10420 "configure"
10420 #include "confdefs.h"
10421 #include <dirent.h>
10422 EOF
10423 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10424 { (eval echo configure:10425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10425 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10426 if test -z "$ac_err"; then
10427   rm -rf conftest*
10428   eval "ac_cv_header_$ac_safe=yes"
10429 else
10430   echo "$ac_err" >&5
10431   echo "configure: failed program was:" >&5
10432   cat conftest.$ac_ext >&5
10433   rm -rf conftest*
10434   eval "ac_cv_header_$ac_safe=no"
10435 fi
10436 rm -f conftest*
10437 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10438   echo "$ac_t""yes" 1>&6
10439   { test "$extra_verbose" = "yes" && cat << \EOF
10440     Defining SYSV_SYSTEM_DIR
10441 EOF
10442 cat >> confdefs.h <<\EOF
10443 #define SYSV_SYSTEM_DIR 1
10444 EOF
10445 }
10446
10447 else
10448   echo "$ac_t""no" 1>&6
10449 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10450 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10451 echo "configure:10452: checking for sys/dir.h" >&5
10452
10453 cat > conftest.$ac_ext <<EOF
10454 #line 10455 "configure"
10455 #include "confdefs.h"
10456 #include <sys/dir.h>
10457 EOF
10458 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10459 { (eval echo configure:10460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10460 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10461 if test -z "$ac_err"; then
10462   rm -rf conftest*
10463   eval "ac_cv_header_$ac_safe=yes"
10464 else
10465   echo "$ac_err" >&5
10466   echo "configure: failed program was:" >&5
10467   cat conftest.$ac_ext >&5
10468   rm -rf conftest*
10469   eval "ac_cv_header_$ac_safe=no"
10470 fi
10471 rm -f conftest*
10472 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10473   echo "$ac_t""yes" 1>&6
10474   :
10475 else
10476   echo "$ac_t""no" 1>&6
10477 { test "$extra_verbose" = "yes" && cat << \EOF
10478     Defining NONSYSTEM_DIR_LIBRARY
10479 EOF
10480 cat >> confdefs.h <<\EOF
10481 #define NONSYSTEM_DIR_LIBRARY 1
10482 EOF
10483 }
10484
10485 fi
10486
10487 fi
10488
10489
10490 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10491 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10492 echo "configure:10493: checking for nlist.h" >&5
10493
10494 cat > conftest.$ac_ext <<EOF
10495 #line 10496 "configure"
10496 #include "confdefs.h"
10497 #include <nlist.h>
10498 EOF
10499 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10500 { (eval echo configure:10501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10501 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10502 if test -z "$ac_err"; then
10503   rm -rf conftest*
10504   eval "ac_cv_header_$ac_safe=yes"
10505 else
10506   echo "$ac_err" >&5
10507   echo "configure: failed program was:" >&5
10508   cat conftest.$ac_ext >&5
10509   rm -rf conftest*
10510   eval "ac_cv_header_$ac_safe=no"
10511 fi
10512 rm -f conftest*
10513 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10514   echo "$ac_t""yes" 1>&6
10515   { test "$extra_verbose" = "yes" && cat << \EOF
10516     Defining NLIST_STRUCT
10517 EOF
10518 cat >> confdefs.h <<\EOF
10519 #define NLIST_STRUCT 1
10520 EOF
10521 }
10522
10523 else
10524   echo "$ac_t""no" 1>&6
10525 fi
10526
10527
10528
10529 echo "checking "for sound support"" 1>&6
10530 echo "configure:10531: checking "for sound support"" >&5
10531 case "$with_sound" in
10532   native | both ) with_native_sound=yes;;
10533   nas    | no   ) with_native_sound=no;;
10534 esac
10535 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10536
10537 if test "$with_native_sound" != "no"; then
10538     if test -n "$native_sound_lib"; then
10539     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10540 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10541 echo "configure:10542: checking for multimedia/audio_device.h" >&5
10542
10543 cat > conftest.$ac_ext <<EOF
10544 #line 10545 "configure"
10545 #include "confdefs.h"
10546 #include <multimedia/audio_device.h>
10547 EOF
10548 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10549 { (eval echo configure:10550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10550 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10551 if test -z "$ac_err"; then
10552   rm -rf conftest*
10553   eval "ac_cv_header_$ac_safe=yes"
10554 else
10555   echo "$ac_err" >&5
10556   echo "configure: failed program was:" >&5
10557   cat conftest.$ac_ext >&5
10558   rm -rf conftest*
10559   eval "ac_cv_header_$ac_safe=no"
10560 fi
10561 rm -f conftest*
10562 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10563   echo "$ac_t""yes" 1>&6
10564   sound_found=yes sound_cflags=""
10565       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10566    echo "    xemacs will be linked with \"sunplay.o\""
10567  fi
10568 else
10569   echo "$ac_t""no" 1>&6
10570 fi
10571
10572   fi
10573
10574     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10575     sound_found=yes
10576     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10577    echo "    xemacs will be linked with \"sunplay.o\""
10578  fi
10579     if test -d "/usr/demo/SOUND/include"
10580       then sound_cflags="-I/usr/demo/SOUND/include"
10581       else sound_cflags="-I/usr/demo/SOUND"
10582     fi
10583     if test -z "$native_sound_lib" ; then
10584       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10585         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10586         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10587       fi
10588     fi
10589   fi
10590
10591     if test -z "$sound_found"; then
10592     case "$canonical" in
10593     *-sgi-* )
10594       if test -z "$native_sound_lib"; then
10595         
10596 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10597 echo "configure:10598: checking for ALopenport in -laudio" >&5
10598 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10599
10600 xe_check_libs=" -laudio "
10601 cat > conftest.$ac_ext <<EOF
10602 #line 10603 "configure"
10603 #include "confdefs.h"
10604 /* Override any gcc2 internal prototype to avoid an error.  */
10605 /* We use char because int might match the return type of a gcc2
10606     builtin and then its argument prototype would still apply.  */
10607 char ALopenport();
10608
10609 int main() {
10610 ALopenport()
10611 ; return 0; }
10612 EOF
10613 if { (eval echo configure:10614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10614   rm -rf conftest*
10615   eval "ac_cv_lib_$ac_lib_var=yes"
10616 else
10617   echo "configure: failed program was:" >&5
10618   cat conftest.$ac_ext >&5
10619   rm -rf conftest*
10620   eval "ac_cv_lib_$ac_lib_var=no"
10621 fi
10622 rm -f conftest*
10623 xe_check_libs=""
10624
10625 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10626   echo "$ac_t""yes" 1>&6
10627   native_sound_lib="-laudio"
10628 else
10629   echo "$ac_t""no" 1>&6
10630 fi
10631
10632
10633       fi
10634       if test -n "$native_sound_lib"; then
10635         sound_found=yes sound_cflags=""
10636         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10637    echo "    xemacs will be linked with \"sgiplay.o\""
10638  fi
10639       fi ;;
10640     hppa*-hp-hpux* )
10641       if test -z "$native_sound_lib"; then
10642         
10643 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10644 echo "configure:10645: checking for AOpenAudio in -lAlib" >&5
10645 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10646
10647 xe_check_libs=" -lAlib "
10648 cat > conftest.$ac_ext <<EOF
10649 #line 10650 "configure"
10650 #include "confdefs.h"
10651 /* Override any gcc2 internal prototype to avoid an error.  */
10652 /* We use char because int might match the return type of a gcc2
10653     builtin and then its argument prototype would still apply.  */
10654 char AOpenAudio();
10655
10656 int main() {
10657 AOpenAudio()
10658 ; return 0; }
10659 EOF
10660 if { (eval echo configure:10661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10661   rm -rf conftest*
10662   eval "ac_cv_lib_$ac_lib_var=yes"
10663 else
10664   echo "configure: failed program was:" >&5
10665   cat conftest.$ac_ext >&5
10666   rm -rf conftest*
10667   eval "ac_cv_lib_$ac_lib_var=no"
10668 fi
10669 rm -f conftest*
10670 xe_check_libs=""
10671
10672 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10673   echo "$ac_t""yes" 1>&6
10674   native_sound_lib="-lAlib"
10675 else
10676   echo "$ac_t""no" 1>&6
10677 fi
10678
10679
10680       fi
10681       if test -n "$native_sound_lib"; then
10682         sound_found=yes
10683         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10684    echo "    xemacs will be linked with \"hpplay.o\""
10685  fi
10686         if test "$GCC" = "yes" # Kludge city
10687           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10688           else sound_cflags="+e -I/usr/audio/examples"
10689         fi
10690       fi ;;
10691     esac
10692   fi
10693
10694     if test -z "$sound_found"; then
10695     for dir in "machine" "sys" "linux"; do
10696       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10697 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10698 echo "configure:10699: checking for ${dir}/soundcard.h" >&5
10699
10700 cat > conftest.$ac_ext <<EOF
10701 #line 10702 "configure"
10702 #include "confdefs.h"
10703 #include <${dir}/soundcard.h>
10704 EOF
10705 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10706 { (eval echo configure:10707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10707 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10708 if test -z "$ac_err"; then
10709   rm -rf conftest*
10710   eval "ac_cv_header_$ac_safe=yes"
10711 else
10712   echo "$ac_err" >&5
10713   echo "configure: failed program was:" >&5
10714   cat conftest.$ac_ext >&5
10715   rm -rf conftest*
10716   eval "ac_cv_header_$ac_safe=no"
10717 fi
10718 rm -f conftest*
10719 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10720   echo "$ac_t""yes" 1>&6
10721   sound_found=yes
10722         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10723    echo "    xemacs will be linked with \"linuxplay.o\""
10724  fi
10725         { test "$extra_verbose" = "yes" && cat << EOF
10726     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10727 EOF
10728 cat >> confdefs.h <<EOF
10729 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10730 EOF
10731 }
10732
10733         break
10734 else
10735   echo "$ac_t""no" 1>&6
10736 fi
10737
10738     done
10739   fi
10740
10741   test "$sound_found" = "yes" && with_native_sound=yes
10742 fi
10743
10744 if test -z "$with_sound"; then
10745   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10746     with_sound=native
10747   fi
10748 fi
10749
10750 if test "$with_native_sound" = "yes"; then
10751   { test "$extra_verbose" = "yes" && cat << \EOF
10752     Defining HAVE_NATIVE_SOUND
10753 EOF
10754 cat >> confdefs.h <<\EOF
10755 #define HAVE_NATIVE_SOUND 1
10756 EOF
10757 }
10758
10759   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10760 fi
10761
10762 case "$with_sound" in both | nas )
10763   { test "$extra_verbose" = "yes" && cat << \EOF
10764     Defining HAVE_NAS_SOUND
10765 EOF
10766 cat >> confdefs.h <<\EOF
10767 #define HAVE_NAS_SOUND 1
10768 EOF
10769 }
10770
10771   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10772    echo "    xemacs will be linked with \"nas.o\""
10773  fi
10774   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10775       cat > conftest.$ac_ext <<EOF
10776 #line 10777 "configure"
10777 #include "confdefs.h"
10778 #include <audio/Xtutil.h>
10779 EOF
10780 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10781   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10782   :
10783 else
10784   rm -rf conftest*
10785   { test "$extra_verbose" = "yes" && cat << \EOF
10786     Defining NAS_NO_ERROR_JUMP
10787 EOF
10788 cat >> confdefs.h <<\EOF
10789 #define NAS_NO_ERROR_JUMP 1
10790 EOF
10791 }
10792
10793 fi
10794 rm -f conftest*
10795
10796 esac
10797
10798
10799 test -z "$with_tty" && with_tty=yes
10800
10801 if test "$with_tty" = "yes"  ; then
10802   echo "checking for TTY-related features" 1>&6
10803 echo "configure:10804: checking for TTY-related features" >&5
10804   { test "$extra_verbose" = "yes" && cat << \EOF
10805     Defining HAVE_TTY
10806 EOF
10807 cat >> confdefs.h <<\EOF
10808 #define HAVE_TTY 1
10809 EOF
10810 }
10811
10812   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
10813    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\""
10814  fi
10815
10816     if test -z "$with_ncurses"; then
10817     
10818 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10819 echo "configure:10820: checking for tgetent in -lncurses" >&5
10820 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10821
10822 xe_check_libs=" -lncurses "
10823 cat > conftest.$ac_ext <<EOF
10824 #line 10825 "configure"
10825 #include "confdefs.h"
10826 /* Override any gcc2 internal prototype to avoid an error.  */
10827 /* We use char because int might match the return type of a gcc2
10828     builtin and then its argument prototype would still apply.  */
10829 char tgetent();
10830
10831 int main() {
10832 tgetent()
10833 ; return 0; }
10834 EOF
10835 if { (eval echo configure:10836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10836   rm -rf conftest*
10837   eval "ac_cv_lib_$ac_lib_var=yes"
10838 else
10839   echo "configure: failed program was:" >&5
10840   cat conftest.$ac_ext >&5
10841   rm -rf conftest*
10842   eval "ac_cv_lib_$ac_lib_var=no"
10843 fi
10844 rm -f conftest*
10845 xe_check_libs=""
10846
10847 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10848   echo "$ac_t""yes" 1>&6
10849   with_ncurses=yes
10850 else
10851   echo "$ac_t""no" 1>&6
10852 with_ncurses=no
10853 fi
10854
10855
10856   fi
10857   if test "$with_ncurses" = "yes"; then
10858     { test "$extra_verbose" = "yes" && cat << \EOF
10859     Defining HAVE_NCURSES
10860 EOF
10861 cat >> confdefs.h <<\EOF
10862 #define HAVE_NCURSES 1
10863 EOF
10864 }
10865
10866     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10867 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10868 echo "configure:10869: checking for ncurses/curses.h" >&5
10869
10870 cat > conftest.$ac_ext <<EOF
10871 #line 10872 "configure"
10872 #include "confdefs.h"
10873 #include <ncurses/curses.h>
10874 EOF
10875 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10876 { (eval echo configure:10877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10877 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10878 if test -z "$ac_err"; then
10879   rm -rf conftest*
10880   eval "ac_cv_header_$ac_safe=yes"
10881 else
10882   echo "$ac_err" >&5
10883   echo "configure: failed program was:" >&5
10884   cat conftest.$ac_ext >&5
10885   rm -rf conftest*
10886   eval "ac_cv_header_$ac_safe=no"
10887 fi
10888 rm -f conftest*
10889 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10890   echo "$ac_t""yes" 1>&6
10891   curses_h_path=ncurses/curses.h
10892 else
10893   echo "$ac_t""no" 1>&6
10894 fi
10895
10896     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10897 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10898 echo "configure:10899: checking for ncurses/term.h" >&5
10899
10900 cat > conftest.$ac_ext <<EOF
10901 #line 10902 "configure"
10902 #include "confdefs.h"
10903 #include <ncurses/term.h>
10904 EOF
10905 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10906 { (eval echo configure:10907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10907 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10908 if test -z "$ac_err"; then
10909   rm -rf conftest*
10910   eval "ac_cv_header_$ac_safe=yes"
10911 else
10912   echo "$ac_err" >&5
10913   echo "configure: failed program was:" >&5
10914   cat conftest.$ac_ext >&5
10915   rm -rf conftest*
10916   eval "ac_cv_header_$ac_safe=no"
10917 fi
10918 rm -f conftest*
10919 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10920   echo "$ac_t""yes" 1>&6
10921   term_h_path=ncurses/term.h
10922 else
10923   echo "$ac_t""no" 1>&6
10924 fi
10925
10926     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10927    echo "    xemacs will be linked with \"terminfo.o\""
10928  fi
10929     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10930
10931     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10932                         save_c_switch_site="$c_switch_site"
10933       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10934       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10935 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10936 echo "configure:10937: checking for ncurses/curses.h" >&5
10937
10938 cat > conftest.$ac_ext <<EOF
10939 #line 10940 "configure"
10940 #include "confdefs.h"
10941 #include <ncurses/curses.h>
10942 EOF
10943 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10944 { (eval echo configure:10945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10945 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10946 if test -z "$ac_err"; then
10947   rm -rf conftest*
10948   eval "ac_cv_header_$ac_safe=yes"
10949 else
10950   echo "$ac_err" >&5
10951   echo "configure: failed program was:" >&5
10952   cat conftest.$ac_ext >&5
10953   rm -rf conftest*
10954   eval "ac_cv_header_$ac_safe=no"
10955 fi
10956 rm -f conftest*
10957 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10958   echo "$ac_t""yes" 1>&6
10959   curses_h_path=ncurses/curses.h
10960 else
10961   echo "$ac_t""no" 1>&6
10962 fi
10963
10964       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10965         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10966         else c_switch_site="$save_c_switch_site"
10967       fi
10968     fi
10969   else         if test "$have_terminfo" = "yes"; then
10970       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10971    echo "    xemacs will be linked with \"terminfo.o\""
10972  fi
10973       if test -n "$libs_termcap"; then
10974         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10975       else
10976         for lib in curses termlib termcap; do
10977           
10978 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10979 echo "configure:10980: checking for tgetent in -l$lib" >&5
10980 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10981
10982 xe_check_libs=" -l$lib "
10983 cat > conftest.$ac_ext <<EOF
10984 #line 10985 "configure"
10985 #include "confdefs.h"
10986 /* Override any gcc2 internal prototype to avoid an error.  */
10987 /* We use char because int might match the return type of a gcc2
10988     builtin and then its argument prototype would still apply.  */
10989 char tgetent();
10990
10991 int main() {
10992 tgetent()
10993 ; return 0; }
10994 EOF
10995 if { (eval echo configure:10996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10996   rm -rf conftest*
10997   eval "ac_cv_lib_$ac_lib_var=yes"
10998 else
10999   echo "configure: failed program was:" >&5
11000   cat conftest.$ac_ext >&5
11001   rm -rf conftest*
11002   eval "ac_cv_lib_$ac_lib_var=no"
11003 fi
11004 rm -f conftest*
11005 xe_check_libs=""
11006
11007 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11008   echo "$ac_t""yes" 1>&6
11009   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
11010 else
11011   echo "$ac_t""no" 1>&6
11012 fi
11013
11014
11015         done
11016       fi
11017     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
11018    echo "    xemacs will be linked with \"tparam.o\""
11019  fi
11020                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
11021       if test -n "$libs_termcap"; then
11022         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
11023       else
11024         
11025 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
11026 echo "configure:11027: checking for tgetent in -lcurses" >&5
11027 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
11028
11029 xe_check_libs=" -lcurses "
11030 cat > conftest.$ac_ext <<EOF
11031 #line 11032 "configure"
11032 #include "confdefs.h"
11033 /* Override any gcc2 internal prototype to avoid an error.  */
11034 /* We use char because int might match the return type of a gcc2
11035     builtin and then its argument prototype would still apply.  */
11036 char tgetent();
11037
11038 int main() {
11039 tgetent()
11040 ; return 0; }
11041 EOF
11042 if { (eval echo configure:11043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11043   rm -rf conftest*
11044   eval "ac_cv_lib_$ac_lib_var=yes"
11045 else
11046   echo "configure: failed program was:" >&5
11047   cat conftest.$ac_ext >&5
11048   rm -rf conftest*
11049   eval "ac_cv_lib_$ac_lib_var=no"
11050 fi
11051 rm -f conftest*
11052 xe_check_libs=""
11053
11054 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11055   echo "$ac_t""yes" 1>&6
11056   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
11057 else
11058   echo "$ac_t""no" 1>&6
11059 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
11060 echo "configure:11061: checking for tgetent in -ltermcap" >&5
11061 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
11062
11063 xe_check_libs=" -ltermcap "
11064 cat > conftest.$ac_ext <<EOF
11065 #line 11066 "configure"
11066 #include "confdefs.h"
11067 /* Override any gcc2 internal prototype to avoid an error.  */
11068 /* We use char because int might match the return type of a gcc2
11069     builtin and then its argument prototype would still apply.  */
11070 char tgetent();
11071
11072 int main() {
11073 tgetent()
11074 ; return 0; }
11075 EOF
11076 if { (eval echo configure:11077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11077   rm -rf conftest*
11078   eval "ac_cv_lib_$ac_lib_var=yes"
11079 else
11080   echo "configure: failed program was:" >&5
11081   cat conftest.$ac_ext >&5
11082   rm -rf conftest*
11083   eval "ac_cv_lib_$ac_lib_var=no"
11084 fi
11085 rm -f conftest*
11086 xe_check_libs=""
11087
11088 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11089   echo "$ac_t""yes" 1>&6
11090   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11091 else
11092   echo "$ac_t""no" 1>&6
11093 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11094    echo "    xemacs will be linked with \"termcap.o\""
11095  fi
11096 fi
11097
11098
11099 fi
11100
11101
11102       fi
11103     fi
11104   fi
11105   { test "$extra_verbose" = "yes" && cat << EOF
11106     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11107 EOF
11108 cat >> confdefs.h <<EOF
11109 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11110 EOF
11111 }
11112
11113   { test "$extra_verbose" = "yes" && cat << EOF
11114     Defining TERM_H_PATH = "${term_h_path-term.h}"
11115 EOF
11116 cat >> confdefs.h <<EOF
11117 #define TERM_H_PATH "${term_h_path-term.h}"
11118 EOF
11119 }
11120
11121
11122     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11123 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11124 echo "configure:11125: checking for gpm.h" >&5
11125
11126 cat > conftest.$ac_ext <<EOF
11127 #line 11128 "configure"
11128 #include "confdefs.h"
11129 #include <gpm.h>
11130 EOF
11131 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11132 { (eval echo configure:11133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11133 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11134 if test -z "$ac_err"; then
11135   rm -rf conftest*
11136   eval "ac_cv_header_$ac_safe=yes"
11137 else
11138   echo "$ac_err" >&5
11139   echo "configure: failed program was:" >&5
11140   cat conftest.$ac_ext >&5
11141   rm -rf conftest*
11142   eval "ac_cv_header_$ac_safe=no"
11143 fi
11144 rm -f conftest*
11145 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11146   echo "$ac_t""yes" 1>&6
11147   :
11148 else
11149   echo "$ac_t""no" 1>&6
11150 with_gpm=no
11151 fi
11152  }
11153   test -z "$with_gpm" && { 
11154 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11155 echo "configure:11156: checking for Gpm_Open in -lgpm" >&5
11156 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11157
11158 xe_check_libs=" -lgpm "
11159 cat > conftest.$ac_ext <<EOF
11160 #line 11161 "configure"
11161 #include "confdefs.h"
11162 /* Override any gcc2 internal prototype to avoid an error.  */
11163 /* We use char because int might match the return type of a gcc2
11164     builtin and then its argument prototype would still apply.  */
11165 char Gpm_Open();
11166
11167 int main() {
11168 Gpm_Open()
11169 ; return 0; }
11170 EOF
11171 if { (eval echo configure:11172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11172   rm -rf conftest*
11173   eval "ac_cv_lib_$ac_lib_var=yes"
11174 else
11175   echo "configure: failed program was:" >&5
11176   cat conftest.$ac_ext >&5
11177   rm -rf conftest*
11178   eval "ac_cv_lib_$ac_lib_var=no"
11179 fi
11180 rm -f conftest*
11181 xe_check_libs=""
11182
11183 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11184   echo "$ac_t""yes" 1>&6
11185   with_gpm=yes
11186 else
11187   echo "$ac_t""no" 1>&6
11188 with_gpm=no
11189 fi
11190
11191  }
11192   if test "$with_gpm" = "yes"; then
11193     { test "$extra_verbose" = "yes" && cat << \EOF
11194     Defining HAVE_GPM
11195 EOF
11196 cat >> confdefs.h <<\EOF
11197 #define HAVE_GPM 1
11198 EOF
11199 }
11200
11201     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11202    echo "    xemacs will be linked with \"gpmevent.o\""
11203  fi
11204     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11205   fi
11206
11207 else   for feature in ncurses gpm; do
11208     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11209       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11210     fi
11211     eval "with_${feature}=no"
11212   done
11213 fi 
11214 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11215    echo "    xemacs will be linked with \"event-unixoid.o\""
11216  fi
11217
11218
11219 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11220   != "no no no" && echo "checking for database support" 1>&6
11221 echo "configure:11222: checking for database support" >&5
11222
11223 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11224   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11225 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11226 echo "configure:11227: checking for ndbm.h" >&5
11227
11228 cat > conftest.$ac_ext <<EOF
11229 #line 11230 "configure"
11230 #include "confdefs.h"
11231 #include <ndbm.h>
11232 EOF
11233 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11234 { (eval echo configure:11235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11235 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11236 if test -z "$ac_err"; then
11237   rm -rf conftest*
11238   eval "ac_cv_header_$ac_safe=yes"
11239 else
11240   echo "$ac_err" >&5
11241   echo "configure: failed program was:" >&5
11242   cat conftest.$ac_ext >&5
11243   rm -rf conftest*
11244   eval "ac_cv_header_$ac_safe=no"
11245 fi
11246 rm -f conftest*
11247 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11248   echo "$ac_t""yes" 1>&6
11249   :
11250 else
11251   echo "$ac_t""no" 1>&6
11252
11253     test "$with_database_gnudbm" = "yes" -o \
11254          "$with_database_dbm"    = "yes" && \
11255       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11256     with_database_gnudbm=no with_database_dbm=no
11257 fi
11258
11259 fi
11260
11261 if test "$with_database_gnudbm" != "no"; then
11262   
11263 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11264 echo "configure:11265: checking for dbm_open in -lgdbm" >&5
11265 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11266
11267 xe_check_libs=" -lgdbm "
11268 cat > conftest.$ac_ext <<EOF
11269 #line 11270 "configure"
11270 #include "confdefs.h"
11271 /* Override any gcc2 internal prototype to avoid an error.  */
11272 /* We use char because int might match the return type of a gcc2
11273     builtin and then its argument prototype would still apply.  */
11274 char dbm_open();
11275
11276 int main() {
11277 dbm_open()
11278 ; return 0; }
11279 EOF
11280 if { (eval echo configure:11281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11281   rm -rf conftest*
11282   eval "ac_cv_lib_$ac_lib_var=yes"
11283 else
11284   echo "configure: failed program was:" >&5
11285   cat conftest.$ac_ext >&5
11286   rm -rf conftest*
11287   eval "ac_cv_lib_$ac_lib_var=no"
11288 fi
11289 rm -f conftest*
11290 xe_check_libs=""
11291
11292 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11293   echo "$ac_t""yes" 1>&6
11294   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11295 else
11296   echo "$ac_t""no" 1>&6
11297 if test "$with_database_gnudbm" = "yes"; then
11298      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11299    fi
11300    with_database_gnudbm=no
11301 fi
11302
11303
11304 fi
11305
11306 if test "$with_database_dbm" != "no"; then
11307   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11308 echo "configure:11309: checking for dbm_open" >&5
11309
11310 cat > conftest.$ac_ext <<EOF
11311 #line 11312 "configure"
11312 #include "confdefs.h"
11313 /* System header to define __stub macros and hopefully few prototypes,
11314     which can conflict with char dbm_open(); below.  */
11315 #include <assert.h>
11316 /* Override any gcc2 internal prototype to avoid an error.  */
11317 /* We use char because int might match the return type of a gcc2
11318     builtin and then its argument prototype would still apply.  */
11319 char dbm_open();
11320
11321 int main() {
11322
11323 /* The GNU C library defines this for functions which it implements
11324     to always fail with ENOSYS.  Some functions are actually named
11325     something starting with __ and the normal name is an alias.  */
11326 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11327 choke me
11328 #else
11329 dbm_open();
11330 #endif
11331
11332 ; return 0; }
11333 EOF
11334 if { (eval echo configure:11335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11335   rm -rf conftest*
11336   eval "ac_cv_func_dbm_open=yes"
11337 else
11338   echo "configure: failed program was:" >&5
11339   cat conftest.$ac_ext >&5
11340   rm -rf conftest*
11341   eval "ac_cv_func_dbm_open=no"
11342 fi
11343 rm -f conftest*
11344
11345 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11346   echo "$ac_t""yes" 1>&6
11347   with_database_dbm=yes libdbm=
11348 else
11349   echo "$ac_t""no" 1>&6
11350
11351     
11352 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11353 echo "configure:11354: checking for dbm_open in -ldbm" >&5
11354 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11355
11356 xe_check_libs=" -ldbm "
11357 cat > conftest.$ac_ext <<EOF
11358 #line 11359 "configure"
11359 #include "confdefs.h"
11360 /* Override any gcc2 internal prototype to avoid an error.  */
11361 /* We use char because int might match the return type of a gcc2
11362     builtin and then its argument prototype would still apply.  */
11363 char dbm_open();
11364
11365 int main() {
11366 dbm_open()
11367 ; return 0; }
11368 EOF
11369 if { (eval echo configure:11370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11370   rm -rf conftest*
11371   eval "ac_cv_lib_$ac_lib_var=yes"
11372 else
11373   echo "configure: failed program was:" >&5
11374   cat conftest.$ac_ext >&5
11375   rm -rf conftest*
11376   eval "ac_cv_lib_$ac_lib_var=no"
11377 fi
11378 rm -f conftest*
11379 xe_check_libs=""
11380
11381 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11382   echo "$ac_t""yes" 1>&6
11383   with_database_dbm=yes libdbm=-ldbm
11384 else
11385   echo "$ac_t""no" 1>&6
11386 test "$with_database_dbm" = "yes" && \
11387         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11388       with_database_dbm=no
11389 fi
11390
11391
11392 fi
11393
11394 fi
11395
11396 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11397 test "$with_database_gnudbm" = "yes" -o \
11398      "$with_database_dbm"    = "yes" && \
11399   { test "$extra_verbose" = "yes" && cat << \EOF
11400     Defining HAVE_DBM
11401 EOF
11402 cat >> confdefs.h <<\EOF
11403 #define HAVE_DBM 1
11404 EOF
11405 }
11406
11407
11408 if test "$with_database_berkdb" != "no"; then
11409   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11410 echo "configure:11411: checking for Berkeley db.h" >&5
11411   for path in "db/db.h" "db.h"; do
11412     cat > conftest.$ac_ext <<EOF
11413 #line 11414 "configure"
11414 #include "confdefs.h"
11415 #ifdef HAVE_INTTYPES_H
11416 #define __BIT_TYPES_DEFINED__
11417 #include <inttypes.h>
11418 typedef uint8_t  u_int8_t;
11419 typedef uint16_t u_int16_t;
11420 typedef uint32_t u_int32_t;
11421 #ifdef WE_DONT_NEED_QUADS
11422 typedef uint64_t u_int64_t;
11423 #endif
11424 #endif
11425 #include <$path>
11426
11427 int main() {
11428
11429 ; return 0; }
11430 EOF
11431 if { (eval echo configure:11432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11432   rm -rf conftest*
11433   db_h_path="$path"; break
11434 else
11435   echo "configure: failed program was:" >&5
11436   cat conftest.$ac_ext >&5
11437 fi
11438 rm -f conftest*
11439   done
11440   if test -z "$db_h_path"
11441   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11442   else echo "$ac_t""$db_h_path" 1>&6
11443   fi
11444
11445   if test "$with_database_berkdb" != "no"; then
11446     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11447 echo "configure:11448: checking for Berkeley DB version" >&5
11448     cat > conftest.$ac_ext <<EOF
11449 #line 11450 "configure"
11450 #include "confdefs.h"
11451 #include <$db_h_path>
11452 #if DB_VERSION_MAJOR > 1
11453 yes
11454 #endif
11455
11456 EOF
11457 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11458   egrep "yes" >/dev/null 2>&1; then
11459   rm -rf conftest*
11460   echo "$ac_t""2" 1>&6; dbfunc=db_open
11461 else
11462   rm -rf conftest*
11463   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11464 fi
11465 rm -f conftest*
11466
11467     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11468 echo "configure:11469: checking for $dbfunc" >&5
11469
11470 cat > conftest.$ac_ext <<EOF
11471 #line 11472 "configure"
11472 #include "confdefs.h"
11473 /* System header to define __stub macros and hopefully few prototypes,
11474     which can conflict with char $dbfunc(); below.  */
11475 #include <assert.h>
11476 /* Override any gcc2 internal prototype to avoid an error.  */
11477 /* We use char because int might match the return type of a gcc2
11478     builtin and then its argument prototype would still apply.  */
11479 char $dbfunc();
11480
11481 int main() {
11482
11483 /* The GNU C library defines this for functions which it implements
11484     to always fail with ENOSYS.  Some functions are actually named
11485     something starting with __ and the normal name is an alias.  */
11486 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11487 choke me
11488 #else
11489 $dbfunc();
11490 #endif
11491
11492 ; return 0; }
11493 EOF
11494 if { (eval echo configure:11495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11495   rm -rf conftest*
11496   eval "ac_cv_func_$dbfunc=yes"
11497 else
11498   echo "configure: failed program was:" >&5
11499   cat conftest.$ac_ext >&5
11500   rm -rf conftest*
11501   eval "ac_cv_func_$dbfunc=no"
11502 fi
11503 rm -f conftest*
11504
11505 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11506   echo "$ac_t""yes" 1>&6
11507   with_database_berkdb=yes need_libdb=no
11508 else
11509   echo "$ac_t""no" 1>&6
11510
11511     
11512 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11513 echo "configure:11514: checking for $dbfunc in -ldb" >&5
11514 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11515
11516 xe_check_libs=" -ldb "
11517 cat > conftest.$ac_ext <<EOF
11518 #line 11519 "configure"
11519 #include "confdefs.h"
11520 /* Override any gcc2 internal prototype to avoid an error.  */
11521 /* We use char because int might match the return type of a gcc2
11522     builtin and then its argument prototype would still apply.  */
11523 char $dbfunc();
11524
11525 int main() {
11526 $dbfunc()
11527 ; return 0; }
11528 EOF
11529 if { (eval echo configure:11530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11530   rm -rf conftest*
11531   eval "ac_cv_lib_$ac_lib_var=yes"
11532 else
11533   echo "configure: failed program was:" >&5
11534   cat conftest.$ac_ext >&5
11535   rm -rf conftest*
11536   eval "ac_cv_lib_$ac_lib_var=no"
11537 fi
11538 rm -f conftest*
11539 xe_check_libs=""
11540
11541 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11542   echo "$ac_t""yes" 1>&6
11543   with_database_berkdb=yes need_libdb=yes
11544 else
11545   echo "$ac_t""no" 1>&6
11546 fi
11547
11548
11549 fi
11550
11551   fi
11552
11553   if test "$with_database_berkdb" = "yes"; then
11554     { test "$extra_verbose" = "yes" && cat << EOF
11555     Defining DB_H_PATH = "$db_h_path"
11556 EOF
11557 cat >> confdefs.h <<EOF
11558 #define DB_H_PATH "$db_h_path"
11559 EOF
11560 }
11561
11562     { test "$extra_verbose" = "yes" && cat << \EOF
11563     Defining HAVE_BERKELEY_DB
11564 EOF
11565 cat >> confdefs.h <<\EOF
11566 #define HAVE_BERKELEY_DB 1
11567 EOF
11568 }
11569
11570     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11571   else with_database_berkdb=no
11572   fi
11573 fi
11574
11575 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11576      != "no no no"; then
11577   { test "$extra_verbose" = "yes" && cat << \EOF
11578     Defining HAVE_DATABASE
11579 EOF
11580 cat >> confdefs.h <<\EOF
11581 #define HAVE_DATABASE 1
11582 EOF
11583 }
11584
11585   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11586    echo "    xemacs will be linked with \"database.o\""
11587  fi
11588 fi
11589
11590 if test "$with_socks" = "yes"; then
11591   
11592 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11593 echo "configure:11594: checking for SOCKSinit in -lsocks" >&5
11594 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11595
11596 xe_check_libs=" -lsocks "
11597 cat > conftest.$ac_ext <<EOF
11598 #line 11599 "configure"
11599 #include "confdefs.h"
11600 /* Override any gcc2 internal prototype to avoid an error.  */
11601 /* We use char because int might match the return type of a gcc2
11602     builtin and then its argument prototype would still apply.  */
11603 char SOCKSinit();
11604
11605 int main() {
11606 SOCKSinit()
11607 ; return 0; }
11608 EOF
11609 if { (eval echo configure:11610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11610   rm -rf conftest*
11611   eval "ac_cv_lib_$ac_lib_var=yes"
11612 else
11613   echo "configure: failed program was:" >&5
11614   cat conftest.$ac_ext >&5
11615   rm -rf conftest*
11616   eval "ac_cv_lib_$ac_lib_var=no"
11617 fi
11618 rm -f conftest*
11619 xe_check_libs=""
11620
11621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11622   echo "$ac_t""yes" 1>&6
11623     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11624     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11625   { test "$extra_verbose" = "yes" && cat << EOF
11626     Defining $ac_tr_lib
11627 EOF
11628 cat >> confdefs.h <<EOF
11629 #define $ac_tr_lib 1
11630 EOF
11631 }
11632
11633   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11634
11635 else
11636   echo "$ac_t""no" 1>&6
11637 fi
11638
11639
11640   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11641     Defining HAVE_SOCKS
11642 EOF
11643 cat >> confdefs.h <<\EOF
11644 #define HAVE_SOCKS 1
11645 EOF
11646 }
11647
11648 fi
11649
11650 if test "$usage_tracking" = "yes"; then
11651   { test "$extra_verbose" = "yes" && cat << \EOF
11652     Defining USAGE_TRACKING
11653 EOF
11654 cat >> confdefs.h <<\EOF
11655 #define USAGE_TRACKING 1
11656 EOF
11657 }
11658
11659   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11660 fi
11661
11662 for ac_hdr in dlfcn.h
11663 do
11664 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11665 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11666 echo "configure:11667: checking for $ac_hdr" >&5
11667
11668 cat > conftest.$ac_ext <<EOF
11669 #line 11670 "configure"
11670 #include "confdefs.h"
11671 #include <$ac_hdr>
11672 EOF
11673 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11674 { (eval echo configure:11675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11675 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11676 if test -z "$ac_err"; then
11677   rm -rf conftest*
11678   eval "ac_cv_header_$ac_safe=yes"
11679 else
11680   echo "$ac_err" >&5
11681   echo "configure: failed program was:" >&5
11682   cat conftest.$ac_ext >&5
11683   rm -rf conftest*
11684   eval "ac_cv_header_$ac_safe=no"
11685 fi
11686 rm -f conftest*
11687 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11688   echo "$ac_t""yes" 1>&6
11689     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11690   { test "$extra_verbose" = "yes" && cat << EOF
11691     Defining $ac_tr_hdr
11692 EOF
11693 cat >> confdefs.h <<EOF
11694 #define $ac_tr_hdr 1
11695 EOF
11696 }
11697  have_dlfcn=yes
11698   { test "$extra_verbose" = "yes" && cat << \EOF
11699     Defining HAVE_DLFCN_H
11700 EOF
11701 cat >> confdefs.h <<\EOF
11702 #define HAVE_DLFCN_H 1
11703 EOF
11704 }
11705
11706 else
11707   echo "$ac_t""no" 1>&6
11708 fi
11709 done
11710
11711 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11712 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11713 echo "configure:11714: checking for dlopen in -ldl" >&5
11714 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11715
11716 xe_check_libs=" -ldl "
11717 cat > conftest.$ac_ext <<EOF
11718 #line 11719 "configure"
11719 #include "confdefs.h"
11720 /* Override any gcc2 internal prototype to avoid an error.  */
11721 /* We use char because int might match the return type of a gcc2
11722     builtin and then its argument prototype would still apply.  */
11723 char dlopen();
11724
11725 int main() {
11726 dlopen()
11727 ; return 0; }
11728 EOF
11729 if { (eval echo configure:11730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11730   rm -rf conftest*
11731   eval "ac_cv_lib_$ac_lib_var=yes"
11732 else
11733   echo "configure: failed program was:" >&5
11734   cat conftest.$ac_ext >&5
11735   rm -rf conftest*
11736   eval "ac_cv_lib_$ac_lib_var=no"
11737 fi
11738 rm -f conftest*
11739 xe_check_libs=""
11740
11741 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11742   echo "$ac_t""yes" 1>&6
11743   { test "$extra_verbose" = "yes" && cat << \EOF
11744     Defining HAVE_DLOPEN
11745 EOF
11746 cat >> confdefs.h <<\EOF
11747 #define HAVE_DLOPEN 1
11748 EOF
11749 }
11750  DLL_LIB=dl;  with_modules=yes
11751 else
11752   echo "$ac_t""no" 1>&6
11753 fi
11754
11755  }
11756 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11757 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11758 echo "configure:11759: checking for _dlopen in -lc" >&5
11759 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11760
11761 xe_check_libs=" -lc "
11762 cat > conftest.$ac_ext <<EOF
11763 #line 11764 "configure"
11764 #include "confdefs.h"
11765 /* Override any gcc2 internal prototype to avoid an error.  */
11766 /* We use char because int might match the return type of a gcc2
11767     builtin and then its argument prototype would still apply.  */
11768 char _dlopen();
11769
11770 int main() {
11771 _dlopen()
11772 ; return 0; }
11773 EOF
11774 if { (eval echo configure:11775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11775   rm -rf conftest*
11776   eval "ac_cv_lib_$ac_lib_var=yes"
11777 else
11778   echo "configure: failed program was:" >&5
11779   cat conftest.$ac_ext >&5
11780   rm -rf conftest*
11781   eval "ac_cv_lib_$ac_lib_var=no"
11782 fi
11783 rm -f conftest*
11784 xe_check_libs=""
11785
11786 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11787   echo "$ac_t""yes" 1>&6
11788   { test "$extra_verbose" = "yes" && cat << \EOF
11789     Defining HAVE_DLOPEN
11790 EOF
11791 cat >> confdefs.h <<\EOF
11792 #define HAVE_DLOPEN 1
11793 EOF
11794 }
11795  DLL_LIB=;   with_modules=yes
11796 else
11797   echo "$ac_t""no" 1>&6
11798 fi
11799
11800  }
11801 test -z "$with_modules" && test ! -z "$have_dlfcn" && { 
11802 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11803 echo "configure:11804: checking for dlopen in -lc" >&5
11804 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11805
11806 xe_check_libs=" -lc "
11807 cat > conftest.$ac_ext <<EOF
11808 #line 11809 "configure"
11809 #include "confdefs.h"
11810 /* Override any gcc2 internal prototype to avoid an error.  */
11811 /* We use char because int might match the return type of a gcc2
11812     builtin and then its argument prototype would still apply.  */
11813 char dlopen();
11814
11815 int main() {
11816 dlopen()
11817 ; return 0; }
11818 EOF
11819 if { (eval echo configure:11820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11820   rm -rf conftest*
11821   eval "ac_cv_lib_$ac_lib_var=yes"
11822 else
11823   echo "configure: failed program was:" >&5
11824   cat conftest.$ac_ext >&5
11825   rm -rf conftest*
11826   eval "ac_cv_lib_$ac_lib_var=no"
11827 fi
11828 rm -f conftest*
11829 xe_check_libs=""
11830
11831 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11832   echo "$ac_t""yes" 1>&6
11833   { test "$extra_verbose" = "yes" && cat << \EOF
11834     Defining HAVE_DLOPEN
11835 EOF
11836 cat >> confdefs.h <<\EOF
11837 #define HAVE_DLOPEN 1
11838 EOF
11839 }
11840  DLL_LIB=;   with_modules=yes
11841 else
11842   echo "$ac_t""no" 1>&6
11843 fi
11844
11845  }
11846 test -z "$with_modules" && { 
11847 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11848 echo "configure:11849: checking for shl_load in -ldld" >&5
11849 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11850
11851 xe_check_libs=" -ldld "
11852 cat > conftest.$ac_ext <<EOF
11853 #line 11854 "configure"
11854 #include "confdefs.h"
11855 /* Override any gcc2 internal prototype to avoid an error.  */
11856 /* We use char because int might match the return type of a gcc2
11857     builtin and then its argument prototype would still apply.  */
11858 char shl_load();
11859
11860 int main() {
11861 shl_load()
11862 ; return 0; }
11863 EOF
11864 if { (eval echo configure:11865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11865   rm -rf conftest*
11866   eval "ac_cv_lib_$ac_lib_var=yes"
11867 else
11868   echo "configure: failed program was:" >&5
11869   cat conftest.$ac_ext >&5
11870   rm -rf conftest*
11871   eval "ac_cv_lib_$ac_lib_var=no"
11872 fi
11873 rm -f conftest*
11874 xe_check_libs=""
11875
11876 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11877   echo "$ac_t""yes" 1>&6
11878   { test "$extra_verbose" = "yes" && cat << \EOF
11879     Defining HAVE_SHL_LOAD
11880 EOF
11881 cat >> confdefs.h <<\EOF
11882 #define HAVE_SHL_LOAD 1
11883 EOF
11884 }
11885  DLL_LIB=dld; with_modules=yes
11886 else
11887   echo "$ac_t""no" 1>&6
11888 fi
11889
11890  }
11891 test -z "$with_modules" && { 
11892 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11893 echo "configure:11894: checking for dld_init in -ldld" >&5
11894 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11895
11896 xe_check_libs=" -ldld "
11897 cat > conftest.$ac_ext <<EOF
11898 #line 11899 "configure"
11899 #include "confdefs.h"
11900 /* Override any gcc2 internal prototype to avoid an error.  */
11901 /* We use char because int might match the return type of a gcc2
11902     builtin and then its argument prototype would still apply.  */
11903 char dld_init();
11904
11905 int main() {
11906 dld_init()
11907 ; return 0; }
11908 EOF
11909 if { (eval echo configure:11910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11910   rm -rf conftest*
11911   eval "ac_cv_lib_$ac_lib_var=yes"
11912 else
11913   echo "configure: failed program was:" >&5
11914   cat conftest.$ac_ext >&5
11915   rm -rf conftest*
11916   eval "ac_cv_lib_$ac_lib_var=no"
11917 fi
11918 rm -f conftest*
11919 xe_check_libs=""
11920
11921 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11922   echo "$ac_t""yes" 1>&6
11923   { test "$extra_verbose" = "yes" && cat << \EOF
11924     Defining HAVE_DLD_INIT
11925 EOF
11926 cat >> confdefs.h <<\EOF
11927 #define HAVE_DLD_INIT 1
11928 EOF
11929 }
11930  DLL_LIB=dld; with_modules=yes
11931 else
11932   echo "$ac_t""no" 1>&6
11933 fi
11934
11935  }
11936 if test "$with_modules" = "yes"; then
11937   
11938 dll_ld=
11939 dll_ldflags=
11940 dll_cflags=
11941 dll_post=
11942 dll_ldo="-o"
11943 ld_dynamic_link_flags=
11944 xehost=$canonical
11945 xealias=$internal_configuration
11946
11947 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
11948 echo "configure:11949: checking how to build dynamic libraries for ${xehost}" >&5
11949 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
11950 case "$xehost" in
11951 *-*-linux-gnu*) ;;
11952 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
11953 esac
11954
11955 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
11956 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
11957 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
11958
11959 case "$xehost_os" in
11960 aix3*)
11961   # AIX sometimes has problems with the GCC collect2 program.  For some
11962   # reason, if we set the COLLECT_NAMES environment variable, the problems
11963   # vanish in a puff of smoke.
11964   if test "${COLLECT_NAMES+set}" != set; then
11965     COLLECT_NAMES=
11966     export COLLECT_NAMES
11967   fi
11968   ;;
11969 esac
11970
11971 # Now see if the compiler is really GCC.
11972 if test "$GCC" = "yes"; then
11973   XEGCC=yes
11974 else
11975   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
11976 echo "configure:11977: checking checking whether we are using GNU C" >&5
11977   cat > conftest.$ac_ext <<EOF
11978 #line 11979 "configure"
11979 #include "confdefs.h"
11980
11981 #ifdef __GNUC__
11982   yes;
11983 #endif
11984
11985 EOF
11986 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11987   egrep "yes" >/dev/null 2>&1; then
11988   rm -rf conftest*
11989   XEGCC=yes
11990 else
11991   rm -rf conftest*
11992   XEGCC=no
11993 fi
11994 rm -f conftest*
11995
11996   echo "$ac_t""${XEGCC}" 1>&6
11997 fi
11998
11999 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
12000 echo "configure:12001: checking how to produce PIC code" >&5
12001 wl=
12002
12003 can_build_shared=yes
12004 if test "$XEGCC" = yes; then
12005   wl='-Wl,'
12006
12007   case "$xehost_os" in
12008   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
12009     # PIC is the default for these OSes.
12010     ;;
12011
12012   os2*)
12013     # We can build DLLs from non-PIC.
12014     ;;
12015   amigaos*)
12016     # FIXME: we need at least 68020 code to build shared libraries, but
12017     # adding the `-m68020' flag to GCC prevents building anything better,
12018     # like `-m68040'.
12019     dll_cflags='-m68020 -resident32 -malways-restore-a4'
12020     ;;
12021   *)
12022     dll_cflags='-fPIC'
12023     ;;
12024   esac
12025 else
12026   # PORTME Check for PIC flags for the system compiler.
12027   case "$xehost_os" in
12028   hpux9* | hpux10*)
12029     # Is there a better link_static_flag that works with the bundled CC?
12030     wl='-Wl,'
12031     dll_cflags='+Z'
12032     ;;
12033
12034   irix5* | irix6*)
12035     wl='-Wl,'
12036     # PIC (with -KPIC) is the default.
12037     ;;
12038
12039   os2*)
12040     # We can build DLLs from non-PIC.
12041     ;;
12042
12043   osf3* | osf4*)
12044     # All OSF/1 code is PIC.
12045     wl='-Wl,'
12046     ;;
12047
12048   sco3.2v5*)
12049     dll_cflags='-belf -Kpic'
12050     wl='-Wl,'
12051     ;;
12052
12053   unixware*)
12054     dll_cflags="-KPIC"
12055     wl="-Wl,"
12056     ;;
12057
12058   sysv4*)
12059     dll_cflags="-KPIC"
12060     wl="-Wl,"
12061     ;;
12062
12063   sysv5*)
12064     dll_cflags="-KPIC"
12065     wl="-Wl,"
12066     ;;
12067
12068   solaris2*)
12069     dll_cflags='-KPIC'
12070     wl='-Wl,'
12071     ;;
12072
12073   sunos4*)
12074     dll_cflags='-PIC'
12075     wl='-Qoption ld '
12076     ;;
12077
12078   uts4*)
12079     dll_cflags='-pic'
12080     ;;
12081
12082   *)
12083     can_build_shared=no
12084     ;;
12085   esac
12086 fi
12087
12088 if test -n "$dll_cflags"; then
12089   echo "$ac_t""${dll_cflags}" 1>&6
12090   
12091   # Check to make sure the dll_cflags actually works.
12092   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12093 echo "configure:12094: checking if PIC flag ${dll_cflags} really works" >&5
12094   save_CFLAGS="$CFLAGS"
12095   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12096   cat > conftest.$ac_ext <<EOF
12097 #line 12098 "configure"
12098 #include "confdefs.h"
12099
12100 int main() {
12101 int x=0;
12102 ; return 0; }
12103 EOF
12104 if { (eval echo configure:12105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12105   rm -rf conftest*
12106   
12107     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12108     # reports no error.  So, we need to grep stderr for (Bundled).
12109     if grep '(Bundled)' config.log >/dev/null; then
12110       echo "$ac_t""no" 1>&6
12111       can_build_shared=no
12112       dll_cflags=
12113     else
12114       echo "$ac_t""yes" 1>&6
12115     fi
12116 else
12117   echo "configure: failed program was:" >&5
12118   cat conftest.$ac_ext >&5
12119   rm -rf conftest*
12120   echo "$ac_t""no" 1>&6
12121     can_build_shared=no
12122     dll_cflags=
12123 fi
12124 rm -f conftest*
12125   CFLAGS="$save_CFLAGS"
12126 else
12127   echo "$ac_t""none" 1>&6
12128 fi
12129
12130 if test "$can_build_shared" = "yes"; then
12131 cc_produces_so=no
12132 xldf=
12133 xcldf=
12134 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12135 echo "configure:12136: checking if C compiler can produce shared libraries" >&5
12136 if test "$XEGCC" = yes; then
12137   xcldf="-shared"
12138   xldf="-shared"
12139 else # Not using GCC
12140   case "$xehost_os" in
12141     aix3* | aix4*)
12142       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12143       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12144       ;;
12145
12146     freebsd2* | netbsd* | openbsd*)
12147       xldf="-Bshareable"
12148       xcldf="${wl}-Bshareable"
12149       ;;
12150
12151     freebsd3*)
12152       xcldf="-shared"
12153       ;;
12154
12155     hpux*)
12156       xldf="-b +s"
12157       xcldf="${wl}-b ${wl}+s"
12158       ;;
12159
12160     irix5* | irix6* | osf3* | osf4*)
12161       xcldf="${wl}-shared"
12162       xldf="-shared"
12163       ;;
12164
12165     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12166       xcldf="-G"
12167       xldf="-G"
12168       ;;
12169
12170     sunos4*)
12171       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12172       xldf="-assert pure-text -Bstatic"
12173       ;;
12174   esac
12175 fi # End if if we are using gcc
12176
12177 if test -n "$xcldf"; then
12178   save_LDFLAGS=$LDFLAGS
12179   save_LIBS=$LIBS
12180   save_xe_libs=$xe_libs
12181   LDFLAGS="$xcldf $LDFLAGS"
12182   LIBS=
12183   xe_libs=
12184   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12185   cat > conftest.$ac_ext <<EOF
12186 #line 12187 "configure"
12187 #include "confdefs.h"
12188
12189 int main() {
12190 int x=0;
12191 ; return 0; }
12192 EOF
12193 if { (eval echo configure:12194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12194   rm -rf conftest*
12195   cc_produces_so=yes
12196 else
12197   echo "configure: failed program was:" >&5
12198   cat conftest.$ac_ext >&5
12199   rm -rf conftest*
12200   cc_produces_so=no
12201 fi
12202 rm -f conftest*
12203   LDFLAGS=$save_LDFLAGS
12204   LIBS=$save_LIBS
12205   xe_libs=$save_xe_libs
12206   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12207 else
12208   cc_produces_so=no
12209 fi
12210 echo "$ac_t""${cc_produces_so}" 1>&6
12211
12212 LTLD=$LD
12213 if test -z "$LTLD"; then
12214   ac_prog=ld
12215   if test "$XEGCC" = yes; then
12216     # Check if gcc -print-prog-name=ld gives a path.
12217     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12218 echo "configure:12219: checking for ld used by GCC" >&5
12219     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12220     case "$ac_prog" in
12221     # Accept absolute paths.
12222     /*)
12223       if test -z "$LTLD"; then
12224         case "$ac_prog" in
12225           *gcc-lib*) LTLD="$CC"
12226                      ;;
12227           *)         LTLD="$ac_prog"
12228                      ;;
12229         esac
12230       fi
12231       ;;
12232     "")
12233       # If it fails, then pretend we aren't using GCC.
12234       ac_prog=ld
12235       ;;
12236     *)
12237       # If it is relative, then search for the first ld in PATH.
12238       with_gnu_ld=unknown
12239       ;;
12240     esac
12241   else
12242     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12243 echo "configure:12244: checking for GNU ld" >&5
12244   fi
12245
12246   if test -z "$LTLD"; then
12247     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12248     for ac_dir in $PATH; do
12249       test -z "$ac_dir" && ac_dir=.
12250       if test -f "$ac_dir/$ac_prog"; then
12251         LTLD="$ac_dir/$ac_prog"
12252         # Check to see if the program is GNU ld.  I'd rather use --version,
12253         # but apparently some GNU ld's only accept -v.
12254         # Break only if it was the GNU/non-GNU ld that we prefer.
12255         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12256           xe_gnu_ld=yes
12257         else
12258           xe_gnu_ld=no
12259         fi
12260       fi
12261     done
12262     IFS="$ac_save_ifs"
12263   fi
12264
12265   if test -n "$LTLD"; then
12266     echo "$ac_t""${LTLD}" 1>&6
12267   else
12268     echo "$ac_t""no" 1>&6
12269   fi
12270
12271   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12272     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12273     exit 1
12274   fi
12275 fi
12276
12277 ld_dynamic_link_flags=
12278
12279 # Check to see if it really is or isn't GNU ld.
12280 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12281 echo "configure:12282: checking if the linker is GNU ld" >&5
12282 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12283 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12284   xe_gnu_ld=yes
12285 else
12286   xe_gnu_ld=no
12287 fi
12288 echo "$ac_t""${xe_gnu_ld}" 1>&6
12289
12290 case "$xehost_os" in
12291   amigaos* | sunos4*)
12292     # On these operating systems, we should treat GNU ld like the system ld.
12293     gnu_ld_acts_native=yes
12294     ;;
12295   *)
12296     gnu_ld_acts_native=no
12297     ;;
12298 esac
12299
12300 if test "$cc_produces_so" = "yes"; then
12301   dll_ld=$CC
12302   dll_ldflags=$xcldf
12303   can_build_shared=yes
12304 else
12305   # OK - only NOW do we futz about with ld.
12306   # See if the linker supports building shared libraries.
12307   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12308 echo "configure:12309: checking whether the linker supports shared libraries" >&5
12309   dll_ld=$CC
12310   dll_ldflags=$LDFLAGS
12311   ld_shlibs=yes
12312   can_build_shared=yes
12313   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12314     # See if GNU ld supports shared libraries.
12315     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12316       dll_ld=$CC
12317       dll_ldflags="-shared"
12318       ld_shlibs=yes
12319     else
12320       ld_shlibs=no
12321     fi
12322   else
12323     # PORTME fill in a description of your system's linker (not GNU ld)
12324     case "$xehost_os" in
12325     aix3*)
12326       dll_ld=$LTLD
12327       dll_ldflags=$xldf
12328       ;;
12329
12330     aix4*)
12331       dll_ldflags=$xcldf
12332       ;;
12333
12334     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12335     # support.  Future versions do this automatically, but an explicit c++rt0.o
12336     # doesn't break anything, and helps significantly (at the cost of a little
12337     # extra space).
12338     freebsd2.2*)
12339       dll_ld=$LTLD
12340       dll_ldflags=$xldf
12341       dll_post="/usr/lib/c++rt0.o"
12342       ;;
12343
12344     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12345     freebsd2*)
12346       dll_ld=$LTLD
12347       dll_ldflags="-Bshareable"
12348       ;;
12349
12350     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12351     freebsd3*)
12352       dll_ldflags="-shared"
12353       ;;
12354
12355     hpux*)
12356       dll_ld=$LTLD
12357       dll_ldflags=$xldf
12358       ;;
12359
12360     irix5* | irix6*)
12361       dll_ld=$LTLD
12362       dll_ldflags=$xldf
12363       ;;
12364
12365     netbsd*)
12366       # Tested with NetBSD 1.2 ld
12367       dll_ld=$LTLD
12368       dll_ldflags=$xldf
12369       ;;
12370
12371     openbsd*)
12372       dll_ld=$LTLD
12373       dll_ldflags=$xldf
12374       ;;
12375
12376     osf3* | osf4*)
12377       dll_ld=$LTLD
12378       dll_ldflags=$xldf
12379       ;;
12380
12381     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12382     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12383       dll_ld=$LTLD
12384       case "$dll_ld" in
12385         *gcc*) dll_ldflags="-shared"
12386                dll_ld=$CC
12387                ;;
12388         *)     dll_ldflags="-G"
12389                ;;
12390       esac
12391       ;;
12392
12393     sunos4*)
12394       if test "$XEGCC" = yes; then
12395         dll_ld=$CC
12396       else
12397         dll_ld=$LTLD
12398       fi
12399       dll_ldflags=$xldf
12400       ;;
12401
12402     uts4*)
12403       dll_ld=$LTLD
12404       dll_ldflags="-G"
12405       ;;
12406
12407     bsdi*)
12408       dll_ldflags="-r"
12409       dll_ld="shlicc2"
12410       ;;
12411
12412     *)
12413       ld_shlibs=no
12414       can_build_shared=no
12415       ;;
12416     esac
12417   fi
12418   echo "$ac_t""${ld_shlibs}" 1>&6
12419   if test "$ld_shlibs" = "no"; then
12420     can_build_shared=no
12421   fi
12422 fi # End of if cc_produces_so = no
12423
12424
12425 if test "$xe_gnu_ld" = yes; then
12426   if test "$ld_shlibs" = yes; then
12427     ld_dynamic_link_flags="${wl}-export-dynamic"
12428   fi
12429 fi
12430
12431 if test -z "$ld_dynamic_link_flags"; then
12432   case "$xehost_os" in
12433   aix3*)
12434     ld_dynamic_link_flags=
12435     ;;
12436
12437   aix4*)
12438     ld_dynamic_link_flags=
12439     ;;
12440
12441   freebsd2.2*)
12442     ld_dynamic_link_flags=
12443     ;;
12444
12445   freebsd2*)
12446     ld_dynamic_link_flags=
12447     ;;
12448
12449   freebsd3*)
12450     ld_dynamic_link_flags=
12451     ;;
12452
12453   hpux*)
12454     ld_dynamic_link_flags="${wl}-E"
12455     ;;
12456
12457   irix5* | irix6*)
12458     ld_dynamic_link_flags=
12459     ;;
12460
12461   netbsd*)
12462     ld_dynamic_link_flags=
12463     ;;
12464
12465   openbsd*)
12466     ld_dynamic_link_flags=
12467     ;;
12468
12469   osf3* | osf4*)
12470     ld_dynamic_link_flags=
12471     ;;
12472
12473   solaris2* | solaris7*)
12474     ld_dynamic_link_flags="${wl}-Bdynamic"
12475     ;;
12476
12477   sco3.2v5* | unixware* | sysv5* | sysv4*)
12478     ld_dynamic_link_flags="${wl}-Bexport"
12479     ;;
12480
12481   sunos4*)
12482     ld_dynamic_link_flags=
12483     ;;
12484
12485   uts4*)
12486     ld_dynamic_link_flags=
12487     ;;
12488
12489   bsdi*)
12490     ld_dynamic_link_flags=
12491     ;;
12492
12493   esac
12494 fi # End of if -z ld_dynamic_link_flags
12495 fi # End of if test "$can_build_shared" = "yes"
12496
12497
12498
12499
12500
12501
12502
12503
12504   if test "$can_build_shared" = "yes"; then
12505     { test "$extra_verbose" = "yes" && cat << \EOF
12506     Defining HAVE_SHLIB
12507 EOF
12508 cat >> confdefs.h <<\EOF
12509 #define HAVE_SHLIB 1
12510 EOF
12511 }
12512
12513     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12514    echo "    xemacs will be linked with \"sysdll.o\""
12515  fi
12516     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12517    echo "    xemacs will be linked with \"emodules.o\""
12518  fi
12519     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12520     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12521     for ac_func in dlerror _dlerror
12522 do
12523 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12524 echo "configure:12525: checking for $ac_func" >&5
12525
12526 cat > conftest.$ac_ext <<EOF
12527 #line 12528 "configure"
12528 #include "confdefs.h"
12529 /* System header to define __stub macros and hopefully few prototypes,
12530     which can conflict with char $ac_func(); below.  */
12531 #include <assert.h>
12532 /* Override any gcc2 internal prototype to avoid an error.  */
12533 /* We use char because int might match the return type of a gcc2
12534     builtin and then its argument prototype would still apply.  */
12535 char $ac_func();
12536
12537 int main() {
12538
12539 /* The GNU C library defines this for functions which it implements
12540     to always fail with ENOSYS.  Some functions are actually named
12541     something starting with __ and the normal name is an alias.  */
12542 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12543 choke me
12544 #else
12545 $ac_func();
12546 #endif
12547
12548 ; return 0; }
12549 EOF
12550 if { (eval echo configure:12551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12551   rm -rf conftest*
12552   eval "ac_cv_func_$ac_func=yes"
12553 else
12554   echo "configure: failed program was:" >&5
12555   cat conftest.$ac_ext >&5
12556   rm -rf conftest*
12557   eval "ac_cv_func_$ac_func=no"
12558 fi
12559 rm -f conftest*
12560
12561 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12562   echo "$ac_t""yes" 1>&6
12563     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12564   { test "$extra_verbose" = "yes" && cat << EOF
12565     Defining $ac_tr_func
12566 EOF
12567 cat >> confdefs.h <<EOF
12568 #define $ac_tr_func 1
12569 EOF
12570 }
12571  
12572 else
12573   echo "$ac_t""no" 1>&6
12574 fi
12575 done
12576
12577   else
12578     echo "configure: warning: disabling shared library support" 1>&2
12579     with_modules=no
12580   fi
12581 fi
12582
12583 cat > conftest.$ac_ext <<EOF
12584 #line 12585 "configure"
12585 #include "confdefs.h"
12586 int main(int c,char *v[]){return 0;}
12587 EOF
12588 if { (eval echo configure:12589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12589 then
12590   :
12591 else
12592   conftest_rc="$?"
12593   echo "configure: failed program was:" >&5
12594   cat conftest.$ac_ext >&5
12595   rm -fr conftest*
12596   
12597   echo ""
12598   echo "*** PANIC *** The C compiler can no longer build working executables."
12599   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12600   echo "*** PANIC *** The most likely reason for this problem is that configure"
12601   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12602   echo "*** PANIC *** found at run time."
12603   echo "*** PANIC ***"
12604   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12605   echo "*** PANIC *** On other systems, try telling configure where to find the"
12606   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12607   echo "*** PANIC ***"
12608   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12609   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12610   echo "*** PANIC *** on your system.  Don't do that."
12611   exit 1
12612 fi
12613 rm -fr conftest*
12614
12615 if test "$win32_processes" = "yes"; then
12616   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12617    echo "    xemacs will be linked with \"process-nt.o\""
12618  fi
12619 else
12620   { test "$extra_verbose" = "yes" && cat << \EOF
12621     Defining HAVE_UNIX_PROCESSES
12622 EOF
12623 cat >> confdefs.h <<\EOF
12624 #define HAVE_UNIX_PROCESSES 1
12625 EOF
12626 }
12627
12628   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12629    echo "    xemacs will be linked with \"process-unix.o\""
12630  fi
12631 fi
12632
12633
12634
12635 T=""
12636 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12637 CFLAGS="$T"
12638
12639
12640 T=""
12641 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12642 extra_objs="$T"
12643
12644
12645 T=""
12646 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
12647 c_switch_general="$T"
12648
12649
12650 T=""
12651 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12652 c_switch_window_system="$T"
12653
12654
12655 T=""
12656 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12657 c_switch_all="$T"
12658
12659
12660 T=""
12661 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
12662 ld_switch_general="$T"
12663
12664
12665 T=""
12666 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12667 ld_switch_window_system="$T"
12668
12669
12670 T=""
12671 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12672 ld_switch_all="$T"
12673
12674
12675 T=""
12676 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12677 ld_libs_general="$T"
12678
12679
12680 T=""
12681 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
12682 ld_libs_window_system="$T"
12683
12684
12685 T=""
12686 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12687 ld_libs_all="$T"
12688
12689
12690
12691 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12692 internal_makefile_list="Makefile.in"
12693 SUBDIR_MAKEFILES=''
12694 test -d lock || mkdir lock
12695 for dir in $MAKE_SUBDIR; do
12696   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12697         test -d "$d" || mkdir "$d"; cd "$d"
12698       done ) ;;
12699    * ) test -d "$dir" || mkdir "$dir" ;;
12700   esac
12701   
12702 T=""
12703 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12704 SUBDIR_MAKEFILES="$T"
12705
12706   
12707 T=""
12708 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12709 internal_makefile_list="$T"
12710
12711 done
12712
12713
12714
12715
12716 for dir in src/s src/m; do
12717   if test ! -d "$dir" ; then
12718     echo Making symbolic link to "$srcdir/$dir"
12719     ${LN_S} "$srcdir/$dir" "$dir"
12720   fi
12721 done
12722
12723 if test "$extra_verbose" = "yes"; then
12724   echo ""
12725   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
12726   echo ""
12727 fi
12728
12729 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12730   echo "creating src/gdbinit"; echo ""
12731   echo "source $srcdir/src/gdbinit" > src/gdbinit
12732 fi
12733
12734 if test "$__SUNPRO_C" = "yes"; then
12735   echo "creating .sbinit"; echo ""
12736   ( echo "# For use with Sun WorkShop's Source browser."
12737     echo "# See sbquery(1) and sbinit(4) for more information"
12738     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12739   ) > .sbinit
12740 fi
12741
12742 rm -f core
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762 PREFIX=$prefix
12763 while true; do
12764   case "$PREFIX" in
12765     *\$* ) eval "PREFIX=$PREFIX" ;;
12766     *) break ;;
12767   esac
12768 done
12769
12770
12771
12772
12773 EXEC_PREFIX=$exec_prefix
12774 while true; do
12775   case "$EXEC_PREFIX" in
12776     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12777     *) break ;;
12778   esac
12779 done
12780
12781
12782
12783
12784 INFODIR=$infodir
12785 while true; do
12786   case "$INFODIR" in
12787     *\$* ) eval "INFODIR=$INFODIR" ;;
12788     *) break ;;
12789   esac
12790 done
12791
12792
12793
12794
12795 INFOPATH=$infopath
12796 while true; do
12797   case "$INFOPATH" in
12798     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12799     *) break ;;
12800   esac
12801 done
12802
12803
12804
12805
12806 PACKAGE_PATH=$package_path
12807 while true; do
12808   case "$PACKAGE_PATH" in
12809     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12810     *) break ;;
12811   esac
12812 done
12813
12814
12815
12816
12817 LISPDIR=$lispdir
12818 while true; do
12819   case "$LISPDIR" in
12820     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12821     *) break ;;
12822   esac
12823 done
12824
12825
12826
12827
12828 MODULEDIR=$moduledir
12829 while true; do
12830   case "$MODULEDIR" in
12831     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12832     *) break ;;
12833   esac
12834 done
12835
12836
12837
12838
12839 SITELISPDIR=$sitelispdir
12840 while true; do
12841   case "$SITELISPDIR" in
12842     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12843     *) break ;;
12844   esac
12845 done
12846
12847
12848
12849
12850 SITEMODULEDIR=$sitemoduledir
12851 while true; do
12852   case "$SITEMODULEDIR" in
12853     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12854     *) break ;;
12855   esac
12856 done
12857
12858
12859
12860
12861 ETCDIR=$etcdir
12862 while true; do
12863   case "$ETCDIR" in
12864     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12865     *) break ;;
12866   esac
12867 done
12868
12869
12870
12871
12872 LOCKDIR=$lockdir
12873 while true; do
12874   case "$LOCKDIR" in
12875     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12876     *) break ;;
12877   esac
12878 done
12879
12880
12881
12882
12883 DOCDIR=$docdir
12884 while true; do
12885   case "$DOCDIR" in
12886     *\$* ) eval "DOCDIR=$DOCDIR" ;;
12887     *) break ;;
12888   esac
12889 done
12890
12891
12892
12893
12894 ARCHLIBDIR=$archlibdir
12895 while true; do
12896   case "$ARCHLIBDIR" in
12897     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12898     *) break ;;
12899   esac
12900 done
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12922
12923
12924
12925
12926
12927
12928
12929 : ${XEMACS_CC:=$CC}
12930
12931
12932 if test "$with_prefix" = "yes"; then
12933   { test "$extra_verbose" = "yes" && cat << \EOF
12934     Defining PREFIX_USER_DEFINED
12935 EOF
12936 cat >> confdefs.h <<\EOF
12937 #define PREFIX_USER_DEFINED 1
12938 EOF
12939 }
12940
12941 fi
12942
12943 if test "$with_site_lisp" = "no"; then
12944   { test "$extra_verbose" = "yes" && cat << \EOF
12945     Defining INHIBIT_SITE_LISP
12946 EOF
12947 cat >> confdefs.h <<\EOF
12948 #define INHIBIT_SITE_LISP 1
12949 EOF
12950 }
12951
12952 fi
12953 if test "$with_site_modules" = "no"; then
12954   { test "$extra_verbose" = "yes" && cat << \EOF
12955     Defining INHIBIT_SITE_MODULES
12956 EOF
12957 cat >> confdefs.h <<\EOF
12958 #define INHIBIT_SITE_MODULES 1
12959 EOF
12960 }
12961
12962 fi
12963
12964
12965 T=""
12966 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12967 ac_configure_args="$T"
12968
12969 { test "$extra_verbose" = "yes" && cat << EOF
12970     Defining EMACS_CONFIGURATION = "$canonical"
12971 EOF
12972 cat >> confdefs.h <<EOF
12973 #define EMACS_CONFIGURATION "$canonical"
12974 EOF
12975 }
12976
12977 { test "$extra_verbose" = "yes" && cat << EOF
12978     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12979 EOF
12980 cat >> confdefs.h <<EOF
12981 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12982 EOF
12983 }
12984
12985 { test "$extra_verbose" = "yes" && cat << EOF
12986     Defining config_machfile = "$machfile"
12987 EOF
12988 cat >> confdefs.h <<EOF
12989 #define config_machfile "$machfile"
12990 EOF
12991 }
12992
12993 { test "$extra_verbose" = "yes" && cat << EOF
12994     Defining config_opsysfile = "$opsysfile"
12995 EOF
12996 cat >> confdefs.h <<EOF
12997 #define config_opsysfile "$opsysfile"
12998 EOF
12999 }
13000
13001
13002
13003 null_string=""
13004 { test "$extra_verbose" = "yes" && cat << EOF
13005     Defining LD_SWITCH_X_SITE = $null_string
13006 EOF
13007 cat >> confdefs.h <<EOF
13008 #define LD_SWITCH_X_SITE $null_string
13009 EOF
13010 }
13011
13012 { test "$extra_verbose" = "yes" && cat << EOF
13013     Defining LD_SWITCH_X_SITE_AUX = $null_string
13014 EOF
13015 cat >> confdefs.h <<EOF
13016 #define LD_SWITCH_X_SITE_AUX $null_string
13017 EOF
13018 }
13019
13020 { test "$extra_verbose" = "yes" && cat << EOF
13021     Defining C_SWITCH_X_SITE = $null_string
13022 EOF
13023 cat >> confdefs.h <<EOF
13024 #define C_SWITCH_X_SITE $null_string
13025 EOF
13026 }
13027
13028 { test "$extra_verbose" = "yes" && cat << EOF
13029     Defining LD_SWITCH_SITE = $null_string
13030 EOF
13031 cat >> confdefs.h <<EOF
13032 #define LD_SWITCH_SITE $null_string
13033 EOF
13034 }
13035
13036 { test "$extra_verbose" = "yes" && cat << EOF
13037     Defining C_SWITCH_SITE = $null_string
13038 EOF
13039 cat >> confdefs.h <<EOF
13040 #define C_SWITCH_SITE $null_string
13041 EOF
13042 }
13043
13044
13045
13046 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13047     Defining GNU_MALLOC
13048 EOF
13049 cat >> confdefs.h <<\EOF
13050 #define GNU_MALLOC 1
13051 EOF
13052 }
13053
13054 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13055     Defining USE_SYSTEM_MALLOC
13056 EOF
13057 cat >> confdefs.h <<\EOF
13058 #define USE_SYSTEM_MALLOC 1
13059 EOF
13060 }
13061
13062 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13063     Defining USE_DEBUG_MALLOC
13064 EOF
13065 cat >> confdefs.h <<\EOF
13066 #define USE_DEBUG_MALLOC 1
13067 EOF
13068 }
13069
13070                                               { test "$extra_verbose" = "yes" && cat << \EOF
13071     Defining USE_SYSTEM_MALLOC
13072 EOF
13073 cat >> confdefs.h <<\EOF
13074 #define USE_SYSTEM_MALLOC 1
13075 EOF
13076 }
13077
13078 fi
13079 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13080     Defining I18N3
13081 EOF
13082 cat >> confdefs.h <<\EOF
13083 #define I18N3 1
13084 EOF
13085 }
13086
13087 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13088     Defining USE_GCC
13089 EOF
13090 cat >> confdefs.h <<\EOF
13091 #define USE_GCC 1
13092 EOF
13093 }
13094
13095 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13096     Defining EXTERNAL_WIDGET
13097 EOF
13098 cat >> confdefs.h <<\EOF
13099 #define EXTERNAL_WIDGET 1
13100 EOF
13101 }
13102
13103 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13104     Defining NO_DOC_FILE
13105 EOF
13106 cat >> confdefs.h <<\EOF
13107 #define NO_DOC_FILE 1
13108 EOF
13109 }
13110
13111 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13112     Defining PURIFY
13113 EOF
13114 cat >> confdefs.h <<\EOF
13115 #define PURIFY 1
13116 EOF
13117 }
13118
13119 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13120     Defining QUANTIFY
13121 EOF
13122 cat >> confdefs.h <<\EOF
13123 #define QUANTIFY 1
13124 EOF
13125 }
13126
13127 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13128     Defining MAIL_USE_POP
13129 EOF
13130 cat >> confdefs.h <<\EOF
13131 #define MAIL_USE_POP 1
13132 EOF
13133 }
13134
13135 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13136     Defining KERBEROS
13137 EOF
13138 cat >> confdefs.h <<\EOF
13139 #define KERBEROS 1
13140 EOF
13141 }
13142
13143 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13144     Defining HESIOD
13145 EOF
13146 cat >> confdefs.h <<\EOF
13147 #define HESIOD 1
13148 EOF
13149 }
13150
13151 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13152     Defining USE_UNION_TYPE
13153 EOF
13154 cat >> confdefs.h <<\EOF
13155 #define USE_UNION_TYPE 1
13156 EOF
13157 }
13158
13159
13160
13161 (
13162 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13163 else
13164   echo "uname -a: `uname -a`"
13165 fi
13166 echo ""
13167 echo "$0 $quoted_arguments"
13168 ) > Installation
13169
13170 if test ! -z ${emacs_beta_version} ; then
13171   if test -z "${emacs_is_beta}" ; then
13172         xemacs_betaname=".${emacs_beta_version}"
13173   else
13174         xemacs_betaname="-b${emacs_beta_version}"
13175   fi
13176 else
13177   xemacs_betaname=""    
13178 fi
13179
13180 (
13181 echo "
13182
13183 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13184
13185   Where should the build process find the source code?    $srcdir
13186   What installation prefix should install use?            $prefix
13187   What operating system and machine description files should XEmacs use?
13188         \`$opsysfile' and \`$machfile'
13189   What compiler should XEmacs be built with?              $CC $CFLAGS
13190   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13191   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13192   What window system should XEmacs use?                   ${window_system}"
13193 if test "$with_x11" = "yes"; then
13194   echo "  Where do we find X Windows header files?                $x_includes"
13195   echo "  Where do we find X Windows libraries?                   $x_libraries"
13196 fi
13197 if test -n "$site_includes"; then
13198   echo "  Additional header files:                                $site_includes"
13199 fi
13200 if test -n "$site_libraries"; then
13201   echo "  Additional libraries:                                   $site_libraries"
13202 fi
13203 if test -n "$site_prefixes"; then
13204   echo "  Additional prefixes:                                    $site_prefixes"
13205 fi
13206 if test -n "$runpath"; then
13207   echo "  Runtime library search path:                            $runpath"
13208 fi
13209 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13210 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13211 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13212 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13213   echo "  No Xmu; substituting equivalent routines."
13214 fi
13215
13216 if test "$with_xpm" = yes; then
13217   echo "  Compiling in support for XPM images."
13218 elif test "$with_x11" = yes; then
13219   echo "  --------------------------------------------------------------------"
13220   echo "  WARNING: Compiling without XPM support."
13221   if test "$xpm_problem" != ""; then
13222     echo "  Reason: $xpm_problem"
13223   fi
13224   echo "  WARNING: You should strongly consider installing XPM."
13225   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13226   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13227   echo "  --------------------------------------------------------------------"
13228 fi
13229 if test "$with_png" = yes; then
13230   echo "  Compiling in support for PNG image handling."
13231 elif test "$window_system" != "none"; then
13232   echo "  --------------------------------------------------------------------"
13233   echo "  WARNING: Compiling without PNG image support."
13234   if test "$png_problem" != ""; then
13235     echo "  Reason: $png_problem"
13236   fi
13237   echo "  WARNING: You should strongly consider installing the PNG libraries."
13238   echo "  WARNING: Otherwise certain images and glyphs may not display."
13239   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13240   echo "  --------------------------------------------------------------------"
13241 fi
13242 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13243 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13244 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13245 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13246 case "$with_sound" in
13247   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13248   native ) echo "  Compiling in native sound support." ;;
13249   both   ) echo "  Compiling in both network and native sound support." ;;
13250 esac
13251 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13252
13253 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13254 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13255 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13256
13257 test "$with_ldap"            = yes && echo "  Compiling in support for LDAP."
13258
13259 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13260 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13261
13262 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13263 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13264 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13265 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13266 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13267 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13268 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13269 if test "$with_wnn" = yes; then
13270   echo "  Compiling in support for the WNN input method on Mule."
13271   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13272 fi
13273 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13274
13275 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13276 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13277 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13278 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13279 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13280 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13281 case "$with_menubars" in
13282   lucid ) echo "  Using Lucid menubars." ;;
13283   motif ) echo "  Using Motif menubars."
13284           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13285           echo "             We recommend using the Lucid menubar instead."
13286           echo "             Re-run configure with --with-menubars='lucid'." ;;
13287 esac
13288 case "$with_scrollbars" in
13289   lucid    ) echo "  Using Lucid scrollbars."     ;;
13290   motif    ) echo "  Using Motif scrollbars."     ;;
13291   athena   ) echo "  Using Athena scrollbars."    ;;
13292   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13293 esac
13294 case "$with_widgets" in
13295   motif    ) echo "  Using Motif native widgets."     ;;
13296 esac
13297 case "$with_dialogs" in
13298   motif    )
13299     echo "  Using Motif dialog boxes."
13300     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13301       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13302       echo "             We recommend using the Athena dialog boxes instead."
13303       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13304       echo "             Read the PROBLEMS file for more information."
13305     fi; fi
13306     ;;
13307   athena   ) echo "  Using Athena dialog boxes."    ;;
13308   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13309 esac
13310 test "$with_modules" = "yes" && echo "  Compiling in DSO module support."
13311 test "$with_clash_detection" = yes && \
13312   echo "  Clash detection will use \"$lockdir\" for locking files."
13313 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13314 test "$with_pop"        = yes && echo "  Using POP for mail access."
13315 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13316 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13317 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13318 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13319 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13320 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13321   != "no no no no no"; then
13322   echo "  WARNING: ---------------------------------------------------------"
13323   echo "  WARNING: Compiling in support for runtime error checking."
13324   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13325   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13326   echo "  WARNING: ---------------------------------------------------------"
13327 fi
13328 echo ""
13329 ) | tee -a Installation
13330 echo ""
13331
13332
13333 # Remove any trailing slashes in these variables.
13334 test -n "$prefix" &&
13335   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13336 test -n "$exec_prefix" &&
13337   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13338
13339
13340 for file in $internal_makefile_list; do
13341   test "$file" = src/Makefile.in && \
13342     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13343   ac_output_files="${ac_output_files+$ac_output_files }$file"
13344 done
13345 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13346 if test "$with_modules" = "yes"; then
13347   ac_output_files="$ac_output_files lib-src/ellcc.h"
13348 fi
13349
13350 trap '' 1 2 15
13351
13352 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13353
13354 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13355 # Let make expand exec_prefix.
13356 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13357
13358 # Any assignment to VPATH causes Sun make to only execute
13359 # the first set of double-colon rules, so remove it if not needed.
13360 # If there is a colon in the path, we need to keep it.
13361 if test "x$srcdir" = x.; then
13362   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13363 fi
13364
13365 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13366
13367 DEFS=-DHAVE_CONFIG_H
13368
13369 # Without the "./", some shells look in PATH for config.status.
13370 : ${CONFIG_STATUS=./config.status}
13371
13372 echo creating $CONFIG_STATUS
13373 rm -f $CONFIG_STATUS
13374 cat > $CONFIG_STATUS <<EOF
13375 #! /bin/sh
13376 # Generated automatically by configure.
13377 # Run this file to recreate the current configuration.
13378 # This directory was configured as follows,
13379 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13380 #
13381 # $0 $ac_configure_args
13382 #
13383 # Compiler output produced by configure, useful for debugging
13384 # configure, is in ./config.log if it exists.
13385
13386 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13387 for ac_option
13388 do
13389   case "\$ac_option" in
13390   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13391     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13392     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13393   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13394     echo "$CONFIG_STATUS generated by autoconf version 2.13"
13395     exit 0 ;;
13396   -help | --help | --hel | --he | --h)
13397     echo "\$ac_cs_usage"; exit 0 ;;
13398   *) echo "\$ac_cs_usage"; exit 1 ;;
13399   esac
13400 done
13401
13402 ac_given_srcdir=$srcdir
13403 ac_given_INSTALL="$INSTALL"
13404
13405 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13406 EOF
13407 cat >> $CONFIG_STATUS <<EOF
13408
13409 # Protect against being on the right side of a sed subst in config.status.
13410 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13411  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13412 $ac_vpsub
13413 $extrasub
13414 s%@SHELL@%$SHELL%g
13415 s%@CFLAGS@%$CFLAGS%g
13416 s%@CPPFLAGS@%$CPPFLAGS%g
13417 s%@CXXFLAGS@%$CXXFLAGS%g
13418 s%@FFLAGS@%$FFLAGS%g
13419 s%@DEFS@%$DEFS%g
13420 s%@LDFLAGS@%$LDFLAGS%g
13421 s%@LIBS@%$LIBS%g
13422 s%@exec_prefix@%$exec_prefix%g
13423 s%@prefix@%$prefix%g
13424 s%@program_transform_name@%$program_transform_name%g
13425 s%@bindir@%$bindir%g
13426 s%@sbindir@%$sbindir%g
13427 s%@libexecdir@%$libexecdir%g
13428 s%@datadir@%$datadir%g
13429 s%@sysconfdir@%$sysconfdir%g
13430 s%@sharedstatedir@%$sharedstatedir%g
13431 s%@localstatedir@%$localstatedir%g
13432 s%@libdir@%$libdir%g
13433 s%@includedir@%$includedir%g
13434 s%@oldincludedir@%$oldincludedir%g
13435 s%@infodir@%$infodir%g
13436 s%@mandir@%$mandir%g
13437 s%@LN_S@%$LN_S%g
13438 s%@blddir@%$blddir%g
13439 s%@CC@%$CC%g
13440 s%@CPP@%$CPP%g
13441 s%@start_flags@%$start_flags%g
13442 s%@ld_switch_shared@%$ld_switch_shared%g
13443 s%@start_files@%$start_files%g
13444 s%@ld@%$ld%g
13445 s%@lib_gcc@%$lib_gcc%g
13446 s%@RANLIB@%$RANLIB%g
13447 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13448 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
13449 s%@INSTALL_DATA@%$INSTALL_DATA%g
13450 s%@YACC@%$YACC%g
13451 s%@SET_MAKE@%$SET_MAKE%g
13452 s%@X_CFLAGS@%$X_CFLAGS%g
13453 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13454 s%@X_LIBS@%$X_LIBS%g
13455 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13456 s%@install_pp@%$install_pp%g
13457 s%@libs_xauth@%$libs_xauth%g
13458 s%@dnd_objs@%$dnd_objs%g
13459 s%@lwlib_objs@%$lwlib_objs%g
13460 s%@ALLOCA@%$ALLOCA%g
13461 s%@dll_ld@%$dll_ld%g
13462 s%@dll_cflags@%$dll_cflags%g
13463 s%@dll_ldflags@%$dll_ldflags%g
13464 s%@dll_post@%$dll_post%g
13465 s%@dll_ldo@%$dll_ldo%g
13466 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13467 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13468 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13469 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13470 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13471 s%@PROGNAME@%$PROGNAME%g
13472 s%@version@%$version%g
13473 s%@configuration@%$configuration%g
13474 s%@canonical@%$canonical%g
13475 s%@inststaticdir@%$inststaticdir%g
13476 s%@instvardir@%$instvardir%g
13477 s%@srcdir@%$srcdir%g
13478 s%@pkgdir@%$pkgdir%g
13479 s%@statedir@%$statedir%g
13480 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
13481 s%@PREFIX@%$PREFIX%g
13482 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
13483 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13484 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13485 s%@INFODIR@%$INFODIR%g
13486 s%@infopath@%$infopath%g
13487 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13488 s%@INFOPATH@%$INFOPATH%g
13489 s%@package_path@%$package_path%g
13490 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13491 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13492 s%@lispdir@%$lispdir%g
13493 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13494 s%@LISPDIR@%$LISPDIR%g
13495 s%@moduledir@%$moduledir%g
13496 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13497 s%@MODULEDIR@%$MODULEDIR%g
13498 s%@sitelispdir@%$sitelispdir%g
13499 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13500 s%@SITELISPDIR@%$SITELISPDIR%g
13501 s%@sitemoduledir@%$sitemoduledir%g
13502 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13503 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13504 s%@etcdir@%$etcdir%g
13505 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13506 s%@ETCDIR@%$ETCDIR%g
13507 s%@lockdir@%$lockdir%g
13508 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13509 s%@LOCKDIR@%$LOCKDIR%g
13510 s%@docdir@%$docdir%g
13511 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
13512 s%@DOCDIR@%$DOCDIR%g
13513 s%@archlibdir@%$archlibdir%g
13514 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13515 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13516 s%@bitmapdir@%$bitmapdir%g
13517 s%@extra_objs@%$extra_objs%g
13518 s%@machfile@%$machfile%g
13519 s%@opsysfile@%$opsysfile%g
13520 s%@c_switch_general@%$c_switch_general%g
13521 s%@c_switch_window_system@%$c_switch_window_system%g
13522 s%@c_switch_all@%$c_switch_all%g
13523 s%@ld_switch_general@%$ld_switch_general%g
13524 s%@ld_switch_window_system@%$ld_switch_window_system%g
13525 s%@ld_switch_all@%$ld_switch_all%g
13526 s%@ld_libs_general@%$ld_libs_general%g
13527 s%@ld_libs_window_system@%$ld_libs_window_system%g
13528 s%@ld_libs_all@%$ld_libs_all%g
13529 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13530 s%@native_sound_lib@%$native_sound_lib%g
13531 s%@sound_cflags@%$sound_cflags%g
13532 s%@dynodump_arch@%$dynodump_arch%g
13533 s%@XEMACS_CC@%$XEMACS_CC%g
13534 s%@internal_makefile_list@%$internal_makefile_list%g
13535
13536 CEOF
13537 EOF
13538
13539 cat >> $CONFIG_STATUS <<\EOF
13540
13541 # Split the substitutions into bite-sized pieces for seds with
13542 # small command number limits, like on Digital OSF/1 and HP-UX.
13543 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13544 ac_file=1 # Number of current file.
13545 ac_beg=1 # First line for current file.
13546 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13547 ac_more_lines=:
13548 ac_sed_cmds=""
13549 while $ac_more_lines; do
13550   if test $ac_beg -gt 1; then
13551     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13552   else
13553     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13554   fi
13555   if test ! -s conftest.s$ac_file; then
13556     ac_more_lines=false
13557     rm -f conftest.s$ac_file
13558   else
13559     if test -z "$ac_sed_cmds"; then
13560       ac_sed_cmds="sed -f conftest.s$ac_file"
13561     else
13562       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13563     fi
13564     ac_file=`expr $ac_file + 1`
13565     ac_beg=$ac_end
13566     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13567   fi
13568 done
13569 if test -z "$ac_sed_cmds"; then
13570   ac_sed_cmds=cat
13571 fi
13572 EOF
13573
13574 cat >> $CONFIG_STATUS <<EOF
13575
13576 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13577 EOF
13578 cat >> $CONFIG_STATUS <<\EOF
13579 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13580   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13581   case "$ac_file" in
13582   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13583        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13584   *) ac_file_in="${ac_file}.in" ;;
13585   esac
13586
13587   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13588
13589   # Remove last slash and all that follows it.  Not all systems have dirname.
13590   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13591   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13592     # The file is in a subdirectory.
13593     test ! -d "$ac_dir" && mkdir "$ac_dir"
13594     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13595     # A "../" for each directory in $ac_dir_suffix.
13596     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13597   else
13598     ac_dir_suffix= ac_dots=
13599   fi
13600
13601   case "$ac_given_srcdir" in
13602   .)  srcdir=.
13603       if test -z "$ac_dots"; then top_srcdir=.
13604       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13605   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13606   *) # Relative path.
13607     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13608     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13609   esac
13610
13611   case "$ac_given_INSTALL" in
13612   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13613   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13614   esac
13615
13616   echo creating "$ac_file"
13617   rm -f "$ac_file"
13618   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13619   case "$ac_file" in
13620   *Makefile*) ac_comsub="1i\\
13621 # $configure_input" ;;
13622   *) ac_comsub= ;;
13623   esac
13624
13625   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13626   sed -e "$ac_comsub
13627 s%@configure_input@%$configure_input%g
13628 s%@srcdir@%$srcdir%g
13629 s%@top_srcdir@%$top_srcdir%g
13630 s%@INSTALL@%$INSTALL%g
13631 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13632 fi; done
13633 rm -f conftest.s*
13634
13635 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13636 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13637 #
13638 # ac_d sets the value in "#define NAME VALUE" lines.
13639 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13640 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13641 ac_dC='\3'
13642 ac_dD='%g'
13643 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13644 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13645 ac_uB='\([      ]\)%\1#\2define\3'
13646 ac_uC=' '
13647 ac_uD='\4%g'
13648 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13649 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13650 ac_eB='$%\1#\2define\3'
13651 ac_eC=' '
13652 ac_eD='%g'
13653
13654 if test "${CONFIG_HEADERS+set}" != set; then
13655 EOF
13656 cat >> $CONFIG_STATUS <<EOF
13657   CONFIG_HEADERS="src/config.h lwlib/config.h"
13658 EOF
13659 cat >> $CONFIG_STATUS <<\EOF
13660 fi
13661 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13662   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13663   case "$ac_file" in
13664   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13665        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13666   *) ac_file_in="${ac_file}.in" ;;
13667   esac
13668
13669   echo creating $ac_file
13670
13671   rm -f conftest.frag conftest.in conftest.out
13672   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13673   cat $ac_file_inputs > conftest.in
13674
13675 EOF
13676
13677 # Transform confdefs.h into a sed script conftest.vals that substitutes
13678 # the proper values into config.h.in to produce config.h.  And first:
13679 # Protect against being on the right side of a sed subst in config.status.
13680 # Protect against being in an unquoted here document in config.status.
13681 rm -f conftest.vals
13682 cat > conftest.hdr <<\EOF
13683 s/[\\&%]/\\&/g
13684 s%[\\$`]%\\&%g
13685 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13686 s%ac_d%ac_u%gp
13687 s%ac_u%ac_e%gp
13688 EOF
13689 sed -n -f conftest.hdr confdefs.h > conftest.vals
13690 rm -f conftest.hdr
13691
13692 # This sed command replaces #undef with comments.  This is necessary, for
13693 # example, in the case of _POSIX_SOURCE, which is predefined and required
13694 # on some systems where configure will not decide to define it.
13695 cat >> conftest.vals <<\EOF
13696 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13697 EOF
13698
13699 # Break up conftest.vals because some shells have a limit on
13700 # the size of here documents, and old seds have small limits too.
13701
13702 rm -f conftest.tail
13703 while :
13704 do
13705   ac_lines=`grep -c . conftest.vals`
13706   # grep -c gives empty output for an empty file on some AIX systems.
13707   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13708   # Write a limited-size here document to conftest.frag.
13709   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13710   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13711   echo 'CEOF
13712   sed -f conftest.frag conftest.in > conftest.out
13713   rm -f conftest.in
13714   mv conftest.out conftest.in
13715 ' >> $CONFIG_STATUS
13716   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13717   rm -f conftest.vals
13718   mv conftest.tail conftest.vals
13719 done
13720 rm -f conftest.vals
13721
13722 cat >> $CONFIG_STATUS <<\EOF
13723   rm -f conftest.frag conftest.h
13724   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13725   cat conftest.in >> conftest.h
13726   rm -f conftest.in
13727   if cmp -s $ac_file conftest.h 2>/dev/null; then
13728     echo "$ac_file is unchanged"
13729     rm -f conftest.h
13730   else
13731     # Remove last slash and all that follows it.  Not all systems have dirname.
13732       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13733       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13734       # The file is in a subdirectory.
13735       test ! -d "$ac_dir" && mkdir "$ac_dir"
13736     fi
13737     rm -f $ac_file
13738     mv conftest.h $ac_file
13739   fi
13740 fi; done
13741
13742 EOF
13743 cat >> $CONFIG_STATUS <<EOF
13744 CPP="$CPP"
13745  top_srcdir="$srcdir"
13746  MAKE_SUBDIR="$MAKE_SUBDIR"
13747
13748 EOF
13749 cat >> $CONFIG_STATUS <<\EOF
13750 for dir in . $MAKE_SUBDIR; do
13751   (
13752     cd $dir
13753     rm -f junk.c
13754     < Makefile.in \
13755       sed -e '/^# Generated/d' \
13756           -e 's%/\*\*/#.*%%' \
13757           -e 's/^ *# */#/' \
13758           -e '/^##/d' \
13759           -e '/^#/ {
13760 p
13761 d
13762 }'        \
13763           -e '/./ {
13764 s/\([\"]\)/\\\1/g
13765 s/^/"/
13766 s/$/"/
13767 }'  > junk.c;
13768
13769
13770
13771     echo creating $dir/Makefile
13772 $CPP -I. -I${top_srcdir}/src  junk.c \
13773   | sed -e 's/^\#.*//'          \
13774         -e 's/^[        ][      ]*$//'\
13775         -e 's/^ /       /'              \
13776   | sed -n -e '/^..*$/p'        \
13777   | sed '/^\"/ {
13778         s/\\\([\"]\)/\1/g
13779         s/^[    ]*\"//
13780         s/\"[   ]*$//
13781 }' > Makefile.new
13782     chmod 444 Makefile.new
13783     mv -f Makefile.new Makefile
13784
13785     echo creating $dir/GNUmakefile
13786 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13787   | sed -e 's/^\#.*//'          \
13788         -e 's/^[        ][      ]*$//'\
13789         -e 's/^ /       /'              \
13790   | sed -n -e '/^..*$/p'        \
13791   | sed '/^\"/ {
13792         s/\\\([\"]\)/\1/g
13793         s/^[    ]*\"//
13794         s/\"[   ]*$//
13795 }' > Makefile.new
13796     chmod 444 Makefile.new
13797     mv -f Makefile.new GNUmakefile
13798
13799     rm -f junk.c
13800   )
13801 done
13802
13803 sed < config.status >> lib-src/config.values \
13804   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13805   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13806   -e 's/^\([^ ]*\) $/\1 ""/' \
13807   -e 's/ 1$/ t/'
13808
13809
13810 exit 0
13811 EOF
13812 chmod +x $CONFIG_STATUS
13813 rm -fr confdefs* $ac_clean_files
13814 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1