Contents of release-21-2 at 1999-07-02-10.
[chise/xemacs-chise.git.1] / configure
1 #! /bin/sh
2
3 #### Configuration script for XEmacs.  Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version 2.12 
6 #### Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
7 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
8 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
9 #### Copyright (C) 1995, 1996 Ben Wing.
10 #### Copyright (C) 1998, 1999 J. Kean Johnston.
11
12 ### Don't edit this script!
13 ### This script was automatically generated by the `autoconf' program
14 ### from the file `./configure.in'.
15 ### To rebuild it, execute the command
16 ###     autoconf
17 ### in the this directory.  You must have autoconf version 2.12 or later.
18
19 ### This file is part of XEmacs.
20
21 ### XEmacs is free software; you can redistribute it and/or modify it
22 ### under the terms of the GNU General Public License as published by
23 ### the Free Software Foundation; either version 2, or (at your
24 ### option) any later version.
25
26 ### XEmacs is distributed in the hope that it will be useful, but
27 ### WITHOUT ANY WARRANTY; without even the implied warranty of
28 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29 ### General Public License for more details.
30
31 ### You should have received a copy of the GNU General Public License
32 ### along with XEmacs; see the file COPYING.  If not, write to the Free
33 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 ### 02111-1307, USA.
35
36 ### For usage, run `./configure --help'
37 ### For more detailed information on building and installing XEmacs,
38 ### read the file `INSTALL'.
39 ###
40 ### If configure succeeds, it leaves its status in config.status.
41 ### A log of configuration tests can be found in config.log.
42 ### If configure fails after disturbing the status quo,
43 ###     config.status is removed.
44
45 ac_help="$ac_help
46   --with-x                use the X Window System"
47
48
49
50 if test -n "$ZSH_VERSION"; then
51     setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
52   setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
53   setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
54   setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
55       if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
56 elif test -n "$BASH_VERSION"; then
57     set -o posix
58   unset CDPATH
59 else
60   if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
61 fi
62
63 exec_prefix=NONE
64 host=NONE
65 no_create=
66 nonopt=NONE
67 no_recursion=
68 prefix=NONE
69 program_prefix=NONE
70 program_suffix=NONE
71 program_transform_name=s,x,x,
72 silent=
73 site=
74 srcdir=
75 target=NONE
76 verbose=
77 x_includes=NONE
78 x_libraries=NONE
79
80 bindir='${exec_prefix}/bin'
81 sbindir='${exec_prefix}/sbin'
82 libexecdir='${exec_prefix}/libexec'
83 datadir='${prefix}/share'
84 sysconfdir='${prefix}/etc'
85 sharedstatedir='${prefix}/com'
86 localstatedir='${prefix}/var'
87 libdir='${{exec_prefix}}/lib'
88 includedir='${prefix}/include'
89 oldincludedir='/usr/include'
90 infodir='${prefix}/info'
91 mandir='${prefix}/man'
92
93 subdirs=
94 MFLAGS= MAKEFLAGS=
95 ac_max_here_lines=12
96
97 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
98
99 # File descriptor usage:
100 # 0 standard input
101 # 1 file creation
102 # 2 errors and warnings
103 # 3 some systems may open it to /dev/tty
104 # 4 used on the Kubota Titan
105 # 6 checking for... messages and results
106 # 5 compiler messages saved in config.log
107 if test "$silent" = yes; then
108   exec 6>/dev/null
109 else
110   exec 6>&1
111 fi
112 exec 5>./config.log
113
114 echo "\
115 This file contains any messages produced by compilers while
116 running configure, to aid debugging if configure makes a mistake.
117 " 1>&5
118
119 # Strip out --no-create and --no-recursion so they do not pile up.
120 # Also quote any args containing shell metacharacters.
121 ac_configure_args=
122 for ac_arg
123 do
124   case "$ac_arg" in
125   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
126   | --no-cr | --no-c) ;;
127   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
128   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
129   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
130   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
131   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
132   esac
133 done
134
135 # NLS nuisances.
136 # Only set these to C if already set.  These must not be set unconditionally
137 # because not all systems understand e.g. LANG=C (notably SCO).
138 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
139 # Non-C LC_CTYPE values break the ctype check.
140 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
141 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
142 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
143 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
144
145 # confdefs.h avoids OS command line length limits that DEFS can exceed.
146 rm -rf conftest* confdefs.h
147 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
148 echo > confdefs.h
149
150 # A filename unique to this package, relative to the directory that
151 # configure is in, which we can look for to find out if srcdir is correct.
152 ac_unique_file=src/lisp.h
153
154 # Find the source files, if location was not specified.
155 if test -z "$srcdir"; then
156   ac_srcdir_defaulted=yes
157   # Try the directory containing this script, then its parent.
158   ac_prog=$0
159   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
160   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
161   srcdir=$ac_confdir
162   if test ! -r $srcdir/$ac_unique_file; then
163     srcdir=..
164   fi
165 else
166   ac_srcdir_defaulted=no
167 fi
168 if test ! -r $srcdir/$ac_unique_file; then
169   if test "$ac_srcdir_defaulted" = yes; then
170     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
171   else
172     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
173   fi
174 fi
175 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
176
177 # Prefer explicitly selected file to automatically selected ones.
178 if test -z "$CONFIG_SITE"; then
179   if test "x$prefix" != xNONE; then
180     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
181   else
182     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
183   fi
184 fi
185 for ac_site_file in $CONFIG_SITE; do
186   if test -r "$ac_site_file"; then
187     echo "loading site script $ac_site_file"
188     . "$ac_site_file"
189   fi
190 done
191
192
193 ac_ext=c
194 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
195 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
196 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
197 ac_cpp='$CPP '"$xe_cppflags"
198 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
199 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
200 cross_compiling=no
201
202 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
203   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
204   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
205     ac_n= ac_c='
206 ' ac_t='        '
207   else
208     ac_n=-n ac_c= ac_t=
209   fi
210 else
211   ac_n= ac_c='\c' ac_t=
212 fi
213
214
215 progname="`echo $0 | sed 's:^\./\./:\./:'`"
216
217
218 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
219 INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
220
221 prefix='/usr/local'
222 exec_prefix='${prefix}'
223 bindir='${exec_prefix}/bin'
224 datadir='${prefix}/lib'
225 statedir='${prefix}/lib'
226 libdir='${exec_prefix}/lib'
227 mandir='${prefix}/man/man1'
228 infodir='${datadir}/${PROGNAME}-${version}/info'
229 infopath=''
230 install_pp=''
231 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
232 moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
233 sitelispdir='${datadir}/xemacs/site-lisp'
234 sitemoduledir='${datadir}/xemacs/site-modules'
235 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
236 package_path=''
237 etcdir='${datadir}/${PROGNAME}-${version}/etc'
238 lockdir='${statedir}/${PROGNAME}/lock'
239 archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
240 docdir='${archlibdir}'
241 with_site_lisp='no'
242 with_site_modules='yes'
243 with_menubars=''
244 with_scrollbars=''
245 with_dialogs=''
246 with_file_coding=''
247 cpp='' cppflags='' libs='' ldflags=''
248 dynamic=''
249 with_x11=''
250 with_msw=''
251 rel_alloc='default'
252 with_system_malloc='default'
253 with_dlmalloc='default'
254 native_sound_lib=''
255 use_assertions="yes"
256 with_toolbars=""
257 with_tty=""
258 use_union_type="no"
259 with_dnet=""
260
261
262
263
264 arguments="$@"
265
266 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
267 quoted_arguments=
268 for i in "$@"; do
269    case "$i" in
270    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
271    | --no-cr | --no-c) ;;
272    -no-recursion | --no-recursion | --no-recursio | --no-recursi \
273    | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
274    *)
275    quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
276    quoted_arguments="$quoted_arguments '$quoted_i'" ;;
277    esac
278 done
279
280 while test $# != 0; do
281   arg="$1"; shift
282   case "$arg" in
283     --no-create|--no-recursion) ;;
284         -* )
285             case "$arg" in
286         -*=*)
287           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
288           val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
289           valomitted=no
290         ;;
291                                                                           -*)
292                                           opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
293           val="yes" valomitted=yes
294         ;;
295       esac
296
297             optname="$opt"
298       opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
299
300             case "${valomitted}-${opt}" in yes-without_* )
301         opt=`echo $opt | sed 's/without/with/'`
302         valomitted="no" val="no" ;;
303       esac
304
305             case "$opt" in
306
307         with_site_lisp  | \
308     with_site_modules | \
309         with_x          | \
310         with_x11        | \
311         with_msw        | \
312         with_gcc        | \
313         dynamic         | \
314         with_ncurses    | \
315         with_dnet       | \
316         with_socks      | \
317         with_dragndrop  | \
318         with_cde        | \
319         with_offix      | \
320         with_gpm        | \
321         with_xpm        | \
322         with_xface      | \
323         with_gif        | \
324         with_jpeg       | \
325         with_png        | \
326         with_tiff       | \
327         with_wmcommand  | \
328         with_xmu        | \
329         with_purify     | \
330         with_quantify   | \
331         with_toolbars   | \
332         with_tty        | \
333         with_xfs        | \
334         with_i18n3      | \
335         with_mule       | \
336         with_file_coding| \
337         with_canna      | \
338         with_wnn        | \
339         with_wnn6       | \
340         with_workshop   | \
341         with_sparcworks | \
342         with_tooltalk   | \
343         with_ldap       | \
344         with_pop        | \
345         with_kerberos   | \
346         with_hesiod     | \
347         with_dnet       | \
348         with_infodock   | \
349         external_widget | \
350         verbose         | \
351         extra_verbose   | \
352         const_is_losing | \
353         usage_tracking  | \
354         use_union_type  | \
355         debug           | \
356         use_assertions  | \
357         memory_usage_stats | \
358         with_clash_detection | \
359         with_shlib | \
360         no_doc_file )
361                   case "$val" in
362             y | ye | yes )      val=yes ;;
363             n | no )            val=no  ;;
364             * ) (echo "$progname: Usage error:"
365 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
366 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
367           esac
368           eval "$opt=\"$val\"" ;;
369
370
371                         srcdir          | \
372         compiler        | \
373         cflags          | \
374         cpp             | \
375         cppflags        | \
376         libs            | \
377         ldflags         | \
378         cache_file      | \
379         native_sound_lib| \
380         site_lisp       | \
381         x_includes      | \
382         x_libraries     | \
383         site_includes   | \
384         site_libraries  | \
385         site_prefixes   | \
386         site_runtime_libraries )
387                   if test "$valomitted" = "yes" ; then
388                     if test "$#" = 0 ; then
389               (echo "$progname: Usage error:"
390 echo " " "The \`--$optname' option requires a value."
391 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
392             fi
393             val="$1"; shift
394           fi
395           eval "$opt=\"$val\""
396         ;;
397
398                 rel_alloc | \
399         with_dlmalloc | \
400         with_debug_malloc  | use_debug_malloc | \
401         with_system_malloc | use_system_malloc )
402           case "$val" in
403             y | ye | yes )      val=yes ;;
404             n | no )            val=no  ;;
405             d | de | def | defa | defau | defaul | default ) val=default ;;
406             * ) (echo "$progname: Usage error:"
407 echo " " "The \`--$optname' option requires one of these values:
408   \`yes', \`no', or \`default'."
409 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
410           esac
411           case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
412           eval "$opt=\"$val\""
413         ;;
414
415                 "with_database" )
416           with_database_berkdb=no
417           with_database_dbm=no
418           with_database_gnudbm=no
419           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
420             case "$x" in
421                 no ) ;;
422                 b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
423                 d | db | dbm )                          with_database_dbm=yes    ;;
424                 g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
425                 * ) (echo "$progname: Usage error:"
426 echo " " "The \`--$optname' option value
427   must be either \`no' or a comma-separated list
428   of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
429 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
430             esac
431           done
432           if test "$with_database_dbm"    = "yes" -a \
433                   "$with_database_gnudbm" = "yes"; then
434           (echo "$progname: Usage error:"
435 echo " " "Only one of \`dbm' and \`gnudbm' may be specified
436   with the \`--$optname' option."
437 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
438           fi
439         ;;
440
441                 "with_sound" )
442                           case "$val" in
443             y | ye | yes )                      val=native ;;
444             n | no | non | none )               val=no;;
445             na | nat | nati | nativ | native )  val=native  ;;
446             ne | net | neta | netau | netaud | netaudi | netaudio | nas ) val=nas  ;;
447             b | bo | bot | both )               val=both;;
448             * ) (echo "$progname: Usage error:"
449 echo " " "The \`--$optname' option must have one of these values:
450   \`native', \`nas', \`both', or \`none'."
451 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
452           esac
453           eval "$opt=\"$val\""
454         ;;
455
456                 "with_xim" )
457           case "$val" in
458             y | ye | yes )                val=yes   ;;
459             n | no | non | none )         val=no    ;;
460             x | xl | xli | xlib )         val=xlib  ;;
461             m | mo | mot | moti | motif ) val=motif ;;
462             * ) (echo "$progname: Usage error:"
463 echo " " "The \`--$optname' option must have one of these values:
464   \`motif', \`xlib', \`yes', or \`no'."
465 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
466           esac
467           eval "$opt=\"$val\""
468         ;;
469
470                 "mail_locking" )
471           case "$val" in
472             lockf )     val=lockf ;;
473             flock )     val=flock ;;
474             file )      val=file  ;;
475             * ) (echo "$progname: Usage error:"
476 echo " " "The \`--$optname' option must have one of these values:
477   \`lockf', \`flock', or \`file'."
478 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
479           esac
480           eval "$opt=\"$val\""
481         ;;
482
483                 "error_checking" )
484                           
485           for x in `echo "$val" | sed -e 's/,/ /g'` ; do
486             case "$x" in
487                       n | no | non | none ) new_default=no ;;
488               a | al | all )        new_default=yes ;;
489
490               extents )       error_check_extents=yes ;;
491               noextents )     error_check_extents=no ;;
492
493               typecheck )     error_check_typecheck=yes ;;
494               notypecheck )   error_check_typecheck=no ;;
495
496               bufpos )        error_check_bufpos=yes ;;
497               nobufpos )      error_check_bufpos=no ;;
498
499               gc )            error_check_gc=yes ;;
500               nogc )          error_check_gc=no ;;
501
502               malloc )        error_check_malloc=yes ;;
503               nomalloc )      error_check_malloc=no ;;
504
505               byte_code )     error_check_byte_code=yes ;;
506               nobyte_code )   error_check_byte_code=no ;;
507
508               * ) bogus_error_check=yes ;;
509             esac
510             if test "$bogus_error_check" -o \
511                  \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
512                 if test "$error_check_default" = yes ; then
513                   types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', and \`nobyte-code'."
514                 else
515                   types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', and \`byte-code'."
516                 fi
517                 (echo "$progname: Usage error:"
518 echo " " "Valid types for the \`--$optname' option are:
519   $types."
520 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
521             elif test -n "$new_default" ; then
522                 error_check_extents=$new_default
523                 error_check_typecheck=$new_default
524                 error_check_bufpos=$new_default
525                 error_check_gc=$new_default
526                 error_check_malloc=$new_default
527                 error_check_byte_code=$new_default
528                 new_default=    # reset this
529             fi
530             echeck_notfirst=true
531           done
532         ;;
533
534                                 
535                 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
536         mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
537         archlibdir | docdir | package_path )
538                    if test "$valomitted" = "yes"; then
539              if test "$#" = 0; then
540                  (echo "$progname: Usage error:"
541 echo " " "The \`--$optname' option requires a value."
542 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1;
543              fi
544              val="$1"; shift
545            fi
546            eval "$opt=\"$val\""
547
548                            case "$opt" in
549              prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
550     Defining PREFIX_USER_DEFINED
551 EOF
552 cat >> confdefs.h <<\EOF
553 #define PREFIX_USER_DEFINED 1
554 EOF
555 }
556  ;;
557              exec_prefix ) { test "$extra_verbose" = "yes" && cat << \EOF
558     Defining EXEC_PREFIX_USER_DEFINED
559 EOF
560 cat >> confdefs.h <<\EOF
561 #define EXEC_PREFIX_USER_DEFINED 1
562 EOF
563 }
564  ;;
565              lispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
566     Defining LISPDIR_USER_DEFINED
567 EOF
568 cat >> confdefs.h <<\EOF
569 #define LISPDIR_USER_DEFINED 1
570 EOF
571 }
572  ;;
573              sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
574     Defining SITELISPDIR_USER_DEFINED
575 EOF
576 cat >> confdefs.h <<\EOF
577 #define SITELISPDIR_USER_DEFINED 1
578 EOF
579 }
580  ;;
581              moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
582     Defining MODULEDIR_USER_DEFINED
583 EOF
584 cat >> confdefs.h <<\EOF
585 #define MODULEDIR_USER_DEFINED 1
586 EOF
587 }
588  ;;
589              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
590     Defining ETCDIR_USER_DEFINED
591 EOF
592 cat >> confdefs.h <<\EOF
593 #define ETCDIR_USER_DEFINED 1
594 EOF
595 }
596  ;;
597              infodir ) { test "$extra_verbose" = "yes" && cat << \EOF
598     Defining INFODIR_USER_DEFINED
599 EOF
600 cat >> confdefs.h <<\EOF
601 #define INFODIR_USER_DEFINED 1
602 EOF
603 }
604  ;;
605              infopath ) { test "$extra_verbose" = "yes" && cat << \EOF
606     Defining INFOPATH_USER_DEFINED
607 EOF
608 cat >> confdefs.h <<\EOF
609 #define INFOPATH_USER_DEFINED 1
610 EOF
611 }
612  ;;
613              package_path ) { test "$extra_verbose" = "yes" && cat << \EOF
614     Defining PACKAGE_PATH_USER_DEFINED
615 EOF
616 cat >> confdefs.h <<\EOF
617 #define PACKAGE_PATH_USER_DEFINED 1
618 EOF
619 }
620  ;;
621              datadir )
622                 { test "$extra_verbose" = "yes" && cat << \EOF
623     Defining INFODIR_USER_DEFINED
624 EOF
625 cat >> confdefs.h <<\EOF
626 #define INFODIR_USER_DEFINED 1
627 EOF
628 }
629
630                 { test "$extra_verbose" = "yes" && cat << \EOF
631     Defining LISPDIR_USER_DEFINED
632 EOF
633 cat >> confdefs.h <<\EOF
634 #define LISPDIR_USER_DEFINED 1
635 EOF
636 }
637
638             { test "$extra_verbose" = "yes" && cat << \EOF
639     Defining MODULEDIR_USER_DEFINED
640 EOF
641 cat >> confdefs.h <<\EOF
642 #define MODULEDIR_USER_DEFINED 1
643 EOF
644 }
645
646                 { test "$extra_verbose" = "yes" && cat << \EOF
647     Defining ETCDIR_USER_DEFINED
648 EOF
649 cat >> confdefs.h <<\EOF
650 #define ETCDIR_USER_DEFINED 1
651 EOF
652 }
653  ;;
654              statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF
655     Defining LOCKDIR_USER_DEFINED
656 EOF
657 cat >> confdefs.h <<\EOF
658 #define LOCKDIR_USER_DEFINED 1
659 EOF
660 }
661  ;;
662              docdir ) { test "$extra_verbose" = "yes" && cat << \EOF
663     Defining DOCDIR_USER_DEFINED
664 EOF
665 cat >> confdefs.h <<\EOF
666 #define DOCDIR_USER_DEFINED 1
667 EOF
668 }
669  ;;
670              exec_prefix | libdir | archlibdir ) { test "$extra_verbose" = "yes" && cat << \EOF
671     Defining ARCHLIBDIR_USER_DEFINED
672 EOF
673 cat >> confdefs.h <<\EOF
674 #define ARCHLIBDIR_USER_DEFINED 1
675 EOF
676 }
677  ;;
678            esac
679         ;;
680
681                 "no_create" ) ;;
682
683                 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
684
685                 "with_menubars"   | \
686         "with_scrollbars" | \
687         "with_dialogs" )
688           case "$val" in
689             l | lu | luc | luci | lucid )               val=lucid  ;;
690             m | mo | mot | moti | motif )               val=motif  ;;
691             athena3d | athena-3d )                      val=athena3d ;;
692             a | at | ath | athe | athen | athena )      val=athena ;;
693             n | no | non | none )                       val=no ;;
694             * ) (echo "$progname: Usage error:"
695 echo " " "The \`--$optname' option must have one of these values:
696   \`lucid', \`motif', \`athena', \`athena3d', or \`no'."
697 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
698           esac
699           eval "$opt=\"$val\""
700         ;;
701
702                 "run_in_place"  | \
703         "with_gnu_make" )
704           echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
705         ;;
706
707                 * ) (echo "$progname: Usage error:"
708 echo " " "Unrecognized option: $arg"
709 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
710
711       esac
712     ;;
713
714         *-*-*) configuration="$arg" ;;
715
716         *) (echo "$progname: Usage error:"
717 echo " " "Unrecognized argument: $arg"
718 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
719
720   esac
721 done
722
723
724 test -n "$cpp"      && CPP="$cpp"
725 test -n "$cppflags" && CPPFLAGS="$cppflags"
726 test -n "$libs"     && LIBS="$libs"
727 test -n "$ldflags"  && LDFLAGS="$ldflags"
728
729 eval set x "$quoted_arguments"; shift
730
731 test "$extra_verbose" = "yes" && verbose=yes
732
733 test -n "$with_x" && with_x11="$with_x"
734
735 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
736   test "$with_system_malloc" = "default" && with_system_malloc=yes
737 fi
738
739
740
741 if test "$with_cde $with_tooltalk" = "yes no"; then
742   (echo "$progname: Usage error:"
743 echo " " "--with-cde requires --with-tooltalk"
744 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
745 elif test "$with_tooltalk" = "no" ; then with_cde=no
746 elif test "$with_cde" = "yes"; then with_tooltalk=yes
747 fi
748
749
750 case "$srcdir" in
751
752     "" )
753     for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`" "." ".." ; do
754       if test -f "$dir/src/lisp.h" -a \
755               -f "$dir/lisp/version.el" ; then
756         srcdir="$dir"
757         break
758       fi
759     done
760     if test -z "$srcdir" ; then
761       (echo "$progname: Usage error:"
762 echo " " "Neither the current directory nor its parent seem to
763   contain the XEmacs sources.  If you do not want to build XEmacs in its
764   source tree, you should run \`$progname' in the directory in which
765   you wish to build XEmacs, using the \`--srcdir' option to say where the
766   sources may be found."
767 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
768     fi
769   ;;
770
771     * )
772     if test ! -f "$srcdir/src/lisp.h" -o \
773             ! -f "$srcdir/lisp/version.el" ; then
774       (echo "$progname: Usage error:"
775 echo " " "The directory specified with the \`--srcdir' option,
776   \`$srcdir', doesn't seem to contain the XEmacs sources.  You should
777   either run the \`$progname' script at the top of the XEmacs source
778   tree, or use the \`--srcdir' option to specify the XEmacs source directory."
779 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
780     fi
781   ;;
782 esac
783
784 if test -z "$configuration"; then
785     configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
786   if test -z "$configuration"; then
787     (echo "$progname: Usage error:"
788 echo " " "XEmacs has not been ported to this host type.
789 Try explicitly specifying the CONFIGURATION when rerunning configure."
790 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
791   fi
792 fi
793
794 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
795 echo "configure:796: checking whether ln -s works" >&5
796
797 rm -f conftestdata
798 if ln -s X conftestdata 2>/dev/null
799 then
800   rm -f conftestdata
801   ac_cv_prog_LN_S="ln -s"
802 else
803   ac_cv_prog_LN_S=ln
804 fi
805 LN_S="$ac_cv_prog_LN_S"
806 if test "$ac_cv_prog_LN_S" = "ln -s"; then
807   echo "$ac_t""yes" 1>&6
808 else
809   echo "$ac_t""no" 1>&6
810 fi
811
812
813 for dir in lisp etc man info; do
814   if test ! -d "$dir" ; then
815     echo Making symbolic link to "$srcdir/$dir"
816     ${LN_S} "$srcdir/$dir" "$dir"
817   fi
818 done
819
820
821 absolute_pwd="`pwd`";
822 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
823 then blddir="$PWD"
824 else blddir="$absolute_pwd"; if test -d "/net"; then
825   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
826   blddir=`echo "$blddir" | \
827    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
828 fi
829 fi
830
831
832 case "$srcdir" in
833   /* ) ;;
834   .  ) srcdir="$blddir" ;;
835   *  ) srcdir="`cd $srcdir && pwd`"; if test -d "/net"; then
836   if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
837   srcdir=`echo "$srcdir" | \
838    sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
839 fi ;;
840 esac
841
842 if test `pwd` != `sh -c cd $srcdir && pwd`  \
843    && test -f "$srcdir/src/config.h"; then
844   (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
845    echo "   as a build directory right now; it has been configured in its own"
846    echo "   right.  To configure in another directory as well, you MUST"
847    echo "   use GNU make.  If you do not have GNU make, then you must"
848    echo "   now do \`make distclean' in $srcdir,"
849    echo "   and then run $progname again.") >&2
850   extrasub='/^VPATH[     ]*=/c\
851 vpath %.c $(srcdir)\
852 vpath %.h $(srcdir)\
853 vpath %.y $(srcdir)\
854 vpath %.l $(srcdir)\
855 vpath %.s $(srcdir)\
856 vpath %.in $(srcdir)'
857 fi
858
859 . "$srcdir/version.sh" || exit 1;
860 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
861 : "${extra_verbose=$beta}"
862 version="${emacs_major_version}.${emacs_minor_version}"
863 { test "$extra_verbose" = "yes" && cat << EOF
864     Defining EMACS_MAJOR_VERSION = $emacs_major_version
865 EOF
866 cat >> confdefs.h <<EOF
867 #define EMACS_MAJOR_VERSION $emacs_major_version
868 EOF
869 }
870
871 { test "$extra_verbose" = "yes" && cat << EOF
872     Defining EMACS_MINOR_VERSION = $emacs_minor_version
873 EOF
874 cat >> confdefs.h <<EOF
875 #define EMACS_MINOR_VERSION $emacs_minor_version
876 EOF
877 }
878
879 if test -n "$emacs_beta_version" ; then
880   if test "$beta" = "yes"; then
881         version="${version}-b${emacs_beta_version}"
882         { test "$extra_verbose" = "yes" && cat << EOF
883     Defining EMACS_BETA_VERSION = $emacs_beta_version
884 EOF
885 cat >> confdefs.h <<EOF
886 #define EMACS_BETA_VERSION $emacs_beta_version
887 EOF
888 }
889
890   else
891         version="${version}.${emacs_beta_version}"
892         { test "$extra_verbose" = "yes" && cat << EOF
893     Defining EMACS_PATCH_LEVEL = $emacs_beta_version
894 EOF
895 cat >> confdefs.h <<EOF
896 #define EMACS_PATCH_LEVEL $emacs_beta_version
897 EOF
898 }
899
900   fi
901 fi
902 { test "$extra_verbose" = "yes" && cat << EOF
903     Defining XEMACS_CODENAME = "$xemacs_codename"
904 EOF
905 cat >> confdefs.h <<EOF
906 #define XEMACS_CODENAME "$xemacs_codename"
907 EOF
908 }
909
910 { test "$extra_verbose" = "yes" && cat << EOF
911     Defining EMACS_VERSION = "$version"
912 EOF
913 cat >> confdefs.h <<EOF
914 #define EMACS_VERSION "$version"
915 EOF
916 }
917
918
919 if test "$with_infodock" = "yes"; then
920   if test ! -f ../../ID-INSTALL; then
921     echo "Cannot build InfoDock without InfoDock sources"
922     with_infodock=no
923   fi
924 fi
925
926 if test "$with_infodock" = "yes"; then
927       { test "$extra_verbose" = "yes" && cat << EOF
928     Defining INFODOCK_MAJOR_VERSION = $infodock_major_version
929 EOF
930 cat >> confdefs.h <<EOF
931 #define INFODOCK_MAJOR_VERSION $infodock_major_version
932 EOF
933 }
934
935   { test "$extra_verbose" = "yes" && cat << EOF
936     Defining INFODOCK_MINOR_VERSION = $infodock_minor_version
937 EOF
938 cat >> confdefs.h <<EOF
939 #define INFODOCK_MINOR_VERSION $infodock_minor_version
940 EOF
941 }
942
943   { test "$extra_verbose" = "yes" && cat << EOF
944     Defining INFODOCK_BUILD_VERSION = $infodock_build_version
945 EOF
946 cat >> confdefs.h <<EOF
947 #define INFODOCK_BUILD_VERSION $infodock_build_version
948 EOF
949 }
950
951   version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
952   PROGNAME=infodock
953   CPPFLAGS="$CPPFLAGS -DINFODOCK"
954 else
955   PROGNAME=xemacs
956 fi
957
958 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
959 test "${error_check_extents=$beta}"   = yes && { test "$extra_verbose" = "yes" && cat << \EOF
960     Defining ERROR_CHECK_EXTENTS
961 EOF
962 cat >> confdefs.h <<\EOF
963 #define ERROR_CHECK_EXTENTS 1
964 EOF
965 }
966
967 test "${error_check_typecheck=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
968     Defining ERROR_CHECK_TYPECHECK
969 EOF
970 cat >> confdefs.h <<\EOF
971 #define ERROR_CHECK_TYPECHECK 1
972 EOF
973 }
974
975 test "${error_check_bufpos=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
976     Defining ERROR_CHECK_BUFPOS
977 EOF
978 cat >> confdefs.h <<\EOF
979 #define ERROR_CHECK_BUFPOS 1
980 EOF
981 }
982
983 test "${error_check_gc=$beta}"        = yes && { test "$extra_verbose" = "yes" && cat << \EOF
984     Defining ERROR_CHECK_GC
985 EOF
986 cat >> confdefs.h <<\EOF
987 #define ERROR_CHECK_GC 1
988 EOF
989 }
990
991 test "${error_check_malloc=$beta}"    = yes && { test "$extra_verbose" = "yes" && cat << \EOF
992     Defining ERROR_CHECK_MALLOC
993 EOF
994 cat >> confdefs.h <<\EOF
995 #define ERROR_CHECK_MALLOC 1
996 EOF
997 }
998
999 test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF
1000     Defining ERROR_CHECK_BYTE_CODE
1001 EOF
1002 cat >> confdefs.h <<\EOF
1003 #define ERROR_CHECK_BYTE_CODE 1
1004 EOF
1005 }
1006
1007 if test "${debug:=$beta}" = "yes"; then
1008   use_assertions=yes memory_usage_stats=yes
1009   extra_objs="$extra_objs debug.o" &&  if test "$extra_verbose" = "yes"; then
1010    echo "    xemacs will be linked with \"debug.o\""
1011  fi
1012   { test "$extra_verbose" = "yes" && cat << \EOF
1013     Defining DEBUG_XEMACS
1014 EOF
1015 cat >> confdefs.h <<\EOF
1016 #define DEBUG_XEMACS 1
1017 EOF
1018 }
1019
1020 fi
1021 test "$use_assertions"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1022     Defining USE_ASSERTIONS
1023 EOF
1024 cat >> confdefs.h <<\EOF
1025 #define USE_ASSERTIONS 1
1026 EOF
1027 }
1028
1029 test "$memory_usage_stats" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
1030     Defining MEMORY_USAGE_STATS
1031 EOF
1032 cat >> confdefs.h <<\EOF
1033 #define MEMORY_USAGE_STATS 1
1034 EOF
1035 }
1036
1037
1038
1039 echo $ac_n "checking "host system type"""... $ac_c" 1>&6
1040 echo "configure:1041: checking "host system type"" >&5
1041 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1042 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1043 configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1044 canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
1045 echo "$ac_t""$configuration" 1>&6
1046
1047
1048
1049
1050
1051 machine='' opsys=''
1052
1053 case "$canonical" in
1054   sparc-*-*        ) machine=sparc ;;
1055   alpha*-*-*       ) machine=alpha ;;
1056   vax-*-*          ) machine=vax ;;
1057   mips-dec-*       ) machine=pmax ;;
1058   mips-sgi-*       ) machine=iris4d ;;
1059   romp-ibm-*       ) machine=ibmrt ;;
1060   rs6000-ibm-aix*  ) machine=ibmrs6000 ;;
1061   powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1062   powerpc*-*       ) machine=powerpc ;;
1063   hppa-*-*         ) machine=hp800 ;;
1064   m88k-dg-*        ) machine=aviion ;;
1065   m68*-sony-*      ) machine=news ;;
1066   mips-sony-*      ) machine=news-risc ;;
1067   clipper-*        ) machine=clipper ;;
1068   arm-*            ) machine=arm ;;
1069   ns32k-*          ) machine=ns32000 ;;
1070 esac
1071
1072 case "$canonical" in
1073   *-*-linux*    ) opsys=linux ;;
1074   *-*-netbsd*   ) opsys=netbsd ;;
1075   *-*-openbsd*  ) opsys=openbsd ;;
1076   *-*-nextstep* ) opsys=nextstep ;;
1077   *-*-vms       ) opsys=vms ;;
1078
1079     *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1080   *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1081   *-dec-osf3.[2-9]         ) opsys=decosf3-2 ;;
1082   *-dec-osf3*                ) opsys=decosf3-1 ;;
1083   *-dec-osf4*                ) opsys=decosf4-0 ;;
1084
1085     *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1086   *-*-ultrix4.[12]* ) opsys=bsd4-3 ;;
1087   *-*-ultrix* )         opsys=ultrix4-3 ;;
1088
1089     *-*-aix3.1*  ) opsys=aix3-1 ;;
1090   *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1091   *-*-aix3*    ) opsys=aix3-2   ;;
1092   *-*-aix4.0*  ) opsys=aix4     ;;
1093   *-*-aix4.1*  ) opsys=aix4-1   ;;
1094   *-*-aix4*    ) opsys=aix4-2   ;;
1095
1096     *-gnu* )                    opsys=gnu    ;;
1097   *-*-bsd4.[01] )               opsys=bsd4-1 ;;
1098   *-*-bsd4.2 )                  opsys=bsd4-2 ;;
1099   *-*-bsd4.3 )                  opsys=bsd4-3 ;;
1100   *-*-aos4.2 )                  opsys=bsd4-2 ;;
1101   *-*-aos*   )                  opsys=bsd4-3 ;;
1102   *-*-sysv0    | *-*-sysvr0 )   opsys=usg5-0 ;;
1103   *-*-sysv2    | *-*-sysvr2 )   opsys=usg5-2 ;;
1104   *-*-sysv2.2  | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1105   *-*-sysv3*   | *-*-sysvr3* )  opsys=usg5-3 ;;
1106   *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1107   *-*-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1108         if test -z "$NON_GNU_CPP" ; then
1109           for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1110             if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1111           done
1112         fi
1113         opsys=usg5-4-2 ;;
1114     *-sysv4* | *-sysvr4* )      opsys=usg5-4 ;;
1115     *-*-mach_bsd4.3* )          opsys=mach-bsd4-3 ;;
1116 esac
1117
1118 case "$canonical" in
1119
1120     *-*-netbsd* )
1121     case "$canonical" in
1122       i[3-9]86-*-netbsd*) machine=intel386 ;;
1123       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1124                                             machine=hp9000s300 ;;
1125       pc532-*-netbsd* | ns32k-*-netbsd* )  machine=ns32000 ;;
1126       pmax-*-netbsd*  | mips-*-netbsd*  )  machine=pmax ;;
1127     esac
1128   ;;
1129
1130     *-*-openbsd* )
1131     case "${canonical}" in
1132       i386-*-openbsd*)          machine=intel386 ;;
1133       m68k-*-openbsd*)          machine=hp9000s300 ;;
1134       mipsel-*-openbsd*)        machine=pmax ;;
1135      esac
1136    ;;
1137
1138     arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1139   arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1140
1141     fx80-alliant-* ) machine=alliant4     opsys=bsd4-2 ;;
1142   i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1143
1144     m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1145
1146     580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1147
1148     m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1149
1150     we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1151
1152     m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1153
1154     rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1155   m68*-bull-sysv3*  ) machine=dpx2      opsys=usg5-3 ;; # dpx2
1156   m68*-bull-sysv2*  ) machine=sps7      opsys=usg5-2 ;; # sps7
1157
1158   
1159     celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1160
1161     *-convex-bsd* | *-convex-convexos* )
1162     machine=convex opsys=bsd4-3
1163     NON_GNU_CPP="cc -E -P"
1164   ;;
1165
1166     i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1167
1168     i586-dg-dgux*R4*   | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1169   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1170   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1171   m88k-dg-dgux*                           ) opsys=dgux     ;;
1172
1173     m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1174   m88k-motorola-sysv4* )
1175                     machine=delta88k opsys=usg5-4-2
1176   ;;
1177   m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1178
1179     m68*-dual-sysv*    ) machine=dual opsys=usg5-2   ;;
1180   m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1181
1182     ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1183
1184     pn-gould-bsd4.2* ) machine=gould     opsys=bsd4-2 ;;
1185   pn-gould-bsd4.3* ) machine=gould     opsys=bsd4-3 ;;
1186   np1-gould-bsd* )   machine=gould-np1 opsys=bsd4-3 ;;
1187
1188       m88k-harris-cxux* )
1189         case "`uname -r`" in
1190        [56].[0-9] ) machine=nh4000 opsys=cxux  ;;
1191        [7].[0-9]  ) machine=nh4000 opsys=cxux7 ;;
1192     esac
1193     NON_GNU_CPP="/lib/cpp"
1194   ;;
1195     m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1196     powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1197
1198     xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1199
1200     m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1201
1202     *-hp-hpux* )
1203         case "$canonical" in
1204       m68*  ) machine=hp9000s300 ;;
1205       hppa* ) machine=hp800      ;;
1206     esac
1207
1208     case "$canonical" in
1209       *-hp-hpux7*  )  opsys=hpux   ;;
1210       *-hp-hpux8*  )  opsys=hpux8  ;;
1211       *-hp-hpux9*  )  opsys=hpux9  ;;
1212       *-hp-hpux10* )  opsys=hpux10 ;;
1213       *-hp-hpux11* )  opsys=hpux11 ;;
1214       *            )  opsys=hpux   ;;
1215     esac
1216
1217         case "$opsys" in hpux9 | hpux10 ) extra_objs="$extra_objs strcat.o" &&  if test "$extra_verbose" = "yes"; then
1218    echo "    xemacs will be linked with \"strcat.o\""
1219  fi ;; esac
1220
1221     if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1222         ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1223     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1224
1225     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1226   ;;
1227
1228     orion-orion-bsd*   ) machine=orion    opsys=bsd4-2 ;;
1229   clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1230
1231     i[3-9]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1232   i[3-9]86-ibm-aix1.[23]* | i[3-9]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1233   i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1234   romp-ibm-aos*    ) opsys=bsd4-3 ;;
1235   romp-ibm-bsd*    ) opsys=bsd4-3 ;;
1236   romp-ibm-mach*   ) opsys=mach-bsd4-3 ;;
1237
1238     m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1239   m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1240
1241     i[3-9]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1242
1243     i[3-9]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1244
1245     i[3-9]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1246
1247     i[3-9]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1248
1249       i[3-9]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1250
1251     i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1252
1253     i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1254
1255     m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1256
1257     m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1258
1259         mips-mips-usg* ) machine=mips4 ;;
1260   mips-mips-riscos4 )
1261     machine=mips4
1262     NON_GNU_CC="cc -systype bsd43"
1263     NON_GNU_CPP="cc -systype bsd43 -E"
1264     case "$canonical" in
1265       mips-mips-riscos4* ) opsys=bsd4-3  ;;
1266       mips-mips-riscos5* ) opsys=riscos5 ;;
1267     esac
1268   ;;
1269   mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1270   mips-mips-*    ) machine=mips opsys=usg5-2-2 ;;
1271
1272     m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1273
1274     ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1275
1276     m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32   opsys=usg5-2-2 ;;
1277   m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1278
1279     m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1280
1281     m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1282
1283     m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1284
1285     pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1286
1287     ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1288   ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1289
1290     mips-siemens-sysv* | mips-sni-sysv*)
1291     machine=mips-siemens opsys=usg5-4
1292     NON_GNU_CC=/usr/ccs/bin/cc
1293     NON_GNU_CPP=/usr/ccs/lib/cpp
1294   ;;
1295
1296     mips-nec-sysv*)
1297     machine=mips-nec
1298     NON_GNU_CC=/usr/ccs/bin/cc
1299     NON_GNU_CPP=/usr/ccs/lib/cpp
1300   ;;
1301
1302       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1303   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1304     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
1305   mips-sgi-irix4.*    ) opsys=irix4-0 ;;
1306   mips-sgi-irix6*     ) opsys=irix6-0 ;;
1307   mips-sgi-irix5.1*   ) opsys=irix5-1 ;;
1308   mips-sgi-irix5.2*   ) opsys=irix5-2 ;;
1309   mips-sgi-irix5.*    ) opsys=irix5-3 ;;
1310   mips-sgi-irix*      ) opsys=irix5-0 ;;
1311
1312     *-sony-newsos[34]* | *-sony-news[34]* ) opsys=bsd4-3 ;;
1313   *-sony-news* ) opsys=newsos5 ;;
1314
1315     m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1316
1317     *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1318         case "$canonical" in
1319       m68*-sunos1* )             machine=sun1     ;;
1320       m68*-sunos2* )             machine=sun2     ;;
1321       m68* )                     machine=sun3     ;;
1322       i*86*-sun-sunos[34]* )   machine=sun386   ;;
1323       i*86-*-* )                 machine=intel386 ;;
1324       rs6000* )                  machine=rs6000   ;;
1325     esac
1326
1327         case "$canonical" in *-sunos5*)
1328       canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1329     esac
1330
1331                     case "$canonical" in
1332       *-sunos4* )
1333         #test -f /usr/lib/cpp     && NON_GNU_CPP=/usr/lib/cpp ;;
1334         : ;;
1335       *-solaris2* )
1336         #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1337         RANLIB=':' ;;
1338     esac
1339
1340     case "$canonical" in
1341       *-solaris*          )
1342         opsys=sol2
1343         os_release=`uname -r | sed -e 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'`
1344         { test "$extra_verbose" = "yes" && cat << EOF
1345     Defining OS_RELEASE = $os_release
1346 EOF
1347 cat >> confdefs.h <<EOF
1348 #define OS_RELEASE $os_release
1349 EOF
1350 }
1351  ;;
1352
1353             i*86-*-sunos4*      ) opsys=sunos4-0        ;;
1354       *-sunos4.0*         ) opsys=sunos4-0      ;;
1355       *-sunos4.1.2*       ) opsys=sunos4-1-2    ;;
1356       *-sunos4.1.3*       ) opsys=sunos4-1-3    ;;
1357       *-sunos4.1.[4-9]* ) opsys=sunos4-1-4      ;;
1358       *-sunos4* | *-sunos ) opsys=sunos4-1      ;;
1359       *-mach*             ) opsys=mach-bsd4-3   ;;
1360       *                   ) opsys=bsd4-2        ;;
1361     esac
1362
1363     case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1364
1365         test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1366   ;;
1367
1368     m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1369
1370     tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1371   tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1372
1373     mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1374
1375     m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1376
1377     ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1378       m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1379
1380     titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1381
1382     m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1383
1384     vax-dec-* )
1385     case "$canonical" in
1386       *-sysv[01]* | *-sysvr[01]* )      opsys=usg5-0 ;;
1387       *-sysv2* | *-sysvr2* )            opsys=usg5-2 ;;
1388       *-mach* )                         opsys=mach-bsd4-3 ;;
1389     esac
1390   ;;
1391
1392     ns16k-whitechapel-* ) machine=mg1 ;;
1393
1394     m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1395
1396     i[3-9]86-*-* )
1397     machine=intel386
1398     case "$canonical" in
1399       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1400       *-isc2.2* )               opsys=isc2-2 ;;
1401       *-isc4.0* )               opsys=isc4-0 ;;
1402       *-isc4.* )                opsys=isc4-1
1403                                 GCC_TEST_OPTIONS=-posix
1404                                 NON_GCC_TEST_OPTIONS=-Xp
1405                                 ;;
1406       *-isc* )                  opsys=isc3-0 ;;
1407       *-esix5* )                opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1408       *-esix* )                 opsys=esix ;;
1409       *-mach* )                 opsys=mach-bsd4-3 ;;
1410       *-xenix* )                opsys=xenix ;;
1411       *-sco3.2v4* )             opsys=sco4 NON_GNU_CPP=/lib/cpp  ;;
1412       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
1413       *-bsdi4* )                opsys=bsdos4 ;;
1414       *-bsdi3* )                opsys=bsdos3 ;;
1415       *-bsdi2.1* )              opsys=bsdos2-1 ;;
1416       *-bsdi2* )                opsys=bsdos2 ;;
1417       *-sco3.2v5* )             opsys=sco5 ;
1418                                                         if test "$dynamic" = "yes" ; then
1419                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF"  ;
1420         else
1421                 NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;
1422         fi ;;
1423       *-386bsd* )               opsys=386bsd ;;
1424       *-freebsd* )              opsys=freebsd ;;
1425       *-nextstep* )             opsys=nextstep ;;
1426       *-pc-cygwin* )            opsys=cygwin32 ;;
1427       *-pc-mingw* )             opsys=mingw32 ;
1428                                 test -z "$with_tty" && with_tty="no";;
1429           esac
1430   ;;
1431
1432     m68k-*-linux* ) machine=m68k opsys=linux ;;
1433
1434 esac
1435
1436 if test -z "$machine" -o -z "$opsys"; then
1437   (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
1438    echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
1439   ) >&2
1440   exit 1
1441 fi
1442
1443 if test -z "$dynamic"; then
1444   case "$opsys" in
1445     hpux* | sunos4* ) dynamic=no ;;
1446     *) dynamic=yes ;;
1447   esac
1448 fi
1449 if test "$dynamic" = "yes"; then
1450   case "$opsys" in
1451     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1452     decosf* ) ld_call_shared="-call_shared" ;;
1453   esac
1454 else   case "$opsys" in
1455     sol2 )
1456       echo "Static linking is not supported on Solaris 2."
1457       echo "Rerun configure without specifying --dynamic=no."
1458       exit 1 ;;
1459     linux   ) ld_call_shared="-Bstatic" ;;
1460     decosf* ) ld_call_shared="-non_shared" ;;
1461   esac
1462 fi
1463
1464 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1465
1466 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1467 { test "$extra_verbose" = "yes" && cat << EOF
1468     Defining STACK_TRACE_EYE_CATCHER = $stack_trace_eye_catcher
1469 EOF
1470 cat >> confdefs.h <<EOF
1471 #define STACK_TRACE_EYE_CATCHER $stack_trace_eye_catcher
1472 EOF
1473 }
1474
1475
1476 machfile="m/${machine}.h"
1477 opsysfile="s/${opsys}.h"
1478
1479
1480 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1481 if test "$with_workshop $with_tooltalk" = "yes no"; then
1482   (echo "$progname: Usage error:"
1483 echo " " "--with-workshop requires --with-tooltalk"
1484 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
1485 elif test "$with_tooltalk" = "no" ; then with_workshop=no
1486 elif test "$with_workshop" = "yes"; then with_tooltalk=yes
1487 fi
1488
1489 if test "$with_workshop" = "yes"; then
1490   { test "$extra_verbose" = "yes" && cat << \EOF
1491     Defining SUNPRO
1492 EOF
1493 cat >> confdefs.h <<\EOF
1494 #define SUNPRO 1
1495 EOF
1496 }
1497
1498   extra_objs="$extra_objs sunpro.o" &&  if test "$extra_verbose" = "yes"; then
1499    echo "    xemacs will be linked with \"sunpro.o\""
1500  fi
1501 fi
1502
1503 if test "$with_clash_detection" = "yes"; then
1504   { test "$extra_verbose" = "yes" && cat << \EOF
1505     Defining CLASH_DETECTION
1506 EOF
1507 cat >> confdefs.h <<\EOF
1508 #define CLASH_DETECTION 1
1509 EOF
1510 }
1511
1512   extra_objs="$extra_objs filelock.o" &&  if test "$extra_verbose" = "yes"; then
1513    echo "    xemacs will be linked with \"filelock.o\""
1514  fi
1515 fi
1516
1517 test -n "$compiler" && CC="$compiler"
1518 if test "$with_gcc" = "no"; then   case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1519 fi
1520
1521 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1522 if test "${CFLAGS-unset}" != unset
1523   then cflags_specified=yes;
1524   else cflags_specified=no;
1525 fi
1526
1527 xe_save_CFLAGS="$CFLAGS"
1528
1529 # Extract the first word of "gcc", so it can be a program name with args.
1530 set dummy gcc; ac_word=$2
1531 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1532 echo "configure:1533: checking for $ac_word" >&5
1533
1534 if test -n "$CC"; then
1535   ac_cv_prog_CC="$CC" # Let the user override the test.
1536 else
1537   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1538   for ac_dir in $PATH; do
1539     test -z "$ac_dir" && ac_dir=.
1540     if test -f $ac_dir/$ac_word; then
1541       ac_cv_prog_CC="gcc"
1542       break
1543     fi
1544   done
1545   IFS="$ac_save_ifs"
1546 fi
1547 CC="$ac_cv_prog_CC"
1548 if test -n "$CC"; then
1549   echo "$ac_t""$CC" 1>&6
1550 else
1551   echo "$ac_t""no" 1>&6
1552 fi
1553
1554 if test -z "$CC"; then
1555   # Extract the first word of "cc", so it can be a program name with args.
1556 set dummy cc; ac_word=$2
1557 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1558 echo "configure:1559: checking for $ac_word" >&5
1559
1560 if test -n "$CC"; then
1561   ac_cv_prog_CC="$CC" # Let the user override the test.
1562 else
1563   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1564   ac_prog_rejected=no
1565   for ac_dir in $PATH; do
1566     test -z "$ac_dir" && ac_dir=.
1567     if test -f $ac_dir/$ac_word; then
1568       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1569         ac_prog_rejected=yes
1570         continue
1571       fi
1572       ac_cv_prog_CC="cc"
1573       break
1574     fi
1575   done
1576   IFS="$ac_save_ifs"
1577 if test $ac_prog_rejected = yes; then
1578   # We found a bogon in the path, so make sure we never use it.
1579   set dummy $ac_cv_prog_CC
1580   shift
1581   if test $# -gt 0; then
1582     # We chose a different compiler from the bogus one.
1583     # However, it has the same basename, so the bogon will be chosen
1584     # first if we set CC to just the basename; use the full file name.
1585     shift
1586     set dummy "$ac_dir/$ac_word" "$@"
1587     shift
1588     ac_cv_prog_CC="$@"
1589   fi
1590 fi
1591 fi
1592 CC="$ac_cv_prog_CC"
1593 if test -n "$CC"; then
1594   echo "$ac_t""$CC" 1>&6
1595 else
1596   echo "$ac_t""no" 1>&6
1597 fi
1598
1599   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1600 fi
1601
1602 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1603 echo "configure:1604: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1604
1605 ac_ext=c
1606 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1607 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1608 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1609 ac_cpp='$CPP '"$xe_cppflags"
1610 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1611 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1612 cross_compiling=no
1613
1614 cat > conftest.$ac_ext <<EOF
1615 #line 1616 "configure"
1616 #include "confdefs.h"
1617 main(){return(0);}
1618 EOF
1619 if { (eval echo configure:1620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1620   ac_cv_prog_cc_works=yes
1621   # If we can't run a trivial program, we are probably using a cross compiler.
1622   if (./conftest; exit) 2>/dev/null; then
1623     ac_cv_prog_cc_cross=no
1624   else
1625     ac_cv_prog_cc_cross=yes
1626   fi
1627 else
1628   echo "configure: failed program was:" >&5
1629   cat conftest.$ac_ext >&5
1630   ac_cv_prog_cc_works=no
1631 fi
1632 rm -fr conftest*
1633
1634 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1635 if test $ac_cv_prog_cc_works = no; then
1636   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1637 fi
1638 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1639 echo "configure:1640: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1640 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1641 cross_compiling=$ac_cv_prog_cc_cross
1642
1643 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1644 echo "configure:1645: checking whether we are using GNU C" >&5
1645
1646 cat > conftest.c <<EOF
1647 #ifdef __GNUC__
1648   yes;
1649 #endif
1650 EOF
1651 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1652   ac_cv_prog_gcc=yes
1653 else
1654   ac_cv_prog_gcc=no
1655 fi
1656
1657 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1658
1659 if test $ac_cv_prog_gcc = yes; then
1660   GCC=yes
1661   ac_test_CFLAGS="${CFLAGS+set}"
1662   ac_save_CFLAGS="$CFLAGS"
1663   CFLAGS=
1664   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1665 echo "configure:1666: checking whether ${CC-cc} accepts -g" >&5
1666
1667 echo 'void f(){}' > conftest.c
1668 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1669   ac_cv_prog_cc_g=yes
1670 else
1671   ac_cv_prog_cc_g=no
1672 fi
1673 rm -f conftest*
1674
1675
1676 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1677   if test "$ac_test_CFLAGS" = set; then
1678     CFLAGS="$ac_save_CFLAGS"
1679   elif test $ac_cv_prog_cc_g = yes; then
1680     CFLAGS="-g -O2"
1681   else
1682     CFLAGS="-O2"
1683   fi
1684 else
1685   GCC=
1686   test "${CFLAGS+set}" = set || CFLAGS="-g"
1687 fi
1688  
1689 if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
1690   CC=${NON_GNU_CC-cc}
1691   # Extract the first word of "gcc", so it can be a program name with args.
1692 set dummy gcc; ac_word=$2
1693 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1694 echo "configure:1695: checking for $ac_word" >&5
1695
1696 if test -n "$CC"; then
1697   ac_cv_prog_CC="$CC" # Let the user override the test.
1698 else
1699   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1700   for ac_dir in $PATH; do
1701     test -z "$ac_dir" && ac_dir=.
1702     if test -f $ac_dir/$ac_word; then
1703       ac_cv_prog_CC="gcc"
1704       break
1705     fi
1706   done
1707   IFS="$ac_save_ifs"
1708 fi
1709 CC="$ac_cv_prog_CC"
1710 if test -n "$CC"; then
1711   echo "$ac_t""$CC" 1>&6
1712 else
1713   echo "$ac_t""no" 1>&6
1714 fi
1715
1716 if test -z "$CC"; then
1717   # Extract the first word of "cc", so it can be a program name with args.
1718 set dummy cc; ac_word=$2
1719 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1720 echo "configure:1721: checking for $ac_word" >&5
1721
1722 if test -n "$CC"; then
1723   ac_cv_prog_CC="$CC" # Let the user override the test.
1724 else
1725   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1726   ac_prog_rejected=no
1727   for ac_dir in $PATH; do
1728     test -z "$ac_dir" && ac_dir=.
1729     if test -f $ac_dir/$ac_word; then
1730       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1731         ac_prog_rejected=yes
1732         continue
1733       fi
1734       ac_cv_prog_CC="cc"
1735       break
1736     fi
1737   done
1738   IFS="$ac_save_ifs"
1739 if test $ac_prog_rejected = yes; then
1740   # We found a bogon in the path, so make sure we never use it.
1741   set dummy $ac_cv_prog_CC
1742   shift
1743   if test $# -gt 0; then
1744     # We chose a different compiler from the bogus one.
1745     # However, it has the same basename, so the bogon will be chosen
1746     # first if we set CC to just the basename; use the full file name.
1747     shift
1748     set dummy "$ac_dir/$ac_word" "$@"
1749     shift
1750     ac_cv_prog_CC="$@"
1751   fi
1752 fi
1753 fi
1754 CC="$ac_cv_prog_CC"
1755 if test -n "$CC"; then
1756   echo "$ac_t""$CC" 1>&6
1757 else
1758   echo "$ac_t""no" 1>&6
1759 fi
1760
1761   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1762 fi
1763
1764 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1765 echo "configure:1766: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1766
1767 ac_ext=c
1768 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1769 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1770 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1771 ac_cpp='$CPP '"$xe_cppflags"
1772 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1773 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1774 cross_compiling=no
1775
1776 cat > conftest.$ac_ext <<EOF
1777 #line 1778 "configure"
1778 #include "confdefs.h"
1779 main(){return(0);}
1780 EOF
1781 if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1782   ac_cv_prog_cc_works=yes
1783   # If we can't run a trivial program, we are probably using a cross compiler.
1784   if (./conftest; exit) 2>/dev/null; then
1785     ac_cv_prog_cc_cross=no
1786   else
1787     ac_cv_prog_cc_cross=yes
1788   fi
1789 else
1790   echo "configure: failed program was:" >&5
1791   cat conftest.$ac_ext >&5
1792   ac_cv_prog_cc_works=no
1793 fi
1794 rm -fr conftest*
1795
1796 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1797 if test $ac_cv_prog_cc_works = no; then
1798   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1799 fi
1800 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1801 echo "configure:1802: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1802 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1803 cross_compiling=$ac_cv_prog_cc_cross
1804
1805 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1806 echo "configure:1807: checking whether we are using GNU C" >&5
1807
1808 cat > conftest.c <<EOF
1809 #ifdef __GNUC__
1810   yes;
1811 #endif
1812 EOF
1813 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1814   ac_cv_prog_gcc=yes
1815 else
1816   ac_cv_prog_gcc=no
1817 fi
1818
1819 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1820
1821 if test $ac_cv_prog_gcc = yes; then
1822   GCC=yes
1823   ac_test_CFLAGS="${CFLAGS+set}"
1824   ac_save_CFLAGS="$CFLAGS"
1825   CFLAGS=
1826   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1827 echo "configure:1828: checking whether ${CC-cc} accepts -g" >&5
1828
1829 echo 'void f(){}' > conftest.c
1830 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1831   ac_cv_prog_cc_g=yes
1832 else
1833   ac_cv_prog_cc_g=no
1834 fi
1835 rm -f conftest*
1836
1837
1838 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1839   if test "$ac_test_CFLAGS" = set; then
1840     CFLAGS="$ac_save_CFLAGS"
1841   elif test $ac_cv_prog_cc_g = yes; then
1842     CFLAGS="-g -O2"
1843   else
1844     CFLAGS="-O2"
1845   fi
1846 else
1847   GCC=
1848   test "${CFLAGS+set}" = set || CFLAGS="-g"
1849 fi
1850
1851 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1852   CC=gcc
1853   # Extract the first word of "gcc", so it can be a program name with args.
1854 set dummy gcc; ac_word=$2
1855 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1856 echo "configure:1857: checking for $ac_word" >&5
1857
1858 if test -n "$CC"; then
1859   ac_cv_prog_CC="$CC" # Let the user override the test.
1860 else
1861   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1862   for ac_dir in $PATH; do
1863     test -z "$ac_dir" && ac_dir=.
1864     if test -f $ac_dir/$ac_word; then
1865       ac_cv_prog_CC="gcc"
1866       break
1867     fi
1868   done
1869   IFS="$ac_save_ifs"
1870 fi
1871 CC="$ac_cv_prog_CC"
1872 if test -n "$CC"; then
1873   echo "$ac_t""$CC" 1>&6
1874 else
1875   echo "$ac_t""no" 1>&6
1876 fi
1877
1878 if test -z "$CC"; then
1879   # Extract the first word of "cc", so it can be a program name with args.
1880 set dummy cc; ac_word=$2
1881 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1882 echo "configure:1883: checking for $ac_word" >&5
1883
1884 if test -n "$CC"; then
1885   ac_cv_prog_CC="$CC" # Let the user override the test.
1886 else
1887   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1888   ac_prog_rejected=no
1889   for ac_dir in $PATH; do
1890     test -z "$ac_dir" && ac_dir=.
1891     if test -f $ac_dir/$ac_word; then
1892       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1893         ac_prog_rejected=yes
1894         continue
1895       fi
1896       ac_cv_prog_CC="cc"
1897       break
1898     fi
1899   done
1900   IFS="$ac_save_ifs"
1901 if test $ac_prog_rejected = yes; then
1902   # We found a bogon in the path, so make sure we never use it.
1903   set dummy $ac_cv_prog_CC
1904   shift
1905   if test $# -gt 0; then
1906     # We chose a different compiler from the bogus one.
1907     # However, it has the same basename, so the bogon will be chosen
1908     # first if we set CC to just the basename; use the full file name.
1909     shift
1910     set dummy "$ac_dir/$ac_word" "$@"
1911     shift
1912     ac_cv_prog_CC="$@"
1913   fi
1914 fi
1915 fi
1916 CC="$ac_cv_prog_CC"
1917 if test -n "$CC"; then
1918   echo "$ac_t""$CC" 1>&6
1919 else
1920   echo "$ac_t""no" 1>&6
1921 fi
1922
1923   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1924 fi
1925
1926 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1927 echo "configure:1928: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1928
1929 ac_ext=c
1930 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
1931 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
1932 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
1933 ac_cpp='$CPP '"$xe_cppflags"
1934 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&5'
1935 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
1936 cross_compiling=no
1937
1938 cat > conftest.$ac_ext <<EOF
1939 #line 1940 "configure"
1940 #include "confdefs.h"
1941 main(){return(0);}
1942 EOF
1943 if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1944   ac_cv_prog_cc_works=yes
1945   # If we can't run a trivial program, we are probably using a cross compiler.
1946   if (./conftest; exit) 2>/dev/null; then
1947     ac_cv_prog_cc_cross=no
1948   else
1949     ac_cv_prog_cc_cross=yes
1950   fi
1951 else
1952   echo "configure: failed program was:" >&5
1953   cat conftest.$ac_ext >&5
1954   ac_cv_prog_cc_works=no
1955 fi
1956 rm -fr conftest*
1957
1958 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1959 if test $ac_cv_prog_cc_works = no; then
1960   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1961 fi
1962 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1963 echo "configure:1964: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1964 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1965 cross_compiling=$ac_cv_prog_cc_cross
1966
1967 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1968 echo "configure:1969: checking whether we are using GNU C" >&5
1969
1970 cat > conftest.c <<EOF
1971 #ifdef __GNUC__
1972   yes;
1973 #endif
1974 EOF
1975 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1976   ac_cv_prog_gcc=yes
1977 else
1978   ac_cv_prog_gcc=no
1979 fi
1980
1981 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1982
1983 if test $ac_cv_prog_gcc = yes; then
1984   GCC=yes
1985   ac_test_CFLAGS="${CFLAGS+set}"
1986   ac_save_CFLAGS="$CFLAGS"
1987   CFLAGS=
1988   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1989 echo "configure:1990: checking whether ${CC-cc} accepts -g" >&5
1990
1991 echo 'void f(){}' > conftest.c
1992 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1993   ac_cv_prog_cc_g=yes
1994 else
1995   ac_cv_prog_cc_g=no
1996 fi
1997 rm -f conftest*
1998
1999
2000 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2001   if test "$ac_test_CFLAGS" = set; then
2002     CFLAGS="$ac_save_CFLAGS"
2003   elif test $ac_cv_prog_cc_g = yes; then
2004     CFLAGS="-g -O2"
2005   else
2006     CFLAGS="-O2"
2007   fi
2008 else
2009   GCC=
2010   test "${CFLAGS+set}" = set || CFLAGS="-g"
2011 fi
2012
2013 fi
2014 CFLAGS="$xe_save_CFLAGS"
2015
2016
2017 test -n "$CPP" -a -d "$CPP" && CPP=
2018
2019 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
2020
2021 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2022 echo "configure:2023: checking how to run the C preprocessor" >&5
2023 # On Suns, sometimes $CPP names a directory.
2024 if test -n "$CPP" && test -d "$CPP"; then
2025   CPP=
2026 fi
2027 if test -z "$CPP"; then
2028
2029   # This must be in double quotes, not single quotes, because CPP may get
2030   # substituted into the Makefile and "${CC-cc}" will confuse make.
2031   CPP="${CC-cc} -E"
2032   # On the NeXT, cc -E runs the code through the compiler's parser,
2033   # not just through cpp.
2034   cat > conftest.$ac_ext <<EOF
2035 #line 2036 "configure"
2036 #include "confdefs.h"
2037 #include <assert.h>
2038 Syntax Error
2039 EOF
2040 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2041 { (eval echo configure:2042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2042 ac_err=`grep -v '^ *+' conftest.out`
2043 if test -z "$ac_err"; then
2044   :
2045 else
2046   echo "$ac_err" >&5
2047   echo "configure: failed program was:" >&5
2048   cat conftest.$ac_ext >&5
2049   rm -rf conftest*
2050   CPP="${CC-cc} -E -traditional-cpp"
2051   cat > conftest.$ac_ext <<EOF
2052 #line 2053 "configure"
2053 #include "confdefs.h"
2054 #include <assert.h>
2055 Syntax Error
2056 EOF
2057 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2058 { (eval echo configure:2059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2059 ac_err=`grep -v '^ *+' conftest.out`
2060 if test -z "$ac_err"; then
2061   :
2062 else
2063   echo "$ac_err" >&5
2064   echo "configure: failed program was:" >&5
2065   cat conftest.$ac_ext >&5
2066   rm -rf conftest*
2067   CPP=/lib/cpp
2068 fi
2069 rm -f conftest*
2070 fi
2071 rm -f conftest*
2072   ac_cv_prog_CPP="$CPP"
2073   CPP="$ac_cv_prog_CPP"
2074 else
2075   ac_cv_prog_CPP="$CPP"
2076 fi
2077 echo "$ac_t""$CPP" 1>&6
2078
2079
2080 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2081 echo "configure:2082: checking for AIX" >&5
2082 cat > conftest.$ac_ext <<EOF
2083 #line 2084 "configure"
2084 #include "confdefs.h"
2085 #ifdef _AIX
2086   yes
2087 #endif
2088
2089 EOF
2090 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2091   egrep "yes" >/dev/null 2>&1; then
2092   rm -rf conftest*
2093   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
2094     Defining _ALL_SOURCE
2095 EOF
2096 cat >> confdefs.h <<\EOF
2097 #define _ALL_SOURCE 1
2098 EOF
2099 }
2100
2101 else
2102   rm -rf conftest*
2103   echo "$ac_t""no" 1>&6
2104 fi
2105 rm -f conftest*
2106
2107
2108
2109 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
2110 echo "configure:2111: checking for GNU libc" >&5
2111 cat > conftest.$ac_ext <<EOF
2112 #line 2113 "configure"
2113 #include "confdefs.h"
2114 #include <features.h>
2115 int main() {
2116
2117 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
2118 #error Not a GNU libc system :-(
2119 ******* ======= ******** &&&&&&&&
2120 #endif
2121
2122 ; return 0; }
2123 EOF
2124 if { (eval echo configure:2125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2125   rm -rf conftest*
2126   have_glibc=yes
2127 else
2128   echo "configure: failed program was:" >&5
2129   cat conftest.$ac_ext >&5
2130   rm -rf conftest*
2131   have_glibc=no
2132 fi
2133 rm -f conftest*
2134 echo "$ac_t""$have_glibc" 1>&6
2135 test "$have_glibc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
2136     Defining _GNU_SOURCE
2137 EOF
2138 cat >> confdefs.h <<\EOF
2139 #define _GNU_SOURCE 1
2140 EOF
2141 }
2142
2143
2144
2145 cat > conftest.$ac_ext <<EOF
2146 #line 2147 "configure"
2147 #include "confdefs.h"
2148 int main () {
2149 #if defined __SUNPRO_C
2150 return 11;
2151 #elif defined __DECC
2152 return 12;
2153 #else
2154 return 0;
2155 #endif
2156 }
2157 EOF
2158 if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
2159 then
2160   :
2161 else
2162   conftest_rc="$?"
2163   echo "configure: failed program was:" >&5
2164   cat conftest.$ac_ext >&5
2165   rm -fr conftest*
2166   case "$conftest_rc" in
2167   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
2168   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
2169 esac
2170 fi
2171 rm -fr conftest*
2172
2173
2174
2175
2176 echo "Extracting information from the machine- and system-dependent headers..."
2177
2178 tempcname="conftest.c"
2179
2180
2181
2182 cat > $tempcname <<EOF
2183 #define NOT_C_CODE
2184 #define C_SWITCH_SITE
2185 #define C_SWITCH_X_SITE
2186 #define LD_SWITCH_SITE
2187 #define LD_SWITCH_X_SITE
2188 #define LD_SWITCH_X_SITE_AUX
2189 #define OS_RELEASE $os_release
2190 #include "$srcdir/src/$opsysfile"
2191 #include "$srcdir/src/$machfile"
2192
2193 #ifndef LIBS_MACHINE
2194 #define LIBS_MACHINE
2195 #endif
2196 configure___ libs_machine=LIBS_MACHINE
2197
2198 #ifndef LIBS_SYSTEM
2199 #define LIBS_SYSTEM
2200 #endif
2201 configure___ libs_system=LIBS_SYSTEM
2202
2203 #ifndef LIBS_TERMCAP
2204 #define LIBS_TERMCAP
2205 #endif
2206 configure___ libs_termcap=LIBS_TERMCAP
2207
2208 #ifndef LIB_STANDARD
2209 #define LIB_STANDARD
2210 #endif
2211 configure___ libs_standard=LIB_STANDARD
2212
2213
2214 #ifndef OBJECTS_MACHINE
2215 #define OBJECTS_MACHINE
2216 #endif
2217 configure___ objects_machine=OBJECTS_MACHINE
2218
2219 #ifndef OBJECTS_SYSTEM
2220 #define OBJECTS_SYSTEM
2221 #endif
2222 configure___ objects_system=OBJECTS_SYSTEM
2223
2224
2225 #ifndef C_SWITCH_MACHINE
2226 #define C_SWITCH_MACHINE
2227 #endif
2228 configure___ c_switch_machine=C_SWITCH_MACHINE
2229
2230 #ifndef C_SWITCH_SYSTEM
2231 #define C_SWITCH_SYSTEM
2232 #endif
2233 configure___ c_switch_system=C_SWITCH_SYSTEM
2234
2235
2236 #ifndef LD_SWITCH_MACHINE
2237 #define LD_SWITCH_MACHINE
2238 #endif
2239 configure___ ld_switch_machine=LD_SWITCH_MACHINE
2240
2241 #ifndef LD_SWITCH_SYSTEM
2242 #define LD_SWITCH_SYSTEM
2243 #endif
2244 configure___ ld_switch_system=LD_SWITCH_SYSTEM
2245
2246
2247 #ifndef UNEXEC
2248 #define UNEXEC "unexec.o"
2249 #endif
2250 configure___ unexec=UNEXEC
2251
2252
2253 #ifndef LD_SWITCH_SHARED
2254 #define LD_SWITCH_SHARED "-c"
2255 #endif
2256 configure___ ld_switch_shared=LD_SWITCH_SHARED
2257
2258
2259 #ifdef ORDINARY_LINK
2260 #define LD "\$(CC) \$(CFLAGS)"
2261 #else /* no ORDINARY LINK */
2262 #ifdef COFF_ENCAPSULATE
2263 #define LD "\$(CC) -nostdlib"
2264 #else /* not COFF_ENCAPSULATE */
2265 #ifdef LINKER
2266 #define LD LINKER
2267 #else /* ! defined (LINKER) */
2268 #define LD "ld"
2269 #endif /* ! defined (LINKER) */
2270 #endif /* ! defined (COFF_ENCAPSULATE) */
2271 #endif /* not ORDINARY_LINK */
2272 configure___ ld=LD
2273
2274 #ifndef LIB_GCC
2275 #define LIB_GCC
2276 #endif
2277 configure___ lib_gcc=LIB_GCC
2278
2279 #ifndef LD_TEXT_START_ADDR
2280 #define LD_TEXT_START_ADDR
2281 #endif
2282 configure___ ld_text_start_addr=LD_TEXT_START_ADDR
2283
2284
2285 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
2286 #ifdef NO_REMAP
2287 #ifdef COFF_ENCAPSULATE
2288 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
2289 #else /* ! defined (COFF_ENCAPSULATE) */
2290 #define START_FILES "pre-crt0.o /lib/crt0.o"
2291 #endif /* ! defined (COFF_ENCAPSULATE) */
2292 #else /* ! defined (NO_REMAP) */
2293 #define START_FILES "ecrt0.o"
2294 #endif /* ! defined (NO_REMAP) */
2295 #endif /* no ORDINARY_LINK */
2296 #ifndef START_FILES
2297 #define START_FILES
2298 #endif
2299 configure___ start_files=START_FILES
2300
2301 #ifdef ORDINARY_LINK
2302 configure___ ordinary_link=yes
2303 #else
2304 configure___ ordinary_link=no
2305 #endif
2306
2307 #ifdef SYSTEM_MALLOC
2308 configure___ system_malloc=yes
2309 #else
2310 configure___ system_malloc=no
2311 #endif
2312
2313 #ifdef TERMINFO
2314 configure___ have_terminfo=yes
2315 #else
2316 configure___ have_terminfo=no
2317 #endif
2318
2319 #ifdef MAIL_USE_FLOCK
2320 configure___ mail_use_flock=yes
2321 #else
2322 configure___ mail_use_flock=no
2323 #endif
2324
2325 #ifdef MAIL_USE_LOCKF
2326 configure___ mail_use_lockf=yes
2327 #else
2328 configure___ mail_use_lockf=no
2329 #endif
2330
2331 #ifdef HAVE_WIN32_PROCESSES
2332 configure___ win32_processes=yes
2333 #else
2334 configure___ win32_processes=no
2335 #endif
2336
2337 EOF
2338
2339 CPP=`eval "echo $CPP $CPPFLAGS"`
2340 eval `$CPP -Isrc $tempcname \
2341         | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
2342
2343 rm $tempcname
2344
2345 test "$extra_verbose" = "yes" && \
2346   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 ""
2347
2348 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
2349
2350 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
2351
2352 if test "$cflags_specified" = "no"; then
2353       if   test "$GCC" = "yes"; then
2354     CFLAGS="-g -O3 -Wall -Wno-switch"
2355               elif test "$__SUNPRO_C" = "yes"; then
2356     case "$opsys" in
2357       sol2    ) CFLAGS="-v -xO4" ;;
2358       sunos4* ) CFLAGS="-xO2";;
2359     esac
2360   elif test "$__DECC" = "yes"; then
2361     CFLAGS="-O3"
2362   elif test "$CC" = "xlc"; then
2363     CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
2364     else
2365     CFLAGS="-O" ;  fi
2366 fi
2367
2368
2369 if test "$GCC" = "yes"; then
2370   set x $ld_switch_system; shift; ld_switch_system=""
2371   while test -n "$1"; do
2372     case $1 in
2373       -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
2374       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
2375       -Xlinker* ) ;;
2376       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
2377     esac
2378     shift
2379   done
2380 fi
2381
2382 if test "$GCC" = "yes"; then
2383   set x $ld_switch_machine; shift; ld_switch_machine=""
2384   while test -n "$1"; do
2385     case $1 in
2386       -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
2387       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
2388       -Xlinker* ) ;;
2389       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
2390     esac
2391     shift
2392   done
2393 fi
2394
2395 if test "$GCC" = "yes"; then
2396   set x $LDFLAGS; shift; LDFLAGS=""
2397   while test -n "$1"; do
2398     case $1 in
2399       -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
2400       -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
2401       -Xlinker* ) ;;
2402       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
2403     esac
2404     shift
2405   done
2406 fi
2407
2408 if test "$GCC" = "yes"; then
2409   set x $ld_call_shared; shift; ld_call_shared=""
2410   while test -n "$1"; do
2411     case $1 in
2412       -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
2413       -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
2414       -Xlinker* ) ;;
2415       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
2416     esac
2417     shift
2418   done
2419 fi
2420
2421 test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" &&  if test "$extra_verbose" = "yes"; then
2422    echo "    xemacs will be linked with \"$objects_machine\""
2423  fi
2424 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$extra_verbose" = "yes"; then
2425    echo "    xemacs will be linked with \"$objects_system\""
2426  fi
2427 test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$extra_verbose" = "yes"; then
2428    echo "    xemacs will be linked with \"$unexec\""
2429  fi
2430
2431 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
2432 echo "configure:2433: checking for dynodump" >&5
2433 if test "$unexec" != "unexsol2.o"; then
2434   echo "$ac_t""no" 1>&6
2435 else
2436   echo "$ac_t""yes" 1>&6
2437   { test "$extra_verbose" = "yes" && cat << \EOF
2438     Defining DYNODUMP
2439 EOF
2440 cat >> confdefs.h <<\EOF
2441 #define DYNODUMP 1
2442 EOF
2443 }
2444
2445   MAKE_SUBDIR="$MAKE_SUBDIR dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$MAKE_SUBDIR"; fi
2446   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS dynodump" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dynodump\" to \$SRC_SUBDIR_DEPS"; fi
2447   case "$machine" in
2448     sparc   ) dynodump_arch=sparc ;;
2449     *86*    ) dynodump_arch=i386  ;;
2450     powerpc ) dynodump_arch=ppc   ;;
2451   esac
2452     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
2453 fi
2454
2455
2456 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2457
2458 if test "$unexec" = "unexaix.o"; then
2459   if   test "$dynamic" = "no"; then
2460   start_flags="-Wl,-bnso,-bnodelcsect"
2461   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2462   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2463     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2464   done
2465   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2466     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2467   done
2468   
2469 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
2470 echo "configure:2471: checking for terminateAndUnload in -lC" >&5
2471 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
2472
2473 xe_check_libs=" -lC "
2474 cat > conftest.$ac_ext <<EOF
2475 #line 2476 "configure"
2476 #include "confdefs.h"
2477 /* Override any gcc2 internal prototype to avoid an error.  */
2478 /* We use char because int might match the return type of a gcc2
2479     builtin and then its argument prototype would still apply.  */
2480 char terminateAndUnload();
2481
2482 int main() {
2483 terminateAndUnload()
2484 ; return 0; }
2485 EOF
2486 if { (eval echo configure:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2487   rm -rf conftest*
2488   eval "ac_cv_lib_$ac_lib_var=yes"
2489 else
2490   echo "configure: failed program was:" >&5
2491   cat conftest.$ac_ext >&5
2492   rm -rf conftest*
2493   eval "ac_cv_lib_$ac_lib_var=no"
2494 fi
2495 rm -f conftest*
2496 xe_check_libs=""
2497
2498 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
2499   echo "$ac_t""yes" 1>&6
2500   libs_system="$libs_system -lC" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lC\" to \$libs_system"; fi
2501 else
2502   echo "$ac_t""no" 1>&6
2503 fi
2504
2505
2506   fi
2507 elif test -n "$ld_text_start_addr"; then
2508   start_flags="-T $ld_text_start_addr -e __start"
2509 fi
2510
2511
2512
2513
2514 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2515  test -z "$linker" &&  linker='$(CC) -nostdlib'
2516  test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2517 fi
2518 test "$GCC" != "yes" && lib_gcc=
2519
2520
2521
2522
2523
2524 case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2525 if test -n "$site_libraries"; then
2526   for arg in $site_libraries; do
2527     case "$arg" in
2528      -* ) ;;
2529      * ) test -d "$arg" || \
2530            { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
2531        arg="-L${arg}" ;;
2532     esac
2533     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
2534   done
2535 fi
2536
2537 case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2538 if test -n "$site_includes"; then
2539   for arg in $site_includes; do
2540     case "$arg" in
2541       -* ) ;;
2542       * ) test -d "$arg" || \
2543            { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
2544       arg="-I${arg}" ;;
2545     esac
2546     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
2547   done
2548 fi
2549
2550 case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2551 if test -n "$site_prefixes"; then
2552   for dir in $site_prefixes; do
2553     lib_dir="${dir}/lib"
2554     inc_dir="${dir}/include"
2555     if test ! -d "$dir"; then
2556       { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
2557     elif test ! -d "$lib_dir"; then
2558       { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
2559     else
2560       if test -d "$inc_dir"; then
2561         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
2562       fi
2563       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
2564     fi
2565   done
2566 fi
2567
2568
2569 for dir in "/usr/ccs/lib"; do
2570   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
2571 done
2572
2573 case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
2574 if test -n "$site_runtime_libraries"; then
2575   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
2576   export LD_RUN_PATH
2577 fi
2578
2579
2580 if   test "$dynamic" = "no"; then add_runtime_path=no
2581 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2582 else case "$opsys" in
2583        sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2584        * ) add_runtime_path=no ;;
2585      esac
2586 fi
2587
2588 if test "$add_runtime_path" = "yes"; then
2589       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
2590 echo "configure:2591: checking "for runtime libraries flag"" >&5
2591   case "$opsys" in
2592     sol2 ) dash_r="-R" ;;
2593     decosf* | linux* | irix*) dash_r="-rpath " ;;
2594     *)
2595       dash_r=""
2596       for try_dash_r in "-R" "-R " "-rpath "; do
2597         xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2598         
2599 if test "$GCC" = "yes"; then
2600   set x $xe_check_libs; shift; xe_check_libs=""
2601   while test -n "$1"; do
2602     case $1 in
2603       -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
2604       -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
2605       -Xlinker* ) ;;
2606       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
2607     esac
2608     shift
2609   done
2610 fi
2611         cat > conftest.$ac_ext <<EOF
2612 #line 2613 "configure"
2613 #include "confdefs.h"
2614
2615 int main() {
2616
2617 ; return 0; }
2618 EOF
2619 if { (eval echo configure:2620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2620   rm -rf conftest*
2621   dash_r="$try_dash_r"
2622 else
2623   echo "configure: failed program was:" >&5
2624   cat conftest.$ac_ext >&5
2625 fi
2626 rm -f conftest*
2627         xe_check_libs=""
2628         test -n "$dash_r" && break
2629       done ;;
2630   esac
2631   if test -n "$dash_r";
2632     then echo "$ac_t"""\"${dash_r}\""" 1>&6
2633     else echo "$ac_t""NONE" 1>&6
2634   fi
2635 fi
2636
2637 xe_add_unique_runpath_dir='
2638   xe_add_p=yes
2639   for xe_dir in $runpath_dirs; do       test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2640   done
2641   if test "$xe_add_p" = "yes"; then
2642     test -n "$runpath" && runpath="${runpath}:"
2643     runpath="${runpath}${xe_runpath_dir}"
2644     runpath_dirs="$runpath_dirs $xe_runpath_dir"
2645   fi'
2646
2647
2648
2649
2650 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2651     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2652   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
2653   
2654         runpath="" runpath_dirs=""
2655   if test -n "$LD_RUN_PATH"; then
2656     runpath="$LD_RUN_PATH"
2657   elif test "$GCC" = "yes"; then
2658         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2659     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
2660     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2661     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2662       case "$arg" in P,* | -L* | -R* )
2663         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2664           {
2665 xe_runpath_dir="$dir"
2666   test "$xe_runpath_dir" != "/lib"     -a \
2667         "$xe_runpath_dir" != "/usr/lib" -a \
2668         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2669   eval "$xe_add_unique_runpath_dir"
2670 }
2671         done ;;
2672       esac
2673     done
2674     ld_switch_run="$ld_switch_run_save"
2675     rm -f conftest*
2676   else
2677         for arg in $ld_switch_site $ld_switch_x_site; do
2678       case "$arg" in -L*) {
2679 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
2680   test "$xe_runpath_dir" != "/lib"     -a \
2681         "$xe_runpath_dir" != "/usr/lib" -a \
2682         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
2683   eval "$xe_add_unique_runpath_dir"
2684 };; esac
2685     done
2686         if test "$opsys $need_motif" = "sol2 yes"; then
2687       xe_runpath_dir="/opt/SUNWdt/lib";
2688       eval "$xe_add_unique_runpath_dir";
2689     fi
2690   fi 
2691   if test -n "$runpath"; then
2692     ld_switch_run="${dash_r}${runpath}"
2693     
2694 if test "$GCC" = "yes"; then
2695   set x $ld_switch_run; shift; ld_switch_run=""
2696   while test -n "$1"; do
2697     case $1 in
2698       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
2699       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
2700       -Xlinker* ) ;;
2701       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
2702     esac
2703     shift
2704   done
2705 fi
2706     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2707   fi
2708 fi
2709
2710
2711
2712
2713 GNU_MALLOC=yes
2714 if test "$with_dlmalloc" != "no"; then
2715         doug_lea_malloc=yes
2716 else
2717         doug_lea_malloc=no
2718 fi
2719 after_morecore_hook_exists=yes
2720 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
2721 echo "configure:2722: checking for malloc_get_state" >&5
2722
2723 cat > conftest.$ac_ext <<EOF
2724 #line 2725 "configure"
2725 #include "confdefs.h"
2726 /* System header to define __stub macros and hopefully few prototypes,
2727     which can conflict with char malloc_get_state(); below.  */
2728 #include <assert.h>
2729 /* Override any gcc2 internal prototype to avoid an error.  */
2730 /* We use char because int might match the return type of a gcc2
2731     builtin and then its argument prototype would still apply.  */
2732 char malloc_get_state();
2733
2734 int main() {
2735
2736 /* The GNU C library defines this for functions which it implements
2737     to always fail with ENOSYS.  Some functions are actually named
2738     something starting with __ and the normal name is an alias.  */
2739 #if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
2740 choke me
2741 #else
2742 malloc_get_state();
2743 #endif
2744
2745 ; return 0; }
2746 EOF
2747 if { (eval echo configure:2748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2748   rm -rf conftest*
2749   eval "ac_cv_func_malloc_get_state=yes"
2750 else
2751   echo "configure: failed program was:" >&5
2752   cat conftest.$ac_ext >&5
2753   rm -rf conftest*
2754   eval "ac_cv_func_malloc_get_state=no"
2755 fi
2756 rm -f conftest*
2757
2758 if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
2759   echo "$ac_t""yes" 1>&6
2760   :
2761 else
2762   echo "$ac_t""no" 1>&6
2763 doug_lea_malloc=no
2764 fi
2765
2766 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
2767 echo "configure:2768: checking for malloc_set_state" >&5
2768
2769 cat > conftest.$ac_ext <<EOF
2770 #line 2771 "configure"
2771 #include "confdefs.h"
2772 /* System header to define __stub macros and hopefully few prototypes,
2773     which can conflict with char malloc_set_state(); below.  */
2774 #include <assert.h>
2775 /* Override any gcc2 internal prototype to avoid an error.  */
2776 /* We use char because int might match the return type of a gcc2
2777     builtin and then its argument prototype would still apply.  */
2778 char malloc_set_state();
2779
2780 int main() {
2781
2782 /* The GNU C library defines this for functions which it implements
2783     to always fail with ENOSYS.  Some functions are actually named
2784     something starting with __ and the normal name is an alias.  */
2785 #if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
2786 choke me
2787 #else
2788 malloc_set_state();
2789 #endif
2790
2791 ; return 0; }
2792 EOF
2793 if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2794   rm -rf conftest*
2795   eval "ac_cv_func_malloc_set_state=yes"
2796 else
2797   echo "configure: failed program was:" >&5
2798   cat conftest.$ac_ext >&5
2799   rm -rf conftest*
2800   eval "ac_cv_func_malloc_set_state=no"
2801 fi
2802 rm -f conftest*
2803
2804 if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
2805   echo "$ac_t""yes" 1>&6
2806   :
2807 else
2808   echo "$ac_t""no" 1>&6
2809 doug_lea_malloc=no
2810 fi
2811
2812 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
2813 echo "configure:2814: checking whether __after_morecore_hook exists" >&5
2814 cat > conftest.$ac_ext <<EOF
2815 #line 2816 "configure"
2816 #include "confdefs.h"
2817 extern void (* __after_morecore_hook)();
2818 int main() {
2819 __after_morecore_hook = 0
2820 ; return 0; }
2821 EOF
2822 if { (eval echo configure:2823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2823   rm -rf conftest*
2824   echo "$ac_t""yes" 1>&6
2825 else
2826   echo "configure: failed program was:" >&5
2827   cat conftest.$ac_ext >&5
2828   rm -rf conftest*
2829   echo "$ac_t""no" 1>&6
2830    after_morecore_hook_exists=no
2831 fi
2832 rm -f conftest*
2833 if test "$system_malloc" = "yes" ; then
2834   GNU_MALLOC=no
2835   GNU_MALLOC_reason="
2836   (The GNU allocators don't work with this system configuration)."
2837 elif test "$with_system_malloc" = "yes" ; then
2838   GNU_MALLOC=no
2839   GNU_MALLOC_reason="
2840   (User chose not to use GNU allocators)."
2841 elif test "$with_debug_malloc" = "yes" ; then
2842   GNU_MALLOC=no
2843   GNU_MALLOC_reason="
2844   (User chose to use Debugging Malloc)."
2845 fi
2846
2847 if test "$doug_lea_malloc" = "yes" ; then
2848   if test "$GNU_MALLOC" = yes ; then
2849     GNU_MALLOC_reason="
2850   (Using Doug Lea's new malloc from the GNU C Library.)"
2851   fi
2852   { test "$extra_verbose" = "yes" && cat << \EOF
2853     Defining DOUG_LEA_MALLOC
2854 EOF
2855 cat >> confdefs.h <<\EOF
2856 #define DOUG_LEA_MALLOC 1
2857 EOF
2858 }
2859
2860   if test "$after_morecore_hook_exists" = "no" ; then
2861     GNU_MALLOC_reason="
2862   (Using Doug Lea's new malloc from the Linux C Library.)"
2863     { test "$extra_verbose" = "yes" && cat << \EOF
2864     Defining _NO_MALLOC_WARNING_
2865 EOF
2866 cat >> confdefs.h <<\EOF
2867 #define _NO_MALLOC_WARNING_ 1
2868 EOF
2869 }
2870
2871   fi
2872   use_minimal_tagbits=yes
2873 fi
2874
2875
2876
2877
2878 # Extract the first word of "ranlib", so it can be a program name with args.
2879 set dummy ranlib; ac_word=$2
2880 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2881 echo "configure:2882: checking for $ac_word" >&5
2882
2883 if test -n "$RANLIB"; then
2884   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2885 else
2886   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2887   for ac_dir in $PATH; do
2888     test -z "$ac_dir" && ac_dir=.
2889     if test -f $ac_dir/$ac_word; then
2890       ac_cv_prog_RANLIB="ranlib"
2891       break
2892     fi
2893   done
2894   IFS="$ac_save_ifs"
2895   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2896 fi
2897 RANLIB="$ac_cv_prog_RANLIB"
2898 if test -n "$RANLIB"; then
2899   echo "$ac_t""$RANLIB" 1>&6
2900 else
2901   echo "$ac_t""no" 1>&6
2902 fi
2903
2904 ac_aux_dir=
2905 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2906   if test -f $ac_dir/install-sh; then
2907     ac_aux_dir=$ac_dir
2908     ac_install_sh="$ac_aux_dir/install-sh -c"
2909     break
2910   elif test -f $ac_dir/install.sh; then
2911     ac_aux_dir=$ac_dir
2912     ac_install_sh="$ac_aux_dir/install.sh -c"
2913     break
2914   fi
2915 done
2916 if test -z "$ac_aux_dir"; then
2917   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
2918 fi
2919 ac_config_guess=$ac_aux_dir/config.guess
2920 ac_config_sub=$ac_aux_dir/config.sub
2921 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
2922
2923 # Find a good install program.  We prefer a C program (faster),
2924 # so one script is as good as another.  But avoid the broken or
2925 # incompatible versions:
2926 # SysV /etc/install, /usr/sbin/install
2927 # SunOS /usr/etc/install
2928 # IRIX /sbin/install
2929 # AIX /bin/install
2930 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2931 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2932 # ./install, which can be erroneously created by make from ./install.sh.
2933 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2934 echo "configure:2935: checking for a BSD compatible install" >&5
2935 if test -z "$INSTALL"; then
2936
2937   IFS="${IFS=   }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
2938   for ac_dir in $PATH; do
2939     # Account for people who put trailing slashes in PATH elements.
2940     case "$ac_dir/" in
2941     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2942     *)
2943       # OSF1 and SCO ODT 3.0 have their own names for install.
2944       for ac_prog in ginstall installbsd scoinst install; do
2945         if test -f $ac_dir/$ac_prog; then
2946           if test $ac_prog = install &&
2947             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2948             # AIX install.  It has an incompatible calling convention.
2949             # OSF/1 installbsd also uses dspmsg, but is usable.
2950             :
2951           else
2952             ac_cv_path_install="$ac_dir/$ac_prog -c"
2953             break 2
2954           fi
2955         fi
2956       done
2957       ;;
2958     esac
2959   done
2960   IFS="$ac_save_IFS"
2961
2962   if test "${ac_cv_path_install+set}" = set; then
2963     INSTALL="$ac_cv_path_install"
2964   else
2965     # As a last resort, use the slow shell script.  We don't cache a
2966     # path for INSTALL within a source directory, because that will
2967     # break other packages using the cache if that directory is
2968     # removed, or if the path is relative.
2969     INSTALL="$ac_install_sh"
2970   fi
2971 fi
2972 echo "$ac_t""$INSTALL" 1>&6
2973
2974 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2975 # It thinks the first close brace ends the variable substitution.
2976 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 for ac_prog in 'bison -y' byacc
2981 do
2982 # Extract the first word of "$ac_prog", so it can be a program name with args.
2983 set dummy $ac_prog; ac_word=$2
2984 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2985 echo "configure:2986: checking for $ac_word" >&5
2986
2987 if test -n "$YACC"; then
2988   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2989 else
2990   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2991   for ac_dir in $PATH; do
2992     test -z "$ac_dir" && ac_dir=.
2993     if test -f $ac_dir/$ac_word; then
2994       ac_cv_prog_YACC="$ac_prog"
2995       break
2996     fi
2997   done
2998   IFS="$ac_save_ifs"
2999 fi
3000 YACC="$ac_cv_prog_YACC"
3001 if test -n "$YACC"; then
3002   echo "$ac_t""$YACC" 1>&6
3003 else
3004   echo "$ac_t""no" 1>&6
3005 fi
3006
3007 test -n "$YACC" && break
3008 done
3009 test -n "$YACC" || YACC="yacc"
3010
3011
3012 for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
3013 do
3014 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3015 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3016 echo "configure:3017: checking for $ac_hdr" >&5
3017
3018 cat > conftest.$ac_ext <<EOF
3019 #line 3020 "configure"
3020 #include "confdefs.h"
3021 #include <$ac_hdr>
3022 EOF
3023 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3024 { (eval echo configure:3025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3025 ac_err=`grep -v '^ *+' conftest.out`
3026 if test -z "$ac_err"; then
3027   rm -rf conftest*
3028   eval "ac_cv_header_$ac_safe=yes"
3029 else
3030   echo "$ac_err" >&5
3031   echo "configure: failed program was:" >&5
3032   cat conftest.$ac_ext >&5
3033   rm -rf conftest*
3034   eval "ac_cv_header_$ac_safe=no"
3035 fi
3036 rm -f conftest*
3037 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3038   echo "$ac_t""yes" 1>&6
3039     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3040   { test "$extra_verbose" = "yes" && cat << EOF
3041     Defining $ac_tr_hdr
3042 EOF
3043 cat >> confdefs.h <<EOF
3044 #define $ac_tr_hdr 1
3045 EOF
3046 }
3047  
3048 else
3049   echo "$ac_t""no" 1>&6
3050 fi
3051 done
3052
3053 for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
3054 do
3055 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3056 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3057 echo "configure:3058: checking for $ac_hdr" >&5
3058
3059 cat > conftest.$ac_ext <<EOF
3060 #line 3061 "configure"
3061 #include "confdefs.h"
3062 #include <$ac_hdr>
3063 EOF
3064 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3065 { (eval echo configure:3066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3066 ac_err=`grep -v '^ *+' conftest.out`
3067 if test -z "$ac_err"; then
3068   rm -rf conftest*
3069   eval "ac_cv_header_$ac_safe=yes"
3070 else
3071   echo "$ac_err" >&5
3072   echo "configure: failed program was:" >&5
3073   cat conftest.$ac_ext >&5
3074   rm -rf conftest*
3075   eval "ac_cv_header_$ac_safe=no"
3076 fi
3077 rm -f conftest*
3078 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3079   echo "$ac_t""yes" 1>&6
3080     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3081   { test "$extra_verbose" = "yes" && cat << EOF
3082     Defining $ac_tr_hdr
3083 EOF
3084 cat >> confdefs.h <<EOF
3085 #define $ac_tr_hdr 1
3086 EOF
3087 }
3088  
3089 else
3090   echo "$ac_t""no" 1>&6
3091 fi
3092 done
3093
3094 for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
3095 do
3096 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3097 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3098 echo "configure:3099: checking for $ac_hdr" >&5
3099
3100 cat > conftest.$ac_ext <<EOF
3101 #line 3102 "configure"
3102 #include "confdefs.h"
3103 #include <$ac_hdr>
3104 EOF
3105 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3106 { (eval echo configure:3107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3107 ac_err=`grep -v '^ *+' conftest.out`
3108 if test -z "$ac_err"; then
3109   rm -rf conftest*
3110   eval "ac_cv_header_$ac_safe=yes"
3111 else
3112   echo "$ac_err" >&5
3113   echo "configure: failed program was:" >&5
3114   cat conftest.$ac_ext >&5
3115   rm -rf conftest*
3116   eval "ac_cv_header_$ac_safe=no"
3117 fi
3118 rm -f conftest*
3119 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3120   echo "$ac_t""yes" 1>&6
3121     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3122   { test "$extra_verbose" = "yes" && cat << EOF
3123     Defining $ac_tr_hdr
3124 EOF
3125 cat >> confdefs.h <<EOF
3126 #define $ac_tr_hdr 1
3127 EOF
3128 }
3129  
3130 else
3131   echo "$ac_t""no" 1>&6
3132 fi
3133 done
3134
3135 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3136 echo "configure:3137: checking for sys/wait.h that is POSIX.1 compatible" >&5
3137
3138 cat > conftest.$ac_ext <<EOF
3139 #line 3140 "configure"
3140 #include "confdefs.h"
3141 #include <sys/types.h>
3142 #include <sys/wait.h>
3143 #ifndef WEXITSTATUS
3144 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3145 #endif
3146 #ifndef WIFEXITED
3147 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3148 #endif
3149 int main() {
3150 int s;
3151 wait (&s);
3152 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3153 ; return 0; }
3154 EOF
3155 if { (eval echo configure:3156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3156   rm -rf conftest*
3157   ac_cv_header_sys_wait_h=yes
3158 else
3159   echo "configure: failed program was:" >&5
3160   cat conftest.$ac_ext >&5
3161   rm -rf conftest*
3162   ac_cv_header_sys_wait_h=no
3163 fi
3164 rm -f conftest*
3165
3166 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3167 if test $ac_cv_header_sys_wait_h = yes; then
3168   { test "$extra_verbose" = "yes" && cat << \EOF
3169     Defining HAVE_SYS_WAIT_H
3170 EOF
3171 cat >> confdefs.h <<\EOF
3172 #define HAVE_SYS_WAIT_H 1
3173 EOF
3174 }
3175
3176 fi
3177
3178 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3179 echo "configure:3180: checking for ANSI C header files" >&5
3180
3181 cat > conftest.$ac_ext <<EOF
3182 #line 3183 "configure"
3183 #include "confdefs.h"
3184 #include <stdlib.h>
3185 #include <stdarg.h>
3186 #include <string.h>
3187 #include <float.h>
3188 EOF
3189 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3190 { (eval echo configure:3191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3191 ac_err=`grep -v '^ *+' conftest.out`
3192 if test -z "$ac_err"; then
3193   rm -rf conftest*
3194   ac_cv_header_stdc=yes
3195 else
3196   echo "$ac_err" >&5
3197   echo "configure: failed program was:" >&5
3198   cat conftest.$ac_ext >&5
3199   rm -rf conftest*
3200   ac_cv_header_stdc=no
3201 fi
3202 rm -f conftest*
3203
3204 if test $ac_cv_header_stdc = yes; then
3205   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3206 cat > conftest.$ac_ext <<EOF
3207 #line 3208 "configure"
3208 #include "confdefs.h"
3209 #include <string.h>
3210 EOF
3211 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3212   egrep "memchr" >/dev/null 2>&1; then
3213   :
3214 else
3215   rm -rf conftest*
3216   ac_cv_header_stdc=no
3217 fi
3218 rm -f conftest*
3219
3220 fi
3221
3222 if test $ac_cv_header_stdc = yes; then
3223   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3224 cat > conftest.$ac_ext <<EOF
3225 #line 3226 "configure"
3226 #include "confdefs.h"
3227 #include <stdlib.h>
3228 EOF
3229 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3230   egrep "free" >/dev/null 2>&1; then
3231   :
3232 else
3233   rm -rf conftest*
3234   ac_cv_header_stdc=no
3235 fi
3236 rm -f conftest*
3237
3238 fi
3239
3240 if test $ac_cv_header_stdc = yes; then
3241   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3242 cat > conftest.$ac_ext <<EOF
3243 #line 3244 "configure"
3244 #include "confdefs.h"
3245 #include <ctype.h>
3246 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3247 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3248 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3249 int main () { int i; for (i = 0; i < 256; i++)
3250 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3251 exit (0); }
3252
3253 EOF
3254 if { (eval echo configure:3255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3255 then
3256   :
3257 else
3258   conftest_rc="$?"
3259   echo "configure: failed program was:" >&5
3260   cat conftest.$ac_ext >&5
3261   rm -fr conftest*
3262   ac_cv_header_stdc=no
3263 fi
3264 rm -fr conftest*
3265 fi
3266
3267 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3268 if test $ac_cv_header_stdc = yes; then
3269   { test "$extra_verbose" = "yes" && cat << \EOF
3270     Defining STDC_HEADERS
3271 EOF
3272 cat >> confdefs.h <<\EOF
3273 #define STDC_HEADERS 1
3274 EOF
3275 }
3276
3277 fi
3278
3279 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3280 echo "configure:3281: checking whether time.h and sys/time.h may both be included" >&5
3281
3282 cat > conftest.$ac_ext <<EOF
3283 #line 3284 "configure"
3284 #include "confdefs.h"
3285 #include <sys/types.h>
3286 #include <sys/time.h>
3287 #include <time.h>
3288 int main() {
3289 struct tm *tp;
3290 ; return 0; }
3291 EOF
3292 if { (eval echo configure:3293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3293   rm -rf conftest*
3294   ac_cv_header_time=yes
3295 else
3296   echo "configure: failed program was:" >&5
3297   cat conftest.$ac_ext >&5
3298   rm -rf conftest*
3299   ac_cv_header_time=no
3300 fi
3301 rm -f conftest*
3302
3303 echo "$ac_t""$ac_cv_header_time" 1>&6
3304 if test $ac_cv_header_time = yes; then
3305   { test "$extra_verbose" = "yes" && cat << \EOF
3306     Defining TIME_WITH_SYS_TIME
3307 EOF
3308 cat >> confdefs.h <<\EOF
3309 #define TIME_WITH_SYS_TIME 1
3310 EOF
3311 }
3312
3313 fi
3314
3315 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
3316 echo "configure:3317: checking for sys_siglist declaration in signal.h or unistd.h" >&5
3317
3318 cat > conftest.$ac_ext <<EOF
3319 #line 3320 "configure"
3320 #include "confdefs.h"
3321 #include <sys/types.h>
3322 #include <signal.h>
3323 /* NetBSD declares sys_siglist in unistd.h.  */
3324 #ifdef HAVE_UNISTD_H
3325 #include <unistd.h>
3326 #endif
3327 int main() {
3328 char *msg = *(sys_siglist + 1);
3329 ; return 0; }
3330 EOF
3331 if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3332   rm -rf conftest*
3333   ac_cv_decl_sys_siglist=yes
3334 else
3335   echo "configure: failed program was:" >&5
3336   cat conftest.$ac_ext >&5
3337   rm -rf conftest*
3338   ac_cv_decl_sys_siglist=no
3339 fi
3340 rm -f conftest*
3341
3342 echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
3343 if test $ac_cv_decl_sys_siglist = yes; then
3344   { test "$extra_verbose" = "yes" && cat << \EOF
3345     Defining SYS_SIGLIST_DECLARED
3346 EOF
3347 cat >> confdefs.h <<\EOF
3348 #define SYS_SIGLIST_DECLARED 1
3349 EOF
3350 }
3351
3352 fi
3353
3354
3355 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
3356 echo "configure:3357: checking for struct utimbuf" >&5
3357 cat > conftest.$ac_ext <<EOF
3358 #line 3359 "configure"
3359 #include "confdefs.h"
3360 #ifdef TIME_WITH_SYS_TIME
3361 #include <sys/time.h>
3362 #include <time.h>
3363 #else
3364 #ifdef HAVE_SYS_TIME_H
3365 #include <sys/time.h>
3366 #else
3367 #include <time.h>
3368 #endif
3369 #endif
3370 #ifdef HAVE_UTIME_H
3371 #include <utime.h>
3372 #endif
3373 int main() {
3374 static struct utimbuf x; x.actime = x.modtime;
3375 ; return 0; }
3376 EOF
3377 if { (eval echo configure:3378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3378   rm -rf conftest*
3379   echo "$ac_t""yes" 1>&6
3380    { test "$extra_verbose" = "yes" && cat << \EOF
3381     Defining HAVE_STRUCT_UTIMBUF
3382 EOF
3383 cat >> confdefs.h <<\EOF
3384 #define HAVE_STRUCT_UTIMBUF 1
3385 EOF
3386 }
3387
3388 else
3389   echo "configure: failed program was:" >&5
3390   cat conftest.$ac_ext >&5
3391   rm -rf conftest*
3392   echo "$ac_t""no" 1>&6
3393 fi
3394 rm -f conftest*
3395
3396 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3397 echo "configure:3398: checking return type of signal handlers" >&5
3398
3399 cat > conftest.$ac_ext <<EOF
3400 #line 3401 "configure"
3401 #include "confdefs.h"
3402 #include <sys/types.h>
3403 #include <signal.h>
3404 #ifdef signal
3405 #undef signal
3406 #endif
3407 #ifdef __cplusplus
3408 extern "C" void (*signal (int, void (*)(int)))(int);
3409 #else
3410 void (*signal ()) ();
3411 #endif
3412
3413 int main() {
3414 int i;
3415 ; return 0; }
3416 EOF
3417 if { (eval echo configure:3418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3418   rm -rf conftest*
3419   ac_cv_type_signal=void
3420 else
3421   echo "configure: failed program was:" >&5
3422   cat conftest.$ac_ext >&5
3423   rm -rf conftest*
3424   ac_cv_type_signal=int
3425 fi
3426 rm -f conftest*
3427
3428 echo "$ac_t""$ac_cv_type_signal" 1>&6
3429 { test "$extra_verbose" = "yes" && cat << EOF
3430     Defining RETSIGTYPE = $ac_cv_type_signal
3431 EOF
3432 cat >> confdefs.h <<EOF
3433 #define RETSIGTYPE $ac_cv_type_signal
3434 EOF
3435 }
3436
3437
3438 echo $ac_n "checking for size_t""... $ac_c" 1>&6
3439 echo "configure:3440: checking for size_t" >&5
3440
3441 cat > conftest.$ac_ext <<EOF
3442 #line 3443 "configure"
3443 #include "confdefs.h"
3444 #include <sys/types.h>
3445 #if STDC_HEADERS
3446 #include <stdlib.h>
3447 #include <stddef.h>
3448 #endif
3449 EOF
3450 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3451   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3452   rm -rf conftest*
3453   ac_cv_type_size_t=yes
3454 else
3455   rm -rf conftest*
3456   ac_cv_type_size_t=no
3457 fi
3458 rm -f conftest*
3459
3460 echo "$ac_t""$ac_cv_type_size_t" 1>&6
3461 if test $ac_cv_type_size_t = no; then
3462   { test "$extra_verbose" = "yes" && cat << \EOF
3463     Defining size_t = unsigned
3464 EOF
3465 cat >> confdefs.h <<\EOF
3466 #define size_t unsigned
3467 EOF
3468 }
3469
3470 fi
3471
3472 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
3473 echo "configure:3474: checking for pid_t" >&5
3474
3475 cat > conftest.$ac_ext <<EOF
3476 #line 3477 "configure"
3477 #include "confdefs.h"
3478 #include <sys/types.h>
3479 #if STDC_HEADERS
3480 #include <stdlib.h>
3481 #include <stddef.h>
3482 #endif
3483 EOF
3484 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3485   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3486   rm -rf conftest*
3487   ac_cv_type_pid_t=yes
3488 else
3489   rm -rf conftest*
3490   ac_cv_type_pid_t=no
3491 fi
3492 rm -f conftest*
3493
3494 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3495 if test $ac_cv_type_pid_t = no; then
3496   { test "$extra_verbose" = "yes" && cat << \EOF
3497     Defining pid_t = int
3498 EOF
3499 cat >> confdefs.h <<\EOF
3500 #define pid_t int
3501 EOF
3502 }
3503
3504 fi
3505
3506 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
3507 echo "configure:3508: checking for uid_t in sys/types.h" >&5
3508
3509 cat > conftest.$ac_ext <<EOF
3510 #line 3511 "configure"
3511 #include "confdefs.h"
3512 #include <sys/types.h>
3513 EOF
3514 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3515   egrep "uid_t" >/dev/null 2>&1; then
3516   rm -rf conftest*
3517   ac_cv_type_uid_t=yes
3518 else
3519   rm -rf conftest*
3520   ac_cv_type_uid_t=no
3521 fi
3522 rm -f conftest*
3523
3524
3525 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
3526 if test $ac_cv_type_uid_t = no; then
3527   { test "$extra_verbose" = "yes" && cat << \EOF
3528     Defining uid_t = int
3529 EOF
3530 cat >> confdefs.h <<\EOF
3531 #define uid_t int
3532 EOF
3533 }
3534
3535   { test "$extra_verbose" = "yes" && cat << \EOF
3536     Defining gid_t = int
3537 EOF
3538 cat >> confdefs.h <<\EOF
3539 #define gid_t int
3540 EOF
3541 }
3542
3543 fi
3544
3545 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
3546 echo "configure:3547: checking for mode_t" >&5
3547
3548 cat > conftest.$ac_ext <<EOF
3549 #line 3550 "configure"
3550 #include "confdefs.h"
3551 #include <sys/types.h>
3552 #if STDC_HEADERS
3553 #include <stdlib.h>
3554 #include <stddef.h>
3555 #endif
3556 EOF
3557 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3558   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3559   rm -rf conftest*
3560   ac_cv_type_mode_t=yes
3561 else
3562   rm -rf conftest*
3563   ac_cv_type_mode_t=no
3564 fi
3565 rm -f conftest*
3566
3567 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
3568 if test $ac_cv_type_mode_t = no; then
3569   { test "$extra_verbose" = "yes" && cat << \EOF
3570     Defining mode_t = int
3571 EOF
3572 cat >> confdefs.h <<\EOF
3573 #define mode_t int
3574 EOF
3575 }
3576
3577 fi
3578
3579 echo $ac_n "checking for off_t""... $ac_c" 1>&6
3580 echo "configure:3581: checking for off_t" >&5
3581
3582 cat > conftest.$ac_ext <<EOF
3583 #line 3584 "configure"
3584 #include "confdefs.h"
3585 #include <sys/types.h>
3586 #if STDC_HEADERS
3587 #include <stdlib.h>
3588 #include <stddef.h>
3589 #endif
3590 EOF
3591 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3592   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3593   rm -rf conftest*
3594   ac_cv_type_off_t=yes
3595 else
3596   rm -rf conftest*
3597   ac_cv_type_off_t=no
3598 fi
3599 rm -f conftest*
3600
3601 echo "$ac_t""$ac_cv_type_off_t" 1>&6
3602 if test $ac_cv_type_off_t = no; then
3603   { test "$extra_verbose" = "yes" && cat << \EOF
3604     Defining off_t = long
3605 EOF
3606 cat >> confdefs.h <<\EOF
3607 #define off_t long
3608 EOF
3609 }
3610
3611 fi
3612
3613
3614 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
3615 echo "configure:3616: checking for struct timeval" >&5
3616 cat > conftest.$ac_ext <<EOF
3617 #line 3618 "configure"
3618 #include "confdefs.h"
3619 #ifdef TIME_WITH_SYS_TIME
3620 #include <sys/time.h>
3621 #include <time.h>
3622 #else
3623 #ifdef HAVE_SYS_TIME_H
3624 #include <sys/time.h>
3625 #else
3626 #include <time.h>
3627 #endif
3628 #endif
3629 int main() {
3630 static struct timeval x; x.tv_sec = x.tv_usec;
3631 ; return 0; }
3632 EOF
3633 if { (eval echo configure:3634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3634   rm -rf conftest*
3635   echo "$ac_t""yes" 1>&6
3636   HAVE_TIMEVAL=yes
3637   { test "$extra_verbose" = "yes" && cat << \EOF
3638     Defining HAVE_TIMEVAL
3639 EOF
3640 cat >> confdefs.h <<\EOF
3641 #define HAVE_TIMEVAL 1
3642 EOF
3643 }
3644
3645 else
3646   echo "configure: failed program was:" >&5
3647   cat conftest.$ac_ext >&5
3648   rm -rf conftest*
3649   echo "$ac_t""no" 1>&6
3650    HAVE_TIMEVAL=no
3651 fi
3652 rm -f conftest*
3653
3654 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3655 echo "configure:3656: checking whether struct tm is in sys/time.h or time.h" >&5
3656
3657 cat > conftest.$ac_ext <<EOF
3658 #line 3659 "configure"
3659 #include "confdefs.h"
3660 #include <sys/types.h>
3661 #include <time.h>
3662 int main() {
3663 struct tm *tp; tp->tm_sec;
3664 ; return 0; }
3665 EOF
3666 if { (eval echo configure:3667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3667   rm -rf conftest*
3668   ac_cv_struct_tm=time.h
3669 else
3670   echo "configure: failed program was:" >&5
3671   cat conftest.$ac_ext >&5
3672   rm -rf conftest*
3673   ac_cv_struct_tm=sys/time.h
3674 fi
3675 rm -f conftest*
3676
3677 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3678 if test $ac_cv_struct_tm = sys/time.h; then
3679   { test "$extra_verbose" = "yes" && cat << \EOF
3680     Defining TM_IN_SYS_TIME
3681 EOF
3682 cat >> confdefs.h <<\EOF
3683 #define TM_IN_SYS_TIME 1
3684 EOF
3685 }
3686
3687 fi
3688
3689 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3690 echo "configure:3691: checking for tm_zone in struct tm" >&5
3691
3692 cat > conftest.$ac_ext <<EOF
3693 #line 3694 "configure"
3694 #include "confdefs.h"
3695 #include <sys/types.h>
3696 #include <$ac_cv_struct_tm>
3697 int main() {
3698 struct tm tm; tm.tm_zone;
3699 ; return 0; }
3700 EOF
3701 if { (eval echo configure:3702: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3702   rm -rf conftest*
3703   ac_cv_struct_tm_zone=yes
3704 else
3705   echo "configure: failed program was:" >&5
3706   cat conftest.$ac_ext >&5
3707   rm -rf conftest*
3708   ac_cv_struct_tm_zone=no
3709 fi
3710 rm -f conftest*
3711
3712 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3713 if test "$ac_cv_struct_tm_zone" = yes; then
3714   { test "$extra_verbose" = "yes" && cat << \EOF
3715     Defining HAVE_TM_ZONE
3716 EOF
3717 cat >> confdefs.h <<\EOF
3718 #define HAVE_TM_ZONE 1
3719 EOF
3720 }
3721
3722 else
3723   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3724 echo "configure:3725: checking for tzname" >&5
3725
3726 cat > conftest.$ac_ext <<EOF
3727 #line 3728 "configure"
3728 #include "confdefs.h"
3729 #include <time.h>
3730 #ifndef tzname /* For SGI.  */
3731 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3732 #endif
3733 int main() {
3734 atoi(*tzname);
3735 ; return 0; }
3736 EOF
3737 if { (eval echo configure:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3738   rm -rf conftest*
3739   ac_cv_var_tzname=yes
3740 else
3741   echo "configure: failed program was:" >&5
3742   cat conftest.$ac_ext >&5
3743   rm -rf conftest*
3744   ac_cv_var_tzname=no
3745 fi
3746 rm -f conftest*
3747
3748 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3749   if test $ac_cv_var_tzname = yes; then
3750     { test "$extra_verbose" = "yes" && cat << \EOF
3751     Defining HAVE_TZNAME
3752 EOF
3753 cat >> confdefs.h <<\EOF
3754 #define HAVE_TZNAME 1
3755 EOF
3756 }
3757
3758   fi
3759 fi
3760
3761
3762 echo $ac_n "checking for working const""... $ac_c" 1>&6
3763 echo "configure:3764: checking for working const" >&5
3764
3765 cat > conftest.$ac_ext <<EOF
3766 #line 3767 "configure"
3767 #include "confdefs.h"
3768
3769 int main() {
3770
3771 /* Ultrix mips cc rejects this.  */
3772 typedef int charset[2]; const charset x;
3773 /* SunOS 4.1.1 cc rejects this.  */
3774 char const *const *ccp;
3775 char **p;
3776 /* NEC SVR4.0.2 mips cc rejects this.  */
3777 struct point {int x, y;};
3778 static struct point const zero = {0,0};
3779 /* AIX XL C 1.02.0.0 rejects this.
3780    It does not let you subtract one const X* pointer from another in an arm
3781    of an if-expression whose if-part is not a constant expression */
3782 const char *g = "string";
3783 ccp = &g + (g ? g-g : 0);
3784 /* HPUX 7.0 cc rejects these. */
3785 ++ccp;
3786 p = (char**) ccp;
3787 ccp = (char const *const *) p;
3788 { /* SCO 3.2v4 cc rejects this.  */
3789   char *t;
3790   char const *s = 0 ? (char *) 0 : (char const *) 0;
3791
3792   *t++ = 0;
3793 }
3794 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3795   int x[] = {25, 17};
3796   const int *foo = &x[0];
3797   ++foo;
3798 }
3799 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3800   typedef const int *iptr;
3801   iptr p = 0;
3802   ++p;
3803 }
3804 { /* AIX XL C 1.02.0.0 rejects this saying
3805      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3806   struct s { int j; const int *ap[3]; };
3807   struct s *b; b->j = 5;
3808 }
3809 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3810   const int foo = 10;
3811 }
3812
3813 ; return 0; }
3814 EOF
3815 if { (eval echo configure:3816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3816   rm -rf conftest*
3817   ac_cv_c_const=yes
3818 else
3819   echo "configure: failed program was:" >&5
3820   cat conftest.$ac_ext >&5
3821   rm -rf conftest*
3822   ac_cv_c_const=no
3823 fi
3824 rm -f conftest*
3825
3826 echo "$ac_t""$ac_cv_c_const" 1>&6
3827 if test $ac_cv_c_const = no; then
3828   { test "$extra_verbose" = "yes" && cat << \EOF
3829     Defining const = 
3830 EOF
3831 cat >> confdefs.h <<\EOF
3832 #define const 
3833 EOF
3834 }
3835
3836 fi
3837
3838
3839 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3840 echo "configure:3841: checking whether ${MAKE-make} sets \${MAKE}" >&5
3841 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3842
3843 cat > conftestmake <<\EOF
3844 all:
3845         @echo 'ac_maketemp="${MAKE}"'
3846 EOF
3847 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3848 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3849 if test -n "$ac_maketemp"; then
3850   eval ac_cv_prog_make_${ac_make}_set=yes
3851 else
3852   eval ac_cv_prog_make_${ac_make}_set=no
3853 fi
3854 rm -f conftestmake
3855 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3856   echo "$ac_t""yes" 1>&6
3857   SET_MAKE=
3858 else
3859   echo "$ac_t""no" 1>&6
3860   SET_MAKE="MAKE=${MAKE-make}"
3861 fi
3862
3863
3864 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3865 echo "configure:3866: checking whether byte ordering is bigendian" >&5
3866
3867 ac_cv_c_bigendian=unknown
3868 # See if sys/param.h defines the BYTE_ORDER macro.
3869 cat > conftest.$ac_ext <<EOF
3870 #line 3871 "configure"
3871 #include "confdefs.h"
3872 #include <sys/types.h>
3873 #include <sys/param.h>
3874 int main() {
3875
3876 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3877  bogus endian macros
3878 #endif
3879 ; return 0; }
3880 EOF
3881 if { (eval echo configure:3882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3882   rm -rf conftest*
3883   # It does; now see whether it defined to BIG_ENDIAN or not.
3884 cat > conftest.$ac_ext <<EOF
3885 #line 3886 "configure"
3886 #include "confdefs.h"
3887 #include <sys/types.h>
3888 #include <sys/param.h>
3889 int main() {
3890
3891 #if BYTE_ORDER != BIG_ENDIAN
3892  not big endian
3893 #endif
3894 ; return 0; }
3895 EOF
3896 if { (eval echo configure:3897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3897   rm -rf conftest*
3898   ac_cv_c_bigendian=yes
3899 else
3900   echo "configure: failed program was:" >&5
3901   cat conftest.$ac_ext >&5
3902   rm -rf conftest*
3903   ac_cv_c_bigendian=no
3904 fi
3905 rm -f conftest*
3906 else
3907   echo "configure: failed program was:" >&5
3908   cat conftest.$ac_ext >&5
3909 fi
3910 rm -f conftest*
3911 if test $ac_cv_c_bigendian = unknown; then
3912 cat > conftest.$ac_ext <<EOF
3913 #line 3914 "configure"
3914 #include "confdefs.h"
3915 main () {
3916   /* Are we little or big endian?  From Harbison&Steele.  */
3917   union
3918   {
3919     long l;
3920     char c[sizeof (long)];
3921   } u;
3922   u.l = 1;
3923   exit (u.c[sizeof (long) - 1] == 1);
3924 }
3925 EOF
3926 if { (eval echo configure:3927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3927 then
3928   ac_cv_c_bigendian=no
3929 else
3930   conftest_rc="$?"
3931   echo "configure: failed program was:" >&5
3932   cat conftest.$ac_ext >&5
3933   rm -fr conftest*
3934   ac_cv_c_bigendian=yes
3935 fi
3936 rm -fr conftest*
3937 fi
3938
3939 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3940 if test $ac_cv_c_bigendian = yes; then
3941   { test "$extra_verbose" = "yes" && cat << \EOF
3942     Defining WORDS_BIGENDIAN
3943 EOF
3944 cat >> confdefs.h <<\EOF
3945 #define WORDS_BIGENDIAN 1
3946 EOF
3947 }
3948
3949 fi
3950
3951
3952 echo $ac_n "checking size of short""... $ac_c" 1>&6
3953 echo "configure:3954: checking size of short" >&5
3954
3955 cat > conftest.$ac_ext <<EOF
3956 #line 3957 "configure"
3957 #include "confdefs.h"
3958 #include <stdio.h>
3959 main()
3960 {
3961   FILE *f=fopen("conftestval", "w");
3962   if (!f) exit(1);
3963   fprintf(f, "%d\n", sizeof(short));
3964   exit(0);
3965 }
3966 EOF
3967 if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
3968 then
3969   ac_cv_sizeof_short=`cat conftestval`
3970 else
3971   conftest_rc="$?"
3972   echo "configure: failed program was:" >&5
3973   cat conftest.$ac_ext >&5
3974   rm -fr conftest*
3975   ac_cv_sizeof_short=0
3976 fi
3977 rm -fr conftest*
3978 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
3979 { test "$extra_verbose" = "yes" && cat << EOF
3980     Defining SIZEOF_SHORT = $ac_cv_sizeof_short
3981 EOF
3982 cat >> confdefs.h <<EOF
3983 #define SIZEOF_SHORT $ac_cv_sizeof_short
3984 EOF
3985 }
3986
3987
3988 if test "$ac_cv_sizeof_short" = 0; then
3989   echo ""
3990   echo "*** PANIC *** Configure tests are not working - compiler is broken."
3991   echo "*** PANIC *** Please examine config.log for compilation errors."
3992   exit 1
3993 fi
3994 echo $ac_n "checking size of int""... $ac_c" 1>&6
3995 echo "configure:3996: checking size of int" >&5
3996
3997 cat > conftest.$ac_ext <<EOF
3998 #line 3999 "configure"
3999 #include "confdefs.h"
4000 #include <stdio.h>
4001 main()
4002 {
4003   FILE *f=fopen("conftestval", "w");
4004   if (!f) exit(1);
4005   fprintf(f, "%d\n", sizeof(int));
4006   exit(0);
4007 }
4008 EOF
4009 if { (eval echo configure:4010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4010 then
4011   ac_cv_sizeof_int=`cat conftestval`
4012 else
4013   conftest_rc="$?"
4014   echo "configure: failed program was:" >&5
4015   cat conftest.$ac_ext >&5
4016   rm -fr conftest*
4017   ac_cv_sizeof_int=0
4018 fi
4019 rm -fr conftest*
4020 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
4021 { test "$extra_verbose" = "yes" && cat << EOF
4022     Defining SIZEOF_INT = $ac_cv_sizeof_int
4023 EOF
4024 cat >> confdefs.h <<EOF
4025 #define SIZEOF_INT $ac_cv_sizeof_int
4026 EOF
4027 }
4028
4029
4030 echo $ac_n "checking size of long""... $ac_c" 1>&6
4031 echo "configure:4032: checking size of long" >&5
4032
4033 cat > conftest.$ac_ext <<EOF
4034 #line 4035 "configure"
4035 #include "confdefs.h"
4036 #include <stdio.h>
4037 main()
4038 {
4039   FILE *f=fopen("conftestval", "w");
4040   if (!f) exit(1);
4041   fprintf(f, "%d\n", sizeof(long));
4042   exit(0);
4043 }
4044 EOF
4045 if { (eval echo configure:4046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4046 then
4047   ac_cv_sizeof_long=`cat conftestval`
4048 else
4049   conftest_rc="$?"
4050   echo "configure: failed program was:" >&5
4051   cat conftest.$ac_ext >&5
4052   rm -fr conftest*
4053   ac_cv_sizeof_long=0
4054 fi
4055 rm -fr conftest*
4056 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
4057 { test "$extra_verbose" = "yes" && cat << EOF
4058     Defining SIZEOF_LONG = $ac_cv_sizeof_long
4059 EOF
4060 cat >> confdefs.h <<EOF
4061 #define SIZEOF_LONG $ac_cv_sizeof_long
4062 EOF
4063 }
4064
4065
4066 echo $ac_n "checking size of long long""... $ac_c" 1>&6
4067 echo "configure:4068: checking size of long long" >&5
4068
4069 cat > conftest.$ac_ext <<EOF
4070 #line 4071 "configure"
4071 #include "confdefs.h"
4072 #include <stdio.h>
4073 main()
4074 {
4075   FILE *f=fopen("conftestval", "w");
4076   if (!f) exit(1);
4077   fprintf(f, "%d\n", sizeof(long long));
4078   exit(0);
4079 }
4080 EOF
4081 if { (eval echo configure:4082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4082 then
4083   ac_cv_sizeof_long_long=`cat conftestval`
4084 else
4085   conftest_rc="$?"
4086   echo "configure: failed program was:" >&5
4087   cat conftest.$ac_ext >&5
4088   rm -fr conftest*
4089   ac_cv_sizeof_long_long=0
4090 fi
4091 rm -fr conftest*
4092 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
4093 { test "$extra_verbose" = "yes" && cat << EOF
4094     Defining SIZEOF_LONG_LONG = $ac_cv_sizeof_long_long
4095 EOF
4096 cat >> confdefs.h <<EOF
4097 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
4098 EOF
4099 }
4100
4101
4102 echo $ac_n "checking size of void *""... $ac_c" 1>&6
4103 echo "configure:4104: checking size of void *" >&5
4104
4105 cat > conftest.$ac_ext <<EOF
4106 #line 4107 "configure"
4107 #include "confdefs.h"
4108 #include <stdio.h>
4109 main()
4110 {
4111   FILE *f=fopen("conftestval", "w");
4112   if (!f) exit(1);
4113   fprintf(f, "%d\n", sizeof(void *));
4114   exit(0);
4115 }
4116 EOF
4117 if { (eval echo configure:4118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
4118 then
4119   ac_cv_sizeof_void_p=`cat conftestval`
4120 else
4121   conftest_rc="$?"
4122   echo "configure: failed program was:" >&5
4123   cat conftest.$ac_ext >&5
4124   rm -fr conftest*
4125   ac_cv_sizeof_void_p=0
4126 fi
4127 rm -fr conftest*
4128 echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
4129 { test "$extra_verbose" = "yes" && cat << EOF
4130     Defining SIZEOF_VOID_P = $ac_cv_sizeof_void_p
4131 EOF
4132 cat >> confdefs.h <<EOF
4133 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
4134 EOF
4135 }
4136
4137
4138
4139 echo $ac_n "checking for long file names""... $ac_c" 1>&6
4140 echo "configure:4141: checking for long file names" >&5
4141
4142 ac_cv_sys_long_file_names=yes
4143 # Test for long file names in all the places we know might matter:
4144 #      .                the current directory, where building will happen
4145 #      $prefix/lib      where we will be installing things
4146 #      $exec_prefix/lib likewise
4147 # eval it to expand exec_prefix.
4148 #      $TMPDIR          if set, where it might want to write temporary files
4149 # if $TMPDIR is not set:
4150 #      /tmp             where it might want to write temporary files
4151 #      /var/tmp         likewise
4152 #      /usr/tmp         likewise
4153 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
4154   ac_tmpdirs="$TMPDIR"
4155 else
4156   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
4157 fi
4158 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
4159   test -d $ac_dir || continue
4160   test -w $ac_dir || continue # It is less confusing to not echo anything here.
4161   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
4162   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
4163   val=`cat $ac_dir/conftest9012345 2>/dev/null`
4164   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
4165     ac_cv_sys_long_file_names=no
4166     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4167     break
4168   fi
4169   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
4170 done
4171
4172 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
4173 if test $ac_cv_sys_long_file_names = yes; then
4174   { test "$extra_verbose" = "yes" && cat << \EOF
4175     Defining HAVE_LONG_FILE_NAMES
4176 EOF
4177 cat >> confdefs.h <<\EOF
4178 #define HAVE_LONG_FILE_NAMES 1
4179 EOF
4180 }
4181
4182 fi
4183
4184
4185 echo $ac_n "checking for sin""... $ac_c" 1>&6
4186 echo "configure:4187: checking for sin" >&5
4187
4188 cat > conftest.$ac_ext <<EOF
4189 #line 4190 "configure"
4190 #include "confdefs.h"
4191 /* System header to define __stub macros and hopefully few prototypes,
4192     which can conflict with char sin(); below.  */
4193 #include <assert.h>
4194 /* Override any gcc2 internal prototype to avoid an error.  */
4195 /* We use char because int might match the return type of a gcc2
4196     builtin and then its argument prototype would still apply.  */
4197 char sin();
4198
4199 int main() {
4200
4201 /* The GNU C library defines this for functions which it implements
4202     to always fail with ENOSYS.  Some functions are actually named
4203     something starting with __ and the normal name is an alias.  */
4204 #if defined (__stub_sin) || defined (__stub___sin)
4205 choke me
4206 #else
4207 sin();
4208 #endif
4209
4210 ; return 0; }
4211 EOF
4212 if { (eval echo configure:4213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4213   rm -rf conftest*
4214   eval "ac_cv_func_sin=yes"
4215 else
4216   echo "configure: failed program was:" >&5
4217   cat conftest.$ac_ext >&5
4218   rm -rf conftest*
4219   eval "ac_cv_func_sin=no"
4220 fi
4221 rm -f conftest*
4222
4223 if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
4224   echo "$ac_t""yes" 1>&6
4225   :
4226 else
4227   echo "$ac_t""no" 1>&6
4228
4229 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
4230 echo "configure:4231: checking for sin in -lm" >&5
4231 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
4232
4233 xe_check_libs=" -lm "
4234 cat > conftest.$ac_ext <<EOF
4235 #line 4236 "configure"
4236 #include "confdefs.h"
4237 /* Override any gcc2 internal prototype to avoid an error.  */
4238 /* We use char because int might match the return type of a gcc2
4239     builtin and then its argument prototype would still apply.  */
4240 char sin();
4241
4242 int main() {
4243 sin()
4244 ; return 0; }
4245 EOF
4246 if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4247   rm -rf conftest*
4248   eval "ac_cv_lib_$ac_lib_var=yes"
4249 else
4250   echo "configure: failed program was:" >&5
4251   cat conftest.$ac_ext >&5
4252   rm -rf conftest*
4253   eval "ac_cv_lib_$ac_lib_var=no"
4254 fi
4255 rm -f conftest*
4256 xe_check_libs=""
4257
4258 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4259   echo "$ac_t""yes" 1>&6
4260     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
4261     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4262   { test "$extra_verbose" = "yes" && cat << EOF
4263     Defining $ac_tr_lib
4264 EOF
4265 cat >> confdefs.h <<EOF
4266 #define $ac_tr_lib 1
4267 EOF
4268 }
4269
4270   LIBS="-lm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lm\" to \$LIBS"; fi
4271
4272 else
4273   echo "$ac_t""no" 1>&6
4274 fi
4275
4276
4277 fi
4278
4279
4280 { test "$extra_verbose" = "yes" && cat << \EOF
4281     Defining LISP_FLOAT_TYPE
4282 EOF
4283 cat >> confdefs.h <<\EOF
4284 #define LISP_FLOAT_TYPE 1
4285 EOF
4286 }
4287
4288
4289 cat > conftest.$ac_ext <<EOF
4290 #line 4291 "configure"
4291 #include "confdefs.h"
4292 #include <math.h>
4293 int main() {
4294 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
4295 ; return 0; }
4296 EOF
4297 if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4298   rm -rf conftest*
4299   { test "$extra_verbose" = "yes" && cat << \EOF
4300     Defining HAVE_INVERSE_HYPERBOLIC
4301 EOF
4302 cat >> confdefs.h <<\EOF
4303 #define HAVE_INVERSE_HYPERBOLIC 1
4304 EOF
4305 }
4306
4307 else
4308   echo "configure: failed program was:" >&5
4309   cat conftest.$ac_ext >&5
4310 fi
4311 rm -f conftest*
4312
4313 echo "checking type of mail spool file locking" 1>&6
4314 echo "configure:4315: checking type of mail spool file locking" >&5
4315 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
4316 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
4317 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
4318     Defining REAL_MAIL_USE_LOCKF
4319 EOF
4320 cat >> confdefs.h <<\EOF
4321 #define REAL_MAIL_USE_LOCKF 1
4322 EOF
4323 }
4324
4325 elif test "$mail_locking" = "flock"; then { test "$extra_verbose" = "yes" && cat << \EOF
4326     Defining REAL_MAIL_USE_FLOCK
4327 EOF
4328 cat >> confdefs.h <<\EOF
4329 #define REAL_MAIL_USE_FLOCK 1
4330 EOF
4331 }
4332
4333 else mail_locking="dot-locking"
4334 fi
4335
4336 case "$opsys" in decosf*)
4337   
4338 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
4339 echo "configure:4340: checking for cma_open in -lpthreads" >&5
4340 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4341
4342 xe_check_libs=" -lpthreads "
4343 cat > conftest.$ac_ext <<EOF
4344 #line 4345 "configure"
4345 #include "confdefs.h"
4346 /* Override any gcc2 internal prototype to avoid an error.  */
4347 /* We use char because int might match the return type of a gcc2
4348     builtin and then its argument prototype would still apply.  */
4349 char cma_open();
4350
4351 int main() {
4352 cma_open()
4353 ; return 0; }
4354 EOF
4355 if { (eval echo configure:4356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4356   rm -rf conftest*
4357   eval "ac_cv_lib_$ac_lib_var=yes"
4358 else
4359   echo "configure: failed program was:" >&5
4360   cat conftest.$ac_ext >&5
4361   rm -rf conftest*
4362   eval "ac_cv_lib_$ac_lib_var=no"
4363 fi
4364 rm -f conftest*
4365 xe_check_libs=""
4366
4367 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4368   echo "$ac_t""yes" 1>&6
4369     ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4370     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4371   { test "$extra_verbose" = "yes" && cat << EOF
4372     Defining $ac_tr_lib
4373 EOF
4374 cat >> confdefs.h <<EOF
4375 #define $ac_tr_lib 1
4376 EOF
4377 }
4378
4379   LIBS="-lpthreads $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpthreads\" to \$LIBS"; fi
4380
4381 else
4382   echo "$ac_t""no" 1>&6
4383 fi
4384
4385
4386   test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
4387     c_switch_site="$c_switch_site -threads" ;;
4388 esac
4389
4390 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
4391 echo "configure:4392: checking whether the -xildoff compiler flag is required" >&5
4392 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
4393   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
4394     then echo "$ac_t""no" 1>&6;
4395     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
4396   fi
4397   else echo "$ac_t""no" 1>&6
4398 fi
4399
4400 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
4401   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
4402 echo "configure:4403: checking for \"-z ignore\" linker flag" >&5
4403   case "`ld -h 2>&1`" in
4404     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
4405       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
4406     *) echo "$ac_t""no" 1>&6 ;;
4407   esac
4408 fi
4409
4410
4411 echo "checking "for specified window system"" 1>&6
4412 echo "configure:4413: checking "for specified window system"" >&5
4413
4414 if test "$with_x11" != "no"; then
4415     test "$x_includes $x_libraries" != "NONE NONE" && \
4416    window_system=x11 with_x11=yes
4417
4418         
4419       if test "$x_includes $x_libraries" = "NONE NONE" \
4420     -a -n "$OPENWINHOME" \
4421     -a "$OPENWINHOME" != "/usr/openwin" \
4422     -a -d "$OPENWINHOME"; then
4423       test -d "$OPENWINHOME/lib"           && x_libraries="$OPENWINHOME/lib"
4424       test -d "$OPENWINHOME/include"       && x_includes="$OPENWINHOME/include"
4425       test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
4426   fi
4427
4428   if test "$x_includes" = "NONE"; then
4429                     for dir in "/usr/X11" "/usr/X11R6"; do
4430       if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
4431     done
4432   fi
4433
4434   if test "$x_libraries" = "NONE"; then
4435     for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
4436       if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
4437     done
4438   fi
4439
4440   # If we find X, set shell vars x_includes and x_libraries to the
4441 # paths, otherwise set no_x=yes.
4442 # Uses ac_ vars as temps to allow command line to override cache and checks.
4443 # --without-x overrides everything else, but does not touch the cache.
4444 echo $ac_n "checking for X""... $ac_c" 1>&6
4445 echo "configure:4446: checking for X" >&5
4446
4447 # Check whether --with-x or --without-x was given.
4448 if test "${with_x+set}" = set; then
4449   withval="$with_x"
4450   :
4451 fi
4452
4453 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4454 if test "x$with_x" = xno; then
4455   # The user explicitly disabled X.
4456   have_x=disabled
4457 else
4458   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
4459     # Both variables are already set.
4460     have_x=yes
4461   else
4462
4463 # One or both of the vars are not set, and there is no cached value.
4464 ac_x_includes=NO ac_x_libraries=NO
4465 rm -fr conftestdir
4466 if mkdir conftestdir; then
4467   cd conftestdir
4468   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
4469   cat > Imakefile <<'EOF'
4470 acfindx:
4471         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
4472 EOF
4473   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
4474     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
4475     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
4476     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4477     for ac_extension in a so sl; do
4478       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
4479         test -f $ac_im_libdir/libX11.$ac_extension; then
4480         ac_im_usrlibdir=$ac_im_libdir; break
4481       fi
4482     done
4483     # Screen out bogus values from the imake configuration.  They are
4484     # bogus both because they are the default anyway, and because
4485     # using them would break gcc on systems where it needs fixed includes.
4486     case "$ac_im_incroot" in
4487         /usr/include) ;;
4488         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
4489     esac
4490     case "$ac_im_usrlibdir" in
4491         /usr/lib | /lib) ;;
4492         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
4493     esac
4494   fi
4495   cd ..
4496   rm -fr conftestdir
4497 fi
4498
4499 if test "$ac_x_includes" = NO; then
4500   # Guess where to find include files, by looking for this one X11 .h file.
4501   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
4502
4503   # First, try using that file with no special directory specified.
4504 cat > conftest.$ac_ext <<EOF
4505 #line 4506 "configure"
4506 #include "confdefs.h"
4507 #include <$x_direct_test_include>
4508 EOF
4509 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4510 { (eval echo configure:4511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4511 ac_err=`grep -v '^ *+' conftest.out`
4512 if test -z "$ac_err"; then
4513   rm -rf conftest*
4514   # We can compile using X headers with no special include directory.
4515 ac_x_includes=
4516 else
4517   echo "$ac_err" >&5
4518   echo "configure: failed program was:" >&5
4519   cat conftest.$ac_ext >&5
4520   rm -rf conftest*
4521   # Look for the header file in a standard set of common directories.
4522 # Check X11 before X11Rn because it is often a symlink to the current release.
4523   for ac_dir in               \
4524     /usr/X11/include          \
4525     /usr/X11R6/include        \
4526     /usr/X11R5/include        \
4527     /usr/X11R4/include        \
4528                               \
4529     /usr/include/X11          \
4530     /usr/include/X11R6        \
4531     /usr/include/X11R5        \
4532     /usr/include/X11R4        \
4533                               \
4534     /usr/local/X11/include    \
4535     /usr/local/X11R6/include  \
4536     /usr/local/X11R5/include  \
4537     /usr/local/X11R4/include  \
4538                               \
4539     /usr/local/include/X11    \
4540     /usr/local/include/X11R6  \
4541     /usr/local/include/X11R5  \
4542     /usr/local/include/X11R4  \
4543                               \
4544     /usr/X386/include         \
4545     /usr/x386/include         \
4546     /usr/XFree86/include/X11  \
4547                               \
4548     /usr/include              \
4549     /usr/local/include        \
4550     /usr/unsupported/include  \
4551     /usr/athena/include       \
4552     /usr/local/x11r5/include  \
4553     /usr/lpp/Xamples/include  \
4554                               \
4555     /usr/openwin/include      \
4556     /usr/openwin/share/include \
4557     ; \
4558   do
4559     if test -r "$ac_dir/$x_direct_test_include"; then
4560       ac_x_includes=$ac_dir
4561       break
4562     fi
4563   done
4564 fi
4565 rm -f conftest*
4566 fi # $ac_x_includes = NO
4567
4568 if test "$ac_x_libraries" = NO; then
4569   # Check for the libraries.
4570
4571   test -z "$x_direct_test_library" && x_direct_test_library=Xt
4572   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
4573
4574   # See if we find them without any special options.
4575   # Don't add to $LIBS permanently.
4576   ac_save_LIBS="$LIBS"
4577   LIBS="-l$x_direct_test_library $LIBS"
4578 cat > conftest.$ac_ext <<EOF
4579 #line 4580 "configure"
4580 #include "confdefs.h"
4581
4582 int main() {
4583 ${x_direct_test_function}()
4584 ; return 0; }
4585 EOF
4586 if { (eval echo configure:4587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4587   rm -rf conftest*
4588   LIBS="$ac_save_LIBS"
4589 # We can link X programs with no special library path.
4590 ac_x_libraries=
4591 else
4592   echo "configure: failed program was:" >&5
4593   cat conftest.$ac_ext >&5
4594   rm -rf conftest*
4595   LIBS="$ac_save_LIBS"
4596 # First see if replacing the include by lib works.
4597 # Check X11 before X11Rn because it is often a symlink to the current release.
4598 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
4599     /usr/X11/lib          \
4600     /usr/X11R6/lib        \
4601     /usr/X11R5/lib        \
4602     /usr/X11R4/lib        \
4603                           \
4604     /usr/lib/X11          \
4605     /usr/lib/X11R6        \
4606     /usr/lib/X11R5        \
4607     /usr/lib/X11R4        \
4608                           \
4609     /usr/local/X11/lib    \
4610     /usr/local/X11R6/lib  \
4611     /usr/local/X11R5/lib  \
4612     /usr/local/X11R4/lib  \
4613                           \
4614     /usr/local/lib/X11    \
4615     /usr/local/lib/X11R6  \
4616     /usr/local/lib/X11R5  \
4617     /usr/local/lib/X11R4  \
4618                           \
4619     /usr/X386/lib         \
4620     /usr/x386/lib         \
4621     /usr/XFree86/lib/X11  \
4622                           \
4623     /usr/lib              \
4624     /usr/local/lib        \
4625     /usr/unsupported/lib  \
4626     /usr/athena/lib       \
4627     /usr/local/x11r5/lib  \
4628     /usr/lpp/Xamples/lib  \
4629     /lib/usr/lib/X11      \
4630                           \
4631     /usr/openwin/lib      \
4632     /usr/openwin/share/lib \
4633     ; \
4634 do
4635   for ac_extension in a so sl; do
4636     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
4637       ac_x_libraries=$ac_dir
4638       break 2
4639     fi
4640   done
4641 done
4642 fi
4643 rm -f conftest*
4644 fi # $ac_x_libraries = NO
4645
4646 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
4647   # Didn't find X anywhere.  Cache the known absence of X.
4648   ac_cv_have_x="have_x=no"
4649 else
4650   # Record where we found X for the cache.
4651   ac_cv_have_x="have_x=yes \
4652                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
4653 fi
4654   fi
4655   eval "$ac_cv_have_x"
4656 fi # $with_x != no
4657
4658 if test "$have_x" != yes; then
4659   echo "$ac_t""$have_x" 1>&6
4660   no_x=yes
4661 else
4662   # If each of the values was on the command line, it overrides each guess.
4663   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4664   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4665   # Update the cache value to reflect the command line values.
4666   ac_cv_have_x="have_x=yes \
4667                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
4668   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
4669 fi
4670
4671 if test "$no_x" = yes; then
4672   # Not all programs may use this symbol, but it does not hurt to define it.
4673   { test "$extra_verbose" = "yes" && cat << \EOF
4674     Defining X_DISPLAY_MISSING
4675 EOF
4676 cat >> confdefs.h <<\EOF
4677 #define X_DISPLAY_MISSING 1
4678 EOF
4679 }
4680
4681   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4682 else
4683   if test -n "$x_includes"; then
4684     X_CFLAGS="$X_CFLAGS -I$x_includes"
4685   fi
4686
4687   # It would also be nice to do this for all -L options, not just this one.
4688   if test -n "$x_libraries"; then
4689     X_LIBS="$X_LIBS -L$x_libraries"
4690     # For Solaris; some versions of Sun CC require a space after -R and
4691     # others require no space.  Words are not sufficient . . . .
4692     case "`(uname -sr) 2>/dev/null`" in
4693     "SunOS 5"*)
4694       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4695 echo "configure:4696: checking whether -R must be followed by a space" >&5
4696       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4697       cat > conftest.$ac_ext <<EOF
4698 #line 4699 "configure"
4699 #include "confdefs.h"
4700
4701 int main() {
4702
4703 ; return 0; }
4704 EOF
4705 if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4706   rm -rf conftest*
4707   ac_R_nospace=yes
4708 else
4709   echo "configure: failed program was:" >&5
4710   cat conftest.$ac_ext >&5
4711   rm -rf conftest*
4712   ac_R_nospace=no
4713 fi
4714 rm -f conftest*
4715       if test $ac_R_nospace = yes; then
4716         echo "$ac_t""no" 1>&6
4717         X_LIBS="$X_LIBS -R$x_libraries"
4718       else
4719         LIBS="$ac_xsave_LIBS -R $x_libraries"
4720         cat > conftest.$ac_ext <<EOF
4721 #line 4722 "configure"
4722 #include "confdefs.h"
4723
4724 int main() {
4725
4726 ; return 0; }
4727 EOF
4728 if { (eval echo configure:4729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4729   rm -rf conftest*
4730   ac_R_space=yes
4731 else
4732   echo "configure: failed program was:" >&5
4733   cat conftest.$ac_ext >&5
4734   rm -rf conftest*
4735   ac_R_space=no
4736 fi
4737 rm -f conftest*
4738         if test $ac_R_space = yes; then
4739           echo "$ac_t""yes" 1>&6
4740           X_LIBS="$X_LIBS -R $x_libraries"
4741         else
4742           echo "$ac_t""neither works" 1>&6
4743         fi
4744       fi
4745       LIBS="$ac_xsave_LIBS"
4746     esac
4747   fi
4748
4749   # Check for system-dependent libraries X programs must link with.
4750   # Do this before checking for the system-independent R6 libraries
4751   # (-lICE), since we may need -lsocket or whatever for X linking.
4752
4753   if test "$ISC" = yes; then
4754     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4755   else
4756     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4757     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4758     # the Alpha needs dnet_stub (dnet does not exist).
4759     if test "$with_dnet" = "no" ; then
4760 ac_cv_lib_dnet_dnet_ntoa=no
4761 else
4762
4763 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4764 echo "configure:4765: checking for dnet_ntoa in -ldnet" >&5
4765 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4766
4767 xe_check_libs=" -ldnet "
4768 cat > conftest.$ac_ext <<EOF
4769 #line 4770 "configure"
4770 #include "confdefs.h"
4771 /* Override any gcc2 internal prototype to avoid an error.  */
4772 /* We use char because int might match the return type of a gcc2
4773     builtin and then its argument prototype would still apply.  */
4774 char dnet_ntoa();
4775
4776 int main() {
4777 dnet_ntoa()
4778 ; return 0; }
4779 EOF
4780 if { (eval echo configure:4781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4781   rm -rf conftest*
4782   eval "ac_cv_lib_$ac_lib_var=yes"
4783 else
4784   echo "configure: failed program was:" >&5
4785   cat conftest.$ac_ext >&5
4786   rm -rf conftest*
4787   eval "ac_cv_lib_$ac_lib_var=no"
4788 fi
4789 rm -f conftest*
4790 xe_check_libs=""
4791
4792 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4793   echo "$ac_t""yes" 1>&6
4794   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4795 else
4796   echo "$ac_t""no" 1>&6
4797 fi
4798
4799 fi
4800
4801     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4802       
4803 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4804 echo "configure:4805: checking for dnet_ntoa in -ldnet_stub" >&5
4805 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4806
4807 xe_check_libs=" -ldnet_stub "
4808 cat > conftest.$ac_ext <<EOF
4809 #line 4810 "configure"
4810 #include "confdefs.h"
4811 /* Override any gcc2 internal prototype to avoid an error.  */
4812 /* We use char because int might match the return type of a gcc2
4813     builtin and then its argument prototype would still apply.  */
4814 char dnet_ntoa();
4815
4816 int main() {
4817 dnet_ntoa()
4818 ; return 0; }
4819 EOF
4820 if { (eval echo configure:4821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4821   rm -rf conftest*
4822   eval "ac_cv_lib_$ac_lib_var=yes"
4823 else
4824   echo "configure: failed program was:" >&5
4825   cat conftest.$ac_ext >&5
4826   rm -rf conftest*
4827   eval "ac_cv_lib_$ac_lib_var=no"
4828 fi
4829 rm -f conftest*
4830 xe_check_libs=""
4831
4832 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4833   echo "$ac_t""yes" 1>&6
4834   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4835 else
4836   echo "$ac_t""no" 1>&6
4837 fi
4838
4839
4840     fi
4841
4842     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4843     # to get the SysV transport functions.
4844     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4845     # needs -lnsl.
4846     # The nsl library prevents programs from opening the X display
4847     # on Irix 5.2, according to dickey@clark.net.
4848     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4849 echo "configure:4850: checking for gethostbyname" >&5
4850
4851 cat > conftest.$ac_ext <<EOF
4852 #line 4853 "configure"
4853 #include "confdefs.h"
4854 /* System header to define __stub macros and hopefully few prototypes,
4855     which can conflict with char gethostbyname(); below.  */
4856 #include <assert.h>
4857 /* Override any gcc2 internal prototype to avoid an error.  */
4858 /* We use char because int might match the return type of a gcc2
4859     builtin and then its argument prototype would still apply.  */
4860 char gethostbyname();
4861
4862 int main() {
4863
4864 /* The GNU C library defines this for functions which it implements
4865     to always fail with ENOSYS.  Some functions are actually named
4866     something starting with __ and the normal name is an alias.  */
4867 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4868 choke me
4869 #else
4870 gethostbyname();
4871 #endif
4872
4873 ; return 0; }
4874 EOF
4875 if { (eval echo configure:4876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4876   rm -rf conftest*
4877   eval "ac_cv_func_gethostbyname=yes"
4878 else
4879   echo "configure: failed program was:" >&5
4880   cat conftest.$ac_ext >&5
4881   rm -rf conftest*
4882   eval "ac_cv_func_gethostbyname=no"
4883 fi
4884 rm -f conftest*
4885
4886 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4887   echo "$ac_t""yes" 1>&6
4888   :
4889 else
4890   echo "$ac_t""no" 1>&6
4891 fi
4892
4893     if test $ac_cv_func_gethostbyname = no; then
4894       
4895 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4896 echo "configure:4897: checking for gethostbyname in -lnsl" >&5
4897 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4898
4899 xe_check_libs=" -lnsl "
4900 cat > conftest.$ac_ext <<EOF
4901 #line 4902 "configure"
4902 #include "confdefs.h"
4903 /* Override any gcc2 internal prototype to avoid an error.  */
4904 /* We use char because int might match the return type of a gcc2
4905     builtin and then its argument prototype would still apply.  */
4906 char gethostbyname();
4907
4908 int main() {
4909 gethostbyname()
4910 ; return 0; }
4911 EOF
4912 if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4913   rm -rf conftest*
4914   eval "ac_cv_lib_$ac_lib_var=yes"
4915 else
4916   echo "configure: failed program was:" >&5
4917   cat conftest.$ac_ext >&5
4918   rm -rf conftest*
4919   eval "ac_cv_lib_$ac_lib_var=no"
4920 fi
4921 rm -f conftest*
4922 xe_check_libs=""
4923
4924 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
4925   echo "$ac_t""yes" 1>&6
4926   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4927 else
4928   echo "$ac_t""no" 1>&6
4929 fi
4930
4931
4932     fi
4933
4934     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4935     # socket/setsockopt and other routines are undefined under SCO ODT
4936     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4937     # on later versions), says simon@lia.di.epfl.ch: it contains
4938     # gethostby* variants that don't use the nameserver (or something).
4939     # -lsocket must be given before -lnsl if both are needed.
4940     # We assume that if connect needs -lnsl, so does gethostbyname.
4941     echo $ac_n "checking for connect""... $ac_c" 1>&6
4942 echo "configure:4943: checking for connect" >&5
4943
4944 cat > conftest.$ac_ext <<EOF
4945 #line 4946 "configure"
4946 #include "confdefs.h"
4947 /* System header to define __stub macros and hopefully few prototypes,
4948     which can conflict with char connect(); below.  */
4949 #include <assert.h>
4950 /* Override any gcc2 internal prototype to avoid an error.  */
4951 /* We use char because int might match the return type of a gcc2
4952     builtin and then its argument prototype would still apply.  */
4953 char connect();
4954
4955 int main() {
4956
4957 /* The GNU C library defines this for functions which it implements
4958     to always fail with ENOSYS.  Some functions are actually named
4959     something starting with __ and the normal name is an alias.  */
4960 #if defined (__stub_connect) || defined (__stub___connect)
4961 choke me
4962 #else
4963 connect();
4964 #endif
4965
4966 ; return 0; }
4967 EOF
4968 if { (eval echo configure:4969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4969   rm -rf conftest*
4970   eval "ac_cv_func_connect=yes"
4971 else
4972   echo "configure: failed program was:" >&5
4973   cat conftest.$ac_ext >&5
4974   rm -rf conftest*
4975   eval "ac_cv_func_connect=no"
4976 fi
4977 rm -f conftest*
4978
4979 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4980   echo "$ac_t""yes" 1>&6
4981   :
4982 else
4983   echo "$ac_t""no" 1>&6
4984 fi
4985
4986     if test $ac_cv_func_connect = no; then
4987       
4988 xe_msg_checking="for connect in -lsocket"
4989 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
4990 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
4991 echo "configure:4992: checking "$xe_msg_checking"" >&5
4992 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
4993
4994 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
4995 cat > conftest.$ac_ext <<EOF
4996 #line 4997 "configure"
4997 #include "confdefs.h"
4998 /* Override any gcc2 internal prototype to avoid an error.  */
4999 /* We use char because int might match the return type of a gcc2
5000     builtin and then its argument prototype would still apply.  */
5001 char connect();
5002
5003 int main() {
5004 connect()
5005 ; return 0; }
5006 EOF
5007 if { (eval echo configure:5008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5008   rm -rf conftest*
5009   eval "ac_cv_lib_$ac_lib_var=yes"
5010 else
5011   echo "configure: failed program was:" >&5
5012   cat conftest.$ac_ext >&5
5013   rm -rf conftest*
5014   eval "ac_cv_lib_$ac_lib_var=no"
5015 fi
5016 rm -f conftest*
5017 xe_check_libs=""
5018
5019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5020   echo "$ac_t""yes" 1>&6
5021   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5022 else
5023   echo "$ac_t""no" 1>&6
5024 fi
5025
5026
5027     fi
5028
5029     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5030     echo $ac_n "checking for remove""... $ac_c" 1>&6
5031 echo "configure:5032: checking for remove" >&5
5032
5033 cat > conftest.$ac_ext <<EOF
5034 #line 5035 "configure"
5035 #include "confdefs.h"
5036 /* System header to define __stub macros and hopefully few prototypes,
5037     which can conflict with char remove(); below.  */
5038 #include <assert.h>
5039 /* Override any gcc2 internal prototype to avoid an error.  */
5040 /* We use char because int might match the return type of a gcc2
5041     builtin and then its argument prototype would still apply.  */
5042 char remove();
5043
5044 int main() {
5045
5046 /* The GNU C library defines this for functions which it implements
5047     to always fail with ENOSYS.  Some functions are actually named
5048     something starting with __ and the normal name is an alias.  */
5049 #if defined (__stub_remove) || defined (__stub___remove)
5050 choke me
5051 #else
5052 remove();
5053 #endif
5054
5055 ; return 0; }
5056 EOF
5057 if { (eval echo configure:5058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5058   rm -rf conftest*
5059   eval "ac_cv_func_remove=yes"
5060 else
5061   echo "configure: failed program was:" >&5
5062   cat conftest.$ac_ext >&5
5063   rm -rf conftest*
5064   eval "ac_cv_func_remove=no"
5065 fi
5066 rm -f conftest*
5067
5068 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5069   echo "$ac_t""yes" 1>&6
5070   :
5071 else
5072   echo "$ac_t""no" 1>&6
5073 fi
5074
5075     if test $ac_cv_func_remove = no; then
5076       
5077 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5078 echo "configure:5079: checking for remove in -lposix" >&5
5079 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5080
5081 xe_check_libs=" -lposix "
5082 cat > conftest.$ac_ext <<EOF
5083 #line 5084 "configure"
5084 #include "confdefs.h"
5085 /* Override any gcc2 internal prototype to avoid an error.  */
5086 /* We use char because int might match the return type of a gcc2
5087     builtin and then its argument prototype would still apply.  */
5088 char remove();
5089
5090 int main() {
5091 remove()
5092 ; return 0; }
5093 EOF
5094 if { (eval echo configure:5095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5095   rm -rf conftest*
5096   eval "ac_cv_lib_$ac_lib_var=yes"
5097 else
5098   echo "configure: failed program was:" >&5
5099   cat conftest.$ac_ext >&5
5100   rm -rf conftest*
5101   eval "ac_cv_lib_$ac_lib_var=no"
5102 fi
5103 rm -f conftest*
5104 xe_check_libs=""
5105
5106 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5107   echo "$ac_t""yes" 1>&6
5108   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5109 else
5110   echo "$ac_t""no" 1>&6
5111 fi
5112
5113
5114     fi
5115
5116     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5117     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5118 echo "configure:5119: checking for shmat" >&5
5119
5120 cat > conftest.$ac_ext <<EOF
5121 #line 5122 "configure"
5122 #include "confdefs.h"
5123 /* System header to define __stub macros and hopefully few prototypes,
5124     which can conflict with char shmat(); below.  */
5125 #include <assert.h>
5126 /* Override any gcc2 internal prototype to avoid an error.  */
5127 /* We use char because int might match the return type of a gcc2
5128     builtin and then its argument prototype would still apply.  */
5129 char shmat();
5130
5131 int main() {
5132
5133 /* The GNU C library defines this for functions which it implements
5134     to always fail with ENOSYS.  Some functions are actually named
5135     something starting with __ and the normal name is an alias.  */
5136 #if defined (__stub_shmat) || defined (__stub___shmat)
5137 choke me
5138 #else
5139 shmat();
5140 #endif
5141
5142 ; return 0; }
5143 EOF
5144 if { (eval echo configure:5145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5145   rm -rf conftest*
5146   eval "ac_cv_func_shmat=yes"
5147 else
5148   echo "configure: failed program was:" >&5
5149   cat conftest.$ac_ext >&5
5150   rm -rf conftest*
5151   eval "ac_cv_func_shmat=no"
5152 fi
5153 rm -f conftest*
5154
5155 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5156   echo "$ac_t""yes" 1>&6
5157   :
5158 else
5159   echo "$ac_t""no" 1>&6
5160 fi
5161
5162     if test $ac_cv_func_shmat = no; then
5163       
5164 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5165 echo "configure:5166: checking for shmat in -lipc" >&5
5166 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5167
5168 xe_check_libs=" -lipc "
5169 cat > conftest.$ac_ext <<EOF
5170 #line 5171 "configure"
5171 #include "confdefs.h"
5172 /* Override any gcc2 internal prototype to avoid an error.  */
5173 /* We use char because int might match the return type of a gcc2
5174     builtin and then its argument prototype would still apply.  */
5175 char shmat();
5176
5177 int main() {
5178 shmat()
5179 ; return 0; }
5180 EOF
5181 if { (eval echo configure:5182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5182   rm -rf conftest*
5183   eval "ac_cv_lib_$ac_lib_var=yes"
5184 else
5185   echo "configure: failed program was:" >&5
5186   cat conftest.$ac_ext >&5
5187   rm -rf conftest*
5188   eval "ac_cv_lib_$ac_lib_var=no"
5189 fi
5190 rm -f conftest*
5191 xe_check_libs=""
5192
5193 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5194   echo "$ac_t""yes" 1>&6
5195   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5196 else
5197   echo "$ac_t""no" 1>&6
5198 fi
5199
5200
5201     fi
5202   fi
5203
5204   # Check for libraries that X11R6 Xt/Xaw programs need.
5205   ac_save_LDFLAGS="$LDFLAGS"
5206   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5207   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5208   # check for ICE first), but we must link in the order -lSM -lICE or
5209   # we get undefined symbols.  So assume we have SM if we have ICE.
5210   # These have to be linked with before -lX11, unlike the other
5211   # libraries we check for below, so use a different variable.
5212   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5213   
5214 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5215 echo "configure:5216: checking for IceConnectionNumber in -lICE" >&5
5216 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5217
5218 xe_check_libs=" -lICE "
5219 cat > conftest.$ac_ext <<EOF
5220 #line 5221 "configure"
5221 #include "confdefs.h"
5222 /* Override any gcc2 internal prototype to avoid an error.  */
5223 /* We use char because int might match the return type of a gcc2
5224     builtin and then its argument prototype would still apply.  */
5225 char IceConnectionNumber();
5226
5227 int main() {
5228 IceConnectionNumber()
5229 ; return 0; }
5230 EOF
5231 if { (eval echo configure:5232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5232   rm -rf conftest*
5233   eval "ac_cv_lib_$ac_lib_var=yes"
5234 else
5235   echo "configure: failed program was:" >&5
5236   cat conftest.$ac_ext >&5
5237   rm -rf conftest*
5238   eval "ac_cv_lib_$ac_lib_var=no"
5239 fi
5240 rm -f conftest*
5241 xe_check_libs=""
5242
5243 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5244   echo "$ac_t""yes" 1>&6
5245   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5246 else
5247   echo "$ac_t""no" 1>&6
5248 fi
5249
5250
5251   LDFLAGS="$ac_save_LDFLAGS"
5252
5253 fi
5254  # Autoconf claims to find X library and include dirs for us.
5255   if test "$no_x" = "yes"
5256   then with_x11=no  window_system=none HAVE_X_WINDOWS=no
5257   else with_x11=yes window_system=x11  HAVE_X_WINDOWS=yes
5258   fi
5259 fi
5260
5261 case "$with_x11" in
5262   yes ) window_system=x11  HAVE_X_WINDOWS=yes ;;
5263   no  ) window_system=none HAVE_X_WINDOWS=no  ;;
5264 esac
5265
5266 if test "$with_x11" = "yes"; then
5267   { test "$extra_verbose" = "yes" && cat << \EOF
5268     Defining HAVE_X_WINDOWS
5269 EOF
5270 cat >> confdefs.h <<\EOF
5271 #define HAVE_X_WINDOWS 1
5272 EOF
5273 }
5274
5275   MAKE_SUBDIR="$MAKE_SUBDIR lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$MAKE_SUBDIR"; fi
5276   SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi
5277
5278       for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
5279     inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
5280     if test -d "$lib_dir" -a -d "$inc_dir"; then
5281       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5282         x_libraries="$lib_dir $x_libraries"
5283         X_LIBS="-L${lib_dir} $X_LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;;
5284       esac
5285       case "$x_includes" in "$inc_dir"* ) ;; *)
5286         x_includes="$inc_dir $x_includes"
5287         X_CFLAGS="-I${inc_dir} $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;;
5288       esac
5289       break;       fi
5290   done
5291
5292     for rel in "X11R6" "X11R5" "X11R4"; do
5293     lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
5294     if test -d "$lib_dir" -a -d "$inc_dir"; then
5295       case "$x_libraries" in *"$lib_dir"* ) ;; *)
5296         x_libraries="$x_libraries $lib_dir"
5297         X_LIBS="$X_LIBS -L${lib_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${lib_dir}\" to \$X_LIBS"; fi
5298       esac
5299       case "$x_includes" in "$inc_dir"* ) ;; *)
5300         x_includes="$x_includes $inc_dir"
5301         X_CFLAGS="$X_CFLAGS -I${inc_dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi
5302       esac
5303       break;     fi
5304   done
5305
5306     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
5307
5308   ld_switch_x_site="$X_LIBS"
5309
5310   
5311 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
5312     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5313   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
5314   
5315         runpath="" runpath_dirs=""
5316   if test -n "$LD_RUN_PATH"; then
5317     runpath="$LD_RUN_PATH"
5318   elif test "$GCC" = "yes"; then
5319         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
5320     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
5321     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
5322     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
5323       case "$arg" in P,* | -L* | -R* )
5324         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
5325           {
5326 xe_runpath_dir="$dir"
5327   test "$xe_runpath_dir" != "/lib"     -a \
5328         "$xe_runpath_dir" != "/usr/lib" -a \
5329         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5330   eval "$xe_add_unique_runpath_dir"
5331 }
5332         done ;;
5333       esac
5334     done
5335     ld_switch_run="$ld_switch_run_save"
5336     rm -f conftest*
5337   else
5338         for arg in $ld_switch_site $ld_switch_x_site; do
5339       case "$arg" in -L*) {
5340 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
5341   test "$xe_runpath_dir" != "/lib"     -a \
5342         "$xe_runpath_dir" != "/usr/lib" -a \
5343         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
5344   eval "$xe_add_unique_runpath_dir"
5345 };; esac
5346     done
5347         if test "$opsys $need_motif" = "sol2 yes"; then
5348       xe_runpath_dir="/opt/SUNWdt/lib";
5349       eval "$xe_add_unique_runpath_dir";
5350     fi
5351   fi 
5352   if test -n "$runpath"; then
5353     ld_switch_run="${dash_r}${runpath}"
5354     
5355 if test "$GCC" = "yes"; then
5356   set x $ld_switch_run; shift; ld_switch_run=""
5357   while test -n "$1"; do
5358     case $1 in
5359       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
5360       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
5361       -Xlinker* ) ;;
5362       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
5363     esac
5364     shift
5365   done
5366 fi
5367     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
5368   fi
5369 fi
5370
5371
5372   if test "$extra_verbose" = "yes"; then
5373     echo; echo "X11 compilation variables:"
5374     for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done
5375     echo
5376   fi
5377
5378             bitmapdirs=
5379   if test "$x_includes" != NONE; then
5380     for i in $x_includes; do
5381       if test -d "$i/bitmaps"; then
5382         bitmapdirs="$i/bitmaps:$bitmapdirs"
5383       fi
5384       if test -d "$i/X11/bitmaps"; then
5385         bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
5386       fi
5387     done
5388     bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
5389   fi
5390   test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF
5391     Defining BITMAPDIR = "$bitmapdirs"
5392 EOF
5393 cat >> confdefs.h <<EOF
5394 #define BITMAPDIR "$bitmapdirs"
5395 EOF
5396 }
5397
5398
5399     echo "checking for X defines extracted by xmkmf" 1>&6
5400 echo "configure:5401: checking for X defines extracted by xmkmf" >&5
5401   rm -fr conftestdir
5402   if mkdir conftestdir; then
5403     cd conftestdir
5404     cat > Imakefile <<'EOF'
5405 xetest:
5406         @echo ${PROTO_DEFINES} ${STD_DEFINES}
5407 EOF
5408     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5409       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5410       xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
5411     fi
5412     cd ..
5413     rm -fr conftestdir
5414     for word in $xmkmf_defines; do
5415       case "$word" in
5416         -D*=* ) ;;
5417         -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
5418               { test "$extra_verbose" = "yes" && cat << EOF
5419     Defining $word
5420 EOF
5421 cat >> confdefs.h <<EOF
5422 #define $word 1
5423 EOF
5424 }
5425  ;;
5426       esac
5427     done
5428   fi
5429
5430     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
5431 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
5432 echo "configure:5433: checking for X11/Intrinsic.h" >&5
5433
5434 cat > conftest.$ac_ext <<EOF
5435 #line 5436 "configure"
5436 #include "confdefs.h"
5437 #include <X11/Intrinsic.h>
5438 EOF
5439 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5440 { (eval echo configure:5441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5441 ac_err=`grep -v '^ *+' conftest.out`
5442 if test -z "$ac_err"; then
5443   rm -rf conftest*
5444   eval "ac_cv_header_$ac_safe=yes"
5445 else
5446   echo "$ac_err" >&5
5447   echo "configure: failed program was:" >&5
5448   cat conftest.$ac_ext >&5
5449   rm -rf conftest*
5450   eval "ac_cv_header_$ac_safe=no"
5451 fi
5452 rm -f conftest*
5453 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5454   echo "$ac_t""yes" 1>&6
5455   :
5456 else
5457   echo "$ac_t""no" 1>&6
5458 { echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; }
5459 fi
5460
5461
5462       
5463 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5464 echo "configure:5465: checking for XOpenDisplay in -lX11" >&5
5465 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5466
5467 xe_check_libs=" -lX11 "
5468 cat > conftest.$ac_ext <<EOF
5469 #line 5470 "configure"
5470 #include "confdefs.h"
5471 /* Override any gcc2 internal prototype to avoid an error.  */
5472 /* We use char because int might match the return type of a gcc2
5473     builtin and then its argument prototype would still apply.  */
5474 char XOpenDisplay();
5475
5476 int main() {
5477 XOpenDisplay()
5478 ; return 0; }
5479 EOF
5480 if { (eval echo configure:5481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5481   rm -rf conftest*
5482   eval "ac_cv_lib_$ac_lib_var=yes"
5483 else
5484   echo "configure: failed program was:" >&5
5485   cat conftest.$ac_ext >&5
5486   rm -rf conftest*
5487   eval "ac_cv_lib_$ac_lib_var=no"
5488 fi
5489 rm -f conftest*
5490 xe_check_libs=""
5491
5492 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5493   echo "$ac_t""yes" 1>&6
5494   have_lib_x11=yes
5495 else
5496   echo "$ac_t""no" 1>&6
5497 fi
5498
5499
5500   if test "$have_lib_x11" != "yes"; then
5501     
5502 xe_msg_checking="for XGetFontProperty in -lX11"
5503 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
5504 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
5505 echo "configure:5506: checking "$xe_msg_checking"" >&5
5506 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
5507
5508 xe_check_libs=" -lX11 -b i486-linuxaout"
5509 cat > conftest.$ac_ext <<EOF
5510 #line 5511 "configure"
5511 #include "confdefs.h"
5512 /* Override any gcc2 internal prototype to avoid an error.  */
5513 /* We use char because int might match the return type of a gcc2
5514     builtin and then its argument prototype would still apply.  */
5515 char XGetFontProperty();
5516
5517 int main() {
5518 XGetFontProperty()
5519 ; return 0; }
5520 EOF
5521 if { (eval echo configure:5522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5522   rm -rf conftest*
5523   eval "ac_cv_lib_$ac_lib_var=yes"
5524 else
5525   echo "configure: failed program was:" >&5
5526   cat conftest.$ac_ext >&5
5527   rm -rf conftest*
5528   eval "ac_cv_lib_$ac_lib_var=no"
5529 fi
5530 rm -f conftest*
5531 xe_check_libs=""
5532
5533 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5534   echo "$ac_t""yes" 1>&6
5535   ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site"
5536 else
5537   echo "$ac_t""no" 1>&6
5538 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5539 fi
5540
5541
5542   fi
5543   libs_x="-lX11"
5544   test "$extra_verbose" = "yes" && echo "    Setting libs_x to \"-lX11\""
5545
5546     
5547 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
5548 echo "configure:5549: checking for XShapeSelectInput in -lXext" >&5
5549 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
5550
5551 xe_check_libs=" -lXext "
5552 cat > conftest.$ac_ext <<EOF
5553 #line 5554 "configure"
5554 #include "confdefs.h"
5555 /* Override any gcc2 internal prototype to avoid an error.  */
5556 /* We use char because int might match the return type of a gcc2
5557     builtin and then its argument prototype would still apply.  */
5558 char XShapeSelectInput();
5559
5560 int main() {
5561 XShapeSelectInput()
5562 ; return 0; }
5563 EOF
5564 if { (eval echo configure:5565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5565   rm -rf conftest*
5566   eval "ac_cv_lib_$ac_lib_var=yes"
5567 else
5568   echo "configure: failed program was:" >&5
5569   cat conftest.$ac_ext >&5
5570   rm -rf conftest*
5571   eval "ac_cv_lib_$ac_lib_var=no"
5572 fi
5573 rm -f conftest*
5574 xe_check_libs=""
5575
5576 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5577   echo "$ac_t""yes" 1>&6
5578   libs_x="-lXext $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXext\" to \$libs_x"; fi
5579 else
5580   echo "$ac_t""no" 1>&6
5581 fi
5582
5583
5584
5585     
5586 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
5587 echo "configure:5588: checking for XtOpenDisplay in -lXt" >&5
5588 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
5589
5590 xe_check_libs=" -lXt "
5591 cat > conftest.$ac_ext <<EOF
5592 #line 5593 "configure"
5593 #include "confdefs.h"
5594 /* Override any gcc2 internal prototype to avoid an error.  */
5595 /* We use char because int might match the return type of a gcc2
5596     builtin and then its argument prototype would still apply.  */
5597 char XtOpenDisplay();
5598
5599 int main() {
5600 XtOpenDisplay()
5601 ; return 0; }
5602 EOF
5603 if { (eval echo configure:5604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5604   rm -rf conftest*
5605   eval "ac_cv_lib_$ac_lib_var=yes"
5606 else
5607   echo "configure: failed program was:" >&5
5608   cat conftest.$ac_ext >&5
5609   rm -rf conftest*
5610   eval "ac_cv_lib_$ac_lib_var=no"
5611 fi
5612 rm -f conftest*
5613 xe_check_libs=""
5614
5615 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5616   echo "$ac_t""yes" 1>&6
5617   libs_x="-lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXt\" to \$libs_x"; fi
5618 else
5619   echo "$ac_t""no" 1>&6
5620 { echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; }
5621 fi
5622
5623
5624
5625   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
5626 echo "configure:5627: checking the version of X11 being used" >&5
5627   cat > conftest.$ac_ext <<EOF
5628 #line 5629 "configure"
5629 #include "confdefs.h"
5630 #include <X11/Intrinsic.h>
5631     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
5632 EOF
5633 if { (eval echo configure:5634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5634 then
5635   ./conftest foobar; x11_release=$?
5636 else
5637   conftest_rc="$?"
5638   echo "configure: failed program was:" >&5
5639   cat conftest.$ac_ext >&5
5640   rm -fr conftest*
5641   x11_release=4
5642 fi
5643 rm -fr conftest*
5644   echo "$ac_t""R${x11_release}" 1>&6
5645   { test "$extra_verbose" = "yes" && cat << EOF
5646     Defining THIS_IS_X11R${x11_release}
5647 EOF
5648 cat >> confdefs.h <<EOF
5649 #define THIS_IS_X11R${x11_release} 1
5650 EOF
5651 }
5652
5653
5654   for ac_hdr in X11/Xlocale.h
5655 do
5656 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5657 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5658 echo "configure:5659: checking for $ac_hdr" >&5
5659
5660 cat > conftest.$ac_ext <<EOF
5661 #line 5662 "configure"
5662 #include "confdefs.h"
5663 #include <$ac_hdr>
5664 EOF
5665 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5666 { (eval echo configure:5667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5667 ac_err=`grep -v '^ *+' conftest.out`
5668 if test -z "$ac_err"; then
5669   rm -rf conftest*
5670   eval "ac_cv_header_$ac_safe=yes"
5671 else
5672   echo "$ac_err" >&5
5673   echo "configure: failed program was:" >&5
5674   cat conftest.$ac_ext >&5
5675   rm -rf conftest*
5676   eval "ac_cv_header_$ac_safe=no"
5677 fi
5678 rm -f conftest*
5679 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5680   echo "$ac_t""yes" 1>&6
5681     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5682   { test "$extra_verbose" = "yes" && cat << EOF
5683     Defining $ac_tr_hdr
5684 EOF
5685 cat >> confdefs.h <<EOF
5686 #define $ac_tr_hdr 1
5687 EOF
5688 }
5689  
5690 else
5691   echo "$ac_t""no" 1>&6
5692 fi
5693 done
5694
5695
5696     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
5697 echo "configure:5698: checking for XFree86" >&5
5698   if test -d "/usr/X386/include" -o \
5699           -f "/etc/XF86Config"    -o \
5700           -f "/etc/X11/XF86Config" -o \
5701           -f "/usr/X11R6/lib/X11/XF86Config"; then
5702     echo "$ac_t""yes" 1>&6
5703     { test "$extra_verbose" = "yes" && cat << \EOF
5704     Defining HAVE_XFREE386
5705 EOF
5706 cat >> confdefs.h <<\EOF
5707 #define HAVE_XFREE386 1
5708 EOF
5709 }
5710
5711   else
5712     echo "$ac_t""no" 1>&6
5713   fi
5714
5715     test -z "$with_xmu" && { 
5716 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
5717 echo "configure:5718: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
5718 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
5719
5720 xe_check_libs=" -lXmu "
5721 cat > conftest.$ac_ext <<EOF
5722 #line 5723 "configure"
5723 #include "confdefs.h"
5724 /* Override any gcc2 internal prototype to avoid an error.  */
5725 /* We use char because int might match the return type of a gcc2
5726     builtin and then its argument prototype would still apply.  */
5727 char XmuReadBitmapDataFromFile();
5728
5729 int main() {
5730 XmuReadBitmapDataFromFile()
5731 ; return 0; }
5732 EOF
5733 if { (eval echo configure:5734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5734   rm -rf conftest*
5735   eval "ac_cv_lib_$ac_lib_var=yes"
5736 else
5737   echo "configure: failed program was:" >&5
5738   cat conftest.$ac_ext >&5
5739   rm -rf conftest*
5740   eval "ac_cv_lib_$ac_lib_var=no"
5741 fi
5742 rm -f conftest*
5743 xe_check_libs=""
5744
5745 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5746   echo "$ac_t""yes" 1>&6
5747   with_xmu=yes
5748 else
5749   echo "$ac_t""no" 1>&6
5750 with_xmu=no
5751 fi
5752
5753  }
5754   if test "$with_xmu" = "no"; then
5755     extra_objs="$extra_objs xmu.o" &&  if test "$extra_verbose" = "yes"; then
5756    echo "    xemacs will be linked with \"xmu.o\""
5757  fi
5758   else
5759     libs_x="-lXmu $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXmu\" to \$libs_x"; fi
5760     { test "$extra_verbose" = "yes" && cat << \EOF
5761     Defining HAVE_XMU
5762 EOF
5763 cat >> confdefs.h <<\EOF
5764 #define HAVE_XMU 1
5765 EOF
5766 }
5767
5768   fi
5769
5770       
5771 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
5772 echo "configure:5773: checking for main in -lXbsd" >&5
5773 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
5774
5775 xe_check_libs=" -lXbsd "
5776 cat > conftest.$ac_ext <<EOF
5777 #line 5778 "configure"
5778 #include "confdefs.h"
5779
5780 int main() {
5781 main()
5782 ; return 0; }
5783 EOF
5784 if { (eval echo configure:5785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5785   rm -rf conftest*
5786   eval "ac_cv_lib_$ac_lib_var=yes"
5787 else
5788   echo "configure: failed program was:" >&5
5789   cat conftest.$ac_ext >&5
5790   rm -rf conftest*
5791   eval "ac_cv_lib_$ac_lib_var=no"
5792 fi
5793 rm -f conftest*
5794 xe_check_libs=""
5795
5796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5797   echo "$ac_t""yes" 1>&6
5798   libs_x="-lXbsd $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXbsd\" to \$libs_x"; fi
5799 else
5800   echo "$ac_t""no" 1>&6
5801 fi
5802
5803
5804
5805     if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
5806         if test "$GCC" = "yes"; then
5807       X_CFLAGS="-mthreads $X_CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$X_CFLAGS"; fi
5808       libs_x="-mthreads $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-mthreads\" to \$libs_x"; fi
5809     else
5810       case "$CC" in
5811         "xlc" ) CC="xlc_r" ;;
5812         "xlC" ) CC="xlC_r" ;;
5813         "cc"  ) CC="cc_r" ;;
5814       esac
5815     fi
5816   fi
5817
5818 fi 
5819 if test "$with_msw" != "no"; then
5820   echo "checking for MS-Windows" 1>&6
5821 echo "configure:5822: checking for MS-Windows" >&5
5822   
5823 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
5824 echo "configure:5825: checking for main in -lgdi32" >&5
5825 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
5826
5827 xe_check_libs=" -lgdi32 "
5828 cat > conftest.$ac_ext <<EOF
5829 #line 5830 "configure"
5830 #include "confdefs.h"
5831
5832 int main() {
5833 main()
5834 ; return 0; }
5835 EOF
5836 if { (eval echo configure:5837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5837   rm -rf conftest*
5838   eval "ac_cv_lib_$ac_lib_var=yes"
5839 else
5840   echo "configure: failed program was:" >&5
5841   cat conftest.$ac_ext >&5
5842   rm -rf conftest*
5843   eval "ac_cv_lib_$ac_lib_var=no"
5844 fi
5845 rm -f conftest*
5846 xe_check_libs=""
5847
5848 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
5849   echo "$ac_t""yes" 1>&6
5850   with_msw=yes
5851 else
5852   echo "$ac_t""no" 1>&6
5853 fi
5854
5855
5856   if test "$with_msw" = "yes"; then
5857     { test "$extra_verbose" = "yes" && cat << \EOF
5858     Defining HAVE_MS_WINDOWS
5859 EOF
5860 cat >> confdefs.h <<\EOF
5861 #define HAVE_MS_WINDOWS 1
5862 EOF
5863 }
5864
5865     install_pp="$blddir/lib-src/installexe.sh"
5866     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
5867     test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
5868     if test "$window_system" != x11; then
5869         window_system=msw
5870         test "$with_scrollbars" != "no" && with_scrollbars=msw \
5871             && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5872    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5873  fi
5874         test "$with_menubars"   != "no" && with_menubars=msw \
5875             && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5876    echo "    xemacs will be linked with \"menubar-msw.o\""
5877  fi
5878         test "$with_toolbars"   != "no" && with_toolbars=msw \
5879             && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5880    echo "    xemacs will be linked with \"toolbar-msw.o\""
5881  fi
5882         test "$with_dialogs"   != "no" && with_dialogs=msw \
5883             && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5884    echo "    xemacs will be linked with \"dialog-msw.o\""
5885  fi
5886     else
5887         test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5888    echo "    xemacs will be linked with \"scrollbar-msw.o\""
5889  fi
5890         test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5891    echo "    xemacs will be linked with \"menubar-msw.o\""
5892  fi
5893         test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
5894    echo "    xemacs will be linked with \"toolbar-msw.o\""
5895  fi
5896         test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
5897    echo "    xemacs will be linked with \"dialog-msw.o\""
5898  fi
5899     fi
5900         cat > conftest.$ac_ext <<EOF
5901 #line 5902 "configure"
5902 #include "confdefs.h"
5903 #include <fcntl.h>
5904     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
5905 EOF
5906 if { (eval echo configure:5907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
5907 then
5908   { test "$extra_verbose" = "yes" && cat << \EOF
5909     Defining HAVE_MSG_SELECT
5910 EOF
5911 cat >> confdefs.h <<\EOF
5912 #define HAVE_MSG_SELECT 1
5913 EOF
5914 }
5915
5916 else
5917   conftest_rc="$?"
5918   echo "configure: failed program was:" >&5
5919   cat conftest.$ac_ext >&5
5920 fi
5921 rm -fr conftest*
5922     const_is_losing=no
5923     with_file_coding=yes
5924     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
5925    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\""
5926  fi
5927   fi
5928 fi
5929
5930
5931
5932 test -z "$window_system" && window_system="none"
5933
5934 if test "$window_system" = "none"; then
5935   for feature in menubars scrollbars toolbars dialogs dragndrop xface
5936   do
5937     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5938        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
5939     fi
5940     eval "with_${feature}=no"
5941   done
5942 else
5943   test -z "$with_toolbars" && with_toolbars=yes
5944 fi
5945
5946 if test "$with_msw" != "yes"; then
5947   for feature in   MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
5948   do
5949     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5950        echo "configure: warning: --with-$feature ignored:  Not valid without MS-Windows support" 1>&2
5951     fi
5952     eval "with_${feature}=no"
5953   done
5954 else
5955   :
5956 fi
5957
5958 if test "$with_x11" != "yes"; then
5959             for feature in tooltalk cde offix wmcommand xim xmu
5960   do
5961     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
5962        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
5963     fi
5964     eval "with_${feature}=no"
5965   done
5966 fi
5967
5968 bitmapdir=
5969
5970 case "$window_system" in
5971   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
5972   msw  ) HAVE_X_WINDOWS=no ; echo "  Using MS-Windows." ;;
5973   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
5974 esac
5975
5976 case "$x_libraries" in *X11R4* )
5977   test "$opsys" = "hpux9"     && opsysfile="s/hpux9-x11r4.h"
5978   test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
5979 esac
5980
5981 echo "checking for WM_COMMAND option" 1>&6
5982 echo "configure:5983: checking for WM_COMMAND option" >&5;
5983 if test "$with_wmcommand" != "no"; then
5984   { test "$extra_verbose" = "yes" && cat << \EOF
5985     Defining HAVE_WMCOMMAND
5986 EOF
5987 cat >> confdefs.h <<\EOF
5988 #define HAVE_WMCOMMAND 1
5989 EOF
5990 }
5991
5992 fi
5993
5994 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
5995 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
5996 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
5997 echo "configure:5998: checking for X11/Xauth.h" >&5
5998
5999 cat > conftest.$ac_ext <<EOF
6000 #line 6001 "configure"
6001 #include "confdefs.h"
6002 #include <X11/Xauth.h>
6003 EOF
6004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6005 { (eval echo configure:6006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6006 ac_err=`grep -v '^ *+' conftest.out`
6007 if test -z "$ac_err"; then
6008   rm -rf conftest*
6009   eval "ac_cv_header_$ac_safe=yes"
6010 else
6011   echo "$ac_err" >&5
6012   echo "configure: failed program was:" >&5
6013   cat conftest.$ac_ext >&5
6014   rm -rf conftest*
6015   eval "ac_cv_header_$ac_safe=no"
6016 fi
6017 rm -f conftest*
6018 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6019   echo "$ac_t""yes" 1>&6
6020   :
6021 else
6022   echo "$ac_t""no" 1>&6
6023 with_xauth=no
6024 fi
6025  }
6026 test -z "$with_xauth" && { 
6027 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
6028 echo "configure:6029: checking for XauGetAuthByAddr in -lXau" >&5
6029 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
6030
6031 xe_check_libs=" -lXau "
6032 cat > conftest.$ac_ext <<EOF
6033 #line 6034 "configure"
6034 #include "confdefs.h"
6035 /* Override any gcc2 internal prototype to avoid an error.  */
6036 /* We use char because int might match the return type of a gcc2
6037     builtin and then its argument prototype would still apply.  */
6038 char XauGetAuthByAddr();
6039
6040 int main() {
6041 XauGetAuthByAddr()
6042 ; return 0; }
6043 EOF
6044 if { (eval echo configure:6045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6045   rm -rf conftest*
6046   eval "ac_cv_lib_$ac_lib_var=yes"
6047 else
6048   echo "configure: failed program was:" >&5
6049   cat conftest.$ac_ext >&5
6050   rm -rf conftest*
6051   eval "ac_cv_lib_$ac_lib_var=no"
6052 fi
6053 rm -f conftest*
6054 xe_check_libs=""
6055
6056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6057   echo "$ac_t""yes" 1>&6
6058   :
6059 else
6060   echo "$ac_t""no" 1>&6
6061 with_xauth=no
6062 fi
6063
6064  }
6065 test -z "$with_xauth" && with_xauth=yes
6066 if test "$with_xauth" = "yes"; then
6067   { test "$extra_verbose" = "yes" && cat << \EOF
6068     Defining HAVE_XAUTH
6069 EOF
6070 cat >> confdefs.h <<\EOF
6071 #define HAVE_XAUTH 1
6072 EOF
6073 }
6074
6075   
6076 T=""
6077 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
6078 libs_xauth="$T"
6079
6080 fi
6081
6082
6083
6084
6085 if test "$with_tooltalk" != "no" ; then
6086       for dir in "" "Tt/" "desktop/" ; do
6087     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
6088 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
6089 echo "configure:6090: checking for ${dir}tt_c.h" >&5
6090
6091 cat > conftest.$ac_ext <<EOF
6092 #line 6093 "configure"
6093 #include "confdefs.h"
6094 #include <${dir}tt_c.h>
6095 EOF
6096 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6097 { (eval echo configure:6098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6098 ac_err=`grep -v '^ *+' conftest.out`
6099 if test -z "$ac_err"; then
6100   rm -rf conftest*
6101   eval "ac_cv_header_$ac_safe=yes"
6102 else
6103   echo "$ac_err" >&5
6104   echo "configure: failed program was:" >&5
6105   cat conftest.$ac_ext >&5
6106   rm -rf conftest*
6107   eval "ac_cv_header_$ac_safe=no"
6108 fi
6109 rm -f conftest*
6110 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6111   echo "$ac_t""yes" 1>&6
6112   tt_c_h_path="${dir}tt_c.h"; break
6113 else
6114   echo "$ac_t""no" 1>&6
6115 fi
6116
6117   done
6118   if test -z "$tt_c_h_path"; then
6119     if test "$with_tooltalk" = "yes"; then
6120       (echo "$progname: Usage error:"
6121 echo " " "Unable to find required tooltalk header files."
6122 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6123     fi
6124     with_tooltalk=no
6125   fi
6126 fi
6127 if test "$with_tooltalk" != "no" ; then
6128   for extra_libs in "" "-lI18N -lce" "-lcxx"; do
6129     
6130 xe_msg_checking="for tt_message_create in -ltt"
6131 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
6132 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6133 echo "configure:6134: checking "$xe_msg_checking"" >&5
6134 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
6135
6136 xe_check_libs=" -ltt $extra_libs"
6137 cat > conftest.$ac_ext <<EOF
6138 #line 6139 "configure"
6139 #include "confdefs.h"
6140 /* Override any gcc2 internal prototype to avoid an error.  */
6141 /* We use char because int might match the return type of a gcc2
6142     builtin and then its argument prototype would still apply.  */
6143 char tt_message_create();
6144
6145 int main() {
6146 tt_message_create()
6147 ; return 0; }
6148 EOF
6149 if { (eval echo configure:6150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6150   rm -rf conftest*
6151   eval "ac_cv_lib_$ac_lib_var=yes"
6152 else
6153   echo "configure: failed program was:" >&5
6154   cat conftest.$ac_ext >&5
6155   rm -rf conftest*
6156   eval "ac_cv_lib_$ac_lib_var=no"
6157 fi
6158 rm -f conftest*
6159 xe_check_libs=""
6160
6161 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6162   echo "$ac_t""yes" 1>&6
6163   tt_libs="-ltt $extra_libs"; break
6164 else
6165   echo "$ac_t""no" 1>&6
6166 :
6167 fi
6168
6169
6170   done
6171   if test -z "$tt_libs"; then
6172     if test "$with_tooltalk" = "yes"; then
6173       (echo "$progname: Usage error:"
6174 echo " " "Unable to find required tooltalk libraries."
6175 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
6176     fi
6177     with_tooltalk=no
6178   fi
6179 fi
6180 test -z "$with_tooltalk" && with_tooltalk=yes
6181 if test "$with_tooltalk" = "yes"; then
6182   { test "$extra_verbose" = "yes" && cat << \EOF
6183     Defining TOOLTALK
6184 EOF
6185 cat >> confdefs.h <<\EOF
6186 #define TOOLTALK 1
6187 EOF
6188 }
6189
6190   { test "$extra_verbose" = "yes" && cat << EOF
6191     Defining TT_C_H_PATH = "$tt_c_h_path"
6192 EOF
6193 cat >> confdefs.h <<EOF
6194 #define TT_C_H_PATH "$tt_c_h_path"
6195 EOF
6196 }
6197
6198   libs_x="$tt_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$tt_libs\" to \$libs_x"; fi
6199   extra_objs="$extra_objs tooltalk.o" &&  if test "$extra_verbose" = "yes"; then
6200    echo "    xemacs will be linked with \"tooltalk.o\""
6201  fi
6202 fi
6203
6204 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
6205 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
6206 echo "configure:6207: checking for Dt/Dt.h" >&5
6207
6208 cat > conftest.$ac_ext <<EOF
6209 #line 6210 "configure"
6210 #include "confdefs.h"
6211 #include <Dt/Dt.h>
6212 EOF
6213 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6214 { (eval echo configure:6215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6215 ac_err=`grep -v '^ *+' conftest.out`
6216 if test -z "$ac_err"; then
6217   rm -rf conftest*
6218   eval "ac_cv_header_$ac_safe=yes"
6219 else
6220   echo "$ac_err" >&5
6221   echo "configure: failed program was:" >&5
6222   cat conftest.$ac_ext >&5
6223   rm -rf conftest*
6224   eval "ac_cv_header_$ac_safe=no"
6225 fi
6226 rm -f conftest*
6227 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6228   echo "$ac_t""yes" 1>&6
6229   :
6230 else
6231   echo "$ac_t""no" 1>&6
6232 with_cde=no
6233 fi
6234  }
6235 test -z "$with_cde" && { 
6236 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
6237 echo "configure:6238: checking for DtDndDragStart in -lDtSvc" >&5
6238 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
6239
6240 xe_check_libs=" -lDtSvc "
6241 cat > conftest.$ac_ext <<EOF
6242 #line 6243 "configure"
6243 #include "confdefs.h"
6244 /* Override any gcc2 internal prototype to avoid an error.  */
6245 /* We use char because int might match the return type of a gcc2
6246     builtin and then its argument prototype would still apply.  */
6247 char DtDndDragStart();
6248
6249 int main() {
6250 DtDndDragStart()
6251 ; return 0; }
6252 EOF
6253 if { (eval echo configure:6254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6254   rm -rf conftest*
6255   eval "ac_cv_lib_$ac_lib_var=yes"
6256 else
6257   echo "configure: failed program was:" >&5
6258   cat conftest.$ac_ext >&5
6259   rm -rf conftest*
6260   eval "ac_cv_lib_$ac_lib_var=no"
6261 fi
6262 rm -f conftest*
6263 xe_check_libs=""
6264
6265 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6266   echo "$ac_t""yes" 1>&6
6267   :
6268 else
6269   echo "$ac_t""no" 1>&6
6270 with_cde=no
6271 fi
6272
6273  }
6274 test -z "$with_cde" && with_cde=yes
6275 if test "$with_dragndrop" = no; then
6276   echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2
6277   with_cde=no
6278 fi
6279 if test "$with_cde" = "yes" ; then
6280   { test "$extra_verbose" = "yes" && cat << \EOF
6281     Defining HAVE_CDE
6282 EOF
6283 cat >> confdefs.h <<\EOF
6284 #define HAVE_CDE 1
6285 EOF
6286 }
6287
6288   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
6289   dragndrop_proto="$dragndrop_proto CDE" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"CDE\" to \$dragndrop_proto"; fi
6290   with_tooltalk=yes # CDE requires Tooltalk
6291   need_motif=yes    # CDE requires Motif
6292 fi
6293
6294 test "$window_system" != "x11" && with_offix=no
6295 if test "$with_xmu" != yes -a "$with_x11" = yes; then
6296   echo "configure: warning: No OffiX without real Xmu support" 1>&2
6297   with_offix=no
6298 fi
6299 if test "$with_dragndrop" = no; then
6300   echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
6301   with_offix=no
6302 fi
6303 if test "$with_cde" = yes; then
6304   echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
6305   with_offix=no
6306 fi
6307 test -z "$with_offix" && with_offix=no
6308 if test "$with_offix" = "yes"; then
6309   { test "$extra_verbose" = "yes" && cat << \EOF
6310     Defining HAVE_OFFIX_DND
6311 EOF
6312 cat >> confdefs.h <<\EOF
6313 #define HAVE_OFFIX_DND 1
6314 EOF
6315 }
6316
6317   dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
6318   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
6319 fi
6320
6321 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
6322 echo "configure:6323: checking if drag and drop API is needed" >&5
6323 if test "$with_dragndrop" != "no" ; then
6324   if test -n "$dragndrop_proto" ; then
6325     with_dragndrop=yes
6326     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
6327     { test "$extra_verbose" = "yes" && cat << \EOF
6328     Defining HAVE_DRAGNDROP
6329 EOF
6330 cat >> confdefs.h <<\EOF
6331 #define HAVE_DRAGNDROP 1
6332 EOF
6333 }
6334
6335     extra_objs="$extra_objs dragdrop.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"dragdrop.o\" to \$extra_objs"; fi
6336   else
6337     with_dragndrop=no
6338     echo "$ac_t""no" 1>&6
6339   fi
6340 fi
6341
6342 echo "checking for LDAP" 1>&6
6343 echo "configure:6344: checking for LDAP" >&5
6344 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
6345 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
6346 echo "configure:6347: checking for ldap.h" >&5
6347
6348 cat > conftest.$ac_ext <<EOF
6349 #line 6350 "configure"
6350 #include "confdefs.h"
6351 #include <ldap.h>
6352 EOF
6353 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6354 { (eval echo configure:6355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6355 ac_err=`grep -v '^ *+' conftest.out`
6356 if test -z "$ac_err"; then
6357   rm -rf conftest*
6358   eval "ac_cv_header_$ac_safe=yes"
6359 else
6360   echo "$ac_err" >&5
6361   echo "configure: failed program was:" >&5
6362   cat conftest.$ac_ext >&5
6363   rm -rf conftest*
6364   eval "ac_cv_header_$ac_safe=no"
6365 fi
6366 rm -f conftest*
6367 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6368   echo "$ac_t""yes" 1>&6
6369   :
6370 else
6371   echo "$ac_t""no" 1>&6
6372 with_ldap=no
6373 fi
6374  }
6375 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
6376 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
6377 echo "configure:6378: checking for lber.h" >&5
6378
6379 cat > conftest.$ac_ext <<EOF
6380 #line 6381 "configure"
6381 #include "confdefs.h"
6382 #include <lber.h>
6383 EOF
6384 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6385 { (eval echo configure:6386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6386 ac_err=`grep -v '^ *+' conftest.out`
6387 if test -z "$ac_err"; then
6388   rm -rf conftest*
6389   eval "ac_cv_header_$ac_safe=yes"
6390 else
6391   echo "$ac_err" >&5
6392   echo "configure: failed program was:" >&5
6393   cat conftest.$ac_ext >&5
6394   rm -rf conftest*
6395   eval "ac_cv_header_$ac_safe=no"
6396 fi
6397 rm -f conftest*
6398 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6399   echo "$ac_t""yes" 1>&6
6400   :
6401 else
6402   echo "$ac_t""no" 1>&6
6403 with_ldap=no
6404 fi
6405  }
6406 if test "$with_ldap" != "no"; then
6407   
6408 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
6409 echo "configure:6410: checking for ldap_search in -lldap" >&5
6410 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
6411
6412 xe_check_libs=" -lldap "
6413 cat > conftest.$ac_ext <<EOF
6414 #line 6415 "configure"
6415 #include "confdefs.h"
6416 /* Override any gcc2 internal prototype to avoid an error.  */
6417 /* We use char because int might match the return type of a gcc2
6418     builtin and then its argument prototype would still apply.  */
6419 char ldap_search();
6420
6421 int main() {
6422 ldap_search()
6423 ; return 0; }
6424 EOF
6425 if { (eval echo configure:6426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6426   rm -rf conftest*
6427   eval "ac_cv_lib_$ac_lib_var=yes"
6428 else
6429   echo "configure: failed program was:" >&5
6430   cat conftest.$ac_ext >&5
6431   rm -rf conftest*
6432   eval "ac_cv_lib_$ac_lib_var=no"
6433 fi
6434 rm -f conftest*
6435 xe_check_libs=""
6436
6437 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6438   echo "$ac_t""yes" 1>&6
6439   with_ldap_nolber=yes
6440 else
6441   echo "$ac_t""no" 1>&6
6442 with_ldap_nolber=no
6443 fi
6444
6445
6446   test "$with_ldap_nolber" = "no" && { 
6447 xe_msg_checking="for ldap_open in -lldap"
6448 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
6449 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
6450 echo "configure:6451: checking "$xe_msg_checking"" >&5
6451 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
6452
6453 xe_check_libs=" -lldap -llber"
6454 cat > conftest.$ac_ext <<EOF
6455 #line 6456 "configure"
6456 #include "confdefs.h"
6457 /* Override any gcc2 internal prototype to avoid an error.  */
6458 /* We use char because int might match the return type of a gcc2
6459     builtin and then its argument prototype would still apply.  */
6460 char ldap_open();
6461
6462 int main() {
6463 ldap_open()
6464 ; return 0; }
6465 EOF
6466 if { (eval echo configure:6467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6467   rm -rf conftest*
6468   eval "ac_cv_lib_$ac_lib_var=yes"
6469 else
6470   echo "configure: failed program was:" >&5
6471   cat conftest.$ac_ext >&5
6472   rm -rf conftest*
6473   eval "ac_cv_lib_$ac_lib_var=no"
6474 fi
6475 rm -f conftest*
6476 xe_check_libs=""
6477
6478 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6479   echo "$ac_t""yes" 1>&6
6480   with_ldap_lber=yes
6481 else
6482   echo "$ac_t""no" 1>&6
6483 with_ldap_lber=no
6484 fi
6485
6486  }
6487   test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" \) && with_ldap=yes
6488 fi
6489 if test "$with_ldap" = "yes"; then
6490   { test "$extra_verbose" = "yes" && cat << \EOF
6491     Defining HAVE_LDAP
6492 EOF
6493 cat >> confdefs.h <<\EOF
6494 #define HAVE_LDAP 1
6495 EOF
6496 }
6497
6498   extra_objs="$extra_objs eldap.o" &&  if test "$extra_verbose" = "yes"; then
6499    echo "    xemacs will be linked with \"eldap.o\""
6500  fi
6501   if test "$with_ldap_nolber" = "yes" ; then
6502     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6503   else
6504     LIBS="-llber $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-llber\" to \$LIBS"; fi
6505     LIBS="-lldap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lldap\" to \$LIBS"; fi
6506   fi
6507   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
6508 do
6509 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6510 echo "configure:6511: checking for $ac_func" >&5
6511
6512 cat > conftest.$ac_ext <<EOF
6513 #line 6514 "configure"
6514 #include "confdefs.h"
6515 /* System header to define __stub macros and hopefully few prototypes,
6516     which can conflict with char $ac_func(); below.  */
6517 #include <assert.h>
6518 /* Override any gcc2 internal prototype to avoid an error.  */
6519 /* We use char because int might match the return type of a gcc2
6520     builtin and then its argument prototype would still apply.  */
6521 char $ac_func();
6522
6523 int main() {
6524
6525 /* The GNU C library defines this for functions which it implements
6526     to always fail with ENOSYS.  Some functions are actually named
6527     something starting with __ and the normal name is an alias.  */
6528 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6529 choke me
6530 #else
6531 $ac_func();
6532 #endif
6533
6534 ; return 0; }
6535 EOF
6536 if { (eval echo configure:6537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6537   rm -rf conftest*
6538   eval "ac_cv_func_$ac_func=yes"
6539 else
6540   echo "configure: failed program was:" >&5
6541   cat conftest.$ac_ext >&5
6542   rm -rf conftest*
6543   eval "ac_cv_func_$ac_func=no"
6544 fi
6545 rm -f conftest*
6546
6547 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6548   echo "$ac_t""yes" 1>&6
6549     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6550   { test "$extra_verbose" = "yes" && cat << EOF
6551     Defining $ac_tr_func
6552 EOF
6553 cat >> confdefs.h <<EOF
6554 #define $ac_tr_func 1
6555 EOF
6556 }
6557  
6558 else
6559   echo "$ac_t""no" 1>&6
6560 fi
6561 done
6562
6563 fi
6564
6565
6566 if test "$window_system" != "none"; then
6567   echo "checking for graphics libraries" 1>&6
6568 echo "configure:6569: checking for graphics libraries" >&5
6569
6570     xpm_problem=""
6571   if test -z "$with_xpm"; then
6572     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
6573 echo "configure:6574: checking for Xpm - no older than 3.4f" >&5
6574     xe_check_libs=-lXpm
6575     cat > conftest.$ac_ext <<EOF
6576 #line 6577 "configure"
6577 #include "confdefs.h"
6578 #include <X11/xpm.h>
6579     int main(int c, char **v) {
6580     return c == 1 ? 0 :
6581       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
6582       XpmIncludeVersion < 30406 ? 2 : 0 ;}
6583 EOF
6584 if { (eval echo configure:6585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
6585 then
6586   ./conftest dummy_arg; xpm_status=$?;
6587       if test "$xpm_status" = "0"; then
6588         with_xpm=yes;
6589       else
6590         with_xpm=no;
6591         if test "$xpm_status" = "1"; then
6592           xpm_problem="Xpm library version and header file version don't match!"
6593         elif test "$xpm_status" = "2"; then
6594           xpm_problem="Xpm library version is too old!"
6595         else
6596           xpm_problem="Internal xpm detection logic error!"
6597         fi
6598         echo "
6599 *** WARNING *** $xpm_problem
6600   I'm not touching that with a 10-foot pole!
6601   If you really want to use the installed version of Xpm, rerun
6602   configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
6603     fi
6604 else
6605   conftest_rc="$?"
6606   echo "configure: failed program was:" >&5
6607   cat conftest.$ac_ext >&5
6608   rm -fr conftest*
6609   with_xpm=no
6610 fi
6611 rm -fr conftest*
6612     xe_check_libs=
6613     echo "$ac_t""$with_xpm" 1>&6
6614   fi
6615   if test "$with_xpm" = "yes"; then
6616     { test "$extra_verbose" = "yes" && cat << \EOF
6617     Defining HAVE_XPM
6618 EOF
6619 cat >> confdefs.h <<\EOF
6620 #define HAVE_XPM 1
6621 EOF
6622 }
6623
6624     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
6625     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
6626 echo "configure:6627: checking for \"FOR_MSW\" xpm" >&5
6627     xe_check_libs=-lXpm
6628     cat > conftest.$ac_ext <<EOF
6629 #line 6630 "configure"
6630 #include "confdefs.h"
6631
6632 int main() {
6633 XpmCreatePixmapFromData()
6634 ; return 0; }
6635 EOF
6636 if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6637   rm -rf conftest*
6638   xpm_for_msw=no
6639 else
6640   echo "configure: failed program was:" >&5
6641   cat conftest.$ac_ext >&5
6642   rm -rf conftest*
6643   xpm_for_msw=yes
6644 fi
6645 rm -f conftest*
6646     xe_check_libs=
6647     echo "$ac_t""$xpm_for_msw" 1>&6
6648     if test "$xpm_for_msw" = "yes"; then
6649       { test "$extra_verbose" = "yes" && cat << \EOF
6650     Defining FOR_MSW
6651 EOF
6652 cat >> confdefs.h <<\EOF
6653 #define FOR_MSW 1
6654 EOF
6655 }
6656
6657     fi
6658   fi
6659
6660     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
6661 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
6662 echo "configure:6663: checking for compface.h" >&5
6663
6664 cat > conftest.$ac_ext <<EOF
6665 #line 6666 "configure"
6666 #include "confdefs.h"
6667 #include <compface.h>
6668 EOF
6669 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6670 { (eval echo configure:6671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6671 ac_err=`grep -v '^ *+' conftest.out`
6672 if test -z "$ac_err"; then
6673   rm -rf conftest*
6674   eval "ac_cv_header_$ac_safe=yes"
6675 else
6676   echo "$ac_err" >&5
6677   echo "configure: failed program was:" >&5
6678   cat conftest.$ac_ext >&5
6679   rm -rf conftest*
6680   eval "ac_cv_header_$ac_safe=no"
6681 fi
6682 rm -f conftest*
6683 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6684   echo "$ac_t""yes" 1>&6
6685   :
6686 else
6687   echo "$ac_t""no" 1>&6
6688 with_xface=no
6689 fi
6690  }
6691   test -z "$with_xface" && { 
6692 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
6693 echo "configure:6694: checking for UnGenFace in -lcompface" >&5
6694 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
6695
6696 xe_check_libs=" -lcompface "
6697 cat > conftest.$ac_ext <<EOF
6698 #line 6699 "configure"
6699 #include "confdefs.h"
6700 /* Override any gcc2 internal prototype to avoid an error.  */
6701 /* We use char because int might match the return type of a gcc2
6702     builtin and then its argument prototype would still apply.  */
6703 char UnGenFace();
6704
6705 int main() {
6706 UnGenFace()
6707 ; return 0; }
6708 EOF
6709 if { (eval echo configure:6710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6710   rm -rf conftest*
6711   eval "ac_cv_lib_$ac_lib_var=yes"
6712 else
6713   echo "configure: failed program was:" >&5
6714   cat conftest.$ac_ext >&5
6715   rm -rf conftest*
6716   eval "ac_cv_lib_$ac_lib_var=no"
6717 fi
6718 rm -f conftest*
6719 xe_check_libs=""
6720
6721 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6722   echo "$ac_t""yes" 1>&6
6723   : 
6724 else
6725   echo "$ac_t""no" 1>&6
6726 with_xface=no
6727 fi
6728
6729  }
6730   test -z "$with_xface" && with_xface=yes
6731   if test "$with_xface" = "yes"; then
6732     { test "$extra_verbose" = "yes" && cat << \EOF
6733     Defining HAVE_XFACE
6734 EOF
6735 cat >> confdefs.h <<\EOF
6736 #define HAVE_XFACE 1
6737 EOF
6738 }
6739
6740     libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
6741   fi
6742
6743         if test "$with_gif" != "no"; then
6744     with_gif="yes"
6745     { test "$extra_verbose" = "yes" && cat << \EOF
6746     Defining HAVE_GIF
6747 EOF
6748 cat >> confdefs.h <<\EOF
6749 #define HAVE_GIF 1
6750 EOF
6751 }
6752
6753     extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
6754    echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
6755  fi
6756   fi
6757
6758       if test "$with_png $with_tiff" != "no no"; then
6759     
6760 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
6761 echo "configure:6762: checking for inflate in -lc" >&5
6762 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
6763
6764 xe_check_libs=" -lc "
6765 cat > conftest.$ac_ext <<EOF
6766 #line 6767 "configure"
6767 #include "confdefs.h"
6768 /* Override any gcc2 internal prototype to avoid an error.  */
6769 /* We use char because int might match the return type of a gcc2
6770     builtin and then its argument prototype would still apply.  */
6771 char inflate();
6772
6773 int main() {
6774 inflate()
6775 ; return 0; }
6776 EOF
6777 if { (eval echo configure:6778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6778   rm -rf conftest*
6779   eval "ac_cv_lib_$ac_lib_var=yes"
6780 else
6781   echo "configure: failed program was:" >&5
6782   cat conftest.$ac_ext >&5
6783   rm -rf conftest*
6784   eval "ac_cv_lib_$ac_lib_var=no"
6785 fi
6786 rm -f conftest*
6787 xe_check_libs=""
6788
6789 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6790   echo "$ac_t""yes" 1>&6
6791   :
6792 else
6793   echo "$ac_t""no" 1>&6
6794
6795 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
6796 echo "configure:6797: checking for inflate in -lz" >&5
6797 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
6798
6799 xe_check_libs=" -lz "
6800 cat > conftest.$ac_ext <<EOF
6801 #line 6802 "configure"
6802 #include "confdefs.h"
6803 /* Override any gcc2 internal prototype to avoid an error.  */
6804 /* We use char because int might match the return type of a gcc2
6805     builtin and then its argument prototype would still apply.  */
6806 char inflate();
6807
6808 int main() {
6809 inflate()
6810 ; return 0; }
6811 EOF
6812 if { (eval echo configure:6813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6813   rm -rf conftest*
6814   eval "ac_cv_lib_$ac_lib_var=yes"
6815 else
6816   echo "configure: failed program was:" >&5
6817   cat conftest.$ac_ext >&5
6818   rm -rf conftest*
6819   eval "ac_cv_lib_$ac_lib_var=no"
6820 fi
6821 rm -f conftest*
6822 xe_check_libs=""
6823
6824 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6825   echo "$ac_t""yes" 1>&6
6826   libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
6827 else
6828   echo "$ac_t""no" 1>&6
6829
6830 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
6831 echo "configure:6832: checking for inflate in -lgz" >&5
6832 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
6833
6834 xe_check_libs=" -lgz "
6835 cat > conftest.$ac_ext <<EOF
6836 #line 6837 "configure"
6837 #include "confdefs.h"
6838 /* Override any gcc2 internal prototype to avoid an error.  */
6839 /* We use char because int might match the return type of a gcc2
6840     builtin and then its argument prototype would still apply.  */
6841 char inflate();
6842
6843 int main() {
6844 inflate()
6845 ; return 0; }
6846 EOF
6847 if { (eval echo configure:6848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6848   rm -rf conftest*
6849   eval "ac_cv_lib_$ac_lib_var=yes"
6850 else
6851   echo "configure: failed program was:" >&5
6852   cat conftest.$ac_ext >&5
6853   rm -rf conftest*
6854   eval "ac_cv_lib_$ac_lib_var=no"
6855 fi
6856 rm -f conftest*
6857 xe_check_libs=""
6858
6859 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6860   echo "$ac_t""yes" 1>&6
6861   libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
6862 else
6863   echo "$ac_t""no" 1>&6
6864 fi
6865
6866
6867 fi
6868
6869
6870 fi
6871
6872
6873   fi
6874
6875     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
6876 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
6877 echo "configure:6878: checking for jpeglib.h" >&5
6878
6879 cat > conftest.$ac_ext <<EOF
6880 #line 6881 "configure"
6881 #include "confdefs.h"
6882 #include <jpeglib.h>
6883 EOF
6884 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6885 { (eval echo configure:6886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6886 ac_err=`grep -v '^ *+' conftest.out`
6887 if test -z "$ac_err"; then
6888   rm -rf conftest*
6889   eval "ac_cv_header_$ac_safe=yes"
6890 else
6891   echo "$ac_err" >&5
6892   echo "configure: failed program was:" >&5
6893   cat conftest.$ac_ext >&5
6894   rm -rf conftest*
6895   eval "ac_cv_header_$ac_safe=no"
6896 fi
6897 rm -f conftest*
6898 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6899   echo "$ac_t""yes" 1>&6
6900   :
6901 else
6902   echo "$ac_t""no" 1>&6
6903 with_jpeg=no
6904 fi
6905  }
6906   test -z "$with_jpeg" && { 
6907 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
6908 echo "configure:6909: checking for jpeg_destroy_decompress in -ljpeg" >&5
6909 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
6910
6911 xe_check_libs=" -ljpeg "
6912 cat > conftest.$ac_ext <<EOF
6913 #line 6914 "configure"
6914 #include "confdefs.h"
6915 /* Override any gcc2 internal prototype to avoid an error.  */
6916 /* We use char because int might match the return type of a gcc2
6917     builtin and then its argument prototype would still apply.  */
6918 char jpeg_destroy_decompress();
6919
6920 int main() {
6921 jpeg_destroy_decompress()
6922 ; return 0; }
6923 EOF
6924 if { (eval echo configure:6925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6925   rm -rf conftest*
6926   eval "ac_cv_lib_$ac_lib_var=yes"
6927 else
6928   echo "configure: failed program was:" >&5
6929   cat conftest.$ac_ext >&5
6930   rm -rf conftest*
6931   eval "ac_cv_lib_$ac_lib_var=no"
6932 fi
6933 rm -f conftest*
6934 xe_check_libs=""
6935
6936 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
6937   echo "$ac_t""yes" 1>&6
6938   :
6939 else
6940   echo "$ac_t""no" 1>&6
6941 with_jpeg=no
6942 fi
6943
6944  }
6945   test -z "$with_jpeg" && with_jpeg=yes
6946   if test "$with_jpeg" = "yes"; then
6947     { test "$extra_verbose" = "yes" && cat << \EOF
6948     Defining HAVE_JPEG
6949 EOF
6950 cat >> confdefs.h <<\EOF
6951 #define HAVE_JPEG 1
6952 EOF
6953 }
6954
6955     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
6956   fi
6957
6958     png_problem=""
6959   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
6960 echo "configure:6961: checking for pow" >&5
6961
6962 cat > conftest.$ac_ext <<EOF
6963 #line 6964 "configure"
6964 #include "confdefs.h"
6965 /* System header to define __stub macros and hopefully few prototypes,
6966     which can conflict with char pow(); below.  */
6967 #include <assert.h>
6968 /* Override any gcc2 internal prototype to avoid an error.  */
6969 /* We use char because int might match the return type of a gcc2
6970     builtin and then its argument prototype would still apply.  */
6971 char pow();
6972
6973 int main() {
6974
6975 /* The GNU C library defines this for functions which it implements
6976     to always fail with ENOSYS.  Some functions are actually named
6977     something starting with __ and the normal name is an alias.  */
6978 #if defined (__stub_pow) || defined (__stub___pow)
6979 choke me
6980 #else
6981 pow();
6982 #endif
6983
6984 ; return 0; }
6985 EOF
6986 if { (eval echo configure:6987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6987   rm -rf conftest*
6988   eval "ac_cv_func_pow=yes"
6989 else
6990   echo "configure: failed program was:" >&5
6991   cat conftest.$ac_ext >&5
6992   rm -rf conftest*
6993   eval "ac_cv_func_pow=no"
6994 fi
6995 rm -f conftest*
6996
6997 if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then
6998   echo "$ac_t""yes" 1>&6
6999   :
7000 else
7001   echo "$ac_t""no" 1>&6
7002 with_png=no
7003 fi
7004  }
7005   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
7006 echo $ac_n "checking for png.h""... $ac_c" 1>&6
7007 echo "configure:7008: checking for png.h" >&5
7008
7009 cat > conftest.$ac_ext <<EOF
7010 #line 7011 "configure"
7011 #include "confdefs.h"
7012 #include <png.h>
7013 EOF
7014 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7015 { (eval echo configure:7016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7016 ac_err=`grep -v '^ *+' conftest.out`
7017 if test -z "$ac_err"; then
7018   rm -rf conftest*
7019   eval "ac_cv_header_$ac_safe=yes"
7020 else
7021   echo "$ac_err" >&5
7022   echo "configure: failed program was:" >&5
7023   cat conftest.$ac_ext >&5
7024   rm -rf conftest*
7025   eval "ac_cv_header_$ac_safe=no"
7026 fi
7027 rm -f conftest*
7028 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7029   echo "$ac_t""yes" 1>&6
7030   :
7031 else
7032   echo "$ac_t""no" 1>&6
7033 with_png=no
7034 fi
7035  }
7036   test -z "$with_png" && { 
7037 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
7038 echo "configure:7039: checking for png_read_image in -lpng" >&5
7039 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
7040
7041 xe_check_libs=" -lpng "
7042 cat > conftest.$ac_ext <<EOF
7043 #line 7044 "configure"
7044 #include "confdefs.h"
7045 /* Override any gcc2 internal prototype to avoid an error.  */
7046 /* We use char because int might match the return type of a gcc2
7047     builtin and then its argument prototype would still apply.  */
7048 char png_read_image();
7049
7050 int main() {
7051 png_read_image()
7052 ; return 0; }
7053 EOF
7054 if { (eval echo configure:7055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7055   rm -rf conftest*
7056   eval "ac_cv_lib_$ac_lib_var=yes"
7057 else
7058   echo "configure: failed program was:" >&5
7059   cat conftest.$ac_ext >&5
7060   rm -rf conftest*
7061   eval "ac_cv_lib_$ac_lib_var=no"
7062 fi
7063 rm -f conftest*
7064 xe_check_libs=""
7065
7066 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7067   echo "$ac_t""yes" 1>&6
7068   :
7069 else
7070   echo "$ac_t""no" 1>&6
7071 with_png=no
7072 fi
7073
7074  }
7075   if test -z "$with_png"; then
7076     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
7077 echo "configure:7078: checking for workable png version information" >&5
7078     xe_check_libs="-lpng -lz"
7079     cat > conftest.$ac_ext <<EOF
7080 #line 7081 "configure"
7081 #include "confdefs.h"
7082 #include <png.h>
7083     int main(int c, char **v) {
7084     if (c == 1) return 0;
7085     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
7086     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
7087 EOF
7088 if { (eval echo configure:7089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
7089 then
7090   ./conftest dummy_arg; png_status=$?;
7091       if test "$png_status" = "0"; then
7092         with_png=yes;
7093       else
7094         with_png=no;
7095         if test "$png_status" = "1"; then
7096           png_problem="PNG library version and header file don't match!"
7097         elif test "$png_status" = "2"; then
7098           png_problem="PNG library version too old (pre 1.0.2)!"
7099         fi
7100         echo "
7101 *** WARNING *** $png_problem
7102   I'm not touching that with a 10-foot pole!
7103   If you really want to use the installed version of libPNG, rerun
7104   configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
7105     fi
7106 else
7107   conftest_rc="$?"
7108   echo "configure: failed program was:" >&5
7109   cat conftest.$ac_ext >&5
7110   rm -fr conftest*
7111   with_png=no
7112 fi
7113 rm -fr conftest*
7114     xe_check_libs=
7115     echo "$ac_t""$with_png" 1>&6
7116   fi
7117   if test "$with_png" = "yes"; then
7118     { test "$extra_verbose" = "yes" && cat << \EOF
7119     Defining HAVE_PNG
7120 EOF
7121 cat >> confdefs.h <<\EOF
7122 #define HAVE_PNG 1
7123 EOF
7124 }
7125
7126     libs_x="-lpng $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lpng\" to \$libs_x"; fi
7127   fi
7128
7129     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
7130 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
7131 echo "configure:7132: checking for tiffio.h" >&5
7132
7133 cat > conftest.$ac_ext <<EOF
7134 #line 7135 "configure"
7135 #include "confdefs.h"
7136 #include <tiffio.h>
7137 EOF
7138 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7139 { (eval echo configure:7140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7140 ac_err=`grep -v '^ *+' conftest.out`
7141 if test -z "$ac_err"; then
7142   rm -rf conftest*
7143   eval "ac_cv_header_$ac_safe=yes"
7144 else
7145   echo "$ac_err" >&5
7146   echo "configure: failed program was:" >&5
7147   cat conftest.$ac_ext >&5
7148   rm -rf conftest*
7149   eval "ac_cv_header_$ac_safe=no"
7150 fi
7151 rm -f conftest*
7152 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7153   echo "$ac_t""yes" 1>&6
7154   :
7155 else
7156   echo "$ac_t""no" 1>&6
7157 with_tiff=no
7158 fi
7159  }
7160   test -z "$with_tiff" && { 
7161 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
7162 echo "configure:7163: checking for TIFFClientOpen in -ltiff" >&5
7163 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
7164
7165 xe_check_libs=" -ltiff "
7166 cat > conftest.$ac_ext <<EOF
7167 #line 7168 "configure"
7168 #include "confdefs.h"
7169 /* Override any gcc2 internal prototype to avoid an error.  */
7170 /* We use char because int might match the return type of a gcc2
7171     builtin and then its argument prototype would still apply.  */
7172 char TIFFClientOpen();
7173
7174 int main() {
7175 TIFFClientOpen()
7176 ; return 0; }
7177 EOF
7178 if { (eval echo configure:7179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7179   rm -rf conftest*
7180   eval "ac_cv_lib_$ac_lib_var=yes"
7181 else
7182   echo "configure: failed program was:" >&5
7183   cat conftest.$ac_ext >&5
7184   rm -rf conftest*
7185   eval "ac_cv_lib_$ac_lib_var=no"
7186 fi
7187 rm -f conftest*
7188 xe_check_libs=""
7189
7190 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7191   echo "$ac_t""yes" 1>&6
7192   :
7193 else
7194   echo "$ac_t""no" 1>&6
7195 with_tiff=no
7196 fi
7197
7198  }
7199   test -z "$with_tiff" && with_tiff=yes
7200   if test "$with_tiff" = "yes"; then
7201     { test "$extra_verbose" = "yes" && cat << \EOF
7202     Defining HAVE_TIFF
7203 EOF
7204 cat >> confdefs.h <<\EOF
7205 #define HAVE_TIFF 1
7206 EOF
7207 }
7208
7209     libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
7210   fi
7211 fi
7212
7213
7214 if test "$with_x11" = "yes"; then
7215
7216   echo "checking for X11 graphics libraries" 1>&6
7217 echo "configure:7218: checking for X11 graphics libraries" >&5
7218
7219     
7220 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
7221 echo "configure:7222: checking for XawScrollbarSetThumb in -lXaw" >&5
7222 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
7223
7224 xe_check_libs=" -lXaw "
7225 cat > conftest.$ac_ext <<EOF
7226 #line 7227 "configure"
7227 #include "confdefs.h"
7228 /* Override any gcc2 internal prototype to avoid an error.  */
7229 /* We use char because int might match the return type of a gcc2
7230     builtin and then its argument prototype would still apply.  */
7231 char XawScrollbarSetThumb();
7232
7233 int main() {
7234 XawScrollbarSetThumb()
7235 ; return 0; }
7236 EOF
7237 if { (eval echo configure:7238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7238   rm -rf conftest*
7239   eval "ac_cv_lib_$ac_lib_var=yes"
7240 else
7241   echo "configure: failed program was:" >&5
7242   cat conftest.$ac_ext >&5
7243   rm -rf conftest*
7244   eval "ac_cv_lib_$ac_lib_var=no"
7245 fi
7246 rm -f conftest*
7247 xe_check_libs=""
7248
7249 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7250   echo "$ac_t""yes" 1>&6
7251   have_xaw=yes
7252 else
7253   echo "$ac_t""no" 1>&6
7254 have_xaw=no
7255 fi
7256
7257
7258                     
7259     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
7260 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
7261 echo "configure:7262: checking for Xm/Xm.h" >&5
7262
7263 cat > conftest.$ac_ext <<EOF
7264 #line 7265 "configure"
7265 #include "confdefs.h"
7266 #include <Xm/Xm.h>
7267 EOF
7268 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7269 { (eval echo configure:7270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7270 ac_err=`grep -v '^ *+' conftest.out`
7271 if test -z "$ac_err"; then
7272   rm -rf conftest*
7273   eval "ac_cv_header_$ac_safe=yes"
7274 else
7275   echo "$ac_err" >&5
7276   echo "configure: failed program was:" >&5
7277   cat conftest.$ac_ext >&5
7278   rm -rf conftest*
7279   eval "ac_cv_header_$ac_safe=no"
7280 fi
7281 rm -f conftest*
7282 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7283   echo "$ac_t""yes" 1>&6
7284   
7285 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
7286 echo "configure:7287: checking for XmStringFree in -lXm" >&5
7287 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
7288
7289 xe_check_libs=" -lXm "
7290 cat > conftest.$ac_ext <<EOF
7291 #line 7292 "configure"
7292 #include "confdefs.h"
7293 /* Override any gcc2 internal prototype to avoid an error.  */
7294 /* We use char because int might match the return type of a gcc2
7295     builtin and then its argument prototype would still apply.  */
7296 char XmStringFree();
7297
7298 int main() {
7299 XmStringFree()
7300 ; return 0; }
7301 EOF
7302 if { (eval echo configure:7303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7303   rm -rf conftest*
7304   eval "ac_cv_lib_$ac_lib_var=yes"
7305 else
7306   echo "configure: failed program was:" >&5
7307   cat conftest.$ac_ext >&5
7308   rm -rf conftest*
7309   eval "ac_cv_lib_$ac_lib_var=no"
7310 fi
7311 rm -f conftest*
7312 xe_check_libs=""
7313
7314 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7315   echo "$ac_t""yes" 1>&6
7316   have_motif=yes
7317 else
7318   echo "$ac_t""no" 1>&6
7319 have_motif=no
7320 fi
7321
7322
7323 else
7324   echo "$ac_t""no" 1>&6
7325 have_motif=no
7326 fi
7327
7328
7329   if test "$have_motif" = "yes"; then
7330         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
7331 echo "configure:7332: checking for Lesstif" >&5
7332     cat > conftest.$ac_ext <<EOF
7333 #line 7334 "configure"
7334 #include "confdefs.h"
7335 #include <Xm/Xm.h>
7336 #ifdef LESSTIF_VERSION
7337 yes
7338 #endif
7339
7340 EOF
7341 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7342   egrep "yes" >/dev/null 2>&1; then
7343   rm -rf conftest*
7344   have_lesstif=yes
7345 else
7346   rm -rf conftest*
7347   have_lesstif=no
7348 fi
7349 rm -f conftest*
7350
7351   echo "$ac_t""$have_lesstif" 1>&6
7352   fi
7353
7354 fi 
7355
7356 case "$with_menubars" in "" | "yes" | "athena" | "athena3d" )
7357   with_menubars="lucid" ;;
7358 esac
7359 case "$with_dialogs" in "" | "yes" | "lucid" )
7360   if   test "$have_motif" = "yes"; then with_dialogs="motif"
7361   elif test "$have_xaw"   = "yes"; then with_dialogs="athena"
7362   else with_dialogs=no
7363   fi ;;
7364 esac
7365 case "$with_scrollbars" in "" | "yes" )
7366   with_scrollbars="lucid" ;;
7367 esac
7368
7369 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars"
7370
7371 case "$all_widgets" in *athena* )
7372   { test "$extra_verbose" = "yes" && cat << \EOF
7373     Defining LWLIB_USES_ATHENA
7374 EOF
7375 cat >> confdefs.h <<\EOF
7376 #define LWLIB_USES_ATHENA 1
7377 EOF
7378 }
7379
7380   { test "$extra_verbose" = "yes" && cat << \EOF
7381     Defining NEED_ATHENA
7382 EOF
7383 cat >> confdefs.h <<\EOF
7384 #define NEED_ATHENA 1
7385 EOF
7386 }
7387
7388   lwlib_objs="$lwlib_objs lwlib-Xaw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xaw.o\" to \$lwlib_objs"; fi
7389   libs_x="-lXaw $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXaw\" to \$libs_x"; fi ;;
7390 esac
7391
7392 case "$all_widgets" in *motif* )
7393   { test "$extra_verbose" = "yes" && cat << \EOF
7394     Defining LWLIB_USES_MOTIF
7395 EOF
7396 cat >> confdefs.h <<\EOF
7397 #define LWLIB_USES_MOTIF 1
7398 EOF
7399 }
7400
7401   { test "$extra_verbose" = "yes" && cat << \EOF
7402     Defining NEED_MOTIF
7403 EOF
7404 cat >> confdefs.h <<\EOF
7405 #define NEED_MOTIF 1
7406 EOF
7407 }
7408
7409   lwlib_objs="$lwlib_objs lwlib-Xm.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xm.o\" to \$lwlib_objs"; fi
7410   need_motif=yes ;;
7411 esac
7412
7413 test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7414 test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
7415 test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
7416 case "$all_widgets" in *lucid* )
7417   { test "$extra_verbose" = "yes" && cat << \EOF
7418     Defining NEED_LUCID
7419 EOF
7420 cat >> confdefs.h <<\EOF
7421 #define NEED_LUCID 1
7422 EOF
7423 }
7424
7425   lwlib_objs="$lwlib_objs lwlib-Xlw.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lwlib-Xlw.o\" to \$lwlib_objs"; fi ;;
7426 esac
7427
7428
7429
7430 case "$with_scrollbars" in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7431     Defining LWLIB_SCROLLBARS_ATHENA
7432 EOF
7433 cat >> confdefs.h <<\EOF
7434 #define LWLIB_SCROLLBARS_ATHENA 1
7435 EOF
7436 }
7437 ;; esac
7438 case "$with_dialogs"    in athena* ) { test "$extra_verbose" = "yes" && cat << \EOF
7439     Defining LWLIB_DIALOGS_ATHENA
7440 EOF
7441 cat >> confdefs.h <<\EOF
7442 #define LWLIB_DIALOGS_ATHENA 1
7443 EOF
7444 }
7445    ;; esac
7446 test "$with_scrollbars" = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7447     Defining LWLIB_SCROLLBARS_ATHENA3D
7448 EOF
7449 cat >> confdefs.h <<\EOF
7450 #define LWLIB_SCROLLBARS_ATHENA3D 1
7451 EOF
7452 }
7453
7454 test "$with_dialogs"    = "athena3d" && { test "$extra_verbose" = "yes" && cat << \EOF
7455     Defining LWLIB_DIALOGS_ATHENA3D
7456 EOF
7457 cat >> confdefs.h <<\EOF
7458 #define LWLIB_DIALOGS_ATHENA3D 1
7459 EOF
7460 }
7461
7462
7463 test "$with_menubars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7464     Defining HAVE_MENUBARS
7465 EOF
7466 cat >> confdefs.h <<\EOF
7467 #define HAVE_MENUBARS 1
7468 EOF
7469 }
7470
7471 test "$with_scrollbars" != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7472     Defining HAVE_SCROLLBARS
7473 EOF
7474 cat >> confdefs.h <<\EOF
7475 #define HAVE_SCROLLBARS 1
7476 EOF
7477 }
7478
7479 test "$with_dialogs"    != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7480     Defining HAVE_DIALOGS
7481 EOF
7482 cat >> confdefs.h <<\EOF
7483 #define HAVE_DIALOGS 1
7484 EOF
7485 }
7486
7487 test "$with_toolbars"   != "no"    && { test "$extra_verbose" = "yes" && cat << \EOF
7488     Defining HAVE_TOOLBARS
7489 EOF
7490 cat >> confdefs.h <<\EOF
7491 #define HAVE_TOOLBARS 1
7492 EOF
7493 }
7494
7495
7496 test "$with_menubars"   = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7497     Defining LWLIB_MENUBARS_LUCID
7498 EOF
7499 cat >> confdefs.h <<\EOF
7500 #define LWLIB_MENUBARS_LUCID 1
7501 EOF
7502 }
7503
7504 test "$with_scrollbars" = "lucid"  && { test "$extra_verbose" = "yes" && cat << \EOF
7505     Defining LWLIB_SCROLLBARS_LUCID
7506 EOF
7507 cat >> confdefs.h <<\EOF
7508 #define LWLIB_SCROLLBARS_LUCID 1
7509 EOF
7510 }
7511
7512
7513 test "$with_menubars"   = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7514     Defining LWLIB_MENUBARS_MOTIF
7515 EOF
7516 cat >> confdefs.h <<\EOF
7517 #define LWLIB_MENUBARS_MOTIF 1
7518 EOF
7519 }
7520
7521 test "$with_scrollbars" = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7522     Defining LWLIB_SCROLLBARS_MOTIF
7523 EOF
7524 cat >> confdefs.h <<\EOF
7525 #define LWLIB_SCROLLBARS_MOTIF 1
7526 EOF
7527 }
7528
7529 test "$with_dialogs"    = "motif"  && { test "$extra_verbose" = "yes" && cat << \EOF
7530     Defining LWLIB_DIALOGS_MOTIF
7531 EOF
7532 cat >> confdefs.h <<\EOF
7533 #define LWLIB_DIALOGS_MOTIF 1
7534 EOF
7535 }
7536
7537
7538 test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar.o" &&  if test "$extra_verbose" = "yes"; then
7539    echo "    xemacs will be linked with \"menubar.o\""
7540  fi
7541 test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar.o" &&  if test "$extra_verbose" = "yes"; then
7542    echo "    xemacs will be linked with \"scrollbar.o\""
7543  fi
7544 test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if test "$extra_verbose" = "yes"; then
7545    echo "    xemacs will be linked with \"dialog.o\""
7546  fi
7547 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
7548    echo "    xemacs will be linked with \"toolbar.o\""
7549  fi
7550
7551 if test "$with_x11" = "yes"; then
7552   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
7553    echo "    xemacs will be linked with \"menubar-x.o\""
7554  fi
7555   test "$with_scrollbars" != "no"      && extra_objs="$extra_objs scrollbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7556    echo "    xemacs will be linked with \"scrollbar-x.o\""
7557  fi
7558   test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog-x.o" &&  if test "$extra_verbose" = "yes"; then
7559    echo "    xemacs will be linked with \"dialog-x.o\""
7560  fi
7561   test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar-x.o" &&  if test "$extra_verbose" = "yes"; then
7562    echo "    xemacs will be linked with \"toolbar-x.o\""
7563  fi
7564   test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui-x.o" &&  if test "$extra_verbose" = "yes"; then
7565    echo "    xemacs will be linked with \"gui-x.o\""
7566  fi
7567 else
7568   if test \( "$with_sound" = "nas" \) -o \( "$with_sound" = "both" \); then
7569     echo "Attempt to Build NAS sound without X"
7570     echo "Please remove NAS configuration or build with X"
7571     exit 1
7572   fi
7573 fi
7574
7575
7576 test -z "$with_mule" && with_mule=no
7577 test -z "$with_file_coding" && with_file_coding=no
7578
7579
7580 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
7581   { test "$extra_verbose" = "yes" && cat << \EOF
7582     Defining FILE_CODING
7583 EOF
7584 cat >> confdefs.h <<\EOF
7585 #define FILE_CODING 1
7586 EOF
7587 }
7588
7589   extra_objs="$extra_objs file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7590    echo "    xemacs will be linked with \"file-coding.o\""
7591  fi
7592 fi
7593
7594 if test "$with_mule" = "yes" ; then
7595   echo "checking for Mule-related features" 1>&6
7596 echo "configure:7597: checking for Mule-related features" >&5
7597   { test "$extra_verbose" = "yes" && cat << \EOF
7598     Defining MULE
7599 EOF
7600 cat >> confdefs.h <<\EOF
7601 #define MULE 1
7602 EOF
7603 }
7604
7605   { test "$extra_verbose" = "yes" && cat << \EOF
7606     Defining FILE_CODING
7607 EOF
7608 cat >> confdefs.h <<\EOF
7609 #define FILE_CODING 1
7610 EOF
7611 }
7612
7613   extra_objs="$extra_objs mule.o mule-ccl.o mule-charset.o file-coding.o" &&  if test "$extra_verbose" = "yes"; then
7614    echo "    xemacs will be linked with \"mule.o mule-ccl.o mule-charset.o file-coding.o\""
7615  fi
7616
7617     for ac_hdr in libintl.h
7618 do
7619 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7620 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7621 echo "configure:7622: checking for $ac_hdr" >&5
7622
7623 cat > conftest.$ac_ext <<EOF
7624 #line 7625 "configure"
7625 #include "confdefs.h"
7626 #include <$ac_hdr>
7627 EOF
7628 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7629 { (eval echo configure:7630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7630 ac_err=`grep -v '^ *+' conftest.out`
7631 if test -z "$ac_err"; then
7632   rm -rf conftest*
7633   eval "ac_cv_header_$ac_safe=yes"
7634 else
7635   echo "$ac_err" >&5
7636   echo "configure: failed program was:" >&5
7637   cat conftest.$ac_ext >&5
7638   rm -rf conftest*
7639   eval "ac_cv_header_$ac_safe=no"
7640 fi
7641 rm -f conftest*
7642 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7643   echo "$ac_t""yes" 1>&6
7644     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7645   { test "$extra_verbose" = "yes" && cat << EOF
7646     Defining $ac_tr_hdr
7647 EOF
7648 cat >> confdefs.h <<EOF
7649 #define $ac_tr_hdr 1
7650 EOF
7651 }
7652  
7653 else
7654   echo "$ac_t""no" 1>&6
7655 fi
7656 done
7657
7658   
7659 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
7660 echo "configure:7661: checking for strerror in -lintl" >&5
7661 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
7662
7663 xe_check_libs=" -lintl "
7664 cat > conftest.$ac_ext <<EOF
7665 #line 7666 "configure"
7666 #include "confdefs.h"
7667 /* Override any gcc2 internal prototype to avoid an error.  */
7668 /* We use char because int might match the return type of a gcc2
7669     builtin and then its argument prototype would still apply.  */
7670 char strerror();
7671
7672 int main() {
7673 strerror()
7674 ; return 0; }
7675 EOF
7676 if { (eval echo configure:7677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7677   rm -rf conftest*
7678   eval "ac_cv_lib_$ac_lib_var=yes"
7679 else
7680   echo "configure: failed program was:" >&5
7681   cat conftest.$ac_ext >&5
7682   rm -rf conftest*
7683   eval "ac_cv_lib_$ac_lib_var=no"
7684 fi
7685 rm -f conftest*
7686 xe_check_libs=""
7687
7688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7689   echo "$ac_t""yes" 1>&6
7690     ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7691     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7692   { test "$extra_verbose" = "yes" && cat << EOF
7693     Defining $ac_tr_lib
7694 EOF
7695 cat >> confdefs.h <<EOF
7696 #define $ac_tr_lib 1
7697 EOF
7698 }
7699
7700   LIBS="-lintl $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lintl\" to \$LIBS"; fi
7701
7702 else
7703   echo "$ac_t""no" 1>&6
7704 fi
7705
7706
7707
7708   echo "checking for Mule input methods" 1>&6
7709 echo "configure:7710: checking for Mule input methods" >&5
7710         case "$with_xim" in "" | "yes" )
7711     echo "checking for XIM" 1>&6
7712 echo "configure:7713: checking for XIM" >&5
7713     
7714 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
7715 echo "configure:7716: checking for XOpenIM in -lX11" >&5
7716 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
7717
7718 xe_check_libs=" -lX11 "
7719 cat > conftest.$ac_ext <<EOF
7720 #line 7721 "configure"
7721 #include "confdefs.h"
7722 /* Override any gcc2 internal prototype to avoid an error.  */
7723 /* We use char because int might match the return type of a gcc2
7724     builtin and then its argument prototype would still apply.  */
7725 char XOpenIM();
7726
7727 int main() {
7728 XOpenIM()
7729 ; return 0; }
7730 EOF
7731 if { (eval echo configure:7732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7732   rm -rf conftest*
7733   eval "ac_cv_lib_$ac_lib_var=yes"
7734 else
7735   echo "configure: failed program was:" >&5
7736   cat conftest.$ac_ext >&5
7737   rm -rf conftest*
7738   eval "ac_cv_lib_$ac_lib_var=no"
7739 fi
7740 rm -f conftest*
7741 xe_check_libs=""
7742
7743 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7744   echo "$ac_t""yes" 1>&6
7745   with_xim=xlib
7746 else
7747   echo "$ac_t""no" 1>&6
7748 with_xim=no
7749 fi
7750
7751
7752         if test "$have_motif $have_lesstif" = "yes no"; then
7753       
7754 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
7755 echo "configure:7756: checking for XmImMbLookupString in -lXm" >&5
7756 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
7757
7758 xe_check_libs=" -lXm "
7759 cat > conftest.$ac_ext <<EOF
7760 #line 7761 "configure"
7761 #include "confdefs.h"
7762 /* Override any gcc2 internal prototype to avoid an error.  */
7763 /* We use char because int might match the return type of a gcc2
7764     builtin and then its argument prototype would still apply.  */
7765 char XmImMbLookupString();
7766
7767 int main() {
7768 XmImMbLookupString()
7769 ; return 0; }
7770 EOF
7771 if { (eval echo configure:7772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7772   rm -rf conftest*
7773   eval "ac_cv_lib_$ac_lib_var=yes"
7774 else
7775   echo "configure: failed program was:" >&5
7776   cat conftest.$ac_ext >&5
7777   rm -rf conftest*
7778   eval "ac_cv_lib_$ac_lib_var=no"
7779 fi
7780 rm -f conftest*
7781 xe_check_libs=""
7782
7783 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7784   echo "$ac_t""yes" 1>&6
7785   with_xim=motif
7786 else
7787   echo "$ac_t""no" 1>&6
7788 fi
7789
7790
7791     fi ;;
7792   esac
7793   if test "$with_xim" != "no"; then
7794     { test "$extra_verbose" = "yes" && cat << \EOF
7795     Defining HAVE_XIM
7796 EOF
7797 cat >> confdefs.h <<\EOF
7798 #define HAVE_XIM 1
7799 EOF
7800 }
7801
7802     if test "$with_xim" = "xlib"; then
7803       { test "$extra_verbose" = "yes" && cat << \EOF
7804     Defining XIM_XLIB
7805 EOF
7806 cat >> confdefs.h <<\EOF
7807 #define XIM_XLIB 1
7808 EOF
7809 }
7810
7811       extra_objs="$extra_objs input-method-xlib.o" &&  if test "$extra_verbose" = "yes"; then
7812    echo "    xemacs will be linked with \"input-method-xlib.o\""
7813  fi
7814     fi
7815     if test "$with_xim" = "motif"; then
7816       { test "$extra_verbose" = "yes" && cat << \EOF
7817     Defining XIM_MOTIF
7818 EOF
7819 cat >> confdefs.h <<\EOF
7820 #define XIM_MOTIF 1
7821 EOF
7822 }
7823
7824       need_motif=yes
7825       extra_objs="$extra_objs input-method-motif.o" &&  if test "$extra_verbose" = "yes"; then
7826    echo "    xemacs will be linked with \"input-method-motif.o\""
7827  fi
7828     fi
7829     if test "$with_xim" = "motif"; then
7830       with_xfs=no
7831     fi
7832   fi
7833
7834     if test "$with_xfs" = "yes" ; then
7835     echo "checking for XFontSet" 1>&6
7836 echo "configure:7837: checking for XFontSet" >&5
7837     
7838 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
7839 echo "configure:7840: checking for XmbDrawString in -lX11" >&5
7840 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
7841
7842 xe_check_libs=" -lX11 "
7843 cat > conftest.$ac_ext <<EOF
7844 #line 7845 "configure"
7845 #include "confdefs.h"
7846 /* Override any gcc2 internal prototype to avoid an error.  */
7847 /* We use char because int might match the return type of a gcc2
7848     builtin and then its argument prototype would still apply.  */
7849 char XmbDrawString();
7850
7851 int main() {
7852 XmbDrawString()
7853 ; return 0; }
7854 EOF
7855 if { (eval echo configure:7856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7856   rm -rf conftest*
7857   eval "ac_cv_lib_$ac_lib_var=yes"
7858 else
7859   echo "configure: failed program was:" >&5
7860   cat conftest.$ac_ext >&5
7861   rm -rf conftest*
7862   eval "ac_cv_lib_$ac_lib_var=no"
7863 fi
7864 rm -f conftest*
7865 xe_check_libs=""
7866
7867 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
7868   echo "$ac_t""yes" 1>&6
7869   :
7870 else
7871   echo "$ac_t""no" 1>&6
7872 with_xfs=no
7873 fi
7874
7875
7876     if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
7877       { test "$extra_verbose" = "yes" && cat << \EOF
7878     Defining USE_XFONTSET
7879 EOF
7880 cat >> confdefs.h <<\EOF
7881 #define USE_XFONTSET 1
7882 EOF
7883 }
7884
7885       if test "$with_xim" = "no" ; then
7886         extra_objs="$extra_objs input-method-xfs.o" &&  if test "$extra_verbose" = "yes"; then
7887    echo "    xemacs will be linked with \"input-method-xfs.o\""
7888  fi
7889       fi
7890     fi
7891   fi 
7892     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
7893   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
7894 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
7895 echo "configure:7896: checking for wnn/jllib.h" >&5
7896
7897 cat > conftest.$ac_ext <<EOF
7898 #line 7899 "configure"
7899 #include "confdefs.h"
7900 #include <wnn/jllib.h>
7901 EOF
7902 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7903 { (eval echo configure:7904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7904 ac_err=`grep -v '^ *+' conftest.out`
7905 if test -z "$ac_err"; then
7906   rm -rf conftest*
7907   eval "ac_cv_header_$ac_safe=yes"
7908 else
7909   echo "$ac_err" >&5
7910   echo "configure: failed program was:" >&5
7911   cat conftest.$ac_ext >&5
7912   rm -rf conftest*
7913   eval "ac_cv_header_$ac_safe=no"
7914 fi
7915 rm -f conftest*
7916 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7917   echo "$ac_t""yes" 1>&6
7918   :
7919 else
7920   echo "$ac_t""no" 1>&6
7921 with_wnn=no
7922 fi
7923  }
7924     if test "$with_wnn" != "no"; then
7925     for ac_func in crypt
7926 do
7927 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7928 echo "configure:7929: checking for $ac_func" >&5
7929
7930 cat > conftest.$ac_ext <<EOF
7931 #line 7932 "configure"
7932 #include "confdefs.h"
7933 /* System header to define __stub macros and hopefully few prototypes,
7934     which can conflict with char $ac_func(); below.  */
7935 #include <assert.h>
7936 /* Override any gcc2 internal prototype to avoid an error.  */
7937 /* We use char because int might match the return type of a gcc2
7938     builtin and then its argument prototype would still apply.  */
7939 char $ac_func();
7940
7941 int main() {
7942
7943 /* The GNU C library defines this for functions which it implements
7944     to always fail with ENOSYS.  Some functions are actually named
7945     something starting with __ and the normal name is an alias.  */
7946 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7947 choke me
7948 #else
7949 $ac_func();
7950 #endif
7951
7952 ; return 0; }
7953 EOF
7954 if { (eval echo configure:7955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7955   rm -rf conftest*
7956   eval "ac_cv_func_$ac_func=yes"
7957 else
7958   echo "configure: failed program was:" >&5
7959   cat conftest.$ac_ext >&5
7960   rm -rf conftest*
7961   eval "ac_cv_func_$ac_func=no"
7962 fi
7963 rm -f conftest*
7964
7965 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7966   echo "$ac_t""yes" 1>&6
7967     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7968   { test "$extra_verbose" = "yes" && cat << EOF
7969     Defining $ac_tr_func
7970 EOF
7971 cat >> confdefs.h <<EOF
7972 #define $ac_tr_func 1
7973 EOF
7974 }
7975  
7976 else
7977   echo "$ac_t""no" 1>&6
7978 fi
7979 done
7980
7981     test "$ac_cv_func_crypt" != "yes" && { 
7982 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7983 echo "configure:7984: checking for crypt in -lcrypt" >&5
7984 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7985
7986 xe_check_libs=" -lcrypt "
7987 cat > conftest.$ac_ext <<EOF
7988 #line 7989 "configure"
7989 #include "confdefs.h"
7990 /* Override any gcc2 internal prototype to avoid an error.  */
7991 /* We use char because int might match the return type of a gcc2
7992     builtin and then its argument prototype would still apply.  */
7993 char crypt();
7994
7995 int main() {
7996 crypt()
7997 ; return 0; }
7998 EOF
7999 if { (eval echo configure:8000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8000   rm -rf conftest*
8001   eval "ac_cv_lib_$ac_lib_var=yes"
8002 else
8003   echo "configure: failed program was:" >&5
8004   cat conftest.$ac_ext >&5
8005   rm -rf conftest*
8006   eval "ac_cv_lib_$ac_lib_var=no"
8007 fi
8008 rm -f conftest*
8009 xe_check_libs=""
8010
8011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8012   echo "$ac_t""yes" 1>&6
8013     ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8014     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8015   { test "$extra_verbose" = "yes" && cat << EOF
8016     Defining $ac_tr_lib
8017 EOF
8018 cat >> confdefs.h <<EOF
8019 #define $ac_tr_lib 1
8020 EOF
8021 }
8022
8023   LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
8024
8025 else
8026   echo "$ac_t""no" 1>&6
8027 fi
8028
8029  }
8030   fi
8031     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
8032     
8033 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
8034 echo "configure:8035: checking for jl_dic_list_e in -lwnn" >&5
8035 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8036
8037 xe_check_libs=" -lwnn "
8038 cat > conftest.$ac_ext <<EOF
8039 #line 8040 "configure"
8040 #include "confdefs.h"
8041 /* Override any gcc2 internal prototype to avoid an error.  */
8042 /* We use char because int might match the return type of a gcc2
8043     builtin and then its argument prototype would still apply.  */
8044 char jl_dic_list_e();
8045
8046 int main() {
8047 jl_dic_list_e()
8048 ; return 0; }
8049 EOF
8050 if { (eval echo configure:8051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8051   rm -rf conftest*
8052   eval "ac_cv_lib_$ac_lib_var=yes"
8053 else
8054   echo "configure: failed program was:" >&5
8055   cat conftest.$ac_ext >&5
8056   rm -rf conftest*
8057   eval "ac_cv_lib_$ac_lib_var=no"
8058 fi
8059 rm -f conftest*
8060 xe_check_libs=""
8061
8062 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8063   echo "$ac_t""yes" 1>&6
8064   libwnn=wnn
8065 else
8066   echo "$ac_t""no" 1>&6
8067 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
8068 echo "configure:8069: checking for jl_dic_list_e in -lwnn4" >&5
8069 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8070
8071 xe_check_libs=" -lwnn4 "
8072 cat > conftest.$ac_ext <<EOF
8073 #line 8074 "configure"
8074 #include "confdefs.h"
8075 /* Override any gcc2 internal prototype to avoid an error.  */
8076 /* We use char because int might match the return type of a gcc2
8077     builtin and then its argument prototype would still apply.  */
8078 char jl_dic_list_e();
8079
8080 int main() {
8081 jl_dic_list_e()
8082 ; return 0; }
8083 EOF
8084 if { (eval echo configure:8085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8085   rm -rf conftest*
8086   eval "ac_cv_lib_$ac_lib_var=yes"
8087 else
8088   echo "configure: failed program was:" >&5
8089   cat conftest.$ac_ext >&5
8090   rm -rf conftest*
8091   eval "ac_cv_lib_$ac_lib_var=no"
8092 fi
8093 rm -f conftest*
8094 xe_check_libs=""
8095
8096 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8097   echo "$ac_t""yes" 1>&6
8098   libwnn=wnn4
8099 else
8100   echo "$ac_t""no" 1>&6
8101 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
8102 echo "configure:8103: checking for jl_dic_list_e in -lwnn6" >&5
8103 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
8104
8105 xe_check_libs=" -lwnn6 "
8106 cat > conftest.$ac_ext <<EOF
8107 #line 8108 "configure"
8108 #include "confdefs.h"
8109 /* Override any gcc2 internal prototype to avoid an error.  */
8110 /* We use char because int might match the return type of a gcc2
8111     builtin and then its argument prototype would still apply.  */
8112 char jl_dic_list_e();
8113
8114 int main() {
8115 jl_dic_list_e()
8116 ; return 0; }
8117 EOF
8118 if { (eval echo configure:8119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8119   rm -rf conftest*
8120   eval "ac_cv_lib_$ac_lib_var=yes"
8121 else
8122   echo "configure: failed program was:" >&5
8123   cat conftest.$ac_ext >&5
8124   rm -rf conftest*
8125   eval "ac_cv_lib_$ac_lib_var=no"
8126 fi
8127 rm -f conftest*
8128 xe_check_libs=""
8129
8130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8131   echo "$ac_t""yes" 1>&6
8132   libwnn=wnn6
8133 else
8134   echo "$ac_t""no" 1>&6
8135 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
8136 echo "configure:8137: checking for dic_list_e in -lwnn6_fromsrc" >&5
8137 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
8138
8139 xe_check_libs=" -lwnn6_fromsrc "
8140 cat > conftest.$ac_ext <<EOF
8141 #line 8142 "configure"
8142 #include "confdefs.h"
8143 /* Override any gcc2 internal prototype to avoid an error.  */
8144 /* We use char because int might match the return type of a gcc2
8145     builtin and then its argument prototype would still apply.  */
8146 char dic_list_e();
8147
8148 int main() {
8149 dic_list_e()
8150 ; return 0; }
8151 EOF
8152 if { (eval echo configure:8153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8153   rm -rf conftest*
8154   eval "ac_cv_lib_$ac_lib_var=yes"
8155 else
8156   echo "configure: failed program was:" >&5
8157   cat conftest.$ac_ext >&5
8158   rm -rf conftest*
8159   eval "ac_cv_lib_$ac_lib_var=no"
8160 fi
8161 rm -f conftest*
8162 xe_check_libs=""
8163
8164 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8165   echo "$ac_t""yes" 1>&6
8166   libwnn=wnn6_fromsrc
8167 else
8168   echo "$ac_t""no" 1>&6
8169 with_wnn=no
8170 fi
8171
8172
8173 fi
8174
8175
8176 fi
8177
8178
8179 fi
8180
8181
8182   fi
8183   test -z "$with_wnn" && with_wnn=yes
8184   if test "$with_wnn" = "yes"; then
8185     { test "$extra_verbose" = "yes" && cat << \EOF
8186     Defining HAVE_WNN
8187 EOF
8188 cat >> confdefs.h <<\EOF
8189 #define HAVE_WNN 1
8190 EOF
8191 }
8192
8193     libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
8194     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
8195    echo "    xemacs will be linked with \"mule-wnnfns.o\""
8196  fi
8197     if test "$with_wnn6" != "no"; then
8198       
8199 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
8200 echo "configure:8201: checking for jl_fi_dic_list in -l$libwnn" >&5
8201 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
8202
8203 xe_check_libs=" -l$libwnn "
8204 cat > conftest.$ac_ext <<EOF
8205 #line 8206 "configure"
8206 #include "confdefs.h"
8207 /* Override any gcc2 internal prototype to avoid an error.  */
8208 /* We use char because int might match the return type of a gcc2
8209     builtin and then its argument prototype would still apply.  */
8210 char jl_fi_dic_list();
8211
8212 int main() {
8213 jl_fi_dic_list()
8214 ; return 0; }
8215 EOF
8216 if { (eval echo configure:8217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8217   rm -rf conftest*
8218   eval "ac_cv_lib_$ac_lib_var=yes"
8219 else
8220   echo "configure: failed program was:" >&5
8221   cat conftest.$ac_ext >&5
8222   rm -rf conftest*
8223   eval "ac_cv_lib_$ac_lib_var=no"
8224 fi
8225 rm -f conftest*
8226 xe_check_libs=""
8227
8228 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8229   echo "$ac_t""yes" 1>&6
8230   with_wnn6=yes
8231 else
8232   echo "$ac_t""no" 1>&6
8233 fi
8234
8235
8236       test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
8237     Defining WNN6
8238 EOF
8239 cat >> confdefs.h <<\EOF
8240 #define WNN6 1
8241 EOF
8242 }
8243
8244     fi
8245   fi
8246
8247     canna_includes_found=no
8248   if test "$with_canna" != "no"; then
8249     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8250 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8251 echo "configure:8252: checking for canna/jrkanji.h" >&5
8252
8253 cat > conftest.$ac_ext <<EOF
8254 #line 8255 "configure"
8255 #include "confdefs.h"
8256 #include <canna/jrkanji.h>
8257 EOF
8258 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8259 { (eval echo configure:8260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8260 ac_err=`grep -v '^ *+' conftest.out`
8261 if test -z "$ac_err"; then
8262   rm -rf conftest*
8263   eval "ac_cv_header_$ac_safe=yes"
8264 else
8265   echo "$ac_err" >&5
8266   echo "configure: failed program was:" >&5
8267   cat conftest.$ac_ext >&5
8268   rm -rf conftest*
8269   eval "ac_cv_header_$ac_safe=no"
8270 fi
8271 rm -f conftest*
8272 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8273   echo "$ac_t""yes" 1>&6
8274   canna_includes_found=yes
8275 else
8276   echo "$ac_t""no" 1>&6
8277 fi
8278
8279   fi
8280   if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
8281       -d "/usr/local/canna/include"; then
8282     save_c_switch_site="$c_switch_site"
8283     c_switch_site="$c_switch_site -I/usr/local/canna/include"
8284     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
8285 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
8286 echo "configure:8287: checking for canna/jrkanji.h" >&5
8287
8288 cat > conftest.$ac_ext <<EOF
8289 #line 8290 "configure"
8290 #include "confdefs.h"
8291 #include <canna/jrkanji.h>
8292 EOF
8293 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8294 { (eval echo configure:8295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8295 ac_err=`grep -v '^ *+' conftest.out`
8296 if test -z "$ac_err"; then
8297   rm -rf conftest*
8298   eval "ac_cv_header_$ac_safe=yes"
8299 else
8300   echo "$ac_err" >&5
8301   echo "configure: failed program was:" >&5
8302   cat conftest.$ac_ext >&5
8303   rm -rf conftest*
8304   eval "ac_cv_header_$ac_safe=no"
8305 fi
8306 rm -f conftest*
8307 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8308   echo "$ac_t""yes" 1>&6
8309   canna_includes_found=yes
8310 else
8311   echo "$ac_t""no" 1>&6
8312 fi
8313
8314     if test "$canna_includes_found" != "yes"; then
8315       c_switch_site="$save_c_switch_site"
8316       with_canna="no"
8317     fi
8318   fi
8319
8320   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
8321 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
8322 echo "configure:8323: checking for canna/RK.h" >&5
8323
8324 cat > conftest.$ac_ext <<EOF
8325 #line 8326 "configure"
8326 #include "confdefs.h"
8327 #include <canna/RK.h>
8328 EOF
8329 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8330 { (eval echo configure:8331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8331 ac_err=`grep -v '^ *+' conftest.out`
8332 if test -z "$ac_err"; then
8333   rm -rf conftest*
8334   eval "ac_cv_header_$ac_safe=yes"
8335 else
8336   echo "$ac_err" >&5
8337   echo "configure: failed program was:" >&5
8338   cat conftest.$ac_ext >&5
8339   rm -rf conftest*
8340   eval "ac_cv_header_$ac_safe=no"
8341 fi
8342 rm -f conftest*
8343 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8344   echo "$ac_t""yes" 1>&6
8345   :
8346 else
8347   echo "$ac_t""no" 1>&6
8348 with_canna=no
8349 fi
8350  }
8351   test -z "$with_canna" && { 
8352 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
8353 echo "configure:8354: checking for RkBgnBun in -lRKC" >&5
8354 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
8355
8356 xe_check_libs=" -lRKC "
8357 cat > conftest.$ac_ext <<EOF
8358 #line 8359 "configure"
8359 #include "confdefs.h"
8360 /* Override any gcc2 internal prototype to avoid an error.  */
8361 /* We use char because int might match the return type of a gcc2
8362     builtin and then its argument prototype would still apply.  */
8363 char RkBgnBun();
8364
8365 int main() {
8366 RkBgnBun()
8367 ; return 0; }
8368 EOF
8369 if { (eval echo configure:8370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8370   rm -rf conftest*
8371   eval "ac_cv_lib_$ac_lib_var=yes"
8372 else
8373   echo "configure: failed program was:" >&5
8374   cat conftest.$ac_ext >&5
8375   rm -rf conftest*
8376   eval "ac_cv_lib_$ac_lib_var=no"
8377 fi
8378 rm -f conftest*
8379 xe_check_libs=""
8380
8381 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8382   echo "$ac_t""yes" 1>&6
8383   :
8384 else
8385   echo "$ac_t""no" 1>&6
8386 with_canna=no
8387 fi
8388
8389  }
8390   test -z "$with_canna" && { 
8391 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
8392 echo "configure:8393: checking for jrKanjiControl in -lcanna" >&5
8393 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
8394
8395 xe_check_libs=" -lcanna "
8396 cat > conftest.$ac_ext <<EOF
8397 #line 8398 "configure"
8398 #include "confdefs.h"
8399 /* Override any gcc2 internal prototype to avoid an error.  */
8400 /* We use char because int might match the return type of a gcc2
8401     builtin and then its argument prototype would still apply.  */
8402 char jrKanjiControl();
8403
8404 int main() {
8405 jrKanjiControl()
8406 ; return 0; }
8407 EOF
8408 if { (eval echo configure:8409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8409   rm -rf conftest*
8410   eval "ac_cv_lib_$ac_lib_var=yes"
8411 else
8412   echo "configure: failed program was:" >&5
8413   cat conftest.$ac_ext >&5
8414   rm -rf conftest*
8415   eval "ac_cv_lib_$ac_lib_var=no"
8416 fi
8417 rm -f conftest*
8418 xe_check_libs=""
8419
8420 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8421   echo "$ac_t""yes" 1>&6
8422   :
8423 else
8424   echo "$ac_t""no" 1>&6
8425 with_canna=no
8426 fi
8427
8428  }
8429   test -z "$with_canna" && with_canna=yes
8430   if test "$with_canna" = "yes"; then
8431     { test "$extra_verbose" = "yes" && cat << \EOF
8432     Defining HAVE_CANNA
8433 EOF
8434 cat >> confdefs.h <<\EOF
8435 #define HAVE_CANNA 1
8436 EOF
8437 }
8438
8439     libs_x="-lcanna -lRKC $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcanna -lRKC\" to \$libs_x"; fi
8440     extra_objs="$extra_objs mule-canna.o" &&  if test "$extra_verbose" = "yes"; then
8441    echo "    xemacs will be linked with \"mule-canna.o\""
8442  fi
8443   fi
8444
8445 else   for feature in xim canna wnn; do
8446     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
8447       echo "configure: warning: "--with-${feature} ignored:  Not valid without Mule support"" 1>&2
8448     fi
8449     eval "with_${feature}=no"
8450   done
8451 fi 
8452
8453 if test "$need_motif" = "yes" ; then
8454   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
8455     
8456 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
8457 echo "configure:8458: checking for layout_object_getvalue in -li18n" >&5
8458 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
8459
8460 xe_check_libs=" -li18n "
8461 cat > conftest.$ac_ext <<EOF
8462 #line 8463 "configure"
8463 #include "confdefs.h"
8464 /* Override any gcc2 internal prototype to avoid an error.  */
8465 /* We use char because int might match the return type of a gcc2
8466     builtin and then its argument prototype would still apply.  */
8467 char layout_object_getvalue();
8468
8469 int main() {
8470 layout_object_getvalue()
8471 ; return 0; }
8472 EOF
8473 if { (eval echo configure:8474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8474   rm -rf conftest*
8475   eval "ac_cv_lib_$ac_lib_var=yes"
8476 else
8477   echo "configure: failed program was:" >&5
8478   cat conftest.$ac_ext >&5
8479   rm -rf conftest*
8480   eval "ac_cv_lib_$ac_lib_var=no"
8481 fi
8482 rm -f conftest*
8483 xe_check_libs=""
8484
8485 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8486   echo "$ac_t""yes" 1>&6
8487   libs_x="-li18n $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-li18n\" to \$libs_x"; fi
8488 else
8489   echo "$ac_t""no" 1>&6
8490 fi
8491
8492
8493   
8494 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
8495     ld_switch_site=`echo   '' $ld_switch_site   | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8496   ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"`
8497   
8498         runpath="" runpath_dirs=""
8499   if test -n "$LD_RUN_PATH"; then
8500     runpath="$LD_RUN_PATH"
8501   elif test "$GCC" = "yes"; then
8502         ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
8503     echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c
8504     xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
8505     for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
8506       case "$arg" in P,* | -L* | -R* )
8507         for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
8508           {
8509 xe_runpath_dir="$dir"
8510   test "$xe_runpath_dir" != "/lib"     -a \
8511         "$xe_runpath_dir" != "/usr/lib" -a \
8512         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8513   eval "$xe_add_unique_runpath_dir"
8514 }
8515         done ;;
8516       esac
8517     done
8518     ld_switch_run="$ld_switch_run_save"
8519     rm -f conftest*
8520   else
8521         for arg in $ld_switch_site $ld_switch_x_site; do
8522       case "$arg" in -L*) {
8523 xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`
8524   test "$xe_runpath_dir" != "/lib"     -a \
8525         "$xe_runpath_dir" != "/usr/lib" -a \
8526         -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \
8527   eval "$xe_add_unique_runpath_dir"
8528 };; esac
8529     done
8530         if test "$opsys $need_motif" = "sol2 yes"; then
8531       xe_runpath_dir="/opt/SUNWdt/lib";
8532       eval "$xe_add_unique_runpath_dir";
8533     fi
8534   fi 
8535   if test -n "$runpath"; then
8536     ld_switch_run="${dash_r}${runpath}"
8537     
8538 if test "$GCC" = "yes"; then
8539   set x $ld_switch_run; shift; ld_switch_run=""
8540   while test -n "$1"; do
8541     case $1 in
8542       -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
8543       -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
8544       -Xlinker* ) ;;
8545       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
8546     esac
8547     shift
8548   done
8549 fi
8550     test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
8551   fi
8552 fi
8553
8554 fi
8555
8556 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
8557 do
8558 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8559 echo "configure:8560: checking for $ac_func" >&5
8560
8561 cat > conftest.$ac_ext <<EOF
8562 #line 8563 "configure"
8563 #include "confdefs.h"
8564 /* System header to define __stub macros and hopefully few prototypes,
8565     which can conflict with char $ac_func(); below.  */
8566 #include <assert.h>
8567 /* Override any gcc2 internal prototype to avoid an error.  */
8568 /* We use char because int might match the return type of a gcc2
8569     builtin and then its argument prototype would still apply.  */
8570 char $ac_func();
8571
8572 int main() {
8573
8574 /* The GNU C library defines this for functions which it implements
8575     to always fail with ENOSYS.  Some functions are actually named
8576     something starting with __ and the normal name is an alias.  */
8577 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8578 choke me
8579 #else
8580 $ac_func();
8581 #endif
8582
8583 ; return 0; }
8584 EOF
8585 if { (eval echo configure:8586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8586   rm -rf conftest*
8587   eval "ac_cv_func_$ac_func=yes"
8588 else
8589   echo "configure: failed program was:" >&5
8590   cat conftest.$ac_ext >&5
8591   rm -rf conftest*
8592   eval "ac_cv_func_$ac_func=no"
8593 fi
8594 rm -f conftest*
8595
8596 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8597   echo "$ac_t""yes" 1>&6
8598     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8599   { test "$extra_verbose" = "yes" && cat << EOF
8600     Defining $ac_tr_func
8601 EOF
8602 cat >> confdefs.h <<EOF
8603 #define $ac_tr_func 1
8604 EOF
8605 }
8606  
8607 else
8608   echo "$ac_t""no" 1>&6
8609 fi
8610 done
8611
8612
8613
8614 case "$opsys" in
8615   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8616    echo "    xemacs will be linked with \"realpath.o\""
8617  fi ;;
8618   * )
8619     case "$canonical" in
8620       *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8621    echo "    xemacs will be linked with \"realpath.o\""
8622  fi ;;
8623       * ) for ac_func in realpath
8624 do
8625 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8626 echo "configure:8627: checking for $ac_func" >&5
8627
8628 cat > conftest.$ac_ext <<EOF
8629 #line 8630 "configure"
8630 #include "confdefs.h"
8631 /* System header to define __stub macros and hopefully few prototypes,
8632     which can conflict with char $ac_func(); below.  */
8633 #include <assert.h>
8634 /* Override any gcc2 internal prototype to avoid an error.  */
8635 /* We use char because int might match the return type of a gcc2
8636     builtin and then its argument prototype would still apply.  */
8637 char $ac_func();
8638
8639 int main() {
8640
8641 /* The GNU C library defines this for functions which it implements
8642     to always fail with ENOSYS.  Some functions are actually named
8643     something starting with __ and the normal name is an alias.  */
8644 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8645 choke me
8646 #else
8647 $ac_func();
8648 #endif
8649
8650 ; return 0; }
8651 EOF
8652 if { (eval echo configure:8653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8653   rm -rf conftest*
8654   eval "ac_cv_func_$ac_func=yes"
8655 else
8656   echo "configure: failed program was:" >&5
8657   cat conftest.$ac_ext >&5
8658   rm -rf conftest*
8659   eval "ac_cv_func_$ac_func=no"
8660 fi
8661 rm -f conftest*
8662
8663 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8664   echo "$ac_t""yes" 1>&6
8665     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8666   { test "$extra_verbose" = "yes" && cat << EOF
8667     Defining $ac_tr_func
8668 EOF
8669 cat >> confdefs.h <<EOF
8670 #define $ac_tr_func 1
8671 EOF
8672 }
8673  
8674 else
8675   echo "$ac_t""no" 1>&6
8676 fi
8677 done
8678
8679           test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
8680    echo "    xemacs will be linked with \"realpath.o\""
8681  fi ;;
8682     esac ;;
8683 esac
8684
8685 for ac_func in getloadavg
8686 do
8687 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8688 echo "configure:8689: checking for $ac_func" >&5
8689
8690 cat > conftest.$ac_ext <<EOF
8691 #line 8692 "configure"
8692 #include "confdefs.h"
8693 /* System header to define __stub macros and hopefully few prototypes,
8694     which can conflict with char $ac_func(); below.  */
8695 #include <assert.h>
8696 /* Override any gcc2 internal prototype to avoid an error.  */
8697 /* We use char because int might match the return type of a gcc2
8698     builtin and then its argument prototype would still apply.  */
8699 char $ac_func();
8700
8701 int main() {
8702
8703 /* The GNU C library defines this for functions which it implements
8704     to always fail with ENOSYS.  Some functions are actually named
8705     something starting with __ and the normal name is an alias.  */
8706 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8707 choke me
8708 #else
8709 $ac_func();
8710 #endif
8711
8712 ; return 0; }
8713 EOF
8714 if { (eval echo configure:8715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8715   rm -rf conftest*
8716   eval "ac_cv_func_$ac_func=yes"
8717 else
8718   echo "configure: failed program was:" >&5
8719   cat conftest.$ac_ext >&5
8720   rm -rf conftest*
8721   eval "ac_cv_func_$ac_func=no"
8722 fi
8723 rm -f conftest*
8724
8725 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8726   echo "$ac_t""yes" 1>&6
8727     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8728   { test "$extra_verbose" = "yes" && cat << EOF
8729     Defining $ac_tr_func
8730 EOF
8731 cat >> confdefs.h <<EOF
8732 #define $ac_tr_func 1
8733 EOF
8734 }
8735  
8736 else
8737   echo "$ac_t""no" 1>&6
8738 fi
8739 done
8740
8741
8742 if test "$ac_cv_func_getloadavg" != "yes"
8743 then
8744   extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
8745    echo "    xemacs will be linked with \"getloadavg.o\""
8746  fi
8747
8748     
8749 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
8750 echo "configure:8751: checking for kstat_open in -lkstat" >&5
8751 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
8752
8753 xe_check_libs=" -lkstat "
8754 cat > conftest.$ac_ext <<EOF
8755 #line 8756 "configure"
8756 #include "confdefs.h"
8757 /* Override any gcc2 internal prototype to avoid an error.  */
8758 /* We use char because int might match the return type of a gcc2
8759     builtin and then its argument prototype would still apply.  */
8760 char kstat_open();
8761
8762 int main() {
8763 kstat_open()
8764 ; return 0; }
8765 EOF
8766 if { (eval echo configure:8767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8767   rm -rf conftest*
8768   eval "ac_cv_lib_$ac_lib_var=yes"
8769 else
8770   echo "configure: failed program was:" >&5
8771   cat conftest.$ac_ext >&5
8772   rm -rf conftest*
8773   eval "ac_cv_lib_$ac_lib_var=no"
8774 fi
8775 rm -f conftest*
8776 xe_check_libs=""
8777
8778 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8779   echo "$ac_t""yes" 1>&6
8780     ac_tr_lib=HAVE_LIB`echo kstat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8781     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8782   { test "$extra_verbose" = "yes" && cat << EOF
8783     Defining $ac_tr_lib
8784 EOF
8785 cat >> confdefs.h <<EOF
8786 #define $ac_tr_lib 1
8787 EOF
8788 }
8789
8790   LIBS="-lkstat $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkstat\" to \$LIBS"; fi
8791
8792 else
8793   echo "$ac_t""no" 1>&6
8794 fi
8795
8796
8797
8798     
8799 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
8800 echo "configure:8801: checking for kvm_read in -lkvm" >&5
8801 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
8802
8803 xe_check_libs=" -lkvm "
8804 cat > conftest.$ac_ext <<EOF
8805 #line 8806 "configure"
8806 #include "confdefs.h"
8807 /* Override any gcc2 internal prototype to avoid an error.  */
8808 /* We use char because int might match the return type of a gcc2
8809     builtin and then its argument prototype would still apply.  */
8810 char kvm_read();
8811
8812 int main() {
8813 kvm_read()
8814 ; return 0; }
8815 EOF
8816 if { (eval echo configure:8817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8817   rm -rf conftest*
8818   eval "ac_cv_lib_$ac_lib_var=yes"
8819 else
8820   echo "configure: failed program was:" >&5
8821   cat conftest.$ac_ext >&5
8822   rm -rf conftest*
8823   eval "ac_cv_lib_$ac_lib_var=no"
8824 fi
8825 rm -f conftest*
8826 xe_check_libs=""
8827
8828 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
8829   echo "$ac_t""yes" 1>&6
8830     ac_tr_lib=HAVE_LIB`echo kvm | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8831     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8832   { test "$extra_verbose" = "yes" && cat << EOF
8833     Defining $ac_tr_lib
8834 EOF
8835 cat >> confdefs.h <<EOF
8836 #define $ac_tr_lib 1
8837 EOF
8838 }
8839
8840   LIBS="-lkvm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lkvm\" to \$LIBS"; fi
8841
8842 else
8843   echo "$ac_t""no" 1>&6
8844 fi
8845
8846
8847 fi
8848
8849 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
8850 echo "configure:8851: checking whether netdb declares h_errno" >&5
8851 cat > conftest.$ac_ext <<EOF
8852 #line 8853 "configure"
8853 #include "confdefs.h"
8854 #include <netdb.h>
8855 int main() {
8856 return h_errno;
8857 ; return 0; }
8858 EOF
8859 if { (eval echo configure:8860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
8860   rm -rf conftest*
8861   echo "$ac_t""yes" 1>&6
8862    { test "$extra_verbose" = "yes" && cat << \EOF
8863     Defining HAVE_H_ERRNO
8864 EOF
8865 cat >> confdefs.h <<\EOF
8866 #define HAVE_H_ERRNO 1
8867 EOF
8868 }
8869
8870 else
8871   echo "configure: failed program was:" >&5
8872   cat conftest.$ac_ext >&5
8873   rm -rf conftest*
8874   echo "$ac_t""no" 1>&6
8875 fi
8876 rm -f conftest*
8877
8878 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8879 echo "configure:8880: checking for sigsetjmp" >&5
8880 cat > conftest.$ac_ext <<EOF
8881 #line 8882 "configure"
8882 #include "confdefs.h"
8883 #include <setjmp.h>
8884 int main() {
8885 sigjmp_buf bar; sigsetjmp (bar, 0);
8886 ; return 0; }
8887 EOF
8888 if { (eval echo configure:8889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8889   rm -rf conftest*
8890   echo "$ac_t""yes" 1>&6
8891    { test "$extra_verbose" = "yes" && cat << \EOF
8892     Defining HAVE_SIGSETJMP
8893 EOF
8894 cat >> confdefs.h <<\EOF
8895 #define HAVE_SIGSETJMP 1
8896 EOF
8897 }
8898
8899 else
8900   echo "configure: failed program was:" >&5
8901   cat conftest.$ac_ext >&5
8902   rm -rf conftest*
8903   echo "$ac_t""no" 1>&6
8904 fi
8905 rm -f conftest*
8906
8907 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
8908 echo "configure:8909: checking whether localtime caches TZ" >&5
8909
8910 if test "$ac_cv_func_tzset" = "yes"; then
8911 cat > conftest.$ac_ext <<EOF
8912 #line 8913 "configure"
8913 #include "confdefs.h"
8914 #include <time.h>
8915 #if STDC_HEADERS
8916 # include <stdlib.h>
8917 #endif
8918 extern char **environ;
8919 unset_TZ ()
8920 {
8921   char **from, **to;
8922   for (to = from = environ; (*to = *from); from++)
8923     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
8924       to++;
8925 }
8926 char TZ_GMT0[] = "TZ=GMT0";
8927 char TZ_PST8[] = "TZ=PST8";
8928 main()
8929 {
8930   time_t now = time ((time_t *) 0);
8931   int hour_GMT0, hour_unset;
8932   if (putenv (TZ_GMT0) != 0)
8933     exit (1);
8934   hour_GMT0 = localtime (&now)->tm_hour;
8935   unset_TZ ();
8936   hour_unset = localtime (&now)->tm_hour;
8937   if (putenv (TZ_PST8) != 0)
8938     exit (1);
8939   if (localtime (&now)->tm_hour == hour_GMT0)
8940     exit (1);
8941   unset_TZ ();
8942   if (localtime (&now)->tm_hour != hour_unset)
8943     exit (1);
8944   exit (0);
8945 }
8946 EOF
8947 if { (eval echo configure:8948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
8948 then
8949   emacs_cv_localtime_cache=no
8950 else
8951   conftest_rc="$?"
8952   echo "configure: failed program was:" >&5
8953   cat conftest.$ac_ext >&5
8954   rm -fr conftest*
8955   emacs_cv_localtime_cache=yes
8956 fi
8957 rm -fr conftest*
8958 else
8959         # If we lack tzset, report that localtime does not cache TZ,
8960         # since we can't invalidate the cache if we don't have tzset.
8961         emacs_cv_localtime_cache=no
8962 fi
8963 echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
8964 if test $emacs_cv_localtime_cache = yes; then
8965   { test "$extra_verbose" = "yes" && cat << \EOF
8966     Defining LOCALTIME_CACHE
8967 EOF
8968 cat >> confdefs.h <<\EOF
8969 #define LOCALTIME_CACHE 1
8970 EOF
8971 }
8972
8973 fi
8974
8975 if test "$HAVE_TIMEVAL" = "yes"; then
8976 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
8977 echo "configure:8978: checking whether gettimeofday accepts one or two arguments" >&5
8978 cat > conftest.$ac_ext <<EOF
8979 #line 8980 "configure"
8980 #include "confdefs.h"
8981
8982 #ifdef TIME_WITH_SYS_TIME
8983 #include <sys/time.h>
8984 #include <time.h>
8985 #else
8986 #ifdef HAVE_SYS_TIME_H
8987 #include <sys/time.h>
8988 #else
8989 #include <time.h>
8990 #endif
8991 #endif
8992   
8993 int main() {
8994
8995   struct timeval time;
8996   struct timezone dummy;
8997   gettimeofday (&time, &dummy);
8998
8999 ; return 0; }
9000 EOF
9001 if { (eval echo configure:9002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9002   rm -rf conftest*
9003   echo "$ac_t""two" 1>&6
9004 else
9005   echo "configure: failed program was:" >&5
9006   cat conftest.$ac_ext >&5
9007   rm -rf conftest*
9008   echo "$ac_t""one" 1>&6
9009    { test "$extra_verbose" = "yes" && cat << \EOF
9010     Defining GETTIMEOFDAY_ONE_ARGUMENT
9011 EOF
9012 cat >> confdefs.h <<\EOF
9013 #define GETTIMEOFDAY_ONE_ARGUMENT 1
9014 EOF
9015 }
9016
9017 fi
9018 rm -f conftest*
9019 fi
9020
9021
9022 echo $ac_n "checking for inline""... $ac_c" 1>&6
9023 echo "configure:9024: checking for inline" >&5
9024
9025 ac_cv_c_inline=no
9026 for ac_kw in inline __inline__ __inline; do
9027   cat > conftest.$ac_ext <<EOF
9028 #line 9029 "configure"
9029 #include "confdefs.h"
9030
9031 int main() {
9032 } $ac_kw foo() {
9033 ; return 0; }
9034 EOF
9035 if { (eval echo configure:9036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9036   rm -rf conftest*
9037   ac_cv_c_inline=$ac_kw; break
9038 else
9039   echo "configure: failed program was:" >&5
9040   cat conftest.$ac_ext >&5
9041 fi
9042 rm -f conftest*
9043 done
9044
9045
9046 echo "$ac_t""$ac_cv_c_inline" 1>&6
9047 case "$ac_cv_c_inline" in
9048   inline | yes) ;;
9049   no) { test "$extra_verbose" = "yes" && cat << \EOF
9050     Defining inline = 
9051 EOF
9052 cat >> confdefs.h <<\EOF
9053 #define inline 
9054 EOF
9055 }
9056  ;;
9057   *)  { test "$extra_verbose" = "yes" && cat << EOF
9058     Defining inline = $ac_cv_c_inline
9059 EOF
9060 cat >> confdefs.h <<EOF
9061 #define inline $ac_cv_c_inline
9062 EOF
9063 }
9064  ;;
9065 esac
9066
9067 if test "$ac_cv_c_inline" != "no"; then
9068   { test "$extra_verbose" = "yes" && cat << \EOF
9069     Defining HAVE_INLINE
9070 EOF
9071 cat >> confdefs.h <<\EOF
9072 #define HAVE_INLINE 1
9073 EOF
9074 }
9075
9076   test "$GCC" = "yes" && extra_objs="$extra_objs inline.o" &&  if test "$extra_verbose" = "yes"; then
9077    echo "    xemacs will be linked with \"inline.o\""
9078  fi
9079 fi
9080
9081
9082 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
9083 # for constant arguments.  Useless!
9084 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
9085 echo "configure:9086: checking for working alloca.h" >&5
9086
9087 cat > conftest.$ac_ext <<EOF
9088 #line 9089 "configure"
9089 #include "confdefs.h"
9090 #include <alloca.h>
9091 int main() {
9092 char *p = alloca(2 * sizeof(int));
9093 ; return 0; }
9094 EOF
9095 if { (eval echo configure:9096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9096   rm -rf conftest*
9097   ac_cv_header_alloca_h=yes
9098 else
9099   echo "configure: failed program was:" >&5
9100   cat conftest.$ac_ext >&5
9101   rm -rf conftest*
9102   ac_cv_header_alloca_h=no
9103 fi
9104 rm -f conftest*
9105
9106 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
9107 if test $ac_cv_header_alloca_h = yes; then
9108   { test "$extra_verbose" = "yes" && cat << \EOF
9109     Defining HAVE_ALLOCA_H
9110 EOF
9111 cat >> confdefs.h <<\EOF
9112 #define HAVE_ALLOCA_H 1
9113 EOF
9114 }
9115
9116 fi
9117
9118 echo $ac_n "checking for alloca""... $ac_c" 1>&6
9119 echo "configure:9120: checking for alloca" >&5
9120
9121 cat > conftest.$ac_ext <<EOF
9122 #line 9123 "configure"
9123 #include "confdefs.h"
9124
9125 #ifdef __GNUC__
9126 # define alloca __builtin_alloca
9127 #else
9128 # if HAVE_ALLOCA_H
9129 #  include <alloca.h>
9130 # else
9131 #  ifdef _AIX
9132  #pragma alloca
9133 #  else
9134 #   ifndef alloca /* predefined by HP cc +Olibcalls */
9135 char *alloca ();
9136 #   endif
9137 #  endif
9138 # endif
9139 #endif
9140
9141 int main() {
9142 char *p = (char *) alloca(1);
9143 ; return 0; }
9144 EOF
9145 if { (eval echo configure:9146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9146   rm -rf conftest*
9147   ac_cv_func_alloca_works=yes
9148 else
9149   echo "configure: failed program was:" >&5
9150   cat conftest.$ac_ext >&5
9151   rm -rf conftest*
9152   ac_cv_func_alloca_works=no
9153 fi
9154 rm -f conftest*
9155
9156 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
9157 if test $ac_cv_func_alloca_works = yes; then
9158   { test "$extra_verbose" = "yes" && cat << \EOF
9159     Defining HAVE_ALLOCA
9160 EOF
9161 cat >> confdefs.h <<\EOF
9162 #define HAVE_ALLOCA 1
9163 EOF
9164 }
9165
9166 fi
9167
9168 if test $ac_cv_func_alloca_works = no; then
9169   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
9170   # that cause trouble.  Some versions do not even contain alloca or
9171   # contain a buggy version.  If you still want to use their alloca,
9172   # use ar to extract alloca.o from them instead of compiling alloca.c.
9173   ALLOCA=alloca.o
9174   { test "$extra_verbose" = "yes" && cat << \EOF
9175     Defining C_ALLOCA
9176 EOF
9177 cat >> confdefs.h <<\EOF
9178 #define C_ALLOCA 1
9179 EOF
9180 }
9181
9182
9183 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
9184 echo "configure:9185: checking whether alloca needs Cray hooks" >&5
9185
9186 cat > conftest.$ac_ext <<EOF
9187 #line 9188 "configure"
9188 #include "confdefs.h"
9189 #if defined(CRAY) && ! defined(CRAY2)
9190 webecray
9191 #else
9192 wenotbecray
9193 #endif
9194
9195 EOF
9196 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9197   egrep "webecray" >/dev/null 2>&1; then
9198   rm -rf conftest*
9199   ac_cv_os_cray=yes
9200 else
9201   rm -rf conftest*
9202   ac_cv_os_cray=no
9203 fi
9204 rm -f conftest*
9205
9206
9207 echo "$ac_t""$ac_cv_os_cray" 1>&6
9208 if test $ac_cv_os_cray = yes; then
9209 for ac_func in _getb67 GETB67 getb67; do
9210   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9211 echo "configure:9212: checking for $ac_func" >&5
9212
9213 cat > conftest.$ac_ext <<EOF
9214 #line 9215 "configure"
9215 #include "confdefs.h"
9216 /* System header to define __stub macros and hopefully few prototypes,
9217     which can conflict with char $ac_func(); below.  */
9218 #include <assert.h>
9219 /* Override any gcc2 internal prototype to avoid an error.  */
9220 /* We use char because int might match the return type of a gcc2
9221     builtin and then its argument prototype would still apply.  */
9222 char $ac_func();
9223
9224 int main() {
9225
9226 /* The GNU C library defines this for functions which it implements
9227     to always fail with ENOSYS.  Some functions are actually named
9228     something starting with __ and the normal name is an alias.  */
9229 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9230 choke me
9231 #else
9232 $ac_func();
9233 #endif
9234
9235 ; return 0; }
9236 EOF
9237 if { (eval echo configure:9238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9238   rm -rf conftest*
9239   eval "ac_cv_func_$ac_func=yes"
9240 else
9241   echo "configure: failed program was:" >&5
9242   cat conftest.$ac_ext >&5
9243   rm -rf conftest*
9244   eval "ac_cv_func_$ac_func=no"
9245 fi
9246 rm -f conftest*
9247
9248 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9249   echo "$ac_t""yes" 1>&6
9250   { test "$extra_verbose" = "yes" && cat << EOF
9251     Defining CRAY_STACKSEG_END = $ac_func
9252 EOF
9253 cat >> confdefs.h <<EOF
9254 #define CRAY_STACKSEG_END $ac_func
9255 EOF
9256 }
9257
9258   break
9259 else
9260   echo "$ac_t""no" 1>&6
9261 fi
9262
9263 done
9264 fi
9265
9266 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
9267 echo "configure:9268: checking stack direction for C alloca" >&5
9268
9269 cat > conftest.$ac_ext <<EOF
9270 #line 9271 "configure"
9271 #include "confdefs.h"
9272 find_stack_direction ()
9273 {
9274   static char *addr = 0;
9275   auto char dummy;
9276   if (addr == 0)
9277     {
9278       addr = &dummy;
9279       return find_stack_direction ();
9280     }
9281   else
9282     return (&dummy > addr) ? 1 : -1;
9283 }
9284 main ()
9285 {
9286   exit (find_stack_direction() < 0);
9287 }
9288 EOF
9289 if { (eval echo configure:9290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9290 then
9291   ac_cv_c_stack_direction=1
9292 else
9293   conftest_rc="$?"
9294   echo "configure: failed program was:" >&5
9295   cat conftest.$ac_ext >&5
9296   rm -fr conftest*
9297   ac_cv_c_stack_direction=-1
9298 fi
9299 rm -fr conftest*
9300
9301 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
9302 { test "$extra_verbose" = "yes" && cat << EOF
9303     Defining STACK_DIRECTION = $ac_cv_c_stack_direction
9304 EOF
9305 cat >> confdefs.h <<EOF
9306 #define STACK_DIRECTION $ac_cv_c_stack_direction
9307 EOF
9308 }
9309
9310 fi
9311
9312 test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbose" = "yes"; then
9313    echo "    xemacs will be linked with \"$ALLOCA\""
9314  fi
9315
9316 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9317 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9318 echo "configure:9319: checking for vfork.h" >&5
9319
9320 cat > conftest.$ac_ext <<EOF
9321 #line 9322 "configure"
9322 #include "confdefs.h"
9323 #include <vfork.h>
9324 EOF
9325 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9326 { (eval echo configure:9327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9327 ac_err=`grep -v '^ *+' conftest.out`
9328 if test -z "$ac_err"; then
9329   rm -rf conftest*
9330   eval "ac_cv_header_$ac_safe=yes"
9331 else
9332   echo "$ac_err" >&5
9333   echo "configure: failed program was:" >&5
9334   cat conftest.$ac_ext >&5
9335   rm -rf conftest*
9336   eval "ac_cv_header_$ac_safe=no"
9337 fi
9338 rm -f conftest*
9339 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9340   echo "$ac_t""yes" 1>&6
9341   { test "$extra_verbose" = "yes" && cat << \EOF
9342     Defining HAVE_VFORK_H
9343 EOF
9344 cat >> confdefs.h <<\EOF
9345 #define HAVE_VFORK_H 1
9346 EOF
9347 }
9348
9349 else
9350   echo "$ac_t""no" 1>&6
9351 fi
9352
9353 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9354 echo "configure:9355: checking for working vfork" >&5
9355
9356 cat > conftest.$ac_ext <<EOF
9357 #line 9358 "configure"
9358 #include "confdefs.h"
9359 /* Thanks to Paul Eggert for this test.  */
9360 #include <stdio.h>
9361 #include <sys/types.h>
9362 #include <sys/stat.h>
9363 #ifdef HAVE_UNISTD_H
9364 #include <unistd.h>
9365 #endif
9366 #ifdef HAVE_VFORK_H
9367 #include <vfork.h>
9368 #endif
9369 /* On some sparc systems, changes by the child to local and incoming
9370    argument registers are propagated back to the parent.
9371    The compiler is told about this with #include <vfork.h>,
9372    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9373    Test for this by using a static variable whose address
9374    is put into a register that is clobbered by the vfork.  */
9375 static
9376 #ifdef __cplusplus
9377 sparc_address_test (int arg)
9378 #else
9379 sparc_address_test (arg) int arg;
9380 #endif
9381 {
9382   static pid_t child;
9383   if (!child) {
9384     child = vfork ();
9385     if (child < 0) {
9386       perror ("vfork");
9387       _exit(2);
9388     }
9389     if (!child) {
9390       arg = getpid();
9391       write(-1, "", 0);
9392       _exit (arg);
9393     }
9394   }
9395 }
9396 main() {
9397   pid_t parent = getpid ();
9398   pid_t child;
9399
9400   sparc_address_test ();
9401
9402   child = vfork ();
9403
9404   if (child == 0) {
9405     /* Here is another test for sparc vfork register problems.
9406        This test uses lots of local variables, at least
9407        as many local variables as main has allocated so far
9408        including compiler temporaries.  4 locals are enough for
9409        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9410        A buggy compiler should reuse the register of parent
9411        for one of the local variables, since it will think that
9412        parent can't possibly be used any more in this routine.
9413        Assigning to the local variable will thus munge parent
9414        in the parent process.  */
9415     pid_t
9416       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9417       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9418     /* Convince the compiler that p..p7 are live; otherwise, it might
9419        use the same hardware register for all 8 local variables.  */
9420     if (p != p1 || p != p2 || p != p3 || p != p4
9421         || p != p5 || p != p6 || p != p7)
9422       _exit(1);
9423
9424     /* On some systems (e.g. IRIX 3.3),
9425        vfork doesn't separate parent from child file descriptors.
9426        If the child closes a descriptor before it execs or exits,
9427        this munges the parent's descriptor as well.
9428        Test for this by closing stdout in the child.  */
9429     _exit(close(fileno(stdout)) != 0);
9430   } else {
9431     int status;
9432     struct stat st;
9433
9434     while (wait(&status) != child)
9435       ;
9436     exit(
9437          /* Was there some problem with vforking?  */
9438          child < 0
9439
9440          /* Did the child fail?  (This shouldn't happen.)  */
9441          || status
9442
9443          /* Did the vfork/compiler bug occur?  */
9444          || parent != getpid()
9445
9446          /* Did the file descriptor bug occur?  */
9447          || fstat(fileno(stdout), &st) != 0
9448          );
9449   }
9450 }
9451 EOF
9452 if { (eval echo configure:9453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9453 then
9454   ac_cv_func_vfork_works=yes
9455 else
9456   conftest_rc="$?"
9457   echo "configure: failed program was:" >&5
9458   cat conftest.$ac_ext >&5
9459   rm -fr conftest*
9460   ac_cv_func_vfork_works=no
9461 fi
9462 rm -fr conftest*
9463
9464 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9465 if test $ac_cv_func_vfork_works = no; then
9466   { test "$extra_verbose" = "yes" && cat << \EOF
9467     Defining vfork = fork
9468 EOF
9469 cat >> confdefs.h <<\EOF
9470 #define vfork fork
9471 EOF
9472 }
9473
9474 fi
9475
9476
9477 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
9478 echo "configure:9479: checking for working strcoll" >&5
9479
9480 cat > conftest.$ac_ext <<EOF
9481 #line 9482 "configure"
9482 #include "confdefs.h"
9483 #include <string.h>
9484 main ()
9485 {
9486   exit (strcoll ("abc", "def") >= 0 ||
9487         strcoll ("ABC", "DEF") >= 0 ||
9488         strcoll ("123", "456") >= 0);
9489 }
9490 EOF
9491 if { (eval echo configure:9492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9492 then
9493   ac_cv_func_strcoll_works=yes
9494 else
9495   conftest_rc="$?"
9496   echo "configure: failed program was:" >&5
9497   cat conftest.$ac_ext >&5
9498   rm -fr conftest*
9499   ac_cv_func_strcoll_works=no
9500 fi
9501 rm -fr conftest*
9502
9503 echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
9504 if test $ac_cv_func_strcoll_works = yes; then
9505   { test "$extra_verbose" = "yes" && cat << \EOF
9506     Defining HAVE_STRCOLL
9507 EOF
9508 cat >> confdefs.h <<\EOF
9509 #define HAVE_STRCOLL 1
9510 EOF
9511 }
9512
9513 fi
9514
9515
9516 for ac_func in getpgrp
9517 do
9518 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9519 echo "configure:9520: checking for $ac_func" >&5
9520
9521 cat > conftest.$ac_ext <<EOF
9522 #line 9523 "configure"
9523 #include "confdefs.h"
9524 /* System header to define __stub macros and hopefully few prototypes,
9525     which can conflict with char $ac_func(); below.  */
9526 #include <assert.h>
9527 /* Override any gcc2 internal prototype to avoid an error.  */
9528 /* We use char because int might match the return type of a gcc2
9529     builtin and then its argument prototype would still apply.  */
9530 char $ac_func();
9531
9532 int main() {
9533
9534 /* The GNU C library defines this for functions which it implements
9535     to always fail with ENOSYS.  Some functions are actually named
9536     something starting with __ and the normal name is an alias.  */
9537 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9538 choke me
9539 #else
9540 $ac_func();
9541 #endif
9542
9543 ; return 0; }
9544 EOF
9545 if { (eval echo configure:9546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9546   rm -rf conftest*
9547   eval "ac_cv_func_$ac_func=yes"
9548 else
9549   echo "configure: failed program was:" >&5
9550   cat conftest.$ac_ext >&5
9551   rm -rf conftest*
9552   eval "ac_cv_func_$ac_func=no"
9553 fi
9554 rm -f conftest*
9555
9556 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9557   echo "$ac_t""yes" 1>&6
9558     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9559   { test "$extra_verbose" = "yes" && cat << EOF
9560     Defining $ac_tr_func
9561 EOF
9562 cat >> confdefs.h <<EOF
9563 #define $ac_tr_func 1
9564 EOF
9565 }
9566  
9567 else
9568   echo "$ac_t""no" 1>&6
9569 fi
9570 done
9571
9572 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
9573 echo "configure:9574: checking whether getpgrp takes no argument" >&5
9574
9575 cat > conftest.$ac_ext <<EOF
9576 #line 9577 "configure"
9577 #include "confdefs.h"
9578
9579 /*
9580  * If this system has a BSD-style getpgrp(),
9581  * which takes a pid argument, exit unsuccessfully.
9582  *
9583  * Snarfed from Chet Ramey's bash pgrp.c test program
9584  */
9585 #include <stdio.h>
9586 #include <sys/types.h>
9587
9588 int     pid;
9589 int     pg1, pg2, pg3, pg4;
9590 int     ng, np, s, child;
9591
9592 main()
9593 {
9594         pid = getpid();
9595         pg1 = getpgrp(0);
9596         pg2 = getpgrp();
9597         pg3 = getpgrp(pid);
9598         pg4 = getpgrp(1);
9599
9600         /*
9601          * If all of these values are the same, it's pretty sure that
9602          * we're on a system that ignores getpgrp's first argument.
9603          */
9604         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
9605                 exit(0);
9606
9607         child = fork();
9608         if (child < 0)
9609                 exit(1);
9610         else if (child == 0) {
9611                 np = getpid();
9612                 /*
9613                  * If this is Sys V, this will not work; pgrp will be
9614                  * set to np because setpgrp just changes a pgrp to be
9615                  * the same as the pid.
9616                  */
9617                 setpgrp(np, pg1);
9618                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
9619                 if (ng == pg1) {
9620                         exit(1);
9621                 } else {
9622                         exit(0);
9623                 }
9624         } else {
9625                 wait(&s);
9626                 exit(s>>8);
9627         }
9628 }
9629
9630 EOF
9631 if { (eval echo configure:9632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9632 then
9633   ac_cv_func_getpgrp_void=yes
9634 else
9635   conftest_rc="$?"
9636   echo "configure: failed program was:" >&5
9637   cat conftest.$ac_ext >&5
9638   rm -fr conftest*
9639   ac_cv_func_getpgrp_void=no
9640 fi
9641 rm -fr conftest*
9642
9643
9644 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
9645 if test $ac_cv_func_getpgrp_void = yes; then
9646   { test "$extra_verbose" = "yes" && cat << \EOF
9647     Defining GETPGRP_VOID
9648 EOF
9649 cat >> confdefs.h <<\EOF
9650 #define GETPGRP_VOID 1
9651 EOF
9652 }
9653
9654 fi
9655
9656
9657 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9658 echo "configure:9659: checking for working mmap" >&5
9659 case "$opsys" in ultrix* ) have_mmap=no ;; *)
9660 cat > conftest.$ac_ext <<EOF
9661 #line 9662 "configure"
9662 #include "confdefs.h"
9663 #include <stdio.h>
9664 #include <unistd.h>
9665 #include <fcntl.h>
9666 #include <sys/mman.h>
9667
9668 #ifndef MAP_VARIABLE
9669 #define MAP_VARIABLE 0
9670 #endif
9671
9672 #ifndef MAP_FAILED
9673 #define MAP_FAILED -1
9674 #endif
9675
9676 int main (int argc, char *argv[])
9677 {
9678   int fd = -1;
9679   caddr_t p;
9680 #ifndef MAP_ANONYMOUS
9681   fd = open ("/dev/zero", O_RDWR);
9682   if (fd < 0)
9683     return 1;
9684 #define MAP_ANONYMOUS 0
9685 #endif
9686   if (mmap(0, 1024, PROT_READ | PROT_WRITE,
9687            MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
9688            fd, 0) != (void *) MAP_FAILED)
9689     return 0;
9690   perror ("conftest: mmap failed");
9691   return 1;
9692 }
9693 EOF
9694 if { (eval echo configure:9695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9695 then
9696   have_mmap=yes
9697 else
9698   conftest_rc="$?"
9699   echo "configure: failed program was:" >&5
9700   cat conftest.$ac_ext >&5
9701   rm -fr conftest*
9702   have_mmap=no
9703 fi
9704 rm -fr conftest* ;;
9705 esac
9706 echo "$ac_t""$have_mmap" 1>&6
9707 test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9708     Defining HAVE_MMAP
9709 EOF
9710 cat >> confdefs.h <<\EOF
9711 #define HAVE_MMAP 1
9712 EOF
9713 }
9714
9715 for ac_hdr in unistd.h
9716 do
9717 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9718 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9719 echo "configure:9720: checking for $ac_hdr" >&5
9720
9721 cat > conftest.$ac_ext <<EOF
9722 #line 9723 "configure"
9723 #include "confdefs.h"
9724 #include <$ac_hdr>
9725 EOF
9726 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9727 { (eval echo configure:9728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9728 ac_err=`grep -v '^ *+' conftest.out`
9729 if test -z "$ac_err"; then
9730   rm -rf conftest*
9731   eval "ac_cv_header_$ac_safe=yes"
9732 else
9733   echo "$ac_err" >&5
9734   echo "configure: failed program was:" >&5
9735   cat conftest.$ac_ext >&5
9736   rm -rf conftest*
9737   eval "ac_cv_header_$ac_safe=no"
9738 fi
9739 rm -f conftest*
9740 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9741   echo "$ac_t""yes" 1>&6
9742     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9743   { test "$extra_verbose" = "yes" && cat << EOF
9744     Defining $ac_tr_hdr
9745 EOF
9746 cat >> confdefs.h <<EOF
9747 #define $ac_tr_hdr 1
9748 EOF
9749 }
9750  
9751 else
9752   echo "$ac_t""no" 1>&6
9753 fi
9754 done
9755
9756 for ac_func in getpagesize
9757 do
9758 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9759 echo "configure:9760: checking for $ac_func" >&5
9760
9761 cat > conftest.$ac_ext <<EOF
9762 #line 9763 "configure"
9763 #include "confdefs.h"
9764 /* System header to define __stub macros and hopefully few prototypes,
9765     which can conflict with char $ac_func(); below.  */
9766 #include <assert.h>
9767 /* Override any gcc2 internal prototype to avoid an error.  */
9768 /* We use char because int might match the return type of a gcc2
9769     builtin and then its argument prototype would still apply.  */
9770 char $ac_func();
9771
9772 int main() {
9773
9774 /* The GNU C library defines this for functions which it implements
9775     to always fail with ENOSYS.  Some functions are actually named
9776     something starting with __ and the normal name is an alias.  */
9777 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9778 choke me
9779 #else
9780 $ac_func();
9781 #endif
9782
9783 ; return 0; }
9784 EOF
9785 if { (eval echo configure:9786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
9786   rm -rf conftest*
9787   eval "ac_cv_func_$ac_func=yes"
9788 else
9789   echo "configure: failed program was:" >&5
9790   cat conftest.$ac_ext >&5
9791   rm -rf conftest*
9792   eval "ac_cv_func_$ac_func=no"
9793 fi
9794 rm -f conftest*
9795
9796 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9797   echo "$ac_t""yes" 1>&6
9798     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9799   { test "$extra_verbose" = "yes" && cat << EOF
9800     Defining $ac_tr_func
9801 EOF
9802 cat >> confdefs.h <<EOF
9803 #define $ac_tr_func 1
9804 EOF
9805 }
9806  
9807 else
9808   echo "$ac_t""no" 1>&6
9809 fi
9810 done
9811
9812 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
9813 echo "configure:9814: checking for working mmap" >&5
9814
9815 cat > conftest.$ac_ext <<EOF
9816 #line 9817 "configure"
9817 #include "confdefs.h"
9818
9819 /* Thanks to Mike Haertel and Jim Avera for this test.
9820    Here is a matrix of mmap possibilities:
9821         mmap private not fixed
9822         mmap private fixed at somewhere currently unmapped
9823         mmap private fixed at somewhere already mapped
9824         mmap shared not fixed
9825         mmap shared fixed at somewhere currently unmapped
9826         mmap shared fixed at somewhere already mapped
9827    For private mappings, we should verify that changes cannot be read()
9828    back from the file, nor mmap's back from the file at a different
9829    address.  (There have been systems where private was not correctly
9830    implemented like the infamous i386 svr4.0, and systems where the
9831    VM page cache was not coherent with the filesystem buffer cache
9832    like early versions of FreeBSD and possibly contemporary NetBSD.)
9833    For shared mappings, we should conversely verify that changes get
9834    propogated back to all the places they're supposed to be.
9835
9836    Grep wants private fixed already mapped.
9837    The main things grep needs to know about mmap are:
9838    * does it exist and is it safe to write into the mmap'd area
9839    * how to use it (BSD variants)  */
9840 #include <sys/types.h>
9841 #include <fcntl.h>
9842 #include <sys/mman.h>
9843
9844 /* This mess was copied from the GNU getpagesize.h.  */
9845 #ifndef HAVE_GETPAGESIZE
9846 # ifdef HAVE_UNISTD_H
9847 #  include <unistd.h>
9848 # endif
9849
9850 /* Assume that all systems that can run configure have sys/param.h.  */
9851 # ifndef HAVE_SYS_PARAM_H
9852 #  define HAVE_SYS_PARAM_H 1
9853 # endif
9854
9855 # ifdef _SC_PAGESIZE
9856 #  define getpagesize() sysconf(_SC_PAGESIZE)
9857 # else /* no _SC_PAGESIZE */
9858 #  ifdef HAVE_SYS_PARAM_H
9859 #   include <sys/param.h>
9860 #   ifdef EXEC_PAGESIZE
9861 #    define getpagesize() EXEC_PAGESIZE
9862 #   else /* no EXEC_PAGESIZE */
9863 #    ifdef NBPG
9864 #     define getpagesize() NBPG * CLSIZE
9865 #     ifndef CLSIZE
9866 #      define CLSIZE 1
9867 #     endif /* no CLSIZE */
9868 #    else /* no NBPG */
9869 #     ifdef NBPC
9870 #      define getpagesize() NBPC
9871 #     else /* no NBPC */
9872 #      ifdef PAGESIZE
9873 #       define getpagesize() PAGESIZE
9874 #      endif /* PAGESIZE */
9875 #     endif /* no NBPC */
9876 #    endif /* no NBPG */
9877 #   endif /* no EXEC_PAGESIZE */
9878 #  else /* no HAVE_SYS_PARAM_H */
9879 #   define getpagesize() 8192   /* punt totally */
9880 #  endif /* no HAVE_SYS_PARAM_H */
9881 # endif /* no _SC_PAGESIZE */
9882
9883 #endif /* no HAVE_GETPAGESIZE */
9884
9885 #ifdef __cplusplus
9886 extern "C" { void *malloc(unsigned); }
9887 #else
9888 char *malloc();
9889 #endif
9890
9891 int
9892 main()
9893 {
9894         char *data, *data2, *data3;
9895         int i, pagesize;
9896         int fd;
9897
9898         pagesize = getpagesize();
9899
9900         /*
9901          * First, make a file with some known garbage in it.
9902          */
9903         data = malloc(pagesize);
9904         if (!data)
9905                 exit(1);
9906         for (i = 0; i < pagesize; ++i)
9907                 *(data + i) = rand();
9908         umask(0);
9909         fd = creat("conftestmmap", 0600);
9910         if (fd < 0)
9911                 exit(1);
9912         if (write(fd, data, pagesize) != pagesize)
9913                 exit(1);
9914         close(fd);
9915
9916         /*
9917          * Next, try to mmap the file at a fixed address which
9918          * already has something else allocated at it.  If we can,
9919          * also make sure that we see the same garbage.
9920          */
9921         fd = open("conftestmmap", O_RDWR);
9922         if (fd < 0)
9923                 exit(1);
9924         data2 = malloc(2 * pagesize);
9925         if (!data2)
9926                 exit(1);
9927         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
9928         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
9929             MAP_PRIVATE | MAP_FIXED, fd, 0L))
9930                 exit(1);
9931         for (i = 0; i < pagesize; ++i)
9932                 if (*(data + i) != *(data2 + i))
9933                         exit(1);
9934
9935         /*
9936          * Finally, make sure that changes to the mapped area
9937          * do not percolate back to the file as seen by read().
9938          * (This is a bug on some variants of i386 svr4.0.)
9939          */
9940         for (i = 0; i < pagesize; ++i)
9941                 *(data2 + i) = *(data2 + i) + 1;
9942         data3 = malloc(pagesize);
9943         if (!data3)
9944                 exit(1);
9945         if (read(fd, data3, pagesize) != pagesize)
9946                 exit(1);
9947         for (i = 0; i < pagesize; ++i)
9948                 if (*(data + i) != *(data3 + i))
9949                         exit(1);
9950         close(fd);
9951         unlink("conftestmmap");
9952         exit(0);
9953 }
9954
9955 EOF
9956 if { (eval echo configure:9957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
9957 then
9958   ac_cv_func_mmap_fixed_mapped=yes
9959 else
9960   conftest_rc="$?"
9961   echo "configure: failed program was:" >&5
9962   cat conftest.$ac_ext >&5
9963   rm -fr conftest*
9964   ac_cv_func_mmap_fixed_mapped=no
9965 fi
9966 rm -fr conftest*
9967
9968 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
9969 if test $ac_cv_func_mmap_fixed_mapped = yes; then
9970   { test "$extra_verbose" = "yes" && cat << \EOF
9971     Defining HAVE_MMAP
9972 EOF
9973 cat >> confdefs.h <<\EOF
9974 #define HAVE_MMAP 1
9975 EOF
9976 }
9977
9978 fi
9979
9980
9981 test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
9982 test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
9983 test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
9984     Defining REL_ALLOC
9985 EOF
9986 cat >> confdefs.h <<\EOF
9987 #define REL_ALLOC 1
9988 EOF
9989 }
9990
9991
9992 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
9993 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
9994 echo "configure:9995: checking for termios.h" >&5
9995
9996 cat > conftest.$ac_ext <<EOF
9997 #line 9998 "configure"
9998 #include "confdefs.h"
9999 #include <termios.h>
10000 EOF
10001 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10002 { (eval echo configure:10003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10003 ac_err=`grep -v '^ *+' conftest.out`
10004 if test -z "$ac_err"; then
10005   rm -rf conftest*
10006   eval "ac_cv_header_$ac_safe=yes"
10007 else
10008   echo "$ac_err" >&5
10009   echo "configure: failed program was:" >&5
10010   cat conftest.$ac_ext >&5
10011   rm -rf conftest*
10012   eval "ac_cv_header_$ac_safe=no"
10013 fi
10014 rm -f conftest*
10015 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10016   echo "$ac_t""yes" 1>&6
10017   { test "$extra_verbose" = "yes" && cat << \EOF
10018     Defining HAVE_TERMIOS
10019 EOF
10020 cat >> confdefs.h <<\EOF
10021 #define HAVE_TERMIOS 1
10022 EOF
10023 }
10024
10025   { test "$extra_verbose" = "yes" && cat << \EOF
10026     Defining SIGNALS_VIA_CHARACTERS
10027 EOF
10028 cat >> confdefs.h <<\EOF
10029 #define SIGNALS_VIA_CHARACTERS 1
10030 EOF
10031 }
10032
10033   { test "$extra_verbose" = "yes" && cat << \EOF
10034     Defining NO_TERMIO
10035 EOF
10036 cat >> confdefs.h <<\EOF
10037 #define NO_TERMIO 1
10038 EOF
10039 }
10040
10041 else
10042   echo "$ac_t""no" 1>&6
10043 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
10044 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
10045 echo "configure:10046: checking for termio.h" >&5
10046
10047 cat > conftest.$ac_ext <<EOF
10048 #line 10049 "configure"
10049 #include "confdefs.h"
10050 #include <termio.h>
10051 EOF
10052 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10053 { (eval echo configure:10054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10054 ac_err=`grep -v '^ *+' conftest.out`
10055 if test -z "$ac_err"; then
10056   rm -rf conftest*
10057   eval "ac_cv_header_$ac_safe=yes"
10058 else
10059   echo "$ac_err" >&5
10060   echo "configure: failed program was:" >&5
10061   cat conftest.$ac_ext >&5
10062   rm -rf conftest*
10063   eval "ac_cv_header_$ac_safe=no"
10064 fi
10065 rm -f conftest*
10066 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10067   echo "$ac_t""yes" 1>&6
10068   { test "$extra_verbose" = "yes" && cat << \EOF
10069     Defining HAVE_TERMIO
10070 EOF
10071 cat >> confdefs.h <<\EOF
10072 #define HAVE_TERMIO 1
10073 EOF
10074 }
10075
10076 else
10077   echo "$ac_t""no" 1>&6
10078 fi
10079
10080 fi
10081
10082
10083
10084 echo $ac_n "checking for socket""... $ac_c" 1>&6
10085 echo "configure:10086: checking for socket" >&5
10086
10087 cat > conftest.$ac_ext <<EOF
10088 #line 10089 "configure"
10089 #include "confdefs.h"
10090 /* System header to define __stub macros and hopefully few prototypes,
10091     which can conflict with char socket(); below.  */
10092 #include <assert.h>
10093 /* Override any gcc2 internal prototype to avoid an error.  */
10094 /* We use char because int might match the return type of a gcc2
10095     builtin and then its argument prototype would still apply.  */
10096 char socket();
10097
10098 int main() {
10099
10100 /* The GNU C library defines this for functions which it implements
10101     to always fail with ENOSYS.  Some functions are actually named
10102     something starting with __ and the normal name is an alias.  */
10103 #if defined (__stub_socket) || defined (__stub___socket)
10104 choke me
10105 #else
10106 socket();
10107 #endif
10108
10109 ; return 0; }
10110 EOF
10111 if { (eval echo configure:10112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10112   rm -rf conftest*
10113   eval "ac_cv_func_socket=yes"
10114 else
10115   echo "configure: failed program was:" >&5
10116   cat conftest.$ac_ext >&5
10117   rm -rf conftest*
10118   eval "ac_cv_func_socket=no"
10119 fi
10120 rm -f conftest*
10121
10122 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
10123   echo "$ac_t""yes" 1>&6
10124   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
10125 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
10126 echo "configure:10127: checking for netinet/in.h" >&5
10127
10128 cat > conftest.$ac_ext <<EOF
10129 #line 10130 "configure"
10130 #include "confdefs.h"
10131 #include <netinet/in.h>
10132 EOF
10133 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10134 { (eval echo configure:10135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10135 ac_err=`grep -v '^ *+' conftest.out`
10136 if test -z "$ac_err"; then
10137   rm -rf conftest*
10138   eval "ac_cv_header_$ac_safe=yes"
10139 else
10140   echo "$ac_err" >&5
10141   echo "configure: failed program was:" >&5
10142   cat conftest.$ac_ext >&5
10143   rm -rf conftest*
10144   eval "ac_cv_header_$ac_safe=no"
10145 fi
10146 rm -f conftest*
10147 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10148   echo "$ac_t""yes" 1>&6
10149   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
10150 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
10151 echo "configure:10152: checking for arpa/inet.h" >&5
10152
10153 cat > conftest.$ac_ext <<EOF
10154 #line 10155 "configure"
10155 #include "confdefs.h"
10156 #include <arpa/inet.h>
10157 EOF
10158 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10159 { (eval echo configure:10160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10160 ac_err=`grep -v '^ *+' conftest.out`
10161 if test -z "$ac_err"; then
10162   rm -rf conftest*
10163   eval "ac_cv_header_$ac_safe=yes"
10164 else
10165   echo "$ac_err" >&5
10166   echo "configure: failed program was:" >&5
10167   cat conftest.$ac_ext >&5
10168   rm -rf conftest*
10169   eval "ac_cv_header_$ac_safe=no"
10170 fi
10171 rm -f conftest*
10172 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10173   echo "$ac_t""yes" 1>&6
10174   
10175   { test "$extra_verbose" = "yes" && cat << \EOF
10176     Defining HAVE_SOCKETS
10177 EOF
10178 cat >> confdefs.h <<\EOF
10179 #define HAVE_SOCKETS 1
10180 EOF
10181 }
10182
10183       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
10184 echo "configure:10185: checking "for sun_len member in struct sockaddr_un"" >&5
10185       cat > conftest.$ac_ext <<EOF
10186 #line 10187 "configure"
10187 #include "confdefs.h"
10188
10189 #include <sys/types.h>
10190 #include <sys/socket.h>
10191 #include <sys/un.h>
10192       
10193 int main() {
10194 static struct sockaddr_un x; x.sun_len = 1;
10195 ; return 0; }
10196 EOF
10197 if { (eval echo configure:10198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10198   rm -rf conftest*
10199   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10200     Defining HAVE_SOCKADDR_SUN_LEN
10201 EOF
10202 cat >> confdefs.h <<\EOF
10203 #define HAVE_SOCKADDR_SUN_LEN 1
10204 EOF
10205 }
10206
10207 else
10208   echo "configure: failed program was:" >&5
10209   cat conftest.$ac_ext >&5
10210   rm -rf conftest*
10211   echo "$ac_t""no" 1>&6
10212 fi
10213 rm -f conftest*
10214       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
10215 echo "configure:10216: checking "for ip_mreq struct in netinet/in.h"" >&5
10216       cat > conftest.$ac_ext <<EOF
10217 #line 10218 "configure"
10218 #include "confdefs.h"
10219
10220 #include <sys/types.h>
10221 #include <netinet/in.h>
10222       
10223 int main() {
10224 static struct ip_mreq x;
10225 ; return 0; }
10226 EOF
10227 if { (eval echo configure:10228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10228   rm -rf conftest*
10229   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
10230     Defining HAVE_MULTICAST
10231 EOF
10232 cat >> confdefs.h <<\EOF
10233 #define HAVE_MULTICAST 1
10234 EOF
10235 }
10236
10237 else
10238   echo "configure: failed program was:" >&5
10239   cat conftest.$ac_ext >&5
10240   rm -rf conftest*
10241   echo "$ac_t""no" 1>&6
10242 fi
10243 rm -f conftest*
10244 else
10245   echo "$ac_t""no" 1>&6
10246 fi
10247
10248 else
10249   echo "$ac_t""no" 1>&6
10250 fi
10251
10252 else
10253   echo "$ac_t""no" 1>&6
10254 fi
10255
10256
10257 echo $ac_n "checking for msgget""... $ac_c" 1>&6
10258 echo "configure:10259: checking for msgget" >&5
10259
10260 cat > conftest.$ac_ext <<EOF
10261 #line 10262 "configure"
10262 #include "confdefs.h"
10263 /* System header to define __stub macros and hopefully few prototypes,
10264     which can conflict with char msgget(); below.  */
10265 #include <assert.h>
10266 /* Override any gcc2 internal prototype to avoid an error.  */
10267 /* We use char because int might match the return type of a gcc2
10268     builtin and then its argument prototype would still apply.  */
10269 char msgget();
10270
10271 int main() {
10272
10273 /* The GNU C library defines this for functions which it implements
10274     to always fail with ENOSYS.  Some functions are actually named
10275     something starting with __ and the normal name is an alias.  */
10276 #if defined (__stub_msgget) || defined (__stub___msgget)
10277 choke me
10278 #else
10279 msgget();
10280 #endif
10281
10282 ; return 0; }
10283 EOF
10284 if { (eval echo configure:10285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10285   rm -rf conftest*
10286   eval "ac_cv_func_msgget=yes"
10287 else
10288   echo "configure: failed program was:" >&5
10289   cat conftest.$ac_ext >&5
10290   rm -rf conftest*
10291   eval "ac_cv_func_msgget=no"
10292 fi
10293 rm -f conftest*
10294
10295 if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
10296   echo "$ac_t""yes" 1>&6
10297   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
10298 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
10299 echo "configure:10300: checking for sys/ipc.h" >&5
10300
10301 cat > conftest.$ac_ext <<EOF
10302 #line 10303 "configure"
10303 #include "confdefs.h"
10304 #include <sys/ipc.h>
10305 EOF
10306 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10307 { (eval echo configure:10308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10308 ac_err=`grep -v '^ *+' conftest.out`
10309 if test -z "$ac_err"; then
10310   rm -rf conftest*
10311   eval "ac_cv_header_$ac_safe=yes"
10312 else
10313   echo "$ac_err" >&5
10314   echo "configure: failed program was:" >&5
10315   cat conftest.$ac_ext >&5
10316   rm -rf conftest*
10317   eval "ac_cv_header_$ac_safe=no"
10318 fi
10319 rm -f conftest*
10320 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10321   echo "$ac_t""yes" 1>&6
10322   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
10323 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
10324 echo "configure:10325: checking for sys/msg.h" >&5
10325
10326 cat > conftest.$ac_ext <<EOF
10327 #line 10328 "configure"
10328 #include "confdefs.h"
10329 #include <sys/msg.h>
10330 EOF
10331 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10332 { (eval echo configure:10333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10333 ac_err=`grep -v '^ *+' conftest.out`
10334 if test -z "$ac_err"; then
10335   rm -rf conftest*
10336   eval "ac_cv_header_$ac_safe=yes"
10337 else
10338   echo "$ac_err" >&5
10339   echo "configure: failed program was:" >&5
10340   cat conftest.$ac_ext >&5
10341   rm -rf conftest*
10342   eval "ac_cv_header_$ac_safe=no"
10343 fi
10344 rm -f conftest*
10345 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10346   echo "$ac_t""yes" 1>&6
10347   { test "$extra_verbose" = "yes" && cat << \EOF
10348     Defining HAVE_SYSVIPC
10349 EOF
10350 cat >> confdefs.h <<\EOF
10351 #define HAVE_SYSVIPC 1
10352 EOF
10353 }
10354
10355 else
10356   echo "$ac_t""no" 1>&6
10357 fi
10358
10359 else
10360   echo "$ac_t""no" 1>&6
10361 fi
10362
10363 else
10364   echo "$ac_t""no" 1>&6
10365 fi
10366
10367
10368 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
10369 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
10370 echo "configure:10371: checking for dirent.h" >&5
10371
10372 cat > conftest.$ac_ext <<EOF
10373 #line 10374 "configure"
10374 #include "confdefs.h"
10375 #include <dirent.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`
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 SYSV_SYSTEM_DIR
10395 EOF
10396 cat >> confdefs.h <<\EOF
10397 #define SYSV_SYSTEM_DIR 1
10398 EOF
10399 }
10400
10401 else
10402   echo "$ac_t""no" 1>&6
10403 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
10404 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
10405 echo "configure:10406: checking for sys/dir.h" >&5
10406
10407 cat > conftest.$ac_ext <<EOF
10408 #line 10409 "configure"
10409 #include "confdefs.h"
10410 #include <sys/dir.h>
10411 EOF
10412 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10413 { (eval echo configure:10414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10414 ac_err=`grep -v '^ *+' conftest.out`
10415 if test -z "$ac_err"; then
10416   rm -rf conftest*
10417   eval "ac_cv_header_$ac_safe=yes"
10418 else
10419   echo "$ac_err" >&5
10420   echo "configure: failed program was:" >&5
10421   cat conftest.$ac_ext >&5
10422   rm -rf conftest*
10423   eval "ac_cv_header_$ac_safe=no"
10424 fi
10425 rm -f conftest*
10426 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10427   echo "$ac_t""yes" 1>&6
10428   :
10429 else
10430   echo "$ac_t""no" 1>&6
10431 { test "$extra_verbose" = "yes" && cat << \EOF
10432     Defining NONSYSTEM_DIR_LIBRARY
10433 EOF
10434 cat >> confdefs.h <<\EOF
10435 #define NONSYSTEM_DIR_LIBRARY 1
10436 EOF
10437 }
10438
10439 fi
10440
10441 fi
10442
10443
10444 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
10445 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
10446 echo "configure:10447: checking for nlist.h" >&5
10447
10448 cat > conftest.$ac_ext <<EOF
10449 #line 10450 "configure"
10450 #include "confdefs.h"
10451 #include <nlist.h>
10452 EOF
10453 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10454 { (eval echo configure:10455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10455 ac_err=`grep -v '^ *+' conftest.out`
10456 if test -z "$ac_err"; then
10457   rm -rf conftest*
10458   eval "ac_cv_header_$ac_safe=yes"
10459 else
10460   echo "$ac_err" >&5
10461   echo "configure: failed program was:" >&5
10462   cat conftest.$ac_ext >&5
10463   rm -rf conftest*
10464   eval "ac_cv_header_$ac_safe=no"
10465 fi
10466 rm -f conftest*
10467 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10468   echo "$ac_t""yes" 1>&6
10469   { test "$extra_verbose" = "yes" && cat << \EOF
10470     Defining NLIST_STRUCT
10471 EOF
10472 cat >> confdefs.h <<\EOF
10473 #define NLIST_STRUCT 1
10474 EOF
10475 }
10476
10477 else
10478   echo "$ac_t""no" 1>&6
10479 fi
10480
10481
10482
10483 echo "checking "for sound support"" 1>&6
10484 echo "configure:10485: checking "for sound support"" >&5
10485 case "$with_sound" in
10486   native | both ) with_native_sound=yes;;
10487   nas    | no   ) with_native_sound=no;;
10488 esac
10489 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
10490
10491 if test "$with_native_sound" != "no"; then
10492     if test -n "$native_sound_lib"; then
10493     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
10494 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
10495 echo "configure:10496: checking for multimedia/audio_device.h" >&5
10496
10497 cat > conftest.$ac_ext <<EOF
10498 #line 10499 "configure"
10499 #include "confdefs.h"
10500 #include <multimedia/audio_device.h>
10501 EOF
10502 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10503 { (eval echo configure:10504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10504 ac_err=`grep -v '^ *+' conftest.out`
10505 if test -z "$ac_err"; then
10506   rm -rf conftest*
10507   eval "ac_cv_header_$ac_safe=yes"
10508 else
10509   echo "$ac_err" >&5
10510   echo "configure: failed program was:" >&5
10511   cat conftest.$ac_ext >&5
10512   rm -rf conftest*
10513   eval "ac_cv_header_$ac_safe=no"
10514 fi
10515 rm -f conftest*
10516 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10517   echo "$ac_t""yes" 1>&6
10518   sound_found=yes sound_cflags=""
10519       extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10520    echo "    xemacs will be linked with \"sunplay.o\""
10521  fi
10522 else
10523   echo "$ac_t""no" 1>&6
10524 fi
10525
10526   fi
10527
10528     if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
10529     sound_found=yes
10530     extra_objs="$extra_objs sunplay.o" &&  if test "$extra_verbose" = "yes"; then
10531    echo "    xemacs will be linked with \"sunplay.o\""
10532  fi
10533     if test -d "/usr/demo/SOUND/include"
10534       then sound_cflags="-I/usr/demo/SOUND/include"
10535       else sound_cflags="-I/usr/demo/SOUND"
10536     fi
10537     if test -z "$native_sound_lib" ; then
10538       if test -r "/usr/demo/SOUND/lib/libaudio.a"
10539         then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
10540         else native_sound_lib="/usr/demo/SOUND/libaudio.a"
10541       fi
10542     fi
10543   fi
10544
10545     if test -z "$sound_found"; then
10546     case "$canonical" in
10547     *-sgi-* )
10548       if test -z "$native_sound_lib"; then
10549         
10550 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
10551 echo "configure:10552: checking for ALopenport in -laudio" >&5
10552 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
10553
10554 xe_check_libs=" -laudio "
10555 cat > conftest.$ac_ext <<EOF
10556 #line 10557 "configure"
10557 #include "confdefs.h"
10558 /* Override any gcc2 internal prototype to avoid an error.  */
10559 /* We use char because int might match the return type of a gcc2
10560     builtin and then its argument prototype would still apply.  */
10561 char ALopenport();
10562
10563 int main() {
10564 ALopenport()
10565 ; return 0; }
10566 EOF
10567 if { (eval echo configure:10568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10568   rm -rf conftest*
10569   eval "ac_cv_lib_$ac_lib_var=yes"
10570 else
10571   echo "configure: failed program was:" >&5
10572   cat conftest.$ac_ext >&5
10573   rm -rf conftest*
10574   eval "ac_cv_lib_$ac_lib_var=no"
10575 fi
10576 rm -f conftest*
10577 xe_check_libs=""
10578
10579 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10580   echo "$ac_t""yes" 1>&6
10581   native_sound_lib="-laudio"
10582 else
10583   echo "$ac_t""no" 1>&6
10584 fi
10585
10586
10587       fi
10588       if test -n "$native_sound_lib"; then
10589         sound_found=yes sound_cflags=""
10590         extra_objs="$extra_objs sgiplay.o" &&  if test "$extra_verbose" = "yes"; then
10591    echo "    xemacs will be linked with \"sgiplay.o\""
10592  fi
10593       fi ;;
10594     hppa*-hp-hpux* )
10595       if test -z "$native_sound_lib"; then
10596         
10597 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
10598 echo "configure:10599: checking for AOpenAudio in -lAlib" >&5
10599 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
10600
10601 xe_check_libs=" -lAlib "
10602 cat > conftest.$ac_ext <<EOF
10603 #line 10604 "configure"
10604 #include "confdefs.h"
10605 /* Override any gcc2 internal prototype to avoid an error.  */
10606 /* We use char because int might match the return type of a gcc2
10607     builtin and then its argument prototype would still apply.  */
10608 char AOpenAudio();
10609
10610 int main() {
10611 AOpenAudio()
10612 ; return 0; }
10613 EOF
10614 if { (eval echo configure:10615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10615   rm -rf conftest*
10616   eval "ac_cv_lib_$ac_lib_var=yes"
10617 else
10618   echo "configure: failed program was:" >&5
10619   cat conftest.$ac_ext >&5
10620   rm -rf conftest*
10621   eval "ac_cv_lib_$ac_lib_var=no"
10622 fi
10623 rm -f conftest*
10624 xe_check_libs=""
10625
10626 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10627   echo "$ac_t""yes" 1>&6
10628   native_sound_lib="-lAlib"
10629 else
10630   echo "$ac_t""no" 1>&6
10631 fi
10632
10633
10634       fi
10635       if test -n "$native_sound_lib"; then
10636         sound_found=yes
10637         extra_objs="$extra_objs hpplay.o" &&  if test "$extra_verbose" = "yes"; then
10638    echo "    xemacs will be linked with \"hpplay.o\""
10639  fi
10640         if test "$GCC" = "yes" # Kludge city
10641           then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
10642           else sound_cflags="+e -I/usr/audio/examples"
10643         fi
10644       fi ;;
10645     esac
10646   fi
10647
10648     if test -z "$sound_found"; then
10649     for dir in "machine" "sys" "linux"; do
10650       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
10651 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
10652 echo "configure:10653: checking for ${dir}/soundcard.h" >&5
10653
10654 cat > conftest.$ac_ext <<EOF
10655 #line 10656 "configure"
10656 #include "confdefs.h"
10657 #include <${dir}/soundcard.h>
10658 EOF
10659 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10660 { (eval echo configure:10661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10661 ac_err=`grep -v '^ *+' conftest.out`
10662 if test -z "$ac_err"; then
10663   rm -rf conftest*
10664   eval "ac_cv_header_$ac_safe=yes"
10665 else
10666   echo "$ac_err" >&5
10667   echo "configure: failed program was:" >&5
10668   cat conftest.$ac_ext >&5
10669   rm -rf conftest*
10670   eval "ac_cv_header_$ac_safe=no"
10671 fi
10672 rm -f conftest*
10673 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10674   echo "$ac_t""yes" 1>&6
10675   sound_found=yes
10676         extra_objs="$extra_objs linuxplay.o" &&  if test "$extra_verbose" = "yes"; then
10677    echo "    xemacs will be linked with \"linuxplay.o\""
10678  fi
10679         { test "$extra_verbose" = "yes" && cat << EOF
10680     Defining SOUNDCARD_H_PATH = "${dir}/soundcard.h"
10681 EOF
10682 cat >> confdefs.h <<EOF
10683 #define SOUNDCARD_H_PATH "${dir}/soundcard.h"
10684 EOF
10685 }
10686
10687         break
10688 else
10689   echo "$ac_t""no" 1>&6
10690 fi
10691
10692     done
10693   fi
10694
10695   test "$sound_found" = "yes" && with_native_sound=yes
10696 fi
10697
10698 if test -z "$with_sound"; then
10699   if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then
10700     with_sound=native
10701   fi
10702 fi
10703
10704 if test "$with_native_sound" = "yes"; then
10705   { test "$extra_verbose" = "yes" && cat << \EOF
10706     Defining HAVE_NATIVE_SOUND
10707 EOF
10708 cat >> confdefs.h <<\EOF
10709 #define HAVE_NATIVE_SOUND 1
10710 EOF
10711 }
10712
10713   test -n "$native_sound_lib" && LIBS="$native_sound_lib $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$native_sound_lib\" to \$LIBS"; fi
10714 fi
10715
10716 case "$with_sound" in both | nas )
10717   { test "$extra_verbose" = "yes" && cat << \EOF
10718     Defining HAVE_NAS_SOUND
10719 EOF
10720 cat >> confdefs.h <<\EOF
10721 #define HAVE_NAS_SOUND 1
10722 EOF
10723 }
10724
10725   extra_objs="$extra_objs nas.o" &&  if test "$extra_verbose" = "yes"; then
10726    echo "    xemacs will be linked with \"nas.o\""
10727  fi
10728   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
10729       cat > conftest.$ac_ext <<EOF
10730 #line 10731 "configure"
10731 #include "confdefs.h"
10732 #include <audio/Xtutil.h>
10733 EOF
10734 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10735   egrep "AuXtErrorJump" >/dev/null 2>&1; then
10736   :
10737 else
10738   rm -rf conftest*
10739   { test "$extra_verbose" = "yes" && cat << \EOF
10740     Defining NAS_NO_ERROR_JUMP
10741 EOF
10742 cat >> confdefs.h <<\EOF
10743 #define NAS_NO_ERROR_JUMP 1
10744 EOF
10745 }
10746
10747 fi
10748 rm -f conftest*
10749
10750 esac
10751
10752
10753 test -z "$with_tty" && with_tty=yes
10754
10755 if test "$with_tty" = "yes"  ; then
10756   echo "checking for TTY-related features" 1>&6
10757 echo "configure:10758: checking for TTY-related features" >&5
10758   { test "$extra_verbose" = "yes" && cat << \EOF
10759     Defining HAVE_TTY
10760 EOF
10761 cat >> confdefs.h <<\EOF
10762 #define HAVE_TTY 1
10763 EOF
10764 }
10765
10766   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
10767    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\""
10768  fi
10769
10770     if test -z "$with_ncurses"; then
10771     
10772 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
10773 echo "configure:10774: checking for tgetent in -lncurses" >&5
10774 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
10775
10776 xe_check_libs=" -lncurses "
10777 cat > conftest.$ac_ext <<EOF
10778 #line 10779 "configure"
10779 #include "confdefs.h"
10780 /* Override any gcc2 internal prototype to avoid an error.  */
10781 /* We use char because int might match the return type of a gcc2
10782     builtin and then its argument prototype would still apply.  */
10783 char tgetent();
10784
10785 int main() {
10786 tgetent()
10787 ; return 0; }
10788 EOF
10789 if { (eval echo configure:10790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10790   rm -rf conftest*
10791   eval "ac_cv_lib_$ac_lib_var=yes"
10792 else
10793   echo "configure: failed program was:" >&5
10794   cat conftest.$ac_ext >&5
10795   rm -rf conftest*
10796   eval "ac_cv_lib_$ac_lib_var=no"
10797 fi
10798 rm -f conftest*
10799 xe_check_libs=""
10800
10801 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10802   echo "$ac_t""yes" 1>&6
10803   with_ncurses=yes
10804 else
10805   echo "$ac_t""no" 1>&6
10806 with_ncurses=no
10807 fi
10808
10809
10810   fi
10811   if test "$with_ncurses" = "yes"; then
10812     { test "$extra_verbose" = "yes" && cat << \EOF
10813     Defining HAVE_NCURSES
10814 EOF
10815 cat >> confdefs.h <<\EOF
10816 #define HAVE_NCURSES 1
10817 EOF
10818 }
10819
10820     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10821 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10822 echo "configure:10823: checking for ncurses/curses.h" >&5
10823
10824 cat > conftest.$ac_ext <<EOF
10825 #line 10826 "configure"
10826 #include "confdefs.h"
10827 #include <ncurses/curses.h>
10828 EOF
10829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10830 { (eval echo configure:10831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10831 ac_err=`grep -v '^ *+' conftest.out`
10832 if test -z "$ac_err"; then
10833   rm -rf conftest*
10834   eval "ac_cv_header_$ac_safe=yes"
10835 else
10836   echo "$ac_err" >&5
10837   echo "configure: failed program was:" >&5
10838   cat conftest.$ac_ext >&5
10839   rm -rf conftest*
10840   eval "ac_cv_header_$ac_safe=no"
10841 fi
10842 rm -f conftest*
10843 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10844   echo "$ac_t""yes" 1>&6
10845   curses_h_path=ncurses/curses.h
10846 else
10847   echo "$ac_t""no" 1>&6
10848 fi
10849
10850     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
10851 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
10852 echo "configure:10853: checking for ncurses/term.h" >&5
10853
10854 cat > conftest.$ac_ext <<EOF
10855 #line 10856 "configure"
10856 #include "confdefs.h"
10857 #include <ncurses/term.h>
10858 EOF
10859 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10860 { (eval echo configure:10861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10861 ac_err=`grep -v '^ *+' conftest.out`
10862 if test -z "$ac_err"; then
10863   rm -rf conftest*
10864   eval "ac_cv_header_$ac_safe=yes"
10865 else
10866   echo "$ac_err" >&5
10867   echo "configure: failed program was:" >&5
10868   cat conftest.$ac_ext >&5
10869   rm -rf conftest*
10870   eval "ac_cv_header_$ac_safe=no"
10871 fi
10872 rm -f conftest*
10873 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10874   echo "$ac_t""yes" 1>&6
10875   term_h_path=ncurses/term.h
10876 else
10877   echo "$ac_t""no" 1>&6
10878 fi
10879
10880     extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10881    echo "    xemacs will be linked with \"terminfo.o\""
10882  fi
10883     LIBS="-lncurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lncurses\" to \$LIBS"; fi
10884
10885     if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
10886                         save_c_switch_site="$c_switch_site"
10887       c_switch_site="$c_switch_site -I/usr/include/ncurses"
10888       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
10889 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
10890 echo "configure:10891: checking for ncurses/curses.h" >&5
10891
10892 cat > conftest.$ac_ext <<EOF
10893 #line 10894 "configure"
10894 #include "confdefs.h"
10895 #include <ncurses/curses.h>
10896 EOF
10897 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10898 { (eval echo configure:10899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10899 ac_err=`grep -v '^ *+' conftest.out`
10900 if test -z "$ac_err"; then
10901   rm -rf conftest*
10902   eval "ac_cv_header_$ac_safe=yes"
10903 else
10904   echo "$ac_err" >&5
10905   echo "configure: failed program was:" >&5
10906   cat conftest.$ac_ext >&5
10907   rm -rf conftest*
10908   eval "ac_cv_header_$ac_safe=no"
10909 fi
10910 rm -f conftest*
10911 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10912   echo "$ac_t""yes" 1>&6
10913   curses_h_path=ncurses/curses.h
10914 else
10915   echo "$ac_t""no" 1>&6
10916 fi
10917
10918       if test "$ac_cv_header_ncurses_curses_h" = "yes"
10919         then echo "configure: warning: "Your system has the bogus ncurses include bug."" 1>&2
10920         else c_switch_site="$save_c_switch_site"
10921       fi
10922     fi
10923   else         if test "$have_terminfo" = "yes"; then
10924       extra_objs="$extra_objs terminfo.o" &&  if test "$extra_verbose" = "yes"; then
10925    echo "    xemacs will be linked with \"terminfo.o\""
10926  fi
10927       if test -n "$libs_termcap"; then
10928         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10929       else
10930         for lib in curses termlib termcap; do
10931           
10932 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
10933 echo "configure:10934: checking for tgetent in -l$lib" >&5
10934 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
10935
10936 xe_check_libs=" -l$lib "
10937 cat > conftest.$ac_ext <<EOF
10938 #line 10939 "configure"
10939 #include "confdefs.h"
10940 /* Override any gcc2 internal prototype to avoid an error.  */
10941 /* We use char because int might match the return type of a gcc2
10942     builtin and then its argument prototype would still apply.  */
10943 char tgetent();
10944
10945 int main() {
10946 tgetent()
10947 ; return 0; }
10948 EOF
10949 if { (eval echo configure:10950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10950   rm -rf conftest*
10951   eval "ac_cv_lib_$ac_lib_var=yes"
10952 else
10953   echo "configure: failed program was:" >&5
10954   cat conftest.$ac_ext >&5
10955   rm -rf conftest*
10956   eval "ac_cv_lib_$ac_lib_var=no"
10957 fi
10958 rm -f conftest*
10959 xe_check_libs=""
10960
10961 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
10962   echo "$ac_t""yes" 1>&6
10963   LIBS="-l${lib} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${lib}\" to \$LIBS"; fi; break
10964 else
10965   echo "$ac_t""no" 1>&6
10966 fi
10967
10968
10969         done
10970       fi
10971     else       extra_objs="$extra_objs tparam.o" &&  if test "$extra_verbose" = "yes"; then
10972    echo "    xemacs will be linked with \"tparam.o\""
10973  fi
10974                         case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
10975       if test -n "$libs_termcap"; then
10976         LIBS="$libs_termcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$libs_termcap\" to \$LIBS"; fi
10977       else
10978         
10979 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
10980 echo "configure:10981: checking for tgetent in -lcurses" >&5
10981 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
10982
10983 xe_check_libs=" -lcurses "
10984 cat > conftest.$ac_ext <<EOF
10985 #line 10986 "configure"
10986 #include "confdefs.h"
10987 /* Override any gcc2 internal prototype to avoid an error.  */
10988 /* We use char because int might match the return type of a gcc2
10989     builtin and then its argument prototype would still apply.  */
10990 char tgetent();
10991
10992 int main() {
10993 tgetent()
10994 ; return 0; }
10995 EOF
10996 if { (eval echo configure:10997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
10997   rm -rf conftest*
10998   eval "ac_cv_lib_$ac_lib_var=yes"
10999 else
11000   echo "configure: failed program was:" >&5
11001   cat conftest.$ac_ext >&5
11002   rm -rf conftest*
11003   eval "ac_cv_lib_$ac_lib_var=no"
11004 fi
11005 rm -f conftest*
11006 xe_check_libs=""
11007
11008 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11009   echo "$ac_t""yes" 1>&6
11010   LIBS="-lcurses $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcurses\" to \$LIBS"; fi
11011 else
11012   echo "$ac_t""no" 1>&6
11013 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
11014 echo "configure:11015: checking for tgetent in -ltermcap" >&5
11015 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
11016
11017 xe_check_libs=" -ltermcap "
11018 cat > conftest.$ac_ext <<EOF
11019 #line 11020 "configure"
11020 #include "confdefs.h"
11021 /* Override any gcc2 internal prototype to avoid an error.  */
11022 /* We use char because int might match the return type of a gcc2
11023     builtin and then its argument prototype would still apply.  */
11024 char tgetent();
11025
11026 int main() {
11027 tgetent()
11028 ; return 0; }
11029 EOF
11030 if { (eval echo configure:11031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11031   rm -rf conftest*
11032   eval "ac_cv_lib_$ac_lib_var=yes"
11033 else
11034   echo "configure: failed program was:" >&5
11035   cat conftest.$ac_ext >&5
11036   rm -rf conftest*
11037   eval "ac_cv_lib_$ac_lib_var=no"
11038 fi
11039 rm -f conftest*
11040 xe_check_libs=""
11041
11042 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11043   echo "$ac_t""yes" 1>&6
11044   LIBS="-ltermcap $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltermcap\" to \$LIBS"; fi
11045 else
11046   echo "$ac_t""no" 1>&6
11047 extra_objs="$extra_objs termcap.o" &&  if test "$extra_verbose" = "yes"; then
11048    echo "    xemacs will be linked with \"termcap.o\""
11049  fi
11050 fi
11051
11052
11053 fi
11054
11055
11056       fi
11057     fi
11058   fi
11059   { test "$extra_verbose" = "yes" && cat << EOF
11060     Defining CURSES_H_PATH = "${curses_h_path-curses.h}"
11061 EOF
11062 cat >> confdefs.h <<EOF
11063 #define CURSES_H_PATH "${curses_h_path-curses.h}"
11064 EOF
11065 }
11066
11067   { test "$extra_verbose" = "yes" && cat << EOF
11068     Defining TERM_H_PATH = "${term_h_path-term.h}"
11069 EOF
11070 cat >> confdefs.h <<EOF
11071 #define TERM_H_PATH "${term_h_path-term.h}"
11072 EOF
11073 }
11074
11075
11076     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
11077 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
11078 echo "configure:11079: checking for gpm.h" >&5
11079
11080 cat > conftest.$ac_ext <<EOF
11081 #line 11082 "configure"
11082 #include "confdefs.h"
11083 #include <gpm.h>
11084 EOF
11085 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11086 { (eval echo configure:11087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11087 ac_err=`grep -v '^ *+' conftest.out`
11088 if test -z "$ac_err"; then
11089   rm -rf conftest*
11090   eval "ac_cv_header_$ac_safe=yes"
11091 else
11092   echo "$ac_err" >&5
11093   echo "configure: failed program was:" >&5
11094   cat conftest.$ac_ext >&5
11095   rm -rf conftest*
11096   eval "ac_cv_header_$ac_safe=no"
11097 fi
11098 rm -f conftest*
11099 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11100   echo "$ac_t""yes" 1>&6
11101   :
11102 else
11103   echo "$ac_t""no" 1>&6
11104 with_gpm=no
11105 fi
11106  }
11107   test -z "$with_gpm" && { 
11108 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
11109 echo "configure:11110: checking for Gpm_Open in -lgpm" >&5
11110 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
11111
11112 xe_check_libs=" -lgpm "
11113 cat > conftest.$ac_ext <<EOF
11114 #line 11115 "configure"
11115 #include "confdefs.h"
11116 /* Override any gcc2 internal prototype to avoid an error.  */
11117 /* We use char because int might match the return type of a gcc2
11118     builtin and then its argument prototype would still apply.  */
11119 char Gpm_Open();
11120
11121 int main() {
11122 Gpm_Open()
11123 ; return 0; }
11124 EOF
11125 if { (eval echo configure:11126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11126   rm -rf conftest*
11127   eval "ac_cv_lib_$ac_lib_var=yes"
11128 else
11129   echo "configure: failed program was:" >&5
11130   cat conftest.$ac_ext >&5
11131   rm -rf conftest*
11132   eval "ac_cv_lib_$ac_lib_var=no"
11133 fi
11134 rm -f conftest*
11135 xe_check_libs=""
11136
11137 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11138   echo "$ac_t""yes" 1>&6
11139   with_gpm=yes
11140 else
11141   echo "$ac_t""no" 1>&6
11142 with_gpm=no
11143 fi
11144
11145  }
11146   if test "$with_gpm" = "yes"; then
11147     { test "$extra_verbose" = "yes" && cat << \EOF
11148     Defining HAVE_GPM
11149 EOF
11150 cat >> confdefs.h <<\EOF
11151 #define HAVE_GPM 1
11152 EOF
11153 }
11154
11155     extra_objs="$extra_objs gpmevent.o" &&  if test "$extra_verbose" = "yes"; then
11156    echo "    xemacs will be linked with \"gpmevent.o\""
11157  fi
11158     LIBS="-lgpm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgpm\" to \$LIBS"; fi
11159   fi
11160
11161 else   for feature in ncurses gpm; do
11162     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
11163       echo "configure: warning: "--with-${feature} ignored:  Not valid without TTY support"" 1>&2
11164     fi
11165     eval "with_${feature}=no"
11166   done
11167 fi 
11168 test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" &&  if test "$extra_verbose" = "yes"; then
11169    echo "    xemacs will be linked with \"event-unixoid.o\""
11170  fi
11171
11172
11173 test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11174   != "no no no" && echo "checking for database support" 1>&6
11175 echo "configure:11176: checking for database support" >&5
11176
11177 if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
11178   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
11179 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
11180 echo "configure:11181: checking for ndbm.h" >&5
11181
11182 cat > conftest.$ac_ext <<EOF
11183 #line 11184 "configure"
11184 #include "confdefs.h"
11185 #include <ndbm.h>
11186 EOF
11187 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11188 { (eval echo configure:11189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11189 ac_err=`grep -v '^ *+' conftest.out`
11190 if test -z "$ac_err"; then
11191   rm -rf conftest*
11192   eval "ac_cv_header_$ac_safe=yes"
11193 else
11194   echo "$ac_err" >&5
11195   echo "configure: failed program was:" >&5
11196   cat conftest.$ac_ext >&5
11197   rm -rf conftest*
11198   eval "ac_cv_header_$ac_safe=no"
11199 fi
11200 rm -f conftest*
11201 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11202   echo "$ac_t""yes" 1>&6
11203   :
11204 else
11205   echo "$ac_t""no" 1>&6
11206
11207     test "$with_database_gnudbm" = "yes" -o \
11208          "$with_database_dbm"    = "yes" && \
11209       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11210     with_database_gnudbm=no with_database_dbm=no
11211 fi
11212
11213 fi
11214
11215 if test "$with_database_gnudbm" != "no"; then
11216   
11217 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
11218 echo "configure:11219: checking for dbm_open in -lgdbm" >&5
11219 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
11220
11221 xe_check_libs=" -lgdbm "
11222 cat > conftest.$ac_ext <<EOF
11223 #line 11224 "configure"
11224 #include "confdefs.h"
11225 /* Override any gcc2 internal prototype to avoid an error.  */
11226 /* We use char because int might match the return type of a gcc2
11227     builtin and then its argument prototype would still apply.  */
11228 char dbm_open();
11229
11230 int main() {
11231 dbm_open()
11232 ; return 0; }
11233 EOF
11234 if { (eval echo configure:11235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11235   rm -rf conftest*
11236   eval "ac_cv_lib_$ac_lib_var=yes"
11237 else
11238   echo "configure: failed program was:" >&5
11239   cat conftest.$ac_ext >&5
11240   rm -rf conftest*
11241   eval "ac_cv_lib_$ac_lib_var=no"
11242 fi
11243 rm -f conftest*
11244 xe_check_libs=""
11245
11246 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11247   echo "$ac_t""yes" 1>&6
11248   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
11249 else
11250   echo "$ac_t""no" 1>&6
11251 if test "$with_database_gnudbm" = "yes"; then
11252      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
11253    fi
11254    with_database_gnudbm=no
11255 fi
11256
11257
11258 fi
11259
11260 if test "$with_database_dbm" != "no"; then
11261   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
11262 echo "configure:11263: checking for dbm_open" >&5
11263
11264 cat > conftest.$ac_ext <<EOF
11265 #line 11266 "configure"
11266 #include "confdefs.h"
11267 /* System header to define __stub macros and hopefully few prototypes,
11268     which can conflict with char dbm_open(); below.  */
11269 #include <assert.h>
11270 /* Override any gcc2 internal prototype to avoid an error.  */
11271 /* We use char because int might match the return type of a gcc2
11272     builtin and then its argument prototype would still apply.  */
11273 char dbm_open();
11274
11275 int main() {
11276
11277 /* The GNU C library defines this for functions which it implements
11278     to always fail with ENOSYS.  Some functions are actually named
11279     something starting with __ and the normal name is an alias.  */
11280 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
11281 choke me
11282 #else
11283 dbm_open();
11284 #endif
11285
11286 ; return 0; }
11287 EOF
11288 if { (eval echo configure:11289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11289   rm -rf conftest*
11290   eval "ac_cv_func_dbm_open=yes"
11291 else
11292   echo "configure: failed program was:" >&5
11293   cat conftest.$ac_ext >&5
11294   rm -rf conftest*
11295   eval "ac_cv_func_dbm_open=no"
11296 fi
11297 rm -f conftest*
11298
11299 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
11300   echo "$ac_t""yes" 1>&6
11301   with_database_dbm=yes libdbm=
11302 else
11303   echo "$ac_t""no" 1>&6
11304
11305     
11306 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
11307 echo "configure:11308: checking for dbm_open in -ldbm" >&5
11308 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
11309
11310 xe_check_libs=" -ldbm "
11311 cat > conftest.$ac_ext <<EOF
11312 #line 11313 "configure"
11313 #include "confdefs.h"
11314 /* Override any gcc2 internal prototype to avoid an error.  */
11315 /* We use char because int might match the return type of a gcc2
11316     builtin and then its argument prototype would still apply.  */
11317 char dbm_open();
11318
11319 int main() {
11320 dbm_open()
11321 ; return 0; }
11322 EOF
11323 if { (eval echo configure:11324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11324   rm -rf conftest*
11325   eval "ac_cv_lib_$ac_lib_var=yes"
11326 else
11327   echo "configure: failed program was:" >&5
11328   cat conftest.$ac_ext >&5
11329   rm -rf conftest*
11330   eval "ac_cv_lib_$ac_lib_var=no"
11331 fi
11332 rm -f conftest*
11333 xe_check_libs=""
11334
11335 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11336   echo "$ac_t""yes" 1>&6
11337   with_database_dbm=yes libdbm=-ldbm
11338 else
11339   echo "$ac_t""no" 1>&6
11340 test "$with_database_dbm" = "yes" && \
11341         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
11342       with_database_dbm=no
11343 fi
11344
11345
11346 fi
11347
11348 fi
11349
11350 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
11351 test "$with_database_gnudbm" = "yes" -o \
11352      "$with_database_dbm"    = "yes" && \
11353   { test "$extra_verbose" = "yes" && cat << \EOF
11354     Defining HAVE_DBM
11355 EOF
11356 cat >> confdefs.h <<\EOF
11357 #define HAVE_DBM 1
11358 EOF
11359 }
11360
11361
11362 if test "$with_database_berkdb" != "no"; then
11363   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
11364 echo "configure:11365: checking for Berkeley db.h" >&5
11365   for path in "db/db.h" "db.h"; do
11366     cat > conftest.$ac_ext <<EOF
11367 #line 11368 "configure"
11368 #include "confdefs.h"
11369 #ifdef HAVE_INTTYPES_H
11370 #define __BIT_TYPES_DEFINED__
11371 #include <inttypes.h>
11372 typedef uint8_t  u_int8_t;
11373 typedef uint16_t u_int16_t;
11374 typedef uint32_t u_int32_t;
11375 #ifdef WE_DONT_NEED_QUADS
11376 typedef uint64_t u_int64_t;
11377 #endif
11378 #endif
11379 #include <$path>
11380
11381 int main() {
11382
11383 ; return 0; }
11384 EOF
11385 if { (eval echo configure:11386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11386   rm -rf conftest*
11387   db_h_path="$path"; break
11388 else
11389   echo "configure: failed program was:" >&5
11390   cat conftest.$ac_ext >&5
11391 fi
11392 rm -f conftest*
11393   done
11394   if test -z "$db_h_path"
11395   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
11396   else echo "$ac_t""$db_h_path" 1>&6
11397   fi
11398
11399   if test "$with_database_berkdb" != "no"; then
11400     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
11401 echo "configure:11402: checking for Berkeley DB version" >&5
11402     cat > conftest.$ac_ext <<EOF
11403 #line 11404 "configure"
11404 #include "confdefs.h"
11405 #include <$db_h_path>
11406 #if DB_VERSION_MAJOR > 1
11407 yes
11408 #endif
11409
11410 EOF
11411 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11412   egrep "yes" >/dev/null 2>&1; then
11413   rm -rf conftest*
11414   echo "$ac_t""2" 1>&6; dbfunc=db_open
11415 else
11416   rm -rf conftest*
11417   echo "$ac_t""1" 1>&6; dbfunc=dbopen
11418 fi
11419 rm -f conftest*
11420
11421     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
11422 echo "configure:11423: checking for $dbfunc" >&5
11423
11424 cat > conftest.$ac_ext <<EOF
11425 #line 11426 "configure"
11426 #include "confdefs.h"
11427 /* System header to define __stub macros and hopefully few prototypes,
11428     which can conflict with char $dbfunc(); below.  */
11429 #include <assert.h>
11430 /* Override any gcc2 internal prototype to avoid an error.  */
11431 /* We use char because int might match the return type of a gcc2
11432     builtin and then its argument prototype would still apply.  */
11433 char $dbfunc();
11434
11435 int main() {
11436
11437 /* The GNU C library defines this for functions which it implements
11438     to always fail with ENOSYS.  Some functions are actually named
11439     something starting with __ and the normal name is an alias.  */
11440 #if defined (__stub_$dbfunc) || defined (__stub___$dbfunc)
11441 choke me
11442 #else
11443 $dbfunc();
11444 #endif
11445
11446 ; return 0; }
11447 EOF
11448 if { (eval echo configure:11449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11449   rm -rf conftest*
11450   eval "ac_cv_func_$dbfunc=yes"
11451 else
11452   echo "configure: failed program was:" >&5
11453   cat conftest.$ac_ext >&5
11454   rm -rf conftest*
11455   eval "ac_cv_func_$dbfunc=no"
11456 fi
11457 rm -f conftest*
11458
11459 if eval "test \"`echo '$ac_cv_func_'$dbfunc`\" = yes"; then
11460   echo "$ac_t""yes" 1>&6
11461   with_database_berkdb=yes need_libdb=no
11462 else
11463   echo "$ac_t""no" 1>&6
11464
11465     
11466 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
11467 echo "configure:11468: checking for $dbfunc in -ldb" >&5
11468 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
11469
11470 xe_check_libs=" -ldb "
11471 cat > conftest.$ac_ext <<EOF
11472 #line 11473 "configure"
11473 #include "confdefs.h"
11474 /* Override any gcc2 internal prototype to avoid an error.  */
11475 /* We use char because int might match the return type of a gcc2
11476     builtin and then its argument prototype would still apply.  */
11477 char $dbfunc();
11478
11479 int main() {
11480 $dbfunc()
11481 ; return 0; }
11482 EOF
11483 if { (eval echo configure:11484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11484   rm -rf conftest*
11485   eval "ac_cv_lib_$ac_lib_var=yes"
11486 else
11487   echo "configure: failed program was:" >&5
11488   cat conftest.$ac_ext >&5
11489   rm -rf conftest*
11490   eval "ac_cv_lib_$ac_lib_var=no"
11491 fi
11492 rm -f conftest*
11493 xe_check_libs=""
11494
11495 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11496   echo "$ac_t""yes" 1>&6
11497   with_database_berkdb=yes need_libdb=yes
11498 else
11499   echo "$ac_t""no" 1>&6
11500 fi
11501
11502
11503 fi
11504
11505   fi
11506
11507   if test "$with_database_berkdb" = "yes"; then
11508     { test "$extra_verbose" = "yes" && cat << EOF
11509     Defining DB_H_PATH = "$db_h_path"
11510 EOF
11511 cat >> confdefs.h <<EOF
11512 #define DB_H_PATH "$db_h_path"
11513 EOF
11514 }
11515
11516     { test "$extra_verbose" = "yes" && cat << \EOF
11517     Defining HAVE_BERKELEY_DB
11518 EOF
11519 cat >> confdefs.h <<\EOF
11520 #define HAVE_BERKELEY_DB 1
11521 EOF
11522 }
11523
11524     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
11525   else with_database_berkdb=no
11526   fi
11527 fi
11528
11529 if test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
11530      != "no no no"; then
11531   { test "$extra_verbose" = "yes" && cat << \EOF
11532     Defining HAVE_DATABASE
11533 EOF
11534 cat >> confdefs.h <<\EOF
11535 #define HAVE_DATABASE 1
11536 EOF
11537 }
11538
11539   extra_objs="$extra_objs database.o" &&  if test "$extra_verbose" = "yes"; then
11540    echo "    xemacs will be linked with \"database.o\""
11541  fi
11542 fi
11543
11544 if test "$with_socks" = "yes"; then
11545   
11546 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
11547 echo "configure:11548: checking for SOCKSinit in -lsocks" >&5
11548 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
11549
11550 xe_check_libs=" -lsocks "
11551 cat > conftest.$ac_ext <<EOF
11552 #line 11553 "configure"
11553 #include "confdefs.h"
11554 /* Override any gcc2 internal prototype to avoid an error.  */
11555 /* We use char because int might match the return type of a gcc2
11556     builtin and then its argument prototype would still apply.  */
11557 char SOCKSinit();
11558
11559 int main() {
11560 SOCKSinit()
11561 ; return 0; }
11562 EOF
11563 if { (eval echo configure:11564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11564   rm -rf conftest*
11565   eval "ac_cv_lib_$ac_lib_var=yes"
11566 else
11567   echo "configure: failed program was:" >&5
11568   cat conftest.$ac_ext >&5
11569   rm -rf conftest*
11570   eval "ac_cv_lib_$ac_lib_var=no"
11571 fi
11572 rm -f conftest*
11573 xe_check_libs=""
11574
11575 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11576   echo "$ac_t""yes" 1>&6
11577     ac_tr_lib=HAVE_LIB`echo socks | sed -e 's/[^a-zA-Z0-9_]/_/g' \
11578     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
11579   { test "$extra_verbose" = "yes" && cat << EOF
11580     Defining $ac_tr_lib
11581 EOF
11582 cat >> confdefs.h <<EOF
11583 #define $ac_tr_lib 1
11584 EOF
11585 }
11586
11587   LIBS="-lsocks $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lsocks\" to \$LIBS"; fi
11588
11589 else
11590   echo "$ac_t""no" 1>&6
11591 fi
11592
11593
11594   test -n "$ac_cv_lib_socks_SOCKSinit" && { test "$extra_verbose" = "yes" && cat << \EOF
11595     Defining HAVE_SOCKS
11596 EOF
11597 cat >> confdefs.h <<\EOF
11598 #define HAVE_SOCKS 1
11599 EOF
11600 }
11601
11602 fi
11603
11604 if test "$usage_tracking" = "yes"; then
11605   { test "$extra_verbose" = "yes" && cat << \EOF
11606     Defining USAGE_TRACKING
11607 EOF
11608 cat >> confdefs.h <<\EOF
11609 #define USAGE_TRACKING 1
11610 EOF
11611 }
11612
11613   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
11614 fi
11615
11616 for ac_hdr in dlfcn.h
11617 do
11618 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11619 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11620 echo "configure:11621: checking for $ac_hdr" >&5
11621
11622 cat > conftest.$ac_ext <<EOF
11623 #line 11624 "configure"
11624 #include "confdefs.h"
11625 #include <$ac_hdr>
11626 EOF
11627 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11628 { (eval echo configure:11629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11629 ac_err=`grep -v '^ *+' conftest.out`
11630 if test -z "$ac_err"; then
11631   rm -rf conftest*
11632   eval "ac_cv_header_$ac_safe=yes"
11633 else
11634   echo "$ac_err" >&5
11635   echo "configure: failed program was:" >&5
11636   cat conftest.$ac_ext >&5
11637   rm -rf conftest*
11638   eval "ac_cv_header_$ac_safe=no"
11639 fi
11640 rm -f conftest*
11641 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11642   echo "$ac_t""yes" 1>&6
11643     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11644   { test "$extra_verbose" = "yes" && cat << EOF
11645     Defining $ac_tr_hdr
11646 EOF
11647 cat >> confdefs.h <<EOF
11648 #define $ac_tr_hdr 1
11649 EOF
11650 }
11651  have_dlfcn=yes
11652   { test "$extra_verbose" = "yes" && cat << \EOF
11653     Defining HAVE_DLFCN_H
11654 EOF
11655 cat >> confdefs.h <<\EOF
11656 #define HAVE_DLFCN_H 1
11657 EOF
11658 }
11659
11660 else
11661   echo "$ac_t""no" 1>&6
11662 fi
11663 done
11664
11665 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11666 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
11667 echo "configure:11668: checking for dlopen in -ldl" >&5
11668 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
11669
11670 xe_check_libs=" -ldl "
11671 cat > conftest.$ac_ext <<EOF
11672 #line 11673 "configure"
11673 #include "confdefs.h"
11674 /* Override any gcc2 internal prototype to avoid an error.  */
11675 /* We use char because int might match the return type of a gcc2
11676     builtin and then its argument prototype would still apply.  */
11677 char dlopen();
11678
11679 int main() {
11680 dlopen()
11681 ; return 0; }
11682 EOF
11683 if { (eval echo configure:11684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11684   rm -rf conftest*
11685   eval "ac_cv_lib_$ac_lib_var=yes"
11686 else
11687   echo "configure: failed program was:" >&5
11688   cat conftest.$ac_ext >&5
11689   rm -rf conftest*
11690   eval "ac_cv_lib_$ac_lib_var=no"
11691 fi
11692 rm -f conftest*
11693 xe_check_libs=""
11694
11695 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11696   echo "$ac_t""yes" 1>&6
11697   { test "$extra_verbose" = "yes" && cat << \EOF
11698     Defining HAVE_DLOPEN
11699 EOF
11700 cat >> confdefs.h <<\EOF
11701 #define HAVE_DLOPEN 1
11702 EOF
11703 }
11704  DLL_LIB=dl;  with_shlib=yes
11705 else
11706   echo "$ac_t""no" 1>&6
11707 fi
11708
11709  }
11710 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11711 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
11712 echo "configure:11713: checking for _dlopen in -lc" >&5
11713 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
11714
11715 xe_check_libs=" -lc "
11716 cat > conftest.$ac_ext <<EOF
11717 #line 11718 "configure"
11718 #include "confdefs.h"
11719 /* Override any gcc2 internal prototype to avoid an error.  */
11720 /* We use char because int might match the return type of a gcc2
11721     builtin and then its argument prototype would still apply.  */
11722 char _dlopen();
11723
11724 int main() {
11725 _dlopen()
11726 ; return 0; }
11727 EOF
11728 if { (eval echo configure:11729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11729   rm -rf conftest*
11730   eval "ac_cv_lib_$ac_lib_var=yes"
11731 else
11732   echo "configure: failed program was:" >&5
11733   cat conftest.$ac_ext >&5
11734   rm -rf conftest*
11735   eval "ac_cv_lib_$ac_lib_var=no"
11736 fi
11737 rm -f conftest*
11738 xe_check_libs=""
11739
11740 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11741   echo "$ac_t""yes" 1>&6
11742   { test "$extra_verbose" = "yes" && cat << \EOF
11743     Defining HAVE_DLOPEN
11744 EOF
11745 cat >> confdefs.h <<\EOF
11746 #define HAVE_DLOPEN 1
11747 EOF
11748 }
11749  DLL_LIB=;   with_shlib=yes
11750 else
11751   echo "$ac_t""no" 1>&6
11752 fi
11753
11754  }
11755 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
11756 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
11757 echo "configure:11758: checking for dlopen in -lc" >&5
11758 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
11759
11760 xe_check_libs=" -lc "
11761 cat > conftest.$ac_ext <<EOF
11762 #line 11763 "configure"
11763 #include "confdefs.h"
11764 /* Override any gcc2 internal prototype to avoid an error.  */
11765 /* We use char because int might match the return type of a gcc2
11766     builtin and then its argument prototype would still apply.  */
11767 char dlopen();
11768
11769 int main() {
11770 dlopen()
11771 ; return 0; }
11772 EOF
11773 if { (eval echo configure:11774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11774   rm -rf conftest*
11775   eval "ac_cv_lib_$ac_lib_var=yes"
11776 else
11777   echo "configure: failed program was:" >&5
11778   cat conftest.$ac_ext >&5
11779   rm -rf conftest*
11780   eval "ac_cv_lib_$ac_lib_var=no"
11781 fi
11782 rm -f conftest*
11783 xe_check_libs=""
11784
11785 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11786   echo "$ac_t""yes" 1>&6
11787   { test "$extra_verbose" = "yes" && cat << \EOF
11788     Defining HAVE_DLOPEN
11789 EOF
11790 cat >> confdefs.h <<\EOF
11791 #define HAVE_DLOPEN 1
11792 EOF
11793 }
11794  DLL_LIB=;   with_shlib=yes
11795 else
11796   echo "$ac_t""no" 1>&6
11797 fi
11798
11799  }
11800 test -z "$with_shlib" && { 
11801 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
11802 echo "configure:11803: checking for shl_load in -ldld" >&5
11803 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
11804
11805 xe_check_libs=" -ldld "
11806 cat > conftest.$ac_ext <<EOF
11807 #line 11808 "configure"
11808 #include "confdefs.h"
11809 /* Override any gcc2 internal prototype to avoid an error.  */
11810 /* We use char because int might match the return type of a gcc2
11811     builtin and then its argument prototype would still apply.  */
11812 char shl_load();
11813
11814 int main() {
11815 shl_load()
11816 ; return 0; }
11817 EOF
11818 if { (eval echo configure:11819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11819   rm -rf conftest*
11820   eval "ac_cv_lib_$ac_lib_var=yes"
11821 else
11822   echo "configure: failed program was:" >&5
11823   cat conftest.$ac_ext >&5
11824   rm -rf conftest*
11825   eval "ac_cv_lib_$ac_lib_var=no"
11826 fi
11827 rm -f conftest*
11828 xe_check_libs=""
11829
11830 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11831   echo "$ac_t""yes" 1>&6
11832   { test "$extra_verbose" = "yes" && cat << \EOF
11833     Defining HAVE_SHL_LOAD
11834 EOF
11835 cat >> confdefs.h <<\EOF
11836 #define HAVE_SHL_LOAD 1
11837 EOF
11838 }
11839  DLL_LIB=dld; with_shlib=yes
11840 else
11841   echo "$ac_t""no" 1>&6
11842 fi
11843
11844  }
11845 test -z "$with_shlib" && { 
11846 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
11847 echo "configure:11848: checking for dld_init in -ldld" >&5
11848 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
11849
11850 xe_check_libs=" -ldld "
11851 cat > conftest.$ac_ext <<EOF
11852 #line 11853 "configure"
11853 #include "confdefs.h"
11854 /* Override any gcc2 internal prototype to avoid an error.  */
11855 /* We use char because int might match the return type of a gcc2
11856     builtin and then its argument prototype would still apply.  */
11857 char dld_init();
11858
11859 int main() {
11860 dld_init()
11861 ; return 0; }
11862 EOF
11863 if { (eval echo configure:11864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
11864   rm -rf conftest*
11865   eval "ac_cv_lib_$ac_lib_var=yes"
11866 else
11867   echo "configure: failed program was:" >&5
11868   cat conftest.$ac_ext >&5
11869   rm -rf conftest*
11870   eval "ac_cv_lib_$ac_lib_var=no"
11871 fi
11872 rm -f conftest*
11873 xe_check_libs=""
11874
11875 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
11876   echo "$ac_t""yes" 1>&6
11877   { test "$extra_verbose" = "yes" && cat << \EOF
11878     Defining HAVE_DLD_INIT
11879 EOF
11880 cat >> confdefs.h <<\EOF
11881 #define HAVE_DLD_INIT 1
11882 EOF
11883 }
11884  DLL_LIB=dld; with_shlib=yes
11885 else
11886   echo "$ac_t""no" 1>&6
11887 fi
11888
11889  }
11890 if test "$with_shlib" = "yes"; then
11891   
11892 dll_ld=
11893 dll_ldflags=
11894 dll_cflags=
11895 dll_post=
11896 dll_ldo="-o"
11897 ld_dynamic_link_flags=
11898 xehost=$canonical
11899 xealias=$internal_configuration
11900
11901 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
11902 echo "configure:11903: checking how to build dynamic libraries for ${xehost}" >&5
11903 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
11904 case "$xehost" in
11905 *-*-linux-gnu*) ;;
11906 *-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
11907 esac
11908
11909 xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
11910 xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
11911 xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
11912
11913 case "$xehost_os" in
11914 aix3*)
11915   # AIX sometimes has problems with the GCC collect2 program.  For some
11916   # reason, if we set the COLLECT_NAMES environment variable, the problems
11917   # vanish in a puff of smoke.
11918   if test "${COLLECT_NAMES+set}" != set; then
11919     COLLECT_NAMES=
11920     export COLLECT_NAMES
11921   fi
11922   ;;
11923 esac
11924
11925 # Now see if the compiler is really GCC.
11926 if test "$GCC" = "yes"; then
11927   XEGCC=yes
11928 else
11929   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
11930 echo "configure:11931: checking checking whether we are using GNU C" >&5
11931   cat > conftest.$ac_ext <<EOF
11932 #line 11933 "configure"
11933 #include "confdefs.h"
11934
11935 #ifdef __GNUC__
11936   yes;
11937 #endif
11938
11939 EOF
11940 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11941   egrep "yes" >/dev/null 2>&1; then
11942   rm -rf conftest*
11943   XEGCC=yes
11944 else
11945   rm -rf conftest*
11946   XEGCC=no
11947 fi
11948 rm -f conftest*
11949
11950   echo "$ac_t""${XEGCC}" 1>&6
11951 fi
11952
11953 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
11954 echo "configure:11955: checking how to produce PIC code" >&5
11955 wl=
11956
11957 can_build_shared=yes
11958 if test "$XEGCC" = yes; then
11959   wl='-Wl,'
11960
11961   case "$xehost_os" in
11962   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
11963     # PIC is the default for these OSes.
11964     ;;
11965
11966   os2*)
11967     # We can build DLLs from non-PIC.
11968     ;;
11969   amigaos*)
11970     # FIXME: we need at least 68020 code to build shared libraries, but
11971     # adding the `-m68020' flag to GCC prevents building anything better,
11972     # like `-m68040'.
11973     dll_cflags='-m68020 -resident32 -malways-restore-a4'
11974     ;;
11975   *)
11976     dll_cflags='-fPIC'
11977     ;;
11978   esac
11979 else
11980   # PORTME Check for PIC flags for the system compiler.
11981   case "$xehost_os" in
11982   hpux9* | hpux10*)
11983     # Is there a better link_static_flag that works with the bundled CC?
11984     wl='-Wl,'
11985     dll_cflags='+Z'
11986     ;;
11987
11988   irix5* | irix6*)
11989     wl='-Wl,'
11990     # PIC (with -KPIC) is the default.
11991     ;;
11992
11993   os2*)
11994     # We can build DLLs from non-PIC.
11995     ;;
11996
11997   osf3* | osf4*)
11998     # All OSF/1 code is PIC.
11999     wl='-Wl,'
12000     ;;
12001
12002   sco3.2v5*)
12003     dll_cflags='-belf -Kpic'
12004     wl='-Wl,'
12005     ;;
12006
12007   unixware*)
12008     dll_cflags="-KPIC"
12009     wl="-Wl,"
12010     ;;
12011
12012   sysv4*)
12013     dll_cflags="-KPIC"
12014     wl="-Wl,"
12015     ;;
12016
12017   sysv5*)
12018     dll_cflags="-KPIC"
12019     wl="-Wl,"
12020     ;;
12021
12022   solaris2*)
12023     dll_cflags='-KPIC'
12024     wl='-Wl,'
12025     ;;
12026
12027   sunos4*)
12028     dll_cflags='-PIC'
12029     wl='-Qoption ld '
12030     ;;
12031
12032   uts4*)
12033     dll_cflags='-pic'
12034     ;;
12035
12036   *)
12037     can_build_shared=no
12038     ;;
12039   esac
12040 fi
12041
12042 if test -n "$dll_cflags"; then
12043   echo "$ac_t""${dll_cflags}" 1>&6
12044   
12045   # Check to make sure the dll_cflags actually works.
12046   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
12047 echo "configure:12048: checking if PIC flag ${dll_cflags} really works" >&5
12048   save_CFLAGS="$CFLAGS"
12049   CFLAGS="$CFLAGS $dll_cflags -DPIC"
12050   cat > conftest.$ac_ext <<EOF
12051 #line 12052 "configure"
12052 #include "confdefs.h"
12053
12054 int main() {
12055 int x=0;
12056 ; return 0; }
12057 EOF
12058 if { (eval echo configure:12059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12059   rm -rf conftest*
12060   
12061     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
12062     # reports no error.  So, we need to grep stderr for (Bundled).
12063     if grep '(Bundled)' config.log >/dev/null; then
12064       echo "$ac_t""no" 1>&6
12065       can_build_shared=no
12066       dll_cflags=
12067     else
12068       echo "$ac_t""yes" 1>&6
12069     fi
12070 else
12071   echo "configure: failed program was:" >&5
12072   cat conftest.$ac_ext >&5
12073   rm -rf conftest*
12074   echo "$ac_t""no" 1>&6
12075     can_build_shared=no
12076     dll_cflags=
12077 fi
12078 rm -f conftest*
12079   CFLAGS="$save_CFLAGS"
12080 else
12081   echo "$ac_t""none" 1>&6
12082 fi
12083
12084 if test "$can_build_shared" = "yes"; then
12085 cc_produces_so=no
12086 xldf=
12087 xcldf=
12088 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
12089 echo "configure:12090: checking if C compiler can produce shared libraries" >&5
12090 if test "$XEGCC" = yes; then
12091   xcldf="-shared"
12092   xldf="-shared"
12093 else # Not using GCC
12094   case "$xehost_os" in
12095     aix3* | aix4*)
12096       xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
12097       xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
12098       ;;
12099
12100     freebsd2* | netbsd* | openbsd*)
12101       xldf="-Bshareable"
12102       xcldf="${wl}-Bshareable"
12103       ;;
12104
12105     freebsd3*)
12106       xcldf="-shared"
12107       ;;
12108
12109     hpux*)
12110       xldf="-b +s"
12111       xcldf="${wl}-b ${wl}+s"
12112       ;;
12113
12114     irix5* | irix6* | osf3* | osf4*)
12115       xcldf="${wl}-shared"
12116       xldf="-shared"
12117       ;;
12118
12119     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
12120       xcldf="-G"
12121       xldf="-G"
12122       ;;
12123
12124     sunos4*)
12125       xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
12126       xldf="-assert pure-text -Bstatic"
12127       ;;
12128   esac
12129 fi # End if if we are using gcc
12130
12131 if test -n "$xcldf"; then
12132   save_LDFLAGS=$LDFLAGS
12133   save_LIBS=$LIBS
12134   save_xe_libs=$xe_libs
12135   LDFLAGS="$xcldf $LDFLAGS"
12136   LIBS=
12137   xe_libs=
12138   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12139   cat > conftest.$ac_ext <<EOF
12140 #line 12141 "configure"
12141 #include "confdefs.h"
12142
12143 int main() {
12144 int x=0;
12145 ; return 0; }
12146 EOF
12147 if { (eval echo configure:12148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12148   rm -rf conftest*
12149   cc_produces_so=yes
12150 else
12151   echo "configure: failed program was:" >&5
12152   cat conftest.$ac_ext >&5
12153   rm -rf conftest*
12154   cc_produces_so=no
12155 fi
12156 rm -f conftest*
12157   LDFLAGS=$save_LDFLAGS
12158   LIBS=$save_LIBS
12159   xe_libs=$save_xe_libs
12160   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
12161 else
12162   cc_produces_so=no
12163 fi
12164 echo "$ac_t""${cc_produces_so}" 1>&6
12165
12166 LTLD=$LD
12167 if test -z "$LTLD"; then
12168   ac_prog=ld
12169   if test "$XEGCC" = yes; then
12170     # Check if gcc -print-prog-name=ld gives a path.
12171     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
12172 echo "configure:12173: checking for ld used by GCC" >&5
12173     ac_prog=`($CC -print-prog-name=ld) 2>&5`
12174     case "$ac_prog" in
12175     # Accept absolute paths.
12176     /*)
12177       if test -z "$LTLD"; then
12178         case "$ac_prog" in
12179           *gcc-lib*) LTLD="$CC"
12180                      ;;
12181           *)         LTLD="$ac_prog"
12182                      ;;
12183         esac
12184       fi
12185       ;;
12186     "")
12187       # If it fails, then pretend we aren't using GCC.
12188       ac_prog=ld
12189       ;;
12190     *)
12191       # If it is relative, then search for the first ld in PATH.
12192       with_gnu_ld=unknown
12193       ;;
12194     esac
12195   else
12196     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
12197 echo "configure:12198: checking for GNU ld" >&5
12198   fi
12199
12200   if test -z "$LTLD"; then
12201     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
12202     for ac_dir in $PATH; do
12203       test -z "$ac_dir" && ac_dir=.
12204       if test -f "$ac_dir/$ac_prog"; then
12205         LTLD="$ac_dir/$ac_prog"
12206         # Check to see if the program is GNU ld.  I'd rather use --version,
12207         # but apparently some GNU ld's only accept -v.
12208         # Break only if it was the GNU/non-GNU ld that we prefer.
12209         if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
12210           xe_gnu_ld=yes
12211         else
12212           xe_gnu_ld=no
12213         fi
12214       fi
12215     done
12216     IFS="$ac_save_ifs"
12217   fi
12218
12219   if test -n "$LTLD"; then
12220     echo "$ac_t""${LTLD}" 1>&6
12221   else
12222     echo "$ac_t""no" 1>&6
12223   fi
12224
12225   if test -z "$LTLD" -a "$cc_produces_so" = no; then
12226     { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
12227     exit 1
12228   fi
12229 fi
12230
12231 ld_dynamic_link_flags=
12232
12233 # Check to see if it really is or isn't GNU ld.
12234 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
12235 echo "configure:12236: checking if the linker is GNU ld" >&5
12236 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
12237 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
12238   xe_gnu_ld=yes
12239 else
12240   xe_gnu_ld=no
12241 fi
12242 echo "$ac_t""${xe_gnu_ld}" 1>&6
12243
12244 case "$xehost_os" in
12245   amigaos* | sunos4*)
12246     # On these operating systems, we should treat GNU ld like the system ld.
12247     gnu_ld_acts_native=yes
12248     ;;
12249   *)
12250     gnu_ld_acts_native=no
12251     ;;
12252 esac
12253
12254 if test "$cc_produces_so" = "yes"; then
12255   dll_ld=$CC
12256   dll_ldflags=$xcldf
12257   can_build_shared=yes
12258 else
12259   # OK - only NOW do we futz about with ld.
12260   # See if the linker supports building shared libraries.
12261   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
12262 echo "configure:12263: checking whether the linker supports shared libraries" >&5
12263   dll_ld=$CC
12264   dll_ldflags=$LDFLAGS
12265   ld_shlibs=yes
12266   can_build_shared=yes
12267   if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
12268     # See if GNU ld supports shared libraries.
12269     if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
12270       dll_ld=$CC
12271       dll_ldflags="-shared"
12272       ld_shlibs=yes
12273     else
12274       ld_shlibs=no
12275     fi
12276   else
12277     # PORTME fill in a description of your system's linker (not GNU ld)
12278     case "$xehost_os" in
12279     aix3*)
12280       dll_ld=$LTLD
12281       dll_ldflags=$xldf
12282       ;;
12283
12284     aix4*)
12285       dll_ldflags=$xcldf
12286       ;;
12287
12288     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
12289     # support.  Future versions do this automatically, but an explicit c++rt0.o
12290     # doesn't break anything, and helps significantly (at the cost of a little
12291     # extra space).
12292     freebsd2.2*)
12293       dll_ld=$LTLD
12294       dll_ldflags=$xldf
12295       dll_post="/usr/lib/c++rt0.o"
12296       ;;
12297
12298     # Unfortunately, older versions of FreeBSD 2 don't have this feature.
12299     freebsd2*)
12300       dll_ld=$LTLD
12301       dll_ldflags="-Bshareable"
12302       ;;
12303
12304     # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
12305     freebsd3*)
12306       dll_ldflags="-shared"
12307       ;;
12308
12309     hpux*)
12310       dll_ld=$LTLD
12311       dll_ldflags=$xldf
12312       ;;
12313
12314     irix5* | irix6*)
12315       dll_ld=$LTLD
12316       dll_ldflags=$xldf
12317       ;;
12318
12319     netbsd*)
12320       # Tested with NetBSD 1.2 ld
12321       dll_ld=$LTLD
12322       dll_ldflags=$xldf
12323       ;;
12324
12325     openbsd*)
12326       dll_ld=$LTLD
12327       dll_ldflags=$xldf
12328       ;;
12329
12330     osf3* | osf4*)
12331       dll_ld=$LTLD
12332       dll_ldflags=$xldf
12333       ;;
12334
12335     # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
12336     sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
12337       dll_ld=$LTLD
12338       case "$dll_ld" in
12339         *gcc*) dll_ldflags="-shared"
12340                dll_ld=$CC
12341                ;;
12342         *)     dll_ldflags="-G"
12343                ;;
12344       esac
12345       ;;
12346
12347     sunos4*)
12348       if test "$XEGCC" = yes; then
12349         dll_ld=$CC
12350       else
12351         dll_ld=$LTLD
12352       fi
12353       dll_ldflags=$xldf
12354       ;;
12355
12356     uts4*)
12357       dll_ld=$LTLD
12358       dll_ldflags="-G"
12359       ;;
12360
12361     bsdi*)
12362       dll_ldflags="-r"
12363       dll_ld="shlicc2"
12364       ;;
12365
12366     *)
12367       ld_shlibs=no
12368       can_build_shared=no
12369       ;;
12370     esac
12371   fi
12372   echo "$ac_t""${ld_shlibs}" 1>&6
12373   if test "$ld_shlibs" = "no"; then
12374     can_build_shared=no
12375   fi
12376 fi # End of if cc_produces_so = no
12377
12378
12379 if test "$xe_gnu_ld" = yes; then
12380   if test "$ld_shlibs" = yes; then
12381     ld_dynamic_link_flags="${wl}-export-dynamic"
12382   fi
12383 fi
12384
12385 if test -z "$ld_dynamic_link_flags"; then
12386   case "$xehost_os" in
12387   aix3*)
12388     ld_dynamic_link_flags=
12389     ;;
12390
12391   aix4*)
12392     ld_dynamic_link_flags=
12393     ;;
12394
12395   freebsd2.2*)
12396     ld_dynamic_link_flags=
12397     ;;
12398
12399   freebsd2*)
12400     ld_dynamic_link_flags=
12401     ;;
12402
12403   freebsd3*)
12404     ld_dynamic_link_flags=
12405     ;;
12406
12407   hpux*)
12408     ld_dynamic_link_flags="${wl}-E"
12409     ;;
12410
12411   irix5* | irix6*)
12412     ld_dynamic_link_flags=
12413     ;;
12414
12415   netbsd*)
12416     ld_dynamic_link_flags=
12417     ;;
12418
12419   openbsd*)
12420     ld_dynamic_link_flags=
12421     ;;
12422
12423   osf3* | osf4*)
12424     ld_dynamic_link_flags=
12425     ;;
12426
12427   solaris2* | solaris7*)
12428     ld_dynamic_link_flags="${wl}-Bdynamic"
12429     ;;
12430
12431   sco3.2v5* | unixware* | sysv5* | sysv4*)
12432     ld_dynamic_link_flags="${wl}-Bexport"
12433     ;;
12434
12435   sunos4*)
12436     ld_dynamic_link_flags=
12437     ;;
12438
12439   uts4*)
12440     ld_dynamic_link_flags=
12441     ;;
12442
12443   bsdi*)
12444     ld_dynamic_link_flags=
12445     ;;
12446
12447   esac
12448 fi # End of if -z ld_dynamic_link_flags
12449 fi # End of if test "$can_build_shared" = "yes"
12450
12451
12452
12453
12454
12455
12456
12457
12458   if test "$can_build_shared" = "yes"; then
12459     { test "$extra_verbose" = "yes" && cat << \EOF
12460     Defining HAVE_SHLIB
12461 EOF
12462 cat >> confdefs.h <<\EOF
12463 #define HAVE_SHLIB 1
12464 EOF
12465 }
12466
12467     extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
12468    echo "    xemacs will be linked with \"sysdll.o\""
12469  fi
12470     extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
12471    echo "    xemacs will be linked with \"emodules.o\""
12472  fi
12473     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
12474     test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
12475     for ac_func in dlerror _dlerror
12476 do
12477 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12478 echo "configure:12479: checking for $ac_func" >&5
12479
12480 cat > conftest.$ac_ext <<EOF
12481 #line 12482 "configure"
12482 #include "confdefs.h"
12483 /* System header to define __stub macros and hopefully few prototypes,
12484     which can conflict with char $ac_func(); below.  */
12485 #include <assert.h>
12486 /* Override any gcc2 internal prototype to avoid an error.  */
12487 /* We use char because int might match the return type of a gcc2
12488     builtin and then its argument prototype would still apply.  */
12489 char $ac_func();
12490
12491 int main() {
12492
12493 /* The GNU C library defines this for functions which it implements
12494     to always fail with ENOSYS.  Some functions are actually named
12495     something starting with __ and the normal name is an alias.  */
12496 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12497 choke me
12498 #else
12499 $ac_func();
12500 #endif
12501
12502 ; return 0; }
12503 EOF
12504 if { (eval echo configure:12505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
12505   rm -rf conftest*
12506   eval "ac_cv_func_$ac_func=yes"
12507 else
12508   echo "configure: failed program was:" >&5
12509   cat conftest.$ac_ext >&5
12510   rm -rf conftest*
12511   eval "ac_cv_func_$ac_func=no"
12512 fi
12513 rm -f conftest*
12514
12515 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12516   echo "$ac_t""yes" 1>&6
12517     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12518   { test "$extra_verbose" = "yes" && cat << EOF
12519     Defining $ac_tr_func
12520 EOF
12521 cat >> confdefs.h <<EOF
12522 #define $ac_tr_func 1
12523 EOF
12524 }
12525  
12526 else
12527   echo "$ac_t""no" 1>&6
12528 fi
12529 done
12530
12531   else
12532     echo "configure: warning: disabling shared library support" 1>&2
12533     with_shlib=no
12534   fi
12535 fi
12536
12537 cat > conftest.$ac_ext <<EOF
12538 #line 12539 "configure"
12539 #include "confdefs.h"
12540 int main(int c,char *v[]){return 0;}
12541 EOF
12542 if { (eval echo configure:12543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
12543 then
12544   :
12545 else
12546   conftest_rc="$?"
12547   echo "configure: failed program was:" >&5
12548   cat conftest.$ac_ext >&5
12549   rm -fr conftest*
12550   
12551   echo ""
12552   echo "*** PANIC *** The C compiler can no longer build working executables."
12553   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
12554   echo "*** PANIC *** The most likely reason for this problem is that configure"
12555   echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
12556   echo "*** PANIC *** found at run time."
12557   echo "*** PANIC ***"
12558   echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
12559   echo "*** PANIC *** On other systems, try telling configure where to find the"
12560   echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
12561   echo "*** PANIC ***"
12562   echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
12563   echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
12564   echo "*** PANIC *** on your system.  Don't do that."
12565   exit 1
12566 fi
12567 rm -fr conftest*
12568
12569 if test "$win32_processes" = "yes"; then
12570   extra_objs="$extra_objs process-nt.o" &&  if test "$extra_verbose" = "yes"; then
12571    echo "    xemacs will be linked with \"process-nt.o\""
12572  fi
12573 else
12574   { test "$extra_verbose" = "yes" && cat << \EOF
12575     Defining HAVE_UNIX_PROCESSES
12576 EOF
12577 cat >> confdefs.h <<\EOF
12578 #define HAVE_UNIX_PROCESSES 1
12579 EOF
12580 }
12581
12582   extra_objs="$extra_objs process-unix.o" &&  if test "$extra_verbose" = "yes"; then
12583    echo "    xemacs will be linked with \"process-unix.o\""
12584  fi
12585 fi
12586
12587
12588
12589 T=""
12590 for W in $CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12591 CFLAGS="$T"
12592
12593
12594 T=""
12595 for W in $extra_objs; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12596 extra_objs="$T"
12597
12598
12599 T=""
12600 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
12601 c_switch_general="$T"
12602
12603
12604 T=""
12605 for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12606 c_switch_window_system="$T"
12607
12608
12609 T=""
12610 for W in $c_switch_general $c_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12611 c_switch_all="$T"
12612
12613
12614 T=""
12615 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
12616 ld_switch_general="$T"
12617
12618
12619 T=""
12620 for W in $ld_switch_x_site; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12621 ld_switch_window_system="$T"
12622
12623
12624 T=""
12625 for W in $ld_switch_general $ld_switch_window_system; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12626 ld_switch_all="$T"
12627
12628
12629 T=""
12630 for W in $LIBS $libs_machine $libs_system $libs_standard; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12631 ld_libs_general="$T"
12632
12633
12634 T=""
12635 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
12636 ld_libs_window_system="$T"
12637
12638
12639 T=""
12640 for W in $ld_libs_window_system $ld_libs_general; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12641 ld_libs_all="$T"
12642
12643
12644
12645 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
12646 internal_makefile_list="Makefile.in"
12647 SUBDIR_MAKEFILES=''
12648 test -d lock || mkdir lock
12649 for dir in $MAKE_SUBDIR; do
12650   case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
12651         test -d "$d" || mkdir "$d"; cd "$d"
12652       done ) ;;
12653    * ) test -d "$dir" || mkdir "$dir" ;;
12654   esac
12655   
12656 T=""
12657 for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12658 SUBDIR_MAKEFILES="$T"
12659
12660   
12661 T=""
12662 for W in $internal_makefile_list $dir/Makefile.in; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12663 internal_makefile_list="$T"
12664
12665 done
12666
12667
12668
12669
12670 for dir in src/s src/m; do
12671   if test ! -d "$dir" ; then
12672     echo Making symbolic link to "$srcdir/$dir"
12673     ${LN_S} "$srcdir/$dir" "$dir"
12674   fi
12675 done
12676
12677 if test "$extra_verbose" = "yes"; then
12678   echo ""
12679   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
12680   echo ""
12681 fi
12682
12683 if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
12684   echo "creating src/gdbinit"; echo ""
12685   echo "source $srcdir/src/gdbinit" > src/gdbinit
12686 fi
12687
12688 if test "$__SUNPRO_C" = "yes"; then
12689   echo "creating .sbinit"; echo ""
12690   ( echo "# For use with Sun WorkShop's Source browser."
12691     echo "# See sbquery(1) and sbinit(4) for more information"
12692     for dir in $MAKE_SUBDIR; do echo "import $dir"; done
12693   ) > .sbinit
12694 fi
12695
12696 rm -f core
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714 PREFIX=$prefix
12715 while true; do
12716   case "$PREFIX" in
12717     *\$* ) eval "PREFIX=$PREFIX" ;;
12718     *) break ;;
12719   esac
12720 done
12721
12722
12723
12724
12725 EXEC_PREFIX=$exec_prefix
12726 while true; do
12727   case "$EXEC_PREFIX" in
12728     *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
12729     *) break ;;
12730   esac
12731 done
12732
12733
12734
12735
12736 INFODIR=$infodir
12737 while true; do
12738   case "$INFODIR" in
12739     *\$* ) eval "INFODIR=$INFODIR" ;;
12740     *) break ;;
12741   esac
12742 done
12743
12744
12745
12746
12747 INFOPATH=$infopath
12748 while true; do
12749   case "$INFOPATH" in
12750     *\$* ) eval "INFOPATH=$INFOPATH" ;;
12751     *) break ;;
12752   esac
12753 done
12754
12755
12756
12757
12758 PACKAGE_PATH=$package_path
12759 while true; do
12760   case "$PACKAGE_PATH" in
12761     *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
12762     *) break ;;
12763   esac
12764 done
12765
12766
12767
12768
12769 LISPDIR=$lispdir
12770 while true; do
12771   case "$LISPDIR" in
12772     *\$* ) eval "LISPDIR=$LISPDIR" ;;
12773     *) break ;;
12774   esac
12775 done
12776
12777
12778
12779
12780 MODULEDIR=$moduledir
12781 while true; do
12782   case "$MODULEDIR" in
12783     *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
12784     *) break ;;
12785   esac
12786 done
12787
12788
12789
12790
12791 SITELISPDIR=$sitelispdir
12792 while true; do
12793   case "$SITELISPDIR" in
12794     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
12795     *) break ;;
12796   esac
12797 done
12798
12799
12800
12801
12802 SITEMODULEDIR=$sitemoduledir
12803 while true; do
12804   case "$SITEMODULEDIR" in
12805     *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
12806     *) break ;;
12807   esac
12808 done
12809
12810
12811
12812
12813 ETCDIR=$etcdir
12814 while true; do
12815   case "$ETCDIR" in
12816     *\$* ) eval "ETCDIR=$ETCDIR" ;;
12817     *) break ;;
12818   esac
12819 done
12820
12821
12822
12823
12824 LOCKDIR=$lockdir
12825 while true; do
12826   case "$LOCKDIR" in
12827     *\$* ) eval "LOCKDIR=$LOCKDIR" ;;
12828     *) break ;;
12829   esac
12830 done
12831
12832
12833
12834
12835 DOCDIR=$docdir
12836 while true; do
12837   case "$DOCDIR" in
12838     *\$* ) eval "DOCDIR=$DOCDIR" ;;
12839     *) break ;;
12840   esac
12841 done
12842
12843
12844
12845
12846 ARCHLIBDIR=$archlibdir
12847 while true; do
12848   case "$ARCHLIBDIR" in
12849     *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
12850     *) break ;;
12851   esac
12852 done
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
12874
12875
12876
12877
12878
12879
12880
12881 : ${XEMACS_CC:=$CC}
12882
12883
12884
12885 if test "$with_site_lisp" = "no"; then
12886   { test "$extra_verbose" = "yes" && cat << \EOF
12887     Defining INHIBIT_SITE_LISP
12888 EOF
12889 cat >> confdefs.h <<\EOF
12890 #define INHIBIT_SITE_LISP 1
12891 EOF
12892 }
12893
12894 fi
12895 if test "$with_site_modules" = "no"; then
12896   { test "$extra_verbose" = "yes" && cat << \EOF
12897     Defining INHIBIT_SITE_MODULES
12898 EOF
12899 cat >> confdefs.h <<\EOF
12900 #define INHIBIT_SITE_MODULES 1
12901 EOF
12902 }
12903
12904 fi
12905
12906
12907 T=""
12908 for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
12909 ac_configure_args="$T"
12910
12911 { test "$extra_verbose" = "yes" && cat << EOF
12912     Defining EMACS_CONFIGURATION = "$canonical"
12913 EOF
12914 cat >> confdefs.h <<EOF
12915 #define EMACS_CONFIGURATION "$canonical"
12916 EOF
12917 }
12918
12919 { test "$extra_verbose" = "yes" && cat << EOF
12920     Defining EMACS_CONFIG_OPTIONS = "$ac_configure_args"
12921 EOF
12922 cat >> confdefs.h <<EOF
12923 #define EMACS_CONFIG_OPTIONS "$ac_configure_args"
12924 EOF
12925 }
12926
12927 { test "$extra_verbose" = "yes" && cat << EOF
12928     Defining config_machfile = "$machfile"
12929 EOF
12930 cat >> confdefs.h <<EOF
12931 #define config_machfile "$machfile"
12932 EOF
12933 }
12934
12935 { test "$extra_verbose" = "yes" && cat << EOF
12936     Defining config_opsysfile = "$opsysfile"
12937 EOF
12938 cat >> confdefs.h <<EOF
12939 #define config_opsysfile "$opsysfile"
12940 EOF
12941 }
12942
12943
12944
12945 null_string=""
12946 { test "$extra_verbose" = "yes" && cat << EOF
12947     Defining LD_SWITCH_X_SITE = $null_string
12948 EOF
12949 cat >> confdefs.h <<EOF
12950 #define LD_SWITCH_X_SITE $null_string
12951 EOF
12952 }
12953
12954 { test "$extra_verbose" = "yes" && cat << EOF
12955     Defining LD_SWITCH_X_SITE_AUX = $null_string
12956 EOF
12957 cat >> confdefs.h <<EOF
12958 #define LD_SWITCH_X_SITE_AUX $null_string
12959 EOF
12960 }
12961
12962 { test "$extra_verbose" = "yes" && cat << EOF
12963     Defining C_SWITCH_X_SITE = $null_string
12964 EOF
12965 cat >> confdefs.h <<EOF
12966 #define C_SWITCH_X_SITE $null_string
12967 EOF
12968 }
12969
12970 { test "$extra_verbose" = "yes" && cat << EOF
12971     Defining LD_SWITCH_SITE = $null_string
12972 EOF
12973 cat >> confdefs.h <<EOF
12974 #define LD_SWITCH_SITE $null_string
12975 EOF
12976 }
12977
12978 { test "$extra_verbose" = "yes" && cat << EOF
12979     Defining C_SWITCH_SITE = $null_string
12980 EOF
12981 cat >> confdefs.h <<EOF
12982 #define C_SWITCH_SITE $null_string
12983 EOF
12984 }
12985
12986
12987
12988 if   test "$GNU_MALLOC"         = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12989     Defining GNU_MALLOC
12990 EOF
12991 cat >> confdefs.h <<\EOF
12992 #define GNU_MALLOC 1
12993 EOF
12994 }
12995
12996 elif test "$with_system_malloc" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
12997     Defining USE_SYSTEM_MALLOC
12998 EOF
12999 cat >> confdefs.h <<\EOF
13000 #define USE_SYSTEM_MALLOC 1
13001 EOF
13002 }
13003
13004 elif test "$with_debug_malloc"  = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF
13005     Defining USE_DEBUG_MALLOC
13006 EOF
13007 cat >> confdefs.h <<\EOF
13008 #define USE_DEBUG_MALLOC 1
13009 EOF
13010 }
13011
13012                                               { test "$extra_verbose" = "yes" && cat << \EOF
13013     Defining USE_SYSTEM_MALLOC
13014 EOF
13015 cat >> confdefs.h <<\EOF
13016 #define USE_SYSTEM_MALLOC 1
13017 EOF
13018 }
13019
13020 fi
13021 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13022     Defining I18N3
13023 EOF
13024 cat >> confdefs.h <<\EOF
13025 #define I18N3 1
13026 EOF
13027 }
13028
13029 test "$GCC"                = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13030     Defining USE_GCC
13031 EOF
13032 cat >> confdefs.h <<\EOF
13033 #define USE_GCC 1
13034 EOF
13035 }
13036
13037 test "$external_widget"    = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13038     Defining EXTERNAL_WIDGET
13039 EOF
13040 cat >> confdefs.h <<\EOF
13041 #define EXTERNAL_WIDGET 1
13042 EOF
13043 }
13044
13045 test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13046     Defining NO_DOC_FILE
13047 EOF
13048 cat >> confdefs.h <<\EOF
13049 #define NO_DOC_FILE 1
13050 EOF
13051 }
13052
13053 test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13054     Defining PURIFY
13055 EOF
13056 cat >> confdefs.h <<\EOF
13057 #define PURIFY 1
13058 EOF
13059 }
13060
13061 test "$with_quantify"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13062     Defining QUANTIFY
13063 EOF
13064 cat >> confdefs.h <<\EOF
13065 #define QUANTIFY 1
13066 EOF
13067 }
13068
13069 test "$with_pop"           = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13070     Defining MAIL_USE_POP
13071 EOF
13072 cat >> confdefs.h <<\EOF
13073 #define MAIL_USE_POP 1
13074 EOF
13075 }
13076
13077 test "$with_kerberos"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13078     Defining KERBEROS
13079 EOF
13080 cat >> confdefs.h <<\EOF
13081 #define KERBEROS 1
13082 EOF
13083 }
13084
13085 test "$with_hesiod"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13086     Defining HESIOD
13087 EOF
13088 cat >> confdefs.h <<\EOF
13089 #define HESIOD 1
13090 EOF
13091 }
13092
13093 test "$use_union_type"     = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
13094     Defining USE_UNION_TYPE
13095 EOF
13096 cat >> confdefs.h <<\EOF
13097 #define USE_UNION_TYPE 1
13098 EOF
13099 }
13100
13101
13102
13103 (
13104 if test -f /etc/osversion; then   echo "osversion: `cat /etc/osversion`"
13105 else
13106   echo "uname -a: `uname -a`"
13107 fi
13108 echo ""
13109 echo "$0 $quoted_arguments"
13110 ) > Installation
13111
13112 if test ! -z ${emacs_beta_version} ; then
13113   if test -z "${emacs_is_beta}" ; then
13114         xemacs_betaname=".${emacs_beta_version}"
13115   else
13116         xemacs_betaname="-b${emacs_beta_version}"
13117   fi
13118 else
13119   xemacs_betaname=""    
13120 fi
13121
13122 (
13123 echo "
13124
13125 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
13126
13127   Where should the build process find the source code?    $srcdir
13128   What installation prefix should install use?            $prefix
13129   What operating system and machine description files should XEmacs use?
13130         \`$opsysfile' and \`$machfile'
13131   What compiler should XEmacs be built with?              $CC $CFLAGS
13132   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
13133   Should XEmacs use the relocating allocator for buffers? $rel_alloc
13134   What window system should XEmacs use?                   ${window_system}"
13135 if test "$with_x11" = "yes"; then
13136   echo "  Where do we find X Windows header files?                $x_includes"
13137   echo "  Where do we find X Windows libraries?                   $x_libraries"
13138 fi
13139 if test -n "$site_includes"; then
13140   echo "  Additional header files:                                $site_includes"
13141 fi
13142 if test -n "$site_libraries"; then
13143   echo "  Additional libraries:                                   $site_libraries"
13144 fi
13145 if test -n "$site_prefixes"; then
13146   echo "  Additional prefixes:                                    $site_prefixes"
13147 fi
13148 if test -n "$runpath"; then
13149   echo "  Runtime library search path:                            $runpath"
13150 fi
13151 test "$with_dnet"  = yes && echo "  Compiling in support for DNET."
13152 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
13153 test "$with_xauth" = yes && echo "  Compiling in support for XAUTH."
13154 if test "$with_xmu" != yes -a "$with_x11" = yes; then
13155   echo "  No Xmu; substituting equivalent routines."
13156 fi
13157
13158 if test "$with_xpm" = yes; then
13159   echo "  Compiling in support for XPM images."
13160 elif test "$with_x11" = yes; then
13161   echo "  --------------------------------------------------------------------"
13162   echo "  WARNING: Compiling without XPM support."
13163   if test "$xpm_problem" != ""; then
13164     echo "  Reason: $xpm_problem"
13165   fi
13166   echo "  WARNING: You should strongly consider installing XPM."
13167   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
13168   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13169   echo "  --------------------------------------------------------------------"
13170 fi
13171 if test "$with_png" = yes; then
13172   echo "  Compiling in support for PNG image handling."
13173 elif test "$window_system" != "none"; then
13174   echo "  --------------------------------------------------------------------"
13175   echo "  WARNING: Compiling without PNG image support."
13176   if test "$png_problem" != ""; then
13177     echo "  Reason: $png_problem"
13178   fi
13179   echo "  WARNING: You should strongly consider installing the PNG libraries."
13180   echo "  WARNING: Otherwise certain images and glyphs may not display."
13181   echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
13182   echo "  --------------------------------------------------------------------"
13183 fi
13184 test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
13185 test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
13186 test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
13187 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
13188 case "$with_sound" in
13189   nas    ) echo "  Compiling in network sound (NAS) support." ;;
13190   native ) echo "  Compiling in native sound support." ;;
13191   both   ) echo "  Compiling in both network and native sound support." ;;
13192 esac
13193 test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
13194
13195 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
13196 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
13197 test "$with_database_gnudbm" = yes && echo "  Compiling in support for GNU DBM."
13198
13199 test "$with_ldap"            = yes && echo "  Compiling in support for LDAP."
13200
13201 test "$with_ncurses"  = yes && echo "  Compiling in support for ncurses."
13202 test "$with_gpm"      = yes && echo "  Compiling in support for GPM (General Purpose Mouse)."
13203
13204 test "$with_mule"     = yes && echo "  Compiling in Mule (multi-lingual) support."
13205 test "$with_file_coding"     = yes && echo "  Compiling in File coding support."
13206 test "$with_xim"      != no && echo "  Compiling in XIM (X11R5+ I18N input method) support."
13207 test "$with_xim" = motif    && echo "    Using Motif to provide XIM support."
13208 test "$with_xim" = xlib     && echo "    Using raw Xlib to provide XIM support."
13209 test "$with_xfs" = yes      && echo "    Using XFontSet to provide bilingual menubar."
13210 test "$with_canna"    = yes && echo "  Compiling in support for Canna on Mule."
13211 if test "$with_wnn" = yes; then
13212   echo "  Compiling in support for the WNN input method on Mule."
13213   test "$with_wnn6" = yes && echo "    Using WNN version 6."
13214 fi
13215 test "$with_i18n3"    = yes && echo "  Compiling in I18N support, level 3 (doesn't currently work)."
13216
13217 test "$with_cde"      = yes && echo "  Compiling in support for CDE."
13218 test "$with_tooltalk" = yes && echo "  Compiling in support for ToolTalk."
13219 test "$with_offix"    = yes && echo "  Compiling in support for OffiX."
13220 test "$with_dragndrop" = yes && echo "  Compiling in EXPERIMENTAL support for Drag'n'Drop ($dragndrop_proto )."
13221 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
13222 test "$with_wmcommand"  != no && echo "  Compiling in support for proper WM_COMMAND handling."
13223 case "$with_menubars" in
13224   lucid ) echo "  Using Lucid menubars." ;;
13225   motif ) echo "  Using Motif menubars."
13226           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
13227           echo "             We recommend using the Lucid menubar instead."
13228           echo "             Re-run configure with --with-menubars='lucid'." ;;
13229 esac
13230 case "$with_scrollbars" in
13231   lucid    ) echo "  Using Lucid scrollbars."     ;;
13232   motif    ) echo "  Using Motif scrollbars."     ;;
13233   athena   ) echo "  Using Athena scrollbars."    ;;
13234   athena3d ) echo "  Using Athena-3d scrollbars." ;;
13235 esac
13236 case "$with_dialogs" in
13237   motif    )
13238     echo "  Using Motif dialog boxes."
13239     if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
13240       echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
13241       echo "             We recommend using the Athena dialog boxes instead."
13242       echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
13243       echo "             Read the PROBLEMS file for more information."
13244     fi; fi
13245     ;;
13246   athena   ) echo "  Using Athena dialog boxes."    ;;
13247   athena3d ) echo "  Using Athena-3d dialog boxes." ;;
13248 esac
13249 test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
13250 test "$with_clash_detection" = yes && \
13251   echo "  Clash detection will use \"$lockdir\" for locking files."
13252 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
13253 test "$with_pop"        = yes && echo "  Using POP for mail access."
13254 test "$with_kerberos"   = yes && echo "  Using Kerberos for POP authentication."
13255 test "$with_hesiod"     = yes && echo "  Using Hesiod to get POP server host."
13256 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
13257 test "$debug"              = yes && echo "  Compiling in extra code for debugging."
13258 test "$usage_tracking"     = yes && echo "  Compiling with usage tracking active (Sun internal)."
13259 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc" \
13260   != "no no no no no"; then
13261   echo "  WARNING: ---------------------------------------------------------"
13262   echo "  WARNING: Compiling in support for runtime error checking."
13263   echo "  WARNING: XEmacs will run noticeably more slowly as a result."
13264   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
13265   echo "  WARNING: ---------------------------------------------------------"
13266 fi
13267 echo ""
13268 ) | tee -a Installation
13269 echo ""
13270
13271
13272 # Remove any trailing slashes in these variables.
13273 test -n "$prefix" &&
13274   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13275 test -n "$exec_prefix" &&
13276   exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
13277
13278
13279 for file in $internal_makefile_list; do
13280   test "$file" = src/Makefile.in && \
13281     file="src/Makefile.in:src/Makefile.in.in:src/depend"
13282   ac_output_files="${ac_output_files+$ac_output_files }$file"
13283 done
13284 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
13285 if test "$with_shlib" = "yes"; then
13286   ac_output_files="$ac_output_files lib-src/ellcc.h"
13287 fi
13288
13289 trap '' 1 2 15
13290
13291 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
13292
13293 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13294 # Let make expand exec_prefix.
13295 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13296
13297 # Any assignment to VPATH causes Sun make to only execute
13298 # the first set of double-colon rules, so remove it if not needed.
13299 # If there is a colon in the path, we need to keep it.
13300 if test "x$srcdir" = x.; then
13301   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
13302 fi
13303
13304 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
13305
13306 DEFS=-DHAVE_CONFIG_H
13307
13308 # Without the "./", some shells look in PATH for config.status.
13309 : ${CONFIG_STATUS=./config.status}
13310
13311 echo creating $CONFIG_STATUS
13312 rm -f $CONFIG_STATUS
13313 cat > $CONFIG_STATUS <<EOF
13314 #! /bin/sh
13315 # Generated automatically by configure.
13316 # Run this file to recreate the current configuration.
13317 # This directory was configured as follows,
13318 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
13319 #
13320 # $0 $ac_configure_args
13321 #
13322 # Compiler output produced by configure, useful for debugging
13323 # configure, is in ./config.log if it exists.
13324
13325 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
13326 for ac_option
13327 do
13328   case "\$ac_option" in
13329   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13330     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
13331     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
13332   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
13333     echo "$CONFIG_STATUS generated by autoconf version 2.12"
13334     exit 0 ;;
13335   -help | --help | --hel | --he | --h)
13336     echo "\$ac_cs_usage"; exit 0 ;;
13337   *) echo "\$ac_cs_usage"; exit 1 ;;
13338   esac
13339 done
13340
13341 ac_given_srcdir=$srcdir
13342 ac_given_INSTALL="$INSTALL"
13343
13344 trap 'rm -fr `echo "$ac_output_files src/config.h lwlib/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
13345 EOF
13346 cat >> $CONFIG_STATUS <<EOF
13347
13348 # Protect against being on the right side of a sed subst in config.status.
13349 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
13350  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
13351 $ac_vpsub
13352 $extrasub
13353 s%@CFLAGS@%$CFLAGS%g
13354 s%@CPPFLAGS@%$CPPFLAGS%g
13355 s%@CXXFLAGS@%$CXXFLAGS%g
13356 s%@DEFS@%$DEFS%g
13357 s%@LDFLAGS@%$LDFLAGS%g
13358 s%@LIBS@%$LIBS%g
13359 s%@exec_prefix@%$exec_prefix%g
13360 s%@prefix@%$prefix%g
13361 s%@program_transform_name@%$program_transform_name%g
13362 s%@bindir@%$bindir%g
13363 s%@sbindir@%$sbindir%g
13364 s%@libexecdir@%$libexecdir%g
13365 s%@datadir@%$datadir%g
13366 s%@sysconfdir@%$sysconfdir%g
13367 s%@sharedstatedir@%$sharedstatedir%g
13368 s%@localstatedir@%$localstatedir%g
13369 s%@libdir@%$libdir%g
13370 s%@includedir@%$includedir%g
13371 s%@oldincludedir@%$oldincludedir%g
13372 s%@infodir@%$infodir%g
13373 s%@mandir@%$mandir%g
13374 s%@LN_S@%$LN_S%g
13375 s%@blddir@%$blddir%g
13376 s%@CC@%$CC%g
13377 s%@CPP@%$CPP%g
13378 s%@start_flags@%$start_flags%g
13379 s%@ld_switch_shared@%$ld_switch_shared%g
13380 s%@start_files@%$start_files%g
13381 s%@ld@%$ld%g
13382 s%@lib_gcc@%$lib_gcc%g
13383 s%@RANLIB@%$RANLIB%g
13384 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
13385 s%@INSTALL_DATA@%$INSTALL_DATA%g
13386 s%@YACC@%$YACC%g
13387 s%@SET_MAKE@%$SET_MAKE%g
13388 s%@X_CFLAGS@%$X_CFLAGS%g
13389 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
13390 s%@X_LIBS@%$X_LIBS%g
13391 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
13392 s%@install_pp@%$install_pp%g
13393 s%@libs_xauth@%$libs_xauth%g
13394 s%@dnd_objs@%$dnd_objs%g
13395 s%@lwlib_objs@%$lwlib_objs%g
13396 s%@ALLOCA@%$ALLOCA%g
13397 s%@dll_ld@%$dll_ld%g
13398 s%@dll_cflags@%$dll_cflags%g
13399 s%@dll_ldflags@%$dll_ldflags%g
13400 s%@dll_post@%$dll_post%g
13401 s%@dll_ldo@%$dll_ldo%g
13402 s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
13403 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
13404 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
13405 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
13406 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
13407 s%@PROGNAME@%$PROGNAME%g
13408 s%@version@%$version%g
13409 s%@configuration@%$configuration%g
13410 s%@canonical@%$canonical%g
13411 s%@srcdir@%$srcdir%g
13412 s%@pkgdir@%$pkgdir%g
13413 s%@statedir@%$statedir%g
13414 s%@PREFIX_USER_DEFINED@%$PREFIX_USER_DEFINED%g
13415 s%@PREFIX@%$PREFIX%g
13416 s%@EXEC_PREFIX_USER_DEFINED@%$EXEC_PREFIX_USER_DEFINED%g
13417 s%@EXEC_PREFIX@%$EXEC_PREFIX%g
13418 s%@INFODIR_USER_DEFINED@%$INFODIR_USER_DEFINED%g
13419 s%@INFODIR@%$INFODIR%g
13420 s%@infopath@%$infopath%g
13421 s%@INFOPATH_USER_DEFINED@%$INFOPATH_USER_DEFINED%g
13422 s%@INFOPATH@%$INFOPATH%g
13423 s%@package_path@%$package_path%g
13424 s%@PACKAGE_PATH_USER_DEFINED@%$PACKAGE_PATH_USER_DEFINED%g
13425 s%@PACKAGE_PATH@%$PACKAGE_PATH%g
13426 s%@lispdir@%$lispdir%g
13427 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
13428 s%@LISPDIR@%$LISPDIR%g
13429 s%@moduledir@%$moduledir%g
13430 s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
13431 s%@MODULEDIR@%$MODULEDIR%g
13432 s%@sitelispdir@%$sitelispdir%g
13433 s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
13434 s%@SITELISPDIR@%$SITELISPDIR%g
13435 s%@sitemoduledir@%$sitemoduledir%g
13436 s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
13437 s%@SITEMODULEDIR@%$SITEMODULEDIR%g
13438 s%@etcdir@%$etcdir%g
13439 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
13440 s%@ETCDIR@%$ETCDIR%g
13441 s%@lockdir@%$lockdir%g
13442 s%@LOCKDIR_USER_DEFINED@%$LOCKDIR_USER_DEFINED%g
13443 s%@LOCKDIR@%$LOCKDIR%g
13444 s%@docdir@%$docdir%g
13445 s%@DOCDIR_USER_DEFINED@%$DOCDIR_USER_DEFINED%g
13446 s%@DOCDIR@%$DOCDIR%g
13447 s%@archlibdir@%$archlibdir%g
13448 s%@ARCHLIBDIR_USER_DEFINED@%$ARCHLIBDIR_USER_DEFINED%g
13449 s%@ARCHLIBDIR@%$ARCHLIBDIR%g
13450 s%@bitmapdir@%$bitmapdir%g
13451 s%@extra_objs@%$extra_objs%g
13452 s%@machfile@%$machfile%g
13453 s%@opsysfile@%$opsysfile%g
13454 s%@c_switch_general@%$c_switch_general%g
13455 s%@c_switch_window_system@%$c_switch_window_system%g
13456 s%@c_switch_all@%$c_switch_all%g
13457 s%@ld_switch_general@%$ld_switch_general%g
13458 s%@ld_switch_window_system@%$ld_switch_window_system%g
13459 s%@ld_switch_all@%$ld_switch_all%g
13460 s%@ld_libs_general@%$ld_libs_general%g
13461 s%@ld_libs_window_system@%$ld_libs_window_system%g
13462 s%@ld_libs_all@%$ld_libs_all%g
13463 s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
13464 s%@native_sound_lib@%$native_sound_lib%g
13465 s%@sound_cflags@%$sound_cflags%g
13466 s%@dynodump_arch@%$dynodump_arch%g
13467 s%@XEMACS_CC@%$XEMACS_CC%g
13468 s%@internal_makefile_list@%$internal_makefile_list%g
13469
13470 CEOF
13471 EOF
13472
13473 cat >> $CONFIG_STATUS <<\EOF
13474
13475 # Split the substitutions into bite-sized pieces for seds with
13476 # small command number limits, like on Digital OSF/1 and HP-UX.
13477 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
13478 ac_file=1 # Number of current file.
13479 ac_beg=1 # First line for current file.
13480 ac_end=$ac_max_sed_cmds # Line after last line for current file.
13481 ac_more_lines=:
13482 ac_sed_cmds=""
13483 while $ac_more_lines; do
13484   if test $ac_beg -gt 1; then
13485     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
13486   else
13487     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
13488   fi
13489   if test ! -s conftest.s$ac_file; then
13490     ac_more_lines=false
13491     rm -f conftest.s$ac_file
13492   else
13493     if test -z "$ac_sed_cmds"; then
13494       ac_sed_cmds="sed -f conftest.s$ac_file"
13495     else
13496       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
13497     fi
13498     ac_file=`expr $ac_file + 1`
13499     ac_beg=$ac_end
13500     ac_end=`expr $ac_end + $ac_max_sed_cmds`
13501   fi
13502 done
13503 if test -z "$ac_sed_cmds"; then
13504   ac_sed_cmds=cat
13505 fi
13506 EOF
13507
13508 cat >> $CONFIG_STATUS <<EOF
13509
13510 CONFIG_FILES=\${CONFIG_FILES-"$ac_output_files"}
13511 EOF
13512 cat >> $CONFIG_STATUS <<\EOF
13513 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
13514   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13515   case "$ac_file" in
13516   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13517        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13518   *) ac_file_in="${ac_file}.in" ;;
13519   esac
13520
13521   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
13522
13523   # Remove last slash and all that follows it.  Not all systems have dirname.
13524   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13525   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13526     # The file is in a subdirectory.
13527     test ! -d "$ac_dir" && mkdir "$ac_dir"
13528     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
13529     # A "../" for each directory in $ac_dir_suffix.
13530     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
13531   else
13532     ac_dir_suffix= ac_dots=
13533   fi
13534
13535   case "$ac_given_srcdir" in
13536   .)  srcdir=.
13537       if test -z "$ac_dots"; then top_srcdir=.
13538       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
13539   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
13540   *) # Relative path.
13541     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
13542     top_srcdir="$ac_dots$ac_given_srcdir" ;;
13543   esac
13544
13545   case "$ac_given_INSTALL" in
13546   [/$]*) INSTALL="$ac_given_INSTALL" ;;
13547   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
13548   esac
13549
13550   echo creating "$ac_file"
13551   rm -f "$ac_file"
13552   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
13553   case "$ac_file" in
13554   *Makefile*) ac_comsub="1i\\
13555 # $configure_input" ;;
13556   *) ac_comsub= ;;
13557   esac
13558
13559   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13560   sed -e "$ac_comsub
13561 s%@configure_input@%$configure_input%g
13562 s%@srcdir@%$srcdir%g
13563 s%@top_srcdir@%$top_srcdir%g
13564 s%@INSTALL@%$INSTALL%g
13565 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
13566 fi; done
13567 rm -f conftest.s*
13568
13569 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13570 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13571 #
13572 # ac_d sets the value in "#define NAME VALUE" lines.
13573 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13574 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
13575 ac_dC='\3'
13576 ac_dD='%g'
13577 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13578 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13579 ac_uB='\([      ]\)%\1#\2define\3'
13580 ac_uC=' '
13581 ac_uD='\4%g'
13582 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13583 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13584 ac_eB='$%\1#\2define\3'
13585 ac_eC=' '
13586 ac_eD='%g'
13587
13588 if test "${CONFIG_HEADERS+set}" != set; then
13589 EOF
13590 cat >> $CONFIG_STATUS <<EOF
13591   CONFIG_HEADERS="src/config.h lwlib/config.h"
13592 EOF
13593 cat >> $CONFIG_STATUS <<\EOF
13594 fi
13595 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
13596   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13597   case "$ac_file" in
13598   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
13599        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
13600   *) ac_file_in="${ac_file}.in" ;;
13601   esac
13602
13603   echo creating $ac_file
13604
13605   rm -f conftest.frag conftest.in conftest.out
13606   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
13607   cat $ac_file_inputs > conftest.in
13608
13609 EOF
13610
13611 # Transform confdefs.h into a sed script conftest.vals that substitutes
13612 # the proper values into config.h.in to produce config.h.  And first:
13613 # Protect against being on the right side of a sed subst in config.status.
13614 # Protect against being in an unquoted here document in config.status.
13615 rm -f conftest.vals
13616 cat > conftest.hdr <<\EOF
13617 s/[\\&%]/\\&/g
13618 s%[\\$`]%\\&%g
13619 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
13620 s%ac_d%ac_u%gp
13621 s%ac_u%ac_e%gp
13622 EOF
13623 sed -n -f conftest.hdr confdefs.h > conftest.vals
13624 rm -f conftest.hdr
13625
13626 # This sed command replaces #undef with comments.  This is necessary, for
13627 # example, in the case of _POSIX_SOURCE, which is predefined and required
13628 # on some systems where configure will not decide to define it.
13629 cat >> conftest.vals <<\EOF
13630 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
13631 EOF
13632
13633 # Break up conftest.vals because some shells have a limit on
13634 # the size of here documents, and old seds have small limits too.
13635
13636 rm -f conftest.tail
13637 while :
13638 do
13639   ac_lines=`grep -c . conftest.vals`
13640   # grep -c gives empty output for an empty file on some AIX systems.
13641   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
13642   # Write a limited-size here document to conftest.frag.
13643   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
13644   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
13645   echo 'CEOF
13646   sed -f conftest.frag conftest.in > conftest.out
13647   rm -f conftest.in
13648   mv conftest.out conftest.in
13649 ' >> $CONFIG_STATUS
13650   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13651   rm -f conftest.vals
13652   mv conftest.tail conftest.vals
13653 done
13654 rm -f conftest.vals
13655
13656 cat >> $CONFIG_STATUS <<\EOF
13657   rm -f conftest.frag conftest.h
13658   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13659   cat conftest.in >> conftest.h
13660   rm -f conftest.in
13661   if cmp -s $ac_file conftest.h 2>/dev/null; then
13662     echo "$ac_file is unchanged"
13663     rm -f conftest.h
13664   else
13665     # Remove last slash and all that follows it.  Not all systems have dirname.
13666       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13667       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13668       # The file is in a subdirectory.
13669       test ! -d "$ac_dir" && mkdir "$ac_dir"
13670     fi
13671     rm -f $ac_file
13672     mv conftest.h $ac_file
13673   fi
13674 fi; done
13675
13676 EOF
13677 cat >> $CONFIG_STATUS <<EOF
13678 CPP="$CPP"
13679  top_srcdir="$srcdir"
13680  MAKE_SUBDIR="$MAKE_SUBDIR"
13681
13682 EOF
13683 cat >> $CONFIG_STATUS <<\EOF
13684 for dir in . $MAKE_SUBDIR; do
13685   (
13686     cd $dir
13687     rm -f junk.c
13688     < Makefile.in \
13689       sed -e '/^# Generated/d' \
13690           -e 's%/\*\*/#.*%%' \
13691           -e 's/^ *# */#/' \
13692           -e '/^##/d' \
13693           -e '/^#/ {
13694 p
13695 d
13696 }'        \
13697           -e '/./ {
13698 s/\([\"]\)/\\\1/g
13699 s/^/"/
13700 s/$/"/
13701 }'  > junk.c;
13702
13703
13704
13705     echo creating $dir/Makefile
13706 $CPP -I. -I${top_srcdir}/src  junk.c \
13707   | sed -e 's/^\#.*//'          \
13708         -e 's/^[        ][      ]*$//'\
13709         -e 's/^ /       /'              \
13710   | sed -n -e '/^..*$/p'        \
13711   | sed '/^\"/ {
13712         s/\\\([\"]\)/\1/g
13713         s/^[    ]*\"//
13714         s/\"[   ]*$//
13715 }' > Makefile.new
13716     chmod 444 Makefile.new
13717     mv -f Makefile.new Makefile
13718
13719     echo creating $dir/GNUmakefile
13720 $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
13721   | sed -e 's/^\#.*//'          \
13722         -e 's/^[        ][      ]*$//'\
13723         -e 's/^ /       /'              \
13724   | sed -n -e '/^..*$/p'        \
13725   | sed '/^\"/ {
13726         s/\\\([\"]\)/\1/g
13727         s/^[    ]*\"//
13728         s/\"[   ]*$//
13729 }' > Makefile.new
13730     chmod 444 Makefile.new
13731     mv -f Makefile.new GNUmakefile
13732
13733     rm -f junk.c
13734   )
13735 done
13736
13737 sed < config.status >> lib-src/config.values \
13738   -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
13739   -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
13740   -e 's/^\([^ ]*\) $/\1 ""/' \
13741   -e 's/ 1$/ t/'
13742
13743
13744 exit 0
13745 EOF
13746 chmod +x $CONFIG_STATUS
13747 rm -fr confdefs* $ac_clean_files
13748 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1