Do not cache the result of the vasprintf test (see configure.in for explanation)...
[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 mawk gawk 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 else
1136   echo "$ac_t""no" 1>&6
1137 fi
1138
1139 ac_header_dirent=no
1140 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1141 do
1142 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1143 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1144 echo "configure:1145: checking for $ac_hdr that defines DIR" >&5
1145 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1146   echo $ac_n "(cached) $ac_c" 1>&6
1147 else
1148   cat > conftest.$ac_ext <<EOF
1149 #line 1150 "configure"
1150 #include "confdefs.h"
1151 #include <sys/types.h>
1152 #include <$ac_hdr>
1153 int main() {
1154 DIR *dirp = 0;
1155 ; return 0; }
1156 EOF
1157 if { (eval echo configure:1158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1158   rm -rf conftest*
1159   eval "ac_cv_header_dirent_$ac_safe=yes"
1160 else
1161   echo "configure: failed program was:" >&5
1162   cat conftest.$ac_ext >&5
1163   rm -rf conftest*
1164   eval "ac_cv_header_dirent_$ac_safe=no"
1165 fi
1166 rm -f conftest*
1167 fi
1168 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1169   echo "$ac_t""yes" 1>&6
1170     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1171   cat >> confdefs.h <<EOF
1172 #define $ac_tr_hdr 1
1173 EOF
1174  ac_header_dirent=$ac_hdr; break
1175 else
1176   echo "$ac_t""no" 1>&6
1177 fi
1178 done
1179 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1180 if test $ac_header_dirent = dirent.h; then
1181 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1182 echo "configure:1183: checking for opendir in -ldir" >&5
1183 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1184 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1185   echo $ac_n "(cached) $ac_c" 1>&6
1186 else
1187   ac_save_LIBS="$LIBS"
1188 LIBS="-ldir  $LIBS"
1189 cat > conftest.$ac_ext <<EOF
1190 #line 1191 "configure"
1191 #include "confdefs.h"
1192 /* Override any gcc2 internal prototype to avoid an error.  */
1193 #ifdef __cplusplus
1194 extern "C"
1195 #endif
1196 /* We use char because int might match the return type of a gcc2
1197     builtin and then its argument prototype would still apply.  */
1198 char opendir();
1199
1200 int main() {
1201 opendir()
1202 ; return 0; }
1203 EOF
1204 if { (eval echo configure:1205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1205   rm -rf conftest*
1206   eval "ac_cv_lib_$ac_lib_var=yes"
1207 else
1208   echo "configure: failed program was:" >&5
1209   cat conftest.$ac_ext >&5
1210   rm -rf conftest*
1211   eval "ac_cv_lib_$ac_lib_var=no"
1212 fi
1213 rm -f conftest*
1214 LIBS="$ac_save_LIBS"
1215
1216 fi
1217 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1218   echo "$ac_t""yes" 1>&6
1219   LIBS="$LIBS -ldir"
1220 else
1221   echo "$ac_t""no" 1>&6
1222 fi
1223
1224 else
1225 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1226 echo "configure:1227: checking for opendir in -lx" >&5
1227 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1228 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1229   echo $ac_n "(cached) $ac_c" 1>&6
1230 else
1231   ac_save_LIBS="$LIBS"
1232 LIBS="-lx  $LIBS"
1233 cat > conftest.$ac_ext <<EOF
1234 #line 1235 "configure"
1235 #include "confdefs.h"
1236 /* Override any gcc2 internal prototype to avoid an error.  */
1237 #ifdef __cplusplus
1238 extern "C"
1239 #endif
1240 /* We use char because int might match the return type of a gcc2
1241     builtin and then its argument prototype would still apply.  */
1242 char opendir();
1243
1244 int main() {
1245 opendir()
1246 ; return 0; }
1247 EOF
1248 if { (eval echo configure:1249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1249   rm -rf conftest*
1250   eval "ac_cv_lib_$ac_lib_var=yes"
1251 else
1252   echo "configure: failed program was:" >&5
1253   cat conftest.$ac_ext >&5
1254   rm -rf conftest*
1255   eval "ac_cv_lib_$ac_lib_var=no"
1256 fi
1257 rm -f conftest*
1258 LIBS="$ac_save_LIBS"
1259
1260 fi
1261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1262   echo "$ac_t""yes" 1>&6
1263   LIBS="$LIBS -lx"
1264 else
1265   echo "$ac_t""no" 1>&6
1266 fi
1267
1268 fi
1269
1270
1271 # This must be after CXXCPP
1272
1273 echo $ac_n "checking which header file defines FD_ macros""... $ac_c" 1>&6
1274 echo "configure:1275: checking which header file defines FD_ macros" >&5
1275 if eval "test \"`echo '$''{'s51_cv_fd'+set}'`\" = set"; then
1276   echo $ac_n "(cached) $ac_c" 1>&6
1277 else
1278   s51_cv_fd="unknown"
1279 cat > conftest.$ac_ext <<EOF
1280 #line 1281 "configure"
1281 #include "confdefs.h"
1282
1283 #include <sys/time.h>
1284 #ifdef FD_ZERO
1285 yes
1286 #endif
1287 EOF
1288 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1289   egrep "yes" >/dev/null 2>&1; then
1290   rm -rf conftest*
1291   s51_cv_fd="<sys/time.h>"
1292 fi
1293 rm -f conftest*
1294
1295 cat > conftest.$ac_ext <<EOF
1296 #line 1297 "configure"
1297 #include "confdefs.h"
1298
1299 #include <sys/types.h>
1300 #ifdef FD_ZERO
1301 yes
1302 #endif
1303 EOF
1304 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1305   egrep "yes" >/dev/null 2>&1; then
1306   rm -rf conftest*
1307   s51_cv_fd="<sys/types.h>"
1308 fi
1309 rm -f conftest*
1310
1311 cat > conftest.$ac_ext <<EOF
1312 #line 1313 "configure"
1313 #include "confdefs.h"
1314
1315 #include <sys/select.h>
1316 #ifdef FD_ZERO
1317 yes
1318 #endif
1319 EOF
1320 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1321   egrep "yes" >/dev/null 2>&1; then
1322   rm -rf conftest*
1323   s51_cv_fd="<sys/types.h>"
1324 fi
1325 rm -f conftest*
1326
1327 fi
1328
1329 echo "$ac_t""$s51_cv_fd" 1>&6
1330
1331 cat >> confdefs.h <<\EOF
1332 #define FD_HEADER_OK 0
1333 EOF
1334
1335 if echo $s51_cv_fd|grep time >/dev/null 2>&1; then
1336 cat >> confdefs.h <<\EOF
1337 #define FD_NEED_TIME_H 1
1338 EOF
1339
1340 cat >> confdefs.h <<\EOF
1341 #define FD_HEADER_OK 1
1342 EOF
1343
1344 else
1345 cat >> confdefs.h <<\EOF
1346 #define FD_NEED_TIME_H 0
1347 EOF
1348
1349 fi
1350 if echo $s51_cv_fd|grep types >/dev/null 2>&1; then
1351 cat >> confdefs.h <<\EOF
1352 #define FD_NEED_TYPES_H 1
1353 EOF
1354
1355 cat >> confdefs.h <<\EOF
1356 #define FD_HEADER_OK 1
1357 EOF
1358
1359 else
1360 cat >> confdefs.h <<\EOF
1361 #define FD_NEED_TYPES_H 0
1362 EOF
1363
1364 fi
1365 if echo $s51_cv_fd|grep select >/dev/null 2>&1; then
1366 cat >> confdefs.h <<\EOF
1367 #define FD_NEED_SELECT_H 1
1368 EOF
1369
1370 cat >> confdefs.h <<\EOF
1371 #define FD_HEADER_OK 1
1372 EOF
1373
1374 else
1375 cat >> confdefs.h <<\EOF
1376 #define FD_NEED_SELECT_H 0
1377 EOF
1378
1379 fi
1380
1381 cat >> confdefs.h <<EOF
1382 #define HEADER_FD ${s51_cv_fd}
1383 EOF
1384
1385
1386
1387 # Checking for functions/libs
1388 # ===========================================================================
1389
1390
1391
1392 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
1393 echo "configure:1394: checking for socket in -lsocket" >&5
1394 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
1395 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1396   echo $ac_n "(cached) $ac_c" 1>&6
1397 else
1398   ac_save_LIBS="$LIBS"
1399 LIBS="-lsocket  $LIBS"
1400 cat > conftest.$ac_ext <<EOF
1401 #line 1402 "configure"
1402 #include "confdefs.h"
1403 /* Override any gcc2 internal prototype to avoid an error.  */
1404 #ifdef __cplusplus
1405 extern "C"
1406 #endif
1407 /* We use char because int might match the return type of a gcc2
1408     builtin and then its argument prototype would still apply.  */
1409 char socket();
1410
1411 int main() {
1412 socket()
1413 ; return 0; }
1414 EOF
1415 if { (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1416   rm -rf conftest*
1417   eval "ac_cv_lib_$ac_lib_var=yes"
1418 else
1419   echo "configure: failed program was:" >&5
1420   cat conftest.$ac_ext >&5
1421   rm -rf conftest*
1422   eval "ac_cv_lib_$ac_lib_var=no"
1423 fi
1424 rm -f conftest*
1425 LIBS="$ac_save_LIBS"
1426
1427 fi
1428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1429   echo "$ac_t""yes" 1>&6
1430     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1431     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1432   cat >> confdefs.h <<EOF
1433 #define $ac_tr_lib 1
1434 EOF
1435
1436   LIBS="-lsocket $LIBS"
1437
1438 else
1439   echo "$ac_t""no" 1>&6
1440 fi
1441
1442 echo $ac_n "checking for xdr_short in -lnsl""... $ac_c" 1>&6
1443 echo "configure:1444: checking for xdr_short in -lnsl" >&5
1444 ac_lib_var=`echo nsl'_'xdr_short | sed 'y%./+-%__p_%'`
1445 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1446   echo $ac_n "(cached) $ac_c" 1>&6
1447 else
1448   ac_save_LIBS="$LIBS"
1449 LIBS="-lnsl  $LIBS"
1450 cat > conftest.$ac_ext <<EOF
1451 #line 1452 "configure"
1452 #include "confdefs.h"
1453 /* Override any gcc2 internal prototype to avoid an error.  */
1454 #ifdef __cplusplus
1455 extern "C"
1456 #endif
1457 /* We use char because int might match the return type of a gcc2
1458     builtin and then its argument prototype would still apply.  */
1459 char xdr_short();
1460
1461 int main() {
1462 xdr_short()
1463 ; return 0; }
1464 EOF
1465 if { (eval echo configure:1466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1466   rm -rf conftest*
1467   eval "ac_cv_lib_$ac_lib_var=yes"
1468 else
1469   echo "configure: failed program was:" >&5
1470   cat conftest.$ac_ext >&5
1471   rm -rf conftest*
1472   eval "ac_cv_lib_$ac_lib_var=no"
1473 fi
1474 rm -f conftest*
1475 LIBS="$ac_save_LIBS"
1476
1477 fi
1478 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1479   echo "$ac_t""yes" 1>&6
1480     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1481     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1482   cat >> confdefs.h <<EOF
1483 #define $ac_tr_lib 1
1484 EOF
1485
1486   LIBS="-lnsl $LIBS"
1487
1488 else
1489   echo "$ac_t""no" 1>&6
1490 fi
1491
1492 echo $ac_n "checking for panel_above in -lpanel""... $ac_c" 1>&6
1493 echo "configure:1494: checking for panel_above in -lpanel" >&5
1494 ac_lib_var=`echo panel'_'panel_above | sed 'y%./+-%__p_%'`
1495 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1496   echo $ac_n "(cached) $ac_c" 1>&6
1497 else
1498   ac_save_LIBS="$LIBS"
1499 LIBS="-lpanel -lcurses $LIBS"
1500 cat > conftest.$ac_ext <<EOF
1501 #line 1502 "configure"
1502 #include "confdefs.h"
1503 /* Override any gcc2 internal prototype to avoid an error.  */
1504 #ifdef __cplusplus
1505 extern "C"
1506 #endif
1507 /* We use char because int might match the return type of a gcc2
1508     builtin and then its argument prototype would still apply.  */
1509 char panel_above();
1510
1511 int main() {
1512 panel_above()
1513 ; return 0; }
1514 EOF
1515 if { (eval echo configure:1516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1516   rm -rf conftest*
1517   eval "ac_cv_lib_$ac_lib_var=yes"
1518 else
1519   echo "configure: failed program was:" >&5
1520   cat conftest.$ac_ext >&5
1521   rm -rf conftest*
1522   eval "ac_cv_lib_$ac_lib_var=no"
1523 fi
1524 rm -f conftest*
1525 LIBS="$ac_save_LIBS"
1526
1527 fi
1528 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1529   echo "$ac_t""yes" 1>&6
1530   panel_ok="yes"
1531 curses_ok="yes"
1532 CURSES_LIBS="-lpanel -lcurses"
1533
1534 else
1535   echo "$ac_t""no" 1>&6
1536 panel_ok="no"
1537 echo $ac_n "checking for nl in -lcurses""... $ac_c" 1>&6
1538 echo "configure:1539: checking for nl in -lcurses" >&5
1539 ac_lib_var=`echo curses'_'nl | sed 'y%./+-%__p_%'`
1540 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1541   echo $ac_n "(cached) $ac_c" 1>&6
1542 else
1543   ac_save_LIBS="$LIBS"
1544 LIBS="-lcurses  $LIBS"
1545 cat > conftest.$ac_ext <<EOF
1546 #line 1547 "configure"
1547 #include "confdefs.h"
1548 /* Override any gcc2 internal prototype to avoid an error.  */
1549 #ifdef __cplusplus
1550 extern "C"
1551 #endif
1552 /* We use char because int might match the return type of a gcc2
1553     builtin and then its argument prototype would still apply.  */
1554 char nl();
1555
1556 int main() {
1557 nl()
1558 ; return 0; }
1559 EOF
1560 if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1561   rm -rf conftest*
1562   eval "ac_cv_lib_$ac_lib_var=yes"
1563 else
1564   echo "configure: failed program was:" >&5
1565   cat conftest.$ac_ext >&5
1566   rm -rf conftest*
1567   eval "ac_cv_lib_$ac_lib_var=no"
1568 fi
1569 rm -f conftest*
1570 LIBS="$ac_save_LIBS"
1571
1572 fi
1573 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1574   echo "$ac_t""yes" 1>&6
1575   curses_ok="yes"
1576 CURSES_LIBS="-lcurses"
1577
1578 else
1579   echo "$ac_t""no" 1>&6
1580 ncurses_ok="no"
1581 fi
1582
1583
1584 fi
1585
1586
1587
1588
1589
1590 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
1591 echo "configure:1592: checking for vprintf" >&5
1592 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
1593   echo $ac_n "(cached) $ac_c" 1>&6
1594 else
1595   cat > conftest.$ac_ext <<EOF
1596 #line 1597 "configure"
1597 #include "confdefs.h"
1598 /* System header to define __stub macros and hopefully few prototypes,
1599     which can conflict with char vprintf(); below.  */
1600 #include <assert.h>
1601 /* Override any gcc2 internal prototype to avoid an error.  */
1602 #ifdef __cplusplus
1603 extern "C"
1604 #endif
1605 /* We use char because int might match the return type of a gcc2
1606     builtin and then its argument prototype would still apply.  */
1607 char vprintf();
1608
1609 int main() {
1610
1611 /* The GNU C library defines this for functions which it implements
1612     to always fail with ENOSYS.  Some functions are actually named
1613     something starting with __ and the normal name is an alias.  */
1614 #if defined (__stub_vprintf) || defined (__stub___vprintf)
1615 choke me
1616 #else
1617 vprintf();
1618 #endif
1619
1620 ; return 0; }
1621 EOF
1622 if { (eval echo configure:1623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1623   rm -rf conftest*
1624   eval "ac_cv_func_vprintf=yes"
1625 else
1626   echo "configure: failed program was:" >&5
1627   cat conftest.$ac_ext >&5
1628   rm -rf conftest*
1629   eval "ac_cv_func_vprintf=no"
1630 fi
1631 rm -f conftest*
1632 fi
1633
1634 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
1635   echo "$ac_t""yes" 1>&6
1636   cat >> confdefs.h <<\EOF
1637 #define HAVE_VPRINTF 1
1638 EOF
1639
1640 else
1641   echo "$ac_t""no" 1>&6
1642 fi
1643
1644 if test "$ac_cv_func_vprintf" != yes; then
1645 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
1646 echo "configure:1647: checking for _doprnt" >&5
1647 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
1648   echo $ac_n "(cached) $ac_c" 1>&6
1649 else
1650   cat > conftest.$ac_ext <<EOF
1651 #line 1652 "configure"
1652 #include "confdefs.h"
1653 /* System header to define __stub macros and hopefully few prototypes,
1654     which can conflict with char _doprnt(); below.  */
1655 #include <assert.h>
1656 /* Override any gcc2 internal prototype to avoid an error.  */
1657 #ifdef __cplusplus
1658 extern "C"
1659 #endif
1660 /* We use char because int might match the return type of a gcc2
1661     builtin and then its argument prototype would still apply.  */
1662 char _doprnt();
1663
1664 int main() {
1665
1666 /* The GNU C library defines this for functions which it implements
1667     to always fail with ENOSYS.  Some functions are actually named
1668     something starting with __ and the normal name is an alias.  */
1669 #if defined (__stub__doprnt) || defined (__stub____doprnt)
1670 choke me
1671 #else
1672 _doprnt();
1673 #endif
1674
1675 ; return 0; }
1676 EOF
1677 if { (eval echo configure:1678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1678   rm -rf conftest*
1679   eval "ac_cv_func__doprnt=yes"
1680 else
1681   echo "configure: failed program was:" >&5
1682   cat conftest.$ac_ext >&5
1683   rm -rf conftest*
1684   eval "ac_cv_func__doprnt=no"
1685 fi
1686 rm -f conftest*
1687 fi
1688
1689 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
1690   echo "$ac_t""yes" 1>&6
1691   cat >> confdefs.h <<\EOF
1692 #define HAVE_DOPRNT 1
1693 EOF
1694
1695 else
1696   echo "$ac_t""no" 1>&6
1697 fi
1698
1699 fi
1700
1701 echo $ac_n "checking for vasprintf""... $ac_c" 1>&6
1702 echo "configure:1703: checking for vasprintf" >&5
1703 cat > conftest.$ac_ext <<EOF
1704 #line 1705 "configure"
1705 #include "confdefs.h"
1706 /* System header to define __stub macros and hopefully few prototypes,
1707     which can conflict with char vasprintf(); below.  */
1708 #include <assert.h>
1709 /* Override any gcc2 internal prototype to avoid an error.  */
1710 #ifdef __cplusplus
1711 extern "C"
1712 #endif
1713 /* We use char because int might match the return type of a gcc2
1714     builtin and then its argument prototype would still apply.  */
1715 char vasprintf();
1716
1717 int main() {
1718
1719 /* The GNU C library defines this for functions which it implements
1720     to always fail with ENOSYS.  Some functions are actually named
1721     something starting with __ and the normal name is an alias.  */
1722 #if defined (__stub_vasprintf) || defined (__stub___vasprintf)
1723 choke me
1724 #else
1725 vasprintf();
1726 #endif
1727
1728 ; return 0; }
1729 EOF
1730 if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1731   rm -rf conftest*
1732   eval "ac_cv_func_vasprintf=yes"
1733 else
1734   echo "configure: failed program was:" >&5
1735   cat conftest.$ac_ext >&5
1736   rm -rf conftest*
1737   eval "ac_cv_func_vasprintf=no"
1738 fi
1739 rm -f conftest*
1740 if eval "test \"`echo '$ac_cv_func_'vasprintf`\" = yes"; then
1741   echo "$ac_t""yes" 1>&6
1742   :
1743 else
1744   echo "$ac_t""no" 1>&6
1745 fi
1746
1747 for ac_func in strlen strcpy strcat strstr strcmp strerror strtok strdup
1748 do
1749 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1750 echo "configure:1751: checking for $ac_func" >&5
1751 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1752   echo $ac_n "(cached) $ac_c" 1>&6
1753 else
1754   cat > conftest.$ac_ext <<EOF
1755 #line 1756 "configure"
1756 #include "confdefs.h"
1757 /* System header to define __stub macros and hopefully few prototypes,
1758     which can conflict with char $ac_func(); below.  */
1759 #include <assert.h>
1760 /* Override any gcc2 internal prototype to avoid an error.  */
1761 #ifdef __cplusplus
1762 extern "C"
1763 #endif
1764 /* We use char because int might match the return type of a gcc2
1765     builtin and then its argument prototype would still apply.  */
1766 char $ac_func();
1767
1768 int main() {
1769
1770 /* The GNU C library defines this for functions which it implements
1771     to always fail with ENOSYS.  Some functions are actually named
1772     something starting with __ and the normal name is an alias.  */
1773 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1774 choke me
1775 #else
1776 $ac_func();
1777 #endif
1778
1779 ; return 0; }
1780 EOF
1781 if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1782   rm -rf conftest*
1783   eval "ac_cv_func_$ac_func=yes"
1784 else
1785   echo "configure: failed program was:" >&5
1786   cat conftest.$ac_ext >&5
1787   rm -rf conftest*
1788   eval "ac_cv_func_$ac_func=no"
1789 fi
1790 rm -f conftest*
1791 fi
1792
1793 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1794   echo "$ac_t""yes" 1>&6
1795     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1796   cat >> confdefs.h <<EOF
1797 #define $ac_tr_func 1
1798 EOF
1799  
1800 else
1801   echo "$ac_t""no" 1>&6
1802 fi
1803 done
1804
1805 for ac_func in vsnprintf strchr memcpy
1806 do
1807 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1808 echo "configure:1809: checking for $ac_func" >&5
1809 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1810   echo $ac_n "(cached) $ac_c" 1>&6
1811 else
1812   cat > conftest.$ac_ext <<EOF
1813 #line 1814 "configure"
1814 #include "confdefs.h"
1815 /* System header to define __stub macros and hopefully few prototypes,
1816     which can conflict with char $ac_func(); below.  */
1817 #include <assert.h>
1818 /* Override any gcc2 internal prototype to avoid an error.  */
1819 #ifdef __cplusplus
1820 extern "C"
1821 #endif
1822 /* We use char because int might match the return type of a gcc2
1823     builtin and then its argument prototype would still apply.  */
1824 char $ac_func();
1825
1826 int main() {
1827
1828 /* The GNU C library defines this for functions which it implements
1829     to always fail with ENOSYS.  Some functions are actually named
1830     something starting with __ and the normal name is an alias.  */
1831 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1832 choke me
1833 #else
1834 $ac_func();
1835 #endif
1836
1837 ; return 0; }
1838 EOF
1839 if { (eval echo configure:1840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1840   rm -rf conftest*
1841   eval "ac_cv_func_$ac_func=yes"
1842 else
1843   echo "configure: failed program was:" >&5
1844   cat conftest.$ac_ext >&5
1845   rm -rf conftest*
1846   eval "ac_cv_func_$ac_func=no"
1847 fi
1848 rm -f conftest*
1849 fi
1850
1851 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1852   echo "$ac_t""yes" 1>&6
1853     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1854   cat >> confdefs.h <<EOF
1855 #define $ac_tr_func 1
1856 EOF
1857  
1858 else
1859   echo "$ac_t""no" 1>&6
1860 fi
1861 done
1862
1863 for ac_func in fgets
1864 do
1865 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1866 echo "configure:1867: checking for $ac_func" >&5
1867 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1868   echo $ac_n "(cached) $ac_c" 1>&6
1869 else
1870   cat > conftest.$ac_ext <<EOF
1871 #line 1872 "configure"
1872 #include "confdefs.h"
1873 /* System header to define __stub macros and hopefully few prototypes,
1874     which can conflict with char $ac_func(); below.  */
1875 #include <assert.h>
1876 /* Override any gcc2 internal prototype to avoid an error.  */
1877 #ifdef __cplusplus
1878 extern "C"
1879 #endif
1880 /* We use char because int might match the return type of a gcc2
1881     builtin and then its argument prototype would still apply.  */
1882 char $ac_func();
1883
1884 int main() {
1885
1886 /* The GNU C library defines this for functions which it implements
1887     to always fail with ENOSYS.  Some functions are actually named
1888     something starting with __ and the normal name is an alias.  */
1889 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1890 choke me
1891 #else
1892 $ac_func();
1893 #endif
1894
1895 ; return 0; }
1896 EOF
1897 if { (eval echo configure:1898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1898   rm -rf conftest*
1899   eval "ac_cv_func_$ac_func=yes"
1900 else
1901   echo "configure: failed program was:" >&5
1902   cat conftest.$ac_ext >&5
1903   rm -rf conftest*
1904   eval "ac_cv_func_$ac_func=no"
1905 fi
1906 rm -f conftest*
1907 fi
1908
1909 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1910   echo "$ac_t""yes" 1>&6
1911     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1912   cat >> confdefs.h <<EOF
1913 #define $ac_tr_func 1
1914 EOF
1915  
1916 else
1917   echo "$ac_t""no" 1>&6
1918 fi
1919 done
1920
1921 for ac_func in yylex
1922 do
1923 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1924 echo "configure:1925: checking for $ac_func" >&5
1925 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1926   echo $ac_n "(cached) $ac_c" 1>&6
1927 else
1928   cat > conftest.$ac_ext <<EOF
1929 #line 1930 "configure"
1930 #include "confdefs.h"
1931 /* System header to define __stub macros and hopefully few prototypes,
1932     which can conflict with char $ac_func(); below.  */
1933 #include <assert.h>
1934 /* Override any gcc2 internal prototype to avoid an error.  */
1935 #ifdef __cplusplus
1936 extern "C"
1937 #endif
1938 /* We use char because int might match the return type of a gcc2
1939     builtin and then its argument prototype would still apply.  */
1940 char $ac_func();
1941
1942 int main() {
1943
1944 /* The GNU C library defines this for functions which it implements
1945     to always fail with ENOSYS.  Some functions are actually named
1946     something starting with __ and the normal name is an alias.  */
1947 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1948 choke me
1949 #else
1950 $ac_func();
1951 #endif
1952
1953 ; return 0; }
1954 EOF
1955 if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1956   rm -rf conftest*
1957   eval "ac_cv_func_$ac_func=yes"
1958 else
1959   echo "configure: failed program was:" >&5
1960   cat conftest.$ac_ext >&5
1961   rm -rf conftest*
1962   eval "ac_cv_func_$ac_func=no"
1963 fi
1964 rm -f conftest*
1965 fi
1966
1967 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1968   echo "$ac_t""yes" 1>&6
1969     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1970   cat >> confdefs.h <<EOF
1971 #define $ac_tr_func 1
1972 EOF
1973  
1974 else
1975   echo "$ac_t""no" 1>&6
1976 fi
1977 done
1978
1979
1980 echo $ac_n "checking whether scanf knows %a""... $ac_c" 1>&6
1981 echo "configure:1982: checking whether scanf knows %a" >&5
1982 if eval "test \"`echo '$''{'s51_cv_scanf_a'+set}'`\" = set"; then
1983   echo $ac_n "(cached) $ac_c" 1>&6
1984 else
1985   echo "a b" >conftest.data
1986 if test "$cross_compiling" = yes; then
1987   s51_cv_scanf_a="unknown"
1988 else
1989   cat > conftest.$ac_ext <<EOF
1990 #line 1991 "configure"
1991 #include "confdefs.h"
1992 #ifdef __cplusplus
1993 extern "C" void exit(int);
1994 #endif
1995
1996 #include <stdio.h>
1997 void main(void)
1998 {
1999   FILE *f;
2000   char *a;
2001   int  i;
2002   if ((f= fopen("conftest.data", "r")) == NULL)
2003     exit(1);
2004   i= fscanf(f, " %a[a-z] ", &a);
2005   fclose(f);
2006   if (i == 0)
2007     exit(2);
2008   if (i == 1)
2009     exit(0);
2010   exit(3);
2011 }
2012 EOF
2013 if { (eval echo configure:2014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2014 then
2015   s51_cv_scanf_a="yes"
2016 else
2017   echo "configure: failed program was:" >&5
2018   cat conftest.$ac_ext >&5
2019   rm -fr conftest*
2020   s51_cv_scanf_a="no"
2021 fi
2022 rm -fr conftest*
2023 fi
2024
2025
2026 fi
2027
2028 echo "$ac_t""$s51_cv_scanf_a" 1>&6
2029 if test "$s51_cv_scanf_a" = "yes"; then
2030   cat >> confdefs.h <<\EOF
2031 #define SCANF_A 1
2032 EOF
2033
2034 fi
2035
2036 echo $ac_n "checking whether getcwd is GNUish""... $ac_c" 1>&6
2037 echo "configure:2038: checking whether getcwd is GNUish" >&5
2038 if eval "test \"`echo '$''{'s51_cv_getcwd'+set}'`\" = set"; then
2039   echo $ac_n "(cached) $ac_c" 1>&6
2040 else
2041   if test "$cross_compiling" = yes; then
2042   s51_cv_getcwd="unknown"
2043 else
2044   cat > conftest.$ac_ext <<EOF
2045 #line 2046 "configure"
2046 #include "confdefs.h"
2047 #ifdef __cplusplus
2048 extern "C" void exit(int);
2049 #endif
2050
2051 #include <unistd.h>
2052 void main(void)
2053 {
2054   if ((getcwd(NULL, 0)) == NULL)
2055     exit(1);
2056   exit(0);
2057 }
2058 EOF
2059 if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2060 then
2061   s51_cv_getcwd="yes"
2062 else
2063   echo "configure: failed program was:" >&5
2064   cat conftest.$ac_ext >&5
2065   rm -fr conftest*
2066   s51_cv_getcwd="no"
2067 fi
2068 rm -fr conftest*
2069 fi
2070
2071
2072 fi
2073
2074 echo "$ac_t""$s51_cv_getcwd" 1>&6
2075 if test "$s51_cv_getcwd" = "yes"; then
2076   cat >> confdefs.h <<\EOF
2077 #define GNU_GETCWD 1
2078 EOF
2079
2080 fi
2081
2082
2083 # Macro definitions
2084 ###################
2085
2086 # DD_COPT macro checks if the compiler specified as the 1st parameter
2087 # supports option specified as the 2nd parameter
2088 # For example: DD_CPORT(CXX, fPIC)
2089
2090
2091
2092
2093 # Checking characteristics of compilers and other programs
2094 # --------------------------------------------------------
2095 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
2096 echo "configure:2097: checking whether byte ordering is bigendian" >&5
2097 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
2098   echo $ac_n "(cached) $ac_c" 1>&6
2099 else
2100   ac_cv_c_bigendian=unknown
2101 # See if sys/param.h defines the BYTE_ORDER macro.
2102 cat > conftest.$ac_ext <<EOF
2103 #line 2104 "configure"
2104 #include "confdefs.h"
2105 #include <sys/types.h>
2106 #include <sys/param.h>
2107 int main() {
2108
2109 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
2110  bogus endian macros
2111 #endif
2112 ; return 0; }
2113 EOF
2114 if { (eval echo configure:2115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2115   rm -rf conftest*
2116   # It does; now see whether it defined to BIG_ENDIAN or not.
2117 cat > conftest.$ac_ext <<EOF
2118 #line 2119 "configure"
2119 #include "confdefs.h"
2120 #include <sys/types.h>
2121 #include <sys/param.h>
2122 int main() {
2123
2124 #if BYTE_ORDER != BIG_ENDIAN
2125  not big endian
2126 #endif
2127 ; return 0; }
2128 EOF
2129 if { (eval echo configure:2130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2130   rm -rf conftest*
2131   ac_cv_c_bigendian=yes
2132 else
2133   echo "configure: failed program was:" >&5
2134   cat conftest.$ac_ext >&5
2135   rm -rf conftest*
2136   ac_cv_c_bigendian=no
2137 fi
2138 rm -f conftest*
2139 else
2140   echo "configure: failed program was:" >&5
2141   cat conftest.$ac_ext >&5
2142 fi
2143 rm -f conftest*
2144 if test $ac_cv_c_bigendian = unknown; then
2145 if test "$cross_compiling" = yes; then
2146     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2147 else
2148   cat > conftest.$ac_ext <<EOF
2149 #line 2150 "configure"
2150 #include "confdefs.h"
2151 #ifdef __cplusplus
2152 extern "C" void exit(int);
2153 #endif
2154 main () {
2155   /* Are we little or big endian?  From Harbison&Steele.  */
2156   union
2157   {
2158     long l;
2159     char c[sizeof (long)];
2160   } u;
2161   u.l = 1;
2162   exit (u.c[sizeof (long) - 1] == 1);
2163 }
2164 EOF
2165 if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2166 then
2167   ac_cv_c_bigendian=no
2168 else
2169   echo "configure: failed program was:" >&5
2170   cat conftest.$ac_ext >&5
2171   rm -fr conftest*
2172   ac_cv_c_bigendian=yes
2173 fi
2174 rm -fr conftest*
2175 fi
2176
2177 fi
2178 fi
2179
2180 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
2181 if test $ac_cv_c_bigendian = yes; then
2182   cat >> confdefs.h <<\EOF
2183 #define WORDS_BIGENDIAN 1
2184 EOF
2185
2186 fi
2187
2188 echo $ac_n "checking whether preprocessor accepts -MM or -M""... $ac_c" 1>&6
2189 echo "configure:2190: checking whether preprocessor accepts -MM or -M" >&5
2190 if eval "test \"`echo '$''{'s51_cv_MM'+set}'`\" = set"; then
2191   echo $ac_n "(cached) $ac_c" 1>&6
2192 else
2193   echo "#include <stdio.h>" >_test_.c
2194 echo "" >>_test_.c
2195 $CXXCPP -v -MM _test_.c 1>&5 2>&5
2196 if test "$?" = "0"; then
2197   s51_cv_MM="-MM"
2198 else
2199   s51_cv_MM="-M"
2200 fi
2201 rm -f _test_.*
2202 fi
2203
2204 echo "$ac_t""$s51_cv_MM" 1>&6
2205 M_OR_MM=$s51_cv_MM
2206
2207
2208 # This is the first time when CFLAGS are set/modified!!
2209
2210
2211 echo $ac_n "checking whether $CXX accepts -ggdb""... $ac_c" 1>&6
2212 echo "configure:2213: checking whether $CXX accepts -ggdb" >&5
2213 if eval "test \"`echo '$''{'s51_cv_CXXggdb'+set}'`\" = set"; then
2214   echo $ac_n "(cached) $ac_c" 1>&6
2215 else
2216   cat >_test_.c <<EOF
2217 #include <stdio.h>
2218 void main(void) {}
2219 EOF
2220 $CXX -v -ggdb -c _test_.c 1>&5 2>&5
2221 if test "$?" = "0"; then
2222   s51_cv_CXXggdb="yes"
2223 else
2224   s51_cv_CXXggdb="no"
2225 fi
2226 rm -f _test_.* a.out
2227 fi
2228
2229 echo "$ac_t""$s51_cv_CXXggdb" 1>&6
2230
2231 if test "$s51_cv_CXXggdb" = "yes"; then
2232     if test "$CXXFLAGS"x = x ;then
2233         CXXFLAGS="-ggdb -O"
2234     else
2235         CXXFLAGS="$CXXFLAGS -ggdb"
2236     fi
2237 fi
2238
2239
2240 echo $ac_n "checking whether $CXX accepts -pipe""... $ac_c" 1>&6
2241 echo "configure:2242: checking whether $CXX accepts -pipe" >&5
2242 if eval "test \"`echo '$''{'s51_cv_CXXpipe'+set}'`\" = set"; then
2243   echo $ac_n "(cached) $ac_c" 1>&6
2244 else
2245   cat >_test_.c <<EOF
2246 #include <stdio.h>
2247 void main(void) {}
2248 EOF
2249 $CXX -v -pipe -c _test_.c 1>&5 2>&5
2250 if test "$?" = "0"; then
2251   s51_cv_CXXpipe="yes"
2252 else
2253   s51_cv_CXXpipe="no"
2254 fi
2255 rm -f _test_.* a.out
2256 fi
2257
2258 echo "$ac_t""$s51_cv_CXXpipe" 1>&6
2259
2260 if test "$s51_cv_CXXpipe" = "yes"; then
2261   CXXFLAGS="$CXXFLAGS -pipe"
2262 fi
2263
2264
2265 # Checks for typedefs, structures, and compiler characteristics.
2266 # ===========================================================================
2267
2268 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
2269 echo "configure:2270: checking return type of signal handlers" >&5
2270 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
2271   echo $ac_n "(cached) $ac_c" 1>&6
2272 else
2273   cat > conftest.$ac_ext <<EOF
2274 #line 2275 "configure"
2275 #include "confdefs.h"
2276 #include <sys/types.h>
2277 #include <signal.h>
2278 #ifdef signal
2279 #undef signal
2280 #endif
2281 #ifdef __cplusplus
2282 extern "C" void (*signal (int, void (*)(int)))(int);
2283 #else
2284 void (*signal ()) ();
2285 #endif
2286
2287 int main() {
2288 int i;
2289 ; return 0; }
2290 EOF
2291 if { (eval echo configure:2292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2292   rm -rf conftest*
2293   ac_cv_type_signal=void
2294 else
2295   echo "configure: failed program was:" >&5
2296   cat conftest.$ac_ext >&5
2297   rm -rf conftest*
2298   ac_cv_type_signal=int
2299 fi
2300 rm -f conftest*
2301 fi
2302
2303 echo "$ac_t""$ac_cv_type_signal" 1>&6
2304 cat >> confdefs.h <<EOF
2305 #define RETSIGTYPE $ac_cv_type_signal
2306 EOF
2307
2308
2309 echo $ac_n "checking size of char""... $ac_c" 1>&6
2310 echo "configure:2311: checking size of char" >&5
2311 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
2312   echo $ac_n "(cached) $ac_c" 1>&6
2313 else
2314   if test "$cross_compiling" = yes; then
2315     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2316 else
2317   cat > conftest.$ac_ext <<EOF
2318 #line 2319 "configure"
2319 #include "confdefs.h"
2320 #ifdef __cplusplus
2321 extern "C" void exit(int);
2322 #endif
2323 #include <stdio.h>
2324 main()
2325 {
2326   FILE *f=fopen("conftestval", "w");
2327   if (!f) exit(1);
2328   fprintf(f, "%d\n", sizeof(char));
2329   exit(0);
2330 }
2331 EOF
2332 if { (eval echo configure:2333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2333 then
2334   ac_cv_sizeof_char=`cat conftestval`
2335 else
2336   echo "configure: failed program was:" >&5
2337   cat conftest.$ac_ext >&5
2338   rm -fr conftest*
2339   ac_cv_sizeof_char=0
2340 fi
2341 rm -fr conftest*
2342 fi
2343
2344 fi
2345 echo "$ac_t""$ac_cv_sizeof_char" 1>&6
2346 cat >> confdefs.h <<EOF
2347 #define SIZEOF_CHAR $ac_cv_sizeof_char
2348 EOF
2349
2350
2351 echo $ac_n "checking size of short""... $ac_c" 1>&6
2352 echo "configure:2353: checking size of short" >&5
2353 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
2354   echo $ac_n "(cached) $ac_c" 1>&6
2355 else
2356   if test "$cross_compiling" = yes; then
2357     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2358 else
2359   cat > conftest.$ac_ext <<EOF
2360 #line 2361 "configure"
2361 #include "confdefs.h"
2362 #ifdef __cplusplus
2363 extern "C" void exit(int);
2364 #endif
2365 #include <stdio.h>
2366 main()
2367 {
2368   FILE *f=fopen("conftestval", "w");
2369   if (!f) exit(1);
2370   fprintf(f, "%d\n", sizeof(short));
2371   exit(0);
2372 }
2373 EOF
2374 if { (eval echo configure:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2375 then
2376   ac_cv_sizeof_short=`cat conftestval`
2377 else
2378   echo "configure: failed program was:" >&5
2379   cat conftest.$ac_ext >&5
2380   rm -fr conftest*
2381   ac_cv_sizeof_short=0
2382 fi
2383 rm -fr conftest*
2384 fi
2385
2386 fi
2387 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
2388 cat >> confdefs.h <<EOF
2389 #define SIZEOF_SHORT $ac_cv_sizeof_short
2390 EOF
2391
2392
2393 echo $ac_n "checking size of int""... $ac_c" 1>&6
2394 echo "configure:2395: checking size of int" >&5
2395 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
2396   echo $ac_n "(cached) $ac_c" 1>&6
2397 else
2398   if test "$cross_compiling" = yes; then
2399     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2400 else
2401   cat > conftest.$ac_ext <<EOF
2402 #line 2403 "configure"
2403 #include "confdefs.h"
2404 #ifdef __cplusplus
2405 extern "C" void exit(int);
2406 #endif
2407 #include <stdio.h>
2408 main()
2409 {
2410   FILE *f=fopen("conftestval", "w");
2411   if (!f) exit(1);
2412   fprintf(f, "%d\n", sizeof(int));
2413   exit(0);
2414 }
2415 EOF
2416 if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2417 then
2418   ac_cv_sizeof_int=`cat conftestval`
2419 else
2420   echo "configure: failed program was:" >&5
2421   cat conftest.$ac_ext >&5
2422   rm -fr conftest*
2423   ac_cv_sizeof_int=0
2424 fi
2425 rm -fr conftest*
2426 fi
2427
2428 fi
2429 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
2430 cat >> confdefs.h <<EOF
2431 #define SIZEOF_INT $ac_cv_sizeof_int
2432 EOF
2433
2434
2435 echo $ac_n "checking size of long""... $ac_c" 1>&6
2436 echo "configure:2437: checking size of long" >&5
2437 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
2438   echo $ac_n "(cached) $ac_c" 1>&6
2439 else
2440   if test "$cross_compiling" = yes; then
2441     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2442 else
2443   cat > conftest.$ac_ext <<EOF
2444 #line 2445 "configure"
2445 #include "confdefs.h"
2446 #ifdef __cplusplus
2447 extern "C" void exit(int);
2448 #endif
2449 #include <stdio.h>
2450 main()
2451 {
2452   FILE *f=fopen("conftestval", "w");
2453   if (!f) exit(1);
2454   fprintf(f, "%d\n", sizeof(long));
2455   exit(0);
2456 }
2457 EOF
2458 if { (eval echo configure:2459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2459 then
2460   ac_cv_sizeof_long=`cat conftestval`
2461 else
2462   echo "configure: failed program was:" >&5
2463   cat conftest.$ac_ext >&5
2464   rm -fr conftest*
2465   ac_cv_sizeof_long=0
2466 fi
2467 rm -fr conftest*
2468 fi
2469
2470 fi
2471 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
2472 cat >> confdefs.h <<EOF
2473 #define SIZEOF_LONG $ac_cv_sizeof_long
2474 EOF
2475
2476
2477 echo $ac_n "checking size of long long""... $ac_c" 1>&6
2478 echo "configure:2479: checking size of long long" >&5
2479 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
2480   echo $ac_n "(cached) $ac_c" 1>&6
2481 else
2482   if test "$cross_compiling" = yes; then
2483     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2484 else
2485   cat > conftest.$ac_ext <<EOF
2486 #line 2487 "configure"
2487 #include "confdefs.h"
2488 #ifdef __cplusplus
2489 extern "C" void exit(int);
2490 #endif
2491 #include <stdio.h>
2492 main()
2493 {
2494   FILE *f=fopen("conftestval", "w");
2495   if (!f) exit(1);
2496   fprintf(f, "%d\n", sizeof(long long));
2497   exit(0);
2498 }
2499 EOF
2500 if { (eval echo configure:2501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2501 then
2502   ac_cv_sizeof_long_long=`cat conftestval`
2503 else
2504   echo "configure: failed program was:" >&5
2505   cat conftest.$ac_ext >&5
2506   rm -fr conftest*
2507   ac_cv_sizeof_long_long=0
2508 fi
2509 rm -fr conftest*
2510 fi
2511
2512 fi
2513 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
2514 cat >> confdefs.h <<EOF
2515 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
2516 EOF
2517
2518
2519
2520 type_name()
2521 {
2522     if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
2523         echo "char"
2524         exit
2525     fi
2526     if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
2527         echo "short"
2528         exit
2529     fi
2530     if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
2531         echo "int"
2532         exit
2533     fi
2534     if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
2535         echo "long"
2536         exit
2537     fi
2538     if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
2539         echo "long long"
2540         exit
2541     fi
2542     echo "long long"
2543 }
2544
2545 echo $ac_n "checking type name for byte""... $ac_c" 1>&6
2546 echo "configure:2547: checking type name for byte" >&5
2547 TYPE_BYTE=`type_name 1`
2548 echo "$ac_t""$TYPE_BYTE" 1>&6
2549 echo $ac_n "checking type name for word""... $ac_c" 1>&6
2550 echo "configure:2551: checking type name for word" >&5
2551 TYPE_WORD=`type_name 2`
2552 echo "$ac_t""$TYPE_WORD" 1>&6
2553 echo $ac_n "checking type name for dword""... $ac_c" 1>&6
2554 echo "configure:2555: checking type name for dword" >&5
2555 TYPE_DWORD=`type_name 4`
2556 echo "$ac_t""$TYPE_DWORD" 1>&6
2557 cat >> confdefs.h <<EOF
2558 #define TYPE_BYTE $TYPE_BYTE
2559 EOF
2560
2561 cat >> confdefs.h <<EOF
2562 #define TYPE_WORD $TYPE_WORD
2563 EOF
2564
2565 cat >> confdefs.h <<EOF
2566 #define TYPE_DWORD $TYPE_DWORD
2567 EOF
2568
2569
2570 # Generating output files
2571 # ===========================================================================
2572
2573 trap '' 1 2 15
2574 cat > confcache <<\EOF
2575 # This file is a shell script that caches the results of configure
2576 # tests run on this system so they can be shared between configure
2577 # scripts and configure runs.  It is not useful on other systems.
2578 # If it contains results you don't want to keep, you may remove or edit it.
2579 #
2580 # By default, configure uses ./config.cache as the cache file,
2581 # creating it if it does not exist already.  You can give configure
2582 # the --cache-file=FILE option to use a different cache file; that is
2583 # what configure does when it calls configure scripts in
2584 # subdirectories, so they share the cache.
2585 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2586 # config.status only pays attention to the cache file if you give it the
2587 # --recheck option to rerun configure.
2588 #
2589 EOF
2590 # The following way of writing the cache mishandles newlines in values,
2591 # but we know of no workaround that is simple, portable, and efficient.
2592 # So, don't put newlines in cache variables' values.
2593 # Ultrix sh set writes to stderr and can't be redirected directly,
2594 # and sets the high bit in the cache file unless we assign to the vars.
2595 (set) 2>&1 |
2596   case `(ac_space=' '; set | grep ac_space) 2>&1` in
2597   *ac_space=\ *)
2598     # `set' does not quote correctly, so add quotes (double-quote substitution
2599     # turns \\\\ into \\, and sed turns \\ into \).
2600     sed -n \
2601       -e "s/'/'\\\\''/g" \
2602       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2603     ;;
2604   *)
2605     # `set' quotes correctly as required by POSIX, so do not add quotes.
2606     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2607     ;;
2608   esac >> confcache
2609 if cmp -s $cache_file confcache; then
2610   :
2611 else
2612   if test -w $cache_file; then
2613     echo "updating cache $cache_file"
2614     cat confcache > $cache_file
2615   else
2616     echo "not updating unwritable cache $cache_file"
2617   fi
2618 fi
2619 rm -f confcache
2620
2621 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2622
2623 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2624 # Let make expand exec_prefix.
2625 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2626
2627 # Any assignment to VPATH causes Sun make to only execute
2628 # the first set of double-colon rules, so remove it if not needed.
2629 # If there is a colon in the path, we need to keep it.
2630 if test "x$srcdir" = x.; then
2631   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
2632 fi
2633
2634 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2635
2636 DEFS=-DHAVE_CONFIG_H
2637
2638 # Without the "./", some shells look in PATH for config.status.
2639 : ${CONFIG_STATUS=./config.status}
2640
2641 echo creating $CONFIG_STATUS
2642 rm -f $CONFIG_STATUS
2643 cat > $CONFIG_STATUS <<EOF
2644 #! /bin/sh
2645 # Generated automatically by configure.
2646 # Run this file to recreate the current configuration.
2647 # This directory was configured as follows,
2648 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2649 #
2650 # $0 $ac_configure_args
2651 #
2652 # Compiler output produced by configure, useful for debugging
2653 # configure, is in ./config.log if it exists.
2654
2655 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2656 for ac_option
2657 do
2658   case "\$ac_option" in
2659   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2660     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2661     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2662   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2663     echo "$CONFIG_STATUS generated by autoconf version 2.13"
2664     exit 0 ;;
2665   -help | --help | --hel | --he | --h)
2666     echo "\$ac_cs_usage"; exit 0 ;;
2667   *) echo "\$ac_cs_usage"; exit 1 ;;
2668   esac
2669 done
2670
2671 ac_given_srcdir=$srcdir
2672 ac_given_INSTALL="$INSTALL"
2673
2674 trap 'rm -fr `echo "main.mk:main_in.mk
2675 sim.src/Makefile
2676 cmd.src/Makefile
2677 s51.src/Makefile
2678 avr.src/Makefile
2679 z80.src/Makefile
2680 gui.src/Makefile
2681 gui.src/serio.src/Makefile
2682 gui.src/portmon.src/Makefile
2683 doc/Makefile
2684  ddconfig.h:ddconfig_in.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2685 EOF
2686 cat >> $CONFIG_STATUS <<EOF
2687
2688 # Protect against being on the right side of a sed subst in config.status.
2689 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2690  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2691 $ac_vpsub
2692 $extrasub
2693 s%@SHELL@%$SHELL%g
2694 s%@CFLAGS@%$CFLAGS%g
2695 s%@CPPFLAGS@%$CPPFLAGS%g
2696 s%@CXXFLAGS@%$CXXFLAGS%g
2697 s%@FFLAGS@%$FFLAGS%g
2698 s%@DEFS@%$DEFS%g
2699 s%@LDFLAGS@%$LDFLAGS%g
2700 s%@LIBS@%$LIBS%g
2701 s%@exec_prefix@%$exec_prefix%g
2702 s%@prefix@%$prefix%g
2703 s%@program_transform_name@%$program_transform_name%g
2704 s%@bindir@%$bindir%g
2705 s%@sbindir@%$sbindir%g
2706 s%@libexecdir@%$libexecdir%g
2707 s%@datadir@%$datadir%g
2708 s%@sysconfdir@%$sysconfdir%g
2709 s%@sharedstatedir@%$sharedstatedir%g
2710 s%@localstatedir@%$localstatedir%g
2711 s%@libdir@%$libdir%g
2712 s%@includedir@%$includedir%g
2713 s%@oldincludedir@%$oldincludedir%g
2714 s%@infodir@%$infodir%g
2715 s%@mandir@%$mandir%g
2716 s%@AWK@%$AWK%g
2717 s%@VERSION@%$VERSION%g
2718 s%@VERSIONHI@%$VERSIONHI%g
2719 s%@VERSIONLO@%$VERSIONLO%g
2720 s%@VERSIONP@%$VERSIONP%g
2721 s%@CXX@%$CXX%g
2722 s%@CXXCPP@%$CXXCPP%g
2723 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2724 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
2725 s%@INSTALL_DATA@%$INSTALL_DATA%g
2726 s%@RANLIB@%$RANLIB%g
2727 s%@panel_ok@%$panel_ok%g
2728 s%@curses_ok@%$curses_ok%g
2729 s%@CURSES_LIBS@%$CURSES_LIBS%g
2730 s%@M_OR_MM@%$M_OR_MM%g
2731
2732 CEOF
2733 EOF
2734
2735 cat >> $CONFIG_STATUS <<\EOF
2736
2737 # Split the substitutions into bite-sized pieces for seds with
2738 # small command number limits, like on Digital OSF/1 and HP-UX.
2739 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2740 ac_file=1 # Number of current file.
2741 ac_beg=1 # First line for current file.
2742 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2743 ac_more_lines=:
2744 ac_sed_cmds=""
2745 while $ac_more_lines; do
2746   if test $ac_beg -gt 1; then
2747     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2748   else
2749     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2750   fi
2751   if test ! -s conftest.s$ac_file; then
2752     ac_more_lines=false
2753     rm -f conftest.s$ac_file
2754   else
2755     if test -z "$ac_sed_cmds"; then
2756       ac_sed_cmds="sed -f conftest.s$ac_file"
2757     else
2758       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2759     fi
2760     ac_file=`expr $ac_file + 1`
2761     ac_beg=$ac_end
2762     ac_end=`expr $ac_end + $ac_max_sed_cmds`
2763   fi
2764 done
2765 if test -z "$ac_sed_cmds"; then
2766   ac_sed_cmds=cat
2767 fi
2768 EOF
2769
2770 cat >> $CONFIG_STATUS <<EOF
2771
2772 CONFIG_FILES=\${CONFIG_FILES-"main.mk:main_in.mk
2773 sim.src/Makefile
2774 cmd.src/Makefile
2775 s51.src/Makefile
2776 avr.src/Makefile
2777 z80.src/Makefile
2778 gui.src/Makefile
2779 gui.src/serio.src/Makefile
2780 gui.src/portmon.src/Makefile
2781 doc/Makefile
2782 "}
2783 EOF
2784 cat >> $CONFIG_STATUS <<\EOF
2785 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2786   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2787   case "$ac_file" in
2788   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2789        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2790   *) ac_file_in="${ac_file}.in" ;;
2791   esac
2792
2793   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2794
2795   # Remove last slash and all that follows it.  Not all systems have dirname.
2796   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2797   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2798     # The file is in a subdirectory.
2799     test ! -d "$ac_dir" && mkdir "$ac_dir"
2800     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2801     # A "../" for each directory in $ac_dir_suffix.
2802     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2803   else
2804     ac_dir_suffix= ac_dots=
2805   fi
2806
2807   case "$ac_given_srcdir" in
2808   .)  srcdir=.
2809       if test -z "$ac_dots"; then top_srcdir=.
2810       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2811   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2812   *) # Relative path.
2813     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2814     top_srcdir="$ac_dots$ac_given_srcdir" ;;
2815   esac
2816
2817   case "$ac_given_INSTALL" in
2818   [/$]*) INSTALL="$ac_given_INSTALL" ;;
2819   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2820   esac
2821
2822   echo creating "$ac_file"
2823   rm -f "$ac_file"
2824   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2825   case "$ac_file" in
2826   *Makefile*) ac_comsub="1i\\
2827 # $configure_input" ;;
2828   *) ac_comsub= ;;
2829   esac
2830
2831   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2832   sed -e "$ac_comsub
2833 s%@configure_input@%$configure_input%g
2834 s%@srcdir@%$srcdir%g
2835 s%@top_srcdir@%$top_srcdir%g
2836 s%@INSTALL@%$INSTALL%g
2837 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2838 fi; done
2839 rm -f conftest.s*
2840
2841 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2842 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2843 #
2844 # ac_d sets the value in "#define NAME VALUE" lines.
2845 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
2846 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
2847 ac_dC='\3'
2848 ac_dD='%g'
2849 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2850 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2851 ac_uB='\([      ]\)%\1#\2define\3'
2852 ac_uC=' '
2853 ac_uD='\4%g'
2854 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2855 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2856 ac_eB='$%\1#\2define\3'
2857 ac_eC=' '
2858 ac_eD='%g'
2859
2860 if test "${CONFIG_HEADERS+set}" != set; then
2861 EOF
2862 cat >> $CONFIG_STATUS <<EOF
2863   CONFIG_HEADERS="ddconfig.h:ddconfig_in.h"
2864 EOF
2865 cat >> $CONFIG_STATUS <<\EOF
2866 fi
2867 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2868   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2869   case "$ac_file" in
2870   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2871        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2872   *) ac_file_in="${ac_file}.in" ;;
2873   esac
2874
2875   echo creating $ac_file
2876
2877   rm -f conftest.frag conftest.in conftest.out
2878   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2879   cat $ac_file_inputs > conftest.in
2880
2881 EOF
2882
2883 # Transform confdefs.h into a sed script conftest.vals that substitutes
2884 # the proper values into config.h.in to produce config.h.  And first:
2885 # Protect against being on the right side of a sed subst in config.status.
2886 # Protect against being in an unquoted here document in config.status.
2887 rm -f conftest.vals
2888 cat > conftest.hdr <<\EOF
2889 s/[\\&%]/\\&/g
2890 s%[\\$`]%\\&%g
2891 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2892 s%ac_d%ac_u%gp
2893 s%ac_u%ac_e%gp
2894 EOF
2895 sed -n -f conftest.hdr confdefs.h > conftest.vals
2896 rm -f conftest.hdr
2897
2898 # This sed command replaces #undef with comments.  This is necessary, for
2899 # example, in the case of _POSIX_SOURCE, which is predefined and required
2900 # on some systems where configure will not decide to define it.
2901 cat >> conftest.vals <<\EOF
2902 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2903 EOF
2904
2905 # Break up conftest.vals because some shells have a limit on
2906 # the size of here documents, and old seds have small limits too.
2907
2908 rm -f conftest.tail
2909 while :
2910 do
2911   ac_lines=`grep -c . conftest.vals`
2912   # grep -c gives empty output for an empty file on some AIX systems.
2913   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2914   # Write a limited-size here document to conftest.frag.
2915   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2916   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2917   echo 'CEOF
2918   sed -f conftest.frag conftest.in > conftest.out
2919   rm -f conftest.in
2920   mv conftest.out conftest.in
2921 ' >> $CONFIG_STATUS
2922   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2923   rm -f conftest.vals
2924   mv conftest.tail conftest.vals
2925 done
2926 rm -f conftest.vals
2927
2928 cat >> $CONFIG_STATUS <<\EOF
2929   rm -f conftest.frag conftest.h
2930   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
2931   cat conftest.in >> conftest.h
2932   rm -f conftest.in
2933   if cmp -s $ac_file conftest.h 2>/dev/null; then
2934     echo "$ac_file is unchanged"
2935     rm -f conftest.h
2936   else
2937     # Remove last slash and all that follows it.  Not all systems have dirname.
2938       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2939       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2940       # The file is in a subdirectory.
2941       test ! -d "$ac_dir" && mkdir "$ac_dir"
2942     fi
2943     rm -f $ac_file
2944     mv conftest.h $ac_file
2945   fi
2946 fi; done
2947
2948 EOF
2949 cat >> $CONFIG_STATUS <<EOF
2950
2951 EOF
2952 cat >> $CONFIG_STATUS <<\EOF
2953
2954 exit 0
2955 EOF
2956 chmod +x $CONFIG_STATUS
2957 rm -fr confdefs* $ac_clean_files
2958 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2959
2960
2961
2962 # End of configure/configure.in