Merge branch ucsim-034-pre3 to main trunk; new version 0.4
[fw/sdcc] / sim / ucsim / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --enable-ucsim          compile ucsim frontend"
16 ac_help="$ac_help
17   --enable-dlso           compile dynamically loadable shared libraries"
18 ac_help="$ac_help
19   --disable-51            do not compile simulator for MCS51"
20 ac_help="$ac_help
21   --disable-avr           do not compile simulator for AVR"
22 ac_help="$ac_help
23   --enable-z80            compile simulator for Z80"
24 ac_help="$ac_help
25   --enable-xa             compile simulator for XA"
26 ac_help="$ac_help
27   --enable-serio          compile serio GUI tool (needs curses)"
28
29 # Initialize some variables set by options.
30 # The variables have the same names as the options, with
31 # dashes changed to underlines.
32 build=NONE
33 cache_file=./config.cache
34 exec_prefix=NONE
35 host=NONE
36 no_create=
37 nonopt=NONE
38 no_recursion=
39 prefix=NONE
40 program_prefix=NONE
41 program_suffix=NONE
42 program_transform_name=s,x,x,
43 silent=
44 site=
45 srcdir=
46 target=NONE
47 verbose=
48 x_includes=NONE
49 x_libraries=NONE
50 bindir='${exec_prefix}/bin'
51 sbindir='${exec_prefix}/sbin'
52 libexecdir='${exec_prefix}/libexec'
53 datadir='${prefix}/share'
54 sysconfdir='${prefix}/etc'
55 sharedstatedir='${prefix}/com'
56 localstatedir='${prefix}/var'
57 libdir='${exec_prefix}/lib'
58 includedir='${prefix}/include'
59 oldincludedir='/usr/include'
60 infodir='${prefix}/info'
61 mandir='${prefix}/man'
62
63 # Initialize some other variables.
64 subdirs=
65 MFLAGS= MAKEFLAGS=
66 SHELL=${CONFIG_SHELL-/bin/sh}
67 # Maximum number of lines to put in a shell here document.
68 ac_max_here_lines=12
69
70 ac_prev=
71 for ac_option
72 do
73
74   # If the previous option needs an argument, assign it.
75   if test -n "$ac_prev"; then
76     eval "$ac_prev=\$ac_option"
77     ac_prev=
78     continue
79   fi
80
81   case "$ac_option" in
82   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
83   *) ac_optarg= ;;
84   esac
85
86   # Accept the important Cygnus configure options, so we can diagnose typos.
87
88   case "$ac_option" in
89
90   -bindir | --bindir | --bindi | --bind | --bin | --bi)
91     ac_prev=bindir ;;
92   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
93     bindir="$ac_optarg" ;;
94
95   -build | --build | --buil | --bui | --bu)
96     ac_prev=build ;;
97   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
98     build="$ac_optarg" ;;
99
100   -cache-file | --cache-file | --cache-fil | --cache-fi \
101   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
102     ac_prev=cache_file ;;
103   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
104   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
105     cache_file="$ac_optarg" ;;
106
107   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
108     ac_prev=datadir ;;
109   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
110   | --da=*)
111     datadir="$ac_optarg" ;;
112
113   -disable-* | --disable-*)
114     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
115     # Reject names that are not valid shell variable names.
116     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
117       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
118     fi
119     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
120     eval "enable_${ac_feature}=no" ;;
121
122   -enable-* | --enable-*)
123     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
124     # Reject names that are not valid shell variable names.
125     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
126       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
127     fi
128     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
129     case "$ac_option" in
130       *=*) ;;
131       *) ac_optarg=yes ;;
132     esac
133     eval "enable_${ac_feature}='$ac_optarg'" ;;
134
135   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
136   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
137   | --exec | --exe | --ex)
138     ac_prev=exec_prefix ;;
139   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
140   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
141   | --exec=* | --exe=* | --ex=*)
142     exec_prefix="$ac_optarg" ;;
143
144   -gas | --gas | --ga | --g)
145     # Obsolete; use --with-gas.
146     with_gas=yes ;;
147
148   -help | --help | --hel | --he)
149     # Omit some internal or obsolete options to make the list less imposing.
150     # This message is too long to be a string in the A/UX 3.1 sh.
151     cat << EOF
152 Usage: configure [options] [host]
153 Options: [defaults in brackets after descriptions]
154 Configuration:
155   --cache-file=FILE       cache test results in FILE
156   --help                  print this message
157   --no-create             do not create output files
158   --quiet, --silent       do not print \`checking...' messages
159   --version               print the version of autoconf that created configure
160 Directory and file names:
161   --prefix=PREFIX         install architecture-independent files in PREFIX
162                           [$ac_default_prefix]
163   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
164                           [same as prefix]
165   --bindir=DIR            user executables in DIR [EPREFIX/bin]
166   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
167   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
168   --datadir=DIR           read-only architecture-independent data in DIR
169                           [PREFIX/share]
170   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
171   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
172                           [PREFIX/com]
173   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
174   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
175   --includedir=DIR        C header files in DIR [PREFIX/include]
176   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
177   --infodir=DIR           info documentation in DIR [PREFIX/info]
178   --mandir=DIR            man documentation in DIR [PREFIX/man]
179   --srcdir=DIR            find the sources in DIR [configure dir or ..]
180   --program-prefix=PREFIX prepend PREFIX to installed program names
181   --program-suffix=SUFFIX append SUFFIX to installed program names
182   --program-transform-name=PROGRAM
183                           run sed PROGRAM on installed program names
184 EOF
185     cat << EOF
186 Host type:
187   --build=BUILD           configure for building on BUILD [BUILD=HOST]
188   --host=HOST             configure for HOST [guessed]
189   --target=TARGET         configure for TARGET [TARGET=HOST]
190 Features and packages:
191   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
192   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
193   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
194   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
195   --x-includes=DIR        X include files are in DIR
196   --x-libraries=DIR       X library files are in DIR
197 EOF
198     if test -n "$ac_help"; then
199       echo "--enable and --with options recognized:$ac_help"
200     fi
201     exit 0 ;;
202
203   -host | --host | --hos | --ho)
204     ac_prev=host ;;
205   -host=* | --host=* | --hos=* | --ho=*)
206     host="$ac_optarg" ;;
207
208   -includedir | --includedir | --includedi | --included | --include \
209   | --includ | --inclu | --incl | --inc)
210     ac_prev=includedir ;;
211   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
212   | --includ=* | --inclu=* | --incl=* | --inc=*)
213     includedir="$ac_optarg" ;;
214
215   -infodir | --infodir | --infodi | --infod | --info | --inf)
216     ac_prev=infodir ;;
217   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
218     infodir="$ac_optarg" ;;
219
220   -libdir | --libdir | --libdi | --libd)
221     ac_prev=libdir ;;
222   -libdir=* | --libdir=* | --libdi=* | --libd=*)
223     libdir="$ac_optarg" ;;
224
225   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
226   | --libexe | --libex | --libe)
227     ac_prev=libexecdir ;;
228   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
229   | --libexe=* | --libex=* | --libe=*)
230     libexecdir="$ac_optarg" ;;
231
232   -localstatedir | --localstatedir | --localstatedi | --localstated \
233   | --localstate | --localstat | --localsta | --localst \
234   | --locals | --local | --loca | --loc | --lo)
235     ac_prev=localstatedir ;;
236   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
237   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
238   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
239     localstatedir="$ac_optarg" ;;
240
241   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
242     ac_prev=mandir ;;
243   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
244     mandir="$ac_optarg" ;;
245
246   -nfp | --nfp | --nf)
247     # Obsolete; use --without-fp.
248     with_fp=no ;;
249
250   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
251   | --no-cr | --no-c)
252     no_create=yes ;;
253
254   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
255   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
256     no_recursion=yes ;;
257
258   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
259   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
260   | --oldin | --oldi | --old | --ol | --o)
261     ac_prev=oldincludedir ;;
262   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
263   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
264   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
265     oldincludedir="$ac_optarg" ;;
266
267   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
268     ac_prev=prefix ;;
269   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
270     prefix="$ac_optarg" ;;
271
272   -program-prefix | --program-prefix | --program-prefi | --program-pref \
273   | --program-pre | --program-pr | --program-p)
274     ac_prev=program_prefix ;;
275   -program-prefix=* | --program-prefix=* | --program-prefi=* \
276   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
277     program_prefix="$ac_optarg" ;;
278
279   -program-suffix | --program-suffix | --program-suffi | --program-suff \
280   | --program-suf | --program-su | --program-s)
281     ac_prev=program_suffix ;;
282   -program-suffix=* | --program-suffix=* | --program-suffi=* \
283   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
284     program_suffix="$ac_optarg" ;;
285
286   -program-transform-name | --program-transform-name \
287   | --program-transform-nam | --program-transform-na \
288   | --program-transform-n | --program-transform- \
289   | --program-transform | --program-transfor \
290   | --program-transfo | --program-transf \
291   | --program-trans | --program-tran \
292   | --progr-tra | --program-tr | --program-t)
293     ac_prev=program_transform_name ;;
294   -program-transform-name=* | --program-transform-name=* \
295   | --program-transform-nam=* | --program-transform-na=* \
296   | --program-transform-n=* | --program-transform-=* \
297   | --program-transform=* | --program-transfor=* \
298   | --program-transfo=* | --program-transf=* \
299   | --program-trans=* | --program-tran=* \
300   | --progr-tra=* | --program-tr=* | --program-t=*)
301     program_transform_name="$ac_optarg" ;;
302
303   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
304   | -silent | --silent | --silen | --sile | --sil)
305     silent=yes ;;
306
307   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
308     ac_prev=sbindir ;;
309   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
310   | --sbi=* | --sb=*)
311     sbindir="$ac_optarg" ;;
312
313   -sharedstatedir | --sharedstatedir | --sharedstatedi \
314   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
315   | --sharedst | --shareds | --shared | --share | --shar \
316   | --sha | --sh)
317     ac_prev=sharedstatedir ;;
318   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
319   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
320   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
321   | --sha=* | --sh=*)
322     sharedstatedir="$ac_optarg" ;;
323
324   -site | --site | --sit)
325     ac_prev=site ;;
326   -site=* | --site=* | --sit=*)
327     site="$ac_optarg" ;;
328
329   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
330     ac_prev=srcdir ;;
331   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
332     srcdir="$ac_optarg" ;;
333
334   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
335   | --syscon | --sysco | --sysc | --sys | --sy)
336     ac_prev=sysconfdir ;;
337   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
338   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
339     sysconfdir="$ac_optarg" ;;
340
341   -target | --target | --targe | --targ | --tar | --ta | --t)
342     ac_prev=target ;;
343   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
344     target="$ac_optarg" ;;
345
346   -v | -verbose | --verbose | --verbos | --verbo | --verb)
347     verbose=yes ;;
348
349   -version | --version | --versio | --versi | --vers)
350     echo "configure generated by autoconf version 2.13"
351     exit 0 ;;
352
353   -with-* | --with-*)
354     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
355     # Reject names that are not valid shell variable names.
356     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
357       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
358     fi
359     ac_package=`echo $ac_package| sed 's/-/_/g'`
360     case "$ac_option" in
361       *=*) ;;
362       *) ac_optarg=yes ;;
363     esac
364     eval "with_${ac_package}='$ac_optarg'" ;;
365
366   -without-* | --without-*)
367     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
368     # Reject names that are not valid shell variable names.
369     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
370       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
371     fi
372     ac_package=`echo $ac_package| sed 's/-/_/g'`
373     eval "with_${ac_package}=no" ;;
374
375   --x)
376     # Obsolete; use --with-x.
377     with_x=yes ;;
378
379   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
380   | --x-incl | --x-inc | --x-in | --x-i)
381     ac_prev=x_includes ;;
382   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
383   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
384     x_includes="$ac_optarg" ;;
385
386   -x-libraries | --x-libraries | --x-librarie | --x-librari \
387   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
388     ac_prev=x_libraries ;;
389   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
390   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
391     x_libraries="$ac_optarg" ;;
392
393   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
394     ;;
395
396   *)
397     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
398       echo "configure: warning: $ac_option: invalid host type" 1>&2
399     fi
400     if test "x$nonopt" != xNONE; then
401       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
402     fi
403     nonopt="$ac_option"
404     ;;
405
406   esac
407 done
408
409 if test -n "$ac_prev"; then
410   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
411 fi
412
413 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
414
415 # File descriptor usage:
416 # 0 standard input
417 # 1 file creation
418 # 2 errors and warnings
419 # 3 some systems may open it to /dev/tty
420 # 4 used on the Kubota Titan
421 # 6 checking for... messages and results
422 # 5 compiler messages saved in config.log
423 if test "$silent" = yes; then
424   exec 6>/dev/null
425 else
426   exec 6>&1
427 fi
428 exec 5>./config.log
429
430 echo "\
431 This file contains any messages produced by compilers while
432 running configure, to aid debugging if configure makes a mistake.
433 " 1>&5
434
435 # Strip out --no-create and --no-recursion so they do not pile up.
436 # Also quote any args containing shell metacharacters.
437 ac_configure_args=
438 for ac_arg
439 do
440   case "$ac_arg" in
441   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
442   | --no-cr | --no-c) ;;
443   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
444   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
445   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
446   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
447   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
448   esac
449 done
450
451 # NLS nuisances.
452 # Only set these to C if already set.  These must not be set unconditionally
453 # because not all systems understand e.g. LANG=C (notably SCO).
454 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
455 # Non-C LC_CTYPE values break the ctype check.
456 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
457 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
458 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
459 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
460
461 # confdefs.h avoids OS command line length limits that DEFS can exceed.
462 rm -rf conftest* confdefs.h
463 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
464 echo > confdefs.h
465
466 # A filename unique to this package, relative to the directory that
467 # configure is in, which we can look for to find out if srcdir is correct.
468 ac_unique_file=.version
469
470 # Find the source files, if location was not specified.
471 if test -z "$srcdir"; then
472   ac_srcdir_defaulted=yes
473   # Try the directory containing this script, then its parent.
474   ac_prog=$0
475   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
476   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
477   srcdir=$ac_confdir
478   if test ! -r $srcdir/$ac_unique_file; then
479     srcdir=..
480   fi
481 else
482   ac_srcdir_defaulted=no
483 fi
484 if test ! -r $srcdir/$ac_unique_file; then
485   if test "$ac_srcdir_defaulted" = yes; then
486     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
487   else
488     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
489   fi
490 fi
491 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
492
493 # Prefer explicitly selected file to automatically selected ones.
494 if test -z "$CONFIG_SITE"; then
495   if test "x$prefix" != xNONE; then
496     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
497   else
498     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
499   fi
500 fi
501 for ac_site_file in $CONFIG_SITE; do
502   if test -r "$ac_site_file"; then
503     echo "loading site script $ac_site_file"
504     . "$ac_site_file"
505   fi
506 done
507
508 if test -r "$cache_file"; then
509   echo "loading cache $cache_file"
510   . $cache_file
511 else
512   echo "creating cache $cache_file"
513   > $cache_file
514 fi
515
516 ac_ext=c
517 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
518 ac_cpp='$CPP $CPPFLAGS'
519 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
520 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
521 cross_compiling=$ac_cv_prog_cc_cross
522
523 ac_exeext=
524 ac_objext=o
525 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
526   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
527   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
528     ac_n= ac_c='
529 ' ac_t='        '
530   else
531     ac_n=-n ac_c= ac_t=
532   fi
533 else
534   ac_n= ac_c='\c' ac_t=
535 fi
536
537
538
539
540 for ac_prog in mawk gawk nawk awk
541 do
542 # Extract the first word of "$ac_prog", so it can be a program name with args.
543 set dummy $ac_prog; ac_word=$2
544 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
545 echo "configure:546: checking for $ac_word" >&5
546 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
547   echo $ac_n "(cached) $ac_c" 1>&6
548 else
549   if test -n "$AWK"; then
550   ac_cv_prog_AWK="$AWK" # Let the user override the test.
551 else
552   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
553   ac_dummy="$PATH"
554   for ac_dir in $ac_dummy; do
555     test -z "$ac_dir" && ac_dir=.
556     if test -f $ac_dir/$ac_word; then
557       ac_cv_prog_AWK="$ac_prog"
558       break
559     fi
560   done
561   IFS="$ac_save_ifs"
562 fi
563 fi
564 AWK="$ac_cv_prog_AWK"
565 if test -n "$AWK"; then
566   echo "$ac_t""$AWK" 1>&6
567 else
568   echo "$ac_t""no" 1>&6
569 fi
570
571 test -n "$AWK" && break
572 done
573
574
575 echo $ac_n "checking version of the package""... $ac_c" 1>&6
576 echo "configure:577: checking version of the package" >&5
577 if test -f .version; then
578   VERSION=`cat .version`
579   echo "$ac_t""$VERSION" 1>&6
580 else
581   VERSION="0.0.0"
582   echo "$ac_t""unknown using 0.0.0" 1>&6
583 fi
584 VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
585 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
586 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
587
588
589
590
591 cat >> confdefs.h <<EOF
592 #define VERSIONSTR "${VERSION}"
593 EOF
594
595 cat >> confdefs.h <<EOF
596 #define VERSIONHI $VERSIONHI
597 EOF
598
599 cat >> confdefs.h <<EOF
600 #define VERSIONLO $VERSIONLO
601 EOF
602
603 cat >> confdefs.h <<EOF
604 #define VERSIONP $VERSIONP
605 EOF
606
607
608 # Some options
609 #==============
610 # Check whether --enable-ucsim or --disable-ucsim was given.
611 if test "${enable_ucsim+set}" = set; then
612   enableval="$enable_ucsim"
613   if test $enable_ucsim != "no"; then
614     enable_ucsim="yes"
615 fi
616 else
617   #default
618 enable_ucsim="no"
619 fi
620
621 # Check whether --enable-dlso or --disable-dlso was given.
622 if test "${enable_dlso+set}" = set; then
623   enableval="$enable_dlso"
624   if test $enable_dlso != "no"; then
625     enable_dlso="yes"
626 fi
627 else
628   enable_dlso="no"
629 fi
630
631 # Check whether --enable-51 or --disable-51 was given.
632 if test "${enable_51+set}" = set; then
633   enableval="$enable_51"
634   if test $enable_51 != "no"; then
635     enable_51="yes"
636 fi
637 else
638   enable_51="yes"
639 fi
640
641 # Check whether --enable-avr or --disable-avr was given.
642 if test "${enable_avr+set}" = set; then
643   enableval="$enable_avr"
644   if test $enable_avr != "no"; then
645     enable_avr="yes"
646 fi
647 else
648   enable_avr="yes"
649 fi
650
651 # Check whether --enable-z80 or --disable-z80 was given.
652 if test "${enable_z80+set}" = set; then
653   enableval="$enable_z80"
654   if test $enable_z80 != "no"; then
655     enable_z80="yes"
656 fi
657 else
658   enable_z80="no"
659 fi
660
661 # Check whether --enable-xa or --disable-xa was given.
662 if test "${enable_xa+set}" = set; then
663   enableval="$enable_xa"
664   if test $enable_xa != "no"; then
665     enable_xa="yes"
666 fi
667 else
668   enable_xa="no"
669 fi
670
671 # Check whether --enable-portmon or --disable-portmon was given.
672 if test "${enable_portmon+set}" = set; then
673   enableval="$enable_portmon"
674   if test $enable_serio != "no"; then
675     enable_serio="yes"
676 fi
677 else
678   enable_serio="yes"
679 fi
680
681
682
683
684
685
686
687
688
689 # Required programs
690 #-------------------
691 for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
692 do
693 # Extract the first word of "$ac_prog", so it can be a program name with args.
694 set dummy $ac_prog; ac_word=$2
695 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
696 echo "configure:697: checking for $ac_word" >&5
697 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
698   echo $ac_n "(cached) $ac_c" 1>&6
699 else
700   if test -n "$CXX"; then
701   ac_cv_prog_CXX="$CXX" # Let the user override the test.
702 else
703   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
704   ac_dummy="$PATH"
705   for ac_dir in $ac_dummy; do
706     test -z "$ac_dir" && ac_dir=.
707     if test -f $ac_dir/$ac_word; then
708       ac_cv_prog_CXX="$ac_prog"
709       break
710     fi
711   done
712   IFS="$ac_save_ifs"
713 fi
714 fi
715 CXX="$ac_cv_prog_CXX"
716 if test -n "$CXX"; then
717   echo "$ac_t""$CXX" 1>&6
718 else
719   echo "$ac_t""no" 1>&6
720 fi
721
722 test -n "$CXX" && break
723 done
724 test -n "$CXX" || CXX="gcc"
725
726
727 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
728 echo "configure:729: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
729
730 ac_ext=C
731 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
732 ac_cpp='$CXXCPP $CPPFLAGS'
733 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
734 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
735 cross_compiling=$ac_cv_prog_cxx_cross
736
737 cat > conftest.$ac_ext << EOF
738
739 #line 740 "configure"
740 #include "confdefs.h"
741
742 int main(){return(0);}
743 EOF
744 if { (eval echo configure:745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
745   ac_cv_prog_cxx_works=yes
746   # If we can't run a trivial program, we are probably using a cross compiler.
747   if (./conftest; exit) 2>/dev/null; then
748     ac_cv_prog_cxx_cross=no
749   else
750     ac_cv_prog_cxx_cross=yes
751   fi
752 else
753   echo "configure: failed program was:" >&5
754   cat conftest.$ac_ext >&5
755   ac_cv_prog_cxx_works=no
756 fi
757 rm -fr conftest*
758 ac_ext=c
759 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
760 ac_cpp='$CPP $CPPFLAGS'
761 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
762 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
763 cross_compiling=$ac_cv_prog_cc_cross
764
765 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
766 if test $ac_cv_prog_cxx_works = no; then
767   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
768 fi
769 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
770 echo "configure:771: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
771 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
772 cross_compiling=$ac_cv_prog_cxx_cross
773
774 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
775 echo "configure:776: checking whether we are using GNU C++" >&5
776 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
777   echo $ac_n "(cached) $ac_c" 1>&6
778 else
779   cat > conftest.C <<EOF
780 #ifdef __GNUC__
781   yes;
782 #endif
783 EOF
784 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
785   ac_cv_prog_gxx=yes
786 else
787   ac_cv_prog_gxx=no
788 fi
789 fi
790
791 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
792
793 if test $ac_cv_prog_gxx = yes; then
794   GXX=yes
795 else
796   GXX=
797 fi
798
799 ac_test_CXXFLAGS="${CXXFLAGS+set}"
800 ac_save_CXXFLAGS="$CXXFLAGS"
801 CXXFLAGS=
802 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
803 echo "configure:804: checking whether ${CXX-g++} accepts -g" >&5
804 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
805   echo $ac_n "(cached) $ac_c" 1>&6
806 else
807   echo 'void f(){}' > conftest.cc
808 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
809   ac_cv_prog_cxx_g=yes
810 else
811   ac_cv_prog_cxx_g=no
812 fi
813 rm -f conftest*
814
815 fi
816
817 echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
818 if test "$ac_test_CXXFLAGS" = set; then
819   CXXFLAGS="$ac_save_CXXFLAGS"
820 elif test $ac_cv_prog_cxx_g = yes; then
821   if test "$GXX" = yes; then
822     CXXFLAGS="-g -O2"
823   else
824     CXXFLAGS="-g"
825   fi
826 else
827   if test "$GXX" = yes; then
828     CXXFLAGS="-O2"
829   else
830     CXXFLAGS=
831   fi
832 fi
833
834 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
835 echo "configure:836: checking how to run the C++ preprocessor" >&5
836 if test -z "$CXXCPP"; then
837 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
838   echo $ac_n "(cached) $ac_c" 1>&6
839 else
840   ac_ext=C
841 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
842 ac_cpp='$CXXCPP $CPPFLAGS'
843 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
844 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
845 cross_compiling=$ac_cv_prog_cxx_cross
846   CXXCPP="${CXX-g++} -E"
847   cat > conftest.$ac_ext <<EOF
848 #line 849 "configure"
849 #include "confdefs.h"
850 #include <stdlib.h>
851 EOF
852 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
853 { (eval echo configure:854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
854 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
855 if test -z "$ac_err"; then
856   :
857 else
858   echo "$ac_err" >&5
859   echo "configure: failed program was:" >&5
860   cat conftest.$ac_ext >&5
861   rm -rf conftest*
862   CXXCPP=/lib/cpp
863 fi
864 rm -f conftest*
865   ac_cv_prog_CXXCPP="$CXXCPP"
866 ac_ext=c
867 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
868 ac_cpp='$CPP $CPPFLAGS'
869 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
870 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
871 cross_compiling=$ac_cv_prog_cc_cross
872 fi
873 fi
874 CXXCPP="$ac_cv_prog_CXXCPP"
875 echo "$ac_t""$CXXCPP" 1>&6
876
877 ac_aux_dir=
878 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
879   if test -f $ac_dir/install-sh; then
880     ac_aux_dir=$ac_dir
881     ac_install_sh="$ac_aux_dir/install-sh -c"
882     break
883   elif test -f $ac_dir/install.sh; then
884     ac_aux_dir=$ac_dir
885     ac_install_sh="$ac_aux_dir/install.sh -c"
886     break
887   fi
888 done
889 if test -z "$ac_aux_dir"; then
890   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
891 fi
892 ac_config_guess=$ac_aux_dir/config.guess
893 ac_config_sub=$ac_aux_dir/config.sub
894 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
895
896 # Find a good install program.  We prefer a C program (faster),
897 # so one script is as good as another.  But avoid the broken or
898 # incompatible versions:
899 # SysV /etc/install, /usr/sbin/install
900 # SunOS /usr/etc/install
901 # IRIX /sbin/install
902 # AIX /bin/install
903 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
904 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
905 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
906 # ./install, which can be erroneously created by make from ./install.sh.
907 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
908 echo "configure:909: checking for a BSD compatible install" >&5
909 if test -z "$INSTALL"; then
910 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
911   echo $ac_n "(cached) $ac_c" 1>&6
912 else
913     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
914   for ac_dir in $PATH; do
915     # Account for people who put trailing slashes in PATH elements.
916     case "$ac_dir/" in
917     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
918     *)
919       # OSF1 and SCO ODT 3.0 have their own names for install.
920       # Don't use installbsd from OSF since it installs stuff as root
921       # by default.
922       for ac_prog in ginstall scoinst install; do
923         if test -f $ac_dir/$ac_prog; then
924           if test $ac_prog = install &&
925             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
926             # AIX install.  It has an incompatible calling convention.
927             :
928           else
929             ac_cv_path_install="$ac_dir/$ac_prog -c"
930             break 2
931           fi
932         fi
933       done
934       ;;
935     esac
936   done
937   IFS="$ac_save_IFS"
938
939 fi
940   if test "${ac_cv_path_install+set}" = set; then
941     INSTALL="$ac_cv_path_install"
942   else
943     # As a last resort, use the slow shell script.  We don't cache a
944     # path for INSTALL within a source directory, because that will
945     # break other packages using the cache if that directory is
946     # removed, or if the path is relative.
947     INSTALL="$ac_install_sh"
948   fi
949 fi
950 echo "$ac_t""$INSTALL" 1>&6
951
952 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
953 # It thinks the first close brace ends the variable substitution.
954 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
955
956 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
957
958 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
959
960 # Extract the first word of "ranlib", so it can be a program name with args.
961 set dummy ranlib; ac_word=$2
962 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
963 echo "configure:964: checking for $ac_word" >&5
964 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
965   echo $ac_n "(cached) $ac_c" 1>&6
966 else
967   if test -n "$RANLIB"; then
968   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
969 else
970   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
971   ac_dummy="$PATH"
972   for ac_dir in $ac_dummy; do
973     test -z "$ac_dir" && ac_dir=.
974     if test -f $ac_dir/$ac_word; then
975       ac_cv_prog_RANLIB="ranlib"
976       break
977     fi
978   done
979   IFS="$ac_save_ifs"
980   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
981 fi
982 fi
983 RANLIB="$ac_cv_prog_RANLIB"
984 if test -n "$RANLIB"; then
985   echo "$ac_t""$RANLIB" 1>&6
986 else
987   echo "$ac_t""no" 1>&6
988 fi
989
990 ac_ext=C
991 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
992 ac_cpp='$CXXCPP $CPPFLAGS'
993 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
994 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
995 cross_compiling=$ac_cv_prog_cxx_cross
996
997
998 # Extract the first word of "strip", so it can be a program name with args.
999 set dummy strip; ac_word=$2
1000 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1001 echo "configure:1002: checking for $ac_word" >&5
1002 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
1003   echo $ac_n "(cached) $ac_c" 1>&6
1004 else
1005   if test -n "$STRIP"; then
1006   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
1007 else
1008   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1009   ac_dummy="$PATH"
1010   for ac_dir in $ac_dummy; do
1011     test -z "$ac_dir" && ac_dir=.
1012     if test -f $ac_dir/$ac_word; then
1013       ac_cv_prog_STRIP="strip"
1014       break
1015     fi
1016   done
1017   IFS="$ac_save_ifs"
1018   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
1019 fi
1020 fi
1021 STRIP="$ac_cv_prog_STRIP"
1022 if test -n "$STRIP"; then
1023   echo "$ac_t""$STRIP" 1>&6
1024 else
1025   echo "$ac_t""no" 1>&6
1026 fi
1027
1028
1029 # Checking for header files.
1030 # ===========================================================================
1031
1032 if test -d /stuff/include; then
1033   CPPFLAGS="$CPPFLAGS -I/stuff/include"
1034 fi
1035
1036 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1037 echo "configure:1038: checking for ANSI C header files" >&5
1038 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1039   echo $ac_n "(cached) $ac_c" 1>&6
1040 else
1041   cat > conftest.$ac_ext <<EOF
1042 #line 1043 "configure"
1043 #include "confdefs.h"
1044 #include <stdlib.h>
1045 #include <stdarg.h>
1046 #include <string.h>
1047 #include <float.h>
1048 EOF
1049 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1050 { (eval echo configure:1051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1051 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1052 if test -z "$ac_err"; then
1053   rm -rf conftest*
1054   ac_cv_header_stdc=yes
1055 else
1056   echo "$ac_err" >&5
1057   echo "configure: failed program was:" >&5
1058   cat conftest.$ac_ext >&5
1059   rm -rf conftest*
1060   ac_cv_header_stdc=no
1061 fi
1062 rm -f conftest*
1063
1064 if test $ac_cv_header_stdc = yes; then
1065   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1066 cat > conftest.$ac_ext <<EOF
1067 #line 1068 "configure"
1068 #include "confdefs.h"
1069 #include <string.h>
1070 EOF
1071 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1072   egrep "memchr" >/dev/null 2>&1; then
1073   :
1074 else
1075   rm -rf conftest*
1076   ac_cv_header_stdc=no
1077 fi
1078 rm -f conftest*
1079
1080 fi
1081
1082 if test $ac_cv_header_stdc = yes; then
1083   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1084 cat > conftest.$ac_ext <<EOF
1085 #line 1086 "configure"
1086 #include "confdefs.h"
1087 #include <stdlib.h>
1088 EOF
1089 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1090   egrep "free" >/dev/null 2>&1; then
1091   :
1092 else
1093   rm -rf conftest*
1094   ac_cv_header_stdc=no
1095 fi
1096 rm -f conftest*
1097
1098 fi
1099
1100 if test $ac_cv_header_stdc = yes; then
1101   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1102 if test "$cross_compiling" = yes; then
1103   :
1104 else
1105   cat > conftest.$ac_ext <<EOF
1106 #line 1107 "configure"
1107 #include "confdefs.h"
1108 #ifdef __cplusplus
1109 extern "C" void exit(int);
1110 #endif
1111 #include <ctype.h>
1112 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1113 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1114 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1115 int main () { int i; for (i = 0; i < 256; i++)
1116 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1117 exit (0); }
1118
1119 EOF
1120 if { (eval echo configure:1121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1121 then
1122   :
1123 else
1124   echo "configure: failed program was:" >&5
1125   cat conftest.$ac_ext >&5
1126   rm -fr conftest*
1127   ac_cv_header_stdc=no
1128 fi
1129 rm -fr conftest*
1130 fi
1131
1132 fi
1133 fi
1134
1135 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1136 if test $ac_cv_header_stdc = yes; then
1137   cat >> confdefs.h <<\EOF
1138 #define STDC_HEADERS 1
1139 EOF
1140
1141 fi
1142
1143 for ac_hdr in getopt.h
1144 do
1145 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1146 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1147 echo "configure:1148: checking for $ac_hdr" >&5
1148 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1149   echo $ac_n "(cached) $ac_c" 1>&6
1150 else
1151   cat > conftest.$ac_ext <<EOF
1152 #line 1153 "configure"
1153 #include "confdefs.h"
1154 #include <$ac_hdr>
1155 EOF
1156 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1157 { (eval echo configure:1158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1158 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1159 if test -z "$ac_err"; then
1160   rm -rf conftest*
1161   eval "ac_cv_header_$ac_safe=yes"
1162 else
1163   echo "$ac_err" >&5
1164   echo "configure: failed program was:" >&5
1165   cat conftest.$ac_ext >&5
1166   rm -rf conftest*
1167   eval "ac_cv_header_$ac_safe=no"
1168 fi
1169 rm -f conftest*
1170 fi
1171 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1172   echo "$ac_t""yes" 1>&6
1173     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1174   cat >> confdefs.h <<EOF
1175 #define $ac_tr_hdr 1
1176 EOF
1177  
1178 else
1179   echo "$ac_t""no" 1>&6
1180 fi
1181 done
1182
1183 for ac_hdr in unistd.h
1184 do
1185 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1186 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1187 echo "configure:1188: checking for $ac_hdr" >&5
1188 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1189   echo $ac_n "(cached) $ac_c" 1>&6
1190 else
1191   cat > conftest.$ac_ext <<EOF
1192 #line 1193 "configure"
1193 #include "confdefs.h"
1194 #include <$ac_hdr>
1195 EOF
1196 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1197 { (eval echo configure:1198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1198 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1199 if test -z "$ac_err"; then
1200   rm -rf conftest*
1201   eval "ac_cv_header_$ac_safe=yes"
1202 else
1203   echo "$ac_err" >&5
1204   echo "configure: failed program was:" >&5
1205   cat conftest.$ac_ext >&5
1206   rm -rf conftest*
1207   eval "ac_cv_header_$ac_safe=no"
1208 fi
1209 rm -f conftest*
1210 fi
1211 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1212   echo "$ac_t""yes" 1>&6
1213     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1214   cat >> confdefs.h <<EOF
1215 #define $ac_tr_hdr 1
1216 EOF
1217  
1218 else
1219   echo "$ac_t""no" 1>&6
1220 fi
1221 done
1222
1223 ac_safe=`echo "sys/socket.h" | sed 'y%./+-%__p_%'`
1224 echo $ac_n "checking for sys/socket.h""... $ac_c" 1>&6
1225 echo "configure:1226: checking for sys/socket.h" >&5
1226 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1227   echo $ac_n "(cached) $ac_c" 1>&6
1228 else
1229   cat > conftest.$ac_ext <<EOF
1230 #line 1231 "configure"
1231 #include "confdefs.h"
1232 #include <sys/socket.h>
1233 EOF
1234 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1235 { (eval echo configure:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1236 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1237 if test -z "$ac_err"; then
1238   rm -rf conftest*
1239   eval "ac_cv_header_$ac_safe=yes"
1240 else
1241   echo "$ac_err" >&5
1242   echo "configure: failed program was:" >&5
1243   cat conftest.$ac_ext >&5
1244   rm -rf conftest*
1245   eval "ac_cv_header_$ac_safe=no"
1246 fi
1247 rm -f conftest*
1248 fi
1249 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1250   echo "$ac_t""yes" 1>&6
1251   cat >> confdefs.h <<\EOF
1252 #define SOCKET_AVAIL 1
1253 EOF
1254
1255     cat >> confdefs.h <<\EOF
1256 #define HAVE_SYS_SOCKET_H 1
1257 EOF
1258
1259     cat > conftest.$ac_ext <<EOF
1260 #line 1261 "configure"
1261 #include "confdefs.h"
1262 #include <sys/socket.h>
1263 EOF
1264 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1265   egrep "socklen_t" >/dev/null 2>&1; then
1266   rm -rf conftest*
1267   cat >> confdefs.h <<EOF
1268 #define SOCKLEN_T socklen_t
1269 EOF
1270
1271 else
1272   rm -rf conftest*
1273   cat >> confdefs.h <<EOF
1274 #define SOCKLEN_T uint
1275 EOF
1276
1277 fi
1278 rm -f conftest*
1279
1280
1281 else
1282   echo "$ac_t""no" 1>&6
1283 fi
1284
1285 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
1286 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
1287 echo "configure:1288: checking for dlfcn.h" >&5
1288 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1289   echo $ac_n "(cached) $ac_c" 1>&6
1290 else
1291   cat > conftest.$ac_ext <<EOF
1292 #line 1293 "configure"
1293 #include "confdefs.h"
1294 #include <dlfcn.h>
1295 EOF
1296 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1297 { (eval echo configure:1298: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1298 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1299 if test -z "$ac_err"; then
1300   rm -rf conftest*
1301   eval "ac_cv_header_$ac_safe=yes"
1302 else
1303   echo "$ac_err" >&5
1304   echo "configure: failed program was:" >&5
1305   cat conftest.$ac_ext >&5
1306   rm -rf conftest*
1307   eval "ac_cv_header_$ac_safe=no"
1308 fi
1309 rm -f conftest*
1310 fi
1311 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1312   echo "$ac_t""yes" 1>&6
1313   :
1314 else
1315   echo "$ac_t""no" 1>&6
1316 fi
1317
1318 ac_header_dirent=no
1319 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1320 do
1321 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1322 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1323 echo "configure:1324: checking for $ac_hdr that defines DIR" >&5
1324 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1325   echo $ac_n "(cached) $ac_c" 1>&6
1326 else
1327   cat > conftest.$ac_ext <<EOF
1328 #line 1329 "configure"
1329 #include "confdefs.h"
1330 #include <sys/types.h>
1331 #include <$ac_hdr>
1332 int main() {
1333 DIR *dirp = 0;
1334 ; return 0; }
1335 EOF
1336 if { (eval echo configure:1337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1337   rm -rf conftest*
1338   eval "ac_cv_header_dirent_$ac_safe=yes"
1339 else
1340   echo "configure: failed program was:" >&5
1341   cat conftest.$ac_ext >&5
1342   rm -rf conftest*
1343   eval "ac_cv_header_dirent_$ac_safe=no"
1344 fi
1345 rm -f conftest*
1346 fi
1347 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1348   echo "$ac_t""yes" 1>&6
1349     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1350   cat >> confdefs.h <<EOF
1351 #define $ac_tr_hdr 1
1352 EOF
1353  ac_header_dirent=$ac_hdr; break
1354 else
1355   echo "$ac_t""no" 1>&6
1356 fi
1357 done
1358 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1359 if test $ac_header_dirent = dirent.h; then
1360 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1361 echo "configure:1362: checking for opendir in -ldir" >&5
1362 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1363 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1364   echo $ac_n "(cached) $ac_c" 1>&6
1365 else
1366   ac_save_LIBS="$LIBS"
1367 LIBS="-ldir  $LIBS"
1368 cat > conftest.$ac_ext <<EOF
1369 #line 1370 "configure"
1370 #include "confdefs.h"
1371 /* Override any gcc2 internal prototype to avoid an error.  */
1372 #ifdef __cplusplus
1373 extern "C"
1374 #endif
1375 /* We use char because int might match the return type of a gcc2
1376     builtin and then its argument prototype would still apply.  */
1377 char opendir();
1378
1379 int main() {
1380 opendir()
1381 ; return 0; }
1382 EOF
1383 if { (eval echo configure:1384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1384   rm -rf conftest*
1385   eval "ac_cv_lib_$ac_lib_var=yes"
1386 else
1387   echo "configure: failed program was:" >&5
1388   cat conftest.$ac_ext >&5
1389   rm -rf conftest*
1390   eval "ac_cv_lib_$ac_lib_var=no"
1391 fi
1392 rm -f conftest*
1393 LIBS="$ac_save_LIBS"
1394
1395 fi
1396 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1397   echo "$ac_t""yes" 1>&6
1398   LIBS="$LIBS -ldir"
1399 else
1400   echo "$ac_t""no" 1>&6
1401 fi
1402
1403 else
1404 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1405 echo "configure:1406: checking for opendir in -lx" >&5
1406 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1407 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1408   echo $ac_n "(cached) $ac_c" 1>&6
1409 else
1410   ac_save_LIBS="$LIBS"
1411 LIBS="-lx  $LIBS"
1412 cat > conftest.$ac_ext <<EOF
1413 #line 1414 "configure"
1414 #include "confdefs.h"
1415 /* Override any gcc2 internal prototype to avoid an error.  */
1416 #ifdef __cplusplus
1417 extern "C"
1418 #endif
1419 /* We use char because int might match the return type of a gcc2
1420     builtin and then its argument prototype would still apply.  */
1421 char opendir();
1422
1423 int main() {
1424 opendir()
1425 ; return 0; }
1426 EOF
1427 if { (eval echo configure:1428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1428   rm -rf conftest*
1429   eval "ac_cv_lib_$ac_lib_var=yes"
1430 else
1431   echo "configure: failed program was:" >&5
1432   cat conftest.$ac_ext >&5
1433   rm -rf conftest*
1434   eval "ac_cv_lib_$ac_lib_var=no"
1435 fi
1436 rm -f conftest*
1437 LIBS="$ac_save_LIBS"
1438
1439 fi
1440 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1441   echo "$ac_t""yes" 1>&6
1442   LIBS="$LIBS -lx"
1443 else
1444   echo "$ac_t""no" 1>&6
1445 fi
1446
1447 fi
1448
1449
1450 # This must be after CXXCPP
1451
1452 echo $ac_n "checking which header file defines FD_ macros""... $ac_c" 1>&6
1453 echo "configure:1454: checking which header file defines FD_ macros" >&5
1454 if eval "test \"`echo '$''{'ucsim_cv_fd'+set}'`\" = set"; then
1455   echo $ac_n "(cached) $ac_c" 1>&6
1456 else
1457   ucsim_cv_fd="unknown"
1458 cat > conftest.$ac_ext <<EOF
1459 #line 1460 "configure"
1460 #include "confdefs.h"
1461
1462 #include <sys/time.h>
1463 #ifdef FD_ZERO
1464 yes
1465 #endif
1466 EOF
1467 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1468   egrep "yes" >/dev/null 2>&1; then
1469   rm -rf conftest*
1470   ucsim_cv_fd="<sys/time.h>"
1471 fi
1472 rm -f conftest*
1473
1474 cat > conftest.$ac_ext <<EOF
1475 #line 1476 "configure"
1476 #include "confdefs.h"
1477
1478 #include <sys/types.h>
1479 #ifdef FD_ZERO
1480 yes
1481 #endif
1482 EOF
1483 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1484   egrep "yes" >/dev/null 2>&1; then
1485   rm -rf conftest*
1486   ucsim_cv_fd="<sys/types.h>"
1487 fi
1488 rm -f conftest*
1489
1490 cat > conftest.$ac_ext <<EOF
1491 #line 1492 "configure"
1492 #include "confdefs.h"
1493
1494 #include <sys/select.h>
1495 #ifdef FD_ZERO
1496 yes
1497 #endif
1498 EOF
1499 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1500   egrep "yes" >/dev/null 2>&1; then
1501   rm -rf conftest*
1502   ucsim_cv_fd="<sys/types.h>"
1503 fi
1504 rm -f conftest*
1505
1506 fi
1507
1508 echo "$ac_t""$ucsim_cv_fd" 1>&6
1509
1510 cat >> confdefs.h <<\EOF
1511 #define FD_HEADER_OK 0
1512 EOF
1513
1514 if echo $ucsim_cv_fd|grep time >/dev/null 2>&1; then
1515 cat >> confdefs.h <<\EOF
1516 #define FD_NEED_TIME_H 1
1517 EOF
1518
1519 cat >> confdefs.h <<\EOF
1520 #define FD_HEADER_OK 1
1521 EOF
1522
1523 else
1524 cat >> confdefs.h <<\EOF
1525 #define FD_NEED_TIME_H 0
1526 EOF
1527
1528 fi
1529 if echo $ucsim_cv_fd|grep types >/dev/null 2>&1; then
1530 cat >> confdefs.h <<\EOF
1531 #define FD_NEED_TYPES_H 1
1532 EOF
1533
1534 cat >> confdefs.h <<\EOF
1535 #define FD_HEADER_OK 1
1536 EOF
1537
1538 else
1539 cat >> confdefs.h <<\EOF
1540 #define FD_NEED_TYPES_H 0
1541 EOF
1542
1543 fi
1544 if echo $ucsim_cv_fd|grep select >/dev/null 2>&1; then
1545 cat >> confdefs.h <<\EOF
1546 #define FD_NEED_SELECT_H 1
1547 EOF
1548
1549 cat >> confdefs.h <<\EOF
1550 #define FD_HEADER_OK 1
1551 EOF
1552
1553 else
1554 cat >> confdefs.h <<\EOF
1555 #define FD_NEED_SELECT_H 0
1556 EOF
1557
1558 fi
1559
1560 cat >> confdefs.h <<EOF
1561 #define HEADER_FD ${ucsim_cv_fd}
1562 EOF
1563
1564
1565
1566 # Checking for functions/libs
1567 # ===========================================================================
1568 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
1569 echo "configure:1570: checking for socket in -lsocket" >&5
1570 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
1571 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1572   echo $ac_n "(cached) $ac_c" 1>&6
1573 else
1574   ac_save_LIBS="$LIBS"
1575 LIBS="-lsocket  $LIBS"
1576 cat > conftest.$ac_ext <<EOF
1577 #line 1578 "configure"
1578 #include "confdefs.h"
1579 /* Override any gcc2 internal prototype to avoid an error.  */
1580 #ifdef __cplusplus
1581 extern "C"
1582 #endif
1583 /* We use char because int might match the return type of a gcc2
1584     builtin and then its argument prototype would still apply.  */
1585 char socket();
1586
1587 int main() {
1588 socket()
1589 ; return 0; }
1590 EOF
1591 if { (eval echo configure:1592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1592   rm -rf conftest*
1593   eval "ac_cv_lib_$ac_lib_var=yes"
1594 else
1595   echo "configure: failed program was:" >&5
1596   cat conftest.$ac_ext >&5
1597   rm -rf conftest*
1598   eval "ac_cv_lib_$ac_lib_var=no"
1599 fi
1600 rm -f conftest*
1601 LIBS="$ac_save_LIBS"
1602
1603 fi
1604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1605   echo "$ac_t""yes" 1>&6
1606     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1607     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1608   cat >> confdefs.h <<EOF
1609 #define $ac_tr_lib 1
1610 EOF
1611
1612   LIBS="-lsocket $LIBS"
1613
1614 else
1615   echo "$ac_t""no" 1>&6
1616 fi
1617
1618 echo $ac_n "checking for xdr_short in -lnsl""... $ac_c" 1>&6
1619 echo "configure:1620: checking for xdr_short in -lnsl" >&5
1620 ac_lib_var=`echo nsl'_'xdr_short | sed 'y%./+-%__p_%'`
1621 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1622   echo $ac_n "(cached) $ac_c" 1>&6
1623 else
1624   ac_save_LIBS="$LIBS"
1625 LIBS="-lnsl  $LIBS"
1626 cat > conftest.$ac_ext <<EOF
1627 #line 1628 "configure"
1628 #include "confdefs.h"
1629 /* Override any gcc2 internal prototype to avoid an error.  */
1630 #ifdef __cplusplus
1631 extern "C"
1632 #endif
1633 /* We use char because int might match the return type of a gcc2
1634     builtin and then its argument prototype would still apply.  */
1635 char xdr_short();
1636
1637 int main() {
1638 xdr_short()
1639 ; return 0; }
1640 EOF
1641 if { (eval echo configure:1642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1642   rm -rf conftest*
1643   eval "ac_cv_lib_$ac_lib_var=yes"
1644 else
1645   echo "configure: failed program was:" >&5
1646   cat conftest.$ac_ext >&5
1647   rm -rf conftest*
1648   eval "ac_cv_lib_$ac_lib_var=no"
1649 fi
1650 rm -f conftest*
1651 LIBS="$ac_save_LIBS"
1652
1653 fi
1654 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1655   echo "$ac_t""yes" 1>&6
1656     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1657     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1658   cat >> confdefs.h <<EOF
1659 #define $ac_tr_lib 1
1660 EOF
1661
1662   LIBS="-lnsl $LIBS"
1663
1664 else
1665   echo "$ac_t""no" 1>&6
1666 fi
1667
1668 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
1669 echo "configure:1670: checking for dlopen in -ldl" >&5
1670 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
1671 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1672   echo $ac_n "(cached) $ac_c" 1>&6
1673 else
1674   ac_save_LIBS="$LIBS"
1675 LIBS="-ldl  $LIBS"
1676 cat > conftest.$ac_ext <<EOF
1677 #line 1678 "configure"
1678 #include "confdefs.h"
1679 /* Override any gcc2 internal prototype to avoid an error.  */
1680 #ifdef __cplusplus
1681 extern "C"
1682 #endif
1683 /* We use char because int might match the return type of a gcc2
1684     builtin and then its argument prototype would still apply.  */
1685 char dlopen();
1686
1687 int main() {
1688 dlopen()
1689 ; return 0; }
1690 EOF
1691 if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1692   rm -rf conftest*
1693   eval "ac_cv_lib_$ac_lib_var=yes"
1694 else
1695   echo "configure: failed program was:" >&5
1696   cat conftest.$ac_ext >&5
1697   rm -rf conftest*
1698   eval "ac_cv_lib_$ac_lib_var=no"
1699 fi
1700 rm -f conftest*
1701 LIBS="$ac_save_LIBS"
1702
1703 fi
1704 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1705   echo "$ac_t""yes" 1>&6
1706   dl_ok="yes"
1707 DL="-ldl"
1708 else
1709   echo "$ac_t""no" 1>&6
1710 dl_ok="no"
1711 DL=""
1712 fi
1713
1714
1715
1716 echo $ac_n "checking for panel_above in -lpanel""... $ac_c" 1>&6
1717 echo "configure:1718: checking for panel_above in -lpanel" >&5
1718 ac_lib_var=`echo panel'_'panel_above | sed 'y%./+-%__p_%'`
1719 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1720   echo $ac_n "(cached) $ac_c" 1>&6
1721 else
1722   ac_save_LIBS="$LIBS"
1723 LIBS="-lpanel -lcurses $LIBS"
1724 cat > conftest.$ac_ext <<EOF
1725 #line 1726 "configure"
1726 #include "confdefs.h"
1727 /* Override any gcc2 internal prototype to avoid an error.  */
1728 #ifdef __cplusplus
1729 extern "C"
1730 #endif
1731 /* We use char because int might match the return type of a gcc2
1732     builtin and then its argument prototype would still apply.  */
1733 char panel_above();
1734
1735 int main() {
1736 panel_above()
1737 ; return 0; }
1738 EOF
1739 if { (eval echo configure:1740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1740   rm -rf conftest*
1741   eval "ac_cv_lib_$ac_lib_var=yes"
1742 else
1743   echo "configure: failed program was:" >&5
1744   cat conftest.$ac_ext >&5
1745   rm -rf conftest*
1746   eval "ac_cv_lib_$ac_lib_var=no"
1747 fi
1748 rm -f conftest*
1749 LIBS="$ac_save_LIBS"
1750
1751 fi
1752 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1753   echo "$ac_t""yes" 1>&6
1754   panel_ok="yes"
1755 curses_ok="yes"
1756 CURSES_LIBS="-lpanel -lcurses"
1757
1758 else
1759   echo "$ac_t""no" 1>&6
1760 panel_ok="no"
1761 echo $ac_n "checking for nl in -lcurses""... $ac_c" 1>&6
1762 echo "configure:1763: checking for nl in -lcurses" >&5
1763 ac_lib_var=`echo curses'_'nl | sed 'y%./+-%__p_%'`
1764 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1765   echo $ac_n "(cached) $ac_c" 1>&6
1766 else
1767   ac_save_LIBS="$LIBS"
1768 LIBS="-lcurses  $LIBS"
1769 cat > conftest.$ac_ext <<EOF
1770 #line 1771 "configure"
1771 #include "confdefs.h"
1772 /* Override any gcc2 internal prototype to avoid an error.  */
1773 #ifdef __cplusplus
1774 extern "C"
1775 #endif
1776 /* We use char because int might match the return type of a gcc2
1777     builtin and then its argument prototype would still apply.  */
1778 char nl();
1779
1780 int main() {
1781 nl()
1782 ; return 0; }
1783 EOF
1784 if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1785   rm -rf conftest*
1786   eval "ac_cv_lib_$ac_lib_var=yes"
1787 else
1788   echo "configure: failed program was:" >&5
1789   cat conftest.$ac_ext >&5
1790   rm -rf conftest*
1791   eval "ac_cv_lib_$ac_lib_var=no"
1792 fi
1793 rm -f conftest*
1794 LIBS="$ac_save_LIBS"
1795
1796 fi
1797 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1798   echo "$ac_t""yes" 1>&6
1799   curses_ok="yes"
1800 CURSES_LIBS="-lcurses"
1801
1802 else
1803   echo "$ac_t""no" 1>&6
1804 ncurses_ok="no"
1805 fi
1806
1807
1808 fi
1809
1810
1811
1812
1813
1814 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
1815 echo "configure:1816: checking for vprintf" >&5
1816 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
1817   echo $ac_n "(cached) $ac_c" 1>&6
1818 else
1819   cat > conftest.$ac_ext <<EOF
1820 #line 1821 "configure"
1821 #include "confdefs.h"
1822 /* System header to define __stub macros and hopefully few prototypes,
1823     which can conflict with char vprintf(); below.  */
1824 #include <assert.h>
1825 /* Override any gcc2 internal prototype to avoid an error.  */
1826 #ifdef __cplusplus
1827 extern "C"
1828 #endif
1829 /* We use char because int might match the return type of a gcc2
1830     builtin and then its argument prototype would still apply.  */
1831 char vprintf();
1832
1833 int main() {
1834
1835 /* The GNU C library defines this for functions which it implements
1836     to always fail with ENOSYS.  Some functions are actually named
1837     something starting with __ and the normal name is an alias.  */
1838 #if defined (__stub_vprintf) || defined (__stub___vprintf)
1839 choke me
1840 #else
1841 vprintf();
1842 #endif
1843
1844 ; return 0; }
1845 EOF
1846 if { (eval echo configure:1847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1847   rm -rf conftest*
1848   eval "ac_cv_func_vprintf=yes"
1849 else
1850   echo "configure: failed program was:" >&5
1851   cat conftest.$ac_ext >&5
1852   rm -rf conftest*
1853   eval "ac_cv_func_vprintf=no"
1854 fi
1855 rm -f conftest*
1856 fi
1857
1858 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
1859   echo "$ac_t""yes" 1>&6
1860   cat >> confdefs.h <<\EOF
1861 #define HAVE_VPRINTF 1
1862 EOF
1863
1864 else
1865   echo "$ac_t""no" 1>&6
1866 fi
1867
1868 if test "$ac_cv_func_vprintf" != yes; then
1869 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
1870 echo "configure:1871: checking for _doprnt" >&5
1871 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
1872   echo $ac_n "(cached) $ac_c" 1>&6
1873 else
1874   cat > conftest.$ac_ext <<EOF
1875 #line 1876 "configure"
1876 #include "confdefs.h"
1877 /* System header to define __stub macros and hopefully few prototypes,
1878     which can conflict with char _doprnt(); below.  */
1879 #include <assert.h>
1880 /* Override any gcc2 internal prototype to avoid an error.  */
1881 #ifdef __cplusplus
1882 extern "C"
1883 #endif
1884 /* We use char because int might match the return type of a gcc2
1885     builtin and then its argument prototype would still apply.  */
1886 char _doprnt();
1887
1888 int main() {
1889
1890 /* The GNU C library defines this for functions which it implements
1891     to always fail with ENOSYS.  Some functions are actually named
1892     something starting with __ and the normal name is an alias.  */
1893 #if defined (__stub__doprnt) || defined (__stub____doprnt)
1894 choke me
1895 #else
1896 _doprnt();
1897 #endif
1898
1899 ; return 0; }
1900 EOF
1901 if { (eval echo configure:1902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1902   rm -rf conftest*
1903   eval "ac_cv_func__doprnt=yes"
1904 else
1905   echo "configure: failed program was:" >&5
1906   cat conftest.$ac_ext >&5
1907   rm -rf conftest*
1908   eval "ac_cv_func__doprnt=no"
1909 fi
1910 rm -f conftest*
1911 fi
1912
1913 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
1914   echo "$ac_t""yes" 1>&6
1915   cat >> confdefs.h <<\EOF
1916 #define HAVE_DOPRNT 1
1917 EOF
1918
1919 else
1920   echo "$ac_t""no" 1>&6
1921 fi
1922
1923 fi
1924
1925 for ac_func in vsnprintf vasprintf
1926 do
1927 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1928 echo "configure:1929: checking for $ac_func" >&5
1929 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1930   echo $ac_n "(cached) $ac_c" 1>&6
1931 else
1932   cat > conftest.$ac_ext <<EOF
1933 #line 1934 "configure"
1934 #include "confdefs.h"
1935 /* System header to define __stub macros and hopefully few prototypes,
1936     which can conflict with char $ac_func(); below.  */
1937 #include <assert.h>
1938 /* Override any gcc2 internal prototype to avoid an error.  */
1939 #ifdef __cplusplus
1940 extern "C"
1941 #endif
1942 /* We use char because int might match the return type of a gcc2
1943     builtin and then its argument prototype would still apply.  */
1944 char $ac_func();
1945
1946 int main() {
1947
1948 /* The GNU C library defines this for functions which it implements
1949     to always fail with ENOSYS.  Some functions are actually named
1950     something starting with __ and the normal name is an alias.  */
1951 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1952 choke me
1953 #else
1954 $ac_func();
1955 #endif
1956
1957 ; return 0; }
1958 EOF
1959 if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1960   rm -rf conftest*
1961   eval "ac_cv_func_$ac_func=yes"
1962 else
1963   echo "configure: failed program was:" >&5
1964   cat conftest.$ac_ext >&5
1965   rm -rf conftest*
1966   eval "ac_cv_func_$ac_func=no"
1967 fi
1968 rm -f conftest*
1969 fi
1970
1971 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1972   echo "$ac_t""yes" 1>&6
1973     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1974   cat >> confdefs.h <<EOF
1975 #define $ac_tr_func 1
1976 EOF
1977  
1978 else
1979   echo "$ac_t""no" 1>&6
1980 fi
1981 done
1982
1983 for ac_func in strlen strcpy strcat strstr strcmp strerror strtok strdup
1984 do
1985 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1986 echo "configure:1987: checking for $ac_func" >&5
1987 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1988   echo $ac_n "(cached) $ac_c" 1>&6
1989 else
1990   cat > conftest.$ac_ext <<EOF
1991 #line 1992 "configure"
1992 #include "confdefs.h"
1993 /* System header to define __stub macros and hopefully few prototypes,
1994     which can conflict with char $ac_func(); below.  */
1995 #include <assert.h>
1996 /* Override any gcc2 internal prototype to avoid an error.  */
1997 #ifdef __cplusplus
1998 extern "C"
1999 #endif
2000 /* We use char because int might match the return type of a gcc2
2001     builtin and then its argument prototype would still apply.  */
2002 char $ac_func();
2003
2004 int main() {
2005
2006 /* The GNU C library defines this for functions which it implements
2007     to always fail with ENOSYS.  Some functions are actually named
2008     something starting with __ and the normal name is an alias.  */
2009 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2010 choke me
2011 #else
2012 $ac_func();
2013 #endif
2014
2015 ; return 0; }
2016 EOF
2017 if { (eval echo configure:2018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2018   rm -rf conftest*
2019   eval "ac_cv_func_$ac_func=yes"
2020 else
2021   echo "configure: failed program was:" >&5
2022   cat conftest.$ac_ext >&5
2023   rm -rf conftest*
2024   eval "ac_cv_func_$ac_func=no"
2025 fi
2026 rm -f conftest*
2027 fi
2028
2029 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2030   echo "$ac_t""yes" 1>&6
2031     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2032   cat >> confdefs.h <<EOF
2033 #define $ac_tr_func 1
2034 EOF
2035  
2036 else
2037   echo "$ac_t""no" 1>&6
2038 fi
2039 done
2040
2041 for ac_func in strchr memcpy
2042 do
2043 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2044 echo "configure:2045: checking for $ac_func" >&5
2045 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2046   echo $ac_n "(cached) $ac_c" 1>&6
2047 else
2048   cat > conftest.$ac_ext <<EOF
2049 #line 2050 "configure"
2050 #include "confdefs.h"
2051 /* System header to define __stub macros and hopefully few prototypes,
2052     which can conflict with char $ac_func(); below.  */
2053 #include <assert.h>
2054 /* Override any gcc2 internal prototype to avoid an error.  */
2055 #ifdef __cplusplus
2056 extern "C"
2057 #endif
2058 /* We use char because int might match the return type of a gcc2
2059     builtin and then its argument prototype would still apply.  */
2060 char $ac_func();
2061
2062 int main() {
2063
2064 /* The GNU C library defines this for functions which it implements
2065     to always fail with ENOSYS.  Some functions are actually named
2066     something starting with __ and the normal name is an alias.  */
2067 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2068 choke me
2069 #else
2070 $ac_func();
2071 #endif
2072
2073 ; return 0; }
2074 EOF
2075 if { (eval echo configure:2076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2076   rm -rf conftest*
2077   eval "ac_cv_func_$ac_func=yes"
2078 else
2079   echo "configure: failed program was:" >&5
2080   cat conftest.$ac_ext >&5
2081   rm -rf conftest*
2082   eval "ac_cv_func_$ac_func=no"
2083 fi
2084 rm -f conftest*
2085 fi
2086
2087 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2088   echo "$ac_t""yes" 1>&6
2089     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2090   cat >> confdefs.h <<EOF
2091 #define $ac_tr_func 1
2092 EOF
2093  
2094 else
2095   echo "$ac_t""no" 1>&6
2096 fi
2097 done
2098
2099 for ac_func in fgets
2100 do
2101 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2102 echo "configure:2103: checking for $ac_func" >&5
2103 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2104   echo $ac_n "(cached) $ac_c" 1>&6
2105 else
2106   cat > conftest.$ac_ext <<EOF
2107 #line 2108 "configure"
2108 #include "confdefs.h"
2109 /* System header to define __stub macros and hopefully few prototypes,
2110     which can conflict with char $ac_func(); below.  */
2111 #include <assert.h>
2112 /* Override any gcc2 internal prototype to avoid an error.  */
2113 #ifdef __cplusplus
2114 extern "C"
2115 #endif
2116 /* We use char because int might match the return type of a gcc2
2117     builtin and then its argument prototype would still apply.  */
2118 char $ac_func();
2119
2120 int main() {
2121
2122 /* The GNU C library defines this for functions which it implements
2123     to always fail with ENOSYS.  Some functions are actually named
2124     something starting with __ and the normal name is an alias.  */
2125 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2126 choke me
2127 #else
2128 $ac_func();
2129 #endif
2130
2131 ; return 0; }
2132 EOF
2133 if { (eval echo configure:2134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2134   rm -rf conftest*
2135   eval "ac_cv_func_$ac_func=yes"
2136 else
2137   echo "configure: failed program was:" >&5
2138   cat conftest.$ac_ext >&5
2139   rm -rf conftest*
2140   eval "ac_cv_func_$ac_func=no"
2141 fi
2142 rm -f conftest*
2143 fi
2144
2145 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2146   echo "$ac_t""yes" 1>&6
2147     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2148   cat >> confdefs.h <<EOF
2149 #define $ac_tr_func 1
2150 EOF
2151  
2152 else
2153   echo "$ac_t""no" 1>&6
2154 fi
2155 done
2156
2157 for ac_func in yylex
2158 do
2159 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2160 echo "configure:2161: checking for $ac_func" >&5
2161 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2162   echo $ac_n "(cached) $ac_c" 1>&6
2163 else
2164   cat > conftest.$ac_ext <<EOF
2165 #line 2166 "configure"
2166 #include "confdefs.h"
2167 /* System header to define __stub macros and hopefully few prototypes,
2168     which can conflict with char $ac_func(); below.  */
2169 #include <assert.h>
2170 /* Override any gcc2 internal prototype to avoid an error.  */
2171 #ifdef __cplusplus
2172 extern "C"
2173 #endif
2174 /* We use char because int might match the return type of a gcc2
2175     builtin and then its argument prototype would still apply.  */
2176 char $ac_func();
2177
2178 int main() {
2179
2180 /* The GNU C library defines this for functions which it implements
2181     to always fail with ENOSYS.  Some functions are actually named
2182     something starting with __ and the normal name is an alias.  */
2183 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2184 choke me
2185 #else
2186 $ac_func();
2187 #endif
2188
2189 ; return 0; }
2190 EOF
2191 if { (eval echo configure:2192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2192   rm -rf conftest*
2193   eval "ac_cv_func_$ac_func=yes"
2194 else
2195   echo "configure: failed program was:" >&5
2196   cat conftest.$ac_ext >&5
2197   rm -rf conftest*
2198   eval "ac_cv_func_$ac_func=no"
2199 fi
2200 rm -f conftest*
2201 fi
2202
2203 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2204   echo "$ac_t""yes" 1>&6
2205     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2206   cat >> confdefs.h <<EOF
2207 #define $ac_tr_func 1
2208 EOF
2209  
2210 else
2211   echo "$ac_t""no" 1>&6
2212 fi
2213 done
2214
2215
2216 echo $ac_n "checking whether scanf knows %a""... $ac_c" 1>&6
2217 echo "configure:2218: checking whether scanf knows %a" >&5
2218 if eval "test \"`echo '$''{'ucsim_cv_scanf_a'+set}'`\" = set"; then
2219   echo $ac_n "(cached) $ac_c" 1>&6
2220 else
2221   echo "a b" >conftest.data
2222 if test "$cross_compiling" = yes; then
2223   ucsim_cv_scanf_a="unknown"
2224 else
2225   cat > conftest.$ac_ext <<EOF
2226 #line 2227 "configure"
2227 #include "confdefs.h"
2228 #ifdef __cplusplus
2229 extern "C" void exit(int);
2230 #endif
2231
2232 #include <stdio.h>
2233 void main(void)
2234 {
2235   FILE *f;
2236   char *a;
2237   int  i;
2238   if ((f= fopen("conftest.data", "r")) == NULL)
2239     exit(1);
2240   i= fscanf(f, " %a[a-z] ", &a);
2241   fclose(f);
2242   if (i == 0)
2243     exit(2);
2244   if (i == 1)
2245     exit(0);
2246   exit(3);
2247 }
2248 EOF
2249 if { (eval echo configure:2250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2250 then
2251   ucsim_cv_scanf_a="yes"
2252 else
2253   echo "configure: failed program was:" >&5
2254   cat conftest.$ac_ext >&5
2255   rm -fr conftest*
2256   ucsim_cv_scanf_a="no"
2257 fi
2258 rm -fr conftest*
2259 fi
2260
2261
2262 fi
2263
2264 echo "$ac_t""$ucsim_cv_scanf_a" 1>&6
2265 if test "$ucsim_cv_scanf_a" = "yes"; then
2266   cat >> confdefs.h <<\EOF
2267 #define SCANF_A 1
2268 EOF
2269
2270 fi
2271
2272 echo $ac_n "checking whether getcwd is GNUish""... $ac_c" 1>&6
2273 echo "configure:2274: checking whether getcwd is GNUish" >&5
2274 if eval "test \"`echo '$''{'ucsim_cv_getcwd'+set}'`\" = set"; then
2275   echo $ac_n "(cached) $ac_c" 1>&6
2276 else
2277   if test "$cross_compiling" = yes; then
2278   ucsim_cv_getcwd="unknown"
2279 else
2280   cat > conftest.$ac_ext <<EOF
2281 #line 2282 "configure"
2282 #include "confdefs.h"
2283 #ifdef __cplusplus
2284 extern "C" void exit(int);
2285 #endif
2286
2287 #include <unistd.h>
2288 void main(void)
2289 {
2290   if ((getcwd(NULL, 0)) == NULL)
2291     exit(1);
2292   exit(0);
2293 }
2294 EOF
2295 if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2296 then
2297   ucsim_cv_getcwd="yes"
2298 else
2299   echo "configure: failed program was:" >&5
2300   cat conftest.$ac_ext >&5
2301   rm -fr conftest*
2302   ucsim_cv_getcwd="no"
2303 fi
2304 rm -fr conftest*
2305 fi
2306
2307
2308 fi
2309
2310 echo "$ac_t""$ucsim_cv_getcwd" 1>&6
2311 if test "$ucsim_cv_getcwd" = "yes"; then
2312   cat >> confdefs.h <<\EOF
2313 #define GNU_GETCWD 1
2314 EOF
2315
2316 fi
2317
2318
2319 #'
2320
2321 echo $ac_n "checking for type of length pointer parameter of accept""... $ac_c" 1>&6
2322 echo "configure:2323: checking for type of length pointer parameter of accept" >&5
2323 if eval "test \"`echo '$''{'ucsim_cv_accept_length_type'+set}'`\" = set"; then
2324   echo $ac_n "(cached) $ac_c" 1>&6
2325 else
2326   ac_save_CPPFLAGS="$CPPFLAGS"
2327     ucsim_cv_accept_length_type=no
2328     for ac_val in int size_t socklen_t; do
2329       CPPFLAGS="$ac_save_CPPFLAGS -DACCEPT_SOCKLEN_T=$ac_val"
2330       cat > conftest.$ac_ext <<EOF
2331 #line 2332 "configure"
2332 #include "confdefs.h"
2333 #include <sys/types.h>
2334 #include <sys/socket.h>
2335 int main() {
2336 struct sockaddr a; $ac_val len; accept (0, &a, &len);
2337 ; return 0; }
2338 EOF
2339 if { (eval echo configure:2340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2340   rm -rf conftest*
2341   ucsim_cv_accept_length_type=$ac_val; break
2342 else
2343   echo "configure: failed program was:" >&5
2344   cat conftest.$ac_ext >&5
2345 fi
2346 rm -f conftest*
2347     done
2348     CPPFLAGS="$ac_save_CPPFLAGS"
2349 fi
2350
2351 echo "$ac_t""$ucsim_cv_accept_length_type" 1>&6
2352   if test "$ucsim_cv_accept_length_type" != no; then
2353     cat >> confdefs.h <<EOF
2354 #define ACCEPT_SOCKLEN_T $ucsim_cv_accept_length_type
2355 EOF
2356
2357   fi
2358  
2359
2360
2361 # Macro definitions
2362 ###################
2363
2364 # DD_COPT macro checks if the compiler specified as the 1st parameter
2365 # supports option specified as the 2nd parameter
2366 # For example: DD_COPT(CXX, fPIC)
2367
2368
2369
2370
2371 # Checking characteristics of compilers and other programs
2372 # --------------------------------------------------------
2373
2374 # Cross compiling overrides
2375 # FIXME
2376 if test "$CC" = "i586-mingw32msvc-gcc"; then
2377   ac_cv_c_bigendian=no
2378   ac_cv_sizeof_char=1
2379   ac_cv_sizeof_short=2
2380   ac_cv_sizeof_int=4 
2381   ac_cv_sizeof_long=4
2382   ac_cv_sizeof_long_long=4
2383 fi
2384
2385 if test "$cross_compiling" == "no"
2386 then
2387     echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
2388 echo "configure:2389: checking whether byte ordering is bigendian" >&5
2389 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
2390   echo $ac_n "(cached) $ac_c" 1>&6
2391 else
2392   ac_cv_c_bigendian=unknown
2393 # See if sys/param.h defines the BYTE_ORDER macro.
2394 cat > conftest.$ac_ext <<EOF
2395 #line 2396 "configure"
2396 #include "confdefs.h"
2397 #include <sys/types.h>
2398 #include <sys/param.h>
2399 int main() {
2400
2401 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
2402  bogus endian macros
2403 #endif
2404 ; return 0; }
2405 EOF
2406 if { (eval echo configure:2407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2407   rm -rf conftest*
2408   # It does; now see whether it defined to BIG_ENDIAN or not.
2409 cat > conftest.$ac_ext <<EOF
2410 #line 2411 "configure"
2411 #include "confdefs.h"
2412 #include <sys/types.h>
2413 #include <sys/param.h>
2414 int main() {
2415
2416 #if BYTE_ORDER != BIG_ENDIAN
2417  not big endian
2418 #endif
2419 ; return 0; }
2420 EOF
2421 if { (eval echo configure:2422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2422   rm -rf conftest*
2423   ac_cv_c_bigendian=yes
2424 else
2425   echo "configure: failed program was:" >&5
2426   cat conftest.$ac_ext >&5
2427   rm -rf conftest*
2428   ac_cv_c_bigendian=no
2429 fi
2430 rm -f conftest*
2431 else
2432   echo "configure: failed program was:" >&5
2433   cat conftest.$ac_ext >&5
2434 fi
2435 rm -f conftest*
2436 if test $ac_cv_c_bigendian = unknown; then
2437 if test "$cross_compiling" = yes; then
2438     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2439 else
2440   cat > conftest.$ac_ext <<EOF
2441 #line 2442 "configure"
2442 #include "confdefs.h"
2443 #ifdef __cplusplus
2444 extern "C" void exit(int);
2445 #endif
2446 main () {
2447   /* Are we little or big endian?  From Harbison&Steele.  */
2448   union
2449   {
2450     long l;
2451     char c[sizeof (long)];
2452   } u;
2453   u.l = 1;
2454   exit (u.c[sizeof (long) - 1] == 1);
2455 }
2456 EOF
2457 if { (eval echo configure:2458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2458 then
2459   ac_cv_c_bigendian=no
2460 else
2461   echo "configure: failed program was:" >&5
2462   cat conftest.$ac_ext >&5
2463   rm -fr conftest*
2464   ac_cv_c_bigendian=yes
2465 fi
2466 rm -fr conftest*
2467 fi
2468
2469 fi
2470 fi
2471
2472 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
2473 if test $ac_cv_c_bigendian = yes; then
2474   cat >> confdefs.h <<\EOF
2475 #define WORDS_BIGENDIAN 1
2476 EOF
2477
2478 fi
2479
2480 else
2481 #echo "CROSS ENDIAN"
2482     if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
2483         ac_cv_c_bigendian=no
2484     else
2485         : # FIXME
2486     fi
2487 #echo "CROSS ENDIAN DONE"
2488 fi
2489
2490 echo $ac_n "checking whether preprocessor accepts -MM or -M""... $ac_c" 1>&6
2491 echo "configure:2492: checking whether preprocessor accepts -MM or -M" >&5
2492 if eval "test \"`echo '$''{'ucsim_cv_MM'+set}'`\" = set"; then
2493   echo $ac_n "(cached) $ac_c" 1>&6
2494 else
2495   echo "#include <stdio.h>" >_test_.c
2496 echo "" >>_test_.c
2497 $CXXCPP -v -MM _test_.c 1>&5 2>&5
2498 if test "$?" = "0"; then
2499   ucsim_cv_MM="-MM"
2500 else
2501   ucsim_cv_MM="-M"
2502 fi
2503 rm -f _test_.*
2504 fi
2505
2506 echo "$ac_t""$ucsim_cv_MM" 1>&6
2507 M_OR_MM=$ucsim_cv_MM
2508
2509
2510 # This is the first time when CFLAGS are set/modified!!
2511
2512
2513 echo $ac_n "checking whether $CXX accepts -ggdb""... $ac_c" 1>&6
2514 echo "configure:2515: checking whether $CXX accepts -ggdb" >&5
2515 if eval "test \"`echo '$''{'ucsim_cv_CXXggdb'+set}'`\" = set"; then
2516   echo $ac_n "(cached) $ac_c" 1>&6
2517 else
2518   cat >_test_.c <<EOF
2519 #include <stdio.h>
2520 void main(void) {}
2521 EOF
2522 $CXX -v -ggdb -c _test_.c 1>&5 2>&5
2523 if test "$?" = "0"; then
2524   ucsim_cv_CXXggdb="yes"
2525 else
2526   ucsim_cv_CXXggdb="no"
2527 fi
2528 rm -f _test_.* a.out
2529 fi
2530
2531 echo "$ac_t""$ucsim_cv_CXXggdb" 1>&6
2532
2533 if test "$ucsim_cv_CXXggdb" = "yes"; then
2534     if test "$CXXFLAGS"x = x ;then
2535         CXXFLAGS="-ggdb"
2536     else
2537         CXXFLAGS="$CXXFLAGS -ggdb"
2538     fi
2539 fi
2540
2541
2542 echo $ac_n "checking whether $CXX accepts -pipe""... $ac_c" 1>&6
2543 echo "configure:2544: checking whether $CXX accepts -pipe" >&5
2544 if eval "test \"`echo '$''{'ucsim_cv_CXXpipe'+set}'`\" = set"; then
2545   echo $ac_n "(cached) $ac_c" 1>&6
2546 else
2547   cat >_test_.c <<EOF
2548 #include <stdio.h>
2549 void main(void) {}
2550 EOF
2551 $CXX -v -pipe -c _test_.c 1>&5 2>&5
2552 if test "$?" = "0"; then
2553   ucsim_cv_CXXpipe="yes"
2554 else
2555   ucsim_cv_CXXpipe="no"
2556 fi
2557 rm -f _test_.* a.out
2558 fi
2559
2560 echo "$ac_t""$ucsim_cv_CXXpipe" 1>&6
2561
2562 if test "$ucsim_cv_CXXpipe" = "yes"; then
2563   CXXFLAGS="$CXXFLAGS -pipe"
2564 fi
2565
2566 PICOPT=""
2567 SHAREDLIB="no"
2568
2569 echo $ac_n "checking whether $CXX accepts -fPIC""... $ac_c" 1>&6
2570 echo "configure:2571: checking whether $CXX accepts -fPIC" >&5
2571 if eval "test \"`echo '$''{'ucsim_cv_CXXfPIC'+set}'`\" = set"; then
2572   echo $ac_n "(cached) $ac_c" 1>&6
2573 else
2574   cat >_test_.c <<EOF
2575 #include <stdio.h>
2576 void main(void) {}
2577 EOF
2578 $CXX -v -fPIC -c _test_.c 1>&5 2>&5
2579 if test "$?" = "0"; then
2580   ucsim_cv_CXXfPIC="yes"
2581 else
2582   ucsim_cv_CXXfPIC="no"
2583 fi
2584 rm -f _test_.* a.out
2585 fi
2586
2587 echo "$ac_t""$ucsim_cv_CXXfPIC" 1>&6
2588
2589 if test "$ucsim_cv_CXXfPIC" = "yes"; then
2590     PICOPT="-fPIC"
2591 else
2592     
2593 echo $ac_n "checking whether $CXX accepts -fpic""... $ac_c" 1>&6
2594 echo "configure:2595: checking whether $CXX accepts -fpic" >&5
2595 if eval "test \"`echo '$''{'ucsim_cv_CXXfpic'+set}'`\" = set"; then
2596   echo $ac_n "(cached) $ac_c" 1>&6
2597 else
2598   cat >_test_.c <<EOF
2599 #include <stdio.h>
2600 void main(void) {}
2601 EOF
2602 $CXX -v -fpic -c _test_.c 1>&5 2>&5
2603 if test "$?" = "0"; then
2604   ucsim_cv_CXXfpic="yes"
2605 else
2606   ucsim_cv_CXXfpic="no"
2607 fi
2608 rm -f _test_.* a.out
2609 fi
2610
2611 echo "$ac_t""$ucsim_cv_CXXfpic" 1>&6
2612
2613     if test "$ucsim_cv_CXXfpic" = "yes"; then
2614         PICOPT="-fpic"
2615     fi
2616 fi
2617 if test "$PICOPT"x != "x"; then
2618     SHAREDLIB="yes"
2619 fi
2620 # If this is Cygwin neither use Position Independant Code
2621 # nor build .so
2622 # Quick + dirty by Bernhard
2623 # FIXME
2624 if $CXX -v 2>&1 | grep -i cygwin 1>&5 2>&5; then
2625     PICOPT=""
2626     SHAREDLIB="no"
2627 fi
2628
2629
2630
2631 dlso_ok="no"
2632 if test $SHAREDLIB = "yes" -a $dl_ok = "yes" -a $enable_dlso = "yes"; then
2633     dlso_ok="yes"
2634 fi
2635
2636
2637 # Checks for typedefs, structures, and compiler characteristics.
2638 # ===========================================================================
2639
2640 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
2641 echo "configure:2642: checking return type of signal handlers" >&5
2642 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
2643   echo $ac_n "(cached) $ac_c" 1>&6
2644 else
2645   cat > conftest.$ac_ext <<EOF
2646 #line 2647 "configure"
2647 #include "confdefs.h"
2648 #include <sys/types.h>
2649 #include <signal.h>
2650 #ifdef signal
2651 #undef signal
2652 #endif
2653 #ifdef __cplusplus
2654 extern "C" void (*signal (int, void (*)(int)))(int);
2655 #else
2656 void (*signal ()) ();
2657 #endif
2658
2659 int main() {
2660 int i;
2661 ; return 0; }
2662 EOF
2663 if { (eval echo configure:2664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2664   rm -rf conftest*
2665   ac_cv_type_signal=void
2666 else
2667   echo "configure: failed program was:" >&5
2668   cat conftest.$ac_ext >&5
2669   rm -rf conftest*
2670   ac_cv_type_signal=int
2671 fi
2672 rm -f conftest*
2673 fi
2674
2675 echo "$ac_t""$ac_cv_type_signal" 1>&6
2676 cat >> confdefs.h <<EOF
2677 #define RETSIGTYPE $ac_cv_type_signal
2678 EOF
2679
2680
2681 if test "$cross_compiling" = "no"; then
2682 echo $ac_n "checking size of char""... $ac_c" 1>&6
2683 echo "configure:2684: checking size of char" >&5
2684 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
2685   echo $ac_n "(cached) $ac_c" 1>&6
2686 else
2687   if test "$cross_compiling" = yes; then
2688     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2689 else
2690   cat > conftest.$ac_ext <<EOF
2691 #line 2692 "configure"
2692 #include "confdefs.h"
2693 #ifdef __cplusplus
2694 extern "C" void exit(int);
2695 #endif
2696 #include <stdio.h>
2697 #include <sys/types.h>
2698 main()
2699 {
2700   FILE *f=fopen("conftestval", "w");
2701   if (!f) exit(1);
2702   fprintf(f, "%d\n", sizeof(char));
2703   exit(0);
2704 }
2705 EOF
2706 if { (eval echo configure:2707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2707 then
2708   ac_cv_sizeof_char=`cat conftestval`
2709 else
2710   echo "configure: failed program was:" >&5
2711   cat conftest.$ac_ext >&5
2712   rm -fr conftest*
2713   ac_cv_sizeof_char=0
2714 fi
2715 rm -fr conftest*
2716 fi
2717
2718 fi
2719 echo "$ac_t""$ac_cv_sizeof_char" 1>&6
2720 cat >> confdefs.h <<EOF
2721 #define SIZEOF_CHAR $ac_cv_sizeof_char
2722 EOF
2723
2724
2725 echo $ac_n "checking size of short""... $ac_c" 1>&6
2726 echo "configure:2727: checking size of short" >&5
2727 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
2728   echo $ac_n "(cached) $ac_c" 1>&6
2729 else
2730   if test "$cross_compiling" = yes; then
2731     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2732 else
2733   cat > conftest.$ac_ext <<EOF
2734 #line 2735 "configure"
2735 #include "confdefs.h"
2736 #ifdef __cplusplus
2737 extern "C" void exit(int);
2738 #endif
2739 #include <stdio.h>
2740 #include <sys/types.h>
2741 main()
2742 {
2743   FILE *f=fopen("conftestval", "w");
2744   if (!f) exit(1);
2745   fprintf(f, "%d\n", sizeof(short));
2746   exit(0);
2747 }
2748 EOF
2749 if { (eval echo configure:2750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2750 then
2751   ac_cv_sizeof_short=`cat conftestval`
2752 else
2753   echo "configure: failed program was:" >&5
2754   cat conftest.$ac_ext >&5
2755   rm -fr conftest*
2756   ac_cv_sizeof_short=0
2757 fi
2758 rm -fr conftest*
2759 fi
2760
2761 fi
2762 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
2763 cat >> confdefs.h <<EOF
2764 #define SIZEOF_SHORT $ac_cv_sizeof_short
2765 EOF
2766
2767
2768 echo $ac_n "checking size of int""... $ac_c" 1>&6
2769 echo "configure:2770: checking size of int" >&5
2770 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
2771   echo $ac_n "(cached) $ac_c" 1>&6
2772 else
2773   if test "$cross_compiling" = yes; then
2774     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2775 else
2776   cat > conftest.$ac_ext <<EOF
2777 #line 2778 "configure"
2778 #include "confdefs.h"
2779 #ifdef __cplusplus
2780 extern "C" void exit(int);
2781 #endif
2782 #include <stdio.h>
2783 #include <sys/types.h>
2784 main()
2785 {
2786   FILE *f=fopen("conftestval", "w");
2787   if (!f) exit(1);
2788   fprintf(f, "%d\n", sizeof(int));
2789   exit(0);
2790 }
2791 EOF
2792 if { (eval echo configure:2793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2793 then
2794   ac_cv_sizeof_int=`cat conftestval`
2795 else
2796   echo "configure: failed program was:" >&5
2797   cat conftest.$ac_ext >&5
2798   rm -fr conftest*
2799   ac_cv_sizeof_int=0
2800 fi
2801 rm -fr conftest*
2802 fi
2803
2804 fi
2805 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
2806 cat >> confdefs.h <<EOF
2807 #define SIZEOF_INT $ac_cv_sizeof_int
2808 EOF
2809
2810
2811 echo $ac_n "checking size of long""... $ac_c" 1>&6
2812 echo "configure:2813: checking size of long" >&5
2813 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
2814   echo $ac_n "(cached) $ac_c" 1>&6
2815 else
2816   if test "$cross_compiling" = yes; then
2817     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2818 else
2819   cat > conftest.$ac_ext <<EOF
2820 #line 2821 "configure"
2821 #include "confdefs.h"
2822 #ifdef __cplusplus
2823 extern "C" void exit(int);
2824 #endif
2825 #include <stdio.h>
2826 #include <sys/types.h>
2827 main()
2828 {
2829   FILE *f=fopen("conftestval", "w");
2830   if (!f) exit(1);
2831   fprintf(f, "%d\n", sizeof(long));
2832   exit(0);
2833 }
2834 EOF
2835 if { (eval echo configure:2836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2836 then
2837   ac_cv_sizeof_long=`cat conftestval`
2838 else
2839   echo "configure: failed program was:" >&5
2840   cat conftest.$ac_ext >&5
2841   rm -fr conftest*
2842   ac_cv_sizeof_long=0
2843 fi
2844 rm -fr conftest*
2845 fi
2846
2847 fi
2848 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
2849 cat >> confdefs.h <<EOF
2850 #define SIZEOF_LONG $ac_cv_sizeof_long
2851 EOF
2852
2853
2854 echo $ac_n "checking size of long long""... $ac_c" 1>&6
2855 echo "configure:2856: checking size of long long" >&5
2856 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
2857   echo $ac_n "(cached) $ac_c" 1>&6
2858 else
2859   if test "$cross_compiling" = yes; then
2860     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2861 else
2862   cat > conftest.$ac_ext <<EOF
2863 #line 2864 "configure"
2864 #include "confdefs.h"
2865 #ifdef __cplusplus
2866 extern "C" void exit(int);
2867 #endif
2868 #include <stdio.h>
2869 #include <sys/types.h>
2870 main()
2871 {
2872   FILE *f=fopen("conftestval", "w");
2873   if (!f) exit(1);
2874   fprintf(f, "%d\n", sizeof(long long));
2875   exit(0);
2876 }
2877 EOF
2878 if { (eval echo configure:2879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2879 then
2880   ac_cv_sizeof_long_long=`cat conftestval`
2881 else
2882   echo "configure: failed program was:" >&5
2883   cat conftest.$ac_ext >&5
2884   rm -fr conftest*
2885   ac_cv_sizeof_long_long=0
2886 fi
2887 rm -fr conftest*
2888 fi
2889
2890 fi
2891 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
2892 cat >> confdefs.h <<EOF
2893 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
2894 EOF
2895
2896
2897 else
2898     if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
2899         ac_cv_sizeof_char=1
2900         ac_cv_sizeof_short=2
2901         ac_cv_sizeof_int=4 
2902         ac_cv_sizeof_long=4
2903         ac_cv_sizeof_long_long=4
2904     else
2905         : # FIXME
2906     fi
2907 #echo
2908 fi
2909
2910 type_name()
2911 {
2912     if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
2913         echo "char"
2914         exit
2915     fi
2916     if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
2917         echo "short"
2918         exit
2919     fi
2920     if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
2921         echo "int"
2922         exit
2923     fi
2924     if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
2925         echo "long"
2926         exit
2927     fi
2928     if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
2929         echo "long long"
2930         exit
2931     fi
2932     echo "long long"
2933 }
2934
2935 echo $ac_n "checking type name for byte""... $ac_c" 1>&6
2936 echo "configure:2937: checking type name for byte" >&5
2937 TYPE_BYTE=`type_name 1`
2938 echo "$ac_t""$TYPE_BYTE" 1>&6
2939 echo $ac_n "checking type name for word""... $ac_c" 1>&6
2940 echo "configure:2941: checking type name for word" >&5
2941 TYPE_WORD=`type_name 2`
2942 echo "$ac_t""$TYPE_WORD" 1>&6
2943 echo $ac_n "checking type name for dword""... $ac_c" 1>&6
2944 echo "configure:2945: checking type name for dword" >&5
2945 TYPE_DWORD=`type_name 4`
2946 echo "$ac_t""$TYPE_DWORD" 1>&6
2947 cat >> confdefs.h <<EOF
2948 #define TYPE_BYTE $TYPE_BYTE
2949 EOF
2950
2951 cat >> confdefs.h <<EOF
2952 #define TYPE_WORD $TYPE_WORD
2953 EOF
2954
2955 cat >> confdefs.h <<EOF
2956 #define TYPE_DWORD $TYPE_DWORD
2957 EOF
2958
2959
2960 if echo $TYPE_DWORD|grep short >/dev/null; then
2961     A="h"
2962 elif echo $TYPE_DWORD|grep long >/dev/null; then
2963     A="l"
2964 else
2965     A=""
2966 fi
2967
2968 if echo $TYPE_WORD|grep short >/dev/null; then M="h"
2969 elif echo $TYPE_WORD|grep long >/dev/null; then M="l"
2970 else M=""
2971 fi
2972
2973 cat >> confdefs.h <<EOF
2974 #define _A_ "${A}"
2975 EOF
2976
2977 cat >> confdefs.h <<EOF
2978 #define _M_ "${M}"
2979 EOF
2980
2981
2982
2983 # Generating output files
2984 # ===========================================================================
2985
2986 trap '' 1 2 15
2987 cat > confcache <<\EOF
2988 # This file is a shell script that caches the results of configure
2989 # tests run on this system so they can be shared between configure
2990 # scripts and configure runs.  It is not useful on other systems.
2991 # If it contains results you don't want to keep, you may remove or edit it.
2992 #
2993 # By default, configure uses ./config.cache as the cache file,
2994 # creating it if it does not exist already.  You can give configure
2995 # the --cache-file=FILE option to use a different cache file; that is
2996 # what configure does when it calls configure scripts in
2997 # subdirectories, so they share the cache.
2998 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2999 # config.status only pays attention to the cache file if you give it the
3000 # --recheck option to rerun configure.
3001 #
3002 EOF
3003 # The following way of writing the cache mishandles newlines in values,
3004 # but we know of no workaround that is simple, portable, and efficient.
3005 # So, don't put newlines in cache variables' values.
3006 # Ultrix sh set writes to stderr and can't be redirected directly,
3007 # and sets the high bit in the cache file unless we assign to the vars.
3008 (set) 2>&1 |
3009   case `(ac_space=' '; set | grep ac_space) 2>&1` in
3010   *ac_space=\ *)
3011     # `set' does not quote correctly, so add quotes (double-quote substitution
3012     # turns \\\\ into \\, and sed turns \\ into \).
3013     sed -n \
3014       -e "s/'/'\\\\''/g" \
3015       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3016     ;;
3017   *)
3018     # `set' quotes correctly as required by POSIX, so do not add quotes.
3019     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3020     ;;
3021   esac >> confcache
3022 if cmp -s $cache_file confcache; then
3023   :
3024 else
3025   if test -w $cache_file; then
3026     echo "updating cache $cache_file"
3027     cat confcache > $cache_file
3028   else
3029     echo "not updating unwritable cache $cache_file"
3030   fi
3031 fi
3032 rm -f confcache
3033
3034 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3035
3036 test "x$prefix" = xNONE && prefix=$ac_default_prefix
3037 # Let make expand exec_prefix.
3038 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3039
3040 # Any assignment to VPATH causes Sun make to only execute
3041 # the first set of double-colon rules, so remove it if not needed.
3042 # If there is a colon in the path, we need to keep it.
3043 if test "x$srcdir" = x.; then
3044   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
3045 fi
3046
3047 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3048
3049 DEFS=-DHAVE_CONFIG_H
3050
3051 # Without the "./", some shells look in PATH for config.status.
3052 : ${CONFIG_STATUS=./config.status}
3053
3054 echo creating $CONFIG_STATUS
3055 rm -f $CONFIG_STATUS
3056 cat > $CONFIG_STATUS <<EOF
3057 #! /bin/sh
3058 # Generated automatically by configure.
3059 # Run this file to recreate the current configuration.
3060 # This directory was configured as follows,
3061 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3062 #
3063 # $0 $ac_configure_args
3064 #
3065 # Compiler output produced by configure, useful for debugging
3066 # configure, is in ./config.log if it exists.
3067
3068 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3069 for ac_option
3070 do
3071   case "\$ac_option" in
3072   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3073     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3074     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3075   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3076     echo "$CONFIG_STATUS generated by autoconf version 2.13"
3077     exit 0 ;;
3078   -help | --help | --hel | --he | --h)
3079     echo "\$ac_cs_usage"; exit 0 ;;
3080   *) echo "\$ac_cs_usage"; exit 1 ;;
3081   esac
3082 done
3083
3084 ac_given_srcdir=$srcdir
3085 ac_given_INSTALL="$INSTALL"
3086
3087 trap 'rm -fr `echo "main.mk:main_in.mk
3088 packages.mk:packages_in.mk
3089 sim.src/Makefile
3090 cmd.src/Makefile
3091 s51.src/Makefile
3092 avr.src/Makefile
3093 z80.src/Makefile
3094 xa.src/Makefile
3095 gui.src/Makefile
3096 gui.src/serio.src/Makefile
3097 doc/Makefile
3098  ddconfig.h:ddconfig_in.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3099 EOF
3100 cat >> $CONFIG_STATUS <<EOF
3101
3102 # Protect against being on the right side of a sed subst in config.status.
3103 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3104  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3105 $ac_vpsub
3106 $extrasub
3107 s%@SHELL@%$SHELL%g
3108 s%@CFLAGS@%$CFLAGS%g
3109 s%@CPPFLAGS@%$CPPFLAGS%g
3110 s%@CXXFLAGS@%$CXXFLAGS%g
3111 s%@FFLAGS@%$FFLAGS%g
3112 s%@DEFS@%$DEFS%g
3113 s%@LDFLAGS@%$LDFLAGS%g
3114 s%@LIBS@%$LIBS%g
3115 s%@exec_prefix@%$exec_prefix%g
3116 s%@prefix@%$prefix%g
3117 s%@program_transform_name@%$program_transform_name%g
3118 s%@bindir@%$bindir%g
3119 s%@sbindir@%$sbindir%g
3120 s%@libexecdir@%$libexecdir%g
3121 s%@datadir@%$datadir%g
3122 s%@sysconfdir@%$sysconfdir%g
3123 s%@sharedstatedir@%$sharedstatedir%g
3124 s%@localstatedir@%$localstatedir%g
3125 s%@libdir@%$libdir%g
3126 s%@includedir@%$includedir%g
3127 s%@oldincludedir@%$oldincludedir%g
3128 s%@infodir@%$infodir%g
3129 s%@mandir@%$mandir%g
3130 s%@AWK@%$AWK%g
3131 s%@VERSION@%$VERSION%g
3132 s%@VERSIONHI@%$VERSIONHI%g
3133 s%@VERSIONLO@%$VERSIONLO%g
3134 s%@VERSIONP@%$VERSIONP%g
3135 s%@enable_ucsim@%$enable_ucsim%g
3136 s%@enable_dlso@%$enable_dlso%g
3137 s%@enable_51@%$enable_51%g
3138 s%@enable_avr@%$enable_avr%g
3139 s%@enable_z80@%$enable_z80%g
3140 s%@enable_xa@%$enable_xa%g
3141 s%@enable_serio@%$enable_serio%g
3142 s%@CXX@%$CXX%g
3143 s%@CXXCPP@%$CXXCPP%g
3144 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3145 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
3146 s%@INSTALL_DATA@%$INSTALL_DATA%g
3147 s%@RANLIB@%$RANLIB%g
3148 s%@STRIP@%$STRIP%g
3149 s%@dl_ok@%$dl_ok%g
3150 s%@DL@%$DL%g
3151 s%@panel_ok@%$panel_ok%g
3152 s%@curses_ok@%$curses_ok%g
3153 s%@CURSES_LIBS@%$CURSES_LIBS%g
3154 s%@M_OR_MM@%$M_OR_MM%g
3155 s%@SHAREDLIB@%$SHAREDLIB%g
3156 s%@PICOPT@%$PICOPT%g
3157 s%@dlso_ok@%$dlso_ok%g
3158
3159 CEOF
3160 EOF
3161
3162 cat >> $CONFIG_STATUS <<\EOF
3163
3164 # Split the substitutions into bite-sized pieces for seds with
3165 # small command number limits, like on Digital OSF/1 and HP-UX.
3166 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3167 ac_file=1 # Number of current file.
3168 ac_beg=1 # First line for current file.
3169 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3170 ac_more_lines=:
3171 ac_sed_cmds=""
3172 while $ac_more_lines; do
3173   if test $ac_beg -gt 1; then
3174     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3175   else
3176     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3177   fi
3178   if test ! -s conftest.s$ac_file; then
3179     ac_more_lines=false
3180     rm -f conftest.s$ac_file
3181   else
3182     if test -z "$ac_sed_cmds"; then
3183       ac_sed_cmds="sed -f conftest.s$ac_file"
3184     else
3185       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3186     fi
3187     ac_file=`expr $ac_file + 1`
3188     ac_beg=$ac_end
3189     ac_end=`expr $ac_end + $ac_max_sed_cmds`
3190   fi
3191 done
3192 if test -z "$ac_sed_cmds"; then
3193   ac_sed_cmds=cat
3194 fi
3195 EOF
3196
3197 cat >> $CONFIG_STATUS <<EOF
3198
3199 CONFIG_FILES=\${CONFIG_FILES-"main.mk:main_in.mk
3200 packages.mk:packages_in.mk
3201 sim.src/Makefile
3202 cmd.src/Makefile
3203 s51.src/Makefile
3204 avr.src/Makefile
3205 z80.src/Makefile
3206 xa.src/Makefile
3207 gui.src/Makefile
3208 gui.src/serio.src/Makefile
3209 doc/Makefile
3210 "}
3211 EOF
3212 cat >> $CONFIG_STATUS <<\EOF
3213 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3214   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3215   case "$ac_file" in
3216   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3217        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3218   *) ac_file_in="${ac_file}.in" ;;
3219   esac
3220
3221   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3222
3223   # Remove last slash and all that follows it.  Not all systems have dirname.
3224   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3225   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3226     # The file is in a subdirectory.
3227     test ! -d "$ac_dir" && mkdir "$ac_dir"
3228     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3229     # A "../" for each directory in $ac_dir_suffix.
3230     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3231   else
3232     ac_dir_suffix= ac_dots=
3233   fi
3234
3235   case "$ac_given_srcdir" in
3236   .)  srcdir=.
3237       if test -z "$ac_dots"; then top_srcdir=.
3238       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3239   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3240   *) # Relative path.
3241     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3242     top_srcdir="$ac_dots$ac_given_srcdir" ;;
3243   esac
3244
3245   case "$ac_given_INSTALL" in
3246   [/$]*) INSTALL="$ac_given_INSTALL" ;;
3247   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3248   esac
3249
3250   echo creating "$ac_file"
3251   rm -f "$ac_file"
3252   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3253   case "$ac_file" in
3254   *Makefile*) ac_comsub="1i\\
3255 # $configure_input" ;;
3256   *) ac_comsub= ;;
3257   esac
3258
3259   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3260   sed -e "$ac_comsub
3261 s%@configure_input@%$configure_input%g
3262 s%@srcdir@%$srcdir%g
3263 s%@top_srcdir@%$top_srcdir%g
3264 s%@INSTALL@%$INSTALL%g
3265 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3266 fi; done
3267 rm -f conftest.s*
3268
3269 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3270 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3271 #
3272 # ac_d sets the value in "#define NAME VALUE" lines.
3273 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3274 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3275 ac_dC='\3'
3276 ac_dD='%g'
3277 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3278 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3279 ac_uB='\([      ]\)%\1#\2define\3'
3280 ac_uC=' '
3281 ac_uD='\4%g'
3282 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3283 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3284 ac_eB='$%\1#\2define\3'
3285 ac_eC=' '
3286 ac_eD='%g'
3287
3288 if test "${CONFIG_HEADERS+set}" != set; then
3289 EOF
3290 cat >> $CONFIG_STATUS <<EOF
3291   CONFIG_HEADERS="ddconfig.h:ddconfig_in.h"
3292 EOF
3293 cat >> $CONFIG_STATUS <<\EOF
3294 fi
3295 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3296   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3297   case "$ac_file" in
3298   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3299        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3300   *) ac_file_in="${ac_file}.in" ;;
3301   esac
3302
3303   echo creating $ac_file
3304
3305   rm -f conftest.frag conftest.in conftest.out
3306   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3307   cat $ac_file_inputs > conftest.in
3308
3309 EOF
3310
3311 # Transform confdefs.h into a sed script conftest.vals that substitutes
3312 # the proper values into config.h.in to produce config.h.  And first:
3313 # Protect against being on the right side of a sed subst in config.status.
3314 # Protect against being in an unquoted here document in config.status.
3315 rm -f conftest.vals
3316 cat > conftest.hdr <<\EOF
3317 s/[\\&%]/\\&/g
3318 s%[\\$`]%\\&%g
3319 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3320 s%ac_d%ac_u%gp
3321 s%ac_u%ac_e%gp
3322 EOF
3323 sed -n -f conftest.hdr confdefs.h > conftest.vals
3324 rm -f conftest.hdr
3325
3326 # This sed command replaces #undef with comments.  This is necessary, for
3327 # example, in the case of _POSIX_SOURCE, which is predefined and required
3328 # on some systems where configure will not decide to define it.
3329 cat >> conftest.vals <<\EOF
3330 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3331 EOF
3332
3333 # Break up conftest.vals because some shells have a limit on
3334 # the size of here documents, and old seds have small limits too.
3335
3336 rm -f conftest.tail
3337 while :
3338 do
3339   ac_lines=`grep -c . conftest.vals`
3340   # grep -c gives empty output for an empty file on some AIX systems.
3341   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3342   # Write a limited-size here document to conftest.frag.
3343   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3344   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3345   echo 'CEOF
3346   sed -f conftest.frag conftest.in > conftest.out
3347   rm -f conftest.in
3348   mv conftest.out conftest.in
3349 ' >> $CONFIG_STATUS
3350   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3351   rm -f conftest.vals
3352   mv conftest.tail conftest.vals
3353 done
3354 rm -f conftest.vals
3355
3356 cat >> $CONFIG_STATUS <<\EOF
3357   rm -f conftest.frag conftest.h
3358   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3359   cat conftest.in >> conftest.h
3360   rm -f conftest.in
3361   if cmp -s $ac_file conftest.h 2>/dev/null; then
3362     echo "$ac_file is unchanged"
3363     rm -f conftest.h
3364   else
3365     # Remove last slash and all that follows it.  Not all systems have dirname.
3366       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3367       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3368       # The file is in a subdirectory.
3369       test ! -d "$ac_dir" && mkdir "$ac_dir"
3370     fi
3371     rm -f $ac_file
3372     mv conftest.h $ac_file
3373   fi
3374 fi; done
3375
3376 EOF
3377 cat >> $CONFIG_STATUS <<EOF
3378
3379 EOF
3380 cat >> $CONFIG_STATUS <<\EOF
3381
3382 exit 0
3383 EOF
3384 chmod +x $CONFIG_STATUS
3385 rm -fr confdefs* $ac_clean_files
3386 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3387
3388
3389 #gui.src/portmon.src/Makefile
3390
3391
3392 # End of configure/configure.in