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